diff options
author | Noel <noel.grandin@collabora.co.uk> | 2021-01-28 20:29:16 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-01-29 09:25:12 +0100 |
commit | 1250aecd71fabde4dba990bfceb61bbe8e06b8ea (patch) | |
tree | 3c42ffdf68b7e81aba29228631a8cd34e2f11830 | |
parent | 4f3987e0b1a995431478769c898b5ef151745254 (diff) |
loplugin:stringviewparam extend to new..
O[U]StringBuffer methods
Change-Id: I0ffbc33d54ae7c98b5652434f3370ee4f819f6f4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110090
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
127 files changed, 404 insertions, 352 deletions
diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx index 4ebab52ee2c4..94d496e87c4f 100644 --- a/basic/source/classes/sb.cxx +++ b/basic/source/classes/sb.cxx @@ -1538,7 +1538,7 @@ void StarBASIC::SetErrorData( ErrCode nCode, sal_uInt16 nLine, aGlobals.nCol2 = nCol2; } -void StarBASIC::MakeErrorText( ErrCode nId, const OUString& aMsg ) +void StarBASIC::MakeErrorText( ErrCode nId, std::u16string_view aMsg ) { SolarMutexGuard aSolarGuard; sal_uInt16 nOldID = GetVBErrorCode( nId ); diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx index ac6fcf8a2879..2afc7ed52604 100644 --- a/basic/source/classes/sbunoobj.cxx +++ b/basic/source/classes/sbunoobj.cxx @@ -284,13 +284,13 @@ namespace } } -static void implAppendExceptionMsg( OUStringBuffer& _inout_rBuffer, const Exception& _e, const OUString& _rExceptionType, sal_Int32 _nLevel ) +static void implAppendExceptionMsg( OUStringBuffer& _inout_rBuffer, const Exception& _e, std::u16string_view _rExceptionType, sal_Int32 _nLevel ) { _inout_rBuffer.append( "\n" ); lcl_indent( _inout_rBuffer, _nLevel ); _inout_rBuffer.append( "Type: " ); - if ( _rExceptionType.isEmpty() ) + if ( _rExceptionType.empty() ) _inout_rBuffer.append( "Unknown" ); else _inout_rBuffer.append( _rExceptionType ); @@ -303,7 +303,7 @@ static void implAppendExceptionMsg( OUStringBuffer& _inout_rBuffer, const Except } // construct an error message for the exception -static OUString implGetExceptionMsg( const Exception& e, const OUString& aExceptionType_ ) +static OUString implGetExceptionMsg( const Exception& e, std::u16string_view aExceptionType_ ) { OUStringBuffer aMessageBuf; implAppendExceptionMsg( aMessageBuf, e, aExceptionType_, 0 ); @@ -338,7 +338,7 @@ static Any convertAny( const Any& rVal, const Type& aDestType ) catch( const CannotConvertException& e2 ) { StarBASIC::Error( ERRCODE_BASIC_EXCEPTION, - implGetExceptionMsg( e2, "com.sun.star.lang.IllegalArgumentException" ) ); + implGetExceptionMsg( e2, u"com.sun.star.lang.IllegalArgumentException" ) ); return aConvertedVal; } return aConvertedVal; @@ -4150,7 +4150,7 @@ void RTL_Impl_CreateUnoValue( SbxArray& rPar ) catch( const NoSuchElementException& e1 ) { StarBASIC::Error( ERRCODE_BASIC_EXCEPTION, - implGetExceptionMsg( e1, "com.sun.star.container.NoSuchElementException" ) ); + implGetExceptionMsg( e1, u"com.sun.star.container.NoSuchElementException" ) ); return; } Reference< XTypeDescription > xTypeDesc; diff --git a/chart2/source/controller/main/ChartController_Insert.cxx b/chart2/source/controller/main/ChartController_Insert.cxx index 320282a5deb5..04c27782c375 100644 --- a/chart2/source/controller/main/ChartController_Insert.cxx +++ b/chart2/source/controller/main/ChartController_Insert.cxx @@ -441,7 +441,7 @@ void ChartController::executeDispatch_InsertErrorBars( bool bYError ) aItemConverter.FillItemSet( aItemSet ); ObjectPropertiesDialogParameter aDialogParameter( ObjectIdentifier::createClassifiedIdentifierWithParent( - objType, OUString(), m_aSelection.getSelectedCID())); + objType, u"", m_aSelection.getSelectedCID())); aDialogParameter.init( getModel() ); ViewElementListProvider aViewElementListProvider( m_pDrawModelWrapper.get()); SolarMutexGuard aGuard; diff --git a/chart2/source/controller/main/ChartController_Properties.cxx b/chart2/source/controller/main/ChartController_Properties.cxx index 666c9979830e..e7a35fef3410 100644 --- a/chart2/source/controller/main/ChartController_Properties.cxx +++ b/chart2/source/controller/main/ChartController_Properties.cxx @@ -327,7 +327,7 @@ wrapper::ItemConverter* createItemConverter( OUString lcl_getTitleCIDForCommand( std::string_view rDispatchCommand, const uno::Reference< frame::XModel > & xChartModel ) { if( rDispatchCommand == "AllTitles") - return ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_TITLE, "ALLELEMENTS" ); + return ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_TITLE, u"ALLELEMENTS" ); TitleHelper::eTitleType nTitleType( TitleHelper::MAIN_TITLE ); if( rDispatchCommand == "SubTitle" ) @@ -350,7 +350,7 @@ OUString lcl_getTitleCIDForCommand( std::string_view rDispatchCommand, const uno OUString lcl_getAxisCIDForCommand( std::string_view rDispatchCommand, const uno::Reference< frame::XModel >& xChartModel ) { if( rDispatchCommand == "DiagramAxisAll") - return ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_AXIS, "ALLELEMENTS" ); + return ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_AXIS, u"ALLELEMENTS" ); sal_Int32 nDimensionIndex=0; bool bMainAxis=true; @@ -385,7 +385,7 @@ OUString lcl_getGridCIDForCommand( std::string_view rDispatchCommand, const uno: uno::Reference< XDiagram > xDiagram( ChartModelHelper::findDiagram( xChartModel ) ); if( rDispatchCommand == "DiagramGridAll") - return ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_GRID, "ALLELEMENTS" ); + return ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_GRID, u"ALLELEMENTS" ); sal_Int32 nDimensionIndex=0; bool bMainGrid=true; @@ -429,7 +429,7 @@ OUString lcl_getErrorCIDForCommand( const ObjectType eDispatchType, const Object if( eSelectedType == eDispatchType ) return rSelectedCID; - return ObjectIdentifier::createClassifiedIdentifierWithParent( eDispatchType, OUString(), rSelectedCID ); + return ObjectIdentifier::createClassifiedIdentifierWithParent( eDispatchType, u"", rSelectedCID ); } OUString lcl_getObjectCIDForCommand( std::string_view rDispatchCommand, const uno::Reference< XChartDocument > & xChartDocument, const OUString& rSelectedCID ) @@ -520,7 +520,7 @@ OUString lcl_getObjectCIDForCommand( std::string_view rDispatchCommand, const un return rSelectedCID; else return ObjectIdentifier::createClassifiedIdentifierWithParent( - OBJECTTYPE_DATA_LABELS, OUString(), rSelectedCID ); + OBJECTTYPE_DATA_LABELS, u"", rSelectedCID ); } //data labels else if( rDispatchCommand == "FormatDataLabel" ) @@ -536,7 +536,7 @@ OUString lcl_getObjectCIDForCommand( std::string_view rDispatchCommand, const un OUString aChildParticle( ObjectIdentifier::getStringForType( OBJECTTYPE_DATA_LABELS ) + "=" ); OUString aLabelsCID = ObjectIdentifier::createClassifiedIdentifierForParticles( aSeriesParticle, aChildParticle ); OUString aLabelCID_Stub = ObjectIdentifier::createClassifiedIdentifierWithParent( - OBJECTTYPE_DATA_LABEL, OUString(), aLabelsCID ); + OBJECTTYPE_DATA_LABEL, u"", aLabelsCID ); return ObjectIdentifier::createPointCID( aLabelCID_Stub, nPointIndex ); } @@ -631,7 +631,7 @@ OUString lcl_getObjectCIDForCommand( std::string_view rDispatchCommand, const un if( eSelectedType == OBJECTTYPE_DATA_STOCK_LOSS ) return rSelectedCID; else - return ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_DATA_STOCK_LOSS, OUString()); + return ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_DATA_STOCK_LOSS, u""); } // stock gain else if( rDispatchCommand == "FormatStockGain" ) @@ -639,12 +639,12 @@ OUString lcl_getObjectCIDForCommand( std::string_view rDispatchCommand, const un if( eSelectedType == OBJECTTYPE_DATA_STOCK_GAIN ) return rSelectedCID; else - return ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_DATA_STOCK_GAIN, OUString() ); + return ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_DATA_STOCK_GAIN, u"" ); } return ObjectIdentifier::createClassifiedIdentifier( eObjectType, - OUString() ); // aParticleID + u"" ); // aParticleID } } @@ -682,7 +682,7 @@ OUString lcl_getFormatCIDforSelectedCID( const OUString& rSelectedCID ) // treat diagram as wall if( eObjectType==OBJECTTYPE_DIAGRAM ) - aFormatCID = ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_DIAGRAM_WALL, OUString() ); + aFormatCID = ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_DIAGRAM_WALL, u"" ); return aFormatCID; } diff --git a/chart2/source/controller/main/ObjectHierarchy.cxx b/chart2/source/controller/main/ObjectHierarchy.cxx index 32762762e827..ff4d63fc16ea 100644 --- a/chart2/source/controller/main/ObjectHierarchy.cxx +++ b/chart2/source/controller/main/ObjectHierarchy.cxx @@ -206,7 +206,7 @@ void ImplObjectHierarchy::createTree( const Reference< XChartDocument >& xChartD // Chart Area if( m_bOrderingForElementSelector ) { - aTopLevelContainer.emplace_back( ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_PAGE, OUString() ) ); + aTopLevelContainer.emplace_back( ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_PAGE, u"" ) ); if( xDiagram.is() ) { aTopLevelContainer.push_back( aDiaOID ); @@ -268,7 +268,7 @@ void ImplObjectHierarchy::createTree( const Reference< XChartDocument >& xChartD // Chart Area if( !m_bOrderingForElementSelector ) - aTopLevelContainer.emplace_back( ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_PAGE, OUString() ) ); + aTopLevelContainer.emplace_back( ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_PAGE, u"" ) ); if( ! aTopLevelContainer.empty()) m_aChildMap[ ObjectHierarchy::getRootNodeOID() ] = aTopLevelContainer; @@ -371,11 +371,11 @@ void ImplObjectHierarchy::createWallAndFloor( bool bHasWall = DiagramHelper::isSupportingFloorAndWall( xDiagram ); if( bHasWall && bIsThreeD ) { - rContainer.emplace_back( ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_DIAGRAM_WALL, OUString() ) ); + rContainer.emplace_back( ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_DIAGRAM_WALL, u"" ) ); Reference< beans::XPropertySet > xFloor( xDiagram->getFloor()); if( xFloor.is()) - rContainer.emplace_back( ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_DIAGRAM_FLOOR, OUString() ) ); + rContainer.emplace_back( ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_DIAGRAM_FLOOR, u"" ) ); } } @@ -468,7 +468,7 @@ void ImplObjectHierarchy::createDataSeriesTree( ( nStyle != css::chart::ErrorBarStyle::NONE ) ) { aSeriesSubContainer.emplace_back( ObjectIdentifier::createClassifiedIdentifierWithParent( - OBJECTTYPE_DATA_ERRORS_Y, OUString(), aSeriesParticle ) ); + OBJECTTYPE_DATA_ERRORS_Y, u"", aSeriesParticle ) ); } } @@ -481,7 +481,7 @@ void ImplObjectHierarchy::createDataSeriesTree( ( nStyle != css::chart::ErrorBarStyle::NONE ) ) { aSeriesSubContainer.emplace_back( ObjectIdentifier::createClassifiedIdentifierWithParent( - OBJECTTYPE_DATA_ERRORS_X, OUString(), aSeriesParticle ) ); + OBJECTTYPE_DATA_ERRORS_X, u"", aSeriesParticle ) ); } } } diff --git a/chart2/source/controller/main/SelectionHelper.cxx b/chart2/source/controller/main/SelectionHelper.cxx index 29c71c5c1097..dc3230749f57 100644 --- a/chart2/source/controller/main/SelectionHelper.cxx +++ b/chart2/source/controller/main/SelectionHelper.cxx @@ -242,7 +242,7 @@ void Selection::adaptSelectionToNewPos( const Point& rMousePos, DrawViewWrapper if ( !m_aSelectedOID.isAdditionalShape() ) { - OUString aPageCID( ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_PAGE, OUString() ) );//@todo read CID from model + OUString aPageCID( ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_PAGE, u"" ) );//@todo read CID from model if ( !m_aSelectedOID.isAutoGeneratedObject() ) { @@ -251,7 +251,7 @@ void Selection::adaptSelectionToNewPos( const Point& rMousePos, DrawViewWrapper //check whether the diagram was hit but not selected (e.g. because it has no filling): OUString aDiagramCID = ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_DIAGRAM, OUString::number( 0 ) ); - OUString aWallCID( ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_DIAGRAM_WALL, OUString() ) );//@todo read CID from model + OUString aWallCID( ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_DIAGRAM_WALL, u"" ) );//@todo read CID from model bool bBackGroundHit = m_aSelectedOID.getObjectCID() == aPageCID || m_aSelectedOID.getObjectCID() == aWallCID || !m_aSelectedOID.isAutoGeneratedObject(); if( bBackGroundHit ) { @@ -401,7 +401,7 @@ OUString SelectionHelper::getHitObjectCID( aRet.clear(); } - OUString aPageCID( ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_PAGE, OUString() ) );//@todo read CID from model + OUString aPageCID( ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_PAGE, u"" ) );//@todo read CID from model //get page when nothing was hit if( aRet.isEmpty() && !pNewObj ) { @@ -426,7 +426,7 @@ OUString SelectionHelper::getHitObjectCID( } else if( bGetDiagramInsteadOf_Wall ) { - OUString aWallCID( ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_DIAGRAM_WALL, OUString() ) );//@todo read CID from model + OUString aWallCID( ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_DIAGRAM_WALL, u"" ) );//@todo read CID from model if( aRet == aWallCID ) { diff --git a/chart2/source/controller/sidebar/ChartAreaPanel.cxx b/chart2/source/controller/sidebar/ChartAreaPanel.cxx index 55a756c6edf3..fc887fc91aae 100644 --- a/chart2/source/controller/sidebar/ChartAreaPanel.cxx +++ b/chart2/source/controller/sidebar/ChartAreaPanel.cxx @@ -55,7 +55,7 @@ OUString getCID(const css::uno::Reference<css::frame::XModel>& xModel) ChartController* pController = dynamic_cast<ChartController*>(xController.get()); if (pController) { - pController->select( css::uno::Any( ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_PAGE, OUString() ) ) ); + pController->select( css::uno::Any( ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_PAGE, u"" ) ) ); xSelectionSupplier = css::uno::Reference<css::view::XSelectionSupplier>(xController, css::uno::UNO_QUERY); if (xSelectionSupplier.is()) aAny = xSelectionSupplier->getSelection(); diff --git a/chart2/source/inc/ObjectIdentifier.hxx b/chart2/source/inc/ObjectIdentifier.hxx index 6f534305359e..48895bd42bdd 100644 --- a/chart2/source/inc/ObjectIdentifier.hxx +++ b/chart2/source/inc/ObjectIdentifier.hxx @@ -115,8 +115,8 @@ public: static OUString createClassifiedIdentifierForParticles( const OUString& rParentParticle , const OUString& rChildParticle - , const OUString& rDragMethodServiceName = OUString() - , const OUString& rDragParameterString = OUString() ); + , std::u16string_view rDragMethodServiceName = std::u16string_view() + , std::u16string_view rDragParameterString = std::u16string_view() ); static OUString createClassifiedIdentifierForGrid( const css::uno::Reference< css::chart2::XAxis >& xAxis @@ -147,20 +147,20 @@ public: static OUString createParticleForLegend( const css::uno::Reference< css::frame::XModel >& xChartModel ); - static OUString addChildParticle( const OUString& rParticle, const OUString& rChildParticle ); + static OUString addChildParticle( const OUString& rParticle, std::u16string_view rChildParticle ); static OUString createChildParticleWithIndex( ObjectType eObjectType, sal_Int32 nIndex ); static sal_Int32 getIndexFromParticleOrCID( const OUString& rParticleOrCID ); static OUString createClassifiedIdentifier( enum ObjectType eObjectType //e.g. OBJECTTYPE_DATA_SERIES - , const OUString& rParticleID );//e.g. SeriesID + , std::u16string_view rParticleID );//e.g. SeriesID static OUString createClassifiedIdentifierWithParent( enum ObjectType //e.g. OBJECTTYPE_DATA_POINT or OBJECTTYPE_GRID - , const OUString& rParticleID //for points or subgrids this is an Index or otherwise an identifier from the model object - , const OUString& rParentPartical //e.g. "Series=SeriesID" or "Grid=GridId" - , const OUString& rDragMethodServiceName = OUString() - , const OUString& rDragParameterString = OUString() + , std::u16string_view rParticleID //for points or subgrids this is an Index or otherwise an identifier from the model object + , std::u16string_view rParentPartical //e.g. "Series=SeriesID" or "Grid=GridId" + , std::u16string_view rDragMethodServiceName = std::u16string_view() + , std::u16string_view rDragParameterString = std::u16string_view() ); static bool isCID( const OUString& rName ); @@ -179,12 +179,12 @@ public: static OUString createSeriesSubObjectStub( ObjectType eSubObjectType , const OUString& rSeriesParticle - , const OUString& rDragMethodServiceName = OUString() - , const OUString& rDragParameterString = OUString() ); + , std::u16string_view rDragMethodServiceName = std::u16string_view() + , std::u16string_view rDragParameterString = std::u16string_view() ); static OUString createPointCID( std::u16string_view rPointCID_Stub, sal_Int32 nIndex ); - static OUString createDataCurveCID( const OUString& rSeriesParticle, sal_Int32 nCurveIndex, bool bAverageLine ); - static OUString createDataCurveEquationCID( const OUString& rSeriesParticle, sal_Int32 nCurveIndex ); + static OUString createDataCurveCID( std::u16string_view rSeriesParticle, sal_Int32 nCurveIndex, bool bAverageLine ); + static OUString createDataCurveEquationCID( std::u16string_view rSeriesParticle, sal_Int32 nCurveIndex ); SAL_DLLPRIVATE static OUString getObjectID( const OUString& rCID ); static OUString getParticleID( const OUString& rCID ); diff --git a/chart2/source/tools/ObjectIdentifier.cxx b/chart2/source/tools/ObjectIdentifier.cxx index 29f2b83efbec..64273763158e 100644 --- a/chart2/source/tools/ObjectIdentifier.cxx +++ b/chart2/source/tools/ObjectIdentifier.cxx @@ -62,8 +62,8 @@ namespace { OUString lcl_createClassificationStringForType( ObjectType eObjectType - , const OUString& rDragMethodServiceName - , const OUString& rDragParameterString + , std::u16string_view rDragMethodServiceName + , std::u16string_view rDragParameterString ) { OUStringBuffer aRet; @@ -81,14 +81,14 @@ OUString lcl_createClassificationStringForType( ObjectType eObjectType default: break;//empty string } - if( !rDragMethodServiceName.isEmpty() ) + if( !rDragMethodServiceName.empty() ) { if( !aRet.isEmpty() ) aRet.append(":"); aRet.append( m_aDragMethodEquals ); aRet.append( rDragMethodServiceName ); - if( !rDragParameterString.isEmpty() ) + if( !rDragParameterString.empty() ) { if( !aRet.isEmpty() ) aRet.append(":"); @@ -477,8 +477,8 @@ OUString ObjectIdentifier::createClassifiedIdentifierForParticle( OUString ObjectIdentifier::createClassifiedIdentifierForParticles( const OUString& rParentParticle , const OUString& rChildParticle - , const OUString& rDragMethodServiceName - , const OUString& rDragParameterString ) + , std::u16string_view rDragMethodServiceName + , std::u16string_view rDragParameterString ) { ObjectType eObjectType( ObjectIdentifier::getObjectType( rChildParticle ) ); if( eObjectType == OBJECTTYPE_UNKNOWN ) @@ -651,18 +651,18 @@ OUString ObjectIdentifier::createParticleForLegend( OUString ObjectIdentifier::createClassifiedIdentifier( enum ObjectType eObjectType //e.g. OBJECTTYPE_DATA_SERIES - , const OUString& rParticleID )//e.g. SeriesID + , std::u16string_view rParticleID )//e.g. SeriesID { return createClassifiedIdentifierWithParent( - eObjectType, rParticleID, OUString() ); + eObjectType, rParticleID, u"" ); } OUString ObjectIdentifier::createClassifiedIdentifierWithParent( enum ObjectType eObjectType //e.g. OBJECTTYPE_DATA_POINT or OBJECTTYPE_GRID - , const OUString& rParticleID //e.g. Point Index or SubGrid Index - , const OUString& rParentPartical //e.g. "Series=SeriesID" or "Grid=GridId" - , const OUString& rDragMethodServiceName - , const OUString& rDragParameterString + , std::u16string_view rParticleID //e.g. Point Index or SubGrid Index + , std::u16string_view rParentPartical //e.g. "Series=SeriesID" or "Grid=GridId" + , std::u16string_view rDragMethodServiceName + , std::u16string_view rDragParameterString ) //, bool bIsMultiClickObject ) //e.g. true { @@ -673,7 +673,7 @@ OUString ObjectIdentifier::createClassifiedIdentifierWithParent( if(aRet.getLength() > static_cast<sal_Int32>(strlen(m_aProtocol))) aRet.append("/"); aRet.append(rParentPartical); - if(!rParentPartical.isEmpty()) + if(!rParentPartical.empty()) aRet.append(":"); aRet.append(getStringForType( eObjectType )); @@ -1066,7 +1066,7 @@ ObjectType ObjectIdentifier::getObjectType() const } OUString ObjectIdentifier::createDataCurveCID( - const OUString& rSeriesParticle + std::u16string_view rSeriesParticle , sal_Int32 nCurveIndex , bool bAverageLine ) { @@ -1076,20 +1076,20 @@ OUString ObjectIdentifier::createDataCurveCID( } OUString ObjectIdentifier::createDataCurveEquationCID( - const OUString& rSeriesParticle + std::u16string_view rSeriesParticle , sal_Int32 nCurveIndex ) { OUString aParticleID( OUString::number( nCurveIndex ) ); return createClassifiedIdentifierWithParent( OBJECTTYPE_DATA_CURVE_EQUATION, aParticleID, rSeriesParticle ); } -OUString ObjectIdentifier::addChildParticle( const OUString& rParticle, const OUString& rChildParticle ) +OUString ObjectIdentifier::addChildParticle( const OUString& rParticle, std::u16string_view rChildParticle ) { OUStringBuffer aRet(rParticle); - if( !aRet.isEmpty() && !rChildParticle.isEmpty() ) + if( !aRet.isEmpty() && !rChildParticle.empty() ) aRet.append(":"); - if( !rChildParticle.isEmpty() ) + if( !rChildParticle.empty() ) aRet.append(rChildParticle); return aRet.makeStringAndClear(); @@ -1114,8 +1114,8 @@ sal_Int32 ObjectIdentifier::getIndexFromParticleOrCID( const OUString& rParticle OUString ObjectIdentifier::createSeriesSubObjectStub( ObjectType eSubObjectType , const OUString& rSeriesParticle - , const OUString& rDragMethodServiceName - , const OUString& rDragParameterString ) + , std::u16string_view rDragMethodServiceName + , std::u16string_view rDragParameterString ) { OUString aChildParticle = getStringForType( eSubObjectType ) + "="; diff --git a/chart2/source/view/charttypes/CandleStickChart.cxx b/chart2/source/view/charttypes/CandleStickChart.cxx index 9c89d5450bb4..3294e3d04fd4 100644 --- a/chart2/source/view/charttypes/CandleStickChart.cxx +++ b/chart2/source/view/charttypes/CandleStickChart.cxx @@ -90,10 +90,10 @@ void CandleStickChart::createShapes() createGroupShape( m_xLogicTarget )); uno::Reference< drawing::XShapes > xLossTarget( createGroupShape( m_xLogicTarget, ObjectIdentifier::createClassifiedIdentifier( - OBJECTTYPE_DATA_STOCK_LOSS, OUString() ))); + OBJECTTYPE_DATA_STOCK_LOSS, u"" ))); uno::Reference< drawing::XShapes > xGainTarget( createGroupShape( m_xLogicTarget, ObjectIdentifier::createClassifiedIdentifier( - OBJECTTYPE_DATA_STOCK_GAIN, OUString() ))); + OBJECTTYPE_DATA_STOCK_GAIN, u"" ))); uno::Reference< drawing::XShapes > xTextTarget( m_pShapeFactory->createGroup2D( m_xFinalTarget )); diff --git a/chart2/source/view/diagram/VDiagram.cxx b/chart2/source/view/diagram/VDiagram.cxx index c89981bea282..670dfab90424 100644 --- a/chart2/source/view/diagram/VDiagram.cxx +++ b/chart2/source/view/diagram/VDiagram.cxx @@ -183,7 +183,7 @@ void VDiagram::createShapes_2d() else { //CID for selection handling - OUString aWallCID( ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_DIAGRAM_WALL, OUString() ) );//@todo read CID from model + OUString aWallCID( ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_DIAGRAM_WALL, u"" ) );//@todo read CID from model xProp->setPropertyValue( UNO_NAME_MISC_OBJ_NAME, uno::Any( aWallCID ) ); } } @@ -480,7 +480,7 @@ void VDiagram::createShapes_3d() if( m_xDiagram.is() ) xWallProp.set( m_xDiagram->getWall() ); - OUString aWallCID( ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_DIAGRAM_WALL, OUString() ) );//@todo read CID from model + OUString aWallCID( ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_DIAGRAM_WALL, u"" ) );//@todo read CID from model if( !bAddFloorAndWall ) aWallCID.clear(); uno::Reference< drawing::XShapes > xWallGroup_Shapes( m_pShapeFactory->createGroup3D( xOuterGroup_Shapes, aWallCID ) ); @@ -622,7 +622,7 @@ void VDiagram::createShapes_3d() } else { - OUString aFloorCID( ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_DIAGRAM_FLOOR, OUString() ) );//@todo read CID from model + OUString aFloorCID( ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_DIAGRAM_FLOOR, u"" ) );//@todo read CID from model ShapeFactory::setShapeName( xShape, aFloorCID ); } } diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx index 56a64d349e6f..e449680daf4c 100644 --- a/chart2/source/view/main/ChartView.cxx +++ b/chart2/source/view/main/ChartView.cxx @@ -2358,7 +2358,7 @@ void formatPage( tPropertyNameValueMap aNameValueMap; PropertyMapper::getValueMap( aNameValueMap, PropertyMapper::getPropertyNameMapForFillAndLineProperties(), xModelPage ); - OUString aCID( ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_PAGE, OUString() ) ); + OUString aCID( ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_PAGE, u"" ) ); aNameValueMap.emplace( "Name", uno::Any( aCID ) ); //CID OUString tNameSequence aNames; diff --git a/chart2/source/view/main/VDataSeries.cxx b/chart2/source/view/main/VDataSeries.cxx index d3c4dcd857e8..35606be26fa0 100644 --- a/chart2/source/view/main/VDataSeries.cxx +++ b/chart2/source/view/main/VDataSeries.cxx @@ -353,7 +353,7 @@ void VDataSeries::setParticle( const OUString& rSeriesParticle ) m_aPointCID_Stub = ObjectIdentifier::createSeriesSubObjectStub( OBJECTTYPE_DATA_POINT, m_aSeriesParticle ); m_aLabelCID_Stub = ObjectIdentifier::createClassifiedIdentifierWithParent( - OBJECTTYPE_DATA_LABEL, OUString(), getLabelsCID() ); + OBJECTTYPE_DATA_LABEL, u"", getLabelsCID() ); } OUString VDataSeries::getErrorBarsCID(bool bYError) const { diff --git a/codemaker/source/commonjava/commonjava.cxx b/codemaker/source/commonjava/commonjava.cxx index 0d01bee54048..6782789ae337 100644 --- a/codemaker/source/commonjava/commonjava.cxx +++ b/codemaker/source/commonjava/commonjava.cxx @@ -37,7 +37,7 @@ namespace codemaker::java { OString translateUnoToJavaType( - codemaker::UnoType::Sort sort, OString const & nucleus, bool referenceType) + codemaker::UnoType::Sort sort, std::string_view nucleus, bool referenceType) { OStringBuffer buf(128); if (sort <= codemaker::UnoType::Sort::Any) { diff --git a/codemaker/source/javamaker/javatype.cxx b/codemaker/source/javamaker/javatype.cxx index 25406d07234c..c7c84a208b3a 100644 --- a/codemaker/source/javamaker/javatype.cxx +++ b/codemaker/source/javamaker/javatype.cxx @@ -54,7 +54,7 @@ using codemaker::javamaker::ClassFile; namespace { void appendUnoName( - rtl::Reference< TypeManager > const & manager, OUString const & nucleus, + rtl::Reference< TypeManager > const & manager, std::u16string_view nucleus, sal_Int32 rank, std::vector< OUString > const & arguments, OUStringBuffer * buffer) { @@ -88,7 +88,7 @@ void appendUnoName( // polymorphic struct type template, or interface type, decomposed into nucleus, // sequence rank, and template arguments) into a core UNO type name: OUString createUnoName( - rtl::Reference< TypeManager > const & manager, OUString const & nucleus, + rtl::Reference< TypeManager > const & manager, std::u16string_view nucleus, sal_Int32 rank, std::vector< OUString > const & arguments) { OUStringBuffer buf(256); diff --git a/comphelper/source/misc/string.cxx b/comphelper/source/misc/string.cxx index 8ab965406fcb..32b365c09022 100644 --- a/comphelper/source/misc/string.cxx +++ b/comphelper/source/misc/string.cxx @@ -286,7 +286,7 @@ uno::Sequence< OUString > return comphelper::containerToSequence(vec); } -OString join(const OString& rSeparator, const std::vector<OString>& rSequence) +OString join(std::string_view rSeparator, const std::vector<OString>& rSequence) { OStringBuffer aBuffer; for (size_t i = 0; i < rSequence.size(); ++i) diff --git a/compilerplugins/clang/stringviewparam.cxx b/compilerplugins/clang/stringviewparam.cxx index 86ee7c21b393..9182bf449bbe 100644 --- a/compilerplugins/clang/stringviewparam.cxx +++ b/compilerplugins/clang/stringviewparam.cxx @@ -65,6 +65,23 @@ StringType relevantStringType(QualType type) } } +bool isRelevantStringBufferType(QualType type) +{ + loplugin::TypeCheck const c(type); + if (c.Class("OStringBuffer").Namespace("rtl")) + { + return true; + } + else if (c.Class("OUStringBuffer").Namespace("rtl")) + { + return true; + } + else + { + return false; + } +} + bool relevantParmVarDecl(ParmVarDecl const* decl) { auto const t1 = decl->getType(); @@ -122,13 +139,28 @@ DeclRefExpr const* relevantImplicitCastExpr(ImplicitCastExpr const* expr) DeclRefExpr const* relevantCXXMemberCallExpr(CXXMemberCallExpr const* expr) { + auto const d = expr->getMethodDecl(); + if (isRelevantStringBufferType(compat::getObjectType(expr))) + { + if (auto const i = d->getIdentifier()) + { + auto const n = i->getName(); + if (n == "append" || n == "indexOf" || n == "lastIndexOf") + { + return relevantDeclRefExpr(expr->getArg(0)); + } + else if (n == "insert") + { + return relevantDeclRefExpr(expr->getArg(1)); + } + } + } StringType t = relevantStringType(compat::getObjectType(expr)); if (t == StringType::None) { return nullptr; } bool good = false; - auto const d = expr->getMethodDecl(); if (d->getOverloadedOperator() == OO_Subscript) { good = true; diff --git a/compilerplugins/clang/test/stringviewparam.cxx b/compilerplugins/clang/test/stringviewparam.cxx index 24dab18e0f9c..a9fcab3ac3a0 100644 --- a/compilerplugins/clang/test/stringviewparam.cxx +++ b/compilerplugins/clang/test/stringviewparam.cxx @@ -13,6 +13,7 @@ #include "rtl/string.hxx" #include "rtl/ustring.hxx" +#include "rtl/ustrbuf.hxx" #include "sal/types.h" void f1a(std::string_view); @@ -83,4 +84,11 @@ struct S10 } }; +// expected-error@+1 {{replace function parameter of type 'const rtl::OUString &' with 'std::u16string_view' [loplugin:stringviewparam]}} +void f11(const OUString& f11rString) +{ + OUStringBuffer buf; + buf.append(f11rString); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx index 0308a0361761..619629f95c79 100644 --- a/configmgr/source/access.cxx +++ b/configmgr/source/access.cxx @@ -1797,7 +1797,7 @@ void Access::initBroadcasterAndChanges( if (!path.isEmpty()) { path.append('/'); } - path.append(Data::createSegment("*", i.first)); + path.append(Data::createSegment(u"*", i.first)); allChanges->push_back( css::util::ElementChange( css::uno::Any(path.makeStringAndClear()), @@ -1884,7 +1884,7 @@ void Access::initBroadcasterAndChanges( if (!path.isEmpty()) { path.append('/'); } - path.append(Data::createSegment("*", i.first)); + path.append(Data::createSegment(u"*", i.first)); allChanges->push_back( css::util::ElementChange( css::uno::Any(path.makeStringAndClear()), diff --git a/configmgr/source/data.cxx b/configmgr/source/data.cxx index 4f91d3b25612..6e95f1665726 100644 --- a/configmgr/source/data.cxx +++ b/configmgr/source/data.cxx @@ -77,9 +77,9 @@ bool decode( } OUString Data::createSegment( - OUString const & templateName, OUString const & name) + std::u16string_view templateName, OUString const & name) { - if (templateName.isEmpty()) { + if (templateName.empty()) { return name; } OUStringBuffer buf(128); diff --git a/configmgr/source/data.hxx b/configmgr/source/data.hxx index 58763cd0d58c..9e1da0829679 100644 --- a/configmgr/source/data.hxx +++ b/configmgr/source/data.hxx @@ -51,7 +51,7 @@ struct Data { Modifications modifications; static OUString createSegment( - OUString const & templateName, OUString const & name); + std::u16string_view templateName, OUString const & name); static sal_Int32 parseSegment( OUString const & path, sal_Int32 index, OUString * name, diff --git a/connectivity/source/commontools/dbtools.cxx b/connectivity/source/commontools/dbtools.cxx index cd9f2c9fc48f..31e54c1b0606 100644 --- a/connectivity/source/commontools/dbtools.cxx +++ b/connectivity/source/commontools/dbtools.cxx @@ -1908,7 +1908,7 @@ void setObjectWithInfo(const Reference<XParameters>& _xParams, } } -void getBooleanComparisonPredicate( const OUString& _rExpression, const bool _bValue, const sal_Int32 _nBooleanComparisonMode, +void getBooleanComparisonPredicate( std::u16string_view _rExpression, const bool _bValue, const sal_Int32 _nBooleanComparisonMode, OUStringBuffer& _out_rSQLPredicate ) { switch ( _nBooleanComparisonMode ) diff --git a/connectivity/source/commontools/filtermanager.cxx b/connectivity/source/commontools/filtermanager.cxx index a6180dd00666..ee39aa87830e 100644 --- a/connectivity/source/commontools/filtermanager.cxx +++ b/connectivity/source/commontools/filtermanager.cxx @@ -152,7 +152,7 @@ namespace dbtools } - void FilterManager::appendFilterComponent( OUStringBuffer& io_appendTo, const OUString& i_component ) + void FilterManager::appendFilterComponent( OUStringBuffer& io_appendTo, std::u16string_view i_component ) { if ( !io_appendTo.isEmpty() ) { diff --git a/connectivity/source/drivers/firebird/Blob.cxx b/connectivity/source/drivers/firebird/Blob.cxx index 8ed9fc4a8ac7..9cbc0a1b6d03 100644 --- a/connectivity/source/drivers/firebird/Blob.cxx +++ b/connectivity/source/drivers/firebird/Blob.cxx @@ -67,7 +67,7 @@ void Blob::ensureBlobIsOpened() nullptr); if (aErr) - evaluateStatusVector(m_statusVector, "isc_open_blob2", *this); + evaluateStatusVector(m_statusVector, u"isc_open_blob2", *this); m_bBlobOpened = true; m_nBlobPosition = 0; @@ -90,7 +90,7 @@ void Blob::ensureBlobIsOpened() aResultBuffer); if (aErr) - evaluateStatusVector(m_statusVector, "isc_blob_info", *this); + evaluateStatusVector(m_statusVector, u"isc_blob_info", *this); char* pIt = aResultBuffer; while( *pIt != isc_info_end ) // info is in clusters @@ -141,7 +141,7 @@ bool Blob::readOneSegment(uno::Sequence< sal_Int8 >& rDataOut) if (aRet && aRet != isc_segstr_eof && IndicatesError(m_statusVector)) { - OUString sError(StatusVectorToString(m_statusVector, "isc_get_segment")); + OUString sError(StatusVectorToString(m_statusVector, u"isc_get_segment")); throw IOException(sError, *this); } m_nBlobPosition += nActualSize; @@ -160,7 +160,7 @@ void Blob::closeBlob() aErr = isc_close_blob(m_statusVector, &m_blobHandle); if (aErr) - evaluateStatusVector(m_statusVector, "isc_close_blob", *this); + evaluateStatusVector(m_statusVector, u"isc_close_blob", *this); m_bBlobOpened = false; #if SAL_TYPES_SIZEOFPOINTER == 8 @@ -299,7 +299,7 @@ sal_Int32 SAL_CALL Blob::readBytes(uno::Sequence< sal_Int8 >& rDataOut, reinterpret_cast<char*>(rDataOut.getArray()) + nTotalBytesRead); if (aErr && IndicatesError(m_statusVector)) { - OUString sError(StatusVectorToString(m_statusVector, "isc_get_segment")); + OUString sError(StatusVectorToString(m_statusVector, u"isc_get_segment")); throw IOException(sError, *this); } nTotalBytesRead += nBytesRead; diff --git a/connectivity/source/drivers/firebird/Connection.cxx b/connectivity/source/drivers/firebird/Connection.cxx index 05c24e9f73be..6ec8940cd8a4 100644 --- a/connectivity/source/drivers/firebird/Connection.cxx +++ b/connectivity/source/drivers/firebird/Connection.cxx @@ -274,7 +274,7 @@ void Connection::construct(const OUString& url, const Sequence< PropertyValue >& 0); if (aErr) { - evaluateStatusVector(status, "isc_create_database", *this); + evaluateStatusVector(status, u"isc_create_database", *this); } } else @@ -292,7 +292,7 @@ void Connection::construct(const OUString& url, const Sequence< PropertyValue >& dpbBuffer.c_str()); if (aErr) { - evaluateStatusVector(status, "isc_attach_database", *this); + evaluateStatusVector(status, u"isc_attach_database", *this); } } @@ -490,7 +490,7 @@ void Connection::setupTransaction() aTPB); evaluateStatusVector(status_vector, - "isc_start_transaction", + u"isc_start_transaction", *this); } @@ -516,7 +516,7 @@ void SAL_CALL Connection::commit() disposeStatements(); isc_commit_transaction(status_vector, &m_aTransactionHandle); evaluateStatusVector(status_vector, - "isc_commit_transaction", + u"isc_commit_transaction", *this); } } @@ -569,7 +569,7 @@ isc_svc_handle Connection::attachServiceManager() aSPBBuffer)) { evaluateStatusVector(aStatusVector, - "isc_service_attach", + u"isc_service_attach", *this); } @@ -583,7 +583,7 @@ void Connection::detachServiceManager(isc_svc_handle aServiceHandle) &aServiceHandle)) { evaluateStatusVector(aStatusVector, - "isc_service_detach", + u"isc_service_detach", *this); } } @@ -642,7 +642,7 @@ void Connection::runBackupService(const short nAction) aRequest.getLength(), aRequest.getStr())) { - evaluateStatusVector(aStatusVector, "isc_service_start", *this); + evaluateStatusVector(aStatusVector, u"isc_service_start", *this); } char aInfoSPB = isc_info_svc_line; @@ -658,7 +658,7 @@ void Connection::runBackupService(const short nAction) sizeof(aResults), aResults)) { - evaluateStatusVector(aStatusVector, "isc_service_query", *this); + evaluateStatusVector(aStatusVector, u"isc_service_query", *this); } detachServiceManager(aServiceHandle); @@ -911,7 +911,7 @@ void Connection::disposing() { if (isc_detach_database(status, &m_aDBHandle)) { - evaluateStatusVector(status, "isc_detach_database", *this); + evaluateStatusVector(status, u"isc_detach_database", *this); } } // TODO: write to storage again? diff --git a/connectivity/source/drivers/firebird/PreparedStatement.cxx b/connectivity/source/drivers/firebird/PreparedStatement.cxx index 56fa1827bdad..3f7859d1dba7 100644 --- a/connectivity/source/drivers/firebird/PreparedStatement.cxx +++ b/connectivity/source/drivers/firebird/PreparedStatement.cxx @@ -307,7 +307,7 @@ sal_Bool SAL_CALL OPreparedStatement::execute() // Do not throw error. Trying to close a closed cursor is not a // critical mistake. OUString sErrMsg = StatusVectorToString(m_statusVector, - "isc_dsql_free_statement: close cursor"); + u"isc_dsql_free_statement: close cursor"); SAL_WARN("connectivity.firebird", sErrMsg); } } @@ -320,7 +320,7 @@ sal_Bool SAL_CALL OPreparedStatement::execute() if (aErr) { SAL_WARN("connectivity.firebird", "isc_dsql_execute failed" ); - evaluateStatusVector(m_statusVector, "isc_dsql_execute", *this); + evaluateStatusVector(m_statusVector, u"isc_dsql_execute", *this); } m_xResultSet = new OResultSet(m_pConnection.get(), @@ -565,7 +565,7 @@ void OPreparedStatement::openBlobForWriting(isc_blob_handle& rBlobHandle, ISC_QU if (aErr) { evaluateStatusVector(m_statusVector, - "setBlob failed on " + m_sSqlStatement, + OUString("setBlob failed on " + m_sSqlStatement), *this); assert(false); } @@ -580,7 +580,7 @@ void OPreparedStatement::closeBlobAfterWriting(isc_blob_handle& rBlobHandle) if (aErr) { evaluateStatusVector(m_statusVector, - "isc_close_blob failed", + u"isc_close_blob failed", *this); assert(false); } @@ -632,7 +632,7 @@ void SAL_CALL OPreparedStatement::setClob(sal_Int32 nParameterIndex, const Refer if (aErr) { evaluateStatusVector(m_statusVector, - "isc_put_segment failed", + u"isc_put_segment failed", *this); assert(false); } @@ -670,7 +670,7 @@ void OPreparedStatement::setClob( sal_Int32 nParameterIndex, const OUString& rSt if (aErr) { evaluateStatusVector(m_statusVector, - "isc_put_segment failed", + u"isc_put_segment failed", *this); assert(false); } @@ -722,7 +722,7 @@ void SAL_CALL OPreparedStatement::setBlob(sal_Int32 nParameterIndex, if (aErr) { evaluateStatusVector(m_statusVector, - "isc_put_segment failed", + u"isc_put_segment failed", *this); assert(false); } @@ -890,7 +890,7 @@ void SAL_CALL OPreparedStatement::setBytes(sal_Int32 nParameterIndex, if (aErr) { evaluateStatusVector(m_statusVector, - "isc_put_segment failed", + u"isc_put_segment failed", *this); assert(false); } diff --git a/connectivity/source/drivers/firebird/ResultSet.cxx b/connectivity/source/drivers/firebird/ResultSet.cxx index 7ae77c607e0d..975d5c13ce97 100644 --- a/connectivity/source/drivers/firebird/ResultSet.cxx +++ b/connectivity/source/drivers/firebird/ResultSet.cxx @@ -144,7 +144,7 @@ sal_Bool SAL_CALL OResultSet::next() { SAL_WARN("connectivity.firebird", "Error when fetching data"); // Throws sql exception as appropriate - evaluateStatusVector(m_statusVector, "isc_dsql_fetch", *this); + evaluateStatusVector(m_statusVector, u"isc_dsql_fetch", *this); return false; } } diff --git a/connectivity/source/drivers/firebird/StatementCommonBase.cxx b/connectivity/source/drivers/firebird/StatementCommonBase.cxx index 1d7d5ef32bdf..3f44dcd3587b 100644 --- a/connectivity/source/drivers/firebird/StatementCommonBase.cxx +++ b/connectivity/source/drivers/firebird/StatementCommonBase.cxx @@ -78,7 +78,7 @@ void OStatementCommonBase::freeStatementHandle() &m_aStatementHandle, DSQL_drop); evaluateStatusVector(m_statusVector, - "isc_dsql_free_statement", + u"isc_dsql_free_statement", *this); } } @@ -146,7 +146,7 @@ void OStatementCommonBase::prepareAndDescribeStatement(std::u16string_view sql, if (aErr) { evaluateStatusVector(m_statusVector, - "isc_dsql_allocate_statement", + u"isc_dsql_allocate_statement", *this); } else @@ -162,7 +162,7 @@ void OStatementCommonBase::prepareAndDescribeStatement(std::u16string_view sql, if (aErr) { evaluateStatusVector(m_statusVector, - "isc_dsql_prepare", + u"isc_dsql_prepare", *this); } else @@ -176,7 +176,7 @@ void OStatementCommonBase::prepareAndDescribeStatement(std::u16string_view sql, { // TODO: free statement handle, etc.? evaluateStatusVector(m_statusVector, - "isc_dsql_describe", + u"isc_dsql_describe", *this); } else @@ -199,7 +199,7 @@ void OStatementCommonBase::prepareAndDescribeStatement(std::u16string_view sql, if (aErr) { evaluateStatusVector(m_statusVector, - "isc_dsql_describe", + u"isc_dsql_describe", *this); } else @@ -379,7 +379,7 @@ short OStatementCommonBase::getSqlInfoItem(char aInfoItem) } evaluateStatusVector(aStatusVector, - "isc_dsq_sql_info", + u"isc_dsq_sql_info", *this); return 0; } @@ -411,7 +411,7 @@ sal_Int32 OStatementCommonBase::getStatementChangeCount() if (aErr) { evaluateStatusVector(aStatusVector, - "isc_dsq_sql_info", + u"isc_dsq_sql_info", *this); return 0; } diff --git a/connectivity/source/drivers/firebird/Util.cxx b/connectivity/source/drivers/firebird/Util.cxx index 82d69a123c97..3bf3cfbc4d82 100644 --- a/connectivity/source/drivers/firebird/Util.cxx +++ b/connectivity/source/drivers/firebird/Util.cxx @@ -31,7 +31,7 @@ OUString firebird::sanitizeIdentifier(const OUString& rIdentifier) } OUString firebird::StatusVectorToString(const ISC_STATUS_ARRAY& rStatusVector, - const OUString& rCause) + std::u16string_view rCause) { OUStringBuffer buf; const ISC_STATUS* pStatus = reinterpret_cast<const ISC_STATUS*>(&rStatusVector); @@ -59,7 +59,7 @@ OUString firebird::StatusVectorToString(const ISC_STATUS_ARRAY& rStatusVector, } void firebird::evaluateStatusVector(const ISC_STATUS_ARRAY& rStatusVector, - const OUString& rCause, + std::u16string_view rCause, const uno::Reference< XInterface >& _rxContext) { if (IndicatesError(rStatusVector)) diff --git a/connectivity/source/drivers/firebird/Util.hxx b/connectivity/source/drivers/firebird/Util.hxx index efb222f3ff22..0724410165a2 100644 --- a/connectivity/source/drivers/firebird/Util.hxx +++ b/connectivity/source/drivers/firebird/Util.hxx @@ -95,7 +95,7 @@ public: } OUString StatusVectorToString(const ISC_STATUS_ARRAY& rStatusVector, - const OUString& rCause); + std::u16string_view rCause); /** * Evaluate a firebird status vector and throw exceptions as necessary. @@ -104,7 +104,7 @@ public: * @throws css::sdbc::SQLException */ void evaluateStatusVector(const ISC_STATUS_ARRAY& rStatusVector, - const OUString& aCause, + std::u16string_view aCause, const css::uno::Reference< css::uno::XInterface >& _rxContext); /** diff --git a/connectivity/source/drivers/hsqldb/HTools.cxx b/connectivity/source/drivers/hsqldb/HTools.cxx index b9854c01ce67..3dd388aceecb 100644 --- a/connectivity/source/drivers/hsqldb/HTools.cxx +++ b/connectivity/source/drivers/hsqldb/HTools.cxx @@ -23,18 +23,18 @@ namespace connectivity::hsqldb { - void HTools::appendTableFilterCrit( OUStringBuffer& _inout_rBuffer, const OUString& _rCatalog, - const OUString& _rSchema, const OUString& _rName, bool _bShortForm ) + void HTools::appendTableFilterCrit( OUStringBuffer& _inout_rBuffer, std::u16string_view _rCatalog, + std::u16string_view _rSchema, std::u16string_view _rName, bool _bShortForm ) { _inout_rBuffer.append( " WHERE " ); - if ( !_rCatalog.isEmpty() ) + if ( !_rCatalog.empty() ) { _inout_rBuffer.appendAscii( _bShortForm ? "TABLE_CAT" : "TABLE_CATALOG" ); _inout_rBuffer.append( " = '" ); _inout_rBuffer.append ( _rCatalog ); _inout_rBuffer.append( "' AND " ); } - if ( !_rSchema.isEmpty() ) + if ( !_rSchema.empty() ) { _inout_rBuffer.appendAscii( _bShortForm ? "TABLE_SCHEM" : "TABLE_SCHEMA" ); _inout_rBuffer.append( " = '" ); diff --git a/connectivity/source/inc/hsqldb/HTools.hxx b/connectivity/source/inc/hsqldb/HTools.hxx index be30e8e281ee..4e7e542141e0 100644 --- a/connectivity/source/inc/hsqldb/HTools.hxx +++ b/connectivity/source/inc/hsqldb/HTools.hxx @@ -37,8 +37,8 @@ namespace connectivity::hsqldb have the short form (TABLE_CAT instead of TABLE_CATALOG, and so on) */ static void appendTableFilterCrit( - OUStringBuffer& _inout_rBuffer, const OUString& _rCatalog, - const OUString& _rSchema, const OUString& _rName, + OUStringBuffer& _inout_rBuffer, std::u16string_view _rCatalog, + std::u16string_view _rSchema, std::u16string_view _rName, bool _bShortForm ); }; diff --git a/cppu/source/uno/lbmap.cxx b/cppu/source/uno/lbmap.cxx index 1e8655a99b58..685bf6d4a2a8 100644 --- a/cppu/source/uno/lbmap.cxx +++ b/cppu/source/uno/lbmap.cxx @@ -282,7 +282,7 @@ uno_Mediate_Mapping::uno_Mediate_Mapping( static OUString getMappingName( - const Environment & rFrom, const Environment & rTo, const OUString & rAddPurpose ) + const Environment & rFrom, const Environment & rTo, std::u16string_view rAddPurpose ) { OUStringBuffer aKey( 64 ); aKey.append( rAddPurpose ); @@ -299,10 +299,10 @@ static OUString getMappingName( } static OUString getBridgeName( - const Environment & rFrom, const Environment & rTo, const OUString & rAddPurpose ) + const Environment & rFrom, const Environment & rTo, std::u16string_view rAddPurpose ) { OUStringBuffer aBridgeName( 16 ); - if (!rAddPurpose.isEmpty()) + if (!rAddPurpose.empty()) { aBridgeName.append( rAddPurpose ); aBridgeName.append( '_' ); diff --git a/dbaccess/qa/unit/embeddeddb_performancetest.cxx b/dbaccess/qa/unit/embeddeddb_performancetest.cxx index e4119804d3b1..ec23226d4016 100644 --- a/dbaccess/qa/unit/embeddeddb_performancetest.cxx +++ b/dbaccess/qa/unit/embeddeddb_performancetest.cxx @@ -92,7 +92,7 @@ private: void printTimes(const TimeValue* pTime1, const TimeValue* pTime2, const TimeValue* pTime3); void doPerformanceTestOnODB(const OUString& rDriverURL, - const OUString& rDBName, + std::u16string_view rDBName, const bool bUsePreparedStatement); void setupTestTable(uno::Reference< XConnection > const & xConnection); @@ -102,13 +102,13 @@ private: // Individual Tests void performPreparedStatementInsertTest( uno::Reference< XConnection > const & xConnection, - const OUString& rDBName); + std::u16string_view rDBName); void performStatementInsertTest( uno::Reference< XConnection > const & xConnection, - const OUString& rDBName); + std::u16string_view rDBName); void performReadTest( uno::Reference< XConnection > const & xConnection, - const OUString& rDBName); + std::u16string_view rDBName); // Perform all tests on a given DB. void testFirebird(); @@ -173,17 +173,17 @@ void EmbeddedDBPerformanceTest::testFirebird() { m_aOutputBuffer.append("Standard Insert\n"); - doPerformanceTestOnODB("sdbc:embedded:firebird", "Firebird", false); + doPerformanceTestOnODB("sdbc:embedded:firebird", u"Firebird", false); m_aOutputBuffer.append("PreparedStatement Insert\n"); - doPerformanceTestOnODB("sdbc:embedded:firebird", "Firebird", true); + doPerformanceTestOnODB("sdbc:embedded:firebird", u"Firebird", true); } void EmbeddedDBPerformanceTest::testHSQLDB() { m_aOutputBuffer.append("Standard Insert\n"); - doPerformanceTestOnODB("sdbc:embedded:hsqldb", "HSQLDB", false); + doPerformanceTestOnODB("sdbc:embedded:hsqldb", u"HSQLDB", false); m_aOutputBuffer.append("PreparedStatement Insert\n"); - doPerformanceTestOnODB("sdbc:embedded:hsqldb", "HSQLDB", true); + doPerformanceTestOnODB("sdbc:embedded:hsqldb", u"HSQLDB", true); } /** @@ -192,7 +192,7 @@ void EmbeddedDBPerformanceTest::testHSQLDB() */ void EmbeddedDBPerformanceTest::doPerformanceTestOnODB( const OUString& rDriverURL, - const OUString& rDBName, + std::u16string_view rDBName, const bool bUsePreparedStatement) { ::utl::TempFile aFile; @@ -244,7 +244,7 @@ void EmbeddedDBPerformanceTest::setupTestTable( void EmbeddedDBPerformanceTest::performPreparedStatementInsertTest( uno::Reference< XConnection > const & xConnection, - const OUString& rDBName) + std::u16string_view rDBName) { uno::Reference< XPreparedStatement > xPreparedStatement = xConnection->prepareStatement( @@ -286,7 +286,7 @@ void EmbeddedDBPerformanceTest::performPreparedStatementInsertTest( void EmbeddedDBPerformanceTest::performStatementInsertTest( uno::Reference< XConnection > const & xConnection, - const OUString& rDBName) + std::u16string_view rDBName) { uno::Reference< XStatement > xStatement = xConnection->createStatement(); @@ -324,7 +324,7 @@ void EmbeddedDBPerformanceTest::performStatementInsertTest( void EmbeddedDBPerformanceTest::performReadTest( uno::Reference< XConnection > const & xConnection, - const OUString& rDBName) + std::u16string_view rDBName) { uno::Reference< XStatement > xStatement = xConnection->createStatement(); diff --git a/dbaccess/source/core/api/OptimisticSet.cxx b/dbaccess/source/core/api/OptimisticSet.cxx index 7db4ca08740b..ee05bd49d968 100644 --- a/dbaccess/source/core/api/OptimisticSet.cxx +++ b/dbaccess/source/core/api/OptimisticSet.cxx @@ -56,7 +56,7 @@ using namespace ::osl; typedef std::map<OUString, OUStringBuffer> TSQLStatements; namespace { - void lcl_fillKeyCondition(const OUString& i_sTableName,const OUString& i_sQuotedColumnName,const ORowSetValue& i_aValue,TSQLStatements& io_aKeyConditions) + void lcl_fillKeyCondition(const OUString& i_sTableName,std::u16string_view i_sQuotedColumnName,const ORowSetValue& i_aValue,TSQLStatements& io_aKeyConditions) { OUStringBuffer& rKeyCondition = io_aKeyConditions[i_sTableName]; if ( !rKeyCondition.isEmpty() ) diff --git a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx index f3f401b3cb99..6439941912dc 100644 --- a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx +++ b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx @@ -169,7 +169,7 @@ namespace delete pSqlParseNode; _rIterator.dispose(); } - void lcl_addFilterCriteria_throw(sal_Int32 i_nFilterOperator,const OUString& i_sValue,OUStringBuffer& o_sRet) + void lcl_addFilterCriteria_throw(sal_Int32 i_nFilterOperator,std::u16string_view i_sValue,OUStringBuffer& o_sRet) { switch( i_nFilterOperator ) { @@ -1647,7 +1647,7 @@ void OSingleSelectQueryComposer::setConditionByColumn( const Reference< XPropert if ( nType != DataType::BOOLEAN && DataType::BIT != nType ) { - lcl_addFilterCriteria_throw(filterOperator,"",aSQL); + lcl_addFilterCriteria_throw(filterOperator,u"",aSQL); } switch(nType) @@ -1716,7 +1716,7 @@ void OSingleSelectQueryComposer::setConditionByColumn( const Reference< XPropert sal_Int32 nFilterOp = filterOperator; if ( filterOperator != SQLFilterOperator::SQLNULL && filterOperator != SQLFilterOperator::NOT_SQLNULL ) nFilterOp = SQLFilterOperator::SQLNULL; - lcl_addFilterCriteria_throw(nFilterOp,"",aSQL); + lcl_addFilterCriteria_throw(nFilterOp,u"",aSQL); } // Attach filter diff --git a/dbaccess/source/core/recovery/settingsimport.cxx b/dbaccess/source/core/recovery/settingsimport.cxx index b64787aa82a4..2353202681c4 100644 --- a/dbaccess/source/core/recovery/settingsimport.cxx +++ b/dbaccess/source/core/recovery/settingsimport.cxx @@ -54,7 +54,7 @@ namespace dbaccess { } - void SettingsImport::characters( const OUString& i_rCharacters ) + void SettingsImport::characters( std::u16string_view i_rCharacters ) { m_aCharacters.append( i_rCharacters ); } diff --git a/dbaccess/source/core/recovery/settingsimport.hxx b/dbaccess/source/core/recovery/settingsimport.hxx index 38bce0228e29..bc29bd727b8f 100644 --- a/dbaccess/source/core/recovery/settingsimport.hxx +++ b/dbaccess/source/core/recovery/settingsimport.hxx @@ -48,7 +48,7 @@ namespace dbaccess const css::uno::Reference< css::xml::sax::XAttributeList >& i_rAttributes ); virtual void endElement(); - void characters( const OUString& i_rCharacters ); + void characters( std::u16string_view i_rCharacters ); protected: virtual ~SettingsImport() override; diff --git a/dbaccess/source/filter/hsqldb/fbcreateparser.cxx b/dbaccess/source/filter/hsqldb/fbcreateparser.cxx index 4f8fb8667d1e..8ee1196a1618 100644 --- a/dbaccess/source/filter/hsqldb/fbcreateparser.cxx +++ b/dbaccess/source/filter/hsqldb/fbcreateparser.cxx @@ -29,7 +29,7 @@ using namespace css::sdbc; namespace { -void lcl_appendWithSpace(OUStringBuffer& sBuff, const OUString& sStr) +void lcl_appendWithSpace(OUStringBuffer& sBuff, std::u16string_view sStr) { sBuff.append(" "); sBuff.append(sStr); @@ -138,7 +138,7 @@ OUString FbCreateStmtParser::compose() const sSql.append("CREATE TABLE "); sSql.append(getTableName()); - lcl_appendWithSpace(sSql, "("); // column declaration + lcl_appendWithSpace(sSql, u"("); // column declaration auto& rColumns = getColumnDef(); auto columnIter = rColumns.cbegin(); while (columnIter != rColumns.end()) @@ -178,7 +178,7 @@ OUString FbCreateStmtParser::compose() const if (columnIter->isAutoIncremental()) { - lcl_appendWithSpace(sSql, "GENERATED BY DEFAULT AS IDENTITY (START WITH "); + lcl_appendWithSpace(sSql, u"GENERATED BY DEFAULT AS IDENTITY (START WITH "); // start with 0: // HSQLDB: first value will be 0. @@ -187,17 +187,17 @@ OUString FbCreateStmtParser::compose() const sSql.append(")"); } else if (!columnIter->isNullable()) - lcl_appendWithSpace(sSql, "NOT NULL"); + lcl_appendWithSpace(sSql, u"NOT NULL"); if (columnIter->isCaseInsensitive()) - lcl_appendWithSpace(sSql, "COLLATE UNICODE_CI"); + lcl_appendWithSpace(sSql, u"COLLATE UNICODE_CI"); const OUString& sDefaultVal = columnIter->getDefault(); if (!sDefaultVal.isEmpty()) { - lcl_appendWithSpace(sSql, "DEFAULT"); + lcl_appendWithSpace(sSql, u"DEFAULT"); if (sDefaultVal.equalsIgnoreAsciiCase("NOW")) - lcl_appendWithSpace(sSql, "\'NOW\'"); // Fb likes it single quoted + lcl_appendWithSpace(sSql, u"\'NOW\'"); // Fb likes it single quoted else lcl_appendWithSpace(sSql, sDefaultVal); } diff --git a/dbaccess/source/filter/hsqldb/hsqlimport.cxx b/dbaccess/source/filter/hsqldb/hsqlimport.cxx index f24ceb6f2ff0..045a32f93ce3 100644 --- a/dbaccess/source/filter/hsqldb/hsqlimport.cxx +++ b/dbaccess/source/filter/hsqldb/hsqlimport.cxx @@ -176,7 +176,7 @@ void lcl_setParams(const std::vector<Any>& row, Reference<XParameters> const& xP } } -OUString lcl_createInsertStatement(const OUString& sTableName, +OUString lcl_createInsertStatement(std::u16string_view sTableName, const std::vector<dbahsql::ColumnDefinition>& rColTypes) { assert(rColTypes.size() > 0); @@ -216,7 +216,8 @@ HsqlImporter::HsqlImporter(Reference<XConnection>& rConnection, const Reference< m_xStorage.set(rStorage); } -void HsqlImporter::insertRow(const std::vector<css::uno::Any>& xRows, const OUString& sTableName, +void HsqlImporter::insertRow(const std::vector<css::uno::Any>& xRows, + std::u16string_view sTableName, const std::vector<ColumnDefinition>& rColTypes) { OUString sStatement = lcl_createInsertStatement(sTableName, rColTypes); diff --git a/dbaccess/source/filter/hsqldb/hsqlimport.hxx b/dbaccess/source/filter/hsqldb/hsqlimport.hxx index f414d327565d..7bab53c24b88 100644 --- a/dbaccess/source/filter/hsqldb/hsqlimport.hxx +++ b/dbaccess/source/filter/hsqldb/hsqlimport.hxx @@ -30,7 +30,7 @@ private: css::uno::Reference<css::embed::XStorage> m_xStorage; protected: - void insertRow(const std::vector<css::uno::Any>& xRows, const OUString& sTable, + void insertRow(const std::vector<css::uno::Any>& xRows, std::u16string_view sTable, const std::vector<ColumnDefinition>& rColTypes); void processTree(HsqlBinaryNode& rNode, HsqlRowInputStream& rStream, const std::vector<ColumnDefinition>& rColTypes, const OUString& sTableName, diff --git a/desktop/source/app/dispatchwatcher.cxx b/desktop/source/app/dispatchwatcher.cxx index 9ab77f399ec4..bde83bcd22d4 100644 --- a/desktop/source/app/dispatchwatcher.cxx +++ b/desktop/source/app/dispatchwatcher.cxx @@ -90,7 +90,7 @@ struct DispatchHolder Reference< XDispatch > xDispatch; }; -std::shared_ptr<const SfxFilter> impl_lookupExportFilterForUrl( std::u16string_view rUrl, const OUString& rFactory ) +std::shared_ptr<const SfxFilter> impl_lookupExportFilterForUrl( std::u16string_view rUrl, std::u16string_view rFactory ) { // create the list of filters OUStringBuffer sQuery(256); diff --git a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx index bea08615c459..42f63aa2e772 100644 --- a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx +++ b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx @@ -161,7 +161,7 @@ private: uno::Any const & exception) const; OUString getUpdateDisplayString( - dp_gui::UpdateData const & data, OUString const & version = OUString()) const; + dp_gui::UpdateData const & data, std::u16string_view version = std::u16string_view()) const; void prepareUpdateData( css::uno::Reference< css::xml::dom::XNode > const & updateInfo, @@ -332,7 +332,7 @@ void UpdateDialog::Thread::handleSpecificError( } OUString UpdateDialog::Thread::getUpdateDisplayString( - dp_gui::UpdateData const & data, OUString const & version) const + dp_gui::UpdateData const & data, std::u16string_view version) const { OSL_ASSERT(data.aInstalledPackage.is()); OUStringBuffer b(data.aInstalledPackage->getDisplayName()); @@ -343,7 +343,7 @@ OUString UpdateDialog::Thread::getUpdateDisplayString( b.append(m_dialog.m_version); } b.append(' '); - if (!version.isEmpty()) + if (!version.empty()) b.append(version); else b.append(data.updateVersion); diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx b/extensions/source/propctrlr/formcomponenthandler.cxx index c0f3cea4e51d..e63074053cf1 100644 --- a/extensions/source/propctrlr/formcomponenthandler.cxx +++ b/extensions/source/propctrlr/formcomponenthandler.cxx @@ -2516,13 +2516,13 @@ namespace pcr } } - void FormComponentPropertyHandler::impl_fillQueryNames_throw( const Reference< XNameAccess >& _xQueryNames,std::vector< OUString >& _out_rNames,const OUString& _sName ) const + void FormComponentPropertyHandler::impl_fillQueryNames_throw( const Reference< XNameAccess >& _xQueryNames,std::vector< OUString >& _out_rNames,std::u16string_view _sName ) const { DBG_ASSERT( _xQueryNames.is(), "FormComponentPropertyHandler::impl_fillQueryNames_throw: no way to obtain the queries of the connection!" ); if ( !_xQueryNames.is() ) return; - bool bAdd = !_sName.isEmpty(); + bool bAdd = !_sName.empty(); const Sequence<OUString> aQueryNames =_xQueryNames->getElementNames(); for ( const OUString& rQueryName : aQueryNames ) diff --git a/extensions/source/propctrlr/formcomponenthandler.hxx b/extensions/source/propctrlr/formcomponenthandler.hxx index 8359cdbccc04..f62778522bd4 100644 --- a/extensions/source/propctrlr/formcomponenthandler.hxx +++ b/extensions/source/propctrlr/formcomponenthandler.hxx @@ -219,7 +219,7 @@ namespace pcr */ void impl_fillQueryNames_throw( const css::uno::Reference< css::container::XNameAccess >& _xQueryNames ,std::vector< OUString >& _out_rNames - ,const OUString& _sName = OUString() ) const; + ,std::u16string_view _sName = std::u16string_view() ) const; /** describes the UI for selecting a ListSource (for list-like form controls) @precond diff --git a/framework/inc/recording/dispatchrecorder.hxx b/framework/inc/recording/dispatchrecorder.hxx index 2a7afc550177..dbbd50166382 100644 --- a/framework/inc/recording/dispatchrecorder.hxx +++ b/framework/inc/recording/dispatchrecorder.hxx @@ -80,7 +80,7 @@ class DispatchRecorder final // private functions private: - void implts_recordMacro( const OUString& aURL, + void implts_recordMacro( std::u16string_view aURL, const css::uno::Sequence< css::beans::PropertyValue >& lArguments, bool bAsComment, OUStringBuffer& ); void AppendToBuffer( const css::uno::Any& aValue, OUStringBuffer& aArgumentBuffer ); diff --git a/framework/source/accelerators/documentacceleratorconfiguration.cxx b/framework/source/accelerators/documentacceleratorconfiguration.cxx index 33f4e877a534..df638d2b2ab3 100644 --- a/framework/source/accelerators/documentacceleratorconfiguration.cxx +++ b/framework/source/accelerators/documentacceleratorconfiguration.cxx @@ -30,7 +30,7 @@ using namespace framework; -#define RESOURCETYPE_ACCELERATOR "accelerator" +#define RESOURCETYPE_ACCELERATOR u"accelerator" namespace { @@ -167,7 +167,7 @@ void DocumentAcceleratorConfiguration::fillCache() m_aPresetHandler.connectToResource( PresetHandler::E_DOCUMENT, RESOURCETYPE_ACCELERATOR, - OUString(), + u"", xDocumentRoot, aLanguageTag); diff --git a/framework/source/accelerators/presethandler.cxx b/framework/source/accelerators/presethandler.cxx index bce2e3861499..50de9d7179e5 100644 --- a/framework/source/accelerators/presethandler.cxx +++ b/framework/source/accelerators/presethandler.cxx @@ -304,8 +304,8 @@ css::uno::Reference< css::embed::XStorage > PresetHandler::getParentStorageUser( } void PresetHandler::connectToResource( PresetHandler::EConfigType eConfigType , - const OUString& sResource , - const OUString& sModule , + std::u16string_view sResource , + std::u16string_view sModule , const css::uno::Reference< css::embed::XStorage >& xDocumentRoot, const LanguageTag& rLanguageTag ) { diff --git a/framework/source/inc/accelerators/presethandler.hxx b/framework/source/inc/accelerators/presethandler.hxx index ad0a2e1260d5..8323116eea7c 100644 --- a/framework/source/inc/accelerators/presethandler.hxx +++ b/framework/source/inc/accelerators/presethandler.hxx @@ -208,8 +208,8 @@ class PresetHandler if the specified resource couldn't be located. */ void connectToResource( EConfigType eConfigType , - const OUString& sResourceType , - const OUString& sModule , + std::u16string_view sResourceType , + std::u16string_view sModule , const css::uno::Reference< css::embed::XStorage >& xDocumentRoot , const LanguageTag& rLanguageTag = LanguageTag(LANGUAGE_USER_PRIV_NOTRANSLATE)); diff --git a/framework/source/recording/dispatchrecorder.cxx b/framework/source/recording/dispatchrecorder.cxx index 0a370ef3fa0b..70b6b9f41f2f 100644 --- a/framework/source/recording/dispatchrecorder.cxx +++ b/framework/source/recording/dispatchrecorder.cxx @@ -287,7 +287,7 @@ void DispatchRecorder::AppendToBuffer( const css::uno::Any& aValue, OUStringBuff } } -void DispatchRecorder::implts_recordMacro( const OUString& aURL, +void DispatchRecorder::implts_recordMacro( std::u16string_view aURL, const css::uno::Sequence< css::beans::PropertyValue >& lArguments, bool bAsComment, OUStringBuffer& aScriptBuffer ) { diff --git a/include/basic/sbstar.hxx b/include/basic/sbstar.hxx index bdcf167edd49..9c3d02421af9 100644 --- a/include/basic/sbstar.hxx +++ b/include/basic/sbstar.hxx @@ -121,7 +121,7 @@ public: sal_uInt16 nCol1, sal_uInt16 nCol2 ); // Specific to error handler - static void MakeErrorText( ErrCode, const OUString& aMsg ); + static void MakeErrorText( ErrCode, std::u16string_view aMsg ); static const OUString& GetErrorText(); static ErrCode const & GetErrorCode(); static sal_uInt16 GetVBErrorCode( ErrCode nError ); diff --git a/include/codemaker/commonjava.hxx b/include/codemaker/commonjava.hxx index 10d7c28ba576..daac32263cea 100644 --- a/include/codemaker/commonjava.hxx +++ b/include/codemaker/commonjava.hxx @@ -31,7 +31,7 @@ namespace rtl { class OString; } namespace codemaker::java { rtl::OString translateUnoToJavaType( - codemaker::UnoType::Sort sort, rtl::OString const & nucleus, + codemaker::UnoType::Sort sort, std::string_view nucleus, bool referenceType); rtl::OString translateUnoToJavaIdentifier( diff --git a/include/comphelper/stl_types.hxx b/include/comphelper/stl_types.hxx index 983247a84713..5e8a532a60b9 100644 --- a/include/comphelper/stl_types.hxx +++ b/include/comphelper/stl_types.hxx @@ -119,7 +119,7 @@ public: OUStringBufferAppender(OUStringBuffer & i_rBuffer) : m_rBuffer(&i_rBuffer) { } - Self & operator=(OUString const & i_rStr) + Self & operator=(std::u16string_view i_rStr) { m_rBuffer->append( i_rStr ); return *this; diff --git a/include/comphelper/string.hxx b/include/comphelper/string.hxx index 3567ce364cac..6e421fa7d1e8 100644 --- a/include/comphelper/string.hxx +++ b/include/comphelper/string.hxx @@ -269,7 +269,7 @@ COMPHELPER_DLLPUBLIC OUString convertCommaSeparated( css::uno::Sequence< OUString > const & i_rSeq); /// Return a string which is the concatenation of the strings in the sequence. -COMPHELPER_DLLPUBLIC OString join(const OString& rSeparator, const std::vector<OString>& rSequence); +COMPHELPER_DLLPUBLIC OString join(std::string_view rSeparator, const std::vector<OString>& rSequence); /** Convert a decimal string to a number. diff --git a/include/connectivity/dbtools.hxx b/include/connectivity/dbtools.hxx index f4f19b66f57e..505228a9931a 100644 --- a/include/connectivity/dbtools.hxx +++ b/include/connectivity/dbtools.hxx @@ -770,7 +770,7 @@ namespace dbtools the buffer to which the comparison predicate will be appended */ OOO_DLLPUBLIC_DBTOOLS void getBooleanComparisonPredicate( - const OUString& _rExpression, + std::u16string_view _rExpression, const bool _bValue, const sal_Int32 _nBooleanComparisonMode, OUStringBuffer& _out_rSQLPredicate diff --git a/include/connectivity/filtermanager.hxx b/include/connectivity/filtermanager.hxx index af9baef396fe..b6f104aa4037 100644 --- a/include/connectivity/filtermanager.hxx +++ b/include/connectivity/filtermanager.hxx @@ -98,7 +98,7 @@ namespace dbtools /** appends one filter component to the statement in our composer */ - static void appendFilterComponent( OUStringBuffer& io_appendTo, const OUString& i_component ); + static void appendFilterComponent( OUStringBuffer& io_appendTo, std::u16string_view i_component ); /// checks whether there is only one (or even no) non-empty filter component bool isThereAtMostOneFilterComponent( OUString& o_singleComponent ) const; diff --git a/include/oox/core/contexthandler2.hxx b/include/oox/core/contexthandler2.hxx index 872a50697ca1..13b732dec7e5 100644 --- a/include/oox/core/contexthandler2.hxx +++ b/include/oox/core/contexthandler2.hxx @@ -187,7 +187,7 @@ protected: const css::uno::Reference< css::xml::sax::XFastAttributeList >& rxAttribs ); /** Must be called from characters() in derived classes. */ - void implCharacters( const OUString& rChars ); + void implCharacters( std::u16string_view rChars ); /** Must be called from endFastElement() in derived classes. */ void implEndElement( sal_Int32 nElement ); diff --git a/include/oox/dump/dumperbase.hxx b/include/oox/dump/dumperbase.hxx index 7b7f4fd9ad8c..81c3a2fcb21e 100644 --- a/include/oox/dump/dumperbase.hxx +++ b/include/oox/dump/dumperbase.hxx @@ -316,7 +316,7 @@ public: // token list ------------------------------------------------------------- - static void appendToken( OUStringBuffer& rStr, const OUString& rToken, sal_Unicode cSep = OOX_DUMP_LISTSEP ); + static void appendToken( OUStringBuffer& rStr, std::u16string_view rToken, sal_Unicode cSep = OOX_DUMP_LISTSEP ); static void appendIndex( OUStringBuffer& rStr, sal_Int64 nIdx ); diff --git a/include/oox/ole/vbamodule.hxx b/include/oox/ole/vbamodule.hxx index 85f1f3e37103..b6a615ef6ba6 100644 --- a/include/oox/ole/vbamodule.hxx +++ b/include/oox/ole/vbamodule.hxx @@ -79,7 +79,7 @@ private: /** Creates a new Basic module and inserts it into the passed Basic library. */ void createModule( - const OUString& rVBASourceCode, + std::u16string_view rVBASourceCode, const css::uno::Reference< css::container::XNameContainer >& rxBasicLib, const css::uno::Reference< css::container::XNameAccess >& rxDocObjectNA ) const; diff --git a/include/sfx2/DocumentMetadataAccess.hxx b/include/sfx2/DocumentMetadataAccess.hxx index 196676671f9d..bcbf9f1b3849 100644 --- a/include/sfx2/DocumentMetadataAccess.hxx +++ b/include/sfx2/DocumentMetadataAccess.hxx @@ -67,7 +67,7 @@ createBaseURI( css::uno::Reference<css::uno::XComponentContext> const & i_xContext, css::uno::Reference<css::frame::XModel> const & i_xModel, OUString const & i_rPkgURI, - OUString const & i_rSubDocument = OUString()); + std::u16string_view i_rSubDocument = std::u16string_view()); struct DocumentMetadataAccess_Impl; diff --git a/include/sfx2/linkmgr.hxx b/include/sfx2/linkmgr.hxx index fcd91ea81f0d..b952e992092b 100644 --- a/include/sfx2/linkmgr.hxx +++ b/include/sfx2/linkmgr.hxx @@ -105,7 +105,7 @@ public: // Connect the links to a pseudo-object and add to the list void InsertFileLink( sfx2::SvBaseLink&, SvBaseLinkObjectType nFileType, - const OUString& rFileNm, + std::u16string_view rFileNm, const OUString* pFilterNm = nullptr, const OUString* pRange = nullptr ); diff --git a/include/sfx2/lokhelper.hxx b/include/sfx2/lokhelper.hxx index 34023d8d8bd3..f10bac147933 100644 --- a/include/sfx2/lokhelper.hxx +++ b/include/sfx2/lokhelper.hxx @@ -105,7 +105,7 @@ public: /// Emits a LOK_CALLBACK_DOCUMENT_SIZE_CHANGED for all views of the same document - if @bInvalidateAll - first invalidates all parts static void notifyDocumentSizeChangedAllViews(vcl::ITiledRenderable* pDoc, bool bInvalidateAll = true); /// Emits a LOK_CALLBACK_INVALIDATE_TILES, but tweaks it according to setOptionalFeatures() if needed. - static void notifyInvalidation(SfxViewShell const* pThisView, const OString& rPayload); + static void notifyInvalidation(SfxViewShell const* pThisView, std::string_view rPayload); /// Emits a LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR, but tweaks it according to setOptionalFeatures() if needed. static void notifyVisCursorInvalidation(OutlinerViewShell const* pThisView, const OString& rRectangle, bool bMispelledWord = false, const OString& rHyperlink = ""); /// Notifies all views with the given type and payload. diff --git a/include/svl/zforlist.hxx b/include/svl/zforlist.hxx index 405249b5c7ce..fe148e978466 100644 --- a/include/svl/zforlist.hxx +++ b/include/svl/zforlist.hxx @@ -360,9 +360,9 @@ public: /// rSymStr is appended/prepended to rStr, incl. minus sign static void CompletePositiveFormatString(OUStringBuffer& rStr, - const OUString& rSymStr, sal_uInt16 nPosiFormat); + std::u16string_view rSymStr, sal_uInt16 nPosiFormat); static void CompleteNegativeFormatString(OUStringBuffer& rStr, - const OUString& rSymStr, sal_uInt16 nNegaFormat); + std::u16string_view rSymStr, sal_uInt16 nNegaFormat); /** Representation of a currency (symbol position and negative sign) in other language settings */ diff --git a/include/svl/zformat.hxx b/include/svl/zformat.hxx index 6ced6b0122ff..543c5967804c 100644 --- a/include/svl/zformat.hxx +++ b/include/svl/zformat.hxx @@ -242,7 +242,7 @@ public: bool GetOutputString( double fNumber, sal_uInt16 nCharCount, OUString& rOutString ) const; bool GetOutputString( double fNumber, OUString& OutString, const Color** ppColor ); - void GetOutputString( const OUString& sString, OUString& OutString, const Color** ppColor ); + void GetOutputString( std::u16string_view sString, OUString& OutString, const Color** ppColor ); // True if type text bool IsTextFormat() const { return bool(eType & SvNumFormatType::TEXT); } diff --git a/include/xmloff/xmlnumfe.hxx b/include/xmloff/xmlnumfe.hxx index 80388ba758c1..98584ac93873 100644 --- a/include/xmloff/xmlnumfe.hxx +++ b/include/xmloff/xmlnumfe.hxx @@ -59,7 +59,7 @@ private: SAL_DLLPRIVATE void AddStyleAttr_Impl( bool bLong ); SAL_DLLPRIVATE void AddLanguageAttr_Impl( LanguageType nLang ); - SAL_DLLPRIVATE void AddToTextElement_Impl( const OUString& rString ); + SAL_DLLPRIVATE void AddToTextElement_Impl( std::u16string_view rString ); SAL_DLLPRIVATE void FinishTextElement_Impl(bool bUseExtensionNS = false); SAL_DLLPRIVATE void WriteColorElement_Impl( const Color& rColor ); diff --git a/include/xmloff/xmlnumfi.hxx b/include/xmloff/xmlnumfi.hxx index e0f61cc1eec3..1bf6c9228ed6 100644 --- a/include/xmloff/xmlnumfi.hxx +++ b/include/xmloff/xmlnumfi.hxx @@ -182,7 +182,7 @@ public: const LocaleDataWrapper& GetLocaleData() const; - void AddToCode( const OUString& rString ); + void AddToCode( std::u16string_view rString ); void AddToCode( sal_Unicode c ); void AddNumber( const SvXMLNumberInfo& rInfo ); void AddCurrency( const OUString& rContent, LanguageType nLang ); diff --git a/jvmfwk/inc/fwkbase.hxx b/jvmfwk/inc/fwkbase.hxx index 1c6ad983f47c..5f989cc08cee 100644 --- a/jvmfwk/inc/fwkbase.hxx +++ b/jvmfwk/inc/fwkbase.hxx @@ -85,7 +85,7 @@ JFW_MODE getMode(); /** creates the -Djava.class.path option with the complete classpath, including the paths which are set by UNO_JAVA_JFW_CLASSPATH_URLS. */ -OString makeClassPathOption(OUString const& sUserClassPath); +OString makeClassPathOption(std::u16string_view sUserClassPath); OString getSettingsPath(const OUString& sURL); diff --git a/jvmfwk/source/fwkbase.cxx b/jvmfwk/source/fwkbase.cxx index 4c4b50725f2c..6864881aad7d 100644 --- a/jvmfwk/source/fwkbase.cxx +++ b/jvmfwk/source/fwkbase.cxx @@ -441,21 +441,21 @@ OUString getApplicationClassPath() return buf.makeStringAndClear(); } -OString makeClassPathOption(OUString const & sUserClassPath) +OString makeClassPathOption(std::u16string_view sUserClassPath) { //Compose the class path OString sPaths; OUStringBuffer sBufCP(4096); // append all user selected jars to the class path - if (!sUserClassPath.isEmpty()) + if (!sUserClassPath.empty()) sBufCP.append(sUserClassPath); //append all jar libraries and components to the class path OUString sAppCP = getApplicationClassPath(); if (!sAppCP.isEmpty()) { - if (!sUserClassPath.isEmpty()) + if (!sUserClassPath.empty()) { sBufCP.append(SAL_PATHSEPARATOR); } diff --git a/l10ntools/source/localize.cxx b/l10ntools/source/localize.cxx index 3401a7429658..47cc132fd8c3 100644 --- a/l10ntools/source/localize.cxx +++ b/l10ntools/source/localize.cxx @@ -85,7 +85,7 @@ bool passesPositiveList(const OUString& rUrl) { } void handleCommand( - const OString& rInPath, const OString& rOutPath, + std::string_view rInPath, std::string_view rOutPath, const std::string& rExecutable) { OStringBuffer buf; diff --git a/oox/source/core/contexthandler2.cxx b/oox/source/core/contexthandler2.cxx index a63a9b6ba1a5..b7924cc9fa4a 100644 --- a/oox/source/core/contexthandler2.cxx +++ b/oox/source/core/contexthandler2.cxx @@ -102,7 +102,7 @@ void ContextHandler2Helper::implStartElement( sal_Int32 nElement, const Referenc onStartElement( aAttribs ); } -void ContextHandler2Helper::implCharacters( const OUString& rChars ) +void ContextHandler2Helper::implCharacters( std::u16string_view rChars ) { // #i76091# collect characters until new element starts or this element ends if( !mxContextStack->empty() ) diff --git a/oox/source/dump/dumperbase.cxx b/oox/source/dump/dumperbase.cxx index 06d277855c76..c3b26de7a067 100644 --- a/oox/source/dump/dumperbase.cxx +++ b/oox/source/dump/dumperbase.cxx @@ -511,9 +511,9 @@ void StringHelper::appendEncString( OUStringBuffer& rStr, const OUString& rData, // token list ----------------------------------------------------------------- -void StringHelper::appendToken( OUStringBuffer& rStr, const OUString& rToken, sal_Unicode cSep ) +void StringHelper::appendToken( OUStringBuffer& rStr, std::u16string_view rToken, sal_Unicode cSep ) { - if( (rStr.getLength() > 0) && (!rToken.isEmpty()) ) + if( (rStr.getLength() > 0) && (!rToken.empty()) ) rStr.append( cSep ); rStr.append( rToken ); } @@ -1061,7 +1061,7 @@ OUString FlagsList::implGetName( const Config& /*rCfg*/, sal_Int64 nKey ) const bool bFlag = getFlag( nKey, nMask ); if( bOnOff ) { - StringHelper::appendToken( aName, rFlagName.copy( 1 ) ); + StringHelper::appendToken( aName, rFlagName.subView( 1 ) ); aName.appendAscii( bFlag ? ":on" : ":off" ); } else @@ -1073,14 +1073,14 @@ OUString FlagsList::implGetName( const Config& /*rCfg*/, sal_Int64 nKey ) const if( !bNegated ) StringHelper::appendToken( aName, rFlagName ); else if( nBothSep > 0 ) - StringHelper::appendToken( aName, rFlagName.copy( nBothSep + 1 ) ); + StringHelper::appendToken( aName, rFlagName.subView( nBothSep + 1 ) ); } else if( bNegated ) { if( nBothSep > 0 ) - StringHelper::appendToken( aName, rFlagName.copy( 1, nBothSep - 1 ) ); + StringHelper::appendToken( aName, rFlagName.subView( 1, nBothSep - 1 ) ); else - StringHelper::appendToken( aName, rFlagName.copy( 1 ) ); + StringHelper::appendToken( aName, rFlagName.subView( 1 ) ); } } } diff --git a/oox/source/ole/vbamodule.cxx b/oox/source/ole/vbamodule.cxx index 7e913124730b..47c676cdc086 100644 --- a/oox/source/ole/vbamodule.cxx +++ b/oox/source/ole/vbamodule.cxx @@ -136,7 +136,7 @@ void VbaModule::createAndImportModule( StorageBase& rVbaStrg, void VbaModule::createEmptyModule( const Reference< container::XNameContainer >& rxBasicLib, const Reference< container::XNameAccess >& rxDocObjectNA ) const { - createModule( OUString(), rxBasicLib, rxDocObjectNA ); + createModule( u"", rxBasicLib, rxDocObjectNA ); } OUString VbaModule::readSourceCode( StorageBase& rVbaStrg ) const @@ -252,7 +252,7 @@ OUString VbaModule::readSourceCode( StorageBase& rVbaStrg ) const return aSourceCode.makeStringAndClear(); } -void VbaModule::createModule( const OUString& rVBASourceCode, +void VbaModule::createModule( std::u16string_view rVBASourceCode, const Reference< container::XNameContainer >& rxBasicLib, const Reference< container::XNameAccess >& rxDocObjectNA ) const { diff --git a/registry/source/keyimpl.cxx b/registry/source/keyimpl.cxx index fff60d6e2449..abf8e0d1ef12 100644 --- a/registry/source/keyimpl.cxx +++ b/registry/source/keyimpl.cxx @@ -65,7 +65,7 @@ RegError ORegKey::releaseKey(RegKeyHandle hKey) // createKey -RegError ORegKey::createKey(const OUString& keyName, RegKeyHandle* phNewKey) +RegError ORegKey::createKey(std::u16string_view keyName, RegKeyHandle* phNewKey) { return m_pRegistry->createKey(this, keyName, phNewKey); } @@ -73,7 +73,7 @@ RegError ORegKey::createKey(const OUString& keyName, RegKeyHandle* phNewKey) // openKey -RegError ORegKey::openKey(const OUString& keyName, RegKeyHandle* phOpenKey) +RegError ORegKey::openKey(std::u16string_view keyName, RegKeyHandle* phOpenKey) { return m_pRegistry->openKey(this, keyName, phOpenKey); } @@ -81,7 +81,7 @@ RegError ORegKey::openKey(const OUString& keyName, RegKeyHandle* phOpenKey) // openSubKeys -RegError ORegKey::openSubKeys(const OUString& keyName, RegKeyHandle** phOpenSubKeys, sal_uInt32* pnSubKeys) +RegError ORegKey::openSubKeys(std::u16string_view keyName, RegKeyHandle** phOpenSubKeys, sal_uInt32* pnSubKeys) { RegError _ret = RegError::NO_ERROR; @@ -89,7 +89,7 @@ RegError ORegKey::openSubKeys(const OUString& keyName, RegKeyHandle** phOpenSubK *pnSubKeys = 0; ORegKey* pKey = this; - if ( !keyName.isEmpty() ) + if ( !keyName.empty() ) { _ret = openKey(keyName, reinterpret_cast<RegKeyHandle*>(&pKey)); if (_ret != RegError::NO_ERROR) @@ -132,7 +132,7 @@ RegError ORegKey::openSubKeys(const OUString& keyName, RegKeyHandle** phOpenSubK } *phOpenSubKeys = reinterpret_cast<RegKeyHandle*>(pSubKeys); - if (!keyName.isEmpty()) + if (!keyName.empty()) { (void) releaseKey(pKey); } @@ -142,7 +142,7 @@ RegError ORegKey::openSubKeys(const OUString& keyName, RegKeyHandle** phOpenSubK // getKeyNames -RegError ORegKey::getKeyNames(const OUString& keyName, +RegError ORegKey::getKeyNames(std::u16string_view keyName, rtl_uString*** pSubKeyNames, sal_uInt32* pnSubKeys) { @@ -150,7 +150,7 @@ RegError ORegKey::getKeyNames(const OUString& keyName, *pnSubKeys = 0; ORegKey* pKey = this; - if (!keyName.isEmpty()) + if (!keyName.empty()) { RegError _ret = openKey(keyName, reinterpret_cast<RegKeyHandle*>(&pKey)); if (_ret != RegError::NO_ERROR) @@ -189,7 +189,7 @@ RegError ORegKey::getKeyNames(const OUString& keyName, } *pSubKeyNames = pSubKeys; - if (!keyName.isEmpty()) + if (!keyName.empty()) { releaseKey(pKey); } @@ -207,7 +207,7 @@ RegError ORegKey::closeKey(RegKeyHandle hKey) // deleteKey -RegError ORegKey::deleteKey(const OUString& keyName) +RegError ORegKey::deleteKey(std::u16string_view keyName) { return m_pRegistry->deleteKey(this, keyName); } @@ -899,10 +899,10 @@ RegError ORegKey::getUnicodeListValue(std::u16string_view valueName, sal_Unicode } -RegError ORegKey::getResolvedKeyName(const OUString& keyName, +RegError ORegKey::getResolvedKeyName(std::u16string_view keyName, OUString& resolvedName) const { - if (keyName.isEmpty()) + if (keyName.empty()) return RegError::INVALID_KEYNAME; resolvedName = getFullPath(keyName); @@ -961,13 +961,13 @@ OStoreDirectory ORegKey::getStoreDir() const return rStoreDir; } -OUString ORegKey::getFullPath(OUString const & path) const { - OSL_ASSERT(!m_name.isEmpty() && !path.isEmpty()); +OUString ORegKey::getFullPath(std::u16string_view path) const { + OSL_ASSERT(!m_name.isEmpty() && !path.empty()); OUStringBuffer b(32); b.append(m_name); if (!b.isEmpty() && b[b.getLength() - 1] == '/') { if (path[0] == '/') { - b.append(path.subView(1)); + b.append(path.substr(1)); } else { b.append(path); } diff --git a/registry/source/keyimpl.hxx b/registry/source/keyimpl.hxx index 17b7023dce75..1958a7b6247e 100644 --- a/registry/source/keyimpl.hxx +++ b/registry/source/keyimpl.hxx @@ -42,21 +42,21 @@ public: RegError releaseKey(RegKeyHandle hKey); - RegError createKey(const OUString& keyName, RegKeyHandle* phNewKey); + RegError createKey(std::u16string_view keyName, RegKeyHandle* phNewKey); - RegError openKey(const OUString& keyName, RegKeyHandle* phOpenKey); + RegError openKey(std::u16string_view keyName, RegKeyHandle* phOpenKey); - RegError openSubKeys(const OUString& keyName, + RegError openSubKeys(std::u16string_view keyName, RegKeyHandle** phOpenSubKeys, sal_uInt32* pnSubKeys); - RegError getKeyNames(const OUString& keyName, + RegError getKeyNames(std::u16string_view keyName, rtl_uString*** pSubKeyNames, sal_uInt32* pnSubKeys); RegError closeKey(RegKeyHandle hKey); - RegError deleteKey(const OUString& keyName); + RegError deleteKey(std::u16string_view keyName); RegError getValueInfo(std::u16string_view valueName, RegValueType* pValueTye, @@ -93,7 +93,7 @@ public: sal_Unicode*** pValueList, sal_uInt32* pLen) const; - RegError getResolvedKeyName(const OUString& keyName, + RegError getResolvedKeyName(std::u16string_view keyName, OUString& resolvedName) const; bool isDeleted() const @@ -124,7 +124,7 @@ public: const OUString& getName() const { return m_name; } - OUString getFullPath(OUString const & path) const; + OUString getFullPath(std::u16string_view path) const; private: sal_uInt32 m_refCount; diff --git a/registry/source/regimpl.cxx b/registry/source/regimpl.cxx index dc87985ab623..6201a38c7662 100644 --- a/registry/source/regimpl.cxx +++ b/registry/source/regimpl.cxx @@ -603,14 +603,14 @@ RegError ORegistry::releaseKey (RegKeyHandle hKey) return RegError::NO_ERROR; } -RegError ORegistry::createKey(RegKeyHandle hKey, const OUString& keyName, +RegError ORegistry::createKey(RegKeyHandle hKey, std::u16string_view keyName, RegKeyHandle* phNewKey) { ORegKey* pKey; *phNewKey = nullptr; - if (keyName.isEmpty()) + if (keyName.empty()) return RegError::INVALID_KEYNAME; REG_GUARD(m_mutex); @@ -660,14 +660,14 @@ RegError ORegistry::createKey(RegKeyHandle hKey, const OUString& keyName, return RegError::NO_ERROR; } -RegError ORegistry::openKey(RegKeyHandle hKey, const OUString& keyName, +RegError ORegistry::openKey(RegKeyHandle hKey, std::u16string_view keyName, RegKeyHandle* phOpenKey) { ORegKey* pKey; *phOpenKey = nullptr; - if (keyName.isEmpty()) + if (keyName.empty()) { return RegError::INVALID_KEYNAME; } @@ -735,10 +735,10 @@ RegError ORegistry::closeKey(RegKeyHandle hKey) return releaseKey(pKey); } -RegError ORegistry::deleteKey(RegKeyHandle hKey, const OUString& keyName) +RegError ORegistry::deleteKey(RegKeyHandle hKey, std::u16string_view keyName) { ORegKey* pKey = static_cast< ORegKey* >(hKey); - if (keyName.isEmpty()) + if (keyName.empty()) return RegError::INVALID_KEYNAME; REG_GUARD(m_mutex); diff --git a/registry/source/regimpl.hxx b/registry/source/regimpl.hxx index db2af7e77846..19fa6b1e3232 100644 --- a/registry/source/regimpl.hxx +++ b/registry/source/regimpl.hxx @@ -65,16 +65,16 @@ public: RegError releaseKey(RegKeyHandle hKey); RegError createKey(RegKeyHandle hKey, - const OUString& keyName, + std::u16string_view keyName, RegKeyHandle* phNewKey); RegError openKey(RegKeyHandle hKey, - const OUString& keyName, + std::u16string_view keyName, RegKeyHandle* phOpenKey); RegError closeKey(RegKeyHandle hKey); - RegError deleteKey(RegKeyHandle hKey, const OUString& keyName); + RegError deleteKey(RegKeyHandle hKey, std::u16string_view keyName); RegError loadKey(RegKeyHandle hKey, const OUString& regFileName, diff --git a/registry/source/registry.cxx b/registry/source/registry.cxx index eb2a38f6ba5a..1727dfc119dc 100644 --- a/registry/source/registry.cxx +++ b/registry/source/registry.cxx @@ -241,7 +241,7 @@ static RegError REGISTRY_CALLTYPE mergeKey(RegHandle hReg, if (keyName->length) { ORegKey* pNewKey = nullptr; - RegError _ret = pKey->createKey(keyName, reinterpret_cast<RegKeyHandle*>(&pNewKey)); + RegError _ret = pKey->createKey(OUString::unacquired(&keyName), reinterpret_cast<RegKeyHandle*>(&pNewKey)); if (_ret != RegError::NO_ERROR) return _ret; diff --git a/registry/source/regkey.cxx b/registry/source/regkey.cxx index 55b0bc80924e..4f0d518976d4 100644 --- a/registry/source/regkey.cxx +++ b/registry/source/regkey.cxx @@ -95,7 +95,7 @@ RegError REGISTRY_CALLTYPE createKey(RegKeyHandle hKey, if (pKey->isReadOnly()) return RegError::REGISTRY_READONLY; - return pKey->createKey(keyName, phNewKey); + return pKey->createKey(OUString::unacquired(&keyName), phNewKey); } @@ -114,7 +114,7 @@ RegError REGISTRY_CALLTYPE openKey(RegKeyHandle hKey, if (pKey->isDeleted()) return RegError::INVALID_KEY; - return pKey->openKey(keyName, phOpenKey); + return pKey->openKey(OUString::unacquired(&keyName), phOpenKey); } @@ -135,7 +135,7 @@ RegError REGISTRY_CALLTYPE openSubKeys(RegKeyHandle hKey, if (pKey->isDeleted()) return RegError::INVALID_KEY; - return pKey->openSubKeys(keyName, pphSubKeys, pnSubKeys); + return pKey->openSubKeys(OUString::unacquired(&keyName), pphSubKeys, pnSubKeys); } @@ -173,7 +173,7 @@ RegError REGISTRY_CALLTYPE deleteKey(RegKeyHandle hKey, if (pKey->isReadOnly()) return RegError::REGISTRY_READONLY; - return pKey->deleteKey(keyName); + return pKey->deleteKey(OUString::unacquired(&keyName)); } @@ -211,7 +211,7 @@ RegError REGISTRY_CALLTYPE setValue(RegKeyHandle hKey, if (keyName->length) { ORegKey* pSubKey = nullptr; - RegError _ret1 = pKey->openKey(keyName, reinterpret_cast<RegKeyHandle*>(&pSubKey)); + RegError _ret1 = pKey->openKey(OUString::unacquired(&keyName), reinterpret_cast<RegKeyHandle*>(&pSubKey)); if (_ret1 != RegError::NO_ERROR) return _ret1; @@ -253,7 +253,7 @@ RegError REGISTRY_CALLTYPE setLongListValue(RegKeyHandle hKey, if (keyName->length) { ORegKey* pSubKey = nullptr; - RegError _ret1 = pKey->openKey(keyName, reinterpret_cast<RegKeyHandle*>(&pSubKey)); + RegError _ret1 = pKey->openKey(OUString::unacquired(&keyName), reinterpret_cast<RegKeyHandle*>(&pSubKey)); if (_ret1 != RegError::NO_ERROR) return _ret1; @@ -295,7 +295,7 @@ RegError REGISTRY_CALLTYPE setStringListValue(RegKeyHandle hKey, if (keyName->length) { ORegKey* pSubKey = nullptr; - RegError _ret1 = pKey->openKey(keyName, reinterpret_cast<RegKeyHandle*>(&pSubKey)); + RegError _ret1 = pKey->openKey(OUString::unacquired(&keyName), reinterpret_cast<RegKeyHandle*>(&pSubKey)); if (_ret1 != RegError::NO_ERROR) return _ret1; @@ -337,7 +337,7 @@ RegError REGISTRY_CALLTYPE setUnicodeListValue(RegKeyHandle hKey, if (keyName->length) { ORegKey* pSubKey = nullptr; - RegError _ret1 = pKey->openKey(keyName, reinterpret_cast<RegKeyHandle*>(&pSubKey)); + RegError _ret1 = pKey->openKey(OUString::unacquired(&keyName), reinterpret_cast<RegKeyHandle*>(&pSubKey)); if (_ret1 != RegError::NO_ERROR) return _ret1; @@ -382,7 +382,7 @@ RegError REGISTRY_CALLTYPE getValueInfo(RegKeyHandle hKey, if (keyName->length) { ORegKey* pSubKey = nullptr; - RegError _ret = pKey->openKey(keyName, reinterpret_cast<RegKeyHandle*>(&pSubKey)); + RegError _ret = pKey->openKey(OUString::unacquired(&keyName), reinterpret_cast<RegKeyHandle*>(&pSubKey)); if (_ret != RegError::NO_ERROR) return _ret; @@ -428,7 +428,7 @@ RegError REGISTRY_CALLTYPE getValue(RegKeyHandle hKey, if (keyName->length) { ORegKey* pSubKey = nullptr; - RegError _ret1 = pKey->openKey(keyName, reinterpret_cast<RegKeyHandle*>(&pSubKey)); + RegError _ret1 = pKey->openKey(OUString::unacquired(&keyName), reinterpret_cast<RegKeyHandle*>(&pSubKey)); if (_ret1 != RegError::NO_ERROR) return _ret1; @@ -468,7 +468,7 @@ RegError REGISTRY_CALLTYPE getLongListValue(RegKeyHandle hKey, if (keyName->length) { ORegKey* pSubKey = nullptr; - RegError _ret1 = pKey->openKey(keyName, reinterpret_cast<RegKeyHandle*>(&pSubKey)); + RegError _ret1 = pKey->openKey(OUString::unacquired(&keyName), reinterpret_cast<RegKeyHandle*>(&pSubKey)); if (_ret1 != RegError::NO_ERROR) return _ret1; @@ -508,7 +508,7 @@ RegError REGISTRY_CALLTYPE getStringListValue(RegKeyHandle hKey, if (keyName->length) { ORegKey* pSubKey = nullptr; - RegError _ret1 = pKey->openKey(keyName, reinterpret_cast<RegKeyHandle*>(&pSubKey)); + RegError _ret1 = pKey->openKey(OUString::unacquired(&keyName), reinterpret_cast<RegKeyHandle*>(&pSubKey)); if (_ret1 != RegError::NO_ERROR) return _ret1; @@ -546,7 +546,7 @@ RegError REGISTRY_CALLTYPE getUnicodeListValue(RegKeyHandle hKey, if (keyName->length) { ORegKey* pSubKey = nullptr; - RegError _ret1 = pKey->openKey(keyName, reinterpret_cast<RegKeyHandle*>(&pSubKey)); + RegError _ret1 = pKey->openKey(OUString::unacquired(&keyName), reinterpret_cast<RegKeyHandle*>(&pSubKey)); if (_ret1 != RegError::NO_ERROR) return _ret1; @@ -623,7 +623,7 @@ RegError REGISTRY_CALLTYPE getResolvedKeyName(RegKeyHandle hKey, return RegError::INVALID_KEY; OUString resolvedName; - RegError _ret = pKey->getResolvedKeyName(keyName, resolvedName); + RegError _ret = pKey->getResolvedKeyName(OUString::unacquired(&keyName), resolvedName); if (_ret == RegError::NO_ERROR) rtl_uString_assign(pResolvedName, resolvedName.pData); return _ret; @@ -644,7 +644,7 @@ RegError REGISTRY_CALLTYPE getKeyNames(RegKeyHandle hKey, if (pKey->isDeleted()) return RegError::INVALID_KEY; - return pKey->getKeyNames(keyName, pSubKeyNames, pnSubKeys); + return pKey->getKeyNames(OUString::unacquired(&keyName), pSubKeyNames, pnSubKeys); } diff --git a/sax/source/fastparser/fastparser.cxx b/sax/source/fastparser/fastparser.cxx index 6bfa1ce0e205..e225f17a1621 100644 --- a/sax/source/fastparser/fastparser.cxx +++ b/sax/source/fastparser/fastparser.cxx @@ -574,7 +574,7 @@ Event& Entity::getEvent( CallbackType aType ) return rEvent; } -OUString lclGetErrorMessage( xmlParserCtxtPtr ctxt, const OUString& sSystemId, sal_Int32 nLine ) +OUString lclGetErrorMessage( xmlParserCtxtPtr ctxt, std::u16string_view sSystemId, sal_Int32 nLine ) { const char* pMessage; xmlErrorPtr error = xmlCtxtGetLastError( ctxt ); diff --git a/sc/inc/dputil.hxx b/sc/inc/dputil.hxx index 742c69da0e6a..b3e733f40c7b 100644 --- a/sc/inc/dputil.hxx +++ b/sc/inc/dputil.hxx @@ -47,7 +47,7 @@ public: double fValue, const ScDPNumGroupInfo* pInfo, sal_Int32 nDatePart, const SvNumberFormatter* pFormatter); - SC_DLLPUBLIC static OUString getDisplayedMeasureName(const OUString& rName, ScSubTotalFunc eFunc); + SC_DLLPUBLIC static OUString getDisplayedMeasureName(std::u16string_view rName, ScSubTotalFunc eFunc); SC_DLLPUBLIC static ScSubTotalFunc toSubTotalFunc(ScGeneralFunction eGenFunc); }; diff --git a/sc/inc/global.hxx b/sc/inc/global.hxx index 6e0836fe8342..f1a3559aa6ad 100644 --- a/sc/inc/global.hxx +++ b/sc/inc/global.hxx @@ -627,7 +627,7 @@ public: @param nSepCount Specifies how often cSep is inserted between two tokens. @param bForceSep true = Always insert separator; false = Only, if not at begin or end. */ SC_DLLPUBLIC static OUString addToken( - const OUString& rTokenList, const OUString& rToken, + const OUString& rTokenList, std::u16string_view rToken, sal_Unicode cSep, sal_Int32 nSepCount = 1, bool bForceSep = false ); diff --git a/sc/qa/unit/helper/qahelper.cxx b/sc/qa/unit/helper/qahelper.cxx index 5400347324e7..051292ea52e6 100644 --- a/sc/qa/unit/helper/qahelper.cxx +++ b/sc/qa/unit/helper/qahelper.cxx @@ -653,7 +653,15 @@ void ScBootstrapFixture::createFileURL( rFilePath = url.GetMainURL(INetURLObject::DecodeMechanism::NONE); } -void ScBootstrapFixture::createCSVPath(const OUString& aFileBase, OUString& rCSVPath) +void ScBootstrapFixture::createCSVPath(const char* aFileBase, OUString& rCSVPath) +{ + OUStringBuffer aBuffer( m_directories.getSrcRootPath()); + aBuffer.append(EnsureSeparator(aBuffer)).append(m_aBaseString); + aBuffer.append(EnsureSeparator(aBuffer)).append("contentCSV/").appendAscii(aFileBase).append("csv"); + rCSVPath = aBuffer.makeStringAndClear(); +} + +void ScBootstrapFixture::createCSVPath(std::u16string_view aFileBase, OUString& rCSVPath) { OUStringBuffer aBuffer( m_directories.getSrcRootPath()); aBuffer.append(EnsureSeparator(aBuffer)).append(m_aBaseString); diff --git a/sc/qa/unit/helper/qahelper.hxx b/sc/qa/unit/helper/qahelper.hxx index 693ccbe3675f..5e1dc4cd3da4 100644 --- a/sc/qa/unit/helper/qahelper.hxx +++ b/sc/qa/unit/helper/qahelper.hxx @@ -188,8 +188,8 @@ public: virtual ~ScBootstrapFixture() override; void createFileURL(std::u16string_view aFileBase, const OUString& aFileExtension, OUString& rFilePath); - - void createCSVPath(const OUString& aFileBase, OUString& rCSVPath); + void createCSVPath(const char* aFileBase, OUString& rCSVPath); + void createCSVPath(std::u16string_view aFileBase, OUString& rCSVPath); ScDocShellRef saveAndReload(ScDocShell* pShell, const OUString &rFilter, const OUString &rUserData, const OUString& rTypeName, SfxFilterFlags nFormatType, const OUString* pPassword = nullptr ); diff --git a/sc/source/core/data/dptabres.cxx b/sc/source/core/data/dptabres.cxx index c0022282a9d6..b3d1d894dd2a 100644 --- a/sc/source/core/data/dptabres.cxx +++ b/sc/source/core/data/dptabres.cxx @@ -1296,7 +1296,7 @@ void ScDPResultMember::ProcessData( const vector< SCROW >& aChildMembers, const * Parse subtotal string and replace all occurrences of '?' with the caption * string. Do ensure that escaped characters are not translated. */ -static OUString lcl_parseSubtotalName(const OUString& rSubStr, const OUString& rCaption) +static OUString lcl_parseSubtotalName(const OUString& rSubStr, std::u16string_view rCaption) { OUStringBuffer aNewStr; sal_Int32 n = rSubStr.getLength(); diff --git a/sc/source/core/data/dputil.cxx b/sc/source/core/data/dputil.cxx index 46fa54aebbb4..b3e2d7477327 100644 --- a/sc/source/core/data/dputil.cxx +++ b/sc/source/core/data/dputil.cxx @@ -387,7 +387,7 @@ const char* aFuncStrIds[] = { } -OUString ScDPUtil::getDisplayedMeasureName(const OUString& rName, ScSubTotalFunc eFunc) +OUString ScDPUtil::getDisplayedMeasureName(std::u16string_view rName, ScSubTotalFunc eFunc) { OUStringBuffer aRet; assert(unsigned(eFunc) < SAL_N_ELEMENTS(aFuncStrIds)); diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx index eb7476801f99..3a87e3a95577 100644 --- a/sc/source/core/data/global.cxx +++ b/sc/source/core/data/global.cxx @@ -651,11 +651,11 @@ const sal_Unicode* ScGlobal::UnicodeStrChr( const sal_Unicode* pStr, return nullptr; } -OUString ScGlobal::addToken(const OUString& rTokenList, const OUString& rToken, +OUString ScGlobal::addToken(const OUString& rTokenList, std::u16string_view rToken, sal_Unicode cSep, sal_Int32 nSepCount, bool bForceSep) { OUStringBuffer aBuf(rTokenList); - if( bForceSep || (!rToken.isEmpty() && !rTokenList.isEmpty()) ) + if( bForceSep || (!rToken.empty() && !rTokenList.isEmpty()) ) comphelper::string::padToLength(aBuf, aBuf.getLength() + nSepCount, cSep); aBuf.append(rToken); return aBuf.makeStringAndClear(); diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx index b8dd4c1440b6..44c8e0a90dc1 100644 --- a/sc/source/core/tool/address.cxx +++ b/sc/source/core/tool/address.cxx @@ -2002,7 +2002,7 @@ static OUString getFileNameFromDoc( const ScDocument* pDoc ) } -static void lcl_string_append(OUStringBuffer &rString, const OUString &sString) +static void lcl_string_append(OUStringBuffer &rString, std::u16string_view sString) { rString.append(sString); } diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index 24c594667231..5ed09abc0b73 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -804,7 +804,7 @@ struct ConventionOOO_A1 : public Convention_A1 static void MakeOneRefStrImpl( const ScSheetLimits& rLimits, OUStringBuffer& rBuffer, - const OUString& rErrRef, const std::vector<OUString>& rTabNames, + std::u16string_view rErrRef, const std::vector<OUString>& rTabNames, const ScSingleRefData& rRef, const ScAddress& rAbsRef, bool bForceTab, bool bODF, SingletonDisplay eSingletonDisplay ) { diff --git a/sc/source/filter/excel/excdoc.cxx b/sc/source/filter/excel/excdoc.cxx index 6bb415559869..ebc5a69f937a 100644 --- a/sc/source/filter/excel/excdoc.cxx +++ b/sc/source/filter/excel/excdoc.cxx @@ -429,7 +429,7 @@ void ExcTable::FillAsTableBinary( SCTAB nCodeNameIdx ) if (rNote.maPos.Tab() != mnScTab) continue; - mxNoteList->AppendNewRecord(new XclExpNote(GetRoot(), rNote.maPos, rNote.mpNote, OUString())); + mxNoteList->AppendNewRecord(new XclExpNote(GetRoot(), rNote.maPos, rNote.mpNote, u"")); } // WSBOOL needs data from page settings, create it here, add it later @@ -570,7 +570,7 @@ void ExcTable::FillAsTableXml() if (rNote.maPos.Tab() != mnScTab) continue; - mxNoteList->AppendNewRecord(new XclExpNote(GetRoot(), rNote.maPos, rNote.mpNote, OUString())); + mxNoteList->AppendNewRecord(new XclExpNote(GetRoot(), rNote.maPos, rNote.mpNote, u"")); } // WSBOOL needs data from page settings, create it here, add it later diff --git a/sc/source/filter/excel/xeescher.cxx b/sc/source/filter/excel/xeescher.cxx index f4f29e83e02d..68cf336c88a8 100644 --- a/sc/source/filter/excel/xeescher.cxx +++ b/sc/source/filter/excel/xeescher.cxx @@ -1448,7 +1448,7 @@ const css::uno::Reference<css::chart::XChartDocument>& XclExpChartObj::GetChartD } XclExpNote::XclExpNote(const XclExpRoot& rRoot, const ScAddress& rScPos, - const ScPostIt* pScNote, const OUString& rAddText) + const ScPostIt* pScNote, std::u16string_view rAddText) : XclExpRecord(EXC_ID_NOTE) , mrRoot(rRoot) , maScPos(rScPos) diff --git a/sc/source/filter/excel/xltools.cxx b/sc/source/filter/excel/xltools.cxx index 814817ce030f..e4ffbebce44b 100644 --- a/sc/source/filter/excel/xltools.cxx +++ b/sc/source/filter/excel/xltools.cxx @@ -549,7 +549,7 @@ const char* const ppcStyleNames[] = "Followed_Hyperlink" }; -OUString XclTools::GetBuiltInStyleName( sal_uInt8 nStyleId, const OUString& rName, sal_uInt8 nLevel ) +OUString XclTools::GetBuiltInStyleName( sal_uInt8 nStyleId, std::u16string_view rName, sal_uInt8 nLevel ) { OUString aStyleName; @@ -562,7 +562,7 @@ OUString XclTools::GetBuiltInStyleName( sal_uInt8 nStyleId, const OUString& rNam OUStringBuffer aBuf(maStyleNamePrefix1); if( nStyleId < SAL_N_ELEMENTS( ppcStyleNames ) ) aBuf.appendAscii(ppcStyleNames[nStyleId]); - else if (!rName.isEmpty()) + else if (!rName.empty()) aBuf.append(rName); else aBuf.append(static_cast<sal_Int32>(nStyleId)); diff --git a/sc/source/filter/inc/xeescher.hxx b/sc/source/filter/inc/xeescher.hxx index 1a08b6db9886..07156acbcfa5 100644 --- a/sc/source/filter/inc/xeescher.hxx +++ b/sc/source/filter/inc/xeescher.hxx @@ -349,7 +349,7 @@ public: const XclExpRoot& rRoot, const ScAddress& rScPos, const ScPostIt* pScNote, - const OUString& rAddText ); + std::u16string_view rAddText ); /** Writes the NOTE record, if the respective Escher object is present. */ virtual void Save( XclExpStream& rStrm ) override; diff --git a/sc/source/filter/inc/xltools.hxx b/sc/source/filter/inc/xltools.hxx index 9b77c88e636f..a5b413a5f03e 100644 --- a/sc/source/filter/inc/xltools.hxx +++ b/sc/source/filter/inc/xltools.hxx @@ -203,7 +203,7 @@ public: @param rName Default name for unknown styles. @param nLevel The zero-based outline level for RowLevel and ColLevel styles. @return The style name or an empty string, if the parameters are not valid. */ - static OUString GetBuiltInStyleName( sal_uInt8 nStyleId, const OUString& rName, sal_uInt8 nLevel ); + static OUString GetBuiltInStyleName( sal_uInt8 nStyleId, std::u16string_view rName, sal_uInt8 nLevel ); /** Returns true, if the passed string is a name of an Excel built-in style. @param pnStyleId If not 0, the found style identifier will be returned here. diff --git a/sc/source/filter/oox/querytablebuffer.cxx b/sc/source/filter/oox/querytablebuffer.cxx index 9ab1c550a14a..a3800acd5a81 100644 --- a/sc/source/filter/oox/querytablebuffer.cxx +++ b/sc/source/filter/oox/querytablebuffer.cxx @@ -63,9 +63,9 @@ const sal_uInt32 BIFF12_QUERYTABLE_APPLYBORDER = 0x00020000; const sal_uInt32 BIFF12_QUERYTABLE_APPLYFILL = 0x00040000; const sal_uInt32 BIFF12_QUERYTABLE_APPLYPROTECTION = 0x00080000; -void lclAppendWebQueryTableName( OUStringBuffer& rTables, const OUString& rTableName ) +void lclAppendWebQueryTableName( OUStringBuffer& rTables, std::u16string_view rTableName ) { - if( !rTableName.isEmpty() ) + if( !rTableName.empty() ) { if( !rTables.isEmpty() ) rTables.append( ';' ); diff --git a/sc/source/filter/oox/stylesbuffer.cxx b/sc/source/filter/oox/stylesbuffer.cxx index 17cf305392e2..153948cd0422 100644 --- a/sc/source/filter/oox/stylesbuffer.cxx +++ b/sc/source/filter/oox/stylesbuffer.cxx @@ -2399,13 +2399,13 @@ const char* const sppcStyleNames[] = }; const sal_Int32 snStyleNamesCount = static_cast< sal_Int32 >( SAL_N_ELEMENTS( sppcStyleNames ) ); -OUString lclGetBuiltinStyleName( sal_Int32 nBuiltinId, const OUString& rName, sal_Int32 nLevel = 0 ) +OUString lclGetBuiltinStyleName( sal_Int32 nBuiltinId, std::u16string_view rName, sal_Int32 nLevel = 0 ) { OSL_ENSURE( (0 <= nBuiltinId) && (nBuiltinId < snStyleNamesCount), "lclGetBuiltinStyleName - unknown built-in style" ); OUStringBuffer aStyleName("Excel Built-in "); if( (0 <= nBuiltinId) && (nBuiltinId < snStyleNamesCount) && (sppcStyleNames[ nBuiltinId ] != nullptr) ) aStyleName.appendAscii( sppcStyleNames[ nBuiltinId ] ); - else if( !rName.isEmpty() ) + else if( !rName.empty() ) aStyleName.append( rName ); else aStyleName.append( nBuiltinId ); @@ -2678,7 +2678,7 @@ OUString CellStyleBuffer::createCellStyle( const CellStyleRef& rxCellStyle ) return rStyleName; } // on error: fallback to default style - return lclGetBuiltinStyleName( OOX_STYLE_NORMAL, OUString() ); + return lclGetBuiltinStyleName( OOX_STYLE_NORMAL, u"" ); } AutoFormatModel::AutoFormatModel() : diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx index 1111f2349b99..a3b784f1b419 100644 --- a/sc/source/filter/xml/xmlimprt.cxx +++ b/sc/source/filter/xml/xmlimprt.cxx @@ -807,7 +807,7 @@ void ScXMLImport::SetConfigurationSettings(const uno::Sequence<beans::PropertyVa SvXMLUnitConverter::convertPropertySet(xProperties, aFilteredProps); } -sal_Int32 ScXMLImport::SetCurrencySymbol(const sal_Int32 nKey, const OUString& rCurrency) +sal_Int32 ScXMLImport::SetCurrencySymbol(const sal_Int32 nKey, std::u16string_view rCurrency) { uno::Reference <util::XNumberFormatsSupplier> xNumberFormatsSupplier(GetNumberFormatsSupplier()); if (xNumberFormatsSupplier.is()) @@ -913,7 +913,7 @@ bool ScXMLImport::IsCurrencySymbol(const sal_Int32 nNumberFormat, const OUString void ScXMLImport::SetType(const uno::Reference <beans::XPropertySet>& rProperties, sal_Int32& rNumberFormat, const sal_Int16 nCellType, - const OUString& rCurrency) + std::u16string_view rCurrency) { if (!mbImportStyles) return; @@ -966,7 +966,7 @@ void ScXMLImport::SetType(const uno::Reference <beans::XPropertySet>& rPropertie rProperties->setPropertyValue( gsNumberFormat, uno::makeAny(xNumberFormatTypes->getStandardFormat(nCellType, aLocale)) ); } } - else if (!rCurrency.isEmpty() && !sCurrentCurrency.isEmpty()) + else if (!rCurrency.empty() && !sCurrentCurrency.isEmpty()) { if (sCurrentCurrency != rCurrency) if (!IsCurrencySymbol(rNumberFormat, sCurrentCurrency, rCurrency)) @@ -982,7 +982,7 @@ void ScXMLImport::SetType(const uno::Reference <beans::XPropertySet>& rPropertie } else { - if ((nCellType == util::NumberFormat::CURRENCY) && !rCurrency.isEmpty() && !sCurrentCurrency.isEmpty() && + if ((nCellType == util::NumberFormat::CURRENCY) && !rCurrency.empty() && !sCurrentCurrency.isEmpty() && sCurrentCurrency != rCurrency && !IsCurrencySymbol(rNumberFormat, sCurrentCurrency, rCurrency)) rProperties->setPropertyValue( gsNumberFormat, uno::makeAny(SetCurrencySymbol(rNumberFormat, rCurrency))); } diff --git a/sc/source/filter/xml/xmlimprt.hxx b/sc/source/filter/xml/xmlimprt.hxx index c1fa72cd7b4d..5591e4e4c7e3 100644 --- a/sc/source/filter/xml/xmlimprt.hxx +++ b/sc/source/filter/xml/xmlimprt.hxx @@ -254,12 +254,12 @@ public: virtual void SetConfigurationSettings(const css::uno::Sequence<css::beans::PropertyValue>& aConfigProps) override; ScMyStylesImportHelper* GetStylesImportHelper() { return pStylesImportHelper.get(); } - sal_Int32 SetCurrencySymbol(const sal_Int32 nKey, const OUString& rCurrency); + sal_Int32 SetCurrencySymbol(const sal_Int32 nKey, std::u16string_view rCurrency); bool IsCurrencySymbol(const sal_Int32 nNumberFormat, const OUString& sCurrencySymbol, std::u16string_view sBankSymbol); void SetType(const css::uno::Reference <css::beans::XPropertySet>& rProperties, sal_Int32& rNumberFormat, const sal_Int16 nCellType, - const OUString& rCurrency); + std::u16string_view rCurrency); void ProgressBarIncrement(); diff --git a/sc/source/ui/condformat/condformathelper.cxx b/sc/source/ui/condformat/condformathelper.cxx index 130785249469..3ae4f301a1a5 100644 --- a/sc/source/ui/condformat/condformathelper.cxx +++ b/sc/source/ui/condformat/condformathelper.cxx @@ -191,7 +191,7 @@ OUString ScCondFormatHelper::GetExpression(const ScConditionalFormat& rFormat, c } OUString ScCondFormatHelper::GetExpression( ScCondFormatEntryType eType, sal_Int32 nIndex, - const OUString& aStr1, const OUString& aStr2 ) + std::u16string_view aStr1, std::u16string_view aStr2 ) { OUStringBuffer aBuffer(getTextForType(eType)); aBuffer.append(" "); diff --git a/sc/source/ui/inc/condformathelper.hxx b/sc/source/ui/inc/condformathelper.hxx index 79de9c7d6d7b..8191c9f18726 100644 --- a/sc/source/ui/inc/condformathelper.hxx +++ b/sc/source/ui/inc/condformathelper.hxx @@ -31,7 +31,7 @@ public: static SC_DLLPUBLIC OUString GetExpression(const ScConditionalFormat& rFormat, const ScAddress& rPos); static SC_DLLPUBLIC OUString GetExpression( ScCondFormatEntryType eType, sal_Int32 nIndex, - const OUString& aStr1 = OUString(), const OUString& aStr2 = OUString() ); + std::u16string_view aStr1 = std::u16string_view(), std::u16string_view aStr2 = std::u16string_view() ); }; #endif diff --git a/sd/source/filter/html/htmlex.cxx b/sd/source/filter/html/htmlex.cxx index 87d90336e554..774edd93b396 100644 --- a/sd/source/filter/html/htmlex.cxx +++ b/sd/source/filter/html/htmlex.cxx @@ -322,9 +322,9 @@ OUString getParagraphStyle( SdrOutliner* pOutliner, sal_Int32 nPara ) return sStyle; } -void lclAppendStyle(OUStringBuffer& aBuffer, const OUString& aTag, const OUString& aStyle) +void lclAppendStyle(OUStringBuffer& aBuffer, std::u16string_view aTag, std::u16string_view aStyle) { - if (aStyle.isEmpty()) + if (aStyle.empty()) aBuffer.append("<").append(aTag).append(">"); else aBuffer.append("<").append(aTag).append(" style=\"").append(aStyle).append("\">"); @@ -652,7 +652,7 @@ void HtmlExport::ExportSingleDocument() sStyle += "page-break-before:always; "; sStyle += getParagraphStyle(pOutliner, 0); - lclAppendStyle(aStr, "h1", sStyle); + lclAppendStyle(aStr, u"h1", sStyle); aStr.append(sTitleText); aStr.append("</h1>\r\n"); @@ -1104,7 +1104,7 @@ bool HtmlExport::CreateHtmlTextForPresPages() // page title OUString sTitleText( CreateTextForTitle(pOutliner,pPage, pPage->GetPageBackgroundColor()) ); - lclAppendStyle(aStr, "h1", getParagraphStyle(pOutliner, 0)); + lclAppendStyle(aStr, u"h1", getParagraphStyle(pOutliner, 0)); aStr.append(sTitleText); aStr.append("</h1>\r\n"); @@ -1348,7 +1348,7 @@ void HtmlExport::WriteOutlinerParagraph(OUStringBuffer& aStr, SdrOutliner* pOutl aStr.append("</ul>\r\n"); nCurrentDepth--; } - lclAppendStyle(aStr, "li", getParagraphStyle(pOutliner, nIndex)); + lclAppendStyle(aStr, u"li", getParagraphStyle(pOutliner, nIndex)); aStr.append(aParaText); aStr.append("</li>\r\n"); } @@ -1381,7 +1381,7 @@ OUString HtmlExport::CreateTextForNotesPage( SdrOutliner* pOutliner, sal_Int32 nCount = pOutliner->GetParagraphCount(); for (sal_Int32 nPara = 0; nPara < nCount; nPara++) { - lclAppendStyle(aStr, "p", getParagraphStyle(pOutliner, nPara)); + lclAppendStyle(aStr, u"p", getParagraphStyle(pOutliner, nPara)); aStr.append(ParagraphToHTMLString(pOutliner, nPara, rBackgroundColor)); aStr.append("</p>\r\n"); } @@ -2098,7 +2098,7 @@ bool HtmlExport::CreateOutlinePages() if (aTitle.isEmpty()) aTitle = maPageNames[nSdPage]; - lclAppendStyle(aStr, "p", getParagraphStyle(pOutliner, 0)); + lclAppendStyle(aStr, u"p", getParagraphStyle(pOutliner, 0)); aStr.append(CreateLink(aLink, aTitle)); aStr.append("</p>"); @@ -2406,7 +2406,7 @@ bool HtmlExport::CreateNavBarFrames() aButton); if(nFile != 0 && mnSdPageCount > 1) - aButton = CreateLink("JavaScript:parent.NavigateAbs(0)", aButton); + aButton = CreateLink(u"JavaScript:parent.NavigateAbs(0)", aButton); aStr.append(aButton); aStr.append("\r\n"); @@ -2419,7 +2419,7 @@ bool HtmlExport::CreateNavBarFrames() aButton); if(nFile != 0 && mnSdPageCount > 1) - aButton = CreateLink("JavaScript:parent.NavigateRel(-1)", aButton); + aButton = CreateLink(u"JavaScript:parent.NavigateRel(-1)", aButton); aStr.append(aButton); aStr.append("\r\n"); @@ -2432,7 +2432,7 @@ bool HtmlExport::CreateNavBarFrames() aButton); if(nFile != 2 && mnSdPageCount > 1) - aButton = CreateLink("JavaScript:parent.NavigateRel(1)", aButton); + aButton = CreateLink(u"JavaScript:parent.NavigateRel(1)", aButton); aStr.append(aButton); aStr.append("\r\n"); @@ -2463,7 +2463,7 @@ bool HtmlExport::CreateNavBarFrames() aButton = CreateImage(GetButtonName(BTN_INDEX), aButton); // to the overview - aStr.append(CreateLink(maIndex, aButton, "_top")); + aStr.append(CreateLink(maIndex, aButton, u"_top")); aStr.append("\r\n"); } @@ -2475,7 +2475,7 @@ bool HtmlExport::CreateNavBarFrames() aButton = CreateImage(GetButtonName(BTN_TEXT), aButton); OUString aText0("text0" + gaHTMLExtension); - aStr.append(CreateLink(aText0, aButton, "_top")); + aStr.append(CreateLink(aText0, aButton, u"_top")); aStr.append("\r\n"); } @@ -2505,7 +2505,7 @@ bool HtmlExport::CreateNavBarFrames() if(mnButtonThema != -1) aButton = CreateImage(GetButtonName(BTN_MORE), aButton); - aStr.append(CreateLink("JavaScript:parent.ExpandOutline()", aButton)); + aStr.append(CreateLink(u"JavaScript:parent.ExpandOutline()", aButton)); aStr.append("</body>\r\n</html>"); bOk = WriteHtml("navbar3", true, aStr.makeStringAndClear()); @@ -2528,7 +2528,7 @@ bool HtmlExport::CreateNavBarFrames() if(mnButtonThema != -1) aButton = CreateImage(GetButtonName(BTN_LESS), aButton); - aStr.append(CreateLink("JavaScript:parent.CollapseOutline()", aButton)); + aStr.append(CreateLink(u"JavaScript:parent.CollapseOutline()", aButton)); aStr.append("</body>\r\n</html>"); bOk = WriteHtml("navbar4", true, aStr.makeStringAndClear()); @@ -2691,13 +2691,13 @@ OUString HtmlExport::CreateBodyTag() const } // creates a hyperlink -OUString HtmlExport::CreateLink( const OUString& aLink, - const OUString& aText, - const OUString& aTarget ) +OUString HtmlExport::CreateLink( std::u16string_view aLink, + std::u16string_view aText, + std::u16string_view aTarget ) { OUStringBuffer aStr( "<a href=\"" ); aStr.append(aLink); - if (!aTarget.isEmpty()) + if (!aTarget.empty()) { aStr.append("\" target=\""); aStr.append(aTarget); @@ -2710,13 +2710,13 @@ OUString HtmlExport::CreateLink( const OUString& aLink, } // creates an image tag -OUString HtmlExport::CreateImage( const OUString& aImage, const OUString& aAltText ) +OUString HtmlExport::CreateImage( std::u16string_view aImage, std::u16string_view aAltText ) { OUStringBuffer aStr( "<img src=\""); aStr.append(aImage); aStr.append("\" border=0"); - if (!aAltText.isEmpty()) + if (!aAltText.empty()) { aStr.append(" alt=\""); aStr.append(aAltText); @@ -2766,7 +2766,7 @@ OUString HtmlExport::CreateHTMLCircleArea( sal_uLong nRadius, // create area for a polygon; we expect pixel coordinates OUString HtmlExport::CreateHTMLPolygonArea( const ::basegfx::B2DPolyPolygon& rPolyPolygon, - Size aShift, double fFactor, const OUString& rHRef ) + Size aShift, double fFactor, std::u16string_view rHRef ) { OUStringBuffer aStr; const sal_uInt32 nNoOfPolygons(rPolyPolygon.count()); diff --git a/sd/source/filter/html/htmlex.hxx b/sd/source/filter/html/htmlex.hxx index 4a7602e93863..8d9ccdc275f9 100644 --- a/sd/source/filter/html/htmlex.hxx +++ b/sd/source/filter/html/htmlex.hxx @@ -168,9 +168,9 @@ class HtmlExport final OUString const & getDocumentTitle(); bool SavePresentation(); - static OUString CreateLink( const OUString& aLink, const OUString& aText, - const OUString& aTarget = OUString()); - static OUString CreateImage( const OUString& aImage, const OUString& aAltText ); + static OUString CreateLink( std::u16string_view aLink, std::u16string_view aText, + std::u16string_view aTarget = std::u16string_view()); + static OUString CreateImage( std::u16string_view aImage, std::u16string_view aAltText ); OUString CreateNavBar( sal_uInt16 nSdPage, bool bIsText ) const; OUString CreateBodyTag() const; @@ -183,7 +183,7 @@ class HtmlExport final static OUString CreateHTMLCircleArea( sal_uLong nRadius, sal_uLong nCenterX, sal_uLong nCenterY, std::u16string_view rHRef ); - static OUString CreateHTMLPolygonArea( const ::basegfx::B2DPolyPolygon& rPolyPoly, Size aShift, double fFactor, const OUString& rHRef ); + static OUString CreateHTMLPolygonArea( const ::basegfx::B2DPolyPolygon& rPolyPoly, Size aShift, double fFactor, std::u16string_view rHRef ); static OUString CreateHTMLRectArea( const ::tools::Rectangle& rRect, std::u16string_view rHRef ); diff --git a/sfx2/source/appl/linkmgr2.cxx b/sfx2/source/appl/linkmgr2.cxx index ed980af3d90a..8d1882c2057a 100644 --- a/sfx2/source/appl/linkmgr2.cxx +++ b/sfx2/source/appl/linkmgr2.cxx @@ -450,7 +450,7 @@ void LinkManager::LinkServerShell(const OUString& rPath, SfxObjectShell& rServer } void LinkManager::InsertFileLink( - sfx2::SvBaseLink& rLink, SvBaseLinkObjectType nFileType, const OUString& rFileNm, + sfx2::SvBaseLink& rLink, SvBaseLinkObjectType nFileType, std::u16string_view rFileNm, const OUString* pFilterNm, const OUString* pRange) { if (!isClientType(rLink.GetObjType())) diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx index c57522ad55e5..61e15c22abfd 100644 --- a/sfx2/source/appl/newhelp.cxx +++ b/sfx2/source/appl/newhelp.cxx @@ -1223,16 +1223,16 @@ void BookmarksTabPage_Impl::AddBookmarks(const OUString& rTitle, const OUString& m_xBookmarksBox->append(rURL, rTitle, SvFileInformationManager::GetImageId(INetURLObject(aImageURL))); } -OUString SfxHelpWindow_Impl::buildHelpURL(const OUString& sFactory , - const OUString& sContent , - const OUString& sAnchor) +OUString SfxHelpWindow_Impl::buildHelpURL(std::u16string_view sFactory , + std::u16string_view sContent , + std::u16string_view sAnchor) { OUStringBuffer sHelpURL(256); sHelpURL.append(HELP_URL); sHelpURL.append(sFactory); sHelpURL.append(sContent); AppendConfigToken(sHelpURL, true/*bUseQuestionMark*/); - if (!sAnchor.isEmpty()) + if (!sAnchor.empty()) sHelpURL.append(sAnchor); return sHelpURL.makeStringAndClear(); } @@ -2303,7 +2303,7 @@ void SfxHelpWindow_Impl::SaveConfig() void SfxHelpWindow_Impl::ShowStartPage() { - loadHelpContent(SfxHelpWindow_Impl::buildHelpURL(xIndexWin->GetFactory(), "/start", OUString())); + loadHelpContent(SfxHelpWindow_Impl::buildHelpURL(xIndexWin->GetFactory(), u"/start", u"")); } IMPL_LINK(SfxHelpWindow_Impl, SelectHdl, const OString&, rCurItem, void) @@ -2339,7 +2339,7 @@ IMPL_LINK_NOARG(SfxHelpWindow_Impl, OpenHdl, LinkParamNone*, void) else aId = aEntry; - sHelpURL = SfxHelpWindow_Impl::buildHelpURL(xIndexWin->GetFactory(), "/" + aId, aAnchor); + sHelpURL = SfxHelpWindow_Impl::buildHelpURL(xIndexWin->GetFactory(), OUString("/" + aId), aAnchor); } loadHelpContent(sHelpURL); diff --git a/sfx2/source/appl/newhelp.hxx b/sfx2/source/appl/newhelp.hxx index 26266a6ee747..c7458b248e3c 100644 --- a/sfx2/source/appl/newhelp.hxx +++ b/sfx2/source/appl/newhelp.hxx @@ -483,9 +483,9 @@ public: void openDone(const OUString& sURL , bool bSuccess); - static OUString buildHelpURL(const OUString& sFactory , - const OUString& sContent , - const OUString& sAnchor); + static OUString buildHelpURL(std::u16string_view sFactory , + std::u16string_view sContent , + std::u16string_view sAnchor); void loadHelpContent(const OUString& sHelpURL , bool bAddToHistory = true); diff --git a/sfx2/source/bastyp/fltfnc.cxx b/sfx2/source/bastyp/fltfnc.cxx index 7d45c06ba176..bd48141ac7f5 100644 --- a/sfx2/source/bastyp/fltfnc.cxx +++ b/sfx2/source/bastyp/fltfnc.cxx @@ -839,14 +839,14 @@ std::shared_ptr<const SfxFilter> SfxFilterMatcherIter::Next() ---------------------------------------------------------------*/ static OUString implc_convertStringlistToString( const uno::Sequence< OUString >& lList , sal_Unicode cSeparator, - const OUString& sPrefix ) + std::u16string_view sPrefix ) { OUStringBuffer sString ( 1000 ) ; sal_Int32 nCount = lList.getLength(); sal_Int32 nItem = 0 ; for( nItem=0; nItem<nCount; ++nItem ) { - if( !sPrefix.isEmpty() ) + if( !sPrefix.empty() ) { sString.append( sPrefix ); } @@ -925,7 +925,7 @@ void SfxFilterContainer::ReadSingleFilter_Impl( { uno::Sequence< OUString > lUserData; rFilterProperty.Value >>= lUserData; - sUserData = implc_convertStringlistToString( lUserData, ',', OUString() ); + sUserData = implc_convertStringlistToString( lUserData, ',', u"" ); } else if ( rFilterProperty.Name == "DocumentService" ) { @@ -972,14 +972,14 @@ void SfxFilterContainer::ReadSingleFilter_Impl( { uno::Sequence< OUString > lExtensions; rTypeProperty.Value >>= lExtensions; - sExtension = implc_convertStringlistToString( lExtensions, ';', "*." ); + sExtension = implc_convertStringlistToString( lExtensions, ';', u"*." ); } } else if ( rTypeProperty.Name == "URLPattern" ) { uno::Sequence< OUString > lPattern; rTypeProperty.Value >>= lPattern; - sPattern = implc_convertStringlistToString( lPattern, ';', OUString() ); + sPattern = implc_convertStringlistToString( lPattern, ';', u"" ); } } } diff --git a/sfx2/source/doc/DocumentMetadataAccess.cxx b/sfx2/source/doc/DocumentMetadataAccess.cxx index 13e4d0bde45b..e030a0dc111b 100644 --- a/sfx2/source/doc/DocumentMetadataAccess.cxx +++ b/sfx2/source/doc/DocumentMetadataAccess.cxx @@ -117,7 +117,7 @@ static bool isReservedFile(std::u16string_view i_rPath) uno::Reference<rdf::XURI> createBaseURI( uno::Reference<uno::XComponentContext> const & i_xContext, uno::Reference<frame::XModel> const & i_xModel, - OUString const & i_rPkgURI, OUString const & i_rSubDocument) + OUString const & i_rPkgURI, std::u16string_view i_rSubDocument) { if (!i_xContext.is() || (!i_xModel.is() && i_rPkgURI.isEmpty())) { throw uno::RuntimeException(); @@ -192,7 +192,7 @@ uno::Reference<rdf::XURI> createBaseURI( } buf.append('/'); } - if (!i_rSubDocument.isEmpty()) + if (!i_rSubDocument.empty()) { buf.append(i_rSubDocument); buf.append('/'); diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx index 7c7511fbfbd4..cdd6030a7c8f 100644 --- a/sfx2/source/view/lokhelper.cxx +++ b/sfx2/source/view/lokhelper.cxx @@ -486,7 +486,7 @@ void SfxLokHelper::notifyWindow(const SfxViewShell* pThisView, pThisView->libreOfficeKitViewCallback(LOK_CALLBACK_WINDOW, s.getStr()); } -void SfxLokHelper::notifyInvalidation(SfxViewShell const* pThisView, const OString& rPayload) +void SfxLokHelper::notifyInvalidation(SfxViewShell const* pThisView, std::string_view rPayload) { OStringBuffer aBuf(32); diff --git a/starmath/inc/visitors.hxx b/starmath/inc/visitors.hxx index ff9ca79261ec..ce2519836844 100644 --- a/starmath/inc/visitors.hxx +++ b/starmath/inc/visitors.hxx @@ -468,7 +468,7 @@ private: * @param rText * @return */ - void Append( const OUString &rText ) { + void Append( std::u16string_view rText ) { maCmdText.append( rText ); } diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx index f21f4448b873..0ccc14b7ff04 100644 --- a/svl/source/numbers/zforlist.cxx +++ b/svl/source/numbers/zforlist.cxx @@ -4406,7 +4406,7 @@ void NfCurrencyEntry::CompleteNegativeFormatString(OUStringBuffer& rStr, bool bB // static -void NfCurrencyEntry::CompletePositiveFormatString(OUStringBuffer& rStr, const OUString& rSymStr, +void NfCurrencyEntry::CompletePositiveFormatString(OUStringBuffer& rStr, std::u16string_view rSymStr, sal_uInt16 nPositiveFormat) { switch( nPositiveFormat ) @@ -4438,7 +4438,7 @@ void NfCurrencyEntry::CompletePositiveFormatString(OUStringBuffer& rStr, const O // static void NfCurrencyEntry::CompleteNegativeFormatString(OUStringBuffer& rStr, - const OUString& rSymStr, + std::u16string_view rSymStr, sal_uInt16 nNegativeFormat) { switch( nNegativeFormat ) diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index c452c25001fa..b0dcad070dd2 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -2160,7 +2160,7 @@ static bool lcl_insertStarFillChar( OUStringBuffer& rBuf, sal_Int32 nPos, const return false; } -void SvNumberformat::GetOutputString(const OUString& sString, +void SvNumberformat::GetOutputString(std::u16string_view sString, OUString& OutString, const Color** ppColor) { diff --git a/svx/inc/DescriptionGenerator.hxx b/svx/inc/DescriptionGenerator.hxx index 5895b310b3fe..daf169f9b478 100644 --- a/svx/inc/DescriptionGenerator.hxx +++ b/svx/inc/DescriptionGenerator.hxx @@ -104,7 +104,7 @@ public: String to append to the current description. It is not modified in any way. */ - void AppendString(const OUString& sString); + void AppendString(std::u16string_view sString); private: /// Reference to the shape from which the properties are extracted. diff --git a/svx/source/accessibility/AccessibleControlShape.cxx b/svx/source/accessibility/AccessibleControlShape.cxx index 79cba1292c2c..b5eda7f92891 100644 --- a/svx/source/accessibility/AccessibleControlShape.cxx +++ b/svx/source/accessibility/AccessibleControlShape.cxx @@ -343,7 +343,7 @@ OUString aDG.Initialize ("Unknown accessible control shape"); if (mxShape.is()) { - aDG.AppendString ("service name="); + aDG.AppendString (u"service name="); aDG.AppendString (mxShape->getShapeType()); } } diff --git a/svx/source/accessibility/DescriptionGenerator.cxx b/svx/source/accessibility/DescriptionGenerator.cxx index 2ed65c5dbf38..2a473ed40563 100644 --- a/svx/source/accessibility/DescriptionGenerator.cxx +++ b/svx/source/accessibility/DescriptionGenerator.cxx @@ -133,7 +133,10 @@ void DescriptionGenerator::AddProperty(const OUString& sPropertyName, PropertyTy } } -void DescriptionGenerator::AppendString(const OUString& sString) { msDescription.append(sString); } +void DescriptionGenerator::AppendString(std::u16string_view sString) +{ + msDescription.append(sString); +} /** Search for the given color in the global color table. If found append its name to the description. Otherwise append its RGB tuple. diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx index ed5d851bf7ad..ccb3b4469b3c 100644 --- a/svx/source/fmcomp/gridcell.cxx +++ b/svx/source/fmcomp/gridcell.cxx @@ -3070,10 +3070,10 @@ IMPL_LINK_NOARG(DbFilterField, OnClick, weld::Button&, void) switch (eState) { case TRISTATE_TRUE: - ::dbtools::getBooleanComparisonPredicate("", true, nBooleanComparisonMode, aTextBuf); + ::dbtools::getBooleanComparisonPredicate(u"", true, nBooleanComparisonMode, aTextBuf); break; case TRISTATE_FALSE: - ::dbtools::getBooleanComparisonPredicate("", false, nBooleanComparisonMode, aTextBuf); + ::dbtools::getBooleanComparisonPredicate(u"", false, nBooleanComparisonMode, aTextBuf); break; case TRISTATE_INDET: break; diff --git a/sw/source/filter/ww8/rtfsdrexport.cxx b/sw/source/filter/ww8/rtfsdrexport.cxx index 3ad34049f247..3bcdebc3cf11 100644 --- a/sw/source/filter/ww8/rtfsdrexport.cxx +++ b/sw/source/filter/ww8/rtfsdrexport.cxx @@ -486,7 +486,7 @@ void RtfSdrExport::AddRectangleDimensions(OStringBuffer& rBuffer, rBuffer.append(OOO_STRING_SVTOOLS_RTF_SHPBOTTOM).append(rRectangle.Bottom()); } -static void lcl_AppendSP(OStringBuffer& rRunText, const char cName[], const OString& rValue) +static void lcl_AppendSP(OStringBuffer& rRunText, const char cName[], std::string_view rValue) { rRunText.append('{') .append(OOO_STRING_SVTOOLS_RTF_SP) diff --git a/unotools/source/config/bootstrap.cxx b/unotools/source/config/bootstrap.cxx index 2188e26aec26..98a2ac802f69 100644 --- a/unotools/source/config/bootstrap.cxx +++ b/unotools/source/config/bootstrap.cxx @@ -420,7 +420,7 @@ static void addFileError(OUStringBuffer& _rBuf, OUString const& _aPath, AsciiStr _rBuf.appendAscii(_sWhat).append(PERIOD); } -static void addMissingDirectoryError(OUStringBuffer& _rBuf, OUString const& _aPath) +static void addMissingDirectoryError(OUStringBuffer& _rBuf, std::u16string_view _aPath) { _rBuf.append("The configuration directory"); _rBuf.append(" '").append(_aPath).append("' "); diff --git a/uui/source/iahndl-errorhandler.cxx b/uui/source/iahndl-errorhandler.cxx index 56f54255d730..c41625522f32 100644 --- a/uui/source/iahndl-errorhandler.cxx +++ b/uui/source/iahndl-errorhandler.cxx @@ -56,13 +56,13 @@ executeErrorDialog( weld::Window* pParent, task::InteractionClassification eClassification, OUString const & rContext, - OUString const & rMessage, + std::u16string_view rMessage, MessageBoxStyle nButtonMask) { SolarMutexGuard aGuard; OUStringBuffer aText(rContext); - if (!rContext.isEmpty() && !rMessage.isEmpty()) + if (!rContext.isEmpty() && !rMessage.empty()) aText.append(":\n"); //TODO! must be internationalized aText.append(rMessage); diff --git a/vcl/inc/printdlg.hxx b/vcl/inc/printdlg.hxx index 60839b07382f..ee3c1896672e 100644 --- a/vcl/inc/printdlg.hxx +++ b/vcl/inc/printdlg.hxx @@ -66,7 +66,7 @@ namespace vcl virtual void Resize() override; void setPreview( const GDIMetaFile&, const Size& i_rPaperSize, - const OUString& i_rPaperName, + std::u16string_view i_rPaperName, const OUString& i_rNoPageString, sal_Int32 i_nDPIX, sal_Int32 i_nDPIY, bool i_bGreyscale diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx index fa9cf9760a78..f232e50a7c7a 100644 --- a/vcl/source/control/field.cxx +++ b/vcl/source/control/field.cxx @@ -364,8 +364,8 @@ bool ImplNumericGetValue( const OUString& rStr, sal_Int64& rValue, } void ImplUpdateSeparatorString( OUString& io_rText, - const OUString& rOldDecSep, const OUString& rNewDecSep, - const OUString& rOldThSep, const OUString& rNewThSep ) + const OUString& rOldDecSep, std::u16string_view rNewDecSep, + const OUString& rOldThSep, std::u16string_view rNewThSep ) { OUStringBuffer aBuf( io_rText.getLength() ); sal_Int32 nIndexDec = 0, nIndexTh = 0, nIndex = 0; @@ -399,8 +399,8 @@ void ImplUpdateSeparatorString( OUString& io_rText, io_rText = aBuf.makeStringAndClear(); } -void ImplUpdateSeparators( const OUString& rOldDecSep, const OUString& rNewDecSep, - const OUString& rOldThSep, const OUString& rNewThSep, +void ImplUpdateSeparators( const OUString& rOldDecSep, std::u16string_view rNewDecSep, + const OUString& rOldThSep, std::u16string_view rNewThSep, Edit* pEdit ) { bool bChangeDec = (rOldDecSep != rNewDecSep); diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx index ecdcaeafa853..f5fac8531094 100644 --- a/vcl/source/window/printdlg.cxx +++ b/vcl/source/window/printdlg.cxx @@ -219,7 +219,7 @@ bool PrintDialog::PrintPreviewWindow::Command( const CommandEvent& rEvt ) void PrintDialog::PrintPreviewWindow::setPreview( const GDIMetaFile& i_rNewPreview, const Size& i_rOrigSize, - const OUString& i_rPaperName, + std::u16string_view i_rPaperName, const OUString& i_rReplacement, sal_Int32 i_nDPIX, sal_Int32 i_nDPIY, @@ -248,7 +248,7 @@ void PrintDialog::PrintPreviewWindow::setPreview( const GDIMetaFile& i_rNewPrevi aBuf.append( aNumText ) .append( u' ' ); aBuf.appendAscii( eUnit == MapUnit::MapMM ? "mm" : "in" ); - if( !i_rPaperName.isEmpty() ) + if( !i_rPaperName.empty() ) { aBuf.append( " (" ); aBuf.append( i_rPaperName ); diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index 9604361fc110..13da5508b236 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -140,7 +140,7 @@ DomainMapper::DomainMapper( const uno::Reference< uno::XComponentContext >& xCon OUString aBaseURL = rMediaDesc.getUnpackedValueOrDefault("URL", OUString()); const uno::Reference<frame::XModel> xModel_(xModel, uno::UNO_QUERY_THROW); - const uno::Reference<rdf::XURI> xBaseURI(sfx2::createBaseURI(xContext, xModel_, aBaseURL, OUString())); + const uno::Reference<rdf::XURI> xBaseURI(sfx2::createBaseURI(xContext, xModel_, aBaseURL, u"")); const uno::Reference<task::XInteractionHandler> xHandler; xDocumentMetadataAccess->loadMetadataFromStorage(xStorage, xBaseURI, xHandler); } diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index dc014457c8d5..2eb09c13d4ec 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -3580,7 +3580,7 @@ void RTFDocumentImpl::setDestination(Destination eDestination) // this is a questionably named method that is used only in a very special // situation where it looks like the "current" buffer is needed? -void RTFDocumentImpl::setDestinationText(OUString const& rString) +void RTFDocumentImpl::setDestinationText(std::u16string_view rString) { m_aStates.top().getDestinationText().setLength(0); m_aStates.top().getDestinationText().append(rString); diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx b/writerfilter/source/rtftok/rtfdocumentimpl.hxx index b1708ca470b5..ffe8a357f6b7 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx @@ -408,7 +408,7 @@ public: explicit RTFParserState(RTFDocumentImpl* pDocumentImpl); - void appendDestinationText(const OUString& rString) + void appendDestinationText(std::u16string_view rString) { if (m_pCurrentDestinationText) m_pCurrentDestinationText->append(rString); @@ -720,7 +720,7 @@ public: return m_xModelFactory; } bool isInBackground(); - void setDestinationText(OUString const& rString); + void setDestinationText(std::u16string_view rString); /// Resolve a picture: If not inline, then anchored. void resolvePict(bool bInline, css::uno::Reference<css::drawing::XShape> const& rShape); diff --git a/xmloff/source/core/DomExport.cxx b/xmloff/source/core/DomExport.cxx index e6362d7678ce..9d26d68b1cee 100644 --- a/xmloff/source/core/DomExport.cxx +++ b/xmloff/source/core/DomExport.cxx @@ -128,7 +128,7 @@ class DomExport: public DomVisitor void pushNamespace(); void addNamespace( const OUString& sPrefix, const OUString& sURI ); OUString qualifiedName( const OUString& sPrefix, const OUString& sURI, - const OUString& sLocalName ); + std::u16string_view sLocalName ); OUString qualifiedName( const Reference<XElement>& ); OUString qualifiedName( const Reference<XAttr>& ); void addAttribute( const Reference<XAttr>& ); @@ -181,7 +181,7 @@ void DomExport::addNamespace( const OUString& sPrefix, const OUString& sURI ) OUString DomExport::qualifiedName( const OUString& sPrefix, const OUString& sURI, - const OUString& sLocalName ) + std::u16string_view sLocalName ) { OUStringBuffer sBuffer; if( !sPrefix.isEmpty() && !sURI.isEmpty() ) diff --git a/xmloff/source/style/xmlnumfe.cxx b/xmloff/source/style/xmlnumfe.cxx index 9be8b434df31..b961eb2620f5 100644 --- a/xmloff/source/style/xmlnumfe.cxx +++ b/xmloff/source/style/xmlnumfe.cxx @@ -273,7 +273,7 @@ SvXMLNumFmtExport::~SvXMLNumFmtExport() // helper methods -static OUString lcl_CreateStyleName( sal_Int32 nKey, sal_Int32 nPart, bool bDefPart, const OUString& rPrefix ) +static OUString lcl_CreateStyleName( sal_Int32 nKey, sal_Int32 nPart, bool bDefPart, std::u16string_view rPrefix ) { OUStringBuffer aFmtName(10); aFmtName.append( rPrefix ); @@ -313,7 +313,7 @@ void SvXMLNumFmtExport::AddLanguageAttr_Impl( LanguageType nLang ) // methods to write individual elements within a format -void SvXMLNumFmtExport::AddToTextElement_Impl( const OUString& rString ) +void SvXMLNumFmtExport::AddToTextElement_Impl( std::u16string_view rString ) { // append to sTextContent, write element in FinishTextElement_Impl // to avoid several text elements following each other @@ -899,7 +899,7 @@ bool SvXMLNumFmtExport::WriteTextWithCurrency_Impl( const OUString& rString, // text before currency symbol if ( nPos > 0 ) { - AddToTextElement_Impl( rString.copy( 0, nPos ) ); + AddToTextElement_Impl( rString.subView( 0, nPos ) ); } // currency symbol (empty string -> default) WriteCurrencyElement_Impl( "", "" ); @@ -908,7 +908,7 @@ bool SvXMLNumFmtExport::WriteTextWithCurrency_Impl( const OUString& rString, // text after currency symbol if ( nCont < nLength ) { - AddToTextElement_Impl( rString.copy( nCont, nLength-nCont ) ); + AddToTextElement_Impl( rString.subView( nCont, nLength-nCont ) ); } } else diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx index 652ff02b6a2b..b33715726b92 100644 --- a/xmloff/source/style/xmlnumfi.cxx +++ b/xmloff/source/style/xmlnumfi.cxx @@ -1064,9 +1064,9 @@ void SvXMLNumFmtElementContext::endFastElement(sal_Int32 ) rParent.AddNumber( aNumInfo ); // simple number if ( aNumInfo.bExpSign ) - rParent.AddToCode( "E+" ); + rParent.AddToCode( u"E+" ); else - rParent.AddToCode( "E" ); + rParent.AddToCode( u"E" ); for (sal_Int32 i=0; i<aNumInfo.nExpDigits; i++) { rParent.AddToCode( '0' ); @@ -1621,7 +1621,7 @@ void SvXMLNumFormatContext::AddToCode( sal_Unicode c ) bHasExtraText = true; } -void SvXMLNumFormatContext::AddToCode( const OUString& rString ) +void SvXMLNumFormatContext::AddToCode( std::u16string_view rString ) { aFormatCode.append( rString ); bHasExtraText = true; diff --git a/xmloff/source/text/XMLTextListAutoStylePool.cxx b/xmloff/source/text/XMLTextListAutoStylePool.cxx index 2779e41d6ba9..d2744cb18a38 100644 --- a/xmloff/source/text/XMLTextListAutoStylePool.cxx +++ b/xmloff/source/text/XMLTextListAutoStylePool.cxx @@ -54,7 +54,7 @@ public: sal_uInt32 nPos, const Reference < XIndexReplace > & rNumRules, XMLTextListAutoStylePoolNames_Impl& rNames, - const OUString& rPrefix, + std::u16string_view rPrefix, sal_uInt32& rName ); explicit XMLTextListAutoStylePoolEntry_Impl( @@ -90,7 +90,7 @@ XMLTextListAutoStylePoolEntry_Impl::XMLTextListAutoStylePoolEntry_Impl( sal_uInt32 nP, const Reference < XIndexReplace > & rNumRules, XMLTextListAutoStylePoolNames_Impl& rNames, - const OUString& rPrefix, + std::u16string_view rPrefix, sal_uInt32& rName ) : xNumRules( rNumRules ), nPos( nP ), |