[Libreoffice-commits] core.git: sw/inc sw/source
Matteo Casalin
matteo.casalin at yahoo.com
Mon Aug 19 07:04:11 PDT 2013
sw/inc/ndole.hxx | 8 ++++----
sw/source/core/ole/ndole.cxx | 30 ++++++++++++++----------------
2 files changed, 18 insertions(+), 20 deletions(-)
New commits:
commit 83d874ec13f6bf260f3f4093fd1613bea23bf27c
Author: Matteo Casalin <matteo.casalin at yahoo.com>
Date: Sat Aug 17 11:47:04 2013 +0200
String to OUString, some small cleanup
Change-Id: I2cb6b2c2169e5ba72ac8866f4a797421bd779a8b
Reviewed-on: https://gerrit.libreoffice.org/5473
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/sw/inc/ndole.hxx b/sw/inc/ndole.hxx
index 3a80cea..8c65ae4 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 1f74ff5..432037b 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);
}
More information about the Libreoffice-commits
mailing list