From: Jean-Marc Lasgouttes Date: Thu, 5 Aug 2004 15:14:29 +0000 (+0000) Subject: fix insertion of insets in non english doc; use native syntax for accellerators in... X-Git-Tag: 1.6.10~15125 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=f8146681da3247efed4131e1e4b4315f0434d583;p=features.git fix insertion of insets in non english doc; use native syntax for accellerators in lyx-qt git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8870 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/ChangeLog b/src/ChangeLog index 898931c72b..210ceb18b6 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,18 @@ +2004-08-05 Jean-Marc Lasgouttes + + * kbsequence.C (print): use UI native formatting for menu + shortcuts + + * text.C (insertChar): call Paragraph::insertChar with a font + argument (cosmetic) + + * paragraph.C (insertInset, insertChar): the version that takes a + LyXFont argument is now a wrapper around the other one (the + opposite used to be true). + + * paragraph_pimpl.C (insertInset, insertChar): remove the LyXFont + argument. Font setting is done in Paragraph now. + 2004-08-04 Jean-Marc Lasgouttes * outputparams.h: add new members intitle and lang. diff --git a/src/kbsequence.C b/src/kbsequence.C index ffe1661c5b..0d701cdb28 100644 --- a/src/kbsequence.C +++ b/src/kbsequence.C @@ -137,7 +137,7 @@ string const kb_sequence::print() const KeySequence::size_type i, length = sequence.size(); for (i = 0; i < length; ++i) { - buf += kb_keymap::printKeySym(*sequence[i], modifiers[i].first); + buf += sequence[i]->print(modifiers[i].first); // append a blank if (i + 1 < length) { diff --git a/src/paragraph.C b/src/paragraph.C index 1a6cdfc35a..18bcfb9a27 100644 --- a/src/paragraph.C +++ b/src/paragraph.C @@ -278,29 +278,32 @@ bool Paragraph::checkInsertChar(LyXFont &) } -void Paragraph::insertChar(pos_type pos, Paragraph::value_type c) +void Paragraph::insertChar(pos_type pos, Paragraph::value_type c, + Change change) { - insertChar(pos, c, LyXFont(LyXFont::ALL_INHERIT)); + pimpl_->insertChar(pos, c, change); } void Paragraph::insertChar(pos_type pos, Paragraph::value_type c, LyXFont const & font, Change change) { - pimpl_->insertChar(pos, c, font, change); + pimpl_->insertChar(pos, c, change); + setFont(pos, font); } -void Paragraph::insertInset(pos_type pos, InsetBase * inset) +void Paragraph::insertInset(pos_type pos, InsetBase * inset, Change change) { - insertInset(pos, inset, LyXFont(LyXFont::ALL_INHERIT)); + pimpl_->insertInset(pos, inset, change); } void Paragraph::insertInset(pos_type pos, InsetBase * inset, - LyXFont const & font, Change change) + LyXFont const & font, Change change) { - pimpl_->insertInset(pos, inset, font, change); + pimpl_->insertInset(pos, inset, change); + setFont(pos, font); } diff --git a/src/paragraph.h b/src/paragraph.h index 8968fb2abf..155ee497f0 100644 --- a/src/paragraph.h +++ b/src/paragraph.h @@ -284,14 +284,16 @@ public: void insert(lyx::pos_type pos, std::string const & str, LyXFont const & font); /// - void insertChar(lyx::pos_type pos, value_type c); + void insertChar(lyx::pos_type pos, value_type c, + Change change = Change(Change::INSERTED)); /// void insertChar(lyx::pos_type pos, value_type c, LyXFont const &, Change change = Change(Change::INSERTED)); /// bool checkInsertChar(LyXFont &); /// - void insertInset(lyx::pos_type pos, InsetBase * inset); + void insertInset(lyx::pos_type pos, InsetBase * inset, + Change change = Change(Change::INSERTED)); /// void insertInset(lyx::pos_type pos, InsetBase * inset, LyXFont const &, Change change = Change(Change::INSERTED)); diff --git a/src/paragraph_pimpl.C b/src/paragraph_pimpl.C index 10460fcaa8..6792ee42b5 100644 --- a/src/paragraph_pimpl.C +++ b/src/paragraph_pimpl.C @@ -253,8 +253,7 @@ Paragraph::value_type Paragraph::Pimpl::getChar(pos_type pos) const } -void Paragraph::Pimpl::insertChar(pos_type pos, value_type c, - LyXFont const & font, Change change) +void Paragraph::Pimpl::insertChar(pos_type pos, value_type c, Change change) { BOOST_ASSERT(pos <= size()); @@ -267,7 +266,6 @@ void Paragraph::Pimpl::insertChar(pos_type pos, value_type c, if (pos == size()) { // when appending characters, no need to update tables owner_->text_.push_back(c); - owner_->setFont(pos, font); return; } @@ -285,18 +283,16 @@ void Paragraph::Pimpl::insertChar(pos_type pos, value_type c, // Update the insets owner_->insetlist.increasePosAfterPos(pos); - - owner_->setFont(pos, font); } void Paragraph::Pimpl::insertInset(pos_type pos, - InsetBase * inset, LyXFont const & font, Change change) + InsetBase * inset, Change change) { BOOST_ASSERT(inset); BOOST_ASSERT(pos <= size()); - insertChar(pos, META_INSET, font, change); + insertChar(pos, META_INSET, change); BOOST_ASSERT(owner_->text_[pos] == META_INSET); // Add a new entry in the insetlist. diff --git a/src/paragraph_pimpl.h b/src/paragraph_pimpl.h index 08c8c27188..325d0034a8 100644 --- a/src/paragraph_pimpl.h +++ b/src/paragraph_pimpl.h @@ -68,11 +68,9 @@ struct Paragraph::Pimpl { /// void setChar(lyx::pos_type pos, value_type c); /// - void insertChar(lyx::pos_type pos, value_type c, - LyXFont const & font, Change change = Change(Change::INSERTED)); + void insertChar(lyx::pos_type pos, value_type c, Change change); /// - void insertInset(lyx::pos_type pos, InsetBase * inset, - LyXFont const & font, Change change = Change(Change::INSERTED)); + void insertInset(lyx::pos_type pos, InsetBase * inset, Change change); /// definite erase void eraseIntern(lyx::pos_type pos); /// erase the given position. Returns true if it was actually erased diff --git a/src/text.C b/src/text.C index 36e06cf016..fda8d9a1d6 100644 --- a/src/text.C +++ b/src/text.C @@ -1234,8 +1234,7 @@ void LyXText::insertChar(LCursor & cur, char c) } } - par.insertChar(cur.pos(), c); - setCharFont(pit, cur.pos(), rawtmpfont); + par.insertChar(cur.pos(), c, rawtmpfont); current_font = rawtmpfont; real_current_font = realtmpfont;