22#include <com/sun/star/text/XTextSection.hpp>
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());
109 bool bTable = pTableNode !=
nullptr;
110 while( pTableNode !=
nullptr )
122 uno::RuntimeException aExcept;
124 "No content node found that is inside this change section "
125 "but outside of a table";
133 const uno::Reference<text::XTextRange> & aTextRange)
136 xCursor->gotoRange(aTextRange->getStart(),
false);
137 xCursor->gotoRange(aTextRange->getEnd(),
true);
146 auto pUnoCursor(
GetDoc()->CreateUnoCursor(*aPam.
Start()));
162 uno::Reference< text::XText >
const& xParent,
bool const bStart)
165 , m_rRedline(rRedline)
189 return uno::Sequence<beans::PropertyValue>(4);
212 OSL_FAIL(
"Empty section in redline portion! (end node immediately follows start node)");
233 for(
size_t nRed = 0; nRed < rRedTable.
size() && !bFound; nRed++)
243 return css::uno::Sequence<sal_Int8>();
258 aRet <<= const_cast<SwRangeRedline&>(rRedline).GetDescr();
270 aRet <<= OUString::number(
271 sal::static_int_cast< sal_Int64 >(
reinterpret_cast< sal_IntPtr
>(&rRedline) ) );
287 uno::Sequence< beans::PropertyValue > aRet(12);
289 beans::PropertyValue* pRet = aRet.getArray();
291 sal_Int32 nPropIdx = 0;
297 pRet[nPropIdx++].Value <<= rRedline.
GetComment();
299 pRet[nPropIdx++].Value <<=
const_cast<SwRangeRedline&
>(rRedline).GetDescr();
303 pRet[nPropIdx++].Value <<= OUString::number(
304 sal::static_int_cast< sal_Int64 >(
reinterpret_cast< sal_IntPtr
>(&rRedline) ) );
306 pRet[nPropIdx++].Value <<= !rRedline.
HasMark();
309 pRet[nPropIdx++].Value <<= bIsStart;
321 pRet[nPropIdx++].Value <<= xRet;
324 OSL_FAIL(
"Empty section in redline portion! (end node immediately follows start node)");
332 aRet.realloc(nPropIdx);
339 m_pRedline(&rRedline)
350 static uno::Reference< beans::XPropertySetInfo > xRef =
359 throw uno::RuntimeException();
362 OSL_FAIL(
"currently not available");
366 OSL_FAIL(
"currently not available");
370 OUString sTmp; aValue >>= sTmp;
375 SAL_WARN(
"sw.uno",
"SwXRedline::setPropertyValue: can't set Description");
379 OSL_FAIL(
"currently not available");
380 OUString sTmp; aValue >>= sTmp;
382 throw lang::IllegalArgumentException();
386 OSL_FAIL(
"currently not available");
390 throw lang::IllegalArgumentException();
398 throw uno::RuntimeException();
404 uno::Reference<XInterface> xRet;
413 OSL_ENSURE(pSectNode,
"No section node!");
420 OSL_ENSURE(pTableNode,
"No table node!");
435 xRet = uno::Reference<text::XTextRange>(xRange);
439 OSL_FAIL(
"illegal node type");
454 OSL_FAIL(
"Empty section in redline portion! (end node immediately follows start node)");
465 const uno::Reference< beans::XPropertyChangeListener >& )
470 const OUString& ,
const uno::Reference< beans::XPropertyChangeListener >& )
475 const OUString& ,
const uno::Reference< beans::XVetoableChangeListener >& )
480 const OUString& ,
const uno::Reference< beans::XVetoableChangeListener >& )
486 if(rHint.
GetId() == SfxHintId::Dying)
491 if(!*pHint->m_ppXRedline && &pHint->m_rRedline ==
GetRedline())
492 *pHint->m_ppXRedline =
this;
500 throw uno::RuntimeException();
505 SwPaM aPam(*pNodeIndex);
507 auto pUnoCursor(
GetDoc()->CreateUnoCursor(*aPam.
Start()));
519 throw uno::RuntimeException();
526 throw uno::RuntimeException();
531 throw uno::RuntimeException();
537 auto& rUnoCursor(pXCursor->GetCursor());
553 const uno::Reference< text::XTextRange > & )
555 throw uno::RuntimeException();
563 aRet = SwXRedlineBaseClass::queryInterface(rType);
572 SwXRedlineBaseClass::getTypes()
578 return css::uno::Sequence<sal_Int8>();
OUString SwRedlineTypeToOUString(RedlineType eType)
css::util::DateTime GetUNODateTime() const
virtual const SwRedlineTable & GetRedlineTable() const =0
virtual SwPageDesc * GetPageDescFromPool(sal_uInt16 nId, bool bRegardLanguage=true)=0
Return required automatic page style.
css::uno::Reference< css::beans::XPropertySetInfo > const & getPropertySetInfo() const
bool StartListening(SvtBroadcaster &rBroadcaster)
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
IDocumentStylePoolAccess const & getIDocumentStylePoolAccess() const
bool IsInHeaderFooter(const SwNode &) const
Marks a node in the document model.
Base class of the Writer document model elements.
SwStartNode * GetStartNode()
SwSectionNode * GetSectionNode()
SwNodeOffset GetIndex() const
SwTableNode * FindTableNode()
Search table node, in which it is.
SwNodeOffset EndOfSectionIndex() const
SwTableNode * GetTableNode()
SwNodeType GetNodeType() const
const SwEndNode * EndOfSectionNode() const
SwContentNode * GoNext(SwNodeIndex *) const
PaM is Point and Mark: a selection of the document model.
const SwPosition * GetMark() const
SwNode & GetPointNode() const
bool Move(SwMoveFnCollection const &fnMove=fnMoveForward, SwGoInDoc fnGo=GoInContent)
Movement of cursor.
SwNode & GetMarkNode() const
const SwPosition * GetPoint() const
const SwPosition * Start() const
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
const OUString & GetComment(sal_uInt16 nPos=0) const
const SwNodeIndex * GetContentIdx() const
OUString const & GetAuthorString(sal_uInt16 nPos=0) const
const DateTime & GetTimeStamp(sal_uInt16 nPos=0) const
void SetComment(const OUString &rS)
RedlineType GetType(sal_uInt16 nPos=0) const
bool IsDelLastPara() const
const SwRedlineData & GetRedlineData(sal_uInt16 nPos=0) const
const SwRedlineData * Next() const
const OUString & GetComment() const
const DateTime & GetTimeStamp() const
RedlineType GetType() const
A section node represents the start of a section on the UI, i.e.
const SwSection & GetSection() const
SwSectionFormat * GetFormat()
Starts a section of nodes in the document model.
const SwTable & GetTable() const
SwTable is one table in the document model, containing rows (which contain cells).
SwTableFormat * GetFrameFormat()
const SfxItemPropertySet * GetPropertySet(sal_uInt16 PropertyId)
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &rPropertyName) override
SwXRedlinePortion(SwRangeRedline const &rRedline, SwUnoCursor const *pPortionCursor, css::uno::Reference< css::text::XText > const &xParent, bool const bIsStart)
static css::uno::Any GetPropertyValue(std::u16string_view PropertyName, SwRangeRedline const &rRedline)
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
static css::uno::Sequence< css::beans::PropertyValue > CreateRedlineProperties(SwRangeRedline const &rRedline, bool const bIsStart)
virtual ~SwXRedlinePortion() override
SwRangeRedline const & m_rRedline
SwXRedlineText provides an XText which may be used to write directly into a redline node.
virtual rtl::Reference< SwXTextCursor > createXTextCursorByRange(const ::css::uno::Reference< ::css::text::XTextRange > &aTextPosition) override
SwXRedlineText(SwDoc *pDoc, const SwNodeIndex &aNodeIndex)
virtual const SwStartNode * GetStartNode() const override
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &aType) override
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override
virtual sal_Bool SAL_CALL hasElements() override
virtual css::uno::Type SAL_CALL getElementType() override
virtual rtl::Reference< SwXTextCursor > createXTextCursor() override
virtual sal_Bool SAL_CALL hasElements() override
virtual ~SwXRedline() override
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &aType) override
SwXRedline(SwRangeRedline &rRedline, SwDoc &rDoc)
virtual rtl::Reference< SwXTextCursor > createXTextCursorByRange(const ::css::uno::Reference< ::css::text::XTextRange > &aTextPosition) override
SwRangeRedline * m_pRedline
const SwRangeRedline * GetRedline() const
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
virtual rtl::Reference< SwXTextCursor > createXTextCursor() override
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
virtual void Notify(const SfxHint &) override
virtual css::uno::Type SAL_CALL getElementType() override
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
SwUnoCursor & GetCursor() const
void SetCollapsed(bool bSet)
static css::uno::Reference< css::text::XTextSection > GetObject(SwSectionFormat &rFormat)
static css::uno::Reference< css::text::XTextTable > GetObject(SwFrameFormat &rFormat)
const SwDoc * GetDoc() const
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
css::uno::Sequence< css::uno::Type > SAL_CALL getTypes()
css::uno::Type const & get()
std::deque< AttacherIndex_Impl > aIndex
#define SAL_WARN(area, stream)
css::uno::Sequence< T > concatSequences(const css::uno::Sequence< T > &rS1, const Ss &... rSn)
css::beans::PropertyValue makePropertyValue(const OUString &rName, T &&rValue)
@ Table
SwTableNode is derived from SwStartNode.
@ Section
SwSectionNode is derived from SwStartNode.
o3tl::strong_int< sal_Int32, struct Tag_SwNodeOffset > SwNodeOffset
bool GoInNode(SwPaM &rPam, SwMoveFnCollection const &fnMove)
SwMoveFnCollection const & fnMoveForward
SwPam::Move()/Find() default argument.
@ RES_POOLPAGE_STANDARD
Standard page.
Marks a position in the document model.
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)
SwUnoPropertyMapProvider aSwMapProvider
#define PROPERTY_MAP_REDLINE
constexpr OUStringLiteral UNO_NAME_REDLINE_SUCCESSOR_DATA
constexpr OUStringLiteral UNO_NAME_REDLINE_IDENTIFIER
constexpr OUStringLiteral UNO_NAME_MERGE_LAST_PARA
constexpr OUStringLiteral UNO_NAME_REDLINE_TYPE
constexpr OUStringLiteral UNO_NAME_IS_START
constexpr OUStringLiteral UNO_NAME_REDLINE_TEXT
constexpr OUStringLiteral UNO_NAME_IS_COLLAPSED
constexpr OUStringLiteral UNO_NAME_REDLINE_START
constexpr OUStringLiteral UNO_NAME_REDLINE_COMMENT
constexpr OUStringLiteral UNO_NAME_REDLINE_AUTHOR
constexpr OUStringLiteral UNO_NAME_REDLINE_DESCRIPTION
constexpr OUStringLiteral UNO_NAME_REDLINE_DATE_TIME
constexpr OUStringLiteral UNO_NAME_IS_IN_HEADER_FOOTER
constexpr OUStringLiteral UNO_NAME_REDLINE_END
static uno::Sequence< beans::PropertyValue > lcl_GetSuccessorProperties(const SwRangeRedline &rRedline)