summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/svx/tbcontrl.hxx11
-rw-r--r--officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu11
-rw-r--r--sc/source/ui/app/scdll.cxx1
-rw-r--r--sd/source/ui/app/sddll.cxx1
-rw-r--r--svx/source/tbxctrls/tbcontrl.cxx73
-rw-r--r--svx/util/svxcore.component4
-rw-r--r--sw/source/uibase/app/swmodule.cxx1
7 files changed, 62 insertions, 40 deletions
diff --git a/include/svx/tbcontrl.hxx b/include/svx/tbcontrl.hxx
index 6785370fb1e2..1067fa0bd628 100644
--- a/include/svx/tbcontrl.hxx
+++ b/include/svx/tbcontrl.hxx
@@ -254,17 +254,6 @@ public:
void setColorSelectFunction(const ColorSelectFunction& aColorSelectFunction);
};
-class SVX_DLLPUBLIC SvxFrameToolBoxControl : public SfxToolBoxControl
-{
-public:
- SFX_DECL_TOOLBOX_CONTROL();
- SvxFrameToolBoxControl(sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rToolBox);
-
- virtual VclPtr<SfxPopupWindow> CreatePopupWindow() override;
- virtual void StateChanged(sal_uInt16 nSID, SfxItemState eState,
- const SfxPoolItem* pState) override;
-};
-
class SVX_DLLPUBLIC SvxFrameLineStyleToolBoxControl : public SfxToolBoxControl
{
public:
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu b/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu
index 096ed337bf1c..9f0e3ec9e94d 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu
@@ -1082,6 +1082,17 @@
<value>com.sun.star.comp.sfx2.ClassificationCategoriesController</value>
</prop>
</node>
+ <node oor:name="com.sun.star.comp.svx.FrameToolBoxControl" oor:op="replace">
+ <prop oor:name="Command">
+ <value>.uno:SetBorderStyle</value>
+ </prop>
+ <prop oor:name="Module">
+ <value/>
+ </prop>
+ <prop oor:name="Controller">
+ <value>com.sun.star.comp.svx.FrameToolBoxControl</value>
+ </prop>
+ </node>
<node oor:name="c4" oor:op="replace" install:module="reportbuilder">
<prop oor:name="Command">
<value>.uno:FontColor</value>
diff --git a/sc/source/ui/app/scdll.cxx b/sc/source/ui/app/scdll.cxx
index 355552dfe9b9..abc587c0e333 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);
- SvxFrameToolBoxControl ::RegisterControl(SID_ATTR_BORDER, pMod);
SvxFrameLineStyleToolBoxControl ::RegisterControl(SID_FRAME_LINESTYLE, pMod);
SvxColorToolBoxControl ::RegisterControl(SID_FRAME_LINECOLOR, pMod);
SvxClipBoardControl ::RegisterControl(SID_PASTE, pMod );
diff --git a/sd/source/ui/app/sddll.cxx b/sd/source/ui/app/sddll.cxx
index c63d2b6abbec..035fda3dd321 100644
--- a/sd/source/ui/app/sddll.cxx
+++ b/sd/source/ui/app/sddll.cxx
@@ -237,7 +237,6 @@ void SdDLL::RegisterControllers(SdModule* pMod)
SvxTableToolBoxControl::RegisterControl(SID_INSERT_TABLE, pMod );
SvxFrameLineStyleToolBoxControl::RegisterControl(SID_FRAME_LINESTYLE, pMod );
SvxColorToolBoxControl::RegisterControl(SID_FRAME_LINECOLOR, pMod );
- SvxFrameToolBoxControl::RegisterControl(SID_ATTR_BORDER, pMod );
SvxTbxCtlDraw::RegisterControl(SID_INSERT_DRAW, pMod );
EmojiPopup::RegisterControl(SID_EMOJI_CONTROL, pMod );
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index cba6820ed361..ed9a38e84960 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -30,6 +30,7 @@
#include <vcl/vclptr.hxx>
#include <svtools/valueset.hxx>
#include <svtools/ctrlbox.hxx>
+#include <svtools/popupwindowcontroller.hxx>
#include <svl/style.hxx>
#include <svtools/ctrltool.hxx>
#include <svtools/borderhelper.hxx>
@@ -115,7 +116,6 @@ using namespace ::com::sun::star::lang;
SFX_IMPL_TOOLBOX_CONTROL( SvxStyleToolBoxControl, SfxTemplateItem );
SFX_IMPL_TOOLBOX_CONTROL( SvxFontNameToolBoxControl, SvxFontItem );
-SFX_IMPL_TOOLBOX_CONTROL( SvxFrameToolBoxControl, SvxBoxItem );
SFX_IMPL_TOOLBOX_CONTROL( SvxFrameLineStyleToolBoxControl, SvxLineItem );
SFX_IMPL_TOOLBOX_CONTROL( SvxSimpleUndoRedoController, SfxStringItem );
SFX_IMPL_TOOLBOX_CONTROL( SvxCurrencyToolBoxControl, SfxBoolItem );
@@ -1600,7 +1600,7 @@ Color BorderColorStatus::GetColor()
SvxFrameWindow_Impl::SvxFrameWindow_Impl( sal_uInt16 nId, const Reference< XFrame >& rFrame, vcl::Window* pParentWindow ) :
- SfxPopupWindow( nId, rFrame, pParentWindow, WinBits( WB_STDPOPUP | WB_OWNERDRAWDECORATION ) ),
+ SfxPopupWindow( nId, rFrame, pParentWindow, WB_STDPOPUP | WB_OWNERDRAWDECORATION | WB_CLOSEABLE | WB_MOVEABLE ),
aFrameSet ( VclPtr<SvxFrmValueSet_Impl>::Create(this, WinBits( WB_ITEMBORDER | WB_DOUBLEBORDER | WB_3DLOOK | WB_NO_DIRECTSELECT )) ),
bParagraphMode(false)
{
@@ -2898,40 +2898,61 @@ void SvxColorToolBoxControl::RegisterControl(sal_uInt16 nSlotId, SfxModule *pMod
// class SvxFrameToolBoxControl --------------------------------------------
-SvxFrameToolBoxControl::SvxFrameToolBoxControl(
- sal_uInt16 nSlotId,
- sal_uInt16 nId,
- ToolBox& rTbx )
- : SfxToolBoxControl( nSlotId, nId, rTbx )
+class SvxFrameToolBoxControl : public svt::PopupWindowController
+{
+public:
+ explicit SvxFrameToolBoxControl( const css::uno::Reference< css::uno::XComponentContext >& rContext );
+
+ // XInitialization
+ virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& rArguments ) throw ( css::uno::Exception, css::uno::RuntimeException, std::exception ) override;
+
+ // XServiceInfo
+ virtual OUString SAL_CALL getImplementationName() throw ( css::uno::RuntimeException, std::exception ) override;
+ virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw ( css::uno::RuntimeException, std::exception ) override;
+
+private:
+ virtual VclPtr<vcl::Window> createPopupWindow( vcl::Window* pParent ) override;
+ using svt::ToolboxController::createPopupWindow;
+};
+
+SvxFrameToolBoxControl::SvxFrameToolBoxControl( const css::uno::Reference< css::uno::XComponentContext >& rContext )
+ : svt::PopupWindowController( rContext, nullptr, OUString() )
{
- rTbx.SetItemBits( nId, ToolBoxItemBits::DROPDOWNONLY | rTbx.GetItemBits( nId ) );
}
-VclPtr<SfxPopupWindow> SvxFrameToolBoxControl::CreatePopupWindow()
+void SvxFrameToolBoxControl::initialize( const css::uno::Sequence< css::uno::Any >& rArguments )
+ throw ( css::uno::Exception, css::uno::RuntimeException, std::exception )
{
- VclPtr<SvxFrameWindow_Impl> pFrameWin = VclPtr<SvxFrameWindow_Impl>::Create(
- GetSlotId(), m_xFrame, &GetToolBox() );
+ svt::PopupWindowController::initialize( rArguments );
+ ToolBox* pToolBox = nullptr;
+ sal_uInt16 nId = 0;
+ if ( getToolboxId( nId, &pToolBox ) )
+ pToolBox->SetItemBits( nId, pToolBox->GetItemBits( nId ) | ToolBoxItemBits::DROPDOWNONLY );
+}
- pFrameWin->StartPopupMode( &GetToolBox(),
- FloatWinPopupFlags::GrabFocus |
- FloatWinPopupFlags::AllowTearOff |
- FloatWinPopupFlags::NoAppFocusClose );
- pFrameWin->StartSelection();
- SetPopupWindow( pFrameWin );
+VclPtr<vcl::Window> SvxFrameToolBoxControl::createPopupWindow( vcl::Window* pParent )
+{
+ return VclPtr<SvxFrameWindow_Impl>::Create( 0, m_xFrame, pParent );
+}
- return pFrameWin;
+OUString SvxFrameToolBoxControl::getImplementationName()
+ throw ( css::uno::RuntimeException, std::exception )
+{
+ return OUString( "com.sun.star.comp.svx.FrameToolBoxControl" );
}
-void SvxFrameToolBoxControl::StateChanged(
- sal_uInt16, SfxItemState eState, const SfxPoolItem* )
+css::uno::Sequence< OUString > SvxFrameToolBoxControl::getSupportedServiceNames()
+ throw ( css::uno::RuntimeException, std::exception )
{
- sal_uInt16 nId = GetId();
- ToolBox& rTbx = GetToolBox();
+ return { "com.sun.star.frame.ToolbarController" };
+}
- rTbx.EnableItem( nId, SfxItemState::DISABLED != eState );
- rTbx.SetItemState( nId, (SfxItemState::DONTCARE == eState)
- ? TRISTATE_INDET
- : TRISTATE_FALSE );
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
+com_sun_star_comp_svx_FrameToolBoxControl_get_implementation(
+ css::uno::XComponentContext* rContext,
+ css::uno::Sequence<css::uno::Any> const & )
+{
+ return cppu::acquire( new SvxFrameToolBoxControl( rContext ) );
}
SvxFrameLineStyleToolBoxControl::SvxFrameLineStyleToolBoxControl(
diff --git a/svx/util/svxcore.component b/svx/util/svxcore.component
index 1e6d1c7ef793..8c8d42da1236 100644
--- a/svx/util/svxcore.component
+++ b/svx/util/svxcore.component
@@ -40,6 +40,10 @@
<implementation name="com.sun.star.comp.svx.FontworkCharacterSpacingController">
<service name="com.sun.star.frame.ToolbarController"/>
</implementation>
+ <implementation name="com.sun.star.comp.svx.FrameToolBoxControl"
+ constructor="com_sun_star_comp_svx_FrameToolBoxControl_get_implementation">
+ <service name="com.sun.star.frame.ToolbarController"/>
+ </implementation>
<implementation name="com.sun.star.comp.Svx.GraphicExportHelper"
constructor="com_sun_star_comp_Svx_GraphicExportHelper_get_implementation">
<service name="com.sun.star.document.BinaryStreamResolver"/>
diff --git a/sw/source/uibase/app/swmodule.cxx b/sw/source/uibase/app/swmodule.cxx
index eaa726bea839..6ca46d4a9e2e 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 );
- SvxFrameToolBoxControl::RegisterControl(SID_ATTR_BORDER, pMod );
SvxFrameLineStyleToolBoxControl::RegisterControl(SID_FRAME_LINESTYLE, pMod );
SvxColorToolBoxControl::RegisterControl(SID_FRAME_LINECOLOR, pMod );