22 #include <com/sun/star/text/XTextSection.hpp>
30 #include <section.hxx>
31 #include <unoprnms.hxx>
64 uno::Reference<container::XEnumerationAccess> aAccess =
this;
73 aRet = OWeakObject::queryInterface(rType);
90 return css::uno::Sequence<sal_Int8>();
100 auto& rUnoCursor(pXCursor->GetCursor());
110 bool bTable = pTableNode !=
nullptr;
111 while( pTableNode !=
nullptr )
117 if( pContentNode !=
nullptr )
118 rUnoCursor.GetPoint()->nContent.Assign( pContentNode, 0 );
125 uno::RuntimeException aExcept;
127 "No content node found that is inside this change section "
128 "but outside of a table";
132 return static_cast<text::XWordCursor*
>(pXCursor.get());
136 const uno::Reference<text::XTextRange> & aTextRange)
139 xCursor->gotoRange(aTextRange->getStart(),
false);
140 xCursor->gotoRange(aTextRange->getEnd(),
true);
149 auto pUnoCursor(
GetDoc()->CreateUnoCursor(*aPam.
Start()));
165 uno::Reference< text::XText >
const& xParent,
bool const bStart)
168 , m_rRedline(rRedline)
192 return uno::Sequence<beans::PropertyValue>(4);
215 OSL_FAIL(
"Empty section in redline portion! (end node immediately follows start node)");
236 for(
size_t nRed = 0; nRed < rRedTable.
size() && !bFound; nRed++)
246 return css::uno::Sequence<sal_Int8>();
261 aRet <<= const_cast<SwRangeRedline&>(rRedline).GetDescr();
273 aRet <<= OUString::number(
274 sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >(&rRedline) ) );
290 uno::Sequence< beans::PropertyValue > aRet(12);
292 beans::PropertyValue* pRet = aRet.getArray();
294 sal_Int32 nPropIdx = 0;
300 pRet[nPropIdx++].Value <<= rRedline.
GetComment();
302 pRet[nPropIdx++].Value <<=
const_cast<SwRangeRedline&
>(rRedline).GetDescr();
306 pRet[nPropIdx++].Value <<= OUString::number(
307 sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >(&rRedline) ) );
309 pRet[nPropIdx++].Value <<= !rRedline.
HasMark();
312 pRet[nPropIdx++].Value <<= bIsStart;
324 pRet[nPropIdx++].Value <<= xRet;
327 OSL_FAIL(
"Empty section in redline portion! (end node immediately follows start node)");
335 aRet.realloc(nPropIdx);
342 m_pRedline(&rRedline)
353 static uno::Reference< beans::XPropertySetInfo > xRef =
362 throw uno::RuntimeException();
365 OSL_FAIL(
"currently not available");
369 OSL_FAIL(
"currently not available");
373 OUString sTmp; aValue >>= sTmp;
378 SAL_WARN(
"sw.uno",
"SwXRedline::setPropertyValue: can't set Description");
382 OSL_FAIL(
"currently not available");
383 OUString sTmp; aValue >>= sTmp;
385 throw lang::IllegalArgumentException();
389 OSL_FAIL(
"currently not available");
393 throw lang::IllegalArgumentException();
401 throw uno::RuntimeException();
407 uno::Reference<XInterface> xRet;
416 OSL_ENSURE(pSectNode,
"No section node!");
423 OSL_ENSURE(pTableNode,
"No table node!");
436 const uno::Reference<text::XTextRange> xRange =
442 OSL_FAIL(
"illegal node type");
457 OSL_FAIL(
"Empty section in redline portion! (end node immediately follows start node)");
468 const uno::Reference< beans::XPropertyChangeListener >& )
473 const OUString& ,
const uno::Reference< beans::XPropertyChangeListener >& )
478 const OUString& ,
const uno::Reference< beans::XVetoableChangeListener >& )
483 const OUString& ,
const uno::Reference< beans::XVetoableChangeListener >& )
489 if(rHint.
GetId() == SfxHintId::Dying)
493 }
else if(
auto pHint = dynamic_cast<const sw::FindRedlineHint*>(&rHint)) {
494 if(!*pHint->m_ppXRedline && &pHint->m_rRedline ==
GetRedline())
495 *pHint->m_ppXRedline =
this;
503 throw uno::RuntimeException();
508 SwPaM aPam(*pNodeIndex);
510 auto pUnoCursor(
GetDoc()->CreateUnoCursor(*aPam.
Start()));
522 throw uno::RuntimeException();
530 throw uno::RuntimeException();
535 throw uno::RuntimeException();
541 auto& rUnoCursor(pXCursor->GetCursor());
554 rUnoCursor.GetPoint()->nContent.Assign(pCont, 0);
556 return static_cast<text::XWordCursor*
>(pXCursor.get());
560 const uno::Reference< text::XTextRange > & )
562 throw uno::RuntimeException();
570 aRet = SwXRedlineBaseClass::queryInterface(rType);
579 SwXRedlineBaseClass::getTypes()
585 return css::uno::Sequence<sal_Int8>();
virtual css::uno::Type SAL_CALL getElementType() override
const SwEndNode * EndOfSectionNode() const
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
Starts a section of nodes in the document model.
SwNode & GetNode(bool bPoint=true) const
SwNodeOffset EndOfSectionIndex() const
Marks a position in the document model.
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
#define PROPERTY_MAP_REDLINE
OUString const & GetAuthorString(sal_uInt16 nPos=0) const
virtual const SwStartNode * GetStartNode() const override
#define UNO_NAME_MERGE_LAST_PARA
const SwRedlineData * Next() const
#define UNO_NAME_IS_START
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
css::beans::PropertyValue makePropertyValue(const OUString &rName, T &&rValue)
const SwPosition * GetMark() const
const SfxItemPropertySet * GetPropertySet(sal_uInt16 PropertyId)
SwSectionNode is derived from SwStartNode.
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
SwSectionFormat * GetFormat()
static css::uno::Any GetPropertyValue(std::u16string_view PropertyName, SwRangeRedline const &rRedline)
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &rPropertyName) override
SwXRedline(SwRangeRedline &rRedline, SwDoc &rDoc)
SwTableFormat * GetFrameFormat()
css::uno::Reference< css::beans::XPropertySetInfo > const & getPropertySetInfo() const
virtual css::uno::Type SAL_CALL getElementType() override
bool IsInHeaderFooter(const SwNodeIndex &rIdx) const
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
const SwSection & GetSection() const
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
RedlineType GetType() const
virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL createTextCursor() override
SwTableNode * GetTableNode()
SwNodeType GetNodeType() const
IDocumentStylePoolAccess const & getIDocumentStylePoolAccess() const
SwXRedlinePortion(SwRangeRedline const &rRedline, SwUnoCursor const *pPortionCursor, css::uno::Reference< css::text::XText > const &xParent, bool const bIsStart)
const DateTime & GetTimeStamp(sal_uInt16 nPos=0) const
static uno::Sequence< beans::PropertyValue > lcl_GetSuccessorProperties(const SwRangeRedline &rRedline)
#define UNO_NAME_IS_COLLAPSED
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &aType) override
const SwTable & GetTable() const
#define UNO_NAME_REDLINE_END
virtual ~SwXRedline() override
SwRangeRedline const & m_rRedline
const SwRedlineData & GetRedlineData(sal_uInt16 nPos=0) const
virtual SwPageDesc * GetPageDescFromPool(sal_uInt16 nId, bool bRegardLanguage=true)=0
Return required automatic page style.
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
SwRangeRedline * m_pRedline
css::util::DateTime GetUNODateTime() const
PaM is Point and Mark: a selection of the document model.
bool Move(SwMoveFnCollection const &fnMove=fnMoveForward, SwGoInDoc fnGo=GoInContent)
Movement of cursor.
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &aType) override
bool GoInNode(SwPaM &rPam, SwMoveFnCollection const &fnMove)
SwXRedlineText provides an XText which may be used to write directly into a redline node...
const SwPosition * GetPoint() const
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL createTextCursorByRange(const css::uno::Reference< css::text::XTextRange > &aTextPosition) override
OUString SwRedlineTypeToOUString(RedlineType eType)
#define UNO_NAME_REDLINE_SUCCESSOR_DATA
SwNodeOffset GetIndex() const
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
virtual sal_Bool SAL_CALL hasElements() override
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
const DateTime & GetTimeStamp() const
#define UNO_NAME_IS_IN_HEADER_FOOTER
Marks a node in the document model.
#define UNO_NAME_REDLINE_DESCRIPTION
css::uno::Type const & get()
void SetCollapsed(bool bSet)
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
static css::uno::Reference< css::text::XTextTable > GetObject(SwFrameFormat &rFormat)
bool StartListening(SvtBroadcaster &rBroadcaster)
SwStartNode * GetStartNode()
css::uno::Sequence< T > concatSequences(const css::uno::Sequence< T > &rS1, const Ss &...rSn)
#define UNO_NAME_REDLINE_COMMENT
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
SwTable is one table in the document model, containing rows (which contain cells).
const SwPosition * Start() const
#define UNO_NAME_REDLINE_AUTHOR
const OUString & GetComment(sal_uInt16 nPos=0) const
SvtBroadcaster & GetNotifier()
void SetComment(const OUString &rS)
virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL createTextCursor() override
const OUString & GetComment() const
const SwDoc * GetDoc() const
static css::uno::Sequence< css::beans::PropertyValue > CreateRedlineProperties(SwRangeRedline const &rRedline, bool const bIsStart)
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
SwXRedlineText(SwDoc *pDoc, const SwNodeIndex &aNodeIndex)
virtual ~SwXRedlinePortion() override
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override
const SwRangeRedline * GetRedline() const
#define UNO_NAME_REDLINE_START
#define UNO_NAME_REDLINE_IDENTIFIER
SwMoveFnCollection const & fnMoveForward
SwPam::Move()/Find() default argument.
SwUnoCursor & GetCursor() const
virtual sal_Bool SAL_CALL hasElements() override
RedlineType GetType(sal_uInt16 nPos=0) const
SwTableNode is derived from SwStartNode.
SwUnoPropertyMapProvider aSwMapProvider
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL createTextCursorByRange(const css::uno::Reference< css::text::XTextRange > &aTextPosition) override
#define UNO_NAME_REDLINE_TEXT
o3tl::strong_int< sal_Int32, struct Tag_SwNodeOffset > SwNodeOffset
css::uno::Sequence< css::uno::Type > SAL_CALL getTypes()
SwTableNode * FindTableNode()
Search table node, in which it is.
#define UNO_NAME_REDLINE_DATE_TIME
#define SAL_WARN(area, stream)
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
#define UNO_NAME_REDLINE_TYPE
SwSectionNode * GetSectionNode()
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)
static css::uno::Reference< css::text::XTextSection > GetObject(SwSectionFormat &rFormat)
virtual const SwRedlineTable & GetRedlineTable() const =0
bool IsDelLastPara() const
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
SwContentNode * GoNext(SwNodeIndex *) const
SwNodeIndex * GetContentIdx() const
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override
virtual void Notify(const SfxHint &) override
Base class of the Writer document model elements.