diff options
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index dcce02f40a02..59027ee1c173 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -4192,13 +4192,28 @@ void DocxAttributeOutput::FlyFrameGraphic( const SwGrfNode* pGrfNode, const Size completely discarding it. */ if ( aRelId.isEmpty() ) - m_pSerializer->singleElementNS( XML_a, XML_blip, + m_pSerializer->startElementNS( XML_a, XML_blip, FSEND ); else - m_pSerializer->singleElementNS( XML_a, XML_blip, + m_pSerializer->startElementNS( XML_a, XML_blip, FSNS( XML_r, nImageType ), aRelId.getStr(), FSEND ); + pItem = 0; + sal_uInt32 nMode = GRAPHICDRAWMODE_STANDARD; + + if ( pGrfNode && SfxItemState::SET == pGrfNode->GetSwAttrSet().GetItemState(RES_GRFATR_DRAWMODE, true, &pItem)) + { + nMode = static_cast<const SfxEnumItem*>(pItem)->GetValue(); + if (nMode == GRAPHICDRAWMODE_GREYS) + m_pSerializer->singleElementNS (XML_a, XML_grayscl, FSEND); + else if (nMode == GRAPHICDRAWMODE_MONO) //black/white has a 0,5 threshold in LibreOffice + m_pSerializer->singleElementNS (XML_a, XML_biLevel, XML_thresh, OString::number(50000), FSEND); + else if (nMode == GRAPHICDRAWMODE_WATERMARK) //watermark has a brightness/luminance of 0,5 and contrast of -0.7 in LibreOffice + m_pSerializer->singleElementNS( XML_a, XML_lum, XML_bright, OString::number(50000), XML_contrast, OString::number(-70000), FSEND ); + } + m_pSerializer->endElementNS( XML_a, XML_blip ); + if (pSdrObj){ WriteSrcRect(pSdrObj); } |