[gnote] Add is_bullet to NoteBuffer



commit 92bf7ae5345c4874e29d21e0d1b76be6f9976390
Author: Aurimas Ä?ernius <aurisc4 gmail com>
Date:   Tue Jan 25 22:36:24 2011 +0200

    Add is_bullet to NoteBuffer
    
    Add a static method is_bullet to NoteBuffer, that returns true,
    if passed character is a bullet.

 src/notebuffer.cpp |    9 +++++++++
 src/notebuffer.hpp |    2 +-
 2 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/src/notebuffer.cpp b/src/notebuffer.cpp
index 1d2e093..1479724 100644
--- a/src/notebuffer.cpp
+++ b/src/notebuffer.cpp
@@ -40,6 +40,15 @@ namespace gnote {
 #define NUM_INDENT_BULLETS 3
   const gunichar NoteBuffer::s_indent_bullets[NUM_INDENT_BULLETS] = { 0x2022, 0x2218, 0x2023 };
 
+  bool NoteBuffer::is_bullet(gunichar c)
+  {
+    for (int i = 0; i < NUM_INDENT_BULLETS; ++i)
+      if (c == s_indent_bullets[i])
+        return true;
+
+    return false;
+  }
+
   bool NoteBuffer::get_enable_auto_bulleted_lists() const
   {
     return Preferences::obj().get<bool>(Preferences::ENABLE_AUTO_BULLETED_LISTS);
diff --git a/src/notebuffer.hpp b/src/notebuffer.hpp
index 10453a1..911e42c 100644
--- a/src/notebuffer.hpp
+++ b/src/notebuffer.hpp
@@ -107,7 +107,7 @@ public:
   void increase_depth(Gtk::TextIter & start);
   void decrease_depth(Gtk::TextIter & start);
   DepthNoteTag::Ptr find_depth_tag(Gtk::TextIter &);
-
+  static bool is_bullet(gunichar c);
 protected: 
   NoteBuffer(const NoteTagTable::Ptr &, Note &);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]