]>
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"
46 ColumnData TableData
[40];
47 bool inTabular
= FALSE
;
49 bool startRows
= FALSE
;
50 bool tableVerticalLineLeft
= FALSE
;
51 bool tableVerticalLineRight
= FALSE
;
52 int noColumns
= 0; // Current number of columns in table
55 int currentRowNumber
= 0;
58 * Parse table argument
62 bool ParseTableArgument(char *value
)
66 int len
= strlen(value
);
67 bool isBorder
= FALSE
;
78 TableData
[noColumns
].leftBorder
= isBorder
;
79 TableData
[noColumns
].rightBorder
= FALSE
;
80 TableData
[noColumns
].justification
= 'l';
81 TableData
[noColumns
].width
= 2000; // Estimate
82 TableData
[noColumns
].absWidth
= FALSE
;
83 // TableData[noColumns].spacing = ??
90 TableData
[noColumns
].leftBorder
= isBorder
;
91 TableData
[noColumns
].rightBorder
= FALSE
;
92 TableData
[noColumns
].justification
= 'c';
93 TableData
[noColumns
].width
= defaultTableColumnWidth
; // Estimate
94 TableData
[noColumns
].absWidth
= FALSE
;
95 // TableData[noColumns].spacing = ??
102 TableData
[noColumns
].leftBorder
= isBorder
;
103 TableData
[noColumns
].rightBorder
= FALSE
;
104 TableData
[noColumns
].justification
= 'r';
105 TableData
[noColumns
].width
= 2000; // Estimate
106 TableData
[noColumns
].absWidth
= FALSE
;
107 // TableData[noColumns].spacing = ??
124 while ((i
< len
) && (isdigit(ch
) || ch
== '.'))
131 // Assume we have 2 characters for units
132 numberBuf
[j
] = value
[i
];
134 numberBuf
[j
] = value
[i
];
137 if (value
[i
] == '}') i
++;
139 TableData
[noColumns
].leftBorder
= isBorder
;
140 TableData
[noColumns
].rightBorder
= FALSE
;
141 TableData
[noColumns
].justification
= 'l';
142 TableData
[noColumns
].width
= 20*ParseUnitArgument(numberBuf
);
143 TableData
[noColumns
].absWidth
= TRUE
;
144 // TableData[noColumns].spacing = ??
150 char *buf
= new char[strlen(value
) + 80];
151 sprintf(buf
, "Tabular first argument \"%s\" too complex!", value
);
158 TableData
[noColumns
-1].rightBorder
= TRUE
;