diff options
author | Noel Grandin <noel@peralex.com> | 2015-03-19 16:02:29 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-03-23 09:42:23 +0200 |
commit | 0339e648a8d4d78f8271af07965876fae81d1570 (patch) | |
tree | 14f7a4616185232973e59351e9e7524fac9e36a1 /chart2 | |
parent | 468ff4b3b6e20cab284b5f6dbd7c8aa5a1ba1264 (diff) |
loplugin:constantfunction: chart2
Change-Id: I2ec1eaf9faa23779fbdf53771dbba1936c6aa3f9
Diffstat (limited to 'chart2')
18 files changed, 12 insertions, 84 deletions
diff --git a/chart2/inc/ChartView.hxx b/chart2/inc/ChartView.hxx index 13bb25219501..9f901e7cd176 100644 --- a/chart2/inc/ChartView.hxx +++ b/chart2/inc/ChartView.hxx @@ -226,7 +226,6 @@ private: //methods void impl_notifyModeChangeListener( const OUString& rNewMode ); void impl_refreshAddIn(); - bool impl_AddInDrawsAllByItself(); void impl_updateView( bool bCheckLockedCtrler = true ); diff --git a/chart2/source/controller/dialogs/DataBrowser.cxx b/chart2/source/controller/dialogs/DataBrowser.cxx index 75b55d440344..f430d3723fce 100644 --- a/chart2/source/controller/dialogs/DataBrowser.cxx +++ b/chart2/source/controller/dialogs/DataBrowser.cxx @@ -162,7 +162,10 @@ public: sal_Int32 GetStartColumn() const { return m_nStartCol;} sal_Int32 GetEndColumn() const { return m_nEndCol;} - static sal_Int32 GetRelativeAppFontXPosForNameField(); + static const sal_Int32 nSymbolHeight = 10; + static const sal_Int32 nSymbolDistance = 2; + + static sal_Int32 GetRelativeAppFontXPosForNameField() { return nSymbolHeight + nSymbolDistance; } void Show(); void Hide(); @@ -239,14 +242,6 @@ void SeriesHeader::SetColor( const Color & rCol ) m_spColorBar->SetControlBackground( rCol ); } -const sal_Int32 nSymbolHeight = 10; -const sal_Int32 nSymbolDistance = 2; - -sal_Int32 SeriesHeader::GetRelativeAppFontXPosForNameField() -{ - return nSymbolHeight + nSymbolDistance; -} - void SeriesHeader::SetPos( const Point & rPos ) { m_aPos = rPos; diff --git a/chart2/source/controller/dialogs/DataBrowserModel.cxx b/chart2/source/controller/dialogs/DataBrowserModel.cxx index 3c9da085399b..e63151e6ee03 100644 --- a/chart2/source/controller/dialogs/DataBrowserModel.cxx +++ b/chart2/source/controller/dialogs/DataBrowserModel.cxx @@ -207,12 +207,6 @@ private: OUString m_aRole; }; -bool lcl_ShowCategories( const Reference< chart2::XDiagram > & /* xDiagram */ ) -{ - // show categories for all charts - return true; -} - bool lcl_ShowCategoriesAsDataLabel( const Reference< chart2::XDiagram > & xDiagram ) { return !DiagramHelper::isCategoryDiagram(xDiagram); @@ -802,7 +796,6 @@ void DataBrowserModel::updateFromModel() sal_Int32 nHeaderStart = 0; sal_Int32 nHeaderEnd = 0; - if( lcl_ShowCategories( xDiagram )) { Reference< frame::XModel > xChartModel( m_xChartDocument, uno::UNO_QUERY ); ChartModel* pModel = dynamic_cast<ChartModel*>(xChartModel.get()); diff --git a/chart2/source/controller/dialogs/dlg_View3D.cxx b/chart2/source/controller/dialogs/dlg_View3D.cxx index c346fdd23aaa..0ff8d1b10a35 100644 --- a/chart2/source/controller/dialogs/dlg_View3D.cxx +++ b/chart2/source/controller/dialogs/dlg_View3D.cxx @@ -80,10 +80,6 @@ short View3DDialog::Execute() { if( m_pGeometry ) m_pGeometry->commitPendingChanges(); - if( m_pAppearance ) - m_pAppearance->commitPendingChanges(); - if( m_pIllumination ) - m_pIllumination->commitPendingChanges(); } return nResult; } diff --git a/chart2/source/controller/dialogs/tp_3D_SceneAppearance.cxx b/chart2/source/controller/dialogs/tp_3D_SceneAppearance.cxx index 6a15742ff548..1515c6b9899d 100644 --- a/chart2/source/controller/dialogs/tp_3D_SceneAppearance.cxx +++ b/chart2/source/controller/dialogs/tp_3D_SceneAppearance.cxx @@ -128,10 +128,6 @@ void ThreeD_SceneAppearance_TabPage::ActivatePage() updateScheme(); } -void ThreeD_SceneAppearance_TabPage::commitPendingChanges() -{ -} - void ThreeD_SceneAppearance_TabPage::applyRoundedEdgeAndObjectLinesToModel() { if(!m_bCommitToModel) diff --git a/chart2/source/controller/dialogs/tp_3D_SceneAppearance.hxx b/chart2/source/controller/dialogs/tp_3D_SceneAppearance.hxx index b00718c76e9c..b674dff025dd 100644 --- a/chart2/source/controller/dialogs/tp_3D_SceneAppearance.hxx +++ b/chart2/source/controller/dialogs/tp_3D_SceneAppearance.hxx @@ -40,9 +40,6 @@ public: ControllerLockHelper & rControllerLockHelper ); virtual ~ThreeD_SceneAppearance_TabPage(); - // has to be called in case the dialog was closed with OK - void commitPendingChanges(); - virtual void ActivatePage() SAL_OVERRIDE; private: diff --git a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx index 629f55440790..71d0d65f40f2 100644 --- a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx +++ b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx @@ -301,10 +301,6 @@ ThreeD_SceneIllumination_TabPage::~ThreeD_SceneIllumination_TabPage() delete[] m_pLightSourceInfoList; } -void ThreeD_SceneIllumination_TabPage::commitPendingChanges() -{ -} - IMPL_LINK_NOARG(ThreeD_SceneIllumination_TabPage, fillControlsFromModel) { if( m_bInCommitToModel )//don't read own changes diff --git a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.hxx b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.hxx index 3f7af791d290..5e68d8bf08e0 100644 --- a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.hxx +++ b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.hxx @@ -59,9 +59,6 @@ public: const XColorListRef &pColorTable ); virtual ~ThreeD_SceneIllumination_TabPage(); - // has to be called in case the dialog was closed with OK - void commitPendingChanges(); - private: DECL_LINK( ClickLightSourceButtonHdl, LightButton* ); DECL_LINK( SelectColorHdl, ColorLB* ); diff --git a/chart2/source/controller/dialogs/tp_AxisLabel.cxx b/chart2/source/controller/dialogs/tp_AxisLabel.cxx index 82e37280d704..77a426f4bba3 100644 --- a/chart2/source/controller/dialogs/tp_AxisLabel.cxx +++ b/chart2/source/controller/dialogs/tp_AxisLabel.cxx @@ -68,17 +68,11 @@ SchAxisLabelTabPage::SchAxisLabelTabPage( vcl::Window* pParent, const SfxItemSet m_pOrientHlp->AddDependentWindow( *m_pFtRotate, TRISTATE_TRUE ); m_pCbShowDescription->SetClickHdl( LINK( this, SchAxisLabelTabPage, ToggleShowLabel ) ); - - Construct(); } SchAxisLabelTabPage::~SchAxisLabelTabPage() {delete m_pOrientHlp;} -void SchAxisLabelTabPage::Construct() -{ -} - SfxTabPage* SchAxisLabelTabPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrs ) { return new SchAxisLabelTabPage( pParent, *rAttrs ); diff --git a/chart2/source/controller/dialogs/tp_AxisLabel.hxx b/chart2/source/controller/dialogs/tp_AxisLabel.hxx index 8da5eafcf9c7..0aa09b53b823 100644 --- a/chart2/source/controller/dialogs/tp_AxisLabel.hxx +++ b/chart2/source/controller/dialogs/tp_AxisLabel.hxx @@ -71,8 +71,6 @@ public: SchAxisLabelTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs ); virtual ~SchAxisLabelTabPage(); - void Construct(); - static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rInAttrs ); virtual bool FillItemSet( SfxItemSet* rOutAttrs ) SAL_OVERRIDE; virtual void Reset( const SfxItemSet* rInAttrs ) SAL_OVERRIDE; diff --git a/chart2/source/inc/ThreeDHelper.hxx b/chart2/source/inc/ThreeDHelper.hxx index 6c27f253231c..41427ab0435d 100644 --- a/chart2/source/inc/ThreeDHelper.hxx +++ b/chart2/source/inc/ThreeDHelper.hxx @@ -83,8 +83,9 @@ public: , bool bRightAngledAxes, bool bRotateLights=true ); static void adaptRadAnglesForRightAngledAxes( double& rfXAngleRad, double& rfYAngleRad ); - static double getXDegreeAngleLimitForRightAngledAxes(); - static double getYDegreeAngleLimitForRightAngledAxes(); + static double getXDegreeAngleLimitForRightAngledAxes() { return 90.0; } + static double getYDegreeAngleLimitForRightAngledAxes() { return 45.0; } + static double getValueClippedToRange( double fValue, const double& fPositivLimit ); static void convertElevationRotationDegToXYZAngleRad( diff --git a/chart2/source/model/template/BubbleChartType.cxx b/chart2/source/model/template/BubbleChartType.cxx index f9724f7e7109..d5228542adb4 100644 --- a/chart2/source/model/template/BubbleChartType.cxx +++ b/chart2/source/model/template/BubbleChartType.cxx @@ -41,11 +41,6 @@ using ::osl::MutexGuard; namespace { -void lcl_AddPropertiesToVector( - ::std::vector< Property > & /*rOutProperties*/ ) -{ -} - struct StaticBubbleChartTypeDefaults_Initializer { ::chart::tPropertyValueMap* operator()() @@ -71,7 +66,6 @@ private: Sequence< Property > lcl_GetPropertySequence() { ::std::vector< ::com::sun::star::beans::Property > aProperties; - lcl_AddPropertiesToVector( aProperties ); ::std::sort( aProperties.begin(), aProperties.end(), ::chart::PropertyNameLess() ); diff --git a/chart2/source/model/template/BubbleChartTypeTemplate.cxx b/chart2/source/model/template/BubbleChartTypeTemplate.cxx index 5ea692e83acd..006e64eb797d 100644 --- a/chart2/source/model/template/BubbleChartTypeTemplate.cxx +++ b/chart2/source/model/template/BubbleChartTypeTemplate.cxx @@ -43,11 +43,6 @@ using ::osl::MutexGuard; namespace { -void lcl_AddPropertiesToVector( - ::std::vector< Property > & /*rOutProperties*/ ) -{ -} - struct StaticBubbleChartTypeTemplateDefaults_Initializer { ::chart::tPropertyValueMap* operator()() @@ -73,7 +68,6 @@ private: Sequence< Property > lcl_GetPropertySequence() { ::std::vector< ::com::sun::star::beans::Property > aProperties; - lcl_AddPropertiesToVector( aProperties ); ::std::sort( aProperties.begin(), aProperties.end(), ::chart::PropertyNameLess() ); diff --git a/chart2/source/tools/ThreeDHelper.cxx b/chart2/source/tools/ThreeDHelper.cxx index 407efb1002e3..79545222b464 100644 --- a/chart2/source/tools/ThreeDHelper.cxx +++ b/chart2/source/tools/ThreeDHelper.cxx @@ -898,16 +898,6 @@ double ThreeDHelper::getValueClippedToRange( double fAngle, const double& fPosit return fAngle; } -double ThreeDHelper::getXDegreeAngleLimitForRightAngledAxes() -{ - return 90.0; -} - -double ThreeDHelper::getYDegreeAngleLimitForRightAngledAxes() -{ - return 45.0; -} - void ThreeDHelper::adaptRadAnglesForRightAngledAxes( double& rfXAngleRad, double& rfYAngleRad ) { rfXAngleRad = ThreeDHelper::getValueClippedToRange(rfXAngleRad, BaseGFXHelper::Deg2Rad(ThreeDHelper::getXDegreeAngleLimitForRightAngledAxes()) ); diff --git a/chart2/source/view/inc/AbstractShapeFactory.hxx b/chart2/source/view/inc/AbstractShapeFactory.hxx index b684ae28a94b..020777dbb2bb 100644 --- a/chart2/source/view/inc/AbstractShapeFactory.hxx +++ b/chart2/source/view/inc/AbstractShapeFactory.hxx @@ -151,7 +151,7 @@ public: createArea2D( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& xTarget , const ::com::sun::star::drawing::PolyPolygonShape3D& rPolyPolygon) = 0; - static sal_Int32 getSymbolCount(); + static sal_Int32 getSymbolCount() { return Symbol_COUNT; } virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > createSymbol2D( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& xTarget diff --git a/chart2/source/view/main/AbstractShapeFactory.cxx b/chart2/source/view/main/AbstractShapeFactory.cxx index 45314c0af298..c8e229580605 100644 --- a/chart2/source/view/main/AbstractShapeFactory.cxx +++ b/chart2/source/view/main/AbstractShapeFactory.cxx @@ -115,11 +115,6 @@ AbstractShapeFactory* AbstractShapeFactory::getOrCreateShapeFactory(uno::Referen return pShapeFactory; } -sal_Int32 AbstractShapeFactory::getSymbolCount() -{ - return Symbol_COUNT; -} - uno::Reference< drawing::XShapes > AbstractShapeFactory::getChartRootShape( const uno::Reference< drawing::XDrawPage>& xDrawPage ) { diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx index ad10fb558add..030206722b1d 100644 --- a/chart2/source/view/main/ChartView.cxx +++ b/chart2/source/view/main/ChartView.cxx @@ -2002,7 +2002,7 @@ awt::Rectangle ChartView::getRectangleOfObject( const OUString& rObjectCID, bool namespace { -sal_Int32 lcl_getDiagramTitleSpace() +inline sal_Int32 lcl_getDiagramTitleSpace() { return 200; //=0,2 cm spacing } @@ -2248,7 +2248,7 @@ awt::Rectangle ExplicitValueProvider::substractAxisTitleSizes( namespace { -double lcl_getPageLayoutDistancePercentage() +inline double lcl_getPageLayoutDistancePercentage() { return 0.02; } @@ -2577,11 +2577,6 @@ void lcl_removeEmptyGroupShapes( const Reference< drawing::XShapes>& xParent ) } -bool ChartView::impl_AddInDrawsAllByItself() -{ - return false; -} - void ChartView::impl_refreshAddIn() { if( !m_bRefreshAddIn ) @@ -2628,8 +2623,6 @@ void ChartView::createShapes() //make sure add-in is refreshed after creating the shapes const ::comphelper::ScopeGuard aGuard( boost::bind( &ChartView::impl_refreshAddIn, this ) ); - if( impl_AddInDrawsAllByItself() ) - return; m_aResultingDiagramRectangleExcludingAxes = awt::Rectangle(0,0,0,0); impl_deleteCoordinateSystems(); diff --git a/chart2/source/view/main/VLegend.cxx b/chart2/source/view/main/VLegend.cxx index b7838f422e58..a5a3b722a97e 100644 --- a/chart2/source/view/main/VLegend.cxx +++ b/chart2/source/view/main/VLegend.cxx @@ -609,13 +609,13 @@ awt::Size lcl_placeLegendEntries( } // #i109336# Improve auto positioning in chart -sal_Int32 lcl_getLegendLeftRightMargin() +inline sal_Int32 lcl_getLegendLeftRightMargin() { return 210; // 1/100 mm } // #i109336# Improve auto positioning in chart -sal_Int32 lcl_getLegendTopBottomMargin() +inline sal_Int32 lcl_getLegendTopBottomMargin() { return 185; // 1/100 mm } |