[Libreoffice-commits] core.git: chart2/source include/comphelper
Stephan Bergmann
sbergman at redhat.com
Mon Apr 25 06:11:35 UTC 2016
chart2/source/controller/main/ChartController.cxx | 110 ++++++-------
chart2/source/controller/main/CommandDispatchContainer.cxx | 12 -
include/comphelper/InlineContainer.hxx | 24 --
3 files changed, 60 insertions(+), 86 deletions(-)
New commits:
commit 2b68383e44338ffc3d5fb519fd91ff31f0a2b35a
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Apr 22 22:25:28 2016 +0200
Kill comphelper::MakeSet
Change-Id: I2e5f8c2cd67406d9d275960a37c4aa45e283eec3
Reviewed-on: https://gerrit.libreoffice.org/24343
Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
Tested-by: Stephan Bergmann <sbergman at redhat.com>
diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx
index 51ce111..609c397 100644
--- a/chart2/source/controller/main/ChartController.cxx
+++ b/chart2/source/controller/main/ChartController.cxx
@@ -17,6 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <sal/config.h>
+
+#include <set>
+
#include "ChartController.hxx"
#include "servicenames.hxx"
#include "ResId.hxx"
@@ -45,7 +49,6 @@
#include "UndoActions.hxx"
#include "ViewElementListProvider.hxx"
-#include <comphelper/InlineContainer.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <com/sun/star/awt/PosSize.hpp>
@@ -1569,70 +1572,69 @@ void ChartController::impl_initializeAccessible( const uno::Reference< lang::XIn
::std::set< OUString > ChartController::impl_getAvailableCommands()
{
- return ::comphelper::MakeSet< OUString >
+ return {
// commands for container forward
- ( "AddDirect" ) ( "NewDoc" ) ( "Open" )
- ( "Save" ) ( "SaveAs" ) ( "SendMail" )
- ( "EditDoc" ) ( "ExportDirectToPDF" ) ( "PrintDefault" )
+ "AddDirect", "NewDoc", "Open",
+ "Save", "SaveAs", "SendMail",
+ "EditDoc", "ExportDirectToPDF", "PrintDefault",
// own commands
- ( "Cut" ) ( "Copy" ) ( "Paste" )
- ( "DataRanges" ) ( "DiagramData" )
+ "Cut", "Copy", "Paste",
+ "DataRanges", "DiagramData",
// insert objects
- ( "InsertMenuTitles" ) ( "InsertTitles" )
- ( "InsertMenuLegend" ) ( "InsertLegend" ) ( "DeleteLegend" )
- ( "InsertMenuDataLabels" )
- ( "InsertMenuAxes" ) ( "InsertRemoveAxes" ) ( "InsertMenuGrids" )
- ( "InsertSymbol" )
- ( "InsertTrendlineEquation" ) ( "InsertTrendlineEquationAndR2" )
- ( "InsertR2Value" ) ( "DeleteR2Value" )
- ( "InsertMenuTrendlines" ) ( "InsertTrendline" )
- ( "InsertMenuMeanValues" ) ( "InsertMeanValue" )
- ( "InsertMenuXErrorBars" ) ( "InsertXErrorBars" )
- ( "InsertMenuYErrorBars" ) ( "InsertYErrorBars" )
- ( "InsertDataLabels" ) ( "InsertDataLabel" )
- ( "DeleteTrendline" ) ( "DeleteMeanValue" ) ( "DeleteTrendlineEquation" )
- ( "DeleteXErrorBars" ) ( "DeleteYErrorBars" )
- ( "DeleteDataLabels" ) ( "DeleteDataLabel" )
+ "InsertMenuTitles", "InsertTitles",
+ "InsertMenuLegend", "InsertLegend", "DeleteLegend",
+ "InsertMenuDataLabels",
+ "InsertMenuAxes", "InsertRemoveAxes", "InsertMenuGrids",
+ "InsertSymbol",
+ "InsertTrendlineEquation", "InsertTrendlineEquationAndR2",
+ "InsertR2Value", "DeleteR2Value",
+ "InsertMenuTrendlines", "InsertTrendline",
+ "InsertMenuMeanValues", "InsertMeanValue",
+ "InsertMenuXErrorBars", "InsertXErrorBars",
+ "InsertMenuYErrorBars", "InsertYErrorBars",
+ "InsertDataLabels", "InsertDataLabel",
+ "DeleteTrendline", "DeleteMeanValue", "DeleteTrendlineEquation",
+ "DeleteXErrorBars", "DeleteYErrorBars",
+ "DeleteDataLabels", "DeleteDataLabel",
//format objects
- ( "FormatSelection" ) ( "TransformDialog" )
- ( "DiagramType" ) ( "View3D" )
- ( "Forward" ) ( "Backward" )
- ( "MainTitle" ) ( "SubTitle" )
- ( "XTitle" ) ( "YTitle" ) ( "ZTitle" )
- ( "SecondaryXTitle" ) ( "SecondaryYTitle" )
- ( "AllTitles" ) ( "Legend" )
- ( "DiagramAxisX" ) ( "DiagramAxisY" ) ( "DiagramAxisZ" )
- ( "DiagramAxisA" ) ( "DiagramAxisB" ) ( "DiagramAxisAll" )
- ( "DiagramGridXMain" ) ( "DiagramGridYMain" ) ( "DiagramGridZMain" )
- ( "DiagramGridXHelp" ) ( "DiagramGridYHelp" ) ( "DiagramGridZHelp" )
- ( "DiagramGridAll" )
- ( "DiagramWall" ) ( "DiagramFloor" ) ( "DiagramArea" )
+ "FormatSelection", "TransformDialog",
+ "DiagramType", "View3D",
+ "Forward", "Backward",
+ "MainTitle", "SubTitle",
+ "XTitle", "YTitle", "ZTitle",
+ "SecondaryXTitle", "SecondaryYTitle",
+ "AllTitles", "Legend",
+ "DiagramAxisX", "DiagramAxisY", "DiagramAxisZ",
+ "DiagramAxisA", "DiagramAxisB", "DiagramAxisAll",
+ "DiagramGridXMain", "DiagramGridYMain", "DiagramGridZMain",
+ "DiagramGridXHelp", "DiagramGridYHelp", "DiagramGridZHelp",
+ "DiagramGridAll",
+ "DiagramWall", "DiagramFloor", "DiagramArea",
//context menu - format objects entries
- ( "FormatWall" ) ( "FormatFloor" ) ( "FormatChartArea" )
- ( "FormatLegend" )
+ "FormatWall", "FormatFloor", "FormatChartArea",
+ "FormatLegend",
- ( "FormatAxis" ) ( "FormatTitle" )
- ( "FormatDataSeries" ) ( "FormatDataPoint" )
- ( "ResetAllDataPoints" ) ( "ResetDataPoint" )
- ( "FormatDataLabels" ) ( "FormatDataLabel" )
- ( "FormatMeanValue" ) ( "FormatTrendline" ) ( "FormatTrendlineEquation" )
- ( "FormatXErrorBars" ) ( "FormatYErrorBars" )
- ( "FormatStockLoss" ) ( "FormatStockGain" )
+ "FormatAxis", "FormatTitle",
+ "FormatDataSeries", "FormatDataPoint",
+ "ResetAllDataPoints", "ResetDataPoint",
+ "FormatDataLabels", "FormatDataLabel",
+ "FormatMeanValue", "FormatTrendline", "FormatTrendlineEquation",
+ "FormatXErrorBars", "FormatYErrorBars",
+ "FormatStockLoss", "FormatStockGain",
- ( "FormatMajorGrid" ) ( "InsertMajorGrid" ) ( "DeleteMajorGrid" )
- ( "FormatMinorGrid" ) ( "InsertMinorGrid" ) ( "DeleteMinorGrid" )
- ( "InsertAxis" ) ( "DeleteAxis" ) ( "InsertAxisTitle" )
+ "FormatMajorGrid", "InsertMajorGrid", "DeleteMajorGrid",
+ "FormatMinorGrid", "InsertMinorGrid", "DeleteMinorGrid",
+ "InsertAxis", "DeleteAxis", "InsertAxisTitle",
// toolbar commands
- ( "ToggleGridHorizontal" ) ( "ToggleGridVertical" ) ( "ToggleLegend" ) ( "ScaleText" )
- ( "NewArrangement" ) ( "Update" )
- ( "DefaultColors" ) ( "BarWidth" ) ( "NumberOfLines" )
- ( "ArrangeRow" )
- ( "StatusBarVisible" )
- ( "ChartElementSelector" )
- ;
+ "ToggleGridHorizontal", "ToggleGridVertical", "ToggleLegend", "ScaleText",
+ "NewArrangement", "Update",
+ "DefaultColors", "BarWidth", "NumberOfLines",
+ "ArrangeRow",
+ "StatusBarVisible",
+ "ChartElementSelector"};
}
ViewElementListProvider ChartController::getViewElementListProvider()
diff --git a/chart2/source/controller/main/CommandDispatchContainer.cxx b/chart2/source/controller/main/CommandDispatchContainer.cxx
index 6a16ec0..1e9c848 100644
--- a/chart2/source/controller/main/CommandDispatchContainer.cxx
+++ b/chart2/source/controller/main/CommandDispatchContainer.cxx
@@ -26,8 +26,6 @@
#include "DrawCommandDispatch.hxx"
#include "ShapeController.hxx"
-#include <comphelper/InlineContainer.hxx>
-
#include <com/sun/star/frame/XDispatchProvider.hpp>
using namespace ::com::sun::star;
@@ -45,12 +43,10 @@ CommandDispatchContainer::CommandDispatchContainer(
,m_pDrawCommandDispatch( nullptr )
,m_pShapeController( nullptr )
{
- m_aContainerDocumentCommands =
- ::comphelper::MakeSet< OUString >
- ("AddDirect") ("NewDoc") ("Open")
- ("Save") ("SaveAs") ("SendMail")
- ("EditDoc") ("ExportDirectToPDF") ("PrintDefault")
- ;
+ m_aContainerDocumentCommands.insert({
+ "AddDirect", "NewDoc", "Open",
+ "Save", "SaveAs", "SendMail",
+ "EditDoc", "ExportDirectToPDF", "PrintDefault"});
}
void CommandDispatchContainer::setModel(
diff --git a/include/comphelper/InlineContainer.hxx b/include/comphelper/InlineContainer.hxx
index d5c3e10..1c2aa7d 100644
--- a/include/comphelper/InlineContainer.hxx
+++ b/include/comphelper/InlineContainer.hxx
@@ -20,34 +20,10 @@
#define INCLUDED_COMPHELPER_INLINECONTAINER_HXX
#include <map>
-#include <set>
namespace comphelper
{
-/** Creates a set which contains an arbitrary number of elements.
-
- usage:
-
- set< t > aSet( MakeSet< t >( t_1 )( t_2 )...( t_n ) );
- */
-template < typename T >
-class MakeSet : public ::std::set< T >
-{
-public:
- explicit MakeSet(const T &a)
- : ::std::set< T >()
- {
- this->insert(this->end(), a);
- }
- MakeSet &operator()(const T &a)
- {
- this->insert(this->end(), a);
- return *this;
- }
-};
-
-
/** usage:
map< k, v > aMap( MakeMap< k, v >
More information about the Libreoffice-commits
mailing list