diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-05-08 21:28:07 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-05-12 17:00:59 +0200 |
commit | cae37f77232f142f5d27c945715a9d3f6e06a9e2 (patch) | |
tree | b1ba969a4973438dfd5f77d41faef6eb7032d5ae | |
parent | 52a06992f1404a4b85f99aedd75377fd60a489b9 (diff) |
replace createFromAscii with OUString literals in SvxStyleToolBoxControl
Change-Id: Ibdf5f7b0100cafbecc263a038b2234012da10fff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167543
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | svx/source/tbxctrls/tbcontrl.cxx | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index 309f3e403b94..e7001b9bfba3 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -2974,7 +2974,7 @@ struct SvxStyleToolBoxControl::Impl Reference<container::XNameAccess> xParaStyles; xStylesSupplier->getStyleFamilies()->getByName(u"ParagraphStyles"_ustr) >>= xParaStyles; - static const std::vector<OUString> aWriterStyles = + static constexpr OUString aWriterStyles[] { u"Standard"_ustr, u"Text body"_ustr, @@ -3008,23 +3008,22 @@ struct SvxStyleToolBoxControl::Impl bSpecModeCalc = xServices->supportsService( u"com.sun.star.sheet.SpreadsheetDocument"_ustr))) { - static const char* aCalcStyles[] = + static constexpr OUString aCalcStyles[] { - "Default", - "Accent 1", - "Accent 2", - "Accent 3", - "Heading 1", - "Heading 2", - "Result" + u"Default"_ustr, + u"Accent 1"_ustr, + u"Accent 2"_ustr, + u"Accent 3"_ustr, + u"Heading 1"_ustr, + u"Heading 2"_ustr, + u"Result"_ustr }; Reference<container::XNameAccess> xCellStyles; xStylesSupplier->getStyleFamilies()->getByName(u"CellStyles"_ustr) >>= xCellStyles; - for(const char* pCalcStyle : aCalcStyles) + for(const OUString & sStyleName : aCalcStyles) { try { - const OUString sStyleName( OUString::createFromAscii( pCalcStyle ) ); if( xCellStyles->hasByName( sStyleName ) ) { Reference< beans::XPropertySet > xStyle( xCellStyles->getByName( sStyleName), UNO_QUERY_THROW ); |