X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4b7eab302f12688ad0fb272ac56500e29014432d..629f3c1beaecfd39e0682da25cf9e670cf038b43:/contrib/src/ogl/basic2.cpp diff --git a/contrib/src/ogl/basic2.cpp b/contrib/src/ogl/basic2.cpp index b65c7df5b2..35c591720c 100644 --- a/contrib/src/ogl/basic2.cpp +++ b/contrib/src/ogl/basic2.cpp @@ -1769,7 +1769,7 @@ wxShapeRegion::wxShapeRegion() m_textColour = wxT("BLACK"); m_penColour = wxT("BLACK"); m_penStyle = wxSOLID; - m_actualColourObject = NULL; + m_actualColourObject = wxTheColourDatabase->Find(wxT("BLACK")); m_actualPenObject = NULL; } @@ -1790,7 +1790,7 @@ wxShapeRegion::wxShapeRegion(wxShapeRegion& region) m_regionProportionX = region.m_regionProportionX; m_regionProportionY = region.m_regionProportionY; m_formatMode = region.m_formatMode; - m_actualColourObject = NULL; + m_actualColourObject = region.m_actualColourObject; m_actualPenObject = NULL; m_penStyle = region.m_penStyle; m_penColour = region.m_penColour; @@ -1862,15 +1862,12 @@ void wxShapeRegion::SetFormatMode(int mode) void wxShapeRegion::SetColour(const wxString& col) { m_textColour = col; - m_actualColourObject = NULL; + m_actualColourObject = col; } -wxColour *wxShapeRegion::GetActualColourObject() +wxColour wxShapeRegion::GetActualColourObject() { - if (!m_actualColourObject) - m_actualColourObject = wxTheColourDatabase->FindColour(GetColour()); - if (!m_actualColourObject) - m_actualColourObject = wxBLACK; + m_actualColourObject = wxTheColourDatabase->Find(GetColour()); return m_actualColourObject; }