more detail on my bug find

nute
2004-07-15
2004-07-17
  • nute

    nute - 2004-07-15

    First of all, this Notepad rocks! makes me want to get into coding some more!

    ok heres what I found in the source pretaining to my minor annoyance :
    http://sourceforge.net/tracker/index.php?func=detail&aid=991839&group_id=95717&atid=612382 I have obtained the src, I found in
    Notepad_plus.cpp,  Line 1676
    <code>
    {
        const int NB_VIEW = 2;
        ScintillaEditView * pScintillaArray[NB_VIEW];
        DocTabView * pDocTabArray[NB_VIEW];

        // the oder (1.current view 2.non current view) is important
        // to synchronize with "hideCurrentView" function
        pScintillaArray[0] = _pEditView;
        pScintillaArray[1] = getNonCurrentEditView();

        pDocTabArray[0] = _pDocTab;
        pDocTabArray[1] = getNonCurrentDocTab();

        for (int j = 0 ; j < NB_VIEW ; j++)
        {
            for (int i = (pScintillaArray[j]->getNbDoc()-1) ; i >= 0  ; i--)
            {
                Buffer & docBuf = pScintillaArray[j]->getBufferAt(i);
                docFileStaus fStatus = docBuf.checkFileState();
                pDocTabArray[j]->updateTabItem(i);

                if (fStatus == MODIFIED_FROM_OUTSIDE)
                {
                    if (doReloadOrNot(docBuf.getFileName()) == IDYES)
                    {
                        pDocTabArray[j]->activate(i);
                        reload(docBuf.getFileName());
                    }
                    docBuf.updatTimeStamp();
                }
                else if (fStatus == FILE_DELETED)
                {
                    if (doCloseOrNot(docBuf.getFileName()) == IDNO)
                    {
                        pDocTabArray[j]->activate(i);
                        //_pDocTab->closeCurrentDoc();
                        if ((pScintillaArray[j]->getNbDoc() == 1) && (_mainWindowStatus & TWO_VIEWS_MASK))
                        {
                            pDocTabArray[j]->closeCurrentDoc();
                            hideCurrentView();
                        }
                        else
                            pDocTabArray[j]->closeCurrentDoc();
                    }
                }
               
                bool isReadOnly = pScintillaArray[j]->isCurrentBufReadOnly();
                pScintillaArray[j]->execute(SCI_SETREADONLY, isReadOnly);
                //_pDocTab->updateCurrentTabItem();
            }
        }
    }
    </code>

    I can read a bit of this code, it seems that the bug would be in WinXP ,failing to bring the application forward, even though the dialog popup was answered.
    Maybe a solution would be to allow the focus of NPP when that dialog is answered, like when that particular ELSE is reached.  If I am not knowing what I talk about, let me know here, Im not anything near expert of C code

     
    • Don HO

      Don HO - 2004-07-17

      Hi nute,

      > it seems that the bug would be in WinXP ,
      > failing to bring the application forward,
      > even though the dialog popup was answered.

      I don't know if it's the bug of XP, I didn't try it out on the other os. But you're in the right path (the right function anyway).
      Indeed, I should test if NPP is minimized in this fuction. If so, I bring up NPP to the top.

      The correction will be in the next release.

      Don