ooo-build r12456 - in trunk: . patches/test



Author: kyoshida
Date: Sun May  4 00:01:05 2008
New Revision: 12456
URL: http://svn.gnome.org/viewvc/ooo-build?rev=12456&view=rev

Log:
2008-05-03  Kohei Yoshida  <kyoshida novell com>

	* patches/test/sc-sheet-name-special-chars.diff: updated for XL A1 and
	R1C1 address conventions.


Modified:
   trunk/ChangeLog
   trunk/patches/test/sc-sheet-name-special-chars.diff

Modified: trunk/patches/test/sc-sheet-name-special-chars.diff
==============================================================================
--- trunk/patches/test/sc-sheet-name-special-chars.diff	(original)
+++ trunk/patches/test/sc-sheet-name-special-chars.diff	Sun May  4 00:01:05 2008
@@ -1,7 +1,35 @@
-diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=sc.vpj sc.clean/inc/document.hxx sc/inc/document.hxx
---- sc.clean/inc/document.hxx	2008-04-29 19:57:28.000000000 -0400
-+++ sc/inc/document.hxx	2008-05-01 12:14:13.000000000 -0400
-@@ -584,7 +584,6 @@ SC_DLLPUBLIC	ScDBCollection*	GetDBCollec
+diff --git a/sc/inc/compiler.hxx b/sc/inc/compiler.hxx
+index c163251..25a3387 100644
+--- sc/inc/compiler.hxx
++++ sc/inc/compiler.hxx
+@@ -226,6 +226,22 @@ public:
+                     parseAnyToken( const String& rFormula,
+                                    xub_StrLen nSrcPos,
+                                    const CharClass* pCharClass) const = 0;
++
++        enum SpecialSymbolType
++        {
++            /** 
++             * Character between sheet name and address.  In OOO A1 this is 
++             * '.', while XL A1 and XL R1C1 this is '!'. 
++             */
++            SHEET_SEPARATOR,
++
++            /**
++             * In OOO A1, a sheet name may be prefixed with '$' to indicate an
++             * absolute sheet position.
++             */
++            ABS_SHEET_PREFIX
++        };
++        virtual sal_Unicode getSpecialSymbol( SpecialSymbolType eSymType ) const = 0;
+     };
+     friend struct Convention;
+ 
+diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
+index e9c4a7c..e8b18e9 100644
+--- sc/inc/document.hxx
++++ sc/inc/document.hxx
+@@ -567,7 +567,6 @@ SC_DLLPUBLIC	ScDBCollection*	GetDBCollection() const;
  	void			SnapVisArea( Rectangle& rRect ) const;			// 1/100 mm
  
  	SC_DLLPUBLIC BOOL			ValidTabName( const String& rName ) const;
