Kaydet (Commit) d311b65f authored tarafından Maxim Monastirsky's avatar Maxim Monastirsky

Convert optimize table button to the generic controller

Change-Id: I6b9089daaa2bb7d0dfc1072296fc51401e5fc88a
üst 489af4ed
/* -*- 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: */
......@@ -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>
......
......@@ -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>
......
......@@ -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()
......
......@@ -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 \
......
......@@ -15154,7 +15154,7 @@ SfxVoidItem SplitCell SID_TABLE_SPLIT_CELLS
GroupId = GID_TABLE;
]
SfxUInt16Item OptimizeTable SID_OPTIMIZE_TABLE
SfxVoidItem OptimizeTable SID_OPTIMIZE_TABLE
[
/* flags: */
......
/* -*- 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: */
......@@ -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 \
......
......@@ -5954,7 +5954,7 @@ SfxBoolItem OnlineAutoFormat FN_AUTOFORMAT_AUTO
GroupId = GID_FORMAT;
]
SfxUInt16Item OptimizeTable FN_OPTIMIZE_TABLE
SfxVoidItem OptimizeTable FN_OPTIMIZE_TABLE
[
/* flags: */
......
......@@ -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 );
......
/* -*- 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: */
/* -*- 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: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment