[Libreoffice-commits] core.git: 2 commits - oox/source vcl/opengl
Tor Lillqvist
tml at collabora.com
Tue May 10 10:24:58 UTC 2016
oox/source/drawingml/color.cxx | 4 ++--
vcl/opengl/gdiimpl.cxx | 7 +++++--
2 files changed, 7 insertions(+), 4 deletions(-)
New commits:
commit 08977ff115fca510f0152cf26ccf3df24640d8b4
Author: Tor Lillqvist <tml at collabora.com>
Date: Tue May 10 13:13:05 2016 +0300
loplugin:rangedforcopy
Loop variable passed by value, pass by reference instead.
Change-Id: I12d1cb639cbe7a5686a1854168362b85322fa2e5
diff --git a/oox/source/drawingml/color.cxx b/oox/source/drawingml/color.cxx
index 7d9b359..774541f 100644
--- a/oox/source/drawingml/color.cxx
+++ b/oox/source/drawingml/color.cxx
@@ -121,7 +121,7 @@ PresetColorsPool::PresetColorsPool() :
{XML_white, 0xFFFFFF}, {XML_whiteSmoke, 0xF5F5F5},
{XML_yellow, 0xFFFF00}, {XML_yellowGreen, 0x9ACD32}
};
- for(auto const nEntry : spnDmlColors)
+ for(auto const& nEntry : spnDmlColors)
maDmlColors[ static_cast< size_t >(nEntry.first) ] = nEntry.second;
// predefined colors in VML (map XML token identifiers to RGB values)
@@ -136,7 +136,7 @@ PresetColorsPool::PresetColorsPool() :
{XML_silver, 0xC0C0C0}, {XML_teal, 0x008080},
{XML_white, 0xFFFFFF}, {XML_yellow, 0xFFFF00}
};
- for(auto const nEntry : spnVmlColors)
+ for(auto const& nEntry : spnVmlColors)
maVmlColors[ static_cast< size_t >(nEntry.first) ] = nEntry.second;
}
commit 347e46da399b8cc96d9dd8dbfd62120db473b555
Author: Tor Lillqvist <tml at collabora.com>
Date: Tue May 10 12:50:38 2016 +0300
Check if we have an OpenGL context before using API that requires it
Avoid GL errors when glDisable() is called without a context.
Change-Id: Ie9eae498c207a82934228ad2f74b7096308f5530
diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx
index 4b67ed5..65650c0 100644
--- a/vcl/opengl/gdiimpl.cxx
+++ b/vcl/opengl/gdiimpl.cxx
@@ -2516,8 +2516,11 @@ void OpenGLSalGraphicsImpl::doFlush()
{
FlushDeferredDrawing();
- mpContext->state()->scissor().disable();
- mpContext->state()->stencil().disable();
+ if (OpenGLContext::hasCurrent())
+ {
+ mpContext->state()->scissor().disable();
+ mpContext->state()->stencil().disable();
+ }
if( IsOffscreen() )
return;
More information about the Libreoffice-commits
mailing list