basic/source/classes/sb.cxx | 2 basic/source/classes/sbunoobj.cxx | 10 +- chart2/source/controller/main/ChartController_Insert.cxx | 2 chart2/source/controller/main/ChartController_Properties.cxx | 20 ++-- chart2/source/controller/main/ObjectHierarchy.cxx | 12 +- chart2/source/controller/main/SelectionHelper.cxx | 8 - chart2/source/controller/sidebar/ChartAreaPanel.cxx | 2 chart2/source/inc/ObjectIdentifier.hxx | 24 ++--- chart2/source/tools/ObjectIdentifier.cxx | 40 ++++----- chart2/source/view/charttypes/CandleStickChart.cxx | 4 chart2/source/view/diagram/VDiagram.cxx | 6 - chart2/source/view/main/ChartView.cxx | 2 chart2/source/view/main/VDataSeries.cxx | 2 codemaker/source/commonjava/commonjava.cxx | 2 codemaker/source/javamaker/javatype.cxx | 4 comphelper/source/misc/string.cxx | 2 compilerplugins/clang/stringviewparam.cxx | 34 +++++++- compilerplugins/clang/test/stringviewparam.cxx | 8 + configmgr/source/access.cxx | 4 configmgr/source/data.cxx | 4 configmgr/source/data.hxx | 2 connectivity/source/commontools/dbtools.cxx | 2 connectivity/source/commontools/filtermanager.cxx | 2 connectivity/source/drivers/firebird/Blob.cxx | 10 +- connectivity/source/drivers/firebird/Connection.cxx | 18 ++-- connectivity/source/drivers/firebird/PreparedStatement.cxx | 16 +-- connectivity/source/drivers/firebird/ResultSet.cxx | 2 connectivity/source/drivers/firebird/StatementCommonBase.cxx | 14 +-- connectivity/source/drivers/firebird/Util.cxx | 4 connectivity/source/drivers/firebird/Util.hxx | 4 connectivity/source/drivers/hsqldb/HTools.cxx | 8 - connectivity/source/inc/hsqldb/HTools.hxx | 4 cppu/source/uno/lbmap.cxx | 6 - dbaccess/qa/unit/embeddeddb_performancetest.cxx | 24 ++--- dbaccess/source/core/api/OptimisticSet.cxx | 2 dbaccess/source/core/api/SingleSelectQueryComposer.cxx | 6 - dbaccess/source/core/recovery/settingsimport.cxx | 2 dbaccess/source/core/recovery/settingsimport.hxx | 2 dbaccess/source/filter/hsqldb/fbcreateparser.cxx | 14 +-- dbaccess/source/filter/hsqldb/hsqlimport.cxx | 5 - dbaccess/source/filter/hsqldb/hsqlimport.hxx | 2 desktop/source/app/dispatchwatcher.cxx | 2 desktop/source/deployment/gui/dp_gui_updatedialog.cxx | 6 - extensions/source/propctrlr/formcomponenthandler.cxx | 4 extensions/source/propctrlr/formcomponenthandler.hxx | 2 framework/inc/recording/dispatchrecorder.hxx | 2 framework/source/accelerators/documentacceleratorconfiguration.cxx | 4 framework/source/accelerators/presethandler.cxx | 4 framework/source/inc/accelerators/presethandler.hxx | 4 framework/source/recording/dispatchrecorder.cxx | 2 include/basic/sbstar.hxx | 2 include/codemaker/commonjava.hxx | 2 include/comphelper/stl_types.hxx | 2 include/comphelper/string.hxx | 2 include/connectivity/dbtools.hxx | 2 include/connectivity/filtermanager.hxx | 2 include/oox/core/contexthandler2.hxx | 2 include/oox/dump/dumperbase.hxx | 2 include/oox/ole/vbamodule.hxx | 2 include/sfx2/DocumentMetadataAccess.hxx | 2 include/sfx2/linkmgr.hxx | 2 include/sfx2/lokhelper.hxx | 2 include/svl/zforlist.hxx | 4 include/svl/zformat.hxx | 2 include/xmloff/xmlnumfe.hxx | 2 include/xmloff/xmlnumfi.hxx | 2 jvmfwk/inc/fwkbase.hxx | 2 jvmfwk/source/fwkbase.cxx | 6 - l10ntools/source/localize.cxx | 2 oox/source/core/contexthandler2.cxx | 2 oox/source/dump/dumperbase.cxx | 12 +- oox/source/ole/vbamodule.cxx | 4 registry/source/keyimpl.cxx | 28 +++--- registry/source/keyimpl.hxx | 14 +-- registry/source/regimpl.cxx | 12 +- registry/source/regimpl.hxx | 6 - registry/source/registry.cxx | 2 registry/source/regkey.cxx | 30 +++---- sax/source/fastparser/fastparser.cxx | 2 sc/inc/dputil.hxx | 2 sc/inc/global.hxx | 2 sc/qa/unit/helper/qahelper.cxx | 10 ++ sc/qa/unit/helper/qahelper.hxx | 4 sc/source/core/data/dptabres.cxx | 2 sc/source/core/data/dputil.cxx | 2 sc/source/core/data/global.cxx | 4 sc/source/core/tool/address.cxx | 2 sc/source/core/tool/compiler.cxx | 2 sc/source/filter/excel/excdoc.cxx | 4 sc/source/filter/excel/xeescher.cxx | 2 sc/source/filter/excel/xltools.cxx | 4 sc/source/filter/inc/xeescher.hxx | 2 sc/source/filter/inc/xltools.hxx | 2 sc/source/filter/oox/querytablebuffer.cxx | 4 sc/source/filter/oox/stylesbuffer.cxx | 6 - sc/source/filter/xml/xmlimprt.cxx | 8 - sc/source/filter/xml/xmlimprt.hxx | 4 sc/source/ui/condformat/condformathelper.cxx | 2 sc/source/ui/inc/condformathelper.hxx | 2 sd/source/filter/html/htmlex.cxx | 42 +++++----- sd/source/filter/html/htmlex.hxx | 8 - sfx2/source/appl/linkmgr2.cxx | 2 sfx2/source/appl/newhelp.cxx | 12 +- sfx2/source/appl/newhelp.hxx | 6 - sfx2/source/bastyp/fltfnc.cxx | 10 +- sfx2/source/doc/DocumentMetadataAccess.cxx | 4 sfx2/source/view/lokhelper.cxx | 2 starmath/inc/visitors.hxx | 2 svl/source/numbers/zforlist.cxx | 4 svl/source/numbers/zformat.cxx | 2 svx/inc/DescriptionGenerator.hxx | 2 svx/source/accessibility/AccessibleControlShape.cxx | 2 svx/source/accessibility/DescriptionGenerator.cxx | 5 - svx/source/fmcomp/gridcell.cxx | 4 sw/source/filter/ww8/rtfsdrexport.cxx | 2 unotools/source/config/bootstrap.cxx | 2 uui/source/iahndl-errorhandler.cxx | 4 vcl/inc/printdlg.hxx | 2 vcl/source/control/field.cxx | 8 - vcl/source/window/printdlg.cxx | 4 writerfilter/source/dmapper/DomainMapper.cxx | 2 writerfilter/source/rtftok/rtfdocumentimpl.cxx | 2 writerfilter/source/rtftok/rtfdocumentimpl.hxx | 4 xmloff/source/core/DomExport.cxx | 4 xmloff/source/style/xmlnumfe.cxx | 8 - xmloff/source/style/xmlnumfi.cxx | 6 - xmloff/source/text/XMLTextListAutoStylePool.cxx | 4 127 files changed, 404 insertions(+), 352 deletions(-)
New commits: commit 1250aecd71fabde4dba990bfceb61bbe8e06b8ea Author: Noel <noel.gran...@collabora.co.uk> AuthorDate: Thu Jan 28 20:29:16 2021 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Fri Jan 29 09:25:12 2021 +0100 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.gran...@collabora.co.uk> 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)); ... etc. - the rest is truncated _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits