LibreOffice Module sw (master) 1
|
#include <sal/config.h>
#include <sal/log.hxx>
#include <utility>
#include <unoport.hxx>
#include <IMark.hxx>
#include <crossrefbookmark.hxx>
#include <annotationmark.hxx>
#include <doc.hxx>
#include <IDocumentRedlineAccess.hxx>
#include <txatbase.hxx>
#include <txtatr.hxx>
#include <ndhints.hxx>
#include <ndtxt.hxx>
#include <unocrsr.hxx>
#include <docary.hxx>
#include <textboxhelper.hxx>
#include <tox.hxx>
#include <unoparaframeenum.hxx>
#include <unocrsrhelper.hxx>
#include <unorefmark.hxx>
#include <unobookmark.hxx>
#include <unofield.hxx>
#include <unometa.hxx>
#include <unolinebreak.hxx>
#include <unocontentcontrol.hxx>
#include <fmtfld.hxx>
#include <fldbas.hxx>
#include <fmtmeta.hxx>
#include <fmtanchr.hxx>
#include <fmtrfmrk.hxx>
#include <frmfmt.hxx>
#include <fmtflcnt.hxx>
#include <unoidx.hxx>
#include <unocoll.hxx>
#include <redline.hxx>
#include <txtannotationfld.hxx>
#include <vcl/svapp.hxx>
#include <comphelper/string.hxx>
#include <comphelper/servicehelper.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <com/sun/star/container/XEnumeration.hpp>
#include <algorithm>
#include <memory>
#include <set>
#include <stack>
Go to the source code of this file.
Typedefs | |
typedef std::pair< TextRangeList_t *const, SwTextAttr const *const > | PortionList_t |
typedef std::stack< PortionList_t > | PortionStack_t |
typedef std::shared_ptr< SwXRedlinePortion_Impl > | SwXRedlinePortion_ImplSharedPtr |
typedef std::multiset< SwXRedlinePortion_ImplSharedPtr, RedlineCompareStruct > | SwXRedlinePortion_ImplList |
Functions | |
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, bool bOnlyTextFields) |
static void | lcl_FillFieldMarkArray (std::deque< sal_Int32 > &rFieldMarks, SwUnoCursor const &rUnoCursor, const sal_Int32 i_nStartPos) |
static uno::Reference< text::XTextRange > | lcl_ExportFieldMark (uno::Reference< text::XText > const &i_xParentText, SwUnoCursor *const pUnoCursor, const SwTextNode *const pTextNode) |
static Reference< XTextRange > | lcl_CreateRefMarkPortion (Reference< XText > const &xParent, const SwUnoCursor *const pUnoCursor, const SwTextAttr &rAttr, const bool bEnd) |
static void | lcl_InsertRubyPortion (TextRangeList_t &rPortions, Reference< XText > const &xParent, const SwUnoCursor *const pUnoCursor, const SwTextAttr &rAttr, const bool bEnd) |
static Reference< XTextRange > | lcl_CreateTOXMarkPortion (Reference< XText > const &xParent, const SwUnoCursor *const pUnoCursor, SwTextAttr &rAttr, const bool bEnd) |
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) |
static uno::Reference< text::XTextRange > | lcl_CreateContentControlPortion (const uno::Reference< text::XText > &xParent, const SwUnoCursor *pUnoCursor, SwTextAttr &rAttr, std::unique_ptr< const TextRangeList_t > &&pPortions) |
Creates a text portion that has a non-empty ContentControl property. More... | |
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. More... | |
static void | lcl_ExportSoftPageBreak (TextRangeList_t &rPortions, Reference< XText > const &xParent, const SwUnoCursor *const pUnoCursor, SwSoftPageBreakList &rBreakArr, const sal_Int32 nIndex) |
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) |
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) |
static void | lcl_FillRedlineArray (SwDoc const &rDoc, SwUnoCursor const &rUnoCursor, SwXRedlinePortion_ImplList &rRedArr) |
static void | lcl_FillSoftPageBreakArray (SwUnoCursor const &rUnoCursor, SwSoftPageBreakList &rBreakArr) |
static void | lcl_ExportRedline (TextRangeList_t &rPortions, Reference< XText > const &xParent, const SwUnoCursor *const pUnoCursor, SwXRedlinePortion_ImplList &rRedlineArr, const sal_Int32 nIndex) |
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) |
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 position as nIndex. More... | |
static void | lcl_ExtractFramePositions (FrameClientSortList_t &rFrames, sal_Int32 nCurrentIndex, o3tl::sorted_vector< sal_Int32 > &rFramePositions) |
Fills character positions from rFrames into rFramePositions. More... | |
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. More... | |
static sal_Int32 | lcl_GetNextIndex (SwXBookmarkPortion_ImplList const &rBkmArr, SwXRedlinePortion_ImplList const &rRedlineArr, SwSoftPageBreakList const &rBreakArr) |
typedef std::pair< TextRangeList_t * const, SwTextAttr const * const > PortionList_t |
Definition at line 72 of file unoportenum.cxx.
typedef std::stack< PortionList_t > PortionStack_t |
Definition at line 73 of file unoportenum.cxx.
typedef std::multiset< SwXRedlinePortion_ImplSharedPtr, RedlineCompareStruct > SwXRedlinePortion_ImplList |
Definition at line 699 of file unoportenum.cxx.
typedef std::shared_ptr< SwXRedlinePortion_Impl > SwXRedlinePortion_ImplSharedPtr |
Definition at line 678 of file unoportenum.cxx.
|
static |
Creates a text portion that has a non-empty ContentControl property.
Definition at line 545 of file unoportenum.cxx.
References SwXContentControl::CreateXContentControl(), SwTextAttr::GetAttr(), SwFormatContentControl::GetContentControl(), and PORTION_CONTENT_CONTROL.
Referenced by lcl_ExportHints().
|
static |
Definition at line 518 of file unoportenum.cxx.
References SwXMeta::CreateXMeta(), SwTextAttr::GetAttr(), SwFormatMeta::GetMeta(), PORTION_FIELD, PORTION_META, RES_TXTATR_META(), and SwTextAttr::Which().
Referenced by lcl_ExportHints().
|
static |
Definition at line 1331 of file unoportenum.cxx.
References SwpHints::Count(), SwPaM::DeleteMark(), SwPosition::GetContentIndex(), SwPaM::GetDoc(), SwTextAttr::GetEnd(), getLength(), SwPosition::GetNode(), GetNode(), SwPaM::GetPoint(), SwPaM::GetPointNode(), SwTextNode::GetpSwpHints(), SwpHints::GetSortedByEnd(), SwTextAttr::GetStart(), SwNode::GetTextNode(), SwPaM::HasMark(), i, lcl_ExportAnnotationStarts(), lcl_ExportBkmAndRedline(), lcl_ExportFieldMark(), lcl_ExportFrames(), lcl_ExportHints(), lcl_ExtractFramePositions(), lcl_FillFieldMarkArray(), lcl_FillRedlineArray(), lcl_FillSoftPageBreakArray(), lcl_GetNextIndex(), lcl_MoveCursor(), SwTextNode::Len(), SwPaM::Normalize(), PORTION_TEXT, RES_TXTATR_AUTOFMT(), SwCursor::Right(), SwUnoCursorHelper::SelectPam(), Start, SwPaM::Start(), and SwTextAttr::Which().
|
static |
Definition at line 448 of file unoportenum.cxx.
References SwXReferenceMark::CreateXReferenceMark(), SwTextAttr::End(), SwTextAttr::GetAttr(), SwPaM::GetDoc(), PORTION_REFMARK_END, and PORTION_REFMARK_START.
Referenced by lcl_ExportHints().
|
static |
Definition at line 491 of file unoportenum.cxx.
References SwXDocumentIndexMark::CreateXDocumentIndexMark(), SwTextAttr::GetAttr(), SwPaM::GetDoc(), SwTextAttr::GetEnd(), PORTION_TOXMARK_END, and PORTION_TOXMARK_START.
Referenced by lcl_ExportHints().
|
static |
Exports all start annotation marks from rAnnotationStartArr into rPortions that have the same start position as nIndex.
rAnnotationStartArr | the array of annotation marks. Consumed entries are removed. |
rFramePositions | the list of positions where there is an at-char anchored frame. |
bOnlyFrame | If true: export only the start of annotation marks which cover an at-char anchored frame. If false: export everything else. |
Definition at line 1208 of file unoportenum.cxx.
References o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::end(), o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::find(), nIndex, and PORTION_ANNOTATION.
Referenced by lcl_CreatePortions().
|
static |
Definition at line 1170 of file unoportenum.cxx.
References o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::empty(), lcl_ExportBookmark(), lcl_ExportRedline(), lcl_ExportSoftPageBreak(), and nIndex.
Referenced by lcl_CreatePortions().
|
static |
Exports all bookmarks from rBkmArr into rPortions that have the same start or end position as nIndex.
rBkmArr | the array of bookmarks. If bOnlyFrameStarts is true, then this is only read, otherwise consumed entries are removed. |
rFramePositions | the list of positions where there is an at-char / anchored frame. |
bOnlyFrameStarts | If true: export only the start of the bookmarks which cover an at-char anchored frame. If false: export the end of the same bookmarks and everything else. |
Definition at line 572 of file unoportenum.cxx.
References o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::end(), o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::find(), nIndex, PORTION_BOOKMARK_END, and PORTION_BOOKMARK_START.
Referenced by lcl_ExportBkmAndRedline().
|
static |
Definition at line 373 of file unoportenum.cxx.
References CH_TXT_ATR_FIELDEND, CH_TXT_ATR_FIELDSEP, CH_TXT_ATR_FIELDSTART, CH_TXT_ATR_FORMELEMENT, Char, SwXFieldmark::CreateXFieldmark(), SwPaM::End(), SwPosition::GetContentIndex(), SwPaM::GetDoc(), IDocumentMarkAccess::getFieldmarkAt(), SwDoc::getIDocumentMarkAccess(), SwPaM::GetMark(), SwPaM::GetPoint(), SwTextNode::GetText(), PORTION_FIELD_END, PORTION_FIELD_SEP, PORTION_FIELD_START, PORTION_FIELD_START_END, SwCursor::Right(), start, and SwPaM::Start().
Referenced by lcl_CreatePortions().
|
static |
Exports at-char anchored frames.
i_rFrames | the frames for this paragraph, frames at <= i_nCurrentIndex are removed from the container. |
Definition at line 1277 of file unoportenum.cxx.
Referenced by lcl_CreatePortions().
|
static |
Definition at line 702 of file unoportenum.cxx.
References Count, SwpHints::Count(), SwXBookmark::CreateXBookmark(), SwXLineBreak::CreateXLineBreak(), SwXTextField::CreateXTextField(), SwPaM::DeleteMark(), SwPaM::Exchange(), SwField::ExpandField(), SwpHints::Get(), SwTextAnnotationField::GetAnnotationMark(), SwTextAttr::GetAnyEnd(), SwPaM::GetDoc(), SwTextAttr::GetEnd(), SwFormatField::GetField(), SwTextAttr::GetFlyCnt(), SwTextAttr::GetFootnote(), SwTextAttr::GetFormatField(), SwFormatFlyCnt::GetFrameFormat(), SwTextAttr::GetLineBreak(), SwPaM::GetMark(), SwXFootnotes::GetObject(), SwPaM::GetPoint(), SwpHints::GetSortedByEnd(), SwTextAttr::GetStart(), SwTextBoxHelper::isTextBox(), lcl_CreateContentControlPortion(), lcl_CreateMetaPortion(), lcl_CreateRefMarkPortion(), lcl_CreateTOXMarkPortion(), lcl_InsertRubyPortion(), SwPaM::Normalize(), PORTION_ANNOTATION, PORTION_ANNOTATION_END, PORTION_FIELD, PORTION_FOOTNOTE, PORTION_FRAME, PORTION_LINEBREAK, RES_FLYFRMFMT(), RES_TXTATR_ANNOTATION(), RES_TXTATR_AUTOFMT(), RES_TXTATR_CHARFMT(), RES_TXTATR_CJK_RUBY(), RES_TXTATR_CONTENTCONTROL(), RES_TXTATR_FIELD(), RES_TXTATR_FLYCNT(), RES_TXTATR_FTN(), RES_TXTATR_INETFMT(), RES_TXTATR_INPUTFIELD(), RES_TXTATR_LINEBREAK(), RES_TXTATR_META(), RES_TXTATR_METAFIELD(), RES_TXTATR_REFMARK(), RES_TXTATR_TOXMARK(), SwCursor::Right(), SAL_WARN, Top, and SwTextAttr::Which().
Referenced by lcl_CreatePortions().
|
static |
Definition at line 1139 of file unoportenum.cxx.
References nIndex.
Referenced by lcl_ExportBkmAndRedline().
|
static |
Definition at line 632 of file unoportenum.cxx.
References o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::begin(), o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::end(), o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::erase(), nIndex, and PORTION_SOFT_PAGEBREAK.
Referenced by lcl_ExportBkmAndRedline().
|
static |
Fills character positions from rFrames into rFramePositions.
Definition at line 1247 of file unoportenum.cxx.
References SwFormatAnchor::GetAnchorContentOffset(), SwFormatAnchor::GetAnchorNode(), and o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::insert().
Referenced by lcl_CreatePortions().
|
static |
Definition at line 355 of file unoportenum.cxx.
References CH_TXT_ATR_FIELDEND, CH_TXT_ATR_FIELDSEP, CH_TXT_ATR_FIELDSTART, CH_TXT_ATR_FORMELEMENT, SwPosition::GetNode(), SwPaM::GetPoint(), SwTextNode::GetText(), SwNode::GetTextNode(), and pos.
Referenced by lcl_CreatePortions().
|
static |
Definition at line 1101 of file unoportenum.cxx.
References SwDoc::getIDocumentRedlineAccess(), SwPosition::GetNode(), SwPaM::GetPoint(), IDocumentRedlineAccess::GetRedlinePos(), IDocumentRedlineAccess::GetRedlineTable(), SwPaM::HasMark(), SwRedlineTable::size(), and SwPaM::StartEnd().
Referenced by lcl_CreatePortions().
|
static |
Definition at line 1129 of file unoportenum.cxx.
References SwTextNode::fillSoftPageBreakList(), SwPosition::GetNode(), SwPaM::GetPoint(), and SwNode::GetTextNode().
Referenced by lcl_CreatePortions().
|
static |
Definition at line 1305 of file unoportenum.cxx.
References o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::begin(), and o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::empty().
Referenced by lcl_CreatePortions().
|
static |
Definition at line 478 of file unoportenum.cxx.
References SwTextAttr::End().
Referenced by lcl_ExportHints().
|
static |
Definition at line 1060 of file unoportenum.cxx.
References SwPaM::GetPoint(), SwPaM::GetPointContentNode(), SwContentNode::Len(), and SwPosition::SetContent().
Referenced by lcl_CreatePortions().