Please have a look at this and tell if you have problems with it.

? Config
? concept-checks-1.diff
? const-1.diff
? cursor-1.diff
? devel.diff
? gtkmm-2.4-1.diff
? insetold-1.diff
? nvi-clone-1.diff.gz
? nvi-dispatch-1.diff
? lib/help
Index: src/aspell.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/aspell.C,v
retrieving revision 1.10
diff -u -p -B -b -w -r1.10 aspell.C
--- src/aspell.C	8 Oct 2003 11:31:46 -0000	1.10
+++ src/aspell.C	4 Jan 2005 07:24:03 -0000
@@ -73,7 +73,7 @@ void ASpell::addSpeller(string const & l
 }
 
 
-enum ASpell::Result ASpell::check(WordLangTuple const & word)
+ASpell::Result ASpell::check(WordLangTuple const & word)
 {
 	Result res = UNKNOWN;
 
@@ -88,7 +88,7 @@ enum ASpell::Result ASpell::check(WordLa
 
 	AspellSpeller * m = it->second.speller;
 
-	int word_ok = aspell_speller_check(m, word.word().c_str(), -1);
+	int const word_ok = aspell_speller_check(m, word.word().c_str(), -1);
 	BOOST_ASSERT(word_ok != -1);
 
 	if (word_ok) {
@@ -129,9 +129,8 @@ string const ASpell::nextMiss()
 
 	if (els)
 		str = aspell_string_enumeration_next(els);
-	if (str)
-		return str;
-	return "";
+
+	return (str ? str : "");
 }
 
 
@@ -143,9 +142,7 @@ string const ASpell::error()
 		err = aspell_error_message(spell_error_object);
 	}
 
-	if (err)
-		return err;
-	return "";
+	return (err ? err : "");
 }
 
 #endif // USE_ASPELL
Index: src/aspell_local.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/aspell_local.h,v
retrieving revision 1.3
diff -u -p -B -b -w -r1.3 aspell_local.h
--- src/aspell_local.h	7 Oct 2003 13:32:17 -0000	1.3
+++ src/aspell_local.h	4 Jan 2005 07:24:03 -0000
@@ -64,7 +64,7 @@ private:
 		AspellConfig * config;
 	};
 
-	typedef std::map<std::string, struct Speller> Spellers;
+	typedef std::map<std::string, Speller> Spellers;
 
 	/// the spellers
 	Spellers spellers_;
Index: src/buffer.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/buffer.C,v
retrieving revision 1.597
diff -u -p -B -b -w -r1.597 buffer.C
--- src/buffer.C	20 Dec 2004 16:59:32 -0000	1.597
+++ src/buffer.C	4 Jan 2005 07:24:03 -0000
@@ -136,7 +136,7 @@ extern BufferList bufferlist;
 
 namespace {
 
-const int LYX_FORMAT = 238;
+int const LYX_FORMAT = 238;
 
 } // namespace anon
 
@@ -319,7 +319,7 @@ TexRow const & Buffer::texrow() const
 }
 
 
-string const Buffer::getLatexName(bool no_path) const
+string const Buffer::getLatexName(bool const no_path) const
 {
 	string const name = ChangeExtension(MakeLatexName(fileName()), ".tex");
 	return no_path ? OnlyFilename(name) : name;
@@ -358,7 +358,7 @@ pair<Buffer::LogType, string> const Buff
 }
 
 
