lok: vcl: fix multiple floatwin removal case more robustly.
[LibreOffice.git] / writerfilter / source / rtftok / rtfdispatchflag.cxx
blobb68262ff265e0218318efc3830d9432b22243dce
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
10 #include "rtfdocumentimpl.hxx"
12 #include <com/sun/star/drawing/XDrawPageSupplier.hpp>
13 #include <com/sun/star/drawing/XEnhancedCustomShapeDefaulter.hpp>
14 #include <com/sun/star/text/RelOrientation.hpp>
15 #include <com/sun/star/text/VertOrientation.hpp>
16 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
18 #include <filter/msfilter/escherex.hxx>
20 #include <ooxml/resourceids.hxx>
22 #include <sal/log.hxx>
24 #include "rtfsdrimport.hxx"
25 #include "rtfskipdestination.hxx"
27 using namespace com::sun::star;
29 namespace writerfilter
31 namespace rtftok
33 RTFError RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
35 setNeedSect(true);
36 checkUnicode(/*bUnicode =*/true, /*bHex =*/true);
37 RTFSkipDestination aSkip(*this);
38 int nParam = -1;
39 int nSprm = -1;
41 // Underline flags.
42 switch (nKeyword)
44 case RTF_ULD:
45 nSprm = NS_ooxml::LN_Value_ST_Underline_dotted;
46 break;
47 case RTF_ULW:
48 nSprm = NS_ooxml::LN_Value_ST_Underline_words;
49 break;
50 default:
51 break;
53 if (nSprm >= 0)
55 auto pValue = new RTFValue(nSprm);
56 m_aStates.top().aCharacterAttributes.set(NS_ooxml::LN_CT_Underline_val, pValue);
57 return RTFError::OK;
60 // Indentation
61 switch (nKeyword)
63 case RTF_QC:
64 nParam = NS_ooxml::LN_Value_ST_Jc_center;
65 break;
66 case RTF_QJ:
67 nParam = NS_ooxml::LN_Value_ST_Jc_both;
68 break;
69 case RTF_QL:
70 nParam = NS_ooxml::LN_Value_ST_Jc_left;
71 break;
72 case RTF_QR:
73 nParam = NS_ooxml::LN_Value_ST_Jc_right;
74 break;
75 case RTF_QD:
76 nParam = NS_ooxml::LN_Value_ST_Jc_both;
77 break;
78 default:
79 break;
81 if (nParam >= 0)
83 auto pValue = new RTFValue(nParam);
84 m_aStates.top().aParagraphSprms.set(NS_ooxml::LN_CT_PPrBase_jc, pValue);
85 m_bNeedPap = true;
86 return RTFError::OK;
89 // Font Alignment
90 switch (nKeyword)
92 case RTF_FAFIXED:
93 case RTF_FAAUTO:
94 nParam = NS_ooxml::LN_Value_doc_ST_TextAlignment_auto;
95 break;
96 case RTF_FAHANG:
97 nParam = NS_ooxml::LN_Value_doc_ST_TextAlignment_top;
98 break;
99 case RTF_FACENTER:
100 nParam = NS_ooxml::LN_Value_doc_ST_TextAlignment_center;
101 break;
102 case RTF_FAROMAN:
103 nParam = NS_ooxml::LN_Value_doc_ST_TextAlignment_baseline;
104 break;
105 case RTF_FAVAR:
106 nParam = NS_ooxml::LN_Value_doc_ST_TextAlignment_bottom;
107 break;
108 default:
109 break;
111 if (nParam >= 0)
113 auto pValue = new RTFValue(nParam);
114 m_aStates.top().aParagraphSprms.set(NS_ooxml::LN_CT_PPrBase_textAlignment, pValue);
115 return RTFError::OK;
118 // Tab kind.
119 switch (nKeyword)
121 case RTF_TQR:
122 nParam = NS_ooxml::LN_Value_ST_TabJc_right;
123 break;
124 case RTF_TQC:
125 nParam = NS_ooxml::LN_Value_ST_TabJc_center;
126 break;
127 case RTF_TQDEC:
128 nParam = NS_ooxml::LN_Value_ST_TabJc_decimal;
129 break;
130 default:
131 break;
133 if (nParam >= 0)
135 auto pValue = new RTFValue(nParam);
136 m_aStates.top().aTabAttributes.set(NS_ooxml::LN_CT_TabStop_val, pValue);
137 return RTFError::OK;
140 // Tab lead.
141 switch (nKeyword)
143 case RTF_TLDOT:
144 nParam = NS_ooxml::LN_Value_ST_TabTlc_dot;
145 break;
146 case RTF_TLMDOT:
147 nParam = NS_ooxml::LN_Value_ST_TabTlc_middleDot;
148 break;
149 case RTF_TLHYPH:
150 nParam = NS_ooxml::LN_Value_ST_TabTlc_hyphen;
151 break;
152 case RTF_TLUL:
153 nParam = NS_ooxml::LN_Value_ST_TabTlc_underscore;
154 break;
155 case RTF_TLTH:
156 nParam = NS_ooxml::LN_Value_ST_TabTlc_hyphen;
157 break; // thick line is not supported by dmapper, this is just a hack
158 case RTF_TLEQ:
159 nParam = NS_ooxml::LN_Value_ST_TabTlc_none;
160 break; // equal sign isn't, either
161 default:
162 break;
164 if (nParam >= 0)
166 auto pValue = new RTFValue(nParam);
167 m_aStates.top().aTabAttributes.set(NS_ooxml::LN_CT_TabStop_leader, pValue);
168 return RTFError::OK;
171 // Border types
173 switch (nKeyword)
175 // brdrhair and brdrs are the same, brdrw will make a difference
176 // map to values in ooxml/model.xml resource ST_Border
177 case RTF_BRDRHAIR:
178 case RTF_BRDRS:
179 nParam = NS_ooxml::LN_Value_ST_Border_single;
180 break;
181 case RTF_BRDRDOT:
182 nParam = NS_ooxml::LN_Value_ST_Border_dotted;
183 break;
184 case RTF_BRDRDASH:
185 nParam = NS_ooxml::LN_Value_ST_Border_dashed;
186 break;
187 case RTF_BRDRDB:
188 nParam = NS_ooxml::LN_Value_ST_Border_double;
189 break;
190 case RTF_BRDRTNTHSG:
191 nParam = NS_ooxml::LN_Value_ST_Border_thinThickSmallGap;
192 break;
193 case RTF_BRDRTNTHMG:
194 nParam = NS_ooxml::LN_Value_ST_Border_thinThickMediumGap;
195 break;
196 case RTF_BRDRTNTHLG:
197 nParam = NS_ooxml::LN_Value_ST_Border_thinThickLargeGap;
198 break;
199 case RTF_BRDRTHTNSG:
200 nParam = NS_ooxml::LN_Value_ST_Border_thickThinSmallGap;
201 break;
202 case RTF_BRDRTHTNMG:
203 nParam = NS_ooxml::LN_Value_ST_Border_thickThinMediumGap;
204 break;
205 case RTF_BRDRTHTNLG:
206 nParam = NS_ooxml::LN_Value_ST_Border_thickThinLargeGap;
207 break;
208 case RTF_BRDREMBOSS:
209 nParam = NS_ooxml::LN_Value_ST_Border_threeDEmboss;
210 break;
211 case RTF_BRDRENGRAVE:
212 nParam = NS_ooxml::LN_Value_ST_Border_threeDEngrave;
213 break;
214 case RTF_BRDROUTSET:
215 nParam = NS_ooxml::LN_Value_ST_Border_outset;
216 break;
217 case RTF_BRDRINSET:
218 nParam = NS_ooxml::LN_Value_ST_Border_inset;
219 break;
220 case RTF_BRDRDASHSM:
221 nParam = NS_ooxml::LN_Value_ST_Border_dashSmallGap;
222 break;
223 case RTF_BRDRDASHD:
224 nParam = NS_ooxml::LN_Value_ST_Border_dotDash;
225 break;
226 case RTF_BRDRDASHDD:
227 nParam = NS_ooxml::LN_Value_ST_Border_dotDotDash;
228 break;
229 case RTF_BRDRNONE:
230 nParam = NS_ooxml::LN_Value_ST_Border_none;
231 break;
232 default:
233 break;
235 if (nParam >= 0)
237 auto pValue = new RTFValue(nParam);
238 putBorderProperty(m_aStates, NS_ooxml::LN_CT_Border_val, pValue);
239 return RTFError::OK;
243 // Section breaks
244 switch (nKeyword)
246 case RTF_SBKNONE:
247 nParam = NS_ooxml::LN_Value_ST_SectionMark_continuous;
248 break;
249 case RTF_SBKCOL:
250 nParam = NS_ooxml::LN_Value_ST_SectionMark_nextColumn;
251 break;
252 case RTF_SBKPAGE:
253 nParam = NS_ooxml::LN_Value_ST_SectionMark_nextPage;
254 break;
255 case RTF_SBKEVEN:
256 nParam = NS_ooxml::LN_Value_ST_SectionMark_evenPage;
257 break;
258 case RTF_SBKODD:
259 nParam = NS_ooxml::LN_Value_ST_SectionMark_oddPage;
260 break;
261 default:
262 break;
264 if (nParam >= 0)
266 if (m_nResetBreakOnSectBreak != RTF_invalid)
268 m_nResetBreakOnSectBreak = nKeyword;
270 auto pValue = new RTFValue(nParam);
271 m_aStates.top().aSectionSprms.set(NS_ooxml::LN_EG_SectPrContents_type, pValue);
272 return RTFError::OK;
275 // Footnote numbering
276 switch (nKeyword)
278 case RTF_FTNNAR:
279 nParam = NS_ooxml::LN_Value_ST_NumberFormat_decimal;
280 break;
281 case RTF_FTNNALC:
282 nParam = NS_ooxml::LN_Value_ST_NumberFormat_lowerLetter;
283 break;
284 case RTF_FTNNAUC:
285 nParam = NS_ooxml::LN_Value_ST_NumberFormat_upperLetter;
286 break;
287 case RTF_FTNNRLC:
288 nParam = NS_ooxml::LN_Value_ST_NumberFormat_lowerRoman;
289 break;
290 case RTF_FTNNRUC:
291 nParam = NS_ooxml::LN_Value_ST_NumberFormat_upperRoman;
292 break;
293 case RTF_FTNNCHI:
294 nParam = NS_ooxml::LN_Value_ST_NumberFormat_chicago;
295 break;
296 default:
297 break;
299 if (nParam >= 0)
301 auto pValue = new RTFValue(nParam);
302 putNestedSprm(m_aDefaultState.aParagraphSprms, NS_ooxml::LN_EG_SectPrContents_footnotePr,
303 NS_ooxml::LN_CT_FtnProps_numFmt, pValue);
304 return RTFError::OK;
307 // Footnote restart type
308 switch (nKeyword)
310 case RTF_FTNRSTPG:
311 nParam = NS_ooxml::LN_Value_ST_RestartNumber_eachPage;
312 break;
313 case RTF_FTNRESTART:
314 nParam = NS_ooxml::LN_Value_ST_RestartNumber_eachSect;
315 break;
316 case RTF_FTNRSTCONT:
317 nParam = NS_ooxml::LN_Value_ST_RestartNumber_continuous;
318 break;
319 default:
320 break;
322 if (nParam >= 0)
324 auto pValue = new RTFValue(nParam);
325 putNestedSprm(m_aDefaultState.aParagraphSprms, NS_ooxml::LN_EG_SectPrContents_footnotePr,
326 NS_ooxml::LN_EG_FtnEdnNumProps_numRestart, pValue);
327 return RTFError::OK;
330 // Endnote numbering
331 switch (nKeyword)
333 case RTF_AFTNNAR:
334 nParam = NS_ooxml::LN_Value_ST_NumberFormat_decimal;
335 break;
336 case RTF_AFTNNALC:
337 nParam = NS_ooxml::LN_Value_ST_NumberFormat_lowerLetter;
338 break;
339 case RTF_AFTNNAUC:
340 nParam = NS_ooxml::LN_Value_ST_NumberFormat_upperLetter;
341 break;
342 case RTF_AFTNNRLC:
343 nParam = NS_ooxml::LN_Value_ST_NumberFormat_lowerRoman;
344 break;
345 case RTF_AFTNNRUC:
346 nParam = NS_ooxml::LN_Value_ST_NumberFormat_upperRoman;
347 break;
348 case RTF_AFTNNCHI:
349 nParam = NS_ooxml::LN_Value_ST_NumberFormat_chicago;
350 break;
351 default:
352 break;
354 if (nParam >= 0)
356 auto pValue = new RTFValue(nParam);
357 putNestedSprm(m_aDefaultState.aParagraphSprms, NS_ooxml::LN_EG_SectPrContents_endnotePr,
358 NS_ooxml::LN_CT_EdnProps_numFmt, pValue);
359 return RTFError::OK;
362 switch (nKeyword)
364 case RTF_TRQL:
365 nParam = NS_ooxml::LN_Value_ST_Jc_left;
366 break;
367 case RTF_TRQC:
368 nParam = NS_ooxml::LN_Value_ST_Jc_center;
369 break;
370 case RTF_TRQR:
371 nParam = NS_ooxml::LN_Value_ST_Jc_right;
372 break;
373 default:
374 break;
376 if (nParam >= 0)
378 auto pValue = new RTFValue(nParam);
379 m_aStates.top().aTableRowSprms.set(NS_ooxml::LN_CT_TrPrBase_jc, pValue);
380 return RTFError::OK;
383 // Cell Text Flow
384 switch (nKeyword)
386 case RTF_CLTXLRTB:
387 nParam = NS_ooxml::LN_Value_ST_TextDirection_lrTb;
388 break;
389 case RTF_CLTXTBRL:
390 nParam = NS_ooxml::LN_Value_ST_TextDirection_tbRl;
391 break;
392 case RTF_CLTXBTLR:
393 nParam = NS_ooxml::LN_Value_ST_TextDirection_btLr;
394 break;
395 case RTF_CLTXLRTBV:
396 nParam = NS_ooxml::LN_Value_ST_TextDirection_lrTbV;
397 break;
398 case RTF_CLTXTBRLV:
399 nParam = NS_ooxml::LN_Value_ST_TextDirection_tbRlV;
400 break;
401 default:
402 break;
404 if (nParam >= 0)
406 auto pValue = new RTFValue(nParam);
407 m_aStates.top().aTableCellSprms.set(NS_ooxml::LN_CT_TcPrBase_textDirection, pValue);
410 // Trivial paragraph flags
411 switch (nKeyword)
413 case RTF_KEEP:
414 if (m_aStates.top().pCurrentBuffer != &m_aTableBufferStack.back())
415 nParam = NS_ooxml::LN_CT_PPrBase_keepLines;
416 break;
417 case RTF_KEEPN:
418 if (m_aStates.top().pCurrentBuffer != &m_aTableBufferStack.back())
419 nParam = NS_ooxml::LN_CT_PPrBase_keepNext;
420 break;
421 case RTF_INTBL:
423 m_aStates.top().pCurrentBuffer = &m_aTableBufferStack.back();
424 nParam = NS_ooxml::LN_inTbl;
426 break;
427 case RTF_PAGEBB:
428 nParam = NS_ooxml::LN_CT_PPrBase_pageBreakBefore;
429 break;
430 default:
431 break;
433 if (nParam >= 0)
435 auto pValue = new RTFValue(1);
436 m_aStates.top().aParagraphSprms.erase(NS_ooxml::LN_inTbl);
437 m_aStates.top().aParagraphSprms.set(nParam, pValue);
438 return RTFError::OK;
441 switch (nKeyword)
443 case RTF_FNIL:
444 case RTF_FROMAN:
445 case RTF_FSWISS:
446 case RTF_FMODERN:
447 case RTF_FSCRIPT:
448 case RTF_FDECOR:
449 case RTF_FTECH:
450 case RTF_FBIDI:
451 // TODO ooxml:CT_Font_family seems to be ignored by the domain mapper
452 break;
453 case RTF_ANSI:
454 m_aStates.top().nCurrentEncoding = RTL_TEXTENCODING_MS_1252;
455 break;
456 case RTF_MAC:
457 m_aDefaultState.nCurrentEncoding = RTL_TEXTENCODING_APPLE_ROMAN;
458 m_aStates.top().nCurrentEncoding = m_aDefaultState.nCurrentEncoding;
459 break;
460 case RTF_PC:
461 m_aDefaultState.nCurrentEncoding = RTL_TEXTENCODING_IBM_437;
462 m_aStates.top().nCurrentEncoding = m_aDefaultState.nCurrentEncoding;
463 break;
464 case RTF_PCA:
465 m_aDefaultState.nCurrentEncoding = RTL_TEXTENCODING_IBM_850;
466 m_aStates.top().nCurrentEncoding = m_aDefaultState.nCurrentEncoding;
467 break;
468 case RTF_PLAIN:
470 m_aStates.top().aCharacterSprms = getDefaultState().aCharacterSprms;
471 m_aStates.top().nCurrentEncoding = getEncoding(getFontIndex(m_nDefaultFontIndex));
472 m_aStates.top().aCharacterAttributes = getDefaultState().aCharacterAttributes;
473 m_aStates.top().nCurrentCharacterStyleIndex = -1;
474 m_aStates.top().isRightToLeft = false;
475 m_aStates.top().eRunType = RTFParserState::RunType::LOCH;
477 break;
478 case RTF_PARD:
480 if (m_bHadPicture)
481 dispatchSymbol(RTF_PAR);
482 // \pard is allowed between \cell and \row, but in that case it should not reset the fact that we're inside a table.
483 // It should not reset the paragraph style, either, so remember the old paragraph style.
484 RTFValue::Pointer_t pOldStyle
485 = m_aStates.top().aParagraphSprms.find(NS_ooxml::LN_CT_PPrBase_pStyle);
486 m_aStates.top().aParagraphSprms = m_aDefaultState.aParagraphSprms;
487 m_aStates.top().aParagraphAttributes = m_aDefaultState.aParagraphAttributes;
489 if (m_nTopLevelCells == 0 && m_nNestedCells == 0)
491 // Reset that we're in a table.
492 m_aStates.top().pCurrentBuffer = nullptr;
494 else
496 // We are still in a table.
497 m_aStates.top().aParagraphSprms.set(NS_ooxml::LN_inTbl, new RTFValue(1));
498 if (m_bAfterCellBeforeRow && pOldStyle)
499 // And we still have the same paragraph style.
500 m_aStates.top().aParagraphSprms.set(NS_ooxml::LN_CT_PPrBase_pStyle, pOldStyle);
501 // Ideally getDefaultSPRM() would take care of this, but it would not when we're buffering.
502 m_aStates.top().aParagraphSprms.set(NS_ooxml::LN_CT_PPrBase_tabs, new RTFValue());
504 resetFrame();
506 // Reset currently selected paragraph style as well, unless we are in the special "after \cell, before \row" state.
507 // By default the style with index 0 is applied.
508 if (!m_bAfterCellBeforeRow)
510 OUString const aName = getStyleName(0);
511 // But only in case it's not a character style.
512 if (!aName.isEmpty()
513 && getStyleType(0) != NS_ooxml::LN_Value_ST_StyleType_character)
515 m_aStates.top().aParagraphSprms.set(NS_ooxml::LN_CT_PPrBase_pStyle,
516 new RTFValue(aName));
517 m_aStates.top().nCurrentStyleIndex = 0;
519 else
521 m_aStates.top().nCurrentStyleIndex = -1;
524 // Need to send paragraph properties again, if there will be any.
525 m_bNeedPap = true;
526 break;
528 case RTF_SECTD:
530 m_aStates.top().aSectionSprms = m_aDefaultState.aSectionSprms;
531 m_aStates.top().aSectionAttributes = m_aDefaultState.aSectionAttributes;
533 break;
534 case RTF_TROWD:
536 // Back these up, in case later we still need this info.
537 backupTableRowProperties();
538 resetTableRowProperties();
539 // In case the table definition is in the middle of the row
540 // (invalid), make sure table definition is emitted.
541 m_bNeedPap = true;
543 break;
544 case RTF_WIDCTLPAR:
545 case RTF_NOWIDCTLPAR:
547 auto pValue = new RTFValue(int(nKeyword == RTF_WIDCTLPAR));
548 m_aStates.top().aParagraphSprms.set(NS_ooxml::LN_CT_PPrBase_widowControl, pValue);
550 break;
551 case RTF_BOX:
553 RTFSprms aAttributes;
554 auto pValue = new RTFValue(aAttributes);
555 for (int i = 0; i < 4; i++)
556 m_aStates.top().aParagraphSprms.set(getParagraphBorder(i), pValue);
557 m_aStates.top().nBorderState = RTFBorderState::PARAGRAPH_BOX;
559 break;
560 case RTF_LTRSECT:
561 case RTF_RTLSECT:
563 auto pValue = new RTFValue(nKeyword == RTF_LTRSECT ? 0 : 1);
564 m_aStates.top().aParagraphSprms.set(NS_ooxml::LN_EG_SectPrContents_textDirection,
565 pValue);
567 break;
568 case RTF_LTRPAR:
569 case RTF_RTLPAR:
571 auto pValue = new RTFValue(nKeyword == RTF_LTRPAR ? 0 : 1);
572 m_aStates.top().aParagraphSprms.set(NS_ooxml::LN_CT_PPrBase_bidi, pValue);
574 break;
575 case RTF_LTRROW:
576 case RTF_RTLROW:
577 m_aStates.top().aTableRowSprms.set(NS_ooxml::LN_CT_TblPrBase_bidiVisual,
578 new RTFValue(int(nKeyword == RTF_RTLROW)));
579 break;
580 case RTF_LTRCH:
581 // dmapper does not support this.
582 m_aStates.top().isRightToLeft = false;
583 break;
584 case RTF_RTLCH:
585 m_aStates.top().isRightToLeft = true;
586 if (m_aDefaultState.nCurrentEncoding == RTL_TEXTENCODING_MS_1255)
587 m_aStates.top().nCurrentEncoding = m_aDefaultState.nCurrentEncoding;
588 break;
589 case RTF_ULNONE:
591 auto pValue = new RTFValue(NS_ooxml::LN_Value_ST_Underline_none);
592 m_aStates.top().aCharacterAttributes.set(NS_ooxml::LN_CT_Underline_val, pValue);
594 break;
595 case RTF_NONSHPPICT:
596 case RTF_MMATHPICT: // Picture group used by readers not understanding \moMath group
597 m_aStates.top().eDestination = Destination::SKIP;
598 break;
599 case RTF_CLBRDRT:
600 case RTF_CLBRDRL:
601 case RTF_CLBRDRB:
602 case RTF_CLBRDRR:
604 RTFSprms aAttributes;
605 RTFSprms aSprms;
606 auto pValue = new RTFValue(aAttributes, aSprms);
607 switch (nKeyword)
609 case RTF_CLBRDRT:
610 nParam = NS_ooxml::LN_CT_TcBorders_top;
611 break;
612 case RTF_CLBRDRL:
613 nParam = NS_ooxml::LN_CT_TcBorders_left;
614 break;
615 case RTF_CLBRDRB:
616 nParam = NS_ooxml::LN_CT_TcBorders_bottom;
617 break;
618 case RTF_CLBRDRR:
619 nParam = NS_ooxml::LN_CT_TcBorders_right;
620 break;
621 default:
622 break;
624 putNestedSprm(m_aStates.top().aTableCellSprms, NS_ooxml::LN_CT_TcPrBase_tcBorders,
625 nParam, pValue);
626 m_aStates.top().nBorderState = RTFBorderState::CELL;
628 break;
629 case RTF_PGBRDRT:
630 case RTF_PGBRDRL:
631 case RTF_PGBRDRB:
632 case RTF_PGBRDRR:
634 RTFSprms aAttributes;
635 RTFSprms aSprms;
636 auto pValue = new RTFValue(aAttributes, aSprms);
637 switch (nKeyword)
639 case RTF_PGBRDRT:
640 nParam = NS_ooxml::LN_CT_PageBorders_top;
641 break;
642 case RTF_PGBRDRL:
643 nParam = NS_ooxml::LN_CT_PageBorders_left;
644 break;
645 case RTF_PGBRDRB:
646 nParam = NS_ooxml::LN_CT_PageBorders_bottom;
647 break;
648 case RTF_PGBRDRR:
649 nParam = NS_ooxml::LN_CT_PageBorders_right;
650 break;
651 default:
652 break;
654 putNestedSprm(m_aStates.top().aSectionSprms, NS_ooxml::LN_EG_SectPrContents_pgBorders,
655 nParam, pValue);
656 m_aStates.top().nBorderState = RTFBorderState::PAGE;
658 break;
659 case RTF_BRDRT:
660 case RTF_BRDRL:
661 case RTF_BRDRB:
662 case RTF_BRDRR:
664 RTFSprms aAttributes;
665 RTFSprms aSprms;
666 auto pValue = new RTFValue(aAttributes, aSprms);
667 switch (nKeyword)
669 case RTF_BRDRT:
670 nParam = getParagraphBorder(0);
671 break;
672 case RTF_BRDRL:
673 nParam = getParagraphBorder(1);
674 break;
675 case RTF_BRDRB:
676 nParam = getParagraphBorder(2);
677 break;
678 case RTF_BRDRR:
679 nParam = getParagraphBorder(3);
680 break;
681 default:
682 break;
684 putNestedSprm(m_aStates.top().aParagraphSprms, NS_ooxml::LN_CT_PrBase_pBdr, nParam,
685 pValue);
686 m_aStates.top().nBorderState = RTFBorderState::PARAGRAPH;
688 break;
689 case RTF_CHBRDR:
691 RTFSprms aAttributes;
692 auto pValue = new RTFValue(aAttributes);
693 m_aStates.top().aCharacterSprms.set(NS_ooxml::LN_EG_RPrBase_bdr, pValue);
694 m_aStates.top().nBorderState = RTFBorderState::CHARACTER;
696 break;
697 case RTF_CLMGF:
699 auto pValue = new RTFValue(NS_ooxml::LN_Value_ST_Merge_restart);
700 m_aStates.top().aTableCellSprms.set(NS_ooxml::LN_CT_TcPrBase_hMerge, pValue);
702 break;
703 case RTF_CLMRG:
705 auto pValue = new RTFValue(NS_ooxml::LN_Value_ST_Merge_continue);
706 m_aStates.top().aTableCellSprms.set(NS_ooxml::LN_CT_TcPrBase_hMerge, pValue);
708 break;
709 case RTF_CLVMGF:
711 auto pValue = new RTFValue(NS_ooxml::LN_Value_ST_Merge_restart);
712 m_aStates.top().aTableCellSprms.set(NS_ooxml::LN_CT_TcPrBase_vMerge, pValue);
714 break;
715 case RTF_CLVMRG:
717 auto pValue = new RTFValue(NS_ooxml::LN_Value_ST_Merge_continue);
718 m_aStates.top().aTableCellSprms.set(NS_ooxml::LN_CT_TcPrBase_vMerge, pValue);
720 break;
721 case RTF_CLVERTALT:
722 case RTF_CLVERTALC:
723 case RTF_CLVERTALB:
725 switch (nKeyword)
727 case RTF_CLVERTALT:
728 nParam = NS_ooxml::LN_Value_ST_VerticalJc_top;
729 break;
730 case RTF_CLVERTALC:
731 nParam = NS_ooxml::LN_Value_ST_VerticalJc_center;
732 break;
733 case RTF_CLVERTALB:
734 nParam = NS_ooxml::LN_Value_ST_VerticalJc_bottom;
735 break;
736 default:
737 break;
739 auto pValue = new RTFValue(nParam);
740 m_aStates.top().aTableCellSprms.set(NS_ooxml::LN_CT_TcPrBase_vAlign, pValue);
742 break;
743 case RTF_TRKEEP:
745 auto pValue = new RTFValue(1);
746 m_aStates.top().aTableRowSprms.set(NS_ooxml::LN_CT_TrPrBase_cantSplit, pValue);
748 break;
749 case RTF_SECTUNLOCKED:
751 auto pValue = new RTFValue(0);
752 m_aStates.top().aSectionSprms.set(NS_ooxml::LN_EG_SectPrContents_formProt, pValue);
754 break;
755 case RTF_PGNBIDIA:
756 case RTF_PGNBIDIB:
757 // These should be mapped to NS_ooxml::LN_EG_SectPrContents_pgNumType, but dmapper has no API for that at the moment.
758 break;
759 case RTF_LOCH:
760 m_aStates.top().eRunType = RTFParserState::RunType::LOCH;
761 break;
762 case RTF_HICH:
763 m_aStates.top().eRunType = RTFParserState::RunType::HICH;
764 break;
765 case RTF_DBCH:
766 m_aStates.top().eRunType = RTFParserState::RunType::DBCH;
767 break;
768 case RTF_TITLEPG:
770 auto pValue = new RTFValue(1);
771 m_aStates.top().aSectionSprms.set(NS_ooxml::LN_EG_SectPrContents_titlePg, pValue);
773 break;
774 case RTF_SUPER:
776 // Make sure character properties are not lost if the document
777 // starts with a footnote.
778 if (!isStyleSheetImport())
780 checkFirstRun();
781 checkNeedPap();
784 if (!m_aStates.top().pCurrentBuffer)
785 m_aStates.top().pCurrentBuffer = &m_aSuperBuffer;
787 auto pValue = new RTFValue("superscript");
788 m_aStates.top().aCharacterSprms.set(NS_ooxml::LN_EG_RPrBase_vertAlign, pValue);
790 break;
791 case RTF_SUB:
793 auto pValue = new RTFValue("subscript");
794 m_aStates.top().aCharacterSprms.set(NS_ooxml::LN_EG_RPrBase_vertAlign, pValue);
796 break;
797 case RTF_NOSUPERSUB:
799 if (m_aStates.top().pCurrentBuffer == &m_aSuperBuffer)
801 replayBuffer(m_aSuperBuffer, nullptr, nullptr);
802 m_aStates.top().pCurrentBuffer = nullptr;
804 m_aStates.top().aCharacterSprms.erase(NS_ooxml::LN_EG_RPrBase_vertAlign);
806 break;
807 case RTF_LINEPPAGE:
808 case RTF_LINECONT:
810 auto pValue = new RTFValue(nKeyword == RTF_LINEPPAGE
811 ? NS_ooxml::LN_Value_ST_LineNumberRestart_newPage
812 : NS_ooxml::LN_Value_ST_LineNumberRestart_continuous);
813 putNestedAttribute(m_aStates.top().aSectionSprms,
814 NS_ooxml::LN_EG_SectPrContents_lnNumType,
815 NS_ooxml::LN_CT_LineNumber_restart, pValue);
817 break;
818 case RTF_AENDDOC:
819 // Noop, this is the default in Writer.
820 break;
821 case RTF_AENDNOTES:
822 // Noop, Writer does not support having endnotes at the end of section.
823 break;
824 case RTF_AFTNRSTCONT:
825 // Noop, this is the default in Writer.
826 break;
827 case RTF_AFTNRESTART:
828 // Noop, Writer does not support restarting endnotes at each section.
829 break;
830 case RTF_FTNBJ:
831 // Noop, this is the default in Writer.
832 break;
833 case RTF_ENDDOC:
835 auto pValue = new RTFValue(NS_ooxml::LN_Value_ST_RestartNumber_eachSect);
836 putNestedSprm(m_aDefaultState.aParagraphSprms,
837 NS_ooxml::LN_EG_SectPrContents_footnotePr,
838 NS_ooxml::LN_EG_FtnEdnNumProps_numRestart, pValue);
840 break;
841 case RTF_NOLINE:
842 eraseNestedAttribute(m_aStates.top().aSectionSprms,
843 NS_ooxml::LN_EG_SectPrContents_lnNumType,
844 NS_ooxml::LN_CT_LineNumber_distance);
845 break;
846 case RTF_FORMSHADE:
847 // Noop, this is the default in Writer.
848 break;
849 case RTF_PNGBLIP:
850 m_aStates.top().aPicture.eStyle = RTFBmpStyle::PNG;
851 break;
852 case RTF_JPEGBLIP:
853 m_aStates.top().aPicture.eStyle = RTFBmpStyle::JPEG;
854 break;
855 case RTF_POSYT:
856 m_aStates.top().aFrame.setSprm(NS_ooxml::LN_CT_FramePr_yAlign,
857 NS_ooxml::LN_Value_doc_ST_YAlign_top);
858 break;
859 case RTF_POSYB:
860 m_aStates.top().aFrame.setSprm(NS_ooxml::LN_CT_FramePr_yAlign,
861 NS_ooxml::LN_Value_doc_ST_YAlign_bottom);
862 break;
863 case RTF_POSYC:
864 m_aStates.top().aFrame.setSprm(NS_ooxml::LN_CT_FramePr_yAlign,
865 NS_ooxml::LN_Value_doc_ST_YAlign_center);
866 break;
867 case RTF_POSYIN:
868 m_aStates.top().aFrame.setSprm(NS_ooxml::LN_CT_FramePr_yAlign,
869 NS_ooxml::LN_Value_doc_ST_YAlign_inside);
870 break;
871 case RTF_POSYOUT:
872 m_aStates.top().aFrame.setSprm(NS_ooxml::LN_CT_FramePr_yAlign,
873 NS_ooxml::LN_Value_doc_ST_YAlign_outside);
874 break;
875 case RTF_POSYIL:
876 m_aStates.top().aFrame.setSprm(NS_ooxml::LN_CT_FramePr_yAlign,
877 NS_ooxml::LN_Value_doc_ST_YAlign_inline);
878 break;
880 case RTF_PHMRG:
881 m_aStates.top().aFrame.setSprm(NS_ooxml::LN_CT_FramePr_hAnchor,
882 NS_ooxml::LN_Value_doc_ST_HAnchor_margin);
883 break;
884 case RTF_PVMRG:
885 m_aStates.top().aFrame.setSprm(NS_ooxml::LN_CT_FramePr_vAnchor,
886 NS_ooxml::LN_Value_doc_ST_VAnchor_margin);
887 break;
888 case RTF_PHPG:
889 m_aStates.top().aFrame.setSprm(NS_ooxml::LN_CT_FramePr_hAnchor,
890 NS_ooxml::LN_Value_doc_ST_HAnchor_page);
891 break;
892 case RTF_PVPG:
893 m_aStates.top().aFrame.setSprm(NS_ooxml::LN_CT_FramePr_vAnchor,
894 NS_ooxml::LN_Value_doc_ST_VAnchor_page);
895 break;
896 case RTF_PHCOL:
897 m_aStates.top().aFrame.setSprm(NS_ooxml::LN_CT_FramePr_hAnchor,
898 NS_ooxml::LN_Value_doc_ST_HAnchor_text);
899 break;
900 case RTF_PVPARA:
901 m_aStates.top().aFrame.setSprm(NS_ooxml::LN_CT_FramePr_vAnchor,
902 NS_ooxml::LN_Value_doc_ST_VAnchor_text);
903 break;
905 case RTF_POSXC:
906 m_aStates.top().aFrame.setSprm(NS_ooxml::LN_CT_FramePr_xAlign,
907 NS_ooxml::LN_Value_doc_ST_XAlign_center);
908 break;
909 case RTF_POSXI:
910 m_aStates.top().aFrame.setSprm(NS_ooxml::LN_CT_FramePr_xAlign,
911 NS_ooxml::LN_Value_doc_ST_XAlign_inside);
912 break;
913 case RTF_POSXO:
914 m_aStates.top().aFrame.setSprm(NS_ooxml::LN_CT_FramePr_xAlign,
915 NS_ooxml::LN_Value_doc_ST_XAlign_outside);
916 break;
917 case RTF_POSXL:
918 m_aStates.top().aFrame.setSprm(NS_ooxml::LN_CT_FramePr_xAlign,
919 NS_ooxml::LN_Value_doc_ST_XAlign_left);
920 break;
921 case RTF_POSXR:
922 m_aStates.top().aFrame.setSprm(NS_ooxml::LN_CT_FramePr_xAlign,
923 NS_ooxml::LN_Value_doc_ST_XAlign_right);
924 break;
926 case RTF_DPLINE:
927 case RTF_DPRECT:
928 case RTF_DPELLIPSE:
929 case RTF_DPTXBX:
930 case RTF_DPPOLYLINE:
931 case RTF_DPPOLYGON:
933 sal_Int32 nType = 0;
934 switch (nKeyword)
936 case RTF_DPLINE:
937 m_aStates.top().aDrawingObject.xShape.set(
938 getModelFactory()->createInstance("com.sun.star.drawing.LineShape"),
939 uno::UNO_QUERY);
940 break;
941 case RTF_DPPOLYLINE:
942 // The reason this is not a simple CustomShape is that in the old syntax we have no ViewBox info.
943 m_aStates.top().aDrawingObject.xShape.set(
944 getModelFactory()->createInstance("com.sun.star.drawing.PolyLineShape"),
945 uno::UNO_QUERY);
946 break;
947 case RTF_DPPOLYGON:
948 m_aStates.top().aDrawingObject.xShape.set(
949 getModelFactory()->createInstance("com.sun.star.drawing.PolyPolygonShape"),
950 uno::UNO_QUERY);
951 break;
952 case RTF_DPRECT:
953 m_aStates.top().aDrawingObject.xShape.set(
954 getModelFactory()->createInstance("com.sun.star.drawing.RectangleShape"),
955 uno::UNO_QUERY);
956 break;
957 case RTF_DPELLIPSE:
958 nType = ESCHER_ShpInst_Ellipse;
959 break;
960 case RTF_DPTXBX:
962 m_aStates.top().aDrawingObject.xShape.set(
963 getModelFactory()->createInstance("com.sun.star.text.TextFrame"),
964 uno::UNO_QUERY);
965 std::vector<beans::PropertyValue> aDefaults
966 = RTFSdrImport::getTextFrameDefaults(false);
967 for (const auto& rDefault : aDefaults)
969 if (!findPropertyName(m_aStates.top().aDrawingObject.aPendingProperties,
970 rDefault.Name))
971 m_aStates.top().aDrawingObject.aPendingProperties.push_back(rDefault);
973 checkFirstRun();
974 Mapper().startShape(m_aStates.top().aDrawingObject.xShape);
975 m_aStates.top().aDrawingObject.bHadShapeText = true;
977 break;
978 default:
979 break;
981 if (nType)
982 m_aStates.top().aDrawingObject.xShape.set(
983 getModelFactory()->createInstance("com.sun.star.drawing.CustomShape"),
984 uno::UNO_QUERY);
985 uno::Reference<drawing::XDrawPageSupplier> xDrawSupplier(m_xDstDoc, uno::UNO_QUERY);
986 m_aStates.top().aDrawingObject.xPropertySet.set(m_aStates.top().aDrawingObject.xShape,
987 uno::UNO_QUERY);
988 if (xDrawSupplier.is())
990 uno::Reference<drawing::XShapes> xShapes(xDrawSupplier->getDrawPage(),
991 uno::UNO_QUERY);
992 if (xShapes.is() && nKeyword != RTF_DPTXBX)
994 // set default VertOrient before inserting
995 m_aStates.top().aDrawingObject.xPropertySet->setPropertyValue(
996 "VertOrient", uno::makeAny(text::VertOrientation::NONE));
997 xShapes->add(m_aStates.top().aDrawingObject.xShape);
1000 if (nType)
1002 uno::Reference<drawing::XEnhancedCustomShapeDefaulter> xDefaulter(
1003 m_aStates.top().aDrawingObject.xShape, uno::UNO_QUERY);
1004 xDefaulter->createCustomShapeDefaults(OUString::number(nType));
1006 std::vector<beans::PropertyValue>& rPendingProperties
1007 = m_aStates.top().aDrawingObject.aPendingProperties;
1008 for (auto& rPendingProperty : rPendingProperties)
1009 m_aStates.top().aDrawingObject.xPropertySet->setPropertyValue(
1010 rPendingProperty.Name, rPendingProperty.Value);
1011 m_pSdrImport->resolveDhgt(m_aStates.top().aDrawingObject.xPropertySet,
1012 m_aStates.top().aDrawingObject.nDhgt, /*bOldStyle=*/true);
1014 break;
1015 case RTF_DOBXMARGIN:
1016 case RTF_DOBYMARGIN:
1018 beans::PropertyValue aPropertyValue;
1019 aPropertyValue.Name = (nKeyword == RTF_DOBXMARGIN ? OUString("HoriOrientRelation")
1020 : OUString("VertOrientRelation"));
1021 aPropertyValue.Value <<= text::RelOrientation::PAGE_PRINT_AREA;
1022 m_aStates.top().aDrawingObject.aPendingProperties.push_back(aPropertyValue);
1024 break;
1025 case RTF_DOBXPAGE:
1026 case RTF_DOBYPAGE:
1028 beans::PropertyValue aPropertyValue;
1029 aPropertyValue.Name = (nKeyword == RTF_DOBXPAGE ? OUString("HoriOrientRelation")
1030 : OUString("VertOrientRelation"));
1031 aPropertyValue.Value <<= text::RelOrientation::PAGE_FRAME;
1032 m_aStates.top().aDrawingObject.aPendingProperties.push_back(aPropertyValue);
1034 break;
1035 case RTF_DOBYPARA:
1037 beans::PropertyValue aPropertyValue;
1038 aPropertyValue.Name = "VertOrientRelation";
1039 aPropertyValue.Value <<= text::RelOrientation::FRAME;
1040 m_aStates.top().aDrawingObject.aPendingProperties.push_back(aPropertyValue);
1042 break;
1043 case RTF_CONTEXTUALSPACE:
1045 auto pValue = new RTFValue(1);
1046 m_aStates.top().aParagraphSprms.set(NS_ooxml::LN_CT_PPrBase_contextualSpacing, pValue);
1048 break;
1049 case RTF_LINKSTYLES:
1051 auto pValue = new RTFValue(1);
1052 m_aSettingsTableSprms.set(NS_ooxml::LN_CT_Settings_linkStyles, pValue);
1054 break;
1055 case RTF_PNLVLBODY:
1057 auto pValue = new RTFValue(2);
1058 m_aStates.top().aTableAttributes.set(NS_ooxml::LN_CT_AbstractNum_nsid, pValue);
1060 break;
1061 case RTF_PNDEC:
1063 auto pValue = new RTFValue(NS_ooxml::LN_Value_ST_NumberFormat_decimal);
1064 m_aStates.top().aTableSprms.set(NS_ooxml::LN_CT_Lvl_numFmt, pValue);
1066 break;
1067 case RTF_PNLVLBLT:
1069 m_aStates.top().aTableAttributes.set(NS_ooxml::LN_CT_AbstractNum_nsid, new RTFValue(1));
1070 m_aStates.top().aTableSprms.set(
1071 NS_ooxml::LN_CT_Lvl_numFmt,
1072 new RTFValue(NS_ooxml::LN_Value_ST_NumberFormat_bullet));
1074 break;
1075 case RTF_LANDSCAPE:
1077 auto pValue = new RTFValue(NS_ooxml::LN_Value_ST_PageOrientation_landscape);
1078 putNestedAttribute(m_aDefaultState.aSectionSprms, NS_ooxml::LN_EG_SectPrContents_pgSz,
1079 NS_ooxml::LN_CT_PageSz_orient, pValue);
1080 SAL_FALLTHROUGH; // set the default + current value
1082 case RTF_LNDSCPSXN:
1084 auto pValue = new RTFValue(NS_ooxml::LN_Value_ST_PageOrientation_landscape);
1085 putNestedAttribute(m_aStates.top().aSectionSprms, NS_ooxml::LN_EG_SectPrContents_pgSz,
1086 NS_ooxml::LN_CT_PageSz_orient, pValue);
1088 break;
1089 case RTF_SHPBXPAGE:
1090 m_aStates.top().aShape.nHoriOrientRelation = text::RelOrientation::PAGE_FRAME;
1091 m_aStates.top().aShape.nHoriOrientRelationToken
1092 = NS_ooxml::LN_Value_wordprocessingDrawing_ST_RelFromH_page;
1093 break;
1094 case RTF_SHPBYPAGE:
1095 m_aStates.top().aShape.nVertOrientRelation = text::RelOrientation::PAGE_FRAME;
1096 m_aStates.top().aShape.nVertOrientRelationToken
1097 = NS_ooxml::LN_Value_wordprocessingDrawing_ST_RelFromV_page;
1098 break;
1099 case RTF_DPLINEHOLLOW:
1100 m_aStates.top().aDrawingObject.nFLine = 0;
1101 break;
1102 case RTF_DPROUNDR:
1103 if (m_aStates.top().aDrawingObject.xPropertySet.is())
1104 // Seems this old syntax has no way to specify a custom radius, and this is the default
1105 m_aStates.top().aDrawingObject.xPropertySet->setPropertyValue(
1106 "CornerRadius", uno::makeAny(sal_Int32(83)));
1107 break;
1108 case RTF_NOWRAP:
1109 m_aStates.top().aFrame.setSprm(NS_ooxml::LN_CT_FramePr_wrap,
1110 NS_ooxml::LN_Value_doc_ST_Wrap_notBeside);
1111 break;
1112 case RTF_MNOR:
1113 m_bMathNor = true;
1114 break;
1115 case RTF_REVISIONS:
1116 m_aSettingsTableSprms.set(NS_ooxml::LN_CT_Settings_trackRevisions, new RTFValue(1));
1117 break;
1118 case RTF_BRDRSH:
1119 putBorderProperty(m_aStates, NS_ooxml::LN_CT_Border_shadow, new RTFValue(1));
1120 break;
1121 case RTF_NOCOLBAL:
1122 m_aSettingsTableSprms.set(NS_ooxml::LN_CT_Compat_noColumnBalance, new RTFValue(1));
1123 break;
1124 case RTF_MARGMIRROR:
1125 m_aSettingsTableSprms.set(NS_ooxml::LN_CT_Settings_mirrorMargins, new RTFValue(1));
1126 break;
1127 case RTF_SAUTOUPD:
1128 m_aStates.top().aTableSprms.set(NS_ooxml::LN_CT_Style_autoRedefine, new RTFValue(1));
1129 break;
1130 case RTF_WIDOWCTRL:
1131 m_aSettingsTableSprms.set(NS_ooxml::LN_CT_Settings_widowControl, new RTFValue(1));
1132 break;
1133 case RTF_LINEBETCOL:
1134 putNestedAttribute(m_aStates.top().aSectionSprms, NS_ooxml::LN_EG_SectPrContents_cols,
1135 NS_ooxml::LN_CT_Columns_sep, new RTFValue(1));
1136 break;
1137 case RTF_PGNRESTART:
1138 putNestedAttribute(m_aStates.top().aSectionSprms,
1139 NS_ooxml::LN_EG_SectPrContents_pgNumType,
1140 NS_ooxml::LN_CT_PageNumber_start, new RTFValue(1));
1141 break;
1142 case RTF_PGNUCLTR:
1144 auto pIntValue = new RTFValue(NS_ooxml::LN_Value_ST_NumberFormat_upperLetter);
1145 putNestedAttribute(m_aStates.top().aSectionSprms,
1146 NS_ooxml::LN_EG_SectPrContents_pgNumType,
1147 NS_ooxml::LN_CT_PageNumber_fmt, pIntValue);
1149 break;
1150 case RTF_PGNLCLTR:
1152 auto pIntValue = new RTFValue(NS_ooxml::LN_Value_ST_NumberFormat_lowerLetter);
1153 putNestedAttribute(m_aStates.top().aSectionSprms,
1154 NS_ooxml::LN_EG_SectPrContents_pgNumType,
1155 NS_ooxml::LN_CT_PageNumber_fmt, pIntValue);
1157 break;
1158 case RTF_PGNUCRM:
1160 auto pIntValue = new RTFValue(NS_ooxml::LN_Value_ST_NumberFormat_upperRoman);
1161 putNestedAttribute(m_aStates.top().aSectionSprms,
1162 NS_ooxml::LN_EG_SectPrContents_pgNumType,
1163 NS_ooxml::LN_CT_PageNumber_fmt, pIntValue);
1165 break;
1166 case RTF_PGNLCRM:
1168 auto pIntValue = new RTFValue(NS_ooxml::LN_Value_ST_NumberFormat_lowerRoman);
1169 putNestedAttribute(m_aStates.top().aSectionSprms,
1170 NS_ooxml::LN_EG_SectPrContents_pgNumType,
1171 NS_ooxml::LN_CT_PageNumber_fmt, pIntValue);
1173 break;
1174 case RTF_PGNDEC:
1176 auto pIntValue = new RTFValue(NS_ooxml::LN_Value_ST_NumberFormat_decimal);
1177 putNestedAttribute(m_aStates.top().aSectionSprms,
1178 NS_ooxml::LN_EG_SectPrContents_pgNumType,
1179 NS_ooxml::LN_CT_PageNumber_fmt, pIntValue);
1181 break;
1182 case RTF_HTMAUTSP:
1183 m_aSettingsTableSprms.set(NS_ooxml::LN_CT_Compat_doNotUseHTMLParagraphAutoSpacing,
1184 new RTFValue(0));
1185 break;
1186 default:
1188 SAL_INFO("writerfilter", "TODO handle flag '" << keywordToString(nKeyword) << "'");
1189 aSkip.setParsed(false);
1191 break;
1193 return RTFError::OK;
1196 } // namespace rtftok
1197 } // namespace writerfilter
1199 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */