diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.com> | 2014-04-08 17:50:04 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2014-04-08 18:11:53 +0200 |
commit | 930f669be1100bfa1447f60cc379d51d18224dff (patch) | |
tree | 6071ea2286436e02c2d7cd601bb51b50c7348f63 | |
parent | 55e39c72d6ac462b201dc0ae0ab0c610a0f13056 (diff) |
liblo: Return early everywhere where we potentially export images.
To avoid searching the node(s).
Change-Id: I1ddf962113ead192435c174ff3bf607596e4bfc3
-rw-r--r-- | sw/source/filter/html/htmlflywriter.cxx | 12 | ||||
-rw-r--r-- | sw/source/filter/html/htmlplug.cxx | 19 |
2 files changed, 20 insertions, 11 deletions
diff --git a/sw/source/filter/html/htmlflywriter.cxx b/sw/source/filter/html/htmlflywriter.cxx index 6060530aaff0..e7d5c4d8022c 100644 --- a/sw/source/filter/html/htmlflywriter.cxx +++ b/sw/source/filter/html/htmlflywriter.cxx @@ -809,7 +809,7 @@ Writer& OutHTML_Image( Writer& rWrt, const SwFrmFmt &rFrmFmt, const sal_Char *pMarkType, const ImageMap *pAltImgMap ) { - SwHTMLWriter & rHTMLWrt = (SwHTMLWriter&)rWrt; + SwHTMLWriter &rHTMLWrt = static_cast<SwHTMLWriter&>(rWrt); if (rHTMLWrt.mbSkipImages) return rHTMLWrt; @@ -1439,6 +1439,11 @@ static Writer& OutHTML_FrmFmtAsDivOrSpan( Writer& rWrt, static Writer & OutHTML_FrmFmtAsImage( Writer& rWrt, const SwFrmFmt& rFrmFmt, sal_Bool /*bInCntnr*/ ) { + SwHTMLWriter& rHTMLWrt = static_cast<SwHTMLWriter&>(rWrt); + + if (rHTMLWrt.mbSkipImages) + return rWrt; + ImageMap aIMap; Graphic aGraphic( ((SwFrmFmt &)rFrmFmt).MakeGraphic( &aIMap ) ); Size aSz( 0, 0 ); @@ -1452,7 +1457,10 @@ static Writer & OutHTML_FrmFmtAsImage( Writer& rWrt, const SwFrmFmt& rFrmFmt, static Writer& OutHTML_FrmFmtGrfNode( Writer& rWrt, const SwFrmFmt& rFrmFmt, sal_Bool bInCntnr ) { - SwHTMLWriter& rHTMLWrt = (SwHTMLWriter&)rWrt; + SwHTMLWriter& rHTMLWrt = static_cast<SwHTMLWriter&>(rWrt); + + if (rHTMLWrt.mbSkipImages) + return rWrt; const SwFmtCntnt& rFlyCntnt = rFrmFmt.GetCntnt(); sal_uLong nStt = rFlyCntnt.GetCntntIdx()->GetIndex()+1; diff --git a/sw/source/filter/html/htmlplug.cxx b/sw/source/filter/html/htmlplug.cxx index 421239b285c1..f124b6b991a0 100644 --- a/sw/source/filter/html/htmlplug.cxx +++ b/sw/source/filter/html/htmlplug.cxx @@ -1247,7 +1247,10 @@ Writer& OutHTML_FrmFmtOLENode( Writer& rWrt, const SwFrmFmt& rFrmFmt, Writer& OutHTML_FrmFmtOLENodeGrf( Writer& rWrt, const SwFrmFmt& rFrmFmt, sal_Bool bInCntnr ) { - SwHTMLWriter& rHTMLWrt = (SwHTMLWriter&)rWrt; + SwHTMLWriter& rHTMLWrt = static_cast<SwHTMLWriter&>(rWrt); + + if (rHTMLWrt.mbSkipImages) + return rWrt; const SwFmtCntnt& rFlyCntnt = rFrmFmt.GetCntnt(); sal_uLong nStt = rFlyCntnt.GetCntntIdx()->GetIndex()+1; @@ -1257,14 +1260,12 @@ Writer& OutHTML_FrmFmtOLENodeGrf( Writer& rWrt, const SwFrmFmt& rFrmFmt, if( !pOLENd ) return rWrt; - { - Graphic aGraphic( *pOLENd->GetGraphic() ); - sal_uLong nFlags = bInCntnr ? HTML_FRMOPTS_GENIMG_CNTNR - : HTML_FRMOPTS_GENIMG; - OutHTML_Image( rWrt, rFrmFmt, aGraphic, - pOLENd->GetTitle(), pOLENd->GetTwipSize(), - nFlags, "ole" ); - } + Graphic aGraphic( *pOLENd->GetGraphic() ); + sal_uLong nFlags = bInCntnr ? HTML_FRMOPTS_GENIMG_CNTNR + : HTML_FRMOPTS_GENIMG; + OutHTML_Image( rWrt, rFrmFmt, aGraphic, + pOLENd->GetTitle(), pOLENd->GetTwipSize(), + nFlags, "ole" ); return rWrt; } |