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/source | |
parent | d36dd33fd263c5e34d6e8a78428f0b3a505bad36 (diff) |
Provide a version that takes rtl::OUString.
Diffstat (limited to 'sfx2/source')
-rw-r--r-- | sfx2/source/appl/linkmgr2.cxx | 28 |
1 files changed, 26 insertions, 2 deletions
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() |