]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetTabular.cpp
Comments.
[lyx.git] / src / insets / InsetTabular.cpp
index 53a808a83a6924365dd9eb3f264c95adba7216f3..3cd8213b3a130d7d3501213015c488a3e008d432 100644 (file)
@@ -188,62 +188,6 @@ TabularFeature tabularFeature[] =
 };
 
 
-template <class T>
-string const write_attribute(string const & name, T const & t)
-{
-       string const s = tostr(t);
-       return s.empty() ? s : " " + name + "=\"" + s + "\"";
-}
-
-template <>
-string const write_attribute(string const & name, string const & t)
-{
-       return t.empty() ? t : " " + name + "=\"" + t + "\"";
-}
-
-
-template <>
-string const write_attribute(string const & name, docstring const & t)
-{
-       return t.empty() ? string() : " " + name + "=\"" + to_utf8(t) + "\"";
-}
-
-
-template <>
-string const write_attribute(string const & name, bool const & b)
-{
-       // we write only true attribute values so we remove a bit of the
-       // file format bloat for tabulars.
-       return b ? write_attribute(name, convert<string>(b)) : string();
-}
-
-
-template <>
-string const write_attribute(string const & name, int const & i)
-{
-       // we write only true attribute values so we remove a bit of the
-       // file format bloat for tabulars.
-       return i ? write_attribute(name, convert<string>(i)) : string();
-}
-
-
-template <>
-string const write_attribute(string const & name, Tabular::idx_type const & i)
-{
-       // we write only true attribute values so we remove a bit of the
-       // file format bloat for tabulars.
-       return i ? write_attribute(name, convert<string>(i)) : string();
-}
-
-
-template <>
-string const write_attribute(string const & name, Length const & value)
-{
-       // we write only the value if we really have one same reson as above.
-       return value.zero() ? string() : write_attribute(name, value.asString());
-}
-
-
 string const tostr(LyXAlignment const & num)
 {
        switch (num) {
@@ -503,6 +447,61 @@ void l_getline(istream & is, string & str)
        }
 }
 
+template <class T>
+string const write_attribute(string const & name, T const & t)
+{
+       string const s = tostr(t);
+       return s.empty() ? s : " " + name + "=\"" + s + "\"";
+}
+
+template <>
+string const write_attribute(string const & name, string const & t)
+{
+       return t.empty() ? t : " " + name + "=\"" + t + "\"";
+}
+
+
+template <>
+string const write_attribute(string const & name, docstring const & t)
+{
+       return t.empty() ? string() : " " + name + "=\"" + to_utf8(t) + "\"";
+}
+
+
+template <>
+string const write_attribute(string const & name, bool const & b)
+{
+       // we write only true attribute values so we remove a bit of the
+       // file format bloat for tabulars.
+       return b ? write_attribute(name, convert<string>(b)) : string();
+}
+
+
+template <>
+string const write_attribute(string const & name, int const & i)
+{
+       // we write only true attribute values so we remove a bit of the
+       // file format bloat for tabulars.
+       return i ? write_attribute(name, convert<string>(i)) : string();
+}
+
+
+template <>
+string const write_attribute(string const & name, Tabular::idx_type const & i)
+{
+       // we write only true attribute values so we remove a bit of the
+       // file format bloat for tabulars.
+       return i ? write_attribute(name, convert<string>(i)) : string();
+}
+
+
+template <>
+string const write_attribute(string const & name, Length const & value)
+{
+       // we write only the value if we really have one same reson as above.
+       return value.zero() ? string() : write_attribute(name, value.asString());
+}
+
 } // namespace
 
 
@@ -3400,7 +3399,7 @@ void InsetTabular::write(ostream & os) const
 }
 
 
-docstring InsetTabular::contextMenu(BufferView const &, int, int) const
+string InsetTabular::contextMenu(BufferView const &, int, int) const
 {
        // FIXME: depending on the selection state,
        // we could offer a different menu.
@@ -3408,9 +3407,9 @@ docstring InsetTabular::contextMenu(BufferView const &, int, int) const
 }
 
 
-docstring InsetTabular::contextMenuName() const
+string InsetTabular::contextMenuName() const
 {
-       return from_ascii("context-tabular");
+       return "context-tabular";
 }