summaryrefslogtreecommitdiff
path: root/vcl/win/source/app/salinst.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/win/source/app/salinst.cxx')
-rw-r--r--vcl/win/source/app/salinst.cxx24
1 files changed, 23 insertions, 1 deletions
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();