[PATCH] Resolves Bug 35938: Saves caption separator text in caption dialog.

Jeff Aigner jaigner at setnine.com
Wed Jun 8 22:56:04 PDT 2011


A static String member was added to the SwCaptionDialog class to save the value of the separator text edit between uses.
---
 sw/source/ui/frmdlg/cption.cxx |    4 ++++
 sw/source/ui/inc/cption.hxx    |    1 +
 2 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/sw/source/ui/frmdlg/cption.cxx b/sw/source/ui/frmdlg/cption.cxx
index e6deb8c..12f6af7 100644
--- a/sw/source/ui/frmdlg/cption.cxx
+++ b/sw/source/ui/frmdlg/cption.cxx
@@ -112,6 +112,8 @@ public:
     String  GetCharacterStyle() const;
 };
 
+String SwCaptionDialog::our_aSepTextSave = String::CreateFromAscii(": "); // Caption separator text
+
 SwCaptionDialog::SwCaptionDialog( Window *pParent, SwView &rV ) :
 
     SvxStandardDialog( pParent, SW_RES(DLG_CAPTION) ),
@@ -282,6 +284,7 @@ SwCaptionDialog::SwCaptionDialog( Window *pParent, SwView &rV ) :
     FreeResource();
 
     CheckButtonWidth();
+    aSepEdit.SetText(our_aSepTextSave);
     aTextEdit.GrabFocus();
     DrawSample();
 }
@@ -308,6 +311,7 @@ void SwCaptionDialog::Apply()
     aOpt.CopyAttributes() = bCopyAttributes;
     aOpt.SetCharacterStyle( sCharacterStyle );
     rView.InsertCaption( &aOpt );
+    our_aSepTextSave = aSepEdit.GetText();
 }
 
 IMPL_LINK_INLINE_START( SwCaptionDialog, OptionHdl, Button*, pButton )
diff --git a/sw/source/ui/inc/cption.hxx b/sw/source/ui/inc/cption.hxx
index f23f4be..144f05c 100644
--- a/sw/source/ui/inc/cption.hxx
+++ b/sw/source/ui/inc/cption.hxx
@@ -118,6 +118,7 @@ class SwCaptionDialog : public SvxStandardDialog
     void    CheckButtonWidth();
     void    ApplyCaptionOrder(); //#i61007# order of captions 
 
+    static String our_aSepTextSave; // Save caption separator text
 public:
      SwCaptionDialog( Window *pParent, SwView &rV );
     ~SwCaptionDialog();
-- 
1.7.4.1


--------------040300060803020709030607--


More information about the LibreOffice mailing list