X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ftabular_funcs.h;h=e2ce28f1e7948b9be1a76b371f1c000d0b070001;hb=b99a5acc7f18c3f885856fa962c0f0a63a0ca5ad;hp=6f500df26d2139684c20d15889886e7b876a2a64;hpb=cc0959da55bf2b90cec9696281061538614712dc;p=lyx.git diff --git a/src/tabular_funcs.h b/src/tabular_funcs.h index 6f500df26d..e2ce28f1e7 100644 --- a/src/tabular_funcs.h +++ b/src/tabular_funcs.h @@ -1,26 +1,22 @@ // -*- C++ -*- /* This file is part of - * ====================================================== - * + * ====================================================== + * * LyX, The Document Processor - * + * * Copyright 2000-2001 The LyX Team. * * @author: Jürgen Vigna * - * ====================================================== + * ====================================================== */ #ifndef TABULAR_FUNCS_H #define TABULAR_FUNCS_H -#ifdef __GNUG__ -#pragma interface -#endif - #include "LString.h" -#include "layout.h" #include "tabular.h" +#include "support/lstrings.h" // for tostr #include @@ -29,12 +25,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); @@ -48,14 +49,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