f9a2b92
From aa04efe74b865de83e63846873e83e5b1b91d71e Mon Sep 17 00:00:00 2001
f9a2b92
Message-Id: <aa04efe74b865de83e63846873e83e5b1b91d71e.1435267199.git.erack@redhat.com>
f9a2b92
From: Eike Rathke <erack@redhat.com>
f9a2b92
Date: Thu, 25 Jun 2015 20:06:47 +0200
f9a2b92
Subject: [PATCH] a singleton must be fully parsed to be valid, tdf#44419
f9a2b92
 related
f9a2b92
MIME-Version: 1.0
f9a2b92
Content-Type: multipart/mixed; boundary="------------erAck-patch-parts"
f9a2b92
f9a2b92
This is a multi-part message in MIME format.
f9a2b92
--------------erAck-patch-parts
f9a2b92
Content-Type: text/plain; charset=UTF-8; format=fixed
f9a2b92
Content-Transfer-Encoding: 8bit
f9a2b92
f9a2b92
f9a2b92
No trailing characters must be present in 1:1 or A:A full row/column
f9a2b92
references, e.g. 2:2,2 is not valid. The original cause is the lexical
f9a2b92
analyzer that accepted 2,2 as the second part after the range operator
f9a2b92
because ',' is also the group separator here, which needs further
f9a2b92
changes.
f9a2b92
f9a2b92
Change-Id: Iff354469f7dcb4e0b6fa645c39cc1f8ebad4a6ea
f9a2b92
(cherry picked from commit c48af2b55a60492565b987ee65d98edc6bd94533)
f9a2b92
Reviewed-on: https://gerrit.libreoffice.org/16490
f9a2b92
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
f9a2b92
Tested-by: Caolán McNamara <caolanm@redhat.com>
f9a2b92
---
f9a2b92
 sc/source/core/tool/address.cxx | 4 ++--
f9a2b92
 1 file changed, 2 insertions(+), 2 deletions(-)
f9a2b92
f9a2b92
f9a2b92
--------------erAck-patch-parts
f9a2b92
Content-Type: text/x-patch; name="0001-a-singleton-must-be-fully-parsed-to-be-valid-tdf-444.patch"
f9a2b92
Content-Transfer-Encoding: 8bit
f9a2b92
Content-Disposition: attachment; filename="0001-a-singleton-must-be-fully-parsed-to-be-valid-tdf-444.patch"
f9a2b92
f9a2b92
diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx
f9a2b92
index ef3baad..96d7812 100644
f9a2b92
--- a/sc/source/core/tool/address.cxx
f9a2b92
+++ b/sc/source/core/tool/address.cxx
f9a2b92
@@ -916,7 +916,7 @@ static sal_uInt16 lcl_ScRange_Parse_XL_A1( ScRange& r,
f9a2b92
 
f9a2b92
         tmp1 = lcl_eatWhiteSpace( tmp1 );
f9a2b92
         tmp2 = lcl_a1_get_row( tmp1, &r.aEnd, &nFlags2 );
f9a2b92
-        if( !tmp2 )
f9a2b92
+        if( !tmp2 || *tmp2 != 0 )   // Must have fully parsed a singleton.
f9a2b92
             return 0;
f9a2b92
 
f9a2b92
         r.aStart.SetCol( 0 ); r.aEnd.SetCol( MAXCOL );
f9a2b92
@@ -939,7 +939,7 @@ static sal_uInt16 lcl_ScRange_Parse_XL_A1( ScRange& r,
f9a2b92
 
f9a2b92
         tmp1 = lcl_eatWhiteSpace( tmp1 );
f9a2b92
         tmp2 = lcl_a1_get_col( tmp1, &r.aEnd, &nFlags2 );
f9a2b92
-        if( !tmp2 )
f9a2b92
+        if( !tmp2 || *tmp2 != 0 )   // Must have fully parsed a singleton.
f9a2b92
             return 0;
f9a2b92
 
f9a2b92
         r.aStart.SetRow( 0 ); r.aEnd.SetRow( MAXROW );
f9a2b92
f9a2b92
--------------erAck-patch-parts--
f9a2b92
f9a2b92