summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorTamas Bunth <tamas.bunth@collabora.co.uk>2017-08-11 01:57:55 +0200
committerAron Budea <aron.budea@collabora.com>2017-08-15 14:20:03 +0200
commit60f7eee2cd7257ba5f99ec28911d3e9bb8b42168 (patch)
treeadcb530886a63efa026e392a218d2d851540ad3d /sc
parent44ec0adc7ea196f5aede4964fe49248aded4ab28 (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> Reviewed-on: https://gerrit.libreoffice.org/41041 Reviewed-by: Aron Budea <aron.budea@collabora.com> Tested-by: Aron Budea <aron.budea@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/vba/vbarange.cxx8
1 files changed, 1 insertions, 7 deletions
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