[Libreoffice-commits] core.git: 2 commits - desktop/source vcl/source

Michael Weghorn (via logerrit) logerrit at kemper.freedesktop.org
Mon Mar 30 12:17:55 UTC 2020


 desktop/source/lib/lokinteractionhandler.cxx |    4 ++++
 vcl/source/filter/ipdf/pdfread.cxx           |    1 -
 2 files changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 1d8529c67692b119924bc5760372daa64fa4cb4a
Author:     Michael Weghorn <m.weghorn at posteo.de>
AuthorDate: Mon Mar 30 11:19:55 2020 +0200
Commit:     Michael Weghorn <m.weghorn at posteo.de>
CommitDate: Mon Mar 30 14:17:36 2020 +0200

    lok: Avoid deadlock for password-protected doc with gtktiledviewer
    
    Since commit 629bc69708a280b79f07b58adcda8593e22cf422
    ("LOK: hold the solar mutex consistently for document method calls.",
    2016-10-19), the SolarMutex needs to be acquired in
    'lo_setDocumentPassword'.
    
    This caused a deadlock for gtktiledviewer when trying to open a
    password-protected file, since the callback handler runs in a
    different thread there.
    
    Temporarily release the SolarMutex in
    LOKInteractionHandler::handlePasswordRequest to prevent that
    and make opening password-protected files with gtktiledviewer
    work again.
    
    Change-Id: I3ec8067c2b22aff5867eb0d526d399a18947fd48
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91350
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.weghorn at posteo.de>

diff --git a/desktop/source/lib/lokinteractionhandler.cxx b/desktop/source/lib/lokinteractionhandler.cxx
index f749bd4397c2..3dfd602b261a 100644
--- a/desktop/source/lib/lokinteractionhandler.cxx
+++ b/desktop/source/lib/lokinteractionhandler.cxx
@@ -42,6 +42,7 @@
 #include <LibreOfficeKit/LibreOfficeKitEnums.h>
 #include <sfx2/lokhelper.hxx>
 #include <sfx2/viewsh.hxx>
+#include <vcl/svapp.hxx>
 
 using namespace com::sun::star;
 
@@ -275,6 +276,9 @@ bool LOKInteractionHandler::handlePasswordRequest(const uno::Sequence<uno::Refer
         m_pLOKit->hasOptionalFeature(bIsRequestPasswordToModify ? LOK_FEATURE_DOCUMENT_PASSWORD_TO_MODIFY
                                                                 : LOK_FEATURE_DOCUMENT_PASSWORD))
     {
+        // release SolarMutex, so the callback handler, which may run in another thread,
+        // can acquire it in 'lo_setDocumentPassword'
+        SolarMutexReleaser aReleaser;
         m_pLOKit->mpCallback(bIsRequestPasswordToModify ? LOK_CALLBACK_DOCUMENT_PASSWORD_TO_MODIFY
                                                         : LOK_CALLBACK_DOCUMENT_PASSWORD,
                 sUrl.getStr(),
commit c664523d7b4523e9bb73b1e81e4c3faba5b47ee0
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Mar 30 12:10:49 2020 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Mon Mar 30 14:17:22 2020 +0200

    stray fResolutionDPI left behind
    
    from...
    
    commit 489b18edd6dc87287f260ba87d95abcc95d87932
    Date:   Sun Mar 29 16:30:19 2020 +0200
    
        pdfium: fix setting the size of the document when opening PDF
    
    Change-Id: I86c6983f3d22e5169416436bffc0e347a888591a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91357
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/source/filter/ipdf/pdfread.cxx b/vcl/source/filter/ipdf/pdfread.cxx
index 8a90b0ab93ca..187bc459c2f9 100644
--- a/vcl/source/filter/ipdf/pdfread.cxx
+++ b/vcl/source/filter/ipdf/pdfread.cxx
@@ -305,7 +305,6 @@ size_t ImportPDFUnloaded(const OUString& rURL, std::vector<std::pair<Graphic, Si
 #else
     (void)rURL;
     (void)rGraphics;
-    (void)fResolutionDPI;
     return 0;
 #endif // HAVE_FEATURE_PDFIUM
 }


More information about the Libreoffice-commits mailing list