summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2015-03-10 00:48:28 +0200
committerTor Lillqvist <tml@collabora.com>2015-03-10 09:27:58 +0200
commitbb0c05cebed131805d04919fac2b83030087451b (patch)
tree5ba10aaa12763a52f07cd8686894ac674f25075f
parenta099abe9ffd5e90b7cb4d488e25df4fce3099a48 (diff)
Also relative row references need to wrap around, like fdo#84556 for columns
Change-Id: I07400d6dead66ec437436b5ea8b49491f8048335
-rw-r--r--sc/source/filter/excel/excform8.cxx11
1 files changed, 10 insertions, 1 deletions
diff --git a/sc/source/filter/excel/excform8.cxx b/sc/source/filter/excel/excform8.cxx
index ff4bd6c72576..ebe3b6445e57 100644
--- a/sc/source/filter/excel/excform8.cxx
+++ b/sc/source/filter/excel/excform8.cxx
@@ -1479,7 +1479,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));
}