29 #include <osl/mutex.hxx>
45 #include <unotext.hxx>
51 #include <com/sun/star/frame/XModel.hpp>
52 #include <com/sun/star/lang/NoSupportException.hpp>
53 #include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
54 #include <com/sun/star/rdf/Statement.hpp>
55 #include <com/sun/star/rdf/URI.hpp>
56 #include <com/sun/star/rdf/URIs.hpp>
57 #include <com/sun/star/rdf/XLiteral.hpp>
58 #include <com/sun/star/rdf/XRepositorySupplier.hpp>
59 #include <com/sun/star/lang/DisposedException.hpp>
70 uno::WeakReference<uno::XInterface>
m_wThis;
78 : m_EventListeners(m_Mutex)
79 , m_bIsDescriptor(nullptr == pRefMark)
81 , m_pMarkFormat(pRefMark)
103 uno::Reference<uno::XInterface>
const xThis(
m_wThis);
108 lang::EventObject
const ev(xThis);
114 if(rHint.
GetId() == SfxHintId::Dying)
128 uno::Reference<text::XTextContent>
133 uno::Reference<text::XTextContent> xMark;
147 pMark->
m_pImpl->m_wThis = xMark;
154 class theSwXReferenceMarkUnoTunnelId :
public rtl::Static< UnoTunnelIdInit, theSwXReferenceMarkUnoTunnelId > {};
165 return ::sw::UnoTunnelImpl<SwXReferenceMark>(rId,
this);
170 return "SwXReferenceMark";
179 uno::Sequence< OUString > SAL_CALL
183 "com.sun.star.text.TextContent",
184 "com.sun.star.text.ReferenceMark"
190 template<
typename T>
struct NotContainedIn
192 std::vector<T>
const& m_rVector;
193 explicit NotContainedIn(std::vector<T>
const& rVector)
194 : m_rVector(rVector) { }
195 bool operator() (T
const& rT) {
196 return std::find(m_rVector.begin(), m_rVector.end(), rT)
215 const bool bForceExpandHints( !bMark && pCursor && pCursor->
IsAtEndOfMeta() );
221 std::vector<SwTextAttr *> oldMarks;
241 std::vector<SwTextAttr *>
const newMarks(
244 std::vector<SwTextAttr *>::const_iterator
const iter(
245 std::find_if(newMarks.begin(), newMarks.end(),
246 NotContainedIn<SwTextAttr *>(oldMarks)));
247 assert(newMarks.end() != iter);
248 if (newMarks.end() != iter)
263 throw uno::RuntimeException(
264 "SwXReferenceMark::InsertRefMark(): cannot insert attribute",
nullptr);
279 throw uno::RuntimeException();
281 uno::Reference<lang::XUnoTunnel> xRangeTunnel( xTextRange, uno::UNO_QUERY);
284 if(xRangeTunnel.is())
286 pRange = ::sw::UnoTunnelGetImplementation<SwXTextRange>(xRangeTunnel);
288 ::sw::UnoTunnelGetImplementation<OTextCursorHelper>(xRangeTunnel);
290 SwDoc *
const pDocument =
291 pRange ? &pRange->
GetDoc() : (pCursor ? pCursor->
GetDoc() :
nullptr);
294 throw lang::IllegalArgumentException();
300 m_pImpl->InsertRefMark(aPam, dynamic_cast<SwXTextCursor*>(pCursor));
301 m_pImpl->m_bIsDescriptor =
false;
305 uno::Reference< text::XTextRange > SAL_CALL
314 if (pNewMark && (pNewMark ==
m_pImpl->m_pMarkFormat))
317 m_pImpl->m_pMarkFormat->GetTextRefMark();
323 const std::unique_ptr<SwPaM> pPam( (pTextMark->
End())
324 ?
new SwPaM( rTextNode, *pTextMark->
End(),
329 *
m_pImpl->m_pDoc, *pPam->Start(), pPam->End());
343 if (pNewMark && (pNewMark ==
m_pImpl->m_pMarkFormat))
346 m_pImpl->m_pMarkFormat->GetTextRefMark();
352 const sal_Int32 nStt = pTextMark->
GetStart();
353 const sal_Int32 nEnd = pTextMark->
End()
357 SwPaM aPam( rTextNode, nStt, rTextNode, nEnd );
358 m_pImpl->m_pDoc->getIDocumentContentOperations().DeleteAndJoin( aPam );
362 else if (
m_pImpl->m_bIsDescriptor)
369 const uno::Reference< lang::XEventListener > & xListener)
372 m_pImpl->m_EventListeners.addInterface(xListener);
376 const uno::Reference< lang::XEventListener > & xListener)
379 m_pImpl->m_EventListeners.removeInterface(xListener);
388 throw uno::RuntimeException();
404 ||
m_pImpl->m_pDoc->GetRefMark(rName))
406 throw uno::RuntimeException();
410 if ((rName !=
m_pImpl->m_sMarkName)
411 && pCurMark && (pCurMark ==
m_pImpl->m_pMarkFormat))
415 m_pImpl->m_pMarkFormat->GetTextRefMark();
421 const sal_Int32 nStt = pTextMark->
GetStart();
422 const sal_Int32 nEnd = pTextMark->
End()
426 SwPaM aPam( rTextNode, nStt, rTextNode, nEnd );
428 m_pImpl->m_pDoc->getIDocumentContentOperations().DeleteAndJoin( aPam );
433 m_pImpl->InsertRefMark( aPam,
nullptr );
440 uno::Reference< beans::XPropertySetInfo > SAL_CALL
445 static uno::Reference< beans::XPropertySetInfo > xRef =
454 throw lang::IllegalArgumentException();
464 throw beans::UnknownPropertyException(rPropertyName);
471 const uno::Reference< beans::XPropertyChangeListener >& )
473 OSL_FAIL(
"SwXReferenceMark::addPropertyChangeListener(): not implemented");
478 const uno::Reference< beans::XPropertyChangeListener >& )
480 OSL_FAIL(
"SwXReferenceMark::removePropertyChangeListener(): not implemented");
485 const uno::Reference< beans::XVetoableChangeListener >& )
487 OSL_FAIL(
"SwXReferenceMark::addVetoableChangeListener(): not implemented");
492 const uno::Reference< beans::XVetoableChangeListener >& )
494 OSL_FAIL(
"SwXReferenceMark::removeVetoableChangeListener(): not implemented");
504 virtual void PrepareForAttach(uno::Reference< text::XTextRange > & xRange,
505 const SwPaM & rPam)
override;
507 virtual bool CheckForOwnMemberMeta(
const SwPaM & rPam,
const bool bAbsorb)
override;
511 virtual uno::Reference< text::XTextCursor >
512 CreateCursor()
override;
525 virtual uno::Sequence< sal_Int8 > SAL_CALL
526 getImplementationId()
override;
529 virtual uno::Reference< text::XTextCursor > SAL_CALL
530 createTextCursor()
override;
531 virtual uno::Reference< text::XTextCursor > SAL_CALL
532 createTextCursorByRange(
533 const uno::Reference< text::XTextRange > & xTextPosition)
override;
548 dynamic_cast<SwXText*>(m_rMeta.GetParentText().get()));
549 return pParent ? pParent->GetStartNode() :
nullptr;
552 void SwXMetaText::PrepareForAttach( uno::Reference<text::XTextRange> & xRange,
556 xRange =
static_cast<text::XWordCursor*
>(
561 bool SwXMetaText::CheckForOwnMemberMeta(
const SwPaM & rPam,
const bool bAbsorb)
563 return m_rMeta.CheckForOwnMemberMeta(rPam, bAbsorb);
566 uno::Reference< text::XTextCursor > SwXMetaText::CreateCursor()
568 uno::Reference< text::XTextCursor > xRet;
572 sal_Int32 nMetaStart;
575 m_rMeta.SetContentRange(pTextNode, nMetaStart, nMetaEnd) );
579 xRet =
static_cast<text::XWordCursor*
>(
586 uno::Sequence<sal_Int8> SAL_CALL
587 SwXMetaText::getImplementationId()
589 return css::uno::Sequence<sal_Int8>();
593 uno::Reference< text::XTextCursor > SAL_CALL
594 SwXMetaText::createTextCursor()
596 return CreateCursor();
599 uno::Reference< text::XTextCursor > SAL_CALL
600 SwXMetaText::createTextCursorByRange(
601 const uno::Reference<text::XTextRange> & xTextPosition)
603 const uno::Reference<text::XTextCursor> xCursor( CreateCursor() );
604 xCursor->gotoRange(xTextPosition,
false);
629 uno::Reference<text::XText>
const& xParentText,
630 std::unique_ptr<TextRangeList_t const> pPortions)
631 : m_EventListeners(m_Mutex)
632 , m_pTextPortions(
std::move(pPortions))
633 , m_bIsDisposed(false)
634 , m_bIsDescriptor(nullptr == pMeta)
635 , m_xParentText(xParentText)
636 , m_xText(new SwXMetaText(rDoc, rThis))
642 inline const ::sw::Meta*
GetMeta()
const;
658 m_pTextPortions.reset();
659 if(rHint.
GetId() != SfxHintId::Dying && rHint.
GetId() != SfxHintId::Deinitializing)
662 m_bIsDisposed =
true;
664 m_xText->Invalidate();
665 uno::Reference<uno::XInterface>
const xThis(m_wThis);
670 lang::EventObject
const ev(xThis);
671 m_EventListeners.disposeAndClear(ev);
680 uno::Reference<text::XText>
const& xParentText,
681 std::unique_ptr<TextRangeList_t const> pPortions)
682 :
m_pImpl( new
SwXMeta::Impl(*this, *pDoc, pMeta, xParentText,
std::move(pPortions)) )
695 uno::Reference<rdf::XMetadatable>
701 uno::Reference<rdf::XMetadatable>
const xMeta(pXMeta);
703 pXMeta->
m_pImpl->m_wThis = xMeta;
707 uno::Reference<rdf::XMetadatable>
709 uno::Reference<text::XText>
const& i_xParent,
710 std::unique_ptr<TextRangeList_t const> && pPortions)
714 uno::Reference<rdf::XMetadatable> xMeta(rMeta.
GetXMeta());
720 comphelper::getUnoTunnelImplementation<SwXMeta>(xMeta));
725 pXMeta->m_pImpl->m_pTextPortions = std::move(pPortions);
727 if (pXMeta->m_pImpl->m_xParentText.get() != i_xParent.get())
729 SAL_WARN(
"sw.uno",
"SwXMeta with different parent?");
730 pXMeta->m_pImpl->m_xParentText.set(i_xParent);
738 SAL_WARN_IF(!pTextNode,
"sw.uno",
"CreateXMeta: no text node?");
739 if (!pTextNode) {
return nullptr; }
740 uno::Reference<text::XText> xParentText(i_xParent);
741 if (!xParentText.is())
744 SAL_WARN_IF(!pTextAttr,
"sw.uno",
"CreateXMeta: no text attr?");
745 if (!pTextAttr) {
return nullptr; }
746 const SwPosition aPos(*pTextNode, pTextAttr->GetStart());
749 if (!xParentText.is()) {
return nullptr; }
752 std::move(pPortions))
754 std::move(pPortions)));
760 pXMeta->m_pImpl->m_wThis = xMeta;
765 SwTextNode *& rpNode, sal_Int32 & rStart, sal_Int32 & rEnd )
const
770 SwTextMeta const *
const pTextAttr( pMeta->GetTextAttr() );
777 rStart = pTextAttr->GetStart() + 1;
778 rEnd = *pTextAttr->End();
789 sal_Int32 nMetaStart;
791 const bool bSuccess(
SetContentRange(pTextNode, nMetaStart, nMetaEnd) );
792 OSL_ENSURE(bSuccess,
"no pam?");
794 throw lang::DisposedException();
797 if (&pStartPos->nNode.GetNode() != pTextNode)
799 throw lang::IllegalArgumentException(
800 "trying to insert into a nesting text content, but start "
801 "of text range not in same paragraph as text content",
804 bool bForceExpandHints(
false);
805 const sal_Int32 nStartPos(pStartPos->nContent.GetIndex());
808 if ((nStartPos < nMetaStart) || (nStartPos > nMetaEnd))
810 throw lang::IllegalArgumentException(
811 "trying to insert into a nesting text content, but start "
812 "of text range not inside text content",
815 else if (nStartPos == nMetaEnd)
817 bForceExpandHints =
true;
822 if (&pEndPos->nNode.GetNode() != pTextNode)
824 throw lang::IllegalArgumentException(
825 "trying to insert into a nesting text content, but end "
826 "of text range not in same paragraph as text content",
829 const sal_Int32 nEndPos(pEndPos->nContent.GetIndex());
832 if ((nEndPos < nMetaStart) || (nEndPos > nMetaEnd))
834 throw lang::IllegalArgumentException(
835 "trying to insert into a nesting text content, but end "
836 "of text range not inside text content",
839 else if (nEndPos == nMetaEnd)
841 bForceExpandHints =
true;
844 return bForceExpandHints;
849 class theSwXMetaUnoTunnelId :
public rtl::Static< UnoTunnelIdInit, theSwXMetaUnoTunnelId > {};
861 return ::sw::UnoTunnelImpl<SwXMeta>(i_rId,
this);
877 uno::Sequence< OUString > SAL_CALL
881 "com.sun.star.text.TextContent",
882 "com.sun.star.text.InContentMetadata"
889 uno::Reference< lang::XEventListener>
const & xListener )
892 m_pImpl->m_EventListeners.addInterface(xListener);
897 uno::Reference< lang::XEventListener>
const & xListener )
900 m_pImpl->m_EventListeners.removeInterface(xListener);
910 m_pImpl->m_pTextPortions.reset();
911 lang::EventObject
const ev(static_cast< ::cppu::OWeakObject&>(*
this));
912 m_pImpl->m_EventListeners.disposeAndClear(ev);
914 m_pImpl->m_xText->Invalidate();
916 else if (!
m_pImpl->m_bIsDisposed)
919 sal_Int32 nMetaStart;
922 OSL_ENSURE(bSuccess,
"no pam?");
926 SwPaM aPam( *pTextNode, nMetaStart - 1, *pTextNode, nMetaEnd );
938 const sal_uInt16 i_nWhich)
944 throw lang::DisposedException();
948 throw uno::RuntimeException(
949 "SwXMeta::attach(): already attached",
950 static_cast< ::cppu::OWeakObject* >(
this));
953 uno::Reference<lang::XUnoTunnel> xRangeTunnel(i_xTextRange, uno::UNO_QUERY);
954 if (!xRangeTunnel.is())
956 throw lang::IllegalArgumentException(
957 "SwXMeta::attach(): argument is no XUnoTunnel",
958 static_cast< ::cppu::OWeakObject* >(
this), 0);
961 ::sw::UnoTunnelGetImplementation<SwXTextRange>(xRangeTunnel));
963 ::sw::UnoTunnelGetImplementation<OTextCursorHelper>(xRangeTunnel));
964 if (!pRange && !pCursor)
966 throw lang::IllegalArgumentException(
967 "SwXMeta::attach(): argument not supported type",
968 static_cast< ::cppu::OWeakObject* >(
this), 0);
975 throw lang::IllegalArgumentException(
976 "SwXMeta::attach(): argument has no SwDoc",
977 static_cast< ::cppu::OWeakObject* >(
this), 0);
986 dynamic_cast<SwXTextCursor*>(pCursor));
987 const bool bForceExpandHints(pTextCursor && pTextCursor->
IsAtEndOfMeta());
993 const std::shared_ptr< ::sw::Meta> pMeta( (
RES_TXTATR_META == i_nWhich)
994 ? std::make_shared< ::sw::Meta>(
nullptr )
995 : std::shared_ptr< ::sw::Meta>(
996 pDoc->GetMetaFieldManager().makeMetaField()) );
998 const bool bSuccess( pDoc->getIDocumentContentOperations().InsertPoolItem( aPam, meta, nInsertFlags ) );
999 SwTextAttr *
const pTextAttr( pMeta->GetTextAttr() );
1002 throw lang::IllegalArgumentException(
1003 "SwXMeta::attach(): cannot create meta: range invalid?",
1004 static_cast< ::cppu::OWeakObject* >(
this), 1);
1008 OSL_FAIL(
"meta inserted, but has no text attribute?");
1009 throw uno::RuntimeException(
1010 "SwXMeta::attach(): cannot create meta",
1011 static_cast< ::cppu::OWeakObject* >(
this));
1015 m_pImpl->m_pMeta = pMeta.get();
1016 m_pImpl->StartListening(pMeta->GetNotifier());
1017 pMeta->SetXMeta(uno::Reference<rdf::XMetadatable>(
this));
1021 m_pImpl->m_bIsDescriptor =
false;
1031 uno::Reference< text::XTextRange > SAL_CALL
1038 throw lang::DisposedException();
1042 throw uno::RuntimeException(
1043 "SwXMeta::getAnchor(): not inserted",
1044 static_cast< ::cppu::OWeakObject* >(
this));
1048 sal_Int32 nMetaStart;
1050 const bool bSuccess(
SetContentRange(pTextNode, nMetaStart, nMetaEnd));
1051 OSL_ENSURE(bSuccess,
"no pam?");
1054 throw lang::DisposedException(
1055 "SwXMeta::getAnchor(): not attached",
1056 static_cast< ::cppu::OWeakObject* >(
this));
1059 const SwPosition start(*pTextNode, nMetaStart - 1);
1065 uno::Reference< text::XText > SAL_CALL
1071 uno::Reference< text::XTextRange > SAL_CALL
1075 return m_pImpl->m_xText->getStart();
1078 uno::Reference< text::XTextRange > SAL_CALL
1082 return m_pImpl->m_xText->getEnd();
1089 return m_pImpl->m_xText->getString();
1096 return m_pImpl->m_xText->setString(rString);
1100 uno::Reference< text::XTextCursor > SAL_CALL
1104 return m_pImpl->m_xText->createTextCursor();
1107 uno::Reference< text::XTextCursor > SAL_CALL
1109 const uno::Reference<text::XTextRange> & xTextPosition)
1112 return m_pImpl->m_xText->createTextCursorByRange(xTextPosition);
1117 const OUString& rString,
sal_Bool bAbsorb)
1120 return m_pImpl->m_xText->insertString(xRange, rString, bAbsorb);
1125 sal_Int16 nControlCharacter,
sal_Bool bAbsorb)
1128 return m_pImpl->m_xText->insertControlCharacter(xRange, nControlCharacter,
1135 const uno::Reference<text::XTextContent> & xContent,
sal_Bool bAbsorb)
1138 return m_pImpl->m_xText->insertTextContent(xRange, xContent, bAbsorb);
1143 const uno::Reference< text::XTextContent > & xContent)
1146 return m_pImpl->m_xText->removeTextContent(xContent);
1150 uno::Reference< uno::XInterface > SAL_CALL
1155 sal_Int32 nMetaStart;
1157 bool const bSuccess(
SetContentRange(pTextNode, nMetaStart, nMetaEnd) );
1158 OSL_ENSURE(bSuccess,
"no pam?");
1159 if (!bSuccess) {
throw lang::DisposedException(); }
1163 uno::Reference<text::XTextContent>
const xRet(
1172 throw lang::NoSupportException(
"setting parent not supported", *
this);
1185 return m_pImpl->m_pMeta !=
nullptr;
1189 uno::Reference< container::XEnumeration > SAL_CALL
1196 throw lang::DisposedException();
1200 throw uno::RuntimeException(
1201 "createEnumeration(): not inserted",
1202 static_cast< ::cppu::OWeakObject* >(
this));
1206 sal_Int32 nMetaStart;
1208 const bool bSuccess(
SetContentRange(pTextNode, nMetaStart, nMetaEnd));
1209 OSL_ENSURE(bSuccess,
"no pam?");
1211 throw lang::DisposedException();
1213 SwPaM aPam(*pTextNode, nMetaStart);
1215 if (!
m_pImpl->m_pTextPortions)
1237 SwTextNode const *
const pTextNode( pMeta->GetTextNode() );
1241 return pShell ? pShell->
GetModel() :
nullptr;
1253 uno::Reference<text::XText>
const& xParentText,
1254 std::unique_ptr<TextRangeList_t const> pPortions)
1257 OSL_ENSURE(dynamic_cast< ::sw::MetaField* >(pMeta),
1258 "SwXMetaField created for wrong hint!");
1274 return "SwXMetaField";
1283 uno::Sequence< OUString > SAL_CALL
1287 "com.sun.star.text.TextContent",
1288 "com.sun.star.text.TextField",
1289 "com.sun.star.text.textfield.MetadataField"
1296 uno::Reference< lang::XEventListener>
const & xListener )
1303 uno::Reference< lang::XEventListener>
const & xListener )
1321 uno::Reference< text::XTextRange > SAL_CALL
1328 uno::Reference< beans::XPropertySetInfo > SAL_CALL
1333 static uno::Reference< beans::XPropertySetInfo > xRef(
1341 const OUString& rPropertyName,
const uno::Any& rValue)
1346 const_cast< ::sw::MetaField * >(
m_pImpl->GetMetaField()) );
1348 throw lang::DisposedException();
1350 if ( rPropertyName ==
"NumberFormat" )
1352 sal_Int32 nNumberFormat(0);
1353 if (rValue >>= nNumberFormat)
1358 else if ( rPropertyName ==
"IsFixedLanguage" )
1368 throw beans::UnknownPropertyException(rPropertyName);
1379 throw lang::DisposedException();
1383 if ( rPropertyName ==
"NumberFormat" )
1386 any <<= static_cast<sal_Int32>(pMeta->GetNumberFormat(text));
1388 else if ( rPropertyName ==
"IsFixedLanguage" )
1390 any <<= pMeta->IsFixedLanguage();
1394 throw beans::UnknownPropertyException(rPropertyName);
1403 const uno::Reference< beans::XPropertyChangeListener >& )
1405 OSL_FAIL(
"SwXMetaField::addPropertyChangeListener(): not implemented");
1411 const uno::Reference< beans::XPropertyChangeListener >& )
1413 OSL_FAIL(
"SwXMetaField::removePropertyChangeListener(): not implemented");
1419 const uno::Reference< beans::XVetoableChangeListener >& )
1421 OSL_FAIL(
"SwXMetaField::addVetoableChangeListener(): not implemented");
1427 const uno::Reference< beans::XVetoableChangeListener >& )
1429 OSL_FAIL(
"SwXMetaField::removeVetoableChangeListener(): not implemented");
1432 static uno::Reference<rdf::XURI>
const&
1435 static uno::Reference< uno::XComponentContext > xContext(
1437 static uno::Reference< rdf::XURI > xOdfPrefix(
1438 rdf::URI::createKnown(xContext, rdf::URIs::ODF_PREFIX),
1439 uno::UNO_SET_THROW);
1440 static uno::Reference< rdf::XURI > xOdfSuffix(
1441 rdf::URI::createKnown(xContext, rdf::URIs::ODF_SUFFIX),
1442 uno::UNO_SET_THROW);
1443 return bPrefix ? xOdfPrefix : xOdfSuffix;
1448 uno::Reference<rdf::XRepository>
const & xRepository,
1449 uno::Reference<rdf::XResource>
const & xMetaField,
1450 uno::Reference<rdf::XURI>
const & xPredicate)
1452 const uno::Reference<container::XEnumeration> xEnum(
1453 xRepository->getStatements(xMetaField, xPredicate,
nullptr),
1454 uno::UNO_SET_THROW);
1455 while (xEnum->hasMoreElements()) {
1456 rdf::Statement stmt;
1457 if (!(xEnum->nextElement() >>= stmt)) {
1458 throw uno::RuntimeException();
1460 const uno::Reference<rdf::XLiteral> xObject(stmt.Object,
1462 if (!xObject.is())
continue;
1463 if (xEnum->hasMoreElements()) {
1464 SAL_INFO(
"sw.uno",
"ignoring other odf:Prefix/odf:Suffix statements");
1466 return xObject->getValue();
1473 const uno::Reference<frame::XModel>& xModel,
1474 const uno::Reference<rdf::XMetadatable>& xMetaField,
1475 OUString *
const o_pPrefix, OUString *
const o_pSuffix)
1478 const uno::Reference<rdf::XRepositorySupplier> xRS(
1479 xModel, uno::UNO_QUERY_THROW);
1480 const uno::Reference<rdf::XRepository> xRepo(
1481 xRS->getRDFRepository(), uno::UNO_SET_THROW);
1482 const uno::Reference<rdf::XResource> xMeta(
1483 xMetaField, uno::UNO_QUERY_THROW);
1492 }
catch (uno::RuntimeException &) {
1494 }
catch (
const uno::Exception &) {
1496 throw lang::WrappedTargetRuntimeException(
"getPrefixAndSuffix: exception",
nullptr, anyEx);
1518 return prefix + content + suffix;
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
Starts a section of nodes in the document model.
static uno::Reference< rdf::XURI > const & lcl_getURI(const bool bPrefix)
Impl(SwDoc *const pDoc, SwFormatRefMark *const pRefMark)
SwNode & GetNode(bool bPoint=true) const
virtual const SwDoc * GetDoc() const =0
Marks a position in the document model.
::comphelper::OInterfaceContainerHelper2 m_EventListeners
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &xListener) override
constexpr TypedWhichId< SwFormatMeta > RES_TXTATR_METAFIELD(49)
virtual void SAL_CALL addPropertyChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
SwDocShell * GetDocShell()
constexpr TypedWhichId< SwFormatMeta > RES_TXTATR_META(48)
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getAnchor() override
void InsertRefMark(SwPaM &rPam, SwXTextCursor const *const pCursor)
const SwPosition * GetMark() const
const SfxItemPropertySet * GetPropertySet(sal_uInt16 PropertyId)
void disposeAndClear(const css::lang::EventObject &rEvt)
bool IsAtEndOfMeta() const
virtual void SAL_CALL removePropertyChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
css::uno::Reference< css::frame::XModel > GetModel() const
virtual bool DeleteAndJoin(SwPaM &, const bool bForceJoinNext=false)=0
complete delete of a given PaM
IDocumentContentOperations const & getIDocumentContentOperations() const
const SwFormatRefMark & GetRefMark() const
css::uno::Reference< css::beans::XPropertySetInfo > const & getPropertySetInfo() const
#define PROPERTY_MAP_METAFIELD
SwTextAttr * GetTextAttrForCharAt(const sal_Int32 nIndex, const sal_uInt16 nWhich=RES_TXTATR_END) const
get the text attribute at position nIndex which owns the dummy character CH_TXTATR_* at that position...
static OUString lcl_getPrefixOrSuffix(uno::Reference< rdf::XRepository > const &xRepository, uno::Reference< rdf::XResource > const &xMetaField, uno::Reference< rdf::XURI > const &xPredicate)
SwXReferenceMark(SwDoc *const pDoc, SwFormatRefMark *const pMark)
const SwTextNode & GetTextNode() const
virtual void SAL_CALL acquire() SAL_OVERRIDE
virtual void SAL_CALL addVetoableChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &xListener) override
Any SAL_CALL getCaughtException()
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
virtual OUString SAL_CALL getImplementationName() override
sal_Int32 GetStart() const
virtual ~SwXReferenceMark() override
virtual void Notify(const SfxHint &) override
virtual void SAL_CALL dispose() override
exports com.sun.star. text
virtual sal_Bool SAL_CALL supportsService(const OUString &rServiceName) override
PaM is Point and Mark: a selection of the document model.
virtual void SAL_CALL setName(const OUString &rName) override
bool GetDefaultTextContentValue(css::uno::Any &rAny, std::u16string_view rPropertyName, sal_uInt16 nWID=0)
static SwNodePtr GetStartNode(SwOutlineNodes const *pOutlNds, int nOutlineLevel, SwOutlineNodes::size_type *nOutl)
virtual void SAL_CALL removeVetoableChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &xListener) override
const SwFormatRefMark * m_pMarkFormat
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > &xListener) override
const SwPosition * GetPoint() const
virtual void SAL_CALL attach(const css::uno::Reference< css::text::XTextRange > &xTextRange) override
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
uno::WeakReference< uno::XInterface > m_wThis
Force hint expand (only matters for hints with CH_TXTATR).
css::uno::Type const & get()
SwNodes & GetNodes()
Node is in which nodes-array/doc?
bool StartListening(SvtBroadcaster &rBroadcaster)
static css::uno::Reference< css::text::XTextContent > CreateXReferenceMark(SwDoc &rDoc, SwFormatRefMark *pMarkFormat)
virtual OUString SAL_CALL getName() override
enumrange< T >::Iterator end(enumrange< T >)
const SwPosition * Start() const
bool XTextRangeToSwPaM(SwUnoInternalPaM &rToFill, const uno::Reference< text::XTextRange > &xTextRange,::sw::TextRangeMode const eMode)
SvtBroadcaster & GetNotifier()
uno::Reference< text::XTextContent > GetNestedTextContent(SwTextNode const &rTextNode, sal_Int32 const nIndex, bool const bParent)
SwTextNode is a paragraph in the document model.
void getPrefixAndSuffix(const uno::Reference< frame::XModel > &xModel, const uno::Reference< rdf::XMetadatable > &xMetaField, OUString *const o_pPrefix, OUString *const o_pSuffix)
#define SAL_WARN_IF(condition, area, stream)
virtual bool InsertPoolItem(const SwPaM &rRg, const SfxPoolItem &, const SetAttrMode nFlags=SetAttrMode::DEFAULT, SwRootFrame const *pLayout=nullptr, bool bExpandCharToPara=false, SwTextAttr **ppNewTextAttr=nullptr)=0
Insert an attribute.
#define SAL_INFO(area, stream)
sal_Int32 GetIndex() const
const SwPosition * End() const
virtual sal_Int64 SAL_CALL getSomething(const css::uno::Sequence< sal_Int8 > &rIdentifier) override
const sal_Int32 * End() const
Reference< XComponentContext > getProcessComponentContext()
SwUnoPropertyMapProvider aSwMapProvider
virtual void SAL_CALL release() SAL_OVERRIDE
exports com.sun.star.report. meta
std::vector< SwTextAttr * > GetTextAttrsAt(sal_Int32 const nIndex, sal_uInt16 const nWhich) const
get the innermost text attributes covering position nIndex.
#define PROPERTY_MAP_PARAGRAPH_EXTENSIONS
#define SAL_WARN(area, stream)
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &rPropertyName) override
constexpr TypedWhichId< SwFormatRefMark > RES_TXTATR_REFMARK(RES_TXTATR_WITHEND_BEGIN)
OUString getString(const Any &_rAny)
virtual void SAL_CALL setPropertyValue(const OUString &rPropertyName, const css::uno::Any &rValue) override
::sw::UnoImplPtr< Impl > m_pImpl
uno::Reference< text::XText > CreateParentXText(SwDoc &rDoc, const SwPosition &rPos)
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId()
SwTextNode * GetTextNode()
Inline methods from Node.hxx.