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