diff options
author | Mathias Bauer <mba@openoffice.org> | 2009-10-26 17:41:29 +0100 |
---|---|---|
committer | Mathias Bauer <mba@openoffice.org> | 2009-10-26 17:41:29 +0100 |
commit | 37cd2a528c5346a56e5d65e2991443e78f56489a (patch) | |
tree | 7d1338fa631c51f5fb71486f7e35c51c6786ce88 /vcl/win | |
parent | acae9170ea69e3b54b31ebf0322b53e4818172a3 (diff) | |
parent | cf144cb77169bfc84604434f4b7923fe5dac3d1e (diff) |
merge commit for m62
Diffstat (limited to 'vcl/win')
-rw-r--r-- | vcl/win/inc/salinst.h | 1 | ||||
-rw-r--r-- | vcl/win/source/app/salinst.cxx | 24 |
2 files changed, 24 insertions, 1 deletions
diff --git a/vcl/win/inc/salinst.h b/vcl/win/inc/salinst.h index 26afe892b9a3..33a1a941ed49 100644 --- a/vcl/win/inc/salinst.h +++ b/vcl/win/inc/salinst.h @@ -88,6 +88,7 @@ public: virtual void DestroyMenuItem( SalMenuItem* ); virtual SalSession* CreateSalSession(); virtual void* GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes ); + virtual void AddToRecentDocumentList(const rtl::OUString& rFileUrl, const rtl::OUString& rMimeType); static int WorkaroundExceptionHandlingInUSER32Lib(int nExcept, LPEXCEPTION_POINTERS pExceptionInfo); }; diff --git a/vcl/win/source/app/salinst.cxx b/vcl/win/source/app/salinst.cxx index 4c8a1fc86714..68177795c8db 100644 --- a/vcl/win/source/app/salinst.cxx +++ b/vcl/win/source/app/salinst.cxx @@ -39,7 +39,7 @@ #ifdef __MINGW32__ #include <excpt.h> #endif - +#include <osl/file.hxx> #include <vos/mutex.hxx> #include <tools/debug.hxx> #include <wincomp.hxx> @@ -66,11 +66,13 @@ #if defined _MSC_VER #pragma warning(push, 1) +#pragma warning( disable: 4917 ) #endif #include <GdiPlus.h> #include <GdiPlusEnums.h> #include <GdiPlusColor.h> +#include <Shlobj.h> #if defined _MSC_VER #pragma warning(pop) @@ -1092,6 +1094,26 @@ void* WinSalInstance::GetConnectionIdentifier( ConnectionIdentifierType& rReturn // ----------------------------------------------------------------------- +/** Add a file to the system shells recent document list if there is any. + This function may have no effect under Unix because there is no + standard API among the different desktop managers. + + @param aFileUrl + The file url of the document. +*/ +void WinSalInstance::AddToRecentDocumentList(const rtl::OUString& rFileUrl, const rtl::OUString& /*rMimeType*/) +{ + rtl::OUString system_path; + osl::FileBase::RC rc = osl::FileBase::getSystemPathFromFileURL(rFileUrl, system_path); + + OSL_ENSURE(osl::FileBase::E_None == rc, "Invalid file url"); + + if (osl::FileBase::E_None == rc) + SHAddToRecentDocs(SHARD_PATHW, system_path.getStr()); +} + +// ----------------------------------------------------------------------- + SalTimer* WinSalInstance::CreateSalTimer() { return new WinSalTimer(); |