]> git.lyx.org Git - lyx.git/blobdiff - src/Buffer.h
Revert "Fix bug with wrong baseline calculation in last paragraph"
[lyx.git] / src / Buffer.h
index 9535c12341ccc2738c02933741c63816b80458d2..29992f9ae78af32499bef78fffeabe5584137c75 100644 (file)
@@ -15,8 +15,6 @@
 #include "OutputEnums.h"
 #include "OutputParams.h"
 
-#include "insets/InsetCode.h"
-
 #include "support/strfwd.h"
 #include "support/types.h"
 
@@ -94,6 +92,9 @@ typedef std::set<Buffer *> CloneList;
  * minimal, probably not.
  * \author Lars Gullik Bjønnes
  */
+
+class MarkAsExporting;
+
 class Buffer {
 public:
        /// What type of log will \c getLogName() return?
@@ -229,8 +230,7 @@ public:
        /// read a new document from a string
        bool readString(std::string const &);
        /// Reloads the LyX file
-       /// \param clearUndo if false, leave alone the undo stack.
-       ReadStatus reload(bool clearUndo = true);
+       ReadStatus reload();
 //FIXME: The following function should be private
 //private:
        /// read the header, returns number of unknown tokens
@@ -394,7 +394,7 @@ public:
        /// Returns the buffer's filename. It is always an absolute path.
        std::string absFileName() const;
 
-       /// Returns the the path where the buffer lives.
+       /// Returns the path where the buffer lives.
        /// It is always an absolute path.
        std::string filePath() const;
 
@@ -510,6 +510,8 @@ public:
        ///
        BufferParams & params();
        BufferParams const & params() const;
+       ///
+       BufferParams const & masterParams() const;
 
        /** The list of paragraphs.
            This is a linked list of paragraph, this list holds the
@@ -588,12 +590,11 @@ public:
 
        /// Replace the inset contents for insets which InsetCode is equal
        /// to the passed \p inset_code.
-       void changeRefsIfUnique(docstring const & from, docstring const & to,
-               InsetCode code);
+       void changeRefsIfUnique(docstring const & from, docstring const & to);
 
        /// get source code (latex/docbook) for some paragraphs, or all paragraphs
        /// including preamble
-       void getSourceCode(odocstream & os, std::string const format,
+       void getSourceCode(odocstream & os, std::string const format,
                           pit_type par_begin, pit_type par_end, OutputWhat output,
                           bool master) const;
 
@@ -717,7 +718,6 @@ public:
        int charCount(bool with_blanks) const;
 
 private:
-       class MarkAsExporting;
        friend class MarkAsExporting;
        /// mark the buffer as busy exporting something, or not
        void setExportStatus(bool e) const;
@@ -753,6 +753,25 @@ private:
 };
 
 
+/// Helper class, to guarantee that the export status
+/// gets reset properly. To use, simply create a local variable:
+///    MarkAsExporting mex(bufptr);
+/// and leave the rest to us.
+class MarkAsExporting {
+public:
+       MarkAsExporting(Buffer const * buf) : buf_(buf)
+       {
+               buf_->setExportStatus(true);
+       }
+       ~MarkAsExporting()
+       {
+               buf_->setExportStatus(false);
+       }
+private:
+       Buffer const * const buf_;
+};
+
+
 } // namespace lyx
 
 #endif