X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FBullet.h;h=446f18b1e5ad5283d0af882e0e7274c800e340d5;hb=35cf7dcb2bdfdcda465b69c58465f657c77fd9d7;hp=8aa09dd84fa7ddf8e4c3077f4780b36452b29929;hpb=abb623f7872ba960a92a6d069dcb6aa5add0d8b0;p=lyx.git diff --git a/src/Bullet.h b/src/Bullet.h index 8aa09dd84f..446f18b1e5 100644 --- a/src/Bullet.h +++ b/src/Bullet.h @@ -27,10 +27,10 @@ class Bullet { public: /// - Bullet(const int f = -1, const int c = -1, const int s = -1); + Bullet(int f = -1, int c = -1, int s = -1); /// - Bullet(string const &); + explicit Bullet(string const &); /// void setCharacter(int); @@ -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(); }