summaryrefslogtreecommitdiff
path: root/oox/source/export
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@suse.cz>2011-11-18 18:09:43 +0100
committerLuboš Luňák <l.lunak@suse.cz>2011-11-24 18:43:57 +0100
commite9462ed2d978dc3e641227ea9f553eeed4d81a97 (patch)
tree8b77274817348852458ed19be1bd46bb66d0a749 /oox/source/export
parent1d163e4835b4906eb4559851e5ab2470b26332fe (diff)
ooxml mathml import - first very basic implementation
still needs a number of cleanups (and handling more of course)
Diffstat (limited to 'oox/source/export')
-rw-r--r--oox/source/export/ooxmlexport.cxx75
1 files changed, 75 insertions, 0 deletions
diff --git a/oox/source/export/ooxmlexport.cxx b/oox/source/export/ooxmlexport.cxx
index b4e541cc3a1d..1dfc18645a48 100644
--- a/oox/source/export/ooxmlexport.cxx
+++ b/oox/source/export/ooxmlexport.cxx
@@ -28,6 +28,12 @@
#include <oox/export/ooxmlexport.hxx>
#include <oox/export/starmathimport.hxx>
+#include <oox/token/tokens.hxx>
+#include <oox/token/namespaces.hxx>
+
+using namespace oox;
+using namespace oox::core;
+using namespace com::sun::star;
OoxmlFormulaExportBase::OoxmlFormulaExportBase()
{
@@ -37,4 +43,73 @@ OoxmlFormulaImportBase::OoxmlFormulaImportBase()
{
}
+OoxmlFormulaImportHelper::OoxmlFormulaImportHelper()
+{
+}
+
+
+namespace ooxmlformulaimport
+{
+
+XmlStream::XmlStream()
+: pos( -1 )
+{
+ // make sure our extra bit does not conflict with values used by oox
+ assert( TAG_OPENING > ( 1024 << NMSP_SHIFT ));
+}
+
+bool XmlStream::nextIsEnd() const
+{
+ return pos + 1 >= int( tokens.size());
+}
+
+int XmlStream::getNextToken()
+{
+ ++pos;
+ if( pos < int( tokens.size()))
+ return tokens[ pos ];
+ return XML_TOKEN_INVALID;
+}
+
+int XmlStream::peekNextToken() const
+{
+ if( pos - 1 < int( tokens.size()))
+ return tokens[ pos + 1 ];
+ return XML_TOKEN_INVALID;
+}
+
+AttributeList XmlStream::getAttributes()
+{
+ assert( pos < int( attributes.size()));
+ return attributes[ pos ];
+}
+
+rtl::OUString XmlStream::getCharacters()
+{
+ assert( pos < int( characters.size()));
+ return characters[ pos ];
+}
+
+void XmlStreamBuilder::appendOpeningTag( int token, const uno::Reference< xml::sax::XFastAttributeList >& attrs )
+{
+ tokens.push_back( OPENING( token ));
+ attributes.push_back( AttributeList( attrs ));
+ characters.push_back( rtl::OUString());
+}
+
+void XmlStreamBuilder::appendClosingTag( int token )
+{
+ tokens.push_back( CLOSING( token ));
+ attributes.push_back( AttributeList( uno::Reference< xml::sax::XFastAttributeList >()));
+ characters.push_back( rtl::OUString());
+}
+
+void XmlStreamBuilder::appendCharacters( const rtl::OUString& chars )
+{
+ assert( !characters.empty());
+ characters.back() = chars;
+}
+
+} // namespace
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */