summaryrefslogtreecommitdiff
path: root/sw/source/filter/html/htmlfldw.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-10-21 10:21:01 +0200
committerNoel Grandin <noel@peralex.com>2013-10-23 08:29:15 +0200
commit7a06928bcf638e1eeedebc9d53c306a1b852cc9b (patch)
treec0402c2da4e2c522ecf32a0b413128f727cbc0fa /sw/source/filter/html/htmlfldw.cxx
parenta55d02bacb2c8f21cba759c8fe3931df07a85b0c (diff)
convert code to use OUString::endsWith
Convert places that call aStr[aStr.getLength()-1] == 'x' to use the shorter form aStr.endsWith("x") Change-Id: I1b3a19c0e89b8989cdbeed440f95fc76f9a4b6b6
Diffstat (limited to 'sw/source/filter/html/htmlfldw.cxx')
-rw-r--r--sw/source/filter/html/htmlfldw.cxx9
1 files changed, 4 insertions, 5 deletions
diff --git a/sw/source/filter/html/htmlfldw.cxx b/sw/source/filter/html/htmlfldw.cxx
index ceca41810ab1..8a3f247f8087 100644
--- a/sw/source/filter/html/htmlfldw.cxx
+++ b/sw/source/filter/html/htmlfldw.cxx
@@ -464,10 +464,9 @@ Writer& OutHTML_SwFmtFld( Writer& rWrt, const SfxPoolItem& rHt )
const OUString& rComment = pFld->GetPar2();
sal_Bool bWritten = sal_False;
- if( (rComment.getLength() >= 6 && '<' == rComment[0] &&
- '>' == rComment[rComment.getLength()-1] &&
- rComment.copy( 1, 4 ).equalsIgnoreAsciiCase( OOO_STRING_SVTOOLS_HTML_meta) ) ||
- (rComment.getLength() >= 7 &&
+ if( (rComment.getLength() >= 6 && rComment.startsWith("<") && rComment.endsWith(">") &&
+ rComment.copy( 1, 4 ).equalsIgnoreAsciiCase( OOO_STRING_SVTOOLS_HTML_meta) ) ||
+ (rComment.getLength() >= 7 &&
rComment.startsWith( "<!--" ) &&
rComment.endsWith( "-->" )) )
{
@@ -481,7 +480,7 @@ Writer& OutHTML_SwFmtFld( Writer& rWrt, const SfxPoolItem& rHt )
bWritten = sal_True;
}
else if( rComment.getLength() >= 7 &&
- '>' == rComment[rComment.getLength()-1] &&
+ rComment.endsWith(">") &&
rComment.startsWithIgnoreAsciiCase( "HTML:" ) )
{
OUString sComment(comphelper::string::stripStart(rComment.copy(5), ' '));