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