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>
diff --git a/vcl/win/app/salinst.cxx b/vcl/win/app/salinst.cxx
index 340e0ed..a33b7e1 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;