diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2018-04-18 13:01:37 +0200 |
---|---|---|
committer | Michael Stahl <Michael.Stahl@cib.de> | 2018-04-18 16:13:50 +0200 |
commit | b07e8a7e16ba69e822a309ec280d1987f90021a3 (patch) | |
tree | 7e43accb5c798648e68161d338caa8ba29c79f03 /vcl/win/app | |
parent | 0f6e4ec64d7f95f9b2123586db61e294cf99f207 (diff) |
vcl: WNT: *really* avoid calling SHAddToRecentDocs() from unit tests
At least in sw unit tests, AddToRecentDocumentList is apparently called
too early so the variable isn't set yet.
It's much better to check IsHeadlessMode anyway because that is set in
more situations, and if you run soffice --headless you probably don't
want the corresponding files to show up in Explorer's Recently list.
Change-Id: I8ada3659d05c94d072ba30859090e835a595e9ea
Reviewed-on: https://gerrit.libreoffice.org/53100
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
Diffstat (limited to 'vcl/win/app')
-rw-r--r-- | vcl/win/app/salinst.cxx | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/vcl/win/app/salinst.cxx b/vcl/win/app/salinst.cxx index 340e0ed01b77..a33b7e1bd683 100644 --- a/vcl/win/app/salinst.cxx +++ b/vcl/win/app/salinst.cxx @@ -921,8 +921,7 @@ OUString WinSalInstance::GetConnectionIdentifier() */ void WinSalInstance::AddToRecentDocumentList(const OUString& rFileUrl, const OUString& /*rMimeType*/, const OUString& rDocumentService) { - static bool const s_isTest(getenv("LO_TESTNAME") != nullptr); - if (s_isTest) + if (Application::IsHeadlessModeEnabled()) return; OUString system_path; |