[PATCH] kate vi ptr constructors

Adriaan de Groot groot at kde.org
Sat Dec 27 10:10:20 GMT 2008


This is a very peculiar idiom for me, since it does some extra futzing on a 0 
in trying to create a null pointer; but it occurs twice, so there might be 
some secret hidden meaning to it. This patch replaces static_cast by the null 
Ptr constructor.

--- kate/vimode/katevivisualmode.cpp    (revision 901981)
+++ kate/vimode/katevivisualmode.cpp    (working copy)
@@ -50,7 +50,7 @@
 void KateViVisualMode::highlight() const
 {
   // FIXME: HACK to avoid highlight bug: remove highlighing and re-set it
-  highlightRange->setAttribute(static_cast<KTextEditor::Attribute::Ptr>(0));
+  highlightRange->setAttribute(KTextEditor::Attribute::Ptr());
   highlightRange->setAttribute(attribute);

   KTextEditor::Cursor c1 = m_start;
@@ -100,7 +100,7 @@
 void KateViVisualMode::reset()
 {
     // remove highlighting
-    highlightRange-
>setAttribute(static_cast<KTextEditor::Attribute::Ptr>(0));
+    highlightRange->setAttribute(KTextEditor::Attribute::Ptr());

     m_awaitingMotionOrTextObject.push_back( 0 ); // search for text 
objects/mot
ion from char 0


[ade]





More information about the kde-core-devel mailing list