include/avmedia/mediatoolbox.hxx | 4 include/svx/grafctrl.hxx | 17 - include/svx/subtoolboxcontrol.hxx | 47 ---- officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu | 70 ++++++ sc/Library_sc.mk | 1 sc/sdi/scalc.sdi | 4 sc/sdi/tabvwsh.sdi | 4 sc/source/ui/app/scdll.cxx | 4 sc/source/ui/cctrl/tbinsert.cxx | 106 ---------- sc/source/ui/inc/tabvwsh.hxx | 6 sc/source/ui/inc/tbinsert.hxx | 44 ---- sc/source/ui/view/tabvwsh4.cxx | 35 --- sd/inc/pch/precompiled_sd.hxx | 1 sd/source/ui/app/sddll.cxx | 3 svx/Library_svx.mk | 1 svx/sdi/svx.sdi | 4 svx/source/tbxctrls/grafctrl.cxx | 26 -- svx/source/tbxctrls/subtoolboxcontrol.cxx | 55 ----- sw/Library_sw.mk | 1 sw/inc/view.hxx | 4 sw/sdi/_viewsh.sdi | 4 sw/sdi/swriter.sdi | 6 sw/sdi/viewsh.sdi | 1 sw/source/uibase/app/swmodule.cxx | 6 sw/source/uibase/inc/tblctrl.hxx | 39 --- sw/source/uibase/inc/workctrl.hxx | 20 - sw/source/uibase/ribbar/tblctrl.cxx | 50 ---- sw/source/uibase/ribbar/workctrl.cxx | 89 -------- sw/source/uibase/uiview/view.cxx | 4 sw/source/uibase/uiview/view2.cxx | 24 -- sw/source/uibase/uiview/viewstat.cxx | 30 -- 31 files changed, 80 insertions(+), 630 deletions(-)
New commits: commit a3050f632517137f809d76662170726b518f043a Author: Maxim Monastirsky <[email protected]> Date: Tue Jul 14 17:24:23 2015 +0300 Convert filters button to the generic controller Change-Id: I6d3c76c0aafe0ad77b597a2cb8331e6f8219e2d2 diff --git a/include/avmedia/mediatoolbox.hxx b/include/avmedia/mediatoolbox.hxx index fb61d33..e0ccd86 100644 --- a/include/avmedia/mediatoolbox.hxx +++ b/include/avmedia/mediatoolbox.hxx @@ -27,10 +27,6 @@ namespace avmedia { - -// - SvxGrafFilterToolBoxControl - - - class MediaItem; class AVMEDIA_DLLPUBLIC MediaToolBoxControl : public SfxToolBoxControl diff --git a/include/svx/grafctrl.hxx b/include/svx/grafctrl.hxx index c91ff3a..1adcc39 100644 --- a/include/svx/grafctrl.hxx +++ b/include/svx/grafctrl.hxx @@ -40,23 +40,6 @@ public: }; -// - SvxGrafFilterToolBoxControl - - - -class SVX_DLLPUBLIC SvxGrafFilterToolBoxControl : public SfxToolBoxControl -{ -public: - - SFX_DECL_TOOLBOX_CONTROL(); - - SvxGrafFilterToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx ); - virtual ~SvxGrafFilterToolBoxControl(); - - virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ) SAL_OVERRIDE; - virtual VclPtr<SfxPopupWindow> CreatePopupWindow() SAL_OVERRIDE; -}; - - // - SvxGrafToolBoxControl - diff --git a/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu b/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu index 8d96dc6..20fc41e 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu @@ -176,6 +176,20 @@ </node> </node> <node oor:name="ToolBar"> + <node oor:name="GraphicFilterControl" oor:op="replace"> + <prop oor:name="Command"> + <value>.uno:GraphicFilterToolbox</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>graffilterbar</value> + </prop> + </node> <node oor:name="OptimizeTableControl" oor:op="replace"> <prop oor:name="Command"> <value>.uno:OptimizeTable</value> diff --git a/sc/source/ui/app/scdll.cxx b/sc/source/ui/app/scdll.cxx index 6095a1b..be95d7d 100644 --- a/sc/source/ui/app/scdll.cxx +++ b/sc/source/ui/app/scdll.cxx @@ -185,7 +185,6 @@ void ScDLL::Init() SvxGrafContrastToolBoxControl ::RegisterControl(SID_ATTR_GRAF_CONTRAST, pMod); SvxGrafGammaToolBoxControl ::RegisterControl(SID_ATTR_GRAF_GAMMA, pMod); SvxGrafTransparenceToolBoxControl::RegisterControl(SID_ATTR_GRAF_TRANSPARENCE, pMod); - SvxGrafFilterToolBoxControl ::RegisterControl(SID_GRFFILTER, pMod); SvxVertTextTbxCtrl::RegisterControl(SID_DRAW_CAPTION_VERTICAL, pMod); SvxVertTextTbxCtrl::RegisterControl(SID_DRAW_TEXT_VERTICAL, pMod); diff --git a/sd/source/ui/app/sddll.cxx b/sd/source/ui/app/sddll.cxx index 928db7b..70c9178 100644 --- a/sd/source/ui/app/sddll.cxx +++ b/sd/source/ui/app/sddll.cxx @@ -208,7 +208,6 @@ void SdDLL::RegisterControllers() SvxColorToolBoxControl::RegisterControl( SID_ATTR_CHAR_COLOR, pMod ); SvxColorToolBoxControl::RegisterControl( SID_ATTR_CHAR_BACK_COLOR, pMod ); - SvxGrafFilterToolBoxControl::RegisterControl( SID_GRFFILTER, pMod ); SvxGrafModeToolBoxControl::RegisterControl( SID_ATTR_GRAF_MODE, pMod ); SvxGrafRedToolBoxControl::RegisterControl( SID_ATTR_GRAF_RED, pMod ); SvxGrafGreenToolBoxControl::RegisterControl( SID_ATTR_GRAF_GREEN, pMod ); diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi index 51072b6..fe52a8c 100644 --- a/svx/sdi/svx.sdi +++ b/svx/sdi/svx.sdi @@ -5561,7 +5561,7 @@ SfxVoidItem GraphicFilterSolarize SID_GRFFILTER_SOLARIZE ] -TbxImageItem GraphicFilterToolbox SID_GRFFILTER +SfxVoidItem GraphicFilterToolbox SID_GRFFILTER [ /* flags: */ diff --git a/svx/source/tbxctrls/grafctrl.cxx b/svx/source/tbxctrls/grafctrl.cxx index 1b6a4f2..6f434e6 100644 --- a/svx/source/tbxctrls/grafctrl.cxx +++ b/svx/source/tbxctrls/grafctrl.cxx @@ -423,32 +423,6 @@ void ImplGrafModeControl::Update( const SfxPoolItem* pItem ) SetNoSelection(); } -SFX_IMPL_TOOLBOX_CONTROL( SvxGrafFilterToolBoxControl, TbxImageItem ); - -SvxGrafFilterToolBoxControl::SvxGrafFilterToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx ) : - SfxToolBoxControl( nSlotId, nId, rTbx ) -{ - rTbx.SetItemBits( nId, ToolBoxItemBits::DROPDOWNONLY | rTbx.GetItemBits( nId ) ); - rTbx.Invalidate(); -} - -SvxGrafFilterToolBoxControl::~SvxGrafFilterToolBoxControl() -{ -} - -void SvxGrafFilterToolBoxControl::StateChanged( sal_uInt16, SfxItemState eState, const SfxPoolItem* ) -{ - GetToolBox().EnableItem( GetId(), ( eState != SfxItemState::DISABLED ) ); -} - -VclPtr<SfxPopupWindow> SvxGrafFilterToolBoxControl::CreatePopupWindow() -{ - OUString aSubTbxResName( "private:resource/toolbar/graffilterbar" ); - createAndPositionSubToolBar( aSubTbxResName ); - - return NULL; -} - SvxGrafToolBoxControl::SvxGrafToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx) : SfxToolBoxControl( nSlotId, nId, rTbx ) { diff --git a/sw/source/uibase/app/swmodule.cxx b/sw/source/uibase/app/swmodule.cxx index 2136bf7..779732b 100644 --- a/sw/source/uibase/app/swmodule.cxx +++ b/sw/source/uibase/app/swmodule.cxx @@ -367,7 +367,6 @@ void SwDLL::RegisterControls() SvxGrafGammaToolBoxControl::RegisterControl( SID_ATTR_GRAF_GAMMA, pMod ); SvxGrafTransparenceToolBoxControl::RegisterControl( SID_ATTR_GRAF_TRANSPARENCE, pMod ); SvxGrafModeToolBoxControl::RegisterControl( SID_ATTR_GRAF_MODE, pMod ); - SvxGrafFilterToolBoxControl::RegisterControl( SID_GRFFILTER, pMod ); SvxVertTextTbxCtrl::RegisterControl(SID_TEXTDIRECTION_LEFT_TO_RIGHT, pMod); SvxVertTextTbxCtrl::RegisterControl(SID_TEXTDIRECTION_TOP_TO_BOTTOM, pMod); SvxVertTextTbxCtrl::RegisterControl(SID_DRAW_CAPTION_VERTICAL, pMod); commit d311b65f277cce83557dd59f95e9295bc7781cee Author: Maxim Monastirsky <[email protected]> Date: Tue Jul 14 16:37:10 2015 +0300 Convert optimize table button to the generic controller Change-Id: I6b9089daaa2bb7d0dfc1072296fc51401e5fc88a diff --git a/include/svx/subtoolboxcontrol.hxx b/include/svx/subtoolboxcontrol.hxx deleted file mode 100644 index 17555e1..0000000 --- a/include/svx/subtoolboxcontrol.hxx +++ /dev/null @@ -1,47 +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_SVX_SUBTOOLBOXCONTROL_HXX -#define INCLUDED_SVX_SUBTOOLBOXCONTROL_HXX - -#include <svx/svxdllapi.h> -#include <sfx2/tbxctrl.hxx> - - - - - -class SVX_DLLPUBLIC SvxSubToolBoxControl : public SfxToolBoxControl -{ - -public: - SFX_DECL_TOOLBOX_CONTROL(); - - SvxSubToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx ); - virtual ~SvxSubToolBoxControl(); - - virtual VclPtr<SfxPopupWindow> CreatePopupWindow() SAL_OVERRIDE; -}; - - - - -#endif - - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu b/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu index 03f10ac..8d96dc6 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu @@ -176,6 +176,20 @@ </node> </node> <node oor:name="ToolBar"> + <node oor:name="OptimizeTableControl" oor:op="replace"> + <prop oor:name="Command"> + <value>.uno:OptimizeTable</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>optimizetablebar</value> + </prop> + </node> <node oor:name="InsertControl" oor:op="replace"> <prop oor:name="Command"> <value>.uno:InsertCtrl</value> diff --git a/sd/inc/pch/precompiled_sd.hxx b/sd/inc/pch/precompiled_sd.hxx index e52dda0..0f87ab5 100644 --- a/sd/inc/pch/precompiled_sd.hxx +++ b/sd/inc/pch/precompiled_sd.hxx @@ -707,7 +707,6 @@ #include <svx/sidebar/SelectionAnalyzer.hxx> #include <svx/sphere3d.hxx> #include <svx/srchdlg.hxx> -#include <svx/subtoolboxcontrol.hxx> #include <svx/svdattr.hxx> #include <svx/svddef.hxx> #include <svx/svddrgmt.hxx> diff --git a/sd/source/ui/app/sddll.cxx b/sd/source/ui/app/sddll.cxx index 4b49945..928db7b 100644 --- a/sd/source/ui/app/sddll.cxx +++ b/sd/source/ui/app/sddll.cxx @@ -81,7 +81,6 @@ #include <svx/modctrl.hxx> #include <svx/pszctrl.hxx> #include <svx/srchdlg.hxx> -#include <svx/subtoolboxcontrol.hxx> #include <svx/SvxColorChildWindow.hxx> #include <svx/SvxShapeTypes.hxx> #include <svx/tbcontrl.hxx> @@ -262,7 +261,6 @@ void SdDLL::RegisterControllers() SvxFrameLineStyleToolBoxControl::RegisterControl(SID_FRAME_LINESTYLE, pMod ); SvxColorToolBoxControl::RegisterControl(SID_FRAME_LINECOLOR, pMod ); SvxFrameToolBoxControl::RegisterControl(SID_ATTR_BORDER, pMod ); - SvxSubToolBoxControl::RegisterControl(SID_OPTIMIZE_TABLE, pMod); } void SdDLL::Init() diff --git a/svx/Library_svx.mk b/svx/Library_svx.mk index 48e5e0c..a890ed7 100644 --- a/svx/Library_svx.mk +++ b/svx/Library_svx.mk @@ -225,7 +225,6 @@ $(eval $(call gb_Library_add_exception_objects,svx,\ svx/source/tbxctrls/layctrl \ svx/source/tbxctrls/lboxctrl \ svx/source/tbxctrls/linectrl \ - svx/source/tbxctrls/subtoolboxcontrol \ svx/source/tbxctrls/tbunocontroller \ svx/source/tbxctrls/tbunosearchcontrollers \ svx/source/tbxctrls/tbxalign \ diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi index ec3bbec..51072b6 100644 --- a/svx/sdi/svx.sdi +++ b/svx/sdi/svx.sdi @@ -15154,7 +15154,7 @@ SfxVoidItem SplitCell SID_TABLE_SPLIT_CELLS GroupId = GID_TABLE; ] -SfxUInt16Item OptimizeTable SID_OPTIMIZE_TABLE +SfxVoidItem OptimizeTable SID_OPTIMIZE_TABLE [ /* flags: */ diff --git a/svx/source/tbxctrls/subtoolboxcontrol.cxx b/svx/source/tbxctrls/subtoolboxcontrol.cxx deleted file mode 100644 index 95227ca..0000000 --- a/svx/source/tbxctrls/subtoolboxcontrol.cxx +++ /dev/null @@ -1,55 +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 <svl/intitem.hxx> - -#include <vcl/toolbox.hxx> -#include <sfx2/app.hxx> -#include <svx/subtoolboxcontrol.hxx> -#include <svx/svxids.hrc> - - -SFX_IMPL_TOOLBOX_CONTROL( SvxSubToolBoxControl, SfxUInt16Item ); - -SvxSubToolBoxControl::SvxSubToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx ) -: SfxToolBoxControl( nSlotId, nId, rTbx ) -{ - rTbx.SetItemBits( nId, ToolBoxItemBits::DROPDOWNONLY | rTbx.GetItemBits( nId ) ); -} - -SvxSubToolBoxControl::~SvxSubToolBoxControl() -{ -} - -VclPtr<SfxPopupWindow> SvxSubToolBoxControl::CreatePopupWindow() -{ - const sal_Char* pResource = 0; - switch( GetSlotId() ) - { - case SID_OPTIMIZE_TABLE: - pResource = "private:resource/toolbar/optimizetablebar"; - break; - } - - if( pResource ) - createAndPositionSubToolBar( OUString::createFromAscii( pResource ) ); - return NULL; -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/Library_sw.mk b/sw/Library_sw.mk index ea83687..1654395 100644 --- a/sw/Library_sw.mk +++ b/sw/Library_sw.mk @@ -643,7 +643,6 @@ $(eval $(call gb_Library_add_exception_objects,sw,\ sw/source/uibase/ribbar/drawbase \ sw/source/uibase/ribbar/dselect \ sw/source/uibase/ribbar/inputwin \ - sw/source/uibase/ribbar/tblctrl \ sw/source/uibase/ribbar/tbxanchr \ sw/source/uibase/ribbar/workctrl \ sw/source/uibase/shells/annotsh \ diff --git a/sw/sdi/swriter.sdi b/sw/sdi/swriter.sdi index 201c7b0..6ecfbb8 100644 --- a/sw/sdi/swriter.sdi +++ b/sw/sdi/swriter.sdi @@ -5954,7 +5954,7 @@ SfxBoolItem OnlineAutoFormat FN_AUTOFORMAT_AUTO GroupId = GID_FORMAT; ] -SfxUInt16Item OptimizeTable FN_OPTIMIZE_TABLE +SfxVoidItem OptimizeTable FN_OPTIMIZE_TABLE [ /* flags: */ diff --git a/sw/source/uibase/app/swmodule.cxx b/sw/source/uibase/app/swmodule.cxx index 611f0fc..2136bf7 100644 --- a/sw/source/uibase/app/swmodule.cxx +++ b/sw/source/uibase/app/swmodule.cxx @@ -94,7 +94,6 @@ #include <tmplctrl.hxx> #include <viewlayoutctrl.hxx> #include <svx/zoomsliderctrl.hxx> -#include <tblctrl.hxx> #include <zoomctrl.hxx> #include <wordcountctrl.hxx> #include <workctrl.hxx> @@ -342,8 +341,6 @@ void SwDLL::RegisterControls() SvxModifyControl::RegisterControl( SID_DOC_MODIFIED, pMod ); SvxZoomSliderControl::RegisterControl( SID_ATTR_ZOOMSLIDER, pMod ); - SwTableOptimizeCtrl::RegisterControl(FN_OPTIMIZE_TABLE, pMod); - SvxIMapDlgChildWindow::RegisterChildWindow( false, pMod ); SvxSearchDialogWrapper::RegisterChildWindow( false, pMod ); SvxHlinkDlgWrapper::RegisterChildWindow( false, pMod ); diff --git a/sw/source/uibase/inc/tblctrl.hxx b/sw/source/uibase/inc/tblctrl.hxx deleted file mode 100644 index 3528a34..0000000 --- a/sw/source/uibase/inc/tblctrl.hxx +++ /dev/null @@ -1,39 +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_SW_SOURCE_UIBASE_INC_TBLCTRL_HXX -#define INCLUDED_SW_SOURCE_UIBASE_INC_TBLCTRL_HXX - -#include <sfx2/tbxctrl.hxx> - -class SwTableOptimizeCtrl : public SfxToolBoxControl -{ - -public: - SFX_DECL_TOOLBOX_CONTROL(); - - SwTableOptimizeCtrl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx ); - virtual ~SwTableOptimizeCtrl(); - - virtual VclPtr<SfxPopupWindow> CreatePopupWindow() SAL_OVERRIDE; - -}; - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/uibase/ribbar/tblctrl.cxx b/sw/source/uibase/ribbar/tblctrl.cxx deleted file mode 100644 index d592705..0000000 --- a/sw/source/uibase/ribbar/tblctrl.cxx +++ /dev/null @@ -1,50 +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 <svl/intitem.hxx> - -#include <vcl/toolbox.hxx> -#include <sfx2/app.hxx> - -#include "cmdid.h" -#include "swtypes.hxx" -#include "tblctrl.hxx" - -SFX_IMPL_TOOLBOX_CONTROL( SwTableOptimizeCtrl, SfxUInt16Item ); - -SwTableOptimizeCtrl::SwTableOptimizeCtrl( - sal_uInt16 nSlotId, - sal_uInt16 nId, - ToolBox& rTbx ) : - SfxToolBoxControl( nSlotId, nId, rTbx ) -{ - rTbx.SetItemBits( nId, ToolBoxItemBits::DROPDOWNONLY | rTbx.GetItemBits( nId ) ); -} - -SwTableOptimizeCtrl::~SwTableOptimizeCtrl() -{ -} - -VclPtr<SfxPopupWindow> SwTableOptimizeCtrl::CreatePopupWindow() -{ - createAndPositionSubToolBar("private:resource/toolbar/optimizetablebar"); - return NULL; -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ commit 489af4ed790a233c94051d2f08e51d7c44ddba37 Author: Maxim Monastirsky <[email protected]> Date: Mon Jul 13 23:38:13 2015 +0300 Convert insert buttons to the generic controller Change-Id: If7c6c1c5000893fca4205162526b4b4035637c11 diff --git a/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu b/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu index 165f863..03f10ac 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu @@ -176,6 +176,48 @@ </node> </node> <node oor:name="ToolBar"> + <node oor:name="InsertControl" oor:op="replace"> + <prop oor:name="Command"> + <value>.uno:InsertCtrl</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:InsertGraphic</value> + </prop> + </node> + <node oor:name="InsertObjectControl" oor:op="replace"> + <prop oor:name="Command"> + <value>.uno:InsertObjCtrl</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>insertobjectbar;.uno:InsertObject</value> + </prop> + </node> + <node oor:name="InsertCellControl" oor:op="replace"> + <prop oor:name="Command"> + <value>.uno:InsCellsCtrl</value> + </prop> + <prop oor:name="Module"> + <value>com.sun.star.sheet.SpreadsheetDocument</value> + </prop> + <prop oor:name="Controller"> + <value>com.sun.star.comp.framework.SubToolBarController</value> + </prop> + <prop oor:name="Value"> + <value>insertcellsbar;.uno:InsertCellsDown</value> + </prop> + </node> <node oor:name="c1" oor:op="replace"> <prop oor:name="Command"> <value>.uno:DBNewForm</value> diff --git a/sc/Library_sc.mk b/sc/Library_sc.mk index c0644f8..3fa8c74 100644 --- a/sc/Library_sc.mk +++ b/sc/Library_sc.mk @@ -381,7 +381,6 @@ $(eval $(call gb_Library_add_exception_objects,sc,\ sc/source/ui/cctrl/checklistmenu \ sc/source/ui/cctrl/dpcontrol \ sc/source/ui/cctrl/popmenu \ - sc/source/ui/cctrl/tbinsert \ sc/source/ui/cctrl/tbzoomsliderctrl \ sc/source/ui/condformat/condformatdlg \ sc/source/ui/condformat/condformatdlgentry \ diff --git a/sc/sdi/scalc.sdi b/sc/sdi/scalc.sdi index aa9d0da..482107e 100644 --- a/sc/sdi/scalc.sdi +++ b/sc/sdi/scalc.sdi @@ -3931,7 +3931,7 @@ SfxVoidItem InputLineMatrix FID_INPUTLINE_MATRIX ] -SfxUInt16Item InsCellsCtrl SID_TBXCTL_INSCELLS +SfxVoidItem InsCellsCtrl SID_TBXCTL_INSCELLS [ /* flags: */ @@ -4209,7 +4209,7 @@ SfxVoidItem InsertContents FID_INS_CELL_CONTENTS ] -SfxUInt16Item InsertCtrl SID_TBXCTL_INSERT +SfxVoidItem InsertCtrl SID_TBXCTL_INSERT [ /* flags: */ diff --git a/sc/sdi/tabvwsh.sdi b/sc/sdi/tabvwsh.sdi index d2ff989..eeb9019 100644 --- a/sc/sdi/tabvwsh.sdi +++ b/sc/sdi/tabvwsh.sdi @@ -267,8 +267,8 @@ shell ScTabViewShell SID_STATUS_PAGESTYLE [ ExecMethod = Execute; StateMethod = GetState; ] - SID_TBXCTL_INSERT [ ExecMethod = ExecTbx; StateMethod = GetTbxState; ] - SID_TBXCTL_INSCELLS [ ExecMethod = ExecTbx; StateMethod = GetTbxState; ] + SID_TBXCTL_INSERT [] + SID_TBXCTL_INSCELLS [] } diff --git a/sc/source/ui/app/scdll.cxx b/sc/source/ui/app/scdll.cxx index 47b0534..6095a1b 100644 --- a/sc/source/ui/app/scdll.cxx +++ b/sc/source/ui/app/scdll.cxx @@ -85,7 +85,6 @@ #include <svx/lboxctrl.hxx> #include <svx/verttexttbxctrl.hxx> #include <svx/formatpaintbrushctrl.hxx> -#include "tbinsert.hxx" #include "tbzoomsliderctrl.hxx" #include <svx/zoomsliderctrl.hxx> @@ -154,8 +153,6 @@ void ScDLL::Init() SfxRecentFilesToolBoxControl::RegisterControl(SID_OPEN_CALC, pMod); // Own Controller - ScTbxInsertCtrl ::RegisterControl(SID_TBXCTL_INSERT, pMod); - ScTbxInsertCtrl ::RegisterControl(SID_TBXCTL_INSCELLS, pMod); ScZoomSliderControl ::RegisterControl(SID_PREVIEW_SCALINGFACTOR, pMod); // SvxToolboxController diff --git a/sc/source/ui/cctrl/tbinsert.cxx b/sc/source/ui/cctrl/tbinsert.cxx deleted file mode 100644 index 049949c..0000000 --- a/sc/source/ui/cctrl/tbinsert.cxx +++ /dev/null @@ -1,106 +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 <string> - -#include <svl/intitem.hxx> -#include <sfx2/dispatch.hxx> -#include <sfx2/viewsh.hxx> -#include <sfx2/viewfrm.hxx> -#include <sfx2/imagemgr.hxx> -#include <vcl/toolbox.hxx> - -#include "tbinsert.hxx" -#include "global.hxx" -#include "scmod.hxx" -#include "scresid.hxx" -#include "sc.hrc" - -SFX_IMPL_TOOLBOX_CONTROL( ScTbxInsertCtrl, SfxUInt16Item); - -// ToolBox - Controller - -ScTbxInsertCtrl::ScTbxInsertCtrl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx ) : - SfxToolBoxControl( nSlotId, nId, rTbx ), - nLastSlotId(0) -{ - rTbx.SetItemBits( nId, ToolBoxItemBits::DROPDOWN | rTbx.GetItemBits( nId ) ); -} - -ScTbxInsertCtrl::~ScTbxInsertCtrl() -{ -} - -void ScTbxInsertCtrl::StateChanged( sal_uInt16 /* nSID */, SfxItemState eState, - const SfxPoolItem* pState ) -{ - GetToolBox().EnableItem( GetId(), (GetItemState(pState) != SfxItemState::DISABLED) ); - - if( eState == SfxItemState::DEFAULT ) - { - - const SfxUInt16Item* pItem = PTR_CAST( SfxUInt16Item, pState ); - if(pItem) - { - nLastSlotId = pItem->GetValue(); - sal_uInt16 nImageId = nLastSlotId ? nLastSlotId : GetSlotId(); - OUString aSlotURL( "slot:" ); - aSlotURL += OUString::number( nImageId); - Image aImage = GetImage( m_xFrame, - aSlotURL, - hasBigImages() - ); - GetToolBox().SetItemImage(GetId(), aImage); - } - } -} - -VclPtr<SfxPopupWindow> ScTbxInsertCtrl::CreatePopupWindow() -{ - sal_uInt16 nSlotId = GetSlotId(); - if (nSlotId == SID_TBXCTL_INSERT) - { - OUString aInsertBarResStr( "private:resource/toolbar/insertbar" ); - createAndPositionSubToolBar( aInsertBarResStr ); - } - else if (nSlotId == SID_TBXCTL_INSCELLS) - { - OUString aInsertCellsBarResStr( "private:resource/toolbar/insertcellsbar" ); - createAndPositionSubToolBar( aInsertCellsBarResStr ); - } - return NULL; -} - -void ScTbxInsertCtrl::Select( sal_uInt16 /*nSelectModifier*/ ) -{ - SfxViewShell* pCurSh( SfxViewShell::Current() ); - SfxDispatcher* pDispatch( 0 ); - - if ( pCurSh ) - { - SfxViewFrame* pViewFrame = pCurSh->GetViewFrame(); - if ( pViewFrame ) - pDispatch = pViewFrame->GetDispatcher(); - } - - if ( pDispatch ) - pDispatch->Execute(nLastSlotId); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx index 1d79989..3a2536d 100644 --- a/sc/source/ui/inc/tabvwsh.hxx +++ b/sc/source/ui/inc/tabvwsh.hxx @@ -92,9 +92,6 @@ enum ObjectSelectionType class ScTabViewShell: public SfxViewShell, public ScDBFunc { private: - static sal_uInt16 nInsertCtrlState; - static sal_uInt16 nInsCellsCtrlState; - SvxHtmlOptions aHTMLOpt; ObjectSelectionType eCurOST; sal_uInt16 nDrawSfxId; @@ -276,9 +273,6 @@ public: void ExecImageMap( SfxRequest& rReq ); void GetImageMapState( SfxItemSet& rSet ); - void ExecTbx( SfxRequest& rReq ); - static void GetTbxState( SfxItemSet& rSet ); - void ExecuteSave( SfxRequest& rReq ); void GetSaveState( SfxItemSet& rSet ); void ExecSearch( SfxRequest& rReq ); diff --git a/sc/source/ui/inc/tbinsert.hxx b/sc/source/ui/inc/tbinsert.hxx deleted file mode 100644 index 07b6201..0000000 --- a/sc/source/ui/inc/tbinsert.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_SC_SOURCE_UI_INC_TBINSERT_HXX -#define INCLUDED_SC_SOURCE_UI_INC_TBINSERT_HXX - -#include <sfx2/tbxctrl.hxx> - -class ScTbxInsertCtrl : public SfxToolBoxControl -{ - sal_uInt16 nLastSlotId; - virtual void Select( sal_uInt16 nSelectModifier ) SAL_OVERRIDE; - -public: - SFX_DECL_TOOLBOX_CONTROL(); - - ScTbxInsertCtrl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rBox ); - virtual ~ScTbxInsertCtrl(); - - virtual VclPtr<SfxPopupWindow> CreatePopupWindow() SAL_OVERRIDE; - virtual void StateChanged( sal_uInt16 nSID, - SfxItemState eState, - const SfxPoolItem* pState ) SAL_OVERRIDE; -}; - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx index cb57e3b..8890c4b 100644 --- a/sc/source/ui/view/tabvwsh4.cxx +++ b/sc/source/ui/view/tabvwsh4.cxx @@ -102,11 +102,6 @@ extern SfxViewShell* pScActiveViewShell; // global.cxx using namespace com::sun::star; -// STATIC DATA ----------------------------------------------------------- - -sal_uInt16 ScTabViewShell::nInsertCtrlState = SID_INSERT_GRAPHIC; -sal_uInt16 ScTabViewShell::nInsCellsCtrlState = 0; - void ScTabViewShell::Activate(bool bMDI) { SfxViewShell::Activate(bMDI); @@ -1830,34 +1825,4 @@ ScNavigatorSettings* ScTabViewShell::GetNavigatorSettings() return pNavSettings; } -void ScTabViewShell::ExecTbx( SfxRequest& rReq ) -{ - const SfxItemSet* pReqArgs = rReq.GetArgs(); - sal_uInt16 nSlot = rReq.GetSlot(); - const SfxPoolItem* pItem = NULL; - if ( pReqArgs ) - pReqArgs->GetItemState( nSlot, true, &pItem ); - - switch ( nSlot ) - { - case SID_TBXCTL_INSERT: - if ( pItem ) - nInsertCtrlState = static_cast<const SfxUInt16Item*>(pItem)->GetValue(); - break; - case SID_TBXCTL_INSCELLS: - if ( pItem ) - nInsCellsCtrlState = static_cast<const SfxUInt16Item*>(pItem)->GetValue(); - break; - default: - OSL_FAIL("Slot im Wald"); - } - GetViewFrame()->GetBindings().Invalidate( nSlot ); -} - -void ScTabViewShell::GetTbxState( SfxItemSet& rSet ) -{ - rSet.Put( SfxUInt16Item( SID_TBXCTL_INSERT, nInsertCtrlState ) ); - rSet.Put( SfxUInt16Item( SID_TBXCTL_INSCELLS, nInsCellsCtrlState ) ); -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/inc/view.hxx b/sw/inc/view.hxx index 2a21a20..6df748b 100644 --- a/sw/inc/view.hxx +++ b/sw/inc/view.hxx @@ -156,10 +156,6 @@ class SW_DLLPUBLIC SwView: public SfxViewShell static VclPtr<SvxSearchDialog> m_pSrchDlg; static SvxSearchItem *m_pSrchItem; - static sal_uInt16 m_nInsertCtrlState; - static sal_uInt16 m_nWebInsertCtrlState; - static sal_uInt16 m_nInsertObjectCtrlState; - static sal_uInt16 m_nInsertFieldCtrlState; static sal_uInt16 m_nMoveType; // for buttons below the scrollbar (viewmdi) static sal_Int32 m_nActMark; // current jump mark for unknown mark diff --git a/sw/sdi/_viewsh.sdi b/sw/sdi/_viewsh.sdi index 5e35f90..51d5937 100644 --- a/sw/sdi/_viewsh.sdi +++ b/sw/sdi/_viewsh.sdi @@ -531,10 +531,8 @@ interface BaseTextEditView ] FN_INSERT_CTRL [ - ExecMethod = Execute ; - StateMethod = GetState ; Export = FALSE; - ] + ] SID_ATTR_DEFTABSTOP [ diff --git a/sw/sdi/swriter.sdi b/sw/sdi/swriter.sdi index 03b94c1..201c7b0 100644 --- a/sw/sdi/swriter.sdi +++ b/sw/sdi/swriter.sdi @@ -3710,7 +3710,7 @@ SfxStringItem InsertSection FN_INSERT_REGION GroupId = GID_INSERT; ] -SfxImageItem InsertCtrl FN_INSERT_CTRL +SfxVoidItem InsertCtrl FN_INSERT_CTRL [ /* flags: */ @@ -4133,7 +4133,7 @@ SfxVoidItem InsertNeutralParagraph FN_NUM_BULLET_NONUM GroupId = GID_ENUMERATION; ] -SfxImageItem InsertObjCtrl FN_INSERT_OBJ_CTRL +SfxVoidItem InsertObjCtrl FN_INSERT_OBJ_CTRL [ /* flags: */ diff --git a/sw/sdi/viewsh.sdi b/sw/sdi/viewsh.sdi index db75fc1..567d704 100644 --- a/sw/sdi/viewsh.sdi +++ b/sw/sdi/viewsh.sdi @@ -46,7 +46,6 @@ interface TextEditView : BaseTextEditView // Slots, which are not needed in the WebDocShell FN_INSERT_OBJ_CTRL [ - ExecMethod = Execute ; StateMethod = GetState ; Export = FALSE ; DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR"; diff --git a/sw/source/uibase/app/swmodule.cxx b/sw/source/uibase/app/swmodule.cxx index ba06d42..611f0fc 100644 --- a/sw/source/uibase/app/swmodule.cxx +++ b/sw/source/uibase/app/swmodule.cxx @@ -290,8 +290,6 @@ void SwDLL::RegisterControls() SvxTbxCtlDraw::RegisterControl(SID_INSERT_DRAW, pMod ); SvxTbxCtlAlign::RegisterControl(SID_OBJECT_ALIGN, pMod ); SwTbxAnchor::RegisterControl(FN_TOOL_ANCHOR, pMod ); - SwTbxInsertCtrl::RegisterControl(FN_INSERT_CTRL, pMod ); - SwTbxInsertCtrl::RegisterControl(FN_INSERT_OBJ_CTRL, pMod ); SwTbxFieldCtrl::RegisterControl(FN_INSERT_FIELD_CTRL, pMod ); SwTbxAutoTextCtrl::RegisterControl(FN_GLOSSARY_DLG, pMod ); svx::ParaLineSpacingPopup::RegisterControl(SID_ATTR_PARA_LINESPACE, pMod); diff --git a/sw/source/uibase/inc/workctrl.hxx b/sw/source/uibase/inc/workctrl.hxx index 910dcb2..31bf973 100644 --- a/sw/source/uibase/inc/workctrl.hxx +++ b/sw/source/uibase/inc/workctrl.hxx @@ -52,26 +52,6 @@ class SwView; #define NID_TABLE_FORMULA_ERROR 20019 #define NID_COUNT 20 -class SwTbxInsertCtrl : public SfxToolBoxControl -{ - sal_uInt16 nLastSlotId; - - virtual void Select(sal_uInt16 nSelectModifier) SAL_OVERRIDE; - -public: - SFX_DECL_TOOLBOX_CONTROL(); - - SwTbxInsertCtrl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx ); - virtual ~SwTbxInsertCtrl(); - - virtual VclPtr<SfxPopupWindow> CreatePopupWindow() SAL_OVERRIDE; - virtual void StateChanged( sal_uInt16 nSID, - SfxItemState eState, - const SfxPoolItem* pState ) SAL_OVERRIDE; - - virtual void SAL_CALL update() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; -}; - class SwTbxAutoTextCtrl : public SfxToolBoxControl { PopupMenu* pPopup; diff --git a/sw/source/uibase/ribbar/workctrl.cxx b/sw/source/uibase/ribbar/workctrl.cxx index c56f9cb..99d1cfd 100644 --- a/sw/source/uibase/ribbar/workctrl.cxx +++ b/sw/source/uibase/ribbar/workctrl.cxx @@ -64,98 +64,9 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::frame; -SFX_IMPL_TOOLBOX_CONTROL( SwTbxInsertCtrl, SfxImageItem); SFX_IMPL_TOOLBOX_CONTROL( SwTbxAutoTextCtrl, SfxVoidItem ); SFX_IMPL_TOOLBOX_CONTROL( SwTbxFieldCtrl, SfxBoolItem ); -SwTbxInsertCtrl::SwTbxInsertCtrl( - sal_uInt16 nSlotId, - sal_uInt16 nId, - ToolBox& rTbx ) : - SfxToolBoxControl( nSlotId, nId, rTbx ), - nLastSlotId(FN_INSERT_CTRL == nSlotId ? FN_INSERT_TABLE : SID_INSERT_DIAGRAM) -{ - rTbx.SetItemBits( nId, ToolBoxItemBits::DROPDOWN | rTbx.GetItemBits( nId ) ); -} - -SwTbxInsertCtrl::~SwTbxInsertCtrl() -{ -} - -void SAL_CALL SwTbxInsertCtrl::update() throw (uno::RuntimeException, std::exception) -{ - ToolBox& rTbx = GetToolBox(); - OUString aSlotURL = "slot:" + OUString::number( nLastSlotId); - Image aImage = GetImage( m_xFrame, aSlotURL, hasBigImages() ); - - rTbx.SetItemImage(GetId(), aImage); - rTbx.Invalidate(); - - SfxToolBoxControl::update(); -} - -void SwTbxInsertCtrl::StateChanged( sal_uInt16 /*nSID*/, - SfxItemState eState, - const SfxPoolItem* pState ) -{ - sal_uInt16 nId = GetId(); - GetToolBox().EnableItem( nId, (GetItemState(pState) != SfxItemState::DISABLED) ); - - if( eState == SfxItemState::DEFAULT ) - { - const SfxImageItem* pItem = PTR_CAST( SfxImageItem, pState ); - if(pItem) - { - nLastSlotId = pItem->GetValue(); - if( nLastSlotId ) - nId = nLastSlotId; - - OUString aSlotURL = "slot:" + OUString::number( nId); - ToolBox& rBox = GetToolBox(); - Image aImage = GetImage( m_xFrame, aSlotURL, hasBigImages() ); - rBox.SetItemImage(GetId(), aImage); - rBox.SetItemImageMirrorMode( GetId(), false ); - rBox.SetItemImageAngle( GetId(), pItem->GetRotation() ); - rBox.SetItemImageMirrorMode( GetId(), pItem->IsMirrored() ); - } - } - -} - -VclPtr<SfxPopupWindow> SwTbxInsertCtrl::CreatePopupWindow() -{ - if(GetSlotId() == FN_INSERT_CTRL) - { - OUString aToolBarResStr( "private:resource/toolbar/insertbar" ); - createAndPositionSubToolBar( aToolBarResStr ); - } - else /* FN_INSERT_OBJ_CTRL */ - { - OUString aToolBarResStr( "private:resource/toolbar/insertobjectbar" ); - createAndPositionSubToolBar( aToolBarResStr ); - } - return NULL; -} - -void SwTbxInsertCtrl::Select( sal_uInt16 /*nSelectModifier*/ ) -{ - if( nLastSlotId ) - { - SfxViewShell* pCurSh( SfxViewShell::Current() ); - SfxDispatcher* pDispatch( 0 ); - - if ( pCurSh ) - { - SfxViewFrame* pViewFrame = pCurSh->GetViewFrame(); - if ( pViewFrame ) - pDispatch = pViewFrame->GetDispatcher(); - } - - if ( pDispatch ) - pDispatch->Execute(nLastSlotId); - } -} - SwTbxAutoTextCtrl::SwTbxAutoTextCtrl( sal_uInt16 nSlotId, sal_uInt16 nId, diff --git a/sw/source/uibase/uiview/view.cxx b/sw/source/uibase/uiview/view.cxx index e19673c..4125a91 100644 --- a/sw/source/uibase/uiview/view.cxx +++ b/sw/source/uibase/uiview/view.cxx @@ -128,10 +128,6 @@ bool bDocSzUpdated = true; SvxSearchItem* SwView::m_pSrchItem = 0; -sal_uInt16 SwView::m_nInsertCtrlState = FN_INSERT_TABLE; -sal_uInt16 SwView::m_nWebInsertCtrlState = FN_INSERT_TABLE; -sal_uInt16 SwView::m_nInsertObjectCtrlState = SID_INSERT_DIAGRAM; - bool SwView::m_bExtra = false; bool SwView::m_bFound = false; bool SwView::m_bJustOpened = false; diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx index a65b79a..e47987f 100644 --- a/sw/source/uibase/uiview/view2.cxx +++ b/sw/source/uibase/uiview/view2.cxx @@ -991,30 +991,6 @@ void SwView::Execute(SfxRequest &rReq) m_pShell->ExecuteSlot(rReq); } break; - case FN_INSERT_CTRL: - case FN_INSERT_OBJ_CTRL: - { - if(pArgs && SfxItemState::SET == pArgs->GetItemState(nSlot, false, &pItem)) - { - const sal_uInt16 nValue = static_cast<const SfxUInt16Item*>(pItem)->GetValue(); - switch ( nSlot ) - { - case FN_INSERT_CTRL: - { - bool bWeb = 0 != PTR_CAST(SwWebView, this); - if(bWeb) - SwView::m_nWebInsertCtrlState = nValue; - else - SwView::m_nInsertCtrlState = nValue; - } - break; - case FN_INSERT_OBJ_CTRL: SwView::m_nInsertObjectCtrlState = nValue ;break; - } - - } - GetViewFrame()->GetBindings().Invalidate( nSlot ); - } - break; #if defined WNT || defined UNX case SID_TWAIN_SELECT: case SID_TWAIN_TRANSFER: diff --git a/sw/source/uibase/uiview/viewstat.cxx b/sw/source/uibase/uiview/viewstat.cxx index aabd463..a7d2c16 100644 --- a/sw/source/uibase/uiview/viewstat.cxx +++ b/sw/source/uibase/uiview/viewstat.cxx @@ -191,42 +191,12 @@ void SwView::GetState(SfxItemSet &rSet) rSet.DisableItem(nWhich); } break; - case FN_INSERT_CTRL: - { - SfxImageItem aImgItem(nWhich, bWeb ? SwView::m_nWebInsertCtrlState : SwView::m_nInsertCtrlState); - SfxSlotPool& rPool = SfxSlotPool::GetSlotPool( GetViewFrame() ); - const SfxSlot* pSlot = rPool.GetSlot( aImgItem.GetValue() ); - if(pSlot && pSlot->IsMode( SfxSlotMode::IMAGEROTATION )) - { - if(m_pWrtShell->IsInVerticalText()) - aImgItem.SetRotation(2700); - if(m_pWrtShell->IsInRightToLeftText()) - aImgItem.SetMirrored(true); - } - rSet.Put(aImgItem); - } - break; - case FN_INSERT_OBJ_CTRL: if( bWeb || m_pWrtShell->CrsrInsideInputField() ) { rSet.DisableItem(nWhich); } - else - { - SfxImageItem aImgItem(nWhich, SwView::m_nInsertObjectCtrlState); - SfxSlotPool& rPool = SfxSlotPool::GetSlotPool( GetViewFrame() ); - const SfxSlot* pSlot = rPool.GetSlot( aImgItem.GetValue() ); - if(pSlot && pSlot->IsMode( SfxSlotMode::IMAGEROTATION )) - { - if (m_pWrtShell->IsInVerticalText()) - aImgItem.SetRotation(2700); - if (m_pWrtShell->IsInRightToLeftText()) - aImgItem.SetMirrored(true); - } - rSet.Put(aImgItem); - } break; case FN_UPDATE_TOX: _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
