summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2017-07-14 14:34:28 +0200
committerEike Rathke <erack@redhat.com>2017-07-14 14:35:04 +0200
commit62ee21cb463d80a28c4c41a488f85e07abafbc69 (patch)
tree91a7a189c195513abb278383c6adbbfbc83ebb96 /sc
parent5850debba42bc5ce65ec8363a5381a9d8d2cdaea (diff)
Fix export test crash of ooo95715-1.xls
Negative sheet number injected by sc::FormulaLogger::GroupScope::addRefMessage() wans't handled by lcl_Format() #9 0x00007f292172c322 in ScGroupTokenConverter::convert (this=0x7ffc5b1940d0, rCode=..., rScope=...) at /build/libo/dev/sc/source/core/data/grouptokenconverter.cxx:140 #8 0x00007f29224c54d8 in sc::FormulaLogger::GroupScope::addRefMessage (this=0x7ffc5b193ff0, rCellPos=..., rRefPos=..., nLen=111, rArray=...) at /build/libo/dev/sc/source/core/tool/formulalogger.cxx:147 #7 0x00007f292181c071 in ScRange::Format (this=0x7ffc5b193dc0, nFlags=-32760, pDoc=0x4b1db70, rDetails=..., bFullAddressNotation=false) at /build/libo/dev/sc/source/core/tool/address.cxx:2211 #6 0x00007f292181b9a9 in ScAddress::Format (this=0x7ffc5b193dc0, nFlags=-32760, pDoc=0x4b1db70, rDetails=...) at /build/libo/dev/sc/source/core/tool/address.cxx:2111 #5 0x00007f292181ecf5 in lcl_Format<rtl::OUStringBuffer> (r="", nTab=-1, nRow=75, nCol=0, nFlags=-30968, pDoc=0x4b1db70, rDetails=...) at /build/libo/dev/sc/source/core/tool/address.cxx:2018 #4 0x00007f29214471fb in rtl::OUString::operator[] (this=0x7ffc5b193c00, index=0) at /build/libo/dev/include/rtl/ustring.hxx:668 Change-Id: I68ecfb11574644e9e5670431789ee42d37d27523
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/tool/address.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx
index de79a3d8a4df..f9b721159484 100644
--- a/sc/source/core/tool/address.cxx
+++ b/sc/source/core/tool/address.cxx
@@ -2005,7 +2005,7 @@ template<typename T > inline void lcl_Format( T& r, SCTAB nTab, SCROW nRow, SCCO
nFlags |= ( ScRefFlags::ROW_VALID | ScRefFlags::COL_VALID | ScRefFlags::TAB_VALID );
if( pDoc && (nFlags & ScRefFlags::TAB_VALID ) )
{
- if ( nTab >= pDoc->GetTableCount() )
+ if ( nTab < 0 || nTab >= pDoc->GetTableCount() )
{
lcl_string_append(r, ScGlobal::GetRscString( STR_NOREF_STR ));
return;