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 
666  if (!aRegion.HasMark())
667  {
668  // Annotation range was found in the file, but start/end is the same,
669  // pointing after the postit placeholder (see assert above).
670  // Adjust the start of the range to actually cover the comment, similar
671  // to what the UI and the UNO API does.
672  aRegion.SetMark();
673  --aRegion.Start()->nContent;
674  }
675 
676  pDoc->getIDocumentMarkAccess()->makeAnnotationMark(aRegion, OUString());
677  }
678  else
679  {
680  SAL_WARN("sw", "RES_FLTR_ANNOTATIONMARK: unexpected field");
681  }
682  }
683  else
684  {
685  SAL_WARN("sw", "RES_FLTR_ANNOTATIONMARK: missing field");
686  }
687  }
688  else
689  SAL_WARN("sw", "failed to make book region or point");
690  }
691  break;
692  case RES_FLTR_RDFMARK:
693  {
694  if (MakeBookRegionOrPoint(rEntry, pDoc, aRegion))
695  {
696  SwFltRDFMark* pMark = static_cast<SwFltRDFMark*>(rEntry.pAttr.get());
697  if (aRegion.GetNode().IsTextNode())
698  {
699  SwTextNode& rTextNode = *aRegion.GetNode().GetTextNode();
700 
701  for (const std::pair<OUString, OUString>& rAttribute : pMark->GetAttributes())
702  {
703  OUString aTypeNS = rAttribute.first;
704  OUString aMetadataFilePath = lcl_getTypePath(aTypeNS);
705  if (aMetadataFilePath.isEmpty())
706  continue;
707 
708  SwRDFHelper::addTextNodeStatement(aTypeNS, aMetadataFilePath, rTextNode, rAttribute.first, rAttribute.second);
709  }
710  }
711  }
712  else
713  SAL_WARN("sw", "failed to make book region or point");
714  }
715  break;
716  case RES_FLTR_TOX:
717  {
718  MakePoint(rEntry, pDoc, aRegion);
719 
720  SwPosition* pPoint = aRegion.GetPoint();
721 
722  SwFltTOX* pTOXAttr = static_cast<SwFltTOX*>(rEntry.pAttr.get());
723 
724  // test if on this node there had been a pagebreak BEFORE the
725  // tox attribute was put on the stack
727  SwContentNode* pNd = nullptr;
728  if( !pTOXAttr->HadBreakItem() || !pTOXAttr->HadPageDescItem() )
729  {
730  pNd = pPoint->nNode.GetNode().GetContentNode();
731  if( pNd )
732  {
733  const SfxItemSet* pSet = pNd->GetpSwAttrSet();
734  const SfxPoolItem* pItem;
735  if( pSet )
736  {
737  if( !pTOXAttr->HadBreakItem()
738  && SfxItemState::SET == pSet->GetItemState( RES_BREAK, false, &pItem ) )
739  {
740  aBkSet.Put( *pItem );
741  pNd->ResetAttr( RES_BREAK );
742  }
743  if( !pTOXAttr->HadPageDescItem()
744  && SfxItemState::SET == pSet->GetItemState( RES_PAGEDESC, false, &pItem ) )
745  {
746  aBkSet.Put( *pItem );
747  pNd->ResetAttr( RES_PAGEDESC );
748  }
749  }
750  }
751  }
752 
753  // set (above saved and removed) the break item at the node following the TOX
754  if (pNd && aBkSet.Count())
755  pNd->SetAttr(aBkSet);
756  }
757  break;
758  case RES_FLTR_REDLINE:
759  {
760  if (rEntry.MakeRegion(pDoc, aRegion, true))
761  {
765  SwFltRedline& rFltRedline = *static_cast<SwFltRedline*>(rEntry.pAttr.get());
766 
767  SwRedlineData aData(rFltRedline.eType,
768  rFltRedline.nAutorNo,
769  rFltRedline.aStamp,
770  OUString(),
771  nullptr
772  );
773  pDoc->getIDocumentRedlineAccess().AppendRedline( new SwRangeRedline(aData, aRegion), true );
777  }
778  }
779  break;
780  default:
781  {
782  // Revised for more complex situations should be considered
783  if ( !bSdODChecked )
784  {
785  bHasSdOD = HasSdOD();
786  bSdODChecked = true;
787  }
788  sal_Int32 nStart = rEntry.GetStartCP();
789  sal_Int32 nEnd = rEntry.GetEndCP();
790  if (nStart != -1 && nEnd != -1 && nEnd >= nStart )
791  {
792  rEntry.SetIsParaEnd( IsParaEndInCPs(nStart,nEnd,bHasSdOD) );
793  }
794  if (rEntry.MakeRegion(pDoc, aRegion, false))
795  {
796  if (rEntry.IsParaEnd())
797  {
798  pDoc->getIDocumentContentOperations().InsertPoolItem(aRegion, *rEntry.pAttr, SetAttrMode::DEFAULT, nullptr, true);
799  }
800  else
801  {
803  }
804  }
805  }
806  break;
807  }
808 }
809 
810 bool SwFltControlStack::IsParaEndInCPs(sal_Int32 /*nStart*/, sal_Int32 /*nEnd*/,bool /*bSdOD*/) const
811 {
812  return false;
813 }
814 
815 bool SwFltControlStack::CheckSdOD(sal_Int32 /*nStart*/, sal_Int32 /*nEnd*/)
816 {
817  return false;
818 }
819 
820 SfxPoolItem* SwFltControlStack::GetFormatStackAttr(sal_uInt16 nWhich, sal_uInt16 * pPos)
821 {
822  size_t nSize = m_Entries.size();
823 
824  while (nSize)
825  {
826  // is it the looked-for attribute ? (only applies to locked, meaning
827  // currently set attributes!!)
828  SwFltStackEntry &rEntry = *m_Entries[--nSize];
829  if (rEntry.bOpen && rEntry.pAttr->Which() == nWhich)
830  {
831  if (pPos)
832  *pPos = nSize;
833  return rEntry.pAttr.get(); // Ok, so stop
834  }
835  }
836  return nullptr;
837 }
838 
839 const SfxPoolItem* SwFltControlStack::GetOpenStackAttr(const SwPosition& rPos, sal_uInt16 nWhich)
840 {
841  SwFltPosition aFltPos(rPos);
842 
843  size_t nSize = m_Entries.size();
844 
845  while (nSize)
846  {
847  SwFltStackEntry &rEntry = *m_Entries[--nSize];
848  if (rEntry.bOpen && rEntry.pAttr->Which() == nWhich && rEntry.m_aMkPos == aFltPos)
849  {
850  return rEntry.pAttr.get();
851  }
852  }
853  return nullptr;
854 }
855 
857 {
858  const SwPosition *pStt = rPam.Start(), *pEnd = rPam.End();
859 
860  if( !rPam.HasMark() || *pStt >= *pEnd )
861  return;
862 
863  SwNodeIndex aStartNode(pStt->nNode, -1);
864  const sal_Int32 nStartIdx = pStt->nContent.GetIndex();
865  SwNodeIndex aEndNode(pEnd->nNode, -1);
866  const sal_Int32 nEndIdx = pEnd->nContent.GetIndex();
867 
868  // We don't support deleting content that is over one node, or removing a node.
869  OSL_ENSURE(aEndNode == aStartNode, "nodes must be the same, or this method extended");
870  if (aEndNode != aStartNode)
871  return;
872 
873  for (size_t nSize = m_Entries.size(); nSize > 0;)
874  {
875  SwFltStackEntry& rEntry = *m_Entries[--nSize];
876 
877  bool bEntryStartAfterSelStart =
878  (rEntry.m_aMkPos.m_nNode == aStartNode &&
879  rEntry.m_aMkPos.m_nContent >= nStartIdx);
880 
881  bool bEntryStartBeforeSelEnd =
882  (rEntry.m_aMkPos.m_nNode == aEndNode &&
883  rEntry.m_aMkPos.m_nContent <= nEndIdx);
884 
885  bool bEntryEndAfterSelStart = false;
886  bool bEntryEndBeforeSelEnd = false;
887  if (!rEntry.bOpen)
888  {
889  bEntryEndAfterSelStart =
890  (rEntry.m_aPtPos.m_nNode == aStartNode &&
891  rEntry.m_aPtPos.m_nContent >= nStartIdx);
892 
893  bEntryEndBeforeSelEnd =
894  (rEntry.m_aPtPos.m_nNode == aEndNode &&
895  rEntry.m_aPtPos.m_nContent <= nEndIdx);
896  }
897 
898  bool bTotallyContained = false;
899  if (
900  bEntryStartAfterSelStart && bEntryStartBeforeSelEnd &&
901  bEntryEndAfterSelStart && bEntryEndBeforeSelEnd
902  )
903  {
904  bTotallyContained = true;
905  }
906 
907  if (bTotallyContained)
908  {
909  // after start, before end, delete
910  DeleteAndDestroy(nSize);
911  continue;
912  }
913 
914  const sal_Int32 nContentDiff = nEndIdx - nStartIdx;
915 
916  // to be adjusted
917  if (bEntryStartAfterSelStart)
918  {
919  if (bEntryStartBeforeSelEnd)
920  {
921  // move start to new start
922  rEntry.m_aMkPos.SetPos(aStartNode, nStartIdx);
923  }
924  else
925  rEntry.m_aMkPos.m_nContent -= nContentDiff;
926  }
927 
928  if (bEntryEndAfterSelStart)
929  {
930  if (bEntryEndBeforeSelEnd)
931  rEntry.m_aPtPos.SetPos(aStartNode, nStartIdx);
932  else
933  rEntry.m_aPtPos.m_nContent -= nContentDiff;
934  }
935 
936  //That's what Open is, end equal to start, and nPtContent is invalid
937  if (rEntry.bOpen)
938  rEntry.m_aPtPos = rEntry.m_aMkPos;
939  }
940 }
941 
942 // methods of SwFltAnchor follow
944  SfxPoolItem(RES_FLTR_ANCHOR), pFrameFormat(pFormat)
945 {
946  pClient.reset( new SwFltAnchorClient(this) );
947  pFrameFormat->Add(pClient.get());
948 }
949 
951  SfxPoolItem(RES_FLTR_ANCHOR), pFrameFormat(rCpy.pFrameFormat)
952 {
953  pClient.reset( new SwFltAnchorClient(this) );
954  pFrameFormat->Add(pClient.get());
955 }
956 
958 {
959 }
960 
962 {
963  pFrameFormat = _pFrameFormat;
964 }
965 
966 
967 bool SwFltAnchor::operator==(const SfxPoolItem& rItem) const
968 {
969  return pFrameFormat == static_cast<const SwFltAnchor&>(rItem).pFrameFormat;
970 }
971 
973 {
974  return new SwFltAnchor(*this);
975 }
976 
978 : m_pFltAnchor(pFltAnchor)
979 {
980 }
981 
983 {
984  if (pNew->Which() == RES_FMT_CHG)
985  {
986  const SwFormatChg * pFormatChg = dynamic_cast<const SwFormatChg *> (pNew);
987 
988  if (pFormatChg != nullptr)
989  {
990  SwFrameFormat * pFrameFormat = dynamic_cast<SwFrameFormat *> (pFormatChg->pChangedFormat);
991 
992  if (pFrameFormat != nullptr)
993  m_pFltAnchor->SetFrameFormat(pFrameFormat);
994  }
995  }
996 }
997 
998 // methods of SwFltRedline follow
999 bool SwFltRedline::operator==(const SfxPoolItem& rItem) const
1000 {
1001  return this == &rItem;
1002 }
1003 
1005 {
1006  return new SwFltRedline(*this);
1007 }
1008 
1009 // methods of SwFltBookmark follow
1010 SwFltBookmark::SwFltBookmark( const OUString& rNa, const OUString& rVa,
1011  long nHand, const bool bIsTOCBookmark )
1013  , mnHandle( nHand )
1014  , maName( rNa )
1015  , maVal( rVa )
1016  , mbIsTOCBookmark( bIsTOCBookmark )
1017 {
1018  // eSrc: CHARSET_DONTKNOW for no transform at operator <<
1019  // Upcase is always done.
1020  // Transform is never done at XXXStack.NewAttr(...).
1021  // otherwise: Src Charset from argument for aName
1022  // Src Charset from filter for aVal ( Text )
1023 
1025  {
1027  maName += rNa;
1028  }
1029 }
1030 
1031 bool SwFltBookmark::operator==(const SfxPoolItem& rItem) const
1032 {
1033  return ( maName == static_cast<const SwFltBookmark&>(rItem).maName)
1034  && (mnHandle == static_cast<const SwFltBookmark&>(rItem).mnHandle);
1035 }
1036 
1038 {
1039  return new SwFltBookmark(*this);
1040 }
1041 
1044  m_nHandle(0)
1045 {
1046 }
1047 
1048 bool SwFltRDFMark::operator==(const SfxPoolItem& rItem) const
1049 {
1050  if (!SfxPoolItem::operator==(rItem))
1051  return false;
1052 
1053  const SwFltRDFMark& rMark = static_cast<const SwFltRDFMark&>(rItem);
1054 
1055  return m_nHandle == rMark.m_nHandle && m_aAttributes == rMark.m_aAttributes;
1056 }
1057 
1059 {
1060  return new SwFltRDFMark(*this);
1061 }
1062 
1063 void SwFltRDFMark::SetHandle(long nHandle)
1064 {
1065  m_nHandle = nHandle;
1066 }
1067 
1069 {
1070  return m_nHandle;
1071 }
1072 
1073 void SwFltRDFMark::SetAttributes(const std::vector< std::pair<OUString, OUString> >& rAttributes)
1074 {
1075  m_aAttributes = rAttributes;
1076 }
1077 
1078 const std::vector< std::pair<OUString, OUString> >& SwFltRDFMark::GetAttributes() const
1079 {
1080  return m_aAttributes;
1081 }
1082 
1083 // methods of SwFltTOX follow
1085  : SfxPoolItem(RES_FLTR_TOX), m_xTOXBase(pBase),
1086  bHadBreakItem( false ), bHadPageDescItem( false )
1087 {
1088 }
1089 
1090 bool SwFltTOX::operator==(const SfxPoolItem& rItem) const
1091 {
1092  return m_xTOXBase.get() == static_cast<const SwFltTOX&>(rItem).m_xTOXBase.get();
1093 }
1094 
1096 {
1097  return new SwFltTOX(*this);
1098 }
1099 
1100 // UpdatePageDescs needs to be called at end of parsing to make Writer actually
1101 // accept Pagedescs contents
1102 void UpdatePageDescs(SwDoc &rDoc, size_t nInPageDescOffset)
1103 {
1104  // Update document page descriptors (only this way also left pages
1105  // get adjusted)
1106 
1107  // PageDesc "Standard"
1108  rDoc.ChgPageDesc(0, rDoc.GetPageDesc(0));
1109 
1110  // PageDescs "Convert..."
1111  for (size_t i = nInPageDescOffset; i < rDoc.GetPageDescCnt(); ++i)
1112  rDoc.ChgPageDesc(i, rDoc.GetPageDesc(i));
1113 }
1114 
1115 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::vector< std::pair< OUString, OUString > > m_aAttributes
Definition: fltshell.hxx:263
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:1181
void DeleteMark()
Definition: pam.hxx:177
long m_nHandle
Definition: fltshell.hxx:262
SwNode & GetNode(bool bPoint=true) const
Definition: pam.hxx:223
void SetFrameFormat(SwFrameFormat *_pFrameFormat)
Definition: fltshell.cxx:961
void Add(SwClient *pDepend)
Definition: calbck.cxx:217
sal_uLong Count() const
Definition: ndarr.hxx:143
sal_Int32 mnStartCP
Definition: fltshell.hxx:95
#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:253
std::string GetValue
SwNodeIndex m_nNode
Definition: fltshell.hxx:50
void Delete(const SwPaM &rPam)
Definition: fltshell.cxx:856
const SwExtendedSubType SUB_INVISIBLE
Invisible.
Definition: fldbas.hxx:205
void UpdatePageDescs(SwDoc &rDoc, size_t nInPageDescOffset)
Definition: fltshell.cxx:1102
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
OUString const maName
SwNodeIndex nNode
Definition: pam.hxx:37
std::shared_ptr< SwTOXBase > m_xTOXBase
Definition: fltshell.hxx:279
sal_uIntPtr sal_uLong
#define RES_FLTR_REDLINE
Definition: hintids.hxx:325
virtual bool operator==(const SfxPoolItem &) const override
Definition: fltshell.cxx:967
long const mnHandle
Definition: fltshell.hxx:235
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
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:1552
virtual SfxPoolItem * Clone(SfxItemPool *=nullptr) const override
Definition: fltshell.cxx:972
IDocumentContentOperations const & getIDocumentContentOperations() const
Definition: doc.cxx:347
bool bConsumedByField
Definition: fltshell.hxx:92
#define RES_FLTRATTR_BEGIN
Definition: hintids.hxx:320
OUString maName
Definition: fltshell.hxx:236
SwFltAnchorClient(SwFltAnchor *pFltAnchor)
Definition: fltshell.cxx:977
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:820
Stores RDF statements on a paragraph (key-value pairs where the subject is the paragraph).
Definition: fltshell.hxx:260
static SW_DLLPUBLIC OUString GetCrossRefHeadingBookmarkNamePrefix()
Definition: docbm.cxx:517
static SW_DLLPUBLIC bool IsLegalPaMForCrossRefHeadingBookmark(const SwPaM &rPaM)
Definition: docbm.cxx:522
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:112
sal_Int32 mnEndCP
Definition: fltshell.hxx:96
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:113
bool CheckNodesRange(const SwNodeIndex &rStt, const SwNodeIndex &rEnd, bool bChkSection)
Definition: pam.cxx:236
const SwFormatField & GetFormatField() const
Definition: txatbase.hxx:191
SwFltTOX(SwTOXBase *pBase)
Definition: fltshell.cxx:1084
RedlineFlags on.
#define RES_FLTR_TOX
Definition: hintids.hxx:324
SwFltAnchor(SwFrameFormat *pFlyFormat)
Definition: fltshell.cxx:943
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:839
SwNumRule * FindNumRulePtr(const OUString &rName) const
Definition: docnum.cxx:2423
bool empty() const
Definition: fltshell.hxx:173
Style of a layout element.
Definition: frmfmt.hxx:57
virtual bool IsParaEndInCPs(sal_Int32 nStart, sal_Int32 nEnd, bool bSdOD) const
Definition: fltshell.cxx:810
virtual sal_Int32 GetCurrAttrCP() const
Definition: fltshell.hxx:135
void SetAttributes(const std::vector< std::pair< OUString, OUString > > &rAttributes)
Definition: fltshell.cxx:1073
virtual bool CheckSdOD(sal_Int32 nStart, sal_Int32 nEnd)
Definition: fltshell.cxx:815
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:876
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:982
void Exchange()
Definition: pam.cxx:469
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:1095
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:875
std::unique_ptr< SwFltAnchorClient > pClient
Definition: fltshell.hxx:185
#define RES_FLTR_RDFMARK
Definition: hintids.hxx:327
virtual bool operator==(const SfxPoolItem &) const override
Definition: fltshell.cxx:1031
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:1048
sal_Int32 m_nContent
Definition: fltshell.hxx:51
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:160
#define RES_FMT_CHG
Definition: hintids.hxx:284
long GetHandle() const
Definition: fltshell.cxx:1068
show all deletes
SwFltPosition m_aMkPos
Definition: fltshell.hxx:85
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
Definition: doc.cxx:437
const SwPosition * Start() const
Definition: pam.hxx:212
const OUString & GetName() const
Definition: docufld.hxx:488
static OUString lcl_getTypePath(OUString &rType)
Definition: fltshell.cxx:93
virtual bool SetFormatAttr(const SfxPoolItem &rAttr)
Definition: format.cxx:458
std::unique_ptr< SfxPoolItem > pAttr
Definition: fltshell.hxx:88
SwFltAnchor * m_pFltAnchor
Definition: fltshell.hxx:202
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:957
SwFltPosition m_aPtPos
Definition: fltshell.hxx:86
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
Definition: doc.cxx:367
#define RES_TXTATR_FIELD
Definition: hintids.hxx:150
void SetHandle(long nHandle)
Definition: fltshell.cxx:1063
#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:215
virtual bool InsertPoolItem(const SwPaM &rRg, const SfxPoolItem &, const SetAttrMode nFlags=SetAttrMode::DEFAULT, SwRootFrame const *pLayout=nullptr, bool bExpandCharToPara=false, SwTextAttr **ppNewTextAttr=nullptr)=0
Insert an attribute.
#define RES_TXTATR_ANNOTATION
Definition: hintids.hxx:153
RedlineType const eType
Definition: fltshell.hxx:214
bool m_isAnnotationOnEnd
annotation already moved onto its end pos.
Definition: fltshell.hxx:93
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:402
const SwPosition * End() const
Definition: pam.hxx:217
sal_Int32 GetStartCP() const
Definition: fltshell.hxx:110
virtual SfxPoolItem * Clone(SfxItemPool *=nullptr) const override
Definition: fltshell.cxx:1004
virtual bool operator==(const SfxPoolItem &) const override
Definition: fltshell.cxx:1090
bool HadPageDescItem() const
Definition: fltshell.hxx:291
const SwStartNode * FindTableBoxStartNode() const
Definition: node.hxx:196
bool HadBreakItem() const
Definition: fltshell.hxx:290
const OUString & GetValSys() const
Definition: fltshell.hxx:252
sal_Int32 GetEndCP() const
Definition: fltshell.hxx:111
#define SAL_WARN(area, stream)
void SetStartCP(sal_Int32 nCP)
Definition: fltshell.hxx:108
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:455
DateTime const aStamp
Definition: fltshell.hxx:213
bool DelNumRule(const OUString &rName, bool bBroadCast=false)
Definition: docnum.cxx:1053
const std::vector< std::pair< OUString, OUString > > & GetAttributes() const
Definition: fltshell.cxx:1078
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:109
SwFltRedline(RedlineType eType_, std::size_t nAutorNo_, const DateTime &rStamp_)
Definition: fltshell.hxx:217
virtual void ClearParaEndPosition()
Definition: fltshell.hxx:139
bool IsTextNode() const
Definition: node.hxx:636
void SetPos(SwNodeIndex const &rNode, sal_uInt16 nIdx)
Definition: fltshell.hxx:58
#define RES_TXTATR_INPUTFIELD
Definition: hintids.hxx:145
virtual bool operator==(const SfxPoolItem &rItem) const override
Definition: fltshell.cxx:999
SwContentNode * GoNext(SwNodeIndex *) const
Definition: nodes.cxx:1273
SwFrameFormat * pFrameFormat
Definition: fltshell.hxx:184
static bool MakeBookRegionOrPoint(const SwFltStackEntry &rEntry, SwDoc *pDoc, SwPaM &rRegion)
Definition: fltshell.cxx:489
virtual SfxPoolItem * Clone(SfxItemPool *=nullptr) const override
Definition: fltshell.cxx:1037
sal_uInt16 Which() const
no RedlineFlags
virtual SfxPoolItem * Clone(SfxItemPool *=nullptr) const override
Definition: fltshell.cxx:1058
const SwAttrPool & GetAttrPool() const
Definition: doc.hxx:1308
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
Definition: ndtxt.hxx:843
virtual void SetAttrInDoc(const SwPosition &rTmpPos, SwFltStackEntry &rEntry)
Definition: fltshell.cxx:553
void SetAnchor(const SwPosition *pPos)
Definition: atrfrm.cxx:1486
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:1010
void NewAttr(const SwPosition &rPos, const SfxPoolItem &rAttr)
Definition: fltshell.cxx:279
void KillUnlockedAttrs(const SwPosition &pPos)
Definition: fltshell.cxx:347