diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-10-10 16:23:37 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-10-11 07:18:11 +0200 |
commit | cdbac696fb0cbb1d09645bc02799eed5504b192b (patch) | |
tree | 25ef63dbfb17fdafcd073cbc0c1d88bd5759e408 /editeng | |
parent | cfd06eb99b8f366bfe96e4a6d3112e4c6057098b (diff) |
simplify "a = a +" to "a +="
mostly so that my stringadd loplugin can point out places to improve
Change-Id: I9920ee1c99cdb6b811ba67ff9d8e32aa261884b5
Reviewed-on: https://gerrit.libreoffice.org/80618
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/items/frmitems.cxx | 58 | ||||
-rw-r--r-- | editeng/source/items/optitems.cxx | 3 | ||||
-rw-r--r-- | editeng/source/items/paraitem.cxx | 5 | ||||
-rw-r--r-- | editeng/source/items/textitem.cxx | 7 | ||||
-rw-r--r-- | editeng/source/rtf/svxrtf.cxx | 2 |
5 files changed, 29 insertions, 46 deletions
diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx index 4cb09608cf2e..1d74227313fe 100644 --- a/editeng/source/items/frmitems.cxx +++ b/editeng/source/items/frmitems.cxx @@ -556,8 +556,7 @@ bool SvxLRSpaceItem::GetPresentation Application::GetSettings().GetUILanguageTag()); else { - rText = rText + - GetMetricText( nLeftMargin, eCoreUnit, ePresUnit, &rIntl ) + + rText += GetMetricText( nLeftMargin, eCoreUnit, ePresUnit, &rIntl ) + " " + EditResId(GetMetricId(ePresUnit)); } rText += OUString(cpDelim); @@ -565,12 +564,11 @@ bool SvxLRSpaceItem::GetPresentation { rText += EditResId(RID_SVXITEMS_LRSPACE_FLINE); if ( 100 != nPropFirstLineOfst ) - rText = rText + unicode::formatPercent(nPropFirstLineOfst, - Application::GetSettings().GetUILanguageTag()); + rText += unicode::formatPercent(nPropFirstLineOfst, + Application::GetSettings().GetUILanguageTag()); else { - rText = rText + - GetMetricText( static_cast<long>(nFirstLineOfst), + rText += GetMetricText( static_cast<long>(nFirstLineOfst), eCoreUnit, ePresUnit, &rIntl ) + " " + EditResId(GetMetricId(ePresUnit)); } @@ -578,12 +576,11 @@ bool SvxLRSpaceItem::GetPresentation } rText += EditResId(RID_SVXITEMS_LRSPACE_RIGHT); if ( 100 != nPropRightMargin ) - rText = rText + unicode::formatPercent(nPropRightMargin, + rText += unicode::formatPercent(nPropRightMargin, Application::GetSettings().GetUILanguageTag()); else { - rText = rText + - GetMetricText( nRightMargin, + rText += GetMetricText( nRightMargin, eCoreUnit, ePresUnit, &rIntl ) + " " + EditResId(GetMetricId(ePresUnit)); } @@ -799,11 +796,10 @@ bool SvxULSpaceItem::GetPresentation } else { - rText = rText + - GetMetricText( static_cast<long>(nUpper), eCoreUnit, ePresUnit, &rIntl ) + + rText += GetMetricText( static_cast<long>(nUpper), eCoreUnit, ePresUnit, &rIntl ) + " " + EditResId(GetMetricId(ePresUnit)); } - rText = rText + OUString(cpDelim) + EditResId(RID_SVXITEMS_ULSPACE_LOWER); + rText += OUString(cpDelim) + EditResId(RID_SVXITEMS_ULSPACE_LOWER); if ( 100 != nPropLower ) { rText += unicode::formatPercent(nPropLower, @@ -811,8 +807,7 @@ bool SvxULSpaceItem::GetPresentation } else { - rText = rText + - GetMetricText( static_cast<long>(nLower), eCoreUnit, ePresUnit, &rIntl ) + + rText += GetMetricText( static_cast<long>(nLower), eCoreUnit, ePresUnit, &rIntl ) + " " + EditResId(GetMetricId(ePresUnit)); } return true; @@ -965,7 +960,7 @@ bool SvxProtectItem::GetPresentation if ( bSize ) pId = RID_SVXITEMS_PROT_SIZE_TRUE; - rText = rText + EditResId(pId) + OUString(cpDelim); + rText += EditResId(pId) + OUString(cpDelim); pId = RID_SVXITEMS_PROT_POS_FALSE; if ( bPos ) @@ -1176,8 +1171,7 @@ bool SvxShadowItem::GetPresentation if ( aShadowColor.GetTransparency() ) pId = RID_SVXITEMS_TRANSPARENT_TRUE; - rText = rText + - EditResId(pId) + + rText += EditResId(pId) + OUString(cpDelim) + GetMetricText( static_cast<long>(nWidth), eCoreUnit, ePresUnit, &rIntl ) + OUString(cpDelim) + @@ -1193,8 +1187,7 @@ bool SvxShadowItem::GetPresentation const char* pId = RID_SVXITEMS_TRANSPARENT_FALSE; if ( aShadowColor.GetTransparency() ) pId = RID_SVXITEMS_TRANSPARENT_TRUE; - rText = rText + - EditResId(pId) + + rText += EditResId(pId) + OUString(cpDelim) + GetMetricText( static_cast<long>(nWidth), eCoreUnit, ePresUnit, &rIntl ) + " " + EditResId(GetMetricId(ePresUnit)) + @@ -1722,23 +1715,22 @@ bool SvxBoxItem::GetPresentation { if ( pBottom ) { - rText = rText + pBottom->GetValueString( eCoreUnit, ePresUnit, &rIntl ) + cpDelimTmp; + rText += pBottom->GetValueString( eCoreUnit, ePresUnit, &rIntl ) + cpDelimTmp; } if ( pLeft ) { - rText = rText + pLeft->GetValueString( eCoreUnit, ePresUnit, &rIntl ) + cpDelimTmp; + rText += pLeft->GetValueString( eCoreUnit, ePresUnit, &rIntl ) + cpDelimTmp; } if ( pRight ) { - rText = rText + pRight->GetValueString( eCoreUnit, ePresUnit, &rIntl ) + cpDelimTmp; + rText += pRight->GetValueString( eCoreUnit, ePresUnit, &rIntl ) + cpDelimTmp; } } rText += GetMetricText( static_cast<long>(nTopDist), eCoreUnit, ePresUnit, &rIntl ); if( nTopDist != nBottomDist || nTopDist != nLeftDist || nTopDist != nRightDist ) { - rText = rText + - cpDelimTmp + + rText += cpDelimTmp + GetMetricText( static_cast<long>(nBottomDist), eCoreUnit, ePresUnit, &rIntl ) + cpDelimTmp + @@ -1767,29 +1759,25 @@ bool SvxBoxItem::GetPresentation { if ( pTop ) { - rText = rText + - EditResId(RID_SVXITEMS_BORDER_TOP) + + rText += EditResId(RID_SVXITEMS_BORDER_TOP) + pTop->GetValueString( eCoreUnit, ePresUnit, &rIntl, true ) + cpDelimTmp; } if ( pBottom ) { - rText = rText + - EditResId(RID_SVXITEMS_BORDER_BOTTOM) + + rText += EditResId(RID_SVXITEMS_BORDER_BOTTOM) + pBottom->GetValueString( eCoreUnit, ePresUnit, &rIntl, true ) + cpDelimTmp; } if ( pLeft ) { - rText = rText + - EditResId(RID_SVXITEMS_BORDER_LEFT) + + rText += EditResId(RID_SVXITEMS_BORDER_LEFT) + pLeft->GetValueString( eCoreUnit, ePresUnit, &rIntl, true ) + cpDelimTmp; } if ( pRight ) { - rText = rText + - EditResId(RID_SVXITEMS_BORDER_RIGHT) + + rText += EditResId(RID_SVXITEMS_BORDER_RIGHT) + pRight->GetValueString( eCoreUnit, ePresUnit, &rIntl, true ) + cpDelimTmp; } @@ -1800,15 +1788,13 @@ bool SvxBoxItem::GetPresentation if( nTopDist == nBottomDist && nTopDist == nLeftDist && nTopDist == nRightDist ) { - rText = rText + - GetMetricText( static_cast<long>(nTopDist), eCoreUnit, + rText += GetMetricText( static_cast<long>(nTopDist), eCoreUnit, ePresUnit, &rIntl ) + " " + EditResId(GetMetricId(ePresUnit)); } else { - rText = rText + - EditResId(RID_SVXITEMS_BORDER_TOP) + + rText += EditResId(RID_SVXITEMS_BORDER_TOP) + GetMetricText( static_cast<long>(nTopDist), eCoreUnit, ePresUnit, &rIntl ) + " " + EditResId(GetMetricId(ePresUnit)) + diff --git a/editeng/source/items/optitems.cxx b/editeng/source/items/optitems.cxx index 1186192c088b..aeeb15314e01 100644 --- a/editeng/source/items/optitems.cxx +++ b/editeng/source/items/optitems.cxx @@ -56,8 +56,7 @@ bool SfxHyphenRegionItem::GetPresentation const IntlWrapper& ) const { - rText = rText + - EditResId(RID_SVXITEMS_HYPHEN_MINLEAD).replaceAll("%1", OUString::number(nMinLead)) + + rText += EditResId(RID_SVXITEMS_HYPHEN_MINLEAD).replaceAll("%1", OUString::number(nMinLead)) + "," + EditResId(RID_SVXITEMS_HYPHEN_MINTRAIL).replaceAll("%1", OUString::number(nMinTrail)); return true; diff --git a/editeng/source/items/paraitem.cxx b/editeng/source/items/paraitem.cxx index ed159e14ed08..983f210dec3a 100644 --- a/editeng/source/items/paraitem.cxx +++ b/editeng/source/items/paraitem.cxx @@ -660,7 +660,7 @@ bool SvxHyphenZoneItem::GetPresentation if ( bPageEnd ) pId = RID_SVXITEMS_PAGE_END_TRUE; - rText = rText + EditResId(pId) + cpDelimTmp + + rText += EditResId(pId) + cpDelimTmp + OUString::number( nMinLead ) + cpDelimTmp + OUString::number( nMinTrail ) + cpDelimTmp + OUString::number( nMaxHyphens ); @@ -677,8 +677,7 @@ bool SvxHyphenZoneItem::GetPresentation if ( bPageEnd ) pId = RID_SVXITEMS_PAGE_END_TRUE; - rText = rText + - EditResId(pId) + + rText += EditResId(pId) + cpDelimTmp + EditResId(RID_SVXITEMS_HYPHEN_MINLEAD).replaceAll("%1", OUString::number(nMinLead)) + cpDelimTmp + diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx index ffb4e63e2e21..82889dc91be7 100644 --- a/editeng/source/items/textitem.cxx +++ b/editeng/source/items/textitem.cxx @@ -965,7 +965,7 @@ bool SvxTextLineItem::GetPresentation { rText = GetValueTextByPos( GetValue() ); if( !mColor.GetTransparency() ) - rText = rText + OUString(cpDelim) + ::GetColorString( mColor ); + rText += OUString(cpDelim) + ::GetColorString( mColor ); return true; } @@ -1540,8 +1540,7 @@ bool SvxKerningItem::GetPresentation if (pId) rText += EditResId(pId); - rText = rText + - GetMetricText( static_cast<long>(GetValue()), eCoreUnit, MapUnit::MapPoint, &rIntl ) + + rText += GetMetricText( static_cast<long>(GetValue()), eCoreUnit, MapUnit::MapPoint, &rIntl ) + " " + EditResId(GetMetricId(MapUnit::MapPoint)); return true; } @@ -1721,7 +1720,7 @@ bool SvxEscapementItem::GetPresentation if( DFLT_ESC_AUTO_SUPER == nEsc || DFLT_ESC_AUTO_SUB == nEsc ) rText += EditResId(RID_SVXITEMS_ESCAPEMENT_AUTO); else - rText = rText + OUString::number( nEsc ) + "%"; + rText += OUString::number( nEsc ) + "%"; } return true; } diff --git a/editeng/source/rtf/svxrtf.cxx b/editeng/source/rtf/svxrtf.cxx index f78fcb891454..7f5fdd34ac6a 100644 --- a/editeng/source/rtf/svxrtf.cxx +++ b/editeng/source/rtf/svxrtf.cxx @@ -559,7 +559,7 @@ void SvxRTFParser::ReadFontTable() { // All data from the font is available, so off to the table if (!sAltNm.isEmpty()) - sFntNm = sFntNm + ";" + sAltNm; + sFntNm += ";" + sAltNm; pFont->SetFamilyName( sFntNm ); m_FontTable.insert(std::make_pair(nInsFontNo, std::move(pFont))); |