[Libreoffice-commits] core.git: sw/qa writerfilter/source
Miklos Vajna
vmiklos at collabora.co.uk
Tue Dec 1 00:25:32 PST 2015
sw/qa/extras/ooxmlimport/data/tdf94043.docx |binary
sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 8 ++++++++
writerfilter/source/dmapper/PropertyMap.cxx | 12 +++++++++---
3 files changed, 17 insertions(+), 3 deletions(-)
New commits:
commit be6a428c08467ec379b58c8908580a282f9a9d01
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Tue Dec 1 09:24:15 2015 +0100
Related: tdf#94043 DOCX import: fix column separator handling
See wwSectionManager::SetCols() for the DOC import equivalent of this
code, if line width is 0, then there will be still no visible line.
Change-Id: Ifb0dc596e252a60cdac575fff2894aced1580c69
diff --git a/sw/qa/extras/ooxmlimport/data/tdf94043.docx b/sw/qa/extras/ooxmlimport/data/tdf94043.docx
new file mode 100644
index 0000000..fa47be0
Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/tdf94043.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index ef59606..e19d1ba 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -2989,6 +2989,14 @@ DECLARE_OOXMLIMPORT_TEST(testTdf95970, "tdf95970.docx")
CPPUNIT_ASSERT(basegfx::fTools::equal(aTransform.Line3.Column3, 1.0));
}
+DECLARE_OOXMLIMPORT_TEST(testTdf94043, "tdf94043.docx")
+{
+ auto xTextSection = getProperty< uno::Reference<beans::XPropertySet> >(getParagraph(2), "TextSection");
+ auto xTextColumns = getProperty< uno::Reference<text::XTextColumns> >(xTextSection, "TextColumns");
+ // This was 0, the separator line was not visible due to 0 width.
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2), getProperty<sal_Int32>(xTextColumns, "SeparatorLineWidth"));
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx
index ac02e62..90c4da3 100644
--- a/writerfilter/source/dmapper/PropertyMap.cxx
+++ b/writerfilter/source/dmapper/PropertyMap.cxx
@@ -41,6 +41,7 @@
#include <com/sun/star/text/XText.hpp>
#include <com/sun/star/text/TextGridMode.hpp>
#include <com/sun/star/text/XTextCopy.hpp>
+#include <com/sun/star/style/VerticalAlignment.hpp>
#include <comphelper/sequence.hxx>
#include <comphelper/propertyvalue.hxx>
#include "PropertyMapHelper.hxx"
@@ -743,9 +744,14 @@ uno::Reference< text::XTextColumns > SectionPropertyMap::ApplyColumnProperties(
}
if(m_bSeparatorLineIsOn)
- xColumnPropSet->setPropertyValue(
- getPropertyName( PROP_SEPARATOR_LINE_IS_ON ),
- uno::makeAny( m_bSeparatorLineIsOn ));
+ {
+ xColumnPropSet->setPropertyValue("SeparatorLineIsOn", uno::makeAny(true));
+ xColumnPropSet->setPropertyValue("SeparatorLineVerticalAlignment", uno::makeAny(style::VerticalAlignment_TOP));
+ xColumnPropSet->setPropertyValue("SeparatorLineRelativeHeight", uno::makeAny(static_cast<sal_Int8>(100)));
+ xColumnPropSet->setPropertyValue("SeparatorLineColor", uno::makeAny(static_cast<sal_Int32>(COL_BLACK)));
+ // 1 twip -> 2 mm100.
+ xColumnPropSet->setPropertyValue("SeparatorLineWidth", uno::makeAny(static_cast<sal_Int32>(2)));
+ }
xColumnContainer->setPropertyValue( sTextColumns, uno::makeAny( xColumns ) );
// Set the columns to be unbalanced if that compatibility option is set or this is the last section.
if (rDM_Impl.GetSettingsTable()->GetNoColumnBalance() || rDM_Impl.GetIsLastSectionGroup())
More information about the Libreoffice-commits
mailing list