fix some fallout from the import libs rebase

f41
David Tardon 11 years ago
parent 4f34478c5d
commit 9bde8a97af

@ -0,0 +1,113 @@
From 8ea986b7c5fb87c5991801acba3d47378294d85c Mon Sep 17 00:00:00 2001
From: David Tardon <dtardon@redhat.com>
Date: Wed, 28 May 2014 10:22:41 +0200
Subject: [PATCH 01/18] improve WPXSvInputStream test
Change-Id: I95817ea44b6793d4a80b74b32f3b5477c6169b26
(cherry picked from commit c14a6e0570c33c8a1258d5b562ca082de2cf05ce)
---
writerperfect/CppunitTest_writerperfect_stream.mk | 1 +
writerperfect/qa/unit/WPXSvStreamTest.cxx | 42 +++++++++++++++++++++++
2 files changed, 43 insertions(+)
diff --git a/writerperfect/CppunitTest_writerperfect_stream.mk b/writerperfect/CppunitTest_writerperfect_stream.mk
index 8416008..ad943e0 100644
--- a/writerperfect/CppunitTest_writerperfect_stream.mk
+++ b/writerperfect/CppunitTest_writerperfect_stream.mk
@@ -47,6 +47,7 @@ $(eval $(call gb_CppunitTest_use_components,writerperfect_stream,\
package/util/package2 \
ucb/source/core/ucb1 \
ucb/source/ucp/file/ucpfile1 \
+ unotools/util/utl \
))
$(eval $(call gb_CppunitTest_add_exception_objects,writerperfect_stream,\
diff --git a/writerperfect/qa/unit/WPXSvStreamTest.cxx b/writerperfect/qa/unit/WPXSvStreamTest.cxx
index d75f201..c2b4f20 100644
--- a/writerperfect/qa/unit/WPXSvStreamTest.cxx
+++ b/writerperfect/qa/unit/WPXSvStreamTest.cxx
@@ -9,6 +9,7 @@
#include <algorithm>
#include <cassert>
+#include <sstream>
#include <boost/shared_ptr.hpp>
@@ -98,6 +99,24 @@ const shared_ptr<RVNGInputStream> lcl_createStreamForURL(const rtl::OUString &rU
return pInput;
}
+void lcl_testSubStreams(const shared_ptr<RVNGInputStream> &pInput)
+{
+ shared_ptr<RVNGInputStream> pSubStream;
+
+ // all valid substreams can be read
+ for (std::size_t i = 0; i != pInput->subStreamCount(); ++i)
+ {
+ std::ostringstream msg("opening substream ");
+ msg << i;
+ pSubStream.reset(pInput->getSubStreamById(i));
+ CPPUNIT_ASSERT_MESSAGE(msg.str(), bool(pSubStream));
+ }
+
+ // invalid substreams cannot be read
+ pSubStream.reset(pInput->getSubStreamById(pInput->subStreamCount()));
+ CPPUNIT_ASSERT(!pSubStream);
+}
+
void WPXSvStreamTest::testRead()
{
const shared_ptr<RVNGInputStream> pInput(lcl_createStream());
@@ -281,8 +300,17 @@ void WPXSvStreamTest::testStructured()
assert(bool(pInput));
CPPUNIT_ASSERT(pInput->isStructured());
+ CPPUNIT_ASSERT(2 == pInput->subStreamCount());
+ lcl_testSubStreams(pInput);
+
+ // check for existing substream
+ CPPUNIT_ASSERT(pInput->existsSubStream("WordDocument"));
shared_ptr<RVNGInputStream> pSubStream(pInput->getSubStreamByName("WordDocument"));
CPPUNIT_ASSERT(bool(pSubStream));
+ CPPUNIT_ASSERT(!pSubStream->isEnd());
+
+ // check for not existing substream
+ CPPUNIT_ASSERT(!pInput->existsSubStream("foo"));
pSubStream.reset(pInput->getSubStreamByName("foo"));
CPPUNIT_ASSERT(!pSubStream);
}
@@ -293,8 +321,18 @@ void WPXSvStreamTest::testStructured()
assert(bool(pInput));
CPPUNIT_ASSERT(pInput->isStructured());
+ CPPUNIT_ASSERT(9 == pInput->subStreamCount());
+ lcl_testSubStreams(pInput);
+
+ // check for existing substream
+ CPPUNIT_ASSERT(pInput->existsSubStream("content.xml"));
shared_ptr<RVNGInputStream> pSubStream(pInput->getSubStreamByName("content.xml"));
CPPUNIT_ASSERT(bool(pSubStream));
+ CPPUNIT_ASSERT(!pSubStream->isEnd());
+
+ // check for not existing substream
+ CPPUNIT_ASSERT(pInput->existsSubStream("content.xml"));
+ CPPUNIT_ASSERT(!pInput->existsSubStream("foo"));
pSubStream.reset(pInput->getSubStreamByName("foo"));
CPPUNIT_ASSERT(!pSubStream);
}
@@ -304,7 +342,11 @@ void WPXSvStreamTest::testStructured()
const shared_ptr<RVNGInputStream> pInput(lcl_createStream());
CPPUNIT_ASSERT(!pInput->isStructured());
+ CPPUNIT_ASSERT(0 == pInput->subStreamCount());
+ CPPUNIT_ASSERT(!pInput->existsSubStream("foo"));
CPPUNIT_ASSERT(0 == pInput->getSubStreamByName("foo"));
+ CPPUNIT_ASSERT(0 == pInput->getSubStreamById(42));
+ CPPUNIT_ASSERT(0 == pInput->subStreamName(42));
}
}
--
1.9.3

