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