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/svdograf.cxx | |
parent | 12a034623e015ca05b56c82ebb63230ce731bab4 (diff) |
convert TakeObjNameSingul family to OUString
Change-Id: I0c667cbcfcc1ea1f04d113a53b7ba83c943052e4
Diffstat (limited to 'svx/source/svdraw/svdograf.cxx')
-rw-r--r-- | svx/source/svdraw/svdograf.cxx | 74 |
1 files changed, 39 insertions, 35 deletions
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 |