cui/source/options/certpath.cxx |   18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

New commits:
commit e3b95b4a2efc3641236f3cfb3a1f5aaf5843045e
Author:     Ilhan Yesil <ilhanye...@gmx.de>
AuthorDate: Wed May 29 12:02:47 2019 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Thu Jul 4 16:54:39 2019 +0200

    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.behr...@cib.de>
    (cherry picked from commit 6be961a7b6b5594b65f651522ef19f38bb9579aa)
    Reviewed-on: https://gerrit.libreoffice.org/75087
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>
    Tested-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/cui/source/options/certpath.cxx b/cui/source/options/certpath.cxx
index 59d0d8834b0c..57f34df44a15 100644
--- a/cui/source/options/certpath.cxx
+++ b/cui/source/options/certpath.cxx
@@ -94,7 +94,23 @@ CertPathDialog::CertPathDialog(vcl::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 &e)
     {
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to