LibreOffice Module editeng (master) 1
svxrtf.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include <memory>
21#include <queue>
23#include <rtl/tencinfo.h>
24#include <svl/itemiter.hxx>
25#include <svl/whiter.hxx>
26#include <svtools/rtftoken.h>
27#include <svl/itempool.hxx>
29#include <tools/debug.hxx>
31
32#include <comphelper/string.hxx>
33
35#include <editeng/fontitem.hxx>
36#include <editeng/svxrtf.hxx>
37#include <editeng/editids.hrc>
38#include <vcl/font.hxx>
39#include <vcl/svapp.hxx>
40#include <vcl/settings.hxx>
41
42
43using namespace ::com::sun::star;
44
45
46static rtl_TextEncoding lcl_GetDefaultTextEncodingForRTF()
47{
48
49 OUString aLangString( Application::GetSettings().GetLanguageTag().getLanguage());
50
51 if ( aLangString == "ru" || aLangString == "uk" )
52 return RTL_TEXTENCODING_MS_1251;
53 if ( aLangString == "tr" )
54 return RTL_TEXTENCODING_MS_1254;
55 else
56 return RTL_TEXTENCODING_MS_1252;
57}
58
59// -------------- Methods --------------------
60
62 : SvRTFParser( rIn, 5 )
63 , pAttrPool( &rPool )
64 , nDfltFont( 0)
65 , bNewDoc( true )
66 , bNewGroup( false)
67 , bIsSetDfltTab( false)
68 , bChkStyleAttr( false )
69 , bCalcValue( false )
70 , bIsLeftToRightDef( true)
71 , bIsInReadStyleTab( false)
72{
73 pDfltFont.emplace();
75
76 // generate the correct WhichId table from the set WhichIds.
78}
79
81{
82 if( !aAttrStack.empty() )
84}
85
87{
88 mxInsertPosition = rNew;
89}
90
92{
93 DBG_ASSERT( mxInsertPosition, "no insertion position");
94
95 if( !mxInsertPosition )
96 return SvParserState::Error;
97
98 if( !maColorTable.empty() )
100 m_FontTable.clear();
101 m_StyleTable.clear();
102 if( !aAttrStack.empty() )
104
105 bIsSetDfltTab = false;
106 bNewGroup = false;
107 nDfltFont = 0;
108
110}
111
112void SvxRTFParser::Continue( int nToken )
113{
115
116 SvParserState eStatus = GetStatus();
117 if (eStatus != SvParserState::Pending && eStatus != SvParserState::Error)
118 {
120 //Regardless of what "color 0" is, word defaults to auto as the default colour.
121 //e.g. see #i7713#
122 }
123}
124
125
126// is called for each token that is recognized in CallParser
127void SvxRTFParser::NextToken( int nToken )
128{
129 sal_Unicode cCh;
130 switch( nToken )
131 {
132 case RTF_COLORTBL: ReadColorTable(); break;
133 case RTF_FONTTBL: ReadFontTable(); break;
134 case RTF_STYLESHEET: ReadStyleTable(); break;
135
136 case RTF_DEFF:
137 if( bNewDoc )
138 {
139 if (!m_FontTable.empty())
140 // Can immediately be set
142 else
143 // is set after reading the font table
145 }
146 break;
147
148 case RTF_DEFTAB:
149 case RTF_DEFLANG:
150 if( bNewDoc )
152 break;
153
154
155 case RTF_PICT: ReadBitmapData(); break;
156
157 case RTF_LINE: cCh = '\n'; goto INSINGLECHAR;
158 case RTF_TAB: cCh = '\t'; goto INSINGLECHAR;
159 case RTF_SUBENTRYINDEX: cCh = ':'; goto INSINGLECHAR;
160
161 case RTF_EMDASH: cCh = 0x2014; goto INSINGLECHAR;
162 case RTF_ENDASH: cCh = 0x2013; goto INSINGLECHAR;
163 case RTF_BULLET: cCh = 0x2022; goto INSINGLECHAR;
164 case RTF_LQUOTE: cCh = 0x2018; goto INSINGLECHAR;
165 case RTF_RQUOTE: cCh = 0x2019; goto INSINGLECHAR;
166 case RTF_LDBLQUOTE: cCh = 0x201C; goto INSINGLECHAR;
167 case RTF_RDBLQUOTE: cCh = 0x201D; goto INSINGLECHAR;
168INSINGLECHAR:
169 aToken = OUStringChar(cCh);
170 [[fallthrough]]; // aToken is set as Text
171 case RTF_TEXTTOKEN:
172 {
173 InsertText();
174 // all collected Attributes are set
175 for (size_t n = m_AttrSetList.size(); n; )
176 {
177 auto const& pStkSet = m_AttrSetList[--n];
178 SetAttrSet( *pStkSet );
179 m_AttrSetList.pop_back();
180 }
181 }
182 break;
183
184
185 case RTF_PAR:
186 InsertPara();
187 break;
188 case '{':
189 if (bNewGroup) // Nesting!
190 GetAttrSet_();
191 bNewGroup = true;
192 break;
193 case '}':
194 if( !bNewGroup ) // Empty Group ??
195 AttrGroupEnd();
196 bNewGroup = false;
197 break;
198 case RTF_INFO:
199 SkipGroup();
200 break;
201
202 // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
203 // First overwrite all (all have to be in one group!!)
204 // Could also appear in the RTF-file without the IGNORE-Flag; all Groups
205 // with the IGNORE-Flag are overwritten in the default branch.
206
207 case RTF_SWG_PRTDATA:
208 case RTF_FIELD:
209 case RTF_ATNID:
210 case RTF_ANNOTATION:
211
212 case RTF_BKMKSTART:
213 case RTF_BKMKEND:
214 case RTF_BKMK_KEY:
215 case RTF_XE:
216 case RTF_TC:
217 case RTF_NEXTFILE:
218 case RTF_TEMPLATE:
219 // RTF_SHPRSLT disabled for #i19718#
220 SkipGroup();
221 break;
222 // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
223
224 case RTF_PGDSCNO:
225 case RTF_PGBRK:
226 case RTF_SHADOW:
227 if( RTF_IGNOREFLAG != GetStackPtr( -1 )->nTokenId )
228 break;
229 nToken = SkipToken();
230 if( '{' == GetStackPtr( -1 )->nTokenId )
231 nToken = SkipToken();
232
234 break;
235
236 default:
237 switch( nToken & ~(0xff | RTF_SWGDEFS) )
238 {
239 case RTF_PARFMT: // here are no SWGDEFS
241 break;
242
243 case RTF_CHRFMT:
244 case RTF_BRDRDEF:
245 case RTF_TABSTOPDEF:
246
247 if( RTF_SWGDEFS & nToken)
248 {
249 if( RTF_IGNOREFLAG != GetStackPtr( -1 )->nTokenId )
250 break;
251 nToken = SkipToken();
252 if( '{' == GetStackPtr( -1 )->nTokenId )
253 {
254 nToken = SkipToken();
255 }
256 }
258 break;
259 default:
260 {
261 if( RTF_IGNOREFLAG == GetStackPtr( -1 )->nTokenId &&
262 '{' == GetStackPtr( -2 )->nTokenId )
263 SkipGroup();
264 }
265 break;
266 }
267 break;
268 }
269}
270
272{
273 int bSaveChkStyleAttr = bChkStyleAttr ? 1 : 0;
274 sal_uInt16 nStyleNo = 0;
275 bool bHasStyleNo = false;
276 int _nOpenBrackets = 1; // the first was already detected earlier!!
277 std::optional<SvxRTFStyleType> xStyle(SvxRTFStyleType(*pAttrPool, aWhichMap));
278 xStyle->aAttrSet.Put( GetRTFDefaults() );
279
280 bIsInReadStyleTab = true;
281 bChkStyleAttr = false; // Do not check Attribute against the Styles
282
283 while( _nOpenBrackets && IsParserWorking() )
284 {
285 int nToken = GetNextToken();
286 switch( nToken )
287 {
288 case '}': if( --_nOpenBrackets && IsParserWorking() )
289 // Style has been completely read,
290 // so this is still a stable status
292 break;
293 case '{':
294 {
296 SkipToken();
297 else if( RTF_UNKNOWNCONTROL != ( nToken = GetNextToken() ) &&
298 RTF_PN != nToken )
299 SkipToken( -2 );
300 else
301 {
302 // filter out at once
305 if( '}' != nToken )
306 eState = SvParserState::Error;
307 break;
308 }
309 ++_nOpenBrackets;
310 }
311 break;
312
313 case RTF_SBASEDON: xStyle->nBasedOn = sal_uInt16(nTokenValue); break;
314 case RTF_SNEXT: break;
315 case RTF_OUTLINELEVEL:
316 case RTF_SOUTLVL: xStyle->nOutlineNo = sal_uInt8(nTokenValue); break;
317 case RTF_S: nStyleNo = static_cast<short>(nTokenValue);
318 bHasStyleNo = true;
319 break;
320 case RTF_CS: nStyleNo = static_cast<short>(nTokenValue);
321 bHasStyleNo = true;
322 break;
323
324 case RTF_TEXTTOKEN:
325 if (bHasStyleNo)
326 {
327 DelCharAtEnd( aToken, ';' );
328 xStyle->sName = aToken.toString();
329
330 if (!m_StyleTable.empty())
331 {
332 m_StyleTable.erase(nStyleNo);
333 }
334 // All data from the font is available, so off to the table
335 m_StyleTable.emplace(nStyleNo, std::move(*xStyle));
336 xStyle.emplace(*pAttrPool, aWhichMap);
337 xStyle->aAttrSet.Put( GetRTFDefaults() );
338 nStyleNo = 0;
339 bHasStyleNo = false;
340 }
341 break;
342 default:
343 switch( nToken & ~(0xff | RTF_SWGDEFS) )
344 {
345 case RTF_PARFMT: // here are no SWGDEFS
346 ReadAttr( nToken, &xStyle->aAttrSet );
347 break;
348
349 case RTF_CHRFMT:
350 case RTF_BRDRDEF:
351 case RTF_TABSTOPDEF:
352#ifndef NDEBUG
353 auto nEnteringToken = nToken;
354#endif
355 auto nEnteringIndex = m_nTokenIndex;
356 int nSkippedTokens = 0;
357 if( RTF_SWGDEFS & nToken)
358 {
359 if( RTF_IGNOREFLAG != GetStackPtr( -1 )->nTokenId )
360 break;
361 nToken = SkipToken();
362 ++nSkippedTokens;
363 if( '{' == GetStackPtr( -1 )->nTokenId )
364 {
365 nToken = SkipToken();
366 ++nSkippedTokens;
367 }
368 }
369 ReadAttr( nToken, &xStyle->aAttrSet );
370 if (nSkippedTokens && m_nTokenIndex == nEnteringIndex - nSkippedTokens)
371 {
372 // we called SkipToken to go back one or two, but ReadAttrs
373 // read nothing, so on next loop of the outer while we
374 // would end up in the same state again (assert that)
375 assert(nEnteringToken == GetNextToken());
376 // and loop endlessly, skip format a token
377 // instead to avoid that
378 SkipToken(nSkippedTokens);
379 }
380 break;
381 }
382 break;
383 }
384 }
385 xStyle.reset(); // Delete the Last Style
386 SkipToken(); // the closing brace is evaluated "above"
387
388 // Flag back to old state
389 bChkStyleAttr = bSaveChkStyleAttr;
390 bIsInReadStyleTab = false;
391}
392
394{
395 int nToken;
396 sal_uInt8 nRed = 0xff, nGreen = 0xff, nBlue = 0xff;
397
398 for (;;)
399 {
401 if ( '}' == nToken || !IsParserWorking() )
402 break;
403 switch( nToken )
404 {
405 case RTF_RED: nRed = sal_uInt8(nTokenValue); break;
406 case RTF_GREEN: nGreen = sal_uInt8(nTokenValue); break;
407 case RTF_BLUE: nBlue = sal_uInt8(nTokenValue); break;
408
409 case RTF_TEXTTOKEN:
410 if( 1 == aToken.getLength()
411 ? aToken[ 0 ] != ';'
412 : -1 == aToken.indexOf( ";" ) )
413 break; // At least the ';' must be found
414
415 [[fallthrough]];
416
417 case ';':
418 if( IsParserWorking() )
419 {
420 // one color is finished, fill in the table
421 // try to map the values to SV internal names
422 Color aColor( nRed, nGreen, nBlue );
423 if( maColorTable.empty() &&
424 sal_uInt8(-1) == nRed && sal_uInt8(-1) == nGreen && sal_uInt8(-1) == nBlue )
425 aColor = COL_AUTO;
426 maColorTable.push_back( aColor );
427 nRed = 0;
428 nGreen = 0;
429 nBlue = 0;
430
431 // Color has been completely read,
432 // so this is still a stable status
434 }
435 break;
436 }
437 }
438 SkipToken(); // the closing brace is evaluated "above"
439}
440
442{
443 int _nOpenBrackets = 1; // the first was already detected earlier!!
444 vcl::Font aFont;
445 short nFontNo(0), nInsFontNo (0);
446 OUString sAltNm, sFntNm;
447 bool bIsAltFntNm = false;
448
449 rtl_TextEncoding nSystemChar = lcl_GetDefaultTextEncodingForRTF();
450 aFont.SetCharSet( nSystemChar );
451 SetEncoding( nSystemChar );
452
453 while( _nOpenBrackets && IsParserWorking() )
454 {
455 bool bCheckNewFont = false;
456 int nToken = GetNextToken();
457 switch( nToken )
458 {
459 case '}':
460 bIsAltFntNm = false;
461 // Style has been completely read,
462 // so this is still a stable status
463 if( --_nOpenBrackets <= 1 && IsParserWorking() )
465 bCheckNewFont = true;
466 nInsFontNo = nFontNo;
467 break;
468 case '{':
470 SkipToken();
471 // immediately skip unknown and all known but non-evaluated
472 // groups
473 else if( RTF_UNKNOWNCONTROL != ( nToken = GetNextToken() ) &&
476 SkipToken( -2 );
477 else
478 {
479 // filter out at once
482 if( '}' != nToken )
483 eState = SvParserState::Error;
484 break;
485 }
486 ++_nOpenBrackets;
487 break;
488 case RTF_FROMAN:
489 aFont.SetFamily( FAMILY_ROMAN );
490 break;
491 case RTF_FSWISS:
492 aFont.SetFamily( FAMILY_SWISS );
493 break;
494 case RTF_FMODERN:
495 aFont.SetFamily( FAMILY_MODERN );
496 break;
497 case RTF_FSCRIPT:
498 aFont.SetFamily( FAMILY_SCRIPT );
499 break;
500 case RTF_FDECOR:
502 break;
503 // for technical/symbolic font of the rtl_TextEncoding is changed!
504 case RTF_FTECH:
505 aFont.SetCharSet( RTL_TEXTENCODING_SYMBOL );
506 [[fallthrough]];
507 case RTF_FNIL:
508 aFont.SetFamily( FAMILY_DONTKNOW );
509 break;
510 case RTF_FCHARSET:
511 if (-1 != nTokenValue)
512 {
513 rtl_TextEncoding nrtl_TextEncoding = rtl_getTextEncodingFromWindowsCharset(
514 static_cast<sal_uInt8>(nTokenValue));
515 aFont.SetCharSet(nrtl_TextEncoding);
516 //When we're in a font, the fontname is in the font
517 //charset, except for symbol fonts I believe
518 if (nrtl_TextEncoding == RTL_TEXTENCODING_SYMBOL)
519 nrtl_TextEncoding = RTL_TEXTENCODING_DONTKNOW;
520 SetEncoding(nrtl_TextEncoding);
521 }
522 break;
523 case RTF_FPRQ:
524 switch( nTokenValue )
525 {
526 case 1:
527 aFont.SetPitch( PITCH_FIXED );
528 break;
529 case 2:
530 aFont.SetPitch( PITCH_VARIABLE );
531 break;
532 }
533 break;
534 case RTF_F:
535 bCheckNewFont = true;
536 nInsFontNo = nFontNo;
537 nFontNo = static_cast<short>(nTokenValue);
538 break;
539 case RTF_FALT:
540 bIsAltFntNm = true;
541 break;
542 case RTF_TEXTTOKEN:
543 DelCharAtEnd( aToken, ';' );
544 if ( !aToken.isEmpty() )
545 {
546 if( bIsAltFntNm )
547 sAltNm = aToken;
548 else
549 sFntNm = aToken;
550 }
551 break;
552 }
553
554 if( bCheckNewFont && 1 >= _nOpenBrackets && !sFntNm.isEmpty() ) // one font is ready
555 {
556 // All data from the font is available, so off to the table
557 if (!sAltNm.isEmpty())
558 sFntNm += ";" + sAltNm;
559
560 aFont.SetFamilyName( sFntNm );
561 m_FontTable.insert(std::make_pair(nInsFontNo, aFont));
562 aFont = vcl::Font();
563 aFont.SetCharSet( nSystemChar );
564 sAltNm.clear();
565 sFntNm.clear();
566 }
567 }
568 SkipToken(); // the closing brace is evaluated "above"
569
570 // set the default font in the Document
571 if( bNewDoc && IsParserWorking() )
573}
574
576{
577 maColorTable.clear();
578}
579
581{
582 aAttrStack.clear();
583}
584
585void SvxRTFParser::DelCharAtEnd( OUStringBuffer& rStr, const sal_Unicode cDel )
586{
587 rStr.strip(' ');
588 if( !rStr.isEmpty() && cDel == rStr[ rStr.getLength()-1 ])
589 rStr.setLength( rStr.getLength()-1 );
590}
591
592
593const vcl::Font& SvxRTFParser::GetFont( sal_uInt16 nId )
594{
595 SvxRTFFontTbl::const_iterator it = m_FontTable.find( nId );
596 if (it != m_FontTable.end())
597 {
598 return it->second;
599 }
600 const SvxFontItem& rDfltFont =
601 pAttrPool->GetDefaultItem(aPlainMap[SID_ATTR_CHAR_FONT]);
602 pDfltFont->SetFamilyName( rDfltFont.GetStyleName() );
603 pDfltFont->SetFamily( rDfltFont.GetFamily() );
604 return *pDfltFont;
605}
606
607std::unique_ptr<SvxRTFItemStackType> SvxRTFItemStackType::createSvxRTFItemStackType(
608 SfxItemPool& rPool, const WhichRangesContainer& pWhichRange, const EditPosition& rEditPosition)
609{
610 struct MakeUniqueEnabler : public SvxRTFItemStackType
611 {
612 MakeUniqueEnabler(SfxItemPool& rPool, const WhichRangesContainer& pWhichRange, const EditPosition& rEditPosition)
613 : SvxRTFItemStackType(rPool, pWhichRange, rEditPosition)
614 {
615 }
616 };
617 return std::make_unique<MakeUniqueEnabler>(rPool, pWhichRange, rEditPosition);
618}
619
621{
622 SvxRTFItemStackType* pCurrent = aAttrStack.empty() ? nullptr : aAttrStack.back().get();
623 std::unique_ptr<SvxRTFItemStackType> xNew;
624 if( pCurrent )
625 xNew = std::make_unique<SvxRTFItemStackType>(*pCurrent, *mxInsertPosition, false/*bCopyAttr*/);
626 else
628 xNew->SetRTFDefaults( GetRTFDefaults() );
629
630 aAttrStack.push_back( std::move(xNew) );
631
632 if (aAttrStack.size() > 96 && utl::ConfigManager::IsFuzzing())
633 throw std::range_error("ecStackOverflow");
634
635 bNewGroup = false;
636 return aAttrStack.back().get();
637}
638
640{
641 // check attributes to the attributes of the stylesheet or to
642 // the default attrs of the document
643 SfxItemSet &rSet = rStkType.GetAttrSet();
644 const SfxItemPool& rPool = *rSet.GetPool();
645 const SfxPoolItem* pItem;
646 SfxWhichIter aIter( rSet );
647
648 if( !IsChkStyleAttr() ||
649 !rStkType.GetAttrSet().Count() ||
650 m_StyleTable.count( rStkType.nStyleNo ) == 0 )
651 {
652 for( sal_uInt16 nWhich = aIter.GetCurWhich(); nWhich; nWhich = aIter.NextWhich() )
653 {
654 if (SfxItemPool::IsWhich(nWhich) &&
655 SfxItemState::SET == aIter.GetItemState( false, &pItem ) &&
656 rPool.GetDefaultItem( nWhich ) == *pItem )
657 aIter.ClearItem(); // delete
658 }
659 }
660 else
661 {
662 // Delete all Attributes, which are already defined in the Style,
663 // from the current AttrSet.
664 auto & rStyle = m_StyleTable.find(rStkType.nStyleNo)->second;
665 SfxItemSet &rStyleSet = rStyle.aAttrSet;
666 const SfxPoolItem* pSItem;
667 for( sal_uInt16 nWhich = aIter.GetCurWhich(); nWhich; nWhich = aIter.NextWhich() )
668 {
669 if( SfxItemState::SET == rStyleSet.GetItemState( nWhich, true, &pSItem ))
670 {
671 if( SfxItemState::SET == aIter.GetItemState( false, &pItem )
672 && *pItem == *pSItem )
673 rSet.ClearItem( nWhich ); // delete
674 }
675 else if (SfxItemPool::IsWhich(nWhich) &&
676 SfxItemState::SET == aIter.GetItemState( false, &pItem ) &&
677 rPool.GetDefaultItem( nWhich ) == *pItem )
678 rSet.ClearItem( nWhich ); // delete
679 }
680 }
681}
682
683void SvxRTFParser::AttrGroupEnd() // process the current, delete from Stack
684{
685 if( aAttrStack.empty() )
686 return;
687
688 std::unique_ptr<SvxRTFItemStackType> pOld = std::move(aAttrStack.back());
689 aAttrStack.pop_back();
690 SvxRTFItemStackType *pCurrent = aAttrStack.empty() ? nullptr : aAttrStack.back().get();
691
692 do { // middle check loop
693 sal_Int32 nOldSttNdIdx = pOld->mxStartNodeIdx->GetIdx();
694 if (pOld->maChildList.empty() &&
695 ((!pOld->aAttrSet.Count() && !pOld->nStyleNo ) ||
696 (nOldSttNdIdx == mxInsertPosition->GetNodeIdx() &&
697 pOld->nSttCnt == mxInsertPosition->GetCntIdx() )))
698 break; // no attributes or Area
699
700 // set only the attributes that are different from the parent
701 if( pCurrent && pOld->aAttrSet.Count() )
702 {
703 SfxItemIter aIter( pOld->aAttrSet );
704 const SfxPoolItem* pItem = aIter.GetCurItem(), *pGet;
705 do
706 {
707 if( SfxItemState::SET == pCurrent->aAttrSet.GetItemState(
708 pItem->Which(), false, &pGet ) &&
709 *pItem == *pGet )
710 aIter.ClearItem();
711
712 pItem = aIter.NextItem();
713 } while (pItem);
714
715 if (!pOld->aAttrSet.Count() && pOld->maChildList.empty() &&
716 !pOld->nStyleNo )
717 break;
718 }
719
720 // Set all attributes which have been defined from start until here
721 bool bCrsrBack = !mxInsertPosition->GetCntIdx();
722 if( bCrsrBack )
723 {
724 // at the beginning of a paragraph? Move back one position
725 sal_Int32 nNd = mxInsertPosition->GetNodeIdx();
726 MovePos(false);
727 // if can not move backward then later don't move forward !
728 bCrsrBack = nNd != mxInsertPosition->GetNodeIdx();
729 }
730
731 if( pOld->mxStartNodeIdx->GetIdx() < mxInsertPosition->GetNodeIdx() ||
732 ( pOld->mxStartNodeIdx->GetIdx() == mxInsertPosition->GetNodeIdx() &&
733 pOld->nSttCnt <= mxInsertPosition->GetCntIdx() ) )
734 {
735 if( !bCrsrBack )
736 {
737 // all pard attributes are only valid until the previous
738 // paragraph !!
739 if( nOldSttNdIdx == mxInsertPosition->GetNodeIdx() )
740 {
741 }
742 else
743 {
744 // Now it gets complicated:
745 // - all character attributes sre keep the area
746 // - all paragraph attributes to get the area
747 // up to the previous paragraph
748 auto xNew = std::make_unique<SvxRTFItemStackType>(*pOld, *mxInsertPosition, true);
749 xNew->aAttrSet.SetParent( pOld->aAttrSet.GetParent() );
750
751 // Delete all paragraph attributes from xNew
752 for (const auto& pair : aPardMap.data)
753 if (sal_uInt16 wid = pair.second)
754 xNew->aAttrSet.ClearItem(wid);
755 xNew->SetRTFDefaults( GetRTFDefaults() );
756
757 // Were there any?
758 if( xNew->aAttrSet.Count() == pOld->aAttrSet.Count() )
759 {
760 xNew.reset();
761 }
762 else
763 {
764 xNew->nStyleNo = 0;
765
766 // Now span the real area of xNew from old
767 SetEndPrevPara( pOld->mxEndNodeIdx, pOld->nEndCnt );
768 xNew->nSttCnt = 0;
769
770 if( IsChkStyleAttr() )
771 {
772 ClearStyleAttr_( *pOld );
773 ClearStyleAttr_( *xNew ); //#i10381#, methinks.
774 }
775
776 if( pCurrent )
777 {
778 pCurrent->Add(std::move(pOld));
779 pCurrent->Add(std::move(xNew));
780 }
781 else
782 {
783 // Last off the stack, thus cache it until the next text was
784 // read. (Span no attributes!)
785
786 m_AttrSetList.push_back(std::move(pOld));
787 m_AttrSetList.push_back(std::move(xNew));
788 }
789 break;
790 }
791 }
792 }
793
794 pOld->mxEndNodeIdx = mxInsertPosition->MakeNodeIdx();
795 pOld->nEndCnt = mxInsertPosition->GetCntIdx();
796
797 /*
798 #i21422#
799 If the parent (pCurrent) sets something e.g. , and the child (pOld)
800 unsets it and the style both are based on has it unset then
801 clearing the pOld by looking at the style is clearly a disaster
802 as the text ends up with pCurrents bold and not pOlds no bold, this
803 should be rethought out. For the moment its safest to just do
804 the clean if we have no parent, all we suffer is too many
805 redundant properties.
806 */
807 if (IsChkStyleAttr() && !pCurrent)
808 ClearStyleAttr_( *pOld );
809
810 if( pCurrent )
811 {
812 pCurrent->Add(std::move(pOld));
813 // split up and create new entry, because it makes no sense
814 // to create a "so long" depend list. Bug 95010
815 if (bCrsrBack && 50 < pCurrent->maChildList.size())
816 {
817 // at the beginning of a paragraph? Move back one position
818 MovePos();
819 bCrsrBack = false;
820
821 // Open a new Group.
822 auto xNew(std::make_unique<SvxRTFItemStackType>(*pCurrent, *mxInsertPosition, true));
823 xNew->SetRTFDefaults( GetRTFDefaults() );
824
825 // Set all until here valid Attributes
826 AttrGroupEnd();
827 pCurrent = aAttrStack.empty() ? nullptr : aAttrStack.back().get(); // can be changed after AttrGroupEnd!
828 xNew->aAttrSet.SetParent( pCurrent ? &pCurrent->aAttrSet : nullptr );
829 aAttrStack.push_back( std::move(xNew) );
830 }
831 }
832 else
833 // Last off the stack, thus cache it until the next text was
834 // read. (Span no attributes!)
835 m_AttrSetList.push_back(std::move(pOld));
836 }
837
838 if( bCrsrBack )
839 // at the beginning of a paragraph? Move back one position
840 MovePos();
841
842 } while( false );
843
844 bNewGroup = false;
845}
846
847void SvxRTFParser::SetAllAttrOfStk() // end all Attr. and set it into doc
848{
849 // repeat until all attributes will be taken from stack
850 while( !aAttrStack.empty() )
851 AttrGroupEnd();
852
853 for (size_t n = m_AttrSetList.size(); n; )
854 {
855 auto const& pStkSet = m_AttrSetList[--n];
856 SetAttrSet( *pStkSet );
857 pStkSet->DropChildList();
858 m_AttrSetList.pop_back();
859 }
860}
861
862// sets all the attributes that are different from the current
864{
865 // Was DefTab never read? then set to default
866 if( !bIsSetDfltTab )
867 SetDefault( RTF_DEFTAB, 720 );
868
869 if (!rSet.maChildList.empty())
870 rSet.Compress( *this );
871 if( rSet.aAttrSet.Count() || rSet.nStyleNo )
873
874 // then process all the children
875 for (size_t n = 0; n < rSet.maChildList.size(); ++n)
876 SetAttrSet( *(rSet.maChildList[ n ]) );
877}
878
879// Has no text been inserted yet? (SttPos from the top Stack entry!)
881{
882 SvxRTFItemStackType* pCurrent = aAttrStack.empty() ? nullptr : aAttrStack.back().get();
883 return !pCurrent || (pCurrent->mxStartNodeIdx->GetIdx() == mxInsertPosition->GetNodeIdx() &&
884 pCurrent->nSttCnt == mxInsertPosition->GetCntIdx());
885}
886
887
889{
890}
891
893{
895
896 // Here are the IDs for all paragraph attributes, which can be detected by
897 // SvxParser and can be set in a SfxItemSet. The IDs are set correctly through
898 // the SlotIds from POOL.
899 static constexpr sal_uInt16 WIDS1[] {
900 SID_ATTR_PARA_LINESPACE,
901 SID_ATTR_PARA_ADJUST,
902 SID_ATTR_TABSTOP,
903 SID_ATTR_PARA_HYPHENZONE,
904 SID_ATTR_LRSPACE,
905 SID_ATTR_ULSPACE,
906 SID_ATTR_BRUSH,
907 SID_ATTR_BORDER_OUTER,
908 SID_ATTR_BORDER_SHADOW,
909 SID_ATTR_PARA_OUTLLEVEL,
910 SID_ATTR_PARA_SPLIT,
911 SID_ATTR_PARA_KEEP,
912 SID_PARA_VERTALIGN,
913 SID_ATTR_PARA_SCRIPTSPACE,
914 SID_ATTR_PARA_HANGPUNCTUATION,
915 SID_ATTR_PARA_FORBIDDEN_RULES,
916 SID_ATTR_FRAMEDIRECTION,
917 };
918 for (sal_uInt16 nWid : WIDS1)
919 {
920 sal_uInt16 nTrueWid = pAttrPool->GetTrueWhich(nWid, false);
921 aPardMap.data[nWid] = nTrueWid;
922 if (nTrueWid == 0)
923 continue;
924 aWhichMap = aWhichMap.MergeRange(nTrueWid, nTrueWid);
925 }
926
927 // Here are the IDs for all character attributes, which can be detected by
928 // SvxParser and can be set in a SfxItemSet. The IDs are set correctly through
929 // the SlotIds from POOL.
930 static constexpr sal_uInt16 WIDS[] {
931 SID_ATTR_CHAR_CASEMAP, SID_ATTR_BRUSH_CHAR, SID_ATTR_CHAR_COLOR,
932 SID_ATTR_CHAR_CONTOUR, SID_ATTR_CHAR_STRIKEOUT, SID_ATTR_CHAR_ESCAPEMENT,
933 SID_ATTR_CHAR_FONT, SID_ATTR_CHAR_FONTHEIGHT, SID_ATTR_CHAR_KERNING,
934 SID_ATTR_CHAR_LANGUAGE, SID_ATTR_CHAR_POSTURE, SID_ATTR_CHAR_SHADOWED,
935 SID_ATTR_CHAR_UNDERLINE, SID_ATTR_CHAR_OVERLINE, SID_ATTR_CHAR_WEIGHT,
936 SID_ATTR_CHAR_WORDLINEMODE, SID_ATTR_CHAR_AUTOKERN, SID_ATTR_CHAR_CJK_FONT,
937 SID_ATTR_CHAR_CJK_FONTHEIGHT, sal_uInt16(SID_ATTR_CHAR_CJK_LANGUAGE), SID_ATTR_CHAR_CJK_POSTURE,
938 SID_ATTR_CHAR_CJK_WEIGHT, SID_ATTR_CHAR_CTL_FONT, SID_ATTR_CHAR_CTL_FONTHEIGHT,
939 SID_ATTR_CHAR_CTL_LANGUAGE, SID_ATTR_CHAR_CTL_POSTURE, SID_ATTR_CHAR_CTL_WEIGHT,
940 SID_ATTR_CHAR_EMPHASISMARK, SID_ATTR_CHAR_TWO_LINES, SID_ATTR_CHAR_SCALEWIDTH,
941 SID_ATTR_CHAR_ROTATED, SID_ATTR_CHAR_RELIEF, SID_ATTR_CHAR_HIDDEN,
942 };
943 for (sal_uInt16 nWid : WIDS)
944 {
945 sal_uInt16 nTrueWid = pAttrPool->GetTrueWhich(nWid, false);
946 aPlainMap.data[nWid] = nTrueWid;
947 if (nTrueWid == 0)
948 continue;
949 aWhichMap = aWhichMap.MergeRange(nTrueWid, nTrueWid);
950 }
951}
952
954{
955 if( !pRTFDefaults )
956 {
958 if (const sal_uInt16 nId = aPardMap[SID_ATTR_PARA_SCRIPTSPACE])
959 {
960 SvxScriptSpaceItem aItem( false, nId );
961 if( bNewDoc )
963 else
964 pRTFDefaults->Put( aItem );
965 }
966 }
967 return *pRTFDefaults;
968}
969
970
972 : aAttrSet(rPool, pWhichRange)
973 , nBasedOn(0)
974 , nOutlineNo(sal_uInt8(-1)) // not set
975{
976}
977
979 SfxItemPool& rPool, const WhichRangesContainer& pWhichRange,
980 const EditPosition& rPos )
981 : aAttrSet( rPool, pWhichRange )
982 , mxStartNodeIdx(rPos.MakeNodeIdx())
983#if !defined(__COVERITY__)
984 // coverity 2020 has difficulty wrt std::optional leading to bogus 'Uninitialized scalar variable'
985 , mxEndNodeIdx(mxStartNodeIdx)
986#endif
987 , nSttCnt(rPos.GetCntIdx())
988 , nEndCnt(nSttCnt)
989 , nStyleNo(0)
990{
991}
992
994 const SvxRTFItemStackType& rCpy,
995 const EditPosition& rPos,
996 bool const bCopyAttr )
997 : aAttrSet( *rCpy.aAttrSet.GetPool(), rCpy.aAttrSet.GetRanges() )
998 , mxStartNodeIdx(rPos.MakeNodeIdx())
999#if !defined(__COVERITY__)
1000 // coverity 2020 has difficulty wrt std::optional leading to bogus 'Uninitialized scalar variable'
1001 , mxEndNodeIdx(mxStartNodeIdx)
1002#endif
1003 , nSttCnt(rPos.GetCntIdx())
1004 , nEndCnt(nSttCnt)
1005 , nStyleNo(rCpy.nStyleNo)
1006{
1007 aAttrSet.SetParent( &rCpy.aAttrSet );
1008 if( bCopyAttr )
1009 aAttrSet.Put( rCpy.aAttrSet );
1010}
1011
1012/* ofz#13491 SvxRTFItemStackType dtor recursively
1013 calls the dtor of its m_pChildList. The recurse
1014 depth can grow sufficiently to trigger asan.
1015
1016 So breadth-first iterate through the nodes
1017 and make a flat vector of them which can
1018 be iterated through in order of most
1019 distant from root first and release
1020 their children linearly
1021*/
1023{
1024 if (maChildList.empty())
1025 return;
1026
1027 std::vector<SvxRTFItemStackType*> bfs;
1028 std::queue<SvxRTFItemStackType*> aQueue;
1029 aQueue.push(this);
1030
1031 while (!aQueue.empty())
1032 {
1033 auto* front = aQueue.front();
1034 aQueue.pop();
1035 if (!front->maChildList.empty())
1036 {
1037 for (const auto& a : front->maChildList)
1038 aQueue.push(a.get());
1039 bfs.push_back(front);
1040 }
1041 }
1042
1043 for (auto it = bfs.rbegin(); it != bfs.rend(); ++it)
1044 {
1045 SvxRTFItemStackType* pNode = *it;
1046 pNode->maChildList.clear();
1047 }
1048}
1049
1051{
1052}
1053
1054void SvxRTFItemStackType::Add(std::unique_ptr<SvxRTFItemStackType> pIns)
1055{
1056 maChildList.push_back(std::move(pIns));
1057}
1058
1060{
1061 mxStartNodeIdx = rPos.MakeNodeIdx();
1063 nSttCnt = rPos.GetCntIdx();
1064}
1065
1067{
1068 ENSURE_OR_RETURN_VOID(!maChildList.empty(), "Compress: ChildList empty");
1069
1070 SvxRTFItemStackType* pTmp = maChildList[0].get();
1071
1072 if( !pTmp->aAttrSet.Count() ||
1073 mxStartNodeIdx->GetIdx() != pTmp->mxStartNodeIdx->GetIdx() ||
1074 nSttCnt != pTmp->nSttCnt )
1075 return;
1076
1077 EditNodeIdx aLastNd = *pTmp->mxEndNodeIdx;
1078 sal_Int32 nLastCnt = pTmp->nEndCnt;
1079
1080 SfxItemSet aMrgSet( pTmp->aAttrSet );
1081 for (size_t n = 1; n < maChildList.size(); ++n)
1082 {
1083 pTmp = maChildList[n].get();
1084 if (!pTmp->maChildList.empty())
1085 pTmp->Compress( rParser );
1086
1087 if( !pTmp->nSttCnt
1088 ? (aLastNd.GetIdx()+1 != pTmp->mxStartNodeIdx->GetIdx() ||
1089 !rParser.IsEndPara( &aLastNd, nLastCnt ) )
1090 : ( pTmp->nSttCnt != nLastCnt ||
1091 aLastNd.GetIdx() != pTmp->mxStartNodeIdx->GetIdx() ))
1092 {
1093 while (++n < maChildList.size())
1094 {
1095 pTmp = maChildList[n].get();
1096 if (!pTmp->maChildList.empty())
1097 pTmp->Compress( rParser );
1098 }
1099 return;
1100 }
1101
1102 if( n )
1103 {
1104 // Search for all which are set over the whole area
1105 SfxItemIter aIter( aMrgSet );
1106 const SfxPoolItem* pItem;
1107 const SfxPoolItem* pIterItem = aIter.GetCurItem();
1108 do {
1109 sal_uInt16 nWhich = pIterItem->Which();
1110 if( SfxItemState::SET != pTmp->aAttrSet.GetItemState( nWhich,
1111 false, &pItem ) || *pItem != *pIterItem)
1112 aIter.ClearItem();
1113
1114 pIterItem = aIter.NextItem();
1115 } while(pIterItem);
1116
1117 if( !aMrgSet.Count() )
1118 return;
1119 }
1120
1121 aLastNd = *pTmp->mxEndNodeIdx;
1122 nLastCnt = pTmp->nEndCnt;
1123 }
1124
1125 if( mxEndNodeIdx->GetIdx() != aLastNd.GetIdx() || nEndCnt != nLastCnt )
1126 return;
1127
1128 // It can be merged
1129 aAttrSet.Put( aMrgSet );
1130
1131 size_t n = 0, nChildLen = maChildList.size();
1132 while (n < nChildLen)
1133 {
1134 pTmp = maChildList[n].get();
1135 pTmp->aAttrSet.Differentiate( aMrgSet );
1136
1137 if (pTmp->maChildList.empty() && !pTmp->aAttrSet.Count() && !pTmp->nStyleNo)
1138 {
1139 maChildList.erase( maChildList.begin() + n );
1140 --nChildLen;
1141 continue;
1142 }
1143 ++n;
1144 }
1145}
1147{
1148 if( rDefaults.Count() )
1149 {
1150 SfxItemIter aIter( rDefaults );
1151 const SfxPoolItem* pItem = aIter.GetCurItem();
1152 do {
1153 sal_uInt16 nWhich = pItem->Which();
1154 if( SfxItemState::SET != aAttrSet.GetItemState( nWhich, false ))
1155 aAttrSet.Put(*pItem);
1156
1157 pItem = aIter.NextItem();
1158 } while(pItem);
1159 }
1160}
1161
1162/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
static const AllSettings & GetSettings()
sal_Int32 GetIdx() const
Definition: eertfpar.cxx:610
sal_Int32 GetCntIdx() const
EditNodeIdx MakeNodeIdx() const
void ClearItem()
const SfxPoolItem * GetCurItem() const
const SfxPoolItem * NextItem()
const SfxPoolItem & GetDefaultItem(sal_uInt16 nWhich) const
sal_uInt16 GetTrueWhich(sal_uInt16 nSlot, bool bDeep=true) const
static bool IsWhich(sal_uInt16 nId)
void SetPoolDefaultItem(const SfxPoolItem &)
SfxItemPool * GetPool() const
void SetParent(const SfxItemSet *pNew)
sal_uInt16 Count() const
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
void Differentiate(const SfxItemSet &rSet)
sal_uInt16 Which() const
sal_uInt16 GetCurWhich() const
SfxItemState GetItemState(bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
void ClearItem()
sal_uInt16 NextWhich()
void SaveState(T nToken)
SvParserState GetStatus() const
TokenStackType * GetStackPtr(short nCnt)
tools::Long nTokenValue
OUStringBuffer aToken
bool IsParserWorking() const
tools::Long m_nTokenIndex
T SkipToken(short nCnt=-1)
SvParserState eState
void ReadBitmapData()
void ReadUnknownData()
virtual void Continue(int nToken) override
void SkipGroup()
virtual SvParserState CallParser() override
void SetEncoding(rtl_TextEncoding eEnc)
This item describes a Font.
Definition: fontitem.hxx:30
FontFamily GetFamily() const
Definition: fontitem.hxx:81
const OUString & GetStyleName() const
Definition: fontitem.hxx:72
SvxRTFItemStackList maChildList
Definition: svxrtf.hxx:238
SvxRTFItemStackType(SvxRTFItemStackType const &)=delete
void SetRTFDefaults(const SfxItemSet &rDefaults)
Definition: svxrtf.cxx:1146
sal_uInt16 nStyleNo
Definition: svxrtf.hxx:239
SfxItemSet aAttrSet
Definition: svxrtf.hxx:234
sal_Int32 nSttCnt
Definition: svxrtf.hxx:237
std::optional< EditNodeIdx > mxStartNodeIdx
Definition: svxrtf.hxx:235
std::optional< EditNodeIdx > mxEndNodeIdx
Definition: svxrtf.hxx:236
void SetStartPos(const EditPosition &rPos)
Definition: svxrtf.cxx:1059
static std::unique_ptr< SvxRTFItemStackType > createSvxRTFItemStackType(SfxItemPool &, const WhichRangesContainer &pWhichRange, const EditPosition &)
Definition: svxrtf.cxx:607
void Compress(const SvxRTFParser &)
Definition: svxrtf.cxx:1066
SfxItemSet & GetAttrSet()
Definition: svxrtf.hxx:269
sal_Int32 nEndCnt
Definition: svxrtf.hxx:237
void Add(std::unique_ptr< SvxRTFItemStackType >)
Definition: svxrtf.cxx:1054
bool bNewGroup
Definition: svxrtf.hxx:118
void ClearAttrStack()
Definition: svxrtf.cxx:580
SvxRTFParser(SvxRTFParser const &)=delete
SfxItemPool * pAttrPool
Definition: svxrtf.hxx:110
bool bChkStyleAttr
Definition: svxrtf.hxx:120
void AttrGroupEnd()
Definition: svxrtf.cxx:683
bool bIsSetDfltTab
Definition: svxrtf.hxx:119
PlainOrPardMap aPlainMap
Definition: svxrtf.hxx:105
WhichRangesContainer aWhichMap
Definition: svxrtf.hxx:107
virtual void InsertText()=0
void SetAttrSet(SvxRTFItemStackType &rSet)
Definition: svxrtf.cxx:863
void ClearColorTbl()
Definition: svxrtf.cxx:575
void SetAllAttrOfStk()
Definition: svxrtf.cxx:847
static void DelCharAtEnd(OUStringBuffer &rStr, const sal_Unicode cDel)
Definition: svxrtf.cxx:585
bool IsChkStyleAttr() const
Definition: svxrtf.hxx:192
void ReadColorTable()
Definition: svxrtf.cxx:393
bool IsAttrSttPos()
Definition: svxrtf.cxx:880
virtual void InsertPara()=0
std::optional< Color > mxDefaultColor
Definition: svxrtf.hxx:111
virtual void SetEndPrevPara(std::optional< EditNodeIdx > &rpNodePos, sal_Int32 &rCntPos)=0
SvxRTFStyleTbl m_StyleTable
Definition: svxrtf.hxx:93
void ReadFontTable()
Definition: svxrtf.cxx:441
virtual void Continue(int nToken) override
Definition: svxrtf.cxx:112
virtual bool IsEndPara(EditNodeIdx *pNd, sal_Int32 nCnt) const =0
std::vector< Color > maColorTable
Definition: svxrtf.hxx:91
std::optional< vcl::Font > pDfltFont
Definition: svxrtf.hxx:112
std::optional< EditPosition > mxInsertPosition
Definition: svxrtf.hxx:109
SvxRTFFontTbl m_FontTable
Definition: svxrtf.hxx:92
std::unique_ptr< SfxItemSet > pRTFDefaults
Definition: svxrtf.hxx:113
int nDfltFont
Definition: svxrtf.hxx:115
void ReadAttr(int nToken, SfxItemSet *pSet)
Definition: rtfitem.cxx:180
virtual void NextToken(int nToken) override
Definition: svxrtf.cxx:127
virtual SvParserState CallParser() override
Definition: svxrtf.cxx:91
void BuildWhichTable()
Definition: svxrtf.cxx:892
const vcl::Font & GetFont(sal_uInt16 nId)
Definition: svxrtf.cxx:593
void ClearStyleAttr_(SvxRTFItemStackType &rStkType)
Definition: svxrtf.cxx:639
bool bIsInReadStyleTab
Definition: svxrtf.hxx:124
const SfxItemSet & GetRTFDefaults()
Definition: svxrtf.cxx:953
SvxRTFItemStackList m_AttrSetList
Definition: svxrtf.hxx:95
PlainOrPardMap aPardMap
Definition: svxrtf.hxx:106
virtual ~SvxRTFParser() override
Definition: svxrtf.cxx:80
virtual void SetAttrInDoc(SvxRTFItemStackType &rSet)
Definition: svxrtf.cxx:888
void SetInsPos(const EditPosition &rNew)
Definition: svxrtf.cxx:86
SfxItemSet & GetAttrSet()
Definition: svxrtf.hxx:287
void SetDefault(int nToken, int nValue)
Definition: rtfitem.cxx:1775
void ReadStyleTable()
Definition: svxrtf.cxx:271
SvxRTFItemStackType * GetAttrSet_()
Definition: svxrtf.cxx:620
std::deque< std::unique_ptr< SvxRTFItemStackType > > aAttrStack
Definition: svxrtf.hxx:94
bool bNewDoc
Definition: svxrtf.hxx:117
virtual void MovePos(bool bForward=true)=0
static bool IsFuzzing()
void SetPitch(FontPitch ePitch)
void SetFamily(FontFamily)
void SetCharSet(rtl_TextEncoding)
void SetFamilyName(const OUString &rFamilyName)
constexpr ::Color COL_AUTO(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
#define DBG_ASSERT(sCon, aError)
#define ENSURE_OR_RETURN_VOID(c, m)
PITCH_VARIABLE
PITCH_FIXED
FAMILY_DECORATIVE
FAMILY_DONTKNOW
FAMILY_SCRIPT
FAMILY_SWISS
FAMILY_MODERN
FAMILY_ROMAN
sal_Int64 n
uno_Any a
if(aStr !=aBuf) UpdateName_Impl(m_xFollowLb.get()
bool GetRanges(std::vector< std::shared_ptr< SwUnoCursor > > &rRanges, SwDoc &rDoc, SwPaM const &rDelPam)
sal_Int16 nId
DefTokenId nToken
const wchar_t *typedef int(__stdcall *DllNativeUnregProc)(int
RTF_CHRFMT
RTF_SWGDEFS
RTF_PARFMT
RTF_TABSTOPDEF
RTF_BRDRDEF
RTF_FONTTBL
RTF_PGBRK
RTF_TAB
RTF_SOUTLVL
RTF_FONTEMB
RTF_SNEXT
RTF_XE
RTF_ATNID
RTF_FSCRIPT
RTF_SBASEDON
RTF_PN
RTF_FMODERN
RTF_BKMKSTART
RTF_PGDSCNO
RTF_FIELD
RTF_UNKNOWNCONTROL
RTF_SWG_PRTDATA
RTF_DEFTAB
RTF_DEFLANG
RTF_STYLESHEET
RTF_FDECOR
RTF_BKMKEND
RTF_F
RTF_SUBENTRYINDEX
RTF_FNAME
RTF_GREEN
RTF_FROMAN
RTF_FNIL
RTF_LQUOTE
RTF_DEFF
RTF_S
RTF_FCHARSET
RTF_FALT
RTF_TEXTTOKEN
RTF_TC
RTF_FONTFILE
RTF_FPRQ
RTF_PICT
RTF_ANNOTATION
RTF_TEMPLATE
RTF_COLORTBL
RTF_LDBLQUOTE
RTF_EMDASH
RTF_RDBLQUOTE
RTF_BKMK_KEY
RTF_BLUE
RTF_BULLET
RTF_FSWISS
RTF_SHADOW
RTF_RED
RTF_OUTLINELEVEL
RTF_IGNOREFLAG
RTF_NEXTFILE
RTF_LINE
RTF_RQUOTE
RTF_ENDASH
RTF_PAR
RTF_INFO
RTF_CS
RTF_FTECH
RTF_PANOSE
static SfxItemSet & rSet
std::map< sal_uInt16, sal_uInt16 > data
Definition: svxrtf.hxx:99
SvxRTFStyleType(SfxItemPool &rPool, const WhichRangesContainer &pWhichRange)
Definition: svxrtf.cxx:971
SAL_WARN_UNUSED_RESULT WhichRangesContainer MergeRange(sal_uInt16 nFrom, sal_uInt16 nTo) const
SvParserState
static rtl_TextEncoding lcl_GetDefaultTextEncodingForRTF()
Definition: svxrtf.cxx:46
unsigned char sal_uInt8
sal_uInt16 sal_Unicode