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