[Libreoffice-commits] core.git: 3 commits - chart2/source sc/source
Markus Mohrhard
markus.mohrhard at collabora.co.uk
Sat Feb 15 03:08:50 CET 2014
chart2/source/view/main/OpenGLRender.cxx | 23 ++++++++++++++++-------
sc/source/filter/excel/xecontent.cxx | 13 ++++++++-----
2 files changed, 24 insertions(+), 12 deletions(-)
New commits:
commit 6d6ba15f7dd3251e70d5311e6138f294025a0a5f
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Sat Feb 15 03:05:34 2014 +0100
fix OpenGL text rendering
Change-Id: Ia5dd022d8b79d4276a92bcf741196137d5e9d36e
diff --git a/chart2/source/view/main/OpenGLRender.cxx b/chart2/source/view/main/OpenGLRender.cxx
index 1dabe73..963d6b0 100755
--- a/chart2/source/view/main/OpenGLRender.cxx
+++ b/chart2/source/view/main/OpenGLRender.cxx
@@ -221,6 +221,17 @@ GLint OpenGLRender::LoadShaders(const OUString& rVertexShaderName,const OUString
return ProgramID;
}
+namespace {
+
+GLfloat texCoords[] = {
+ 0.0f, 0.0f,
+ 1.0f, 0.0f,
+ 1.0f, 1.0f,
+ 0.0f, 1.0f
+};
+
+}
+
int OpenGLRender::InitOpenGL(GLWindow aWindow)
{
glWin = aWindow;
@@ -318,10 +329,12 @@ int OpenGLRender::InitOpenGL(GLWindow aWindow)
glGenBuffers(1, &m_RenderTexCoordBuf);
glBindBuffer(GL_ARRAY_BUFFER, m_RenderTexCoordBuf);
+ glBufferData(GL_ARRAY_BUFFER, sizeof(texCoords), texCoords, GL_STATIC_DRAW);
glBindBuffer(GL_ARRAY_BUFFER, 0);
glGenBuffers(1, &m_TextTexCoordBuf);
glBindBuffer(GL_ARRAY_BUFFER, m_TextTexCoordBuf);
+ glBufferData(GL_ARRAY_BUFFER, sizeof(texCoords), texCoords, GL_STATIC_DRAW);
glBindBuffer(GL_ARRAY_BUFFER, 0);
#if defined( WNT )
@@ -1476,7 +1489,7 @@ int OpenGLRender::RenderTextShape()
glUniform1i(m_TextTexID, 0);
CHECK_GL_ERROR();
//TODO: moggi: get rid fo GL_QUADS
- glDrawArrays(GL_QUADS, 0, 3);
+ glDrawArrays(GL_QUADS, 0, 4);
CHECK_GL_ERROR();
glDisableVertexAttribArray(m_TextTexCoordID);
CHECK_GL_ERROR();
commit eabba2d8421cf9fe47b7a40169e2c4b5cadbdf27
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Sat Feb 15 03:04:51 2014 +0100
remove unnecessary stuff
Change-Id: Ideac5b1bdd86ed8eaf37d8f9554293d965cb8612
diff --git a/chart2/source/view/main/OpenGLRender.cxx b/chart2/source/view/main/OpenGLRender.cxx
index 1f07b46..1dabe73 100755
--- a/chart2/source/view/main/OpenGLRender.cxx
+++ b/chart2/source/view/main/OpenGLRender.cxx
@@ -1330,10 +1330,6 @@ int OpenGLRender::RenderRectangleShape(bool bBorder, bool bFill)
int OpenGLRender::CreateTextTexture(const BitmapEx& rBitmapEx, awt::Point aPos, awt::Size aSize, long rotation,
const drawing::HomogenMatrix3& rTrans)
{
- glm::mat3 aTrans(rTrans.Line1.Column1, rTrans.Line1.Column2, rTrans.Line1.Column3,
- rTrans.Line2.Column1, rTrans.Line2.Column2, rTrans.Line2.Column3,
- rTrans.Line3.Column1, rTrans.Line3.Column3, rTrans.Line3.Column3);
-
#if DEBUG_PNG // debug PNG writing
static int nIdx = 0;
OUString aName = OUString( "file:///home/moggi/Documents/work/text" ) + OUString::number( nIdx++ ) + ".png";
@@ -1454,7 +1450,7 @@ int OpenGLRender::RenderTextShape()
glEnableVertexAttribArray(m_TextVertexID);
glBindBuffer(GL_ARRAY_BUFFER, m_VertexBuffer);
glVertexAttribPointer(
- m_TextVertexID, // attribute. No particular reason for 0, but must match the layout in the shader.
+ m_TextVertexID,
3, // size
GL_FLOAT, // type
GL_FALSE, // normalized?
@@ -1466,7 +1462,7 @@ int OpenGLRender::RenderTextShape()
glEnableVertexAttribArray(m_TextTexCoordID);
glBindBuffer(GL_ARRAY_BUFFER, m_TextTexCoordBuf);
glVertexAttribPointer(
- m_TextTexCoordID, // attribute. No particular reason for 0, but must match the layout in the shader.
+ m_TextTexCoordID,
2, // size
GL_FLOAT, // type
GL_FALSE, // normalized?
commit 48545bb3952e000d72e7c3b1719e4c526b289650
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Fri Feb 14 00:07:31 2014 +0100
fix crash related to hyperlink export, related #i20491#
Export of ooo20491-7.ods as xlsx
Change-Id: I43e1fd6dcb4bfbefea68c0b0a24c7ad0890d9efb
diff --git a/sc/source/filter/excel/xecontent.cxx b/sc/source/filter/excel/xecontent.cxx
index 21394c5..327ef0e 100644
--- a/sc/source/filter/excel/xecontent.cxx
+++ b/sc/source/filter/excel/xecontent.cxx
@@ -415,12 +415,15 @@ XclExpHyperlink::XclExpHyperlink( const XclExpRoot& rRoot, const SvxURLField& rU
OUString aTextMark( rUrl.copy( 1 ) );
sal_Int32 nSepPos = aTextMark.indexOf( '.' );
- aTextMark = aTextMark.replaceAt( nSepPos, 1, "!" );
- OUString aSheetName( aTextMark.copy(0, nSepPos));
-
- if ( aSheetName.indexOf(' ') != -1 && aSheetName[0] != '\'')
+ if(nSepPos != -1)
{
- aTextMark = "'" + aTextMark.replaceAt(nSepPos, 0, "'");
+ aTextMark = aTextMark.replaceAt( nSepPos, 1, "!" );
+ OUString aSheetName( aTextMark.copy(0, nSepPos));
+
+ if ( aSheetName.indexOf(' ') != -1 && aSheetName[0] != '\'')
+ {
+ aTextMark = "'" + aTextMark.replaceAt(nSepPos, 0, "'");
+ }
}
mxTextMark.reset( new XclExpString( aTextMark, EXC_STR_FORCEUNICODE, 255 ) );
More information about the Libreoffice-commits
mailing list