LibreOffice Module sw (master) 1
unosect.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include <memory>
21#include <unosection.hxx>
22
23#include <com/sun/star/beans/PropertyAttribute.hpp>
24#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
25#include <com/sun/star/text/SectionFileLink.hpp>
26
30
31#include <cmdid.h>
32#include <hintids.hxx>
33#include <svl/urihelper.hxx>
34#include <svl/listener.hxx>
35#include <editeng/brushitem.hxx>
36#include <editeng/xmlcnitm.hxx>
37#include <sfx2/linkmgr.hxx>
38#include <sfx2/lnkbase.hxx>
39#include <osl/diagnose.h>
40#include <vcl/svapp.hxx>
41#include <fmtclds.hxx>
42#include <unotextrange.hxx>
43#include <TextCursorHelper.hxx>
44#include <unoport.hxx>
45#include <redline.hxx>
46#include <unomap.hxx>
47#include <section.hxx>
48#include <doc.hxx>
50#include <IDocumentUndoRedo.hxx>
51#include <docsh.hxx>
52#include <sfx2/docfile.hxx>
53#include <docary.hxx>
54#include <swundo.hxx>
55#include <tox.hxx>
56#include <unoidx.hxx>
57#include <doctxm.hxx>
58#include <fmtftntx.hxx>
59#include <fmtclbl.hxx>
61#include <fmtcntnt.hxx>
62#include <editeng/lrspitem.hxx>
64#include <comphelper/string.hxx>
65#include <o3tl/string_view.hxx>
66
67using namespace ::com::sun::star;
68
69namespace {
70
71struct SwTextSectionProperties_Impl
72{
73 uno::Sequence<sal_Int8> m_Password;
74 OUString m_sCondition;
75 OUString m_sLinkFileName;
76 OUString m_sSectionFilter;
77 OUString m_sSectionRegion;
78
79 std::unique_ptr<SwFormatCol> m_pColItem;
80 std::unique_ptr<SvxBrushItem> m_pBrushItem;
81 std::unique_ptr<SwFormatFootnoteAtTextEnd> m_pFootnoteItem;
82 std::unique_ptr<SwFormatEndAtTextEnd> m_pEndItem;
83 std::unique_ptr<SvXMLAttrContainerItem> m_pXMLAttr;
84 std::unique_ptr<SwFormatNoBalancedColumns> m_pNoBalanceItem;
85 std::unique_ptr<SvxFrameDirectionItem> m_pFrameDirItem;
86 std::unique_ptr<SvxLRSpaceItem> m_pLRSpaceItem;
87
88 bool m_bDDE;
89 bool m_bHidden;
90 bool m_bCondHidden;
91 bool m_bProtect;
92 bool m_bEditInReadonly;
93 bool m_bUpdateType;
94
95 SwTextSectionProperties_Impl()
96 : m_bDDE(false)
97 , m_bHidden(false)
98 , m_bCondHidden(false)
99 , m_bProtect(false)
100 , m_bEditInReadonly(false)
101 , m_bUpdateType(true)
102 {
103 }
104
105};
106
107}
108
110 : public SvtListener
111{
112public:
116 std::mutex m_Mutex; // just for OInterfaceContainerHelper4
118 const bool m_bIndexHeader;
120 OUString m_sName;
121 std::unique_ptr<SwTextSectionProperties_Impl> m_pProps;
123
125 SwSectionFormat* const pFormat, const bool bIndexHeader)
126 : m_rThis(rThis)
128 , m_bIndexHeader(bIndexHeader)
129 , m_bIsDescriptor(nullptr == pFormat)
130 , m_pProps(pFormat ? nullptr : new SwTextSectionProperties_Impl())
131 , m_pFormat(pFormat)
132 {
133 if(m_pFormat)
134 StartListening(m_pFormat->GetNotifier());
135 }
136
137 void Attach(SwSectionFormat* pFormat)
138 {
140 StartListening(pFormat->GetNotifier());
141 m_pFormat = pFormat;
142 }
143
145 { return m_pFormat; }
146
148 SwSectionFormat *const pFormat( GetSectionFormat() );
149 if (!pFormat) {
150 throw uno::RuntimeException("SwXTextSection: disposed or invalid", nullptr);
151 }
152 return *pFormat;
153 }
154
161 const uno::Sequence< OUString >& rPropertyNames,
162 const uno::Sequence< uno::Any >& aValues);
166 uno::Sequence< uno::Any >
168 const uno::Sequence< OUString >& rPropertyNames);
169 virtual void Notify(const SfxHint& rHint) override;
170};
171
173{
174 if(rHint.GetId() == SfxHintId::Dying)
175 {
176 m_pFormat = nullptr;
177 uno::Reference<uno::XInterface> const xThis(m_wThis);
178 if (!xThis.is())
179 { // fdo#72695: if UNO object is already dead, don't revive it with event
180 return;
181 }
182 lang::EventObject const ev(xThis);
183 std::unique_lock aGuard(m_Mutex);
185 }
186}
187
189{
190 return m_pImpl->GetSectionFormat();
191}
192
195 SwSectionFormat *const pFormat, const bool bIndexHeader)
196{
197 // re-use existing SwXTextSection
198 // #i105557#: do not iterate over the registered clients: race condition
200 if (pFormat)
201 {
202 xSection = pFormat->GetXTextSection();
203 }
204 if ( !xSection.is() )
205 {
206 rtl::Reference<SwXTextSection> pNew = new SwXTextSection(pFormat, bIndexHeader);
207 xSection = pNew;
208 if (pFormat)
209 {
210 pFormat->SetXTextSection(xSection);
211 }
212 // need a permanent Reference to initialize m_wThis
213 pNew->m_pImpl->m_wThis = xSection.get();
214 }
215 return xSection;
216}
217
219 SwSectionFormat *const pFormat, const bool bIndexHeader)
220 : m_pImpl( new SwXTextSection::Impl(*this, pFormat, bIndexHeader) )
221{
222}
223
225{
226}
227
228uno::Reference< text::XTextSection > SAL_CALL
230{
231 SolarMutexGuard aGuard;
232
233 SwSectionFormat & rSectionFormat( m_pImpl->GetSectionFormatOrThrow() );
234
235 SwSectionFormat *const pParentFormat = rSectionFormat.GetParent();
236 const uno::Reference< text::XTextSection > xRet =
237 pParentFormat ? CreateXTextSection(pParentFormat) : nullptr;
238 return xRet;
239}
240
241uno::Sequence< uno::Reference< text::XTextSection > > SAL_CALL
243{
244 SolarMutexGuard aGuard;
245
246 SwSectionFormat & rSectionFormat( m_pImpl->GetSectionFormatOrThrow() );
247
248 SwSections aChildren;
249 rSectionFormat.GetChildSections(aChildren, SectionSort::Not, false);
250 uno::Sequence<uno::Reference<text::XTextSection> > aSeq(aChildren.size());
251 uno::Reference< text::XTextSection > * pArray = aSeq.getArray();
252 for (size_t i = 0; i < aChildren.size(); ++i)
253 {
254 SwSectionFormat *const pChild = aChildren[i]->GetFormat();
255 pArray[i] = CreateXTextSection(pChild);
256 }
257 return aSeq;
258}
259
260void SAL_CALL
261SwXTextSection::attach(const uno::Reference< text::XTextRange > & xTextRange)
262{
264
265 if (!m_pImpl->m_bIsDescriptor)
266 {
267 throw uno::RuntimeException();
268 }
269
270 SwXTextRange* pRange = dynamic_cast<SwXTextRange*>(xTextRange.get());
271 OTextCursorHelper* pCursor = dynamic_cast<OTextCursorHelper*>(xTextRange.get());
272
273 SwDoc *const pDoc =
274 pRange ? &pRange->GetDoc() : (pCursor ? pCursor->GetDoc() : nullptr);
275 if (!pDoc)
276 {
277 throw lang::IllegalArgumentException();
278 }
279
280 SwUnoInternalPaM aPam(*pDoc);
281 // this has to return true now
282 ::sw::XTextRangeToSwPaM(aPam, xTextRange);
283 UnoActionContext aCont(pDoc);
284 pDoc->GetIDocumentUndoRedo().StartUndo( SwUndoId::INSSECTION, nullptr );
285
286 if (m_pImpl->m_sName.isEmpty())
287 {
288 m_pImpl->m_sName = "TextSection";
289 }
291 if( m_pImpl->m_pProps->m_bDDE )
293 else if( m_pImpl->m_pProps->m_sLinkFileName.isEmpty() && m_pImpl->m_pProps->m_sSectionRegion.isEmpty() )
295 // index header section?
296 if (m_pImpl->m_bIndexHeader)
297 {
298 // caller wants an index header section, but will only
299 // give him one if a) we are inside an index, and b) said
300 // index doesn't yet have a header section.
301 const SwTOXBase* pBase = SwDoc::GetCurTOX(*aPam.Start());
302
303 // are we inside an index?
304 if (pBase)
305 {
306 // get all child sections
307 SwSections aSectionsArr;
308 static_cast<const SwTOXBaseSection*>(pBase)->GetFormat()->
309 GetChildSections(aSectionsArr);
310
311 // and search for current header section
312 const size_t nCount = aSectionsArr.size();
313 bool bHeaderPresent = false;
314 for(size_t i = 0; i < nCount; ++i)
315 {
316 if (aSectionsArr[i]->GetType() == SectionType::ToxHeader)
317 bHeaderPresent = true;
318 }
319 if (! bHeaderPresent)
320 {
322 }
323 }
324 }
325
326 SwSectionData aSect(eType, pDoc->GetUniqueSectionName(&m_pImpl->m_sName));
327 aSect.SetCondition(m_pImpl->m_pProps->m_sCondition);
328 aSect.SetLinkFileName(m_pImpl->m_pProps->m_sLinkFileName +
329 OUStringChar(sfx2::cTokenSeparator) +
330 m_pImpl->m_pProps->m_sSectionFilter +
331 OUStringChar(sfx2::cTokenSeparator) +
332 m_pImpl->m_pProps->m_sSectionRegion);
333
334 aSect.SetHidden(m_pImpl->m_pProps->m_bHidden);
335 aSect.SetProtectFlag(m_pImpl->m_pProps->m_bProtect);
336 aSect.SetEditInReadonlyFlag(m_pImpl->m_pProps->m_bEditInReadonly);
337
344 aSet(pDoc->GetAttrPool());
345 if (m_pImpl->m_pProps->m_pBrushItem)
346 {
347 aSet.Put(*m_pImpl->m_pProps->m_pBrushItem);
348 }
349 if (m_pImpl->m_pProps->m_pColItem)
350 {
351 aSet.Put(*m_pImpl->m_pProps->m_pColItem);
352 }
353 if (m_pImpl->m_pProps->m_pFootnoteItem)
354 {
355 aSet.Put(*m_pImpl->m_pProps->m_pFootnoteItem);
356 }
357 if (m_pImpl->m_pProps->m_pEndItem)
358 {
359 aSet.Put(*m_pImpl->m_pProps->m_pEndItem);
360 }
361 if (m_pImpl->m_pProps->m_pXMLAttr)
362 {
363 aSet.Put(*m_pImpl->m_pProps->m_pXMLAttr);
364 }
365 if (m_pImpl->m_pProps->m_pNoBalanceItem)
366 {
367 aSet.Put(*m_pImpl->m_pProps->m_pNoBalanceItem);
368 }
369 if (m_pImpl->m_pProps->m_pFrameDirItem)
370 {
371 aSet.Put(*m_pImpl->m_pProps->m_pFrameDirItem);
372 }
373 if (m_pImpl->m_pProps->m_pLRSpaceItem)
374 {
375 aSet.Put(*m_pImpl->m_pProps->m_pLRSpaceItem);
376 }
377 // section password
378 if (m_pImpl->m_pProps->m_Password.hasElements())
379 {
380 aSect.SetPassword(m_pImpl->m_pProps->m_Password);
381 }
382
383 SwSection *const pRet =
384 pDoc->InsertSwSection( aPam, aSect, nullptr, aSet.Count() ? &aSet : nullptr );
385 if (!pRet) // fdo#42450 text range could partially overlap existing section
386 {
387 // shouldn't have created an undo object yet
388 pDoc->GetIDocumentUndoRedo().EndUndo( SwUndoId::INSSECTION, nullptr );
389 throw lang::IllegalArgumentException(
390 "SwXTextSection::attach(): invalid TextRange",
391 static_cast< ::cppu::OWeakObject*>(this), 0);
392 }
393 m_pImpl->Attach(pRet->GetFormat());
394 pRet->GetFormat()->SetXObject(static_cast< ::cppu::OWeakObject*>(this));
395
396 // XML import must hide sections depending on their old
397 // condition status
398 if (!m_pImpl->m_pProps->m_sCondition.isEmpty())
399 {
400 pRet->SetCondHidden(m_pImpl->m_pProps->m_bCondHidden);
401 }
402
403 // set update type if DDE link (and connect, if necessary)
404 if (m_pImpl->m_pProps->m_bDDE)
405 {
406 if (! pRet->IsConnected())
407 {
409 }
410 pRet->SetUpdateType( m_pImpl->m_pProps->m_bUpdateType ?
411 SfxLinkUpdateMode::ALWAYS : SfxLinkUpdateMode::ONCALL );
412 }
413
414 // end the Undo bracketing here
415 pDoc->GetIDocumentUndoRedo().EndUndo( SwUndoId::INSSECTION, nullptr );
416 m_pImpl->m_pProps.reset();
417 m_pImpl->m_bIsDescriptor = false;
418}
419
420uno::Reference< text::XTextRange > SAL_CALL
422{
423 SolarMutexGuard aGuard;
424
426 SwSectionFormat *const pSectFormat = m_pImpl->GetSectionFormat();
427 if(pSectFormat)
428 {
429 const SwNodeIndex* pIdx;
430 if( nullptr != ( pSectFormat->GetSection() ) &&
431 nullptr != ( pIdx = pSectFormat->GetContent().GetContentIdx() ) &&
432 pIdx->GetNode().GetNodes().IsDocNodes() )
433 {
434 bool isMoveIntoTable(false);
435 SwPaM aPaM(*pIdx);
437 assert(pIdx->GetNode().IsSectionNode());
438 if (aPaM.GetPoint()->GetNode().FindTableNode() != pIdx->GetNode().FindTableNode()
439 || aPaM.GetPoint()->GetNode().FindSectionNode() != &pIdx->GetNode())
440 {
441 isMoveIntoTable = true;
442 }
443
444 const SwEndNode* pEndNode = pIdx->GetNode().EndOfSectionNode();
445 SwPaM aEnd(*pEndNode);
447 if (aEnd.GetPoint()->GetNode().FindTableNode() != pIdx->GetNode().FindTableNode()
448 || aEnd.GetPoint()->GetNode().FindSectionNode() != &pIdx->GetNode())
449 {
450 isMoveIntoTable = true;
451 }
452 if (isMoveIntoTable)
453 {
454 uno::Reference<text::XText> const xParentText(
455 ::sw::CreateParentXText(*pSectFormat->GetDoc(), SwPosition(*pIdx)));
456 xRet = new SwXTextRange(*pSectFormat);
457 }
458 else // for compatibility, keep the old way in this case
459 {
460 xRet = SwXTextRange::CreateXTextRange(*pSectFormat->GetDoc(),
461 *aPaM.Start(), aEnd.Start());
462 }
463 }
464 }
465 return xRet;
466}
467
469{
470 SolarMutexGuard aGuard;
471
472 SwSectionFormat *const pSectFormat = m_pImpl->GetSectionFormat();
473 if (pSectFormat)
474 {
475 pSectFormat->GetDoc()->DelSectionFormat( pSectFormat );
476 }
477}
478
480 const uno::Reference< lang::XEventListener > & xListener)
481{
482 // no need to lock here as m_pImpl is const and container threadsafe
483 std::unique_lock aGuard(m_pImpl->m_Mutex);
484 m_pImpl->m_EventListeners.addInterface(aGuard, xListener);
485}
486
488 const uno::Reference< lang::XEventListener > & xListener)
489{
490 // no need to lock here as m_pImpl is const and container threadsafe
491 std::unique_lock aGuard(m_pImpl->m_Mutex);
492 m_pImpl->m_EventListeners.removeInterface(aGuard, xListener);
493}
494
495uno::Reference< beans::XPropertySetInfo > SAL_CALL
497{
499 return m_pImpl->m_rPropSet.getPropertySetInfo();
500}
501
502static void
503lcl_UpdateLinkType(SwSection & rSection, bool const bLinkUpdateAlways)
504{
505 if (rSection.GetType() == SectionType::DdeLink)
506 {
507 // set update type; needs an established link
508 if (!rSection.IsConnected())
509 {
511 }
512 rSection.SetUpdateType( bLinkUpdateAlways
513 ? SfxLinkUpdateMode::ALWAYS : SfxLinkUpdateMode::ONCALL );
514 }
515}
516
517static void
519 std::unique_ptr<SwSectionData> const& pSectionData,
520 std::optional<SfxItemSet> const& oItemSet,
521 bool const bLinkModeChanged, bool const bLinkUpdateAlways = true)
522{
523 if (!pFormat)
524 return;
525
526 SwSection & rSection = *pFormat->GetSection();
527 SwDoc *const pDoc = pFormat->GetDoc();
528 SwSectionFormats const& rFormats = pDoc->GetSections();
529 UnoActionContext aContext(pDoc);
530 for (size_t i = 0; i < rFormats.size(); ++i)
531 {
532 if (rFormats[i]->GetSection()->GetSectionName()
533 == rSection.GetSectionName())
534 {
535 pDoc->UpdateSection(i, *pSectionData, oItemSet ? &*oItemSet : nullptr,
536 pDoc->IsInReading());
537 {
538 // temporarily remove actions to allow cursor update
539 // TODO: why? no table cursor here!
540 UnoActionRemoveContext aRemoveContext( pDoc );
541 }
542
543 if (bLinkModeChanged)
544 {
545 lcl_UpdateLinkType(rSection, bLinkUpdateAlways);
546 }
547 // section found and processed: break from loop
548 break;
549 }
550 }
551}
552
554 const uno::Sequence< OUString >& rPropertyNames,
555 const uno::Sequence< uno::Any >& rValues)
556{
557 if(rPropertyNames.getLength() != rValues.getLength())
558 {
559 throw lang::IllegalArgumentException();
560 }
561 SwSectionFormat *const pFormat = GetSectionFormat();
562 if (!pFormat && !m_bIsDescriptor)
563 {
564 throw uno::RuntimeException();
565 }
566
567 std::unique_ptr<SwSectionData> const pSectionData(
568 pFormat ? new SwSectionData(*pFormat->GetSection()) : nullptr);
569
570 OUString const*const pPropertyNames = rPropertyNames.getConstArray();
571 uno::Any const*const pValues = rValues.getConstArray();
572 std::optional<SfxItemSet> oItemSet;
573 bool bLinkModeChanged = false;
574 bool bLinkMode = false;
575
576 for (sal_Int32 nProperty = 0; nProperty < rPropertyNames.getLength();
577 nProperty++)
578 {
579 SfxItemPropertyMapEntry const*const pEntry =
580 m_rPropSet.getPropertyMap().getByName(pPropertyNames[nProperty]);
581 if (!pEntry)
582 {
583 throw beans::UnknownPropertyException(
584 "Unknown property: " + pPropertyNames[nProperty],
585 static_cast<cppu::OWeakObject *>(& m_rThis));
586 }
587 if (pEntry->nFlags & beans::PropertyAttribute::READONLY)
588 {
589 throw beans::PropertyVetoException(
590 "Property is read-only: " + pPropertyNames[nProperty],
591 static_cast<cppu::OWeakObject *>(& m_rThis));
592 }
593 switch (pEntry->nWID)
594 {
596 {
597 OUString uTmp;
598 pValues[nProperty] >>= uTmp;
599 if (m_bIsDescriptor)
600 {
601 m_pProps->m_sCondition = uTmp;
602 }
603 else
604 {
605 pSectionData->SetCondition(uTmp);
606 }
607 }
608 break;
612 {
613 OUString sTmp;
614 pValues[nProperty] >>= sTmp;
615 if (m_bIsDescriptor)
616 {
617 if (!m_pProps->m_bDDE)
618 {
619 m_pProps->m_sLinkFileName =
620 OUStringChar(sfx2::cTokenSeparator) + OUStringChar(sfx2::cTokenSeparator);
621 m_pProps->m_bDDE = true;
622 }
623 m_pProps->m_sLinkFileName = comphelper::string::setToken(
624 m_pProps->m_sLinkFileName,
626 }
627 else
628 {
629 OUString sLinkFileName(pSectionData->GetLinkFileName());
630 if (pSectionData->GetType() != SectionType::DdeLink)
631 {
632 sLinkFileName = OUStringChar(sfx2::cTokenSeparator) + OUStringChar(sfx2::cTokenSeparator);
633 pSectionData->SetType(SectionType::DdeLink);
634 }
635 sLinkFileName = comphelper::string::setToken(sLinkFileName,
636 pEntry->nWID - WID_SECT_DDE_TYPE,
638 pSectionData->SetLinkFileName(sLinkFileName);
639 }
640 }
641 break;
643 {
644 bool bVal(false);
645 if (!(pValues[nProperty] >>= bVal))
646 {
647 throw lang::IllegalArgumentException();
648 }
649 if (m_bIsDescriptor)
650 {
651 m_pProps->m_bUpdateType = bVal;
652 }
653 else
654 {
655 bLinkModeChanged = true;
656 bLinkMode = bVal;
657 }
658 }
659 break;
660 case WID_SECT_LINK:
661 {
662 text::SectionFileLink aLink;
663 if (!(pValues[nProperty] >>= aLink))
664 {
665 throw lang::IllegalArgumentException();
666 }
667 if (m_bIsDescriptor)
668 {
669 m_pProps->m_bDDE = false;
670 m_pProps->m_sLinkFileName = aLink.FileURL;
671 m_pProps->m_sSectionFilter = aLink.FilterName;
672 }
673 else
674 {
675 if (pSectionData->GetType() != SectionType::FileLink &&
676 !aLink.FileURL.isEmpty())
677 {
678 pSectionData->SetType(SectionType::FileLink);
679 }
680 const OUString sTmp(!aLink.FileURL.isEmpty()
682 pFormat->GetDoc()->GetDocShell()->GetMedium()->GetURLObject(),
683 aLink.FileURL, URIHelper::GetMaybeFileHdl())
684 : OUString());
685 const OUString sFileName(
686 sTmp + OUStringChar(sfx2::cTokenSeparator) +
687 aLink.FilterName + OUStringChar(sfx2::cTokenSeparator) +
688 o3tl::getToken(pSectionData->GetLinkFileName(), 2, sfx2::cTokenSeparator));
689 pSectionData->SetLinkFileName(sFileName);
690 if (sFileName.getLength() < 3)
691 {
692 pSectionData->SetType(SectionType::Content);
693 }
694 }
695 }
696 break;
697 case WID_SECT_REGION:
698 {
699 OUString sLink;
700 pValues[nProperty] >>= sLink;
701 if (m_bIsDescriptor)
702 {
703 m_pProps->m_bDDE = false;
704 m_pProps->m_sSectionRegion = sLink;
705 }
706 else
707 {
708 if (pSectionData->GetType() != SectionType::FileLink &&
709 !sLink.isEmpty())
710 {
711 pSectionData->SetType(SectionType::FileLink);
712 }
713 OUString sSectLink(pSectionData->GetLinkFileName());
714 for (sal_Int32 i = comphelper::string::getTokenCount(sSectLink, sfx2::cTokenSeparator);
715 i < 3; ++i)
716 {
717 sSectLink += OUStringChar(sfx2::cTokenSeparator);
718 }
719 sSectLink = comphelper::string::setToken(sSectLink, 2, sfx2::cTokenSeparator, sLink);
720 pSectionData->SetLinkFileName(sSectLink);
721 if (sSectLink.getLength() < 3)
722 {
723 pSectionData->SetType(SectionType::Content);
724 }
725 }
726 }
727 break;
728 case WID_SECT_VISIBLE:
729 {
730 bool bVal(false);
731 if (!(pValues[nProperty] >>= bVal))
732 {
733 throw lang::IllegalArgumentException();
734 }
735 if (m_bIsDescriptor)
736 {
737 m_pProps->m_bHidden = !bVal;
738 }
739 else
740 {
741 pSectionData->SetHidden(!bVal);
742 }
743 }
744 break;
746 {
747 bool bVal(false);
748 if (!(pValues[nProperty] >>= bVal))
749 {
750 throw lang::IllegalArgumentException();
751 }
752 if (m_bIsDescriptor)
753 {
754 m_pProps->m_bCondHidden = !bVal;
755 }
756 else
757 {
758 if (!pSectionData->GetCondition().isEmpty())
759 {
760 pSectionData->SetCondHidden(!bVal);
761 }
762 }
763 }
764 break;
766 {
767 bool bVal(false);
768 if (!(pValues[nProperty] >>= bVal))
769 {
770 throw lang::IllegalArgumentException();
771 }
772 if (m_bIsDescriptor)
773 {
774 m_pProps->m_bProtect = bVal;
775 }
776 else
777 {
778 pSectionData->SetProtectFlag(bVal);
779 }
780 }
781 break;
783 {
784 bool bVal(false);
785 if (!(pValues[nProperty] >>= bVal))
786 {
787 throw lang::IllegalArgumentException();
788 }
789 if (m_bIsDescriptor)
790 {
791 m_pProps->m_bEditInReadonly = bVal;
792 }
793 else
794 {
795 pSectionData->SetEditInReadonlyFlag(bVal);
796 }
797 }
798 break;
800 {
801 uno::Sequence<sal_Int8> aSeq;
802 pValues[nProperty] >>= aSeq;
803 if (m_bIsDescriptor)
804 {
805 m_pProps->m_Password = aSeq;
806 }
807 else
808 {
809 pSectionData->SetPassword(aSeq);
810 }
811 }
812 break;
813 default:
814 {
815 if (pFormat)
816 {
817 const SfxItemSet& rOldAttrSet = pFormat->GetAttrSet();
818 oItemSet.emplace(*rOldAttrSet.GetPool(), pEntry->nWID, pEntry->nWID);
819 oItemSet->Put(rOldAttrSet);
821 pValues[nProperty], *oItemSet);
822 }
823 else
824 {
825 SfxPoolItem* pPutItem = nullptr;
826 if (RES_COL == pEntry->nWID)
827 {
828 if (!m_pProps->m_pColItem)
829 {
830 m_pProps->m_pColItem.reset(new SwFormatCol);
831 }
832 pPutItem = m_pProps->m_pColItem.get();
833 }
834 else if (RES_BACKGROUND == pEntry->nWID)
835 {
836 if (!m_pProps->m_pBrushItem)
837 {
838 m_pProps->m_pBrushItem.reset(
840 }
841 pPutItem = m_pProps->m_pBrushItem.get();
842 }
843 else if (RES_FTN_AT_TXTEND == pEntry->nWID)
844 {
845 if (!m_pProps->m_pFootnoteItem)
846 {
847 m_pProps->m_pFootnoteItem.reset(new SwFormatFootnoteAtTextEnd);
848 }
849 pPutItem = m_pProps->m_pFootnoteItem.get();
850 }
851 else if (RES_END_AT_TXTEND == pEntry->nWID)
852 {
853 if (!m_pProps->m_pEndItem)
854 {
855 m_pProps->m_pEndItem.reset(new SwFormatEndAtTextEnd);
856 }
857 pPutItem = m_pProps->m_pEndItem.get();
858 }
859 else if (RES_UNKNOWNATR_CONTAINER== pEntry->nWID)
860 {
861 if (!m_pProps->m_pXMLAttr)
862 {
863 m_pProps->m_pXMLAttr.reset(
866 }
867 pPutItem = m_pProps->m_pXMLAttr.get();
868 }
869 else if (RES_COLUMNBALANCE== pEntry->nWID)
870 {
871 if (!m_pProps->m_pNoBalanceItem)
872 {
873 m_pProps->m_pNoBalanceItem.reset(
874 new SwFormatNoBalancedColumns(true));
875 }
876 pPutItem = m_pProps->m_pNoBalanceItem.get();
877 }
878 else if (RES_FRAMEDIR == pEntry->nWID)
879 {
880 if (!m_pProps->m_pFrameDirItem)
881 {
882 m_pProps->m_pFrameDirItem.reset(
884 SvxFrameDirection::Horizontal_LR_TB, RES_FRAMEDIR));
885 }
886 pPutItem = m_pProps->m_pFrameDirItem.get();
887 }
888 else if (RES_LR_SPACE == pEntry->nWID)
889 {
890 if (!m_pProps->m_pLRSpaceItem)
891 {
892 m_pProps->m_pLRSpaceItem.reset(
894 }
895 pPutItem = m_pProps->m_pLRSpaceItem.get();
896 }
897 if (pPutItem)
898 {
899 pPutItem->PutValue(pValues[nProperty],
900 pEntry->nMemberId);
901 }
902 }
903 }
904 }
905 }
906
907 lcl_UpdateSection(pFormat, pSectionData, oItemSet, bLinkModeChanged,
908 bLinkMode);
909}
910
911void SAL_CALL
913 const uno::Sequence< OUString >& rPropertyNames,
914 const uno::Sequence< uno::Any >& rValues)
915{
916 SolarMutexGuard aGuard;
917
918 // workaround for bad designed API
919 try
920 {
921 m_pImpl->SetPropertyValues_Impl( rPropertyNames, rValues );
922 }
923 catch (const beans::UnknownPropertyException &rException)
924 {
925 // wrap the original (here not allowed) exception in
926 // a WrappedTargetException that gets thrown instead.
927 lang::WrappedTargetException aWExc;
928 aWExc.TargetException <<= rException;
929 throw aWExc;
930 }
931}
932
934 const OUString& rPropertyName, const uno::Any& rValue)
935{
936 SolarMutexGuard aGuard;
937
938 m_pImpl->SetPropertyValues_Impl( { rPropertyName } , { rValue } );
939}
940
941uno::Sequence< uno::Any >
943 const uno::Sequence< OUString > & rPropertyNames )
944{
945 SwSectionFormat *const pFormat = GetSectionFormat();
946 if (!pFormat && !m_bIsDescriptor)
947 {
948 throw uno::RuntimeException( "non-descriptor section without format");
949 }
950
951 uno::Sequence< uno::Any > aRet(rPropertyNames.getLength());
952 uno::Any* pRet = aRet.getArray();
953 SwSection *const pSect = pFormat ? pFormat->GetSection() : nullptr;
954 const OUString* pPropertyNames = rPropertyNames.getConstArray();
955
956 for (sal_Int32 nProperty = 0; nProperty < rPropertyNames.getLength();
957 nProperty++)
958 {
959 SfxItemPropertyMapEntry const*const pEntry =
960 m_rPropSet.getPropertyMap().getByName(pPropertyNames[nProperty]);
961 if (!pEntry)
962 {
963 throw beans::UnknownPropertyException(
964 "Unknown property: " + pPropertyNames[nProperty],
965 static_cast<cppu::OWeakObject *>(& m_rThis));
966 }
967 switch(pEntry->nWID)
968 {
970 {
971 const OUString uTmp( m_bIsDescriptor
972 ? m_pProps->m_sCondition
973 : pSect->GetCondition());
974 pRet[nProperty] <<= uTmp;
975 }
976 break;
980 {
981 OUString sRet;
982 if (m_bIsDescriptor)
983 {
984 if (m_pProps->m_bDDE)
985 {
986 sRet = m_pProps->m_sLinkFileName;
987 }
988 }
989 else if (SectionType::DdeLink == pSect->GetType())
990 {
991 sRet = pSect->GetLinkFileName();
992 }
993 pRet[nProperty] <<= sRet.getToken(pEntry->nWID - WID_SECT_DDE_TYPE,
995 }
996 break;
998 {
999 // GetUpdateType() returns .._ALWAYS or .._ONCALL
1000 if (pSect && pSect->IsLinkType() && pSect->IsConnected()) // #i73247#
1001 {
1002 const bool bTemp =
1003 (pSect->GetUpdateType() == SfxLinkUpdateMode::ALWAYS);
1004 pRet[nProperty] <<= bTemp;
1005 }
1006 }
1007 break;
1008 case WID_SECT_LINK :
1009 {
1010 text::SectionFileLink aLink;
1011 if (m_bIsDescriptor)
1012 {
1013 if (!m_pProps->m_bDDE)
1014 {
1015 aLink.FileURL = m_pProps->m_sLinkFileName;
1016 aLink.FilterName = m_pProps->m_sSectionFilter;
1017 }
1018 }
1019 else if (SectionType::FileLink == pSect->GetType())
1020 {
1021 const OUString& sRet( pSect->GetLinkFileName() );
1022 sal_Int32 nIndex(0);
1023 aLink.FileURL =
1024 sRet.getToken(0, sfx2::cTokenSeparator, nIndex);
1025 aLink.FilterName =
1026 sRet.getToken(0, sfx2::cTokenSeparator, nIndex);
1027 }
1028 pRet[nProperty] <<= aLink;
1029 }
1030 break;
1031 case WID_SECT_REGION :
1032 {
1033 OUString sRet;
1034 if (m_bIsDescriptor)
1035 {
1036 sRet = m_pProps->m_sSectionRegion;
1037 }
1038 else if (SectionType::FileLink == pSect->GetType())
1039 {
1040 sRet = pSect->GetLinkFileName().getToken(2,
1042 }
1043 pRet[nProperty] <<= sRet;
1044 }
1045 break;
1046 case WID_SECT_VISIBLE :
1047 {
1048 const bool bTemp = m_bIsDescriptor
1049 ? !m_pProps->m_bHidden : !pSect->IsHidden();
1050 pRet[nProperty] <<= bTemp;
1051 }
1052 break;
1054 {
1055 const bool bTemp = m_bIsDescriptor
1056 ? !m_pProps->m_bCondHidden : !pSect->IsCondHidden();
1057 pRet[nProperty] <<= bTemp;
1058 }
1059 break;
1060 case WID_SECT_PROTECTED:
1061 {
1062 const bool bTemp = m_bIsDescriptor
1063 ? m_pProps->m_bProtect : pSect->IsProtect();
1064 pRet[nProperty] <<= bTemp;
1065 }
1066 break;
1068 {
1069 const bool bTemp = m_bIsDescriptor
1070 ? m_pProps->m_bEditInReadonly : pSect->IsEditInReadonly();
1071 pRet[nProperty] <<= bTemp;
1072 }
1073 break;
1075 {
1076 if (pFormat)
1077 {
1078 pRet[nProperty] <<= pFormat->GetSection()->GetSectionName();
1079 }
1080 }
1081 break;
1083 {
1084 // search enclosing index
1085 SwSection* pEnclosingSection = pSect;
1086 while ((pEnclosingSection != nullptr) &&
1087 (SectionType::ToxContent != pEnclosingSection->GetType()))
1088 {
1089 pEnclosingSection = pEnclosingSection->GetParent();
1090 }
1091 SwTOXBaseSection* const pTOXBaseSect = pEnclosingSection ?
1092 dynamic_cast<SwTOXBaseSection*>( pEnclosingSection ) : nullptr;
1093 if (pTOXBaseSect)
1094 {
1095 // convert section to TOXBase and get SwXDocumentIndex
1096 const uno::Reference<text::XDocumentIndex> xIndex =
1098 *pTOXBaseSect->GetFormat()->GetDoc(), pTOXBaseSect);
1099 pRet[nProperty] <<= xIndex;
1100 }
1101 // else: no enclosing index found -> empty return value
1102 }
1103 break;
1105 {
1106 const bool bRet = pFormat && (nullptr != pFormat->GetGlobalDocSection());
1107 pRet[nProperty] <<= bRet;
1108 }
1109 break;
1111 case FN_UNO_TEXT_WRAP:
1112 case FN_UNO_ANCHOR_TYPE:
1114 pRet[nProperty], u"", pEntry->nWID);
1115 break;
1118 {
1119 if (!pFormat)
1120 break; // #i73247#
1121 SwNode* pSectNode = pFormat->GetSectionNode();
1122 if (FN_UNO_REDLINE_NODE_END == pEntry->nWID)
1123 {
1124 pSectNode = pSectNode->EndOfSectionNode();
1125 }
1126 const SwRedlineTable& rRedTable =
1128 for (SwRangeRedline* pRedline : rRedTable)
1129 {
1130 const SwNode& rRedPointNode = pRedline->GetPointNode();
1131 const SwNode& rRedMarkNode = pRedline->GetMarkNode();
1132 if ((&rRedPointNode == pSectNode) ||
1133 (&rRedMarkNode == pSectNode))
1134 {
1135 const SwNode& rStartOfRedline =
1136 (SwNodeIndex(rRedPointNode) <=
1137 SwNodeIndex(rRedMarkNode))
1138 ? rRedPointNode : rRedMarkNode;
1139 const bool bIsStart = (&rStartOfRedline == pSectNode);
1140 pRet[nProperty] <<=
1142 *pRedline, bIsStart);
1143 break;
1144 }
1145 }
1146 }
1147 break;
1148 case WID_SECT_PASSWORD:
1149 {
1150 pRet[nProperty] <<= m_bIsDescriptor
1151 ? m_pProps->m_Password : pSect->GetPassword();
1152 }
1153 break;
1154 default:
1155 {
1156 if (pFormat)
1157 {
1158 m_rPropSet.getPropertyValue(*pEntry,
1159 pFormat->GetAttrSet(), pRet[nProperty]);
1160 }
1161 else
1162 {
1163 const SfxPoolItem* pQueryItem = nullptr;
1164 if (RES_COL == pEntry->nWID)
1165 {
1166 if (!m_pProps->m_pColItem)
1167 {
1168 m_pProps->m_pColItem.reset(new SwFormatCol);
1169 }
1170 pQueryItem = m_pProps->m_pColItem.get();
1171 }
1172 else if (RES_BACKGROUND == pEntry->nWID)
1173 {
1174 if (!m_pProps->m_pBrushItem)
1175 {
1176 m_pProps->m_pBrushItem.reset(
1178 }
1179 pQueryItem = m_pProps->m_pBrushItem.get();
1180 }
1181 else if (RES_FTN_AT_TXTEND == pEntry->nWID)
1182 {
1183 if (!m_pProps->m_pFootnoteItem)
1184 {
1185 m_pProps->m_pFootnoteItem.reset(new SwFormatFootnoteAtTextEnd);
1186 }
1187 pQueryItem = m_pProps->m_pFootnoteItem.get();
1188 }
1189 else if (RES_END_AT_TXTEND == pEntry->nWID)
1190 {
1191 if (!m_pProps->m_pEndItem)
1192 {
1193 m_pProps->m_pEndItem.reset(new SwFormatEndAtTextEnd);
1194 }
1195 pQueryItem = m_pProps->m_pEndItem.get();
1196 }
1197 else if (RES_UNKNOWNATR_CONTAINER== pEntry->nWID)
1198 {
1199 if (!m_pProps->m_pXMLAttr)
1200 {
1201 m_pProps->m_pXMLAttr.reset(
1203 }
1204 pQueryItem = m_pProps->m_pXMLAttr.get();
1205 }
1206 else if (RES_COLUMNBALANCE== pEntry->nWID)
1207 {
1208 if (!m_pProps->m_pNoBalanceItem)
1209 {
1210 m_pProps->m_pNoBalanceItem.reset(
1212 }
1213 pQueryItem = m_pProps->m_pNoBalanceItem.get();
1214 }
1215 else if (RES_FRAMEDIR == pEntry->nWID)
1216 {
1217 if (!m_pProps->m_pFrameDirItem)
1218 {
1219 m_pProps->m_pFrameDirItem.reset(
1221 SvxFrameDirection::Environment, RES_FRAMEDIR));
1222 }
1223 pQueryItem = m_pProps->m_pFrameDirItem.get();
1224 }
1225 else if (RES_LR_SPACE == pEntry->nWID)
1226 {
1227 if (!m_pProps->m_pLRSpaceItem)
1228 {
1229 m_pProps->m_pLRSpaceItem.reset(
1231 }
1232 pQueryItem = m_pProps->m_pLRSpaceItem.get();
1233 }
1234 if (pQueryItem)
1235 {
1236 pQueryItem->QueryValue(pRet[nProperty],
1237 pEntry->nMemberId);
1238 }
1239 }
1240 }
1241 }
1242 }
1243 return aRet;
1244}
1245
1246uno::Sequence< uno::Any > SAL_CALL
1248 const uno::Sequence< OUString >& rPropertyNames)
1249{
1250 SolarMutexGuard aGuard;
1251 uno::Sequence< uno::Any > aValues;
1252
1253 // workaround for bad designed API
1254 try
1255 {
1256 aValues = m_pImpl->GetPropertyValues_Impl( rPropertyNames );
1257 }
1258 catch (beans::UnknownPropertyException &)
1259 {
1260 css::uno::Any anyEx = cppu::getCaughtException();
1261 throw lang::WrappedTargetRuntimeException("Unknown property exception caught",
1262 static_cast < cppu::OWeakObject * > ( this ), anyEx );
1263 }
1264 catch (lang::WrappedTargetException &)
1265 {
1266 css::uno::Any anyEx = cppu::getCaughtException();
1267 throw lang::WrappedTargetRuntimeException("WrappedTargetException caught",
1268 static_cast < cppu::OWeakObject * > ( this ), anyEx );
1269 }
1270
1271 return aValues;
1272}
1273
1274uno::Any SAL_CALL
1275SwXTextSection::getPropertyValue(const OUString& rPropertyName)
1276{
1277 SolarMutexGuard aGuard;
1278
1279 uno::Sequence< OUString > aPropertyNames { rPropertyName };
1280 return m_pImpl->GetPropertyValues_Impl(aPropertyNames).getConstArray()[0];
1281}
1282
1284 const uno::Sequence< OUString >& /*aPropertyNames*/,
1285 const uno::Reference< beans::XPropertiesChangeListener >& /*xListener*/ )
1286{
1287 OSL_FAIL("SwXTextSection::addPropertiesChangeListener(): not implemented");
1288}
1289
1291 const uno::Reference< beans::XPropertiesChangeListener >& /*xListener*/ )
1292{
1293 OSL_FAIL("SwXTextSection::removePropertiesChangeListener(): not implemented");
1294}
1295
1297 const uno::Sequence< OUString >& /*aPropertyNames*/,
1298 const uno::Reference< beans::XPropertiesChangeListener >& /*xListener*/ )
1299{
1300 OSL_FAIL("SwXTextSection::firePropertiesChangeEvent(): not implemented");
1301}
1302
1303void SAL_CALL
1305 const OUString& /*rPropertyName*/,
1306 const uno::Reference< beans::XPropertyChangeListener >& /*xListener*/)
1307{
1308 OSL_FAIL("SwXTextSection::addPropertyChangeListener(): not implemented");
1309}
1310
1311void SAL_CALL
1313 const OUString& /*rPropertyName*/,
1314 const uno::Reference< beans::XPropertyChangeListener >& /*xListener*/)
1315{
1316 OSL_FAIL("SwXTextSection::removePropertyChangeListener(): not implemented");
1317}
1318
1319void SAL_CALL
1321 const OUString& /*rPropertyName*/,
1322 const uno::Reference< beans::XVetoableChangeListener >& /*xListener*/)
1323{
1324 OSL_FAIL("SwXTextSection::addVetoableChangeListener(): not implemented");
1325}
1326
1327void SAL_CALL
1329 const OUString& /*rPropertyName*/,
1330 const uno::Reference< beans::XVetoableChangeListener >& /*xListener*/)
1331{
1332 OSL_FAIL("SwXTextSection::removeVetoableChangeListener(): not implemented");
1333}
1334
1335beans::PropertyState SAL_CALL
1336SwXTextSection::getPropertyState(const OUString& rPropertyName)
1337{
1338 SolarMutexGuard aGuard;
1339
1340 uno::Sequence< OUString > aNames { rPropertyName };
1341 return getPropertyStates(aNames).getConstArray()[0];
1342}
1343
1344uno::Sequence< beans::PropertyState > SAL_CALL
1346 const uno::Sequence< OUString >& rPropertyNames)
1347{
1348 SolarMutexGuard aGuard;
1349
1350 SwSectionFormat *const pFormat = m_pImpl->GetSectionFormat();
1351 if (!pFormat && !m_pImpl->m_bIsDescriptor)
1352 {
1353 throw uno::RuntimeException();
1354 }
1355
1356 uno::Sequence< beans::PropertyState > aStates(rPropertyNames.getLength());
1357 beans::PropertyState *const pStates = aStates.getArray();
1358 const OUString* pNames = rPropertyNames.getConstArray();
1359 for (sal_Int32 i = 0; i < rPropertyNames.getLength(); i++)
1360 {
1361 pStates[i] = beans::PropertyState_DEFAULT_VALUE;
1362 SfxItemPropertyMapEntry const*const pEntry =
1363 m_pImpl->m_rPropSet.getPropertyMap().getByName( pNames[i]);
1364 if (!pEntry)
1365 {
1366 throw beans::UnknownPropertyException(
1367 "Unknown property: " + pNames[i],
1368 static_cast< cppu::OWeakObject* >(this));
1369 }
1370 switch (pEntry->nWID)
1371 {
1372 case WID_SECT_CONDITION:
1373 case WID_SECT_DDE_TYPE:
1374 case WID_SECT_DDE_FILE:
1377 case WID_SECT_LINK:
1378 case WID_SECT_REGION :
1379 case WID_SECT_VISIBLE:
1380 case WID_SECT_PROTECTED:
1384 case FN_UNO_TEXT_WRAP:
1385 case FN_UNO_ANCHOR_TYPE:
1386 pStates[i] = beans::PropertyState_DIRECT_VALUE;
1387 break;
1388 default:
1389 {
1390 if (pFormat)
1391 {
1392 pStates[i] = m_pImpl->m_rPropSet.getPropertyState(
1393 pNames[i], pFormat->GetAttrSet());
1394 }
1395 else
1396 {
1397 if (RES_COL == pEntry->nWID)
1398 {
1399 if (!m_pImpl->m_pProps->m_pColItem)
1400 {
1401 pStates[i] = beans::PropertyState_DEFAULT_VALUE;
1402 }
1403 else
1404 {
1405 pStates[i] = beans::PropertyState_DIRECT_VALUE;
1406 }
1407 }
1408 else
1409 {
1410 if (!m_pImpl->m_pProps->m_pBrushItem)
1411 {
1412 pStates[i] = beans::PropertyState_DEFAULT_VALUE;
1413 }
1414 else
1415 {
1416 pStates[i] = beans::PropertyState_DIRECT_VALUE;
1417 }
1418 }
1419 }
1420 }
1421 }
1422 }
1423 return aStates;
1424}
1425
1426void SAL_CALL
1427SwXTextSection::setPropertyToDefault(const OUString& rPropertyName)
1428{
1429 SolarMutexGuard aGuard;
1430
1431 SwSectionFormat *const pFormat = m_pImpl->GetSectionFormat();
1432 if (!pFormat && !m_pImpl->m_bIsDescriptor)
1433 {
1434 throw uno::RuntimeException();
1435 }
1436
1437 SfxItemPropertyMapEntry const*const pEntry =
1438 m_pImpl->m_rPropSet.getPropertyMap().getByName(rPropertyName);
1439 if (!pEntry)
1440 {
1441 throw beans::UnknownPropertyException(
1442 "Unknown property: " + rPropertyName,
1443 static_cast< cppu::OWeakObject* >(this));
1444 }
1445 if (pEntry->nFlags & beans::PropertyAttribute::READONLY)
1446 {
1447 throw uno::RuntimeException(
1448 "Property is read-only: " + rPropertyName,
1449 static_cast<cppu::OWeakObject *>(this));
1450 }
1451
1452 std::unique_ptr<SwSectionData> const pSectionData(
1453 pFormat ? new SwSectionData(*pFormat->GetSection()) : nullptr);
1454
1455 std::optional<SfxItemSet> oNewAttrSet;
1456 bool bLinkModeChanged = false;
1457
1458 switch (pEntry->nWID)
1459 {
1460 case WID_SECT_CONDITION:
1461 {
1462 if (m_pImpl->m_bIsDescriptor)
1463 {
1464 m_pImpl->m_pProps->m_sCondition.clear();
1465 }
1466 else
1467 {
1468 pSectionData->SetCondition(OUString());
1469 }
1470 }
1471 break;
1472 case WID_SECT_DDE_TYPE :
1473 case WID_SECT_DDE_FILE :
1475 case WID_SECT_LINK :
1476 case WID_SECT_REGION :
1477 if (m_pImpl->m_bIsDescriptor)
1478 {
1479 m_pImpl->m_pProps->m_bDDE = false;
1480 m_pImpl->m_pProps->m_sLinkFileName.clear();
1481 m_pImpl->m_pProps->m_sSectionRegion.clear();
1482 m_pImpl->m_pProps->m_sSectionFilter.clear();
1483 }
1484 else
1485 {
1486 pSectionData->SetType(SectionType::Content);
1487 }
1488 break;
1490 if (m_pImpl->m_bIsDescriptor)
1491 {
1492 m_pImpl->m_pProps->m_bUpdateType = true;
1493 }
1494 else
1495 {
1496 bLinkModeChanged = true;
1497 }
1498 break;
1499 case WID_SECT_VISIBLE :
1500 {
1501 if (m_pImpl->m_bIsDescriptor)
1502 {
1503 m_pImpl->m_pProps->m_bHidden = false;
1504 }
1505 else
1506 {
1507 pSectionData->SetHidden(false);
1508 }
1509 }
1510 break;
1511 case WID_SECT_PROTECTED:
1512 {
1513 if (m_pImpl->m_bIsDescriptor)
1514 {
1515 m_pImpl->m_pProps->m_bProtect = false;
1516 }
1517 else
1518 {
1519 pSectionData->SetProtectFlag(false);
1520 }
1521 }
1522 break;
1524 {
1525 if (m_pImpl->m_bIsDescriptor)
1526 {
1527 m_pImpl->m_pProps->m_bEditInReadonly = false;
1528 }
1529 else
1530 {
1531 pSectionData->SetEditInReadonlyFlag(false);
1532 }
1533 }
1534 break;
1535
1537 case FN_UNO_TEXT_WRAP:
1538 case FN_UNO_ANCHOR_TYPE:
1539 break;
1540 default:
1541 {
1542 if (SfxItemPool::IsWhich(pEntry->nWID))
1543 {
1544 if (pFormat)
1545 {
1546 const SfxItemSet& rOldAttrSet = pFormat->GetAttrSet();
1547 oNewAttrSet.emplace(*rOldAttrSet.GetPool(), pEntry->nWID, pEntry->nWID);
1548 oNewAttrSet->ClearItem(pEntry->nWID);
1549 }
1550 else
1551 {
1552 if (RES_COL == pEntry->nWID)
1553 {
1554 m_pImpl->m_pProps->m_pColItem.reset();
1555 }
1556 else if (RES_BACKGROUND == pEntry->nWID)
1557 {
1558 m_pImpl->m_pProps->m_pBrushItem.reset();
1559 }
1560 }
1561 }
1562 }
1563 }
1564
1565 lcl_UpdateSection(pFormat, pSectionData, oNewAttrSet, bLinkModeChanged);
1566}
1567
1568uno::Any SAL_CALL
1569SwXTextSection::getPropertyDefault(const OUString& rPropertyName)
1570{
1571 SolarMutexGuard aGuard;
1572
1573 uno::Any aRet;
1574 SwSectionFormat *const pFormat = m_pImpl->GetSectionFormat();
1575 SfxItemPropertyMapEntry const*const pEntry =
1576 m_pImpl->m_rPropSet.getPropertyMap().getByName(rPropertyName);
1577 if (!pEntry)
1578 {
1579 throw beans::UnknownPropertyException(
1580 "Unknown property: " + rPropertyName,
1581 static_cast<cppu::OWeakObject *>(this));
1582 }
1583
1584 switch(pEntry->nWID)
1585 {
1586 case WID_SECT_CONDITION:
1587 case WID_SECT_DDE_TYPE :
1588 case WID_SECT_DDE_FILE :
1590 case WID_SECT_REGION :
1592 aRet <<= OUString();
1593 break;
1594 case WID_SECT_LINK :
1595 aRet <<= text::SectionFileLink();
1596 break;
1598 case WID_SECT_VISIBLE :
1599 aRet <<= true;
1600 break;
1601 case WID_SECT_PROTECTED:
1603 aRet <<= false;
1604 break;
1606 case FN_UNO_TEXT_WRAP:
1607 case FN_UNO_ANCHOR_TYPE:
1608 ::sw::GetDefaultTextContentValue(aRet, u"", pEntry->nWID);
1609 break;
1610 default:
1611 if(pFormat && SfxItemPool::IsWhich(pEntry->nWID))
1612 {
1613 SwDoc *const pDoc = pFormat->GetDoc();
1614 const SfxPoolItem& rDefItem =
1615 pDoc->GetAttrPool().GetDefaultItem(pEntry->nWID);
1616 rDefItem.QueryValue(aRet, pEntry->nMemberId);
1617 }
1618 }
1619 return aRet;
1620}
1621
1622OUString SAL_CALL SwXTextSection::getName()
1623{
1624 SolarMutexGuard aGuard;
1625
1626 OUString sRet;
1627 SwSectionFormat const*const pFormat = m_pImpl->GetSectionFormat();
1628 if(pFormat)
1629 {
1630 sRet = pFormat->GetSection()->GetSectionName();
1631 }
1632 else if (m_pImpl->m_bIsDescriptor)
1633 {
1634 sRet = m_pImpl->m_sName;
1635 }
1636 else
1637 {
1638 throw uno::RuntimeException();
1639 }
1640 return sRet;
1641}
1642
1643void SAL_CALL SwXTextSection::setName(const OUString& rName)
1644{
1645 SolarMutexGuard aGuard;
1646
1647 SwSectionFormat *const pFormat = m_pImpl->GetSectionFormat();
1648 if(pFormat)
1649 {
1650 SwSection *const pSect = pFormat->GetSection();
1651 SwSectionData aSection(*pSect);
1652 aSection.SetSectionName(rName);
1653
1654 const SwSectionFormats& rFormats = pFormat->GetDoc()->GetSections();
1655 size_t nApplyPos = SIZE_MAX;
1656 for( size_t i = 0; i < rFormats.size(); ++i )
1657 {
1658 if(rFormats[i]->GetSection() == pSect)
1659 {
1660 nApplyPos = i;
1661 }
1662 else if (rName == rFormats[i]->GetSection()->GetSectionName())
1663 {
1664 throw uno::RuntimeException();
1665 }
1666 }
1667 if (nApplyPos != SIZE_MAX)
1668 {
1669 {
1670 UnoActionContext aContext(pFormat->GetDoc());
1671 pFormat->GetDoc()->UpdateSection(nApplyPos, aSection);
1672 }
1673 {
1674 // temporarily remove actions to allow cursor update
1675 // TODO: why? no table cursor here!
1676 UnoActionRemoveContext aRemoveContext( pFormat->GetDoc() );
1677 }
1678 }
1679 }
1680 else if (m_pImpl->m_bIsDescriptor)
1681 {
1682 m_pImpl->m_sName = rName;
1683 }
1684 else
1685 {
1686 throw uno::RuntimeException();
1687 }
1688}
1689
1690OUString SAL_CALL
1692{
1693 return "SwXTextSection";
1694}
1695
1696sal_Bool SAL_CALL SwXTextSection::supportsService(const OUString& rServiceName)
1697{
1698 return cppu::supportsService(this, rServiceName);
1699}
1700
1701uno::Sequence< OUString > SAL_CALL
1703{
1704 return {
1705 "com.sun.star.text.TextContent",
1706 "com.sun.star.text.TextSection",
1707 "com.sun.star.document.LinkTarget"
1708 };
1709}
1710
1711// MetadatableMixin
1712::sfx2::Metadatable* SwXTextSection::GetCoreObject()
1713{
1714 SwSectionFormat *const pSectionFormat( m_pImpl->GetSectionFormat() );
1715 return pSectionFormat;
1716}
1717
1718uno::Reference<frame::XModel> SwXTextSection::GetModel()
1719{
1720 SwSectionFormat *const pSectionFormat( m_pImpl->GetSectionFormat() );
1721 if (pSectionFormat)
1722 {
1723 SwDocShell const*const pShell( pSectionFormat->GetDoc()->GetDocShell() );
1724 return pShell ? pShell->GetModel() : nullptr;
1725 }
1726 return nullptr;
1727}
1728
1729/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const PropertyValue * pValues
virtual const SwRedlineTable & GetRedlineTable() const =0
SfxHintId GetId() const
const SfxPoolItem & GetDefaultItem(sal_uInt16 nWhich) const
static bool IsWhich(sal_uInt16 nId)
const SfxItemPropertyMapEntry * getByName(std::u16string_view rName) const
void setPropertyValue(const SfxItemPropertyMapEntry &rEntry, const css::uno::Any &aVal, SfxItemSet &rSet) const
const SfxItemPropertyMap & getPropertyMap() const
SfxItemPool * GetPool() const
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const INetURLObject & GetURLObject() const
SfxMedium * GetMedium() const
css::uno::Reference< css::frame::XModel3 > GetModel() const
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId)
void EndListeningAll()
bool StartListening(SvtBroadcaster &rBroadcaster)
Definition: doc.hxx:197
bool IsInReading() const
Definition: doc.hxx:969
SwSectionFormats & GetSections()
Definition: doc.hxx:1356
SwSection * InsertSwSection(SwPaM const &rRange, SwSectionData &, std::tuple< SwTOXBase const *, sw::RedlineMode, sw::FieldmarkMode, sw::ParagraphBreakMode > const *pTOXBase, SfxItemSet const *const pAttr, bool const bUpdate=true)
Definition: ndsect.cxx:148
IDocumentUndoRedo & GetIDocumentUndoRedo()
Definition: doc.cxx:158
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
Definition: doc.cxx:349
static SwTOXBase * GetCurTOX(const SwPosition &rPos)
Get current table of contents.
Definition: doctxm.cxx:449
void DelSectionFormat(SwSectionFormat *pFormat, bool bDelNodes=false)
Definition: ndsect.cxx:507
OUString GetUniqueSectionName(const OUString *pChkStr=nullptr) const
Definition: ndsect.cxx:1393
void UpdateSection(size_t const nSect, SwSectionData &, SfxItemSet const *const =nullptr, bool const bPreventLinkUpdate=false)
Definition: ndsect.cxx:594
const SwAttrPool & GetAttrPool() const
Definition: doc.hxx:1337
SwDocShell * GetDocShell()
Definition: doc.hxx:1370
Ends a section of nodes in the document model.
Definition: node.hxx:378
const SwNodeIndex * GetContentIdx() const
Definition: fmtcntnt.hxx:46
If text in multi-column sections should be evenly distributed.
Definition: fmtclbl.hxx:29
const SwDoc * GetDoc() const
The document is set in SwAttrPool now, therefore you always can access it.
Definition: format.hxx:139
const SwAttrSet & GetAttrSet() const
For querying the attribute array.
Definition: format.hxx:136
const SwFormatContent & GetContent(bool=true) const
Definition: fmtcntnt.hxx:55
SAL_DLLPRIVATE void SetXObject(css::uno::Reference< css::uno::XInterface > const &xObject)
Definition: frmfmt.hxx:185
Marks a node in the document model.
Definition: ndindex.hxx:31
SwNode & GetNode() const
Definition: ndindex.hxx:123
Base class of the Writer document model elements.
Definition: node.hxx:98
SwNodes & GetNodes()
Node is in which nodes-array/doc?
Definition: node.hxx:706
bool IsSectionNode() const
Definition: node.hxx:192
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:968
const SwEndNode * EndOfSectionNode() const
Definition: node.hxx:695
bool IsDocNodes() const
Is the NodesArray the regular one of Doc? (and not the UndoNds, ...) Implementation in doc....
Definition: nodes.cxx:2555
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:188
bool Move(SwMoveFnCollection const &fnMove=fnMoveForward, SwGoInDoc fnGo=GoInContent)
Movement of cursor.
Definition: pam.cxx:657
const SwPosition * GetPoint() const
Definition: pam.hxx:253
const SwPosition * Start() const
Definition: pam.hxx:258
void SetHidden(bool const bFlag)
Definition: section.hxx:99
SAL_DLLPRIVATE void SetProtectFlag(bool const bFlag)
Definition: section.hxx:106
void SetEditInReadonlyFlag(bool const bFlag)
Definition: section.hxx:108
void SetSectionName(OUString const &rName)
Definition: section.hxx:94
void SetCondition(OUString const &rNew)
Definition: section.hxx:115
void SetLinkFileName(OUString const &rNew)
Definition: section.hxx:118
void SetPassword(css::uno::Sequence< sal_Int8 > const &rNew)
Definition: section.hxx:128
SwSection * GetSection() const
Definition: section.cxx:646
SAL_DLLPRIVATE void SetXTextSection(rtl::Reference< SwXTextSection > const &xTextSection)
Definition: section.cxx:808
SwSectionFormat * GetParent() const
Definition: section.hxx:360
void GetChildSections(SwSections &rArr, SectionSort eSort=SectionSort::Not, bool bAllSections=true) const
Definition: section.cxx:853
SAL_DLLPRIVATE unotools::WeakReference< SwXTextSection > const & GetXTextSection() const
Definition: section.hxx:326
SwSectionNode * GetSectionNode()
Definition: section.cxx:923
const SwSection * GetGlobalDocSection() const
Definition: section.cxx:932
Array of Undo-history.
Definition: docary.hxx:193
OUString const & GetCondition() const
Definition: section.hxx:201
bool IsEditInReadonly() const
Definition: section.cxx:344
void SetUpdateType(SfxLinkUpdateMode nType)
Definition: section.hxx:224
OUString const & GetLinkFileName() const
Definition: section.cxx:519
css::uno::Sequence< sal_Int8 > const & GetPassword() const
Definition: section.hxx:213
bool IsHidden() const
Definition: section.hxx:181
SwSection * GetParent() const
Definition: section.hxx:351
void SetCondHidden(bool const bFlag)
Definition: section.cxx:509
const OUString & GetSectionName() const
Definition: section.hxx:171
SwSectionFormat * GetFormat()
Definition: section.hxx:341
bool IsProtect() const
Definition: section.cxx:334
bool IsLinkType() const
Definition: section.hxx:238
SectionType GetType() const
Definition: section.hxx:173
SfxLinkUpdateMode GetUpdateType() const
Definition: section.hxx:223
bool IsCondHidden() const
Definition: section.hxx:195
bool IsConnected() const
Definition: section.hxx:227
void CreateLink(LinkCreateType eType)
Definition: section.cxx:1399
size_t size() const
Definition: docary.hxx:88
static rtl::Reference< SwXDocumentIndex > CreateXDocumentIndex(SwDoc &rDoc, SwTOXBaseSection *pSection, TOXTypes eTypes=TOX_INDEX)
Definition: unoidx.cxx:401
static css::uno::Sequence< css::beans::PropertyValue > CreateRedlineProperties(SwRangeRedline const &rRedline, bool const bIsStart)
Definition: unoredline.cxx:284
const SwDoc & GetDoc() const
Definition: unoobj2.cxx:762
static rtl::Reference< SwXTextRange > CreateXTextRange(SwDoc &rDoc, const SwPosition &rPos, const SwPosition *const pMark)
Definition: unoobj2.cxx:1221
uno::Sequence< uno::Any > GetPropertyValues_Impl(const uno::Sequence< OUString > &rPropertyNames)
Definition: unosect.cxx:942
SwSectionFormat * GetSectionFormat() const
Definition: unosect.cxx:144
const SfxItemPropertySet & m_rPropSet
Definition: unosect.cxx:115
SwSectionFormat * m_pFormat
Definition: unosect.cxx:122
const bool m_bIndexHeader
Definition: unosect.cxx:118
::comphelper::OInterfaceContainerHelper4< css::lang::XEventListener > m_EventListeners
Definition: unosect.cxx:117
void SetPropertyValues_Impl(const uno::Sequence< OUString > &rPropertyNames, const uno::Sequence< uno::Any > &aValues)
Definition: unosect.cxx:553
void Attach(SwSectionFormat *pFormat)
Definition: unosect.cxx:137
virtual void Notify(const SfxHint &rHint) override
Definition: unosect.cxx:172
std::unique_ptr< SwTextSectionProperties_Impl > m_pProps
Definition: unosect.cxx:121
Impl(SwXTextSection &rThis, SwSectionFormat *const pFormat, const bool bIndexHeader)
Definition: unosect.cxx:124
std::mutex m_Mutex
Definition: unosect.cxx:116
SwSectionFormat & GetSectionFormatOrThrow() const
Definition: unosect.cxx:147
unotools::WeakReference< SwXTextSection > m_wThis
Definition: unosect.cxx:114
SwXTextSection & m_rThis
Definition: unosect.cxx:113
virtual void SAL_CALL addPropertiesChangeListener(const css::uno::Sequence< OUString > &rPropertyNames, const css::uno::Reference< css::beans::XPropertiesChangeListener > &xListener) override
Definition: unosect.cxx:1283
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unosect.cxx:1702
virtual ::sfx2::Metadatable * GetCoreObject() override
Definition: unosect.cxx:1712
virtual void SAL_CALL removePropertyChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: unosect.cxx:1312
virtual css::uno::Reference< css::frame::XModel > GetModel() override
Definition: unosect.cxx:1718
virtual css::uno::Sequence< css::uno::Any > SAL_CALL getPropertyValues(const css::uno::Sequence< OUString > &rPropertyNames) override
Definition: unosect.cxx:1247
virtual void SAL_CALL firePropertiesChangeEvent(const css::uno::Sequence< OUString > &rPropertyNames, const css::uno::Reference< css::beans::XPropertiesChangeListener > &xListener) override
Definition: unosect.cxx:1296
virtual OUString SAL_CALL getName() override
Definition: unosect.cxx:1622
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getAnchor() override
Definition: unosect.cxx:421
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &rPropertyName) override
Definition: unosect.cxx:1275
virtual ~SwXTextSection() override
Definition: unosect.cxx:224
virtual void SAL_CALL setPropertyValues(const css::uno::Sequence< OUString > &rPropertyNames, const css::uno::Sequence< css::uno::Any > &rValues) override
Definition: unosect.cxx:912
virtual css::uno::Reference< css::text::XTextSection > SAL_CALL getParentSection() override
Definition: unosect.cxx:229
virtual void SAL_CALL dispose() override
Definition: unosect.cxx:468
virtual void SAL_CALL setPropertyValue(const OUString &rPropertyName, const css::uno::Any &rValue) override
Definition: unosect.cxx:933
virtual void SAL_CALL removePropertiesChangeListener(const css::uno::Reference< css::beans::XPropertiesChangeListener > &xListener) override
Definition: unosect.cxx:1290
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > &xListener) override
Definition: unosect.cxx:487
virtual css::uno::Sequence< css::beans::PropertyState > SAL_CALL getPropertyStates(const css::uno::Sequence< OUString > &rPropertyNames) override
Definition: unosect.cxx:1345
SwSectionFormat * GetFormat() const
Definition: unosect.cxx:188
SwXTextSection(SwSectionFormat *const pFormat, const bool bIndexHeader)
Definition: unosect.cxx:218
virtual css::uno::Any SAL_CALL getPropertyDefault(const OUString &rPropertyName) override
Definition: unosect.cxx:1569
virtual void SAL_CALL removeVetoableChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &xListener) override
Definition: unosect.cxx:1328
::sw::UnoImplPtr< Impl > m_pImpl
Definition: unosection.hxx:54
virtual void SAL_CALL setPropertyToDefault(const OUString &rPropertyName) override
Definition: unosect.cxx:1427
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &xListener) override
Definition: unosect.cxx:479
virtual void SAL_CALL addPropertyChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: unosect.cxx:1304
virtual void SAL_CALL setName(const OUString &rName) override
Definition: unosect.cxx:1643
virtual css::beans::PropertyState SAL_CALL getPropertyState(const OUString &rPropertyName) override
Definition: unosect.cxx:1336
virtual sal_Bool SAL_CALL supportsService(const OUString &rServiceName) override
Definition: unosect.cxx:1696
static rtl::Reference< SwXTextSection > CreateXTextSection(SwSectionFormat *const pFormat, const bool bIndexHeader=false)
Definition: unosect.cxx:194
virtual css::uno::Sequence< css::uno::Reference< css::text::XTextSection > > SAL_CALL getChildSections() override
Definition: unosect.cxx:242
virtual void SAL_CALL addVetoableChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &xListener) override
Definition: unosect.cxx:1320
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: unosect.cxx:496
virtual void SAL_CALL attach(const css::uno::Reference< css::text::XTextRange > &xTextRange) override
Definition: unosect.cxx:261
virtual OUString SAL_CALL getImplementationName() override
Definition: unosect.cxx:1691
void disposeAndClear(::std::unique_lock<::std::mutex > &rGuard, const css::lang::EventObject &rEvt)
#define FN_UNO_ANCHOR_TYPE
Definition: cmdid.h:600
#define FN_PARAM_LINK_DISPLAY_NAME
Definition: cmdid.h:844
#define FN_UNO_REDLINE_NODE_START
Definition: cmdid.h:604
#define FN_UNO_REDLINE_NODE_END
Definition: cmdid.h:605
#define FN_UNO_ANCHOR_TYPES
Definition: cmdid.h:593
#define FN_UNO_TEXT_WRAP
Definition: cmdid.h:599
int nCount
float u
DocumentType eType
constexpr TypedWhichId< SvxFrameDirectionItem > RES_FRAMEDIR(126)
constexpr TypedWhichId< SwFormatEndAtTextEnd > RES_END_AT_TXTEND(124)
constexpr TypedWhichId< SwFormatFootnoteAtTextEnd > RES_FTN_AT_TXTEND(123)
constexpr TypedWhichId< SwFormatCol > RES_COL(115)
constexpr TypedWhichId< SvXMLAttrContainerItem > RES_UNKNOWNATR_CONTAINER(RES_UNKNOWNATR_BEGIN)
constexpr TypedWhichId< SvxBrushItem > RES_BACKGROUND(111)
constexpr TypedWhichId< SwFormatNoBalancedColumns > RES_COLUMNBALANCE(125)
constexpr TypedWhichId< SvxLRSpaceItem > RES_LR_SPACE(97)
sal_Int32 nIndex
Sequence< sal_Int8 > aSeq
SVL_DLLPUBLIC Link< OUString *, bool > const & GetMaybeFileHdl()
SVL_DLLPUBLIC OUString SmartRel2Abs(INetURLObject const &rTheBaseURIRef, OUString const &rTheRelURIRef, Link< OUString *, bool > const &rMaybeFileHdl=Link< OUString *, bool >(), bool bCheckFileExists=true, bool bIgnoreFragment=false, INetURLObject::EncodeMechanism eEncodeMechanism=INetURLObject::EncodeMechanism::WasEncoded, INetURLObject::DecodeMechanism eDecodeMechanism=INetURLObject::DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8, FSysStyle eStyle=FSysStyle::Detect)
OUString setToken(const OUString &rIn, sal_Int32 nToken, sal_Unicode cTok, std::u16string_view rNewToken)
sal_Int32 getTokenCount(std::string_view rIn, char cTok)
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
Any SAL_CALL getCaughtException()
int i
std::basic_string_view< charT, traits > getToken(std::basic_string_view< charT, traits > sv, charT delimiter, std::size_t &position)
const sal_Unicode cTokenSeparator
uno::Reference< text::XText > CreateParentXText(SwDoc &rDoc, const SwPosition &rPos)
Definition: unoobj2.cxx:1240
bool XTextRangeToSwPaM(SwUnoInternalPaM &rToFill, const uno::Reference< text::XTextRange > &xTextRange, ::sw::TextRangeMode const eMode)
Definition: unoobj2.cxx:1108
bool GetDefaultTextContentValue(css::uno::Any &rAny, std::u16string_view rPropertyName, sal_uInt16 nWID=0)
bool GoInContent(SwPaM &rPam, SwMoveFnCollection const &fnMove)
Definition: pam.cxx:1203
SwMoveFnCollection const & fnMoveBackward
Definition: paminit.cxx:60
SwMoveFnCollection const & fnMoveForward
SwPam::Move()/Find() default argument.
Definition: paminit.cxx:61
SectionType
Definition: section.hxx:46
std::vector< SwSection * > SwSections
Definition: section.hxx:42
Marks a position in the document model.
Definition: pam.hxx:38
SwNode & GetNode() const
Definition: pam.hxx:81
unsigned char sal_Bool
SwUnoPropertyMapProvider aSwMapProvider
Definition: unomap1.cxx:88
#define WID_SECT_DDE_AUTOUPDATE
Definition: unomap.hxx:157
#define PROPERTY_MAP_SECTION
Definition: unomap.hxx:34
#define WID_SECT_DDE_ELEMENT
Definition: unomap.hxx:152
#define WID_SECT_IS_GLOBAL_DOC_SECTION
Definition: unomap.hxx:159
#define WID_SECT_DOCUMENT_INDEX
Definition: unomap.hxx:158
#define WID_SECT_PASSWORD
Definition: unomap.hxx:160
#define WID_SECT_DDE_TYPE
Definition: unomap.hxx:150
#define WID_SECT_DDE_FILE
Definition: unomap.hxx:151
#define WID_SECT_LINK
Definition: unomap.hxx:153
#define WID_SECT_VISIBLE
Definition: unomap.hxx:154
#define WID_SECT_REGION
Definition: unomap.hxx:156
#define WID_SECT_CURRENTLY_VISIBLE
Definition: unomap.hxx:161
#define WID_SECT_CONDITION
Definition: unomap.hxx:149
#define WID_SECT_PROTECTED
Definition: unomap.hxx:155
#define WID_SECT_EDIT_IN_READONLY
Definition: unomap.hxx:162
static void lcl_UpdateSection(SwSectionFormat *const pFormat, std::unique_ptr< SwSectionData > const &pSectionData, std::optional< SfxItemSet > const &oItemSet, bool const bLinkModeChanged, bool const bLinkUpdateAlways=true)
Definition: unosect.cxx:518
static void lcl_UpdateLinkType(SwSection &rSection, bool const bLinkUpdateAlways)
Definition: unosect.cxx:503