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:34:30 +0000
commit86c7b2559eb1390fb72c97f8b54e41b6fdee0d7c (patch)
treeb4670722597956d33b6b3b28f6c4b48b0f552863 /filter
parent3e2dff3a18e52c153b3bebd2fa0f4aee7f3f671b (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/7039 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")