ooo-build r11247 - in trunk: . patches/cairo patches/src680



Author: strba
Date: Fri Jan 11 16:25:49 2008
New Revision: 11247
URL: http://svn.gnome.org/viewvc/ooo-build?rev=11247&view=rev

Log:
don't crash, just silently fail if cairo canvas is requested and xrender extension is not present + fix some warnings in libwpd 0.8.13 (yeah, bad me)

Added:
   trunk/patches/cairo/cairo-canvas-fail-if-no-xrender.diff
Modified:
   trunk/ChangeLog
   trunk/patches/src680/apply
   trunk/patches/src680/libwpd.diff

Added: trunk/patches/cairo/cairo-canvas-fail-if-no-xrender.diff
==============================================================================
--- (empty file)
+++ trunk/patches/cairo/cairo-canvas-fail-if-no-xrender.diff	Fri Jan 11 16:25:49 2008
@@ -0,0 +1,101 @@
+--- canvas/source/cairo/cairo_cairo.cxx	17 Jul 2007 14:19:36 -0000	1.5
++++ canvas/source/cairo/cairo_cairo.cxx	28 Nov 2007 09:46:36 -0000
+@@ -47,6 +47,13 @@
+ #include <cairo-xlib.h>
+ #include <cairo-xlib-xrender.h>
+ 
++	bool HasXRender( const void* pSysData )
++	{
++	        Display *pDisplay = (Display*) cairoHelperGetDisplay( pSysData );
++	        int nDummy;
++	        return XQueryExtension( pDisplay, "RENDER", &nDummy, &nDummy, &nDummy );
++	}
++
+   /**
+    * Surface::Surface:   Create Canvas surface with existing data
+    * @param pSysData Platform native system environment data (struct SystemEnvData in vcl/inc/sysdata.hxx)
+--- canvas/source/cairo/cairo_cairo.hxx	17 Jul 2007 14:19:49 -0000	1.4
++++ canvas/source/cairo/cairo_cairo.hxx	28 Nov 2007 09:46:36 -0000
+@@ -3,6 +3,8 @@
+ 
+ namespace cairo {
+ 
++        bool HasXRender( const void* pSysData );
++
+ #include <cairo.h>
+ 
+ 	typedef cairo_t Cairo;
+--- canvas/source/cairo/cairo_devicehelper.cxx	17 Jul 2007 14:21:10 -0000	1.7
++++ canvas/source/cairo/cairo_devicehelper.cxx	28 Nov 2007 09:46:36 -0000
+@@ -64,6 +64,22 @@
+ 
+ namespace cairocanvas
+ {
++
++    const SystemEnvData* GetSysData(Window *pOutputWindow)
++    {
++        const SystemEnvData* pSysData = NULL;
++        // check whether we're a SysChild: have to fetch system data
++        // directly from SystemChildWindow, because the GetSystemData
++        // method is unfortunately not virtual
++        const SystemChildWindow* pSysChild = dynamic_cast< const SystemChildWindow* >( pOutputWindow );
++        if( pSysChild )
++            pSysData = pSysChild->GetSystemData();
++        else
++            pSysData = pOutputWindow->GetSystemData();
++        return pSysData;
++    }
++
++
+     DeviceHelper::DeviceHelper() :
+         mpSpriteCanvas( NULL ),
+         maSize(),
+@@ -90,14 +106,7 @@
+         mpSpriteCanvas = &rSpriteCanvas;
+         mbFullScreen = bFullscreen;
+ 
+-        // check whether we're a SysChild: have to fetch system data
+-        // directly from SystemChildWindow, because the GetSystemData
+-        // method is unfortunately not virtual
+-        const SystemChildWindow* pSysChild = dynamic_cast< const SystemChildWindow* >( mpOutputWindow );
+-        if( pSysChild )
+-            mpSysData = pSysChild->GetSystemData();
+-        else
+-            mpSysData = mpOutputWindow->GetSystemData();
++        mpSysData = GetSysData(mpOutputWindow);
+ 
+         setSize( rSize );
+     }
+--- canvas/source/cairo/cairo_devicehelper.hxx	28 Feb 2006 10:35:37 -0000	1.2
++++ canvas/source/cairo/cairo_devicehelper.hxx	28 Nov 2007 09:46:36 -0000
+@@ -54,6 +54,8 @@
+     class SpriteCanvas;
+     class SpriteCanvasHelper;
+ 
++    const SystemEnvData* GetSysData(Window *pOutputWindow);
++
+     class DeviceHelper : private ::boost::noncopyable
+     {
+     public:
+--- canvas/source/cairo/cairo_spritecanvas.cxx	9 Nov 2007 11:59:46 -0000	1.5.12.1
++++ canvas/source/cairo/cairo_spritecanvas.cxx	28 Nov 2007 09:46:36 -0000
+@@ -56,7 +56,7 @@
+ #include <basegfx/numeric/ftools.hxx>
+ 
+ #include "cairo_spritecanvas.hxx"
+-
++#include "cairo_devicehelper.hxx"
+ 
+ using namespace ::cairo;
+ using namespace ::com::sun::star;
+@@ -100,6 +100,10 @@
+         CHECK_AND_THROW( pOutputWindow != NULL, 
+                          "SpriteCanvas::SpriteCanvas: invalid Window pointer" );
+ 
++        bool bHasXRender = HasXRender( cairocanvas::GetSysData(pOutputWindow) );
++        CHECK_AND_THROW( bHasXRender == true, 
++                         "SpriteCanvas::SpriteCanvas: No RENDER extension" );
++
+         Size aPixelSize( pOutputWindow->GetOutputSizePixel() );
+         const ::basegfx::B2ISize aSize( aPixelSize.Width(),
+                                         aPixelSize.Height() );

Modified: trunk/patches/src680/apply
==============================================================================
--- trunk/patches/src680/apply	(original)
+++ trunk/patches/src680/apply	Fri Jan 11 16:25:49 2008
@@ -1460,6 +1460,10 @@
 cairo-config_office-configure-in.diff, i#70519, tml
 cairo-cairo-1-4-10-diff.diff, i#70519, tml
 
+# don't crash if xrender extension is not present
+cairo-canvas-fail-if-no-xrender.diff, i#84049, fridrich
+
+
 # Additional diffs for cairocanvas on Win32
 cairo-canvas-win32.diff, i#70519, n#300398, tml
 

Modified: trunk/patches/src680/libwpd.diff
==============================================================================
--- trunk/patches/src680/libwpd.diff	(original)
+++ trunk/patches/src680/libwpd.diff	Fri Jan 11 16:25:49 2008
@@ -1,13 +1,169 @@
 --- libwpd/makefile.mk	23 Jan 2007 12:10:32 -0000	1.14
 +++ libwpd/makefile.mk	15 Jun 2007 11:04:20 -0000
-@@ -49,8 +49,8 @@
+@@ -49,7 +49,7 @@
  	@echo "Using system libwpd..."
  .ENDIF
  
 -TARFILE_NAME=libwpd-0.8.8
--PATCH_FILE_NAME=$(TARFILE_NAME).diff
 +TARFILE_NAME=libwpd-0.8.13
-+#PATCH_FILE_NAME=$(TARFILE_NAME).diff
+ PATCH_FILE_NAME=$(TARFILE_NAME).diff
  BUILD_ACTION=dmake $(MFLAGS) $(CALLMACROS)
  BUILD_DIR=src$/lib
- 
+--- /dev/null	2007-12-17 14:57:10.000000000 +0100
++++ libwpd/libwpd-0.8.13.diff	2008-01-10 21:21:51.000000000 +0100
+@@ -0,0 +1,155 @@
++*** misc/libwpd-0.8.13/src/lib/WP1ContentListener.cpp	Sun Sep 23 12:12:27 2007
++--- misc/build/libwpd-0.8.13/src/lib/WP1ContentListener.cpp	Thu Jan 10 21:21:38 2008
++***************
++*** 219,231 ****
++  	}
++  }
++  
++! void WP1ContentListener::fontId(const uint16_t fontId)
++  {
++  	if (!isUndoOn())
++  	{
++  		_closeSpan();
++  		
++! 		switch (fontId)
++  		{
++  		case 0x0002:
++  		case 0xFF02:
++--- 219,231 ----
++  	}
++  }
++  
++! void WP1ContentListener::fontId(const uint16_t id)
++  {
++  	if (!isUndoOn())
++  	{
++  		_closeSpan();
++  		
++! 		switch (id)
++  		{
++  		case 0x0002:
++  		case 0xFF02:
++*** misc/libwpd-0.8.13/src/lib/WP1ContentListener.h	Mon Sep 17 13:16:26 2007
++--- misc/build/libwpd-0.8.13/src/lib/WP1ContentListener.h	Thu Jan 10 21:21:38 2008
++***************
++*** 60,66 ****
++  	void insertNote(const WPXNoteType noteType, WP1SubDocument *subDocument);
++  	void attributeChange(const bool isOn, const uint8_t attribute);
++  	void fontPointSize(const uint8_t pointSize);
++! 	void fontId(const uint16_t fontId);
++  	void marginReset(const uint16_t leftMargin, const uint16_t rightMargin);
++  	void topMarginSet(const uint16_t /* topMargin */) {}
++  	void bottomMarginSet(const uint16_t /* bottomMargin */) {}
++--- 60,66 ----
++  	void insertNote(const WPXNoteType noteType, WP1SubDocument *subDocument);
++  	void attributeChange(const bool isOn, const uint8_t attribute);
++  	void fontPointSize(const uint8_t pointSize);
++! 	void fontId(const uint16_t id);
++  	void marginReset(const uint16_t leftMargin, const uint16_t rightMargin);
++  	void topMarginSet(const uint16_t /* topMargin */) {}
++  	void bottomMarginSet(const uint16_t /* bottomMargin */) {}
++*** misc/libwpd-0.8.13/src/lib/WP1Listener.h	Mon Sep 17 13:16:26 2007
++--- misc/build/libwpd-0.8.13/src/lib/WP1Listener.h	Thu Jan 10 21:21:38 2008
++***************
++*** 47,53 ****
++  	virtual void insertNote(const WPXNoteType noteType, WP1SubDocument *subDocument) = 0;
++  	virtual void attributeChange(const bool isOn, const uint8_t attribute) = 0;
++  	virtual void fontPointSize(const uint8_t pointSize) = 0;
++! 	virtual void fontId(const uint16_t fontId) = 0;
++  	virtual void marginReset(const uint16_t leftMargin, const uint16_t rightMargin) = 0;
++  	virtual void topMarginSet(const uint16_t topMargin) = 0;
++  	virtual void bottomMarginSet(const uint16_t bottomMargin) = 0;
++--- 47,53 ----
++  	virtual void insertNote(const WPXNoteType noteType, WP1SubDocument *subDocument) = 0;
++  	virtual void attributeChange(const bool isOn, const uint8_t attribute) = 0;
++  	virtual void fontPointSize(const uint8_t pointSize) = 0;
++! 	virtual void fontId(const uint16_t id) = 0;
++  	virtual void marginReset(const uint16_t leftMargin, const uint16_t rightMargin) = 0;
++  	virtual void topMarginSet(const uint16_t topMargin) = 0;
++  	virtual void bottomMarginSet(const uint16_t bottomMargin) = 0;
++*** misc/libwpd-0.8.13/src/lib/WP1StylesListener.h	Mon Sep 17 13:16:26 2007
++--- misc/build/libwpd-0.8.13/src/lib/WP1StylesListener.h	Thu Jan 10 21:21:38 2008
++***************
++*** 49,55 ****
++  	void insertNote(const WPXNoteType /* noteType */, WP1SubDocument * /* subDocument */) {}
++  	void attributeChange(const bool /* isOn */, const uint8_t /* attribute */) {}
++  	void fontPointSize(const uint8_t /* pointSize */) {}
++! 	void fontId(const uint16_t /* fontId */) {}
++  	void marginReset(const uint16_t leftMargin, const uint16_t rightMargin);
++  	void topMarginSet(const uint16_t topMargin);
++  	void bottomMarginSet(const uint16_t bottomMargin);
++--- 49,55 ----
++  	void insertNote(const WPXNoteType /* noteType */, WP1SubDocument * /* subDocument */) {}
++  	void attributeChange(const bool /* isOn */, const uint8_t /* attribute */) {}
++  	void fontPointSize(const uint8_t /* pointSize */) {}
++! 	void fontId(const uint16_t /* id */) {}
++  	void marginReset(const uint16_t leftMargin, const uint16_t rightMargin);
++  	void topMarginSet(const uint16_t topMargin);
++  	void bottomMarginSet(const uint16_t bottomMargin);
++*** misc/libwpd-0.8.13/src/lib/WP5StylesListener.h	Fri Oct 12 19:16:09 2007
++--- misc/build/libwpd-0.8.13/src/lib/WP5StylesListener.h	Thu Jan 10 21:21:38 2008
++***************
++*** 46,52 ****
++  	void setTabs(const std::vector<WPXTabStop>& /* tabStops */, const uint16_t /* tabOffset */) {} 
++  	void insertCharacter(const uint16_t /* character */) { /*if (!isUndoOn())*/ m_currentPageHasContent = true; }
++  	void insertTab(const uint8_t /* tabType */, const float /* tabPosition */) { /*if (!isUndoOn())*/ m_currentPageHasContent = true; }
++! 	virtual void insertIndent(const uint8_t indentType, const float indentPosition) { /*if (!isUndoOn())*/ m_currentPageHasContent = true; }
++  	void characterColorChange(const uint8_t /* red */, const uint8_t /* green */, const uint8_t /* blue */) {};
++  	void insertEOL() { /*if (!isUndoOn())*/ m_currentPageHasContent = true; }
++   	void insertBreak(const uint8_t breakType);
++--- 46,52 ----
++  	void setTabs(const std::vector<WPXTabStop>& /* tabStops */, const uint16_t /* tabOffset */) {} 
++  	void insertCharacter(const uint16_t /* character */) { /*if (!isUndoOn())*/ m_currentPageHasContent = true; }
++  	void insertTab(const uint8_t /* tabType */, const float /* tabPosition */) { /*if (!isUndoOn())*/ m_currentPageHasContent = true; }
++! 	virtual void insertIndent(const uint8_t /* indentType */, const float /* indentPosition */) { /*if (!isUndoOn())*/ m_currentPageHasContent = true; }
++  	void characterColorChange(const uint8_t /* red */, const uint8_t /* green */, const uint8_t /* blue */) {};
++  	void insertEOL() { /*if (!isUndoOn())*/ m_currentPageHasContent = true; }
++   	void insertBreak(const uint8_t breakType);
++*** misc/libwpd-0.8.13/src/lib/WP6ContentListener.cpp	Sat Dec  8 13:12:37 2007
++--- misc/build/libwpd-0.8.13/src/lib/WP6ContentListener.cpp	Thu Jan 10 21:21:38 2008
++***************
++*** 169,175 ****
++  				 const uint8_t month, const uint8_t day, 
++  				 const uint8_t hour, const uint8_t minute, 
++  				 const uint8_t second, const uint8_t dayOfWeek, 
++! 				 const uint8_t timeZone, const uint8_t unused)
++  {
++          #define DATEBUFLEN 100  // length of buffer allocated for strftime()
++          #define WPMONDAYOFFSET  1       // WP week starts Monday, tm_wday on Sunday
++--- 169,175 ----
++  				 const uint8_t month, const uint8_t day, 
++  				 const uint8_t hour, const uint8_t minute, 
++  				 const uint8_t second, const uint8_t dayOfWeek, 
++! 				 const uint8_t /* timeZone */, const uint8_t /* unused */)
++  {
++          #define DATEBUFLEN 100  // length of buffer allocated for strftime()
++          #define WPMONDAYOFFSET  1       // WP week starts Monday, tm_wday on Sunday
++*** misc/libwpd-0.8.13/src/lib/WP6StylesListener.h	Thu May 17 15:06:21 2007
++--- misc/build/libwpd-0.8.13/src/lib/WP6StylesListener.h	Thu Jan 10 21:21:38 2008
++***************
++*** 44,55 ****
++  public:
++  	WP6StylesListener(std::list<WPXPageSpan> &pageList, WPXTableList tableList);
++  
++! 	void setDate(const uint16_t type, const uint16_t year, 
++!                      const uint8_t month, const uint8_t day, 
++!                      const uint8_t hour, const uint8_t minute, 
++!                      const uint8_t second, const uint8_t dayOfWeek, 
++!                      const uint8_t timeZone, const uint8_t unused) {}
++! 	void setExtendedInformation(const uint16_t type, const WPXString &data) {}
++  	void startDocument() {}
++  	void setAlignmentCharacter(const uint16_t /* character */) {}
++  	void setLeaderCharacter(const uint16_t /* character */, const uint8_t /* numberOfSpaces */) {}
++--- 44,55 ----
++  public:
++  	WP6StylesListener(std::list<WPXPageSpan> &pageList, WPXTableList tableList);
++  
++! 	void setDate(const uint16_t /* type */, const uint16_t /* year */, 
++!                      const uint8_t /* month */, const uint8_t /* day */, 
++!                      const uint8_t /* hour */, const uint8_t /* minute */, 
++!                      const uint8_t /* second */, const uint8_t /* dayOfWeek */, 
++!                      const uint8_t /* timeZone */, const uint8_t /* unused */) {}
++! 	void setExtendedInformation(const uint16_t /* type */, const WPXString & /* data */) {}
++  	void startDocument() {}
++  	void setAlignmentCharacter(const uint16_t /* character */) {}
++  	void setLeaderCharacter(const uint16_t /* character */, const uint8_t /* numberOfSpaces */) {}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]