From f255f93b9e02515322039be39f841873e4706911 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=BCrgen=20Spitzm=C3=BCller?= Date: Tue, 7 Dec 2010 09:00:50 +0000 Subject: [PATCH] * Follow Vincent's advice to keep constness. Thanks Vincent. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36759 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/Buffer.cpp | 4 ++-- src/Buffer.h | 6 +++--- src/frontends/qt4/GuiViewSource.cpp | 3 +-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/Buffer.cpp b/src/Buffer.cpp index 1509b5ba28..48dbe7398d 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -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(¶ms().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 = diff --git a/src/Buffer.h b/src/Buffer.h index c9f82068b3..a2a74136a5 100644 --- a/src/Buffer.h +++ b/src/Buffer.h @@ -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 DefaultFlavorCache; /// - DefaultFlavorCache default_flavors_; + mutable DefaultFlavorCache default_flavors_; /// void getLanguages(std::set &) const; /// Checks whether any of the referenced bibfiles have changed since the diff --git a/src/frontends/qt4/GuiViewSource.cpp b/src/frontends/qt4/GuiViewSource.cpp index 1bfd7a2919..a5beae5da6 100644 --- a/src/frontends/qt4/GuiViewSource.cpp +++ b/src/frontends/qt4/GuiViewSource.cpp @@ -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(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); -- 2.39.2