[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source

Eike Rathke erack at redhat.com
Tue Jun 30 03:58:29 PDT 2015


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

New commits:
commit d2787cde7722dee09ae67e1d6bc9a3501ecc0d56
Author: Eike Rathke <erack at redhat.com>
Date:   Tue Jun 30 12:42:06 2015 +0200

    tdf#92427 entire column/row reference also if both sticky parts are relative
    
    For example, convert A1:A1048576 to A:A but not A$1:A1048576 or
    A1:A$1048576
    
    Change-Id: I7845134f79a04f7c031896d515ea1cb8050bd454
    (cherry picked from commit 0ccefa0cb62da893556893bec2414c22cb2ad7b8)

diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx
index 60d6d2e..0af90d6 100644
--- a/sc/source/core/tool/address.cxx
+++ b/sc/source/core/tool/address.cxx
@@ -1502,6 +1502,25 @@ static sal_uInt16 lcl_ScRange_Parse_OOo( ScRange& rRange,
                     nRes2 |= SCA_COL_ABSOLUTE;
                 }
             }
+            else if ((nRes1 & SCA_VALID) && (nRes2 & SCA_VALID))
+            {
+                // Flag entire column/row references so they can be displayed
+                // as such. If the sticky reference parts are not both
+                // absolute or relative, assume that the user thought about
+                // something we should not touch.
+                if (rRange.aStart.Row() == 0 && rRange.aEnd.Row() == MAXROW &&
+                        ((nRes1 & SCA_ROW_ABSOLUTE) == 0) && ((nRes2 & SCA_ROW_ABSOLUTE) == 0))
+                {
+                    nRes1 |= SCA_ROW_ABSOLUTE;
+                    nRes2 |= SCA_ROW_ABSOLUTE;
+                }
+                else if (rRange.aStart.Col() == 0 && rRange.aEnd.Col() == MAXCOL &&
+                        ((nRes1 & SCA_COL_ABSOLUTE) == 0) && ((nRes2 & SCA_COL_ABSOLUTE) == 0))
+                {
+                    nRes1 |= SCA_COL_ABSOLUTE;
+                    nRes2 |= SCA_COL_ABSOLUTE;
+                }
+            }
             if (nRes1 && nRes2)
             {
                 // PutInOrder / Justify


More information about the Libreoffice-commits mailing list