LibreOffice Module sw (master)  1
unocrsrhelper.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 <unocrsrhelper.hxx>
21 
22 #include <map>
23 #include <algorithm>
24 #include <memory>
25 
26 #include <com/sun/star/beans/PropertyAttribute.hpp>
27 #include <com/sun/star/beans/PropertyState.hpp>
28 #include <com/sun/star/embed/ElementModes.hpp>
29 #include <com/sun/star/embed/XStorage.hpp>
30 #include <com/sun/star/io/IOException.hpp>
31 #include <com/sun/star/text/XTextSection.hpp>
32 #include <com/sun/star/lang/XSingleServiceFactory.hpp>
33 
34 #include <svx/svxids.hrc>
35 #include <svx/unoshape.hxx>
36 
37 #include <cmdid.h>
38 #include <unotextrange.hxx>
39 #include <unodraw.hxx>
40 #include <unofootnote.hxx>
41 #include <unobookmark.hxx>
42 #include <unomap.hxx>
43 #include <unorefmark.hxx>
44 #include <unostyle.hxx>
45 #include <unoidx.hxx>
46 #include <unofield.hxx>
47 #include <unotbl.hxx>
48 #include <unosett.hxx>
49 #include <unoframe.hxx>
50 #include <unocrsr.hxx>
51 #include <doc.hxx>
52 #include <IDocumentUndoRedo.hxx>
55 #include <fmtftn.hxx>
56 #include <fmtpdsc.hxx>
57 #include <charfmt.hxx>
58 #include <pagedesc.hxx>
59 #include <docstyle.hxx>
60 #include <ndtxt.hxx>
61 #include <txtrfmrk.hxx>
62 #include <fmtfld.hxx>
63 #include <docsh.hxx>
64 #include <section.hxx>
65 #include <shellio.hxx>
66 #include <edimp.hxx>
67 #include <swundo.hxx>
68 #include <cntfrm.hxx>
69 #include <pagefrm.hxx>
70 #include <svl/eitem.hxx>
71 #include <docary.hxx>
72 #include <swtable.hxx>
73 #include <tox.hxx>
74 #include <doctxm.hxx>
75 #include <fchrfmt.hxx>
76 #include <editeng/flstitem.hxx>
77 #include <vcl/metric.hxx>
78 #include <svtools/ctrltool.hxx>
79 #include <sfx2/docfilt.hxx>
80 #include <sfx2/docfile.hxx>
81 #include <sfx2/fcontnr.hxx>
82 #include <svl/stritem.hxx>
83 #include <SwStyleNameMapper.hxx>
84 #include <redline.hxx>
85 #include <numrule.hxx>
89 #include <SwNodeNum.hxx>
90 #include <fmtmeta.hxx>
91 #include <txtfld.hxx>
92 #include <unoparagraph.hxx>
93 #include <sal/log.hxx>
94 
95 using namespace ::com::sun::star;
96 using namespace ::com::sun::star::uno;
97 using namespace ::com::sun::star::beans;
98 using namespace ::com::sun::star::text;
99 using namespace ::com::sun::star::table;
100 using namespace ::com::sun::star::container;
101 using namespace ::com::sun::star::lang;
102 
104 {
105 
106 static SwPaM* lcl_createPamCopy(const SwPaM& rPam)
107 {
108  SwPaM *const pRet = new SwPaM(*rPam.GetPoint());
109  ::sw::DeepCopyPaM(rPam, *pRet);
110  return pRet;
111 }
112 
113 void GetSelectableFromAny(uno::Reference<uno::XInterface> const& xIfc,
114  SwDoc & rTargetDoc,
115  SwPaM *& o_rpPaM, std::pair<OUString, FlyCntType> & o_rFrame,
116  OUString & o_rTableName, SwUnoTableCursor const*& o_rpTableCursor,
117  ::sw::mark::IMark const*& o_rpMark,
118  std::vector<SdrObject *> & o_rSdrObjects)
119 {
120  uno::Reference<drawing::XShapes> const xShapes(xIfc, UNO_QUERY);
121  if (xShapes.is())
122  {
123  sal_Int32 nShapes(xShapes->getCount());
124  for (sal_Int32 i = 0; i < nShapes; ++i)
125  {
126  uno::Reference<lang::XUnoTunnel> xShape;
127  xShapes->getByIndex(i) >>= xShape;
128  if (xShape.is())
129  {
130  SvxShape *const pSvxShape(
131  ::sw::UnoTunnelGetImplementation<SvxShape>(xShape));
132  if (pSvxShape)
133  {
134  SdrObject *const pSdrObject = pSvxShape->GetSdrObject();
135  if (pSdrObject)
136  { // hmm... needs view to verify it's in right doc...
137  o_rSdrObjects.push_back(pSdrObject);
138  }
139  }
140  }
141  }
142  return;
143  }
144 
145  uno::Reference<lang::XUnoTunnel> const xTunnel(xIfc, UNO_QUERY);
146  if (!xTunnel.is()) // everything below needs tunnel
147  {
148  return;
149  }
150 
151  SwXShape *const pShape(::sw::UnoTunnelGetImplementation<SwXShape>(xTunnel));
152  if (pShape)
153  {
154  uno::Reference<uno::XAggregation> const xAgg(
155  pShape->GetAggregationInterface());
156  if (xAgg.is())
157  {
158  SvxShape *const pSvxShape(
159  ::sw::UnoTunnelGetImplementation<SvxShape>(xTunnel));
160  if (pSvxShape)
161  {
162  SdrObject *const pSdrObject = pSvxShape->GetSdrObject();
163  if (pSdrObject)
164  { // hmm... needs view to verify it's in right doc...
165  o_rSdrObjects.push_back(pSdrObject);
166  }
167  }
168  }
169  return;
170  }
171 
172  OTextCursorHelper *const pCursor(
173  ::sw::UnoTunnelGetImplementation<OTextCursorHelper>(xTunnel));
174  if (pCursor)
175  {
176  if (pCursor->GetDoc() == &rTargetDoc)
177  {
178  o_rpPaM = lcl_createPamCopy(*pCursor->GetPaM());
179  }
180  return;
181  }
182 
183  SwXTextRanges* const pRanges(
184  ::sw::UnoTunnelGetImplementation<SwXTextRanges>(xTunnel));
185  if (pRanges)
186  {
187  SwUnoCursor const* pUnoCursor = pRanges->GetCursor();
188  if (pUnoCursor && pUnoCursor->GetDoc() == &rTargetDoc)
189  {
190  o_rpPaM = lcl_createPamCopy(*pUnoCursor);
191  }
192  return;
193  }
194 
195  // check these before Range to prevent misinterpretation of text frames
196  // and cells also implement XTextRange
197  SwXFrame *const pFrame(
198  ::sw::UnoTunnelGetImplementation<SwXFrame>(xTunnel));
199  if (pFrame)
200  {
201  const SwFrameFormat *const pFrameFormat(pFrame->GetFrameFormat());
202  if (pFrameFormat && pFrameFormat->GetDoc() == &rTargetDoc)
203  {
204  o_rFrame = std::make_pair(pFrameFormat->GetName(), pFrame->GetFlyCntType());
205  }
206  return;
207  }
208 
209  SwXTextTable *const pTextTable(
210  ::sw::UnoTunnelGetImplementation<SwXTextTable>(xTunnel));
211  if (pTextTable)
212  {
213  SwFrameFormat *const pFrameFormat(pTextTable->GetFrameFormat());
214  if (pFrameFormat && pFrameFormat->GetDoc() == &rTargetDoc)
215  {
216  o_rTableName = pFrameFormat->GetName();
217  }
218  return;
219  }
220 
221  SwXCell *const pCell(
222  ::sw::UnoTunnelGetImplementation<SwXCell>(xTunnel));
223  if (pCell)
224  {
225  SwFrameFormat *const pFrameFormat(pCell->GetFrameFormat());
226  if (pFrameFormat && pFrameFormat->GetDoc() == &rTargetDoc)
227  {
228  SwTableBox * pBox = pCell->GetTableBox();
229  SwTable *const pTable = SwTable::FindTable(pFrameFormat);
230  // ??? what's the benefit of setting pBox in this convoluted way?
231  pBox = pCell->FindBox(pTable, pBox);
232  if (pBox)
233  {
234  SwPosition const aPos(*pBox->GetSttNd());
235  SwPaM aPam(aPos);
236  aPam.Move(fnMoveForward, GoInNode);
237  o_rpPaM = lcl_createPamCopy(aPam);
238  }
239  }
240  return;
241  }
242 
243  uno::Reference<text::XTextRange> const xTextRange(xTunnel, UNO_QUERY);
244  if (xTextRange.is())
245  {
246  SwUnoInternalPaM aPam(rTargetDoc);
247  if (::sw::XTextRangeToSwPaM(aPam, xTextRange))
248  {
249  o_rpPaM = lcl_createPamCopy(aPam);
250  }
251  return;
252  }
253 
254  SwXCellRange *const pCellRange(
255  ::sw::UnoTunnelGetImplementation<SwXCellRange>(xTunnel));
256  if (pCellRange)
257  {
258  SwUnoCursor const*const pUnoCursor(pCellRange->GetTableCursor());
259  if (pUnoCursor && pUnoCursor->GetDoc() == &rTargetDoc)
260  {
261  // probably can't copy it to o_rpPaM for this since it's
262  // a SwTableCursor
263  o_rpTableCursor = dynamic_cast<SwUnoTableCursor const*>(pUnoCursor);
264  }
265  return;
266  }
267 
268  ::sw::mark::IMark const*const pMark(
269  SwXBookmark::GetBookmarkInDoc(& rTargetDoc, xTunnel));
270  if (pMark)
271  {
272  o_rpMark = pMark;
273  return;
274  }
275 }
276 
277 uno::Reference<text::XTextContent>
278 GetNestedTextContent(SwTextNode const & rTextNode, sal_Int32 const nIndex,
279  bool const bParent)
280 {
281  // these should be unambiguous because of the dummy character
282  SwTextNode::GetTextAttrMode const eMode( bParent
284  SwTextAttr *const pMetaTextAttr =
285  rTextNode.GetTextAttrAt(nIndex, RES_TXTATR_META, eMode);
286  SwTextAttr *const pMetaFieldTextAttr =
287  rTextNode.GetTextAttrAt(nIndex, RES_TXTATR_METAFIELD, eMode);
288  // which is innermost?
289  SwTextAttr *const pTextAttr = pMetaTextAttr
290  ? (pMetaFieldTextAttr
291  ? ((pMetaFieldTextAttr->GetStart() >
292  pMetaTextAttr->GetStart())
293  ? pMetaFieldTextAttr : pMetaTextAttr)
294  : pMetaTextAttr)
295  : pMetaFieldTextAttr;
296  uno::Reference<XTextContent> xRet;
297  if (pTextAttr)
298  {
299  ::sw::Meta *const pMeta(
300  static_cast<SwFormatMeta &>(pTextAttr->GetAttr()).GetMeta());
301  assert(pMeta);
302  xRet.set(pMeta->MakeUnoObject(), uno::UNO_QUERY);
303  }
304  return xRet;
305 }
306 
307 // Read the special properties of the cursor
309  , SwPaM& rPam
310  , Any *pAny
311  , PropertyState& eState
312  , const SwTextNode* pNode )
313 {
314  PropertyState eNewState = PropertyState_DIRECT_VALUE;
315  bool bDone = true;
316  switch(rEntry.nWID)
317  {
319  if (pAny)
320  {
321  const SwTextNode * pTmpNode = pNode;
322 
323  if (!pTmpNode)
324  pTmpNode = rPam.GetNode().GetTextNode();
325 
326  bool bRet = false;
327 
328  if ( pTmpNode &&
329  pTmpNode->GetNum() &&
330  pTmpNode->GetNum()->IsContinueingPreviousSubTree() )
331  {
332  bRet = true;
333  }
334 
335  *pAny <<= bRet;
336  }
337  break;
339  if (pAny)
340  {
341  const SwTextNode * pTmpNode = pNode;
342 
343  if (!pTmpNode)
344  pTmpNode = rPam.GetNode().GetTextNode();
345 
346  OUString sRet;
347  if ( pTmpNode && pTmpNode->GetNum() )
348  {
349  sRet = pTmpNode->GetNumString();
350  }
351 
352  *pAny <<= sRet;
353  }
354  break;
356  if (pAny)
357  {
358  const SwTextNode * pTmpNode = pNode;
359 
360  if (!pTmpNode)
361  pTmpNode = rPam.GetNode().GetTextNode();
362 
363  sal_Int16 nRet = -1;
364  if ( pTmpNode )
365  nRet = sal::static_int_cast< sal_Int16 >( pTmpNode->GetAttrOutlineLevel() );
366 
367  *pAny <<= nRet;
368  }
369  break;
371  case FN_UNO_PARA_STYLE :
372  {
373  SwFormatColl* pFormat = nullptr;
374  if(pNode)
375  pFormat = FN_UNO_PARA_CONDITIONAL_STYLE_NAME == rEntry.nWID
376  ? pNode->GetFormatColl() : &pNode->GetAnyFormatColl();
377  else
378  {
381  }
382  if(pFormat)
383  {
384  if( pAny )
385  {
386  OUString sVal;
388  *pAny <<= sVal;
389  }
390  }
391  else
392  eNewState = PropertyState_AMBIGUOUS_VALUE;
393  }
394  break;
395  case FN_UNO_PAGE_STYLE :
396  {
397  OUString sVal;
398  GetCurPageStyle(rPam, sVal);
399  if( pAny )
400  *pAny <<= sVal;
401  if(sVal.isEmpty())
402  eNewState = PropertyState_AMBIGUOUS_VALUE;
403  }
404  break;
406  if( pAny )
407  {
408  sal_Int16 nValue = IsNodeNumStart(rPam, eNewState);
409  *pAny <<= nValue;
410  }
411  break;
412  case FN_UNO_NUM_LEVEL :
413  case FN_UNO_IS_NUMBER :
414  // #i91601#
415  case FN_UNO_LIST_ID:
416  case FN_NUMBER_NEWSTART:
417  {
418  // a multi selection is not considered
419  const SwTextNode* pTextNd = rPam.GetNode().GetTextNode();
420  if ( pTextNd && pTextNd->IsInList() )
421  {
422  if( pAny )
423  {
424  if(rEntry.nWID == FN_UNO_NUM_LEVEL)
425  *pAny <<= static_cast<sal_Int16>(pTextNd->GetActualListLevel());
426  else if(rEntry.nWID == FN_UNO_IS_NUMBER)
427  {
428  *pAny <<= pTextNd->IsCountedInList();
429  }
430  // #i91601#
431  else if ( rEntry.nWID == FN_UNO_LIST_ID )
432  {
433  *pAny <<= pTextNd->GetListId();
434  }
435  else
436  {
437  *pAny <<= pTextNd->IsListRestart();
438  }
439  }
440  }
441  else
442  {
443  eNewState = PropertyState_DEFAULT_VALUE;
444 
445  if( pAny )
446  {
447  // #i30838# set default values for default properties
448  if(rEntry.nWID == FN_UNO_NUM_LEVEL)
449  *pAny <<= static_cast<sal_Int16>( 0 );
450  else if(rEntry.nWID == FN_UNO_IS_NUMBER)
451  *pAny <<= false;
452  // #i91601#
453  else if ( rEntry.nWID == FN_UNO_LIST_ID )
454  {
455  *pAny <<= OUString();
456  }
457  else
458  *pAny <<= false;
459  }
460  }
461  //PROPERTY_MAYBEVOID!
462  }
463  break;
464  case FN_UNO_NUM_RULES :
465  if( pAny )
466  getNumberingProperty(rPam, eNewState, pAny);
467  else
468  {
469  if( !SwDoc::GetNumRuleAtPos( *rPam.GetPoint() ) )
470  eNewState = PropertyState_DEFAULT_VALUE;
471  }
472  break;
474  {
475  std::vector<SwTextAttr *> marks;
476  if (rPam.GetNode().IsTextNode())
477  {
478  marks = rPam.GetNode().GetTextNode()->GetTextAttrsAt(
480  }
481  if (!marks.empty())
482  {
483  if( pAny )
484  { // hmm... can only return 1 here
485  SwTOXMark & rMark =
486  static_cast<SwTOXMark &>((*marks.begin())->GetAttr());
487  const uno::Reference< text::XDocumentIndexMark > xRef =
489  *rPam.GetDoc(), &rMark);
490  (*pAny) <<= xRef;
491  }
492  }
493  else
494  //also here - indistinguishable
495  eNewState = PropertyState_DEFAULT_VALUE;
496  }
497  break;
499  {
500  SwTOXBase* pBase = SwDoc::GetCurTOX(
501  *rPam.Start() );
502  if( pBase )
503  {
504  if( pAny )
505  {
506  const uno::Reference< text::XDocumentIndex > xRef =
508  static_cast<SwTOXBaseSection *>(pBase));
509  (*pAny) <<= xRef;
510  }
511  }
512  else
513  eNewState = PropertyState_DEFAULT_VALUE;
514  }
515  break;
516  case FN_UNO_TEXT_FIELD:
517  {
518  const SwPosition *pPos = rPam.Start();
519  const SwTextNode *pTextNd =
520  rPam.GetDoc()->GetNodes()[pPos->nNode.GetIndex()]->GetTextNode();
521  const SwTextAttr* pTextAttr = pTextNd
522  ? pTextNd->GetFieldTextAttrAt( pPos->nContent.GetIndex(), true )
523  : nullptr;
524  if ( pTextAttr != nullptr )
525  {
526  if( pAny )
527  {
528  uno::Reference<text::XTextField> const xField(
530  &pTextAttr->GetFormatField()));
531  *pAny <<= xField;
532  }
533  }
534  else
535  eNewState = PropertyState_DEFAULT_VALUE;
536  }
537  break;
538  case FN_UNO_TEXT_TABLE:
539  case FN_UNO_CELL:
540  {
541  SwStartNode* pSttNode = rPam.GetNode().StartOfSectionNode();
542  SwStartNodeType eType = pSttNode->GetStartNodeType();
543  if(SwTableBoxStartNode == eType)
544  {
545  if( pAny )
546  {
547  const SwTableNode* pTableNode = pSttNode->FindTableNode();
548  SwFrameFormat* pTableFormat = static_cast<SwFrameFormat*>(pTableNode->GetTable().GetFrameFormat());
549  //SwTable& rTable = static_cast<SwTableNode*>(pSttNode)->GetTable();
550  if(FN_UNO_TEXT_TABLE == rEntry.nWID)
551  {
552  uno::Reference< XTextTable > xTable = SwXTextTables::GetObject(*pTableFormat);
553  *pAny <<= xTable;
554  }
555  else
556  {
557  SwTableBox* pBox = pSttNode->GetTableBox();
558  uno::Reference< XCell > xCell = SwXCell::CreateXCell(pTableFormat, pBox);
559  *pAny <<= xCell;
560  }
561  }
562  }
563  else
564  eNewState = PropertyState_DEFAULT_VALUE;
565  }
566  break;
567  case FN_UNO_TEXT_FRAME:
568  {
569  SwStartNode* pSttNode = rPam.GetNode().StartOfSectionNode();
570  SwStartNodeType eType = pSttNode->GetStartNodeType();
571 
572  SwFrameFormat* pFormat;
573  if(eType == SwFlyStartNode && nullptr != (pFormat = pSttNode->GetFlyFormat()))
574  {
575  if( pAny )
576  {
577  uno::Reference<XTextFrame> const xFrame(
578  SwXTextFrame::CreateXTextFrame(*pFormat->GetDoc(), pFormat));
579  (*pAny) <<= xFrame;
580  }
581  }
582  else
583  eNewState = PropertyState_DEFAULT_VALUE;
584  }
585  break;
586  case FN_UNO_TEXT_SECTION:
587  {
588  SwSection* pSect = SwDoc::GetCurrSection(*rPam.GetPoint());
589  if(pSect)
590  {
591  if( pAny )
592  {
593  uno::Reference< XTextSection > xSect = SwXTextSections::GetObject( *pSect->GetFormat() );
594  *pAny <<= xSect;
595  }
596  }
597  else
598  eNewState = PropertyState_DEFAULT_VALUE;
599  }
600  break;
602  {
603  SwTextNode* pTextNode = rPam.GetPoint()->nNode.GetNode().GetTextNode();
604  if (pTextNode)
605  {
606  if (pAny)
607  {
608  uno::Reference<text::XTextContent> xParagraph = SwXParagraph::CreateXParagraph(*pTextNode->GetDoc(), pTextNode);
609  *pAny <<= xParagraph;
610  }
611  }
612  else
613  eNewState = PropertyState_DEFAULT_VALUE;
614  }
615  break;
616  case FN_UNO_ENDNOTE:
617  case FN_UNO_FOOTNOTE:
618  {
619  SwTextAttr *const pTextAttr = rPam.GetNode().IsTextNode() ?
621  rPam.GetPoint()->nContent.GetIndex(), RES_TXTATR_FTN) : nullptr;
622  if(pTextAttr)
623  {
624  const SwFormatFootnote& rFootnote = pTextAttr->GetFootnote();
625  if(rFootnote.IsEndNote() == (FN_UNO_ENDNOTE == rEntry.nWID))
626  {
627  if( pAny )
628  {
629  const uno::Reference< text::XFootnote > xFootnote =
631  &const_cast<SwFormatFootnote&>(rFootnote));
632  *pAny <<= xFootnote;
633  }
634  }
635  else
636  eNewState = PropertyState_DEFAULT_VALUE;
637  }
638  else
639  eNewState = PropertyState_DEFAULT_VALUE;
640  }
641  break;
643  {
644  std::vector<SwTextAttr *> marks;
645  if (rPam.GetNode().IsTextNode())
646  {
647  marks = rPam.GetNode().GetTextNode()->GetTextAttrsAt(
649  }
650  if (!marks.empty())
651  {
652  if( pAny )
653  { // hmm... can only return 1 here
654  const SwFormatRefMark& rRef = (*marks.begin())->GetRefMark();
655  uno::Reference<XTextContent> const xRef =
657  const_cast<SwFormatRefMark*>(&rRef));
658  *pAny <<= xRef;
659  }
660  }
661  else
662  eNewState = PropertyState_DEFAULT_VALUE;
663  }
664  break;
666  {
667  uno::Reference<XTextContent> const xRet(rPam.GetNode().IsTextNode()
669  rPam.GetPoint()->nContent.GetIndex(), false)
670  : nullptr);
671  if (xRet.is())
672  {
673  if (pAny)
674  {
675  (*pAny) <<= xRet;
676  }
677  }
678  else
679  {
680  eNewState = PropertyState_DEFAULT_VALUE;
681  }
682  }
683  break;
685  {
686 
687  SwTextNode *const pTextNode = rPam.GetNode().GetTextNode();
688  if (&rPam.GetNode() == &rPam.GetNode(false)
689  && pTextNode && pTextNode->GetpSwpHints())
690  {
691  sal_Int32 nPaMStart = rPam.GetPoint()->nContent.GetIndex();
692  sal_Int32 nPaMEnd = rPam.GetMark() ? rPam.GetMark()->nContent.GetIndex() : nPaMStart;
693  if(nPaMStart > nPaMEnd)
694  {
695  std::swap(nPaMStart, nPaMEnd);
696  }
697  Sequence< OUString> aCharStyles;
698  SwpHints* pHints = pTextNode->GetpSwpHints();
699  for( size_t nAttr = 0; nAttr < pHints->Count(); ++nAttr )
700  {
701  SwTextAttr* pAttr = pHints->Get( nAttr );
702  if(pAttr->Which() != RES_TXTATR_CHARFMT)
703  continue;
704  const sal_Int32 nAttrStart = pAttr->GetStart();
705  const sal_Int32 nAttrEnd = *pAttr->GetEnd();
706  //check if the attribute touches the selection
707  if( ( nAttrEnd > nPaMStart && nAttrStart < nPaMEnd ) ||
708  ( !nAttrStart && !nAttrEnd && !nPaMStart && !nPaMEnd ) )
709  {
710  //check for overlapping
711  if(nAttrStart > nPaMStart ||
712  nAttrEnd < nPaMEnd)
713  {
714  aCharStyles.realloc(0);
715  break;
716  }
717  else
718  {
719  //now the attribute should start before or at the selection
720  //and it should end at the end of the selection or behind
721  OSL_ENSURE(nAttrStart <= nPaMStart && nAttrEnd >=nPaMEnd,
722  "attribute overlaps or is outside");
723  //now the name of the style has to be added to the sequence
724  aCharStyles.realloc(aCharStyles.getLength() + 1);
725  OSL_ENSURE(pAttr->GetCharFormat().GetCharFormat(), "no character format set");
726  aCharStyles.getArray()[aCharStyles.getLength() - 1] =
729  }
730  }
731 
732  }
733  eNewState =
734  aCharStyles.hasElements() ?
735  PropertyState_DIRECT_VALUE : PropertyState_DEFAULT_VALUE;
736  if(pAny)
737  (*pAny) <<= aCharStyles;
738  }
739  else
740  eNewState = PropertyState_DEFAULT_VALUE;
741  }
742  break;
743  case RES_TXTATR_CHARFMT:
744  // no break here!
745  default: bDone = false;
746  }
747  if( bDone )
748  eState = eNewState;
749  return bDone;
750 };
751 
752 sal_Int16 IsNodeNumStart(SwPaM const & rPam, PropertyState& eState)
753 {
754  const SwTextNode* pTextNd = rPam.GetNode().GetTextNode();
755  // correction: check, if restart value is set at the text node and use
756  // new method <SwTextNode::GetAttrListRestartValue()> to retrieve the value
757  if ( pTextNd && pTextNd->GetNumRule() && pTextNd->IsListRestart() &&
758  pTextNd->HasAttrListRestartValue() )
759  {
760  eState = PropertyState_DIRECT_VALUE;
761  sal_Int16 nTmp = sal::static_int_cast< sal_Int16 >(pTextNd->GetAttrListRestartValue());
762  return nTmp;
763  }
764  eState = PropertyState_DEFAULT_VALUE;
765  return -1;
766 }
767 
768 void setNumberingProperty(const Any& rValue, SwPaM& rPam)
769 {
770  uno::Reference<XIndexReplace> xIndexReplace;
771  if(rValue >>= xIndexReplace)
772  {
773  SwXNumberingRules* pSwNum = nullptr;
774 
775  uno::Reference<XUnoTunnel> xNumTunnel(xIndexReplace, UNO_QUERY);
776  if(xNumTunnel.is())
777  {
778  pSwNum = reinterpret_cast< SwXNumberingRules * >(
779  sal::static_int_cast< sal_IntPtr >( xNumTunnel->getSomething( SwXNumberingRules::getUnoTunnelId() )));
780  }
781 
782  if(pSwNum)
783  {
784  SwDoc* pDoc = rPam.GetDoc();
785  if(pSwNum->GetNumRule())
786  {
787  SwNumRule aRule(*pSwNum->GetNumRule());
788  const OUString* pNewCharStyles = pSwNum->GetNewCharStyleNames();
789  const OUString* pBulletFontNames = pSwNum->GetBulletFontNames();
790  for(sal_uInt16 i = 0; i < MAXLEVEL; i++)
791  {
792  SwNumFormat aFormat(aRule.Get( i ));
793  if (!pNewCharStyles[i].isEmpty() &&
794  !SwXNumberingRules::isInvalidStyle(pNewCharStyles[i]) &&
795  (!aFormat.GetCharFormat() || pNewCharStyles[i] != aFormat.GetCharFormat()->GetName()))
796  {
797  if (pNewCharStyles[i].isEmpty())
798  {
799  // FIXME
800  // Is something missing/wrong here?
801  // if condition is always false due to outer check!
802  aFormat.SetCharFormat(nullptr);
803  }
804  else
805  {
806 
807  // get CharStyle and set the rule
808  const size_t nChCount = pDoc->GetCharFormats()->size();
809  SwCharFormat* pCharFormat = nullptr;
810  for(size_t nCharFormat = 0; nCharFormat < nChCount; ++nCharFormat)
811  {
812  SwCharFormat& rChFormat = *((*(pDoc->GetCharFormats()))[nCharFormat]);
813  if(rChFormat.GetName() == pNewCharStyles[i])
814  {
815  pCharFormat = &rChFormat;
816  break;
817  }
818  }
819 
820  if(!pCharFormat)
821  {
823  SfxStyleSheetBase* pBase;
824  pBase = pPool->Find(pNewCharStyles[i], SfxStyleFamily::Char);
825  // shall it really be created?
826  if(!pBase)
827  pBase = &pPool->Make(pNewCharStyles[i], SfxStyleFamily::Page);
828  pCharFormat = static_cast<SwDocStyleSheet*>(pBase)->GetCharFormat();
829  }
830  if(pCharFormat)
831  aFormat.SetCharFormat(pCharFormat);
832  }
833  }
834  //Now again for fonts
835  if(
836  !pBulletFontNames[i].isEmpty() &&
837  !SwXNumberingRules::isInvalidStyle(pBulletFontNames[i]) &&
838  (!aFormat.GetBulletFont() || aFormat.GetBulletFont()->GetFamilyName() != pBulletFontNames[i])
839  )
840  {
841  const SvxFontListItem* pFontListItem =
842  static_cast<const SvxFontListItem* >(pDoc->GetDocShell()
843  ->GetItem( SID_ATTR_CHAR_FONTLIST ));
844  const FontList* pList = pFontListItem->GetFontList();
845 
846  FontMetric aFontMetric = pList->Get(
847  pBulletFontNames[i],WEIGHT_NORMAL, ITALIC_NONE);
848  vcl::Font aFont(aFontMetric);
849  aFormat.SetBulletFont(&aFont);
850  }
851  aRule.Set( i, aFormat );
852  }
853  UnoActionContext aAction(pDoc);
854 
855  if( rPam.GetNext() != &rPam ) // Multiple selection?
856  {
857  pDoc->GetIDocumentUndoRedo().StartUndo( SwUndoId::START, nullptr );
858  SwPamRanges aRangeArr( rPam );
859  SwPaM aPam( *rPam.GetPoint() );
860  for ( size_t n = 0; n < aRangeArr.Count(); ++n )
861  {
862  // no start of a new list
863  pDoc->SetNumRule( aRangeArr.SetPam( n, aPam ), aRule, false );
864  }
865  pDoc->GetIDocumentUndoRedo().EndUndo( SwUndoId::END, nullptr );
866  }
867  else
868  {
869  // no start of a new list
870  pDoc->SetNumRule( rPam, aRule, false );
871  }
872 
873  }
874  else if(!pSwNum->GetCreatedNumRuleName().isEmpty())
875  {
876  UnoActionContext aAction( pDoc );
877  SwNumRule* pRule = pDoc->FindNumRulePtr( pSwNum->GetCreatedNumRuleName() );
878  if ( !pRule )
879  throw RuntimeException();
880  // no start of a new list
881  pDoc->SetNumRule( rPam, *pRule, false );
882  }
883  else
884  {
885  // #i103817#
886  // outline numbering
887  UnoActionContext aAction(pDoc);
888  SwNumRule* pRule = pDoc->GetOutlineNumRule();
889  if(!pRule)
890  throw RuntimeException();
891  pDoc->SetNumRule( rPam, *pRule, false );
892  }
893  }
894  }
895  else if ( rValue.getValueType() == cppu::UnoType<void>::get() )
896  {
897  rPam.GetDoc()->DelNumRules(rPam);
898  }
899 }
900 
901 void getNumberingProperty(SwPaM& rPam, PropertyState& eState, Any * pAny )
902 {
903  const SwNumRule* pNumRule = SwDoc::GetNumRuleAtPos( *rPam.GetPoint() );
904  if(pNumRule)
905  {
906  uno::Reference< XIndexReplace > xNum = new SwXNumberingRules(*pNumRule);
907  if ( pAny )
908  *pAny <<= xNum;
909  eState = PropertyState_DIRECT_VALUE;
910  }
911  else
912  eState = PropertyState_DEFAULT_VALUE;
913 }
914 
915 void GetCurPageStyle(SwPaM const & rPaM, OUString &rString)
916 {
917  if (!rPaM.GetContentNode())
918  return; // TODO: is there an easy way to get it for tables/sections?
920  if(pFrame)
921  {
922  const SwPageFrame* pPage = pFrame->FindPageFrame();
923  if(pPage)
924  {
927  }
928  }
929 }
930 
931 // reset special properties of the cursor
933 {
934  SwDoc* pDoc = rPam.GetDoc();
935  switch(rEntry.nWID)
936  {
937  case FN_UNO_PARA_STYLE :
938  break;
939  case FN_UNO_PAGE_STYLE :
940  break;
942  {
943  UnoActionContext aAction(pDoc);
944 
945  if( rPam.GetNext() != &rPam ) // Multiple selection?
946  {
947  pDoc->GetIDocumentUndoRedo().StartUndo( SwUndoId::START, nullptr );
948  SwPamRanges aRangeArr( rPam );
949  SwPaM aPam( *rPam.GetPoint() );
950  for( size_t n = 0; n < aRangeArr.Count(); ++n )
951  pDoc->SetNodeNumStart( *aRangeArr.SetPam( n, aPam ).GetPoint(), 1 );
952  pDoc->GetIDocumentUndoRedo().EndUndo( SwUndoId::END, nullptr );
953  }
954  else
955  pDoc->SetNodeNumStart( *rPam.GetPoint(), 0 );
956  }
957 
958  break;
959  case FN_UNO_NUM_LEVEL :
960  break;
961  case FN_UNO_NUM_RULES:
962  break;
964  {
965  std::set<sal_uInt16> aWhichIds;
966  aWhichIds.insert( RES_TXTATR_CHARFMT);
967  pDoc->ResetAttrs(rPam, true, aWhichIds);
968  }
969  break;
970  }
971 }
972 
973 void InsertFile(SwUnoCursor* pUnoCursor, const OUString& rURL,
974  const uno::Sequence< beans::PropertyValue >& rOptions)
975 {
976  std::unique_ptr<SfxMedium> pMed;
977  SwDoc* pDoc = pUnoCursor->GetDoc();
978  SwDocShell* pDocSh = pDoc->GetDocShell();
979  utl::MediaDescriptor aMediaDescriptor( rOptions );
980  OUString sFileName = rURL;
981  OUString sFilterName, sFilterOptions, sPassword, sBaseURL;
982  uno::Reference < io::XStream > xStream;
983  uno::Reference < io::XInputStream > xInputStream;
984 
985  if( sFileName.isEmpty() )
986  aMediaDescriptor[utl::MediaDescriptor::PROP_URL()] >>= sFileName;
987  if( sFileName.isEmpty() )
988  aMediaDescriptor[utl::MediaDescriptor::PROP_FILENAME()] >>= sFileName;
989  aMediaDescriptor[utl::MediaDescriptor::PROP_INPUTSTREAM()] >>= xInputStream;
990  aMediaDescriptor[utl::MediaDescriptor::PROP_STREAM()] >>= xStream;
991  aMediaDescriptor[utl::MediaDescriptor::PROP_INPUTSTREAM()] >>= xInputStream;
992  aMediaDescriptor[utl::MediaDescriptor::PROP_FILTERNAME()] >>= sFilterName;
993  aMediaDescriptor[utl::MediaDescriptor::PROP_FILTEROPTIONS()] >>= sFilterOptions;
994  aMediaDescriptor[utl::MediaDescriptor::PROP_PASSWORD()] >>= sPassword;
995  aMediaDescriptor[utl::MediaDescriptor::PROP_DOCUMENTBASEURL() ] >>= sBaseURL;
996  if ( !xInputStream.is() && xStream.is() )
997  xInputStream = xStream->getInputStream();
998 
999  if(!pDocSh || (sFileName.isEmpty() && !xInputStream.is()))
1000  return;
1001 
1002  SfxObjectFactory& rFact = pDocSh->GetFactory();
1003  std::shared_ptr<const SfxFilter> pFilter = rFact.GetFilterContainer()->GetFilter4FilterName( sFilterName );
1004  uno::Reference < embed::XStorage > xReadStorage;
1005  if( xInputStream.is() )
1006  {
1007  uno::Sequence< uno::Any > aArgs( 2 );
1008  aArgs[0] <<= xInputStream;
1009  aArgs[1] <<= embed::ElementModes::READ;
1010  try
1011  {
1012  xReadStorage.set( ::comphelper::OStorageHelper::GetStorageFactory()->createInstanceWithArguments( aArgs ),
1013  uno::UNO_QUERY );
1014  }
1015  catch( const io::IOException&) {}
1016  }
1017  if ( !pFilter )
1018  {
1019  if( xInputStream.is() && !xReadStorage.is())
1020  {
1021  pMed.reset(new SfxMedium);
1022  pMed->setStreamToLoadFrom(xInputStream, true );
1023  }
1024  else
1025  pMed.reset(xReadStorage.is() ?
1026  new SfxMedium(xReadStorage, sBaseURL, nullptr ) :
1027  new SfxMedium(sFileName, StreamMode::READ, nullptr, nullptr ));
1028  if( !sBaseURL.isEmpty() )
1029  pMed->GetItemSet()->Put( SfxStringItem( SID_DOC_BASEURL, sBaseURL ) );
1030 
1031  SfxFilterMatcher aMatcher( rFact.GetFilterContainer()->GetName() );
1032  ErrCode nErr = aMatcher.GuessFilter(*pMed, pFilter, SfxFilterFlags::NONE);
1033  if ( nErr || !pFilter)
1034  return;
1035  pMed->SetFilter( pFilter );
1036  }
1037  else
1038  {
1039  if( xInputStream.is() && !xReadStorage.is())
1040  {
1041  pMed.reset(new SfxMedium);
1042  pMed->setStreamToLoadFrom(xInputStream, true );
1043  pMed->SetFilter( pFilter );
1044  }
1045  else
1046  {
1047  if( xReadStorage.is() )
1048  {
1049  pMed.reset(new SfxMedium(xReadStorage, sBaseURL, nullptr ));
1050  pMed->SetFilter( pFilter );
1051  }
1052  else
1053  pMed.reset(new SfxMedium(sFileName, StreamMode::READ, pFilter, nullptr));
1054  }
1055  if(!sFilterOptions.isEmpty())
1056  pMed->GetItemSet()->Put( SfxStringItem( SID_FILE_FILTEROPTIONS, sFilterOptions ) );
1057  if(!sBaseURL.isEmpty())
1058  pMed->GetItemSet()->Put( SfxStringItem( SID_DOC_BASEURL, sBaseURL ) );
1059  }
1060 
1061  // this sourcecode is not responsible for the lifetime of the shell, SfxObjectShellLock should not be used
1062  SfxObjectShellRef aRef( pDocSh );
1063 
1064  pMed->Download(); // if necessary: start the download
1065  if( aRef.is() && 1 < aRef->GetRefCount() ) // Ref still valid?
1066  {
1067  SwReaderPtr pRdr;
1068  SfxItemSet* pSet = pMed->GetItemSet();
1069  pSet->Put(SfxBoolItem(FN_API_CALL, true));
1070  if(!sPassword.isEmpty())
1071  pSet->Put(SfxStringItem(SID_PASSWORD, sPassword));
1072  Reader *pRead = pDocSh->StartConvertFrom( *pMed, pRdr, nullptr, pUnoCursor);
1073  if( pRead )
1074  {
1075 
1076  UnoActionContext aContext(pDoc);
1077 
1078  if(pUnoCursor->HasMark())
1079  pDoc->getIDocumentContentOperations().DeleteAndJoin(*pUnoCursor);
1080 
1081  SwNodeIndex aSave( pUnoCursor->GetPoint()->nNode, -1 );
1082  sal_Int32 nContent = pUnoCursor->GetPoint()->nContent.GetIndex();
1083 
1084  ErrCode nErrno = pRdr->Read( *pRead ); // and paste the document
1085 
1086  if(!nErrno)
1087  {
1088  ++aSave;
1089  pUnoCursor->SetMark();
1090  pUnoCursor->GetMark()->nNode = aSave;
1091 
1092  SwContentNode* pCntNode = aSave.GetNode().GetContentNode();
1093  if( !pCntNode )
1094  nContent = 0;
1095  pUnoCursor->GetMark()->nContent.Assign( pCntNode, nContent );
1096  }
1097  }
1098  }
1099 }
1100 
1101 // insert text and scan for CR characters in order to insert
1102 // paragraph breaks at those positions by calling SplitNode
1104  SwDoc &rDoc,
1105  const SwPaM &rNewCursor,
1106  const OUString &rText,
1107  const bool bForceExpandHints )
1108 {
1109  bool bOK = true;
1110 
1111  const SwInsertFlags nInsertFlags =
1112  bForceExpandHints
1115 
1116  // grouping done in InsertString is intended for typing, not API calls
1117  ::sw::GroupUndoGuard const undoGuard(rDoc.GetIDocumentUndoRedo());
1118  SwTextNode* const pTextNd =
1119  rNewCursor.GetPoint()->nNode.GetNode().GetTextNode();
1120  if (!pTextNd)
1121  {
1122  SAL_INFO("sw.uno", "DocInsertStringSplitCR: need a text node");
1123  return false;
1124  }
1125  OUString aText;
1126  sal_Int32 nStartIdx = 0;
1127  const sal_Int32 nMaxLength = COMPLETE_STRING - pTextNd->GetText().getLength();
1128 
1129  sal_Int32 nIdx = rText.indexOf( '\r', nStartIdx );
1130  if( ( nIdx == -1 && nMaxLength < rText.getLength() ) ||
1131  ( nIdx != -1 && nMaxLength < nIdx ) )
1132  {
1133  nIdx = nMaxLength;
1134  }
1135  while (nIdx != -1 )
1136  {
1137  OSL_ENSURE( nIdx - nStartIdx >= 0, "index negative!" );
1138  aText = rText.copy( nStartIdx, nIdx - nStartIdx );
1139  if (!aText.isEmpty() &&
1140  !rDoc.getIDocumentContentOperations().InsertString( rNewCursor, aText, nInsertFlags ))
1141  {
1142  OSL_FAIL( "Doc->Insert(Str) failed." );
1143  bOK = false;
1144  }
1145  if (!rDoc.getIDocumentContentOperations().SplitNode( *rNewCursor.GetPoint(), false ) )
1146  {
1147  OSL_FAIL( "SplitNode failed" );
1148  bOK = false;
1149  }
1150  nStartIdx = nIdx + 1;
1151  nIdx = rText.indexOf( '\r', nStartIdx );
1152  }
1153  aText = rText.copy( nStartIdx );
1154  if (!aText.isEmpty() &&
1155  !rDoc.getIDocumentContentOperations().InsertString( rNewCursor, aText, nInsertFlags ))
1156  {
1157  OSL_FAIL( "Doc->Insert(Str) failed." );
1158  bOK = false;
1159  }
1160 
1161  return bOK;
1162 }
1163 
1164 void makeRedline( SwPaM const & rPaM,
1165  const OUString& rRedlineType,
1166  const uno::Sequence< beans::PropertyValue >& rRedlineProperties )
1167 {
1168  IDocumentRedlineAccess* pRedlineAccess = &rPaM.GetDoc()->getIDocumentRedlineAccess();
1169 
1171  if ( rRedlineType == "Insert" )
1172  eType = RedlineType::Insert;
1173  else if ( rRedlineType == "Delete" )
1174  eType = RedlineType::Delete;
1175  else if ( rRedlineType == "Format" )
1176  eType = RedlineType::Format;
1177  else if ( rRedlineType == "TextTable" )
1178  eType = RedlineType::Table;
1179  else if ( rRedlineType == "ParagraphFormat" )
1181  else
1182  throw lang::IllegalArgumentException();
1183 
1184  //todo: what about REDLINE_FMTCOLL?
1185  comphelper::SequenceAsHashMap aPropMap( rRedlineProperties );
1186  std::size_t nAuthor = 0;
1187  OUString sAuthor;
1188  if( aPropMap.getValue("RedlineAuthor") >>= sAuthor )
1189  nAuthor = pRedlineAccess->InsertRedlineAuthor(sAuthor);
1190 
1191  OUString sComment;
1192  SwRedlineData aRedlineData( eType, nAuthor );
1193  if( aPropMap.getValue("RedlineComment") >>= sComment )
1194  aRedlineData.SetComment( sComment );
1195 
1196  ::util::DateTime aStamp;
1197  if( aPropMap.getValue("RedlineDateTime") >>= aStamp )
1198  {
1199  aRedlineData.SetTimeStamp( DateTime( aStamp));
1200  }
1201 
1202  SwRedlineExtraData_FormattingChanges* pRedlineExtraData = nullptr;
1203 
1204  // Read the 'Redline Revert Properties' from the parameters
1205  uno::Sequence< beans::PropertyValue > aRevertProperties;
1206  // Check if the value exists
1207  if ( aPropMap.getValue("RedlineRevertProperties") >>= aRevertProperties )
1208  {
1209  int nMap = 0;
1210  // Make sure that paragraph format gets its own map, otherwise e.g. fill attributes are not preserved.
1211  if (eType == RedlineType::ParagraphFormat)
1212  nMap = PROPERTY_MAP_PARAGRAPH;
1213  else
1215  SfxItemPropertySet const& rPropSet = *aSwMapProvider.GetPropertySet(nMap);
1216 
1217  // Check if there are any properties
1218  if (aRevertProperties.hasElements())
1219  {
1220  SwDoc *const pDoc = rPaM.GetDoc();
1221 
1222  // Build set of attributes we want to fetch
1223  std::vector<sal_uInt16> aWhichPairs;
1224  std::vector<SfxItemPropertySimpleEntry const*> aEntries;
1225  aEntries.reserve(aRevertProperties.getLength());
1226  for (sal_Int32 i = 0; i < aRevertProperties.getLength(); ++i)
1227  {
1228  const OUString &rPropertyName = aRevertProperties[i].Name;
1229  SfxItemPropertySimpleEntry const* pEntry = rPropSet.getPropertyMap().getByName(rPropertyName);
1230 
1231  if (!pEntry)
1232  {
1233  // unknown property
1234  break;
1235  }
1236  else if (pEntry->nFlags & beans::PropertyAttribute::READONLY)
1237  {
1238  break;
1239  }
1240  else
1241  {
1242  // FIXME: we should have some nice way of merging ranges surely ?
1243  aWhichPairs.push_back(pEntry->nWID);
1244  aWhichPairs.push_back(pEntry->nWID);
1245  }
1246  aEntries.push_back(pEntry);
1247  }
1248 
1249  if (!aWhichPairs.empty())
1250  {
1251  aWhichPairs.push_back(0); // terminate
1252  SfxItemSet aItemSet(pDoc->GetAttrPool(), aWhichPairs.data());
1253 
1254  for (size_t i = 0; i < aEntries.size(); ++i)
1255  {
1256  SfxItemPropertySimpleEntry const*const pEntry = aEntries[i];
1257  const uno::Any &rValue = aRevertProperties[i].Value;
1258  rPropSet.setPropertyValue(*pEntry, rValue, aItemSet);
1259  }
1260  pRedlineExtraData = new SwRedlineExtraData_FormattingChanges( &aItemSet );
1261  }
1262  }
1263  }
1264 
1265  SwRangeRedline* pRedline = new SwRangeRedline( aRedlineData, rPaM );
1266  RedlineFlags nPrevMode = pRedlineAccess->GetRedlineFlags( );
1267  pRedline->SetExtraData( pRedlineExtraData );
1268 
1269  pRedlineAccess->SetRedlineFlags_intern(RedlineFlags::On);
1270  auto const result(pRedlineAccess->AppendRedline(pRedline, false));
1271  pRedlineAccess->SetRedlineFlags_intern( nPrevMode );
1273  throw lang::IllegalArgumentException();
1274 }
1275 
1277  const OUString& rRedlineType,
1278  const uno::Sequence< beans::PropertyValue >& rRedlineProperties )
1279 {
1280  IDocumentRedlineAccess* pRedlineAccess = &rTableLine.GetFrameFormat()->GetDoc()->getIDocumentRedlineAccess();
1281 
1283  if ( rRedlineType == "TableRowInsert" )
1284  {
1286  }
1287  else if ( rRedlineType == "TableRowDelete" )
1288  {
1290  }
1291  else
1292  {
1293  throw lang::IllegalArgumentException();
1294  }
1295 
1296  comphelper::SequenceAsHashMap aPropMap( rRedlineProperties );
1297  std::size_t nAuthor = 0;
1298  OUString sAuthor;
1299  if( aPropMap.getValue("RedlineAuthor") >>= sAuthor )
1300  nAuthor = pRedlineAccess->InsertRedlineAuthor(sAuthor);
1301 
1302  OUString sComment;
1303  SwRedlineData aRedlineData( eType, nAuthor );
1304  if( aPropMap.getValue("RedlineComment") >>= sComment )
1305  aRedlineData.SetComment( sComment );
1306 
1307  ::util::DateTime aStamp;
1308  if( aPropMap.getValue("RedlineDateTime") >>= aStamp )
1309  {
1310  aRedlineData.SetTimeStamp(
1311  DateTime( Date( aStamp.Day, aStamp.Month, aStamp.Year ), tools::Time( aStamp.Hours, aStamp.Minutes, aStamp.Seconds ) ) );
1312  }
1313 
1314  SwTableRowRedline* pRedline = new SwTableRowRedline( aRedlineData, rTableLine );
1315  RedlineFlags nPrevMode = pRedlineAccess->GetRedlineFlags( );
1316  pRedline->SetExtraData( nullptr );
1317 
1318  pRedlineAccess->SetRedlineFlags_intern(RedlineFlags::On);
1319  bool bRet = pRedlineAccess->AppendTableRowRedline( pRedline, false );
1320  pRedlineAccess->SetRedlineFlags_intern( nPrevMode );
1321  if( !bRet )
1322  throw lang::IllegalArgumentException();
1323 }
1324 
1326  const OUString& rRedlineType,
1327  const uno::Sequence< beans::PropertyValue >& rRedlineProperties )
1328 {
1329  IDocumentRedlineAccess* pRedlineAccess = &rTableBox.GetFrameFormat()->GetDoc()->getIDocumentRedlineAccess();
1330 
1332  if ( rRedlineType == "TableCellInsert" )
1333  {
1335  }
1336  else if ( rRedlineType == "TableCellDelete" )
1337  {
1339  }
1340  else
1341  {
1342  throw lang::IllegalArgumentException();
1343  }
1344 
1345  comphelper::SequenceAsHashMap aPropMap( rRedlineProperties );
1346  std::size_t nAuthor = 0;
1347  OUString sAuthor;
1348  if( aPropMap.getValue("RedlineAuthor") >>= sAuthor )
1349  nAuthor = pRedlineAccess->InsertRedlineAuthor(sAuthor);
1350 
1351  OUString sComment;
1352  SwRedlineData aRedlineData( eType, nAuthor );
1353  if( aPropMap.getValue("RedlineComment") >>= sComment )
1354  aRedlineData.SetComment( sComment );
1355 
1356  ::util::DateTime aStamp;
1357  if( aPropMap.getValue("RedlineDateTime") >>= aStamp )
1358  {
1359  aRedlineData.SetTimeStamp(
1360  DateTime( Date( aStamp.Day, aStamp.Month, aStamp.Year ), tools::Time( aStamp.Hours, aStamp.Minutes, aStamp.Seconds ) ) );
1361  }
1362 
1363  SwTableCellRedline* pRedline = new SwTableCellRedline( aRedlineData, rTableBox );
1364  RedlineFlags nPrevMode = pRedlineAccess->GetRedlineFlags( );
1365  pRedline->SetExtraData( nullptr );
1366 
1367  pRedlineAccess->SetRedlineFlags_intern(RedlineFlags::On);
1368  bool bRet = pRedlineAccess->AppendTableCellRedline( pRedline, false );
1369  pRedlineAccess->SetRedlineFlags_intern( nPrevMode );
1370  if( !bRet )
1371  throw lang::IllegalArgumentException();
1372 }
1373 
1374 void SwAnyMapHelper::SetValue( sal_uInt16 nWhichId, sal_uInt16 nMemberId, const uno::Any& rAny )
1375 {
1376  sal_uInt32 nKey = (nWhichId << 16) + nMemberId;
1377  m_Map[nKey] = rAny;
1378 }
1379 
1380 bool SwAnyMapHelper::FillValue( sal_uInt16 nWhichId, sal_uInt16 nMemberId, const uno::Any*& pAny )
1381 {
1382  bool bRet = false;
1383  sal_uInt32 nKey = (nWhichId << 16) + nMemberId;
1384  auto aIt = m_Map.find( nKey );
1385  if (aIt != m_Map.end())
1386  {
1387  pAny = & aIt->second;
1388  bRet = true;
1389  }
1390  return bRet;
1391 }
1392 
1393 }//namespace SwUnoCursorHelper
1394 
1395 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool is() const
Starts a section of nodes in the document model.
Definition: node.hxx:303
static const OUString & PROP_DOCUMENTBASEURL()
#define FN_API_CALL
Definition: cmdid.h:529
sal_Int32 & GetStart()
start position
Definition: txatbase.hxx:77
void ResetAttrs(const SwPaM &rRg, bool bTextAttr=true, const std::set< sal_uInt16 > &rAttrs=std::set< sal_uInt16 >(), const bool bSendDataChangedEvents=true, SwRootFrame const *pLayout=nullptr)
Reset attributes.
Definition: docfmt.cxx:256
static const OUString & PROP_PASSWORD()
SwNode & GetNode(bool bPoint=true) const
Definition: pam.hxx:223
virtual SfxObjectFactory & GetFactory() const =0
virtual const SwDoc * GetDoc() const =0
static const OUString & PROP_FILENAME()
Marks a position in the document model.
Definition: pam.hxx:35
#define FN_UNO_DOCUMENT_INDEX_MARK
Definition: cmdid.h:502
void makeRedline(SwPaM const &rPaM, const OUString &rRedlineType, const uno::Sequence< beans::PropertyValue > &rRedlineProperties)
#define FN_UNO_CELL
Definition: cmdid.h:506
void SetExtraData(const SwRedlineExtraData *pData)
ExtraData gets copied, the pointer is therefore not taken over by the RedLineObject.
Definition: redline.hxx:331
const SwNodeNum * GetNum(SwRootFrame const *pLayout=nullptr) const
Definition: ndtxt.cxx:3967
SwTableBox * GetTableBox() const
If node is in a table return the respective table box.
Definition: node.cxx:745
virtual const SwRootFrame * GetCurrentLayout() const =0
#define RES_TXTATR_METAFIELD
Definition: hintids.hxx:139
SwDocShell * GetDocShell()
Definition: doc.hxx:1340
SwpHints * GetpSwpHints()
Definition: ndtxt.hxx:219
virtual AppendResult AppendRedline(SwRangeRedline *pNewRedl, bool bCallDelete)=0
Append a new redline.
void SetTimeStamp(const DateTime &rDT)
Definition: redline.hxx:152
virtual void SetRedlineFlags_intern(RedlineFlags eMode)=0
Set a new redline mode.
static SwTOXBase * GetCurTOX(const SwPosition &rPos)
Get current table of contents.
Definition: doctxm.cxx:449
SwNodeIndex nNode
Definition: pam.hxx:37
static const OUString & PROP_FILTEROPTIONS()
static SwPaM * lcl_createPamCopy(const SwPaM &rPam)
const SwFrameFormat * GetFrameFormat() const
Definition: unoframe.hxx:150
static css::uno::Reference< css::text::XTextContent > CreateXParagraph(SwDoc &rDoc, SwTextNode *pTextNode, css::uno::Reference< css::text::XText > const &xParentText=nullptr, const sal_Int32 nSelStart=-1, const sal_Int32 nSelEnd=-1)
Reference< XFrame > xFrame
const SwPosition * GetMark() const
Definition: pam.hxx:209
#define FN_UNO_PARA_CONT_PREV_SUBTREE
Definition: cmdid.h:584
void getNumberingProperty(SwPaM &rPam, PropertyState &eState, Any *pAny)
SwContentFrame * getLayoutFrame(const SwRootFrame *, const SwPosition *pPos=nullptr, std::pair< Point, bool > const *pViewPosAndCalcFrame=nullptr) const
Definition: node.cxx:1150
SwTableBox * GetTableBox() const
Definition: unotbl.hxx:143
virtual SwUndoId EndUndo(SwUndoId const eUndoId, SwRewriter const *const pRewriter)=0
Closes undo block.
OUString GetListId() const
Definition: ndtxt.cxx:4378
static const OUString & PROP_FILTERNAME()
const SfxItemPropertySet * GetPropertySet(sal_uInt16 PropertyId)
Definition: unomap1.cxx:1097
Definition: doc.hxx:185
void resetCursorPropertyValue(const SfxItemPropertySimpleEntry &rEntry, SwPaM &rPam)
bool getCursorPropertyValue(const SfxItemPropertySimpleEntry &rEntry, SwPaM &rPam, Any *pAny, PropertyState &eState, const SwTextNode *pNode)
SwTableLine is one table row in the document model.
Definition: swtable.hxx:344
SwNode & GetNode() const
Definition: ndindex.hxx:118
#define FN_UNO_TEXT_PARAGRAPH
Definition: cmdid.h:526
SwSectionFormat * GetFormat()
Definition: section.hxx:337
bool IsEndNote() const
Definition: fmtftn.hxx:73
IDocumentUndoRedo & GetIDocumentUndoRedo()
Definition: doc.cxx:176
void GetSelectableFromAny(uno::Reference< uno::XInterface > const &xIfc, SwDoc &rTargetDoc, SwPaM *&o_rpPaM, std::pair< OUString, FlyCntType > &o_rFrame, OUString &o_rTableName, SwUnoTableCursor const *&o_rpTableCursor,::sw::mark::IMark const *&o_rpMark, std::vector< SdrObject * > &o_rSdrObjects)
#define RES_TXTATR_CHARFMT
Definition: hintids.hxx:142
sal_uInt16 Which() const
Definition: txatbase.hxx:105
static css::uno::Reference< css::text::XTextField > CreateXTextField(SwDoc *pDoc, SwFormatField const *pFormat, SwServiceType nServiceId=SwServiceType::Invalid)
Definition: unofield.cxx:1252
virtual bool DeleteAndJoin(SwPaM &, const bool bForceJoinNext=false)=0
complete delete of a given PaM
SwTextAttr * GetTextAttrAt(sal_Int32 const nIndex, sal_uInt16 const nWhich, enum GetTextAttrMode const eMode=DEFAULT) const
get the innermost text attribute covering position nIndex.
Definition: ndtxt.cxx:1729
IDocumentContentOperations const & getIDocumentContentOperations() const
Definition: doc.cxx:347
bool IsListRestart() const
Definition: ndtxt.cxx:4120
static SwSection * GetCurrSection(const SwPosition &rPos)
Definition: ndsect.cxx:500
int GetActualListLevel() const
Returns the actual list level of this text node, when it is a list item.
Definition: ndtxt.cxx:4097
SwTableFormat * GetFrameFormat()
Definition: swtable.hxx:201
int GetAttrOutlineLevel() const
Returns outline level of this text node.
Definition: ndtxt.cxx:4032
static css::uno::Reference< css::lang::XSingleServiceFactory > GetStorageFactory(const css::uno::Reference< css::uno::XComponentContext > &rxContext=css::uno::Reference< css::uno::XComponentContext >())
const OUString & GetName() const
Definition: pagedesc.hxx:186
SwContentNode * GetContentNode(bool bPoint=true) const
Definition: pam.hxx:229
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
#define RES_TXTATR_META
Definition: hintids.hxx:138
virtual bool AppendTableRowRedline(SwTableRowRedline *pPtr, bool bCallDelete)=0
#define FN_UNO_ENDNOTE
Definition: cmdid.h:511
#define FN_UNO_LIST_ID
Definition: cmdid.h:581
Reference< XInputStream > xStream
SwIndex nContent
Definition: pam.hxx:38
#define FN_UNO_DOCUMENT_INDEX
Definition: cmdid.h:503
static SwNumRule * GetNumRuleAtPos(SwPosition &rPos, SwRootFrame const *pLayout=nullptr)
Definition: docnum.cxx:2394
void SetComment(const OUString &rS)
Definition: redline.hxx:151
const OUString & GetName() const
Definition: format.hxx:111
sal_uLong GetIndex() const
Definition: ndindex.hxx:151
const sal_uInt8 MAXLEVEL
Definition: swtypes.hxx:95
FontMetric Get(const OUString &rName, const OUString &rStyleName) const
void SetValue(sal_uInt16 nWhichId, sal_uInt16 nMemberId, const css::uno::Any &rAny)
const SwTable & GetTable() const
Definition: node.hxx:497
const SwFormatField & GetFormatField() const
Definition: txatbase.hxx:185
#define FN_UNO_PARA_CONDITIONAL_STYLE_NAME
Definition: cmdid.h:538
RedlineFlags on.
static const OUString & PROP_STREAM()
const OUString & GetCreatedNumRuleName() const
Definition: unosett.hxx:209
bool XTextRangeToSwPaM(SwUnoInternalPaM &rToFill, const uno::Reference< text::XTextRange > &xTextRange)
Definition: unoobj2.cxx:1031
void SetExtraData(const SwRedlineExtraData *pData)
ExtraData gets copied, the pointer is therefore not taken over by the RedLineObject.
Definition: redline.hxx:233
SwPaM * GetNext()
Definition: pam.hxx:264
Redline that holds information about a table-cell that had some change.
Definition: redline.hxx:319
SwPaM & SetPam(size_t nArrPos, SwPaM &rPam)
Definition: ednumber.cxx:99
static SwXCell * CreateXCell(SwFrameFormat *pTableFormat, SwTableBox *pBox, SwTable *pTable=nullptr)
Definition: unotbl.cxx:1155
#define FN_UNO_IS_NUMBER
Definition: cmdid.h:541
SwFormatColl & GetAnyFormatColl() const
Definition: node.hxx:716
std::unique_ptr< SwReader, o3tl::default_delete< SwReader > > SwReaderPtr
Definition: docsh.hxx:44
void DelNumRules(const SwPaM &, SwRootFrame const *pLayout=nullptr)
Definition: docnum.cxx:1331
void SetNodeNumStart(const SwPosition &rPos, sal_uInt16 nStt)
Definition: docnum.cxx:1031
FlyCntType GetFlyCntType() const
Definition: unoframe.hxx:158
#define FN_UNO_PAGE_STYLE
Definition: cmdid.h:496
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:136
const SfxPoolItem * GetItem(sal_uInt16 nSlotId) const
size_t Count() const
Definition: edimp.hxx:49
SwNumRule * FindNumRulePtr(const OUString &rName) const
Definition: docnum.cxx:2423
static SwTable * FindTable(SwFrameFormat const *const pFormat)
Definition: swtable.cxx:1920
const SwNumRule * GetNumRule()
Definition: unosett.hxx:205
virtual bool InsertString(const SwPaM &rRg, const OUString &, const SwInsertFlags nInsertMode=SwInsertFlags::EMPTYEXPAND)=0
Insert string into existing text node at position rRg.Point().
Style of a layout element.
Definition: frmfmt.hxx:57
size_t Count() const
Definition: ndhints.hxx:152
virtual SwUndoId StartUndo(SwUndoId const eUndoId, SwRewriter const *const pRewriter)=0
Opens undo block.
SwTextAttr * Get(size_t nPos) const
Definition: ndhints.hxx:154
bool GoInNode(SwPaM &rPam, SwMoveFnCollection const &fnMove)
Definition: pam.cxx:894
static const OUString & PROP_URL()
SwTableBox * FindBox(SwTable *pTable, SwTableBox *pBox)
search if a box exists in a table
Definition: unotbl.cxx:1176
const SwStartNode * StartOfSectionNode() const
Definition: node.hxx:131
const OUString * GetBulletFontNames() const
Definition: unosett.hxx:204
const SwPosition * GetPoint() const
Definition: pam.hxx:207
SwIndex & Assign(SwIndexReg *, sal_Int32)
Definition: index.cxx:198
#define RES_TXTATR_FTN
Definition: hintids.hxx:152
#define FN_UNO_NESTED_TEXT_CONTENT
Definition: cmdid.h:588
virtual SfxStyleSheetBase & Make(const OUString &, SfxStyleFamily eFam, SfxStyleSearchBits nMask=SfxStyleSearchBits::All)
SwPageFrame * FindPageFrame()
Definition: frame.hxx:658
MetadataImporterPluginType * result
int i
const OUString * GetNewCharStyleNames() const
Definition: unosett.hxx:203
SwPageDesc * GetPageDesc()
Definition: pagefrm.hxx:128
SwContentNode * GetContentNode()
Definition: node.hxx:615
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
Definition: pam.hxx:205
css::uno::Any getValue(const OUString &sKey) const
SwDoc * GetDoc()
Definition: node.hxx:702
SwDoc * GetDoc() const
Definition: pam.hxx:243
virtual SfxStyleSheetBasePool * GetStyleSheetPool() override
For Style PI.
Definition: docsh.cxx:1160
WEIGHT_NORMAL
size_t size() const
Definition: docary.hxx:91
static css::uno::Reference< css::text::XDocumentIndexMark > CreateXDocumentIndexMark(SwDoc &rDoc, SwTOXMark *pMark, TOXTypes eType=TOX_INDEX)
Definition: unoidx.cxx:1651
const SfxItemPropertyMap & getPropertyMap() const
SwNumRule * GetNumRule(bool bInParent=true) const
Returns numbering rule of this text node.
Definition: ndtxt.cxx:2814
Object Value
static css::uno::Reference< css::text::XDocumentIndex > CreateXDocumentIndex(SwDoc &rDoc, SwTOXBaseSection *pSection, TOXTypes eTypes=TOX_INDEX)
Definition: unoidx.cxx:424
SwFrameFormat * GetFrameFormat()
Definition: swtable.hxx:366
void setPropertyValue(const SfxItemPropertySimpleEntry &rEntry, const css::uno::Any &aVal, SfxItemSet &rSet) const
#define RES_TXTATR_TOXMARK
Definition: hintids.hxx:137
Marks a node in the document model.
Definition: ndindex.hxx:31
SwFrameFormat * GetFrameFormat()
Definition: swtable.hxx:425
css::uno::Type const & get()
static css::uno::Reference< css::text::XTextTable > GetObject(SwFrameFormat &rFormat)
Definition: unocoll.cxx:986
void makeTableCellRedline(SwTableBox &rTableBox, const OUString &rRedlineType, const uno::Sequence< beans::PropertyValue > &rRedlineProperties)
SwTextField * GetFieldTextAttrAt(const sal_Int32 nIndex, const bool bIncludeInputFieldAtStart=false) const
Definition: ndtxt.cxx:1773
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId()
Definition: unosett.cxx:1033
Reader * StartConvertFrom(SfxMedium &rMedium, SwReaderPtr &rpRdr, SwCursorShell const *pCursorSh=nullptr, SwPaM *pPaM=nullptr)
For inserting document.
Definition: docsh.cxx:168
SwStartNodeType GetStartNodeType() const
Definition: node.hxx:320
ITALIC_NONE
const SwDoc * GetDoc() const
The document is set in SwAttrPool now, therefore you always can access it.
Definition: format.hxx:119
virtual std::size_t InsertRedlineAuthor(const OUString &rAuthor)=0
virtual sal_Int32 * GetEnd()
end position
Definition: txatbase.cxx:49
#define FN_UNO_NUM_START_VALUE
Definition: cmdid.h:499
void InsertFile(SwUnoCursor *pUnoCursor, const OUString &rURL, const uno::Sequence< beans::PropertyValue > &rOptions)
DocumentType const eType
static css::uno::Reference< css::text::XTextContent > CreateXReferenceMark(SwDoc &rDoc, SwFormatRefMark *pMarkFormat)
Definition: unorefmk.cxx:131
const css::uno::Reference< css::uno::XAggregation > & GetAggregationInterface()
Definition: unodraw.hxx:243
A page of the document layout.
Definition: pagefrm.hxx:40
bool FillValue(sal_uInt16 nWhichId, sal_uInt16 nMemberId, const css::uno::Any *&pAny)
const SwFormatFootnote & GetFootnote() const
Definition: txatbase.hxx:194
const SfxItemPropertySimpleEntry * getByName(const OUString &rName) const
Redline that holds information about a table-row that had some change.
Definition: redline.hxx:298
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
Definition: doc.cxx:437
#define FN_UNO_TEXT_SECTION
Definition: cmdid.h:509
SwTable is one table in the document model, containing rows (which contain cells).
Definition: swtable.hxx:110
const SwPosition * Start() const
Definition: pam.hxx:212
EXPAND : (Start < nIndex <= End)
Definition: ndtxt.hxx:363
DEFAULT: (Start <= nIndex < End)
Definition: ndtxt.hxx:362
virtual const SwPaM * GetPaM() const =0
#define FN_UNO_TEXT_FIELD
Definition: cmdid.h:504
std::map< sal_uInt32, css::uno::Any > m_Map
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
uno::Reference< text::XTextContent > GetNestedTextContent(SwTextNode const &rTextNode, sal_Int32 const nIndex, bool const bParent)
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:79
void SetExtraData(const SwRedlineExtraData *pData)
ExtraData gets copied, the pointer is therefore not taken over by the RedLineObject.
Definition: redline.hxx:310
#define PROPERTY_MAP_PARAGRAPH
Definition: unomap.hxx:64
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
Definition: doc.cxx:367
SwCharFormat * GetCharFormat() const
Definition: fchrfmt.hxx:70
void SetCharFormat(SwCharFormat *)
Definition: number.cxx:277
const SwStartNode * GetSttNd() const
Definition: swtable.hxx:439
An SwTextAttr container, stores all directly formatted text portions for a text node.
Definition: ndhints.hxx:76
#define FN_UNO_NUM_RULES
Definition: cmdid.h:501
const SwCharFormats * GetCharFormats() const
Definition: doc.hxx:734
#define FN_NUMBER_NEWSTART
Definition: cmdid.h:436
SwNumberTree::tSwNumTreeNumber GetAttrListRestartValue() const
Definition: ndtxt.cxx:4174
#define FN_UNO_CHARFMT_SEQUENCE
Definition: cmdid.h:565
SwMoveFnCollection const & fnMoveForward
SwPam::Move()/Find() default argument.
Definition: paminit.cxx:59
std::shared_ptr< const SfxFilter > GetFilter4FilterName(const OUString &rName, SfxFilterFlags nMust=SfxFilterFlags::NONE, SfxFilterFlags nDont=SFX_FILTER_NOTINSTALLED) const
#define FN_UNO_REFERENCE_MARK
Definition: cmdid.h:508
#define SAL_INFO(area, stream)
sal_Int32 GetIndex() const
Definition: index.hxx:95
bool IsCountedInList() const
Definition: ndtxt.cxx:4240
static void FillProgName(const OUString &rName, OUString &rFillName, SwGetPoolIdFromName)
SwNodes & GetNodes()
Definition: doc.hxx:403
SdrObject * GetSdrObject() const
static SW_DLLPUBLIC css::uno::Reference< css::text::XTextFrame > CreateXTextFrame(SwDoc &rDoc, SwFrameFormat *pFrameFormat)
Definition: unoframe.cxx:3141
SwTableBox is one table cell in the document model.
Definition: swtable.hxx:386
const SwUnoCursor * GetTableCursor() const
Definition: unotbl.cxx:3847
SwUnoPropertyMapProvider aSwMapProvider
Definition: unomap1.cxx:130
#define FN_UNO_TEXT_FRAME
Definition: cmdid.h:507
::sw::mark::IMark const * GetBookmarkInDoc(SwDoc const *const pDoc, const css::uno::Reference< css::lang::XUnoTunnel > &xUT)
Definition: unobkm.cxx:183
bool IsContinueingPreviousSubTree() const
#define RES_TXTATR_REFMARK
Definition: hintids.hxx:136
static css::uno::Reference< css::text::XFootnote > CreateXFootnote(SwDoc &rDoc, SwFormatFootnote *pFootnoteFormat, bool isEndnote=false)
Definition: unoftn.cxx:133
SwStartNodeType
Definition: ndtyp.hxx:50
SwTableNode * FindTableNode()
Search table node, in which it is.
Definition: node.cxx:351
SwFormatColl * GetCurTextFormatColl(SwPaM &rPam, const bool bConditional)
Definition: unoobj.cxx:612
virtual bool SplitNode(const SwPosition &rPos, bool bChkTableStart)=0
Split a node at rPos (implemented only for TextNode).
OUString GetNumString(const bool _bInclPrefixAndSuffixStrings=true, const unsigned int _nRestrictToThisLevel=MAXLEVEL, SwRootFrame const *pLayout=nullptr) const
Returns outline of numbering string.
Definition: ndtxt.cxx:3131
const SfxPoolItem & GetAttr() const
Definition: txatbase.hxx:153
void GetCurPageStyle(SwPaM const &rPaM, OUString &rString)
void setNumberingProperty(const Any &rValue, SwPaM &rPam)
#define RES_PARATR_OUTLINELEVEL
Definition: hintids.hxx:177
std::vector< SwTextAttr * > GetTextAttrsAt(sal_Int32 const nIndex, sal_uInt16 const nWhich) const
get the innermost text attributes covering position nIndex.
Definition: ndtxt.cxx:1720
ScXMLEditAttributeMap::Entry const aEntries[]
virtual RedlineFlags GetRedlineFlags() const =0
Query the currently set redline mode.
SwFormatColl * GetFormatColl() const
Definition: node.hxx:447
bool IsInList() const
Definition: ndtxt.cxx:4344
bool DocInsertStringSplitCR(SwDoc &rDoc, const SwPaM &rNewCursor, const OUString &rText, const bool bForceExpandHints)
virtual bool AppendTableCellRedline(SwTableCellRedline *pPtr, bool bCallDelete)=0
virtual SwUnoCursor * GetCursor()=0
#define FN_UNO_TEXT_TABLE
Definition: cmdid.h:505
#define FN_UNO_NUM_LEVEL
Definition: cmdid.h:500
virtual void SetMark()
Unless this is called, the getter method of Mark will return Point.
Definition: pam.cxx:457
const FontList * GetFontList() const
void makeTableRowRedline(SwTableLine &rTableLine, const OUString &rRedlineType, const uno::Sequence< beans::PropertyValue > &rRedlineProperties)
static css::uno::Reference< css::text::XTextSection > GetObject(SwSectionFormat &rFormat)
Definition: unocoll.cxx:1534
SfxFilterContainer * GetFilterContainer() const
const SwFormatCharFormat & GetCharFormat() const
Definition: txatbase.hxx:173
static const OUString & PROP_INPUTSTREAM()
OUString SetNumRule(const SwPaM &, const SwNumRule &, bool bCreateNewList, SwRootFrame const *pLayout=nullptr, const OUString &sContinuedListId=OUString(), bool bSetItem=true, const bool bResetIndentAttrs=false)
Accept changes of outline styles for OutlineRule.
Definition: docnum.cxx:861
bool HasAttrListRestartValue() const
Definition: ndtxt.cxx:4169
virtual SfxStyleSheetBase * Find(const OUString &, SfxStyleFamily eFam, SfxStyleSearchBits n=SfxStyleSearchBits::All)
void DeepCopyPaM(SwPaM const &rSource, SwPaM &rTarget)
Definition: unoobj2.cxx:136
#define FN_UNO_FOOTNOTE
Definition: cmdid.h:510
bool IsTextNode() const
Definition: node.hxx:636
static bool isInvalidStyle(const OUString &rName)
Definition: unosett.cxx:1023
OUString const & GetName() const
sal_Int16 IsNodeNumStart(SwPaM const &rPam, PropertyState &eState)
#define FN_UNO_PARA_NUM_STRING
Definition: cmdid.h:585
SwFrameFormat * GetFlyFormat() const
If node is in a fly return the respective format.
Definition: node.cxx:710
#define PROPERTY_MAP_TEXTPORTION_EXTENSIONS
Definition: unomap.hxx:61
const sal_Int32 COMPLETE_STRING
Definition: swtypes.hxx:61
#define FN_UNO_PARA_STYLE
Definition: cmdid.h:495
GetTextAttrMode
Definition: ndtxt.hxx:360
const SwAttrPool & GetAttrPool() const
Definition: doc.hxx:1307
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
Definition: ndtxt.hxx:842
SwFrameFormat * GetFrameFormat() const
Definition: unotbl.hxx:146
SwNumRule * GetOutlineNumRule() const
Definition: doc.hxx:1013
static const OUString & GetProgName(const OUString &rName, SwGetPoolIdFromName)
SW_DLLPUBLIC SwFrameFormat * GetFrameFormat()
Definition: unotbl.cxx:2038