diff options
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/appl/appdde.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/appl/fileobj.cxx | 16 | ||||
-rw-r--r-- | sfx2/source/appl/fileobj.hxx | 4 | ||||
-rw-r--r-- | sfx2/source/appl/impldde.cxx | 12 | ||||
-rw-r--r-- | sfx2/source/appl/impldde.hxx | 2 | ||||
-rw-r--r-- | sfx2/source/appl/linkmgr2.cxx | 84 | ||||
-rw-r--r-- | sfx2/source/appl/lnkbase2.cxx | 20 |
7 files changed, 52 insertions, 88 deletions
diff --git a/sfx2/source/appl/appdde.cxx b/sfx2/source/appl/appdde.cxx index 563d378a09e5..e9e827ee3f73 100644 --- a/sfx2/source/appl/appdde.cxx +++ b/sfx2/source/appl/appdde.cxx @@ -642,7 +642,7 @@ bool SfxDdeDocTopic_Impl::StartAdviseLoop() if( pNewObj ) { // then we also establish a corresponding SvBaseLink - String sNm, sTmp( Application::GetAppName() ); + OUString sNm, sTmp( Application::GetAppName() ); ::sfx2::MakeLnkName( sNm, &sTmp, pSh->GetTitle(SFX_TITLE_FULLNAME), GetCurItem() ); new ::sfx2::SvBaseLink( sNm, OBJECT_DDE_EXTERN, pNewObj ); bRet = true; diff --git a/sfx2/source/appl/fileobj.cxx b/sfx2/source/appl/fileobj.cxx index 5cf77dbdf7e8..a974726cd818 100644 --- a/sfx2/source/appl/fileobj.cxx +++ b/sfx2/source/appl/fileobj.cxx @@ -305,7 +305,7 @@ sal_Bool SvFileObject::GetGraphic_Impl( Graphic& rGrf, SvStream* pStream ) { GraphicFilter& rGF = GraphicFilter::GetGraphicFilter(); - const sal_uInt16 nFilter = sFilter.Len() && rGF.GetImportFormatCount() + const sal_uInt16 nFilter = !sFilter.isEmpty() && rGF.GetImportFormatCount() ? rGF.GetImportFormatNumber( sFilter ) : GRFILTER_FORMAT_DONTKNOW; @@ -358,12 +358,12 @@ sal_Bool SvFileObject::GetGraphic_Impl( Graphic& rGrf, SvStream* pStream ) DBG_WARNING3( "Graphic error [%d] - [%s] URL[%s]", nRes, xMed->GetPhysicalName().getStr(), - sFileNm.GetBuffer() ); + sFileNm.getStr() ); } else { DBG_WARNING2( "Graphic error [%d] - [%s]", - nRes, sFileNm.GetBuffer() ); + nRes, sFileNm.getStr() ); } } #endif @@ -420,7 +420,7 @@ String impl_getFilter( const String& _rURL ) void SvFileObject::Edit( Window* pParent, sfx2::SvBaseLink* pLink, const Link& rEndEditHdl ) { aEndEditLink = rEndEditHdl; - String sFile, sRange, sTmpFilter; + OUString sFile, sRange, sTmpFilter; if( pLink && pLink->GetLinkManager() ) { pLink->GetLinkManager()->GetDisplayNames( pLink, 0, &sFile, &sRange, &sTmpFilter ); @@ -439,15 +439,15 @@ void SvFileObject::Edit( Window* pParent, sfx2::SvBaseLink* pLink, const Link& r if( !aDlg.Execute() ) { sFile = aDlg.GetPath(); - sFile += ::sfx2::cTokenSeparator; - sFile += ::sfx2::cTokenSeparator; + sFile += OUString(::sfx2::cTokenSeparator); + sFile += OUString(::sfx2::cTokenSeparator); sFile += aDlg.GetCurrentFilter(); if ( aEndEditLink.IsSet() ) aEndEditLink.Call( &sFile ); } else - sFile.Erase(); + sFile = ""; } break; @@ -483,7 +483,7 @@ void SvFileObject::Edit( Window* pParent, sfx2::SvBaseLink* pLink, const Link& r break; default: - sFile.Erase(); + sFile = ""; } } } diff --git a/sfx2/source/appl/fileobj.hxx b/sfx2/source/appl/fileobj.hxx index ac81e463b0cc..f0e2eba0b764 100644 --- a/sfx2/source/appl/fileobj.hxx +++ b/sfx2/source/appl/fileobj.hxx @@ -30,8 +30,8 @@ namespace sfx2 { class FileDialogHelper; } class SvFileObject : public sfx2::SvLinkSource { - String sFileNm; - String sFilter; + OUString sFileNm; + OUString sFilter; String sReferer; Link aEndEditLink; SfxMediumRef xMed; diff --git a/sfx2/source/appl/impldde.cxx b/sfx2/source/appl/impldde.cxx index 4d0774117937..b036cfcb5f0f 100644 --- a/sfx2/source/appl/impldde.cxx +++ b/sfx2/source/appl/impldde.cxx @@ -85,7 +85,7 @@ SvDDELinkEditDialog::SvDDELinkEditDialog( Window* pParent, SvBaseLink* pLink ) { FreeResource(); - String sServer, sTopic, sItem; + OUString sServer, sTopic, sItem; pLink->GetLinkManager()->GetDisplayNames( pLink, &sServer, &sTopic, &sItem ); aEdDdeApp.SetText( sServer ); @@ -96,12 +96,12 @@ SvDDELinkEditDialog::SvDDELinkEditDialog( Window* pParent, SvBaseLink* pLink ) aEdDdeTopic.SetModifyHdl( STATIC_LINK( this, SvDDELinkEditDialog, EditHdl_Impl)); aEdDdeItem.SetModifyHdl( STATIC_LINK( this, SvDDELinkEditDialog, EditHdl_Impl)); - aOKButton1.Enable( sServer.Len() && sTopic.Len() && sItem.Len() ); + aOKButton1.Enable( !sServer.isEmpty() && !sTopic.isEmpty() && !sItem.isEmpty() ); } String SvDDELinkEditDialog::GetCmd() const { - String sCmd( aEdDdeApp.GetText() ), sRet; + OUString sCmd( aEdDdeApp.GetText() ), sRet; ::sfx2::MakeLnkName( sRet, &sCmd, aEdDdeTopic.GetText(), aEdDdeItem.GetText() ); return sRet; } @@ -215,10 +215,10 @@ sal_Bool SvDDEObject::Connect( SvBaseLink * pSvLink ) if( !pSvLink->GetLinkManager() ) return sal_False; - String sServer, sTopic; + OUString sServer, sTopic; pSvLink->GetLinkManager()->GetDisplayNames( pSvLink, &sServer, &sTopic, &sItem ); - if( !sServer.Len() || !sTopic.Len() || !sItem.Len() ) + if( sServer.isEmpty() || sTopic.isEmpty() || sItem.isEmpty() ) return sal_False; pConnection = new DdeConnection( sServer, sTopic ); @@ -226,7 +226,7 @@ sal_Bool SvDDEObject::Connect( SvBaseLink * pSvLink ) { // Is it possible to address the system-Topic? // then the server is up, it just does not know the topic! - if( sTopic.EqualsIgnoreCaseAscii( "SYSTEM" ) ) + if( sTopic.equalsIgnoreAsciiCase( "SYSTEM" ) ) { sal_Bool bSysTopic; { diff --git a/sfx2/source/appl/impldde.hxx b/sfx2/source/appl/impldde.hxx index c2e436a13dff..1f80a70e33c3 100644 --- a/sfx2/source/appl/impldde.hxx +++ b/sfx2/source/appl/impldde.hxx @@ -33,7 +33,7 @@ namespace sfx2 class SvDDEObject : public SvLinkSource { - String sItem; + OUString sItem; DdeConnection* pConnection; DdeLink* pLink; diff --git a/sfx2/source/appl/linkmgr2.cxx b/sfx2/source/appl/linkmgr2.cxx index 7dcccadc2e85..16b85df5317b 100644 --- a/sfx2/source/appl/linkmgr2.cxx +++ b/sfx2/source/appl/linkmgr2.cxx @@ -179,7 +179,7 @@ sal_Bool LinkManager::Insert( SvBaseLink* pLink ) sal_Bool LinkManager::InsertLink( SvBaseLink * pLink, sal_uInt16 nObjType, sal_uInt16 nUpdateMode, - const String* pName ) + const OUString* pName ) { // This First pLink->SetObjType( nObjType ); @@ -191,14 +191,14 @@ sal_Bool LinkManager::InsertLink( SvBaseLink * pLink, sal_Bool LinkManager::InsertDDELink( SvBaseLink * pLink, - const String& rServer, - const String& rTopic, - const String& rItem ) + const OUString& rServer, + const OUString& rTopic, + const OUString& rItem ) { if( !( OBJECT_CLIENT_SO & pLink->GetObjType() ) ) return sal_False; - String sCmd; + OUString sCmd; ::sfx2::MakeLnkName( sCmd, &rServer, rTopic, rItem ); pLink->SetObjType( OBJECT_CLIENT_DDE ); @@ -222,10 +222,10 @@ sal_Bool LinkManager::InsertDDELink( SvBaseLink * pLink ) // Obtain the string for the dialog bool LinkManager::GetDisplayNames( const SvBaseLink * pLink, - String* pType, - String* pFile, - String* pLinkStr, - String* pFilter ) const + OUString* pType, + OUString* pFile, + OUString* pLinkStr, + OUString* pFilter ) const { bool bRet = false; const String sLNm( pLink->GetLinkSourceName() ); @@ -283,23 +283,6 @@ bool LinkManager::GetDisplayNames( const SvBaseLink * pLink, return bRet; } -bool LinkManager::GetDisplayNames( - const SvBaseLink* pLink, OUString* pType, OUString* pFile, - OUString* pLinkStr, OUString* pFilter) const -{ - String aType, aFile, aLinkStr, aFilter; - bool bRet = GetDisplayNames(pLink, &aType, &aFile, &aLinkStr, &aFilter); - if (pType) - *pType = aType; - if (pFile) - *pFile = aFile; - if (pLinkStr) - *pLinkStr = aLinkStr; - if (pFilter) - *pFilter = aFilter; - return bRet; -} - void LinkManager::UpdateAllLinks( bool bAskUpdate, bool /*bCallErrHdl*/, @@ -389,26 +372,26 @@ void LinkManager::RemoveServer( SvLinkSource* pObj ) } -void MakeLnkName( String& rName, const String* pType, const String& rFile, - const String& rLink, const String* pFilter ) +void MakeLnkName( OUString& rName, const OUString* pType, const OUString& rFile, + const OUString& rLink, const OUString* pFilter ) { if( pType ) { rName = comphelper::string::strip(*pType, ' '); - rName += cTokenSeparator; + rName += OUString(cTokenSeparator); } - else if( rName.Len() ) - rName.Erase(); + else if( !rName.isEmpty() ) + rName = ""; rName += rFile; rName = comphelper::string::strip(rName, ' '); - rName += cTokenSeparator; + rName += OUString(cTokenSeparator); rName = comphelper::string::strip(rName, ' '); rName += rLink; if( pFilter ) { - rName += cTokenSeparator; + rName += OUString(cTokenSeparator); rName += *pFilter; rName = comphelper::string::strip(rName, ' '); } @@ -426,11 +409,11 @@ void LinkManager::ReconnectDdeLink(SfxObjectShell& rServer) for (size_t i = 0; i < n; ++i) { ::sfx2::SvBaseLink* p = *rLinks[i]; - String aType, aFile, aLink, aFilter; + OUString aType, aFile, aLink, aFilter; if (!GetDisplayNames(p, &aType, &aFile, &aLink, &aFilter)) continue; - if (!aType.EqualsAscii("soffice")) + if (aType != "soffice") // DDE connections between OOo apps are always named 'soffice'. continue; @@ -443,7 +426,7 @@ void LinkManager::ReconnectDdeLink(SfxObjectShell& rServer) // This DDE link is not associated with this server shell... Skip it. continue; - if (!aLink.Len()) + if (aLink.isEmpty()) continue; LinkServerShell(aLink, rServer, *p); @@ -464,25 +447,6 @@ void LinkManager::LinkServerShell(const OUString& rPath, SfxObjectShell& rServer } } -bool LinkManager::InsertFileLink( sfx2::SvBaseLink& rLink, - sal_uInt16 nFileType, - const String& rFileNm, - const String* pFilterNm, - const String* pRange ) -{ - if( !( OBJECT_CLIENT_SO & rLink.GetObjType() )) - return false; - - String sCmd( rFileNm ); - sCmd += ::sfx2::cTokenSeparator; - if( pRange ) - sCmd += *pRange; - if( pFilterNm ) - ( sCmd += ::sfx2::cTokenSeparator ) += *pFilterNm; - - return InsertLink( &rLink, nFileType, sfx2::LINKUPDATE_ONCALL, &sCmd ); -} - bool LinkManager::InsertFileLink( sfx2::SvBaseLink& rLink, sal_uInt16 nFileType, const OUString& rFileNm, const OUString* pFilterNm, const OUString* pRange) @@ -503,7 +467,7 @@ bool LinkManager::InsertFileLink( aBuf.append(*pFilterNm); } - String aCmd = aBuf.makeStringAndClear(); + OUString aCmd = aBuf.makeStringAndClear(); return InsertLink(&rLink, nFileType, sfx2::LINKUPDATE_ONCALL, &aCmd); } @@ -540,7 +504,7 @@ sal_uIntPtr LinkManager::RegisterStatusInfoId() // ---------------------------------------------------------------------- -sal_Bool LinkManager::GetGraphicFromAny( const String& rMimeType, +sal_Bool LinkManager::GetGraphicFromAny( const OUString& rMimeType, const ::com::sun::star::uno::Any & rValue, Graphic& rGrf ) { @@ -598,9 +562,9 @@ sal_Bool SvxInternalLink::Connect( sfx2::SvBaseLink* pLink ) { SfxObjectShell* pFndShell = 0; sal_uInt16 nUpdateMode = com::sun::star::document::UpdateDocMode::NO_UPDATE; - String sTopic, sItem, sReferer; + OUString sTopic, sItem, sReferer; LinkManager* pLinkMgr = pLink->GetLinkManager(); - if (pLinkMgr && pLinkMgr->GetDisplayNames(pLink, 0, &sTopic, &sItem) && sTopic.Len()) + if (pLinkMgr && pLinkMgr->GetDisplayNames(pLink, 0, &sTopic, &sItem) && !sTopic.isEmpty()) { // first only loop over the DocumentShells the shells and find those // with the name: @@ -656,7 +620,7 @@ sal_Bool SvxInternalLink::Connect( sfx2::SvBaseLink* pLink ) } // empty topics are not allowed - which document is it - if( !sTopic.Len() ) + if( sTopic.isEmpty() ) return sal_False; if (pFndShell) diff --git a/sfx2/source/appl/lnkbase2.cxx b/sfx2/source/appl/lnkbase2.cxx index 3692a1654050..6bf55d5127ed 100644 --- a/sfx2/source/appl/lnkbase2.cxx +++ b/sfx2/source/appl/lnkbase2.cxx @@ -481,25 +481,25 @@ bool SvBaseLink::ExecuteEdit( const OUString& _rNewName ) SetLinkSourceName( _rNewName ); if( !Update() ) { - String sApp, sTopic, sItem, sError; + OUString sApp, sTopic, sItem, sError; pImpl->m_pLinkMgr->GetDisplayNames( this, &sApp, &sTopic, &sItem ); if( nObjType == OBJECT_CLIENT_DDE ) { sError = SFX2_RESSTR(STR_DDE_ERROR); - sal_uInt16 nFndPos = sError.Search( '%' ); - if( STRING_NOTFOUND != nFndPos ) + sal_Int32 nFndPos = sError.indexOf( '%' ); + if( -1 != nFndPos ) { - sError.Erase( nFndPos, 1 ).Insert( sApp, nFndPos ); - nFndPos = nFndPos + sApp.Len(); + sError = sError.replaceAt( nFndPos, 1, sApp ); + nFndPos = nFndPos + sApp.getLength(); } - if( STRING_NOTFOUND != ( nFndPos = sError.Search( '%', nFndPos ))) + if( -1 != ( nFndPos = sError.indexOf( '%', nFndPos ))) { - sError.Erase( nFndPos, 1 ).Insert( sTopic, nFndPos ); - nFndPos = nFndPos + sTopic.Len(); + sError = sError.replaceAt( nFndPos, 1, sTopic ); + nFndPos = nFndPos + sTopic.getLength(); } - if( STRING_NOTFOUND != ( nFndPos = sError.Search( '%', nFndPos ))) - sError.Erase( nFndPos, 1 ).Insert( sItem, nFndPos ); + if( -1 != ( nFndPos = sError.indexOf( '%', nFndPos ))) + sError = sError.replaceAt( nFndPos, 1, sItem ); } else return false; |