Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

Another bug

(1/1)

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


--- 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);


--- End code ---

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:

sethjackson:

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

--- End quote ---

Yeah. That is why I bolded hack.  :P

EDIT:

Ok hopefully it is more clear now. ;)

Navigation

[0] Message Index

Go to full version