#include "insets/insetfloatlist.h"
#include "support/filetools.h"
#include "support/path.h"
+#include "support/os.h"
#include "LaTeX.h"
#include "Chktex.h"
#include "LyXView.h"
s = fileName() + '~';
if (!lyxrc.backupdir_path.empty())
s = AddName(lyxrc.backupdir_path,
- subst(CleanupPath(s),'/','!'));
+ subst(os::slashify_path(s),'/','!'));
// Rename is the wrong way of making a backup,
// this is the correct way.
unsigned int linelen) const
{
ostringstream buffer;
- LyXFont font1;
- LyXFont font2;
- Inset const * inset;
- char c;
char depth = 0;
int ltype = 0;
int ltype_depth = 0;
int noparbreak = 0;
int islatex = 0;
if (!par->previous()) {
- /* begins or ends a deeper area ?*/
+ // begins or ends a deeper area ?
if (depth != par->params.depth()) {
if (par->params.depth() > depth) {
while (par->params.depth() > depth) {
}
}
- /* First write the layout */
+ // First write the layout
string const tmp = textclasslist.NameOfLayout(params.textclass, par->layout);
if (tmp == "Itemize") {
ltype = 1;
lyxerr << "Should this ever happen?" << endl;
}
- font1 = LyXFont(LyXFont::ALL_INHERIT, params.language);
+ LyXFont const font1 = LyXFont(LyXFont::ALL_INHERIT, params.language);
for (LyXParagraph::size_type i = 0; i < par->size(); ++i) {
if (!i && !noparbreak) {
if (linelen > 0)
buffer << " ";
currlinelen = depth * 2;
switch (ltype) {
- case 0: /* Standard */
- case 4: /* (Sub)Paragraph */
- case 5: /* Description */
+ case 0: // Standard
+ case 4: // (Sub)Paragraph
+ case 5: // Description
break;
- case 6: /* Abstract */
+ case 6: // Abstract
if (linelen > 0)
buffer << "Abstract\n\n";
else
buffer << "Abstract: ";
break;
- case 7: /* Bibliography */
+ case 7: // Bibliography
if (!ref_printed) {
if (linelen > 0)
buffer << "References\n\n";
currlinelen += (ltype_depth-depth)*2;
}
}
- font2 = par->GetFontSettings(params, i);
+ LyXFont const font2 = par->GetFontSettings(params, i);
if (font1.latex() != font2.latex()) {
if (font2.latex() == LyXFont::OFF)
islatex = 0;
} else {
islatex = 0;
}
- c = par->GetUChar(params, i);
+
+ char c = par->GetUChar(params, i);
if (islatex)
continue;
switch (c) {
case LyXParagraph::META_INSET:
- if ((inset = par->GetInset(i))) {
+ {
+ Inset const * inset = par->GetInset(i);
+ if (inset) {
if (!inset->Ascii(this, buffer)) {
string dummy;
- string s = rsplit(buffer.str().c_str(),
- dummy, '\n');
+ string const s =
+ rsplit(buffer.str().c_str(),
+ dummy, '\n');
currlinelen += s.length();
} else {
// to be sure it breaks paragraph
currlinelen += linelen;
}
}
- break;
+ }
+ break;
+
case LyXParagraph::META_NEWLINE:
if (linelen > 0) {
buffer << "\n";
currlinelen += (ltype_depth - depth) * 2;
}
break;
+
case LyXParagraph::META_HFILL:
buffer << "\t";
break;
+
case '\\':
buffer << "\\";
break;
+
default:
if ((linelen > 0) && (currlinelen > (linelen - 10)) &&
(c == ' ') && ((i + 2) < par->size()))
if (!original_path.empty()) {
ofs << "\\makeatletter\n"
<< "\\def\\input@path{{"
- << original_path << "/}}\n"
+ << os::external_path(original_path) << "/}}\n"
<< "\\makeatother\n";
texrow.newline();
texrow.newline();