News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

Another bug

Started by sethjackson, December 22, 2006, 09:24:54 PM

Previous topic - Next topic

sethjackson

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.....


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

Der Meister

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

#2
Quote from: Der Meister 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:

Yeah. That is why I bolded hack:P

EDIT:

Ok hopefully it is more clear now. ;)