[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - 2 commits - svl/source vcl/opengl
Caolán McNamara
caolanm at redhat.com
Fri Sep 15 19:19:22 UTC 2017
svl/source/numbers/zformat.cxx | 22 ++++++++++++++++++++--
vcl/opengl/win/gdiimpl.cxx | 20 +++++++++++++++++---
2 files changed, 37 insertions(+), 5 deletions(-)
New commits:
commit 45cfa386e312bf70c84fb971a9f7d541353b4809
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Sep 5 10:40:18 2017 +0100
Resolves: tdf#107730 ensure per-thread epoxy_handle_external_wglMakeCurrent
Change-Id: Idc1e2da3a02715a09b5b8f4e8e736b8806e59f8e
Reviewed-on: https://gerrit.libreoffice.org/41927
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
Tested-by: Michael Meeks <michael.meeks at collabora.com>
(cherry picked from commit 4cc634327a752d633ea341252d8f4845157f887b)
Reviewed-on: https://gerrit.libreoffice.org/41936
Reviewed-by: Michael Stahl <mstahl at redhat.com>
Tested-by: Michael Stahl <mstahl at redhat.com>
diff --git a/vcl/opengl/win/gdiimpl.cxx b/vcl/opengl/win/gdiimpl.cxx
index 41cbda7e7165..58b3178b6c10 100644
--- a/vcl/opengl/win/gdiimpl.cxx
+++ b/vcl/opengl/win/gdiimpl.cxx
@@ -8,6 +8,7 @@
*/
#include <memory>
+#include <thread>
#include "opengl/win/gdiimpl.hxx"
#include <comphelper/windowserrorstring.hxx>
@@ -75,11 +76,24 @@ void WinOpenGLContext::resetCurrent()
g_bAnyCurrent = false;
}
+thread_local bool bEpoxyDispatchMakeCurrentCalled = false;
+
+void ensureDispatchTable()
+{
+ if (!bEpoxyDispatchMakeCurrentCalled)
+ {
+ epoxy_handle_external_wglMakeCurrent();
+ bEpoxyDispatchMakeCurrentCalled = true;
+ }
+}
+
bool WinOpenGLContext::isCurrent()
{
OpenGLZone aZone;
- return g_bAnyCurrent && m_aGLWin.hRC && wglGetCurrentContext() == m_aGLWin.hRC &&
- wglGetCurrentDC() == m_aGLWin.hDC;
+ if (!g_bAnyCurrent || !m_aGLWin.hRC)
+ return false;
+ ensureDispatchTable();
+ return wglGetCurrentContext() == m_aGLWin.hRC && wglGetCurrentDC() == m_aGLWin.hDC;
}
bool WinOpenGLContext::isAnyCurrent()
@@ -96,7 +110,7 @@ void WinOpenGLContext::makeCurrent()
clearCurrent();
- epoxy_handle_external_wglMakeCurrent();
+ ensureDispatchTable();
if (!wglMakeCurrent(m_aGLWin.hDC, m_aGLWin.hRC))
{
commit 8a398429cd7b8369af360def49989623176cd233
Author: Eike Rathke <erack at redhat.com>
Date: Mon Sep 4 11:18:49 2017 +0200
Resolves: tdf#52510 handle trailing ';' specifying empty following subformat
Change-Id: Ic84065f11619542fe735f45e72c9303897ea5755
(cherry picked from commit 8cb3faca4b1d1d9c68faba103c6c6117853e639e)
Reviewed-on: https://gerrit.libreoffice.org/41878
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index 734af6294825..361fe5c40571 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -1189,8 +1189,26 @@ SvNumberformat::SvNumberformat(OUString& rString,
}
if (sBuff.getLength() == nPos)
{
- if ( nIndex == 2 && eSymbolType == BRACKET_SYMBOLTYPE_FORMAT &&
- sBuff[nPos - 1] == ';' )
+ if (nIndex < 3 && rString[rString.getLength()-1] == ';')
+ {
+ // A trailing ';' is significant and specifies the following
+ // subformat to be empty. We don't enter the scanning loop
+ // above again though.
+ // Note that the operators apply to the current last scanned
+ // subformat.
+ if (nIndex == 0 && eOp1 == NUMBERFORMAT_OP_NO)
+ {
+ eOp1 = NUMBERFORMAT_OP_GT; // undefined condition, default: > 0
+ }
+ else if (nIndex == 1 && eOp2 == NUMBERFORMAT_OP_NO)
+ {
+ eOp2 = NUMBERFORMAT_OP_LT; // undefined condition, default: < 0
+ }
+ NumFor[nIndex+1].Info().eScannedType = css::util::NumberFormat::EMPTY;
+ if (sBuff[nPos-1] != ';')
+ sBuff.insert( nPos++, ';');
+ }
+ if (nIndex == 2 && eSymbolType == BRACKET_SYMBOLTYPE_FORMAT && sBuff[nPos-1] == ';')
{
// #83510# A 4th subformat explicitly specified to be empty
// hides any text. Need the type here for HasTextFormat()
More information about the Libreoffice-commits
mailing list