From: Lars Gullik Bjønnes Date: Wed, 4 Apr 2001 20:20:42 +0000 (+0000) Subject: optimization after profiling X-Git-Tag: 1.6.10~21343 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=ff367a38b1815c6ee5d85f9ab1b1dee80b3a3fd2;p=features.git optimization after profiling git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1885 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/ChangeLog b/src/ChangeLog index 2cc0328a3a..a5ad3f5c3f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,19 @@ +2001-04-04 Lars Gullik Bjønnes + + * lyxrow.C (par): moved + (height): moved + (next): moved + * lyxrox.h: as inlines here + + * lyxfont.h (shape): moved from lyxfont.C + (emph): moved from lyxfont.C + + * lyxfont.C (LyXFont): use initialization list for all + constructors + (shape): move to lyxfont.h as inline + (emph): move to lyxfont.h as inline + + 2001-04-04 Juergen Vigna * vspace.C: had to include stdio.h for use of sscanf diff --git a/src/lyxfont.C b/src/lyxfont.C index 19b5774ca0..31beb27025 100644 --- a/src/lyxfont.C +++ b/src/lyxfont.C @@ -156,52 +156,38 @@ bool LyXFont::FontBits::operator!=(LyXFont::FontBits const & fb1) const LyXFont::LyXFont() -{ - bits = sane; - lang = default_language; -} + : bits(sane), lang(default_language) +{} LyXFont::LyXFont(LyXFont::FONT_INIT1) -{ - bits = inherit; - lang = default_language; -} + : bits(inherit), lang(default_language) +{} LyXFont::LyXFont(LyXFont::FONT_INIT2) -{ - bits = ignore; - lang = ignore_language; -} + : bits(ignore), lang(ignore_language) +{} LyXFont::LyXFont(LyXFont::FONT_INIT3) -{ - bits = sane; - lang = default_language; -} + : bits(sane), lang(default_language) +{} LyXFont::LyXFont(LyXFont::FONT_INIT1, Language const * l) -{ - bits = inherit; - lang = l; -} + : bits(inherit), lang(l) +{} LyXFont::LyXFont(LyXFont::FONT_INIT2, Language const * l) -{ - bits = ignore; - lang = l; -} + : bits(ignore), lang(l) +{} LyXFont::LyXFont(LyXFont::FONT_INIT3, Language const * l) -{ - bits = sane; - lang = l; -} + : bits(sane), lang(l) +{} LyXFont::FONT_FAMILY LyXFont::family() const @@ -216,24 +202,12 @@ LyXFont::FONT_SERIES LyXFont::series() const } -LyXFont::FONT_SHAPE LyXFont::shape() const -{ - return bits.shape; -} - - LyXFont::FONT_SIZE LyXFont::size() const { return bits.size; } -LyXFont::FONT_MISC_STATE LyXFont::emph() const -{ - return bits.emph; -} - - LyXFont::FONT_MISC_STATE LyXFont::underbar() const { return bits.underbar; diff --git a/src/lyxfont.h b/src/lyxfont.h index 2309eab917..07a0348d80 100644 --- a/src/lyxfont.h +++ b/src/lyxfont.h @@ -368,6 +368,21 @@ private: LyXFont::FONT_MISC_STATE org); }; + +inline +LyXFont::FONT_SHAPE LyXFont::shape() const +{ + return bits.shape; +} + + +inline +LyXFont::FONT_MISC_STATE LyXFont::emph() const +{ + return bits.emph; +} + + /// std::ostream & operator<<(std::ostream &, LyXFont::FONT_MISC_STATE); diff --git a/src/lyxrow.C b/src/lyxrow.C index 539253a3a6..4a90389d9b 100644 --- a/src/lyxrow.C +++ b/src/lyxrow.C @@ -29,18 +29,6 @@ void Row::par(LyXParagraph * p) } -LyXParagraph * Row::par() -{ - return par_; -} - - -LyXParagraph * Row::par() const -{ - return par_; -} - - void Row::pos(LyXParagraph::size_type p) { pos_ = p; @@ -71,12 +59,6 @@ void Row::height(unsigned short h) } -unsigned short Row::height() const -{ - return height_; -} - - void Row::width(unsigned int w) { width_ = w; @@ -119,12 +101,6 @@ void Row::next(Row * r) } -Row * Row::next() const -{ - return next_; -} - - void Row::previous(Row * r) { previous_ = r; diff --git a/src/lyxrow.h b/src/lyxrow.h index 108f925f41..876a61cc44 100644 --- a/src/lyxrow.h +++ b/src/lyxrow.h @@ -83,4 +83,32 @@ private: Row * previous_; }; + +inline +LyXParagraph * Row::par() +{ + return par_; +} + + +inline +LyXParagraph * Row::par() const +{ + return par_; +} + + +inline +unsigned short Row::height() const +{ + return height_; +} + + +inline +Row * Row::next() const +{ + return next_; +} + #endif