diff options
author | Vasily Melenchuk <vasily.melenchuk@cib.de> | 2015-02-02 09:43:51 +0000 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-02-13 18:23:15 +0100 |
commit | 2c411e4487f24968d6a62958fec85e4e3e1fda93 (patch) | |
tree | 89774ed068920e8e8947e0447c668d0bbc643a26 /writerfilter | |
parent | d1f38b47c29ef5e2db2cabeb657668637d97e13d (diff) |
tdf#49893 partial fix for blank rentangle problem in RTF
* pib structure in rtf shape is processed always, if exists, not only
for shape #75 (picture frame): it is possible for other shapes, at
least for #1 (rectangle)
* picture inside shape gets width and height from shape: this picture
looks like pib object and should fit shape frame
Conflicts:
sw/qa/extras/rtfimport/rtfimport.cxx
Reviewed on:
https://gerrit.libreoffice.org/14396
Change-Id: I5cf2e692940c4ddd8ab8b291ef65c0cc44c45f5d
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.cxx | 6 | ||||
-rw-r--r-- | writerfilter/source/rtftok/rtfsdrimport.cxx | 14 |
2 files changed, 13 insertions, 7 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 73287ce5d151..c3f5f767171d 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -890,6 +890,12 @@ RTFError RTFDocumentImpl::resolvePict(bool const bInline, uno::Reference<drawing nXExt = (((long)m_aStates.top().aPicture.nScaleX) * (nXExt - (m_aStates.top().aPicture.nCropL + m_aStates.top().aPicture.nCropR))) / 100L; if (m_aStates.top().aPicture.nScaleY != 100) nYExt = (((long)m_aStates.top().aPicture.nScaleY) * (nYExt - (m_aStates.top().aPicture.nCropT + m_aStates.top().aPicture.nCropB))) / 100L; + if (m_aStates.top().bInShape) + { + // Picture in shape: it looks like pib picture, so we will stretch the picture to shape size (tdf#49893) + nXExt = m_aStates.top().aShape.nRight - m_aStates.top().aShape.nLeft; + nYExt = m_aStates.top().aShape.nBottom - m_aStates.top().aShape.nTop; + } auto pXExtValue = std::make_shared<RTFValue>(oox::drawingml::convertHmmToEmu(nXExt)); auto pYExtValue = std::make_shared<RTFValue>(oox::drawingml::convertHmmToEmu(nYExt)); aExtentAttributes.set(NS_ooxml::LN_CT_PositiveSize2D_cx, pXExtValue); diff --git a/writerfilter/source/rtftok/rtfsdrimport.cxx b/writerfilter/source/rtftok/rtfsdrimport.cxx index 8a03254a0375..2c278c426ffd 100644 --- a/writerfilter/source/rtftok/rtfsdrimport.cxx +++ b/writerfilter/source/rtftok/rtfsdrimport.cxx @@ -779,21 +779,21 @@ void RTFSdrImport::resolve(RTFShape& rShape, bool bClose, ShapeOrPict const shap if (m_aParents.size() && m_aParents.top().is() && !m_bTextFrame) m_aParents.top()->add(xShape); + if (bPib) + { + m_rImport.resolvePict(false, xShape); + } + if (nType == ESCHER_ShpInst_PictureFrame) // picture frame { assert(!m_bTextFrame); - if (bPib) - { - m_rImport.resolvePict(false, xShape); - } - else // ??? not sure if the early return should be removed on else? + if (!bPib) // ??? not sure if the early return should be removed on else? { m_xShape = xShape; // store it for later resolvePict call } - return; } - if (bCustom && xShape.is()) + if (bCustom && xShape.is() && !bPib) { uno::Reference<drawing::XEnhancedCustomShapeDefaulter> xDefaulter(xShape, uno::UNO_QUERY); xDefaulter->createCustomShapeDefaults(OUString::number(nType)); |