44 #include <unotext.hxx>
50 #include <com/sun/star/frame/XModel.hpp>
51 #include <com/sun/star/lang/NoSupportException.hpp>
52 #include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
53 #include <com/sun/star/rdf/Statement.hpp>
54 #include <com/sun/star/rdf/URI.hpp>
55 #include <com/sun/star/rdf/URIs.hpp>
56 #include <com/sun/star/rdf/XLiteral.hpp>
57 #include <com/sun/star/rdf/XRepositorySupplier.hpp>
58 #include <com/sun/star/lang/DisposedException.hpp>
66 uno::WeakReference<uno::XInterface>
m_wThis;
75 : m_bIsDescriptor(nullptr == pRefMark)
77 , m_pMarkFormat(pRefMark)
99 uno::Reference<uno::XInterface>
const xThis(
m_wThis);
104 lang::EventObject
const ev(xThis);
105 std::unique_lock aGuard(
m_Mutex);
111 if(rHint.
GetId() == SfxHintId::Dying)
125 uno::Reference<text::XTextContent>
130 uno::Reference<text::XTextContent> xMark;
144 pMark->m_pImpl->m_wThis = xMark;
152 return theSwXReferenceMarkUnoTunnelId.
getSeq();
158 return comphelper::getSomethingImpl<SwXReferenceMark>(rId,
this);
163 return "SwXReferenceMark";
172 uno::Sequence< OUString > SAL_CALL
176 "com.sun.star.text.TextContent",
177 "com.sun.star.text.ReferenceMark"
183 template<
typename T>
struct NotContainedIn
185 std::vector<T>
const& m_rVector;
186 explicit NotContainedIn(std::vector<T>
const& rVector)
187 : m_rVector(rVector) { }
188 bool operator() (T
const& rT) {
189 return std::find(m_rVector.begin(), m_rVector.end(), rT)
208 const bool bForceExpandHints( !bMark && pCursor && pCursor->
IsAtEndOfMeta() );
214 std::vector<SwTextAttr *> oldMarks;
234 std::vector<SwTextAttr *>
const newMarks(
237 std::vector<SwTextAttr *>::const_iterator
const iter(
238 std::find_if(newMarks.begin(), newMarks.end(),
239 NotContainedIn<SwTextAttr *>(oldMarks)));
240 assert(newMarks.end() != iter);
241 if (newMarks.end() != iter)
256 throw uno::RuntimeException(
257 "SwXReferenceMark::InsertRefMark(): cannot insert attribute",
nullptr);
272 throw uno::RuntimeException();
274 uno::Reference<lang::XUnoTunnel> xRangeTunnel( xTextRange, uno::UNO_QUERY);
275 SwXTextRange* pRange = comphelper::getFromUnoTunnel<SwXTextRange>(xRangeTunnel);
276 OTextCursorHelper* pCursor = comphelper::getFromUnoTunnel<OTextCursorHelper>(xRangeTunnel);
277 SwDoc *
const pDocument =
278 pRange ? &pRange->
GetDoc() : (pCursor ? pCursor->GetDoc() :
nullptr);
281 throw lang::IllegalArgumentException();
287 m_pImpl->InsertRefMark(aPam, dynamic_cast<SwXTextCursor*>(pCursor));
288 m_pImpl->m_bIsDescriptor =
false;
292 uno::Reference< text::XTextRange > SAL_CALL
301 if (pNewMark && (pNewMark ==
m_pImpl->m_pMarkFormat))
304 m_pImpl->m_pMarkFormat->GetTextRefMark();
310 std::optional<SwPaM> pPam;
311 if ( pTextMark->
End() )
312 pPam.emplace( rTextNode, *pTextMark->
End(),
315 pPam.emplace( rTextNode, pTextMark->
GetStart());
318 *
m_pImpl->m_pDoc, *pPam->Start(), pPam->End());
332 if (pNewMark && (pNewMark ==
m_pImpl->m_pMarkFormat))
335 m_pImpl->m_pMarkFormat->GetTextRefMark();
341 const sal_Int32 nStt = pTextMark->
GetStart();
342 const sal_Int32 nEnd = pTextMark->
End()
346 SwPaM aPam( rTextNode, nStt, rTextNode, nEnd );
347 m_pImpl->m_pDoc->getIDocumentContentOperations().DeleteAndJoin( aPam );
351 else if (
m_pImpl->m_bIsDescriptor)
358 const uno::Reference< lang::XEventListener > & xListener)
361 std::unique_lock aGuard(
m_pImpl->m_Mutex);
362 m_pImpl->m_EventListeners.addInterface(aGuard, xListener);
366 const uno::Reference< lang::XEventListener > & xListener)
369 std::unique_lock aGuard(
m_pImpl->m_Mutex);
370 m_pImpl->m_EventListeners.removeInterface(aGuard, xListener);
379 throw uno::RuntimeException();
395 ||
m_pImpl->m_pDoc->GetRefMark(rName))
397 throw uno::RuntimeException();
401 if ((rName !=
m_pImpl->m_sMarkName)
402 && pCurMark && (pCurMark ==
m_pImpl->m_pMarkFormat))
406 m_pImpl->m_pMarkFormat->GetTextRefMark();
412 const sal_Int32 nStt = pTextMark->
GetStart();
413 const sal_Int32 nEnd = pTextMark->
End()
417 SwPaM aPam( rTextNode, nStt, rTextNode, nEnd );
419 m_pImpl->m_pDoc->getIDocumentContentOperations().DeleteAndJoin( aPam );
424 m_pImpl->InsertRefMark( aPam,
nullptr );
431 uno::Reference< beans::XPropertySetInfo > SAL_CALL
436 static uno::Reference< beans::XPropertySetInfo > xRef =
445 throw lang::IllegalArgumentException();
455 throw beans::UnknownPropertyException(rPropertyName);
462 const uno::Reference< beans::XPropertyChangeListener >& )
464 OSL_FAIL(
"SwXReferenceMark::addPropertyChangeListener(): not implemented");
469 const uno::Reference< beans::XPropertyChangeListener >& )
471 OSL_FAIL(
"SwXReferenceMark::removePropertyChangeListener(): not implemented");
476 const uno::Reference< beans::XVetoableChangeListener >& )
478 OSL_FAIL(
"SwXReferenceMark::addVetoableChangeListener(): not implemented");
483 const uno::Reference< beans::XVetoableChangeListener >& )
485 OSL_FAIL(
"SwXReferenceMark::removeVetoableChangeListener(): not implemented");
495 virtual void PrepareForAttach(uno::Reference< text::XTextRange > & xRange,
496 const SwPaM & rPam)
override;
498 virtual bool CheckForOwnMemberMeta(
const SwPaM & rPam,
const bool bAbsorb)
override;
502 virtual uno::Reference< text::XTextCursor >
503 CreateCursor()
override;
516 virtual uno::Sequence< sal_Int8 > SAL_CALL
517 getImplementationId()
override;
520 virtual uno::Reference< text::XTextCursor > SAL_CALL
521 createTextCursor()
override;
522 virtual uno::Reference< text::XTextCursor > SAL_CALL
523 createTextCursorByRange(
524 const uno::Reference< text::XTextRange > & xTextPosition)
override;
539 dynamic_cast<SwXText*>(m_rMeta.GetParentText().get()));
540 return pParent ? pParent->GetStartNode() :
nullptr;
543 void SwXMetaText::PrepareForAttach( uno::Reference<text::XTextRange> & xRange,
547 xRange =
static_cast<text::XWordCursor*
>(
552 bool SwXMetaText::CheckForOwnMemberMeta(
const SwPaM & rPam,
const bool bAbsorb)
554 return m_rMeta.CheckForOwnMemberMeta(rPam, bAbsorb);
557 uno::Reference< text::XTextCursor > SwXMetaText::CreateCursor()
559 uno::Reference< text::XTextCursor > xRet;
563 sal_Int32 nMetaStart;
566 m_rMeta.SetContentRange(pTextNode, nMetaStart, nMetaEnd) );
570 xRet =
static_cast<text::XWordCursor*
>(
577 uno::Sequence<sal_Int8> SAL_CALL
578 SwXMetaText::getImplementationId()
580 return css::uno::Sequence<sal_Int8>();
584 uno::Reference< text::XTextCursor > SAL_CALL
585 SwXMetaText::createTextCursor()
587 return CreateCursor();
590 uno::Reference< text::XTextCursor > SAL_CALL
591 SwXMetaText::createTextCursorByRange(
592 const uno::Reference<text::XTextRange> & xTextPosition)
594 const uno::Reference<text::XTextCursor> xCursor( CreateCursor() );
595 xCursor->gotoRange(xTextPosition,
false);
622 uno::Reference<text::XText>
const& xParentText,
623 std::unique_ptr<TextRangeList_t const> pPortions)
624 : m_pTextPortions(
std::move(pPortions))
625 , m_bIsDisposed(
false)
626 , m_bIsDescriptor(nullptr == pMeta)
627 , m_xParentText(xParentText)
628 , m_xText(new SwXMetaText(rDoc, rThis))
634 inline const ::sw::Meta*
GetMeta()
const;
650 m_pTextPortions.reset();
651 if(rHint.
GetId() != SfxHintId::Dying && rHint.
GetId() != SfxHintId::Deinitializing)
654 m_bIsDisposed =
true;
656 m_xText->Invalidate();
657 uno::Reference<uno::XInterface>
const xThis(m_wThis);
662 lang::EventObject
const ev(xThis);
663 std::unique_lock aGuard(m_Mutex);
664 m_EventListeners.disposeAndClear(aGuard, ev);
673 uno::Reference<text::XText>
const& xParentText,
674 std::unique_ptr<TextRangeList_t const> pPortions)
675 :
m_pImpl( new
SwXMeta::Impl(*this, *pDoc, pMeta, xParentText,
std::move(pPortions)) )
688 uno::Reference<rdf::XMetadatable>
694 uno::Reference<rdf::XMetadatable>
const xMeta(pXMeta);
696 pXMeta->
m_pImpl->m_wThis = xMeta;
700 uno::Reference<rdf::XMetadatable>
702 uno::Reference<text::XText>
const& i_xParent,
703 std::unique_ptr<TextRangeList_t const> && pPortions)
707 uno::Reference<rdf::XMetadatable> xMeta(rMeta.
GetXMeta());
713 comphelper::getFromUnoTunnel<SwXMeta>(xMeta));
718 pXMeta->m_pImpl->m_pTextPortions = std::move(pPortions);
720 if (pXMeta->m_pImpl->m_xParentText.get() != i_xParent.get())
722 SAL_WARN(
"sw.uno",
"SwXMeta with different parent?");
723 pXMeta->m_pImpl->m_xParentText.set(i_xParent);
731 SAL_WARN_IF(!pTextNode,
"sw.uno",
"CreateXMeta: no text node?");
732 if (!pTextNode) {
return nullptr; }
733 uno::Reference<text::XText> xParentText(i_xParent);
734 if (!xParentText.is())
737 SAL_WARN_IF(!pTextAttr,
"sw.uno",
"CreateXMeta: no text attr?");
738 if (!pTextAttr) {
return nullptr; }
739 const SwPosition aPos(*pTextNode, pTextAttr->GetStart());
742 if (!xParentText.is()) {
return nullptr; }
745 std::move(pPortions))
747 std::move(pPortions)));
753 pXMeta->m_pImpl->m_wThis = xMeta;
758 SwTextNode *& rpNode, sal_Int32 & rStart, sal_Int32 & rEnd )
const
763 SwTextMeta const *
const pTextAttr( pMeta->GetTextAttr() );
770 rStart = pTextAttr->GetStart() + 1;
771 rEnd = *pTextAttr->End();
782 sal_Int32 nMetaStart;
784 const bool bSuccess(
SetContentRange(pTextNode, nMetaStart, nMetaEnd) );
785 OSL_ENSURE(bSuccess,
"no pam?");
787 throw lang::DisposedException();
790 if (&pStartPos->nNode.GetNode() != pTextNode)
792 throw lang::IllegalArgumentException(
793 "trying to insert into a nesting text content, but start "
794 "of text range not in same paragraph as text content",
797 bool bForceExpandHints(
false);
798 const sal_Int32 nStartPos(pStartPos->nContent.GetIndex());
801 if ((nStartPos < nMetaStart) || (nStartPos > nMetaEnd))
803 throw lang::IllegalArgumentException(
804 "trying to insert into a nesting text content, but start "
805 "of text range not inside text content",
808 else if (nStartPos == nMetaEnd)
810 bForceExpandHints =
true;
815 if (&pEndPos->nNode.GetNode() != pTextNode)
817 throw lang::IllegalArgumentException(
818 "trying to insert into a nesting text content, but end "
819 "of text range not in same paragraph as text content",
822 const sal_Int32 nEndPos(pEndPos->nContent.GetIndex());
825 if ((nEndPos < nMetaStart) || (nEndPos > nMetaEnd))
827 throw lang::IllegalArgumentException(
828 "trying to insert into a nesting text content, but end "
829 "of text range not inside text content",
832 else if (nEndPos == nMetaEnd)
834 bForceExpandHints =
true;
837 return bForceExpandHints;
843 return theSwXMetaUnoTunnelId.
getSeq();
850 return comphelper::getSomethingImpl<SwXMeta>(i_rId,
this);
866 uno::Sequence< OUString > SAL_CALL
870 "com.sun.star.text.TextContent",
871 "com.sun.star.text.InContentMetadata"
878 uno::Reference< lang::XEventListener>
const & xListener )
881 std::unique_lock aGuard(
m_pImpl->m_Mutex);
882 m_pImpl->m_EventListeners.addInterface(aGuard, xListener);
887 uno::Reference< lang::XEventListener>
const & xListener )
890 std::unique_lock aGuard(
m_pImpl->m_Mutex);
891 m_pImpl->m_EventListeners.removeInterface(aGuard, xListener);
901 m_pImpl->m_pTextPortions.reset();
902 lang::EventObject
const ev(static_cast< ::cppu::OWeakObject&>(*
this));
903 std::unique_lock aGuard(
m_pImpl->m_Mutex);
904 m_pImpl->m_EventListeners.disposeAndClear(aGuard, ev);
906 m_pImpl->m_xText->Invalidate();
908 else if (!
m_pImpl->m_bIsDisposed)
911 sal_Int32 nMetaStart;
914 OSL_ENSURE(bSuccess,
"no pam?");
918 SwPaM aPam( *pTextNode, nMetaStart - 1, *pTextNode, nMetaEnd );
923 assert(
m_pImpl->m_bIsDisposed);
930 const sal_uInt16 i_nWhich)
936 throw lang::DisposedException();
940 throw uno::RuntimeException(
941 "SwXMeta::attach(): already attached",
942 static_cast< ::cppu::OWeakObject* >(
this));
945 uno::Reference<lang::XUnoTunnel> xRangeTunnel(i_xTextRange, uno::UNO_QUERY);
946 if (!xRangeTunnel.is())
948 throw lang::IllegalArgumentException(
949 "SwXMeta::attach(): argument is no XUnoTunnel",
950 static_cast< ::cppu::OWeakObject* >(
this), 0);
953 comphelper::getFromUnoTunnel<SwXTextRange>(xRangeTunnel));
955 comphelper::getFromUnoTunnel<OTextCursorHelper>(xRangeTunnel));
956 if (!pRange && !pCursor)
958 throw lang::IllegalArgumentException(
959 "SwXMeta::attach(): argument not supported type",
960 static_cast< ::cppu::OWeakObject* >(
this), 0);
967 throw lang::IllegalArgumentException(
968 "SwXMeta::attach(): argument has no SwDoc",
969 static_cast< ::cppu::OWeakObject* >(
this), 0);
978 dynamic_cast<SwXTextCursor*>(pCursor));
979 const bool bForceExpandHints(pTextCursor && pTextCursor->
IsAtEndOfMeta());
985 const std::shared_ptr< ::sw::Meta> pMeta( (
RES_TXTATR_META == i_nWhich)
986 ? std::make_shared< ::sw::Meta>(
nullptr )
987 : std::shared_ptr< ::sw::Meta>(
988 pDoc->GetMetaFieldManager().makeMetaField()) );
990 const bool bSuccess( pDoc->getIDocumentContentOperations().InsertPoolItem( aPam, meta, nInsertFlags ) );
991 SwTextAttr *
const pTextAttr( pMeta->GetTextAttr() );
994 throw lang::IllegalArgumentException(
995 "SwXMeta::attach(): cannot create meta: range invalid?",
996 static_cast< ::cppu::OWeakObject* >(
this), 1);
1000 OSL_FAIL(
"meta inserted, but has no text attribute?");
1001 throw uno::RuntimeException(
1002 "SwXMeta::attach(): cannot create meta",
1003 static_cast< ::cppu::OWeakObject* >(
this));
1007 m_pImpl->m_pMeta = pMeta.get();
1008 m_pImpl->StartListening(pMeta->GetNotifier());
1009 pMeta->SetXMeta(uno::Reference<rdf::XMetadatable>(
this));
1013 m_pImpl->m_bIsDescriptor =
false;
1023 uno::Reference< text::XTextRange > SAL_CALL
1030 throw lang::DisposedException();
1034 throw uno::RuntimeException(
1035 "SwXMeta::getAnchor(): not inserted",
1036 static_cast< ::cppu::OWeakObject* >(
this));
1040 sal_Int32 nMetaStart;
1042 const bool bSuccess(
SetContentRange(pTextNode, nMetaStart, nMetaEnd));
1043 OSL_ENSURE(bSuccess,
"no pam?");
1046 throw lang::DisposedException(
1047 "SwXMeta::getAnchor(): not attached",
1048 static_cast< ::cppu::OWeakObject* >(
this));
1057 uno::Reference< text::XText > SAL_CALL
1063 uno::Reference< text::XTextRange > SAL_CALL
1067 return m_pImpl->m_xText->getStart();
1070 uno::Reference< text::XTextRange > SAL_CALL
1074 return m_pImpl->m_xText->getEnd();
1081 return m_pImpl->m_xText->getString();
1088 return m_pImpl->m_xText->setString(rString);
1092 uno::Reference< text::XTextCursor > SAL_CALL
1096 return m_pImpl->m_xText->createTextCursor();
1099 uno::Reference< text::XTextCursor > SAL_CALL
1101 const uno::Reference<text::XTextRange> & xTextPosition)
1104 return m_pImpl->m_xText->createTextCursorByRange(xTextPosition);
1109 const OUString& rString,
sal_Bool bAbsorb)
1112 return m_pImpl->m_xText->insertString(xRange, rString, bAbsorb);
1117 sal_Int16 nControlCharacter,
sal_Bool bAbsorb)
1120 return m_pImpl->m_xText->insertControlCharacter(xRange, nControlCharacter,
1127 const uno::Reference<text::XTextContent> & xContent,
sal_Bool bAbsorb)
1130 return m_pImpl->m_xText->insertTextContent(xRange, xContent, bAbsorb);
1135 const uno::Reference< text::XTextContent > & xContent)
1138 return m_pImpl->m_xText->removeTextContent(xContent);
1142 uno::Reference< uno::XInterface > SAL_CALL
1147 sal_Int32 nMetaStart;
1149 bool const bSuccess(
SetContentRange(pTextNode, nMetaStart, nMetaEnd) );
1150 OSL_ENSURE(bSuccess,
"no pam?");
1151 if (!bSuccess) {
throw lang::DisposedException(); }
1155 uno::Reference<text::XTextContent>
const xRet(
1164 throw lang::NoSupportException(
"setting parent not supported", *
this);
1177 return m_pImpl->m_pMeta !=
nullptr;
1181 uno::Reference< container::XEnumeration > SAL_CALL
1188 throw lang::DisposedException();
1192 throw uno::RuntimeException(
1193 "createEnumeration(): not inserted",
1194 static_cast< ::cppu::OWeakObject* >(
this));
1198 sal_Int32 nMetaStart;
1200 const bool bSuccess(
SetContentRange(pTextNode, nMetaStart, nMetaEnd));
1201 OSL_ENSURE(bSuccess,
"no pam?");
1203 throw lang::DisposedException();
1205 SwPaM aPam(*pTextNode, nMetaStart);
1207 if (!
m_pImpl->m_pTextPortions)
1229 SwTextNode const *
const pTextNode( pMeta->GetTextNode() );
1233 return pShell ? pShell->
GetModel() :
nullptr;
1245 uno::Reference<text::XText>
const& xParentText,
1246 std::unique_ptr<TextRangeList_t const> pPortions)
1249 assert(dynamic_cast< ::sw::MetaField* >(pMeta) &&
"SwXMetaField created for wrong hint!");
1265 return "SwXMetaField";
1274 uno::Sequence< OUString > SAL_CALL
1278 "com.sun.star.text.TextContent",
1279 "com.sun.star.text.TextField",
1280 "com.sun.star.text.textfield.MetadataField"
1287 uno::Reference< lang::XEventListener>
const & xListener )
1294 uno::Reference< lang::XEventListener>
const & xListener )
1312 uno::Reference< text::XTextRange > SAL_CALL
1319 uno::Reference< beans::XPropertySetInfo > SAL_CALL
1324 static uno::Reference< beans::XPropertySetInfo > xRef(
1332 const OUString& rPropertyName,
const uno::Any& rValue)
1337 const_cast< ::sw::MetaField * >(
m_pImpl->GetMetaField()) );
1339 throw lang::DisposedException();
1341 if ( rPropertyName ==
"NumberFormat" )
1343 sal_Int32 nNumberFormat(0);
1344 if (rValue >>= nNumberFormat)
1349 else if ( rPropertyName ==
"IsFixedLanguage" )
1359 throw beans::UnknownPropertyException(rPropertyName);
1370 throw lang::DisposedException();
1374 if ( rPropertyName ==
"NumberFormat" )
1377 any <<= static_cast<sal_Int32>(pMeta->GetNumberFormat(text));
1379 else if ( rPropertyName ==
"IsFixedLanguage" )
1381 any <<= pMeta->IsFixedLanguage();
1385 throw beans::UnknownPropertyException(rPropertyName);
1394 const uno::Reference< beans::XPropertyChangeListener >& )
1396 OSL_FAIL(
"SwXMetaField::addPropertyChangeListener(): not implemented");
1402 const uno::Reference< beans::XPropertyChangeListener >& )
1404 OSL_FAIL(
"SwXMetaField::removePropertyChangeListener(): not implemented");
1410 const uno::Reference< beans::XVetoableChangeListener >& )
1412 OSL_FAIL(
"SwXMetaField::addVetoableChangeListener(): not implemented");
1418 const uno::Reference< beans::XVetoableChangeListener >& )
1420 OSL_FAIL(
"SwXMetaField::removeVetoableChangeListener(): not implemented");
1423 static uno::Reference<rdf::XURI>
const&
1426 static uno::Reference< uno::XComponentContext > xContext(
1428 static uno::Reference< rdf::XURI > xOdfPrefix(
1429 rdf::URI::createKnown(xContext, rdf::URIs::ODF_PREFIX),
1430 uno::UNO_SET_THROW);
1431 static uno::Reference< rdf::XURI > xOdfSuffix(
1432 rdf::URI::createKnown(xContext, rdf::URIs::ODF_SUFFIX),
1433 uno::UNO_SET_THROW);
1434 static uno::Reference< rdf::XURI > xOdfShading(
1435 rdf::URI::createKnown(xContext, rdf::URIs::LO_EXT_SHADING),
1436 uno::UNO_SET_THROW);
1439 case rdf::URIs::ODF_PREFIX:
1441 case rdf::URIs::ODF_SUFFIX:
1450 uno::Reference<rdf::XRepository>
const & xRepository,
1451 uno::Reference<rdf::XResource>
const & xMetaField,
1452 uno::Reference<rdf::XURI>
const & xPredicate)
1454 const uno::Reference<container::XEnumeration> xEnum(
1455 xRepository->getStatements(xMetaField, xPredicate,
nullptr),
1456 uno::UNO_SET_THROW);
1457 while (xEnum->hasMoreElements()) {
1458 rdf::Statement stmt;
1459 if (!(xEnum->nextElement() >>= stmt)) {
1460 throw uno::RuntimeException();
1462 const uno::Reference<rdf::XLiteral> xObject(stmt.Object,
1464 if (!xObject.is())
continue;
1465 if (xEnum->hasMoreElements()) {
1466 SAL_INFO(
"sw.uno",
"ignoring other odf:Prefix/odf:Suffix statements");
1468 return xObject->getValue();
1475 const uno::Reference<frame::XModel>& xModel,
1476 const uno::Reference<rdf::XMetadatable>& xMetaField,
1477 OUString *
const o_pPrefix, OUString *
const o_pSuffix, OUString *
const o_pShadingColor)
1480 const uno::Reference<rdf::XRepositorySupplier> xRS(
1481 xModel, uno::UNO_QUERY_THROW);
1482 const uno::Reference<rdf::XRepository> xRepo(
1483 xRS->getRDFRepository(), uno::UNO_SET_THROW);
1484 const uno::Reference<rdf::XResource> xMeta(
1485 xMetaField, uno::UNO_QUERY_THROW);
1494 if (o_pShadingColor)
1498 }
catch (uno::RuntimeException &) {
1500 }
catch (
const uno::Exception &) {
1502 throw lang::WrappedTargetRuntimeException(
"getPrefixAndSuffix: exception",
nullptr, anyEx);
1524 return prefix + content + suffix;
void disposeAndClear(::std::unique_lock<::std::mutex > &rGuard, const css::lang::EventObject &rEvt)
static uno::Reference< rdf::XURI > const & lcl_getURI(const sal_Int16 eKnown)
Starts a section of nodes in the document model.
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.
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
css::uno::Reference< css::frame::XModel3 > GetModel() const
const SfxItemPropertySet * GetPropertySet(sal_uInt16 PropertyId)
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
virtual void SAL_CALL acquire() SAL_NOEXCEPT SAL_OVERRIDE
virtual bool InsertPoolItem(const SwPaM &rRg, const SfxPoolItem &, const SetAttrMode nFlags=SetAttrMode::DEFAULT, SwRootFrame const *pLayout=nullptr, SwTextAttr **ppNewTextAttr=nullptr)=0
Insert an attribute.
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 addVetoableChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &xListener) override
Any SAL_CALL getCaughtException()
A wrapper around SfxPoolItem to store the start position of (usually) a text portion, with an optional end.
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
const css::uno::Sequence< sal_Int8 > & getSeq() const
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)
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.
#define SAL_WARN_IF(condition, area, stream)
#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
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
::comphelper::OInterfaceContainerHelper4< css::lang::XEventListener > m_EventListeners
#define SAL_WARN(area, stream)
void getPrefixAndSuffix(const uno::Reference< frame::XModel > &xModel, const uno::Reference< rdf::XMetadatable > &xMetaField, OUString *const o_pPrefix, OUString *const o_pSuffix, OUString *const o_pShadingColor)
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &rPropertyName) override
constexpr TypedWhichId< SwFormatRefMark > RES_TXTATR_REFMARK(RES_TXTATR_WITHEND_BEGIN)
virtual void SAL_CALL release() SAL_NOEXCEPT SAL_OVERRIDE
static SwNode * GetStartNode(SwOutlineNodes const *pOutlNds, int nOutlineLevel, SwOutlineNodes::size_type *nOutl)
OUString getString(const Any &_rAny)
virtual bool DeleteAndJoin(SwPaM &)=0
complete delete of a given PaM
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.
bool m_bDetectedRangeSegmentation false