]> git.lyx.org Git - features.git/blobdiff - src/Paragraph.cpp
DocBook: make openParTag/closeTag use paragraphs instead of layouts.
[features.git] / src / Paragraph.cpp
index fa62e257c17b44524639a5e3c1b20135b47b9c10..f2d97fe7c97cb9dbc60eac15e39e056391b14ec8 100644 (file)
@@ -2393,8 +2393,9 @@ void Paragraph::latex(BufferParams const & bparams,
        pos_type body_pos = beginOfBody();
        unsigned int column = 0;
 
-       // If we are inside an inset, the real outerfont is local_font
-       Font const real_outerfont = (runparams.local_font != nullptr)
+       // If we are inside an non inheritFont() inset, the real outerfont is local_font
+       Font const real_outerfont = (!inInset().inheritFont()
+                                    && runparams.local_font != nullptr)
                        ? Font(runparams.local_font->fontInfo()) : outerfont;
 
        if (body_pos > 0) {
@@ -2558,7 +2559,7 @@ void Paragraph::latex(BufferParams const & bparams,
                ++column;
 
                // Fully instantiated font
-               Font const current_font = getFont(bparams, i, real_outerfont);
+               Font const current_font = getFont(bparams, i, outerfont);
 
                Font const last_font = running_font;
                bool const in_ct_deletion = (bparams.output_changes
@@ -3122,7 +3123,7 @@ struct DocBookFontState
 std::tuple<vector<xml::FontTag>, vector<xml::EndFontTag>> computeDocBookFontSwitch(FontInfo const & font_old,
                                                                                           Font const & font,
                                                                                           std::string const & default_family,
-                                                                                          DocBookFontState fs)
+                                                                                          DocBookFontState fs)
 {
        vector<xml::FontTag> tagsToOpen;
        vector<xml::EndFontTag> tagsToClose;
@@ -3147,6 +3148,11 @@ std::tuple<vector<xml::FontTag>, vector<xml::EndFontTag>> computeDocBookFontSwit
        if (font_old.strikeout() != curstate)
                doFontSwitchDocBook(tagsToOpen, tagsToClose, fs.sout_flag, curstate, xml::FT_SOUT);
 
+       // xout
+       curstate = font.fontInfo().xout();
+       if (font_old.xout() != curstate)
+               doFontSwitchDocBook(tagsToOpen, tagsToClose, fs.xout_flag, curstate, xml::FT_XOUT);
+
        // double underbar
        curstate = font.fontInfo().uuline();
        if (font_old.uuline() != curstate)
@@ -3169,16 +3175,14 @@ std::tuple<vector<xml::FontTag>, vector<xml::EndFontTag>> computeDocBookFontSwit
        if (old_fs != fs.curr_fs) {
                if (fs.shap_flag) {
                        OptionalFontType tag = fontShapeToXml(old_fs);
-                       if (tag.has_value) {
+                       if (tag.has_value)
                                tagsToClose.push_back(docbookEndFontTag(tag.ft));
-                       }
                        fs.shap_flag = false;
                }
 
                OptionalFontType tag = fontShapeToXml(fs.curr_fs);
-               if (tag.has_value) {
+               if (tag.has_value)
                        tagsToOpen.push_back(docbookStartFontTag(tag.ft));
-               }
        }
 
        // Font family
@@ -3187,9 +3191,8 @@ std::tuple<vector<xml::FontTag>, vector<xml::EndFontTag>> computeDocBookFontSwit
        if (old_fam != fs.curr_fam) {
                if (fs.faml_flag) {
                        OptionalFontType tag = fontFamilyToXml(old_fam);
-                       if (tag.has_value) {
+                       if (tag.has_value)
                                tagsToClose.push_back(docbookEndFontTag(tag.ft));
-                       }
                        fs.faml_flag = false;
                }
                switch (fs.curr_fam) {
@@ -3228,9 +3231,8 @@ std::tuple<vector<xml::FontTag>, vector<xml::EndFontTag>> computeDocBookFontSwit
        if (old_size != fs.curr_size) {
                if (fs.size_flag) {
                        OptionalFontType tag = fontSizeToXml(old_size);
-                       if (tag.has_value) {
+                       if (tag.has_value)
                                tagsToClose.push_back(docbookEndFontTag(tag.ft));
-                       }
                        fs.size_flag = false;
                }
 
@@ -3244,7 +3246,7 @@ std::tuple<vector<xml::FontTag>, vector<xml::EndFontTag>> computeDocBookFontSwit
        return std::tuple<vector<xml::FontTag>, vector<xml::EndFontTag>>(tagsToOpen, tagsToClose);
 }
 
-}// anonymous namespace
+} // anonymous namespace
 
 
 void Paragraph::simpleDocBookOnePar(Buffer const & buf,