[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - 9 commits - external/libetonyek filter/Configuration_filter.mk filter/source postprocess/Rdb_services.mk Repository.mk writerperfect/CppunitTest_writerperfect_calc.mk writerperfect/Library_wpftcalc.mk writerperfect/Module_writerperfect.mk writerperfect/qa writerperfect/source

David Tardon dtardon at redhat.com
Thu May 29 08:26:35 PDT 2014


 Repository.mk                                                      |    1 
 dev/null                                                           |binary
 external/libetonyek/0001-fix-v.3-version-string.patch              |   26 +
 external/libetonyek/UnpackedTarball_libetonyek.mk                  |    6 
 filter/Configuration_filter.mk                                     |   14 
 filter/source/config/fragments/filters/Beagle_Works_Calc.xcu       |   29 +
 filter/source/config/fragments/filters/ClarisWorks_Calc.xcu        |   30 +
 filter/source/config/fragments/filters/Claris_Resolve_Calc.xcu     |   30 +
 filter/source/config/fragments/filters/Great_Works_Calc.xcu        |   29 +
 filter/source/config/fragments/filters/Great_Works_Draw.xcu        |    2 
 filter/source/config/fragments/filters/MS_Works_Calc.xcu           |   30 +
 filter/source/config/fragments/filters/Mac_Wingz_Calc.xcu          |   30 +
 filter/source/config/fragments/filters/Mac_Works_Calc.xcu          |   30 +
 filter/source/config/fragments/types/calc_Beagle_Works.xcu         |   29 +
 filter/source/config/fragments/types/calc_ClarisWorks.xcu          |   29 +
 filter/source/config/fragments/types/calc_Claris_Resolve.xcu       |   29 +
 filter/source/config/fragments/types/calc_Great_Works.xcu          |   29 +
 filter/source/config/fragments/types/calc_MS_Works_Document.xcu    |   29 +
 filter/source/config/fragments/types/calc_Mac_Wingz.xcu            |   29 +
 filter/source/config/fragments/types/calc_Mac_Works.xcu            |   29 +
 postprocess/Rdb_services.mk                                        |    1 
 writerperfect/CppunitTest_writerperfect_calc.mk                    |   46 ++
 writerperfect/Library_wpftcalc.mk                                  |   58 +++
 writerperfect/Module_writerperfect.mk                              |    2 
 writerperfect/qa/unit/WpftCalcFilterTest.cxx                       |   44 ++
 writerperfect/qa/unit/WpftDrawFilterTest.cxx                       |    1 
 writerperfect/qa/unit/WpftImpressFilterTest.cxx                    |    2 
 writerperfect/qa/unit/WpftWriterFilterTest.cxx                     |    2 
 writerperfect/qa/unit/data/writer/libmwaw/fail/HanMac_2.0.4J.hqx   |  178 ---------
 writerperfect/qa/unit/data/writer/libmwaw/pass/ClarisWorks_6.0.cwk |binary
 writerperfect/qa/unit/data/writer/libmwaw/pass/HanMac_2.0.4J.hqx   |  178 +++++++++
 writerperfect/source/calc/ImportFilterBase.cxx                     |  182 +++++++++
 writerperfect/source/calc/ImportFilterBase.hxx                     |  103 +++++
 writerperfect/source/calc/MSWorksCalcImportFilter.cxx              |   91 ++++
 writerperfect/source/calc/MSWorksCalcImportFilter.hxx              |   53 ++
 writerperfect/source/calc/MWAWCalcImportFilter.cxx                 |  191 ++++++++++
 writerperfect/source/calc/MWAWCalcImportFilter.hxx                 |   53 ++
 writerperfect/source/calc/wpftcalc.component                       |   20 +
 writerperfect/source/calc/wpftcalc_genericfilter.cxx               |   55 ++
 writerperfect/source/impress/KeynoteImportFilter.cxx               |    2 
 40 files changed, 1540 insertions(+), 182 deletions(-)

New commits:
commit 9f7694b6e61aa19898802c57a397812efc364d03
Author: David Tardon <dtardon at redhat.com>
Date:   Thu May 29 17:18:02 2014 +0200

    these formats are supported by libmwaw 0.3.x
    
    Change-Id: Ie045a3d700d498d58bad1bfcaf4cfd81b63005a6
    (cherry picked from commit 895d63be19f945a98d705fea3d5d067ff66f8bc1)

diff --git a/writerperfect/qa/unit/WpftWriterFilterTest.cxx b/writerperfect/qa/unit/WpftWriterFilterTest.cxx
index 8028522..904daab 100644
--- a/writerperfect/qa/unit/WpftWriterFilterTest.cxx
+++ b/writerperfect/qa/unit/WpftWriterFilterTest.cxx
@@ -34,7 +34,7 @@ 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("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.MWAWImportFilter", "/writerperfect/qa/unit/data/writer/libmwaw/");
     doTest("com.sun.star.comp.Writer.WordPerfectImportFilter", "/writerperfect/qa/unit/data/writer/libwpd/");
 }
 
