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