[gnote/stable-0.7] Initialize buffer before returning text_content



commit 8f4427365c30420be94378654e6219c0ca5fc0bd
Author: Casey Harkins <caseyharkins gmail com>
Date:   Sat Oct 22 14:52:21 2011 +0300

    Initialize buffer before returning text_content
    
    Fixes bug 647888.
    Thanks Casey Harkins.

 src/note.cpp |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/note.cpp b/src/note.cpp
index 25fec06..8563839c 100644
--- a/src/note.cpp
+++ b/src/note.cpp
@@ -1062,10 +1062,10 @@ namespace gnote {
 
   std::string Note::text_content()
   {
-    if(m_buffer) {
-      return m_buffer->get_slice(m_buffer->begin(), m_buffer->end());
+    if(!m_buffer) {
+      get_buffer();
     }
-    return utils::XmlDecoder::decode(xml_content());
+    return m_buffer->get_slice(m_buffer->begin(), m_buffer->end());
   }
 
   void Note::set_text_content(const std::string & text)



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