[Libreoffice-commits] core.git: include/sfx2 officecfg/registry sd/Library_sd.mk sd/sdi sd/source sfx2/sdi sfx2/source

Maxim Monastirsky momonasmon at gmail.com
Sat Jul 18 12:17:55 PDT 2015


 include/sfx2/tbxctrl.hxx                                        |   19 
 officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu |  154 +++++
 sd/Library_sd.mk                                                |    1 
 sd/sdi/sdraw.sdi                                                |   20 
 sd/source/ui/app/sddll.cxx                                      |   14 
 sd/source/ui/app/tbxww.cxx                                      |  301 ----------
 sd/source/ui/func/fusel.cxx                                     |    8 
 sd/source/ui/inc/DrawViewShell.hxx                              |   11 
 sd/source/ui/inc/tbx_ww.hxx                                     |   44 -
 sd/source/ui/view/drviews2.cxx                                  |    5 
 sd/source/ui/view/drviews7.cxx                                  |   38 -
 sd/source/ui/view/drviewsa.cxx                                  |   32 -
 sd/source/ui/view/drviewsc.cxx                                  |  102 ---
 sd/source/ui/view/drviewse.cxx                                  |   30 
 sd/source/ui/view/drviewsj.cxx                                  |    3 
 sfx2/sdi/sfx.sdi                                                |    2 
 sfx2/source/toolbox/tbxitem.cxx                                 |  227 -------
 17 files changed, 176 insertions(+), 835 deletions(-)

New commits:
commit 7352a7c17875e5adcc4226c45f4a03e11c44ff49
Author: Maxim Monastirsky <momonasmon at gmail.com>
Date:   Sat Jul 18 21:51:27 2015 +0300

    Convert SdTbxControl to the generic controller
    
    And remove the now unused stuff from SfxToolBoxControl.
    
    Change-Id: I8805ba96a5dc41076d9cb8d887759a578a33526d

diff --git a/include/sfx2/tbxctrl.hxx b/include/sfx2/tbxctrl.hxx
index fe1453a..6c02d44 100644
--- a/include/sfx2/tbxctrl.hxx
+++ b/include/sfx2/tbxctrl.hxx
@@ -27,6 +27,7 @@
 #include <vcl/fixed.hxx>
 #include <vcl/floatwin.hxx>
 #include <comphelper/processfactory.hxx>
+#include <cppuhelper/implbase.hxx>
 #include <sfx2/ctrlitem.hxx>
 #include <sfx2/sfxstatuslistener.hxx>
 #include <svtools/toolboxcontroller.hxx>
@@ -34,8 +35,6 @@
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
 #include <com/sun/star/frame/XDispatchProvider.hpp>
 #include <com/sun/star/frame/XFrame.hpp>
-#include <com/sun/star/awt/XDockableWindowListener.hpp>
-#include <com/sun/star/awt/XDockableWindow.hpp>
 #include <com/sun/star/frame/XSubToolbarController.hpp>
 
 
@@ -164,9 +163,8 @@ public:
 
 struct SfxToolBoxControl_Impl;
 class SFX2_DLLPUBLIC SfxToolBoxControl:
