diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2012-06-11 11:03:42 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2012-06-11 11:05:25 +0200 |
commit | 993eb829f357e64b3042caf1227828ae00fd125f (patch) | |
tree | e186574778fd22127414c1a9a730691441b1fe4b /writerfilter | |
parent | fa414fcf975b8eb572ce3679a0b91e2e16ca7f2e (diff) |
RTFDocumentImpl::resolvePict: handle failure from importGraphicObject()
This fixes an assert from the fdo#49659 bugdoc.
Change-Id: I4c4d56aa119dcdb965a0b30ca137d7e7d719259c
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.cxx | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 3acbddc96f54..b2a69622863e 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -635,12 +635,15 @@ int RTFDocumentImpl::resolvePict(bool bInline) // provided by picw and pich. OString aURLBS(OUStringToOString(aGraphicUrl, RTL_TEXTENCODING_UTF8)); const char aURLBegin[] = "vnd.sun.star.GraphicObject:"; - Graphic aGraphic = GraphicObject(aURLBS.copy(RTL_CONSTASCII_LENGTH(aURLBegin))).GetTransformedGraphic(); - Size aSize(aGraphic.GetPrefSize()); - MapMode aMap(MAP_100TH_MM); - aSize = Application::GetDefaultDevice()->PixelToLogic( aSize, aMap ); - m_aStates.top().aPicture.nWidth = aSize.Width(); - m_aStates.top().aPicture.nHeight = aSize.Height(); + if (aURLBS.compareTo(aURLBegin, RTL_CONSTASCII_LENGTH(aURLBegin)) == 0) + { + Graphic aGraphic = GraphicObject(aURLBS.copy(RTL_CONSTASCII_LENGTH(aURLBegin))).GetTransformedGraphic(); + Size aSize(aGraphic.GetPrefSize()); + MapMode aMap(MAP_100TH_MM); + aSize = Application::GetDefaultDevice()->PixelToLogic( aSize, aMap ); + m_aStates.top().aPicture.nWidth = aSize.Width(); + m_aStates.top().aPicture.nHeight = aSize.Height(); + } } // Wrap it in an XShape. |