]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/textcmn.cpp
Remove documentation of non-existent wxFontMapper::SetConfig().
[wxWidgets.git] / src / common / textcmn.cpp
index 76b0916d21200f1a0b2a56ba0fba8a9ffd928b8c..a3a43e6998cf695fce107a8e2adb3c0ee2314c41 100644 (file)
@@ -164,6 +164,7 @@ void wxTextAttr::Init()
     m_fontStyle = wxFONTSTYLE_NORMAL;
     m_fontWeight = wxFONTWEIGHT_NORMAL;
     m_fontUnderlined = false;
+    m_fontStrikethrough = false;
     m_fontEncoding = wxFONTENCODING_DEFAULT;
     m_fontFamily = wxFONTFAMILY_DEFAULT;
 
@@ -193,6 +194,7 @@ void wxTextAttr::Copy(const wxTextAttr& attr)
     m_fontStyle = attr.m_fontStyle;
     m_fontWeight = attr.m_fontWeight;
     m_fontUnderlined = attr.m_fontUnderlined;
+    m_fontStrikethrough = attr.m_fontStrikethrough;
     m_fontFaceName = attr.m_fontFaceName;
     m_fontEncoding = attr.m_fontEncoding;
     m_fontFamily = attr.m_fontFamily;
@@ -403,6 +405,10 @@ wxFont wxTextAttr::GetFont() const
     if (HasFontUnderlined())
         underlined = GetFontUnderlined();
 
+    bool strikethrough = false;
+    if ( HasFontStrikethrough() )
+        strikethrough = GetFontStrikethrough();
+
     wxString fontFaceName;
     if (HasFontFaceName())
         fontFaceName = GetFontFaceName();
@@ -416,6 +422,8 @@ wxFont wxTextAttr::GetFont() const
         fontFamily = GetFontFamily();
 
     wxFont font(fontSize, fontFamily, fontStyle, fontWeight, underlined, fontFaceName, encoding);
+    if ( strikethrough )
+        font.SetStrikethrough( true );
     return font;
 }
 
@@ -437,6 +445,9 @@ bool wxTextAttr::GetFontAttributes(const wxFont& font, int flags)
     if (flags & wxTEXT_ATTR_FONT_UNDERLINE)
         m_fontUnderlined = font.GetUnderlined();
 
+    if (flags & wxTEXT_ATTR_FONT_STRIKETHROUGH)
+        m_fontStrikethrough = font.GetStrikethrough();
+
     if (flags & wxTEXT_ATTR_FONT_FACE)
         m_fontFaceName = font.GetFaceName();
 
@@ -500,6 +511,12 @@ bool wxTextAttr::Apply(const wxTextAttr& style, const wxTextAttr* compareWith)
             destStyle.SetFontUnderlined(style.GetFontUnderlined());
     }
 
+    if (style.HasFontStrikethrough())
+    {
+        if (!(compareWith && compareWith->HasFontStrikethrough() && compareWith->GetFontStrikethrough() == style.GetFontStrikethrough()))
+            destStyle.SetFontStrikethrough(style.GetFontStrikethrough());
+    }
+
     if (style.HasFontFaceName())
     {
         if (!(compareWith && compareWith->HasFontFaceName() && compareWith->GetFontFaceName() == style.GetFontFaceName()))
@@ -773,7 +790,7 @@ bool wxTextAttr::BitlistsEqPartial(int valueA, int valueB, int flags)
 {
     int relevantBitsA = valueA & flags;
     int relevantBitsB = valueB & flags;
-    return (relevantBitsA != relevantBitsB);
+    return relevantBitsA == relevantBitsB;
 }
 
 /// Split into paragraph and character styles