Kaydet (Commit) 176a7238 authored tarafından Justin Luth's avatar Justin Luth Kaydeden (comit) Miklos Vajna

tdf#112074 doc import: use real width if no preferred width

If the document did not specify a preferred table width, then
the indent was completely wrong. I don't think the "else" clause
ever provided a correct value.
See https://bz.apache.org/ooo/attachment.cgi?id=63705&action=diff

These documents don't round-trip at all, so making changes
here ought to be fairly regression-safe since the documents are
read-only anyway.

Change-Id: I6308ffd22b6f7ce60b9780e00b68bc6f8b09a6fa
Reviewed-on: https://gerrit.libreoffice.org/41664Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarJustin Luth <justin_luth@sil.org>
Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
üst c210019f
This diff was suppressed by a .gitattributes entry.
......@@ -12,6 +12,8 @@
#include <com/sun/star/graphic/XGraphic.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/container/XIndexAccess.hpp>
#include <com/sun/star/text/HoriOrientation.hpp>
#include <com/sun/star/text/WritingMode2.hpp>
#include <com/sun/star/text/XTextFramesSupplier.hpp>
#include <com/sun/star/text/XTextTable.hpp>
#include <com/sun/star/text/XTextTablesSupplier.hpp>
......@@ -194,6 +196,20 @@ DECLARE_WW8EXPORT_TEST(testTdf108448_endNote, "tdf108448_endNote.odt")
CPPUNIT_ASSERT_EQUAL_MESSAGE( "Number of paragraphs in Endnote i", 1, nRet );
}
DECLARE_WW8EXPORT_TEST(testTdf112074_RTLtableJustification, "tdf112074_RTLtableJustification.doc")
{
uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY);
uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY);
uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Right To Left writing mode", text::WritingMode2::RL_TB, getProperty<sal_Int16>(xTable, "WritingMode"));
if ( !mbExported )
{
CPPUNIT_ASSERT_EQUAL_MESSAGE("Horizontal Orientation", text::HoriOrientation::LEFT_AND_WIDTH, getProperty<sal_Int16>(xTable, "HoriOrient"));
CPPUNIT_ASSERT_MESSAGE("Table Indent", getProperty<long>(xTable, "LeftMargin") > 3000);
}
}
DECLARE_WW8EXPORT_TEST(testTdf104805, "tdf104805.doc")
{
uno::Reference<beans::XPropertySet> xPropertySet(getStyles("NumberingStyles")->getByName("WW8Num1"), uno::UNO_QUERY);
......
......@@ -2583,13 +2583,9 @@ void WW8TabDesc::CreateSwTable()
nLeft = GetMinLeft();
else
{
if (m_nPreferredWidth)
{
nLeft = m_pIo->m_aSectionManager.GetTextAreaWidth();
nLeft = nLeft - m_nPreferredWidth - m_nOrgDxaLeft;
}
else
nLeft = -GetMinLeft();
const short nTableWidth = m_nPreferredWidth ? m_nPreferredWidth : m_nSwWidth;
nLeft = m_pIo->m_aSectionManager.GetTextAreaWidth();
nLeft = nLeft - nTableWidth - m_nOrgDxaLeft;
}
aL.SetLeft(nLeft);
......
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