tdf#127909 follow the NSSInitializer selection
NSSInitializer contains the copy of the algorithm used in the
certificate path selection dialog, but with commit aceab9cbf104
("tdf#127909 don't always select the first entry") these were
desynced, as the first default profile should be selected
not the last one.
Change-Id: I07816c74eb1184df17e4d251f27ff0bee715e82d
Reviewed-on: https://gerrit.libreoffice.org/81367
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
diff --git a/cui/source/options/certpath.cxx b/cui/source/options/certpath.cxx
index 6f52fcb..c5b496c 100644
--- a/cui/source/options/certpath.cxx
+++ b/cui/source/options/certpath.cxx
@@ -58,6 +58,7 @@ CertPathDialog::CertPathDialog(weld::Window* pParent)
"thunderbird",
"firefox",
"mozilla" };
bool bSelected = false;
uno::Reference<mozilla::XMozillaBootstrap> xMozillaBootstrap = mozilla::MozillaBootstrap::create( comphelper::getProcessComponentContext() );
@@ -78,7 +79,10 @@ CertPathDialog::CertPathDialog(weld::Window* pParent)
{
OUString sEntry = OUString::createFromAscii(productNames[i]) + ":" + sProfileName;
OUString sProfilePath = xMozillaBootstrap->getProfilePath(productTypes[i], sProfileName);
AddCertPath(sEntry, sProfilePath, sProfileName == sDefaultProfile);
const bool bSelectDefaultProfile = !bSelected && sProfileName == sDefaultProfile;
AddCertPath(sEntry, sProfilePath, bSelectDefaultProfile);
if (bSelectDefaultProfile)
bSelected = true;
}
}
}