#include "insets/insettoc.h"
#include "insets/insetparent.h"
#include "insets/insetspecialchar.h"
-#include "insets/figinset.h"
#include "insets/insettext.h"
#include "insets/insetert.h"
#include "insets/insetgraphics.h"
#include "support/filetools.h"
#include "support/path.h"
#include "support/os.h"
-#include "support/syscall.h"
#include "support/lyxlib.h"
#include "support/FileInfo.h"
#include "support/lyxmanip.h"
ErtComp ert_comp;
#endif
+#ifdef WITH_WARNINGS
#warning And _why_ is this here? (Lgb)
+#endif
int unknown_layouts;
int unknown_tokens;
if (!ert_comp.contents.empty()) {
lyxerr[Debug::INSETS] << "ERT contents:\n'"
<< ert_comp.contents << "'" << endl;
- Inset * inset = new InsetERT(ert_comp.contents, true);
+ Inset * inset = new InsetERT(params.language, ert_comp.contents, true);
par->insertInset(pos++, inset, ert_comp.font);
ert_comp.contents.erase();
}
}
} else if (token == "\\added_space_top") {
lex.nextToken();
- par->params().spaceTop(VSpace(lex.getString()));
+ VSpace value = VSpace(lex.getString());
+ if ((value.length().len().value() != 0) ||
+ (value.kind() != VSpace::LENGTH))
+ par->params().spaceTop(value);
} else if (token == "\\added_space_bottom") {
lex.nextToken();
- par->params().spaceBottom(VSpace(lex.getString()));
+ VSpace value = VSpace(lex.getString());
+ if ((value.length().len().value() != 0) ||
+ (value.kind() != VSpace::LENGTH))
+ par->params().spaceBottom(value);
#ifndef NO_COMPABILITY
#ifndef NO_PEXTRA_REALLY
} else if (token == "\\pextra_type") {
}
InsetMinipage * mini = new InsetMinipage;
mini->pos(static_cast<InsetMinipage::Position>(par->params().pextraAlignment()));
- mini->pageWidth(par->params().pextraWidth());
+ mini->pageWidth(LyXLength(par->params().pextraWidth()));
if (!par->params().pextraWidthp().empty()) {
- lyxerr << "WP:" << mini->pageWidth() << endl;
- mini->pageWidth(tostr(par->params().pextraWidthp())+"%");
+ lyxerr << "WP:" << mini->pageWidth().asString() << endl;
+ mini->pageWidth(LyXLength((par->params().pextraWidthp())+"%"));
}
Paragraph * op = mini->firstParagraph();
mini->inset.paragraph(par);
InsetMinipage * mini = new InsetMinipage;
mini->pos(static_cast<InsetMinipage::Position>(minipar->params().pextraAlignment()));
- mini->pageWidth(minipar->params().pextraWidth());
+ mini->pageWidth(LyXLength(minipar->params().pextraWidth()));
if (!par->params().pextraWidthp().empty()) {
- lyxerr << "WP:" << mini->pageWidth() << endl;
- mini->pageWidth(tostr(par->params().pextraWidthp())+"%");
+ lyxerr << "WP:" << mini->pageWidth().asString() << endl;
+ mini->pageWidth(LyXLength((par->params().pextraWidthp())+"%"));
}
mini->inset.paragraph(minipar);
} else if (tmptok == "Formula") {
inset = new InsetFormula;
} else if (tmptok == "Figure") { // Backward compatibility
- inset = new InsetFig(100, 100, *this);
- //inset = new InsetGraphics;
+// inset = new InsetFig(100, 100, *this);
+ inset = new InsetGraphics;
} else if (tmptok == "Graphics") {
inset = new InsetGraphics;
} else if (tmptok == "Info") {// backwards compatibility
} else if (tmptok == "Note") {
inset = new InsetNote;
} else if (tmptok == "Include") {
- InsetCommandParams p( "Include" );
+ InsetCommandParams p("Include");
inset = new InsetInclude(p, *this);
} else if (tmptok == "ERT") {
inset = new InsetERT;
// original_path is set. This is done for usual tex-file, but not
// for nice-latex-file. (Matthias 250696)
if (!only_body) {
- if (!nice){
+ if (!nice) {
// code for usual, NOT nice-latex-file
ofs << "\\batchmode\n"; // changed
// from \nonstopmode
}
string strOptions(options.str().c_str());
- if (!strOptions.empty()){
+ if (!strOptions.empty()) {
strOptions = strip(strOptions, ',');
ofs << '[' << strOptions << ']';
}
if ((in == 0) || !in->forceDefaultParagraphs(in)) {
LyXLayout const & layout =
textclasslist.Style(params.textclass, par->layout);
-
- if (layout.intitle) {
+
+ if (layout.intitle) {
if (already_title) {
lyxerr <<"Error in latexParagraphs: You"
" should not mix title layouts"
" with normal ones." << endl;
} else
was_title = true;
- } else if (was_title && !already_title) {
+ } else if (was_title && !already_title) {
ofs << "\\maketitle\n";
texrow.newline();
already_title = true;
if (par->isInset(0)) {
Inset * inset = par->getInset(0);
Inset::Code lyx_code = inset->lyxCode();
- if (lyx_code == Inset::TOC_CODE){
+ if (lyx_code == Inset::TOC_CODE) {
string const temp = "toc";
sgmlOpenTag(ofs, depth, temp);
_("Error : Wrong depth for"
" LatexType Command.\n"));
- if (!environment_stack[depth].empty()){
+ if (!environment_stack[depth].empty()) {
sgmlCloseTag(ofs, depth,
environment_stack[depth]);
ofs << "</p>";
inline
void reset(PAR_TAG & p1, PAR_TAG const & p2)
{
- p1 = static_cast<PAR_TAG>( p1 & ~p2);
+ p1 = static_cast<PAR_TAG>(p1 & ~p2);
}
} // namespace anon
}
list < PAR_TAG > temp;
- while (!tag_state.empty() && tag_close ) {
+ while (!tag_state.empty() && tag_close) {
PAR_TAG k = tag_state.top();
tag_state.pop();
os << "</" << tag_name(k) << ">";
if (par->isInset(0)) {
Inset * inset = par->getInset(0);
Inset::Code lyx_code = inset->lyxCode();
- if (lyx_code == Inset::LABEL_CODE){
+ if (lyx_code == Inset::LABEL_CODE) {
command_name += " id=\"";
command_name += (static_cast<InsetCommand *>(inset))->getContents();
command_name += "\"";
}
if (environment_stack[depth] != style.latexname()) {
- if(environment_stack.size() == depth + 1) {
+ if (environment_stack.size() == depth + 1) {
environment_stack.push_back("!-- --");
environment_inner.push_back("!-- --");
}
if (style.latextype == LATEX_ENVIRONMENT) {
if (!style.latexparam().empty()) {
- if(style.latexparam() == "CDATA")
+ if (style.latexparam() == "CDATA")
ofs << "<![CDATA[";
else
sgmlOpenTag(ofs, depth + command_depth,
break;
case LATEX_ENVIRONMENT:
if (!style.latexparam().empty()) {
- if(style.latexparam() == "CDATA")
+ if (style.latexparam() == "CDATA")
ofs << "]]>";
else
sgmlCloseTag(ofs, depth + command_depth,
if (font.emph() == LyXFont::ON) {
os << "<emphasis>";
emph_flag = true;
- }else if(i) {
+ } else if (i) {
os << "</emphasis>";
emph_flag = false;
}
}
- if ( par->isInset(i) ) {
+ if (par->isInset(i)) {
Inset * inset = par->getInset(i);
// don't print the inset in position 0 if desc_on == 3 (label)
- if ( i || desc_on != 3)
+ if ( i || desc_on != 3) {
+ if(style.latexparam() == "CDATA")
+ os << "]]>";
inset->docbook(this, os);
+ if(style.latexparam() == "CDATA")
+ os << "<![CDATA[";
+ }
} else {
char c = par->getChar(i);
string sgml_string;
if (style.pass_thru) {
os << c;
- } else if(style.free_spacing || par->isFreeSpacing() || c != ' ') {
+ } else if (style.free_spacing || par->isFreeSpacing() || c != ' ') {
os << sgml_string;
} else if (desc_on ==1) {
++char_line_count;
// <term> not closed...
os << "</term>";
}
- if(style.free_spacing) os << '\n';
+ if (style.free_spacing) os << '\n';
}
// if we removed error insets before we ran chktex or if we inserted
// error insets after we ran chktex, this must be run:
- if (removedErrorInsets || res){
+ if (removedErrorInsets || res) {
users->redraw();
users->fitCursor();
}