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

Matteo Casalin matteo.casalin at yahoo.com
Sat Aug 17 16:04:44 PDT 2013


 sw/inc/fmturl.hxx                 |   16 ++++++++--------
 sw/source/core/crsr/crstrvl.cxx   |    2 +-
 sw/source/core/doc/notxtfrm.cxx   |    4 ++--
 sw/source/core/draw/dflyobj.cxx   |    4 ++--
 sw/source/core/draw/dpage.cxx     |    2 +-
 sw/source/core/frmedt/fefly1.cxx  |    2 +-
 sw/source/core/layout/atrfrm.cxx  |   12 +++---------
 sw/source/filter/ww8/wrtww8gr.cxx |    2 +-
 sw/source/ui/dochdl/swdtflvr.cxx  |   10 +++++-----
 sw/source/ui/docvw/romenu.cxx     |    2 +-
 sw/source/ui/utlui/attrdesc.cxx   |    4 ++--
 11 files changed, 27 insertions(+), 33 deletions(-)

New commits:
commit a38f4e61b5611850f3b4f56cc5f6d9a6cb400d2e
Author: Matteo Casalin <matteo.casalin at yahoo.com>
Date:   Sun Aug 18 01:03:43 2013 +0200

    String to OUString
    
    Change-Id: I22624e2f15b95257f950f48704909aeb6ae54ef4

diff --git a/sw/inc/fmturl.hxx b/sw/inc/fmturl.hxx
index 4782a3d..9c39434 100644
--- a/sw/inc/fmturl.hxx
+++ b/sw/inc/fmturl.hxx
@@ -31,9 +31,9 @@ class IntlWrapper;
 
 class SW_DLLPUBLIC SwFmtURL: public SfxPoolItem
 {
-    String    sTargetFrameName; ///< Target frame for URL.
-    String    sURL;             ///< Simple URL.
-    String    sName;            ///< Name of the anchor.
+    OUString  sTargetFrameName; ///< Target frame for URL.
+    OUString  sURL;             ///< Simple URL.
+    OUString  sName;            ///< Name of the anchor.
     ImageMap *pMap;             ///< ClientSide images.
 
     sal_Bool      bIsServerMap;     ///< A ServerSideImageMap with the URL.
@@ -59,18 +59,18 @@ public:
     virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
     virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
 
-    void SetTargetFrameName( const String& rStr ) { sTargetFrameName = rStr; }
+    void SetTargetFrameName( const OUString& rStr ) { sTargetFrameName = rStr; }
     void SetURL(const OUString &rURL, bool bServerMap);
     void SetMap( const ImageMap *pM );  ///< Pointer will be copied.
 
-    const String   &GetTargetFrameName()const { return sTargetFrameName; }
-    const String   &GetURL()            const { return sURL; }
+    OUString GetTargetFrameName()const { return sTargetFrameName; }
+    OUString GetURL()            const { return sURL; }
           sal_Bool      IsServerMap()       const { return bIsServerMap; }
     const ImageMap *GetMap()            const { return pMap; }
           ImageMap *GetMap()                  { return pMap; }
 
-    const String& GetName() const           { return sName; }
-    void SetName( const String& rNm )       { sName = rNm; }
+    OUString GetName() const                { return sName; }
+    void SetName( const OUString& rNm )     { sName = rNm; }
 };
 
 
diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index 8e9cc14..1b11a31 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -2113,7 +2113,7 @@ bool SwCrsrShell::SelectNxtPrvHyperlink( bool bNext )
         {
             SwFlyFrmFmt* pFmt = (SwFlyFrmFmt*)(*pFmts)[ n ];
             const SwFmtURL& rURLItem = pFmt->GetURL();
-            if( rURLItem.GetMap() || rURLItem.GetURL().Len() )
+            if( rURLItem.GetMap() || !rURLItem.GetURL().isEmpty() )
             {
                 SwFlyFrm* pFly = pFmt->GetFrm( &aPt, sal_False );
                 SwPosition aTmpPos( *pBodySttNd );
diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx
index e3be834..52a2c4c 100644
--- a/sw/source/core/doc/notxtfrm.cxx
+++ b/sw/source/core/doc/notxtfrm.cxx
@@ -104,7 +104,7 @@ static void lcl_PaintReplacement( const SwRect &rRect, const String &rText,
     Color aCol( COL_RED );
     FontUnderline eUnderline = UNDERLINE_NONE;
     const SwFmtURL &rURL = pFrm->FindFlyFrm()->GetFmt()->GetURL();
-    if( rURL.GetURL().Len() || rURL.GetMap() )
+    if( !rURL.GetURL().isEmpty() || rURL.GetMap() )
     {
         bool bVisited = false;
         if ( rURL.GetMap() )
@@ -120,7 +120,7 @@ static void lcl_PaintReplacement( const SwRect &rRect, const String &rText,
                 }
             }
         }
-        else if ( rURL.GetURL().Len() )
+        else if ( !rURL.GetURL().isEmpty() )
             bVisited = rSh.GetDoc()->IsVisitedURL( rURL.GetURL() );
 
         SwFmt *pFmt = rSh.GetDoc()->GetFmtFromPool( static_cast<sal_uInt16>
diff --git a/sw/source/core/draw/dflyobj.cxx b/sw/source/core/draw/dflyobj.cxx
index ab9c5bc..6b83fea 100644
--- a/sw/source/core/draw/dflyobj.cxx
+++ b/sw/source/core/draw/dflyobj.cxx
@@ -860,13 +860,13 @@ Pointer  SwVirtFlyDrawObj::GetMacroPointer(
 bool SwVirtFlyDrawObj::HasMacro() const
 {
     const SwFmtURL &rURL = pFlyFrm->GetFmt()->GetURL();
-    return rURL.GetMap() || rURL.GetURL().Len();
+    return rURL.GetMap() || !rURL.GetURL().isEmpty();
 }
 
 SdrObject* SwVirtFlyDrawObj::CheckMacroHit( const SdrObjMacroHitRec& rRec ) const
 {
     const SwFmtURL &rURL = pFlyFrm->GetFmt()->GetURL();
-    if( rURL.GetMap() || rURL.GetURL().Len() )
+    if( rURL.GetMap() || !rURL.GetURL().isEmpty() )
     {
         SwRect aRect;
         if ( pFlyFrm->Lower() && pFlyFrm->Lower()->IsNoTxtFrm() )
diff --git a/sw/source/core/draw/dpage.cxx b/sw/source/core/draw/dpage.cxx
index ff1fcde..db945d6 100644
--- a/sw/source/core/draw/dpage.cxx
+++ b/sw/source/core/draw/dpage.cxx
@@ -152,7 +152,7 @@ sal_Bool SwDPage::RequestHelp( Window* pWindow, SdrView* pView,
                                            INetURLObject::DECODE_UNAMBIGUOUS);
                 }
             }
-            else if ( rURL.GetURL().Len() )
+            else if ( !rURL.GetURL().isEmpty() )
             {
                 sTxt = URIHelper::removePassword( rURL.GetURL(),
                                         INetURLObject::WAS_ENCODED,
diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx
index 78f792f..4765b71 100644
--- a/sw/source/core/frmedt/fefly1.cxx
+++ b/sw/source/core/frmedt/fefly1.cxx
@@ -1564,7 +1564,7 @@ const SwFrmFmt* SwFEShell::IsURLGrfAtPos( const Point& rPt, String* pURL,
     {
         SwFlyFrm *pFly = ((SwVirtFlyDrawObj*)pObj)->GetFlyFrm();
         const SwFmtURL &rURL = pFly->GetFmt()->GetURL();
-        if( rURL.GetURL().Len() || rURL.GetMap() )
+        if( !rURL.GetURL().isEmpty() || rURL.GetMap() )
         {
             bool bSetTargetFrameName = pTargetFrameName != 0;
             bool bSetDescription = pDescription != 0;
diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx
index 2528806..c71b8a0 100644
--- a/sw/source/core/layout/atrfrm.cxx
+++ b/sw/source/core/layout/atrfrm.cxx
@@ -1665,19 +1665,13 @@ bool SwFmtURL::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
     switch ( nMemberId )
     {
         case MID_URL_URL:
-        {
-            OUString sRet = GetURL();
-            rVal <<= sRet;
-        }
+            rVal <<= GetURL();
         break;
         case MID_URL_TARGET:
-        {
-            OUString sRet = GetTargetFrameName();
-            rVal <<= sRet;
-        }
+            rVal <<= GetTargetFrameName();
         break;
         case MID_URL_HYPERLINKNAME:
-            rVal <<= OUString( GetName() );
+            rVal <<= GetName();
             break;
         case MID_URL_CLIENTMAP:
         {
diff --git a/sw/source/filter/ww8/wrtww8gr.cxx b/sw/source/filter/ww8/wrtww8gr.cxx
index 80a078b..e32b9a6 100644
--- a/sw/source/filter/ww8/wrtww8gr.cxx
+++ b/sw/source/filter/ww8/wrtww8gr.cxx
@@ -388,7 +388,7 @@ void WW8Export::OutGrf(const sw::Frame &rFrame)
     //will be exported to ensure the fidelity
     const SwFmtURL& rURL = rFrame.GetFrmFmt().GetAttrSet().GetURL();
     bool bURLStarted = false;
-    if( rURL.GetURL().Len() && rFrame.GetWriterType() == sw::Frame::eGraphic)
+    if( !rURL.GetURL().isEmpty() && rFrame.GetWriterType() == sw::Frame::eGraphic)
     {
         bURLStarted = true;
         m_pAttrOutput->StartURL( rURL.GetURL(), rURL.GetTargetFrameName() );
diff --git a/sw/source/ui/dochdl/swdtflvr.cxx b/sw/source/ui/dochdl/swdtflvr.cxx
index a09a057..1c9999d 100644
--- a/sw/source/ui/dochdl/swdtflvr.cxx
+++ b/sw/source/ui/dochdl/swdtflvr.cxx
@@ -469,7 +469,7 @@ sal_Bool SwTransferable::GetData( const DataFlavor& rFlavor )
             const SwFmtURL& rURL = (SwFmtURL&)aSet.Get( RES_URL );
             if( rURL.GetMap() )
                 pImageMap = new ImageMap( *rURL.GetMap() );
-            else if( rURL.GetURL().Len() )
+            else if( !rURL.GetURL().isEmpty() )
                 pTargetURL = new INetImage( aEmptyStr, rURL.GetURL(),
                                             rURL.GetTargetFrameName(),
                                             aEmptyStr, Size() );
@@ -972,7 +972,7 @@ int SwTransferable::PrepareForCopy( sal_Bool bIsCut )
             pImageMap = new ImageMap( *rURL.GetMap() );
             AddFormat( SOT_FORMATSTR_ID_SVIM );
         }
-        else if( rURL.GetURL().Len() )
+        else if( !rURL.GetURL().isEmpty() )
         {
             pTargetURL = new INetImage( sGrfNm, rURL.GetURL(),
                                         rURL.GetTargetFrameName(),
@@ -2439,7 +2439,7 @@ int SwTransferable::_PasteAsHyperlink( TransferableDataHelper& rData,
                 rSh.GetFlyFrmAttr( aSet );
                 SwFmtURL aURL2( (SwFmtURL&)aSet.Get( RES_URL ) );
                 aURL2.SetURL( sFile, sal_False );
-                if( !aURL2.GetName().Len() )
+                if( aURL2.GetName().isEmpty() )
                     aURL2.SetName( sFile );
                 aSet.Put( aURL2 );
                 rSh.SetFlyFrmAttr( aSet );
@@ -2526,7 +2526,7 @@ int SwTransferable::_PasteFileName( TransferableDataHelper& rData,
                             rSh.GetFlyFrmAttr( aSet );
                             SwFmtURL aURL2( (SwFmtURL&)aSet.Get( RES_URL ) );
                             aURL2.SetURL( sFile, sal_False );
-                            if( !aURL2.GetName().Len() )
+                            if( aURL2.GetName().isEmpty() )
                                 aURL2.SetName( sFile );
                             aSet.Put( aURL2 );
                             rSh.SetFlyFrmAttr( aSet );
@@ -3061,7 +3061,7 @@ void SwTransferable::SetDataForDragAndDrop( const Point& rSttPos )
             pImageMap = new ImageMap( *rURL.GetMap() );
             AddFormat( SOT_FORMATSTR_ID_SVIM );
         }
-        else if( rURL.GetURL().Len() )
+        else if( !rURL.GetURL().isEmpty() )
         {
             pTargetURL = new INetImage( sGrfNm, rURL.GetURL(),
                                         rURL.GetTargetFrameName(),
diff --git a/sw/source/ui/docvw/romenu.cxx b/sw/source/ui/docvw/romenu.cxx
index 4adf975..9d0947a 100644
--- a/sw/source/ui/docvw/romenu.cxx
+++ b/sw/source/ui/docvw/romenu.cxx
@@ -121,7 +121,7 @@ SwReadOnlyPopup::SwReadOnlyPopup( const Point &rDPos, SwView &rV ) :
             const SwFmtURL& rURL = *(SwFmtURL*)pURLItem;
             if( rURL.GetMap() )
                 pImageMap = new ImageMap( *rURL.GetMap() );
-            else if( rURL.GetURL().Len() )
+            else if( !rURL.GetURL().isEmpty() )
                 pTargetURL = new INetImage( bLink ? sGrfName : aEmptyStr,
                                             rURL.GetURL(),
                                             rURL.GetTargetFrameName(),
diff --git a/sw/source/ui/utlui/attrdesc.cxx b/sw/source/ui/utlui/attrdesc.cxx
index 4c2e5d5..344e180 100644
--- a/sw/source/ui/utlui/attrdesc.cxx
+++ b/sw/source/ui/utlui/attrdesc.cxx
@@ -724,7 +724,7 @@ SfxItemPresentation SwFmtURL::GetPresentation
         {
             if ( pMap )
                 rText += "Client-Map";
-            if ( sURL.Len() )
+            if ( !sURL.isEmpty() )
             {
                 if ( pMap )
                     rText += " - ";
@@ -732,7 +732,7 @@ SfxItemPresentation SwFmtURL::GetPresentation
                 if ( bIsServerMap )
                     rText += " (Server-Map)";
             }
-            if ( sTargetFrameName.Len() )
+            if ( !sTargetFrameName.isEmpty() )
             {
                 rText = rText + ", Target: " + sTargetFrameName;
             }


More information about the Libreoffice-commits mailing list