@@ -9,10 +37,11 @@
  	SC_DLLPUBLIC BOOL			ValidNewTabName( const String& rName ) const;
  	SC_DLLPUBLIC void			CreateValidTabName(String& rName) const;
  	BOOL			InsertTab( SCTAB nPos, const String& rName,
-diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=sc.vpj sc.clean/source/core/data/document.cxx sc/source/core/data/document.cxx
---- sc.clean/source/core/data/document.cxx	2008-04-29 19:57:34.000000000 -0400
-+++ sc/source/core/data/document.cxx	2008-05-01 12:14:13.000000000 -0400
-@@ -177,40 +177,7 @@ BOOL ScDocument::GetTable( const String&
+diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
+index dbe6130..b3d0607 100644
+--- sc/source/core/data/document.cxx
++++ sc/source/core/data/document.cxx
+@@ -193,40 +193,7 @@ BOOL ScDocument::GetTable( const String& rName, SCTAB& rTab ) const
  
  BOOL ScDocument::ValidTabName( const String& rName ) const
  {
@@ -54,10 +83,11 @@
  }
  
  
-diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=sc.vpj sc.clean/source/core/tool/address.cxx sc/source/core/tool/address.cxx
---- sc.clean/source/core/tool/address.cxx	2008-04-29 19:57:34.000000000 -0400
-+++ sc/source/core/tool/address.cxx	2008-05-01 12:14:13.000000000 -0400
-@@ -722,23 +722,30 @@ lcl_ScAddress_Parse_OOo( BOOL& bExternal
+diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx
+index d2bb670..22815cb 100644
+--- sc/source/core/tool/address.cxx
++++ sc/source/core/tool/address.cxx
+@@ -717,23 +717,30 @@ lcl_ScAddress_Parse_OOo( BOOL& bExternal, const sal_Unicode* p,
      BOOL    bExtDoc = FALSE;
      BOOL    bNeedExtTab = FALSE;
  
@@ -91,7 +121,7 @@
      }
  
      SCCOL   nCol = 0;
-@@ -753,12 +760,33 @@ lcl_ScAddress_Parse_OOo( BOOL& bExternal
+@@ -748,12 +755,33 @@ lcl_ScAddress_Parse_OOo( BOOL& bExternal, const sal_Unicode* p,
              nRes |= SCA_TAB_ABSOLUTE;
          if (*p == '$')
              nRes |= SCA_TAB_ABSOLUTE, p++;
@@ -129,18 +159,11 @@
              {
                  p++; break;
              }
-@@ -807,6 +835,7 @@ lcl_ScAddress_Parse_OOo( BOOL& bExternal
-     }
-     nRes |= nBits;
- 
-+
-     q = p;
-     if (*p)
-     {
-diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=sc.vpj sc.clean/source/core/tool/compiler.cxx sc/source/core/tool/compiler.cxx
---- sc.clean/source/core/tool/compiler.cxx	2008-04-29 19:57:34.000000000 -0400
-+++ sc/source/core/tool/compiler.cxx	2008-05-01 12:14:13.000000000 -0400
-@@ -974,6 +974,30 @@ struct Convention_A1 : public ScCompiler
+diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
+index ab91737..0e0955b 100644
+--- sc/source/core/tool/compiler.cxx
++++ sc/source/core/tool/compiler.cxx
+@@ -1087,6 +1087,30 @@ struct Convention_A1 : public ScCompiler::Convention
                                 xub_StrLen nSrcPos,
                                 const CharClass* pCharClass) const
      {
@@ -170,8 +193,69 @@
 +
          static const sal_Int32 nStartFlags = KParseTokens::ANY_LETTER_OR_NUMBER |
              KParseTokens::ASC_UNDERSCORE | KParseTokens::ASC_DOLLAR;
-         static const sal_Int32 nContFlags = nStartFlags | KParseTokens::ASC_DOT |
-@@ -1705,29 +1729,18 @@ ScCompiler::ScCompiler(ScDocument* pDocu
+         static const sal_Int32 nContFlags = nStartFlags | KParseTokens::ASC_DOT;
+@@ -1261,6 +1285,19 @@ struct ConventionOOO_A1 : public Convention_A1
+     {
+         MakeRefStrImpl( rBuffer, rComp, rRef, bSingleRef, false);
+     }
++
++    virtual sal_Unicode getSpecialSymbol( SpecialSymbolType eSymType ) const
++    {
++        switch (eSymType)
++        {
++            case ScCompiler::Convention::ABS_SHEET_PREFIX:
++                return '$';
++            case ScCompiler::Convention::SHEET_SEPARATOR:
++                return '.';
++        }
++
++        return sal_Unicode(0);
++    }
+ };
+ 
+ 
+@@ -1370,6 +1407,16 @@ struct ConventionXL
+             rBuf.append( sal_Unicode( '!' ) );
+         }
+     }
++
++    static sal_Unicode getSpecialSymbol( ScCompiler::Convention::SpecialSymbolType eSymType )
++    {
++        switch (eSymType)
++        {
++            case ScCompiler::Convention::SHEET_SEPARATOR:
++                return '!';
++        }
++        return sal_Unicode(0);
++    }
+ };
+ 
+ struct ConventionXL_A1 : public Convention_A1, public ConventionXL
+@@ -1446,6 +1493,11 @@ struct ConventionXL_A1 : public Convention_A1, public ConventionXL
+             MakeRowStr( rBuf, aRef.Ref2.nRow );
+         }
+     }
++
++    virtual sal_Unicode getSpecialSymbol( SpecialSymbolType eSymType ) const
++    {
++        return ConventionXL::getSpecialSymbol(eSymType);
++    }
+ };
+ 
+ static const ConventionXL_A1 ConvXL_A1;
+@@ -1564,6 +1616,11 @@ struct ConventionXL_R1C1 : public ScCompiler::Convention, public ConventionXL
+         return pCharClass->parseAnyToken( rFormula,
+                 nSrcPos, nStartFlags, aAddAllowed, nContFlags, aAddAllowed );
+     }
++
++    virtual sal_Unicode getSpecialSymbol( SpecialSymbolType eSymType ) const
++    {
++        return ConventionXL::getSpecialSymbol(eSymType);
++    }
+ };
+ 
+ static const ConventionXL_R1C1 ConvXL_R1C1;
+@@ -1621,29 +1678,18 @@ ScCompiler::ScCompiler( ScDocument* pDocument, const ScAddress& rPos,
  void ScCompiler::CheckTabQuotes( String& rString,
                                   const ScAddress::Convention eConv )
  {
@@ -208,10 +292,46 @@
          case ScAddress::CONV_XL_A1 :
          case ScAddress::CONV_XL_R1C1 :
              if( bNeedsQuote )
-diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=sc.vpj sc.clean/source/filter/excel/excimp8.cxx sc/source/filter/excel/excimp8.cxx
---- sc.clean/source/filter/excel/excimp8.cxx	2008-04-29 19:57:38.000000000 -0400
-+++ sc/source/filter/excel/excimp8.cxx	2008-05-01 12:14:13.000000000 -0400
-@@ -218,7 +218,6 @@ void ImportExcel8::Boundsheet( void )
+@@ -1756,6 +1802,11 @@ xub_StrLen ScCompiler::NextSymbol()
+     sal_Unicode cSep = mxSymbols->getSymbol( ocSep).GetChar(0);
+     sal_Unicode cDecSep = (mxSymbols->isEnglish() ? '.' :
+             ScGlobal::pLocaleData->getNumDecimalSep().GetChar(0));
++
++    // special symbols specific to address convention used
++    sal_Unicode cSheetPrefix = pConv->getSpecialSymbol(ScCompiler::Convention::ABS_SHEET_PREFIX);
++    sal_Unicode cSheetSep    = pConv->getSpecialSymbol(ScCompiler::Convention::SHEET_SEPARATOR);
++
+     int nDecSeps = 0;
+     int nRefInSheetName = 0;
+     mnPredetectedReference = 0;
+@@ -2063,8 +2114,8 @@ xub_StrLen ScCompiler::NextSymbol()
+         do
+         {
+             bi18n = FALSE;
+-            // special case  $'sheetname'
+-            if ( pStart[nSrcPos] == '$' && pStart[nSrcPos+1] == '\'' )
++            // special case  (e.g. $'sheetname' in OOO A1)
++            if ( pStart[nSrcPos] == cSheetPrefix && pStart[nSrcPos+1] == '\'' )
+                 aSymbol += pStart[nSrcPos++];
+ 
+             ParseResult aRes = pConv->parseAnyToken( aFormula, nSrcPos, pCharClass );
+@@ -2082,9 +2133,9 @@ xub_StrLen ScCompiler::NextSymbol()
+                 aSymbol.Append( pStart + nSrcPos, (xub_StrLen)aRes.EndPos - nSrcPos );
+                 nSrcPos = (xub_StrLen) aRes.EndPos;
+                 if ( aRes.TokenType & KParseType::SINGLE_QUOTE_NAME )
+-                {   // special cases  'sheetname'.  'filename'#
++                {   // special cases (e.g. 'sheetname'. or 'filename'# in OOO A1)
+                     c = pStart[nSrcPos];
+-                    bi18n = (c == '.' || c == SC_COMPILER_FILE_TAB_SEP);
++                    bi18n = (c == cSheetSep || c == SC_COMPILER_FILE_TAB_SEP);
+                     if ( bi18n )
+                         aSymbol += pStart[nSrcPos++];
+                 }
+diff --git a/sc/source/filter/excel/excimp8.cxx b/sc/source/filter/excel/excimp8.cxx
+index e92c938..c7dac08 100644
+--- sc/source/filter/excel/excimp8.cxx
++++ sc/source/filter/excel/excimp8.cxx
+@@ -186,7 +186,6 @@ void ImportExcel8::Boundsheet( void )
      String aName( aIn.ReadUniString( nLen ) );
      GetTabInfo().AppendXclTabName( aName, nBdshtTab );
  
@@ -219,10 +339,11 @@
  	*pExcRoot->pTabNameBuff << aName;
  
      SCTAB nScTab = static_cast< SCTAB >( nBdshtTab );
-diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=sc.vpj sc.clean/source/filter/excel/exctools.cxx sc/source/filter/excel/exctools.cxx
---- sc.clean/source/filter/excel/exctools.cxx	2008-04-29 19:57:38.000000000 -0400
-+++ sc/source/filter/excel/exctools.cxx	2008-05-01 12:14:13.000000000 -0400
-@@ -401,7 +401,6 @@ void ExcScenario::Apply( const XclImpRoo
+diff --git a/sc/source/filter/excel/exctools.cxx b/sc/source/filter/excel/exctools.cxx
+index be44b92..e7cda06 100644
+--- sc/source/filter/excel/exctools.cxx
++++ sc/source/filter/excel/exctools.cxx
+@@ -391,7 +391,6 @@ void ExcScenario::Apply( const XclImpRoot& rRoot, const BOOL bLast )
      ScDocument&         r = rRoot.GetDoc();
  	ExcScenarioCell*	p = EXCSCFIRST();
  	String				aSzenName( *pName );
@@ -230,10 +351,11 @@
  	UINT16				nNewTab = nTab + 1;
  
  	if( !r.InsertTab( nNewTab, aSzenName ) )
-diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=sc.vpj sc.clean/source/filter/excel/impop.cxx sc/source/filter/excel/impop.cxx
---- sc.clean/source/filter/excel/impop.cxx	2008-04-29 19:57:38.000000000 -0400
-+++ sc/source/filter/excel/impop.cxx	2008-05-01 12:14:13.000000000 -0400
-@@ -440,7 +440,6 @@ void ImportExcel::Externsheet( void )
+diff --git a/sc/source/filter/excel/impop.cxx b/sc/source/filter/excel/impop.cxx
+index 344b648..6bcd443 100644
+--- sc/source/filter/excel/impop.cxx
++++ sc/source/filter/excel/impop.cxx
+@@ -435,7 +435,6 @@ void ImportExcel::Externsheet( void )
      bool bSameWorkBook;
      String aEncodedUrl( aIn.ReadByteString( false ) );
      XclImpUrlHelper::DecodeUrl( aUrl, aTabName, bSameWorkBook, *pExcRoot->pIR, aEncodedUrl );
@@ -241,7 +363,7 @@
      pExcRoot->pExtSheetBuff->Add( aUrl, aTabName, bSameWorkBook );
  }
  
-@@ -691,7 +690,6 @@ void ImportExcel::Boundsheet( void )
+@@ -686,7 +685,6 @@ void ImportExcel::Boundsheet( void )
  	}
  
      String aName( aIn.ReadByteString( FALSE ) );
@@ -249,10 +371,11 @@
  
  	*pExcRoot->pTabNameBuff << aName;
  
-diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=sc.vpj sc.clean/source/filter/excel/xicontent.cxx sc/source/filter/excel/xicontent.cxx
---- sc.clean/source/filter/excel/xicontent.cxx	2008-04-29 19:57:38.000000000 -0400
-+++ sc/source/filter/excel/xicontent.cxx	2008-05-01 12:14:13.000000000 -0400
-@@ -434,12 +434,7 @@ void XclImpHyperlink::ConvertToValidTabN
+diff --git a/sc/source/filter/excel/xicontent.cxx b/sc/source/filter/excel/xicontent.cxx
+index fc44f0d..19c8c55 100644
+--- sc/source/filter/excel/xicontent.cxx
++++ sc/source/filter/excel/xicontent.cxx
+@@ -354,12 +354,7 @@ void XclImpHyperlink::ConvertToValidTabName(String& rUrl)
          {
              bInQuote = !bInQuote;
              if (!bInQuote && aTabName.Len() > 0)
@@ -265,10 +388,11 @@
          }
          else if (bInQuote)
              aTabName.Append(c);
-diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=sc.vpj sc.clean/source/filter/excel/xilink.cxx sc/source/filter/excel/xilink.cxx
---- sc.clean/source/filter/excel/xilink.cxx	2008-04-29 19:57:38.000000000 -0400
-+++ sc/source/filter/excel/xilink.cxx	2008-05-01 12:14:13.000000000 -0400
-@@ -446,7 +446,6 @@ XclImpSupbook::XclImpSupbook( XclImpStre
+diff --git a/sc/source/filter/excel/xilink.cxx b/sc/source/filter/excel/xilink.cxx
+index 18daca6..03f988a 100644
+--- sc/source/filter/excel/xilink.cxx
++++ sc/source/filter/excel/xilink.cxx
+@@ -422,7 +422,6 @@ XclImpSupbook::XclImpSupbook( XclImpStream& rStrm ) :
          for( sal_uInt16 nSBTab = 0; nSBTab < nSBTabCnt; ++nSBTab )
          {
              String aTabName( rStrm.ReadUniString() );
@@ -276,10 +400,11 @@
              maSupbTabList.Append( new XclImpSupbookTab( aTabName ) );
          }
      }
-diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=sc.vpj sc.clean/source/filter/excel/xipivot.cxx sc/source/filter/excel/xipivot.cxx
---- sc.clean/source/filter/excel/xipivot.cxx	2008-04-29 19:57:38.000000000 -0400
-+++ sc/source/filter/excel/xipivot.cxx	2008-05-01 12:14:13.000000000 -0400
-@@ -700,7 +700,6 @@ void XclImpPivotCache::ReadPivotCacheStr
+diff --git a/sc/source/filter/excel/xipivot.cxx b/sc/source/filter/excel/xipivot.cxx
+index e0cf43f..d21d90b 100644
+--- sc/source/filter/excel/xipivot.cxx
++++ sc/source/filter/excel/xipivot.cxx
+@@ -695,7 +695,6 @@ void XclImpPivotCache::ReadPivotCacheStream( XclImpStream& rStrm )
              String aDummyName = CREATE_STRING( "DPCache" );
              if( maTabName.Len() > 0 )
                  aDummyName.Append( '_' ).Append( maTabName );
@@ -287,10 +412,11 @@
              rDoc.CreateValidTabName( aDummyName );
              rDoc.RenameTab( nScTab, aDummyName );
              // set sheet index to source range
-diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=sc.vpj sc.clean/source/filter/ftools/ftools.cxx sc/source/filter/ftools/ftools.cxx
---- sc.clean/source/filter/ftools/ftools.cxx	2008-04-29 19:57:38.000000000 -0400
-+++ sc/source/filter/ftools/ftools.cxx	2008-05-01 12:14:13.000000000 -0400
-@@ -190,11 +190,6 @@ Color ScfTools::GetMixedColor( const Col
+diff --git a/sc/source/filter/ftools/ftools.cxx b/sc/source/filter/ftools/ftools.cxx
+index fca755e..8f753e3 100644
+--- sc/source/filter/ftools/ftools.cxx
++++ sc/source/filter/ftools/ftools.cxx
+@@ -158,11 +158,6 @@ Color ScfTools::GetMixedColor( const Color& rFore, const Color& rBack, sal_uInt8
  
  // *** conversion of names *** ------------------------------------------------
  
@@ -302,10 +428,11 @@
  void ScfTools::ConvertToScDefinedName( String& rName )
  {
      xub_StrLen nLen = rName.Len();
-diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=sc.vpj sc.clean/source/filter/inc/ftools.hxx sc/source/filter/inc/ftools.hxx
---- sc.clean/source/filter/inc/ftools.hxx	2008-04-29 19:57:34.000000000 -0400
-+++ sc/source/filter/inc/ftools.hxx	2008-05-01 12:14:13.000000000 -0400
-@@ -304,10 +304,6 @@ public:
+diff --git a/sc/source/filter/inc/ftools.hxx b/sc/source/filter/inc/ftools.hxx
+index 82ca276..537e7de 100644
+--- sc/source/filter/inc/ftools.hxx
++++ sc/source/filter/inc/ftools.hxx
+@@ -292,10 +292,6 @@ public:
  
  // *** conversion of names *** ------------------------------------------------
  
@@ -316,10 +443,11 @@
      /** Converts a string to a valid Calc defined name or database range name.
          @descr  Defined names in Calc may contain letters, digits (*), underscores, periods (*),
          colons (*), question marks, and dollar signs.
-diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=sc.vpj sc.clean/source/filter/xcl97/XclImpChangeTrack.cxx sc/source/filter/xcl97/XclImpChangeTrack.cxx
---- sc.clean/source/filter/xcl97/XclImpChangeTrack.cxx	2008-04-29 19:57:38.000000000 -0400
-+++ sc/source/filter/xcl97/XclImpChangeTrack.cxx	2008-05-01 12:14:13.000000000 -0400
-@@ -204,7 +204,6 @@ sal_Bool XclImpChangeTrack::Read3DTabRef
+diff --git a/sc/source/filter/xcl97/XclImpChangeTrack.cxx b/sc/source/filter/xcl97/XclImpChangeTrack.cxx
+index 6d1cacd..14b26fa 100644
+--- sc/source/filter/xcl97/XclImpChangeTrack.cxx
++++ sc/source/filter/xcl97/XclImpChangeTrack.cxx
+@@ -179,7 +179,6 @@ sal_Bool XclImpChangeTrack::Read3DTabRefInfo( SCTAB& rFirstTab, SCTAB& rLastTab
          pStrm->Ignore( 1 );
          // - sheet name, always separated from URL
          String aTabName( pStrm->ReadUniString() );
@@ -327,10 +455,11 @@
          pStrm->Ignore( 1 );
          rFirstTab = rLastTab = static_cast<SCTAB>(GetLinkManager().GetScTab( aUrl, aTabName ));
  	}
-diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=sc.vpj sc.clean/source/ui/vba/vbaworksheets.cxx sc/source/ui/vba/vbaworksheets.cxx
---- sc.clean/source/ui/vba/vbaworksheets.cxx	2008-04-29 19:57:30.000000000 -0400
-+++ sc/source/ui/vba/vbaworksheets.cxx	2008-05-01 12:14:13.000000000 -0400
-@@ -407,9 +407,7 @@ ScVbaWorksheets::Item( const uno::Any& I
+diff --git a/sc/source/ui/vba/vbaworksheets.cxx b/sc/source/ui/vba/vbaworksheets.cxx
+index f7ca487..456dbb6 100644
+--- sc/source/ui/vba/vbaworksheets.cxx
++++ sc/source/ui/vba/vbaworksheets.cxx
+@@ -402,9 +402,7 @@ ScVbaWorksheets::Item( const uno::Any& Index, const uno::Any& Index2  ) throw (u
  uno::Any 
  ScVbaWorksheets::getItemByStringIndex( const rtl::OUString& sIndex ) throw (uno::RuntimeException)
  {



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