summaryrefslogtreecommitdiff
path: root/svx/source/tbxctrls/fillctrl.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 /svx/source/tbxctrls/fillctrl.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 'svx/source/tbxctrls/fillctrl.cxx')
-rw-r--r--svx/source/tbxctrls/fillctrl.cxx30
1 files changed, 15 insertions, 15 deletions
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);
}