[EMAIL PROTECTED] (Lars Gullik Bjønnes) writes:

| It seems that Inset::editMessage is not used anymore.
| 
| This is the string that is supposed to be shown in the message buffer
| when we enter an inset, don't we want this anymore?

This patch fix up the editMessage functions to not use to_utf8 and
return a docstring.

I am going to apply it, but I also plan to prepare a patch that just
removes the whole thing since it utterly unused.

Index: src/insets/insetenv.h
===================================================================
--- src/insets/insetenv.h	(revision 14952)
+++ src/insets/insetenv.h	(working copy)
@@ -30,7 +30,7 @@
 	int latex(Buffer const &, std::ostream &,
 		  OutputParams const &) const;
 	///
-	std::string const editMessage() const;
+	virtual lyx::docstring const editMessage() const;
 	///
 	InsetBase::EDITABLE editable() const { return HIGHLY_EDITABLE; }
 	///
Index: src/insets/insetert.h
===================================================================
--- src/insets/insetert.h	(revision 14952)
+++ src/insets/insetert.h	(working copy)
@@ -45,7 +45,7 @@
 	///
 	void read(Buffer const & buf, LyXLex & lex);
 	///
-	std::string const editMessage() const;
+	virtual lyx::docstring const editMessage() const;
 	///
 	bool insetAllowed(InsetBase::Code code) const;
 	///
Index: src/insets/insetbranch.h
===================================================================
--- src/insets/insetbranch.h	(revision 14952)
+++ src/insets/insetbranch.h	(working copy)
@@ -41,7 +41,7 @@
 	///
 	~InsetBranch();
 	///
-	std::string const editMessage() const;
+	virtual lyx::docstring const editMessage() const;
 	///
 	InsetBase::Code lyxCode() const { return InsetBase::BRANCH_CODE; }
 	///
Index: src/insets/insetcharstyle.h
===================================================================
--- src/insets/insetcharstyle.h	(revision 14952)
+++ src/insets/insetcharstyle.h	(working copy)
@@ -55,7 +55,7 @@
 	/// (Re-)set the character style parameters from \p cs
 	void setDefined(CharStyles::iterator cs);
 	///
-	std::string const editMessage() const;
+	virtual lyx::docstring const editMessage() const;
 	///
 	InsetBase::Code lyxCode() const { return InsetBase::CHARSTYLE_CODE; }
 	///
Index: src/insets/insetfloat.C
===================================================================
--- src/insets/insetfloat.C	(revision 14952)
+++ src/insets/insetfloat.C	(working copy)
@@ -36,6 +36,7 @@
 
 #include <sstream>
 
+using lyx::docstring;
 using lyx::support::contains;
 
 using std::endl;
@@ -288,10 +289,9 @@
 }
 
 
-string const InsetFloat::editMessage() const
+docstring const InsetFloat::editMessage() const
 {
-	// FIXME UNICODE
-	return lyx::to_utf8(_("Opened Float Inset"));
+	return _("Opened Float Inset");
 }
 
 
Index: src/insets/insetnote.h
===================================================================
--- src/insets/insetnote.h	(revision 14952)
+++ src/insets/insetnote.h	(working copy)
@@ -45,7 +45,7 @@
 	///
 	~InsetNote();
 	///
-	std::string const editMessage() const;
+	virtual lyx::docstring const editMessage() const;
 	///
 	InsetBase::Code lyxCode() const { return InsetBase::NOTE_CODE; }
 	///
Index: src/insets/insetbase.h
===================================================================
--- src/insets/insetbase.h	(revision 14952)
+++ src/insets/insetbase.h	(working copy)
@@ -12,6 +12,8 @@
 #ifndef INSETBASE_H
 #define INSETBASE_H
 
+#include "support/docstring.h"
+
 #include <memory>
 #include <string>
 #include <vector>
@@ -210,7 +212,7 @@
 		HIGHLY_EDITABLE
 	};
 	/// what appears in the minibuffer when opening
-	virtual std::string const editMessage() const;
+	virtual lyx::docstring const editMessage() const;
 	///
 	virtual EDITABLE editable() const;
 	/// can we go further down on mouse click?
Index: src/insets/insettext.h
===================================================================
--- src/insets/insettext.h	(revision 14952)
+++ src/insets/insettext.h	(working copy)
@@ -53,7 +53,7 @@
 	/// draw inset selection
 	void drawSelection(PainterInfo & pi, int x, int y) const;
 	///
-	std::string const editMessage() const;
+	virtual lyx::docstring const editMessage() const;
 	///
 	EDITABLE editable() const { return HIGHLY_EDITABLE; }
 	///
