using std::endl;
using std::vector;
-static int const WIDTH_OF_LINE = 5;
+namespace {
+
+int const WIDTH_OF_LINE = 5;
+
+} // namespace
/// Define a few methods for the inner structs
}
+namespace {
+
// I would have liked a fromstr template a lot better. (Lgb)
-static inline
+inline
bool string2type(string const str, LyXAlignment & num)
{
if (str == "none")
}
-static inline
+inline
bool string2type(string const str, LyXTabular::VAlignment & num)
{
if (str == "top")
}
-static inline
+inline
bool string2type(string const str, LyXTabular::BoxType & num)
{
if (str == "none")
}
-static inline
+inline
bool string2type(string const str, bool & num)
{
if (str == "true")
}
-static
bool getTokenValue(string const & str, const char * token, string & ret)
{
size_t token_length = strlen(token);
}
-static
bool getTokenValue(string const & str, const char * token, int & num)
{
string tmp;
}
-static
bool getTokenValue(string const & str, const char * token, LyXAlignment & num)
{
string tmp;
}
-static
bool getTokenValue(string const & str, const char * token,
LyXTabular::VAlignment & num)
{
}
-static
bool getTokenValue(string const & str, const char * token,
LyXTabular::BoxType & num)
{
}
-static
bool getTokenValue(string const & str, const char * token, bool & flag)
{
string tmp;
}
-static inline
+inline
void l_getline(istream & is, string & str)
{
- getline(is, str);
- while(str.empty() || ((str.length()==1) && (str[0] == '\r')))
+ str.erase();
+ while (str.empty()) {
getline(is, str);
+ if (!str.empty() && str[str.length() - 1] == '\r')
+ str.erase(str.length() - 1);
+ }
}
+} // namespace anon
+
void LyXTabular::Read(Buffer const * buf, LyXLex & lex)
{
if (LeftLine(cell))
os << '|';
if (!GetPWidth(cell).empty()) {
+#warning Jürgen, are these alignments correct? (Lgb)
switch (GetVAlignment(cell)) {
case LYX_VALIGN_TOP:
os << "p";
} else if (GetUsebox(cell) == BOX_MINIPAGE) {
os << "\\begin{minipage}[";
switch (GetVAlignment(cell)) {
+#warning Jürgen, are these alignments correct? (Lgb)
case LYX_VALIGN_TOP:
os << "t";
break;
os << column_info[i].align_special;
} else if (!column_info[i].p_width.empty()) {
switch (column_info[i].valignment) {
+#warning Jürgen, are these alignments correct? (Lgb)
case LYX_VALIGN_TOP:
os << "p";
break;
}
-static
+namespace {
+
inline
void print_n_chars(ostream & os, unsigned char ch, int n)
{
os << string(n, ch);
}
+} // namespace anon
+
int LyXTabular::AsciiTopHLine(ostream & os, int row,
vector<unsigned int> const & clen) const
features.longtable = true;
if (NeedRotating())
features.rotating = true;
- for (int cell = 0; cell < numberofcells; ++cell) {
+ for (int cell = 0; !features.array && (cell < numberofcells); ++cell) {
if (GetVAlignment(cell) != LYX_VALIGN_TOP)
features.array = true;
GetCellInset(cell)->Validate(features);