[Libreoffice-commits] core.git: sw/qa sw/source

2021-06-09 Thread Oleg Shchelykalnov (via logerrit)
 sw/qa/extras/txtencexport/txtencexport.cxx |2 +-
 sw/source/filter/ascii/wrtasc.cxx  |3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

New commits:
commit b5e07b1339f73841664b28c65639f1638bd7edf4
Author: Oleg Shchelykalnov 
AuthorDate: Wed May 26 22:11:49 2021 +0300
Commit: Michael Stahl 
CommitDate: Wed Jun 9 11:10:01 2021 +0200

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 

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)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: solenv/clang-format sw/CppunitTest_sw_txtencexport.mk sw/Module_sw.mk sw/qa

2021-06-09 Thread Oleg Shchelykalnov (via logerrit)
 solenv/clang-format/excludelist|1 
 sw/CppunitTest_sw_txtencexport.mk  |   63 ++
 sw/Module_sw.mk|1 
 sw/qa/extras/txtencexport/data/bullets.odt |binary
 sw/qa/extras/txtencexport/txtencexport.cxx |  101 +
 5 files changed, 166 insertions(+)

New commits:
commit c96b61f86ef3f4cdc34f84043fed2724b6d9732b
Author: Oleg Shchelykalnov 
AuthorDate: Wed May 26 18:20:06 2021 +0300
Commit: Michael Stahl 
CommitDate: Wed Jun 9 11:09:15 2021 +0200

tdf#137469 Prepare tests for encoded text filter

Change-Id: Ifba71748cc389544bfb64e225a7020de8261967b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105621
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/solenv/clang-format/excludelist b/solenv/clang-format/excludelist
index ec136c66d917..13a5f25ac5ff 100644
--- a/solenv/clang-format/excludelist
+++ b/solenv/clang-format/excludelist
@@ -12332,6 +12332,7 @@ sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
 sw/qa/extras/ooxmlexport/ooxmlw14export.cxx
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx
 sw/qa/extras/tiledrendering/tiledrendering.cxx
+sw/qa/extras/txtencexport/txtencexport.cxx
 sw/qa/extras/uiwriter/uiwriter.cxx
 sw/qa/extras/ww8export/ww8export.cxx
 sw/qa/extras/ww8export/ww8export2.cxx
