ooo-build r14046 - in trunk: . patches/dev300 patches/vba



Author: noelpwer
Date: Tue Sep 23 15:06:07 2008
New Revision: 14046
URL: http://svn.gnome.org/viewvc/ooo-build?rev=14046&view=rev

Log:
2008-09-23  Noel Power  <noel power novell com>

        * patches/apply: enable vba-noregrex-for-match.diff and add
        a1-address-handle-spaces.diff
        * patches/vba/a1-address-handle-spaces.diff: patch a1 parser to
        handle spaces like Range("Sheet1! a1 : b2 ") in address ( as XL
does )


Added:
   trunk/patches/vba/a1-address-handle-spaces.diff
Modified:
   trunk/ChangeLog
   trunk/patches/dev300/apply

Modified: trunk/patches/dev300/apply
==============================================================================
--- trunk/patches/dev300/apply	(original)
+++ trunk/patches/dev300/apply	Tue Sep 23 15:06:07 2008
@@ -1651,6 +1651,12 @@
 userform-image-import-fix.diff
 # spinbutton change wasn't imported correctly
 spinbutton-import-valuechange.diff
+# don't apply regex to MATCH function if typical
+# 'regex' like characters are present
+vba-noregrex-for-match.diff
+# allow spaces in a1 range strings
+a1-address-handle-spaces.diff
+
 [ VBAUntested ]
 SectionOwner => noelpwer
 vba-basic-null.diff i#85349, jjiao

Added: trunk/patches/vba/a1-address-handle-spaces.diff
==============================================================================
--- (empty file)
+++ trunk/patches/vba/a1-address-handle-spaces.diff	Tue Sep 23 15:06:07 2008
@@ -0,0 +1,72 @@
+diff --git sc/source/core/tool/address.cxx sc/source/core/tool/address.cxx
+index 234155c..b7d1b68 100644
+--- sc/source/core/tool/address.cxx
++++ sc/source/core/tool/address.cxx
+@@ -145,6 +145,15 @@ sal_Unicode_strtol ( const sal_Unicode* 
+     return is_neg ? -accum : accum;
+ }
+ 
++const sal_Unicode* lcl_eatWhiteSpace( const sal_Unicode* p )
++{
++    if ( p )
++    {
++        while(  *p == ' ' )
++            ++p;
++    }
++    return p;
++}
+ // Returns NULL if the string should be a sheet name, but is invalid
+ // Returns a pointer to the first character after the sheet name
+ static const sal_Unicode *
+@@ -330,6 +339,8 @@ lcl_ScRange_Parse_XL_Header( ScRange& r,
+             nFlags = nSaveFlags;
+             return start;   // syntax error
+         }
++        else
++            p = lcl_eatWhiteSpace( p );
+     }
+     else
+     {
+@@ -699,8 +710,12 @@ lcl_ScRange_Parse_XL_A1( ScRange& r,
+             return 0;
+ 
+         tmp1 = lcl_a1_get_row( p, &r.aStart, &nFlags );
++        
++        tmp1 = lcl_eatWhiteSpace( tmp1 );
+         if( !tmp1 || *tmp1++ != ':' ) // Even a singleton requires ':' (eg 2:2)
+             return 0;
++
++        tmp1 = lcl_eatWhiteSpace( tmp1 );
+         tmp2 = lcl_a1_get_row( tmp1, &r.aEnd, &nFlags2 );
+         if( !tmp2 )
+             return 0;
+@@ -719,8 +734,11 @@ lcl_ScRange_Parse_XL_A1( ScRange& r,
+         if( bOnlyAcceptSingle ) // by definition full col refs are ranges
+             return 0;
+ 
++        tmp1 = lcl_eatWhiteSpace( tmp1 );
+         if( *tmp1++ != ':' )    // Even a singleton requires ':' (eg F:F)
+             return 0;
++
++        tmp1 = lcl_eatWhiteSpace( tmp1 );
+         tmp2 = lcl_a1_get_col( tmp1, &r.aEnd, &nFlags2 );
+         if( !tmp2 )
+             return 0;
+@@ -749,6 +767,7 @@ lcl_ScRange_Parse_XL_A1( ScRange& r,
+         }
+     }
+ 
++    tmp2 = lcl_eatWhiteSpace( tmp2 );
+     if( *tmp2 != ':' )
+     {
+         nFlags &= ~(SCA_VALID | SCA_VALID_COL | SCA_VALID_ROW | SCA_VALID_TAB |
+@@ -757,7 +776,8 @@ lcl_ScRange_Parse_XL_A1( ScRange& r,
+     }
+ 
+     p = tmp2;
+-    tmp1 = lcl_a1_get_col( p+1, &r.aEnd, &nFlags2 );
++    p = lcl_eatWhiteSpace( p+1 );
++    tmp1 = lcl_a1_get_col( p, &r.aEnd, &nFlags2 );
+     if( !tmp1 ) // strange, but valid singleton
+         return nFlags;
+ 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]