[Libreoffice-commits] core.git: extras/source include/svx svx/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Tue Oct 2 08:00:39 UTC 2018
extras/source/glade/libreoffice-catalog.xml.in | 3 -
include/svx/SvxPresetListBox.hxx | 17 ------
svx/source/tbxctrls/SvxPresetListBox.cxx | 66 -------------------------
3 files changed, 86 deletions(-)
New commits:
commit 374d9af32aab5fcf56445fe1a9e474e2720c7e0c
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Oct 1 20:00:12 2018 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Tue Oct 2 10:00:13 2018 +0200
drop unused SvxPresetListBox
Change-Id: I9efd96e42c7c1a7e8f9f08ddf1edf7c74b30c7ca
Reviewed-on: https://gerrit.libreoffice.org/61216
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/extras/source/glade/libreoffice-catalog.xml.in b/extras/source/glade/libreoffice-catalog.xml.in
index 9ee1cc971c6f..b2174e4a59d0 100644
--- a/extras/source/glade/libreoffice-catalog.xml.in
+++ b/extras/source/glade/libreoffice-catalog.xml.in
@@ -206,9 +206,6 @@
<glade-widget-class title="SvxColorValueSet" name="svxcorelo-SvxColorValueSet"
generic-name="Set of Value Options" parent="GtkDrawingArea"
icon-name="widget-gtk-drawingarea"/>
- <glade-widget-class title="SvxPresetListBox" name="svxcorelo-SvxPresetListBox"
- generic-name="Set of Value Options" parent="GtkDrawingArea"
- icon-name="widget-gtk-drawingarea"/>
<glade-widget-class title="TableValueSet" name="sdlo-TableValueSet"
generic-name="Set of Table Value Options" parent="GtkDrawingArea"
icon-name="widget-gtk-drawingarea"/>
diff --git a/include/svx/SvxPresetListBox.hxx b/include/svx/SvxPresetListBox.hxx
index b090a65d60cf..888f93b86109 100644
--- a/include/svx/SvxPresetListBox.hxx
+++ b/include/svx/SvxPresetListBox.hxx
@@ -27,23 +27,6 @@
#include <svx/xtable.hxx>
#include <tools/gen.hxx>
-class SVX_DLLPUBLIC SvxPresetListBox : public ValueSet
-{
-private:
- sal_uInt32 nColCount;
-
- DECL_LINK( OnMenuItemSelected, Menu*, bool );
-
-public:
- SvxPresetListBox(vcl::Window* pParent, WinBits nWinStyle);
-
- virtual void Resize() override;
- virtual void Command( const CommandEvent& rEvt ) override;
- sal_uInt32 getColumnCount() const { return nColCount; }
-
- void DrawLayout();
-};
-
class SVX_DLLPUBLIC PresetListBox : public SvtValueSet
{
private:
diff --git a/svx/source/tbxctrls/SvxPresetListBox.cxx b/svx/source/tbxctrls/SvxPresetListBox.cxx
index 6d136e8170d7..71f8e6514458 100644
--- a/svx/source/tbxctrls/SvxPresetListBox.cxx
+++ b/svx/source/tbxctrls/SvxPresetListBox.cxx
@@ -26,72 +26,6 @@
#include <vcl/menu.hxx>
#include <vcl/popupmenuwindow.hxx>
-SvxPresetListBox::SvxPresetListBox(vcl::Window* pParent, WinBits nWinStyle)
- : ValueSet(pParent, nWinStyle),
- nColCount(3)
-{
- SetEdgeBlending(true);
- SetExtraSpacing(4);
-}
-
-
-VCL_BUILDER_FACTORY_CONSTRUCTOR(SvxPresetListBox, WB_ITEMBORDER| WB_3DLOOK|WB_OWNERDRAWDECORATION|WB_TABSTOP)
-
-void SvxPresetListBox::Resize()
-{
- DrawLayout();
- WinBits aWinBits(GetStyle());
- aWinBits |= WB_VSCROLL;
- SetStyle(aWinBits);
- ValueSet::Resize();
-}
-
-void SvxPresetListBox::Command( const CommandEvent& rEvent )
-{
- switch(rEvent.GetCommand())
- {
- case CommandEventId::ContextMenu:
- {
- const sal_uInt16 nIndex = GetSelectedItemId();
- if(nIndex > 0)
- {
- Point aPos(rEvent.GetMousePosPixel());
- VclBuilder aBuilder(nullptr, VclBuilderContainer::getUIRootDir(), "svx/ui/presetmenu.ui", "");
- VclPtr<PopupMenu> pMenu(aBuilder.get_menu("menu"));
- FloatingWindow* pMenuWindow = dynamic_cast<FloatingWindow*>(pMenu->GetWindow());
- if(pMenuWindow != nullptr)
- {
- pMenuWindow->SetPopupModeFlags(
- pMenuWindow->GetPopupModeFlags() | FloatWinPopupFlags::NoMouseUpClose);
- }
- pMenu->SetSelectHdl( LINK(this, SvxPresetListBox, OnMenuItemSelected) );
- pMenu->Execute(this,tools::Rectangle(aPos,Size(1,1)),PopupMenuFlags::ExecuteDown);
- }
- }
- break;
- default:
- ValueSet::Command( rEvent );
- break;
- }
-}
-
-void SvxPresetListBox::DrawLayout()
-{
- SetColCount(getColumnCount());
- SetLineCount(5);
-}
-
-IMPL_LINK(SvxPresetListBox, OnMenuItemSelected, Menu*, pMenu, bool)
-{
- if( pMenu == nullptr )
- {
- OSL_ENSURE( pMenu != nullptr, "SvxPresetListBox::OnMenuItemSelected : illegal menu!" );
- return false;
- }
- pMenu->Deactivate();
- return false;
-}
-
PresetListBox::PresetListBox(std::unique_ptr<weld::ScrolledWindow> pWindow)
: SvtValueSet(std::move(pWindow))
, nColCount(3)
More information about the Libreoffice-commits
mailing list