[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - sc/source

Tamas Bunth tamas.bunth at collabora.co.uk
Tue Aug 15 12:21:09 UTC 2017


 sc/source/ui/vba/vbarange.cxx |    8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

New commits:
commit 60f7eee2cd7257ba5f99ec28911d3e9bb8b42168
Author: Tamas Bunth <tamas.bunth at collabora.co.uk>
Date:   Fri Aug 11 01:57:55 2017 +0200

    tdf#107858 oovbaapi: Autofilter always has header
    
    If AutoFilter created with vba macro, it should always use a header
    (because Excel does the same), regardless of the type of cells in the
    first row.
    
    Change-Id: I586e092ac62c893b9873cc4b988566d8f00636cc
    Reviewed-on: https://gerrit.libreoffice.org/40969
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Tamás Bunth <btomi96 at gmail.com>
    Reviewed-on: https://gerrit.libreoffice.org/41041
    Reviewed-by: Aron Budea <aron.budea at collabora.com>
    Tested-by: Aron Budea <aron.budea at collabora.com>

diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx
index c5bade6e0dbb..98f8bc3d4696 100644
--- a/sc/source/ui/vba/vbarange.cxx
+++ b/sc/source/ui/vba/vbarange.cxx
@@ -4436,13 +4436,7 @@ ScVbaRange::AutoFilter( const uno::Any& aField, const uno::Any& Criteria1, const
         xDBRangeProps->setPropertyValue( "AutoFilter", uno::Any(true) );
         // set header (autofilter always need column headers)
         uno::Reference< beans::XPropertySet > xFiltProps( xDataBaseRange->getFilterDescriptor(), uno::UNO_QUERY_THROW );
-        bool bHasColHeader = false;
-        ScDocument* pDoc = pShell ? &pShell->GetDocument() : nullptr;
-        if (pDoc)
-        {
-            bHasColHeader = pDoc->HasColHeader(  static_cast< SCCOL >( autoFiltAddress.StartColumn ), static_cast< SCROW >( autoFiltAddress.StartRow ), static_cast< SCCOL >( autoFiltAddress.EndColumn ), static_cast< SCROW >( autoFiltAddress.EndRow ), static_cast< SCTAB >( autoFiltAddress.Sheet ) );
-        }
-        xFiltProps->setPropertyValue( "ContainsHeader", uno::Any( bHasColHeader ) );
+        xFiltProps->setPropertyValue( "ContainsHeader", uno::Any( true ) );
     }
 
     sal_Int32 nField = 0; // *IS* 1 based


More information about the Libreoffice-commits mailing list