summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--editeng/source/items/paraitem.cxx2
-rw-r--r--include/editeng/lspcitem.hxx4
-rw-r--r--sw/qa/extras/ooxmlexport/data/test_line_spacing.docxbin0 -> 9997 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport.cxx14
4 files changed, 17 insertions, 3 deletions
diff --git a/editeng/source/items/paraitem.cxx b/editeng/source/items/paraitem.cxx
index a78912b579c4..c130771a862e 100644
--- a/editeng/source/items/paraitem.cxx
+++ b/editeng/source/items/paraitem.cxx
@@ -203,7 +203,7 @@ bool SvxLineSpacingItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
case style::LineSpacingMode::PROP:
{
eLineSpace = SVX_LINE_SPACE_AUTO;
- nPropLineSpace = (sal_Int8)std::min(aLSp.Height, (short)0xFF);
+ nPropLineSpace = (sal_Int16)aLSp.Height;
if(100 == aLSp.Height)
eInterLineSpace = SVX_INTER_LINE_SPACE_OFF;
else
diff --git a/include/editeng/lspcitem.hxx b/include/editeng/lspcitem.hxx
index 91505d5e1f99..d04e876fab04 100644
--- a/include/editeng/lspcitem.hxx
+++ b/include/editeng/lspcitem.hxx
@@ -38,7 +38,7 @@ class EDITENG_DLLPUBLIC SvxLineSpacingItem : public SfxEnumItemInterface
short nInterLineSpace;
sal_uInt16 nLineHeight;
- sal_uInt8 nPropLineSpace;
+ sal_uInt16 nPropLineSpace;
SvxLineSpace eLineSpace;
SvxInterLineSpace eInterLineSpace;
@@ -83,7 +83,7 @@ public:
}
// To increase or decrease the row height.
- sal_uInt8 GetPropLineSpace() const { return nPropLineSpace; }
+ sal_uInt16 GetPropLineSpace() const { return nPropLineSpace; }
inline void SetPropLineSpace( const sal_uInt8 nProp )
{
nPropLineSpace = nProp;
diff --git a/sw/qa/extras/ooxmlexport/data/test_line_spacing.docx b/sw/qa/extras/ooxmlexport/data/test_line_spacing.docx
new file mode 100644
index 000000000000..2f92afbb7069
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/test_line_spacing.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index d2efe7c26fd8..24d242b7c0e1 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -1704,6 +1704,20 @@ DECLARE_OOXML_TEST(testFdo70838, "fdo70838.docx")
}
}
+DECLARE_OOXML_TEST(testLineSpacingexport, "test_line_spacing.docx")
+{
+ // The Problem was that the w:line attribute value in w:spacing tag was incorrect
+ uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY);
+ uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration();
+ CPPUNIT_ASSERT(xParaEnum->hasMoreElements());
+
+ style::LineSpacing alineSpacing = getProperty<style::LineSpacing>(xParaEnum->nextElement(), "ParaLineSpacing");
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(13200), static_cast<sal_Int16>(alineSpacing.Height));
+ xmlDocPtr pXmlDoc = parseExport("word/document.xml");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:spacing", "line", "31680");
+}
+
#endif
CPPUNIT_PLUGIN_IMPLEMENT();