From 854d7a1cc77b82ef6b5d72a7889743c1ebe6fe6e Mon Sep 17 00:00:00 2001 From: sushil_shinde Date: Thu, 2 Jan 2014 16:31:26 +0530 Subject: fdo#73217 : Textbox with picture fill are rendered and saved properly. - Bitmap url was not stored propertly for textframes. - Exported background image fill for text box properly. - Added unit test. Conflicts: sw/qa/extras/ooxmlexport/ooxmlexport.cxx Reviewed on: https://gerrit.libreoffice.org/7259 Change-Id: I1fbab24b2a83b22be04fd6950c80ddf274436738 --- sw/source/filter/ww8/docxattributeoutput.cxx | 41 +++++++++++++++++++++------- 1 file changed, 31 insertions(+), 10 deletions(-) (limited to 'sw/source') diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index d1d617edde0f..0aa7e3601155 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -5716,16 +5716,29 @@ void DocxAttributeOutput::FormatBackground( const SvxBrushItem& rBrush ) } else if (m_bDMLTextFrameSyntax) { - m_pSerializer->startElementNS(XML_a, XML_solidFill, FSEND); - m_pSerializer->startElementNS(XML_a, XML_srgbClr, - XML_val, sColor, - FSEND); - if (oAlpha) - m_pSerializer->singleElementNS(XML_a, XML_alpha, - XML_val, OString::number(*oAlpha), - FSEND); - m_pSerializer->endElementNS(XML_a, XML_srgbClr); - m_pSerializer->endElementNS(XML_a, XML_solidFill); + bool bImageBackground = false; + const SfxPoolItem* pItem = GetExport().HasItem(RES_FILL_STYLE); + if (pItem) + { + const XFillStyleItem* pFillStyle = static_cast(pItem); + if(pFillStyle->GetValue() == XFILL_BITMAP) + { + bImageBackground = true; + } + } + if (!bImageBackground) + { + m_pSerializer->startElementNS(XML_a, XML_solidFill, FSEND); + m_pSerializer->startElementNS(XML_a, XML_srgbClr, + XML_val, sColor, + FSEND); + if (oAlpha) + m_pSerializer->singleElementNS(XML_a, XML_alpha, + XML_val, OString::number(*oAlpha), + FSEND); + m_pSerializer->endElementNS(XML_a, XML_srgbClr); + m_pSerializer->endElementNS(XML_a, XML_solidFill); + } } else if ( !m_rExport.bOutPageDescs ) { @@ -5823,6 +5836,14 @@ void DocxAttributeOutput::FormatBox( const SvxBoxItem& rBox ) { const XFillStyleItem* pFillStyle = static_cast(pItem); FormatFillStyle(*pFillStyle); + if (m_oFillStyle && *m_oFillStyle == XFILL_BITMAP) + { + const SdrObject* pSdrObj = m_rExport.mpParentFrame->GetFrmFmt().FindRealSdrObject(); + uno::Reference< drawing::XShape > xShape( ((SdrObject*)pSdrObj)->getUnoShape(), uno::UNO_QUERY ); + uno::Reference< beans::XPropertySet > xPropertySet( xShape, uno::UNO_QUERY ); + m_rDrawingML.SetFS(m_pSerializer); + m_rDrawingML.WriteBlipFill( xPropertySet, "BackGraphicURL" ); + } } pItem = GetExport().HasItem(RES_FILL_GRADIENT); -- cgit