editeng/qa/unit/core-test.cxx               |    2 -
 editeng/source/editeng/edtspell.cxx         |    2 -
 editeng/source/editeng/edtspell.hxx         |    2 -
 include/editeng/svxacorr.hxx                |    2 -
 sw/inc/crsrsh.hxx                           |    2 -
 sw/inc/doc.hxx                              |    2 -
 sw/inc/editsh.hxx                           |    2 -
 sw/inc/fmtinfmt.hxx                         |   29 +++++++++----------
 sw/source/core/access/acchyperlink.cxx      |    8 ++---
 sw/source/core/bastyp/init.cxx              |    2 -
 sw/source/core/crsr/crstrvl.cxx             |    4 +-
 sw/source/core/doc/doc.cxx                  |    4 +-
 sw/source/core/doc/docfmt.cxx               |    4 +-
 sw/source/core/doc/docglbl.cxx              |    2 -
 sw/source/core/edit/acorrect.cxx            |    4 +-
 sw/source/core/edit/editsh.cxx              |   10 +++---
 sw/source/core/inc/acorrect.hxx             |    2 -
 sw/source/core/txtnode/fmtatr2.cxx          |   42 ++++++++++++++++------------
 sw/source/core/txtnode/txtatr2.cxx          |    2 -
 sw/source/filter/html/htmlatr.cxx           |    4 +-
 sw/source/filter/html/htmlgrin.cxx          |    2 -
 sw/source/filter/ww8/rtfattributeoutput.cxx |    2 -
 sw/source/filter/ww8/ww8atr.cxx             |    6 ++--
 sw/source/ui/dochdl/swdtflvr.cxx            |    8 ++---
 sw/source/ui/wrtsh/wrtsh2.cxx               |   21 ++++++++++----
 25 files changed, 92 insertions(+), 78 deletions(-)

New commits:
commit 31ab7f0c7d20f1d7be5ce818d0d99b6bd5a8edde
Author: Matteo Casalin <matteo.casa...@yahoo.com>
Date:   Sun Jul 28 16:40:20 2013 +0200

    String to OUString
    
    Change-Id: I8d4f62b473ad43807621a9dbb826ed33857b737e
    Reviewed-on: https://gerrit.libreoffice.org/5189
    Reviewed-by: Luboš Luňák <l.lu...@suse.cz>
    Tested-by: Luboš Luňák <l.lu...@suse.cz>

diff --git a/editeng/qa/unit/core-test.cxx b/editeng/qa/unit/core-test.cxx
index 0975efb..ae3749c 100644
--- a/editeng/qa/unit/core-test.cxx
+++ b/editeng/qa/unit/core-test.cxx
@@ -253,7 +253,7 @@ private:
         //fprintf(stderr, "TestAutoCorrDoc::SetAttr\n");
         return true;
     }
