dbaccess/source/core/dataaccess/databasedocument.hxx |    4 +++-
 sw/qa/extras/odfexport/data/tdf159027.odt            |binary
 sw/qa/extras/odfexport/odfexport2.cxx                |   15 +++++++++++++++
 3 files changed, 18 insertions(+), 1 deletion(-)

New commits:
commit d50f3fa9f5811204fbf2350e4745a26154fce6d5
Author:     Noel Grandin <[email protected]>
AuthorDate: Wed Sep 4 18:53:40 2024 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Thu Sep 5 11:29:59 2024 +0200

    tsan: data race
    
    Read of size 1 at 0x7250000be3fd by thread T19:
     0 dbaccess::ODatabaseDocument::queryInterface(com::sun::star::uno::Type 
const&)
     1 non-virtual thunk to 
dbaccess::ODatabaseDocument::queryInterface(com::sun::star::uno::Type const&)
     2 
com::sun::star::uno::BaseReference::iquery(com::sun::star::uno::XInterface*, 
com::sun::star::uno::Type const&)
     3 
com::sun::star::uno::Reference<com::sun::star::frame::XFrame>::iquery(com::sun::star::uno::XInterface*)
    
    Previous write of size 1 at 0x7250000be3fd by thread T8 (mutexes: write M0):
     0 dbaccess::ODatabaseDocument::storeAsURL(rtl::OUString const&, 
com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&)
     1 non-virtual thunk to 
dbaccess::ODatabaseDocument::storeAsURL(rtl::OUString const&, 
com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&)
     2 gcc3::callVirtualMethod(void*, unsigned int, void*, 
_typelib_TypeDescriptionReference*, bool, unsigned long*, unsigned int, 
unsigned long*, double*)
    
    Change-Id: I40ce0b5995f94455b5d9ca1d652a58df96b5f553
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172873
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <[email protected]>

diff --git a/dbaccess/source/core/dataaccess/databasedocument.hxx 
b/dbaccess/source/core/dataaccess/databasedocument.hxx
index 545ae9f92164..2700e358a506 100644
--- a/dbaccess/source/core/dataaccess/databasedocument.hxx
+++ b/dbaccess/source/core/dataaccess/databasedocument.hxx
@@ -20,6 +20,7 @@
 
 #include <sal/config.h>
 
+#include <atomic>
 #include <map>
 #include <memory>
 
@@ -192,7 +193,8 @@ class ODatabaseDocument :public ModelDependentComponent     
        // ModelDepe
     */
     InitState                                                                  
                 m_eInitState;
     bool                                                                       
                 m_bClosing;
-    bool                                                                       
                 m_bAllowDocumentScripting;
+    /// Using atomic because locking around accessing this will lead to 
deadlock in queryInterface
+    std::atomic<bool>                                                          
                 m_bAllowDocumentScripting;
     bool                                                                       
                 m_bHasBeenRecovered;
     /// If XModel::attachResource() was called to inform us that the document 
is embedded into another one.
     bool                                                                       
                 m_bEmbedded;
commit 497d328042b18853c5236e95a0f38a4ab733688c
Author:     Oliver Specht <[email protected]>
AuthorDate: Wed Aug 7 14:41:38 2024 +0200
Commit:     Thorsten Behrens <[email protected]>
CommitDate: Thu Sep 5 11:29:56 2024 +0200

    tdf#159027 test added
    
    Test added as follow-up to f60126a6bfae5dad4a11afcc94ddf4a58c5ce8ab
    checking table calculation on page break
    
    Change-Id: Icb4e8b8509db18d82647c66a6abdb87648ad4cb2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171592
    Tested-by: Jenkins
    Reviewed-by: Thorsten Behrens <[email protected]>

diff --git a/sw/qa/extras/odfexport/data/tdf159027.odt 
b/sw/qa/extras/odfexport/data/tdf159027.odt
new file mode 100644
index 000000000000..38d9b4501d8e
Binary files /dev/null and b/sw/qa/extras/odfexport/data/tdf159027.odt differ
diff --git a/sw/qa/extras/odfexport/odfexport2.cxx 
b/sw/qa/extras/odfexport/odfexport2.cxx
index f9205f752054..f964c3777600 100644
--- a/sw/qa/extras/odfexport/odfexport2.cxx
+++ b/sw/qa/extras/odfexport/odfexport2.cxx
@@ -40,6 +40,7 @@
 #include <unoprnms.hxx>
 #include <unotxdoc.hxx>
 #include <docsh.hxx>
+#include <IDocumentFieldsAccess.hxx>
 
 namespace
 {
@@ -1730,6 +1731,20 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf122452)
     CPPUNIT_ASSERT_EQUAL_MESSAGE("Redlines should be Hidden", true, 
pWrtShell->GetLayout()->IsHideRedlines());
 }
 
+CPPUNIT_TEST_FIXTURE(Test, testTdf159027)
+{
+    loadAndReload("tdf159027.odt");
+    SwDoc* pDoc = getSwDoc();
+    pDoc->getIDocumentFieldsAccess().UpdateFields(true);
+
+    uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, 
uno::UNO_QUERY);
+    uno::Reference<container::XIndexAccess> 
xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY);
+    uno::Reference<text::XTextTable> xTextTable(xTables->getByIndex(0), 
uno::UNO_QUERY);
+    uno::Reference<text::XTextRange> 
xCellD9(xTextTable->getCellByName(u"D9"_ustr), uno::UNO_QUERY);
+    CPPUNIT_ASSERT_EQUAL(u"70"_ustr, xCellD9->getString());
+    uno::Reference<text::XTextRange> 
xCellE9(xTextTable->getCellByName(u"E9"_ustr), uno::UNO_QUERY);
+    CPPUNIT_ASSERT_EQUAL(u"6"_ustr, xCellE9->getString());
+}
 } // end of anonymous namespace
 CPPUNIT_PLUGIN_IMPLEMENT();
 

Reply via email to