-    public cppu::ImplInheritanceHelper2<
-        svt::ToolboxController, css::awt::XDockableWindowListener,
-        css::frame::XSubToolbarController>
+    public cppu::ImplInheritanceHelper<
+        svt::ToolboxController, css::frame::XSubToolbarController>
 {
 friend class SfxToolbox;
 friend class SfxPopupWindow;
@@ -191,8 +189,6 @@ protected:
     void                       SetPopupWindow( SfxPopupWindow* pWindow );
 
     // helper methods
-    void    createAndPositionSubToolBar( const OUString& rSubToolBarResName );
-    static ::Size  getPersistentFloatingSize( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame, const OUString& rSubToolBarResName );
     bool    hasBigImages() const;
 
 public:
@@ -226,15 +222,6 @@ public:
     virtual void SAL_CALL functionSelected( const OUString& aCommand ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     virtual void SAL_CALL updateImage(  ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
 
-    //  XDockableWindowListener
-    virtual void SAL_CALL startDocking( const ::com::sun::star::awt::DockingEvent& e ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
-    virtual ::com::sun::star::awt::DockingData SAL_CALL docking( const ::com::sun::star::awt::DockingEvent& e ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
-    virtual void SAL_CALL endDocking( const ::com::sun::star::awt::EndDockingEvent& e ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
-    virtual sal_Bool SAL_CALL prepareToggleFloatingMode( const ::com::sun::star::lang::EventObject& e ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
-    virtual void SAL_CALL toggleFloatingMode( const ::com::sun::star::lang::EventObject& e ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
-    virtual void SAL_CALL closed( const ::com::sun::star::lang::EventObject& e ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
-    virtual void SAL_CALL endPopupMode( const ::com::sun::star::awt::EndPopupModeEvent& e ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
-
 public:
                                SFX_DECL_TOOLBOX_CONTROL();
 
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu b/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu
index 0c30cb6..7566fde 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu
@@ -187,6 +187,160 @@
       </node>
     </node>
     <node oor:name="ToolBar">
+      <node oor:name="ZoomToolBox" oor:op="replace">
+        <prop oor:name="Command">
+          <value>.uno:ZoomToolBox</value>
+        </prop>
+        <prop oor:name="Module">
+          <value/>
+        </prop>
+        <prop oor:name="Controller">
+          <value>com.sun.star.comp.framework.SubToolBarController</value>
+        </prop>
+        <prop oor:name="Value">
+          <value>zoombar;.uno:ZoomPlus</value>
+        </prop>
+      </node>
+      <node oor:name="AdvancedModeToolBox" oor:op="replace">
+        <prop oor:name="Command">
+          <value>.uno:AdvancedMode</value>
+        </prop>
+        <prop oor:name="Module">
+          <value/>
+        </prop>
+        <prop oor:name="Controller">
+          <value>com.sun.star.comp.framework.SubToolBarController</value>
+        </prop>
+        <prop oor:name="Value">
+          <value>choosemodebar;.uno:ToggleObjectRotateMode</value>
+        </prop>
+      </node>
+      <node oor:name="ObjectPositionToolBox" oor:op="replace">
+        <prop oor:name="Command">
+          <value>.uno:ObjectPosition</value>
+        </prop>
+        <prop oor:name="Module">
+          <value/>
+        </prop>
+        <prop oor:name="Controller">
+          <value>com.sun.star.comp.framework.SubToolBarController</value>
+        </prop>
+        <prop oor:name="Value">
+          <value>positionbar;.uno:BringToFront</value>
+        </prop>
+      </node>
+      <node oor:name="TextToolBox" oor:op="replace">
+        <prop oor:name="Command">
+          <value>.uno:TextToolbox</value>
+        </prop>
+        <prop oor:name="Module">
+          <value/>
+        </prop>
+        <prop oor:name="Controller">
+          <value>com.sun.star.comp.framework.SubToolBarController</value>
+        </prop>
+        <prop oor:name="Value">
+          <value>textbar;.uno:Text</value>
+        </prop>
+      </node>
+      <node oor:name="RectangleToolBox" oor:op="replace">
+        <prop oor:name="Command">
+          <value>.uno:RectangleToolbox</value>
+        </prop>
+        <prop oor:name="Module">
+          <value/>
+        </prop>
+        <prop oor:name="Controller">
+          <value>com.sun.star.comp.framework.SubToolBarController</value>
+        </prop>
+        <prop oor:name="Value">
+          <value>rectanglesbar;.uno:Rect</value>
+        </prop>
+      </node>
+      <node oor:name="EllipseToolBox" oor:op="replace">
+        <prop oor:name="Command">
+          <value>.uno:EllipseToolbox</value>
+        </prop>
+        <prop oor:name="Module">
+          <value/>
+        </prop>
+        <prop oor:name="Controller">
+          <value>com.sun.star.comp.framework.SubToolBarController</value>
+        </prop>
+        <prop oor:name="Value">
+          <value>ellipsesbar;.uno:Ellipse</value>
+        </prop>
+      </node>
+      <node oor:name="LineToolBox" oor:op="replace">
+        <prop oor:name="Command">
+          <value>.uno:LineToolbox</value>
+        </prop>
+        <prop oor:name="Module">
+          <value/>
+        </prop>
+        <prop oor:name="Controller">
+          <value>com.sun.star.comp.framework.SubToolBarController</value>
+        </prop>
+        <prop oor:name="Value">
+          <value>linesbar;.uno:Freeline_Unfilled</value>
+        </prop>
+      </node>
+      <node oor:name="ArrowsToolBox" oor:op="replace">
+        <prop oor:name="Command">
+          <value>.uno:ArrowsToolbox</value>
+        </prop>
+        <prop oor:name="Module">
+          <value/>
+        </prop>
+        <prop oor:name="Controller">
+          <value>com.sun.star.comp.framework.SubToolBarController</value>
+        </prop>
+        <prop oor:name="Value">
+          <value>arrowsbar;.uno:LineArrowEnd</value>
+        </prop>
+      </node>
+      <node oor:name="Objects3DToolBox" oor:op="replace">
+        <prop oor:name="Command">
+          <value>.uno:Objects3DToolbox</value>
+        </prop>
+        <prop oor:name="Module">
+          <value/>
+        </prop>
+        <prop oor:name="Controller">
+          <value>com.sun.star.comp.framework.SubToolBarController</value>
+        </prop>
+        <prop oor:name="Value">
+          <value>3dobjectsbar;.uno:Cube</value>
+        </prop>
+      </node>
+      <node oor:name="ConnectorToolBox" oor:op="replace">
+        <prop oor:name="Command">
+          <value>.uno:ConnectorToolbox</value>
+        </prop>
+        <prop oor:name="Module">
+          <value/>
+        </prop>
+        <prop oor:name="Controller">
+          <value>com.sun.star.comp.framework.SubToolBarController</value>
+        </prop>
+        <prop oor:name="Value">
+          <value>connectorsbar;.uno:Connector</value>
+        </prop>
+      </node>
+      <node oor:name="InsertToolBox" oor:op="replace">
+        <prop oor:name="Command">
+          <value>.uno:InsertToolbox</value>
+        </prop>
+        <prop oor:name="Module">
+          <value/>
+        </prop>
+        <prop oor:name="Controller">
+          <value>com.sun.star.comp.framework.SubToolBarController</value>
+        </prop>
+        <prop oor:name="Value">
+          <value>insertbar;.uno:InsertObjectChart</value>
+        </prop>
+      </node>
       <node oor:name="BasicControlsToolBox" oor:op="replace">
         <prop oor:name="Command">
           <value>.uno:ChooseControls</value>
diff --git a/sd/Library_sd.mk b/sd/Library_sd.mk
index cf99782..7a9078f 100644
--- a/sd/Library_sd.mk
+++ b/sd/Library_sd.mk
@@ -192,7 +192,6 @@ $(eval $(call gb_Library_add_exception_objects,sd,\
 	sd/source/ui/app/sdpopup \
 	sd/source/ui/app/sdresid \
 	sd/source/ui/app/sdxfer \
-	sd/source/ui/app/tbxww \
 	sd/source/ui/app/tmplctrl \
 	sd/source/ui/controller/slidelayoutcontroller \
 	sd/source/ui/dlg/AnimationChildWindow \
diff --git a/sd/sdi/sdraw.sdi b/sd/sdi/sdraw.sdi
index 34996c0..4a02435 100644
--- a/sd/sdi/sdraw.sdi
+++ b/sd/sdi/sdraw.sdi
@@ -16,7 +16,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-TbxImageItem AdvancedMode SID_OBJECT_CHOOSE_MODE
+SfxBoolItem AdvancedMode SID_OBJECT_CHOOSE_MODE
 
 [
     /* flags: */
@@ -196,7 +196,7 @@ SfxUInt16Item AnimatorState SID_ANIMATOR_STATE
     GroupId = GID_OPTIONS;
 ]
 
-TbxImageItem ArrowsToolbox SID_DRAWTBX_ARROWS
+SfxBoolItem ArrowsToolbox SID_DRAWTBX_ARROWS
 
 [
     /* flags: */
@@ -1292,7 +1292,7 @@ SfxBoolItem ConnectorLinesCircleStart SID_CONNECTOR_LINES_CIRCLE_START
     GroupId = GID_CONNECTOR;
 ]
 
-TbxImageItem ConnectorToolbox SID_DRAWTBX_CONNECTORS
+SfxBoolItem ConnectorToolbox SID_DRAWTBX_CONNECTORS
 
 [
     /* flags: */
@@ -2157,7 +2157,7 @@ SfxBoolItem CustomAnimationSchemes SID_CUSTOM_ANIMATION_SCHEMES_PANEL
     GroupId = GID_OPTIONS;
 ]
 
-TbxImageItem EllipseToolbox SID_DRAWTBX_ELLIPSES
+SfxBoolItem EllipseToolbox SID_DRAWTBX_ELLIPSES
 
 [
     /* flags: */
@@ -3482,7 +3482,7 @@ SfxVoidItem InsertTimeFieldVar SID_INSERT_FLD_TIME_VAR
     GroupId = GID_INSERT;
 ]
 
-TbxImageItem InsertToolbox SID_DRAWTBX_INSERT
+SfxVoidItem InsertToolbox SID_DRAWTBX_INSERT
 
 [
     /* flags: */
@@ -3889,7 +3889,7 @@ SfxVoidItem LineTo SID_LINETO
     GroupId = GID_DRAWING;
 ]
 
-TbxImageItem LineToolbox SID_DRAWTBX_LINES
+SfxBoolItem LineToolbox SID_DRAWTBX_LINES
 
 [
     /* flags: */
@@ -4516,7 +4516,7 @@ SfxBoolItem NotesMode SID_NOTESMODE
     GroupId = GID_VIEW;
 ]
 
-TbxImageItem ObjectPosition SID_POSITION
+SfxBoolItem ObjectPosition SID_POSITION
 
 [
     /* flags: */
@@ -4542,7 +4542,7 @@ TbxImageItem ObjectPosition SID_POSITION
     GroupId = GID_MODIFY;
 ]
 
-TbxImageItem Objects3DToolbox SID_DRAWTBX_3D_OBJECTS
+SfxBoolItem Objects3DToolbox SID_DRAWTBX_3D_OBJECTS
 
 [
     /* flags: */
@@ -5195,7 +5195,7 @@ SfxBoolItem QuickEdit SID_QUICKEDIT
     GroupId = GID_OPTIONS;
 ]
 
-TbxImageItem RectangleToolbox SID_DRAWTBX_RECTANGLES
+SfxBoolItem RectangleToolbox SID_DRAWTBX_RECTANGLES
 
 [
     /* flags: */
@@ -5994,7 +5994,7 @@ SfxBoolItem TextAutoFitToSize SID_OUTLINE_TEXT_AUTOFIT
     GroupId = GID_FORMAT;
 ]
 
-TbxImageItem TextToolbox SID_DRAWTBX_TEXT
+SfxBoolItem TextToolbox SID_DRAWTBX_TEXT
 
 [
     /* flags: */
diff --git a/sd/source/ui/app/sddll.cxx b/sd/source/ui/app/sddll.cxx
index 8fb1907..fe9e58a5 100644
--- a/sd/source/ui/app/sddll.cxx
+++ b/sd/source/ui/app/sddll.cxx
@@ -57,7 +57,6 @@
 #include "SlideSorterViewShellBase.hxx"
 #include "strmname.h"
 #include "SdShapeTypes.hxx"
-#include "tbx_ww.hxx"
 #include "TextObjectBar.hxx"
 #include "tmplctrl.hxx"
 
@@ -160,19 +159,6 @@ void SdDLL::RegisterControllers()
 {
     SfxModule* pMod = SD_MOD();
 
-    // ToolBoxControls registrieren
-    SdTbxControl::RegisterControl( SID_ZOOM_TOOLBOX, pMod );
-    SdTbxControl::RegisterControl( SID_OBJECT_CHOOSE_MODE, pMod );
-    SdTbxControl::RegisterControl( SID_POSITION, pMod );
-    SdTbxControl::RegisterControl( SID_DRAWTBX_TEXT, pMod );
-    SdTbxControl::RegisterControl( SID_DRAWTBX_RECTANGLES, pMod );
-    SdTbxControl::RegisterControl( SID_DRAWTBX_ELLIPSES, pMod );
-    SdTbxControl::RegisterControl( SID_DRAWTBX_LINES, pMod );
-    SdTbxControl::RegisterControl( SID_DRAWTBX_ARROWS, pMod );
-    SdTbxControl::RegisterControl( SID_DRAWTBX_3D_OBJECTS, pMod );
-    SdTbxControl::RegisterControl( SID_DRAWTBX_CONNECTORS, pMod );
-    SdTbxControl::RegisterControl( SID_DRAWTBX_INSERT, pMod );
-
     SdTbxCtlDiaPages::RegisterControl( SID_PAGES_PER_ROW, pMod );
     SdTbxCtlGlueEscDir::RegisterControl( SID_GLUE_ESCDIR, pMod );
 
diff --git a/sd/source/ui/app/tbxww.cxx b/sd/source/ui/app/tbxww.cxx
deleted file mode 100644
index ee33923..0000000
--- a/sd/source/ui/app/tbxww.cxx
+++ /dev/null
@@ -1,301 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include <sfx2/bindings.hxx>
-#include <svx/svxids.hrc>
-#include <svx/grafctrl.hxx>
-#include <svl/cjkoptions.hxx>
-#include <sfx2/viewsh.hxx>
-#include <sfx2/imagemgr.hxx>
-#include <rtl/ustring.hxx>
-#include <rtl/ustrbuf.hxx>
-
-#include "sddll.hxx"
-#include "GraphicDocShell.hxx"
-
-#include <vcl/toolbox.hxx>
-
-#include "sdmod.hxx"
-#include "app.hrc"
-#include "res_bmp.hrc"
-#include "sdresid.hxx"
-#include "tbx_ww.hxx"
-
-SFX_IMPL_TOOLBOX_CONTROL( SdTbxControl, TbxImageItem )
-
-/**
- * Class for toolbox
- */
-SdTbxControl::SdTbxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx ) :
-        SfxToolBoxControl( nSlotId, nId, rTbx )
-{
-    rTbx.SetItemBits( nId, ToolBoxItemBits::DROPDOWN | rTbx.GetItemBits( nId ) );
-    rTbx.Invalidate();
-}
-
-/**
- * We create the window here
- * You can get the position of the toolbox with GetToolBox()
- * rItemRect are screen coordinates
- */
-
-VclPtr<SfxPopupWindow> SdTbxControl::CreatePopupWindow()
-{
-    SfxPopupWindow *pWin = NULL;
-    OUString aToolBarResStr;
-    OUStringBuffer aTbxResName( "private:resource/toolbar/" );
-    switch( GetSlotId() )
-    {
-        case SID_ZOOM_TOOLBOX:
-            aTbxResName.appendAscii( "zoombar" );
-            aToolBarResStr = aTbxResName.makeStringAndClear();
-        break;
-        case SID_OBJECT_CHOOSE_MODE:
-            aTbxResName.appendAscii( "choosemodebar" );
-            aToolBarResStr = aTbxResName.makeStringAndClear();
-        break;
-        case SID_POSITION:
-            aTbxResName.appendAscii( "positionbar" );
-            aToolBarResStr = aTbxResName.makeStringAndClear();
-        break;
-        case SID_DRAWTBX_TEXT:
-            aTbxResName.appendAscii( "textbar" );
-            aToolBarResStr = aTbxResName.makeStringAndClear();
-        break;
-        case SID_DRAWTBX_RECTANGLES:
-            aTbxResName.appendAscii( "rectanglesbar" );
-            aToolBarResStr = aTbxResName.makeStringAndClear();
-        break;
-        case SID_DRAWTBX_ELLIPSES:
-            aTbxResName.appendAscii( "ellipsesbar" );
-            aToolBarResStr = aTbxResName.makeStringAndClear();
-        break;
-        case SID_DRAWTBX_LINES:
-            aTbxResName.appendAscii( "linesbar" );
-            aToolBarResStr = aTbxResName.makeStringAndClear();
-        break;
-        case SID_DRAWTBX_ARROWS:
-            aTbxResName.appendAscii( "arrowsbar" );
-            aToolBarResStr = aTbxResName.makeStringAndClear();
-        break;
-        case SID_DRAWTBX_3D_OBJECTS:
-            aTbxResName.appendAscii( "3dobjectsbar" );
-            aToolBarResStr = aTbxResName.makeStringAndClear();
-        break;
-        case SID_DRAWTBX_CONNECTORS:
-            aTbxResName.appendAscii( "connectorsbar" );
-            aToolBarResStr = aTbxResName.makeStringAndClear();
-        break;
-        case SID_DRAWTBX_INSERT:
-            aTbxResName.appendAscii( "insertbar" );
-            aToolBarResStr = aTbxResName.makeStringAndClear();
-        break;
-    }
-
-    if ( !aToolBarResStr.isEmpty() )
-        createAndPositionSubToolBar( aToolBarResStr );
-
-    return pWin;
-}
-
-/*-------------------------------------------------------------------------*/
-
-void SdTbxControl::StateChanged( sal_uInt16 nSId,
-                        SfxItemState eState, const SfxPoolItem* pState )
-{
-    SfxToolBoxControl::StateChanged( nSId, eState, pState );
-
-    if( eState == SfxItemState::DEFAULT )
-    {
-        const TbxImageItem* pItem = PTR_CAST( TbxImageItem, pState );
-        // StarDesktop can also receive another item,
-        // but it is not allowed to evaluate it
-        if( pItem )
-        {
-            ToolBox& rTbx = GetToolBox();
-            sal_uInt16 nImage = pItem->GetValue();
-            if( nImage == 0 )
-            {
-                if( rTbx.IsItemChecked( nSId ) )
-                    rTbx.CheckItem( nSId, false );
-            }
-            else
-            {
-                OUString aSlotURL( "slot:" );
-                aSlotURL += OUString::number( nImage);
-                Image aImage = GetImage( m_xFrame,
-                                         aSlotURL,
-                                         hasBigImages()
-                                       );
-
-                // !-operator checks if image is not present
-                if( !!aImage )
-                {
-                    rTbx.SetItemImage( GetId(), aImage );
-                    rTbx.CheckItem( GetId(), IsCheckable( nImage ) );
-
-                    if( nSId != SID_ZOOM_TOOLBOX &&
-                        nSId != SID_DRAWTBX_INSERT &&
-                        nSId != SID_POSITION )
-                    {
-                        if( nSId != SID_OBJECT_CHOOSE_MODE &&
-                            rTbx.IsItemChecked( SID_OBJECT_CHOOSE_MODE ) )
-                            rTbx.CheckItem( SID_OBJECT_CHOOSE_MODE, false );
-                        if( nSId != SID_DRAWTBX_TEXT &&
-                            rTbx.IsItemChecked( SID_DRAWTBX_TEXT ) )
-                             rTbx.CheckItem( SID_DRAWTBX_TEXT, false );
-                        if( nSId != SID_DRAWTBX_RECTANGLES &&
-                            rTbx.IsItemChecked( SID_DRAWTBX_RECTANGLES ) )
-                               rTbx.CheckItem( SID_DRAWTBX_RECTANGLES, false );
-                        if( nSId != SID_DRAWTBX_ELLIPSES &&
-                            rTbx.IsItemChecked( SID_DRAWTBX_ELLIPSES ) )
-                               rTbx.CheckItem( SID_DRAWTBX_ELLIPSES, false );
-                        if( nSId != SID_DRAWTBX_LINES &&
-                            rTbx.IsItemChecked( SID_DRAWTBX_LINES ) )
-                            rTbx.CheckItem( SID_DRAWTBX_LINES, false );
-                        if( nSId != SID_DRAWTBX_ARROWS &&
-                            rTbx.IsItemChecked( SID_DRAWTBX_ARROWS ) )
-                            rTbx.CheckItem( SID_DRAWTBX_ARROWS, false );
-                        if( nSId != SID_DRAWTBX_3D_OBJECTS &&
-                            rTbx.IsItemChecked( SID_DRAWTBX_3D_OBJECTS ) )
-                            rTbx.CheckItem( SID_DRAWTBX_3D_OBJECTS, false );
-                        if( nSId != SID_DRAWTBX_CONNECTORS &&
-                            rTbx.IsItemChecked( SID_DRAWTBX_CONNECTORS ) )
-                            rTbx.CheckItem( SID_DRAWTBX_CONNECTORS, false );
-                    }
-                }
-            }
-        }
-    }
-}
-
-/*-------------------------------------------------------------------------*/
-
-bool SdTbxControl::IsCheckable( sal_uInt16 nSId )
-{
-    switch( nSId )
-    {
-        case SID_OBJECT_ROTATE:
-        case SID_OBJECT_MIRROR:
-        case SID_OBJECT_CROP:
-        case SID_OBJECT_TRANSPARENCE:
-        case SID_OBJECT_GRADIENT:
-        case SID_OBJECT_SHEAR:
-        case SID_OBJECT_CROOK_ROTATE:
-        case SID_OBJECT_CROOK_SLANT:
-        case SID_OBJECT_CROOK_STRETCH:
-        case SID_CONVERT_TO_3D_LATHE:
-
-        case SID_ATTR_CHAR:
-        case SID_ATTR_CHAR_VERTICAL:
-        case SID_TEXT_FITTOSIZE:
-        case SID_TEXT_FITTOSIZE_VERTICAL:
-        case SID_DRAW_CAPTION:
-        case SID_DRAW_CAPTION_VERTICAL:
-        case SID_DRAW_FONTWORK:
-        case SID_DRAW_FONTWORK_VERTICAL:
-
-        case SID_DRAW_RECT:
-        case SID_DRAW_SQUARE:
-        case SID_DRAW_RECT_ROUND:
-        case SID_DRAW_SQUARE_ROUND:
-        case SID_DRAW_RECT_NOFILL:
-        case SID_DRAW_SQUARE_NOFILL:
-        case SID_DRAW_RECT_ROUND_NOFILL:
-        case SID_DRAW_SQUARE_ROUND_NOFILL:
-
-        case SID_DRAW_ELLIPSE:
-        case SID_DRAW_CIRCLE:
-        case SID_DRAW_PIE:
-        case SID_DRAW_CIRCLEPIE:
-        case SID_DRAW_ELLIPSECUT:
-        case SID_DRAW_CIRCLECUT:
-        case SID_DRAW_ARC:
-        case SID_DRAW_CIRCLEARC:
-        case SID_DRAW_ELLIPSE_NOFILL:
-        case SID_DRAW_CIRCLE_NOFILL:
-        case SID_DRAW_PIE_NOFILL:
-        case SID_DRAW_CIRCLEPIE_NOFILL:
-        case SID_DRAW_ELLIPSECUT_NOFILL:
-        case SID_DRAW_CIRCLECUT_NOFILL:
-
-        case SID_DRAW_BEZIER_NOFILL:
-        case SID_DRAW_POLYGON_NOFILL:
-        case SID_DRAW_XPOLYGON_NOFILL:
-        case SID_DRAW_BEZIER_FILL:
-        case SID_DRAW_POLYGON:
-        case SID_DRAW_XPOLYGON:
-        case SID_DRAW_FREELINE:
-        case SID_DRAW_FREELINE_NOFILL:
-
-        case SID_DRAW_LINE:
-        case SID_DRAW_XLINE:
-        case SID_DRAW_MEASURELINE:
-        case SID_LINE_ARROW_START:
-        case SID_LINE_ARROW_END:
-        case SID_LINE_ARROWS:
-        case SID_LINE_ARROW_CIRCLE:
-        case SID_LINE_CIRCLE_ARROW:
-        case SID_LINE_ARROW_SQUARE:
-        case SID_LINE_SQUARE_ARROW:
-
-        case SID_3D_CUBE:
-        case SID_3D_SPHERE:
-        case SID_3D_CYLINDER:
-        case SID_3D_CONE:
-        case SID_3D_PYRAMID:
-        case SID_3D_TORUS:
-        case SID_3D_SHELL:
-        case SID_3D_HALF_SPHERE:
-
-        case SID_TOOL_CONNECTOR:
-        case SID_CONNECTOR_ARROW_START:
-        case SID_CONNECTOR_ARROW_END:
-        case SID_CONNECTOR_ARROWS:
-        case SID_CONNECTOR_CIRCLE_START:
-        case SID_CONNECTOR_CIRCLE_END:
-        case SID_CONNECTOR_CIRCLES:
-        case SID_CONNECTOR_LINE:
-        case SID_CONNECTOR_LINE_ARROW_START:
-        case SID_CONNECTOR_LINE_ARROW_END:
-        case SID_CONNECTOR_LINE_ARROWS:
-        case SID_CONNECTOR_LINE_CIRCLE_START:
-        case SID_CONNECTOR_LINE_CIRCLE_END:
-        case SID_CONNECTOR_LINE_CIRCLES:
-        case SID_CONNECTOR_CURVE:
-        case SID_CONNECTOR_CURVE_ARROW_START:
-        case SID_CONNECTOR_CURVE_ARROW_END:
-        case SID_CONNECTOR_CURVE_ARROWS:
-        case SID_CONNECTOR_CURVE_CIRCLE_START:
-        case SID_CONNECTOR_CURVE_CIRCLE_END:
-        case SID_CONNECTOR_CURVE_CIRCLES:
-        case SID_CONNECTOR_LINES:
-        case SID_CONNECTOR_LINES_ARROW_START:
-        case SID_CONNECTOR_LINES_ARROW_END:
-        case SID_CONNECTOR_LINES_ARROWS:
-        case SID_CONNECTOR_LINES_CIRCLE_START:
-        case SID_CONNECTOR_LINES_CIRCLE_END:
-        case SID_CONNECTOR_LINES_CIRCLES:
-
-            return true;
-    }
-    return false;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/func/fusel.cxx b/sd/source/ui/func/fusel.cxx
index 000ac60..dd9520a 100644
--- a/sd/source/ui/func/fusel.cxx
+++ b/sd/source/ui/func/fusel.cxx
@@ -1030,14 +1030,6 @@ void FuSelection::Activate()
     {
         case SID_OBJECT_ROTATE:
         {
-            // (mapped) Slot is explicitly set to rotate
-            if( mpViewShell->ISA(DrawViewShell) )
-            {
-                sal_uInt16* pSlotArray =
-                    static_cast<DrawViewShell*>(mpViewShell)->GetSlotArray();
-                pSlotArray[ 1 ] = SID_OBJECT_ROTATE;
-            }
-
             eMode = SDRDRAG_ROTATE;
 
             if ( mpView->GetDragMode() != eMode )
diff --git a/sd/source/ui/inc/DrawViewShell.hxx b/sd/source/ui/inc/DrawViewShell.hxx
index c5c89ba..34b0929 100644
--- a/sd/source/ui/inc/DrawViewShell.hxx
+++ b/sd/source/ui/inc/DrawViewShell.hxx
@@ -66,8 +66,6 @@ class DrawViewShell
       public SfxListener
 {
 public:
-    static const int SLOTARRAY_COUNT = 22;
-
     TYPEINFO_OVERRIDE();
     SFX_DECL_INTERFACE(SD_IF_SDDRAWVIEWSHELL)
 
@@ -303,8 +301,6 @@ public:
 
     bool IsLayerModeActive() const { return mbIsLayerModeActive;}
 
-    sal_uInt16*         GetSlotArray() const { return mpSlotArray; }
-
     virtual sal_Int8    AcceptDrop( const AcceptDropEvent& rEvt, DropTargetHelper& rTargetHelper,
                                     ::sd::Window* pTargetWindow, sal_uInt16 nPage, sal_uInt16 nLayer ) SAL_OVERRIDE;
     virtual sal_Int8    ExecuteDrop( const ExecuteDropEvent& rEvt, DropTargetHelper& rTargetHelper,
@@ -406,8 +402,6 @@ protected:
     bool            mbIsRulerDrag;
     sal_uLong           mnLockCount;
     bool            mbReadOnly;
-    sal_uInt16*         mpSlotArray;
-
     static bool     mbPipette;
 
                     DECL_LINK( ClipboardChanged, TransferableDataHelper* );
@@ -428,11 +422,6 @@ protected:
                                bool bSize, bool bMargin, bool bScaleAll );
 
     static sal_uInt16 GetIdBySubId( sal_uInt16 nSId );
-    void            MapSlot( sal_uInt16 nSId );
-    void            UpdateToolboxImages( SfxItemSet &rSet, bool bPermanent = true );
-    sal_uInt16      GetMappedSlot( sal_uInt16 nSId );
-    sal_uInt16      GetArrayId( sal_uInt16 nSId );
-
     void            GetMenuStateSel(SfxItemSet& rSet);
 
 private:
diff --git a/sd/source/ui/inc/tbx_ww.hxx b/sd/source/ui/inc/tbx_ww.hxx
deleted file mode 100644
index d65c0bc..0000000
--- a/sd/source/ui/inc/tbx_ww.hxx
+++ /dev/null
@@ -1,44 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef INCLUDED_SD_SOURCE_UI_INC_TBX_WW_HXX
-#define INCLUDED_SD_SOURCE_UI_INC_TBX_WW_HXX
-
-#include <sdresid.hxx>
-#include <sfx2/tbxctrl.hxx>
-
-class SdTbxControl : public SfxToolBoxControl
-{
-private:
-    static bool IsCheckable( sal_uInt16 nSId );
-
-public:
-            SFX_DECL_TOOLBOX_CONTROL();
-
-            SdTbxControl(sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
-            virtual ~SdTbxControl() {}
-
-    virtual VclPtr<SfxPopupWindow> CreatePopupWindow() SAL_OVERRIDE;
-    virtual void StateChanged( sal_uInt16 nSId, SfxItemState eState,
-                                const SfxPoolItem* pState ) SAL_OVERRIDE;
-};
-
-#endif // INCLUDED_SD_SOURCE_UI_INC_TBX_WW_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index 00d4a19..7108b35 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -206,9 +206,6 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
 
     sal_uInt16 nSId = rReq.GetSlot();
 
-    // Slot gets mapped (ToolboxImages/-Slots)
-    MapSlot( nSId );
-
     switch ( nSId )
     {
         case SID_OUTLINE_TEXT_AUTOFIT:
@@ -2947,8 +2944,6 @@ void DrawViewShell::ExecChar( SfxRequest &rReq )
 
     sal_uInt16 nSId = rReq.GetSlot();
 
-    MapSlot( nSId );
-
     switch ( nSId )
     {
     case SID_ATTR_CHAR_FONT:
diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx
index c8311e9..ca5023b 100644
--- a/sd/source/ui/view/drviews7.cxx
+++ b/sd/source/ui/view/drviews7.cxx
@@ -275,42 +275,14 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet )
     // State of SfxChild-Windows (Animator, Fontwork etc.)
     SetChildWindowState( rSet );
 
-    // map images of toolboxes (only zoom)
-    UpdateToolboxImages( rSet, false );
-
     if(HasCurrentFunction())
     {
         sal_uInt16 nSId = GetCurrentFunction()->GetSlotID();
+        sal_uInt16 nMainId = GetIdBySubId( nSId );
 
         rSet.Put( SfxBoolItem( nSId, true ) );
-
-        // will cause a uncheck of a simulated slot
-        sal_uInt16 nId = GetIdBySubId( nSId );
-
-        // map images of the toolboxes
-        UpdateToolboxImages( rSet );
-
-        if( nSId != SID_ZOOM_TOOLBOX &&
-            nSId != SID_DRAWTBX_INSERT &&
-            nSId != SID_POSITION )
-        {
-            if( nId != SID_OBJECT_CHOOSE_MODE )
-                rSet.Put( TbxImageItem( SID_OBJECT_CHOOSE_MODE, 0 ) );
-            if( nId != SID_DRAWTBX_TEXT )
-                rSet.Put( TbxImageItem( SID_DRAWTBX_TEXT, 0 ) );
-            if( nId != SID_DRAWTBX_RECTANGLES )
-                rSet.Put( TbxImageItem( SID_DRAWTBX_RECTANGLES, 0 ) );
-            if( nId != SID_DRAWTBX_ELLIPSES )
-                rSet.Put( TbxImageItem( SID_DRAWTBX_ELLIPSES, 0 ) );
-            if( nId != SID_DRAWTBX_LINES )
-                rSet.Put( TbxImageItem( SID_DRAWTBX_LINES, 0 ) );
-            if( nId != SID_DRAWTBX_ARROWS )
-                rSet.Put( TbxImageItem( SID_DRAWTBX_ARROWS, 0 ) );
-            if( nId != SID_DRAWTBX_3D_OBJECTS )
-                rSet.Put( TbxImageItem( SID_DRAWTBX_3D_OBJECTS, 0 ) );
-            if( nId != SID_DRAWTBX_CONNECTORS )
-                rSet.Put( TbxImageItem( SID_DRAWTBX_CONNECTORS, 0 ) );
-        }
+        if ( nMainId != 0 )
+            rSet.Put( SfxBoolItem( nMainId, true ) );
     }
 
     SdrPageView* pPageView = mpDrawView->GetSdrPageView();
@@ -1075,9 +1047,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet )
             nCurrentSId = SID_ATTR_CHAR;
 
         rSet.Put( SfxBoolItem( nCurrentSId, true ) );
-
-        // Short version of UpdateToolboxImages()
-        rSet.Put( TbxImageItem( SID_DRAWTBX_TEXT, nCurrentSId ) );
+        rSet.Put( SfxBoolItem( SID_DRAWTBX_TEXT, true ) );
     }
 
     if ( GetDocSh()->IsReadOnly() )
diff --git a/sd/source/ui/view/drviewsa.cxx b/sd/source/ui/view/drviewsa.cxx
index 2176907..73ecd79 100644
--- a/sd/source/ui/view/drviewsa.cxx
+++ b/sd/source/ui/view/drviewsa.cxx
@@ -191,8 +191,6 @@ DrawViewShell::~DrawViewShell()
     mpView = mpDrawView = NULL;
 
     mpFrameView->Disconnect();
-    delete [] mpSlotArray;
-
     maTabControl.disposeAndClear();
 }
 
@@ -204,7 +202,6 @@ void DrawViewShell::Construct(DrawDocShell* pDocSh, PageKind eInitialPageKind)
     mpActualPage = 0;
     mbMousePosFreezed = false;
     mbReadOnly = GetDocSh()->IsReadOnly();
-    mpSlotArray = 0;
     mpClipEvtLstnr = 0;
     mbPastePossible = false;
     mbIsLayerModeActive = false;
@@ -216,35 +213,6 @@ void DrawViewShell::Construct(DrawDocShell* pDocSh, PageKind eInitialPageKind)
 
     OSL_ASSERT (GetViewShell()!=NULL);
 
-    /* array for slot-/image mapping:
-       even entry: main-/toolbox slot
-       odd entry:  mapped slot
-       Attention: adjust GetIdBySubId() !!!
-       Do not change order (especial zoom) !!! */
-    mpSlotArray = new sal_uInt16[ SLOTARRAY_COUNT ];
-    mpSlotArray[ 0 ]  = SID_OBJECT_CHOOSE_MODE;
-    mpSlotArray[ 1 ]  = SID_OBJECT_ROTATE;
-    mpSlotArray[ 2 ]  = SID_ZOOM_TOOLBOX;
-    mpSlotArray[ 3 ]  = SID_ZOOM_TOOLBOX;
-    mpSlotArray[ 4 ]  = SID_DRAWTBX_TEXT;
-    mpSlotArray[ 5 ]  = SID_ATTR_CHAR;
-    mpSlotArray[ 6 ]  = SID_DRAWTBX_RECTANGLES;
-    mpSlotArray[ 7 ]  = SID_DRAW_RECT;
-    mpSlotArray[ 8 ]  = SID_DRAWTBX_ELLIPSES;
-    mpSlotArray[ 9 ]  = SID_DRAW_ELLIPSE;
-    mpSlotArray[ 10 ] = SID_DRAWTBX_LINES;
-    mpSlotArray[ 11 ] = SID_DRAW_FREELINE_NOFILL;
-    mpSlotArray[ 12 ] = SID_DRAWTBX_3D_OBJECTS;
-    mpSlotArray[ 13 ] = SID_3D_CUBE;
-    mpSlotArray[ 14 ] = SID_DRAWTBX_INSERT;
-    mpSlotArray[ 15 ] = SID_INSERT_DIAGRAM;
-    mpSlotArray[ 16 ] = SID_POSITION;
-    mpSlotArray[ 17 ] = SID_FRAME_TO_TOP;
-    mpSlotArray[ 18 ] = SID_DRAWTBX_CONNECTORS;
-    mpSlotArray[ 19 ] = SID_TOOL_CONNECTOR;
-    mpSlotArray[ 20 ] = SID_DRAWTBX_ARROWS;
-    mpSlotArray[ 21 ] = SID_LINE_ARROW_END;
-
     SetPool( &GetDoc()->GetPool() );
 
     GetDoc()->CreateFirstPages();
diff --git a/sd/source/ui/view/drviewsc.cxx b/sd/source/ui/view/drviewsc.cxx
index 0bacea5..78afdcf 100644
--- a/sd/source/ui/view/drviewsc.cxx
+++ b/sd/source/ui/view/drviewsc.cxx
@@ -52,7 +52,7 @@
 namespace sd {
 
 /**
- * Returns the global/main ID, i.e. the ID, which is used to execute the toolbox
+ * Returns the ID of the group button, if it should be toggled.
  */
 sal_uInt16 DrawViewShell::GetIdBySubId( sal_uInt16 nSId )
 {
@@ -73,28 +73,14 @@ sal_uInt16 DrawViewShell::GetIdBySubId( sal_uInt16 nSId )
         }
         break;
 
-        case SID_FRAME_TO_TOP:
-        case SID_MOREFRONT:
-        case SID_MOREBACK:
-        case SID_FRAME_TO_BOTTOM:
         case SID_BEFORE_OBJ:
         case SID_BEHIND_OBJ:
-        case SID_REVERSE_ORDER:
         {
             nMappedSId = SID_POSITION;
         }
         break;
 
-        case SID_ZOOM_OUT:
-        case SID_ZOOM_IN:
-        case SID_SIZE_REAL:
         case SID_ZOOM_PANNING:
-        case SID_SIZE_PAGE:
-        case SID_SIZE_PAGE_WIDTH:
-        case SID_SIZE_ALL:
-        case SID_SIZE_OPTIMAL:
-        case SID_ZOOM_NEXT:
-        case SID_ZOOM_PREV:
         case SID_ZOOM_MODE:
         {
             nMappedSId = SID_ZOOM_TOOLBOX;
@@ -184,24 +170,6 @@ sal_uInt16 DrawViewShell::GetIdBySubId( sal_uInt16 nSId )
         }
         break;
 
-        case SID_INSERT_DIAGRAM:
-        case SID_ATTR_TABLE:
-        case SID_INSERTFILE:
-        case SID_INSERT_GRAPHIC:
-        case SID_INSERT_AVMEDIA:
-        case SID_INSERTPAGE:
-        case SID_INSERT_MATH:
-        case SID_INSERT_FLOATINGFRAME:
-        case SID_INSERT_OBJECT:
-        case SID_INSERT_PLUGIN:
-        case SID_INSERT_SOUND:
-        case SID_INSERT_VIDEO:
-        case SID_INSERT_TABLE:
-        {
-            nMappedSId = SID_DRAWTBX_INSERT;
-        }
-        break;
-
         case SID_TOOL_CONNECTOR:
         case SID_CONNECTOR_ARROW_START:
         case SID_CONNECTOR_ARROW_END:
@@ -237,74 +205,6 @@ sal_uInt16 DrawViewShell::GetIdBySubId( sal_uInt16 nSId )
     return nMappedSId;
 }
 
-/**
- * Fills the SlotArray in order to get the current mapping of the ToolboxSlots
- */
-void DrawViewShell::MapSlot( sal_uInt16 nSId )
-{
-    sal_uInt16 nMappedSId = GetIdBySubId( nSId );
-
-    if( nMappedSId > 0 )
-    {
-        sal_uInt16 nID = GetArrayId( nMappedSId ) + 1;
-        mpSlotArray[ nID ] = nSId;
-    }
-}
-
-/**
- * Allows a ImageMapping via SlotArray
- */
-void DrawViewShell::UpdateToolboxImages( SfxItemSet &rSet, bool bPermanent )
-{
-    if( !bPermanent )
-    {
-        sal_uInt16 nId = GetArrayId( SID_ZOOM_TOOLBOX ) + 1;
-        rSet.Put( TbxImageItem( SID_ZOOM_TOOLBOX, mpSlotArray[nId] ) );
-
-        nId = GetArrayId( SID_DRAWTBX_INSERT ) + 1;
-        rSet.Put( TbxImageItem( SID_DRAWTBX_INSERT, mpSlotArray[nId] ) );
-
-        nId = GetArrayId( SID_POSITION ) + 1;
-        rSet.Put( TbxImageItem( SID_POSITION, mpSlotArray[nId] ) );
-    }
-    else
-    {
-        for( sal_uInt16 nId = 0; nId < SLOTARRAY_COUNT; nId += 2 )
-        {
-            rSet.Put( TbxImageItem( mpSlotArray[nId], mpSlotArray[nId+1] ) );
-        }
-    }
-}
-
-sal_uInt16 DrawViewShell::GetMappedSlot( sal_uInt16 nSId )
-{
-    sal_uInt16 nSlot = 0;
-    sal_uInt16 nId = GetArrayId( nSId );
-    if( nId != USHRT_MAX )
-        nSlot = mpSlotArray[ nId+1 ];
-
-    /* If the slot is mapped to itself, we have to return 0. Otherwise the slot
-       would be executed over and over again. The slot is initial available in
-       the array in order to show the image correct.  */
-    if( nSId == nSlot )
-        return 0;
-
-    return nSlot;
-}
-
-/**
- * @returns number of the main slot in the slot array
- */
-sal_uInt16 DrawViewShell::GetArrayId( sal_uInt16 nSId )
-{
-    for( sal_uInt16 i = 0; i < SLOTARRAY_COUNT; i += 2 )
-    {
-        if( mpSlotArray[ i ] == nSId )
-            return i;
-    }
-    OSL_FAIL( "Slot in array not found!" );
-    return USHRT_MAX;
-}
 
 void DrawViewShell::UpdateIMapDlg( SdrObject* pObj )
 {
diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx
index 84208f1..70cd2f6 100644
--- a/sd/source/ui/view/drviewse.cxx
+++ b/sd/source/ui/view/drviewse.cxx
@@ -159,8 +159,6 @@ void DrawViewShell::FuPermanent(SfxRequest& rReq)
             pFuText->SetPermanent(true);
             xFunc->ReceiveRequest( rReq );
 
-            MapSlot( nSId );
-
             Invalidate();
 
             Invalidate();
@@ -227,9 +225,6 @@ void DrawViewShell::FuPermanent(SfxRequest& rReq)
         rBind.Update(nOldSId);
     }
 
-    // map Slot (ToolboxImages/-Slots)
-    MapSlot( nSId );
-
     switch ( nSId )
     {
         case SID_TEXTEDIT:  // BASIC ???
@@ -713,9 +708,6 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
 
     sal_uInt16 nSId = rReq.GetSlot();
 
-    // maybe we map the slot (ToolboxImages/-Slots)
-    MapSlot( nSId );
-
     switch ( nSId )
     {
         case SID_CLEAR_UNDO_STACK:
@@ -725,28 +717,6 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
         }
         break;
 
-        // execute slots of ToolboxController mapped
-        case SID_OBJECT_CHOOSE_MODE:
-        case SID_POSITION:
-        case SID_ZOOM_TOOLBOX:
-        case SID_DRAWTBX_TEXT:
-        case SID_DRAWTBX_RECTANGLES:
-        case SID_DRAWTBX_ELLIPSES:
-        case SID_DRAWTBX_LINES:
-        case SID_DRAWTBX_ARROWS:
-        case SID_DRAWTBX_3D_OBJECTS:
-        case SID_DRAWTBX_CONNECTORS:
-        case SID_DRAWTBX_INSERT:
-        {
-            sal_uInt16 nMappedSlot = GetMappedSlot( nSId );
-            if( nMappedSlot > 0 )
-            {
-                SfxRequest aReq( nMappedSlot, SfxCallMode::SLOT, GetDoc()->GetItemPool() );
-                ExecuteSlot( aReq );
-            }
-        }
-        break;
-
         case SID_PRESENTATION:
         case SID_PRESENTATION_CURRENT_SLIDE:
         case SID_REHEARSE_TIMINGS:
diff --git a/sd/source/ui/view/drviewsj.cxx b/sd/source/ui/view/drviewsj.cxx
index f239c36..fabeb63 100644
--- a/sd/source/ui/view/drviewsj.cxx
+++ b/sd/source/ui/view/drviewsj.cxx
@@ -241,6 +241,7 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet )
                 rSet.DisableItem( SID_BEFORE_OBJ );
                 rSet.DisableItem( SID_BEHIND_OBJ );
                 rSet.DisableItem( SID_REVERSE_ORDER );
+                rSet.DisableItem( SID_POSITION );
             }
         }
 
@@ -429,6 +430,7 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet )
                 rSet.DisableItem( SID_BEFORE_OBJ );
                 rSet.DisableItem( SID_BEHIND_OBJ );
                 rSet.DisableItem( SID_REVERSE_ORDER );
+                rSet.DisableItem( SID_POSITION );
             }
         }
 
@@ -488,6 +490,7 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet )
         rSet.DisableItem( SID_BEFORE_OBJ );
         rSet.DisableItem( SID_BEHIND_OBJ );
         rSet.DisableItem( SID_CONVERT );
+        rSet.DisableItem( SID_POSITION );
 
         rSet.DisableItem( SID_SIZE_OPTIMAL );
         rSet.DisableItem( SID_LINEEND_POLYGON );
diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi
index fbb8f60..04f61b7 100644
--- a/sfx2/sdi/sfx.sdi
+++ b/sfx2/sdi/sfx.sdi
@@ -6668,7 +6668,7 @@ SfxVoidItem ZoomPrevious SID_ZOOM_PREV
 ]
 
 
-TbxImageItem ZoomToolBox SID_ZOOM_TOOLBOX
+SfxBoolItem ZoomToolBox SID_ZOOM_TOOLBOX
 
 [
     /* flags: */
diff --git a/sfx2/source/toolbox/tbxitem.cxx b/sfx2/source/toolbox/tbxitem.cxx
index aae7ef3..41caaa3 100644
--- a/sfx2/source/toolbox/tbxitem.cxx
+++ b/sfx2/source/toolbox/tbxitem.cxx
@@ -193,8 +193,6 @@ struct SfxToolBoxControl_Impl
     sal_uInt16              nSlotId;
     VclPtr<SfxPopupWindow>  mpFloatingWindow;
     VclPtr<SfxPopupWindow>  mpPopupWindow;
-    Reference< XUIElement > mxUIElement;
-
     DECL_LINK( WindowEventListener, VclSimpleEvent* );
 };
 
@@ -239,12 +237,6 @@ SfxToolBoxControl::SfxToolBoxControl(
 
 SfxToolBoxControl::~SfxToolBoxControl()
 {
-    if ( pImpl->mxUIElement.is() )
-    {
-        Reference< XComponent > xComponent( pImpl->mxUIElement, UNO_QUERY );
-        xComponent->dispose();
-    }
-    pImpl->mxUIElement = 0;
     delete pImpl;
 }
 
@@ -278,18 +270,6 @@ void SAL_CALL SfxToolBoxControl::dispose() throw (::com::sun::star::uno::Runtime
     pImpl->pBox->SetItemWindow( pImpl->nTbxId, 0 );
     pWindow.disposeAndClear();
 
-    // Dispose an open sub toolbar. It's possible that we have an open
-    // sub toolbar while we get disposed. Therefore we have to dispose
-    // it now! Not doing so would result in a crash. The sub toolbar
-    // gets destroyed asynchronously and would access a non-existing
-    // parent toolbar!
-    if ( pImpl->mxUIElement.is() )
-    {
-        Reference< XComponent > xComponent( pImpl->mxUIElement, UNO_QUERY );
-        xComponent->dispose();
-    }
-    pImpl->mxUIElement = 0;
-
     // Delete my popup windows
     pImpl->mpFloatingWindow.disposeAndClear();
     pImpl->mpPopupWindow.disposeAndClear();
@@ -635,218 +615,11 @@ Reference< ::com::sun::star::awt::XWindow > SAL_CALL SfxToolBoxControl::createIt
     return VCLUnoHelper::GetInterface( CreateItemWindow( VCLUnoHelper::GetWindow( rParent )));
 }
 
-// XDockableWindowListener
-void SAL_CALL SfxToolBoxControl::startDocking( const ::com::sun::star::awt::DockingEvent& )
-throw (::com::sun::star::uno::RuntimeException, std::exception)
-{
-}
-::com::sun::star::awt::DockingData SAL_CALL SfxToolBoxControl::docking( const ::com::sun::star::awt::DockingEvent& )
-throw (::com::sun::star::uno::RuntimeException, std::exception)
-{
-    return ::com::sun::star::awt::DockingData();
-}
-
-void SAL_CALL SfxToolBoxControl::endDocking( const ::com::sun::star::awt::EndDockingEvent& )
-throw (::com::sun::star::uno::RuntimeException, std::exception)
-{
-}
-
-sal_Bool SAL_CALL SfxToolBoxControl::prepareToggleFloatingMode( const ::com::sun::star::lang::EventObject& )
-throw (::com::sun::star::uno::RuntimeException, std::exception)
-{
-    return sal_False;
-}
-
-void SAL_CALL SfxToolBoxControl::toggleFloatingMode( const ::com::sun::star::lang::EventObject& )
-throw (::com::sun::star::uno::RuntimeException, std::exception)
-{
-}
-
-void SAL_CALL SfxToolBoxControl::closed( const ::com::sun::star::lang::EventObject& )
-throw (::com::sun::star::uno::RuntimeException, std::exception)
-{
-}
-
-void SAL_CALL SfxToolBoxControl::endPopupMode( const ::com::sun::star::awt::EndPopupModeEvent& aEvent )
-throw (::com::sun::star::uno::RuntimeException, std::exception)
-{
-    SolarMutexGuard aGuard;
-
-    OUString aSubToolBarResName;
-    if ( pImpl->mxUIElement.is() )
-    {
-        Reference< XPropertySet > xPropSet( pImpl->mxUIElement, UNO_QUERY );
-        if ( xPropSet.is() )
-        {
-            try
-            {
-                xPropSet->getPropertyValue("ResourceURL") >>= aSubToolBarResName;
-            }
-            catch ( com::sun::star::beans::UnknownPropertyException& )
-            {
-            }
-            catch ( com::sun::star::lang::WrappedTargetException& )
-            {
-            }
-        }
-
-        Reference< XComponent > xComponent( pImpl->mxUIElement, UNO_QUERY );
-        xComponent->dispose();
-    }
-    pImpl->mxUIElement = 0;
-
-    // if the toolbar was teared-off recreate it and place it at the given position
-    if( aEvent.bTearoff )
-    {
-        Reference< XUIElement >     xUIElement;
-        Reference< XLayoutManager > xLayoutManager = getLayoutManager();
-
-        if ( !xLayoutManager.is() )
-            return;
-
-        xLayoutManager->createElement( aSubToolBarResName );
-        xUIElement = xLayoutManager->getElement( aSubToolBarResName );
-        if ( xUIElement.is() )
-        {
-            Reference< ::com::sun::star::awt::XWindow > xParent = getFrameInterface()->getContainerWindow();
-
-            Reference< ::com::sun::star::awt::XWindow > xSubToolBar( xUIElement->getRealInterface(), UNO_QUERY );
-            Reference< ::com::sun::star::beans::XPropertySet > xProp( xUIElement, UNO_QUERY );
-            if ( xSubToolBar.is() && xProp.is() )
-            {
-                OUString aPersistentString( "Persistent" );
-                try
-                {
-                    vcl::Window*  pTbxWindow = VCLUnoHelper::GetWindow( xSubToolBar );
-                    if ( pTbxWindow && pTbxWindow->GetType() == WINDOW_TOOLBOX )
-                    {
-                        Any a;
-                        a = xProp->getPropertyValue( aPersistentString );
-                        xProp->setPropertyValue( aPersistentString, makeAny( sal_False ));
-
-                        xLayoutManager->hideElement( aSubToolBarResName );
-                        xLayoutManager->floatWindow( aSubToolBarResName );
-
-                        xLayoutManager->setElementPos( aSubToolBarResName, aEvent.FloatingPosition );
-                        xLayoutManager->showElement( aSubToolBarResName );
-
-                        xProp->setPropertyValue("Persistent", a );
-                    }
-                }
-                catch ( ::com::sun::star::uno::RuntimeException& )
-                {
-                    throw;
-                }
-                catch ( ::com::sun::star::uno::Exception& )
-                {
-                }
-            }
-        }
-    }
-}
-
-::Size  SfxToolBoxControl::getPersistentFloatingSize( const Reference< XFrame >& /*xFrame*/, const OUString& /*rSubToolBarResName*/ )
-{
-    ::Size  aToolboxSize;
-    return aToolboxSize;
-}
-
 bool SfxToolBoxControl::hasBigImages() const
 {
     return (GetToolBox().GetToolboxButtonSize() == TOOLBOX_BUTTONSIZE_LARGE);
 }
 
-void SfxToolBoxControl::createAndPositionSubToolBar( const OUString& rSubToolBarResName )
-{
-    SolarMutexGuard aGuard;
-
-    if ( pImpl->pBox )
-    {
-        static WeakReference< XUIElementFactoryManager > xWeakUIElementFactory;
-
-        sal_uInt16 nItemId = pImpl->pBox->GetDownItemId();
-
-        if ( !nItemId )
-            return;
-
-        // create element with factory
-        Reference< XFrame >                 xFrame          = getFrameInterface();
-        Reference< XUIElement >             xUIElement;
-        Reference< XUIElementFactoryManager >  xUIElementFactory;
-
-        xUIElementFactory = xWeakUIElementFactory;
-        if ( !xUIElementFactory.is() )
-        {
-            xUIElementFactory = theUIElementFactoryManager::get( m_xContext );
-            xWeakUIElementFactory = xUIElementFactory;
-        }
-
-        Sequence< PropertyValue > aPropSeq( 3 );
-        aPropSeq[0].Name = "Frame";
-        aPropSeq[0].Value <<= xFrame;
-        aPropSeq[1].Name = "Persistent";
-        aPropSeq[1].Value <<= sal_False;
-        aPropSeq[2].Name = "PopupMode";
-        aPropSeq[2].Value <<= sal_True;
-
-        try
-        {
-            xUIElement = xUIElementFactory->createUIElement( rSubToolBarResName, aPropSeq );
-        }
-        catch ( ::com::sun::star::container::NoSuchElementException& )
-        {
-        }
-        catch ( IllegalArgumentException& )
-        {
-        }
-
-        if ( xUIElement.is() )
-        {
-            Reference< ::com::sun::star::awt::XWindow > xParent = getFrameInterface()->getContainerWindow();
-
-            Reference< ::com::sun::star::awt::XWindow > xSubToolBar( xUIElement->getRealInterface(), UNO_QUERY );
-            if ( xSubToolBar.is() )
-            {
-                Reference< ::com::sun::star::awt::XDockableWindow > xDockWindow( xSubToolBar, UNO_QUERY );
-                xDockWindow->addDockableWindowListener( Reference< ::com::sun::star::awt::XDockableWindowListener >(
-                    static_cast< OWeakObject * >( this ), UNO_QUERY ));
-                xDockWindow->enableDocking( sal_True );
-
-                // keep refererence to UIElement to avoid its destruction
-                if ( pImpl->mxUIElement.is() )
-                {
-                    Reference< XComponent > xComponent( pImpl->mxUIElement, UNO_QUERY );
-                    xComponent->dispose();
-                }
-                pImpl->mxUIElement = xUIElement;
-
-                vcl::Window*  pTbxWindow = VCLUnoHelper::GetWindow( xSubToolBar );
-                ToolBox* pToolBar( 0 );
-                if ( pTbxWindow && pTbxWindow->GetType() == WINDOW_TOOLBOX )
-                    pToolBar = static_cast<ToolBox *>(pTbxWindow);
-
-                if ( pToolBar )
-                {
-                    vcl::Window*  pParentTbxWindow( pImpl->pBox );
-                    pToolBar->SetParent( pParentTbxWindow );
-                    ::Size aSize = getPersistentFloatingSize( xFrame, rSubToolBarResName );
-                    if ( aSize.Width() == 0 || aSize.Height() == 0 )
-                    {
-                        // calc and set size for popup mode
-                        aSize = pToolBar->CalcPopupWindowSizePixel();
-                    }
-                    pToolBar->SetSizePixel( aSize );
-
-                    // open subtoolbox in popup mode
-                    vcl::Window::GetDockingManager()->StartPopupMode( pImpl->pBox, pToolBar );
-                }
-            }
-        }
-    }
-}
-
-
-
 void SfxToolBoxControl::SetPopupWindow( SfxPopupWindow* pWindow )
 {
     pImpl->mpPopupWindow = pWindow;


More information about the Libreoffice-commits mailing list