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