]>
git.saurik.com Git - wxWidgets.git/blob - utils/tex2rtf/src/table.cpp
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Utilities for manipulating tables
4 // Author: Julian Smart
5 // Modified by: Wlodzimiez ABX Skiba 2003/2004 Unicode support
9 // Copyright: (c) Julian Smart
10 // Licence: wxWindows licence
11 /////////////////////////////////////////////////////////////////////////////
13 // For compilers that support precompilation, includes "wx.h".
14 #include "wx/wxprec.h"
41 ColumnData TableData
[40];
42 bool inTabular
= false;
44 bool startRows
= false;
45 bool tableVerticalLineLeft
= false;
46 bool tableVerticalLineRight
= false;
47 int noColumns
= 0; // Current number of columns in table
50 int currentRowNumber
= 0;
53 * Parse table argument
57 bool ParseTableArgument(wxChar
*value
)
61 int len
= wxStrlen(value
);
62 bool isBorder
= false;
73 TableData
[noColumns
].leftBorder
= isBorder
;
74 TableData
[noColumns
].rightBorder
= false;
75 TableData
[noColumns
].justification
= 'l';
76 TableData
[noColumns
].width
= 2000; // Estimate
77 TableData
[noColumns
].absWidth
= false;
78 // TableData[noColumns].spacing = ??
85 TableData
[noColumns
].leftBorder
= isBorder
;
86 TableData
[noColumns
].rightBorder
= false;
87 TableData
[noColumns
].justification
= 'c';
88 TableData
[noColumns
].width
= defaultTableColumnWidth
; // Estimate
89 TableData
[noColumns
].absWidth
= false;
90 // TableData[noColumns].spacing = ??
97 TableData
[noColumns
].leftBorder
= isBorder
;
98 TableData
[noColumns
].rightBorder
= false;
99 TableData
[noColumns
].justification
= 'r';
100 TableData
[noColumns
].width
= 2000; // Estimate
101 TableData
[noColumns
].absWidth
= false;
102 // TableData[noColumns].spacing = ??
111 wxChar numberBuf
[50];
119 while ((i
< len
) && (isdigit(ch
) || ch
== '.'))
121 numberBuf
[j
] = (wxChar
)ch
;
126 // Assume we have 2 characters for units
127 numberBuf
[j
] = value
[i
];
129 numberBuf
[j
] = value
[i
];
132 if (value
[i
] == '}') i
++;
134 TableData
[noColumns
].leftBorder
= isBorder
;
135 TableData
[noColumns
].rightBorder
= false;
136 TableData
[noColumns
].justification
= 'l';
137 TableData
[noColumns
].width
= 20*ParseUnitArgument(numberBuf
);
138 TableData
[noColumns
].absWidth
= true;
139 // TableData[noColumns].spacing = ??
145 wxChar
*buf
= new wxChar
[wxStrlen(value
) + 80];
146 wxSnprintf(buf
, wxStrlen(value
) + 80, _T("Tabular first argument \"%s\" too complex!"), value
);
153 TableData
[noColumns
-1].rightBorder
= true;