]> git.saurik.com Git - wxWidgets.git/commitdiff
Fix return value of wxPersistentSplitter::RestoreValue().
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 30 Oct 2011 10:08:14 +0000 (10:08 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 30 Oct 2011 10:08:14 +0000 (10:08 +0000)
It used to always return false which didn't allow the code using to decide
whether the default splitter position should be used or not.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69582 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/persist/splitter.h

index d80b378a4bf67e62acb4b70390a8657efd39f1c4..baba7646f07820781e5176e93946841551772dcd 100644 (file)
@@ -47,15 +47,15 @@ public:
     virtual bool Restore()
     {
         int pos;
-        if ( RestoreValue(wxPERSIST_SPLITTER_POSITION, &pos) )
-        {
-            if ( pos == -1 )
-                Get()->Unsplit();
-            else
-                Get()->SetSashPosition(pos);
-        }
-
-        return false;
+        if ( !RestoreValue(wxPERSIST_SPLITTER_POSITION, &pos) )
+            return false;
+
+        if ( pos == -1 )
+            Get()->Unsplit();
+        else
+            Get()->SetSashPosition(pos);
+
+        return true;
     }
 
     virtual wxString GetKind() const { return wxPERSIST_SPLITTER_KIND; }