diff options
-rw-r--r-- | sw/source/filter/html/htmlgrin.cxx | 10 | ||||
-rw-r--r-- | vcl/inc/impgraph.hxx | 3 | ||||
-rw-r--r-- | vcl/source/gdi/graph.cxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/impgraph.cxx | 14 |
4 files changed, 18 insertions, 11 deletions
diff --git a/sw/source/filter/html/htmlgrin.cxx b/sw/source/filter/html/htmlgrin.cxx index cb25a316277f..0a9050f3475a 100644 --- a/sw/source/filter/html/htmlgrin.cxx +++ b/sw/source/filter/html/htmlgrin.cxx @@ -482,18 +482,8 @@ IMAGE_SETEVENT: { GraphicFilter& rFilter = GraphicFilter::GetGraphicFilter(); aGraphic = rFilter.ImportUnloadedGraphic(*pStream); - if (aGraphic) - { sGrfNm.clear(); - if (!bHeightProvided || !bWidthProvided) - { - Size aPrefSize = aGraphic.GetPrefSize(); - nWidth = aPrefSize.getWidth(); - nHeight = aPrefSize.getHeight(); - } - } - if (!sGrfNm.isEmpty()) { if (ERRCODE_NONE == rFilter.ImportGraphic(aGraphic, "", *pStream)) diff --git a/vcl/inc/impgraph.hxx b/vcl/inc/impgraph.hxx index 660fdfce81cd..cff173b9a3fb 100644 --- a/vcl/inc/impgraph.hxx +++ b/vcl/inc/impgraph.hxx @@ -27,6 +27,7 @@ struct ImpSwapInfo { MapMode maPrefMapMode; Size maPrefSize; + Size maSizePixel; bool mbIsAnimated; bool mbIsEPS; @@ -155,6 +156,8 @@ private: Animation ImplGetAnimation() const; const GDIMetaFile& ImplGetGDIMetaFile() const; + Size ImplGetSizePixel() const; + Size ImplGetPrefSize() const; void ImplSetPrefSize( const Size& rPrefSize ); diff --git a/vcl/source/gdi/graph.cxx b/vcl/source/gdi/graph.cxx index 9ba35ddd7366..2533a75e47c4 100644 --- a/vcl/source/gdi/graph.cxx +++ b/vcl/source/gdi/graph.cxx @@ -438,7 +438,7 @@ Size Graphic::GetSizePixel( const OutputDevice* pRefDevice ) const Size aRet; if( GraphicType::Bitmap == mxImpGraphic->ImplGetType() ) - aRet = mxImpGraphic->ImplGetBitmapEx(GraphicConversionParameters()).GetSizePixel(); + aRet = mxImpGraphic->ImplGetSizePixel(); else aRet = ( pRefDevice ? pRefDevice : Application::GetDefaultDevice() )->LogicToPixel( GetPrefSize(), GetPrefMapMode() ); diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx index 1a9cca6ce0da..2b263bcab354 100644 --- a/vcl/source/gdi/impgraph.cxx +++ b/vcl/source/gdi/impgraph.cxx @@ -537,6 +537,8 @@ void ImpGraphic::ImplSetPrepared() maSwapInfo.maPrefSize = aDescriptor.GetSizePixel(); maSwapInfo.maPrefMapMode = MapMode(MapUnit::MapPixel); } + + maSwapInfo.maSizePixel = aDescriptor.GetSizePixel(); } maSwapInfo.mnAnimationLoopCount = 0; maSwapInfo.mbIsAnimated = false; @@ -868,6 +870,18 @@ const GDIMetaFile& ImpGraphic::ImplGetGDIMetaFile() const return maMetaFile; } +Size ImpGraphic::ImplGetSizePixel() const +{ + Size aSize; + + if (ImplIsSwapOut()) + aSize = maSwapInfo.maSizePixel; + else + aSize = ImplGetBitmapEx(GraphicConversionParameters()).GetSizePixel(); + + return aSize; +} + Size ImpGraphic::ImplGetPrefSize() const { Size aSize; |