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>
79#include <memory>
80
81using namespace ::com::sun::star::i18n;
82using namespace ::com::sun::star::lang;
83using namespace ::com::sun::star::uno;
84
85/*
86 * Internal functions
87 */
88
89static void SetTextFormatCollNext( SwTextFormatColl* pTextColl, const SwTextFormatColl* pDel )
90{
91 if ( &pTextColl->GetNextTextFormatColl() == pDel )
92 {
93 pTextColl->SetNextTextFormatColl( *pTextColl );
94 }
95}
96
97static bool lcl_RstAttr( SwNode* pNd, void* pArgs )
98{
100 SwContentNode* pNode = pNd->GetContentNode();
101 if (pPara && pPara->pLayout && pPara->pLayout->HasMergedParas()
102 && pNode && pNode->GetRedlineMergeFlag() == SwNode::Merge::Hidden)
103 {
104 return true;
105 }
106 if( pNode && pNode->HasSwAttrSet() )
107 {
108 const bool bLocked = pNode->IsModifyLocked();
109 pNode->LockModify();
110
111 SwDoc& rDoc = pNode->GetDoc();
112
113 // remove unused attribute RES_LR_SPACE
114 // add list attributes
118 RES_PAGEDESC, RES_BREAK> aSavedAttrsSet(rDoc.GetAttrPool());
119 const SfxItemSet* pAttrSetOfNode = pNode->GetpSwAttrSet();
120
121 std::vector<sal_uInt16> aClearWhichIds;
122 // restoring all paragraph list attributes
123 {
125 aListAttrSet.Set(*pAttrSetOfNode);
126 if ( aListAttrSet.Count() )
127 {
128 aSavedAttrsSet.Put(aListAttrSet);
129 SfxItemIter aIter( aListAttrSet );
130 const SfxPoolItem* pItem = aIter.GetCurItem();
131 while( pItem )
132 {
133 aClearWhichIds.push_back( pItem->Which() );
134 pItem = aIter.NextItem();
135 }
136 }
137 }
138
139 const SfxPoolItem* pItem;
140
141 sal_uInt16 const aSavIds[3] = { RES_PAGEDESC, RES_BREAK, RES_PARATR_NUMRULE };
142 for (sal_uInt16 aSavId : aSavIds)
143 {
144 if (SfxItemState::SET == pAttrSetOfNode->GetItemState(aSavId, false, &pItem))
145 {
146 bool bSave = false;
147 switch( aSavId )
148 {
149 case RES_PAGEDESC:
150 bSave = nullptr != pItem->StaticWhichCast(RES_PAGEDESC).GetPageDesc();
151 break;
152 case RES_BREAK:
153 bSave = SvxBreak::NONE != pItem->StaticWhichCast(RES_BREAK).GetBreak();
154 break;
156 bSave = !pItem->StaticWhichCast(RES_PARATR_NUMRULE).GetValue().isEmpty();
157 break;
158 }
159 if( bSave )
160 {
161 aSavedAttrsSet.Put(*pItem);
162 aClearWhichIds.push_back(aSavId);
163 }
164 }
165 }
166
167 // do not clear items directly from item set and only clear to be kept
168 // attributes, if no deletion item set is found.
169 const bool bKeepAttributes =
170 !pPara || !pPara->pDelSet || pPara->pDelSet->Count() == 0;
171 if ( bKeepAttributes )
172 {
173 pNode->ResetAttr( aClearWhichIds );
174 }
175
176 if( !bLocked )
177 pNode->UnlockModify();
178
179 if( pPara )
180 {
181 SwRegHistory aRegH( pNode, *pNode, pPara->pHistory );
182
183 if( pPara->pDelSet && pPara->pDelSet->Count() )
184 {
185 OSL_ENSURE( !bKeepAttributes,
186 "<lcl_RstAttr(..)> - certain attributes are kept, but not needed." );
187 SfxItemIter aIter( *pPara->pDelSet );
188 for (pItem = aIter.GetCurItem(); pItem; pItem = aIter.NextItem())
189 {
190 if ( ( pItem->Which() != RES_PAGEDESC &&
191 pItem->Which() != RES_BREAK &&
192 pItem->Which() != RES_PARATR_NUMRULE ) ||
193 ( aSavedAttrsSet.GetItemState( pItem->Which(), false ) != SfxItemState::SET ) )
194 {
195 pNode->ResetAttr( pItem->Which() );
196 }
197 }
198 }
199 else if( pPara->bResetAll )
200 pNode->ResetAllAttr();
201 else
203 }
204 else
205 pNode->ResetAllAttr();
206
207 // only restore saved attributes, if needed
208 if (bKeepAttributes && aSavedAttrsSet.Count())
209 {
210 pNode->LockModify();
211
212 pNode->SetAttr(aSavedAttrsSet);
213
214 if( !bLocked )
215 pNode->UnlockModify();
216 }
217 }
218 return true;
219}
220
221void SwDoc::RstTextAttrs(const SwPaM &rRg, bool bInclRefToxMark,
222 bool bExactRange, SwRootFrame const*const pLayout)
223{
224 SwHistory* pHst = nullptr;
225 SwDataChanged aTmp( rRg );
226 if (GetIDocumentUndoRedo().DoesUndo())
227 {
228 std::unique_ptr<SwUndoResetAttr> pUndo(new SwUndoResetAttr( rRg, RES_CHRFMT ));
229 pHst = &pUndo->GetHistory();
230 GetIDocumentUndoRedo().AppendUndo(std::move(pUndo));
231 }
232 const SwPosition *pStt = rRg.Start(), *pEnd = rRg.End();
234 pStt, pEnd, pHst, nullptr, pLayout );
235 aPara.bInclRefToxMark = bInclRefToxMark;
236 aPara.bExactRange = bExactRange;
237 GetNodes().ForEach( pStt->nNode.GetIndex(), pEnd->nNode.GetIndex()+1,
240}
241
242void SwDoc::ResetAttrs( const SwPaM &rRg,
243 bool bTextAttr,
245 const bool bSendDataChangedEvents,
246 SwRootFrame const*const pLayout)
247{
248 SwPaM* pPam = const_cast<SwPaM*>(&rRg);
249 if( !bTextAttr && !rAttrs.empty() && RES_TXTATR_END > *(rAttrs.begin()) )
250 bTextAttr = true;
251
252 if( !rRg.HasMark() )
253 {
254 SwTextNode* pTextNd = rRg.GetPoint()->nNode.GetNode().GetTextNode();
255 if( !pTextNd )
256 return ;
257
258 pPam = new SwPaM( *rRg.GetPoint() );
259
260 SwIndex& rSt = pPam->GetPoint()->nContent;
261 sal_Int32 nMkPos, nPtPos = rSt.GetIndex();
262
263 // Special case: if the Cursor is located within a URL attribute, we take over it's area
264 SwTextAttr const*const pURLAttr(
265 pTextNd->GetTextAttrAt(rSt.GetIndex(), RES_TXTATR_INETFMT));
266 if (pURLAttr && !pURLAttr->GetINetFormat().GetValue().isEmpty())
267 {
268 nMkPos = pURLAttr->GetStart();
269 nPtPos = *pURLAttr->End();
270 }
271 else
272 {
273 assert(g_pBreakIt && g_pBreakIt->GetBreakIter().is());
274 Boundary aBndry = g_pBreakIt->GetBreakIter()->getWordBoundary(
275 pTextNd->GetText(), nPtPos,
276 g_pBreakIt->GetLocale( pTextNd->GetLang( nPtPos ) ),
277 WordType::ANY_WORD /*ANYWORD_IGNOREWHITESPACES*/,
278 true);
279
280 if( aBndry.startPos < nPtPos && nPtPos < aBndry.endPos )
281 {
282 nMkPos = aBndry.startPos;
283 nPtPos = aBndry.endPos;
284 }
285 else
286 {
287 nPtPos = nMkPos = rSt.GetIndex();
288 if( bTextAttr )
289 pTextNd->DontExpandFormat( rSt );
290 }
291 }
292
293 rSt = nMkPos;
294 pPam->SetMark();
295 pPam->GetPoint()->nContent = nPtPos;
296 }
297
298 // #i96644#
299 std::optional< SwDataChanged > oDataChanged;
300 if ( bSendDataChangedEvents )
301 {
302 oDataChanged.emplace( *pPam );
303 }
304 SwHistory* pHst = nullptr;
305 if (GetIDocumentUndoRedo().DoesUndo())
306 {
307 std::unique_ptr<SwUndoResetAttr> pUndo(new SwUndoResetAttr( rRg,
308 bTextAttr ? sal_uInt16(RES_CONDTXTFMTCOLL) : sal_uInt16(RES_TXTFMTCOLL) ));
309 if( !rAttrs.empty() )
310 {
311 pUndo->SetAttrs( o3tl::sorted_vector(rAttrs) );
312 }
313 pHst = &pUndo->GetHistory();
314 GetIDocumentUndoRedo().AppendUndo(std::move(pUndo));
315 }
316
317 const SwPosition *pStt = pPam->Start(), *pEnd = pPam->End();
319 pStt, pEnd, pHst, nullptr, pLayout);
320
321 // mst: not including META here; it seems attrs with CH_TXTATR are omitted
326 aDelSet(GetAttrPool());
327 for( auto it = rAttrs.rbegin(); it != rAttrs.rend(); ++it )
328 {
329 if( POOLATTR_END > *it )
330 aDelSet.Put( *GetDfltAttr( *it ));
331 }
332 if( aDelSet.Count() )
333 aPara.pDelSet = &aDelSet;
334
335 bool bAdd = true;
336 SwNodeIndex aTmpStt( pStt->nNode );
337 SwNodeIndex aTmpEnd( pEnd->nNode );
338 if( pStt->nContent.GetIndex() ) // just one part
339 {
340 // set up a later, and all CharFormatAttr -> TextFormatAttr
341 SwTextNode* pTNd = aTmpStt.GetNode().GetTextNode();
342 if( pTNd && pTNd->HasSwAttrSet() && pTNd->GetpSwAttrSet()->Count() )
343 {
344 if (pHst)
345 {
346 SwRegHistory history(pTNd, *pTNd, pHst);
347 pTNd->FormatToTextAttr(pTNd);
348 }
349 else
350 {
351 pTNd->FormatToTextAttr(pTNd);
352 }
353 }
354
355 ++aTmpStt;
356 }
357 if( pEnd->nContent.GetIndex() == pEnd->nNode.GetNode().GetContentNode()->Len() )
358 {
359 // set up a later, and all CharFormatAttr -> TextFormatAttr
360 ++aTmpEnd;
361 bAdd = false;
362 }
363 else if( pStt->nNode != pEnd->nNode || !pStt->nContent.GetIndex() )
364 {
365 SwTextNode* pTNd = aTmpEnd.GetNode().GetTextNode();
366 if( pTNd && pTNd->HasSwAttrSet() && pTNd->GetpSwAttrSet()->Count() )
367 {
368 if (pHst)
369 {
370 SwRegHistory history(pTNd, *pTNd, pHst);
371 pTNd->FormatToTextAttr(pTNd);
372 }
373 else
374 {
375 pTNd->FormatToTextAttr(pTNd);
376 }
377 }
378 }
379
380 if( aTmpStt < aTmpEnd )
381 GetNodes().ForEach( pStt->nNode, aTmpEnd, lcl_RstAttr, &aPara );
382 else if( !rRg.HasMark() )
383 {
384 aPara.bResetAll = false ;
385 ::lcl_RstAttr( &pStt->nNode.GetNode(), &aPara );
386 aPara.bResetAll = true ;
387 }
388
389 if( bTextAttr )
390 {
391 if( bAdd )
392 ++aTmpEnd;
394 }
395
397
398 oDataChanged.reset(); //before delete pPam
399
400 if( pPam != &rRg )
401 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()->nNode.GetNode().GetTextNode();
411 if (!pTextNode)
412 {
413 return;
414 }
415 const sal_Int32 nStart(rRg.GetPoint()->nContent.GetIndex() - nLen);
417
419 aSet.Put(aRsid);
420 bool const bRet(pTextNode->SetAttr(aSet, nStart,
421 rRg.GetPoint()->nContent.GetIndex()));
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, SwNodeIndex(*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(dynamic_cast<SwTextNode&>(*pCNd));
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 const SwPosition *pStt = rRg.Start(), *pEnd = rRg.End();
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->nNode.GetIndex(), pEnd->nNode.GetIndex()+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 SwNodeIndex aTmpIdx( GetNodes().GetEndOfAutotext() );
1399 const SwNodes& rSrcNds = rSrcFormat.GetDoc()->GetNodes();
1400 SwStartNode* pSttNd = SwNodes::MakeEmptySection( aTmpIdx,
1401 bCpyHeader
1404 const SwNode& rCSttNd = pContent->GetContentIdx()->GetNode();
1405 SwNodeRange aRg( rCSttNd, SwNodeOffset(0), *rCSttNd.EndOfSectionNode() );
1406 aTmpIdx = *pSttNd->EndOfSectionNode();
1407 rSrcNds.Copy_( aRg, aTmpIdx );
1408 aTmpIdx = *pSttNd;
1409 rSrcFormat.GetDoc()->GetDocumentContentOperationsManager().CopyFlyInFlyImpl(aRg, nullptr, aTmpIdx);
1410 // TODO: investigate calling CopyWithFlyInFly?
1411 SwPaM const source(aRg.aStart, aRg.aEnd);
1412 SwPosition dest(aTmpIdx);
1413 sw::CopyBookmarks(source, dest);
1414 pNewFormat->SetFormatAttr( SwFormatContent( pSttNd ));
1415 }
1416 else
1417 pNewFormat->ResetFormatAttr( RES_CNTNT );
1418 }
1419 if( bCpyHeader )
1420 pNewItem->StaticWhichCast(RES_HEADER).RegisterToFormat(*pNewFormat);
1421 else
1422 pNewItem->StaticWhichCast(RES_FOOTER).RegisterToFormat(*pNewFormat);
1423 rDestFormat.SetFormatAttr( *pNewItem );
1424}
1425
1426void SwDoc::CopyPageDesc( const SwPageDesc& rSrcDesc, SwPageDesc& rDstDesc,
1427 bool bCopyPoolIds )
1428{
1429 bool bNotifyLayout = false;
1431
1432 rDstDesc.SetLandscape( rSrcDesc.GetLandscape() );
1433 rDstDesc.SetNumType( rSrcDesc.GetNumType() );
1434 if( rDstDesc.ReadUseOn() != rSrcDesc.ReadUseOn() )
1435 {
1436 rDstDesc.WriteUseOn( rSrcDesc.ReadUseOn() );
1437 bNotifyLayout = true;
1438 }
1439
1440 if( bCopyPoolIds )
1441 {
1442 rDstDesc.SetPoolFormatId( rSrcDesc.GetPoolFormatId() );
1443 rDstDesc.SetPoolHelpId( rSrcDesc.GetPoolHelpId() );
1444 // Always set the HelpFile Id to default!
1445 rDstDesc.SetPoolHlpFileId( UCHAR_MAX );
1446 }
1447
1448 if( rSrcDesc.GetFollow() != &rSrcDesc )
1449 {
1450 const SwPageDesc* pSrcFollow = rSrcDesc.GetFollow();
1451 SwPageDesc* pFollow = FindPageDesc( pSrcFollow->GetName() );
1452 if( !pFollow )
1453 {
1454 // copy
1455 pFollow = MakePageDesc( pSrcFollow->GetName() );
1456 CopyPageDesc( *pSrcFollow, *pFollow );
1457 }
1458 rDstDesc.SetFollow( pFollow );
1459 bNotifyLayout = true;
1460 }
1461
1462 // the header and footer attributes are copied separately
1463 // the content sections have to be copied in their entirety
1464 {
1465 SfxItemSet aAttrSet( rSrcDesc.GetMaster().GetAttrSet() );
1466 aAttrSet.ClearItem( RES_HEADER );
1467 aAttrSet.ClearItem( RES_FOOTER );
1468
1469 rDstDesc.GetMaster().DelDiffs( aAttrSet );
1470 rDstDesc.GetMaster().SetFormatAttr( aAttrSet );
1471
1472 aAttrSet.ClearItem();
1473 aAttrSet.Put( rSrcDesc.GetLeft().GetAttrSet() );
1474 aAttrSet.ClearItem( RES_HEADER );
1475 aAttrSet.ClearItem( RES_FOOTER );
1476
1477 rDstDesc.GetLeft().DelDiffs( aAttrSet );
1478 rDstDesc.GetLeft().SetFormatAttr( aAttrSet );
1479
1480 aAttrSet.ClearItem();
1481 aAttrSet.Put( rSrcDesc.GetFirstMaster().GetAttrSet() );
1482 aAttrSet.ClearItem( RES_HEADER );
1483 aAttrSet.ClearItem( RES_FOOTER );
1484
1485 rDstDesc.GetFirstMaster().DelDiffs( aAttrSet );
1486 rDstDesc.GetFirstMaster().SetFormatAttr( aAttrSet );
1487
1488 aAttrSet.ClearItem();
1489 aAttrSet.Put( rSrcDesc.GetFirstLeft().GetAttrSet() );
1490 aAttrSet.ClearItem( RES_HEADER );
1491 aAttrSet.ClearItem( RES_FOOTER );
1492
1493 rDstDesc.GetFirstLeft().DelDiffs( aAttrSet );
1494 rDstDesc.GetFirstLeft().SetFormatAttr( aAttrSet );
1495 }
1496
1497 CopyHeader( rSrcDesc.GetMaster(), rDstDesc.GetMaster() );
1498 CopyFooter( rSrcDesc.GetMaster(), rDstDesc.GetMaster() );
1499 if( !rDstDesc.IsHeaderShared() )
1500 CopyHeader( rSrcDesc.GetLeft(), rDstDesc.GetLeft() );
1501 else
1502 rDstDesc.GetLeft().SetFormatAttr( rDstDesc.GetMaster().GetHeader() );
1503 if( !rDstDesc.IsFirstShared() )
1504 {
1505 CopyHeader( rSrcDesc.GetFirstMaster(), rDstDesc.GetFirstMaster() );
1506 rDstDesc.GetFirstLeft().SetFormatAttr(rDstDesc.GetFirstMaster().GetHeader());
1507 }
1508 else
1509 {
1510 rDstDesc.GetFirstMaster().SetFormatAttr( rDstDesc.GetMaster().GetHeader() );
1511 rDstDesc.GetFirstLeft().SetFormatAttr(rDstDesc.GetLeft().GetHeader());
1512 }
1513
1514 if( !rDstDesc.IsFooterShared() )
1515 CopyFooter( rSrcDesc.GetLeft(), rDstDesc.GetLeft() );
1516 else
1517 rDstDesc.GetLeft().SetFormatAttr( rDstDesc.GetMaster().GetFooter() );
1518 if( !rDstDesc.IsFirstShared() )
1519 {
1520 CopyFooter( rSrcDesc.GetFirstMaster(), rDstDesc.GetFirstMaster() );
1521 rDstDesc.GetFirstLeft().SetFormatAttr(rDstDesc.GetFirstMaster().GetFooter());
1522 }
1523 else
1524 {
1525 rDstDesc.GetFirstMaster().SetFormatAttr( rDstDesc.GetMaster().GetFooter() );
1526 rDstDesc.GetFirstLeft().SetFormatAttr(rDstDesc.GetLeft().GetFooter());
1527 }
1528
1529 if( bNotifyLayout && pTmpRoot )
1530 {
1531 for( auto aLayout : GetAllLayouts() )
1532 aLayout->AllCheckPageDescs();
1533 }
1534
1535 // If foot notes change the pages have to be triggered
1536 if( !(rDstDesc.GetFootnoteInfo() == rSrcDesc.GetFootnoteInfo()) )
1537 {
1539 rDstDesc.SetFootnoteInfo( rSrcDesc.GetFootnoteInfo() );
1540 rDstDesc.GetMaster().CallSwClientNotify(aHint);
1541 rDstDesc.GetLeft().CallSwClientNotify(aHint);
1542 rDstDesc.GetFirstMaster().CallSwClientNotify(aHint);
1543 rDstDesc.GetFirstLeft().CallSwClientNotify(aHint);
1544 }
1545
1546 // Copy the stashed formats as well between the page descriptors...
1547 for (bool bFirst : { true, false })
1548 for (bool bLeft : { true, false })
1549 for (bool bHeader : { true, false })
1550 {
1551 if (!bLeft && !bFirst)
1552 continue;
1553 if (auto pStashedFormat = rSrcDesc.GetStashedFrameFormat(bHeader, bLeft, bFirst))
1554 rDstDesc.StashFrameFormat(*pStashedFormat, bHeader, bLeft, bFirst);
1555 }
1556}
1557
1558void SwDoc::ReplaceStyles( const SwDoc& rSource, bool bIncludePageStyles )
1559{
1560 ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo());
1561
1568
1569 //To-Do:
1570 // a) in rtf export don't export our hideous pgdsctbl
1571 // extension to rtf anymore
1572 // b) in sd rtf import (View::InsertData) don't use
1573 // a super-fragile test for mere presence of \trowd to
1574 // indicate import of rtf into a table
1575 // c) then drop use of bIncludePageStyles
1576 if (bIncludePageStyles)
1577 {
1578 // and now the page templates
1579 SwPageDescs::size_type nCnt = rSource.m_PageDescs.size();
1580 if( nCnt )
1581 {
1582 // a different Doc -> Number formatter needs to be merged
1583 SwTableNumFormatMerge aTNFM( rSource, *this );
1584
1585 // 1st step: Create all formats (skip the 0th - it's the default!)
1586 while( nCnt )
1587 {
1588 const SwPageDesc &rSrc = *rSource.m_PageDescs[ --nCnt ];
1589 if( nullptr == FindPageDesc( rSrc.GetName() ) )
1590 MakePageDesc( rSrc.GetName() );
1591 }
1592
1593 // 2nd step: Copy all attributes, set the right parents
1594 for (SwPageDescs::size_type i = rSource.m_PageDescs.size(); i; )
1595 {
1596 const SwPageDesc &rSrc = *rSource.m_PageDescs[ --i ];
1597 SwPageDesc* pDesc = FindPageDesc( rSrc.GetName() );
1598 CopyPageDesc( rSrc, *pDesc);
1599 }
1600 }
1601 }
1602
1603 // then there are the numbering templates
1604 const SwNumRuleTable::size_type nCnt = rSource.GetNumRuleTable().size();
1605 if( nCnt )
1606 {
1607 const SwNumRuleTable& rArr = rSource.GetNumRuleTable();
1608 for( SwNumRuleTable::size_type n = 0; n < nCnt; ++n )
1609 {
1610 const SwNumRule& rR = *rArr[ n ];
1611 SwNumRule* pNew = FindNumRulePtr( rR.GetName());
1612 if( pNew )
1613 pNew->CopyNumRule(*this, rR);
1614 else
1615 {
1616 if( !rR.IsAutoRule() )
1617 MakeNumRule( rR.GetName(), &rR );
1618 else
1619 {
1620 // as we reset all styles, there shouldn't be any unknown
1621 // automatic SwNumRules, because all should have been
1622 // created by the style copying!
1623 // So just warn and ignore.
1624 SAL_WARN( "sw.core", "Found unknown auto SwNumRule during reset!" );
1625 }
1626 }
1627 }
1628 }
1629
1630 if (undoGuard.UndoWasEnabled())
1631 {
1632 // nodes array was modified!
1634 }
1635
1637}
1638
1639void SwDoc::MoveLeftMargin(const SwPaM& rPam, bool bRight, bool bModulus,
1640 SwRootFrame const*const pLayout)
1641{
1642 SwHistory* pHistory = nullptr;
1643 if (GetIDocumentUndoRedo().DoesUndo())
1644 {
1645 std::unique_ptr<SwUndoMoveLeftMargin> pUndo(new SwUndoMoveLeftMargin( rPam, bRight,
1646 bModulus ));
1647 pHistory = &pUndo->GetHistory();
1648 GetIDocumentUndoRedo().AppendUndo( std::move(pUndo) );
1649 }
1650
1651 const SvxTabStopItem& rTabItem = GetDefault( RES_PARATR_TABSTOP );
1652 const sal_Int32 nDefDist = rTabItem.Count() ? rTabItem[0].GetTabPos() : 1134;
1653 const SwPosition &rStt = *rPam.Start(), &rEnd = *rPam.End();
1654 SwNodeIndex aIdx( rStt.nNode );
1655 while( aIdx <= rEnd.nNode )
1656 {
1657 SwTextNode* pTNd = aIdx.GetNode().GetTextNode();
1658 if( pTNd )
1659 {
1660 pTNd = sw::GetParaPropsNode(*pLayout, aIdx);
1661 SvxLRSpaceItem aLS(pTNd->SwContentNode::GetAttr(RES_LR_SPACE));
1662
1663 // #i93873# See also lcl_MergeListLevelIndentAsLRSpaceItem in thints.cxx
1664 if ( pTNd->AreListLevelIndentsApplicable() )
1665 {
1666 const SwNumRule* pRule = pTNd->GetNumRule();
1667 if ( pRule )
1668 {
1669 const int nListLevel = pTNd->GetActualListLevel();
1670 if ( nListLevel >= 0 )
1671 {
1672 const SwNumFormat& rFormat = pRule->Get(o3tl::narrowing<sal_uInt16>(nListLevel));
1674 {
1675 aLS.SetTextLeft( rFormat.GetIndentAt() );
1676 aLS.SetTextFirstLineOffset( static_cast<short>(rFormat.GetFirstLineIndent()) );
1677 }
1678 }
1679 }
1680 }
1681
1682 tools::Long nNext = aLS.GetTextLeft();
1683 if( bModulus )
1684 nNext = ( nNext / nDefDist ) * nDefDist;
1685
1686 if( bRight )
1687 nNext += nDefDist;
1688 else
1689 if(nNext >0) // fdo#75936 set limit for decreasing indent
1690 nNext -= nDefDist;
1691
1692 aLS.SetTextLeft( nNext );
1693
1694 SwRegHistory aRegH( pTNd, *pTNd, pHistory );
1695 pTNd->SetAttr( aLS );
1696 aIdx = *sw::GetFirstAndLastNode(*pLayout, aIdx).second;
1697 }
1698 ++aIdx;
1699 }
1701}
1702
1703bool SwDoc::DontExpandFormat( const SwPosition& rPos, bool bFlag )
1704{
1705 bool bRet = false;
1706 SwTextNode* pTextNd = rPos.nNode.GetNode().GetTextNode();
1707 if( pTextNd )
1708 {
1709 bRet = pTextNd->DontExpandFormat( rPos.nContent, bFlag );
1710 if( bRet && GetIDocumentUndoRedo().DoesUndo() )
1711 {
1712 GetIDocumentUndoRedo().AppendUndo( std::make_unique<SwUndoDontExpandFormat>(rPos) );
1713 }
1714 }
1715 return bRet;
1716}
1717
1719{
1721 pFormat->SetName("TableBox" + OUString::number(reinterpret_cast<sal_IntPtr>(pFormat)));
1723 return pFormat;
1724}
1725
1727{
1729 pFormat->SetName("TableLine" + OUString::number(reinterpret_cast<sal_IntPtr>(pFormat)));
1731 return pFormat;
1732}
1733
1735{
1736 if (mpNumberFormatter == nullptr)
1737 {
1744 };
1745}
1746
1748 : pNFormat( nullptr )
1749{
1750 // a different Doc -> Number formatter needs to be merged
1751 if( &rSrc != &rDest )
1752 {
1753 SvNumberFormatter* pN = const_cast<SwDoc&>(rSrc).GetNumberFormatter( false );
1754 if( pN )
1755 {
1756 pNFormat = rDest.GetNumberFormatter();
1757 pNFormat->MergeFormatter( *pN );
1758 }
1759 }
1760
1761 if( &rSrc != &rDest )
1763 MergeWithOtherDoc( rDest );
1764}
1765
1767{
1768 if( pNFormat )
1770}
1771
1772void SwDoc::SetTextFormatCollByAutoFormat( const SwPosition& rPos, sal_uInt16 nPoolId,
1773 const SfxItemSet* pSet )
1774{
1775 SwPaM aPam( rPos );
1776 SwTextNode* pTNd = rPos.nNode.GetNode().GetTextNode();
1777 assert(pTNd);
1778
1780 {
1781 // create the redline object
1782 const SwTextFormatColl& rColl = *pTNd->GetTextColl();
1783 SwRangeRedline* pRedl = new SwRangeRedline( RedlineType::FmtColl, aPam );
1784 pRedl->SetMark();
1785
1786 // Only those items that are not set by the Set again in the Node
1787 // are of interest. Thus, we take the difference.
1788 SwRedlineExtraData_FormatColl aExtraData( rColl.GetName(),
1789 rColl.GetPoolFormatId() );
1790 if( pSet && pTNd->HasSwAttrSet() )
1791 {
1792 SfxItemSet aTmp( *pTNd->GetpSwAttrSet() );
1793 aTmp.Differentiate( *pSet );
1794 // we handle the adjust item separately
1795 const SfxPoolItem* pItem;
1796 if( SfxItemState::SET == pTNd->GetpSwAttrSet()->GetItemState(
1797 RES_PARATR_ADJUST, false, &pItem ))
1798 aTmp.Put( *pItem );
1799 aExtraData.SetItemSet( aTmp );
1800 }
1801 pRedl->SetExtraData( &aExtraData );
1802
1803 //TODO: Undo is still missing!
1805 }
1806
1807 SetTextFormatColl( aPam, getIDocumentStylePoolAccess().GetTextCollFromPool( nPoolId ) );
1808
1809 if (pSet && pSet->Count())
1810 {
1811 aPam.SetMark();
1812 aPam.GetMark()->nContent.Assign(pTNd, pTNd->GetText().getLength());
1813 // sw_redlinehide: don't need layout currently because the only caller
1814 // passes in the properties node
1815 assert(static_cast<SwTextFrame const*>(pTNd->getLayoutFrame(nullptr))->GetTextNodeForParaProps() == pTNd);
1817 }
1818}
1819
1820void SwDoc::SetFormatItemByAutoFormat( const SwPaM& rPam, const SfxItemSet& rSet )
1821{
1822 SwTextNode* pTNd = rPam.GetPoint()->nNode.GetNode().GetTextNode();
1823 assert(pTNd);
1824
1826
1828 {
1829 // create the redline object
1830 SwRangeRedline* pRedl = new SwRangeRedline( RedlineType::Format, rPam );
1831 if( !pRedl->HasMark() )
1832 pRedl->SetMark();
1833
1834 // Only those items that are not set by the Set again in the Node
1835 // are of interest. Thus, we take the difference.
1836 SwRedlineExtraData_Format aExtraData( rSet );
1837
1838 pRedl->SetExtraData( &aExtraData );
1839
1840 //TODO: Undo is still missing!
1842
1844 }
1845
1846 const sal_Int32 nEnd(rPam.End()->nContent.GetIndex());
1847 std::vector<WhichPair> whichIds;
1848 SfxItemIter iter(rSet);
1849 for (SfxPoolItem const* pItem = iter.GetCurItem(); pItem; pItem = iter.NextItem())
1850 {
1851 whichIds.push_back({pItem->Which(), pItem->Which()});
1852 }
1853 SfxItemSet currentSet(GetAttrPool(), WhichRangesContainer(whichIds.data(), whichIds.size()));
1854 pTNd->GetParaAttr(currentSet, nEnd, nEnd);
1855 for (const WhichPair& rPair : whichIds)
1856 { // yuk - want to explicitly set the pool defaults too :-/
1857 currentSet.Put(currentSet.Get(rPair.first));
1858 }
1859
1861
1862 // fdo#62536: DONTEXPAND does not work when there is already an AUTOFMT
1863 // here, so insert the old attributes as an empty hint to stop expand
1864 SwPaM endPam(*pTNd, nEnd);
1865 endPam.SetMark();
1866 getIDocumentContentOperations().InsertItemSet(endPam, currentSet);
1867
1869}
1870
1871void SwDoc::ChgFormat(SwFormat & rFormat, const SfxItemSet & rSet)
1872{
1873 if (GetIDocumentUndoRedo().DoesUndo())
1874 {
1875 // copying <rSet> to <aSet>
1876 SfxItemSet aSet(rSet);
1877 // remove from <aSet> all items, which are already set at the format
1878 aSet.Differentiate(rFormat.GetAttrSet());
1879 // <aSet> contains now all *new* items for the format
1880
1881 // copying current format item set to <aOldSet>
1882 SfxItemSet aOldSet(rFormat.GetAttrSet());
1883 // insert new items into <aOldSet>
1884 aOldSet.Put(aSet);
1885 // invalidate all new items in <aOldSet> in order to clear these items,
1886 // if the undo action is triggered.
1887 {
1888 SfxItemIter aIter(aSet);
1889
1890 for (const SfxPoolItem* pItem = aIter.GetCurItem(); pItem; pItem = aIter.NextItem())
1891 {
1892 aOldSet.InvalidateItem(pItem->Which());
1893 }
1894 }
1895
1897 std::make_unique<SwUndoFormatAttr>(std::move(aOldSet), rFormat, /*bSaveDrawPt*/true));
1898 }
1899
1900 rFormat.SetFormatAttr(rSet);
1901}
1902
1903void SwDoc::RenameFormat(SwFormat & rFormat, const OUString & sNewName,
1904 bool bBroadcast)
1905{
1906 SfxStyleFamily eFamily = SfxStyleFamily::All;
1907
1908 if (GetIDocumentUndoRedo().DoesUndo())
1909 {
1910 std::unique_ptr<SwUndo> pUndo;
1911
1912 switch (rFormat.Which())
1913 {
1914 case RES_CHRFMT:
1915 pUndo.reset(new SwUndoRenameCharFormat(rFormat.GetName(), sNewName, *this));
1916 eFamily = SfxStyleFamily::Char;
1917 break;
1918 case RES_TXTFMTCOLL:
1919 pUndo.reset(new SwUndoRenameFormatColl(rFormat.GetName(), sNewName, *this));
1920 eFamily = SfxStyleFamily::Para;
1921 break;
1922 case RES_FRMFMT:
1923 pUndo.reset(new SwUndoRenameFrameFormat(rFormat.GetName(), sNewName, *this));
1924 eFamily = SfxStyleFamily::Frame;
1925 break;
1926
1927 default:
1928 break;
1929 }
1930
1931 if (pUndo)
1932 {
1933 GetIDocumentUndoRedo().AppendUndo(std::move(pUndo));
1934 }
1935 }
1936
1937 // name change means the o3tl::sorted_array is not property sorted
1938 if (rFormat.Which() == RES_CHRFMT)
1939 mpCharFormatTable->SetFormatNameAndReindex(static_cast<SwCharFormat*>(&rFormat), sNewName);
1940 else
1941 rFormat.SetName(sNewName);
1942
1943 if (bBroadcast)
1944 BroadcastStyleOperation(sNewName, eFamily, SfxHintId::StyleSheetModified);
1945}
1946
1948{
1949 bool bOwns = false;
1950 if (!pWriter)
1951 {
1952 pWriter = xmlNewTextWriterFilename("nodes.xml", 0);
1953 xmlTextWriterSetIndent(pWriter,1);
1954 (void)xmlTextWriterSetIndentString(pWriter, BAD_CAST(" "));
1955 (void)xmlTextWriterStartDocument(pWriter, nullptr, nullptr, nullptr);
1956 bOwns = true;
1957 }
1958 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwDoc"));
1959 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", this);
1960
1961 m_pNodes->dumpAsXml(pWriter);
1962 m_PageDescs.dumpAsXml(pWriter);
1963 maDBData.dumpAsXml(pWriter);
1964 mpMarkManager->dumpAsXml(pWriter);
1965 m_pUndoManager->dumpAsXml(pWriter);
1966 m_pDocumentSettingManager->dumpAsXml(pWriter);
1968 mpTextFormatCollTable->dumpAsXml(pWriter);
1969 mpCharFormatTable->dumpAsXml(pWriter);
1970 mpFrameFormatTable->dumpAsXml(pWriter, "frmFormatTable");
1971 mpSpzFrameFormatTable->dumpAsXml(pWriter, "spzFrameFormatTable");
1972 mpSectionFormatTable->dumpAsXml(pWriter);
1973 mpTableFrameFormatTable->dumpAsXml(pWriter, "tableFrameFormatTable");
1974 mpNumRuleTable->dumpAsXml(pWriter);
1977 if (const SdrModel* pModel = getIDocumentDrawModelAccess().GetDrawModel())
1978 pModel->dumpAsXml(pWriter);
1979
1980 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("mbModified"));
1981 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"), BAD_CAST(OString::boolean(getIDocumentState().IsModified()).getStr()));
1982 (void)xmlTextWriterEndElement(pWriter);
1983
1984 (void)xmlTextWriterEndElement(pWriter);
1985 if (bOwns)
1986 {
1987 (void)xmlTextWriterEndDocument(pWriter);
1988 xmlFreeTextWriter(pWriter);
1989 }
1990}
1991
1993{
1994 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwDBData"));
1995
1996 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("sDataSource"), BAD_CAST(sDataSource.toUtf8().getStr()));
1997 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("sCommand"), BAD_CAST(sCommand.toUtf8().getStr()));
1998 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nCommandType"), BAD_CAST(OString::number(nCommandType).getStr()));
1999
2000 (void)xmlTextWriterEndElement(pWriter);
2001}
2002
2003std::set<Color> SwDoc::GetDocColors()
2004{
2005 std::set<Color> aDocColors;
2006 SwAttrPool& rPool = GetAttrPool();
2007 const sal_uInt16 pAttribs[] = {RES_CHRATR_COLOR, RES_CHRATR_HIGHLIGHT, RES_BACKGROUND};
2008 for (sal_uInt16 nAttrib : pAttribs)
2009 {
2010 for (const SfxPoolItem* pItem : rPool.GetItemSurrogates(nAttrib))
2011 {
2012 auto pColorItem = static_cast<const SvxColorItem*>(pItem);
2013 Color aColor( pColorItem->GetValue() );
2014 if (COL_AUTO != aColor)
2015 aDocColors.insert(aColor);
2016 }
2017 }
2018 return aDocColors;
2019}
2020
2021// #i69627#
2022namespace docfunc
2023{
2025 {
2026 // If a parent paragraph style of one of the paragraph styles, which
2027 // are assigned to the list levels of the outline style, has a list style
2028 // set or inherits a list style from its parent style, the outline style
2029 // has to be written as a normal list style to the OpenDocument file
2030 // format or the OpenOffice.org file format.
2031 bool bRet( false );
2032
2033 const SwTextFormatColls* pTextFormatColls( rDoc.GetTextFormatColls() );
2034 if ( pTextFormatColls )
2035 {
2036 for ( auto pTextFormatColl : *pTextFormatColls )
2037 {
2038 if ( pTextFormatColl->IsDefault() ||
2039 ! pTextFormatColl->IsAssignedToListLevelOfOutlineStyle() )
2040 {
2041 continue;
2042 }
2043
2044 const SwTextFormatColl* pParentTextFormatColl =
2045 dynamic_cast<const SwTextFormatColl*>( pTextFormatColl->DerivedFrom());
2046 if ( !pParentTextFormatColl )
2047 continue;
2048
2049 if ( SfxItemState::SET == pParentTextFormatColl->GetItemState( RES_PARATR_NUMRULE ) )
2050 {
2051 // #i106218# consider that the outline style is set
2052 const SwNumRuleItem& rDirectItem = pParentTextFormatColl->GetNumRule();
2053 if ( rDirectItem.GetValue() != rDoc.GetOutlineNumRule()->GetName() )
2054 {
2055 bRet = true;
2056 break;
2057 }
2058 }
2059 }
2060
2061 }
2062 return bRet;
2063 }
2064}
2065
2067 : m_PosIndex( m_Array.get<0>() )
2068 , m_TypeAndNameIndex( m_Array.get<1>() )
2069{
2070}
2071
2073{
2075}
2076
2078{
2079 ByTypeAndName::iterator it = m_TypeAndNameIndex.find(
2080 std::make_tuple(x->GetName(), x->Which(), x) );
2081 return m_Array.project<0>( it );
2082}
2083
2084SwFrameFormats::ByTypeAndName::const_iterator
2085SwFrameFormats::findByTypeAndName( sal_uInt16 type, const OUString& name ) const
2086{
2087 return m_TypeAndNameIndex.find( std::make_tuple(name, type) );
2088}
2089
2090std::pair<SwFrameFormats::ByTypeAndName::const_iterator, SwFrameFormats::ByTypeAndName::const_iterator>
2091SwFrameFormats::findRangeByName( const OUString& rName ) const
2092{
2093 auto it = m_TypeAndNameIndex.lower_bound( std::make_tuple(rName, sal_uInt16(0)) );
2094 auto itEnd = m_TypeAndNameIndex.upper_bound( std::make_tuple(rName, SAL_MAX_UINT16) );
2095 return { it, itEnd };
2096}
2097
2099{
2100 auto it = m_TypeAndNameIndex.lower_bound( std::make_tuple(rName, sal_uInt16(0)) );
2101 if (it != m_TypeAndNameIndex.end() && (*it)->GetName() == rName)
2102 return *it;
2103 return nullptr;
2104}
2105
2107{
2108 if ( empty() )
2109 return;
2110 const int _offset = keepDefault ? 1 : 0;
2111 for( const_iterator it = begin() + _offset; it != end(); ++it )
2112 delete *it;
2113 if ( _offset )
2114 m_PosIndex.erase( begin() + _offset, end() );
2115 else
2116 m_Array.clear();
2117}
2118
2119std::pair<SwFrameFormats::const_iterator,bool> SwFrameFormats::push_back( const value_type& x )
2120{
2121 SAL_WARN_IF(x->m_ffList != nullptr, "sw.core", "Inserting already assigned item");
2122 assert(x->m_ffList == nullptr);
2123 x->m_ffList = this;
2124 return m_PosIndex.push_back( x );
2125}
2126
2128{
2129 const_iterator const ret = find( x );
2130 SAL_WARN_IF(x->m_ffList != this, "sw.core", "Removing invalid / unassigned item");
2131 if (ret != end()) {
2132 assert( x == *ret );
2133 m_PosIndex.erase( ret );
2134 x->m_ffList = nullptr;
2135 return true;
2136 }
2137 return false;
2138}
2139
2141{
2142 erase( begin() + index_ );
2143}
2144
2146{
2147 (*position)->m_ffList = nullptr;
2148 m_PosIndex.erase( begin() + (position - begin()) );
2149}
2150
2152{
2153 return (x.m_ffList == this);
2154}
2155
2157{
2158 return find(const_cast<SwFrameFormat*>(p)) != end();
2159}
2160
2162{
2163 std::pair<iterator,bool> res = m_PosIndex.push_front( x );
2164 if( ! res.second )
2165 newDefault( res.first );
2166 return res.second;
2167}
2168
2170{
2171 if (position == begin())
2172 return;
2173 m_PosIndex.relocate( begin(), position );
2174}
2175
2176/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
struct _xmlTextWriter * xmlTextWriterPtr
@ Ignore
ignore Redlines
SwBreakIt * g_pBreakIt
Definition: breakit.cxx:33
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:164
const SwFormatCollConditions & GetCondColls() const
Definition: fmtcol.hxx:254
SwFormatColl * GetFormatColl() const
Definition: node.hxx:461
bool HasSwAttrSet() const
Definition: node.hxx:458
SwContentFrame * getLayoutFrame(const SwRootFrame *, const SwPosition *pPos=nullptr, std::pair< Point, bool > const *pViewPosAndCalcFrame=nullptr) const
Definition: node.cxx:1204
virtual bool SetAttr(const SfxPoolItem &)
made virtual
Definition: node.cxx:1566
const SwAttrSet * GetpSwAttrSet() const
Definition: node.hxx:457
virtual SwFormatColl * ChgFormatColl(SwFormatColl *)
Definition: node.cxx:1239
virtual bool ResetAttr(sal_uInt16 nWhich1, sal_uInt16 nWhich2=0)
Definition: node.cxx:1659
virtual sal_uInt16 ResetAllAttr()
Definition: node.cxx:1729
Definition: doc.hxx:188
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:1426
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:221
SwTextFormatColl * CopyTextColl(const SwTextFormatColl &rColl)
copy TextNodes
Definition: docfmt.cxx:1175
bool mbIsAutoFormatRedline
Definition: doc.hxx:312
SwPageDesc * FindPageDesc(const OUString &rName, size_t *pPos=nullptr) const
Definition: docdesc.cxx:953
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:243
SwTableBoxFormat * MakeTableBoxFormat()
Definition: docfmt.cxx:1718
SwConditionTextFormatColl * MakeCondTextFormatColl(const OUString &rFormatName, SwTextFormatColl *pDerivedFrom, bool bBroadcast=false)
Definition: docfmt.cxx:922
void EnsureNumberFormatter()
Definition: docfmt.cxx:1734
size_t GetTableFrameFormatCount(bool bUsed) const
Definition: docfmt.cxx:769
void DelCharFormat(size_t nFormat, bool bBroadcast=false)
Delete the formats.
Definition: docfmt.cxx:670
std::unique_ptr< SwGrfFormatColl > mpDfltGrfFormatColl
Definition: doc.hxx:237
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:729
IDocumentState const & getIDocumentState() const
Definition: doc.cxx:394
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:1772
const SwCharFormat * GetDfltCharFormat() const
Definition: doc.hxx:752
void ChgFormat(SwFormat &rFormat, const SfxItemSet &rSet)
Definition: docfmt.cxx:1871
std::unique_ptr< SwTextFormatColls > mpTextFormatCollTable
Definition: doc.hxx:244
const std::unique_ptr< ::sw::UndoManager > m_pUndoManager
Definition: doc.hxx:215
o3tl::sorted_vector< SwRootFrame * > GetAllLayouts()
Definition: doclay.cxx:1668
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:1947
SwTableLineFormat * MakeTableLineFormat()
Definition: docfmt.cxx:1726
SvNumberFormatter * mpNumberFormatter
Definition: doc.hxx:267
SwNumRule * FindNumRulePtr(const OUString &rName) const
Definition: docnum.cxx:2473
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:195
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:1065
void RenameFormat(SwFormat &rFormat, const OUString &sNewName, bool bBroadcast=false)
Definition: docfmt.cxx:1903
std::unique_ptr< SwCharFormats > mpCharFormatTable
Definition: doc.hxx:240
SwNumRule * GetOutlineNumRule() const
Definition: doc.hxx:1023
const SwCharFormats * GetCharFormats() const
Definition: doc.hxx:739
SwDBData maDBData
Definition: doc.hxx:203
SwPageDescs m_PageDescs
Definition: doc.hxx:197
IDocumentContentOperations const & getIDocumentContentOperations() const
Definition: doc.cxx:315
IDocumentUndoRedo & GetIDocumentUndoRedo()
Definition: doc.cxx:144
SwNodes & GetNodes()
Definition: doc.hxx:408
IDocumentFieldsAccess const & getIDocumentFieldsAccess() const
Definition: doc.cxx:357
std::unique_ptr< SwFrameFormats > mpFrameFormatTable
Definition: doc.hxx:239
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
Definition: doc.cxx:335
sal_uInt32 mnRsid
Definition: doc.hxx:295
SwPageDesc * MakePageDesc(const OUString &rName, const SwPageDesc *pCpy=nullptr, bool bRegardLanguage=true, bool bBroadcast=false)
Definition: docdesc.cxx:771
std::unique_ptr< SwFrameFormats > mpSpzFrameFormatTable
Definition: doc.hxx:241
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
Definition: doc.cxx:405
std::unique_ptr< SwTextFormatColl > mpDfltTextFormatColl
Definition: doc.hxx:236
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:777
IDocumentStylePoolAccess const & getIDocumentStylePoolAccess() const
Definition: doc.cxx:426
::sw::DocumentContentOperationsManager const & GetDocumentContentOperationsManager() const
Definition: doc.cxx:325
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:242
const std::unique_ptr< ::sw::mark::MarkManager > mpMarkManager
Definition: doc.hxx:210
std::unique_ptr< SwNumRuleTable > mpNumRuleTable
Definition: doc.hxx:269
const SwFrameFormats * GetFrameFormats() const
Definition: doc.hxx:737
bool DontExpandFormat(const SwPosition &rPos, bool bFlag=true)
Definition: docfmt.cxx:1703
SwTextFormatColl * FindTextFormatCollByName(const OUString &rName) const
Definition: doc.hxx:798
SwGrfFormatColl * MakeGrfFormatColl(const OUString &rFormatName, SwGrfFormatColl *pDerivedFrom)
Definition: docfmt.cxx:948
std::unique_ptr< SwSectionFormats > mpSectionFormatTable
Definition: doc.hxx:242
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:1318
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:235
IDocumentDrawModelAccess const & getIDocumentDrawModelAccess() const
Definition: doc.cxx:155
std::unique_ptr< SwFrameFormat > mpDfltFrameFormat
Definition: doc.hxx:232
SwCharFormat * MakeCharFormat(const OUString &rFormatName, SwCharFormat *pDerivedFrom, bool bBroadcast=false)
Definition: docfmt.cxx:854
const SwFrameFormat * GetDfltFrameFormat() const
Definition: doc.hxx:746
std::set< Color > GetDocColors()
Definition: docfmt.cxx:2003
SwFormat * MakeCharFormat_(const OUString &, SwFormat *, bool, bool)
Definition: docfmt.cxx:878
const SwFrameFormats * GetSpzFrameFormats() const
Definition: doc.hxx:743
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:216
void ReplaceStyles(const SwDoc &rSource, bool bIncludePageStyles=true)
Definition: docfmt.cxx:1558
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:898
SvNumberFormatter * GetNumberFormatter(bool bCreate=true)
Definition: doc.hxx:1410
::sw::UndoManager & GetUndoManager()
Definition: doc.cxx:133
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:893
void SetFormatItemByAutoFormat(const SwPaM &rPam, const SfxItemSet &)
Definition: docfmt.cxx:1820
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:2507
SwFrameFormat * FindFrameFormatByName(const OUString &rName) const
Definition: docfmt.cxx:745
std::unique_ptr< SwGrfFormatColls > mpGrfFormatCollTable
Definition: doc.hxx:245
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:1639
void dumpAsXml(xmlTextWriterPtr pWriter) const
Definition: docredln.cxx:92
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:715
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 void SetName(const OUString &rNewName, bool bBroadcast=false)
Definition: format.cxx:144
virtual bool ResetFormatAttr(sal_uInt16 nWhich1, sal_uInt16 nWhich2=0)
Definition: format.cxx:619
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:386
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:319
SwFormat * DerivedFrom() const
Definition: format.hxx:128
void CopyAttrs(const SwFormat &)
Copy attributes even among documents.
Definition: format.cxx:172
virtual bool SetFormatAttr(const SfxPoolItem &rAttr)
Definition: format.cxx:448
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:667
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:767
virtual size_t GetFormatCount() const =0
Style of a layout element.
Definition: frmfmt.hxx:61
virtual void SetName(const OUString &rNewName, bool bBroadcast=false) override
Definition: atrfrm.cxx:2561
const_iterator find(const value_type &x) const
Definition: docfmt.cxx:2077
ByPos::const_iterator const_iterator
bool empty() const
std::pair< ByTypeAndName::const_iterator, ByTypeAndName::const_iterator > findRangeByName(const OUString &name) const
Definition: docfmt.cxx:2091
SwFrameFormatsBase m_Array
virtual SwFrameFormat * FindFormatByName(const OUString &rName) const override
Definition: docfmt.cxx:2098
bool ContainsFormat(SwFrameFormat const &rFormat) const
fast check if given format is contained here @precond pFormat must not have been deleted
Definition: docfmt.cxx:2151
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:2156
ByTypeAndName::const_iterator findByTypeAndName(sal_uInt16 type, const OUString &name) const
Definition: docfmt.cxx:2085
bool erase(const value_type &x)
Definition: docfmt.cxx:2127
bool newDefault(const value_type &x)
Definition: docfmt.cxx:2161
void DeleteAndDestroyAll(bool keepDefault=false)
Definition: docfmt.cxx:2106
SwFrameFormatsBase::value_type value_type
const_iterator begin() const
ByTypeAndName & m_TypeAndNameIndex
virtual ~SwFrameFormats() override
Definition: docfmt.cxx:2072
const_iterator end() const
std::pair< const_iterator, bool > push_back(const value_type &x)
Definition: docfmt.cxx:2119
ByPos & m_PosIndex
Get reference.
Definition: reffld.hxx:66
void Add(const SfxPoolItem *pOldValue, const SfxPoolItem *pNewValue, SwNodeOffset nNodeIdx)
Definition: rolbck.cxx:1034
Marks a character position inside a document model node.
Definition: index.hxx:34
SwIndex & Assign(SwIndexReg *, sal_Int32)
Definition: index.cxx:206
sal_Int32 GetIndex() const
Definition: index.hxx:91
TElementType * Next()
Definition: calbck.hxx:364
TElementType * First()
Definition: calbck.hxx:356
void LockModify()
Definition: calbck.hxx:208
bool IsModifyLocked() const
Definition: calbck.hxx:210
void UnlockModify()
Definition: calbck.hxx:209
void Add(SwClient *pDepend)
Definition: calbck.cxx:172
SwClient * Remove(SwClient *pDepend)
Definition: calbck.cxx:225
bool HasWriterListeners() const
Definition: calbck.hxx:202
Marks a node in the document model.
Definition: ndindex.hxx:31
SwNode & GetNode() const
Definition: ndindex.hxx:128
SwNodeOffset GetIndex() const
Definition: ndindex.hxx:161
SwNodeIndex aStart
Definition: ndindex.hxx:141
SwNodeIndex aEnd
Definition: ndindex.hxx:142
Base class of the Writer document model elements.
Definition: node.hxx:83
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
Definition: ndtxt.hxx:871
SwNodeOffset GetIndex() const
Definition: node.hxx:292
SwDoc & GetDoc()
Definition: node.hxx:213
bool IsTextNode() const
Definition: node.hxx:648
Merge GetRedlineMergeFlag() const
Definition: node.hxx:99
SwContentNode * GetContentNode()
Definition: node.hxx:627
const SwEndNode * EndOfSectionNode() const
Definition: node.hxx:694
void ForEach(FnForEach_SwNodes fnForEach, void *pArgs=nullptr)
Definition: ndarr.hxx:142
void Copy_(const SwNodeRange &rRg, const SwNodeIndex &rInsPos, bool bNewFrames=true) const
Definition: ndarr.hxx:175
static SwStartNode * MakeEmptySection(const SwNodeIndex &rIdx, SwStartNodeType=SwNormalStartNode)
Create an empty section of Start- and EndNote.
Definition: nodes.cxx:1887
bool IsAutoRule() const
Definition: numrule.hxx:229
const SwNumFormat & Get(sal_uInt16 i) const
Definition: number.cxx:86
void SetInvalidRule(bool bFlag)
Definition: number.cxx:957
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:900
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:138
const SwPosition * GetMark() const
Definition: pam.hxx:210
virtual void SetMark()
Unless this is called, the getter method of Mark will return Point.
Definition: pam.cxx:477
const SwPosition * End() const
Definition: pam.hxx:218
const SwPosition * GetPoint() const
Definition: pam.hxx:208
const SwPosition * Start() const
Definition: pam.hxx:213
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
Definition: pam.hxx:206
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:220
void SetItemSet(const SfxItemSet &rSet)
Definition: docredln.cxx:951
void dumpAsXml(xmlTextWriterPtr pWriter) const
Definition: docredln.cxx:857
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:314
SwTableNumFormatMerge(const SwDoc &rSrc, SwDoc &rDest)
Definition: docfmt.cxx:1747
SvNumberFormatter * pNFormat
Definition: mvsave.hxx:181
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:611
void SetNextTextFormatColl(SwTextFormatColl &rNext)
Inline implementations.
Definition: fmtcol.hxx:263
int GetAssignedOutlineStyleLevel() const
Definition: fmtcol.cxx:604
Represents the visualization of a paragraph.
Definition: txtfrm.hxx:163
SwTextNode const * GetTextNodeForParaProps() const
Definition: txtfrm.cxx:1306
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:84
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:2110
void FormatToTextAttr(SwTextNode *pNd)
Convey attributes of an AttrSet (AutoFormat) to SwpHintsArray.
Definition: thints.cxx:2509
virtual bool SetAttr(const SfxPoolItem &) override
overriding to handle change of certain paragraph attributes
Definition: ndtxt.cxx:4939
SwTextAttr * GetTextAttrAt(sal_Int32 const nIndex, sal_uInt16 const nWhich, enum GetTextAttrMode const eMode=DEFAULT) const
get the innermost text attribute covering position nIndex.
Definition: ndtxt.cxx:1745
SwNumRule * GetNumRule(bool bInParent=true) const
Returns numbering rule of this text node.
Definition: ndtxt.cxx:2833
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:4141
bool DontExpandFormat(const SwIndex &rIdx, bool bFlag=true, bool bFormatToTextAttributes=true)
When appropriate set DontExpand-flag at INet or character styles respectively.
Definition: ndtxt.cxx:1624
bool AreListLevelIndentsApplicable() const
Determines, if the list level indent attributes can be applied to the paragraph.
Definition: ndtxt.cxx:4501
const OUString & GetText() const
Definition: ndtxt.hxx:220
LanguageType GetLang(const sal_Int32 nBegin, const sal_Int32 nLen=0, sal_uInt16 nScript=0) const
Definition: thints.cxx:3440
SwTextFormatColl * GetTextColl() const
Definition: ndtxt.hxx:865
SwUndoFormatAttr * GetUndo() const
std::unique_ptr< SwUndoFormatAttr > ReleaseUndo()
Typing one or more characters to a single paragraph.
Definition: UndoInsert.hxx:42
void SetWithRsid()
Definition: UndoInsert.hxx:89
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, const SwNodeIndex &rStartIdx, const bool bCopyFlyAtFly=false, SwCopyFlags flags=SwCopyFlags::Default) const
bool UndoWasEnabled() const
SwUndo * GetLastUndo()
Definition: docundo.cxx:238
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:89
static bool lcl_RstAttr(SwNode *pNd, void *pArgs)
Definition: docfmt.cxx:97
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:491
bool isCHRATR(const sal_uInt16 nWhich)
Definition: hintids.hxx:479
constexpr sal_uInt16 RES_FRMATR_END(133)
constexpr sal_uInt16 RES_CHRATR_END(46)
bool isPARATR_LIST(const sal_uInt16 nWhich)
Definition: hintids.hxx:499
constexpr sal_uInt16 RES_PARATR_BEGIN(RES_TXTATR_END)
bool isDrawingLayerAttribute(const sal_uInt16 nWhich)
Definition: hintids.hxx:507
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:503
bool isBOXATR(const sal_uInt16 nWhich)
Definition: hintids.hxx:515
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:495
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:511
const SfxPoolItem * GetDfltAttr(sal_uInt16 nWhich)
Get the default attribute from corresponding default attribute table.
Definition: hints.cxx:156
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:2024
int i
index
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
void CopyBookmarks(const SwPaM &rPam, const SwPosition &rCpyPam)
SwTextNode * GetParaPropsNode(SwRootFrame const &rLayout, SwNodeIndex const &rNode)
Definition: txtfrm.cxx:330
std::pair< SwTextNode *, SwTextNode * > GetFirstAndLastNode(SwRootFrame const &rLayout, SwNodeIndex const &rPos)
Definition: txtfrm.cxx:357
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:1992
OUString sCommand
Definition: swdbdata.hxx:31
Marks a position in the document model.
Definition: pam.hxx:37
SwNodeIndex nNode
Definition: pam.hxx:38
SwIndex nContent
Definition: pam.hxx:39
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