From d8b68d84f11ccda03facce4c2714ae985c96062d Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Sat, 7 Jan 2012 16:00:56 +0000 Subject: [PATCH] Backport Lars's fix for bug removal in GCC 4.7 A long standing bug has been fixed in GCC 4.7, the bug was a non- sactioned extra lookup. This caused some code to work that really shouldn't. The fixes are: add this->, Class::, or move functions about as required to fullfill the rules. In this case some template instantiations were movee to after what they reference. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_2_0_X@40583 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/insets/InsetTabular.cpp | 111 ++++++++++++++++++------------------ status.20x | 4 +- 2 files changed, 58 insertions(+), 57 deletions(-) diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp index 1a2264ac89..1dc55dbeb0 100644 --- a/src/insets/InsetTabular.cpp +++ b/src/insets/InsetTabular.cpp @@ -188,62 +188,6 @@ TabularFeature tabularFeature[] = }; -template -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(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(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(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 +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(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(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(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 diff --git a/status.20x b/status.20x index cf2fff3b50..f1e79906d8 100644 --- a/status.20x +++ b/status.20x @@ -91,7 +91,9 @@ What's new - Make sure that we detect and use python 2 on systems where python 3 is the default python interpreter. -- cmake, LYX_DEPENDENCIES_DOWNLOAD: look for the right filename on SourceForge +- cmake, LYX_DEPENDENCIES_DOWNLOAD: look for the right filename on SourceForge. + +- Make compilation work with GCC 4.7. ** Bug fixes: -- 2.39.5