allow XML style references in formulas

This commit is contained in:
Niklas Nebel 2000-11-01 16:28:31 +00:00
parent c43126f8ff
commit 239ec7e6a5
4 changed files with 28 additions and 22 deletions

View file

@ -2,9 +2,9 @@
*
* $RCSfile: conditio.hxx,v $
*
* $Revision: 1.1.1.1 $
* $Revision: 1.2 $
*
* last change: $Author: hr $ $Date: 2000-09-18 16:44:48 $
* last change: $Author: nn $ $Date: 2000-11-01 17:27:40 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@ -131,7 +131,7 @@ class ScConditionEntry
BOOL bFirstRun;
void MakeCells( const ScAddress& rPos );
void Compile( const String& rExpr1, const String& rExpr2, BOOL bEnglish );
void Compile( const String& rExpr1, const String& rExpr2, BOOL bEnglish, BOOL bCompileXML );
void Interpret( const ScAddress& rPos );
BOOL IsValid( double nArg ) const;
@ -146,7 +146,7 @@ public:
ScConditionEntry( ScConditionMode eOper,
const String& rExpr1, const String& rExpr2,
ScDocument* pDocument, const ScAddress& rPos,
BOOL bCompileEnglish );
BOOL bCompileEnglish, BOOL bCompileXML );
ScConditionEntry( ScConditionMode eOper,
const ScTokenArray* pArr1, const ScTokenArray* pArr2,
ScDocument* pDocument, const ScAddress& rPos );
@ -164,8 +164,8 @@ public:
void SetIgnoreBlank(BOOL bSet);
ScAddress GetSrcPos() const { return aSrcPos; }
String GetExpression( const ScAddress& rCursor, USHORT nPos,
ULONG nNumFmt = 0, BOOL bEnglish = FALSE ) const;
String GetExpression( const ScAddress& rCursor, USHORT nPos, ULONG nNumFmt = 0,
BOOL bEnglish = FALSE, BOOL bCompileXML = FALSE ) const;
ScTokenArray* CreateTokenArry( USHORT nPos ) const;
@ -196,7 +196,8 @@ public:
ScCondFormatEntry( ScConditionMode eOper,
const String& rExpr1, const String& rExpr2,
ScDocument* pDocument, const ScAddress& rPos,
const String& rStyle, BOOL bCompileEnglish = FALSE );
const String& rStyle,
BOOL bCompileEnglish = FALSE, BOOL bCompileXML = FALSE );
ScCondFormatEntry( ScConditionMode eOper,
const ScTokenArray* pArr1, const ScTokenArray* pArr2,
ScDocument* pDocument, const ScAddress& rPos,

View file

@ -2,9 +2,9 @@
*
* $RCSfile: validat.hxx,v $
*
* $Revision: 1.1.1.1 $
* $Revision: 1.2 $
*
* last change: $Author: hr $ $Date: 2000-09-18 16:44:50 $
* last change: $Author: nn $ $Date: 2000-11-01 17:24:45 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@ -114,7 +114,7 @@ public:
ScValidationData( ScValidationMode eMode, ScConditionMode eOper,
const String& rExpr1, const String& rExpr2,
ScDocument* pDocument, const ScAddress& rPos,
BOOL bCompileEnglish = FALSE );
BOOL bCompileEnglish = FALSE, BOOL bCompileXML = FALSE );
ScValidationData( const ScValidationData& r );
ScValidationData( ScDocument* pDocument, const ScValidationData& r );
ScValidationData( SvStream& rStream, ScMultipleReadHeader& rHdr,

View file

@ -2,9 +2,9 @@
*
* $RCSfile: conditio.cxx,v $
*
* $Revision: 1.1.1.1 $
* $Revision: 1.2 $
*
* last change: $Author: hr $ $Date: 2000-09-19 00:16:14 $
* last change: $Author: nn $ $Date: 2000-11-01 17:28:31 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@ -168,7 +168,7 @@ ScConditionEntry::ScConditionEntry( ScDocument* pDocument, const ScConditionEntr
ScConditionEntry::ScConditionEntry( ScConditionMode eOper,
const String& rExpr1, const String& rExpr2,
ScDocument* pDocument, const ScAddress& rPos,
BOOL bCompileEnglish ) :
BOOL bCompileEnglish, BOOL bCompileXML ) :
eOp(eOper),
nOptions(0), // spaeter...
nVal1(0.0),
@ -185,7 +185,7 @@ ScConditionEntry::ScConditionEntry( ScConditionMode eOper,
aSrcPos(rPos),
bFirstRun(TRUE)
{
Compile( rExpr1, rExpr2, bCompileEnglish );
Compile( rExpr1, rExpr2, bCompileEnglish, bCompileXML );
// Formelzellen werden erst bei IsValid angelegt
}
@ -383,12 +383,14 @@ void ScConditionEntry::StoreCondition(SvStream& rStream, ScMultipleWriteHeader&
rHdr.EndEntry();
}
void ScConditionEntry::Compile( const String& rExpr1, const String& rExpr2, BOOL bEnglish )
void ScConditionEntry::Compile( const String& rExpr1, const String& rExpr2,
BOOL bEnglish, BOOL bCompileXML )
{
if ( rExpr1.Len() || rExpr2.Len() )
{
ScCompiler aComp( pDoc, aSrcPos );
aComp.SetCompileEnglish( bEnglish );
aComp.SetCompileXML( bCompileXML );
if ( rExpr1.Len() )
{
@ -842,7 +844,7 @@ BOOL ScConditionEntry::IsCellValid( ScBaseCell* pCell, const ScAddress& rPos ) c
}
String ScConditionEntry::GetExpression( const ScAddress& rCursor, USHORT nIndex,
ULONG nNumFmt, BOOL bEnglish ) const
ULONG nNumFmt, BOOL bEnglish, BOOL bCompileXML ) const
{
String aRet;
@ -855,6 +857,7 @@ String ScConditionEntry::GetExpression( const ScAddress& rCursor, USHORT nIndex,
{
ScCompiler aComp(pDoc, rCursor, *pFormula1);
aComp.SetCompileEnglish( bEnglish );
aComp.SetCompileXML( bCompileXML );
aComp.CreateStringFromTokenArray( aRet );
}
else if (bIsStr1)
@ -872,6 +875,7 @@ String ScConditionEntry::GetExpression( const ScAddress& rCursor, USHORT nIndex,
{
ScCompiler aComp(pDoc, rCursor, *pFormula2);
aComp.SetCompileEnglish( bEnglish );
aComp.SetCompileXML( bCompileXML );
aComp.CreateStringFromTokenArray( aRet );
}
else if (bIsStr2)
@ -1016,8 +1020,9 @@ void ScConditionEntry::DataChanged( const ScRange* pModified ) const
ScCondFormatEntry::ScCondFormatEntry( ScConditionMode eOper,
const String& rExpr1, const String& rExpr2,
ScDocument* pDocument, const ScAddress& rPos,
const String& rStyle, BOOL bCompileEnglish ) :
ScConditionEntry( eOper, rExpr1, rExpr2, pDocument, rPos, bCompileEnglish ),
const String& rStyle,
BOOL bCompileEnglish, BOOL bCompileXML ) :
ScConditionEntry( eOper, rExpr1, rExpr2, pDocument, rPos, bCompileEnglish, bCompileXML ),
aStyleName( rStyle ),
pParent( NULL )
{

View file

@ -2,9 +2,9 @@
*
* $RCSfile: validat.cxx,v $
*
* $Revision: 1.1.1.1 $
* $Revision: 1.2 $
*
* last change: $Author: hr $ $Date: 2000-09-19 00:16:16 $
* last change: $Author: nn $ $Date: 2000-11-01 17:28:31 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@ -103,8 +103,8 @@ SV_IMPL_OP_PTRARR_SORT( ScValidationEntries_Impl, ScValidationDataPtr );
ScValidationData::ScValidationData( ScValidationMode eMode, ScConditionMode eOper,
const String& rExpr1, const String& rExpr2,
ScDocument* pDocument, const ScAddress& rPos,
BOOL bCompileEnglish ) :
ScConditionEntry( eOper, rExpr1, rExpr2, pDocument, rPos, bCompileEnglish ),
BOOL bCompileEnglish, BOOL bCompileXML ) :
ScConditionEntry( eOper, rExpr1, rExpr2, pDocument, rPos, bCompileEnglish, bCompileXML ),
nKey( 0 ),
eDataMode( eMode )
{