63 #include <com/sun/star/text/XTextDocument.hpp>
64 #include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
82 if (rSource.
GetNext() == &rSource)
94 while (pPam != &rSource);
101 struct FrameClientSortListLess
111 void lcl_CollectFrameAtNodeWithLayout(
const SwContentFrame* pCFrame,
118 for(
const auto pAnchoredObj : *pObjs)
130 rFrames.push_back(entry);
139 const bool bAtCharAnchoredObjs )
148 const auto nChkType = bAtCharAnchoredObjs ? RndStdIds::FLY_AT_CHAR : RndStdIds::FLY_AT_PARA;
155 lcl_CollectFrameAtNodeWithLayout(pCFrame, rFrames, nChkType);
160 const size_t nSize = rFormats.
size();
161 for (
size_t i = 0;
i < nSize;
i++)
168 pAnchorPos->
nNode == rIdx )
174 sal_uInt32 nOrder = rAnchor.
GetOrder();
176 FrameClientSortListEntry entry(nIndex, nOrder, std::make_shared<sw::FrameClient>(const_cast<SwFrameFormat*>(pFormat)));
177 rFrames.push_back(entry);
180 std::sort(rFrames.begin(), rFrames.end(), FrameClientSortListLess());
256 const SetAttrMode nAttrMode,
const bool bTableMode)
268 if (rCurrent.HasMark() &&
270 (*rCurrent.GetPoint() != *rCurrent.GetMark()) ))
297 SfxItemSet & rSet,
const bool bOnlyTextAttr,
const bool bGetFromChrFormat)
299 static const sal_uLong nMaxLookup = 1000;
304 SwPosition const & rStart( *rCurrent.Start() );
307 const sal_uLong nEndNd = rEnd .nNode.GetIndex();
309 if (nEndNd - nSttNd >= nMaxLookup)
325 const sal_Int32 nStart = (
n == nSttNd)
326 ? rStart.nContent.GetIndex() : 0;
327 const sal_Int32 nEnd = (
n == nEndNd)
328 ? rEnd.nContent.GetIndex()
364 uno::Reference< text::XText >
const m_xParentText;
370 SwTable const*
const m_pOwnTable;
372 sal_Int32 m_nFirstParaStart;
373 sal_Int32 m_nLastParaEnd;
374 bool m_bFirstParagraph;
375 uno::Reference< text::XTextContent > m_xNextPara;
378 SwXParagraphEnumerationImpl(
379 uno::Reference< text::XText >
const& xParent,
380 const std::shared_ptr<SwUnoCursor>& pCursor,
383 : m_xParentText( xParent )
384 , m_eCursorType( eType )
387 , m_pOwnStartNode( pStartNode )
390 , m_pOwnTable( pTable )
391 , m_nEndIndex( pCursor->
End()->nNode.GetIndex() )
392 , m_nFirstParaStart( -1 )
393 , m_nLastParaEnd( -1 )
394 , m_bFirstParagraph( true )
397 OSL_ENSURE(m_xParentText.is(),
"SwXParagraphEnumeration: no parent?");
400 || (m_pOwnTable && m_pOwnStartNode));
413 virtual ~SwXParagraphEnumerationImpl()
override
414 { m_pCursor.
reset(
nullptr); }
415 virtual void SAL_CALL release() throw ()
override
418 OWeakObject::release();
423 {
return "SwXParagraphEnumeration"; }
427 {
return {
"com.sun.star.text.ParagraphEnumeration"}; };
430 virtual sal_Bool SAL_CALL hasMoreElements()
override;
431 virtual css::uno::Any SAL_CALL nextElement()
override;
434 {
return *m_pCursor; }
438 uno::Reference< text::XTextContent > NextElement_Impl();
444 bool IgnoreLastElement(
SwUnoCursor& rCursor,
bool bMovedFromTable);
450 uno::Reference< text::XText >
const& xParent,
451 const std::shared_ptr<SwUnoCursor>& pCursor,
456 SwTable const* pTable(
nullptr);
469 pCursor->GetPoint()->nNode.GetNode().FindTableNode());
470 pStartNode = pTableNode;
471 pTable = & pTableNode->GetTable();
477 return new SwXParagraphEnumerationImpl(xParent, pCursor, eType, pStartNode, pTable);
481 SwXParagraphEnumerationImpl::hasMoreElements()
484 return m_bFirstParagraph || m_xNextPara.is();
496 pTmp !=
nullptr && &pTmp->
GetTable() != pOwnTable;
497 pTmp = pTmp->StartOfSectionNode()->FindTableNode() )
512 if (pUnoCursor && pOwnStartNode)
521 bool SwXParagraphEnumerationImpl::IgnoreLastElement(
SwUnoCursor& rCursor,
bool bMovedFromTable)
532 if (!bMovedFromTable)
535 return m_nLastParaEnd == 0;
538 uno::Reference< text::XTextContent >
539 SwXParagraphEnumerationImpl::NextElement_Impl()
544 if (!m_bFirstParagraph &&
553 aNewCursor->SetRemainInSection(
false );
559 bool bMovedFromTable =
false;
564 bMovedFromTable =
true;
570 if (m_nEndIndex < aNewCursor->
Start()->nNode.GetIndex())
575 if (IgnoreLastElement(*aNewCursor, bMovedFromTable))
581 bool bInTable =
false;
582 if (!m_bFirstParagraph)
588 if (pTableNode && (&pTableNode->
GetTable() != m_pOwnTable))
600 uno::Reference< text::XTextContent > xRef;
604 (m_bFirstParagraph || bInTable ||
617 const sal_Int32 nFirstContent =
618 m_bFirstParagraph ? m_nFirstParaStart : -1;
619 const sal_Int32 nLastContent =
620 (m_nEndIndex == pStart->
nNode.
GetIndex()) ? m_nLastParaEnd : -1;
626 pTableNode && (&pTableNode->
GetTable() != m_pOwnTable))
634 text::XText *
const pText = m_xParentText.get();
637 static_cast<SwXText*
>(pText), nFirstContent, nLastContent);
644 uno::Any SAL_CALL SwXParagraphEnumerationImpl::nextElement()
647 if (m_bFirstParagraph)
649 m_xNextPara = NextElement_Impl();
650 m_bFirstParagraph =
false;
652 const uno::Reference< text::XTextContent > xRef = m_xNextPara;
655 throw container::NoSuchElementException();
657 m_xNextPara = NextElement_Impl();
677 const uno::Reference<text::XText>& xParent =
nullptr)
679 , m_eRangePosition(eRange)
681 , m_xParentText(xParent)
682 , m_pTableOrSectionFormat(pTableOrSectionFormat)
685 if (m_pTableOrSectionFormat)
704 m_pTableOrSectionFormat =
nullptr;
712 m_pTableOrSectionFormat =
nullptr;
723 if(rHint.
GetId() == SfxHintId::Dying)
732 const uno::Reference< text::XText > & xParent,
746 SwPaM aPam( aPosition );
753 new
SwXTextRange::
Impl(*rSectionFormat.GetDoc(), RANGE_IS_SECTION, &rSectionFormat) )
798 const OUString& rText,
const bool bForceExpandHints)
803 throw uno::RuntimeException(
"not possible for table");
818 throw uno::RuntimeException(
"disposed?");
828 if (rNode.IsSectionNode())
840 assert(rNode.IsTextNode());
849 if (rNode.IsEndNode())
857 assert(rNode.StartOfSectionNode()->IsSectionNode());
863 assert(rNode.IsTextNode());
885 m_pImpl->m_rDoc.getIDocumentContentOperations().DeleteAndJoin(aCursor);
888 if (!rText.isEmpty())
891 m_pImpl->m_rDoc, aCursor, rText, bForceExpandHints);
894 aCursor.
Left(rText.getLength());
902 class theSwXTextRangeUnoTunnelId :
public rtl::Static< UnoTunnelIdInit, theSwXTextRangeUnoTunnelId > {};
914 return ::sw::UnoTunnelImpl<SwXTextRange>(rId,
this);
920 return "SwXTextRange";
928 uno::Sequence< OUString > SAL_CALL
932 "com.sun.star.text.TextRange",
933 "com.sun.star.style.CharacterProperties",
934 "com.sun.star.style.CharacterPropertiesAsian",
935 "com.sun.star.style.CharacterPropertiesComplex",
936 "com.sun.star.style.ParagraphProperties",
937 "com.sun.star.style.ParagraphPropertiesAsian",
938 "com.sun.star.style.ParagraphPropertiesComplex"
942 uno::Reference< text::XText > SAL_CALL
947 if (!
m_pImpl->m_xParentText.is())
950 m_pImpl->m_pTableOrSectionFormat)
959 OSL_ENSURE(
m_pImpl->m_xParentText.is(),
"SwXTextRange::getText: no text");
963 uno::Reference< text::XTextRange > SAL_CALL
968 uno::Reference< text::XTextRange > xRet;
970 if (!
m_pImpl->m_xParentText.is())
985 &&
m_pImpl->m_pTableOrSectionFormat)
987 auto const pSectFormat(static_cast<SwSectionFormat const*>(
m_pImpl->m_pTableOrSectionFormat));
988 SwPaM aPaM(*pSectFormat->GetContent().GetContentIdx());
990 assert(aPaM.GetPoint()->nNode < *pSectFormat->GetContent().GetContentIdx()->GetNode().EndOfSectionNode());
995 throw uno::RuntimeException(
"disposed?");
1000 uno::Reference< text::XTextRange > SAL_CALL
1005 uno::Reference< text::XTextRange > xRet;
1007 if (!
m_pImpl->m_xParentText.is())
1022 &&
m_pImpl->m_pTableOrSectionFormat)
1024 auto const pSectFormat(static_cast<SwSectionFormat const*>(
m_pImpl->m_pTableOrSectionFormat));
1025 SwPaM aPaM(*pSectFormat->GetContent().GetContentIdx()->GetNode().EndOfSectionNode());
1027 assert(*pSectFormat->GetContent().GetContentIdx() < aPaM.GetPoint()->nNode);
1032 throw uno::RuntimeException(
"disposed?");
1064 if (
auto const pSectFormat = static_cast<SwSectionFormat const*>(
m_pImpl->m_pTableOrSectionFormat))
1066 SwNodeIndex const*
const pSectionNode(pSectFormat->GetContent().GetContentIdx());
1068 assert(pSectionNode->GetNodes().IsDocNodes());
1101 const uno::Reference<text::XTextRange> & xTextRange,
1106 uno::Reference<lang::XUnoTunnel> xRangeTunnel( xTextRange, uno::UNO_QUERY);
1112 if(xRangeTunnel.is())
1114 pRange = ::sw::UnoTunnelGetImplementation<SwXTextRange>(xRangeTunnel);
1116 ::sw::UnoTunnelGetImplementation<OTextCursorHelper>(xRangeTunnel);
1118 ::sw::UnoTunnelGetImplementation<SwXTextPortion>(xRangeTunnel);
1119 pText = ::sw::UnoTunnelGetImplementation<SwXText>(xRangeTunnel);
1120 pPara = ::sw::UnoTunnelGetImplementation<SwXParagraph>(xRangeTunnel);
1126 uno::Reference< text::XTextCursor > xTextCursor;
1130 xTextCursor->gotoEnd(
true);
1132 comphelper::getUnoTunnelImplementation<OTextCursorHelper>(xTextCursor);
1148 const SwPaM*
const pUnoCursor = pCursor ? pCursor->
GetPaM()
1149 : (pPortion ? &pPortion->
GetCursor() :
nullptr);
1150 if (pUnoCursor && pDoc == &rToFill.
GetDoc())
1153 "what to do about rings?");
1180 SfxPoolItem *
const pItemNonConst(const_cast<SfxPoolItem *>(pItem));
1184 if (pHeadFootFormat)
1190 if (pCurSttNode && (pCurSttNode == pSttNode))
1192 rpFormat = pHeadFootFormat;
1202 uno::Reference< text::XTextRange >
1206 const uno::Reference<text::XText> xParentText(
1211 pNewCursor->SetMark();
1212 *pNewCursor->GetMark() = *pMark;
1214 const bool isCell( dynamic_cast<SwXCell*>(xParentText.get()) );
1215 const uno::Reference< text::XTextRange > xRet(
1223 uno::Reference< text::XText >
1226 uno::Reference< text::XText > xParentText;
1244 :
new SwXCell( pTableFormat, *pSttNode );
1250 if (
nullptr != pFormat)
1262 for(
size_t i = 0;
i < nPDescCount;
i++)
1286 if (pHeadFootFormat)
1289 *pHeadFootFormat, bHeader);
1297 for (
size_t n = 0;
n < nFootnoteCnt; ++
n )
1307 &const_cast<SwFormatFootnote&>(rFootnote)), uno::UNO_QUERY);
1316 const uno::Reference<frame::XModel>
xModel =
1318 const uno::Reference< text::XTextDocument > xDoc(
1319 xModel, uno::UNO_QUERY);
1320 xParentText = xDoc->getText();
1323 OSL_ENSURE(xParentText.is(),
"no parent text?");
1329 uno::Reference< container::XEnumeration > SAL_CALL
1334 if ( rServiceName !=
"com.sun.star.text.TextContent" )
1336 throw uno::RuntimeException(
"unsupported service");
1341 throw uno::RuntimeException(
"range has no mark (table?)");
1344 const auto pNewCursor(
m_pImpl->m_rDoc.CreateUnoCursor(aPos));
1347 throw uno::RuntimeException(
"range has no positions");
1353 uno::Reference< container::XEnumeration > SAL_CALL
1360 throw uno::RuntimeException(
"range has no mark (table?)");
1363 auto pNewCursor(
m_pImpl->m_rDoc.CreateUnoCursor(aPos));
1366 throw uno::RuntimeException(
"range has no positions");
1368 if (!
m_pImpl->m_xParentText.is())
1388 uno::Sequence< OUString > SAL_CALL
1391 uno::Sequence<OUString> aRet {
"com.sun.star.text.TextContent" };
1395 uno::Reference< beans::XPropertySetInfo > SAL_CALL
1400 static uno::Reference< beans::XPropertySetInfo > xRef =
1401 m_pImpl->m_rPropSet.getPropertySetInfo();
1407 const OUString& rPropertyName,
const uno::Any& rValue)
1413 throw uno::RuntimeException(
"range has no mark (table?)");
1418 rPropertyName, rValue);
1428 throw uno::RuntimeException(
"range has no mark (table?)");
1439 const uno::Reference< beans::XPropertyChangeListener >& )
1441 OSL_FAIL(
"SwXTextRange::addPropertyChangeListener(): not implemented");
1447 const uno::Reference< beans::XPropertyChangeListener >& )
1449 OSL_FAIL(
"SwXTextRange::removePropertyChangeListener(): not implemented");
1455 const uno::Reference< beans::XVetoableChangeListener >& )
1457 OSL_FAIL(
"SwXTextRange::addVetoableChangeListener(): not implemented");
1463 const uno::Reference< beans::XVetoableChangeListener >& )
1465 OSL_FAIL(
"SwXTextRange::removeVetoableChangeListener(): not implemented");
1468 beans::PropertyState SAL_CALL
1475 throw uno::RuntimeException(
"range has no mark (table?)");
1483 uno::Sequence< beans::PropertyState > SAL_CALL
1490 throw uno::RuntimeException(
"range has no mark (table?)");
1504 throw uno::RuntimeException(
"range has no mark (table?)");
1519 throw uno::RuntimeException(
"range has no mark (table?)");
1529 const OUString& rRedlineType,
1530 const uno::Sequence< beans::PropertyValue >& rRedlineProperties )
1536 throw uno::RuntimeException(
"range has no mark (table?)");
1549 virtual sal_Int64 SAL_CALL getSomething(
const css::uno::Sequence< sal_Int8 >& rIdentifier)
override;
1553 {
return "SwXTextRanges"; };
1557 {
return {
"com.sun.star.text.TextRanges" }; };
1560 virtual css::uno::Type SAL_CALL getElementType()
override
1562 virtual sal_Bool SAL_CALL hasElements()
override
1563 {
return getCount() > 0; };
1565 virtual sal_Int32 SAL_CALL getCount()
override;
1566 virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex)
override;
1568 explicit SwXTextRangesImpl(
SwPaM *
const pPaM)
1577 virtual void SAL_CALL release() throw ()
override
1580 OWeakObject::release();
1583 {
return &(*m_pUnoCursor); };
1585 std::vector< uno::Reference< text::XTextRange > > m_Ranges;
1591 void SwXTextRangesImpl::MakeRanges()
1596 for(
SwPaM& rTmpCursor : GetCursor()->GetRingContainer())
1598 const uno::Reference< text::XTextRange > xRange(
1600 rTmpCursor.GetDoc(),
1601 *rTmpCursor.GetPoint(), rTmpCursor.GetMark()));
1604 m_Ranges.push_back(xRange);
1610 {
return new SwXTextRangesImpl(pPaM); }
1614 class theSwXTextRangesUnoTunnelId :
public rtl::Static< UnoTunnelIdInit, theSwXTextRangesUnoTunnelId > {};
1621 SwXTextRangesImpl::getSomething(
const uno::Sequence< sal_Int8 >& rId)
1623 return ::sw::UnoTunnelImpl<SwXTextRanges>(rId,
this);
1632 sal_Int32 SAL_CALL SwXTextRangesImpl::getCount()
1635 return static_cast<sal_Int32
>(m_Ranges.size());
1638 uno::Any SAL_CALL SwXTextRangesImpl::getByIndex(sal_Int32 nIndex)
1642 throw lang::IndexOutOfBoundsException();
1644 ret <<= m_Ranges.at(nIndex);
1658 if (!rString.isEmpty())
1661 rDoc, rCursor, rString,
false ) );
1662 OSL_ENSURE( bSuccess,
"DocInsertStringSplitCR" );
1664 rCursor.
Left(rString.getLength());
1675 {
return "SwXParaFrameEnumeration"; };
1679 {
return {
"com.sun.star.util.ContentEnumeration"}; };
1682 virtual sal_Bool SAL_CALL hasMoreElements()
override;
1683 virtual css::uno::Any SAL_CALL nextElement()
override;
1686 virtual void SAL_CALL release() throw ()
override
1689 OWeakObject::release();
1692 {
return *m_pUnoCursor; }
1693 void PurgeFrameClients()
1698 m_xNextObject =
nullptr;
1703 const auto iter = std::remove_if(m_vFrames.begin(), m_vFrames.end(),
1704 [] (std::shared_ptr<sw::FrameClient>& rEntry) ->
bool {
return !rEntry->GetRegisteredIn(); });
1705 m_vFrames.erase(iter, m_vFrames.end());
1709 bool CreateNextObject();
1710 uno::Reference< text::XTextContent > m_xNextObject;
1718 {
return new SwXParaFrameEnumerationImpl(rPaM, eParaFrameMode, pFormat); }
1720 SwXParaFrameEnumerationImpl::SwXParaFrameEnumerationImpl(
1723 : m_pUnoCursor(rPaM.GetDoc().CreateUnoCursor(*rPaM.GetPoint()))
1727 GetCursor().SetMark();
1728 *GetCursor().GetMark() = *rPaM.
GetMark();
1734 std::transform(vFrames.begin(), vFrames.end(),
1735 std::back_inserter(m_vFrames),
1740 m_vFrames.push_back(std::make_shared<sw::FrameClient>(pFormat));
1750 const auto pFrameFormat =
const_cast<SwFrameFormat*
>(&pFlyFrame->GetFormat());
1751 m_vFrames.push_back(std::make_shared<sw::FrameClient>(pFrameFormat));
1760 void SwXParaFrameEnumerationImpl::FillFrame()
1762 if(!m_pUnoCursor->GetNode().IsTextNode())
1765 const auto pTextAttr = m_pUnoCursor->GetNode().GetTextNode()->GetTextAttrForCharAt(
1771 m_vFrames.push_back(std::make_shared<sw::FrameClient>(pFrameFormat));
1774 bool SwXParaFrameEnumerationImpl::CreateNextObject()
1776 if (m_vFrames.empty())
1780 m_vFrames.front()->GetRegisteredIn());
1781 m_vFrames.pop_front();
1790 m_xNextObject.set(
pObject->getUnoShape(), uno::UNO_QUERY);
1795 OSL_ENSURE(pIdx,
"where is the index?");
1802 *pFormat->
GetDoc(), pFormat));
1807 *pFormat->
GetDoc(), pFormat));
1813 *pFormat->
GetDoc(), pFormat));
1816 return m_xNextObject.is();
1820 SwXParaFrameEnumerationImpl::hasMoreElements()
1823 PurgeFrameClients();
1824 return m_xNextObject.is() || CreateNextObject();
1827 uno::Any SAL_CALL SwXParaFrameEnumerationImpl::nextElement()
1830 PurgeFrameClients();
1831 if (!m_xNextObject.is() && !m_vFrames.empty())
1833 if (!m_xNextObject.is())
1834 throw container::NoSuchElementException();
1836 aRet <<= m_xNextObject;
1837 m_xNextObject =
nullptr;
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
SwStartNode * FindSttNodeByType(SwStartNodeType eTyp)
const SwEndNode * EndOfSectionNode() const
Starts a section of nodes in the document model.
bool MovePara(SwWhichPara, SwMoveFnCollection const &)
std::shared_ptr< SwUnoCursor > CreateUnoCursor(const SwPosition &rPos, bool bTableCursor=false)
virtual sal_Int32 Len() const
static css::uno::Reference< css::text::XTextTable > CreateXTextTable(SwFrameFormat *pFrameFormat)
sal_uLong GetIndex() const
static void DeleteTable(SwDoc &rDoc, SwTable &rTable)
SwNode & GetNode(bool bPoint=true) const
bool GoInContent(SwPaM &rPam, SwMoveFnCollection const &fnMove)
virtual const SwDoc * GetDoc() const =0
const SwSortedObjs * GetDrawObjs() const
Marks a position in the document model.
bool IsSectionNode() const
bool IsMultiSelection() const
SwFrameFormat & GetLeft()
#define PROPERTY_MAP_TEXT_CURSOR
SwTableBox * GetTableBox() const
If node is in a table return the respective table box.
const OUString & GetText() const
virtual const SwRootFrame * GetCurrentLayout() const =0
~UnoActionContext() COVERITY_NOEXCEPT_FALSE
static rtl::Reference< SwXCell > CreateXCell(SwFrameFormat *pTableFormat, SwTableBox *pBox, SwTable *pTable=nullptr)
SwDocShell * GetDocShell()
constexpr TypedWhichId< SwFormatHeader > RES_HEADER(96)
virtual void InsertItemSet(const SwPaM &rRg, const SfxItemSet &, const SetAttrMode nFlags=SetAttrMode::DEFAULT, SwRootFrame const *pLayout=nullptr)=0
std::deque< FrameClientSortListEntry > FrameClientSortList_t
static css::uno::Reference< css::text::XTextContent > CreateXParagraph(SwDoc &rDoc, SwTextNode *pTextNode, css::uno::Reference< css::text::XText > const &xParentText=nullptr, const sal_Int32 nSelStart=-1, const sal_Int32 nSelEnd=-1)
const SwPosition * GetMark() const
SwFrameFormat & GetFirstMaster()
SwContentFrame * getLayoutFrame(const SwRootFrame *, const SwPosition *pPos=nullptr, std::pair< Point, bool > const *pViewPosAndCalcFrame=nullptr) const
virtual SwUndoId EndUndo(SwUndoId const eUndoId, SwRewriter const *const pRewriter)=0
Closes undo block.
Provides access to the marks of a document.
bool Left(sal_uInt16 nCnt)
SwMoveFnCollection const & fnParaStart
constexpr TypedWhichId< SwFormatFlyCnt > RES_TXTATR_FLYCNT(57)
virtual const SwPosition & GetMarkPos() const =0
css::uno::Sequence< OUString > getSupportedServiceNames()
OUString getImplementationName()
UnoActionContext(SwDoc *const pDoc)
Content, content of frame (header, footer, fly).
static SwXParagraphEnumeration * Create(css::uno::Reference< css::text::XText > const &xParent, const std::shared_ptr< SwUnoCursor > &pCursor, const CursorType eType, SwTableBox const *const pTableBox=nullptr)
IDocumentMarkAccess * getIDocumentMarkAccess()
Dialog to specify the properties of date form field.
IDocumentUndoRedo & GetIDocumentUndoRedo()
virtual bool DeleteAndJoin(SwPaM &, const bool bForceJoinNext=false)=0
complete delete of a given PaM
css::uno::Any GetPropertyDefault(SwPaM const &rPaM, const SfxItemPropertySet &rPropSet, std::u16string_view rPropertyName)
IDocumentContentOperations const & getIDocumentContentOperations() const
EmbeddedObjectRef * pObject
The root element of a Writer document layout.
bool SelectPaM(SwPaM &rPaM)
make rPaM select the paragraph
SwTableFormat * GetFrameFormat()
void MoveTo(value_type *pDestRing)
Removes this item from its current ring container and adds it to another ring container.
const SwFrameFormats * GetSpzFrameFormats() const
SwPosFlyFrames GetAllFlyFormats(const SwPaM *, bool bDrawAlso, bool bAsCharAlso=false) const
Returns positions of all FlyFrames in the document.
void SetString(SwCursor &rCursor, const OUString &rString)
SwTableNode * GetTableNode()
void SetRemainInSection(bool bFlag)
SwNodeType GetNodeType() const
void GetCursorAttr(SwPaM &rPam, SfxItemSet &rSet, const bool bOnlyTextAttr=false, const bool bGetFromChrFormat=true)
void UnoRestoreAllActions()
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
static void lcl_RemoveImpl(SwDoc *const pDoc)
virtual ::sw::mark::IMark * makeMark(const SwPaM &rPaM, const OUString &rProposedName, MarkType eMark,::sw::mark::InsertMode eMode, SwPosition const *pSepPos=nullptr)=0
Generates a new mark in the document for a certain selection.
static SwXParaFrameEnumeration * Create(const SwPaM &rPaM, const enum ParaFrameMode eParaFrameMode, SwFrameFormat *const pFormat=nullptr)
constexpr TypedWhichId< SfxUInt16Item > RES_PARATR_OUTLINELEVEL(79)
sal_uLong GetIndex() const
static bool isTextBox(const SwFrameFormat *pFormat, sal_uInt16 nType)
Is the frame format a text box?
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
const SwTable & GetTable() const
void GetTextFromPam(SwPaM &rPam, OUString &rBuffer, SwRootFrame const *pLayout=nullptr)
static SwTableNode * lcl_FindTopLevelTable(SwTableNode *const pTableNode, SwTable const *const pOwnTable)
! compare to SwShellTableCursor::FillRects() in viscrs.cxx
css::uno::Reference< css::frame::XModel > GetBaseModel() const
void Normalize(bool bPointFirst=true)
Normalizes PaM, i.e.
void SelectPam(SwPaM &rPam, const bool bExpand)
static bool lcl_CursorIsInSection(SwUnoCursor const *const pUnoCursor, SwStartNode const *const pOwnStartNode)
void SetPropertyToDefault(SwPaM &rPaM, const SfxItemPropertySet &rPropSet, std::u16string_view rPropertyName)
virtual std::unique_ptr< ILazyDeleter > deleteMark(const IDocumentMarkAccess::const_iterator_t &ppMark)=0
Deletes a mark.
SwTableSortBoxes & GetTabSortBoxes()
PaM is Point and Mark: a selection of the document model.
bool Move(SwMoveFnCollection const &fnMove=fnMoveForward, SwGoInDoc fnGo=GoInContent)
Movement of cursor.
static SwTable * FindTable(SwFrameFormat const *const pFormat)
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
void UpdateOutlineNode(SwNode &rNd)
Update all Nodes - Rule/Format-Change.
virtual SwUndoId StartUndo(SwUndoId const eUndoId, SwRewriter const *const pRewriter)=0
Opens undo block.
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
bool GoInNode(SwPaM &rPam, SwMoveFnCollection const &fnMove)
const SwStartNode * StartOfSectionNode() const
const SwPosition * GetPoint() const
SwIndex & Assign(SwIndexReg *, sal_Int32)
const SwPageDesc & GetPageDesc(const size_t i) const
bool GetParaAttr(SfxItemSet &rSet, sal_Int32 nStt, sal_Int32 nEnd, const bool bOnlyTextAttr=false, const bool bGetFromChrFormat=true, const bool bMergeIndentValuesOfNumRule=false, SwRootFrame const *pLayout=nullptr) const
Query the attributes of textnode over the range.
void CollectFrameAtNode(const SwNodeIndex &rIdx, FrameClientSortList_t &rFrames, const bool bAtCharAnchoredObjs)
SwContentNode * GetContentNode()
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
std::deque< std::shared_ptr< sw::FrameClient > > FrameClientList_t
UnoActionRemoveContext(SwDoc *const pDoc)
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
size_t GetPageDescCnt() const
virtual css::uno::Reference< css::text::XTextCursor > CreateCursor()
bool IsNoTextNode() const
Marks a node in the document model.
css::uno::Type const & get()
static SwDoc * lcl_IsNewStyleTable(SwUnoTableCursor const &rCursor)
ring_container GetRingContainer()
void MergeValues(const SfxItemSet &rSet)
SwStartNodeType GetStartNodeType() const
bool StartListening(SvtBroadcaster &rBroadcaster)
SfxItemPool * GetPool() const
const SwFormatFootnote & GetFootnote() const
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
enumrange< T >::Iterator end(enumrange< T >)
SwTable is one table in the document model, containing rows (which contain cells).
const SwPosition * Start() const
bool XTextRangeToSwPaM(SwUnoInternalPaM &rToFill, const uno::Reference< text::XTextRange > &xTextRange,::sw::TextRangeMode const eMode)
const SwNodeIndex * GetContentIdx() const
SvtBroadcaster & GetNotifier()
virtual const SwPaM * GetPaM() const =0
css::uno::Any GetPropertyValue(SwPaM &rPaM, const SfxItemPropertySet &rPropSet, std::u16string_view rPropertyName)
SwFrameFormat & GetMaster()
sal_uLong EndOfSectionIndex() const
SwTextNode is a paragraph in the document model.
const SwStartNode * GetSttNd() const
virtual const SwViewShell * GetCurrentViewShell() const =0
Returns the layout set at the document.
void reset(std::shared_ptr< SwUnoCursor > pNew)
void UnoRemoveAllActions()
Certain UNO Actions (e.g.
css::uno::Sequence< css::beans::PropertyState > GetPropertyStates(SwPaM &rPaM, const SfxItemPropertySet &rPropSet, const css::uno::Sequence< OUString > &rPropertyNames, const SwGetPropertyStatesCaller eCaller=SW_PROPERTY_STATE_CALLER_DEFAULT)
SwMoveFnCollection const & fnMoveForward
SwPam::Move()/Find() default argument.
SwFrameFormat & GetFirstLeft()
static bool lcl_IsStartNodeInFormat(const bool bHeader, SwStartNode const *const pSttNode, SwFrameFormat const *const pFrameFormat, SwFrameFormat *&rpFormat)
sal_Int32 GetIndex() const
void SetPropertyValue(SwPaM &rPaM, const SfxItemPropertySet &rPropSet, const OUString &rPropertyName, const css::uno::Any &rValue, const SetAttrMode nAttrMode=SetAttrMode::DEFAULT)
SwUnoCursor & GetCursor() const
const SwPosition * End() const
bool GoNextPara(SwPaM &rPam, SwMoveFnCollection const &aPosPara)
static SW_DLLPUBLIC css::uno::Reference< css::text::XTextFrame > CreateXTextFrame(SwDoc &rDoc, SwFrameFormat *pFrameFormat)
SwTableBox is one table cell in the document model.
SwUnoPropertyMapProvider aSwMapProvider
void makeRedline(SwPaM const &rPaM, std::u16string_view rRedlineType, const uno::Sequence< beans::PropertyValue > &rRedlineProperties)
constexpr TypedWhichId< SwDrawFrameFormat > RES_DRAWFRMFMT(157)
virtual const SwPosition & GetMarkEnd() const =0
constexpr TypedWhichId< SwFlyFrameFormat > RES_FLYFRMFMT(154)
virtual void CallSwClientNotify(const SfxHint &rHint) const override
SwMoveFnCollection const & fnMoveBackward
~UnoActionRemoveContext() COVERITY_NOEXCEPT_FALSE
SwTableNode * FindTableNode()
Search table node, in which it is.
void SetCursorAttr(SwPaM &rPam, const SfxItemSet &rSet, const SetAttrMode nAttrMode, const bool bTableMode=false)
const sal_uInt16 * GetRanges() const
constexpr TypedWhichId< SwFormatFooter > RES_FOOTER(97)
SwFootnoteIdxs & GetFootnoteIdxs()
Reference< XModel > xModel
void InvalidateAllItems()
bool DocInsertStringSplitCR(SwDoc &rDoc, const SwPaM &rNewCursor, const OUString &rText, const bool bForceExpandHints)
static css::uno::Reference< css::text::XTextContent > CreateXTextEmbeddedObject(SwDoc &rDoc, SwFrameFormat *pFrameFormat)
virtual const SwPosition & GetMarkStart() const =0
Ends a section of nodes in the document model.
void StartAllAction()
Set up Start-/EndAction for all Shells on an as high as possible (Shell section) level.
static css::uno::Reference< css::text::XTextContent > CreateXTextGraphicObject(SwDoc &rDoc, SwFrameFormat *pFrameFormat)
virtual void SetMark()
Unless this is called, the getter method of Mark will return Point.
css::beans::PropertyState GetPropertyState(SwPaM &rPaM, const SfxItemPropertySet &rPropSet, const OUString &rPropertyName)
std::pair< const_iterator, bool > insert(Value &&x)
void EndAllAction(bool bVirDev=false)
virtual bool IsExpanded() const =0
void DeepCopyPaM(SwPaM const &rSource, SwPaM &rTarget)
bool DeleteRowCol(const SwSelBoxes &rBoxes, RowColMode eMode=RowColMode::DeleteRow)
SwFrameFormat * GetFlyFormat() const
If node is in a fly return the respective format.
uno::Reference< text::XText > CreateParentXText(SwDoc &rDoc, const SwPosition &rPos)
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
virtual const SwPosition & GetOtherMarkPos() const =0
SwTableNode * GetTableNode() const
Base class of the Writer document model elements.