Kaydet (Commit) 610d98bd authored tarafından Justin Luth's avatar Justin Luth

tdf#97648 ooxmlimport: horizontal line's horiOrient

Although LO won't visually do anything with this property
(because o:hr is improperly imported AS_CHAR), at least
import and assign the property so that it is there for
the future if o:hr is changed from AS_CHAR to AT_*.

The unit test just adds a test for the existing status - to
highlight what still needs to be fixed.

o:hr probably ought to be AT_CHAR, with no wrapping. However,
simply doing that wraps text the wrong way (always underneath)
which seems to be a LO limitation of not putting preceeding
chars above an AT_CHAR fly. So that's why I'm not implementing
a change to AT_CHAR.

Change-Id: I4aec99d3976c6d461715dba304cdf9ad98ab12b6
Reviewed-on: https://gerrit.libreoffice.org/42440Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarJustin Luth <justin_luth@sil.org>
üst aeab2384
......@@ -310,6 +310,8 @@ ShapeTypeContext::ShapeTypeContext(ContextHandler2Helper const & rParent,
mrTypeModel.maWidthPercent = OUString::number( hrpct.toInt32() );
mrTypeModel.maWrapDistanceLeft = "0";
mrTypeModel.maWrapDistanceRight = "0";
mrTypeModel.maPositionHorizontal = rAttribs.getString( O_TOKEN( hralign ), "left" );
mrTypeModel.moWrapType = "topAndBottom";
}
// stroke settings (may be overridden by v:stroke element later)
......
......@@ -30,6 +30,7 @@
#include <com/sun/star/view/XSelectionSupplier.hpp>
#include <com/sun/star/style/LineSpacing.hpp>
#include <com/sun/star/style/LineSpacingMode.hpp>
#include <com/sun/star/style/ParagraphAdjust.hpp>
#include <com/sun/star/drawing/XControlShape.hpp>
#include <ftninfo.hxx>
......@@ -231,9 +232,19 @@ DECLARE_OOXMLEXPORT_TEST(testTdf97648_relativeWidth,"tdf97648_relativeWidth.docx
CPPUNIT_ASSERT_DOUBLES_EQUAL( sal_Int32(7616), getShape(1)->getSize().Width, 10);
CPPUNIT_ASSERT_DOUBLES_EQUAL( sal_Int32(8001), getShape(2)->getSize().Width, 10);
CPPUNIT_ASSERT_DOUBLES_EQUAL( sal_Int32(4001), getShape(3)->getSize().Width, 10);
CPPUNIT_ASSERT_EQUAL( style::ParagraphAdjust_LEFT, static_cast<style::ParagraphAdjust>(getProperty<sal_Int16>(getParagraph(6), "ParaAdjust")) );
CPPUNIT_ASSERT_DOUBLES_EQUAL( sal_Int32(1600), getShape(4)->getSize().Width, 10);
CPPUNIT_ASSERT_EQUAL( style::ParagraphAdjust_RIGHT, static_cast<style::ParagraphAdjust>(getProperty<sal_Int16>(getParagraph(8), "ParaAdjust")) );
CPPUNIT_ASSERT_EQUAL( sal_Int32(0), getProperty<sal_Int32>(getShape(1), "LeftMargin") );
if (!mbExported)
{
CPPUNIT_ASSERT_EQUAL_MESSAGE("Text should wrap above/below the line", text::WrapTextMode_NONE, getProperty<text::WrapTextMode>(getShape(1), "Surround"));
CPPUNIT_ASSERT_EQUAL(text::HoriOrientation::CENTER, getProperty<sal_Int16>(getShape(2), "HoriOrient"));
CPPUNIT_ASSERT_EQUAL(text::HoriOrientation::RIGHT, getProperty<sal_Int16>(getShape(3), "HoriOrient"));
CPPUNIT_ASSERT_EQUAL(text::HoriOrientation::LEFT, getProperty<sal_Int16>(getShape(4), "HoriOrient"));
}
}
DECLARE_OOXMLEXPORT_TEST(testTdf104061_tableSectionColumns,"tdf104061_tableSectionColumns.docx")
......
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