Kaydet (Commit) 58548484 authored tarafından Caolán McNamara's avatar Caolán McNamara

save tabdialog settings in dtor as well as ::Ok

Change-Id: Ia279c7cf6e319cba8ee185fd7158f7aa7b504008
üst d800847b
...@@ -119,6 +119,10 @@ protected: ...@@ -119,6 +119,10 @@ protected:
*/ */
bool PrepareLeaveCurrentPage(); bool PrepareLeaveCurrentPage();
/** save the position of the TabDialog and which tab page is the currently active one
*/
void SavePosAndId();
public: public:
SfxTabDialog( Window* pParent, const ResId &rResId, const SfxItemSet * = 0, SfxTabDialog( Window* pParent, const ResId &rResId, const SfxItemSet * = 0,
sal_Bool bEditFmt = sal_False, const String *pUserButtonText = 0 ); sal_Bool bEditFmt = sal_False, const String *pUserButtonText = 0 );
......
...@@ -468,6 +468,8 @@ SfxTabDialog::SfxTabDialog ...@@ -468,6 +468,8 @@ SfxTabDialog::SfxTabDialog
SfxTabDialog::~SfxTabDialog() SfxTabDialog::~SfxTabDialog()
{ {
SavePosAndId();
const sal_uInt16 nCount = pImpl->pData->Count(); const sal_uInt16 nCount = pImpl->pData->Count();
for ( sal_uInt16 i = 0; i < nCount; ++i ) for ( sal_uInt16 i = 0; i < nCount; ++i )
{ {
...@@ -871,6 +873,14 @@ SfxTabPage* SfxTabDialog::GetTabPage( sal_uInt16 nPageId ) const ...@@ -871,6 +873,14 @@ SfxTabPage* SfxTabDialog::GetTabPage( sal_uInt16 nPageId ) const
return NULL; 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() short SfxTabDialog::Ok()
...@@ -893,10 +903,7 @@ short SfxTabDialog::Ok() ...@@ -893,10 +903,7 @@ short SfxTabDialog::Ok()
*/ */
{ {
// save settings (screen position and current page) SavePosAndId(); //See fdo#38828 "Apply" resetting window position
SvtViewOptions aDlgOpt( E_TABDIALOG, String::CreateFromInt32( nResId ) );
aDlgOpt.SetWindowState(OStringToOUString(GetWindowState(WINDOWSTATE_MASK_POS),RTL_TEXTENCODING_ASCII_US));
aDlgOpt.SetPageID( aTabCtrl.GetCurPageId() );
pImpl->bInOK = sal_True; pImpl->bInOK = sal_True;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment