[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - sc/source

Mike Kaganski (via logerrit) logerrit at kemper.freedesktop.org
Thu Aug 8 09:00:21 UTC 2019


 sc/source/filter/excel/xepivotxml.cxx |   10 ++++++++++
 1 file changed, 10 insertions(+)

New commits:
commit fd09ed3d7424a1cb579758769efe465d272ae77d
Author:     Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Wed Aug 7 16:03:34 2019 +0300
Commit:     Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Thu Aug 8 10:59:38 2019 +0200

    tdf#126748: temporary hack to avoid crash when several pivot tables ...
    
    ... reference a single cache, and have different sets of group fields.
    
    The problem is getting group field names from the tables referencing
    the cache; so when a table referencing not all group fields happens
    to be first in the reference list, the returned name is empty.
    
    The hack just stops writing group fields as soon as it finds an empty
    name; this naturally leaves bad cache data behind, but at least doen't
    crash. The retrieval of the names should be reimplemented using a
    different source, to not depend on tables referencing the cache.
    
    Regression after commit b082998401e37e6c7534906601bc481423a6ded0.
    
    Change-Id: Ib2e92f8acf93a801861c6ba5c68fab3bebe3672c
    Reviewed-on: https://gerrit.libreoffice.org/77110
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/77129
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>

diff --git a/sc/source/filter/excel/xepivotxml.cxx b/sc/source/filter/excel/xepivotxml.cxx
index 752d971cfd25..fe6281cb050f 100644
--- a/sc/source/filter/excel/xepivotxml.cxx
+++ b/sc/source/filter/excel/xepivotxml.cxx
@@ -535,6 +535,16 @@ void XclExpXmlPivotCaches::SavePivotCacheXml( XclExpXmlStream& rStrm, const Entr
     {
         bool bDummy = false;
         const OUString aName = pDPObject->GetDimName(i, bDummy);
+        // tdf#126748: DPObject might not reference all group fields, when there are several
+        // DPObjects referencing this cache. Trying to get a dimension data for a field not used
+        // in a given DPObject will give nullptr, and dereferencing it then will crash. To avoid
+        // the crash, until there's a correct method to find the names of group fields in cache,
+        // just skip the fields, creating bad cache data, which is of course a temporary hack.
+        // TODO: reimplement the whole block to get the names from another source, not from first
+        // cache reference.
+        if (aName.isEmpty())
+            break;
+
         ScDPSaveData* pSaveData = pDPObject->GetSaveData();
         assert(pSaveData);
         const ScDPSaveGroupDimension* pDim = pSaveData->GetDimensionData()->GetNamedGroupDim(aName);


More information about the Libreoffice-commits mailing list