diff --git a/sw/CppunitTest_sw_txtencexport.mk 
b/sw/CppunitTest_sw_txtencexport.mk
new file mode 100644
index ..1f37a8eba4c8
--- /dev/null
+++ b/sw/CppunitTest_sw_txtencexport.mk
@@ -0,0 +1,63 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#*
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+#*
+
+$(eval $(call gb_CppunitTest_CppunitTest,sw_txtencexport))
+
+$(eval $(call gb_CppunitTest_use_common_precompiled_header,sw_txtencexport))
+
+$(eval $(call gb_CppunitTest_add_exception_objects,sw_txtencexport, \
+sw/qa/extras/txtencexport/txtencexport \
+))
+
+$(eval $(call gb_CppunitTest_use_libraries,sw_txtencexport, \
+comphelper \
+cppu \
+cppuhelper \
+i18nlangtag \
+sal \
+sfx \
+sw \
+swqahelper \
+test \
+tl \
+unotest \
+utl \
+vcl \
+$(gb_UWINAPI) \
+))
+
+$(eval $(call gb_CppunitTest_use_externals,sw_txtencexport,\
+boost_headers \
+libxml2 \
+))
+
+$(eval $(call gb_CppunitTest_set_include,sw_txtencexport,\
+-I$(SRCDIR)/sw/inc \
+-I$(SRCDIR)/sw/source/core/inc \
+-I$(SRCDIR)/sw/source/uibase/inc \
+-I$(SRCDIR)/sw/qa/inc \
+$$(INCLUDE) \
+))
+
+$(eval $(call gb_CppunitTest_use_api,sw_txtencexport,\
+udkapi \
+offapi \
+oovbaapi \
+))
+
+$(eval $(call gb_CppunitTest_use_ure,sw_txtencexport))
+$(eval $(call gb_CppunitTest_use_vcl,sw_txtencexport))
+
+$(eval $(call gb_CppunitTest_use_rdb,sw_txtencexport,services))
+
+$(eval $(call gb_CppunitTest_use_configuration,sw_txtencexport))
+
+# vim: set noet sw=4 ts=4:
diff --git a/sw/Module_sw.mk b/sw/Module_sw.mk
index 80cad58b1bdc..28782147fb9e 100644
--- a/sw/Module_sw.mk
+++ b/sw/Module_sw.mk
@@ -104,6 +104,7 @@ $(eval $(call gb_Module_add_slowcheck_targets,sw,\
 CppunitTest_sw_odfexport2 \
 CppunitTest_sw_odfimport \
 CppunitTest_sw_txtexport \
+CppunitTest_sw_txtencexport \
 CppunitTest_sw_txtimport \
 $(if $(filter-out MACOSX,$(OS)), \
 CppunitTest_sw_uiwriter \
diff --git a/sw/qa/extras/txtencexport/data/bullets.odt 
b/sw/qa/extras/txtencexport/data/bullets.odt
new file mode 100644
index ..aec2b52cbd27
Binary files /dev/null and b/sw/qa/extras/txtencexport/data/bullets.odt differ
diff --git a/sw/qa/extras/txtencexport/txtencexport.cxx 
b/sw/qa/extras/txtencexport/txtencexport.cxx
new file mode 100644
index ..ec9fa697e9d1
--- /dev/null
+++ b/sw/qa/extras/txtencexport/txtencexport.cxx
@@ -0,0 +1,101 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include 
+
+#include 
+
+class TxtEncExportTest : public SwModelTestBase
+{
+public:
+TxtEncExportTest(const OUString & rFilterOptions)
+: SwModelTestBase("/sw/qa/extras/txtencexport/data/", "Text (encoded)")
+{
+setFilterOptions(rFilterOptions);
+}
+
+protected:
+OString readExportedFile()
+{
+SvMemoryStream aMemoryStream;
+SvFileStream aStream(maTempFile.GetURL(), StreamMode::READ);
+

[Libreoffice-commits] core.git: sw/inc sw/source

2021-05-21 Thread Oleg Shchelykalnov (via logerrit)
 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 
AuthorDate: Wed Nov 11 17:27:08 2020 +0300
Commit: Noel Grandin 
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 

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";
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-4' - sw/source

2020-03-30 Thread Oleg Shchelykalnov (via logerrit)
 sw/source/uibase/dbui/dbmgr.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 06789981b0ed4485f695ad87b332a1b6c3230365
Author: Oleg Shchelykalnov 
AuthorDate: Sat Mar 28 15:48:18 2020 +0300
Commit: Adolfo Jayme Barrientos 
CommitDate: Mon Mar 30 10:18:48 2020 +0200

tdf#131618 MailMerge: Don't require DataSourceName if ResultSet provided

Allows to use ResultSet instead of DataSourceName and DataCommand
options.

Change-Id: I654cdf3bc850ab1c1a29837e8aabdee410b30439
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91277
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
(cherry picked from commit a039725510f13c77591106b02f32f5899c37c007)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91290
Reviewed-by: Oleg Schelykalnov 
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx
index 8d11292d9e52..05216c55c08b 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -479,7 +479,7 @@ bool SwDBManager::Merge( const SwMergeDescriptor& 
rMergeDesc )
 if ( 
rMergeDesc.rDescriptor.has(svx::DataAccessDescriptorProperty::Connection) )
 rMergeDesc.rDescriptor[svx::DataAccessDescriptorProperty::Connection] 
>>= xConnection;
 
-if(aData.sDataSource.isEmpty() || aData.sCommand.isEmpty() || 
!xResSet.is())
+if((aData.sDataSource.isEmpty() || aData.sCommand.isEmpty()) && 
!xResSet.is())
 {
 return false;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sw/source

2020-03-28 Thread Oleg Shchelykalnov (via logerrit)
 sw/source/uibase/dbui/dbmgr.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit a039725510f13c77591106b02f32f5899c37c007
Author: Oleg Shchelykalnov 
AuthorDate: Sat Mar 28 15:48:18 2020 +0300
Commit: Noel Grandin 
CommitDate: Sat Mar 28 20:29:04 2020 +0100

tdf#131618 MailMerge: Don't require DataSourceName if ResultSet provided

Allows to use ResultSet instead of DataSourceName and DataCommand
options.

Change-Id: I654cdf3bc850ab1c1a29837e8aabdee410b30439
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91277
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx
index 0fd0ffc46cf5..a51cb6366753 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -466,7 +466,7 @@ bool SwDBManager::Merge( const SwMergeDescriptor& 
rMergeDesc )
 if ( 
rMergeDesc.rDescriptor.has(svx::DataAccessDescriptorProperty::Connection) )
 rMergeDesc.rDescriptor[svx::DataAccessDescriptorProperty::Connection] 
>>= xConnection;
 
-if(aData.sDataSource.isEmpty() || aData.sCommand.isEmpty() || 
!xResSet.is())
+if((aData.sDataSource.isEmpty() || aData.sCommand.isEmpty()) && 
!xResSet.is())
 {
 return false;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits