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