diff options
author | Maxim Monastirsky <momonasmon@gmail.com> | 2014-11-23 10:19:40 +0200 |
---|---|---|
committer | Maxim Monastirsky <momonasmon@gmail.com> | 2014-11-24 14:44:57 +0200 |
commit | d94a5c50529e348b773e3494721d2353f86b1b4e (patch) | |
tree | 5d759fca5339dacc78c031adb99fb318b1d24344 | |
parent | 2af68258f1c6d7a77226475ee48e28357262fda8 (diff) |
fdo#86546 Open the right tab for more bullets and numbering
Change-Id: Ib8dda6eab89c92fa9bea98e3570896ea02692585
(cherry picked from commit cb6ced50c11ea71e5655c46e49f17f3b5921f526)
-rw-r--r-- | sd/source/ui/func/fuolbull.cxx | 5 | ||||
-rw-r--r-- | svx/sdi/svx.sdi | 2 | ||||
-rw-r--r-- | svx/source/tbxctrls/bulletsnumbering.cxx | 26 | ||||
-rw-r--r-- | sw/source/uibase/shells/txtnum.cxx | 3 |
4 files changed, 30 insertions, 6 deletions
diff --git a/sd/source/ui/func/fuolbull.cxx b/sd/source/ui/func/fuolbull.cxx index aa19030e00b3..9888738c46ba 100644 --- a/sd/source/ui/func/fuolbull.cxx +++ b/sd/source/ui/func/fuolbull.cxx @@ -68,8 +68,9 @@ void FuOutlineBullet::DoExecute( SfxRequest& rReq ) } const SfxItemSet* pArgs = rReq.GetArgs(); + SFX_ITEMSET_ARG( pArgs, pPageItem, SfxStringItem, FN_PARAM_1, false ); - if( !pArgs ) + if ( !pArgs || pPageItem ) { // fill ItemSet for Dialog SfxItemSet aEditAttr( mpDoc->GetPool() ); @@ -84,6 +85,8 @@ void FuOutlineBullet::DoExecute( SfxRequest& rReq ) boost::scoped_ptr<SfxAbstractTabDialog> pDlg(pFact ? pFact->CreateSdOutlineBulletTabDlg( NULL, &aNewAttr, mpView ) : 0); if( pDlg ) { + if ( pPageItem ) + pDlg->SetCurPageId( OUStringToOString( pPageItem->GetValue(), RTL_TEXTENCODING_UTF8 ) ); sal_uInt16 nResult = pDlg->Execute(); switch( nResult ) diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi index 9691ba578622..565ee340d1f2 100644 --- a/svx/sdi/svx.sdi +++ b/svx/sdi/svx.sdi @@ -7918,7 +7918,7 @@ SvxOrphansItem Orphan SID_ATTR_PARA_ORPHANS SfxVoidItem OutlineBullet SID_OUTLINE_BULLET -() +(SfxStringItem Page FN_PARAM_1) [ /* flags: */ AutoUpdate = FALSE, diff --git a/svx/source/tbxctrls/bulletsnumbering.cxx b/svx/source/tbxctrls/bulletsnumbering.cxx index 3f848c274fe7..bc47a66ec219 100644 --- a/svx/source/tbxctrls/bulletsnumbering.cxx +++ b/svx/source/tbxctrls/bulletsnumbering.cxx @@ -34,15 +34,17 @@ #define NUM_PAGETYPE_BULLET 0 #define NUM_PAGETYPE_SINGLENUM 1 +class NumberingToolBoxControl; + class NumberingPopup : public svtools::ToolbarMenu { bool mbBulletItem; - svt::ToolboxController& mrController; + NumberingToolBoxControl& mrController; SvxNumValueSet* mpValueSet; DECL_LINK( VSSelectHdl, void * ); public: - NumberingPopup( svt::ToolboxController& rController, + NumberingPopup( NumberingToolBoxControl& rController, const css::uno::Reference< css::frame::XFrame >& rFrame, vcl::Window* pParent, bool bBulletItem ); @@ -57,6 +59,7 @@ class NumberingToolBoxControl : public svt::PopupWindowController public: NumberingToolBoxControl( const css::uno::Reference< css::uno::XComponentContext >& rxContext ); virtual vcl::Window* createPopupWindow( vcl::Window* pParent ) SAL_OVERRIDE; + bool IsInImpressDraw(); // XStatusListener virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& rEvent ) @@ -76,7 +79,7 @@ public: }; //class NumberingPopup -NumberingPopup::NumberingPopup( svt::ToolboxController& rController, +NumberingPopup::NumberingPopup( NumberingToolBoxControl& rController, const css::uno::Reference< css::frame::XFrame >& rFrame, vcl::Window* pParent, bool bBulletItem ) : ToolbarMenu( rFrame, pParent, WB_STDPOPUP ), @@ -164,7 +167,16 @@ IMPL_LINK( NumberingPopup, VSSelectHdl, void *, pControl ) } else if ( getSelectedEntryId() == 1 ) { - css::uno::Sequence< css::beans::PropertyValue > aArgs( 0 ); + OUString aPageName; + if ( mrController.IsInImpressDraw() ) + aPageName = "customize"; + else + // Writer variants + aPageName = "options"; + + css::uno::Sequence< css::beans::PropertyValue > aArgs( 1 ); + aArgs[0].Name = "Page"; + aArgs[0].Value <<= aPageName; mrController.dispatchCommand( ".uno:OutlineBullet", aArgs ); } @@ -184,6 +196,12 @@ vcl::Window* NumberingToolBoxControl::createPopupWindow( vcl::Window* pParent ) return new NumberingPopup( *this, m_xFrame, pParent, mbBulletItem ); } +bool NumberingToolBoxControl::IsInImpressDraw() +{ + return ( m_sModuleName == "com.sun.star.presentation.PresentationDocument" || + m_sModuleName == "com.sun.star.drawing.DrawingDocument" ); +} + void SAL_CALL NumberingToolBoxControl::statusChanged( const css::frame::FeatureStateEvent& rEvent ) throw ( css::uno::RuntimeException, std::exception ) { diff --git a/sw/source/uibase/shells/txtnum.cxx b/sw/source/uibase/shells/txtnum.cxx index 79fa813b334a..359ff14ec4ef 100644 --- a/sw/source/uibase/shells/txtnum.cxx +++ b/sw/source/uibase/shells/txtnum.cxx @@ -186,6 +186,9 @@ void SwTextShell::ExecEnterNum(SfxRequest &rReq) boost::scoped_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateSwTabDialog( DLG_SVXTEST_NUM_BULLET, GetView().GetWindow(), &aSet, GetShell())); OSL_ENSURE(pDlg, "Dialog creation failed!"); + SFX_REQUEST_ARG( rReq, pPageItem, SfxStringItem, FN_PARAM_1, false ); + if ( pPageItem ) + pDlg->SetCurPageId( OUStringToOString( pPageItem->GetValue(), RTL_TEXTENCODING_UTF8 ) ); const short nRet = pDlg->Execute(); const SfxPoolItem* pItem; if ( RET_OK == nRet ) |