summaryrefslogtreecommitdiff
path: root/writerperfect
diff options
context:
space:
mode:
authoralonso <laurent.alonso@inria.fr>2014-05-28 15:55:39 +0200
committerDavid Tardon <dtardon@redhat.com>2014-05-29 08:02:27 +0200
commit6cae6d682cfdec0104f68552def2d1b5719c8fbe (patch)
tree0c942209858aa51621be4df3c7530b67cf139fe2 /writerperfect
parentc14a6e0570c33c8a1258d5b562ca082de2cf05ce (diff)
enable new handlers
Change-Id: I1c07a44e7d318478bcb2561d29ea53a9475e4b1f
Diffstat (limited to 'writerperfect')
-rw-r--r--writerperfect/source/writer/MSWorksImportFilter.cxx12
-rw-r--r--writerperfect/source/writer/MSWorksImportFilter.hxx1
-rw-r--r--writerperfect/source/writer/MWAWImportFilter.cxx52
3 files changed, 54 insertions, 11 deletions
diff --git a/writerperfect/source/writer/MSWorksImportFilter.cxx b/writerperfect/source/writer/MSWorksImportFilter.cxx
index 75672947b463..2d253fbf7cd4 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 b5ddfe4ccf64..9bddf0882550 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 ad656c942817..d55a645cae5f 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 ()