- if (minipage_open && par && !style.isEnvironment() &&
- (par->pextra_type == PEXTRA_MINIPAGE) &&
- par->pextra_start_minipage) {
- os << "\\end{minipage}\n";
- texrow.newline();
- if (par_sep == BufferParams::PARSEP_INDENT) {
- os << "}\n";
- texrow.newline();
- }
- minipage_open = false;
- }
- if (par && par->depth > depth) {
- if (textclasslist.Style(bparams.textclass,
- par->layout).isParagraph()
- // Thinko!
- // How to handle this? (Lgb)
- //&& !suffixIs(os, "\n\n")
- ) {
- // There should be at least one '\n' already
- // but we need there to be two for Standard
- // paragraphs that are depth-increment'ed to be
- // output correctly. However, tables can
- // also be paragraphs so don't adjust them.
- // ARRae
- // Thinkee:
- // Will it ever harm to have one '\n' too
- // many? i.e. that we sometimes will have
- // three in a row. (Lgb)
- os << '\n';
- texrow.newline();
- }
- par = par->TeXDeeper(buf, bparams, os, texrow
-#ifndef NEW_INSETS
- ,foot, foot_texrow, foot_count
-#endif
- );
- }
- if (par && par->layout == layout && par->depth == depth &&
- (par->pextra_type == PEXTRA_MINIPAGE) && !minipage_open) {
- if (par->pextra_hfill && par->Previous() &&
- (par->Previous()->pextra_type == PEXTRA_MINIPAGE)){
- os << "\\hfill{}\n";
- texrow.newline();
- }
- if (par_sep == BufferParams::PARSEP_INDENT) {
- os << "{\\setlength\\parindent{0pt}\n";
- texrow.newline();
- }
- os << "\\begin{minipage}";
- switch (par->pextra_alignment) {
- case MINIPAGE_ALIGN_TOP:
- os << "[t]";
- break;
- case MINIPAGE_ALIGN_MIDDLE:
- os << "[m]";
- break;
- case MINIPAGE_ALIGN_BOTTOM:
- os << "[b]";
- break;
- }
- if (!par->pextra_width.empty()) {
- os << '{' << par->pextra_width << "}\n";
- } else {
- //float ib = atof(par->pextra_widthp.c_str())/100;
- // string can't handle floats at present
- // so I'll do a conversion by hand knowing that
- // the limits are 0.0 to 1.0. ARRae.
- os << '{';
- switch (par->pextra_widthp.length()) {
- case 3:
- os << "1.00";
- break;
- case 2:
- os << "0." << par->pextra_widthp;
- break;
- case 1:
- os << "0.0" << par->pextra_widthp;
- }
- os << "\\columnwidth}\n";
- }
- texrow.newline();
- if (par_sep == BufferParams::PARSEP_INDENT) {
- os << "\\setlength\\parindent{\\LyXMinipageIndent}\n";
- texrow.newline();
- }
- minipage_open = true;
- minipage_open_depth = par->depth;
- }
- } while (par
- && par->layout == layout
- && par->depth == depth
- && par->pextra_type == pextra_type
-#ifndef NEW_INSETS
- && par->footnoteflag == footnoteflag
-#endif
- );
-
- if (style.isEnvironment()) {
- os << "\\end{" << style.latexname() << '}';
-#ifndef NEW_INSETS
- // maybe this should go after the minipage closes?
- if (foot_this_level) {
- if (foot_count >= 1) {
- if (foot_count > 1) {
- os << "\\addtocounter{footnote}{-"
- << foot_count - 1
- << '}';
- }
- os << foot;
- texrow += foot_texrow;
- foot.clear();
- foot_texrow.reset();
- foot_count = 0;
- }
+
+bool Paragraph::isRightToLeftPar(BufferParams const & bparams) const
+{
+ return lyxrc.rtl_support
+ && getParLanguage(bparams)->RightToLeft();
+}
+
+
+void Paragraph::changeLanguage(BufferParams const & bparams,
+ Language const * from, Language const * to)
+{
+ for (pos_type i = 0; i < size(); ++i) {
+ LyXFont font = getFontSettings(bparams, i);
+ if (font.language() == from) {
+ font.setLanguage(to);
+ setFont(i, font);