parent
ffd22cd81c
commit
f15cf6739b
@ -1,29 +0,0 @@
|
||||
From 08232c1eababe3c12c94eb1eb272bd363693450e Mon Sep 17 00:00:00 2001
|
||||
From: Stephan Bergmann <sbergman@redhat.com>
|
||||
Date: Wed, 9 May 2018 12:15:09 +0200
|
||||
Subject: [PATCH] Missing template clone() in configmgr dconf mode
|
||||
|
||||
...that could cause infinite recursion, e.g. when an erroneously modified
|
||||
/org.openoffice.ucb.Hierarchy/Entry template (which recursively has children of
|
||||
the same template type) is later used to instantiate a new set member.
|
||||
|
||||
Change-Id: I7b9e55fa1c92979aed98b9f23f4432600afffed4
|
||||
---
|
||||
configmgr/source/dconf.cxx | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/configmgr/source/dconf.cxx b/configmgr/source/dconf.cxx
|
||||
index 22c80841addf..642e37ec0257 100644
|
||||
--- a/configmgr/source/dconf.cxx
|
||||
+++ b/configmgr/source/dconf.cxx
|
||||
@@ -938,6 +938,7 @@ void readDir(
|
||||
<< templ);
|
||||
continue;
|
||||
}
|
||||
+ member = member->clone(true);
|
||||
break;
|
||||
default:
|
||||
assert(false); // cannot happen
|
||||
--
|
||||
2.14.3
|
||||
|
@ -1,241 +0,0 @@
|
||||
From f770a69457b5e0432b396d5d1bd62cdc9db8e1ed Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
|
||||
Date: Wed, 11 Apr 2018 11:06:37 +0100
|
||||
Subject: [PATCH] Related: rhbz#1396729 use cairo_surface_create_similar
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
where we can
|
||||
|
||||
Change-Id: If6fd729a9cbf834faef33586b5bd886aad2fbe1d
|
||||
Reviewed-on: https://gerrit.libreoffice.org/52726
|
||||
Tested-by: Jenkins <ci@libreoffice.org>
|
||||
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
|
||||
Tested-by: Caolán McNamara <caolanm@redhat.com>
|
||||
(cherry picked from commit b524de950c6eb0bc61d05d41fe69b67ab59b16c6)
|
||||
|
||||
cairo_surface_create_similar_image is >= cairo 1.12.0
|
||||
|
||||
(cherry picked from commit 2ca4b505b25e13c9f422c28252f5b7533b8e3270)
|
||||
|
||||
Change-Id: I1805e5680beff6c632016686aa661efe25a8c2f8
|
||||
---
|
||||
vcl/headless/svpgdi.cxx | 20 ++++++++++++++++----
|
||||
vcl/headless/svpinst.cxx | 6 ++++--
|
||||
vcl/headless/svpvd.cxx | 40 ++++++++++++++++++++++++++--------------
|
||||
vcl/inc/headless/svpgdi.hxx | 1 +
|
||||
vcl/inc/headless/svpvd.hxx | 9 ++-------
|
||||
vcl/qt5/Qt5Instance.cxx | 8 +++++---
|
||||
vcl/unx/gtk/gtkinst.cxx | 2 +-
|
||||
7 files changed, 55 insertions(+), 31 deletions(-)
|
||||
|
||||
diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx
|
||||
index 67433a2b30e1..b490121750db 100644
|
||||
--- a/vcl/headless/svpgdi.cxx
|
||||
+++ b/vcl/headless/svpgdi.cxx
|
||||
@@ -1239,7 +1239,13 @@ SalBitmap* SvpSalGraphics::getBitmap( long nX, long nY, long nWidth, long nHeigh
|
||||
|
||||
SalColor SvpSalGraphics::getPixel( long nX, long nY )
|
||||
{
|
||||
- cairo_surface_t *target = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, 1, 1);
|
||||
+#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 12, 0)
|
||||
+ cairo_surface_t *target = cairo_surface_create_similar_image(m_pSurface,
|
||||
+#else
|
||||
+ cairo_surface_t *target = cairo_image_surface_create(
|
||||
+#endif
|
||||
+ CAIRO_FORMAT_ARGB32, 1, 1);
|
||||
+
|
||||
cairo_t* cr = cairo_create(target);
|
||||
|
||||
cairo_rectangle(cr, 0, 0, 1, 1);
|
||||
@@ -1398,9 +1404,15 @@ cairo_surface_t* SvpSalGraphics::createCairoSurface(const BitmapBuffer *pBuffer)
|
||||
|
||||
cairo_t* SvpSalGraphics::createTmpCompatibleCairoContext() const
|
||||
{
|
||||
- cairo_surface_t *target = cairo_image_surface_create(CAIRO_FORMAT_ARGB32,
|
||||
- m_aFrameSize.getX() * m_fScale,
|
||||
- m_aFrameSize.getY() * m_fScale);
|
||||
+#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 12, 0)
|
||||
+ cairo_surface_t *target = cairo_surface_create_similar_image(m_pSurface,
|
||||
+#else
|
||||
+ cairo_surface_t *target = cairo_image_surface_create(
|
||||
+#endif
|
||||
+ CAIRO_FORMAT_ARGB32,
|
||||
+ m_aFrameSize.getX() * m_fScale,
|
||||
+ m_aFrameSize.getY() * m_fScale);
|
||||
+
|
||||
#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 14, 0)
|
||||
cairo_surface_set_device_scale(target, m_fScale, m_fScale);
|
||||
#endif
|
||||
diff --git a/vcl/headless/svpinst.cxx b/vcl/headless/svpinst.cxx
|
||||
index 9912186c729c..c39ffaeb5205 100644
|
||||
--- a/vcl/headless/svpinst.cxx
|
||||
+++ b/vcl/headless/svpinst.cxx
|
||||
@@ -219,12 +219,14 @@ void SvpSalInstance::DestroyObject( SalObject* pObject )
|
||||
|
||||
#ifndef IOS
|
||||
|
||||
-SalVirtualDevice* SvpSalInstance::CreateVirtualDevice( SalGraphics* /* pGraphics */,
|
||||
+SalVirtualDevice* SvpSalInstance::CreateVirtualDevice( SalGraphics* pGraphics,
|
||||
long &nDX, long &nDY,
|
||||
DeviceFormat eFormat,
|
||||
const SystemGraphicsData* /* pData */ )
|
||||
{
|
||||
- SvpSalVirtualDevice* pNew = new SvpSalVirtualDevice(eFormat, 1);
|
||||
+ SvpSalGraphics *pSvpSalGraphics = dynamic_cast<SvpSalGraphics*>(pGraphics);
|
||||
+ assert(pSvpSalGraphics);
|
||||
+ SvpSalVirtualDevice* pNew = new SvpSalVirtualDevice(eFormat, pSvpSalGraphics->getSurface());
|
||||
pNew->SetSize( nDX, nDY );
|
||||
return pNew;
|
||||
}
|
||||
diff --git a/vcl/headless/svpvd.cxx b/vcl/headless/svpvd.cxx
|
||||
index cf78ebc8eb7d..4172fc383744 100644
|
||||
--- a/vcl/headless/svpvd.cxx
|
||||
+++ b/vcl/headless/svpvd.cxx
|
||||
@@ -30,9 +30,18 @@
|
||||
|
||||
using namespace basegfx;
|
||||
|
||||
+SvpSalVirtualDevice::SvpSalVirtualDevice(DeviceFormat eFormat, cairo_surface_t* pRefSurface)
|
||||
+ : m_eFormat(eFormat)
|
||||
+ , m_pRefSurface(pRefSurface)
|
||||
+ , m_pSurface(nullptr)
|
||||
+{
|
||||
+ cairo_surface_reference(m_pRefSurface);
|
||||
+}
|
||||
+
|
||||
SvpSalVirtualDevice::~SvpSalVirtualDevice()
|
||||
{
|
||||
cairo_surface_destroy(m_pSurface);
|
||||
+ cairo_surface_destroy(m_pRefSurface);
|
||||
}
|
||||
|
||||
SalGraphics* SvpSalVirtualDevice::AcquireGraphics()
|
||||
@@ -67,9 +76,6 @@ bool SvpSalVirtualDevice::SetSizeUsingBuffer( long nNewDX, long nNewDY,
|
||||
{
|
||||
m_aFrameSize = basegfx::B2IVector(nNewDX, nNewDY);
|
||||
|
||||
- nNewDX *= m_fScale;
|
||||
- nNewDY *= m_fScale;
|
||||
-
|
||||
if (m_pSurface)
|
||||
{
|
||||
cairo_surface_destroy(m_pSurface);
|
||||
@@ -77,23 +83,29 @@ bool SvpSalVirtualDevice::SetSizeUsingBuffer( long nNewDX, long nNewDY,
|
||||
|
||||
if (m_eFormat == DeviceFormat::BITMASK)
|
||||
{
|
||||
- m_pSurface = cairo_image_surface_create(CAIRO_FORMAT_A1,
|
||||
+ m_pSurface = cairo_surface_create_similar(m_pRefSurface, CAIRO_CONTENT_ALPHA,
|
||||
nNewDX, nNewDY);
|
||||
}
|
||||
- else
|
||||
+ else if (pBuffer)
|
||||
{
|
||||
- m_pSurface = pBuffer ?
|
||||
- cairo_image_surface_create_for_data(pBuffer, CAIRO_FORMAT_ARGB32,
|
||||
- nNewDX, nNewDY,
|
||||
- cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32, nNewDX))
|
||||
- :
|
||||
- cairo_image_surface_create(CAIRO_FORMAT_ARGB32,
|
||||
- nNewDX, nNewDY);
|
||||
- }
|
||||
+#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 14, 0)
|
||||
+ double fXScale, fYScale;
|
||||
+ cairo_surface_get_device_scale(m_pRefSurface, &fXScale, &fYScale);
|
||||
+ nNewDX *= fXScale;
|
||||
+ nNewDY *= fYScale;
|
||||
+#endif
|
||||
+
|
||||
+ m_pSurface = cairo_image_surface_create_for_data(pBuffer, CAIRO_FORMAT_ARGB32,
|
||||
+ nNewDX, nNewDY, cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32, nNewDX));
|
||||
|
||||
#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 14, 0)
|
||||
- cairo_surface_set_device_scale(m_pSurface, m_fScale, m_fScale);
|
||||
+ cairo_surface_set_device_scale(m_pSurface, fXScale, fYScale);
|
||||
#endif
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ m_pSurface = cairo_surface_create_similar(m_pRefSurface, CAIRO_CONTENT_COLOR_ALPHA, nNewDX, nNewDY);
|
||||
+ }
|
||||
|
||||
// update device in existing graphics
|
||||
for (auto const& graphic : m_aGraphics)
|
||||
diff --git a/vcl/inc/headless/svpgdi.hxx b/vcl/inc/headless/svpgdi.hxx
|
||||
index 8204538cb132..dae0145b8c58 100644
|
||||
--- a/vcl/inc/headless/svpgdi.hxx
|
||||
+++ b/vcl/inc/headless/svpgdi.hxx
|
||||
@@ -89,6 +89,7 @@ class VCL_DLLPUBLIC SvpSalGraphics : public SalGraphics
|
||||
public:
|
||||
static GlyphCache& getPlatformGlyphCache();
|
||||
void setSurface(cairo_surface_t* pSurface, const basegfx::B2IVector& rSize);
|
||||
+ cairo_surface_t* getSurface() const { return m_pSurface; }
|
||||
static cairo_user_data_key_t* getDamageKey();
|
||||
|
||||
private:
|
||||
diff --git a/vcl/inc/headless/svpvd.hxx b/vcl/inc/headless/svpvd.hxx
|
||||
index 704488cdfae0..51d6af9cb499 100644
|
||||
--- a/vcl/inc/headless/svpvd.hxx
|
||||
+++ b/vcl/inc/headless/svpvd.hxx
|
||||
@@ -30,18 +30,13 @@ typedef struct _cairo_surface cairo_surface_t;
|
||||
class VCL_DLLPUBLIC SvpSalVirtualDevice : public SalVirtualDevice
|
||||
{
|
||||
DeviceFormat m_eFormat;
|
||||
+ cairo_surface_t* m_pRefSurface;
|
||||
cairo_surface_t* m_pSurface;
|
||||
basegfx::B2IVector m_aFrameSize;
|
||||
- double m_fScale;
|
||||
std::vector< SvpSalGraphics* > m_aGraphics;
|
||||
|
||||
public:
|
||||
- SvpSalVirtualDevice(DeviceFormat eFormat, double fScale)
|
||||
- : m_eFormat(eFormat)
|
||||
- , m_pSurface(nullptr)
|
||||
- , m_fScale(fScale)
|
||||
- {
|
||||
- }
|
||||
+ SvpSalVirtualDevice(DeviceFormat eFormat, cairo_surface_t* pRefSurface);
|
||||
virtual ~SvpSalVirtualDevice() override;
|
||||
|
||||
// SalVirtualDevice
|
||||
diff --git a/vcl/qt5/Qt5Instance.cxx b/vcl/qt5/Qt5Instance.cxx
|
||||
index c61a29a01935..0d128c2bc97c 100644
|
||||
--- a/vcl/qt5/Qt5Instance.cxx
|
||||
+++ b/vcl/qt5/Qt5Instance.cxx
|
||||
@@ -84,13 +84,15 @@ SalObject* Qt5Instance::CreateObject(SalFrame* pParent, SystemWindowData*, bool
|
||||
|
||||
void Qt5Instance::DestroyObject(SalObject* pObject) { delete pObject; }
|
||||
|
||||
-SalVirtualDevice* Qt5Instance::CreateVirtualDevice(SalGraphics* /* pGraphics */, long& nDX,
|
||||
- long& nDY, DeviceFormat eFormat,
|
||||
+SalVirtualDevice* Qt5Instance::CreateVirtualDevice(SalGraphics* pGraphics, long& nDX, long& nDY,
|
||||
+ DeviceFormat eFormat,
|
||||
const SystemGraphicsData* /* pData */)
|
||||
{
|
||||
if (m_bUseCairo)
|
||||
{
|
||||
- SvpSalVirtualDevice* pVD = new SvpSalVirtualDevice(eFormat, 1);
|
||||
+ SvpSalGraphics* pSvpSalGraphics = dynamic_cast<SvpSalGraphics*>(pGraphics);
|
||||
+ assert(pSvpSalGraphics);
|
||||
+ SvpSalVirtualDevice* pVD = new SvpSalVirtualDevice(eFormat, pSvpSalGraphics->getSurface());
|
||||
pVD->SetSize(nDX, nDY);
|
||||
return pVD;
|
||||
}
|
||||
diff --git a/vcl/unx/gtk/gtkinst.cxx b/vcl/unx/gtk/gtkinst.cxx
|
||||
index 62b02a36a33f..ee03a340a12f 100644
|
||||
--- a/vcl/unx/gtk/gtkinst.cxx
|
||||
+++ b/vcl/unx/gtk/gtkinst.cxx
|
||||
@@ -336,7 +336,7 @@ SalVirtualDevice* GtkInstance::CreateVirtualDevice( SalGraphics *pG,
|
||||
(void) pGd;
|
||||
SvpSalGraphics *pSvpSalGraphics = dynamic_cast<SvpSalGraphics*>(pG);
|
||||
assert(pSvpSalGraphics);
|
||||
- SvpSalVirtualDevice* pNew = new SvpSalVirtualDevice(eFormat, pSvpSalGraphics->getScale());
|
||||
+ SvpSalVirtualDevice* pNew = new SvpSalVirtualDevice(eFormat, pSvpSalGraphics->getSurface());
|
||||
pNew->SetSize( nDX, nDY );
|
||||
return pNew;
|
||||
#else
|
||||
--
|
||||
2.14.3
|
||||
|
@ -1,43 +0,0 @@
|
||||
From cff779551db2eedf5b16d49213fc5e2179414256 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
|
||||
Date: Thu, 19 Apr 2018 20:12:40 +0100
|
||||
Subject: [PATCH] Related: tdf#116951 rhbz#1569331 end should be in terms of
|
||||
unicode chars
|
||||
|
||||
not bytes
|
||||
|
||||
Change-Id: I05114019abb6c283586cd5c23ed1d148c9cf71d3
|
||||
---
|
||||
vcl/unx/gtk/gtksalframe.cxx | 2 +-
|
||||
vcl/unx/gtk3/gtk3gtkframe.cxx | 2 +-
|
||||
2 files changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/vcl/unx/gtk/gtksalframe.cxx b/vcl/unx/gtk/gtksalframe.cxx
|
||||
index 9fd86abccc3d..ad4b00d26927 100644
|
||||
--- a/vcl/unx/gtk/gtksalframe.cxx
|
||||
+++ b/vcl/unx/gtk/gtksalframe.cxx
|
||||
@@ -3560,7 +3560,7 @@ void GtkSalFrame::IMHandler::signalIMPreeditChanged( GtkIMContext*, gpointer im_
|
||||
|
||||
pango_attr_iterator_range (iter, &start, &end);
|
||||
if (end == G_MAXINT)
|
||||
- end = pText ? strlen (pText) : 0;
|
||||
+ end = pText ? g_utf8_strlen(pText, -1) : 0;
|
||||
if (end == start)
|
||||
continue;
|
||||
|
||||
diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx
|
||||
index 1db3a469973f..113fcb425963 100644
|
||||
--- a/vcl/unx/gtk3/gtk3gtkframe.cxx
|
||||
+++ b/vcl/unx/gtk3/gtk3gtkframe.cxx
|
||||
@@ -3978,7 +3978,7 @@ void GtkSalFrame::IMHandler::signalIMPreeditChanged( GtkIMContext*, gpointer im_
|
||||
|
||||
pango_attr_iterator_range (iter, &start, &end);
|
||||
if (end == G_MAXINT)
|
||||
- end = pText ? strlen (pText) : 0;
|
||||
+ end = pText ? g_utf8_strlen(pText, -1) : 0;
|
||||
if (end == start)
|
||||
continue;
|
||||
|
||||
--
|
||||
2.14.3
|
||||
|
@ -1,85 +0,0 @@
|
||||
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
|
||||
|
@ -1,48 +0,0 @@
|
||||
From cd25a97bbadc0a5c1fd6b0e8603c8b6ebd051926 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
|
||||
Date: Tue, 1 May 2018 12:57:02 +0100
|
||||
Subject: [PATCH] set Referer on link mediadescriptor
|
||||
|
||||
to allow determining if the source document is from a trusted/untrusted
|
||||
location
|
||||
|
||||
Change-Id: I780568652d2ef0cc8543c27ba26289277b5d9d0c
|
||||
Reviewed-on: https://gerrit.libreoffice.org/53693
|
||||
Tested-by: Jenkins <ci@libreoffice.org>
|
||||
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
|
||||
---
|
||||
sw/source/filter/xml/xmltexti.cxx | 11 ++++++++---
|
||||
1 file changed, 8 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/sw/source/filter/xml/xmltexti.cxx b/sw/source/filter/xml/xmltexti.cxx
|
||||
index 78cab08507f0..33548de42f6c 100644
|
||||
--- a/sw/source/filter/xml/xmltexti.cxx
|
||||
+++ b/sw/source/filter/xml/xmltexti.cxx
|
||||
@@ -570,16 +570,21 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertOOoLink(
|
||||
uno::Sequence< beans::PropertyValue > aMediaDescriptor( 1 );
|
||||
aMediaDescriptor[0].Name = "URL";
|
||||
aMediaDescriptor[0].Value <<= aURLObj.GetMainURL( INetURLObject::DecodeMechanism::NONE );
|
||||
- if ( pDoc->GetDocShell() && pDoc->GetDocShell()->GetMedium() )
|
||||
+
|
||||
+ if (SfxMedium* pMedium = pDoc->GetDocShell() ? pDoc->GetDocShell()->GetMedium() : nullptr)
|
||||
{
|
||||
- uno::Reference< task::XInteractionHandler > xInteraction =
|
||||
- pDoc->GetDocShell()->GetMedium()->GetInteractionHandler();
|
||||
+ uno::Reference< task::XInteractionHandler > xInteraction = pMedium->GetInteractionHandler();
|
||||
if ( xInteraction.is() )
|
||||
{
|
||||
aMediaDescriptor.realloc( 2 );
|
||||
aMediaDescriptor[1].Name = "InteractionHandler";
|
||||
aMediaDescriptor[1].Value <<= xInteraction;
|
||||
}
|
||||
+
|
||||
+ const auto nLen = aMediaDescriptor.getLength() + 1;
|
||||
+ aMediaDescriptor.realloc(nLen);
|
||||
+ aMediaDescriptor[nLen - 1].Name = "Referer";
|
||||
+ aMediaDescriptor[nLen - 1].Value <<= pMedium->GetName();
|
||||
}
|
||||
|
||||
uno::Reference < embed::XEmbeddedObject > xObj(
|
||||
--
|
||||
2.14.3
|
||||
|
@ -1,80 +0,0 @@
|
||||
From 47b299c7de49edd3bddd743d6d9bdcf49a09ec39 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
|
||||
Date: Fri, 25 May 2018 14:37:03 +0100
|
||||
Subject: [PATCH] tdf#117601 a11y crash after merging cells
|
||||
|
||||
this is similar to tdf#87199, in this case the accessibiles for the merged
|
||||
cells are not visible so not removed when their frame is deleted, but remain
|
||||
in the cache pointing to invalid frames.
|
||||
|
||||
Change-Id: Ibc5b9f27541683b8f3604839fa3d1431380a4039
|
||||
---
|
||||
sw/inc/accmap.hxx | 3 +++
|
||||
sw/source/core/access/acccontext.cxx | 6 +++++-
|
||||
sw/source/core/access/accmap.cxx | 11 ++++++++---
|
||||
3 files changed, 16 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/sw/inc/accmap.hxx b/sw/inc/accmap.hxx
|
||||
index fc7f665da383..c78bea3e0e51 100644
|
||||
--- a/sw/inc/accmap.hxx
|
||||
+++ b/sw/inc/accmap.hxx
|
||||
@@ -277,6 +277,9 @@ public:
|
||||
Point PixelToCore (const Point& rPoint) const;
|
||||
tools::Rectangle CoreToPixel (const tools::Rectangle& rRect) const;
|
||||
|
||||
+ // is there a known accessibility impl cached for the frame
|
||||
+ bool Contains(const SwFrame *pFrame) const;
|
||||
+
|
||||
private:
|
||||
/** get mapping mode for LogicToPixel and PixelToLogic conversions
|
||||
|
||||
diff --git a/sw/source/core/access/acccontext.cxx b/sw/source/core/access/acccontext.cxx
|
||||
index 628ad727dc47..efb6b415d372 100644
|
||||
--- a/sw/source/core/access/acccontext.cxx
|
||||
+++ b/sw/source/core/access/acccontext.cxx
|
||||
@@ -402,8 +402,12 @@ void SwAccessibleContext::DisposeChildren(const SwFrame *pFrame,
|
||||
if( pLower )
|
||||
{
|
||||
::rtl::Reference< SwAccessibleContext > xAccImpl;
|
||||
- if( rLower.IsAccessible( GetShell()->IsPreview() ) )
|
||||
+ if (rLower.IsAccessible(GetShell()->IsPreview())
|
||||
+ // tdf#117601 dispose the darn thing if it ever was accessible
|
||||
+ || GetMap()->Contains(pLower))
|
||||
+ {
|
||||
xAccImpl = GetMap()->GetContextImpl( pLower, false );
|
||||
+ }
|
||||
if( xAccImpl.is() )
|
||||
xAccImpl->Dispose( bRecursive );
|
||||
else
|
||||
diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx
|
||||
index 712b70873507..43cc0974625e 100644
|
||||
--- a/sw/source/core/access/accmap.cxx
|
||||
+++ b/sw/source/core/access/accmap.cxx
|
||||
@@ -2158,6 +2158,11 @@ void SwAccessibleMap::RemoveContext( const SdrObject *pObj )
|
||||
}
|
||||
}
|
||||
|
||||
+bool SwAccessibleMap::Contains(const SwFrame *pFrame) const
|
||||
+{
|
||||
+ return (pFrame && mpFrameMap && mpFrameMap->find(pFrame) != mpFrameMap->end());
|
||||
+}
|
||||
+
|
||||
void SwAccessibleMap::A11yDispose( const SwFrame *pFrame,
|
||||
const SdrObject *pObj,
|
||||
vcl::Window* pWindow,
|
||||
@@ -2173,9 +2178,9 @@ void SwAccessibleMap::A11yDispose( const SwFrame *pFrame,
|
||||
OSL_ENSURE( !aFrameOrObj.GetSwFrame() || aFrameOrObj.GetSwFrame()->IsAccessibleFrame(),
|
||||
"non accessible frame should be disposed" );
|
||||
|
||||
- if (aFrameOrObj.IsAccessible( GetShell()->IsPreview() )
|
||||
- // fdo#87199 dispose the darn thing if it ever was accessible
|
||||
- || (pFrame && mpFrameMap && mpFrameMap->find(pFrame) != mpFrameMap->end()))
|
||||
+ if (aFrameOrObj.IsAccessible(GetShell()->IsPreview())
|
||||
+ // fdo#87199 dispose the darn thing if it ever was accessible
|
||||
+ || Contains(pFrame))
|
||||
{
|
||||
::rtl::Reference< SwAccessibleContext > xAccImpl;
|
||||
::rtl::Reference< SwAccessibleContext > xParentAccImpl;
|
||||
--
|
||||
2.14.3
|
||||
|
@ -1,126 +0,0 @@
|
||||
From 1b3cf7e967aa103181a3203f5d504d49b49a5ab2 Mon Sep 17 00:00:00 2001
|
||||
From: Stephan Bergmann <sbergman@redhat.com>
|
||||
Date: Thu, 19 Apr 2018 13:59:16 +0200
|
||||
Subject: [PATCH] tdf#95843: Wait for fire_glxtest_process also in --headless
|
||||
mode
|
||||
|
||||
Discussed with mmeeks on IRC that fire_glxtest_process is probably called as
|
||||
early as possible so that its reuslt is ready by the time it is needed in the
|
||||
non-headless case. So best fix for headless is probably to just wait for the
|
||||
sub-process at an opportune point, instead of redesigning the whole mess so that
|
||||
fire_glxtest_process would only be called once its result is actually needed.
|
||||
|
||||
Change-Id: I4ea9c9d54b83c9695a3b72317e68fed0c410da0e
|
||||
Reviewed-on: https://gerrit.libreoffice.org/53154
|
||||
Tested-by: Jenkins <ci@libreoffice.org>
|
||||
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
|
||||
(cherry picked from commit 4bacf58f4af44ac8c4632b43289ccfcc07e5820c)
|
||||
---
|
||||
desktop/inc/app.hxx | 1 +
|
||||
desktop/source/app/app.cxx | 9 +++++++++
|
||||
desktop/source/app/sofficemain.cxx | 4 ++++
|
||||
vcl/inc/opengl/x11/glxtest.hxx | 2 ++
|
||||
vcl/unx/glxtest.cxx | 16 ++++++++++++++++
|
||||
5 files changed, 32 insertions(+)
|
||||
|
||||
diff --git a/desktop/inc/app.hxx b/desktop/inc/app.hxx
|
||||
index 0e5f8774d3c3..d0ef2a66818a 100644
|
||||
--- a/desktop/inc/app.hxx
|
||||
+++ b/desktop/inc/app.hxx
|
||||
@@ -181,6 +181,7 @@ OUString ReplaceStringHookProc(const OUString& rStr);
|
||||
|
||||
#if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID && !defined LIBO_HEADLESS
|
||||
bool fire_glxtest_process();
|
||||
+void reap_glxtest_process();
|
||||
#endif
|
||||
|
||||
#endif // INCLUDED_DESKTOP_INC_APP_HXX
|
||||
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
|
||||
index 192793ea42f1..583ea189165f 100644
|
||||
--- a/desktop/source/app/app.cxx
|
||||
+++ b/desktop/source/app/app.cxx
|
||||
@@ -1595,6 +1595,15 @@ int Desktop::Main()
|
||||
CheckOpenCLCompute(xDesktop);
|
||||
#endif
|
||||
|
||||
+ // In headless mode, reap the process started by fire_glxtest_process() early in soffice_main
|
||||
+ // (desktop/source/app/sofficemain.cxx), in a code block that needs to be covered by the same
|
||||
+ // #if condition as this code block:
|
||||
+#if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID && !defined(LIBO_HEADLESS) && HAVE_FEATURE_OPENGL
|
||||
+ if (rCmdLineArgs.IsHeadless()) {
|
||||
+ reap_glxtest_process();
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
// Release solar mutex just before we wait for our client to connect
|
||||
{
|
||||
SolarMutexReleaser aReleaser;
|
||||
diff --git a/desktop/source/app/sofficemain.cxx b/desktop/source/app/sofficemain.cxx
|
||||
index 657614962489..67c1efe4a799 100644
|
||||
--- a/desktop/source/app/sofficemain.cxx
|
||||
+++ b/desktop/source/app/sofficemain.cxx
|
||||
@@ -122,6 +122,10 @@ extern "C" int DESKTOP_DLLPUBLIC soffice_main()
|
||||
#if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID && !defined(LIBO_HEADLESS) && HAVE_FEATURE_OPENGL
|
||||
/* Run test for OpenGL support in own process to avoid crash with broken
|
||||
* OpenGL drivers. Start process as early as possible.
|
||||
+ * In non-headless mode, the process will be reaped in X11OpenGLDeviceInfo::GetData
|
||||
+ * (vcl/opengl/x11/X11DeviceInfo.cxx). In headless mode, the process will be reaped late in
|
||||
+ * Desktop::Main (desktop/source/app/app.cxx), in a code block that needs to be covered by the
|
||||
+ * same #if condition as this code block.
|
||||
*/
|
||||
bool bSuccess = fire_glxtest_process();
|
||||
SAL_WARN_IF(!bSuccess, "desktop.opengl", "problems with glxtest");
|
||||
diff --git a/vcl/inc/opengl/x11/glxtest.hxx b/vcl/inc/opengl/x11/glxtest.hxx
|
||||
index 979f795de139..d74436aae111 100644
|
||||
--- a/vcl/inc/opengl/x11/glxtest.hxx
|
||||
+++ b/vcl/inc/opengl/x11/glxtest.hxx
|
||||
@@ -18,6 +18,8 @@ VCL_DLLPUBLIC pid_t* getGlxPid();
|
||||
|
||||
bool fire_glxtest_process();
|
||||
|
||||
+void reap_glxtest_process();
|
||||
+
|
||||
#endif
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||
diff --git a/vcl/unx/glxtest.cxx b/vcl/unx/glxtest.cxx
|
||||
index b0cdde234c2b..70d34fb7318d 100644
|
||||
--- a/vcl/unx/glxtest.cxx
|
||||
+++ b/vcl/unx/glxtest.cxx
|
||||
@@ -27,6 +27,8 @@
|
||||
#include <string.h>
|
||||
#include <signal.h>
|
||||
|
||||
+#include <sys/wait.h>
|
||||
+
|
||||
#include <opengl/x11/glxtest.hxx>
|
||||
|
||||
#ifdef __SUNPRO_CC
|
||||
@@ -36,6 +38,8 @@
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
|
||||
+#include <sal/log.hxx>
|
||||
+
|
||||
// stuff from glx.h
|
||||
typedef struct __GLXcontextRec *GLXContext;
|
||||
typedef XID GLXPixmap;
|
||||
@@ -275,3 +279,15 @@ bool fire_glxtest_process()
|
||||
*glxtest_pid = pid;
|
||||
return true;
|
||||
}
|
||||
+
|
||||
+void reap_glxtest_process() {
|
||||
+ pid_t * pid = getGlxPid();
|
||||
+ if (*pid != 0) {
|
||||
+ // Use WNOHANG, as it is probably better to have a (rather harmless) zombie child process
|
||||
+ // hanging around for the duration of the calling process, than to potentially block the
|
||||
+ // calling process here:
|
||||
+ pid_t e = waitpid(*pid, nullptr, WNOHANG);
|
||||
+ SAL_INFO_IF(
|
||||
+ e <= 0, "vcl.opengl", "waiting for glxtest process " << *pid << " failed with " << e);
|
||||
+ }
|
||||
+}
|
||||
--
|
||||
2.14.3
|
||||
|
Loading…
Reference in new issue