[PATCH 1/2] fdo42286 better solution: extend and shrink end of row if needed

Pierre-André Jacquod pjacquod at alumni.ethz.ch
Thu Dec 15 10:29:17 PST 2011


---
 sc/source/core/tool/dbdata.cxx |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/sc/source/core/tool/dbdata.cxx b/sc/source/core/tool/dbdata.cxx
index 3d60554..3cc4146 100644
--- a/sc/source/core/tool/dbdata.cxx
+++ b/sc/source/core/tool/dbdata.cxx
@@ -544,10 +544,8 @@ void ScDBData::UpdateReference(ScDocument* pDoc, UpdateRefMode eUpdateRefMode,
 void ScDBData::ExtendDataArea(ScDocument* pDoc)
 {
     // Extend the DB area to include data rows immediately below.
-    SCCOL nCol1a = nStartCol, nCol2a = nEndCol;
-    SCROW nRow1a = nStartRow, nRow2a = nEndRow;
-    pDoc->GetDataArea(nTable, nCol1a, nRow1a, nCol2a, nRow2a, true, true);
-    nEndRow = nRow2a;
+    // or shrink it if all cells are empty
+    pDoc->GetDataArea(nTable, nStartCol, nStartRow, nEndCol, nEndRow, false, true);
 }
 
 namespace {
-- 
1.7.3.4


--------------050003010003000901070305--


More information about the LibreOffice mailing list