diff options
author | Joren De Cuyper <jorendc@libreoffice.org> | 2015-05-14 12:56:10 +0200 |
---|---|---|
committer | Joren De Cuyper <jorendc@libreoffice.org> | 2015-05-20 10:51:09 +0000 |
commit | 0db96caf0fcce09b87621c11b584a6d81cc7df86 (patch) | |
tree | d9b60047f2a1749a1db22ecef7259450bb897b28 /sw/source/filter | |
parent | fcc7ba441ec8e5116bbcc08c88b5ddb7c892c988 (diff) |
Thanks to Miklos :)
Change-Id: Ib6344ff654e39bf712d7071545573fb2ec525b63
Reviewed-on: https://gerrit.libreoffice.org/15733
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Joren De Cuyper <jorendc@libreoffice.org>
Diffstat (limited to 'sw/source/filter')
-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); } |