+/* static */
+wxTextAttr wxTextAttr::Combine(const wxTextAttr& attr,
+ const wxTextAttr& attrDef,
+ const wxTextCtrlBase *text)
+{
+ wxFont font = attr.GetFont();
+ if ( !font.Ok() )
+ {
+ font = attrDef.GetFont();
+
+ if ( text && !font.Ok() )
+ font = text->GetFont();
+ }
+
+ wxColour colFg = attr.GetTextColour();
+ if ( !colFg.Ok() )
+ {
+ colFg = attrDef.GetTextColour();
+
+ if ( text && !colFg.Ok() )
+ colFg = text->GetForegroundColour();
+ }
+
+ wxColour colBg = attr.GetBackgroundColour();
+ if ( !colBg.Ok() )
+ {
+ colBg = attrDef.GetBackgroundColour();
+
+ if ( text && !colBg.Ok() )
+ colBg = text->GetBackgroundColour();
+ }
+
+ return wxTextAttr(colFg, colBg, font);
+}
+