summaryrefslogtreecommitdiff
path: root/filter/source/textfilterdetect
diff options
context:
space:
mode:
authorMaxim Monastirsky <momonasmon@gmail.com>2014-08-28 23:35:33 +0300
committerMaxim Monastirsky <momonasmon@gmail.com>2014-08-29 00:54:35 +0300
commit1298c1d13572c6fbfbabb813b2d6843368c6df1f (patch)
treeec4e16598c7a9e1447365e7cdbfdd1243f7adfc8 /filter/source/textfilterdetect
parent65f70e0d57be14c55063709e86f252f84dab087b (diff)
We don't check the extension for html
...since 86c6f18c2766aad43d6e3bfcf3530e40440ebca7, so move the related code and comment to the plain text scope. Change-Id: I501ebaba915ddaa3f5d1d8d2977d3ba70fb6071b
Diffstat (limited to 'filter/source/textfilterdetect')
-rw-r--r--filter/source/textfilterdetect/filterdetect.cxx16
1 files changed, 7 insertions, 9 deletions
diff --git a/filter/source/textfilterdetect/filterdetect.cxx b/filter/source/textfilterdetect/filterdetect.cxx
index 1d29dd45cc5d..0b7ae1fc8994 100644
--- a/filter/source/textfilterdetect/filterdetect.cxx
+++ b/filter/source/textfilterdetect/filterdetect.cxx
@@ -125,12 +125,6 @@ OUString SAL_CALL PlainTextFilterDetect::detect(uno::Sequence<beans::PropertyVal
OUString aType = aMediaDesc.getUnpackedValueOrDefault(MediaDescriptor::PROP_TYPENAME(), OUString() );
OUString aDocService = aMediaDesc.getUnpackedValueOrDefault(MediaDescriptor::PROP_DOCUMENTSERVICE(), OUString() );
- OUString aUrl = aMediaDesc.getUnpackedValueOrDefault(MediaDescriptor::PROP_URL(), OUString() );
-
- // Get the file name extension.
- INetURLObject aParser(aUrl);
- OUString aExt = aParser.getExtension(INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET);
- aExt = aExt.toAsciiLowerCase();
if ((aType == "generic_HTML") || (aType == "calc_HTML"))
{
@@ -138,9 +132,6 @@ OUString SAL_CALL PlainTextFilterDetect::detect(uno::Sequence<beans::PropertyVal
if (!xInStream.is() || !IsHTMLStream(xInStream))
return OUString();
- // Decide which filter to use based on the document service first,
- // then on extension if that's not available.
-
if ((aDocService == CALC_DOCSERVICE) || (aType == "calc_HTML"))
aMediaDesc[MediaDescriptor::PROP_FILTERNAME()] <<= OUString(CALC_HTML_FILTER);
else if (aDocService == WRITER_DOCSERVICE)
@@ -151,6 +142,13 @@ OUString SAL_CALL PlainTextFilterDetect::detect(uno::Sequence<beans::PropertyVal
else if (aType == "generic_Text")
{
+ // Get the file name extension.
+ INetURLObject aParser(aMediaDesc.getUnpackedValueOrDefault(MediaDescriptor::PROP_URL(), OUString() ) );
+ OUString aExt = aParser.getExtension(INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET);
+ aExt = aExt.toAsciiLowerCase();
+
+ // Decide which filter to use based on the document service first,
+ // then on extension if that's not available.
if (aDocService == CALC_DOCSERVICE)
aMediaDesc[MediaDescriptor::PROP_FILTERNAME()] <<= OUString(CALC_TEXT_FILTER);
else if (aDocService == WRITER_DOCSERVICE)