[Libreoffice-commits] core.git: sw/inc sw/source

Matteo Casalin matteo.casalin at yahoo.com
Mon Aug 19 07:25:40 PDT 2013


 sw/inc/ndole.hxx                    |   12 ++++++------
 sw/source/core/ole/ndole.cxx        |   16 ++++++++--------
 sw/source/core/unocore/unochart.cxx |    2 +-
 sw/source/core/view/viewsh.cxx      |    2 +-
 sw/source/filter/xml/xmltexte.cxx   |    2 +-
 5 files changed, 17 insertions(+), 17 deletions(-)

New commits:
commit b862b8d5757cd031f361e5960dff8b149d16b615
Author: Matteo Casalin <matteo.casalin at yahoo.com>
Date:   Sat Aug 17 13:47:15 2013 +0200

    String to OUString
    
    Change-Id: Ib028b0846fca69ae678ff02d551eb369a59bc129
    Reviewed-on: https://gerrit.libreoffice.org/5475
    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 8c65ae4..650b1b8 100644
--- a/sw/inc/ndole.hxx
+++ b/sw/inc/ndole.hxx
@@ -73,12 +73,12 @@ class SW_DLLPUBLIC SwOLENode: public SwNoTxtNode
     friend class SwNodes;
     mutable SwOLEObj aOLEObj;
     Graphic*    pGraphic;
-    String sChartTblName;       ///< with chart objects: name of referenced table.
+    OUString sChartTblName;     ///< with chart objects: name of referenced table.
     sal_Bool   bOLESizeInvalid; /**< Should be considered at SwDoc::PrtOLENotify
                                    (e.g. copied). Is not persistent. */
 
     SwEmbedObjectLink*  mpObjectLink;
-    String maLinkURL;
+    OUString maLinkURL;
 
     SwOLENode(  const SwNodeIndex &rWhere,
                 const svt::EmbeddedObjectRef&,
@@ -86,7 +86,7 @@ class SW_DLLPUBLIC SwOLENode: public SwNoTxtNode
                 SwAttrSet* pAutoAttr = 0 );
 
     SwOLENode(  const SwNodeIndex &rWhere,
-                const String &rName,
+                const OUString &rName,
                 sal_Int64 nAspect,
                 SwGrfFmtColl *pGrfColl,
                 SwAttrSet* pAutoAttr = 0 );
@@ -126,7 +126,7 @@ public:
 
     /** Remove OLE-object from "memory".
        inline void Unload() { aOLEObj.Unload(); } */
-    String GetDescription() const { return aOLEObj.GetDescription(); }
+    OUString GetDescription() const { return aOLEObj.GetDescription(); }
 
     sal_Bool UpdateLinkURL_Impl();
     void BreakFileLink_Impl();
@@ -137,8 +137,8 @@ public:
     // #i99665#
     bool IsChart() const;
 
-    const String& GetChartTblName() const       { return sChartTblName; }
-    void SetChartTblName( const String& rNm )   { sChartTblName = rNm; }
+    OUString GetChartTblName() const { return sChartTblName; }
+    void SetChartTblName( const OUString& rNm ) { sChartTblName = rNm; }
 };
 
 
diff --git a/sw/source/core/ole/ndole.cxx b/sw/source/core/ole/ndole.cxx
index 432037b..93bd4dd 100644
--- a/sw/source/core/ole/ndole.cxx
+++ b/sw/source/core/ole/ndole.cxx
@@ -243,7 +243,7 @@ SwOLENode::SwOLENode( const SwNodeIndex &rWhere,
 }
 
 SwOLENode::SwOLENode( const SwNodeIndex &rWhere,
-                    const String &rString,
+                    const OUString &rString,
                     sal_Int64 nAspect,
                     SwGrfFmtColl *pGrfColl,
                     SwAttrSet* pAutoAttr ) :
@@ -359,7 +359,7 @@ sal_Bool SwOLENode::SavePersistentData()
                    bChartWithInternalProvider = sal_True;
            }
 
-           if ( IsChart() && sChartTblName.Len() && !bChartWithInternalProvider )
+           if ( IsChart() && !sChartTblName.isEmpty() && !bChartWithInternalProvider )
                bKeepObjectToTempStorage = sal_False;
            pCnt->RemoveEmbeddedObject( aOLEObj.aName, sal_False, bKeepObjectToTempStorage );
            // modify end
