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();
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  const uno::Reference<lang::XUnoTunnel> xUT(xMeta, uno::UNO_QUERY);
714  SwXMeta *const pXMeta(
715  ::sw::UnoTunnelGetImplementation<SwXMeta>(xUT));
716  assert(pXMeta);
717  // NB: the meta must always be created with the complete content
718  // if SwXTextPortionEnumeration is created for a selection,
719  // it must be checked that the Meta is contained in the selection!
720  pXMeta->m_pImpl->m_pTextPortions = std::move(pPortions);
721  // ??? is this necessary?
722  if (pXMeta->m_pImpl->m_xParentText.get() != i_xParent.get())
723  {
724  SAL_WARN("sw.uno", "SwXMeta with different parent?");
725  pXMeta->m_pImpl->m_xParentText.set(i_xParent);
726  }
727  }
728  return xMeta;
729  }
730 
731  // create new SwXMeta
732  SwTextNode * const pTextNode( rMeta.GetTextNode() );
733  SAL_WARN_IF(!pTextNode, "sw.uno", "CreateXMeta: no text node?");
734  if (!pTextNode) { return nullptr; }
735  uno::Reference<text::XText> xParentText(i_xParent);
736  if (!xParentText.is())
737  {
738  SwTextMeta * const pTextAttr( rMeta.GetTextAttr() );
739  SAL_WARN_IF(!pTextAttr, "sw.uno", "CreateXMeta: no text attr?");
740  if (!pTextAttr) { return nullptr; }
741  const SwPosition aPos(*pTextNode, pTextAttr->GetStart());
742  xParentText.set( ::sw::CreateParentXText(*pTextNode->GetDoc(), aPos) );
743  }
744  if (!xParentText.is()) { return nullptr; }
745  SwXMeta *const pXMeta( (RES_TXTATR_META == rMeta.GetFormatMeta()->Which())
746  ? new SwXMeta (pTextNode->GetDoc(), &rMeta, xParentText,
747  std::move(pPortions))
748  : new SwXMetaField(pTextNode->GetDoc(), &rMeta, xParentText,
749  std::move(pPortions)));
750  // this is why the constructor is private: need to acquire pXMeta here
751  xMeta.set(pXMeta);
752  // in order to initialize the weak pointer cache in the core object
753  rMeta.SetXMeta(xMeta);
754  // need a permanent Reference to initialize m_wThis
755  pXMeta->m_pImpl->m_wThis = xMeta;
756  return xMeta;
757 }
758 
760  SwTextNode *& rpNode, sal_Int32 & rStart, sal_Int32 & rEnd ) const
761 {
762  ::sw::Meta const * const pMeta( m_pImpl->GetMeta() );
763  if (pMeta)
764  {
765  SwTextMeta const * const pTextAttr( pMeta->GetTextAttr() );
766  if (pTextAttr)
767  {
768  rpNode = pMeta->GetTextNode();
769  if (rpNode)
770  {
771  // rStart points at the first position _within_ the meta!
772  rStart = pTextAttr->GetStart() + 1;
773  rEnd = *pTextAttr->End();
774  return true;
775  }
776  }
777  }
778  return false;
779 }
780 
781 bool SwXMeta::CheckForOwnMemberMeta(const SwPaM & rPam, const bool bAbsorb)
782 {
783  SwTextNode * pTextNode;
784  sal_Int32 nMetaStart;
785  sal_Int32 nMetaEnd;
786  const bool bSuccess( SetContentRange(pTextNode, nMetaStart, nMetaEnd) );
787  OSL_ENSURE(bSuccess, "no pam?");
788  if (!bSuccess)
789  throw lang::DisposedException();
790 
791  SwPosition const * const pStartPos( rPam.Start() );
792  if (&pStartPos->nNode.GetNode() != pTextNode)
793  {
794  throw lang::IllegalArgumentException(
795  "trying to insert into a nesting text content, but start "
796  "of text range not in same paragraph as text content",
797  nullptr, 0);
798  }
799  bool bForceExpandHints(false);
800  const sal_Int32 nStartPos(pStartPos->nContent.GetIndex());
801  // not <= but < because nMetaStart is behind dummy char!
802  // not >= but > because == means insert at end!
803  if ((nStartPos < nMetaStart) || (nStartPos > nMetaEnd))
804  {
805  throw lang::IllegalArgumentException(
806  "trying to insert into a nesting text content, but start "
807  "of text range not inside text content",
808  nullptr, 0);
809  }
810  else if (nStartPos == nMetaEnd)
811  {
812  bForceExpandHints = true;
813  }
814  if (rPam.HasMark() && bAbsorb)
815  {
816  SwPosition const * const pEndPos( rPam.End() );
817  if (&pEndPos->nNode.GetNode() != pTextNode)
818  {
819  throw lang::IllegalArgumentException(
820  "trying to insert into a nesting text content, but end "
821  "of text range not in same paragraph as text content",
822  nullptr, 0);
823  }
824  const sal_Int32 nEndPos(pEndPos->nContent.GetIndex());
825  // not <= but < because nMetaStart is behind dummy char!
826  // not >= but > because == means insert at end!
827  if ((nEndPos < nMetaStart) || (nEndPos > nMetaEnd))
828  {
829  throw lang::IllegalArgumentException(
830  "trying to insert into a nesting text content, but end "
831  "of text range not inside text content",
832  nullptr, 0);
833  }
834  else if (nEndPos == nMetaEnd)
835  {
836  bForceExpandHints = true;
837  }
838  }
839  return bForceExpandHints;
840 }
841 
842 namespace
843 {
844  class theSwXMetaUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXMetaUnoTunnelId > {};
845 }
846 
847 const uno::Sequence< sal_Int8 > & SwXMeta::getUnoTunnelId()
848 {
849  return theSwXMetaUnoTunnelId::get().getSeq();
850 }
851 
852 // XUnoTunnel
853 sal_Int64 SAL_CALL
854 SwXMeta::getSomething( const uno::Sequence< sal_Int8 > & i_rId )
855 {
856  return ::sw::UnoTunnelImpl<SwXMeta>(i_rId, this);
857 }
858 
859 // XServiceInfo
860 OUString SAL_CALL
862 {
863  return "SwXMeta";
864 }
865 
866 sal_Bool SAL_CALL
867 SwXMeta::supportsService(const OUString& rServiceName)
868 {
869  return cppu::supportsService(this, rServiceName);
870 }
871 
872 uno::Sequence< OUString > SAL_CALL
874 {
875  return {
876  "com.sun.star.text.TextContent",
877  "com.sun.star.text.InContentMetadata"
878  };
879 }
880 
881 // XComponent
882 void SAL_CALL
884  uno::Reference< lang::XEventListener> const & xListener )
885 {
886  // no need to lock here as m_pImpl is const and container threadsafe
887  m_pImpl->m_EventListeners.addInterface(xListener);
888 }
889 
890 void SAL_CALL
892  uno::Reference< lang::XEventListener> const & xListener )
893 {
894  // no need to lock here as m_pImpl is const and container threadsafe
895  m_pImpl->m_EventListeners.removeInterface(xListener);
896 }
897 
898 void SAL_CALL
900 {
901  SolarMutexGuard g;
902 
903  if (m_pImpl->m_bIsDescriptor)
904  {
905  m_pImpl->m_pTextPortions.reset();
906  lang::EventObject const ev(static_cast< ::cppu::OWeakObject&>(*this));
907  m_pImpl->m_EventListeners.disposeAndClear(ev);
908  m_pImpl->m_bIsDisposed = true;
909  m_pImpl->m_xText->Invalidate();
910  }
911  else if (!m_pImpl->m_bIsDisposed)
912  {
913  SwTextNode * pTextNode;
914  sal_Int32 nMetaStart;
915  sal_Int32 nMetaEnd;
916  const bool bSuccess(SetContentRange(pTextNode, nMetaStart, nMetaEnd));
917  OSL_ENSURE(bSuccess, "no pam?");
918  if (bSuccess)
919  {
920  // -1 because of CH_TXTATR
921  SwPaM aPam( *pTextNode, nMetaStart - 1, *pTextNode, nMetaEnd );
922  SwDoc * const pDoc( pTextNode->GetDoc() );
924 
925  // removal should call Modify and do the dispose
926  assert(m_pImpl->m_bIsDisposed);
927  }
928  }
929 }
930 
931 void
932 SwXMeta::AttachImpl(const uno::Reference< text::XTextRange > & i_xTextRange,
933  const sal_uInt16 i_nWhich)
934 {
935  SolarMutexGuard g;
936 
937  if (m_pImpl->m_bIsDisposed)
938  {
939  throw lang::DisposedException();
940  }
941  if (!m_pImpl->m_bIsDescriptor)
942  {
943  throw uno::RuntimeException(
944  "SwXMeta::attach(): already attached",
945  static_cast< ::cppu::OWeakObject* >(this));
946  }
947 
948  uno::Reference<lang::XUnoTunnel> xRangeTunnel(i_xTextRange, uno::UNO_QUERY);
949  if (!xRangeTunnel.is())
950  {
951  throw lang::IllegalArgumentException(
952  "SwXMeta::attach(): argument is no XUnoTunnel",
953  static_cast< ::cppu::OWeakObject* >(this), 0);
954  }
955  SwXTextRange *const pRange(
956  ::sw::UnoTunnelGetImplementation<SwXTextRange>(xRangeTunnel));
957  OTextCursorHelper *const pCursor( pRange ? nullptr :
958  ::sw::UnoTunnelGetImplementation<OTextCursorHelper>(xRangeTunnel));
959  if (!pRange && !pCursor)
960  {
961  throw lang::IllegalArgumentException(
962  "SwXMeta::attach(): argument not supported type",
963  static_cast< ::cppu::OWeakObject* >(this), 0);
964  }
965 
966  SwDoc * const pDoc(
967  pRange ? &pRange->GetDoc() : pCursor->GetDoc());
968  if (!pDoc)
969  {
970  throw lang::IllegalArgumentException(
971  "SwXMeta::attach(): argument has no SwDoc",
972  static_cast< ::cppu::OWeakObject* >(this), 0);
973  }
974 
975  SwUnoInternalPaM aPam(*pDoc);
976  ::sw::XTextRangeToSwPaM(aPam, i_xTextRange);
977 
978  UnoActionContext aContext(pDoc);
979 
980  SwXTextCursor const*const pTextCursor(
981  dynamic_cast<SwXTextCursor*>(pCursor));
982  const bool bForceExpandHints(pTextCursor && pTextCursor->IsAtEndOfMeta());
983  const SetAttrMode nInsertFlags( bForceExpandHints
987 
988  const std::shared_ptr< ::sw::Meta> pMeta( (RES_TXTATR_META == i_nWhich)
989  ? std::make_shared< ::sw::Meta>( nullptr )
990  : std::shared_ptr< ::sw::Meta>(
991  pDoc->GetMetaFieldManager().makeMetaField()) );
992  SwFormatMeta meta(pMeta, i_nWhich); // this is cloned by Insert!
993  const bool bSuccess( pDoc->getIDocumentContentOperations().InsertPoolItem( aPam, meta, nInsertFlags ) );
994  SwTextAttr * const pTextAttr( pMeta->GetTextAttr() );
995  if (!bSuccess)
996  {
997  throw lang::IllegalArgumentException(
998  "SwXMeta::attach(): cannot create meta: range invalid?",
999  static_cast< ::cppu::OWeakObject* >(this), 1);
1000  }
1001  if (!pTextAttr)
1002  {
1003  OSL_FAIL("meta inserted, but has no text attribute?");
1004  throw uno::RuntimeException(
1005  "SwXMeta::attach(): cannot create meta",
1006  static_cast< ::cppu::OWeakObject* >(this));
1007  }
1008 
1009  m_pImpl->EndListeningAll();
1010  m_pImpl->m_pMeta = pMeta.get();
1011  m_pImpl->StartListening(pMeta->GetNotifier());
1012  pMeta->SetXMeta(uno::Reference<rdf::XMetadatable>(this));
1013 
1014  m_pImpl->m_xParentText = ::sw::CreateParentXText(*pDoc, *aPam.GetPoint());
1015 
1016  m_pImpl->m_bIsDescriptor = false;
1017 }
1018 
1019 // XTextContent
1020 void SAL_CALL
1021 SwXMeta::attach(const uno::Reference< text::XTextRange > & i_xTextRange)
1022 {
1023  return SwXMeta::AttachImpl(i_xTextRange, RES_TXTATR_META);
1024 }
1025 
1026 uno::Reference< text::XTextRange > SAL_CALL
1028 {
1029  SolarMutexGuard g;
1030 
1031  if (m_pImpl->m_bIsDisposed)
1032  {
1033  throw lang::DisposedException();
1034  }
1035  if (m_pImpl->m_bIsDescriptor)
1036  {
1037  throw uno::RuntimeException(
1038  "SwXMeta::getAnchor(): not inserted",
1039  static_cast< ::cppu::OWeakObject* >(this));
1040  }
1041 
1042  SwTextNode * pTextNode;
1043  sal_Int32 nMetaStart;
1044  sal_Int32 nMetaEnd;
1045  const bool bSuccess(SetContentRange(pTextNode, nMetaStart, nMetaEnd));
1046  OSL_ENSURE(bSuccess, "no pam?");
1047  if (!bSuccess)
1048  {
1049  throw lang::DisposedException(
1050  "SwXMeta::getAnchor(): not attached",
1051  static_cast< ::cppu::OWeakObject* >(this));
1052  }
1053 
1054  const SwPosition start(*pTextNode, nMetaStart - 1); // -1 due to CH_TXTATR
1055  const SwPosition end(*pTextNode, nMetaEnd);
1056  return SwXTextRange::CreateXTextRange(*pTextNode->GetDoc(), start, &end);
1057 }
1058 
1059 // XTextRange
1060 uno::Reference< text::XText > SAL_CALL
1062 {
1063  return this;
1064 }
1065 
1066 uno::Reference< text::XTextRange > SAL_CALL
1068 {
1069  SolarMutexGuard g;
1070  return m_pImpl->m_xText->getStart();
1071 }
1072 
1073 uno::Reference< text::XTextRange > SAL_CALL
1075 {
1076  SolarMutexGuard g;
1077  return m_pImpl->m_xText->getEnd();
1078 }
1079 
1080 OUString SAL_CALL
1082 {
1083  SolarMutexGuard g;
1084  return m_pImpl->m_xText->getString();
1085 }
1086 
1087 void SAL_CALL
1088 SwXMeta::setString(const OUString& rString)
1089 {
1090  SolarMutexGuard g;
1091  return m_pImpl->m_xText->setString(rString);
1092 }
1093 
1094 // XSimpleText
1095 uno::Reference< text::XTextCursor > SAL_CALL
1097 {
1098  SolarMutexGuard g;
1099  return m_pImpl->m_xText->createTextCursor();
1100 }
1101 
1102 uno::Reference< text::XTextCursor > SAL_CALL
1104  const uno::Reference<text::XTextRange> & xTextPosition)
1105 {
1106  SolarMutexGuard g;
1107  return m_pImpl->m_xText->createTextCursorByRange(xTextPosition);
1108 }
1109 
1110 void SAL_CALL
1111 SwXMeta::insertString(const uno::Reference<text::XTextRange> & xRange,
1112  const OUString& rString, sal_Bool bAbsorb)
1113 {
1114  SolarMutexGuard g;
1115  return m_pImpl->m_xText->insertString(xRange, rString, bAbsorb);
1116 }
1117 
1118 void SAL_CALL
1119 SwXMeta::insertControlCharacter(const uno::Reference<text::XTextRange> & xRange,
1120  sal_Int16 nControlCharacter, sal_Bool bAbsorb)
1121 {
1122  SolarMutexGuard g;
1123  return m_pImpl->m_xText->insertControlCharacter(xRange, nControlCharacter,
1124  bAbsorb);
1125 }
1126 
1127 // XText
1128 void SAL_CALL
1129 SwXMeta::insertTextContent( const uno::Reference<text::XTextRange> & xRange,
1130  const uno::Reference<text::XTextContent> & xContent, sal_Bool bAbsorb)
1131 {
1132  SolarMutexGuard g;
1133  return m_pImpl->m_xText->insertTextContent(xRange, xContent, bAbsorb);
1134 }
1135 
1136 void SAL_CALL
1138  const uno::Reference< text::XTextContent > & xContent)
1139 {
1140  SolarMutexGuard g;
1141  return m_pImpl->m_xText->removeTextContent(xContent);
1142 }
1143 
1144 // XChild
1145 uno::Reference< uno::XInterface > SAL_CALL
1147 {
1148  SolarMutexGuard g;
1149  SwTextNode * pTextNode;
1150  sal_Int32 nMetaStart;
1151  sal_Int32 nMetaEnd;
1152  bool const bSuccess( SetContentRange(pTextNode, nMetaStart, nMetaEnd) );
1153  OSL_ENSURE(bSuccess, "no pam?");
1154  if (!bSuccess) { throw lang::DisposedException(); }
1155  // in order to prevent getting this meta, subtract 1 from nMetaStart;
1156  // so we get the index of the dummy character, and we exclude it
1157  // by calling GetTextAttrAt(_, _, PARENT) in GetNestedTextContent
1158  uno::Reference<text::XTextContent> const xRet(
1159  SwUnoCursorHelper::GetNestedTextContent(*pTextNode, nMetaStart - 1,
1160  true) );
1161  return xRet;
1162 }
1163 
1164 void SAL_CALL
1165 SwXMeta::setParent(uno::Reference< uno::XInterface > const& /*xParent*/)
1166 {
1167  throw lang::NoSupportException("setting parent not supported", *this);
1168 }
1169 
1170 // XElementAccess
1171 uno::Type SAL_CALL
1173 {
1175 }
1176 
1178 {
1179  SolarMutexGuard g;
1180  return m_pImpl->m_pMeta != nullptr;
1181 }
1182 
1183 // XEnumerationAccess
1184 uno::Reference< container::XEnumeration > SAL_CALL
1186 {
1187  SolarMutexGuard g;
1188 
1189  if (m_pImpl->m_bIsDisposed)
1190  {
1191  throw lang::DisposedException();
1192  }
1193  if (m_pImpl->m_bIsDescriptor)
1194  {
1195  throw uno::RuntimeException(
1196  "createEnumeration(): not inserted",
1197  static_cast< ::cppu::OWeakObject* >(this));
1198  }
1199 
1200  SwTextNode * pTextNode;
1201  sal_Int32 nMetaStart;
1202  sal_Int32 nMetaEnd;
1203  const bool bSuccess(SetContentRange(pTextNode, nMetaStart, nMetaEnd));
1204  OSL_ENSURE(bSuccess, "no pam?");
1205  if (!bSuccess)
1206  throw lang::DisposedException();
1207 
1208  SwPaM aPam(*pTextNode, nMetaStart);
1209 
1210  if (!m_pImpl->m_pTextPortions)
1211  {
1212  return new SwXTextPortionEnumeration(
1213  aPam, GetParentText(), nMetaStart, nMetaEnd);
1214  }
1215  else // cached!
1216  {
1217  return new SwXTextPortionEnumeration(aPam, *m_pImpl->m_pTextPortions);
1218  }
1219 }
1220 
1221 // MetadatableMixin
1223 {
1224  return const_cast< ::sw::Meta * >(m_pImpl->GetMeta());
1225 }
1226 
1227 uno::Reference<frame::XModel> SwXMeta::GetModel()
1228 {
1229  ::sw::Meta const * const pMeta( m_pImpl->GetMeta() );
1230  if (pMeta)
1231  {
1232  SwTextNode const * const pTextNode( pMeta->GetTextNode() );
1233  if (pTextNode)
1234  {
1235  SwDocShell const * const pShell(pTextNode->GetDoc()->GetDocShell());
1236  return pShell ? pShell->GetModel() : nullptr;
1237  }
1238  }
1239  return nullptr;
1240 }
1241 
1242 inline const ::sw::MetaField* SwXMeta::Impl::GetMetaField() const
1243 {
1244  return dynamic_cast<sw::MetaField*>(m_pMeta);
1245 }
1246 
1247 SwXMetaField::SwXMetaField(SwDoc *const pDoc, ::sw::Meta *const pMeta,
1248  uno::Reference<text::XText> const& xParentText,
1249  std::unique_ptr<TextRangeList_t const> pPortions)
1250  : SwXMetaField_Base(pDoc, pMeta, xParentText, std::move(pPortions))
1251 {
1252  OSL_ENSURE(dynamic_cast< ::sw::MetaField* >(pMeta),
1253  "SwXMetaField created for wrong hint!");
1254 }
1255 
1257  : SwXMetaField_Base(pDoc)
1258 {
1259 }
1260 
1262 {
1263 }
1264 
1265 // XServiceInfo
1266 OUString SAL_CALL
1268 {
1269  return "SwXMetaField";
1270 }
1271 
1272 sal_Bool SAL_CALL
1273 SwXMetaField::supportsService(const OUString& rServiceName)
1274 {
1275  return cppu::supportsService(this, rServiceName);
1276 }
1277 
1278 uno::Sequence< OUString > SAL_CALL
1280 {
1281  return {
1282  "com.sun.star.text.TextContent",
1283  "com.sun.star.text.TextField",
1284  "com.sun.star.text.textfield.MetadataField"
1285  };
1286 }
1287 
1288 // XComponent
1289 void SAL_CALL
1291  uno::Reference< lang::XEventListener> const & xListener )
1292 {
1293  return SwXMeta::addEventListener(xListener);
1294 }
1295 
1296 void SAL_CALL
1298  uno::Reference< lang::XEventListener> const & xListener )
1299 {
1300  return SwXMeta::removeEventListener(xListener);
1301 }
1302 
1303 void SAL_CALL
1305 {
1306  return SwXMeta::dispose();
1307 }
1308 
1309 // XTextContent
1310 void SAL_CALL
1311 SwXMetaField::attach(const uno::Reference< text::XTextRange > & i_xTextRange)
1312 {
1313  return SwXMeta::AttachImpl(i_xTextRange, RES_TXTATR_METAFIELD);
1314 }
1315 
1316 uno::Reference< text::XTextRange > SAL_CALL
1318 {
1319  return SwXMeta::getAnchor();
1320 }
1321 
1322 // XPropertySet
1323 uno::Reference< beans::XPropertySetInfo > SAL_CALL
1325 {
1326  SolarMutexGuard g;
1327 
1328  static uno::Reference< beans::XPropertySetInfo > xRef(
1330  ->getPropertySetInfo() );
1331  return xRef;
1332 }
1333 
1334 void SAL_CALL
1336  const OUString& rPropertyName, const uno::Any& rValue)
1337 {
1338  SolarMutexGuard g;
1339 
1340  ::sw::MetaField * const pMeta(
1341  const_cast< ::sw::MetaField * >(m_pImpl->GetMetaField()) );
1342  if (!pMeta)
1343  throw lang::DisposedException();
1344 
1345  if ( rPropertyName == "NumberFormat" )
1346  {
1347  sal_Int32 nNumberFormat(0);
1348  if (rValue >>= nNumberFormat)
1349  {
1350  pMeta->SetNumberFormat(static_cast<sal_uInt32>(nNumberFormat));
1351  }
1352  }
1353  else if ( rPropertyName == "IsFixedLanguage" )
1354  {
1355  bool b(false);
1356  if (rValue >>= b)
1357  {
1358  pMeta->SetIsFixedLanguage(b);
1359  }
1360  }
1361  else
1362  {
1363  throw beans::UnknownPropertyException();
1364  }
1365 }
1366 
1367 uno::Any SAL_CALL
1368 SwXMetaField::getPropertyValue(const OUString& rPropertyName)
1369 {
1370  SolarMutexGuard g;
1371 
1372  ::sw::MetaField const * const pMeta( m_pImpl->GetMetaField() );
1373  if (!pMeta)
1374  throw lang::DisposedException();
1375 
1376  uno::Any any;
1377 
1378  if ( rPropertyName == "NumberFormat" )
1379  {
1380  const OUString text( getPresentation(false) );
1381  any <<= static_cast<sal_Int32>(pMeta->GetNumberFormat(text));
1382  }
1383  else if ( rPropertyName == "IsFixedLanguage" )
1384  {
1385  any <<= pMeta->IsFixedLanguage();
1386  }
1387  else
1388  {
1389  throw beans::UnknownPropertyException();
1390  }
1391 
1392  return any;
1393 }
1394 
1395 void SAL_CALL
1397  const OUString& /*rPropertyName*/,
1398  const uno::Reference< beans::XPropertyChangeListener >& /*xListener*/)
1399 {
1400  OSL_FAIL("SwXMetaField::addPropertyChangeListener(): not implemented");
1401 }
1402 
1403 void SAL_CALL
1405  const OUString& /*rPropertyName*/,
1406  const uno::Reference< beans::XPropertyChangeListener >& /*xListener*/)
1407 {
1408  OSL_FAIL("SwXMetaField::removePropertyChangeListener(): not implemented");
1409 }
1410 
1411 void SAL_CALL
1413  const OUString& /*rPropertyName*/,
1414  const uno::Reference< beans::XVetoableChangeListener >& /*xListener*/)
1415 {
1416  OSL_FAIL("SwXMetaField::addVetoableChangeListener(): not implemented");
1417 }
1418 
1419 void SAL_CALL
1421  const OUString& /*rPropertyName*/,
1422  const uno::Reference< beans::XVetoableChangeListener >& /*xListener*/)
1423 {
1424  OSL_FAIL("SwXMetaField::removeVetoableChangeListener(): not implemented");
1425 }
1426 
1427 static uno::Reference<rdf::XURI> const&
1428 lcl_getURI(const bool bPrefix)
1429 {
1430  static uno::Reference< uno::XComponentContext > xContext(
1432  static uno::Reference< rdf::XURI > xOdfPrefix(
1433  rdf::URI::createKnown(xContext, rdf::URIs::ODF_PREFIX),
1434  uno::UNO_SET_THROW);
1435  static uno::Reference< rdf::XURI > xOdfSuffix(
1436  rdf::URI::createKnown(xContext, rdf::URIs::ODF_SUFFIX),
1437  uno::UNO_SET_THROW);
1438  return bPrefix ? xOdfPrefix : xOdfSuffix;
1439 }
1440 
1441 static OUString
1443  uno::Reference<rdf::XRepository> const & xRepository,
1444  uno::Reference<rdf::XResource> const & xMetaField,
1445  uno::Reference<rdf::XURI> const & xPredicate)
1446 {
1447  const uno::Reference<container::XEnumeration> xEnum(
1448  xRepository->getStatements(xMetaField, xPredicate, nullptr),
1449  uno::UNO_SET_THROW);
1450  while (xEnum->hasMoreElements()) {
1451  rdf::Statement stmt;
1452  if (!(xEnum->nextElement() >>= stmt)) {
1453  throw uno::RuntimeException();
1454  }
1455  const uno::Reference<rdf::XLiteral> xObject(stmt.Object,
1456  uno::UNO_QUERY);
1457  if (!xObject.is()) continue;
1458  if (xEnum->hasMoreElements()) {
1459  SAL_INFO("sw.uno", "ignoring other odf:Prefix/odf:Suffix statements");
1460  }
1461  return xObject->getValue();
1462  }
1463  return OUString();
1464 }
1465 
1466 void
1468  const uno::Reference<frame::XModel>& xModel,
1469  const uno::Reference<rdf::XMetadatable>& xMetaField,
1470  OUString *const o_pPrefix, OUString *const o_pSuffix)
1471 {
1472  try {
1473  const uno::Reference<rdf::XRepositorySupplier> xRS(
1474  xModel, uno::UNO_QUERY_THROW);
1475  const uno::Reference<rdf::XRepository> xRepo(
1476  xRS->getRDFRepository(), uno::UNO_SET_THROW);
1477  const uno::Reference<rdf::XResource> xMeta(
1478  xMetaField, uno::UNO_QUERY_THROW);
1479  if (o_pPrefix)
1480  {
1481  *o_pPrefix = lcl_getPrefixOrSuffix(xRepo, xMeta, lcl_getURI(true));
1482  }
1483  if (o_pSuffix)
1484  {
1485  *o_pSuffix = lcl_getPrefixOrSuffix(xRepo, xMeta, lcl_getURI(false));
1486  }
1487  } catch (uno::RuntimeException &) {
1488  throw;
1489  } catch (const uno::Exception &) {
1490  css::uno::Any anyEx = cppu::getCaughtException();
1491  throw lang::WrappedTargetRuntimeException("getPrefixAndSuffix: exception", nullptr, anyEx);
1492  }
1493 }
1494 
1495 // XTextField
1496 OUString SAL_CALL
1498 {
1499  SolarMutexGuard g;
1500 
1501  if (bShowCommand)
1502  {
1503 //FIXME ?
1504  return OUString();
1505  }
1506  else
1507  {
1508  // getString should check if this is invalid
1509  const OUString content( getString() );
1510  OUString prefix;
1511  OUString suffix;
1512  getPrefixAndSuffix(GetModel(), this, &prefix, &suffix);
1513  return prefix + content + suffix;
1514  }
1515 }
1516 
1517 /* 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:1021
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unorefmk.cxx:1279
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:1061
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:1428
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:1172
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:1027
virtual void SAL_CALL removePropertyChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: unorefmk.cxx:1404
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:139
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:1146
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:1098
Definition: doc.hxx:185
virtual OUString SAL_CALL getImplementationName() override
Definition: unorefmk.cxx:861
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:1290
void disposeAndClear(const css::lang::EventObject &rEvt)
bool IsAtEndOfMeta() const
Definition: unoobj.cxx:803
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:1119
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &xListener) override
Definition: unorefmk.cxx:883
bool CheckForOwnMemberMeta(const SwPaM &rPam, const bool bAbsorb)
Definition: unorefmk.cxx:781
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:1317
css::uno::Reference< css::frame::XModel > GetModel() const
virtual ~SwXMetaField() override
Definition: unorefmk.cxx:1261
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:1137
IDocumentContentOperations const & getIDocumentContentOperations() const
Definition: doc.cxx:347
::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:1103
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:854
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:1412
virtual void Notify(const SfxHint &rHint) override
Definition: unorefmk.cxx:650
#define PROPERTY_MAP_METAFIELD
Definition: unomap.hxx:126
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:3059
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:1442
SwXReferenceMark(SwDoc *const pDoc, SwFormatRefMark *const pMark)
Definition: unorefmk.cxx:120
#define RES_TXTATR_META
Definition: hintids.hxx:138
const SwTextNode & GetTextNode() const
Definition: txtrfmrk.hxx:44
const SwDoc & GetDoc() const
Definition: unoobj2.cxx:789
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:891
virtual void SAL_CALL setPropertyValue(const OUString &rPropertyName, const css::uno::Any &rValue) override
Definition: unorefmk.cxx:1335
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:1008
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:899
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:1888
static SwNodePtr GetStartNode(SwOutlineNodes const *pOutlNds, int nOutlineLevel, SwOutlineNodes::size_type *nOutl)
Definition: docglbl.cxx:90
virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL createTextCursor() override
Definition: unorefmk.cxx:1096
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:652
virtual void SAL_CALL attach(const css::uno::Reference< css::text::XTextRange > &xTextRange) override
Definition: unorefmk.cxx:1311
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:1497
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:1222
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unorefmk.cxx:873
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getEnd() override
Definition: unorefmk.cxx:1074
virtual void SAL_CALL insertString(const css::uno::Reference< css::text::XTextRange > &xRange, const OUString &aString, sal_Bool bAbsorb) override
Definition: unorefmk.cxx:1111
css::uno::Type const & get()
virtual sal_Bool SAL_CALL supportsService(const OUString &rServiceName) override
Definition: unorefmk.cxx:867
SwNodes & GetNodes()
Node is in which nodes-array/doc?
Definition: node.hxx:693
virtual sal_Bool SAL_CALL hasElements() override
Definition: unorefmk.cxx:1177
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:1324
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:1129
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:1081
virtual OUString SAL_CALL getImplementationName() override
Definition: unorefmk.cxx:1267
SvtBroadcaster & GetNotifier()
Definition: calbck.hxx:93
void AttachImpl(const css::uno::Reference< css::text::XTextRange > &xTextRange, const sal_uInt16 nWhich)
Definition: unorefmk.cxx:932
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: unorefmk.cxx:1273
::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:1088
bool operator()(T const &rT)
Definition: unoidx.cxx:1891
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:1467
#define SAL_WARN_IF(condition, area, stream)
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &rPropertyName) override
Definition: unorefmk.cxx:1368
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:847
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:136
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:1242
std::vector< SwTextAttr * > GetTextAttrsAt(sal_Int32 const nIndex, sal_uInt16 const nWhich) const
get the innermost text attributes covering position nIndex.
Definition: ndtxt.cxx:1718
#define PROPERTY_MAP_PARAGRAPH_EXTENSIONS
Definition: unomap.hxx:53
virtual void SAL_CALL addPropertyChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: unorefmk.cxx:1396
#define SAL_WARN(area, stream)
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override
Definition: unorefmk.cxx:1185
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:1165
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:1112
OUString getString(const Any &_rAny)
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getStart() override
Definition: unorefmk.cxx:1067
virtual css::uno::Reference< css::frame::XModel > GetModel() override
Definition: unorefmk.cxx:1227
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:1420
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > &xListener) override
Definition: unorefmk.cxx:1297
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:1133
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:759
virtual void SAL_CALL dispose() override
Definition: unorefmk.cxx:1304
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:769
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
Definition: ndtxt.hxx:843