43 #include <unofield.hxx>
60 #include <com/sun/star/container/XEnumeration.hpp>
69 using namespace ::
std;
71 typedef std::pair< TextRangeList_t * const, SwTextAttr const * const >
PortionList_t;
76 uno::Reference< text::XText >
const& i_xParentText,
79 const sal_Int32 i_nStartPos,
const sal_Int32 i_nEndPos );
87 struct SwXBookmarkPortion_Impl
89 Reference<XTextContent> xBookmark;
93 SwXBookmarkPortion_Impl(uno::Reference<text::XTextContent>
const& xMark,
97 , aPosition ( rPosition )
100 sal_Int32 getIndex ()
const
105 typedef std::shared_ptr < SwXBookmarkPortion_Impl > SwXBookmarkPortion_ImplSharedPtr;
106 struct BookmarkCompareStruct
108 bool operator () (
const SwXBookmarkPortion_ImplSharedPtr &r1,
109 const SwXBookmarkPortion_ImplSharedPtr &r2 )
const
124 return r1->aPosition < r2->aPosition;
127 typedef std::multiset < SwXBookmarkPortion_ImplSharedPtr, BookmarkCompareStruct > SwXBookmarkPortion_ImplList;
135 if(rStartPos.
nNode == nOwnNode)
140 ? BkmType::Start : BkmType::StartEnd;
141 rBkmArr.insert(std::make_shared<SwXBookmarkPortion_Impl>(
147 if(rEndPos.
nNode != nOwnNode)
150 unique_ptr<SwPosition> pCrossRefEndPos;
157 else if (pCrossRefMark)
160 pCrossRefEndPos = std::make_unique<SwPosition>(rEndPos);
161 pCrossRefEndPos->
nContent = pCrossRefEndPos->nNode.GetNode().GetTextNode()->Len();
162 pEndPos = pCrossRefEndPos.get();
166 rBkmArr.insert(std::make_shared<SwXBookmarkPortion_Impl>(
168 BkmType::End, *pEndPos));
172 void lcl_FillBookmarkArray(
SwDoc& rDoc,
SwUnoCursor& rUnoCursor, SwXBookmarkPortion_ImplList& rBkmArr)
195 if (!aSeenMarks.
insert(pBkmk).second)
197 lcl_FillBookmark(pBkmk, nOwnNode, rDoc, rBkmArr);
201 class theSwXTextPortionEnumerationUnoTunnelId :
public rtl::Static< UnoTunnelIdInit, theSwXTextPortionEnumerationUnoTunnelId > {};
202 struct SwAnnotationStartPortion_Impl
205 uno::Reference< text::XTextField > mxAnnotationField;
208 SwAnnotationStartPortion_Impl(
209 uno::Reference< text::XTextField >
const& xAnnotationField,
211 : mxAnnotationField ( xAnnotationField )
212 , maPosition ( rPosition )
216 sal_Int32 getIndex ()
const
221 typedef std::shared_ptr < SwAnnotationStartPortion_Impl > SwAnnotationStartPortion_ImplSharedPtr;
222 struct AnnotationStartCompareStruct
224 bool operator () (
const SwAnnotationStartPortion_ImplSharedPtr &r1,
225 const SwAnnotationStartPortion_ImplSharedPtr &r2 )
228 return r1->maPosition < r2->maPosition;
231 typedef std::multiset < SwAnnotationStartPortion_ImplSharedPtr, AnnotationStartCompareStruct > SwAnnotationStartPortion_ImplList;
233 void lcl_FillAnnotationStartArray(
236 SwAnnotationStartPortion_ImplList& rAnnotationStartArr )
246 aEndOfPara.
nContent = aEndOfPara.nNode.GetNode().GetTextNode()->Len();
253 ppMark != pCandidatesEnd;
259 if (!pAnnotationMark)
263 if (rStartPos.
nNode != nOwnNode)
267 if (!pAnnotationFormatField)
269 SAL_WARN(
"sw.core",
"missing annotation format field");
273 rAnnotationStartArr.insert(
274 std::make_shared<SwAnnotationStartPortion_Impl>(
276 pAnnotationFormatField),
288 const uno::Sequence< sal_Int8 >& rId )
290 if( isUnoTunnelId<SwXTextPortionEnumeration>(rId) )
292 return sal::static_int_cast< sal_Int64 >(
reinterpret_cast< sal_IntPtr
>( this ) );
299 return "SwXTextPortionEnumeration";
310 return {
"com.sun.star.text.TextPortionEnumeration" };
315 uno::Reference< XText >
const & xParentText,
316 const sal_Int32 nStart,
317 const sal_Int32 nEnd )
322 OSL_ENSURE(nEnd == -1 || (nStart <= nEnd &&
323 nEnd <= m_pUnoCursor->
Start()->nNode.GetNode().GetTextNode()->GetText().getLength()),
324 "start or end value invalid!");
335 : m_Portions( rPortions )
358 throw container::NoSuchElementException();
368 const sal_Int32 i_nStartPos)
372 if (!pTextNode)
return;
376 sal_Int32
pos = std::max(static_cast<sal_Int32>(0), i_nStartPos);
379 rFieldMarks.push_back(pos);
384 static uno::Reference<text::XTextRange>
386 uno::Reference< text::XText >
const & i_xParentText,
390 uno::Reference<text::XTextRange> xRef;
395 "hmm --- why is this different");
397 pUnoCursor->
Right(1);
400 OSL_FAIL(
"cannot move cursor?");
409 getFieldmarkAt(*pUnoCursor->
GetMark());
415 pPortion->SetBookmark(
430 getFieldmarkAt(*pUnoCursor->
GetMark());
436 pPortion->SetBookmark(
455 OSL_FAIL(
"no fieldmark found?");
460 static Reference<XTextRange>
462 Reference<XText>
const& xParent,
493 Reference<XText>
const& xParent,
498 static_txtattr_cast<const SwTextRuby&>(rAttr), xParent, bEnd);
499 rPortions.emplace_back(pPortion);
503 static Reference<XTextRange>
505 Reference<XText>
const& xParent,
512 const Reference<XTextContent>
xContent =
530 static uno::Reference<text::XTextRange>
532 uno::Reference<text::XText>
const& xParent,
534 SwTextAttr & rAttr, std::unique_ptr<TextRangeList_t const> && pPortions)
537 *static_cast<SwFormatMeta &>(rAttr.
GetAttr()).GetMeta(),
538 xParent, std::move(pPortions)));
542 const uno::Reference<text::XTextContent>
xContent(xMeta,
549 const uno::Reference<text::XTextField> xField(xMeta, uno::UNO_QUERY);
572 Reference<XText>
const& xParent,
574 SwXBookmarkPortion_ImplList& rBkmArr,
575 const sal_Int32 nIndex,
577 bool bOnlyFrameStarts)
579 for ( SwXBookmarkPortion_ImplList::iterator aIter = rBkmArr.begin(), aEnd = rBkmArr.end(); aIter != aEnd; )
581 const SwXBookmarkPortion_ImplSharedPtr& pPtr = *aIter;
582 if ( nIndex > pPtr->getIndex() )
584 if (bOnlyFrameStarts)
587 aIter = rBkmArr.erase(aIter);
590 if ( nIndex < pPtr->getIndex() )
593 if ((BkmType::Start == pPtr->nBkmType && bOnlyFrameStarts) ||
594 (BkmType::StartEnd == pPtr->nBkmType))
596 bool bFrameStart = rFramePositions.
find(nIndex) != rFramePositions.
end();
597 bool bEnd = pPtr->nBkmType == BkmType::StartEnd && bFrameStart && !bOnlyFrameStarts;
598 if (pPtr->nBkmType == BkmType::Start || bFrameStart || !bOnlyFrameStarts)
609 rPortions.emplace_back(pPortion);
611 pPortion->
SetCollapsed( BkmType::StartEnd == pPtr->nBkmType && !bFrameStart );
614 else if (BkmType::End == pPtr->nBkmType && !bOnlyFrameStarts)
618 rPortions.emplace_back(pPortion);
623 if (bOnlyFrameStarts)
626 aIter = rBkmArr.erase(aIter);
632 Reference<XText>
const& xParent,
635 const sal_Int32 nIndex)
637 for (
auto aIter = rBreakArr.
begin(); aIter != rBreakArr.
end(); )
639 if ( nIndex > *aIter )
641 aIter = rBreakArr.
erase(aIter);
644 if ( nIndex < *aIter )
649 aIter = rBreakArr.
erase(aIter);
655 struct SwXRedlinePortion_Impl
660 SwXRedlinePortion_Impl (
const SwRangeRedline* pRed,
const bool bIsStart )
666 sal_Int32 getRealIndex ()
const
675 typedef std::shared_ptr < SwXRedlinePortion_Impl >
680 struct RedlineCompareStruct
684 return *(r->m_bStart ? r->m_pRedline->Start() : r->m_pRedline->End());
690 return getPosition ( r1 ) < getPosition ( r2 );
696 typedef std::multiset < SwXRedlinePortion_ImplSharedPtr, RedlineCompareStruct >
699 static Reference<XTextRange>
702 const Reference<XText> & xParent,
705 const sal_Int32 i_nStartPos,
706 const sal_Int32 i_nEndPos,
707 const sal_Int32 nCurrentIndex,
708 const bool bRightMoveForbidden,
709 bool & o_rbCursorMoved,
710 sal_Int32 & o_rNextAttrPosition)
714 Reference<XTextRange> xRef;
717 size_t nEndIndex = 0;
718 sal_Int32 nNextEnd = 0;
719 while(nEndIndex < pHints->
Count() &&
726 if (nNextEnd == nCurrentIndex)
728 const sal_uInt16 nWhich( pAttr->
Which() );
734 xParent, pUnoCursor, *pAttr,
true);
735 rPortionStack.top().first->push_back(xTmp);
741 xParent, pUnoCursor, *pAttr,
true);
742 rPortionStack.top().first->push_back(xTmp);
750 xParent, pUnoCursor, *pAttr,
false);
753 xParent, pUnoCursor, *pAttr,
true);
758 OSL_ENSURE(pAttr->GetStart() != *pAttr->GetEnd(),
760 if ((i_nStartPos > 0) &&
761 (pAttr->GetStart() < i_nStartPos))
768 if (pAttr->GetStart() + 1 == i_nStartPos)
770 nEndIndex = pHints->
Count() - 1;
775 if (Top.second != pAttr)
777 OSL_FAIL(
"ExportHints: stack error" );
781 std::unique_ptr<const TextRangeList_t>
782 pCurrentPortions(Top.first);
784 const uno::Reference<text::XTextRange> xPortion(
786 *pAttr, std::move(pCurrentPortions)));
787 rPortionStack.top().first->push_back(xPortion);
798 size_t nStartIndex = 0;
799 sal_Int32 nNextStart = 0;
800 while(nStartIndex < pHints->
Count() &&
801 nCurrentIndex >= (nNextStart = pHints->
Get(nStartIndex)->
GetStart()))
804 sal_uInt16 nAttrWhich = pAttr->
Which();
805 if (nNextStart == nCurrentIndex)
810 if(!bRightMoveForbidden)
812 pUnoCursor->
Right(1);
819 Reference<XTextField>
const xField =
827 if(!bRightMoveForbidden)
829 pUnoCursor->
Right(1);
835 if ( pAnnotationMark !=
nullptr )
839 rDoc, pAnnotationMark));
845 Reference<XTextField> xField =
855 if(!bRightMoveForbidden)
865 Reference<XTextField> xField =
873 if(!bRightMoveForbidden)
875 pUnoCursor->
Right(1);
890 if(!bRightMoveForbidden)
892 pUnoCursor->
Right(1);
908 bool bIsPoint = !(pAttr->
GetEnd());
909 if (!bRightMoveForbidden || !bIsPoint)
913 pUnoCursor->
Right(1);
915 Reference<XTextRange> xTmp =
918 xParent, pUnoCursor, *pAttr,
false)
920 xParent, pUnoCursor, *pAttr,
false);
929 rPortionStack.top().first->push_back(xTmp);
939 xParent, pUnoCursor, *pAttr,
false);
946 if (!bRightMoveForbidden)
948 pUnoCursor->
Right(1);
949 o_rbCursorMoved =
true;
951 if ((i_nEndPos < 0) ||
952 (*pAttr->
GetEnd() <= i_nEndPos))
954 rPortionStack.push( std::make_pair(
965 OSL_FAIL(
"unknown attribute");
974 o_rbCursorMoved =
true;
976 if (!o_rbCursorMoved)
983 while(nStartIndex < pHints->
Count() &&
984 nCurrentIndex >= (nNextStart = pHints->
Get(nStartIndex)->
GetStart()))
989 while(nEndIndex < pHints->
Count() &&
994 ((nNextStart > nCurrentIndex) && (nNextStart < nNextEnd))
995 ? nNextStart : nNextEnd;
996 if (nNextPos > nCurrentIndex)
998 o_rNextAttrPosition = nNextPos;
1005 const sal_Int32 nCurrentIndex,
1006 const sal_Int32 nNextFrameIndex,
1007 const sal_Int32 nNextPortionIndex,
1008 const sal_Int32 nNextAttrIndex,
1009 const sal_Int32 nNextMarkIndex,
1010 const sal_Int32 nEndPos )
1014 if ((nEndPos >= 0) && (nEndPos < nMovePos))
1019 if ((nNextFrameIndex >= 0) && (nNextFrameIndex < nMovePos))
1021 nMovePos = nNextFrameIndex;
1024 if ((nNextPortionIndex >= 0) && (nNextPortionIndex < nMovePos))
1026 nMovePos = nNextPortionIndex;
1029 if ((nNextAttrIndex >= 0) && (nNextAttrIndex < nMovePos))
1031 nMovePos = nNextAttrIndex;
1034 if ((nNextMarkIndex >= 0) && (nNextMarkIndex < nMovePos))
1036 nMovePos = nNextMarkIndex;
1039 if (nMovePos > nCurrentIndex)
1051 const size_t nRedTableCount = rRedTable.
size();
1053 if ( nRedTableCount <= 0 )
1059 for(
size_t nRed = 0; nRed < nRedTableCount; ++nRed)
1064 if ( nOwnNode == nRedNode )
1065 rRedArr.insert( std::make_shared<SwXRedlinePortion_Impl>(
1068 rRedArr.insert( std::make_shared<SwXRedlinePortion_Impl>(
1069 pRedline,
false ) );
1085 Reference<XText>
const& xParent,
1088 const sal_Int32 nIndex)
1093 for ( SwXRedlinePortion_ImplList::iterator aIter = rRedlineArr.begin(), aEnd = rRedlineArr.end();
1097 sal_Int32 nRealIndex = pPtr->getRealIndex();
1099 if ( nIndex > nRealIndex )
1100 aIter = rRedlineArr.erase(aIter);
1102 else if ( nIndex == nRealIndex )
1105 *pPtr->m_pRedline, pUnoCursor, xParent, pPtr->m_bStart));
1106 aIter = rRedlineArr.erase(aIter);
1116 Reference<XText>
const & xParent,
1118 SwXBookmarkPortion_ImplList& rBkmArr,
1121 const sal_Int32 nIndex,
1123 bool bOnlyFrameBookmarkStarts)
1125 if (!rBkmArr.empty())
1127 bOnlyFrameBookmarkStarts);
1129 if (bOnlyFrameBookmarkStarts)
1134 if (!rRedlineArr.empty())
1137 if (!rBreakArr.
empty())
1154 Reference<XText>
const & xParent,
1156 SwAnnotationStartPortion_ImplList& rAnnotationStartArr,
1157 const sal_Int32 nIndex,
1161 for ( SwAnnotationStartPortion_ImplList::iterator aIter = rAnnotationStartArr.begin(), aEnd = rAnnotationStartArr.end();
1164 SwAnnotationStartPortion_ImplSharedPtr pPtr = *aIter;
1165 if ( nIndex > pPtr->getIndex() )
1167 aIter = rAnnotationStartArr.erase(aIter);
1170 if ( pPtr->getIndex() > nIndex )
1175 bool bFrameStart = rFramePositions.
find(nIndex) != rFramePositions.
end();
1176 if (bFrameStart || !bOnlyFrame)
1181 rPortions.emplace_back(pPortion);
1183 aIter = rAnnotationStartArr.erase(aIter);
1194 for (
const auto& rFrame : rFrames)
1196 if (rFrame.nIndex < nCurrentIndex)
1199 if (rFrame.nIndex > nCurrentIndex)
1202 const auto pFrame =
static_cast<const SwFrameFormat*
>(rFrame.pFrameClient->GetRegisteredIn());
1224 Reference<XText>
const & i_xParent,
1227 sal_Int32
const i_nCurrentIndex)
1231 while (!i_rFrames.empty() && i_rFrames.front().nIndex < i_nCurrentIndex)
1232 i_rFrames.pop_front();
1235 while (!i_rFrames.empty() && (i_rFrames.front().nIndex == i_nCurrentIndex))
1238 auto pFrame =
static_cast<SwFrameFormat*
>(i_rFrames.front().pFrameClient->GetRegisteredIn());
1242 rPortions.emplace_back(pPortion);
1244 i_rFrames.pop_front();
1247 return !i_rFrames.empty() ? i_rFrames.front().nIndex : -1;
1251 SwXBookmarkPortion_ImplList
const & rBkmArr,
1255 sal_Int32 nRet = -1;
1256 if(!rBkmArr.empty())
1258 SwXBookmarkPortion_ImplSharedPtr pPtr = *rBkmArr.begin();
1259 nRet = pPtr->getIndex();
1261 if(!rRedlineArr.empty())
1264 sal_Int32 nTmp = pPtr->getRealIndex();
1265 if(nRet < 0 || nTmp < nRet)
1268 if(!rBreakArr.
empty())
1270 if(nRet < 0 || *rBreakArr.
begin() < nRet)
1271 nRet = *rBreakArr.
begin();
1278 uno::Reference< text::XText >
const & i_xParentText,
1281 const sal_Int32 i_nStartPos,
1282 const sal_Int32 i_nEndPos )
1288 if ((i_nStartPos > 0) &&
1294 GetText().getLength()),
"Incorrect start position" );
1296 pUnoCursor->
Right(i_nStartPos);
1301 std::deque<sal_Int32> FieldMarks;
1305 lcl_FillBookmarkArray(rDoc, *pUnoCursor, Bookmarks);
1313 SwAnnotationStartPortion_ImplList AnnotationStarts;
1314 lcl_FillAnnotationStartArray( rDoc, *pUnoCursor, AnnotationStarts );
1319 bool bAtEnd(
false );
1331 OSL_FAIL(
"lcl_CreatePortions: no TextNode - what now ?");
1336 const sal_Int32 nCurrentIndex =
1340 uno::Reference< XTextRange > xRef;
1351 pUnoCursor, Bookmarks, Redlines, SoftPageBreaks, nCurrentIndex, aFramePositions, true );
1354 *PortionStack.top().first,
1362 const sal_Int32 nFirstFrameIndex =
1364 i_xParentText, pUnoCursor, i_rFrames, nCurrentIndex);
1369 pUnoCursor, Bookmarks, Redlines, SoftPageBreaks, nCurrentIndex, aFramePositions, false );
1372 *PortionStack.top().first,
1380 bool bCursorMoved(
false );
1381 sal_Int32 nNextAttrIndex = -1;
1384 bAtEnd = ((i_nEndPos >= 0) && (nCurrentIndex >= i_nEndPos))
1385 || (nCurrentIndex >= pTextNode->
Len());
1390 pHints, i_nStartPos, i_nEndPos, nCurrentIndex, bAtEnd,
1391 bCursorMoved, nNextAttrIndex);
1392 if (PortionStack.empty())
1394 OSL_FAIL(
"CreatePortions: stack underflow");
1399 if (!xRef.is() && !bCursorMoved)
1402 !FieldMarks.empty() && (FieldMarks.front() == nCurrentIndex))
1406 FieldMarks.pop_front();
1411 OSL_ENSURE(FieldMarks.empty() ||
1412 (FieldMarks.front() != nCurrentIndex),
1413 "fieldmark and hint with CH_TXTATR at same pos?");
1416 if (!bAtEnd && !xRef.is() && !bCursorMoved)
1418 const sal_Int32 nNextPortionIndex =
1421 sal_Int32 nNextMarkIndex = ( !FieldMarks.empty() ? FieldMarks.front() : -1 );
1422 if ( !AnnotationStarts.empty()
1423 && ( nNextMarkIndex == -1
1424 || (*AnnotationStarts.begin())->getIndex() < nNextMarkIndex ) )
1426 nNextMarkIndex = (*AnnotationStarts.begin())->getIndex();
1440 else if (bAtEnd && !xRef.is() && !pTextNode->
Len())
1449 PortionStack.top().first->push_back(xRef);
1453 OSL_ENSURE((PortionStack.size() == 1) && !PortionStack.top().second,
1454 "CreatePortions: stack error" );
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
std::shared_ptr< SwUnoCursor > CreateUnoCursor(const SwPosition &rPos, bool bTableCursor=false)
virtual sal_Int32 Len() const
SwNode & GetNode(bool bPoint=true) const
virtual ::sw::mark::IFieldmark * getFieldmarkAt(const SwPosition &rPos) const =0
get Fieldmark for CH_TXT_ATR_FIELDSTART/CH_TXT_ATR_FIELDEND at rPos
Marks a position in the document model.
static Reference< XTextRange > lcl_CreateTOXMarkPortion(Reference< XText > const &xParent, const SwUnoCursor *const pUnoCursor, SwTextAttr &rAttr, const bool bEnd)
virtual css::uno::Any SAL_CALL nextElement() override
constexpr TypedWhichId< SwFormatMeta > RES_TXTATR_METAFIELD(49)
const OUString & GetText() const
SwpHints * GetpSwpHints()
constexpr TypedWhichId< SwFormatMeta > RES_TXTATR_META(48)
virtual sal_Int32 getBookmarksCount() const =0
returns the number of IBookmarks.
wrapper iterator: wraps iterator of implementation while hiding MarkBase class; only IMark instances ...
std::deque< FrameClientSortListEntry > FrameClientSortList_t
virtual const sal_Int32 * GetEnd() const
end position
virtual sal_Int32 Len() const override
static SW_DLLPUBLIC MarkType GetType(const ::sw::mark::IMark &rMark)
Returns the MarkType used to create the mark.
virtual sal_Bool SAL_CALL hasMoreElements() override
const SwPosition * GetMark() const
Provides access to the marks of a document.
virtual SwPosition & GetMarkStart() const override
constexpr TypedWhichId< SwFormatFlyCnt > RES_TXTATR_FLYCNT(57)
virtual ~SwXTextPortionEnumeration() override
std::shared_ptr< SwXRedlinePortion_Impl > SwXRedlinePortion_ImplSharedPtr
const_iterator find(const Value &x) const
geometry::RealPoint2D maPosition
SwTextAttr * GetSortedByEnd(size_t nPos) const
IDocumentMarkAccess * getIDocumentMarkAccess()
static css::uno::Reference< css::text::XTextField > CreateXTextField(SwDoc *pDoc, SwFormatField const *pFormat, SwServiceType nServiceId=SwServiceType::Invalid)
virtual sal_Int32 getAnnotationMarksCount() const =0
sal_Int32 GetAnyEnd() const
end (if available), else start
constexpr TypedWhichId< SwFormatField > RES_TXTATR_ANNOTATION(59)
#define CH_TXT_ATR_FORMELEMENT
const SwIndex * GetNext() const
SwContentNode * GetContentNode(bool bPoint=true) const
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
A wrapper around SfxPoolItem to store the start position of (usually) a text portion, with an optional end.
static void lcl_FillRedlineArray(SwDoc const &rDoc, SwUnoCursor const &rUnoCursor, SwXRedlinePortion_ImplList &rRedArr)
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)
sal_Int32 GetStart() const
virtual const_iterator_t findFirstAnnotationStartsAfter(const SwPosition &rPos) const =0
Finds the first mark that is starting after.
static css::uno::Reference< css::text::XTextContent > CreateXFieldmark(SwDoc &rDoc,::sw::mark::IMark *pMark, bool isReplacementObject=false)
void SetTOXMark(css::uno::Reference< css::text::XTextContent > const &xMark)
constexpr TypedWhichId< SwFormatRuby > RES_TXTATR_CJK_RUBY(53)
constexpr TypedWhichId< SwFormatCharFormat > RES_TXTATR_CHARFMT(52)
const SwFormatField & GetFormatField() const
constexpr TypedWhichId< SwFormatAutoFormat > RES_TXTATR_AUTOFMT(50)
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
constexpr TypedWhichId< SwFormatFootnote > RES_TXTATR_FTN(58)
void Normalize(bool bPointFirst=true)
Normalizes PaM, i.e.
static Reference< XTextRange > lcl_CreateRefMarkPortion(Reference< XText > const &xParent, const SwUnoCursor *const pUnoCursor, const SwTextAttr &rAttr, const bool bEnd)
constexpr TypedWhichId< SwFormatINetFormat > RES_TXTATR_INETFMT(51)
void SelectPam(SwPaM &rPam, const bool bExpand)
static void lcl_ExtractFramePositions(FrameClientSortList_t &rFrames, sal_Int32 nCurrentIndex, o3tl::sorted_vector< sal_Int32 > &rFramePositions)
Fills character positions from rFrames into rFramePositions.
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
PaM is Point and Mark: a selection of the document model.
void SetFootnote(css::uno::Reference< css::text::XFootnote > const &xNote)
static css::uno::Reference< css::text::XTextContent > CreateXBookmark(SwDoc &rDoc,::sw::mark::IMark *pBookmark)
constexpr TypedWhichId< SwFormatField > RES_TXTATR_FIELD(RES_TXTATR_NOEND_BEGIN)
static void lcl_ExportBookmark(TextRangeList_t &rPortions, Reference< XText > const &xParent, const SwUnoCursor *const pUnoCursor, SwXBookmarkPortion_ImplList &rBkmArr, const sal_Int32 nIndex, const o3tl::sorted_vector< sal_Int32 > &rFramePositions, bool bOnlyFrameStarts)
Exports all bookmarks from rBkmArr into rPortions that have the same start or end position as nIndex...
SwTextAttr * Get(size_t nPos) const
static void lcl_ExportRedline(TextRangeList_t &rPortions, Reference< XText > const &xParent, const SwUnoCursor *const pUnoCursor, SwXRedlinePortion_ImplList &rRedlineArr, const sal_Int32 nIndex)
virtual OUString SAL_CALL getImplementationName() override
::sw::mark::IMark * GetAnnotationMark() const
const SwPosition * GetPoint() const
void SetBookmark(css::uno::Reference< css::text::XTextContent > const &xMark)
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId()
static uno::Reference< text::XTextRange > lcl_ExportFieldMark(uno::Reference< text::XText > const &i_xParentText, SwUnoCursor *const pUnoCursor, const SwTextNode *const pTextNode)
void CollectFrameAtNode(const SwNodeIndex &rIdx, FrameClientSortList_t &rFrames, const bool bAtCharAnchoredObjs)
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
sal_Int32 indexOfAny(OUString const &rIn, sal_Unicode const *const pChars, sal_Int32 const nPos)
Marks a character position inside a document model node.
#define CH_TXT_ATR_FIELDSTART
std::pair< TextRangeList_t *const, SwTextAttr const *const > PortionList_t
static css::uno::Reference< css::text::XDocumentIndexMark > CreateXDocumentIndexMark(SwDoc &rDoc, SwTOXMark *pMark, TOXTypes eType=TOX_INDEX)
void SetTextField(css::uno::Reference< css::text::XTextField > const &xField)
static void lcl_InsertRubyPortion(TextRangeList_t &rPortions, Reference< XText > const &xParent, const SwUnoCursor *const pUnoCursor, const SwTextAttr &rAttr, const bool bEnd)
virtual const_iterator_t getAnnotationMarksBegin() const =0
Marks a node in the document model.
void SetCollapsed(bool bSet)
const_iterator end() const
std::stack< PortionList_t > PortionStack_t
static css::uno::Reference< css::text::XTextContent > CreateXReferenceMark(SwDoc &rDoc, SwFormatRefMark *pMarkFormat)
const SwFormatFootnote & GetFootnote() const
static sal_Int32 lcl_GetNextIndex(SwXBookmarkPortion_ImplList const &rBkmArr, SwXRedlinePortion_ImplList const &rRedlineArr, SwSoftPageBreakList const &rBreakArr)
const SwPosition * Start() const
const_iterator begin() const
static void lcl_FillFieldMarkArray(std::deque< sal_Int32 > &rFieldMarks, SwUnoCursor const &rUnoCursor, const sal_Int32 i_nStartPos)
void fillSoftPageBreakList(SwSoftPageBreakList &rBreak) const
SwTextNode is a paragraph in the document model.
OUString ExpandField(bool bCached, SwRootFrame const *pLayout) const
expand the field.
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
SwXTextPortionEnumeration(SwPaM &rParaCursor, css::uno::Reference< css::text::XText > const &xParent, const sal_Int32 nStart, const sal_Int32 nEnd)
static void lcl_FillSoftPageBreakArray(SwUnoCursor const &rUnoCursor, SwSoftPageBreakList &rBreakArr)
An SwTextAttr container, stores all directly formatted text portions for a text node.
static void lcl_ExportAnnotationStarts(TextRangeList_t &rPortions, Reference< XText > const &xParent, const SwUnoCursor *const pUnoCursor, SwAnnotationStartPortion_ImplList &rAnnotationStartArr, const sal_Int32 nIndex, const o3tl::sorted_vector< sal_Int32 > &rFramePositions, bool bOnlyFrame)
Exports all start annotation marks from rAnnotationStartArr into rPortions that have the same start p...
sw::UnoCursorPointer m_pUnoCursor
std::multiset< SwXRedlinePortion_ImplSharedPtr, RedlineCompareStruct > SwXRedlinePortion_ImplList
void reset(std::shared_ptr< SwUnoCursor > pNew)
bool Right(sal_uInt16 nCnt)
sal_Int32 GetIndex() const
virtual sal_Int64 SAL_CALL getSomething(const css::uno::Sequence< sal_Int8 > &aIdentifier) override
const SwPosition * End() const
const sal_Int32 * End() const
static Reference< XTextRange > lcl_ExportHints(PortionStack_t &rPortionStack, const Reference< XText > &xParent, SwUnoCursor *const pUnoCursor, SwpHints const *const pHints, const sal_Int32 i_nStartPos, const sal_Int32 i_nEndPos, const sal_Int32 nCurrentIndex, const bool bRightMoveForbidden, bool &o_rbCursorMoved, sal_Int32 &o_rNextAttrPosition)
constexpr TypedWhichId< SwTOXMark > RES_TXTATR_TOXMARK(47)
void SetRefMark(css::uno::Reference< css::text::XTextContent > const &xMark)
virtual const SwPosition & GetMarkEnd() const =0
constexpr TypedWhichId< SwFormatField > RES_TXTATR_INPUTFIELD(55)
#define CH_TXT_ATR_FIELDEND
constexpr TypedWhichId< SwFlyFrameFormat > RES_FLYFRMFMT(154)
const SfxPoolItem & GetAttr() const
uno::Reference< ucb::XContent > xContent
#define SAL_WARN(area, stream)
static void lcl_MoveCursor(SwUnoCursor *const pUnoCursor, const sal_Int32 nCurrentIndex, const sal_Int32 nNextFrameIndex, const sal_Int32 nNextPortionIndex, const sal_Int32 nNextAttrIndex, const sal_Int32 nNextMarkIndex, const sal_Int32 nEndPos)
void SetMeta(css::uno::Reference< css::text::XTextContent > const &xMeta)
const SwIndex * GetFirstIndex() const
virtual const SwPosition & GetMarkStart() const =0
static void lcl_ExportBkmAndRedline(TextRangeList_t &rPortions, Reference< XText > const &xParent, const SwUnoCursor *const pUnoCursor, SwXBookmarkPortion_ImplList &rBkmArr, SwXRedlinePortion_ImplList &rRedlineArr, SwSoftPageBreakList &rBreakArr, const sal_Int32 nIndex, const o3tl::sorted_vector< sal_Int32 > &rFramePositions, bool bOnlyFrameBookmarkStarts)
constexpr TypedWhichId< SwFormatRefMark > RES_TXTATR_REFMARK(RES_TXTATR_WITHEND_BEGIN)
static sal_Int32 lcl_ExportFrames(TextRangeList_t &rPortions, Reference< XText > const &i_xParent, SwUnoCursor const *const i_pUnoCursor, FrameClientSortList_t &i_rFrames, sal_Int32 const i_nCurrentIndex)
Exports at-char anchored frames.
TextRangeList_t m_Portions
virtual const SwRedlineTable & GetRedlineTable() const =0
std::pair< const_iterator, bool > insert(Value &&x)
#define CH_TXT_ATR_FIELDSEP
virtual bool IsExpanded() const =0
static uno::Reference< text::XTextRange > lcl_CreateMetaPortion(uno::Reference< text::XText > const &xParent, const SwUnoCursor *const pUnoCursor, SwTextAttr &rAttr, std::unique_ptr< TextRangeList_t const > &&pPortions)
const SwFormatField * GetAnnotationFormatField() const
static void lcl_ExportSoftPageBreak(TextRangeList_t &rPortions, Reference< XText > const &xParent, const SwUnoCursor *const pUnoCursor, SwSoftPageBreakList &rBreakArr, const sal_Int32 nIndex)
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
size_type erase(const Value &x)
static void lcl_CreatePortions(TextRangeList_t &i_rPortions, uno::Reference< text::XText > const &i_xParentText, SwUnoCursor *pUnoCursor, FrameClientSortList_t &i_rFrames, const sal_Int32 i_nStartPos, const sal_Int32 i_nEndPos)
const SwFormatFlyCnt & GetFlyCnt() const