[Libreoffice-commits] core.git: sc/source
Julien Nabet
serval2412 at yahoo.fr
Sat Feb 1 13:21:46 PST 2014
sc/source/ui/vba/vbarange.cxx | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
New commits:
commit 7a4e95b8c14d2cf64938d1cbe559576b4400e424
Author: Julien Nabet <serval2412 at yahoo.fr>
Date: Sat Feb 1 22:21:22 2014 +0100
Check if pDoc is null before using it
Change-Id: I8eede8774eebdf32c2749325777bcb5a9b1a720b
diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx
index 5a431f4..95123e3 100644
--- a/sc/source/ui/vba/vbarange.cxx
+++ b/sc/source/ui/vba/vbarange.cxx
@@ -4483,8 +4483,10 @@ ScVbaRange::AutoFilter( const uno::Any& aField, const uno::Any& Criteria1, const
uno::Reference< beans::XPropertySet > xFiltProps( xDataBaseRange->getFilterDescriptor(), uno::UNO_QUERY_THROW );
sal_Bool bHasColHeader = false;
ScDocument* pDoc = pShell ? pShell->GetDocument() : NULL;
-
- 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 ) ) ? sal_True : false;
+ 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 ) ) ? sal_True : false;
+ }
xFiltProps->setPropertyValue( "ContainsHeader", uno::Any( bHasColHeader ) );
}
More information about the Libreoffice-commits
mailing list