tdf#117413 char doubling in calc under X

f41
Caolán McNamara 7 years ago
parent f13cc9a33f
commit d562fa262c

@ -0,0 +1,85 @@
From ba30f47d00850edbbfd157b664d5af97697d7a4a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
Date: Fri, 4 May 2018 17:15:37 +0100
Subject: [PATCH] Resolves: tdf#117413 char doubling appearing under X with
gtk3
like happened on gtk2, so make the rhbz#1283420 bodge happen for XLIB surfaces,
regardless of the backend
Change-Id: Ic51679a71523e8cc76832858411b102d915638cf
---
vcl/unx/generic/gdi/cairotextrender.cxx | 22 +++++++++++++++++++++-
vcl/unx/generic/gdi/x11cairotextrender.cxx | 16 +---------------
2 files changed, 22 insertions(+), 16 deletions(-)
diff --git a/vcl/unx/generic/gdi/cairotextrender.cxx b/vcl/unx/generic/gdi/cairotextrender.cxx
index 00532c8644b9..10edfd0e5001 100644
--- a/vcl/unx/generic/gdi/cairotextrender.cxx
+++ b/vcl/unx/generic/gdi/cairotextrender.cxx
@@ -151,6 +151,26 @@ namespace
}
}
+namespace
+{
+ cairo_t* syncCairoContext(cairo_t* cr)
+ {
+ //rhbz#1283420 tdf#117413 bodge to force a read from the underlying surface which has
+ //the side effect of making the mysterious xrender related problem go away
+ cairo_surface_t *target = cairo_get_target(cr);
+ if (cairo_surface_get_type(target) == CAIRO_SURFACE_TYPE_XLIB)
+ {
+ cairo_surface_t *throw_away = cairo_surface_create_similar(target, cairo_surface_get_content(target), 1, 1);
+ cairo_t *force_read_cr = cairo_create(throw_away);
+ cairo_set_source_surface(force_read_cr, target, 0, 0);
+ cairo_paint(force_read_cr);
+ cairo_destroy(force_read_cr);
+ cairo_surface_destroy(throw_away);
+ }
+ return cr;
+ }
+}
+
void CairoTextRender::DrawTextLayout(const CommonSalLayout& rLayout)
{
const FreetypeFont& rFont = *rLayout.getFreetypeFont();
@@ -191,7 +211,7 @@ void CairoTextRender::DrawTextLayout(const CommonSalLayout& rLayout)
* least change the SalFrame etc impls to dtor the SalGraphics *before* the
* destruction of the windows they reference
*/
- cairo_t *cr = getCairoContext();
+ cairo_t *cr = syncCairoContext(getCairoContext());
if (!cr)
{
SAL_WARN("vcl", "no cairo context for text");
diff --git a/vcl/unx/generic/gdi/x11cairotextrender.cxx b/vcl/unx/generic/gdi/x11cairotextrender.cxx
index 105d0a0392bd..8960bd1c6bb1 100644
--- a/vcl/unx/generic/gdi/x11cairotextrender.cxx
+++ b/vcl/unx/generic/gdi/x11cairotextrender.cxx
@@ -36,21 +36,7 @@ GlyphCache& X11CairoTextRender::getPlatformGlyphCache()
cairo_t* X11CairoTextRender::getCairoContext()
{
- cairo_t *cr = mrParent.getCairoContext();
-
- //rhbz#1283420 bodge to force a read from the underlying surface which has
- //the side effect of making the mysterious xrender related problem go away
- {
- cairo_surface_t *target = cairo_get_target(cr);
- cairo_surface_t *throw_away = cairo_surface_create_similar(target, cairo_surface_get_content(target), 1, 1);
- cairo_t *force_read_cr = cairo_create(throw_away);
- cairo_set_source_surface(force_read_cr, target, 0, 0);
- cairo_paint(force_read_cr);
- cairo_destroy(force_read_cr);
- cairo_surface_destroy(throw_away);
- }
-
- return cr;
+ return mrParent.getCairoContext();
}
void X11CairoTextRender::getSurfaceOffset( double& nDX, double& nDY )
--
2.14.3

@ -62,7 +62,7 @@ Summary: Free Software Productivity Suite
Name: libreoffice
Epoch: 1
Version: %{libo_version}.2
Release: 8%{?libo_prerelease}%{?dist}
Release: 9%{?libo_prerelease}%{?dist}
License: (MPLv1.1 or LGPLv3+) and LGPLv3 and LGPLv2+ and BSD and (MPLv1.1 or GPLv2 or LGPLv2 or Netscape) and Public Domain and ASL 2.0 and MPLv2.0 and CC0
URL: http://www.libreoffice.org/
@ -276,6 +276,7 @@ Patch8: 0001-tdf-95843-Wait-for-fire_glxtest_process-also-in-head.patch
Patch9: 0001-Related-tdf-116951-rhbz-1569331-end-should-be-in-ter.patch
Patch10: 0001-Resolves-tdf-116951-rhbz-1569331-start-is-G_MAXINT.patch
Patch11: 0001-set-Referer-on-link-mediadescriptor.patch
Patch12: 0001-Resolves-tdf-117413-char-doubling-appearing-under-X-.patch
%if 0%{?rhel}
# not upstreamed
@ -2324,6 +2325,9 @@ done
%{_includedir}/LibreOfficeKit
%changelog
* Sat May 5 2018 Caolán McNamara <caolanm@redhat.com> - 1:6.0.3.2-9
- tdf#117413 char doubling in calc under X
* Fri May 4 2018 Caolán McNamara <caolanm@redhat.com> - 1:6.0.3.2-8
- rhbz#1575000 CVE-2018-10583 allow embedded links to smb resources
to be blocked

Loading…
Cancel
Save