From 791d8b4f1f656a8553c25fe9034ca8a350efaaae Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Wed, 15 Apr 2015 15:41:11 +0200 Subject: DOCX import: convert MathType to Math if MathTypeToMath is enabled With this, math equations created by Word <= 2003 and embedded to docx files can be edited finally. Previously the result was read-only and opened in an unexpected new window. Change-Id: I4f9dd1cca4a149959f6151cf9af9242b53190ef5 --- writerfilter/source/dmapper/OLEHandler.cxx | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'writerfilter') diff --git a/writerfilter/source/dmapper/OLEHandler.cxx b/writerfilter/source/dmapper/OLEHandler.cxx index b04c927a1c25..328d2d71459e 100644 --- a/writerfilter/source/dmapper/OLEHandler.cxx +++ b/writerfilter/source/dmapper/OLEHandler.cxx @@ -225,6 +225,10 @@ void OLEHandler::importStream(uno::Reference xComponentC OUString aFilterService; if (m_sProgId == "Word.Document.12") aFilterService = "com.sun.star.comp.Writer.WriterFilter"; + else if (m_sProgId == "Equation.3") + aFilterService = "com.sun.star.comp.Math.MathTypeFilter"; + else + SAL_WARN("writerfilter", "OLEHandler::importStream: unhandled m_sProgId: " << m_sProgId); if (!m_xInputStream.is() || aFilterService.isEmpty()) return; @@ -253,8 +257,19 @@ OUString OLEHandler::getCLSID(uno::Reference xComponentC { OUString aRet; - if (officecfg::Office::Common::Filter::Microsoft::Import::WinWordToWriter::get(xComponentContext) && m_sProgId == "Word.Document.12") - aRet = "8BC6B165-B1B2-4EDD-aa47-dae2ee689dd6"; + // See officecfg/registry/data/org/openoffice/Office/Embedding.xcu. + if (m_sProgId == "Word.Document.12") + { + if (officecfg::Office::Common::Filter::Microsoft::Import::WinWordToWriter::get(xComponentContext)) + aRet = "8BC6B165-B1B2-4EDD-aa47-dae2ee689dd6"; + } + else if (m_sProgId == "Equation.3") + { + if (officecfg::Office::Common::Filter::Microsoft::Import::MathTypeToMath::get(xComponentContext)) + aRet = "078B7ABA-54FC-457F-8551-6147E776A997"; + } + else + SAL_WARN("writerfilter", "OLEHandler::getCLSID: unhandled m_sProgId: " << m_sProgId); return aRet; } -- cgit