diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2013-07-28 16:40:20 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2013-07-30 14:40:30 +0000 |
commit | 31ab7f0c7d20f1d7be5ce818d0d99b6bd5a8edde (patch) | |
tree | f3e2407665932d3467deee25ecbaf588b9e88bd8 /sw | |
parent | 1c48e4efa2369e5708798bdefb46b74a86415d00 (diff) |
String to OUString
Change-Id: I8d4f62b473ad43807621a9dbb826ed33857b737e
Reviewed-on: https://gerrit.libreoffice.org/5189
Reviewed-by: Luboš Luňák <l.lunak@suse.cz>
Tested-by: Luboš Luňák <l.lunak@suse.cz>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/crsrsh.hxx | 2 | ||||
-rw-r--r-- | sw/inc/doc.hxx | 2 | ||||
-rw-r--r-- | sw/inc/editsh.hxx | 2 | ||||
-rw-r--r-- | sw/inc/fmtinfmt.hxx | 29 | ||||
-rw-r--r-- | sw/source/core/access/acchyperlink.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/bastyp/init.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/crsr/crstrvl.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/doc/doc.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/doc/docfmt.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/doc/docglbl.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/edit/acorrect.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/edit/editsh.cxx | 10 | ||||
-rw-r--r-- | sw/source/core/inc/acorrect.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/txtnode/fmtatr2.cxx | 42 | ||||
-rw-r--r-- | sw/source/core/txtnode/txtatr2.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/html/htmlatr.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/html/htmlgrin.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/rtfattributeoutput.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8atr.cxx | 6 | ||||
-rw-r--r-- | sw/source/ui/dochdl/swdtflvr.cxx | 8 | ||||
-rw-r--r-- | sw/source/ui/wrtsh/wrtsh2.cxx | 21 |
21 files changed, 88 insertions, 74 deletions
diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx index a652acc076c0..61a7d2a2e493 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 854b86992bae..b032324d8fc8 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 6e4972193a7f..e45b4e9a54c9 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 426857f12ae7..02d0c9b76871 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 75e227c49c01..d93217e0c157 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 103c73e4e895..abd7120a5c81 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 0869c4614a3d..6511c3617f03 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 4840727cb3a9..b68698648ee1 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 18bad13e7585..8c3f4ea14c97 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 c3c55aa63f7b..a38a4a48253d 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 0b3252e4f6c9..936f3a800730 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 c49cb15fd4e3..91e1d782f270 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 5c82b1d9c4df..e0d0bc5c4fe2 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 d174d803b48c..b977bd611aa2 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 cc33b7cb73d2..351fdee5274b 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 0879237e069b..59084b16ca67 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 fa2cad15c111..67043bd938d2 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 70f19c87ac39..254adb2f7d57 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 f908dcf1b51f..66acee62f413 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 80485bd41b8d..b92f5e059715 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 f0d2855d9ed5..7aae0d16e0ba 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 |