From b16c7bca00a5e829b4bb80d0781da84ea5c9f1fb Mon Sep 17 00:00:00 2001 From: =?utf8?q?Lars=20Gullik=20Bj=C3=B8nnes?= Date: Wed, 24 May 2000 19:02:41 +0000 Subject: [PATCH] small bullet patch from dekel git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@769 a592a061-630c-0410-9148-cb99ea01b6c8 --- ChangeLog | 4 ++++ src/Bullet.C | 4 ++-- src/Bullet.h | 19 +++++-------------- 3 files changed, 11 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9dae073c3c..3306bbde7b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2000-05-09 Dekel Tsur + + * src/Bullet.[Ch]: Fixed a small bug. + 2000-05-21 Dekel Tsur * src/paragraph.C (String): Several fixes/improvements diff --git a/src/Bullet.C b/src/Bullet.C index 07665ea046..70b842608a 100644 --- a/src/Bullet.C +++ b/src/Bullet.C @@ -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 diff --git a/src/Bullet.h b/src/Bullet.h index c4c8203f8b..446f18b1e5 100644 --- a/src/Bullet.h +++ b/src/Bullet.h @@ -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(); } -- 2.39.2