LibreOffice Module sw (master)  1
core/crsr/bookmark.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 <memory>
21 #include <bookmark.hxx>
22 #include <IDocumentUndoRedo.hxx>
24 #include <IDocumentState.hxx>
25 #include <doc.hxx>
26 #include <ndtxt.hxx>
27 #include <pam.hxx>
28 #include <swserv.hxx>
29 #include <sfx2/linkmgr.hxx>
30 #include <sfx2/viewsh.hxx>
31 #include <UndoBookmark.hxx>
32 #include <unobookmark.hxx>
33 #include <xmloff/odffields.hxx>
34 #include <libxml/xmlwriter.h>
35 #include <comphelper/random.hxx>
37 #include <sal/log.hxx>
38 #include <svl/numformat.hxx>
39 #include <svl/zforlist.hxx>
40 #include <edtwin.hxx>
41 #include <DateFormFieldButton.hxx>
44 #include <comphelper/lok.hxx>
45 #include <txtfrm.hxx>
46 #include <LibreOfficeKit/LibreOfficeKitEnums.h>
47 #include <rtl/strbuf.hxx>
48 #include <strings.hrc>
49 
50 using namespace ::sw::mark;
51 using namespace ::com::sun::star;
52 using namespace ::com::sun::star::uno;
53 
54 namespace sw::mark
55 {
56 
58  {
59  SwPosition const& rStartPos(rMark.GetMarkStart());
60  SwPosition const& rEndPos(rMark.GetMarkEnd());
61  SwNodes const& rNodes(rStartPos.nNode.GetNodes());
62  SwNodeOffset const nStartNode(rStartPos.nNode.GetIndex());
63  SwNodeOffset const nEndNode(rEndPos.nNode.GetIndex());
64  int nFields(0);
65  std::optional<SwPosition> ret;
66  for (SwNodeOffset n = nEndNode; nStartNode <= n; --n)
67  {
68  SwNode *const pNode(rNodes[n]);
69  if (pNode->IsTextNode())
70  {
71  SwTextNode & rTextNode(*pNode->GetTextNode());
72  sal_Int32 const nStart(n == nStartNode
73  ? rStartPos.nContent.GetIndex() + 1
74  : 0);
75  sal_Int32 const nEnd(n == nEndNode
76  // subtract 1 to ignore the end char
77  ? rEndPos.nContent.GetIndex() - 1
78  : rTextNode.Len());
79  for (sal_Int32 i = nEnd; nStart < i; --i)
80  {
81  const sal_Unicode c(rTextNode.GetText()[i - 1]);
82  switch (c)
83  {
85  --nFields;
86  assert(0 <= nFields);
87  break;
89  ++nFields;
90  // fields in field result could happen by manual
91  // editing, although the field update deletes them
92  break;
94  if (nFields == 0)
95  {
96  assert(!ret); // one per field
97  ret = SwPosition(rTextNode, i - 1);
98 #ifndef DBG_UTIL
99  return *ret;
100 #endif
101  }
102  break;
103  }
104  }
105  }
106  else if (pNode->IsEndNode() && !pNode->StartOfSectionNode()->IsSectionNode())
107  {
108  assert(nStartNode <= pNode->StartOfSectionIndex());
109  // fieldmark cannot overlap node section, unless it's a section
110  n = pNode->StartOfSectionIndex();
111  }
112  else
113  {
114  assert(pNode->IsNoTextNode() || pNode->IsSectionNode());
115  }
116  }
117  assert(ret); // must have found it
118  return *ret;
119  }
120 } // namespace sw::mark
121 
122 namespace
123 {
124  void lcl_FixPosition(SwPosition& rPos)
125  {
126  // make sure the position has 1) the proper node, and 2) a proper index
127  SwTextNode* pTextNode = rPos.nNode.GetNode().GetTextNode();
128  if(pTextNode == nullptr && rPos.nContent.GetIndex() > 0)
129  {
130  SAL_INFO(
131  "sw.core",
132  "illegal position: " << rPos.nContent.GetIndex()
133  << " without proper TextNode");
134  rPos.nContent.Assign(nullptr, 0);
135  }
136  else if(pTextNode != nullptr && rPos.nContent.GetIndex() > pTextNode->Len())
137  {
138  SAL_INFO(
139  "sw.core",
140  "illegal position: " << rPos.nContent.GetIndex()
141  << " is beyond " << pTextNode->Len());
142  rPos.nContent.Assign(pTextNode, pTextNode->Len());
143  }
144  }
145 
146  void lcl_AssertFieldMarksSet(const Fieldmark& rField,
147  const sal_Unicode aStartMark,
148  const sal_Unicode aEndMark)
149  {
150  if (aEndMark != CH_TXT_ATR_FORMELEMENT)
151  {
152  SwPosition const& rStart(rField.GetMarkStart());
153  assert(rStart.nNode.GetNode().GetTextNode()->GetText()[rStart.nContent.GetIndex()] == aStartMark); (void) rStart; (void) aStartMark;
154  SwPosition const sepPos(sw::mark::FindFieldSep(rField));
155  assert(sepPos.nNode.GetNode().GetTextNode()->GetText()[sepPos.nContent.GetIndex()] == CH_TXT_ATR_FIELDSEP); (void) sepPos;
156  }
157  SwPosition const& rEnd(rField.GetMarkEnd());
158  assert(rEnd.nNode.GetNode().GetTextNode()->GetText()[rEnd.nContent.GetIndex() - 1] == aEndMark); (void) rEnd;
159  }
160 
161  void lcl_SetFieldMarks(Fieldmark& rField,
162  SwDoc& io_rDoc,
163  const sal_Unicode aStartMark,
164  const sal_Unicode aEndMark,
165  SwPosition const*const pSepPos)
166  {
168  OUString startChar(aStartMark);
169  if (aEndMark != CH_TXT_ATR_FORMELEMENT
170  && rField.GetMarkStart() == rField.GetMarkEnd())
171  {
172  // do only 1 InsertString call - to expand existing bookmarks at the
173  // position over the whole field instead of just aStartMark
174  startChar += OUStringChar(CH_TXT_ATR_FIELDSEP) + OUStringChar(aEndMark);
175  }
176 
177  SwPosition start = rField.GetMarkStart();
178  if (aEndMark != CH_TXT_ATR_FORMELEMENT)
179  {
180  SwPaM aStartPaM(start);
181  io_rDoc.getIDocumentContentOperations().InsertString(aStartPaM, startChar);
182  start.nContent -= startChar.getLength(); // restore, it was moved by InsertString
183  // do not manipulate via reference directly but call SetMarkStartPos
184  // which works even if start and end pos were the same
185  rField.SetMarkStartPos( start );
186  SwPosition& rEnd = rField.GetMarkEnd(); // note: retrieve after
187  // setting start, because if start==end it can go stale, see SetMarkPos()
188  assert(pSepPos == nullptr || (start < *pSepPos && *pSepPos <= rEnd));
189  if (startChar.getLength() == 1)
190  {
191  *aStartPaM.GetPoint() = pSepPos ? *pSepPos : rEnd;
192  io_rDoc.getIDocumentContentOperations().InsertString(aStartPaM, OUString(CH_TXT_ATR_FIELDSEP));
193  if (!pSepPos || rEnd < *pSepPos)
194  { // rEnd is not moved automatically if it's same as insert pos
195  ++rEnd.nContent;
196  }
197  }
198  assert(pSepPos == nullptr || (start < *pSepPos && *pSepPos <= rEnd));
199  }
200  else
201  {
202  assert(pSepPos == nullptr);
203  }
204 
205  SwPosition& rEnd = rField.GetMarkEnd();
206  if (aEndMark && startChar.getLength() == 1)
207  {
208  SwPaM aEndPaM(rEnd);
209  io_rDoc.getIDocumentContentOperations().InsertString(aEndPaM, OUString(aEndMark));
210  ++rEnd.nContent;
211  }
212  lcl_AssertFieldMarksSet(rField, aStartMark, aEndMark);
213 
215  }
216 
217  void lcl_RemoveFieldMarks(const Fieldmark& rField,
218  SwDoc& io_rDoc,
219  const sal_Unicode aStartMark,
220  const sal_Unicode aEndMark)
221  {
223 
224  const SwPosition& rStart = rField.GetMarkStart();
225  SwTextNode const*const pStartTextNode = rStart.nNode.GetNode().GetTextNode();
226  assert(pStartTextNode);
227  if (aEndMark != CH_TXT_ATR_FORMELEMENT)
228  {
229  (void) pStartTextNode;
230  // check this before start / end because of the +1 / -1 ...
231  SwPosition const sepPos(sw::mark::FindFieldSep(rField));
232  io_rDoc.GetDocumentContentOperationsManager().DeleteDummyChar(rStart, aStartMark);
234  }
235 
236  const SwPosition& rEnd = rField.GetMarkEnd();
237  SwTextNode *const pEndTextNode = rEnd.nNode.GetNode().GetTextNode();
238  assert(pEndTextNode);
239  const sal_Int32 nEndPos = (rEnd == rStart)
240  ? rEnd.nContent.GetIndex()
241  : rEnd.nContent.GetIndex() - 1;
242  assert(pEndTextNode->GetText()[nEndPos] == aEndMark);
243  SwPosition const aEnd(*pEndTextNode, nEndPos);
244  io_rDoc.GetDocumentContentOperationsManager().DeleteDummyChar(aEnd, aEndMark);
245 
247  }
248 
249  auto InvalidatePosition(SwPosition const& rPos) -> void
250  {
251  SwUpdateAttr const aHint(rPos.nContent.GetIndex(), rPos.nContent.GetIndex(), 0);
253  }
254 }
255 
256 namespace sw::mark
257 {
259  const OUString& rName)
260  : m_pPos1(new SwPosition(*(aPaM.GetPoint())))
261  , m_aName(rName)
262  {
263  m_pPos1->nContent.SetMark(this);
264  lcl_FixPosition(*m_pPos1);
265  if (aPaM.HasMark() && (*aPaM.GetMark() != *aPaM.GetPoint()))
266  {
268  lcl_FixPosition(*m_pPos2);
269  }
270  }
271 
272  // For fieldmarks, the CH_TXT_ATR_FIELDSTART and CH_TXT_ATR_FIELDEND
273  // themselves are part of the covered range. This is guaranteed by
274  // TextFieldmark::InitDoc/lcl_AssureFieldMarksSet.
275  bool MarkBase::IsCoveringPosition(const SwPosition& rPos) const
276  {
277  return GetMarkStart() <= rPos && rPos < GetMarkEnd();
278  }
279 
280  void MarkBase::SetMarkPos(const SwPosition& rNewPos)
281  {
282  std::make_unique<SwPosition>(rNewPos).swap(m_pPos1);
283  m_pPos1->nContent.SetMark(this);
284  }
285 
287  {
288  std::make_unique<SwPosition>(rNewPos).swap(m_pPos2);
289  m_pPos2->nContent.SetMark(this);
290  }
291 
292  OUString MarkBase::ToString( ) const
293  {
294  return "Mark: ( Name, [ Node1, Index1 ] ): ( " + m_aName + ", [ "
295  + OUString::number( sal_Int32(GetMarkPos().nNode.GetIndex()) ) + ", "
296  + OUString::number( GetMarkPos().nContent.GetIndex( ) ) + " ] )";
297  }
298 
300  {
301  (void)xmlTextWriterStartElement(pWriter, BAD_CAST("MarkBase"));
302  (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("name"), BAD_CAST(m_aName.toUtf8().getStr()));
303  (void)xmlTextWriterStartElement(pWriter, BAD_CAST("markPos"));
304  GetMarkPos().dumpAsXml(pWriter);
305  (void)xmlTextWriterEndElement(pWriter);
306  if (IsExpanded())
307  {
308  (void)xmlTextWriterStartElement(pWriter, BAD_CAST("otherMarkPos"));
309  GetOtherMarkPos().dumpAsXml(pWriter);
310  (void)xmlTextWriterEndElement(pWriter);
311  }
312  (void)xmlTextWriterEndElement(pWriter);
313  }
314 
316  { }
317 
318  OUString MarkBase::GenerateNewName(std::u16string_view rPrefix)
319  {
320  static bool bHack = (getenv("LIBO_ONEWAY_STABLE_ODF_EXPORT") != nullptr);
321 
322  if (bHack)
323  {
324  static sal_Int64 nIdCounter = SAL_CONST_INT64(6000000000);
325  return rPrefix + OUString::number(nIdCounter++);
326  }
327  else
328  {
329  static OUString sUniquePostfix;
330  static sal_Int32 nCount = SAL_MAX_INT32;
331  if(nCount == SAL_MAX_INT32)
332  {
333  unsigned int const n(comphelper::rng::uniform_uint_distribution(0,
334  std::numeric_limits<unsigned int>::max()));
335  sUniquePostfix = "_" + OUString::number(n);
336  nCount = 0;
337  }
338  // putting the counter in front of the random parts will speed up string comparisons
339  return rPrefix + OUString::number(nCount++) + sUniquePostfix;
340  }
341  }
342 
343  void MarkBase::SwClientNotify(const SwModify&, const SfxHint& rHint)
344  {
345  CallSwClientNotify(rHint);
346  if (rHint.GetId() != SfxHintId::SwLegacyModify)
347  return;
348  auto pLegacy = static_cast<const sw::LegacyModifyHint*>(&rHint);
349  if(RES_REMOVE_UNO_OBJECT == pLegacy->GetWhich())
350  { // invalidate cached uno object
351  SetXBookmark(uno::Reference<text::XTextContent>(nullptr));
352  }
353  }
354 
356  {
357  }
358 
360  : MarkBase(rPaM, MarkBase::GenerateNewName(u"__NavigatorReminder__"))
361  { }
362 
363  UnoMark::UnoMark(const SwPaM& aPaM)
364  : MarkBase(aPaM, MarkBase::GenerateNewName(u"__UnoMark__"))
365  { }
366 
368  : MarkBase(aPaM, MarkBase::GenerateNewName(u"__DdeLink__"))
369  { }
370 
372  {
373  m_aRefObj = pObj;
374  }
375 
377  {
378  if(m_aRefObj.is())
380  }
381 
383  {
384  if( m_aRefObj.is() )
385  {
386  if(m_aRefObj->HasDataLinks())
387  {
389  p->SendDataChanged();
390  }
392  }
393  }
394 
396  const vcl::KeyCode& rCode,
397  const OUString& rName)
398  : DdeBookmark(aPaM)
399  , m_aCode(rCode)
400  , m_bHidden(false)
401  {
402  m_aName = rName;
403  }
404 
405  void Bookmark::InitDoc(SwDoc& io_rDoc,
406  sw::mark::InsertMode const, SwPosition const*const)
407  {
408  if (io_rDoc.GetIDocumentUndoRedo().DoesUndo())
409  {
411  std::make_unique<SwUndoInsBookmark>(*this));
412  }
413  io_rDoc.getIDocumentState().SetModified();
415  }
416 
418  {
420 
421  if (io_rDoc.GetIDocumentUndoRedo().DoesUndo())
422  {
424  std::make_unique<SwUndoDeleteBookmark>(*this));
425  }
426  io_rDoc.getIDocumentState().SetModified();
428  }
429 
430  // invalidate text frames in case it's hidden or Formatting Marks enabled
432  {
433  InvalidatePosition(GetMarkPos());
434  if (IsExpanded())
435  {
436  InvalidatePosition(GetOtherMarkPos());
437  }
438  }
439 
440  void Bookmark::Hide(bool const isHide)
441  {
442  if (isHide != m_bHidden)
443  {
444  m_bHidden = isHide;
446  }
447  }
448 
449  void Bookmark::SetHideCondition(OUString const& rHideCondition)
450  {
451  if (m_sHideCondition != rHideCondition)
452  {
453  m_sHideCondition = rHideCondition;
454  // don't eval condition here yet - probably only needed for
455  // UI editing condition and that doesn't exist yet
456  }
457  }
458 
460  {
461  SwDoc& rDoc( GetMarkPos().GetDoc() );
462  return rDoc.GetXmlIdRegistry();
463  }
464 
466  {
467  SwDoc& rDoc( GetMarkPos().GetDoc() );
468  return rDoc.IsClipBoard();
469  }
470 
471  bool Bookmark::IsInUndo() const
472  {
473  return false;
474  }
475 
477  {
478  SwDoc& rDoc( GetMarkPos().GetDoc() );
479  return !rDoc.IsInHeaderFooter( GetMarkPos().nNode );
480  }
481 
482  uno::Reference< rdf::XMetadatable > Bookmark::MakeUnoObject()
483  {
484  SwDoc& rDoc( GetMarkPos().GetDoc() );
485  const uno::Reference< rdf::XMetadatable> xMeta(
486  SwXBookmark::CreateXBookmark(rDoc, this), uno::UNO_QUERY);
487  return xMeta;
488  }
489 
491  : MarkBase(rPaM, MarkBase::GenerateNewName(u"__Fieldmark__"))
492  {
493  if(!IsExpanded())
495  }
496 
497  void Fieldmark::SetMarkStartPos( const SwPosition& rNewStartPos )
498  {
499  if ( GetMarkPos( ) <= GetOtherMarkPos( ) )
500  return SetMarkPos( rNewStartPos );
501  else
502  return SetOtherMarkPos( rNewStartPos );
503  }
504 
505  void Fieldmark::SetMarkEndPos( const SwPosition& rNewEndPos )
506  {
507  if ( GetMarkPos( ) <= GetOtherMarkPos( ) )
508  return SetOtherMarkPos( rNewEndPos );
509  else
510  return SetMarkPos( rNewEndPos );
511  }
512 
513  OUString Fieldmark::ToString( ) const
514  {
515  return "Fieldmark: ( Name, Type, [ Nd1, Id1 ], [ Nd2, Id2 ] ): ( " + m_aName + ", "
516  + m_aFieldname + ", [ " + OUString::number( sal_Int32(GetMarkPos().nNode.GetIndex( )) )
517  + ", " + OUString::number( GetMarkPos( ).nContent.GetIndex( ) ) + " ], ["
518  + OUString::number( sal_Int32(GetOtherMarkPos().nNode.GetIndex( )) ) + ", "
519  + OUString::number( GetOtherMarkPos( ).nContent.GetIndex( ) ) + " ] ) ";
520  }
521 
523  {
524  // TODO: Does exist a better solution to trigger a format of the
525  // fieldmark portion? If yes, please use it.
526  SwPaM aPaM( GetMarkPos(), GetOtherMarkPos() );
527  aPaM.InvalidatePaM();
528  }
529 
531  {
532  (void)xmlTextWriterStartElement(pWriter, BAD_CAST("Fieldmark"));
533  (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("fieldname"), BAD_CAST(m_aFieldname.toUtf8().getStr()));
534  (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("fieldHelptext"), BAD_CAST(m_aFieldHelptext.toUtf8().getStr()));
535  MarkBase::dumpAsXml(pWriter);
536  (void)xmlTextWriterStartElement(pWriter, BAD_CAST("parameters"));
537  for (auto& rParam : m_vParams)
538  {
539  (void)xmlTextWriterStartElement(pWriter, BAD_CAST("parameter"));
540  (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("name"), BAD_CAST(rParam.first.toUtf8().getStr()));
541  (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"), BAD_CAST(comphelper::anyToString(rParam.second).toUtf8().getStr()));
542  (void)xmlTextWriterEndElement(pWriter);
543  }
544  (void)xmlTextWriterEndElement(pWriter);
545  (void)xmlTextWriterEndElement(pWriter);
546  }
547 
548  TextFieldmark::TextFieldmark(const SwPaM& rPaM, const OUString& rName)
549  : Fieldmark(rPaM)
550  {
551  if ( !rName.isEmpty() )
552  m_aName = rName;
553  }
554 
556  sw::mark::InsertMode const eMode, SwPosition const*const pSepPos)
557  {
558  if (eMode == sw::mark::InsertMode::New)
559  {
560  lcl_SetFieldMarks(*this, io_rDoc, CH_TXT_ATR_FIELDSTART, CH_TXT_ATR_FIELDEND, pSepPos);
561  }
562  else
563  {
564  lcl_AssertFieldMarksSet(*this, CH_TXT_ATR_FIELDSTART, CH_TXT_ATR_FIELDEND);
565  }
566  }
567 
569  {
570  IDocumentUndoRedo & rIDUR(rDoc.GetIDocumentUndoRedo());
571  if (rIDUR.DoesUndo())
572  {
573  rIDUR.AppendUndo(std::make_unique<SwUndoDelTextFieldmark>(*this));
574  }
575  ::sw::UndoGuard const ug(rIDUR); // prevent SwUndoDeletes
576  lcl_RemoveFieldMarks(*this, rDoc, CH_TXT_ATR_FIELDSTART, CH_TXT_ATR_FIELDEND);
577  // notify layouts to unhide - for the entire fieldmark, as in InitDoc()
578  SwPaM const tmp(GetMarkPos(), GetOtherMarkPos());
580  }
581 
583  : Fieldmark(rPaM)
584  { }
585 
587  sw::mark::InsertMode const eMode, SwPosition const*const pSepPos)
588  {
589  assert(pSepPos == nullptr);
590  if (eMode == sw::mark::InsertMode::New)
591  {
592  lcl_SetFieldMarks(*this, io_rDoc, CH_TXT_ATR_FIELDSTART, CH_TXT_ATR_FORMELEMENT, pSepPos);
593 
594  // For some reason the end mark is moved from 1 by the Insert:
595  // we don't want this for checkboxes
596  SwPosition aNewEndPos = GetMarkEnd();
597  aNewEndPos.nContent--;
598  SetMarkEndPos( aNewEndPos );
599  }
600  else
601  {
602  lcl_AssertFieldMarksSet(*this, CH_TXT_ATR_FIELDSTART, CH_TXT_ATR_FORMELEMENT);
603  }
604  }
605 
607  {
608  IDocumentUndoRedo & rIDUR(rDoc.GetIDocumentUndoRedo());
609  if (rIDUR.DoesUndo())
610  {
611  rIDUR.AppendUndo(std::make_unique<SwUndoDelNoTextFieldmark>(*this));
612  }
613  ::sw::UndoGuard const ug(rIDUR); // prevent SwUndoDeletes
614  lcl_RemoveFieldMarks(*this, rDoc,
616  }
617 
618 
620  : NonTextFieldmark(rPaM)
621  { }
622 
623  void CheckboxFieldmark::SetChecked(bool checked)
624  {
625  if ( IsChecked() != checked )
626  {
627  (*GetParameters())[OUString(ODF_FORMCHECKBOX_RESULT)] <<= checked;
628  // mark document as modified
629  SwDoc& rDoc( GetMarkPos().GetDoc() );
631  }
632  }
633 
635  {
636  bool bResult = false;
637  parameter_map_t::const_iterator pResult = GetParameters()->find(OUString(ODF_FORMCHECKBOX_RESULT));
638  if(pResult != GetParameters()->end())
639  pResult->second >>= bResult;
640  return bResult;
641  }
642 
644  : NonTextFieldmark(rPaM)
645  , m_pButton(nullptr)
646  {
647  }
648 
650  {
652  }
653 
655  {
656  if(m_pButton)
658  }
659 
662  {
663  }
664 
666  {
667  }
668 
670  {
671  if(pEditWin)
672  {
673  if(!m_pButton)
676  m_pButton->Show();
677  }
678  }
679 
681  {
683  }
684 
685  void DropDownFieldmark::SetPortionPaintArea(const SwRect& rPortionPaintArea)
686  {
687  m_aPortionPaintArea = rPortionPaintArea;
688  if(m_pButton)
689  {
690  m_pButton->Show();
692  }
693  }
694 
696  {
698  return;
699 
700  if (!pViewShell || pViewShell->isLOKMobilePhone())
701  return;
702 
704  return;
705 
706  OStringBuffer sPayload;
707  sPayload = OString::Concat("{\"action\": \"show\","
708  " \"type\": \"drop-down\", \"textArea\": \"") +
709  m_aPortionPaintArea.SVRect().toString() + "\",";
710  // Add field params to the message
711  sPayload.append(" \"params\": { \"items\": [");
712 
713  // List items
714  auto pParameters = this->GetParameters();
715  auto pListEntriesIter = pParameters->find(ODF_FORMDROPDOWN_LISTENTRY);
716  css::uno::Sequence<OUString> vListEntries;
717  if (pListEntriesIter != pParameters->end())
718  {
719  pListEntriesIter->second >>= vListEntries;
720  for (const OUString& sItem : std::as_const(vListEntries))
721  sPayload.append("\"" + OUStringToOString(sItem, RTL_TEXTENCODING_UTF8) + "\", ");
722  sPayload.setLength(sPayload.getLength() - 2);
723  }
724  sPayload.append("], ");
725 
726  // Selected item
727  auto pSelectedItemIter = pParameters->find(ODF_FORMDROPDOWN_RESULT);
728  sal_Int32 nSelection = -1;
729  if (pSelectedItemIter != pParameters->end())
730  {
731  pSelectedItemIter->second >>= nSelection;
732  }
733  sPayload.append("\"selected\": \"" + OString::number(nSelection) + "\", ");
734 
735  // Placeholder text
736  sPayload.append("\"placeholderText\": \"" + OUStringToOString(SwResId(STR_DROP_DOWN_EMPTY_LIST), RTL_TEXTENCODING_UTF8) + "\"}}");
737  pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_FORM_FIELD_BUTTON, sPayload.toString().getStr());
738  }
739 
741  {
742  OString sPayload = "{\"action\": \"hide\", \"type\": \"drop-down\"}";
743  pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_FORM_FIELD_BUTTON, sPayload.getStr());
744  }
745 
748  , m_pNumberFormatter(nullptr)
749  , m_pDocumentContentOperationsManager(nullptr)
750  {
751  }
752 
754  {
755  }
756 
758  sw::mark::InsertMode eMode, SwPosition const*const pSepPos)
759  {
762  if (eMode == sw::mark::InsertMode::New)
763  {
764  lcl_SetFieldMarks(*this, io_rDoc, CH_TXT_ATR_FIELDSTART, CH_TXT_ATR_FIELDEND, pSepPos);
765  }
766  else
767  {
768  lcl_AssertFieldMarksSet(*this, CH_TXT_ATR_FIELDSTART, CH_TXT_ATR_FIELDEND);
769  }
770  }
771 
773  {
774  IDocumentUndoRedo & rIDUR(rDoc.GetIDocumentUndoRedo());
775  if (rIDUR.DoesUndo())
776  {
777  // TODO does this need a 3rd Undo class?
778  rIDUR.AppendUndo(std::make_unique<SwUndoDelTextFieldmark>(*this));
779  }
780  ::sw::UndoGuard const ug(rIDUR); // prevent SwUndoDeletes
781  lcl_RemoveFieldMarks(*this, rDoc, CH_TXT_ATR_FIELDSTART, CH_TXT_ATR_FIELDEND);
782  // notify layouts to unhide - for the entire fieldmark, as in InitDoc()
783  SwPaM const tmp(GetMarkPos(), GetOtherMarkPos());
785  }
786 
788  {
789  if(pEditWin)
790  {
791  if(!m_pButton)
794  m_pButton->CalcPosAndSize(aPaintArea);
795  m_pButton->Show();
796  }
797  }
798 
799  void DateFieldmark::SetPortionPaintAreaStart(const SwRect& rPortionPaintArea)
800  {
801  if (rPortionPaintArea.IsEmpty())
802  return;
803 
804  m_aPaintAreaStart = rPortionPaintArea;
806  }
807 
808  void DateFieldmark::SetPortionPaintAreaEnd(const SwRect& rPortionPaintArea)
809  {
810  if (rPortionPaintArea.IsEmpty())
811  return;
812 
813  if(m_aPaintAreaEnd == rPortionPaintArea &&
815  return;
816 
817  m_aPaintAreaEnd = rPortionPaintArea;
818  if(m_pButton)
819  {
820  m_pButton->Show();
822  m_pButton->CalcPosAndSize(aPaintArea);
824  }
826  }
827 
828  OUString DateFieldmark::GetContent() const
829  {
830  const SwTextNode* const pTextNode = GetMarkEnd().nNode.GetNode().GetTextNode();
831  SwPosition const sepPos(sw::mark::FindFieldSep(*this));
832  const sal_Int32 nStart(sepPos.nContent.GetIndex());
833  const sal_Int32 nEnd (GetMarkEnd().nContent.GetIndex());
834 
835  OUString sContent;
836  if(nStart + 1 < pTextNode->GetText().getLength() && nEnd <= pTextNode->GetText().getLength() &&
837  nEnd > nStart + 2)
838  sContent = pTextNode->GetText().copy(nStart + 1, nEnd - nStart - 2);
839  return sContent;
840  }
841 
842  void DateFieldmark::ReplaceContent(const OUString& sNewContent)
843  {
845  return;
846 
847  const SwTextNode* const pTextNode = GetMarkEnd().nNode.GetNode().GetTextNode();
848  SwPosition const sepPos(sw::mark::FindFieldSep(*this));
849  const sal_Int32 nStart(sepPos.nContent.GetIndex());
850  const sal_Int32 nEnd (GetMarkEnd().nContent.GetIndex());
851 
852  if(nStart + 1 < pTextNode->GetText().getLength() && nEnd <= pTextNode->GetText().getLength() &&
853  nEnd > nStart + 2)
854  {
855  SwPaM aFieldPam(GetMarkStart().nNode, nStart + 1,
856  GetMarkStart().nNode, nEnd - 1);
857  m_pDocumentContentOperationsManager->ReplaceRange(aFieldPam, sNewContent, false);
858  }
859  else
860  {
861  SwPaM aFieldStartPam(GetMarkStart().nNode, nStart + 1);
862  m_pDocumentContentOperationsManager->InsertString(aFieldStartPam, sNewContent);
863  }
864 
865  }
866 
867  std::pair<bool, double> DateFieldmark::GetCurrentDate() const
868  {
869  // Check current date param first
870  std::pair<bool, double> aResult = ParseCurrentDateParam();
871  if(aResult.first)
872  return aResult;
873 
875  bool bFoundValidDate = false;
876  double dCurrentDate = 0;
877  OUString sDateFormat;
878  auto pResult = pParameters->find(ODF_FORMDATE_DATEFORMAT);
879  if (pResult != pParameters->end())
880  {
881  pResult->second >>= sDateFormat;
882  }
883 
884  OUString sLang;
885  pResult = pParameters->find(ODF_FORMDATE_DATEFORMAT_LANGUAGE);
886  if (pResult != pParameters->end())
887  {
888  pResult->second >>= sLang;
889  }
890 
891  // Get current content of the field
892  OUString sContent = GetContent();
893 
894  sal_uInt32 nFormat = m_pNumberFormatter->GetEntryKey(sDateFormat, LanguageTag(sLang).getLanguageType());
895  if (nFormat == NUMBERFORMAT_ENTRY_NOT_FOUND)
896  {
897  sal_Int32 nCheckPos = 0;
899  m_pNumberFormatter->PutEntry(sDateFormat,
900  nCheckPos,
901  nType,
902  nFormat,
903  LanguageTag(sLang).getLanguageType());
904  }
905 
906  if (nFormat != NUMBERFORMAT_ENTRY_NOT_FOUND)
907  {
908  bFoundValidDate = m_pNumberFormatter->IsNumberFormat(sContent, nFormat, dCurrentDate);
909  }
910  return std::pair<bool, double>(bFoundValidDate, dCurrentDate);
911  }
912 
913  void DateFieldmark::SetCurrentDate(double fDate)
914  {
915  // Replace current content with the selected date
917 
918  // Also save the current date in a standard format
920  (*pParameters)[ODF_FORMDATE_CURRENTDATE] <<= GetDateInStandardDateFormat(fDate);
921  }
922 
923  OUString DateFieldmark::GetDateInStandardDateFormat(double fDate) const
924  {
925  OUString sCurrentDate;
927  if (nFormat == NUMBERFORMAT_ENTRY_NOT_FOUND)
928  {
929  sal_Int32 nCheckPos = 0;
931  OUString sFormat = ODF_FORMDATE_CURRENTDATE_FORMAT;
932  m_pNumberFormatter->PutEntry(sFormat,
933  nCheckPos,
934  nType,
935  nFormat,
937  }
938 
939  if (nFormat != NUMBERFORMAT_ENTRY_NOT_FOUND)
940  {
941  const Color* pCol = nullptr;
942  m_pNumberFormatter->GetOutputString(fDate, nFormat, sCurrentDate, &pCol, false);
943  }
944  return sCurrentDate;
945  }
946 
947  std::pair<bool, double> DateFieldmark::ParseCurrentDateParam() const
948  {
949  bool bFoundValidDate = false;
950  double dCurrentDate = 0;
951 
953  auto pResult = pParameters->find(ODF_FORMDATE_CURRENTDATE);
954  OUString sCurrentDate;
955  if (pResult != pParameters->end())
956  {
957  pResult->second >>= sCurrentDate;
958  }
959  if(!sCurrentDate.isEmpty())
960  {
962  if (nFormat == NUMBERFORMAT_ENTRY_NOT_FOUND)
963  {
964  sal_Int32 nCheckPos = 0;
966  OUString sFormat = ODF_FORMDATE_CURRENTDATE_FORMAT;
967  m_pNumberFormatter->PutEntry(sFormat,
968  nCheckPos,
969  nType,
970  nFormat,
972  }
973 
974  if(nFormat != NUMBERFORMAT_ENTRY_NOT_FOUND)
975  {
976  bFoundValidDate = m_pNumberFormatter->IsNumberFormat(sCurrentDate, nFormat, dCurrentDate);
977  }
978  }
979  return std::pair<bool, double>(bFoundValidDate, dCurrentDate);
980  }
981 
982 
983  OUString DateFieldmark::GetDateInCurrentDateFormat(double fDate) const
984  {
985  // Get current date format and language
986  OUString sDateFormat;
988  auto pResult = pParameters->find(ODF_FORMDATE_DATEFORMAT);
989  if (pResult != pParameters->end())
990  {
991  pResult->second >>= sDateFormat;
992  }
993 
994  OUString sLang;
995  pResult = pParameters->find(ODF_FORMDATE_DATEFORMAT_LANGUAGE);
996  if (pResult != pParameters->end())
997  {
998  pResult->second >>= sLang;
999  }
1000 
1001  // Fill the content with the specified format
1002  OUString sCurrentContent;
1003  sal_uInt32 nFormat = m_pNumberFormatter->GetEntryKey(sDateFormat, LanguageTag(sLang).getLanguageType());
1004  if (nFormat == NUMBERFORMAT_ENTRY_NOT_FOUND)
1005  {
1006  sal_Int32 nCheckPos = 0;
1008  OUString sFormat = sDateFormat;
1009  m_pNumberFormatter->PutEntry(sFormat,
1010  nCheckPos,
1011  nType,
1012  nFormat,
1013  LanguageTag(sLang).getLanguageType());
1014  }
1015 
1016  if (nFormat != NUMBERFORMAT_ENTRY_NOT_FOUND)
1017  {
1018  const Color* pCol = nullptr;
1019  m_pNumberFormatter->GetOutputString(fDate, nFormat, sCurrentContent, &pCol, false);
1020  }
1021  return sCurrentContent;
1022  }
1023 
1025  {
1026  std::pair<bool, double> aResult = ParseCurrentDateParam();
1027  if(!aResult.first)
1028  return;
1029 
1030  // Current date became invalid
1031  if(GetDateInCurrentDateFormat(aResult.second) != GetContent())
1032  {
1034  (*pParameters)[ODF_FORMDATE_CURRENTDATE] <<= OUString();
1035  }
1036  }
1037 }
1038 
1039 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void SetMarkStartPos(const SwPosition &rNewStartPos)
virtual void Hide(bool rHide) override
virtual std::pair< bool, double > GetCurrentDate() const override
bool is() const
virtual void InitDoc(SwDoc &io_rDoc, sw::mark::InsertMode eMode, SwPosition const *pSepPos) override
DateFieldmark(const SwPaM &rPaM)
static void SendLOKHideMessage(const SfxViewShell *pViewShell)
std::map< OUString, css::uno::Any > parameter_map_t
Definition: IMark.hxx:94
Marks a position in the document model.
Definition: pam.hxx:36
bool IsSectionNode() const
Definition: node.hxx:646
bool isLOKMobilePhone() const
bool IsChecked() const override
OUString m_aName
virtual void ShowButton(SwEditWin *pEditWin) override
const OUString & GetText() const
Definition: ndtxt.hxx:218
virtual bool IsInUndo() const override
virtual void ReplaceContent(const OUString &sNewContent) override
SvNumberFormatter * GetNumberFormatter(bool bCreate=true)
Definition: doc.hxx:1411
constexpr TypedWhichId< SwPtrMsgPoolItem > RES_REMOVE_UNO_OBJECT(181)
SwNodeOffset StartOfSectionIndex() const
Definition: node.hxx:675
SwNodeIndex nNode
Definition: pam.hxx:38
virtual sal_Int32 Len() const override
Definition: ndtxt.cxx:278
virtual void SetModified()=0
Must be called manually at changes of format.
void disposeAndClear()
const SwPosition * GetMark() const
Definition: pam.hxx:210
sal_Int64 n
#define ODF_FORMDATE_CURRENTDATE
virtual SwUndoId EndUndo(SwUndoId const eUndoId, SwRewriter const *const pRewriter)=0
Closes undo block.
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const override
virtual void InitDoc(SwDoc &io_rDoc, sw::mark::InsertMode eMode, SwPosition const *pSepPos) override
Definition: doc.hxx:188
#define ODF_FORMDATE_DATEFORMAT_LANGUAGE
virtual SwPosition & GetMarkStart() const override
IDocumentLinksAdministration const & getIDocumentLinksAdministration() const
Definition: doc.cxx:260
sw::DocumentContentOperationsManager * m_pDocumentContentOperationsManager
virtual void SwClientNotify(const SwModify &, const SfxHint &) override
virtual auto InvalidateFrames() -> void override
virtual const SwPosition & GetMarkPos() const =0
SwPosition FindFieldSep(IFieldmark const &rMark)
return position of the CH_TXT_ATR_FIELDSEP for rMark
void SetChecked(bool checked) override
virtual OUString ToString() const override
SwNode & GetNode() const
Definition: ndindex.hxx:121
UnoMark(const SwPaM &rPaM)
virtual ::sfx2::IXmlIdRegistry & GetRegistry() override
IDocumentUndoRedo & GetIDocumentUndoRedo()
Definition: doc.cxx:144
Of course Writer needs its own rectangles.
Definition: swrect.hxx:34
IDocumentContentOperations const & getIDocumentContentOperations() const
Definition: doc.cxx:315
void SetPortionPaintAreaEnd(const SwRect &rPortionPaintArea)
virtual bool IsCoveringPosition(const SwPosition &rPos) const override
#define CH_TXT_ATR_FORMELEMENT
Definition: hintids.hxx:177
virtual ~DdeBookmark() override
bool InsertString(const SwPaM &rRg, const OUString &, const SwInsertFlags nInsertMode=SwInsertFlags::EMPTYEXPAND) override
Insert string into existing text node at position rRg.Point().
#define ODF_FORMDROPDOWN_RESULT
SfxHintId GetId() const
TextFieldmark(const SwPaM &rPaM, const OUString &rName)
#define ODF_FORMCHECKBOX_RESULT
bool IsInHeaderFooter(const SwNodeIndex &rIdx) const
Definition: doclay.cxx:1552
Fieldmark with a drop down button (e.g. this button opens the date picker for a date field) ...
unsigned int uniform_uint_distribution(unsigned int a, unsigned int b)
void InvalidatePaM()
Definition: pam.cxx:1129
std::unique_ptr< SwPosition > m_pPos1
virtual bool IsExpanded() const override
OUString SwResId(TranslateId aId)
Definition: swmodule.cxx:165
Point TopLeft() const
Definition: swrect.hxx:254
virtual void InitDoc(SwDoc &io_Doc, sw::mark::InsertMode eMode, SwPosition const *pSepPos) override
#define ODF_FORMDATE_CURRENTDATE_LANGUAGE
virtual SwPosition & GetMarkEnd() const override
sal_uInt16 sal_Unicode
SwIndex nContent
Definition: pam.hxx:39
bool PutEntry(OUString &rString, sal_Int32 &nCheckPos, SvNumFormatType &nType, sal_uInt32 &nKey, LanguageType eLnge=LANGUAGE_DONTKNOW, bool bReplaceBooleanEquivalent=true)
std::unique_ptr< SwPosition > m_pPos2
constexpr sal_uInt32 NUMBERFORMAT_ENTRY_NOT_FOUND
virtual ~DropDownFieldmark() override
int nCount
void RemoveServer(SvLinkSource *rObj)
virtual void libreOfficeKitViewCallback(int nType, const char *pPayload) const override
std::pair< bool, double > ParseCurrentDateParam() const
::sfx2::IXmlIdRegistry & GetXmlIdRegistry()
Definition: docnew.cxx:817
OUString GetDateInCurrentDateFormat(double fDate) const
virtual parameter_map_t * GetParameters()=0
#define ODF_FORMDATE_CURRENTDATE_FORMAT
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)
void DeleteDummyChar(SwPosition const &rPos, sal_Unicode cDummy)
virtual void DeregisterFromDoc(SwDoc &rDoc)
bool IsEmpty() const
Definition: swrect.hxx:304
virtual bool DoesUndo() const =0
Is Undo enabled?
Bookmark(const SwPaM &rPaM, const vcl::KeyCode &rCode, const OUString &rName)
virtual void ShowButton(SwEditWin *pEditWin) override
void SetRefObject(SwServerObject *pObj)
Point BottomRight() const
Definition: swrect.hxx:266
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:137
void swap(cow_wrapper< T, P > &a, cow_wrapper< T, P > &b)
static css::uno::Reference< css::text::XTextContent > CreateXBookmark(SwDoc &rDoc,::sw::mark::IMark *pBookmark)
Definition: unobkm.cxx:160
T * get() const
virtual bool InsertString(const SwPaM &rRg, const OUString &, const SwInsertFlags nInsertMode=SwInsertFlags::EMPTYEXPAND)=0
Insert string into existing text node at position rRg.Point().
virtual void AppendUndo(std::unique_ptr< SwUndo > pUndo)=0
Add new Undo action.
virtual SwUndoId StartUndo(SwUndoId const eUndoId, SwRewriter const *const pRewriter)=0
Opens undo block.
#define SAL_MAX_INT32
int i
const SwStartNode * StartOfSectionNode() const
Definition: node.hxx:133
virtual void ReleaseDoc(SwDoc &rDoc) override
const SwPosition * GetPoint() const
Definition: pam.hxx:208
void SetMarkEndPos(const SwPosition &rNewEndPos)
Window class for the Writer edit area, this is the one handling mouse and keyboard events and doing t...
Definition: edtwin.hxx:58
SwIndex & Assign(SwIndexReg *, sal_Int32)
Definition: index.cxx:206
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const override
virtual void DeregisterFromDoc(SwDoc &io_rDoc) override
::sw::DocumentContentOperationsManager const & GetDocumentContentOperationsManager() const
Definition: doc.cxx:325
virtual void ReleaseDoc(SwDoc &rDoc) override
void CalcPosAndSize(const SwRect &rPortionPaintArea)
virtual void ReleaseDoc(SwDoc &rDoc) override
virtual void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
void SetNoServer()
Definition: swserv.cxx:249
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
Definition: pam.hxx:206
virtual auto InvalidateFrames() -> void
virtual ~MarkBase() override
float u
#define CH_TXT_ATR_FIELDSTART
Definition: hintids.hxx:179
SvNumberFormatter * m_pNumberFormatter
bool IsNumberFormat(const OUString &sString, sal_uInt32 &F_Index, double &fOutNumber, SvNumInputOptions eInputOptions=SvNumInputOptions::NONE)
IDocumentState const & getIDocumentState() const
Definition: doc.cxx:394
DdeBookmark(const SwPaM &rPaM)
virtual css::uno::Reference< css::rdf::XMetadatable > MakeUnoObject() override
bool IsNoTextNode() const
Definition: node.hxx:650
SvNumFormatType
bool IsEndNode() const
Definition: node.hxx:634
sal_uInt32 GetEntryKey(std::u16string_view sStr, LanguageType eLnge=LANGUAGE_DONTKNOW)
void SetPortionPaintAreaStart(const SwRect &rPortionPaintArea)
#define ODF_FORMDATE_DATEFORMAT
static OUString GenerateNewName(std::u16string_view rPrefix)
DropDownFieldmark(const SwPaM &rPaM)
CheckboxFieldmark(const SwPaM &rPaM)
enumrange< T >::Iterator end(enumrange< T >)
virtual OUString ToString() const override
bool HasDataLinks() const
NavigatorReminder(const SwPaM &rPaM)
NonTextFieldmark(const SwPaM &rPaM)
virtual SwPosition & GetOtherMarkPos() const override
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:79
MarkBase(const SwPaM &rPaM, const OUString &rName)
void SendLOKShowMessage(const SfxViewShell *pViewShell)
tools::Rectangle SVRect() const
Definition: swrect.hxx:292
void SetXBookmark(css::uno::Reference< css::text::XTextContent > const &xBkmk)
void UpdateFramesForRemoveDeleteRedline(SwDoc &rDoc, SwPaM const &rPam)
virtual bool IsInContent() const override
bool IsVisible() const
virtual bool IsInClipboard() const override
#define SAL_INFO(area, stream)
#define ODF_FORMDROPDOWN_LISTENTRY
virtual void RemoveButton() override
sal_Int32 GetIndex() const
Definition: index.hxx:91
bool IsClipBoard() const
Definition: doc.hxx:963
virtual SwPosition & GetMarkPos() const override
static VclPtr< reference_type > Create(Arg &&...arg)
virtual void SetMarkPos(const SwPosition &rNewPos)
void dumpAsXml(xmlTextWriterPtr pWriter) const
Definition: pam.cxx:186
virtual void InitDoc(SwDoc &io_rDoc, sw::mark::InsertMode eMode, SwPosition const *pSepPos) override
void * p
QPRO_FUNC_TYPE nType
void SetPortionPaintArea(const SwRect &rPortionPaintArea)
IFieldmark::parameter_map_t m_vParams
virtual const SwPosition & GetMarkEnd() const =0
virtual ~DateFieldmark() override
#define CH_TXT_ATR_FIELDEND
Definition: hintids.hxx:181
virtual void SetCurrentDate(double fDate) override
virtual void CallSwClientNotify(const SfxHint &rHint) const override
Definition: calbck.cxx:326
virtual OUString GetContent() const override
Fieldmark(const SwPaM &rPaM)
virtual sfx2::LinkManager & GetLinkManager()=0
virtual void SetHideCondition(const OUString &rHideCondition) override
struct _xmlTextWriter * xmlTextWriterPtr
tools::SvRef< SwServerObject > m_aRefObj
virtual const SwPosition & GetMarkStart() const =0
bool ReplaceRange(SwPaM &rPam, const OUString &rNewStr, const bool bRegExReplace) override
Replace selected range in a TextNode with string.
InsertMode
Definition: IMark.hxx:31
virtual void SetOtherMarkPos(const SwPosition &rNewPos)
rtl::OString toString() const
#define CH_TXT_ATR_FIELDSEP
Definition: hintids.hxx:180
bool IsTextNode() const
Definition: node.hxx:638
void GetOutputString(const double &fOutNumber, sal_uInt32 nFIndex, OUString &sOutString, const Color **ppColor, bool bUseStarFormat=false)
virtual void Invalidate() override
virtual IFieldmark::parameter_map_t * GetParameters() override
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
Definition: ndtxt.hxx:856
virtual const SwPosition & GetOtherMarkPos() const =0
OUString anyToString(uno::Any const &value)
void Show(bool bVisible=true, ShowFlags nFlags=ShowFlags::NONE)
Base class of the Writer document model elements.
Definition: node.hxx:81
typedef void(CALLTYPE *GetFuncDataPtr)(sal_uInt16 &nNo
virtual OUString GetDateInStandardDateFormat(double fDate) const override