]> git.lyx.org Git - features.git/commitdiff
Buffer: Make setExportStatus a private member
authorVincent van Ravesteijn <vfr@lyx.org>
Sun, 30 Oct 2011 11:43:45 +0000 (11:43 +0000)
committerVincent van Ravesteijn <vfr@lyx.org>
Sun, 30 Oct 2011 11:43:45 +0000 (11:43 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40088 a592a061-630c-0410-9148-cb99ea01b6c8

src/Buffer.cpp
src/Buffer.h

index bc86f8a5bf866618b57dcbcd8e1894f5596f5d56..6f4bf30aff9b6767bfd3d49c79b406bbdadcee92 100644 (file)
@@ -3475,23 +3475,22 @@ bool Buffer::autoSave() const
 }
 
 
-namespace {
-       // helper class, to guarantee this gets reset properly
-       class MarkAsExporting   {
-       public:
-               MarkAsExporting(Buffer const * buf) : buf_(buf) 
-               {
-                       LASSERT(buf_, /* */);
-                       buf_->setExportStatus(true);
-               }
-               ~MarkAsExporting() 
-               {
-                       buf_->setExportStatus(false);
-               }
-       private:
-               Buffer const * const buf_;
-       };
-}
+// helper class, to guarantee this gets reset properly
+class Buffer::MarkAsExporting {
+public:
+       MarkAsExporting(Buffer const * buf) : buf_(buf)
+       {
+               LASSERT(buf_, /* */);
+               buf_->setExportStatus(true);
+       }
+       ~MarkAsExporting()
+       {
+               buf_->setExportStatus(false);
+       }
+private:
+       Buffer const * const buf_;
+};
+
 
 
 void Buffer::setExportStatus(bool e) const
index f4cb22f964a54391fa168d53e870f839a62ea52f..781279b0081c50ed8d19afdd2ce1fc7a8205fef4 100644 (file)
@@ -638,8 +638,6 @@ private:
        ExportStatus preview(std::string const & format, bool includeall = false) const;
 
 public:
-       /// mark the buffer as busy exporting something, or not
-       void setExportStatus(bool e) const;
        ///
        bool isExporting() const;
 
@@ -681,6 +679,11 @@ public:
        void checkChildBuffers();
 
 private:
+       class MarkAsExporting;
+       friend class MarkAsExporting;
+       /// mark the buffer as busy exporting something, or not
+       void setExportStatus(bool e) const;
+
        /// Change name of buffer. Updates "read-only" flag.
        void setFileName(support::FileName const & fname);
        ///