summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorMaxim Monastirsky <momonasmon@gmail.com>2013-12-11 20:25:57 +0200
committerKohei Yoshida <libreoffice@kohei.us>2013-12-11 21:33:38 +0000
commit511a59ef2c1b580a4391fa6e5d95cc6826420d65 (patch)
treeb2e883cc8b4c0e54554a16df90fc976305f0b6ab /filter
parentdefc4faef618d4273ee5056359f4b8e5eed24a7c (diff)
Open .tab files with Calc
.tab extension is a known extension for tab-separated values according to Wikipedia. Also add .tsv .tab files to the list of known text files, so XML detection code won't run on it, and won't output errors to console. Change-Id: Ifb8edc40900cb4669264e1e989c01efd61ff24bf Reviewed-on: https://gerrit.libreoffice.org/7038 Reviewed-by: Kohei Yoshida <libreoffice@kohei.us> Tested-by: Kohei Yoshida <libreoffice@kohei.us>
Diffstat (limited to 'filter')
-rw-r--r--filter/source/config/fragments/types/generic_Text.xcu2
-rw-r--r--filter/source/textfilterdetect/filterdetect.cxx2
2 files changed, 3 insertions, 1 deletions
diff --git a/filter/source/config/fragments/types/generic_Text.xcu b/filter/source/config/fragments/types/generic_Text.xcu
index e0dc31d0f55d..45df03f62fa6 100644
--- a/filter/source/config/fragments/types/generic_Text.xcu
+++ b/filter/source/config/fragments/types/generic_Text.xcu
@@ -18,7 +18,7 @@
<node oor:name="generic_Text" oor:op="replace" >
<prop oor:name="DetectService"><value>com.sun.star.comp.filters.PlainTextFilterDetect</value></prop>
<prop oor:name="URLPattern"/>
- <prop oor:name="Extensions"><value>csv txt</value></prop>
+ <prop oor:name="Extensions"><value>csv tsv tab txt</value></prop>
<prop oor:name="MediaType"><value>text/plain</value></prop>
<prop oor:name="Preferred"><value>false</value></prop>
<prop oor:name="UIName">
diff --git a/filter/source/textfilterdetect/filterdetect.cxx b/filter/source/textfilterdetect/filterdetect.cxx
index 360d8d460730..deaeecd8dcf1 100644
--- a/filter/source/textfilterdetect/filterdetect.cxx
+++ b/filter/source/textfilterdetect/filterdetect.cxx
@@ -89,6 +89,8 @@ OUString SAL_CALL PlainTextFilterDetect::detect(uno::Sequence<beans::PropertyVal
setPropValue(lDescriptor, nFilter, "FilterName", OUString(CALC_TEXT_FILTER));
else if (aExt == "tsv")
setPropValue(lDescriptor, nFilter, "FilterName", OUString(CALC_TEXT_FILTER));
+ else if (aExt == "tab")
+ setPropValue(lDescriptor, nFilter, "FilterName", OUString(CALC_TEXT_FILTER));
else if (aExt == "xls")
setPropValue(lDescriptor, nFilter, "FilterName", OUString(CALC_TEXT_FILTER));
else if (aExt == "txt")