LibreOffice Module sw (master) 1
Typedefs | Functions
unoportenum.cxx File Reference
#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>
Include dependency graph for unoportenum.cxx:

Go to the source code of this file.

Typedefs

typedef std::pair< TextRangeList_t *const, SwTextAttr const *const > PortionList_t
 
typedef std::stack< PortionList_tPortionStack_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 Documentation

◆ PortionList_t

typedef std::pair< TextRangeList_t * const, SwTextAttr const * const > PortionList_t

Definition at line 72 of file unoportenum.cxx.

◆ PortionStack_t

typedef std::stack< PortionList_t > PortionStack_t

Definition at line 73 of file unoportenum.cxx.

◆ SwXRedlinePortion_ImplList

typedef std::multiset< SwXRedlinePortion_ImplSharedPtr, RedlineCompareStruct > SwXRedlinePortion_ImplList

Definition at line 699 of file unoportenum.cxx.

◆ SwXRedlinePortion_ImplSharedPtr

typedef std::shared_ptr< SwXRedlinePortion_Impl > SwXRedlinePortion_ImplSharedPtr

Definition at line 678 of file unoportenum.cxx.

Function Documentation

◆ lcl_CreateContentControlPortion()

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 
)
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().

◆ lcl_CreateMetaPortion()

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

◆ lcl_CreatePortions()

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

◆ lcl_CreateRefMarkPortion()

static Reference< XTextRange > lcl_CreateRefMarkPortion ( Reference< XText > const &  xParent,
const SwUnoCursor *const  pUnoCursor,
const SwTextAttr rAttr,
const bool  bEnd 
)
static

◆ lcl_CreateTOXMarkPortion()

static Reference< XTextRange > lcl_CreateTOXMarkPortion ( Reference< XText > const &  xParent,
const SwUnoCursor *const  pUnoCursor,
SwTextAttr rAttr,
const bool  bEnd 
)
static

◆ lcl_ExportAnnotationStarts()

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 
)
static

Exports all start annotation marks from rAnnotationStartArr into rPortions that have the same start position as nIndex.

Parameters
rAnnotationStartArrthe array of annotation marks. Consumed entries are removed.
rFramePositionsthe list of positions where there is an at-char anchored frame.
bOnlyFrameIf 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().

◆ lcl_ExportBkmAndRedline()

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

◆ lcl_ExportBookmark()

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 
)
static

Exports all bookmarks from rBkmArr into rPortions that have the same start or end position as nIndex.

Parameters
rBkmArrthe array of bookmarks. If bOnlyFrameStarts is true, then this is only read, otherwise consumed entries are removed.
rFramePositionsthe list of positions where there is an at-char / anchored frame.
bOnlyFrameStartsIf 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().

◆ lcl_ExportFieldMark()

static uno::Reference< text::XTextRange > lcl_ExportFieldMark ( uno::Reference< text::XText > const &  i_xParentText,
SwUnoCursor *const  pUnoCursor,
const SwTextNode *const  pTextNode 
)
static

◆ lcl_ExportFrames()

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 
)
static

Exports at-char anchored frames.

Parameters
i_rFramesthe 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().

◆ lcl_ExportHints()

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

◆ lcl_ExportRedline()

static void lcl_ExportRedline ( TextRangeList_t rPortions,
Reference< XText > const &  xParent,
const SwUnoCursor *const  pUnoCursor,
SwXRedlinePortion_ImplList rRedlineArr,
const sal_Int32  nIndex 
)
static

Definition at line 1139 of file unoportenum.cxx.

References nIndex.

Referenced by lcl_ExportBkmAndRedline().

◆ lcl_ExportSoftPageBreak()

static void lcl_ExportSoftPageBreak ( TextRangeList_t rPortions,
Reference< XText > const &  xParent,
const SwUnoCursor *const  pUnoCursor,
SwSoftPageBreakList rBreakArr,
const sal_Int32  nIndex 
)
static

◆ lcl_ExtractFramePositions()

static void lcl_ExtractFramePositions ( FrameClientSortList_t rFrames,
sal_Int32  nCurrentIndex,
o3tl::sorted_vector< sal_Int32 > &  rFramePositions 
)
static

◆ lcl_FillFieldMarkArray()

static void lcl_FillFieldMarkArray ( std::deque< sal_Int32 > &  rFieldMarks,
SwUnoCursor const &  rUnoCursor,
const sal_Int32  i_nStartPos 
)
static

◆ lcl_FillRedlineArray()

static void lcl_FillRedlineArray ( SwDoc const &  rDoc,
SwUnoCursor const &  rUnoCursor,
SwXRedlinePortion_ImplList rRedArr 
)
static

◆ lcl_FillSoftPageBreakArray()

static void lcl_FillSoftPageBreakArray ( SwUnoCursor const &  rUnoCursor,
SwSoftPageBreakList rBreakArr 
)
static

◆ lcl_GetNextIndex()

static sal_Int32 lcl_GetNextIndex ( SwXBookmarkPortion_ImplList const &  rBkmArr,
SwXRedlinePortion_ImplList const &  rRedlineArr,
SwSoftPageBreakList const &  rBreakArr 
)
static

◆ lcl_InsertRubyPortion()

static void lcl_InsertRubyPortion ( TextRangeList_t rPortions,
Reference< XText > const &  xParent,
const SwUnoCursor *const  pUnoCursor,
const SwTextAttr rAttr,
const bool  bEnd 
)
static

Definition at line 478 of file unoportenum.cxx.

References SwTextAttr::End().

Referenced by lcl_ExportHints().

◆ lcl_MoveCursor()

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