diff options
author | Noel Grandin <noel@peralex.com> | 2013-08-26 15:22:55 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-08-29 09:30:06 +0200 |
commit | bf1db6daca85bee8333740d43e087feb2965a81b (patch) | |
tree | 3daed89ae5a5ad7c6bd3451f7bbbc556afb1c671 /sw | |
parent | df00d4c230d15951ad31405a3ea77e0faeebcb75 (diff) |
convert include/sfx2/linkmgr.hxx from String to OUString
along the way, de-virtual ScDocFunc::InsertAreaLink, since
it only has one implementation.
Change-Id: I3fc836f9954628f154e01b1c7ae8f90eb7600a76
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/ndgrf.hxx | 4 | ||||
-rw-r--r-- | sw/source/core/doc/doc.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/graphic/ndgrf.cxx | 37 | ||||
-rw-r--r-- | sw/source/ui/dochdl/swdtflvr.cxx | 4 |
4 files changed, 23 insertions, 24 deletions
diff --git a/sw/inc/ndgrf.hxx b/sw/inc/ndgrf.hxx index 0d8c3b5cde67..c839abb4b3c3 100644 --- a/sw/inc/ndgrf.hxx +++ b/sw/inc/ndgrf.hxx @@ -74,7 +74,7 @@ class SW_DLLPUBLIC SwGrfNode: public SwNoTxtNode SwGrfFmtColl* pGrfColl, SwAttrSet* pAutoAttr = 0 ); - void InsertLink( const String& rGrfName, const String& rFltName ); + void InsertLink( const OUString& rGrfName, const OUString& rFltName ); sal_Bool ImportGraphic( SvStream& rStrm ); sal_Bool HasStreamName() const { return maGrfObj.HasUserData(); } /** adjust return type and rename method to @@ -171,7 +171,7 @@ public: /** Re-read in case graphic was not OK. The current one gets replaced by the new one. */ - sal_Bool ReRead( const String& rGrfName, const String& rFltName, + sal_Bool ReRead( const String& rGrfName, const OUString& rFltName, const Graphic* pGraphic = 0, const GraphicObject* pGrfObj = 0, sal_Bool bModify = sal_True ); diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx index f63df89aa8ff..1750fd49db61 100644 --- a/sw/source/core/doc/doc.cxx +++ b/sw/source/core/doc/doc.cxx @@ -2486,7 +2486,7 @@ static ::sfx2::SvBaseLink* lcl_FindNextRemovableLink( const ::sfx2::SvBaseLinks& { ::sfx2::SvBaseLinkRef xLink = pLnk; - String sFName; + OUString sFName; rLnkMgr.GetDisplayNames( xLink, 0, &sFName, 0, 0 ); INetURLObject aURL( sFName ); diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx index 4f3a744e37f1..6c0b540fe61d 100644 --- a/sw/source/core/graphic/ndgrf.cxx +++ b/sw/source/core/graphic/ndgrf.cxx @@ -134,7 +134,7 @@ SwGrfNode::SwGrfNode( const SwNodeIndex & rWhere, } sal_Bool SwGrfNode::ReRead( - const String& rGrfName, const String& rFltName, + const String& rGrfName, const OUString& rFltName, const Graphic* pGraphic, const GraphicObject* pGrfObj, sal_Bool bNewGrf ) { @@ -153,11 +153,11 @@ sal_Bool SwGrfNode::ReRead( if( rGrfName.Len() ) { // Note: If there is DDE in the FltName, than it is a DDE-linked graphic - String sCmd( rGrfName ); - if( rFltName.Len() ) + OUString sCmd( rGrfName ); + if( !rFltName.isEmpty() ) { sal_uInt16 nNewType; - if( rFltName.EqualsAscii( "DDE" )) + if( rFltName == "DDE" ) nNewType = OBJECT_CLIENT_DDE; else { @@ -644,7 +644,7 @@ sal_Bool SwGrfNode::RestorePersistentData() return sal_True; } -void SwGrfNode::InsertLink( const String& rGrfName, const String& rFltName ) +void SwGrfNode::InsertLink( const OUString& rGrfName, const OUString& rFltName ) { refLink = new SwBaseLink( sfx2::LINKUPDATE_ONCALL, FORMAT_GDIMETAFILE, this ); @@ -652,25 +652,25 @@ void SwGrfNode::InsertLink( const String& rGrfName, const String& rFltName ) if( GetNodes().IsDocNodes() ) { refLink->SetVisible( pIDLA->IsVisibleLinks() ); - if( rFltName.EqualsAscii( "DDE" )) + if( rFltName == "DDE" ) { sal_Int32 nTmp = 0; String sApp, sTopic, sItem; - sApp = rGrfName.GetToken( 0, sfx2::cTokenSeparator, nTmp ); - sTopic = rGrfName.GetToken( 0, sfx2::cTokenSeparator, nTmp ); - sItem = rGrfName.Copy( nTmp ); + sApp = rGrfName.getToken( 0, sfx2::cTokenSeparator, nTmp ); + sTopic = rGrfName.getToken( 0, sfx2::cTokenSeparator, nTmp ); + sItem = rGrfName.copy( nTmp ); pIDLA->GetLinkManager().InsertDDELink( refLink, sApp, sTopic, sItem ); } else { - sal_Bool bSync = rFltName.EqualsAscii( "SYNCHRON" ); + sal_Bool bSync = rFltName == "SYNCHRON"; refLink->SetSynchron( bSync ); refLink->SetContentType( SOT_FORMATSTR_ID_SVXB ); pIDLA->GetLinkManager().InsertFileLink( *refLink, OBJECT_CLIENT_GRF, rGrfName, - (!bSync && rFltName.Len() ? &rFltName : 0) ); + (!bSync && !rFltName.isEmpty() ? &rFltName : 0) ); } } maGrfObj.SetLink( rGrfName ); @@ -946,15 +946,15 @@ SwCntntNode* SwGrfNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) const } const sfx2::LinkManager& rMgr = getIDocumentLinksAdministration()->GetLinkManager(); - String sFile, sFilter; + OUString sFile, sFilter; if( IsLinkedFile() ) rMgr.GetDisplayNames( refLink, 0, &sFile, 0, &sFilter ); else if( IsLinkedDDE() ) { - String sTmp1, sTmp2; + OUString sTmp1, sTmp2; rMgr.GetDisplayNames( refLink, &sTmp1, &sTmp2, &sFilter ); sfx2::MakeLnkName( sFile, &sTmp1, sTmp2, sFilter ); - sFilter.AssignAscii( RTL_CONSTASCII_STRINGPARAM( "DDE" )); + sFilter = "DDE"; } SwGrfNode* pGrfNd = pDoc->GetNodes().MakeGrfNode( rIdx, sFile, sFilter, @@ -1039,7 +1039,7 @@ void DelAllGrfCacheEntries( SwDoc* pDoc ) const sfx2::LinkManager& rLnkMgr = pDoc->GetLinkManager(); const ::sfx2::SvBaseLinks& rLnks = rLnkMgr.GetLinks(); SwGrfNode* pGrfNd; - String sFileNm; + OUString sFileNm; for( sal_uInt16 n = rLnks.size(); n; ) { ::sfx2::SvBaseLink* pLnk = &(*rLnks[ --n ]); @@ -1158,7 +1158,7 @@ void SwGrfNode::TriggerAsyncRetrieveInputStream() { mpThreadConsumer.reset( new SwAsyncRetrieveInputStreamThreadConsumer( *this ) ); - String sGrfNm; + OUString sGrfNm; refLink->GetLinkManager()->GetDisplayNames( refLink, 0, &sGrfNm, 0, 0 ); mpThreadConsumer->CreateThread( sGrfNm ); @@ -1212,10 +1212,9 @@ bool SwGrfNode::IsAsyncRetrieveInputStreamPossible() const if ( IsLinkedFile() ) { - String sGrfNm; + OUString sGrfNm; refLink->GetLinkManager()->GetDisplayNames( refLink, 0, &sGrfNm, 0, 0 ); - String sProtocol( "vnd.sun.star.pkg:" ); - if ( sGrfNm.CompareTo( sProtocol, sProtocol.Len() ) != 0 ) + if ( !sGrfNm.startsWith( "vnd.sun.star.pkg:" ) ) { bRet = true; } diff --git a/sw/source/ui/dochdl/swdtflvr.cxx b/sw/source/ui/dochdl/swdtflvr.cxx index f459b9519cd3..34fc1a39120e 100644 --- a/sw/source/ui/dochdl/swdtflvr.cxx +++ b/sw/source/ui/dochdl/swdtflvr.cxx @@ -2020,7 +2020,7 @@ int SwTransferable::_PasteDDE( TransferableDataHelper& rData, sal_Bool bMsg ) { // data from Clipboardformat - String aApp, aTopic, aItem; + OUString aApp, aTopic, aItem; { SotStorageStreamRef xStrm; @@ -2036,7 +2036,7 @@ int SwTransferable::_PasteDDE( TransferableDataHelper& rData, aItem = read_zeroTerminated_uInt8s_ToOUString(*xStrm, eEncoding); } - String aCmd; + OUString aCmd; sfx2::MakeLnkName( aCmd, &aApp, aTopic, aItem ); // do we want to read in a graphic now? |