22 #include <com/sun/star/text/XTextSection.hpp>
29 #include <section.hxx>
30 #include <unoprnms.hxx>
63 uno::Reference<container::XEnumerationAccess> aAccess =
this;
72 aRet = OWeakObject::queryInterface(rType);
89 return css::uno::Sequence<sal_Int8>();
99 auto& rUnoCursor(pXCursor->GetCursor());
109 bool bTable = pTableNode !=
nullptr;
110 while( pTableNode !=
nullptr )
116 if( pContentNode !=
nullptr )
117 rUnoCursor.GetPoint()->nContent.Assign( pContentNode, 0 );
124 uno::RuntimeException aExcept;
126 "No content node found that is inside this change section "
127 "but outside of a table";
131 return static_cast<text::XWordCursor*
>(pXCursor.get());
135 const uno::Reference<text::XTextRange> & aTextRange)
138 xCursor->gotoRange(aTextRange->getStart(),
false);
139 xCursor->gotoRange(aTextRange->getEnd(),
true);
148 auto pUnoCursor(
GetDoc()->CreateUnoCursor(*aPam.
Start()));
164 uno::Reference< text::XText >
const& xParent,
bool const bStart)
167 , m_rRedline(rRedline)
178 uno::Sequence<beans::PropertyValue> aValues(4);
183 beans::PropertyValue*
pValues = aValues.getArray();
218 OSL_FAIL(
"Empty section in redline portion! (end node immediately follows start node)");
239 for(
size_t nRed = 0; nRed < rRedTable.
size() && !bFound; nRed++)
249 return css::uno::Sequence<sal_Int8>();
264 aRet <<= const_cast<SwRangeRedline&>(rRedline).GetDescr();
276 aRet <<= OUString::number(
277 sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >(&rRedline) ) );
293 uno::Sequence< beans::PropertyValue > aRet(12);
295 beans::PropertyValue* pRet = aRet.getArray();
297 sal_Int32 nPropIdx = 0;
303 pRet[nPropIdx++].Value <<= rRedline.
GetComment();
305 pRet[nPropIdx++].Value <<=
const_cast<SwRangeRedline&
>(rRedline).GetDescr();
309 pRet[nPropIdx++].Value <<= OUString::number(
310 sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >(&rRedline) ) );
312 pRet[nPropIdx++].Value <<= !rRedline.
HasMark();
315 pRet[nPropIdx++].Value <<= bIsStart;
327 pRet[nPropIdx++].Value <<= xRet;
330 OSL_FAIL(
"Empty section in redline portion! (end node immediately follows start node)");
338 aRet.realloc(nPropIdx);
356 static uno::Reference< beans::XPropertySetInfo > xRef =
365 throw uno::RuntimeException();
368 OSL_FAIL(
"currently not available");
372 OSL_FAIL(
"currently not available");
376 OUString sTmp; aValue >>= sTmp;
381 SAL_WARN(
"sw.uno",
"SwXRedline::setPropertyValue: can't set Description");
385 OSL_FAIL(
"currently not available");
386 OUString sTmp; aValue >>= sTmp;
388 throw lang::IllegalArgumentException();
392 OSL_FAIL(
"currently not available");
396 throw lang::IllegalArgumentException();
404 throw uno::RuntimeException();
410 uno::Reference<XInterface> xRet;
419 OSL_ENSURE(pSectNode,
"No section node!");
426 OSL_ENSURE(pTableNode,
"No table node!");
439 const uno::Reference<text::XTextRange> xRange =
445 OSL_FAIL(
"illegal node type");
460 OSL_FAIL(
"Empty section in redline portion! (end node immediately follows start node)");
471 const uno::Reference< beans::XPropertyChangeListener >& )
476 const OUString& ,
const uno::Reference< beans::XPropertyChangeListener >& )
481 const OUString& ,
const uno::Reference< beans::XVetoableChangeListener >& )
486 const OUString& ,
const uno::Reference< beans::XVetoableChangeListener >& )
492 if(rHint.
GetId() == SfxHintId::Dying)
496 }
else if(
auto pHint = dynamic_cast<const sw::FindRedlineHint*>(&rHint)) {
497 if(!*pHint->m_ppXRedline && &pHint->m_rRedline ==
GetRedline())
498 *pHint->m_ppXRedline =
this;
506 throw uno::RuntimeException();
511 SwPaM aPam(*pNodeIndex);
513 auto pUnoCursor(
GetDoc()->CreateUnoCursor(*aPam.
Start()));
525 throw uno::RuntimeException();
533 throw uno::RuntimeException();
538 throw uno::RuntimeException();
544 auto& rUnoCursor(pXCursor->GetCursor());
557 rUnoCursor.GetPoint()->nContent.Assign(pCont, 0);
559 return static_cast<text::XWordCursor*
>(pXCursor.get());
563 const uno::Reference< text::XTextRange > & )
565 throw uno::RuntimeException();
573 aRet = SwXRedlineBaseClass::queryInterface(rType);
582 SwXRedlineBaseClass::getTypes()
588 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.
sal_uLong GetIndex() const
SwNode & GetNode(bool bPoint=true) 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
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
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
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
sal_uLong EndOfSectionIndex() const
const PropertyValue * pValues
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
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
SwRangeRedline * pRedline
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.