LibreOffice Module sw (master)  1
fltshell.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #include <memory>
21 #include <sal/config.h>
22 #include <sal/log.hxx>
23 #include <osl/diagnose.h>
24 
25 #include <cstddef>
26 
27 #include <hintids.hxx>
28 #include <hints.hxx>
29 #include <vcl/graphicfilter.hxx>
30 
31 #include <vcl/graph.hxx>
32 #include <svl/urihelper.hxx>
33 #include <editeng/boxitem.hxx>
34 #include <editeng/wghtitem.hxx>
35 #include <editeng/cmapitem.hxx>
36 #include <editeng/contouritem.hxx>
37 #include <editeng/postitem.hxx>
39 #include <svl/stritem.hxx>
40 #include <unotools/charclass.hxx>
41 #include <txtftn.hxx>
42 #include <fmtpdsc.hxx>
43 #include <fmtftn.hxx>
44 #include <fmtanchr.hxx>
45 #include <fmtrfmrk.hxx>
46 #include <fmtclds.hxx>
47 #include <fmtfld.hxx>
48 #include <fmtfsize.hxx>
49 #include <fmthdft.hxx>
50 #include <fmtcntnt.hxx>
51 #include <redline.hxx>
52 #include <pam.hxx>
53 #include <doc.hxx>
57 #include <IDocumentState.hxx>
59 #include <IDocumentMarkAccess.hxx>
60 #include <ndtxt.hxx>
61 #include <frmatr.hxx>
62 #include <fldbas.hxx>
63 #include <docufld.hxx>
64 #include <txtfld.hxx>
65 #include <charatr.hxx>
66 #include <swtable.hxx>
67 #include <tox.hxx>
68 #include <expfld.hxx>
69 #include <section.hxx>
70 #include <tblsel.hxx>
71 #include <pagedesc.hxx>
72 #include <docsh.hxx>
73 #include <fltshell.hxx>
74 #include <viewsh.hxx>
75 #include <shellres.hxx>
76 #include <rdfhelper.hxx>
77 
78 using namespace com::sun::star;
79 
80 static SwContentNode* GetContentNode(SwDoc* pDoc, SwNodeIndex& rIdx, bool bNext)
81 {
82  SwContentNode * pCNd = rIdx.GetNode().GetContentNode();
83  if(!pCNd && nullptr == (pCNd = bNext ? pDoc->GetNodes().GoNext(&rIdx)
84  : SwNodes::GoPrevious(&rIdx)))
85  {
86  pCNd = bNext ? SwNodes::GoPrevious(&rIdx)
87  : pDoc->GetNodes().GoNext(&rIdx);
88  OSL_ENSURE(pCNd, "no ContentNode found");
89  }
90  return pCNd;
91 }
92 
93 static OUString lcl_getTypePath(OUString& rType)
94 {
95  OUString aRet;
96  if (rType.startsWith("urn:bails"))
97  {
98  rType = "urn:bails";
99  aRet = "tscp/bails.rdf";
100  }
101  return aRet;
102 }
103 
104 // Stack entry for all text attributes
105 SwFltStackEntry::SwFltStackEntry(const SwPosition& rStartPos, std::unique_ptr<SfxPoolItem> pHt)
106  : m_aMkPos(rStartPos)
107  , m_aPtPos(rStartPos)
108  , pAttr( std::move(pHt) )
109  , m_isAnnotationOnEnd(false)
110  , mnStartCP(-1)
111  , mnEndCP(-1)
112  , bIsParaEnd(false)
113 {
114  bOld = false; // used for marking Attributes *before* skipping field results
115  bOpen = true; // lock the attribute --> may first
116  bConsumedByField = false;
117 }
118 
120 {
121  // Although attribute got passed as pointer, it gets deleted here
122 }
123 
125 {
126  // Release attribute and keep track of end
127  // Everything with sal_uInt16s, lest the inserting of new text at
128  // the cursor position moves the attribute's range
129  // That's not the desired behavior!
130  bOpen = false; // release and remember END
131  m_aPtPos.SetPos(rEndPos);
132 }
133 
134 bool SwFltStackEntry::MakeRegion(SwDoc* pDoc, SwPaM& rRegion, bool bCheck,
135  const SwFltPosition &rMkPos, const SwFltPosition &rPtPos, bool bIsParaEnd,
136  sal_uInt16 nWhich)
137 {
138  // does this range actually contain something?
139  // empty range is allowed if at start of empty paragraph
140  // fields are special: never have range, so leave them
141 
142  // The only position of 0x0D will not be able to make region in the old logic
143  // because it is beyond the length of para...need special consideration here.
144  sal_uLong nMk = rMkPos.m_nNode.GetIndex() + 1;
145  const SwNodes& rMkNodes = rMkPos.m_nNode.GetNodes();
146  if (nMk >= rMkNodes.Count())
147  return false;
148  SwContentNode *const pContentNode(rMkNodes[nMk]->GetContentNode());
149  if (rMkPos == rPtPos &&
150  ((0 != rPtPos.m_nContent) || (pContentNode && (0 != pContentNode->Len())))
151  && ( RES_TXTATR_FIELD != nWhich
152  && RES_TXTATR_ANNOTATION != nWhich
153  && RES_TXTATR_INPUTFIELD != nWhich )
154  && !(bIsParaEnd && pContentNode && pContentNode->IsTextNode() && 0 != pContentNode->Len() ))
155  {
156  return false;
157  }
158  // The content indices always apply to the node!
159  rRegion.GetPoint()->nNode = rMkPos.m_nNode.GetIndex() + 1;
160  SwContentNode* pCNd = GetContentNode(pDoc, rRegion.GetPoint()->nNode, true);
161 
162  SAL_WARN_IF(pCNd->Len() < rMkPos.m_nContent, "sw.ww8",
163  "invalid content index " << rMkPos.m_nContent << " but text node has only " << pCNd->Len());
164  rRegion.GetPoint()->nContent.Assign(pCNd,
165  std::min<sal_Int32>(rMkPos.m_nContent, pCNd->Len()));
166  rRegion.SetMark();
167  if (rMkPos.m_nNode != rPtPos.m_nNode)
168  {
169  sal_uLong n = rPtPos.m_nNode.GetIndex() + 1;
170  SwNodes& rNodes = rRegion.GetPoint()->nNode.GetNodes();
171  if (n >= rNodes.Count())
172  return false;
173  rRegion.GetPoint()->nNode = n;
174  pCNd = GetContentNode(pDoc, rRegion.GetPoint()->nNode, false);
175  }
176  SAL_WARN_IF(pCNd->Len() < rPtPos.m_nContent, "sw.ww8",
177  "invalid content index " << rPtPos.m_nContent << " but text node has only " << pCNd->Len());
178  rRegion.GetPoint()->nContent.Assign(pCNd,
179  std::min<sal_Int32>(rPtPos.m_nContent, pCNd->Len()));
180  OSL_ENSURE( CheckNodesRange( rRegion.Start()->nNode,
181  rRegion.End()->nNode, true ),
182  "attribute or similar crosses section-boundaries" );
183  if( bCheck )
184  return CheckNodesRange( rRegion.Start()->nNode,
185  rRegion.End()->nNode, true );
186  else
187  return true;
188 }
189 
190 bool SwFltStackEntry::MakeRegion(SwDoc* pDoc, SwPaM& rRegion, bool bCheck) const
191 {
192  return MakeRegion(pDoc, rRegion, bCheck, m_aMkPos, m_aPtPos, bIsParaEnd,
193  pAttr->Which());
194 }
195 
197  : nFieldFlags(nFieldFl),bHasSdOD(true), bSdODChecked(false), pDoc(pDo), bIsEndStack(false)
198 {
199 }
200 
202 {
203  OSL_ENSURE(m_Entries.empty(), "There are still Attributes on the stack");
204 }
205 
206 // MoveAttrs() is meant to address the following problem:
207 // When a field like "set variable" is set through the stack, the text
208 // is shifted by one \xff character, which makes all subsequent
209 // attribute positions invalid.
210 // After setting the attribute in the doc, MoveAttrs() needs to be
211 // called in order to push all attribute positions to the right in the
212 // same paragraph further out by one character.
214 {
215  size_t nCnt = m_Entries.size();
216  sal_uLong nPosNd = rPos.nNode.GetIndex();
217  sal_uInt16 nPosCt = rPos.nContent.GetIndex() - 1;
218 
219  for (size_t i=0; i < nCnt; ++i)
220  {
221  SwFltStackEntry& rEntry = *m_Entries[i];
222  if (
223  (rEntry.m_aMkPos.m_nNode.GetIndex()+1 == nPosNd) &&
224  (rEntry.m_aMkPos.m_nContent >= nPosCt)
225  )
226  {
227  rEntry.m_aMkPos.m_nContent++;
228  OSL_ENSURE( rEntry.m_aMkPos.m_nContent
229  <= pDoc->GetNodes()[nPosNd]->GetContentNode()->Len(),
230  "Attribute ends after end of line" );
231  }
232  if (
233  (rEntry.m_aPtPos.m_nNode.GetIndex()+1 == nPosNd) &&
234  (rEntry.m_aPtPos.m_nContent >= nPosCt)
235  )
236  {
237  if ( !rEntry.m_isAnnotationOnEnd
238  || rEntry.m_aPtPos.m_nContent > nPosCt)
239  {
240  assert(!(rEntry.m_isAnnotationOnEnd && rEntry.m_aPtPos.m_nContent > nPosCt));
241  if ( eMode == MoveAttrsMode::POSTIT_INSERTED
242  && rEntry.m_aPtPos.m_nContent == nPosCt
243  && rEntry.pAttr->Which() == RES_FLTR_ANNOTATIONMARK)
244  {
245  rEntry.m_isAnnotationOnEnd = true;
246  eMode = MoveAttrsMode::DEFAULT; // only set 1 flag
247  }
248  rEntry.m_aPtPos.m_nContent++;
249  OSL_ENSURE( rEntry.m_aPtPos.m_nContent
250  <= pDoc->GetNodes()[nPosNd]->GetContentNode()->Len(),
251  "Attribute ends after end of line" );
252  }
253  }
254  }
255 }
256 
258 {
259  size_t nCnt = m_Entries.size();
260  for (size_t i=0; i < nCnt; ++i)
261  m_Entries[i]->bOld = true;
262 }
263 
264 namespace
265 {
266  bool couldExtendEntry(const SwFltStackEntry *pExtendCandidate,
267  const SfxPoolItem& rAttr)
268  {
269  return (pExtendCandidate &&
270  !pExtendCandidate->bConsumedByField &&
271  //if we bring character attributes into the fold we need to both
272  //a) consider RES_CHRATR_FONTSIZE and RES_CHRATR_FONT wrt Word's CJK/CTL variants
273  //b) consider crossing table cell boundaries (tdf#102334)
274  isPARATR_LIST(rAttr.Which()) &&
275  *(pExtendCandidate->pAttr) == rAttr);
276  }
277 }
278 
279 void SwFltControlStack::NewAttr(const SwPosition& rPos, const SfxPoolItem& rAttr)
280 {
281  sal_uInt16 nWhich = rAttr.Which();
282  // Set end position of potentially equal attributes on stack, so
283  // as to avoid having them accumulate
284  SwFltStackEntry *pExtendCandidate = SetAttr(rPos, nWhich);
285  if (couldExtendEntry(pExtendCandidate, rAttr))
286  {
287  //Here we optimize by seeing if there is an attribute uncommitted
288  //to the document which
289 
290  //a) has the same value as this attribute
291  //b) is already open, or ends at the same place as where we're starting
292  //from. If so we merge it with this one and elide adding another
293  //to the stack
294  pExtendCandidate->SetEndPos(rPos);
295  pExtendCandidate->bOpen=true;
296  }
297  else
298  {
299  SwFltStackEntry *pTmp = new SwFltStackEntry(rPos, std::unique_ptr<SfxPoolItem>(rAttr.Clone()) );
300  pTmp->SetStartCP(GetCurrAttrCP());
301  m_Entries.push_back(std::unique_ptr<SwFltStackEntry>(pTmp));
302  }
303 }
304 
305 void SwFltControlStack::DeleteAndDestroy(Entries::size_type nCnt)
306 {
307  OSL_ENSURE(nCnt < m_Entries.size(), "Out of range!");
308  if (nCnt < m_Entries.size())
309  {
310  auto aElement = m_Entries.begin() + nCnt;
311  m_Entries.erase(aElement);
312  }
313  //Clear the para end position recorded in reader intermittently for the least impact on loading performance
314  //Because the attributes handled based on the unit of para
315  if ( empty() )
316  {
318  bHasSdOD = true;
319  bSdODChecked = false;
320  }
321 }
322 
323 // SwFltControlStack::StealAttr() removes attributes of the given type
324 // from the stack. Allowed as nAttrId: 0 meaning any, or a specific
325 // type. This makes them disappear from the doc structure. Only
326 // attributes from the same paragraph as rPos are removed. Used for
327 // graphic apos -> images.
329 {
330  size_t nCnt = m_Entries.size();
331 
332  while (nCnt)
333  {
334  nCnt --;
335  SwFltStackEntry& rEntry = *m_Entries[nCnt];
336  if (rEntry.m_aPtPos.m_nNode.GetIndex()+1 == rNode.GetIndex())
337  {
338  DeleteAndDestroy(nCnt); // delete from the stack
339  }
340  }
341 }
342 
343 // SwFltControlStack::KillUnlockedAttr() removes all attributes from
344 // the stack, which are assigned to an rPos. This makes them disappear
345 // from the doc structure. Used in WW import for ignoring attributes
346 // assigned to the 0x0c section break symbol.
348 {
349  SwFltPosition aFltPos(rPos);
350 
351  size_t nCnt = m_Entries.size();
352  while( nCnt )
353  {
354  nCnt --;
355  SwFltStackEntry& rEntry = *m_Entries[nCnt];
356  if( !rEntry.bOld
357  && !rEntry.bOpen
358  && (rEntry.m_aMkPos == aFltPos)
359  && (rEntry.m_aPtPos == aFltPos))
360  {
361  DeleteAndDestroy( nCnt ); // remove from stack
362  }
363  }
364 }
365 
366 // Unlock all locked attributes and move to the end, all others will
367 // be applied to the document and removed from the stack.
368 // Returns if there were any selected attributes on the stack
370  sal_uInt16 nAttrId, bool bTstEnde, long nHand,
371  bool consumedByField)
372 {
373  SwFltStackEntry *pRet = nullptr;
374 
375  SwFltPosition aFltPos(rPos);
376 
377  OSL_ENSURE(!nAttrId ||
378  (POOLATTR_BEGIN <= nAttrId && POOLATTR_END > nAttrId) ||
379  (RES_FLTRATTR_BEGIN <= nAttrId && sal_uInt16(RES_FLTRATTR_END) > nAttrId),
380  "Wrong id for attribute");
381 
382  auto aI = m_Entries.begin();
383  while (aI != m_Entries.end())
384  {
385  bool bLastEntry = aI == m_Entries.end() - 1;
386 
387  SwFltStackEntry& rEntry = **aI;
388  if (rEntry.bOpen)
389  {
390  // set end of attribute
391  bool bF = false;
392  if (!nAttrId )
393  {
394  bF = true;
395  }
396  else if (nAttrId == rEntry.pAttr->Which())
397  {
398  if( nAttrId != RES_FLTR_BOOKMARK && nAttrId != RES_FLTR_ANNOTATIONMARK && nAttrId != RES_FLTR_RDFMARK )
399  {
400  // query handle
401  bF = true;
402  }
403  else if (nAttrId == RES_FLTR_BOOKMARK && nHand == static_cast<SwFltBookmark*>(rEntry.pAttr.get())->GetHandle())
404  {
405  bF = true;
406  }
407  else if (nAttrId == RES_FLTR_ANNOTATIONMARK && nHand == static_cast<CntUInt16Item*>(rEntry.pAttr.get())->GetValue())
408  {
409  bF = true;
410  }
411  else if (nAttrId == RES_FLTR_RDFMARK && nHand == static_cast<SwFltRDFMark*>(rEntry.pAttr.get())->GetHandle())
412  {
413  bF = true;
414  }
415  }
416  if (bF)
417  {
418  rEntry.bConsumedByField = consumedByField;
419  rEntry.SetEndPos(rPos);
420  rEntry.SetEndCP(GetCurrAttrCP());
421  if (bLastEntry && nAttrId == rEntry.pAttr->Which())
422  {
423  //potential candidate for merging with an identical
424  //property beginning at rPos
425  pRet = &rEntry;
426  }
427  }
428  ++aI;
429  continue;
430  }
431 
432  // if the end position is equal to the cursor position, then
433  // refrain from applying it; there needs to be following text,
434  // except at the very end. (attribute expansion !!)
435  // Never apply end stack except at document ending
436  if (bTstEnde)
437  {
438  if (bIsEndStack)
439  {
440  ++aI;
441  continue;
442  }
443 
444  //defer inserting this attribute into the document until
445  //we advance to the next node, or finish processing the document
446  if (rEntry.m_aPtPos.m_nNode.GetIndex() == aFltPos.m_nNode.GetIndex())
447  {
448  if (bLastEntry && nAttrId == rEntry.pAttr->Which() &&
449  rEntry.m_aPtPos.m_nContent == aFltPos.m_nContent)
450  {
451  //potential candidate for merging with an identical
452  //property beginning at rPos
453  pRet = &rEntry;
454  }
455 
456  ++aI;
457  continue;
458  }
459  }
460  SetAttrInDoc(rPos, rEntry);
461  aI = m_Entries.erase(aI);
462  }
463 
464  return pRet;
465 }
466 
467 static bool MakePoint(const SwFltStackEntry& rEntry, SwDoc* pDoc,
468  SwPaM& rRegion)
469 {
470  // the anchor is the Pam's Point. It's modified when inserting
471  // text, etc.; therefore it is kept on the stack. Only the
472  // attribute's format needs to be set.
473  rRegion.DeleteMark();
474 
475  sal_uLong nMk = rEntry.m_aMkPos.m_nNode.GetIndex() + 1;
476  const SwNodes& rMkNodes = rEntry.m_aMkPos.m_nNode.GetNodes();
477  if (nMk >= rMkNodes.Count())
478  return false;
479 
480  rRegion.GetPoint()->nNode = nMk;
481  SwContentNode* pCNd = GetContentNode(pDoc, rRegion.GetPoint()->nNode, true);
482  rRegion.GetPoint()->nContent.Assign(pCNd, rEntry.m_aMkPos.m_nContent);
483  return true;
484 }
485 
486 // MakeBookRegionOrPoint() behaves like MakeRegionOrPoint, except that
487 // it adheres to certain restrictions on bookmarks in tables (cannot
488 // span more than one cell)
489 static bool MakeBookRegionOrPoint(const SwFltStackEntry& rEntry, SwDoc* pDoc,
490  SwPaM& rRegion )
491 {
492  if (rEntry.MakeRegion(pDoc, rRegion, true/*bCheck*/ ))
493  {
494  if (rRegion.GetPoint()->nNode.GetNode().FindTableBoxStartNode()
495  != rRegion.GetMark()->nNode.GetNode().FindTableBoxStartNode())
496  {
497  rRegion.Exchange(); // invalid range
498  rRegion.DeleteMark(); // -> both to mark
499  }
500  return true;
501  }
502  return MakePoint(rEntry, pDoc, rRegion);
503 }
504 
505 // IterateNumrulePiece() looks for the first range valid for Numrules
506 // between rTmpStart and rEnd.
507 
508 // rNds denotes the doc nodes
509 // rEnd denotes the range end,
510 // rTmpStart is an in/out parameter: in: start of range to be searched,
511 // out: start of valid range
512 // rTmpEnd is an out parameter
513 // Returns true for valid range
514 static bool IterateNumrulePiece( const SwNodeIndex& rEnd,
515  SwNodeIndex& rTmpStart, SwNodeIndex& rTmpEnd )
516 {
517  while( ( rTmpStart <= rEnd )
518  && !( rTmpStart.GetNode().IsTextNode() ) ) // look for valid start
519  ++rTmpStart;
520 
521  rTmpEnd = rTmpStart;
522  while( ( rTmpEnd <= rEnd )
523  && ( rTmpEnd.GetNode().IsTextNode() ) ) // look for valid end + 1
524  ++rTmpEnd;
525 
526  --rTmpEnd; // valid end
527 
528  return rTmpStart <= rTmpEnd; // valid ?
529 }
530 
531 //***This function will check whether there is existing individual attribute position for 0x0D***/
532 //The check will happen only once for a paragraph during loading
534 {
535  bool bRet = false;
536 
537  for (auto const& it : m_Entries)
538  {
539  SwFltStackEntry& rEntry = *it;
540  if ( rEntry.mnStartCP == rEntry.mnEndCP )
541  {
542  if ( CheckSdOD(rEntry.mnStartCP,rEntry.mnEndCP) )
543  {
544  bRet = true;
545  break;
546  }
547  }
548  }
549 
550  return bRet;
551 }
552 
554  SwFltStackEntry& rEntry)
555 {
556  SwPaM aRegion( rTmpPos );
557 
558  switch(rEntry.pAttr->Which())
559  {
560  case RES_FLTR_ANCHOR:
561  {
562  SwFrameFormat* pFormat = static_cast<SwFltAnchor*>(rEntry.pAttr.get())->GetFrameFormat();
563  if (pFormat != nullptr)
564  {
565  MakePoint(rEntry, pDoc, aRegion);
566  SwFormatAnchor aAnchor(pFormat->GetAnchor());
567  aAnchor.SetAnchor(aRegion.GetPoint());
568  pFormat->SetFormatAttr(aAnchor);
569  // So the frames will be created when inserting into
570  // existing doc (after setting the anchor!):
572  && (RndStdIds::FLY_AT_PARA == pFormat->GetAnchor().GetAnchorId()))
573  {
574  pFormat->MakeFrames();
575  }
576  }
577  }
578  break;
579 
580  case RES_TXTATR_FIELD:
583  break;
584 
585  case RES_TXTATR_TOXMARK:
586  break;
587 
588  case RES_FLTR_NUMRULE: // insert Numrule
589  {
590  const OUString& rNumNm = static_cast<SfxStringItem*>(rEntry.pAttr.get())->GetValue();
591  SwNumRule* pNumRule = pDoc->FindNumRulePtr( rNumNm );
592  if( pNumRule )
593  {
594  if( rEntry.MakeRegion(pDoc, aRegion, true))
595  {
596  SwNodeIndex aTmpStart( aRegion.Start()->nNode );
597  SwNodeIndex aTmpEnd( aTmpStart );
598  SwNodeIndex& rRegEndNd = aRegion.End()->nNode;
599  while( IterateNumrulePiece( rRegEndNd,
600  aTmpStart, aTmpEnd ) )
601  {
602  SwPaM aTmpPam( aTmpStart, aTmpEnd );
603  // no start of a new list
604  pDoc->SetNumRule( aTmpPam, *pNumRule, false );
605 
606  aTmpStart = aTmpEnd; // here starts the next range
607  ++aTmpStart;
608  }
609  }
610  else
611  pDoc->DelNumRule( rNumNm );
612  }
613  }
614  break;
615 
616  case RES_FLTR_BOOKMARK:
617  {
618  SwFltBookmark* pB = static_cast<SwFltBookmark*>(rEntry.pAttr.get());
619  const OUString& rName = static_cast<SwFltBookmark*>(rEntry.pAttr.get())->GetName();
620 
622  {
624  if (!pFT)
625  {
628  }
629  SwSetExpField aField(static_cast<SwSetExpFieldType*>(pFT), pB->GetValSys());
631  MakePoint(rEntry, pDoc, aRegion);
633  MoveAttrs( *(aRegion.GetPoint()) );
634  }
635  if ( ( !IsFlagSet(HYPO) || IsFlagSet(BOOK_AND_REF) ) &&
636  !rEntry.bConsumedByField )
637  {
638  MakeBookRegionOrPoint(rEntry, pDoc, aRegion);
639  // #i120879# - create a cross reference heading bookmark if appropriate.
640  const IDocumentMarkAccess::MarkType eBookmarkType =
641  ( pB->IsTOCBookmark() &&
645  pDoc->getIDocumentMarkAccess()->makeMark(aRegion, rName, eBookmarkType, sw::mark::InsertMode::New);
646  }
647  }
648  break;
650  {
651  if (MakeBookRegionOrPoint(rEntry, pDoc, aRegion))
652  {
653  SwTextNode const*const pTextNode(
654  aRegion.End()->nNode.GetNode().GetTextNode());
655  assert(pTextNode);
656  SwTextField const*const pField(pTextNode->GetFieldTextAttrAt(
657  aRegion.End()->nContent.GetIndex() - 1, true));
658  if (pField)
659  {
660  SwPostItField const*const pPostIt(
661  dynamic_cast<SwPostItField const*>(pField->GetFormatField().GetField()));
662  if (pPostIt)
663  {
664  assert(pPostIt->GetName().isEmpty());
665  pDoc->getIDocumentMarkAccess()->makeAnnotationMark(aRegion, OUString());
666  }
667  else
668  {
669  SAL_WARN("sw", "RES_FLTR_ANNOTATIONMARK: unexpected field");
670  }
671  }
672  else
673  {
674  SAL_WARN("sw", "RES_FLTR_ANNOTATIONMARK: missing field");
675  }
676  }
677  else
678  SAL_WARN("sw", "failed to make book region or point");
679  }
680  break;
681  case RES_FLTR_RDFMARK:
682  {
683  if (MakeBookRegionOrPoint(rEntry, pDoc, aRegion))
684  {
685  SwFltRDFMark* pMark = static_cast<SwFltRDFMark*>(rEntry.pAttr.get());
686  if (aRegion.GetNode().IsTextNode())
687  {
688  SwTextNode& rTextNode = *aRegion.GetNode().GetTextNode();
689 
690  for (const std::pair<OUString, OUString>& rAttribute : pMark->GetAttributes())
691  {
692  OUString aTypeNS = rAttribute.first;
693  OUString aMetadataFilePath = lcl_getTypePath(aTypeNS);
694  if (aMetadataFilePath.isEmpty())
695  continue;
696 
697  SwRDFHelper::addTextNodeStatement(aTypeNS, aMetadataFilePath, rTextNode, rAttribute.first, rAttribute.second);
698  }
699  }
700  }
701  else
702  SAL_WARN("sw", "failed to make book region or point");
703  }
704  break;
705  case RES_FLTR_TOX:
706  {
707  MakePoint(rEntry, pDoc, aRegion);
708 
709  SwPosition* pPoint = aRegion.GetPoint();
710 
711  SwFltTOX* pTOXAttr = static_cast<SwFltTOX*>(rEntry.pAttr.get());
712 
713  // test if on this node there had been a pagebreak BEFORE the
714  // tox attribute was put on the stack
716  SwContentNode* pNd = nullptr;
717  if( !pTOXAttr->HadBreakItem() || !pTOXAttr->HadPageDescItem() )
718  {
719  pNd = pPoint->nNode.GetNode().GetContentNode();
720  if( pNd )
721  {
722  const SfxItemSet* pSet = pNd->GetpSwAttrSet();
723  const SfxPoolItem* pItem;
724  if( pSet )
725  {
726  if( !pTOXAttr->HadBreakItem()
727  && SfxItemState::SET == pSet->GetItemState( RES_BREAK, false, &pItem ) )
728  {
729  aBkSet.Put( *pItem );
730  pNd->ResetAttr( RES_BREAK );
731  }
732  if( !pTOXAttr->HadPageDescItem()
733  && SfxItemState::SET == pSet->GetItemState( RES_PAGEDESC, false, &pItem ) )
734  {
735  aBkSet.Put( *pItem );
736  pNd->ResetAttr( RES_PAGEDESC );
737  }
738  }
739  }
740  }
741 
742  // set (above saved and removed) the break item at the node following the TOX
743  if (pNd && aBkSet.Count())
744  pNd->SetAttr(aBkSet);
745  }
746  break;
747  case RES_FLTR_REDLINE:
748  {
749  if (rEntry.MakeRegion(pDoc, aRegion, true))
750  {
754  SwFltRedline& rFltRedline = *static_cast<SwFltRedline*>(rEntry.pAttr.get());
755 
756  if( SwFltRedline::NoPrevAuthor != rFltRedline.nAutorNoPrev )
757  {
758  SwRedlineData aData(rFltRedline.eTypePrev,
759  rFltRedline.nAutorNoPrev,
760  rFltRedline.aStampPrev,
761  OUString(),
762  nullptr
763  );
764  pDoc->getIDocumentRedlineAccess().AppendRedline(new SwRangeRedline(aData, aRegion), true);
765  }
766  SwRedlineData aData(rFltRedline.eType,
767  rFltRedline.nAutorNo,
768  rFltRedline.aStamp,
769  OUString(),
770  nullptr
771  );
772  pDoc->getIDocumentRedlineAccess().AppendRedline( new SwRangeRedline(aData, aRegion), true );
776  }
777  }
778  break;
779  default:
780  {
781  // Revised for more complex situations should be considered
782  if ( !bSdODChecked )
783  {
784  bHasSdOD = HasSdOD();
785  bSdODChecked = true;
786  }
787  sal_Int32 nStart = rEntry.GetStartCP();
788  sal_Int32 nEnd = rEntry.GetEndCP();
789  if (nStart != -1 && nEnd != -1 && nEnd >= nStart )
790  {
791  rEntry.SetIsParaEnd( IsParaEndInCPs(nStart,nEnd,bHasSdOD) );
792  }
793  if (rEntry.MakeRegion(pDoc, aRegion, false))
794  {
795  if (rEntry.IsParaEnd())
796  {
797  pDoc->getIDocumentContentOperations().InsertPoolItem(aRegion, *rEntry.pAttr, SetAttrMode::DEFAULT, nullptr, true);
798  }
799  else
800  {
802  }
803  }
804  }
805  break;
806  }
807 }
808 
809 bool SwFltControlStack::IsParaEndInCPs(sal_Int32 /*nStart*/, sal_Int32 /*nEnd*/,bool /*bSdOD*/) const
810 {
811  return false;
812 }
813 
814 bool SwFltControlStack::CheckSdOD(sal_Int32 /*nStart*/, sal_Int32 /*nEnd*/)
815 {
816  return false;
817 }
818 
819 SfxPoolItem* SwFltControlStack::GetFormatStackAttr(sal_uInt16 nWhich, sal_uInt16 * pPos)
820 {
821  size_t nSize = m_Entries.size();
822 
823  while (nSize)
824  {
825  // is it the looked-for attribute ? (only applies to locked, meaning
826  // currently set attributes!!)
827  SwFltStackEntry &rEntry = *m_Entries[--nSize];
828  if (rEntry.bOpen && rEntry.pAttr->Which() == nWhich)
829  {
830  if (pPos)
831  *pPos = nSize;
832  return rEntry.pAttr.get(); // Ok, so stop
833  }
834  }
835  return nullptr;
836 }
837 
838 const SfxPoolItem* SwFltControlStack::GetOpenStackAttr(const SwPosition& rPos, sal_uInt16 nWhich)
839 {
840  SwFltPosition aFltPos(rPos);
841 
842  size_t nSize = m_Entries.size();
843 
844  while (nSize)
845  {
846  SwFltStackEntry &rEntry = *m_Entries[--nSize];
847  if (rEntry.bOpen && rEntry.pAttr->Which() == nWhich && rEntry.m_aMkPos == aFltPos)
848  {
849  return rEntry.pAttr.get();
850  }
851  }
852  return nullptr;
853 }
854 
856 {
857  const SwPosition *pStt = rPam.Start(), *pEnd = rPam.End();
858 
859  if( !rPam.HasMark() || *pStt >= *pEnd )
860  return;
861 
862  SwNodeIndex aStartNode(pStt->nNode, -1);
863  const sal_Int32 nStartIdx = pStt->nContent.GetIndex();
864  SwNodeIndex aEndNode(pEnd->nNode, -1);
865  const sal_Int32 nEndIdx = pEnd->nContent.GetIndex();
866 
867  // We don't support deleting content that is over one node, or removing a node.
868  OSL_ENSURE(aEndNode == aStartNode, "nodes must be the same, or this method extended");
869  if (aEndNode != aStartNode)
870  return;
871 
872  for (size_t nSize = m_Entries.size(); nSize > 0;)
873  {
874  SwFltStackEntry& rEntry = *m_Entries[--nSize];
875 
876  bool bEntryStartAfterSelStart =
877  (rEntry.m_aMkPos.m_nNode == aStartNode &&
878  rEntry.m_aMkPos.m_nContent >= nStartIdx);
879 
880  bool bEntryStartBeforeSelEnd =
881  (rEntry.m_aMkPos.m_nNode == aEndNode &&
882  rEntry.m_aMkPos.m_nContent <= nEndIdx);
883 
884  bool bEntryEndAfterSelStart = false;
885  bool bEntryEndBeforeSelEnd = false;
886  if (!rEntry.bOpen)
887  {
888  bEntryEndAfterSelStart =
889  (rEntry.m_aPtPos.m_nNode == aStartNode &&
890  rEntry.m_aPtPos.m_nContent >= nStartIdx);
891 
892  bEntryEndBeforeSelEnd =
893  (rEntry.m_aPtPos.m_nNode == aEndNode &&
894  rEntry.m_aPtPos.m_nContent <= nEndIdx);
895  }
896 
897  bool bTotallyContained = false;
898  if (
899  bEntryStartAfterSelStart && bEntryStartBeforeSelEnd &&
900  bEntryEndAfterSelStart && bEntryEndBeforeSelEnd
901  )
902  {
903  bTotallyContained = true;
904  }
905 
906  if (bTotallyContained)
907  {
908  // after start, before end, delete
909  DeleteAndDestroy(nSize);
910  continue;
911  }
912 
913  const sal_Int32 nContentDiff = nEndIdx - nStartIdx;
914 
915  // to be adjusted
916  if (bEntryStartAfterSelStart)
917  {
918  if (bEntryStartBeforeSelEnd)
919  {
920  // move start to new start
921  rEntry.m_aMkPos.SetPos(aStartNode, nStartIdx);
922  }
923  else
924  rEntry.m_aMkPos.m_nContent -= nContentDiff;
925  }
926 
927  if (bEntryEndAfterSelStart)
928  {
929  if (bEntryEndBeforeSelEnd)
930  rEntry.m_aPtPos.SetPos(aStartNode, nStartIdx);
931  else
932  rEntry.m_aPtPos.m_nContent -= nContentDiff;
933  }
934 
935  //That's what Open is, end equal to start, and nPtContent is invalid
936  if (rEntry.bOpen)
937  rEntry.m_aPtPos = rEntry.m_aMkPos;
938  }
939 }
940 
941 // methods of SwFltAnchor follow
943  SfxPoolItem(RES_FLTR_ANCHOR), pFrameFormat(pFormat)
944 {
945  pClient.reset( new SwFltAnchorClient(this) );
946  pFrameFormat->Add(pClient.get());
947 }
948 
950  SfxPoolItem(RES_FLTR_ANCHOR), pFrameFormat(rCpy.pFrameFormat)
951 {
952  pClient.reset( new SwFltAnchorClient(this) );
953  pFrameFormat->Add(pClient.get());
954 }
955 
957 {
958 }
959 
961 {
962  pFrameFormat = _pFrameFormat;
963 }
964 
965 
966 bool SwFltAnchor::operator==(const SfxPoolItem& rItem) const
967 {
968  return pFrameFormat == static_cast<const SwFltAnchor&>(rItem).pFrameFormat;
969 }
970 
972 {
973  return new SwFltAnchor(*this);
974 }
975 
977 : m_pFltAnchor(pFltAnchor)
978 {
979 }
980 
982 {
983  if (pNew->Which() == RES_FMT_CHG)
984  {
985  const SwFormatChg * pFormatChg = dynamic_cast<const SwFormatChg *> (pNew);
986 
987  if (pFormatChg != nullptr)
988  {
989  SwFrameFormat * pFrameFormat = dynamic_cast<SwFrameFormat *> (pFormatChg->pChangedFormat);
990 
991  if (pFrameFormat != nullptr)
992  m_pFltAnchor->SetFrameFormat(pFrameFormat);
993  }
994  }
995 }
996 
997 // methods of SwFltRedline follow
998 bool SwFltRedline::operator==(const SfxPoolItem& rItem) const
999 {
1000  return this == &rItem;
1001 }
1002 
1004 {
1005  return new SwFltRedline(*this);
1006 }
1007 
1008 // methods of SwFltBookmark follow
1009 SwFltBookmark::SwFltBookmark( const OUString& rNa, const OUString& rVa,
1010  long nHand, const bool bIsTOCBookmark )
1012  , mnHandle( nHand )
1013  , maName( rNa )
1014  , maVal( rVa )
1015  , mbIsTOCBookmark( bIsTOCBookmark )
1016 {
1017  // eSrc: CHARSET_DONTKNOW for no transform at operator <<
1018  // Upcase is always done.
1019  // Transform is never done at XXXStack.NewAttr(...).
1020  // otherwise: Src Charset from argument for aName
1021  // Src Charset from filter for aVal ( Text )
1022 
1024  {
1026  maName += rNa;
1027  }
1028 }
1029 
1030 bool SwFltBookmark::operator==(const SfxPoolItem& rItem) const
1031 {
1032  return ( maName == static_cast<const SwFltBookmark&>(rItem).maName)
1033  && (mnHandle == static_cast<const SwFltBookmark&>(rItem).mnHandle);
1034 }
1035 
1037 {
1038  return new SwFltBookmark(*this);
1039 }
1040 
1043  m_nHandle(0)
1044 {
1045 }
1046 
1047 bool SwFltRDFMark::operator==(const SfxPoolItem& rItem) const
1048 {
1049  if (!SfxPoolItem::operator==(rItem))
1050  return false;
1051 
1052  const SwFltRDFMark& rMark = static_cast<const SwFltRDFMark&>(rItem);
1053 
1054  return m_nHandle == rMark.m_nHandle && m_aAttributes == rMark.m_aAttributes;
1055 }
1056 
1058 {
1059  return new SwFltRDFMark(*this);
1060 }
1061 
1062 void SwFltRDFMark::SetHandle(long nHandle)
1063 {
1064  m_nHandle = nHandle;
1065 }
1066 
1068 {
1069  return m_nHandle;
1070 }
1071 
1072 void SwFltRDFMark::SetAttributes(const std::vector< std::pair<OUString, OUString> >& rAttributes)
1073 {
1074  m_aAttributes = rAttributes;
1075 }
1076 
1077 const std::vector< std::pair<OUString, OUString> >& SwFltRDFMark::GetAttributes() const
1078 {
1079  return m_aAttributes;
1080 }
1081 
1082 // methods of SwFltTOX follow
1084  : SfxPoolItem(RES_FLTR_TOX), m_xTOXBase(pBase),
1085  bHadBreakItem( false ), bHadPageDescItem( false )
1086 {
1087 }
1088 
1089 bool SwFltTOX::operator==(const SfxPoolItem& rItem) const
1090 {
1091  return m_xTOXBase.get() == static_cast<const SwFltTOX&>(rItem).m_xTOXBase.get();
1092 }
1093 
1095 {
1096  return new SwFltTOX(*this);
1097 }
1098 
1099 // UpdatePageDescs needs to be called at end of parsing to make Writer actually
1100 // accept Pagedescs contents
1101 void UpdatePageDescs(SwDoc &rDoc, size_t nInPageDescOffset)
1102 {
1103  // Update document page descriptors (only this way also left pages
1104  // get adjusted)
1105 
1106  // PageDesc "Standard"
1107  rDoc.ChgPageDesc(0, rDoc.GetPageDesc(0));
1108 
1109  // PageDescs "Convert..."
1110  for (size_t i = nInPageDescOffset; i < rDoc.GetPageDescCnt(); ++i)
1111  rDoc.ChgPageDesc(i, rDoc.GetPageDesc(i));
1112 }
1113 
1114 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::vector< std::pair< OUString, OUString > > m_aAttributes
Definition: fltshell.hxx:277
virtual void SetSubType(sal_uInt16 nType) override
Definition: expfld.cxx:894
Instances of SwFields and those derived from it occur 0 to n times.
Definition: fldbas.hxx:233
virtual sal_Int32 Len() const
Definition: node.cxx:1183
void DeleteMark()
Definition: pam.hxx:177
long m_nHandle
Definition: fltshell.hxx:276
SwNode & GetNode(bool bPoint=true) const
Definition: pam.hxx:223
void SetFrameFormat(SwFrameFormat *_pFrameFormat)
Definition: fltshell.cxx:960
void Add(SwClient *pDepend)
Definition: calbck.cxx:217
sal_uLong Count() const
Definition: ndarr.hxx:143
sal_Int32 mnStartCP
Definition: fltshell.hxx:100
#define RES_FLTR_ANCHOR
Definition: hintids.hxx:322
SwFltControlStack(SwFltControlStack const &)=delete
Marks a position in the document model.
Definition: pam.hxx:35
const SwField * GetField() const
Definition: fmtfld.hxx:71
bool IsTOCBookmark() const
Definition: fltshell.hxx:267
RedlineType_t const eType
Definition: fltshell.hxx:220
std::string GetValue
SwNodeIndex m_nNode
Definition: fltshell.hxx:55
void Delete(const SwPaM &rPam)
Definition: fltshell.cxx:855
const SwExtendedSubType SUB_INVISIBLE
Invisible.
Definition: fldbas.hxx:205
void UpdatePageDescs(SwDoc &rDoc, size_t nInPageDescOffset)
Definition: fltshell.cxx:1101
virtual AppendResult AppendRedline(SwRangeRedline *pNewRedl, bool bCallDelete)=0
Append a new redline.
virtual SwFieldType * GetFieldType(SwFieldIds nResId, const OUString &rName, bool bDbFieldMatching) const =0
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const =0
SwNodeIndex nNode
Definition: pam.hxx:37
virtual bool InsertPoolItem(const SwPaM &rRg, const SfxPoolItem &, const SetAttrMode nFlags=SetAttrMode::DEFAULT, SwRootFrame const *pLayout=nullptr, bool bExpandCharToPara=false)=0
Insert an attribute.
std::shared_ptr< SwTOXBase > m_xTOXBase
Definition: fltshell.hxx:293
sal_uIntPtr sal_uLong
#define RES_FLTR_REDLINE
Definition: hintids.hxx:325
virtual bool operator==(const SfxPoolItem &) const override
Definition: fltshell.cxx:966
long const mnHandle
Definition: fltshell.hxx:249
const SwPosition * GetMark() const
Definition: pam.hxx:209
#define RES_FLTR_BOOKMARK
Definition: hintids.hxx:321
Definition: doc.hxx:185
virtual SwFltStackEntry * SetAttr(const SwPosition &rPos, sal_uInt16 nAttrId, bool bTstEnde=true, long nHand=LONG_MAX, bool consumedByField=false)
Definition: fltshell.cxx:369
static SwContentNode * GetContentNode(SwDoc *pDoc, SwNodeIndex &rIdx, bool bNext)
Definition: fltshell.cxx:80
static SwContentNode * GoPrevious(SwNodeIndex *)
Definition: nodes.cxx:1290
DateTime const aStampPrev
Definition: fltshell.hxx:219
SwNode & GetNode() const
Definition: ndindex.hxx:118
virtual ::sw::mark::IMark * makeMark(const SwPaM &rPaM, const OUString &rProposedName, MarkType eMark,::sw::mark::InsertMode eMode)=0
Generates a new mark in the document for a certain selection.
IDocumentMarkAccess * getIDocumentMarkAccess()
Definition: docbm.cxx:1348
virtual SfxPoolItem * Clone(SfxItemPool *=nullptr) const override
Definition: fltshell.cxx:971
IDocumentContentOperations const & getIDocumentContentOperations() const
Definition: doc.cxx:347
bool bConsumedByField
Definition: fltshell.hxx:97
#define RES_FLTRATTR_BEGIN
Definition: hintids.hxx:320
OUString maName
Definition: fltshell.hxx:250
SwFltAnchorClient(SwFltAnchor *pFltAnchor)
Definition: fltshell.cxx:976
show all inserts
#define RES_FLTR_ANNOTATIONMARK
Definition: hintids.hxx:326
IDocumentFieldsAccess const & getIDocumentFieldsAccess() const
Definition: doc.cxx:389
SfxPoolItem * GetFormatStackAttr(sal_uInt16 nWhich, sal_uInt16 *pPos)
Definition: fltshell.cxx:819
Stores RDF statements on a paragraph (key-value pairs where the subject is the paragraph).
Definition: fltshell.hxx:274
static SW_DLLPUBLIC OUString GetCrossRefHeadingBookmarkNamePrefix()
Definition: docbm.cxx:354
static SW_DLLPUBLIC bool IsLegalPaMForCrossRefHeadingBookmark(const SwPaM &rPaM)
Definition: docbm.cxx:359
SW_DLLPUBLIC ~SwFltStackEntry()
Definition: fltshell.cxx:119
SwIndex nContent
Definition: pam.hxx:38
static bool MakePoint(const SwFltStackEntry &rEntry, SwDoc *pDoc, SwPaM &rRegion)
Definition: fltshell.cxx:467
virtual sw::mark::IMark * makeAnnotationMark(const SwPaM &rPaM, const OUString &rName)=0
bool IsParaEnd()
Definition: fltshell.hxx:117
sal_Int32 mnEndCP
Definition: fltshell.hxx:101
sal_uLong GetIndex() const
Definition: ndindex.hxx:151
void DeleteAndDestroy(Entries::size_type nCnt)
Definition: fltshell.cxx:305
void SetIsParaEnd(bool bArg)
Definition: fltshell.hxx:118
bool CheckNodesRange(const SwNodeIndex &rStt, const SwNodeIndex &rEnd, bool bChkSection)
Definition: pam.cxx:238
const SwFormatField & GetFormatField() const
Definition: txatbase.hxx:185
SwFltTOX(SwTOXBase *pBase)
Definition: fltshell.cxx:1083
RedlineFlags on.
#define RES_FLTR_TOX
Definition: hintids.hxx:324
static constexpr auto NoPrevAuthor
Definition: fltshell.hxx:226
SwFltAnchor(SwFrameFormat *pFlyFormat)
Definition: fltshell.cxx:942
SwFltRedline(RedlineType_t eType_, std::size_t nAutorNo_, const DateTime &rStamp_, RedlineType_t eTypePrev_=nsRedlineType_t::REDLINE_INSERT, std::size_t nAutorNoPrev_=NoPrevAuthor)
Definition: fltshell.hxx:228
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:136
SW_DLLPUBLIC void SetEndPos(const SwPosition &rEndPos)
Definition: fltshell.cxx:124
#define RES_FLTR_NUMRULE
Definition: hintids.hxx:323
const SfxPoolItem * GetOpenStackAttr(const SwPosition &rPos, sal_uInt16 nWhich)
Definition: fltshell.cxx:838
SwNumRule * FindNumRulePtr(const OUString &rName) const
Definition: docnum.cxx:2423
bool empty() const
Definition: fltshell.hxx:178
Style of a layout element.
Definition: frmfmt.hxx:57
virtual bool IsParaEndInCPs(sal_Int32 nStart, sal_Int32 nEnd, bool bSdOD) const
Definition: fltshell.cxx:809
virtual sal_Int32 GetCurrAttrCP() const
Definition: fltshell.hxx:140
void SetAttributes(const std::vector< std::pair< OUString, OUString > > &rAttributes)
Definition: fltshell.cxx:1072
virtual bool CheckSdOD(sal_Int32 nStart, sal_Int32 nEnd)
Definition: fltshell.cxx:814
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SwFormatAnchor & GetAnchor(bool=true) const
Definition: fmtanchr.hxx:81
void MarkAllAttrsOld()
Definition: fltshell.cxx:257
const SwPosition * GetPoint() const
Definition: pam.hxx:207
SwIndex & Assign(SwIndexReg *, sal_Int32)
Definition: index.cxx:198
RndStdIds GetAnchorId() const
Definition: fmtanchr.hxx:65
const SwPageDesc & GetPageDesc(const size_t i) const
Definition: doc.hxx:875
SW_DLLPUBLIC bool MakeRegion(SwDoc *pDoc, SwPaM &rRegion, bool bCheck) const
Definition: fltshell.cxx:190
virtual ~SwFltControlStack()
Definition: fltshell.cxx:201
void StealAttr(const SwNodeIndex &rNode)
Definition: fltshell.cxx:328
virtual void Modify(const SfxPoolItem *pOld, const SfxPoolItem *pNew) override
Definition: fltshell.cxx:981
void Exchange()
Definition: pam.cxx:471
int i
SwFormat *const pChangedFormat
Definition: hints.hxx:67
SwContentNode * GetContentNode()
Definition: node.hxx:615
virtual SfxPoolItem * Clone(SfxItemPool *=nullptr) const override
Definition: fltshell.cxx:1094
FlyAnchors.
Definition: fmtanchr.hxx:34
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
Definition: pam.hxx:205
#define RES_FLTRATTR_END
Definition: hintids.hxx:328
SwFltStackEntry(SwFltStackEntry const &)=delete
size_t GetPageDescCnt() const
Definition: doc.hxx:874
std::unique_ptr< SwFltAnchorClient > pClient
Definition: fltshell.hxx:190
#define RES_FLTR_RDFMARK
Definition: hintids.hxx:327
virtual bool operator==(const SfxPoolItem &) const override
Definition: fltshell.cxx:1030
void ChgPageDesc(const OUString &rName, const SwPageDesc &)
Definition: docdesc.cxx:860
#define RES_TXTATR_TOXMARK
Definition: hintids.hxx:137
Marks a node in the document model.
Definition: ndindex.hxx:31
GUIDCNamePair const aData
void MoveAttrs(const SwPosition &rPos, MoveAttrsMode=MoveAttrsMode::DEFAULT)
Definition: fltshell.cxx:213
virtual bool operator==(const SfxPoolItem &) const override
Definition: fltshell.cxx:1047
sal_Int32 m_nContent
Definition: fltshell.hxx:56
static void addTextNodeStatement(const OUString &rType, const OUString &rPath, SwTextNode &rTextNode, const OUString &rKey, const OUString &rValue)
Add an (rTextNode, key, value) statement in the graph of type rType – or if it does not exist...
Definition: rdfhelper.cxx:207
bool IsFlagSet(Flags no) const
Definition: fltshell.hxx:165
#define RES_FMT_CHG
Definition: hintids.hxx:284
long GetHandle() const
Definition: fltshell.cxx:1067
show all deletes
SwFltPosition m_aMkPos
Definition: fltshell.hxx:90
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
Definition: doc.cxx:437
const SwPosition * Start() const
Definition: pam.hxx:212
const OUString & GetName() const
Definition: docufld.hxx:486
static OUString lcl_getTypePath(OUString &rType)
Definition: fltshell.cxx:93
virtual bool SetFormatAttr(const SfxPoolItem &rAttr)
Definition: format.cxx:460
std::unique_ptr< SfxPoolItem > pAttr
Definition: fltshell.hxx:93
SwFltAnchor * m_pFltAnchor
Definition: fltshell.hxx:207
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:79
static bool IterateNumrulePiece(const SwNodeIndex &rEnd, SwNodeIndex &rTmpStart, SwNodeIndex &rTmpEnd)
Definition: fltshell.cxx:514
virtual ~SwFltAnchor() override
Definition: fltshell.cxx:956
SwFltPosition m_aPtPos
Definition: fltshell.hxx:91
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
Definition: doc.cxx:367
#define RES_TXTATR_FIELD
Definition: hintids.hxx:150
void SetHandle(long nHandle)
Definition: fltshell.cxx:1062
#define SAL_WARN_IF(condition, area, stream)
virtual const SwViewShell * GetCurrentViewShell() const =0
Returns the layout set at the document.
const SwNodes & GetNodes() const
Definition: ndindex.hxx:155
virtual SwFieldType * InsertFieldType(const SwFieldType &)=0
std::size_t const nAutorNo
Definition: fltshell.hxx:222
#define RES_TXTATR_ANNOTATION
Definition: hintids.hxx:153
bool m_isAnnotationOnEnd
annotation already moved onto its end pos.
Definition: fltshell.hxx:98
virtual void SetRedlineFlags(RedlineFlags eMode)=0
Set a new redline mode.
sal_Int32 GetIndex() const
Definition: index.hxx:95
virtual void MakeFrames()
Creates the views.
Definition: atrfrm.cxx:2628
SwNodes & GetNodes()
Definition: doc.hxx:403
const SwPosition * End() const
Definition: pam.hxx:217
sal_Int32 GetStartCP() const
Definition: fltshell.hxx:115
RedlineType_t const eTypePrev
Definition: fltshell.hxx:221
virtual SfxPoolItem * Clone(SfxItemPool *=nullptr) const override
Definition: fltshell.cxx:1003
virtual bool operator==(const SfxPoolItem &) const override
Definition: fltshell.cxx:1089
bool HadPageDescItem() const
Definition: fltshell.hxx:305
const SwStartNode * FindTableBoxStartNode() const
Definition: node.hxx:196
bool HadBreakItem() const
Definition: fltshell.hxx:304
const OUString & GetValSys() const
Definition: fltshell.hxx:266
sal_Int32 GetEndCP() const
Definition: fltshell.hxx:116
#define SAL_WARN(area, stream)
void SetStartCP(sal_Int32 nCP)
Definition: fltshell.hxx:113
const SwGetSetExpType GSE_STRING
String.
Definition: fldbas.hxx:195
virtual void SetMark()
Unless this is called, the getter method of Mark will return Point.
Definition: pam.cxx:457
DateTime const aStamp
Definition: fltshell.hxx:218
bool DelNumRule(const OUString &rName, bool bBroadCast=false)
Definition: docnum.cxx:1053
const std::vector< std::pair< OUString, OUString > > & GetAttributes() const
Definition: fltshell.cxx:1077
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
#define RES_PAGEDESC
Definition: hintids.hxx:198
#define RES_BREAK
Definition: hintids.hxx:199
void SetEndCP(sal_Int32 nCP)
Definition: fltshell.hxx:114
virtual void ClearParaEndPosition()
Definition: fltshell.hxx:144
bool IsTextNode() const
Definition: node.hxx:636
void SetPos(SwNodeIndex const &rNode, sal_uInt16 nIdx)
Definition: fltshell.hxx:63
#define RES_TXTATR_INPUTFIELD
Definition: hintids.hxx:145
virtual bool operator==(const SfxPoolItem &rItem) const override
Definition: fltshell.cxx:998
SwContentNode * GoNext(SwNodeIndex *) const
Definition: nodes.cxx:1273
SwFrameFormat * pFrameFormat
Definition: fltshell.hxx:189
static bool MakeBookRegionOrPoint(const SwFltStackEntry &rEntry, SwDoc *pDoc, SwPaM &rRegion)
Definition: fltshell.cxx:489
virtual SfxPoolItem * Clone(SfxItemPool *=nullptr) const override
Definition: fltshell.cxx:1036
sal_uInt16 Which() const
no RedlineFlags
virtual SfxPoolItem * Clone(SfxItemPool *=nullptr) const override
Definition: fltshell.cxx:1057
const SwAttrPool & GetAttrPool() const
Definition: doc.hxx:1307
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
Definition: ndtxt.hxx:842
virtual void SetAttrInDoc(const SwPosition &rTmpPos, SwFltStackEntry &rEntry)
Definition: fltshell.cxx:553
void SetAnchor(const SwPosition *pPos)
Definition: atrfrm.cxx:1486
std::size_t const nAutorNoPrev
Definition: fltshell.hxx:223
bool isPARATR_LIST(const sal_uInt16 nWhich)
Definition: hintids.hxx:364
SwFltBookmark(const OUString &rNa, const OUString &rVa, long nHand, const bool bIsTOCBookmark=false)
Definition: fltshell.cxx:1009
void NewAttr(const SwPosition &rPos, const SfxPoolItem &rAttr)
Definition: fltshell.cxx:279
void KillUnlockedAttrs(const SwPosition &pPos)
Definition: fltshell.cxx:347