diff options
author | Noel Grandin <noel@peralex.com> | 2013-10-21 10:21:01 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-10-23 08:29:15 +0200 |
commit | 7a06928bcf638e1eeedebc9d53c306a1b852cc9b (patch) | |
tree | c0402c2da4e2c522ecf32a0b413128f727cbc0fa /svx | |
parent | a55d02bacb2c8f21cba759c8fe3931df07a85b0c (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 'svx')
-rw-r--r-- | svx/source/form/formcontroller.cxx | 4 | ||||
-rw-r--r-- | svx/source/sidebar/nbdtmg.cxx | 4 | ||||
-rw-r--r-- | svx/source/tbxctrls/fillctrl.cxx | 30 | ||||
-rw-r--r-- | svx/source/tbxctrls/itemwin.cxx | 10 |
4 files changed, 24 insertions, 24 deletions
diff --git a/svx/source/form/formcontroller.cxx b/svx/source/form/formcontroller.cxx index cb21a59074ae..dcd2b18aa2eb 100644 --- a/svx/source/form/formcontroller.cxx +++ b/svx/source/form/formcontroller.cxx @@ -3220,10 +3220,10 @@ void FormController::setFilter(::std::vector<FmFieldInfo>& rFieldInfos) if (aRow.find((*iter).xText) != aRow.end()) { OUString aCompText = aRow[(*iter).xText]; - aCompText += OUString(" "); + aCompText += " "; OString aVal = m_xParser->getContext().getIntlKeywordAscii(IParseContext::KEY_AND); aCompText += OUString(aVal.getStr(),aVal.getLength(),RTL_TEXTENCODING_ASCII_US); - aCompText += OUString(" "); + aCompText += " "; aCompText += ::comphelper::getString(pRefValues[j].Value); aRow[(*iter).xText] = aCompText; } diff --git a/svx/source/sidebar/nbdtmg.cxx b/svx/source/sidebar/nbdtmg.cxx index da61e05cdf57..fbe446a2159a 100644 --- a/svx/source/sidebar/nbdtmg.cxx +++ b/svx/source/sidebar/nbdtmg.cxx @@ -1834,8 +1834,8 @@ sal_Bool OutlineTypeMgr::ApplyNumRule(SvxNumRule& aNum,sal_uInt16 nIndex,sal_uIn aFmt.SetBulletFont( &rActBulletFont ); sal_Unicode cChar = 0; - if( pLevelSettings->sBulletChar.getLength() ) - cChar = pLevelSettings->sBulletChar.getStr()[0]; + if( !pLevelSettings->sBulletChar.isEmpty() ) + cChar = pLevelSettings->sBulletChar[0]; if( Application::GetSettings().GetLayoutRTL() ) { if( 0 == i && cChar == BulletsTypeMgr::aDynamicBulletTypes[5] ) diff --git a/svx/source/tbxctrls/fillctrl.cxx b/svx/source/tbxctrls/fillctrl.cxx index e8b45dc07bc5..499bccf54fa9 100644 --- a/svx/source/tbxctrls/fillctrl.cxx +++ b/svx/source/tbxctrls/fillctrl.cxx @@ -28,8 +28,8 @@ #define DELAY_TIMEOUT 300 -#define TMP_STR_BEGIN '[' -#define TMP_STR_END ']' +#define TMP_STR_BEGIN "[" +#define TMP_STR_END "]" #include "svx/drawitem.hxx" #include "svx/xattr.hxx" @@ -259,13 +259,13 @@ void SvxFillToolBoxControl::Update( const SfxPoolItem* pState ) { // Last entry gets tested against temporary color aTmpStr = pFillAttrLB->GetEntry( nCount - 1 ); - if( aTmpStr[0] == TMP_STR_BEGIN && - aTmpStr[aTmpStr.getLength()-1] == TMP_STR_END ) + if( aTmpStr.startsWith(TMP_STR_BEGIN) && + aTmpStr.endsWith(TMP_STR_END) ) { pFillAttrLB->RemoveEntry( nCount - 1 ); } } - aTmpStr = OUString(TMP_STR_BEGIN) + aString + OUString(TMP_STR_END); + aTmpStr = TMP_STR_BEGIN + aString + TMP_STR_END; //pFillAttrLB->SetUpdateMode( sal_False ); sal_uInt16 nPos = pFillAttrLB->InsertEntry( aColor, aTmpStr ); @@ -293,13 +293,13 @@ void SvxFillToolBoxControl::Update( const SfxPoolItem* pState ) { // Last entry gets tested against temporary entry aTmpStr = pFillAttrLB->GetEntry( nCount - 1 ); - if( aTmpStr[0] == TMP_STR_BEGIN && - aTmpStr[aTmpStr.getLength()-1] == TMP_STR_END ) + if( aTmpStr.startsWith(TMP_STR_BEGIN) && + aTmpStr.endsWith(TMP_STR_END) ) { pFillAttrLB->RemoveEntry( nCount - 1 ); } } - aTmpStr = OUString(TMP_STR_BEGIN) + aString + OUString(TMP_STR_END); + aTmpStr = TMP_STR_BEGIN + aString + TMP_STR_END; XGradientEntry* pEntry = new XGradientEntry( pGradientItem->GetGradientValue(), aTmpStr ); XGradientList aGradientList( "" ); @@ -338,13 +338,13 @@ void SvxFillToolBoxControl::Update( const SfxPoolItem* pState ) { // Last entry gets tested against temporary entry aTmpStr = pFillAttrLB->GetEntry( nCount - 1 ); - if( aTmpStr[0] == TMP_STR_BEGIN && - aTmpStr[aTmpStr.getLength()-1] == TMP_STR_END ) + if( aTmpStr.startsWith(TMP_STR_BEGIN) && + aTmpStr.endsWith(TMP_STR_END) ) { pFillAttrLB->RemoveEntry( nCount - 1 ); } } - aTmpStr = OUString(TMP_STR_BEGIN) + aString + OUString(TMP_STR_END); + aTmpStr = TMP_STR_BEGIN + aString + TMP_STR_END; XHatchEntry* pEntry = new XHatchEntry( pHatchItem->GetHatchValue(), aTmpStr ); XHatchList aHatchList( "" ); @@ -390,13 +390,13 @@ void SvxFillToolBoxControl::Update( const SfxPoolItem* pState ) { // Last entry gets tested against temporary entry aTmpStr = pFillAttrLB->GetEntry( nCount - 1 ); - if( aTmpStr[0] == TMP_STR_BEGIN && - aTmpStr[aTmpStr.getLength()-1] == TMP_STR_END ) + if( aTmpStr.startsWith(TMP_STR_BEGIN) && + aTmpStr.endsWith(TMP_STR_END) ) { pFillAttrLB->RemoveEntry( nCount - 1 ); } } - aTmpStr = OUString(TMP_STR_BEGIN) + aString + OUString(TMP_STR_END); + aTmpStr = TMP_STR_BEGIN + aString + TMP_STR_END; XBitmapEntry* pEntry = new XBitmapEntry(pBitmapItem->GetGraphicObject(), aTmpStr); XBitmapListRef xBitmapList = @@ -673,7 +673,7 @@ IMPL_LINK( FillControl, SelectFillAttrHdl, ListBox *, pBox ) { // Entry gets tested against temporary color OUString aTmpStr = pLbFillAttr->GetSelectEntry(); - if( aTmpStr[0] == TMP_STR_BEGIN && aTmpStr[aTmpStr.getLength()-1] == TMP_STR_END ) + if( aTmpStr.startsWith(TMP_STR_BEGIN) && aTmpStr.endsWith(TMP_STR_END) ) { aTmpStr = aTmpStr.copy(1, aTmpStr.getLength()-2); } diff --git a/svx/source/tbxctrls/itemwin.cxx b/svx/source/tbxctrls/itemwin.cxx index 6435eaa2553d..3d10cb337d33 100644 --- a/svx/source/tbxctrls/itemwin.cxx +++ b/svx/source/tbxctrls/itemwin.cxx @@ -28,8 +28,8 @@ #include <svx/dialogs.hrc> -#define TMP_STR_BEGIN '[' -#define TMP_STR_END ']' +#define TMP_STR_BEGIN "[" +#define TMP_STR_END "]" #define DELAY_TIMEOUT 100 @@ -318,13 +318,13 @@ void SvxColorBox::Update( const XLineColorItem* pItem ) { // Last entry gets tested against temporary color aTmpStr = GetEntry( nCount - 1 ); - if( aTmpStr[0] == TMP_STR_BEGIN && - aTmpStr[aTmpStr.getLength()-1] == TMP_STR_END ) + if( aTmpStr.startsWith(TMP_STR_BEGIN) && + aTmpStr.endsWith(TMP_STR_END) ) { RemoveEntry( nCount - 1 ); } } - aTmpStr = OUString(TMP_STR_BEGIN) + aString + OUString(TMP_STR_END); + aTmpStr = TMP_STR_BEGIN + aString + TMP_STR_END; sal_uInt16 nPos = InsertEntry( aColor, aTmpStr ); SelectEntryPos( nPos ); |