sc/inc/column.hxx | 2 +- sc/inc/table.hxx | 2 +- sc/source/core/data/column.cxx | 4 ++-- sc/source/core/data/document.cxx | 2 +- sc/source/core/data/table2.cxx | 2 +- sc/source/core/data/table3.cxx | 4 ++-- sc/source/core/data/table4.cxx | 2 +- sc/source/core/data/table6.cxx | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-)
New commits: commit bc1096fed97baae496d2b16868a9d7e36017bc59 Author: Stephan Bergmann <sberg...@redhat.com> Date: Tue Oct 4 15:48:29 2016 +0200 Avoid UBSan "reference binding to null pointer" ...at least during JunitTest_sc_unoapi_2 at > ScTable::DoSubTotals(ScSubTotalParam&) sc/source/core/data/table3.cxx:2097:25 > ScDocument::DoSubTotals(short, ScSubTotalParam&) sc/source/core/data/documen3.cxx:761:104 > ScDBDocFunc::DoSubTotals(short, ScSubTotalParam const&, bool, bool) sc/source/ui/docshell/dbdocfun.cxx:1076:29 > ScCellRangeObj::applySubTotals(com::sun::star::uno::Reference<com::sun::star::sheet::XSubTotalDescriptor> const&, unsigned char) sc/source/ui/unoobj/cellsuno.cxx:5868:15 > gcc3::callVirtualMethod(void*, unsigned int, void*, _typelib_TypeDescriptionReference*, bool, unsigned long*, unsigned int, unsigned long*, double*) bridges/source/cpp_uno/gcc3_linux_x86-64/callvirtualmethod.cxx:77:5 > cpp_call(bridges::cpp_uno::shared::UnoInterfaceProxy*, bridges::cpp_uno::shared::VtableSlot, _typelib_TypeDescriptionReference*, int, _typelib_MethodParameter*, void*, void**, _uno_Any**) bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx:241:13 > bridges::cpp_uno::shared::unoInterfaceProxyDispatch(_uno_Interface*, _typelib_TypeDescription const*, void*, void**, _uno_Any**) bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx:431:13 > binaryurp::IncomingRequest::execute_throw(binaryurp::BinaryAny*, std::__debug::vector<binaryurp::BinaryAny, std::allocator<binaryurp::BinaryAny> >*) const binaryurp/source/incomingrequest.cxx:240:13 > binaryurp::IncomingRequest::execute() const binaryurp/source/incomingrequest.cxx:77:26 > request binaryurp/source/reader.cxx:85:9 > cppu_threadpool::JobQueue::enter(long, bool) cppu/source/threadpool/jobqueue.cxx:107:17 > cppu_threadpool::ORequestThread::run() cppu/source/threadpool/thread.cxx:165:31 > threadFunc include/osl/thread.hxx:185:15 > osl_thread_start_Impl(void*) sal/osl/unx/thread.cxx:240:9 > start_thread (/lib64/libpthread.so.0+0x75c9) > __clone (/lib64/libc.so.6+0x102f6c) pStyle can apparently be null, will get passed through to ScColumn::ApplyStyle (sc/source/core/data/column.cxx), where it is only used in pNewPattern->SetStyleSheet(const_cast<ScStyleSheet*>(&rStyle)); and which is apparently fine with a null argument. Change-Id: I13fbb092aab06960d820c605476b2cee58889be4 diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx index 621a65b..5ae6bb4 100644 --- a/sc/inc/column.hxx +++ b/sc/inc/column.hxx @@ -464,7 +464,7 @@ public: void ApplyPatternIfNumberformatIncompatible( const ScRange& rRange, const ScPatternAttr& rPattern, short nNewType ); - void ApplyStyle( SCROW nRow, const ScStyleSheet& rStyle ); + void ApplyStyle( SCROW nRow, const ScStyleSheet* rStyle ); void ApplyStyleArea( SCROW nStartRow, SCROW nEndRow, const ScStyleSheet& rStyle ); void ApplySelectionStyle(const ScStyleSheet& rStyle, const ScMarkData& rMark); void ApplySelectionLineStyle( const ScMarkData& rMark, diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx index e4e1432..e163233 100644 --- a/sc/inc/table.hxx +++ b/sc/inc/table.hxx @@ -633,7 +633,7 @@ public: void AddCondFormatData( const ScRangeList& rRange, sal_uInt32 nIndex ); void RemoveCondFormatData( const ScRangeList& rRange, sal_uInt32 nIndex ); - void ApplyStyle( SCCOL nCol, SCROW nRow, const ScStyleSheet& rStyle ); + void ApplyStyle( SCCOL nCol, SCROW nRow, const ScStyleSheet* rStyle ); void ApplyStyleArea( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, const ScStyleSheet& rStyle ); void ApplySelectionStyle(const ScStyleSheet& rStyle, const ScMarkData& rMark); void ApplySelectionLineStyle( const ScMarkData& rMark, diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx index ea92124..5abcb6e 100644 --- a/sc/source/core/data/column.cxx +++ b/sc/source/core/data/column.cxx @@ -548,13 +548,13 @@ void ScColumn::RemoveCondFormat( SCROW nStartRow, SCROW nEndRow, sal_uInt32 nInd pAttrArray->RemoveCondFormat( nStartRow, nEndRow, nIndex ); } -void ScColumn::ApplyStyle( SCROW nRow, const ScStyleSheet& rStyle ) +void ScColumn::ApplyStyle( SCROW nRow, const ScStyleSheet* rStyle ) { const ScPatternAttr* pPattern = pAttrArray->GetPattern(nRow); std::unique_ptr<ScPatternAttr> pNewPattern(new ScPatternAttr(*pPattern)); if (pNewPattern) { - pNewPattern->SetStyleSheet(const_cast<ScStyleSheet*>(&rStyle)); + pNewPattern->SetStyleSheet(const_cast<ScStyleSheet*>(rStyle)); pAttrArray->SetPattern(nRow, pNewPattern.get(), true); } } diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index b5083ab..692667e 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -4750,7 +4750,7 @@ void ScDocument::ApplyStyle( SCCOL nCol, SCROW nRow, SCTAB nTab, const ScStyleSh { if (ValidTab(nTab) && nTab < static_cast<SCTAB>(maTabs.size())) if (maTabs[nTab]) - maTabs[nTab]->ApplyStyle( nCol, nRow, rStyle ); + maTabs[nTab]->ApplyStyle( nCol, nRow, &rStyle ); } void ScDocument::ApplyStyleArea( SCCOL nStartCol, SCROW nStartRow, diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx index 33227ca..df61646 100644 --- a/sc/source/core/data/table2.cxx +++ b/sc/source/core/data/table2.cxx @@ -2485,7 +2485,7 @@ void ScTable::RemoveCondFormatData( const ScRangeList& rRange, sal_uInt32 nIndex } } -void ScTable::ApplyStyle( SCCOL nCol, SCROW nRow, const ScStyleSheet& rStyle ) +void ScTable::ApplyStyle( SCCOL nCol, SCROW nRow, const ScStyleSheet* rStyle ) { if (ValidColRow(nCol,nRow)) aCol[nCol].ApplyStyle( nRow, rStyle ); diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx index 8cec68e..1784b1c 100644 --- a/sc/source/core/data/table3.cxx +++ b/sc/source/core/data/table3.cxx @@ -2094,7 +2094,7 @@ bool ScTable::DoSubTotals( ScSubTotalParam& rParam ) aOutString += ScGlobal::GetRscString( nStrId ); } SetString( nGroupCol[aRowEntry.nGroupNo], aRowEntry.nDestRow, nTab, aOutString ); - ApplyStyle( nGroupCol[aRowEntry.nGroupNo], aRowEntry.nDestRow, *pStyle ); + ApplyStyle( nGroupCol[aRowEntry.nGroupNo], aRowEntry.nDestRow, pStyle ); ++nRow; ++nEndRow; @@ -2148,7 +2148,7 @@ bool ScTable::DoSubTotals( ScSubTotalParam& rParam ) SetFormulaCell(nResCols[nResult], iEntry->nDestRow, pCell); if ( nResCols[nResult] != nGroupCol[iEntry->nGroupNo] ) { - ApplyStyle( nResCols[nResult], iEntry->nDestRow, *pStyle ); + ApplyStyle( nResCols[nResult], iEntry->nDestRow, pStyle ); lcl_RemoveNumberFormat( this, nResCols[nResult], iEntry->nDestRow ); } diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx index 5ed7af8..a5dd3e4 100644 --- a/sc/source/core/data/table4.cxx +++ b/sc/source/core/data/table4.cxx @@ -673,7 +673,7 @@ void ScTable::FillAuto( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, // Transfer template too //TODO: Merge ApplyPattern to AttrArray ?? if ( pStyleSheet ) - aCol[nCol].ApplyStyle( static_cast<SCROW>(nRow), *pStyleSheet ); + aCol[nCol].ApplyStyle( static_cast<SCROW>(nRow), pStyleSheet ); // Use ApplyPattern instead of SetPattern to keep old MergeFlags if ( pNewPattern ) diff --git a/sc/source/core/data/table6.cxx b/sc/source/core/data/table6.cxx index 5f03fe9..d983a55 100644 --- a/sc/source/core/data/table6.cxx +++ b/sc/source/core/data/table6.cxx @@ -687,7 +687,7 @@ bool ScTable::ReplaceStyle(const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& rSearchItem.GetReplaceString(), SfxStyleFamily::Para )); if (pReplaceStyle) - ApplyStyle( rCol, rRow, *pReplaceStyle ); + ApplyStyle( rCol, rRow, pReplaceStyle ); else { OSL_FAIL("pReplaceStyle==0"); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits