sc/source/core/tool/token.cxx |   19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

New commits:
commit 57ba6cf00b3258838ef6ec75ce7c1c7c38ade751
Author: Kohei Yoshida <kohei.yosh...@collabora.com>
Date:   Mon Mar 10 20:39:01 2014 -0400

    fdo#75815: Adjust external references here too.
    
    Adjusting external references are much simpler than adjusting internal
    ones since we don't need to worry about deleted references etc.
    
    Change-Id: I82111e383e1fc6976ef08c1438c3dd916a249af6
    (cherry picked from commit dd7787ed75e33b65ebee2a6c0aa152efded6f1b8)
    Reviewed-on: https://gerrit.libreoffice.org/8529
    Tested-by: Markus Mohrhard <markus.mohrh...@googlemail.com>
    Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com>

diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index eb2acb9..ec323de 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -2751,6 +2751,25 @@ sc::RefUpdateResult 
ScTokenArray::AdjustReferenceOnShift( const sc::RefUpdateCon
                 rRef.SetRange(aAbs, aNewPos);
             }
             break;
+            case svExternalSingleRef:
+            {
+                // For external reference, just reset the reference with
+                // respect to the new cell position.
+                ScToken* pToken = static_cast<ScToken*>(*p);
+                ScSingleRefData& rRef = pToken->GetSingleRef();
+                ScAddress aAbs = rRef.toAbs(rOldPos);
+                rRef.SetAddress(aAbs, aNewPos);
+            }
+            break;
+            case svExternalDoubleRef:
+            {
+                // Same as above.
+                ScToken* pToken = static_cast<ScToken*>(*p);
+                ScComplexRefData& rRef = pToken->GetDoubleRef();
+                ScRange aAbs = rRef.toAbs(rOldPos);
+                rRef.SetRange(aAbs, aNewPos);
+            }
+            break;
             case svIndex:
             {
                 const formula::FormulaToken* pToken = *p;
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to