[Libreoffice-commits] .: 2 commits - sc/inc sc/source
Kohei Yoshida
kohei at kemper.freedesktop.org
Wed Sep 14 13:05:53 PDT 2011
sc/inc/dpobject.hxx | 2 +-
sc/source/core/data/dpobject.cxx | 12 ++++++++----
sc/source/filter/excel/xepivot.cxx | 3 ---
sc/source/ui/view/dbfunc3.cxx | 5 +++--
4 files changed, 12 insertions(+), 10 deletions(-)
New commits:
commit fb1e454e7fa513f6b9d667a32da4aacf185f067a
Author: Kohei Yoshida <kohei.yoshida at suse.com>
Date: Wed Sep 14 15:36:20 2011 -0400
Don't always set refresh flag on export. This is a bad hack.
diff --git a/sc/source/filter/excel/xepivot.cxx b/sc/source/filter/excel/xepivot.cxx
index 3c405d8..93e353e 100644
--- a/sc/source/filter/excel/xepivot.cxx
+++ b/sc/source/filter/excel/xepivot.cxx
@@ -669,9 +669,6 @@ XclExpPivotCache::XclExpPivotCache( const XclExpRoot& rRoot, const ScDPObject& r
if( 2 * (nDocRow2 - nDocRow1) < (nSrcRow2 - nSrcRow1) )
::set_flag( maPCInfo.mnFlags, EXC_SXDB_SAVEDATA, false );
- // Excel must refresh tables to make drilldown working
- ::set_flag( maPCInfo.mnFlags, EXC_SXDB_REFRESH_LOAD );
-
// adjust row indexes, keep one row of empty area to surely have the empty cache item
if( nSrcRow1 < nDocRow1 )
nSrcRow1 = nDocRow1 - 1;
commit 2f654141fbb81f4dce7953bb1721bf94a5bc67bd
Author: Kohei Yoshida <kohei.yoshida at suse.com>
Date: Wed Sep 14 15:19:12 2011 -0400
Check the source range when refreshing, and abort refresh if invalid.
This avoids refreshing on an invalid source range which causes an
empty pivot table output.
diff --git a/sc/inc/dpobject.hxx b/sc/inc/dpobject.hxx
index dc0831e..f34b042 100644
--- a/sc/inc/dpobject.hxx
+++ b/sc/inc/dpobject.hxx
@@ -313,7 +313,7 @@ public:
ScDPCollection(const ScDPCollection& r);
~ScDPCollection();
- bool ClearCache(ScDPObject* pDPObj);
+ sal_uLong ClearCache(ScDPObject* pDPObj);
SC_DLLPUBLIC size_t GetCount() const;
SC_DLLPUBLIC ScDPObject* operator[](size_t nIndex);
diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx
index 500c5ac..126e220 100644
--- a/sc/source/core/data/dpobject.cxx
+++ b/sc/source/core/data/dpobject.cxx
@@ -2590,14 +2590,18 @@ public:
}
-bool ScDPCollection::ClearCache(ScDPObject* pDPObj)
+sal_uLong ScDPCollection::ClearCache(ScDPObject* pDPObj)
{
if (pDPObj->IsSheetData())
{
// data source is internal sheet.
const ScSheetSourceDesc* pDesc = pDPObj->GetSheetDesc();
if (!pDesc)
- return false;
+ return STR_ERR_DATAPILOTSOURCE;
+
+ sal_uLong nErrId = pDesc->CheckSourceRange();
+ if (nErrId)
+ return nErrId;
if (pDesc->HasRangeName())
{
@@ -2617,12 +2621,12 @@ bool ScDPCollection::ClearCache(ScDPObject* pDPObj)
// data source is external database.
const ScImportSourceDesc* pDesc = pDPObj->GetImportSourceDesc();
if (!pDesc)
- return false;
+ return STR_ERR_DATAPILOTSOURCE;
ScDPCollection::DBCaches& rCaches = GetDBCaches();
rCaches.removeCache(pDesc->GetCommandType(), pDesc->aDBName, pDesc->aObject);
}
- return true;
+ return 0;
}
void ScDPCollection::DeleteOnTab( SCTAB nTab )
diff --git a/sc/source/ui/view/dbfunc3.cxx b/sc/source/ui/view/dbfunc3.cxx
index 9bacc39..1d26fd0 100644
--- a/sc/source/ui/view/dbfunc3.cxx
+++ b/sc/source/ui/view/dbfunc3.cxx
@@ -707,9 +707,10 @@ void ScDBFunc::RecalcPivotTable()
{
// Remove existing data cache for the data that this datapilot uses,
// to force re-build data cache.
- if (!pDPs->ClearCache(pDPObj))
+ sal_uLong nErrId = pDPs->ClearCache(pDPObj);
+ if (nErrId)
{
- ErrorMessage(STR_PIVOT_NOTFOUND);
+ ErrorMessage(nErrId);
return;
}
More information about the Libreoffice-commits
mailing list