diff options
author | Travis Carter <bugs@traviswcarter.com> | 2012-06-21 19:25:19 -0500 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-11-12 12:24:40 +0000 |
commit | 6a2c81b9a5cfa80bbc05c7d2fdd7c634ed26ac82 (patch) | |
tree | 1364ded79dbe0af33c0fd51cc036870c99e4c382 | |
parent | 7bb3480f5428c5925e5fa11bfdaf7ded784e2976 (diff) |
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
-rw-r--r-- | sfx2/inc/sfx2/tabdlg.hxx | 4 | ||||
-rw-r--r-- | sfx2/source/dialog/tabdlg.cxx | 19 |
2 files changed, 19 insertions, 4 deletions
diff --git a/sfx2/inc/sfx2/tabdlg.hxx b/sfx2/inc/sfx2/tabdlg.hxx index 36d78911a649..aa77164ccf44 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 fe4e8be65a8c..10f30ca03f8d 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 ) |