summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/filter/html/htmlfldw.cxx9
-rw-r--r--sw/source/filter/ww8/ww8par5.cxx6
-rw-r--r--sw/source/ui/dbui/createaddresslistdialog.cxx5
-rw-r--r--sw/source/ui/dbui/mmaddressblockpage.cxx2
-rw-r--r--sw/source/ui/lingu/olmenu.cxx4
5 files changed, 12 insertions, 14 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), ' '));
diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx
index af740e6ed9cc..2ce43f289269 100644
--- a/sw/source/filter/ww8/ww8par5.cxx
+++ b/sw/source/filter/ww8/ww8par5.cxx
@@ -219,7 +219,7 @@ OUString SwWW8ImplReader::ConvertFFileName(const OUString& rOrg)
aName = aName.replaceAll("%20", OUString(' '));
// remove attached quotation marks
- if (!aName.isEmpty() && '"' == aName[aName.getLength()-1])
+ if (aName.endsWith("\""))
aName = aName.copy(0, aName.getLength()-1);
// Need the more sophisticated url converter.
@@ -2107,7 +2107,7 @@ eF_ResT SwWW8ImplReader::Read_F_Macro( WW8FieldDesc*, OUString& rStr)
? true : false;
bNewVText = false;
}
- else if( aVText[aVText.getLength()-1] == ']' )
+ else if( aVText.endsWith("]") )
bBracket = false;
}
break;
@@ -3335,7 +3335,7 @@ eF_ResT SwWW8ImplReader::Read_F_Hyperlink( WW8FieldDesc* /*pF*/, OUString& rStr
if ( aReadParam.SkipToNextToken()==-2 )
{
sMark = aReadParam.GetResult();
- if( !sMark.isEmpty() && '"' == sMark[ sMark.getLength()-1 ])
+ if( sMark.endsWith("\""))
sMark = sMark.copy( 0, sMark.getLength() - 1 );
}
diff --git a/sw/source/ui/dbui/createaddresslistdialog.cxx b/sw/source/ui/dbui/createaddresslistdialog.cxx
index 00f576138263..0995300f89d6 100644
--- a/sw/source/ui/dbui/createaddresslistdialog.cxx
+++ b/sw/source/ui/dbui/createaddresslistdialog.cxx
@@ -421,7 +421,7 @@ SwCreateAddressListDialog::SwCreateAddressListDialog(
{
OUString sHeader = sLine.getToken( 0, '\t', nIndex );
OSL_ENSURE(sHeader.getLength() > 2 &&
- sHeader[0] == '\"' && sHeader[sHeader.getLength() - 1] == '\"',
+ sHeader.startsWith("\"") && sHeader.endsWith("\""),
"Wrong format of header");
if(sHeader.getLength() > 2)
{
@@ -438,8 +438,7 @@ SwCreateAddressListDialog::SwCreateAddressListDialog(
for( sal_Int32 nToken = 0; nToken < nDataCount; ++nToken)
{
OUString sData = sLine.getToken( 0, '\t', nIndex );
- OSL_ENSURE(sData.getLength() >= 2 &&
- sData[0] == '\"' && sData[sData.getLength() - 1] == '\"',
+ OSL_ENSURE( sData.startsWith("\"") && sData.endsWith("\""),
"Wrong format of line");
if(sData.getLength() >= 2)
aNewData.push_back(sData.copy(1, sData.getLength() - 2));
diff --git a/sw/source/ui/dbui/mmaddressblockpage.cxx b/sw/source/ui/dbui/mmaddressblockpage.cxx
index b46640a21348..94b9ec966dfa 100644
--- a/sw/source/ui/dbui/mmaddressblockpage.cxx
+++ b/sw/source/ui/dbui/mmaddressblockpage.cxx
@@ -1354,7 +1354,7 @@ void AddressMultiLineEdit::SetText( const OUString& rStr )
{
xub_StrLen nIndex = 0;
OUString sPara = pTextEngine->GetText( nPara );
- if(!sPara.isEmpty() && sPara[sPara.getLength() - 1] != ' ')
+ if(!sPara.isEmpty() && !sPara.endsWith(" "))
{
TextPaM aPaM(nPara, sPara.getLength());
pTextEngine->ReplaceText(TextSelection( aPaM ), OUString(' '));
diff --git a/sw/source/ui/lingu/olmenu.cxx b/sw/source/ui/lingu/olmenu.cxx
index 474179be91c9..687d9a25a37c 100644
--- a/sw/source/ui/lingu/olmenu.cxx
+++ b/sw/source/ui/lingu/olmenu.cxx
@@ -677,8 +677,8 @@ void SwSpellPopup::Execute( sal_uInt16 nId )
// if orginal word has a trailing . (likely the end of a sentence)
// and the replacement text hasn't, then add it to the replacement
if (!aTmp.isEmpty() && !aOrig.isEmpty() &&
- '.' == aOrig[ aOrig.getLength() - 1] && /* !IsAlphaNumeric ??*/
- '.' != aTmp[ aTmp.getLength() - 1])
+ aOrig.endsWith(".") && /* !IsAlphaNumeric ??*/
+ !aTmp.endsWith("."))
{
aTmp += ".";
}