Author Topic: Another bug  (Read 3836 times)

sethjackson

  • Guest
Another bug
« on: December 22, 2006, 09:24:54 pm »
Here is how to reproduce.

1. File -> New -> Empty file
2. If C::B asks you to add the file to the active project hit no
3. File -> Save
4. Hit cancel in the Save as dialog
5. Bingo

Now here is my one liner HACK fix. This IS NOT an acceptable way to fix the bug.....

Code
Index: src/sdk/cbeditor.cpp
===================================================================
--- src/sdk/cbeditor.cpp (revision 3413)
+++ src/sdk/cbeditor.cpp (working copy)
@@ -1267,7 +1267,7 @@
     dlg->SetFilterIndex(StoredIndex);
     PlaceWindow(dlg);
     if (dlg->ShowModal() != wxID_OK)
-        return false;
+        return true;
     m_Filename = dlg->GetPath();
     LOGSTREAM << m_Filename << _T('\n');
     fname.Assign(m_Filename);


If you want to know why this "works" trace through from MainFrame::OnFileSave()....... Which leads to EditorManager::SaveActive().

I'm sure a dev has a good way to fix this, but I can't think of one right now. :P
« Last Edit: December 22, 2006, 09:46:30 pm by sethjackson »

Offline Der Meister

  • Regular
  • ***
  • Posts: 307
Re: Another bug
« Reply #1 on: December 22, 2006, 09:41:35 pm »
This patch pretends that the file was saved correctly in order to suppres the annoying "The file could not be saved" message box? Well, then it is really a hack  :shock:
Real Programmers don't comment their code. If it was hard to write, it should be hard to understand.
Real Programmers don't write in BASIC. Actually, no programmers write in BASIC, after the age of 12.

sethjackson

  • Guest
Re: Another bug
« Reply #2 on: December 22, 2006, 09:45:24 pm »
This patch pretends that the file was saved correctly in order to suppres the annoying "The file could not be saved" message box? Well, then it is really a hack  :shock:

Yeah. That is why I bolded hack:P

EDIT:

Ok hopefully it is more clear now. ;)
« Last Edit: December 22, 2006, 09:47:28 pm by sethjackson »