@ -0,0 +1,177 @@
From 807782cd52d5751bfb98f6e5cb42add2bc679c0c Mon Sep 17 00:00:00 2001
From: alonso <laurent.alonso@inria.fr>
Date: Wed, 28 May 2014 15:55:39 +0200
Subject: [PATCH 02/18] enable new handlers
Change-Id: I1c07a44e7d318478bcb2561d29ea53a9475e4b1f
(cherry picked from commit 6cae6d682cfdec0104f68552def2d1b5719c8fbe)
---
.../source/writer/MSWorksImportFilter.cxx | 12 +++++
.../source/writer/MSWorksImportFilter.hxx | 1 +
writerperfect/source/writer/MWAWImportFilter.cxx | 52 +++++++++++++++++-----
3 files changed, 54 insertions(+), 11 deletions(-)
diff --git a/writerperfect/source/writer/MSWorksImportFilter.cxx b/writerperfect/source/writer/MSWorksImportFilter.cxx
index 7567294..2d253fb 100644
--- a/writerperfect/source/writer/MSWorksImportFilter.cxx
+++ b/writerperfect/source/writer/MSWorksImportFilter.cxx
@@ -24,6 +24,13 @@ using com::sun::star::uno::Exception;
using com::sun::star::uno::RuntimeException;
using com::sun::star::uno::XComponentContext;
+static bool handleEmbeddedWKSObject(const librevenge::RVNGBinaryData &data, OdfDocumentHandler *pHandler, const OdfStreamType streamType)
+{
+ OdsGenerator exporter;
+ exporter.addDocumentHandler(pHandler, streamType);
+ return libwps::WPSDocument::parse(const_cast<librevenge::RVNGInputStream *>(data.getDataStream()), &exporter)==libwps::WPS_OK;
+}
+
bool MSWorksImportFilter::doImportDocument( librevenge::RVNGInputStream &rInput, const rtl::OUString &, librevenge::RVNGTextInterface &rGenerator )
{
return libwps::WPS_OK == libwps::WPSDocument::parse(&rInput, &rGenerator);
@@ -43,6 +50,11 @@ bool MSWorksImportFilter::doDetectFormat( librevenge::RVNGInputStream &rInput, O
return false;
}
+void MSWorksImportFilter::doRegisterHandlers( OdtGenerator &rGenerator )
+{
+ rGenerator.registerEmbeddedObjectHandler("image/wks-ods", &handleEmbeddedWKSObject);
+}
+
OUString MSWorksImportFilter_getImplementationName ()
throw (RuntimeException)
{
diff --git a/writerperfect/source/writer/MSWorksImportFilter.hxx b/writerperfect/source/writer/MSWorksImportFilter.hxx
index b5ddfe4..9bddf08 100644
--- a/writerperfect/source/writer/MSWorksImportFilter.hxx
+++ b/writerperfect/source/writer/MSWorksImportFilter.hxx
@@ -35,6 +35,7 @@ public:
private:
virtual bool doDetectFormat( librevenge::RVNGInputStream &rInput, OUString &rTypeName ) SAL_OVERRIDE;
virtual bool doImportDocument( librevenge::RVNGInputStream &rInput, const rtl::OUString &rFilterName, librevenge::RVNGTextInterface &rGenerator ) SAL_OVERRIDE;
+ virtual void doRegisterHandlers( OdtGenerator &rGenerator ) SAL_OVERRIDE;
};
OUString MSWorksImportFilter_getImplementationName()
diff --git a/writerperfect/source/writer/MWAWImportFilter.cxx b/writerperfect/source/writer/MWAWImportFilter.cxx
index ad656c9..d55a645 100644
--- a/writerperfect/source/writer/MWAWImportFilter.cxx
+++ b/writerperfect/source/writer/MWAWImportFilter.cxx
@@ -24,13 +24,20 @@ using com::sun::star::uno::Exception;
using com::sun::star::uno::RuntimeException;
using com::sun::star::uno::XComponentContext;
-static bool handleEmbeddedMWAWObject(const librevenge::RVNGBinaryData &data, OdfDocumentHandler *pHandler, const OdfStreamType streamType)
+static bool handleEmbeddedMWAWGraphicObject(const librevenge::RVNGBinaryData &data, OdfDocumentHandler *pHandler, const OdfStreamType streamType)
{
OdgGenerator exporter;
exporter.addDocumentHandler(pHandler, streamType);
return MWAWDocument::decodeGraphic(data, &exporter);
}
+static bool handleEmbeddedMWAWSpreadsheetObject(const librevenge::RVNGBinaryData &data, OdfDocumentHandler *pHandler, const OdfStreamType streamType)
+{
+ OdsGenerator exporter;
+ exporter.addDocumentHandler(pHandler, streamType);
+ return MWAWDocument::decodeSpreadsheet(data, &exporter);
+}
+
bool MWAWImportFilter::doImportDocument( librevenge::RVNGInputStream &rInput, const rtl::OUString &, librevenge::RVNGTextInterface &rGenerator )
{
return MWAWDocument::MWAW_R_OK == MWAWDocument::parse(&rInput, &rGenerator);
@@ -65,12 +72,12 @@ bool MWAWImportFilter::doDetectFormat( librevenge::RVNGInputStream &rInput, OUSt
case MWAWDocument::MWAW_T_EDOC:
rTypeName = "writer_eDoc_Document";
break;
- case MWAWDocument::MWAW_T_GREATWORKS:
- rTypeName = "writer_Great_Works";
- break;
case MWAWDocument::MWAW_T_FULLWRITE:
rTypeName = "writer_FullWrite_Professional";
break;
+ case MWAWDocument::MWAW_T_GREATWORKS:
+ rTypeName = "writer_Great_Works";
+ break;
case MWAWDocument::MWAW_T_HANMACWORDJ:
rTypeName = "writer_HanMac_Word_J";
break;
@@ -83,24 +90,24 @@ bool MWAWImportFilter::doDetectFormat( librevenge::RVNGInputStream &rInput, OUSt
case MWAWDocument::MWAW_T_MACDOC:
rTypeName = "writer_MacDoc";
break;
- case MWAWDocument::MWAW_T_MARINERWRITE:
- rTypeName = "writer_Mariner_Write";
- break;
- case MWAWDocument::MWAW_T_MINDWRITE:
- rTypeName = "writer_MindWrite";
- break;
case MWAWDocument::MWAW_T_MACWRITE:
rTypeName = "writer_MacWrite";
break;
case MWAWDocument::MWAW_T_MACWRITEPRO:
rTypeName = "writer_MacWritePro";
break;
+ case MWAWDocument::MWAW_T_MARINERWRITE:
+ rTypeName = "writer_Mariner_Write";
+ break;
case MWAWDocument::MWAW_T_MICROSOFTWORD:
rTypeName = "writer_Mac_Word";
break;
case MWAWDocument::MWAW_T_MICROSOFTWORKS:
rTypeName = "writer_Mac_Works";
break;
+ case MWAWDocument::MWAW_T_MINDWRITE:
+ rTypeName = "writer_MindWrite";
+ break;
case MWAWDocument::MWAW_T_MORE:
rTypeName = "writer_Mac_More";
break;
@@ -123,13 +130,35 @@ bool MWAWImportFilter::doDetectFormat( librevenge::RVNGInputStream &rInput, OUSt
rTypeName = "writer_ZWrite";
break;
+ case MWAWDocument::MWAW_T_ADOBEILLUSTRATOR:
+ case MWAWDocument::MWAW_T_CLARISRESOLVE:
+ case MWAWDocument::MWAW_T_DBASE:
+ case MWAWDocument::MWAW_T_FAMILYTREEMAKER:
+ case MWAWDocument::MWAW_T_FILEMAKER:
+ case MWAWDocument::MWAW_T_FOXBASE:
+ case MWAWDocument::MWAW_T_FULLIMPACT:
+ case MWAWDocument::MWAW_T_FULLPAINT:
case MWAWDocument::MWAW_T_FRAMEMAKER:
+ case MWAWDocument::MWAW_T_INFOGENIE:
+ case MWAWDocument::MWAW_T_KALEIDAGRAPH:
+ case MWAWDocument::MWAW_T_MACDRAFT:
case MWAWDocument::MWAW_T_MACDRAW:
+ case MWAWDocument::MWAW_T_MACDRAWPRO:
case MWAWDocument::MWAW_T_MACPAINT:
+ case MWAWDocument::MWAW_T_MICROSOFTFILE:
+ case MWAWDocument::MWAW_T_MICROSOFTMULTIPLAN:
+ case MWAWDocument::MWAW_T_OVERVUE:
case MWAWDocument::MWAW_T_PAGEMAKER:
+ case MWAWDocument::MWAW_T_PIXELPAINT:
case MWAWDocument::MWAW_T_READYSETGO:
case MWAWDocument::MWAW_T_RAGTIME:
+ case MWAWDocument::MWAW_T_SUPERPAINT:
+ case MWAWDocument::MWAW_T_SYMPOSIUM:
+ case MWAWDocument::MWAW_T_TRAPEZE:
+ case MWAWDocument::MWAW_T_WINGZ:
case MWAWDocument::MWAW_T_XPRESS:
+ case MWAWDocument::MWAW_T_4DIMENSION:
+
case MWAWDocument::MWAW_T_RESERVED1:
case MWAWDocument::MWAW_T_RESERVED2:
case MWAWDocument::MWAW_T_RESERVED3:
@@ -151,7 +180,8 @@ bool MWAWImportFilter::doDetectFormat( librevenge::RVNGInputStream &rInput, OUSt
void MWAWImportFilter::doRegisterHandlers( OdtGenerator &rGenerator )
{
- rGenerator.registerEmbeddedObjectHandler("image/mwaw-odg", &handleEmbeddedMWAWObject);
+ rGenerator.registerEmbeddedObjectHandler("image/mwaw-odg", &handleEmbeddedMWAWGraphicObject);
+ rGenerator.registerEmbeddedObjectHandler("image/mwaw-ods", &handleEmbeddedMWAWSpreadsheetObject);
}
OUString MWAWImportFilter_getImplementationName ()
--
1.9.3

@ -0,0 +1,721 @@
From f458e912d88059a1b129e91bf4d15c03baf3346d Mon Sep 17 00:00:00 2001
From: osnola <alonso@loria.fr>
Date: Wed, 28 May 2014 18:09:57 +0200
Subject: [PATCH 03/18] Add new libmwaw drawing format...
Change-Id: I7fa7a46143126bdf27cf7cb30245dbcb244645ef
(cherry picked from commit 0e17d7bb8acdbc0c36406a352c37f5cb0a987ced)
---
.../config/fragments/filters/Beagle_Works_Draw.xcu | 29 ++++
.../config/fragments/filters/ClarisWorks_Draw.xcu | 30 ++++
.../config/fragments/filters/Great_Works_Draw.xcu | 29 ++++
.../config/fragments/filters/MacPaint_Draw.xcu | 30 ++++
.../config/fragments/filters/Mac_Works_Draw.xcu | 30 ++++
.../config/fragments/filters/SuperPaint_Draw.xcu | 30 ++++
.../config/fragments/types/draw_Beagle_Works.xcu | 29 ++++
.../config/fragments/types/draw_ClarisWorks.xcu | 29 ++++
.../config/fragments/types/draw_Great_Works.xcu | 29 ++++
.../config/fragments/types/draw_MacPaint.xcu | 29 ++++
.../config/fragments/types/draw_Mac_Works.xcu | 29 ++++
.../config/fragments/types/draw_SuperPaint.xcu | 29 ++++
writerperfect/source/draw/MWAWDrawImportFilter.cxx | 191 +++++++++++++++++++++
writerperfect/source/draw/MWAWDrawImportFilter.hxx | 53 ++++++
14 files changed, 596 insertions(+)
create mode 100644 filter/source/config/fragments/filters/Beagle_Works_Draw.xcu
create mode 100644 filter/source/config/fragments/filters/ClarisWorks_Draw.xcu
create mode 100644 filter/source/config/fragments/filters/Great_Works_Draw.xcu
create mode 100644 filter/source/config/fragments/filters/MacPaint_Draw.xcu
create mode 100644 filter/source/config/fragments/filters/Mac_Works_Draw.xcu
create mode 100644 filter/source/config/fragments/filters/SuperPaint_Draw.xcu
create mode 100644 filter/source/config/fragments/types/draw_Beagle_Works.xcu
create mode 100644 filter/source/config/fragments/types/draw_ClarisWorks.xcu
create mode 100644 filter/source/config/fragments/types/draw_Great_Works.xcu
create mode 100644 filter/source/config/fragments/types/draw_MacPaint.xcu
create mode 100644 filter/source/config/fragments/types/draw_Mac_Works.xcu
create mode 100644 filter/source/config/fragments/types/draw_SuperPaint.xcu
create mode 100644 writerperfect/source/draw/MWAWDrawImportFilter.cxx
create mode 100644 writerperfect/source/draw/MWAWDrawImportFilter.hxx
diff --git a/filter/source/config/fragments/filters/Beagle_Works_Draw.xcu b/filter/source/config/fragments/filters/Beagle_Works_Draw.xcu
new file mode 100644
index 0000000..57b5879
--- /dev/null
+++ b/filter/source/config/fragments/filters/Beagle_Works_Draw.xcu
@@ -0,0 +1,29 @@
+<!--
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+-->
+
+<node oor:name="Beagle_Works_Draw" oor:op="replace">
+ <prop oor:name="Flags">
+ <value>IMPORT ALIEN USESOPTIONS 3RDPARTYFILTER PREFERRED</value>
+ </prop>
+ <prop oor:name="FilterService">
+ <value>com.sun.star.comp.Draw.MWAWDrawImportFilter</value>
+ </prop>
+ <prop oor:name="UIName">
+ <value xml:lang="en-US">BeagleWorks/WordPerfect Works v1 Document</value>
+ </prop>
+ <prop oor:name="FileFormatVersion">
+ <value>0</value>
+ </prop>
+ <prop oor:name="Type">
+ <value>draw_Beagle_Works</value>
+ </prop>
+ <prop oor:name="DocumentService">
+ <value>com.sun.star.drawing.DrawingDocument</value>
+ </prop>
+</node>
diff --git a/filter/source/config/fragments/filters/ClarisWorks_Draw.xcu b/filter/source/config/fragments/filters/ClarisWorks_Draw.xcu
new file mode 100644
index 0000000..f4924b7
--- /dev/null
+++ b/filter/source/config/fragments/filters/ClarisWorks_Draw.xcu
@@ -0,0 +1,30 @@
+<!--
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+-->
+ <node oor:name="ClarisWorks_Draw" oor:op="replace">
+ <prop oor:name="Flags"><value>IMPORT ALIEN USESOPTIONS 3RDPARTYFILTER PREFERRED</value></prop>
+ <prop oor:name="UIComponent"/>
+ <prop oor:name="FilterService"><value>com.sun.star.comp.Draw.MWAWDrawImportFilter</value></prop>
+ <prop oor:name="UserData"><value></value></prop>
+ <prop oor:name="UIName">
+ <value xml:lang="en-US">ClarisWorks/AppleWorks Document</value>
+ </prop>
+ <prop oor:name="FileFormatVersion"><value>0</value></prop>
+ <prop oor:name="Type"><value>draw_ClarisWorks</value></prop>
+ <prop oor:name="TemplateName"/>
+ <prop oor:name="DocumentService"><value>com.sun.star.drawing.DrawingDocument</value></prop>
+ </node>
diff --git a/filter/source/config/fragments/filters/Great_Works_Draw.xcu b/filter/source/config/fragments/filters/Great_Works_Draw.xcu
new file mode 100644
index 0000000..4bb0667
--- /dev/null
+++ b/filter/source/config/fragments/filters/Great_Works_Draw.xcu
@@ -0,0 +1,29 @@
+<!--
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+-->
+
+<node oor:name="Great_Works_Draw" oor:op="replace">
+ <prop oor:name="Flags">
+ <value>IMPORT ALIEN USESOPTIONS 3RDPARTYFILTER PREFERRED</value>
+ </prop>
+ <prop oor:name="FilterService">
+ <value>com.sun.star.comp.Draaw.MWAWDrawImportFilter</value>
+ </prop>
+ <prop oor:name="UIName">
+ <value xml:lang="en-US">GreatWorks Document</value>
+ </prop>
+ <prop oor:name="FileFormatVersion">
+ <value>0</value>
+ </prop>
+ <prop oor:name="Type">
+ <value>draw_Great_Works</value>
+ </prop>
+ <prop oor:name="DocumentService">
+ <value>com.sun.star.drawing.DrawingDocument</value>
+ </prop>
+</node>
diff --git a/filter/source/config/fragments/filters/MacPaint_Draw.xcu b/filter/source/config/fragments/filters/MacPaint_Draw.xcu
new file mode 100644
index 0000000..80f8021
--- /dev/null
+++ b/filter/source/config/fragments/filters/MacPaint_Draw.xcu
@@ -0,0 +1,30 @@
+<!--
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+-->
+ <node oor:name="MacPaint_Draw" oor:op="replace">
+ <prop oor:name="Flags"><value>IMPORT ALIEN USESOPTIONS 3RDPARTYFILTER PREFERRED</value></prop>
+ <prop oor:name="UIComponent"/>
+ <prop oor:name="FilterService"><value>com.sun.star.comp.Draw.MWAWDrawImportFilter</value></prop>
+ <prop oor:name="UserData"><value></value></prop>
+ <prop oor:name="UIName">
+ <value xml:lang="en-US">MacPaint (v1)</value>
+ </prop>
+ <prop oor:name="FileFormatVersion"><value>0</value></prop>
+ <prop oor:name="Type"><value>draw_MacPaint</value></prop>
+ <prop oor:name="TemplateName"/>
+ <prop oor:name="DocumentService"><value>com.sun.star.drawing.DrawingDocument</value></prop>
+ </node>
diff --git a/filter/source/config/fragments/filters/Mac_Works_Draw.xcu b/filter/source/config/fragments/filters/Mac_Works_Draw.xcu
new file mode 100644
index 0000000..1c02f3f
--- /dev/null
+++ b/filter/source/config/fragments/filters/Mac_Works_Draw.xcu
@@ -0,0 +1,30 @@
+<!--
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+-->
+ <node oor:name="Mac_Works_Draw" oor:op="replace">
+ <prop oor:name="Flags"><value>IMPORT ALIEN USESOPTIONS 3RDPARTYFILTER PREFERRED</value></prop>
+ <prop oor:name="UIComponent"/>
+ <prop oor:name="FilterService"><value>com.sun.star.comp.Draw.MWAWDrawImportFilter</value></prop>
+ <prop oor:name="UserData"><value></value></prop>
+ <prop oor:name="UIName">
+ <value xml:lang="en-US">Microsoft Works for Mac Document (v1 - v4)</value>
+ </prop>
+ <prop oor:name="FileFormatVersion"><value>0</value></prop>
+ <prop oor:name="Type"><value>draw_Mac_Works</value></prop>
+ <prop oor:name="TemplateName"/>
+ <prop oor:name="DocumentService"><value>com.sun.star.drawing.DrawingDocument</value></prop>
+ </node>
diff --git a/filter/source/config/fragments/filters/SuperPaint_Draw.xcu b/filter/source/config/fragments/filters/SuperPaint_Draw.xcu
new file mode 100644
index 0000000..ccac863
--- /dev/null
+++ b/filter/source/config/fragments/filters/SuperPaint_Draw.xcu
@@ -0,0 +1,30 @@
+<!--
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+-->
+ <node oor:name="SuperPaint_Draw" oor:op="replace">
+ <prop oor:name="Flags"><value>IMPORT ALIEN USESOPTIONS 3RDPARTYFILTER PREFERRED</value></prop>
+ <prop oor:name="UIComponent"/>
+ <prop oor:name="FilterService"><value>com.sun.star.comp.Draw.MWAWDrawImportFilter</value></prop>
+ <prop oor:name="UserData"><value></value></prop>
+ <prop oor:name="UIName">
+ <value xml:lang="en-US">SuperPaint (v1)</value>
+ </prop>
+ <prop oor:name="FileFormatVersion"><value>0</value></prop>
+ <prop oor:name="Type"><value>draw_SuperPaint</value></prop>
+ <prop oor:name="TemplateName"/>
+ <prop oor:name="DocumentService"><value>com.sun.star.drawing.DrawingDocument</value></prop>
+ </node>
diff --git a/filter/source/config/fragments/types/draw_Beagle_Works.xcu b/filter/source/config/fragments/types/draw_Beagle_Works.xcu
new file mode 100644
index 0000000..177ad97
--- /dev/null
+++ b/filter/source/config/fragments/types/draw_Beagle_Works.xcu
@@ -0,0 +1,29 @@
+<!--
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+-->
+
+<node oor:name="draw_Beagle_Works" oor:op="replace">
+ <prop oor:name="DetectService">
+ <value>com.sun.star.comp.Draw.MWAWDrawImportFilter</value>
+ </prop>
+ <prop oor:name="Extensions">
+ <value>dummy</value>
+ </prop>
+ <prop oor:name="MediaType">
+ <value></value>
+ </prop>
+ <prop oor:name="Preferred">
+ <value>true</value>
+ </prop>
+ <prop oor:name="PreferredFilter">
+ <value>Beagle_Works_Draw</value>
+ </prop>
+ <prop oor:name="UIName">
+ <value>BeagleWorks/WordPerfect Works Document</value>
+ </prop>
+</node>
diff --git a/filter/source/config/fragments/types/draw_ClarisWorks.xcu b/filter/source/config/fragments/types/draw_ClarisWorks.xcu
new file mode 100644
index 0000000..74672eb
--- /dev/null
+++ b/filter/source/config/fragments/types/draw_ClarisWorks.xcu
@@ -0,0 +1,29 @@
+<!--
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+-->
+ <node oor:name="draw_ClarisWorks" oor:op="replace" >
+ <prop oor:name="DetectService"><value>com.sun.star.comp.Draw.MWAWDrawImportFilter</value></prop>
+ <prop oor:name="URLPattern"/>
+ <prop oor:name="Extensions"><value>cwk</value></prop>
+ <prop oor:name="MediaType"><value>application/clarisworks</value></prop>
+ <prop oor:name="Preferred"><value>true</value></prop>
+ <prop oor:name="PreferredFilter"><value>Claris_Works_Draw</value></prop>
+ <prop oor:name="UIName">
+ <value>ClarisWorks/AppleWorks Document</value>
+ </prop>
+ <prop oor:name="ClipboardFormat"/>
+ </node>
diff --git a/filter/source/config/fragments/types/draw_Great_Works.xcu b/filter/source/config/fragments/types/draw_Great_Works.xcu
new file mode 100644
index 0000000..f9aeb07
--- /dev/null
+++ b/filter/source/config/fragments/types/draw_Great_Works.xcu
@@ -0,0 +1,29 @@
+<!--
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+-->
+
+<node oor:name="draw_Great_Works" oor:op="replace">
+ <prop oor:name="DetectService">
+ <value>com.sun.star.comp.Draw.MWAWDrawImportFilter</value>
+ </prop>
+ <prop oor:name="Extensions">
+ <value>dummy</value>
+ </prop>
+ <prop oor:name="MediaType">
+ <value></value>
+ </prop>
+ <prop oor:name="Preferred">
+ <value>true</value>
+ </prop>
+ <prop oor:name="PreferredFilter">
+ <value>Great_Works_Draw</value>
+ </prop>
+ <prop oor:name="UIName">
+ <value>GreatWorks Document</value>
+ </prop>
+</node>
diff --git a/filter/source/config/fragments/types/draw_MacPaint.xcu b/filter/source/config/fragments/types/draw_MacPaint.xcu
new file mode 100644
index 0000000..5811ea5
--- /dev/null
+++ b/filter/source/config/fragments/types/draw_MacPaint.xcu
@@ -0,0 +1,29 @@
+<!--
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+-->
+ <node oor:name="draw_MacPaint" oor:op="replace" >
+ <prop oor:name="DetectService"><value>com.sun.star.comp.Draw.MWAWDrawImportFilter</value></prop>
+ <prop oor:name="URLPattern"/>
+ <prop oor:name="Extensions"><value>wps</value></prop>
+ <prop oor:name="MediaType"><value>application/vnd.ms-works</value></prop>
+ <prop oor:name="Preferred"><value>true</value></prop>
+ <prop oor:name="PreferredFilter"><value>MacPaint_Draw</value></prop>
+ <prop oor:name="UIName">
+ <value>MacPaint (v1)</value>
+ </prop>
+ <prop oor:name="ClipboardFormat"/>
+ </node>
diff --git a/filter/source/config/fragments/types/draw_Mac_Works.xcu b/filter/source/config/fragments/types/draw_Mac_Works.xcu
new file mode 100644
index 0000000..79ef12c
--- /dev/null
+++ b/filter/source/config/fragments/types/draw_Mac_Works.xcu
@@ -0,0 +1,29 @@
+<!--
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+-->
+ <node oor:name="draw_Mac_Works" oor:op="replace" >
+ <prop oor:name="DetectService"><value>com.sun.star.comp.Draw.MWAWDrawImportFilter</value></prop>
+ <prop oor:name="URLPattern"/>
+ <prop oor:name="Extensions"><value>wps</value></prop>
+ <prop oor:name="MediaType"><value>application/vnd.ms-works</value></prop>
+ <prop oor:name="Preferred"><value>true</value></prop>
+ <prop oor:name="PreferredFilter"><value>Mac_Works_Draw</value></prop>
+ <prop oor:name="UIName">
+ <value>Microsoft Works for Mac Document (v1 - v4)</value>
+ </prop>
+ <prop oor:name="ClipboardFormat"/>
+ </node>
diff --git a/filter/source/config/fragments/types/draw_SuperPaint.xcu b/filter/source/config/fragments/types/draw_SuperPaint.xcu
new file mode 100644
index 0000000..6dbd4a9
--- /dev/null
+++ b/filter/source/config/fragments/types/draw_SuperPaint.xcu
@@ -0,0 +1,29 @@
+<!--
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+-->
+ <node oor:name="draw_SuperPaint" oor:op="replace" >
+ <prop oor:name="DetectService"><value>com.sun.star.comp.Draw.MWAWDrawImportFilter</value></prop>
+ <prop oor:name="URLPattern"/>
+ <prop oor:name="Extensions"><value>wps</value></prop>
+ <prop oor:name="MediaType"><value>application/vnd.ms-works</value></prop>
+ <prop oor:name="Preferred"><value>true</value></prop>
+ <prop oor:name="PreferredFilter"><value>SuperPaint_Draw</value></prop>
+ <prop oor:name="UIName">
+ <value>SuperPaint (v1)</value>
+ </prop>
+ <prop oor:name="ClipboardFormat"/>
+ </node>
diff --git a/writerperfect/source/draw/MWAWDrawImportFilter.cxx b/writerperfect/source/draw/MWAWDrawImportFilter.cxx
new file mode 100644
index 0000000..feddcdb
--- /dev/null
+++ b/writerperfect/source/draw/MWAWDrawImportFilter.cxx
@@ -0,0 +1,191 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* MWAWDrawImportFilter: Sets up the filter, and calls DocumentCollector
+ * to do the actual filtering
+ *
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include <com/sun/star/uno/Reference.h>
+#include <cppuhelper/supportsservice.hxx>
+
+#include <libmwaw/libmwaw.hxx>
+#include <libodfgen/libodfgen.hxx>
+
+#include "MWAWDrawImportFilter.hxx"
+
+using com::sun::star::uno::Sequence;
+using com::sun::star::uno::Reference;
+using com::sun::star::uno::Any;
+using com::sun::star::uno::XInterface;
+using com::sun::star::uno::Exception;
+using com::sun::star::uno::RuntimeException;
+using com::sun::star::uno::XComponentContext;
+
+static bool handleEmbeddedMWAWGraphicObject(const librevenge::RVNGBinaryData &data, OdfDocumentHandler *pHandler, const OdfStreamType streamType)
+{
+ OdgGenerator exporter;
+ exporter.addDocumentHandler(pHandler, streamType);
+ return MWAWDocument::decodeGraphic(data, &exporter);
+}
+
+static bool handleEmbeddedMWAWSpreadsheetObject(const librevenge::RVNGBinaryData &data, OdfDocumentHandler *pHandler, const OdfStreamType streamType)
+{
+ OdsGenerator exporter;
+ exporter.addDocumentHandler(pHandler, streamType);
+ return MWAWDocument::decodeSpreadsheet(data, &exporter);
+}
+
+bool MWAWDrawImportFilter::doImportDocument( librevenge::RVNGInputStream &rInput, librevenge::RVNGDrawingInterface &rGenerator )
+{
+ return MWAWDocument::MWAW_R_OK == MWAWDocument::parse(&rInput, &rGenerator);
+}
+
+bool MWAWDrawImportFilter::doDetectFormat( librevenge::RVNGInputStream &rInput, OUString &rTypeName )
+{
+ rTypeName = "";
+
+ MWAWDocument::Type docType = MWAWDocument::MWAW_T_UNKNOWN;
+ MWAWDocument::Kind docKind = MWAWDocument::MWAW_K_UNKNOWN;
+ const MWAWDocument::Confidence confidence = MWAWDocument::isFileFormatSupported(&rInput, docType, docKind);
+
+ if (confidence == MWAWDocument::MWAW_C_EXCELLENT)
+ {
+ if ( docKind == MWAWDocument::MWAW_K_DRAW || docKind == MWAWDocument::MWAW_K_PAINT )
+ {
+ switch (docType)
+ {
+ case MWAWDocument::MWAW_T_BEAGLEWORKS:
+ rTypeName = "draw_Beagle_Works";
+ break;
+ case MWAWDocument::MWAW_T_CLARISWORKS:
+ rTypeName = "draw_ClarisWorks";
+ break;
+ case MWAWDocument::MWAW_T_GREATWORKS:
+ rTypeName = "draw_Great_Works";
+ break;
+ case MWAWDocument::MWAW_T_MACPAINT:
+ rTypeName = "draw_MacPaint";
+ break;
+ case MWAWDocument::MWAW_T_MICROSOFTWORKS:
+ rTypeName = "draw_Mac_Works";
+ break;
+ case MWAWDocument::MWAW_T_SUPERPAINT:
+ rTypeName = "draw_SuperPaint";
+ break;
+
+ case MWAWDocument::MWAW_T_ACTA:
+ case MWAWDocument::MWAW_T_ADOBEILLUSTRATOR:
+ case MWAWDocument::MWAW_T_CLARISRESOLVE:
+ case MWAWDocument::MWAW_T_DBASE:
+ case MWAWDocument::MWAW_T_DOCMAKER:
+ case MWAWDocument::MWAW_T_EDOC:
+ case MWAWDocument::MWAW_T_FAMILYTREEMAKER:
+ case MWAWDocument::MWAW_T_FILEMAKER:
+ case MWAWDocument::MWAW_T_FOXBASE:
+ case MWAWDocument::MWAW_T_FRAMEMAKER:
+ case MWAWDocument::MWAW_T_FULLIMPACT:
+ case MWAWDocument::MWAW_T_FULLPAINT:
+ case MWAWDocument::MWAW_T_FULLWRITE:
+ case MWAWDocument::MWAW_T_INFOGENIE:
+ case MWAWDocument::MWAW_T_KALEIDAGRAPH:
+ case MWAWDocument::MWAW_T_HANMACWORDJ:
+ case MWAWDocument::MWAW_T_HANMACWORDK:
+ case MWAWDocument::MWAW_T_LIGHTWAYTEXT:
+ case MWAWDocument::MWAW_T_MACDOC:
+ case MWAWDocument::MWAW_T_MACDRAFT:
+ case MWAWDocument::MWAW_T_MACDRAW:
+ case MWAWDocument::MWAW_T_MACDRAWPRO:
+ case MWAWDocument::MWAW_T_MACWRITE:
+ case MWAWDocument::MWAW_T_MACWRITEPRO:
+ case MWAWDocument::MWAW_T_MARINERWRITE:
+ case MWAWDocument::MWAW_T_MINDWRITE:
+ case MWAWDocument::MWAW_T_MICROSOFTFILE:
+ case MWAWDocument::MWAW_T_MICROSOFTMULTIPLAN:
+ case MWAWDocument::MWAW_T_MICROSOFTWORD:
+ case MWAWDocument::MWAW_T_MORE:
+ case MWAWDocument::MWAW_T_NISUSWRITER:
+ case MWAWDocument::MWAW_T_OVERVUE:
+ case MWAWDocument::MWAW_T_PAGEMAKER:
+ case MWAWDocument::MWAW_T_PIXELPAINT:
+ case MWAWDocument::MWAW_T_RAGTIME:
+ case MWAWDocument::MWAW_T_READYSETGO:
+ case MWAWDocument::MWAW_T_SYMPOSIUM:
+ case MWAWDocument::MWAW_T_TEACHTEXT:
+ case MWAWDocument::MWAW_T_TEXEDIT:
+ case MWAWDocument::MWAW_T_TRAPEZE:
+ case MWAWDocument::MWAW_T_WINGZ:
+ case MWAWDocument::MWAW_T_WRITENOW:
+ case MWAWDocument::MWAW_T_WRITERPLUS:
+ case MWAWDocument::MWAW_T_XPRESS:
+ case MWAWDocument::MWAW_T_ZWRITE:
+ case MWAWDocument::MWAW_T_4DIMENSION:
+
+ case MWAWDocument::MWAW_T_RESERVED1:
+ case MWAWDocument::MWAW_T_RESERVED2:
+ case MWAWDocument::MWAW_T_RESERVED3:
+ case MWAWDocument::MWAW_T_RESERVED4:
+ case MWAWDocument::MWAW_T_RESERVED5:
+ case MWAWDocument::MWAW_T_RESERVED6:
+ case MWAWDocument::MWAW_T_RESERVED7:
+ case MWAWDocument::MWAW_T_RESERVED8:
+ case MWAWDocument::MWAW_T_RESERVED9:
+ case MWAWDocument::MWAW_T_UNKNOWN:
+ default:
+ break;
+ }
+ }
+ }
+
+ return !rTypeName.isEmpty();
+}
+
+void MWAWDrawImportFilter::doRegisterHandlers( OdgGenerator &rGenerator )
+{
+ rGenerator.registerEmbeddedObjectHandler("image/mwaw-odg", &handleEmbeddedMWAWGraphicObject);
+ rGenerator.registerEmbeddedObjectHandler("image/mwaw-ods", &handleEmbeddedMWAWSpreadsheetObject);
+}
+
+OUString MWAWDrawImportFilter_getImplementationName ()
+throw (RuntimeException)
+{
+ return OUString ( "com.sun.star.comp.Draw.MWAWDrawImportFilter" );
+}
+
+Sequence< OUString > SAL_CALL MWAWDrawImportFilter_getSupportedServiceNames( )
+throw (RuntimeException)
+{
+ Sequence < OUString > aRet(2);
+ OUString *pArray = aRet.getArray();
+ pArray[0] = "com.sun.star.document.ImportFilter";
+ pArray[1] = "com.sun.star.document.ExtendedTypeDetection";
+ return aRet;
+}
+
+Reference< XInterface > SAL_CALL MWAWDrawImportFilter_createInstance( const Reference< XComponentContext > &rContext)
+throw( Exception )
+{
+ return (cppu::OWeakObject *) new MWAWDrawImportFilter( rContext );
+}
+
+// XServiceInfo
+OUString SAL_CALL MWAWDrawImportFilter::getImplementationName( )
+throw (RuntimeException, std::exception)
+{
+ return MWAWDrawImportFilter_getImplementationName();
+}
+sal_Bool SAL_CALL MWAWDrawImportFilter::supportsService( const OUString &rServiceName )
+throw (RuntimeException, std::exception)
+{
+ return cppu::supportsService( this, rServiceName );
+}
+Sequence< OUString > SAL_CALL MWAWDrawImportFilter::getSupportedServiceNames( )
+throw (RuntimeException, std::exception)
+{
+ return MWAWDrawImportFilter_getSupportedServiceNames();
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerperfect/source/draw/MWAWDrawImportFilter.hxx b/writerperfect/source/draw/MWAWDrawImportFilter.hxx
new file mode 100644
index 0000000..173629e
--- /dev/null
+++ b/writerperfect/source/draw/MWAWDrawImportFilter.hxx
@@ -0,0 +1,53 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef _MWAWDRAWIMPORTFILTER_HXX
+#define _MWAWDRAWIMPORTFILTER_HXX
+
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+
+#include "ImportFilterBase.hxx"
+
+/* This component will be instantiated for both import or export. Whether it calls
+ * setSourceDocument or setTargetDocument determines which Impl function the filter
+ * member calls */
+class MWAWDrawImportFilter : public writerperfect::draw::ImportFilterBase
+{
+public:
+ MWAWDrawImportFilter( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > &rxContext )
+ : writerperfect::draw::ImportFilterBase( rxContext ) {}
+
+ // XServiceInfo
+ virtual OUString SAL_CALL getImplementationName( )
+ throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+ virtual sal_Bool SAL_CALL supportsService( const OUString &ServiceName )
+ throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( )
+ throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+
+private:
+ virtual bool doDetectFormat( librevenge::RVNGInputStream &rInput, OUString &rTypeName ) SAL_OVERRIDE;
+ virtual bool doImportDocument( librevenge::RVNGInputStream &rInput, librevenge::RVNGDrawingInterface &rGenerator ) SAL_OVERRIDE;
+ virtual void doRegisterHandlers( OdgGenerator &rGenerator ) SAL_OVERRIDE;
+};
+
+OUString MWAWDrawImportFilter_getImplementationName()
+throw ( ::com::sun::star::uno::RuntimeException );
+
+::com::sun::star::uno::Sequence< OUString > SAL_CALL MWAWDrawImportFilter_getSupportedServiceNames( )
+throw ( ::com::sun::star::uno::RuntimeException );
+
+::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
+SAL_CALL MWAWDrawImportFilter_createInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > &rContext)
+throw ( ::com::sun::star::uno::Exception );
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
--
1.9.3

@ -0,0 +1,163 @@
From 660d48599ce3c5a23838a441e1bd51c3f2b8dc20 Mon Sep 17 00:00:00 2001
From: osnola <alonso@loria.fr>
Date: Wed, 28 May 2014 18:13:06 +0200
Subject: [PATCH 04/18] add new libmwaw drawing formats (forgotten files)
Change-Id: Ib9ecd643a552063e2a09874776b3ea0f30e8440a
(cherry picked from commit ba0b63869ace532720bd7c13099e62c478d8cc31)
---
filter/Configuration_filter.mk | 17 +++++++++++++++--
writerperfect/Library_wpftdraw.mk | 2 ++
writerperfect/source/draw/ImportFilterBase.cxx | 6 ++++++
writerperfect/source/draw/ImportFilterBase.hxx | 3 +++
writerperfect/source/draw/wpftdraw.component | 4 ++++
writerperfect/source/draw/wpftdraw_genericfilter.cxx | 5 +++++
6 files changed, 35 insertions(+), 2 deletions(-)
diff --git a/filter/Configuration_filter.mk b/filter/Configuration_filter.mk
index fcc989b..9783f50 100644
--- a/filter/Configuration_filter.mk
+++ b/filter/Configuration_filter.mk
@@ -599,10 +599,17 @@ $(call filter_Configuration_add_types,fcfg_langpack,fcfg_draw_types.xcu,filter/s
draw8_template \
draw_WordPerfect_Graphics \
draw_Visio_Document \
- draw_Publisher_Document \
+ draw_Publisher_Document \
draw_CorelDraw_Document \
draw_Corel_Presentation_Exchange \
draw_Freehand_Document \
+ draw_Visio_Document \
+ draw_Beagle_Works \
+ draw_ClarisWorks \
+ draw_Great_Works \
+ draw_Mac_Works \
+ draw_MacPaint \
+ draw_SuperPaint \
)
$(call filter_Configuration_add_filters,fcfg_langpack,fcfg_draw_filters.xcu,filter/source/config/fragments/filters,\
@@ -613,10 +620,16 @@ $(call filter_Configuration_add_filters,fcfg_langpack,fcfg_draw_filters.xcu,filt
draw8_template \
WordPerfectGraphics \
VisioDocument \
- PublisherDocument \
+ PublisherDocument \
CorelDrawDocument \
CorelPresentationExchange \
FreehandDocument \
+ Beagle_Works_Draw \
+ ClarisWorks_Draw \
+ Great_Works_Draw \
+ Mac_Works_Draw \
+ MacPaint_Draw \
+ SuperPaint_Draw \
)
$(call filter_Configuration_add_ui_filters,fcfg_langpack,filter/source/config/fragments/filters,\
diff --git a/writerperfect/Library_wpftdraw.mk b/writerperfect/Library_wpftdraw.mk
index 807afc9..01a1ebe 100644
--- a/writerperfect/Library_wpftdraw.mk
+++ b/writerperfect/Library_wpftdraw.mk
@@ -40,6 +40,7 @@ $(eval $(call gb_Library_use_externals,wpftdraw,\
cdr \
freehand \
mspub \
+ mwaw \
odfgen \
revenge \
visio \
@@ -58,6 +59,7 @@ $(eval $(call gb_Library_add_exception_objects,wpftdraw,\
writerperfect/source/draw/FreehandImportFilter \
writerperfect/source/draw/ImportFilterBase \
writerperfect/source/draw/MSPUBImportFilter \
+ writerperfect/source/draw/MWAWDrawImportFilter \
writerperfect/source/draw/VisioImportFilter \
writerperfect/source/draw/WPGImportFilter \
writerperfect/source/draw/wpftdraw_genericfilter \
diff --git a/writerperfect/source/draw/ImportFilterBase.cxx b/writerperfect/source/draw/ImportFilterBase.cxx
index 6fc09b2..fc6c8ee 100644
--- a/writerperfect/source/draw/ImportFilterBase.cxx
+++ b/writerperfect/source/draw/ImportFilterBase.cxx
@@ -95,6 +95,8 @@ throw (RuntimeException, std::exception)
OdgGenerator exporter;
exporter.addDocumentHandler(&xHandler, ODF_FLAT_XML);
+ doRegisterHandlers(exporter);
+
return doImportDocument(input, exporter);
}
@@ -170,6 +172,10 @@ throw (Exception, RuntimeException, std::exception)
}
}
+void ImportFilterImpl::doRegisterHandlers( OdgGenerator & )
+{
+}
+
}
}
diff --git a/writerperfect/source/draw/ImportFilterBase.hxx b/writerperfect/source/draw/ImportFilterBase.hxx
index 56a1808..f326d98 100644
--- a/writerperfect/source/draw/ImportFilterBase.hxx
+++ b/writerperfect/source/draw/ImportFilterBase.hxx
@@ -39,6 +39,8 @@ namespace xml { namespace sax {
}
} } }
+class OdgGenerator;
+
namespace writerperfect
{
namespace draw
@@ -80,6 +82,7 @@ public:
private:
virtual bool doDetectFormat( librevenge::RVNGInputStream &rInput, OUString &rTypeName ) = 0;
virtual bool doImportDocument( librevenge::RVNGInputStream &rInput, librevenge::RVNGDrawingInterface &rGenerator ) = 0;
+ virtual void doRegisterHandlers( OdgGenerator &rGenerator );
private:
::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > mxContext;
diff --git a/writerperfect/source/draw/wpftdraw.component b/writerperfect/source/draw/wpftdraw.component
index d524116..cc65f3c 100644
--- a/writerperfect/source/draw/wpftdraw.component
+++ b/writerperfect/source/draw/wpftdraw.component
@@ -25,6 +25,10 @@
<service name="com.sun.star.document.ImportFilter"/>
<service name="com.sun.star.document.ExtendedTypeDetection"/>
</implementation>
+ <implementation name="com.sun.star.comp.Draw.MWAWDrawImportFilter">
+ <service name="com.sun.star.document.ImportFilter"/>
+ <service name="com.sun.star.document.ExtendedTypeDetection"/>
+ </implementation>
<implementation name="com.sun.star.comp.Draw.VisioImportFilter">
<service name="com.sun.star.document.ImportFilter"/>
<service name="com.sun.star.document.ExtendedTypeDetection"/>
diff --git a/writerperfect/source/draw/wpftdraw_genericfilter.cxx b/writerperfect/source/draw/wpftdraw_genericfilter.cxx
index 43cabc1..821ac7c 100644
--- a/writerperfect/source/draw/wpftdraw_genericfilter.cxx
+++ b/writerperfect/source/draw/wpftdraw_genericfilter.cxx
@@ -32,6 +32,7 @@
#include "CDRImportFilter.hxx"
#include "CMXImportFilter.hxx"
#include "MSPUBImportFilter.hxx"
+#include "MWAWDrawImportFilter.hxx"
#include "FreehandImportFilter.hxx"
#include "VisioImportFilter.hxx"
#include "WPGImportFilter.hxx"
@@ -53,6 +54,10 @@ static cppu::ImplementationEntry const services[] = {
&MSPUBImportFilter_getImplementationName,
&MSPUBImportFilter_getSupportedServiceNames,
&cppu::createSingleComponentFactory, 0, 0 },
+ { &MWAWDrawImportFilter_createInstance,
+ &MWAWDrawImportFilter_getImplementationName,
+ &MWAWDrawImportFilter_getSupportedServiceNames,
+ &cppu::createSingleComponentFactory, 0, 0 },
{ &VisioImportFilter_createInstance,
&VisioImportFilter_getImplementationName,
&VisioImportFilter_getSupportedServiceNames,
--
1.9.3

File diff suppressed because it is too large Load Diff

@ -0,0 +1,48 @@
From eab69b534b5fdfcd520fd5832aa2d184bba2fa26 Mon Sep 17 00:00:00 2001
From: David Tardon <dtardon@redhat.com>
Date: Thu, 29 May 2014 13:03:31 +0200
Subject: [PATCH 06/18] fix return value for libe-book import filter
Change-Id: Idd84489a3123d506166a24ff5c85a4e7f75ee676
(cherry picked from commit 5fde8e38c127a872a66b8029b69aff55b01d6d88)
---
writerperfect/source/writer/EBookImportFilter.cxx | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/writerperfect/source/writer/EBookImportFilter.cxx b/writerperfect/source/writer/EBookImportFilter.cxx
index 3003768..efe5334 100644
--- a/writerperfect/source/writer/EBookImportFilter.cxx
+++ b/writerperfect/source/writer/EBookImportFilter.cxx
@@ -28,18 +28,23 @@ using libebook::EBOOKDocument;
bool EBookImportFilter::doImportDocument( librevenge::RVNGInputStream &rInput, const rtl::OUString &rFilterName, librevenge::RVNGTextInterface &rGenerator )
{
+ EBOOKDocument::Type type = EBOOKDocument::TYPE_UNKNOWN;
+
if (rFilterName == "FictionBook 2")
- return EBOOKDocument::parse(&rInput, &rGenerator, EBOOKDocument::TYPE_FICTIONBOOK2);
+ type = EBOOKDocument::TYPE_FICTIONBOOK2;
else if (rFilterName == "PalmDoc")
- return EBOOKDocument::parse(&rInput, &rGenerator, EBOOKDocument::TYPE_PALMDOC);
+ type = EBOOKDocument::TYPE_PALMDOC;
else if (rFilterName == "Plucker eBook")
- return EBOOKDocument::parse(&rInput, &rGenerator, EBOOKDocument::TYPE_PLUCKER);
+ type = EBOOKDocument::TYPE_PLUCKER;
else if (rFilterName == "eReader eBook")
- return EBOOKDocument::parse(&rInput, &rGenerator, EBOOKDocument::TYPE_PEANUTPRESS);
+ type = EBOOKDocument::TYPE_PEANUTPRESS;
else if (rFilterName == "TealDoc")
- return EBOOKDocument::parse(&rInput, &rGenerator, EBOOKDocument::TYPE_TEALDOC);
+ type = EBOOKDocument::TYPE_TEALDOC;
else if (rFilterName == "zTXT")
- return EBOOKDocument::parse(&rInput, &rGenerator, EBOOKDocument::TYPE_ZTXT);
+ type = EBOOKDocument::TYPE_ZTXT;
+
+ if (EBOOKDocument::TYPE_UNKNOWN != type)
+ return EBOOKDocument::RESULT_OK == EBOOKDocument::parse(&rInput, &rGenerator, type);
return false;
}
--
1.9.3

@ -0,0 +1,92 @@
From 0ac751a600e77d574aadca9e852040da5d7bbb41 Mon Sep 17 00:00:00 2001
From: David Tardon <dtardon@redhat.com>
Date: Thu, 29 May 2014 13:31:54 +0200
Subject: [PATCH 07/18] parse zipped FictionBook 2 files again
Change-Id: I04eda7844a5557f834f3ada2cef991b0a181c8a0
(cherry picked from commit 2ac1d3949c383656e54d54556e52631cf4f45b71)
---
...01-parse-zipped-FictionBook-2-files-again.patch | 58 ++++++++++++++++++++++
external/libebook/UnpackedTarball_libebook.mk | 1 +
2 files changed, 59 insertions(+)
create mode 100644 external/libebook/0001-parse-zipped-FictionBook-2-files-again.patch
diff --git a/external/libebook/0001-parse-zipped-FictionBook-2-files-again.patch b/external/libebook/0001-parse-zipped-FictionBook-2-files-again.patch
new file mode 100644
index 0000000..d068e79
--- /dev/null
+++ b/external/libebook/0001-parse-zipped-FictionBook-2-files-again.patch
@@ -0,0 +1,58 @@
+From 5690c18cb2de1bf4f3cce3da8a2132303a0c731f Mon Sep 17 00:00:00 2001
+From: David Tardon <dtardon@redhat.com>
+Date: Thu, 29 May 2014 13:30:13 +0200
+Subject: [PATCH] parse zipped FictionBook 2 files again
+
+---
+ src/lib/EBOOKDocument.cpp | 28 +++++++++++++++++++++++++++-
+ 1 file changed, 27 insertions(+), 1 deletion(-)
+
+diff --git a/src/lib/EBOOKDocument.cpp b/src/lib/EBOOKDocument.cpp
+index 5b8e7ec..c4f9913 100644
+--- a/src/lib/EBOOKDocument.cpp
++++ b/src/lib/EBOOKDocument.cpp
+@@ -427,6 +427,25 @@ EBOOKAPI EBOOKDocument::Confidence EBOOKDocument::isSupported(librevenge::RVNGIn
+ }
+ }
+ #endif
++
++ // TODO: This needs improvement: zipped FictionBook 2 files can contain images too...
++ if (1 == input->subStreamCount())
++ {
++ const librevenge::RVNGString name(input->subStreamName(0));
++ const unsigned long size = name.size();
++ const char *const cName = name.cstr();
++ if (equal(cName + (size - 4), cName + size, ".fb2"))
++ {
++ const scoped_ptr<RVNGInputStream> fb2(input->getSubStreamById(0));
++ const Type xmlType = detectXML(fb2.get());
++ if (TYPE_FICTIONBOOK2 == xmlType)
++ {
++ if (type)
++ *type = xmlType;
++ return CONFIDENCE_EXCELLENT;
++ }
++ }
++ }
+ }
+
+ Confidence confidence = CONFIDENCE_NONE;
+@@ -533,7 +552,14 @@ EBOOKAPI EBOOKDocument::Result EBOOKDocument::parse(librevenge::RVNGInputStream
+ #endif
+ case TYPE_FICTIONBOOK2 :
+ {
+- FB2Parser parser(input_.get());
++ RVNGInputStreamPtr_t fb2Input(input_);
++ // TODO: this needs to handle package with images too
++ if (input_->isStructured())
++ {
++ assert(1 == input->subStreamCount());
++ fb2Input.reset(input->getSubStreamById(0));
++ }
++ FB2Parser parser(fb2Input.get());
+ return parser.parse(document) ? RESULT_OK : RESULT_UNKNOWN_ERROR;
+ }
+ #if defined ENABLE_EXPERIMENTAL
+--
+1.9.3
+
diff --git a/external/libebook/UnpackedTarball_libebook.mk b/external/libebook/UnpackedTarball_libebook.mk
index bcc098a..4986981 100644
--- a/external/libebook/UnpackedTarball_libebook.mk
+++ b/external/libebook/UnpackedTarball_libebook.mk
@@ -15,6 +15,7 @@ $(eval $(call gb_UnpackedTarball_set_patchlevel,libebook,1))
$(eval $(call gb_UnpackedTarball_add_patches,libebook,\
external/libebook/0001-blind-attempt-to-workaround-MSVC-bug.patch \
+ external/libebook/0001-parse-zipped-FictionBook-2-files-again.patch \
))
# vim: set noet sw=4 ts=4:
--
1.9.3

@ -0,0 +1,27 @@
From 78c555ce9d94218f74a319829cf88e79e02e1b62 Mon Sep 17 00:00:00 2001
From: David Tardon <dtardon@redhat.com>
Date: Thu, 29 May 2014 13:33:04 +0200
Subject: [PATCH 08/18] re-enable libe-book integration test
Change-Id: I217183d55607f16c3b996b27b131953962afee96
(cherry picked from commit 5dfb6e74c68073eb1742c53393c683d5841de255)
---
writerperfect/qa/unit/WpftWriterFilterTest.cxx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/writerperfect/qa/unit/WpftWriterFilterTest.cxx b/writerperfect/qa/unit/WpftWriterFilterTest.cxx
index 2e60222..8028522 100644
--- a/writerperfect/qa/unit/WpftWriterFilterTest.cxx
+++ b/writerperfect/qa/unit/WpftWriterFilterTest.cxx
@@ -32,7 +32,7 @@ WpftWriterFilterTest::WpftWriterFilterTest()
void WpftWriterFilterTest::test()
{
doTest("com.sun.star.comp.Writer.AbiWordImportFilter", "/writerperfect/qa/unit/data/writer/libabw/");
- // doTest("org.libreoffice.comp.Writer.EBookImportFilter", "/writerperfect/qa/unit/data/writer/libe-book/");
+ doTest("org.libreoffice.comp.Writer.EBookImportFilter", "/writerperfect/qa/unit/data/writer/libe-book/");
doTest("com.sun.star.comp.Writer.MSWorksImportFilter", "/writerperfect/qa/unit/data/writer/libwps/");
// doTest("com.sun.star.comp.Writer.MWAWImportFilter", "/writerperfect/qa/unit/data/writer/libmwaw/");
doTest("com.sun.star.comp.Writer.WordPerfectImportFilter", "/writerperfect/qa/unit/data/writer/libwpd/");
--
1.9.3

@ -0,0 +1,27 @@
From f43b8775a3d33269367e47ea081979971db85b58 Mon Sep 17 00:00:00 2001
From: David Tardon <dtardon@redhat.com>
Date: Thu, 29 May 2014 15:10:33 +0200
Subject: [PATCH 09/18] use the right XML import service
Change-Id: I45637984f02e3363812ff8c9f0cbd3464786f4de
(cherry picked from commit 243e6a98d80ed896686b4486b4e675ffb2cc1f59)
---
writerperfect/source/impress/KeynoteImportFilter.cxx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/writerperfect/source/impress/KeynoteImportFilter.cxx b/writerperfect/source/impress/KeynoteImportFilter.cxx
index 236e5d9..5edbfa9 100644
--- a/writerperfect/source/impress/KeynoteImportFilter.cxx
+++ b/writerperfect/source/impress/KeynoteImportFilter.cxx
@@ -133,7 +133,7 @@ throw (RuntimeException, std::exception)
// An XML import service: what we push sax messages to..
Reference < XDocumentHandler > xInternalHandler(
mxContext->getServiceManager()->createInstanceWithContext(
- "com.sun.star.comp.Draw.XMLOasisImporter", mxContext),
+ "com.sun.star.comp.Impress.XMLOasisImporter", mxContext),
css::uno::UNO_QUERY_THROW);
// The XImporter sets up an empty target document for XDocumentHandler to write to..
--
1.9.3

@ -0,0 +1,743 @@
From c9c8ad017f8e1c0509725f14370e85f7b70024e7 Mon Sep 17 00:00:00 2001
From: osnola <alonso@loria.fr>
Date: Thu, 29 May 2014 10:26:28 +0200
Subject: [PATCH 10/18] Try to add support for WKS/WDB files...
Change-Id: I0ff1cd35be0e1546a156bc673770a920ad2ca444
(cherry picked from commit e1fa08fe92d7d3f89f5f75cb67f17bb491c42361)
---
Repository.mk | 1 +
filter/Configuration_filter.mk | 2 +
.../config/fragments/filters/MS_Works_Calc.xcu | 30 ++++
.../fragments/types/calc_MS_Works_Document.xcu | 29 ++++
writerperfect/Library_wpftcalc.mk | 56 +++++++
writerperfect/Module_writerperfect.mk | 1 +
writerperfect/source/calc/ImportFilterBase.cxx | 182 +++++++++++++++++++++
writerperfect/source/calc/ImportFilterBase.hxx | 103 ++++++++++++
.../source/calc/MSWorksCalcImportFilter.cxx | 91 +++++++++++
.../source/calc/MSWorksCalcImportFilter.hxx | 53 ++++++
writerperfect/source/calc/wpftcalc.component | 16 ++
.../source/calc/wpftcalc_genericfilter.cxx | 51 ++++++
12 files changed, 615 insertions(+)
create mode 100644 filter/source/config/fragments/filters/MS_Works_Calc.xcu
create mode 100644 filter/source/config/fragments/types/calc_MS_Works_Document.xcu
create mode 100644 writerperfect/Library_wpftcalc.mk
create mode 100644 writerperfect/source/calc/ImportFilterBase.cxx
create mode 100644 writerperfect/source/calc/ImportFilterBase.hxx
create mode 100644 writerperfect/source/calc/MSWorksCalcImportFilter.cxx
create mode 100644 writerperfect/source/calc/MSWorksCalcImportFilter.hxx
create mode 100644 writerperfect/source/calc/wpftcalc.component
create mode 100644 writerperfect/source/calc/wpftcalc_genericfilter.cxx
diff --git a/Repository.mk b/Repository.mk
index 1e6745a..700d9f5 100644
--- a/Repository.mk
+++ b/Repository.mk
@@ -162,6 +162,7 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,calc, \
scd \
scfilt \
scui \
+ wpftcalc \
$(if $(ENABLE_OPENCL),scopencl) \
$(if $(ENABLE_COINMP)$(ENABLE_LPSOLVE),solver) \
$(if $(DISABLE_SCRIPTING),,vbaobj) \
diff --git a/filter/Configuration_filter.mk b/filter/Configuration_filter.mk
index 9783f50..ebd9bf2 100644
--- a/filter/Configuration_filter.mk
+++ b/filter/Configuration_filter.mk
@@ -537,6 +537,7 @@ $(call filter_Configuration_add_types,fcfg_langpack,fcfg_calc_types.xcu,filter/s
MS_Excel_2007_Binary \
calc_OOXML \
calc_OOXML_Template \
+ calc_MS_Works_Document \
)
$(call filter_Configuration_add_filters,fcfg_langpack,fcfg_calc_filters.xcu,filter/source/config/fragments/filters,\
@@ -568,6 +569,7 @@ $(call filter_Configuration_add_filters,fcfg_langpack,fcfg_calc_filters.xcu,filt
calc_MS_Excel_2007_Binary \
calc_OOXML \
calc_OOXML_Template \
+ MS_Works_Calc \
)
$(call filter_Configuration_add_ui_filters,fcfg_langpack,filter/source/config/fragments/filters,\
diff --git a/filter/source/config/fragments/filters/MS_Works_Calc.xcu b/filter/source/config/fragments/filters/MS_Works_Calc.xcu
new file mode 100644
index 0000000..a8222a7
--- /dev/null
+++ b/filter/source/config/fragments/filters/MS_Works_Calc.xcu
@@ -0,0 +1,30 @@
+<!--
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+-->
+ <node oor:name="MS_Works_Calc" oor:op="replace">
+ <prop oor:name="Flags"><value>IMPORT ALIEN USESOPTIONS 3RDPARTYFILTER</value></prop>
+ <prop oor:name="UIComponent"/>
+ <prop oor:name="FilterService"><value>com.sun.star.comp.Calc.MSWorksCalcImportFilter</value></prop>
+ <prop oor:name="UserData"><value></value></prop>
+ <prop oor:name="UIName">
+ <value xml:lang="en-US">Microsoft Works Document</value>
+ </prop>
+ <prop oor:name="FileFormatVersion"><value>0</value></prop>
+ <prop oor:name="Type"><value>calc_MS_Works_Document</value></prop>
+ <prop oor:name="TemplateName"/>
+ <prop oor:name="DocumentService"><value>com.sun.star.sheet.SpreadsheetDocument</value></prop>
+ </node>
diff --git a/filter/source/config/fragments/types/calc_MS_Works_Document.xcu b/filter/source/config/fragments/types/calc_MS_Works_Document.xcu
new file mode 100644
index 0000000..d409be8
--- /dev/null
+++ b/filter/source/config/fragments/types/calc_MS_Works_Document.xcu
@@ -0,0 +1,29 @@
+<!--
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+-->
+ <node oor:name="calc_MS_Works_Document" oor:op="replace" >
+ <prop oor:name="DetectService"><value>com.sun.star.comp.Calc.MSWorksCalcImportFilter</value></prop>
+ <prop oor:name="URLPattern"/>
+ <prop oor:name="Extensions"><value>wps</value></prop>
+ <prop oor:name="MediaType"><value>application/vnd.ms-works</value></prop>
+ <prop oor:name="Preferred"><value>true</value></prop>
+ <prop oor:name="PreferredFilter"><value>MS_Works_Calc</value></prop>
+ <prop oor:name="UIName">
+ <value>Microsoft Works Document</value>
+ </prop>
+ <prop oor:name="ClipboardFormat"/>
+ </node>
diff --git a/writerperfect/Library_wpftcalc.mk b/writerperfect/Library_wpftcalc.mk
new file mode 100644
index 0000000..2e69c3b
--- /dev/null
+++ b/writerperfect/Library_wpftcalc.mk
@@ -0,0 +1,56 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+# This file incorporates work covered by the following license notice:
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed
+# with this work for additional information regarding copyright
+# ownership. The ASF licenses this file to you under the Apache
+# License, Version 2.0 (the "License"); you may not use this file
+# except in compliance with the License. You may obtain a copy of
+# the License at http://www.apache.org/licenses/LICENSE-2.0 .
+#
+
+$(eval $(call gb_Library_Library,wpftcalc))
+
+$(eval $(call gb_Library_set_componentfile,wpftcalc,writerperfect/source/calc/wpftcalc))
+
+$(eval $(call gb_Library_use_sdk_api,wpftcalc))
+
+$(eval $(call gb_Library_use_libraries,wpftcalc,\
+ comphelper \
+ cppu \
+ cppuhelper \
+ sal \
+ sot \
+ tl \
+ utl \
+ writerperfect \
+ xo \
+ $(gb_UWINAPI) \
+))
+
+$(eval $(call gb_Library_use_externals,wpftcalc,\
+ odfgen \
+ revenge \
+ wps \
+ zlib \
+ lcms2 \
+ libxml2 \
+ icui18n \
+ icuuc \
+))
+
+$(eval $(call gb_Library_add_exception_objects,wpftcalc,\
+ writerperfect/source/calc/ImportFilterBase \
+ writerperfect/source/calc/MSWorksCalcImportFilter \
+ writerperfect/source/calc/wpftcalc_genericfilter \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/writerperfect/Module_writerperfect.mk b/writerperfect/Module_writerperfect.mk
index 24decb4..37da37c 100644
--- a/writerperfect/Module_writerperfect.mk
+++ b/writerperfect/Module_writerperfect.mk
@@ -20,6 +20,7 @@
$(eval $(call gb_Module_Module,writerperfect))
$(eval $(call gb_Module_add_targets,writerperfect,\
+ Library_wpftcalc \
Library_wpftdraw \
Library_wpftimpress \
Library_wpftwriter \
diff --git a/writerperfect/source/calc/ImportFilterBase.cxx b/writerperfect/source/calc/ImportFilterBase.cxx
new file mode 100644
index 0000000..ef36746
--- /dev/null
+++ b/writerperfect/source/calc/ImportFilterBase.cxx
@@ -0,0 +1,182 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/io/XInputStream.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/xml/sax/XAttributeList.hpp>
+#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
+#include <com/sun/star/xml/sax/InputSource.hpp>
+#include <com/sun/star/xml/sax/XParser.hpp>
+#include <com/sun/star/io/XSeekable.hpp>
+#include <com/sun/star/uno/Reference.h>
+
+#include <writerperfect/DocumentHandler.hxx>
+#include <writerperfect/WPXSvInputStream.hxx>
+
+#include <xmloff/attrlist.hxx>
+
+#include <libodfgen/libodfgen.hxx>
+
+#include "ImportFilterBase.hxx"
+
+namespace writerperfect
+{
+namespace calc
+{
+
+using com::sun::star::uno::Reference;
+using com::sun::star::io::XInputStream;
+using com::sun::star::io::XSeekable;
+using com::sun::star::uno::Sequence;
+using com::sun::star::uno::Any;
+using com::sun::star::uno::UNO_QUERY;
+using com::sun::star::uno::XInterface;
+using com::sun::star::uno::Exception;
+using com::sun::star::uno::RuntimeException;
+using com::sun::star::beans::PropertyValue;
+using com::sun::star::document::XFilter;
+using com::sun::star::document::XExtendedFilterDetection;
+using com::sun::star::document::XImporter;
+using com::sun::star::xml::sax::InputSource;
+using com::sun::star::xml::sax::XAttributeList;
+using com::sun::star::xml::sax::XDocumentHandler;
+using com::sun::star::xml::sax::XParser;
+
+using writerperfect::DocumentHandler;
+using writerperfect::WPXSvInputStream;
+
+ImportFilterImpl::ImportFilterImpl( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > &rxContext )
+ : mxContext( rxContext )
+{
+}
+
+ImportFilterImpl::~ImportFilterImpl()
+{
+}
+
+sal_Bool SAL_CALL ImportFilterImpl::filter( const Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor )
+throw (RuntimeException, std::exception)
+{
+ sal_Int32 nLength = aDescriptor.getLength();
+ const PropertyValue *pValue = aDescriptor.getConstArray();
+ Reference < XInputStream > xInputStream;
+ for ( sal_Int32 i = 0 ; i < nLength; i++)
+ {
+ if ( pValue[i].Name == "InputStream" )
+ pValue[i].Value >>= xInputStream;
+ }
+ if ( !xInputStream.is() )
+ {
+ OSL_ASSERT( false );
+ return sal_False;
+ }
+
+ // An XML import service: what we push sax messages to..
+ Reference < XDocumentHandler > xInternalHandler(
+ mxContext->getServiceManager()->createInstanceWithContext(
+ "com.sun.star.comp.Calc.XMLOasisImporter", mxContext),
+ css::uno::UNO_QUERY_THROW);
+
+ // The XImporter sets up an empty target document for XDocumentHandler to write to..
+ Reference < XImporter > xImporter(xInternalHandler, UNO_QUERY);
+ xImporter->setTargetDocument( mxDoc );
+
+ // OO Graphics Handler: abstract class to handle document SAX messages, concrete implementation here
+ // writes to in-memory target doc
+ DocumentHandler xHandler(xInternalHandler);
+
+ WPXSvInputStream input( xInputStream );
+
+ OdsGenerator exporter;
+ exporter.addDocumentHandler(&xHandler, ODF_FLAT_XML);
+
+ doRegisterHandlers(exporter);
+
+ return doImportDocument(input, exporter);
+}
+
+void SAL_CALL ImportFilterImpl::cancel( )
+throw (RuntimeException, std::exception)
+{
+}
+
+// XImporter
+void SAL_CALL ImportFilterImpl::setTargetDocument( const Reference< ::com::sun::star::lang::XComponent >& xDoc )
+throw (::com::sun::star::lang::IllegalArgumentException, RuntimeException, std::exception)
+{
+ mxDoc = xDoc;
+}
+
+// XExtendedFilterDetection
+OUString SAL_CALL ImportFilterImpl::detect( com::sun::star::uno::Sequence< PropertyValue >& Descriptor )
+throw( com::sun::star::uno::RuntimeException, std::exception )
+{
+ OUString sTypeName;
+ sal_Int32 nLength = Descriptor.getLength();
+ sal_Int32 location = nLength;
+ const PropertyValue *pValue = Descriptor.getConstArray();
+ Reference < XInputStream > xInputStream;
+ for ( sal_Int32 i = 0 ; i < nLength; i++)
+ {
+ if ( pValue[i].Name == "TypeName" )
+ location=i;
+ else if ( pValue[i].Name == "InputStream" )
+ pValue[i].Value >>= xInputStream;
+ }
+
+ if (!xInputStream.is())
+ return OUString();
+
+ WPXSvInputStream input( xInputStream );
+
+ if ( doDetectFormat( input, sTypeName ) )
+ {
+ assert (!sTypeName.isEmpty());
+
+ if ( location == nLength )
+ {
+ Descriptor.realloc(nLength+1);
+ Descriptor[location].Name = "TypeName";
+ }
+
+ Descriptor[location].Value <<=sTypeName;
+ }
+
+ return sTypeName;
+}
+
+
+// XInitialization
+void SAL_CALL ImportFilterImpl::initialize( const Sequence< Any >& aArguments )
+throw (Exception, RuntimeException, std::exception)
+{
+ Sequence < PropertyValue > aAnySeq;
+ sal_Int32 nLength = aArguments.getLength();
+ if ( nLength && ( aArguments[0] >>= aAnySeq ) )
+ {
+ const PropertyValue *pValue = aAnySeq.getConstArray();
+ nLength = aAnySeq.getLength();
+ for ( sal_Int32 i = 0 ; i < nLength; i++)
+ {
+ if ( pValue[i].Name == "Type" )
+ {
+ pValue[i].Value >>= msFilterName;
+ break;
+ }
+ }
+ }
+}
+
+void ImportFilterImpl::doRegisterHandlers( OdsGenerator & )
+{
+}
+
+}
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerperfect/source/calc/ImportFilterBase.hxx b/writerperfect/source/calc/ImportFilterBase.hxx
new file mode 100644
index 0000000..d6ef454
--- /dev/null
+++ b/writerperfect/source/calc/ImportFilterBase.hxx
@@ -0,0 +1,103 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef INCLUDED_WRITERPERFECT_SOURCE_CALC_IMPORTFILTERBASE_HXX
+#define INCLUDED_WRITERPERFECT_SOURCE_CALC_IMPORTFILTERBASE_HXX
+
+#include <librevenge/librevenge.h>
+
+#include <librevenge-stream/librevenge-stream.h>
+
+#include <com/sun/star/document/XFilter.hpp>
+#include <com/sun/star/document/XImporter.hpp>
+#include <com/sun/star/document/XExtendedFilterDetection.hpp>
+#include <com/sun/star/lang/XInitialization.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <cppuhelper/implbase1.hxx>
+#include <cppuhelper/implbase4.hxx>
+
+namespace com { namespace sun { namespace star {
+namespace beans
+{
+ struct PropertyValue;
+}
+namespace lang
+{
+ class XComponent;
+}
+namespace uno
+{
+ class XComponentContext;
+}
+namespace xml { namespace sax {
+ class XDocumentHandler;
+}
+}
+} } }
+
+class OdsGenerator;
+
+namespace writerperfect
+{
+namespace calc
+{
+
+/* This component will be instantiated for both import or export. Whether it calls
+ * setSourceDocument or setTargetDocument determines which Impl function the filter
+ * member calls */
+class ImportFilterImpl : public cppu::WeakImplHelper4
+ <
+ com::sun::star::document::XFilter,
+ com::sun::star::document::XImporter,
+ com::sun::star::document::XExtendedFilterDetection,
+ com::sun::star::lang::XInitialization
+ >
+{
+public:
+ ImportFilterImpl( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > &rxContext );
+ virtual ~ImportFilterImpl();
+
+ // XFilter
+ virtual sal_Bool SAL_CALL filter( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor )
+ throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+ virtual void SAL_CALL cancel( )
+ throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+
+ // XImporter
+ virtual void SAL_CALL setTargetDocument( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& xDoc )
+ throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+
+ //XExtendedFilterDetection
+ virtual OUString SAL_CALL detect( com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& Descriptor )
+ throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
+
+ // XInitialization
+ virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments )
+ throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+
+private:
+ virtual bool doDetectFormat( librevenge::RVNGInputStream &rInput, OUString &rTypeName ) = 0;
+ virtual bool doImportDocument( librevenge::RVNGInputStream &rInput, librevenge::RVNGSpreadsheetInterface &rGenerator ) = 0;
+ virtual void doRegisterHandlers( OdsGenerator &rGenerator );
+
+private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > mxContext;
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > mxDoc;
+ OUString msFilterName;
+ ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > mxHandler;
+};
+
+/** A base class for import filters.
+ */
+typedef cppu::ImplInheritanceHelper1<ImportFilterImpl, com::sun::star::lang::XServiceInfo> ImportFilterBase;
+
+}
+}
+
+#endif // INCLUDED_WRITERPERFECT_SOURCE_CALC_IMPORTFILTERBASE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerperfect/source/calc/MSWorksCalcImportFilter.cxx b/writerperfect/source/calc/MSWorksCalcImportFilter.cxx
new file mode 100644
index 0000000..1c38f4c
--- /dev/null
+++ b/writerperfect/source/calc/MSWorksCalcImportFilter.cxx
@@ -0,0 +1,91 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* MSWorksCalcImportFilter: Sets up the filter, and calls DocumentCollector
+ * to do the actual filtering
+ *
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include <com/sun/star/uno/Reference.h>
+#include <cppuhelper/supportsservice.hxx>
+
+#include <libwps/libwps.h>
+
+#include "MSWorksCalcImportFilter.hxx"
+
+using com::sun::star::uno::Sequence;
+using com::sun::star::uno::Reference;
+using com::sun::star::uno::Any;
+using com::sun::star::uno::XInterface;
+using com::sun::star::uno::Exception;
+using com::sun::star::uno::RuntimeException;
+using com::sun::star::uno::XComponentContext;
+
+bool MSWorksCalcImportFilter::doImportDocument( librevenge::RVNGInputStream &rInput, librevenge::RVNGSpreadsheetInterface &rGenerator )
+{
+ return libwps::WPS_OK == libwps::WPSDocument::parse(&rInput, &rGenerator);
+}
+
+bool MSWorksCalcImportFilter::doDetectFormat( librevenge::RVNGInputStream &rInput, OUString &rTypeName )
+{
+ libwps::WPSKind kind = libwps::WPS_TEXT;
+ const libwps::WPSConfidence confidence = libwps::WPSDocument::isFileFormatSupported(&rInput, kind);
+
+ if ((kind == libwps::WPS_SPREADSHEET || kind == libwps::WPS_DATABASE) && (confidence == libwps::WPS_CONFIDENCE_EXCELLENT))
+ {
+ rTypeName = "calc_MS_Works_Document";
+ return true;
+ }
+
+ return false;
+}
+
+void MSWorksCalcImportFilter::doRegisterHandlers( OdsGenerator & )
+{
+}
+
+OUString MSWorksCalcImportFilter_getImplementationName ()
+throw (RuntimeException)
+{
+ return OUString ( "com.sun.star.comp.Calc.MSWorksCalcImportFilter" );
+}
+
+Sequence< OUString > SAL_CALL MSWorksCalcImportFilter_getSupportedServiceNames( )
+throw (RuntimeException)
+{
+ Sequence < OUString > aRet(2);
+ OUString *pArray = aRet.getArray();
+ pArray[0] = "com.sun.star.document.ImportFilter";
+ pArray[1] = "com.sun.star.document.ExtendedTypeDetection";
+ return aRet;
+}
+#undef SERVICE_NAME2
+#undef SERVICE_NAME1
+
+Reference< XInterface > SAL_CALL MSWorksCalcImportFilter_createInstance( const Reference< XComponentContext > & rContext)
+throw( Exception )
+{
+ return (cppu::OWeakObject *) new MSWorksCalcImportFilter( rContext );
+}
+
+// XServiceInfo
+OUString SAL_CALL MSWorksCalcImportFilter::getImplementationName( )
+throw (RuntimeException, std::exception)
+{
+ return MSWorksCalcImportFilter_getImplementationName();
+}
+sal_Bool SAL_CALL MSWorksCalcImportFilter::supportsService( const OUString &rServiceName )
+throw (RuntimeException, std::exception)
+{
+ return cppu::supportsService( this, rServiceName );
+}
+Sequence< OUString > SAL_CALL MSWorksCalcImportFilter::getSupportedServiceNames( )
+throw (RuntimeException, std::exception)
+{
+ return MSWorksCalcImportFilter_getSupportedServiceNames();
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerperfect/source/calc/MSWorksCalcImportFilter.hxx b/writerperfect/source/calc/MSWorksCalcImportFilter.hxx
new file mode 100644
index 0000000..2487c50
--- /dev/null
+++ b/writerperfect/source/calc/MSWorksCalcImportFilter.hxx
@@ -0,0 +1,53 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef _MSWORKSCALCIMPORTFILTER_HXX
+#define _MSWORKSCALCIMPORTFILTER_HXX
+
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+
+#include "ImportFilterBase.hxx"
+
+/* This component will be instantiated for both import or export. Whether it calls
+ * setSourceDocument or setTargetDocument determines which Impl function the filter
+ * member calls */
+class MSWorksCalcImportFilter : public writerperfect::calc::ImportFilterBase
+{
+public:
+ MSWorksCalcImportFilter( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > &rxContext )
+ : writerperfect::calc::ImportFilterBase( rxContext ) {}
+
+ // XServiceInfo
+ virtual OUString SAL_CALL getImplementationName( )
+ throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+ virtual sal_Bool SAL_CALL supportsService( const OUString &ServiceName )
+ throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( )
+ throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+
+private:
+ virtual bool doDetectFormat( librevenge::RVNGInputStream &rInput, OUString &rTypeName ) SAL_OVERRIDE;
+ virtual bool doImportDocument( librevenge::RVNGInputStream &rInput, librevenge::RVNGSpreadsheetInterface &rGenerator ) SAL_OVERRIDE;
+ virtual void doRegisterHandlers( OdsGenerator &rGenerator ) SAL_OVERRIDE;
+};
+
+OUString MSWorksCalcImportFilter_getImplementationName()
+throw ( ::com::sun::star::uno::RuntimeException );
+
+::com::sun::star::uno::Sequence< OUString > SAL_CALL MSWorksCalcImportFilter_getSupportedServiceNames( )
+throw ( ::com::sun::star::uno::RuntimeException );
+
+::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
+SAL_CALL MSWorksCalcImportFilter_createInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > & rContext)
+throw ( ::com::sun::star::uno::Exception );
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerperfect/source/calc/wpftcalc.component b/writerperfect/source/calc/wpftcalc.component
new file mode 100644
index 0000000..c2def1e
--- /dev/null
+++ b/writerperfect/source/calc/wpftcalc.component
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+-->
+<component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
+ prefix="wpftcalc" xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.Calc.MSWorksCalcImportFilter">
+ <service name="com.sun.star.document.ImportFilter"/>
+ <service name="com.sun.star.document.ExtendedTypeDetection"/>
+ </implementation>
+</component>
diff --git a/writerperfect/source/calc/wpftcalc_genericfilter.cxx b/writerperfect/source/calc/wpftcalc_genericfilter.cxx
new file mode 100644
index 0000000..eecd0b0
--- /dev/null
+++ b/writerperfect/source/calc/wpftcalc_genericfilter.cxx
@@ -0,0 +1,51 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+/* genericfilter: mostly generic code for registering the filter */
+
+/* "This product is not manufactured, approved, or supported by
+ * Corel Corporation or Corel Corporation Limited."
+ */
+
+#include "sal/config.h"
+
+#include "cppuhelper/factory.hxx"
+#include "cppuhelper/implementationentry.hxx"
+#include "sal/types.h"
+
+#include "MSWorksCalcImportFilter.hxx"
+
+namespace {
+
+static cppu::ImplementationEntry const services[] = {
+ { &MSWorksCalcImportFilter_createInstance, &MSWorksCalcImportFilter_getImplementationName,
+ &MSWorksCalcImportFilter_getSupportedServiceNames,
+ &cppu::createSingleComponentFactory, 0, 0 },
+ { 0, 0, 0, 0, 0, 0 } };
+
+}
+
+extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL wpftcalc_component_getFactory(
+ char const * pImplName, void * pServiceManager, void * pRegistryKey)
+{
+ return cppu::component_getFactoryHelper(
+ pImplName, pServiceManager, pRegistryKey, services);
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
--
1.9.3

@ -0,0 +1,56 @@
From 0dca001fd4cb1397137ae0e217950494bb86d6c8 Mon Sep 17 00:00:00 2001
From: osnola <alonso@loria.fr>
Date: Thu, 29 May 2014 14:29:45 +0200
Subject: [PATCH 11/18] Make the wdb/wks and GreatWorks(draw) work
Change-Id: I1a736a511e6007a4ed6413eb8d9b8e364d73f765
(cherry picked from commit eccfc72781dfa485c94b251e81718bdddd544606)
---
filter/source/config/fragments/filters/Great_Works_Draw.xcu | 2 +-
filter/source/config/fragments/types/calc_MS_Works_Document.xcu | 4 ++--
postprocess/Rdb_services.mk | 1 +
3 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/filter/source/config/fragments/filters/Great_Works_Draw.xcu b/filter/source/config/fragments/filters/Great_Works_Draw.xcu
index 4bb0667..8153102 100644
--- a/filter/source/config/fragments/filters/Great_Works_Draw.xcu
+++ b/filter/source/config/fragments/filters/Great_Works_Draw.xcu
@@ -12,7 +12,7 @@
<value>IMPORT ALIEN USESOPTIONS 3RDPARTYFILTER PREFERRED</value>
</prop>
<prop oor:name="FilterService">
- <value>com.sun.star.comp.Draaw.MWAWDrawImportFilter</value>
+ <value>com.sun.star.comp.Draw.MWAWDrawImportFilter</value>
</prop>
<prop oor:name="UIName">
<value xml:lang="en-US">GreatWorks Document</value>
diff --git a/filter/source/config/fragments/types/calc_MS_Works_Document.xcu b/filter/source/config/fragments/types/calc_MS_Works_Document.xcu
index d409be8..8785a32 100644
--- a/filter/source/config/fragments/types/calc_MS_Works_Document.xcu
+++ b/filter/source/config/fragments/types/calc_MS_Works_Document.xcu
@@ -18,8 +18,8 @@
<node oor:name="calc_MS_Works_Document" oor:op="replace" >
<prop oor:name="DetectService"><value>com.sun.star.comp.Calc.MSWorksCalcImportFilter</value></prop>
<prop oor:name="URLPattern"/>
- <prop oor:name="Extensions"><value>wps</value></prop>
- <prop oor:name="MediaType"><value>application/vnd.ms-works</value></prop>
+ <prop oor:name="Extensions"><value>wks/wdb</value></prop>
+ <prop oor:name="MediaType"></prop>
<prop oor:name="Preferred"><value>true</value></prop>
<prop oor:name="PreferredFilter"><value>MS_Works_Calc</value></prop>
<prop oor:name="UIName">
diff --git a/postprocess/Rdb_services.mk b/postprocess/Rdb_services.mk
index 9ebe6d2..a1fe9bc 100644
--- a/postprocess/Rdb_services.mk
+++ b/postprocess/Rdb_services.mk
@@ -120,6 +120,7 @@ $(eval $(call gb_Rdb_add_components,services,\
writerperfect/source/draw/wpftdraw \
writerperfect/source/impress/wpftimpress \
writerperfect/source/writer/wpftwriter \
+ writerperfect/source/calc/wpftcalc \
$(if $(filter MACOSX,$(OS)), \
$(if $(filter 1060,$(MACOSX_SDK_VERSION)),, \
$(call gb_Helper_optional,AVMEDIA,avmedia/source/macavf/avmediaMacAVF) \
--
1.9.3

@ -0,0 +1,146 @@
From 6a79c9ce401e98c4fa90a870ed29770db3f9f9e2 Mon Sep 17 00:00:00 2001
From: David Tardon <dtardon@redhat.com>
Date: Thu, 29 May 2014 15:35:15 +0200
Subject: [PATCH 12/18] add writerperfect calc integration test
Change-Id: I3ce072f5f7d54b063988f8413251eab00f5321e4
(cherry picked from commit b6ea5de5eda77fa1bb0b7ee8248f001d58bae6be)
---
writerperfect/CppunitTest_writerperfect_calc.mk | 46 ++++++++++++++++++++++
writerperfect/Module_writerperfect.mk | 1 +
writerperfect/qa/unit/WpftCalcFilterTest.cxx | 43 ++++++++++++++++++++
.../qa/unit/data/calc/libwps/fail/.gitignore | 0
.../unit/data/calc/libwps/indeterminate/.gitignore | 0
.../qa/unit/data/calc/libwps/pass/.gitignore | 0
6 files changed, 90 insertions(+)
create mode 100644 writerperfect/CppunitTest_writerperfect_calc.mk
create mode 100644 writerperfect/qa/unit/WpftCalcFilterTest.cxx
create mode 100644 writerperfect/qa/unit/data/calc/libwps/fail/.gitignore
create mode 100644 writerperfect/qa/unit/data/calc/libwps/indeterminate/.gitignore
create mode 100644 writerperfect/qa/unit/data/calc/libwps/pass/.gitignore
diff --git a/writerperfect/CppunitTest_writerperfect_calc.mk b/writerperfect/CppunitTest_writerperfect_calc.mk
new file mode 100644
index 0000000..1a05595
--- /dev/null
+++ b/writerperfect/CppunitTest_writerperfect_calc.mk
@@ -0,0 +1,46 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_CppunitTest_CppunitTest,writerperfect_calc))
+
+$(eval $(call gb_CppunitTest_use_externals,writerperfect_calc,\
+ boost_headers \
+))
+
+$(eval $(call gb_CppunitTest_use_api,writerperfect_calc,\
+ offapi \
+ udkapi \
+))
+
+$(eval $(call gb_CppunitTest_use_libraries,writerperfect_calc,\
+ comphelper \
+ cppu \
+ cppuhelper \
+ sal \
+ test \
+ ucbhelper \
+ unotest \
+ $(gb_UWINAPI) \
+))
+
+$(eval $(call gb_CppunitTest_use_static_libraries,writerperfect_calc,\
+ writerperfect_importtestbase \
+))
+
+$(eval $(call gb_CppunitTest_use_ure,writerperfect_calc))
+
+$(eval $(call gb_CppunitTest_use_rdb,writerperfect_calc,services))
+
+$(eval $(call gb_CppunitTest_use_configuration,writerperfect_calc))
+
+$(eval $(call gb_CppunitTest_add_exception_objects,writerperfect_calc,\
+ writerperfect/qa/unit/WpftCalcFilterTest \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/writerperfect/Module_writerperfect.mk b/writerperfect/Module_writerperfect.mk
index 37da37c..9c30697 100644
--- a/writerperfect/Module_writerperfect.mk
+++ b/writerperfect/Module_writerperfect.mk
@@ -32,6 +32,7 @@ $(eval $(call gb_Module_add_check_targets,writerperfect,\
))
$(eval $(call gb_Module_add_slowcheck_targets,writerperfect,\
+ CppunitTest_writerperfect_calc \
CppunitTest_writerperfect_draw \
CppunitTest_writerperfect_impress \
CppunitTest_writerperfect_writer \
diff --git a/writerperfect/qa/unit/WpftCalcFilterTest.cxx b/writerperfect/qa/unit/WpftCalcFilterTest.cxx
new file mode 100644
index 0000000..ba1ed1e
--- /dev/null
+++ b/writerperfect/qa/unit/WpftCalcFilterTest.cxx
@@ -0,0 +1,43 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include "WpftImportTestBase.hxx"
+
+namespace
+{
+
+class WpftCalcFilterTest : public writerperfect::test::WpftImportTestBase
+{
+public:
+ WpftCalcFilterTest();
+
+ void test();
+
+ CPPUNIT_TEST_SUITE(WpftCalcFilterTest);
+ CPPUNIT_TEST(test);
+ CPPUNIT_TEST_SUITE_END();
+};
+
+WpftCalcFilterTest::WpftCalcFilterTest()
+ : writerperfect::test::WpftImportTestBase("private:factory/scalc")
+{
+}
+
+void WpftCalcFilterTest::test()
+{
+ doTest("com.sun.star.comp.Calc.MSWorksCalcImportFilter", "/writerperfect/qa/unit/data/calc/libwps/");
+}
+
+CPPUNIT_TEST_SUITE_REGISTRATION(WpftCalcFilterTest);
+
+}
+
+CPPUNIT_PLUGIN_IMPLEMENT();
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerperfect/qa/unit/data/calc/libwps/fail/.gitignore b/writerperfect/qa/unit/data/calc/libwps/fail/.gitignore
new file mode 100644
index 0000000..e69de29
diff --git a/writerperfect/qa/unit/data/calc/libwps/indeterminate/.gitignore b/writerperfect/qa/unit/data/calc/libwps/indeterminate/.gitignore
new file mode 100644
index 0000000..e69de29
diff --git a/writerperfect/qa/unit/data/calc/libwps/pass/.gitignore b/writerperfect/qa/unit/data/calc/libwps/pass/.gitignore
new file mode 100644
index 0000000..e69de29
--
1.9.3

@ -0,0 +1,810 @@
From 9954bf0938e34361d4d785c4109de303d422a8c8 Mon Sep 17 00:00:00 2001
From: osnola <alonso@loria.fr>
Date: Thu, 29 May 2014 15:35:18 +0200
Subject: [PATCH 13/18] Add new libmwaw's database/spreadsheet formats...
Change-Id: If07a9e548e1db15b403126263f63d9d09575eb95
(cherry picked from commit 696c8edf7a7731ea4e0f3e4ec4dfeadac2f8ffad)
---
filter/Configuration_filter.mk | 12 ++
.../config/fragments/filters/Beagle_Works_Calc.xcu | 29 ++++
.../config/fragments/filters/ClarisWorks_Calc.xcu | 30 ++++
.../fragments/filters/Claris_Resolve_Calc.xcu | 30 ++++
.../config/fragments/filters/Great_Works_Calc.xcu | 29 ++++
.../config/fragments/filters/Mac_Wingz_Calc.xcu | 30 ++++
.../config/fragments/filters/Mac_Works_Calc.xcu | 30 ++++
.../config/fragments/types/calc_Beagle_Works.xcu | 29 ++++
.../config/fragments/types/calc_ClarisWorks.xcu | 29 ++++
.../config/fragments/types/calc_Claris_Resolve.xcu | 29 ++++
.../config/fragments/types/calc_Great_Works.xcu | 29 ++++
.../config/fragments/types/calc_Mac_Wingz.xcu | 29 ++++
.../config/fragments/types/calc_Mac_Works.xcu | 29 ++++
writerperfect/Library_wpftcalc.mk | 2 +
writerperfect/source/calc/MWAWCalcImportFilter.cxx | 191 +++++++++++++++++++++
writerperfect/source/calc/MWAWCalcImportFilter.hxx | 53 ++++++
writerperfect/source/calc/wpftcalc.component | 4 +
.../source/calc/wpftcalc_genericfilter.cxx | 4 +
18 files changed, 618 insertions(+)
create mode 100644 filter/source/config/fragments/filters/Beagle_Works_Calc.xcu
create mode 100644 filter/source/config/fragments/filters/ClarisWorks_Calc.xcu
create mode 100644 filter/source/config/fragments/filters/Claris_Resolve_Calc.xcu
create mode 100644 filter/source/config/fragments/filters/Great_Works_Calc.xcu
create mode 100644 filter/source/config/fragments/filters/Mac_Wingz_Calc.xcu
create mode 100644 filter/source/config/fragments/filters/Mac_Works_Calc.xcu
create mode 100644 filter/source/config/fragments/types/calc_Beagle_Works.xcu
create mode 100644 filter/source/config/fragments/types/calc_ClarisWorks.xcu
create mode 100644 filter/source/config/fragments/types/calc_Claris_Resolve.xcu
create mode 100644 filter/source/config/fragments/types/calc_Great_Works.xcu
create mode 100644 filter/source/config/fragments/types/calc_Mac_Wingz.xcu
create mode 100644 filter/source/config/fragments/types/calc_Mac_Works.xcu
create mode 100644 writerperfect/source/calc/MWAWCalcImportFilter.cxx
create mode 100644 writerperfect/source/calc/MWAWCalcImportFilter.hxx
diff --git a/filter/Configuration_filter.mk b/filter/Configuration_filter.mk
index ebd9bf2..825a899 100644
--- a/filter/Configuration_filter.mk
+++ b/filter/Configuration_filter.mk
@@ -538,6 +538,12 @@ $(call filter_Configuration_add_types,fcfg_langpack,fcfg_calc_types.xcu,filter/s
calc_OOXML \
calc_OOXML_Template \
calc_MS_Works_Document \
+ calc_Beagle_Works \
+ calc_ClarisWorks \
+ calc_Claris_Resolve \
+ calc_Great_Works \
+ calc_Mac_Works \
+ calc_Mac_Wingz \
)
$(call filter_Configuration_add_filters,fcfg_langpack,fcfg_calc_filters.xcu,filter/source/config/fragments/filters,\
@@ -570,6 +576,12 @@ $(call filter_Configuration_add_filters,fcfg_langpack,fcfg_calc_filters.xcu,filt
calc_OOXML \
calc_OOXML_Template \
MS_Works_Calc \
+ Beagle_Works_Calc \
+ ClarisWorks_Calc \
+ Claris_Resolve_Calc \
+ Great_Works_Calc \
+ Mac_Wingz_Calc \
+ Mac_Works_Calc \
)
$(call filter_Configuration_add_ui_filters,fcfg_langpack,filter/source/config/fragments/filters,\
diff --git a/filter/source/config/fragments/filters/Beagle_Works_Calc.xcu b/filter/source/config/fragments/filters/Beagle_Works_Calc.xcu
new file mode 100644
index 0000000..3d70268
--- /dev/null
+++ b/filter/source/config/fragments/filters/Beagle_Works_Calc.xcu
@@ -0,0 +1,29 @@
+<!--
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+-->
+
+<node oor:name="Beagle_Works_Calc" oor:op="replace">
+ <prop oor:name="Flags">
+ <value>IMPORT ALIEN USESOPTIONS 3RDPARTYFILTER PREFERRED</value>
+ </prop>
+ <prop oor:name="FilterService">
+ <value>com.sun.star.comp.Calc.MWAWCalcImportFilter</value>
+ </prop>
+ <prop oor:name="UIName">
+ <value xml:lang="en-US">BeagleWorks/WordPerfect Works v1 Document</value>
+ </prop>
+ <prop oor:name="FileFormatVersion">
+ <value>0</value>
+ </prop>
+ <prop oor:name="Type">
+ <value>calc_Beagle_Works</value>
+ </prop>
+ <prop oor:name="DocumentService">
+ <value>com.sun.star.sheet.SpreadsheetDocument</value>
+ </prop>
+</node>
diff --git a/filter/source/config/fragments/filters/ClarisWorks_Calc.xcu b/filter/source/config/fragments/filters/ClarisWorks_Calc.xcu
new file mode 100644
index 0000000..77e6fdb
--- /dev/null
+++ b/filter/source/config/fragments/filters/ClarisWorks_Calc.xcu
@@ -0,0 +1,30 @@
+<!--
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+-->
+ <node oor:name="ClarisWorks_Calc" oor:op="replace">
+ <prop oor:name="Flags"><value>IMPORT ALIEN USESOPTIONS 3RDPARTYFILTER PREFERRED</value></prop>
+ <prop oor:name="UIComponent"/>
+ <prop oor:name="FilterService"><value>com.sun.star.comp.Calc.MWAWCalcImportFilter</value></prop>
+ <prop oor:name="UserData"><value></value></prop>
+ <prop oor:name="UIName">
+ <value xml:lang="en-US">ClarisWorks/AppleWorks Document</value>
+ </prop>
+ <prop oor:name="FileFormatVersion"><value>0</value></prop>
+ <prop oor:name="Type"><value>calc_ClarisWorks</value></prop>
+ <prop oor:name="TemplateName"/>
+ <prop oor:name="DocumentService"><value>com.sun.star.sheet.SpreadsheetDocument</value></prop>
+ </node>
diff --git a/filter/source/config/fragments/filters/Claris_Resolve_Calc.xcu b/filter/source/config/fragments/filters/Claris_Resolve_Calc.xcu
new file mode 100644
index 0000000..1db9dcc
--- /dev/null
+++ b/filter/source/config/fragments/filters/Claris_Resolve_Calc.xcu
@@ -0,0 +1,30 @@
+<!--
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+-->
+ <node oor:name="Claris_Resolve_Calc" oor:op="replace">
+ <prop oor:name="Flags"><value>IMPORT ALIEN USESOPTIONS 3RDPARTYFILTER PREFERRED</value></prop>
+ <prop oor:name="UIComponent"/>
+ <prop oor:name="FilterService"><value>com.sun.star.comp.Calc.MWAWCalcImportFilter</value></prop>
+ <prop oor:name="UserData"><value></value></prop>
+ <prop oor:name="UIName">
+ <value xml:lang="en-US">ClarisResolve Document</value>
+ </prop>
+ <prop oor:name="FileFormatVersion"><value>0</value></prop>
+ <prop oor:name="Type"><value>calc_Claris_Resolve</value></prop>
+ <prop oor:name="TemplateName"/>
+ <prop oor:name="DocumentService"><value>com.sun.star.sheet.SpreadsheetDocument</value></prop>
+ </node>
diff --git a/filter/source/config/fragments/filters/Great_Works_Calc.xcu b/filter/source/config/fragments/filters/Great_Works_Calc.xcu
new file mode 100644
index 0000000..89b68f8
--- /dev/null
+++ b/filter/source/config/fragments/filters/Great_Works_Calc.xcu
@@ -0,0 +1,29 @@
+<!--
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+-->
+
+<node oor:name="Great_Works_Calc" oor:op="replace">
+ <prop oor:name="Flags">
+ <value>IMPORT ALIEN USESOPTIONS 3RDPARTYFILTER PREFERRED</value>
+ </prop>
+ <prop oor:name="FilterService">
+ <value>com.sun.star.comp.Calc.MWAWCalcImportFilter</value>
+ </prop>
+ <prop oor:name="UIName">
+ <value xml:lang="en-US">GreatWorks Document</value>
+ </prop>
+ <prop oor:name="FileFormatVersion">
+ <value>0</value>
+ </prop>
+ <prop oor:name="Type">
+ <value>calc_Great_Works</value>
+ </prop>
+ <prop oor:name="DocumentService">
+ <value>com.sun.star.sheet.SpreadsheetDocument</value>
+ </prop>
+</node>
diff --git a/filter/source/config/fragments/filters/Mac_Wingz_Calc.xcu b/filter/source/config/fragments/filters/Mac_Wingz_Calc.xcu
new file mode 100644
index 0000000..e908c7e
--- /dev/null
+++ b/filter/source/config/fragments/filters/Mac_Wingz_Calc.xcu
@@ -0,0 +1,30 @@
+<!--
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+-->
+ <node oor:name="Mac_Wingz_Calc" oor:op="replace">
+ <prop oor:name="Flags"><value>IMPORT ALIEN USESOPTIONS 3RDPARTYFILTER PREFERRED</value></prop>
+ <prop oor:name="UIComponent"/>
+ <prop oor:name="FilterService"><value>com.sun.star.comp.Calc.MWAWCalcImportFilter</value></prop>
+ <prop oor:name="UserData"><value></value></prop>
+ <prop oor:name="UIName">
+ <value xml:lang="en-US">Wingz for Mac Document</value>
+ </prop>
+ <prop oor:name="FileFormatVersion"><value>0</value></prop>
+ <prop oor:name="Type"><value>calc_Mac_Wingz</value></prop>
+ <prop oor:name="TemplateName"/>
+ <prop oor:name="DocumentService"><value>com.sun.star.sheet.SpreadsheetDocument</value></prop>
+ </node>
diff --git a/filter/source/config/fragments/filters/Mac_Works_Calc.xcu b/filter/source/config/fragments/filters/Mac_Works_Calc.xcu
new file mode 100644
index 0000000..8db1b16
--- /dev/null
+++ b/filter/source/config/fragments/filters/Mac_Works_Calc.xcu
@@ -0,0 +1,30 @@
+<!--
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+-->
+ <node oor:name="Mac_Works_Calc" oor:op="replace">
+ <prop oor:name="Flags"><value>IMPORT ALIEN USESOPTIONS 3RDPARTYFILTER PREFERRED</value></prop>
+ <prop oor:name="UIComponent"/>
+ <prop oor:name="FilterService"><value>com.sun.star.comp.Calc.MWAWCalcImportFilter</value></prop>
+ <prop oor:name="UserData"><value></value></prop>
+ <prop oor:name="UIName">
+ <value xml:lang="en-US">Microsoft Works for Mac Document (v1 - v4)</value>
+ </prop>
+ <prop oor:name="FileFormatVersion"><value>0</value></prop>
+ <prop oor:name="Type"><value>calc_Mac_Works</value></prop>
+ <prop oor:name="TemplateName"/>
+ <prop oor:name="DocumentService"><value>com.sun.star.sheet.SpreadsheetDocument</value></prop>
+ </node>
diff --git a/filter/source/config/fragments/types/calc_Beagle_Works.xcu b/filter/source/config/fragments/types/calc_Beagle_Works.xcu
new file mode 100644
index 0000000..840e0a7
--- /dev/null
+++ b/filter/source/config/fragments/types/calc_Beagle_Works.xcu
@@ -0,0 +1,29 @@
+<!--
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+-->
+
+<node oor:name="calc_Beagle_Works" oor:op="replace">
+ <prop oor:name="DetectService">
+ <value>com.sun.star.comp.Calc.MWAWCalcImportFilter</value>
+ </prop>
+ <prop oor:name="Extensions">
+ <value>dummy</value>
+ </prop>
+ <prop oor:name="MediaType">
+ <value></value>
+ </prop>
+ <prop oor:name="Preferred">
+ <value>true</value>
+ </prop>
+ <prop oor:name="PreferredFilter">
+ <value>Beagle_Works_Calc</value>
+ </prop>
+ <prop oor:name="UIName">
+ <value>BeagleWorks/WordPerfect Works Document</value>
+ </prop>
+</node>
diff --git a/filter/source/config/fragments/types/calc_ClarisWorks.xcu b/filter/source/config/fragments/types/calc_ClarisWorks.xcu
new file mode 100644
index 0000000..fe73b41
--- /dev/null
+++ b/filter/source/config/fragments/types/calc_ClarisWorks.xcu
@@ -0,0 +1,29 @@
+<!--
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+-->
+ <node oor:name="calc_ClarisWorks" oor:op="replace" >
+ <prop oor:name="DetectService"><value>com.sun.star.comp.Calc.MWAWCalcImportFilter</value></prop>
+ <prop oor:name="URLPattern"/>
+ <prop oor:name="Extensions"><value>cwk</value></prop>
+ <prop oor:name="MediaType"><value>application/clarisworks</value></prop>
+ <prop oor:name="Preferred"><value>true</value></prop>
+ <prop oor:name="PreferredFilter"><value>Claris_Works_Calc</value></prop>
+ <prop oor:name="UIName">
+ <value>ClarisWorks/AppleWorks Document</value>
+ </prop>
+ <prop oor:name="ClipboardFormat"/>
+ </node>
diff --git a/filter/source/config/fragments/types/calc_Claris_Resolve.xcu b/filter/source/config/fragments/types/calc_Claris_Resolve.xcu
new file mode 100644
index 0000000..309eb47
--- /dev/null
+++ b/filter/source/config/fragments/types/calc_Claris_Resolve.xcu
@@ -0,0 +1,29 @@
+<!--
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+-->
+ <node oor:name="calc_Claris_Resolve" oor:op="replace" >
+ <prop oor:name="DetectService"><value>com.sun.star.comp.Calc.MWAWCalcImportFilter</value></prop>
+ <prop oor:name="URLPattern"/>
+ <prop oor:name="Extensions"><value>cwk</value></prop>
+ <prop oor:name="MediaType"><value>application/clarisworks</value></prop>
+ <prop oor:name="Preferred"><value>true</value></prop>
+ <prop oor:name="PreferredFilter"><value>Claris_Resolve_Calc</value></prop>
+ <prop oor:name="UIName">
+ <value>ClarisResolve Document</value>
+ </prop>
+ <prop oor:name="ClipboardFormat"/>
+ </node>
diff --git a/filter/source/config/fragments/types/calc_Great_Works.xcu b/filter/source/config/fragments/types/calc_Great_Works.xcu
new file mode 100644
index 0000000..f14480d
--- /dev/null
+++ b/filter/source/config/fragments/types/calc_Great_Works.xcu
@@ -0,0 +1,29 @@
+<!--
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+-->
+
+<node oor:name="calc_Great_Works" oor:op="replace">
+ <prop oor:name="DetectService">
+ <value>com.sun.star.comp.Calc.MWAWCalcImportFilter</value>
+ </prop>
+ <prop oor:name="Extensions">
+ <value>dummy</value>
+ </prop>
+ <prop oor:name="MediaType">
+ <value></value>
+ </prop>
+ <prop oor:name="Preferred">
+ <value>true</value>
+ </prop>
+ <prop oor:name="PreferredFilter">
+ <value>Great_Works_Calc</value>
+ </prop>
+ <prop oor:name="UIName">
+ <value>GreatWorks Document</value>
+ </prop>
+</node>
diff --git a/filter/source/config/fragments/types/calc_Mac_Wingz.xcu b/filter/source/config/fragments/types/calc_Mac_Wingz.xcu
new file mode 100644
index 0000000..357a189
--- /dev/null
+++ b/filter/source/config/fragments/types/calc_Mac_Wingz.xcu
@@ -0,0 +1,29 @@
+<!--
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+-->
+ <node oor:name="calc_Mac_Wingz" oor:op="replace" >
+ <prop oor:name="DetectService"><value>com.sun.star.comp.Calc.MWAWCalcImportFilter</value></prop>
+ <prop oor:name="URLPattern"/>
+ <prop oor:name="Extensions"><value></value></prop>
+ <prop oor:name="MediaType"></prop>
+ <prop oor:name="Preferred"><value>true</value></prop>
+ <prop oor:name="PreferredFilter"><value>Mac_Wingz_Calc</value></prop>
+ <prop oor:name="UIName">
+ <value>Wingz for Mac Document</value>
+ </prop>
+ <prop oor:name="ClipboardFormat"/>
+ </node>
diff --git a/filter/source/config/fragments/types/calc_Mac_Works.xcu b/filter/source/config/fragments/types/calc_Mac_Works.xcu
new file mode 100644
index 0000000..9a9d373
--- /dev/null
+++ b/filter/source/config/fragments/types/calc_Mac_Works.xcu
@@ -0,0 +1,29 @@
+<!--
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+-->
+ <node oor:name="calc_Mac_Works" oor:op="replace" >
+ <prop oor:name="DetectService"><value>com.sun.star.comp.Calc.MWAWCalcImportFilter</value></prop>
+ <prop oor:name="URLPattern"/>
+ <prop oor:name="Extensions"><value>wps</value></prop>
+ <prop oor:name="MediaType"><value>application/vnd.ms-works</value></prop>
+ <prop oor:name="Preferred"><value>true</value></prop>
+ <prop oor:name="PreferredFilter"><value>Mac_Works_Calc</value></prop>
+ <prop oor:name="UIName">
+ <value>Microsoft Works for Mac Document (v1 - v4)</value>
+ </prop>
+ <prop oor:name="ClipboardFormat"/>
+ </node>
diff --git a/writerperfect/Library_wpftcalc.mk b/writerperfect/Library_wpftcalc.mk
index 2e69c3b..e09c195 100644
--- a/writerperfect/Library_wpftcalc.mk
+++ b/writerperfect/Library_wpftcalc.mk
@@ -39,6 +39,7 @@ $(eval $(call gb_Library_use_libraries,wpftcalc,\
$(eval $(call gb_Library_use_externals,wpftcalc,\
odfgen \
revenge \
+ mwaw \
wps \
zlib \
lcms2 \
@@ -50,6 +51,7 @@ $(eval $(call gb_Library_use_externals,wpftcalc,\
$(eval $(call gb_Library_add_exception_objects,wpftcalc,\
writerperfect/source/calc/ImportFilterBase \
writerperfect/source/calc/MSWorksCalcImportFilter \
+ writerperfect/source/calc/MWAWCalcImportFilter \
writerperfect/source/calc/wpftcalc_genericfilter \
))
diff --git a/writerperfect/source/calc/MWAWCalcImportFilter.cxx b/writerperfect/source/calc/MWAWCalcImportFilter.cxx
new file mode 100644
index 0000000..0f5101f
--- /dev/null
+++ b/writerperfect/source/calc/MWAWCalcImportFilter.cxx
@@ -0,0 +1,191 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* MWAWCalcImportFilter: Sets up the filter, and calls DocumentCollector
+ * to do the actual filtering
+ *
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include <com/sun/star/uno/Reference.h>
+#include <cppuhelper/supportsservice.hxx>
+
+#include <libmwaw/libmwaw.hxx>
+#include <libodfgen/libodfgen.hxx>
+
+#include "MWAWCalcImportFilter.hxx"
+
+using com::sun::star::uno::Sequence;
+using com::sun::star::uno::Reference;
+using com::sun::star::uno::Any;
+using com::sun::star::uno::XInterface;
+using com::sun::star::uno::Exception;
+using com::sun::star::uno::RuntimeException;
+using com::sun::star::uno::XComponentContext;
+
+static bool handleEmbeddedMWAWGraphicObject(const librevenge::RVNGBinaryData &data, OdfDocumentHandler *pHandler, const OdfStreamType streamType)
+{
+ OdgGenerator exporter;
+ exporter.addDocumentHandler(pHandler, streamType);
+ return MWAWDocument::decodeGraphic(data, &exporter);
+}
+
+static bool handleEmbeddedMWAWSpreadsheetObject(const librevenge::RVNGBinaryData &data, OdfDocumentHandler *pHandler, const OdfStreamType streamType)
+{
+ OdsGenerator exporter;
+ exporter.addDocumentHandler(pHandler, streamType);
+ return MWAWDocument::decodeSpreadsheet(data, &exporter);
+}
+
+bool MWAWCalcImportFilter::doImportDocument( librevenge::RVNGInputStream &rInput, librevenge::RVNGSpreadsheetInterface &rGenerator )
+{
+ return MWAWDocument::MWAW_R_OK == MWAWDocument::parse(&rInput, &rGenerator);
+}
+
+bool MWAWCalcImportFilter::doDetectFormat( librevenge::RVNGInputStream &rInput, OUString &rTypeName )
+{
+ rTypeName = "";
+
+ MWAWDocument::Type docType = MWAWDocument::MWAW_T_UNKNOWN;
+ MWAWDocument::Kind docKind = MWAWDocument::MWAW_K_UNKNOWN;
+ const MWAWDocument::Confidence confidence = MWAWDocument::isFileFormatSupported(&rInput, docType, docKind);
+
+ if (confidence == MWAWDocument::MWAW_C_EXCELLENT)
+ {
+ if ( docKind == MWAWDocument::MWAW_K_SPREADSHEET || docKind == MWAWDocument::MWAW_K_DATABASE )
+ {
+ switch (docType)
+ {
+ case MWAWDocument::MWAW_T_BEAGLEWORKS:
+ rTypeName = "calc_Beagle_Works";
+ break;
+ case MWAWDocument::MWAW_T_CLARISRESOLVE:
+ rTypeName = "calc_Claris_Resolve";
+ break;
+ case MWAWDocument::MWAW_T_CLARISWORKS:
+ rTypeName = "calc_ClarisWorks";
+ break;
+ case MWAWDocument::MWAW_T_GREATWORKS:
+ rTypeName = "calc_Great_Works";
+ break;
+ case MWAWDocument::MWAW_T_MICROSOFTWORKS:
+ rTypeName = "calc_Mac_Works";
+ break;
+ case MWAWDocument::MWAW_T_WINGZ:
+ rTypeName = "calc_Mac_Wingz";
+ break;
+
+ case MWAWDocument::MWAW_T_ACTA:
+ case MWAWDocument::MWAW_T_ADOBEILLUSTRATOR:
+ case MWAWDocument::MWAW_T_DBASE:
+ case MWAWDocument::MWAW_T_DOCMAKER:
+ case MWAWDocument::MWAW_T_EDOC:
+ case MWAWDocument::MWAW_T_FAMILYTREEMAKER:
+ case MWAWDocument::MWAW_T_FILEMAKER:
+ case MWAWDocument::MWAW_T_FOXBASE:
+ case MWAWDocument::MWAW_T_FRAMEMAKER:
+ case MWAWDocument::MWAW_T_FULLIMPACT:
+ case MWAWDocument::MWAW_T_FULLPAINT:
+ case MWAWDocument::MWAW_T_FULLWRITE:
+ case MWAWDocument::MWAW_T_INFOGENIE:
+ case MWAWDocument::MWAW_T_KALEIDAGRAPH:
+ case MWAWDocument::MWAW_T_HANMACWORDJ:
+ case MWAWDocument::MWAW_T_HANMACWORDK:
+ case MWAWDocument::MWAW_T_LIGHTWAYTEXT:
+ case MWAWDocument::MWAW_T_MACDOC:
+ case MWAWDocument::MWAW_T_MACDRAFT:
+ case MWAWDocument::MWAW_T_MACDRAW:
+ case MWAWDocument::MWAW_T_MACDRAWPRO:
+ case MWAWDocument::MWAW_T_MACPAINT:
+ case MWAWDocument::MWAW_T_MACWRITE:
+ case MWAWDocument::MWAW_T_MACWRITEPRO:
+ case MWAWDocument::MWAW_T_MARINERWRITE:
+ case MWAWDocument::MWAW_T_MINDWRITE:
+ case MWAWDocument::MWAW_T_MICROSOFTFILE:
+ case MWAWDocument::MWAW_T_MICROSOFTMULTIPLAN:
+ case MWAWDocument::MWAW_T_MICROSOFTWORD:
+ case MWAWDocument::MWAW_T_MORE:
+ case MWAWDocument::MWAW_T_NISUSWRITER:
+ case MWAWDocument::MWAW_T_OVERVUE:
+ case MWAWDocument::MWAW_T_PAGEMAKER:
+ case MWAWDocument::MWAW_T_PIXELPAINT:
+ case MWAWDocument::MWAW_T_RAGTIME:
+ case MWAWDocument::MWAW_T_READYSETGO:
+ case MWAWDocument::MWAW_T_SUPERPAINT:
+ case MWAWDocument::MWAW_T_SYMPOSIUM:
+ case MWAWDocument::MWAW_T_TEACHTEXT:
+ case MWAWDocument::MWAW_T_TEXEDIT:
+ case MWAWDocument::MWAW_T_TRAPEZE:
+ case MWAWDocument::MWAW_T_WRITENOW:
+ case MWAWDocument::MWAW_T_WRITERPLUS:
+ case MWAWDocument::MWAW_T_XPRESS:
+ case MWAWDocument::MWAW_T_ZWRITE:
+ case MWAWDocument::MWAW_T_4DIMENSION:
+
+ case MWAWDocument::MWAW_T_RESERVED1:
+ case MWAWDocument::MWAW_T_RESERVED2:
+ case MWAWDocument::MWAW_T_RESERVED3:
+ case MWAWDocument::MWAW_T_RESERVED4:
+ case MWAWDocument::MWAW_T_RESERVED5:
+ case MWAWDocument::MWAW_T_RESERVED6:
+ case MWAWDocument::MWAW_T_RESERVED7:
+ case MWAWDocument::MWAW_T_RESERVED8:
+ case MWAWDocument::MWAW_T_RESERVED9:
+ case MWAWDocument::MWAW_T_UNKNOWN:
+ default:
+ break;
+ }
+ }
+ }
+
+ return !rTypeName.isEmpty();
+}
+
+void MWAWCalcImportFilter::doRegisterHandlers( OdsGenerator &rGenerator )
+{
+ rGenerator.registerEmbeddedObjectHandler("image/mwaw-odg", &handleEmbeddedMWAWGraphicObject);
+ rGenerator.registerEmbeddedObjectHandler("image/mwaw-ods", &handleEmbeddedMWAWSpreadsheetObject);
+}
+
+OUString MWAWCalcImportFilter_getImplementationName ()
+throw (RuntimeException)
+{
+ return OUString ( "com.sun.star.comp.Calc.MWAWCalcImportFilter" );
+}
+
+Sequence< OUString > SAL_CALL MWAWCalcImportFilter_getSupportedServiceNames( )
+throw (RuntimeException)
+{
+ Sequence < OUString > aRet(2);
+ OUString *pArray = aRet.getArray();
+ pArray[0] = "com.sun.star.document.ImportFilter";
+ pArray[1] = "com.sun.star.document.ExtendedTypeDetection";
+ return aRet;
+}
+
+Reference< XInterface > SAL_CALL MWAWCalcImportFilter_createInstance( const Reference< XComponentContext > &rContext)
+throw( Exception )
+{
+ return (cppu::OWeakObject *) new MWAWCalcImportFilter( rContext );
+}
+
+// XServiceInfo
+OUString SAL_CALL MWAWCalcImportFilter::getImplementationName( )
+throw (RuntimeException, std::exception)
+{
+ return MWAWCalcImportFilter_getImplementationName();
+}
+sal_Bool SAL_CALL MWAWCalcImportFilter::supportsService( const OUString &rServiceName )
+throw (RuntimeException, std::exception)
+{
+ return cppu::supportsService( this, rServiceName );
+}
+Sequence< OUString > SAL_CALL MWAWCalcImportFilter::getSupportedServiceNames( )
+throw (RuntimeException, std::exception)
+{
+ return MWAWCalcImportFilter_getSupportedServiceNames();
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerperfect/source/calc/MWAWCalcImportFilter.hxx b/writerperfect/source/calc/MWAWCalcImportFilter.hxx
new file mode 100644
index 0000000..8062f6b
--- /dev/null
+++ b/writerperfect/source/calc/MWAWCalcImportFilter.hxx
@@ -0,0 +1,53 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef _MWAWCALCIMPORTFILTER_HXX
+#define _MWAWCALCIMPORTFILTER_HXX
+
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+
+#include "ImportFilterBase.hxx"
+
+/* This component will be instantiated for both import or export. Whether it calls
+ * setSourceDocument or setTargetDocument determines which Impl function the filter
+ * member calls */
+class MWAWCalcImportFilter : public writerperfect::calc::ImportFilterBase
+{
+public:
+ MWAWCalcImportFilter( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > &rxContext )
+ : writerperfect::calc::ImportFilterBase( rxContext ) {}
+
+ // XServiceInfo
+ virtual OUString SAL_CALL getImplementationName( )
+ throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+ virtual sal_Bool SAL_CALL supportsService( const OUString &ServiceName )
+ throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( )
+ throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+
+private:
+ virtual bool doDetectFormat( librevenge::RVNGInputStream &rInput, OUString &rTypeName ) SAL_OVERRIDE;
+ virtual bool doImportDocument( librevenge::RVNGInputStream &rInput, librevenge::RVNGSpreadsheetInterface &rGenerator ) SAL_OVERRIDE;
+ virtual void doRegisterHandlers( OdsGenerator &rGenerator ) SAL_OVERRIDE;
+};
+
+OUString MWAWCalcImportFilter_getImplementationName()
+throw ( ::com::sun::star::uno::RuntimeException );
+
+::com::sun::star::uno::Sequence< OUString > SAL_CALL MWAWCalcImportFilter_getSupportedServiceNames( )
+throw ( ::com::sun::star::uno::RuntimeException );
+
+::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
+SAL_CALL MWAWCalcImportFilter_createInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > &rContext)
+throw ( ::com::sun::star::uno::Exception );
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerperfect/source/calc/wpftcalc.component b/writerperfect/source/calc/wpftcalc.component
index c2def1e..68c5f85 100644
--- a/writerperfect/source/calc/wpftcalc.component
+++ b/writerperfect/source/calc/wpftcalc.component
@@ -13,4 +13,8 @@
<service name="com.sun.star.document.ImportFilter"/>
<service name="com.sun.star.document.ExtendedTypeDetection"/>
</implementation>
+ <implementation name="com.sun.star.comp.Calc.MWAWCalcImportFilter">
+ <service name="com.sun.star.document.ImportFilter"/>
+ <service name="com.sun.star.document.ExtendedTypeDetection"/>
+ </implementation>
</component>
diff --git a/writerperfect/source/calc/wpftcalc_genericfilter.cxx b/writerperfect/source/calc/wpftcalc_genericfilter.cxx
index eecd0b0..2641010 100644
--- a/writerperfect/source/calc/wpftcalc_genericfilter.cxx
+++ b/writerperfect/source/calc/wpftcalc_genericfilter.cxx
@@ -30,6 +30,7 @@
#include "sal/types.h"
#include "MSWorksCalcImportFilter.hxx"
+#include "MWAWCalcImportFilter.hxx"
namespace {
@@ -37,6 +38,9 @@ static cppu::ImplementationEntry const services[] = {
{ &MSWorksCalcImportFilter_createInstance, &MSWorksCalcImportFilter_getImplementationName,
&MSWorksCalcImportFilter_getSupportedServiceNames,
&cppu::createSingleComponentFactory, 0, 0 },
+ { &MWAWCalcImportFilter_createInstance, &MWAWCalcImportFilter_getImplementationName,
+ &MWAWCalcImportFilter_getSupportedServiceNames,
+ &cppu::createSingleComponentFactory, 0, 0 },
{ 0, 0, 0, 0, 0, 0 } };
}
--
1.9.3

@ -0,0 +1,77 @@
From 78a54fa2b9726c09f6d393768e40f8452db4c8dd Mon Sep 17 00:00:00 2001
From: David Tardon <dtardon@redhat.com>
Date: Thu, 29 May 2014 17:09:36 +0200
Subject: [PATCH 14/18] fix detection of Keynote 3 documents
Change-Id: I1c3e6b2809ee8b63f6f4db886bf6358b668b505f
(cherry picked from commit 89e65184bc9e895085d21545c79f4089c9654c1f)
---
.../libetonyek/0001-fix-v.3-version-string.patch | 26 ++++++++++++++++++++++
external/libetonyek/UnpackedTarball_libetonyek.mk | 6 +++++
writerperfect/qa/unit/WpftImpressFilterTest.cxx | 2 +-
3 files changed, 33 insertions(+), 1 deletion(-)
create mode 100644 external/libetonyek/0001-fix-v.3-version-string.patch
diff --git a/external/libetonyek/0001-fix-v.3-version-string.patch b/external/libetonyek/0001-fix-v.3-version-string.patch
new file mode 100644
index 0000000..d344259
--- /dev/null
+++ b/external/libetonyek/0001-fix-v.3-version-string.patch
@@ -0,0 +1,26 @@
+From 16b7bf009a06ac48c69f94b778a09151aa20fa53 Mon Sep 17 00:00:00 2001
+From: David Tardon <dtardon@redhat.com>
+Date: Thu, 29 May 2014 17:04:05 +0200
+Subject: [PATCH] fix v.3 version string
+
+Change-Id: I689fd53bedeccb8d1cda5275832f36333fe1d108
+---
+ src/lib/KEY2Token.gperf | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/lib/KEY2Token.gperf b/src/lib/KEY2Token.gperf
+index d1bf501..483ca97 100644
+--- a/src/lib/KEY2Token.gperf
++++ b/src/lib/KEY2Token.gperf
+@@ -25,7 +25,7 @@ struct Token
+ 1,_1
+ 2004102100,VERSION_STR_2
+ 2005092101,COMPATIBLE_VERSION_STR_3,
+-2005140600,VERSION_STR_3
++2005112100,VERSION_STR_3
+ 72007061400,VERSION_STR_4
+ 92008102400,VERSION_STR_5
+ BGBuildChunk,BGBuildChunk
+--
+1.9.3
+
diff --git a/external/libetonyek/UnpackedTarball_libetonyek.mk b/external/libetonyek/UnpackedTarball_libetonyek.mk
index 52e6a95..4655cbb 100644
--- a/external/libetonyek/UnpackedTarball_libetonyek.mk
+++ b/external/libetonyek/UnpackedTarball_libetonyek.mk
@@ -11,4 +11,10 @@ $(eval $(call gb_UnpackedTarball_UnpackedTarball,libetonyek))
$(eval $(call gb_UnpackedTarball_set_tarball,libetonyek,$(ETONYEK_TARBALL)))
+$(eval $(call gb_UnpackedTarball_set_patchlevel,libetonyek,1))
+
+$(eval $(call gb_UnpackedTarball_add_patches,libetonyek,\
+ external/libetonyek/0001-fix-v.3-version-string.patch \
+))
+
# vim: set noet sw=4 ts=4:
diff --git a/writerperfect/qa/unit/WpftImpressFilterTest.cxx b/writerperfect/qa/unit/WpftImpressFilterTest.cxx
index f148c8f..531da4f 100644
--- a/writerperfect/qa/unit/WpftImpressFilterTest.cxx
+++ b/writerperfect/qa/unit/WpftImpressFilterTest.cxx
@@ -31,7 +31,7 @@ WpftImpressFilterTest::WpftImpressFilterTest()
void WpftImpressFilterTest::test()
{
- // doTest("org.libreoffice.comp.Impress.KeynoteImportFilter", "/writerperfect/qa/unit/data/impress/libetonyek/");
+ doTest("org.libreoffice.comp.Impress.KeynoteImportFilter", "/writerperfect/qa/unit/data/impress/libetonyek/");
}
CPPUNIT_TEST_SUITE_REGISTRATION(WpftImpressFilterTest);
--
1.9.3

@ -0,0 +1,41 @@
From dbced7129da1412bf282327491584cc78601c6c7 Mon Sep 17 00:00:00 2001
From: David Tardon <dtardon@redhat.com>
Date: Thu, 29 May 2014 17:13:33 +0200
Subject: [PATCH 15/18] enable integration test for libmwaw calc import
Change-Id: I9ff3ed6b74d93483a2157087707c5ec47888dd6a
(cherry picked from commit 64a9f9968a6aa801af183a142c490943702a2d68)
---
writerperfect/qa/unit/WpftCalcFilterTest.cxx | 1 +
writerperfect/qa/unit/data/calc/libmwaw/fail/.gitignore | 0
writerperfect/qa/unit/data/calc/libmwaw/indeterminate/.gitignore | 0
writerperfect/qa/unit/data/calc/libmwaw/pass/.gitignore | 0
4 files changed, 1 insertion(+)
create mode 100644 writerperfect/qa/unit/data/calc/libmwaw/fail/.gitignore
create mode 100644 writerperfect/qa/unit/data/calc/libmwaw/indeterminate/.gitignore
create mode 100644 writerperfect/qa/unit/data/calc/libmwaw/pass/.gitignore
diff --git a/writerperfect/qa/unit/WpftCalcFilterTest.cxx b/writerperfect/qa/unit/WpftCalcFilterTest.cxx
index ba1ed1e..6af5c04 100644
--- a/writerperfect/qa/unit/WpftCalcFilterTest.cxx
+++ b/writerperfect/qa/unit/WpftCalcFilterTest.cxx
@@ -31,6 +31,7 @@ WpftCalcFilterTest::WpftCalcFilterTest()
void WpftCalcFilterTest::test()
{
+ doTest("com.sun.star.comp.Calc.MWAWCalcImportFilter", "/writerperfect/qa/unit/data/calc/libmwaw/");
doTest("com.sun.star.comp.Calc.MSWorksCalcImportFilter", "/writerperfect/qa/unit/data/calc/libwps/");
}
diff --git a/writerperfect/qa/unit/data/calc/libmwaw/fail/.gitignore b/writerperfect/qa/unit/data/calc/libmwaw/fail/.gitignore
new file mode 100644
index 0000000..e69de29
diff --git a/writerperfect/qa/unit/data/calc/libmwaw/indeterminate/.gitignore b/writerperfect/qa/unit/data/calc/libmwaw/indeterminate/.gitignore
new file mode 100644
index 0000000..e69de29
diff --git a/writerperfect/qa/unit/data/calc/libmwaw/pass/.gitignore b/writerperfect/qa/unit/data/calc/libmwaw/pass/.gitignore
new file mode 100644
index 0000000..e69de29
--
1.9.3

@ -0,0 +1,41 @@
From 017986c8c34ee8f59fed6ee92c1b663a48cd429c Mon Sep 17 00:00:00 2001
From: David Tardon <dtardon@redhat.com>
Date: Thu, 29 May 2014 17:14:22 +0200
Subject: [PATCH 16/18] enable integration test for libmwaw draw import
Change-Id: I2109b948971776f06c3574ad6e7a9bebc33a40b3
(cherry picked from commit e120b369f10207f4057ebeae92c1ee25f08e4904)
---
writerperfect/qa/unit/WpftDrawFilterTest.cxx | 1 +
writerperfect/qa/unit/data/draw/libmwaw/fail/.gitignore | 0
writerperfect/qa/unit/data/draw/libmwaw/indeterminate/.gitignore | 0
writerperfect/qa/unit/data/draw/libmwaw/pass/.gitignore | 0
4 files changed, 1 insertion(+)
create mode 100644 writerperfect/qa/unit/data/draw/libmwaw/fail/.gitignore
create mode 100644 writerperfect/qa/unit/data/draw/libmwaw/indeterminate/.gitignore
create mode 100644 writerperfect/qa/unit/data/draw/libmwaw/pass/.gitignore
diff --git a/writerperfect/qa/unit/WpftDrawFilterTest.cxx b/writerperfect/qa/unit/WpftDrawFilterTest.cxx
index 3de83ac..3b0b0ef 100644
--- a/writerperfect/qa/unit/WpftDrawFilterTest.cxx
+++ b/writerperfect/qa/unit/WpftDrawFilterTest.cxx
@@ -35,6 +35,7 @@ void WpftDrawFilterTest::test()
doTest("com.sun.star.comp.Draw.CMXImportFilter", "/writerperfect/qa/unit/data/draw/libcdr-cmx/");
doTest("com.sun.star.comp.Draw.FreehandImportFilter", "/writerperfect/qa/unit/data/draw/libfreehand/");
doTest("com.sun.star.comp.Draw.MSPUBImportFilter", "/writerperfect/qa/unit/data/draw/libmspub/");
+ doTest("com.sun.star.comp.Draw.MWAWDrawImportFilter", "/writerperfect/qa/unit/data/draw/libmwaw/");
doTest("com.sun.star.comp.Draw.VisioImportFilter", "/writerperfect/qa/unit/data/draw/libvisio/");
doTest("com.sun.star.comp.Draw.WPGImportFilter", "/writerperfect/qa/unit/data/draw/libwpg/");
}
diff --git a/writerperfect/qa/unit/data/draw/libmwaw/fail/.gitignore b/writerperfect/qa/unit/data/draw/libmwaw/fail/.gitignore
new file mode 100644
index 0000000..e69de29
diff --git a/writerperfect/qa/unit/data/draw/libmwaw/indeterminate/.gitignore b/writerperfect/qa/unit/data/draw/libmwaw/indeterminate/.gitignore
new file mode 100644
index 0000000..e69de29
diff --git a/writerperfect/qa/unit/data/draw/libmwaw/pass/.gitignore b/writerperfect/qa/unit/data/draw/libmwaw/pass/.gitignore
new file mode 100644
index 0000000..e69de29
--
1.9.3

File diff suppressed because it is too large Load Diff

@ -0,0 +1,61 @@
From da20023bf585f7c937ab7f5927f1425d25a79a50 Mon Sep 17 00:00:00 2001
From: David Tardon <dtardon@redhat.com>
Date: Thu, 29 May 2014 19:24:21 +0200
Subject: [PATCH 18/18] fix copypasta
Change-Id: I397426edff584b29210b4df925677893cda35cc7
(cherry picked from commit 8dd624128bf12e013c17b3b24c0b24135296bb8e)
---
filter/source/config/fragments/types/draw_MacPaint.xcu | 4 ++--
filter/source/config/fragments/types/draw_Mac_Works.xcu | 4 ++--
filter/source/config/fragments/types/draw_SuperPaint.xcu | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/filter/source/config/fragments/types/draw_MacPaint.xcu b/filter/source/config/fragments/types/draw_MacPaint.xcu
index 5811ea5..4cadffd 100644
--- a/filter/source/config/fragments/types/draw_MacPaint.xcu
+++ b/filter/source/config/fragments/types/draw_MacPaint.xcu
@@ -18,8 +18,8 @@
<node oor:name="draw_MacPaint" oor:op="replace" >
<prop oor:name="DetectService"><value>com.sun.star.comp.Draw.MWAWDrawImportFilter</value></prop>
<prop oor:name="URLPattern"/>
- <prop oor:name="Extensions"><value>wps</value></prop>
- <prop oor:name="MediaType"><value>application/vnd.ms-works</value></prop>
+ <prop oor:name="Extensions"><value>dummy</value></prop>
+ <prop oor:name="MediaType"></prop>
<prop oor:name="Preferred"><value>true</value></prop>
<prop oor:name="PreferredFilter"><value>MacPaint_Draw</value></prop>
<prop oor:name="UIName">
diff --git a/filter/source/config/fragments/types/draw_Mac_Works.xcu b/filter/source/config/fragments/types/draw_Mac_Works.xcu
index 79ef12c..15dea54 100644
--- a/filter/source/config/fragments/types/draw_Mac_Works.xcu
+++ b/filter/source/config/fragments/types/draw_Mac_Works.xcu
@@ -18,8 +18,8 @@
<node oor:name="draw_Mac_Works" oor:op="replace" >
<prop oor:name="DetectService"><value>com.sun.star.comp.Draw.MWAWDrawImportFilter</value></prop>
<prop oor:name="URLPattern"/>
- <prop oor:name="Extensions"><value>wps</value></prop>
- <prop oor:name="MediaType"><value>application/vnd.ms-works</value></prop>
+ <prop oor:name="Extensions"><value>dummy</value></prop>
+ <prop oor:name="MediaType"></prop>
<prop oor:name="Preferred"><value>true</value></prop>
<prop oor:name="PreferredFilter"><value>Mac_Works_Draw</value></prop>
<prop oor:name="UIName">
diff --git a/filter/source/config/fragments/types/draw_SuperPaint.xcu b/filter/source/config/fragments/types/draw_SuperPaint.xcu
index 6dbd4a9..6f7e349 100644
--- a/filter/source/config/fragments/types/draw_SuperPaint.xcu
+++ b/filter/source/config/fragments/types/draw_SuperPaint.xcu
@@ -18,8 +18,8 @@
<node oor:name="draw_SuperPaint" oor:op="replace" >
<prop oor:name="DetectService"><value>com.sun.star.comp.Draw.MWAWDrawImportFilter</value></prop>
<prop oor:name="URLPattern"/>
- <prop oor:name="Extensions"><value>wps</value></prop>
- <prop oor:name="MediaType"><value>application/vnd.ms-works</value></prop>
+ <prop oor:name="Extensions"><value>dummy</value></prop>
+ <prop oor:name="MediaType"></prop>
<prop oor:name="Preferred"><value>true</value></prop>
<prop oor:name="PreferredFilter"><value>SuperPaint_Draw</value></prop>
<prop oor:name="UIName">
--
1.9.3

@ -37,7 +37,7 @@ Summary: Free Software Productivity Suite
Name: libreoffice
Epoch: 1
Version: %{libo_version}.0
Release: 6%{?libo_prerelease}%{?dist}
Release: 7%{?libo_prerelease}%{?dist}
License: (MPLv1.1 or LGPLv3+) and LGPLv3 and LGPLv2+ and BSD and (MPLv1.1 or GPLv2 or LGPLv2 or Netscape) and Public Domain and ASL 2.0 and Artistic and MPLv2.0
Group: Applications/Productivity
URL: http://www.libreoffice.org/
@ -299,6 +299,24 @@ Patch18: 0006-rebase-all-import-libs.patch
Patch19: 0007-libwpd-stream-does-not-exist-anymore.patch
Patch20: 0008-export-SYSTEM_REVENGE.patch
Patch21: 0009-drop-trailing-comma.patch
Patch22: 0001-improve-WPXSvInputStream-test.patch
Patch23: 0002-enable-new-handlers.patch
Patch24: 0003-Add-new-libmwaw-drawing-format.patch
Patch25: 0004-add-new-libmwaw-drawing-formats-forgotten-files.patch
Patch26: 0005-organize-the-test-data-files-by-test.patch
Patch27: 0006-fix-return-value-for-libe-book-import-filter.patch
Patch28: 0007-parse-zipped-FictionBook-2-files-again.patch
Patch29: 0008-re-enable-libe-book-integration-test.patch
Patch30: 0009-use-the-right-XML-import-service.patch
Patch31: 0010-Try-to-add-support-for-WKS-WDB-files.patch
Patch32: 0011-Make-the-wdb-wks-and-GreatWorks-draw-work.patch
Patch33: 0012-add-writerperfect-calc-integration-test.patch
Patch34: 0013-Add-new-libmwaw-s-database-spreadsheet-formats.patch
Patch35: 0014-fix-detection-of-Keynote-3-documents.patch
Patch36: 0015-enable-integration-test-for-libmwaw-calc-import.patch
Patch37: 0016-enable-integration-test-for-libmwaw-draw-import.patch
Patch38: 0017-these-formats-are-supported-by-libmwaw-0.3.x.patch
Patch39: 0018-fix-copypasta.patch
%define instdir %{_libdir}
%define baseinstdir %{instdir}/libreoffice
@ -2078,6 +2096,7 @@ update-desktop-database %{_datadir}/applications &> /dev/null || :
%{baseinstdir}/program/libscopencllo.so
%{baseinstdir}/program/libscuilo.so
%{baseinstdir}/program/libsolverlo.so
%{baseinstdir}/program/libwpftcalclo.so
%{baseinstdir}/program/resource/analysisen-US.res
%{baseinstdir}/program/resource/dateen-US.res
%{baseinstdir}/program/resource/foren-US.res
@ -2269,6 +2288,9 @@ update-desktop-database %{_datadir}/applications &> /dev/null || :
%endif
%changelog
* Thu May 29 2014 David Tardon <dtardon@redhat.com> - 1:4.3.0.0-7.beta1
- fix some fallout from the import libs rebase
* Wed May 28 2014 David Tardon <dtardon@redhat.com> - 1:4.3.0.0-6.beta1
- switch to librevenge-based import libs

Loading…
Cancel
Save