diff options
author | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2014-12-30 01:16:53 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2014-12-30 01:21:54 +0100 |
commit | b010e6724fa5cd519daafd3abf57f0a3257025bb (patch) | |
tree | e365faf912007e152a286282dcd8adceca53a8d7 /sc/source/filter/excel/excform8.cxx | |
parent | 87e0ae677a7d39e4890d470a3537113c9ab2fa95 (diff) |
relative refs wrap around in xls, fdo#84556
Change-Id: If84d468d4bd55ed55ccd517d0b078d283a1a9c38
Diffstat (limited to 'sc/source/filter/excel/excform8.cxx')
-rw-r--r-- | sc/source/filter/excel/excform8.cxx | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sc/source/filter/excel/excform8.cxx b/sc/source/filter/excel/excform8.cxx index 042d79bddc08..ff4bd6c72576 100644 --- a/sc/source/filter/excel/excform8.cxx +++ b/sc/source/filter/excel/excform8.cxx @@ -1464,7 +1464,16 @@ void ExcelToSc8::ExcRelToScRel8( sal_uInt16 nRow, sal_uInt16 nC, ScSingleRefData { // C O L if( bColRel ) - rSRD.SetRelCol(static_cast<SCCOL>(static_cast<sal_Int8>(nC))); + { + SCCOL nRelCol = static_cast<sal_Int8>(nC); + sal_Int16 nDiff = aEingPos.Col() + nRelCol; + if ( nDiff < 0) + { + // relative column references wrap around + nRelCol = static_cast<sal_Int16>(256 + (int)nRelCol); + } + rSRD.SetRelCol(static_cast<SCCOL>(nRelCol)); + } else rSRD.SetAbsCol(static_cast<SCCOL>(nCol)); |