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
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
......
......@@ -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>
......
<!--
* 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 @@
*
-->
<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>
<!--
* 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;
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");
......
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