diff options
author | Noel Grandin <noel@peralex.com> | 2013-10-23 13:29:32 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-11-04 08:06:10 +0200 |
commit | 0e6a2601b39cbadaff7f7506ba9e804f108060db (patch) | |
tree | ffd6bb4970f689d20087b721eb8dfd4bc86cd53f /svx | |
parent | 457b349edbaf6d9dc747f3a631fee70e0c035bae (diff) |
Convert code that calls OUString::getStr()[] to use the [] operator
This also means that this code now gets bounds checked in debug builds.
Change-Id: Id777f85eaee6a737bbcb84625e6e110abe0e0f27
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/dialog/svxbmpnumvalueset.cxx | 8 | ||||
-rw-r--r-- | svx/source/fmcomp/dbaexchange.cxx | 2 | ||||
-rw-r--r-- | svx/source/sidebar/nbdtmg.cxx | 18 |
3 files changed, 13 insertions, 15 deletions
diff --git a/svx/source/dialog/svxbmpnumvalueset.cxx b/svx/source/dialog/svxbmpnumvalueset.cxx index b620965eef9a..31e83a00b582 100644 --- a/svx/source/dialog/svxbmpnumvalueset.cxx +++ b/svx/source/dialog/svxbmpnumvalueset.cxx @@ -316,8 +316,7 @@ void SvxNumValueSet::UserDraw( const UserDrawEvent& rUDEvt ) aLeft.Y() -= (pDev->GetTextHeight()/2); if(!sPrefixes[i].isEmpty() && - sPrefixes[i] != " " && - sPrefixes[i].getStr()[0] != 0) + sPrefixes[i] != " ") { pVDev->SetFont(aFont); pVDev->DrawText(aLeft, sPrefixes[i]); @@ -349,9 +348,8 @@ void SvxNumValueSet::UserDraw( const UserDrawEvent& rUDEvt ) aLeft, aRuleFont, aFont); - if(!sSuffixes[i].isEmpty()&& - !sSuffixes[i].equalsAsciiL(" ", 1) && - sSuffixes[i].getStr()[0] != 0) + if(!sSuffixes[i].isEmpty() && + !sSuffixes[i].startsWith(" ")) { pVDev->SetFont(aFont); pVDev->DrawText(aLeft, sSuffixes[i]); diff --git a/svx/source/fmcomp/dbaexchange.cxx b/svx/source/fmcomp/dbaexchange.cxx index dc9454ac034d..e5a974d7023f 100644 --- a/svx/source/fmcomp/dbaexchange.cxx +++ b/svx/source/fmcomp/dbaexchange.cxx @@ -467,7 +467,7 @@ namespace svx sal_Int32 nDescriptorLen = m_sCompatibleObjectDescription.getLength(); if (nDescriptorLen) { - if (m_sCompatibleObjectDescription.getStr()[nDescriptorLen] == 11) + if (m_sCompatibleObjectDescription[nDescriptorLen] == 11) m_sCompatibleObjectDescription = m_sCompatibleObjectDescription.copy(0, nDescriptorLen - 1); if (nDescriptorLen) diff --git a/svx/source/sidebar/nbdtmg.cxx b/svx/source/sidebar/nbdtmg.cxx index 3349c8e987d9..77ee1f57d256 100644 --- a/svx/source/sidebar/nbdtmg.cxx +++ b/svx/source/sidebar/nbdtmg.cxx @@ -127,8 +127,8 @@ NumSettings_ImplPtr lcl_CreateNumberingSettingsPtr(const Sequence<PropertyValue> else if(pValues[j].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sBulletFontName))) pValues[j].Value >>= pNew->sBulletFont; } - const sal_Unicode cLocalPrefix = pNew->sPrefix.getLength() ? pNew->sPrefix.getStr()[0] : 0; - const sal_Unicode cLocalSuffix = pNew->sSuffix.getLength() ? pNew->sSuffix.getStr()[0] : 0; + const sal_Unicode cLocalPrefix = pNew->sPrefix.getLength() ? pNew->sPrefix[0] : 0; + const sal_Unicode cLocalSuffix = pNew->sSuffix.getLength() ? pNew->sSuffix[0] : 0; OUString aEmptyStr; if( cLocalPrefix == ' ') pNew->sPrefix=aEmptyStr; if( cLocalSuffix == ' ') pNew->sSuffix=aEmptyStr; @@ -1407,8 +1407,8 @@ sal_uInt16 NumberingTypeMgr::GetNBOIndexForNumRule(SvxNumRule& aNum,sal_uInt16 m return (sal_uInt16)0xFFFF; SvxNumberFormat aFmt(aNum.GetLevel(nActLv)); - //sal_Unicode cPrefix = rtl::OUString(aFmt.GetPrefix()).getStr()[0]; - //sal_Unicode cSuffix = rtl::OUString(aFmt.GetSuffix()).getStr()[0]; + //sal_Unicode cPrefix = rtl::OUString(aFmt.GetPrefix())[0]; + //sal_Unicode cSuffix = rtl::OUString(aFmt.GetSuffix())[0]; OUString sPreFix = aFmt.GetPrefix(); OUString sLclSuffix = aFmt.GetSuffix(); sal_Int16 eNumType = aFmt.GetNumberingType(); @@ -1446,8 +1446,8 @@ sal_Bool NumberingTypeMgr::RelplaceNumRule(SvxNumRule& aNum,sal_uInt16 nIndex,sa return sal_False; SvxNumberFormat aFmt(aNum.GetLevel(nActLv)); - //sal_Unicode cPrefix = rtl::OUString(aFmt.GetPrefix()).getStr()[0]; - //sal_Unicode cSuffix = rtl::OUString(aFmt.GetSuffix()).getStr()[0]; + //sal_Unicode cPrefix = rtl::OUString(aFmt.GetPrefix())[0]; + //sal_Unicode cSuffix = rtl::OUString(aFmt.GetSuffix())[0]; sal_Int16 eNumType = aFmt.GetNumberingType(); sal_uInt16 nCount = pNumberSettingsArr->size(); @@ -1641,7 +1641,7 @@ sal_uInt16 OutlineTypeMgr::GetNBOIndexForNumRule(SvxNumRule& aNum,sal_uInt16 /*m { sal_Unicode cChar = aFmt.GetBulletChar(); //const Font* pFont = aFmt.GetBulletFont(); - sal_Unicode ccChar = _pSet->sBulletChar.getStr()[0]; + sal_Unicode ccChar = _pSet->sBulletChar[0]; // rtl::OUString sFont = _pSet->sBulletFont; if ( !((cChar == ccChar) && //pFont && sFont.compareTo(pFont->GetName()) && _pSet->eLabelFollowedBy == aFmt.GetLabelFollowedBy() && @@ -1710,8 +1710,8 @@ sal_Bool OutlineTypeMgr::RelplaceNumRule(SvxNumRule& aNum,sal_uInt16 nIndex,sal_ for (sal_uInt16 iLevel=0;iLevel < nCount;iLevel++) { SvxNumberFormat aFmt(aNum.GetLevel(iLevel)); - //sal_Unicode cPrefix = rtl::OUString(aFmt.GetPrefix()).getStr()[0]; - //sal_Unicode cSuffix = rtl::OUString(aFmt.GetSuffix()).getStr()[0]; + //sal_Unicode cPrefix = rtl::OUString(aFmt.GetPrefix())[0]; + //sal_Unicode cSuffix = rtl::OUString(aFmt.GetSuffix())[0]; sal_Int16 eNumType = aFmt.GetNumberingType(); NumSettings_ImplPtr _pSet = (*pItemArr->pNumSettingsArr)[iLevel].get(); |