diff options
author | Tor Lillqvist <tml@collabora.com> | 2015-03-10 00:48:28 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2015-03-10 09:15:12 +0000 |
commit | 0307413a287b07c08206169e2645261373e19bb1 (patch) | |
tree | 16069895a7d25fa13b46b65e852069b5e88b697f /sc | |
parent | e40f78753e10be6ca867aac593b6f0be166f3b73 (diff) |
Also relative row references need to wrap around, like fdo#84556 for columns
Change-Id: I07400d6dead66ec437436b5ea8b49491f8048335
Reviewed-on: https://gerrit.libreoffice.org/14823
Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'sc')
-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 53354f32a190..88bd27e0046e 100644 --- a/sc/source/filter/excel/excform8.cxx +++ b/sc/source/filter/excel/excform8.cxx @@ -1426,7 +1426,16 @@ void ExcelToSc8::ExcRelToScRel8( sal_uInt16 nRow, sal_uInt16 nC, ScSingleRefData // R O W if( bRowRel ) - rSRD.SetRelRow(static_cast<sal_Int16>(nRow)); + { + SCROW nRelRow = static_cast<sal_Int16>(nRow); + sal_Int32 nDiff = aEingPos.Row() + nRelRow; + if (nDiff < 0) + { + // relative row references wrap around + nRelRow = 65536 + nRelRow; + } + rSRD.SetRelRow(nRelRow); + } else rSRD.SetAbsRow(std::min( static_cast<SCROW>(nRow), MAXROW)); } |