]> git.lyx.org Git - features.git/commitdiff
fix insertion of insets in non english doc; use native syntax for accellerators in...
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 5 Aug 2004 15:14:29 +0000 (15:14 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 5 Aug 2004 15:14:29 +0000 (15:14 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8870 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/kbsequence.C
src/paragraph.C
src/paragraph.h
src/paragraph_pimpl.C
src/paragraph_pimpl.h
src/text.C

index 898931c72be171b154757a0d789a646391534f0c..210ceb18b6c151c874e0134efdb00223d74fd703 100644 (file)
@@ -1,3 +1,18 @@
+2004-08-05  Jean-Marc Lasgouttes  <lasgouttes@lyx.org>
+
+       * 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  <lasgouttes@lyx.org>
 
        * outputparams.h: add new members intitle and lang.
index ffe1661c5b562dc05d1cf60df5f9e9e068c57a21..0d701cdb28ea982ad740bf828fecd98f9f4d7287 100644 (file)
@@ -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) {
index 1a6cdfc35a5a61713500709dde8b7fd92b9414e3..18bcfb9a275bd0155cf9f0d7562d9d9f5f462af2 100644 (file)
@@ -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);
 }
 
 
index 8968fb2abf2633b3557cffadb1ca4a3f0839beb5..155ee497f0edf8359777f15501a505616c00c4de 100644 (file)
@@ -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));
index 10460fcaa844b1964d771cfe66c8b979c273a2ae..6792ee42b526f1a44ef05ea07d6f8a1dc42f6670 100644 (file)
@@ -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.
index 08c8c27188d8496295303ccc19afd4e3ddcf71e4..325d0034a844e7fed291bba028f9a4e557e70eba 100644 (file)
@@ -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
index 36e06cf0166138e84201309dc624b5ff0e34e44e..fda8d9a1d6b4c9d56ec4cfbf88f7f379dbcb38bd 100644 (file)
@@ -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;