diff --git a/include/svx/tbcontrl.hxx b/include/svx/tbcontrl.hxx index 1067fa0bd628..7c19420642ec 100644 --- a/include/svx/tbcontrl.hxx +++ b/include/svx/tbcontrl.hxx @@ -254,17 +254,6 @@ public: void setColorSelectFunction(const ColorSelectFunction& aColorSelectFunction); }; -class SVX_DLLPUBLIC SvxFrameLineStyleToolBoxControl : public SfxToolBoxControl -{ -public: - SFX_DECL_TOOLBOX_CONTROL(); - SvxFrameLineStyleToolBoxControl(sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rToolBox); - - virtual VclPtr CreatePopupWindow() override; - virtual void StateChanged(sal_uInt16 nSID, SfxItemState eState, - const SfxPoolItem* pState) override; -}; - class SVX_DLLPUBLIC SvxSimpleUndoRedoController : public SfxToolBoxControl { private: diff --git a/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu b/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu index 9f0e3ec9e94d..73f9d17037b1 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu @@ -1082,7 +1082,7 @@ com.sun.star.comp.sfx2.ClassificationCategoriesController - + .uno:SetBorderStyle @@ -1093,6 +1093,17 @@ com.sun.star.comp.svx.FrameToolBoxControl + + + .uno:LineStyle + + + + + + com.sun.star.comp.svx.FrameToolBoxControl + + .uno:FontColor diff --git a/sc/source/ui/app/scdll.cxx b/sc/source/ui/app/scdll.cxx index abc587c0e333..4e249d308004 100644 --- a/sc/source/ui/app/scdll.cxx +++ b/sc/source/ui/app/scdll.cxx @@ -167,7 +167,6 @@ void ScDLL::Init() SvxColorToolBoxControl ::RegisterControl(SID_ATTR_CHAR_COLOR, pMod); SvxColorToolBoxControl ::RegisterControl(SID_BACKGROUND_COLOR, pMod); SvxColorToolBoxControl ::RegisterControl(SID_ATTR_CHAR_BACK_COLOR, pMod); - SvxFrameLineStyleToolBoxControl ::RegisterControl(SID_FRAME_LINESTYLE, pMod); SvxColorToolBoxControl ::RegisterControl(SID_FRAME_LINECOLOR, pMod); SvxClipBoardControl ::RegisterControl(SID_PASTE, pMod ); SvxUndoRedoControl ::RegisterControl(SID_UNDO, pMod ); diff --git a/sd/source/ui/app/sddll.cxx b/sd/source/ui/app/sddll.cxx index 035fda3dd321..41fed944a24c 100644 --- a/sd/source/ui/app/sddll.cxx +++ b/sd/source/ui/app/sddll.cxx @@ -235,7 +235,6 @@ void SdDLL::RegisterControllers(SdModule* pMod) XmlSecStatusBarControl::RegisterControl( SID_SIGNATURE, pMod ); SdTemplateControl::RegisterControl( SID_STATUS_LAYOUT, pMod ); SvxTableToolBoxControl::RegisterControl(SID_INSERT_TABLE, pMod ); - SvxFrameLineStyleToolBoxControl::RegisterControl(SID_FRAME_LINESTYLE, pMod ); SvxColorToolBoxControl::RegisterControl(SID_FRAME_LINECOLOR, pMod ); SvxTbxCtlDraw::RegisterControl(SID_INSERT_DRAW, pMod ); diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index 220146db6137..3b457796feea 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -115,7 +115,6 @@ using namespace ::com::sun::star::lang; SFX_IMPL_TOOLBOX_CONTROL( SvxStyleToolBoxControl, SfxTemplateItem ); SFX_IMPL_TOOLBOX_CONTROL( SvxFontNameToolBoxControl, SvxFontItem ); -SFX_IMPL_TOOLBOX_CONTROL( SvxFrameLineStyleToolBoxControl, SvxLineItem ); SFX_IMPL_TOOLBOX_CONTROL( SvxSimpleUndoRedoController, SfxStringItem ); SFX_IMPL_TOOLBOX_CONTROL( SvxCurrencyToolBoxControl, SfxBoolItem ); @@ -270,10 +269,11 @@ public: virtual void DataChanged( const DataChangedEvent& rDCEvt ) override; }; -class SvxLineWindow_Impl : public SfxPopupWindow +class SvxLineWindow_Impl : public svtools::ToolbarPopup { private: VclPtr m_aLineStyleLb; + svt::ToolboxController& m_rController; bool m_bIsWriter; DECL_LINK( SelectHdl, ListBox&, void ); @@ -282,9 +282,9 @@ protected: virtual void Resize() override; virtual void GetFocus() override; public: - SvxLineWindow_Impl( sal_uInt16 nId, const Reference< XFrame >& rFrame, vcl::Window* pParentWindow ); + SvxLineWindow_Impl( svt::ToolboxController& rController, vcl::Window* pParentWindow ); virtual ~SvxLineWindow_Impl() override { disposeOnce(); } - virtual void dispose() override { m_aLineStyleLb.disposeAndClear(); SfxPopupWindow::dispose(); } + virtual void dispose() override { m_aLineStyleLb.disposeAndClear(); ToolbarPopup::dispose(); } }; class SvxCurrencyToolBoxControl; @@ -1928,14 +1928,14 @@ void SvxCurrencyList_Impl::dispose() SfxPopupWindow::dispose(); } -SvxLineWindow_Impl::SvxLineWindow_Impl( sal_uInt16 nId, const Reference< XFrame >& rFrame, vcl::Window* pParentWindow ) : - - SfxPopupWindow( nId, rFrame, pParentWindow, WinBits( WB_STDPOPUP | WB_OWNERDRAWDECORATION | WB_AUTOSIZE ) ), - m_aLineStyleLb( VclPtr::Create(this) ) +SvxLineWindow_Impl::SvxLineWindow_Impl( svt::ToolboxController& rController, vcl::Window* pParentWindow ) : + ToolbarPopup( rController.getFrameInterface(), pParentWindow, WB_STDPOPUP | WB_MOVEABLE | WB_CLOSEABLE ), + m_aLineStyleLb( VclPtr::Create(this) ), + m_rController( rController ) { try { - Reference< lang::XServiceInfo > xServices( rFrame->getController()->getModel(), UNO_QUERY_THROW ); + Reference< lang::XServiceInfo > xServices( rController.getFrameInterface()->getController()->getModel(), UNO_QUERY_THROW ); m_bIsWriter = xServices->supportsService("com.sun.star.text.TextDocument"); } catch(const uno::Exception& ) @@ -2026,9 +2026,7 @@ IMPL_LINK_NOARG(SvxLineWindow_Impl, SelectHdl, ListBox&, void) aLineItem.QueryValue( a, m_bIsWriter ? CONVERT_TWIPS : 0 ); aArgs[0].Value = a; - SfxToolBoxControl::Dispatch( Reference< XDispatchProvider >( GetFrame()->getController(), UNO_QUERY ), - ".uno:LineStyle", - aArgs ); + m_rController.dispatchCommand( ".uno:LineStyle", aArgs ); } void SvxLineWindow_Impl::Resize() @@ -2929,6 +2927,9 @@ void SvxFrameToolBoxControl::initialize( const css::uno::Sequence< css::uno::Any VclPtr SvxFrameToolBoxControl::createPopupWindow( vcl::Window* pParent ) { + if ( m_aCommandURL == ".uno:LineStyle" ) + return VclPtr::Create( *this, pParent ); + return VclPtr::Create( *this, pParent ); } @@ -2952,40 +2953,6 @@ com_sun_star_comp_svx_FrameToolBoxControl_get_implementation( return cppu::acquire( new SvxFrameToolBoxControl( rContext ) ); } -SvxFrameLineStyleToolBoxControl::SvxFrameLineStyleToolBoxControl( - sal_uInt16 nSlotId, - sal_uInt16 nId, - ToolBox& rTbx ) - - : SfxToolBoxControl( nSlotId, nId, rTbx ) -{ - rTbx.SetItemBits( nId, ToolBoxItemBits::DROPDOWNONLY | rTbx.GetItemBits( nId ) ); -} - -VclPtr SvxFrameLineStyleToolBoxControl::CreatePopupWindow() -{ - VclPtr pLineWin = VclPtr::Create( GetSlotId(), m_xFrame, &GetToolBox() ); - pLineWin->StartPopupMode( &GetToolBox(), - FloatWinPopupFlags::GrabFocus | - FloatWinPopupFlags::AllowTearOff | - FloatWinPopupFlags::NoAppFocusClose ); - SetPopupWindow( pLineWin ); - - return pLineWin; -} - -void SvxFrameLineStyleToolBoxControl::StateChanged( - sal_uInt16 , SfxItemState eState, const SfxPoolItem* ) -{ - sal_uInt16 nId = GetId(); - ToolBox& rTbx = GetToolBox(); - - rTbx.EnableItem( nId, SfxItemState::DISABLED != eState ); - rTbx.SetItemState( nId, (SfxItemState::DONTCARE == eState) - ? TRISTATE_INDET - : TRISTATE_FALSE ); -} - SvxSimpleUndoRedoController::SvxSimpleUndoRedoController( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx ) :SfxToolBoxControl( nSlotId, nId, rTbx ) { diff --git a/sw/source/uibase/app/swmodule.cxx b/sw/source/uibase/app/swmodule.cxx index 6ca46d4a9e2e..6269338eab07 100644 --- a/sw/source/uibase/app/swmodule.cxx +++ b/sw/source/uibase/app/swmodule.cxx @@ -320,7 +320,6 @@ void SwDLL::RegisterControls() SvxColorToolBoxControl::RegisterControl(SID_ATTR_CHAR_COLOR_BACKGROUND, pMod ); SvxStyleToolBoxControl::RegisterControl(SID_STYLE_APPLY, pMod ); SvxColorToolBoxControl::RegisterControl( SID_BACKGROUND_COLOR, pMod ); - SvxFrameLineStyleToolBoxControl::RegisterControl(SID_FRAME_LINESTYLE, pMod ); SvxColorToolBoxControl::RegisterControl(SID_FRAME_LINECOLOR, pMod ); SvxColumnsToolBoxControl::RegisterControl(FN_INSERT_FRAME_INTERACT, pMod );