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

Stephan Bergmann sbergman at redhat.com
Fri Dec 12 03:26:07 PST 2014


 xmloff/source/core/DocumentSettingsContext.cxx  |    6 ++--
 xmloff/source/core/RDFaImportHelper.cxx         |    6 ++--
 xmloff/source/core/xmlmultiimagehelper.cxx      |   16 +++++------
 xmloff/source/draw/XMLImageMapExport.cxx        |   14 ++-------
 xmloff/source/draw/shapeexport.cxx              |    2 -
 xmloff/source/draw/ximpcustomshape.cxx          |   24 ++++++++--------
 xmloff/source/draw/ximpshap.cxx                 |   34 ++++++++++++------------
 xmloff/source/forms/layerimport.cxx             |    2 -
 xmloff/source/forms/propertyexport.cxx          |    2 -
 xmloff/source/style/xmlnumfi.cxx                |    4 +-
 xmloff/source/text/XMLSectionExport.cxx         |    8 +----
 xmloff/source/text/XMLTextFrameContext.cxx      |    2 -
 xmloff/source/text/XMLTextMarkImportContext.cxx |   17 +++++-------
 xmloff/source/text/txtflde.cxx                  |   11 +++----
 xmloff/source/text/txtimp.cxx                   |    6 ++--
 xmloff/source/text/txtparae.cxx                 |    2 -
 xmloff/source/transform/Oasis2OOo.cxx           |    9 ++----
 17 files changed, 74 insertions(+), 91 deletions(-)

New commits:
commit 513108bd57bc64091f1faaa640c0f026b7d91001
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Dec 12 12:25:35 2014 +0100

    xmloff: Use appropriate OUString functions on string constants
    
    Change-Id: Idbe6ac27a4125bd9d9acb01ac42b60396abf0c81

