summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2015-07-17 00:15:00 +0200
committerEike Rathke <erack@redhat.com>2015-07-17 00:26:43 +0200
commit6567538600b6da2abdd684e5ee242aca595c6344 (patch)
treee22e3457d9408b516a0e54b9cb86ce9ef14a937a /sc
parent6be4dfccdac9aa2d6488f9cee03622e56024f0b4 (diff)
inherit existing HasHeader when expanding/shrinking anonymous database range
tdf#88402 related Adding columns, invoking Data->Sort, Cancel now still does not lose a HasHeader set in a previous Sort dialog. Change-Id: I1388b8f6a1964fb584f1826751072ba648f53ab7
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/docshell/docsh5.cxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/sc/source/ui/docshell/docsh5.cxx b/sc/source/ui/docshell/docsh5.cxx
index 9e245b6723be..050ace4b1de5 100644
--- a/sc/source/ui/docshell/docsh5.cxx
+++ b/sc/source/ui/docshell/docsh5.cxx
@@ -236,6 +236,15 @@ ScDBData* ScDocShell::GetDBData( const ScRange& rMarked, ScGetDBMode eMode, ScGe
SCROW nOldY2;
SCTAB nOldTab;
pNoNameData->GetArea( nOldTab, nOldX1, nOldY1, nOldX2, nOldY2 );
+
+ // If previously bHasHeader was set and the new range starts on the
+ // same row and intersects the old column range, then don't reset
+ // bHasHeader but assume that the new range still has headers, just
+ // some are empty or numeric.
+ if (!bHasHeader && pNoNameData->HasHeader() && nTab == nOldTab && nStartRow == nOldY1 &&
+ nStartCol <= nOldY2 && nOldY1 <= nEndCol)
+ bHasHeader = true;
+
DBAreaDeleted( nOldTab, nOldX1, nOldY1, nOldX2, nOldY2 );
pNoNameData->SetSortParam( ScSortParam() ); // Parameter zuruecksetzen