/////////////////////////////////////////////////////////////////////
class Encoding;
-class LyXLayout;
+class Layout;
class Paragraph::Pimpl {
pos_type & i,
unsigned int & column,
Font const & font,
- LyXLayout const & style);
+ Layout const & style);
///
void simpleTeXSpecialChars(Buffer const &, BufferParams const &,
odocstream &,
Font const & outerfont,
bool & open_font,
Change::Type & running_change,
- LyXLayout const & style,
+ Layout const & style,
pos_type & i,
unsigned int & column, value_type const c);
///
void validate(LaTeXFeatures & features,
- LyXLayout const & layout) const;
+ Layout const & layout) const;
///
unsigned int id_;
pos_type & i,
unsigned int & column,
Font const & font,
- LyXLayout const & style)
+ Layout const & style)
{
if (style.pass_thru)
return false;
Font const & outerfont,
bool & open_font,
Change::Type & running_change,
- LyXLayout const & style,
+ Layout const & style,
pos_type & i,
unsigned int & column,
value_type const c)
} else {
if (open_font) {
column += running_font.latexWriteEndChanges(
- os, basefont, basefont);
+ os, bparams, runparams,
+ basefont, basefont);
open_font = false;
}
// some insets cannot be inside a font change command
if (open_font && inset->noFontChange()) {
column += running_font.latexWriteEndChanges(
- os, basefont, basefont);
+ os, bparams, runparams,
+ basefont, basefont);
open_font = false;
basefont = owner_->getLayoutFont(bparams, outerfont);
running_font = basefont;
void Paragraph::Pimpl::validate(LaTeXFeatures & features,
- LyXLayout const & layout) const
+ Layout const & layout) const
{
BufferParams const & bparams = features.bufferParams();
{
features.useLanguage(language);
LYXERR(Debug::LATEX) << "Found language "
- << language->babel() << endl;
+ << language->lang() << endl;
}
}
// Gets the fully instantiated font at a given position in a paragraph
-// This is basically the same function as LyXText::GetFont() in text2.cpp.
+// This is basically the same function as Text::GetFont() in text2.cpp.
// The difference is that this one is used for generating the LaTeX file,
// and thus cosmetic "improvements" are disallowed: This has to deliver
// the true picture of the buffer. (Asger)
{
BOOST_ASSERT(pos >= 0);
- LyXLayout_ptr const & lout = layout();
+ Layout_ptr const & lout = layout();
pos_type const body_pos = beginOfBody();
}
-docstring Paragraph::expandLabel(LyXLayout_ptr const & layout,
+docstring Paragraph::expandLabel(Layout_ptr const & layout,
BufferParams const & bparams, bool process_appendix) const
{
- LyXTextClass const & tclass = bparams.getLyXTextClass();
+ TextClass const & tclass = bparams.getTextClass();
docstring fmt;
if (process_appendix && params().appendix())
}
-void Paragraph::applyLayout(LyXLayout_ptr const & new_layout)
+void Paragraph::applyLayout(Layout_ptr const & new_layout)
{
layout(new_layout);
params().labelWidthString(docstring());
bool return_value = false;
- LyXLayout_ptr style;
+ Layout_ptr style;
// well we have to check if we are in an inset with unlimited
// length (all in one row) if that is true then we don't allow
bool asdefault = forceDefaultParagraphs();
if (asdefault) {
- style = bparams.getLyXTextClass().defaultLayout();
+ style = bparams.getTextClass().defaultLayout();
} else {
style = layout();
}
if (body_pos > 0) {
if (open_font) {
column += running_font.latexWriteEndChanges(
- os, basefont, basefont);
+ os, bparams, runparams,
+ basefont, basefont);
open_font = false;
}
basefont = getLayoutFont(bparams, outerfont);
font.language() != running_font.language()))
{
column += running_font.latexWriteEndChanges(
- os, basefont,
+ os, bparams, runparams, basefont,
(i == body_pos-1) ? basefont : font);
running_font = basefont;
open_font = false;
}
// Switch file encoding if necessary
- int const count = switchEncoding(os, bparams,
- runparams.moving_arg, *(runparams.encoding),
- *(font.language()->encoding()));
- if (count > 0) {
- column += count;
- runparams.encoding = font.language()->encoding();
+ if (runparams.encoding->package() == Encoding::inputenc &&
+ font.language()->encoding()->package() == Encoding::inputenc) {
+ int const count = switchEncoding(os, bparams,
+ runparams.moving_arg, *(runparams.encoding),
+ *(font.language()->encoding()));
+ if (count > 0) {
+ column += count;
+ runparams.encoding = font.language()->encoding();
+ }
}
// Do we need to change font?
font.language() != running_font.language()) &&
i != body_pos - 1)
{
- column += font.latexWriteStartChanges(os, basefont,
+ column += font.latexWriteStartChanges(os, bparams,
+ runparams, basefont,
last_font);
running_font = font;
open_font = true;
#ifdef FIXED_LANGUAGE_END_DETECTION
if (next_) {
running_font
- .latexWriteEndChanges(os, basefont,
+ .latexWriteEndChanges(os, bparams, runparams,
+ basefont,
next_->getFont(bparams, 0, outerfont));
} else {
- running_font.latexWriteEndChanges(os, basefont,
- basefont);
+ running_font.latexWriteEndChanges(os, bparams,
+ runparams, basefont, basefont);
}
#else
#ifdef WITH_WARNINGS
//#warning there as we start another \selectlanguage with the next paragraph if
//#warning we are in need of this. This should be fixed sometime (Jug)
#endif
- running_font.latexWriteEndChanges(os, basefont, basefont);
+ running_font.latexWriteEndChanges(os, bparams, runparams,
+ basefont, basefont);
#endif
}
{
bool emph_flag = false;
- LyXLayout_ptr const & style = layout();
+ Layout_ptr const & style = layout();
Font font_old =
style->labeltype == LABEL_MANUAL ? style->labelfont : style->font;
}
-LyXLayout_ptr const & Paragraph::layout() const
+Layout_ptr const & Paragraph::layout() const
{
return layout_;
}
-void Paragraph::layout(LyXLayout_ptr const & new_layout)
+void Paragraph::layout(Layout_ptr const & new_layout)
{
layout_ = new_layout;
}