[Libreoffice-commits] core.git: winaccessibility/source

Stephan Bergmann sbergman at redhat.com
Thu Apr 6 11:14:53 UTC 2017


 winaccessibility/source/UAccCOM/AccEditableText.cxx |   54 ++++++++++----------
 1 file changed, 27 insertions(+), 27 deletions(-)

New commits:
commit 68d5dbf34d88a9029b15010115c502b3dc7095c8
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Apr 6 13:13:06 2017 +0200

    Use OUString function variants that take a (narrow) string literal
    
    ...instead of going via an OUString temporary created from a char16_t string
    literal
    
    Change-Id: I9bdc1fe5e92988fbe227534a183c0c5a86ebc2a1

diff --git a/winaccessibility/source/UAccCOM/AccEditableText.cxx b/winaccessibility/source/UAccCOM/AccEditableText.cxx
index d676493ef58d..47da0f2efae1 100644
--- a/winaccessibility/source/UAccCOM/AccEditableText.cxx
+++ b/winaccessibility/source/UAccCOM/AccEditableText.cxx
@@ -268,55 +268,55 @@ STDMETHODIMP CAccEditableText::setAttributes(long startOffset, long endOffset, B
  */
 void CAccEditableText::get_AnyFromOLECHAR(const ::rtl::OUString &ouName, const ::rtl::OUString &ouValue, Any &rAny)
 {
-    if(ouName.equals(u"CharBackColor") ||
-            ouName.equals(u"CharColor") ||
-            ouName.equals(u"ParaAdjust") ||
-            ouName.equals(u"ParaFirstLineIndent") ||
-            ouName.equals(u"ParaLeftMargin") ||
-            ouName.equals(u"ParaRightMargin") ||
-            ouName.equals(u"ParaTopMargin") ||
-            ouName.equals(u"ParaBottomMargin") ||
-            ouName.equals(u"CharFontPitch") )
+    if(ouName == "CharBackColor" ||
+            ouName == "CharColor" ||
+            ouName == "ParaAdjust" ||
+            ouName == "ParaFirstLineIndent" ||
+            ouName == "ParaLeftMargin" ||
+            ouName == "ParaRightMargin" ||
+            ouName == "ParaTopMargin" ||
+            ouName == "ParaBottomMargin" ||
+            ouName == "CharFontPitch" )
     {
         // Convert to int.
         // NOTE: CharFontPitch is not implemented in java file.
         sal_Int32 nValue = ouValue.toInt32();
         rAny.setValue(&nValue, cppu::UnoType<sal_Int32>::get());
     }
-    else if(ouName.equals(u"CharShadowed") ||
-            ouName.equals(u"CharContoured") )
+    else if(ouName == "CharShadowed" ||
+            ouName == "CharContoured" )
     {
         // Convert to boolean.
         rAny <<= ouValue.toBoolean();
     }
-    else if(ouName.equals(u"CharEscapement") ||
-            ouName.equals(u"CharStrikeout")  ||
-            ouName.equals(u"CharUnderline") ||
-            ouName.equals(u"CharFontPitch") )
+    else if(ouName == "CharEscapement" ||
+            ouName == "CharStrikeout"  ||
+            ouName == "CharUnderline" ||
+            ouName == "CharFontPitch" )
     {
         // Convert to short.
         short nValue = (short)ouValue.toInt32();
         rAny.setValue(&nValue, cppu::UnoType<short>::get());
     }
-    else if(ouName.equals(u"CharHeight") ||
-            ouName.equals(u"CharWeight") )
+    else if(ouName == "CharHeight" ||
+            ouName == "CharWeight" )
     {
         // Convert to float.
         float fValue = ouValue.toFloat();
         rAny.setValue(&fValue, cppu::UnoType<float>::get());
     }
-    else if(ouName.equals(u"CharFontName") )
+    else if(ouName == "CharFontName" )
     {
         // Convert to string.
         rAny.setValue(&ouValue, cppu::UnoType<rtl::OUString>::get());
     }
-    else if(ouName.equals(u"CharPosture") )
+    else if(ouName == "CharPosture" )
     {
         // Convert to FontSlant.
         css::awt::FontSlant fontSlant = (css::awt::FontSlant)ouValue.toInt32();
         rAny.setValue(&fontSlant, cppu::UnoType<css::awt::FontSlant>::get());
     }
-    else if(ouName.equals(u"ParaTabStops") )
+    else if(ouName == "ParaTabStops" )
     {
 
         // Convert to the Sequence with TabStop element.
@@ -328,7 +328,7 @@ void CAccEditableText::get_AnyFromOLECHAR(const ::rtl::OUString &ouName, const :
         do
         {
             // Position.
-            pos = ouValue.indexOf(u"Position=", pos);
+            pos = ouValue.indexOf("Position=", pos);
             if(pos != -1)
             {
                 posComma = ouValue.indexOf(',', pos + 9); // 9 = length of "Position=".
@@ -339,7 +339,7 @@ void CAccEditableText::get_AnyFromOLECHAR(const ::rtl::OUString &ouName, const :
                     pos = posComma + 1;
 
                     // TabAlign.
-                    pos = ouValue.indexOf(u"TabAlign=", pos);
+                    pos = ouValue.indexOf("TabAlign=", pos);
                     if(pos != -1)
                     {
                         posComma = ouValue.indexOf(',', pos + 9); // 9 = length of "TabAlign=".
@@ -350,7 +350,7 @@ void CAccEditableText::get_AnyFromOLECHAR(const ::rtl::OUString &ouName, const :
                             pos = posComma + 1;
 
                             // DecimalChar.
-                            pos = ouValue.indexOf(u"DecimalChar=", pos);
+                            pos = ouValue.indexOf("DecimalChar=", pos);
                             if(pos != -1)
                             {
                                 posComma = ouValue.indexOf(',', pos + 11); // 11 = length of "TabAlign=".
@@ -361,7 +361,7 @@ void CAccEditableText::get_AnyFromOLECHAR(const ::rtl::OUString &ouName, const :
                                     pos = posComma + 1;
 
                                     // FillChar.
-                                    pos = ouValue.indexOf(u"FillChar=", pos);
+                                    pos = ouValue.indexOf("FillChar=", pos);
                                     if(pos != -1)
                                     {
                                         posComma = ouValue.indexOf(',', pos + 9); // 9 = length of "TabAlign=".
@@ -425,14 +425,14 @@ void CAccEditableText::get_AnyFromOLECHAR(const ::rtl::OUString &ouName, const :
         // Assign to Any object.
         rAny.setValue(&seqTabStop, cppu::UnoType<Sequence< css::style::TabStop >>::get());
     }
-    else if(ouName.equals(u"ParaLineSpacing") )
+    else if(ouName == "ParaLineSpacing" )
     {
         // Parse value string.
         css::style::LineSpacing lineSpacing;
         ::rtl::OUString ouSubValue;
         sal_Int32 pos = 0, posComma = 0;
 
-        pos = ouValue.indexOf(u"Mode=", pos);
+        pos = ouValue.indexOf("Mode=", pos);
         if(pos != -1)
         {
             posComma = ouValue.indexOf(',', pos + 5); // 5 = length of "Mode=".
@@ -442,7 +442,7 @@ void CAccEditableText::get_AnyFromOLECHAR(const ::rtl::OUString &ouName, const :
                 lineSpacing.Mode = (sal_Int16)ouSubValue.toInt32();
                 pos = posComma + 1;
 
-                pos = ouValue.indexOf(u"Height=", pos);
+                pos = ouValue.indexOf("Height=", pos);
                 if(pos != -1)
                 {
                     ouSubValue = ouValue.copy(pos + 7, ouValue.getLength() - pos - 7);


More information about the Libreoffice-commits mailing list