]>
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"
44 ColumnData TableData
[40];
45 bool inTabular
= FALSE
;
47 bool startRows
= FALSE
;
48 bool tableVerticalLineLeft
= FALSE
;
49 bool tableVerticalLineRight
= FALSE
;
50 int noColumns
= 0; // Current number of columns in table
53 int currentRowNumber
= 0;
56 * Parse table argument
60 bool ParseTableArgument(char *value
)
64 int len
= strlen(value
);
65 bool isBorder
= FALSE
;
76 TableData
[noColumns
].leftBorder
= isBorder
;
77 TableData
[noColumns
].rightBorder
= FALSE
;
78 TableData
[noColumns
].justification
= 'l';
79 TableData
[noColumns
].width
= 2000; // Estimate
80 TableData
[noColumns
].absWidth
= FALSE
;
81 // TableData[noColumns].spacing = ??
88 TableData
[noColumns
].leftBorder
= isBorder
;
89 TableData
[noColumns
].rightBorder
= FALSE
;
90 TableData
[noColumns
].justification
= 'c';
91 TableData
[noColumns
].width
= defaultTableColumnWidth
; // Estimate
92 TableData
[noColumns
].absWidth
= FALSE
;
93 // TableData[noColumns].spacing = ??
100 TableData
[noColumns
].leftBorder
= isBorder
;
101 TableData
[noColumns
].rightBorder
= FALSE
;
102 TableData
[noColumns
].justification
= 'r';
103 TableData
[noColumns
].width
= 2000; // Estimate
104 TableData
[noColumns
].absWidth
= FALSE
;
105 // TableData[noColumns].spacing = ??
122 while ((i
< len
) && (isdigit(ch
) || ch
== '.'))
129 // Assume we have 2 characters for units
130 numberBuf
[j
] = value
[i
];
132 numberBuf
[j
] = value
[i
];
135 if (value
[i
] == '}') i
++;
137 TableData
[noColumns
].leftBorder
= isBorder
;
138 TableData
[noColumns
].rightBorder
= FALSE
;
139 TableData
[noColumns
].justification
= 'l';
140 TableData
[noColumns
].width
= 20*ParseUnitArgument(numberBuf
);
141 TableData
[noColumns
].absWidth
= TRUE
;
142 // TableData[noColumns].spacing = ??
148 char *buf
= new char[strlen(value
) + 80];
149 sprintf(buf
, "Tabular first argument \"%s\" too complex!", value
);
156 TableData
[noColumns
-1].rightBorder
= TRUE
;