xsrc = source->LogicalToDeviceX(xsrc);
ysrc = source->LogicalToDeviceY(ysrc);
+ wxBitmap selected;
wxMemoryDC *memDC = wxDynamicCast(source, wxMemoryDC);
- wxBitmap selected = source->GetSelectedBitmap();
+ if ( memDC )
+ {
+ selected = memDC->GetSelectedBitmap();
+ if ( !selected.IsOk() )
+ return false;
+ }
bool use_bitmap_method = false;
bool is_mono = false;
ysrcMask = ysrc;
}
- if (memDC && !selected.Ok()) return false;
-
if (selected.Ok())
{
is_mono = (selected.GetDepth() == 1);
return;
size_t datalen = strlen(data);
- // TODO: as soon as Pango provides a function to check at runtime its
- // version, we can use it to disable the underline hack for
- // Pango >= 1.16 as the "underline of leading/trailing spaces"
- // has been fixed there
- bool needshack = underlined;
+ // in Pango >= 1.16 the "underline of leading/trailing spaces" bug
+ // has been fixed and thus the hack implemented below should never be used
+ static bool pangoOk = !wx_pango_version_check(1, 16, 0);
+
+ bool needshack = underlined && !pangoOk;
char *hackstring = NULL;
if (needshack)
void wxWindowDC::DoGetTextExtent(const wxString &string,
wxCoord *width, wxCoord *height,
wxCoord *descent, wxCoord *externalLeading,
- wxFont *theFont) const
+ const wxFont *theFont) const
{
if ( width )
*width = 0;