[Libreoffice-commits] .: Branch 'libreoffice-3-6' - sfx2/inc sfx2/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Nov 12 04:25:32 PST 2012


 sfx2/inc/sfx2/tabdlg.hxx      |    4 ++++
 sfx2/source/dialog/tabdlg.cxx |   19 +++++++++++++++----
 2 files changed, 19 insertions(+), 4 deletions(-)

New commits:
commit 6a2c81b9a5cfa80bbc05c7d2fdd7c634ed26ac82
Author: Travis Carter <bugs at traviswcarter.com>
Date:   Thu Jun 21 19:25:19 2012 -0500

    Related: fdo#38606 Properly store dialog's position and current page
    
    Dialog's position and current page weren't always being stored. Moved code from the destructor to SfxTabDialog::Ok() so that it will execute everytime Ok or Apply is clicked.
    
    (cherry picked from commit d800847be075dc7420e2655ba8167cc4f9436dc9)
    
    Change-Id: Iddee68a7b22749db50c8c78613be11c8ba5500c6

diff --git a/sfx2/inc/sfx2/tabdlg.hxx b/sfx2/inc/sfx2/tabdlg.hxx
index 36d7891..aa77164 100644
--- a/sfx2/inc/sfx2/tabdlg.hxx
+++ b/sfx2/inc/sfx2/tabdlg.hxx
@@ -119,6 +119,10 @@ protected:
     */
     bool PrepareLeaveCurrentPage();
 
+    /** save the position of the TabDialog and which tab page is the currently active one
+     */
+    void SavePosAndId();
+
 public:
     SfxTabDialog( Window* pParent, const ResId &rResId, const SfxItemSet * = 0,
                   sal_Bool bEditFmt = sal_False, const String *pUserButtonText = 0 );
diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx
index fe4e8be..10f30ca 100644
--- a/sfx2/source/dialog/tabdlg.cxx
+++ b/sfx2/source/dialog/tabdlg.cxx
@@ -468,10 +468,7 @@ SfxTabDialog::SfxTabDialog
 
 SfxTabDialog::~SfxTabDialog()
 {
-    // save settings (screen position and current page)
-    SvtViewOptions aDlgOpt( E_TABDIALOG, String::CreateFromInt32( nResId ) );
-    aDlgOpt.SetWindowState(OStringToOUString(GetWindowState(WINDOWSTATE_MASK_POS),RTL_TEXTENCODING_ASCII_US));
-    aDlgOpt.SetPageID( aTabCtrl.GetCurPageId() );
+    SavePosAndId();
 
     const sal_uInt16 nCount = pImpl->pData->Count();
     for ( sal_uInt16 i = 0; i < nCount; ++i )
@@ -877,6 +874,14 @@ SfxTabPage* SfxTabDialog::GetTabPage( sal_uInt16 nPageId ) const
     return NULL;
 }
 
+void SfxTabDialog::SavePosAndId()
+{
+    // save settings (screen position and current page)
+    SvtViewOptions aDlgOpt( E_TABDIALOG, String::CreateFromInt32( nResId ) );
+    aDlgOpt.SetWindowState(OStringToOUString(GetWindowState(WINDOWSTATE_MASK_POS),RTL_TEXTENCODING_ASCII_US));
+    aDlgOpt.SetPageID( aTabCtrl.GetCurPageId() );
+}
+
 // -----------------------------------------------------------------------
 
 short SfxTabDialog::Ok()
@@ -884,6 +889,10 @@ short SfxTabDialog::Ok()
 /*  [Description]
 
     Ok handler for the Dialogue.
+
+    Dialog's current location and current page are saved for the next time
+    the dialog is shown.
+
     The OutputSet is created and for each page this or the special OutputSet
     is set by calling the method <SfxTabPage::FillItemSet(SfxItemSet &)>, to
     insert the entered data by the user into the set.
@@ -895,6 +904,8 @@ short SfxTabDialog::Ok()
 */
 
 {
+    SavePosAndId(); //See fdo#38828 "Apply" resetting window position
+
     pImpl->bInOK = sal_True;
 
     if ( !pOutSet )


More information about the Libreoffice-commits mailing list