@@ -535,9 +535,9 @@ sal_Bool SwOLENode::UpdateLinkURL_Impl()
 
     if ( mpObjectLink )
     {
-        String aNewLinkURL;
+        OUString aNewLinkURL;
         GetDoc()->GetLinkManager().GetDisplayNames( mpObjectLink, 0, &aNewLinkURL, 0, 0 );
-        if ( !aNewLinkURL.EqualsIgnoreCaseAscii( maLinkURL ) )
+        if ( !aNewLinkURL.equalsIgnoreAsciiCase( maLinkURL ) )
         {
             if ( !aOLEObj.xOLERef.is() )
                 aOLEObj.GetOleRef();
@@ -556,7 +556,7 @@ sal_Bool SwOLENode::UpdateLinkURL_Impl()
                     // TODO/LATER: there should be possible to get current mediadescriptor settings from the object
                     uno::Sequence< beans::PropertyValue > aArgs( 1 );
                     aArgs[0].Name = OUString( "URL" );
-                    aArgs[0].Value <<= OUString( aNewLinkURL );
+                    aArgs[0].Value <<= aNewLinkURL;
                     xPersObj->reload( aArgs, uno::Sequence< beans::PropertyValue >() );
 
                     maLinkURL = aNewLinkURL;
@@ -593,7 +593,7 @@ void SwOLENode::BreakFileLink_Impl()
                 uno::Reference< embed::XLinkageSupport > xLinkSupport( aOLEObj.GetOleRef(), uno::UNO_QUERY_THROW );
                 xLinkSupport->breakLink( xStorage, aOLEObj.GetCurrentPersistName() );
                 DisconnectFileLink_Impl();
-                maLinkURL = String();
+                maLinkURL = OUString();
             }
             catch( uno::Exception& )
             {
@@ -620,8 +620,8 @@ void SwOLENode::CheckFileLink_Impl()
             uno::Reference< embed::XLinkageSupport > xLinkSupport( aOLEObj.xOLERef.GetObject(), uno::UNO_QUERY_THROW );
             if ( xLinkSupport->isLink() )
             {
-                String aLinkURL = xLinkSupport->getLinkURL();
-                if ( aLinkURL.Len() )
+                const OUString aLinkURL = xLinkSupport->getLinkURL();
+                if ( !aLinkURL.isEmpty() )
                 {
                     // this is a file link so the model link manager should handle it
                     mpObjectLink = new SwEmbedObjectLink( this );
diff --git a/sw/source/core/unocore/unochart.cxx b/sw/source/core/unocore/unochart.cxx
index d3b1feb..34d2766 100644
--- a/sw/source/core/unocore/unochart.cxx
+++ b/sw/source/core/unocore/unochart.cxx
@@ -153,7 +153,7 @@ void SwChartLockController_Helper::LockUnlockAllCharts( sal_Bool bLock )
             {
                 ++aIdx;
                 if (0 != ( pONd = aIdx.GetNode().GetOLENode() ) &&
-                    pONd->GetChartTblName().Len() > 0 /* is chart object? */)
+                    !pONd->GetChartTblName().isEmpty() /* is chart object? */)
                 {
                     uno::Reference < embed::XEmbeddedObject > xIP = pONd->GetOLEObj().GetOleRef();
                     if ( svt::EmbeddedObjectRef::TryRunningState( xIP ) )
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 6ea9e7c..5e2fd60 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -615,7 +615,7 @@ sal_Bool ViewShell::HasCharts() const
     {
         ++aIdx;
         const SwOLENode *pNd = aIdx.GetNode().GetOLENode();
-        if( pNd && pNd->GetChartTblName().Len() )
+        if( pNd && !pNd->GetChartTblName().isEmpty() )
         {
             bRet = sal_True;
             break;
diff --git a/sw/source/filter/xml/xmltexte.cxx b/sw/source/filter/xml/xmltexte.cxx
index 21feeab..fcc1373 100644
--- a/sw/source/filter/xml/xmltexte.cxx
+++ b/sw/source/filter/xml/xmltexte.cxx
@@ -502,7 +502,7 @@ void SwXMLTextParagraphExport::_exportTextEmbedded(
             sURL = GetExport().AddEmbeddedObject( sURL );
             lcl_addURL( rXMLExport, sURL, false );
         }
-        if( SV_EMBEDDED_OWN == nType && pOLENd->GetChartTblName().Len() )
+        if( SV_EMBEDDED_OWN == nType && !pOLENd->GetChartTblName().isEmpty() )
         {
             OUString sRange( pOLENd->GetChartTblName() );
             OUStringBuffer aBuffer( sRange.getLength() + 2 );


More information about the Libreoffice-commits mailing list