25#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
26#include <com/sun/star/text/ControlCharacter.hpp>
27#include <com/sun/star/text/TableColumnSeparator.hpp>
28#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
29#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
54#include <unofield.hxx>
57#include <unoprnms.hxx>
64#include <bookmark.hxx>
102 uno::Reference< text::XTextRange >
104 const uno::Sequence< beans::PropertyValue >&
105 rCharacterAndParagraphProperties,
106 const uno::Reference< text::XTextRange >& xInsertPosition);
111 const uno::Reference<text::XTextRange>& xPos1,
112 const uno::Reference<text::XTextRange>& xPos2);
119 const uno::Sequence< uno::Reference< text::XTextRange > > & rCell,
120 std::vector<SwNodeRange> & rRowNodes,
156 OSL_ENSURE(!
m_pImpl->m_pDoc || !pDoc,
157 "SwXText::SetDoc: already have a doc?");
159 m_pImpl->m_bIsValid = (
nullptr != pDoc);
184 uno::RuntimeException aRuntime;
188 return static_cast<text::XWordCursor*
>(xCursor.get());
200 xRet->gotoStart(
false);
206 const ::css::uno::Reference< ::css::text::XTextRange >& aTextPosition )
219 aRet <<= uno::Reference< text::XText >(
this);
223 aRet <<= uno::Reference< text::XSimpleText >(
this);
227 aRet <<= uno::Reference< text::XTextRange>(
this);
231 aRet <<= uno::Reference< text::XTextRangeCompare >(
this);
235 aRet <<= uno::Reference< lang::XTypeProvider >(
this);
239 aRet <<= uno::Reference< text::XRelativeTextContentInsert >(
this);
243 aRet <<= uno::Reference< text::XRelativeTextContentRemove >(
this);
247 aRet <<= uno::Reference< beans::XPropertySet >(
this);
251 aRet <<= uno::Reference< text::XTextAppendAndConvert >(
this);
255 aRet <<= uno::Reference< text::XTextAppend >(
this);
259 aRet <<= uno::Reference< text::XTextPortionAppend >(
this);
263 aRet <<= uno::Reference< text::XParagraphAppend >(
this);
267 aRet <<= uno::Reference< text::XTextConvert >(
this);
271 aRet <<= uno::Reference< text::XTextContentAppend >(
this);
275 aRet <<= uno::Reference< text::XTextCopy >(
this );
280uno::Sequence< uno::Type > SAL_CALL
283 static const uno::Sequence< uno::Type >
aTypes {
303 const OUString& rString,
sal_Bool bAbsorb)
308 if (!xTextRange.is())
310 throw uno::RuntimeException();
314 throw uno::RuntimeException();
317 OTextCursorHelper *
const pCursor =
dynamic_cast<OTextCursorHelper*
>(xTextRange.get());
319 (!pCursor || pCursor->GetDoc() !=
GetDoc()))
321 throw uno::RuntimeException();
326 const SwPaM * pPam(
nullptr);
329 pPam = pCursor->GetPaM();
340 throw uno::RuntimeException();
348 if (!pOwnStartNode || (pOwnStartNode != pTmp))
350 throw uno::RuntimeException();
353 bool bForceExpandHints(
false );
360 catch (
const lang::IllegalArgumentException& iae)
364 throw lang::WrappedTargetRuntimeException( iae.Message,
365 uno::Reference< uno::XInterface >(), anyEx );
379 pTextCursor->
DeleteAndInsert(rString, ::sw::DeleteAndInsertMode::ForceReplace
384 xTextRange->setString(rString);
389 pRange->
DeleteAndInsert(rString, ::sw::DeleteAndInsertMode::ForceReplace
401 *
GetDoc(), aInsertPam, rString, bForceExpandHints );
407 const uno::Reference< text::XTextRange > & xTextRange,
408 sal_Int16 nControlCharacter,
sal_Bool bAbsorb)
412 if (!xTextRange.is())
414 throw lang::IllegalArgumentException();
418 throw uno::RuntimeException();
424 throw uno::RuntimeException();
435 m_pImpl->m_pDoc->getIDocumentContentOperations().DeleteAndJoin(aPam);
440 switch (nControlCharacter)
442 case text::ControlCharacter::PARAGRAPH_BREAK :
445 m_pImpl->m_pDoc->getIDocumentContentOperations().SplitNode(*aPam.
GetPoint(),
false);
447 case text::ControlCharacter::APPEND_PARAGRAPH:
450 m_pImpl->m_pDoc->getIDocumentContentOperations().AppendTextNode(*aPam.
GetPoint());
454 OTextCursorHelper *
const pCursor =
455 dynamic_cast<OTextCursorHelper*
>(xTextRange.get());
462 SwPaM *
const pCursorPam = pCursor->GetPaM();
468 case text::ControlCharacter::LINE_BREAK: cIns = 10;
break;
469 case text::ControlCharacter::SOFT_HYPHEN: cIns =
CHAR_SOFTHYPHEN;
break;
470 case text::ControlCharacter::HARD_HYPHEN: cIns =
CHAR_HARDHYPHEN;
break;
471 case text::ControlCharacter::HARD_SPACE: cIns =
CHAR_HARDBLANK;
break;
475 m_pImpl->m_pDoc->getIDocumentContentOperations().InsertString(
476 aPam, OUString(cIns), nInsertFlags);
484 OTextCursorHelper *
const pCursor =
485 dynamic_cast<OTextCursorHelper*
>(xTextRange.get());
497 SwPaM *
const pUnoCursor = pCursor->GetPaM();
513 const uno::Reference< text::XTextRange > & xRange,
514 const uno::Reference< text::XTextContent > & xContent,
522 lang::IllegalArgumentException aIllegal;
523 aIllegal.Message =
"first parameter invalid;";
528 lang::IllegalArgumentException aIllegal;
529 aIllegal.Message =
"second parameter invalid";
534 uno::RuntimeException aRuntime;
542 lang::IllegalArgumentException aIllegal;
543 aIllegal.Message =
"first parameter invalid";
578 if (pOwnStartNode != pTmp)
580 uno::RuntimeException aRunException;
581 aRunException.Message =
"text interface and cursor not related";
601 pTextField =
nullptr;
603 const bool bAttribute = pBookmark || pDocumentIndexMark
604 || pSection || pReferenceMark || pMeta || pContentControl || pTextField;
606 if (bAbsorb && !bAttribute)
610 pRange->DeleteAndInsert(
u"", ::sw::DeleteAndInsertMode::ForceReplace
615 pCursor->DeleteAndInsert(
u"", ::sw::DeleteAndInsertMode::ForceReplace
620 xRange->setString(OUString());
623 uno::Reference< text::XTextRange > xTempRange =
624 (bAttribute && bAbsorb) ? xRange : xRange->getStart();
625 if (bForceExpandHints)
630 xContent->attach(xTempRange);
635 const uno::Reference< text::XTextContent>& xNewContent,
636 const uno::Reference< text::XTextContent>& xSuccessor)
642 uno::RuntimeException aRuntime;
648 if (!pPara || !pPara->
IsDescriptor() || !xSuccessor.is())
650 throw lang::IllegalArgumentException();
668 else if (pXSection && pXSection->
GetFormat() &&
679 if (!bRet || !pTextNode)
681 throw lang::IllegalArgumentException();
688 const uno::Reference< text::XTextContent>& xNewContent,
689 const uno::Reference< text::XTextContent>& xPredecessor)
695 throw uno::RuntimeException();
699 if(!pPara || !pPara->
IsDescriptor() || !xPredecessor.is())
701 throw lang::IllegalArgumentException();
719 else if (pXSection && pXSection->
GetFormat() &&
729 if (!bRet || !pTextNode)
731 throw lang::IllegalArgumentException();
738 const uno::Reference< text::XTextContent>& xSuccessor)
744 uno::RuntimeException aRuntime;
761 SwPaM aBefore(aTableIdx);
765 else if (pXSection && pXSection->
GetFormat() &&
774 SwPaM aBefore(aSectIdx);
780 throw lang::IllegalArgumentException();
786 const uno::Reference< text::XTextContent>& xPredecessor)
792 uno::RuntimeException aRuntime;
810 SwPaM aPaM(aTableIdx);
814 else if (pXSection && pXSection->
GetFormat() &&
823 SwPaM aAfter(aSectIdx);
829 throw lang::IllegalArgumentException();
835 const uno::Reference< text::XTextContent > & xContent)
840 uno::RuntimeException aRuntime;
841 aRuntime.Message =
"first parameter invalid";
847uno::Reference< text::XText > SAL_CALL
853 const uno::Reference< text::XText > xRet(
this);
857uno::Reference< text::XTextRange > SAL_CALL
865 uno::RuntimeException aRuntime;
869 xRef->gotoStart(
false);
870 return static_cast<text::XWordCursor*
>(xRef.get());
873uno::Reference< text::XTextRange > SAL_CALL
881 uno::RuntimeException aRuntime;
885 xRef->gotoEnd(
false);
886 return static_cast<text::XWordCursor*
>(xRef.get());
896 SAL_WARN(
"sw.uno",
"cursor was not created in getString() call. Returning empty string.");
900 return xRet->getString();
910 uno::RuntimeException aRuntime;
918 throw uno::RuntimeException();
933 bool bInsertNodes =
false;
946 while(aStartIdx < aEndIdx);
959 uno::RuntimeException aRuntime;
964 xRet->setString(rString);
976 xOwnCursor->GetPaM()->GetPointNode().StartOfSectionNode();
1011 return (pOwnStartNode == pTmp);
1016 const uno::Reference<text::XTextRange>& xPos1,
1017 const uno::Reference<text::XTextRange>& xPos2)
1025 throw lang::IllegalArgumentException();
1027 if (!CheckForOwnMember(aPam1) || !CheckForOwnMember(aPam2))
1029 throw lang::IllegalArgumentException();
1032 sal_Int16 nCompare = 0;
1035 if (*pStart1 < *pStart2)
1039 else if (*pStart1 > *pStart2)
1045 OSL_ENSURE(*pStart1 == *pStart2,
1046 "SwPositions should be equal here");
1055 const uno::Reference<text::XTextRange>& xRange1,
1056 const uno::Reference<text::XTextRange>& xRange2)
1060 if (!xRange1.is() || !xRange2.is())
1062 throw lang::IllegalArgumentException();
1064 const uno::Reference<text::XTextRange> xStart1 = xRange1->getStart();
1065 const uno::Reference<text::XTextRange> xStart2 = xRange2->getStart();
1067 return m_pImpl->ComparePositions(xStart1, xStart2);
1072 const uno::Reference<text::XTextRange>& xRange1,
1073 const uno::Reference<text::XTextRange>& xRange2)
1077 if (!xRange1.is() || !xRange2.is())
1079 throw lang::IllegalArgumentException();
1081 uno::Reference<text::XTextRange> xEnd1 = xRange1->getEnd();
1082 uno::Reference<text::XTextRange> xEnd2 = xRange2->getEnd();
1084 return m_pImpl->ComparePositions(xEnd1, xEnd2);
1087uno::Reference< beans::XPropertySetInfo > SAL_CALL
1092 static uno::Reference< beans::XPropertySetInfo > xInfo =
1093 m_pImpl->m_rPropSet.getPropertySetInfo();
1101 throw lang::IllegalArgumentException();
1106 const OUString& rPropertyName)
1112 throw uno::RuntimeException();
1116 m_pImpl->m_rPropSet.getPropertyMap().getByName(rPropertyName);
1119 beans::UnknownPropertyException aExcept;
1120 aExcept.Message =
"Unknown property: " + rPropertyName;
1125 switch (pEntry->
nWID)
1133 const size_t nRedTableCount = rRedTable.
size();
1134 if (nRedTableCount > 0)
1138 for (
size_t nRed = 0; nRed < nRedTableCount; ++nRed)
1143 if (rOwnIndex == rRedNode)
1160 const uno::Reference< beans::XPropertyChangeListener >& )
1162 OSL_FAIL(
"SwXText::addPropertyChangeListener(): not implemented");
1168 const uno::Reference< beans::XPropertyChangeListener >& )
1170 OSL_FAIL(
"SwXText::removePropertyChangeListener(): not implemented");
1176 const uno::Reference< beans::XVetoableChangeListener >& )
1178 OSL_FAIL(
"SwXText::addVetoableChangeListener(): not implemented");
1184 const uno::Reference< beans::XVetoableChangeListener >& )
1186 OSL_FAIL(
"SwXText::removeVetoableChangeListener(): not implemented");
1193uno::Reference< text::XTextRange > SAL_CALL
1195 const uno::Sequence< beans::PropertyValue > & rProperties)
1199 return m_pImpl->finishOrAppendParagraph(rProperties, uno::Reference< text::XTextRange >());
1202uno::Reference< text::XTextRange > SAL_CALL
1204 const uno::Sequence< beans::PropertyValue > & rProperties,
1205 const uno::Reference< text::XTextRange >& xInsertPosition)
1209 return m_pImpl->finishOrAppendParagraph(rProperties, xInsertPosition);
1212uno::Reference< text::XTextRange >
1214 const uno::Sequence< beans::PropertyValue > & rProperties,
1215 const uno::Reference< text::XTextRange >& xInsertPosition)
1219 throw uno::RuntimeException();
1225 throw uno::RuntimeException();
1228 uno::Reference< text::XTextRange > xRet;
1229 bool bIllegalException =
false;
1230 bool bRuntimeException =
false;
1239 if (xInsertPosition.is())
1246 m_pDoc->getIDocumentContentOperations().AppendTextNode( *aPam.
GetPoint() );
1248 m_pDoc->ResetAttrs(aPam);
1264 auto itCharStyle = std::find_if(rProperties.begin(), rProperties.end(), [](
const beans::PropertyValue& rValue)
1266 return rValue.Name ==
"CharStyleName";
1268 if ( itCharStyle != rProperties.end() )
1270 for (
const auto& rValue : rProperties)
1272 if ( rValue != *itCharStyle && rValue.Name.startsWith(
"Char") )
1280 catch (
const lang::IllegalArgumentException& rIllegal)
1283 bIllegalException =
true;
1285 catch (
const uno::RuntimeException& rRuntime)
1288 bRuntimeException =
true;
1290 catch (
const uno::Exception& rEx)
1293 bRuntimeException =
true;
1296 m_pDoc->GetIDocumentUndoRedo().EndUndo(
SwUndoId::END,
nullptr);
1297 if (bIllegalException || bRuntimeException)
1299 m_pDoc->GetIDocumentUndoRedo().Undo();
1300 if (bIllegalException)
1302 lang::IllegalArgumentException aEx;
1308 uno::RuntimeException aEx;
1314 OSL_ENSURE(pTextNode,
"no SwTextNode?");
1323uno::Reference< text::XTextRange > SAL_CALL
1325 const OUString& rText,
1326 const uno::Sequence< beans::PropertyValue > &
1327 rCharacterAndParagraphProperties,
1328 const uno::Reference<text::XTextRange>& xInsertPosition)
1334 throw uno::RuntimeException();
1336 uno::Reference< text::XTextRange > xRet;
1339 bool bIllegalException =
false;
1340 bool bRuntimeException =
false;
1344 auto& rCursor(xTextCursor->GetCursor());
1345 m_pImpl->m_pDoc->DontExpandFormat( *rCursor.Start() );
1347 if (!rText.isEmpty())
1349 SwNodeIndex const nodeIndex(rCursor.GetPoint()->GetNode(), -1);
1350 const sal_Int32 nContentPos = rCursor.GetPoint()->GetContentIndex();
1352 *
m_pImpl->m_pDoc, rCursor, rText,
false);
1362 rCharacterAndParagraphProperties,
1365 catch (
const lang::IllegalArgumentException& rIllegal)
1368 bIllegalException =
true;
1370 catch (
const uno::RuntimeException& rRuntime)
1373 bRuntimeException =
true;
1376 if (bIllegalException || bRuntimeException)
1378 m_pImpl->m_pDoc->GetIDocumentUndoRedo().Undo();
1379 if (bIllegalException)
1381 lang::IllegalArgumentException aEx;
1387 uno::RuntimeException aEx;
1398uno::Reference< text::XTextRange > SAL_CALL
1400 const OUString& rText,
1401 const uno::Sequence< beans::PropertyValue > &
1402 rCharacterAndParagraphProperties)
1406 uno::Reference<text::XTextRange> xInsertPosition =
getEnd();
1407 return insertTextPortion(rText, rCharacterAndParagraphProperties, xInsertPosition);
1412uno::Reference< text::XTextRange > SAL_CALL
1414 const uno::Reference< text::XTextContent >& xTextContent,
1415 const uno::Sequence< beans::PropertyValue >&
1416 rCharacterAndParagraphProperties,
1417 const uno::Reference< text::XTextRange >& xInsertPosition)
1423 throw uno::RuntimeException();
1429 throw lang::IllegalArgumentException(
"invalid position",
nullptr, 2);
1445 if (rCharacterAndParagraphProperties.hasElements())
1449 const uno::Reference< beans::XPropertySet > xAnchor(
1450 xTextContent->getAnchor(), uno::UNO_QUERY);
1453 for (
const auto& rProperty : rCharacterAndParagraphProperties)
1455 xAnchor->setPropertyValue(rProperty.Name, rProperty.Value);
1459 catch (
const uno::Exception& e)
1463 throw lang::WrappedTargetRuntimeException( e.Message,
1464 uno::Reference< uno::XInterface >(), anyEx );
1468 return xInsertPosition;
1471uno::Reference< text::XTextRange > SAL_CALL
1473 const uno::Reference< text::XTextContent >& xTextContent,
1474 const uno::Sequence< beans::PropertyValue >& rCharacterAndParagraphProperties
1479 uno::Reference<text::XTextRange> xInsertPosition =
getEnd();
1494 return index.GetNode().IsGrfNode();
1500 if (rAnchor.
GetAnchorId() != RndStdIds::FLY_AT_PARA)
1527uno::Reference< text::XTextContent > SAL_CALL
1529 const uno::Reference< text::XTextRange >& xStart,
1530 const uno::Reference< text::XTextRange >& xEnd,
1531 const uno::Sequence< beans::PropertyValue >& rFrameProperties)
1537 throw uno::RuntimeException();
1544 for (
const auto& rCellProperty : rFrameProperties)
1546 if (rCellProperty.Name ==
"CursorNotIgnoreTables")
1548 bool bAllowNonTextNode =
false;
1549 rCellProperty.Value >>= bAllowNonTextNode;
1550 if (bAllowNonTextNode)
1551 eMode = ::sw::TextRangeMode::AllowTableNode;
1555 uno::Reference< text::XTextContent > xRet;
1556 std::optional<SwUnoInternalPaM> pTempStartPam(*
GetDoc());
1557 std::optional<SwUnoInternalPaM> pEndPam(*
GetDoc());
1561 throw lang::IllegalArgumentException();
1564 auto pStartPam(
GetDoc()->CreateUnoCursor(*pTempStartPam->GetPoint()));
1565 if (pTempStartPam->HasMark())
1567 pStartPam->SetMark();
1568 *pStartPam->GetMark() = *pTempStartPam->GetMark();
1570 pTempStartPam.reset();
1586 bool bIllegalException =
false;
1587 bool bRuntimeException =
false;
1599 bool bParaAfterInserted =
false;
1600 bool bParaBeforeInserted =
false;
1601 ::std::optional<SwPaM> oAnchorCheckPam;
1602 oAnchorCheckPam.emplace(*pStartPam->Start(), *pEndPam->End());
1604 pStartStartNode && pEndStartNode &&
1605 (pStartStartNode != pEndStartNode || pStartStartNode !=
GetStartNode())
1617 while (pEndStartTableNode && pStartTableNode &&
1624 if (pStartTableNode)
1626 const SwNodeIndex aTableIdx( *pStartTableNode, -1 );
1629 pStartPam->DeleteMark();
1630 *pStartPam->GetPoint() = aBefore;
1639 pEndPam->DeleteMark();
1640 *pEndPam->GetPoint() = aTableEnd;
1644 if ((pStartStartNode != pEndStartNode) ||
1648 if (bParaBeforeInserted)
1650 SwCursor aDelete(*pStartPam->GetPoint(),
nullptr);
1651 *pStartPam->GetPoint() =
1658 if (bParaAfterInserted)
1660 SwCursor aDelete(*pEndPam->GetPoint(),
nullptr);
1661 *pEndPam->GetPoint() =
1668 throw lang::IllegalArgumentException();
1676 if (pStartPam->Start()->GetNode() == pEndPam->Start()->GetNode()
1677 && pStartPam->End()->GetNode() == pEndPam->End()->GetNode())
1681 pEndPam->DeleteMark();
1682 *pEndPam->GetPoint() = aEnd;
1683 *oAnchorCheckPam->End() = aEnd;
1686 *pStartPam->End() = *pEndPam->End();
1693 std::set<OUString> aAnchoredObjectsByName;
1694 for (
size_t i = 0;
i <
m_pImpl->m_pDoc->GetSpzFrameFormats()->
size(); ++
i)
1704 || (RndStdIds::FLY_AT_CHAR == rAnchor.
GetAnchorId()
1708 if (pFrameFormat->
GetName().isEmpty())
1714 aAnchoredObjectsByName.insert(pFrameFormat->
GetName());
1718 oAnchorCheckPam.reset();
1720 const uno::Reference<text::XTextFrame> xNewFrame(
1725 for (
const beans::PropertyValue& rValue : rFrameProperties)
1727 rNewFrame.SwXFrame::setPropertyValue(rValue.Name, rValue.Value);
1732 const uno::Reference< text::XTextRange> xInsertTextRange =
1734 assert(rNewFrame.IsDescriptor());
1735 rNewFrame.attachToRange(xInsertTextRange, pStartPam.get());
1736 assert(!rNewFrame.getName().isEmpty());
1739 SwTextNode *
const pTextNode(pStartPam->GetPointNode().GetTextNode());
1741 if (!pTextNode || !pTextNode->
Len())
1745 SwPaM aMovePam( pStartPam->GetPointNode() );
1749 SwFormatAnchor aNewAnchor(rNewFrame.GetFrameFormat()->GetAnchor());
1752 aNewAnchor, *rNewFrame.GetFrameFormat() );
1755 for (
size_t i = 0;
i <
m_pImpl->m_pDoc->GetSpzFrameFormats()->
size(); ++
i)
1758 if ((!pFrameFormat->
GetName().isEmpty() && aAnchoredObjectsByName.find(pFrameFormat->
GetName()) != aAnchoredObjectsByName.end() ) ||
1759 ( pFrameFormat->
GetName().isEmpty() && aAnchoredObjectsByPtr.
find(pFrameFormat->
FindSdrObject()) != aAnchoredObjectsByPtr.
end()) )
1764 m_pImpl->m_pDoc->SetAttr(aAnchor, *pFrameFormat);
1771 && pTextBoxes->GetOwnerShape())
1773 const auto& rShapeAnchor = pTextBoxes->GetOwnerShape()->GetAnchor();
1774 if (rShapeAnchor.GetAnchorId() == RndStdIds::FLY_AS_CHAR
1778 const SwNode& rAnchorNode
1784 m_pImpl->m_pDoc->SetAttr(aAnchor, *pFrameFormat);
1792 m_pImpl->m_pDoc->getIDocumentContentOperations().DelFullPara(*pStartPam);
1795 catch (
const lang::IllegalArgumentException& rIllegal)
1798 bIllegalException =
true;
1800 catch (
const uno::RuntimeException& rRuntime)
1803 bRuntimeException =
true;
1806 if (bParaBeforeInserted || bParaAfterInserted)
1810 if (bParaBeforeInserted)
1813 m_pImpl->m_pDoc->getIDocumentContentOperations().DelFullPara(*xFrameTextCursor->GetPaM());
1815 if (bParaAfterInserted)
1817 xFrameTextCursor->gotoEnd(
false);
1818 if (!bParaBeforeInserted)
1819 m_pImpl->m_pDoc->getIDocumentContentOperations().DelFullPara(*xFrameTextCursor->GetPaM());
1823 SwPaM aPaM(*xFrameTextCursor->GetPaM()->GetPointNode().FindSttNodeByType(
SwFlyStartNode)->EndOfSectionNode());
1826 m_pImpl->m_pDoc->getIDocumentContentOperations().DelFullPara(aPaM);
1832 if (bIllegalException || bRuntimeException)
1834 m_pImpl->m_pDoc->GetIDocumentUndoRedo().Undo();
1835 if (bIllegalException)
1837 lang::IllegalArgumentException aEx;
1843 uno::RuntimeException aEx;
1854struct VerticallyMergedCell
1856 std::vector<uno::Reference< beans::XPropertySet > > aCells;
1857 sal_Int32 nLeftPosition;
1860 VerticallyMergedCell(uno::Reference< beans::XPropertySet >
const& rxCell,
1861 const sal_Int32 nLeft)
1862 : nLeftPosition( nLeft )
1865 aCells.push_back( rxCell );
1871#define COL_POS_FUZZY 2
1879 const uno::Sequence< uno::Reference< text::XTextRange > > & rCell,
1880 std::vector<SwNodeRange> & rRowNodes,
1883 if (rCell.getLength() != 2)
1885 throw lang::IllegalArgumentException(
1886 "rCell needs to contain 2 elements",
1887 uno::Reference< text::XTextCopy >( &m_rThis ), sal_Int16( 2 ) );
1889 const uno::Reference<text::XTextRange> xStartRange = rCell[0];
1890 const uno::Reference<text::XTextRange> xEndRange = rCell[1];
1900 throw lang::IllegalArgumentException(
1901 "Start or End range cannot be resolved to a SwPaM",
1902 uno::Reference< text::XTextCopy >( &m_rThis ), sal_Int16( 2 ) );
1907 std::optional<SwNodeRange> oCorrectedRange;
1908 m_pDoc->GetNodes().ExpandRangeForTableBox(aTmpRange, oCorrectedRange);
1910 if (oCorrectedRange)
1912 SwPaM aNewStartPaM(oCorrectedRange->aStart, 0);
1913 aStartCellPam = aNewStartPaM;
1915 sal_Int32 nEndLen = 0;
1917 if (pTextNode !=
nullptr)
1918 nEndLen = pTextNode->
Len();
1920 SwPaM aNewEndPaM(oCorrectedRange->aEnd, nEndLen);
1921 aEndCellPam = aNewEndPaM;
1923 oCorrectedRange.reset();
1945 if (nOpenNodeBlock < 0)
1947 throw lang::IllegalArgumentException();
1951 if (nOpenNodeBlock != 0)
1953 throw lang::IllegalArgumentException();
1968 m_pDoc->getIDocumentContentOperations().SplitNode(*aStartCellPam.
Start(),
false);
1977 if (nLastNodeEndIndex == nStartCellNodeIndex)
1982 throw lang::IllegalArgumentException();
1985 m_pDoc->getIDocumentContentOperations().SplitNode(*aStartCellPam.
Start(),
false);
1987 if (nNewIndex != nStartCellNodeIndex)
1991 assert(nNewIndex == nStartCellNodeIndex + 1);
2002 else if (nStartCellNodeIndex == (nLastNodeEndIndex + 1))
2011 throw lang::IllegalArgumentException();
2018 m_pDoc->getIDocumentContentOperations().SplitNode(*aEndCellPam.
End(),
false);
2035 rRowNodes.push_back(aCellRange);
2041 if (pMark->GetMarkEnd() <= *aEndCellPam.
End())
2043 if (pMark->GetMarkStart() < *aStartCellPam.
Start())
2045 SAL_INFO(
"sw.uno",
"deleting fieldmark overlapping table cell");
2056 if (*aStartCellPam.
Start() <= sepPos && sepPos <= *aEndCellPam.
End())
2058 SAL_INFO(
"sw.uno",
"deleting fieldmark with separator in table cell");
2069 if (*aStartCellPam.
Start() <= pMark->GetMarkStart())
2071 if (*aEndCellPam.
End() < pMark->GetMarkEnd())
2073 SAL_INFO(
"sw.uno",
"deleting fieldmark overlapping table cell");
2084 if (*aStartCellPam.
Start() <= sepPos && sepPos <= *aEndCellPam.
End())
2086 SAL_INFO(
"sw.uno",
"deleting fieldmark with separator in table cell");
2101 uno::Sequence<beans::PropertyValue>
const& rRowProperties,
2105 uno::Reference< beans::XPropertySet > xRow;
2107 for (
const beans::PropertyValue& rProperty : rRowProperties)
2109 if ( rProperty.Name ==
"TableColumnSeparators" )
2114 rProperty.
Value >>= aSeparators;
2115 rRowSeparators = aSeparators;
2117 xRow->setPropertyValue(rProperty.Name, rProperty.Value);
2125 if (rRowSeparators.getLength() < nCell)
2127 return rRowSeparators[nCell - 1].Position;
2132 const sal_Int32 nLeftPos,
2133 const uno::Sequence< beans::PropertyValue >& rCellProperties,
2134 const uno::Reference< uno::XInterface >& xCell,
2135 std::vector<VerticallyMergedCell> & rMergedCells)
2137 const uno::Reference< beans::XPropertySet > xCellPS(xCell, uno::UNO_QUERY);
2138 for (
const auto& rCellProperty : rCellProperties)
2140 const OUString & rName = rCellProperty.Name;
2142 if ( rName ==
"VerticalMerge" )
2146 bool bMerge =
false;
2152 for(
auto& aMergedCell : rMergedCells)
2156 aMergedCell.bOpen =
false;
2160 rMergedCells.emplace_back(xCellPS, nLeftPos);
2164 bool bFound =
false;
2165 SAL_WARN_IF(rMergedCells.empty(),
"sw.uno",
"the first merged cell is missing");
2166 for(
auto& aMergedCell : rMergedCells)
2170 aMergedCell.aCells.push_back( xCellPS );
2174 SAL_WARN_IF(!bFound,
"sw.uno",
"couldn't find first vertically merged cell" );
2181 static const std::initializer_list<std::u16string_view> vDenylist = {
2184 if (std::find(vDenylist.begin(), vDenylist.end(), rName) == vDenylist.end())
2186 xCellPS->setPropertyValue(rName, rValue);
2189 catch (
const uno::Exception&)
2200 for(
auto& aMergedCell : rMergedCells)
2205 sal_Int32 nCellCount =
static_cast<sal_Int32
>(aMergedCell.aCells.size());
2208 SAL_WARN(
"sw.uno",
"incomplete vertical cell merge");
2213 for(
auto pxPSet = aMergedCell.aCells.begin()+1; nCellCount<0; ++pxPSet, ++nCellCount)
2216 (*pxPSet)->setPropertyValue(
"VerticalMerge",
uno::Any(
true));
2221uno::Reference< text::XTextTable > SAL_CALL
2223 const uno::Sequence< uno::Sequence< uno::Sequence<
2224 uno::Reference< text::XTextRange > > > >& rTableRanges,
2225 const uno::Sequence< uno::Sequence< uno::Sequence<
2226 beans::PropertyValue > > >& rCellProperties,
2227 const uno::Sequence< uno::Sequence< beans::PropertyValue > >&
2229 const uno::Sequence< beans::PropertyValue >& rTableProperties)
2235 throw uno::RuntimeException();
2241 throw uno::RuntimeException(
2242 "cannot convertToTable if tracked changes are hidden!");
2246 const uno::Sequence< uno::Sequence< uno::Reference< text::XTextRange > > >*
2247 pTableRanges = rTableRanges.getConstArray();
2248 std::vector< std::vector<SwNodeRange> > aTableNodes;
2249 for (sal_Int32 nRow = 0; nRow < rTableRanges.getLength(); ++nRow)
2251 std::vector<SwNodeRange> aRowNodes;
2252 const uno::Sequence< uno::Reference< text::XTextRange > >* pRow =
2253 pTableRanges[nRow].getConstArray();
2254 const sal_Int32 nCells(pTableRanges[nRow].
getLength());
2258 throw lang::IllegalArgumentException();
2261 for (sal_Int32 nCell = 0; nCell < nCells; ++nCell)
2267 : &*aTableNodes.rbegin()->rbegin())
2268 : &*aRowNodes.rbegin());
2269 m_pImpl->ConvertCell(pRow[nCell], aRowNodes, pLastCell);
2271 assert(!aRowNodes.empty());
2272 aTableNodes.push_back(aRowNodes);
2275 std::vector< TableColumnSeparators >
2276 aRowSeparators(rRowProperties.getLength());
2277 std::vector<VerticallyMergedCell> aMergedCells;
2279 SwTable const*
const pTable =
m_pImpl->m_pDoc->TextToTable( aTableNodes );
2282 return uno::Reference< text::XTextTable >();
2284 uno::Reference<text::XTextTable>
const xRet =
2286 uno::Reference<beans::XPropertySet>
const xPrSet(xRet, uno::UNO_QUERY);
2292 for(
const auto& rTableProperty : rTableProperties)
2296 static const std::initializer_list<std::u16string_view> vDenylist = {
2300 u"CharFontNameAsian",
2301 u"CharFontNameComplex",
2304 u"CharHeightComplex",
2305 u"CharInteropGrabBag",
2308 u"CharLocaleComplex",
2309 u"HorizontalBorder",
2312 u"ParaBottomMargin",
2313 u"ParaIsHyphenation",
2322 if (std::find(vDenylist.begin(), vDenylist.end(), rTableProperty.Name) == vDenylist.end())
2324 xPrSet->setPropertyValue(rTableProperty.Name, rTableProperty.Value);
2327 catch (
const uno::Exception&)
2334 const auto xRows = xRet->getRows();
2335 const sal_Int32 nLast =
std::min(xRows->getCount(), rRowProperties.getLength());
2336 SAL_WARN_IF(nLast != rRowProperties.getLength(),
"sw.uno",
"not enough rows for properties");
2337 for(sal_Int32 nCnt = 0; nCnt < nLast; ++nCnt)
2340 uno::Reference<table::XCellRange>
const xCR(xRet, uno::UNO_QUERY_THROW);
2343 for(
const auto& rCellPropertiesForRow : rCellProperties)
2345 sal_Int32 nCell = 0;
2346 for(
const auto& rCellProps : rCellPropertiesForRow)
2350 xCR->getCellByPosition(nCell, nRow),
2361 catch (
const lang::WrappedTargetException&)
2364 catch (
const lang::IndexOutOfBoundsException&)
2376 const uno::Reference< text::XTextCopy >& xSource )
2380 SwXText const*
const pSource(
dynamic_cast<SwXText*
>(xSource.get()));
2382 uno::Reference< text::XText >
const xText(xSource, uno::UNO_QUERY_THROW);
2383 uno::Reference< text::XTextCursor >
const xCursor =
2384 xText->createTextCursor();
2385 xCursor->gotoEnd(
true );
2387 OTextCursorHelper *
const pCursor =
dynamic_cast<OTextCursorHelper*
>(xCursor.get());
2390 throw uno::RuntimeException();
2419 m_pImpl->m_pDoc->getIDocumentContentOperations().DelFullPara(*pDelCursor);
2441 return "SwXBodyText";
2449uno::Sequence< OUString > SAL_CALL
2452 return {
"com.sun.star.text.Text" };
2455uno::Sequence< uno::Type > SAL_CALL
2458 const uno::Sequence< uno::Type >
aTypes = SwXBodyText_Base::getTypes();
2460 return ::comphelper::concatSequences(
aTypes, aTextTypes);
2463uno::Sequence< sal_Int8 > SAL_CALL
2466 return css::uno::Sequence<sal_Int8>();
2474 ? SwXBodyText_Base::queryInterface(rType)
2486 SwPaM aPam(
GetDoc()->GetNodes().GetEndOfContent());
2509 const uno::Reference< text::XTextRange > & xTextPosition)
2513 uno::RuntimeException aRuntime;
2523 throw uno::RuntimeException(
"Invalid text range" );
2543 throw uno::RuntimeException(
"End of content node doesn't have the proper start node",
2544 uno::Reference< uno::XInterface >( *
this ) );
2549uno::Reference< container::XEnumeration > SAL_CALL
2562 uno::RuntimeException aRuntime;
2569 auto pUnoCursor(
GetDoc()->CreateUnoCursor(aPos));
2587 uno::RuntimeException aRuntime;
2615 throw uno::RuntimeException(
"SwXHeadFootText: disposed or invalid",
nullptr);
2622 if(rHint.
GetId() == SfxHintId::Dying)
2629 const bool bIsHeader)
2633 uno::Reference<text::XText> xText(rHeadFootFormat.
GetXObject(), uno::UNO_QUERY);
2644 rHeadFootFormat.GetDoc(),
2656 return {
"SwXHeadFootText"};
2664uno::Sequence<OUString> SAL_CALL
2667 return {
"com.sun.star.text.Text"};
2687 return ::comphelper::concatSequences(
2688 SwXHeadFootText_Base::getTypes(),
2694 return css::uno::Sequence<sal_Int8>();
2699 const uno::Any ret = SwXHeadFootText_Base::queryInterface(rType);
2714 auto& rUnoCursor(pXCursor->GetCursor());
2735 if (!pNewStartNode || (pNewStartNode != pOwnStartNode))
2737 uno::RuntimeException aExcept;
2738 aExcept.Message =
"no text available";
2751 const uno::Reference<text::XTextRange>& xTextPosition)
2758 uno::RuntimeException aRuntime;
2771 if (p1 == pOwnStartNode)
2790 auto pUnoCursor(
GetDoc()->CreateUnoCursor(aPos));
@ CheckPosInFly
check if target position is in fly anchored at source range
virtual bool AppendTextNode(SwPosition &rPos)=0
virtual bool DelFullPara(SwPaM &)=0
Delete full paragraphs.
Provides access to the marks of a document.
virtual sw::mark::IFieldmark * getInnerFieldmarkFor(const SwPosition &pos) const =0
virtual std::unique_ptr< ILazyDeleter > deleteMark(const IDocumentMarkAccess::const_iterator_t &ppMark, bool isMoveNodes)=0
Deletes a mark.
static bool IsShowChanges(const RedlineFlags eM)
virtual const SwRedlineTable & GetRedlineTable() const =0
virtual RedlineFlags GetRedlineFlags() const =0
Query the currently set redline mode.
bool StartListening(SvtBroadcaster &rBroadcaster)
bool Left(sal_uInt16 nCnt)
bool MovePara(SwWhichPara, SwMoveFnCollection const &)
IDocumentContentOperations const & getIDocumentContentOperations() const
IDocumentUndoRedo & GetIDocumentUndoRedo()
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
bool DontExpandFormat(const SwPosition &rPos, bool bFlag=true)
Ends a section of nodes in the document model.
Content, content of frame (header, footer, fly).
const SwNodeIndex * GetContentIdx() const
Marks a node in the document model.
SwNodeOffset GetIndex() const
Base class of the Writer document model elements.
SwStartNode * GetStartNode()
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
SwNodeOffset GetIndex() const
const SwStartNode * FindFooterStartNode() const
const SwStartNode * FindHeaderStartNode() const
bool IsSectionNode() const
SwTableNode * FindTableNode()
Search table node, in which it is.
SwStartNode * FindSttNodeByType(SwStartNodeType eTyp)
const SwStartNode * StartOfSectionNode() const
SwNodeType GetNodeType() const
const SwEndNode * EndOfSectionNode() const
SwNode & GetEndOfContent() const
Regular ContentSection (i.e. the BodyText).
SwContentNode * GoNext(SwNodeIndex *) const
PaM is Point and Mark: a selection of the document model.
const SwPosition * GetMark() const
SwNode & GetPointNode() const
virtual void SetMark()
Unless this is called, the getter method of Mark will return Point.
bool Move(SwMoveFnCollection const &fnMove=fnMoveForward, SwGoInDoc fnGo=GoInContent)
Movement of cursor.
const SwPosition * End() const
const SwPosition * GetPoint() const
const SwPosition * Start() const
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
void AddRule(SwUndoArg eWhat, const OUString &rWith)
A section node represents the start of a section on the UI, i.e.
Starts a section of nodes in the document model.
SwStartNodeType GetStartNodeType() const
SwTable is one table in the document model, containing rows (which contain cells).
SwTableNode * GetTableNode() const
SwTableFormat * GetFrameFormat()
static SwTable * FindTable(SwFrameFormat const *const pFormat)
SwTextNode is a paragraph in the document model.
virtual sal_Int32 Len() const override
const SfxItemPropertySet * GetPropertySet(sal_uInt16 PropertyId)
SwXBodyText(SwDoc *const pDoc)
virtual rtl::Reference< SwXTextCursor > createXTextCursor() override
virtual sal_Bool SAL_CALL supportsService(const OUString &rServiceName) override
virtual sal_Bool SAL_CALL hasElements() override
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override
virtual css::uno::Type SAL_CALL getElementType() override
virtual rtl::Reference< SwXTextCursor > createXTextCursorByRange(const ::css::uno::Reference< ::css::text::XTextRange > &aTextPosition) override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual OUString SAL_CALL getImplementationName() override
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
rtl::Reference< SwXTextCursor > CreateTextCursor(const bool bIgnoreTables=false)
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
rtl::Reference< SwXParagraphEnumeration > createParagraphEnumeration()
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
virtual ~SwXBodyText() override
UNO API wrapper around an internal sw::mark::IMark.
UNO API wrapper around an SwContentControl, exposed as the com.sun.star.text.ContentControl service.
void attachToText(SwXText &rParent, SwTextNode &rTextNode)
for SwXText
bool IsDescriptor() const
static rtl::Reference< SwXParagraph > CreateXParagraph(SwDoc &rDoc, SwTextNode *pTextNode, css::uno::Reference< css::text::XText > const &xParentText=nullptr, const sal_Int32 nSelStart=-1, const sal_Int32 nSelEnd=- 1)
static css::uno::Sequence< css::beans::PropertyValue > CreateRedlineProperties(SwRangeRedline const &rRedline, bool const bIsStart)
void DeleteAndInsert(std::u16string_view aText, ::sw::DeleteAndInsertMode eMode)
UNO wrapper around an SwFormatField, i.e.
SwServiceType GetServiceId() const
virtual rtl::Reference< SwXTextCursor > createXTextCursor() override
static SW_DLLPUBLIC rtl::Reference< SwXTextFrame > CreateXTextFrame(SwDoc &rDoc, SwFrameFormat *pFrameFormat)
SwSectionFormat * GetFormat() const
static rtl::Reference< SwXTextTable > CreateXTextTable(SwFrameFormat *pFrameFormat)
SwFrameFormat * GetFrameFormat()
uno::Reference< text::XTextRange > finishOrAppendParagraph(const uno::Sequence< beans::PropertyValue > &rCharacterAndParagraphProperties, const uno::Reference< text::XTextRange > &xInsertPosition)
bool CheckForOwnMember(const SwPaM &rPaM)
SfxItemPropertySet const & m_rPropSet
sal_Int16 ComparePositions(const uno::Reference< text::XTextRange > &xPos1, const uno::Reference< text::XTextRange > &xPos2)
void ConvertCell(const uno::Sequence< uno::Reference< text::XTextRange > > &rCell, std::vector< SwNodeRange > &rRowNodes, SwNodeRange *const pLastCell)
Impl(SwXText &rThis, SwDoc *const pDoc, const CursorType eType)
virtual void SAL_CALL removeTextContent(const css::uno::Reference< css::text::XTextContent > &xContent) override
const SwDoc * GetDoc() const
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL finishParagraphInsert(const css::uno::Sequence< css::beans::PropertyValue > &rCharacterAndParagraphProperties, const css::uno::Reference< css::text::XTextRange > &xInsertPosition) override
virtual rtl::Reference< SwXTextCursor > createXTextCursorByRange(const ::css::uno::Reference< ::css::text::XTextRange > &aTextPosition)=0
void SetDoc(SwDoc *const pDoc)
virtual void SAL_CALL removePropertyChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
::sw::UnoImplPtr< Impl > m_pImpl
virtual css::uno::Reference< css::text::XTextContent > SAL_CALL convertToTextFrame(const css::uno::Reference< css::text::XTextRange > &xStart, const css::uno::Reference< css::text::XTextRange > &xEnd, const css::uno::Sequence< css::beans::PropertyValue > &xFrameProperties) override
virtual void SAL_CALL removeVetoableChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &xListener) override
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL appendTextPortion(const OUString &rText, const css::uno::Sequence< css::beans::PropertyValue > &rCharacterAndParagraphProperties) override
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL appendTextContent(const css::uno::Reference< css::text::XTextContent > &xTextContent, const css::uno::Sequence< css::beans::PropertyValue > &rCharacterAndParagraphProperties) override
virtual void SAL_CALL addPropertyChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
virtual void SAL_CALL addVetoableChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &xListener) override
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL insertTextContentWithProperties(const css::uno::Reference< css::text::XTextContent > &xTextContent, const css::uno::Sequence< css::beans::PropertyValue > &rCharacterAndParagraphProperties, const css::uno::Reference< css::text::XTextRange > &xInsertPosition) override
virtual void SAL_CALL removeTextContentBefore(const css::uno::Reference< css::text::XTextContent > &xSuccessor) override
virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL createTextCursorByRange(const ::css::uno::Reference< ::css::text::XTextRange > &aTextPosition) override final
SwXText(SwDoc *const pDoc, const CursorType eType)
virtual bool CheckForOwnMemberMeta(const SwPaM &rPam, const bool bAbsorb)
virtual void SAL_CALL removeTextContentAfter(const css::uno::Reference< css::text::XTextContent > &xPredecessor) override
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &rPropertyName) override
virtual rtl::Reference< SwXTextCursor > createXTextCursor()=0
virtual OUString SAL_CALL getString() override
virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL createTextCursor() override final
virtual css::uno::Reference< css::text::XTextTable > SAL_CALL convertToTable(css::uno::Sequence< css::uno::Sequence< css::uno::Sequence< css::uno::Reference< css::text::XTextRange > > > > const &rTableRanges, css::uno::Sequence< css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > > > const &rCellProperties, css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > > const &rRowProperties, css::uno::Sequence< css::beans::PropertyValue > const &rTableProperties) override
sal_Int16 SAL_CALL compareRegionStarts(const css::uno::Reference< css::text::XTextRange > &xR1, const css::uno::Reference< css::text::XTextRange > &xR2) override
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getEnd() override
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL insertTextPortion(const OUString &rText, const css::uno::Sequence< css::beans::PropertyValue > &rCharacterAndParagraphProperties, const css::uno::Reference< css::text::XTextRange > &rTextRange) override
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
sal_Int16 SAL_CALL compareRegionEnds(const css::uno::Reference< css::text::XTextRange > &xR1, const css::uno::Reference< css::text::XTextRange > &xR2) override
virtual void SAL_CALL insertTextContentAfter(const css::uno::Reference< css::text::XTextContent > &xNewContent, const css::uno::Reference< css::text::XTextContent > &xPredecessor) override
virtual void SAL_CALL insertTextContent(const css::uno::Reference< css::text::XTextRange > &xRange, const css::uno::Reference< css::text::XTextContent > &xContent, sal_Bool bAbsorb) override
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getStart() override
virtual void SAL_CALL insertString(const css::uno::Reference< css::text::XTextRange > &xRange, const OUString &aString, sal_Bool bAbsorb) override
virtual void SAL_CALL setString(const OUString &rString) override
virtual css::uno::Reference< css::text::XText > SAL_CALL getText() override
virtual const SwStartNode * GetStartNode() const
virtual void SAL_CALL insertTextContentBefore(const css::uno::Reference< css::text::XTextContent > &xNewContent, const css::uno::Reference< css::text::XTextContent > &xSuccessor) override
virtual void PrepareForAttach(css::uno::Reference< css::text::XTextRange > &xRange, SwPaM const &rPam)
virtual void SAL_CALL copyText(const css::uno::Reference< css::text::XTextCopy > &xSource) override
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL finishParagraph(const css::uno::Sequence< css::beans::PropertyValue > &rCharacterAndParagraphProperties) override
virtual void SAL_CALL insertControlCharacter(const css::uno::Reference< css::text::XTextRange > &xRange, sal_Int16 nControlCharacter, sal_Bool bAbsorb) override
virtual void SAL_CALL setPropertyValue(const OUString &rPropertyName, const css::uno::Any &rValue) override
css::uno::Type const & get()
const_iterator find(const Value &x) const
const_iterator end() const
std::pair< const_iterator, bool > insert(Value &&x)
Blocks grouping undo actions together into an SfxListUndoAction.
#define FN_UNO_REDLINE_NODE_END
#define TOOLS_WARN_EXCEPTION(area, stream)
constexpr TypedWhichId< SwFlyFrameFormat > RES_FLYFRMFMT(162)
#define SAL_WARN_IF(condition, area, stream)
#define SAL_WARN(area, stream)
#define SAL_INFO(area, stream)
void SetPropertyValue(SwPaM &rPaM, const SfxItemPropertySet &rPropSet, const OUString &rPropertyName, const css::uno::Any &rValue, const SetAttrMode nAttrMode=SetAttrMode::DEFAULT)
void SetPropertyValues(SwPaM &rPaM, const SfxItemPropertySet &rPropSet, const css::uno::Sequence< css::beans::PropertyValue > &rPropertyValues, const SetAttrMode nAttrMode=SetAttrMode::DEFAULT)
bool DocInsertStringSplitCR(SwDoc &rDoc, const SwPaM &rNewCursor, std::u16string_view rText, const bool bForceExpandHints)
void SelectPam(SwPaM &rPam, const bool bExpand)
double getLength(const B2DPolygon &rCandidate)
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
Any SAL_CALL getCaughtException()
SwPosition FindFieldSep(IFieldmark const &rMark)
return position of the CH_TXT_ATR_FIELDSEP for rMark
bool XTextRangeToSwPaM(SwUnoInternalPaM &rToFill, const uno::Reference< text::XTextRange > &xTextRange, ::sw::TextRangeMode const eMode)
@ Table
SwTableNode is derived from SwStartNode.
@ Section
SwSectionNode is derived from SwStartNode.
o3tl::strong_int< sal_Int32, struct Tag_SwNodeOffset > SwNodeOffset
SwNodeOffset min(const SwNodeOffset &a, const SwNodeOffset &b)
SwNodeOffset abs(const SwNodeOffset &a)
bool GoCurrPara(SwPaM &rPam, SwMoveFnCollection const &aPosPara)
bool GoInNode(SwPaM &rPam, SwMoveFnCollection const &fnMove)
bool GoInDoc(SwPaM &rPam, SwMoveFnCollection const &fnMove)
bool GoInContent(SwPaM &rPam, SwMoveFnCollection const &fnMove)
SwMoveFnCollection const & fnParaStart
SwMoveFnCollection const & fnParaEnd
SwMoveFnCollection const & fnMoveBackward
SwMoveFnCollection const & fnMoveForward
SwPam::Move()/Find() default argument.
Marks a position in the document model.
void Adjust(SwNodeOffset nDelta)
Adjust node position, and resets content position to zero.
void SetMark(const sw::mark::IMark *pMark)
void Assign(const SwNode &rNd, SwNodeOffset nDelta, sal_Int32 nContentOffset=0)
These all set both nNode and nContent.
void AssignEndIndex(const SwContentNode &rNd)
Set nNode to rNd, and nContent to the end of rNd.
void SetContent(sal_Int32 nContentIndex)
Set content index, only valid to call this if the position points to a SwContentNode subclass.
SwNodeOffset GetNodeIndex() const
void AssignStartIndex(const SwContentNode &rNd)
Set nNode to rNd, and nContent to the beginning of rNd.
sal_Int32 GetContentIndex() const
static rtl::Reference< SwXParagraphEnumeration > Create(css::uno::Reference< css::text::XText > const &xParent, const std::shared_ptr< SwUnoCursor > &pCursor, const CursorType eType, SwTableBox const *const pTableBox=nullptr)
OUString SwResId(TranslateId aId)
css::uno::Reference< css::i18n::XExtendedTransliteration > Body
SwUnoPropertyMapProvider aSwMapProvider
#define PROPERTY_MAP_TEXT_CURSOR
#define PROPERTY_MAP_PARAGRAPH
#define PROPERTY_MAP_TEXT
constexpr OUStringLiteral UNO_NAME_ROW_SPAN
constexpr OUStringLiteral cInvalidObject
static bool isGraphicNode(const SwFrameFormat *pFrameFormat)
static bool IsAtParaMatch(const SwPaM &rAnchorCheckPam, const SwFormatAnchor &rAnchor)
Determines if the at-para rAnchor is anchored at the start or end of rAnchorCheckPam.
static void lcl_MergeCells(std::vector< VerticallyMergedCell > &rMergedCells)
static void lcl_ApplyRowProperties(uno::Sequence< beans::PropertyValue > const &rRowProperties, uno::Any const &rRow, TableColumnSeparators &rRowSeparators)
uno::Sequence< text::TableColumnSeparator > TableColumnSeparators
static sal_Int32 lcl_GetLeftPos(sal_Int32 nCell, TableColumnSeparators const &rRowSeparators)
static void lcl_ApplyCellProperties(const sal_Int32 nLeftPos, const uno::Sequence< beans::PropertyValue > &rCellProperties, const uno::Reference< uno::XInterface > &xCell, std::vector< VerticallyMergedCell > &rMergedCells)
static bool lcl_SimilarPosition(const sal_Int32 nPos1, const sal_Int32 nPos2)