svx/source/form/formcontrolfactory.cxx |  263 ++++++++++++++++-----------------
 1 file changed, 128 insertions(+), 135 deletions(-)

New commits:
commit 544bc99ba834263a6800c05bbd08df3cca3a6e1a
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Thu May 2 13:38:49 2024 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Fri May 3 19:34:33 2024 +0200

    replace createFromAscii with OUString literals in svx
    
    Change-Id: I9d3b6b99ea5ca9f6d17729ae55cd4c3bad75ada1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167061
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/svx/source/form/formcontrolfactory.cxx 
b/svx/source/form/formcontrolfactory.cxx
index dc879a084802..540c4e80e7de 100644
--- a/svx/source/form/formcontrolfactory.cxx
+++ b/svx/source/form/formcontrolfactory.cxx
@@ -204,135 +204,134 @@ namespace svxform
         }
 
 
-        const char* aCharacterAndParagraphProperties[] =
+        constexpr OUString aCharacterAndParagraphProperties[]
         {
-            "CharFontName",
-            "CharFontStyleName",
-            "CharFontFamily",
-            "CharFontCharSet",
-            "CharFontPitch",
-            "CharColor",
-            "CharEscapement",
-            "CharHeight",
-            "CharUnderline",
-            "CharWeight",
-            "CharPosture",
-            "CharAutoKerning",
-            "CharBackColor",
-            "CharBackTransparent",
-            "CharCaseMap",
-            "CharCrossedOut",
-            "CharFlash",
-            "CharStrikeout",
-            "CharWordMode",
-            "CharKerning",
-            "CharLocale",
-            "CharKeepTogether",
-            "CharNoLineBreak",
-            "CharShadowed",
-            "CharFontType",
-            "CharStyleName",
-            "CharContoured",
-            "CharCombineIsOn",
-            "CharCombinePrefix",
-            "CharCombineSuffix",
-            "CharEmphasize",
-            "CharRelief",
-            "RubyText",
-            "RubyAdjust",
-            "RubyCharStyleName",
-            "RubyIsAbove",
-            "CharRotation",
-            "CharRotationIsFitToLine",
-            "CharScaleWidth",
-            "HyperLinkURL",
-            "HyperLinkTarget",
-            "HyperLinkName",
-            "VisitedCharStyleName",
-            "UnvisitedCharStyleName",
-            "CharEscapementHeight",
-            "CharNoHyphenation",
-            "CharUnderlineColor",
-            "CharUnderlineHasColor",
-            "CharStyleNames",
-            "CharHeightAsian",
-            "CharWeightAsian",
-            "CharFontNameAsian",
-            "CharFontStyleNameAsian",
-            "CharFontFamilyAsian",
-            "CharFontCharSetAsian",
-            "CharFontPitchAsian",
-            "CharPostureAsian",
-            "CharLocaleAsian",
-            "ParaIsCharacterDistance",
-            "ParaIsForbiddenRules",
-            "ParaIsHangingPunctuation",
-            "CharHeightComplex",
-            "CharWeightComplex",
-            "CharFontNameComplex",
-            "CharFontStyleNameComplex",
-            "CharFontFamilyComplex",
-            "CharFontCharSetComplex",
-            "CharFontPitchComplex",
-            "CharPostureComplex",
-            "CharLocaleComplex",
-            "ParaAdjust",
-            "ParaLineSpacing",
-            "ParaBackColor",
-            "ParaBackTransparent",
-            "ParaBackGraphic",
-            "ParaBackGraphicURL",
-            "ParaBackGraphicFilter",
-            "ParaBackGraphicLocation",
-            "ParaLastLineAdjust",
-            "ParaExpandSingleWord",
-            "ParaLeftMargin",
-            "ParaRightMargin",
-            "ParaTopMargin",
-            "ParaBottomMargin",
-            "ParaLineNumberCount",
-            "ParaLineNumberStartValue",
-            "PageDescName",
-            "PageNumberOffset",
-            "ParaRegisterModeActive",
-            "ParaTabStops",
-            "ParaStyleName",
-            "DropCapFormat",
-            "DropCapWholeWord",
-            "ParaKeepTogether",
-            "Setting",
-            "ParaSplit",
-            "Setting",
-            "NumberingLevel",
-            "NumberingRules",
-            "NumberingStartValue",
-            "ParaIsNumberingRestart",
-            "NumberingStyleName",
-            "ParaOrphans",
-            "ParaWidows",
-            "ParaShadowFormat",
-            "LeftBorder",
-            "RightBorder",
-            "TopBorder",
-            "BottomBorder",
-            "BorderDistance",
-            "LeftBorderDistance",
-            "RightBorderDistance",
-            "TopBorderDistance",
-            "BottomBorderDistance",
-            "BreakType",
-            "DropCapCharStyleName",
-            "ParaFirstLineIndent",
-            "ParaIsAutoFirstLineIndent",
-            "ParaIsHyphenation",
-            "ParaHyphenationMaxHyphens",
-            "ParaHyphenationMaxLeadingChars",
-            "ParaHyphenationMaxTrailingChars",
-            "ParaVertAlignment",
-            "ParaUserDefinedAttributes",
-            "NumberingIsNumber",
-            "ParaIsConnectBorder",
-            nullptr
+            u"CharFontName"_ustr,
+            u"CharFontStyleName"_ustr,
+            u"CharFontFamily"_ustr,
+            u"CharFontCharSet"_ustr,
+            u"CharFontPitch"_ustr,
+            u"CharColor"_ustr,
+            u"CharEscapement"_ustr,
+            u"CharHeight"_ustr,
+            u"CharUnderline"_ustr,
+            u"CharWeight"_ustr,
+            u"CharPosture"_ustr,
+            u"CharAutoKerning"_ustr,
+            u"CharBackColor"_ustr,
+            u"CharBackTransparent"_ustr,
+            u"CharCaseMap"_ustr,
+            u"CharCrossedOut"_ustr,
+            u"CharFlash"_ustr,
+            u"CharStrikeout"_ustr,
+            u"CharWordMode"_ustr,
+            u"CharKerning"_ustr,
+            u"CharLocale"_ustr,
+            u"CharKeepTogether"_ustr,
+            u"CharNoLineBreak"_ustr,
+            u"CharShadowed"_ustr,
+            u"CharFontType"_ustr,
+            u"CharStyleName"_ustr,
+            u"CharContoured"_ustr,
+            u"CharCombineIsOn"_ustr,
+            u"CharCombinePrefix"_ustr,
+            u"CharCombineSuffix"_ustr,
+            u"CharEmphasize"_ustr,
+            u"CharRelief"_ustr,
+            u"RubyText"_ustr,
+            u"RubyAdjust"_ustr,
+            u"RubyCharStyleName"_ustr,
+            u"RubyIsAbove"_ustr,
+            u"CharRotation"_ustr,
+            u"CharRotationIsFitToLine"_ustr,
+            u"CharScaleWidth"_ustr,
+            u"HyperLinkURL"_ustr,
+            u"HyperLinkTarget"_ustr,
+            u"HyperLinkName"_ustr,
+            u"VisitedCharStyleName"_ustr,
+            u"UnvisitedCharStyleName"_ustr,
+            u"CharEscapementHeight"_ustr,
+            u"CharNoHyphenation"_ustr,
+            u"CharUnderlineColor"_ustr,
+            u"CharUnderlineHasColor"_ustr,
+            u"CharStyleNames"_ustr,
+            u"CharHeightAsian"_ustr,
+            u"CharWeightAsian"_ustr,
+            u"CharFontNameAsian"_ustr,
+            u"CharFontStyleNameAsian"_ustr,
+            u"CharFontFamilyAsian"_ustr,
+            u"CharFontCharSetAsian"_ustr,
+            u"CharFontPitchAsian"_ustr,
+            u"CharPostureAsian"_ustr,
+            u"CharLocaleAsian"_ustr,
+            u"ParaIsCharacterDistance"_ustr,
+            u"ParaIsForbiddenRules"_ustr,
+            u"ParaIsHangingPunctuation"_ustr,
+            u"CharHeightComplex"_ustr,
+            u"CharWeightComplex"_ustr,
+            u"CharFontNameComplex"_ustr,
+            u"CharFontStyleNameComplex"_ustr,
+            u"CharFontFamilyComplex"_ustr,
+            u"CharFontCharSetComplex"_ustr,
+            u"CharFontPitchComplex"_ustr,
+            u"CharPostureComplex"_ustr,
+            u"CharLocaleComplex"_ustr,
+            u"ParaAdjust"_ustr,
+            u"ParaLineSpacing"_ustr,
+            u"ParaBackColor"_ustr,
+            u"ParaBackTransparent"_ustr,
+            u"ParaBackGraphic"_ustr,
+            u"ParaBackGraphicURL"_ustr,
+            u"ParaBackGraphicFilter"_ustr,
+            u"ParaBackGraphicLocation"_ustr,
+            u"ParaLastLineAdjust"_ustr,
+            u"ParaExpandSingleWord"_ustr,
+            u"ParaLeftMargin"_ustr,
+            u"ParaRightMargin"_ustr,
+            u"ParaTopMargin"_ustr,
+            u"ParaBottomMargin"_ustr,
+            u"ParaLineNumberCount"_ustr,
+            u"ParaLineNumberStartValue"_ustr,
+            u"PageDescName"_ustr,
+            u"PageNumberOffset"_ustr,
+            u"ParaRegisterModeActive"_ustr,
+            u"ParaTabStops"_ustr,
+            u"ParaStyleName"_ustr,
+            u"DropCapFormat"_ustr,
+            u"DropCapWholeWord"_ustr,
+            u"ParaKeepTogether"_ustr,
+            u"Setting"_ustr,
+            u"ParaSplit"_ustr,
+            u"Setting"_ustr,
+            u"NumberingLevel"_ustr,
+            u"NumberingRules"_ustr,
+            u"NumberingStartValue"_ustr,
+            u"ParaIsNumberingRestart"_ustr,
+            u"NumberingStyleName"_ustr,
+            u"ParaOrphans"_ustr,
+            u"ParaWidows"_ustr,
+            u"ParaShadowFormat"_ustr,
+            u"LeftBorder"_ustr,
+            u"RightBorder"_ustr,
+            u"TopBorder"_ustr,
+            u"BottomBorder"_ustr,
+            u"BorderDistance"_ustr,
+            u"LeftBorderDistance"_ustr,
+            u"RightBorderDistance"_ustr,
+            u"TopBorderDistance"_ustr,
+            u"BottomBorderDistance"_ustr,
+            u"BreakType"_ustr,
+            u"DropCapCharStyleName"_ustr,
+            u"ParaFirstLineIndent"_ustr,
+            u"ParaIsAutoFirstLineIndent"_ustr,
+            u"ParaIsHyphenation"_ustr,
+            u"ParaHyphenationMaxHyphens"_ustr,
+            u"ParaHyphenationMaxLeadingChars"_ustr,
+            u"ParaHyphenationMaxTrailingChars"_ustr,
+            u"ParaVertAlignment"_ustr,
+            u"ParaUserDefinedAttributes"_ustr,
+            u"NumberingIsNumber"_ustr,
+            u"ParaIsConnectBorder"_ustr
         };
 
 
@@ -346,16 +345,10 @@ namespace svxform
                 Reference< XPropertySetInfo > xSourcePropInfo( 
xStyle->getPropertySetInfo(), UNO_SET_THROW );
                 Reference< XPropertySetInfo > xDestPropInfo( 
_rxModel->getPropertySetInfo(), UNO_SET_THROW );
 
-                OUString sPropertyName;
-                const char** pCharacterProperty = 
aCharacterAndParagraphProperties;
-                while ( *pCharacterProperty )
+                for (const OUString & sPropertyName : 
aCharacterAndParagraphProperties)
                 {
-                    sPropertyName = OUString::createFromAscii( 
*pCharacterProperty );
-
                     if ( xSourcePropInfo->hasPropertyByName( sPropertyName ) 
&& xDestPropInfo->hasPropertyByName( sPropertyName ) )
                         _rxModel->setPropertyValue( sPropertyName, 
xStyle->getPropertyValue( sPropertyName ) );
-
-                    ++pCharacterProperty;
                 }
             }
             catch( const Exception& )

Reply via email to