sc/source/filter/excel/excform8.cxx |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

New commits:
commit 0307413a287b07c08206169e2645261373e19bb1
Author: Tor Lillqvist <t...@collabora.com>
Date:   Tue Mar 10 00:48:28 2015 +0200

    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.mohrh...@googlemail.com>
    Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com>

diff --git a/sc/source/filter/excel/excform8.cxx 
b/sc/source/filter/excel/excform8.cxx
index 53354f3..88bd27e 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));
     }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to