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

New commits:
commit 60f7eee2cd7257ba5f99ec28911d3e9bb8b42168
Author: Tamas Bunth <tamas.bu...@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 <c...@libreoffice.org>
    Reviewed-by: Tamás Bunth <btom...@gmail.com>
    Reviewed-on: https://gerrit.libreoffice.org/41041
    Reviewed-by: Aron Budea <aron.bu...@collabora.com>
    Tested-by: Aron Budea <aron.bu...@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
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to