diff --git a/writerperfect/qa/unit/data/writer/libmwaw/fail/.gitignore b/writerperfect/qa/unit/data/writer/libmwaw/fail/.gitignore
new file mode 100644
index 0000000..e69de29
diff --git a/writerperfect/qa/unit/data/writer/libmwaw/fail/ClarisWorks_6.0.cwk b/writerperfect/qa/unit/data/writer/libmwaw/pass/ClarisWorks_6.0.cwk
similarity index 100%
rename from writerperfect/qa/unit/data/writer/libmwaw/fail/ClarisWorks_6.0.cwk
rename to writerperfect/qa/unit/data/writer/libmwaw/pass/ClarisWorks_6.0.cwk
diff --git a/writerperfect/qa/unit/data/writer/libmwaw/fail/HanMac_2.0.4J.hqx b/writerperfect/qa/unit/data/writer/libmwaw/pass/HanMac_2.0.4J.hqx
similarity index 100%
rename from writerperfect/qa/unit/data/writer/libmwaw/fail/HanMac_2.0.4J.hqx
rename to writerperfect/qa/unit/data/writer/libmwaw/pass/HanMac_2.0.4J.hqx
commit cab2717e38a11a3330f28f878b6d081fc7128766
Author: David Tardon <dtardon at redhat.com>
Date:   Thu May 29 17:14:22 2014 +0200

    enable integration test for libmwaw draw import
    
    Change-Id: I2109b948971776f06c3574ad6e7a9bebc33a40b3
    (cherry picked from commit e120b369f10207f4057ebeae92c1ee25f08e4904)

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
commit 27049e57801b772d4a61d9cfd0df1e29aba05927
Author: David Tardon <dtardon at redhat.com>
Date:   Thu May 29 17:13:33 2014 +0200

    enable integration test for libmwaw calc import
    
    Change-Id: I9ff3ed6b74d93483a2157087707c5ec47888dd6a
    (cherry picked from commit 64a9f9968a6aa801af183a142c490943702a2d68)

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
commit 89ed273d7931cf223ea5f6a3ffd075e9104c7874
Author: David Tardon <dtardon at redhat.com>
Date:   Thu May 29 17:09:36 2014 +0200

    fix detection of Keynote 3 documents
    
    Change-Id: I1c3e6b2809ee8b63f6f4db886bf6358b668b505f
    (cherry picked from commit 89e65184bc9e895085d21545c79f4089c9654c1f)

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 at 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);
commit 88abd27f0aeaead739eaa652036f26c563f0a5c4
Author: osnola <alonso at loria.fr>
Date:   Thu May 29 15:35:18 2014 +0200

    Add new libmwaw's database/spreadsheet formats...
    
    Change-Id: If07a9e548e1db15b403126263f63d9d09575eb95
    (cherry picked from commit 696c8edf7a7731ea4e0f3e4ec4dfeadac2f8ffad)

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 } };
 
 }
commit baf87ff598ca6619c12081c9517b3c3d7539fe46
Author: David Tardon <dtardon at redhat.com>
Date:   Thu May 29 15:35:15 2014 +0200

    add writerperfect calc integration test
    
    Change-Id: I3ce072f5f7d54b063988f8413251eab00f5321e4
    (cherry picked from commit b6ea5de5eda77fa1bb0b7ee8248f001d58bae6be)

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
commit 5ac70159a3c599a41584ff320f3599b081996f45
Author: osnola <alonso at loria.fr>
Date:   Thu May 29 14:29:45 2014 +0200

    Make the wdb/wks and GreatWorks(draw) work
    
    Change-Id: I1a736a511e6007a4ed6413eb8d9b8e364d73f765
    (cherry picked from commit eccfc72781dfa485c94b251e81718bdddd544606)

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) \
commit 34581eca967c6248bc9b0a02289b14c0df2cea39
Author: osnola <alonso at loria.fr>
Date:   Thu May 29 10:26:28 2014 +0200

    Try to add support for WKS/WDB files...
    
    Change-Id: I0ff1cd35be0e1546a156bc673770a920ad2ca444
    (cherry picked from commit e1fa08fe92d7d3f89f5f75cb67f17bb491c42361)

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: */
commit 0222a2b833ccd94e6edd11212c3e461d52a8d2f2
Author: David Tardon <dtardon at redhat.com>
Date:   Thu May 29 15:10:33 2014 +0200

    use the right XML import service
    
    Change-Id: I45637984f02e3363812ff8c9f0cbd3464786f4de
    (cherry picked from commit 243e6a98d80ed896686b4486b4e675ffb2cc1f59)

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..


More information about the Libreoffice-commits mailing list