]>
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"
29 #include "wx/beforestd.h"
37 #include "wx/afterstd.h"
43 ColumnData TableData
[40];
44 bool inTabular
= false;
46 bool startRows
= false;
47 bool tableVerticalLineLeft
= false;
48 bool tableVerticalLineRight
= false;
49 int noColumns
= 0; // Current number of columns in table
52 int currentRowNumber
= 0;
55 * Parse table argument
59 bool ParseTableArgument(wxChar
*value
)
63 int len
= wxStrlen(value
);
64 bool isBorder
= false;
75 TableData
[noColumns
].leftBorder
= isBorder
;
76 TableData
[noColumns
].rightBorder
= false;
77 TableData
[noColumns
].justification
= 'l';
78 TableData
[noColumns
].width
= 2000; // Estimate
79 TableData
[noColumns
].absWidth
= false;
80 // TableData[noColumns].spacing = ??
87 TableData
[noColumns
].leftBorder
= isBorder
;
88 TableData
[noColumns
].rightBorder
= false;
89 TableData
[noColumns
].justification
= 'c';
90 TableData
[noColumns
].width
= defaultTableColumnWidth
; // Estimate
91 TableData
[noColumns
].absWidth
= false;
92 // TableData[noColumns].spacing = ??
99 TableData
[noColumns
].leftBorder
= isBorder
;
100 TableData
[noColumns
].rightBorder
= false;
101 TableData
[noColumns
].justification
= 'r';
102 TableData
[noColumns
].width
= 2000; // Estimate
103 TableData
[noColumns
].absWidth
= false;
104 // TableData[noColumns].spacing = ??
113 wxChar numberBuf
[50];
121 while ((i
< len
) && (isdigit(ch
) || ch
== '.'))
123 numberBuf
[j
] = (wxChar
)ch
;
128 // Assume we have 2 characters for units
129 numberBuf
[j
] = value
[i
];
131 numberBuf
[j
] = value
[i
];
134 if (value
[i
] == '}') i
++;
136 TableData
[noColumns
].leftBorder
= isBorder
;
137 TableData
[noColumns
].rightBorder
= false;
138 TableData
[noColumns
].justification
= 'l';
139 TableData
[noColumns
].width
= 20*ParseUnitArgument(numberBuf
);
140 TableData
[noColumns
].absWidth
= true;
141 // TableData[noColumns].spacing = ??
147 wxChar
*buf
= new wxChar
[wxStrlen(value
) + 80];
148 wxSnprintf(buf
, wxStrlen(value
) + 80, _T("Tabular first argument \"%s\" too complex!"), value
);
155 TableData
[noColumns
-1].rightBorder
= true;