Kaydet (Commit) 8050b97a authored tarafından David Tardon's avatar David Tardon

merge some Palm text format filters

Change-Id: I796ce84325549178d3eac572c363a8cbc9ae542f
üst 6dd6bc42
...@@ -345,14 +345,12 @@ $(eval $(call filter_Configuration_add_types,fcfg_langpack,fcfg_writer_types.xcu ...@@ -345,14 +345,12 @@ $(eval $(call filter_Configuration_add_types,fcfg_langpack,fcfg_writer_types.xcu
writer_OOXML_Template \ writer_OOXML_Template \
writer_layout_dump_xml \ writer_layout_dump_xml \
writer_BroadBand_eBook \ writer_BroadBand_eBook \
writer_eReader_eBook \
writer_FictionBook_2 \ writer_FictionBook_2 \
writer_PalmDoc \ writer_PalmDoc \
writer_Plucker_eBook \ writer_Plucker_eBook \
writer_TealDoc \
writer_zTXT \
writer_ApplePages \ writer_ApplePages \
MWAW_Text_Document \ MWAW_Text_Document \
Palm_Text_Document \
)) ))
$(eval $(call filter_Configuration_add_filters,fcfg_langpack,fcfg_writer_filters.xcu,filter/source/config/fragments/filters,\ $(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 ...@@ -391,14 +389,12 @@ $(eval $(call filter_Configuration_add_filters,fcfg_langpack,fcfg_writer_filters
OOXML_Text_Template \ OOXML_Text_Template \
writer_layout_dump \ writer_layout_dump \
BroadBand_eBook \ BroadBand_eBook \
eReader_eBook \
FictionBook_2 \ FictionBook_2 \
PalmDoc \ PalmDoc \
Plucker_eBook \ Plucker_eBook \
TealDoc \
zTXT \
ApplePages \ ApplePages \
MWAW_Text_Document \ MWAW_Text_Document \
Palm_Text_Document \
)) ))
# fcfg_web # fcfg_web
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
--> -->
<node oor:name="TealDoc" oor:op="replace"> <node oor:name="Palm_Text_Document" oor:op="replace">
<prop oor:name="Flags"> <prop oor:name="Flags">
<value>IMPORT ALIEN 3RDPARTYFILTER PREFERRED</value> <value>IMPORT ALIEN 3RDPARTYFILTER PREFERRED</value>
</prop> </prop>
...@@ -15,13 +15,13 @@ ...@@ -15,13 +15,13 @@
<value>org.libreoffice.comp.Writer.EBookImportFilter</value> <value>org.libreoffice.comp.Writer.EBookImportFilter</value>
</prop> </prop>
<prop oor:name="UIName"> <prop oor:name="UIName">
<value xml:lang="en-US">TealDoc eBook</value> <value xml:lang="en-US">Palm Text Document</value>
</prop> </prop>
<prop oor:name="FileFormatVersion"> <prop oor:name="FileFormatVersion">
<value>0</value> <value>0</value>
</prop> </prop>
<prop oor:name="Type"> <prop oor:name="Type">
<value>writer_TealDoc</value> <value>Palm_Text_Document</value>
</prop> </prop>
<prop oor:name="DocumentService"> <prop oor:name="DocumentService">
<value>com.sun.star.text.TextDocument</value> <value>com.sun.star.text.TextDocument</value>
......
<!--
* 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>
<!--
* 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>
...@@ -7,7 +7,7 @@ ...@@ -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"> <prop oor:name="DetectService">
<value>org.libreoffice.comp.Writer.EBookImportFilter</value> <value>org.libreoffice.comp.Writer.EBookImportFilter</value>
</prop> </prop>
...@@ -21,9 +21,9 @@ ...@@ -21,9 +21,9 @@
<value>true</value> <value>true</value>
</prop> </prop>
<prop oor:name="PreferredFilter"> <prop oor:name="PreferredFilter">
<value>zTXT</value> <value>Palm_Text_Document</value>
</prop> </prop>
<prop oor:name="UIName"> <prop oor:name="UIName">
<value>zTXT eBook</value> <value>Palm Text Document</value>
</prop> </prop>
</node> </node>
<!--
* 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>
<!--
* 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>
...@@ -28,30 +28,31 @@ using libebook::EBOOKDocument; ...@@ -28,30 +28,31 @@ using libebook::EBOOKDocument;
bool EBookImportFilter::doImportDocument(librevenge::RVNGInputStream &rInput, OdtGenerator &rGenerator, utl::MediaDescriptor &rDescriptor) bool EBookImportFilter::doImportDocument(librevenge::RVNGInputStream &rInput, OdtGenerator &rGenerator, utl::MediaDescriptor &rDescriptor)
{ {
EBOOKDocument::Type type = EBOOKDocument::TYPE_UNKNOWN;
rtl::OUString aFilterName; rtl::OUString aFilterName;
rDescriptor[utl::MediaDescriptor::PROP_FILTERNAME()] >>= aFilterName; rDescriptor[utl::MediaDescriptor::PROP_FILTERNAME()] >>= aFilterName;
assert(!aFilterName.isEmpty()); assert(!aFilterName.isEmpty());
if (aFilterName == "BroadBand eBook") if (aFilterName == "Palm_Text_Document")
type = EBOOKDocument::TYPE_BBEB; {
if (aFilterName == "FictionBook 2") return EBOOKDocument::RESULT_OK == EBOOKDocument::parse(&rInput, &rGenerator);
type = EBOOKDocument::TYPE_FICTIONBOOK2; }
else if (aFilterName == "PalmDoc") else
type = EBOOKDocument::TYPE_PALMDOC; {
else if (aFilterName == "Plucker eBook") EBOOKDocument::Type type = EBOOKDocument::TYPE_UNKNOWN;
type = EBOOKDocument::TYPE_PLUCKER;
else if (aFilterName == "eReader eBook") if (aFilterName == "BroadBand eBook")
type = EBOOKDocument::TYPE_PEANUTPRESS; type = EBOOKDocument::TYPE_BBEB;
else if (aFilterName == "TealDoc") else if (aFilterName == "FictionBook 2")
type = EBOOKDocument::TYPE_TEALDOC; type = EBOOKDocument::TYPE_FICTIONBOOK2;
else if (aFilterName == "zTXT") else if (aFilterName == "PalmDoc")
type = EBOOKDocument::TYPE_ZTXT; type = EBOOKDocument::TYPE_PALMDOC;
else if (aFilterName == "Plucker eBook")
if (EBOOKDocument::TYPE_UNKNOWN != type) type = EBOOKDocument::TYPE_PLUCKER;
return EBOOKDocument::RESULT_OK == EBOOKDocument::parse(&rInput, &rGenerator, type);
if (EBOOKDocument::TYPE_UNKNOWN != type)
return EBOOKDocument::RESULT_OK == EBOOKDocument::parse(&rInput, &rGenerator, type);
}
return false; return false;
} }
...@@ -79,13 +80,9 @@ bool EBookImportFilter::doDetectFormat(librevenge::RVNGInputStream &rInput, OUSt ...@@ -79,13 +80,9 @@ bool EBookImportFilter::doDetectFormat(librevenge::RVNGInputStream &rInput, OUSt
rTypeName = "writer_Plucker_eBook"; rTypeName = "writer_Plucker_eBook";
break; break;
case EBOOKDocument::TYPE_PEANUTPRESS : case EBOOKDocument::TYPE_PEANUTPRESS :
rTypeName = "writer_eReader_eBook";
break;
case EBOOKDocument::TYPE_TEALDOC : case EBOOKDocument::TYPE_TEALDOC :
rTypeName = "writer_TealDoc";
break;
case EBOOKDocument::TYPE_ZTXT : case EBOOKDocument::TYPE_ZTXT :
rTypeName = "writer_zTXT"; rTypeName = "Palm_Text_Document";
break; break;
default : default :
SAL_WARN_IF(type != EBOOKDocument::TYPE_UNKNOWN, "writerperfect", "EBookImportFilter::doDetectFormat: document type " << type << " detected, but ignored"); SAL_WARN_IF(type != EBOOKDocument::TYPE_UNKNOWN, "writerperfect", "EBookImportFilter::doDetectFormat: document type " << type << " detected, but ignored");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment