LibreOffice Module editeng (master) 1
eertfpar.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 <comphelper/string.hxx>
21#include <utility>
22
23#include "eertfpar.hxx"
24#include "impedit.hxx"
25#include <svl/intitem.hxx>
27#include <editeng/fhgtitem.hxx>
28#include <editeng/fontitem.hxx>
29#include <editeng/flditem.hxx>
30#include <editeng/editeng.hxx>
31
32#include <svtools/rtftoken.h>
33#include <svtools/htmltokn.h>
35
36using namespace com::sun::star;
37
39 : aSelection( rSel )
40{
41 pParser = pPrsrs;
42 eState = eSt;
43 nToken = HtmlTokenId::NONE;
44}
45
47{
48}
49
51 : aSelection( rSel )
52{
53 pParser = pPrsrs;
54 eState = eSt;
55 nToken = 0;
56 nTokenValue = 0;
57}
58
59constexpr MapUnit gRTFMapUnit = MapUnit::MapTwip;
60
62 SvStream& rIn, EditSelection aSel, SfxItemPool& rAttrPool, EditEngine* pEditEngine) :
63 SvxRTFParser(rAttrPool, rIn),
64 aCurSel(std::move(aSel)),
65 mpEditEngine(pEditEngine),
66 nDefFont(0),
67 bLastActionInsertParaBreak(false)
68{
70
71 // Convert the twips values ...
72 SetCalcValue(true);
74 SetNewDoc(false); // So that the Pool-Defaults are not overwritten...
76}
77
79{
80}
81
83{
84 DBG_ASSERT( !aCurSel.HasRange(), "Selection for CallParser!" );
85 // Separate the part that is imported from the rest.
86 // This expression should be used for all imports.
87 // aStart1PaM: Last position before the imported content
88 // aEnd1PaM: First position after the imported content
89 // aStart2PaM: First position of the imported content
90 // aEnd2PaM: Last position of the imported content
91 EditPaM aStart1PaM( aCurSel.Min().GetNode(), aCurSel.Min().GetIndex() );
93 EditPaM aStart2PaM = aCurSel.Min();
94 // Useful or not?
95 aStart2PaM.GetNode()->GetContentAttribs().GetItems().ClearItem();
96 AddRTFDefaultValues( aStart2PaM, aStart2PaM );
98 // aCurCel now points to the gap
99
101 {
104 }
105
107
109 {
112 }
113
115 {
116 ContentNode* pCurNode = aCurSel.Max().GetNode();
117 sal_Int32 nPara = mpEditEngine->GetEditDoc().GetPos(pCurNode);
118 ContentNode* pPrevNode = mpEditEngine->GetEditDoc().GetObject(nPara-1);
119 DBG_ASSERT( pPrevNode, "Invalid RTF-Document?!" );
120 EditSelection aSel;
121 aSel.Min() = EditPaM( pPrevNode, pPrevNode->Len() );
122 aSel.Max() = EditPaM( pCurNode, 0 );
124 }
125 EditPaM aEnd2PaM( aCurSel.Max() );
126 //AddRTFDefaultValues( aStart2PaM, aEnd2PaM );
127 bool bOnlyOnePara = ( aEnd2PaM.GetNode() == aStart2PaM.GetNode() );
128 // Paste the chunk again ...
129 // Problem: Paragraph attributes may not possibly be taken over
130 // => Do Character attributes.
131
132 bool bSpecialBackward = aStart1PaM.GetNode()->Len() == 0;
133 if ( bOnlyOnePara || aStart1PaM.GetNode()->Len() )
136 aStart1PaM.GetNode(), aStart2PaM.GetNode(), bSpecialBackward );
137 bSpecialBackward = aEnd1PaM.GetNode()->Len() != 0;
138 // when bOnlyOnePara, then the node is gone on Connect.
139 if ( !bOnlyOnePara && aEnd1PaM.GetNode()->Len() )
142 ( bOnlyOnePara ? aStart1PaM.GetNode() : aEnd2PaM.GetNode() ),
143 aEnd1PaM.GetNode(), bSpecialBackward );
144
145 return _eState;
146}
147
148void EditRTFParser::AddRTFDefaultValues( const EditPaM& rStart, const EditPaM& rEnd )
149{
150 // Problem: DefFont and DefFontHeight
151 Size aSz( 12, 0 );
152 MapMode aPntMode( MapUnit::MapPoint );
154 aSz = mpEditEngine->GetRefDevice()->LogicToLogic(aSz, &aPntMode, &_aEditMapMode);
155 SvxFontHeightItem aFontHeightItem( aSz.Width(), 100, EE_CHAR_FONTHEIGHT );
156 vcl::Font aDefFont( GetFont( nDefFont ) );
157 SvxFontItem aFontItem( aDefFont.GetFamilyType(), aDefFont.GetFamilyName(),
158 aDefFont.GetStyleName(), aDefFont.GetPitch(), aDefFont.GetCharSet(), EE_CHAR_FONTINFO );
159
160 sal_Int32 nStartPara = mpEditEngine->GetEditDoc().GetPos( rStart.GetNode() );
161 sal_Int32 nEndPara = mpEditEngine->GetEditDoc().GetPos( rEnd.GetNode() );
162 for ( sal_Int32 nPara = nStartPara; nPara <= nEndPara; nPara++ )
163 {
164 ContentNode* pNode = mpEditEngine->GetEditDoc().GetObject( nPara );
165 assert(pNode && "AddRTFDefaultValues - No paragraph?!");
166 if ( !pNode->GetContentAttribs().HasItem( EE_CHAR_FONTINFO ) )
167 pNode->GetContentAttribs().GetItems().Put( aFontItem );
169 pNode->GetContentAttribs().GetItems().Put( aFontHeightItem );
170 }
171}
172
173void EditRTFParser::NextToken( int nToken )
174{
175 switch( nToken )
176 {
177 case RTF_DEFF:
178 {
179 nDefFont = sal_uInt16(nTokenValue);
180 }
181 break;
182 case RTF_DEFTAB:
183 break;
184 case RTF_CELL:
185 {
187 }
188 break;
189 case RTF_LINE:
190 {
192 }
193 break;
194 case RTF_FIELD:
195 {
196 ReadField();
197 }
198 break;
199 case RTF_SHPINST: // fdo#76776 process contents of shpinst
200 break;
201 case RTF_SP: // fdo#76776 but skip SP groups
202 {
203 SkipGroup();
204 }
205 break;
206 case RTF_PGDSCTBL: // #i29453# ignore \*\pgdsctbl destination
207 case RTF_LISTTEXT:
208 {
209 SkipGroup();
210 }
211 break;
212 default:
213 {
215 if ( nToken == RTF_STYLESHEET )
217 }
218 break;
219 }
221 {
223 aImportInfo.nToken = nToken;
224 aImportInfo.nTokenValue = short(nTokenValue);
226 }
227}
228
230{
231 // for Tokens which are not evaluated in ReadAttr
232 // Actually, only for Calc (RTFTokenHdl), so that RTF_INTBL
234 {
236 aImportInfo.nToken = nToken;
237 aImportInfo.nTokenValue = short(nTokenValue);
239 }
240}
241
243{
244 OUString aText( aToken );
246 {
249 }
252}
253
255{
257 {
260 }
263}
264
265void EditRTFParser::MovePos( bool const bForward )
266{
267 if( bForward )
269 aCurSel.Max(), i18n::CharacterIteratorMode::SKIPCHARACTER);
270 else
272 aCurSel.Max(), i18n::CharacterIteratorMode::SKIPCHARACTER);
273}
274
275void EditRTFParser::SetEndPrevPara( std::optional<EditNodeIdx>& rpNodePos,
276 sal_Int32& rCntPos )
277{
278 // The Intention is to: determine the current insert position of the
279 // previous paragraph and set the end from this.
280 // This "\pard" always apply on the right paragraph.
281
282 ContentNode* pN = aCurSel.Max().GetNode();
283 sal_Int32 nCurPara = mpEditEngine->GetEditDoc().GetPos( pN );
284 DBG_ASSERT( nCurPara != 0, "Paragraph equal to 0: SetEnfPrevPara" );
285 if ( nCurPara )
286 nCurPara--;
287 ContentNode* pPrevNode = mpEditEngine->GetEditDoc().GetObject( nCurPara );
288 assert(pPrevNode && "pPrevNode = 0!");
289 rpNodePos = EditNodeIdx(mpEditEngine, pPrevNode);
290 rCntPos = pPrevNode->Len();
291}
292
293bool EditRTFParser::IsEndPara( EditNodeIdx* pNd, sal_Int32 nCnt ) const
294{
295 return nCnt == pNd->GetNode()->Len();
296}
297
299{
300 ContentNode* pSttNode = const_cast<EditNodeIdx&>(rSet.GetSttNode()).GetNode();
301 ContentNode* pEndNode = const_cast<EditNodeIdx&>(rSet.GetEndNode()).GetNode();
302
303 EditPaM aStartPaM( pSttNode, rSet.GetSttCnt() );
304 EditPaM aEndPaM( pEndNode, rSet.GetEndCnt() );
305
306 // If possible adjust the Escapement-Item:
307
308 // #i66167# adapt font heights to destination MapUnit if necessary
309 const MapUnit eDestUnit = mpEditEngine->GetEditDoc().GetItemPool().GetMetric(0);
310 if (eDestUnit != gRTFMapUnit)
311 {
312 sal_uInt16 const aFntHeightIems[3] = { EE_CHAR_FONTHEIGHT, EE_CHAR_FONTHEIGHT_CJK, EE_CHAR_FONTHEIGHT_CTL };
313 for (unsigned short aFntHeightIem : aFntHeightIems)
314 {
315 const SfxPoolItem* pItem;
316 if (SfxItemState::SET == rSet.GetAttrSet().GetItemState( aFntHeightIem, false, &pItem ))
317 {
318 sal_uInt32 nHeight = static_cast<const SvxFontHeightItem*>(pItem)->GetHeight();
319 tools::Long nNewHeight;
320 nNewHeight = OutputDevice::LogicToLogic( static_cast<tools::Long>(nHeight), gRTFMapUnit, eDestUnit );
321
322 SvxFontHeightItem aFntHeightItem( nNewHeight, 100, aFntHeightIem );
323 aFntHeightItem.SetProp(
324 static_cast<const SvxFontHeightItem*>(pItem)->GetProp(),
325 static_cast<const SvxFontHeightItem*>(pItem)->GetPropUnit());
326 rSet.GetAttrSet().Put( aFntHeightItem );
327 }
328 }
329 }
330
331 if( const SvxEscapementItem* pItem = rSet.GetAttrSet().GetItemIfSet( EE_CHAR_ESCAPEMENT, false ) )
332 {
333 // the correct one
334 tools::Long nEsc = pItem->GetEsc();
335 tools::Long nEscFontHeight = 0;
336 if( ( DFLT_ESC_AUTO_SUPER != nEsc ) && ( DFLT_ESC_AUTO_SUB != nEsc ) )
337 {
338 nEsc *= 10; //HalfPoints => Twips was embezzled in RTFITEM.CXX!
339 SvxFont aFont;
341 {
342 // ofz#24932 detecting RTL vs LTR is slow
343 aFont = aStartPaM.GetNode()->GetCharAttribs().GetDefFont();
344 }
345 else
346 mpEditEngine->SeekCursor(aStartPaM.GetNode(), aStartPaM.GetIndex()+1, aFont);
347 nEscFontHeight = aFont.GetFontSize().Height();
348 }
349 if (nEscFontHeight)
350 {
351 nEsc = nEsc * 100 / nEscFontHeight;
352
353 SvxEscapementItem aEscItem( static_cast<short>(nEsc), pItem->GetProportionalHeight(), EE_CHAR_ESCAPEMENT );
354 rSet.GetAttrSet().Put( aEscItem );
355 }
356 }
357
359 {
360 EditSelection aSel( aStartPaM, aEndPaM );
363 }
364
365 ContentNode* pSN = aStartPaM.GetNode();
366 ContentNode* pEN = aEndPaM.GetNode();
367 sal_Int32 nStartNode = mpEditEngine->GetEditDoc().GetPos( pSN );
368 sal_Int32 nEndNode = mpEditEngine->GetEditDoc().GetPos( pEN );
369 sal_Int16 nOutlLevel = 0xff;
370
372 {
373 SvxRTFStyleTbl::iterator it = GetStyleTbl().find( rSet.StyleNo() );
374 DBG_ASSERT( it != GetStyleTbl().end(), "Template not defined in RTF!" );
375 if ( it != GetStyleTbl().end() )
376 {
377 auto const& pS = it->second;
379 EditSelection(aStartPaM, aEndPaM),
380 static_cast<SfxStyleSheet*>(mpEditEngine->GetStyleSheetPool()->Find(pS.sName, SfxStyleFamily::All)));
381 nOutlLevel = pS.nOutlineNo;
382 }
383 }
384
385 // When an Attribute goes from 0 to the current paragraph length,
386 // it should be a paragraph attribute!
387
388 // Note: Selection can reach over several paragraphs.
389 // All Complete paragraphs are paragraph attributes ...
390 for ( sal_Int32 z = nStartNode+1; z < nEndNode; z++ )
391 {
392 DBG_ASSERT(mpEditEngine->GetEditDoc().GetObject(z), "Node does not exist yet(RTF)");
393 mpEditEngine->SetParaAttribsOnly(z, rSet.GetAttrSet());
394 }
395
396 if ( aStartPaM.GetNode() != aEndPaM.GetNode() )
397 {
398 // The rest of the StartNodes...
399 if ( aStartPaM.GetIndex() == 0 )
400 mpEditEngine->SetParaAttribsOnly(nStartNode, rSet.GetAttrSet());
401 else
403 EditSelection(aStartPaM, EditPaM(aStartPaM.GetNode(), aStartPaM.GetNode()->Len())), rSet.GetAttrSet());
404
405 // the beginning of the EndNodes...
406 if ( aEndPaM.GetIndex() == aEndPaM.GetNode()->Len() )
407 mpEditEngine->SetParaAttribsOnly(nEndNode, rSet.GetAttrSet());
408 else
410 EditSelection(EditPaM(aEndPaM.GetNode(), 0), aEndPaM), rSet.GetAttrSet());
411 }
412 else
413 {
414 if ( ( aStartPaM.GetIndex() == 0 ) && ( aEndPaM.GetIndex() == aEndPaM.GetNode()->Len() ) )
415 {
416 // When settings char attribs as para attribs, we must merge with existing attribs, not overwrite the ItemSet!
417 SfxItemSet aAttrs = mpEditEngine->GetBaseParaAttribs(nStartNode);
418 aAttrs.Put( rSet.GetAttrSet() );
419 mpEditEngine->SetParaAttribsOnly(nStartNode, aAttrs);
420 }
421 else
422 {
424 EditSelection(aStartPaM, aEndPaM), rSet.GetAttrSet());
425 }
426 }
427
428 // OutlLevel...
429 if ( nOutlLevel != 0xff )
430 {
431 for ( sal_Int32 n = nStartNode; n <= nEndNode; n++ )
432 {
434 pNode->GetContentAttribs().GetItems().Put( SfxInt16Item( EE_PARA_OUTLLEVEL, nOutlLevel ) );
435 }
436 }
437}
438
440{
441 SvxRTFStyleTbl& rTable = GetStyleTbl();
442 for (auto & iter : rTable)
443 {
444 if (iter.second.sName == rName)
445 return &iter.second;
446 }
447 return nullptr;
448}
449
451{
452 // Check if a template exists, then it will not be changed!
453 SfxStyleSheet* pStyle = static_cast<SfxStyleSheet*>(mpEditEngine->GetStyleSheetPool()->Find( pRTFStyle->sName, SfxStyleFamily::All ));
454 if ( pStyle )
455 return pStyle;
456
457 OUString aName( pRTFStyle->sName );
458 OUString aParent;
459 if ( pRTFStyle->nBasedOn )
460 {
461 SvxRTFStyleTbl::iterator it = GetStyleTbl().find( pRTFStyle->nBasedOn );
462 if ( it != GetStyleTbl().end())
463 {
464 SvxRTFStyleType const& rS = it->second;
465 if ( &rS != pRTFStyle )
466 aParent = rS.sName;
467 }
468 }
469
470 pStyle = static_cast<SfxStyleSheet*>( &mpEditEngine->GetStyleSheetPool()->Make( aName, SfxStyleFamily::Para ) );
471
472 // 1) convert and take over Items ...
473 ConvertAndPutItems( pStyle->GetItemSet(), pRTFStyle->aAttrSet );
474
475 // 2) As long as Parent is not in the pool, also create this ...
476 if ( !aParent.isEmpty() && ( aParent != aName ) )
477 {
478 SfxStyleSheet* pS = static_cast<SfxStyleSheet*>(mpEditEngine->GetStyleSheetPool()->Find( aParent, SfxStyleFamily::All ));
479 if ( !pS )
480 {
481 // If not found anywhere, create from RTF ...
482 SvxRTFStyleType* _pRTFStyle = FindStyleSheet( aParent );
483 if ( _pRTFStyle )
484 pS = CreateStyleSheet( _pRTFStyle );
485 }
486 // 2b) Link Itemset with Parent ...
487 if ( pS )
488 pStyle->GetItemSet().SetParent( &pS->GetItemSet() );
489 }
490 return pStyle;
491}
492
494{
495 // the SvxRTFParser has now created the template...
497 {
498 for (auto & elem : GetStyleTbl())
499 {
500 SvxRTFStyleType& rRTFStyle = elem.second;
501 CreateStyleSheet( &rRTFStyle );
502 }
503 }
504}
505
507{
508 const MapUnit eDestUnit = aEditMapMode.GetMapUnit();
509 if (eDestUnit != gRTFMapUnit)
511}
512
514{
515 // From SwRTFParser::ReadField()
516 int _nOpenBrackets = 1; // the first was already detected earlier
517 bool bFldInst = false;
518 bool bFldRslt = false;
519 OUString aFldInst;
520 OUString aFldRslt;
521
522 while( _nOpenBrackets && IsParserWorking() )
523 {
524 switch( GetNextToken() )
525 {
526 case '}':
527 {
528 _nOpenBrackets--;
529 if ( _nOpenBrackets == 1 )
530 {
531 bFldInst = false;
532 bFldRslt = false;
533 }
534 }
535 break;
536
537 case '{': _nOpenBrackets++;
538 break;
539
540 case RTF_FIELD: SkipGroup();
541 break;
542
543 case RTF_FLDINST: bFldInst = true;
544 break;
545
546 case RTF_FLDRSLT: bFldRslt = true;
547 break;
548
549 case RTF_TEXTTOKEN:
550 {
551 if ( bFldInst )
552 aFldInst += aToken;
553 else if ( bFldRslt )
554 aFldRslt += aToken;
555 }
556 break;
557 }
558 }
559 if ( !aFldInst.isEmpty() )
560 {
561 OUString aHyperLinkMarker( "HYPERLINK " );
562 if ( aFldInst.startsWithIgnoreAsciiCase( aHyperLinkMarker ) )
563 {
564 aFldInst = aFldInst.copy( aHyperLinkMarker.getLength() );
565 aFldInst = comphelper::string::strip(aFldInst, ' ');
566 // strip start and end quotes
567 aFldInst = aFldInst.copy( 1, aFldInst.getLength()-2 );
568
569 if ( aFldRslt.isEmpty() )
570 aFldRslt = aFldInst;
571
572 SvxFieldItem aField( SvxURLField( aFldInst, aFldRslt, SvxURLFormat::Repr ), EE_FEATURE_FIELD );
576 }
577 }
578
579 SkipToken(); // the closing brace is evaluated "above"
580}
581
583{
584 int _nOpenBrackets = 1; // the first was already detected earlier
585
586 while( _nOpenBrackets && IsParserWorking() )
587 {
588 switch( GetNextToken() )
589 {
590 case '}':
591 {
592 _nOpenBrackets--;
593 }
594 break;
595
596 case '{':
597 {
598 _nOpenBrackets++;
599 }
600 break;
601 }
602 }
603
604 SkipToken(); // the closing brace is evaluated "above"
605}
606
608 mpEditEngine(pEE), mpNode(pNd) {}
609
610sal_Int32 EditNodeIdx::GetIdx() const
611{
613}
614
616 mpEditEngine(pEE), mpCurSel(pSel) {}
617
619{
621}
622
623sal_Int32 EditPosition::GetNodeIdx() const
624{
625 ContentNode* pN = mpCurSel->Max().GetNode();
626 return mpEditEngine->GetEditDoc().GetPos(pN);
627}
628
629sal_Int32 EditPosition::GetCntIdx() const
630{
631 return mpCurSel->Max().GetIndex();
632}
633
634/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SvxFont & GetDefFont()
Definition: editdoc.hxx:215
bool HasItem(sal_uInt16 nWhich) const
Definition: editdoc.cxx:1872
SfxItemSet & GetItems()
Definition: editdoc.hxx:166
CharAttribList & GetCharAttribs()
Definition: editdoc.hxx:256
ContentAttribs & GetContentAttribs()
Definition: editdoc.hxx:254
sal_Int32 Len() const
Definition: editdoc.cxx:1615
sal_Int32 GetPos(const ContentNode *pNode) const
Definition: editdoc.cxx:2086
SfxItemPool & GetItemPool()
Definition: editdoc.hxx:812
const ContentNode * GetObject(sal_Int32 nPos) const
Definition: editdoc.cxx:2091
const SfxItemSet & GetBaseParaAttribs(sal_Int32 nPara) const
Definition: editeng.cxx:950
ESelection CreateESelection(const EditSelection &rSel) const
Definition: editeng.cxx:940
EditPaM CursorRight(const EditPaM &rPaM, sal_uInt16 nCharacterIteratorMode=css::i18n::CharacterIteratorMode::SKIPCELL)
Definition: editeng.cxx:895
EditPaM DeleteSelection(const EditSelection &rSel)
Definition: editeng.cxx:935
bool IsRtfImportHandlerSet() const
Definition: editeng.cxx:2845
EditPaM CursorLeft(const EditPaM &rPaM, sal_uInt16 nCharacterIteratorMode=css::i18n::CharacterIteratorMode::SKIPCELL)
Definition: editeng.cxx:890
EditPaM InsertField(const EditSelection &rEditSelection, const SvxFieldItem &rFld)
Definition: editeng.cxx:835
bool UpdateFieldsOnly()
Definition: editeng.cxx:2372
OutputDevice * GetRefDevice() const
Definition: editeng.cxx:154
void SetParaAttribsOnly(sal_Int32 nPara, const SfxItemSet &rSet)
Definition: editeng.cxx:955
void SeekCursor(ContentNode *pNode, sal_Int32 nPos, SvxFont &rFont)
Definition: editeng.cxx:930
EditSelection InsertText(css::uno::Reference< css::datatransfer::XTransferable > const &rxDataObj, const OUString &rBaseURL, const EditPaM &rPaM, bool bUseSpecial)
void SetStyleSheet(const EditSelection &aSel, SfxStyleSheet *pStyle)
Definition: editeng.cxx:2138
bool IsImportRTFStyleSheetsSet() const
Definition: editeng.cxx:2850
SfxStyleSheetPool * GetStyleSheetPool()
Definition: editeng.cxx:2163
void CallRtfImportHandler(RtfImportInfo &rInfo)
Definition: editeng.cxx:2860
EditPaM InsertParaBreak(const EditSelection &rEditSelection)
Definition: editeng.cxx:2865
void ParaAttribsToCharAttribs(ContentNode *pNode)
Definition: editeng.cxx:819
void SetAttribs(const EditSelection &rSel, const SfxItemSet &rSet, SetAttribsMode nSpecial=SetAttribsMode::NONE)
Definition: editeng.cxx:960
EditPaM InsertLineBreak(const EditSelection &rEditSelection)
Definition: editeng.cxx:2870
EditPaM ConnectParagraphs(ContentNode *pLeft, ContentNode *pRight, bool bBackward)
Definition: editeng.cxx:829
EditDoc & GetEditDoc()
Definition: editeng.cxx:905
ContentNode * mpNode
Definition: svxrtf.hxx:54
EditNodeIdx(EditEngine *pEE, ContentNode *pNd)
Definition: eertfpar.cxx:607
EditEngine * mpEditEngine
Definition: svxrtf.hxx:53
ContentNode * GetNode()
Definition: svxrtf.hxx:51
sal_Int32 GetIdx() const
Definition: eertfpar.cxx:610
const ContentNode * GetNode() const
Definition: editdoc.hxx:312
sal_Int32 GetIndex() const
Definition: editdoc.hxx:316
EditPosition(EditEngine *pIEE, EditSelection *pSel)
EditSelection * mpCurSel
Definition: svxrtf.hxx:62
sal_Int32 GetCntIdx() const
EditNodeIdx MakeNodeIdx() const
EditEngine * mpEditEngine
Definition: svxrtf.hxx:61
sal_Int32 GetNodeIdx() const
virtual void InsertPara() override
Definition: eertfpar.cxx:254
void ReadField()
Definition: eertfpar.cxx:513
EditSelection aCurSel
Definition: eertfpar.hxx:30
virtual ~EditRTFParser() override
Definition: eertfpar.cxx:78
bool bLastActionInsertParaBreak
Definition: eertfpar.hxx:35
virtual void SetEndPrevPara(std::optional< EditNodeIdx > &rpNodePos, sal_Int32 &rCntPos) override
Definition: eertfpar.cxx:275
void SkipGroup()
Definition: eertfpar.cxx:582
virtual void UnknownAttrToken(int nToken) override
Definition: eertfpar.cxx:229
EditRTFParser(SvStream &rIn, EditSelection aCurSel, SfxItemPool &rAttrPool, EditEngine *pEditEngine)
Definition: eertfpar.cxx:61
virtual bool IsEndPara(EditNodeIdx *pNd, sal_Int32 nCnt) const override
Definition: eertfpar.cxx:293
virtual void NextToken(int nToken) override
Definition: eertfpar.cxx:173
virtual void SetAttrInDoc(SvxRTFItemStackType &rSet) override
Definition: eertfpar.cxx:298
SvxRTFStyleType * FindStyleSheet(std::u16string_view rName)
Definition: eertfpar.cxx:439
void CreateStyleSheets()
Definition: eertfpar.cxx:493
virtual void InsertText() override
Definition: eertfpar.cxx:242
EditEngine * mpEditEngine
Definition: eertfpar.hxx:31
virtual void CalcValue() override
Definition: eertfpar.cxx:506
virtual SvParserState CallParser() override
Definition: eertfpar.cxx:82
MapMode aEditMapMode
Definition: eertfpar.hxx:32
sal_uInt16 nDefFont
Definition: eertfpar.hxx:34
virtual void MovePos(bool bForward=true) override
Definition: eertfpar.cxx:265
SfxStyleSheet * CreateStyleSheet(SvxRTFStyleType const *pRTFStyle)
Definition: eertfpar.cxx:450
void AddRTFDefaultValues(const EditPaM &rStart, const EditPaM &rEnd)
Definition: eertfpar.cxx:148
EditPaM & Min()
Definition: editdoc.hxx:705
bool HasRange() const
Definition: editdoc.hxx:711
EditPaM & Max()
Definition: editdoc.hxx:706
MapUnit GetMapUnit() const
SAL_WARN_UNUSED_RESULT Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
const MapMode & GetMapMode() const
virtual MapUnit GetMetric(sal_uInt16 nWhich) const
void SetParent(const SfxItemSet *pNew)
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) 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)
virtual SfxStyleSheetBase & Make(const OUString &, SfxStyleFamily eFam, SfxStyleSearchBits nMask=SfxStyleSearchBits::All)
virtual SfxStyleSheetBase * Find(const OUString &, SfxStyleFamily eFam, SfxStyleSearchBits n=SfxStyleSearchBits::All)
virtual SfxItemSet & GetItemSet()
constexpr tools::Long Height() const
constexpr tools::Long Width() const
tools::Long nTokenValue
OUStringBuffer aToken
bool IsParserWorking() const
T SkipToken(short nCnt=-1)
This item stores a field (SvxFieldData).
Definition: flditem.hxx:70
void SetProp(sal_uInt16 nNewProp, MapUnit eUnit)
Definition: fhgtitem.hxx:76
This item describes a Font.
Definition: fontitem.hxx:30
void SetChkStyleAttr(bool bFlag)
Definition: svxrtf.hxx:193
SvxRTFStyleTbl & GetStyleTbl()
Definition: svxrtf.hxx:199
void SetCalcValue(bool bFlag)
Definition: svxrtf.hxx:195
virtual void NextToken(int nToken) override
Definition: svxrtf.cxx:127
virtual SvParserState CallParser() override
Definition: svxrtf.cxx:91
const vcl::Font & GetFont(sal_uInt16 nId)
Definition: svxrtf.cxx:593
void SetNewDoc(bool bFlag)
Definition: svxrtf.hxx:191
void SetInsPos(const EditPosition &rNew)
Definition: svxrtf.cxx:86
static bool IsFuzzing()
FontFamily GetFamilyType()
const OUString & GetStyleName() const
const OUString & GetFamilyName() const
const Size & GetFontSize() const
FontPitch GetPitch()
rtl_TextEncoding GetCharSet() const
const char * pS
#define DBG_ASSERT(sCon, aError)
float z
HtmlImportState
Definition: editdata.hxx:221
RtfImportState
Definition: editdata.hxx:214
void ConvertAndPutItems(SfxItemSet &rDest, const SfxItemSet &rSource, const MapUnit *pSourceUnit, const MapUnit *pDestUnit)
Definition: editdoc.cxx:888
constexpr TypedWhichId< SvxFieldItem > EE_FEATURE_FIELD(EE_FEATURE_NOTCONV+1)
constexpr TypedWhichId< SvxFontHeightItem > EE_CHAR_FONTHEIGHT(EE_CHAR_START+2)
constexpr TypedWhichId< SvxEscapementItem > EE_CHAR_ESCAPEMENT(EE_CHAR_START+10)
constexpr TypedWhichId< SfxInt16Item > EE_PARA_OUTLLEVEL(EE_PARA_START+11)
constexpr TypedWhichId< SvxFontHeightItem > EE_CHAR_FONTHEIGHT_CTL(EE_CHAR_START+20)
constexpr TypedWhichId< SvxFontHeightItem > EE_CHAR_FONTHEIGHT_CJK(EE_CHAR_START+19)
constexpr TypedWhichId< SvxFontItem > EE_CHAR_FONTINFO(EE_CHAR_START+1)
constexpr MapUnit gRTFMapUnit
Definition: eertfpar.cxx:59
#define DFLT_ESC_AUTO_SUB
#define DFLT_ESC_AUTO_SUPER
OUString aName
sal_Int64 n
AlgAtomPtr mpNode
MapUnit
OString strip(const OString &rIn, char c)
end
long Long
SwContentNode * GetNode(SwPaM &rPam, bool &rbFirst, SwMoveFnCollection const &fnMove, bool const bInReadOnly, SwRootFrame const *const i_pLayout)
DefTokenId nToken
RTF_LISTTEXT
RTF_SP
RTF_SHPINST
RTF_FLDRSLT
RTF_PGDSCTBL
RTF_FIELD
RTF_DEFTAB
RTF_STYLESHEET
RTF_CELL
RTF_DEFF
RTF_TEXTTOKEN
RTF_FLDINST
RTF_LINE
static SfxItemSet & rSet
SvParser< HtmlTokenId > * pParser
Definition: editdata.hxx:231
HtmlTokenId nToken
Definition: editdata.hxx:235
HtmlImportInfo(HtmlImportState eState, SvParser< HtmlTokenId > *pPrsrs, const ESelection &rSel)
Definition: eertfpar.cxx:38
HtmlImportState eState
Definition: editdata.hxx:233
SvParser< int > * pParser
Definition: editdata.hxx:245
short nTokenValue
Definition: editdata.hxx:250
RtfImportState eState
Definition: editdata.hxx:247
RtfImportInfo(RtfImportState eState, SvParser< int > *pPrsrs, const ESelection &rSel)
Definition: eertfpar.cxx:50
sal_uInt16 nBasedOn
Definition: svxrtf.hxx:81
SfxItemSet aAttrSet
Definition: svxrtf.hxx:79
OUString sName
Definition: svxrtf.hxx:80
SvParserState
std::map< sal_uInt16, SvxRTFStyleType > SvxRTFStyleTbl
Definition: svxrtf.hxx:87