summaryrefslogtreecommitdiff
path: root/sc/source/filter/lotus/lotform.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/filter/lotus/lotform.cxx')
-rw-r--r--sc/source/filter/lotus/lotform.cxx24
1 files changed, 15 insertions, 9 deletions
diff --git a/sc/source/filter/lotus/lotform.cxx b/sc/source/filter/lotus/lotform.cxx
index 6fbd929bed0f..c67b50accbbc 100644
--- a/sc/source/filter/lotus/lotform.cxx
+++ b/sc/source/filter/lotus/lotform.cxx
@@ -120,7 +120,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:
@@ -133,7 +134,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:
@@ -602,14 +604,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 );
@@ -1989,7 +1995,7 @@ const sal_Char* GetAddInName( const sal_uInt8 n )
}
-DefTokenId lcl_KnownAddIn( const rtl::OString& rTest )
+static DefTokenId lcl_KnownAddIn( const rtl::OString& rTest )
{
DefTokenId eId = ocNoName;