News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

reparse project or reparse file does not woks any more

Started by ollydbg, November 02, 2011, 03:18:57 PM

Previous topic - Next topic

ollydbg

I just found that in rev 6546(trunk, build my self), in the project tree, If I right mouse click, and select "reparse this project" or "reparse this file",  both of them does not work, any one can reproduce this bug? I have also tried the latest nightly build, and looks like the bug is still there.

Thanks.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

ollydbg

It looks like:
void NativeParser::ReparseSelectedProject()
{
    wxTreeCtrl* tree = Manager::Get()->GetProjectManager()->GetTree();
    if (!tree)
        return;

    wxTreeItemId treeItem =  tree->GetSelection();
    if (!treeItem.IsOk())
        return;

    const FileTreeData* data = static_cast<FileTreeData*>(tree->GetItemData(treeItem));
    if (!data)
        return;

    if (data->GetKind() == FileTreeData::ftdkProject)
    {
        cbProject* project = data->GetProject();
        if (project)
        {
            DeleteParser(project);
            CreateParser(project);
        }
    }
}


Then, we always return from this:

    wxTreeItemId treeItem =  tree->GetSelection();
    if (!treeItem.IsOk())
        return;

Why?
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

oBFusCATed

Because the selection is not valid...
Do you have selection in the tree control?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

ollydbg

Quote from: oBFusCATed on November 02, 2011, 03:27:37 PM
Because the selection is not valid...
Do you have selection in the tree control?
Yes, I have select the project(cbp), and do mouse right click. So, I'm sure it was selected.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.