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

List:       kde-commits
Subject:    branches/KDE/3.5/kdelibs/kate/part
From:       Christoph Cullmann <cullmann () kde ! org>
Date:       2005-08-02 15:52:57
Message-ID: 1122997977.487364.23581.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 442403 by cullmann:

bit cleanup up bugfix for BUG 109017


 M  +1 -8      katetextline.cpp  
 M  +20 -12    katetextline.h  


--- branches/KDE/3.5/kdelibs/kate/part/katetextline.cpp #442402:442403
@@ -28,7 +28,7 @@
 #include <qregexp.h>
 
 KateTextLine::KateTextLine ()
-  : m_noIndentationBasedFolding(false),m_noIndentationBasedFoldingAtStart(false),m_flags(0)
 +  : m_flags(0)
 {
 }
 
@@ -343,9 +343,6 @@
   memcpy(buf, (char *)m_indentationDepth.data(), sizeof(unsigned short) * lind);
   buf += sizeof (unsigned short) * lind;
 
-  memcpy(buf, (bool *)m_noIndentationBasedFolding, sizeof(bool));
-  buf += sizeof (bool);
-
   return buf;
 }
 
@@ -406,10 +403,6 @@
   m_indentationDepth.duplicate ((unsigned short *) buf, lind);
   buf += sizeof(unsigned short) * lind;
 
-  bool nibf;
-  memcpy((bool *) &nibf, buf, sizeof(bool));
-  m_noIndentationBasedFolding=nibf;
-  buf += sizeof(bool);
   return buf;
 }
 
--- branches/KDE/3.5/kdelibs/kate/part/katetextline.h #442402:442403
@@ -52,10 +52,12 @@
      */
     enum Flags
     {
-      flagNoOtherData = 0x1, // ONLY INTERNAL USE, NEVER EVER SET THAT !!!!
-      flagHlContinue = 0x2,
-      flagAutoWrapped = 0x4,
-      flagFoldingColumnsOutdated=0x8
+      flagNoOtherData = 1, // ONLY INTERNAL USE, NEVER EVER SET THAT !!!!
+      flagHlContinue = 2,
+      flagAutoWrapped = 4,
+      flagFoldingColumnsOutdated = 8,
+      flagNoIndentationBasedFolding = 16,
+      flagNoIndentationBasedFoldingAtStart = 32
     };
 
   public:
@@ -281,8 +283,8 @@
     /**
      * @return true if any context at the line end has the noIndentBasedFolding flag \
                set 
      */
-    inline const bool noIndentBasedFolding() const { return \
                m_noIndentationBasedFolding;};
-    inline const bool noIndentBasedFoldingAtStart() const { return \
m_noIndentationBasedFoldingAtStart;}; +    inline const bool noIndentBasedFolding() \
const { return m_flags & KateTextLine::flagNoIndentationBasedFolding; }; +    inline \
const bool noIndentBasedFoldingAtStart() const { return m_flags & \
KateTextLine::flagNoIndentationBasedFoldingAtStart; };  /**
      * folding list
      * @return folding array
@@ -346,8 +348,18 @@
     /**
      * sets if for the next line indent based folding should be disabled
      */
-    inline void setNoIndentBasedFolding(bool val) {m_noIndentationBasedFolding=val; \
                }
-    inline void setNoIndentBasedFoldingAtStart(bool val) \
{m_noIndentationBasedFoldingAtStart=val; } +    inline void \
setNoIndentBasedFolding(bool val) +    {
+      if (val) m_flags = m_flags | KateTextLine::flagNoIndentationBasedFolding;
+      else m_flags = m_flags & ~ KateTextLine::flagNoIndentationBasedFolding;
+    }
+
+    inline void setNoIndentBasedFoldingAtStart(bool val)
+    {
+      if (val) m_flags = m_flags | \
KateTextLine::flagNoIndentationBasedFoldingAtStart; +      else m_flags = m_flags & ~ \
KateTextLine::flagNoIndentationBasedFoldingAtStart; +    }
+
     /**
      * update folding list
      * @param val new folding list
@@ -380,7 +392,6 @@
                        + (m_ctx.size() * sizeof(short))
                        + (m_foldingList.size() * sizeof(uint))
                        + (m_indentationDepth.size() * sizeof(unsigned short))
-                       + sizeof(bool)
                      ) : 0
                  )
              );
@@ -434,9 +445,6 @@
      */
     QMemArray<unsigned short> m_indentationDepth;
 
-    bool m_noIndentationBasedFolding;
-    bool m_noIndentationBasedFoldingAtStart;
-
     /**
      * flags
      */


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

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