LibreOffice Module sw (master) 1
docfmt.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 <libxml/xmlwriter.h>
21#include <hintids.hxx>
22#include <svl/itemiter.hxx>
23#include <svl/numformat.hxx>
24#include <editeng/tstpitem.hxx>
25#include <editeng/lrspitem.hxx>
27#include <editeng/rsiditem.hxx>
28#include <editeng/colritem.hxx>
29#include <officecfg/Office/Common.hxx>
30#include <osl/diagnose.h>
31#include <svl/zforlist.hxx>
34#include <sal/log.hxx>
35#include <com/sun/star/i18n/WordType.hpp>
36#include <com/sun/star/i18n/XBreakIterator.hpp>
37#include <fmtpdsc.hxx>
38#include <fmthdft.hxx>
39#include <fmtcntnt.hxx>
40#include <doc.hxx>
41#include <docfunc.hxx>
42#include <drawdoc.hxx>
43#include <MarkManager.hxx>
45#include <IDocumentUndoRedo.hxx>
49#include <IDocumentState.hxx>
53#include <rootfrm.hxx>
54#include <txtfrm.hxx>
55#include <hints.hxx>
56#include <ndtxt.hxx>
57#include <pam.hxx>
58#include <UndoCore.hxx>
59#include <UndoAttribute.hxx>
60#include <UndoInsert.hxx>
61#include <pagedesc.hxx>
62#include <rolbck.hxx>
63#include <mvsave.hxx>
64#include <txatbase.hxx>
65#include <swtblfmt.hxx>
66#include <charfmt.hxx>
67#include <docary.hxx>
68#include <paratr.hxx>
69#include <redline.hxx>
70#include <reffld.hxx>
71#include <fmtinfmt.hxx>
72#include <breakit.hxx>
73#include <SwUndoFmt.hxx>
74#include <UndoManager.hxx>
75#include <swmodule.hxx>
76#include <modcfg.hxx>
77#include <frameformats.hxx>
78#include <textboxhelper.hxx>
80#include <memory>
81
82using namespace ::com::sun::star::i18n;
83using namespace ::com::sun::star::lang;
84using namespace ::com::sun::star::uno;
85
86/*
87 * Internal functions
88 */
89
90static void SetTextFormatCollNext( SwTextFormatColl* pTextColl, const SwTextFormatColl* pDel )
91{
92 if ( &pTextColl->GetNextTextFormatColl() == pDel )
93 {
94 pTextColl->SetNextTextFormatColl( *pTextColl );
95 }
96}
97
98static bool lcl_RstAttr( SwNode* pNd, void* pArgs )
99{
101 SwContentNode* pNode = pNd->GetContentNode();
102 if (pPara && pPara->pLayout && pPara->pLayout->HasMergedParas()
103 && pNode && pNode->GetRedlineMergeFlag() == SwNode::Merge::Hidden)
104 {
105 return true;
106 }
107 if( pNode && pNode->HasSwAttrSet() )
108 {
109 const bool bLocked = pNode->IsModifyLocked();
110 pNode->LockModify();
111
112 SwDoc& rDoc = pNode->GetDoc();
113
114 // remove unused attribute RES_LR_SPACE
115 // add list attributes
119 RES_PAGEDESC, RES_BREAK> aSavedAttrsSet(rDoc.GetAttrPool());
120 const SfxItemSet* pAttrSetOfNode = pNode->GetpSwAttrSet();
121
122 std::vector<sal_uInt16> aClearWhichIds;
123 // restoring all paragraph list attributes
124 {
126 aListAttrSet.Set(*pAttrSetOfNode);
127 if ( aListAttrSet.Count() )
128 {
129 aSavedAttrsSet.Put(aListAttrSet);
130 SfxItemIter aIter( aListAttrSet );
131 const SfxPoolItem* pItem = aIter.GetCurItem();
132 while( pItem )
133 {
134 aClearWhichIds.push_back( pItem->Which() );
135 pItem = aIter.NextItem();
136 }
137 }
138 }
139
140 const SfxPoolItem* pItem;
141
142 sal_uInt16 const aSavIds[3] = { RES_PAGEDESC, RES_BREAK, RES_PARATR_NUMRULE };
143 for (sal_uInt16 aSavId : aSavIds)
144 {
145 if (SfxItemState::SET == pAttrSetOfNode->GetItemState(aSavId, false, &pItem))
146 {
147 bool bSave = false;
148 switch( aSavId )
149 {
150 case RES_PAGEDESC:
151 bSave = nullptr != pItem->StaticWhichCast(RES_PAGEDESC).GetPageDesc();
152 break;
153 case RES_BREAK:
154 bSave = SvxBreak::NONE != pItem->StaticWhichCast(RES_BREAK).GetBreak();
155 break;
157 bSave = !pItem->StaticWhichCast(RES_PARATR_NUMRULE).GetValue().isEmpty();
158 break;
159 }
160 if( bSave )
161 {
162 aSavedAttrsSet.Put(*pItem);
163 aClearWhichIds.push_back(aSavId);
164 }
165 }
166 }
167
168 // do not clear items directly from item set and only clear to be kept
169 // attributes, if no deletion item set is found.
170 const bool bKeepAttributes =
171 !pPara || !pPara->pDelSet || pPara->pDelSet->Count() == 0;
172 if ( bKeepAttributes )
173 {
174 pNode->ResetAttr( aClearWhichIds );
175 }
176
177 if( !bLocked )
178 pNode->UnlockModify();
179
180 if( pPara )
181 {
182 SwRegHistory aRegH( pNode, *pNode, pPara->pHistory );
183
184 if( pPara->pDelSet && pPara->pDelSet->Count() )
185 {
186 OSL_ENSURE( !bKeepAttributes,
187 "<lcl_RstAttr(..)> - certain attributes are kept, but not needed." );
188 SfxItemIter aIter( *pPara->pDelSet );
189 for (pItem = aIter.GetCurItem(); pItem; pItem = aIter.NextItem())
190 {
191 if ( ( pItem->Which() != RES_PAGEDESC &&
192 pItem->Which() != RES_BREAK &&
193 pItem->Which() != RES_PARATR_NUMRULE ) ||
194 ( aSavedAttrsSet.GetItemState( pItem->Which(), false ) != SfxItemState::SET ) )
195 {
196 pNode->ResetAttr( pItem->Which() );
197 }
198 }
199 }
200 else if( pPara->bResetAll )
201 pNode->ResetAllAttr();
202 else
204 }
205 else
206 pNode->ResetAllAttr();
207
208 // only restore saved attributes, if needed
209 if (bKeepAttributes && aSavedAttrsSet.Count())
210 {
211 pNode->LockModify();
212
213 pNode->SetAttr(aSavedAttrsSet);
214
215 if( !bLocked )
216 pNode->UnlockModify();
217 }
218 }
219 return true;
220}
221
222void SwDoc::RstTextAttrs(const SwPaM &rRg, bool bInclRefToxMark,
223 bool bExactRange, SwRootFrame const*const pLayout)
224{
225 SwHistory* pHst = nullptr;
226 SwDataChanged aTmp( rRg );
227 if (GetIDocumentUndoRedo().DoesUndo())
228 {
229 std::unique_ptr<SwUndoResetAttr> pUndo(new SwUndoResetAttr( rRg, RES_CHRFMT ));
230 pHst = &pUndo->GetHistory();
231 GetIDocumentUndoRedo().AppendUndo(std::move(pUndo));
232 }
233 auto [pStt, pEnd] = rRg.StartEnd(); // SwPosition*
235 pStt, pEnd, pHst, nullptr, pLayout );
236 aPara.bInclRefToxMark = bInclRefToxMark;
237 aPara.bExactRange = bExactRange;
238 GetNodes().ForEach( pStt->GetNodeIndex(), pEnd->GetNodeIndex()+1,
241}
242
243void SwDoc::ResetAttrs( const SwPaM &rRg,
244 bool bTextAttr,
246 const bool bSendDataChangedEvents,
247 SwRootFrame const*const pLayout)
248{
249 SwPaM* pPam = const_cast<SwPaM*>(&rRg);
250 std::optional<SwPaM> oExtraPaM;
251 if( !bTextAttr && !rAttrs.empty() && RES_TXTATR_END > *(rAttrs.begin()) )
252 bTextAttr = true;
253
254 if( !rRg.HasMark() )
255 {
256 SwTextNode* pTextNd = rRg.GetPoint()->GetNode().GetTextNode();
257 if( !pTextNd )
258 return ;
259
260 oExtraPaM.emplace( *rRg.GetPoint() );
261 pPam = &*oExtraPaM;
262
263 SwPosition& rSt = *pPam->GetPoint();
264 sal_Int32 nMkPos, nPtPos = rSt.GetContentIndex();
265
266 // Special case: if the Cursor is located within a URL attribute, we take over it's area
267 SwTextAttr const*const pURLAttr(
269 if (pURLAttr && !pURLAttr->GetINetFormat().GetValue().isEmpty())
270 {
271 nMkPos = pURLAttr->GetStart();
272 nPtPos = *pURLAttr->End();
273 }
274 else
275 {
276 assert(g_pBreakIt && g_pBreakIt->GetBreakIter().is());
277 Boundary aBndry = g_pBreakIt->GetBreakIter()->getWordBoundary(
278 pTextNd->GetText(), nPtPos,
279 g_pBreakIt->GetLocale( pTextNd->GetLang( nPtPos ) ),
280 WordType::ANY_WORD /*ANYWORD_IGNOREWHITESPACES*/,
281 true);
282
283 if( aBndry.startPos < nPtPos && nPtPos < aBndry.endPos )
284 {
285 nMkPos = aBndry.startPos;
286 nPtPos = aBndry.endPos;
287 }
288 else
289 {
290 nPtPos = nMkPos = rSt.GetContentIndex();
291 if( bTextAttr )
292 pTextNd->DontExpandFormat( nPtPos );
293 }
294 }
295
296 rSt.SetContent(nMkPos);
297 pPam->SetMark();
298 pPam->GetPoint()->SetContent(nPtPos);
299 }
300
301 // #i96644#
302 std::optional< SwDataChanged > oDataChanged;
303 if ( bSendDataChangedEvents )
304 {
305 oDataChanged.emplace( *pPam );
306 }
307 SwHistory* pHst = nullptr;
308 if (GetIDocumentUndoRedo().DoesUndo())
309 {
310 std::unique_ptr<SwUndoResetAttr> pUndo(new SwUndoResetAttr( rRg,
311 bTextAttr ? sal_uInt16(RES_CONDTXTFMTCOLL) : sal_uInt16(RES_TXTFMTCOLL) ));
312 if( !rAttrs.empty() )
313 {
314 pUndo->SetAttrs( o3tl::sorted_vector(rAttrs) );
315 }
316 pHst = &pUndo->GetHistory();
317 GetIDocumentUndoRedo().AppendUndo(std::move(pUndo));
318 }
319
320 auto [pStt, pEnd] = pPam->StartEnd(); // SwPosition*
322 pStt, pEnd, pHst, nullptr, pLayout);
323
324 // mst: not including META here; it seems attrs with CH_TXTATR are omitted
329 aDelSet(GetAttrPool());
330 for( auto it = rAttrs.rbegin(); it != rAttrs.rend(); ++it )
331 {
332 if( POOLATTR_END > *it )
333 aDelSet.Put( *GetDfltAttr( *it ));
334 }
335 if( aDelSet.Count() )
336 aPara.pDelSet = &aDelSet;
337
338 bool bAdd = true;
339 SwNodeIndex aTmpStt( pStt->GetNode() );
340 SwNodeIndex aTmpEnd( pEnd->GetNode() );
341 if( pStt->GetContentIndex() ) // just one part
342 {
343 // set up a later, and all CharFormatAttr -> TextFormatAttr
344 SwTextNode* pTNd = aTmpStt.GetNode().GetTextNode();
345 if( pTNd && pTNd->HasSwAttrSet() && pTNd->GetpSwAttrSet()->Count() )
346 {
347 if (pHst)
348 {
349 SwRegHistory history(pTNd, *pTNd, pHst);
350 pTNd->FormatToTextAttr(pTNd);
351 }
352 else
353 {
354 pTNd->FormatToTextAttr(pTNd);
355 }
356 }
357
358 ++aTmpStt;
359 }
360 if( pEnd->GetContentIndex() == pEnd->GetNode().GetContentNode()->Len() )
361 {
362 // set up a later, and all CharFormatAttr -> TextFormatAttr
363 ++aTmpEnd;
364 bAdd = false;
365 }
366 else if( pStt->GetNode() != pEnd->GetNode() || !pStt->GetContentIndex() )
367 {
368 SwTextNode* pTNd = aTmpEnd.GetNode().GetTextNode();
369 if( pTNd && pTNd->HasSwAttrSet() && pTNd->GetpSwAttrSet()->Count() )
370 {
371 if (pHst)
372 {
373 SwRegHistory history(pTNd, *pTNd, pHst);
374 pTNd->FormatToTextAttr(pTNd);
375 }
376 else
377 {
378 pTNd->FormatToTextAttr(pTNd);
379 }
380 }
381 }
382
383 if( aTmpStt < aTmpEnd )
384 GetNodes().ForEach( pStt->GetNode(), aTmpEnd.GetNode(), lcl_RstAttr, &aPara );
385 else if( !rRg.HasMark() )
386 {
387 aPara.bResetAll = false ;
388 ::lcl_RstAttr( &pStt->GetNode(), &aPara );
389 aPara.bResetAll = true ;
390 }
391
392 if( bTextAttr )
393 {
394 if( bAdd )
395 ++aTmpEnd;
396 GetNodes().ForEach( pStt->GetNode(), aTmpEnd.GetNode(), sw::DocumentContentOperationsManager::lcl_RstTextAttr, &aPara );
397 }
398
400
401 oDataChanged.reset(); //before delete pPam
402}
403
405void SwDoc::UpdateRsid( const SwPaM &rRg, const sal_Int32 nLen )
406{
407 if (!SW_MOD()->GetModuleConfig()->IsStoreRsid())
408 return;
409
410 SwTextNode *pTextNode = rRg.GetPoint()->GetNode().GetTextNode();
411 if (!pTextNode)
412 {
413 return;
414 }
415 const sal_Int32 nStart(rRg.GetPoint()->GetContentIndex() - nLen);
417
419 aSet.Put(aRsid);
420 bool const bRet(pTextNode->SetAttr(aSet, nStart,
421 rRg.GetPoint()->GetContentIndex()));
422
423 if (bRet && GetIDocumentUndoRedo().DoesUndo())
424 {
425 SwUndo *const pLastUndo = GetUndoManager().GetLastUndo();
426 SwUndoInsert *const pUndoInsert(dynamic_cast<SwUndoInsert*>(pLastUndo));
427 // this function is called after Insert so expects to find SwUndoInsert
428 assert(pUndoInsert);
429 if (pUndoInsert)
430 {
431 pUndoInsert->SetWithRsid();
432 }
433 }
434}
435
436bool SwDoc::UpdateParRsid( SwTextNode *pTextNode, sal_uInt32 nVal )
437{
438 if (!SW_MOD()->GetModuleConfig()->IsStoreRsid())
439 return false;
440
441 if (!pTextNode)
442 {
443 return false;
444 }
445
446 SvxRsidItem aRsid( nVal ? nVal : mnRsid, RES_PARATR_RSID );
447 return pTextNode->SetAttr( aRsid );
448}
449
452void SwDoc::SetAttr( const SfxPoolItem& rAttr, SwFormat& rFormat )
453{
454 SfxItemSet aSet( GetAttrPool(), rAttr.Which(), rAttr.Which() );
455 aSet.Put( rAttr );
456 SetAttr( aSet, rFormat );
457}
458
461void SwDoc::SetAttr( const SfxItemSet& rSet, SwFormat& rFormat )
462{
463 if (GetIDocumentUndoRedo().DoesUndo())
464 {
465 SwUndoFormatAttrHelper aTmp( rFormat );
466 rFormat.SetFormatAttr( rSet );
467 if ( aTmp.GetUndo() )
468 {
470 }
471 else
472 {
474 }
475 }
476 else
477 {
478 rFormat.SetFormatAttr( rSet );
479 }
480
481 // If the format is a shape, and it has a textbox, sync.
482 auto pShapeFormat = dynamic_cast<SwFrameFormat*>(&rFormat);
483 if (pShapeFormat && SwTextBoxHelper::isTextBox(pShapeFormat, RES_DRAWFRMFMT))
484 {
485 if (auto pObj = pShapeFormat->FindRealSdrObject())
486 {
487 SwTextBoxHelper::syncFlyFrameAttr(*pShapeFormat, rSet, pObj);
488 SwTextBoxHelper::changeAnchor(pShapeFormat, pObj);
489 }
490 }
491
493}
494
495void SwDoc::ResetAttrAtFormat( const sal_uInt16 nWhichId,
496 SwFormat& rChangedFormat )
497{
498 std::unique_ptr<SwUndo> pUndo;
499 if (GetIDocumentUndoRedo().DoesUndo())
500 pUndo.reset(new SwUndoFormatResetAttr( rChangedFormat, nWhichId ));
501
502 const bool bAttrReset = rChangedFormat.ResetFormatAttr( nWhichId );
503
504 if ( bAttrReset )
505 {
506 if ( pUndo )
507 {
508 GetIDocumentUndoRedo().AppendUndo( std::move(pUndo) );
509 }
510
512 }
513}
514
515static bool lcl_SetNewDefTabStops( SwTwips nOldWidth, SwTwips nNewWidth,
516 SvxTabStopItem& rChgTabStop )
517{
518 // Set the default values of all TabStops to the new value.
519 // Attention: we always work with the PoolAttribute here, so that
520 // we don't calculate the same value on the same TabStop (pooled!) for all sets.
521 // We send a FormatChg to modify.
522
523 sal_uInt16 nOldCnt = rChgTabStop.Count();
524 if( !nOldCnt || nOldWidth == nNewWidth )
525 return false;
526
527 // Find the default's beginning
528 sal_uInt16 n;
529 for( n = nOldCnt; n ; --n )
530 if( SvxTabAdjust::Default != rChgTabStop[n - 1].GetAdjustment() )
531 break;
532 ++n;
533 if( n < nOldCnt ) // delete the DefTabStops
534 rChgTabStop.Remove( n, nOldCnt - n );
535 return true;
536}
537
540void SwDoc::SetDefault( const SfxPoolItem& rAttr )
541{
542 SfxItemSet aSet( GetAttrPool(), rAttr.Which(), rAttr.Which() );
543 aSet.Put( rAttr );
544 SetDefault( aSet );
545}
546
547void SwDoc::SetDefault( const SfxItemSet& rSet )
548{
549 if( !rSet.Count() )
550 return;
551
552 sw::BroadcastingModify aCallMod;
553 SwAttrSet aOld( GetAttrPool(), rSet.GetRanges() ),
554 aNew( GetAttrPool(), rSet.GetRanges() );
555 SfxItemIter aIter( rSet );
556 const SfxPoolItem* pItem = aIter.GetCurItem();
558 do
559 {
560 bool bCheckSdrDflt = false;
561 const sal_uInt16 nWhich = pItem->Which();
562 aOld.Put( GetAttrPool().GetDefaultItem( nWhich ) );
564 aNew.Put( GetAttrPool().GetDefaultItem( nWhich ) );
565
566 if (isCHRATR(nWhich) || isTXTATR(nWhich))
567 {
568 aCallMod.Add( mpDfltTextFormatColl.get() );
569 aCallMod.Add( mpDfltCharFormat.get() );
570 bCheckSdrDflt = nullptr != pSdrPool;
571 }
572 else if ( isPARATR(nWhich) ||
573 isPARATR_LIST(nWhich) )
574 {
575 aCallMod.Add( mpDfltTextFormatColl.get() );
576 bCheckSdrDflt = nullptr != pSdrPool;
577 }
578 else if (isGRFATR(nWhich))
579 {
580 aCallMod.Add( mpDfltGrfFormatColl.get() );
581 }
582 else if (isFRMATR(nWhich) || isDrawingLayerAttribute(nWhich) )
583 {
584 aCallMod.Add( mpDfltGrfFormatColl.get() );
585 aCallMod.Add( mpDfltTextFormatColl.get() );
586 aCallMod.Add( mpDfltFrameFormat.get() );
587 }
588 else if (isBOXATR(nWhich))
589 {
590 aCallMod.Add( mpDfltFrameFormat.get() );
591 }
592
593 // also copy the defaults
594 if( bCheckSdrDflt )
595 {
596 sal_uInt16 nSlotId = GetAttrPool().GetSlotId( nWhich );
597 if( 0 != nSlotId && nSlotId != nWhich )
598 {
599 sal_uInt16 nEdtWhich = pSdrPool->GetWhich( nSlotId );
600 if( 0 != nEdtWhich && nSlotId != nEdtWhich )
601 {
602 std::unique_ptr<SfxPoolItem> pCpy(pItem->Clone());
603 pCpy->SetWhich( nEdtWhich );
604 pSdrPool->SetPoolDefaultItem( *pCpy );
605 }
606 }
607 }
608
609 pItem = aIter.NextItem();
610 } while (pItem);
611
612 if( aNew.Count() && aCallMod.HasWriterListeners() )
613 {
614 if (GetIDocumentUndoRedo().DoesUndo())
615 {
616 GetIDocumentUndoRedo().AppendUndo( std::make_unique<SwUndoDefaultAttr>( aOld, *this ) );
617 }
618
619 const SvxTabStopItem* pTmpItem = aNew.GetItemIfSet( RES_PARATR_TABSTOP, false );
620 if( pTmpItem && pTmpItem->Count() )
621 {
622 // Set the default values of all TabStops to the new value.
623 // Attention: we always work with the PoolAttribute here, so that
624 // we don't calculate the same value on the same TabStop (pooled!) for all sets.
625 // We send a FormatChg to modify.
626 SwTwips nNewWidth = (*pTmpItem)[ 0 ].GetTabPos(),
627 nOldWidth = aOld.Get(RES_PARATR_TABSTOP)[ 0 ].GetTabPos();
628
629 bool bChg = false;
630 for (const SfxPoolItem* pItem2 : GetAttrPool().GetItemSurrogates(RES_PARATR_TABSTOP))
631 {
632 if(auto pTabStopItem = pItem2->DynamicWhichCast(RES_PARATR_TABSTOP))
633 bChg |= lcl_SetNewDefTabStops( nOldWidth, nNewWidth,
634 *const_cast<SvxTabStopItem*>(pTabStopItem) );
635 }
636
638 aOld.ClearItem( RES_PARATR_TABSTOP );
639 if( bChg )
640 {
641 SwFormatChg aChgFormat( mpDfltCharFormat.get() );
642 // notify the frames
643 aCallMod.CallSwClientNotify(sw::LegacyModifyHint( &aChgFormat, &aChgFormat ));
644 }
645 }
646 }
647
648 if( aNew.Count() && aCallMod.HasWriterListeners() )
649 {
650 SwAttrSetChg aChgOld( aOld, aOld );
651 SwAttrSetChg aChgNew( aNew, aNew );
652 aCallMod.CallSwClientNotify(sw::LegacyModifyHint( &aChgOld, &aChgNew )); // all changed are sent
653 }
654
655 // remove the default formats from the object again
657 for(SwClient* pClient = aClientIter.First(); pClient; pClient = aClientIter.Next())
658 aCallMod.Remove( pClient );
659
661}
662
664const SfxPoolItem& SwDoc::GetDefault( sal_uInt16 nFormatHint ) const
665{
666 return GetAttrPool().GetDefaultItem( nFormatHint );
667}
668
670void SwDoc::DelCharFormat(size_t nFormat, bool bBroadcast)
671{
672 SwCharFormat * pDel = (*mpCharFormatTable)[nFormat];
673
674 if (bBroadcast)
675 BroadcastStyleOperation(pDel->GetName(), SfxStyleFamily::Char,
676 SfxHintId::StyleSheetErased);
677
678 if (GetIDocumentUndoRedo().DoesUndo())
679 {
681 std::make_unique<SwUndoCharFormatDelete>(pDel, *this));
682 }
683
684 delete (*mpCharFormatTable)[nFormat];
685 mpCharFormatTable->erase(mpCharFormatTable->begin() + nFormat);
686
688}
689
690void SwDoc::DelCharFormat( SwCharFormat const *pFormat, bool bBroadcast )
691{
692 size_t nFormat = mpCharFormatTable->GetPos( pFormat );
693 OSL_ENSURE( SIZE_MAX != nFormat, "Format not found," );
694 DelCharFormat( nFormat, bBroadcast );
695}
696
697void SwDoc::DelFrameFormat( SwFrameFormat *pFormat, bool bBroadcast )
698{
699 if( dynamic_cast<const SwTableBoxFormat*>( pFormat) != nullptr || dynamic_cast<const SwTableLineFormat*>( pFormat) != nullptr )
700 {
701 OSL_ENSURE( false, "Format is not in the DocArray any more, "
702 "so it can be deleted with delete" );
703 delete pFormat;
704 }
705 else
706 {
707 // The format has to be in the one or the other, we'll see in which one.
708 if (mpFrameFormatTable->ContainsFormat(*pFormat))
709 {
710 if (bBroadcast)
712 SfxStyleFamily::Frame,
713 SfxHintId::StyleSheetErased);
714
715 if (GetIDocumentUndoRedo().DoesUndo())
716 {
718 std::make_unique<SwUndoFrameFormatDelete>(pFormat, *this));
719 }
720
721 mpFrameFormatTable->erase( pFormat );
722 delete pFormat;
723 }
724 else
725 {
726 bool contains = GetSpzFrameFormats()->ContainsFormat(*pFormat);
727 OSL_ENSURE( contains, "FrameFormat not found." );
728 if( contains )
729 {
730 GetSpzFrameFormats()->erase( pFormat );
731 delete pFormat;
732 }
733 }
734 }
735}
736
738{
740 OSL_ENSURE( it != mpTableFrameFormatTable->end(), "Format not found," );
741 mpTableFrameFormatTable->erase( it );
742 delete pFormat;
743}
744
745SwFrameFormat* SwDoc::FindFrameFormatByName( const OUString& rName ) const
746{
747 return mpFrameFormatTable->FindFormatByName( rName );
748}
749
751SwFlyFrameFormat *SwDoc::MakeFlyFrameFormat( const OUString &rFormatName,
752 SwFrameFormat *pDerivedFrom )
753{
754 SwFlyFrameFormat *pFormat = new SwFlyFrameFormat( GetAttrPool(), rFormatName, pDerivedFrom );
755 GetSpzFrameFormats()->push_back(pFormat);
757 return pFormat;
758}
759
760SwDrawFrameFormat *SwDoc::MakeDrawFrameFormat( const OUString &rFormatName,
761 SwFrameFormat *pDerivedFrom )
762{
763 SwDrawFrameFormat *pFormat = new SwDrawFrameFormat( GetAttrPool(), rFormatName, pDerivedFrom);
764 GetSpzFrameFormats()->push_back(pFormat);
766 return pFormat;
767}
768
769size_t SwDoc::GetTableFrameFormatCount(bool bUsed) const
770{
771 if (!bUsed)
772 {
773 return mpTableFrameFormatTable->size();
774 }
775
777 size_t nCount = 0;
778 for (SwFrameFormat* const & pFormat : *mpTableFrameFormatTable)
779 {
780 if (!pFormat->GetInfo(aGetHt))
781 nCount++;
782 }
783 return nCount;
784}
785
786SwFrameFormat& SwDoc::GetTableFrameFormat(size_t nFormat, bool bUsed) const
787{
788 if (!bUsed)
789 {
790 return *((*mpTableFrameFormatTable)[nFormat]);
791 }
792
794
795 size_t index = 0;
796
797 for (SwFrameFormat* const & pFormat : *mpTableFrameFormatTable)
798 {
799 if (!pFormat->GetInfo(aGetHt))
800 {
801 if (index == nFormat)
802 return *pFormat;
803 else
804 index++;
805 }
806 }
807 throw std::out_of_range("Format index out of range.");
808}
809
810SwTableFormat* SwDoc::MakeTableFrameFormat( const OUString &rFormatName,
811 SwFrameFormat *pDerivedFrom )
812{
813 SwTableFormat* pFormat = new SwTableFormat( GetAttrPool(), rFormatName, pDerivedFrom );
814 mpTableFrameFormatTable->push_back( pFormat );
816
817 return pFormat;
818}
819
820SwFrameFormat *SwDoc::MakeFrameFormat(const OUString &rFormatName,
821 SwFrameFormat *pDerivedFrom,
822 bool bBroadcast, bool bAuto)
823{
824 SwFrameFormat *pFormat = new SwFrameFormat( GetAttrPool(), rFormatName, pDerivedFrom );
825
826 pFormat->SetAuto(bAuto);
827 mpFrameFormatTable->push_back( pFormat );
829
830 if (GetIDocumentUndoRedo().DoesUndo())
831 {
833 std::make_unique<SwUndoFrameFormatCreate>(pFormat, pDerivedFrom, *this));
834 }
835
836 if (bBroadcast)
837 {
838 BroadcastStyleOperation(rFormatName, SfxStyleFamily::Frame,
839 SfxHintId::StyleSheetCreated);
840 }
841
842 return pFormat;
843}
844
845SwFormat *SwDoc::MakeFrameFormat_(const OUString &rFormatName,
846 SwFormat *pDerivedFrom,
847 bool bBroadcast, bool bAuto)
848{
849 SwFrameFormat *pFrameFormat = dynamic_cast<SwFrameFormat*>(pDerivedFrom);
850 pFrameFormat = MakeFrameFormat( rFormatName, pFrameFormat, bBroadcast, bAuto );
851 return pFrameFormat;
852}
853
854SwCharFormat *SwDoc::MakeCharFormat( const OUString &rFormatName,
855 SwCharFormat *pDerivedFrom,
856 bool bBroadcast )
857{
858 SwCharFormat *pFormat = new SwCharFormat( GetAttrPool(), rFormatName, pDerivedFrom );
859 mpCharFormatTable->insert( pFormat );
860 pFormat->SetAuto(false);
862
863 if (GetIDocumentUndoRedo().DoesUndo())
864 {
866 std::make_unique<SwUndoCharFormatCreate>(pFormat, pDerivedFrom, *this));
867 }
868
869 if (bBroadcast)
870 {
871 BroadcastStyleOperation(rFormatName, SfxStyleFamily::Char,
872 SfxHintId::StyleSheetCreated);
873 }
874
875 return pFormat;
876}
877
878SwFormat *SwDoc::MakeCharFormat_(const OUString &rFormatName,
879 SwFormat *pDerivedFrom,
880 bool bBroadcast, bool /*bAuto*/)
881{
882 SwCharFormat *pCharFormat = dynamic_cast<SwCharFormat*>(pDerivedFrom);
883 pCharFormat = MakeCharFormat( rFormatName, pCharFormat, bBroadcast );
884 return pCharFormat;
885}
886
888SwTextFormatColl* SwDoc::MakeTextFormatColl( const OUString &rFormatName,
889 SwTextFormatColl *pDerivedFrom,
890 bool bBroadcast)
891{
892 SwTextFormatColl *pFormatColl = new SwTextFormatColl( GetAttrPool(), rFormatName,
893 pDerivedFrom );
894 mpTextFormatCollTable->push_back(pFormatColl);
895 pFormatColl->SetAuto(false);
897
898 if (GetIDocumentUndoRedo().DoesUndo())
899 {
901 std::make_unique<SwUndoTextFormatCollCreate>(pFormatColl, pDerivedFrom,
902 *this));
903 }
904
905 if (bBroadcast)
906 BroadcastStyleOperation(rFormatName, SfxStyleFamily::Para,
907 SfxHintId::StyleSheetCreated);
908
909 return pFormatColl;
910}
911
912SwFormat *SwDoc::MakeTextFormatColl_(const OUString &rFormatName,
913 SwFormat *pDerivedFrom,
914 bool bBroadcast, bool /*bAuto*/)
915{
916 SwTextFormatColl *pTextFormatColl = dynamic_cast<SwTextFormatColl*>(pDerivedFrom);
917 pTextFormatColl = MakeTextFormatColl( rFormatName, pTextFormatColl, bBroadcast );
918 return pTextFormatColl;
919}
920
921//FEATURE::CONDCOLL
923 SwTextFormatColl *pDerivedFrom,
924 bool bBroadcast)
925{
927 rFormatName, pDerivedFrom );
928 mpTextFormatCollTable->push_back(pFormatColl);
929 pFormatColl->SetAuto(false);
931
932 if (GetIDocumentUndoRedo().DoesUndo())
933 {
935 std::make_unique<SwUndoCondTextFormatCollCreate>(pFormatColl, pDerivedFrom,
936 *this));
937 }
938
939 if (bBroadcast)
940 BroadcastStyleOperation(rFormatName, SfxStyleFamily::Para,
941 SfxHintId::StyleSheetCreated);
942
943 return pFormatColl;
944}
945//FEATURE::CONDCOLL
946
947// GRF
948SwGrfFormatColl* SwDoc::MakeGrfFormatColl( const OUString &rFormatName,
949 SwGrfFormatColl *pDerivedFrom )
950{
951 SwGrfFormatColl *pFormatColl = new SwGrfFormatColl( GetAttrPool(), rFormatName,
952 pDerivedFrom );
953 mpGrfFormatCollTable->push_back( pFormatColl );
954 pFormatColl->SetAuto(false);
956 return pFormatColl;
957}
958
959void SwDoc::DelTextFormatColl(size_t nFormatColl, bool bBroadcast)
960{
961 OSL_ENSURE( nFormatColl, "Remove of Coll 0." );
962
963 // Who has the to-be-deleted as their Next?
964 SwTextFormatColl *pDel = (*mpTextFormatCollTable)[nFormatColl];
965 if( mpDfltTextFormatColl.get() == pDel )
966 return; // never delete default!
967
968 if (bBroadcast)
969 BroadcastStyleOperation(pDel->GetName(), SfxStyleFamily::Para,
970 SfxHintId::StyleSheetErased);
971
972 if (GetIDocumentUndoRedo().DoesUndo())
973 {
974 std::unique_ptr<SwUndoTextFormatCollDelete> pUndo;
975 if (RES_CONDTXTFMTCOLL == pDel->Which())
976 {
977 pUndo.reset(new SwUndoCondTextFormatCollDelete(pDel, *this));
978 }
979 else
980 {
981 pUndo.reset(new SwUndoTextFormatCollDelete(pDel, *this));
982 }
983
984 GetIDocumentUndoRedo().AppendUndo(std::move(pUndo));
985 }
986
987 // Remove the FormatColl
988 mpTextFormatCollTable->erase(mpTextFormatCollTable->begin() + nFormatColl);
989 // Correct next
990 for( SwTextFormatColls::const_iterator it = mpTextFormatCollTable->begin() + 1; it != mpTextFormatCollTable->end(); ++it )
991 SetTextFormatCollNext( *it, pDel );
992 delete pDel;
994}
995
996void SwDoc::DelTextFormatColl( SwTextFormatColl const *pColl, bool bBroadcast )
997{
998 size_t nFormat = mpTextFormatCollTable->GetPos( pColl );
999 OSL_ENSURE( SIZE_MAX != nFormat, "Collection not found," );
1000 DelTextFormatColl( nFormat, bBroadcast );
1001}
1002
1003static bool lcl_SetTextFormatColl( SwNode* pNode, void* pArgs )
1004{
1005 SwContentNode* pCNd = pNode->GetTextNode();
1006
1007 if( pCNd == nullptr)
1008 return true;
1009
1011
1012 if (pPara->pLayout && pPara->pLayout->HasMergedParas())
1013 {
1015 {
1016 return true;
1017 }
1018 if (pCNd->IsTextNode())
1019 {
1020 pCNd = sw::GetParaPropsNode(*pPara->pLayout, *pCNd);
1021 }
1022 }
1023
1024 SwTextFormatColl* pFormat = static_cast<SwTextFormatColl*>(pPara->pFormatColl);
1025 if ( pPara->bReset )
1026 {
1027 lcl_RstAttr(pCNd, pPara);
1028
1029 // #i62675# check, if paragraph style has changed
1030 if ( pPara->bResetListAttrs &&
1031 pFormat != pCNd->GetFormatColl() &&
1032 pFormat->GetItemState( RES_PARATR_NUMRULE ) == SfxItemState::SET )
1033 {
1034 // Check, if the list style of the paragraph will change.
1035 bool bChangeOfListStyleAtParagraph( true );
1036 SwTextNode& rTNd(*pCNd->GetTextNode());
1037 {
1038 SwNumRule* pNumRuleAtParagraph(rTNd.GetNumRule());
1039 if ( pNumRuleAtParagraph )
1040 {
1041 const SwNumRuleItem& rNumRuleItemAtParagraphStyle =
1042 pFormat->GetNumRule();
1043 if ( rNumRuleItemAtParagraphStyle.GetValue() ==
1044 pNumRuleAtParagraph->GetName() )
1045 {
1046 bChangeOfListStyleAtParagraph = false;
1047 }
1048 }
1049 }
1050
1051 if ( bChangeOfListStyleAtParagraph )
1052 {
1053 std::unique_ptr< SwRegHistory > pRegH;
1054 if ( pPara->pHistory )
1055 {
1056 pRegH.reset(new SwRegHistory(&rTNd, rTNd, pPara->pHistory));
1057 }
1058
1060
1061 // reset all list attributes
1067 }
1068 }
1069 }
1070
1071 // add to History so that old data is saved, if necessary
1072 if( pPara->pHistory )
1073 pPara->pHistory->Add( pCNd->GetFormatColl(), pCNd->GetIndex(),
1075
1076 pCNd->ChgFormatColl( pFormat );
1077
1078 pPara->nWhich++;
1079
1080 return true;
1081}
1082
1084 SwTextFormatColl *pFormat,
1085 const bool bReset,
1086 const bool bResetListAttrs,
1087 SwRootFrame const*const pLayout)
1088{
1089 SwDataChanged aTmp( rRg );
1090 auto [pStt, pEnd] = rRg.StartEnd(); // SwPosition*
1091 SwHistory* pHst = nullptr;
1092 bool bRet = true;
1093
1094 if (GetIDocumentUndoRedo().DoesUndo())
1095 {
1096 std::unique_ptr<SwUndoFormatColl> pUndo(new SwUndoFormatColl( rRg, pFormat,
1097 bReset,
1098 bResetListAttrs ));
1099 pHst = pUndo->GetHistory();
1100 GetIDocumentUndoRedo().AppendUndo(std::move(pUndo));
1101 }
1102
1104 pStt, pEnd, pHst, nullptr, pLayout);
1105 aPara.pFormatColl = pFormat;
1106 aPara.bReset = bReset;
1107 // #i62675#
1108 aPara.bResetListAttrs = bResetListAttrs;
1109
1110 GetNodes().ForEach( pStt->GetNodeIndex(), pEnd->GetNodeIndex()+1,
1111 lcl_SetTextFormatColl, &aPara );
1112 if( !aPara.nWhich )
1113 bRet = false; // didn't find a valid Node
1114
1115 if (bRet)
1116 {
1118 }
1119
1120 return bRet;
1121}
1122
1125 const SwFormatsBase& rFormatArr,
1126 FNCopyFormat fnCopyFormat, const SwFormat& rDfltFormat )
1127{
1128 // It's no autoformat, default format or collection format,
1129 // then search for it.
1130 if( !rFormat.IsAuto() || !rFormat.GetRegisteredIn() )
1131 for( size_t n = 0; n < rFormatArr.GetFormatCount(); ++n )
1132 {
1133 // Does the Doc already contain the template?
1134 if( rFormatArr.GetFormat(n)->GetName()==rFormat.GetName() )
1135 return rFormatArr.GetFormat(n);
1136 }
1137
1138 // Search for the "parent" first
1139 SwFormat* pParent = const_cast<SwFormat*>(&rDfltFormat);
1140 if( rFormat.DerivedFrom() && pParent != rFormat.DerivedFrom() )
1141 pParent = CopyFormat( *rFormat.DerivedFrom(), rFormatArr,
1142 fnCopyFormat, rDfltFormat );
1143
1144 // Create the format and copy the attributes
1145 // #i40550#
1146 SwFormat* pNewFormat = (this->*fnCopyFormat)( rFormat.GetName(), pParent, false, true );
1147 pNewFormat->SetAuto( rFormat.IsAuto() );
1148 pNewFormat->CopyAttrs( rFormat ); // copy the attributes
1149
1150 pNewFormat->SetPoolFormatId( rFormat.GetPoolFormatId() );
1151 pNewFormat->SetPoolHelpId( rFormat.GetPoolHelpId() );
1152
1153 // Always set the HelpFile Id to default!
1154 pNewFormat->SetPoolHlpFileId( UCHAR_MAX );
1155
1156 return pNewFormat;
1157}
1158
1161{
1162 return static_cast<SwFrameFormat*>(CopyFormat( rFormat, *GetFrameFormats(), &SwDoc::MakeFrameFormat_,
1163 *GetDfltFrameFormat() ));
1164}
1165
1168{
1169 return static_cast<SwCharFormat*>(CopyFormat( rFormat, *GetCharFormats(),
1171 *GetDfltCharFormat() ));
1172}
1173
1176{
1177 SwTextFormatColl* pNewColl = FindTextFormatCollByName( rColl.GetName() );
1178 if( pNewColl )
1179 return pNewColl;
1180
1181 // search for the "parent" first
1182 SwTextFormatColl* pParent = mpDfltTextFormatColl.get();
1183 if( pParent != rColl.DerivedFrom() )
1184 pParent = CopyTextColl( *static_cast<SwTextFormatColl*>(rColl.DerivedFrom()) );
1185
1186//FEATURE::CONDCOLL
1187 if( RES_CONDTXTFMTCOLL == rColl.Which() )
1188 {
1189 pNewColl = new SwConditionTextFormatColl( GetAttrPool(), rColl.GetName(),
1190 pParent);
1191 mpTextFormatCollTable->push_back( pNewColl );
1192 pNewColl->SetAuto(false);
1194
1195 // copy the conditions
1196 static_cast<SwConditionTextFormatColl*>(pNewColl)->SetConditions(
1197 static_cast<const SwConditionTextFormatColl&>(rColl).GetCondColls() );
1198 }
1199 else
1200//FEATURE::CONDCOLL
1201 pNewColl = MakeTextFormatColl( rColl.GetName(), pParent );
1202
1203 // copy the auto formats or the attributes
1204 pNewColl->CopyAttrs( rColl );
1205
1208 pNewColl->SetPoolFormatId( rColl.GetPoolFormatId() );
1209 pNewColl->SetPoolHelpId( rColl.GetPoolHelpId() );
1210
1211 // Always set the HelpFile Id to default!
1212 pNewColl->SetPoolHlpFileId( UCHAR_MAX );
1213
1214 if( &rColl.GetNextTextFormatColl() != &rColl )
1216
1217 // create the NumRule if necessary
1218 if( this != rColl.GetDoc() )
1219 {
1220 const SwNumRuleItem* pItem = pNewColl->GetItemIfSet( RES_PARATR_NUMRULE,
1221 false );
1222 if( pItem )
1223 {
1224 const OUString& rName = pItem->GetValue();
1225 if( !rName.isEmpty() )
1226 {
1227 const SwNumRule* pRule = rColl.GetDoc()->FindNumRulePtr( rName );
1228 if( pRule && !pRule->IsAutoRule() )
1229 {
1230 SwNumRule* pDestRule = FindNumRulePtr( rName );
1231 if( pDestRule )
1232 pDestRule->SetInvalidRule( true );
1233 else
1234 MakeNumRule( rName, pRule );
1235 }
1236 }
1237 }
1238 }
1239 return pNewColl;
1240}
1241
1244{
1245 SwGrfFormatColl* pNewColl = mpGrfFormatCollTable->FindFormatByName( rColl.GetName() );
1246 if( pNewColl )
1247 return pNewColl;
1248
1249 // Search for the "parent" first
1250 SwGrfFormatColl* pParent = mpDfltGrfFormatColl.get();
1251 if( pParent != rColl.DerivedFrom() )
1252 pParent = CopyGrfColl( *static_cast<SwGrfFormatColl*>(rColl.DerivedFrom()) );
1253
1254 // if not, copy them
1255 pNewColl = MakeGrfFormatColl( rColl.GetName(), pParent );
1256
1257 // copy the attributes
1258 pNewColl->CopyAttrs( rColl );
1259
1260 pNewColl->SetPoolFormatId( rColl.GetPoolFormatId() );
1261 pNewColl->SetPoolHelpId( rColl.GetPoolHelpId() );
1262
1263 // Always set the HelpFile Id to default!
1264 pNewColl->SetPoolHlpFileId( UCHAR_MAX );
1265
1266 return pNewColl;
1267}
1268
1269void SwDoc::CopyFormatArr( const SwFormatsBase& rSourceArr,
1270 SwFormatsBase const & rDestArr,
1271 FNCopyFormat fnCopyFormat,
1272 SwFormat& rDfltFormat )
1273{
1274 SwFormat* pSrc, *pDest;
1275
1276 // 1st step: Create all formats (skip the 0th - it's the default one)
1277 for( size_t nSrc = rSourceArr.GetFormatCount(); nSrc > 1; )
1278 {
1279 pSrc = rSourceArr.GetFormat( --nSrc );
1280 if( pSrc->IsDefault() || pSrc->IsAuto() )
1281 continue;
1282
1283 if( nullptr == rDestArr.FindFormatByName( pSrc->GetName() ) )
1284 {
1285 if( RES_CONDTXTFMTCOLL == pSrc->Which() )
1286 MakeCondTextFormatColl( pSrc->GetName(), static_cast<SwTextFormatColl*>(&rDfltFormat) );
1287 else
1288 // #i40550#
1289 (this->*fnCopyFormat)( pSrc->GetName(), &rDfltFormat, false, true );
1290 }
1291 }
1292
1293 // 2nd step: Copy all attributes, set the right parents
1294 for( size_t nSrc = rSourceArr.GetFormatCount(); nSrc > 1; )
1295 {
1296 pSrc = rSourceArr.GetFormat( --nSrc );
1297 if( pSrc->IsDefault() || pSrc->IsAuto() )
1298 continue;
1299
1300 pDest = rDestArr.FindFormatByName( pSrc->GetName() );
1301 pDest->SetAuto(false);
1302 pDest->DelDiffs( *pSrc );
1303
1304 // #i94285#: existing <SwFormatPageDesc> instance, before copying attributes
1305 const SwFormatPageDesc* pItem;
1306 if( &GetAttrPool() != pSrc->GetAttrSet().GetPool()
1307 && (pItem = pSrc->GetAttrSet().GetItemIfSet( RES_PAGEDESC, false ))
1308 && pItem->GetPageDesc() )
1309 {
1310 SwFormatPageDesc aPageDesc( *pItem );
1311 const OUString& rNm = aPageDesc.GetPageDesc()->GetName();
1312 SwPageDesc* pPageDesc = FindPageDesc( rNm );
1313 if( !pPageDesc )
1314 {
1315 pPageDesc = MakePageDesc(rNm);
1316 }
1317 aPageDesc.RegisterToPageDesc( *pPageDesc );
1318 SwAttrSet aTmpAttrSet( pSrc->GetAttrSet() );
1319 aTmpAttrSet.Put( aPageDesc );
1320 pDest->SetFormatAttr( aTmpAttrSet );
1321 }
1322 else
1323 {
1324 pDest->SetFormatAttr( pSrc->GetAttrSet() );
1325 }
1326
1327 pDest->SetPoolFormatId( pSrc->GetPoolFormatId() );
1328 pDest->SetPoolHelpId( pSrc->GetPoolHelpId() );
1329
1330 // Always set the HelpFile Id to default!
1331 pDest->SetPoolHlpFileId( UCHAR_MAX );
1332
1333 if( pSrc->DerivedFrom() )
1334 pDest->SetDerivedFrom( rDestArr.FindFormatByName(
1335 pSrc->DerivedFrom()->GetName() ) );
1336 if( RES_TXTFMTCOLL == pSrc->Which() ||
1337 RES_CONDTXTFMTCOLL == pSrc->Which() )
1338 {
1339 SwTextFormatColl* pSrcColl = static_cast<SwTextFormatColl*>(pSrc),
1340 * pDstColl = static_cast<SwTextFormatColl*>(pDest);
1341 if( &pSrcColl->GetNextTextFormatColl() != pSrcColl )
1342 pDstColl->SetNextTextFormatColl(
1343 *static_cast<SwTextFormatColl*>(rDestArr.FindFormatByName( pSrcColl->GetNextTextFormatColl().GetName() )) );
1344
1346 pDstColl->AssignToListLevelOfOutlineStyle(pSrcColl->GetAssignedOutlineStyleLevel());
1347
1348//FEATURE::CONDCOLL
1349 if( RES_CONDTXTFMTCOLL == pSrc->Which() )
1350 {
1351 if (pDstColl->Which() != RES_CONDTXTFMTCOLL)
1352 {
1353 // Target already had a style with a matching name, but it's not a conditional
1354 // style, then don't copy the conditions.
1355 continue;
1356 }
1357
1358 // Copy the conditions, but delete the old ones first!
1359 static_cast<SwConditionTextFormatColl*>(pDstColl)->SetConditions(
1360 static_cast<SwConditionTextFormatColl*>(pSrc)->GetCondColls() );
1361 }
1362//FEATURE::CONDCOLL
1363 }
1364 }
1365}
1366
1368 const SwFrameFormat& rSrcFormat, SwFrameFormat& rDestFormat )
1369{
1370 // Treat the header and footer attributes in the right way:
1371 // Copy content nodes across documents!
1372 sal_uInt16 nAttr = bCpyHeader ? sal_uInt16(RES_HEADER) : sal_uInt16(RES_FOOTER);
1373 const SfxPoolItem* pItem;
1374 if( SfxItemState::SET != rSrcFormat.GetAttrSet().GetItemState( nAttr, false, &pItem ))
1375 return ;
1376
1377 // The header only contains the reference to the format from the other document!
1378 std::unique_ptr<SfxPoolItem> pNewItem(pItem->Clone());
1379
1380 SwFrameFormat* pOldFormat;
1381 if( bCpyHeader )
1382 pOldFormat = pNewItem->StaticWhichCast(RES_HEADER).GetHeaderFormat();
1383 else
1384 pOldFormat = pNewItem->StaticWhichCast(RES_FOOTER).GetFooterFormat();
1385
1386 if( !pOldFormat )
1387 return;
1388
1389 SwFrameFormat* pNewFormat = new SwFrameFormat( GetAttrPool(), "CpyDesc",
1391 pNewFormat->CopyAttrs( *pOldFormat );
1392
1393 if( const SwFormatContent* pContent = pNewFormat->GetAttrSet().GetItemIfSet(
1394 RES_CNTNT, false ) )
1395 {
1396 if( pContent->GetContentIdx() )
1397 {
1398 const SwNodes& rSrcNds = rSrcFormat.GetDoc()->GetNodes();
1399 SwStartNode* pSttNd = SwNodes::MakeEmptySection( GetNodes().GetEndOfAutotext(),
1400 bCpyHeader
1403 const SwNode& rCSttNd = pContent->GetContentIdx()->GetNode();
1404 SwNodeRange aRg( rCSttNd, SwNodeOffset(0), *rCSttNd.EndOfSectionNode() );
1405 rSrcNds.Copy_( aRg, *pSttNd->EndOfSectionNode() );
1406 rSrcFormat.GetDoc()->GetDocumentContentOperationsManager().CopyFlyInFlyImpl(aRg, nullptr, *pSttNd);
1407 // TODO: investigate calling CopyWithFlyInFly?
1408 SwPaM const source(aRg.aStart, aRg.aEnd);
1409 SwPosition dest(*pSttNd);
1410 sw::CopyBookmarks(source, dest);
1411 pNewFormat->SetFormatAttr( SwFormatContent( pSttNd ));
1412 }
1413 else
1414 pNewFormat->ResetFormatAttr( RES_CNTNT );
1415 }
1416 if( bCpyHeader )
1417 pNewItem->StaticWhichCast(RES_HEADER).RegisterToFormat(*pNewFormat);
1418 else
1419 pNewItem->StaticWhichCast(RES_FOOTER).RegisterToFormat(*pNewFormat);
1420 rDestFormat.SetFormatAttr( *pNewItem );
1421}
1422
1423void SwDoc::CopyPageDesc( const SwPageDesc& rSrcDesc, SwPageDesc& rDstDesc,
1424 bool bCopyPoolIds )
1425{
1426 bool bNotifyLayout = false;
1428
1429 rDstDesc.SetLandscape( rSrcDesc.GetLandscape() );
1430 rDstDesc.SetNumType( rSrcDesc.GetNumType() );
1431 if( rDstDesc.ReadUseOn() != rSrcDesc.ReadUseOn() )
1432 {
1433 rDstDesc.WriteUseOn( rSrcDesc.ReadUseOn() );
1434 bNotifyLayout = true;
1435 }
1436
1437 if( bCopyPoolIds )
1438 {
1439 rDstDesc.SetPoolFormatId( rSrcDesc.GetPoolFormatId() );
1440 rDstDesc.SetPoolHelpId( rSrcDesc.GetPoolHelpId() );
1441 // Always set the HelpFile Id to default!
1442 rDstDesc.SetPoolHlpFileId( UCHAR_MAX );
1443 }
1444
1445 if( rSrcDesc.GetFollow() != &rSrcDesc )
1446 {
1447 const SwPageDesc* pSrcFollow = rSrcDesc.GetFollow();
1448 SwPageDesc* pFollow = FindPageDesc( pSrcFollow->GetName() );
1449 if( !pFollow )
1450 {
1451 // copy
1452 pFollow = MakePageDesc( pSrcFollow->GetName() );
1453 CopyPageDesc( *pSrcFollow, *pFollow );
1454 }
1455 rDstDesc.SetFollow( pFollow );
1456 bNotifyLayout = true;
1457 }
1458
1459 // the header and footer attributes are copied separately
1460 // the content sections have to be copied in their entirety
1461 {
1462 SfxItemSet aAttrSet( rSrcDesc.GetMaster().GetAttrSet() );
1463 aAttrSet.ClearItem( RES_HEADER );
1464 aAttrSet.ClearItem( RES_FOOTER );
1465
1466 rDstDesc.GetMaster().DelDiffs( aAttrSet );
1467 rDstDesc.GetMaster().SetFormatAttr( aAttrSet );
1468
1469 aAttrSet.ClearItem();
1470 aAttrSet.Put( rSrcDesc.GetLeft().GetAttrSet() );
1471 aAttrSet.ClearItem( RES_HEADER );
1472 aAttrSet.ClearItem( RES_FOOTER );
1473
1474 rDstDesc.GetLeft().DelDiffs( aAttrSet );
1475 rDstDesc.GetLeft().SetFormatAttr( aAttrSet );
1476
1477 aAttrSet.ClearItem();
1478 aAttrSet.Put( rSrcDesc.GetFirstMaster().GetAttrSet() );
1479 aAttrSet.ClearItem( RES_HEADER );
1480 aAttrSet.ClearItem( RES_FOOTER );
1481
1482 rDstDesc.GetFirstMaster().DelDiffs( aAttrSet );
1483 rDstDesc.GetFirstMaster().SetFormatAttr( aAttrSet );
1484
1485 aAttrSet.ClearItem();
1486 aAttrSet.Put( rSrcDesc.GetFirstLeft().GetAttrSet() );
1487 aAttrSet.ClearItem( RES_HEADER );
1488 aAttrSet.ClearItem( RES_FOOTER );
1489
1490 rDstDesc.GetFirstLeft().DelDiffs( aAttrSet );
1491 rDstDesc.GetFirstLeft().SetFormatAttr( aAttrSet );
1492 }
1493
1494 CopyHeader( rSrcDesc.GetMaster(), rDstDesc.GetMaster() );
1495 CopyFooter( rSrcDesc.GetMaster(), rDstDesc.GetMaster() );
1496 if( !rDstDesc.IsHeaderShared() )
1497 CopyHeader( rSrcDesc.GetLeft(), rDstDesc.GetLeft() );
1498 else
1499 rDstDesc.GetLeft().SetFormatAttr( rDstDesc.GetMaster().GetHeader() );
1500 if( !rDstDesc.IsFirstShared() )
1501 {
1502 CopyHeader( rSrcDesc.GetFirstMaster(), rDstDesc.GetFirstMaster() );
1503 rDstDesc.GetFirstLeft().SetFormatAttr(rDstDesc.GetFirstMaster().GetHeader());
1504 }
1505 else
1506 {
1507 rDstDesc.GetFirstMaster().SetFormatAttr( rDstDesc.GetMaster().GetHeader() );
1508 rDstDesc.GetFirstLeft().SetFormatAttr(rDstDesc.GetLeft().GetHeader());
1509 }
1510
1511 if( !rDstDesc.IsFooterShared() )
1512 CopyFooter( rSrcDesc.GetLeft(), rDstDesc.GetLeft() );
1513 else
1514 rDstDesc.GetLeft().SetFormatAttr( rDstDesc.GetMaster().GetFooter() );
1515 if( !rDstDesc.IsFirstShared() )
1516 {
1517 CopyFooter( rSrcDesc.GetFirstMaster(), rDstDesc.GetFirstMaster() );
1518 rDstDesc.GetFirstLeft().SetFormatAttr(rDstDesc.GetFirstMaster().GetFooter());
1519 }
1520 else
1521 {
1522 rDstDesc.GetFirstMaster().SetFormatAttr( rDstDesc.GetMaster().GetFooter() );
1523 rDstDesc.GetFirstLeft().SetFormatAttr(rDstDesc.GetLeft().GetFooter());
1524 }
1525
1526 if( bNotifyLayout && pTmpRoot )
1527 {
1528 for( auto aLayout : GetAllLayouts() )
1529 aLayout->AllCheckPageDescs();
1530 }
1531
1532 // If foot notes change the pages have to be triggered
1533 if( !(rDstDesc.GetFootnoteInfo() == rSrcDesc.GetFootnoteInfo()) )
1534 {
1536 rDstDesc.SetFootnoteInfo( rSrcDesc.GetFootnoteInfo() );
1537 rDstDesc.GetMaster().CallSwClientNotify(aHint);
1538 rDstDesc.GetLeft().CallSwClientNotify(aHint);
1539 rDstDesc.GetFirstMaster().CallSwClientNotify(aHint);
1540 rDstDesc.GetFirstLeft().CallSwClientNotify(aHint);
1541 }
1542
1543 // Copy the stashed formats as well between the page descriptors...
1544 for (bool bFirst : { true, false })
1545 for (bool bLeft : { true, false })
1546 for (bool bHeader : { true, false })
1547 {
1548 if (!bLeft && !bFirst)
1549 continue;
1550 if (auto pStashedFormat = rSrcDesc.GetStashedFrameFormat(bHeader, bLeft, bFirst))
1551 rDstDesc.StashFrameFormat(*pStashedFormat, bHeader, bLeft, bFirst);
1552 }
1553}
1554
1555void SwDoc::ReplaceStyles( const SwDoc& rSource, bool bIncludePageStyles )
1556{
1557 ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo());
1558
1565
1566 //To-Do:
1567 // a) in rtf export don't export our hideous pgdsctbl
1568 // extension to rtf anymore
1569 // b) in sd rtf import (View::InsertData) don't use
1570 // a super-fragile test for mere presence of \trowd to
1571 // indicate import of rtf into a table
1572 // c) then drop use of bIncludePageStyles
1573 if (bIncludePageStyles)
1574 {
1575 // and now the page templates
1576 SwPageDescs::size_type nCnt = rSource.m_PageDescs.size();
1577 if( nCnt )
1578 {
1579 // a different Doc -> Number formatter needs to be merged
1580 SwTableNumFormatMerge aTNFM( rSource, *this );
1581
1582 // 1st step: Create all formats (skip the 0th - it's the default!)
1583 while( nCnt )
1584 {
1585 const SwPageDesc &rSrc = *rSource.m_PageDescs[ --nCnt ];
1586 if( nullptr == FindPageDesc( rSrc.GetName() ) )
1587 MakePageDesc( rSrc.GetName() );
1588 }
1589
1590 // 2nd step: Copy all attributes, set the right parents
1591 for (SwPageDescs::size_type i = rSource.m_PageDescs.size(); i; )
1592 {
1593 const SwPageDesc &rSrc = *rSource.m_PageDescs[ --i ];
1594 SwPageDesc* pDesc = FindPageDesc( rSrc.GetName() );
1595 CopyPageDesc( rSrc, *pDesc);
1596 }
1597 }
1598 }
1599
1600 // then there are the numbering templates
1601 const SwNumRuleTable::size_type nCnt = rSource.GetNumRuleTable().size();
1602 if( nCnt )
1603 {
1604 const SwNumRuleTable& rArr = rSource.GetNumRuleTable();
1605 for( SwNumRuleTable::size_type n = 0; n < nCnt; ++n )
1606 {
1607 const SwNumRule& rR = *rArr[ n ];
1608 SwNumRule* pNew = FindNumRulePtr( rR.GetName());
1609 if( pNew )
1610 pNew->CopyNumRule(*this, rR);
1611 else
1612 {
1613 if( !rR.IsAutoRule() )
1614 MakeNumRule( rR.GetName(), &rR );
1615 else
1616 {
1617 // as we reset all styles, there shouldn't be any unknown
1618 // automatic SwNumRules, because all should have been
1619 // created by the style copying!
1620 // So just warn and ignore.
1621 SAL_WARN( "sw.core", "Found unknown auto SwNumRule during reset!" );
1622 }
1623 }
1624 }
1625 }
1626
1627 if (undoGuard.UndoWasEnabled())
1628 {
1629 // nodes array was modified!
1631 }
1632
1634}
1635
1636void SwDoc::MoveLeftMargin(const SwPaM& rPam, bool bRight, bool bModulus,
1637 SwRootFrame const*const pLayout)
1638{
1639 SwHistory* pHistory = nullptr;
1640 if (GetIDocumentUndoRedo().DoesUndo())
1641 {
1642 std::unique_ptr<SwUndoMoveLeftMargin> pUndo(new SwUndoMoveLeftMargin( rPam, bRight,
1643 bModulus ));
1644 pHistory = &pUndo->GetHistory();
1645 GetIDocumentUndoRedo().AppendUndo( std::move(pUndo) );
1646 }
1647
1648 const SvxTabStopItem& rTabItem = GetDefault( RES_PARATR_TABSTOP );
1649 const sal_Int32 nDefDist = rTabItem.Count() ? rTabItem[0].GetTabPos() : 1134;
1650 const SwPosition &rStt = *rPam.Start(), &rEnd = *rPam.End();
1651 SwNodeIndex aIdx( rStt.GetNode() );
1652 while( aIdx <= rEnd.GetNode() )
1653 {
1654 SwTextNode* pTNd = aIdx.GetNode().GetTextNode();
1655 if( pTNd )
1656 {
1657 pTNd = sw::GetParaPropsNode(*pLayout, aIdx.GetNode());
1658 SvxLRSpaceItem aLS(pTNd->SwContentNode::GetAttr(RES_LR_SPACE));
1659
1660 // #i93873# See also lcl_MergeListLevelIndentAsLRSpaceItem in thints.cxx
1661 if ( pTNd->AreListLevelIndentsApplicable() )
1662 {
1663 const SwNumRule* pRule = pTNd->GetNumRule();
1664 if ( pRule )
1665 {
1666 const int nListLevel = pTNd->GetActualListLevel();
1667 if ( nListLevel >= 0 )
1668 {
1669 const SwNumFormat& rFormat = pRule->Get(o3tl::narrowing<sal_uInt16>(nListLevel));
1671 {
1672 aLS.SetTextLeft( rFormat.GetIndentAt() );
1673 aLS.SetTextFirstLineOffset( static_cast<short>(rFormat.GetFirstLineIndent()) );
1674 }
1675 }
1676 }
1677 }
1678
1679 tools::Long nNext = aLS.GetTextLeft();
1680 if( bModulus )
1681 nNext = ( nNext / nDefDist ) * nDefDist;
1682
1683 if( bRight )
1684 nNext += nDefDist;
1685 else
1686 if(nNext >0) // fdo#75936 set limit for decreasing indent
1687 nNext -= nDefDist;
1688
1689 aLS.SetTextLeft( nNext );
1690
1691 SwRegHistory aRegH( pTNd, *pTNd, pHistory );
1692 pTNd->SetAttr( aLS );
1693 aIdx = *sw::GetFirstAndLastNode(*pLayout, aIdx.GetNode()).second;
1694 }
1695 ++aIdx;
1696 }
1698}
1699
1700bool SwDoc::DontExpandFormat( const SwPosition& rPos, bool bFlag )
1701{
1702 bool bRet = false;
1703 SwTextNode* pTextNd = rPos.GetNode().GetTextNode();
1704 if( pTextNd )
1705 {
1706 bRet = pTextNd->DontExpandFormat( rPos.GetContentIndex(), bFlag );
1707 if( bRet && GetIDocumentUndoRedo().DoesUndo() )
1708 {
1709 GetIDocumentUndoRedo().AppendUndo( std::make_unique<SwUndoDontExpandFormat>(rPos) );
1710 }
1711 }
1712 return bRet;
1713}
1714
1716{
1718 pFormat->SetFormatName("TableBox" + OUString::number(reinterpret_cast<sal_IntPtr>(pFormat)));
1720 return pFormat;
1721}
1722
1724{
1726 pFormat->SetFormatName("TableLine" + OUString::number(reinterpret_cast<sal_IntPtr>(pFormat)));
1728 return pFormat;
1729}
1730
1732{
1733 if (mpNumberFormatter == nullptr)
1734 {
1741 };
1742}
1743
1745 : pNFormat( nullptr )
1746{
1747 // a different Doc -> Number formatter needs to be merged
1748 if( &rSrc != &rDest )
1749 {
1750 SvNumberFormatter* pN = const_cast<SwDoc&>(rSrc).GetNumberFormatter( false );
1751 if( pN )
1752 {
1753 pNFormat = rDest.GetNumberFormatter();
1754 pNFormat->MergeFormatter( *pN );
1755 }
1756 }
1757
1758 if( &rSrc != &rDest )
1760 MergeWithOtherDoc( rDest );
1761}
1762
1764{
1765 if( pNFormat )
1767}
1768
1769void SwDoc::SetTextFormatCollByAutoFormat( const SwPosition& rPos, sal_uInt16 nPoolId,
1770 const SfxItemSet* pSet )
1771{
1772 SwPaM aPam( rPos );
1773 SwTextNode* pTNd = rPos.GetNode().GetTextNode();
1774 assert(pTNd);
1775
1777 {
1778 // create the redline object
1779 const SwTextFormatColl& rColl = *pTNd->GetTextColl();
1780 SwRangeRedline* pRedl = new SwRangeRedline( RedlineType::FmtColl, aPam );
1781 pRedl->SetMark();
1782
1783 // Only those items that are not set by the Set again in the Node
1784 // are of interest. Thus, we take the difference.
1785 SwRedlineExtraData_FormatColl aExtraData( rColl.GetName(),
1786 rColl.GetPoolFormatId() );
1787 if( pSet && pTNd->HasSwAttrSet() )
1788 {
1789 SfxItemSet aTmp( *pTNd->GetpSwAttrSet() );
1790 aTmp.Differentiate( *pSet );
1791 // we handle the adjust item separately
1792 const SfxPoolItem* pItem;
1793 if( SfxItemState::SET == pTNd->GetpSwAttrSet()->GetItemState(
1794 RES_PARATR_ADJUST, false, &pItem ))
1795 aTmp.Put( *pItem );
1796 aExtraData.SetItemSet( aTmp );
1797 }
1798 pRedl->SetExtraData( &aExtraData );
1799
1800 //TODO: Undo is still missing!
1802 }
1803
1804 SetTextFormatColl( aPam, getIDocumentStylePoolAccess().GetTextCollFromPool( nPoolId ) );
1805
1806 if (pSet && pSet->Count())
1807 {
1808 aPam.SetMark();
1809 aPam.GetMark()->SetContent(pTNd->GetText().getLength());
1810 // sw_redlinehide: don't need layout currently because the only caller
1811 // passes in the properties node
1812 assert(static_cast<SwTextFrame const*>(pTNd->getLayoutFrame(nullptr))->GetTextNodeForParaProps() == pTNd);
1814 }
1815}
1816
1817void SwDoc::SetFormatItemByAutoFormat( const SwPaM& rPam, const SfxItemSet& rSet )
1818{
1819 SwTextNode* pTNd = rPam.GetPoint()->GetNode().GetTextNode();
1820 assert(pTNd);
1821
1823
1825 {
1826 // create the redline object
1827 SwRangeRedline* pRedl = new SwRangeRedline( RedlineType::Format, rPam );
1828 if( !pRedl->HasMark() )
1829 pRedl->SetMark();
1830
1831 // Only those items that are not set by the Set again in the Node
1832 // are of interest. Thus, we take the difference.
1833 SwRedlineExtraData_Format aExtraData( rSet );
1834
1835 pRedl->SetExtraData( &aExtraData );
1836
1837 //TODO: Undo is still missing!
1839
1841 }
1842
1843 const sal_Int32 nEnd(rPam.End()->GetContentIndex());
1844 std::vector<WhichPair> whichIds;
1845 SfxItemIter iter(rSet);
1846 for (SfxPoolItem const* pItem = iter.GetCurItem(); pItem; pItem = iter.NextItem())
1847 {
1848 whichIds.push_back({pItem->Which(), pItem->Which()});
1849 }
1850 SfxItemSet currentSet(GetAttrPool(), WhichRangesContainer(whichIds.data(), whichIds.size()));
1851 pTNd->GetParaAttr(currentSet, nEnd, nEnd);
1852 for (const WhichPair& rPair : whichIds)
1853 { // yuk - want to explicitly set the pool defaults too :-/
1854 currentSet.Put(currentSet.Get(rPair.first));
1855 }
1856
1858
1859 // fdo#62536: DONTEXPAND does not work when there is already an AUTOFMT
1860 // here, so insert the old attributes as an empty hint to stop expand
1861 SwPaM endPam(*pTNd, nEnd);
1862 endPam.SetMark();
1863 getIDocumentContentOperations().InsertItemSet(endPam, currentSet);
1864
1866}
1867
1868void SwDoc::ChgFormat(SwFormat & rFormat, const SfxItemSet & rSet)
1869{
1870 if (GetIDocumentUndoRedo().DoesUndo())
1871 {
1872 // copying <rSet> to <aSet>
1873 SfxItemSet aSet(rSet);
1874 // remove from <aSet> all items, which are already set at the format
1875 aSet.Differentiate(rFormat.GetAttrSet());
1876 // <aSet> contains now all *new* items for the format
1877
1878 // copying current format item set to <aOldSet>
1879 SfxItemSet aOldSet(rFormat.GetAttrSet());
1880 // insert new items into <aOldSet>
1881 aOldSet.Put(aSet);
1882 // invalidate all new items in <aOldSet> in order to clear these items,
1883 // if the undo action is triggered.
1884 {
1885 SfxItemIter aIter(aSet);
1886
1887 for (const SfxPoolItem* pItem = aIter.GetCurItem(); pItem; pItem = aIter.NextItem())
1888 {
1889 aOldSet.InvalidateItem(pItem->Which());
1890 }
1891 }
1892
1894 std::make_unique<SwUndoFormatAttr>(std::move(aOldSet), rFormat, /*bSaveDrawPt*/true));
1895 }
1896
1897 rFormat.SetFormatAttr(rSet);
1898}
1899
1900void SwDoc::RenameFormat(SwFormat & rFormat, const OUString & sNewName,
1901 bool bBroadcast)
1902{
1903 SfxStyleFamily eFamily = SfxStyleFamily::All;
1904
1905 if (GetIDocumentUndoRedo().DoesUndo())
1906 {
1907 std::unique_ptr<SwUndo> pUndo;
1908
1909 switch (rFormat.Which())
1910 {
1911 case RES_CHRFMT:
1912 pUndo.reset(new SwUndoRenameCharFormat(rFormat.GetName(), sNewName, *this));
1913 eFamily = SfxStyleFamily::Char;
1914 break;
1915 case RES_TXTFMTCOLL:
1916 pUndo.reset(new SwUndoRenameFormatColl(rFormat.GetName(), sNewName, *this));
1917 eFamily = SfxStyleFamily::Para;
1918 break;
1919 case RES_FRMFMT:
1920 pUndo.reset(new SwUndoRenameFrameFormat(rFormat.GetName(), sNewName, *this));
1921 eFamily = SfxStyleFamily::Frame;
1922 break;
1923
1924 default:
1925 break;
1926 }
1927
1928 if (pUndo)
1929 {
1930 GetIDocumentUndoRedo().AppendUndo(std::move(pUndo));
1931 }
1932 }
1933
1934 // name change means the o3tl::sorted_array is not property sorted
1935 if (rFormat.Which() == RES_CHRFMT)
1936 mpCharFormatTable->SetFormatNameAndReindex(static_cast<SwCharFormat*>(&rFormat), sNewName);
1937 else
1938 rFormat.SetFormatName(sNewName);
1939
1940 if (bBroadcast)
1941 BroadcastStyleOperation(sNewName, eFamily, SfxHintId::StyleSheetModified);
1942}
1943
1945{
1946 bool bOwns = false;
1947 if (!pWriter)
1948 {
1949 pWriter = xmlNewTextWriterFilename("nodes.xml", 0);
1950 xmlTextWriterSetIndent(pWriter,1);
1951 (void)xmlTextWriterSetIndentString(pWriter, BAD_CAST(" "));
1952 (void)xmlTextWriterStartDocument(pWriter, nullptr, nullptr, nullptr);
1953 bOwns = true;
1954 }
1955 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwDoc"));
1956 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", this);
1957
1958 m_pNodes->dumpAsXml(pWriter);
1959 m_PageDescs.dumpAsXml(pWriter);
1960 maDBData.dumpAsXml(pWriter);
1961 mpMarkManager->dumpAsXml(pWriter);
1962 m_pContentControlManager->dumpAsXml(pWriter);
1963 m_pUndoManager->dumpAsXml(pWriter);
1964 m_pDocumentSettingManager->dumpAsXml(pWriter);
1966 mpTextFormatCollTable->dumpAsXml(pWriter);
1967 mpCharFormatTable->dumpAsXml(pWriter);
1968 mpFrameFormatTable->dumpAsXml(pWriter, "frmFormatTable");
1969 mpSpzFrameFormatTable->dumpAsXml(pWriter, "spzFrameFormatTable");
1970 mpSectionFormatTable->dumpAsXml(pWriter);
1971 mpTableFrameFormatTable->dumpAsXml(pWriter, "tableFrameFormatTable");
1972 mpNumRuleTable->dumpAsXml(pWriter);
1975 if (const SdrModel* pModel = getIDocumentDrawModelAccess().GetDrawModel())
1976 pModel->dumpAsXml(pWriter);
1977
1978 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("mbModified"));
1979 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"), BAD_CAST(OString::boolean(getIDocumentState().IsModified()).getStr()));
1980 (void)xmlTextWriterEndElement(pWriter);
1981
1982 (void)xmlTextWriterEndElement(pWriter);
1983 if (bOwns)
1984 {
1985 (void)xmlTextWriterEndDocument(pWriter);
1986 xmlFreeTextWriter(pWriter);
1987 }
1988}
1989
1991{
1992 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwDBData"));
1993
1994 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("sDataSource"), BAD_CAST(sDataSource.toUtf8().getStr()));
1995 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("sCommand"), BAD_CAST(sCommand.toUtf8().getStr()));
1996 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nCommandType"), BAD_CAST(OString::number(nCommandType).getStr()));
1997
1998 (void)xmlTextWriterEndElement(pWriter);
1999}
2000
2001std::set<Color> SwDoc::GetDocColors()
2002{
2003 std::set<Color> aDocColors;
2004 SwAttrPool& rPool = GetAttrPool();
2005 const sal_uInt16 pAttribs[] = {RES_CHRATR_COLOR, RES_CHRATR_HIGHLIGHT, RES_BACKGROUND};
2006 for (sal_uInt16 nAttrib : pAttribs)
2007 {
2008 for (const SfxPoolItem* pItem : rPool.GetItemSurrogates(nAttrib))
2009 {
2010 auto pColorItem = static_cast<const SvxColorItem*>(pItem);
2011 Color aColor( pColorItem->GetValue() );
2012 if (COL_AUTO != aColor)
2013 aDocColors.insert(aColor);
2014 }
2015 }
2016 return aDocColors;
2017}
2018
2019// #i69627#
2020namespace docfunc
2021{
2023 {
2024 // If a parent paragraph style of one of the paragraph styles, which
2025 // are assigned to the list levels of the outline style, has a list style
2026 // set or inherits a list style from its parent style, the outline style
2027 // has to be written as a normal list style to the OpenDocument file
2028 // format or the OpenOffice.org file format.
2029 bool bRet( false );
2030
2031 const SwTextFormatColls* pTextFormatColls( rDoc.GetTextFormatColls() );
2032 if ( pTextFormatColls )
2033 {
2034 for ( auto pTextFormatColl : *pTextFormatColls )
2035 {
2036 if ( pTextFormatColl->IsDefault() ||
2037 ! pTextFormatColl->IsAssignedToListLevelOfOutlineStyle() )
2038 {
2039 continue;
2040 }
2041
2042 const SwTextFormatColl* pParentTextFormatColl =
2043 dynamic_cast<const SwTextFormatColl*>( pTextFormatColl->DerivedFrom());
2044 if ( !pParentTextFormatColl )
2045 continue;
2046
2047 if ( SfxItemState::SET == pParentTextFormatColl->GetItemState( RES_PARATR_NUMRULE ) )
2048 {
2049 // #i106218# consider that the outline style is set
2050 const SwNumRuleItem& rDirectItem = pParentTextFormatColl->GetNumRule();
2051 if ( rDirectItem.GetValue() != rDoc.GetOutlineNumRule()->GetName() )
2052 {
2053 bRet = true;
2054 break;
2055 }
2056 }
2057 }
2058
2059 }
2060 return bRet;
2061 }
2062}
2063
2065 : m_PosIndex( m_Array.get<0>() )
2066 , m_TypeAndNameIndex( m_Array.get<1>() )
2067{
2068}
2069
2071{
2073}
2074
2076{
2077 ByTypeAndName::iterator it = m_TypeAndNameIndex.find(
2078 std::make_tuple(x->GetName(), x->Which(), x) );
2079 return m_Array.project<0>( it );
2080}
2081
2082SwFrameFormats::ByTypeAndName::const_iterator
2083SwFrameFormats::findByTypeAndName( sal_uInt16 type, const OUString& name ) const
2084{
2085 return m_TypeAndNameIndex.find( std::make_tuple(name, type) );
2086}
2087
2088std::pair<SwFrameFormats::ByTypeAndName::const_iterator, SwFrameFormats::ByTypeAndName::const_iterator>
2089SwFrameFormats::findRangeByName( const OUString& rName ) const
2090{
2091 auto it = m_TypeAndNameIndex.lower_bound( std::make_tuple(rName, sal_uInt16(0)) );
2092 auto itEnd = m_TypeAndNameIndex.upper_bound( std::make_tuple(rName, SAL_MAX_UINT16) );
2093 return { it, itEnd };
2094}
2095
2097{
2098 auto it = m_TypeAndNameIndex.lower_bound( std::make_tuple(rName, sal_uInt16(0)) );
2099 if (it != m_TypeAndNameIndex.end() && (*it)->GetName() == rName)
2100 return *it;
2101 return nullptr;
2102}
2103
2105{
2106 if ( empty() )
2107 return;
2108 const int _offset = keepDefault ? 1 : 0;
2109 for( const_iterator it = begin() + _offset; it != end(); ++it )
2110 delete *it;
2111 if ( _offset )
2112 m_PosIndex.erase( begin() + _offset, end() );
2113 else
2114 m_Array.clear();
2115}
2116
2117std::pair<SwFrameFormats::const_iterator,bool> SwFrameFormats::push_back( const value_type& x )
2118{
2119 SAL_WARN_IF(x->m_ffList != nullptr, "sw.core", "Inserting already assigned item");
2120 assert(x->m_ffList == nullptr);
2121 x->m_ffList = this;
2122 return m_PosIndex.push_back( x );
2123}
2124
2126{
2127 const_iterator const ret = find( x );
2128 SAL_WARN_IF(x->m_ffList != this, "sw.core", "Removing invalid / unassigned item");
2129 if (ret != end()) {
2130 assert( x == *ret );
2131 m_PosIndex.erase( ret );
2132 x->m_ffList = nullptr;
2133 return true;
2134 }
2135 return false;
2136}
2137
2139{
2140 erase( begin() + index_ );
2141}
2142
2144{
2145 (*position)->m_ffList = nullptr;
2146 m_PosIndex.erase( begin() + (position - begin()) );
2147}
2148
2150{
2151 return (x.m_ffList == this);
2152}
2153
2155{
2156 return find(const_cast<SwFrameFormat*>(p)) != end();
2157}
2158
2160{
2161 std::pair<iterator,bool> res = m_PosIndex.push_front( x );
2162 if( ! res.second )
2163 newDefault( res.first );
2164 return res.second;
2165}
2166
2168{
2169 if (position == begin())
2170 return;
2171 m_PosIndex.relocate( begin(), position );
2172}
2173
2174/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
struct _xmlTextWriter * xmlTextWriterPtr
@ Ignore
ignore Redlines
SwBreakIt * g_pBreakIt
Definition: breakit.cxx:34
const OUString & GetValue() const
virtual void InsertItemSet(const SwPaM &rRg, const SfxItemSet &, const SetAttrMode nFlags=SetAttrMode::DEFAULT, SwRootFrame const *pLayout=nullptr)=0
virtual SwFieldType * GetSysFieldType(const SwFieldIds eWhich) const =0
virtual const SwFieldTypes * GetFieldTypes() const =0
virtual const SwRootFrame * GetCurrentLayout() const =0
virtual const SwExtraRedlineTable & GetExtraRedlineTable() const =0
virtual void SetRedlineFlags_intern(RedlineFlags eMode)=0
Set a new redline mode.
virtual const SwRedlineTable & GetRedlineTable() const =0
virtual AppendResult AppendRedline(SwRangeRedline *pNewRedl, bool bCallDelete)=0
Append a new redline.
virtual RedlineFlags GetRedlineFlags() const =0
Query the currently set redline mode.
virtual void SetModified()=0
Must be called manually at changes of format.
virtual void AppendUndo(std::unique_ptr< SwUndo > pUndo)=0
Add new Undo action.
virtual void DelAllUndoObj()=0
Delete all Undo actions.
virtual void ClearRedo()=0
Delete all Redo actions.
const SfxPoolItem * GetCurItem() const
const SfxPoolItem * NextItem()
Item2Range GetItemSurrogates(sal_uInt16 nWhich) const
sal_uInt16 GetWhich(sal_uInt16 nSlot, bool bDeep=true) const
SfxItemPool * GetSecondaryPool() const
const SfxPoolItem & GetDefaultItem(sal_uInt16 nWhich) const
sal_uInt16 GetSlotId(sal_uInt16 nWhich) const
void SetPoolDefaultItem(const SfxPoolItem &)
const WhichRangesContainer & GetRanges() const
sal_uInt16 Count() const
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)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
void Differentiate(const SfxItemSet &rSet)
void InvalidateItem(sal_uInt16 nWhich)
T & StaticWhichCast(TypedWhichId< T > nId)
sal_uInt16 Which() const
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const=0
void SetEvalDateFormat(NfEvalDateFormat eEDF)
void SetYear2000(sal_uInt16 nVal)
SvNumberFormatterIndexTable * MergeFormatter(SvNumberFormatter &rNewTable)
void SetTextLeft(const tools::Long nL, const sal_uInt16 nProp=100)
tools::Long GetTextLeft() const
void SetTextFirstLineOffset(const short nF, const sal_uInt16 nProp=100)
tools::Long GetIndentAt() const
tools::Long GetFirstLineIndent() const
SvxNumPositionAndSpaceMode GetPositionAndSpaceMode() const
sal_uInt16 Count() const
void Remove(const sal_uInt16 nPos, const sal_uInt16 nLen=1)
SwAttrPool * GetPool() const
Definition: swatrset.hxx:183
css::uno::Reference< css::i18n::XBreakIterator > const & GetBreakIter() const
Definition: breakit.hxx:62
const css::lang::Locale & GetLocale(const LanguageType aLang)
Definition: breakit.hxx:67
Represents the style of a text portion.
Definition: charfmt.hxx:27
const SwModify * GetRegisteredIn() const
Definition: calbck.hxx:166
const SwFormatCollConditions & GetCondColls() const
Definition: fmtcol.hxx:254
SwFormatColl * GetFormatColl() const
Definition: node.hxx:497
bool HasSwAttrSet() const
Definition: node.hxx:494
SwContentFrame * getLayoutFrame(const SwRootFrame *, const SwPosition *pPos=nullptr, std::pair< Point, bool > const *pViewPosAndCalcFrame=nullptr) const
Definition: node.cxx:1235
virtual bool SetAttr(const SfxPoolItem &)
made virtual
Definition: node.cxx:1606
const SwAttrSet * GetpSwAttrSet() const
Definition: node.hxx:493
virtual SwFormatColl * ChgFormatColl(SwFormatColl *)
Definition: node.cxx:1270
virtual bool ResetAttr(sal_uInt16 nWhich1, sal_uInt16 nWhich2=0)
Definition: node.cxx:1699
virtual sal_uInt16 ResetAllAttr()
Definition: node.cxx:1769
Definition: doc.hxx:194
void CopyPageDesc(const SwPageDesc &rSrcDesc, SwPageDesc &rDstDesc, bool bCopyPoolIds=true)
Copy the complete PageDesc - beyond document and "deep"! Optionally copying of PoolFormatId,...
Definition: docfmt.cxx:1423
void CopyPageDescHeaderFooterImpl(bool bCpyHeader, const SwFrameFormat &rSrcFormat, SwFrameFormat &rDestFormat)
Definition: docfmt.cxx:1367
void RstTextAttrs(const SwPaM &rRg, bool bInclRefToxMark=false, bool bExactRange=false, SwRootFrame const *pLayout=nullptr)
Definition: docfmt.cxx:222
SwTextFormatColl * CopyTextColl(const SwTextFormatColl &rColl)
copy TextNodes
Definition: docfmt.cxx:1175
bool mbIsAutoFormatRedline
Definition: doc.hxx:321
SwPageDesc * FindPageDesc(const OUString &rName, size_t *pPos=nullptr) const
Definition: docdesc.cxx:947
SwFormat * MakeFrameFormat_(const OUString &, SwFormat *, bool, bool)
Definition: docfmt.cxx:845
void CopyFormatArr(const SwFormatsBase &rSourceArr, SwFormatsBase const &rDestArr, FNCopyFormat fnCopyFormat, SwFormat &rDfltFormat)
Definition: docfmt.cxx:1269
std::unique_ptr< SwFrameFormats > mpTableFrameFormatTable
Definition: doc.hxx:250
SwTableBoxFormat * MakeTableBoxFormat()
Definition: docfmt.cxx:1715
SwConditionTextFormatColl * MakeCondTextFormatColl(const OUString &rFormatName, SwTextFormatColl *pDerivedFrom, bool bBroadcast=false)
Definition: docfmt.cxx:922
void EnsureNumberFormatter()
Definition: docfmt.cxx:1731
size_t GetTableFrameFormatCount(bool bUsed) const
Definition: docfmt.cxx:769
const std::unique_ptr< ::SwContentControlManager > m_pContentControlManager
Definition: doc.hxx:218
void DelCharFormat(size_t nFormat, bool bBroadcast=false)
Delete the formats.
Definition: docfmt.cxx:670
std::unique_ptr< SwGrfFormatColl > mpDfltGrfFormatColl
Definition: doc.hxx:244
SwFlyFrameFormat * MakeFlyFrameFormat(const OUString &rFormatName, SwFrameFormat *pDerivedFrom)
Create the formats.
Definition: docfmt.cxx:751
SwFrameFormat * MakeFrameFormat(const OUString &rFormatName, SwFrameFormat *pDerivedFrom, bool bBroadcast=false, bool bAuto=true)
Definition: docfmt.cxx:820
void BroadcastStyleOperation(const OUString &rName, SfxStyleFamily eFamily, SfxHintId nOp)
Definition: docdesc.cxx:723
IDocumentState const & getIDocumentState() const
Definition: doc.cxx:400
SwFormat * MakeTextFormatColl_(const OUString &, SwFormat *, bool, bool)
Definition: docfmt.cxx:912
SwFormat * CopyFormat(const SwFormat &rFormat, const SwFormatsBase &rFormatArr, FNCopyFormat fnCopyFormat, const SwFormat &rDfltFormat)
Copy the formats to itself.
Definition: docfmt.cxx:1124
void SetTextFormatCollByAutoFormat(const SwPosition &rPos, sal_uInt16 nPoolId, const SfxItemSet *pSet)
Definition: docfmt.cxx:1769
const SwCharFormat * GetDfltCharFormat() const
Definition: doc.hxx:761
void ChgFormat(SwFormat &rFormat, const SfxItemSet &rSet)
Definition: docfmt.cxx:1868
std::unique_ptr< SwTextFormatColls > mpTextFormatCollTable
Definition: doc.hxx:251
const std::unique_ptr< ::sw::UndoManager > m_pUndoManager
Definition: doc.hxx:222
o3tl::sorted_vector< SwRootFrame * > GetAllLayouts()
Definition: doclay.cxx:1687
void UpdateRsid(const SwPaM &rRg, sal_Int32 nLen)
Set the rsid of the next nLen symbols of rRg to the current session number.
Definition: docfmt.cxx:405
void dumpAsXml(xmlTextWriterPtr=nullptr) const
Dumps the entire nodes structure to the given destination (file nodes.xml in the current directory by...
Definition: docfmt.cxx:1944
SwTableLineFormat * MakeTableLineFormat()
Definition: docfmt.cxx:1723
SvNumberFormatter * mpNumberFormatter
Definition: doc.hxx:274
SwNumRule * FindNumRulePtr(const OUString &rName) const
Definition: docnum.cxx:2441
SwTableFormat * MakeTableFrameFormat(const OUString &rFormatName, SwFrameFormat *pDerivedFrom)
Definition: docfmt.cxx:810
SwGrfFormatColl * CopyGrfColl(const SwGrfFormatColl &rColl)
copy the graphic nodes
Definition: docfmt.cxx:1243
std::unique_ptr< SwNodes > m_pNodes
Definition: doc.hxx:201
void SetAttr(const SfxPoolItem &, SwFormat &)
Set attribute in given format.1y If Undo is enabled, the old values is added to the Undo history.
Definition: docfmt.cxx:452
void SetDefault(const SfxPoolItem &)
Set attribute as new default attribute in current document.
Definition: docfmt.cxx:540
const SwNumRuleTable & GetNumRuleTable() const
Definition: doc.hxx:1074
void RenameFormat(SwFormat &rFormat, const OUString &sNewName, bool bBroadcast=false)
Definition: docfmt.cxx:1900
std::unique_ptr< SwCharFormats > mpCharFormatTable
Definition: doc.hxx:247
SwNumRule * GetOutlineNumRule() const
Definition: doc.hxx:1032
const SwCharFormats * GetCharFormats() const
Definition: doc.hxx:748
SwDBData maDBData
Definition: doc.hxx:209
SwPageDescs m_PageDescs
Definition: doc.hxx:203
IDocumentContentOperations const & getIDocumentContentOperations() const
Definition: doc.cxx:321
IDocumentUndoRedo & GetIDocumentUndoRedo()
Definition: doc.cxx:150
SwNodes & GetNodes()
Definition: doc.hxx:417
IDocumentFieldsAccess const & getIDocumentFieldsAccess() const
Definition: doc.cxx:363
std::unique_ptr< SwFrameFormats > mpFrameFormatTable
Definition: doc.hxx:246
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
Definition: doc.cxx:341
sal_uInt32 mnRsid
Definition: doc.hxx:304
SwPageDesc * MakePageDesc(const OUString &rName, const SwPageDesc *pCpy=nullptr, bool bRegardLanguage=true, bool bBroadcast=false)
Definition: docdesc.cxx:765
std::unique_ptr< SwFrameFormats > mpSpzFrameFormatTable
Definition: doc.hxx:248
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
Definition: doc.cxx:411
std::unique_ptr< SwTextFormatColl > mpDfltTextFormatColl
Definition: doc.hxx:243
SwCharFormat * CopyCharFormat(const SwCharFormat &)
copy the char format
Definition: docfmt.cxx:1167
SwFrameFormat * CopyFrameFormat(const SwFrameFormat &)
copy the frame format
Definition: docfmt.cxx:1160
const SfxPoolItem & GetDefault(sal_uInt16 nFormatHint) const
Get the default attribute in this document.
Definition: docfmt.cxx:664
const SwTextFormatColls * GetTextFormatColls() const
Definition: doc.hxx:786
IDocumentStylePoolAccess const & getIDocumentStylePoolAccess() const
Definition: doc.cxx:432
::sw::DocumentContentOperationsManager const & GetDocumentContentOperationsManager() const
Definition: doc.cxx:331
void ResetAttrs(const SwPaM &rRg, bool bTextAttr=true, const o3tl::sorted_vector< sal_uInt16 > &rAttrs=o3tl::sorted_vector< sal_uInt16 >(), const bool bSendDataChangedEvents=true, SwRootFrame const *pLayout=nullptr)
Reset attributes.
Definition: docfmt.cxx:243
const std::unique_ptr< ::sw::mark::MarkManager > mpMarkManager
Definition: doc.hxx:216
std::unique_ptr< SwNumRuleTable > mpNumRuleTable
Definition: doc.hxx:276
const SwFrameFormats * GetFrameFormats() const
Definition: doc.hxx:746
bool DontExpandFormat(const SwPosition &rPos, bool bFlag=true)
Definition: docfmt.cxx:1700
SwTextFormatColl * FindTextFormatCollByName(const OUString &rName) const
Definition: doc.hxx:807
SwGrfFormatColl * MakeGrfFormatColl(const OUString &rFormatName, SwGrfFormatColl *pDerivedFrom)
Definition: docfmt.cxx:948
std::unique_ptr< SwSectionFormats > mpSectionFormatTable
Definition: doc.hxx:249
void DelTextFormatColl(size_t nFormat, bool bBroadcast=false)
Definition: docfmt.cxx:959
void DelFrameFormat(SwFrameFormat *pFormat, bool bBroadcast=false)
Definition: docfmt.cxx:697
bool UpdateParRsid(SwTextNode *pTextNode, sal_uInt32 nVal=0)
Definition: docfmt.cxx:436
SwTextFormatColl * MakeTextFormatColl(const OUString &rFormatName, SwTextFormatColl *pDerivedFrom, bool bBroadcast=false)
Create the FormatCollections.
Definition: docfmt.cxx:888
const SwAttrPool & GetAttrPool() const
Definition: doc.hxx:1326
void ResetAttrAtFormat(const sal_uInt16 nWhichId, SwFormat &rChangedFormat)
Definition: docfmt.cxx:495
void DelTableFrameFormat(SwTableFormat *pFormat)
Definition: docfmt.cxx:737
std::unique_ptr< SwCharFormat > mpDfltCharFormat
Definition: doc.hxx:242
IDocumentDrawModelAccess const & getIDocumentDrawModelAccess() const
Definition: doc.cxx:161
std::unique_ptr< SwFrameFormat > mpDfltFrameFormat
Definition: doc.hxx:239
SwCharFormat * MakeCharFormat(const OUString &rFormatName, SwCharFormat *pDerivedFrom, bool bBroadcast=false)
Definition: docfmt.cxx:854
const SwFrameFormat * GetDfltFrameFormat() const
Definition: doc.hxx:755
std::set< Color > GetDocColors()
Definition: docfmt.cxx:2001
SwFormat * MakeCharFormat_(const OUString &, SwFormat *, bool, bool)
Definition: docfmt.cxx:878
const SwFrameFormats * GetSpzFrameFormats() const
Definition: doc.hxx:752
SwFrameFormat & GetTableFrameFormat(size_t nFormat, bool bUsed) const
Definition: docfmt.cxx:786
SwDrawFrameFormat * MakeDrawFrameFormat(const OUString &rFormatName, SwFrameFormat *pDerivedFrom)
Definition: docfmt.cxx:760
const std::unique_ptr< ::sw::DocumentSettingManager > m_pDocumentSettingManager
Definition: doc.hxx:223
void ReplaceStyles(const SwDoc &rSource, bool bIncludePageStyles=true)
Definition: docfmt.cxx:1555
bool SetTextFormatColl(const SwPaM &rRg, SwTextFormatColl *pFormat, const bool bReset=true, const bool bResetListAttrs=false, SwRootFrame const *pLayout=nullptr)
Add 4th optional parameter <bResetListAttrs>.
Definition: docfmt.cxx:1083
void CopyFooter(const SwFrameFormat &rSrcFormat, SwFrameFormat &rDestFormat)
Copy footer (with contents) from SrcFormat to DestFormat.
Definition: doc.hxx:907
SvNumberFormatter * GetNumberFormatter(bool bCreate=true)
Definition: doc.hxx:1418
::sw::UndoManager & GetUndoManager()
Definition: doc.cxx:139
void CopyHeader(const SwFrameFormat &rSrcFormat, SwFrameFormat &rDestFormat)
Copy header (with contents) from SrcFormat to DestFormat (can also be copied into other document).
Definition: doc.hxx:902
void SetFormatItemByAutoFormat(const SwPaM &rPam, const SfxItemSet &)
Definition: docfmt.cxx:1817
sal_uInt16 MakeNumRule(const OUString &rName, const SwNumRule *pCpy=nullptr, bool bBroadcast=false, const SvxNumberFormat::SvxNumPositionAndSpaceMode eDefaultNumberFormatPositionAndSpaceMode=SvxNumberFormat::LABEL_WIDTH_AND_POSITION)
Definition: docnum.cxx:2475
SwFrameFormat * FindFrameFormatByName(const OUString &rName) const
Definition: docfmt.cxx:745
std::unique_ptr< SwGrfFormatColls > mpGrfFormatCollTable
Definition: doc.hxx:252
void MoveLeftMargin(const SwPaM &rPam, bool bRight, bool bModulus, SwRootFrame const *pLayout=nullptr)
Adjust left margin via object bar (similar to adjustment of numerations).
Definition: docfmt.cxx:1636
void dumpAsXml(xmlTextWriterPtr pWriter) const
Definition: docredln.cxx:95
void dumpAsXml(xmlTextWriterPtr pWriter) const
Definition: fldbas.cxx:218
Content, content of frame (header, footer, fly).
Definition: fmtcntnt.hxx:32
const OUString & GetValue() const
Definition: fmtinfmt.hxx:75
Pagedescriptor Client of SwPageDesc that is "described" by the attribute.
Definition: fmtpdsc.hxx:36
void RegisterToPageDesc(SwPageDesc &)
Definition: atrfrm.cxx:714
SwPageDesc * GetPageDesc()
Definition: fmtpdsc.hxx:61
Base class for various Writer styles.
Definition: format.hxx:47
bool IsDefault() const
Definition: format.hxx:129
const SwDoc * GetDoc() const
The document is set in SwAttrPool now, therefore you always can access it.
Definition: format.hxx:139
sal_uInt16 GetPoolFormatId() const
Get and set Pool style IDs.
Definition: format.hxx:163
void SetPoolHelpId(sal_uInt16 nId)
Definition: format.hxx:168
void SetPoolFormatId(sal_uInt16 nId)
Definition: format.hxx:164
virtual bool ResetFormatAttr(sal_uInt16 nWhich1, sal_uInt16 nWhich2=0)
Definition: format.cxx:618
virtual void SetFormatName(const OUString &rNewName, bool bBroadcast=false)
Definition: format.cxx:145
const SwFormatFooter & GetFooter(bool=true) const
Definition: fmthdft.hxx:99
sal_uInt16 Which() const
for Querying of Writer-functions.
Definition: format.hxx:82
const OUString & GetName() const
Definition: format.hxx:131
sal_uInt16 GetPoolHelpId() const
Get and set Help-IDs for document templates.
Definition: format.hxx:167
void SetAuto(bool bNew)
Definition: format.hxx:179
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
Definition: format.cxx:385
const SwFormatHeader & GetHeader(bool=true) const
Definition: fmthdft.hxx:97
const SwNumRuleItem & GetNumRule(bool=true) const
Definition: paratr.hxx:232
void SetPoolHlpFileId(sal_uInt8 nId)
Definition: format.hxx:170
const SwAttrSet & GetAttrSet() const
For querying the attribute array.
Definition: format.hxx:136
bool SetDerivedFrom(SwFormat *pDerivedFrom=nullptr)
0 is Default.
Definition: format.cxx:318
SwFormat * DerivedFrom() const
Definition: format.hxx:128
void CopyAttrs(const SwFormat &)
Copy attributes even among documents.
Definition: format.cxx:171
virtual bool SetFormatAttr(const SfxPoolItem &rAttr)
Definition: format.cxx:447
bool IsAuto() const
Query / set AutoFormat-flag.
Definition: format.hxx:178
void DelDiffs(const SfxItemSet &rSet)
Delete all attributes that are not in rFormat.
Definition: format.cxx:666
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
Templatized version of GetItemState() to directly return the correct type.
Definition: format.hxx:111
provides some methods for generic operations on lists that contain SwFormat* subclasses.
Definition: docary.hxx:44
virtual SwFormat * GetFormat(size_t idx) const =0
virtual SwFormat * FindFormatByName(const OUString &rName) const
Definition: format.cxx:766
virtual size_t GetFormatCount() const =0
Style of a layout element.
Definition: frmfmt.hxx:62
virtual void SetFormatName(const OUString &rNewName, bool bBroadcast=false) override
Definition: atrfrm.cxx:2567
const_iterator find(const value_type &x) const
Definition: docfmt.cxx:2075
ByPos::const_iterator const_iterator
bool empty() const
std::pair< ByTypeAndName::const_iterator, ByTypeAndName::const_iterator > findRangeByName(const OUString &name) const
Definition: docfmt.cxx:2089
SwFrameFormatsBase m_Array
virtual SwFrameFormat * FindFormatByName(const OUString &rName) const override
Definition: docfmt.cxx:2096
bool ContainsFormat(SwFrameFormat const &rFormat) const
fast check if given format is contained here @precond pFormat must not have been deleted
Definition: docfmt.cxx:2149
SwFrameFormatsBase::size_type size_type
bool IsAlive(SwFrameFormat const *) const
not so fast check that given format is still alive (i.e. contained here)
Definition: docfmt.cxx:2154
ByTypeAndName::const_iterator findByTypeAndName(sal_uInt16 type, const OUString &name) const
Definition: docfmt.cxx:2083
bool erase(const value_type &x)
Definition: docfmt.cxx:2125
bool newDefault(const value_type &x)
Definition: docfmt.cxx:2159
void DeleteAndDestroyAll(bool keepDefault=false)
Definition: docfmt.cxx:2104
SwFrameFormatsBase::value_type value_type
const_iterator begin() const
ByTypeAndName & m_TypeAndNameIndex
virtual ~SwFrameFormats() override
Definition: docfmt.cxx:2070
const_iterator end() const
std::pair< const_iterator, bool > push_back(const value_type &x)
Definition: docfmt.cxx:2117
ByPos & m_PosIndex
Get reference.
Definition: reffld.hxx:66
void Add(const SfxPoolItem *pOldValue, const SfxPoolItem *pNewValue, SwNodeOffset nNodeIdx)
Definition: rolbck.cxx:1028
TElementType * Next()
Definition: calbck.hxx:371
TElementType * First()
Definition: calbck.hxx:363
void LockModify()
Definition: calbck.hxx:210
bool IsModifyLocked() const
Definition: calbck.hxx:212
void UnlockModify()
Definition: calbck.hxx:211
void Add(SwClient *pDepend)
Definition: calbck.cxx:172
SwClient * Remove(SwClient *pDepend)
Definition: calbck.cxx:225
bool HasWriterListeners() const
Definition: calbck.hxx:204
Marks a node in the document model.
Definition: ndindex.hxx:31
SwNode & GetNode() const
Definition: ndindex.hxx:136
SwNodeIndex aStart
Definition: ndindex.hxx:149
SwNodeIndex aEnd
Definition: ndindex.hxx:150
Base class of the Writer document model elements.
Definition: node.hxx:98
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
Definition: ndtxt.hxx:897
SwNodeOffset GetIndex() const
Definition: node.hxx:312
SwDoc & GetDoc()
Definition: node.hxx:233
bool IsTextNode() const
Definition: node.hxx:685
Merge GetRedlineMergeFlag() const
Definition: node.hxx:116
SwContentNode * GetContentNode()
Definition: node.hxx:664
const SwEndNode * EndOfSectionNode() const
Definition: node.hxx:731
void ForEach(FnForEach_SwNodes fnForEach, void *pArgs=nullptr)
Definition: ndarr.hxx:143
static SwStartNode * MakeEmptySection(SwNode &rWhere, SwStartNodeType=SwNormalStartNode)
Create an empty section of Start- and EndNote.
Definition: nodes.cxx:1918
void Copy_(const SwNodeRange &rRg, SwNode &rInsPos, bool bNewFrames=true) const
Definition: ndarr.hxx:179
bool IsAutoRule() const
Definition: numrule.hxx:229
const SwNumFormat & Get(sal_uInt16 i) const
Definition: number.cxx:87
void SetInvalidRule(bool bFlag)
Definition: number.cxx:958
const OUString & GetName() const
Definition: numrule.hxx:224
SwNumRule & CopyNumRule(SwDoc &, const SwNumRule &)
A kind of copy-constructor to make sure the num formats are attached to the correctCharFormats of a d...
Definition: number.cxx:901
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:187
const SwPosition * GetMark() const
Definition: pam.hxx:263
virtual void SetMark()
Unless this is called, the getter method of Mark will return Point.
Definition: pam.cxx:642
std::pair< const SwPosition *, const SwPosition * > StartEnd() const
Because sometimes the cost of the operator<= can add up.
Definition: pam.hxx:277
const SwPosition * End() const
Definition: pam.hxx:271
const SwPosition * GetPoint() const
Definition: pam.hxx:261
const SwPosition * Start() const
Definition: pam.hxx:266
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
Definition: pam.hxx:259
sal_uInt16 GetPoolFormatId() const
Query and set PoolFormat-Id.
Definition: pagedesc.hxx:275
sal_uInt16 GetPoolHelpId() const
Definition: pagedesc.hxx:277
void StashFrameFormat(const SwFrameFormat &rFormat, bool bHeader, bool bLeft, bool bFirst)
Remember original header/footer formats even when they are hidden by "sharing".
Definition: pagedesc.cxx:409
const OUString & GetName() const
Definition: pagedesc.hxx:196
void SetPoolHlpFileId(sal_uInt8 const nId)
Definition: pagedesc.hxx:280
void SetFollow(const SwPageDesc *pNew)
Definition: pagedesc.hxx:314
SwFrameFormat & GetMaster()
Definition: pagedesc.hxx:238
bool IsHeaderShared() const
Definition: pagedesc.hxx:319
const SvxNumberType & GetNumType() const
Definition: pagedesc.hxx:202
bool IsFirstShared() const
Definition: pagedesc.cxx:396
bool IsFooterShared() const
Definition: pagedesc.hxx:323
SwFrameFormat & GetFirstLeft()
Definition: pagedesc.hxx:241
SwFrameFormat & GetFirstMaster()
Definition: pagedesc.hxx:240
void SetPoolFormatId(sal_uInt16 const nId)
Definition: pagedesc.hxx:276
void SetPoolHelpId(sal_uInt16 const nId)
Definition: pagedesc.hxx:278
bool GetLandscape() const
Definition: pagedesc.hxx:199
void SetNumType(const SvxNumberType &rNew)
Definition: pagedesc.hxx:203
void SetFootnoteInfo(const SwPageFootnoteInfo &rNew)
Definition: pagedesc.hxx:207
SwFrameFormat & GetLeft()
Definition: pagedesc.hxx:239
const SwPageDesc * GetFollow() const
Definition: pagedesc.hxx:267
void WriteUseOn(UseOnPage const eNew)
Definition: pagedesc.hxx:235
const SwPageFootnoteInfo & GetFootnoteInfo() const
Definition: pagedesc.hxx:205
UseOnPage ReadUseOn() const
Definition: pagedesc.hxx:236
void SetLandscape(bool bNew)
Definition: pagedesc.hxx:200
const SwFrameFormat * GetStashedFrameFormat(bool bHeader, bool bLeft, bool bFirst) const
Used to restore hidden header/footer formats.
Definition: pagedesc.cxx:445
SwPageDescsBase::size_type size_type
Definition: pagedesc.hxx:432
size_t size() const
Definition: pagedesc.hxx:442
void dumpAsXml(xmlTextWriterPtr pWriter) const
Definition: pagedesc.cxx:791
void SetExtraData(const SwRedlineExtraData *pData)
ExtraData gets copied, the pointer is therefore not taken over by the RedLineObject.
Definition: redline.hxx:223
void SetItemSet(const SfxItemSet &rSet)
Definition: docredln.cxx:947
void dumpAsXml(xmlTextWriterPtr pWriter) const
Definition: docredln.cxx:849
The root element of a Writer document layout.
Definition: rootfrm.hxx:82
bool HasMergedParas() const
Definition: rootfrm.hxx:425
Starts a section of nodes in the document model.
Definition: node.hxx:348
SwTableNumFormatMerge(const SwDoc &rSrc, SwDoc &rDest)
Definition: docfmt.cxx:1744
SvNumberFormatter * pNFormat
Definition: mvsave.hxx:182
A wrapper around SfxPoolItem to store the start position of (usually) a text portion,...
Definition: txatbase.hxx:44
const sal_Int32 * End() const
Definition: txatbase.hxx:156
sal_Int32 GetStart() const
Definition: txatbase.hxx:88
const SwFormatINetFormat & GetINetFormat() const
Definition: txatbase.hxx:244
static bool changeAnchor(SwFrameFormat *pShape, SdrObject *pObj)
Sets the anchor of the associated textframe of the given shape, and returns true on success.
static void syncFlyFrameAttr(SwFrameFormat &rShape, SfxItemSet const &rSet, SdrObject *pObj)
Similar to syncProperty(), but used by the internal API (e.g. for UI purposes).
static bool isTextBox(const SwFrameFormat *pFormat, sal_uInt16 nType, const SdrObject *pObject=nullptr)
Is the frame format a text box?
Represents the style of a paragraph.
Definition: fmtcol.hxx:59
bool IsAssignedToListLevelOfOutlineStyle() const
Definition: fmtcol.hxx:120
SwTextFormatColl & GetNextTextFormatColl() const
Definition: fmtcol.hxx:104
void AssignToListLevelOfOutlineStyle(const int nAssignedListLevel)
Definition: fmtcol.cxx:624
void SetNextTextFormatColl(SwTextFormatColl &rNext)
Inline implementations.
Definition: fmtcol.hxx:263
int GetAssignedOutlineStyleLevel() const
Definition: fmtcol.cxx:617
Represents the visualization of a paragraph.
Definition: txtfrm.hxx:165
SwTextNode const * GetTextNodeForParaProps() const
Definition: txtfrm.cxx:1303
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:111
bool GetParaAttr(SfxItemSet &rSet, sal_Int32 nStt, sal_Int32 nEnd, const bool bOnlyTextAttr=false, const bool bGetFromChrFormat=true, const bool bMergeIndentValuesOfNumRule=false, SwRootFrame const *pLayout=nullptr) const
Query the attributes of textnode over the range.
Definition: thints.cxx:2133
void FormatToTextAttr(SwTextNode *pNd)
Convey attributes of an AttrSet (AutoFormat) to SwpHintsArray.
Definition: thints.cxx:2532
virtual bool SetAttr(const SfxPoolItem &) override
overriding to handle change of certain paragraph attributes
Definition: ndtxt.cxx:5032
SwNumRule * GetNumRule(bool bInParent=true) const
Returns numbering rule of this text node.
Definition: ndtxt.cxx:2907
int GetActualListLevel(SwListRedlineType eRedline=SwListRedlineType::SHOW) const
Returns the actual list level of this text node, when it is a list item.
Definition: ndtxt.cxx:4228
SwTextAttr * GetTextAttrAt(sal_Int32 const nIndex, sal_uInt16 const nWhich, ::sw::GetTextAttrMode const eMode=::sw::GetTextAttrMode::Default) const
get the innermost text attribute covering position nIndex.
Definition: ndtxt.cxx:1790
bool AreListLevelIndentsApplicable() const
Determines, if the list level indent attributes can be applied to the paragraph.
Definition: ndtxt.cxx:4594
const OUString & GetText() const
Definition: ndtxt.hxx:242
LanguageType GetLang(const sal_Int32 nBegin, const sal_Int32 nLen=0, sal_uInt16 nScript=0) const
Definition: thints.cxx:3462
bool DontExpandFormat(sal_Int32 nContentIdx, bool bFlag=true, bool bFormatToTextAttributes=true)
When appropriate set DontExpand-flag at INet or character styles respectively.
Definition: ndtxt.cxx:1667
SwTextFormatColl * GetTextColl() const
Definition: ndtxt.hxx:891
SwUndoFormatAttr * GetUndo() const
std::unique_ptr< SwUndoFormatAttr > ReleaseUndo()
Typing one or more characters to a single paragraph.
Definition: UndoInsert.hxx:43
void SetWithRsid()
Definition: UndoInsert.hxx:90
std::vector< SwTextFormatColl * >::const_iterator const_iterator
Definition: docary.hxx:65
std::vector< SwNumRule * >::size_type size_type
Definition: docary.hxx:66
size_t size() const
Definition: docary.hxx:87
const_reverse_iterator rend() const
const_iterator begin() const
const_reverse_iterator rbegin() const
bool empty() const
virtual void CallSwClientNotify(const SfxHint &rHint) const override
Definition: calbck.cxx:325
static bool lcl_RstTextAttr(SwNode *pNd, void *pArgs)
@params pArgs contains the document's ChrFormatTable Is need for selections at the beginning/end and ...
void CopyFlyInFlyImpl(const SwNodeRange &rRg, SwPaM const *const pCopiedPaM, SwNode &rStartIdx, const bool bCopyFlyAtFly=false, SwCopyFlags flags=SwCopyFlags::Default) const
bool UndoWasEnabled() const
SwUndo * GetLastUndo()
Definition: docundo.cxx:239
static bool IsFuzzing()
constexpr ::Color COL_AUTO(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
int nCount
static void SetTextFormatCollNext(SwTextFormatColl *pTextColl, const SwTextFormatColl *pDel)
Definition: docfmt.cxx:90
static bool lcl_RstAttr(SwNode *pNd, void *pArgs)
Definition: docfmt.cxx:98
static bool lcl_SetTextFormatColl(SwNode *pNode, void *pArgs)
Definition: docfmt.cxx:1003
static bool lcl_SetNewDefTabStops(SwTwips nOldWidth, SwTwips nNewWidth, SvxTabStopItem &rChgTabStop)
Definition: docfmt.cxx:515
float x
constexpr TypedWhichId< SwFormatHeader > RES_HEADER(96)
constexpr TypedWhichId< SvxFormatBreakItem > RES_BREAK(94)
constexpr TypedWhichId< SfxStringItem > RES_PARATR_LIST_ID(RES_PARATR_LIST_BEGIN)
bool isTXTATR(const sal_uInt16 nWhich)
Definition: hintids.hxx:481
bool isCHRATR(const sal_uInt16 nWhich)
Definition: hintids.hxx:469
constexpr sal_uInt16 RES_FRMATR_END(133)
constexpr sal_uInt16 RES_CHRATR_END(46)
bool isPARATR_LIST(const sal_uInt16 nWhich)
Definition: hintids.hxx:489
constexpr sal_uInt16 RES_PARATR_BEGIN(RES_TXTATR_END)
bool isDrawingLayerAttribute(const sal_uInt16 nWhich)
Definition: hintids.hxx:497
constexpr TypedWhichId< SfxInt16Item > RES_PARATR_LIST_LEVEL(83)
constexpr TypedWhichId< SwFrameFormat > RES_FRMFMT(155)
constexpr TypedWhichId< SfxInt16Item > RES_PARATR_LIST_RESTARTVALUE(85)
constexpr TypedWhichId< SwFormatINetFormat > RES_TXTATR_INETFMT(51)
constexpr TypedWhichId< SvxBrushItem > RES_CHRATR_HIGHLIGHT(42)
constexpr TypedWhichId< SwFormatPageDesc > RES_PAGEDESC(93)
constexpr TypedWhichId< SvxAdjustItem > RES_PARATR_ADJUST(64)
constexpr TypedWhichId< SvxTabStopItem > RES_PARATR_TABSTOP(68)
constexpr TypedWhichId< SwFormatFooter > RES_FOOTER(97)
constexpr TypedWhichId< SwFormatContent > RES_CNTNT(95)
constexpr TypedWhichId< SwDrawFrameFormat > RES_DRAWFRMFMT(159)
constexpr sal_uInt16 RES_CHRATR_BEGIN(HINT_BEGIN)
constexpr sal_uInt16 RES_PARATR_LIST_BEGIN(RES_PARATR_END)
constexpr TypedWhichId< SwCharFormat > RES_CHRFMT(RES_FMT_BEGIN)
constexpr TypedWhichId< SwNumRuleItem > RES_PARATR_NUMRULE(72)
constexpr sal_uInt16 RES_UNKNOWNATR_BEGIN(RES_BOXATR_END)
constexpr TypedWhichId< SwTextFormatColl > RES_TXTFMTCOLL(157)
constexpr sal_uInt16 RES_UNKNOWNATR_END(154)
constexpr TypedWhichId< SvxRsidItem > RES_CHRATR_RSID(39)
constexpr sal_uInt16 RES_PARATR_LIST_END(88)
bool isFRMATR(const sal_uInt16 nWhich)
Definition: hintids.hxx:493
bool isBOXATR(const sal_uInt16 nWhich)
Definition: hintids.hxx:505
constexpr TypedWhichId< SvXMLAttrContainerItem > RES_TXTATR_UNKNOWN_CONTAINER(54)
constexpr TypedWhichId< SfxBoolItem > RES_PARATR_LIST_ISCOUNTED(86)
constexpr TypedWhichId< SwConditionTextFormatColl > RES_CONDTXTFMTCOLL(160)
constexpr TypedWhichId< SfxBoolItem > RES_PARATR_LIST_ISRESTART(84)
constexpr TypedWhichId< SvxLRSpaceItem > RES_LR_SPACE(91)
constexpr TypedWhichId< SvxRsidItem > RES_PARATR_RSID(80)
bool isPARATR(const sal_uInt16 nWhich)
Definition: hintids.hxx:485
constexpr TypedWhichId< SvxColorItem > RES_CHRATR_COLOR(3)
constexpr sal_uInt16 RES_TXTATR_END(RES_TXTATR_NOEND_END)
constexpr sal_uInt16 POOLATTR_END(RES_UNKNOWNATR_END)
constexpr TypedWhichId< SvxBrushItem > RES_BACKGROUND(105)
bool isGRFATR(const sal_uInt16 nWhich)
Definition: hintids.hxx:501
const SfxPoolItem * GetDfltAttr(sal_uInt16 nWhich)
Get the default attribute from corresponding default attribute table.
Definition: hints.cxx:159
const char * name
void * p
sal_Int64 n
#define LANGUAGE_SYSTEM
sal_uInt32 index_
#define SAL_WARN_IF(condition, area, stream)
#define SAL_WARN(area, stream)
def position(n=-1)
Reference< XComponentContext > getProcessComponentContext()
bool HasOutlineStyleToBeWrittenAsNormalListStyle(SwDoc &rDoc)
method to check, if the outline style has to written as a normal list style
Definition: docfmt.cxx:2022
int i
index
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
std::pair< SwTextNode *, SwTextNode * > GetFirstAndLastNode(SwRootFrame const &rLayout, SwNode const &rPos)
Definition: txtfrm.cxx:354
void CopyBookmarks(const SwPaM &rPam, const SwPosition &rCpyPam)
SwTextNode * GetParaPropsNode(SwRootFrame const &rLayout, SwNode const &rNode)
Definition: txtfrm.cxx:330
long Long
@ SwHeaderStartNode
Definition: ndtyp.hxx:56
@ SwFooterStartNode
Definition: ndtyp.hxx:57
o3tl::strong_int< sal_Int32, struct Tag_SwNodeOffset > SwNodeOffset
Definition: nodeoffset.hxx:16
static SfxItemSet & rSet
sal_Int32 nCommandType
Definition: swdbdata.hxx:32
OUString sDataSource
Definition: swdbdata.hxx:30
void dumpAsXml(xmlTextWriterPtr pWriter) const
Definition: docfmt.cxx:1990
OUString sCommand
Definition: swdbdata.hxx:31
Marks a position in the document model.
Definition: pam.hxx:37
SwNode & GetNode() const
Definition: pam.hxx:80
void SetContent(sal_Int32 nContentIndex)
Set content index, only valid to call this if the position points to a SwContentNode subclass.
Definition: pam.cxx:266
sal_Int32 GetContentIndex() const
Definition: pam.hxx:84
bool bExactRange
From the attributes included in the range, delete only the ones which have exactly same range....
SfxStyleFamily
#define SW_MOD()
Definition: swmodule.hxx:256
tools::Long SwTwips
Definition: swtypes.hxx:51
#define SAL_MAX_UINT16
ResultType type
std::pair< sal_uInt16, sal_uInt16 > WhichPair
NF_EVALDATEFORMAT_FORMAT_INTL