Index: src/insets/insetmarginal.C
===================================================================
--- src/insets/insetmarginal.C	(revision 14952)
+++ src/insets/insetmarginal.C	(working copy)
@@ -18,6 +18,7 @@
 
 #include "support/std_ostream.h"
 
+using lyx::docstring;
 
 using std::string;
 using std::auto_ptr;
@@ -48,10 +49,9 @@
 }
 
 
-string const InsetMarginal::editMessage() const
+docstring const InsetMarginal::editMessage() const
 {
-	// FIXME UNICODE
-	return lyx::to_utf8(_("Opened Marginal Note Inset"));
+	return _("Opened Marginal Note Inset");
 }
 
 
Index: src/insets/insettabular.C
===================================================================
--- src/insets/insettabular.C	(revision 14952)
+++ src/insets/insettabular.C	(working copy)
@@ -449,10 +449,9 @@
 }
 
 
-string const InsetTabular::editMessage() const
+docstring const InsetTabular::editMessage() const
 {
-	// FIXME UNICODE
-	return lyx::to_utf8(_("Opened table"));
+	return _("Opened table");
 }
 
 
Index: src/insets/insetoptarg.C
===================================================================
--- src/insets/insetoptarg.C	(revision 14952)
+++ src/insets/insetoptarg.C	(working copy)
@@ -19,6 +19,8 @@
 
 #include <sstream>
 
+using lyx::docstring;
+
 using std::string;
 using std::auto_ptr;
 using std::ostream;
@@ -53,10 +55,9 @@
 }
 
 
-string const InsetOptArg::editMessage() const
+docstring const InsetOptArg::editMessage() const
 {
-	// FIXME UNICODE
-	return lyx::to_utf8(_("Opened Optional Argument Inset"));
+	return _("Opened Optional Argument Inset");
 }
 
 
Index: src/insets/insettheorem.h
===================================================================
--- src/insets/insettheorem.h	(revision 14952)
+++ src/insets/insettheorem.h	(working copy)
@@ -34,7 +34,7 @@
 	int latex(Buffer const &, std::ostream &,
 		  OutputParams const &) const;
 	///
-	string const editMessage() const;
+	virtual lyx::docstring const editMessage() const;
 private:
 	virtual std::auto_ptr<InsetBase> doClone() const;
 
Index: src/insets/insetwrap.C
===================================================================
--- src/insets/insetwrap.C	(revision 14952)
+++ src/insets/insetwrap.C	(working copy)
@@ -34,6 +34,8 @@
 
 #include <sstream>
 
+using lyx::docstring;
+
 using std::string;
 using std::endl;
 using std::auto_ptr;
@@ -186,10 +188,9 @@
 }
 
 
-string const InsetWrap::editMessage() const
+docstring const InsetWrap::editMessage() const
 {
-	// FIXME UNICODE
-	return lyx::to_utf8(_("Opened Wrap Inset"));
+	return _("Opened Wrap Inset");
 }
 
 
Index: src/insets/insetfloat.h
===================================================================
--- src/insets/insetfloat.h	(revision 14952)
+++ src/insets/insetfloat.h	(working copy)
@@ -60,7 +60,7 @@
 	int docbook(Buffer const &, std::ostream &,
 		    OutputParams const &) const;
 	///
