|
84 | 84 | * |
85 | 85 | * <pre> |
86 | 86 | * \code |
87 | | - *#include "unicode/ubidi.h" |
| 87 | + *#include <unicode/ubidi.h> |
88 | 88 | * |
89 | 89 | *typedef enum { |
90 | 90 | * styleNormal=0, styleSelected=1, |
|
136 | 136 | * int styleLimit; |
137 | 137 | * |
138 | 138 | * for(i=0; i<styleRunCount; ++i) { |
139 | | - * styleLimit=styleRun[i].limit; |
| 139 | + * styleLimit=styleRuns[i].limit; |
140 | 140 | * if(start<styleLimit) { |
141 | 141 | * if(styleLimit>limit) { styleLimit=limit; } |
142 | 142 | * renderRun(text, start, styleLimit, |
143 | | - * direction, styleRun[i].style); |
| 143 | + * direction, styleRuns[i].style); |
144 | 144 | * if(styleLimit==limit) { break; } |
145 | 145 | * start=styleLimit; |
146 | 146 | * } |
|
150 | 150 | * |
151 | 151 | * for(i=styleRunCount-1; i>=0; --i) { |
152 | 152 | * if(i>0) { |
153 | | - * styleStart=styleRun[i-1].limit; |
| 153 | + * styleStart=styleRuns[i-1].limit; |
154 | 154 | * } else { |
155 | 155 | * styleStart=0; |
156 | 156 | * } |
157 | 157 | * if(limit>=styleStart) { |
158 | 158 | * if(styleStart<start) { styleStart=start; } |
159 | 159 | * renderRun(text, styleStart, limit, |
160 | | - * direction, styleRun[i].style); |
| 160 | + * direction, styleRuns[i].style); |
161 | 161 | * if(styleStart==start) { break; } |
162 | 162 | * limit=styleStart; |
163 | 163 | * } |
|
168 | 168 | * // the line object represents text[start..limit-1] |
169 | 169 | * void renderLine(UBiDi *line, const UChar *text, |
170 | 170 | * int32_t start, int32_t limit, |
171 | | - * const StyleRun *styleRuns, int styleRunCount) { |
| 171 | + * const StyleRun *styleRuns, int styleRunCount, |
| 172 | + * UErrorCode *pErrorCode) { |
172 | 173 | * UBiDiDirection direction=ubidi_getDirection(line); |
173 | 174 | * if(direction!=UBIDI_MIXED) { |
174 | 175 | * // unidirectional |
|
183 | 184 | * int32_t count, i, length; |
184 | 185 | * UBiDiLevel level; |
185 | 186 | * |
186 | | - * count=ubidi_countRuns(para, pErrorCode); |
| 187 | + * count=ubidi_countRuns(line, pErrorCode); |
187 | 188 | * if(U_SUCCESS(*pErrorCode)) { |
188 | 189 | * if(styleRunCount<=1) { |
189 | 190 | * Style style=styleRuns[0].style; |
190 | 191 | * |
191 | 192 | * // iterate over directional runs |
192 | 193 | * for(i=0; i<count; ++i) { |
193 | | - * direction=ubidi_getVisualRun(para, i, &start, &length); |
| 194 | + * direction=ubidi_getVisualRun(line, i, &start, &length); |
194 | 195 | * renderRun(text, start, start+length, direction, style); |
195 | 196 | * } |
196 | 197 | * } else { |
|
244 | 245 | * startLine(paraLevel, width); |
245 | 246 | * |
246 | 247 | * renderLine(para, text, 0, length, |
247 | | - * styleRuns, styleRunCount); |
| 248 | + * styleRuns, styleRunCount, pErrorCode); |
248 | 249 | * } else { |
249 | 250 | * UBiDi *line; |
250 | 251 | * |
|
268 | 269 | * |
269 | 270 | * renderLine(line, text, start, limit, |
270 | 271 | * styleRuns+styleRunStart, |
271 | | - * styleRunLimit-styleRunStart); |
| 272 | + * styleRunLimit-styleRunStart, pErrorCode); |
272 | 273 | * } |
273 | 274 | * if(limit==length) { break; } |
274 | 275 | * start=limit; |
|
0 commit comments