Kaydet (Commit) 3d9792d6 authored tarafından Miklos Vajna's avatar Miklos Vajna Kaydeden (comit) Andras Timar

tdf#89698 DOCX import: inline picture should have no spacing

Commit 3d7e168a (n#783638 DOCX import of
wp:inline's distT/B/L/R attributes, 2012-10-11) was about a picture that
had non-zero spacing in LO, but zero in Word. The hope was that the
problem is just that the value is not imported.

Then commit a88ac708 (fdo#63685
wp:inline's distT/B/L/R is in EMU's, not twips, 2013-04-19) was about a
picture that had so large spacing that the picture become invisible.
Fixing the unit of the spacing value made the picture visible again.

What was missed is that this value is just stored in the doc model, but
layout in Word doesn't use it at all till the anchoring is as-char.
Given that in LO as-char anchoring supports real spacing, just don't
import these values to have the same layout. That's what the WW8 import
does, too.

Change-Id: I1244269e06c5d190e8340349ddc12ae7b0572a4d
(cherry picked from commit 9781a878)
üst a119f03f
...@@ -1380,8 +1380,8 @@ DECLARE_OOXMLIMPORT_TEST(testConditionalstylesTablelook, "conditionalstyles-tbll ...@@ -1380,8 +1380,8 @@ DECLARE_OOXMLIMPORT_TEST(testConditionalstylesTablelook, "conditionalstyles-tbll
DECLARE_OOXMLIMPORT_TEST(testFdo63685, "fdo63685.docx") DECLARE_OOXMLIMPORT_TEST(testFdo63685, "fdo63685.docx")
{ {
// Was 85697, i.e. original 114120 was converted to mm100 from twips, not from EMUs. // An inline image's wrapping should be always zero, even if the doc model has a non-zero value.
CPPUNIT_ASSERT_EQUAL(sal_Int32(318), getProperty<sal_Int32>(getShape(1), "TopMargin")); CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(getShape(1), "TopMargin"));
} }
DECLARE_OOXMLIMPORT_TEST(testN592908_Frame, "n592908-frame.docx") DECLARE_OOXMLIMPORT_TEST(testN592908_Frame, "n592908-frame.docx")
......
...@@ -870,16 +870,16 @@ void GraphicImport::lcl_attribute(Id nName, Value& rValue) ...@@ -870,16 +870,16 @@ void GraphicImport::lcl_attribute(Id nName, Value& rValue)
} }
break; break;
case NS_ooxml::LN_CT_Inline_distT: case NS_ooxml::LN_CT_Inline_distT:
m_pImpl->nTopMargin = oox::drawingml::convertEmuToHmm(nIntValue); m_pImpl->nTopMargin = 0;
break; break;
case NS_ooxml::LN_CT_Inline_distB: case NS_ooxml::LN_CT_Inline_distB:
m_pImpl->nBottomMargin = oox::drawingml::convertEmuToHmm(nIntValue); m_pImpl->nBottomMargin = 0;
break; break;
case NS_ooxml::LN_CT_Inline_distL: case NS_ooxml::LN_CT_Inline_distL:
m_pImpl->nLeftMargin = oox::drawingml::convertEmuToHmm(nIntValue); m_pImpl->nLeftMargin = 0;
break; break;
case NS_ooxml::LN_CT_Inline_distR: case NS_ooxml::LN_CT_Inline_distR:
m_pImpl->nRightMargin = oox::drawingml::convertEmuToHmm(nIntValue); m_pImpl->nRightMargin = 0;
break; break;
case NS_ooxml::LN_CT_GraphicalObjectData_uri: case NS_ooxml::LN_CT_GraphicalObjectData_uri:
rValue.getString(); rValue.getString();
......
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