]>
git.saurik.com Git - wxWidgets.git/blob - utils/tex2rtf/src/table.cpp
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Utilities for manipulating tables
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
13 #pragma implementation
16 // For compilers that support precompilation, includes "wx.h".
17 #include "wx/wxprec.h"
45 ColumnData TableData
[40];
46 bool inTabular
= FALSE
;
48 bool startRows
= FALSE
;
49 bool tableVerticalLineLeft
= FALSE
;
50 bool tableVerticalLineRight
= FALSE
;
51 int noColumns
= 0; // Current number of columns in table
54 int currentRowNumber
= 0;
57 * Parse table argument
61 bool ParseTableArgument(char *value
)
65 int len
= strlen(value
);
66 bool isBorder
= FALSE
;
77 TableData
[noColumns
].leftBorder
= isBorder
;
78 TableData
[noColumns
].rightBorder
= FALSE
;
79 TableData
[noColumns
].justification
= 'l';
80 TableData
[noColumns
].width
= 2000; // Estimate
81 TableData
[noColumns
].absWidth
= FALSE
;
82 // TableData[noColumns].spacing = ??
89 TableData
[noColumns
].leftBorder
= isBorder
;
90 TableData
[noColumns
].rightBorder
= FALSE
;
91 TableData
[noColumns
].justification
= 'c';
92 TableData
[noColumns
].width
= defaultTableColumnWidth
; // Estimate
93 TableData
[noColumns
].absWidth
= FALSE
;
94 // TableData[noColumns].spacing = ??
101 TableData
[noColumns
].leftBorder
= isBorder
;
102 TableData
[noColumns
].rightBorder
= FALSE
;
103 TableData
[noColumns
].justification
= 'r';
104 TableData
[noColumns
].width
= 2000; // Estimate
105 TableData
[noColumns
].absWidth
= FALSE
;
106 // TableData[noColumns].spacing = ??
123 while ((i
< len
) && (isdigit(ch
) || ch
== '.'))
130 // Assume we have 2 characters for units
131 numberBuf
[j
] = value
[i
];
133 numberBuf
[j
] = value
[i
];
136 if (value
[i
] == '}') i
++;
138 TableData
[noColumns
].leftBorder
= isBorder
;
139 TableData
[noColumns
].rightBorder
= FALSE
;
140 TableData
[noColumns
].justification
= 'l';
141 TableData
[noColumns
].width
= 20*ParseUnitArgument(numberBuf
);
142 TableData
[noColumns
].absWidth
= TRUE
;
143 // TableData[noColumns].spacing = ??
149 char *buf
= new char[strlen(value
) + 80];
150 sprintf(buf
, "Tabular first argument \"%s\" too complex!", value
);
157 TableData
[noColumns
-1].rightBorder
= TRUE
;