-    virtual sal_Bool SetINetAttr( xub_StrLen, xub_StrLen, const String& )
+    virtual sal_Bool SetINetAttr( xub_StrLen, xub_StrLen, const OUString& )
     {
         //fprintf(stderr, "TestAutoCorrDoc::SetINetAttr\n");
         return true;
diff --git a/editeng/source/editeng/edtspell.cxx 
b/editeng/source/editeng/edtspell.cxx
index 3e1a3c9..37b1bf6f 100644
--- a/editeng/source/editeng/edtspell.cxx
+++ b/editeng/source/editeng/edtspell.cxx
@@ -660,7 +660,7 @@ sal_Bool EdtAutoCorrDoc::SetAttr( sal_uInt16 nStt, 
sal_uInt16 nEnd,
 }
 
 sal_Bool EdtAutoCorrDoc::SetINetAttr( sal_uInt16 nStt, sal_uInt16 nEnd,
-            const String& rURL )
+            const OUString& rURL )
 {
     // Turn the Text into a command field ...
     EditSelection aSel( EditPaM( pCurNode, nStt ), EditPaM( pCurNode, nEnd ) );
diff --git a/editeng/source/editeng/edtspell.hxx 
b/editeng/source/editeng/edtspell.hxx
index 699a6df..7df5e08 100644
--- a/editeng/source/editeng/edtspell.hxx
+++ b/editeng/source/editeng/edtspell.hxx
@@ -148,7 +148,7 @@ public:
     virtual sal_Bool    ReplaceRange( xub_StrLen nPos, xub_StrLen nLen, const 
String& rTxt );
 
     virtual sal_Bool    SetAttr( sal_uInt16 nStt, sal_uInt16 nEnd, sal_uInt16 
nSlotId, SfxPoolItem& );
-    virtual sal_Bool    SetINetAttr( sal_uInt16 nStt, sal_uInt16 nEnd, const 
String& rURL );
+    virtual sal_Bool    SetINetAttr( sal_uInt16 nStt, sal_uInt16 nEnd, const 
OUString& rURL );
 
     virtual const String* GetPrevPara( sal_Bool bAtNormalPos );
 
diff --git a/include/editeng/svxacorr.hxx b/include/editeng/svxacorr.hxx
index 0a493d7..a90f14f 100644
--- a/include/editeng/svxacorr.hxx
+++ b/include/editeng/svxacorr.hxx
@@ -96,7 +96,7 @@ public:
     virtual sal_Bool SetAttr( xub_StrLen nStt, xub_StrLen nEnd, sal_uInt16 
nSlotId,
                             SfxPoolItem& ) = 0;
 
-    virtual sal_Bool SetINetAttr( xub_StrLen nStt, xub_StrLen nEnd, const 
String& rURL ) = 0;
+    virtual sal_Bool SetINetAttr( xub_StrLen nStt, xub_StrLen nEnd, const 
OUString& rURL ) = 0;
 
     // Return the text of a previous paragraph. This must not be empty!
     // If no paragraph exits or just an empty one, then return 0.
diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx
index a652acc..61a7d2a 100644
--- a/sw/inc/crsrsh.hxx
+++ b/sw/inc/crsrsh.hxx
@@ -777,7 +777,7 @@ public:
 
     sal_Bool SelectTxtAttr( sal_uInt16 nWhich, sal_Bool bExpand, const 
SwTxtAttr* pAttr = 0 );
     bool GotoINetAttr( const SwTxtINetFmt& rAttr );
-    const SwFmtINetFmt* FindINetAttr( const String& rName ) const;
+    const SwFmtINetFmt* FindINetAttr( const OUString& rName ) const;
 
     sal_Bool CheckTblBoxCntnt( const SwPosition* pPos = 0 );
     void SaveTblBoxCntnt( const SwPosition* pPos = 0 );
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index 854b869..b032324 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -1809,7 +1809,7 @@ public:
     void SetAutoCorrExceptWord( SwAutoCorrExceptWord* pNew );
     SwAutoCorrExceptWord* GetAutoCorrExceptWord()       { return mpACEWord; }
 
-    const SwFmtINetFmt* FindINetAttr( const String& rName ) const;
+    const SwFmtINetFmt* FindINetAttr( const OUString& rName ) const;
 
     /// Call into intransparent Basic; expect possible Return String.
     bool ExecMacro( const SvxMacro& rMacro, String* pRet = 0, SbxArray* pArgs 
= 0 );
diff --git a/sw/inc/editsh.hxx b/sw/inc/editsh.hxx
index 6e49721..e45b4e9 100644
--- a/sw/inc/editsh.hxx
+++ b/sw/inc/editsh.hxx
@@ -796,7 +796,7 @@ public:
     /// Calculates selection.
     String Calculate();
 
-    sal_Bool InsertURL( const SwFmtINetFmt& rFmt, const String& rStr,
+    sal_Bool InsertURL( const SwFmtINetFmt& rFmt, const OUString& rStr,
                     sal_Bool bKeepSelection = sal_False );
     sal_uInt16 GetINetAttrs( SwGetINetAttrs& rArr );
 
diff --git a/sw/inc/fmtinfmt.hxx b/sw/inc/fmtinfmt.hxx
index 426857f..02d0c9b 100644
--- a/sw/inc/fmtinfmt.hxx
+++ b/sw/inc/fmtinfmt.hxx
@@ -19,7 +19,6 @@
 #ifndef _FMTINFMT_HXX
 #define _FMTINFMT_HXX
 
-#include <tools/string.hxx>
 #include <svl/poolitem.hxx>
 #include "swdllapi.h"
 
@@ -34,17 +33,17 @@ class SW_DLLPUBLIC SwFmtINetFmt: public SfxPoolItem
 {
     friend class SwTxtINetFmt;
 
-    String aURL;                    ///< URL.
-    String aTargetFrame;            ///< Target frame for URL.
-    String aINetFmt;
-    String aVisitedFmt;
-    String aName;                   ///< Name of the link.
+    OUString aURL;                  ///< URL.
+    OUString aTargetFrame;          ///< Target frame for URL.
+    OUString aINetFmt;
+    OUString aVisitedFmt;
+    OUString aName;                 ///< Name of the link.
     SvxMacroTableDtor* pMacroTbl;
     SwTxtINetFmt* pTxtAttr;         ///< My TextAttribute.
     sal_uInt16 nINetId;
     sal_uInt16 nVisitedId;
 public:
-    SwFmtINetFmt( const String& rURL, const String& rTarget );
+    SwFmtINetFmt( const OUString& rURL, const OUString& rTarget );
     SwFmtINetFmt( const SwFmtINetFmt& rAttr );
     SwFmtINetFmt();                     ///< For TypeInfo.
     virtual ~SwFmtINetFmt();
@@ -69,18 +68,18 @@ public:
     const SwTxtINetFmt* GetTxtINetFmt() const   { return pTxtAttr; }
     SwTxtINetFmt* GetTxtINetFmt()               { return pTxtAttr; }
 
-    const String& GetValue() const          { return aURL; }
+    OUString GetValue() const               { return aURL; }
 
-    const String& GetName() const           { return aName; }
-    void SetName( const String& rNm )       { aName = rNm; }
+    OUString GetName() const                { return aName; }
+    void SetName( const OUString& rNm )     { aName = rNm; }
 
-    const String& GetTargetFrame() const    { return aTargetFrame; }
+    OUString GetTargetFrame() const         { return aTargetFrame; }
 
-    const String& GetINetFmt() const        { return aINetFmt; }
-    void SetINetFmt( const String& rNm )    { aINetFmt = rNm; }
+    OUString GetINetFmt() const             { return aINetFmt; }
+    void SetINetFmt( const OUString& rNm )  { aINetFmt = rNm; }
 
-    const String& GetVisitedFmt() const     { return aVisitedFmt; }
-    void SetVisitedFmt( const String& rNm ) { aVisitedFmt = rNm; }
+    OUString GetVisitedFmt() const            { return aVisitedFmt; }
+    void SetVisitedFmt( const OUString& rNm ) { aVisitedFmt = rNm; }
 
     sal_uInt16 GetINetFmtId() const             { return nINetId; }
     void SetINetFmtId( sal_uInt16 nNew )        { nINetId = nNew; }
diff --git a/sw/source/core/access/acchyperlink.cxx 
b/sw/source/core/access/acchyperlink.cxx
index 75e227c..d93217e 100644
--- a/sw/source/core/access/acchyperlink.cxx
+++ b/sw/source/core/access/acchyperlink.cxx
@@ -75,7 +75,7 @@ sal_Bool SAL_CALL SwAccessibleHyperlink::doAccessibleAction( 
sal_Int32 nIndex )
     if( pTxtAttr && 0 == nIndex )
     {
         const SwFmtINetFmt& rINetFmt = pTxtAttr->GetINetFmt();
-        if( rINetFmt.GetValue().Len() )
+        if( !rINetFmt.GetValue().isEmpty() )
         {
             ViewShell *pVSh = xPara->GetShell();
             if( pVSh )
@@ -102,16 +102,14 @@ OUString SAL_CALL 
SwAccessibleHyperlink::getAccessibleActionDescription(
         sal_Int32 nIndex )
         throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
 {
-    OUString sDesc;
-
     const SwTxtAttr *pTxtAttr = GetTxtAttr();
     if( pTxtAttr && 0 == nIndex )
     {
         const SwFmtINetFmt& rINetFmt = pTxtAttr->GetINetFmt();
-        sDesc = OUString( rINetFmt.GetValue() );
+        return rINetFmt.GetValue();
     }
 
-    return sDesc;
+    return OUString();
 }
 
 uno::Reference< XAccessibleKeyBinding > SAL_CALL
diff --git a/sw/source/core/bastyp/init.cxx b/sw/source/core/bastyp/init.cxx
index 103c73e..abd7120 100644
--- a/sw/source/core/bastyp/init.cxx
+++ b/sw/source/core/bastyp/init.cxx
@@ -500,7 +500,7 @@ void _InitCore()
     aAttrTab[ RES_CHRATR_BOX - POOLATTR_BEGIN ] =           new SvxBoxItem( 
RES_CHRATR_BOX );
 
     aAttrTab[ RES_TXTATR_AUTOFMT- POOLATTR_BEGIN ] =        new SwFmtAutoFmt;
-    aAttrTab[ RES_TXTATR_INETFMT - POOLATTR_BEGIN ] =       new SwFmtINetFmt( 
aEmptyStr, aEmptyStr );
+    aAttrTab[ RES_TXTATR_INETFMT - POOLATTR_BEGIN ] =       new SwFmtINetFmt( 
OUString(), OUString() );
     aAttrTab[ RES_TXTATR_REFMARK - POOLATTR_BEGIN ] =       new SwFmtRefMark( 
aEmptyStr );
     aAttrTab[ RES_TXTATR_TOXMARK - POOLATTR_BEGIN ] =       new SwTOXMark;
     aAttrTab[ RES_TXTATR_CHARFMT- POOLATTR_BEGIN ] =        new SwFmtCharFmt( 
0 );
diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index 0869c46..6511c36 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -1278,7 +1278,7 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
                     pTxtAttr = pTxtNd->GetTxtAttrAt(
                             aPos.nContent.GetIndex(), RES_TXTATR_INETFMT);
                     // "detect" only INetAttrs with URLs
-                    if( pTxtAttr && pTxtAttr->GetINetFmt().GetValue().Len() )
+                    if( pTxtAttr && 
!pTxtAttr->GetINetFmt().GetValue().isEmpty() )
                     {
                         bRet = sal_True;
                         if( bSetCrsr )
@@ -1657,7 +1657,7 @@ bool SwCrsrShell::GotoINetAttr( const SwTxtINetFmt& rAttr 
)
 }
 
 
-const SwFmtINetFmt* SwCrsrShell::FindINetAttr( const String& rName ) const
+const SwFmtINetFmt* SwCrsrShell::FindINetAttr( const OUString& rName ) const
 {
     return mpDoc->FindINetAttr( rName );
 }
diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index 4840727..b686986 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -2039,7 +2039,7 @@ void SwDoc::InvalidateAutoCompleteFlag()
     }   //swmod 080219
 }
 
-const SwFmtINetFmt* SwDoc::FindINetAttr( const String& rName ) const
+const SwFmtINetFmt* SwDoc::FindINetAttr( const OUString& rName ) const
 {
     const SwFmtINetFmt* pItem;
     const SwTxtINetFmt* pTxtAttr;
@@ -2048,7 +2048,7 @@ const SwFmtINetFmt* SwDoc::FindINetAttr( const String& 
rName ) const
     for( n = 0; n < nMaxItems; ++n )
         if( 0 != (pItem = (SwFmtINetFmt*)GetAttrPool().GetItem2(
             RES_TXTATR_INETFMT, n ) ) &&
-            pItem->GetName().Equals( rName ) &&
+            pItem->GetName() == rName &&
             0 != ( pTxtAttr = pItem->GetTxtINetFmt()) &&
             0 != ( pTxtNd = pTxtAttr->GetpTxtNode() ) &&
             &pTxtNd->GetNodes() == &GetNodes() )
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index 18bad13..8c3f4ea 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -343,7 +343,7 @@ void SwDoc::ResetAttrs( const SwPaM &rRg,
         // Special case: if the Crsr is located within a URL attribute, we 
take over it's area
         SwTxtAttr const*const pURLAttr(
             pTxtNd->GetTxtAttrAt(rSt.GetIndex(), RES_TXTATR_INETFMT));
-        if (pURLAttr && pURLAttr->GetINetFmt().GetValue().Len())
+        if (pURLAttr && !pURLAttr->GetINetFmt().GetValue().isEmpty())
         {
             nMkPos = *pURLAttr->GetStart();
             nPtPos = *pURLAttr->GetEnd();
@@ -790,7 +790,7 @@ lcl_InsAttr(SwDoc *const pDoc, const SwPaM &rRg, const 
SfxItemSet& rChgSet,
             // Special case: if the Crsr is located within a URL attribute, we 
take over it's area
             SwTxtAttr const*const pURLAttr(
                 pTxtNd->GetTxtAttrAt(rSt.GetIndex(), RES_TXTATR_INETFMT));
-            if (pURLAttr && pURLAttr->GetINetFmt().GetValue().Len())
+            if (pURLAttr && !pURLAttr->GetINetFmt().GetValue().isEmpty())
             {
                 nMkPos = *pURLAttr->GetStart();
                 nPtPos = *pURLAttr->GetEnd();
diff --git a/sw/source/core/doc/docglbl.cxx b/sw/source/core/doc/docglbl.cxx
index c3c55aa..a38a4a4 100644
--- a/sw/source/core/doc/docglbl.cxx
+++ b/sw/source/core/doc/docglbl.cxx
@@ -395,7 +395,7 @@ bool SwDoc::SplitDoc( sal_uInt16 eDocType, const String& 
rPath, bool bOutline, c
                         }
 
                         // set the link in the StartNode
-                        SwFmtINetFmt aINet( sFileName , aEmptyStr );
+                        SwFmtINetFmt aINet( sFileName , OUString() );
                         SwTxtNode* pTNd = (SwTxtNode*)pStartNd;
                         pTNd->InsertItem(aINet, 0, pTNd->GetTxt().getLength());
 
diff --git a/sw/source/core/edit/acorrect.cxx b/sw/source/core/edit/acorrect.cxx
index 0b3252e..936f3a8 100644
--- a/sw/source/core/edit/acorrect.cxx
+++ b/sw/source/core/edit/acorrect.cxx
@@ -250,14 +250,14 @@ sal_Bool SwAutoCorrDoc::SetAttr( xub_StrLen nStt, 
xub_StrLen nEnd, sal_uInt16 nS
     return 0 != nWhich;
 }
 
-sal_Bool SwAutoCorrDoc::SetINetAttr( xub_StrLen nStt, xub_StrLen nEnd, const 
String& rURL )
+sal_Bool SwAutoCorrDoc::SetINetAttr( xub_StrLen nStt, xub_StrLen nEnd, const 
OUString& rURL )
 {
     const SwNodeIndex& rNd = rCrsr.GetPoint()->nNode;
     SwPaM aPam( rNd, nStt, rNd, nEnd );
 
     SfxItemSet aSet( rEditSh.GetDoc()->GetAttrPool(),
                         RES_TXTATR_INETFMT, RES_TXTATR_INETFMT );
-    aSet.Put( SwFmtINetFmt( rURL, aEmptyStr ));
+    aSet.Put( SwFmtINetFmt( rURL, OUString() ));
     rEditSh.GetDoc()->SetFmtItemByAutoFmt( aPam, aSet );
     if( bUndoIdInitialized )
         bUndoIdInitialized = true;
diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx
index c49cb15..91e1d78 100644
--- a/sw/source/core/edit/editsh.cxx
+++ b/sw/source/core/edit/editsh.cxx
@@ -633,16 +633,16 @@ Graphic SwEditShell::GetIMapGraphic() const
     return aRet;
 }
 
-sal_Bool SwEditShell::InsertURL( const SwFmtINetFmt& rFmt, const String& rStr, 
sal_Bool bKeepSelection )
+sal_Bool SwEditShell::InsertURL( const SwFmtINetFmt& rFmt, const OUString& 
rStr, sal_Bool bKeepSelection )
 {
     // URL and hint text (directly or via selection) necessary
-    if( !rFmt.GetValue().Len() ||   ( !rStr.Len() && !HasSelection() ) )
+    if( rFmt.GetValue().isEmpty() || ( rStr.isEmpty() && !HasSelection() ) )
         return sal_False;
     StartAllAction();
     GetDoc()->GetIDocumentUndoRedo().StartUndo( UNDO_UI_INSERT_URLTXT, NULL);
     bool bInsTxt = true;
 
-    if( rStr.Len() )
+    if( !rStr.isEmpty() )
     {
         SwPaM* pCrsr = GetCrsr();
         if( pCrsr->HasMark() && *pCrsr->GetPoint() != *pCrsr->GetMark() )
@@ -652,7 +652,7 @@ sal_Bool SwEditShell::InsertURL( const SwFmtINetFmt& rFmt, 
const String& rStr, s
             if( pCrsr->GetNext() == pCrsr )
             {
                 // einfach Selection -> Text ueberpruefen
-                String sTxt(comphelper::string::stripEnd(GetSelTxt(), ' '));
+                const OUString sTxt(comphelper::string::stripEnd(GetSelTxt(), 
' '));
                 if( sTxt == rStr )
                     bDelTxt = bInsTxt = false;
             }
@@ -669,7 +669,7 @@ sal_Bool SwEditShell::InsertURL( const SwFmtINetFmt& rFmt, 
const String& rStr, s
         {
             Insert2( rStr );
             SetMark();
-            ExtendSelection( sal_False, rStr.Len() );
+            ExtendSelection( sal_False, rStr.getLength() );
         }
     }
     else
diff --git a/sw/source/core/inc/acorrect.hxx b/sw/source/core/inc/acorrect.hxx
index 5c82b1d..e0d0bc5c 100644
--- a/sw/source/core/inc/acorrect.hxx
+++ b/sw/source/core/inc/acorrect.hxx
@@ -65,7 +65,7 @@ public:
     virtual sal_Bool SetAttr( xub_StrLen nStt, xub_StrLen nEnd, sal_uInt16 
nSlotId,
                             SfxPoolItem& );
 
-    virtual sal_Bool SetINetAttr( xub_StrLen nStt, xub_StrLen nEnd, const 
String& rURL );
+    virtual sal_Bool SetINetAttr( xub_StrLen nStt, xub_StrLen nEnd, const 
OUString& rURL );
 
     // return text of a previous paragraph
     // This must not be empty/blank!
diff --git a/sw/source/core/txtnode/fmtatr2.cxx 
b/sw/source/core/txtnode/fmtatr2.cxx
index d174d80..b977bd6 100644
--- a/sw/source/core/txtnode/fmtatr2.cxx
+++ b/sw/source/core/txtnode/fmtatr2.cxx
@@ -185,7 +185,7 @@ SwFmtINetFmt::SwFmtINetFmt()
     nVisitedId( 0 )
 {}
 
-SwFmtINetFmt::SwFmtINetFmt( const XubString& rURL, const XubString& rTarget )
+SwFmtINetFmt::SwFmtINetFmt( const OUString& rURL, const OUString& rTarget )
     : SfxPoolItem( RES_TXTATR_INETFMT ),
     aURL( rURL ),
     aTargetFrame( rTarget ),
@@ -292,33 +292,37 @@ const SvxMacro* SwFmtINetFmt::GetMacro( sal_uInt16 nEvent 
) const
 
 bool SwFmtINetFmt::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
 {
-    bool bRet = true;
-    XubString sVal;
     nMemberId &= ~CONVERT_TWIPS;
     switch(nMemberId)
     {
         case MID_URL_URL:
-            sVal = aURL;
+            rVal <<= aURL;
         break;
         case MID_URL_TARGET:
-            sVal = aTargetFrame;
+            rVal <<= aTargetFrame;
         break;
         case MID_URL_HYPERLINKNAME:
-            sVal = aName;
+            rVal <<= aName;
         break;
         case MID_URL_VISITED_FMT:
-            sVal = aVisitedFmt;
+        {
+            String sVal = aVisitedFmt;
             if( !sVal.Len() && nVisitedId != 0 )
                 SwStyleNameMapper::FillUIName( nVisitedId, sVal );
             if( sVal.Len() )
                 SwStyleNameMapper::FillProgName( sVal, sVal, 
nsSwGetPoolIdFromName::GET_POOLID_CHRFMT, true );
+            rVal <<= OUString(sVal);
+        }
         break;
         case MID_URL_UNVISITED_FMT:
-            sVal = aINetFmt;
+        {
+            String sVal = aINetFmt;
             if( !sVal.Len() && nINetId != 0 )
                 SwStyleNameMapper::FillUIName( nINetId, sVal );
             if( sVal.Len() )
                 SwStyleNameMapper::FillProgName( sVal, sVal, 
nsSwGetPoolIdFromName::GET_POOLID_CHRFMT, true );
+            rVal <<= OUString(sVal);
+        }
         break;
         case MID_URL_HYPERLINKEVENTS:
         {
@@ -330,13 +334,13 @@ bool SwFmtINetFmt::QueryValue( uno::Any& rVal, sal_uInt8 
nMemberId ) const
 
             // all others return a string; so we just set rVal here and exit
             rVal <<= xNameReplace;
-            return bRet;
         }
+        break;
         default:
+            rVal <<= OUString();
         break;
     }
-    rVal <<= OUString(sVal);
-    return bRet;
+    return true;
 }
 bool SwFmtINetFmt::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId  )
 {
@@ -370,32 +374,36 @@ bool SwFmtINetFmt::PutValue( const uno::Any& rVal, 
sal_uInt8 nMemberId  )
         // all string properties:
         if(rVal.getValueType() != ::getCppuType((OUString*)0))
             return false;
-        XubString sVal = *(OUString*)rVal.getValue();
+
         switch(nMemberId)
         {
             case MID_URL_URL:
-                aURL = sVal;
+                rVal >>= aURL;
                 break;
             case MID_URL_TARGET:
-                aTargetFrame = sVal;
+                rVal >>= aTargetFrame;
                 break;
             case MID_URL_HYPERLINKNAME:
-                aName = sVal;
+                rVal >>= aName;
                 break;
             case MID_URL_VISITED_FMT:
             {
+                OUString sVal;
+                rVal >>= sVal;
                 String aString;
                 SwStyleNameMapper::FillUIName( sVal, aString, 
nsSwGetPoolIdFromName::GET_POOLID_CHRFMT, true );
-                aVisitedFmt = OUString ( aString );
+                aVisitedFmt = aString;
                 nVisitedId = SwStyleNameMapper::GetPoolIdFromUIName( 
aVisitedFmt,
                                                
nsSwGetPoolIdFromName::GET_POOLID_CHRFMT );
             }
             break;
             case MID_URL_UNVISITED_FMT:
             {
+                OUString sVal;
+                rVal >>= sVal;
                 String aString;
                 SwStyleNameMapper::FillUIName( sVal, aString, 
nsSwGetPoolIdFromName::GET_POOLID_CHRFMT, true );
-                aINetFmt = OUString ( aString );
+                aINetFmt = aString;
                 nINetId = SwStyleNameMapper::GetPoolIdFromUIName( aINetFmt, 
nsSwGetPoolIdFromName::GET_POOLID_CHRFMT );
             }
             break;
diff --git a/sw/source/core/txtnode/txtatr2.cxx 
b/sw/source/core/txtnode/txtatr2.cxx
index cc33b7c..351fdee 100644
--- a/sw/source/core/txtnode/txtatr2.cxx
+++ b/sw/source/core/txtnode/txtatr2.cxx
@@ -130,7 +130,7 @@ SwCharFmt* SwTxtINetFmt::GetCharFmt()
     const SwFmtINetFmt& rFmt = SwTxtAttrEnd::GetINetFmt();
     SwCharFmt* pRet = NULL;
 
-    if( rFmt.GetValue().Len() )
+    if( !rFmt.GetValue().isEmpty() )
     {
         const SwDoc* pDoc = GetTxtNode().GetDoc();
         if( !IsVisitedValid() )
diff --git a/sw/source/filter/html/htmlatr.cxx 
b/sw/source/filter/html/htmlatr.cxx
index 0879237..59084b1 100644
--- a/sw/source/filter/html/htmlatr.cxx
+++ b/sw/source/filter/html/htmlatr.cxx
@@ -2923,7 +2923,7 @@ Writer& OutHTML_INetFmt( Writer& rWrt, const 
SwFmtINetFmt& rINetFmt, sal_Bool bO
     sal_Bool bEvents = pMacTable != 0 && !pMacTable->empty();
 
     // Gibt es ueberhaupt etwas auszugeben?
-    if( !aURL.Len() && !bEvents && !rINetFmt.GetName().Len() )
+    if( !aURL.Len() && !bEvents && rINetFmt.GetName().isEmpty() )
         return rWrt;
 
     // Tag aus? Dann nur ein </A> ausgeben.
@@ -2999,7 +2999,7 @@ Writer& OutHTML_INetFmt( Writer& rWrt, const 
SwFmtINetFmt& rINetFmt, sal_Bool bO
         sOut.append('\"');
     }
 
-    if( rINetFmt.GetName().Len() )
+    if( !rINetFmt.GetName().isEmpty() )
     {
         sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_name).append("=\"");
         rWrt.Strm() << sOut.makeStringAndClear().getStr();
diff --git a/sw/source/filter/html/htmlgrin.cxx 
b/sw/source/filter/html/htmlgrin.cxx
index fa2cad1..67043bd 100644
--- a/sw/source/filter/html/htmlgrin.cxx
+++ b/sw/source/filter/html/htmlgrin.cxx
@@ -760,7 +760,7 @@ IMAGE_SETEVENT:
             // Wenn das Attribut auch ein Sprungziel ist, fuegen
             // wir noch eine Bookmark vor der Grafik ein, weil das
             // SwFmtURL kein Sprungziel ist.
-            if( rINetFmt.GetName().Len() )
+            if( !rINetFmt.GetName().isEmpty() )
             {
                 pPam->Move( fnMoveBackward );
                 InsertBookmark( rINetFmt.GetName() );
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx 
b/sw/source/filter/ww8/rtfattributeoutput.cxx
index 70f19c8..254adb2 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -2363,7 +2363,7 @@ void RtfAttributeOutput::TextINetFormat( const 
SwFmtINetFmt& rURL )
 {
     SAL_INFO("sw.rtf", OSL_THIS_FUNC);
 
-    if( rURL.GetValue().Len() )
+    if( !rURL.GetValue().isEmpty() )
     {
         const SwCharFmt* pFmt;
         const SwTxtINetFmt* pTxtAtr = rURL.GetTxtINetFmt();
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index f908dcf..66acee6 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -1614,11 +1614,11 @@ void WW8AttributeOutput::CharBackground( const 
SvxBrushItem& rBrush )
 
 void WW8AttributeOutput::TextINetFormat( const SwFmtINetFmt& rINet )
 {
-    if ( rINet.GetValue().Len() )
+    if ( !rINet.GetValue().isEmpty() )
     {
         sal_uInt16 nId;
-        const String& rStr = rINet.GetINetFmt();
-        if ( rStr.Len() )
+        const OUString rStr = rINet.GetINetFmt();
+        if ( !rStr.isEmpty() )
             nId = rINet.GetINetFmtId();
         else
             nId = RES_POOLCHR_INET_NORMAL;
diff --git a/sw/source/ui/dochdl/swdtflvr.cxx b/sw/source/ui/dochdl/swdtflvr.cxx
index 80485bd..b92f5e0 100644
--- a/sw/source/ui/dochdl/swdtflvr.cxx
+++ b/sw/source/ui/dochdl/swdtflvr.cxx
@@ -1312,7 +1312,7 @@ int SwTransferable::PasteData( TransferableDataHelper& 
rData,
                     INetBookmark aBkmk;
                     if( rData.GetINetBookmark( nFormat, aBkmk ) )
                     {
-                        SwFmtINetFmt aFmt( aBkmk.GetURL(), aEmptyStr );
+                        SwFmtINetFmt aFmt( aBkmk.GetURL(), OUString() );
                         rSh.InsertURL( aFmt, aBkmk.GetDescription() );
                         nRet = 1;
                     }
@@ -1441,7 +1441,7 @@ int SwTransferable::PasteData( TransferableDataHelper& 
rData,
 
                 if( nRet )
                 {
-                    SwFmtINetFmt aFmt( sURL, aEmptyStr );
+                    SwFmtINetFmt aFmt( sURL, OUString() );
                     rSh.InsertURL( aFmt, sDesc );
                 }
             }
@@ -2448,7 +2448,7 @@ int SwTransferable::_PasteAsHyperlink( 
TransferableDataHelper& rData,
 
         default:
             {
-                rSh.InsertURL( SwFmtINetFmt( sFile, aEmptyStr ),
+                rSh.InsertURL( SwFmtINetFmt( sFile, OUString() ),
                                 sDesc.Len() ? sDesc : sFile );
             }
         }
@@ -2535,7 +2535,7 @@ int SwTransferable::_PasteFileName( 
TransferableDataHelper& rData,
 
                     default:
                         {
-                            rSh.InsertURL( SwFmtINetFmt( sFile, aEmptyStr ),
+                            rSh.InsertURL( SwFmtINetFmt( sFile, OUString() ),
                                             sDesc.Len() ? sDesc : sFile );
                         }
                     }
diff --git a/sw/source/ui/wrtsh/wrtsh2.cxx b/sw/source/ui/wrtsh/wrtsh2.cxx
index f0d2855..7aae0d16 100644
--- a/sw/source/ui/wrtsh/wrtsh2.cxx
+++ b/sw/source/ui/wrtsh/wrtsh2.cxx
@@ -307,7 +307,7 @@ void SwWrtShell::ClickToField( const SwField& rFld )
 
 void SwWrtShell::ClickToINetAttr( const SwFmtINetFmt& rItem, sal_uInt16 
nFilter )
 {
-    if( !rItem.GetValue().Len() )
+    if( rItem.GetValue().isEmpty() )
         return ;
 
     bIsInClickToEdit = true;
@@ -419,17 +419,26 @@ void SwWrtShell::NavigatorPaste( const 
NaviContentBookmark& rBkmk,
     if( EXCHG_IN_ACTION_COPY == nAction )
     {
         // Insert
-        String sURL = rBkmk.GetURL();
+        OUString sURL = rBkmk.GetURL();
         // Is this is a jump within the current Doc?
         const SwDocShell* pDocShell = GetView().GetDocShell();
         if(pDocShell->HasName())
         {
-            const String rName = 
pDocShell->GetMedium()->GetURLObject().GetURLNoMark();
+            const OUString rName = 
pDocShell->GetMedium()->GetURLObject().GetURLNoMark();
 
-            if(COMPARE_EQUAL == sURL.CompareTo(rName, rName.Len()))
-                sURL.Erase(0, rName.Len());
+            if (sURL.startsWith(rName))
+            {
+                if (sURL.getLength()>rName.getLength())
+                {
+                    sURL = sURL.copy(rName.getLength());
+                }
+                else
+                {
+                    sURL = OUString();
+                }
+            }
         }
-        SwFmtINetFmt aFmt( sURL, aEmptyStr );
+        SwFmtINetFmt aFmt( sURL, OUString() );
         InsertURL( aFmt, rBkmk.GetDescription() );
     }
     else
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to