diff options
author | Maxim Monastirsky <momonasmon@gmail.com> | 2015-07-18 21:51:27 +0300 |
---|---|---|
committer | Maxim Monastirsky <momonasmon@gmail.com> | 2015-07-18 22:16:39 +0300 |
commit | 7352a7c17875e5adcc4226c45f4a03e11c44ff49 (patch) | |
tree | 29a10d45779472d1b5c342c772867d80baf21864 /sd | |
parent | 9f75bad228ca1f410b7a450084b02ad13745110e (diff) |
Convert SdTbxControl to the generic controller
And remove the now unused stuff from SfxToolBoxControl.
Change-Id: I8805ba96a5dc41076d9cb8d887759a578a33526d
Diffstat (limited to 'sd')
-rw-r--r-- | sd/Library_sd.mk | 1 | ||||
-rw-r--r-- | sd/sdi/sdraw.sdi | 20 | ||||
-rw-r--r-- | sd/source/ui/app/sddll.cxx | 14 | ||||
-rw-r--r-- | sd/source/ui/app/tbxww.cxx | 301 | ||||
-rw-r--r-- | sd/source/ui/func/fusel.cxx | 8 | ||||
-rw-r--r-- | sd/source/ui/inc/DrawViewShell.hxx | 11 | ||||
-rw-r--r-- | sd/source/ui/inc/tbx_ww.hxx | 44 | ||||
-rw-r--r-- | sd/source/ui/view/drviews2.cxx | 5 | ||||
-rw-r--r-- | sd/source/ui/view/drviews7.cxx | 38 | ||||
-rw-r--r-- | sd/source/ui/view/drviewsa.cxx | 32 | ||||
-rw-r--r-- | sd/source/ui/view/drviewsc.cxx | 102 | ||||
-rw-r--r-- | sd/source/ui/view/drviewse.cxx | 30 | ||||
-rw-r--r-- | sd/source/ui/view/drviewsj.cxx | 3 |
13 files changed, 18 insertions, 591 deletions
diff --git a/sd/Library_sd.mk b/sd/Library_sd.mk index cf99782cd1da..7a9078f5418e 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 34996c0170a5..4a024352d829 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 8fb1907793e4..fe9e58a5c048 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 ee3392332f75..000000000000 --- 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 000ac6097e7d..dd9520af513b 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 c5c89ba48715..34b0929b439a 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 d65c0bc88d1a..000000000000 --- 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 00d4a19780ed..7108b3571d12 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 c8311e908230..ca5023b8ea39 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 2176907053b4..73ecd791e61e 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 0bacea5cb1db..78afdcf83cf9 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 84208f1aaa3d..70cd2f6e8fc1 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 f239c3687909..fabeb636bb63 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 ); |