diff options
author | Jean-Noël Rouvignac <jn.rouvignac@gmail.com> | 2013-01-23 12:41:52 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2013-01-28 17:36:20 +0100 |
commit | 0dc532bffcda35d15a4719c05bb258e470355b98 (patch) | |
tree | ec7adac5e52ca5aebb52d06a2498654af82e1200 /sc | |
parent | 7e8e9031c6ef46d67d5579ca42d0c0f5975d4f98 (diff) |
fdo#38838 Some removal/replacement of the String/UniString with OUString
Changed SfxItemPool::GetPresentation( SfxItemPresentation ePres, SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric, String &rText ) const; to use OUString.
Change-Id: I656c1d321ff96f1f2e5b77f6adc103ef0a6fdf66
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/attrib.hxx | 10 | ||||
-rw-r--r-- | sc/inc/docpool.hxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/attrib.cxx | 91 | ||||
-rw-r--r-- | sc/source/core/data/docpool.cxx | 72 |
4 files changed, 75 insertions, 100 deletions
diff --git a/sc/inc/attrib.hxx b/sc/inc/attrib.hxx index 9b12f085955a..08979c25bd21 100644 --- a/sc/inc/attrib.hxx +++ b/sc/inc/attrib.hxx @@ -124,7 +124,7 @@ public: SfxItemPresentation ePres, SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric, - String& rText, + OUString& rText, const IntlWrapper* pIntl = 0 ) const; virtual int operator==( const SfxPoolItem& ) const; @@ -178,7 +178,7 @@ public: virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric, - String &rText, + OUString &rText, const IntlWrapper* pIntl = 0 ) const; virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; @@ -234,7 +234,7 @@ public: virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric, - String &rText, + OUString &rText, const IntlWrapper* pIntl = 0 ) const; virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; @@ -308,7 +308,7 @@ public: virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric, - String& rText, + OUString& rText, const IntlWrapper* pIntl = 0 ) const; }; @@ -375,7 +375,7 @@ public: virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePresentation, SfxMapUnit, SfxMapUnit, - XubString& rText, + OUString& rText, const IntlWrapper* = 0 ) const; virtual bool QueryValue( ::com::sun::star::uno::Any& rAny, sal_uInt8 nMemberId = 0 ) const; diff --git a/sc/inc/docpool.hxx b/sc/inc/docpool.hxx index f187a483c38a..242bb89a2bb2 100644 --- a/sc/inc/docpool.hxx +++ b/sc/inc/docpool.hxx @@ -61,7 +61,7 @@ public: const SfxPoolItem& rItem, SfxItemPresentation ePresentation, SfxMapUnit ePresentationMetric, - String& rText, + OUString& rText, const IntlWrapper* pIntl = 0 ) const; static void InitVersionMaps(); diff --git a/sc/source/core/data/attrib.cxx b/sc/source/core/data/attrib.cxx index 8bb813a0a81c..0d855957a9ac 100644 --- a/sc/source/core/data/attrib.cxx +++ b/sc/source/core/data/attrib.cxx @@ -332,19 +332,19 @@ SfxItemPresentation ScProtectionAttr::GetPresentation SfxItemPresentation ePres, SfxMapUnit /* eCoreMetric */, SfxMapUnit /* ePresMetric */, - String& rText, + OUString& rText, const IntlWrapper* /* pIntl */ ) const { - String aStrYes ( ScGlobal::GetRscString(STR_YES) ); - String aStrNo ( ScGlobal::GetRscString(STR_NO) ); - rtl::OUString aStrSep(": "); - rtl::OUString aStrDelim( ", "); + OUString aStrYes ( ScGlobal::GetRscString(STR_YES) ); + OUString aStrNo ( ScGlobal::GetRscString(STR_NO) ); + OUString aStrSep(": "); + OUString aStrDelim( ", "); switch ( ePres ) { case SFX_ITEM_PRESENTATION_NONE: - rText.Erase(); + rText = OUString(); break; case SFX_ITEM_PRESENTATION_NAMELESS: @@ -352,14 +352,14 @@ SfxItemPresentation ScProtectionAttr::GetPresentation break; case SFX_ITEM_PRESENTATION_COMPLETE: - rText = ScGlobal::GetRscString(STR_PROTECTION); rText += aStrSep; - rText += (bProtection ? aStrYes : aStrNo); rText += aStrDelim; - rText += ScGlobal::GetRscString(STR_FORMULAS); rText += aStrSep; - rText += (!bHideFormula ? aStrYes : aStrNo); rText += aStrDelim; - rText += ScGlobal::GetRscString(STR_HIDE); rText += aStrSep; - rText += (bHideCell ? aStrYes : aStrNo); rText += aStrDelim; - rText += ScGlobal::GetRscString(STR_PRINT); rText += aStrSep; - rText += (!bHidePrint ? aStrYes : aStrNo); + rText = ScGlobal::GetRscString(STR_PROTECTION) + aStrSep + + (bProtection ? aStrYes : aStrNo) + aStrDelim + + ScGlobal::GetRscString(STR_FORMULAS) + aStrSep + + (!bHideFormula ? aStrYes : aStrNo) + aStrDelim + + ScGlobal::GetRscString(STR_HIDE) + aStrSep + + (bHideCell ? aStrYes : aStrNo) + aStrDelim + + ScGlobal::GetRscString(STR_PRINT) + aStrSep + + (!bHidePrint ? aStrYes : aStrNo); break; default: @@ -462,17 +462,16 @@ SfxItemPresentation ScRangeItem::GetPresentation SfxItemPresentation ePres, SfxMapUnit /* eCoreUnit */, SfxMapUnit /* ePresUnit */, - String& rText, - const IntlWrapper* /* pIntl */ + OUString& rText, + const IntlWrapper* /* pIntl */ ) const { - rText.Erase(); + rText = OUString(); switch ( ePres ) { case SFX_ITEM_PRESENTATION_COMPLETE: - rText = ScGlobal::GetRscString(STR_AREA); - rText.AppendAscii(RTL_CONSTASCII_STRINGPARAM( ": " )); + rText = OUString(ScGlobal::GetRscString(STR_AREA)) + ": "; /* !!! fall-through !!! */ case SFX_ITEM_PRESENTATION_NAMELESS: @@ -578,34 +577,32 @@ SfxItemPresentation ScTableListItem::GetPresentation SfxItemPresentation ePres, SfxMapUnit /* eCoreUnit */, SfxMapUnit /* ePresUnit */, - String& rText, + OUString& rText, const IntlWrapper* /* pIntl */ ) const { - const sal_Unicode cDelim = ','; - switch ( ePres ) { case SFX_ITEM_PRESENTATION_NONE: - rText.Erase(); + rText = OUString(); return ePres; case SFX_ITEM_PRESENTATION_NAMELESS: { - rText = '('; + rText = "("; if ( nCount>0 && pTabArr ) for ( sal_uInt16 i=0; i<nCount; i++ ) { - rText += String::CreateFromInt32( pTabArr[i] ); + rText += OUString::number( pTabArr[i] ); if ( i<(nCount-1) ) - rText += cDelim; + rText += ","; } - rText += ')'; + rText += ")"; } return ePres; case SFX_ITEM_PRESENTATION_COMPLETE: - rText.Erase(); + rText = OUString(); return SFX_ITEM_PRESENTATION_NONE; default: @@ -952,12 +949,12 @@ SfxItemPresentation ScViewObjectModeItem::GetPresentation SfxItemPresentation ePres, SfxMapUnit /* eCoreUnit */, SfxMapUnit /* ePresUnit */, - String& rText, + OUString& rText, const IntlWrapper* /* pIntl */ ) const { - rtl::OUString aDel(": "); - rText.Erase(); + OUString aDel(": "); + rText = OUString(); switch ( ePres ) { @@ -965,18 +962,15 @@ SfxItemPresentation ScViewObjectModeItem::GetPresentation switch( Which() ) { case SID_SCATTR_PAGE_CHARTS: - rText = ScGlobal::GetRscString(STR_VOBJ_CHART); - rText += aDel; + rText = ScGlobal::GetRscString(STR_VOBJ_CHART) + aDel; break; case SID_SCATTR_PAGE_OBJECTS: - rText = ScGlobal::GetRscString(STR_VOBJ_OBJECT); - rText += aDel; + rText = ScGlobal::GetRscString(STR_VOBJ_OBJECT) + aDel; break; case SID_SCATTR_PAGE_DRAWINGS: - rText = ScGlobal::GetRscString(STR_VOBJ_DRAWINGS); - rText += aDel; + rText = ScGlobal::GetRscString(STR_VOBJ_DRAWINGS) + aDel; break; default: @@ -1144,31 +1138,30 @@ int ScPageScaleToItem::operator==( const SfxPoolItem& rCmp ) const } namespace { -void lclAppendScalePageCount( String& rText, sal_uInt16 nPages ) +void lclAppendScalePageCount( OUString& rText, sal_uInt16 nPages ) { - rText.AppendAscii( ": " ); + rText += ": "; if( nPages ) { - String aPages( ScGlobal::GetRscString( STR_SCATTR_PAGE_SCALE_PAGES ) ); - aPages.SearchAndReplaceAscii( "%1", String::CreateFromInt32( nPages ) ); - rText.Append( aPages ); + OUString aPages( ScGlobal::GetRscString( STR_SCATTR_PAGE_SCALE_PAGES ) ); + rText += aPages.replaceFirst( "%1", OUString::number( nPages ) ); } else - rText.Append( ScGlobal::GetRscString( STR_SCATTR_PAGE_SCALE_AUTO ) ); + rText += ScGlobal::GetRscString( STR_SCATTR_PAGE_SCALE_AUTO ); } } // namespace SfxItemPresentation ScPageScaleToItem::GetPresentation( - SfxItemPresentation ePres, SfxMapUnit, SfxMapUnit, XubString& rText, const IntlWrapper* ) const + SfxItemPresentation ePres, SfxMapUnit, SfxMapUnit, OUString& rText, const IntlWrapper* ) const { - rText.Erase(); + rText = OUString(); if( !IsValid() || (ePres == SFX_ITEM_PRESENTATION_NONE) ) return SFX_ITEM_PRESENTATION_NONE; - String aName( ScGlobal::GetRscString( STR_SCATTR_PAGE_SCALETO ) ); - String aValue( ScGlobal::GetRscString( STR_SCATTR_PAGE_SCALE_WIDTH ) ); + OUString aName( ScGlobal::GetRscString( STR_SCATTR_PAGE_SCALETO ) ); + OUString aValue( ScGlobal::GetRscString( STR_SCATTR_PAGE_SCALE_WIDTH ) ); lclAppendScalePageCount( aValue, mnWidth ); - aValue.AppendAscii( ", " ).Append( ScGlobal::GetRscString( STR_SCATTR_PAGE_SCALE_HEIGHT ) ); + aValue = aValue + ", " + ScGlobal::GetRscString( STR_SCATTR_PAGE_SCALE_HEIGHT ); lclAppendScalePageCount( aValue, mnHeight ); switch( ePres ) @@ -1185,7 +1178,7 @@ SfxItemPresentation ScPageScaleToItem::GetPresentation( break; case SFX_ITEM_PRESENTATION_COMPLETE: - rText.Assign( aName ).AppendAscii( " (" ).Append( aValue ).Append( ')' ); + rText = aName + " (" + aValue + ")"; break; default: diff --git a/sc/source/core/data/docpool.cxx b/sc/source/core/data/docpool.cxx index 7e422db10115..63ed640a78f3 100644 --- a/sc/source/core/data/docpool.cxx +++ b/sc/source/core/data/docpool.cxx @@ -696,7 +696,7 @@ static SfxItemPresentation lcl_HFPresentation SfxItemPresentation ePresentation, SfxMapUnit eCoreMetric, SfxMapUnit ePresentationMetric, - String& rText, + OUString& rText, const IntlWrapper* pIntl ) { @@ -711,14 +711,14 @@ static SfxItemPresentation lcl_HFPresentation SfxItemIter aIter( rSet ); pItem = aIter.FirstItem(); - String aText; - rtl::OUString aDel(" + "); + OUString aText; + OUString aDel(" + "); while( pItem ) { sal_uInt16 nWhich = pItem->Which(); - aText.Erase(); + aText = ""; switch( nWhich ) { @@ -742,8 +742,7 @@ static SfxItemPresentation lcl_HFPresentation aText = EE_RESSTR(RID_SVXITEMS_LRSPACE_LEFT); if ( 100 != nPropLeftMargin ) { - aText += String::CreateFromInt32( nPropLeftMargin ); - aText += '%'; + aText = aText + OUString::number( nPropLeftMargin ) + "%"; } else { @@ -758,8 +757,7 @@ static SfxItemPresentation lcl_HFPresentation aText += EE_RESSTR(RID_SVXITEMS_LRSPACE_RIGHT); if ( 100 != nPropRightMargin ) { - aText += String::CreateFromInt32( nPropRightMargin ); - aText += '%'; + aText = aText + OUString::number( nPropLeftMargin ) + "%"; } else { @@ -777,10 +775,9 @@ static SfxItemPresentation lcl_HFPresentation } - if ( aText.Len() ) + if ( aText.getLength() ) { - rText += aText; - rText += aDel; + rText = rText + aText + aDel; } pItem = aIter.NextItem(); @@ -796,13 +793,13 @@ SfxItemPresentation ScDocumentPool::GetPresentation( const SfxPoolItem& rItem, SfxItemPresentation ePresentation, SfxMapUnit ePresentationMetric, - String& rText, + OUString& rText, const IntlWrapper* pIntl ) const { sal_uInt16 nW = rItem.Which(); - String aStrYes ( ScGlobal::GetRscString(STR_YES) ); - String aStrNo ( ScGlobal::GetRscString(STR_NO) ); - rtl::OUString aStrSep(": "); + OUString aStrYes ( ScGlobal::GetRscString(STR_YES) ); + OUString aStrNo ( ScGlobal::GetRscString(STR_NO) ); + OUString aStrSep(": "); switch( nW ) { @@ -810,8 +807,7 @@ SfxItemPresentation ScDocumentPool::GetPresentation( switch ( ePresentation ) { case SFX_ITEM_PRESENTATION_COMPLETE: - rText = ScGlobal::GetRscString(STR_SCATTR_PAGE_PRINTDIR); - rText += aStrSep; + rText = ScGlobal::GetRscString(STR_SCATTR_PAGE_PRINTDIR) + aStrSep; // break; // DURCHFALLEN!!! case SFX_ITEM_PRESENTATION_NAMELESS: rText += ((const SfxBoolItem&)rItem).GetValue() ? @@ -829,8 +825,7 @@ SfxItemPresentation ScDocumentPool::GetPresentation( switch ( ePresentation ) { case SFX_ITEM_PRESENTATION_COMPLETE: - rText = ScGlobal::GetRscString(STR_SCATTR_PAGE_HEADERS); - rText += aStrSep; + rText = ScGlobal::GetRscString(STR_SCATTR_PAGE_HEADERS) + aStrSep; // break; // DURCHFALLEN!!! case SFX_ITEM_PRESENTATION_NAMELESS: rText += ((const SfxBoolItem&)rItem).GetValue() ? aStrYes : aStrNo ; @@ -846,8 +841,7 @@ SfxItemPresentation ScDocumentPool::GetPresentation( switch ( ePresentation ) { case SFX_ITEM_PRESENTATION_COMPLETE: - rText = ScGlobal::GetRscString(STR_SCATTR_PAGE_NULLVALS); - rText += aStrSep; + rText = ScGlobal::GetRscString(STR_SCATTR_PAGE_NULLVALS) + aStrSep; // break; // DURCHFALLEN!!! case SFX_ITEM_PRESENTATION_NAMELESS: rText += ((const SfxBoolItem&)rItem).GetValue() ? aStrYes : aStrNo ; @@ -863,8 +857,7 @@ SfxItemPresentation ScDocumentPool::GetPresentation( switch ( ePresentation ) { case SFX_ITEM_PRESENTATION_COMPLETE: - rText = ScGlobal::GetRscString(STR_SCATTR_PAGE_FORMULAS); - rText += aStrSep; + rText = ScGlobal::GetRscString(STR_SCATTR_PAGE_FORMULAS) + aStrSep; // break; // DURCHFALLEN!!! case SFX_ITEM_PRESENTATION_NAMELESS: rText += ((const SfxBoolItem&)rItem).GetValue() ? aStrYes : aStrNo ; @@ -880,8 +873,7 @@ SfxItemPresentation ScDocumentPool::GetPresentation( switch ( ePresentation ) { case SFX_ITEM_PRESENTATION_COMPLETE: - rText = ScGlobal::GetRscString(STR_SCATTR_PAGE_NOTES); - rText += aStrSep; + rText = ScGlobal::GetRscString(STR_SCATTR_PAGE_NOTES) + aStrSep; // break; // DURCHFALLEN!!! case SFX_ITEM_PRESENTATION_NAMELESS: rText += ((const SfxBoolItem&)rItem).GetValue() ? aStrYes : aStrNo ; @@ -897,8 +889,7 @@ SfxItemPresentation ScDocumentPool::GetPresentation( switch ( ePresentation ) { case SFX_ITEM_PRESENTATION_COMPLETE: - rText = ScGlobal::GetRscString(STR_SCATTR_PAGE_GRID); - rText += aStrSep; + rText = ScGlobal::GetRscString(STR_SCATTR_PAGE_GRID) + aStrSep; // break; // DURCHFALLEN!!! case SFX_ITEM_PRESENTATION_NAMELESS: rText += ((const SfxBoolItem&)rItem).GetValue() ? aStrYes : aStrNo ; @@ -920,14 +911,14 @@ SfxItemPresentation ScDocumentPool::GetPresentation( { case SFX_ITEM_PRESENTATION_COMPLETE: { - rText.Assign( ScGlobal::GetRscString( STR_SCATTR_PAGE_SCALETOPAGES ) ).Append( aStrSep ); + rText = ScGlobal::GetRscString( STR_SCATTR_PAGE_SCALETOPAGES ) + aStrSep; } // break; // DURCHFALLEN!!! case SFX_ITEM_PRESENTATION_NAMELESS: { String aPages( ScGlobal::GetRscString( STR_SCATTR_PAGE_SCALE_PAGES ) ); aPages.SearchAndReplaceAscii( "%1", String::CreateFromInt32( nPagNo ) ); - rText.Append( aPages ); + rText += aPages; } break; default: @@ -952,8 +943,7 @@ SfxItemPresentation ScDocumentPool::GetPresentation( switch ( ePresentation ) { case SFX_ITEM_PRESENTATION_COMPLETE: - rText = ScGlobal::GetRscString(STR_SCATTR_PAGE_FIRSTPAGENO); - rText += aStrSep; + rText = ScGlobal::GetRscString(STR_SCATTR_PAGE_FIRSTPAGENO) + aStrSep; // break; // DURCHFALLEN!!! case SFX_ITEM_PRESENTATION_NAMELESS: rText += String::CreateFromInt32( nPagNo ); @@ -980,12 +970,10 @@ SfxItemPresentation ScDocumentPool::GetPresentation( switch ( ePresentation ) { case SFX_ITEM_PRESENTATION_COMPLETE: - rText = ScGlobal::GetRscString(STR_SCATTR_PAGE_SCALE); - rText += aStrSep; + rText = ScGlobal::GetRscString(STR_SCATTR_PAGE_SCALE) + aStrSep; // break; // DURCHFALLEN!!! case SFX_ITEM_PRESENTATION_NAMELESS: - rText += String::CreateFromInt32( nPercent ); - rText += '%'; + rText = rText + OUString::number( nPercent ) + "%"; break; default: { @@ -1002,28 +990,22 @@ SfxItemPresentation ScDocumentPool::GetPresentation( case ATTR_PAGE_HEADERSET: { - String aBuffer; + OUString aBuffer; if( lcl_HFPresentation( rItem, ePresentation, GetMetric( nW ), ePresentationMetric, aBuffer, pIntl ) != SFX_ITEM_PRESENTATION_NONE ) { - rText = ScGlobal::GetRscString(STR_HEADER); - rText.AppendAscii(RTL_CONSTASCII_STRINGPARAM( " ( " )); - rText += aBuffer; - rText.AppendAscii(RTL_CONSTASCII_STRINGPARAM( " ) " )); + rText = OUString(ScGlobal::GetRscString(STR_HEADER)) + " ( " + aBuffer + " ) "; } } break; case ATTR_PAGE_FOOTERSET: { - String aBuffer; + OUString aBuffer; if( lcl_HFPresentation( rItem, ePresentation, GetMetric( nW ), ePresentationMetric, aBuffer, pIntl ) != SFX_ITEM_PRESENTATION_NONE ) { - rText = ScGlobal::GetRscString(STR_FOOTER); - rText.AppendAscii(RTL_CONSTASCII_STRINGPARAM( " ( " )); - rText += aBuffer; - rText.AppendAscii(RTL_CONSTASCII_STRINGPARAM( " ) " )); + rText = OUString(ScGlobal::GetRscString(STR_FOOTER)) + " ( " + aBuffer + " ) "; } } break; |