diff options
author | Tamas Bunth <tamas.bunth@collabora.co.uk> | 2017-08-11 01:57:55 +0200 |
---|---|---|
committer | Tamás Bunth <btomi96@gmail.com> | 2017-08-10 22:27:11 +0200 |
commit | 7e728965b3f5a37a6f0bd75d616d2acb16c40f71 (patch) | |
tree | 1196da66e8a7c044a6be5b0e2fcad1d98c43bee7 /sc/source | |
parent | 97b889b8b2b2554ce33fd6b3f0359fc18f39832d (diff) |
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@libreoffice.org>
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/ui/vba/vbarange.cxx | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx index 5aae79fd6889..29944d78dccb 100644 --- a/sc/source/ui/vba/vbarange.cxx +++ b/sc/source/ui/vba/vbarange.cxx @@ -4438,13 +4438,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 |