LibreOffice Module sw (master)  1
unocontentcontrol.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 <unocontentcontrol.hxx>
21 
22 #include <mutex>
23 
24 #include <com/sun/star/text/XWordCursor.hpp>
25 
29 
30 #include <formatcontentcontrol.hxx>
31 #include <ndtxt.hxx>
32 #include <textcontentcontrol.hxx>
33 #include <unotext.hxx>
34 #include <unotextcursor.hxx>
35 #include <unotextrange.hxx>
36 #include <doc.hxx>
37 #include <unoport.hxx>
38 #include <unomap.hxx>
39 #include <unoprnms.hxx>
40 
41 using namespace com::sun::star;
42 
43 namespace
44 {
46 class SwXContentControlText : public cppu::OWeakObject, public SwXText
47 {
48 private:
49  SwXContentControl& m_rContentControl;
50 
51  void PrepareForAttach(uno::Reference<text::XTextRange>& xRange, const SwPaM& rPam) override;
52 
53 protected:
54  const SwStartNode* GetStartNode() const override;
55  uno::Reference<text::XTextCursor> CreateCursor() override;
56 
57 public:
58  SwXContentControlText(SwDoc& rDoc, SwXContentControl& rContentControl);
59 
61  using SwXText::Invalidate;
62 
63  // XInterface
64  void SAL_CALL acquire() noexcept override { cppu::OWeakObject::acquire(); }
65  void SAL_CALL release() noexcept override { cppu::OWeakObject::release(); }
66 
67  // XTypeProvider
68  uno::Sequence<sal_Int8> SAL_CALL getImplementationId() override;
69 
70  // XText
71  uno::Reference<text::XTextCursor> SAL_CALL createTextCursor() override;
72  uno::Reference<text::XTextCursor> SAL_CALL
73  createTextCursorByRange(const uno::Reference<text::XTextRange>& xTextPosition) override;
74 };
75 }
76 
77 SwXContentControlText::SwXContentControlText(SwDoc& rDoc, SwXContentControl& rContentControl)
79  , m_rContentControl(rContentControl)
80 {
81 }
82 
84 {
85  auto pParent = dynamic_cast<SwXText*>(m_rContentControl.GetParentText().get());
86  return pParent ? pParent->GetStartNode() : nullptr;
87 }
88 
89 void SwXContentControlText::PrepareForAttach(uno::Reference<text::XTextRange>& xRange,
90  const SwPaM& rPam)
91 {
92  // Create a new cursor to prevent modifying SwXTextRange.
93  xRange = static_cast<text::XWordCursor*>(
94  new SwXTextCursor(*GetDoc(), &m_rContentControl, CursorType::ContentControl,
95  *rPam.GetPoint(), (rPam.HasMark()) ? rPam.GetMark() : nullptr));
96 }
97 
98 uno::Reference<text::XTextCursor> SwXContentControlText::CreateCursor()
99 {
100  uno::Reference<text::XTextCursor> xRet;
101  if (IsValid())
102  {
103  SwTextNode* pTextNode;
104  sal_Int32 nContentControlStart;
105  sal_Int32 nContentControlEnd;
106  bool bSuccess = m_rContentControl.SetContentRange(pTextNode, nContentControlStart,
107  nContentControlEnd);
108  if (bSuccess)
109  {
110  SwPosition aPos(*pTextNode, nContentControlStart);
111  xRet = static_cast<text::XWordCursor*>(
112  new SwXTextCursor(*GetDoc(), &m_rContentControl, CursorType::ContentControl, aPos));
113  }
114  }
115  return xRet;
116 }
117 
118 uno::Sequence<sal_Int8> SAL_CALL SwXContentControlText::getImplementationId()
119 {
120  return css::uno::Sequence<sal_Int8>();
121 }
122 
123 // XText
124 uno::Reference<text::XTextCursor> SAL_CALL SwXContentControlText::createTextCursor()
125 {
126  return CreateCursor();
127 }
128 
129 uno::Reference<text::XTextCursor> SAL_CALL SwXContentControlText::createTextCursorByRange(
130  const uno::Reference<text::XTextRange>& xTextPosition)
131 {
132  const uno::Reference<text::XTextCursor> xCursor(CreateCursor());
133  xCursor->gotoRange(xTextPosition, false);
134  return xCursor;
135 }
136 
145 {
146 public:
147  uno::WeakReference<uno::XInterface> m_wThis;
148  // Just for OInterfaceContainerHelper4.
149  std::mutex m_Mutex;
151  std::unique_ptr<const TextRangeList_t> m_pTextPortions;
152  // 3 possible states: not attached, attached, disposed
155  uno::Reference<text::XText> m_xParentText;
161  OUString m_aCheckedState;
163  std::vector<SwContentControlListItem> m_aListItems;
165  bool m_bDate;
166  OUString m_aDateFormat;
167  OUString m_aDateLanguage;
168  OUString m_aCurrentDate;
173  OUString m_aColor;
174 
175  Impl(SwXContentControl& rThis, SwDoc& rDoc, SwContentControl* pContentControl,
176  const uno::Reference<text::XText>& xParentText,
177  std::unique_ptr<const TextRangeList_t> pPortions)
178  : m_pTextPortions(std::move(pPortions))
179  , m_bIsDisposed(false)
180  , m_bIsDescriptor(pContentControl == nullptr)
181  , m_xParentText(xParentText)
182  , m_xText(new SwXContentControlText(rDoc, rThis))
183  , m_pContentControl(pContentControl)
184  , m_bShowingPlaceHolder(false)
185  , m_bCheckbox(false)
186  , m_bChecked(false)
187  , m_bPicture(false)
188  , m_bDate(false)
189  {
190  if (m_pContentControl)
191  {
192  StartListening(m_pContentControl->GetNotifier());
193  }
194  }
195 
196  const SwContentControl* GetContentControl() const;
197 
198 protected:
199  void Notify(const SfxHint& rHint) override;
200 };
201 
203 {
204  return m_pContentControl;
205 }
206 
207 // sw::BroadcastingModify
209 {
210  // throw away cache (SwTextNode changed)
211  m_pTextPortions.reset();
212 
213  if (rHint.GetId() != SfxHintId::Dying && rHint.GetId() != SfxHintId::Deinitializing)
214  return;
215 
216  m_bIsDisposed = true;
217  m_pContentControl = nullptr;
218  m_xText->Invalidate();
219  uno::Reference<uno::XInterface> xThis(m_wThis);
220  if (!xThis.is())
221  {
222  // If UNO object is already dead, don't refer to it in an event.
223  return;
224  }
225  lang::EventObject aEvent(xThis);
226  std::unique_lock aGuard(m_Mutex);
227  m_EventListeners.disposeAndClear(aGuard, aEvent);
228 }
229 
230 const uno::Reference<text::XText>& SwXContentControl::GetParentText() const
231 {
232  return m_pImpl->m_xParentText;
233 }
234 
236  const uno::Reference<text::XText>& xParentText,
237  std::unique_ptr<const TextRangeList_t> pPortions)
238  : m_pImpl(new SwXContentControl::Impl(*this, *pDoc, pContentControl, xParentText,
239  std::move(pPortions)))
240 {
241 }
242 
244  : m_pImpl(new SwXContentControl::Impl(*this, *pDoc, nullptr, nullptr, nullptr))
245 {
246 }
247 
249 
250 uno::Reference<text::XTextContent> SwXContentControl::CreateXContentControl(SwDoc& rDoc)
251 {
252  rtl::Reference<SwXContentControl> xContentControl(new SwXContentControl(&rDoc));
253  uno::Reference<text::XTextContent> xTextContent(xContentControl);
254  xContentControl->m_pImpl->m_wThis = xTextContent;
255  return xContentControl;
256 }
257 
258 uno::Reference<text::XTextContent>
260  const uno::Reference<text::XText>& xParent,
261  std::unique_ptr<const TextRangeList_t>&& pPortions)
262 {
263  // re-use existing SwXContentControl
264  uno::Reference<text::XTextContent> xContentControl(rContentControl.GetXContentControl());
265  if (xContentControl.is())
266  {
267  if (pPortions)
268  {
269  // Set the cache in the XContentControl to the given portions.
270  auto pXContentControl
271  = comphelper::getFromUnoTunnel<SwXContentControl>(xContentControl);
272  assert(pXContentControl);
273  // The content control must always be created with the complete content. If
274  // SwXTextPortionEnumeration is created for a selection, it must be checked that the
275  // content control is contained in the selection.
276  pXContentControl->m_pImpl->m_pTextPortions = std::move(pPortions);
277  if (pXContentControl->m_pImpl->m_xParentText.get() != xParent.get())
278  {
279  SAL_WARN("sw.uno", "SwXContentControl with different parent");
280  pXContentControl->m_pImpl->m_xParentText.set(xParent);
281  }
282  }
283  return xContentControl;
284  }
285 
286  // Create new SwXContentControl.
287  SwTextNode* pTextNode = rContentControl.GetTextNode();
288  if (!pTextNode)
289  {
290  SAL_WARN("sw.uno", "CreateXContentControl: no text node");
291  return nullptr;
292  }
293  uno::Reference<text::XText> xParentText(xParent);
294  if (!xParentText.is())
295  {
296  SwTextContentControl* pTextAttr = rContentControl.GetTextAttr();
297  if (!pTextAttr)
298  {
299  SAL_WARN("sw.uno", "CreateXContentControl: no text attr");
300  return nullptr;
301  }
302  SwPosition aPos(*pTextNode, pTextAttr->GetStart());
303  xParentText.set(sw::CreateParentXText(pTextNode->GetDoc(), aPos));
304  }
305  if (!xParentText.is())
306  {
307  return nullptr;
308  }
310  &pTextNode->GetDoc(), &rContentControl, xParentText, std::move(pPortions));
311  xContentControl.set(pXContentControl);
312  rContentControl.SetXContentControl(xContentControl);
313  pXContentControl->m_pImpl->m_wThis = xContentControl;
314  return xContentControl;
315 }
316 
317 bool SwXContentControl::SetContentRange(SwTextNode*& rpNode, sal_Int32& rStart,
318  sal_Int32& rEnd) const
319 {
320  const SwContentControl* pContentControl = m_pImpl->GetContentControl();
321  if (pContentControl)
322  {
323  const SwTextContentControl* pTextAttr = pContentControl->GetTextAttr();
324  if (pTextAttr)
325  {
326  rpNode = pContentControl->GetTextNode();
327  if (rpNode)
328  {
329  // rStart points at the first position within the content control.
330  rStart = pTextAttr->GetStart() + 1;
331  // rEnd points at the last position within the content control.
332  rEnd = *pTextAttr->End() - 1;
333  return true;
334  }
335  }
336  }
337  return false;
338 }
339 
340 const uno::Sequence<sal_Int8>& SwXContentControl::getUnoTunnelId()
341 {
342  static const comphelper::UnoIdInit theSwXContentControlUnoTunnelId;
343  return theSwXContentControlUnoTunnelId.getSeq();
344 }
345 
346 // XUnoTunnel
347 sal_Int64 SAL_CALL SwXContentControl::getSomething(const uno::Sequence<sal_Int8>& rId)
348 {
349  return comphelper::getSomethingImpl<SwXContentControl>(rId, this);
350 }
351 
352 // XServiceInfo
353 OUString SAL_CALL SwXContentControl::getImplementationName() { return "SwXContentControl"; }
354 
355 sal_Bool SAL_CALL SwXContentControl::supportsService(const OUString& rServiceName)
356 {
357  return cppu::supportsService(this, rServiceName);
358 }
359 
360 uno::Sequence<OUString> SAL_CALL SwXContentControl::getSupportedServiceNames()
361 {
362  return { "com.sun.star.text.TextContent", "com.sun.star.text.ContentControl" };
363 }
364 
365 // XComponent
366 void SAL_CALL
367 SwXContentControl::addEventListener(const uno::Reference<lang::XEventListener>& xListener)
368 {
369  std::unique_lock aGuard(m_pImpl->m_Mutex);
370  m_pImpl->m_EventListeners.addInterface(aGuard, xListener);
371 }
372 
373 void SAL_CALL
374 SwXContentControl::removeEventListener(const uno::Reference<lang::XEventListener>& xListener)
375 {
376  std::unique_lock aGuard(m_pImpl->m_Mutex);
377  m_pImpl->m_EventListeners.removeInterface(aGuard, xListener);
378 }
379 
381 {
382  SolarMutexGuard g;
383 
384  if (m_pImpl->m_bIsDescriptor)
385  {
386  m_pImpl->m_pTextPortions.reset();
387  lang::EventObject aEvent(static_cast<::cppu::OWeakObject&>(*this));
388  std::unique_lock aGuard(m_pImpl->m_Mutex);
389  m_pImpl->m_EventListeners.disposeAndClear(aGuard, aEvent);
390  m_pImpl->m_bIsDisposed = true;
391  m_pImpl->m_xText->Invalidate();
392  }
393  else if (!m_pImpl->m_bIsDisposed)
394  {
395  SwTextNode* pTextNode;
396  sal_Int32 nContentControlStart;
397  sal_Int32 nContentControlEnd;
398  bool bSuccess = SetContentRange(pTextNode, nContentControlStart, nContentControlEnd);
399  if (!bSuccess)
400  {
401  SAL_WARN("sw.core", "SwXContentControl::dispose: no pam");
402  }
403  else
404  {
405  // -1 because of CH_TXTATR
406  SwPaM aPam(*pTextNode, nContentControlStart - 1, *pTextNode, nContentControlEnd);
407  SwDoc& rDoc(pTextNode->GetDoc());
409 
410  // removal should call Modify and do the dispose
411  assert(m_pImpl->m_bIsDisposed);
412  }
413  }
414 }
415 
416 void SwXContentControl::AttachImpl(const uno::Reference<text::XTextRange>& xTextRange,
417  sal_uInt16 nWhich)
418 {
419  SolarMutexGuard aGuard;
420 
421  if (m_pImpl->m_bIsDisposed)
422  {
423  throw lang::DisposedException();
424  }
425  if (!m_pImpl->m_bIsDescriptor)
426  {
427  throw uno::RuntimeException("SwXContentControl::AttachImpl(): already attached",
428  static_cast<::cppu::OWeakObject*>(this));
429  }
430 
431  uno::Reference<lang::XUnoTunnel> xRangeTunnel(xTextRange, uno::UNO_QUERY);
432  if (!xRangeTunnel.is())
433  {
434  throw lang::IllegalArgumentException(
435  "SwXContentControl::AttachImpl(): argument is no XUnoTunnel",
436  static_cast<::cppu::OWeakObject*>(this), 0);
437  }
438  SwXTextRange* pRange = comphelper::getFromUnoTunnel<SwXTextRange>(xRangeTunnel);
439  OTextCursorHelper* pCursor
440  = pRange ? nullptr : comphelper::getFromUnoTunnel<OTextCursorHelper>(xRangeTunnel);
441  if (!pRange && !pCursor)
442  {
443  throw lang::IllegalArgumentException(
444  "SwXContentControl::AttachImpl(): argument not supported type",
445  static_cast<::cppu::OWeakObject*>(this), 0);
446  }
447 
448  SwDoc* pDoc = pRange ? &pRange->GetDoc() : pCursor->GetDoc();
449  if (!pDoc)
450  {
451  throw lang::IllegalArgumentException(
452  "SwXContentControl::AttachImpl(): argument has no SwDoc",
453  static_cast<::cppu::OWeakObject*>(this), 0);
454  }
455 
456  SwUnoInternalPaM aPam(*pDoc);
457  ::sw::XTextRangeToSwPaM(aPam, xTextRange);
458 
459  UnoActionContext aContext(pDoc);
460 
461  auto pTextCursor = dynamic_cast<SwXTextCursor*>(pCursor);
462  bool bForceExpandHints = pTextCursor && pTextCursor->IsAtEndOfContentControl();
463  SetAttrMode nInsertFlags = bForceExpandHints
466 
467  auto pContentControl = std::make_shared<SwContentControl>(nullptr);
468 
469  pContentControl->SetShowingPlaceHolder(m_pImpl->m_bShowingPlaceHolder);
470  pContentControl->SetCheckbox(m_pImpl->m_bCheckbox);
471  pContentControl->SetChecked(m_pImpl->m_bChecked);
472  pContentControl->SetCheckedState(m_pImpl->m_aCheckedState);
473  pContentControl->SetUncheckedState(m_pImpl->m_aUncheckedState);
474  pContentControl->SetListItems(m_pImpl->m_aListItems);
475  pContentControl->SetPicture(m_pImpl->m_bPicture);
476  pContentControl->SetDate(m_pImpl->m_bDate);
477  pContentControl->SetDateFormat(m_pImpl->m_aDateFormat);
478  pContentControl->SetDateLanguage(m_pImpl->m_aDateLanguage);
479  pContentControl->SetCurrentDate(m_pImpl->m_aCurrentDate);
480  pContentControl->SetPlaceholderDocPart(m_pImpl->m_aPlaceholderDocPart);
481  pContentControl->SetDataBindingPrefixMappings(m_pImpl->m_aDataBindingPrefixMappings);
482  pContentControl->SetDataBindingXpath(m_pImpl->m_aDataBindingXpath);
483  pContentControl->SetDataBindingStoreItemID(m_pImpl->m_aDataBindingStoreItemID);
484  pContentControl->SetColor(m_pImpl->m_aColor);
485 
486  SwFormatContentControl aContentControl(pContentControl, nWhich);
487  bool bSuccess
488  = pDoc->getIDocumentContentOperations().InsertPoolItem(aPam, aContentControl, nInsertFlags);
489  SwTextAttr* pTextAttr = pContentControl->GetTextAttr();
490  if (!bSuccess)
491  {
492  throw lang::IllegalArgumentException(
493  "SwXContentControl::AttachImpl(): cannot create content control: invalid range",
494  static_cast<::cppu::OWeakObject*>(this), 1);
495  }
496  if (!pTextAttr)
497  {
498  SAL_WARN("sw.core", "content control inserted, but has no text attribute?");
499  throw uno::RuntimeException(
500  "SwXContentControl::AttachImpl(): cannot create content control",
501  static_cast<::cppu::OWeakObject*>(this));
502  }
503 
504  m_pImpl->EndListeningAll();
505  m_pImpl->m_pContentControl = pContentControl.get();
506  m_pImpl->StartListening(pContentControl->GetNotifier());
507  pContentControl->SetXContentControl(uno::Reference<text::XTextContent>(this));
508 
509  m_pImpl->m_xParentText = sw::CreateParentXText(*pDoc, *aPam.GetPoint());
510 
511  m_pImpl->m_bIsDescriptor = false;
512 }
513 
514 // XTextContent
515 void SAL_CALL SwXContentControl::attach(const uno::Reference<text::XTextRange>& xTextRange)
516 {
518 }
519 
520 uno::Reference<text::XTextRange> SAL_CALL SwXContentControl::getAnchor()
521 {
522  SolarMutexGuard g;
523 
524  if (m_pImpl->m_bIsDisposed)
525  {
526  throw lang::DisposedException();
527  }
528  if (m_pImpl->m_bIsDescriptor)
529  {
530  throw uno::RuntimeException("SwXContentControl::getAnchor(): not inserted",
531  static_cast<::cppu::OWeakObject*>(this));
532  }
533 
534  SwTextNode* pTextNode;
535  sal_Int32 nContentControlStart;
536  sal_Int32 nContentControlEnd;
537  bool bSuccess = SetContentRange(pTextNode, nContentControlStart, nContentControlEnd);
538  if (!bSuccess)
539  {
540  SAL_WARN("sw.core", "no pam");
541  throw lang::DisposedException("SwXContentControl::getAnchor(): not attached",
542  static_cast<::cppu::OWeakObject*>(this));
543  }
544 
545  SwPosition aStart(*pTextNode, nContentControlStart - 1); // -1 due to CH_TXTATR
546  SwPosition aEnd(*pTextNode, nContentControlEnd);
547  return SwXTextRange::CreateXTextRange(pTextNode->GetDoc(), aStart, &aEnd);
548 }
549 
550 // XTextRange
551 uno::Reference<text::XText> SAL_CALL SwXContentControl::getText() { return this; }
552 
553 uno::Reference<text::XTextRange> SAL_CALL SwXContentControl::getStart()
554 {
555  SolarMutexGuard g;
556  return m_pImpl->m_xText->getStart();
557 }
558 
559 uno::Reference<text::XTextRange> SAL_CALL SwXContentControl::getEnd()
560 {
561  SolarMutexGuard g;
562  return m_pImpl->m_xText->getEnd();
563 }
564 
565 OUString SAL_CALL SwXContentControl::getString()
566 {
567  SolarMutexGuard g;
568  return m_pImpl->m_xText->getString();
569 }
570 
571 void SAL_CALL SwXContentControl::setString(const OUString& rString)
572 {
573  SolarMutexGuard g;
574  return m_pImpl->m_xText->setString(rString);
575 }
576 
577 // XSimpleText
578 uno::Reference<text::XTextCursor> SAL_CALL SwXContentControl::createTextCursor()
579 {
580  SolarMutexGuard g;
581  return m_pImpl->m_xText->createTextCursor();
582 }
583 
584 uno::Reference<text::XTextCursor> SAL_CALL
585 SwXContentControl::createTextCursorByRange(const uno::Reference<text::XTextRange>& xTextPosition)
586 {
587  SolarMutexGuard g;
588  return m_pImpl->m_xText->createTextCursorByRange(xTextPosition);
589 }
590 
591 void SAL_CALL SwXContentControl::insertString(const uno::Reference<text::XTextRange>& xRange,
592  const OUString& rString, sal_Bool bAbsorb)
593 {
594  SolarMutexGuard g;
595  return m_pImpl->m_xText->insertString(xRange, rString, bAbsorb);
596 }
597 
599  const uno::Reference<text::XTextRange>& xRange, sal_Int16 nControlCharacter, sal_Bool bAbsorb)
600 {
601  SolarMutexGuard g;
602  return m_pImpl->m_xText->insertControlCharacter(xRange, nControlCharacter, bAbsorb);
603 }
604 
605 // XText
607  const uno::Reference<text::XTextRange>& xRange,
608  const uno::Reference<text::XTextContent>& xContent, sal_Bool bAbsorb)
609 {
610  SolarMutexGuard g;
611  return m_pImpl->m_xText->insertTextContent(xRange, xContent, bAbsorb);
612 }
613 
614 void SAL_CALL
615 SwXContentControl::removeTextContent(const uno::Reference<text::XTextContent>& xContent)
616 {
617  SolarMutexGuard g;
618  return m_pImpl->m_xText->removeTextContent(xContent);
619 }
620 
621 // XPropertySet
622 uno::Reference<beans::XPropertySetInfo> SAL_CALL SwXContentControl::getPropertySetInfo()
623 {
624  SolarMutexGuard aGuard;
625 
626  static uno::Reference<beans::XPropertySetInfo> xRet
628  return xRet;
629 }
630 
631 void SAL_CALL SwXContentControl::setPropertyValue(const OUString& rPropertyName,
632  const css::uno::Any& rValue)
633 {
634  SolarMutexGuard aGuard;
635 
636  if (rPropertyName == UNO_NAME_SHOWING_PLACE_HOLDER)
637  {
638  bool bValue;
639  if (rValue >>= bValue)
640  {
641  if (m_pImpl->m_bIsDescriptor)
642  {
643  m_pImpl->m_bShowingPlaceHolder = bValue;
644  }
645  else
646  {
647  m_pImpl->m_pContentControl->SetShowingPlaceHolder(bValue);
648  }
649  }
650  }
651  else if (rPropertyName == UNO_NAME_CHECKBOX)
652  {
653  bool bValue;
654  if (rValue >>= bValue)
655  {
656  if (m_pImpl->m_bIsDescriptor)
657  {
658  m_pImpl->m_bCheckbox = bValue;
659  }
660  else
661  {
662  m_pImpl->m_pContentControl->SetCheckbox(bValue);
663  }
664  }
665  }
666  else if (rPropertyName == UNO_NAME_CHECKED)
667  {
668  bool bValue;
669  if (rValue >>= bValue)
670  {
671  if (m_pImpl->m_bIsDescriptor)
672  {
673  m_pImpl->m_bChecked = bValue;
674  }
675  else
676  {
677  m_pImpl->m_pContentControl->SetChecked(bValue);
678  }
679  }
680  }
681  else if (rPropertyName == UNO_NAME_CHECKED_STATE)
682  {
683  OUString aValue;
684  if (rValue >>= aValue)
685  {
686  if (m_pImpl->m_bIsDescriptor)
687  {
688  m_pImpl->m_aCheckedState = aValue;
689  }
690  else
691  {
692  m_pImpl->m_pContentControl->SetCheckedState(aValue);
693  }
694  }
695  }
696  else if (rPropertyName == UNO_NAME_UNCHECKED_STATE)
697  {
698  OUString aValue;
699  if (rValue >>= aValue)
700  {
701  if (m_pImpl->m_bIsDescriptor)
702  {
703  m_pImpl->m_aUncheckedState = aValue;
704  }
705  else
706  {
707  m_pImpl->m_pContentControl->SetUncheckedState(aValue);
708  }
709  }
710  }
711  else if (rPropertyName == UNO_NAME_LIST_ITEMS)
712  {
713  std::vector<SwContentControlListItem> aItems
715  if (m_pImpl->m_bIsDescriptor)
716  {
717  m_pImpl->m_aListItems = aItems;
718  }
719  else
720  {
721  m_pImpl->m_pContentControl->SetListItems(aItems);
722  }
723  }
724  else if (rPropertyName == UNO_NAME_PICTURE)
725  {
726  bool bValue;
727  if (rValue >>= bValue)
728  {
729  if (m_pImpl->m_bIsDescriptor)
730  {
731  m_pImpl->m_bPicture = bValue;
732  }
733  else
734  {
735  m_pImpl->m_pContentControl->SetPicture(bValue);
736  }
737  }
738  }
739  else if (rPropertyName == UNO_NAME_DATE)
740  {
741  bool bValue;
742  if (rValue >>= bValue)
743  {
744  if (m_pImpl->m_bIsDescriptor)
745  {
746  m_pImpl->m_bDate = bValue;
747  }
748  else
749  {
750  m_pImpl->m_pContentControl->SetDate(bValue);
751  }
752  }
753  }
754  else if (rPropertyName == UNO_NAME_DATE_FORMAT)
755  {
756  OUString aValue;
757  if (rValue >>= aValue)
758  {
759  if (m_pImpl->m_bIsDescriptor)
760  {
761  m_pImpl->m_aDateFormat = aValue;
762  }
763  else
764  {
765  m_pImpl->m_pContentControl->SetDateFormat(aValue);
766  }
767  }
768  }
769  else if (rPropertyName == UNO_NAME_DATE_LANGUAGE)
770  {
771  OUString aValue;
772  if (rValue >>= aValue)
773  {
774  if (m_pImpl->m_bIsDescriptor)
775  {
776  m_pImpl->m_aDateLanguage = aValue;
777  }
778  else
779  {
780  m_pImpl->m_pContentControl->SetDateLanguage(aValue);
781  }
782  }
783  }
784  else if (rPropertyName == UNO_NAME_CURRENT_DATE)
785  {
786  OUString aValue;
787  if (rValue >>= aValue)
788  {
789  if (m_pImpl->m_bIsDescriptor)
790  {
791  m_pImpl->m_aCurrentDate = aValue;
792  }
793  else
794  {
795  m_pImpl->m_pContentControl->SetCurrentDate(aValue);
796  }
797  }
798  }
799  else if (rPropertyName == UNO_NAME_PLACEHOLDER_DOC_PART)
800  {
801  OUString aValue;
802  if (rValue >>= aValue)
803  {
804  if (m_pImpl->m_bIsDescriptor)
805  {
806  m_pImpl->m_aPlaceholderDocPart = aValue;
807  }
808  else
809  {
810  m_pImpl->m_pContentControl->SetPlaceholderDocPart(aValue);
811  }
812  }
813  }
814  else if (rPropertyName == UNO_NAME_DATA_BINDING_PREFIX_MAPPINGS)
815  {
816  OUString aValue;
817  if (rValue >>= aValue)
818  {
819  if (m_pImpl->m_bIsDescriptor)
820  {
821  m_pImpl->m_aDataBindingPrefixMappings = aValue;
822  }
823  else
824  {
825  m_pImpl->m_pContentControl->SetDataBindingPrefixMappings(aValue);
826  }
827  }
828  }
829  else if (rPropertyName == UNO_NAME_DATA_BINDING_XPATH)
830  {
831  OUString aValue;
832  if (rValue >>= aValue)
833  {
834  if (m_pImpl->m_bIsDescriptor)
835  {
836  m_pImpl->m_aDataBindingXpath = aValue;
837  }
838  else
839  {
840  m_pImpl->m_pContentControl->SetDataBindingXpath(aValue);
841  }
842  }
843  }
844  else if (rPropertyName == UNO_NAME_DATA_BINDING_STORE_ITEM_ID)
845  {
846  OUString aValue;
847  if (rValue >>= aValue)
848  {
849  if (m_pImpl->m_bIsDescriptor)
850  {
851  m_pImpl->m_aDataBindingStoreItemID = aValue;
852  }
853  else
854  {
855  m_pImpl->m_pContentControl->SetDataBindingStoreItemID(aValue);
856  }
857  }
858  }
859  else if (rPropertyName == UNO_NAME_COLOR)
860  {
861  OUString aValue;
862  if (rValue >>= aValue)
863  {
864  if (m_pImpl->m_bIsDescriptor)
865  {
866  m_pImpl->m_aColor = aValue;
867  }
868  else
869  {
870  m_pImpl->m_pContentControl->SetColor(aValue);
871  }
872  }
873  }
874  else
875  {
876  throw beans::UnknownPropertyException();
877  }
878 }
879 
880 uno::Any SAL_CALL SwXContentControl::getPropertyValue(const OUString& rPropertyName)
881 {
882  SolarMutexGuard aGuard;
883 
884  uno::Any aRet;
885  if (rPropertyName == UNO_NAME_SHOWING_PLACE_HOLDER)
886  {
887  if (m_pImpl->m_bIsDescriptor)
888  {
889  aRet <<= m_pImpl->m_bShowingPlaceHolder;
890  }
891  else
892  {
893  aRet <<= m_pImpl->m_pContentControl->GetShowingPlaceHolder();
894  }
895  }
896  else if (rPropertyName == UNO_NAME_CHECKBOX)
897  {
898  if (m_pImpl->m_bIsDescriptor)
899  {
900  aRet <<= m_pImpl->m_bCheckbox;
901  }
902  else
903  {
904  aRet <<= m_pImpl->m_pContentControl->GetCheckbox();
905  }
906  }
907  else if (rPropertyName == UNO_NAME_CHECKED)
908  {
909  if (m_pImpl->m_bIsDescriptor)
910  {
911  aRet <<= m_pImpl->m_bChecked;
912  }
913  else
914  {
915  aRet <<= m_pImpl->m_pContentControl->GetChecked();
916  }
917  }
918  else if (rPropertyName == UNO_NAME_CHECKED_STATE)
919  {
920  if (m_pImpl->m_bIsDescriptor)
921  {
922  aRet <<= m_pImpl->m_aCheckedState;
923  }
924  else
925  {
926  aRet <<= m_pImpl->m_pContentControl->GetCheckedState();
927  }
928  }
929  else if (rPropertyName == UNO_NAME_UNCHECKED_STATE)
930  {
931  if (m_pImpl->m_bIsDescriptor)
932  {
933  aRet <<= m_pImpl->m_aUncheckedState;
934  }
935  else
936  {
937  aRet <<= m_pImpl->m_pContentControl->GetUncheckedState();
938  }
939  }
940  else if (rPropertyName == UNO_NAME_LIST_ITEMS)
941  {
942  std::vector<SwContentControlListItem> aItems;
943  if (m_pImpl->m_bIsDescriptor)
944  {
945  aItems = m_pImpl->m_aListItems;
946  }
947  else
948  {
949  aItems = m_pImpl->m_pContentControl->GetListItems();
950  }
952  }
953  else if (rPropertyName == UNO_NAME_PICTURE)
954  {
955  if (m_pImpl->m_bIsDescriptor)
956  {
957  aRet <<= m_pImpl->m_bPicture;
958  }
959  else
960  {
961  aRet <<= m_pImpl->m_pContentControl->GetPicture();
962  }
963  }
964  else if (rPropertyName == UNO_NAME_DATE)
965  {
966  if (m_pImpl->m_bIsDescriptor)
967  {
968  aRet <<= m_pImpl->m_bDate;
969  }
970  else
971  {
972  aRet <<= m_pImpl->m_pContentControl->GetDate();
973  }
974  }
975  else if (rPropertyName == UNO_NAME_DATE_FORMAT)
976  {
977  if (m_pImpl->m_bIsDescriptor)
978  {
979  aRet <<= m_pImpl->m_aDateFormat;
980  }
981  else
982  {
983  aRet <<= m_pImpl->m_pContentControl->GetDateFormat();
984  }
985  }
986  else if (rPropertyName == UNO_NAME_DATE_LANGUAGE)
987  {
988  if (m_pImpl->m_bIsDescriptor)
989  {
990  aRet <<= m_pImpl->m_aDateLanguage;
991  }
992  else
993  {
994  aRet <<= m_pImpl->m_pContentControl->GetDateLanguage();
995  }
996  }
997  else if (rPropertyName == UNO_NAME_CURRENT_DATE)
998  {
999  if (m_pImpl->m_bIsDescriptor)
1000  {
1001  aRet <<= m_pImpl->m_aCurrentDate;
1002  }
1003  else
1004  {
1005  aRet <<= m_pImpl->m_pContentControl->GetCurrentDate();
1006  }
1007  }
1008  else if (rPropertyName == UNO_NAME_PLACEHOLDER_DOC_PART)
1009  {
1010  if (m_pImpl->m_bIsDescriptor)
1011  {
1012  aRet <<= m_pImpl->m_aPlaceholderDocPart;
1013  }
1014  else
1015  {
1016  aRet <<= m_pImpl->m_pContentControl->GetCurrentDate();
1017  }
1018  }
1019  else if (rPropertyName == UNO_NAME_DATA_BINDING_PREFIX_MAPPINGS)
1020  {
1021  if (m_pImpl->m_bIsDescriptor)
1022  {
1023  aRet <<= m_pImpl->m_aDataBindingPrefixMappings;
1024  }
1025  else
1026  {
1027  aRet <<= m_pImpl->m_pContentControl->GetDataBindingPrefixMappings();
1028  }
1029  }
1030  else if (rPropertyName == UNO_NAME_DATA_BINDING_XPATH)
1031  {
1032  if (m_pImpl->m_bIsDescriptor)
1033  {
1034  aRet <<= m_pImpl->m_aDataBindingXpath;
1035  }
1036  else
1037  {
1038  aRet <<= m_pImpl->m_pContentControl->GetDataBindingXpath();
1039  }
1040  }
1041  else if (rPropertyName == UNO_NAME_DATA_BINDING_STORE_ITEM_ID)
1042  {
1043  if (m_pImpl->m_bIsDescriptor)
1044  {
1045  aRet <<= m_pImpl->m_aDataBindingStoreItemID;
1046  }
1047  else
1048  {
1049  aRet <<= m_pImpl->m_pContentControl->GetDataBindingStoreItemID();
1050  }
1051  }
1052  else if (rPropertyName == UNO_NAME_COLOR)
1053  {
1054  if (m_pImpl->m_bIsDescriptor)
1055  {
1056  aRet <<= m_pImpl->m_aColor;
1057  }
1058  else
1059  {
1060  aRet <<= m_pImpl->m_pContentControl->GetColor();
1061  }
1062  }
1063  else
1064  {
1065  throw beans::UnknownPropertyException();
1066  }
1067 
1068  return aRet;
1069 }
1070 
1072  const OUString& /*rPropertyName*/,
1073  const uno::Reference<beans::XPropertyChangeListener>& /*xListener*/)
1074 {
1075  SAL_WARN("sw.uno", "SwXContentControl::addPropertyChangeListener: not implemented");
1076 }
1077 
1079  const OUString& /*rPropertyName*/,
1080  const uno::Reference<beans::XPropertyChangeListener>& /*xListener*/)
1081 {
1082  SAL_WARN("sw.uno", "SwXContentControl::removePropertyChangeListener: not implemented");
1083 }
1084 
1086  const OUString& /*rPropertyName*/,
1087  const uno::Reference<beans::XVetoableChangeListener>& /*xListener*/)
1088 {
1089  SAL_WARN("sw.uno", "SwXContentControl::addVetoableChangeListener: not implemented");
1090 }
1091 
1093  const OUString& /*rPropertyName*/,
1094  const uno::Reference<beans::XVetoableChangeListener>& /*xListener*/)
1095 {
1096  SAL_WARN("sw.uno", "SwXContentControl::removeVetoableChangeListener: not implemented");
1097 }
1098 
1099 // XElementAccess
1101 {
1103 }
1104 
1106 {
1107  SolarMutexGuard g;
1108  return m_pImpl->m_pContentControl != nullptr;
1109 }
1110 
1111 // XEnumerationAccess
1112 uno::Reference<container::XEnumeration> SAL_CALL SwXContentControl::createEnumeration()
1113 {
1114  SolarMutexGuard g;
1115 
1116  if (m_pImpl->m_bIsDisposed)
1117  {
1118  throw lang::DisposedException();
1119  }
1120  if (m_pImpl->m_bIsDescriptor)
1121  {
1122  throw uno::RuntimeException("createEnumeration(): not inserted",
1123  static_cast<::cppu::OWeakObject*>(this));
1124  }
1125 
1126  SwTextNode* pTextNode;
1127  sal_Int32 nContentControlStart;
1128  sal_Int32 nContentControlEnd;
1129  bool bSuccess = SetContentRange(pTextNode, nContentControlStart, nContentControlEnd);
1130  if (!bSuccess)
1131  {
1132  SAL_WARN("sw.core", "no pam");
1133  throw lang::DisposedException();
1134  }
1135 
1136  SwPaM aPam(*pTextNode, nContentControlStart);
1137 
1138  if (!m_pImpl->m_pTextPortions)
1139  {
1140  return new SwXTextPortionEnumeration(aPam, GetParentText(), nContentControlStart,
1141  nContentControlEnd);
1142  }
1143  else
1144  {
1145  return new SwXTextPortionEnumeration(aPam, std::deque(*m_pImpl->m_pTextPortions));
1146  }
1147 }
1148 
1149 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Starts a section of nodes in the document model.
Definition: node.hxx:313
#define UNO_NAME_CHECKBOX
Definition: unoprnms.hxx:877
Marks a position in the document model.
Definition: pam.hxx:36
SwTextContentControl * GetTextAttr() const
css::uno::Reference< css::text::XText > SAL_CALL getText() override
bool SetContentRange(SwTextNode *&rpNode, sal_Int32 &rStart, sal_Int32 &rEnd) const
Initializes params with position of the attribute content (without CH_TXTATR).
CursorType
The inner part SwXContentControl, which is deleted with a locked SolarMutex.
SwTextNode * GetTextNode() const
#define UNO_NAME_LIST_ITEMS
Definition: unoprnms.hxx:881
void SAL_CALL attach(const css::uno::Reference< css::text::XTextRange > &xTextRange) override
const SwPosition * GetMark() const
Definition: pam.hxx:210
void Invalidate()
Definition: unotext.cxx:148
const css::uno::Reference< css::text::XText > & GetParentText() const
const SfxItemPropertySet * GetPropertySet(sal_uInt16 PropertyId)
Definition: unomap1.cxx:1099
Definition: doc.hxx:187
Stores the properties of a content control.
#define UNO_NAME_DATE
Definition: unoprnms.hxx:254
SfxPoolItem subclass that wraps an SwContentControl.
#define UNO_NAME_PLACEHOLDER_DOC_PART
Definition: unoprnms.hxx:886
virtual void SAL_CALL acquire() SAL_NOEXCEPT SAL_OVERRIDE
virtual bool InsertPoolItem(const SwPaM &rRg, const SfxPoolItem &, const SetAttrMode nFlags=SetAttrMode::DEFAULT, SwRootFrame const *pLayout=nullptr, SwTextAttr **ppNewTextAttr=nullptr)=0
Insert an attribute.
const SwContentControl * GetContentControl() const
SwXContentControl(const SwXContentControl &)=delete
IDocumentContentOperations const & getIDocumentContentOperations() const
Definition: doc.cxx:315
uno::WeakReference< uno::XInterface > m_wThis
css::uno::Reference< css::beans::XPropertySetInfo > const & getPropertySetInfo() const
std::unique_ptr< const TextRangeList_t > m_pTextPortions
SfxHintId GetId() const
::comphelper::OInterfaceContainerHelper4< css::lang::XEventListener > m_EventListeners
css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override
css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
static std::vector< SwContentControlListItem > ItemsFromAny(const css::uno::Any &rVal)
sw::UnoImplPtr< Impl > m_pImpl
const SwDoc & GetDoc() const
Definition: unoobj2.cxx:767
void SAL_CALL addPropertyChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
A wrapper around SfxPoolItem to store the start position of (usually) a text portion, with an optional end.
Definition: txatbase.hxx:43
sal_Int64 SAL_CALL getSomething(const css::uno::Sequence< sal_Int8 > &Identifier) override
css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
void SAL_CALL setString(const OUString &rString) override
sal_Int32 GetStart() const
Definition: txatbase.hxx:88
virtual const SwStartNode * GetStartNode() const
Definition: unotext.cxx:172
void SAL_CALL insertTextContent(const css::uno::Reference< css::text::XTextRange > &xRange, const css::uno::Reference< css::text::XTextContent > &xContent, sal_Bool bAbsorb) override
css::uno::Reference< css::text::XTextRange > SAL_CALL getAnchor() override
Impl(SwXContentControl &rThis, SwDoc &rDoc, SwContentControl *pContentControl, const uno::Reference< text::XText > &xParentText, std::unique_ptr< const TextRangeList_t > pPortions)
void SetXContentControl(const css::uno::Reference< css::text::XTextContent > &xContentCnotrol)
static css::uno::Reference< css::text::XTextContent > CreateXContentControl(SwContentControl &rContentControl, const css::uno::Reference< css::text::XText > &xParentText=nullptr, std::unique_ptr< const TextRangeList_t > &&pPortions=std::unique_ptr< const TextRangeList_t >())
#define UNO_NAME_DATE_LANGUAGE
Definition: unoprnms.hxx:884
#define PROPERTY_MAP_CONTENTCONTROL
Definition: unomap.hxx:129
bool IsAtEndOfContentControl() const
Definition: unoobj.cxx:821
css::uno::Reference< css::text::XTextCursor > SAL_CALL createTextCursorByRange(const css::uno::Reference< css::text::XTextRange > &xTextPosition) override
const css::uno::Sequence< sal_Int8 > & getSeq() const
SwContentControl * m_pContentControl
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:137
#define UNO_NAME_DATA_BINDING_STORE_ITEM_ID
Definition: unoprnms.hxx:889
css::uno::Reference< css::text::XTextRange > SAL_CALL getEnd() override
SwDoc & GetDoc()
Definition: node.hxx:213
const SwPosition * GetPoint() const
Definition: pam.hxx:208
rtl::Reference< SwXContentControlText > m_xText
css::uno::Reference< css::text::XTextRange > SAL_CALL getStart() override
#define UNO_NAME_SHOWING_PLACE_HOLDER
Definition: unoprnms.hxx:876
virtual bool DeleteAndJoin(SwPaM &, SwDeleteFlags flags=SwDeleteFlags::Default)=0
complete delete of a given PaM
void SAL_CALL removePropertyChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
SetAttrMode
Definition: swtypes.hxx:132
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
Definition: pam.hxx:206
Force hint expand (only matters for hints with CH_TXTATR).
OUString SAL_CALL getString() override
UNO API wrapper around an SwContentControl, exposed as the com.sun.star.text.ContentControl service...
unsigned char sal_Bool
#define UNO_NAME_COLOR
Definition: unoprnms.hxx:890
#define UNO_NAME_DATA_BINDING_XPATH
Definition: unoprnms.hxx:888
css::uno::Type const & get()
#define UNO_NAME_CURRENT_DATE
Definition: unoprnms.hxx:885
void Notify(const SfxHint &rHint) override
bool StartListening(SvtBroadcaster &rBroadcaster)
#define UNO_NAME_PICTURE
Definition: unoprnms.hxx:882
void SAL_CALL removeVetoableChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &xListener) override
void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > &xListener) override
static void ItemsToAny(const std::vector< SwContentControlListItem > &rItems, css::uno::Any &rVal)
bool XTextRangeToSwPaM(SwUnoInternalPaM &rToFill, const uno::Reference< text::XTextRange > &xTextRange,::sw::TextRangeMode const eMode)
Definition: unoobj2.cxx:1107
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId()
SvtBroadcaster & GetNotifier()
Definition: calbck.hxx:101
const css::uno::WeakReference< css::text::XTextContent > & GetXContentControl() const
#define UNO_NAME_DATE_FORMAT
Definition: unoprnms.hxx:883
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:79
void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &xListener) override
constexpr TypedWhichId< SwFormatContentControl > RES_TXTATR_CONTENTCONTROL(56)
void SAL_CALL addVetoableChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &xListener) override
sal_Bool SAL_CALL supportsService(const OUString &rServiceName) override
void SAL_CALL setPropertyValue(const OUString &rPropertyName, const css::uno::Any &rValue) override
css::uno::Type SAL_CALL getElementType() override
css::uno::Reference< css::text::XTextCursor > SAL_CALL createTextCursor() override
SwTextAttr subclass that tracks the location of the wrapped SwFormatContentControl.
#define UNO_NAME_CHECKED
Definition: unoprnms.hxx:878
css::uno::Any SAL_CALL getPropertyValue(const OUString &rPropertyName) override
const sal_Int32 * End() const
Definition: txatbase.hxx:156
SwUnoPropertyMapProvider aSwMapProvider
Definition: unomap1.cxx:87
#define UNO_NAME_CHECKED_STATE
Definition: unoprnms.hxx:879
void SAL_CALL removeTextContent(const css::uno::Reference< css::text::XTextContent > &xContent) override
#define SAL_WARN(area, stream)
uno::Reference< text::XText > m_xParentText
void SAL_CALL insertString(const css::uno::Reference< css::text::XTextRange > &xRange, const OUString &aString, sal_Bool bAbsorb) override
#define UNO_NAME_UNCHECKED_STATE
Definition: unoprnms.hxx:880
std::vector< SwContentControlListItem > m_aListItems
virtual void SAL_CALL release() SAL_NOEXCEPT SAL_OVERRIDE
static css::uno::Reference< css::text::XTextRange > CreateXTextRange(SwDoc &rDoc, const SwPosition &rPos, const SwPosition *const pMark)
Definition: unoobj2.cxx:1214
static SwNode * GetStartNode(SwOutlineNodes const *pOutlNds, int nOutlineLevel, SwOutlineNodes::size_type *nOutl)
Definition: docglbl.cxx:89
::std::unique_ptr< XmlIdRegistry_Impl > m_pImpl
void SAL_CALL insertControlCharacter(const css::uno::Reference< css::text::XTextRange > &xRange, sal_Int16 nControlCharacter, sal_Bool bAbsorb) override
void AttachImpl(const css::uno::Reference< css::text::XTextRange > &xTextRange, sal_uInt16 nWhich)
OUString SAL_CALL getImplementationName() override
uno::Reference< text::XText > CreateParentXText(SwDoc &rDoc, const SwPosition &rPos)
Definition: unoobj2.cxx:1235
sal_Bool SAL_CALL hasElements() override
AnyEventRef aEvent
bool m_bDetectedRangeSegmentation false
#define UNO_NAME_DATA_BINDING_PREFIX_MAPPINGS
Definition: unoprnms.hxx:887
void SAL_CALL dispose() override