summaryrefslogtreecommitdiff
path: root/xmloff/source/text
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-12-12 12:25:35 +0100
committerStephan Bergmann <sbergman@redhat.com>2014-12-12 12:25:35 +0100
commit513108bd57bc64091f1faaa640c0f026b7d91001 (patch)
tree2b7ab263dab57c8e7f6d699067ad65113b21ca05 /xmloff/source/text
parent554ba09f76ca1b7b29c0fc19aa4df443840b02d3 (diff)
xmloff: Use appropriate OUString functions on string constants
Change-Id: Idbe6ac27a4125bd9d9acb01ac42b60396abf0c81
Diffstat (limited to 'xmloff/source/text')
-rw-r--r--xmloff/source/text/XMLSectionExport.cxx8
-rw-r--r--xmloff/source/text/XMLTextFrameContext.cxx2
-rw-r--r--xmloff/source/text/XMLTextMarkImportContext.cxx17
-rw-r--r--xmloff/source/text/txtflde.cxx11
-rw-r--r--xmloff/source/text/txtimp.cxx6
-rw-r--r--xmloff/source/text/txtparae.cxx2
6 files changed, 20 insertions, 26 deletions
diff --git a/xmloff/source/text/XMLSectionExport.cxx b/xmloff/source/text/XMLSectionExport.cxx
index 67f5308ec10b..c2912a5e0c89 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 baf62f6c062b..58ed9b39f827 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 0c312d17e159..ba4b2d822ed0 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 f1f8442dce8b..805e0e6ab399 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 e1e454195c1f..3d9b54776ba7 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 cdc468cdc57e..de920891bd22 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();