summaryrefslogtreecommitdiff
path: root/filter/source/textfilterdetect
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2014-07-08 17:01:27 +0200
committerDavid Tardon <dtardon@redhat.com>2014-07-08 17:03:42 +0200
commit86c6f18c2766aad43d6e3bfcf3530e40440ebca7 (patch)
treecf82daabab0b45c481eb9dbb76eb99b1a77e5cf4 /filter/source/textfilterdetect
parent8d4d3b2adee67057f88ca1f6d71a4843227b183e (diff)
avoid problems detecting HTML files with .xls ext.
Change-Id: I9955223aac20f3f640fde51bb7231666c269ca70
Diffstat (limited to 'filter/source/textfilterdetect')
-rw-r--r--filter/source/textfilterdetect/filterdetect.cxx6
1 files changed, 2 insertions, 4 deletions
diff --git a/filter/source/textfilterdetect/filterdetect.cxx b/filter/source/textfilterdetect/filterdetect.cxx
index ffad7faa0282..1d29dd45cc5d 100644
--- a/filter/source/textfilterdetect/filterdetect.cxx
+++ b/filter/source/textfilterdetect/filterdetect.cxx
@@ -132,7 +132,7 @@ OUString SAL_CALL PlainTextFilterDetect::detect(uno::Sequence<beans::PropertyVal
OUString aExt = aParser.getExtension(INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET);
aExt = aExt.toAsciiLowerCase();
- if (aType == "generic_HTML")
+ if ((aType == "generic_HTML") || (aType == "calc_HTML"))
{
uno::Reference<io::XInputStream> xInStream(aMediaDesc[MediaDescriptor::PROP_INPUTSTREAM()], uno::UNO_QUERY);
if (!xInStream.is() || !IsHTMLStream(xInStream))
@@ -141,12 +141,10 @@ OUString SAL_CALL PlainTextFilterDetect::detect(uno::Sequence<beans::PropertyVal
// Decide which filter to use based on the document service first,
// then on extension if that's not available.
- if (aDocService == CALC_DOCSERVICE)
+ if ((aDocService == CALC_DOCSERVICE) || (aType == "calc_HTML"))
aMediaDesc[MediaDescriptor::PROP_FILTERNAME()] <<= OUString(CALC_HTML_FILTER);
else if (aDocService == WRITER_DOCSERVICE)
aMediaDesc[MediaDescriptor::PROP_FILTERNAME()] <<= OUString(WRITER_HTML_FILTER);
- else if (aExt == "xls")
- aMediaDesc[MediaDescriptor::PROP_FILTERNAME()] <<= OUString(CALC_HTML_FILTER);
else
aMediaDesc[MediaDescriptor::PROP_FILTERNAME()] <<= OUString(WEB_HTML_FILTER);
}