Kaydet (Commit) b07e8a7e authored tarafından Michael Stahl's avatar Michael Stahl

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/53100Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMichael Stahl <Michael.Stahl@cib.de>
üst 0f6e4ec6
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment