diff options
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 d283616dbc28..a413037efbfa 100644 --- a/sc/source/filter/excel/excform8.cxx +++ b/sc/source/filter/excel/excform8.cxx @@ -1412,7 +1412,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)); |