summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2024-05-08 10:03:11 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2024-05-11 23:05:22 +0200
commit18c4a2592e650c71f11d0443a3eb9b262c176c3a (patch)
tree22351044fd9505824ac13b3c9e614e2f09efc793
parentDrop now unused SdOptionsZoom class (diff)
downloadcore-18c4a2592e650c71f11d0443a3eb9b262c176c3a.tar.gz
core-18c4a2592e650c71f11d0443a3eb9b262c176c3a.zip
replace createFromAscii with OUString literals in ImageManagerImpl
Change-Id: I995f3f565c01ba85ae470c506facb1f6e5d517a0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167515 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
-rw-r--r--framework/source/uiconfiguration/imagemanagerimpl.cxx28
1 files changed, 14 insertions, 14 deletions
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& )
{