[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - canvas/source vcl/win
Szymon Kłos
szymon.klos at collabora.com
Mon Sep 4 08:24:52 UTC 2017
canvas/source/directx/dx_textlayout_drawhelper.cxx | 5 ++++-
vcl/win/gdi/salvd.cxx | 4 ++--
2 files changed, 6 insertions(+), 3 deletions(-)
New commits:
commit e53c0f102cc4f0ef31a9fffb5b78fd158cf68738
Author: Szymon Kłos <szymon.klos at collabora.com>
Date: Tue Aug 1 12:34:02 2017 +0200
tdf#104252 EMF rendering, set correct VirtualDevice size
ClipRegion is bounded to device size. That resulted in missing
text in case of PDF export with EMF+ images under Windows
(with hardware acceleration).
VirtualDevice size was always equal to the screen resolution what
is not enough to draw complete PDF.
This patch modifies VirtualDevice size to match target size.
Change-Id: I762be6a6ca6fab3897b57f370fecc3f3568a58cb
Reviewed-on: https://gerrit.libreoffice.org/41390
Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>
Tested-by: Tomaž Vajngerl <quikee at gmail.com>
diff --git a/canvas/source/directx/dx_textlayout_drawhelper.cxx b/canvas/source/directx/dx_textlayout_drawhelper.cxx
index fb8e184f9cc6..7a602742b1ba 100644
--- a/canvas/source/directx/dx_textlayout_drawhelper.cxx
+++ b/canvas/source/directx/dx_textlayout_drawhelper.cxx
@@ -80,7 +80,10 @@ namespace dxcanvas
SystemGraphicsData aSystemGraphicsData;
aSystemGraphicsData.nSize = sizeof(SystemGraphicsData);
aSystemGraphicsData.hDC = reinterpret_cast< ::HDC >(hdc);
- ScopedVclPtrInstance<VirtualDevice> xVirtualDevice(&aSystemGraphicsData, Size(1, 1), DeviceFormat::DEFAULT);
+
+ Size aTargetSize(rViewState.AffineTransform.m00, rViewState.AffineTransform.m11);
+
+ ScopedVclPtrInstance<VirtualDevice> xVirtualDevice(&aSystemGraphicsData, aTargetSize, DeviceFormat::DEFAULT);
// disable font antialiasing - GDI does not handle alpha
// surfaces properly.
diff --git a/vcl/win/gdi/salvd.cxx b/vcl/win/gdi/salvd.cxx
index 65d8600f6934..191c0eb0763c 100644
--- a/vcl/win/gdi/salvd.cxx
+++ b/vcl/win/gdi/salvd.cxx
@@ -97,12 +97,12 @@ SalVirtualDevice* WinSalInstance::CreateVirtualDevice( SalGraphics* pSGraphics,
hDC = (pData->hDC) ? pData->hDC : GetDC(pData->hWnd);
hBmp = nullptr;
bOk = (hDC != nullptr);
- if (bOk)
+ if ( bOk && nDX <= 1 && nDY <= 1 )
{
nDX = GetDeviceCaps( hDC, HORZRES );
nDY = GetDeviceCaps( hDC, VERTRES );
}
- else
+ else if ( !bOk )
{
nDX = 0;
nDY = 0;
More information about the Libreoffice-commits
mailing list