[Libreoffice-commits] core.git: 2 commits - formula/source include/formula sc/inc sc/source
Eike Rathke
erack at redhat.com
Wed Nov 18 12:03:13 PST 2015
formula/source/core/api/FormulaCompiler.cxx | 6 +--
formula/source/core/api/token.cxx | 36 ++++++++++----------
include/formula/token.hxx | 50 ++++++++++++++--------------
sc/inc/compiler.hxx | 4 +-
sc/source/core/inc/interpre.hxx | 4 +-
sc/source/core/tool/interpr4.cxx | 2 -
sc/source/core/tool/token.cxx | 4 +-
7 files changed, 53 insertions(+), 53 deletions(-)
New commits:
commit eedcc2c45c09e3180061ae1dfa0eb9d64afc3f39
Author: Eike Rathke <erack at redhat.com>
Date: Wed Nov 18 20:57:49 2015 +0100
cosmetics
Change-Id: Ic06bef4c80426b97a2613fe296ae0aa0ee55a215
diff --git a/formula/source/core/api/token.cxx b/formula/source/core/api/token.cxx
index 2716271..d46b02d 100644
--- a/formula/source/core/api/token.cxx
+++ b/formula/source/core/api/token.cxx
@@ -331,10 +331,10 @@ bool FormulaToken::TextEqual( const FormulaToken& rToken ) const
-sal_uInt8 FormulaByteToken::GetByte() const { return nByte; }
-void FormulaByteToken::SetByte( sal_uInt8 n ) { nByte = n; }
-bool FormulaByteToken::IsInForceArray() const { return bIsInForceArray; }
-void FormulaByteToken::SetInForceArray( bool b ) { bIsInForceArray = b; }
+sal_uInt8 FormulaByteToken::GetByte() const { return nByte; }
+void FormulaByteToken::SetByte( sal_uInt8 n ) { nByte = n; }
+bool FormulaByteToken::IsInForceArray() const { return bIsInForceArray; }
+void FormulaByteToken::SetInForceArray( bool b ) { bIsInForceArray = b; }
bool FormulaByteToken::operator==( const FormulaToken& r ) const
{
return FormulaToken::operator==( r ) && nByte == r.GetByte() &&
@@ -342,16 +342,16 @@ bool FormulaByteToken::operator==( const FormulaToken& r ) const
}
-FormulaToken* FormulaFAPToken::GetFAPOrigToken() const { return pOrigToken.get(); }
+FormulaToken* FormulaFAPToken::GetFAPOrigToken() const { return pOrigToken.get(); }
bool FormulaFAPToken::operator==( const FormulaToken& r ) const
{
return FormulaByteToken::operator==( r ) && pOrigToken == r.GetFAPOrigToken();
}
-short* FormulaJumpToken::GetJump() const { return pJump; }
-bool FormulaJumpToken::IsInForceArray() const { return bIsInForceArray; }
-void FormulaJumpToken::SetInForceArray( bool b ) { bIsInForceArray = b; }
+short* FormulaJumpToken::GetJump() const { return pJump; }
+bool FormulaJumpToken::IsInForceArray() const { return bIsInForceArray; }
+void FormulaJumpToken::SetInForceArray( bool b ) { bIsInForceArray = b; }
bool FormulaJumpToken::operator==( const FormulaToken& r ) const
{
return FormulaToken::operator==( r ) && pJump[0] == r.GetJump()[0] &&
@@ -1686,9 +1686,9 @@ bool FormulaIndexToken::operator==( const FormulaToken& r ) const
return FormulaToken::operator==( r ) && nIndex == r.GetIndex() &&
mbGlobal == r.IsGlobal();
}
-const OUString& FormulaExternalToken::GetExternal() const { return aExternal; }
-sal_uInt8 FormulaExternalToken::GetByte() const { return nByte; }
-void FormulaExternalToken::SetByte( sal_uInt8 n ) { nByte = n; }
+const OUString& FormulaExternalToken::GetExternal() const { return aExternal; }
+sal_uInt8 FormulaExternalToken::GetByte() const { return nByte; }
+void FormulaExternalToken::SetByte( sal_uInt8 n ) { nByte = n; }
bool FormulaExternalToken::operator==( const FormulaToken& r ) const
{
return FormulaToken::operator==( r ) && nByte == r.GetByte() &&
@@ -1696,8 +1696,8 @@ bool FormulaExternalToken::operator==( const FormulaToken& r ) const
}
-sal_uInt16 FormulaErrorToken::GetError() const { return nError; }
-void FormulaErrorToken::SetError( sal_uInt16 nErr ) { nError = nErr; }
+sal_uInt16 FormulaErrorToken::GetError() const { return nError; }
+void FormulaErrorToken::SetError( sal_uInt16 nErr ) { nError = nErr; }
bool FormulaErrorToken::operator==( const FormulaToken& r ) const
{
return FormulaToken::operator==( r ) &&
diff --git a/include/formula/token.hxx b/include/formula/token.hxx
index 2dd8f8c..f2a93b6 100644
--- a/include/formula/token.hxx
+++ b/include/formula/token.hxx
@@ -126,8 +126,8 @@ public:
const_cast<FormulaToken*>(this)->Delete();
}
- inline oslInterlockedCount GetRef() const { return mnRefCnt; }
- inline OpCode GetOpCode() const { return eOp; }
+ inline oslInterlockedCount GetRef() const { return mnRefCnt; }
+ inline OpCode GetOpCode() const { return eOp; }
/**
Dummy methods to avoid switches and casts where possible,
@@ -150,23 +150,23 @@ public:
virtual void SetInForceArray( bool b );
virtual double GetDouble() const;
virtual double& GetDoubleAsReference();
- virtual svl::SharedString GetString() const;
+ virtual svl::SharedString GetString() const;
virtual sal_uInt16 GetIndex() const;
virtual void SetIndex( sal_uInt16 n );
virtual bool IsGlobal() const;
virtual void SetGlobal( bool b );
virtual short* GetJump() const;
- virtual const OUString& GetExternal() const;
+ virtual const OUString& GetExternal() const;
virtual FormulaToken* GetFAPOrigToken() const;
virtual sal_uInt16 GetError() const;
virtual void SetError( sal_uInt16 );
- virtual const ScSingleRefData* GetSingleRef() const;
- virtual ScSingleRefData* GetSingleRef();
+ virtual const ScSingleRefData* GetSingleRef() const;
+ virtual ScSingleRefData* GetSingleRef();
virtual const ScComplexRefData* GetDoubleRef() const;
virtual ScComplexRefData* GetDoubleRef();
- virtual const ScSingleRefData* GetSingleRef2() const;
- virtual ScSingleRefData* GetSingleRef2();
+ virtual const ScSingleRefData* GetSingleRef2() const;
+ virtual ScSingleRefData* GetSingleRef2();
virtual const ScMatrix* GetMatrix() const;
virtual ScMatrix* GetMatrix();
virtual ScJumpMatrix* GetJumpMatrix() const;
commit 270f8ea48b4d4cec8e1d6e37dd5147b8f4d74b34
Author: Eike Rathke <erack at redhat.com>
Date: Wed Nov 18 20:40:56 2015 +0100
rename FormulaToken HasForceArray to IsInForceArray
... to name it was it does and to distinguish from
ScParameterClassification::HasForceArray(OpCode) which IS about a
function having ForceArray parameters.
Change-Id: I8af4e1d0353cdb5ad0a9b837ae0763dc77242734
diff --git a/formula/source/core/api/FormulaCompiler.cxx b/formula/source/core/api/FormulaCompiler.cxx
index 421e829..c4ca443 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -2262,15 +2262,15 @@ void FormulaCompiler::ForceArrayOperator( FormulaTokenRef& rCurr )
if (!(rCurr->GetOpCode() != ocPush && (rCurr->GetType() == svByte || rCurr->GetType() == svJump)))
return;
- if (pCurrentFactorToken->HasForceArray())
+ if (pCurrentFactorToken->IsInForceArray())
{
- rCurr->SetForceArray( true);
+ rCurr->SetInForceArray( true);
return;
}
if (nCurrentFactorParam && IsForceArrayParameter( pCurrentFactorToken.get(),
static_cast<sal_uInt8>(nCurrentFactorParam - 1)))
- rCurr->SetForceArray( true);
+ rCurr->SetInForceArray( true);
}
void FormulaCompiler::CheckSetForceArrayParameter( FormulaTokenRef& rCurr, sal_uInt8 nParam )
diff --git a/formula/source/core/api/token.cxx b/formula/source/core/api/token.cxx
index e7da2bd..2716271 100644
--- a/formula/source/core/api/token.cxx
+++ b/formula/source/core/api/token.cxx
@@ -174,15 +174,15 @@ void FormulaToken::SetByte( sal_uInt8 )
SAL_WARN( "formula.core", "FormulaToken::SetByte: virtual dummy called" );
}
-bool FormulaToken::HasForceArray() const
+bool FormulaToken::IsInForceArray() const
{
// ok to be called for any derived class
return false;
}
-void FormulaToken::SetForceArray( bool )
+void FormulaToken::SetInForceArray( bool )
{
- SAL_WARN( "formula.core", "FormulaToken::SetForceArray: virtual dummy called" );
+ SAL_WARN( "formula.core", "FormulaToken::SetInForceArray: virtual dummy called" );
}
double FormulaToken::GetDouble() const
@@ -333,12 +333,12 @@ bool FormulaToken::TextEqual( const FormulaToken& rToken ) const
sal_uInt8 FormulaByteToken::GetByte() const { return nByte; }
void FormulaByteToken::SetByte( sal_uInt8 n ) { nByte = n; }
-bool FormulaByteToken::HasForceArray() const { return bHasForceArray; }
-void FormulaByteToken::SetForceArray( bool b ) { bHasForceArray = b; }
+bool FormulaByteToken::IsInForceArray() const { return bIsInForceArray; }
+void FormulaByteToken::SetInForceArray( bool b ) { bIsInForceArray = b; }
bool FormulaByteToken::operator==( const FormulaToken& r ) const
{
return FormulaToken::operator==( r ) && nByte == r.GetByte() &&
- bHasForceArray == r.HasForceArray();
+ bIsInForceArray == r.IsInForceArray();
}
@@ -350,13 +350,13 @@ bool FormulaFAPToken::operator==( const FormulaToken& r ) const
short* FormulaJumpToken::GetJump() const { return pJump; }
-bool FormulaJumpToken::HasForceArray() const { return bHasForceArray; }
-void FormulaJumpToken::SetForceArray( bool b ) { bHasForceArray = b; }
+bool FormulaJumpToken::IsInForceArray() const { return bIsInForceArray; }
+void FormulaJumpToken::SetInForceArray( bool b ) { bIsInForceArray = b; }
bool FormulaJumpToken::operator==( const FormulaToken& r ) const
{
return FormulaToken::operator==( r ) && pJump[0] == r.GetJump()[0] &&
memcmp( pJump+1, r.GetJump()+1, pJump[0] * sizeof(short) ) == 0 &&
- bHasForceArray == r.HasForceArray();
+ bIsInForceArray == r.IsInForceArray();
}
FormulaJumpToken::~FormulaJumpToken()
{
diff --git a/include/formula/token.hxx b/include/formula/token.hxx
index 23d9787..2dd8f8c 100644
--- a/include/formula/token.hxx
+++ b/include/formula/token.hxx
@@ -138,16 +138,16 @@ public:
which of course is 0 on non-functions. FormulaByteToken and ScExternal do
override it.
- - HasForceArray() since also this is only used for operators and
- functions and is 0 for other tokens.
+ - IsInForceArray() since also this is only used for operators and
+ functions and is false for other tokens.
Any other non-overridden method pops up an assertion.
*/
virtual sal_uInt8 GetByte() const;
virtual void SetByte( sal_uInt8 n );
- virtual bool HasForceArray() const;
- virtual void SetForceArray( bool b );
+ virtual bool IsInForceArray() const;
+ virtual void SetInForceArray( bool b );
virtual double GetDouble() const;
virtual double& GetDoubleAsReference();
virtual svl::SharedString GetString() const;
@@ -207,30 +207,30 @@ class FORMULA_DLLPUBLIC FormulaByteToken : public FormulaToken
{
private:
sal_uInt8 nByte;
- bool bHasForceArray;
+ bool bIsInForceArray;
protected:
FormulaByteToken( OpCode e, sal_uInt8 n, StackVar v, bool b ) :
FormulaToken( v,e ), nByte( n ),
- bHasForceArray( b ) {}
+ bIsInForceArray( b ) {}
public:
FormulaByteToken( OpCode e, sal_uInt8 n, bool b ) :
FormulaToken( svByte,e ), nByte( n ),
- bHasForceArray( b ) {}
+ bIsInForceArray( b ) {}
FormulaByteToken( OpCode e, sal_uInt8 n ) :
FormulaToken( svByte,e ), nByte( n ),
- bHasForceArray( false ) {}
+ bIsInForceArray( false ) {}
FormulaByteToken( OpCode e ) :
FormulaToken( svByte,e ), nByte( 0 ),
- bHasForceArray( false ) {}
+ bIsInForceArray( false ) {}
FormulaByteToken( const FormulaByteToken& r ) :
FormulaToken( r ), nByte( r.nByte ),
- bHasForceArray( r.bHasForceArray ) {}
+ bIsInForceArray( r.bIsInForceArray ) {}
virtual FormulaToken* Clone() const override { return new FormulaByteToken(*this); }
virtual sal_uInt8 GetByte() const override;
virtual void SetByte( sal_uInt8 n ) override;
- virtual bool HasForceArray() const override;
- virtual void SetForceArray( bool b ) override;
+ virtual bool IsInForceArray() const override;
+ virtual void SetInForceArray( bool b ) override;
virtual bool operator==( const FormulaToken& rToken ) const override;
DECL_FIXEDMEMPOOL_NEWDEL_DLL( FormulaByteToken )
@@ -365,18 +365,18 @@ class FORMULA_DLLPUBLIC FormulaJumpToken : public FormulaToken
{
private:
short* pJump;
- bool bHasForceArray;
+ bool bIsInForceArray;
public:
FormulaJumpToken( OpCode e, short* p ) :
FormulaToken( formula::svJump , e),
- bHasForceArray( false)
+ bIsInForceArray( false)
{
pJump = new short[ p[0] + 1 ];
memcpy( pJump, p, (p[0] + 1) * sizeof(short) );
}
FormulaJumpToken( const FormulaJumpToken& r ) :
FormulaToken( r ),
- bHasForceArray( r.bHasForceArray)
+ bIsInForceArray( r.bIsInForceArray)
{
pJump = new short[ r.pJump[0] + 1 ];
memcpy( pJump, r.pJump, (r.pJump[0] + 1) * sizeof(short) );
@@ -385,8 +385,8 @@ public:
virtual short* GetJump() const override;
virtual bool operator==( const formula::FormulaToken& rToken ) const override;
virtual FormulaToken* Clone() const override { return new FormulaJumpToken(*this); }
- virtual bool HasForceArray() const override;
- virtual void SetForceArray( bool b ) override;
+ virtual bool IsInForceArray() const override;
+ virtual void SetInForceArray( bool b ) override;
};
diff --git a/sc/inc/compiler.hxx b/sc/inc/compiler.hxx
index c563323..3c8a12e 100644
--- a/sc/inc/compiler.hxx
+++ b/sc/inc/compiler.hxx
@@ -104,7 +104,7 @@ public:
double nValue;
struct {
sal_uInt8 cByte;
- bool bHasForceArray;
+ bool bIsInForceArray;
} sbyte;
};
DECL_FIXEDMEMPOOL_NEWDEL( ScDoubleRawToken );
@@ -121,7 +121,7 @@ public:
double nValue;
struct {
sal_uInt8 cByte;
- bool bHasForceArray;
+ bool bIsInForceArray;
} sbyte;
ScComplexRefData aRef;
struct {
diff --git a/sc/source/core/inc/interpre.hxx b/sc/source/core/inc/interpre.hxx
index c35248d..9bdb461 100644
--- a/sc/source/core/inc/interpre.hxx
+++ b/sc/source/core/inc/interpre.hxx
@@ -910,7 +910,7 @@ public:
inline void ScInterpreter::MatrixDoubleRefToMatrix()
{
- if ( (bMatrixFormula || pCur->HasForceArray()) && GetStackType() == formula::svDoubleRef )
+ if ( (bMatrixFormula || pCur->IsInForceArray()) && GetStackType() == formula::svDoubleRef )
{
GetTokenMatrixMap(); // make sure it exists, create if not.
PopDoubleRefPushMatrix();
@@ -919,7 +919,7 @@ inline void ScInterpreter::MatrixDoubleRefToMatrix()
inline bool ScInterpreter::MatrixParameterConversion()
{
- if ( (bMatrixFormula || pCur->HasForceArray() || ScParameterClassification::HasForceArray( pCur->GetOpCode())) &&
+ if ( (bMatrixFormula || pCur->IsInForceArray() || ScParameterClassification::HasForceArray( pCur->GetOpCode())) &&
!pJumpMatrix && sp > 0 )
return ConvertMatrixParameters();
return false;
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index a5f5982..d841422 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -1400,7 +1400,7 @@ bool ScInterpreter::ConvertMatrixParameters()
// has ForceArray or ReferenceOrForceArray
// parameter *somewhere else*) pick a normal
// position dependent implicit intersection later.
- (eType != ScParameterClassification::Value || bMatrixFormula || pCur->HasForceArray()))
+ (eType != ScParameterClassification::Value || bMatrixFormula || pCur->IsInForceArray()))
{
SCCOL nCol1, nCol2;
SCROW nRow1, nRow2;
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index ea66456..7c43d37 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -252,7 +252,7 @@ void ScRawToken::SetOpCode( OpCode e )
default:
eType = svByte;
sbyte.cByte = 0;
- sbyte.bHasForceArray = false;
+ sbyte.bIsInForceArray = false;
}
}
@@ -381,7 +381,7 @@ FormulaToken* ScRawToken::CreateToken() const
switch ( GetType() )
{
case svByte :
- return new FormulaByteToken( eOp, sbyte.cByte, sbyte.bHasForceArray );
+ return new FormulaByteToken( eOp, sbyte.cByte, sbyte.bIsInForceArray );
case svDouble :
IF_NOT_OPCODE_ERROR( ocPush, FormulaDoubleToken);
return new FormulaDoubleToken( nValue );
More information about the Libreoffice-commits
mailing list