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