LibreOffice Module sw (master)  1
docedt.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 <fmtanchr.hxx>
21 #include <fmtcntnt.hxx>
22 #include <txtftn.hxx>
23 #include <acorrect.hxx>
24 #include <UndoManager.hxx>
26 #include <IDocumentState.hxx>
28 #include <docsh.hxx>
29 #include <docary.hxx>
30 #include <doctxm.hxx>
31 #include <ftnidx.hxx>
32 #include <mdiexp.hxx>
33 #include <mvsave.hxx>
34 #include <redline.hxx>
35 #include <rootfrm.hxx>
36 #include <splargs.hxx>
37 #include <txtfrm.hxx>
38 #include <breakit.hxx>
39 #include <vcl/layout.hxx>
40 #include <editsh.hxx>
41 #include <fmtfld.hxx>
42 #include <docufld.hxx>
43 #include <unoflatpara.hxx>
44 #include <SwGrammarMarkUp.hxx>
45 #include <docedt.hxx>
46 #include <frmfmt.hxx>
47 #include <ndtxt.hxx>
48 
49 #include <vector>
50 #include <com/sun/star/linguistic2/XProofreadingIterator.hpp>
51 
52 using namespace ::com::sun::star;
53 using namespace ::com::sun::star::linguistic2;
54 using namespace ::com::sun::star::i18n;
55 
56 
57 void RestFlyInRange( SaveFlyArr & rArr, const SwNodeIndex& rSttIdx,
58  const SwNodeIndex* pInsertPos )
59 {
60  SwPosition aPos( rSttIdx );
61  for(SaveFly & rSave : rArr)
62  {
63  // create new anchor
64  SwFrameFormat* pFormat = rSave.pFrameFormat;
65 
66  if( rSave.bInsertPosition )
67  {
68  if( pInsertPos != nullptr )
69  aPos.nNode = *pInsertPos;
70  else
71  aPos.nNode = rSttIdx.GetIndex();
72  }
73  else
74  aPos.nNode = rSttIdx.GetIndex() + rSave.nNdDiff;
75 
76  aPos.nContent.Assign(dynamic_cast<SwIndexReg*>(&aPos.nNode.GetNode()), 0);
77  SwFormatAnchor aAnchor( pFormat->GetAnchor() );
78  aAnchor.SetAnchor( &aPos );
79  pFormat->GetDoc()->GetSpzFrameFormats()->push_back( pFormat );
80  // SetFormatAttr should call Modify() and add it to the node
81  pFormat->SetFormatAttr( aAnchor );
82  SwContentNode* pCNd = aPos.nNode.GetNode().GetContentNode();
83  if (pCNd && pCNd->getLayoutFrame(pFormat->GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout(), nullptr, nullptr))
84  pFormat->MakeFrames();
85  }
87 }
88 
89 void SaveFlyInRange( const SwNodeRange& rRg, SaveFlyArr& rArr )
90 {
91  SwFrameFormats& rFormats = *rRg.aStart.GetNode().GetDoc()->GetSpzFrameFormats();
92  for( SwFrameFormats::size_type n = 0; n < rFormats.size(); ++n )
93  {
94  SwFrameFormat *const pFormat = rFormats[n];
95  SwFormatAnchor const*const pAnchor = &pFormat->GetAnchor();
96  SwPosition const*const pAPos = pAnchor->GetContentAnchor();
97  if (pAPos &&
98  ((RndStdIds::FLY_AT_PARA == pAnchor->GetAnchorId()) ||
99  (RndStdIds::FLY_AT_CHAR == pAnchor->GetAnchorId())) &&
100  rRg.aStart <= pAPos->nNode && pAPos->nNode < rRg.aEnd )
101  {
102  SaveFly aSave( pAPos->nNode.GetIndex() - rRg.aStart.GetIndex(),
103  pFormat, false );
104  rArr.push_back( aSave );
105  pFormat->DelFrames();
106  // set a dummy anchor position to maintain anchoring invariants
107  SwFormatAnchor aAnchor( pFormat->GetAnchor() );
108  aAnchor.SetAnchor(nullptr);
109  pFormat->SetFormatAttr(aAnchor);
110  rFormats.erase( rFormats.begin() + n-- );
111  }
112  }
114 }
115 
116 void SaveFlyInRange( const SwPaM& rPam, const SwNodeIndex& rInsPos,
117  SaveFlyArr& rArr, bool bMoveAllFlys )
118 {
119  SwFrameFormats& rFormats = *rPam.GetPoint()->nNode.GetNode().GetDoc()->GetSpzFrameFormats();
120  SwFrameFormat* pFormat;
121  const SwFormatAnchor* pAnchor;
122 
123  const SwPosition* pPos = rPam.Start();
124  const SwNodeIndex& rSttNdIdx = pPos->nNode;
125  short nSttOff = (!bMoveAllFlys && rSttNdIdx.GetNode().IsContentNode() &&
126  pPos->nContent.GetIndex()) ? 1 : 0;
127 
128  pPos = rPam.GetPoint() == pPos ? rPam.GetMark() : rPam.GetPoint();
129  const SwNodeIndex& rEndNdIdx = pPos->nNode;
130  short nOff = ( bMoveAllFlys || ( rEndNdIdx.GetNode().IsContentNode() &&
131  pPos->nContent == rEndNdIdx.GetNode().GetContentNode()->Len() ))
132  ? 0 : 1;
133 
134  for( SwFrameFormats::size_type n = 0; n < rFormats.size(); ++n )
135  {
136  pFormat = rFormats[n];
137  pAnchor = &pFormat->GetAnchor();
138  const SwPosition* pAPos = pAnchor->GetContentAnchor();
139  const SwNodeIndex* pContentIdx;
140  if (pAPos &&
141  ((RndStdIds::FLY_AT_PARA == pAnchor->GetAnchorId()) ||
142  (RndStdIds::FLY_AT_CHAR == pAnchor->GetAnchorId())) &&
143  // do not move if the InsPos is in the ContentArea of the Fly
144  ( nullptr == ( pContentIdx = pFormat->GetContent().GetContentIdx() ) ||
145  !( *pContentIdx < rInsPos &&
146  rInsPos < pContentIdx->GetNode().EndOfSectionIndex() )) )
147  {
148  bool bInsPos = false;
149 
150  if( !bMoveAllFlys && rEndNdIdx == pAPos->nNode )
151  {
152  // Do not touch Anchor, if only a part of the EndNode
153  // or the whole EndNode is identical with the SttNode
154  if( rSttNdIdx != pAPos->nNode )
155  {
156  // Only attach an anchor to the beginning or end
157  SwPosition aPos( rSttNdIdx );
158  SwFormatAnchor aAnchor( *pAnchor );
159  aAnchor.SetAnchor( &aPos );
160  pFormat->SetFormatAttr( aAnchor );
161  }
162  }
163  else if( ( rSttNdIdx.GetIndex() + nSttOff <= pAPos->nNode.GetIndex()
164  && pAPos->nNode.GetIndex() <= rEndNdIdx.GetIndex() - nOff ) ||
165  ( bInsPos = (rInsPos == pAPos->nNode) ))
166 
167  {
168  SaveFly aSave( pAPos->nNode.GetIndex() - rSttNdIdx.GetIndex(),
169  pFormat, bInsPos );
170  rArr.push_back( aSave );
171  pFormat->DelFrames();
172  // set a dummy anchor position to maintain anchoring invariants
173  SwFormatAnchor aAnchor( pFormat->GetAnchor() );
174  aAnchor.SetAnchor(nullptr);
175  pFormat->SetFormatAttr(aAnchor);
176  rFormats.erase( rFormats.begin() + n-- );
177  }
178  }
179  }
181 }
182 
185 void DelFlyInRange( const SwNodeIndex& rMkNdIdx,
186  const SwNodeIndex& rPtNdIdx )
187 {
188  const bool bDelFwrd = rMkNdIdx.GetIndex() <= rPtNdIdx.GetIndex();
189 
190  SwDoc* pDoc = rMkNdIdx.GetNode().GetDoc();
191  SwFrameFormats& rTable = *pDoc->GetSpzFrameFormats();
192  for ( auto i = rTable.size(); i; )
193  {
194  SwFrameFormat *pFormat = rTable[--i];
195  const SwFormatAnchor &rAnch = pFormat->GetAnchor();
196  SwPosition const*const pAPos = rAnch.GetContentAnchor();
197  if (pAPos &&
198  ((rAnch.GetAnchorId() == RndStdIds::FLY_AT_PARA) ||
199  (rAnch.GetAnchorId() == RndStdIds::FLY_AT_CHAR)) &&
200  ( bDelFwrd
201  ? rMkNdIdx < pAPos->nNode && pAPos->nNode <= rPtNdIdx
202  : rPtNdIdx <= pAPos->nNode && pAPos->nNode < rMkNdIdx ))
203  {
204  // Only move the Anchor??
205  if( rPtNdIdx == pAPos->nNode )
206  {
207  SwFormatAnchor aAnch( pFormat->GetAnchor() );
208  SwPosition aPos( rMkNdIdx );
209  aAnch.SetAnchor( &aPos );
210  pFormat->SetFormatAttr( aAnch );
211  }
212  else
213  {
214  // If the Fly is deleted, all Flys in its content have to be deleted too.
215  const SwFormatContent &rContent = pFormat->GetContent();
216  // But only fly formats own their content, not draw formats.
217  if (rContent.GetContentIdx() && pFormat->Which() == RES_FLYFRMFMT)
218  {
219  DelFlyInRange( *rContent.GetContentIdx(),
220  SwNodeIndex( *rContent.GetContentIdx()->
221  GetNode().EndOfSectionNode() ));
222  // Position could have been moved!
223  if( i > rTable.size() )
224  i = rTable.size();
225  else if( pFormat != rTable[i] )
226  i = std::distance(rTable.begin(), rTable.find( pFormat ));
227  }
228 
229  pDoc->getIDocumentLayoutAccess().DelLayoutFormat( pFormat );
230 
231  // DelLayoutFormat can also trigger the deletion of objects.
232  if( i > rTable.size() )
233  i = rTable.size();
234  }
235  }
236  }
237 }
238 
239 // #i59534: Redo of insertion of multiple text nodes runs into trouble
240 // because of unnecessary expanded redlines
241 // From now on this class saves the redline positions of all redlines which ends exact at the
242 // insert position (node _and_ content index)
244  : nSavContent( nCnt )
245 {
246  SwNode& rNd = rInsIdx.GetNode();
247  SwDoc* pDest = rNd.GetDoc();
249  {
251  const SwPosition* pEnd;
252  SwPosition aSrcPos( rInsIdx, SwIndex( rNd.GetContentNode(), nCnt ));
253  pDest->getIDocumentRedlineAccess().GetRedline( aSrcPos, &nFndPos );
254  const SwRangeRedline* pRedl;
255  while( nFndPos--
256  && *( pEnd = ( pRedl = pDest->getIDocumentRedlineAccess().GetRedlineTable()[ nFndPos ] )->End() ) == aSrcPos
257  && *pRedl->Start() < aSrcPos )
258  {
259  if( !pSavIdx )
260  {
261  pSavIdx.reset(new SwNodeIndex( rInsIdx, -1 ));
262  }
263  mvSavArr.push_back( const_cast<SwPosition*>(pEnd) );
264  }
265  }
266 }
267 
269 {
270  pSavIdx.reset();
271 }
272 
274 {
275  if (mvSavArr.empty())
276  return;
277  ++(*pSavIdx);
278  SwContentNode* pNode = pSavIdx->GetNode().GetContentNode();
279  // If there's no content node at the remembered position, we will not restore the old position
280  // This may happen if a table (or section?) will be inserted.
281  if( pNode )
282  {
283  SwPosition aPos( *pSavIdx, SwIndex( pNode, nSavContent ));
284  for( auto n = mvSavArr.size(); n; )
285  *mvSavArr[ --n ] = aPos;
286  }
287 }
288 
290 static std::vector<sal_uInt16> lcl_RangesToVector(const sal_uInt16 * pRanges)
291 {
292  std::vector<sal_uInt16> aResult;
293 
294  int i = 0;
295  while (pRanges[i] != 0)
296  {
297  OSL_ENSURE(pRanges[i+1] != 0, "malformed ranges");
298 
299  for (sal_uInt16 j = pRanges[i]; j < pRanges[i+1]; j++)
300  aResult.push_back(j);
301 
302  i += 2;
303  }
304 
305  return aResult;
306 }
307 
308 void sw_GetJoinFlags( SwPaM& rPam, bool& rJoinText, bool& rJoinPrev )
309 {
310  rJoinText = false;
311  rJoinPrev = false;
312  if( rPam.GetPoint()->nNode != rPam.GetMark()->nNode )
313  {
314  const SwPosition* pStt = rPam.Start(), *pEnd = rPam.End();
315  SwTextNode *pSttNd = pStt->nNode.GetNode().GetTextNode();
316  if( pSttNd )
317  {
318  SwTextNode *pEndNd = pEnd->nNode.GetNode().GetTextNode();
319  rJoinText = nullptr != pEndNd;
320  if( rJoinText )
321  {
322  bool bExchange = pStt == rPam.GetPoint();
323  if( !pStt->nContent.GetIndex() &&
324  pEndNd->GetText().getLength() != pEnd->nContent.GetIndex())
325  bExchange = !bExchange;
326  if( bExchange )
327  rPam.Exchange();
328  rJoinPrev = rPam.GetPoint() == pStt;
329  OSL_ENSURE( !pStt->nContent.GetIndex() &&
330  pEndNd->GetText().getLength() != pEnd->nContent.GetIndex()
331  ? (rPam.GetPoint()->nNode < rPam.GetMark()->nNode)
332  : (rPam.GetPoint()->nNode > rPam.GetMark()->nNode),
333  "sw_GetJoinFlags");
334  }
335  }
336  }
337 }
338 
339 bool sw_JoinText( SwPaM& rPam, bool bJoinPrev )
340 {
341  SwNodeIndex aIdx( rPam.GetPoint()->nNode );
342  SwTextNode *pTextNd = aIdx.GetNode().GetTextNode();
343  SwNodeIndex aOldIdx( aIdx );
344  SwTextNode *pOldTextNd = pTextNd;
345 
346  if( pTextNd && pTextNd->CanJoinNext( &aIdx ) )
347  {
348  SwDoc* pDoc = rPam.GetDoc();
349  if( bJoinPrev )
350  {
351  // We do not need to handle xmlids in this case, because
352  // it is only invoked if one paragraph is/becomes completely empty
353  // (see sw_GetJoinFlags)
354  {
355  // If PageBreaks are deleted/set, it must not be added to the Undo history!
356  // Also, deleting the Node is not added to the Undo history!
357  ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
358 
359  /* PageBreaks, PageDesc, ColumnBreaks */
360  // If we need to change something about the logic to copy the PageBreaks,
361  // PageDesc, etc. we also have to change SwUndoDelete.
362  // There, we copy the AUTO PageBreak from the GetMarkNode!
363 
364  /* The MarkNode */
365  pTextNd = aIdx.GetNode().GetTextNode();
366  if (pTextNd->HasSwAttrSet())
367  {
368  const SfxPoolItem* pItem;
369  if( SfxItemState::SET == pTextNd->GetpSwAttrSet()->GetItemState(
370  RES_BREAK, false, &pItem ) )
371  pTextNd->ResetAttr( RES_BREAK );
372  if( pTextNd->HasSwAttrSet() &&
373  SfxItemState::SET == pTextNd->GetpSwAttrSet()->GetItemState(
374  RES_PAGEDESC, false, &pItem ) )
375  pTextNd->ResetAttr( RES_PAGEDESC );
376  }
377 
378  /* The PointNode */
379  if( pOldTextNd->HasSwAttrSet() )
380  {
381  const SfxPoolItem* pItem;
382  SfxItemSet aSet( pDoc->GetAttrPool(), aBreakSetRange );
383  const SfxItemSet* pSet = pOldTextNd->GetpSwAttrSet();
384  if( SfxItemState::SET == pSet->GetItemState( RES_BREAK,
385  false, &pItem ) )
386  aSet.Put( *pItem );
387  if( SfxItemState::SET == pSet->GetItemState( RES_PAGEDESC,
388  false, &pItem ) )
389  aSet.Put( *pItem );
390  if( aSet.Count() )
391  pTextNd->SetAttr( aSet );
392  }
393  pOldTextNd->FormatToTextAttr( pTextNd );
394 
395  const std::shared_ptr< sw::mark::ContentIdxStore> pContentStore(sw::mark::ContentIdxStore::Create());
396  pContentStore->Save( pDoc, aOldIdx.GetIndex(), pOldTextNd->Len() );
397 
398  SwIndex aAlphaIdx(pTextNd);
399  pOldTextNd->CutText( pTextNd, aAlphaIdx, SwIndex(pOldTextNd),
400  pOldTextNd->Len() );
401  SwPosition aAlphaPos( aIdx, aAlphaIdx );
402  pDoc->CorrRel( rPam.GetPoint()->nNode, aAlphaPos, 0, true );
403 
404  // move all Bookmarks/TOXMarks
405  if( !pContentStore->Empty() )
406  pContentStore->Restore( pDoc, aIdx.GetIndex() );
407 
408  // If the passed PaM is not in the Cursor ring,
409  // treat it separately (e.g. when it's being called from AutoFormat)
410  if( pOldTextNd == rPam.GetBound().nContent.GetIdxReg() )
411  rPam.GetBound() = aAlphaPos;
412  if( pOldTextNd == rPam.GetBound( false ).nContent.GetIdxReg() )
413  rPam.GetBound( false ) = aAlphaPos;
414  }
415  // delete the Node, at last!
416  SwNode::Merge const eOldMergeFlag(pOldTextNd->GetRedlineMergeFlag());
417  if (eOldMergeFlag == SwNode::Merge::First)
418  {
419  sw::MoveDeletedPrevFrames(*pOldTextNd, *pTextNd);
420  }
421  pDoc->GetNodes().Delete( aOldIdx );
423  eOldMergeFlag == SwNode::Merge::NonFirst
425  : sw::Recreate::No);
426  }
427  else
428  {
429  SwTextNode* pDelNd = aIdx.GetNode().GetTextNode();
430  if( pTextNd->Len() )
431  pDelNd->FormatToTextAttr( pTextNd );
432  else
433  {
434  /* This case was missed:
435 
436  <something></something> <-- pTextNd
437  <other>ccc</other> <-- pDelNd
438 
439  <something> and <other> are paragraph
440  attributes. The attribute <something> stayed if not
441  overwritten by an attribute in "ccc". Fixed by
442  first resetting all character attributes in first
443  paragraph (pTextNd).
444  */
445  std::vector<sal_uInt16> aShorts =
447  pTextNd->ResetAttr(aShorts);
448 
449  if( pDelNd->HasSwAttrSet() )
450  {
451  // only copy the character attributes
452  SfxItemSet aTmpSet( pDoc->GetAttrPool(), aCharFormatSetRange );
453  aTmpSet.Put( *pDelNd->GetpSwAttrSet() );
454  pTextNd->SetAttr( aTmpSet );
455  }
456  }
457 
458  pDoc->CorrRel( aIdx, *rPam.GetPoint(), 0, true );
459  // #i100466# adjust given <rPam>, if it does not belong to the cursors
460  if ( pDelNd == rPam.GetBound().nContent.GetIdxReg() )
461  {
462  rPam.GetBound() = SwPosition( SwNodeIndex( *pTextNd ), SwIndex( pTextNd ) );
463  }
464  if( pDelNd == rPam.GetBound( false ).nContent.GetIdxReg() )
465  {
466  rPam.GetBound( false ) = SwPosition( SwNodeIndex( *pTextNd ), SwIndex( pTextNd ) );
467  }
468  pTextNd->JoinNext();
469  }
470  return true;
471  }
472  else return false;
473 }
474 
475 static void lcl_syncGrammarError( SwTextNode &rTextNode, linguistic2::ProofreadingResult& rResult,
476  const ModelToViewHelper &rConversionMap )
477 {
478  if( rTextNode.IsGrammarCheckDirty() )
479  return;
480  SwGrammarMarkUp* pWrong = rTextNode.GetGrammarCheck();
481  linguistic2::SingleProofreadingError* pArray = rResult.aErrors.getArray();
482  sal_uInt16 j = 0;
483  if( pWrong )
484  {
485  for( sal_Int32 i = 0; i < rResult.aErrors.getLength(); ++i )
486  {
487  const linguistic2::SingleProofreadingError &rError = rResult.aErrors[i];
488  const sal_Int32 nStart = rConversionMap.ConvertToModelPosition( rError.nErrorStart ).mnPos;
489  const sal_Int32 nEnd = rConversionMap.ConvertToModelPosition( rError.nErrorStart + rError.nErrorLength ).mnPos;
490  if( i != j )
491  pArray[j] = pArray[i];
492  if( pWrong->LookForEntry( nStart, nEnd ) )
493  ++j;
494  }
495  }
496  if( rResult.aErrors.getLength() > j )
497  rResult.aErrors.realloc( j );
498 }
499 
501  uno::Reference< XSpellChecker1 > const &xSpeller,
502  sal_uInt16* pPageCnt, sal_uInt16* pPageSt,
503  bool bGrammarCheck,
504  SwRootFrame const*const pLayout,
505  SwConversionArgs *pConvArgs ) const
506 {
507  SwPosition* pSttPos = rPaM.Start(), *pEndPos = rPaM.End();
508 
509  std::unique_ptr<SwSpellArgs> pSpellArgs;
510  if (pConvArgs)
511  {
512  pConvArgs->SetStart(pSttPos->nNode.GetNode().GetTextNode(), pSttPos->nContent);
513  pConvArgs->SetEnd( pEndPos->nNode.GetNode().GetTextNode(), pEndPos->nContent );
514  }
515  else
516  pSpellArgs.reset(new SwSpellArgs( xSpeller,
517  pSttPos->nNode.GetNode().GetTextNode(), pSttPos->nContent,
518  pEndPos->nNode.GetNode().GetTextNode(), pEndPos->nContent,
519  bGrammarCheck ));
520 
521  sal_uLong nCurrNd = pSttPos->nNode.GetIndex();
522  sal_uLong nEndNd = pEndPos->nNode.GetIndex();
523 
524  uno::Any aRet;
525  if( nCurrNd <= nEndNd )
526  {
527  SwContentFrame* pContentFrame;
528  bool bGoOn = true;
529  while( bGoOn )
530  {
531  SwNode* pNd = GetNodes()[ nCurrNd ];
532  switch( pNd->GetNodeType() )
533  {
534  case SwNodeType::Text:
535  if( nullptr != ( pContentFrame = pNd->GetTextNode()->getLayoutFrame( getIDocumentLayoutAccess().GetCurrentLayout() )) )
536  {
537  // skip protected and hidden Cells and Flys
538  if( pContentFrame->IsProtected() )
539  {
540  nCurrNd = pNd->EndOfSectionIndex();
541  }
542  else if( !static_cast<SwTextFrame*>(pContentFrame)->IsHiddenNow() )
543  {
544  if( pPageCnt && *pPageCnt && pPageSt )
545  {
546  sal_uInt16 nPageNr = pContentFrame->GetPhyPageNum();
547  if( !*pPageSt )
548  {
549  *pPageSt = nPageNr;
550  if( *pPageCnt < *pPageSt )
551  *pPageCnt = *pPageSt;
552  }
553  long nStat;
554  if( nPageNr >= *pPageSt )
555  nStat = nPageNr - *pPageSt + 1;
556  else
557  nStat = nPageNr + *pPageCnt - *pPageSt + 1;
558  ::SetProgressState( nStat, GetDocShell() );
559  }
560  //Spell() changes the pSpellArgs in case an error is found
561  sal_Int32 nBeginGrammarCheck = 0;
562  sal_Int32 nEndGrammarCheck = 0;
563  if( pSpellArgs && pSpellArgs->bIsGrammarCheck)
564  {
565  nBeginGrammarCheck = pSpellArgs->pStartNode == pNd ? pSpellArgs->pStartIdx->GetIndex() : 0;
566  // if grammar checking starts inside of a sentence the start position has to be adjusted
567  if( nBeginGrammarCheck )
568  {
569  SwIndex aStartIndex( dynamic_cast< SwTextNode* >( pNd ), nBeginGrammarCheck );
570  SwPosition aStart( *pNd, aStartIndex );
571  SwCursor aCursor(aStart, nullptr);
572  SwPosition aOrigPos = *aCursor.GetPoint();
573  aCursor.GoSentence( SwCursor::START_SENT );
574  if( aOrigPos != *aCursor.GetPoint() )
575  {
576  nBeginGrammarCheck = aCursor.GetPoint()->nContent.GetIndex();
577  }
578  }
579  nEndGrammarCheck = (pSpellArgs->pEndNode == pNd)
580  ? pSpellArgs->pEndIdx->GetIndex()
581  : pNd->GetTextNode()
582  ->GetText().getLength();
583  }
584 
585  sal_Int32 nSpellErrorPosition = pNd->GetTextNode()->GetText().getLength();
586  if( (!pConvArgs && pNd->GetTextNode()->Spell( pSpellArgs.get() )) ||
587  ( pConvArgs && pNd->GetTextNode()->Convert( *pConvArgs )))
588  {
589  // Cancel and remember position
590  pSttPos->nNode = nCurrNd;
591  pEndPos->nNode = nCurrNd;
592  nCurrNd = nEndNd;
593  if( pSpellArgs )
594  nSpellErrorPosition = pSpellArgs->pStartIdx->GetIndex() > pSpellArgs->pEndIdx->GetIndex() ?
595  pSpellArgs->pEndIdx->GetIndex() :
596  pSpellArgs->pStartIdx->GetIndex();
597  }
598 
599  if( pSpellArgs && pSpellArgs->bIsGrammarCheck )
600  {
601  uno::Reference< linguistic2::XProofreadingIterator > xGCIterator( GetGCIterator() );
602  if (xGCIterator.is())
603  {
604  uno::Reference< lang::XComponent > xDoc( GetDocShell()->GetBaseModel(), uno::UNO_QUERY );
605  // Expand the string:
606  const ModelToViewHelper aConversionMap(*pNd->GetTextNode(), pLayout);
607  const OUString& aExpandText = aConversionMap.getViewText();
608 
609  // get XFlatParagraph to use...
610  uno::Reference< text::XFlatParagraph > xFlatPara = new SwXFlatParagraph( *pNd->GetTextNode(), aExpandText, aConversionMap );
611 
612  // get error position of cursor in XFlatParagraph
613  linguistic2::ProofreadingResult aResult;
614  bool bGrammarErrors;
615  do
616  {
617  aConversionMap.ConvertToViewPosition( nBeginGrammarCheck );
618  aResult = xGCIterator->checkSentenceAtPosition(
619  xDoc, xFlatPara, aExpandText, lang::Locale(), nBeginGrammarCheck, -1, -1 );
620 
621  lcl_syncGrammarError( *pNd->GetTextNode(), aResult, aConversionMap );
622 
623  // get suggestions to use for the specific error position
624  bGrammarErrors = aResult.aErrors.hasElements();
625  // if grammar checking doesn't have any progress then quit
626  if( aResult.nStartOfNextSentencePosition <= nBeginGrammarCheck )
627  break;
628  // prepare next iteration
629  nBeginGrammarCheck = aResult.nStartOfNextSentencePosition;
630  }
631  while( nSpellErrorPosition > aResult.nBehindEndOfSentencePosition && !bGrammarErrors && aResult.nBehindEndOfSentencePosition < nEndGrammarCheck );
632 
633  if( bGrammarErrors && nSpellErrorPosition >= aResult.nBehindEndOfSentencePosition )
634  {
635  aRet <<= aResult;
636  //put the cursor to the current error
637  const linguistic2::SingleProofreadingError &rError = aResult.aErrors[0];
638  nCurrNd = pNd->GetIndex();
639  pSttPos->nNode = nCurrNd;
640  pEndPos->nNode = nCurrNd;
641  pSpellArgs->pStartNode = pNd->GetTextNode();
642  pSpellArgs->pEndNode = pNd->GetTextNode();
643  pSpellArgs->pStartIdx->Assign(pNd->GetTextNode(), aConversionMap.ConvertToModelPosition( rError.nErrorStart ).mnPos );
644  pSpellArgs->pEndIdx->Assign(pNd->GetTextNode(), aConversionMap.ConvertToModelPosition( rError.nErrorStart + rError.nErrorLength ).mnPos );
645  nCurrNd = nEndNd;
646  }
647  }
648  }
649  }
650  }
651  break;
652  case SwNodeType::Section:
653  if( static_cast<SwSectionNode*>(pNd)->GetSection().IsProtect() ||
654  static_cast<SwSectionNode*>(pNd)->GetSection().IsHidden() )
655  nCurrNd = pNd->EndOfSectionIndex();
656  break;
657  case SwNodeType::End:
658  {
659  break;
660  }
661  default: break;
662  }
663 
664  bGoOn = nCurrNd < nEndNd;
665  ++nCurrNd;
666  }
667  }
668 
669  if( !aRet.hasValue() )
670  {
671  if (pConvArgs)
672  aRet <<= pConvArgs->aConvText;
673  else
674  aRet <<= pSpellArgs->xSpellAlt;
675  }
676 
677  return aRet;
678 }
679 
681 {
682  const SwNode *pStart;
683  const SwNode *pEnd;
685  sal_uInt16 * const pPageCnt;
686  sal_uInt16 * const pPageSt;
687 
688  sal_uInt32 nNode;
689  sal_Int32 nPamStart;
690  sal_Int32 nPamLen;
691 
692 public:
693  SwHyphArgs( const SwPaM *pPam, const Point &rPoint,
694  sal_uInt16* pPageCount, sal_uInt16* pPageStart );
695  void SetPam( SwPaM *pPam ) const;
696  void SetNode( SwNode *pNew ) { pNode = pNew; }
697  inline void SetRange( const SwNode *pNew );
698  void NextNode() { ++nNode; }
699  sal_uInt16 *GetPageCnt() { return pPageCnt; }
700  sal_uInt16 *GetPageSt() { return pPageSt; }
701 };
702 
703 SwHyphArgs::SwHyphArgs( const SwPaM *pPam, const Point &rCursorPos,
704  sal_uInt16* pPageCount, sal_uInt16* pPageStart )
705  : SwInterHyphInfo( rCursorPos ), pNode(nullptr),
706  pPageCnt( pPageCount ), pPageSt( pPageStart )
707 {
708  // The following constraints have to be met:
709  // 1) there is at least one Selection
710  // 2) SPoint() == Start()
711  OSL_ENSURE( pPam->HasMark(), "SwDoc::Hyphenate: blowing in the wind");
712  OSL_ENSURE( *pPam->GetPoint() <= *pPam->GetMark(),
713  "SwDoc::Hyphenate: New York, New York");
714 
715  const SwPosition *pPoint = pPam->GetPoint();
716  nNode = pPoint->nNode.GetIndex();
717 
718  // Set start
719  pStart = pPoint->nNode.GetNode().GetTextNode();
720  nPamStart = pPoint->nContent.GetIndex();
721 
722  // Set End and Length
723  const SwPosition *pMark = pPam->GetMark();
724  pEnd = pMark->nNode.GetNode().GetTextNode();
725  nPamLen = pMark->nContent.GetIndex();
726  if( pPoint->nNode == pMark->nNode )
727  nPamLen = nPamLen - pPoint->nContent.GetIndex();
728 }
729 
730 inline void SwHyphArgs::SetRange( const SwNode *pNew )
731 {
732  nStart = pStart == pNew ? nPamStart : 0;
733  nEnd = pEnd == pNew ? nPamStart + nPamLen : SAL_MAX_INT32;
734 }
735 
736 void SwHyphArgs::SetPam( SwPaM *pPam ) const
737 {
738  if( !pNode )
739  *pPam->GetPoint() = *pPam->GetMark();
740  else
741  {
742  pPam->GetPoint()->nNode = nNode;
744  pPam->GetMark()->nNode = nNode;
746  nWordStart + nWordLen );
747  OSL_ENSURE( nNode == pNode->GetIndex(),
748  "SwHyphArgs::SetPam: Pam disaster" );
749  }
750 }
751 
752 // Returns true if we can proceed.
753 static bool lcl_HyphenateNode( const SwNodePtr& rpNd, void* pArgs )
754 {
755  // Hyphenate returns true if there is a hyphenation point and sets pPam
756  SwTextNode *pNode = rpNd->GetTextNode();
757  SwHyphArgs *pHyphArgs = static_cast<SwHyphArgs*>(pArgs);
758  if( pNode )
759  {
760  // sw_redlinehide: this will be called once per node for merged nodes;
761  // the fully deleted ones won't have frames so are skipped.
762  SwContentFrame* pContentFrame = pNode->getLayoutFrame( pNode->GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout() );
763  if( pContentFrame && !static_cast<SwTextFrame*>(pContentFrame)->IsHiddenNow() )
764  {
765  sal_uInt16 *pPageSt = pHyphArgs->GetPageSt();
766  sal_uInt16 *pPageCnt = pHyphArgs->GetPageCnt();
767  if( pPageCnt && *pPageCnt && pPageSt )
768  {
769  sal_uInt16 nPageNr = pContentFrame->GetPhyPageNum();
770  if( !*pPageSt )
771  {
772  *pPageSt = nPageNr;
773  if( *pPageCnt < *pPageSt )
774  *pPageCnt = *pPageSt;
775  }
776  long nStat = nPageNr >= *pPageSt ? nPageNr - *pPageSt + 1
777  : nPageNr + *pPageCnt - *pPageSt + 1;
778  ::SetProgressState( nStat, pNode->GetDoc()->GetDocShell() );
779  }
780  pHyphArgs->SetRange( rpNd );
781  if( pNode->Hyphenate( *pHyphArgs ) )
782  {
783  pHyphArgs->SetNode( rpNd );
784  return false;
785  }
786  }
787  }
788  pHyphArgs->NextNode();
789  return true;
790 }
791 
792 uno::Reference< XHyphenatedWord > SwDoc::Hyphenate(
793  SwPaM *pPam, const Point &rCursorPos,
794  sal_uInt16* pPageCnt, sal_uInt16* pPageSt )
795 {
796  OSL_ENSURE(this == pPam->GetDoc(), "SwDoc::Hyphenate: strangers in the night");
797 
798  if( *pPam->GetPoint() > *pPam->GetMark() )
799  pPam->Exchange();
800 
801  SwHyphArgs aHyphArg( pPam, rCursorPos, pPageCnt, pPageSt );
802  SwNodeIndex aTmpIdx( pPam->GetMark()->nNode, 1 );
803  GetNodes().ForEach( pPam->GetPoint()->nNode, aTmpIdx,
804  lcl_HyphenateNode, &aHyphArg );
805  aHyphArg.SetPam( pPam );
806  return aHyphArg.GetHyphWord(); // will be set by lcl_HyphenateNode
807 }
808 
809 // Save the current values to add them as automatic entries to AutoCorrect.
810 void SwDoc::SetAutoCorrExceptWord( std::unique_ptr<SwAutoCorrExceptWord> pNew )
811 {
812  mpACEWord = std::move(pNew);
813 }
814 
816 {
817  mpACEWord.reset();
818 }
819 
820 void SwDoc::CountWords( const SwPaM& rPaM, SwDocStat& rStat )
821 {
822  // This is a modified version of SwDoc::TransliterateText
823  const SwPosition* pStt = rPaM.Start();
824  const SwPosition* pEnd = pStt == rPaM.GetPoint() ? rPaM.GetMark()
825  : rPaM.GetPoint();
826 
827  const sal_uLong nSttNd = pStt->nNode.GetIndex();
828  const sal_uLong nEndNd = pEnd->nNode.GetIndex();
829 
830  const sal_Int32 nSttCnt = pStt->nContent.GetIndex();
831  const sal_Int32 nEndCnt = pEnd->nContent.GetIndex();
832 
833  const SwTextNode* pTNd = pStt->nNode.GetNode().GetTextNode();
834  if( pStt == pEnd && pTNd ) // no region ?
835  {
836  // do nothing
837  return;
838  }
839 
840  if( nSttNd != nEndNd )
841  {
842  SwNodeIndex aIdx( pStt->nNode );
843  if( nSttCnt )
844  {
845  ++aIdx;
846  if( pTNd )
847  pTNd->CountWords( rStat, nSttCnt, pTNd->GetText().getLength() );
848  }
849 
850  for( ; aIdx.GetIndex() < nEndNd; ++aIdx )
851  if( nullptr != ( pTNd = aIdx.GetNode().GetTextNode() ))
852  pTNd->CountWords( rStat, 0, pTNd->GetText().getLength() );
853 
854  if( nEndCnt && nullptr != ( pTNd = pEnd->nNode.GetNode().GetTextNode() ))
855  pTNd->CountWords( rStat, 0, nEndCnt );
856  }
857  else if( pTNd && nSttCnt < nEndCnt )
858  pTNd->CountWords( rStat, nSttCnt, nEndCnt );
859 }
860 
861 
862 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool GoSentence(SentenceMoveType eMoveType, SwRootFrame const *pLayout=nullptr)
Definition: swcrsr.cxx:1529
void CheckResetRedlineMergeFlag(SwTextNode &rNode, Recreate eRecreateMerged)
if first node is First, its frames may need to be moved, never deleted.
Definition: ndtxt.cxx:878
const SwEndNode * EndOfSectionNode() const
Definition: node.hxx:682
std::vector< SwPosition * > mvSavArr
Definition: mvsave.hxx:188
virtual sal_Int32 Len() const
Definition: node.cxx:1183
bool erase(const value_type &x)
Definition: docfmt.cxx:2117
SwNode * pNode
Definition: docedt.cxx:684
sal_uLong GetIndex() const
Definition: node.hxx:282
bool hasValue()
Marks a position in the document model.
Definition: pam.hxx:35
void MoveDeletedPrevFrames(const SwTextNode &rDeletedPrev, SwTextNode &rNode)
if first node is deleted & second survives, then the first node's frame will be deleted too; prevent this...
Definition: ndtxt.cxx:838
SwContentNode * GetNode(SwPaM &rPam, bool &rbFirst, SwMoveFnCollection const &fnMove, bool const bInReadOnly, SwRootFrame const *const i_pLayout)
This function returns the next node in direction of search.
Definition: pam.cxx:756
std::pair< const_iterator, bool > push_back(const value_type &x)
Definition: docfmt.cxx:2109
const OUString & GetText() const
Definition: ndtxt.hxx:211
virtual const SwRootFrame * GetCurrentLayout() const =0
SwDocShell * GetDocShell()
Definition: doc.hxx:1340
void SetNode(SwNode *pNew)
Definition: docedt.cxx:696
css::uno::Any Spell(SwPaM &, css::uno::Reference< css::linguistic2::XSpellChecker1 > const &, sal_uInt16 *pPageCnt, sal_uInt16 *pPageSt, bool bGrammarCheck, SwRootFrame const *pLayout, SwConversionArgs *pConvArgs=nullptr) const
Operations on the content of the document e.g.
Definition: docedt.cxx:500
const_iterator find(const value_type &x) const
Definition: docfmt.cxx:2077
SwNodeIndex nNode
Definition: pam.hxx:37
const_iterator begin() const
Definition: docary.hxx:257
virtual sal_Int32 Len() const override
Definition: ndtxt.cxx:284
sal_uIntPtr sal_uLong
bool Spell(SwSpellArgs *)
Definition: txtedt.cxx:951
const SwPosition * GetMark() const
Definition: pam.hxx:209
SwContentFrame * getLayoutFrame(const SwRootFrame *, const SwPosition *pPos=nullptr, std::pair< Point, bool > const *pViewPosAndCalcFrame=nullptr) const
Definition: node.cxx:1150
Definition: doc.hxx:185
void CutText(SwTextNode *const pDest, const SwIndex &rStart, const sal_Int32 nLen)
Definition: ndtxt.cxx:2402
SwSectionNode is derived from SwStartNode.
SwNode & GetNode() const
Definition: ndindex.hxx:118
sal_uInt32 nNode
Definition: docedt.cxx:688
Content, content of frame (header, footer, fly).
Definition: fmtcntnt.hxx:31
SwPosition & GetBound(bool bOne=true)
Definition: pam.hxx:245
IDocumentUndoRedo & GetIDocumentUndoRedo()
Definition: doc.cxx:176
The root element of a Writer document layout.
Definition: rootfrm.hxx:79
const SwFrameFormats * GetSpzFrameFormats() const
Definition: doc.hxx:738
void Delete(const SwNodeIndex &rPos, sal_uLong nNodes=1)
delete nodes
Definition: nodes.cxx:1063
void SetEnd(SwTextNode *pEnd, SwIndex &rEnd)
Definition: splargs.hxx:55
SwNodeType GetNodeType() const
Definition: node.hxx:144
SwIndex nContent
Definition: pam.hxx:38
bool empty() const
Definition: docary.hxx:367
SwNodeIndex aStart
Definition: ndindex.hxx:131
sal_uLong GetIndex() const
Definition: ndindex.hxx:151
virtual void DelLayoutFormat(SwFrameFormat *pFormat)=0
void SetRange(const SwNode *pNew)
Definition: docedt.cxx:730
static std::vector< sal_uInt16 > lcl_RangesToVector(const sal_uInt16 *pRanges)
Convert list of ranges of whichIds to a corresponding list of whichIds.
Definition: docedt.cxx:290
static bool lcl_HyphenateNode(const SwNodePtr &rpNd, void *pArgs)
Definition: docedt.cxx:753
bool sw_JoinText(SwPaM &rPam, bool bJoinPrev)
Definition: docedt.cxx:339
void SetProgressState(long nPosition, SwDocShell const *pDocShell)
Definition: mainwn.cxx:78
Specific frame formats (frames, DrawObjects).
Definition: docary.hxx:201
const css::uno::Reference< css::linguistic2::XHyphenatedWord > & GetHyphWord()
Definition: splargs.hxx:139
#define RES_FLYFRMFMT
Definition: hintids.hxx:274
bool IsContentNode() const
Definition: node.hxx:628
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:136
static void lcl_syncGrammarError(SwTextNode &rTextNode, linguistic2::ProofreadingResult &rResult, const ModelToViewHelper &rConversionMap)
Definition: docedt.cxx:475
const SwAttrSet * GetpSwAttrSet() const
Definition: node.hxx:443
Merge
sw_redlinehide: redline node merge state
Definition: node.hxx:92
Style of a layout element.
Definition: frmfmt.hxx:57
const OUString & getViewText() const
#define SAL_MAX_INT32
const SwFormatAnchor & GetAnchor(bool=true) const
Definition: fmtanchr.hxx:81
void ForEach(FnForEach_SwNodes fnForEach, void *pArgs=nullptr)
Definition: ndarr.hxx:144
const SwPosition * GetPoint() const
Definition: pam.hxx:207
void SaveFlyInRange(const SwNodeRange &rRg, SaveFlyArr &rArr)
Definition: docedt.cxx:89
SwIndex & Assign(SwIndexReg *, sal_Int32)
Definition: index.cxx:198
RndStdIds GetAnchorId() const
Definition: fmtanchr.hxx:65
const SwPosition * GetContentAnchor() const
Definition: fmtanchr.hxx:67
sal_Int32 nPamLen
Definition: docedt.cxx:690
void Exchange()
Definition: pam.cxx:471
int i
SwContentNode * GetContentNode()
Definition: node.hxx:615
vector_type::size_type size_type
Definition: docary.hxx:330
sal_Int32 nStart
input: requested range to hyphenate
Definition: splargs.hxx:118
FlyAnchors.
Definition: fmtanchr.hxx:34
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
Definition: pam.hxx:205
SwDoc * GetDoc()
Definition: node.hxx:702
SwDoc * GetDoc() const
Definition: pam.hxx:243
bool LookForEntry(sal_Int32 nBegin, sal_Int32 nEnd)
Definition: wrong.cxx:613
virtual void DelFrames()
Destroys all Frames in aDepend (Frames are identified via dynamic_cast).
Definition: atrfrm.cxx:2617
Marks a character position inside a document model node.
Definition: index.hxx:37
SwGrammarMarkUp * GetGrammarCheck()
Definition: txtedt.cxx:2190
bool Hyphenate(SwInterHyphInfo &rHyphInf)
Interactive hyphenation: we find TextFrame and call its CalcHyph.
Definition: txtedt.cxx:1620
std::unique_ptr< SwNodeIndex > pSavIdx
Definition: mvsave.hxx:189
Marks a node in the document model.
Definition: ndindex.hxx:31
bool HasSwAttrSet() const
Definition: node.hxx:444
const SwDoc * GetDoc() const
The document is set in SwAttrPool now, therefore you always can access it.
Definition: format.hxx:119
void RestFlyInRange(SaveFlyArr &rArr, const SwNodeIndex &rSttIdx, const SwNodeIndex *pInsertPos)
Definition: docedt.cxx:57
sal_Int32 nEnd
Definition: splargs.hxx:119
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
Definition: doc.cxx:437
const SwPosition * Start() const
Definition: pam.hxx:212
std::deque< SaveFly > SaveFlyArr
Definition: mvsave.hxx:110
css::uno::Reference< css::linguistic2::XProofreadingIterator > const & GetGCIterator() const
Definition: docnew.cxx:131
const SwNodeIndex * GetContentIdx() const
Definition: fmtcntnt.hxx:46
virtual const SwRangeRedline * GetRedline(const SwPosition &rPos, SwRedlineTable::size_type *pFndPos) const =0
virtual bool SetFormatAttr(const SfxPoolItem &rAttr)
Definition: format.cxx:460
sal_uInt16 Which() const
for Querying of Writer-functions.
Definition: format.hxx:78
void CorrRel(const SwNodeIndex &rOldNode, const SwPosition &rNewPos, const sal_Int32 nOffset=0, bool bMoveCursor=false)
Definition: doccorr.cxx:300
OUString aConvText
Definition: splargs.hxx:64
void SetAutoCorrExceptWord(std::unique_ptr< SwAutoCorrExceptWord > pNew)
Definition: docedt.cxx:810
sal_uLong EndOfSectionIndex() const
Definition: node.hxx:677
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:79
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
Definition: doc.cxx:367
const SwNode * pStart
Definition: docedt.cxx:682
std::unique_ptr< SwAutoCorrExceptWord > mpACEWord
For the automated takeover of auto-corrected words that are "re-corrected".
Definition: doc.hxx:260
data structure to temporarily hold fly anchor positions relative to some location.
Definition: mvsave.hxx:99
void SetPam(SwPaM *pPam) const
Definition: docedt.cxx:736
sal_uInt16 GetPhyPageNum() const
Definition: trvlfrm.cxx:1688
void DeleteAutoCorrExceptWord()
Definition: docedt.cxx:815
static std::shared_ptr< ContentIdxStore > Create()
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 SwNode * pEnd
Definition: docedt.cxx:683
sal_Int32 nPamStart
Definition: docedt.cxx:689
const SwPosition * End() const
Definition: pam.hxx:217
sal_uInt16 const aCharFormatSetRange[]
Definition: init.cxx:251
SwNodeIndex aEnd
Definition: ndindex.hxx:132
SaveRedlEndPosForRestore(const SwNodeIndex &rInsIdx, sal_Int32 nContent)
Definition: docedt.cxx:243
ModelPosition ConvertToModelPosition(sal_Int32 nViewPos) const
Converts a view position into a model position.
bool CountWords(SwDocStat &rStat, sal_Int32 nStart, sal_Int32 nEnd) const
count words in given range - returns true if we refreshed out count
Definition: txtedt.cxx:1980
sal_Int32 const nSavContent
Definition: mvsave.hxx:190
sal_uInt16 *const pPageSt
Definition: docedt.cxx:686
sal_Int32 nWordLen
Definition: splargs.hxx:122
const SwFormatContent & GetContent(bool=true) const
Definition: fmtcntnt.hxx:55
SwHyphArgs(const SwPaM *pPam, const Point &rPoint, sal_uInt16 *pPageCount, sal_uInt16 *pPageStart)
Definition: docedt.cxx:703
size_t size() const
Definition: docary.hxx:225
void sw_GetJoinFlags(SwPaM &rPam, bool &rJoinText, bool &rJoinPrev)
Definition: docedt.cxx:308
SwFrameFormatsBase::size_type size_type
Definition: docary.hxx:217
sal_Int32 nWordStart
output: found word
Definition: splargs.hxx:121
void FormatToTextAttr(SwTextNode *pNd)
Convey attributes of an AttrSet (AutoFormat) to SwpHintsArray.
Definition: thints.cxx:2479
virtual const SwRedlineTable & GetRedlineTable() const =0
const SwIndexReg * GetIdxReg() const
Definition: index.hxx:101
void NextNode()
Definition: docedt.cxx:698
#define RES_PAGEDESC
Definition: hintids.hxx:198
#define RES_BREAK
Definition: hintids.hxx:199
sal_uInt16 const aBreakSetRange[]
Definition: init.cxx:148
bool Convert(SwConversionArgs &)
Definition: txtedt.cxx:1111
void SetStart(SwTextNode *pStart, SwIndex &rStart)
Definition: splargs.hxx:50
Merge GetRedlineMergeFlag() const
Definition: node.hxx:97
void DelFlyInRange(const SwNodeIndex &rMkNdIdx, const SwNodeIndex &rPtNdIdx)
Delete and move all Flys at the paragraph, that are within the selection.
Definition: docedt.cxx:185
sal_uInt16 * GetPageCnt()
Definition: docedt.cxx:699
css::uno::Reference< css::linguistic2::XHyphenatedWord > Hyphenate(SwPaM *pPam, const Point &rCursorPos, sal_uInt16 *pPageCnt, sal_uInt16 *pPageSt)
Definition: docedt.cxx:792
sal_uInt16 * GetPageSt()
Definition: docedt.cxx:700
static void CountWords(const SwPaM &rPaM, SwDocStat &rStat)
Definition: docedt.cxx:820
const SwAttrPool & GetAttrPool() const
Definition: doc.hxx:1307
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
Definition: ndtxt.hxx:843
bool IsGrammarCheckDirty() const
Definition: txtedt.cxx:2264
void SetAnchor(const SwPosition *pPos)
Definition: atrfrm.cxx:1486
bool IsProtected() const
Is the Frame or rather the Section in which it lies protected?
Definition: trvlfrm.cxx:1621
sal_uInt16 *const pPageCnt
Definition: docedt.cxx:685
void CheckAnchoredFlyConsistency(SwDoc const &rDoc)
Definition: atrfrm.cxx:3541
Base class of the Writer document model elements.
Definition: node.hxx:79