[Libreoffice-commits] core.git: sc/source
Eike Rathke
erack at redhat.com
Fri Jul 31 10:19:33 PDT 2015
sc/source/core/tool/dbdata.cxx | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
New commits:
commit 1f44d9b74a5e2d8c249c6f65a29cb2583a9c5235
Author: Eike Rathke <erack at redhat.com>
Date: Fri Jul 31 19:16:19 2015 +0200
TableRef: add some SAL_WARN() when invalidating column names/offsets
Change-Id: I628a7ce66d8d3eed5bf70a0ac57acd8f4deef598
diff --git a/sc/source/core/tool/dbdata.cxx b/sc/source/core/tool/dbdata.cxx
index d24ea6d..d896b22 100644
--- a/sc/source/core/tool/dbdata.cxx
+++ b/sc/source/core/tool/dbdata.cxx
@@ -277,7 +277,13 @@ void ScDBData::GetArea(ScRange& rRange) const
void ScDBData::SetArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2)
{
if (nCol2 - nCol1 != nEndCol - nStartCol)
- ::std::vector<OUString>().swap( maTableColumnNames); // invalidate column names/offsets
+ {
+ if (!maTableColumnNames.empty())
+ {
+ SAL_WARN("sc.core", "ScDBData::SetArea - invalidating column names/offsets");
+ ::std::vector<OUString>().swap( maTableColumnNames);
+ }
+ }
nTable = nTab;
nStartCol = nCol1;
@@ -564,7 +570,13 @@ void ScDBData::ExtendDataArea(ScDocument* pDoc)
SCCOL nOldCol1 = nStartCol, nOldCol2 = nEndCol;
pDoc->GetDataArea(nTable, nStartCol, nStartRow, nEndCol, nEndRow, false, true);
if (nStartCol != nOldCol1 || nEndCol != nOldCol2)
- ::std::vector<OUString>().swap( maTableColumnNames); // invalidate column names/offsets
+ {
+ if (!maTableColumnNames.empty())
+ {
+ SAL_WARN("sc.core", "ScDBData::ExtendDataArea - invalidating column names/offsets");
+ ::std::vector<OUString>().swap( maTableColumnNames);
+ }
+ }
}
void ScDBData::AdjustTableColumnNames( UpdateRefMode eUpdateRefMode, SCCOL nDx, SCCOL nCol1,
@@ -604,6 +616,9 @@ void ScDBData::AdjustTableColumnNames( UpdateRefMode eUpdateRefMode, SCCOL nDx,
}
}
} // else empty aNewNames invalidates names/offsets
+
+ SAL_WARN_IF( !maTableColumnNames.empty() && aNewNames.empty(),
+ "sc.core", "ScDBData::AdjustTableColumnNames - invalidating column names/offsets");
aNewNames.swap( maTableColumnNames);
}
More information about the Libreoffice-commits
mailing list