X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ftabular_funcs.h;h=5760d2261d08d388aa7a0ca4ca9d824ade255768;hb=5091380d6bad1686800e384ed1bbb03836a15aab;hp=24691bf7ba25387cdffc1fc427f02a1804581a7f;hpb=b922cdd796f9e4b9a46a79808cdee596e04903eb;p=lyx.git diff --git a/src/tabular_funcs.h b/src/tabular_funcs.h index 24691bf7ba..5760d2261d 100644 --- a/src/tabular_funcs.h +++ b/src/tabular_funcs.h @@ -1,14 +1,14 @@ // -*- C++ -*- /* This file is part of - * ====================================================== - * + * ====================================================== + * * LyX, The Document Processor - * + * * Copyright 2000-2001 The LyX Team. * * @author: Jürgen Vigna * - * ====================================================== + * ====================================================== */ #ifndef TABULAR_FUNCS_H @@ -20,6 +20,7 @@ #include "LString.h" #include "tabular.h" +#include "support/lstrings.h" // for tostr #include @@ -28,12 +29,17 @@ template string const write_attribute(string const & name, T const & t) { + if (tostr(t).empty()) + return string(); + string str = " " + name + "=\"" + tostr(t) + "\""; return str; } template<> string const write_attribute(string const & name, bool const & b); template<> +string const write_attribute(string const & name, int const & b); +template<> string const write_attribute(string const & name, LyXLength const & value); string const tostr(LyXAlignment const & num); string const tostr(LyXTabular::VAlignment const & num); @@ -47,14 +53,14 @@ extern bool string2type(string const str, bool & num); extern bool getTokenValue(string const & str, char const * token, string &ret); extern bool getTokenValue(string const & str, char const * token, int & num); extern bool getTokenValue(string const & str, char const * token, - LyXAlignment & num); + LyXAlignment & num); extern bool getTokenValue(string const & str, char const * token, - LyXTabular::VAlignment & num); + LyXTabular::VAlignment & num); extern bool getTokenValue(string const & str, char const * token, - LyXTabular::BoxType & num); + LyXTabular::BoxType & num); extern bool getTokenValue(string const & str, char const * token, bool & flag); extern bool getTokenValue(string const & str, char const * token, - LyXLength & len); + LyXLength & len); extern void l_getline(std::istream & is, string & str); #endif