diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2021-06-04 14:02:52 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2021-06-04 14:54:45 +0200 |
commit | 26d2b19d4e9388072b8dae574efdf00d7f7a0f2f (patch) | |
tree | 15f52f1275de376a98386b9ded7d787d211aba40 /drawinglayer | |
parent | 4839b7ca3b5a730edf90ebebc749db145efec098 (diff) |
sw HTML export: fix pixel size of shapes
- the twips logic size was set, but it was consumed as mm100 logic size,
so the pixel size was about half of the correct one
- the HTML export didn't write a logic size ("CSS pixels size") for
shapes
Change-Id: I37f6b4acde9d1298fae81f9975e9db95485631ee
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116691
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'drawinglayer')
-rw-r--r-- | drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx b/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx index 2f750e73af65..63b4ffd6986d 100644 --- a/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx +++ b/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx @@ -34,6 +34,7 @@ #include <drawinglayer/primitive2d/transformprimitive2d.hxx> #include <drawinglayer/converters.hxx> +#include <comphelper/sequenceashashmap.hxx> using namespace ::com::sun::star; @@ -81,6 +82,16 @@ namespace drawinglayer::unorenderer const css::geometry::RealRectangle2D& Range, ::sal_uInt32 MaximumQuadraticPixels) { + o3tl::Length eRangeUnit = o3tl::Length::mm100; + comphelper::SequenceAsHashMap aViewInformationMap(aViewInformationSequence); + auto it = aViewInformationMap.find("RangeUnit"); + if (it != aViewInformationMap.end()) + { + sal_Int32 nVal{}; + it->second >>= nVal; + eRangeUnit = static_cast<o3tl::Length>(nVal); + } + uno::Reference< rendering::XBitmap > XBitmap; if(aPrimitive2DSequence.hasElements()) @@ -107,9 +118,8 @@ namespace drawinglayer::unorenderer } const geometry::ViewInformation2D aViewInformation2D(aViewInformationSequence); - const double fFactor100th_mmToInch(1.0 / (2.54 * 1000.0)); - const sal_uInt32 nDiscreteWidth(basegfx::fround((fWidth * fFactor100th_mmToInch) * DPI_X)); - const sal_uInt32 nDiscreteHeight(basegfx::fround((fHeight * fFactor100th_mmToInch) * DPI_Y)); + const sal_uInt32 nDiscreteWidth(basegfx::fround(o3tl::convert(fWidth, eRangeUnit, o3tl::Length::in) * DPI_X)); + const sal_uInt32 nDiscreteHeight(basegfx::fround(o3tl::convert(fHeight, eRangeUnit, o3tl::Length::in) * DPI_Y)); basegfx::B2DHomMatrix aEmbedding( basegfx::utils::createTranslateB2DHomMatrix( |