From eacfac2d5eb938862a68e5ff83ffd46d2fa4aaca Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 30 Oct 2011 10:08:14 +0000 Subject: [PATCH] Fix return value of wxPersistentSplitter::RestoreValue(). 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 | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/include/wx/persist/splitter.h b/include/wx/persist/splitter.h index d80b378a4b..baba7646f0 100644 --- a/include/wx/persist/splitter.h +++ b/include/wx/persist/splitter.h @@ -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); - } + if ( !RestoreValue(wxPERSIST_SPLITTER_POSITION, &pos) ) + return false; - return false; + if ( pos == -1 ) + Get()->Unsplit(); + else + Get()->SetSashPosition(pos); + + return true; } virtual wxString GetKind() const { return wxPERSIST_SPLITTER_KIND; }