LibreOffice Module sw (master) 1
section.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/xmlstring.h>
21#include <libxml/xmlwriter.h>
22#include <stdlib.h>
23#include <hintids.hxx>
24#include <osl/diagnose.h>
25#include <sot/exchange.hxx>
26#include <svl/stritem.hxx>
27#include <sfx2/docfile.hxx>
28#include <editeng/protitem.hxx>
29#include <sfx2/linkmgr.hxx>
30#include <sfx2/sfxsids.hrc>
31#include <docary.hxx>
32#include <fmtcntnt.hxx>
33#include <fmtpdsc.hxx>
34#include <doc.hxx>
35#include <IDocumentUndoRedo.hxx>
41#include <IDocumentState.hxx>
43#include <node.hxx>
44#include <pam.hxx>
45#include <frmatr.hxx>
46#include <frmtool.hxx>
47#include <editsh.hxx>
48#include <hints.hxx>
49#include <docsh.hxx>
50#include <ndtxt.hxx>
51#include <section.hxx>
52#include <swserv.hxx>
53#include <shellio.hxx>
54#include <poolfmt.hxx>
55#include <swbaslnk.hxx>
56#include <mvsave.hxx>
57#include <ftnidx.hxx>
58#include <doctxm.hxx>
59#include <fmteiro.hxx>
60#include <unosection.hxx>
61#include <calbck.hxx>
62#include <fmtclds.hxx>
63#include <algorithm>
64#include <utility>
65#include "ndsect.hxx"
66
67using namespace ::com::sun::star;
68
69namespace {
70 class SwIntrnlSectRefLink : public SwBaseLink
71 {
72 SwSectionFormat& m_rSectFormat;
73
74 public:
75 SwIntrnlSectRefLink(SwSectionFormat& rFormat, SfxLinkUpdateMode nUpdateType)
76 : SwBaseLink(nUpdateType, SotClipboardFormatId::RTF)
77 , m_rSectFormat(rFormat)
78 {}
79
80 virtual void Closed() override;
81 virtual ::sfx2::SvBaseLink::UpdateResult DataChanged(
82 const OUString& rMimeType, const css::uno::Any & rValue ) override;
83
84 virtual const SwNode* GetAnchor() const override;
85 virtual bool IsInRange( SwNodeOffset nSttNd, SwNodeOffset nEndNd ) const override;
86
87 SwSectionNode* GetSectNode()
88 {
89 const SwNode* pSectNd( GetAnchor() );
90 return const_cast<SwSectionNode*>( pSectNd->GetSectionNode() );
91 }
92 };
93}
94
95SwSectionData::SwSectionData(SectionType const eType, OUString aName)
96 : m_eType(eType)
97 , m_sSectionName(std::move(aName))
98 , m_bHiddenFlag(false)
99 , m_bProtectFlag(false)
100 , m_bEditInReadonlyFlag(false) // edit in readonly sections
101 , m_bHidden(false)
102 , m_bCondHiddenFlag(true)
103 , m_bConnectFlag(true)
104{
105}
106
107// this must have the same semantics as operator=()
109 : m_eType(rSection.GetType())
110 , m_sSectionName(rSection.GetSectionName())
111 , m_sCondition(rSection.GetCondition())
112 , m_sLinkFileName(rSection.GetLinkFileName())
113 , m_sLinkFilePassword(rSection.GetLinkFilePassword())
114 , m_Password(rSection.GetPassword())
115 , m_bHiddenFlag(rSection.IsHiddenFlag())
116 , m_bProtectFlag(rSection.IsProtect())
117 // edit in readonly sections
118 , m_bEditInReadonlyFlag(rSection.IsEditInReadonly())
119 , m_bHidden(rSection.IsHidden())
120 , m_bCondHiddenFlag(true)
121 , m_bConnectFlag(rSection.IsConnectFlag())
122{
123}
124
125// this must have the same semantics as operator=()
127 : m_eType(rOther.m_eType)
128 , m_sSectionName(rOther.m_sSectionName)
129 , m_sCondition(rOther.m_sCondition)
130 , m_sLinkFileName(rOther.m_sLinkFileName)
131 , m_sLinkFilePassword(rOther.m_sLinkFilePassword)
132 , m_Password(rOther.m_Password)
133 , m_bHiddenFlag(rOther.m_bHiddenFlag)
134 , m_bProtectFlag(rOther.m_bProtectFlag)
135 // edit in readonly sections
136 , m_bEditInReadonlyFlag(rOther.m_bEditInReadonlyFlag)
137 , m_bHidden(rOther.m_bHidden)
138 , m_bCondHiddenFlag(true)
139 , m_bConnectFlag(rOther.m_bConnectFlag)
140{
141}
142
143// the semantics here are weird for reasons of backward compatibility
145{
146 m_eType = rOther.m_eType;
148 m_sCondition = rOther.m_sCondition;
152 m_Password = rOther.m_Password;
153
156
157 m_bHidden = rOther.m_bHidden;
158 // FIXME: old code did not assign m_bHiddenFlag ?
159 // FIXME: why should m_bCondHiddenFlag always default to true?
160 m_bCondHiddenFlag = true;
161
162 return *this;
163}
164
165// the semantics here are weird for reasons of backward compatibility
167{
168 return (m_eType == rOther.m_eType)
169 && (m_sSectionName == rOther.m_sSectionName)
170 && (m_sCondition == rOther.m_sCondition)
171 && (m_bHidden == rOther.m_bHidden)
172 && (m_bProtectFlag == rOther.m_bProtectFlag)
174 && (m_sLinkFileName == rOther.m_sLinkFileName)
176 && (m_Password == rOther.m_Password);
177 // FIXME: old code ignored m_bCondHiddenFlag m_bHiddenFlag m_bConnectFlag
178}
179
181{
182 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwSectionData"));
183 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", this);
184 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("section-name"), BAD_CAST(m_sSectionName.toUtf8().getStr()));
185 (void)xmlTextWriterEndElement(pWriter);
186}
187
189 SectionType const eType, OUString const& rName, SwSectionFormat & rFormat)
190 : SwClient(& rFormat)
191 , m_Data(eType, rName)
192{
193 StartListening(rFormat.GetNotifier());
194
195 SwSection *const pParentSect = GetParent();
196 if( pParentSect )
197 {
198 // edit in readonly sections
200 }
201
203
204 if (!m_Data.IsEditInReadonlyFlag()) // edit in readonly sections
205 {
207 }
208}
209
211{
212 SwSectionFormat* pFormat = GetFormat();
213 if( !pFormat )
214 return;
215
216 SwDoc* pDoc = pFormat->GetDoc();
217 if( pDoc->IsInDtor() )
218 {
219 // We reattach our Format to the default FrameFormat
220 // to not get any dependencies
221 if( pFormat->DerivedFrom() != pDoc->GetDfltFrameFormat() )
222 pFormat->RegisterToFormat( *pDoc->GetDfltFrameFormat() );
223 }
224 else
225 {
226 pFormat->Remove( this ); // remove
228
230 {
232 }
233
234 if (m_RefObj.is())
235 {
237 }
238
239 // If the Section is the last Client in the Format we can delete it
240 pFormat->RemoveAllUnos();
241 if( !pFormat->HasWriterListeners() )
242 {
243 // Do not add to the Undo. This should've happened earlier.
244 ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
245 pDoc->DelSectionFormat( pFormat );
246 }
247 }
248 if (m_RefObj.is())
249 {
250 m_RefObj->Closed();
251 }
252}
253
255{
256 bool const bOldHidden( m_Data.IsHidden() );
257 m_Data = rData;
258 // The next two may actually overwrite the m_Data.m_bProtect or EditInReadonly Flag
259 // in Modify, which should result in same flag value as the old code!
262 if (bOldHidden != m_Data.IsHidden()) // check if changed...
263 {
265 }
266}
267
269{
270 // note that the old code compared the flags of the parameter with the
271 // format attributes of this; the following mess should do the same...
272 (void) GetLinkFileName(); // updates m_sLinkFileName
273 bool const bProtect(m_Data.IsProtectFlag());
274 bool const bEditInReadonly(m_Data.IsEditInReadonlyFlag());
277 bool const bResult( m_Data == rCmp );
278 m_Data.SetProtectFlag(bProtect);
279 m_Data.SetEditInReadonlyFlag(bEditInReadonly);
280 return bResult;
281}
282
283void SwSection::ImplSetHiddenFlag(bool const bTmpHidden, bool const bCondition)
284{
285 SwSectionFormat* pFormat = GetFormat();
286 OSL_ENSURE(pFormat, "ImplSetHiddenFlag: no format?");
287 if( !pFormat )
288 return;
289
290 const bool bHide = bTmpHidden && bCondition;
291
292 if (bHide) // should be hidden
293 {
294 if (!m_Data.IsHiddenFlag()) // is not hidden
295 {
296 // Is the Parent hidden?
297 // This should be shown by the bHiddenFlag.
298
299 // Tell all Children that they are hidden
300 const sw::SectionHidden aHint;
301 pFormat->CallSwClientNotify(aHint);
302
303 // Delete all Frames
304 pFormat->DelFrames();
305 }
306 }
307 else if (m_Data.IsHiddenFlag()) // show Nodes again
308 {
309 // Show all Frames (Child Sections are accounted for by MakeFrames)
310 // Only if the Parent Section is not restricting us!
311 SwSection* pParentSect = pFormat->GetParentSection();
312 if( !pParentSect || !pParentSect->IsHiddenFlag() )
313 {
314 // Tell all Children that the Parent is not hidden anymore
315 const sw::SectionHidden aHint(false);
316 pFormat->CallSwClientNotify(aHint);
317
318 pFormat->MakeFrames();
319 }
320 }
321}
322
324{
325 const SwSection* pSect = this;
326 do {
327 if( pSect->IsHidden() && pSect->IsCondHidden() )
328 return true;
329 } while( nullptr != ( pSect = pSect->GetParent()) );
330
331 return false;
332}
333
335{
336 SwSectionFormat const *const pFormat( GetFormat() );
337 OSL_ENSURE(pFormat, "SwSection::IsProtect: no format?");
338 return pFormat
339 ? pFormat->GetProtect().IsContentProtected()
340 : IsProtectFlag();
341}
342
343// edit in readonly sections
345{
346 SwSectionFormat const *const pFormat( GetFormat() );
347 OSL_ENSURE(pFormat, "SwSection::IsEditInReadonly: no format?");
348 return pFormat
349 ? pFormat->GetEditInReadonly().GetValue()
351}
352
353void SwSection::SetHidden(bool const bFlag)
354{
355 if (!m_Data.IsHidden() == !bFlag)
356 return;
357
358 m_Data.SetHidden(bFlag);
360}
361
362void SwSection::SetProtect(bool const bFlag)
363{
364 SwSectionFormat *const pFormat( GetFormat() );
365 OSL_ENSURE(pFormat, "SwSection::SetProtect: no format?");
366 if (pFormat)
367 {
369 aItem.SetContentProtect( bFlag );
370 pFormat->SetFormatAttr( aItem );
371 // note: this will call m_Data.SetProtectFlag via Modify!
372 }
373 else
374 {
375 m_Data.SetProtectFlag(bFlag);
376 }
377}
378
379// edit in readonly sections
380void SwSection::SetEditInReadonly(bool const bFlag)
381{
382 SwSectionFormat *const pFormat( GetFormat() );
383 OSL_ENSURE(pFormat, "SwSection::SetEditInReadonly: no format?");
384 if (pFormat)
385 {
387 aItem.SetValue( bFlag );
388 pFormat->SetFormatAttr( aItem );
389 // note: this will call m_Data.SetEditInReadonlyFlag via Modify!
390 }
391 else
392 {
394 }
395}
396
398{
399 Notify(rHint);
400}
401
402void SwSection::Notify(SfxHint const& rHint)
403{
404 if (rHint.GetId() == SfxHintId::SwSectionHidden)
405 {
406 auto rSectionHidden = static_cast<const sw::SectionHidden&>(rHint);
407 m_Data.SetHiddenFlag(rSectionHidden.m_isHidden || (m_Data.IsHidden() && m_Data.IsCondHidden()));
408 return;
409 } else if (rHint.GetId() != SfxHintId::SwLegacyModify)
410 return;
411 auto pLegacy = static_cast<const sw::LegacyModifyHint*>(&rHint);
412 auto pOld = pLegacy->m_pOld;
413 auto pNew = pLegacy->m_pNew;
414 bool bUpdateFootnote = false;
415 switch(pLegacy->GetWhich())
416 {
417 case RES_ATTRSET_CHG:
418 if (pNew && pOld)
419 {
420 SfxItemSet* pNewSet = const_cast<SwAttrSetChg*>(static_cast<const SwAttrSetChg*>(pNew))->GetChgSet();
421 SfxItemSet* pOldSet = const_cast<SwAttrSetChg*>(static_cast<const SwAttrSetChg*>(pOld))->GetChgSet();
422
423 if( const SvxProtectItem* pItem = pNewSet->GetItemIfSet(
424 RES_PROTECT, false ) )
425 {
426 m_Data.SetProtectFlag( pItem->IsContentProtected() );
427 pNewSet->ClearItem( RES_PROTECT );
428 pOldSet->ClearItem( RES_PROTECT );
429 }
430
431 // --> edit in readonly sections
432 if( const SwFormatEditInReadonly* pItem = pNewSet->GetItemIfSet(
433 RES_EDIT_IN_READONLY, false ) )
434 {
435 m_Data.SetEditInReadonlyFlag(pItem->GetValue());
438 }
439
440 if( SfxItemState::SET == pNewSet->GetItemState(
441 RES_FTN_AT_TXTEND, false ) ||
442 SfxItemState::SET == pNewSet->GetItemState(
443 RES_END_AT_TXTEND, false ))
444 {
445 bUpdateFootnote = true;
446 }
447
448 if( !pNewSet->Count() )
449 return;
450 }
451 break;
452
453 case RES_PROTECT:
454 if( pNew )
455 {
456 bool bNewFlag =
457 static_cast<const SvxProtectItem*>(pNew)->IsContentProtected();
458 // this used to inherit the flag from the parent, but then there is
459 // no way to turn it off in an inner section
460 m_Data.SetProtectFlag( bNewFlag );
461 }
462 return;
463 // edit in readonly sections
465 if( pNew )
466 {
467 const bool bNewFlag =
468 static_cast<const SwFormatEditInReadonly*>(pNew)->GetValue();
469 m_Data.SetEditInReadonlyFlag( bNewFlag );
470 }
471 return;
472
473 case RES_COL:
474 // Is handled by the Layout, if appropriate
475 break;
476
478 if( pNew && pOld )
479 {
480 bUpdateFootnote = true;
481 }
482 break;
483
485 if( pNew && pOld )
486 {
487 bUpdateFootnote = true;
488 }
489 break;
490
491 default:
492 CheckRegistration( pOld );
493 break;
494 }
495
496 if( bUpdateFootnote )
497 {
498 SwSectionNode* pSectNd = GetFormat()->GetSectionNode();
499 if( pSectNd )
500 pSectNd->GetDoc().GetFootnoteIdxs().UpdateFootnote(*pSectNd);
501 }
502}
503
505{
506 m_RefObj = pObj;
507}
508
509void SwSection::SetCondHidden(bool const bFlag)
510{
511 if (!m_Data.IsCondHidden() == !bFlag)
512 return;
513
514 m_Data.SetCondHidden(bFlag);
516}
517
518// Set/remove the linked FileName
519OUString const & SwSection::GetLinkFileName() const
520{
521 if (m_RefLink.is())
522 {
523 OUString sTmp;
524 switch (m_Data.GetType())
525 {
527 sTmp = m_RefLink->GetLinkSourceName();
528 break;
529
531 {
532 OUString sRange;
533 OUString sFilter;
534 if (m_RefLink->GetLinkManager() &&
536 m_RefLink.get(), nullptr, &sTmp, &sRange, &sFilter ))
537 {
538 sTmp += OUStringChar(sfx2::cTokenSeparator) + sFilter
539 + OUStringChar(sfx2::cTokenSeparator) + sRange;
540 }
541 else if( GetFormat() && !GetFormat()->GetSectionNode() )
542 {
543 // If the Section is in the UndoNodesArray, the LinkManager
544 // does not contain the Link, thus it cannot be queried for it.
545 // Thus return the current Name.
546 return m_Data.GetLinkFileName();
547 }
548 }
549 break;
550 default: break;
551 }
553 }
554 return m_Data.GetLinkFileName();
555}
556
557void SwSection::SetLinkFileName(const OUString& rNew)
558{
559 if (m_RefLink.is())
560 {
561 m_RefLink->SetLinkSourceName( rNew );
562 }
564}
565
566// If it was a Linked Section, we need to make all Child Links visible
568{
569 const SwNode* pNd;
570 const ::sfx2::SvBaseLinks& rLnks = rSectNd.GetDoc().getIDocumentLinksAdministration().GetLinkManager().GetLinks();
571 for( auto n = rLnks.size(); n; )
572 {
573 sfx2::SvBaseLink& rBLnk = *rLnks[--n];
574 if (!rBLnk.IsVisible() && dynamic_cast<const SwBaseLink*>(&rBLnk) != nullptr
575 && nullptr != (pNd = static_cast<SwBaseLink&>(rBLnk).GetAnchor()))
576 {
577 pNd = pNd->StartOfSectionNode(); // If it's a SectionNode
578 const SwSectionNode* pParent;
579 while( nullptr != ( pParent = pNd->FindSectionNode() ) &&
580 ( SectionType::Content == pParent->GetSection().GetType()
581 || pNd == &rSectNd ))
582 pNd = pParent->StartOfSectionNode();
583
584 // It's within a normal Section, so show again
585 if( !pParent )
586 rBLnk.SetVisible(true);
587 }
588 }
589}
590
592{
593 const SwTOXBase* pRet = nullptr;
595 pRet = dynamic_cast<const SwTOXBaseSection*>(this);
596 return pRet;
597}
598
600 : SwFrameFormat( pDoc->GetAttrPool(), OUString(), pDrvdFrame )
601{
602 LockModify();
604 UnlockModify();
605}
606
608{
609 if( GetDoc()->IsInDtor() )
610 return;
611
612 SwSectionNode* pSectNd;
613 const SwNodeIndex* pIdx = GetContent( false ).GetContentIdx();
614 if( pIdx && &GetDoc()->GetNodes() == &pIdx->GetNodes() &&
615 nullptr != (pSectNd = pIdx->GetNode().GetSectionNode() ))
616 {
617 SwSection& rSect = pSectNd->GetSection();
618 // If it was a linked Section, we need to make all Child Links
619 // visible again
620 if( rSect.IsConnected() )
622
623 // Check whether we need to be visible, before deleting the Nodes
624 if( rSect.IsHiddenFlag() )
625 {
626 SwSection* pParentSect = rSect.GetParent();
627 if( !pParentSect || !pParentSect->IsHiddenFlag() )
628 {
629 // Make Nodes visible again
630 rSect.SetHidden(false);
631 }
632 }
633 // mba: test iteration; objects are removed while iterating
634 // use hint which allows to specify, if the content shall be saved or not
635 CallSwClientNotify( SwSectionFrameMoveAndDeleteHint( true ) );
636
637 // Raise the Section up
638 SwNodeRange aRg( *pSectNd, SwNodeOffset(0), *pSectNd->EndOfSectionNode() );
639 GetDoc()->GetNodes().SectionUp( &aRg );
640 }
641 LockModify();
643 UnlockModify();
644}
645
647{
649}
650
651// Do not destroy all Frames in aDepend (Frames are recognized with a dynamic_cast).
653{
654 SwSectionNode* pSectNd;
655 const SwNodeIndex* pIdx = GetContent(false).GetContentIdx();
656 if( pIdx && &GetDoc()->GetNodes() == &pIdx->GetNodes() &&
657 nullptr != (pSectNd = pIdx->GetNode().GetSectionNode() ))
658 {
659 // First delete the <SwSectionFrame> of the <SwSectionFormat> instance
660 // mba: test iteration as objects are removed in iteration
661 // use hint which allows to specify, if the content shall be saved or not
662 CallSwClientNotify( SwSectionFrameMoveAndDeleteHint( false ) );
663
664 // Then delete frames of the nested <SwSectionFormat> instances
666 SwSectionFormat *pLast = aIter.First();
667 while ( pLast )
668 {
669 pLast->DelFrames();
670 pLast = aIter.Next();
671 }
672
673 SwNodeOffset nEnd = pSectNd->EndOfSectionIndex();
674 SwNodeOffset nStart = pSectNd->GetIndex()+1;
675 sw_DeleteFootnote( pSectNd, nStart, nEnd );
676 }
677 if( !pIdx )
678 return;
679
680 // Send Hint for PageDesc. Actually the Layout contained in the
681 // Paste of the Frame itself would need to do this. But that leads
682 // to subsequent errors, which we'd need to solve at run-time.
683 SwNodeIndex aNextNd( *pIdx );
684 SwContentNode* pCNd = GetDoc()->GetNodes().GoNextSection( &aNextNd, true, false );
685 if( pCNd )
686 {
687 const SfxPoolItem& rItem = pCNd->GetSwAttrSet().Get(RES_PAGEDESC);
688 pCNd->CallSwClientNotify(sw::LegacyModifyHint(&rItem, &rItem));
689 }
690}
691
692// Create the Views
694{
695 SwSectionNode* pSectNd;
696 const SwNodeIndex* pIdx = GetContent(false).GetContentIdx();
697
698 if( pIdx && &GetDoc()->GetNodes() == &pIdx->GetNodes() &&
699 nullptr != (pSectNd = pIdx->GetNode().GetSectionNode() ))
700 {
701 SwNodeIndex aIdx( *pIdx );
702 pSectNd->MakeOwnFrames( &aIdx );
703 }
704}
705
706void SwSectionFormat::SwClientNotify(const SwModify& rMod, const SfxHint& rHint)
707{
708 if (rHint.GetId() == SfxHintId::SwSectionHidden)
709 {
710 auto rSectionHidden = static_cast<const sw::SectionHidden&>(rHint);
711 auto pSect = GetSection();
712 if(!pSect || rSectionHidden.m_isHidden == pSect->IsHiddenFlag()) // already at target state, skipping.
713 return;
714 GetNotifier().Broadcast(rSectionHidden);
715 return;
716 } else if (rHint.GetId() != SfxHintId::SwLegacyModify)
717 return;
718 auto pLegacy = static_cast<const sw::LegacyModifyHint*>(&rHint);
719 sal_uInt16 nWhich = pLegacy->GetWhich();
720 auto pOld = pLegacy->m_pOld;
721 auto pNew = pLegacy->m_pNew;
722 switch( nWhich )
723 {
724 case RES_ATTRSET_CHG:
725 if (HasWriterListeners() && pOld && pNew)
726 {
727 SfxItemSet* pNewSet = const_cast<SwAttrSetChg*>(static_cast<const SwAttrSetChg*>(pNew))->GetChgSet();
728 SfxItemSet* pOldSet = const_cast<SwAttrSetChg*>(static_cast<const SwAttrSetChg*>(pOld))->GetChgSet();
729 const SfxPoolItem *pItem;
730 if( SfxItemState::SET == pNewSet->GetItemState(
731 RES_PROTECT, false, &pItem ))
732 {
733 GetNotifier().Broadcast(sw::LegacyModifyHint(pItem, pItem));
734 pNewSet->ClearItem( RES_PROTECT );
735 pOldSet->ClearItem( RES_PROTECT );
736 }
737
738 // --> edit in readonly sections
739 if( SfxItemState::SET == pNewSet->GetItemState(
740 RES_EDIT_IN_READONLY, false, &pItem ) )
741 {
742 GetNotifier().Broadcast(sw::LegacyModifyHint(pItem, pItem));
745 }
746
747 if( SfxItemState::SET == pNewSet->GetItemState(
748 RES_FTN_AT_TXTEND, false, &pItem ))
749 {
750 GetNotifier().Broadcast(sw::LegacyModifyHint(pItem, pItem));
751 pNewSet->ClearItem( RES_FTN_AT_TXTEND );
752 pOldSet->ClearItem( RES_FTN_AT_TXTEND );
753 }
754 if( SfxItemState::SET == pNewSet->GetItemState(
755 RES_END_AT_TXTEND, false, &pItem ))
756 {
757 GetNotifier().Broadcast(sw::LegacyModifyHint(pItem, pItem));
758 pNewSet->ClearItem( RES_END_AT_TXTEND );
759 pOldSet->ClearItem( RES_END_AT_TXTEND );
760 }
761 if( !static_cast<const SwAttrSetChg*>(pOld)->GetChgSet()->Count() )
762 return;
763 }
764 break;
765
768 GetNotifier().Broadcast(sw::LegacyModifyHint(pOld, pNew));
769 return;
770 case RES_PROTECT:
771 case RES_EDIT_IN_READONLY: // edit in readonly sections
772 // Pass through these Messages until the End of the tree!
773 GetNotifier().Broadcast(sw::LegacyModifyHint(pOld, pNew));
774 return; // That's it!
775
776 case RES_OBJECTDYING:
777 if( !GetDoc()->IsInDtor() && pOld &&
778 static_cast<const SwPtrMsgPoolItem *>(pOld)->pObject == static_cast<void*>(GetRegisteredIn()) )
779 {
780 // My Parents will be destroyed, so get the Parent's Parent
781 // and update
783 UpdateParent();
784 return;
785 }
786 break;
787
788 case RES_FMT_CHG:
789 if( !GetDoc()->IsInDtor() &&
790 static_cast<const SwFormatChg*>(pNew)->pChangedFormat == static_cast<void*>(GetRegisteredIn()) &&
791 dynamic_cast<const SwSectionFormat*>(static_cast<const SwFormatChg*>(pNew)->pChangedFormat) != nullptr )
792 {
793 // My Parent will be changed, thus I need to update
795 UpdateParent();
796 return;
797 }
798 break;
799 }
801
802 if (pOld && (RES_REMOVE_UNO_OBJECT == pOld->Which()))
803 { // invalidate cached uno object
804 SetXTextSection(nullptr);
805 }
806}
807
809{
810 m_wXTextSection = xTextSection.get();
811}
812
813// Get info from the Format
815{
816 switch( rInfo.Which() )
817 {
820 {
821 const SwSectionNode* pNd = GetSectionNode();
822 if( pNd )
823 static_cast<SwFindNearestNode&>(rInfo).CheckNode( *pNd );
824 }
825 return true;
826
828 {
829 SwFrame* pFrame = SwIterator<SwFrame,SwFormat>(*this).First();
830 // if the current section has no own frame search for the children
831 if(!pFrame)
832 {
834 SwSectionFormat* pChild = aFormatIter.First();
835 while(pChild && !pFrame)
836 {
837 pFrame = SwIterator<SwFrame,SwFormat>(*pChild).First();
838 pChild = aFormatIter.Next();
839 }
840 }
841 static_cast<SwPtrMsgPoolItem&>(rInfo).pObject = pFrame;
842 }
843 return false;
844 }
845 return sw::BroadcastingModify::GetInfo( rInfo );
846}
847
848static bool lcl_SectionCmpPos( const SwSection *pFirst, const SwSection *pSecond)
849{
850 const SwSectionFormat* pFSectFormat = pFirst->GetFormat();
851 const SwSectionFormat* pSSectFormat = pSecond->GetFormat();
852 OSL_ENSURE( pFSectFormat && pSSectFormat &&
853 pFSectFormat->GetContent(false).GetContentIdx() &&
854 pSSectFormat->GetContent(false).GetContentIdx(),
855 "Invalid sections" );
856 return pFSectFormat->GetContent(false).GetContentIdx()->GetIndex() <
857 pSSectFormat->GetContent(false).GetContentIdx()->GetIndex();
858}
859
860// get all Sections that have been derived from this one
862 SectionSort eSort,
863 bool bAllSections ) const
864{
865 rArr.clear();
866
867 if( !HasWriterListeners() )
868 return;
869
871 const SwNodeIndex* pIdx;
872 for( SwSectionFormat* pLast = aIter.First(); pLast; pLast = aIter.Next() )
873 if( bAllSections ||
874 ( nullptr != ( pIdx = pLast->GetContent(false).
875 GetContentIdx()) && &pIdx->GetNodes() == &GetDoc()->GetNodes() ))
876 {
877 SwSection* pDummy = pLast->GetSection();
878 rArr.push_back( pDummy );
879 }
880
881 // Do we need any sorting?
882 if( 1 < rArr.size() )
883 switch( eSort )
884 {
885 case SectionSort::Pos:
886 std::sort( rArr.begin(), rArr.end(), lcl_SectionCmpPos );
887 break;
888 case SectionSort::Not: break;
889 }
890}
891
892// See whether the Section is within the Nodes or the UndoNodes array
894{
895 const SwNodeIndex* pIdx = GetContent(false).GetContentIdx();
896 return pIdx && &pIdx->GetNodes() == &GetDoc()->GetNodes();
897}
898
899// Parent was changed
901{
902 if(!HasWriterListeners())
903 return;
904
905 const SwSection* pSection = GetSection();
906 const SvxProtectItem* pProtect = &GetProtect();
907 // edit in readonly sections
908 const SwFormatEditInReadonly* pEditInReadonly = &GetEditInReadonly();
909 bool bIsHidden = pSection->IsHidden();
910 if(GetRegisteredIn())
911 {
912 const SwSection* pPS = GetParentSection();
913 pProtect = &pPS->GetFormat()->GetProtect();
914 pEditInReadonly = &pPS->GetFormat()->GetEditInReadonly();
915 bIsHidden = pPS->IsHiddenFlag();
916 }
917 if(!pProtect->IsContentProtected() != !pSection->IsProtectFlag())
918 CallSwClientNotify(sw::LegacyModifyHint(pProtect, pProtect));
919
920 // edit in readonly sections
921 if(!pEditInReadonly->GetValue() != !pSection->IsEditInReadonlyFlag())
922 CallSwClientNotify(sw::LegacyModifyHint(pEditInReadonly, pEditInReadonly));
923
924 if(bIsHidden == pSection->IsHiddenFlag())
925 {
926 const sw::SectionHidden aHint(bIsHidden);
927 CallSwClientNotify(aHint);
928 }
929}
930
932{
933 const SwNodeIndex* pIdx = GetContent(false).GetContentIdx();
934 if( pIdx && ( &pIdx->GetNodes() == &GetDoc()->GetNodes() ))
935 return pIdx->GetNode().GetSectionNode();
936 return nullptr;
937}
938
939// Is this Section valid for the GlobalDocument?
941{
942 const SwSectionNode* pNd = GetSectionNode();
943 if( pNd &&
946 pNd->GetIndex() > pNd->GetNodes().GetEndOfExtras().GetIndex() &&
949 return &pNd->GetSection();
950 return nullptr;
951}
952
953// sw::Metadatable
955{
956 return GetDoc()->GetXmlIdRegistry();
957}
958
960{
961 return GetDoc()->IsClipBoard();
962}
963
965{
966 return !IsInNodesArr();
967}
968
970{
971 SwNodeIndex const*const pIdx = GetContent(false).GetContentIdx();
972 OSL_ENSURE(pIdx, "SwSectionFormat::IsInContent: no index?");
973 return pIdx == nullptr || !GetDoc()->IsInHeaderFooter(pIdx->GetNode());
974}
975
976// n.b.: if the section format represents an index, then there is both a
977// SwXDocumentIndex and a SwXTextSection instance for this single core object.
978// these two can both implement XMetadatable and forward to the same core
979// section format. but here only one UNO object can be returned,
980// so always return the text section.
981uno::Reference< rdf::XMetadatable >
983{
984 uno::Reference<rdf::XMetadatable> xMeta;
985 SwSection *const pSection( GetSection() );
986 if (pSection)
987 {
989 SectionType::ToxHeader == pSection->GetType());
990 }
991 return xMeta;
992}
993
995{
996 return false;
997}
998
1000{
1001 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwSectionFormat"));
1002 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", this);
1003 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("name"), BAD_CAST(GetName().toUtf8().getStr()));
1004 GetAttrSet().dumpAsXml(pWriter);
1005 (void)xmlTextWriterEndElement(pWriter);
1006}
1007
1009{
1010 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwSectionFormats"));
1011 for (size_t i = 0; i < size(); ++i)
1012 GetFormat(i)->dumpAsXml(pWriter);
1013 (void)xmlTextWriterEndElement(pWriter);
1014}
1015
1016// Method to break section links inside a linked section
1017static void lcl_BreakSectionLinksInSect( const SwSectionNode& rSectNd )
1018{
1019 if ( !rSectNd.GetSection().IsConnected() )
1020 {
1021 OSL_FAIL( "method <lcl_RemoveSectionLinksInSect(..)> - no Link at Section of SectionNode" );
1022 return;
1023 }
1024 const ::sfx2::SvBaseLink* pOwnLink( &(rSectNd.GetSection().GetBaseLink() ) );
1025 const ::sfx2::SvBaseLinks& rLnks = rSectNd.GetDoc().getIDocumentLinksAdministration().GetLinkManager().GetLinks();
1026 for ( auto n = rLnks.size(); n > 0; )
1027 {
1028 SwIntrnlSectRefLink* pSectLnk = dynamic_cast<SwIntrnlSectRefLink*>(&(*rLnks[ --n ]));
1029 if ( pSectLnk && pSectLnk != pOwnLink &&
1030 pSectLnk->IsInRange( rSectNd.GetIndex(), rSectNd.EndOfSectionIndex() ) )
1031 {
1032 // break the link of the corresponding section.
1033 // the link is also removed from the link manager
1034 SwSectionNode* pSectNode = pSectLnk->GetSectNode();
1035 assert(pSectNode);
1036 pSectNode->GetSection().BreakLink();
1037
1038 // for robustness, because link is removed from the link manager
1039 if ( n > rLnks.size() )
1040 {
1041 n = rLnks.size();
1042 }
1043 }
1044 }
1045}
1046
1047static void lcl_UpdateLinksInSect( const SwBaseLink& rUpdLnk, SwSectionNode& rSectNd )
1048{
1049 SwDoc& rDoc = rSectNd.GetDoc();
1050 SwDocShell* pDShell = rDoc.GetDocShell();
1051 if( !pDShell || !pDShell->GetMedium() )
1052 return ;
1053
1054 const OUString sName( pDShell->GetMedium()->GetName() );
1055 const OUString sMimeType( SotExchange::GetFormatMimeType( SotClipboardFormatId::SIMPLE_FILE ));
1056 uno::Any aValue;
1057 aValue <<= sName; // Arbitrary name
1058
1059 const ::sfx2::SvBaseLinks& rLnks = rDoc.getIDocumentLinksAdministration().GetLinkManager().GetLinks();
1060 for( auto n = rLnks.size(); n; )
1061 {
1062 ::sfx2::SvBaseLink* pLnk = &(*rLnks[ --n ]);
1063 if( pLnk == &rUpdLnk )
1064 continue;
1066 continue;
1067 SwBaseLink* pBLink = dynamic_cast<SwBaseLink*>( pLnk );
1068 if( pBLink && pBLink->IsInRange( rSectNd.GetIndex(),
1069 rSectNd.EndOfSectionIndex() ) )
1070 {
1071 // It's in the Section, so update. But only if it's not in the same File!
1072 OUString sFName;
1073 sfx2::LinkManager::GetDisplayNames( pBLink, nullptr, &sFName );
1074 if( sFName != sName )
1075 {
1076 pBLink->DataChanged( sMimeType, aValue );
1077
1078 // If needed find the Link pointer to avoid skipping one or calling one twice
1079 if( n >= rLnks.size() && 0 != ( n = rLnks.size() ))
1080 --n;
1081
1082 if( n && pLnk != &(*rLnks[ n ]) )
1083 {
1084 // Find - it can only precede it!
1085 while( n )
1086 if( pLnk == &(*rLnks[ --n ] ) )
1087 break;
1088 }
1089 }
1090 }
1091 }
1092}
1093
1094::sfx2::SvBaseLink::UpdateResult SwIntrnlSectRefLink::DataChanged(
1095 const OUString& rMimeType, const uno::Any & rValue )
1096{
1097 SwSectionNode* pSectNd = m_rSectFormat.GetSectionNode();
1098 SwDoc* pDoc = m_rSectFormat.GetDoc();
1099
1101
1102 if( !pSectNd || !pDoc || pDoc->IsInDtor() || ChkNoDataFlag() ||
1104 {
1105 // Should we be in the Undo already?
1106 return SUCCESS;
1107 }
1108
1109 // #i38810# - Due to possible existing signatures, the
1110 // document has to be modified after updating a link.
1112 // set additional flag that links have been updated, in order to check this
1113 // during load.
1115
1116 // Always switch off Undo
1117 bool const bWasUndo = pDoc->GetIDocumentUndoRedo().DoesUndo();
1118 pDoc->GetIDocumentUndoRedo().DoUndo(false);
1119 bool bWasVisibleLinks = pDoc->getIDocumentLinksAdministration().IsVisibleLinks();
1121
1122 SwPaM* pPam;
1124 SwEditShell* pESh = pDoc->GetEditShell();
1126 {
1127 // Insert an empty TextNode at the Section's start
1128 SwNodeIndex aIdx( *pSectNd, +1 );
1129 SwNodeIndex aEndIdx( *pSectNd->EndOfSectionNode() );
1130 pDoc->GetNodes().MakeTextNode( aIdx.GetNode(),
1132
1133 if( pESh )
1134 pESh->StartAllAction();
1135 else if( pVSh )
1136 pVSh->StartAction();
1137
1138 SwPosition aPos( aIdx, SwNodeOffset(-1) );
1139 SwDoc::CorrAbs( aIdx, aEndIdx, aPos, true );
1140
1141 pPam = new SwPaM( aPos );
1142
1143 // Delete everything succeeding it
1144 --aIdx;
1145 DelFlyInRange( aIdx.GetNode(), aEndIdx.GetNode() );
1146 DelBookmarks(aIdx.GetNode(), aEndIdx.GetNode());
1147 ++aIdx;
1148
1149 pDoc->GetNodes().Delete( aIdx, aEndIdx.GetIndex() - aIdx.GetIndex() );
1150 }
1151
1152 SwSection& rSection = pSectNd->GetSection();
1153 rSection.SetConnectFlag(false);
1154
1155 Reader* pRead = nullptr;
1156 switch( nDataFormat )
1157 {
1158 case SotClipboardFormatId::STRING:
1159 pRead = ReadAscii;
1160 break;
1161
1162 case SotClipboardFormatId::RICHTEXT:
1163 case SotClipboardFormatId::RTF:
1165 break;
1166
1167 case SotClipboardFormatId::SIMPLE_FILE:
1168 if ( rValue.hasValue() )
1169 {
1170 OUString sFileName;
1171 if ( !(rValue >>= sFileName) )
1172 break;
1173 OUString sFilter;
1174 OUString sRange;
1175 sfx2::LinkManager::GetDisplayNames( this, nullptr, &sFileName,
1176 &sRange, &sFilter );
1177
1178 RedlineFlags eOldRedlineFlags = RedlineFlags::NONE;
1179 SfxObjectShellRef xDocSh;
1180 SfxObjectShellLock xLockRef;
1181 int nRet;
1182 if( sFileName.isEmpty() )
1183 {
1184 xDocSh = pDoc->GetDocShell();
1185 nRet = 1;
1186 }
1187 else
1188 {
1189 nRet = SwFindDocShell( xDocSh, xLockRef, sFileName,
1190 rSection.GetLinkFilePassword(),
1191 sFilter, 0, pDoc->GetDocShell() );
1192 if( nRet )
1193 {
1194 SwDoc* pSrcDoc = static_cast<SwDocShell*>( xDocSh.get() )->GetDoc();
1195 eOldRedlineFlags = pSrcDoc->getIDocumentRedlineAccess().GetRedlineFlags();
1197 }
1198 }
1199
1200 if( nRet )
1201 {
1202 rSection.SetConnectFlag();
1203
1204 SwNodeIndex aSave( pPam->GetPoint()->GetNode(), -1 );
1205 std::optional<SwNodeRange> oCpyRg;
1206
1207 if( xDocSh->GetMedium() &&
1208 rSection.GetLinkFilePassword().isEmpty() )
1209 {
1210 if( const SfxStringItem* pItem = xDocSh->GetMedium()->GetItemSet()->
1211 GetItemIfSet( SID_PASSWORD, false ) )
1212 rSection.SetLinkFilePassword( pItem->GetValue() );
1213 }
1214
1215 SwDoc* pSrcDoc = static_cast<SwDocShell*>( xDocSh.get() )->GetDoc();
1216
1217 if( !sRange.isEmpty() )
1218 {
1219 // Catch recursion
1220 bool bRecursion = false;
1221 if( pSrcDoc == pDoc )
1222 {
1223 tools::SvRef<SwServerObject> refObj( static_cast<SwServerObject*>(
1225 if( refObj.is() )
1226 {
1227 bRecursion = refObj->IsLinkInServer( this ) ||
1228 ChkNoDataFlag();
1229 }
1230 }
1231
1232 SwNode& rInsPos = pPam->GetPoint()->GetNode();
1233
1234 SwPaM* pCpyPam = nullptr;
1235 if( !bRecursion &&
1236 pSrcDoc->GetDocumentLinksAdministrationManager().SelectServerObj( sRange, pCpyPam, oCpyRg )
1237 && pCpyPam )
1238 {
1239 if( pSrcDoc != pDoc ||
1240 pCpyPam->Start()->GetNode() > rInsPos ||
1241 rInsPos >= pCpyPam->End()->GetNode() )
1242 {
1244 }
1245 delete pCpyPam;
1246 }
1247 if( oCpyRg && pSrcDoc == pDoc &&
1248 oCpyRg->aStart < rInsPos && rInsPos < oCpyRg->aEnd.GetNode() )
1249 {
1250 oCpyRg.reset();
1251 }
1252 }
1253 else if( pSrcDoc != pDoc )
1254 oCpyRg.emplace( pSrcDoc->GetNodes().GetEndOfExtras(), SwNodeOffset(2),
1255 pSrcDoc->GetNodes().GetEndOfContent() );
1256
1257 // #i81653#
1258 // Update links of extern linked document or extern linked
1259 // document section, if section is protected.
1260 if ( pSrcDoc != pDoc &&
1261 rSection.IsProtectFlag() )
1262 {
1263 pSrcDoc->getIDocumentLinksAdministration().GetLinkManager().UpdateAllLinks( false, false, nullptr );
1264 }
1265
1266 if( oCpyRg )
1267 {
1268 SwNode& rInsPos = pPam->GetPoint()->GetNode();
1269 bool bCreateFrame = rInsPos <= pDoc->GetNodes().GetEndOfExtras() ||
1270 rInsPos.FindTableNode();
1271
1272 SwTableNumFormatMerge aTNFM( *pSrcDoc, *pDoc );
1273
1274 pSrcDoc->GetDocumentContentOperationsManager().CopyWithFlyInFly(*oCpyRg, rInsPos, nullptr, bCreateFrame);
1275 ++aSave;
1276
1277 if( !bCreateFrame )
1278 ::MakeFrames( pDoc, aSave.GetNode(), rInsPos );
1279
1280 // Delete last Node, only if it was copied successfully
1281 // (the Section contains more than one Node)
1282 if( SwNodeOffset(2) < pSectNd->EndOfSectionIndex() - pSectNd->GetIndex() )
1283 {
1284 aSave = rInsPos;
1285 pPam->Move( fnMoveBackward, GoInNode );
1286 pPam->SetMark(); // Rewire both SwPositions
1287
1288 pDoc->CorrAbs( aSave.GetNode(), *pPam->GetPoint(), 0, true );
1289 pDoc->GetNodes().Delete( aSave );
1290 }
1291 oCpyRg.reset();
1292 }
1293
1294 lcl_BreakSectionLinksInSect( *pSectNd );
1295
1296 // Update all Links in this Section
1297 lcl_UpdateLinksInSect( *this, *pSectNd );
1298 }
1299 if( xDocSh.is() )
1300 {
1301 if( 2 == nRet )
1302 xDocSh->DoClose();
1303 else if( static_cast<SwDocShell*>( xDocSh.get() )->GetDoc() )
1304 static_cast<SwDocShell*>( xDocSh.get() )->GetDoc()->getIDocumentRedlineAccess().SetRedlineFlags(
1305 eOldRedlineFlags );
1306 }
1307 }
1308 break;
1309 default: break;
1310 }
1311
1312 // Only create DDE if Shell is available!
1313 uno::Sequence< sal_Int8 > aSeq;
1314 if( pRead && rValue.hasValue() && ( rValue >>= aSeq ) )
1315 {
1316 if( pESh )
1317 {
1318 pESh->Push();
1319 SwPaM* pCursor = pESh->GetCursor();
1320 *pCursor->GetPoint() = *pPam->GetPoint();
1321 delete pPam;
1322 pPam = pCursor;
1323 }
1324
1325 SvMemoryStream aStrm( const_cast<sal_Int8 *>(aSeq.getConstArray()), aSeq.getLength(),
1326 StreamMode::READ );
1327 aStrm.Seek( 0 );
1328
1329 // TODO/MBA: it's impossible to set a BaseURL here!
1330 SwReader aTmpReader( aStrm, OUString(), pDoc->GetDocShell()->GetMedium()->GetBaseURL(), *pPam );
1331
1332 if( ! aTmpReader.Read( *pRead ).IsError() )
1333 {
1334 rSection.SetConnectFlag();
1335 }
1336
1337 if( pESh )
1338 {
1340 pPam = nullptr; // pam was deleted earlier
1341 }
1342 }
1343
1344 // remove all undo actions and turn undo on again
1345 pDoc->GetIDocumentUndoRedo().DelAllUndoObj();
1346 pDoc->GetIDocumentUndoRedo().DoUndo(bWasUndo);
1347 pDoc->getIDocumentLinksAdministration().SetVisibleLinks( bWasVisibleLinks );
1348
1351 pDoc->getIDocumentFieldsAccess().UpdateExpFields(nullptr, true);
1352
1353 if( pESh )
1354 pESh->EndAllAction();
1355 else if( pVSh )
1356 pVSh->EndAction();
1357 delete pPam; // Was created at the start
1358
1359 return SUCCESS;
1360}
1361
1362void SwIntrnlSectRefLink::Closed()
1363{
1364 SwDoc* pDoc = m_rSectFormat.GetDoc();
1365 if( pDoc && !pDoc->IsInDtor() )
1366 {
1367 // Advise says goodbye: mark the Section as not protected
1368 // and change the Flag
1369 const SwSectionFormats& rFormats = pDoc->GetSections();
1370 for( auto n = rFormats.size(); n; )
1371 if (rFormats[--n] == &m_rSectFormat)
1372 {
1374 SwEditShell* pESh = pDoc->GetEditShell();
1375
1376 if( pESh )
1377 pESh->StartAllAction();
1378 else
1379 pSh->StartAction();
1380
1381 SwSectionData aSectionData(*m_rSectFormat.GetSection());
1382 aSectionData.SetType( SectionType::Content );
1383 aSectionData.SetLinkFileName( OUString() );
1384 aSectionData.SetProtectFlag( false );
1385 // edit in readonly sections
1386 aSectionData.SetEditInReadonlyFlag( false );
1387
1388 aSectionData.SetConnectFlag( false );
1389
1390 pDoc->UpdateSection( n, aSectionData );
1391
1392 // Make all Links within the Section visible again
1393 SwSectionNode* pSectNd = m_rSectFormat.GetSectionNode();
1394 if( pSectNd )
1396
1397 if( pESh )
1398 pESh->EndAllAction();
1399 else
1400 pSh->EndAction();
1401 break;
1402 }
1403 }
1404 SvBaseLink::Closed();
1405}
1406
1408{
1409 SwSectionFormat* pFormat = GetFormat();
1410 OSL_ENSURE(pFormat, "SwSection::CreateLink: no format?");
1411 if (!pFormat || (SectionType::Content == m_Data.GetType()))
1412 return ;
1413
1414 SfxLinkUpdateMode nUpdateType = SfxLinkUpdateMode::ALWAYS;
1415
1416 if (!m_RefLink.is())
1417 {
1418 // create BaseLink
1419 m_RefLink = new SwIntrnlSectRefLink( *pFormat, nUpdateType );
1420 }
1421 else
1422 {
1424 }
1425
1426 SwIntrnlSectRefLink *const pLnk =
1427 static_cast<SwIntrnlSectRefLink*>( m_RefLink.get() );
1428
1429 const OUString sCmd(m_Data.GetLinkFileName());
1430 pLnk->SetUpdateMode( nUpdateType );
1431 pLnk->SetVisible( pFormat->GetDoc()->getIDocumentLinksAdministration().IsVisibleLinks() );
1432
1433 switch (m_Data.GetType())
1434 {
1436 pLnk->SetLinkSourceName( sCmd );
1438 break;
1440 {
1441 pLnk->SetContentType( SotClipboardFormatId::SIMPLE_FILE );
1442 sal_Int32 nIndex = 0;
1443 const OUString sFile(sCmd.getToken( 0, sfx2::cTokenSeparator, nIndex ));
1444 const OUString sFltr(sCmd.getToken( 0, sfx2::cTokenSeparator, nIndex ));
1445 const OUString sRange(sCmd.getToken( 0, sfx2::cTokenSeparator, nIndex ));
1448 sFile,
1449 ( !sFltr.isEmpty() ? &sFltr : nullptr ),
1450 ( !sRange.isEmpty() ? &sRange : nullptr ) );
1451 }
1452 break;
1453 default:
1454 OSL_ENSURE( false, "What kind of Link is this?" );
1455 }
1456
1457 switch( eCreateType )
1458 {
1459 case LinkCreateType::Connect: // Connect Link right away
1460 pLnk->Connect();
1461 break;
1462
1463 case LinkCreateType::Update: // Connect Link and update
1464 pLnk->Update();
1465 break;
1466 case LinkCreateType::NONE: break;
1467 }
1468}
1469
1471{
1472 const SectionType eCurrentType( GetType() );
1473 if ( eCurrentType == SectionType::Content ||
1474 eCurrentType == SectionType::ToxHeader ||
1475 eCurrentType == SectionType::ToxContent )
1476 {
1477 // nothing to do
1478 return;
1479 }
1480
1481 // Release link, if it exists
1482 if (m_RefLink.is())
1483 {
1484 SwSectionFormat *const pFormat( GetFormat() );
1485 OSL_ENSURE(pFormat, "SwSection::BreakLink: no format?");
1486 if (pFormat)
1487 {
1489 }
1490 m_RefLink.clear();
1491 }
1492 // change type
1494 // reset linked file data
1495 SetLinkFileName( OUString() );
1496 SetLinkFilePassword( OUString() );
1497}
1498
1500{
1501 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwSection"));
1502 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", this);
1503 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("registered-in"), "%p",
1504 GetRegisteredIn());
1505 m_Data.dumpAsXml(pWriter);
1506 (void)xmlTextWriterEndElement(pWriter);
1507}
1508
1509const SwNode* SwIntrnlSectRefLink::GetAnchor() const { return m_rSectFormat.GetSectionNode(); }
1510
1511bool SwIntrnlSectRefLink::IsInRange( SwNodeOffset nSttNd, SwNodeOffset nEndNd ) const
1512{
1513 SwStartNode* pSttNd = m_rSectFormat.GetSectionNode();
1514 return pSttNd &&
1515 nSttNd < pSttNd->GetIndex() &&
1516 pSttNd->EndOfSectionIndex() < nEndNd;
1517}
1518
1519/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@ CheckPosInFly
check if target position is in fly anchored at source range
@ ShowInsert
show all inserts
@ NONE
no RedlineFlags
virtual bool CopyRange(SwPaM &rPam, SwPosition &rPos, SwCopyFlags flags) const =0
Copy a selected content range to a position.
virtual void LockExpFields()=0
virtual bool IsExpFieldsLocked() const =0
virtual void UpdateExpFields(SwTextField *pField, bool bUpdateRefFields)=0
virtual void UnlockExpFields()=0
virtual const SwViewShell * GetCurrentViewShell() const =0
Returns the layout set at the document.
virtual ::sfx2::SvLinkSource * CreateLinkSource(const OUString &rItem)=0
virtual void SetVisibleLinks(bool bFlag)=0
virtual sfx2::LinkManager & GetLinkManager()=0
virtual void SetLinksUpdated(const bool bNewLinksUpdated)=0
virtual bool IsVisibleLinks() const =0
Insert links in-/visibly into LinkManager (linked ranges).
virtual void SetRedlineFlags(RedlineFlags eMode)=0
Set a new redline mode.
virtual RedlineFlags GetRedlineFlags() const =0
Query the currently set redline mode.
virtual void SetModified()=0
Must be called manually at changes of format.
virtual SwTextFormatColl * GetTextCollFromPool(sal_uInt16 nId, bool bRegardLanguage=true)=0
Return "Auto-Collection with ID.
void SetValue(bool const bTheValue)
bool GetValue() const
SfxHintId GetId() const
sal_uInt16 Count() const
void dumpAsXml(xmlTextWriterPtr pWriter) 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 & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
OUString GetBaseURL(bool bForSaving=false)
const OUString & GetName() const
SfxMedium * GetMedium() const
sal_uInt16 Which() const
static OUString GetFormatMimeType(SotClipboardFormatId nFormat)
static SotClipboardFormatId GetFormatIdFromMimeType(const OUString &rMimeType)
void EndListeningAll()
bool StartListening(SvtBroadcaster &rBroadcaster)
void SetContentProtect(bool bNew)
bool IsContentProtected() const
const SwAttrSet * GetChgSet() const
What has changed.
Definition: hints.hxx:343
const SwModify * GetRegisteredIn() const
Definition: calbck.hxx:166
std::optional< sw::ModifyChangedHint > CheckRegistration(const SfxPoolItem *pOldValue)
Definition: calbck.cxx:77
const SwAttrSet & GetSwAttrSet() const
Does node has already its own auto-attributes? Access to SwAttrSet.
Definition: node.hxx:765
bool Pop(PopMode, ::std::optional< SwCallLink > &roLink)
void Push()
store a copy of the current cursor on the cursor stack
Definition: crsrsh.cxx:2279
SwCursor * GetCursor(bool bMakeTableCursor=true) const
Return pointer to the current shell cursor.
Definition: crsrsh.cxx:194
SwDoc * GetDoc()
returns Doc. But be careful!
Definition: docsh.hxx:204
Definition: doc.hxx:195
::sw::DocumentLinksAdministrationManager const & GetDocumentLinksAdministrationManager() const
Definition: doc.cxx:278
SwSectionFormats & GetSections()
Definition: doc.hxx:1350
IDocumentState const & getIDocumentState() const
Definition: doc.cxx:402
bool IsInDtor() const
Definition: doc.hxx:415
void CorrAbs(const SwNode &rOldNode, const SwPosition &rNewPos, const sal_Int32 nOffset=0, bool bMoveCursor=false)
Definition: doccorr.cxx:171
bool IsClipBoard() const
Definition: doc.hxx:974
IDocumentLinksAdministration const & getIDocumentLinksAdministration() const
Definition: doc.cxx:268
IDocumentContentOperations const & getIDocumentContentOperations() const
Definition: doc.cxx:323
IDocumentUndoRedo & GetIDocumentUndoRedo()
Definition: doc.cxx:152
SwNodes & GetNodes()
Definition: doc.hxx:420
IDocumentFieldsAccess const & getIDocumentFieldsAccess() const
Definition: doc.cxx:365
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
Definition: doc.cxx:343
::sfx2::IXmlIdRegistry & GetXmlIdRegistry()
Definition: docnew.cxx:820
SwEditShell const * GetEditShell() const
Definition: doccorr.cxx:330
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
Definition: doc.cxx:413
SwFootnoteIdxs & GetFootnoteIdxs()
Definition: doc.hxx:645
void DelSectionFormat(SwSectionFormat *pFormat, bool bDelNodes=false)
Definition: ndsect.cxx:513
IDocumentStylePoolAccess const & getIDocumentStylePoolAccess() const
Definition: doc.cxx:434
::sw::DocumentContentOperationsManager const & GetDocumentContentOperationsManager() const
Definition: doc.cxx:333
void UpdateSection(size_t const nSect, SwSectionData &, SfxItemSet const *const =nullptr, bool const bPreventLinkUpdate=false)
Definition: ndsect.cxx:600
const SwFrameFormat * GetDfltFrameFormat() const
Definition: doc.hxx:758
SwDocShell * GetDocShell()
Definition: doc.hxx:1364
bool IsInHeaderFooter(const SwNode &) const
Definition: doclay.cxx:1566
void StartAllAction()
For all views of this document.
Definition: edws.cxx:86
void EndAllAction()
Definition: edws.cxx:97
void UpdateFootnote(const SwNode &rStt)
Definition: ftnidx.cxx:59
const SwNodeIndex * GetContentIdx() const
Definition: fmtcntnt.hxx:46
const SwDoc * GetDoc() const
The document is set in SwAttrPool now, therefore you always can access it.
Definition: format.hxx:139
virtual bool ResetFormatAttr(sal_uInt16 nWhich1, sal_uInt16 nWhich2=0)
Definition: format.cxx:618
const OUString & GetName() const
Definition: format.hxx:131
const SvxProtectItem & GetProtect(bool=true) const
Definition: frmatr.hxx:106
const SwFormatEditInReadonly & GetEditInReadonly(bool=true) const
Definition: fmteiro.hxx:48
const SwAttrSet & GetAttrSet() const
For querying the attribute array.
Definition: format.hxx:136
const SwFormatPageDesc & GetPageDesc(bool=true) const
Definition: fmtpdsc.hxx:78
SwFormat * DerivedFrom() const
Definition: format.hxx:128
const SfxPoolItem & GetFormatAttr(sal_uInt16 nWhich, bool bInParents=true) const
If bInParents is FALSE, search only in this format for attribute.
Definition: format.cxx:366
virtual bool SetFormatAttr(const SfxPoolItem &rAttr)
Definition: format.cxx:447
const SwFormatContent & GetContent(bool=true) const
Definition: fmtcntnt.hxx:55
void RemoveAllUnos()
Definition: format.cxx:757
virtual SwSectionFormat * GetFormat(size_t idx) const override
Definition: docary.hxx:158
Style of a layout element.
Definition: frmfmt.hxx:62
void RegisterToFormat(SwFormat &rFormat)
Definition: atrfrm.cxx:2735
virtual void SwClientNotify(const SwModify &, const SfxHint &) override
Definition: atrfrm.cxx:2635
Base class of the Writer layout elements.
Definition: frame.hxx:315
TElementType * Next()
Definition: calbck.hxx:380
TElementType * First()
Definition: calbck.hxx:372
Marks a node in the document model.
Definition: ndindex.hxx:31
const SwNodes & GetNodes() const
Definition: ndindex.hxx:119
SwNode & GetNode() const
Definition: ndindex.hxx:123
SwNodeOffset GetIndex() const
Definition: ndindex.hxx:111
Base class of the Writer document model elements.
Definition: node.hxx:98
SwSectionNode * GetSectionNode()
Definition: node.hxx:658
SwNodeOffset GetIndex() const
Definition: node.hxx:312
SwNodes & GetNodes()
Node is in which nodes-array/doc?
Definition: node.hxx:744
SwDoc & GetDoc()
Definition: node.hxx:233
bool IsSectionNode() const
Definition: node.hxx:695
SwTableNode * FindTableNode()
Search table node, in which it is.
Definition: node.cxx:380
SwSectionNode * FindSectionNode()
Search section node, in which it is.
Definition: ndsect.cxx:974
const SwStartNode * StartOfSectionNode() const
Definition: node.hxx:153
SwNodeOffset EndOfSectionIndex() const
Definition: node.hxx:728
const SwEndNode * EndOfSectionNode() const
Definition: node.hxx:733
SwNode & GetEndOfExtras() const
This is the last EndNode of a special section.
Definition: ndarr.hxx:163
SwTextNode * MakeTextNode(SwNode &rWhere, SwTextFormatColl *pColl, bool bNewFrames=true)
Implementations of "Make...Node" are in the given .cxx-files.
Definition: ndtxt.cxx:121
void SectionUp(SwNodeRange *)
increase level of the given range
Definition: nodes.cxx:960
SwNode & GetEndOfContent() const
Regular ContentSection (i.e. the BodyText).
Definition: ndarr.hxx:165
void Delete(const SwNodeIndex &rPos, SwNodeOffset nNodes=SwNodeOffset(1))
Definition: nodes.cxx:1070
SwContentNode * GoNextSection(SwNodeIndex *, bool bSkipHidden=true, bool bSkipProtect=true) const
Go to next content-node that is not protected or hidden (Both set FALSE ==> GoNext/GoPrevious!...
Definition: nodes.cxx:1948
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:187
virtual void SetMark()
Unless this is called, the getter method of Mark will return Point.
Definition: pam.cxx:642
bool Move(SwMoveFnCollection const &fnMove=fnMoveForward, SwGoInDoc fnGo=GoInContent)
Movement of cursor.
Definition: pam.cxx:668
const SwPosition * End() const
Definition: pam.hxx:271
const SwPosition * GetPoint() const
Definition: pam.hxx:261
const SwPosition * Start() const
Definition: pam.hxx:266
OUString m_sLinkFileName
Definition: section.hxx:67
bool IsEditInReadonlyFlag() const
Definition: section.hxx:107
bool m_bProtectFlag
Flags that correspond to attributes in the format: may have different value than format attribute: fo...
Definition: section.hxx:77
void SetHidden(bool const bFlag)
Definition: section.hxx:99
void dumpAsXml(xmlTextWriterPtr pWriter) const
Definition: section.cxx:180
SAL_DLLPRIVATE void SetProtectFlag(bool const bFlag)
Definition: section.hxx:106
void SetEditInReadonlyFlag(bool const bFlag)
Definition: section.hxx:108
void SetCondHidden(bool const bFlag)
Definition: section.hxx:111
SectionType m_eType
Definition: section.hxx:63
bool IsProtectFlag() const
Definition: section.hxx:104
bool operator==(SwSectionData const &) const
Definition: section.cxx:166
OUString m_sLinkFilePassword
Definition: section.hxx:68
OUString m_sSectionName
Definition: section.hxx:65
SectionType GetType() const
Definition: section.hxx:95
css::uno::Sequence< sal_Int8 > m_Password
Definition: section.hxx:69
bool m_bCondHiddenFlag
Hide condition evaluated ‘true’.
Definition: section.hxx:82
SwSectionData & operator=(SwSectionData const &)
Definition: section.cxx:144
void SetLinkFileName(OUString const &rNew)
Definition: section.hxx:118
bool m_bConnectFlag
Definition: section.hxx:83
SAL_DLLPRIVATE void SetHiddenFlag(bool const bFlag)
Definition: section.hxx:103
bool IsHidden() const
Definition: section.hxx:98
SwSectionData(SectionType const eType, OUString aName)
Definition: section.cxx:95
const OUString & GetLinkFileName() const
Definition: section.hxx:117
OUString m_sCondition
Hide condition.
Definition: section.hxx:66
bool IsCondHidden() const
Definition: section.hxx:112
bool IsHiddenFlag() const
Definition: section.hxx:101
bool m_bEditInReadonlyFlag
Definition: section.hxx:79
bool m_bHidden
Section is hidden, unless condition evaluates ‘false’.
Definition: section.hxx:81
virtual bool IsInUndo() const override
Definition: section.cxx:964
virtual css::uno::Reference< css::rdf::XMetadatable > MakeUnoObject() override
Definition: section.cxx:982
SwSection * GetSection() const
Definition: section.cxx:646
virtual bool IsInClipboard() const override
Definition: section.cxx:959
virtual ~SwSectionFormat() override
Definition: section.cxx:607
unotools::WeakReference< SwXTextSection > m_wXTextSection
Why does this exist in addition to the m_wXObject in SwFrameFormat? in case of an index,...
Definition: section.hxx:283
virtual void DelFrames() override
Destroys all Frames in aDepend (Frames are identified via dynamic_cast).
Definition: section.cxx:652
virtual void SwClientNotify(const SwModify &, const SfxHint &) override
Definition: section.cxx:706
SAL_DLLPRIVATE void SetXTextSection(rtl::Reference< SwXTextSection > const &xTextSection)
Definition: section.cxx:808
SAL_DLLPRIVATE void UpdateParent()
Definition: section.cxx:900
void GetChildSections(SwSections &rArr, SectionSort eSort=SectionSort::Not, bool bAllSections=true) const
Definition: section.cxx:861
virtual bool IsInContent() const override
Definition: section.cxx:969
virtual ::sfx2::IXmlIdRegistry & GetRegistry() override
Definition: section.cxx:954
virtual bool supportsFullDrawingLayerFillAttributeSet() const override
Definition: section.cxx:994
virtual bool GetInfo(SfxPoolItem &) const override
Definition: section.cxx:814
virtual void MakeFrames() override
Creates the views.
Definition: section.cxx:693
void dumpAsXml(xmlTextWriterPtr pWriter) const
Definition: section.cxx:999
SwSection * GetParentSection() const
Definition: section.hxx:366
SwSectionNode * GetSectionNode()
Definition: section.cxx:931
const SwSection * GetGlobalDocSection() const
Definition: section.cxx:940
SwSectionFormat(SwFrameFormat *pDrvdFrame, SwDoc *pDoc)
Definition: section.cxx:599
bool IsInNodesArr() const
Definition: section.cxx:893
Array of Undo-history.
Definition: docary.hxx:192
void dumpAsXml(xmlTextWriterPtr pWriter) const
Definition: section.cxx:1008
A section node represents the start of a section on the UI, i.e.
Definition: node.hxx:575
const SwSection & GetSection() const
Definition: node.hxx:590
void MakeOwnFrames(SwNodeIndex *pIdxBehind, SwNodeIndex *pEnd=nullptr)
Creates the frms for the SectionNode (i.e.
Definition: ndsect.cxx:1162
tools::SvRef< SwServerObject > m_RefObj
Definition: section.hxx:151
bool IsEditInReadonly() const
Definition: section.cxx:344
void SetLinkFileName(OUString const &rNew)
Definition: section.cxx:557
OUString const & GetLinkFileName() const
Definition: section.cxx:519
bool IsProtectFlag() const
Definition: section.hxx:191
bool IsHiddenFlag() const
Definition: section.hxx:190
const SwTOXBase * GetTOXBase() const
Definition: section.cxx:591
bool IsHidden() const
Definition: section.hxx:181
SwSection * GetParent() const
Definition: section.hxx:349
SwSectionData m_Data
Definition: section.hxx:149
void SetSectionData(SwSectionData const &rData)
Definition: section.cxx:254
void SetCondHidden(bool const bFlag)
Definition: section.cxx:509
SwSection(SectionType const eType, OUString const &rName, SwSectionFormat &rFormat)
Definition: section.cxx:188
SwSectionFormat * GetFormat()
Definition: section.hxx:339
void SetEditInReadonly(bool const bFlag=true)
Definition: section.cxx:380
tools::SvRef< sfx2::SvBaseLink > m_RefLink
Definition: section.hxx:152
void SetType(SectionType const eType)
Definition: section.hxx:174
void SetLinkFilePassword(OUString const &rS)
Definition: section.hxx:209
SAL_DLLPRIVATE void ImplSetHiddenFlag(bool const bHidden, bool const bCondition)
Definition: section.cxx:283
const ::sfx2::SvBaseLink & GetBaseLink() const
Definition: section.hxx:231
virtual ~SwSection() override
Definition: section.cxx:210
bool IsProtect() const
Definition: section.cxx:334
void SetHidden(bool const bFlag=true)
Definition: section.cxx:353
OUString const & GetLinkFilePassword() const
Definition: section.hxx:207
SectionType GetType() const
Definition: section.hxx:173
bool IsCondHidden() const
Definition: section.hxx:195
bool IsConnected() const
Definition: section.hxx:227
virtual void Notify(SfxHint const &rHint) override
Definition: section.cxx:402
void dumpAsXml(xmlTextWriterPtr pWriter) const
Definition: section.cxx:1499
bool IsEditInReadonlyFlag() const
Definition: section.hxx:192
void SetRefObject(SwServerObject *pObj)
Definition: section.cxx:504
virtual void SwClientNotify(const SwModify &, const SfxHint &) override
Definition: section.cxx:397
bool CalcHiddenFlag() const
Definition: section.cxx:323
bool DataEquals(SwSectionData const &rCmp) const
Definition: section.cxx:268
void SetProtect(bool const bFlag=true)
Definition: section.cxx:362
void SetConnectFlag(bool const bFlag=true)
Definition: section.hxx:242
void BreakLink()
Definition: section.cxx:1470
static void MakeChildLinksVisible(const SwSectionNode &rSectNd)
Definition: section.cxx:567
void CreateLink(LinkCreateType eType)
Definition: section.cxx:1407
Starts a section of nodes in the document model.
Definition: node.hxx:348
void StartAction()
Definition: viewsh.hxx:603
void EndAction(const bool bIdleEnd=false)
Definition: viewsh.hxx:608
static rtl::Reference< SwXTextSection > CreateXTextSection(SwSectionFormat *const pFormat, const bool bIndexHeader=false)
Definition: unosect.cxx:194
void InsertFileLink(sfx2::SvBaseLink &, SvBaseLinkObjectType nFileType, std::u16string_view rFileNm, const OUString *pFilterNm=nullptr, const OUString *pRange=nullptr)
static bool GetDisplayNames(const SvBaseLink *, OUString *pType, OUString *pFile=nullptr, OUString *pLink=nullptr, OUString *pFilter=nullptr)
void InsertDDELink(SvBaseLink *, const OUString &rServer, std::u16string_view rTopic, std::u16string_view rItem)
void UpdateAllLinks(bool bAskUpdate, bool bUpdateGrfLinks, weld::Window *pParentWin)
void RemoveServer(SvLinkSource *rObj)
static SotClipboardFormatId RegisterStatusInfoId()
void Remove(SvBaseLink const *pLink)
const SvBaseLinks & GetLinks() const
void CopyWithFlyInFly(const SwNodeRange &rRg, SwNode &rInsPos, const std::pair< const SwPaM &, const SwPosition & > *pCopiedPaM=nullptr, bool bMakeNewFrames=true, bool bDelRedlines=true, bool bCopyFlyAtFly=false, SwCopyFlags flags=SwCopyFlags::Default) const
note: rRg/rInsPos exclude a partially selected start text node; pCopiedPaM includes a partially selec...
bool SelectServerObj(std::u16string_view rStr, SwPaM *&rpPam, std::optional< SwNodeRange > &rpRange) const
T * get() const
bool is() const
struct _xmlTextWriter * xmlTextWriterPtr
void DelBookmarks(SwNode &rStt, const SwNode &rEnd, std::vector< SaveBookmark > *pSaveBkmk, std::optional< sal_Int32 > oStartContentIdx, std::optional< sal_Int32 > oEndContentIdx)
Definition: docbm.cxx:2004
void DelFlyInRange(SwNode &rMkNd, SwNode &rPtNd, std::optional< sal_Int32 > oMkContentIdx, std::optional< sal_Int32 > oPtContentIdx)
Delete and move all Flys at the paragraph, that are within the selection.
Definition: docedt.cxx:208
int SwFindDocShell(SfxObjectShellRef &xDocSh, SfxObjectShellLock &xLockRef, std::u16string_view rFileName, const OUString &rPasswd, const OUString &rFilter, sal_Int16 nVersion, SwDocShell *pDestSh)
Find the right DocShell and create a new one: The return value specifies what should happen to the Sh...
Definition: docsh2.cxx:1702
EmbeddedObjectRef * pObject
const EnumerationType m_eType
constexpr OUStringLiteral IsHidden(u"IsHidden")
Reader * ReadAscii
Definition: fltini.cxx:46
DocumentType eType
SotClipboardFormatId
void MakeFrames(SwDoc *pDoc, SwNode &rSttIdx, SwNode &rEndIdx)
Definition: frmtool.cxx:2017
constexpr TypedWhichId< SwPtrMsgPoolItem > RES_REMOVE_UNO_OBJECT(181)
constexpr TypedWhichId< SwFormatEndAtTextEnd > RES_END_AT_TXTEND(124)
constexpr TypedWhichId< SwFormatFootnoteAtTextEnd > RES_FTN_AT_TXTEND(123)
constexpr TypedWhichId< SwFindNearestNode > RES_FINDNEARESTNODE(184)
constexpr TypedWhichId< SwFormatCol > RES_COL(115)
constexpr TypedWhichId< SwFormatEditInReadonly > RES_EDIT_IN_READONLY(118)
constexpr TypedWhichId< SwFormatPageDesc > RES_PAGEDESC(99)
constexpr TypedWhichId< SwAttrSetChg > RES_ATTRSET_CHG(169)
constexpr TypedWhichId< SvxProtectItem > RES_PROTECT(106)
constexpr TypedWhichId< SwPtrMsgPoolItem > RES_CONTENT_VISIBLE(185)
constexpr TypedWhichId< SwFormatContent > RES_CNTNT(101)
constexpr TypedWhichId< SwPtrMsgPoolItem > RES_OBJECTDYING(RES_FORMAT_MSG_BEGIN)
constexpr TypedWhichId< SwFormatChg > RES_FMT_CHG(168)
const SfxPoolItem * GetDfltAttr(sal_uInt16 nWhich)
Get the default attribute from corresponding default attribute table.
Definition: hints.cxx:148
sal_Int32 nIndex
OUString aName
sal_Int64 n
Sequence< sal_Int8 > aSeq
SfxLinkUpdateMode
const char * sName
Reader * GetRtfReader()
Definition: fltini.cxx:149
int i
Count
const sal_Unicode cTokenSeparator
SvBaseLinkObjectType
void sw_DeleteFootnote(SwSectionNode *pNd, SwNodeOffset nStt, SwNodeOffset nEnd)
Definition: ndsect.cxx:740
o3tl::strong_int< sal_Int32, struct Tag_SwNodeOffset > SwNodeOffset
Definition: nodeoffset.hxx:16
const char GetValue[]
bool GoInNode(SwPaM &rPam, SwMoveFnCollection const &fnMove)
Definition: pam.cxx:1171
SwMoveFnCollection const & fnMoveBackward
Definition: paminit.cxx:60
@ RES_POOLCOLL_TEXT
Text body.
Definition: poolfmt.hxx:251
static void lcl_BreakSectionLinksInSect(const SwSectionNode &rSectNd)
Definition: section.cxx:1017
static void lcl_UpdateLinksInSect(const SwBaseLink &rUpdLnk, SwSectionNode &rSectNd)
Definition: section.cxx:1047
static bool lcl_SectionCmpPos(const SwSection *pFirst, const SwSection *pSecond)
Definition: section.cxx:848
SectionType
Definition: section.hxx:46
SectionSort
Definition: section.hxx:271
LinkCreateType
Definition: section.hxx:54
std::vector< SwSection * > SwSections
Definition: section.hxx:42
Marks a position in the document model.
Definition: pam.hxx:37
SwNode & GetNode() const
Definition: pam.hxx:80
sal_uInt16 GetWhich() const
Definition: calbck.hxx:75
const SfxPoolItem * m_pOld
Definition: calbck.hxx:77
bool hasValue()
bool IsInRange(const WhichRangesContainer &pRange, const sal_uInt16 nId)
check if ID is in range of attribute set IDs
Definition: swatrset.cxx:451
signed char sal_Int8