summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTamas Bunth <tamas.bunth@collabora.co.uk>2017-08-11 01:57:55 +0200
committerTamás Bunth <btomi96@gmail.com>2017-08-10 22:27:11 +0200
commit7e728965b3f5a37a6f0bd75d616d2acb16c40f71 (patch)
tree1196da66e8a7c044a6be5b0e2fcad1d98c43bee7
parent97b889b8b2b2554ce33fd6b3f0359fc18f39832d (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>
-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 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