connectivity/source/commontools/dbtools2.cxx | 2 - cui/source/customize/CustomNotebookbarGenerator.cxx | 4 +- framework/source/uiconfiguration/imagemanagerimpl.cxx | 28 +++++++++--------- include/unotools/confignode.hxx | 5 --- sfx2/source/dialog/filtergrouping.cxx | 4 +- sfx2/source/notebookbar/SfxNotebookBar.cxx | 2 - uui/source/iahndl.cxx | 2 - 7 files changed, 21 insertions(+), 26 deletions(-)
New commits: commit 9dac3118ee80bea900cede71e4ef616bad165401 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Wed May 8 10:36:51 2024 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Sat May 11 23:05:30 2024 +0200 replace createFromAscii with OUString literals in OConfigurationNode Change-Id: I6029cd4c894c6ab079cc508ba15df41ec5d4f8db Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167516 Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> Tested-by: Jenkins diff --git a/connectivity/source/commontools/dbtools2.cxx b/connectivity/source/commontools/dbtools2.cxx index f43cd2f77d89..e6088c513711 100644 --- a/connectivity/source/commontools/dbtools2.cxx +++ b/connectivity/source/commontools/dbtools2.cxx @@ -950,7 +950,7 @@ OUString getDefaultReportEngineServiceName(const Reference< XComponentContext >& aReportEngines.getNodeValue("DefaultReportEngine") >>= sDefaultReportEngineName; if ( !sDefaultReportEngineName.isEmpty() ) { - ::utl::OConfigurationNode aReportEngineNames = aReportEngines.openNode("ReportEngineNames"); + ::utl::OConfigurationNode aReportEngineNames = aReportEngines.openNode(u"ReportEngineNames"_ustr); if ( aReportEngineNames.isValid() ) { ::utl::OConfigurationNode aReportEngine = aReportEngineNames.openNode(sDefaultReportEngineName); diff --git a/cui/source/customize/CustomNotebookbarGenerator.cxx b/cui/source/customize/CustomNotebookbarGenerator.cxx index 20610dc9b096..df065fb81e7b 100644 --- a/cui/source/customize/CustomNotebookbarGenerator.cxx +++ b/cui/source/customize/CustomNotebookbarGenerator.cxx @@ -258,7 +258,7 @@ Sequence<OUString> CustomNotebookbarGenerator::getCustomizedUIItem(OUString sNot const utl::OConfigurationTreeRoot aAppNode(::comphelper::getProcessComponentContext(), aPath, false); - const utl::OConfigurationNode aModesNode = aAppNode.openNode("Modes"); + const utl::OConfigurationNode aModesNode = aAppNode.openNode(u"Modes"_ustr); const utl::OConfigurationNode aModeNode(aModesNode.openNode(sNotebookbarConfigType)); const Any aValue = aModeNode.getNodeValue("UIItemProperties"); Sequence<OUString> aValues; @@ -272,7 +272,7 @@ void CustomNotebookbarGenerator::setCustomizedUIItem(const Sequence<OUString>& r OUString aPath = getAppNameRegistryPath(); const utl::OConfigurationTreeRoot aAppNode(::comphelper::getProcessComponentContext(), aPath, true); - const utl::OConfigurationNode aModesNode = aAppNode.openNode("Modes"); + const utl::OConfigurationNode aModesNode = aAppNode.openNode(u"Modes"_ustr); const utl::OConfigurationNode aModeNode(aModesNode.openNode(rNotebookbarConfigType)); css::uno::Any aUIItemProperties(rUIItemProperties); diff --git a/include/unotools/confignode.hxx b/include/unotools/confignode.hxx index 946825aa4821..c95acd8bdbdb 100644 --- a/include/unotools/confignode.hxx +++ b/include/unotools/confignode.hxx @@ -81,11 +81,6 @@ namespace utl */ OConfigurationNode openNode(const OUString& _rPath) const noexcept; - OConfigurationNode openNode( const char* _pAsciiPath ) const - { - return openNode( OUString::createFromAscii( _pAsciiPath ) ); - } - /** create a new child node If the object represents a set node, this method may be used to create a new child. For non-set-nodes, the diff --git a/sfx2/source/dialog/filtergrouping.cxx b/sfx2/source/dialog/filtergrouping.cxx index e4f210c59765..dfa9d0295466 100644 --- a/sfx2/source/dialog/filtergrouping.cxx +++ b/sfx2/source/dialog/filtergrouping.cxx @@ -254,7 +254,7 @@ namespace sfx2 // go for all the single class entries OConfigurationNode aFilterClassesNode = - _rFilterClassification.openNode( "GlobalFilters/Classes" ); + _rFilterClassification.openNode( u"GlobalFilters/Classes"_ustr ); const Sequence< OUString > aFilterClasses = aFilterClassesNode.getNodeNames(); ::std::for_each( aFilterClasses.begin(), @@ -298,7 +298,7 @@ namespace sfx2 // the node for the local classes OConfigurationNode aFilterClassesNode = - _rFilterClassification.openNode( "LocalFilters/Classes" ); + _rFilterClassification.openNode( u"LocalFilters/Classes"_ustr ); const Sequence< OUString > aFilterClasses = aFilterClassesNode.getNodeNames(); ::std::for_each( diff --git a/sfx2/source/notebookbar/SfxNotebookBar.cxx b/sfx2/source/notebookbar/SfxNotebookBar.cxx index 3fa8ea694626..4866db50c866 100644 --- a/sfx2/source/notebookbar/SfxNotebookBar.cxx +++ b/sfx2/source/notebookbar/SfxNotebookBar.cxx @@ -354,7 +354,7 @@ bool SfxNotebookBar::IsActive(bool bConsiderSingleToolbar) if (comphelper::LibreOfficeKit::isActive() && aActive == "notebookbar_online.ui") return true; - const utl::OConfigurationNode aModesNode = aAppNode.openNode("Modes"); + const utl::OConfigurationNode aModesNode = aAppNode.openNode(u"Modes"_ustr); const Sequence<OUString> aModeNodeNames( aModesNode.getNodeNames() ); for ( const auto& rModeNodeName : aModeNodeNames ) diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx index 291d3f18e844..2f039a85fc67 100644 --- a/uui/source/iahndl.cxx +++ b/uui/source/iahndl.cxx @@ -334,7 +334,7 @@ bool UUIInteractionHelper::handleTypedHandlerImplementations( Reference< XIntera for ( auto const & handlerName : aRegisteredHandlers ) { const ::utl::OConfigurationNode aHandlerNode( aConfigRoot.openNode( handlerName ) ); - const ::utl::OConfigurationNode aTypesNode( aHandlerNode.openNode( "HandledRequestTypes" ) ); + const ::utl::OConfigurationNode aTypesNode( aHandlerNode.openNode( u"HandledRequestTypes"_ustr ) ); // loop through all the types which the current handler is registered for const Sequence< OUString > aHandledTypes( aTypesNode.getNodeNames() ); commit 18c4a2592e650c71f11d0443a3eb9b262c176c3a Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Wed May 8 10:03:11 2024 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Sat May 11 23:05:22 2024 +0200 replace createFromAscii with OUString literals in ImageManagerImpl Change-Id: I995f3f565c01ba85ae470c506facb1f6e5d517a0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167515 Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> Tested-by: Jenkins diff --git a/framework/source/uiconfiguration/imagemanagerimpl.cxx b/framework/source/uiconfiguration/imagemanagerimpl.cxx index 43fa3683f91f..31deab1fc15c 100644 --- a/framework/source/uiconfiguration/imagemanagerimpl.cxx +++ b/framework/source/uiconfiguration/imagemanagerimpl.cxx @@ -67,18 +67,18 @@ const sal_Int16 MAX_IMAGETYPE_VALUE = css::ui::ImageType::SIZE_32; constexpr OUString IMAGE_FOLDER = u"images"_ustr; constexpr OUString BITMAPS_FOLDER = u"Bitmaps"_ustr; -const o3tl::enumarray<vcl::ImageType, const char*> IMAGELIST_XML_FILE = +constexpr o3tl::enumarray<vcl::ImageType, OUString> IMAGELIST_XML_FILE { - "sc_imagelist.xml", - "lc_imagelist.xml", - "xc_imagelist.xml" + u"sc_imagelist.xml"_ustr, + u"lc_imagelist.xml"_ustr, + u"xc_imagelist.xml"_ustr }; -const o3tl::enumarray<vcl::ImageType, const char*> BITMAP_FILE_NAMES = +constexpr o3tl::enumarray<vcl::ImageType, OUString> BITMAP_FILE_NAMES { - "sc_userimages.png", - "lc_userimages.png", - "xc_userimages.png" + u"sc_userimages.png"_ustr, + u"lc_userimages.png"_ustr, + u"xc_userimages.png"_ustr }; namespace framework @@ -300,7 +300,7 @@ void ImageManagerImpl::implts_loadUserImages( { try { - uno::Reference< XStream > xStream = xUserImageStorage->openStreamElement( OUString::createFromAscii( IMAGELIST_XML_FILE[nImageType] ), + uno::Reference< XStream > xStream = xUserImageStorage->openStreamElement( IMAGELIST_XML_FILE[nImageType], ElementModes::READ ); uno::Reference< XInputStream > xInputStream = xStream->getInputStream(); @@ -320,7 +320,7 @@ void ImageManagerImpl::implts_loadUserImages( } uno::Reference< XStream > xBitmapStream = xUserBitmapsStorage->openStreamElement( - OUString::createFromAscii( BITMAP_FILE_NAMES[nImageType] ), + BITMAP_FILE_NAMES[nImageType], ElementModes::READ ); if ( xBitmapStream.is() ) @@ -385,12 +385,12 @@ bool ImageManagerImpl::implts_storeUserImages( uno::Reference< XTransactedObject > xTransaction; uno::Reference< XOutputStream > xOutputStream; - uno::Reference< XStream > xStream = xUserImageStorage->openStreamElement( OUString::createFromAscii( IMAGELIST_XML_FILE[nImageType] ), + uno::Reference< XStream > xStream = xUserImageStorage->openStreamElement( IMAGELIST_XML_FILE[nImageType], ElementModes::WRITE|ElementModes::TRUNCATE ); if ( xStream.is() ) { uno::Reference< XStream > xBitmapStream = - xUserBitmapsStorage->openStreamElement( OUString::createFromAscii( BITMAP_FILE_NAMES[nImageType] ), + xUserBitmapsStorage->openStreamElement( BITMAP_FILE_NAMES[nImageType], ElementModes::WRITE|ElementModes::TRUNCATE ); if ( xBitmapStream.is() ) { @@ -425,7 +425,7 @@ bool ImageManagerImpl::implts_storeUserImages( // the NoSuchElementException as it can be possible that there is no stream at all! try { - xUserImageStorage->removeElement( OUString::createFromAscii( IMAGELIST_XML_FILE[nImageType] )); + xUserImageStorage->removeElement( IMAGELIST_XML_FILE[nImageType] ); } catch ( const css::container::NoSuchElementException& ) { @@ -433,7 +433,7 @@ bool ImageManagerImpl::implts_storeUserImages( try { - xUserBitmapsStorage->removeElement( OUString::createFromAscii( BITMAP_FILE_NAMES[nImageType] )); + xUserBitmapsStorage->removeElement( BITMAP_FILE_NAMES[nImageType] ); } catch ( const css::container::NoSuchElementException& ) {