diff options
author | Kohei Yoshida <kyoshida@novell.com> | 2010-10-05 10:28:46 -0400 |
---|---|---|
committer | Kohei Yoshida <kyoshida@novell.com> | 2010-10-05 10:28:46 -0400 |
commit | e0185db43409456a5ccf47bd1f879888a5b04783 (patch) | |
tree | 1bedf6cde707f7f502439a237bc020b9293649d2 /sfx2 | |
parent | 2a154fcf9cea7f9d0c056368a66314ee89d34456 (diff) |
Ported calc-formula-variable-sep-config-check-sfx2.diff from ooo-build.
This adds a method that gets called when the user clicks OK to dismiss
the Options dialog. This is used in order to handle conflicting argument
separator settings wrt locale-specific decimal separators.
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/inc/sfx2/objsh.hxx | 7 | ||||
-rw-r--r-- | sfx2/source/appl/appserv.cxx | 8 | ||||
-rw-r--r-- | sfx2/source/doc/objstor.cxx | 16 | ||||
-rw-r--r-- | sfx2/source/doc/objxtor.cxx | 1 | ||||
-rw-r--r-- | sfx2/source/inc/objshimp.hxx | 3 |
5 files changed, 33 insertions, 2 deletions
diff --git a/sfx2/inc/sfx2/objsh.hxx b/sfx2/inc/sfx2/objsh.hxx index e392535f4155..1073a685f07f 100644 --- a/sfx2/inc/sfx2/objsh.hxx +++ b/sfx2/inc/sfx2/objsh.hxx @@ -346,6 +346,13 @@ public: virtual sal_Bool SwitchPersistance( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage ); virtual void UpdateLinks(); + /** + * Called when the Options dialog is dismissed with the OK button, to + * handle potentially conflicting option settings. + */ + virtual void CheckConfigOptions(); + sal_Bool IsConfigOptionsChecked() const; + void SetConfigOptionsChecked( sal_Bool bChecked ); // called for a few slots like SID_SAVE[AS]DOC, SID_PRINTDOC[DIRECT], derived classes may abort the action virtual sal_Bool QuerySlotExecutable( USHORT nSlotId ); diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index e64659103969..c41f92ce66ad 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -966,11 +966,17 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) { VclAbstractDialog* pDlg = pFact->CreateFrameDialog( NULL, xFrame, rReq.GetSlot(), sPageURL ); - pDlg->Execute(); + short nRet = pDlg->Execute(); delete pDlg; SfxViewFrame* pView = SfxViewFrame::GetFirst(); while ( pView ) { + if (nRet == RET_OK) + { + SfxObjectShell* pObjSh = pView->GetObjectShell(); + if (pObjSh) + pObjSh->SetConfigOptionsChecked(false); + } pView->GetBindings().InvalidateAll(FALSE); pView = SfxViewFrame::GetNext( *pView ); } diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index 60b7f484fff4..bc8b23d726fb 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -3714,6 +3714,22 @@ void SfxObjectShell::UpdateLinks() { } +void SfxObjectShell::CheckConfigOptions() +{ + // not handled. Each app's shell needs to overwrite this method to add handler. + SetConfigOptionsChecked(true); +} + +sal_Bool SfxObjectShell::IsConfigOptionsChecked() const +{ + return pImp->m_bConfigOptionsChecked; +} + +void SfxObjectShell::SetConfigOptionsChecked( sal_Bool bChecked ) +{ + pImp->m_bConfigOptionsChecked = bChecked; +} + sal_Bool SfxObjectShell::QuerySaveSizeExceededModules_Impl( const uno::Reference< task::XInteractionHandler >& xHandler ) { if ( !HasBasic() ) diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx index b7567b89f02f..d6b9a6edb0eb 100644 --- a/sfx2/source/doc/objxtor.cxx +++ b/sfx2/source/doc/objxtor.cxx @@ -225,6 +225,7 @@ SfxObjectShell_Impl::SfxObjectShell_Impl( SfxObjectShell& _rDocShell ) ,bSaveVersionOnClose( sal_False ) ,m_bSharedXMLFlag( sal_False ) ,m_bAllowShareControlFileClean( sal_True ) + ,m_bConfigOptionsChecked( sal_False ) ,lErr(ERRCODE_NONE) ,nEventId ( 0) ,pReloadTimer ( 0) diff --git a/sfx2/source/inc/objshimp.hxx b/sfx2/source/inc/objshimp.hxx index b5087fb46294..10a5b09e6f2c 100644 --- a/sfx2/source/inc/objshimp.hxx +++ b/sfx2/source/inc/objshimp.hxx @@ -108,7 +108,8 @@ struct SfxObjectShell_Impl : public ::sfx2::IMacroDocumentAccess bUseUserData:1, bSaveVersionOnClose:1, m_bSharedXMLFlag:1, // whether the flag should be stored in xml file - m_bAllowShareControlFileClean:1; // whether the flag should be stored in xml file + m_bAllowShareControlFileClean:1, // whether the flag should be stored in xml file + m_bConfigOptionsChecked:1; // whether or not the user options are checked after the Options dialog is closed. IndexBitSet aBitSet; sal_uInt32 lErr; |