]> git.lyx.org Git - features.git/commitdiff
small bullet patch from dekel
authorLars Gullik Bjønnes <larsbj@gullik.org>
Wed, 24 May 2000 19:02:41 +0000 (19:02 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Wed, 24 May 2000 19:02:41 +0000 (19:02 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@769 a592a061-630c-0410-9148-cb99ea01b6c8

ChangeLog
src/Bullet.C
src/Bullet.h

index 9dae073c3cba9ff6fb42187f85b114c22de912e0..3306bbde7b8c8c050574512e27172a36b8aeda13 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2000-05-09  Dekel Tsur  <dekel@math.tau.ac.il>
+
+       * src/Bullet.[Ch]: Fixed a small bug.
+
 2000-05-21  Dekel Tsur  <dekel@math.tau.ac.il>
 
        * src/paragraph.C (String): Several fixes/improvements
index 07665ea0467558f948da4835042cc8c08795b24c..70b842608a1b000b34117629e59475a8bb5daf22 100644 (file)
@@ -53,7 +53,7 @@ Bullet::Bullet(int f, int c, int s)
 }
 
 
-string Bullet::getText()
+string const & Bullet::getText() const
 {
        if (user_text == 0) {
                generateText();
@@ -83,7 +83,7 @@ bool operator == (const Bullet & b1, const Bullet & b2)
 /*--------------------Private Member Functions-------------------*/
 
 
-void Bullet::generateText()
+void Bullet::generateText() const
 {
        // Assumption:
        // user hasn't defined their own text and/or I haven't generated
index c4c8203f8bb423c61d4c7a8f618fd2234457da33..446f18b1e5ad5283d0af882e0e7274c800e340d5 100644 (file)
@@ -47,9 +47,7 @@ public:
        ///
        int getSize() const;
        ///
-       string getText() const;
-       ///
-       string getText();
+       string const & getText() const;
        ///
        char const * c_str() const;
        ///
@@ -106,7 +104,7 @@ private:
        };
        
        ///
-       void generateText();
+       void generateText() const;
        ///
        static string bulletSize(short int);
        ///
@@ -126,7 +124,7 @@ private:
            or if I can use it to generate strings (0)
            or have already (-1)
        */
-       short user_text; 
+       mutable short user_text; 
        
        //NOTE: Arranging these four shorts above to be together
        //      like this should ensure they are in a single cache line
@@ -135,7 +133,7 @@ private:
            or one generated internally from the font, character
            and size settings.
        */
-       string text;
+       mutable string text;
 };
 
 
@@ -229,13 +227,6 @@ int Bullet::getSize() const
 }
 
 
-inline
-string Bullet::getText() const
-{
-       return text;
-}
-
-
 inline
 Bullet & Bullet::operator=(Bullet const & b)
 {
@@ -257,7 +248,7 @@ Bullet & Bullet::operator=(Bullet const & b)
 inline
 char const * Bullet::c_str() const
 {
-       return this->getText().c_str();
+       return getText().c_str();
 }