Kaydet (Commit) 67bde246 authored tarafından Krisztian Pinter's avatar Krisztian Pinter Kaydeden (comit) Tomaž Vajngerl

Remove redundant class SvxLineColorToolBoxControl

Change-Id: I882ee959baae429307218d3076a2a198ff960ddd
üst cb02490a
...@@ -42,7 +42,8 @@ ...@@ -42,7 +42,8 @@
SvxColorToolBoxControl SvxColorToolBoxControl
---------------------- ----------------------
Item type: SvxColorItem Item type: SvxColorItem
and SfxBoolItem SfxBoolItem
and XLineColorItem
for font color (writer, ...) for font color (writer, ...)
Execute-Id SID_ATTR_CHAR_COLOR2 Execute-Id SID_ATTR_CHAR_COLOR2
...@@ -66,9 +67,7 @@ ...@@ -66,9 +67,7 @@
for 3D extrusion for 3D extrusion
Execute-Id SID_EXTRUSION_3D_COLOR Execute-Id SID_EXTRUSION_3D_COLOR
SvxLineColorToolBoxControl for line color
--------------------------
Item type: XLineColorItem
Execute-Id SID_ATTR_LINE_COLOR Execute-Id SID_ATTR_LINE_COLOR
SvxPatternToolBoxControl SvxPatternToolBoxControl
...@@ -236,26 +235,6 @@ public: ...@@ -236,26 +235,6 @@ public:
}; };
// class SvxLineColorToolBoxControl --------------------------------------
class SVX_DLLPUBLIC SvxLineColorToolBoxControl : public SfxToolBoxControl
{
::boost::scoped_ptr< ::svx::ToolboxButtonColorUpdater > pBtnUpdater;
PaletteManager mPaletteManager;
DECL_LINK( SelectedHdl, Color* );
public:
SFX_DECL_TOOLBOX_CONTROL();
SvxLineColorToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
virtual ~SvxLineColorToolBoxControl();
virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
const SfxPoolItem* pState ) SAL_OVERRIDE;
virtual SfxPopupWindowType GetPopupWindowType() const SAL_OVERRIDE;
virtual SfxPopupWindow* CreatePopupWindow() SAL_OVERRIDE;
virtual void Select(sal_uInt16 nSelectModifier) SAL_OVERRIDE;
};
// class SvxFrameToolBoxControl ------------------------------------------ // class SvxFrameToolBoxControl ------------------------------------------
class SVX_DLLPUBLIC SvxFrameToolBoxControl : public SfxToolBoxControl class SVX_DLLPUBLIC SvxFrameToolBoxControl : public SfxToolBoxControl
......
...@@ -171,7 +171,7 @@ void ScDLL::Init() ...@@ -171,7 +171,7 @@ void ScDLL::Init()
SvxFillToolBoxControl ::RegisterControl(0, pMod); SvxFillToolBoxControl ::RegisterControl(0, pMod);
SvxLineStyleToolBoxControl ::RegisterControl(0, pMod); SvxLineStyleToolBoxControl ::RegisterControl(0, pMod);
SvxLineWidthToolBoxControl ::RegisterControl(0, pMod); SvxLineWidthToolBoxControl ::RegisterControl(0, pMod);
SvxLineColorToolBoxControl ::RegisterControl(0, pMod); SvxColorToolBoxControl ::RegisterControl(0, pMod);
SvxLineEndToolBoxControl ::RegisterControl(SID_ATTR_LINEEND_STYLE, pMod); SvxLineEndToolBoxControl ::RegisterControl(SID_ATTR_LINEEND_STYLE, pMod);
SvxStyleToolBoxControl ::RegisterControl(SID_STYLE_APPLY, pMod); SvxStyleToolBoxControl ::RegisterControl(SID_STYLE_APPLY, pMod);
SvxFontNameToolBoxControl ::RegisterControl(SID_ATTR_CHAR_FONT, pMod); SvxFontNameToolBoxControl ::RegisterControl(SID_ATTR_CHAR_FONT, pMod);
......
...@@ -207,7 +207,7 @@ void SdDLL::RegisterControllers() ...@@ -207,7 +207,7 @@ void SdDLL::RegisterControllers()
SvxFillToolBoxControl::RegisterControl(0, pMod); SvxFillToolBoxControl::RegisterControl(0, pMod);
SvxLineStyleToolBoxControl::RegisterControl(0, pMod); SvxLineStyleToolBoxControl::RegisterControl(0, pMod);
SvxLineWidthToolBoxControl::RegisterControl(0, pMod); SvxLineWidthToolBoxControl::RegisterControl(0, pMod);
SvxLineColorToolBoxControl::RegisterControl(0, pMod); SvxColorToolBoxControl::RegisterControl(0, pMod);
SvxLineEndToolBoxControl::RegisterControl( SID_ATTR_LINEEND_STYLE, pMod ); SvxLineEndToolBoxControl::RegisterControl( SID_ATTR_LINEEND_STYLE, pMod );
......
...@@ -108,8 +108,6 @@ using namespace ::com::sun::star::lang; ...@@ -108,8 +108,6 @@ using namespace ::com::sun::star::lang;
SFX_IMPL_TOOLBOX_CONTROL( SvxStyleToolBoxControl, SfxTemplateItem ); SFX_IMPL_TOOLBOX_CONTROL( SvxStyleToolBoxControl, SfxTemplateItem );
SFX_IMPL_TOOLBOX_CONTROL( SvxFontNameToolBoxControl, SvxFontItem ); SFX_IMPL_TOOLBOX_CONTROL( SvxFontNameToolBoxControl, SvxFontItem );
SFX_IMPL_TOOLBOX_CONTROL( SvxColorToolBoxControl, SvxColorItem );
SFX_IMPL_TOOLBOX_CONTROL( SvxLineColorToolBoxControl, XLineColorItem );
SFX_IMPL_TOOLBOX_CONTROL( SvxFrameToolBoxControl, SvxBoxItem ); SFX_IMPL_TOOLBOX_CONTROL( SvxFrameToolBoxControl, SvxBoxItem );
SFX_IMPL_TOOLBOX_CONTROL( SvxFrameLineStyleToolBoxControl, SvxLineItem ); SFX_IMPL_TOOLBOX_CONTROL( SvxFrameLineStyleToolBoxControl, SvxLineItem );
SFX_IMPL_TOOLBOX_CONTROL( SvxSimpleUndoRedoController, SfxStringItem ); SFX_IMPL_TOOLBOX_CONTROL( SvxSimpleUndoRedoController, SfxStringItem );
...@@ -2329,73 +2327,18 @@ void SvxColorToolBoxControl::Select(sal_uInt16 /*nSelectModifier*/) ...@@ -2329,73 +2327,18 @@ void SvxColorToolBoxControl::Select(sal_uInt16 /*nSelectModifier*/)
Dispatch( aCommand, aArgs ); Dispatch( aCommand, aArgs );
} }
// class SvxLineColorToolBoxControl ---------------------------------------- SfxToolBoxControl* SvxColorToolBoxControl::CreateImpl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox &rTbx )
SvxLineColorToolBoxControl::SvxLineColorToolBoxControl(
sal_uInt16 nSlotId,
sal_uInt16 nId,
ToolBox& rTbx ) :
SfxToolBoxControl( nSlotId, nId, rTbx )
{
rTbx.SetItemBits( nId, TIB_DROPDOWN | rTbx.GetItemBits( nId ) );
addStatusListener( OUString( ".uno:XLineColor" ) );
pBtnUpdater.reset( new ::svx::ToolboxButtonColorUpdater( nSlotId, nId, &GetToolBox() ) );
mPaletteManager.SetLastColor( COL_BLACK );
mPaletteManager.SetBtnUpdater( pBtnUpdater.get() );
}
SvxLineColorToolBoxControl::~SvxLineColorToolBoxControl()
{
}
SfxPopupWindowType SvxLineColorToolBoxControl::GetPopupWindowType() const
{
return SFX_POPUPWINDOW_ONTIMEOUT;
}
SfxPopupWindow* SvxLineColorToolBoxControl::CreatePopupWindow()
{
SvxColorWindow_Impl* pColorWin =
new SvxColorWindow_Impl(
m_aCommandURL,
mPaletteManager,
GetSlotId(),
m_xFrame,
SVX_RESSTR( RID_SVXSTR_LINECOLOR ),
&GetToolBox() );
pColorWin->StartPopupMode( &GetToolBox(),
FLOATWIN_POPUPMODE_GRABFOCUS|FLOATWIN_POPUPMODE_ALLOWTEAROFF|FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE );
pColorWin->StartSelection();
SetPopupWindow( pColorWin );
pColorWin->SetSelectedHdl( LINK( this, SvxLineColorToolBoxControl, SelectedHdl ) );
return pColorWin;
}
IMPL_LINK(SvxLineColorToolBoxControl, SelectedHdl, Color*, pColor)
{ {
pBtnUpdater->Update( *pColor ); return new SvxColorToolBoxControl( nSlotId, nId, rTbx );
mPaletteManager.SetLastColor( *pColor );
return 0;
} }
void SvxLineColorToolBoxControl::StateChanged( void SvxColorToolBoxControl::RegisterControl(sal_uInt16 nSlotId, SfxModule *pMod)
sal_uInt16 /*nSID*/, SfxItemState eState, const SfxPoolItem* /*pState*/ )
{ {
ToolBox& rTbx = GetToolBox(); SfxToolBoxControl::RegisterToolBoxControl( pMod, new SfxTbxCtrlFactory( SvxColorToolBoxControl::CreateImpl, TYPE(SvxColorItem), nSlotId ) );
sal_uInt16 nId = GetId(); SfxToolBoxControl::RegisterToolBoxControl( pMod, new SfxTbxCtrlFactory( SvxColorToolBoxControl::CreateImpl, TYPE(XLineColorItem), nSlotId ) );
rTbx.EnableItem( nId, SfxItemState::DISABLED != eState );
rTbx.SetItemState( nId, ( SfxItemState::DONTCARE == eState ) ? TRISTATE_INDET : TRISTATE_FALSE );
} }
void SvxLineColorToolBoxControl::Select(sal_uInt16 /*nSelectModifier*/) // class SvxFrameToolBoxControl --------------------------------------------
{
Sequence< PropertyValue > aArgs( 1 );
aArgs[0].Name = "XLineColor";
aArgs[0].Value = makeAny( (sal_uInt32)( mPaletteManager.GetLastColor().GetColor() ));
Dispatch( OUString( ".uno:XLineColor" ), aArgs );
}
SvxFrameToolBoxControl::SvxFrameToolBoxControl( SvxFrameToolBoxControl::SvxFrameToolBoxControl(
sal_uInt16 nSlotId, sal_uInt16 nSlotId,
......
...@@ -320,7 +320,7 @@ void SwDLL::RegisterControls() ...@@ -320,7 +320,7 @@ void SwDLL::RegisterControls()
SvxFillToolBoxControl::RegisterControl(SID_ATTR_FILL_STYLE, pMod ); SvxFillToolBoxControl::RegisterControl(SID_ATTR_FILL_STYLE, pMod );
SvxLineStyleToolBoxControl::RegisterControl(SID_ATTR_LINE_STYLE, pMod ); SvxLineStyleToolBoxControl::RegisterControl(SID_ATTR_LINE_STYLE, pMod );
SvxLineWidthToolBoxControl::RegisterControl(SID_ATTR_LINE_WIDTH, pMod ); SvxLineWidthToolBoxControl::RegisterControl(SID_ATTR_LINE_WIDTH, pMod );
SvxLineColorToolBoxControl::RegisterControl(SID_ATTR_LINE_COLOR, pMod ); SvxColorToolBoxControl::RegisterControl(SID_ATTR_LINE_COLOR, pMod );
SvxLineEndToolBoxControl::RegisterControl(SID_ATTR_LINEEND_STYLE, pMod ); SvxLineEndToolBoxControl::RegisterControl(SID_ATTR_LINEEND_STYLE, pMod );
SvxFontNameToolBoxControl::RegisterControl(SID_ATTR_CHAR_FONT, pMod ); SvxFontNameToolBoxControl::RegisterControl(SID_ATTR_CHAR_FONT, pMod );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment