[Libreoffice-commits] core.git: 3 commits - include/svx sd/sdi sd/source sd/uiconfig svx/source

Maxim Monastirsky momonasmon at gmail.com
Wed Dec 30 13:00:49 PST 2015


 include/svx/tbxctl.hxx                       |    2 ++
 sd/sdi/ViewShellBase.sdi                     |    6 ++++++
 sd/source/core/typemap.cxx                   |    3 +++
 sd/source/ui/app/sddll.cxx                   |    2 ++
 sd/uiconfig/sdraw/toolbar/standardbar.xml    |    1 +
 sd/uiconfig/simpress/toolbar/standardbar.xml |    1 +
 svx/source/tbxctrls/tbxdrctl.cxx             |   21 +++++++++++++++------
 7 files changed, 30 insertions(+), 6 deletions(-)

New commits:
commit 58482f97c1c54c4008479af46eae47a0b9b6e12b
Author: Maxim Monastirsky <momonasmon at gmail.com>
Date:   Wed Dec 30 22:37:42 2015 +0200

    Related: tdf#89540 We don't use PseudoSlots in sd
    
    This unbreaks various draw buttons after the addition
    of SID_INSERT_DRAW to sd. Also silences the warning
    "master slot with non-enum-type found".
    
    Change-Id: I250a1a4b5d24f052d303c24138654f7e41cc4fb6

diff --git a/sd/sdi/ViewShellBase.sdi b/sd/sdi/ViewShellBase.sdi
index 4329582..e58605f 100644
--- a/sd/sdi/ViewShellBase.sdi
+++ b/sd/sdi/ViewShellBase.sdi
@@ -141,6 +141,7 @@ interface ViewShellBaseView
     [
         ExecMethod = Execute ;
         StateMethod = GetState ;
+        PseudoSlots = FALSE;
     ]
 }
 
commit ab183029791690d711d858303e2ad0ef5454a2bd
Author: Maxim Monastirsky <momonasmon at gmail.com>
Date:   Wed Dec 30 22:41:22 2015 +0200

    Some cosmetics
    
    Change-Id: I07e826eaa11ec9f21a9eab6f771361566e9c57e0

diff --git a/svx/source/tbxctrls/tbxdrctl.cxx b/svx/source/tbxctrls/tbxdrctl.cxx
index f2e059f..0c40f0a 100644
--- a/svx/source/tbxctrls/tbxdrctl.cxx
+++ b/svx/source/tbxctrls/tbxdrctl.cxx
@@ -41,27 +41,25 @@ using namespace ::com::sun::star::frame;
 
 
 SvxTbxCtlDraw::SvxTbxCtlDraw( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx ) :
-
     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);
+{
+    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")
+    if ( m_sModuleName == "com.sun.star.presentation.PresentationDocument" || m_sModuleName == "com.sun.star.drawing.DrawingDocument" )
         m_sToolboxName="private:resource/toolbar/toolbar";
     else
         m_sToolboxName="private:resource/toolbar/drawbar";
-    }
+}
 
 
 
commit 5fe01e8b69e40b1acc60b6068aa39cdf625e3ce4
Author: Gulsah Kose <gulsah.1004 at gmail.com>
Date:   Wed Dec 9 23:22:25 2015 +0200

    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 at gmail.com>

diff --git a/include/svx/tbxctl.hxx b/include/svx/tbxctl.hxx
index b2625ef..fb18d8b 100644
--- a/include/svx/tbxctl.hxx
+++ b/include/svx/tbxctl.hxx
@@ -39,6 +39,8 @@ protected:
 
 public:
     SvxTbxCtlDraw( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
+    // XInitialization
+    virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) throw ( css::uno::Exception, css::uno::RuntimeException, std::exception) override;
     virtual ~SvxTbxCtlDraw() {}
 
     SFX_DECL_TOOLBOX_CONTROL();
diff --git a/sd/sdi/ViewShellBase.sdi b/sd/sdi/ViewShellBase.sdi
index 7996781..4329582 100644
--- a/sd/sdi/ViewShellBase.sdi
+++ b/sd/sdi/ViewShellBase.sdi
@@ -137,6 +137,11 @@ interface ViewShellBaseView
         ExecMethod = Execute ;
         StateMethod = GetState ;
     ]
+    SID_INSERT_DRAW
+    [
+        ExecMethod = Execute ;
+        StateMethod = GetState ;
+    ]
 }
 
 shell ViewShellBase
diff --git a/sd/source/core/typemap.cxx b/sd/source/core/typemap.cxx
index 65f7cf0..65898a2 100644
--- a/sd/source/core/typemap.cxx
+++ b/sd/source/core/typemap.cxx
@@ -84,6 +84,7 @@
 #include <svx/xftshxy.hxx>
 #include <avmedia/mediaitem.hxx>
 #include <svx/drawitem.hxx>
+#include <svl/aeitem.hxx>
 
 // #UndoRedo#
 #include <svl/slstitm.hxx>
@@ -103,6 +104,8 @@
 #include <svx/galleryitem.hxx>
 
 #define SFX_TYPEMAP
+#define SvxDrawToolItem             SfxAllEnumItem
 #include "sdslots.hxx"
 
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/app/sddll.cxx b/sd/source/ui/app/sddll.cxx
index 9fe1148..8291d1a 100644
--- a/sd/source/ui/app/sddll.cxx
+++ b/sd/source/ui/app/sddll.cxx
@@ -87,6 +87,7 @@
 #include <svx/xmlsecctrl.hxx>
 #include <svx/zoomctrl.hxx>
 #include <svx/zoomsliderctrl.hxx>
+#include <svx/tbxctl.hxx>
 #include <sfx2/docfilt.hxx>
 #include <sfx2/docfile.hxx>
 #include <sfx2/fcontnr.hxx>
@@ -244,6 +245,7 @@ void SdDLL::RegisterControllers()
     SvxFrameLineStyleToolBoxControl::RegisterControl(SID_FRAME_LINESTYLE, pMod );
     SvxColorToolBoxControl::RegisterControl(SID_FRAME_LINECOLOR, pMod );
     SvxFrameToolBoxControl::RegisterControl(SID_ATTR_BORDER, pMod );
+    SvxTbxCtlDraw::RegisterControl(SID_INSERT_DRAW, pMod );
 }
 
 void SdDLL::Init()
diff --git a/sd/uiconfig/sdraw/toolbar/standardbar.xml b/sd/uiconfig/sdraw/toolbar/standardbar.xml
index 6894887..d8c8407 100644
--- a/sd/uiconfig/sdraw/toolbar/standardbar.xml
+++ b/sd/uiconfig/sdraw/toolbar/standardbar.xml
@@ -73,6 +73,7 @@
  <toolbar:toolbaritem xlink:href=".uno:ToggleObjectBezierMode" toolbar:helpid="10126"/>
  <toolbar:toolbaritem xlink:href=".uno:GlueEditMode"/>
  <toolbar:toolbaritem xlink:href=".uno:ExtrusionToggle" toolbar:helpid="10960"/>
+ <toolbar:toolbaritem xlink:href=".uno:InsertDraw"/>
  <toolbar:toolbarseparator/>
  <toolbar:toolbaritem xlink:href=".uno:HelpIndex" toolbar:visible="false"/>
  <toolbar:toolbaritem xlink:href=".uno:ExtendedHelp" toolbar:visible="false"/>
diff --git a/sd/uiconfig/simpress/toolbar/standardbar.xml b/sd/uiconfig/simpress/toolbar/standardbar.xml
index 64a42e8..ffc5561 100644
--- a/sd/uiconfig/simpress/toolbar/standardbar.xml
+++ b/sd/uiconfig/simpress/toolbar/standardbar.xml
@@ -63,6 +63,7 @@
  <toolbar:toolbaritem xlink:href=".uno:GridVisible"/>
  <toolbar:toolbaritem xlink:href=".uno:HelplinesMove" toolbar:visible="false"/>
  <toolbar:toolbaritem xlink:href=".uno:AnimationEffects"/>
+ <toolbar:toolbaritem xlink:href=".uno:InsertDraw"/>
  <toolbar:toolbarseparator/>
  <toolbar:toolbaritem xlink:href=".uno:PageSetup"/>
  <toolbar:toolbaritem xlink:href=".uno:SlideMasterPage"/>
diff --git a/svx/source/tbxctrls/tbxdrctl.cxx b/svx/source/tbxctrls/tbxdrctl.cxx
index f70805c..f2e059f 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,


More information about the Libreoffice-commits mailing list