diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-09-20 11:27:25 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-09-20 13:11:56 +0200 |
commit | 65062ceaae656dca2cf66653b0ed7d627737e54c (patch) | |
tree | acdbc893aa8f6d7e2349209164a745ff5c994837 /chart2 | |
parent | 6defa69b8f3a60643163ecba28b6df1f5825bcd2 (diff) |
use more std::u16string_view in chart2
Change-Id: I3617efa2e7fd55e6c1007338fd3c52aa9bbf13b2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140232
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2')
16 files changed, 98 insertions, 98 deletions
diff --git a/chart2/source/controller/dialogs/ObjectNameProvider.cxx b/chart2/source/controller/dialogs/ObjectNameProvider.cxx index 55dfbcef0287..987e5c7412cc 100644 --- a/chart2/source/controller/dialogs/ObjectNameProvider.cxx +++ b/chart2/source/controller/dialogs/ObjectNameProvider.cxx @@ -62,7 +62,7 @@ using ::com::sun::star::uno::Any; namespace { -OUString lcl_getDataSeriesName( const OUString& rObjectCID, const rtl::Reference<::chart::ChartModel>& xChartModel ) +OUString lcl_getDataSeriesName( std::u16string_view rObjectCID, const rtl::Reference<::chart::ChartModel>& xChartModel ) { OUString aRet; @@ -81,7 +81,7 @@ OUString lcl_getDataSeriesName( const OUString& rObjectCID, const rtl::Reference return aRet; } -OUString lcl_getFullSeriesName( const OUString& rObjectCID, const rtl::Reference<::chart::ChartModel>& xChartModel ) +OUString lcl_getFullSeriesName( std::u16string_view rObjectCID, const rtl::Reference<::chart::ChartModel>& xChartModel ) { OUString aRet(SchResId(STR_TIP_DATASERIES)); OUString aWildcard( "%SERIESNAME" ); @@ -323,7 +323,7 @@ OUString ObjectNameProvider::getName( ObjectType eObjectType, bool bPlural ) return aRet; } -OUString ObjectNameProvider::getAxisName( const OUString& rObjectCID +OUString ObjectNameProvider::getAxisName( std::u16string_view rObjectCID , const rtl::Reference<::chart::ChartModel>& xChartModel ) { OUString aRet; @@ -399,7 +399,7 @@ OUString ObjectNameProvider::getTitleNameByType( TitleHelper::eTitleType eType ) return aRet; } -OUString ObjectNameProvider::getTitleName( const OUString& rObjectCID +OUString ObjectNameProvider::getTitleName( std::u16string_view rObjectCID , const rtl::Reference<::chart::ChartModel>& xChartModel ) { OUString aRet; @@ -418,7 +418,7 @@ OUString ObjectNameProvider::getTitleName( const OUString& rObjectCID return aRet; } -OUString ObjectNameProvider::getGridName( const OUString& rObjectCID +OUString ObjectNameProvider::getGridName( std::u16string_view rObjectCID , const rtl::Reference<::chart::ChartModel>& xChartModel ) { OUString aRet; @@ -471,7 +471,7 @@ OUString ObjectNameProvider::getGridName( const OUString& rObjectCID return aRet; } -OUString ObjectNameProvider::getHelpText( const OUString& rObjectCID, const rtl::Reference<::chart::ChartModel>& xChartModel, bool bVerbose ) +OUString ObjectNameProvider::getHelpText( std::u16string_view rObjectCID, const rtl::Reference<::chart::ChartModel>& xChartModel, bool bVerbose ) { OUString aRet; ObjectType eObjectType( ObjectIdentifier::getObjectType(rObjectCID) ); @@ -716,7 +716,7 @@ OUString ObjectNameProvider::getHelpText( const OUString& rObjectCID, const rtl: return aRet; } -OUString ObjectNameProvider::getSelectedObjectText( const OUString & rObjectCID, const rtl::Reference<::chart::ChartModel>& xChartDocument ) +OUString ObjectNameProvider::getSelectedObjectText( std::u16string_view rObjectCID, const rtl::Reference<::chart::ChartModel>& xChartDocument ) { OUString aRet; ObjectType eObjectType( ObjectIdentifier::getObjectType(rObjectCID) ); @@ -768,7 +768,7 @@ OUString ObjectNameProvider::getSelectedObjectText( const OUString & rObjectCID, } OUString ObjectNameProvider::getNameForCID( - const OUString& rObjectCID, + std::u16string_view rObjectCID, const rtl::Reference<::chart::ChartModel>& xChartDocument ) { ObjectType eType( ObjectIdentifier::getObjectType( rObjectCID )); @@ -836,7 +836,7 @@ OUString ObjectNameProvider::getNameForCID( OUString ObjectNameProvider::getName_ObjectForSeries( ObjectType eObjectType, - const OUString& rSeriesCID, + std::u16string_view rSeriesCID, const rtl::Reference<::chart::ChartModel>& xChartDocument ) { rtl::Reference< DataSeries > xSeries = ObjectIdentifier::getDataSeriesForCID( rSeriesCID , xChartDocument ); diff --git a/chart2/source/controller/dialogs/dlg_InsertErrorBars.cxx b/chart2/source/controller/dialogs/dlg_InsertErrorBars.cxx index 98afaa47c057..6d3aa87d20a0 100644 --- a/chart2/source/controller/dialogs/dlg_InsertErrorBars.cxx +++ b/chart2/source/controller/dialogs/dlg_InsertErrorBars.cxx @@ -69,7 +69,7 @@ void InsertErrorBarsDialog::SetAxisMinorStepWidthForErrorBarDecimals( double fMi double InsertErrorBarsDialog::getAxisMinorStepWidthForErrorBarDecimals( const rtl::Reference<::chart::ChartModel>& xChartModel, const Reference< uno::XInterface >& xChartView, - const OUString& rSelectedObjectCID ) + std::u16string_view rSelectedObjectCID ) { double fStepWidth = 0.001; diff --git a/chart2/source/controller/inc/ChartController.hxx b/chart2/source/controller/inc/ChartController.hxx index 81f3070403bc..0e913961f2c8 100644 --- a/chart2/source/controller/inc/ChartController.hxx +++ b/chart2/source/controller/inc/ChartController.hxx @@ -536,7 +536,7 @@ private: /// @return </sal_True>, if resize/move was successful bool impl_moveOrResizeObject( const OUString & rCID, eMoveOrResizeType eType, double fAmountLogicX, double fAmountLogicY ); - bool impl_DragDataPoint( const OUString & rCID, double fOffset ); + bool impl_DragDataPoint( std::u16string_view rCID, double fOffset ); static const o3tl::sorted_vector< OUString >& impl_getAvailableCommands(); diff --git a/chart2/source/controller/inc/ObjectNameProvider.hxx b/chart2/source/controller/inc/ObjectNameProvider.hxx index 276e58977d35..c613dd5ce855 100644 --- a/chart2/source/controller/inc/ObjectNameProvider.hxx +++ b/chart2/source/controller/inc/ObjectNameProvider.hxx @@ -35,33 +35,33 @@ class ObjectNameProvider { public: static OUString getName( ObjectType eObjectType, bool bPlural=false ); - static OUString getAxisName( const OUString& rObjectCID + static OUString getAxisName( std::u16string_view rObjectCID , const rtl::Reference<::chart::ChartModel>& xChartModel ); - static OUString getGridName( const OUString& rObjectCID + static OUString getGridName( std::u16string_view rObjectCID , const rtl::Reference<::chart::ChartModel>& xChartModel ); - static OUString getTitleName( const OUString& rObjectCID + static OUString getTitleName( std::u16string_view rObjectCID , const rtl::Reference<::chart::ChartModel>& xChartModel ); static OUString getTitleNameByType( TitleHelper::eTitleType eType ); static OUString getNameForCID( - const OUString& rObjectCID, + std::u16string_view rObjectCID, const rtl::Reference<::chart::ChartModel>& xChartDocument ); static OUString getName_ObjectForSeries( ObjectType eObjectType, - const OUString& rSeriesCID, + std::u16string_view rSeriesCID, const rtl::Reference<::chart::ChartModel>& xChartDocument ); static OUString getName_ObjectForAllSeries( ObjectType eObjectType ); /** Provides help texts for the various chart elements. The parameter rObjectCID has to be a ClassifiedIdentifier - see class ObjectIdentifier. */ - static OUString getHelpText( const OUString& rObjectCID, const rtl::Reference<::chart::ChartModel>& xChartModel, bool bVerbose=false ); + static OUString getHelpText( std::u16string_view rObjectCID, const rtl::Reference<::chart::ChartModel>& xChartModel, bool bVerbose=false ); /** This is used for showing the currently selected object in the status bar (command "Context") */ - static OUString getSelectedObjectText( const OUString & rObjectCID, const rtl::Reference<::chart::ChartModel>& xChartDocument ); + static OUString getSelectedObjectText( std::u16string_view rObjectCID, const rtl::Reference<::chart::ChartModel>& xChartDocument ); }; } //namespace chart diff --git a/chart2/source/controller/inc/PositionAndSizeHelper.hxx b/chart2/source/controller/inc/PositionAndSizeHelper.hxx index f70ccf302f6d..0f79373d52f9 100644 --- a/chart2/source/controller/inc/PositionAndSizeHelper.hxx +++ b/chart2/source/controller/inc/PositionAndSizeHelper.hxx @@ -36,7 +36,7 @@ public: , const css::awt::Rectangle& rOldPositionAndSize , const css::awt::Rectangle& rPageRectangle ); - static bool moveObject( const OUString& rObjectCID + static bool moveObject( std::u16string_view rObjectCID , const rtl::Reference<::chart::ChartModel>& xChartModel , const css::awt::Rectangle& rNewPositionAndSize , const css::awt::Rectangle& rOldPositionAndSize diff --git a/chart2/source/controller/inc/dlg_InsertErrorBars.hxx b/chart2/source/controller/inc/dlg_InsertErrorBars.hxx index e68036153c10..59911c2f5ed2 100644 --- a/chart2/source/controller/inc/dlg_InsertErrorBars.hxx +++ b/chart2/source/controller/inc/dlg_InsertErrorBars.hxx @@ -43,7 +43,7 @@ public: static double getAxisMinorStepWidthForErrorBarDecimals( const rtl::Reference<::chart::ChartModel>& xChartModel, const css::uno::Reference<css::uno::XInterface>& xChartView, - const OUString& rSelectedObjectCID); + std::u16string_view rSelectedObjectCID); void FillItemSet(SfxItemSet& rOutAttrs); diff --git a/chart2/source/controller/main/ChartController_Insert.cxx b/chart2/source/controller/main/ChartController_Insert.cxx index c75ac20457e5..40a0a86b1e95 100644 --- a/chart2/source/controller/main/ChartController_Insert.cxx +++ b/chart2/source/controller/main/ChartController_Insert.cxx @@ -599,7 +599,7 @@ void ChartController::executeDispatch_InsertErrorBars( bool bYError ) bYError ? ErrorBarResources::ERROR_BAR_Y : ErrorBarResources::ERROR_BAR_X); aDlg.SetAxisMinorStepWidthForErrorBarDecimals( - InsertErrorBarsDialog::getAxisMinorStepWidthForErrorBarDecimals( getChartModel(), m_xChartView, OUString() ) ); + InsertErrorBarsDialog::getAxisMinorStepWidthForErrorBarDecimals( getChartModel(), m_xChartView, u"" ) ); if (aDlg.run() == RET_OK) { diff --git a/chart2/source/controller/main/ChartController_Properties.cxx b/chart2/source/controller/main/ChartController_Properties.cxx index 46dbe5431ff6..501870ecf2b2 100644 --- a/chart2/source/controller/main/ChartController_Properties.cxx +++ b/chart2/source/controller/main/ChartController_Properties.cxx @@ -76,7 +76,7 @@ namespace { wrapper::ItemConverter* createItemConverter( - const OUString & aObjectCID, const rtl::Reference<::chart::ChartModel>& xChartModel, + std::u16string_view aObjectCID, const rtl::Reference<::chart::ChartModel>& xChartModel, const uno::Reference<uno::XComponentContext>& xContext, SdrModel& rDrawModel, ExplicitValueProvider* pExplicitValueProvider, ReferenceSizeProvider const * pRefSizeProvider ) { diff --git a/chart2/source/controller/main/ChartController_Tools.cxx b/chart2/source/controller/main/ChartController_Tools.cxx index 085f31e8b574..ee036e9cff01 100644 --- a/chart2/source/controller/main/ChartController_Tools.cxx +++ b/chart2/source/controller/main/ChartController_Tools.cxx @@ -96,7 +96,7 @@ namespace { bool lcl_deleteDataSeries( - const OUString & rCID, + std::u16string_view rCID, const rtl::Reference<::chart::ChartModel> & xModel, const Reference< document::XUndoManager > & xUndoManager ) { @@ -128,7 +128,7 @@ bool lcl_deleteDataSeries( } bool lcl_deleteDataCurve( - const OUString & rCID, + std::u16string_view rCID, const rtl::Reference<::chart::ChartModel> & xModel, const Reference< document::XUndoManager > & xUndoManager ) { @@ -143,7 +143,7 @@ bool lcl_deleteDataCurve( { uno::Reference< chart2::XRegressionCurveContainer > xRegressionCurveContainer( ObjectIdentifier::getObjectPropertySet( - OUString(ObjectIdentifier::getFullParentParticle( rCID )), xModel), uno::UNO_QUERY ); + ObjectIdentifier::getFullParentParticle( rCID ), xModel), uno::UNO_QUERY ); if( xRegressionCurveContainer.is()) { @@ -679,7 +679,7 @@ bool ChartController::executeDispatch_Delete() { uno::Reference< chart2::XRegressionCurveContainer > xRegCurveCnt( ObjectIdentifier::getObjectPropertySet( - OUString(ObjectIdentifier::getFullParentParticle( aCID )), getChartModel()), uno::UNO_QUERY ); + ObjectIdentifier::getFullParentParticle( aCID ), getChartModel()), uno::UNO_QUERY ); if( xRegCurveCnt.is()) { UndoGuard aUndoGuard( diff --git a/chart2/source/controller/main/ChartController_Window.cxx b/chart2/source/controller/main/ChartController_Window.cxx index 98e6f8f9cd6a..78734d05e06a 100644 --- a/chart2/source/controller/main/ChartController_Window.cxx +++ b/chart2/source/controller/main/ChartController_Window.cxx @@ -1851,7 +1851,7 @@ bool ChartController::impl_moveOrResizeObject( return bResult; } -bool ChartController::impl_DragDataPoint( const OUString & rCID, double fAdditionalOffset ) +bool ChartController::impl_DragDataPoint( std::u16string_view rCID, double fAdditionalOffset ) { bool bResult = false; if( fAdditionalOffset < -1.0 || fAdditionalOffset > 1.0 || fAdditionalOffset == 0.0 ) diff --git a/chart2/source/controller/main/PositionAndSizeHelper.cxx b/chart2/source/controller/main/PositionAndSizeHelper.cxx index 6bdb41a7de02..50678d145b3c 100644 --- a/chart2/source/controller/main/PositionAndSizeHelper.cxx +++ b/chart2/source/controller/main/PositionAndSizeHelper.cxx @@ -152,7 +152,7 @@ bool PositionAndSizeHelper::moveObject( ObjectType eObjectType return true; } -bool PositionAndSizeHelper::moveObject( const OUString& rObjectCID +bool PositionAndSizeHelper::moveObject( std::u16string_view rObjectCID , const rtl::Reference<::chart::ChartModel>& xChartModel , const awt::Rectangle& rNewPositionAndSize , const awt::Rectangle& rOldPositionAndSize diff --git a/chart2/source/controller/sidebar/ChartAxisPanel.cxx b/chart2/source/controller/sidebar/ChartAxisPanel.cxx index acc4a8add952..f44264a1bb47 100644 --- a/chart2/source/controller/sidebar/ChartAxisPanel.cxx +++ b/chart2/source/controller/sidebar/ChartAxisPanel.cxx @@ -36,7 +36,7 @@ namespace chart::sidebar { namespace { bool isLabelShown(const rtl::Reference<::chart::ChartModel>& xModel, - const OUString& rCID) + std::u16string_view rCID) { rtl::Reference< ::chart::Axis > xAxis = ObjectIdentifier::getAxisForCID(rCID, xModel); @@ -53,7 +53,7 @@ bool isLabelShown(const rtl::Reference<::chart::ChartModel>& xModel, } void setLabelShown(const rtl::Reference<::chart::ChartModel>& xModel, - const OUString& rCID, bool bVisible) + std::u16string_view rCID, bool bVisible) { rtl::Reference< ::chart::Axis > xAxis = ObjectIdentifier::getAxisForCID(rCID, xModel); @@ -77,7 +77,7 @@ AxisLabelPosMap const aLabelPosMap[] = { }; sal_Int32 getLabelPosition(const rtl::Reference<::chart::ChartModel>& xModel, - const OUString& rCID) + std::u16string_view rCID) { rtl::Reference< ::chart::Axis > xAxis = ObjectIdentifier::getAxisForCID(rCID, xModel); @@ -100,7 +100,7 @@ sal_Int32 getLabelPosition(const rtl::Reference<::chart::ChartModel>& xModel, } void setLabelPosition(const rtl::Reference<::chart::ChartModel>& xModel, - const OUString& rCID, sal_Int32 nPos) + std::u16string_view rCID, sal_Int32 nPos) { rtl::Reference< ::chart::Axis > xAxis = ObjectIdentifier::getAxisForCID(rCID, xModel); @@ -118,7 +118,7 @@ void setLabelPosition(const rtl::Reference<::chart::ChartModel>& xModel, } bool isReverse(const rtl::Reference<::chart::ChartModel>& xModel, - const OUString& rCID) + std::u16string_view rCID) { rtl::Reference< Axis > xAxis = ObjectIdentifier::getAxisForCID(rCID, xModel); @@ -132,7 +132,7 @@ bool isReverse(const rtl::Reference<::chart::ChartModel>& xModel, } void setReverse(const rtl::Reference<::chart::ChartModel>& xModel, - const OUString& rCID, bool bReverse) + std::u16string_view rCID, bool bReverse) { rtl::Reference< Axis > xAxis = ObjectIdentifier::getAxisForCID(rCID, xModel); @@ -170,7 +170,7 @@ OUString getCID(const css::uno::Reference<css::frame::XModel>& xModel) } void setAxisRotation(const rtl::Reference<::chart::ChartModel>& xModel, - const OUString& rCID, double nVal) + std::u16string_view rCID, double nVal) { rtl::Reference< ::chart::Axis > xAxis = ObjectIdentifier::getAxisForCID(rCID, xModel); @@ -182,7 +182,7 @@ void setAxisRotation(const rtl::Reference<::chart::ChartModel>& xModel, } double getAxisRotation(const rtl::Reference<::chart::ChartModel>& xModel, - const OUString& rCID) + std::u16string_view rCID) { rtl::Reference< ::chart::Axis > xAxis = ObjectIdentifier::getAxisForCID(rCID, xModel); diff --git a/chart2/source/controller/sidebar/ChartErrorBarPanel.cxx b/chart2/source/controller/sidebar/ChartErrorBarPanel.cxx index e86fdf0fef59..66563e4586a9 100644 --- a/chart2/source/controller/sidebar/ChartErrorBarPanel.cxx +++ b/chart2/source/controller/sidebar/ChartErrorBarPanel.cxx @@ -41,13 +41,13 @@ enum class ErrorBarDirection }; css::uno::Reference<css::beans::XPropertySet> getErrorBarPropSet( - const rtl::Reference<::chart::ChartModel>& xModel, const OUString& rCID) + const rtl::Reference<::chart::ChartModel>& xModel, std::u16string_view rCID) { return ObjectIdentifier::getObjectPropertySet(rCID, xModel); } bool showPositiveError(const rtl::Reference<::chart::ChartModel>& xModel, - const OUString& rCID) + std::u16string_view rCID) { css::uno::Reference<css::beans::XPropertySet> xPropSet = getErrorBarPropSet(xModel, rCID); @@ -66,7 +66,7 @@ bool showPositiveError(const rtl::Reference<::chart::ChartModel>& xModel, } bool showNegativeError(const rtl::Reference<::chart::ChartModel>& xModel, - const OUString& rCID) + std::u16string_view rCID) { css::uno::Reference<css::beans::XPropertySet> xPropSet = getErrorBarPropSet(xModel, rCID); @@ -85,7 +85,7 @@ bool showNegativeError(const rtl::Reference<::chart::ChartModel>& xModel, } void setShowPositiveError(const rtl::Reference<::chart::ChartModel>& xModel, - const OUString& rCID, bool bShow) + std::u16string_view rCID, bool bShow) { css::uno::Reference<css::beans::XPropertySet> xPropSet = getErrorBarPropSet(xModel, rCID); @@ -97,7 +97,7 @@ void setShowPositiveError(const rtl::Reference<::chart::ChartModel>& xModel, } void setShowNegativeError(const rtl::Reference<::chart::ChartModel>& xModel, - const OUString& rCID, bool bShow) + std::u16string_view rCID, bool bShow) { css::uno::Reference<css::beans::XPropertySet> xPropSet = getErrorBarPropSet(xModel, rCID); @@ -125,7 +125,7 @@ ErrorBarTypeMap const aErrorBarType[] = { }; sal_Int32 getTypePos(const rtl::Reference<::chart::ChartModel>& xModel, - const OUString& rCID) + std::u16string_view rCID) { css::uno::Reference<css::beans::XPropertySet> xPropSet = getErrorBarPropSet(xModel, rCID); @@ -151,7 +151,7 @@ sal_Int32 getTypePos(const rtl::Reference<::chart::ChartModel>& xModel, } void setTypePos(const rtl::Reference<::chart::ChartModel>& xModel, - const OUString& rCID, sal_Int32 nPos) + std::u16string_view rCID, sal_Int32 nPos) { css::uno::Reference<css::beans::XPropertySet> xPropSet = getErrorBarPropSet(xModel, rCID); @@ -170,7 +170,7 @@ void setTypePos(const rtl::Reference<::chart::ChartModel>& xModel, } double getValue(const rtl::Reference<::chart::ChartModel>& xModel, - const OUString& rCID, ErrorBarDirection eDir) + std::u16string_view rCID, ErrorBarDirection eDir) { css::uno::Reference<css::beans::XPropertySet> xPropSet = getErrorBarPropSet(xModel, rCID); @@ -194,7 +194,7 @@ double getValue(const rtl::Reference<::chart::ChartModel>& xModel, } void setValue(const rtl::Reference<::chart::ChartModel>& xModel, - const OUString& rCID, double nVal, ErrorBarDirection eDir) + std::u16string_view rCID, double nVal, ErrorBarDirection eDir) { css::uno::Reference<css::beans::XPropertySet> xPropSet = getErrorBarPropSet(xModel, rCID); diff --git a/chart2/source/controller/sidebar/ChartSeriesPanel.cxx b/chart2/source/controller/sidebar/ChartSeriesPanel.cxx index c5b21ed5a4c4..ad77a6aa5e5d 100644 --- a/chart2/source/controller/sidebar/ChartSeriesPanel.cxx +++ b/chart2/source/controller/sidebar/ChartSeriesPanel.cxx @@ -45,7 +45,7 @@ namespace chart::sidebar { namespace { -bool isDataLabelVisible(const rtl::Reference<::chart::ChartModel>& xModel, const OUString& rCID) +bool isDataLabelVisible(const rtl::Reference<::chart::ChartModel>& xModel, std::u16string_view rCID) { rtl::Reference< DataSeries > xSeries = ObjectIdentifier::getDataSeriesForCID(rCID, xModel); @@ -56,7 +56,7 @@ bool isDataLabelVisible(const rtl::Reference<::chart::ChartModel>& xModel, const return DataSeriesHelper::hasDataLabelsAtSeries(xSeries); } -void setDataLabelVisible(const rtl::Reference<::chart::ChartModel>& xModel, const OUString& rCID, bool bVisible) +void setDataLabelVisible(const rtl::Reference<::chart::ChartModel>& xModel, std::u16string_view rCID, bool bVisible) { rtl::Reference< DataSeries > xSeries = ObjectIdentifier::getDataSeriesForCID(rCID, xModel); @@ -86,7 +86,7 @@ LabelPlacementMap const aLabelPlacementMap[] = { }; sal_Int32 getDataLabelPlacement(const rtl::Reference<::chart::ChartModel>& xModel, - const OUString& rCID) + std::u16string_view rCID) { rtl::Reference< DataSeries > xSeries = ObjectIdentifier::getDataSeriesForCID(rCID, xModel); @@ -111,7 +111,7 @@ sal_Int32 getDataLabelPlacement(const rtl::Reference<::chart::ChartModel>& xMode } void setDataLabelPlacement(const rtl::Reference<::chart::ChartModel>& xModel, - const OUString& rCID, sal_Int32 nPos) + std::u16string_view rCID, sal_Int32 nPos) { rtl::Reference< DataSeries > xSeries = ObjectIdentifier::getDataSeriesForCID(rCID, xModel); @@ -133,7 +133,7 @@ void setDataLabelPlacement(const rtl::Reference<::chart::ChartModel>& xModel, } bool isTrendlineVisible(const rtl::Reference<::chart::ChartModel>& xModel, - const OUString& rCID) + std::u16string_view rCID) { rtl::Reference< DataSeries > xRegressionCurveContainer = ObjectIdentifier::getDataSeriesForCID(rCID, xModel); @@ -145,7 +145,7 @@ bool isTrendlineVisible(const rtl::Reference<::chart::ChartModel>& xModel, } void setTrendlineVisible(const rtl::Reference<::chart::ChartModel>& - xModel, const OUString& rCID, bool bVisible) + xModel, std::u16string_view rCID, bool bVisible) { rtl::Reference< DataSeries > xRegressionCurveContainer = ObjectIdentifier::getDataSeriesForCID(rCID, xModel); @@ -166,7 +166,7 @@ void setTrendlineVisible(const rtl::Reference<::chart::ChartModel>& } bool isErrorBarVisible(const rtl::Reference<::chart::ChartModel>& xModel, - const OUString& rCID, bool bYError) + std::u16string_view rCID, bool bYError) { rtl::Reference< DataSeries > xSeries = ObjectIdentifier::getDataSeriesForCID(rCID, xModel); @@ -178,7 +178,7 @@ bool isErrorBarVisible(const rtl::Reference<::chart::ChartModel>& xModel, } void setErrorBarVisible(const rtl::Reference<::chart::ChartModel>& - xModel, const OUString& rCID, bool bYError, bool bVisible) + xModel, std::u16string_view rCID, bool bYError, bool bVisible) { rtl::Reference< DataSeries > xSeries = ObjectIdentifier::getDataSeriesForCID(rCID, xModel); @@ -199,7 +199,7 @@ void setErrorBarVisible(const rtl::Reference<::chart::ChartModel>& } bool isPrimaryAxis(const rtl::Reference<::chart::ChartModel>& - xModel, const OUString& rCID) + xModel, std::u16string_view rCID) { rtl::Reference< DataSeries > xSeries = ObjectIdentifier::getDataSeriesForCID(rCID, xModel); @@ -211,7 +211,7 @@ bool isPrimaryAxis(const rtl::Reference<::chart::ChartModel>& } void setAttachedAxisType(const rtl::Reference<::chart::ChartModel>& - xModel, const OUString& rCID, bool bPrimary) + xModel, std::u16string_view rCID, bool bPrimary) { const rtl::Reference<DataSeries> xDataSeries = ObjectIdentifier::getDataSeriesForCID(rCID, xModel); @@ -230,7 +230,7 @@ rtl::Reference<ChartType> getChartType( return xCooSysSequence[0]->getChartTypes2()[0]; } -OUString getSeriesLabel(const rtl::Reference<::chart::ChartModel>& xModel, const OUString& rCID) +OUString getSeriesLabel(const rtl::Reference<::chart::ChartModel>& xModel, std::u16string_view rCID) { rtl::Reference< DataSeries > xSeries = ObjectIdentifier::getDataSeriesForCID(rCID, xModel); diff --git a/chart2/source/inc/ObjectIdentifier.hxx b/chart2/source/inc/ObjectIdentifier.hxx index 14b684f59f46..46b4a279a9d1 100644 --- a/chart2/source/inc/ObjectIdentifier.hxx +++ b/chart2/source/inc/ObjectIdentifier.hxx @@ -156,7 +156,7 @@ public: static OUString addChildParticle( std::u16string_view rParticle, std::u16string_view rChildParticle ); static OUString createChildParticleWithIndex( ObjectType eObjectType, sal_Int32 nIndex ); - static sal_Int32 getIndexFromParticleOrCID( const OUString& rParticleOrCID ); + static sal_Int32 getIndexFromParticleOrCID( std::u16string_view rParticleOrCID ); static OUString createClassifiedIdentifier( enum ObjectType eObjectType //e.g. OBJECTTYPE_DATA_SERIES @@ -198,29 +198,29 @@ public: static std::u16string_view getFullParentParticle( std::u16string_view rCID ); //returns the series particle of a CID when the CID is a child of the series - static OUString getSeriesParticleFromCID( const OUString& rCID ); + static OUString getSeriesParticleFromCID( std::u16string_view rCID ); //return the model object that is indicated by rObjectCID static css::uno::Reference< css::beans::XPropertySet > getObjectPropertySet( - const OUString& rObjectCID + std::u16string_view rObjectCID , const rtl::Reference< ::chart::ChartModel >& xChartDocument ); //return the axis object that belongs to rObjectCID if any static rtl::Reference< ::chart::Axis > getAxisForCID( - const OUString& rObjectCID + std::u16string_view rObjectCID , const rtl::Reference<::chart::ChartModel>& xChartModel ); //return the series object that belongs to rObjectCID if any static rtl::Reference< ::chart::DataSeries > getDataSeriesForCID( - const OUString& rObjectCID + std::u16string_view rObjectCID , const rtl::Reference<::chart::ChartModel>& xChartModel ); static rtl::Reference< ::chart::Diagram > getDiagramForCID( - const OUString& rObjectCID + std::u16string_view rObjectCID , const rtl::Reference<::chart::ChartModel>& xChartModel ); static const OUString& getPieSegmentDragMethodServiceName(); @@ -235,7 +235,7 @@ public: static TitleHelper::eTitleType getTitleTypeForCID( std::u16string_view rCID ); - static OUString getMovedSeriesCID( const OUString& rObjectCID, bool bForward ); + static OUString getMovedSeriesCID( std::u16string_view rObjectCID, bool bForward ); bool isValid() const; bool isAutoGeneratedObject() const; diff --git a/chart2/source/tools/ObjectIdentifier.cxx b/chart2/source/tools/ObjectIdentifier.cxx index 0952effbbf86..7d647aa854dd 100644 --- a/chart2/source/tools/ObjectIdentifier.cxx +++ b/chart2/source/tools/ObjectIdentifier.cxx @@ -153,17 +153,17 @@ rtl::Reference<ChartType> lcl_getFirstStockChartType( const rtl::Reference<::cha return nullptr; } -OUString lcl_getIndexStringAfterString( const OUString& rString, const OUString& rSearchString ) -{ - sal_Int32 nIndexStart = rString.lastIndexOf( rSearchString ); - if( nIndexStart == -1 ) - return OUString(); - nIndexStart += rSearchString.getLength(); - sal_Int32 nIndexEnd = rString.getLength(); - sal_Int32 nNextColon = rString.indexOf( ':', nIndexStart ); - if( nNextColon != -1 ) +std::u16string_view lcl_getIndexStringAfterString( std::u16string_view rString, std::u16string_view rSearchString ) +{ + size_t nIndexStart = rString.rfind( rSearchString ); + if( nIndexStart == std::u16string_view::npos ) + return std::u16string_view(); + nIndexStart += rSearchString.size(); + size_t nIndexEnd = rString.size(); + size_t nNextColon = rString.find( ':', nIndexStart ); + if( nNextColon != std::u16string_view::npos ) nIndexEnd = nNextColon; - return rString.copy(nIndexStart,nIndexEnd-nIndexStart); + return rString.substr(nIndexStart,nIndexEnd-nIndexStart); } sal_Int32 lcl_StringToIndex( std::u16string_view rIndexString ) @@ -178,34 +178,34 @@ sal_Int32 lcl_StringToIndex( std::u16string_view rIndexString ) return nRet; } -void lcl_parseCooSysIndices( sal_Int32& rnDiagram, sal_Int32& rnCooSys, const OUString& rString ) +void lcl_parseCooSysIndices( sal_Int32& rnDiagram, sal_Int32& rnCooSys, std::u16string_view rString ) { - rnDiagram = lcl_StringToIndex( lcl_getIndexStringAfterString( rString, "D=" ) ); - rnCooSys = lcl_StringToIndex( lcl_getIndexStringAfterString( rString, "CS=" ) ); + rnDiagram = lcl_StringToIndex( lcl_getIndexStringAfterString( rString, u"D=" ) ); + rnCooSys = lcl_StringToIndex( lcl_getIndexStringAfterString( rString, u"CS=" ) ); } -void lcl_parseAxisIndices( sal_Int32& rnDimensionIndex, sal_Int32& rnAxisIndex, const OUString& rString ) +void lcl_parseAxisIndices( sal_Int32& rnDimensionIndex, sal_Int32& rnAxisIndex, std::u16string_view rString ) { - OUString aAxisIndexString = lcl_getIndexStringAfterString( rString, ":Axis=" ); + std::u16string_view aAxisIndexString = lcl_getIndexStringAfterString( rString, u":Axis=" ); sal_Int32 nCharacterIndex=0; rnDimensionIndex = lcl_StringToIndex( o3tl::getToken(aAxisIndexString, 0, ',', nCharacterIndex ) ); rnAxisIndex = lcl_StringToIndex( o3tl::getToken(aAxisIndexString, 0, ',', nCharacterIndex ) ); } -void lcl_parseGridIndices( sal_Int32& rnSubGridIndex, const OUString& rString ) +void lcl_parseGridIndices( sal_Int32& rnSubGridIndex, std::u16string_view rString ) { rnSubGridIndex = -1; - rnSubGridIndex = lcl_StringToIndex( lcl_getIndexStringAfterString( rString, ":SubGrid=" ) ); + rnSubGridIndex = lcl_StringToIndex( lcl_getIndexStringAfterString( rString, u":SubGrid=" ) ); } -void lcl_parseSeriesIndices( sal_Int32& rnChartTypeIndex, sal_Int32& rnSeriesIndex, sal_Int32& rnPointIndex, const OUString& rString ) +void lcl_parseSeriesIndices( sal_Int32& rnChartTypeIndex, sal_Int32& rnSeriesIndex, sal_Int32& rnPointIndex, std::u16string_view rString ) { - rnChartTypeIndex = lcl_StringToIndex( lcl_getIndexStringAfterString( rString, "CT=" ) ); - rnSeriesIndex = lcl_StringToIndex( lcl_getIndexStringAfterString( rString, "Series=" ) ); - rnPointIndex = lcl_StringToIndex( lcl_getIndexStringAfterString( rString, "Point=" ) ); + rnChartTypeIndex = lcl_StringToIndex( lcl_getIndexStringAfterString( rString, u"CT=" ) ); + rnSeriesIndex = lcl_StringToIndex( lcl_getIndexStringAfterString( rString, u"Series=" ) ); + rnPointIndex = lcl_StringToIndex( lcl_getIndexStringAfterString( rString, u"Point=" ) ); } -void lcl_getDiagramAndCooSys( const OUString& rObjectCID +void lcl_getDiagramAndCooSys( std::u16string_view rObjectCID , const rtl::Reference<::chart::ChartModel>& xChartModel , rtl::Reference< Diagram >& xDiagram , rtl::Reference< BaseCoordinateSystem >& xCooSys ) @@ -1013,9 +1013,9 @@ OUString ObjectIdentifier::createChildParticleWithIndex( ObjectType eObjectType, return aRet.makeStringAndClear(); } -sal_Int32 ObjectIdentifier::getIndexFromParticleOrCID( const OUString& rParticleOrCID ) +sal_Int32 ObjectIdentifier::getIndexFromParticleOrCID( std::u16string_view rParticleOrCID ) { - const OUString aIndexString = lcl_getIndexStringAfterString( rParticleOrCID, "=" ); + const std::u16string_view aIndexString = lcl_getIndexStringAfterString( rParticleOrCID, u"=" ); return lcl_StringToIndex( o3tl::getToken(aIndexString, 0, ',' ) ); } @@ -1084,11 +1084,11 @@ bool ObjectIdentifier::isCID( std::u16string_view rName ) } Reference< beans::XPropertySet > ObjectIdentifier::getObjectPropertySet( - const OUString& rObjectCID + std::u16string_view rObjectCID , const rtl::Reference<::chart::ChartModel>& xChartModel ) { //return the model object that is indicated by rObjectCID - if(rObjectCID.isEmpty()) + if(rObjectCID.empty()) return nullptr; if(!xChartModel.is()) return nullptr; @@ -1270,7 +1270,7 @@ Reference< beans::XPropertySet > ObjectIdentifier::getObjectPropertySet( } rtl::Reference< Axis > ObjectIdentifier::getAxisForCID( - const OUString& rObjectCID + std::u16string_view rObjectCID , const rtl::Reference<::chart::ChartModel>& xChartModel ) { rtl::Reference< Diagram > xDiagram; @@ -1285,7 +1285,7 @@ rtl::Reference< Axis > ObjectIdentifier::getAxisForCID( } rtl::Reference< DataSeries > ObjectIdentifier::getDataSeriesForCID( - const OUString& rObjectCID + std::u16string_view rObjectCID , const rtl::Reference<::chart::ChartModel>& xChartModel ) { rtl::Reference< Diagram > xDiagram; @@ -1310,7 +1310,7 @@ rtl::Reference< DataSeries > ObjectIdentifier::getDataSeriesForCID( } rtl::Reference< Diagram > ObjectIdentifier::getDiagramForCID( - const OUString& rObjectCID + std::u16string_view rObjectCID , const rtl::Reference<::chart::ChartModel>& xChartModel ) { rtl::Reference< Diagram > xDiagram; @@ -1334,7 +1334,7 @@ TitleHelper::eTitleType ObjectIdentifier::getTitleTypeForCID( std::u16string_vie return eRet; } -OUString ObjectIdentifier::getSeriesParticleFromCID( const OUString& rCID ) +OUString ObjectIdentifier::getSeriesParticleFromCID( std::u16string_view rCID ) { sal_Int32 nDiagramIndex = -1; sal_Int32 nCooSysIndex = -1; @@ -1348,12 +1348,12 @@ OUString ObjectIdentifier::getSeriesParticleFromCID( const OUString& rCID ) return ObjectIdentifier::createParticleForSeries( nDiagramIndex, nCooSysIndex, nChartTypeIndex, nSeriesIndex ); } -OUString ObjectIdentifier::getMovedSeriesCID( const OUString& rObjectCID, bool bForward ) +OUString ObjectIdentifier::getMovedSeriesCID( std::u16string_view rObjectCID, bool bForward ) { - sal_Int32 nDiagramIndex = lcl_StringToIndex( lcl_getIndexStringAfterString( rObjectCID, "CID/D=" ) ); - sal_Int32 nCooSysIndex = lcl_StringToIndex( lcl_getIndexStringAfterString( rObjectCID, "CS=" ) ); - sal_Int32 nChartTypeIndex = lcl_StringToIndex( lcl_getIndexStringAfterString( rObjectCID, "CT=" ) ); - sal_Int32 nSeriesIndex = lcl_StringToIndex( lcl_getIndexStringAfterString( rObjectCID, "Series=" ) ); + sal_Int32 nDiagramIndex = lcl_StringToIndex( lcl_getIndexStringAfterString( rObjectCID, u"CID/D=" ) ); + sal_Int32 nCooSysIndex = lcl_StringToIndex( lcl_getIndexStringAfterString( rObjectCID, u"CS=" ) ); + sal_Int32 nChartTypeIndex = lcl_StringToIndex( lcl_getIndexStringAfterString( rObjectCID, u"CT=" ) ); + sal_Int32 nSeriesIndex = lcl_StringToIndex( lcl_getIndexStringAfterString( rObjectCID, u"Series=" ) ); if( bForward ) nSeriesIndex--; |