summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorsushil_shinde <sushil.shinde@synerzip.com>2014-01-02 16:31:26 +0530
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-01-06 11:25:09 +0100
commit854d7a1cc77b82ef6b5d72a7889743c1ebe6fe6e (patch)
tree87f945dd4bf58bd4d8642c891bf48e8a373cb041 /sw/source
parent6fd47306eb393d3c99c552ffc851f4edf245f8c8 (diff)
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
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx41
1 files changed, 31 insertions, 10 deletions
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<const XFillStyleItem*>(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<const XFillStyleItem*>(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);