summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaxim Monastirsky <momonasmon@gmail.com>2016-10-07 00:22:01 +0300
committerMaxim Monastirsky <momonasmon@gmail.com>2016-10-07 00:28:55 +0300
commit5e87eea81bab8a954a2c1ad6c923dd4134ec8901 (patch)
tree5b2af4e1035695db54fab72ea2899e84ae2f522b
parenttdf#102776 : fixed Notebookbar hiding (diff)
downloadcore-5e87eea81bab8a954a2c1ad6c923dd4134ec8901.tar.gz
core-5e87eea81bab8a954a2c1ad6c923dd4134ec8901.zip
Base SvxLineWindow_Impl on ToolbarPopup
Change-Id: I93dbb180fc65bca77e0eb58f116d0a0a5266556a
-rw-r--r--include/svx/tbcontrl.hxx11
-rw-r--r--officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu13
-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.cxx59
-rw-r--r--sw/source/uibase/app/swmodule.cxx1
6 files changed, 25 insertions, 61 deletions
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<SfxPopupWindow> 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 @@
<value>com.sun.star.comp.sfx2.ClassificationCategoriesController</value>
</prop>
</node>
- <node oor:name="com.sun.star.comp.svx.FrameToolBoxControl" oor:op="replace">
+ <node oor:name="BorderStyleToolBoxControl" oor:op="replace">
<prop oor:name="Command">
<value>.uno:SetBorderStyle</value>
</prop>
@@ -1093,6 +1093,17 @@
<value>com.sun.star.comp.svx.FrameToolBoxControl</value>
</prop>
</node>
+ <node oor:name="BorderLineStyleToolBoxControl" oor:op="replace">
+ <prop oor:name="Command">
+ <value>.uno:LineStyle</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 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<LineListBox> 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<LineListBox>::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<LineListBox>::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<vcl::Window> SvxFrameToolBoxControl::createPopupWindow( vcl::Window* pParent )
{
+ if ( m_aCommandURL == ".uno:LineStyle" )
+ return VclPtr<SvxLineWindow_Impl>::Create( *this, pParent );
+
return VclPtr<SvxFrameWindow_Impl>::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<SfxPopupWindow> SvxFrameLineStyleToolBoxControl::CreatePopupWindow()
-{
- VclPtr<SvxLineWindow_Impl> pLineWin = VclPtr<SvxLineWindow_Impl>::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 );