Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


Hello,

I'm new to contributing here, so greetings to all! Attached is a patch
for bug 35938. It changes the Picture Caption dialog to remember the
last-used value of the caption separator text.

Kind Regards,

Jeff Aigner
From b80eab85eb6288c8b5c08cbccd2cadc75943a8b6 Mon Sep 17 00:00:00 2001
From: Jeff Aigner <jaigner@setnine.com>
Date: Thu, 9 Jun 2011 00:56:04 -0500
Subject: [PATCH] Resolves Bug 35938: Saves caption separator text in caption dialog.

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


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.