diff --git a/src/Buffer.cpp b/src/Buffer.cpp index a046124250..ea5b6e57ae 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -822,7 +822,7 @@ bool Buffer::readDocument(Lexer & lex) // inform parent buffer about local macros if (parent()) { - Buffer * pbuf = const_cast(parent()); + Buffer const * pbuf = parent(); UserMacroSet::const_iterator cit = usermacros.begin(); UserMacroSet::const_iterator end = usermacros.end(); for (; cit != end; ++cit) diff --git a/src/Buffer.h b/src/Buffer.h index d0d787687c..5819466bf7 100644 --- a/src/Buffer.h +++ b/src/Buffer.h @@ -544,7 +544,7 @@ public: /// Collect user macro names at loading time typedef std::set UserMacroSet; - UserMacroSet usermacros; + mutable UserMacroSet usermacros; /// Replace the inset contents for insets which InsetCode is equal /// to the passed \p inset_code. diff --git a/src/insets/InsetInclude.cpp b/src/insets/InsetInclude.cpp index bdb332d9d6..e1e61b15c4 100644 --- a/src/insets/InsetInclude.cpp +++ b/src/insets/InsetInclude.cpp @@ -463,7 +463,7 @@ Buffer * InsetInclude::loadIfNeeded() const } else { // The file was already loaded, so, simply // inform parent buffer about local macros. - Buffer * parent = const_cast(&buffer()); + Buffer const * parent = &buffer(); child->setParent(parent); MacroNameSet macros; child->listMacroNames(macros);