diff options
author | Matúš Kukan <matus.kukan@collabora.com> | 2014-09-17 21:36:02 +0200 |
---|---|---|
committer | Matúš Kukan <matus.kukan@collabora.com> | 2014-09-18 15:37:16 +0200 |
commit | 72703173066a2db5c977d422ace59d60b998bbfc (patch) | |
tree | 7dc57b78d01250773eed2cdc6495f79aa4dbfd93 | |
parent | 6503be5311716cf520cf534ca1bb0fd595b93d72 (diff) |
HTML import: fix importing of inlined images (related: fdo#50763)
Regression from 3914a711060341345f15b83656457f90095f32d6
Change-Id: I0523d2b07dc33c74caa711cf7aae274c935f8eed
-rw-r--r-- | sw/source/filter/html/htmlgrin.cxx | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/sw/source/filter/html/htmlgrin.cxx b/sw/source/filter/html/htmlgrin.cxx index 5a0805682832..f4e1e4421410 100644 --- a/sw/source/filter/html/htmlgrin.cxx +++ b/sw/source/filter/html/htmlgrin.cxx @@ -694,21 +694,30 @@ IMAGE_SETEVENT: aFrmSize.SetHeightPercent( nPrcHeight ); aFrmSet.Put( aFrmSize ); - Graphic aEmptyGrf; + Graphic aGraphic; INetURLObject aGraphicURL( sGrfNm ); - if (aGraphicURL.GetProtocol() == INET_PROT_DATA || - aGraphicURL.GetProtocol() == INET_PROT_FILE) + if( aGraphicURL.GetProtocol() == INET_PROT_DATA ) { - if (GRFILTER_OK == GraphicFilter::GetGraphicFilter().ImportGraphic(aEmptyGrf, aGraphicURL)) + SvMemoryStream* aStream = aGraphicURL.getData(); + if( aStream ) + { + if (GRFILTER_OK == GraphicFilter::GetGraphicFilter().ImportGraphic(aGraphic, "", *aStream)) + sGrfNm = ""; + free( aStream ); + } + } + else if (aGraphicURL.GetProtocol() == INET_PROT_FILE) + { + if (GRFILTER_OK == GraphicFilter::GetGraphicFilter().ImportGraphic(aGraphic, aGraphicURL)) sGrfNm = ""; } if (!sGrfNm.isEmpty()) { - aEmptyGrf.SetDefaultType(); + aGraphic.SetDefaultType(); } // passing empty sGrfNm here, means we don't want the graphic to be linked - SwFrmFmt *pFlyFmt = pDoc->getIDocumentContentOperations().Insert( *pPam, sGrfNm, aEmptyOUStr, &aEmptyGrf, + SwFrmFmt *pFlyFmt = pDoc->getIDocumentContentOperations().Insert( *pPam, sGrfNm, aEmptyOUStr, &aGraphic, &aFrmSet, NULL, NULL ); SwGrfNode *pGrfNd = pDoc->GetNodes()[ pFlyFmt->GetCntnt().GetCntntIdx() ->GetIndex()+1 ]->GetGrfNode(); |