LibreOffice Module sw (master)  1
Classes | Typedefs | Enumerations | 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 <unomid.h>
#include <unoparaframeenum.hxx>
#include <unocrsrhelper.hxx>
#include <unorefmark.hxx>
#include <unobookmark.hxx>
#include <unoredline.hxx>
#include <unofield.hxx>
#include <unometa.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 <docufld.hxx>
#include <txtfld.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.

Classes

struct  SwXRedlinePortion_Impl
 
struct  RedlineCompareStruct
 

Typedefs

typedef std::pair< TextRangeList_t *const, SwTextAttr const *const > PortionList_t
 
typedef std::stack< PortionList_tPortionStack_t
 
typedef std::shared_ptr< SwXRedlinePortion_ImplSwXRedlinePortion_ImplSharedPtr
 
typedef std::multiset< SwXRedlinePortion_ImplSharedPtr, RedlineCompareStructSwXRedlinePortion_ImplList
 

Enumerations

enum  BkmType
 

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)
 
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 void lcl_ExportBookmark (TextRangeList_t &rPortions, Reference< XText > const &xParent, const SwUnoCursor *const pUnoCursor, SwXBookmarkPortion_ImplList &rBkmArr, const sal_Int32 nIndex, const std::set< 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 std::set< 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 std::set< 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, std::set< 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

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

Definition at line 75 of file unoportenum.cxx.

typedef std::stack< PortionList_t > PortionStack_t

Definition at line 76 of file unoportenum.cxx.

Definition at line 724 of file unoportenum.cxx.

Definition at line 707 of file unoportenum.cxx.

Enumeration Type Documentation

enum BkmType
strong

Definition at line 87 of file unoportenum.cxx.

Function Documentation

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
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 
)
static
static Reference<XTextRange> lcl_CreateRefMarkPortion ( Reference< XText > const &  xParent,
const SwUnoCursor *const  pUnoCursor,
const SwTextAttr rAttr,
const bool  bEnd 
)
static
static Reference<XTextRange> lcl_CreateTOXMarkPortion ( Reference< XText > const &  xParent,
const SwUnoCursor *const  pUnoCursor,
SwTextAttr rAttr,
const bool  bEnd 
)
static
static void lcl_ExportAnnotationStarts ( TextRangeList_t rPortions,
Reference< XText > const &  xParent,
const SwUnoCursor *const  pUnoCursor,
SwAnnotationStartPortion_ImplList &  rAnnotationStartArr,
const sal_Int32  nIndex,
const std::set< 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 1179 of file unoportenum.cxx.

References PORTION_ANNOTATION, and SwXTextPortion::SetTextField().

Referenced by lcl_CreatePortions().

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 std::set< sal_Int32 > &  rFramePositions,
bool  bOnlyFrameBookmarkStarts 
)
static
static void lcl_ExportBookmark ( TextRangeList_t rPortions,
Reference< XText > const &  xParent,
const SwUnoCursor *const  pUnoCursor,
SwXBookmarkPortion_ImplList &  rBkmArr,
const sal_Int32  nIndex,
const std::set< 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 603 of file unoportenum.cxx.

References PORTION_BOOKMARK_END, PORTION_BOOKMARK_START, SwXTextPortion::SetBookmark(), and SwXTextPortion::SetCollapsed().

Referenced by lcl_ExportBkmAndRedline().

static uno::Reference<text::XTextRange> lcl_ExportFieldMark ( uno::Reference< text::XText > const &  i_xParentText,
SwUnoCursor *const  pUnoCursor,
const SwTextNode *const  pTextNode 
)
static
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 1249 of file unoportenum.cxx.

References SwClient::GetRegisteredIn().

Referenced by lcl_CreatePortions().

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
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 1110 of file unoportenum.cxx.

Referenced by lcl_ExportBkmAndRedline().

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

Definition at line 663 of file unoportenum.cxx.

References PORTION_SOFT_PAGEBREAK.

Referenced by lcl_ExportBkmAndRedline().

static void lcl_ExtractFramePositions ( FrameClientSortList_t rFrames,
sal_Int32  nCurrentIndex,
std::set< sal_Int32 > &  rFramePositions 
)
static

Fills character positions from rFrames into rFramePositions.

Definition at line 1218 of file unoportenum.cxx.

References SwFormatAnchor::GetContentAnchor(), SwIndex::GetIndex(), SwClient::GetRegisteredIn(), and SwPosition::nContent.

Referenced by lcl_CreatePortions().

static void lcl_FillFieldMarkArray ( std::deque< sal_Int32 > &  rFieldMarks,
SwUnoCursor const &  rUnoCursor,
const sal_Int32  i_nStartPos 
)
static
static void lcl_FillRedlineArray ( SwDoc const &  rDoc,
SwUnoCursor const &  rUnoCursor,
SwXRedlinePortion_ImplList rRedArr 
)
static
static void lcl_FillSoftPageBreakArray ( SwUnoCursor const &  rUnoCursor,
SwSoftPageBreakList rBreakArr 
)
static
static sal_Int32 lcl_GetNextIndex ( SwXBookmarkPortion_ImplList const &  rBkmArr,
SwXRedlinePortion_ImplList const &  rRedlineArr,
SwSoftPageBreakList const &  rBreakArr 
)
static

Definition at line 1279 of file unoportenum.cxx.

Referenced by lcl_CreatePortions().

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 524 of file unoportenum.cxx.

References SwTextAttr::End(), and SwXTextPortion::SetCollapsed().

Referenced by lcl_ExportHints().

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