[Libreoffice-commits] core.git: 5 commits - bin/update_pch.sh solenv/gbuild vcl/inc vcl/source vcl/win

Jan Holesovsky kendy at collabora.com
Mon Nov 17 15:57:28 PST 2014


 bin/update_pch.sh                   |    4 -
 solenv/gbuild/ExternalProject.mk    |    1 
 vcl/inc/pch/precompiled_vcl.hxx     |   10 +++-
 vcl/inc/win/saldata.hxx             |    2 
 vcl/source/opengl/OpenGLContext.cxx |   19 +++++++--
 vcl/source/opengl/OpenGLHelper.cxx  |    2 
 vcl/win/source/gdi/winlayout.cxx    |   10 +---
 vcl/win/source/window/salframe.cxx  |   73 ++++++++----------------------------
 8 files changed, 51 insertions(+), 70 deletions(-)

New commits:
commit b5dd21e11fd5f27527bdd70c4aab400561c77305
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Mon Nov 17 16:37:50 2014 +0100

    windows opengl: Use the updated DrawMask to get nice text with OpenGL.
    
    Change-Id: Ie4f08575848e76159af86d44e10f24fa383930fb

diff --git a/vcl/win/source/gdi/winlayout.cxx b/vcl/win/source/gdi/winlayout.cxx
index 3321d0d..1d461e6 100644
--- a/vcl/win/source/gdi/winlayout.cxx
+++ b/vcl/win/source/gdi/winlayout.cxx
@@ -243,13 +243,11 @@ void WinLayout::DrawText(SalGraphics& rGraphics) const
             aRects.mnDestWidth = width;
             aRects.mnDestHeight = height;
 
+            COLORREF color = GetTextColor(hDC);
+            SalColor salColor = MAKE_SALCOLOR(GetRValue(color), GetGValue(color), GetBValue(color));
+
             pImpl->PreDraw();
-            // TODO when we have it:
-            // COLORREF color = GetTextColor(hDC);
-            // SalColor salColor = MAKE_SALCOLOR(GetRValue(color), GetGValue(color), GetBValue(color));
-            // pImpl->DrawSolidColorWithMask(salColor, aTexture, aRects);
-            // and kill the following interim thing:
-            pImpl->DrawTexture(aTexture, aRects);
+            pImpl->DrawMask(aTexture, salColor, aRects);
             pImpl->PostDraw();
         }
 
commit 66b170230d41a9b35a86962b953d898d78a9a324
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Mon Nov 17 12:29:56 2014 +0100

    windows: Improve logging.
    
    Change-Id: I15e6d240b3c94af07e9b39cc16efb581869729f2

