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