summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--filter/inc/filter/msfilter/ooxmlexport.hxx46
-rw-r--r--starmath/Library_sm.mk2
-rw-r--r--starmath/inc/unomodel.hxx7
-rw-r--r--starmath/source/unomodel.cxx5
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx7
5 files changed, 65 insertions, 2 deletions
diff --git a/filter/inc/filter/msfilter/ooxmlexport.hxx b/filter/inc/filter/msfilter/ooxmlexport.hxx
new file mode 100644
index 000000000000..b8a59e73d8a4
--- /dev/null
+++ b/filter/inc/filter/msfilter/ooxmlexport.hxx
@@ -0,0 +1,46 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * Major Contributor(s):
+ * Copyright (C) 2011 Lubos Lunak <l.lunak@suse.cz> (initial developer)
+ *
+ * All Rights Reserved.
+ *
+ * For minor contributions see the git repository.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+#ifndef _OOXMLEXPORT_HXX
+#define _OOXMLEXPORT_HXX
+
+#include <sax/fshelper.hxx>
+#include "filter/msfilter/msfilterdllapi.h"
+
+/**
+ Interface class, StarMath will implement writeFormulaOoxml() to write out OOXML
+ representing the formula.
+ */
+class MSFILTER_DLLPUBLIC OoxmlFormulaExportBase
+{
+public:
+ virtual void writeFormulaOoxml( ::sax_fastparser::FSHelperPtr m_pSerializer ) = 0;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/starmath/Library_sm.mk b/starmath/Library_sm.mk
index 86e833f00421..20564240e150 100644
--- a/starmath/Library_sm.mk
+++ b/starmath/Library_sm.mk
@@ -47,7 +47,9 @@ $(eval $(call gb_Library_add_linked_libs,sm,\
cppuhelper \
editeng \
i18npaper \
+ msfilter \
sal \
+ sax \
sfx \
sot \
svl \
diff --git a/starmath/inc/unomodel.hxx b/starmath/inc/unomodel.hxx
index 693ea3bc9b2e..15ada7b3a152 100644
--- a/starmath/inc/unomodel.hxx
+++ b/starmath/inc/unomodel.hxx
@@ -37,6 +37,7 @@
#include <sfx2/sfxbasemodel.hxx>
#include <comphelper/propertysethelper.hxx>
#include <vcl/print.hxx>
+#include <filter/msfilter/ooxmlexport.hxx>
class SmFormat;
@@ -63,7 +64,8 @@ public:
class SmModel : public SfxBaseModel,
public comphelper::PropertySetHelper,
public com::sun::star::lang::XServiceInfo,
- public com::sun::star::view::XRenderable
+ public com::sun::star::view::XRenderable,
+ public OoxmlFormulaExportBase
{
SmPrintUIOptions* m_pPrintUIOptions;
protected:
@@ -100,6 +102,9 @@ public:
virtual void SAL_CALL setParent( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xParent ) throw( ::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException );
+ // OoxmlFormulaExportBase
+ virtual void writeFormulaOoxml( ::sax_fastparser::FSHelperPtr m_pSerializer );
+
static ::com::sun::star::uno::Sequence< rtl::OUString > getSupportedServiceNames_Static();
static ::rtl::OUString getImplementationName_Static();
};
diff --git a/starmath/source/unomodel.cxx b/starmath/source/unomodel.cxx
index 8ee267e65cb1..1820420e7c4c 100644
--- a/starmath/source/unomodel.cxx
+++ b/starmath/source/unomodel.cxx
@@ -1132,4 +1132,9 @@ void SAL_CALL SmModel::setParent( const uno::Reference< uno::XInterface >& xPare
}
}
+void SmModel::writeFormulaOoxml( ::sax_fastparser::FSHelperPtr m_pSerializer )
+{
+// static_cast< SmDocShell* >( GetObjectShell())->writeFormulaOoxml( m_pSerializer );
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index b2c43917b409..fcd303ac8b36 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -45,6 +45,7 @@
#include <oox/export/drawingml.hxx>
#include <oox/export/utils.hxx>
#include <oox/export/vmlexport.hxx>
+#include <filter/msfilter/ooxmlexport.hxx>
#include <i18npool/mslangid.hxx>
@@ -2301,7 +2302,11 @@ bool DocxAttributeOutput::WriteOLEMath( const SdrObject*, const SwOLENode& rOLEN
if( !SotExchange::IsMath(aObjName) )
return false;
- // TODO
+ uno::Reference< uno::XInterface > xInterface( aObjRef->getComponent(), uno::UNO_QUERY );
+ OoxmlFormulaExportBase* formulaexport = dynamic_cast< OoxmlFormulaExportBase* >( xInterface.get());
+ if( formulaexport == NULL )
+ return false;
+ formulaexport->writeFormulaOoxml( m_pSerializer );
return true;
}