summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-11-19 12:47:37 +0200
committerNoel Grandin <noel@peralex.com>2013-11-19 12:49:29 +0200
commit363cc397172f2b0a94d9c4dc44fc8d95072795a3 (patch)
tree16a23a796e2db536d7af3f0144bce8fd01570e26 /xmloff
parent02a2203580226766c4b3b8778430774ff76f90e9 (diff)
convert equalsAsciiL calls to startWith calls where possible
Simplify code like: aStr.equalsAsciiL( "%", 1 ) to aStr.startsWith( "%" ) Change-Id: Iee0e4e60b0ae6d567fa8f72db5d616fffbec3c00
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/draw/XMLImageMapExport.cxx3
-rw-r--r--xmloff/source/script/XMLEventExport.cxx2
-rw-r--r--xmloff/source/text/txtflde.cxx66
-rw-r--r--xmloff/source/text/txtparae.cxx3
4 files changed, 35 insertions, 39 deletions
diff --git a/xmloff/source/draw/XMLImageMapExport.cxx b/xmloff/source/draw/XMLImageMapExport.cxx
index 5722e77c6895..02bc33a7e843 100644
--- a/xmloff/source/draw/XMLImageMapExport.cxx
+++ b/xmloff/source/draw/XMLImageMapExport.cxx
@@ -193,8 +193,7 @@ void XMLImageMapExport::ExportMapEntry(
mrExport.AddAttribute(
XML_NAMESPACE_XLINK, XML_SHOW,
- sTargt.equalsAsciiL( "_blank", sizeof("_blank")-1 )
- ? XML_NEW : XML_REPLACE );
+ sTargt.startsWith( "_blank" ) ? XML_NEW : XML_REPLACE );
}
// name
diff --git a/xmloff/source/script/XMLEventExport.cxx b/xmloff/source/script/XMLEventExport.cxx
index 868162444ccc..4d496a7b5940 100644
--- a/xmloff/source/script/XMLEventExport.cxx
+++ b/xmloff/source/script/XMLEventExport.cxx
@@ -242,7 +242,7 @@ void XMLEventExport::ExportEvent(
}
else
{
- if (! sType.equalsAsciiL("None", sizeof("None")-1))
+ if (! sType.startsWith("None"))
{
OSL_FAIL("unknown event type returned by API");
// unknown type -> error (ignore)
diff --git a/xmloff/source/text/txtflde.cxx b/xmloff/source/text/txtflde.cxx
index 927f4cc03d47..47b5a6783c3b 100644
--- a/xmloff/source/text/txtflde.cxx
+++ b/xmloff/source/text/txtflde.cxx
@@ -2716,8 +2716,7 @@ void XMLTextFieldExport::ProcessBibliographyData(
sal_Int32 nLength = aValues.getLength();
for (sal_Int32 i = 0; i < nLength; i++)
{
- if (aValues[i].Name.equalsAsciiL("BibiliographicType",
- sizeof("BibiliographicType")-1))
+ if (aValues[i].Name.startsWith("BibiliographicType"))
{
sal_Int16 nTypeId = 0;
aValues[i].Value >>= nTypeId;
@@ -3328,128 +3327,127 @@ enum XMLTokenEnum XMLTextFieldExport::MapBibliographyFieldName(OUString sName)
{
enum XMLTokenEnum eName = XML_TOKEN_INVALID;
- if (sName.equalsAsciiL("Identifier", sizeof("Identifier")-1))
+ if (sName.startsWith("Identifier"))
{
eName = XML_IDENTIFIER;
}
- else if (sName.equalsAsciiL("BibiliographicType",
- sizeof("BibiliographicType")-1))
+ else if (sName.startsWith("BibiliographicType"))
{
eName = XML_BIBLIOGRAPHY_TYPE;
}
- else if (sName.equalsAsciiL("Address", sizeof("Address")-1))
+ else if (sName.startsWith("Address"))
{
eName = XML_ADDRESS;
}
- else if (sName.equalsAsciiL("Annote", sizeof("Annote")-1))
+ else if (sName.startsWith("Annote"))
{
eName = XML_ANNOTE;
}
- else if (sName.equalsAsciiL("Author", sizeof("Author")-1))
+ else if (sName.startsWith("Author"))
{
eName = XML_AUTHOR;
}
- else if (sName.equalsAsciiL("Booktitle", sizeof("Booktitle")-1))
+ else if (sName.startsWith("Booktitle"))
{
eName = XML_BOOKTITLE;
}
- else if (sName.equalsAsciiL("Chapter", sizeof("Chapter")-1))
+ else if (sName.startsWith("Chapter"))
{
eName = XML_CHAPTER;
}
- else if (sName.equalsAsciiL("Edition", sizeof("Edition")-1))
+ else if (sName.startsWith("Edition"))
{
eName = XML_EDITION;
}
- else if (sName.equalsAsciiL("Editor", sizeof("Editor")-1))
+ else if (sName.startsWith("Editor"))
{
eName = XML_EDITOR;
}
- else if (sName.equalsAsciiL("Howpublished", sizeof("Howpublished")-1))
+ else if (sName.startsWith("Howpublished"))
{
eName = XML_HOWPUBLISHED;
}
- else if (sName.equalsAsciiL("Institution", sizeof("Institution")-1))
+ else if (sName.startsWith("Institution"))
{
eName = XML_INSTITUTION;
}
- else if (sName.equalsAsciiL("Journal", sizeof("Journal")-1))
+ else if (sName.startsWith("Journal"))
{
eName = XML_JOURNAL;
}
- else if (sName.equalsAsciiL("Month", sizeof("Month")-1))
+ else if (sName.startsWith("Month"))
{
eName = XML_MONTH;
}
- else if (sName.equalsAsciiL("Note", sizeof("Note")-1))
+ else if (sName.startsWith("Note"))
{
eName = XML_NOTE;
}
- else if (sName.equalsAsciiL("Number", sizeof("Number")-1))
+ else if (sName.startsWith("Number"))
{
eName = XML_NUMBER;
}
- else if (sName.equalsAsciiL("Organizations", sizeof("Organizations")-1))
+ else if (sName.startsWith("Organizations"))
{
eName = XML_ORGANIZATIONS;
}
- else if (sName.equalsAsciiL("Pages", sizeof("Pages")-1))
+ else if (sName.startsWith("Pages"))
{
eName = XML_PAGES;
}
- else if (sName.equalsAsciiL("Publisher", sizeof("Publisher")-1))
+ else if (sName.startsWith("Publisher"))
{
eName = XML_PUBLISHER;
}
- else if (sName.equalsAsciiL("School", sizeof("School")-1))
+ else if (sName.startsWith("School"))
{
eName = XML_SCHOOL;
}
- else if (sName.equalsAsciiL("Series", sizeof("Series")-1))
+ else if (sName.startsWith("Series"))
{
eName = XML_SERIES;
}
- else if (sName.equalsAsciiL("Title", sizeof("Title")-1))
+ else if (sName.startsWith("Title"))
{
eName = XML_TITLE;
}
- else if (sName.equalsAsciiL("Report_Type", sizeof("Report_Type")-1))
+ else if (sName.startsWith("Report_Type"))
{
eName = XML_REPORT_TYPE;
}
- else if (sName.equalsAsciiL("Volume", sizeof("Volume")-1))
+ else if (sName.startsWith("Volume"))
{
eName = XML_VOLUME;
}
- else if (sName.equalsAsciiL("Year", sizeof("Year")-1))
+ else if (sName.startsWith("Year"))
{
eName = XML_YEAR;
}
- else if (sName.equalsAsciiL("URL", sizeof("URL")-1))
+ else if (sName.startsWith("URL"))
{
eName = XML_URL;
}
- else if (sName.equalsAsciiL("Custom1", sizeof("Custom1")-1))
+ else if (sName.startsWith("Custom1"))
{
eName = XML_CUSTOM1;
}
- else if (sName.equalsAsciiL("Custom2", sizeof("Custom2")-1))
+ else if (sName.startsWith("Custom2"))
{
eName = XML_CUSTOM2;
}
- else if (sName.equalsAsciiL("Custom3", sizeof("Custom3")-1))
+ else if (sName.startsWith("Custom3"))
{
eName = XML_CUSTOM3;
}
- else if (sName.equalsAsciiL("Custom4", sizeof("Custom4")-1))
+ else if (sName.startsWith("Custom4"))
{
eName = XML_CUSTOM4;
}
- else if (sName.equalsAsciiL("Custom5", sizeof("Custom5")-1))
+ else if (sName.startsWith("Custom5"))
{
eName = XML_CUSTOM5;
}
- else if (sName.equalsAsciiL("ISBN", sizeof("ISBN")-1))
+ else if (sName.startsWith("ISBN"))
{
eName = XML_ISBN;
}
diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx
index f389b4d5c5f7..32ff3ad1fd6f 100644
--- a/xmloff/source/text/txtparae.cxx
+++ b/xmloff/source/text/txtparae.cxx
@@ -3305,8 +3305,7 @@ sal_Bool XMLTextParagraphExport::addHyperlinkAttributes(
GetExport().AddAttribute( XML_NAMESPACE_OFFICE,
XML_TARGET_FRAME_NAME, sTargetFrame );
enum XMLTokenEnum eTok =
- sTargetFrame.equalsAsciiL( "_blank", sizeof("_blank")-1 )
- ? XML_NEW : XML_REPLACE;
+ sTargetFrame.startsWith( "_blank" ) ? XML_NEW : XML_REPLACE;
GetExport().AddAttribute( XML_NAMESPACE_XLINK, XML_SHOW, eTok );
}