summaryrefslogtreecommitdiff
path: root/sw/source/ui/dbui
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/ui/dbui
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/ui/dbui')
-rw-r--r--sw/source/ui/dbui/createaddresslistdialog.cxx5
-rw-r--r--sw/source/ui/dbui/mmaddressblockpage.cxx2
2 files changed, 3 insertions, 4 deletions
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(' '));