diff --git a/vcl/inc/win/saldata.hxx b/vcl/inc/win/saldata.hxx
index e1ae8cc..2c0731e 100644
--- a/vcl/inc/win/saldata.hxx
+++ b/vcl/inc/win/saldata.hxx
@@ -183,7 +183,7 @@ LRESULT CALLBACK SalFrameWndProcW( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM l
 void EmitTimerCallback();
 
 void SalTestMouseLeave();
-bool ImplWriteLastError( DWORD lastError, const char *szApiCall );
+void ImplWriteLastError(DWORD lastError, const char *szApiCall);
 
 long ImplHandleSalObjKeyMsg( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam );
 long ImplHandleSalObjSysCharMsg( HWND hWnd, WPARAM wParam, LPARAM lParam );
diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx
index 33a019d..67e4c5f 100644
--- a/vcl/source/opengl/OpenGLContext.cxx
+++ b/vcl/source/opengl/OpenGLContext.cxx
@@ -23,6 +23,10 @@
 #include <postmac.h>
 #endif
 
+#if defined( WNT )
+#include <win/saldata.hxx>
+#endif
+
 using namespace com::sun::star;
 
 #if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID
@@ -765,7 +769,8 @@ bool OpenGLContext::init(HDC hDC, HWND hWnd)
 bool OpenGLContext::ImplInit()
 {
     SAL_INFO("vcl.opengl", "OpenGLContext::ImplInit----start");
-    PIXELFORMATDESCRIPTOR PixelFormatFront = // PixelFormat Tells Windows How We Want Things To Be
+    // PixelFormat tells Windows how we want things to be
+    PIXELFORMATDESCRIPTOR PixelFormatFront =
     {
         sizeof(PIXELFORMATDESCRIPTOR),
         1,                              // Version Number
@@ -813,17 +818,25 @@ bool OpenGLContext::ImplInit()
         return false;
     }
 
-    SetPixelFormat(m_aGLWin.hDC, WindowPix, &PixelFormatFront);
+    if (!SetPixelFormat(m_aGLWin.hDC, WindowPix, &PixelFormatFront))
+    {
+        ImplWriteLastError(GetLastError(), "SetPixelFormat in OpenGLContext::ImplInit");
+        SAL_WARN("vcl.opengl", "SetPixelFormat failed");
+        return false;
+    }
+
     m_aGLWin.hRC = wglCreateContext(m_aGLWin.hDC);
     if (m_aGLWin.hRC == NULL)
     {
+        ImplWriteLastError(GetLastError(), "wglCreateContext in OpenGLContext::ImplInit");
         SAL_WARN("vcl.opengl", "wglCreateContext failed");
         return false;
     }
 
     if (!wglMakeCurrent(m_aGLWin.hDC, m_aGLWin.hRC))
     {
-        SAL_WARN("vcl.opengl", "wglMakeCurrent failed: " << GetLastError());
+        ImplWriteLastError(GetLastError(), "wglMakeCurrent in OpenGLContext::ImplInit");
+        SAL_WARN("vcl.opengl", "wglMakeCurrent failed");
         return false;
     }
 
diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx
index d42b0f5..d2fef8f 100644
--- a/vcl/win/source/window/salframe.cxx
+++ b/vcl/win/source/window/salframe.cxx
@@ -5974,64 +5974,27 @@ bool ImplHandleGlobalMsg( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam, LR
     return bResult;
 }
 
-bool ImplWriteLastError( DWORD lastError, const char *szApiCall )
+void ImplWriteLastError(DWORD lastError, const char *szApiCall)
 {
-    static int first=1;
-    // if VCL_LOGFILE_ENABLED is set, Win32 API error messages can be written
-    // to %TMP%/vcl.log or %TEMP%/vcl.log
-    static char *logEnabled = getenv("VCL_LOGFILE_ENABLED");
-    if( logEnabled )
-    {
-        bool bSuccess = FALSE;
-        static char *szTmp = getenv("TMP");
-        if( !szTmp || !*szTmp )
-            szTmp = getenv("TEMP");
-        if( szTmp && *szTmp )
-        {
-            char fname[5000];
-            strcpy( fname, szTmp );
-            if( fname[strlen(fname) - 1] != '\\' )
-                strcat( fname, "\\");
-            strcat( fname, "vcl.log" );
-            FILE *fp = fopen( fname, "a" ); // always append
-            if( fp )
-            {
-                if( first )
-                {
-                    first = 0;
-                    fprintf( fp, "Process ID: %ld (0x%lx)\n", GetCurrentProcessId(), GetCurrentProcessId() );
-                }
-                time_t aclock;
-                time( &aclock );                           // Get time in seconds
-                struct tm *newtime = localtime( &aclock ); // Convert time to struct tm form
-                fprintf( fp, asctime( newtime ) );         // print time stamp
-
-                fprintf( fp, "%s returned %lu (0x%lx)\n", szApiCall, lastError, lastError );
-                bSuccess = TRUE;    // may be FormatMessage fails but we wrote at least the error code
-
-                LPVOID lpMsgBuf;
-                if (FormatMessageA(
-                    FORMAT_MESSAGE_ALLOCATE_BUFFER |
-                    FORMAT_MESSAGE_FROM_SYSTEM |
-                    FORMAT_MESSAGE_IGNORE_INSERTS,
-                    NULL,
-                    lastError,
-                    MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
-                    (LPSTR) &lpMsgBuf,
-                    0,
-                    NULL ))
-                {
-                    fprintf( fp, " %s\n", (LPSTR)lpMsgBuf );
-                    LocalFree( lpMsgBuf );
-                }
-
-                fclose( fp );
-            }
-        }
-        return bSuccess;
+#if OSL_DEBUG_LEVEL > 0
+    LPVOID lpMsgBuf;
+    if (FormatMessageA(
+                FORMAT_MESSAGE_ALLOCATE_BUFFER |
+                FORMAT_MESSAGE_FROM_SYSTEM |
+                FORMAT_MESSAGE_IGNORE_INSERTS,
+                NULL,
+                lastError & 0xffff,
+                MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
+                (LPTSTR) &lpMsgBuf,
+                0,
+                NULL ))
+    {
+        SAL_WARN("vcl", "API call: " << szApiCall << " returned " << lastError << " (0x" << std::hex << lastError << "): " << (LPTSTR) lpMsgBuf);
+        LocalFree(lpMsgBuf);
     }
     else
-        return TRUE;
+        SAL_WARN("vcl", "API call: " << szApiCall << " returned " << lastError << " (0x" << std::hex << lastError << ")");
+#endif
 }
 
 #ifdef _WIN32
commit 3852d46941107c0ad596cfc0fe9098433292994c
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Mon Nov 17 00:28:29 2014 +0100

    opengl: Do not check for OpenGL errors in a loop.
    
    Can lead to an infinite loop.
    
    Change-Id: I09863959719115aec23534ac72a9a9690af3aeb9

diff --git a/vcl/source/opengl/OpenGLHelper.cxx b/vcl/source/opengl/OpenGLHelper.cxx
index fda89c3..6e2fe2c 100644
--- a/vcl/source/opengl/OpenGLHelper.cxx
+++ b/vcl/source/opengl/OpenGLHelper.cxx
@@ -353,7 +353,7 @@ float OpenGLHelper::getGLVersion()
 void OpenGLHelper::checkGLError(const char* pFile, size_t nLine)
 {
     GLenum glErr = glGetError();
-    while (glErr != GL_NO_ERROR)
+    if (glErr != GL_NO_ERROR)
     {
         const char* sError = OpenGLHelper::GLErrorString(glErr);
 
commit b829f8352c85593c209ba0f44d83da3a126058a4
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Sun Nov 16 00:11:38 2014 +0100

    windows: msbuild gets completely confused when the 'Platform' envvar is set.
    
    Change-Id: Iea04859c6afa203bd6b527b99c680ff4176cf9e1

diff --git a/solenv/gbuild/ExternalProject.mk b/solenv/gbuild/ExternalProject.mk
index aeb5379..59fc678 100644
--- a/solenv/gbuild/ExternalProject.mk
+++ b/solenv/gbuild/ExternalProject.mk
@@ -212,6 +212,7 @@ define gb_ExternalProject_run
 $(if $(findstring YES,$(UNPACKED_IS_BIN_TARBALL)),\
 	touch $@,
 $(call gb_Helper_print_on_error,cd $(EXTERNAL_WORKDIR)/$(3) && \
+	unset Platform && \
 	$(if $(WRAPPERS),export $(WRAPPERS) &&) \
 	$(if $(NMAKE),INCLUDE="$(gb_ExternalProject_INCLUDE)" LIB="$(ILIB)" MAKEFLAGS=) \
 	$(2) && touch $@,$(EXTERNAL_WORKDIR)/$(if $(3),$(3)/,)$(if $(4),$(4),$(1).log))
commit e423113497bb0b69f6ed3a390feab174cfbc730c
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Tue Nov 18 00:30:09 2014 +0100

    pch: jpeg's headers conflict with INT32 typedef when in pch.
    
    Change-Id: I02b8fa22c11895d00e29d93b25397af676e3edae

diff --git a/bin/update_pch.sh b/bin/update_pch.sh
index 0d0b8f6..61f0c6d 100755
--- a/bin/update_pch.sh
+++ b/bin/update_pch.sh
@@ -150,8 +150,8 @@ function filter_ignore()
     grep -v -F -e '#include <oledb.h>' | \
     grep -v -F -e '#include <cert.h>' | \
     grep -v -F -e '#include <xmlreader/xmlreader.hxx>' | \
-    grep -v -F -e '#include "jerror.h"' | \
-    grep -v -F -e '#include "jpeglib.h"'
+    grep -v -e '#include [<"]jerror.h[">]' | \
+    grep -v -e '#include [<"]jpeglib.h[">]'
 )
 
     # " in #include "foo" breaks echo down below, so " -> @
diff --git a/vcl/inc/pch/precompiled_vcl.hxx b/vcl/inc/pch/precompiled_vcl.hxx
index 55c95f5..9d3018a 100644
--- a/vcl/inc/pch/precompiled_vcl.hxx
+++ b/vcl/inc/pch/precompiled_vcl.hxx
@@ -124,9 +124,11 @@
 #include <basegfx/polygon/b2dpolygon.hxx>
 #include <basegfx/polygon/b2dpolygonclipper.hxx>
 #include <basegfx/polygon/b2dpolygontools.hxx>
+#include <basegfx/polygon/b2dpolygontriangulator.hxx>
 #include <basegfx/polygon/b2dpolypolygon.hxx>
 #include <basegfx/polygon/b2dpolypolygoncutter.hxx>
 #include <basegfx/polygon/b2dpolypolygontools.hxx>
+#include <basegfx/polygon/b2dtrapezoid.hxx>
 #include <basegfx/range/b2drange.hxx>
 #include <basegfx/range/b2drectangle.hxx>
 #include <basegfx/range/b2irectangle.hxx>
@@ -184,8 +186,11 @@
 #include <com/sun/star/datatransfer/dnd/XDragGestureRecognizer.hpp>
 #include <com/sun/star/datatransfer/dnd/XDragSource.hpp>
 #include <com/sun/star/datatransfer/dnd/XDropTarget.hpp>
+#include <com/sun/star/frame/Desktop.hpp>
 #include <com/sun/star/frame/ModuleManager.hpp>
 #include <com/sun/star/frame/XController.hpp>
+#include <com/sun/star/frame/XDispatch.hpp>
+#include <com/sun/star/frame/XDispatchProvider.hpp>
 #include <com/sun/star/frame/XModel.hpp>
 #include <com/sun/star/frame/XModuleManager2.hpp>
 #include <com/sun/star/frame/XSessionManagerClient.hpp>
@@ -272,6 +277,7 @@
 #include <com/sun/star/xml/sax/XDocumentHandler.hpp>
 #include <comphelper/namedvaluecollection.hxx>
 #include <comphelper/processfactory.hxx>
+#include <comphelper/random.hxx>
 #include <comphelper/scopeguard.hxx>
 #include <comphelper/seqstream.hxx>
 #include <comphelper/string.hxx>
@@ -298,8 +304,6 @@
 #include <i18nlangtag/mslangid.hxx>
 #include <iomanip>
 #include <iostream>
-#include <jerror.h>
-#include <jpeglib.h>
 #include <lcms2.h>
 #include <limits.h>
 #include <limits>
@@ -308,6 +312,7 @@
 #include <math.h>
 #include <memory>
 #include <numeric>
+#include <o3tl/numeric.hxx>
 #include <officecfg/Office/Common.hxx>
 #include <osl/diagnose.h>
 #include <osl/diagnose.hxx>
@@ -364,6 +369,7 @@
 #include <tools/debug.hxx>
 #include <tools/diagnose_ex.h>
 #include <tools/fontenum.hxx>
+#include <tools/fract.hxx>
 #include <tools/gen.hxx>
 #include <tools/helpers.hxx>
 #include <tools/line.hxx>


More information about the Libreoffice-commits mailing list