]> git.saurik.com Git - wxWidgets.git/commitdiff
Pass correct length to XTextExtents
authorJulian Smart <julian@anthemion.co.uk>
Tue, 12 Feb 2002 15:39:18 +0000 (15:39 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Tue, 12 Feb 2002 15:39:18 +0000 (15:39 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14157 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/x11/dcclient.cpp
src/x11/toplevel.cpp
src/x11/window.cpp

index 93746522bdf0b20e9c243a06a21f3bc26a0f946f..509325d62891c84b5322e7113c84088945d973bb 100644 (file)
@@ -1233,7 +1233,10 @@ void wxWindowDC::DoDrawText( const wxString &text, wxCoord x, wxCoord y )
     y = YLOG2DEV(y);
 
     XCharStruct overall_return;
-    int direction, slen, ascent, descent;
+    int direction = 0;
+    int slen = text.Length();
+    int ascent = 0;
+    int descent = 0;
     (void)XTextExtents((XFontStruct*) xfont, (char*) (const char*) text, slen, &direction,
                                &ascent, &descent, &overall_return);
 #if 0
index fb3be5d0fddc3525aefa5b6cddb093130f79b4fc..648bb6ac3a0a7596f7516d8b479951ddca86ff3d 100644 (file)
@@ -95,7 +95,8 @@ bool wxTopLevelWindowX11::Create(wxWindow *parent,
     // TODO: For dialogs, this should be wxSYS_COLOUR_3DFACE
     m_backgroundColour = wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE);
     m_backgroundColour.CalcPixel( (WXColormap) cm );
-
+    m_hasBgCol = TRUE;
+       
     XSetWindowAttributes xattributes;
     XSizeHints size_hints;
     XWMHints wm_hints;
index ec6674bbf14bad8cdf091d64d9df8b79994aecdb..041217aa9eb2b3d48cfe2040ac42db60efead61e 100644 (file)
@@ -138,6 +138,7 @@ bool wxWindowX11::Create(wxWindow *parent, wxWindowID id,
 
     m_backgroundColour = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE);
     m_backgroundColour.CalcPixel( (WXColormap) cm ); 
+    m_hasBgCol = TRUE;
     
     m_foregroundColour = *wxBLACK;
     m_foregroundColour.CalcPixel( (WXColormap) cm ); 
@@ -1313,8 +1314,7 @@ int wxComputeColours (Display *display, wxColour * back, wxColour * fore)
 
 bool wxWindowX11::SetBackgroundColour(const wxColour& col)
 {
-    if ( !wxWindowBase::SetBackgroundColour(col) )
-        return FALSE;
+    wxWindowBase::SetBackgroundColour(col);
 
     if (!GetMainWindow())
         return FALSE;