summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorWinfried Donkers <winfrieddonkers@libreoffice.org>2014-08-08 17:39:04 +0200
committerCaolán McNamara <caolanm@redhat.com>2015-02-17 13:21:27 +0000
commit1706760769018662a50b494b2e4a0ca85c93ca42 (patch)
tree89becfaa1e14803339936e4f6ef9b19a303a59a5 /include
parent2575d7cb9c514bee71520f795a9a2f148c1e02c3 (diff)
fdo#81596 export to OOXML that need argument changes
Reviewed-on: https://gerrit.libreoffice.org/10831 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com> (cherry picked from commit 4feaf96f50fa89eccb4e7a638220099e9a8482f1) sensible indenting, fdo#81596 related (cherry picked from commit 3dd241c52d6db424bd4696ff8f223976542e411b) simplify RewriteMissing() and switch in Add...(), fdo#81596 related (cherry picked from commit 14aabee5a73e57e26b2062b1ebf00c3f1dff1250) write TRUE() for 2nd IF() parameter, fdo#81596 related (cherry picked from commit 8f031861f590ba914321816657a003375d93ef5d) f7eb11a950b45793d04837d02f9546a93673fa2f f2ca37e1fda87ce56282fc2d2fc57a0784851139 52d0b43b19e10bee82109b635b3b7ce4f43650a3 Change-Id: I3a99e416be9f3f04175939e4560f8f7c55497185 Reviewed-on: https://gerrit.libreoffice.org/14388 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/formula/tokenarray.hxx47
1 files changed, 39 insertions, 8 deletions
diff --git a/include/formula/tokenarray.hxx b/include/formula/tokenarray.hxx
index c6433aa43b07..ceb84253f246 100644
--- a/include/formula/tokenarray.hxx
+++ b/include/formula/tokenarray.hxx
@@ -55,12 +55,39 @@ class FormulaMissingContext;
class FORMULA_DLLPUBLIC MissingConvention
{
- bool mbODFF; /// TRUE: ODFF, FALSE: PODF
public:
- explicit MissingConvention( bool bODFF ) : mbODFF(bODFF) {}
+ enum Convention
+ {
+ FORMULA_MISSING_CONVENTION_PODF,
+ FORMULA_MISSING_CONVENTION_ODFF,
+ FORMULA_MISSING_CONVENTION_OOXML
+ };
+ explicit MissingConvention( Convention eConvention ) : meConvention(eConvention) {}
+ inline bool isPODF() const { return meConvention == FORMULA_MISSING_CONVENTION_PODF; }
+ inline Convention getConvention() const { return meConvention; }
+private:
+ Convention meConvention;
+};
+
+class FORMULA_DLLPUBLIC MissingConventionODF : public MissingConvention
+{
+public:
+ explicit MissingConventionODF( bool bODFF ) :
+ MissingConvention( bODFF ?
+ MissingConvention::FORMULA_MISSING_CONVENTION_ODFF :
+ MissingConvention::FORMULA_MISSING_CONVENTION_PODF)
+ {
+ }
+ // Implementation and usage only in token.cxx
+ inline bool isRewriteNeeded( OpCode eOp ) const;
+};
+
+class FORMULA_DLLPUBLIC MissingConventionOOXML : public MissingConvention
+{
+public:
+ explicit MissingConventionOOXML() : MissingConvention( MissingConvention::FORMULA_MISSING_CONVENTION_OOXML) {}
// Implementation and usage only in token.cxx
inline bool isRewriteNeeded( OpCode eOp ) const;
- inline bool isODFF() const { return mbODFF; }
};
class FORMULA_DLLPUBLIC FormulaTokenArray
@@ -238,15 +265,19 @@ public:
FormulaTokenArray& operator=( const FormulaTokenArray& );
/** Determines if this formula needs any changes to convert it to something
- previous versions of OOo could consume (Plain Old Formula). */
- bool NeedsPofRewrite(const MissingConvention & rConv);
+ previous versions of OOo could consume (Plain Old Formula, pre-ODFF, or
+ also ODFF) */
+ bool NeedsPodfRewrite( const MissingConventionODF & rConv );
+
+ /** Determines if this formula needs any changes to convert it to OOXML. */
+ bool NeedsOoxmlRewrite( const MissingConventionOOXML & rConv );
- /** Rewrites to Plain Old Formula, substituting missing parameters. The
+ /** Rewrites to Plain Old Formula or OOXML, substituting missing parameters. The
FormulaTokenArray* returned is new'ed. */
- FormulaTokenArray* RewriteMissingToPof(const MissingConvention & rConv);
+ FormulaTokenArray* RewriteMissing( const MissingConvention & rConv );
/** Determines if this formula may be followed by a reference. */
- bool MayReferenceFollow();
+ bool MayReferenceFollow();
};
inline OpCode FormulaTokenArray::GetOuterFuncOpCode()