summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleg Shchelykalnov <olegshtch@yandex.ru>2021-05-26 22:11:49 +0300
committerMichael Stahl <michael.stahl@allotropia.de>2021-06-09 11:10:01 +0200
commitb5e07b1339f73841664b28c65639f1638bd7edf4 (patch)
tree05bf42cab6d53bfbbeda1eb54a04dcf85bb0cf1a
parentc96b61f86ef3f4cdc34f84043fed2724b6d9732b (diff)
tdf#137469 Implement and test excluding hidden text in text filter
Uses filter options to manage whether hidden text output to file. Fixes filter options usage in test. Change-Id: I12a234438730795df6dd11bd6707dfa1fbfa4740 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105631 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
-rw-r--r--sw/qa/extras/txtencexport/txtencexport.cxx2
-rw-r--r--sw/source/filter/ascii/wrtasc.cxx3
2 files changed, 3 insertions, 2 deletions
diff --git a/sw/qa/extras/txtencexport/txtencexport.cxx b/sw/qa/extras/txtencexport/txtencexport.cxx
index ec9fa697e9d1..bce9b81b4564 100644
--- a/sw/qa/extras/txtencexport/txtencexport.cxx
+++ b/sw/qa/extras/txtencexport/txtencexport.cxx
@@ -86,7 +86,7 @@ DECLARE_TXTENCEXPORT_TEST(testBulletsHidden, "bullets.odt", "UTF8,,,,,false", Tx
" 2. Second" SAL_NEWLINE_STRING " 1. Second-first" SAL_NEWLINE_STRING
" Third, but deleted" SAL_NEWLINE_STRING " 3. Actual third" SAL_NEWLINE_STRING
"" SAL_NEWLINE_STRING "Paragraph after numbering" SAL_NEWLINE_STRING
- "Next paragraph" SAL_NEWLINE_STRING "Hidden paragraph" SAL_NEWLINE_STRING
+ "Next paragraph" SAL_NEWLINE_STRING
"Final paragraph" SAL_NEWLINE_STRING,
RTL_TEXTENCODING_UTF8);
diff --git a/sw/source/filter/ascii/wrtasc.cxx b/sw/source/filter/ascii/wrtasc.cxx
index f122e51f6d5c..1bba438e87e8 100644
--- a/sw/source/filter/ascii/wrtasc.cxx
+++ b/sw/source/filter/ascii/wrtasc.cxx
@@ -87,6 +87,7 @@ SwASCWriter::~SwASCWriter() {}
ErrCode SwASCWriter::WriteStream()
{
bool bIncludeBOM = GetAsciiOptions().GetIncludeBOM();
+ bool bIncludeHidden = GetAsciiOptions().GetIncludeHidden();
if( m_bASCII_ParaAsCR ) // If predefined
m_sLineEnd = "\015";
@@ -149,7 +150,7 @@ ErrCode SwASCWriter::WriteStream()
continue; // reset while loop!
}
}
- else
+ else if (!pNd->IsHidden() || bIncludeHidden)
{
if (bWriteSttTag)
{