-	std::string const editMessage() const;
+	virtual lyx::docstring const editMessage() const;
 	///
 	bool insetAllowed(InsetBase::Code) const;
 	/** returns true if, when outputing LaTeX, font changes should
Index: src/insets/insetbox.C
===================================================================
--- src/insets/insetbox.C	(revision 14952)
+++ src/insets/insetbox.C	(working copy)
@@ -30,6 +30,8 @@
 
 #include <sstream>
 
+using lyx::docstring;
+
 using std::auto_ptr;
 using std::string;
 using std::istringstream;
@@ -116,9 +118,9 @@
 }
 
 
-string const InsetBox::editMessage() const
+docstring const InsetBox::editMessage() const
 {
-	return lyx::to_utf8(_("Opened Box Inset"));
+	return _("Opened Box Inset");
 }
 
 
Index: src/insets/insetcaption.C
===================================================================
--- src/insets/insetcaption.C	(revision 14952)
+++ src/insets/insetcaption.C	(working copy)
@@ -75,10 +75,9 @@
 }
 
 
-string const InsetCaption::editMessage() const
+docstring const InsetCaption::editMessage() const
 {
-	// FIXME UNICODE
-	return lyx::to_utf8(_("Opened Caption Inset"));
+	return _("Opened Caption Inset");
 }
 
 
Index: src/insets/insettabular.h
===================================================================
--- src/insets/insettabular.h	(revision 14952)
+++ src/insets/insettabular.h	(working copy)
@@ -68,7 +68,7 @@
 	///
 	void drawSelection(PainterInfo & pi, int x, int y) const;
 	///
-	std::string const editMessage() const;
+	virtual lyx::docstring const editMessage() const;
 	///
 	EDITABLE editable() const { return HIGHLY_EDITABLE; }
 	///
Index: src/insets/insetmarginal.h
===================================================================
--- src/insets/insetmarginal.h	(revision 14952)
+++ src/insets/insetmarginal.h	(working copy)
@@ -32,7 +32,7 @@
 	int docbook(Buffer const &, std::ostream &,
 		    OutputParams const & runparams) const;
 	///
-	std::string const editMessage() const;
+	virtual lyx::docstring const editMessage() const;
 protected:
 	InsetMarginal(InsetMarginal const &);
 private:
Index: src/insets/insetoptarg.h
===================================================================
--- src/insets/insetoptarg.h	(revision 14952)
+++ src/insets/insetoptarg.h	(working copy)
@@ -27,7 +27,7 @@
 	/// code of the inset
 	InsetBase::Code lyxCode() const { return InsetBase::OPTARG_CODE; }
 	/// return an message upon editing
-	std::string const editMessage() const;
+	virtual lyx::docstring const editMessage() const;
 
 	/// Standard LaTeX output -- short-circuited
 	int latex(Buffer const &, std::ostream &,
Index: src/insets/insetfoot.C
===================================================================
--- src/insets/insetfoot.C	(revision 14952)
+++ src/insets/insetfoot.C	(working copy)
@@ -23,6 +23,7 @@
 
 #include "support/std_ostream.h"
 
+using lyx::docstring;
 
 using std::string;
 using std::auto_ptr;
@@ -53,10 +54,9 @@
 }
 
 
-string const InsetFoot::editMessage() const
+docstring const InsetFoot::editMessage() const
 {
-	// FIXME UNICODE
-	return lyx::to_utf8(_("Opened Footnote Inset"));
+	return _("Opened Footnote Inset");
 }
 
 
Index: src/insets/insetwrap.h
===================================================================
--- src/insets/insetwrap.h	(revision 14952)
+++ src/insets/insetwrap.h	(working copy)
@@ -56,7 +56,7 @@
 	int docbook(Buffer const &, std::ostream &,
 		    OutputParams const &) const;
 	///
-	std::string const editMessage() const;
+	virtual lyx::docstring const editMessage() const;
 	///
 	bool insetAllowed(InsetBase::Code) const;
 	///
Index: src/insets/insetenv.C
===================================================================
--- src/insets/insetenv.C	(revision 14952)
+++ src/insets/insetenv.C	(working copy)
@@ -21,6 +21,8 @@
 #include "support/std_ostream.h"
 
 
+using lyx::docstring;
+
 using std::string;
 using std::auto_ptr;
 using std::ostream;
@@ -60,10 +62,10 @@
 }
 
 
-string const InsetEnvironment::editMessage() const
+docstring const InsetEnvironment::editMessage() const
 {
 	// FIXME UNICODE
-	return lyx::to_utf8(_("Opened Environment Inset: ")) + getInsetName();
+	return _("Opened Environment Inset: ") + lyx::from_utf8(getInsetName());
 }
 
 
Index: src/insets/insetert.C
===================================================================
--- src/insets/insetert.C	(revision 14952)
+++ src/insets/insetert.C	(working copy)
@@ -36,6 +36,7 @@
 
 #include <sstream>
 
+using lyx::docstring;
 using lyx::pos_type;
 using lyx::support::token;
 
@@ -137,10 +138,9 @@
 }
 
 
-string const InsetERT::editMessage() const
+docstring const InsetERT::editMessage() const
 {
-	// FIXME UNICODE
-	return lyx::to_utf8(_("Opened ERT Inset"));
+	return _("Opened ERT Inset");
 }
 
 
Index: src/insets/insetbox.h
===================================================================
--- src/insets/insetbox.h	(revision 14952)
+++ src/insets/insetbox.h	(working copy)
@@ -60,7 +60,7 @@
 	///
 	~InsetBox();
 	///
-	std::string const editMessage() const;
+	virtual lyx::docstring const editMessage() const;
 	///
 	InsetBase::Code lyxCode() const { return InsetBase::BOX_CODE; }
 	///
Index: src/insets/insetbranch.C
===================================================================
--- src/insets/insetbranch.C	(revision 14952)
+++ src/insets/insetbranch.C	(working copy)
@@ -26,6 +26,8 @@
 
 #include <sstream>
 
+using lyx::docstring;
+
 using std::string;
 using std::auto_ptr;
 using std::istringstream;
@@ -67,10 +69,9 @@
 }
 
 
-string const InsetBranch::editMessage() const
+docstring const InsetBranch::editMessage() const
 {
-	// FIXME UNICODE
-	return lyx::to_utf8(_("Opened Branch Inset"));
+	return _("Opened Branch Inset");
 }
 
 
Index: src/insets/insetcharstyle.C
===================================================================
--- src/insets/insetcharstyle.C	(revision 14952)
+++ src/insets/insetcharstyle.C	(working copy)
@@ -114,10 +114,9 @@
 }
 
 
-string const InsetCharStyle::editMessage() const
+docstring const InsetCharStyle::editMessage() const
 {
-	// FIXME UNICODE
-	return lyx::to_utf8(_("Opened CharStyle Inset"));
+	return _("Opened CharStyle Inset");
 }
 
 
Index: src/insets/insetcaption.h
===================================================================
--- src/insets/insetcaption.h	(revision 14952)
+++ src/insets/insetcaption.h	(working copy)
@@ -33,7 +33,7 @@
 	///
 	virtual InsetBase::Code lyxCode() const;
 	///
-	virtual std::string const editMessage() const;
+	virtual lyx::docstring const editMessage() const;
 	///
 	virtual void cursorPos
 		(CursorSlice const & sl, bool boundary, int & x, int & y) const;
Index: src/insets/insetnote.C
===================================================================
--- src/insets/insetnote.C	(revision 14952)
+++ src/insets/insetnote.C	(working copy)
@@ -34,6 +34,8 @@
 
 #include <sstream>
 
+using lyx::docstring;
+
 using std::string;
 using std::auto_ptr;
 using std::istringstream;
@@ -141,10 +143,9 @@
 }
 
 
-string const InsetNote::editMessage() const
+docstring const InsetNote::editMessage() const
 {
-	// FIXME UNICODE
-	return lyx::to_utf8(_("Opened Note Inset"));
+	return _("Opened Note Inset");
 }
 
 
Index: src/insets/insetbase.C
===================================================================
--- src/insets/insetbase.C	(revision 14952)
+++ src/insets/insetbase.C	(working copy)
@@ -252,10 +252,9 @@
 }
 
 
-std::string const InsetBase::editMessage() const
+lyx::docstring const InsetBase::editMessage() const
 {
-	// FIXME UNICODE
-	return lyx::to_utf8(_("Opened inset"));
+	return _("Opened inset");
 }
 
 
Index: src/insets/insetfoot.h
===================================================================
--- src/insets/insetfoot.h	(revision 14952)
+++ src/insets/insetfoot.h	(working copy)
@@ -31,7 +31,7 @@
 	int docbook(Buffer const &, std::ostream &,
 		    OutputParams const & runparams) const;
 	///
-	std::string const editMessage() const;
+	virtual lyx::docstring const editMessage() const;
 protected:
 	InsetFoot(InsetFoot const &);
 private:
Index: src/insets/insettext.C
===================================================================
--- src/insets/insettext.C	(revision 14952)
+++ src/insets/insettext.C	(working copy)
@@ -225,10 +225,9 @@
 }
 
 
-string const InsetText::editMessage() const
+docstring const InsetText::editMessage() const
 {
-	// FIXME UNICODE
-	return lyx::to_utf8(_("Opened Text Inset"));
+	return _("Opened Text Inset");
 }
 
 
Index: src/mathed/math_hullinset.C
===================================================================
--- src/mathed/math_hullinset.C	(revision 14952)
+++ src/mathed/math_hullinset.C	(working copy)
@@ -1310,10 +1310,9 @@
 }
 
 
-string const MathHullInset::editMessage() const
+docstring const MathHullInset::editMessage() const
 {
-	// FIXME UNICODE
-	return lyx::to_utf8(_("Math editor mode"));
+	return _("Math editor mode");
 }
 
 
Index: src/mathed/math_hullinset.h
===================================================================
--- src/mathed/math_hullinset.h	(revision 14952)
+++ src/mathed/math_hullinset.h	(working copy)
@@ -186,7 +186,7 @@
 //
 public:
 	/// what appears in the minibuffer when opening
-	virtual std::string const editMessage() const;
+	virtual lyx::docstring const editMessage() const;
 	///
 	virtual void mutateToText();
 	///
-- 
        Lgb

Reply via email to