diff options
author | Kohei Yoshida <kohei.yoshida@suse.com> | 2012-01-20 15:32:08 -0500 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@suse.com> | 2012-01-20 16:36:53 -0500 |
commit | 6964157be89119fe58347f7281207205236b05a6 (patch) | |
tree | 858c46f717f0b28ebeaf5f025de9d13a1801fd56 /sfx2 | |
parent | d36dd33fd263c5e34d6e8a78428f0b3a505bad36 (diff) |
Provide a version that takes rtl::OUString.
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/inc/sfx2/linkmgr.hxx | 8 | ||||
-rw-r--r-- | sfx2/source/appl/linkmgr2.cxx | 28 |
2 files changed, 32 insertions, 4 deletions
diff --git a/sfx2/inc/sfx2/linkmgr.hxx b/sfx2/inc/sfx2/linkmgr.hxx index 5aeaa7f08f97..0258f95652d4 100644 --- a/sfx2/inc/sfx2/linkmgr.hxx +++ b/sfx2/inc/sfx2/linkmgr.hxx @@ -114,12 +114,16 @@ public: sal_Bool InsertDDELink( SvBaseLink* ); // Connect the links to a pseudo-object and add to the list - sal_Bool InsertFileLink( sfx2::SvBaseLink&, + bool InsertFileLink( sfx2::SvBaseLink&, sal_uInt16 nFileType, - const String& rTxt, + const String& rFileNm, const String* pFilterNm = 0, const String* pRange = 0 ); + bool InsertFileLink( + sfx2::SvBaseLink& rLink, sal_uInt16 nFileType, const rtl::OUString& rFileNm, + const rtl::OUString* pFilterNm = NULL, const rtl::OUString* pRange = NULL); + void ReconnectDdeLink(SfxObjectShell& rServer); /** diff --git a/sfx2/source/appl/linkmgr2.cxx b/sfx2/source/appl/linkmgr2.cxx index 4984e6e21c87..0e8607d61e45 100644 --- a/sfx2/source/appl/linkmgr2.cxx +++ b/sfx2/source/appl/linkmgr2.cxx @@ -467,14 +467,14 @@ void LinkManager::LinkServerShell(const OUString& rPath, SfxObjectShell& rServer } } -sal_Bool LinkManager::InsertFileLink( sfx2::SvBaseLink& rLink, +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 sal_False; + return false; String sCmd( rFileNm ); sCmd += ::sfx2::cTokenSeperator; @@ -486,6 +486,30 @@ sal_Bool LinkManager::InsertFileLink( sfx2::SvBaseLink& rLink, return InsertLink( &rLink, nFileType, sfx2::LINKUPDATE_ONCALL, &sCmd ); } +bool LinkManager::InsertFileLink( + sfx2::SvBaseLink& rLink, sal_uInt16 nFileType, const rtl::OUString& rFileNm, + const rtl::OUString* pFilterNm, const rtl::OUString* pRange) +{ + if (!(OBJECT_CLIENT_SO & rLink.GetObjType())) + return false; + + rtl::OUStringBuffer aBuf; + aBuf.append(rFileNm); + aBuf.append(sfx2::cTokenSeperator); + + if (pRange) + aBuf.append(*pRange); + + if (pFilterNm) + { + aBuf.append(sfx2::cTokenSeperator); + aBuf.append(*pFilterNm); + } + + String aCmd = aBuf.makeStringAndClear(); + return InsertLink(&rLink, nFileType, sfx2::LINKUPDATE_ONCALL, &aCmd); +} + // A transfer is aborted, so cancel all download media // (for now this is only of interest for the file links!) void LinkManager::CancelTransfers() |