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