[Libreoffice-commits] core.git: Branch 'libreoffice-5-1' - vcl/source

Tomaž Vajngerl tomaz.vajngerl at collabora.com
Tue Apr 5 06:46:38 UTC 2016


 vcl/source/opengl/OpenGLHelper.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 3c02e65e4f0724225adf7cc85dc0e492ba048182
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date:   Sun Mar 6 23:54:52 2016 +0100

    opengl: fix loading shader with preamble that uses #version
    
    The preamble was inserted into a false position so the shader
    could was constructed incorrectly and would fail to compile.
    
    Change-Id: I4c51adde9014a326bbe38a5d2d17dd0047e33195
    Reviewed-on: https://gerrit.libreoffice.org/23463
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: David Tardon <dtardon at redhat.com>

diff --git a/vcl/source/opengl/OpenGLHelper.cxx b/vcl/source/opengl/OpenGLHelper.cxx
index 00341d4..8418706 100644
--- a/vcl/source/opengl/OpenGLHelper.cxx
+++ b/vcl/source/opengl/OpenGLHelper.cxx
@@ -156,8 +156,8 @@ static void addPreamble(OString& rShaderSource, const OString& rPreamble)
         if (nVersionStrEndPos == -1)
             nVersionStrEndPos = nVersionStrStartPos + 8;
 
-        OString aVersionLine = rShaderSource.copy(0, nVersionStrEndPos - nVersionStrStartPos);
-        OString aShaderBody = rShaderSource.copy(nVersionStrEndPos - nVersionStrStartPos);
+        OString aVersionLine = rShaderSource.copy(0, nVersionStrEndPos);
+        OString aShaderBody = rShaderSource.copy(nVersionStrEndPos + 1);
 
         rShaderSource = aVersionLine + "\n" + rPreamble + "\n" + aShaderBody;
     }


More information about the Libreoffice-commits mailing list