diff options
author | Gulsah Kose <gulsah.1004@gmail.com> | 2015-12-09 23:22:25 +0200 |
---|---|---|
committer | Maxim Monastirsky <momonasmon@gmail.com> | 2015-12-30 22:58:10 +0200 |
commit | 5fe01e8b69e40b1acc60b6068aa39cdf625e3ce4 (patch) | |
tree | 2ea0bc179b5b2b5d2aab48a71a36c8d0b1e2a529 /svx/source/tbxctrls | |
parent | 6c2a9102eeb4d3de6a64780eb2b97415b15ce4a9 (diff) |
tdf#89540 Completed show draw functions button for impress and draw.
v2: failed commit.
v3: Solved slot defination and dimmed button problem.
v4: Tried to find slot execution method.
v5: Added a control for draw toolbar name in impress and draw
v6: Toolbar name control is changed for checking request only impress and draw.
v7: Overrided initialize method of base class.
v8: Control provided with module name.
v9: Cleaned unnecessary included headers
v10: Removed m_sModuleName defination and reused base class' m_sModuleName variable.
Added white space before header files. Moved control into the initialize method.
Control is changed as only controls impress or draw.
Change-Id: I781783a72954af1f16212b981356db472ed48739
Signed-off-by: Gulsah Kose <gulsah.1004@gmail.com>
Diffstat (limited to 'svx/source/tbxctrls')
-rw-r--r-- | svx/source/tbxctrls/tbxdrctl.cxx | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/svx/source/tbxctrls/tbxdrctl.cxx b/svx/source/tbxctrls/tbxdrctl.cxx index f70805cce61b..f2e059f5c87f 100644 --- a/svx/source/tbxctrls/tbxdrctl.cxx +++ b/svx/source/tbxctrls/tbxdrctl.cxx @@ -29,7 +29,6 @@ #include <svx/dialmgr.hxx> #include <svx/dialogs.hrc> - #include "svx/tbxctl.hxx" #include "svx/tbxcolor.hxx" #include <com/sun/star/frame/XLayoutManager.hpp> @@ -43,15 +42,27 @@ using namespace ::com::sun::star::frame; SvxTbxCtlDraw::SvxTbxCtlDraw( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx ) : - SfxToolBoxControl( nSlotId, nId, rTbx ), - - m_sToolboxName( "private:resource/toolbar/drawbar" ) + SfxToolBoxControl( nSlotId, nId, rTbx ) { rTbx.SetItemBits( nId, ToolBoxItemBits::CHECKABLE | rTbx.GetItemBits( nId ) ); rTbx.Invalidate(); } +void SAL_CALL SvxTbxCtlDraw::initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) throw ( css::uno::Exception, css::uno::RuntimeException, std::exception) + { + svt::ToolboxController::initialize(aArguments); + /* + * Toolbar name is defined as "private:resource/toolbar/drawbar" in writer and calc, + * "private:resource/toolbar/toolbar" in draw and impress. Control is added for this + * difference. + */ + if (svt::ToolboxController::m_sModuleName=="com.sun.star.presentation.PresentationDocument" || svt::ToolboxController::m_sModuleName=="com.sun.star.drawing.DrawingDocument") + m_sToolboxName="private:resource/toolbar/toolbar"; + else + m_sToolboxName="private:resource/toolbar/drawbar"; + } + void SvxTbxCtlDraw::StateChanged( sal_uInt16 nSID, SfxItemState eState, |