diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-03-30 10:10:08 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-04-06 21:24:55 +0200 |
commit | a4f747e9cd70bc25994040e7812680c2c8356c08 (patch) | |
tree | 37417145ce76cb3586fb035519e5dbf70c4cb816 /svx | |
parent | 21e8ce9ab9a522d25e95773af59b7ccccaee4e54 (diff) |
remove newly unused stuff
Change-Id: Idce9955294372817c0dd1f40ebd38f16fc90eab5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91007
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/UIConfig_svx.mk | 1 | ||||
-rw-r--r-- | svx/inc/pch/precompiled_svx.hxx | 50 | ||||
-rw-r--r-- | svx/source/tbxctrls/SvxColorValueSet.cxx | 3 | ||||
-rw-r--r-- | svx/source/tbxctrls/tbcontrl.cxx | 473 | ||||
-rw-r--r-- | svx/uiconfig/ui/oldcolorwindow.ui | 180 |
5 files changed, 13 insertions, 694 deletions
diff --git a/svx/UIConfig_svx.mk b/svx/UIConfig_svx.mk index 414361b8a316..567464c49cb5 100644 --- a/svx/UIConfig_svx.mk +++ b/svx/UIConfig_svx.mk @@ -89,7 +89,6 @@ $(eval $(call gb_UIConfig_add_uifiles,svx,\ svx/uiconfig/ui/metricfieldbox \ svx/uiconfig/ui/namespacedialog \ svx/uiconfig/ui/numberingwindow \ - svx/uiconfig/ui/oldcolorwindow \ svx/uiconfig/ui/optgridpage \ svx/uiconfig/ui/paralinespacingcontrol \ svx/uiconfig/ui/paralrspacing \ diff --git a/svx/inc/pch/precompiled_svx.hxx b/svx/inc/pch/precompiled_svx.hxx index 74ded456eab0..b566a4589b0f 100644 --- a/svx/inc/pch/precompiled_svx.hxx +++ b/svx/inc/pch/precompiled_svx.hxx @@ -13,7 +13,7 @@ manual changes will be rewritten by the next run of update_pch.sh (which presumably also fixes all possible problems, so it's usually better to use it). - Generated on 2020-02-14 10:26:10 using: + Generated on 2020-03-27 21:07:57 using: ./bin/update_pch svx svx --cutoff=3 --exclude:system --exclude:module --include:local If after updating build fails, use the following command to locate conflicting headers: @@ -26,22 +26,20 @@ #include <cassert> #include <climits> #include <cstddef> -#include <cstring> #include <deque> #include <functional> #include <iomanip> #include <limits.h> #include <map> #include <memory> +#include <optional> #include <ostream> #include <set> #include <stddef.h> -#include <string> #include <type_traits> #include <unordered_map> #include <utility> #include <vector> -#include <boost/property_tree/json_parser.hpp> #include <boost/property_tree/ptree.hpp> #include <boost/property_tree/ptree_fwd.hpp> #endif // PCH_LEVEL >= 1 @@ -57,7 +55,7 @@ #include <rtl/bootstrap.hxx> #include <rtl/instance.hxx> #include <rtl/ref.hxx> -#include <rtl/strbuf.hxx> +#include <rtl/string.hxx> #include <rtl/tencinfo.h> #include <rtl/textenc.h> #include <rtl/ustrbuf.hxx> @@ -72,7 +70,6 @@ #include <vcl/BitmapFilter.hxx> #include <vcl/EnumContext.hxx> #include <vcl/GraphicObject.hxx> -#include <vcl/IContext.hxx> #include <vcl/Scanline.hxx> #include <vcl/alpha.hxx> #include <vcl/bitmapex.hxx> @@ -82,7 +79,6 @@ #include <vcl/ctrl.hxx> #include <vcl/customweld.hxx> #include <vcl/dllapi.h> -#include <vcl/dockwin.hxx> #include <vcl/errcode.hxx> #include <vcl/errinf.hxx> #include <vcl/event.hxx> @@ -90,12 +86,10 @@ #include <vcl/font.hxx> #include <vcl/gdimtf.hxx> #include <vcl/graph.hxx> -#include <vcl/help.hxx> #include <vcl/idle.hxx> #include <vcl/image.hxx> #include <vcl/imap.hxx> #include <vcl/imapobj.hxx> -#include <vcl/layout.hxx> #include <vcl/menu.hxx> #include <vcl/metric.hxx> #include <vcl/outdev.hxx> @@ -138,13 +132,12 @@ #include <com/sun/star/awt/GradientStyle.hpp> #include <com/sun/star/awt/Point.hpp> #include <com/sun/star/awt/Rectangle.hpp> +#include <com/sun/star/awt/XControl.hpp> #include <com/sun/star/awt/XControlContainer.hpp> #include <com/sun/star/beans/NamedValue.hpp> -#include <com/sun/star/beans/PropertyState.hpp> #include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/beans/XPropertyChangeListener.hpp> #include <com/sun/star/beans/XPropertySet.hpp> -#include <com/sun/star/beans/XPropertySetInfo.hpp> #include <com/sun/star/container/XIndexAccess.hpp> #include <com/sun/star/container/XNameAccess.hpp> #include <com/sun/star/container/XNameContainer.hpp> @@ -152,8 +145,8 @@ #include <com/sun/star/drawing/LineCap.hpp> #include <com/sun/star/drawing/TextFitToSizeType.hpp> #include <com/sun/star/form/XForm.hpp> +#include <com/sun/star/form/XFormComponent.hpp> #include <com/sun/star/frame/XController.hpp> -#include <com/sun/star/frame/XController2.hpp> #include <com/sun/star/frame/XDispatch.hpp> #include <com/sun/star/frame/XDispatchProvider.hpp> #include <com/sun/star/frame/XFrame.hpp> @@ -167,18 +160,20 @@ #include <com/sun/star/lang/IndexOutOfBoundsException.hpp> #include <com/sun/star/lang/Locale.hpp> #include <com/sun/star/lang/XComponent.hpp> +#include <com/sun/star/lang/XEventListener.hpp> #include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/XTypeProvider.hpp> #include <com/sun/star/lang/XUnoTunnel.hpp> +#include <com/sun/star/sdbc/XResultSet.hpp> +#include <com/sun/star/sdbcx/XColumnsSupplier.hpp> +#include <com/sun/star/sdbcx/XRowLocate.hpp> #include <com/sun/star/style/NumberingType.hpp> #include <com/sun/star/style/XStyle.hpp> #include <com/sun/star/text/DefaultNumberingProvider.hpp> #include <com/sun/star/text/WritingMode2.hpp> -#include <com/sun/star/text/XNumberingFormatter.hpp> #include <com/sun/star/text/textfield/Type.hpp> -#include <com/sun/star/ui/XContextChangeEventListener.hpp> #include <com/sun/star/uno/Any.h> #include <com/sun/star/uno/Any.hxx> #include <com/sun/star/uno/Exception.hpp> @@ -201,10 +196,8 @@ #include <com/sun/star/view/XSelectionSupplier.hpp> #include <comphelper/broadcasthelper.hxx> #include <comphelper/comphelperdllapi.h> -#include <comphelper/lok.hxx> #include <comphelper/processfactory.hxx> #include <comphelper/proparrhlp.hxx> -#include <comphelper/property.hxx> #include <comphelper/propertycontainer.hxx> #include <comphelper/propertysequence.hxx> #include <comphelper/sequence.hxx> @@ -212,7 +205,6 @@ #include <comphelper/string.hxx> #include <comphelper/types.hxx> #include <comphelper/weak.hxx> -#include <connectivity/dbtoolsdllapi.hxx> #include <cppu/cppudllapi.h> #include <cppu/unotype.hxx> #include <cppuhelper/basemutex.hxx> @@ -245,8 +237,6 @@ #include <editeng/flditem.hxx> #include <editeng/fontitem.hxx> #include <editeng/frmdir.hxx> -#include <editeng/itemtype.hxx> -#include <editeng/kernitem.hxx> #include <editeng/lrspitem.hxx> #include <editeng/numdef.hxx> #include <editeng/numitem.hxx> @@ -260,13 +250,13 @@ #include <editeng/udlnitem.hxx> #include <editeng/ulspitem.hxx> #include <editeng/unoedhlp.hxx> +#include <editeng/unoedsrc.hxx> #include <editeng/wghtitem.hxx> #include <i18nlangtag/lang.h> #include <i18nlangtag/languagetag.hxx> #include <i18nlangtag/mslangid.hxx> #include <o3tl/cow_wrapper.hxx> #include <o3tl/deleter.hxx> -#include <optional> #include <o3tl/safeint.hxx> #include <o3tl/typed_flags_set.hxx> #include <o3tl/underlyingenumvalue.hxx> @@ -283,19 +273,15 @@ #include <sfx2/dispatch.hxx> #include <sfx2/dllapi.h> #include <sfx2/dockwin.hxx> -#include <sfx2/lokhelper.hxx> #include <sfx2/module.hxx> #include <sfx2/objsh.hxx> #include <sfx2/request.hxx> -#include <sfx2/sidebar/ControlFactory.hxx> -#include <sfx2/sidebar/SidebarToolBox.hxx> -#include <sfx2/sidebar/Theme.hxx> #include <sfx2/stbitem.hxx> +#include <sfx2/tabdlg.hxx> #include <sfx2/tbxctrl.hxx> #include <sfx2/viewfrm.hxx> #include <sfx2/viewsh.hxx> #include <sfx2/weldutils.hxx> -#include <sot/exchange.hxx> #include <sot/formats.hxx> #include <svl/SfxBroadcaster.hxx> #include <svl/cenumitm.hxx> @@ -360,13 +346,10 @@ #include <unotools/viewoptions.hxx> #endif // PCH_LEVEL >= 3 #if PCH_LEVEL >= 4 -#include <DescriptionGenerator.hxx> #include <cell.hxx> -#include <celltypes.hxx> #include <charmapacc.hxx> #include <fmprop.hxx> #include <fmservs.hxx> -#include <fmshimp.hxx> #include <helpids.h> #include <labelitemwindow.hxx> #include <svx/AccessibleControlShape.hxx> @@ -386,18 +369,17 @@ #include <svx/drawitem.hxx> #include <svx/e3ditem.hxx> #include <svx/fmmodel.hxx> -#include <svx/fmpage.hxx> #include <svx/fmshell.hxx> #include <svx/fmtools.hxx> #include <svx/framebordertype.hxx> #include <svx/galmisc.hxx> #include <svx/itemwin.hxx> #include <svx/itextprovider.hxx> -#include <svx/linectrl.hxx> #include <svx/obj3d.hxx> #include <svx/pageitem.hxx> #include <svx/rotmodit.hxx> #include <svx/rulritem.hxx> +#include <svx/sdmetitm.hxx> #include <svx/sdooitm.hxx> #include <svx/sdprcitm.hxx> #include <svx/sdrpaintwindow.hxx> @@ -422,16 +404,12 @@ #include <svx/svdpagv.hxx> #include <svx/svdtext.hxx> #include <svx/svdtrans.hxx> -#include <svx/svdtypes.hxx> #include <svx/svdview.hxx> #include <svx/svx3ditems.hxx> #include <svx/svxdlg.hxx> #include <svx/svxdllapi.h> -#include <svx/tbxcolor.hxx> #include <svx/unoapi.hxx> #include <svx/unomid.hxx> -#include <svx/unopage.hxx> -#include <svx/unoprov.hxx> #include <svx/unoshtxt.hxx> #include <svx/view3d.hxx> #include <svx/viewpt3d.hxx> @@ -446,13 +424,9 @@ #include <svx/xit.hxx> #include <svx/xlineit0.hxx> #include <svx/xlnclit.hxx> -#include <svx/xlndsit.hxx> -#include <svx/xlnedit.hxx> -#include <svx/xlnstit.hxx> #include <svx/xlntrit.hxx> #include <svx/xlnwtit.hxx> #include <svx/xtable.hxx> -#include <svx/zoomslideritem.hxx> #endif // PCH_LEVEL >= 4 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/tbxctrls/SvxColorValueSet.cxx b/svx/source/tbxctrls/SvxColorValueSet.cxx index 773dce6de000..2c0ba7c73966 100644 --- a/svx/source/tbxctrls/SvxColorValueSet.cxx +++ b/svx/source/tbxctrls/SvxColorValueSet.cxx @@ -19,7 +19,6 @@ #include <svx/SvxColorValueSet.hxx> #include <svx/xtable.hxx> -#include <vcl/builderfactory.hxx> #include <vcl/svapp.hxx> #include <vcl/settings.hxx> #include <osl/diagnose.h> @@ -36,8 +35,6 @@ ColorValueSet::ColorValueSet(std::unique_ptr<weld::ScrolledWindow> pWindow) SetEdgeBlending(true); } -VCL_BUILDER_FACTORY_CONSTRUCTOR(SvxColorValueSet, WB_TABSTOP) - sal_uInt32 SvxColorValueSet::getMaxRowCount() { return StyleSettings::GetColorValueSetMaximumRowCount(); diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index 38d5574b745a..ba36e98f24c9 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -26,8 +26,8 @@ #include <svl/itemset.hxx> #include <vcl/commandinfoprovider.hxx> #include <vcl/event.hxx> -#include <vcl/toolbox.hxx> #include <vcl/menubtn.hxx> +#include <vcl/toolbox.hxx> #include <vcl/customweld.hxx> #include <vcl/vclptr.hxx> #include <svtools/valueset.hxx> @@ -1627,120 +1627,6 @@ boost::property_tree::ptree SvxFontNameBox_Impl::DumpAsPropertyTree() return aTree; } -SvxColorWindow::SvxColorWindow(const OUString& rCommand, - std::shared_ptr<PaletteManager> const & rPaletteManager, - ColorStatus& rColorStatus, - sal_uInt16 nSlotId, - const Reference< XFrame >& rFrame, - vcl::Window* pParentWindow, - bool bReuseParentForPicker, - ColorSelectFunction const & aFunction): - - ToolbarPopup( rFrame, pParentWindow, "palette_popup_window", "svx/ui/oldcolorwindow.ui" ), - theSlotId( nSlotId ), - maCommand( rCommand ), - mxParentWindow(pParentWindow), - mxPaletteManager( rPaletteManager ), - mrColorStatus( rColorStatus ), - maColorSelectFunction(aFunction), - mbReuseParentForPicker(bReuseParentForPicker) -{ - get(mpPaletteListBox, "palette_listbox"); - get(mpButtonAutoColor, "auto_color_button"); - get(mpButtonNoneColor, "none_color_button"); - get(mpButtonPicker, "color_picker_button"); - get(mpColorSet, "colorset"); - get(mpRecentColorSet, "recent_colorset"); - get(mpAutomaticSeparator, "separator4"); - - mpColorSet->SetStyle( WinBits(WB_FLATVALUESET | WB_ITEMBORDER | WB_3DLOOK | WB_NO_DIRECTSELECT | WB_TABSTOP) ); - mpRecentColorSet->SetStyle( WinBits(WB_FLATVALUESET | WB_ITEMBORDER | WB_3DLOOK | WB_NO_DIRECTSELECT | WB_TABSTOP) ); - - switch ( theSlotId ) - { - case SID_ATTR_CHAR_COLOR_BACKGROUND: - case SID_BACKGROUND_COLOR: - case SID_ATTR_CHAR_BACK_COLOR: - case SID_TABLE_CELL_BACKGROUND_COLOR: - { - mpButtonAutoColor->SetText( SvxResId( RID_SVXSTR_NOFILL ) ); - break; - } - case SID_AUTHOR_COLOR: - { - mpButtonAutoColor->SetText( SvxResId( RID_SVXSTR_BY_AUTHOR ) ); - break; - } - case SID_BMPMASK_COLOR: - { - mpButtonAutoColor->SetText( SvxResId( RID_SVXSTR_TRANSPARENT ) ); - break; - } - case SID_ATTR_CHAR_COLOR: - case SID_ATTR_CHAR_COLOR2: - case SID_EXTRUSION_3D_COLOR: - { - mpButtonAutoColor->SetText(EditResId(RID_SVXSTR_AUTOMATIC)); - break; - } - case SID_FM_CTL_PROPERTIES: - { - mpButtonAutoColor->SetText( SvxResId( RID_SVXSTR_DEFAULT ) ); - break; - } - default: - { - mpButtonAutoColor->Hide(); - mpAutomaticSeparator->Hide(); - break; - } - } - - mpColorSet->SetAccessibleName( GetText() ); - - mpPaletteListBox->SetStyle( mpPaletteListBox->GetStyle() | WB_BORDER ); - mpPaletteListBox->SetSelectHdl( LINK( this, SvxColorWindow, SelectPaletteHdl ) ); - mpPaletteListBox->AdaptDropDownLineCountToMaximum(); - std::vector<OUString> aPaletteList = mxPaletteManager->GetPaletteList(); - for (const auto& rPalette : aPaletteList ) - { - mpPaletteListBox->InsertEntry( rPalette ); - } - OUString aPaletteName( officecfg::Office::Common::UserColors::PaletteName::get() ); - mpPaletteListBox->SelectEntry( aPaletteName ); - const sal_Int32 nSelectedEntry(mpPaletteListBox->GetSelectedEntryPos()); - if (nSelectedEntry != LISTBOX_ENTRY_NOTFOUND) - mxPaletteManager->SetPalette(nSelectedEntry); - - mpButtonAutoColor->SetClickHdl( LINK( this, SvxColorWindow, AutoColorClickHdl ) ); - mpButtonNoneColor->SetClickHdl( LINK( this, SvxColorWindow, AutoColorClickHdl ) ); - mpButtonPicker->SetClickHdl( LINK( this, SvxColorWindow, OpenPickerClickHdl ) ); - - mpColorSet->SetSelectHdl( LINK( this, SvxColorWindow, SelectHdl ) ); - mpRecentColorSet->SetSelectHdl( LINK( this, SvxColorWindow, SelectHdl ) ); - SetHelpId( HID_POPUP_COLOR ); - mpColorSet->SetHelpId( HID_POPUP_COLOR_CTRL ); - - mxPaletteManager->ReloadColorSet(*mpColorSet); - const sal_uInt32 nMaxItems(SvxColorValueSet::getMaxRowCount() * SvxColorValueSet::getColumnCount()); - Size aSize = mpColorSet->layoutAllVisible(nMaxItems); - mpColorSet->set_height_request(aSize.Height()); - mpColorSet->set_width_request(aSize.Width()); - - mxPaletteManager->ReloadRecentColorSet(*mpRecentColorSet); - aSize = mpRecentColorSet->layoutAllVisible(mxPaletteManager->GetRecentColorCount()); - mpRecentColorSet->set_height_request(aSize.Height()); - mpRecentColorSet->set_width_request(aSize.Width()); - - AddStatusListener( ".uno:ColorTableState" ); - AddStatusListener( maCommand ); - if ( maCommand == ".uno:FrameLineColor" ) - { - AddStatusListener( ".uno:BorderTLBR" ); - AddStatusListener( ".uno:BorderBLTR" ); - } -} - ColorWindow::ColorWindow(const OUString& rCommand, std::shared_ptr<PaletteManager> const & rPaletteManager, ColorStatus& rColorStatus, @@ -1863,41 +1749,10 @@ void ColorWindow::ShowNoneButton() mxButtonNoneColor->show(); } -SvxColorWindow::~SvxColorWindow() -{ - disposeOnce(); -} - ColorWindow::~ColorWindow() { } -void SvxColorWindow::dispose() -{ - mpColorSet.clear(); - mpRecentColorSet.clear(); - mpPaletteListBox.clear(); - mpButtonAutoColor.clear(); - mpButtonNoneColor.clear(); - mpButtonPicker.clear(); - mpAutomaticSeparator.clear(); - mxParentWindow.clear(); - ToolbarPopup::dispose(); -} - -void SvxColorWindow::KeyInput( const KeyEvent& rKEvt ) -{ - mpColorSet->GrabFocus(); - mpColorSet->KeyInput(rKEvt); -} - -NamedColor SvxColorWindow::GetSelectEntryColor(ValueSet const * pColorSet) -{ - Color aColor = pColorSet->GetItemColor(pColorSet->GetSelectedItemId()); - OUString sColorName = pColorSet->GetItemText(pColorSet->GetSelectedItemId()); - return std::make_pair(aColor, sColorName); -} - NamedColor ColorWindow::GetSelectEntryColor(SvtValueSet const * pColorSet) { Color aColor = pColorSet->GetItemColor(pColorSet->GetSelectedItemId()); @@ -1951,17 +1806,6 @@ namespace } } -NamedColor SvxColorWindow::GetSelectEntryColor() const -{ - if (!mpColorSet->IsNoSelection()) - return GetSelectEntryColor(mpColorSet); - if (!mpRecentColorSet->IsNoSelection()) - return GetSelectEntryColor(mpRecentColorSet); - if (mpButtonNoneColor->GetStyle() & WB_DEFBUTTON) - return GetNoneColor(); - return GetAutoColor(); -} - NamedColor ColorWindow::GetSelectEntryColor() const { if (!mxColorSet->IsNoSelection()) @@ -1973,27 +1817,6 @@ NamedColor ColorWindow::GetSelectEntryColor() const return GetAutoColor(); } -IMPL_LINK(SvxColorWindow, SelectHdl, ValueSet*, pColorSet, void) -{ - VclPtr<SvxColorWindow> xThis(this); - - NamedColor aNamedColor = GetSelectEntryColor(pColorSet); - - if ( pColorSet != mpRecentColorSet ) - { - mxPaletteManager->AddRecentColor(aNamedColor.first, aNamedColor.second); - if ( !IsInPopupMode() ) - mxPaletteManager->ReloadRecentColorSet(*mpRecentColorSet); - } - - if ( IsInPopupMode() ) - EndPopupMode(); - - maSelectedLink.Call(aNamedColor); - - maColorSelectFunction(maCommand, aNamedColor); -} - IMPL_LINK(ColorWindow, SelectHdl, SvtValueSet*, pColorSet, void) { NamedColor aNamedColor = GetSelectEntryColor(pColorSet); @@ -2017,14 +1840,6 @@ IMPL_LINK(ColorWindow, SelectHdl, SvtValueSet*, pColorSet, void) aColorSelectFunction(sCommand, aNamedColor); } -IMPL_LINK_NOARG(SvxColorWindow, SelectPaletteHdl, ListBox&, void) -{ - sal_Int32 nPos = mpPaletteListBox->GetSelectedEntryPos(); - mxPaletteManager->SetPalette( nPos ); - mxPaletteManager->ReloadColorSet(*mpColorSet); - mpColorSet->layoutToGivenHeight(mpColorSet->GetSizePixel().Height(), mxPaletteManager->GetColorCount()); -} - IMPL_LINK_NOARG(ColorWindow, SelectPaletteHdl, weld::ComboBox&, void) { int nPos = mxPaletteListBox->get_active(); @@ -2033,32 +1848,11 @@ IMPL_LINK_NOARG(ColorWindow, SelectPaletteHdl, weld::ComboBox&, void) mxColorSet->layoutToGivenHeight(mxColorSet->GetOutputSizePixel().Height(), mxPaletteManager->GetColorCount()); } -NamedColor SvxColorWindow::GetAutoColor() const -{ - return ::GetAutoColor(theSlotId); -} - NamedColor ColorWindow::GetAutoColor() const { return ::GetAutoColor(theSlotId); } -IMPL_LINK(SvxColorWindow, AutoColorClickHdl, Button*, pButton, void) -{ - VclPtr<SvxColorWindow> xThis(this); - - NamedColor aNamedColor = pButton == mpButtonAutoColor ? GetAutoColor() : GetNoneColor(); - - mpRecentColorSet->SetNoSelection(); - - if ( IsInPopupMode() ) - EndPopupMode(); - - maSelectedLink.Call(aNamedColor); - - maColorSelectFunction(maCommand, aNamedColor); -} - IMPL_LINK(ColorWindow, AutoColorClickHdl, weld::Button&, rButton, void) { NamedColor aNamedColor = &rButton == mxButtonAutoColor.get() ? GetAutoColor() : GetNoneColor(); @@ -2079,26 +1873,6 @@ IMPL_LINK(ColorWindow, AutoColorClickHdl, weld::Button&, rButton, void) aColorSelectFunction(sCommand, aNamedColor); } -IMPL_LINK_NOARG(SvxColorWindow, OpenPickerClickHdl, Button*, void) -{ - VclPtr<SvxColorWindow> xThis(this); - - if ( IsInPopupMode() ) - EndPopupMode(); - - weld::Window* pParentFrame; - if (mbReuseParentForPicker) - { - pParentFrame = mxParentWindow->GetFrameWeld(); - } - else - { - const css::uno::Reference<css::awt::XWindow> xParent = mxFrame->getContainerWindow(); - pParentFrame = Application::GetFrameWeld(xParent); - } - mxPaletteManager->PopupColorPicker(pParentFrame, maCommand, GetSelectEntryColor().first); -} - IMPL_LINK_NOARG(ColorWindow, OpenPickerClickHdl, weld::Button&, void) { // copy before set_inactive @@ -2112,14 +1886,6 @@ IMPL_LINK_NOARG(ColorWindow, OpenPickerClickHdl, weld::Button&, void) xPaletteManager->PopupColorPicker(pParentWindow, sCommand, nColor); } -void SvxColorWindow::SetNoSelection() -{ - mpColorSet->SetNoSelection(); - mpRecentColorSet->SetNoSelection(); - mpButtonAutoColor->set_property("has-default", "false"); - mpButtonNoneColor->set_property("has-default", "false"); -} - void ColorWindow::SetNoSelection() { mxColorSet->SetNoSelection(); @@ -2136,23 +1902,6 @@ bool ColorWindow::IsNoSelection() const return !mxButtonAutoColor->get_visible() && !mxButtonNoneColor->get_visible(); } -void SvxColorWindow::statusChanged( const css::frame::FeatureStateEvent& rEvent ) -{ - if (rEvent.FeatureURL.Complete == ".uno:ColorTableState") - { - if (rEvent.IsEnabled && mxPaletteManager->GetPalette() == 0) - { - mxPaletteManager->ReloadColorSet(*mpColorSet); - mpColorSet->layoutToGivenHeight(mpColorSet->GetSizePixel().Height(), mxPaletteManager->GetColorCount()); - } - } - else - { - mrColorStatus.statusChanged(rEvent); - SelectEntry(mrColorStatus.GetColor()); - } -} - void ColorWindow::statusChanged( const css::frame::FeatureStateEvent& rEvent ) { if (rEvent.FeatureURL.Complete == ".uno:ColorTableState") @@ -2170,19 +1919,6 @@ void ColorWindow::statusChanged( const css::frame::FeatureStateEvent& rEvent ) } } -bool SvxColorWindow::SelectValueSetEntry(SvxColorValueSet* pColorSet, const Color& rColor) -{ - for (size_t i = 1; i <= pColorSet->GetItemCount(); ++i) - { - if (rColor == pColorSet->GetItemColor(i)) - { - pColorSet->SelectItem(i); - return true; - } - } - return false; -} - bool ColorWindow::SelectValueSetEntry(ColorValueSet* pColorSet, const Color& rColor) { for (size_t i = 1; i <= pColorSet->GetItemCount(); ++i) @@ -2196,47 +1932,6 @@ bool ColorWindow::SelectValueSetEntry(ColorValueSet* pColorSet, const Color& rCo return false; } -void SvxColorWindow::SelectEntry(const NamedColor& rNamedColor) -{ - SetNoSelection(); - - const Color &rColor = rNamedColor.first; - - if (rColor == COL_TRANSPARENT || rColor == COL_AUTO) - { - mpButtonAutoColor->set_property("has-default", "true"); - return; - } - - if (mpButtonNoneColor->IsVisible() && rColor == COL_NONE_COLOR) - { - mpButtonNoneColor->set_property("has-default", "true"); - return; - } - - // try current palette - bool bFoundColor = SelectValueSetEntry(mpColorSet, rColor); - // try recently used - if (!bFoundColor) - bFoundColor = SelectValueSetEntry(mpRecentColorSet, rColor); - // if it's not there, add it there now to the end of the recently used - // so its available somewhere handy, but not without trashing the - // whole recently used - if (!bFoundColor) - { - const OUString& rColorName = rNamedColor.second; - mxPaletteManager->AddRecentColor(rColor, rColorName, false); - mxPaletteManager->ReloadRecentColorSet(*mpRecentColorSet); - SelectValueSetEntry(mpRecentColorSet, rColor); - } -} - -void SvxColorWindow::SelectEntry(const Color& rColor) -{ - OUString sColorName = "#" + rColor.AsRGBHexString().toAsciiUpperCase(); - SvxColorWindow::SelectEntry(std::make_pair(rColor, sColorName)); -} - void ColorWindow::SelectEntry(const NamedColor& rNamedColor) { SetNoSelection(); @@ -3932,23 +3627,6 @@ void SvxCurrencyToolBoxControl::GetCurrencySymbols( std::vector<OUString>& rList } } -SvxListBoxColorWrapper::SvxListBoxColorWrapper(SvxColorListBox* pControl) - : mxControl(pControl) -{ -} - -void SvxListBoxColorWrapper::operator()(const OUString& /*rCommand*/, const NamedColor& rColor) -{ - if (!mxControl) - return; - mxControl->Selected(rColor); -} - -void SvxListBoxColorWrapper::dispose() -{ - mxControl.clear(); -} - ListBoxColorWrapper::ListBoxColorWrapper(ColorListBox* pControl) : mpControl(pControl) { @@ -3959,27 +3637,6 @@ void ListBoxColorWrapper::operator()(const OUString& /*rCommand*/, const NamedCo mpControl->Selected(rColor); } -SvxColorListBox::SvxColorListBox(vcl::Window* pParent, WinBits nStyle) - : MenuButton(pParent, nStyle) - , m_aColorWrapper(this) - , m_aAutoDisplayColor(Application::GetSettings().GetStyleSettings().GetDialogColor()) - , m_nSlotId(0) -{ - m_aSelectedColor = GetAutoColor(m_nSlotId); - LockWidthRequest(); - ShowPreview(m_aSelectedColor); - SetActivateHdl(LINK(this, SvxColorListBox, MenuActivateHdl)); -} - -void SvxColorListBox::EnsurePaletteManager() -{ - if (!m_xPaletteManager) - { - m_xPaletteManager = std::make_shared<PaletteManager>(); - m_xPaletteManager->SetColorSelectFunction(std::ref(m_aColorWrapper)); - } -} - void ColorListBox::EnsurePaletteManager() { if (!m_xPaletteManager) @@ -4000,134 +3657,6 @@ void ColorListBox::SetSlotId(sal_uInt16 nSlotId, bool bShowNoneButton) createColorWindow(); } -//to avoid the box resizing every time the color is changed to -//the optimal size of the individual color, get the longest -//standard color and stick with that as the size for all -void SvxColorListBox::LockWidthRequest() -{ - if (get_width_request() != -1) - return; - NamedColor aLongestColor; - long nMaxStandardColorTextWidth = 0; - XColorListRef const xColorTable = XColorList::CreateStdColorList(); - for (long i = 0; i != xColorTable->Count(); ++i) - { - XColorEntry& rEntry = *xColorTable->GetColor(i); - long nColorTextWidth = GetTextWidth(rEntry.GetName()); - if (nColorTextWidth > nMaxStandardColorTextWidth) - { - nMaxStandardColorTextWidth = nColorTextWidth; - aLongestColor.second = rEntry.GetName(); - } - } - ShowPreview(aLongestColor); - set_width_request(get_preferred_size().Width()); -} - -void SvxColorListBox::ShowPreview(const NamedColor &rColor) -{ - const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings(); - Size aImageSize(rStyleSettings.GetListBoxPreviewDefaultPixelSize()); - - ScopedVclPtrInstance<VirtualDevice> xDevice; - xDevice->SetOutputSize(aImageSize); - const tools::Rectangle aRect(Point(0, 0), aImageSize); - if (rColor.first == COL_AUTO) - xDevice->SetFillColor(m_aAutoDisplayColor); - else - xDevice->SetFillColor(rColor.first); - - xDevice->SetLineColor(rStyleSettings.GetDisableColor()); - xDevice->DrawRect(aRect); - - BitmapEx aBitmap(xDevice->GetBitmapEx(Point(0, 0), xDevice->GetOutputSize())); - SetImageAlign(ImageAlign::Left); - SetModeImage(Image(aBitmap)); - SetText(rColor.second); -} - -IMPL_LINK(SvxColorListBox, WindowEventListener, VclWindowEvent&, rWindowEvent, void) -{ - if (rWindowEvent.GetId() == VclEventId::WindowEndPopupMode) - { - m_xColorWindow.disposeAndClear(); - SetPopover(nullptr); - } -} - -IMPL_LINK_NOARG(SvxColorListBox, MenuActivateHdl, MenuButton *, void) -{ - if (!m_xColorWindow || m_xColorWindow->isDisposed()) - createColorWindow(); -} - -void SvxColorListBox::createColorWindow() -{ - const SfxViewFrame* pViewFrame = SfxViewFrame::Current(); - const SfxFrame* pFrame = pViewFrame ? &pViewFrame->GetFrame() : nullptr; - css::uno::Reference<css::frame::XFrame> xFrame(pFrame ? pFrame->GetFrameInterface() : uno::Reference<css::frame::XFrame>()); - - EnsurePaletteManager(); - - m_xColorWindow = VclPtr<SvxColorWindow>::Create( - OUString() /*m_aCommandURL*/, - m_xPaletteManager, - m_aColorStatus, - m_nSlotId, - xFrame, - this, - true, - m_aColorWrapper); - - m_xColorWindow->AddEventListener(LINK(this, SvxColorListBox, WindowEventListener)); - - SetNoSelection(); - m_xColorWindow->SelectEntry(m_aSelectedColor); - SetPopover(m_xColorWindow); -} - -void SvxColorListBox::Selected(const NamedColor& rColor) -{ - ShowPreview(rColor); - m_aSelectedColor = rColor; - if (m_aSelectedLink.IsSet()) - m_aSelectedLink.Call(*this); -} - -SvxColorListBox::~SvxColorListBox() -{ - disposeOnce(); -} - -void SvxColorListBox::dispose() -{ - m_xColorWindow.disposeAndClear(); - m_aColorWrapper.dispose(); - MenuButton::dispose(); -} - -VclPtr<SvxColorWindow> const & SvxColorListBox::getColorWindow() const -{ - if (!m_xColorWindow || m_xColorWindow->isDisposed()) - const_cast<SvxColorListBox*>(this)->createColorWindow(); - return m_xColorWindow; -} - -void SvxColorListBox::SelectEntry(const Color& rColor) -{ - VclPtr<SvxColorWindow> xColorWindow = getColorWindow(); - xColorWindow->SelectEntry(rColor); - m_aSelectedColor = xColorWindow->GetSelectEntryColor(); - ShowPreview(m_aSelectedColor); -} - -boost::property_tree::ptree SvxColorListBox::DumpAsPropertyTree() -{ - boost::property_tree::ptree aTree = MenuButton::DumpAsPropertyTree(); - aTree.put("type", "colorlistbox"); - return aTree; -} - ColorListBox::ColorListBox(std::unique_ptr<weld::MenuButton> pControl, weld::Window* pTopLevel) : m_xButton(std::move(pControl)) , m_pTopLevel(pTopLevel) diff --git a/svx/uiconfig/ui/oldcolorwindow.ui b/svx/uiconfig/ui/oldcolorwindow.ui deleted file mode 100644 index 042fdd3cc71c..000000000000 --- a/svx/uiconfig/ui/oldcolorwindow.ui +++ /dev/null @@ -1,180 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.20.0 --> -<interface domain="svx"> - <requires lib="gtk+" version="3.18"/> - <requires lib="LibreOffice" version="1.0"/> - <object class="GtkImage" id="auto_icon"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="pixbuf">cmd/sc_square_unfilled.png</property> - </object> - <object class="GtkImage" id="custom_color_icon"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="margin_right">6</property> - <property name="xalign">0</property> - <property name="pixbuf">cmd/sc_colorsettings.png</property> - <property name="icon_size">1</property> - </object> - <object class="GtkImage" id="none_icon"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="pixbuf">cmd/sc_square_unfilled.png</property> - </object> - <object class="GtkWindow" id="palette_popup_window"> - <property name="can_focus">False</property> - <property name="hexpand">True</property> - <property name="vexpand">True</property> - <property name="border_width">4</property> - <property name="resizable">False</property> - <property name="type_hint">dock</property> - <child> - <object class="GtkBox" id="box1"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="orientation">vertical</property> - <child> - <object class="GtkBox"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="spacing">6</property> - <property name="homogeneous">True</property> - <child> - <object class="GtkButton" id="auto_color_button"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - <property name="image">auto_icon</property> - <property name="relief">none</property> - <property name="xalign">0</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkButton" id="none_color_button"> - <property name="label" translatable="yes" context="oldcolorwindow|none_color_button">None</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - <property name="image">none_icon</property> - <property name="relief">none</property> - <property name="xalign">0</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkSeparator" id="separator4"> - <property name="visible">True</property> - <property name="can_focus">False</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> - </child> - <child> - <object class="GtkComboBox" id="palette_listbox"> - <property name="visible">True</property> - <property name="can_focus">False</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">2</property> - </packing> - </child> - <child> - <object class="svxcorelo-SvxColorValueSet" id="colorset"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">3</property> - </packing> - </child> - <child> - <object class="GtkSeparator" id="separator1"> - <property name="visible">True</property> - <property name="can_focus">False</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">4</property> - </packing> - </child> - <child> - <object class="GtkLabel" id="label1"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label" translatable="yes" context="oldcolorwindow|label1">Recent</property> - <property name="xalign">0</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">5</property> - </packing> - </child> - <child> - <object class="svxcorelo-SvxColorValueSet" id="recent_colorset"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">7</property> - </packing> - </child> - <child> - <object class="GtkSeparator" id="separator3"> - <property name="visible">True</property> - <property name="can_focus">False</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">8</property> - </packing> - </child> - <child> - <object class="GtkButton" id="color_picker_button"> - <property name="label" translatable="yes" context="oldcolorwindow|color_picker_button">Custom Color…</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - <property name="image">custom_color_icon</property> - <property name="relief">none</property> - <property name="xalign">0</property> - <property name="always_show_image">True</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">9</property> - </packing> - </child> - </object> - </child> - </object> -</interface> |