[Libreoffice-commits] .: hwpfilter/source

Caolán McNamara caolan at kemper.freedesktop.org
Thu Feb 3 06:45:05 PST 2011


 hwpfilter/source/mzstring.cpp |    6 ++++--
 hwpfilter/source/mzstring.h   |    4 ++--
 2 files changed, 6 insertions(+), 4 deletions(-)

New commits:
commit 25512a3bc725442d96cbb240935cb573d882efa4
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Feb 3 14:45:00 2011 +0000

    fix copy ctor and assignment sigs

diff --git a/hwpfilter/source/mzstring.cpp b/hwpfilter/source/mzstring.cpp
index ee33def..a5610c6 100644
--- a/hwpfilter/source/mzstring.cpp
+++ b/hwpfilter/source/mzstring.cpp
@@ -78,7 +78,7 @@ MzString::~MzString()
 }
 
 
-void MzString::operator = (MzString &s)
+MzString &MzString::operator = (MzString &s)
 {
     int n = s.length();
     if (allocate(n))
@@ -86,10 +86,11 @@ void MzString::operator = (MzString &s)
         if (n > 0) memcpy(Data, s.Data, n);
         Length = n;
     }
+    return *this;
 }
 
 
-void MzString::operator = (const char *s)
+MzString &MzString::operator = (const char *s)
 {
     if (s == NULL)
         s = "";
@@ -99,6 +100,7 @@ void MzString::operator = (const char *s)
         if (n > 0) memcpy(Data, s, n);
         Length = n;
     }
+    return *this;
 }
 
 
diff --git a/hwpfilter/source/mzstring.h b/hwpfilter/source/mzstring.h
index 761df0a..e97f96b 100644
--- a/hwpfilter/source/mzstring.h
+++ b/hwpfilter/source/mzstring.h
@@ -108,8 +108,8 @@ class MzString
         bool      resize(int len);
 
 // Assignment
-        void      operator = (MzString &s);
-        void      operator = (const char *s);
+        MzString  &operator = (MzString &s);
+        MzString  &operator = (const char *s);
 
 // Appending
         MzString  &operator += (char);


More information about the Libreoffice-commits mailing list