[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - sw/qa writerfilter/source
Justin Luth
justin_luth at sil.org
Wed Nov 30 05:50:37 UTC 2016
sw/qa/extras/ooxmlimport/data/tdf103975_notPageBreakE.docx |binary
sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 7 +++++++
writerfilter/source/dmapper/DomainMapper.cxx | 9 +++++++++
3 files changed, 16 insertions(+)
New commits:
commit 3de0128ec4e0fce998c84043a7f8f173f1f8ac96
Author: Justin Luth <justin_luth at sil.org>
Date: Mon Nov 28 21:59:22 2016 +0300
tdf#103975 docx import: don't lose column break
This round-trips terribly, but that was equally true before these patches.
Change-Id: I4ed191c77e7f519d4c013fc83ef8b866b53d0c70
Reviewed-on: https://gerrit.libreoffice.org/31326
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Justin Luth <justin_luth at sil.org>
(cherry picked from commit bbc7ed9c379019f31dc7ac234cf83ea151601465)
Reviewed-on: https://gerrit.libreoffice.org/31341
diff --git a/sw/qa/extras/ooxmlimport/data/tdf103975_notPageBreakE.docx b/sw/qa/extras/ooxmlimport/data/tdf103975_notPageBreakE.docx
new file mode 100755
index 0000000..ac3eb9f
Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/tdf103975_notPageBreakE.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 05a4904..78845fd 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -24,6 +24,7 @@
#include <com/sun/star/document/XEmbeddedObjectSupplier2.hpp>
#include <com/sun/star/drawing/PointSequenceSequence.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/style/BreakType.hpp>
#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
#include <com/sun/star/text/HoriOrientation.hpp>
#include <com/sun/star/text/RelOrientation.hpp>
@@ -129,6 +130,12 @@ DECLARE_SW_IMPORT_TEST(testMathMalformedXml, "math-malformed_xml.docx", FailTest
CPPUNIT_ASSERT(!mxComponent.is());
}
+DECLARE_OOXMLIMPORT_TEST(testTdf103975_notPageBreakE, "tdf103975_notPageBreakE.docx")
+{
+ // The problem was that the column break was getting lost.
+ CPPUNIT_ASSERT_EQUAL(style::BreakType_COLUMN_BEFORE, getProperty<style::BreakType>(getParagraph(2), "BreakType"));
+}
+
DECLARE_OOXMLIMPORT_TEST(testN751017, "n751017.docx")
{
uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY);
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index 26168b8..aa279d6 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -3258,7 +3258,16 @@ void DomainMapper::lcl_utext(const sal_uInt8 * data_, size_t len)
if (m_pImpl->isBreakDeferred(PAGE_BREAK))
pContext->Insert(PROP_BREAK_TYPE, uno::makeAny(style::BreakType_PAGE_BEFORE));
else if (m_pImpl->isBreakDeferred(COLUMN_BREAK))
+ {
+ if ( m_pImpl->GetIsFirstParagraphInSection() || !m_pImpl->IsFirstRun() )
+ {
+ mbIsSplitPara = true;
+ m_pImpl->finishParagraph( m_pImpl->GetTopContextOfType(CONTEXT_PARAGRAPH) );
+ lcl_startParagraphGroup();
+ }
+
pContext->Insert(PROP_BREAK_TYPE, uno::makeAny(style::BreakType_COLUMN_BEFORE));
+ }
m_pImpl->clearDeferredBreaks();
}
More information about the Libreoffice-commits
mailing list