]> git.lyx.org Git - lyx.git/blobdiff - src/buffer.C
Yet another tweak from J�rgen.
[lyx.git] / src / buffer.C
index 0cc738b0ae648a42778cb1968563c57b2aa8007e..3e6a4e3a2b11cf6e0d61de0627490985655117af 100644 (file)
@@ -151,11 +151,11 @@ extern int tex_code_break_column;
 Buffer::Buffer(string const & file, bool ronly)
        : paragraph(0), lyx_clean(true), bak_clean(true),
          unnamed(false), dep_clean(0), read_only(ronly),
-         filename(file), users(0)
+         filename_(file), users(0)
 {
        lyxerr[Debug::INFO] << "Buffer::Buffer()" << endl;
 //     filename = file;
-       filepath = OnlyPath(file);
+       filepath_ = OnlyPath(file);
 //     paragraph = 0;
 //     lyx_clean = true;
 //     bak_clean = true;
@@ -200,7 +200,7 @@ Buffer::~Buffer()
 
 string const Buffer::getLatexName(bool no_path) const
 {
-       string const name = ChangeExtension(MakeLatexName(filename), ".tex");
+       string const name = ChangeExtension(MakeLatexName(fileName()), ".tex");
        if (no_path)
                return OnlyFilename(name);
        else
@@ -273,9 +273,9 @@ void Buffer::resetAutosaveTimers() const
 
 void Buffer::setFileName(string const & newfile)
 {
-       filename = MakeAbsPath(newfile);
-       filepath = OnlyPath(filename);
-       setReadonly(IsFileWriteable(filename) == 0);
+       filename_ = MakeAbsPath(newfile);
+       filepath_ = OnlyPath(filename_);
+       setReadonly(IsFileWriteable(filename_) == 0);
        updateTitles();
 }
 
@@ -1278,10 +1278,10 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par,
                        }
                        InsetMinipage * mini = new InsetMinipage;
                        mini->pos(static_cast<InsetMinipage::Position>(par->params().pextraAlignment()));
-                       mini->width(par->params().pextraWidth());
+                       mini->pageWidth(LyXLength(par->params().pextraWidth()));
                        if (!par->params().pextraWidthp().empty()) {
-                           lyxerr << "WP:" << mini->width() << endl;
-                           mini->width(tostr(par->params().pextraWidthp())+"%");
+                           lyxerr << "WP:" << mini->pageWidth().asString() << endl;
+                           mini->pageWidth(LyXLength((par->params().pextraWidthp())+"%"));
                        }
                        Paragraph * op = mini->firstParagraph();
                        mini->inset.paragraph(par);
@@ -1359,10 +1359,10 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par,
 
                InsetMinipage * mini = new InsetMinipage;
                mini->pos(static_cast<InsetMinipage::Position>(minipar->params().pextraAlignment()));
-               mini->width(minipar->params().pextraWidth());
+               mini->pageWidth(LyXLength(minipar->params().pextraWidth()));
                if (!par->params().pextraWidthp().empty()) {
-                   lyxerr << "WP:" << mini->width() << endl;
-                   mini->width(tostr(par->params().pextraWidthp())+"%");
+                   lyxerr << "WP:" << mini->pageWidth().asString() << endl;
+                   mini->pageWidth(LyXLength((par->params().pextraWidthp())+"%"));
                }
                mini->inset.paragraph(minipar);
                        
@@ -1513,8 +1513,8 @@ void Buffer::readInset(LyXLex & lex, Paragraph *& par,
                } 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
@@ -1702,7 +1702,7 @@ bool Buffer::writeFile(string const & fname, bool flag) const
        // warnings, only cerr.
        // Needed for autosave in background or panic save (Matthias 120496)
 
-       if (read_only && (fname == filename)) {
+       if (read_only && (fname == fileName())) {
                // Here we should come with a question if we should
                // perform the write anyway.
                if (flag)
@@ -2545,15 +2545,15 @@ void Buffer::latexParagraphs(ostream & ofs, Paragraph * par,
                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;
@@ -3449,7 +3449,7 @@ int Buffer::runChktex()
 
        // get LaTeX-Filename
        string const name = getLatexName();
-       string path = OnlyPath(filename);
+       string path = filePath();
 
        string const org_path = path;
        if (lyxrc.use_tempdir || !IsDirWriteable(path)) {
@@ -3466,7 +3466,7 @@ int Buffer::runChktex()
        makeLaTeXFile(name, org_path, false);
 
        TeXErrors terr;
-       Chktex chktex(lyxrc.chktex_command, name, filepath);
+       Chktex chktex(lyxrc.chktex_command, name, filePath());
        int res = chktex.run(terr); // run chktex
 
        if (res == -1) {