]> git.lyx.org Git - features.git/commitdiff
[Bugs 3461 and 3630] Allow real_current_font to be reset in Text::setFont even when...
authorRichard Heck <rgheck@comcast.net>
Thu, 17 May 2007 12:17:38 +0000 (12:17 +0000)
committerRichard Heck <rgheck@comcast.net>
Thu, 17 May 2007 12:17:38 +0000 (12:17 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18382 a592a061-630c-0410-9148-cb99ea01b6c8

src/Text2.cpp

index d7af2bafc80df3a4c9f439509f08b20a30533b5f..e893889a299eefd7fd87a38daa3952d65746ada5 100644 (file)
@@ -437,29 +437,29 @@ void Text::changeDepth(Cursor & cur, DEPTH_CHANGE type)
 void Text::setFont(Cursor & cur, Font const & font, bool toggleall)
 {
        BOOST_ASSERT(this == cur.text());
-       // if there is no selection just set the current_font
-       if (!cur.selection()) {
-               // Determine basis font
-               Font layoutfont;
-               pit_type pit = cur.pit();
-               if (cur.pos() < pars_[pit].beginOfBody())
-                       layoutfont = getLabelFont(cur.buffer(), pars_[pit]);
-               else
-                       layoutfont = getLayoutFont(cur.buffer(), pit);
+       // Set the current_font
+       // Determine basis font
+       Font layoutfont;
+       pit_type pit = cur.pit();
+       if (cur.pos() < pars_[pit].beginOfBody())
+               layoutfont = getLabelFont(cur.buffer(), pars_[pit]);
+       else
+               layoutfont = getLayoutFont(cur.buffer(), pit);
 
-               // Update current font
-               real_current_font.update(font,
-                                        cur.buffer().params().language,
-                                        toggleall);
+       // Update current font
+       real_current_font.update(font,
+                                       cur.buffer().params().language,
+                                       toggleall);
 
-               // Reduce to implicit settings
-               current_font = real_current_font;
-               current_font.reduce(layoutfont);
-               // And resolve it completely
-               real_current_font.realize(layoutfont);
+       // Reduce to implicit settings
+       current_font = real_current_font;
+       current_font.reduce(layoutfont);
+       // And resolve it completely
+       real_current_font.realize(layoutfont);
 
+       // if there is no selection that's all we need to do 
+       if (!cur.selection())
                return;
-       }
 
        // Ok, we have a selection.
        recordUndoSelection(cur);