[Libreoffice-commits] core.git: sw/inc sw/source
Oleg Shchelykalnov (via logerrit)
logerrit at kemper.freedesktop.org
Fri May 21 07:57:08 UTC 2021
sw/inc/shellio.hxx | 5 +++++
sw/source/filter/basflt/fltini.cxx | 17 ++++++++++++++++-
2 files changed, 21 insertions(+), 1 deletion(-)
New commits:
commit aafe21d8765158d223dd359e6737b64ed1b34549
Author: Oleg Shchelykalnov <olegshtch at yandex.ru>
AuthorDate: Wed Nov 11 17:27:08 2020 +0300
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Fri May 21 09:56:33 2021 +0200
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 at collabora.co.uk>
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";
}
More information about the Libreoffice-commits
mailing list