[Libreoffice-commits] core.git: sc/source

Eike Rathke erack at redhat.com
Thu Jul 16 15:27:34 PDT 2015


 sc/source/ui/docshell/docsh5.cxx |    9 +++++++++
 1 file changed, 9 insertions(+)

New commits:
commit 6567538600b6da2abdd684e5ee242aca595c6344
Author: Eike Rathke <erack at redhat.com>
Date:   Fri Jul 17 00:15:00 2015 +0200

    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

diff --git a/sc/source/ui/docshell/docsh5.cxx b/sc/source/ui/docshell/docsh5.cxx
index 9e245b6..050ace4 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


More information about the Libreoffice-commits mailing list