diff options
author | David Tardon <dtardon@redhat.com> | 2015-12-08 16:25:23 +0100 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2015-12-08 22:13:55 +0100 |
commit | e23259391817e9f6176834d70ccf425e30fa9f34 (patch) | |
tree | 7262e04e2f8dbfe59840c1501090931b15de7007 | |
parent | c4a842fcba5f0d4462fd643d5f7705ba9aef7c49 (diff) |
merge some Palm text format filters
Change-Id: I796ce84325549178d3eac572c363a8cbc9ae542f
(cherry picked from commit 8050b97aca3efbba6df31c53a64ead9c81d9d708)
-rw-r--r-- | filter/Configuration_filter.mk | 8 | ||||
-rw-r--r-- | filter/source/config/fragments/filters/Palm_Text_Document.xcu (renamed from filter/source/config/fragments/filters/TealDoc.xcu) | 6 | ||||
-rw-r--r-- | filter/source/config/fragments/filters/eReader_eBook.xcu | 29 | ||||
-rw-r--r-- | filter/source/config/fragments/filters/zTXT.xcu | 29 | ||||
-rw-r--r-- | filter/source/config/fragments/types/Palm_Text_Document.xcu (renamed from filter/source/config/fragments/types/writer_zTXT.xcu) | 6 | ||||
-rw-r--r-- | filter/source/config/fragments/types/writer_TealDoc.xcu | 29 | ||||
-rw-r--r-- | filter/source/config/fragments/types/writer_eReader_eBook.xcu | 29 | ||||
-rw-r--r-- | writerperfect/source/writer/EBookImportFilter.cxx | 45 |
8 files changed, 29 insertions, 152 deletions
diff --git a/filter/Configuration_filter.mk b/filter/Configuration_filter.mk index 575a77f208eb..75913657e2b0 100644 --- a/filter/Configuration_filter.mk +++ b/filter/Configuration_filter.mk @@ -345,14 +345,12 @@ $(eval $(call filter_Configuration_add_types,fcfg_langpack,fcfg_writer_types.xcu writer_OOXML_Template \ writer_layout_dump_xml \ writer_BroadBand_eBook \ - writer_eReader_eBook \ writer_FictionBook_2 \ writer_PalmDoc \ writer_Plucker_eBook \ - writer_TealDoc \ - writer_zTXT \ writer_ApplePages \ MWAW_Text_Document \ + Palm_Text_Document \ )) $(eval $(call filter_Configuration_add_filters,fcfg_langpack,fcfg_writer_filters.xcu,filter/source/config/fragments/filters,\ @@ -391,14 +389,12 @@ $(eval $(call filter_Configuration_add_filters,fcfg_langpack,fcfg_writer_filters OOXML_Text_Template \ writer_layout_dump \ BroadBand_eBook \ - eReader_eBook \ FictionBook_2 \ PalmDoc \ Plucker_eBook \ - TealDoc \ - zTXT \ ApplePages \ MWAW_Text_Document \ + Palm_Text_Document \ )) # fcfg_web diff --git a/filter/source/config/fragments/filters/TealDoc.xcu b/filter/source/config/fragments/filters/Palm_Text_Document.xcu index e74c154a7a17..4747d3588490 100644 --- a/filter/source/config/fragments/filters/TealDoc.xcu +++ b/filter/source/config/fragments/filters/Palm_Text_Document.xcu @@ -7,7 +7,7 @@ * --> -<node oor:name="TealDoc" oor:op="replace"> +<node oor:name="Palm_Text_Document" oor:op="replace"> <prop oor:name="Flags"> <value>IMPORT ALIEN 3RDPARTYFILTER PREFERRED</value> </prop> @@ -15,13 +15,13 @@ <value>org.libreoffice.comp.Writer.EBookImportFilter</value> </prop> <prop oor:name="UIName"> - <value xml:lang="en-US">TealDoc eBook</value> + <value xml:lang="en-US">Palm Text Document</value> </prop> <prop oor:name="FileFormatVersion"> <value>0</value> </prop> <prop oor:name="Type"> - <value>writer_TealDoc</value> + <value>Palm_Text_Document</value> </prop> <prop oor:name="DocumentService"> <value>com.sun.star.text.TextDocument</value> diff --git a/filter/source/config/fragments/filters/eReader_eBook.xcu b/filter/source/config/fragments/filters/eReader_eBook.xcu deleted file mode 100644 index efc86ba327c3..000000000000 --- a/filter/source/config/fragments/filters/eReader_eBook.xcu +++ /dev/null @@ -1,29 +0,0 @@ -<!-- - * 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="eReader eBook" oor:op="replace"> - <prop oor:name="Flags"> - <value>IMPORT ALIEN 3RDPARTYFILTER PREFERRED</value> - </prop> - <prop oor:name="FilterService"> - <value>org.libreoffice.comp.Writer.EBookImportFilter</value> - </prop> - <prop oor:name="UIName"> - <value xml:lang="en-US">eReader eBook</value> - </prop> - <prop oor:name="FileFormatVersion"> - <value>0</value> - </prop> - <prop oor:name="Type"> - <value>writer_eReader_eBook</value> - </prop> - <prop oor:name="DocumentService"> - <value>com.sun.star.text.TextDocument</value> - </prop> -</node> diff --git a/filter/source/config/fragments/filters/zTXT.xcu b/filter/source/config/fragments/filters/zTXT.xcu deleted file mode 100644 index 6e5de945d71f..000000000000 --- a/filter/source/config/fragments/filters/zTXT.xcu +++ /dev/null @@ -1,29 +0,0 @@ -<!-- - * 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="zTXT" oor:op="replace"> - <prop oor:name="Flags"> - <value>IMPORT ALIEN 3RDPARTYFILTER PREFERRED</value> - </prop> - <prop oor:name="FilterService"> - <value>org.libreoffice.comp.Writer.EBookImportFilter</value> - </prop> - <prop oor:name="UIName"> - <value xml:lang="en-US">zTXT eBook</value> - </prop> - <prop oor:name="FileFormatVersion"> - <value>0</value> - </prop> - <prop oor:name="Type"> - <value>writer_zTXT</value> - </prop> - <prop oor:name="DocumentService"> - <value>com.sun.star.text.TextDocument</value> - </prop> -</node> diff --git a/filter/source/config/fragments/types/writer_zTXT.xcu b/filter/source/config/fragments/types/Palm_Text_Document.xcu index 95cbc08abf91..e067f9f0af5f 100644 --- a/filter/source/config/fragments/types/writer_zTXT.xcu +++ b/filter/source/config/fragments/types/Palm_Text_Document.xcu @@ -7,7 +7,7 @@ * --> -<node oor:name="writer_zTXT" oor:op="replace"> +<node oor:name="Palm_Text_Document" oor:op="replace"> <prop oor:name="DetectService"> <value>org.libreoffice.comp.Writer.EBookImportFilter</value> </prop> @@ -21,9 +21,9 @@ <value>true</value> </prop> <prop oor:name="PreferredFilter"> - <value>zTXT</value> + <value>Palm_Text_Document</value> </prop> <prop oor:name="UIName"> - <value>zTXT eBook</value> + <value>Palm Text Document</value> </prop> </node> diff --git a/filter/source/config/fragments/types/writer_TealDoc.xcu b/filter/source/config/fragments/types/writer_TealDoc.xcu deleted file mode 100644 index 26c13da3c485..000000000000 --- a/filter/source/config/fragments/types/writer_TealDoc.xcu +++ /dev/null @@ -1,29 +0,0 @@ -<!-- - * 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="writer_TealDoc" oor:op="replace"> - <prop oor:name="DetectService"> - <value>org.libreoffice.comp.Writer.EBookImportFilter</value> - </prop> - <prop oor:name="Extensions"> - <value>pdb</value> - </prop> - <prop oor:name="MediaType"> - <value>application/vnd.palm</value> - </prop> - <prop oor:name="Preferred"> - <value>true</value> - </prop> - <prop oor:name="PreferredFilter"> - <value>TealDoc</value> - </prop> - <prop oor:name="UIName"> - <value>TealDoc eBook</value> - </prop> -</node> diff --git a/filter/source/config/fragments/types/writer_eReader_eBook.xcu b/filter/source/config/fragments/types/writer_eReader_eBook.xcu deleted file mode 100644 index e0908720b616..000000000000 --- a/filter/source/config/fragments/types/writer_eReader_eBook.xcu +++ /dev/null @@ -1,29 +0,0 @@ -<!-- - * 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="writer_eReader_eBook" oor:op="replace"> - <prop oor:name="DetectService"> - <value>org.libreoffice.comp.Writer.EBookImportFilter</value> - </prop> - <prop oor:name="Extensions"> - <value>pdb</value> - </prop> - <prop oor:name="MediaType"> - <value>application/vnd.palm</value> - </prop> - <prop oor:name="Preferred"> - <value>true</value> - </prop> - <prop oor:name="PreferredFilter"> - <value>eReader eBook</value> - </prop> - <prop oor:name="UIName"> - <value>eReader eBook</value> - </prop> -</node> diff --git a/writerperfect/source/writer/EBookImportFilter.cxx b/writerperfect/source/writer/EBookImportFilter.cxx index 5301bdc8afe1..73a9fbe5284b 100644 --- a/writerperfect/source/writer/EBookImportFilter.cxx +++ b/writerperfect/source/writer/EBookImportFilter.cxx @@ -28,30 +28,31 @@ using libebook::EBOOKDocument; bool EBookImportFilter::doImportDocument(librevenge::RVNGInputStream &rInput, OdtGenerator &rGenerator, utl::MediaDescriptor &rDescriptor) { - EBOOKDocument::Type type = EBOOKDocument::TYPE_UNKNOWN; - rtl::OUString aFilterName; rDescriptor[utl::MediaDescriptor::PROP_FILTERNAME()] >>= aFilterName; assert(!aFilterName.isEmpty()); - if (aFilterName == "BroadBand eBook") - type = EBOOKDocument::TYPE_BBEB; - if (aFilterName == "FictionBook 2") - type = EBOOKDocument::TYPE_FICTIONBOOK2; - else if (aFilterName == "PalmDoc") - type = EBOOKDocument::TYPE_PALMDOC; - else if (aFilterName == "Plucker eBook") - type = EBOOKDocument::TYPE_PLUCKER; - else if (aFilterName == "eReader eBook") - type = EBOOKDocument::TYPE_PEANUTPRESS; - else if (aFilterName == "TealDoc") - type = EBOOKDocument::TYPE_TEALDOC; - else if (aFilterName == "zTXT") - type = EBOOKDocument::TYPE_ZTXT; - - if (EBOOKDocument::TYPE_UNKNOWN != type) - return EBOOKDocument::RESULT_OK == EBOOKDocument::parse(&rInput, &rGenerator, type); + if (aFilterName == "Palm_Text_Document") + { + return EBOOKDocument::RESULT_OK == EBOOKDocument::parse(&rInput, &rGenerator); + } + else + { + EBOOKDocument::Type type = EBOOKDocument::TYPE_UNKNOWN; + + if (aFilterName == "BroadBand eBook") + type = EBOOKDocument::TYPE_BBEB; + else if (aFilterName == "FictionBook 2") + type = EBOOKDocument::TYPE_FICTIONBOOK2; + else if (aFilterName == "PalmDoc") + type = EBOOKDocument::TYPE_PALMDOC; + else if (aFilterName == "Plucker eBook") + type = EBOOKDocument::TYPE_PLUCKER; + + if (EBOOKDocument::TYPE_UNKNOWN != type) + return EBOOKDocument::RESULT_OK == EBOOKDocument::parse(&rInput, &rGenerator, type); + } return false; } @@ -79,13 +80,9 @@ bool EBookImportFilter::doDetectFormat(librevenge::RVNGInputStream &rInput, OUSt rTypeName = "writer_Plucker_eBook"; break; case EBOOKDocument::TYPE_PEANUTPRESS : - rTypeName = "writer_eReader_eBook"; - break; case EBOOKDocument::TYPE_TEALDOC : - rTypeName = "writer_TealDoc"; - break; case EBOOKDocument::TYPE_ZTXT : - rTypeName = "writer_zTXT"; + rTypeName = "Palm_Text_Document"; break; default : SAL_WARN_IF(type != EBOOKDocument::TYPE_UNKNOWN, "writerperfect", "EBookImportFilter::doDetectFormat: document type " << type << " detected, but ignored"); |