[Libreoffice-commits] core.git: Branch 'distro/lhm/libreoffice-5-2+backports' - 2 commits - officecfg/registry sc/qa sc/source sfx2/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sun Dec 2 22:34:29 UTC 2018


Rebased ref, commits from common ancestor:
commit 29db8961938b21ae557fb3714dbdc9344116ee60
Author:     Katarina Behrens <Katarina.Behrens at cib.de>
AuthorDate: Tue Nov 27 15:30:24 2018 +0100
Commit:     Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Sun Dec 2 23:33:42 2018 +0100

    Option to turn off WebDAV file locking
    
    Locking files on WebDAV shares was implemented in tdf#82744,
    in particular:
    
    commit 26e6d4b05ab444e6a7529ffcac7fbe592fc94833
        tdf#82744: fix WebDAV lock/unlock behaviour - part 1
    commit bc9a8ddbb7081f79e915c841e56fd1c40f0df6f9
        tdf#82744: fix WebDAV lock/unlock behaviour - part 2
    commit b4576f3da4d90139fc5140962d13cb91dab98797
        tdf#82744: fix WebDAV lock/unlock behaviour - part 3
    commit fed2984281a85a5a2f308841ec810f218c75f2ab
        tdf#82744: fix WebDAV lock/unlock behaviour - part 4
    
    Before that, files on WebDAV shares were accessed w/o locking since
    the beginning of [OOo] time. This option allows to revert to
    the old behaviour i.e. non-locking WebDAV access.
    
    For concurrent read-write WebDAV access by multiple users it is
    recommended to keep UseWebDAVFileLocking at default value (true)
    
    Reviewed-on: https://gerrit.libreoffice.org/64116
    Tested-by: Jenkins
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    (cherry picked from commit 297be63c8d1dd8f802b5216048d860c5b2661edc)
    Reviewed-on: https://gerrit.libreoffice.org/64371
    Tested-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    (cherry picked from commit 10dbbe46a4818b0fea4afbfe0fd66f75a2dd8eef)
    
    Conflicts:
            sfx2/source/doc/docfile.cxx
    
    Change-Id: Id92177631d4854d6c7bf412164acbd9740db9592
    Reviewed-on: https://gerrit.libreoffice.org/64372
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    Tested-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index 74cbc1525e1a..e7b2dffa06b6 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -5624,6 +5624,15 @@
         </info>
         <value>true</value>
       </prop>
+      <prop oor:name="UseWebDAVFileLocking" oor:type="xs:boolean" oor:nillable="false">
+        <info>
+          <desc>Determines if WebDAV-specific file locking is used for documents
+	  on WebDAV shares. It is not recommended to set this option to 'false' in
+	  scenarios where multi-user, concurrent read/write access to WebDAV share
+	  is required</desc>
+        </info>
+        <value>true</value>
+      </prop>
       <prop oor:name="UseDocumentOOoLockFile" oor:type="xs:boolean" oor:nillable="false">
         <info>
           <desc>Allows to specify whether the OOo document file locking
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 4c6cf3f60b4c..89ccdfcecbab 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -166,6 +166,11 @@ bool IsLockingUsed()
 
 #endif
 
+bool IsWebDAVLockingUsed()
+{
+    return officecfg::Office::Common::Misc::UseWebDAVFileLocking::get();
+}
+
 } // anonymous namespace
 
 class SfxMedium_Impl
