Kaydet (Commit) 0d2da0ac authored tarafından Samuel Mehrbrodt's avatar Samuel Mehrbrodt

tdf#123829 Respect CollapseEmptyCellPara setting when reading odf docs

Commit 56b2cf0c 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: 's avatarSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
üst 3061ca82
......@@ -23,6 +23,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>
......@@ -916,5 +917,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: */
......@@ -1392,6 +1392,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;
......@@ -1489,6 +1490,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& )
{
......@@ -1660,6 +1663,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 )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment