summaryrefslogtreecommitdiff
path: root/include/formula
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2013-10-10 20:24:21 -0400
committerKohei Yoshida <kohei.yoshida@collabora.com>2013-10-11 12:14:27 -0400
commit7333881bb7b04f7e4e2a28638024ae82a9c14e81 (patch)
tree97548f94ab918d502b45a5dda40ece5ad4117617 /include/formula
parent6255be7ca294d350143290c343673f264f42220c (diff)
Formula tokens, formula cells and formula interpreters to use shared strings.
Change-Id: I5da99869fc7f61ce698180fa5daa9be9db9ac132
Diffstat (limited to 'include/formula')
-rw-r--r--include/formula/token.hxx35
1 files changed, 15 insertions, 20 deletions
diff --git a/include/formula/token.hxx b/include/formula/token.hxx
index d9486be9efe9..905be7b5ef90 100644
--- a/include/formula/token.hxx
+++ b/include/formula/token.hxx
@@ -28,6 +28,7 @@
#include "formula/IFunctionDescription.hxx"
#include "formula/formuladllapi.h"
#include "formula/types.hxx"
+#include "svl/sharedstring.hxx"
namespace formula
{
@@ -136,7 +137,7 @@ public:
virtual void SetForceArray( bool b );
virtual double GetDouble() const;
virtual double& GetDoubleAsReference();
- virtual const OUString& GetString() const;
+ virtual svl::SharedString GetString() const;
virtual sal_uInt16 GetIndex() const;
virtual void SetIndex( sal_uInt16 n );
virtual bool IsGlobal() const;
@@ -256,17 +257,14 @@ public:
class FORMULA_DLLPUBLIC FormulaStringToken : public FormulaToken
{
-private:
- OUString aString;
+ svl::SharedString maString;
public:
- FormulaStringToken( const OUString& r ) :
- FormulaToken( svString ), aString( r ) {}
- FormulaStringToken( const FormulaStringToken& r ) :
- FormulaToken( r ), aString( r.aString ) {}
+ FormulaStringToken( const svl::SharedString& r );
+ FormulaStringToken( const FormulaStringToken& r );
- virtual FormulaToken* Clone() const { return new FormulaStringToken(*this); }
- virtual const OUString& GetString() const;
- virtual bool operator==( const FormulaToken& rToken ) const;
+ virtual FormulaToken* Clone() const;
+ virtual svl::SharedString GetString() const;
+ virtual bool operator==( const FormulaToken& rToken ) const;
DECL_FIXEDMEMPOOL_NEWDEL_DLL( FormulaStringToken )
};
@@ -276,17 +274,14 @@ public:
ocPush, and an optional sal_uInt8 for ocBad tokens. */
class FORMULA_DLLPUBLIC FormulaStringOpToken : public FormulaByteToken
{
-private:
- OUString aString;
+ svl::SharedString maString;
public:
- FormulaStringOpToken( OpCode e, const OUString& r ) :
- FormulaByteToken( e, 0, svString, false ), aString( r ) {}
- FormulaStringOpToken( const FormulaStringOpToken& r ) :
- FormulaByteToken( r ), aString( r.aString ) {}
+ FormulaStringOpToken( OpCode e, const svl::SharedString& r );
+ FormulaStringOpToken( const FormulaStringOpToken& r );
- virtual FormulaToken* Clone() const { return new FormulaStringOpToken(*this); }
- virtual const OUString& GetString() const;
- virtual bool operator==( const FormulaToken& rToken ) const;
+ virtual FormulaToken* Clone() const;
+ virtual svl::SharedString GetString() const;
+ virtual bool operator==( const FormulaToken& rToken ) const;
};
class FORMULA_DLLPUBLIC FormulaIndexToken : public FormulaToken
@@ -343,7 +338,7 @@ public:
virtual FormulaToken* Clone() const { return new FormulaMissingToken(*this); }
virtual double GetDouble() const;
- virtual const OUString& GetString() const;
+ virtual svl::SharedString GetString() const;
virtual bool operator==( const FormulaToken& rToken ) const;
};