summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-06-26 14:31:12 +0100
committerCaolán McNamara <caolanm@redhat.com>2012-06-26 15:26:58 +0100
commit58548484f734596a43dffa2810812fee42252437 (patch)
tree1506f2c467dadf6166c81fb34e9371e184fbb31f /sfx2
parentd800847be075dc7420e2655ba8167cc4f9436dc9 (diff)
save tabdialog settings in dtor as well as ::Ok
Change-Id: Ia279c7cf6e319cba8ee185fd7158f7aa7b504008
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/inc/sfx2/tabdlg.hxx4
-rw-r--r--sfx2/source/dialog/tabdlg.cxx15
2 files changed, 15 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 5d8411842ddd..342dc47834f9 100644
--- a/sfx2/source/dialog/tabdlg.cxx
+++ b/sfx2/source/dialog/tabdlg.cxx
@@ -468,6 +468,8 @@ SfxTabDialog::SfxTabDialog
SfxTabDialog::~SfxTabDialog()
{
+ SavePosAndId();
+
const sal_uInt16 nCount = pImpl->pData->Count();
for ( sal_uInt16 i = 0; i < nCount; ++i )
{
@@ -871,6 +873,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()
@@ -893,10 +903,7 @@ short SfxTabDialog::Ok()
*/
{
- // 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(); //See fdo#38828 "Apply" resetting window position
pImpl->bInOK = sal_True;