Kaydet (Commit) 02ed81ef authored tarafından Armin Le Grand's avatar Armin Le Grand

filter review Lotus WK

Patch by: Eike Rathke
üst a6b0b8d0
......@@ -44,8 +44,6 @@
#include "patattr.hxx"
#include "ftools.hxx"
const sal_uInt16 LotusFontBuffer::nSize = 8;
void LotusFontBuffer::Fill( const sal_uInt8 nIndex, SfxItemSet& rItemSet )
{
sal_uInt8 nIntIndex = nIndex & 0x07;
......
......@@ -92,14 +92,15 @@ private:
inline void Type( const sal_uInt16 nNew ) { nType = nNew; }
};
ENTRY pData[ 8 ];
const static sal_uInt16 nSize;
void MakeFont( ENTRY* pEntry );
public:
const static sal_uInt16 nSize = 8;
void Fill( const sal_uInt8 nIndex, SfxItemSet& rItemSet );
void SetName( const sal_uInt16 nIndex, const String& rName );
void SetHeight( const sal_uInt16 nIndex, const sal_uInt16 nHeight );
void SetType( const sal_uInt16 nIndex, const sal_uInt16 nType );
private:
ENTRY pData[ nSize ];
};
......
......@@ -41,7 +41,6 @@ class ImportLotus : public ImportTyp
{
private:
SvStream* pIn; // benoetigt wegen multiplem Read()!
LotusFontBuffer* pFontBuff;
LotusToSc aConv;
sal_uInt16 nTab; // z.Zt. bearbeitete Tabelle
sal_Int32 nExtTab;
......
......@@ -35,7 +35,6 @@ void OP_EOF( SvStream &aStream, sal_uInt16 nLaenge );
void OP_Integer( SvStream &aStream, sal_uInt16 nLaenge );
void OP_Number( SvStream &aStream, sal_uInt16 nLaenge );
void OP_Label( SvStream &aStream, sal_uInt16 nLaenge );
//UNUSED2009-05 void OP_Text( SvStream &aStream, sal_uInt16 nLaenge ); // WK3
void OP_Integer3( SvStream &aStream, sal_uInt16 nLaenge ); // WK3
void OP_Number3( SvStream &aStream, sal_uInt16 nLaenge ); // WK3
void OP_Formula( SvStream &aStream, sal_uInt16 nLaenge );
......
......@@ -105,6 +105,9 @@ struct LOTUS_ROOT
RangeNameBufferWK3* pRngNmBffWK3;
LotusFontBuffer* pFontBuff;
LotAttrTable* pAttrTable;
LOTUS_ROOT( ScDocument* pDocP, CharSet eQ );
~LOTUS_ROOT();
};
extern LOTUS_ROOT* pLotusRoot; // -> Inkarn. in filter.cxx
......
......@@ -170,17 +170,20 @@ class TokenPool
#endif
ScTokenArray* pScToken; // Tokenbastler
void GrowString( void );
void GrowDouble( void );
//UNUSED2009-05 void GrowError( void );
void GrowTripel( void );
void GrowId( void );
void GrowElement( void );
void GrowExt( void );
void GrowNlf( void );
void GrowMatrix( void );
void GetElement( const sal_uInt16 nId );
void GetElementRek( const sal_uInt16 nId );
bool GrowString( void );
bool GrowDouble( void );
/* TODO: in case we had FormulaTokenArray::AddError() */
#if 0
bool GrowError( void );
#endif
bool GrowTripel( sal_uInt16 nByMin = 1 );
bool GrowId( void );
bool GrowElement( void );
bool GrowExt( void );
bool GrowNlf( void );
bool GrowMatrix( void );
bool GetElement( const sal_uInt16 nId );
bool GetElementRek( const sal_uInt16 nId );
public:
TokenPool( void );
~TokenPool();
......@@ -214,7 +217,6 @@ class TokenPool
inline E_TYPE GetType( const TokenId& nId ) const;
sal_Bool IsSingleOp( const TokenId& nId, const DefTokenId eId ) const;
const String* GetExternal( const TokenId& nId ) const;
//UNUSED2008-05 const String* GetString( const TokenId& nId ) const;
ScMatrix* GetMatrix( unsigned int n ) const;
};
......@@ -305,7 +307,8 @@ inline TokenPool& TokenPool::operator <<( const TokenId nId )
"-TokenPool::operator <<: TokenId im DefToken-Bereich!" );
if( nP_IdAkt >= nP_Id )
GrowId();
if (!GrowId())
return *this;
pP_Id[ nP_IdAkt ] = ( ( sal_uInt16 ) nId ) - 1;
nP_IdAkt++;
......@@ -320,7 +323,8 @@ inline TokenPool& TokenPool::operator <<( const DefTokenId eId )
"-TokenPool::operator<<: enmum zu gross!" );
if( nP_IdAkt >= nP_Id )
GrowId();
if (!GrowId())
return *this;
pP_Id[ nP_IdAkt ] = ( ( sal_uInt16 ) eId ) + nScTokenOff;
nP_IdAkt++;
......@@ -332,7 +336,8 @@ inline TokenPool& TokenPool::operator <<( const DefTokenId eId )
inline TokenPool& TokenPool::operator <<( TokenStack& rStack )
{
if( nP_IdAkt >= nP_Id )
GrowId();
if (!GrowId())
return *this;
pP_Id[ nP_IdAkt ] = ( ( sal_uInt16 ) rStack.Get() ) - 1;
nP_IdAkt++;
......
......@@ -60,9 +60,6 @@ WKTYP eTyp;
extern sal_Bool bEOF; // zeigt Ende der Datei
sal_Bool bEOF;
extern CharSet eCharNach; // Zeichenkonvertierung von->nach
CharSet eCharNach;
extern CharSet eCharVon;
CharSet eCharVon;
......@@ -70,16 +67,11 @@ extern ScDocument* pDoc; // Aufhaenger zum Dokumentzugriff
ScDocument* pDoc;
extern sal_Char* pPuffer; // -> memory.cxx
extern sal_Char* pDummy1; // -> memory.cxx
extern OPCODE_FKT pOpFkt[ FKT_LIMIT ];
// -> optab.cxx, Tabelle moeglicher Opcodes
extern OPCODE_FKT pOpFkt123[ FKT_LIMIT123 ];
// -> optab.cxx, Table of possible Opcodes
extern long nDateiLaenge; // -> datei.cpp, ...der gerade offenen Datei
LOTUS_ROOT* pLotusRoot = NULL;
......@@ -193,9 +185,10 @@ WKTYP ScanVersion( SvStream& aStream )
aStream >> nVersNr;
if( aStream.IsEof() ) return eWK_Error;
if( nVersNr == 0x0004 && nRecLen == 26 )
{ // 4 Bytes von 26 gelesen->22 ueberlesen
aStream.Read( pDummy1, 22 );
return eWK3;
{ // 4 bytes of 26 read => skip 22 (read instead of seek to make IsEof() work just in case)
sal_Char aDummy[22];
aStream.Read( aDummy, 22 );
return aStream.IsEof() ? eWK_Error : eWK3;
}
break;
case 0x1003:
......
......@@ -68,7 +68,7 @@ void LotAttrCache::LotusToScBorderLine( sal_uInt8 nLine, SvxBorderLine& aBL )
const SvxColorItem& LotAttrCache::GetColorItem( const sal_uInt8 nLotIndex ) const
{
DBG_ASSERT( nLotIndex > 0 && nLotIndex < 7,
"-LotAttrCache::GetColorItem(): so nicht!" );
"-LotAttrCache::GetColorItem(): caller hast to check index!" );
return *ppColorItems[ nLotIndex - 1 ];
}
......@@ -77,7 +77,7 @@ const SvxColorItem& LotAttrCache::GetColorItem( const sal_uInt8 nLotIndex ) cons
const Color& LotAttrCache::GetColor( const sal_uInt8 nLotIndex ) const
{
// Farbe <-> Index passt fuer Background, nicht aber fuer Fonts (0 <-> 7)!
DBG_ASSERT( nLotIndex < 8, "*LotAttrCache::GetColor(): Index > 7!" );
DBG_ASSERT( nLotIndex < 8, "*LotAttrCache::GetColor(): Index > 7, caller hast to check index!" );
return pColTab[ nLotIndex ];
}
......@@ -208,6 +208,8 @@ LotAttrCol::~LotAttrCol()
void LotAttrCol::SetAttr( const SCROW nRow, const ScPatternAttr& rAttr )
{
// Actually with the current implementation of MAXROWCOUNT>=64k and nRow
// being read as sal_uInt16 there's no chance that nRow would be invalid..
DBG_ASSERT( ValidRow(nRow), "*LotAttrCol::SetAttr(): ... und rums?!" );
ENTRY* pAkt = ( ENTRY* ) List::Last();
......@@ -275,6 +277,9 @@ LotAttrTable::~LotAttrTable()
void LotAttrTable::SetAttr( const SCCOL nColFirst, const SCCOL nColLast, const SCROW nRow,
const LotAttrWK3& rAttr )
{
// With the current implementation of MAXCOLCOUNT>=1024 and nColFirst and
// nColLast being calculated as sal_uInt8+sal_uInt8 there's no chance that
// they would be invalid.
const ScPatternAttr& rPattAttr = aAttrCache.GetPattAttr( rAttr );
SCCOL nColCnt;
......
......@@ -121,7 +121,8 @@ void LotusToSc::DoFunc( DefTokenId eOc, sal_uInt8 nAnz, const sal_Char* pExtStri
break;
case ocChose:
{// 1. Parameter ++
IncToken( eParam[ nAnz - 1 ] );
if (nAnz >= 1)
IncToken( eParam[ nAnz - 1 ] );
}
break;
case ocFind:
......@@ -134,7 +135,8 @@ void LotusToSc::DoFunc( DefTokenId eOc, sal_uInt8 nAnz, const sal_Char* pExtStri
case ocMid:
case ocReplace:
{// 2. Parameter ++
IncToken( eParam[ nAnz - 2 ] );
if (nAnz >= 2)
IncToken( eParam[ nAnz - 2 ] );
}
break;
case ocZins:
......@@ -604,14 +606,18 @@ ConvErr LotusToSc::Convert( const ScTokenArray*& rpErg, sal_Int32& rRest,
if( nStrLen )
{
// String t( ReadString( aIn, nStrLen, eSrcChar ) );
sal_Char* p = new sal_Char[ nStrLen + 1 ];
aIn.Read( p, nStrLen );
p[ nStrLen ] = 0x00;
sal_Char* p = new (::std::nothrow) sal_Char[ nStrLen + 1 ];
if (p)
{
aIn.Read( p, nStrLen );
p[ nStrLen ] = 0x00;
DoFunc( ocNoName, nAnz, p );
DoFunc( ocNoName, nAnz, p );
delete[] p;
delete[] p;
}
else
DoFunc( ocNoName, nAnz, NULL );
}
else
DoFunc( ocNoName, nAnz, NULL );
......@@ -1991,7 +1997,7 @@ const sal_Char* GetAddInName( const sal_uInt8 n )
}
DefTokenId lcl_KnownAddIn( const ByteString& sTest )
static DefTokenId lcl_KnownAddIn( const ByteString& sTest )
{
DefTokenId eId = ocNoName;
......
......@@ -46,6 +46,29 @@
static vos:: OMutex aLotImpSemaphore;
LOTUS_ROOT::LOTUS_ROOT( ScDocument* pDocP, CharSet eQ )
:
pDoc( pDocP),
pRangeNames( new LotusRangeList),
pScRangeName( pDocP->GetRangeName()),
eCharsetQ( eQ),
eFirstType( Lotus_X),
eActType( Lotus_X),
pRngNmBffWK3( new RangeNameBufferWK3),
pFontBuff( new LotusFontBuffer),
pAttrTable( new LotAttrTable)
{
}
LOTUS_ROOT::~LOTUS_ROOT()
{
delete pRangeNames;
delete pRngNmBffWK3;
delete pFontBuff;
delete pAttrTable;
}
ImportLotus::ImportLotus( SvStream& aStream, ScDocument* pDoc, CharSet eQ ) :
ImportTyp( pDoc, eQ ),
......@@ -55,30 +78,14 @@ ImportLotus::ImportLotus( SvStream& aStream, ScDocument* pDoc, CharSet eQ ) :
// good point to start locking of import lotus
aLotImpSemaphore.acquire();
pLotusRoot = new LOTUS_ROOT;
pLotusRoot->pDoc = pDoc;
pLotusRoot->pRangeNames = new LotusRangeList;
pLotusRoot->pScRangeName = pDoc->GetRangeName();
pLotusRoot->eCharsetQ = eQ;
pLotusRoot->eFirstType = Lotus_X;
pLotusRoot->eActType = Lotus_X;
pLotusRoot->pRngNmBffWK3 = new RangeNameBufferWK3;
pFontBuff = pLotusRoot->pFontBuff = new LotusFontBuffer;
pLotusRoot->pAttrTable = new LotAttrTable;
pLotusRoot = new LOTUS_ROOT( pDoc, eQ);
}
ImportLotus::~ImportLotus()
{
delete pLotusRoot->pRangeNames;
delete pLotusRoot->pRngNmBffWK3;
delete pFontBuff;
delete pLotusRoot->pAttrTable;
delete pLotusRoot;
#ifdef DBG_UTIL
pLotusRoot = NULL;
#endif
// no need 4 pLotusRoot anymore
aLotImpSemaphore.release();
......@@ -129,7 +136,7 @@ void ImportLotus::Columnwidth( sal_uInt16 nRecLen )
DBG_ASSERT( nRecLen >= 4, "*ImportLotus::Columnwidth(): Record zu kurz!" );
sal_uInt8 nLTab, nWindow2;
sal_uInt16 nCnt = ( nRecLen - 4 ) / 2;
sal_uInt16 nCnt = (nRecLen < 4) ? 0 : ( nRecLen - 4 ) / 2;
Read( nLTab );
Read( nWindow2 );
......@@ -161,7 +168,7 @@ void ImportLotus::Hiddencolumn( sal_uInt16 nRecLen )
DBG_ASSERT( nRecLen >= 4, "*ImportLotus::Hiddencolumn(): Record zu kurz!" );
sal_uInt8 nLTab, nWindow2;
sal_uInt16 nCnt = ( nRecLen - 4 ) / 2;
sal_uInt16 nCnt = (nRecLen < 4) ? 0 : ( nRecLen - 4 ) / 2;
Read( nLTab );
Read( nWindow2 );
......@@ -187,18 +194,17 @@ void ImportLotus::Userrange( void )
{
sal_uInt16 nRangeType;
ScRange aScRange;
sal_Char* pBuffer = new sal_Char[ 32 ];
Read( nRangeType );
pIn->Read( pBuffer, 16 );
pBuffer[ 16 ] = ( sal_Char ) 0x00; // zur Sicherheit...
String aName( pBuffer, eQuellChar );
sal_Char aBuffer[ 17 ];
pIn->Read( aBuffer, 16 );
aBuffer[ 16 ] = 0;
String aName( aBuffer, eQuellChar );
Read( aScRange );
pLotusRoot->pRngNmBffWK3->Add( aName, aScRange );
delete[] pBuffer;
}
......@@ -239,7 +245,7 @@ void ImportLotus::Labelcell( void )
void ImportLotus::Numbercell( void )
{
{
ScAddress aAddr;
double fVal;
......@@ -248,11 +254,11 @@ void ImportLotus::Numbercell( void )
pD->PutCell( aAddr.Col(), aAddr.Row(), aAddr.Tab(),
new ScValueCell( fVal ), (sal_Bool)sal_True );
}
}
void ImportLotus::Smallnumcell( void )
{
{
ScAddress aAddr;
sal_Int16 nVal;
......@@ -261,11 +267,11 @@ void ImportLotus::Smallnumcell( void )
pD->PutCell( aAddr.Col(), aAddr.Row(), aAddr.Tab(),
new ScValueCell( SnumToDouble( nVal ) ), ( sal_Bool ) sal_True );
}
}
ScFormulaCell *ImportLotus::Formulacell( sal_uInt16 n )
{
{
DBG_ASSERT( pIn, "-ImportLotus::Formulacell(): Null-Stream -> Rums!" );
ScAddress aAddr;
......@@ -273,7 +279,7 @@ ScFormulaCell *ImportLotus::Formulacell( sal_uInt16 n )
Read( aAddr );
Skip( 10 );
n -= 14;
n -= (n > 14) ? 14 : n;
const ScTokenArray* pErg;
sal_Int32 nRest = n;
......@@ -289,7 +295,7 @@ ScFormulaCell *ImportLotus::Formulacell( sal_uInt16 n )
pD->PutCell( aAddr.Col(), aAddr.Row(), aAddr.Tab(), pZelle, (sal_Bool)sal_True );
return NULL;
}
}
void ImportLotus::Read( String &r )
......@@ -304,7 +310,7 @@ void ImportLotus::RowPresentation( sal_uInt16 nRecLen )
sal_uInt8 nLTab, nFlags;
sal_uInt16 nRow, nHeight;
sal_uInt16 nCnt = ( nRecLen - 4 ) / 8;
sal_uInt16 nCnt = (nRecLen < 4) ? 0 : ( nRecLen - 4 ) / 8;
Read( nLTab );
Skip( 1 );
......@@ -355,52 +361,44 @@ void ImportLotus::Font_Face( void )
Read( nNum );
// ACHTUNG: QUICK-HACK gegen unerklaerliche Loops
if( nNum > 7 )
return;
// ACHTUNG
if( nNum >= LotusFontBuffer::nSize )
return; // nonsense
Read( aName );
pFontBuff->SetName( nNum, aName );
pLotusRoot->pFontBuff->SetName( nNum, aName );
}
void ImportLotus::Font_Type( void )
{
static const sal_uInt16 nAnz = 8;
sal_uInt16 nCnt;
sal_uInt16 nType;
for( nCnt = 0 ; nCnt < nAnz ; nCnt++ )
for( sal_uInt16 nCnt = 0 ; nCnt < LotusFontBuffer::nSize ; nCnt++ )
{
sal_uInt16 nType;
Read( nType );
pFontBuff->SetType( nCnt, nType );
pLotusRoot->pFontBuff->SetType( nCnt, nType );
}
}
void ImportLotus::Font_Ysize( void )
{
static const sal_uInt16 nAnz = 8;
sal_uInt16 nCnt;
sal_uInt16 nSize;
for( nCnt = 0 ; nCnt < nAnz ; nCnt++ )
for( sal_uInt16 nCnt = 0 ; nCnt < LotusFontBuffer::nSize ; nCnt++ )
{
sal_uInt16 nSize;
Read( nSize );
pFontBuff->SetHeight( nCnt, nSize );
pLotusRoot->pFontBuff->SetHeight( nCnt, nSize );
}
}
void ImportLotus::_Row( const sal_uInt16 nRecLen )
{
{
DBG_ASSERT( nExtTab >= 0, "*ImportLotus::_Row(): Kann hier nicht sein!" );
sal_uInt16 nRow;
sal_uInt16 nHeight;
sal_uInt16 nCntDwn = ( nRecLen - 4 ) / 5;
sal_uInt16 nCntDwn = (nRecLen < 4) ? 0 : ( nRecLen - 4 ) / 5;
SCCOL nColCnt = 0;
sal_uInt8 nRepeats;
LotAttrWK3 aAttr;
......@@ -464,6 +462,4 @@ void ImportLotus::_Row( const sal_uInt16 nRecLen )
if( bCenter )
// evtl. alte Center bemachen
pD->DoMerge( static_cast<SCTAB> (nExtTab), nCenterStart, static_cast<SCROW> (nRow), nCenterEnd, static_cast<SCROW> (nRow) );
}
}
......@@ -73,7 +73,7 @@ FltError ImportLotus::Read()
{
*pIn >> nOp >> nRecLen;
if( pIn->IsEof() )
if( pIn->IsEof() || nNextRec > SAL_MAX_UINT32 - nRecLen - 4 )
eAkt = S_END;
nNextRec += nRecLen + 4;
......@@ -168,17 +168,25 @@ FltError ImportLotus::Read()
break;
case 0x001b: // extended attributes
Read( nSubType );
nRecLen -= 2;
switch( nSubType )
if (nRecLen > 2)
{
case 2007: // ROW PRESENTATION
RowPresentation( nRecLen );
break;
Read( nSubType );
nRecLen -= 2;
switch( nSubType )
{
case 2007: // ROW PRESENTATION
RowPresentation( nRecLen );
break;
case 14000: // NAMED SHEET
NamedSheet();
break;
case 14000: // NAMED SHEET
NamedSheet();
break;
}
}
else
{
eRet = eERR_FORMAT;
eAkt = S_END;
}
}
......@@ -189,12 +197,6 @@ FltError ImportLotus::Read()
// -----------------------------------------------------------
case S_END: // S_END
break;
// -----------------------------------------------------------
#ifdef DBG_UTIL
default:
DBG_ERROR( "*ImportLotus::Read(): State unbekannt!" );
eAkt = S_END;
#endif
}
DBG_ASSERT( nNextRec >= pIn->Tell(),
......@@ -259,7 +261,7 @@ FltError ImportLotus::Read( SvStream& rIn )
{
*pIn >> nOp >> nRecLen;
if( pIn->IsEof() )
if( pIn->IsEof() || nNextRec > SAL_MAX_UINT32 - nRecLen - 4 )
bRead = sal_False;
else
{
......
......@@ -37,38 +37,10 @@
#include "decl.h"
#include "tool.h"
extern const long nStackSize;
extern const int nAnzNRange;
extern ScDocument* pDoc;
const long nStackSize = 8L * 1024; // -> form_xxx.cpp
const int nAnzNRange = 2048; // -> tool_xxx.cpp, max. 2048 Named Ranges
sal_Char* pPuffer; // -> flt_xxx.cxx
sal_Char* pDummy1; // -> flt_xxx.cxx, ScanVersion()
sal_Char* pDummy2; // -> tool.cxx, CreateTable()
extern sal_uInt8* pFormelBuffer; // -> tool.cxx, fuer OP_Formula()
sal_uInt8* pFormelBuffer;
extern FormCache* pValueFormCache; // -> tool.cxx
sal_Char* pStack; // -> formel.cxx
sal_Char* pPuffer0; // -> formel.cxx
sal_Char* pPuffer1; // -> formel.cxx
extern const int nMaxPar;
const int nMaxPar = 128; // max. 128 Parameter werden unterstuetzt
sal_Char** pPar; // -> formel.cxx, Pn()
#ifndef _DOS // -> op.cxx
sal_Char* pAnsi;
#endif
sal_Char* pErgebnis; // -> op.cxx
extern sal_Bool bFormInit; // -> tool.cxx, fuer GetFormHandle()
sal_Bool bFormInit;
extern SvxHorJustifyItem *pAttrRight, *pAttrLeft, *pAttrCenter,
*pAttrRepeat, *pAttrStandard; // -> tool.cxx, fuer GetFormAttr()
extern ScProtectionAttr* pAttrUnprot; // -> tool.cxx, fuer PutFormString()
......@@ -77,25 +49,6 @@ extern ScProtectionAttr* pAttrUnprot; // -> tool.cxx, fuer PutFormString()
sal_Bool MemNew( void )
{
pPuffer = new sal_Char [ 32L*1024L ];
pDummy1 = new sal_Char [ 32 ];
pDummy2 = new sal_Char [ 32 ];
pStack = new sal_Char [ nStackSize * 3 ]; // alle drei auf einmal
pPuffer0 = pStack + nStackSize;
pPuffer1 = pPuffer0 + nStackSize;
pAnsi = new sal_Char [ 2048 ];
pErgebnis = new sal_Char [ 32L*1024L ];
pPar = new sal_Char *[ nMaxPar ];
pFormelBuffer = new sal_uInt8[ 4096 ];
pValueFormCache = new FormCache( pDoc );
// fuer tool.cxx::PutFormString()
......@@ -105,7 +58,6 @@ sal_Bool MemNew( void )
pAttrCenter = new SvxHorJustifyItem( SVX_HOR_JUSTIFY_CENTER, ATTR_HOR_JUSTIFY );
pAttrRepeat = new SvxHorJustifyItem( SVX_HOR_JUSTIFY_REPEAT, ATTR_HOR_JUSTIFY );
pAttrStandard = new SvxHorJustifyItem( SVX_HOR_JUSTIFY_STANDARD, ATTR_HOR_JUSTIFY );
bFormInit = sal_True;
return sal_True;
}
......@@ -113,15 +65,6 @@ sal_Bool MemNew( void )
void MemDelete( void )
{
delete[] pPuffer;
delete[] pDummy1;
delete[] pDummy2;
delete[] pStack;
delete[] pAnsi;
delete[] pErgebnis;
delete[] pPar;
delete[] pFormelBuffer;
delete pValueFormCache;
delete pAttrRight;
delete pAttrLeft;
......
This diff is collapsed.
......@@ -52,11 +52,7 @@
//--------------------------------------------------------- EXTERNE VARIABLEN -
extern WKTYP eTyp; // -> filter.cxx, aktueller Dateityp
extern sal_Char* pDummy2; // -> memory.cxx
extern ScDocument* pDoc; // -> filter.cxx, Aufhaenger zum Dokumentzugriff
extern CharSet eCharNach; // -> filter.cxx, Zeichenkonvertierung von->nach
extern sal_Bool bFormInit; // -> memory.cxx, fuer GetFormHandle()
//--------------------------------------------------------- GLOBALE VARIABLEN -
sal_uInt8 nDefaultFormat; // -> op.cpp, Standard-Zellenformat
......@@ -82,6 +78,8 @@ void PutFormString( SCCOL nCol, SCROW nRow, SCTAB nTab, sal_Char* pString )
{
// Label-Format-Auswertung
DBG_ASSERT( pString != NULL, "PutFormString(): pString == NULL" );
if (!pString)
return;
sal_Char cForm;
SvxHorJustifyItem* pJustify = NULL;
......@@ -113,12 +111,9 @@ void PutFormString( SCCOL nCol, SCROW nRow, SCTAB nTab, sal_Char* pString )
pJustify = pAttrStandard;
}
if( pString )
{
pDoc->ApplyAttr( nCol, nRow, nTab, *pJustify );
ScStringCell* pZelle = new ScStringCell( String( pString, pLotusRoot->eCharsetQ ) );
pDoc->PutCell( nCol, nRow, nTab, pZelle, ( sal_Bool ) sal_True );
}
pDoc->ApplyAttr( nCol, nRow, nTab, *pJustify );
ScStringCell* pZelle = new ScStringCell( String( pString, pLotusRoot->eCharsetQ ) );
pDoc->PutCell( nCol, nRow, nTab, pZelle, ( sal_Bool ) sal_True );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment