From 525f24674e886e077ce985bd78ebcc8a95425578 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Tue, 18 Oct 2016 14:26:39 +0200 Subject: [PATCH] wxAuiManagerUpdatePerspectiveCaptions() update --- include/wxex/common.h | 6 +++--- src/framemanager.cpp | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/wxex/common.h b/include/wxex/common.h index d842b16..47e3914 100644 --- a/include/wxex/common.h +++ b/include/wxex/common.h @@ -24,14 +24,14 @@ /// /// wxExtend Version /// -#define wxEXTEND_VERSION 0x01050000 +#define wxEXTEND_VERSION 0x01050100 #define wxEXTEND_VERSION_MAJ 1 #define wxEXTEND_VERSION_MIN 5 -#define wxEXTEND_VERSION_REV 0 +#define wxEXTEND_VERSION_REV 1 #define wxEXTEND_VERSION_BUILD 0 -#define wxEXTEND_VERSION_STR "1.5" +#define wxEXTEND_VERSION_STR "1.5.1" #define wxEXTEND_BUILD_YEAR_STR "2016" #define wxExtendVersion "15" diff --git a/src/framemanager.cpp b/src/framemanager.cpp index 7f985bd..06afb78 100644 --- a/src/framemanager.cpp +++ b/src/framemanager.cpp @@ -24,7 +24,6 @@ bool WXEXTEND_API wxAuiManagerUpdatePerspectiveCaptions(wxAuiManager& mgr, wxString& perspective) { wxString input = perspective; - wxString output; wxString part; // check layout string version @@ -36,8 +35,10 @@ bool WXEXTEND_API wxAuiManagerUpdatePerspectiveCaptions(wxAuiManager& mgr, wxStr part.Trim(false); if (part != wxT("layout2")) return false; - output += part; - output += wxT('|'); + + wxString result; + result.Alloc(500); + result = wxT('layout2|'); // replace escaped characters so we can // split up the string easily @@ -60,8 +61,7 @@ bool WXEXTEND_API wxAuiManagerUpdatePerspectiveCaptions(wxAuiManager& mgr, wxStr if (pane_part.Left(9) == wxT("dock_size")) { - output += pane_part; - output += wxT('|'); + result += pane_part + wxT('|'); continue; } @@ -79,10 +79,10 @@ bool WXEXTEND_API wxAuiManagerUpdatePerspectiveCaptions(wxAuiManager& mgr, wxStr // Update caption. pane.caption = p.caption; - output += mgr.SavePaneInfo(pane); - output += wxT('|'); + // Re-generate and append pane info. + result += mgr.SavePaneInfo(pane) + wxT('|'); } - perspective = output; + perspective = result; return true; }