]> git.lyx.org Git - features.git/commitdiff
* Follow Vincent's advice to keep constness. Thanks Vincent.
authorJürgen Spitzmüller <spitz@lyx.org>
Tue, 7 Dec 2010 09:00:50 +0000 (09:00 +0000)
committerJürgen Spitzmüller <spitz@lyx.org>
Tue, 7 Dec 2010 09:00:50 +0000 (09:00 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36759 a592a061-630c-0410-9148-cb99ea01b6c8

src/Buffer.cpp
src/Buffer.h
src/frontends/qt4/GuiViewSource.cpp

index 1509b5ba28cd272795bba61d0eba1cc200e6f181..48dbe7398d0ada346ac87628bc273054d9323dd1 100644 (file)
@@ -3072,7 +3072,7 @@ void Buffer::changeRefsIfUnique(docstring const & from, docstring const & to,
 
 
 void Buffer::getSourceCode(odocstream & os, pit_type par_begin,
-       pit_type par_end, bool full_source)
+       pit_type par_end, bool full_source) const
 {
        OutputParams runparams(&params().encoding());
        runparams.nice = true;
@@ -3388,7 +3388,7 @@ string Buffer::getDefaultOutputFormat() const
 }
 
 
-OutputParams::FLAVOR Buffer::getDefaultOutputFlavor()
+OutputParams::FLAVOR Buffer::getDefaultOutputFlavor() const
 {
        string const dformat = getDefaultOutputFormat();
        DefaultFlavorCache::const_iterator it =
index c9f82068b3f7efe724048b1c69e458cf7bf6a8e6..a2a74136a528d8261c03c6d74d1137421e282be1 100644 (file)
@@ -554,7 +554,7 @@ public:
        /// get source code (latex/docbook) for some paragraphs, or all paragraphs
        /// including preamble
        void getSourceCode(odocstream & os, pit_type par_begin, pit_type par_end,
-               bool full_source);
+               bool full_source) const;
 
        /// Access to error list.
        /// This method is used only for GUI visualisation of Buffer related
@@ -603,7 +603,7 @@ public:
        /// return the default output format of the current backend
        std::string getDefaultOutputFormat() const;
        /// return the default output flavor
-       OutputParams::FLAVOR getDefaultOutputFlavor();
+       OutputParams::FLAVOR getDefaultOutputFlavor() const;
 
        ///
        bool doExport(std::string const & format, bool put_in_tempdir,
@@ -669,7 +669,7 @@ private:
        /// A cache for the default flavors
        typedef std::map<std::string, OutputParams::FLAVOR> DefaultFlavorCache;
        ///
-       DefaultFlavorCache default_flavors_;
+       mutable DefaultFlavorCache default_flavors_;
        ///
        void getLanguages(std::set<Language const *> &) const;
        /// Checks whether any of the referenced bibfiles have changed since the
index 1bfd7a291922289ec063d616d713185ec2266561..a5beae5da691e673c05fa55d77e9ae9274527128 100644 (file)
@@ -102,8 +102,7 @@ static bool getContent(BufferView const * view, bool fullSource, QString & qstr)
        if (par_begin > par_end)
                swap(par_begin, par_end);
        odocstringstream ostr;
-       const_cast<BufferView *>(view)->buffer().getSourceCode(
-               ostr, par_begin, par_end + 1, fullSource);
+       view->buffer().getSourceCode(ostr, par_begin, par_end + 1, fullSource);
        docstring s = ostr.str();
        static size_t crc = 0;
        size_t newcrc = crcCheck(s);