[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/qa sw/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Wed Mar 6 11:32:38 UTC 2019
sw/qa/extras/odfimport/data/tdf123829.odt |binary
sw/qa/extras/odfimport/odfimport.cxx | 11 +++++++++++
sw/source/filter/xml/xmlimp.cxx | 6 ++++++
3 files changed, 17 insertions(+)
New commits:
commit a1ec611ea740e56949cf9f80179a90591d4f9dfc
Author: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
AuthorDate: Tue Mar 5 13:47:10 2019 +0100
Commit: Michael Stahl <Michael.Stahl at cib.de>
CommitDate: Wed Mar 6 12:32:12 2019 +0100
tdf#123829 Respect CollapseEmptyCellPara setting when reading odf docs
Commit 56b2cf0c10d9caa01ebae1d80465e342d046a85c introduced a "feature"
which would hide an empty line after a table and only make it visible
when the cursor is in it.
So when loading an ODF doc, only enable this feature for which have the
CollapseEmptyCellPara setting set.
Change-Id: Ib4dfbbe8d45eb57547c51c7eee2f81331fc5300e
Reviewed-on: https://gerrit.libreoffice.org/68742
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
(cherry picked from commit 0d2da0acfaa610c690bce552c0ed5df62d4c35cb)
Reviewed-on: https://gerrit.libreoffice.org/68790
Reviewed-by: Michael Stahl <Michael.Stahl at cib.de>
diff --git a/sw/qa/extras/odfimport/data/tdf123829.odt b/sw/qa/extras/odfimport/data/tdf123829.odt
new file mode 100644
index 000000000000..3219b4156182
Binary files /dev/null and b/sw/qa/extras/odfimport/data/tdf123829.odt differ
diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx
index 88f3564e3be3..9ee4f206f5a5 100644
--- a/sw/qa/extras/odfimport/odfimport.cxx
+++ b/sw/qa/extras/odfimport/odfimport.cxx
@@ -22,6 +22,7 @@
#include <com/sun/star/text/PageNumberType.hpp>
#include <com/sun/star/text/VertOrientation.hpp>
+#include <IDocumentSettingAccess.hxx>
#include <wrtsh.hxx>
#include <ndtxt.hxx>
#include <swdtflvr.hxx>
@@ -915,5 +916,15 @@ DECLARE_ODFIMPORT_TEST(testTdf120677, "tdf120677.fodt")
// The document used to hang the layout, consuming memory until OOM
}
+DECLARE_ODFIMPORT_TEST(testTdf123829, "tdf123829.odt")
+{
+ SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
+ CPPUNIT_ASSERT(pTextDoc);
+ SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc();
+ CPPUNIT_ASSERT_EQUAL_MESSAGE(
+ "Compatibility: collapse cell paras should not be set", false,
+ pDoc->getIDocumentSettingAccess().get(DocumentSettingId::COLLAPSE_EMPTY_CELL_PARA));
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx
index e88f90e2c621..d838a8adb8a6 100644
--- a/sw/source/filter/xml/xmlimp.cxx
+++ b/sw/source/filter/xml/xmlimp.cxx
@@ -1393,6 +1393,7 @@ void SwXMLImport::SetConfigurationSettings(const Sequence < PropertyValue > & aC
bool bPropLineSpacingShrinksFirstLine = false;
bool bSubtractFlysAnchoredAtFlys = false;
bool bDisableOffPagePositioning = false;
+ bool bCollapseEmptyCellPara = false;
const PropertyValue* currentDatabaseDataSource = nullptr;
const PropertyValue* currentDatabaseCommand = nullptr;
@@ -1487,6 +1488,8 @@ void SwXMLImport::SetConfigurationSettings(const Sequence < PropertyValue > & aC
bSubtractFlysAnchoredAtFlys = true;
else if (pValues->Name == "DisableOffPagePositioning")
bDisableOffPagePositioning = true;
+ else if (pValues->Name == "CollapseEmptyCellPara")
+ bCollapseEmptyCellPara = true;
}
catch( Exception& )
{
@@ -1650,6 +1653,9 @@ void SwXMLImport::SetConfigurationSettings(const Sequence < PropertyValue > & aC
if ( bDisableOffPagePositioning )
xProps->setPropertyValue("DisableOffPagePositioning", makeAny(true));
+ if (!bCollapseEmptyCellPara)
+ xProps->setPropertyValue("CollapseEmptyCellPara", makeAny(false));
+
SwDoc *pDoc = getDoc();
SfxPrinter *pPrinter = pDoc->getIDocumentDeviceAccess().getPrinter( false );
if( pPrinter )
More information about the Libreoffice-commits
mailing list