LibreOffice Module sw (master)  1
unorefmk.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #include <memory>
21 #include <utility>
22 
26 #include <cppuhelper/exc_hlp.hxx>
28 #include <cppuhelper/weak.hxx>
29 #include <osl/mutex.hxx>
30 #include <sal/config.h>
31 #include <svl/listener.hxx>
32 #include <vcl/svapp.hxx>
33 #include <sal/log.hxx>
34 
35 #include <unotextrange.hxx>
36 #include <unorefmark.hxx>
37 #include <unotextcursor.hxx>
38 #include <unomap.hxx>
39 #include <unocrsrhelper.hxx>
40 #include <doc.hxx>
41 #include <ndtxt.hxx>
42 #include <fmtrfmrk.hxx>
43 #include <txtrfmrk.hxx>
44 #include <unometa.hxx>
45 #include <unotext.hxx>
46 #include <unoport.hxx>
47 #include <txtatr.hxx>
48 #include <fmtmeta.hxx>
49 #include <docsh.hxx>
50 
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>
60 
61 using namespace ::com::sun::star;
62 
64  : public SvtListener
65 {
66 private:
67  ::osl::Mutex m_Mutex; // just for OInterfaceContainerHelper2
68 
69 public:
70  uno::WeakReference<uno::XInterface> m_wThis;
75  OUString m_sMarkName;
76 
77  Impl(SwDoc* const pDoc, SwFormatRefMark* const pRefMark)
78  : m_EventListeners(m_Mutex)
79  , m_bIsDescriptor(nullptr == pRefMark)
80  , m_pDoc(pDoc)
81  , m_pMarkFormat(pRefMark)
82  {
83  if (pRefMark)
84  {
85  StartListening(pRefMark->GetNotifier());
86  m_sMarkName = pRefMark->GetRefName();
87  }
88  }
89 
90  bool IsValid() const { return m_pMarkFormat; }
91  void InsertRefMark( SwPaM & rPam, SwXTextCursor const*const pCursor );
92  void Invalidate();
93 protected:
94  virtual void Notify(const SfxHint&) override;
95 
96 };
97 
99 {
100  EndListeningAll();
101  m_pDoc = nullptr;
102  m_pMarkFormat = nullptr;
103  uno::Reference<uno::XInterface> const xThis(m_wThis);
104  if (!xThis.is())
105  { // fdo#72695: if UNO object is already dead, don't revive it with event
106  return;
107  }
108  lang::EventObject const ev(xThis);
110 }
111 
113 {
114  if(rHint.GetId() == SfxHintId::Dying)
115  Invalidate();
116 }
117 
119  SwDoc *const pDoc, SwFormatRefMark *const pRefMark)
120  : m_pImpl( new SwXReferenceMark::Impl(pDoc, pRefMark) )
121 {
122 }
123 
125 {
126 }
127 
128 uno::Reference<text::XTextContent>
130  SwDoc & rDoc, SwFormatRefMark *const pMarkFormat)
131 {
132  // i#105557: do not iterate over the registered clients: race condition
133  uno::Reference<text::XTextContent> xMark;
134  if (pMarkFormat)
135  {
136  xMark = pMarkFormat->GetXRefMark();
137  }
138  if (!xMark.is())
139  {
140  rtl::Reference<SwXReferenceMark> pMark(new SwXReferenceMark(&rDoc, pMarkFormat));
141  xMark = pMark;
142  if (pMarkFormat)
143  {
144  pMarkFormat->SetXRefMark(xMark);
145  }
146  // need a permanent Reference to initialize m_wThis
147  pMark->m_pImpl->m_wThis = xMark;
148  }
149  return xMark;
150 }
151 
152 const uno::Sequence< sal_Int8 > & SwXReferenceMark::getUnoTunnelId()
153 {
154  static const comphelper::UnoIdInit theSwXReferenceMarkUnoTunnelId;
155  return theSwXReferenceMarkUnoTunnelId.getSeq();
156 }
157 
158 sal_Int64 SAL_CALL
159 SwXReferenceMark::getSomething(const uno::Sequence< sal_Int8 >& rId)
160 {
161  return comphelper::getSomethingImpl<SwXReferenceMark>(rId, this);
162 }
163 
165 {
166  return "SwXReferenceMark";
167 }
168 
169 sal_Bool SAL_CALL
170 SwXReferenceMark::supportsService(const OUString& rServiceName)
171 {
172  return cppu::supportsService(this, rServiceName);
173 }
174 
175 uno::Sequence< OUString > SAL_CALL
177 {
178  return {
179  "com.sun.star.text.TextContent",
180  "com.sun.star.text.ReferenceMark"
181  };
182 }
183 
184 namespace {
185 
186 template<typename T> struct NotContainedIn
187 {
188  std::vector<T> const& m_rVector;
189  explicit NotContainedIn(std::vector<T> const& rVector)
190  : m_rVector(rVector) { }
191  bool operator() (T const& rT) {
192  return std::find(m_rVector.begin(), m_rVector.end(), rT)
193  == m_rVector.end();
194  }
195 };
196 
197 }
198 
200  SwXTextCursor const*const pCursor)
201 {
205  SwDoc& rDoc2 = rPam.GetDoc();
206 
207  UnoActionContext aCont(&rDoc2);
208  SwFormatRefMark aRefMark(m_sMarkName);
209  bool bMark = *rPam.GetPoint() != *rPam.GetMark();
210 
211  const bool bForceExpandHints( !bMark && pCursor && pCursor->IsAtEndOfMeta() );
212  const SetAttrMode nInsertFlags = bForceExpandHints
216 
217  std::vector<SwTextAttr *> oldMarks;
218  if (bMark)
219  {
220  oldMarks = rPam.GetNode().GetTextNode()->GetTextAttrsAt(
222  }
223 
224  rDoc2.getIDocumentContentOperations().InsertPoolItem( rPam, aRefMark, nInsertFlags );
225 
226  if( bMark && *rPam.GetPoint() > *rPam.GetMark())
227  {
228  rPam.Exchange();
229  }
230 
231  // aRefMark was copied into the document pool; now retrieve real format...
232  SwTextAttr * pTextAttr(nullptr);
233  if (bMark)
234  {
235  // #i107672#
236  // ensure that we do not retrieve a different mark at the same position
237  std::vector<SwTextAttr *> const newMarks(
240  std::vector<SwTextAttr *>::const_iterator const iter(
241  std::find_if(newMarks.begin(), newMarks.end(),
242  NotContainedIn<SwTextAttr *>(oldMarks)));
243  assert(newMarks.end() != iter);
244  if (newMarks.end() != iter)
245  {
246  pTextAttr = *iter;
247  }
248  }
249  else
250  {
251  SwTextNode *pTextNd = rPam.GetNode().GetTextNode();
252  assert(pTextNd);
253  pTextAttr = pTextNd ? rPam.GetNode().GetTextNode()->GetTextAttrForCharAt(
254  rPam.GetPoint()->nContent.GetIndex() - 1, RES_TXTATR_REFMARK) : nullptr;
255  }
256 
257  if (!pTextAttr)
258  {
259  throw uno::RuntimeException(
260  "SwXReferenceMark::InsertRefMark(): cannot insert attribute", nullptr);
261  }
262 
263  m_pMarkFormat = &pTextAttr->GetRefMark();
264  EndListeningAll();
265  StartListening(const_cast<SwFormatRefMark*>(m_pMarkFormat)->GetNotifier());
266 }
267 
268 void SAL_CALL
269 SwXReferenceMark::attach(const uno::Reference< text::XTextRange > & xTextRange)
270 {
271  SolarMutexGuard aGuard;
272 
273  if (!m_pImpl->m_bIsDescriptor)
274  {
275  throw uno::RuntimeException();
276  }
277  uno::Reference<lang::XUnoTunnel> xRangeTunnel( xTextRange, uno::UNO_QUERY);
278  SwXTextRange* pRange = comphelper::getFromUnoTunnel<SwXTextRange>(xRangeTunnel);
279  OTextCursorHelper* pCursor = comphelper::getFromUnoTunnel<OTextCursorHelper>(xRangeTunnel);
280  SwDoc *const pDocument =
281  pRange ? &pRange->GetDoc() : (pCursor ? pCursor->GetDoc() : nullptr);
282  if (!pDocument)
283  {
284  throw lang::IllegalArgumentException();
285  }
286 
287  SwUnoInternalPaM aPam(*pDocument);
288  // this now needs to return TRUE
289  ::sw::XTextRangeToSwPaM(aPam, xTextRange);
290  m_pImpl->InsertRefMark(aPam, dynamic_cast<SwXTextCursor*>(pCursor));
291  m_pImpl->m_bIsDescriptor = false;
292  m_pImpl->m_pDoc = pDocument;
293 }
294 
295 uno::Reference< text::XTextRange > SAL_CALL
297 {
298  SolarMutexGuard aGuard;
299 
300  if (m_pImpl->IsValid())
301  {
302  SwFormatRefMark const*const pNewMark =
303  m_pImpl->m_pDoc->GetRefMark(m_pImpl->m_sMarkName);
304  if (pNewMark && (pNewMark == m_pImpl->m_pMarkFormat))
305  {
306  SwTextRefMark const*const pTextMark =
307  m_pImpl->m_pMarkFormat->GetTextRefMark();
308  if (pTextMark &&
309  (&pTextMark->GetTextNode().GetNodes() ==
310  &m_pImpl->m_pDoc->GetNodes()))
311  {
312  SwTextNode const& rTextNode = pTextMark->GetTextNode();
313  std::optional<SwPaM> pPam;
314  if ( pTextMark->End() )
315  pPam.emplace( rTextNode, *pTextMark->End(),
316  rTextNode, pTextMark->GetStart());
317  else
318  pPam.emplace( rTextNode, pTextMark->GetStart());
319 
321  *m_pImpl->m_pDoc, *pPam->Start(), pPam->End());
322  }
323  }
324  }
325  return nullptr;
326 }
327 
329 {
330  SolarMutexGuard aGuard;
331  if (m_pImpl->IsValid())
332  {
333  SwFormatRefMark const*const pNewMark =
334  m_pImpl->m_pDoc->GetRefMark(m_pImpl->m_sMarkName);
335  if (pNewMark && (pNewMark == m_pImpl->m_pMarkFormat))
336  {
337  SwTextRefMark const*const pTextMark =
338  m_pImpl->m_pMarkFormat->GetTextRefMark();
339  if (pTextMark &&
340  (&pTextMark->GetTextNode().GetNodes() ==
341  &m_pImpl->m_pDoc->GetNodes()))
342  {
343  SwTextNode const& rTextNode = pTextMark->GetTextNode();
344  const sal_Int32 nStt = pTextMark->GetStart();
345  const sal_Int32 nEnd = pTextMark->End()
346  ? *pTextMark->End()
347  : nStt + 1;
348 
349  SwPaM aPam( rTextNode, nStt, rTextNode, nEnd );
350  m_pImpl->m_pDoc->getIDocumentContentOperations().DeleteAndJoin( aPam );
351  }
352  }
353  }
354  else if (m_pImpl->m_bIsDescriptor)
355  {
356  m_pImpl->Invalidate();
357  }
358 }
359 
361  const uno::Reference< lang::XEventListener > & xListener)
362 {
363  // no need to lock here as m_pImpl is const and container threadsafe
364  m_pImpl->m_EventListeners.addInterface(xListener);
365 }
366 
368  const uno::Reference< lang::XEventListener > & xListener)
369 {
370  // no need to lock here as m_pImpl is const and container threadsafe
371  m_pImpl->m_EventListeners.removeInterface(xListener);
372 }
373 
374 OUString SAL_CALL SwXReferenceMark::getName()
375 {
376  SolarMutexGuard aGuard;
377  if (!m_pImpl->IsValid() ||
378  !m_pImpl->m_pDoc->GetRefMark(m_pImpl->m_sMarkName))
379  {
380  throw uno::RuntimeException();
381  }
382  return m_pImpl->m_sMarkName;
383 }
384 
385 void SAL_CALL SwXReferenceMark::setName(const OUString& rName)
386 {
387  SolarMutexGuard aGuard;
388  if (m_pImpl->m_bIsDescriptor)
389  {
390  m_pImpl->m_sMarkName = rName;
391  }
392  else
393  {
394  if (!m_pImpl->IsValid()
395  || !m_pImpl->m_pDoc->GetRefMark(m_pImpl->m_sMarkName)
396  || m_pImpl->m_pDoc->GetRefMark(rName))
397  {
398  throw uno::RuntimeException();
399  }
400  SwFormatRefMark const*const pCurMark =
401  m_pImpl->m_pDoc->GetRefMark(m_pImpl->m_sMarkName);
402  if ((rName != m_pImpl->m_sMarkName)
403  && pCurMark && (pCurMark == m_pImpl->m_pMarkFormat))
404  {
405  const UnoActionContext aCont(m_pImpl->m_pDoc);
406  SwTextRefMark const*const pTextMark =
407  m_pImpl->m_pMarkFormat->GetTextRefMark();
408  if (pTextMark &&
409  (&pTextMark->GetTextNode().GetNodes() ==
410  &m_pImpl->m_pDoc->GetNodes()))
411  {
412  SwTextNode const& rTextNode = pTextMark->GetTextNode();
413  const sal_Int32 nStt = pTextMark->GetStart();
414  const sal_Int32 nEnd = pTextMark->End()
415  ? *pTextMark->End()
416  : nStt + 1;
417 
418  SwPaM aPam( rTextNode, nStt, rTextNode, nEnd );
419  // deletes the m_pImpl->m_pDoc member in the SwXReferenceMark!
420  m_pImpl->m_pDoc->getIDocumentContentOperations().DeleteAndJoin( aPam );
421  // The aPam will keep the correct and functional doc though
422 
423  m_pImpl->m_sMarkName = rName;
424  //create a new one
425  m_pImpl->InsertRefMark( aPam, nullptr );
426  m_pImpl->m_pDoc = &aPam.GetDoc();
427  }
428  }
429  }
430 }
431 
432 uno::Reference< beans::XPropertySetInfo > SAL_CALL
434 {
435  SolarMutexGuard g;
436 
437  static uno::Reference< beans::XPropertySetInfo > xRef =
439  ->getPropertySetInfo();
440  return xRef;
441 }
442 
444  const OUString& /*rPropertyName*/, const uno::Any& /*rValue*/ )
445 {
446  throw lang::IllegalArgumentException();
447 }
448 
449 uno::Any SAL_CALL
450 SwXReferenceMark::getPropertyValue(const OUString& rPropertyName)
451 {
452  // does not seem to need SolarMutex
453  uno::Any aRet;
454  if (! ::sw::GetDefaultTextContentValue(aRet, rPropertyName))
455  {
456  throw beans::UnknownPropertyException(rPropertyName);
457  }
458  return aRet;
459 }
460 
462  const OUString& /*rPropertyName*/,
463  const uno::Reference< beans::XPropertyChangeListener >& /*xListener*/)
464 {
465  OSL_FAIL("SwXReferenceMark::addPropertyChangeListener(): not implemented");
466 }
467 
469  const OUString& /*rPropertyName*/,
470  const uno::Reference< beans::XPropertyChangeListener >& /*xListener*/)
471 {
472  OSL_FAIL("SwXReferenceMark::removePropertyChangeListener(): not implemented");
473 }
474 
476  const OUString& /*rPropertyName*/,
477  const uno::Reference< beans::XVetoableChangeListener >& /*xListener*/)
478 {
479  OSL_FAIL("SwXReferenceMark::addVetoableChangeListener(): not implemented");
480 }
481 
483  const OUString& /*rPropertyName*/,
484  const uno::Reference< beans::XVetoableChangeListener >& /*xListener*/)
485 {
486  OSL_FAIL("SwXReferenceMark::removeVetoableChangeListener(): not implemented");
487 }
488 
489 namespace {
490 
491 class SwXMetaText : public cppu::OWeakObject, public SwXText
492 {
493 private:
494  SwXMeta & m_rMeta;
495 
496  virtual void PrepareForAttach(uno::Reference< text::XTextRange > & xRange,
497  const SwPaM & rPam) override;
498 
499  virtual bool CheckForOwnMemberMeta(const SwPaM & rPam, const bool bAbsorb) override;
500 
501 protected:
502  virtual const SwStartNode *GetStartNode() const override;
503  virtual uno::Reference< text::XTextCursor >
504  CreateCursor() override;
505 
506 public:
507  SwXMetaText(SwDoc & rDoc, SwXMeta & rMeta);
508 
510  using SwXText::Invalidate;
511 
512  // XInterface
513  virtual void SAL_CALL acquire() noexcept override { cppu::OWeakObject::acquire(); }
514  virtual void SAL_CALL release() noexcept override { cppu::OWeakObject::release(); }
515 
516  // XTypeProvider
517  virtual uno::Sequence< sal_Int8 > SAL_CALL
518  getImplementationId() override;
519 
520  // XText
521  virtual uno::Reference< text::XTextCursor > SAL_CALL
522  createTextCursor() override;
523  virtual uno::Reference< text::XTextCursor > SAL_CALL
524  createTextCursorByRange(
525  const uno::Reference< text::XTextRange > & xTextPosition) override;
526 
527 };
528 
529 }
530 
531 SwXMetaText::SwXMetaText(SwDoc & rDoc, SwXMeta & rMeta)
532  : SwXText(&rDoc, CursorType::Meta)
533  , m_rMeta(rMeta)
534 {
535 }
536 
538 {
539  SwXText const * const pParent(
540  dynamic_cast<SwXText*>(m_rMeta.GetParentText().get()));
541  return pParent ? pParent->GetStartNode() : nullptr;
542 }
543 
544 void SwXMetaText::PrepareForAttach( uno::Reference<text::XTextRange> & xRange,
545  const SwPaM & rPam)
546 {
547  // create a new cursor to prevent modifying SwXTextRange
548  xRange = static_cast<text::XWordCursor*>(
549  new SwXTextCursor(*GetDoc(), &m_rMeta, CursorType::Meta, *rPam.GetPoint(),
550  (rPam.HasMark()) ? rPam.GetMark() : nullptr));
551 }
552 
553 bool SwXMetaText::CheckForOwnMemberMeta(const SwPaM & rPam, const bool bAbsorb)
554 {
555  return m_rMeta.CheckForOwnMemberMeta(rPam, bAbsorb);
556 }
557 
558 uno::Reference< text::XTextCursor > SwXMetaText::CreateCursor()
559 {
560  uno::Reference< text::XTextCursor > xRet;
561  if (IsValid())
562  {
563  SwTextNode * pTextNode;
564  sal_Int32 nMetaStart;
565  sal_Int32 nMetaEnd;
566  const bool bSuccess(
567  m_rMeta.SetContentRange(pTextNode, nMetaStart, nMetaEnd) );
568  if (bSuccess)
569  {
570  SwPosition aPos(*pTextNode, nMetaStart);
571  xRet = static_cast<text::XWordCursor*>(
572  new SwXTextCursor(*GetDoc(), &m_rMeta, CursorType::Meta, aPos));
573  }
574  }
575  return xRet;
576 }
577 
578 uno::Sequence<sal_Int8> SAL_CALL
579 SwXMetaText::getImplementationId()
580 {
581  return css::uno::Sequence<sal_Int8>();
582 }
583 
584 // XText
585 uno::Reference< text::XTextCursor > SAL_CALL
586 SwXMetaText::createTextCursor()
587 {
588  return CreateCursor();
589 }
590 
591 uno::Reference< text::XTextCursor > SAL_CALL
592 SwXMetaText::createTextCursorByRange(
593  const uno::Reference<text::XTextRange> & xTextPosition)
594 {
595  const uno::Reference<text::XTextCursor> xCursor( CreateCursor() );
596  xCursor->gotoRange(xTextPosition, false);
597  return xCursor;
598 }
599 
600 // the Meta has a cached list of text portions for its contents
601 // this list is created by SwXTextPortionEnumeration
602 // the Meta listens at the SwTextNode and throws away the cache when it changes
604 {
605 private:
606  ::osl::Mutex m_Mutex; // just for OInterfaceContainerHelper2
607 
608 public:
609  uno::WeakReference<uno::XInterface> m_wThis;
611  std::unique_ptr<const TextRangeList_t> m_pTextPortions;
612  // 3 possible states: not attached, attached, disposed
615  uno::Reference<text::XText> m_xParentText;
618 
619  Impl(SwXMeta& rThis, SwDoc& rDoc,
620  ::sw::Meta* const pMeta,
621  uno::Reference<text::XText> const& xParentText,
622  std::unique_ptr<TextRangeList_t const> pPortions)
623  : m_EventListeners(m_Mutex)
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))
629  , m_pMeta(pMeta)
630  {
631  !m_bIsDescriptor && StartListening(m_pMeta->GetNotifier());
632  }
633 
634  inline const ::sw::Meta* GetMeta() const;
635  // only for SwXMetaField!
636  inline const ::sw::MetaField* GetMetaField() const;
637 protected:
638  virtual void Notify(const SfxHint& rHint) override;
639 
640 };
641 
642 inline const ::sw::Meta* SwXMeta::Impl::GetMeta() const
643 {
644  return m_pMeta;
645 }
646 
647 // sw::BroadcastingModify
648 void SwXMeta::Impl::Notify(const SfxHint& rHint)
649 {
650  m_pTextPortions.reset(); // throw away cache (SwTextNode changed)
651  if(rHint.GetId() != SfxHintId::Dying && rHint.GetId() != SfxHintId::Deinitializing)
652  return;
653 
654  m_bIsDisposed = true;
655  m_pMeta = nullptr;
656  m_xText->Invalidate();
657  uno::Reference<uno::XInterface> const xThis(m_wThis);
658  if (!xThis.is())
659  { // fdo#72695: if UNO object is already dead, don't revive it with event
660  return;
661  }
662  lang::EventObject const ev(xThis);
663  m_EventListeners.disposeAndClear(ev);
664 }
665 
666 uno::Reference<text::XText> const & SwXMeta::GetParentText() const
667 {
668  return m_pImpl->m_xParentText;
669 }
670 
671 SwXMeta::SwXMeta(SwDoc *const pDoc, ::sw::Meta *const pMeta,
672  uno::Reference<text::XText> const& xParentText,
673  std::unique_ptr<TextRangeList_t const> pPortions)
674  : m_pImpl( new SwXMeta::Impl(*this, *pDoc, pMeta, xParentText, std::move(pPortions)) )
675 {
676 }
677 
679  : m_pImpl( new SwXMeta::Impl(*this, *pDoc, nullptr, nullptr, nullptr) )
680 {
681 }
682 
684 {
685 }
686 
687 uno::Reference<rdf::XMetadatable>
688 SwXMeta::CreateXMeta(SwDoc & rDoc, bool const isField)
689 {
690  SwXMeta *const pXMeta(isField
691  ? new SwXMetaField(& rDoc) : new SwXMeta(& rDoc));
692  // this is why the constructor is private: need to acquire pXMeta here
693  uno::Reference<rdf::XMetadatable> const xMeta(pXMeta);
694  // need a permanent Reference to initialize m_wThis
695  pXMeta->m_pImpl->m_wThis = xMeta;
696  return xMeta;
697 }
698 
699 uno::Reference<rdf::XMetadatable>
701  uno::Reference<text::XText> const& i_xParent,
702  std::unique_ptr<TextRangeList_t const> && pPortions)
703 {
704  // re-use existing SwXMeta
705  // #i105557#: do not iterate over the registered clients: race condition
706  uno::Reference<rdf::XMetadatable> xMeta(rMeta.GetXMeta());
707  if (xMeta.is())
708  {
709  if (pPortions) // set cache in the XMeta to the given portions
710  {
711  SwXMeta *const pXMeta(
712  comphelper::getFromUnoTunnel<SwXMeta>(xMeta));
713  assert(pXMeta);
714  // NB: the meta must always be created with the complete content
715  // if SwXTextPortionEnumeration is created for a selection,
716  // it must be checked that the Meta is contained in the selection!
717  pXMeta->m_pImpl->m_pTextPortions = std::move(pPortions);
718  // ??? is this necessary?
719  if (pXMeta->m_pImpl->m_xParentText.get() != i_xParent.get())
720  {
721  SAL_WARN("sw.uno", "SwXMeta with different parent?");
722  pXMeta->m_pImpl->m_xParentText.set(i_xParent);
723  }
724  }
725  return xMeta;
726  }
727 
728  // create new SwXMeta
729  SwTextNode * const pTextNode( rMeta.GetTextNode() );
730  SAL_WARN_IF(!pTextNode, "sw.uno", "CreateXMeta: no text node?");
731  if (!pTextNode) { return nullptr; }
732  uno::Reference<text::XText> xParentText(i_xParent);
733  if (!xParentText.is())
734  {
735  SwTextMeta * const pTextAttr( rMeta.GetTextAttr() );
736  SAL_WARN_IF(!pTextAttr, "sw.uno", "CreateXMeta: no text attr?");
737  if (!pTextAttr) { return nullptr; }
738  const SwPosition aPos(*pTextNode, pTextAttr->GetStart());
739  xParentText.set( ::sw::CreateParentXText(pTextNode->GetDoc(), aPos) );
740  }
741  if (!xParentText.is()) { return nullptr; }
742  SwXMeta *const pXMeta( (RES_TXTATR_META == rMeta.GetFormatMeta()->Which())
743  ? new SwXMeta (&pTextNode->GetDoc(), &rMeta, xParentText,
744  std::move(pPortions))
745  : new SwXMetaField(&pTextNode->GetDoc(), &rMeta, xParentText,
746  std::move(pPortions)));
747  // this is why the constructor is private: need to acquire pXMeta here
748  xMeta.set(pXMeta);
749  // in order to initialize the weak pointer cache in the core object
750  rMeta.SetXMeta(xMeta);
751  // need a permanent Reference to initialize m_wThis
752  pXMeta->m_pImpl->m_wThis = xMeta;
753  return xMeta;
754 }
755 
757  SwTextNode *& rpNode, sal_Int32 & rStart, sal_Int32 & rEnd ) const
758 {
759  ::sw::Meta const * const pMeta( m_pImpl->GetMeta() );
760  if (pMeta)
761  {
762  SwTextMeta const * const pTextAttr( pMeta->GetTextAttr() );
763  if (pTextAttr)
764  {
765  rpNode = pMeta->GetTextNode();
766  if (rpNode)
767  {
768  // rStart points at the first position _within_ the meta!
769  rStart = pTextAttr->GetStart() + 1;
770  rEnd = *pTextAttr->End();
771  return true;
772  }
773  }
774  }
775  return false;
776 }
777 
778 bool SwXMeta::CheckForOwnMemberMeta(const SwPaM & rPam, const bool bAbsorb)
779 {
780  SwTextNode * pTextNode;
781  sal_Int32 nMetaStart;
782  sal_Int32 nMetaEnd;
783  const bool bSuccess( SetContentRange(pTextNode, nMetaStart, nMetaEnd) );
784  OSL_ENSURE(bSuccess, "no pam?");
785  if (!bSuccess)
786  throw lang::DisposedException();
787 
788  SwPosition const * const pStartPos( rPam.Start() );
789  if (&pStartPos->nNode.GetNode() != pTextNode)
790  {
791  throw lang::IllegalArgumentException(
792  "trying to insert into a nesting text content, but start "
793  "of text range not in same paragraph as text content",
794  nullptr, 0);
795  }
796  bool bForceExpandHints(false);
797  const sal_Int32 nStartPos(pStartPos->nContent.GetIndex());
798  // not <= but < because nMetaStart is behind dummy char!
799  // not >= but > because == means insert at end!
800  if ((nStartPos < nMetaStart) || (nStartPos > nMetaEnd))
801  {
802  throw lang::IllegalArgumentException(
803  "trying to insert into a nesting text content, but start "
804  "of text range not inside text content",
805  nullptr, 0);
806  }
807  else if (nStartPos == nMetaEnd)
808  {
809  bForceExpandHints = true;
810  }
811  if (rPam.HasMark() && bAbsorb)
812  {
813  SwPosition const * const pEndPos( rPam.End() );
814  if (&pEndPos->nNode.GetNode() != pTextNode)
815  {
816  throw lang::IllegalArgumentException(
817  "trying to insert into a nesting text content, but end "
818  "of text range not in same paragraph as text content",
819  nullptr, 0);
820  }
821  const sal_Int32 nEndPos(pEndPos->nContent.GetIndex());
822  // not <= but < because nMetaStart is behind dummy char!
823  // not >= but > because == means insert at end!
824  if ((nEndPos < nMetaStart) || (nEndPos > nMetaEnd))
825  {
826  throw lang::IllegalArgumentException(
827  "trying to insert into a nesting text content, but end "
828  "of text range not inside text content",
829  nullptr, 0);
830  }
831  else if (nEndPos == nMetaEnd)
832  {
833  bForceExpandHints = true;
834  }
835  }
836  return bForceExpandHints;
837 }
838 
839 const uno::Sequence< sal_Int8 > & SwXMeta::getUnoTunnelId()
840 {
841  static const comphelper::UnoIdInit theSwXMetaUnoTunnelId;
842  return theSwXMetaUnoTunnelId.getSeq();
843 }
844 
845 // XUnoTunnel
846 sal_Int64 SAL_CALL
847 SwXMeta::getSomething( const uno::Sequence< sal_Int8 > & i_rId )
848 {
849  return comphelper::getSomethingImpl<SwXMeta>(i_rId, this);
850 }
851 
852 // XServiceInfo
853 OUString SAL_CALL
855 {
856  return "SwXMeta";
857 }
858 
859 sal_Bool SAL_CALL
860 SwXMeta::supportsService(const OUString& rServiceName)
861 {
862  return cppu::supportsService(this, rServiceName);
863 }
864 
865 uno::Sequence< OUString > SAL_CALL
867 {
868  return {
869  "com.sun.star.text.TextContent",
870  "com.sun.star.text.InContentMetadata"
871  };
872 }
873 
874 // XComponent
875 void SAL_CALL
877  uno::Reference< lang::XEventListener> const & xListener )
878 {
879  // no need to lock here as m_pImpl is const and container threadsafe
880  m_pImpl->m_EventListeners.addInterface(xListener);
881 }
882 
883 void SAL_CALL
885  uno::Reference< lang::XEventListener> const & xListener )
886 {
887  // no need to lock here as m_pImpl is const and container threadsafe
888  m_pImpl->m_EventListeners.removeInterface(xListener);
889 }
890 
891 void SAL_CALL
893 {
894  SolarMutexGuard g;
895 
896  if (m_pImpl->m_bIsDescriptor)
897  {
898  m_pImpl->m_pTextPortions.reset();
899  lang::EventObject const ev(static_cast< ::cppu::OWeakObject&>(*this));
900  m_pImpl->m_EventListeners.disposeAndClear(ev);
901  m_pImpl->m_bIsDisposed = true;
902  m_pImpl->m_xText->Invalidate();
903  }
904  else if (!m_pImpl->m_bIsDisposed)
905  {
906  SwTextNode * pTextNode;
907  sal_Int32 nMetaStart;
908  sal_Int32 nMetaEnd;
909  const bool bSuccess(SetContentRange(pTextNode, nMetaStart, nMetaEnd));
910  OSL_ENSURE(bSuccess, "no pam?");
911  if (bSuccess)
912  {
913  // -1 because of CH_TXTATR
914  SwPaM aPam( *pTextNode, nMetaStart - 1, *pTextNode, nMetaEnd );
915  SwDoc& rDoc( pTextNode->GetDoc() );
917 
918  // removal should call Modify and do the dispose
919  assert(m_pImpl->m_bIsDisposed);
920  }
921  }
922 }
923 
924 void
925 SwXMeta::AttachImpl(const uno::Reference< text::XTextRange > & i_xTextRange,
926  const sal_uInt16 i_nWhich)
927 {
928  SolarMutexGuard g;
929 
930  if (m_pImpl->m_bIsDisposed)
931  {
932  throw lang::DisposedException();
933  }
934  if (!m_pImpl->m_bIsDescriptor)
935  {
936  throw uno::RuntimeException(
937  "SwXMeta::attach(): already attached",
938  static_cast< ::cppu::OWeakObject* >(this));
939  }
940 
941  uno::Reference<lang::XUnoTunnel> xRangeTunnel(i_xTextRange, uno::UNO_QUERY);
942  if (!xRangeTunnel.is())
943  {
944  throw lang::IllegalArgumentException(
945  "SwXMeta::attach(): argument is no XUnoTunnel",
946  static_cast< ::cppu::OWeakObject* >(this), 0);
947  }
948  SwXTextRange *const pRange(
949  comphelper::getFromUnoTunnel<SwXTextRange>(xRangeTunnel));
950  OTextCursorHelper *const pCursor( pRange ? nullptr :
951  comphelper::getFromUnoTunnel<OTextCursorHelper>(xRangeTunnel));
952  if (!pRange && !pCursor)
953  {
954  throw lang::IllegalArgumentException(
955  "SwXMeta::attach(): argument not supported type",
956  static_cast< ::cppu::OWeakObject* >(this), 0);
957  }
958 
959  SwDoc * const pDoc(
960  pRange ? &pRange->GetDoc() : pCursor->GetDoc());
961  if (!pDoc)
962  {
963  throw lang::IllegalArgumentException(
964  "SwXMeta::attach(): argument has no SwDoc",
965  static_cast< ::cppu::OWeakObject* >(this), 0);
966  }
967 
968  SwUnoInternalPaM aPam(*pDoc);
969  ::sw::XTextRangeToSwPaM(aPam, i_xTextRange);
970 
971  UnoActionContext aContext(pDoc);
972 
973  SwXTextCursor const*const pTextCursor(
974  dynamic_cast<SwXTextCursor*>(pCursor));
975  const bool bForceExpandHints(pTextCursor && pTextCursor->IsAtEndOfMeta());
976  const SetAttrMode nInsertFlags( bForceExpandHints
980 
981  const std::shared_ptr< ::sw::Meta> pMeta( (RES_TXTATR_META == i_nWhich)
982  ? std::make_shared< ::sw::Meta>( nullptr )
983  : std::shared_ptr< ::sw::Meta>(
984  pDoc->GetMetaFieldManager().makeMetaField()) );
985  SwFormatMeta meta(pMeta, i_nWhich); // this is cloned by Insert!
986  const bool bSuccess( pDoc->getIDocumentContentOperations().InsertPoolItem( aPam, meta, nInsertFlags ) );
987  SwTextAttr * const pTextAttr( pMeta->GetTextAttr() );
988  if (!bSuccess)
989  {
990  throw lang::IllegalArgumentException(
991  "SwXMeta::attach(): cannot create meta: range invalid?",
992  static_cast< ::cppu::OWeakObject* >(this), 1);
993  }
994  if (!pTextAttr)
995  {
996  OSL_FAIL("meta inserted, but has no text attribute?");
997  throw uno::RuntimeException(
998  "SwXMeta::attach(): cannot create meta",
999  static_cast< ::cppu::OWeakObject* >(this));
1000  }
1001 
1002  m_pImpl->EndListeningAll();
1003  m_pImpl->m_pMeta = pMeta.get();
1004  m_pImpl->StartListening(pMeta->GetNotifier());
1005  pMeta->SetXMeta(uno::Reference<rdf::XMetadatable>(this));
1006 
1007  m_pImpl->m_xParentText = ::sw::CreateParentXText(*pDoc, *aPam.GetPoint());
1008 
1009  m_pImpl->m_bIsDescriptor = false;
1010 }
1011 
1012 // XTextContent
1013 void SAL_CALL
1014 SwXMeta::attach(const uno::Reference< text::XTextRange > & i_xTextRange)
1015 {
1016  return SwXMeta::AttachImpl(i_xTextRange, RES_TXTATR_META);
1017 }
1018 
1019 uno::Reference< text::XTextRange > SAL_CALL
1021 {
1022  SolarMutexGuard g;
1023 
1024  if (m_pImpl->m_bIsDisposed)
1025  {
1026  throw lang::DisposedException();
1027  }
1028  if (m_pImpl->m_bIsDescriptor)
1029  {
1030  throw uno::RuntimeException(
1031  "SwXMeta::getAnchor(): not inserted",
1032  static_cast< ::cppu::OWeakObject* >(this));
1033  }
1034 
1035  SwTextNode * pTextNode;
1036  sal_Int32 nMetaStart;
1037  sal_Int32 nMetaEnd;
1038  const bool bSuccess(SetContentRange(pTextNode, nMetaStart, nMetaEnd));
1039  OSL_ENSURE(bSuccess, "no pam?");
1040  if (!bSuccess)
1041  {
1042  throw lang::DisposedException(
1043  "SwXMeta::getAnchor(): not attached",
1044  static_cast< ::cppu::OWeakObject* >(this));
1045  }
1046 
1047  const SwPosition start(*pTextNode, nMetaStart - 1); // -1 due to CH_TXTATR
1048  const SwPosition end(*pTextNode, nMetaEnd);
1049  return SwXTextRange::CreateXTextRange(pTextNode->GetDoc(), start, &end);
1050 }
1051 
1052 // XTextRange
1053 uno::Reference< text::XText > SAL_CALL
1055 {
1056  return this;
1057 }
1058 
1059 uno::Reference< text::XTextRange > SAL_CALL
1061 {
1062  SolarMutexGuard g;
1063  return m_pImpl->m_xText->getStart();
1064 }
1065 
1066 uno::Reference< text::XTextRange > SAL_CALL
1068 {
1069  SolarMutexGuard g;
1070  return m_pImpl->m_xText->getEnd();
1071 }
1072 
1073 OUString SAL_CALL
1075 {
1076  SolarMutexGuard g;
1077  return m_pImpl->m_xText->getString();
1078 }
1079 
1080 void SAL_CALL
1081 SwXMeta::setString(const OUString& rString)
1082 {
1083  SolarMutexGuard g;
1084  return m_pImpl->m_xText->setString(rString);
1085 }
1086 
1087 // XSimpleText
1088 uno::Reference< text::XTextCursor > SAL_CALL
1090 {
1091  SolarMutexGuard g;
1092  return m_pImpl->m_xText->createTextCursor();
1093 }
1094 
1095 uno::Reference< text::XTextCursor > SAL_CALL
1097  const uno::Reference<text::XTextRange> & xTextPosition)
1098 {
1099  SolarMutexGuard g;
1100  return m_pImpl->m_xText->createTextCursorByRange(xTextPosition);
1101 }
1102 
1103 void SAL_CALL
1104 SwXMeta::insertString(const uno::Reference<text::XTextRange> & xRange,
1105  const OUString& rString, sal_Bool bAbsorb)
1106 {
1107  SolarMutexGuard g;
1108  return m_pImpl->m_xText->insertString(xRange, rString, bAbsorb);
1109 }
1110 
1111 void SAL_CALL
1112 SwXMeta::insertControlCharacter(const uno::Reference<text::XTextRange> & xRange,
1113  sal_Int16 nControlCharacter, sal_Bool bAbsorb)
1114 {
1115  SolarMutexGuard g;
1116  return m_pImpl->m_xText->insertControlCharacter(xRange, nControlCharacter,
1117  bAbsorb);
1118 }
1119 
1120 // XText
1121 void SAL_CALL
1122 SwXMeta::insertTextContent( const uno::Reference<text::XTextRange> & xRange,
1123  const uno::Reference<text::XTextContent> & xContent, sal_Bool bAbsorb)
1124 {
1125  SolarMutexGuard g;
1126  return m_pImpl->m_xText->insertTextContent(xRange, xContent, bAbsorb);
1127 }
1128 
1129 void SAL_CALL
1131  const uno::Reference< text::XTextContent > & xContent)
1132 {
1133  SolarMutexGuard g;
1134  return m_pImpl->m_xText->removeTextContent(xContent);
1135 }
1136 
1137 // XChild
1138 uno::Reference< uno::XInterface > SAL_CALL
1140 {
1141  SolarMutexGuard g;
1142  SwTextNode * pTextNode;
1143  sal_Int32 nMetaStart;
1144  sal_Int32 nMetaEnd;
1145  bool const bSuccess( SetContentRange(pTextNode, nMetaStart, nMetaEnd) );
1146  OSL_ENSURE(bSuccess, "no pam?");
1147  if (!bSuccess) { throw lang::DisposedException(); }
1148  // in order to prevent getting this meta, subtract 1 from nMetaStart;
1149  // so we get the index of the dummy character, and we exclude it
1150  // by calling GetTextAttrAt(_, _, PARENT) in GetNestedTextContent
1151  uno::Reference<text::XTextContent> const xRet(
1152  SwUnoCursorHelper::GetNestedTextContent(*pTextNode, nMetaStart - 1,
1153  true) );
1154  return xRet;
1155 }
1156 
1157 void SAL_CALL
1158 SwXMeta::setParent(uno::Reference< uno::XInterface > const& /*xParent*/)
1159 {
1160  throw lang::NoSupportException("setting parent not supported", *this);
1161 }
1162 
1163 // XElementAccess
1164 uno::Type SAL_CALL
1166 {
1168 }
1169 
1171 {
1172  SolarMutexGuard g;
1173  return m_pImpl->m_pMeta != nullptr;
1174 }
1175 
1176 // XEnumerationAccess
1177 uno::Reference< container::XEnumeration > SAL_CALL
1179 {
1180  SolarMutexGuard g;
1181 
1182  if (m_pImpl->m_bIsDisposed)
1183  {
1184  throw lang::DisposedException();
1185  }
1186  if (m_pImpl->m_bIsDescriptor)
1187  {
1188  throw uno::RuntimeException(
1189  "createEnumeration(): not inserted",
1190  static_cast< ::cppu::OWeakObject* >(this));
1191  }
1192 
1193  SwTextNode * pTextNode;
1194  sal_Int32 nMetaStart;
1195  sal_Int32 nMetaEnd;
1196  const bool bSuccess(SetContentRange(pTextNode, nMetaStart, nMetaEnd));
1197  OSL_ENSURE(bSuccess, "no pam?");
1198  if (!bSuccess)
1199  throw lang::DisposedException();
1200 
1201  SwPaM aPam(*pTextNode, nMetaStart);
1202 
1203  if (!m_pImpl->m_pTextPortions)
1204  {
1205  return new SwXTextPortionEnumeration(
1206  aPam, GetParentText(), nMetaStart, nMetaEnd);
1207  }
1208  else // cached!
1209  {
1210  return new SwXTextPortionEnumeration(aPam, *m_pImpl->m_pTextPortions);
1211  }
1212 }
1213 
1214 // MetadatableMixin
1216 {
1217  return const_cast< ::sw::Meta * >(m_pImpl->GetMeta());
1218 }
1219 
1220 uno::Reference<frame::XModel> SwXMeta::GetModel()
1221 {
1222  ::sw::Meta const * const pMeta( m_pImpl->GetMeta() );
1223  if (pMeta)
1224  {
1225  SwTextNode const * const pTextNode( pMeta->GetTextNode() );
1226  if (pTextNode)
1227  {
1228  SwDocShell const * const pShell(pTextNode->GetDoc().GetDocShell());
1229  return pShell ? pShell->GetModel() : nullptr;
1230  }
1231  }
1232  return nullptr;
1233 }
1234 
1235 inline const ::sw::MetaField* SwXMeta::Impl::GetMetaField() const
1236 {
1237  return dynamic_cast<sw::MetaField*>(m_pMeta);
1238 }
1239 
1240 SwXMetaField::SwXMetaField(SwDoc *const pDoc, ::sw::Meta *const pMeta,
1241  uno::Reference<text::XText> const& xParentText,
1242  std::unique_ptr<TextRangeList_t const> pPortions)
1243  : SwXMetaField_Base(pDoc, pMeta, xParentText, std::move(pPortions))
1244 {
1245  assert(dynamic_cast< ::sw::MetaField* >(pMeta) && "SwXMetaField created for wrong hint!");
1246 }
1247 
1249  : SwXMetaField_Base(pDoc)
1250 {
1251 }
1252 
1254 {
1255 }
1256 
1257 // XServiceInfo
1258 OUString SAL_CALL
1260 {
1261  return "SwXMetaField";
1262 }
1263 
1264 sal_Bool SAL_CALL
1265 SwXMetaField::supportsService(const OUString& rServiceName)
1266 {
1267  return cppu::supportsService(this, rServiceName);
1268 }
1269 
1270 uno::Sequence< OUString > SAL_CALL
1272 {
1273  return {
1274  "com.sun.star.text.TextContent",
1275  "com.sun.star.text.TextField",
1276  "com.sun.star.text.textfield.MetadataField"
1277  };
1278 }
1279 
1280 // XComponent
1281 void SAL_CALL
1283  uno::Reference< lang::XEventListener> const & xListener )
1284 {
1285  return SwXMeta::addEventListener(xListener);
1286 }
1287 
1288 void SAL_CALL
1290  uno::Reference< lang::XEventListener> const & xListener )
1291 {
1292  return SwXMeta::removeEventListener(xListener);
1293 }
1294 
1295 void SAL_CALL
1297 {
1298  return SwXMeta::dispose();
1299 }
1300 
1301 // XTextContent
1302 void SAL_CALL
1303 SwXMetaField::attach(const uno::Reference< text::XTextRange > & i_xTextRange)
1304 {
1305  return SwXMeta::AttachImpl(i_xTextRange, RES_TXTATR_METAFIELD);
1306 }
1307 
1308 uno::Reference< text::XTextRange > SAL_CALL
1310 {
1311  return SwXMeta::getAnchor();
1312 }
1313 
1314 // XPropertySet
1315 uno::Reference< beans::XPropertySetInfo > SAL_CALL
1317 {
1318  SolarMutexGuard g;
1319 
1320  static uno::Reference< beans::XPropertySetInfo > xRef(
1322  ->getPropertySetInfo() );
1323  return xRef;
1324 }
1325 
1326 void SAL_CALL
1328  const OUString& rPropertyName, const uno::Any& rValue)
1329 {
1330  SolarMutexGuard g;
1331 
1332  ::sw::MetaField * const pMeta(
1333  const_cast< ::sw::MetaField * >(m_pImpl->GetMetaField()) );
1334  if (!pMeta)
1335  throw lang::DisposedException();
1336 
1337  if ( rPropertyName == "NumberFormat" )
1338  {
1339  sal_Int32 nNumberFormat(0);
1340  if (rValue >>= nNumberFormat)
1341  {
1342  pMeta->SetNumberFormat(static_cast<sal_uInt32>(nNumberFormat));
1343  }
1344  }
1345  else if ( rPropertyName == "IsFixedLanguage" )
1346  {
1347  bool b(false);
1348  if (rValue >>= b)
1349  {
1350  pMeta->SetIsFixedLanguage(b);
1351  }
1352  }
1353  else
1354  {
1355  throw beans::UnknownPropertyException(rPropertyName);
1356  }
1357 }
1358 
1359 uno::Any SAL_CALL
1360 SwXMetaField::getPropertyValue(const OUString& rPropertyName)
1361 {
1362  SolarMutexGuard g;
1363 
1364  ::sw::MetaField const * const pMeta( m_pImpl->GetMetaField() );
1365  if (!pMeta)
1366  throw lang::DisposedException();
1367 
1368  uno::Any any;
1369 
1370  if ( rPropertyName == "NumberFormat" )
1371  {
1372  const OUString text( getPresentation(false) );
1373  any <<= static_cast<sal_Int32>(pMeta->GetNumberFormat(text));
1374  }
1375  else if ( rPropertyName == "IsFixedLanguage" )
1376  {
1377  any <<= pMeta->IsFixedLanguage();
1378  }
1379  else
1380  {
1381  throw beans::UnknownPropertyException(rPropertyName);
1382  }
1383 
1384  return any;
1385 }
1386 
1387 void SAL_CALL
1389  const OUString& /*rPropertyName*/,
1390  const uno::Reference< beans::XPropertyChangeListener >& /*xListener*/)
1391 {
1392  OSL_FAIL("SwXMetaField::addPropertyChangeListener(): not implemented");
1393 }
1394 
1395 void SAL_CALL
1397  const OUString& /*rPropertyName*/,
1398  const uno::Reference< beans::XPropertyChangeListener >& /*xListener*/)
1399 {
1400  OSL_FAIL("SwXMetaField::removePropertyChangeListener(): not implemented");
1401 }
1402 
1403 void SAL_CALL
1405  const OUString& /*rPropertyName*/,
1406  const uno::Reference< beans::XVetoableChangeListener >& /*xListener*/)
1407 {
1408  OSL_FAIL("SwXMetaField::addVetoableChangeListener(): not implemented");
1409 }
1410 
1411 void SAL_CALL
1413  const OUString& /*rPropertyName*/,
1414  const uno::Reference< beans::XVetoableChangeListener >& /*xListener*/)
1415 {
1416  OSL_FAIL("SwXMetaField::removeVetoableChangeListener(): not implemented");
1417 }
1418 
1419 static uno::Reference<rdf::XURI> const&
1420 lcl_getURI(const sal_Int16 eKnown)
1421 {
1422  static uno::Reference< uno::XComponentContext > xContext(
1424  static uno::Reference< rdf::XURI > xOdfPrefix(
1425  rdf::URI::createKnown(xContext, rdf::URIs::ODF_PREFIX),
1426  uno::UNO_SET_THROW);
1427  static uno::Reference< rdf::XURI > xOdfSuffix(
1428  rdf::URI::createKnown(xContext, rdf::URIs::ODF_SUFFIX),
1429  uno::UNO_SET_THROW);
1430  static uno::Reference< rdf::XURI > xOdfShading(
1431  rdf::URI::createKnown(xContext, rdf::URIs::LO_EXT_SHADING),
1432  uno::UNO_SET_THROW);
1433  switch (eKnown)
1434  {
1435  case rdf::URIs::ODF_PREFIX:
1436  return xOdfPrefix;
1437  case rdf::URIs::ODF_SUFFIX:
1438  return xOdfSuffix;
1439  default:
1440  return xOdfShading;
1441  }
1442 }
1443 
1444 static OUString
1446  uno::Reference<rdf::XRepository> const & xRepository,
1447  uno::Reference<rdf::XResource> const & xMetaField,
1448  uno::Reference<rdf::XURI> const & xPredicate)
1449 {
1450  const uno::Reference<container::XEnumeration> xEnum(
1451  xRepository->getStatements(xMetaField, xPredicate, nullptr),
1452  uno::UNO_SET_THROW);
1453  while (xEnum->hasMoreElements()) {
1454  rdf::Statement stmt;
1455  if (!(xEnum->nextElement() >>= stmt)) {
1456  throw uno::RuntimeException();
1457  }
1458  const uno::Reference<rdf::XLiteral> xObject(stmt.Object,
1459  uno::UNO_QUERY);
1460  if (!xObject.is()) continue;
1461  if (xEnum->hasMoreElements()) {
1462  SAL_INFO("sw.uno", "ignoring other odf:Prefix/odf:Suffix statements");
1463  }
1464  return xObject->getValue();
1465  }
1466  return OUString();
1467 }
1468 
1469 void
1471  const uno::Reference<frame::XModel>& xModel,
1472  const uno::Reference<rdf::XMetadatable>& xMetaField,
1473  OUString *const o_pPrefix, OUString *const o_pSuffix, OUString *const o_pShadingColor)
1474 {
1475  try {
1476  const uno::Reference<rdf::XRepositorySupplier> xRS(
1477  xModel, uno::UNO_QUERY_THROW);
1478  const uno::Reference<rdf::XRepository> xRepo(
1479  xRS->getRDFRepository(), uno::UNO_SET_THROW);
1480  const uno::Reference<rdf::XResource> xMeta(
1481  xMetaField, uno::UNO_QUERY_THROW);
1482  if (o_pPrefix)
1483  {
1484  *o_pPrefix = lcl_getPrefixOrSuffix(xRepo, xMeta, lcl_getURI(rdf::URIs::ODF_PREFIX));
1485  }
1486  if (o_pSuffix)
1487  {
1488  *o_pSuffix = lcl_getPrefixOrSuffix(xRepo, xMeta, lcl_getURI(rdf::URIs::ODF_SUFFIX));
1489  }
1490  if (o_pShadingColor)
1491  {
1492  *o_pShadingColor = lcl_getPrefixOrSuffix(xRepo, xMeta, lcl_getURI(rdf::URIs::LO_EXT_SHADING));
1493  }
1494  } catch (uno::RuntimeException &) {
1495  throw;
1496  } catch (const uno::Exception &) {
1497  css::uno::Any anyEx = cppu::getCaughtException();
1498  throw lang::WrappedTargetRuntimeException("getPrefixAndSuffix: exception", nullptr, anyEx);
1499  }
1500 }
1501 
1502 // XTextField
1503 OUString SAL_CALL
1505 {
1506  SolarMutexGuard g;
1507 
1508  if (bShowCommand)
1509  {
1510 //FIXME ?
1511  return OUString();
1512  }
1513  else
1514  {
1515  // getString should check if this is invalid
1516  const OUString content( getString() );
1517  OUString prefix;
1518  OUString suffix;
1519  getPrefixAndSuffix(GetModel(), this, &prefix, &suffix, nullptr);
1520  return prefix + content + suffix;
1521  }
1522 }
1523 
1524 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void SAL_CALL attach(const css::uno::Reference< css::text::XTextRange > &xTextRange) override
Definition: unorefmk.cxx:1014
static uno::Reference< rdf::XURI > const & lcl_getURI(const sal_Int16 eKnown)
Definition: unorefmk.cxx:1420
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unorefmk.cxx:1271
static css::uno::Reference< css::rdf::XMetadatable > CreateXMeta(::sw::Meta &rMeta, css::uno::Reference< css::text::XText > const &xParentText=nullptr, std::unique_ptr< TextRangeList_t const > &&pPortions=std::unique_ptr< TextRangeList_t const >())
virtual css::uno::Reference< css::text::XText > SAL_CALL getText() override
Definition: unorefmk.cxx:1054
SwXMeta(SwXMeta const &)=delete
Starts a section of nodes in the document model.
Definition: node.hxx:312
Impl(SwDoc *const pDoc, SwFormatRefMark *const pRefMark)
Definition: unorefmk.cxx:77
const ::sw::Meta * GetMeta() const
Definition: unorefmk.cxx:642
SwNode & GetNode(bool bPoint=true) const
Definition: pam.hxx:223
virtual css::uno::Type SAL_CALL getElementType() override
Definition: unorefmk.cxx:1165
virtual const SwDoc * GetDoc() const =0
::osl::Mutex m_Mutex
Definition: unorefmk.cxx:606
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getAnchor() override
Definition: unorefmk.cxx:1020
virtual void SAL_CALL removePropertyChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: unorefmk.cxx:1396
SwFormatMeta * GetFormatMeta() const
Definition: fmtmeta.hxx:145
Marks a position in the document model.
Definition: pam.hxx:35
::comphelper::OInterfaceContainerHelper2 m_EventListeners
Definition: unorefmk.cxx:71
css::uno::Reference< css::text::XText > const & GetParentText() const
Definition: unorefmk.cxx:666
OUString & GetRefName()
Definition: fmtrfmrk.hxx:64
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &xListener) override
Definition: unorefmk.cxx:360
constexpr TypedWhichId< SwFormatMeta > RES_TXTATR_METAFIELD(49)
::osl::Mutex m_Mutex
Definition: unorefmk.cxx:67
CursorType
virtual void SAL_CALL addPropertyChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: unorefmk.cxx:461
SwDocShell * GetDocShell()
Definition: doc.hxx:1352
constexpr TypedWhichId< SwFormatMeta > RES_TXTATR_META(48)
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getAnchor() override
Definition: unorefmk.cxx:296
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getParent() override
Definition: unorefmk.cxx:1139
void InsertRefMark(SwPaM &rPam, SwXTextCursor const *const pCursor)
Definition: unorefmk.cxx:199
const SwPosition * GetMark() const
Definition: pam.hxx:209
void Invalidate()
Definition: unotext.cxx:147
css::uno::Reference< css::frame::XModel3 > GetModel() const
const SfxItemPropertySet * GetPropertySet(sal_uInt16 PropertyId)
Definition: unomap1.cxx:1062
Definition: doc.hxx:188
virtual OUString SAL_CALL getImplementationName() override
Definition: unorefmk.cxx:854
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &xListener) override
Definition: unorefmk.cxx:1282
void disposeAndClear(const css::lang::EventObject &rEvt)
bool IsAtEndOfMeta() const
Definition: unoobj.cxx:795
uno::WeakReference< uno::XInterface > m_wThis
Definition: unorefmk.cxx:609
virtual void SAL_CALL insertControlCharacter(const css::uno::Reference< css::text::XTextRange > &xRange, sal_Int16 nControlCharacter, sal_Bool bAbsorb) override
Definition: unorefmk.cxx:1112
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &xListener) override
Definition: unorefmk.cxx:876
bool CheckForOwnMemberMeta(const SwPaM &rPam, const bool bAbsorb)
Definition: unorefmk.cxx:778
virtual void SAL_CALL removePropertyChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: unorefmk.cxx:468
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unorefmk.cxx:176
::sw::UnoImplPtr< Impl > m_pImpl
Definition: unometa.hxx:67
virtual void SAL_CALL acquire() SAL_NOEXCEPT SAL_OVERRIDE
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getAnchor() override
Definition: unorefmk.cxx:1309
virtual bool InsertPoolItem(const SwPaM &rRg, const SfxPoolItem &, const SetAttrMode nFlags=SetAttrMode::DEFAULT, SwRootFrame const *pLayout=nullptr, SwTextAttr **ppNewTextAttr=nullptr)=0
Insert an attribute.
virtual ~SwXMetaField() override
Definition: unorefmk.cxx:1253
virtual bool DeleteAndJoin(SwPaM &, const bool bForceJoinNext=false)=0
complete delete of a given PaM
virtual void SAL_CALL removeTextContent(const css::uno::Reference< css::text::XTextContent > &xContent) override
Definition: unorefmk.cxx:1130
IDocumentContentOperations const & getIDocumentContentOperations() const
Definition: doc.cxx:315
::comphelper::OInterfaceContainerHelper2 m_EventListeners
Definition: unorefmk.cxx:610
bool m_bIsDisposed
Definition: unorefmk.cxx:613
virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL createTextCursorByRange(const css::uno::Reference< css::text::XTextRange > &xTextPosition) override
Definition: unorefmk.cxx:1096
const SwFormatRefMark & GetRefMark() const
Definition: txatbase.hxx:222
css::uno::Reference< css::beans::XPropertySetInfo > const & getPropertySetInfo() const
virtual sal_Int64 SAL_CALL getSomething(const css::uno::Sequence< sal_Int8 > &Identifier) override
Definition: unorefmk.cxx:847
SfxHintId GetId() const
virtual ~SwXMeta() override
Definition: unorefmk.cxx:683
virtual void SAL_CALL addVetoableChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &xListener) override
Definition: unorefmk.cxx:1404
virtual void Notify(const SfxHint &rHint) override
Definition: unorefmk.cxx:648
#define PROPERTY_MAP_METAFIELD
Definition: unomap.hxx:123
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...
Definition: ndtxt.cxx:3014
static OUString lcl_getPrefixOrSuffix(uno::Reference< rdf::XRepository > const &xRepository, uno::Reference< rdf::XResource > const &xMetaField, uno::Reference< rdf::XURI > const &xPredicate)
Definition: unorefmk.cxx:1445
SwXReferenceMark(SwDoc *const pDoc, SwFormatRefMark *const pMark)
Definition: unorefmk.cxx:118
const SwTextNode & GetTextNode() const
Definition: txtrfmrk.hxx:44
const SwDoc & GetDoc() const
Definition: unoobj2.cxx:767
SwIndex nContent
Definition: pam.hxx:38
virtual void SAL_CALL addVetoableChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &xListener) override
Definition: unorefmk.cxx:475
Any SAL_CALL getCaughtException()
A wrapper around SfxPoolItem to store the start position of (usually) a text portion, with an optional end.
Definition: txatbase.hxx:41
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: unorefmk.cxx:433
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > &xListener) override
Definition: unorefmk.cxx:884
virtual void SAL_CALL setPropertyValue(const OUString &rPropertyName, const css::uno::Any &rValue) override
Definition: unorefmk.cxx:1327
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
virtual OUString SAL_CALL getImplementationName() override
Definition: unorefmk.cxx:164
sal_Int32 GetStart() const
Definition: txatbase.hxx:86
css::uno::WeakReference< css::rdf::XMetadatable > const & GetXMeta() const
Definition: fmtmeta.hxx:150
virtual ~SwXReferenceMark() override
Definition: unorefmk.cxx:124
virtual void Notify(const SfxHint &) override
Definition: unorefmk.cxx:112
SwXMetaField(SwDoc *const pDoc,::sw::Meta *const pMeta, css::uno::Reference< css::text::XText > const &xParentText, std::unique_ptr< TextRangeList_t const > pPortions)
virtual void SAL_CALL dispose() override
Definition: unorefmk.cxx:892
const css::uno::Sequence< sal_Int8 > & getSeq() const
virtual void SAL_CALL dispose() override
Definition: unorefmk.cxx:328
exports com.sun.star. text
virtual sal_Bool SAL_CALL supportsService(const OUString &rServiceName) override
Definition: unorefmk.cxx:170
void EndListeningAll()
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:136
virtual void SAL_CALL setName(const OUString &rName) override
Definition: unorefmk.cxx:385
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)
Definition: docglbl.cxx:89
virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL createTextCursor() override
Definition: unorefmk.cxx:1089
virtual void SAL_CALL removeVetoableChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &xListener) override
Definition: unorefmk.cxx:482
const SwFormatRefMark * m_pMarkFormat
Definition: unorefmk.cxx:74
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > &xListener) override
Definition: unorefmk.cxx:367
SwTextMeta * GetTextAttr() const
Definition: fmtatr2.cxx:651
SwDoc & GetDoc()
Definition: node.hxx:212
virtual void SAL_CALL attach(const css::uno::Reference< css::text::XTextRange > &xTextRange) override
Definition: unorefmk.cxx:1303
const SwPosition * GetPoint() const
Definition: pam.hxx:207
void SetIsFixedLanguage(bool b)
Definition: fmtmeta.hxx:183
Impl(SwXMeta &rThis, SwDoc &rDoc,::sw::Meta *const pMeta, uno::Reference< text::XText > const &xParentText, std::unique_ptr< TextRangeList_t const > pPortions)
Definition: unorefmk.cxx:619
virtual void SAL_CALL attach(const css::uno::Reference< css::text::XTextRange > &xTextRange) override
Definition: unorefmk.cxx:269
SetAttrMode
Definition: swtypes.hxx:133
void Exchange()
Definition: pam.cxx:492
virtual OUString SAL_CALL getPresentation(sal_Bool bShowCommand) override
Definition: unorefmk.cxx:1504
void SetXMeta(css::uno::Reference< css::rdf::XMetadatable > const &xMeta)
Definition: fmtmeta.hxx:152
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
Definition: pam.hxx:205
const Any & any
uno::WeakReference< uno::XInterface > m_wThis
Definition: unorefmk.cxx:70
Force hint expand (only matters for hints with CH_TXTATR).
unsigned char sal_Bool
virtual ::sfx2::Metadatable * GetCoreObject() override
Definition: unorefmk.cxx:1215
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unorefmk.cxx:866
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getEnd() override
Definition: unorefmk.cxx:1067
virtual void SAL_CALL insertString(const css::uno::Reference< css::text::XTextRange > &xRange, const OUString &aString, sal_Bool bAbsorb) override
Definition: unorefmk.cxx:1104
css::uno::Type const & get()
virtual sal_Bool SAL_CALL supportsService(const OUString &rServiceName) override
Definition: unorefmk.cxx:860
SwNodes & GetNodes()
Node is in which nodes-array/doc?
Definition: node.hxx:694
virtual sal_Bool SAL_CALL hasElements() override
Definition: unorefmk.cxx:1170
bool StartListening(SvtBroadcaster &rBroadcaster)
sw::Meta * m_pMeta
Definition: unorefmk.cxx:617
static css::uno::Reference< css::text::XTextContent > CreateXReferenceMark(SwDoc &rDoc, SwFormatRefMark *pMarkFormat)
Definition: unorefmk.cxx:129
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: unorefmk.cxx:1316
virtual void SAL_CALL insertTextContent(const css::uno::Reference< css::text::XTextRange > &xRange, const css::uno::Reference< css::text::XTextContent > &xContent, sal_Bool bAbsorb) override
Definition: unorefmk.cxx:1122
uno::Reference< text::XText > m_xParentText
Definition: unorefmk.cxx:615
virtual OUString SAL_CALL getName() override
Definition: unorefmk.cxx:374
bool IsValid() const
Definition: unorefmk.cxx:90
SwTextNode * GetTextNode() const
Definition: fmtmeta.hxx:143
enumrange< T >::Iterator end(enumrange< T >)
const SwPosition * Start() const
Definition: pam.hxx:212
bool XTextRangeToSwPaM(SwUnoInternalPaM &rToFill, const uno::Reference< text::XTextRange > &xTextRange,::sw::TextRangeMode const eMode)
Definition: unoobj2.cxx:1107
void SetXRefMark(css::uno::Reference< css::text::XTextContent > const &xMark)
Definition: fmtrfmrk.hxx:69
virtual OUString SAL_CALL getString() override
Definition: unorefmk.cxx:1074
virtual OUString SAL_CALL getImplementationName() override
Definition: unorefmk.cxx:1259
SvtBroadcaster & GetNotifier()
Definition: calbck.hxx:102
void AttachImpl(const css::uno::Reference< css::text::XTextRange > &xTextRange, const sal_uInt16 nWhich)
Definition: unorefmk.cxx:925
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: unorefmk.cxx:1265
::cppu::ImplInheritanceHelper< SwXMeta, css::beans::XPropertySet, css::text::XTextField > SwXMetaField_Base
Definition: unometa.hxx:191
uno::Reference< text::XTextContent > GetNestedTextContent(SwTextNode const &rTextNode, sal_Int32 const nIndex, bool const bParent)
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:79
virtual void SAL_CALL setString(const OUString &rString) override
Definition: unorefmk.cxx:1081
css::uno::WeakReference< css::text::XTextContent > const & GetXRefMark() const
Definition: fmtrfmrk.hxx:67
#define SAL_WARN_IF(condition, area, stream)
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &rPropertyName) override
Definition: unorefmk.cxx:1360
bool m_bIsDescriptor
Definition: unorefmk.cxx:614
#define SAL_INFO(area, stream)
sal_Int32 GetIndex() const
Definition: index.hxx:91
const SwPosition * End() const
Definition: pam.hxx:217
virtual sal_Int64 SAL_CALL getSomething(const css::uno::Sequence< sal_Int8 > &rIdentifier) override
Definition: unorefmk.cxx:159
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId()
Definition: unorefmk.cxx:839
const sal_Int32 * End() const
Definition: txatbase.hxx:152
Reference< XComponentContext > getProcessComponentContext()
SwUnoPropertyMapProvider aSwMapProvider
Definition: unomap1.cxx:87
exports com.sun.star.report. meta
std::unique_ptr< const TextRangeList_t > m_pTextPortions
Definition: unorefmk.cxx:611
rtl::Reference< SwXMetaText > m_xText
Definition: unorefmk.cxx:616
const ::sw::MetaField * GetMetaField() const
Definition: unorefmk.cxx:1235
std::vector< SwTextAttr * > GetTextAttrsAt(sal_Int32 const nIndex, sal_uInt16 const nWhich) const
get the innermost text attributes covering position nIndex.
Definition: ndtxt.cxx:1678
#define PROPERTY_MAP_PARAGRAPH_EXTENSIONS
Definition: unomap.hxx:51
virtual void SAL_CALL addPropertyChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: unorefmk.cxx:1388
#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)
Definition: unorefmk.cxx:1470
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override
Definition: unorefmk.cxx:1178
SwDoc & GetDoc() const
Definition: pam.hxx:243
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &rPropertyName) override
Definition: unorefmk.cxx:450
virtual void SAL_CALL setParent(css::uno::Reference< css::uno::XInterface > const &xParent) override
Definition: unorefmk.cxx:1158
constexpr TypedWhichId< SwFormatRefMark > RES_TXTATR_REFMARK(RES_TXTATR_WITHEND_BEGIN)
virtual void SAL_CALL release() SAL_NOEXCEPT SAL_OVERRIDE
static css::uno::Reference< css::text::XTextRange > CreateXTextRange(SwDoc &rDoc, const SwPosition &rPos, const SwPosition *const pMark)
Definition: unoobj2.cxx:1214
::std::unique_ptr< XmlIdRegistry_Impl > m_pImpl
OUString getString(const Any &_rAny)
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getStart() override
Definition: unorefmk.cxx:1060
virtual css::uno::Reference< css::frame::XModel > GetModel() override
Definition: unorefmk.cxx:1220
virtual void SAL_CALL removeVetoableChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &xListener) override
Definition: unorefmk.cxx:1412
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > &xListener) override
Definition: unorefmk.cxx:1289
virtual void SAL_CALL setPropertyValue(const OUString &rPropertyName, const css::uno::Any &rValue) override
Definition: unorefmk.cxx:443
::sw::UnoImplPtr< Impl > m_pImpl
Definition: unorefmark.hxx:50
uno::Reference< text::XText > CreateParentXText(SwDoc &rDoc, const SwPosition &rPos)
Definition: unoobj2.cxx:1235
sal_uInt16 Which() const
bool SetContentRange(SwTextNode *&rpNode, sal_Int32 &rStart, sal_Int32 &rEnd) const
init params with position of the attribute content (w/out CH_TXTATR)
Definition: unorefmk.cxx:756
virtual void SAL_CALL dispose() override
Definition: unorefmk.cxx:1296
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId()
Definition: unorefmk.cxx:152
void SetNumberFormat(sal_uInt32 nNumberFormat)
Definition: fmtatr2.cxx:769
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
Definition: ndtxt.hxx:850