diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-10-09 16:54:36 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-10-10 08:13:42 +0200 |
commit | cfa4801cd0d8bfd5d6e692c0a3afa9639df45522 (patch) | |
tree | d5b21b9c8166cec5e34baf5db1fe36f250abf232 | |
parent | 3277446dc37f445b4d95a6c1272caf20242518c5 (diff) |
rename TakeItemName -> GetItemName
and return a value instead of the awkward out-parameter
Change-Id: I3b68c4e3b31f3ebc84ac5aecfb393c8d89e60b62
Reviewed-on: https://gerrit.libreoffice.org/80550
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | include/svx/svdpool.hxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svdattr.cxx | 132 | ||||
-rw-r--r-- | svx/source/svdraw/svdibrow.cxx | 2 |
3 files changed, 30 insertions, 106 deletions
diff --git a/include/svx/svdpool.hxx b/include/svx/svdpool.hxx index 13c5fddd31d7..04bd7c83f2e6 100644 --- a/include/svx/svdpool.hxx +++ b/include/svx/svdpool.hxx @@ -42,7 +42,7 @@ public: OUString& rText, const IntlWrapper& rIntlWrapper) const override; - static void TakeItemName(sal_uInt16 nWhich, OUString& rItemName); + static OUString GetItemName(sal_uInt16 nWhich); }; #endif // INCLUDED_SVX_SVDPOOL_HXX diff --git a/svx/source/svdraw/svdattr.cxx b/svx/source/svdraw/svdattr.cxx index 274a3541a2ec..80ee71ba8da7 100644 --- a/svx/source/svdraw/svdattr.cxx +++ b/svx/source/svdraw/svdattr.cxx @@ -382,10 +382,7 @@ bool SdrItemPool::GetPresentation( rItem.GetPresentation(SfxItemPresentation::Nameless, GetMetric(nWhich),ePresentationMetric,rText, rIntlWrapper); - OUString aStr; - - TakeItemName(nWhich, aStr); - rText = aStr + " " + rText; + rText = GetItemName(nWhich) + " " + rText; return true; } @@ -393,7 +390,7 @@ bool SdrItemPool::GetPresentation( return XOutdevItemPool::GetPresentation(rItem,ePresentationMetric,rText,rIntlWrapper); } -void SdrItemPool::TakeItemName(sal_uInt16 nWhich, OUString& rItemName) +OUString SdrItemPool::GetItemName(sal_uInt16 nWhich) { const char* pResId = SIP_UNKNOWN_ATTR; @@ -612,7 +609,7 @@ void SdrItemPool::TakeItemName(sal_uInt16 nWhich, OUString& rItemName) case EE_FEATURE_FIELD : pResId = SIP_EE_FEATURE_FIELD;break; } // switch - rItemName = SvxResId(pResId); + return SvxResId(pResId); } @@ -646,10 +643,7 @@ bool SdrFractionItem::GetPresentation( if(ePresentation == SfxItemPresentation::Complete) { - OUString aStr; - - SdrItemPool::TakeItemName(Which(), aStr); - rText = aStr + " " + rText; + rText = SdrItemPool::GetItemName(Which()) + " " + rText; return true; } else if(ePresentation == SfxItemPresentation::Nameless) @@ -684,10 +678,7 @@ bool SdrScaleItem::GetPresentation( if(ePresentation == SfxItemPresentation::Complete) { - OUString aStr; - - SdrItemPool::TakeItemName(Which(), aStr); - rText = aStr + " " + rText; + rText = SdrItemPool::GetItemName(Which()) + " " + rText; } return true; @@ -719,10 +710,7 @@ bool SdrOnOffItem::GetPresentation(SfxItemPresentation ePres, { rText=GetValueTextByVal(GetValue()); if (ePres==SfxItemPresentation::Complete) { - OUString aStr; - - SdrItemPool::TakeItemName(Which(), aStr); - rText = aStr + " " + rText; + rText = SdrItemPool::GetItemName(Which()) + " " + rText; } return true; } @@ -745,10 +733,7 @@ bool SdrYesNoItem::GetPresentation(SfxItemPresentation ePres, { rText=GetValueTextByVal(GetValue()); if (ePres==SfxItemPresentation::Complete) { - OUString aStr; - - SdrItemPool::TakeItemName(Which(), aStr); - rText = aStr + " " + rText; + rText = SdrItemPool::GetItemName(Which()) + " " + rText; } return true; } @@ -771,10 +756,7 @@ bool SdrPercentItem::GetPresentation( if(ePres == SfxItemPresentation::Complete) { - OUString aStr; - - SdrItemPool::TakeItemName(Which(), aStr); - rText = aStr + " " + rText; + rText = SdrItemPool::GetItemName(Which()) + " " + rText; } return true; @@ -840,9 +822,7 @@ bool SdrAngleItem::GetPresentation( if(ePres == SfxItemPresentation::Complete) { - OUString aStr; - - SdrItemPool::TakeItemName(Which(), aStr); + OUString aStr = SdrItemPool::GetItemName(Which()); aText.insert(0, ' '); aText.insert(0, aStr); } @@ -886,10 +866,7 @@ bool SdrMetricItem::GetPresentation(SfxItemPresentation ePres, SdrFormatter::TakeUnitStr(ePresMetric,aStr); rText += " " + aStr; if (ePres==SfxItemPresentation::Complete) { - OUString aStr2; - - SdrItemPool::TakeItemName(Which(), aStr2); - rText = aStr2 + " " + rText; + rText = SdrItemPool::GetItemName(Which()) + " " + rText; } return true; } @@ -920,10 +897,7 @@ bool SdrCaptionTypeItem::GetPresentation(SfxItemPresentation ePres, { rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue())); if (ePres==SfxItemPresentation::Complete) { - OUString aStr; - - SdrItemPool::TakeItemName(Which(), aStr); - rText = aStr + " " + rText; + rText = SdrItemPool::GetItemName(Which()) + " " + rText; } return true; } @@ -950,10 +924,7 @@ bool SdrCaptionEscDirItem::GetPresentation(SfxItemPresentation ePres, { rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue())); if (ePres==SfxItemPresentation::Complete) { - OUString aStr; - - SdrItemPool::TakeItemName(Which(), aStr); - rText = aStr + " " + rText; + rText = SdrItemPool::GetItemName(Which()) + " " + rText; } return true; } @@ -988,10 +959,7 @@ bool SdrTextFitToSizeTypeItem::GetPresentation(SfxItemPresentation ePres, { rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue())); if (ePres==SfxItemPresentation::Complete) { - OUString aStr; - - SdrItemPool::TakeItemName(Which(), aStr); - rText = aStr + " " + rText; + rText = SdrItemPool::GetItemName(Which()) + " " + rText; } return true; } @@ -1054,10 +1022,7 @@ bool SdrTextVertAdjustItem::GetPresentation(SfxItemPresentation ePres, { rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue())); if (ePres==SfxItemPresentation::Complete) { - OUString aStr; - - SdrItemPool::TakeItemName(Which(), aStr); - rText = aStr + " " + rText; + rText = SdrItemPool::GetItemName(Which()) + " " + rText; } return true; } @@ -1116,10 +1081,7 @@ bool SdrTextHorzAdjustItem::GetPresentation(SfxItemPresentation ePres, { rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue())); if (ePres==SfxItemPresentation::Complete) { - OUString aStr; - - SdrItemPool::TakeItemName(Which(), aStr); - rText = aStr + " " + rText; + rText = SdrItemPool::GetItemName(Which()) + " " + rText; } return true; } @@ -1171,10 +1133,7 @@ bool SdrTextAniKindItem::GetPresentation(SfxItemPresentation ePres, { rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue())); if (ePres==SfxItemPresentation::Complete) { - OUString aStr; - - SdrItemPool::TakeItemName(Which(), aStr); - rText = aStr + " " + rText; + rText = SdrItemPool::GetItemName(Which()) + " " + rText; } return true; } @@ -1224,10 +1183,7 @@ bool SdrTextAniDirectionItem::GetPresentation(SfxItemPresentation ePres, { rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue())); if (ePres==SfxItemPresentation::Complete) { - OUString aStr; - - SdrItemPool::TakeItemName(Which(), aStr); - rText = aStr + " " + rText; + rText = SdrItemPool::GetItemName(Which()) + " " + rText; } return true; } @@ -1266,10 +1222,7 @@ bool SdrTextAniDelayItem::GetPresentation( if(ePres == SfxItemPresentation::Complete) { - OUString aStr; - - SdrItemPool::TakeItemName(Which(), aStr); - rText = aStr + " " + rText; + rText = SdrItemPool::GetItemName(Which()) + " " + rText; } return true; @@ -1319,10 +1272,7 @@ bool SdrTextAniAmountItem::GetPresentation( if(ePres == SfxItemPresentation::Complete) { - OUString aStr; - - SdrItemPool::TakeItemName(Which(), aStr); - rText = aStr + " " + rText; + rText = SdrItemPool::GetItemName(Which()) + " " + rText; } return true; @@ -1340,9 +1290,7 @@ bool SdrTextFixedCellHeightItem::GetPresentation( SfxItemPresentation ePres, rText = GetValueTextByVal( GetValue() ); if (ePres==SfxItemPresentation::Complete) { - OUString aStr; - SdrItemPool::TakeItemName(Which(), aStr); - rText = aStr + " " + rText; + rText = SdrItemPool::GetItemName(Which()) + " " + rText; } return true; } @@ -1390,10 +1338,7 @@ bool SdrEdgeKindItem::GetPresentation(SfxItemPresentation ePres, { rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue())); if (ePres==SfxItemPresentation::Complete) { - OUString aStr; - - SdrItemPool::TakeItemName(Which(), aStr); - rText = aStr + " " + rText; + rText = SdrItemPool::GetItemName(Which()) + " " + rText; } return true; } @@ -1559,10 +1504,7 @@ bool SdrMeasureKindItem::GetPresentation(SfxItemPresentation ePres, { rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue())); if (ePres==SfxItemPresentation::Complete) { - OUString aStr; - - SdrItemPool::TakeItemName(Which(), aStr); - rText = aStr + " " + rText; + rText = SdrItemPool::GetItemName(Which()) + " " + rText; } return true; } @@ -1612,10 +1554,7 @@ bool SdrMeasureTextHPosItem::GetPresentation(SfxItemPresentation ePres, { rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue())); if (ePres==SfxItemPresentation::Complete) { - OUString aStr; - - SdrItemPool::TakeItemName(Which(), aStr); - rText = aStr + " " + rText; + rText = SdrItemPool::GetItemName(Which()) + " " + rText; } return true; } @@ -1666,10 +1605,7 @@ bool SdrMeasureTextVPosItem::GetPresentation(SfxItemPresentation ePres, { rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue())); if (ePres==SfxItemPresentation::Complete) { - OUString aStr; - - SdrItemPool::TakeItemName(Which(), aStr); - rText = aStr + " " + rText; + rText = SdrItemPool::GetItemName(Which()) + " " + rText; } return true; } @@ -1717,10 +1653,7 @@ bool SdrMeasureUnitItem::GetPresentation(SfxItemPresentation ePres, { rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue())); if (ePres==SfxItemPresentation::Complete) { - OUString aStr; - - SdrItemPool::TakeItemName(Which(), aStr); - rText = aStr + " " + rText; + rText = SdrItemPool::GetItemName(Which()) + " " + rText; } return true; } @@ -1764,10 +1697,7 @@ bool SdrCircKindItem::GetPresentation(SfxItemPresentation ePres, { rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue())); if (ePres==SfxItemPresentation::Complete) { - OUString aStr; - - SdrItemPool::TakeItemName(Which(), aStr); - rText = aStr + " " + rText; + rText = SdrItemPool::GetItemName(Which()) + " " + rText; } return true; } @@ -1812,10 +1742,7 @@ bool SdrSignedPercentItem::GetPresentation( if(ePres == SfxItemPresentation::Complete) { - OUString aStr; - - SdrItemPool::TakeItemName(Which(), aStr); - rText = aStr + " " + rText; + rText = SdrItemPool::GetItemName(Which()) + " " + rText; } return true; @@ -1935,10 +1862,7 @@ bool SdrGrafModeItem::GetPresentation( SfxItemPresentation ePres, if( ePres == SfxItemPresentation::Complete ) { - OUString aStr; - - SdrItemPool::TakeItemName( Which(), aStr ); - rText = aStr + " " + rText; + rText = SdrItemPool::GetItemName( Which() ) + " " + rText; } return true; diff --git a/svx/source/svdraw/svdibrow.cxx b/svx/source/svdraw/svdibrow.cxx index 91cbd07ff29f..532df4f7a8b2 100644 --- a/svx/source/svdraw/svdibrow.cxx +++ b/svx/source/svdraw/svdibrow.cxx @@ -937,7 +937,7 @@ void SdrItemBrowserControl::SetAttributes(const SfxItemSet* pSet, const SfxItemS } nWhich0=nWhich; ImpItemListRow aEntry; - SdrItemPool::TakeItemName(nWhich, aEntry.aName); + aEntry.aName = SdrItemPool::GetItemName(nWhich); nIndent*=2; while(nIndent > 0) |