]>
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"
42 ColumnData TableData
[40];
43 bool inTabular
= FALSE
;
45 bool startRows
= FALSE
;
46 bool tableVerticalLineLeft
= FALSE
;
47 bool tableVerticalLineRight
= FALSE
;
48 int noColumns
= 0; // Current number of columns in table
51 int currentRowNumber
= 0;
54 * Parse table argument
58 bool ParseTableArgument(char *value
)
62 int len
= strlen(value
);
63 bool isBorder
= FALSE
;
74 TableData
[noColumns
].leftBorder
= isBorder
;
75 TableData
[noColumns
].rightBorder
= FALSE
;
76 TableData
[noColumns
].justification
= 'l';
77 TableData
[noColumns
].width
= 2000; // Estimate
78 TableData
[noColumns
].absWidth
= FALSE
;
79 // TableData[noColumns].spacing = ??
86 TableData
[noColumns
].leftBorder
= isBorder
;
87 TableData
[noColumns
].rightBorder
= FALSE
;
88 TableData
[noColumns
].justification
= 'c';
89 TableData
[noColumns
].width
= defaultTableColumnWidth
; // Estimate
90 TableData
[noColumns
].absWidth
= FALSE
;
91 // TableData[noColumns].spacing = ??
98 TableData
[noColumns
].leftBorder
= isBorder
;
99 TableData
[noColumns
].rightBorder
= FALSE
;
100 TableData
[noColumns
].justification
= 'r';
101 TableData
[noColumns
].width
= 2000; // Estimate
102 TableData
[noColumns
].absWidth
= FALSE
;
103 // TableData[noColumns].spacing = ??
120 while ((i
< len
) && (isdigit(ch
) || ch
== '.'))
127 // Assume we have 2 characters for units
128 numberBuf
[j
] = value
[i
];
130 numberBuf
[j
] = value
[i
];
133 if (value
[i
] == '}') i
++;
135 TableData
[noColumns
].leftBorder
= isBorder
;
136 TableData
[noColumns
].rightBorder
= FALSE
;
137 TableData
[noColumns
].justification
= 'l';
138 TableData
[noColumns
].width
= 20*ParseUnitArgument(numberBuf
);
139 TableData
[noColumns
].absWidth
= TRUE
;
140 // TableData[noColumns].spacing = ??
146 char *buf
= new char[strlen(value
) + 80];
147 sprintf(buf
, "Tabular first argument \"%s\" too complex!", value
);
154 TableData
[noColumns
-1].rightBorder
= TRUE
;