summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2008-03-06 14:43:00 +0000
committerKurt Zenker <kz@openoffice.org>2008-03-06 14:43:00 +0000
commitb910dbc0ff04f722657b23867d88883b4a67a645 (patch)
tree84a258998af0406a6e18d2097d841cc322e60f98 /sc
parent589960c8ff30f39af57280d665a6280cb765aeb9 (diff)
INTEGRATION: CWS odff (1.12.90); FILE MERGED
2008/01/18 20:45:34 er 1.12.90.2: ScToken base class without OpCode member but implicit ocPush, derived ScOpToken class to inherit from if explicit OpCode needed; this saves 2 bytes on each (!) allocation of ScDoubleToken, ScStringToken, ScSingleRefToken, ScDoubleRefToken. And there are zillions.. 2008/01/10 14:40:48 dr 1.12.90.1: import/export error codes
Diffstat (limited to 'sc')
-rw-r--r--sc/source/filter/excel/tokstack.cxx69
1 files changed, 58 insertions, 11 deletions
diff --git a/sc/source/filter/excel/tokstack.cxx b/sc/source/filter/excel/tokstack.cxx
index a785a702e9a3..8c2d65718c02 100644
--- a/sc/source/filter/excel/tokstack.cxx
+++ b/sc/source/filter/excel/tokstack.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: tokstack.cxx,v $
*
- * $Revision: 1.12 $
+ * $Revision: 1.13 $
*
- * last change: $Author: obo $ $Date: 2007-06-13 09:09:40 $
+ * last change: $Author: kz $ $Date: 2008-03-06 15:43:00 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -97,6 +97,10 @@ TokenPool::TokenPool( void )
nP_Dbl = 8;
pP_Dbl = new double[ nP_Dbl ];
+ // Sammelstelle fuer error codes
+ nP_Err = 8;
+ pP_Err = new USHORT[ nP_Err ];
+
// Sammelstellen fuer Referenzen
nP_RefTr = 32;
ppP_RefTr = new SingleRefData *[ nP_RefTr ];
@@ -130,6 +134,7 @@ TokenPool::~TokenPool()
delete[] pType;
delete[] pSize;
delete[] pP_Dbl;
+ delete[] pP_Err;
for( n = 0 ; n < nP_RefTr ; n++/*, pAktTr++*/ )
{
@@ -205,6 +210,22 @@ void TokenPool::GrowDouble( void )
}
+void TokenPool::GrowError( void )
+{
+ UINT16 nP_ErrNew = nP_Err * 2;
+
+ USHORT* pP_ErrNew = new USHORT[ nP_ErrNew ];
+
+ for( UINT16 nL = 0 ; nL < nP_Err ; nL++ )
+ pP_ErrNew[ nL ] = pP_Err[ nL ];
+
+ nP_Err = nP_ErrNew;
+
+ delete[] pP_Err;
+ pP_Err = pP_ErrNew;
+}
+
+
void TokenPool::GrowTripel( void )
{
UINT16 nP_RefTrNew = nP_RefTr * 2;
@@ -331,6 +352,11 @@ void TokenPool::GetElement( const UINT16 nId )
case T_D:
pScToken->AddDouble( pP_Dbl[ pElement[ nId ] ] );
break;
+ case T_Err:
+#if 0 // erAck
+ pScToken->AddError( pP_Err[ pElement[ nId ] ] );
+#endif
+ break;
case T_RefC:
pScToken->AddSingleReference( *ppP_RefTr[ pElement[ (UINT16) nId ] ] );
break;
@@ -351,12 +377,9 @@ void TokenPool::GetElement( const UINT16 nId )
EXTCONT* p = ( n < nP_Ext )? ppP_Ext[ n ] : NULL;
if( p )
- {
- ScToken *pTok = pScToken->AddExternal( p->aText );
- pTok->NewOpCode (p->eId);
+ pScToken->AddExternal( p->aText, p->eId );
}
break;
- }
case T_Nlf:
{
UINT16 n = pElement[ nId ];
@@ -411,6 +434,11 @@ void TokenPool::GetElementRek( const UINT16 nId )
case T_D:
pScToken->AddDouble( pP_Dbl[ pElement[ *pAkt ] ] );
break;
+ case T_Err:
+#if 0 // erAck
+ pScToken->AddError( pP_Err[ pElement[ *pAkt ] ] );
+#endif
+ break;
case T_RefC:
pScToken->AddSingleReference( *ppP_RefTr[ pElement[ *pAkt ] ] );
break;
@@ -431,10 +459,7 @@ void TokenPool::GetElementRek( const UINT16 nId )
EXTCONT* p = ( n < nP_Ext )? ppP_Ext[ n ] : NULL;
if( p )
- {
- ScToken *pTok = pScToken->AddExternal( p->aText );
- pTok->NewOpCode (p->eId);
- }
+ pScToken->AddExternal( p->aText, p->eId );
}
break;
case T_Nlf:
@@ -509,6 +534,28 @@ const TokenId TokenPool::Store( const double& rDouble )
}
+const TokenId TokenPool::StoreError( USHORT nError )
+{
+ if( nElementAkt >= nElement )
+ GrowElement();
+
+ if( nP_ErrAkt >= nP_Err )
+ GrowError();
+
+ pElement[ nElementAkt ] = nP_ErrAkt; // Index in Error-Array
+ pType[ nElementAkt ] = T_Err; // Typinfo Error eintragen
+
+ pP_Err[ nP_ErrAkt ] = nError;
+
+ pSize[ nElementAkt ] = 1; // eigentlich Banane
+
+ nElementAkt++;
+ nP_ErrAkt++;
+
+ return ( const TokenId ) nElementAkt; // Ausgabe von altem Wert + 1!
+}
+
+
const TokenId TokenPool::Store( const UINT16 nIndex )
{
if( nElementAkt >= nElement )
@@ -682,7 +729,7 @@ const TokenId TokenPool::StoreMatrix( SCSIZE nC, SCSIZE nR )
void TokenPool::Reset( void )
{
- nP_IdAkt = nP_IdLast = nElementAkt = nP_StrAkt = nP_DblAkt = nP_RefTrAkt = nP_ExtAkt = nP_NlfAkt = nP_MatrixAkt = 0;
+ nP_IdAkt = nP_IdLast = nElementAkt = nP_StrAkt = nP_DblAkt = nP_ErrAkt = nP_RefTrAkt = nP_ExtAkt = nP_NlfAkt = nP_MatrixAkt = 0;
}