diff --git a/xmloff/source/core/DocumentSettingsContext.cxx b/xmloff/source/core/DocumentSettingsContext.cxx
index 4e60385..f49e938 100644
--- a/xmloff/source/core/DocumentSettingsContext.cxx
+++ b/xmloff/source/core/DocumentSettingsContext.cxx
@@ -376,7 +376,7 @@ void XMLDocumentSettingsContext::EndElement()
         bool bFound(false);
         while((i >= 0) && !bFound)
         {
-            if (aSeqViewProps[i].Name.equalsAscii("Views"))
+            if (aSeqViewProps[i].Name == "Views")
             {
                 bFound = true;
                 uno::Reference<container::XIndexAccess> xIndexAccess;
@@ -404,13 +404,13 @@ void XMLDocumentSettingsContext::EndElement()
             {
                 OUString sProp( aSeqConfigProps[i].Name );
 
-                if ( sProp.equalsAscii("PrinterName") )
+                if ( sProp == "PrinterName" )
                 {
                     OUString sEmpty;
                     aSeqConfigProps[i].Value = uno::makeAny( sEmpty );
                     nFound++;
                 }
-                else if ( sProp.equalsAscii("PrinterSetup") )
+                else if ( sProp == "PrinterSetup" )
                 {
                     uno::Sequence< sal_Int8 > aEmpty;
                     aSeqConfigProps[i].Value = uno::makeAny( aEmpty );
diff --git a/xmloff/source/core/RDFaImportHelper.cxx b/xmloff/source/core/RDFaImportHelper.cxx
index 81ef976..61b7169 100644
--- a/xmloff/source/core/RDFaImportHelper.cxx
+++ b/xmloff/source/core/RDFaImportHelper.cxx
@@ -247,7 +247,7 @@ RDFaReader::ReadURIOrSafeCURIE(OUString const & i_rURIOrSafeCURIE) const
     }
     else
     {
-        if (i_rURIOrSafeCURIE.matchAsciiL("_:", 2)) // blank node
+        if (i_rURIOrSafeCURIE.startsWith("_:")) // blank node
         {
             SAL_INFO("xmloff.core", "ReadURIOrSafeCURIE: invalid URI: scheme is _" );
             return OUString();
@@ -273,7 +273,7 @@ RDFaInserter::LookupBlankNode(OUString const & i_rNodeId )
 uno::Reference< rdf::XURI >
 RDFaInserter::MakeURI( OUString const & i_rURI) const
 {
-    if (i_rURI.matchAsciiL("_:", 2)) // blank node
+    if (i_rURI.startsWith("_:")) // blank node
     {
         SAL_INFO("xmloff.core", "MakeURI: cannot create URI for blank node");
         return 0;
@@ -295,7 +295,7 @@ RDFaInserter::MakeURI( OUString const & i_rURI) const
 uno::Reference< rdf::XResource>
 RDFaInserter::MakeResource( OUString const & i_rResource)
 {
-    if (i_rResource.matchAsciiL("_:", 2)) // blank node
+    if (i_rResource.startsWith("_:")) // blank node
     {
         // we cannot use the blank node label as-is: it must be distinct
         // from labels in other graphs, so create fresh ones per XML stream
diff --git a/xmloff/source/core/xmlmultiimagehelper.cxx b/xmloff/source/core/xmlmultiimagehelper.cxx
index 8ada292..b0607a2 100644
--- a/xmloff/source/core/xmlmultiimagehelper.cxx
+++ b/xmloff/source/core/xmlmultiimagehelper.cxx
@@ -29,37 +29,37 @@ namespace
         sal_uInt32 nRetval(0);
 
         // pixel formats first
-        if(rString.endsWithAsciiL(".bmp", 4))
+        if(rString.endsWith(".bmp"))
         {
             return 10;
         }
-        if(rString.endsWithAsciiL(".gif", 4))
+        if(rString.endsWith(".gif"))
         {
             return 20;
         }
-        if(rString.endsWithAsciiL(".jpg", 4))
+        if(rString.endsWith(".jpg"))
         {
             return 30;
         }
-        if(rString.endsWithAsciiL(".png", 4))
+        if(rString.endsWith(".png"))
         {
             return 40;
         }
 
         // vector formats, prefer always
-        if(rString.endsWithAsciiL(".svm", 4))
+        if(rString.endsWith(".svm"))
         {
             return 1000;
         }
-        if(rString.endsWithAsciiL(".wmf", 4))
+        if(rString.endsWith(".wmf"))
         {
             return 1010;
         }
-        if(rString.endsWithAsciiL(".emf", 4))
+        if(rString.endsWith(".emf"))
         {
             return 1020;
         }
-        else if(rString.endsWithAsciiL(".svg", 4))
+        if(rString.endsWith(".svg"))
         {
             return 1030;
         }
diff --git a/xmloff/source/draw/XMLImageMapExport.cxx b/xmloff/source/draw/XMLImageMapExport.cxx
index b1f3325..b1a4b71 100644
--- a/xmloff/source/draw/XMLImageMapExport.cxx
+++ b/xmloff/source/draw/XMLImageMapExport.cxx
@@ -53,11 +53,6 @@ using ::com::sun::star::document::XEventsSupplier;
 using ::com::sun::star::lang::XServiceInfo;
 using ::com::sun::star::drawing::PointSequence;
 
-
-const sal_Char sAPI_ImageMapRectangleObject[] = "com.sun.star.image.ImageMapRectangleObject";
-const sal_Char sAPI_ImageMapCircleObject[] = "com.sun.star.image.ImageMapCircleObject";
-const sal_Char sAPI_ImageMapPolygonObject[] = "com.sun.star.image.ImageMapPolygonObject";
-
 XMLImageMapExport::XMLImageMapExport(SvXMLExport& rExp) :
     msBoundary("Boundary"),
     msCenter("Center"),
@@ -144,20 +139,17 @@ void XMLImageMapExport::ExportMapEntry(
         {
             OUString& rName = sServiceNames[i];
 
-            if ( rName.equalsAsciiL(sAPI_ImageMapRectangleObject,
-                                    sizeof(sAPI_ImageMapRectangleObject)-1) )
+            if ( rName == "com.sun.star.image.ImageMapRectangleObject" )
             {
                 eType = XML_AREA_RECTANGLE;
                 break;
             }
-            else if ( rName.equalsAsciiL(sAPI_ImageMapCircleObject,
-                                         sizeof(sAPI_ImageMapCircleObject)-1) )
+            else if ( rName == "com.sun.star.image.ImageMapCircleObject" )
             {
                 eType = XML_AREA_CIRCLE;
                 break;
             }
-            else if ( rName.equalsAsciiL(sAPI_ImageMapPolygonObject,
-                                         sizeof(sAPI_ImageMapPolygonObject)-1))
+            else if ( rName == "com.sun.star.image.ImageMapPolygonObject" )
             {
                 eType = XML_AREA_POLYGON;
                 break;
diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx
index 3efaba0..09ba163 100644
--- a/xmloff/source/draw/shapeexport.cxx
+++ b/xmloff/source/draw/shapeexport.cxx
@@ -195,7 +195,7 @@ uno::Reference< drawing::XShape > XMLShapeExport::checkForCustomShapeReplacement
     if( ( GetExport().getExportFlags() & EXPORT_OASIS ) == 0 )
     {
         OUString aType( xShape->getShapeType() );
-        if( aType.equalsAscii( "com.sun.star.drawing.CustomShape" ) )
+        if( aType == "com.sun.star.drawing.CustomShape" )
         {
             uno::Reference< beans::XPropertySet > xSet( xShape, uno::UNO_QUERY );
             if( xSet.is() )
diff --git a/xmloff/source/draw/ximpcustomshape.cxx b/xmloff/source/draw/ximpcustomshape.cxx
index b6b0db9..8015a4b 100644
--- a/xmloff/source/draw/ximpcustomshape.cxx
+++ b/xmloff/source/draw/ximpcustomshape.cxx
@@ -226,62 +226,62 @@ bool GetNextParameter( com::sun::star::drawing::EnhancedCustomShapeParameter& rP
     else if ( rParaString[ nIndex ] > '9' )
     {
         bNumberRequired = false;
-        if ( rParaString.matchIgnoreAsciiCaseAsciiL( "left", 4, nIndex ) )
+        if ( rParaString.matchIgnoreAsciiCase( "left", nIndex ) )
         {
             rParameter.Type = com::sun::star::drawing::EnhancedCustomShapeParameterType::LEFT;
             nIndex += 4;
         }
-        else if ( rParaString.matchIgnoreAsciiCaseAsciiL( "top", 3, nIndex ) )
+        else if ( rParaString.matchIgnoreAsciiCase( "top", nIndex ) )
         {
             rParameter.Type = com::sun::star::drawing::EnhancedCustomShapeParameterType::TOP;
             nIndex += 3;
         }
-        else if ( rParaString.matchIgnoreAsciiCaseAsciiL( "right", 5, nIndex ) )
+        else if ( rParaString.matchIgnoreAsciiCase( "right", nIndex ) )
         {
             rParameter.Type = com::sun::star::drawing::EnhancedCustomShapeParameterType::RIGHT;
             nIndex += 5;
         }
-        else if ( rParaString.matchIgnoreAsciiCaseAsciiL( "bottom", 6, nIndex ) )
+        else if ( rParaString.matchIgnoreAsciiCase( "bottom", nIndex ) )
         {
             rParameter.Type = com::sun::star::drawing::EnhancedCustomShapeParameterType::BOTTOM;
             nIndex += 6;
         }
-        else if ( rParaString.matchIgnoreAsciiCaseAsciiL( "xstretch", 8, nIndex ) )
+        else if ( rParaString.matchIgnoreAsciiCase( "xstretch", nIndex ) )
         {
             rParameter.Type = com::sun::star::drawing::EnhancedCustomShapeParameterType::XSTRETCH;
             nIndex += 8;
         }
-        else if ( rParaString.matchIgnoreAsciiCaseAsciiL( "ystretch", 8, nIndex ) )
+        else if ( rParaString.matchIgnoreAsciiCase( "ystretch", nIndex ) )
         {
             rParameter.Type = com::sun::star::drawing::EnhancedCustomShapeParameterType::YSTRETCH;
             nIndex += 8;
         }
-        else if ( rParaString.matchIgnoreAsciiCaseAsciiL( "hasstroke", 9, nIndex ) )
+        else if ( rParaString.matchIgnoreAsciiCase( "hasstroke", nIndex ) )
         {
             rParameter.Type = com::sun::star::drawing::EnhancedCustomShapeParameterType::HASSTROKE;
             nIndex += 9;
         }
-        else if ( rParaString.matchIgnoreAsciiCaseAsciiL( "hasfill", 7, nIndex ) )
+        else if ( rParaString.matchIgnoreAsciiCase( "hasfill", nIndex ) )
         {
             rParameter.Type = com::sun::star::drawing::EnhancedCustomShapeParameterType::HASFILL;
             nIndex += 7;
         }
-        else if ( rParaString.matchIgnoreAsciiCaseAsciiL( "width", 5, nIndex ) )
+        else if ( rParaString.matchIgnoreAsciiCase( "width", nIndex ) )
         {
             rParameter.Type = com::sun::star::drawing::EnhancedCustomShapeParameterType::WIDTH;
             nIndex += 5;
         }
-        else if ( rParaString.matchIgnoreAsciiCaseAsciiL( "height", 6, nIndex ) )
+        else if ( rParaString.matchIgnoreAsciiCase( "height", nIndex ) )
         {
             rParameter.Type = com::sun::star::drawing::EnhancedCustomShapeParameterType::HEIGHT;
             nIndex += 6;
         }
-        else if ( rParaString.matchIgnoreAsciiCaseAsciiL( "logwidth", 8, nIndex ) )
+        else if ( rParaString.matchIgnoreAsciiCase( "logwidth", nIndex ) )
         {
             rParameter.Type = com::sun::star::drawing::EnhancedCustomShapeParameterType::LOGWIDTH;
             nIndex += 8;
         }
-        else if ( rParaString.matchIgnoreAsciiCaseAsciiL( "logheight", 9, nIndex ) )
+        else if ( rParaString.matchIgnoreAsciiCase( "logheight", nIndex ) )
         {
             rParameter.Type = com::sun::star::drawing::EnhancedCustomShapeParameterType::LOGHEIGHT;
             nIndex += 9;
diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx
index 6a8c77a..bc0ee61 100644
--- a/xmloff/source/draw/ximpshap.cxx
+++ b/xmloff/source/draw/ximpshap.cxx
@@ -128,7 +128,7 @@ static bool ImpIsEmptyURL( const OUString& rURL )
 
     // #i13140# Also compare against 'toplevel' URLs. which also
     // result in empty filename strings.
-    if( rURL.equalsAscii( "#./" ) )
+    if( rURL == "#./" )
         return true;
 
     return false;
@@ -3068,10 +3068,10 @@ void SdXMLPluginShapeContext::StartElement( const ::com::sun::star::uno::Referen
 
         if( nPrefix == XML_NAMESPACE_DRAW && IsXMLToken( aLocalName, XML_MIME_TYPE ) )
         {
-            if( xAttrList->getValueByIndex( n ).equalsAscii( "application/vnd.sun.star.media" ) )
+            if( xAttrList->getValueByIndex( n ) == "application/vnd.sun.star.media" )
                 mbMedia = true;
 #if HAVE_FEATURE_GLTF
-            if( xAttrList->getValueByIndex( n ).equalsAscii( "model/vnd.gltf+json" ) )
+            if( xAttrList->getValueByIndex( n ) == "model/vnd.gltf+json" )
                 mbMedia = true;
 #endif
             // leave this loop
@@ -3220,49 +3220,49 @@ void SdXMLPluginShapeContext::EndElement()
             {
                 const OUString& rName = maParams[ nParam ].Name;
 
-                if( rName.equalsAscii( "Loop" ) )
+                if( rName == "Loop" )
                 {
                     OUString aValueStr;
                     maParams[ nParam ].Value >>= aValueStr;
                     xProps->setPropertyValue("Loop",
-                        uno::makeAny( aValueStr.equalsAscii( "true" ) ) );
+                        uno::makeAny( aValueStr == "true" ) );
                 }
-                else if( rName.equalsAscii( "Mute" ) )
+                else if( rName == "Mute" )
                 {
                     OUString aValueStr;
                     maParams[ nParam ].Value >>= aValueStr;
                     xProps->setPropertyValue("Mute",
-                        uno::makeAny( aValueStr.equalsAscii( "true" ) ) );
+                        uno::makeAny( aValueStr == "true" ) );
                 }
-                else if( rName.equalsAscii( "VolumeDB" ) )
+                else if( rName == "VolumeDB" )
                 {
                     OUString aValueStr;
                     maParams[ nParam ].Value >>= aValueStr;
                     xProps->setPropertyValue("VolumeDB",
                                                 uno::makeAny( static_cast< sal_Int16 >( aValueStr.toInt32() ) ) );
                 }
-                else if( rName.equalsAscii( "Zoom" ) )
+                else if( rName == "Zoom" )
                 {
                     OUString            aZoomStr;
                     media::ZoomLevel    eZoomLevel;
 
                     maParams[ nParam ].Value >>= aZoomStr;
 
-                    if( aZoomStr.equalsAscii( "25%" ) )
+                    if( aZoomStr == "25%" )
                         eZoomLevel = media::ZoomLevel_ZOOM_1_TO_4;
-                    else if( aZoomStr.equalsAscii( "50%" ) )
+                    else if( aZoomStr == "50%" )
                         eZoomLevel = media::ZoomLevel_ZOOM_1_TO_2;
-                    else if( aZoomStr.equalsAscii( "100%" ) )
+                    else if( aZoomStr == "100%" )
                         eZoomLevel = media::ZoomLevel_ORIGINAL;
-                    else if( aZoomStr.equalsAscii( "200%" ) )
+                    else if( aZoomStr == "200%" )
                         eZoomLevel = media::ZoomLevel_ZOOM_2_TO_1;
-                    else if( aZoomStr.equalsAscii( "400%" ) )
+                    else if( aZoomStr == "400%" )
                         eZoomLevel = media::ZoomLevel_ZOOM_4_TO_1;
-                    else if( aZoomStr.equalsAscii( "fit" ) )
+                    else if( aZoomStr == "fit" )
                         eZoomLevel = media::ZoomLevel_FIT_TO_WINDOW;
-                    else if( aZoomStr.equalsAscii( "fixedfit" ) )
+                    else if( aZoomStr == "fixedfit" )
                         eZoomLevel = media::ZoomLevel_FIT_TO_WINDOW_FIXED_ASPECT;
-                    else if( aZoomStr.equalsAscii( "fullscreen" ) )
+                    else if( aZoomStr == "fullscreen" )
                         eZoomLevel = media::ZoomLevel_FULLSCREEN;
                     else
                         eZoomLevel = media::ZoomLevel_NOT_AVAILABLE;
diff --git a/xmloff/source/forms/layerimport.cxx b/xmloff/source/forms/layerimport.cxx
index 125abd4..47f62fc 100644
--- a/xmloff/source/forms/layerimport.cxx
+++ b/xmloff/source/forms/layerimport.cxx
@@ -484,7 +484,7 @@ SvXMLImportContext* OFormLayerXMLImport_Impl::createContext(const sal_uInt16 _nP
     const Reference< xml::sax::XAttributeList >&)
 {
     SvXMLImportContext* pContext = NULL;
-    if ( _rLocalName.equalsAscii( "form" ) )
+    if ( _rLocalName == "form" )
     {
         if ( m_xCurrentPageFormsSupp.is() )
             pContext = new OFormImport(*this, *this, _nPrefix, _rLocalName, m_xCurrentPageFormsSupp->getForms() );
diff --git a/xmloff/source/forms/propertyexport.cxx b/xmloff/source/forms/propertyexport.cxx
index bc41ab4..501c88a 100644
--- a/xmloff/source/forms/propertyexport.cxx
+++ b/xmloff/source/forms/propertyexport.cxx
@@ -391,7 +391,7 @@ namespace xmloff
         DBG_CHECK_PROPERTY( PROPERTY_TARGETFRAME, OUString );
 
         OUString sTargetFrame = comphelper::getString(m_xProps->getPropertyValue(PROPERTY_TARGETFRAME));
-        if( ! sTargetFrame.equalsAscii("_blank") )
+        if( sTargetFrame != "_blank" )
         {   // an empty string and "_blank" have the same meaning and don't have to be written
             AddAttribute(OAttributeMetaData::getCommonControlAttributeNamespace(CCA_TARGET_FRAME)
                         ,OAttributeMetaData::getCommonControlAttributeName(CCA_TARGET_FRAME)
diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx
index 6c84c5a..71b9822 100644
--- a/xmloff/source/style/xmlnumfi.cxx
+++ b/xmloff/source/style/xmlnumfi.cxx
@@ -1885,7 +1885,7 @@ void SvXMLNumFormatContext::AddCurrency( const OUString& rContent, LanguageType
             bAutomatic = true;
         }
     }
-    else if ( nLang == LANGUAGE_SYSTEM && aSymbol.equalsAscii("CCC") )
+    else if ( nLang == LANGUAGE_SYSTEM && aSymbol == "CCC" )
     {
         //  "CCC" is used for automatic long symbol
         bAutomatic = true;
@@ -2057,7 +2057,7 @@ void SvXMLNumFormatContext::AddCondition( const sal_Int32 nIndex )
 
         //! collect all conditions first and adjust default to >=0, >0 or <0 depending on count
         //! allow blanks in conditions
-        if ( aConditions.isEmpty() && aMyConditions.size() == 1 && sRealCond.equalsAscii( ">=0" ) )
+        if ( aConditions.isEmpty() && aMyConditions.size() == 1 && sRealCond == ">=0" )
             bDefaultCond = true;
 
         if ( nType == XML_TOK_STYLES_TEXT_STYLE && nIndex == 2 )
diff --git a/xmloff/source/text/XMLSectionExport.cxx b/xmloff/source/text/XMLSectionExport.cxx
index 67f5308..c2912a5 100644
--- a/xmloff/source/text/XMLSectionExport.cxx
+++ b/xmloff/source/text/XMLSectionExport.cxx
@@ -1617,8 +1617,6 @@ void XMLSectionExport::ExportBoolean(
 
 const sal_Char sAPI_FieldMaster_Bibliography[] =
                                 "com.sun.star.text.FieldMaster.Bibliography";
-const sal_Char sAPI_SortKey[] = "SortKey";
-const sal_Char sAPI_IsSortAscending[] = "IsSortAscending";
 
 void XMLSectionExport::ExportBibliographyConfiguration(SvXMLExport& rExport)
 {
@@ -1708,8 +1706,7 @@ void XMLSectionExport::ExportBibliographyConfiguration(SvXMLExport& rExport)
                 {
                     PropertyValue& rValue = rKey[nPropertyKey];
 
-                    if (rValue.Name.equalsAsciiL(sAPI_SortKey,
-                                                 sizeof(sAPI_SortKey)-1))
+                    if (rValue.Name == "SortKey")
                     {
                         sal_Int16 nKey = 0;
                         rValue.Value >>= nKey;
@@ -1721,8 +1718,7 @@ void XMLSectionExport::ExportBibliographyConfiguration(SvXMLExport& rExport)
                                                  sBuf.makeStringAndClear());
                         }
                     }
-                    else if (rValue.Name.equalsAsciiL(sAPI_IsSortAscending,
-                                            sizeof(sAPI_IsSortAscending)-1))
+                    else if (rValue.Name == "IsSortAscending")
                     {
                         bool bTmp = *(sal_Bool*)rValue.Value.getValue();
                         rExport.AddAttribute(XML_NAMESPACE_TEXT,
diff --git a/xmloff/source/text/XMLTextFrameContext.cxx b/xmloff/source/text/XMLTextFrameContext.cxx
index baf62f6..58ed9b3 100644
--- a/xmloff/source/text/XMLTextFrameContext.cxx
+++ b/xmloff/source/text/XMLTextFrameContext.cxx
@@ -1526,7 +1526,7 @@ SvXMLImportContext *XMLTextFrameContext::CreateChildContext(
 
                         if( nPrefix == XML_NAMESPACE_DRAW && IsXMLToken( aLocalName, XML_MIME_TYPE ) )
                         {
-                            if( xAttrList->getValueByIndex( n ).equalsAscii( "application/vnd.sun.star.media" ) )
+                            if( xAttrList->getValueByIndex( n ) == "application/vnd.sun.star.media" )
                                 bMedia = true;
 
                             // leave this loop
diff --git a/xmloff/source/text/XMLTextMarkImportContext.cxx b/xmloff/source/text/XMLTextMarkImportContext.cxx
index 0c312d1..ba4b2d8 100644
--- a/xmloff/source/text/XMLTextMarkImportContext.cxx
+++ b/xmloff/source/text/XMLTextMarkImportContext.cxx
@@ -132,13 +132,13 @@ static const char *lcl_getFormFieldmarkName(OUString &name)
 {
     static const char sCheckbox[]=ODF_FORMCHECKBOX;
     static const char sFormDropDown[]=ODF_FORMDROPDOWN;
-    if (name.equalsAscii("msoffice.field.FORMCHECKBOX") ||
-            name.equalsAscii("ecma.office-open-xml.field.FORMCHECKBOX") )
+    if (name == "msoffice.field.FORMCHECKBOX" ||
+        name == "ecma.office-open-xml.field.FORMCHECKBOX")
         return sCheckbox;
-    else if (name.equalsAscii(ODF_FORMCHECKBOX) )
+    else if (name == ODF_FORMCHECKBOX)
         return sCheckbox;
-    if (name.equalsAscii(ODF_FORMDROPDOWN) ||
-            name.equalsAscii("ecma.office-open-xml.field.FORMDROPDOWN") )
+    if (name == ODF_FORMDROPDOWN ||
+        name == "ecma.office-open-xml.field.FORMDROPDOWN")
         return sFormDropDown;
     else
         return NULL;
@@ -146,10 +146,9 @@ static const char *lcl_getFormFieldmarkName(OUString &name)
 
 static OUString lcl_getFieldmarkName(OUString const& name)
 {
-    static const char sFormtext[]=ODF_FORMTEXT;
-    if (name.equalsAscii("msoffice.field.FORMTEXT") ||
-            name.equalsAscii("ecma.office-open-xml.field.FORMTEXT") )
-        return OUString::createFromAscii(sFormtext);
+    if (name == "msoffice.field.FORMTEXT" ||
+        name == "ecma.office-open-xml.field.FORMTEXT")
+        return OUString(ODF_FORMTEXT);
     else
         return name;
 }
diff --git a/xmloff/source/text/txtflde.cxx b/xmloff/source/text/txtflde.cxx
index f1f8442..805e0e6 100644
--- a/xmloff/source/text/txtflde.cxx
+++ b/xmloff/source/text/txtflde.cxx
@@ -1930,9 +1930,8 @@ void XMLTextFieldExport::ExportFieldDeclarations(
         OUString sFieldMaster = aFieldMasters[i];
 
         // workaround for #no-bug#
-        static const sal_Char sDB[] =
-            "com.sun.star.text.FieldMaster.DataBase.";
-        if ( sFieldMaster.matchIgnoreAsciiCaseAsciiL( sDB, sizeof(sDB)-1) )
+        if ( sFieldMaster.startsWithIgnoreAsciiCase(
+                 "com.sun.star.text.FieldMaster.DataBase.") )
         {
             continue;
         }
@@ -1948,7 +1947,7 @@ void XMLTextFieldExport::ExportFieldDeclarations(
         aAny >>= xPropSet;
 
         // save interesting field masters
-        if (sFieldMasterType.equalsAscii(FIELD_SERVICE_SETEXP))
+        if (sFieldMasterType == FIELD_SERVICE_SETEXP)
         {
             sal_Int32 nType = GetIntProperty(sPropertySubType, xPropSet);
 
@@ -1962,11 +1961,11 @@ void XMLTextFieldExport::ExportFieldDeclarations(
                 aVarName.push_back( sFieldMaster );
             }
         }
-        else if (sFieldMasterType.equalsAscii(FIELD_SERVICE_USER))
+        else if (sFieldMasterType == FIELD_SERVICE_USER)
         {
             aUserName.push_back( sFieldMaster );
         }
-        else if (sFieldMasterType.equalsAscii(FIELD_SERVICE_DDE))
+        else if (sFieldMasterType == FIELD_SERVICE_DDE)
         {
             aDdeName.push_back( sFieldMaster );
         }
diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx
index e1e4541..3d9b547 100644
--- a/xmloff/source/text/txtimp.cxx
+++ b/xmloff/source/text/txtimp.cxx
@@ -846,17 +846,17 @@ namespace
             pCurrent != m_pInParams->end();
             ++pCurrent)
         {
-            if(pCurrent->first.equalsAscii(ODF_FORMDROPDOWN_RESULT))
+            if(pCurrent->first == ODF_FORMDROPDOWN_RESULT)
             {
                 // sal_Int32
                 vOutParams[pCurrent->first] = makeAny(pCurrent->second.toInt32());
             }
-            else if(pCurrent->first.equalsAscii(ODF_FORMCHECKBOX_RESULT))
+            else if(pCurrent->first == ODF_FORMCHECKBOX_RESULT)
             {
                 // bool
                 vOutParams[pCurrent->first] = makeAny(pCurrent->second.toBoolean());
             }
-            else if(pCurrent->first.equalsAscii(ODF_FORMDROPDOWN_LISTENTRY))
+            else if(pCurrent->first == ODF_FORMDROPDOWN_LISTENTRY)
             {
                 // sequence
                 vListEntries.push_back(pCurrent->second);
diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx
index cdc468c..de92089 100644
--- a/xmloff/source/text/txtparae.cxx
+++ b/xmloff/source/text/txtparae.cxx
@@ -387,7 +387,7 @@ void FieldParamExporter::Export()
             aValue >>= sValue;
             ExportParameter(*pCurrent,sValue);
 
-            if ( pCurrent->equalsAscii( ODF_OLE_PARAM ) )
+            if ( *pCurrent == ODF_OLE_PARAM )
             {
                 // Save the OLE object
                 Reference< embed::XStorage > xTargetStg = m_pExport->GetTargetStorage();
diff --git a/xmloff/source/transform/Oasis2OOo.cxx b/xmloff/source/transform/Oasis2OOo.cxx
index 3b2ee5f..519f39d 100644
--- a/xmloff/source/transform/Oasis2OOo.cxx
+++ b/xmloff/source/transform/Oasis2OOo.cxx
@@ -1490,14 +1490,11 @@ void XMLConfigItemTContext_Impl::StartElement(
             if ( IsXMLToken( aLocalName, XML_NAME ) )
             {
                 const OUString& rValue = xAttrList->getValueByIndex( i );
-                const sal_Char sRedlineProtectionKey[] = "RedlineProtectionKey";
-                const sal_Char sCursorX[] = "CursorPositionX";
-                const sal_Char sCursorY[] = "CursorPositionY";
-                if( rValue.equalsAsciiL( sRedlineProtectionKey, sizeof(sRedlineProtectionKey)-1 ) )
+                if( rValue == "RedlineProtectionKey" )
                     m_bIsRedlineProtectionKey = true;
-                else if( rValue.equalsAsciiL( sCursorX, sizeof(sCursorX)-1 ) )
+                else if( rValue == "CursorPositionX" )
                     m_bIsCursorX = true;
-                else if( rValue.equalsAsciiL( sCursorY, sizeof(sCursorY)-1 ) )
+                else if( rValue == "CursorPositionY" )
                     m_bIsCursorY = true;
 
                 break;


More information about the Libreoffice-commits mailing list