]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/persist/splitter.h
Fix wxPropertyGrid::GetPropertyRect when the last item is collapsed.
[wxWidgets.git] / include / wx / persist / splitter.h
index d80b378a4bf67e62acb4b70390a8657efd39f1c4..d8369c3783ace9cb469a757a4b82bcda8e8e49ce 100644 (file)
@@ -3,7 +3,6 @@
 // Purpose:     Persistence support for wxSplitterWindow.
 // Author:      Vadim Zeitlin
 // Created:     2011-08-31
-// RCS-ID:      $Id: wxhead.h,v 1.12 2010-04-22 12:44:51 zeitlin Exp $
 // Copyright:   (c) 2011 Vadim Zeitlin <vadim@wxwidgets.org>
 // Licence:     wxWindows licence
 ///////////////////////////////////////////////////////////////////////////////
@@ -47,15 +46,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; }