LibreOffice Module sw (master)  1
unoftn.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 <sal/config.h>
21 
23 #include <comphelper/sequence.hxx>
26 #include <svl/listener.hxx>
27 #include <mutex>
28 
29 #include <unofootnote.hxx>
30 #include <unotextrange.hxx>
31 #include <unotextcursor.hxx>
32 #include <unoparagraph.hxx>
33 #include <unomap.hxx>
34 #include <unoprnms.hxx>
35 #include <doc.hxx>
36 #include <ftnidx.hxx>
37 #include <fmtftn.hxx>
38 #include <txtftn.hxx>
39 #include <ndtxt.hxx>
40 #include <unocrsr.hxx>
41 #include <svl/itemprop.hxx>
42 
43 using namespace ::com::sun::star;
44 
45 namespace {
46 
47 uno::Sequence< OUString >
48 GetSupportedServiceNamesImpl(
49  size_t const nServices, char const*const pServices[])
50 {
51  uno::Sequence< OUString > ret(static_cast<sal_Int32>(nServices));
52 
53  std::transform(pServices, pServices + nServices, ret.getArray(),
54  [](const char* pService) -> OUString { return OUString::createFromAscii(pService); });
55 
56  return ret;
57 }
58 
59 }
60 
62  : public SvtListener
63 {
64 public:
65 
67  uno::WeakReference<uno::XInterface> m_wThis;
68  const bool m_bIsEndnote;
69  std::mutex m_Mutex; // just for OInterfaceContainerHelper4
73  OUString m_sLabel;
74 
75  Impl(SwXFootnote& rThis,
76  SwFormatFootnote* const pFootnote,
77  const bool bIsEndnote)
78  : m_rThis(rThis)
79  , m_bIsEndnote(bIsEndnote)
80  , m_bIsDescriptor(nullptr == pFootnote)
81  , m_pFormatFootnote(pFootnote)
82  {
83  m_pFormatFootnote && StartListening(m_pFormatFootnote->GetNotifier());
84  }
85 
87  return m_rThis.GetDoc() ? m_pFormatFootnote : nullptr;
88  }
89 
91  SwFormatFootnote const*const pFootnote( GetFootnoteFormat() );
92  if (!pFootnote) {
93  throw uno::RuntimeException("SwXFootnote: disposed or invalid", nullptr);
94  }
95  return *pFootnote;
96  }
97 
98  void Invalidate();
99 protected:
100  void Notify(const SfxHint& rHint) override;
101 
102 };
103 
105 {
106  EndListeningAll();
107  m_pFormatFootnote = nullptr;
108  m_rThis.SetDoc(nullptr);
109  uno::Reference<uno::XInterface> const xThis(m_wThis);
110  if (!xThis.is())
111  { // fdo#72695: if UNO object is already dead, don't revive it with event
112  return;
113  }
114  lang::EventObject const ev(xThis);
115  std::unique_lock aGuard(m_Mutex);
116  m_EventListeners.disposeAndClear(aGuard, ev);
117 }
118 
120 {
121  if(rHint.GetId() == SfxHintId::Dying)
122  Invalidate();
123 }
124 
125 SwXFootnote::SwXFootnote(const bool bEndnote)
126  : SwXText(nullptr, CursorType::Footnote)
127  , m_pImpl( new SwXFootnote::Impl(*this, nullptr, bEndnote) )
128 {
129 }
130 
132  : SwXText(& rDoc, CursorType::Footnote)
133  , m_pImpl( new SwXFootnote::Impl(*this, &rFormat, rFormat.IsEndNote()) )
134 {
135 }
136 
138 {
139 }
140 
141 uno::Reference<text::XFootnote>
142 SwXFootnote::CreateXFootnote(SwDoc & rDoc, SwFormatFootnote *const pFootnoteFormat,
143  bool const isEndnote)
144 {
145  // i#105557: do not iterate over the registered clients: race condition
146  uno::Reference<text::XFootnote> xNote;
147  if (pFootnoteFormat)
148  {
149  xNote = pFootnoteFormat->GetXFootnote();
150  }
151  if (!xNote.is())
152  {
153  SwXFootnote *const pNote(pFootnoteFormat
154  ? new SwXFootnote(rDoc, *pFootnoteFormat)
155  : new SwXFootnote(isEndnote));
156  xNote.set(pNote);
157  if (pFootnoteFormat)
158  {
159  pFootnoteFormat->SetXFootnote(xNote);
160  }
161  // need a permanent Reference to initialize m_wThis
162  pNote->m_pImpl->m_wThis = xNote;
163  }
164  return xNote;
165 }
166 
167 const uno::Sequence< sal_Int8 > & SwXFootnote::getUnoTunnelId()
168 {
169  static const comphelper::UnoIdInit theSwXFootnoteUnoTunnelId;
170  return theSwXFootnoteUnoTunnelId.getSeq();
171 }
172 
173 sal_Int64 SAL_CALL
174 SwXFootnote::getSomething(const uno::Sequence< sal_Int8 >& rId)
175 {
176  const sal_Int64 nRet( comphelper::getSomethingImpl<SwXFootnote>(rId, this) );
177  return nRet ? nRet : SwXText::getSomething(rId);
178 }
179 
180 OUString SAL_CALL
182 {
183  return "SwXFootnote";
184 }
185 
186 char const*const g_ServicesFootnote[] =
187 {
188  "com.sun.star.text.TextContent",
189  "com.sun.star.text.Footnote",
190  "com.sun.star.text.Text",
191  "com.sun.star.text.Endnote", // NB: only supported for endnotes!
192 };
193 
194 const size_t g_nServicesEndnote( SAL_N_ELEMENTS(g_ServicesFootnote) );
195 
196 const size_t g_nServicesFootnote( g_nServicesEndnote - 1 ); // NB: omit!
197 
198 sal_Bool SAL_CALL SwXFootnote::supportsService(const OUString& rServiceName)
199 {
200  return cppu::supportsService(this, rServiceName);
201 }
202 
203 uno::Sequence< OUString > SAL_CALL
205 {
206  SolarMutexGuard g;
207  return GetSupportedServiceNamesImpl(
208  (m_pImpl->m_bIsEndnote) ? g_nServicesEndnote : g_nServicesFootnote,
209  g_ServicesFootnote);
210 }
211 
212 uno::Sequence< uno::Type > SAL_CALL
214 {
215  const uno::Sequence< uno::Type > aTypes = SwXFootnote_Base::getTypes();
216  const uno::Sequence< uno::Type > aTextTypes = SwXText::getTypes();
217  return ::comphelper::concatSequences(aTypes, aTextTypes);
218 }
219 
220 uno::Sequence< sal_Int8 > SAL_CALL
222 {
223  return css::uno::Sequence<sal_Int8>();
224 }
225 
226 uno::Any SAL_CALL
228 {
229  const uno::Any ret = SwXFootnote_Base::queryInterface(rType);
230  return (ret.getValueType() == cppu::UnoType<void>::get())
231  ? SwXText::queryInterface(rType)
232  : ret;
233 }
234 
235 OUString SAL_CALL SwXFootnote::getLabel()
236 {
237  SolarMutexGuard aGuard;
238 
239  OUString sRet;
240  SwFormatFootnote const*const pFormat = m_pImpl->GetFootnoteFormat();
241  if(pFormat)
242  {
243  sRet = pFormat->GetNumStr();
244  }
245  else if (m_pImpl->m_bIsDescriptor)
246  {
247  sRet = m_pImpl->m_sLabel;
248  }
249  else
250  {
251  throw uno::RuntimeException();
252  }
253  return sRet;
254 }
255 
256 void SAL_CALL
257 SwXFootnote::setLabel(const OUString& aLabel)
258 {
259  SolarMutexGuard aGuard;
260  OUString newLabel(aLabel);
261  //new line must not occur as footnote label
262  if(newLabel.indexOf('\n') >=0 )
263  {
264  newLabel = newLabel.replace('\n', ' ');
265  }
266  SwFormatFootnote const*const pFormat = m_pImpl->GetFootnoteFormat();
267  if(pFormat)
268  {
269  const SwTextFootnote* pTextFootnote = pFormat->GetTextFootnote();
270  OSL_ENSURE(pTextFootnote, "No TextNode?");
271  SwTextNode& rTextNode = const_cast<SwTextNode&>(pTextFootnote->GetTextNode());
272 
273  SwPaM aPam(rTextNode, pTextFootnote->GetStart());
274  GetDoc()->SetCurFootnote(aPam, newLabel, pFormat->IsEndNote());
275  }
276  else if (m_pImpl->m_bIsDescriptor)
277  {
278  m_pImpl->m_sLabel = newLabel;
279  }
280  else
281  {
282  throw uno::RuntimeException();
283  }
284 }
285 
286 void SAL_CALL
287 SwXFootnote::attach(const uno::Reference< text::XTextRange > & xTextRange)
288 {
289  SolarMutexGuard aGuard;
290 
291  if (!m_pImpl->m_bIsDescriptor)
292  {
293  throw uno::RuntimeException();
294  }
295  const uno::Reference<lang::XUnoTunnel> xRangeTunnel(
296  xTextRange, uno::UNO_QUERY);
297  SwXTextRange *const pRange =
298  comphelper::getFromUnoTunnel<SwXTextRange>(xRangeTunnel);
299  OTextCursorHelper *const pCursor =
300  comphelper::getFromUnoTunnel<OTextCursorHelper>(xRangeTunnel);
301  SwDoc *const pNewDoc =
302  pRange ? &pRange->GetDoc() : (pCursor ? pCursor->GetDoc() : nullptr);
303  if (!pNewDoc)
304  {
305  throw lang::IllegalArgumentException();
306  }
307 
308  SwUnoInternalPaM aPam(*pNewDoc);
309  // this now needs to return TRUE
310  ::sw::XTextRangeToSwPaM(aPam, xTextRange);
311 
312  UnoActionContext aCont(pNewDoc);
313  pNewDoc->getIDocumentContentOperations().DeleteAndJoin(aPam);
314  aPam.DeleteMark();
315  SwFormatFootnote aFootNote(m_pImpl->m_bIsEndnote);
316  if (!m_pImpl->m_sLabel.isEmpty())
317  {
318  aFootNote.SetNumStr(m_pImpl->m_sLabel);
319  }
320 
321  SwXTextCursor const*const pTextCursor(
322  dynamic_cast<SwXTextCursor*>(pCursor));
323  const bool bForceExpandHints( pTextCursor && pTextCursor->IsAtEndOfMeta() );
324  const SetAttrMode nInsertFlags = bForceExpandHints
327 
328  pNewDoc->getIDocumentContentOperations().InsertPoolItem(aPam, aFootNote, nInsertFlags);
329 
330  SwTextFootnote *const pTextAttr = static_cast<SwTextFootnote*>(
332  aPam.GetPoint()->nContent.GetIndex()-1, RES_TXTATR_FTN ));
333 
334  if (pTextAttr)
335  {
336  m_pImpl->EndListeningAll();
337  SwFormatFootnote* pFootnote = const_cast<SwFormatFootnote*>(&pTextAttr->GetFootnote());
338  m_pImpl->m_pFormatFootnote = pFootnote;
339  m_pImpl->StartListening(pFootnote->GetNotifier());
340  // force creation of sequence id - is used for references
341  if (pNewDoc->IsInReading())
342  {
343  pTextAttr->SetSeqNo(pNewDoc->GetFootnoteIdxs().size());
344  }
345  else
346  {
347  pTextAttr->SetSeqRefNo();
348  }
349  }
350  m_pImpl->m_bIsDescriptor = false;
351  SetDoc(pNewDoc);
352 }
353 
354 uno::Reference< text::XTextRange > SAL_CALL
356 {
357  SolarMutexGuard aGuard;
358  return m_pImpl->GetFootnoteFormatOrThrow().getAnchor(*GetDoc());
359 }
360 
361 void SAL_CALL SwXFootnote::dispose()
362 {
363  SolarMutexGuard aGuard;
364 
365  SwFormatFootnote const& rFormat( m_pImpl->GetFootnoteFormatOrThrow() );
366 
367  SwTextFootnote const*const pTextFootnote = rFormat.GetTextFootnote();
368  OSL_ENSURE(pTextFootnote, "no TextNode?");
369  SwTextNode& rTextNode = const_cast<SwTextNode&>(pTextFootnote->GetTextNode());
370  const sal_Int32 nPos = pTextFootnote->GetStart();
371  SwPaM aPam(rTextNode, nPos, rTextNode, nPos+1);
373 }
374 
375 void SAL_CALL
377  const uno::Reference< lang::XEventListener > & xListener)
378 {
379  // no need to lock here as m_pImpl is const and container threadsafe
380  std::unique_lock aGuard(m_pImpl->m_Mutex);
381  m_pImpl->m_EventListeners.addInterface(aGuard, xListener);
382 }
383 
384 void SAL_CALL
386  const uno::Reference< lang::XEventListener > & xListener)
387 {
388  // no need to lock here as m_pImpl is const and container threadsafe
389  std::unique_lock aGuard(m_pImpl->m_Mutex);
390  m_pImpl->m_EventListeners.removeInterface(aGuard, xListener);
391 }
392 
394 {
395  SwFormatFootnote const*const pFormat = m_pImpl->GetFootnoteFormat();
396  if(pFormat)
397  {
398  const SwTextFootnote* pTextFootnote = pFormat->GetTextFootnote();
399  if( pTextFootnote )
400  {
401  return pTextFootnote->GetStartNode()->GetNode().GetStartNode();
402  }
403  }
404  return nullptr;
405 }
406 
407 uno::Reference< text::XTextCursor >
409 {
410  return createTextCursor();
411 }
412 
413 uno::Reference< text::XTextCursor > SAL_CALL
415 {
416  SolarMutexGuard aGuard;
417 
418  SwFormatFootnote const& rFormat( m_pImpl->GetFootnoteFormatOrThrow() );
419 
420  SwTextFootnote const*const pTextFootnote = rFormat.GetTextFootnote();
421  SwPosition aPos( *pTextFootnote->GetStartNode() );
423  new SwXTextCursor(*GetDoc(), this, CursorType::Footnote, aPos);
424  auto& rUnoCursor(pXCursor->GetCursor());
425  rUnoCursor.Move(fnMoveForward, GoInNode);
426  return static_cast<text::XWordCursor*>(pXCursor.get());
427 }
428 
429 uno::Reference< text::XTextCursor > SAL_CALL
431  const uno::Reference< text::XTextRange > & xTextPosition)
432 {
433  SolarMutexGuard aGuard;
434 
435  SwFormatFootnote const& rFormat( m_pImpl->GetFootnoteFormatOrThrow() );
436 
437  SwUnoInternalPaM aPam(*GetDoc());
438  if (!::sw::XTextRangeToSwPaM(aPam, xTextPosition))
439  {
440  throw uno::RuntimeException();
441  }
442 
443  SwTextFootnote const*const pTextFootnote = rFormat.GetTextFootnote();
444  SwNode const*const pFootnoteStartNode = &pTextFootnote->GetStartNode()->GetNode();
445 
446  const SwNode* pStart = aPam.GetNode().FindFootnoteStartNode();
447  if (pStart != pFootnoteStartNode)
448  {
449  throw uno::RuntimeException();
450  }
451 
452  const uno::Reference< text::XTextCursor > xRet =
453  static_cast<text::XWordCursor*>(
455  *aPam.GetPoint(), aPam.GetMark()));
456  return xRet;
457 }
458 
459 uno::Reference< container::XEnumeration > SAL_CALL
461 {
462  SolarMutexGuard aGuard;
463 
464  SwFormatFootnote const& rFormat( m_pImpl->GetFootnoteFormatOrThrow() );
465 
466  SwTextFootnote const*const pTextFootnote = rFormat.GetTextFootnote();
467  SwPosition aPos( *pTextFootnote->GetStartNode() );
468  auto pUnoCursor(GetDoc()->CreateUnoCursor(aPos));
469  pUnoCursor->Move(fnMoveForward, GoInNode);
470  return SwXParagraphEnumeration::Create(this, pUnoCursor, CursorType::Footnote);
471 }
472 
474 {
476 }
477 
479 {
480  return true;
481 }
482 
483 uno::Reference< beans::XPropertySetInfo > SAL_CALL
485 {
486  SolarMutexGuard g;
487  static uno::Reference< beans::XPropertySetInfo > xRet =
489  ->getPropertySetInfo();
490  return xRet;
491 }
492 
493 void SAL_CALL
494 SwXFootnote::setPropertyValue(const OUString&, const uno::Any&)
495 {
496  //no values to be set
497  throw lang::IllegalArgumentException();
498 }
499 
500 uno::Any SAL_CALL
501 SwXFootnote::getPropertyValue(const OUString& rPropertyName)
502 {
503  SolarMutexGuard aGuard;
504 
505  uno::Any aRet;
506  if (! ::sw::GetDefaultTextContentValue(aRet, rPropertyName))
507  {
508  if (rPropertyName == UNO_NAME_START_REDLINE ||
509  rPropertyName == UNO_NAME_END_REDLINE)
510  {
511  //redline can only be returned if it's a living object
512  if (!m_pImpl->m_bIsDescriptor)
513  {
514  aRet = SwXText::getPropertyValue(rPropertyName);
515  }
516  }
517  else if (rPropertyName == UNO_NAME_REFERENCE_ID)
518  {
519  SwFormatFootnote const*const pFormat = m_pImpl->GetFootnoteFormat();
520  if (pFormat)
521  {
522  SwTextFootnote const*const pTextFootnote = pFormat->GetTextFootnote();
523  OSL_ENSURE(pTextFootnote, "no TextNode?");
524  aRet <<= static_cast<sal_Int16>(pTextFootnote->GetSeqRefNo());
525  }
526  }
527  else
528  {
529  beans::UnknownPropertyException aExcept;
530  aExcept.Message = rPropertyName;
531  throw aExcept;
532  }
533  }
534  return aRet;
535 }
536 
537 void SAL_CALL
539  const OUString& /*rPropertyName*/,
540  const uno::Reference< beans::XPropertyChangeListener >& /*xListener*/)
541 {
542  OSL_FAIL("SwXFootnote::addPropertyChangeListener(): not implemented");
543 }
544 
545 void SAL_CALL
547  const OUString& /*rPropertyName*/,
548  const uno::Reference< beans::XPropertyChangeListener >& /*xListener*/)
549 {
550  OSL_FAIL("SwXFootnote::removePropertyChangeListener(): not implemented");
551 }
552 
553 void SAL_CALL
555  const OUString& /*rPropertyName*/,
556  const uno::Reference< beans::XVetoableChangeListener >& /*xListener*/)
557 {
558  OSL_FAIL("SwXFootnote::addVetoableChangeListener(): not implemented");
559 }
560 
561 void SAL_CALL
563  const OUString& /*rPropertyName*/,
564  const uno::Reference< beans::XVetoableChangeListener >& /*xListener*/)
565 {
566  OSL_FAIL("SwXFootnote::removeVetoableChangeListener(): not implemented");
567 }
568 
569 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void disposeAndClear(::std::unique_lock<::std::mutex > &rGuard, const css::lang::EventObject &rEvt)
virtual void SAL_CALL setPropertyValue(const OUString &rPropertyName, const css::uno::Any &rValue) override
Definition: unoftn.cxx:494
Starts a section of nodes in the document model.
Definition: node.hxx:313
void Invalidate()
Definition: unoftn.cxx:104
void DeleteMark()
Definition: pam.hxx:178
virtual css::uno::Type SAL_CALL getElementType() override
Definition: unoftn.cxx:473
void SetDoc(SwDoc *const pDoc)
Definition: unotext.cxx:153
virtual OUString SAL_CALL getLabel() override
Definition: unoftn.cxx:235
SwNode & GetNode(bool bPoint=true) const
Definition: pam.hxx:224
virtual void SAL_CALL attach(const css::uno::Reference< css::text::XTextRange > &xTextRange) override
Definition: unoftn.cxx:287
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unoftn.cxx:204
Marks a position in the document model.
Definition: pam.hxx:36
virtual sal_Int64 SAL_CALL getSomething(const css::uno::Sequence< sal_Int8 > &rIdentifier) override
Definition: unoftn.cxx:174
std::mutex m_Mutex
Definition: unoftn.cxx:69
virtual void SAL_CALL setLabel(const OUString &rLabel) override
Definition: unoftn.cxx:257
virtual OUString SAL_CALL getImplementationName() override
Definition: unoftn.cxx:181
CursorType
SwFormatFootnote const & GetFootnoteFormatOrThrow() const
Definition: unoftn.cxx:90
void SetXFootnote(css::uno::Reference< css::text::XFootnote > const &xNote)
Definition: fmtftn.hxx:96
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
Definition: unoftn.cxx:213
#define UNO_NAME_END_REDLINE
Definition: unoprnms.hxx:557
virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL createTextCursorByRange(const css::uno::Reference< css::text::XTextRange > &xTextPosition) override
Definition: unoftn.cxx:430
OUString m_sLabel
Definition: unoftn.cxx:73
void Invalidate()
Definition: unotext.cxx:148
const SfxItemPropertySet * GetPropertySet(sal_uInt16 PropertyId)
Definition: unomap1.cxx:1090
Definition: doc.hxx:187
void SetNumStr(const OUString &rStr)
Definition: fmtftn.hxx:73
bool IsAtEndOfMeta() const
Definition: unoobj.cxx:791
SwNode & GetNode() const
Definition: ndindex.hxx:128
bool IsEndNote() const
Definition: fmtftn.hxx:71
virtual const SwStartNode * GetStartNode() const override
Definition: unoftn.cxx:393
const size_t g_nServicesEndnote(SAL_N_ELEMENTS(g_ServicesFootnote))
IDocumentContentOperations const & getIDocumentContentOperations() const
Definition: doc.cxx:315
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getAnchor() override
Definition: unoftn.cxx:355
void SetSeqNo(sal_uInt16 n)
Definition: txtftn.hxx:63
css::uno::Reference< css::beans::XPropertySetInfo > const & getPropertySetInfo() const
SfxHintId GetId() const
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
Definition: unotext.cxx:264
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:3069
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
Definition: unoftn.cxx:227
virtual void SAL_CALL dispose() override
Definition: unoftn.cxx:361
const SwTextFootnote * GetTextFootnote() const
Definition: fmtftn.hxx:83
const SwDoc & GetDoc() const
Definition: unoobj2.cxx:767
const bool m_bIsEndnote
Definition: unoftn.cxx:68
constexpr TypedWhichId< SwFormatFootnote > RES_TXTATR_FTN(59)
SwIndex nContent
Definition: pam.hxx:39
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &rPropertyName) override
Definition: unoftn.cxx:501
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
sal_Int32 GetStart() const
Definition: txatbase.hxx:88
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
Definition: unoftn.cxx:221
const OUString & GetNumStr() const
Definition: fmtftn.hxx:68
sal_uInt16 GetSeqRefNo() const
Definition: txtftn.hxx:64
#define SAL_N_ELEMENTS(arr)
const css::uno::Sequence< sal_Int8 > & getSeq() const
::sw::UnoImplPtr< Impl > m_pImpl
Definition: unofootnote.hxx:50
bool m_bIsDescriptor
Definition: unoftn.cxx:71
void EndListeningAll()
virtual sal_Bool SAL_CALL hasElements() override
Definition: unoftn.cxx:478
bool SetCurFootnote(const SwPaM &rPam, const OUString &rNumStr, bool bIsEndNote)
change footnotes in range
Definition: docftn.cxx:432
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:137
bool GetDefaultTextContentValue(css::uno::Any &rAny, std::u16string_view rPropertyName, sal_uInt16 nWID=0)
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &xListener) override
Definition: unoftn.cxx:376
bool GoInNode(SwPaM &rPam, SwMoveFnCollection const &fnMove)
Definition: pam.cxx:959
const SwPosition * GetPoint() const
Definition: pam.hxx:208
virtual sal_Int64 SAL_CALL getSomething(const css::uno::Sequence< sal_Int8 > &rIdentifier) override
Definition: unotext.cxx:1210
virtual ~SwXFootnote() override
Definition: unoftn.cxx:137
SetAttrMode
Definition: swtypes.hxx:132
virtual void SAL_CALL addVetoableChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &xListener) override
Definition: unoftn.cxx:554
virtual void SAL_CALL removeVetoableChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &xListener) override
Definition: unoftn.cxx:562
const size_t g_nServicesFootnote(g_nServicesEndnote-1)
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: unoftn.cxx:484
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
Definition: unotext.cxx:193
Force hint expand (only matters for hints with CH_TXTATR).
unsigned char sal_Bool
Impl(SwXFootnote &rThis, SwFormatFootnote *const pFootnote, const bool bIsEndnote)
Definition: unoftn.cxx:75
char const *const g_ServicesFootnote[]
Definition: unoftn.cxx:186
css::uno::Type const & get()
virtual css::uno::Reference< css::text::XTextCursor > CreateCursor() override
Definition: unoftn.cxx:408
uno::WeakReference< uno::XInterface > m_wThis
Definition: unoftn.cxx:67
bool StartListening(SvtBroadcaster &rBroadcaster)
SwStartNode * GetStartNode()
Definition: node.hxx:601
const SwFormatFootnote & GetFootnote() const
Definition: txatbase.hxx:208
const SvXMLTokenMapEntry aTypes[]
bool XTextRangeToSwPaM(SwUnoInternalPaM &rToFill, const uno::Reference< text::XTextRange > &xTextRange,::sw::TextRangeMode const eMode)
Definition: unoobj2.cxx:1107
SvtBroadcaster & GetNotifier()
Definition: calbck.hxx:101
#define PROPERTY_MAP_FOOTNOTE
Definition: unomap.hxx:60
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:79
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > &xListener) override
Definition: unoftn.cxx:385
const SwFormatFootnote * GetFootnoteFormat() const
Definition: unoftn.cxx:86
const SwDoc * GetDoc() const
Definition: unotext.cxx:133
SwFormatFootnote * m_pFormatFootnote
Definition: unoftn.cxx:72
SwXFootnote & m_rThis
Definition: unoftn.cxx:66
virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL createTextCursor() override
Definition: unoftn.cxx:414
SwMoveFnCollection const & fnMoveForward
SwPam::Move()/Find() default argument.
Definition: paminit.cxx:59
sal_Int32 GetIndex() const
Definition: index.hxx:91
virtual void SAL_CALL addPropertyChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: unoftn.cxx:538
css::uno::WeakReference< css::text::XFootnote > const & GetXFootnote() const
Definition: fmtftn.hxx:94
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId()
Definition: unoftn.cxx:167
SwUnoPropertyMapProvider aSwMapProvider
Definition: unomap1.cxx:87
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override
Definition: unoftn.cxx:460
virtual void SAL_CALL removePropertyChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: unoftn.cxx:546
static css::uno::Reference< css::text::XFootnote > CreateXFootnote(SwDoc &rDoc, SwFormatFootnote *pFootnoteFormat, bool isEndnote=false)
Definition: unoftn.cxx:142
void SetSeqRefNo()
Set the sequence number for the current footnote.
Definition: atrftn.cxx:538
#define UNO_NAME_START_REDLINE
Definition: unoprnms.hxx:556
SwNodeIndex * GetStartNode() const
Definition: txtftn.hxx:41
SwXFootnote(SwDoc &rDoc, SwFormatFootnote &rFormat)
Definition: unoftn.cxx:131
static rtl::Reference< SwXParagraphEnumeration > Create(css::uno::Reference< css::text::XText > const &xParent, const std::shared_ptr< SwUnoCursor > &pCursor, const CursorType eType, SwTableBox const *const pTableBox=nullptr)
Definition: unoobj2.cxx:449
::std::unique_ptr< XmlIdRegistry_Impl > m_pImpl
virtual sal_Bool SAL_CALL supportsService(const OUString &rServiceName) override
Definition: unoftn.cxx:198
virtual bool DeleteAndJoin(SwPaM &)=0
complete delete of a given PaM
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &rPropertyName) override
Definition: unotext.cxx:1115
#define UNO_NAME_REFERENCE_ID
Definition: unoprnms.hxx:482
const SwTextNode & GetTextNode() const
Definition: txtftn.hxx:70
const SwStartNode * FindFootnoteStartNode() const
Definition: node.hxx:202
::comphelper::OInterfaceContainerHelper4< css::lang::XEventListener > m_EventListeners
Definition: unoftn.cxx:70
sal_uInt16 nPos
void Notify(const SfxHint &rHint) override
Definition: unoftn.cxx:119
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
Definition: ndtxt.hxx:864
Base class of the Writer document model elements.
Definition: node.hxx:81