sfx2/source/view/lokhelper.cxx  |    2 --
 sw/source/filter/xml/xmlimp.cxx |   12 ++++++++++++
 2 files changed, 12 insertions(+), 2 deletions(-)

New commits:
commit 0cb78e2f6f76d5bb32487c6cf76a78bafedbbd45
Author:     Caolán McNamara <[email protected]>
AuthorDate: Mon Feb 12 21:51:44 2024 +0000
Commit:     Caolán McNamara <[email protected]>
CommitDate: Tue Feb 13 11:41:14 2024 +0100

    ofz#66592 avoid double-init document properties throw issue
    
    Change-Id: Ia63f11c52de8c951c9bd1b03150a2982ba63ccb1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163262
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx
index c5225a916fff..916d58b2d7c4 100644
--- a/sw/source/filter/xml/xmlimp.cxx
+++ b/sw/source/filter/xml/xmlimp.cxx
@@ -1841,7 +1841,19 @@ extern "C" SAL_DLLPUBLIC_EXPORT bool 
TestPDFExportFODT(SvStream &rStream)
     xImporter->setTargetDocument(xModel);
 
     uno::Reference<document::XFilter> xFODTFilter(xInterface, 
uno::UNO_QUERY_THROW);
+
+    SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(xModel.get());
+    SfxObjectShell* pObjSh = pTextDoc ? pTextDoc->GetDocShell() : nullptr;
+
+    //SetLoading hack because the document properties will be re-initted
+    //by the xml filter and during the init, while it's considered 
uninitialized,
+    //setting a property will inform the document it's modified, which attempts
+    //to update the properties, which throws cause the properties are 
uninitialized
+    if (pObjSh)
+        pObjSh->SetLoading(SfxLoadedFlags::NONE);
     bool ret = xFODTFilter->filter(aArgs);
+    if (pObjSh)
+        pObjSh->SetLoading(SfxLoadedFlags::ALL);
 
     if (ret)
     {
commit 3e94090120aa594f0a1d2a96adc3e602632ceb80
Author:     Tomaž Vajngerl <[email protected]>
AuthorDate: Thu Feb 8 18:55:44 2024 +0900
Commit:     Caolán McNamara <[email protected]>
CommitDate: Tue Feb 13 11:41:03 2024 +0100

    lok: remove unneeded mutex guard
    
    Change-Id: I9e9ef3fd4ad43c2523c286f534e14e839aada453
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163114
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Miklos Vajna <[email protected]>
    (cherry picked from commit 21c215a0345feb347c7adeea5aca766ede23f54a)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163283
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx
index 530490686c11..ff9f1a8175bf 100644
--- a/sfx2/source/view/lokhelper.cxx
+++ b/sfx2/source/view/lokhelper.cxx
@@ -1142,11 +1142,9 @@ void LOKEditViewHistory::Update(bool bRemove)
     if (!comphelper::LibreOfficeKit::isActive())
         return;
 
-    static std::mutex aMutex;
     SfxViewShell* pViewShell = SfxViewShell::Current();
     if (pViewShell)
     {
-        std::lock_guard<std::mutex> aLockGuard{aMutex};
         int nDocId = pViewShell->GetDocId().get();
         if (maEditViewHistory.find(nDocId) != maEditViewHistory.end())
             maEditViewHistory[nDocId].remove(pViewShell);

Reply via email to