diff options
-rw-r--r-- | sw/inc/ndole.hxx | 8 | ||||
-rw-r--r-- | sw/source/core/ole/ndole.cxx | 30 |
2 files changed, 18 insertions, 20 deletions
diff --git a/sw/inc/ndole.hxx b/sw/inc/ndole.hxx index 3a80cea9c51f..8c65ae435800 100644 --- a/sw/inc/ndole.hxx +++ b/sw/inc/ndole.hxx @@ -39,7 +39,7 @@ class SW_DLLPUBLIC SwOLEObj /** Either ref or name are known. If only name is known, ref is obtained on demand by GetOleRef() from Sfx. */ svt::EmbeddedObjectRef xOLERef; - String aName; + OUString aName; SwOLEObj( const SwOLEObj& rObj ); /// Not allowed. SwOLEObj(); @@ -48,7 +48,7 @@ class SW_DLLPUBLIC SwOLEObj public: SwOLEObj( const svt::EmbeddedObjectRef& pObj ); - SwOLEObj( const String &rName, sal_Int64 nAspect ); + SwOLEObj( const OUString &rName, sal_Int64 nAspect ); ~SwOLEObj(); sal_Bool UnloadObject(); @@ -56,11 +56,11 @@ public: const SwDoc* pDoc, sal_Int64 nAspect ); - String GetDescription(); + OUString GetDescription(); const com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject > GetOleRef(); svt::EmbeddedObjectRef& GetObject(); - const String& GetCurrentPersistName() const { return aName; } + OUString GetCurrentPersistName() const { return aName; } sal_Bool IsOleRef() const; ///< To avoid unneccessary loading of object. }; diff --git a/sw/source/core/ole/ndole.cxx b/sw/source/core/ole/ndole.cxx index 1f74ff5aed50..432037b27673 100644 --- a/sw/source/core/ole/ndole.cxx +++ b/sw/source/core/ole/ndole.cxx @@ -298,7 +298,7 @@ sal_Bool SwOLENode::RestorePersistentData() if ( xChild.is() ) xChild->setParent( p->GetModel() ); - OSL_ENSURE( aOLEObj.aName.Len(), "No object name!" ); + OSL_ENSURE( !aOLEObj.aName.isEmpty(), "No object name!" ); OUString aObjName; if ( !p->GetEmbeddedObjectContainer().InsertEmbeddedObject( aOLEObj.xOLERef.GetObject(), aObjName ) ) { @@ -668,7 +668,7 @@ SwOLEObj::SwOLEObj( const svt::EmbeddedObjectRef& xObj ) : } -SwOLEObj::SwOLEObj( const String &rString, sal_Int64 nAspect ) : +SwOLEObj::SwOLEObj( const OUString &rString, sal_Int64 nAspect ) : pOLENd( 0 ), pListener( 0 ), aName( rString ) @@ -737,7 +737,7 @@ SwOLEObj::~SwOLEObj() void SwOLEObj::SetNode( SwOLENode* pNode ) { pOLENd = pNode; - if ( !aName.Len() ) + if ( aName.isEmpty() ) { SwDoc* pDoc = pNode->GetDoc(); @@ -895,22 +895,20 @@ sal_Bool SwOLEObj::UnloadObject( uno::Reference< embed::XEmbeddedObject > xObj, return bRet; } -String SwOLEObj::GetDescription() +OUString SwOLEObj::GetDescription() { - String aResult; uno::Reference< embed::XEmbeddedObject > xEmbObj = GetOleRef(); - if ( xEmbObj.is() ) - { - SvGlobalName aClassID( xEmbObj->getClassID() ); - if ( SotExchange::IsMath( aClassID ) ) - aResult = SW_RESSTR(STR_MATH_FORMULA); - else if ( SotExchange::IsChart( aClassID ) ) - aResult = SW_RESSTR(STR_CHART); - else - aResult = SW_RESSTR(STR_OLE); - } + if ( !xEmbObj.is() ) + return OUString(); + + SvGlobalName aClassID( xEmbObj->getClassID() ); + if ( SotExchange::IsMath( aClassID ) ) + return SW_RESSTR(STR_MATH_FORMULA); + + if ( SotExchange::IsChart( aClassID ) ) + return SW_RESSTR(STR_CHART); - return aResult; + return SW_RESSTR(STR_OLE); } |