diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-07-25 09:27:58 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-07-25 09:56:02 +0100 |
commit | 75a66d2d1f295a1a9a488f0a12c672a975ffaf81 (patch) | |
tree | 8dcfa78afce8b1c4ba5b06ebf3b90b5ec67e3baf /svx/source/svdraw | |
parent | 12a034623e015ca05b56c82ebb63230ce731bab4 (diff) |
convert TakeObjNameSingul family to OUString
Change-Id: I0c667cbcfcc1ea1f04d113a53b7ba83c943052e4
Diffstat (limited to 'svx/source/svdraw')
-rw-r--r-- | svx/source/svdraw/svddrgv.cxx | 5 | ||||
-rw-r--r-- | svx/source/svdraw/svdedtv2.cxx | 4 | ||||
-rw-r--r-- | svx/source/svdraw/svdedxv.cxx | 3 | ||||
-rw-r--r-- | svx/source/svdraw/svdmark.cxx | 4 | ||||
-rw-r--r-- | svx/source/svdraw/svdoashp.cxx | 17 | ||||
-rw-r--r-- | svx/source/svdraw/svdobj.cxx | 20 | ||||
-rw-r--r-- | svx/source/svdraw/svdocapt.cxx | 18 | ||||
-rw-r--r-- | svx/source/svdraw/svdocirc.cxx | 17 | ||||
-rw-r--r-- | svx/source/svdraw/svdoedge.cxx | 17 | ||||
-rw-r--r-- | svx/source/svdraw/svdograf.cxx | 74 | ||||
-rw-r--r-- | svx/source/svdraw/svdogrp.cxx | 22 | ||||
-rw-r--r-- | svx/source/svdraw/svdomeas.cxx | 18 | ||||
-rw-r--r-- | svx/source/svdraw/svdomedia.cxx | 18 | ||||
-rw-r--r-- | svx/source/svdraw/svdoole2.cxx | 16 | ||||
-rw-r--r-- | svx/source/svdraw/svdopage.cxx | 18 | ||||
-rw-r--r-- | svx/source/svdraw/svdopath.cxx | 45 | ||||
-rw-r--r-- | svx/source/svdraw/svdorect.cxx | 42 | ||||
-rw-r--r-- | svx/source/svdraw/svdotext.cxx | 17 | ||||
-rw-r--r-- | svx/source/svdraw/svdouno.cxx | 18 | ||||
-rw-r--r-- | svx/source/svdraw/svdovirt.cxx | 22 | ||||
-rw-r--r-- | svx/source/svdraw/svdundo.cxx | 3 | ||||
-rw-r--r-- | svx/source/svdraw/svdview.cxx | 2 |
22 files changed, 222 insertions, 198 deletions
diff --git a/svx/source/svdraw/svddrgv.cxx b/svx/source/svdraw/svddrgv.cxx index e4cbdd40e188..da555ea0ab9d 100644 --- a/svx/source/svdraw/svddrgv.cxx +++ b/svx/source/svdraw/svddrgv.cxx @@ -640,8 +640,7 @@ sal_Bool SdrDragView::ImpBegInsObjPoint(sal_Bool bIdxZwang, sal_uInt32 nIdx, con DBG_ASSERT( pInsPointUndo, "svx::SdrDragView::BegInsObjPoint(), could not create correct undo object!" ); XubString aStr(ImpGetResStr(STR_DragInsertPoint)); - XubString aName; - pMarkedObj->TakeObjNameSingul(aName); + OUString aName(pMarkedObj->TakeObjNameSingul()); xub_StrLen nPos(aStr.SearchAscii("%1")); if(STRING_NOTFOUND != nPos) @@ -751,7 +750,7 @@ sal_Bool SdrDragView::BegInsGluePoint(const Point& rPnt) pInsPointUndo= dynamic_cast< SdrUndoGeoObj* >( GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pObj) ); DBG_ASSERT( pInsPointUndo, "svx::SdrDragView::BegInsObjPoint(), could not create correct undo object!" ); XubString aStr(ImpGetResStr(STR_DragInsertGluePoint)); - XubString aName; pObj->TakeObjNameSingul(aName); + OUString aName(pObj->TakeObjNameSingul()); aStr.SearchAndReplaceAscii("%1", aName); diff --git a/svx/source/svdraw/svdedtv2.cxx b/svx/source/svdraw/svdedtv2.cxx index 6f626da3baca..91573ccb834c 100644 --- a/svx/source/svdraw/svdedtv2.cxx +++ b/svx/source/svdraw/svdedtv2.cxx @@ -1795,7 +1795,7 @@ void SdrEditView::UnGroupMarked() sal_uIntPtr nCount=0; XubString aName1; - XubString aName; + OUString aName; bool bNameOk=false; for (sal_uIntPtr nm=GetMarkedObjectCount(); nm>0;) { nm--; @@ -1805,7 +1805,7 @@ void SdrEditView::UnGroupMarked() if (pSrcLst!=NULL) { nCount++; if (nCount==1) { - pGrp->TakeObjNameSingul(aName); // retrieve name of group + aName = pGrp->TakeObjNameSingul(); // retrieve name of group pGrp->TakeObjNamePlural(aName1); // retrieve name of group bNameOk=true; } else { diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx index 8ed8c24c9032..6722ad349d1c 100644 --- a/svx/source/svdraw/svdedxv.cxx +++ b/svx/source/svdraw/svdedxv.cxx @@ -917,8 +917,7 @@ SdrEndTextEditKind SdrObjEditView::SdrEndTextEdit(sal_Bool bDontDeleteReally) const bool bUndo = IsUndoEnabled(); if( bUndo ) { - XubString aObjName; - pTEObj->TakeObjNameSingul(aObjName); + OUString aObjName(pTEObj->TakeObjNameSingul()); BegUndo(ImpGetResStr(STR_UndoObjSetText),aObjName); } diff --git a/svx/source/svdraw/svdmark.cxx b/svx/source/svdraw/svdmark.cxx index 40820e7efb66..73dd2b97a268 100644 --- a/svx/source/svdraw/svdmark.cxx +++ b/svx/source/svdraw/svdmark.cxx @@ -569,7 +569,7 @@ const XubString& SdrMarkList::GetMarkDescription() const { if(pMark->GetMarkedSdrObj()) { - pMark->GetMarkedSdrObj()->TakeObjNameSingul(aNam); + aNam = pMark->GetMarkedSdrObj()->TakeObjNameSingul(); } } else @@ -663,7 +663,7 @@ const XubString& SdrMarkList::GetPointMarkDescription(sal_Bool bGlue) const { if(pMark->GetMarkedSdrObj()) { - pMark->GetMarkedSdrObj()->TakeObjNameSingul(aNam); + aNam = pMark->GetMarkedSdrObj()->TakeObjNameSingul(); } } else diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx index b6bfd6c68df8..dbfb8a05585d 100644 --- a/svx/source/svdraw/svdoashp.cxx +++ b/svx/source/svdraw/svdoashp.cxx @@ -2824,17 +2824,18 @@ SdrObjCustomShape& SdrObjCustomShape::operator=(const SdrObjCustomShape& rObj) } -void SdrObjCustomShape::TakeObjNameSingul(XubString& rName) const +OUString SdrObjCustomShape::TakeObjNameSingul() const { - rName = ImpGetResStr(STR_ObjNameSingulCUSTOMSHAPE); - String aNm( GetName() ); - if( aNm.Len() ) + OUStringBuffer sName(ImpGetResStr(STR_ObjNameSingulCUSTOMSHAPE)); + OUString aNm(GetName()); + if (!aNm.isEmpty()) { - rName += sal_Unicode(' '); - rName += sal_Unicode('\''); - rName += aNm; - rName += sal_Unicode('\''); + sName.append(' '); + sName.append('\''); + sName.append(aNm); + sName.append('\''); } + return sName.makeStringAndClear(); } void SdrObjCustomShape::TakeObjNamePlural(XubString& rName) const diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index b6e760f07060..60d42ecf82cd 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -1090,18 +1090,19 @@ SdrObject& SdrObject::operator=(const SdrObject& rObj) return *this; } -void SdrObject::TakeObjNameSingul(XubString& rName) const +OUString SdrObject::TakeObjNameSingul() const { - rName=ImpGetResStr(STR_ObjNameSingulNONE); + OUStringBuffer sName(ImpGetResStr(STR_ObjNameSingulNONE)); - String aName( GetName() ); - if(aName.Len()) + OUString aName(GetName()); + if (!aName.isEmpty()) { - rName += sal_Unicode(' '); - rName += sal_Unicode('\''); - rName += aName; - rName += sal_Unicode('\''); + sName.append(' '); + sName.append('\''); + sName.append(aName); + sName.append('\''); } + return sName.makeStringAndClear(); } void SdrObject::TakeObjNamePlural(XubString& rName) const @@ -1116,8 +1117,7 @@ void SdrObject::ImpTakeDescriptionStr(sal_uInt16 nStrCacheID, OUString& rStr, sa if (nPos >= 0) { // Replace '%1' with the object name. - XubString aObjName; - TakeObjNameSingul(aObjName); + OUString aObjName(TakeObjNameSingul()); rStr = rStr.replaceAt(nPos, 2, aObjName); } diff --git a/svx/source/svdraw/svdocapt.cxx b/svx/source/svdraw/svdocapt.cxx index 29115e8c9caf..ceb341b10119 100644 --- a/svx/source/svdraw/svdocapt.cxx +++ b/svx/source/svdraw/svdocapt.cxx @@ -240,18 +240,20 @@ SdrCaptionObj* SdrCaptionObj::Clone() const return CloneHelper< SdrCaptionObj >(); } -void SdrCaptionObj::TakeObjNameSingul(XubString& rName) const +OUString SdrCaptionObj::TakeObjNameSingul() const { - rName=ImpGetResStr(STR_ObjNameSingulCAPTION); + OUStringBuffer sName(ImpGetResStr(STR_ObjNameSingulCAPTION)); - String aName( GetName() ); - if(aName.Len()) + OUString aName(GetName()); + if (!aName.isEmpty()) { - rName += sal_Unicode(' '); - rName += sal_Unicode('\''); - rName += aName; - rName += sal_Unicode('\''); + sName.append(' '); + sName.append('\''); + sName.append(aName); + sName.append('\''); } + + return sName.makeStringAndClear(); } void SdrCaptionObj::TakeObjNamePlural(XubString& rName) const diff --git a/svx/source/svdraw/svdocirc.cxx b/svx/source/svdraw/svdocirc.cxx index 5edc746d7bdd..b43c842f3c88 100644 --- a/svx/source/svdraw/svdocirc.cxx +++ b/svx/source/svdraw/svdocirc.cxx @@ -283,7 +283,7 @@ void SdrCircObj::RecalcXPoly() mpXPoly = new XPolygon(aPolyCirc); } -void SdrCircObj::TakeObjNameSingul(XubString& rName) const +OUString SdrCircObj::TakeObjNameSingul() const { sal_uInt16 nID=STR_ObjNameSingulCIRC; if (aRect.GetWidth()==aRect.GetHeight() && aGeo.nShearWink==0) { @@ -303,16 +303,17 @@ void SdrCircObj::TakeObjNameSingul(XubString& rName) const default: break; } } - rName=ImpGetResStr(nID); + OUStringBuffer sName(ImpGetResStr(nID)); - String aName( GetName() ); - if(aName.Len()) + OUString aName(GetName()); + if (!aName.isEmpty()) { - rName += sal_Unicode(' '); - rName += sal_Unicode('\''); - rName += aName; - rName += sal_Unicode('\''); + sName.append(' '); + sName.append('\''); + sName.append(aName); + sName.append('\''); } + return sName.makeStringAndClear(); } void SdrCircObj::TakeObjNamePlural(XubString& rName) const diff --git a/svx/source/svdraw/svdoedge.cxx b/svx/source/svdraw/svdoedge.cxx index 6c3eaa1983cb..30d3366aa347 100644 --- a/svx/source/svdraw/svdoedge.cxx +++ b/svx/source/svdraw/svdoedge.cxx @@ -1638,18 +1638,19 @@ SdrEdgeObj& SdrEdgeObj::operator=(const SdrEdgeObj& rObj) return *this; } -void SdrEdgeObj::TakeObjNameSingul(XubString& rName) const +OUString SdrEdgeObj::TakeObjNameSingul() const { - rName=ImpGetResStr(STR_ObjNameSingulEDGE); + OUStringBuffer sName(ImpGetResStr(STR_ObjNameSingulEDGE)); - String aName( GetName() ); - if(aName.Len()) + OUString aName(GetName()); + if (!aName.isEmpty()) { - rName += sal_Unicode(' '); - rName += sal_Unicode('\''); - rName += aName; - rName += sal_Unicode('\''); + sName.append(' '); + sName.append('\''); + sName.append(aName); + sName.append('\''); } + return sName.makeStringAndClear(); } void SdrEdgeObj::TakeObjNamePlural(XubString& rName) const diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx index 00da76213ce8..fb550c168561 100644 --- a/svx/source/svdraw/svdograf.cxx +++ b/svx/source/svdraw/svdograf.cxx @@ -713,53 +713,57 @@ void SdrGrafObj::ImpSetLinkedGraphic( const Graphic& rGraphic ) GetModel()->SetChanged( bIsChanged ); } -void SdrGrafObj::TakeObjNameSingul(XubString& rName) const +OUString SdrGrafObj::TakeObjNameSingul() const { - if(pGraphic) - { - const SvgDataPtr& rSvgDataPtr = pGraphic->GetGraphic().getSvgData(); + if (!pGraphic) + return OUString(); - if(rSvgDataPtr.get()) - { - rName = ImpGetResStr(STR_ObjNameSingulGRAFSVG); - } - else + const SvgDataPtr& rSvgDataPtr = pGraphic->GetGraphic().getSvgData(); + + OUStringBuffer sName; + + if(rSvgDataPtr.get()) + { + sName.append(ImpGetResStr(STR_ObjNameSingulGRAFSVG)); + } + else + { + switch( pGraphic->GetType() ) { - switch( pGraphic->GetType() ) + case GRAPHIC_BITMAP: { - case GRAPHIC_BITMAP: - { - const sal_uInt16 nId = ( ( pGraphic->IsTransparent() || ( (const SdrGrafTransparenceItem&) GetObjectItem( SDRATTR_GRAFTRANSPARENCE ) ).GetValue() ) ? - ( IsLinkedGraphic() ? STR_ObjNameSingulGRAFBMPTRANSLNK : STR_ObjNameSingulGRAFBMPTRANS ) : - ( IsLinkedGraphic() ? STR_ObjNameSingulGRAFBMPLNK : STR_ObjNameSingulGRAFBMP ) ); + const sal_uInt16 nId = ( ( pGraphic->IsTransparent() || ( (const SdrGrafTransparenceItem&) GetObjectItem( SDRATTR_GRAFTRANSPARENCE ) ).GetValue() ) ? + ( IsLinkedGraphic() ? STR_ObjNameSingulGRAFBMPTRANSLNK : STR_ObjNameSingulGRAFBMPTRANS ) : + ( IsLinkedGraphic() ? STR_ObjNameSingulGRAFBMPLNK : STR_ObjNameSingulGRAFBMP ) ); - rName=ImpGetResStr( nId ); - } - break; + sName.append(ImpGetResStr(nId)); + } + break; - case GRAPHIC_GDIMETAFILE: - rName=ImpGetResStr( IsLinkedGraphic() ? STR_ObjNameSingulGRAFMTFLNK : STR_ObjNameSingulGRAFMTF ); - break; + case GRAPHIC_GDIMETAFILE: + sName.append(ImpGetResStr(IsLinkedGraphic() ? STR_ObjNameSingulGRAFMTFLNK : STR_ObjNameSingulGRAFMTF)); + break; - case GRAPHIC_NONE: - rName=ImpGetResStr( IsLinkedGraphic() ? STR_ObjNameSingulGRAFNONELNK : STR_ObjNameSingulGRAFNONE ); - break; + case GRAPHIC_NONE: + sName.append(ImpGetResStr(IsLinkedGraphic() ? STR_ObjNameSingulGRAFNONELNK : STR_ObjNameSingulGRAFNONE)); + break; - default: - rName=ImpGetResStr( IsLinkedGraphic() ? STR_ObjNameSingulGRAFLNK : STR_ObjNameSingulGRAF ); - break; - } + default: + sName.append(ImpGetResStr(IsLinkedGraphic() ? STR_ObjNameSingulGRAFLNK : STR_ObjNameSingulGRAF)); + break; } + } - const String aName(GetName()); + const OUString aName(GetName()); - if( aName.Len() ) - { - rName.AppendAscii( " '" ); - rName += aName; - rName += sal_Unicode( '\'' ); - } + if (!aName.isEmpty()) + { + sName.append(" '"); + sName.append(aName); + sName.append('\'' ); } + + return sName.makeStringAndClear(); } void SdrGrafObj::TakeObjNamePlural( XubString& rName ) const diff --git a/svx/source/svdraw/svdogrp.cxx b/svx/source/svdraw/svdogrp.cxx index 37cc3f9c24c3..98d7ca30c307 100644 --- a/svx/source/svdraw/svdogrp.cxx +++ b/svx/source/svdraw/svdogrp.cxx @@ -291,26 +291,30 @@ SdrObjGroup& SdrObjGroup::operator=(const SdrObjGroup& rObj) } -void SdrObjGroup::TakeObjNameSingul(XubString& rName) const +OUString SdrObjGroup::TakeObjNameSingul() const { + OUStringBuffer sName; + if(!pSub->GetObjCount()) { - rName = ImpGetResStr(STR_ObjNameSingulGRUPEMPTY); + sName.append(ImpGetResStr(STR_ObjNameSingulGRUPEMPTY)); } else { - rName = ImpGetResStr(STR_ObjNameSingulGRUP); + sName.append(ImpGetResStr(STR_ObjNameSingulGRUP)); } - const String aName(GetName()); + const OUString aName(GetName()); - if(aName.Len()) + if (!aName.isEmpty()) { - rName += sal_Unicode(' '); - rName += sal_Unicode('\''); - rName += aName; - rName += sal_Unicode('\''); + sName.append(' '); + sName.append('\''); + sName.append(aName); + sName.append('\''); } + + return sName.makeStringAndClear(); } diff --git a/svx/source/svdraw/svdomeas.cxx b/svx/source/svdraw/svdomeas.cxx index d6077cc99db5..5778c7460bcd 100644 --- a/svx/source/svdraw/svdomeas.cxx +++ b/svx/source/svdraw/svdomeas.cxx @@ -743,18 +743,20 @@ SdrMeasureObj* SdrMeasureObj::Clone() const return CloneHelper< SdrMeasureObj >(); } -void SdrMeasureObj::TakeObjNameSingul(XubString& rName) const +OUString SdrMeasureObj::TakeObjNameSingul() const { - rName=ImpGetResStr(STR_ObjNameSingulMEASURE); + OUStringBuffer sName(ImpGetResStr(STR_ObjNameSingulMEASURE)); - String aName( GetName() ); - if(aName.Len()) + OUString aName( GetName() ); + if (!aName.isEmpty()) { - rName += sal_Unicode(' '); - rName += sal_Unicode('\''); - rName += aName; - rName += sal_Unicode('\''); + sName.append(' '); + sName.append('\''); + sName.append(aName); + sName.append('\''); } + + return sName.makeStringAndClear(); } void SdrMeasureObj::TakeObjNamePlural(XubString& rName) const diff --git a/svx/source/svdraw/svdomedia.cxx b/svx/source/svdraw/svdomedia.cxx index 085e805ec2ab..43b19988806f 100644 --- a/svx/source/svdraw/svdomedia.cxx +++ b/svx/source/svdraw/svdomedia.cxx @@ -139,19 +139,21 @@ sal_uInt16 SdrMediaObj::GetObjIdentifier() const // ------------------------------------------------------------------------------ -void SdrMediaObj::TakeObjNameSingul(XubString& rName) const +OUString SdrMediaObj::TakeObjNameSingul() const { - rName=ImpGetResStr(STR_ObjNameSingulMEDIA); + OUStringBuffer sName(ImpGetResStr(STR_ObjNameSingulMEDIA)); - String aName( GetName() ); + OUString aName(GetName()); - if(aName.Len()) + if (!aName.isEmpty()) { - rName += sal_Unicode(' '); - rName += sal_Unicode('\''); - rName += aName; - rName += sal_Unicode('\''); + sName.append(' '); + sName.append('\''); + sName.append(aName); + sName.append('\''); } + + return sName.makeStringAndClear(); } // ------------------------------------------------------------------------------ diff --git a/svx/source/svdraw/svdoole2.cxx b/svx/source/svdraw/svdoole2.cxx index 1d37bfc95ed3..c614f6aaf20c 100644 --- a/svx/source/svdraw/svdoole2.cxx +++ b/svx/source/svdraw/svdoole2.cxx @@ -1591,18 +1591,20 @@ sal_uInt16 SdrOle2Obj::GetObjIdentifier() const // ----------------------------------------------------------------------------- -void SdrOle2Obj::TakeObjNameSingul(XubString& rName) const +OUString SdrOle2Obj::TakeObjNameSingul() const { - rName = ImpGetResStr(bFrame ? STR_ObjNameSingulFrame : STR_ObjNameSingulOLE2); + OUStringBuffer sName(ImpGetResStr(bFrame ? STR_ObjNameSingulFrame : STR_ObjNameSingulOLE2)); - const String aName(GetName()); + const OUString aName(GetName()); - if( aName.Len() ) + if (!aName.isEmpty()) { - rName.AppendAscii(" '"); - rName += aName; - rName += sal_Unicode('\''); + sName.append(" '"); + sName.append(aName); + sName.append('\''); } + + return sName.makeStringAndClear(); } // ----------------------------------------------------------------------------- diff --git a/svx/source/svdraw/svdopage.cxx b/svx/source/svdraw/svdopage.cxx index 2abcf5743060..8bb424d8a84f 100644 --- a/svx/source/svdraw/svdopage.cxx +++ b/svx/source/svdraw/svdopage.cxx @@ -166,18 +166,20 @@ SdrPageObj& SdrPageObj::operator=(const SdrPageObj& rObj) return *this; } -void SdrPageObj::TakeObjNameSingul(XubString& rName) const +OUString SdrPageObj::TakeObjNameSingul() const { - rName=ImpGetResStr(STR_ObjNameSingulPAGE); + OUStringBuffer sName(ImpGetResStr(STR_ObjNameSingulPAGE)); - String aName( GetName() ); - if(aName.Len()) + OUString aName(GetName()); + if (!aName.isEmpty()) { - rName += sal_Unicode(' '); - rName += sal_Unicode('\''); - rName += aName; - rName += sal_Unicode('\''); + sName.append(' '); + sName.append('\''); + sName.append(aName); + sName.append('\''); } + + return sName.makeStringAndClear(); } void SdrPageObj::TakeObjNamePlural(XubString& rName) const diff --git a/svx/source/svdraw/svdopath.cxx b/svx/source/svdraw/svdopath.cxx index dbbaaef0cd99..b7ea371406f9 100644 --- a/svx/source/svdraw/svdopath.cxx +++ b/svx/source/svdraw/svdopath.cxx @@ -1866,8 +1866,10 @@ SdrPathObj& SdrPathObj::operator=(const SdrPathObj& rObj) return *this; } -void SdrPathObj::TakeObjNameSingul(XubString& rName) const +OUString SdrPathObj::TakeObjNameSingul() const { + OUStringBuffer sName; + if(OBJ_LINE == meKind) { sal_uInt16 nId(STR_ObjNameSingulLINE); @@ -1901,7 +1903,7 @@ void SdrPathObj::TakeObjNameSingul(XubString& rName) const } } - rName = ImpGetResStr(nId); + sName.append(ImpGetResStr(nId)); } else if(OBJ_PLIN == meKind || OBJ_POLY == meKind) { @@ -1919,7 +1921,7 @@ void SdrPathObj::TakeObjNameSingul(XubString& rName) const nId = STR_ObjNameSingulPLIN; } - rName = ImpGetResStr(nId); + sName.append(ImpGetResStr(nId)); } else { @@ -1941,38 +1943,35 @@ void SdrPathObj::TakeObjNameSingul(XubString& rName) const nId = STR_ObjNameSingulPLIN_PntAnz; } - rName = ImpGetResStr(nId); - sal_uInt16 nPos(rName.SearchAscii("%2")); // #i96537# - - if(STRING_NOTFOUND != nPos) - { - rName.Erase(nPos, 2); - rName.Insert(OUString::number(nPointCount), nPos); - } + OUString sTemp(ImpGetResStr(nId)); + // #i96537# + sName.append(sTemp.replaceFirst("%2", OUString::number(nPointCount))); } } else { switch (meKind) { - case OBJ_PATHLINE: rName=ImpGetResStr(STR_ObjNameSingulPATHLINE); break; - case OBJ_FREELINE: rName=ImpGetResStr(STR_ObjNameSingulFREELINE); break; - case OBJ_SPLNLINE: rName=ImpGetResStr(STR_ObjNameSingulNATSPLN); break; - case OBJ_PATHFILL: rName=ImpGetResStr(STR_ObjNameSingulPATHFILL); break; - case OBJ_FREEFILL: rName=ImpGetResStr(STR_ObjNameSingulFREEFILL); break; - case OBJ_SPLNFILL: rName=ImpGetResStr(STR_ObjNameSingulPERSPLN); break; + case OBJ_PATHLINE: sName.append(ImpGetResStr(STR_ObjNameSingulPATHLINE)); break; + case OBJ_FREELINE: sName.append(ImpGetResStr(STR_ObjNameSingulFREELINE)); break; + case OBJ_SPLNLINE: sName.append(ImpGetResStr(STR_ObjNameSingulNATSPLN)); break; + case OBJ_PATHFILL: sName.append(ImpGetResStr(STR_ObjNameSingulPATHFILL)); break; + case OBJ_FREEFILL: sName.append(ImpGetResStr(STR_ObjNameSingulFREEFILL)); break; + case OBJ_SPLNFILL: sName.append(ImpGetResStr(STR_ObjNameSingulPERSPLN)); break; default: break; } } - String aName(GetName()); - if(aName.Len()) + OUString aName(GetName()); + if (!aName.isEmpty()) { - rName += sal_Unicode(' '); - rName += sal_Unicode('\''); - rName += aName; - rName += sal_Unicode('\''); + sName.append(' '); + sName.append('\''); + sName.append(aName); + sName.append('\''); } + + return sName.makeStringAndClear(); } void SdrPathObj::TakeObjNamePlural(XubString& rName) const diff --git a/svx/source/svdraw/svdorect.cxx b/svx/source/svdraw/svdorect.cxx index d17a0ed3b43e..65cd363c51f8 100644 --- a/svx/source/svdraw/svdorect.cxx +++ b/svx/source/svdraw/svdorect.cxx @@ -219,32 +219,34 @@ void SdrRectObj::TakeUnrotatedSnapRect(Rectangle& rRect) const } } -void SdrRectObj::TakeObjNameSingul(XubString& rName) const +OUString SdrRectObj::TakeObjNameSingul() const { if (IsTextFrame()) { - SdrTextObj::TakeObjNameSingul(rName); + return SdrTextObj::TakeObjNameSingul(); } - else - { - sal_uInt16 nResId=STR_ObjNameSingulRECT; - if (aGeo.nShearWink!=0) { - nResId+=4; // parallelogram or, maybe, rhombus - } else { - if (aRect.GetWidth()==aRect.GetHeight()) nResId+=2; // square - } - if (GetEckenradius()!=0) nResId+=8; // rounded down - rName=ImpGetResStr(nResId); - String aName( GetName() ); - if(aName.Len()) - { - rName += sal_Unicode(' '); - rName += sal_Unicode('\''); - rName += aName; - rName += sal_Unicode('\''); - } + OUStringBuffer sName; + + sal_uInt16 nResId=STR_ObjNameSingulRECT; + if (aGeo.nShearWink!=0) { + nResId+=4; // parallelogram or, maybe, rhombus + } else { + if (aRect.GetWidth()==aRect.GetHeight()) nResId+=2; // square } + if (GetEckenradius()!=0) nResId+=8; // rounded down + sName.append(ImpGetResStr(nResId)); + + OUString aName(GetName()); + if (!aName.isEmpty()) + { + sName.append(' '); + sName.append('\''); + sName.append(aName); + sName.append('\''); + } + + return sName.makeStringAndClear(); } void SdrRectObj::TakeObjNamePlural(XubString& rName) const diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index 387a561b77ab..f46744f52f99 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -966,7 +966,7 @@ void SdrTextObj::ImpSetCharStretching(SdrOutliner& rOutliner, const Size& rTextS } } -void SdrTextObj::TakeObjNameSingul(XubString& rName) const +OUString SdrTextObj::TakeObjNameSingul() const { XubString aStr; @@ -1020,17 +1020,18 @@ void SdrTextObj::TakeObjNameSingul(XubString& rName) const } } - rName = aStr; + OUStringBuffer sName(aStr); - String aName( GetName() ); - if(aName.Len()) + OUString aName(GetName()); + if (!aName.isEmpty()) { - rName += sal_Unicode(' '); - rName += sal_Unicode('\''); - rName += aName; - rName += sal_Unicode('\''); + sName.append(' '); + sName.append('\''); + sName.append(aName); + sName.append('\''); } + return sName.makeStringAndClear(); } void SdrTextObj::TakeObjNamePlural(XubString& rName) const diff --git a/svx/source/svdraw/svdouno.cxx b/svx/source/svdraw/svdouno.cxx index 82d7fe31ce66..f23ca26af995 100644 --- a/svx/source/svdraw/svdouno.cxx +++ b/svx/source/svdraw/svdouno.cxx @@ -255,18 +255,20 @@ void SdrUnoObj::SetContextWritingMode( const sal_Int16 _nContextWritingMode ) } } -void SdrUnoObj::TakeObjNameSingul(XubString& rName) const +OUString SdrUnoObj::TakeObjNameSingul() const { - rName = ImpGetResStr(STR_ObjNameSingulUno); + OUStringBuffer sName(ImpGetResStr(STR_ObjNameSingulUno)); - String aName( GetName() ); - if(aName.Len()) + OUString aName(GetName()); + if (!aName.isEmpty()) { - rName += sal_Unicode(' '); - rName += sal_Unicode('\''); - rName += aName; - rName += sal_Unicode('\''); + sName.append(' '); + sName.append('\''); + sName.append(aName); + sName.append('\''); } + + return sName.makeStringAndClear(); } void SdrUnoObj::TakeObjNamePlural(XubString& rName) const diff --git a/svx/source/svdraw/svdovirt.cxx b/svx/source/svdraw/svdovirt.cxx index 2e80aa526488..991d283e9c1d 100644 --- a/svx/source/svdraw/svdovirt.cxx +++ b/svx/source/svdraw/svdovirt.cxx @@ -151,20 +151,22 @@ SdrVirtObj& SdrVirtObj::operator=(const SdrVirtObj& rObj) return *this; } -void SdrVirtObj::TakeObjNameSingul(XubString& rName) const +OUString SdrVirtObj::TakeObjNameSingul() const { - rRefObj.TakeObjNameSingul(rName); - rName.Insert(sal_Unicode('['), 0); - rName += sal_Unicode(']'); + OUStringBuffer sName(rRefObj.TakeObjNameSingul()); + sName.insert(0, '['); + sName.append(']'); - String aName( GetName() ); - if(aName.Len()) + OUString aName(GetName()); + if (!aName.isEmpty()) { - rName += sal_Unicode(' '); - rName += sal_Unicode('\''); - rName += aName; - rName += sal_Unicode('\''); + sName.append(' '); + sName.append('\''); + sName.append(aName); + sName.append('\''); } + + return sName.makeStringAndClear(); } void SdrVirtObj::TakeObjNamePlural(XubString& rName) const diff --git a/svx/source/svdraw/svdundo.cxx b/svx/source/svdraw/svdundo.cxx index 8cae9f4cbeb7..2d478e0e25b7 100644 --- a/svx/source/svdraw/svdundo.cxx +++ b/svx/source/svdraw/svdundo.cxx @@ -221,8 +221,7 @@ void SdrUndoObj::GetDescriptionStringForObject( const SdrObject& _rForObject, sa } else { - XubString aStr; - _rForObject.TakeObjNameSingul(aStr); + OUString aStr(_rForObject.TakeObjNameSingul()); rStr.Insert(aStr, nPos); } } diff --git a/svx/source/svdraw/svdview.cxx b/svx/source/svdraw/svdview.cxx index b9338608d60e..89d07820b02d 100644 --- a/svx/source/svdraw/svdview.cxx +++ b/svx/source/svdraw/svdview.cxx @@ -1176,7 +1176,7 @@ XubString SdrView::GetStatusText() if(!aStr.Len()) { - pAktCreate->TakeObjNameSingul(aName); + aName = pAktCreate->TakeObjNameSingul(); aStr = ImpGetResStr(STR_ViewCreateObj); } } |