@@ -1004,6 +1009,10 @@ void SfxMedium::LockOrigFileOnDemand( bool bLoading, bool bNoUI )
 
     if ( GetURLObject().isAnyKnownWebDAVScheme() )
     {
+        // do nothing if WebDAV locking is disabled
+        if (!IsWebDAVLockingUsed())
+            return;
+
         try
         {
             bool bResult = pImpl->m_bLocked;
@@ -2789,6 +2798,12 @@ void SfxMedium::UnlockFile( bool bReleaseLockStream )
     // check if webdav
     if ( GetURLObject().isAnyKnownWebDAVScheme() )
     {
+        // do nothing if WebDAV locking if disabled
+        // (shouldn't happen because we already skipped locking,
+        // see LockOrigFileOnDemand, but just in case ...)
+        if (!IsWebDAVLockingUsed())
+            return;
+
         if ( pImpl->m_bLocked )
         {
             // an interaction handler should be used for authentication, if needed
commit d69038484a089ece9d08033595fc79a869a2efcb
Author:     Vasily Melenchuk <vasily.melenchuk at cib.de>
AuthorDate: Thu Nov 22 11:30:29 2018 +0300
Commit:     Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Sun Dec 2 23:33:41 2018 +0100

    tdf#121612: update pivot caches during saving to XLSX
    
    Cache was empty so pivot table was not exported completely
    and pivot table filter were missing.
    
    Change-Id: Ib0b9e98a5588159c5c7de1e2e5d2bdcbfe986d8d
    Reviewed-on: https://gerrit.libreoffice.org/63785
    Tested-by: Jenkins
    Reviewed-by: Katarina Behrens <Katarina.Behrens at cib.de>
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    Reviewed-on: https://gerrit.libreoffice.org/64264
    Tested-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/sc/qa/unit/data/ods/tdf121612.ods b/sc/qa/unit/data/ods/tdf121612.ods
new file mode 100644
index 000000000000..6afc4e0c931c
Binary files /dev/null and b/sc/qa/unit/data/ods/tdf121612.ods differ
diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx
index 4e90034a5f99..c316553f44c4 100644
--- a/sc/qa/unit/subsequent_export-test.cxx
+++ b/sc/qa/unit/subsequent_export-test.cxx
@@ -176,6 +176,7 @@ public:
     void testHeaderImage();
 
     void testTdf88657();
+    void testTdf121612();
 
     CPPUNIT_TEST_SUITE(ScExportTest);
     CPPUNIT_TEST(test);
@@ -258,6 +259,7 @@ public:
     CPPUNIT_TEST(testHeaderImage);
 
     CPPUNIT_TEST(testTdf88657);
+    CPPUNIT_TEST(testTdf121612);
 
     CPPUNIT_TEST_SUITE_END();
 
@@ -3708,6 +3710,23 @@ void ScExportTest::testConditionalFormatRangeListXLSX()
     assertXPath(pDoc, "//x:conditionalFormatting", "sqref", "F4 F10");
 }
 
+void ScExportTest::testTdf121612()
+{
+    ScDocShellRef xDocSh = loadDoc("tdf121612.", FORMAT_ODS);
+    CPPUNIT_ASSERT(xDocSh.Is());
+    xDocSh = saveAndReload(xDocSh.get(), FORMAT_XLSX);
+
+    ScDocument& rDoc = xDocSh->GetDocument();
+
+    // There should be a pivot table
+    CPPUNIT_ASSERT(rDoc.HasPivotTable());
+
+    // DP collection is not lost after export and has one entry
+    ScDPCollection* pDPColl = rDoc.GetDPCollection();
+    CPPUNIT_ASSERT(pDPColl);
+    CPPUNIT_ASSERT_EQUAL(size_t(1), pDPColl->GetCount());
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(ScExportTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sc/source/filter/excel/xepivotxml.cxx b/sc/source/filter/excel/xepivotxml.cxx
index 1b340812cc3f..28114c67c103 100644
--- a/sc/source/filter/excel/xepivotxml.cxx
+++ b/sc/source/filter/excel/xepivotxml.cxx
@@ -296,15 +296,22 @@ XclExpXmlPivotTableManager::XclExpXmlPivotTableManager( const XclExpRoot& rRoot
 
 void XclExpXmlPivotTableManager::Initialize()
 {
-    const ScDocument& rDoc = GetDoc();
+    ScDocument& rDoc = GetDoc();
     if (!rDoc.HasPivotTable())
         // No pivot table to export.
         return;
 
-    const ScDPCollection* pDPColl = rDoc.GetDPCollection();
+    ScDPCollection* pDPColl = rDoc.GetDPCollection();
     if (!pDPColl)
         return;
 
+    // Update caches from DPObject
+    for (size_t i = 0; i < pDPColl->GetCount(); ++i)
+    {
+        ScDPObject& rDPObj = (*pDPColl)[i];
+        rDPObj.SyncAllDimensionMembers();
+    }
+
     // Go through the caches first.
 
     std::vector<XclExpXmlPivotCaches::Entry> aCaches;


More information about the Libreoffice-commits mailing list