summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorIlhan Yesil <ilhanyesil@gmx.de>2019-05-29 12:02:47 +0200
committerKatarina Behrens <Katarina.Behrens@cib.de>2019-07-01 21:06:10 +0200
commit6be961a7b6b5594b65f651522ef19f38bb9579aa (patch)
tree57e27774ae93e704694ab62d67bb788fa4b06ff6 /cui
parent5cb34f1c38be72047be1c4ed8357c5e87134c6a2 (diff)
tdf#125552 Don't show deleted certificate folder in Certificate Path dialog
Added a check to ensure that certificate folder exists. Change-Id: I351a58bbc606ac48eb9bdc85aaf0dbf8533a3d10 Reviewed-on: https://gerrit.libreoffice.org/73149 Tested-by: Jenkins Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/options/certpath.cxx18
1 files changed, 17 insertions, 1 deletions
diff --git a/cui/source/options/certpath.cxx b/cui/source/options/certpath.cxx
index 9e3406d07016..9bd43b850e6f 100644
--- a/cui/source/options/certpath.cxx
+++ b/cui/source/options/certpath.cxx
@@ -90,7 +90,23 @@ CertPathDialog::CertPathDialog(weld::Window* pParent)
officecfg::Office::Common::Security::Scripting::CertDir::get().get_value_or(OUString());
if (!sUserSetCertPath.isEmpty())
- AddCertPath(m_sManual, sUserSetCertPath);
+ {
+ // check existence
+ ::osl::DirectoryItem aUserPathItem;
+ OUString sUserSetCertURLPath;
+ osl::FileBase::getFileURLFromSystemPath(sUserSetCertPath, sUserSetCertURLPath);
+ ::osl::FileBase::RC result = ::osl::DirectoryItem::get( sUserSetCertURLPath, aUserPathItem );
+ if ( result == ::osl::FileBase::E_None )
+ {
+ ::osl::FileStatus aStatus( osl_FileStatus_Mask_Validate );
+ result = aUserPathItem.getFileStatus( aStatus );
+ if ( result == ::osl::FileBase::E_None )
+ {
+ // the cert path exists
+ AddCertPath(m_sManual, sUserSetCertPath);
+ }
+ }
+ }
}
catch (const uno::Exception &)
{