From 25934decf8bfd94506bccd48ac66be9d7eb4dce2 Mon Sep 17 00:00:00 2001 From: Jochen Nitschke Date: Thu, 7 Apr 2016 20:24:27 +0200 Subject: tdf#94306 replace boost::noncopyable in chart2 Replace with C++11 delete copy-constructur and copy-assignment. Delete default-constructors when comments suggested it. Change-Id: Ieeaf6ca998a4165d6eacf5e900c6a09aafdcfbe6 Reviewed-on: https://gerrit.libreoffice.org/23903 Reviewed-by: Jochen Nitschke Reviewed-by: David Tardon Tested-by: David Tardon --- chart2/inc/ChartModel.hxx | 2 +- chart2/source/controller/inc/AccessibleChartView.hxx | 5 ++--- chart2/source/controller/inc/ChartController.hxx | 5 +---- chart2/source/controller/inc/ChartToolbarController.hxx | 8 ++++---- chart2/source/controller/inc/dlg_CreationWizard.hxx | 10 +++++----- chart2/source/controller/inc/dlg_CreationWizard_UNO.hxx | 4 ++-- chart2/source/controller/main/ChartFrameloader.hxx | 7 ++++--- chart2/source/controller/main/ChartModelClone.hxx | 7 ++++--- chart2/source/controller/main/UndoActions.hxx | 6 +++--- chart2/source/controller/sidebar/Chart2PanelFactory.hxx | 7 ++++--- chart2/source/inc/NameContainer.hxx | 4 +--- chart2/source/inc/chartview/DrawModelWrapper.hxx | 5 ++--- chart2/source/view/charttypes/AreaChart.hxx | 5 ++--- chart2/source/view/charttypes/BarChart.hxx | 5 ++--- chart2/source/view/charttypes/BubbleChart.hxx | 5 ++--- chart2/source/view/charttypes/CandleStickChart.hxx | 6 ++---- chart2/source/view/charttypes/NetChart.hxx | 5 ++--- chart2/source/view/charttypes/PieChart.hxx | 5 ++--- chart2/source/view/inc/VDataSeries.hxx | 6 ++++-- chart2/source/view/inc/VSeriesPlotter.hxx | 6 ++---- 20 files changed, 51 insertions(+), 62 deletions(-) (limited to 'chart2') diff --git a/chart2/inc/ChartModel.hxx b/chart2/inc/ChartModel.hxx index 215c0f04abd1..e3f9997a0535 100644 --- a/chart2/inc/ChartModel.hxx +++ b/chart2/inc/ChartModel.hxx @@ -213,7 +213,7 @@ private: void insertDefaultChart(); public: - //no default constructor + ChartModel() = delete; ChartModel(css::uno::Reference< css::uno::XComponentContext > const & xContext); explicit ChartModel( const ChartModel & rOther ); virtual ~ChartModel(); diff --git a/chart2/source/controller/inc/AccessibleChartView.hxx b/chart2/source/controller/inc/AccessibleChartView.hxx index 28d4fa9a5d86..7e2e942bebe6 100644 --- a/chart2/source/controller/inc/AccessibleChartView.hxx +++ b/chart2/source/controller/inc/AccessibleChartView.hxx @@ -60,6 +60,8 @@ public: AccessibleChartView(SdrView* pView ); virtual ~AccessibleChartView(); + AccessibleChartView() = delete; + // ____ WeakComponentHelper (called from XComponent::dispose()) ____ virtual void SAL_CALL disposing() override; @@ -123,9 +125,6 @@ private: // members AccessibleUniqueId m_aCurrentSelectionOID; SdrView* m_pSdrView; ::accessibility::IAccessibleViewForwarder* m_pViewForwarder; - - //no default constructor - AccessibleChartView(); }; } //namespace chart diff --git a/chart2/source/controller/inc/ChartController.hxx b/chart2/source/controller/inc/ChartController.hxx index 2906ade9cedb..f73d7e449370 100644 --- a/chart2/source/controller/inc/ChartController.hxx +++ b/chart2/source/controller/inc/ChartController.hxx @@ -105,7 +105,7 @@ class ChartController : public ::cppu::WeakImplHelper < friend class ShapeController; public: - //no default constructor + ChartController() = delete; explicit ChartController(css::uno::Reference< css::uno::XComponentContext > const & xContext); virtual ~ChartController(); @@ -378,9 +378,6 @@ public: DECL_LINK_TYPED( NotifyUndoActionHdl, SdrUndoAction*, void ); -public: - //private - private: DrawViewWrapper* GetDrawViewWrapper(); diff --git a/chart2/source/controller/inc/ChartToolbarController.hxx b/chart2/source/controller/inc/ChartToolbarController.hxx index ddcbc523963d..ae7ce735573a 100644 --- a/chart2/source/controller/inc/ChartToolbarController.hxx +++ b/chart2/source/controller/inc/ChartToolbarController.hxx @@ -21,8 +21,6 @@ #include #include -#include - namespace chart { namespace { @@ -34,14 +32,16 @@ typedef cppu::WeakComponentImplHelper< } -class ChartToolbarController : private boost::noncopyable, - private cppu::BaseMutex, +class ChartToolbarController : private cppu::BaseMutex, public ChartToolbarControllerBase { public: ChartToolbarController(const css::uno::Sequence& rProperties); virtual ~ChartToolbarController(); + ChartToolbarController(const ChartToolbarController&) = delete; + const ChartToolbarController& operator=(const ChartToolbarController&) = delete; + // XToolbarContoller virtual void SAL_CALL execute(sal_Int16 nKeyModifier) throw (css::uno::RuntimeException, std::exception) override; diff --git a/chart2/source/controller/inc/dlg_CreationWizard.hxx b/chart2/source/controller/inc/dlg_CreationWizard.hxx index 7e7255c4cadc..18b2904b91e2 100644 --- a/chart2/source/controller/inc/dlg_CreationWizard.hxx +++ b/chart2/source/controller/inc/dlg_CreationWizard.hxx @@ -28,7 +28,6 @@ #include #include -#include #include namespace chart @@ -44,7 +43,11 @@ public: CreationWizard( vcl::Window* pParent, const css::uno::Reference< css::frame::XModel >& xChartModel , const css::uno::Reference< css::uno::XComponentContext >& xContext - , sal_Int32 nOnePageOnlyIndex=-1 );//if nOnePageOnlyIndex is an index of an exsisting page starting with 0, then only this page is displayed without next/previous and roadmap + // if nOnePageOnlyIndex is an index of an exsisting page starting with 0 + // then only this page is displayed without next/previous and roadmap + , sal_Int32 nOnePageOnlyIndex=-1 ); + + CreationWizard() = delete; bool isClosable() { /*@todo*/ return m_bIsClosable;} @@ -60,9 +63,6 @@ protected: virtual OUString getStateDisplayName( WizardState nState ) const override; private: - //no default constructor - CreationWizard(); - virtual VclPtr createPage(WizardState nState) override; css::uno::Reference< css::chart2::XChartDocument > m_xChartModel; diff --git a/chart2/source/controller/inc/dlg_CreationWizard_UNO.hxx b/chart2/source/controller/inc/dlg_CreationWizard_UNO.hxx index d9493cfb0d83..0e144f2775a9 100644 --- a/chart2/source/controller/inc/dlg_CreationWizard_UNO.hxx +++ b/chart2/source/controller/inc/dlg_CreationWizard_UNO.hxx @@ -47,6 +47,8 @@ class CreationWizardUnoDlg : public MutexContainer , public css::beans::XPropertySet { public: + CreationWizardUnoDlg() = delete; + CreationWizardUnoDlg( const css::uno::Reference< css::uno::XComponentContext >& xContext ); virtual ~CreationWizardUnoDlg(); @@ -101,8 +103,6 @@ protected: virtual void SAL_CALL disposing() override; private: - //no default constructor - CreationWizardUnoDlg(); void createDialogOnDemand(); private: diff --git a/chart2/source/controller/main/ChartFrameloader.hxx b/chart2/source/controller/main/ChartFrameloader.hxx index ffd399131a63..f27f12dcfd0e 100644 --- a/chart2/source/controller/main/ChartFrameloader.hxx +++ b/chart2/source/controller/main/ChartFrameloader.hxx @@ -39,10 +39,11 @@ private: ::osl::Condition m_oCancelFinished; private: - bool impl_checkCancel(); - //no default constructor - ChartFrameLoader(){} + bool impl_checkCancel(); + public: + ChartFrameLoader() = delete; + explicit ChartFrameLoader(css::uno::Reference< css::uno::XComponentContext > const & xContext); virtual ~ChartFrameLoader(); diff --git a/chart2/source/controller/main/ChartModelClone.hxx b/chart2/source/controller/main/ChartModelClone.hxx index 616921970902..a12adda1bc01 100644 --- a/chart2/source/controller/main/ChartModelClone.hxx +++ b/chart2/source/controller/main/ChartModelClone.hxx @@ -23,8 +23,6 @@ #include #include -#include - namespace chart { @@ -35,7 +33,7 @@ namespace chart E_MODEL_WITH_SELECTION }; - class ChartModelClone : public ::boost::noncopyable + class ChartModelClone { public: ChartModelClone( @@ -45,6 +43,9 @@ namespace chart ~ChartModelClone(); + ChartModelClone(const ChartModelClone&) = delete; + const ChartModelClone& operator=(const ChartModelClone&) = delete; + ModelFacet getFacet() const; void applyToModel( const css::uno::Reference< css::frame::XModel >& i_model ) const; diff --git a/chart2/source/controller/main/UndoActions.hxx b/chart2/source/controller/main/UndoActions.hxx index 68c91a32308c..a8dfcd96781d 100644 --- a/chart2/source/controller/main/UndoActions.hxx +++ b/chart2/source/controller/main/UndoActions.hxx @@ -32,8 +32,6 @@ #include #include -#include - class SdrUndoAction; namespace chart @@ -48,7 +46,6 @@ typedef ::cppu::WeakComponentImplHelper< css::document::XUndoAction > UndoElemen class UndoElement :public UndoElement_MBase ,public UndoElement_TBase - ,public ::boost::noncopyable { public: /** creates a new undo action @@ -66,6 +63,9 @@ public: const std::shared_ptr< ChartModelClone >& i_modelClone ); + UndoElement(const UndoElement&) = delete; + const UndoElement& operator=(const UndoElement&) = delete; + // XUndoAction virtual OUString SAL_CALL getTitle() throw (css::uno::RuntimeException, std::exception) override; virtual void SAL_CALL undo( ) throw (css::document::UndoFailedException, css::uno::RuntimeException, std::exception) override; diff --git a/chart2/source/controller/sidebar/Chart2PanelFactory.hxx b/chart2/source/controller/sidebar/Chart2PanelFactory.hxx index c68fe5f566bb..7b30fc4a9fa4 100644 --- a/chart2/source/controller/sidebar/Chart2PanelFactory.hxx +++ b/chart2/source/controller/sidebar/Chart2PanelFactory.hxx @@ -24,7 +24,6 @@ #include #include #include -#include namespace chart { namespace sidebar { @@ -37,14 +36,16 @@ namespace } class ChartPanelFactory - : private ::boost::noncopyable, - private ::cppu::BaseMutex, + : private ::cppu::BaseMutex, public PanelFactoryInterfaceBase { public: ChartPanelFactory(); virtual ~ChartPanelFactory(); + ChartPanelFactory(const ChartPanelFactory&) = delete; + const ChartPanelFactory& operator=(const ChartPanelFactory&) = delete; + // XUIElementFactory virtual css::uno::Reference SAL_CALL createUIElement( const ::rtl::OUString& rsResourceURL, diff --git a/chart2/source/inc/NameContainer.hxx b/chart2/source/inc/NameContainer.hxx index b00c90a405e2..b4fc11b06d67 100644 --- a/chart2/source/inc/NameContainer.hxx +++ b/chart2/source/inc/NameContainer.hxx @@ -47,6 +47,7 @@ typedef ::cppu::WeakImplHelper< class NameContainer : public impl::NameContainer_Base { public: + NameContainer() = delete; NameContainer( const css::uno::Type& rType, const OUString& rServicename, const OUString& rImplementationName ); explicit NameContainer( const NameContainer & rOther ); virtual ~NameContainer(); @@ -75,9 +76,6 @@ public: // XCloneable virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone() throw (css::uno::RuntimeException, std::exception) override; -private: //methods - NameContainer();//no default constructor - private: //member const css::uno::Type m_aType; const OUString m_aServicename; diff --git a/chart2/source/inc/chartview/DrawModelWrapper.hxx b/chart2/source/inc/chartview/DrawModelWrapper.hxx index 71dafdd54fc0..20cbcae441c3 100644 --- a/chart2/source/inc/chartview/DrawModelWrapper.hxx +++ b/chart2/source/inc/chartview/DrawModelWrapper.hxx @@ -41,10 +41,9 @@ private: VclPtr m_pRefDevice; - //no default constructor - DrawModelWrapper(); - public: + DrawModelWrapper() = delete; + SAL_DLLPRIVATE DrawModelWrapper( const css::uno::Reference& xContext ); SAL_DLLPRIVATE virtual ~DrawModelWrapper(); diff --git a/chart2/source/view/charttypes/AreaChart.hxx b/chart2/source/view/charttypes/AreaChart.hxx index 80f56ec7121c..14e65f8b8bd4 100644 --- a/chart2/source/view/charttypes/AreaChart.hxx +++ b/chart2/source/view/charttypes/AreaChart.hxx @@ -30,6 +30,8 @@ class AreaChart : public VSeriesPlotter { // public methods public: + AreaChart() = delete; + AreaChart( const css::uno::Reference< css::chart2::XChartType >& xChartTypeModel , sal_Int32 nDimensionCount , bool bCategoryXAxis, bool bNoArea=false @@ -50,9 +52,6 @@ public: virtual css::uno::Any getExplicitSymbol( const VDataSeries& rSeries, sal_Int32 nPointIndex=-1/*-1 for series symbol*/ ) override; private: //methods - //no default constructor - AreaChart(); - void impl_createSeriesShapes(); bool impl_createArea( VDataSeries* pSeries , css::drawing::PolyPolygonShape3D* pSeriesPoly diff --git a/chart2/source/view/charttypes/BarChart.hxx b/chart2/source/view/charttypes/BarChart.hxx index 4153cdf3f09c..17632f5c4832 100644 --- a/chart2/source/view/charttypes/BarChart.hxx +++ b/chart2/source/view/charttypes/BarChart.hxx @@ -30,6 +30,8 @@ class BarChart : public VSeriesPlotter { // public methods public: + BarChart() = delete; + BarChart( const css::uno::Reference< css::chart2::XChartType >& xChartTypeModel , sal_Int32 nDimensionCount ); virtual ~BarChart(); @@ -40,9 +42,6 @@ public: virtual css::drawing::Direction3D getPreferredDiagramAspectRatio() const override; private: //methods - //no default constructor - BarChart(); - css::uno::Reference< css::drawing::XShape > createDataPoint3D_Bar( const css::uno::Reference< css::drawing::XShapes >& xTarget diff --git a/chart2/source/view/charttypes/BubbleChart.hxx b/chart2/source/view/charttypes/BubbleChart.hxx index f66a6144774b..5c7d49caf9ed 100644 --- a/chart2/source/view/charttypes/BubbleChart.hxx +++ b/chart2/source/view/charttypes/BubbleChart.hxx @@ -29,6 +29,8 @@ class BubbleChart : public VSeriesPlotter { // public methods public: + BubbleChart() = delete; + BubbleChart( const css::uno::Reference< css::chart2::XChartType >& xChartTypeModel , sal_Int32 nDimensionCount ); virtual ~BubbleChart(); @@ -46,9 +48,6 @@ public: virtual LegendSymbolStyle getLegendSymbolStyle() override; private: //methods - //no default constructor - BubbleChart(); - void calculateMaximumLogicBubbleSize(); void calculateBubbleSizeScalingFactor(); diff --git a/chart2/source/view/charttypes/CandleStickChart.hxx b/chart2/source/view/charttypes/CandleStickChart.hxx index f85db625daa3..38e1dacd57b9 100644 --- a/chart2/source/view/charttypes/CandleStickChart.hxx +++ b/chart2/source/view/charttypes/CandleStickChart.hxx @@ -30,6 +30,8 @@ class CandleStickChart : public VSeriesPlotter { // public methods public: + CandleStickChart() = delete; + CandleStickChart( const css::uno::Reference< css::chart2::XChartType >& xChartTypeModel , sal_Int32 nDimensionCount ); virtual ~CandleStickChart(); @@ -44,10 +46,6 @@ public: virtual LegendSymbolStyle getLegendSymbolStyle() override; -private: //methods - //no default constructor - CandleStickChart(); - private: //member BarPositionHelper* m_pMainPosHelper; }; diff --git a/chart2/source/view/charttypes/NetChart.hxx b/chart2/source/view/charttypes/NetChart.hxx index ee98c343b8bd..8ec0f2793d53 100644 --- a/chart2/source/view/charttypes/NetChart.hxx +++ b/chart2/source/view/charttypes/NetChart.hxx @@ -29,6 +29,8 @@ class NetChart : public VSeriesPlotter { // public methods public: + NetChart() = delete; + NetChart( const css::uno::Reference< css::chart2::XChartType >& xChartTypeModel , sal_Int32 nDimensionCount , bool bNoArea @@ -50,9 +52,6 @@ public: virtual css::uno::Any getExplicitSymbol( const VDataSeries& rSeries, sal_Int32 nPointIndex=-1/*-1 for series symbol*/ ) override; private: //methods - //no default constructor - NetChart(); - void impl_createSeriesShapes(); bool impl_createArea( VDataSeries* pSeries , css::drawing::PolyPolygonShape3D* pSeriesPoly diff --git a/chart2/source/view/charttypes/PieChart.hxx b/chart2/source/view/charttypes/PieChart.hxx index b46279943f0f..2b39e0869f95 100644 --- a/chart2/source/view/charttypes/PieChart.hxx +++ b/chart2/source/view/charttypes/PieChart.hxx @@ -33,6 +33,8 @@ class PieChart : public VSeriesPlotter struct ShapeParam; public: + PieChart() = delete; + PieChart( const css::uno::Reference< css::chart2::XChartType >& xChartTypeModel , sal_Int32 nDimensionCount, bool bExcludingPositioning ); virtual ~PieChart(); @@ -61,9 +63,6 @@ public: virtual bool isSeparateStackingForDifferentSigns( sal_Int32 nDimensionIndex ) override; private: //methods - //no default constructor - PieChart(); - css::uno::Reference createDataPoint( const css::uno::Reference& xTarget, diff --git a/chart2/source/view/inc/VDataSeries.hxx b/chart2/source/view/inc/VDataSeries.hxx index 0d18b6eb64f4..94586f402882 100644 --- a/chart2/source/view/inc/VDataSeries.hxx +++ b/chart2/source/view/inc/VDataSeries.hxx @@ -36,7 +36,6 @@ #include #include #include -#include namespace chart { @@ -56,13 +55,16 @@ public: mutable css::uno::Sequence Doubles; }; -class VDataSeries final : private boost::noncopyable +class VDataSeries final { public: VDataSeries( const css::uno::Reference& xDataSeries ); ~VDataSeries(); + VDataSeries(const VDataSeries&) = delete; + const VDataSeries& operator=(const VDataSeries&) = delete; + css::uno::Reference getModel() const; void setCategoryXAxis(); diff --git a/chart2/source/view/inc/VSeriesPlotter.hxx b/chart2/source/view/inc/VSeriesPlotter.hxx index f112f2828ea2..2eeeb1af14ae 100644 --- a/chart2/source/view/inc/VSeriesPlotter.hxx +++ b/chart2/source/view/inc/VSeriesPlotter.hxx @@ -119,6 +119,8 @@ private: class VSeriesPlotter : public PlotterBase, public MinimumAndMaximumSupplier, public LegendEntryProvider { public: + VSeriesPlotter() = delete; + virtual ~VSeriesPlotter(); /* @@ -253,10 +255,6 @@ public: bool WantToPlotInFrontOfAxisLine(); virtual bool shouldSnapRectToUsedArea(); -private: - //no default constructor - VSeriesPlotter(); - protected: VSeriesPlotter( const css::uno::Reference< css::chart2::XChartType >& xChartTypeModel -- cgit