-void Buffer::setReadonly(bool flag)
+void Buffer::setReadonly(bool const flag)
 {
 	if (pimpl_->read_only != flag) {
 		pimpl_->read_only = flag;
@@ -548,7 +548,7 @@ bool Buffer::readFile(string const & fil
 }
 
 
-bool Buffer::readFile(string const & filename, pit_type pit)
+bool Buffer::readFile(string const & filename, pit_type const pit)
 {
 	LyXLex lex(0, 0);
 	lex.setFile(filename);
@@ -562,13 +562,13 @@ bool Buffer::fully_loaded() const
 }
 
 
-void Buffer::fully_loaded(bool value)
+void Buffer::fully_loaded(bool const value)
 {
 	pimpl_->file_fully_loaded = value;
 }
 
 
-bool Buffer::readFile(LyXLex & lex, string const & filename, pit_type pit)
+bool Buffer::readFile(LyXLex & lex, string const & filename, pit_type const pit)
 {
 	BOOST_ASSERT(!filename.empty());
 
@@ -846,7 +846,7 @@ void Buffer::makeLaTeXFile(string const 
 void Buffer::makeLaTeXFile(ostream & os,
 			   string const & original_path,
 			   OutputParams const & runparams_in,
-			   bool output_preamble, bool output_body)
+			   bool const output_preamble, bool const output_body)
 {
 	OutputParams runparams = runparams_in;
 
@@ -1000,7 +1000,7 @@ bool Buffer::isSGML() const
 
 void Buffer::makeLinuxDocFile(string const & fname,
 			      OutputParams const & runparams,
-			      bool body_only)
+			      bool const body_only)
 {
 	ofstream ofs;
 	if (!openFileWrite(ofs, fname))
@@ -1013,7 +1013,7 @@ void Buffer::makeLinuxDocFile(string con
 
 	LyXTextClass const & tclass = params().getLyXTextClass();
 
-	string top_element = tclass.latexname();
+	string const & top_element = tclass.latexname();
 
 	if (!body_only) {
 		ofs << tclass.class_header();
@@ -1058,7 +1058,7 @@ void Buffer::makeLinuxDocFile(string con
 
 void Buffer::makeDocBookFile(string const & fname,
 			     OutputParams const & runparams,
-			     bool only_body)
+			     bool const only_body)
 {
 	ofstream ofs;
 	if (!openFileWrite(ofs, fname))
@@ -1070,7 +1070,7 @@ void Buffer::makeDocBookFile(string cons
 	texrow().reset();
 
 	LyXTextClass const & tclass = params().getLyXTextClass();
-	string top_element = tclass.latexname();
+	string const & top_element = tclass.latexname();
 
 	if (!only_body) {
 		if (runparams.flavor == OutputParams::XML)
@@ -1157,7 +1157,7 @@ int Buffer::runChktex()
 
 	TeXErrors terr;
 	Chktex chktex(lyxrc.chktex_command, name, filePath());
-	int res = chktex.run(terr); // run chktex
+	int const res = chktex.run(terr); // run chktex
 
 	if (res == -1) {
 		Alert::error(_("chktex failure"),
@@ -1220,7 +1220,7 @@ void Buffer::validate(LaTeXFeatures & fe
 }
 
 
-void Buffer::getLabelList(std::vector<string> & list) const
+void Buffer::getLabelList(vector<string> & list) const
 {
 	/// if this is a child document and the parent is already loaded
 	/// Use the parent's list instead  [ale990407]
@@ -1240,7 +1240,7 @@ void Buffer::getLabelList(std::vector<st
 
 
 // This is also a buffer property (ale)
-void Buffer::fillWithBibKeys(std::vector<std::pair<string, string> > & keys)
+void Buffer::fillWithBibKeys(vector<pair<string, string> > & keys)
 	const
 {
 	/// if this is a child document and the parent is already loaded
@@ -1276,7 +1276,7 @@ void Buffer::fillWithBibKeys(std::vector
 
 bool Buffer::isDepClean(string const & name) const
 {
-	DepClean::const_iterator it = pimpl_->dep_clean.find(name);
+	DepClean::const_iterator const it = pimpl_->dep_clean.find(name);
 	if (it == pimpl_->dep_clean.end())
 		return true;
 	return it->second;
@@ -1316,6 +1316,9 @@ bool Buffer::dispatch(FuncRequest const 
 
 void Buffer::changeLanguage(Language const * from, Language const * to)
 {
+	BOOST_ASSERT(from);
+	BOOST_ASSERT(to);
+
 	lyxerr << "Changing Language!" << endl;
 
 	// Take care of l10n/i18n
@@ -1329,6 +1332,8 @@ void Buffer::changeLanguage(Language con
 
 void Buffer::updateDocLang(Language const * nlang)
 {
+	BOOST_ASSERT(nlang);
+
 	pimpl_->messages.reset(new Messages(nlang->code()));
 }
 
@@ -1344,10 +1349,10 @@ bool Buffer::isMultiLingual() const
 }
 
 
-ParIterator Buffer::getParFromID(int id) const
+ParIterator Buffer::getParFromID(int const id) const
 {
 	ParConstIterator it = par_iterator_begin();
-	ParConstIterator end = par_iterator_end();
+	ParConstIterator const end = par_iterator_end();
 
 	if (id < 0) {
 		// John says this is called with id == -1 from undo
@@ -1363,9 +1368,9 @@ ParIterator Buffer::getParFromID(int id)
 }
 
 
-bool Buffer::hasParWithID(int id) const
+bool Buffer::hasParWithID(int const id) const
 {
-	ParConstIterator it = getParFromID(id);
+	ParConstIterator const it = getParFromID(id);
 	return it != par_iterator_end();
 }
 
@@ -1452,6 +1457,7 @@ bool Buffer::isUnnamed() const
 }
 
 
+#warning this function should be moved to buffer_pimpl.C
 void Buffer::markDirty()
 {
 	if (pimpl_->lyx_clean) {
Index: src/buffer_funcs.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/buffer_funcs.C,v
retrieving revision 1.21
diff -u -p -B -b -w -r1.21 buffer_funcs.C
--- src/buffer_funcs.C	27 Dec 2004 16:30:27 -0000	1.21
+++ src/buffer_funcs.C	4 Jan 2005 07:24:03 -0000
@@ -50,8 +50,10 @@ extern BufferList bufferlist;
 
 namespace {
 
-bool readFile(Buffer * b, string const & s)
+bool readFile(Buffer * const b, string const & s)
 {
+	BOOST_ASSERT(b);
+
 	// File information about normal file
 	FileInfo fileN(s);
 	if (!fileN.exist()) {
@@ -70,7 +72,8 @@ bool readFile(Buffer * b, string const &
 	    && fileE.getModificationTime() > fileN.getModificationTime())
 	{
 		string const file = MakeDisplayPath(s, 20);
-		string text = bformat(_("An emergency save of the document "
+		string const text =
+			bformat(_("An emergency save of the document "
 					"%1$s exists.\n\n"
 					"Recover emergency save?"), file);
 		switch (Alert::prompt(_("Load emergency save?"), text, 0, 2,
@@ -96,7 +99,8 @@ bool readFile(Buffer * b, string const &
 	    && fileA.getModificationTime() > fileN.getModificationTime())
 	{
 		string const file = MakeDisplayPath(s, 20);
-		string text = bformat(_("The backup of the document "
+		string const text =
+			bformat(_("The backup of the document "
 					"%1$s is newer.\n\nLoad the "
 					"backup instead?"), file);
 		switch (Alert::prompt(_("Load backup?"), text, 0, 2,
@@ -125,6 +129,8 @@ bool readFile(Buffer * b, string const &
 
 bool loadLyXFile(Buffer * b, string const & s)
 {
+	BOOST_ASSERT(b);
+
 	switch (IsFileWriteable(s)) {
 	case 0:
 		b->setReadonly(true);
@@ -139,7 +145,8 @@ bool loadLyXFile(Buffer * b, string cons
 		string const file = MakeDisplayPath(s, 20);
 		// Here we probably should run
 		if (LyXVC::file_not_found_hook(s)) {
-			string text = bformat(_("Do you want to retrieve the document"
+			string const text =
+				bformat(_("Do you want to retrieve the document"
 				" %1$s from version control?"), file);
 			int const ret = Alert::prompt(_("Retrieve from version control?"),
 				text, 0, 1, _("&Retrieve"), _("&Cancel"));
@@ -159,10 +166,11 @@ bool loadLyXFile(Buffer * b, string cons
 
 
 Buffer * newFile(string const & filename, string const & templatename,
-		 bool isNamed)
+		 bool const isNamed)
 {
 	// get a free buffer
 	Buffer * b = bufferlist.newBuffer(filename);
+	BOOST_ASSERT(b);
 
 	string tname;
 	// use defaults.lyx as a default template if it exists.
Index: src/bufferlist.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/bufferlist.C,v
retrieving revision 1.147
diff -u -p -B -b -w -r1.147 bufferlist.C
--- src/bufferlist.C	16 Dec 2004 14:53:58 -0000	1.147
+++ src/bufferlist.C	4 Jan 2005 07:24:03 -0000
@@ -69,13 +69,16 @@ bool BufferList::empty() const
 
 bool BufferList::quitWriteBuffer(Buffer * buf)
 {
+	BOOST_ASSERT(buf);
+
 	string file;
 	if (buf->isUnnamed())
 		file = OnlyFilename(buf->fileName());
 	else
 		file = MakeDisplayPath(buf->fileName(), 30);
 
-	string text = bformat(_("The document %1$s has unsaved changes.\n\n"
+	string const text =
+		bformat(_("The document %1$s has unsaved changes.\n\n"
 		"Do you want to save the document or discard the changes?"), file);
 	int const ret = Alert::prompt(_("Save changed document?"),
 		text, 0, 2, _("&Save"), _("&Discard"), _("&Cancel"));
@@ -127,16 +130,18 @@ bool BufferList::quitWriteAll()
 void BufferList::release(Buffer * buf)
 {
 	BOOST_ASSERT(buf);
-	BufferStorage::iterator it = find(bstore.begin(), bstore.end(), buf);
+	BufferStorage::iterator const it =
+		find(bstore.begin(), bstore.end(), buf);
 	if (it != bstore.end()) {
 		Buffer * tmp = (*it);
+		BOOST_ASSERT(tmp);
 		bstore.erase(it);
 		delete tmp;
 	}
 }
 
 
-Buffer * BufferList::newBuffer(string const & s, bool ronly)
+Buffer * BufferList::newBuffer(string const & s, bool const ronly)
 {
 	auto_ptr<Buffer> tmpbuf(new Buffer(s, ronly));
 	tmpbuf->params().useClassDefaults();
@@ -155,7 +160,7 @@ void BufferList::closeAll()
 }
 
 
-bool BufferList::close(Buffer * buf, bool ask)
+bool BufferList::close(Buffer * buf, bool const ask)
 {
 	BOOST_ASSERT(buf);
 
@@ -171,7 +176,8 @@ bool BufferList::close(Buffer * buf, boo
 	else
 		fname = MakeDisplayPath(buf->fileName(), 30);
 
-	string text = bformat(_("The document %1$s has unsaved changes.\n\n"
+	string const text =
+		bformat(_("The document %1$s has unsaved changes.\n\n"
 		"Do you want to save the document or discard the changes?"), fname);
 	int const ret = Alert::prompt(_("Save changed document?"),
 		text, 0, 2, _("&Save"), _("&Discard"), _("&Cancel"));
@@ -216,7 +222,7 @@ Buffer * BufferList::first()
 }
 
 
-Buffer * BufferList::getBuffer(unsigned int choice)
+Buffer * BufferList::getBuffer(unsigned int const choice)
 {
 	if (choice >= bstore.size())
 		return 0;
@@ -226,6 +232,8 @@ Buffer * BufferList::getBuffer(unsigned 
 
 Buffer * BufferList::next(Buffer const * buf) const
 {
+	BOOST_ASSERT(buf);
+
 	if (bstore.empty())
 		return 0;
 	BufferStorage::const_iterator it = find(bstore.begin(),
@@ -241,6 +249,8 @@ Buffer * BufferList::next(Buffer const *
 
 Buffer * BufferList::previous(Buffer const * buf) const
 {
+	BOOST_ASSERT(buf);
+
 	if (bstore.empty())
 		return 0;
 	BufferStorage::const_iterator it = find(bstore.begin(),
@@ -280,10 +290,9 @@ void BufferList::emergencyWriteAll()
 
 void BufferList::emergencyWrite(Buffer * buf)
 {
-	// assert(buf) // this is not good since C assert takes an int
-		       // and a pointer is a long (JMarc)
-	assert(buf != 0); // use c assert to avoid a loop
-
+	// Use ::assert to avoid a loop, BOOST_ASSERT ends up calling ::assert
+	// compare with 0 to avoid pointer/interger comparison
+	assert(buf != 0);
 
 	// No need to save if the buffer has not changed.
 	if (buf->isClean())
Index: src/bufferparams.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/bufferparams.C,v
retrieving revision 1.91
diff -u -p -B -b -w -r1.91 bufferparams.C
--- src/bufferparams.C	26 Oct 2004 21:16:43 -0000	1.91
+++ src/bufferparams.C	4 Jan 2005 07:24:03 -0000
@@ -64,17 +64,19 @@ namespace biblio = lyx::biblio;
 namespace {
 
 // Paragraph separation
-typedef Translator<std::string, BufferParams::PARSEP> ParSepTranslator;
+typedef Translator<string, BufferParams::PARSEP> ParSepTranslator;
 
 
-ParSepTranslator const init_parseptranslator() {
+ParSepTranslator const init_parseptranslator()
+{
 	ParSepTranslator translator(string_paragraph_separation[0], BufferParams::PARSEP_INDENT);
 	translator.addPair(string_paragraph_separation[1], BufferParams::PARSEP_SKIP);
 	return translator;
 }
 
 
-ParSepTranslator const & parseptranslator() {
+ParSepTranslator const & parseptranslator()
+{
 	static ParSepTranslator translator = init_parseptranslator();
 	return translator;
 }
@@ -79,11 +81,13 @@ ParSepTranslator const & parseptranslato
 	return translator;
 }
 
+
 // Quotes language
-typedef Translator<std::string, InsetQuotes::quote_language> QuotesLangTranslator;
+typedef Translator<string, InsetQuotes::quote_language> QuotesLangTranslator;
 
 
-QuotesLangTranslator const init_quoteslangtranslator() {
+QuotesLangTranslator const init_quoteslangtranslator()
+{
 	QuotesLangTranslator translator(string_quotes_language[0], InsetQuotes::EnglishQ);
 	translator.addPair(string_quotes_language[1], InsetQuotes::SwedishQ);
 	translator.addPair(string_quotes_language[2], InsetQuotes::GermanQ);
@@ -94,7 +98,8 @@ QuotesLangTranslator const init_quotesla
 }
 
 
-QuotesLangTranslator const & quoteslangtranslator() {
+QuotesLangTranslator const & quoteslangtranslator()
+{
 	static QuotesLangTranslator translator = init_quoteslangtranslator();
 	return translator;
 }
@@ -103,14 +109,16 @@ QuotesLangTranslator const & quoteslangt
 typedef Translator<int, InsetQuotes::quote_times> QuotesTimesTranslator;
 
 
-QuotesTimesTranslator const init_quotestimestranslator() {
+QuotesTimesTranslator const init_quotestimestranslator()
+{
 	QuotesTimesTranslator translator(1, InsetQuotes::SingleQ);
 	translator.addPair(2, InsetQuotes::DoubleQ);
 	return translator;
 }
 
 
-QuotesTimesTranslator const & quotestimestranslator() {
+QuotesTimesTranslator const & quotestimestranslator()
+{
 	static QuotesTimesTranslator translator = init_quotestimestranslator();
 	return translator;
 }
@@ -119,7 +128,8 @@ QuotesTimesTranslator const & quotestime
 typedef Translator<std::string, VMARGIN_PAPER_TYPE> PaperSizeTranslator;
 
 
-PaperSizeTranslator const init_papersizetranslator() {
+PaperSizeTranslator const init_papersizetranslator()
+{
 	PaperSizeTranslator translator(string_papersize[0], VM_PAPER_DEFAULT);
 	translator.addPair(string_papersize[1], VM_PAPER_CUSTOM);
 	translator.addPair(string_papersize[2], VM_PAPER_USLETTER);
@@ -135,7 +145,8 @@ PaperSizeTranslator const init_papersize
 }
 
 
-PaperSizeTranslator const & papersizetranslator() {
+PaperSizeTranslator const & papersizetranslator()
+{
 	static PaperSizeTranslator translator = init_papersizetranslator();
 	return translator;
 }
@@ -140,11 +151,13 @@ PaperSizeTranslator const & papersizetra
 	return translator;
 }
 
+
 // Paper packages
-typedef Translator<std::string, PAPER_PACKAGES> PaperPackagesTranslator;
+typedef Translator<string, PAPER_PACKAGES> PaperPackagesTranslator;
 
 
-PaperPackagesTranslator const init_paperpackagestranslator() {
+PaperPackagesTranslator const init_paperpackagestranslator()
+{
 	PaperPackagesTranslator translator(string_paperpackages[0], PACKAGE_NONE);
 	translator.addPair(string_paperpackages[1], PACKAGE_A4);
 	translator.addPair(string_paperpackages[2], PACKAGE_A4WIDE);
@@ -153,24 +166,27 @@ PaperPackagesTranslator const init_paper
 }
 
 
-PaperPackagesTranslator const & paperpackagestranslator() {
+PaperPackagesTranslator const & paperpackagestranslator()
+{
 	static PaperPackagesTranslator translator = init_paperpackagestranslator();
 	return translator;
 }
 
 
 // Paper orientation
-typedef Translator<std::string, PAPER_ORIENTATION> PaperOrientationTranslator;
+typedef Translator<string, PAPER_ORIENTATION> PaperOrientationTranslator;
 
 
-PaperOrientationTranslator const init_paperorientationtranslator() {
+PaperOrientationTranslator const init_paperorientationtranslator()
+{
 	PaperOrientationTranslator translator(string_orientation[0], ORIENTATION_PORTRAIT);
 	translator.addPair(string_orientation[1], ORIENTATION_LANDSCAPE);
 	return translator;
 }
 
 
-PaperOrientationTranslator const & paperorientationtranslator() {
+PaperOrientationTranslator const & paperorientationtranslator()
+{
 	static PaperOrientationTranslator translator = init_paperorientationtranslator();
 	return translator;
 }
@@ -180,14 +196,16 @@ PaperOrientationTranslator const & paper
 typedef Translator<int, LyXTextClass::PageSides> SidesTranslator;
 
 
-SidesTranslator const init_sidestranslator() {
+SidesTranslator const init_sidestranslator()
+{
 	SidesTranslator translator(1, LyXTextClass::OneSide);
 	translator.addPair(2, LyXTextClass::TwoSides);
 	return translator;
 }
 
 
-SidesTranslator const & sidestranslator() {
+SidesTranslator const & sidestranslator()
+{
 	static SidesTranslator translator = init_sidestranslator();
 	return translator;
 }
@@ -198,7 +216,8 @@ SidesTranslator const & sidestranslator(
 typedef Translator<int, BufferParams::AMS> AMSTranslator;
 
 
-AMSTranslator const init_amstranslator() {
+AMSTranslator const init_amstranslator()
+{
 	AMSTranslator translator(0, BufferParams::AMS_OFF);
 	translator.addPair(1, BufferParams::AMS_AUTO);
 	translator.addPair(2, BufferParams::AMS_ON);
@@ -206,7 +225,8 @@ AMSTranslator const init_amstranslator()
 }
 
 
-AMSTranslator const & amstranslator() {
+AMSTranslator const & amstranslator()
+{
 	static AMSTranslator translator = init_amstranslator();
 	return translator;
 }
@@ -217,7 +236,8 @@ AMSTranslator const & amstranslator() {
 typedef Translator<string, biblio::CiteEngine> CiteEngineTranslator;
 
 
-CiteEngineTranslator const init_citeenginetranslator() {
+CiteEngineTranslator const init_citeenginetranslator()
+{
 	CiteEngineTranslator translator("basic", biblio::ENGINE_BASIC);
 	translator.addPair("natbib_numerical", biblio::ENGINE_NATBIB_NUMERICAL);
 	translator.addPair("natbib_authoryear", biblio::ENGINE_NATBIB_AUTHORYEAR);
@@ -226,7 +246,8 @@ CiteEngineTranslator const init_citeengi
 }
 
 
-CiteEngineTranslator const & citeenginetranslator() {
+CiteEngineTranslator const & citeenginetranslator()
+{
 	static CiteEngineTranslator translator = init_citeenginetranslator();
 	return translator;
 }
@@ -236,7 +257,8 @@ CiteEngineTranslator const & citeenginet
 typedef Translator<string, Spacing::Space> SpaceTranslator;
 
 
-SpaceTranslator const init_spacetranslator() {
+SpaceTranslator const init_spacetranslator()
+{
 	SpaceTranslator translator("default", Spacing::Default);
 	translator.addPair("single", Spacing::Single);
 	translator.addPair("onehalf", Spacing::Onehalf);
@@ -245,7 +267,8 @@ SpaceTranslator const init_spacetranslat
 }
 
 
-SpaceTranslator const & spacetranslator() {
+SpaceTranslator const & spacetranslator()
+{
 	static SpaceTranslator translator = init_spacetranslator();
 	return translator;
 }
@@ -281,6 +304,8 @@ BufferParams::Impl::Impl()
 BufferParams::Impl *
 BufferParams::MemoryTraits::clone(BufferParams::Impl const * ptr)
 {
+	BOOST_ASSERT(ptr);
+
 	return new BufferParams::Impl(*ptr);
 }
 
@@ -359,28 +384,28 @@ BranchList const & BufferParams::branchl
 }
 
 
-Bullet & BufferParams::temp_bullet(lyx::size_type index)
+Bullet & BufferParams::temp_bullet(lyx::size_type const index)
 {
 	BOOST_ASSERT(index < 4);
 	return pimpl_->temp_bullets[index];
 }
 
 
-Bullet const & BufferParams::temp_bullet(lyx::size_type index) const
+Bullet const & BufferParams::temp_bullet(lyx::size_type const index) const
 {
 	BOOST_ASSERT(index < 4);
 	return pimpl_->temp_bullets[index];
 }
 
 
-Bullet & BufferParams::user_defined_bullet(lyx::size_type index)
+Bullet & BufferParams::user_defined_bullet(lyx::size_type const index)
 {
 	BOOST_ASSERT(index < 4);
 	return pimpl_->user_defined_bullets[index];
 }
 
 
-Bullet const & BufferParams::user_defined_bullet(lyx::size_type index) const
+Bullet const & BufferParams::user_defined_bullet(lyx::size_type const index) const
 {
 	BOOST_ASSERT(index < 4);
 	return pimpl_->user_defined_bullets[index];
@@ -425,7 +450,8 @@ string const BufferParams::readToken(LyX
 			return classname;
 		}
 		if (!getLyXTextClass().isTeXClassAvailable()) {
-			string msg = bformat(_("The document uses a missing "
+			string const msg =
+				bformat(_("The document uses a missing "
 				"TeX class \"%1$s\".\n"), classname);
 			Alert::warning(_("Document class not available"),
 			               msg + _("LyX will not be able to produce output."));
@@ -589,12 +615,12 @@ void BufferParams::writeFile(ostream & o
 		   << "\n\\end_preamble\n";
 	}
 
-	/* the options */
+	// the options
 	if (!options.empty()) {
 		os << "\\options " << options << '\n';
 	}
 
-	/* then the text parameters */
+	// then the text parameters
 	if (language != ignore_language)
 		os << "\\language " << language->lang() << '\n';
 	os << "\\inputencoding " << inputenc
@@ -1226,7 +1253,7 @@ void BufferParams::readBulletsLaTeX(LyXL
 	if (!lex.next()) return;
 	int const index = lex.getInteger();
 	lex.next(true);
-	string temp_str = lex.getString();
+	string const temp_str = lex.getString();
 
 	user_defined_bullet(index).setText(temp_str);
 	temp_bullet(index).setText(temp_str);
Index: src/bufferview_funcs.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/bufferview_funcs.C,v
retrieving revision 1.143
diff -u -p -B -b -w -r1.143 bufferview_funcs.C
--- src/bufferview_funcs.C	30 Nov 2004 01:59:32 -0000	1.143
+++ src/bufferview_funcs.C	4 Jan 2005 07:24:03 -0000
@@ -50,7 +50,7 @@ namespace bv_funcs {
 
 // Set data using font and toggle
 // If successful, returns true
-bool font2string(LyXFont const & font, bool toggle, string & data)
+bool font2string(LyXFont const & font, bool const toggle, string & data)
 {
 	string lang = "ignore";
 	if (font.language())
Index: src/changes.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/changes.C,v
retrieving revision 1.9
diff -u -p -B -b -w -r1.9 changes.C
--- src/changes.C	6 Oct 2003 15:42:07 -0000	1.9
+++ src/changes.C	4 Jan 2005 07:24:03 -0000
@@ -60,13 +60,13 @@ bool Changes::Range::contained(Range con
 }
 
 
-bool Changes::Range::contains(pos_type pos) const
+bool Changes::Range::contains(pos_type const pos) const
 {
 	return pos >= start && pos < end;
 }
 
 
-bool Changes::Range::loose_contains(pos_type pos) const
+bool Changes::Range::loose_contains(pos_type const pos) const
 {
 	return pos >= start && pos <= end;
 }
@@ -79,7 +79,7 @@ bool Changes::Range::intersects(Range co
 }
 
 
-Changes::Changes(Change::Type type)
+Changes::Changes(Change::Type const type)
 	: empty_type_(type)
 {
 }
@@ -96,7 +96,7 @@ Changes::Changes(Changes const & c)
 }
 
 
-void Changes::record(Change change, pos_type pos)
+void Changes::record(Change const change, pos_type const pos)
 {
 	if (lyxerr.debugging(Debug::CHANGES)) {
 		lyxerr[Debug::CHANGES] << "record " << change.type
@@ -118,25 +118,27 @@ void Changes::record(Change change, pos_
 }
 
 
-void Changes::set(Change change, pos_type pos)
+void Changes::set(Change const change, pos_type const pos)
 {
 	set(change, pos, pos + 1);
 }
 
 
-void Changes::set(Change::Type type, pos_type pos)
+void Changes::set(Change::Type const type, pos_type const pos)
 {
 	set(type, pos, pos + 1);
 }
 
 
-void Changes::set(Change::Type type, pos_type start, pos_type end)
+void Changes::set(Change::Type const type,
+		  pos_type const start, pos_type const end)
 {
 	set(Change(type), start, end);
 }
 
 
-void Changes::set(Change change, pos_type start, pos_type end)
+void Changes::set(Change const change,
+		  pos_type const start, pos_type const end)
 {
 	ChangeTable::iterator it = table_.begin();
 
@@ -162,7 +164,7 @@ void Changes::set(Change change, pos_typ
 	}
 
 	it = table_.begin();
-	ChangeTable::iterator itend = table_.end();
+	ChangeTable::iterator const itend = table_.end();
 
 	// find a super-range
 	for (; it != itend; ++it) {
@@ -221,7 +223,7 @@ void Changes::set(Change change, pos_typ
 }
 
 
-void Changes::erase(pos_type pos)
+void Changes::erase(pos_type const pos)
 {
 	ChangeTable::iterator it = table_.begin();
 	ChangeTable::iterator end = table_.end();
@@ -252,7 +254,7 @@ void Changes::erase(pos_type pos)
 }
 
 
-void Changes::del(Change change, ChangeTable::size_type pos)
+void Changes::del(Change const change, ChangeTable::size_type const pos)
 {
 	// this case happens when building from .lyx
 	if (table_.empty()) {
@@ -281,7 +283,7 @@ void Changes::del(Change change, ChangeT
 }
 
 
-void Changes::add(Change change, ChangeTable::size_type pos)
+void Changes::add(Change const change, ChangeTable::size_type const pos)
 {
 	ChangeTable::iterator it = table_.begin();
 	ChangeTable::iterator end = table_.end();
@@ -310,7 +312,7 @@ void Changes::add(Change change, ChangeT
 }
 
 
-Change const Changes::lookupFull(pos_type pos) const
+Change const Changes::lookupFull(pos_type const pos) const
 {
 	if (!table_.size()) {
 		if (lyxerr.debugging(Debug::CHANGES))
@@ -319,7 +321,7 @@ Change const Changes::lookupFull(pos_typ
 	}
 
 	ChangeTable::const_iterator it = table_.begin();
-	ChangeTable::const_iterator end = table_.end();
+	ChangeTable::const_iterator const end = table_.end();
 
 	for (; it != end; ++it) {
 		if (it->range.contains(pos))
@@ -327,12 +329,12 @@ Change const Changes::lookupFull(pos_typ
 	}
 
 	check();
-	BOOST_ASSERT(false);
+	BOOST_ASSERT(false && "missing changes for pos");
 	return Change(Change::UNCHANGED);
 }
 
 
-Change::Type Changes::lookup(pos_type pos) const
+Change::Type Changes::lookup(pos_type const pos) const
 {
 	if (!table_.size()) {
 		if (lyxerr.debugging(Debug::CHANGES))
@@ -349,12 +351,12 @@ Change::Type Changes::lookup(pos_type po
 	}
 
 	check();
-	BOOST_ASSERT(0);
+	BOOST_ASSERT(false && "missing changes for pos");
 	return Change::UNCHANGED;
 }
 
 
-bool Changes::isChange(pos_type start, pos_type end) const
+bool Changes::isChange(pos_type const start, pos_type const end) const
 {
 	if (!table_.size()) {
 		if (lyxerr.debugging(Debug::CHANGES))
@@ -363,7 +365,7 @@ bool Changes::isChange(pos_type start, p
 	}
 
 	ChangeTable::const_iterator it = table_.begin();
-	ChangeTable::const_iterator itend = table_.end();
+	ChangeTable::const_iterator const itend = table_.end();
 
 	for (; it != itend; ++it) {
 		if (lyxerr.debugging(Debug::CHANGES)) {
@@ -388,7 +390,8 @@ bool Changes::isChange(pos_type start, p
 }
 
 
-bool Changes::isChangeEdited(lyx::pos_type start, lyx::pos_type end) const
+bool Changes::isChangeEdited(lyx::pos_type const start,
+			     lyx::pos_type const end) const
 {
 	if (!table_.size()) {
 		if (lyxerr.debugging(Debug::CHANGES))
@@ -397,7 +400,7 @@ bool Changes::isChangeEdited(lyx::pos_ty
 	}
 
 	ChangeTable::const_iterator it = table_.begin();
-	ChangeTable::const_iterator itend = table_.end();
+	ChangeTable::const_iterator const itend = table_.end();
 
 	for (; it != itend; ++it) {
 		if (it->range.intersects(Range(start, end ? end - 1 : 0))
@@ -465,7 +468,7 @@ void Changes::check() const
 	ChangeTable::const_iterator it = table_.begin();
 	ChangeTable::const_iterator end = table_.end();
 
-	bool dont_assert(true);
+	bool dont_assert = true;
 
 	lyxerr[Debug::CHANGES] << "Changelist:" << endl;
 	for (; it != end; ++it) {
@@ -491,7 +494,8 @@ void Changes::check() const
 }
 
 
-int Changes::latexMarkChange(std::ostream & os, Change::Type old, Change::Type change)
+int Changes::latexMarkChange(std::ostream & os,
+			     Change::Type const old, Change::Type const change)
 {
 	if (old == change)
 		return 0;
@@ -535,7 +539,8 @@ int Changes::latexMarkChange(std::ostrea
 }
 
 
-void Changes::lyxMarkChange(std::ostream & os, int & column, lyx::time_type curtime,
+void Changes::lyxMarkChange(std::ostream & os, int & column,
+			    lyx::time_type const curtime,
 	Change const & old, Change const & change)
 {
 	if (old == change)
@@ -549,7 +554,7 @@ void Changes::lyxMarkChange(std::ostream
 			break;
 
 		case Change::DELETED: {
-			lyx::time_type t(change.changetime);
+			lyx::time_type t = change.changetime;
 			if (!t)
 				t = curtime;
 			os << "\n\\change_deleted " << change.author
@@ -558,12 +563,13 @@ void Changes::lyxMarkChange(std::ostream
 			break;
 		}
 
-		case Change::INSERTED:
-			lyx::time_type t(change.changetime);
+	case Change::INSERTED: {
+			lyx::time_type t = change.changetime;
 			if (!t)
 				t = curtime;
 			os << "\n\\change_inserted " << change.author
 				<< " " << t << "\n";
 			break;
+	}
 	}
 }
Index: src/converter.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/converter.C,v
retrieving revision 1.102
diff -u -p -B -b -w -r1.102 converter.C
--- src/converter.C	8 Nov 2004 08:22:03 -0000	1.102
+++ src/converter.C	4 Jan 2005 07:24:04 -0000
@@ -103,8 +103,9 @@ private:
 } // namespace anon
 
 
-Converter::Converter(string const & f, string const & t, string const & c,
-	  string const & l): from(f), to(t), command(c), flags(l),
+Converter::Converter(string const & f, string const & t,
+		     string const & c, string const & l)
+	: from(f), to(t), command(c), flags(l),
 			     From(0), To(0), latex(false), xml(false),
 			     original_dir(false), need_aux(false)
 {}
@@ -158,7 +159,7 @@ bool operator<(Converter const & a, Conv
 Converter const * Converters::getConverter(string const & from,
 					    string const & to) const
 {
-	ConverterList::const_iterator cit =
+	ConverterList::const_iterator const cit =
 		find_if(converterlist_.begin(), converterlist_.end(),
 			ConverterEqual(from, to));
 	if (cit != converterlist_.end())
@@ -170,7 +171,7 @@ Converter const * Converters::getConvert
 
 int Converters::getNumber(string const & from, string const & to) const
 {
-	ConverterList::const_iterator cit =
+	ConverterList::const_iterator const cit =
 		find_if(converterlist_.begin(), converterlist_.end(),
 			ConverterEqual(from, to));
 	if (cit != converterlist_.end())
@@ -215,7 +216,8 @@ void Converters::add(string const & from
 
 void Converters::erase(string const & from, string const & to)
 {
-	ConverterList::iterator it = find_if(converterlist_.begin(),
+	ConverterList::iterator const it =
+		find_if(converterlist_.begin(),
 					     converterlist_.end(),
 					     ConverterEqual(from, to));
 	if (it != converterlist_.end())
@@ -324,7 +326,7 @@ bool Converters::convert(Buffer const * 
 
 		if (conv.latex) {
 			run_latex = true;
-			string command = subst(conv.command, token_from, "");
+			string const command = subst(conv.command, token_from, "");
 			lyxerr[Debug::FILES] << "Running " << command << endl;
 			if (!runLaTeX(*buffer, command, runparams))
 				return false;
@@ -337,9 +339,9 @@ bool Converters::convert(Buffer const * 
 				runLaTeX(*buffer, latex_command_, runparams);
 			}
 
-			string infile2 = (conv.original_dir)
+			string const infile2 = (conv.original_dir)
 				? infile : MakeRelPath(infile, path);
-			string outfile2 = (conv.original_dir)
+			string const outfile2 = (conv.original_dir)
 				? outfile : MakeRelPath(outfile, path);
 
 			string command = conv.command;
@@ -363,7 +365,7 @@ bool Converters::convert(Buffer const * 
 				buffer->message(_("Executing command: ")
 					+ command);
 
-			Systemcall::Starttype type = (dummy)
+			Systemcall::Starttype const type = (dummy)
 				? Systemcall::DontWait : Systemcall::Wait;
 			Systemcall one;
 			int res;
@@ -420,9 +422,9 @@ bool Converters::convert(Buffer const * 
 				  subst(conv.result_file,
 					token_base, OnlyFilename(to_base)));
 		if (from_base != to_base) {
-			string from = subst(conv.result_dir,
+			string const from = subst(conv.result_dir,
 					    token_base, from_base);
-			string to = subst(conv.result_dir,
+			string const to = subst(conv.result_dir,
 					  token_base, to_base);
 			Mover const & mover = movers(conv.from);
 			if (!mover.rename(from, to)) {
@@ -506,7 +508,7 @@ bool Converters::scanLog(Buffer const & 
 	runparams.flavor = OutputParams::LATEX;
 	LaTeX latex("", runparams, filename, "");
 	TeXErrors terr;
-	int result = latex.scanLogFile(terr);
+	int const result = latex.scanLogFile(terr);
 
 	if (result & LaTeX::ERRORS)
 		bufferErrors(buffer, terr);
@@ -539,19 +542,20 @@ bool Converters::runLaTeX(Buffer const &
 	runparams.document_language = buffer.params().language->babel();
 
 	// do the LaTeX run(s)
-	string name = buffer.getLatexName();
+	string const name = buffer.getLatexName();
 	LaTeX latex(command, runparams, name, buffer.filePath());
 	TeXErrors terr;
 	showMessage show(buffer);
 	latex.message.connect(show);
-	int result = latex.run(terr);
+	int const result = latex.run(terr);
 
 	if (result & LaTeX::ERRORS)
 		bufferErrors(buffer, terr);
 
 	// check return value from latex.run().
 	if ((result & LaTeX::NO_LOGFILE)) {
-		string str = bformat(_("LaTeX did not run successfully. "
+		string const str =
+			bformat(_("LaTeX did not run successfully. "
 				       "Additionally, LyX could not locate "
 				       "the LaTeX log %1$s."), name);
 		Alert::error(_("LaTeX failed"), str);
@@ -578,7 +582,7 @@ void Converters::buildGraph()
 {
 	G_.init(formats.size());
 	ConverterList::iterator beg = converterlist_.begin();
-	ConverterList::iterator end = converterlist_.end();
+	ConverterList::iterator const end = converterlist_.end();
 	for (ConverterList::iterator it = beg; it != end ; ++it) {
 		int const s = formats.getNumber(it->from);
 		int const t = formats.getNumber(it->to);
@@ -593,7 +597,7 @@ Converters::intToFormat(std::vector<int>
 	vector<Format const *> result(input.size());
 
 	vector<int>::const_iterator it = input.begin();
-	vector<int>::const_iterator end = input.end();
+	vector<int>::const_iterator const end = input.end();
 	vector<Format const *>::iterator rit = result.begin();
 	for ( ; it != end; ++it, ++rit) {
 		*rit = &formats.get(*it);
@@ -601,8 +605,9 @@ Converters::intToFormat(std::vector<int>
 	return result;
 }
 
+
 vector<Format const *> const
-Converters::getReachableTo(string const & target, bool clear_visited)
+Converters::getReachableTo(string const & target, bool const clear_visited)
 {
 	vector<int> const & reachablesto =
 		G_.getReachableTo(formats.getNumber(target), clear_visited);
@@ -612,8 +617,8 @@ Converters::getReachableTo(string const 
 
 
 vector<Format const *> const
-Converters::getReachable(string const & from, bool only_viewable,
-			 bool clear_visited)
+Converters::getReachable(string const & from, bool const only_viewable,
+			 bool const clear_visited)
 {
 	vector<int> const & reachables =
 		G_.getReachable(formats.getNumber(from),
Index: src/counters.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/counters.C,v
retrieving revision 1.31
diff -u -p -B -b -w -r1.31 counters.C
--- src/counters.C	24 Jul 2004 10:55:09 -0000	1.31
+++ src/counters.C	4 Jan 2005 07:24:04 -0000
@@ -78,7 +78,7 @@ void Counter::setMaster(string const & m
 void Counters::newCounter(string const & newc)
 {
 	// First check if newc already exist
-	CounterList::iterator cit = counterList.find(newc);
+	CounterList::iterator const cit = counterList.find(newc);
 	// if already exist give warning and return
 	if (cit != counterList.end()) {
 		lyxerr << "The new counter already exists." << endl;
@@ -91,14 +91,14 @@ void Counters::newCounter(string const &
 void Counters::newCounter(string const & newc, string const & masterc)
 {
 	// First check if newc already exists
-	CounterList::iterator cit = counterList.find(newc);
+	CounterList::iterator const cit = counterList.find(newc);
 	// if already existant give warning and return
 	if (cit != counterList.end()) {
 		lyxerr << "The new counter already exists." << endl;
 		return;
 	}
 	// then check if masterc exists
-	CounterList::iterator it = counterList.find(masterc);
+	CounterList::iterator const it = counterList.find(masterc);
 	// if not give warning and return
 	if (it == counterList.end()) {
 		lyxerr << "The master counter does not exist." << endl;
@@ -109,9 +109,9 @@ void Counters::newCounter(string const &
 }
 
 
-void Counters::set(string const & ctr, int val)
+void Counters::set(string const & ctr, int const val)
 {
-	CounterList::iterator it = counterList.find(ctr);
+	CounterList::iterator const it = counterList.find(ctr);
 	if (it == counterList.end()) {
 		lyxerr << "set: Counter does not exist: " << ctr << endl;
 		return;
@@ -120,9 +120,9 @@ void Counters::set(string const & ctr, i
 }
 
 
-void Counters::addto(string const & ctr, int val)
+void Counters::addto(string const & ctr, int const val)
 {
-	CounterList::iterator it = counterList.find(ctr);
+	CounterList::iterator const it = counterList.find(ctr);
 	if (it == counterList.end()) {
 		lyxerr << "addto: Counter does not exist: " << ctr << endl;
 		return;
@@ -133,7 +133,7 @@ void Counters::addto(string const & ctr,
 
 int Counters::value(string const & ctr) const
 {
-	CounterList::const_iterator cit = counterList.find(ctr);
+	CounterList::const_iterator const cit = counterList.find(ctr);
 	if (cit == counterList.end()) {
 		lyxerr << "value: Counter does not exist: " << ctr << endl;
 		return 0;
@@ -152,7 +152,7 @@ void Counters::step(string const & ctr)
 
 	it->second.step();
 	it = counterList.begin();
-	CounterList::iterator end = counterList.end();
+	CounterList::iterator const end = counterList.end();
 	for (; it != end; ++it) {
 		if (it->second.master() == ctr) {
 			it->second.reset();
@@ -164,7 +164,7 @@ void Counters::step(string const & ctr)
 void Counters::reset()
 {
 	CounterList::iterator it = counterList.begin();
-	CounterList::iterator end = counterList.end();
+	CounterList::iterator const end = counterList.end();
 	for (; it != end; ++it) {
 		it->second.reset();
 	}
@@ -198,7 +198,7 @@ void Counters::copy(Counters & from, Cou
 
 namespace {
 
-char loweralphaCounter(int n)
+char loweralphaCounter(int const n)
 {
 	if (n < 1 || n > 26)
 		return '?';
@@ -206,7 +206,7 @@ char loweralphaCounter(int n)
 }
 
 
-char alphaCounter(int n)
+char alphaCounter(int const n)
 {
 	if (n < 1 || n > 26)
 		return '?';
@@ -214,7 +214,7 @@ char alphaCounter(int n)
 }
 
 
-char hebrewCounter(int n)
+char hebrewCounter(int const n)
 {
 	static const char hebrew[22] = {
 		'�', '�', '�', '�', '�', '�', '�', '�', '�',
@@ -228,9 +228,9 @@ char hebrewCounter(int n)
 }
 
 
-string const lowerromanCounter(int n)
+string const lowerromanCounter(int const n)
 {
-	static char const * roman[20] = {
+	static char const * const roman[20] = {
 		"i",   "ii",  "iii", "iv", "v",
 		"vi",  "vii", "viii", "ix", "x",
 		"xi",  "xii", "xiii", "xiv", "xv",
@@ -243,9 +243,9 @@ string const lowerromanCounter(int n)
 }
 
 
-string const romanCounter(int n)
+string const romanCounter(int const n)
 {
-	static char const * roman[20] = {
+	static char const * const roman[20] = {
 		"I",   "II",  "III", "IV", "V",
 		"VI",  "VII", "VIII", "IX", "X",
 		"XI",  "XII", "XIII", "XIV", "XV",
@@ -291,7 +291,7 @@ string Counters::counterLabel(string con
 	string label = format;
 	while (true) {
 #ifdef WITH_WARNINGS
-#warning Using boost::regex would make this code a lot simpler... (Lgb)
+#warning Using boost::regex or boost::spirit would make this code a lot simpler... (Lgb)
 #endif
 
 		size_t const i = label.find('\\', 0);
Index: src/cursor.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/cursor.C,v
retrieving revision 1.116
diff -u -p -B -b -w -r1.116 cursor.C
--- src/cursor.C	29 Dec 2004 11:39:12 -0000	1.116
+++ src/cursor.C	4 Jan 2005 07:24:04 -0000
@@ -230,45 +230,6 @@ DispatchResult LCursor::result() const
 }
 
 
-bool LCursor::getStatus(FuncRequest const & cmd, FuncStatus & status)
-{
-	// This is, of course, a mess. Better create a new doc iterator and use
-	// this in Inset::getStatus. This might require an additional
-	// BufferView * arg, though (which should be avoided)
-	LCursor safe = *this;
-	bool res = false;
-	for ( ; size(); pop()) {
-		//lyxerr << "\nLCursor::getStatus: cmd: " << cmd << endl << *this << endl;
-		if (idx() > lastidx()) {
-			lyxerr << "wrong idx " << idx() << ", max is " << lastidx()
-				<< ". Trying to correct this."  << endl;
-			idx() = lastidx();
-		}
-		if (pit() > lastpit()) {
-			lyxerr << "wrong par " << pit() << ", max is " << lastpit()
-				<< ". Trying to correct this."  << endl;
-			pit() = lastpit();
-		}
-		if (pos() > lastpos()) {
-			lyxerr << "wrong pos " << pos() << ", max is " << lastpos()
-				<< ". Trying to correct this."  << endl;
-			pos() = lastpos();
-		}
-
-		// The inset's getStatus() will return 'true' if it made
-		// a definitive decision on whether it want to handle the
-		// request or not. The result of this decision is put into
-		// the 'status' parameter.
-		if (inset().getStatus(*this, cmd, status)) {
-			res = true;
-			break;
-		}
-	}
-	operator=(safe);
-	return res;
-}
-
-
 BufferView & LCursor::bv() const
 {
 	BOOST_ASSERT(bv_);
Index: src/cursor.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/cursor.h,v
retrieving revision 1.68
diff -u -p -B -b -w -r1.68 cursor.h
--- src/cursor.h	2 Dec 2004 11:32:13 -0000	1.68
+++ src/cursor.h	4 Jan 2005 07:24:04 -0000
@@ -42,14 +42,6 @@ public:
 	void dispatch(FuncRequest const & cmd);
 	/// get the resut of the last dispatch
 	DispatchResult result() const;
-        /**
-	 * \returns true if this function made a definitive decision on
-	 * whether the inset at this cursor position wants to handle the
-	 * request \p cmd or not. The result of this decision is put into
-	 * \p status.
-	 */
-	bool getStatus(FuncRequest const & cmd, FuncStatus & flag);
-
 	/// add a new cursor slice
 	void push(InsetBase & inset);
 	/// add a new cursor slice, place cursor on left end
Index: src/lyxfunc.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyxfunc.C,v
retrieving revision 1.635
diff -u -p -B -b -w -r1.635 lyxfunc.C
--- src/lyxfunc.C	6 Dec 2004 13:03:38 -0000	1.635
+++ src/lyxfunc.C	4 Jan 2005 07:24:05 -0000
@@ -141,6 +141,59 @@ extern boost::scoped_ptr<kb_keymap> topl
 extern tex_accent_struct get_accent(kb_action action);
 
 
+namespace {
+
+bool getStatus(LCursor cursor,
+	       FuncRequest const & cmd, FuncStatus & status)
+{
+	// This is, of course, a mess. Better create a new doc iterator and use
+	// this in Inset::getStatus. This might require an additional
+	// BufferView * arg, though (which should be avoided)
+	//LCursor safe = *this;
+	bool res = false;
+	for ( ; cursor.size(); cursor.pop()) {
+		//lyxerr << "\nLCursor::getStatus: cmd: " << cmd << endl << *this << endl;
+		DocIterator::idx_type & idx = cursor.idx();
+		DocIterator::idx_type const lastidx = cursor.lastidx();
+
+		if (idx > lastidx) {
+			lyxerr << "wrong idx " << idx << ", max is " << lastidx
+				<< ". Trying to correct this."  << endl;
+			idx = lastidx;
+		}
+
+		DocIterator::pit_type & pit = cursor.pit();
+		DocIterator::pit_type const lastpit = cursor.lastpit();
+
+		if (pit > lastpit) {
+			lyxerr << "wrong par " << pit << ", max is " << lastpit
+				<< ". Trying to correct this."  << endl;
+			pit = lastpit;
+		}
+
+		DocIterator::pos_type & pos = cursor.pos();
+		DocIterator::pos_type const lastpos = cursor.lastpos();
+
+		if (pos > lastpos) {
+			lyxerr << "wrong pos " << pos << ", max is " << lastpos
+				<< ". Trying to correct this."  << endl;
+			pos = lastpos;
+		}
+
+		// The inset's getStatus() will return 'true' if it made
+		// a definitive decision on whether it want to handle the
+		// request or not. The result of this decision is put into
+		// the 'status' parameter.
+		if (cursor.inset().getStatus(cursor, cmd, status)) {
+			res = true;
+			break;
+		}
+	}
+	return res;
+}
+
+}
+
 LyXFunc::LyXFunc(LyXView * lv)
 	: owner(lv),
 	encoded_last_key(0),
@@ -522,8 +575,8 @@ FuncStatus LyXFunc::getStatus(FuncReques
 
 	default:
 
-		if (!cur.getStatus(cmd, flag))
-			flag |= view()->getStatus(cmd);
+		if (!::getStatus(cur, cmd, flag))
+			flag = view()->getStatus(cmd);
 	}
 
 	if (!enable)
Index: src/insets/inset.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/inset.C,v
retrieving revision 1.130
diff -u -p -B -b -w -r1.130 inset.C
--- src/insets/inset.C	23 Nov 2004 23:04:47 -0000	1.130
+++ src/insets/inset.C	4 Jan 2005 07:24:05 -0000
@@ -52,12 +52,6 @@ LColor_color InsetOld::backgroundColor()
 }
 
 
-bool InsetOld::forceDefaultParagraphs(InsetBase const *) const
-{
-	return false;
-}
-
-
 int InsetOld::ascent() const
 {
 	return dim_.asc;
Index: src/insets/inset.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/inset.h,v
retrieving revision 1.159
diff -u -p -B -b -w -r1.159 inset.h
--- src/insets/inset.h	25 Nov 2004 19:13:03 -0000	1.159
+++ src/insets/inset.h	4 Jan 2005 07:24:05 -0000
@@ -53,8 +53,6 @@ public:
 	/// returns the actual scroll-value
 	virtual int scroll(bool recursive = true) const;
 
-	///
-	bool forceDefaultParagraphs(InsetBase const * inset) const;
 protected:
 	///
 	InsetOld(InsetOld const & in);
Index: src/insets/insetbase.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetbase.h,v
retrieving revision 1.48
diff -u -p -B -b -w -r1.48 insetbase.h
Index: src/mathed/math_data.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_data.C,v
retrieving revision 1.58
diff -u -p -B -b -w -r1.58 math_data.C
-- 
        Lgb

Reply via email to