summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleg Shchelykalnov <olegshtch@yandex.ru>2020-11-11 17:27:08 +0300
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-05-21 09:56:33 +0200
commitaafe21d8765158d223dd359e6737b64ed1b34549 (patch)
tree759493123f83c9b9d638111038ce35dd2305f34c
parentc8598f28db8ef5ab5f695cf1af645bb43dbc264d (diff)
tdf#137469 Add option to disable hidden text in text filter
Adds sixth filter option to text filter. If true (default) filter save hidden text to output file. Change-Id: I71202653b3cc4e50ddd06a665f5a718f875f6d79 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105579 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--sw/inc/shellio.hxx5
-rw-r--r--sw/source/filter/basflt/fltini.cxx17
2 files changed, 21 insertions, 1 deletions
diff --git a/sw/inc/shellio.hxx b/sw/inc/shellio.hxx
index d05293c45365..1cdda8e0ed5a 100644
--- a/sw/inc/shellio.hxx
+++ b/sw/inc/shellio.hxx
@@ -62,6 +62,7 @@ class SW_DLLPUBLIC SwAsciiOptions
LanguageType m_nLanguage;
LineEnd m_eCRLF_Flag;
bool m_bIncludeBOM; // Whether to include a byte-order-mark in the output.
+ bool m_bIncludeHidden; // Whether to include hidden paragraphs and text.
public:
@@ -80,6 +81,9 @@ public:
bool GetIncludeBOM() const { return m_bIncludeBOM; }
void SetIncludeBOM( bool bVal ) { m_bIncludeBOM = bVal; }
+ bool GetIncludeHidden() const { return m_bIncludeHidden; }
+ void SetIncludeHidden( bool bVal ) { m_bIncludeHidden = bVal; }
+
void Reset()
{
m_sFont.clear();
@@ -87,6 +91,7 @@ public:
m_eCharSet = ::osl_getThreadTextEncoding();
m_nLanguage = LANGUAGE_SYSTEM;
m_bIncludeBOM = true;
+ m_bIncludeHidden = true;
}
// for the automatic conversion (mail/news/...)
void ReadUserData( const OUString& );
diff --git a/sw/source/filter/basflt/fltini.cxx b/sw/source/filter/basflt/fltini.cxx
index e8a64eda2d83..57e66b9a5e8e 100644
--- a/sw/source/filter/basflt/fltini.cxx
+++ b/sw/source/filter/basflt/fltini.cxx
@@ -542,6 +542,7 @@ OUString NameFromCharSet(rtl_TextEncoding nChrSet)
// 3. Fontname
// 4. Language
// 5. Whether to include byte-order-mark - as true/false
+// 6. Whether to include hidden paragraphs and text - as true/false
// the delimiter character is ","
void SwAsciiOptions::ReadUserData( const OUString& rStr )
@@ -565,6 +566,9 @@ void SwAsciiOptions::ReadUserData( const OUString& rStr )
m_nLanguage = LanguageTag::convertToLanguageTypeWithFallback(sToken);
if (nToken >= 0 && !(sToken = rStr.getToken(0, ',', nToken)).isEmpty()) // 5. Include BOM?
m_bIncludeBOM = !(sToken.equalsIgnoreAsciiCase("FALSE"));
+ // 6. Include hidden text
+ if (nToken >= 0 && !(sToken = rStr.getToken(0, ',', nToken)).isEmpty())
+ m_bIncludeHidden = !(sToken.equalsIgnoreAsciiCase("FALSE"));
}
void SwAsciiOptions::WriteUserData(OUString& rStr)
@@ -598,7 +602,18 @@ void SwAsciiOptions::WriteUserData(OUString& rStr)
rStr += ",";
// 5. Whether to include byte-order-mark
- if( m_bIncludeBOM )
+ if(m_bIncludeBOM)
+ {
+ rStr += "true";
+ }
+ else
+ {
+ rStr += "false";
+ }
+ rStr += ",";
+
+ // 6. Whether to include hidden paragraphs and text
+ if(m_bIncludeHidden)
{
rStr += "true";
}