DocxAttributeOutput::FlyFrameGraphic: avoid <a:ln> when there is no border

Change-Id: Ia94f490c0ad8c392bd8bbfbe889f5333c13e0022
This commit is contained in:
Miklos Vajna
2014-12-10 17:06:28 +01:00
parent a645c82894
commit dbbfad3dfb
3 changed files with 28 additions and 15 deletions

Binary file not shown.

View File

@@ -721,6 +721,12 @@ DECLARE_OOXMLEXPORT_TEST(testTblpprShape, "tblppr-shape.docx")
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2540), getProperty<sal_Int32>(xPageStyle, "LeftMargin"));
}
DECLARE_OOXMLEXPORT_TEST(testImageNoborder, "image-noborder.docx")
{
// This was 26; we exported border for an image that had no border.
CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt32>(0), getProperty<table::BorderLine2>(getShape(1), "TopBorder").LineWidth);
}
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@@ -4215,21 +4215,28 @@ void DocxAttributeOutput::FlyFrameGraphic( const SwGrfNode* pGrfNode, const Size
m_pSerializer->singleElementNS( XML_a, XML_avLst,
FSEND );
m_pSerializer->endElementNS( XML_a, XML_prstGeom );
m_pSerializer->singleElementNS( XML_a, XML_noFill,
FSEND );
m_pSerializer->startElementNS( XML_a, XML_ln,
XML_w, "9525",
FSEND );
m_pSerializer->singleElementNS( XML_a, XML_noFill,
FSEND );
m_pSerializer->singleElementNS( XML_a, XML_miter,
XML_lim, "800000",
FSEND );
m_pSerializer->singleElementNS( XML_a, XML_headEnd,
FSEND );
m_pSerializer->singleElementNS( XML_a, XML_tailEnd,
FSEND );
m_pSerializer->endElementNS( XML_a, XML_ln );
const SvxBoxItem& rBoxItem = pFrmFmt->GetBox();
const SvxBorderLine* pLeft = rBoxItem.GetLine(BOX_LINE_LEFT);
const SvxBorderLine* pRight = rBoxItem.GetLine(BOX_LINE_RIGHT);
const SvxBorderLine* pTop = rBoxItem.GetLine(BOX_LINE_TOP);
const SvxBorderLine* pBottom = rBoxItem.GetLine(BOX_LINE_BOTTOM);
if (pLeft || pRight || pTop || pBottom)
{
m_pSerializer->startElementNS( XML_a, XML_ln,
XML_w, "9525",
FSEND );
m_pSerializer->singleElementNS( XML_a, XML_noFill,
FSEND );
m_pSerializer->singleElementNS( XML_a, XML_miter,
XML_lim, "800000",
FSEND );
m_pSerializer->singleElementNS( XML_a, XML_headEnd,
FSEND );
m_pSerializer->singleElementNS( XML_a, XML_tailEnd,
FSEND );
m_pSerializer->endElementNS( XML_a, XML_ln );
}
m_rExport.SdrExporter().writeDMLEffectLst(*pFrmFmt);