summaryrefslogtreecommitdiff
path: root/reportdesign
diff options
context:
space:
mode:
authorHeiko Tietze <tietze.heiko@gmail.com>2020-09-01 10:45:05 +0200
committerMaxim Monastirsky <momonasmon@gmail.com>2020-09-18 01:11:18 +0200
commit705226338beeabd214f260c00f1a6db2cfb52475 (patch)
tree3643bda35f5878ef39cdb4548bcd8f8d7e42ec15 /reportdesign
parent90a5b6844409ee46b8cb4d87ad8446994a546575 (diff)
Resolves tdf#97918 - Individual UNO commands for distribution options
New UNO commands added, SID_DISTRIBUTE_DLG bend to dropdown, ui removed Menus and toolbars adjusted Change-Id: Ic0a3cc299f745a1a0cd18edead1f410ff57a1f1f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102272 Tested-by: Jenkins Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
Diffstat (limited to 'reportdesign')
-rw-r--r--reportdesign/UIConfig_dbreport.mk1
-rw-r--r--reportdesign/inc/rptui_slotid.hrc2
-rw-r--r--reportdesign/source/ui/report/ReportController.cxx31
-rw-r--r--reportdesign/uiconfig/dbreport/menubar/menubar.xml2
-rw-r--r--reportdesign/uiconfig/dbreport/popupmenu/report.xml2
-rw-r--r--reportdesign/uiconfig/dbreport/toolbar/distributebar.xml21
6 files changed, 52 insertions, 7 deletions
diff --git a/reportdesign/UIConfig_dbreport.mk b/reportdesign/UIConfig_dbreport.mk
index d04dce4bbd64..89c60a3dab4f 100644
--- a/reportdesign/UIConfig_dbreport.mk
+++ b/reportdesign/UIConfig_dbreport.mk
@@ -26,6 +26,7 @@ $(eval $(call gb_UIConfig_add_toolbarfiles,modules/dbreport,\
reportdesign/uiconfig/dbreport/toolbar/arrowshapes \
reportdesign/uiconfig/dbreport/toolbar/basicshapes \
reportdesign/uiconfig/dbreport/toolbar/calloutshapes \
+ reportdesign/uiconfig/dbreport/toolbar/distributebar \
reportdesign/uiconfig/dbreport/toolbar/drawbar \
reportdesign/uiconfig/dbreport/toolbar/flowchartshapes \
reportdesign/uiconfig/dbreport/toolbar/Formatting \
diff --git a/reportdesign/inc/rptui_slotid.hrc b/reportdesign/inc/rptui_slotid.hrc
index 95dc0019af70..c66fb556efaf 100644
--- a/reportdesign/inc/rptui_slotid.hrc
+++ b/reportdesign/inc/rptui_slotid.hrc
@@ -29,7 +29,7 @@
#define SID_CONDITIONALFORMATTING ( SID_RPTUI_START + 4 )
#define SID_PAGEDIALOG ( SID_RPTUI_START + 5 )
#define SID_SETCONTROLDEFAULTS ( SID_RPTUI_START + 6 )
-#define SID_DISTRIBUTION ( SID_RPTUI_START + 7 )
+
#define SID_PAGEHEADER_WITHOUT_UNDO ( SID_RPTUI_START + 8 )
#define SID_PAGEFOOTER_WITHOUT_UNDO ( SID_RPTUI_START + 9 )
#define SID_REPORTHEADER_WITHOUT_UNDO ( SID_RPTUI_START + 10 )
diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx
index 9a73953542c8..f6509cd3beaf 100644
--- a/reportdesign/source/ui/report/ReportController.cxx
+++ b/reportdesign/source/ui/report/ReportController.cxx
@@ -451,7 +451,14 @@ FeatureState OReportController::GetState(sal_uInt16 _nId) const
aReturn.bEnabled = m_nSelectionCount > 1;
break;
- case SID_DISTRIBUTION:
+ case SID_DISTRIBUTE_HLEFT:
+ case SID_DISTRIBUTE_HCENTER:
+ case SID_DISTRIBUTE_HDISTANCE:
+ case SID_DISTRIBUTE_HRIGHT:
+ case SID_DISTRIBUTE_VTOP:
+ case SID_DISTRIBUTE_VCENTER:
+ case SID_DISTRIBUTE_VDISTANCE:
+ case SID_DISTRIBUTE_VBOTTOM:
aReturn.bEnabled = isEditable() && getDesignView()->HasSelection();
if ( aReturn.bEnabled )
{
@@ -1034,11 +1041,18 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >
case SID_OBJECT_HELL:
changeZOrder(_nId);
break;
- case SID_DISTRIBUTION:
+ case SID_DISTRIBUTE_HLEFT:
+ case SID_DISTRIBUTE_HCENTER:
+ case SID_DISTRIBUTE_HDISTANCE:
+ case SID_DISTRIBUTE_HRIGHT:
+ case SID_DISTRIBUTE_VTOP:
+ case SID_DISTRIBUTE_VCENTER:
+ case SID_DISTRIBUTE_VDISTANCE:
+ case SID_DISTRIBUTE_VBOTTOM:
{
OSectionView* pSectionView = getCurrentSectionView();
if ( pSectionView )
- pSectionView->DistributeMarkedObjects(getFrameWeld());
+ pSectionView->DistributeMarkedObjects(_nId);
}
break;
case SID_OBJECT_SMALLESTWIDTH:
@@ -1838,7 +1852,16 @@ void OReportController::describeSupportedFeatures()
implDescribeSupportedFeature( ".uno:SmallestHeight", SID_OBJECT_SMALLESTHEIGHT, CommandGroup::FORMAT );
implDescribeSupportedFeature( ".uno:GreatestWidth", SID_OBJECT_GREATESTWIDTH, CommandGroup::FORMAT );
implDescribeSupportedFeature( ".uno:GreatestHeight", SID_OBJECT_GREATESTHEIGHT, CommandGroup::FORMAT );
- implDescribeSupportedFeature( ".uno:Distribution", SID_DISTRIBUTION, CommandGroup::FORMAT );
+
+ implDescribeSupportedFeature( ".uno:DistributeSelection", SID_DISTRIBUTE_DLG, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( ".uno:DistributeHorzLeft", SID_DISTRIBUTE_HLEFT, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( ".uno:DistributeHorzCenter", SID_DISTRIBUTE_HCENTER, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( ".uno:DistributeHorzDistance", SID_DISTRIBUTE_HDISTANCE, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( ".uno:DistributeHorzRight", SID_DISTRIBUTE_HRIGHT, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( ".uno:DistributeVertTop", SID_DISTRIBUTE_VTOP, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( ".uno:DistributeVertCenter", SID_DISTRIBUTE_VCENTER, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( ".uno:DistributeVertDistance", SID_DISTRIBUTE_VDISTANCE, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( ".uno:DistributeVertBottom", SID_DISTRIBUTE_VBOTTOM, CommandGroup::FORMAT );
implDescribeSupportedFeature( ".uno:ExportTo", SID_EXPORTDOC, CommandGroup::APPLICATION );
implDescribeSupportedFeature( ".uno:ExportToPDF", SID_EXPORTDOCASPDF, CommandGroup::APPLICATION );
diff --git a/reportdesign/uiconfig/dbreport/menubar/menubar.xml b/reportdesign/uiconfig/dbreport/menubar/menubar.xml
index cf9bb4543450..2ca14f363a5d 100644
--- a/reportdesign/uiconfig/dbreport/menubar/menubar.xml
+++ b/reportdesign/uiconfig/dbreport/menubar/menubar.xml
@@ -240,7 +240,7 @@
</menu:menupopup>
</menu:menu>
<menu:menuseparator/>
- <menu:menuitem menu:id=".uno:Distribution"/>
+ <menu:menuitem menu:id=".uno:DistributeSelection"/>
</menu:menupopup>
</menu:menu>
<menu:menu menu:id=".uno:ToolsMenu" >
diff --git a/reportdesign/uiconfig/dbreport/popupmenu/report.xml b/reportdesign/uiconfig/dbreport/popupmenu/report.xml
index 5605aa9c77b7..8791fe4701f2 100644
--- a/reportdesign/uiconfig/dbreport/popupmenu/report.xml
+++ b/reportdesign/uiconfig/dbreport/popupmenu/report.xml
@@ -62,7 +62,7 @@
</menu:menupopup>
</menu:menu>
<menu:menuseparator/>
- <menu:menuitem menu:id=".uno:Distribution"/>
+ <menu:menuitem menu:id=".uno:DistributeSelection"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:ControlProperties"/>
</menu:menupopup>
diff --git a/reportdesign/uiconfig/dbreport/toolbar/distributebar.xml b/reportdesign/uiconfig/dbreport/toolbar/distributebar.xml
new file mode 100644
index 000000000000..308104262c47
--- /dev/null
+++ b/reportdesign/uiconfig/dbreport/toolbar/distributebar.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE toolbar:toolbar PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "toolbar.dtd">
+<!--
+ * 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/.
+ *
+-->
+<toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <toolbar:toolbaritem xlink:href=".uno:DistributeHorzLeft"/>
+ <toolbar:toolbaritem xlink:href=".uno:DistributeHorzCenter"/>
+ <toolbar:toolbaritem xlink:href=".uno:DistributeHorzDistance"/>
+ <toolbar:toolbaritem xlink:href=".uno:DistributeHorzRight"/>
+ <toolbar:toolbarbreak/>
+ <toolbar:toolbaritem xlink:href=".uno:DistributeVertTop"/>
+ <toolbar:toolbaritem xlink:href=".uno:DistributeVertCenter"/>
+ <toolbar:toolbaritem xlink:href=".uno:DistributeVertDistance"/>
+ <toolbar:toolbaritem xlink:href=".uno:DistributeVertBottom"/>
+</toolbar:toolbar> \ No newline at end of file