[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-bugs-dist
Subject:    [Bug 117479] Changes to"highlighting text styles" colors not
From:       Dominik Haumann <dhdev () gmx ! de>
Date:       2006-06-28 8:53:20
Message-ID: 20060628085320.16795.qmail () ktown ! kde ! org
[Download RAW message or body]

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
         
http://bugs.kde.org/show_bug.cgi?id=117479         




------- Additional Comments From dhdev gmx de  2006-06-28 10:53 -------
SVN commit 555680 by dhaumann:

forward port SVN commit 511726 by alund:

Make updateStyle() work: colors can be unset, and so can other items if we
reset to default (oh, and call it too in the latter case)

CCBUG: 117479


 M  +11 -0     katestyletreewidget.cpp  


--- trunk/KDE/kdelibs/kate/part/katestyletreewidget.cpp #555679:555680
 @ -464,54 +464,63  @
     if ( currentStyle->fontWeight() != actualStyle->fontWeight())
       actualStyle->setFontWeight( currentStyle->fontWeight() );
   }
+  else actualStyle->clearProperty( QTextFormat::FontWeight );
 
   if ( currentStyle->hasProperty(QTextFormat::FontItalic) )
   {
     if ( currentStyle->fontItalic() != actualStyle->fontItalic())
       actualStyle->setFontItalic( currentStyle->fontItalic() );
   }
+  else actualStyle->clearProperty( QTextFormat::FontItalic );
 
   if ( currentStyle->hasProperty(QTextFormat::FontStrikeOut) )
   {
     if ( currentStyle->fontStrikeOut() != actualStyle->fontStrikeOut())
       actualStyle->setFontStrikeOut( currentStyle->fontStrikeOut() );
   }
+  else actualStyle->clearProperty( QTextFormat::FontStrikeOut );
 
   if ( currentStyle->hasProperty(QTextFormat::FontUnderline) )
   {
     if ( currentStyle->fontUnderline() != actualStyle->fontUnderline())
       actualStyle->setFontUnderline( currentStyle->fontUnderline() );
   }
+  else actualStyle->clearProperty( QTextFormat::FontUnderline );
 
   if ( currentStyle->hasProperty(KTextEditor::Attribute::Outline) )
   {
     if ( currentStyle->outline() != actualStyle->outline())
       actualStyle->setOutline( currentStyle->outline() );
   }
+  else actualStyle->clearProperty( KTextEditor::Attribute::Outline );
 
   if ( currentStyle->hasProperty(QTextFormat::ForegroundBrush) )
   {
     if ( currentStyle->foreground() != actualStyle->foreground())
       actualStyle->setForeground( currentStyle->foreground() );
   }
+  else actualStyle->clearProperty( QTextFormat::ForegroundBrush );
 
   if ( currentStyle->hasProperty(KTextEditor::Attribute::SelectedForeground) )
   {
     if ( currentStyle->selectedForeground() != actualStyle->selectedForeground())
       actualStyle->setSelectedForeground( currentStyle->selectedForeground() );
   }
+  else actualStyle->clearProperty( KTextEditor::Attribute::SelectedForeground );
 
   if ( currentStyle->hasProperty(QTextFormat::BackgroundBrush) )
   {
     if ( currentStyle->background() != actualStyle->background())
       actualStyle->setBackground( currentStyle->background() );
   }
+  else actualStyle->clearProperty( QTextFormat::BackgroundBrush );
 
   if ( currentStyle->hasProperty(KTextEditor::Attribute::SelectedBackground) )
   {
     if ( currentStyle->selectedBackground() != actualStyle->selectedBackground())
       actualStyle->setSelectedBackground( currentStyle->selectedBackground() );
   }
+  else actualStyle->clearProperty( KTextEditor::Attribute::SelectedBackground );
 }
 
 /* only true for a hl mode item using it's default style */
 @ -550,6 +559,7  @
   }
   else {
     currentStyle = KTextEditor::Attribute::Ptr(new KTextEditor::Attribute( *defaultStyle ));
+    updateStyle();
     //FIXME
     //repaint();
   }
 @ -645,6 +655,7  @
     currentStyle->clearProperty(QTextFormat::BackgroundBrush);
   else if ( c == 101 && currentStyle->hasProperty(KTextEditor::Attribute::SelectedBackground) )
     currentStyle->clearProperty(KTextEditor::Attribute::SelectedBackground);
+  updateStyle();
 }
 
 KateStyleTreeWidget* KateStyleTreeWidgetItem::treeWidget() const
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic