LibreOffice Module sw (master)  1
wrtsh1.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 <com/sun/star/beans/XPropertySet.hpp>
21 #include <com/sun/star/container/XChild.hpp>
22 #include <com/sun/star/embed/EmbedMisc.hpp>
23 #include <com/sun/star/embed/EmbedStates.hpp>
24 #include <com/sun/star/embed/EmbedVerbs.hpp>
25 #include <com/sun/star/embed/NoVisualAreaSizeException.hpp>
26 #include <com/sun/star/chart2/XChartDocument.hpp>
27 #include <com/sun/star/util/XModifiable.hpp>
28 #include <com/sun/star/lang/XInitialization.hpp>
29 
30 #include <hintids.hxx>
31 #include <sot/exchange.hxx>
32 #include <svx/xfillit0.hxx>
33 #include <svx/hdft.hxx>
34 #include <svx/svdview.hxx>
35 #include <svl/itemiter.hxx>
36 #include <tools/bigint.hxx>
37 #include <svtools/insdlg.hxx>
38 #include <sfx2/ipclient.hxx>
40 #include <editeng/svxacorr.hxx>
41 #include <editeng/ulspitem.hxx>
42 #include <vcl/graph.hxx>
43 #include <unotools/charclass.hxx>
45 #include <svx/svxdlg.hxx>
46 #include <svx/extrusionbar.hxx>
47 #include <svx/fontworkbar.hxx>
48 #include <dialoghelp.hxx>
49 #include <frmfmt.hxx>
50 #include <fmtftn.hxx>
51 #include <fmthdft.hxx>
52 #include <fmtpdsc.hxx>
53 #include <txtfrm.hxx>
54 #include <wdocsh.hxx>
55 #include <swmodule.hxx>
56 #include <wrtsh.hxx>
57 #include <view.hxx>
58 #include <cmdid.h>
59 #include <pagedesc.hxx>
60 #include <frmmgr.hxx>
61 #include <swundo.hxx>
62 #include <swcli.hxx>
63 #include <poolfmt.hxx>
64 #include <edtwin.hxx>
65 #include <fmtcol.hxx>
66 #include <swtable.hxx>
67 #include <viscrs.hxx>
68 #include <swdtflvr.hxx>
69 #include <doc.hxx>
71 #include <SwCapObjType.hxx>
72 #include <SwStyleNameMapper.hxx>
73 #include <sfx2/request.hxx>
74 #include <paratr.hxx>
75 #include <ndtxt.hxx>
76 #include <editeng/acorrcfg.hxx>
77 #include <IMark.hxx>
78 #include <sfx2/bindings.hxx>
79 #include <flyfrm.hxx>
80 
81 // -> #111827#
82 #include <SwRewriter.hxx>
83 #include <strings.hrc>
84 // <- #111827#
85 
87 #include <sfx2/viewfrm.hxx>
88 #include <vcl/uitest/logger.hxx>
90 #include <osl/diagnose.h>
91 
92 #include <PostItMgr.hxx>
93 #include <FrameControlsManager.hxx>
94 #include <fldmgr.hxx>
95 #include <docufld.hxx>
97 #include <fmtfld.hxx>
98 
99 #include <sfx2/msgpool.hxx>
100 #include <sfx2/msg.hxx>
101 #include <svtools/embedhlp.hxx>
102 #include <svx/postattr.hxx>
103 #include <comphelper/lok.hxx>
105 #include <memory>
106 
107 #include <frmtool.hxx>
108 #include <viewopt.hxx>
109 
110 #include <IDocumentUndoRedo.hxx>
111 #include <UndoInsert.hxx>
112 #include <UndoCore.hxx>
113 
114 using namespace sw::mark;
115 using namespace com::sun::star;
116 namespace {
117 
118 void collectUIInformation(const OUString& rAction, const OUString& aParameters)
119 {
120  EventDescription aDescription;
121  aDescription.aAction = rAction;
122  aDescription.aParameters = {{"parameters", aParameters}};
123  aDescription.aID = "writer_edit";
124  aDescription.aKeyWord = "SwEditWinUIObject";
125  aDescription.aParent = "MainWindow";
126  UITestLogger::getInstance().logEvent(aDescription);
127 }
128 
129 }
130 
132 
133 static bool lcl_IsAllowed(const SwWrtShell* rSh)
134 {
136  {
137  SwTextNode* pTextNode = rSh->GetCursor()->GetNode().GetTextNode();
138  if (pTextNode && pTextNode->IsOutline())
139  {
140  // disallow if this is an outline node having folded content
141  bool bVisible = true;
142  pTextNode->GetAttrOutlineContentVisible(bVisible);
143  if (!bVisible)
144  return false;
145  }
146  }
147  return true;
148 }
149 
150 #define BITFLD_INI_LIST \
151  m_bClearMark = \
152  m_bIns = true;\
153  m_bAddMode = \
154  m_bBlockMode = \
155  m_bExtMode = \
156  m_bInSelect = \
157  m_bLayoutMode = \
158  m_bSelWrd = \
159  m_bSelLn = \
160  m_bRetainSelection = false; \
161  m_bIsInClickToEdit = false;
162 
164 {
166  if( pACorr && !pACorr->IsAutoCorrFlag( ACFlags::CapitalStartSentence | ACFlags::CapitalStartWord |
167  ACFlags::AddNonBrkSpace | ACFlags::ChgOrdinalNumber | ACFlags::TransliterateRTL |
168  ACFlags::ChgToEnEmDash | ACFlags::SetINetAttr | ACFlags::Autocorrect ))
169  pACorr = nullptr;
170  return pACorr;
171 }
172 
173 void SwWrtShell::NoEdit(bool bHideCursor)
174 {
175  if(bHideCursor)
176  HideCursor();
177 }
178 
180 {
181  if (CanInsert())
182  {
183  ShowCursor();
184  }
185 }
186 
188 {
189  SwMvContext aMvContext(this);
190  if(IsEndPara() && !IsSttPara())
191  return true;
192 
193  return IsEndWord();
194 }
195 
196 // Insert string
197 void SwWrtShell::InsertByWord( const OUString & rStr)
198 {
199  if( rStr.isEmpty() )
200  return;
201 
202  bool bDelim = GetAppCharClass().isLetterNumeric( rStr, 0 );
203  sal_Int32 nPos = 0, nStt = 0;
204  for( ; nPos < rStr.getLength(); nPos++ )
205  {
206  bool bTmpDelim = GetAppCharClass().isLetterNumeric( rStr, nPos );
207  if( bTmpDelim != bDelim )
208  {
209  Insert( rStr.copy( nStt, nPos - nStt ));
210  nStt = nPos;
211  }
212  }
213  if( nStt != nPos )
214  Insert( rStr.copy( nStt, nPos - nStt ));
215 }
216 
217 void SwWrtShell::Insert( const OUString &rStr )
218 {
219  ResetCursorStack();
220  if( !CanInsert() )
221  return;
222 
223  bool bStarted = false;
224  bool bHasSel = HasSelection(),
225  bCallIns = m_bIns /*|| bHasSel*/;
226  bool bDeleted = false;
227 
228  if( bHasSel || ( !m_bIns && SelectHiddenRange() ) )
229  {
230  // Only here parenthesizing, because the normal
231  // insert is already in parentheses at Editshell.
232  StartAllAction();
233 
234  SwRewriter aRewriter;
235 
236  aRewriter.AddRule(UndoArg1, GetCursorDescr());
237  aRewriter.AddRule(UndoArg2, SwResId(STR_YIELDS));
238  {
239  OUString aTmpStr = SwResId(STR_START_QUOTE) +
240  rStr + SwResId(STR_END_QUOTE);
241 
242  aRewriter.AddRule(UndoArg3, aTmpStr);
243  }
244 
245  StartUndo(SwUndoId::REPLACE, &aRewriter);
246  bStarted = true;
247  Push();
248  bDeleted = DelRight();
249  Pop(SwCursorShell::PopMode::DeleteCurrent); // Restore selection (if tracking changes)
250  NormalizePam(false); // tdf#127635 put point at the end of deletion
251  ClearMark();
252  }
253 
254  bCallIns ?
255  SwEditShell::Insert2( rStr, bDeleted ) : SwEditShell::Overwrite( rStr );
256 
257  if( bStarted )
258  {
259  EndUndo();
260  EndAllAction();
261  }
262 }
263 
264 // Maximum height limit not possible, because the maximum height
265 // of the current frame can not be obtained.
266 
267 void SwWrtShell::Insert( const OUString &rPath, const OUString &rFilter,
268  const Graphic &rGrf, SwFlyFrameAttrMgr *pFrameMgr,
269  RndStdIds nAnchorType )
270 {
271  ResetCursorStack();
272  if ( !CanInsert() )
273  return;
274 
275  StartAllAction();
276 
277  SwRewriter aRewriter;
278  aRewriter.AddRule(UndoArg1, SwResId(STR_GRAPHIC));
279 
280  StartUndo(SwUndoId::INSERT, &aRewriter);
281 
282  if ( HasSelection() )
283  DelRight();
284  // Inserted graphics in its own paragraph,
285  // if at the end of a non-empty paragraph.
286  //For i120928,avoid to split node
287 
288  EnterSelFrameMode();
289 
290  bool bSetGrfSize = true;
291  bool bOwnMgr = false;
292 
293  if ( !pFrameMgr )
294  {
295  bOwnMgr = true;
296  pFrameMgr = new SwFlyFrameAttrMgr( true, this, Frmmgr_Type::GRF, nullptr );
297 
298  // CAUTION
299  // GetAttrSet makes an adjustment
300  // While pasting is a SwFrameSize present
301  // because of the DEF-Framesize
302  // These must be removed explicitly for the optimal size.
303  pFrameMgr->DelAttr(RES_FRM_SIZE);
304 
305  if (nAnchorType != RndStdIds::FLY_AT_PARA)
306  // Something other than at-para was requested.
307  pFrameMgr->SetAnchor(nAnchorType);
308  }
309  else
310  {
311  Size aSz( pFrameMgr->GetSize() );
312  if ( !aSz.Width() || !aSz.Height() )
313  {
314  aSz.setWidth(567);
315  aSz.setHeight( 567);
316  pFrameMgr->SetSize( aSz );
317  }
318  else if ( aSz.Width() != DFLT_WIDTH && aSz.Height() != DFLT_HEIGHT )
319  bSetGrfSize = false;
320 
322  }
323 
324  // during change tracking, insert the image anchored as character
325  // (to create an SwRangeRedline on its anchor point)
326  if ( IsRedlineOn() && nAnchorType != RndStdIds::FLY_AS_CHAR )
327  pFrameMgr->SetAnchor( RndStdIds::FLY_AS_CHAR );
328 
329  // Insert the graphic
330  SwFEShell::Insert(rPath, rFilter, &rGrf, &pFrameMgr->GetAttrSet());
331  if ( bOwnMgr )
332  pFrameMgr->UpdateAttrMgr();
333 
334  if( bSetGrfSize )
335  {
336  Size aGrfSize, aBound = GetGraphicDefaultSize();
337  GetGrfSize( aGrfSize );
338 
339  // Add the margin attributes to GrfSize,
340  // because these counts at the margin additionally
341  aGrfSize.AdjustWidth(pFrameMgr->CalcWidthBorder() );
342  aGrfSize.AdjustHeight(pFrameMgr->CalcHeightBorder() );
343 
344  const BigInt aTempWidth( aGrfSize.Width() );
345  const BigInt aTempHeight( aGrfSize.Height());
346 
347  // Fit width if necessary, scale down the height proportional thereafter.
348  if( aGrfSize.Width() > aBound.Width() )
349  {
350  aGrfSize.setWidth( aBound.Width() );
351  aGrfSize.setHeight( BigInt(aBound.Width()) * aTempHeight / aTempWidth );
352  }
353  // Fit height if necessary, scale down the width proportional thereafter.
354  if( aGrfSize.Height() > aBound.Height() )
355  {
356  aGrfSize.setHeight( aBound.Height() );
357  aGrfSize.setWidth( BigInt(aBound.Height()) * aTempWidth / aTempHeight );
358  }
359  pFrameMgr->SetSize( aGrfSize );
360  pFrameMgr->UpdateFlyFrame();
361  }
362  if ( bOwnMgr )
363  delete pFrameMgr;
364 
365  EndUndo();
366  EndAllAction();
367 }
368 
369 // Insert an OLE-Object into the CORE.
370 // if no object is transferred, then one will be created.
371 
373  sal_uInt16 nSlotId )
374 {
375  ResetCursorStack();
376  if( !CanInsert() )
377  return;
378 
379  if( !xRef.is() )
380  {
381  // temporary storage
383  uno::Reference < embed::XStorage > xStor = comphelper::OStorageHelper::GetTemporaryStorage();
384  bool bDoVerb = true;
385  if ( pName )
386  {
388  OUString aName;
389  // TODO/LATER: get aspect?
390  xObj.Assign( aCnt.CreateEmbeddedObject( pName->GetByteSequence(), aName ), embed::Aspects::MSOLE_CONTENT );
391  }
392  else
393  {
394  SvObjectServerList aServerList;
395  switch (nSlotId)
396  {
397  case SID_INSERT_OBJECT:
398  {
399  aServerList.FillInsertObjects();
400  aServerList.Remove( SwDocShell::Factory().GetClassId() );
401  [[fallthrough]];
402  }
403 
404  // TODO/LATER: recording! Convert properties to items
405  case SID_INSERT_FLOATINGFRAME:
406  {
407  SfxSlotPool* pSlotPool = SW_MOD()->GetSlotPool();
408  const SfxSlot* pSlot = pSlotPool->GetSlot(nSlotId);
409  OString aCmd = OString::Concat(".uno:") + pSlot->GetUnoName();
411  ScopedVclPtr<SfxAbstractInsertObjectDialog> pDlg(pFact->CreateInsertObjectDialog(GetFrameWeld(mxDoc->GetDocShell()),
412  OUString::fromUtf8( aCmd ), xStor, &aServerList));
413  if (pDlg)
414  {
415  pDlg->Execute();
416  bDoVerb = pDlg->IsCreateNew();
417  OUString aIconMediaType;
418  uno::Reference< io::XInputStream > xIconMetaFile = pDlg->GetIconIfIconified( &aIconMediaType );
419  xObj.Assign( pDlg->GetObject(),
420  xIconMetaFile.is() ? embed::Aspects::MSOLE_ICON : embed::Aspects::MSOLE_CONTENT );
421  if ( xIconMetaFile.is() )
422  xObj.SetGraphicStream( xIconMetaFile, aIconMediaType );
423  }
424 
425  break;
426  }
427 
428  default:
429  break;
430  }
431  }
432 
433  if ( xObj.is() )
434  {
435  if( InsertOleObject( xObj ) && bDoVerb )
436  {
437  SfxInPlaceClient* pClient = GetView().FindIPClient( xObj.GetObject(), &GetView().GetEditWin() );
438  if ( !pClient )
439  {
440  pClient = new SwOleClient( &GetView(), &GetView().GetEditWin(), xObj );
441  SetCheckForOLEInCaption( true );
442  }
443 
444  if ( xObj.GetViewAspect() == embed::Aspects::MSOLE_ICON )
445  {
446  SwRect aArea = GetAnyCurRect( CurRectType::FlyEmbeddedPrt, nullptr, xObj.GetObject() );
447  aArea.Pos() += GetAnyCurRect( CurRectType::FlyEmbedded, nullptr, xObj.GetObject() ).Pos();
448  MapMode aMapMode( MapUnit::MapTwip );
449  Size aSize = xObj.GetSize( &aMapMode );
450  aArea.Width( aSize.Width() );
451  aArea.Height( aSize.Height() );
452  RequestObjectResize( aArea, xObj.GetObject() );
453  }
454  else
455  CalcAndSetScale( xObj );
456 
457  //#50270# We don't need to handle error, this is handled by the
458  //DoVerb in the SfxViewShell
459  pClient->DoVerb(embed::EmbedVerbs::MS_OLEVERB_SHOW);
460 
461  // TODO/LATER: set document name - should be done in Client
462  }
463  }
464  }
465  else
466  {
467  if( HasSelection() )
468  DelRight();
469  InsertOleObject( xRef );
470  }
471 }
472 
473 // Insert object into the Core.
474 // From ClipBoard or Insert
475 
477 {
478  //tdf#125100 Ensure that ole object is initially shown as pictogram
479  comphelper::EmbeddedObjectContainer& rEmbeddedObjectContainer = mxDoc->GetDocShell()->getEmbeddedObjectContainer();
480  bool bSaveUserAllowsLinkUpdate = rEmbeddedObjectContainer.getUserAllowsLinkUpdate();
481  rEmbeddedObjectContainer.setUserAllowsLinkUpdate(true);
482 
483  ResetCursorStack();
484  StartAllAction();
485 
486  StartUndo(SwUndoId::INSERT);
487 
488  //Some differences between StarMath and any other objects:
489  //1. Selections should be deleted. For StarMath the Text should be
490  // passed to the Object
491  //2. If the cursor is at the end of a non empty paragraph a paragraph
492  // break should be inserted. StarMath objects are character bound and
493  // no break should be inserted.
494  //3. If an selection is passed to a StarMath object, this object should
495  // not be activated. false should be returned then.
496  bool bStarMath = true;
497  bool bActivate = true;
498 
499  // set parent to get correct VisArea(in case of object needing parent printer)
500  uno::Reference < container::XChild > xChild( xRef.GetObject(), uno::UNO_QUERY );
501  if ( xChild.is() )
502  xChild->setParent( mxDoc->GetDocShell()->GetModel() );
503 
504  SvGlobalName aCLSID( xRef->getClassID() );
505  bStarMath = ( SotExchange::IsMath( aCLSID ) != 0 );
506  if( IsSelection() )
507  {
508  if( bStarMath )
509  {
510  OUString aMathData;
511  GetSelectedText( aMathData, ParaBreakType::ToOnlyCR );
512 
513  if( !aMathData.isEmpty() && svt::EmbeddedObjectRef::TryRunningState( xRef.GetObject() ) )
514  {
515  uno::Reference < beans::XPropertySet > xSet( xRef->getComponent(), uno::UNO_QUERY );
516  if ( xSet.is() )
517  {
518  try
519  {
520  xSet->setPropertyValue("Formula", uno::makeAny( aMathData ) );
521  bActivate = false;
522  }
523  catch (const uno::Exception&)
524  {
525  }
526  }
527  }
528  }
529  DelRight();
530  }
531 
532  if ( !bStarMath )
533  SwFEShell::SplitNode( false, false );
534 
535  EnterSelFrameMode();
536 
537  const SvGlobalName* pName = nullptr;
538  SvGlobalName aObjClsId;
539  if (xRef.is())
540  {
541  aObjClsId = SvGlobalName(xRef.GetObject()->getClassID());
542  pName = &aObjClsId;
543  }
544  SwFlyFrameAttrMgr aFrameMgr( true, this, Frmmgr_Type::OLE, pName );
546 
547  SwRect aBound;
548  CalcBoundRect( aBound, aFrameMgr.GetAnchor() );
549 
550  //The Size should be suggested by the OLE server
551  MapMode aMapMode( MapUnit::MapTwip );
552  Size aSz = xRef.GetSize( &aMapMode );
553 
554  //Object size can be limited
555  if ( aSz.Width() > aBound.Width() )
556  {
557  //Always limit proportional.
558  aSz.setHeight( aSz.Height() * aBound.Width() / aSz.Width() );
559  aSz.setWidth( aBound.Width() );
560  }
561  aFrameMgr.SetSize( aSz );
562  SwFlyFrameFormat *pFormat = SwFEShell::InsertObject( xRef, &aFrameMgr.GetAttrSet() );
563 
564  // --> #i972#
565  if ( bStarMath && mxDoc->getIDocumentSettingAccess().get( DocumentSettingId::MATH_BASELINE_ALIGNMENT ) )
566  AlignFormulaToBaseline( xRef.GetObject() );
567 
568  if (pFlyFrameFormat)
569  *pFlyFrameFormat = pFormat;
570 
571  if ( SotExchange::IsChart( aCLSID ) )
572  {
573  uno::Reference< embed::XEmbeddedObject > xEmbeddedObj = xRef.GetObject();
574  if ( xEmbeddedObj.is() )
575  {
576  bool bDisableDataTableDialog = false;
578  uno::Reference< beans::XPropertySet > xProps( xEmbeddedObj->getComponent(), uno::UNO_QUERY );
579  if ( xProps.is() &&
580  ( xProps->getPropertyValue("DisableDataTableDialog") >>= bDisableDataTableDialog ) &&
581  bDisableDataTableDialog )
582  {
583  xProps->setPropertyValue("DisableDataTableDialog",
584  uno::makeAny( false ) );
585  xProps->setPropertyValue("DisableComplexChartTypes",
586  uno::makeAny( false ) );
587  uno::Reference< util::XModifiable > xModifiable( xProps, uno::UNO_QUERY );
588  if ( xModifiable.is() )
589  {
590  xModifiable->setModified( true );
591  }
592  }
593  }
594  }
595 
596  EndAllAction();
597  GetView().AutoCaption(OLE_CAP, &aCLSID);
598 
599  SwRewriter aRewriter;
600 
601  if ( bStarMath )
602  aRewriter.AddRule(UndoArg1, SwResId(STR_MATH_FORMULA));
603  else if ( SotExchange::IsChart( aCLSID ) )
604  aRewriter.AddRule(UndoArg1, SwResId(STR_CHART));
605  else
606  aRewriter.AddRule(UndoArg1, SwResId(STR_OLE));
607 
608  EndUndo(SwUndoId::INSERT, &aRewriter);
609 
610  rEmbeddedObjectContainer.setUserAllowsLinkUpdate(bSaveUserAllowsLinkUpdate);
611 
612  return bActivate;
613 }
614 
615 // The current selected OLE object will be loaded with the
616 // verb into the server.
617 void SwWrtShell::LaunchOLEObj(sal_Int32 nVerb)
618 {
619  if ( GetCntType() != CNT_OLE ||
620  GetView().GetViewFrame()->GetFrame().IsInPlace() )
621  return;
622 
623  svt::EmbeddedObjectRef& xRef = GetOLEObject();
624  OSL_ENSURE( xRef.is(), "OLE not found" );
625 
626  // LOK: we don't want to handle any other embedded objects than
627  // charts, there are too many problems with eg. embedded spreadsheets
628  // (like it creates a separate view for the calc sheet)
629  if (comphelper::LibreOfficeKit::isActive() && !SotExchange::IsChart(xRef->getClassID()))
630  return;
631 
632  SfxInPlaceClient* pCli = GetView().FindIPClient( xRef.GetObject(), &GetView().GetEditWin() );
633  if ( !pCli )
634  pCli = new SwOleClient( &GetView(), &GetView().GetEditWin(), xRef );
635 
636  uno::Reference<lang::XInitialization> xOLEInit(xRef.GetObject(), uno::UNO_QUERY);
637  if (xOLEInit.is())
638  {
639  uno::Sequence<beans::PropertyValue> aArguments
640  = { comphelper::makePropertyValue("ReadOnly", pCli->IsProtected()) };
641  xOLEInit->initialize({ uno::makeAny(aArguments) });
642  }
643 
644  static_cast<SwOleClient*>(pCli)->SetInDoVerb( true );
645 
646  CalcAndSetScale( xRef );
647  pCli->DoVerb( nVerb );
648 
649  static_cast<SwOleClient*>(pCli)->SetInDoVerb( false );
650  CalcAndSetScale( xRef );
651 }
652 
653 void SwWrtShell::MoveObjectIfActive( svt::EmbeddedObjectRef& xObj, const Point& rOffset )
654 {
655  try
656  {
657  sal_Int32 nState = xObj->getCurrentState();
658  if ( nState == css::embed::EmbedStates::INPLACE_ACTIVE
659  || nState == css::embed::EmbedStates::UI_ACTIVE )
660  {
661  SfxInPlaceClient* pCli =
662  GetView().FindIPClient( xObj.GetObject(), &(GetView().GetEditWin()) );
663  if ( pCli )
664  {
665  tools::Rectangle aArea = pCli->GetObjArea();
666  aArea += rOffset;
667  pCli->SetObjArea( aArea );
668  }
669  }
670  }
671  catch (const uno::Exception&)
672  {
673  }
674 }
675 
677  const SwRect *pFlyPrtRect,
678  const SwRect *pFlyFrameRect,
679  const bool bNoTextFramePrtAreaChanged )
680 {
681  // Setting the scale of the client. This arises from the difference
682  // between the VisArea of the object and the ObjArea.
683  OSL_ENSURE( xObj.is(), "ObjectRef not valid" );
684 
685  sal_Int64 nAspect = xObj.GetViewAspect();
686  if ( nAspect == embed::Aspects::MSOLE_ICON )
687  return; // the replacement image is completely controlled by container in this case
688 
689  sal_Int64 nMisc = 0;
690  bool bLinkingChart = false;
691 
692  try
693  {
694  nMisc = xObj->getStatus( nAspect );
695 
696  // This can surely only be a non-active object, if desired they
697  // get the new size set as VisArea (StarChart).
698  if( embed::EmbedMisc::MS_EMBED_RECOMPOSEONRESIZE & nMisc )
699  {
700  // TODO/MBA: testing
701  SwRect aRect( pFlyPrtRect ? *pFlyPrtRect
702  : GetAnyCurRect( CurRectType::FlyEmbeddedPrt, nullptr, xObj.GetObject() ));
703  if( !aRect.IsEmpty() )
704  {
705  // TODO/LEAN: getMapUnit can switch object to running state
706  // xObj.TryRunningState();
707 
708  MapUnit aUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( nAspect ) );
709 
710  // TODO/LATER: needs complete VisArea?!
711  Size aSize( OutputDevice::LogicToLogic(aRect.SVRect(), MapMode(MapUnit::MapTwip), MapMode(aUnit)).GetSize() );
712  awt::Size aSz;
713  aSz.Width = aSize.Width();
714  aSz.Height = aSize.Height();
715 
716  // Action 'setVisualAreaSize' doesn't have to turn on the
717  // modified state of the document, either.
718  bool bModified = false;
719  uno::Reference<util::XModifiable> xModifiable(xObj->getComponent(), uno::UNO_QUERY);
720  if (xModifiable.is())
721  bModified = xModifiable->isModified();
722  xObj->setVisualAreaSize( nAspect, aSz );
723  xModifiable.set(xObj->getComponent(), uno::UNO_QUERY);
724  if (xModifiable.is() && xModifiable->isModified() && !bModified)
725  xModifiable->setModified(bModified);
726 
727  // #i48419# - action 'UpdateReplacement' doesn't
728  // have to change the modified state of the document.
729  // This is only a workaround for the defect, that this action
730  // modifies a document after load, because unnecessarily the
731  // replacement graphic is updated, in spite of the fact that
732  // nothing has been changed.
733  // If the replacement graphic changes by this action, the document
734  // will be already modified via other mechanisms.
735  {
736  bool bResetEnableSetModified(false);
737  if ( GetDoc()->GetDocShell()->IsEnableSetModified() )
738  {
739  GetDoc()->GetDocShell()->EnableSetModified( false );
740  bResetEnableSetModified = true;
741  }
742 
743  //#i79576# don't destroy chart replacement images on load
744  //#i79578# don't request a new replacement image for charts to often
745  //a chart sends a modified call to the framework if it was changed
746  //thus the replacement update is already handled elsewhere
747  if ( !SotExchange::IsChart( xObj->getClassID() ) )
748  xObj.UpdateReplacement();
749 
750  if ( bResetEnableSetModified )
751  {
752  GetDoc()->GetDocShell()->EnableSetModified();
753  }
754  }
755  }
756 
757  // TODO/LATER: this is only a workaround,
758  uno::Reference< chart2::XChartDocument > xChartDocument( xObj->getComponent(), uno::UNO_QUERY );
759  bLinkingChart = ( xChartDocument.is() && !xChartDocument->hasInternalDataProvider() );
760  }
761  }
762  catch (const uno::Exception&)
763  {
764  // TODO/LATER: handle the error
765  return;
766  }
767 
768  SfxInPlaceClient* pCli = GetView().FindIPClient( xObj.GetObject(), &GetView().GetEditWin() );
769  if ( !pCli )
770  {
771  if ( (embed::EmbedMisc::EMBED_ACTIVATEIMMEDIATELY & nMisc)
772  || bLinkingChart
773  // --> OD #i117189# - refine condition for non-resizable objects
774  // non-resizable objects need to be set the size back by this method
775  || ( bNoTextFramePrtAreaChanged && nMisc & embed::EmbedMisc::EMBED_NEVERRESIZE ) )
776  {
777  pCli = new SwOleClient( &GetView(), &GetView().GetEditWin(), xObj );
778  }
779  else
780  return;
781  }
782 
783  // TODO/LEAN: getMapUnit can switch object to running state
784  // xObj.TryRunningState();
785 
786  awt::Size aSize;
787  try
788  {
789  aSize = xObj->getVisualAreaSize( nAspect );
790  }
791  catch (const embed::NoVisualAreaSizeException&)
792  {
793  OSL_FAIL("Can't get visual area size!" );
794  // the scaling will not be done
795  }
796  catch (const uno::Exception&)
797  {
798  // TODO/LATER: handle the error
799  OSL_FAIL("Can't get visual area size!" );
800  return;
801  }
802 
803  Size _aVisArea( aSize.Width, aSize.Height );
804 
805  Fraction aScaleWidth( 1, 1 );
806  Fraction aScaleHeight( 1, 1 );
807 
808  bool bUseObjectSize = false;
809 
810  // As long as there comes no reasonable size from the object,
811  // nothing can be scaled.
812  if( _aVisArea.Width() && _aVisArea.Height() )
813  {
814  const MapMode aTmp( MapUnit::MapTwip );
815  MapUnit aUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( nAspect ) );
816  _aVisArea = OutputDevice::LogicToLogic(_aVisArea, MapMode(aUnit), aTmp);
817  Size aObjArea;
818  if ( pFlyPrtRect )
819  aObjArea = pFlyPrtRect->SSize();
820  else
821  aObjArea = GetAnyCurRect( CurRectType::FlyEmbeddedPrt, nullptr, xObj.GetObject() ).SSize();
822 
823  // differ the aObjArea and _aVisArea by 1 Pixel then set new VisArea
824  tools::Long nX, nY;
825  SwSelPaintRects::Get1PixelInLogic( *this, &nX, &nY );
826  if( !( _aVisArea.Width() - nX <= aObjArea.Width() &&
827  _aVisArea.Width() + nX >= aObjArea.Width() &&
828  _aVisArea.Height()- nY <= aObjArea.Height()&&
829  _aVisArea.Height()+ nY >= aObjArea.Height() ))
830  {
831  if ( nMisc & embed::EmbedMisc::EMBED_NEVERRESIZE )
832  {
833  // the object must not be scaled,
834  // the size stored in object must be used for restoring
835  bUseObjectSize = true;
836  }
837  else
838  {
839  aScaleWidth = Fraction( aObjArea.Width(), _aVisArea.Width() );
840  aScaleHeight = Fraction( aObjArea.Height(), _aVisArea.Height());
841  }
842  }
843  }
844 
845  // Now is the favorable time to set the ObjArea.
846  // The Scaling must be considered.
847  SwRect aArea;
848  if ( pFlyPrtRect )
849  {
850  aArea = *pFlyPrtRect;
851  aArea += pFlyFrameRect->Pos();
852  }
853  else
854  {
855  aArea = GetAnyCurRect( CurRectType::FlyEmbeddedPrt, nullptr, xObj.GetObject() );
856  aArea.Pos() += GetAnyCurRect( CurRectType::FlyEmbedded, nullptr, xObj.GetObject() ).Pos();
857  }
858 
859  if ( bUseObjectSize )
860  {
861  // --> this moves non-resizable object so that when adding borders the baseline remains the same
862  const SwFlyFrameFormat *pFlyFrameFormat = dynamic_cast< const SwFlyFrameFormat * >( GetFlyFrameFormat() );
863  OSL_ENSURE( pFlyFrameFormat, "Could not find fly frame." );
864  if ( pFlyFrameFormat )
865  {
866  const Point &rPoint = pFlyFrameFormat->GetLastFlyFramePrtRectPos();
867  SwRect aRect( pFlyPrtRect ? *pFlyPrtRect
868  : GetAnyCurRect( CurRectType::FlyEmbeddedPrt, nullptr, xObj.GetObject() ));
869  aArea += rPoint - aRect.Pos(); // adjust area by diff of printing area position in order to keep baseline alignment correct.
870  }
871  aArea.Width ( _aVisArea.Width() );
872  aArea.Height( _aVisArea.Height() );
873  RequestObjectResize( aArea, xObj.GetObject() );
874  }
875  else
876  {
877  aArea.Width ( tools::Long( aArea.Width() / pCli->GetScaleWidth() ) );
878  aArea.Height( tools::Long( aArea.Height() / pCli->GetScaleHeight() ) );
879  }
880 
881  pCli->SetObjAreaAndScale( aArea.SVRect(), aScaleWidth, aScaleHeight );
882 }
883 
885  const SwRect &rFrame )
886 {
887  SfxInPlaceClient* pCli = GetView().FindIPClient( xObj.GetObject(), &GetView().GetEditWin());
888  if ( !pCli )
889  new SwOleClient( &GetView(), &GetView().GetEditWin(), xObj );
890  CalcAndSetScale( xObj, &rPrt, &rFrame );
891 }
892 
893 // Insert hard page break;
894 // Selections will be overwritten
895 void SwWrtShell::InsertPageBreak(const OUString *pPageDesc, const ::std::optional<sal_uInt16>& oPgNum )
896 {
897  if (!lcl_IsAllowed(this))
898  return;
899 
900  ResetCursorStack();
901  if( CanInsert() )
902  {
903  SwActContext aActContext(this);
905 
906  if ( !IsCursorInTable() )
907  {
908  if(HasSelection())
909  DelRight();
911  // delete the numbered attribute of the last line if the last line is empty
912  GetDoc()->ClearLineNumAttrs( *GetCursor()->GetPoint() );
913  }
914 
915  const SwPageDesc *pDesc = pPageDesc
916  ? FindPageDescByName( *pPageDesc, true ) : nullptr;
917  if( pDesc )
918  {
919  SwFormatPageDesc aDesc( pDesc );
920  aDesc.SetNumOffset( oPgNum );
921  SetAttrItem( aDesc );
922  }
923  else
924  SetAttrItem( SvxFormatBreakItem(SvxBreak::PageBefore, RES_BREAK) );
926  }
927  collectUIInformation("BREAK_PAGE", "parameter");
928 }
929 
930 // Insert hard page break;
931 // Selections will be overwritten
932 
934 {
935  if (!lcl_IsAllowed(this))
936  return;
937 
938  ResetCursorStack();
939  if( CanInsert() )
940  {
941  if(HasSelection())
942  DelRight();
943 
944  const sal_Unicode cIns = 0x0A;
945  SvxAutoCorrect* pACorr = lcl_IsAutoCorr();
946  if( pACorr )
947  AutoCorrect( *pACorr, cIns );
948  else
949  SwWrtShell::Insert( OUString( cIns ) );
950  }
951 }
952 
953 // Insert hard column break;
954 // Selections will be overwritten
955 
957 {
958  if (!lcl_IsAllowed(this))
959  return;
960 
961  SwActContext aActContext(this);
962  ResetCursorStack();
963  if( !CanInsert() )
964  return;
965 
967 
968  if ( !IsCursorInTable() )
969  {
970  if(HasSelection())
971  DelRight();
972  SwFEShell::SplitNode( false, false );
973  }
974  SetAttrItem(SvxFormatBreakItem(SvxBreak::ColumnBefore, RES_BREAK));
975 
977 }
978 
979 // Insert footnote
980 // rStr - optional footnote mark
981 
982 void SwWrtShell::InsertFootnote(const OUString &rStr, bool bEndNote, bool bEdit )
983 {
984  ResetCursorStack();
985  if( !CanInsert() )
986  return;
987 
988  if(HasSelection())
989  {
990  //collapse cursor to the end
991  if(!IsCursorPtAtEnd())
992  SwapPam();
993  ClearMark();
994  }
995  SwPosition aPos = *GetCursor()->GetPoint();
996  SwFormatFootnote aFootNote( bEndNote );
997  if(!rStr.isEmpty())
998  aFootNote.SetNumStr( rStr );
999 
1000  SetAttrItem(aFootNote);
1001 
1002  if( bEdit )
1003  {
1004  // For editing the footnote text.
1005  Left(CRSR_SKIP_CHARS, false, 1, false );
1006  GotoFootnoteText();
1007  }
1008  m_aNavigationMgr.addEntry(aPos);
1009 }
1010 
1011 // tdf#141634
1013 {
1014  SwTextNode* pTextNode = pThis->GetCursor()->GetNode().GetTextNode();
1015  if (pTextNode && pTextNode->IsOutline())
1016  {
1017  bool bVisible = true;
1018  pTextNode->GetAttrOutlineContentVisible(bVisible);
1019  if (!bVisible)
1020  {
1021  const SwNodes& rNodes = pThis->GetNodes();
1022  const SwOutlineNodes& rOutlineNodes = rNodes.GetOutLineNds();
1024  (void) rOutlineNodes.Seek_Entry(pTextNode, &nPos);
1025 
1026  SwNode* pSttNd = rOutlineNodes[nPos];
1027 
1028  // determine end node of folded outline content
1029  SwNode* pEndNd = &rNodes.GetEndOfContent();
1030  if (rOutlineNodes.size() > nPos + 1)
1031  pEndNd = rOutlineNodes[nPos + 1];
1032 
1034  {
1035  // get the next outline node after the folded outline content (iPos)
1036  // it is the next outline node with the same level or less
1037  int nLevel = pSttNd->GetTextNode()->GetAttrOutlineLevel();
1038  SwOutlineNodes::size_type iPos = nPos;
1039  while (++iPos < rOutlineNodes.size() &&
1040  rOutlineNodes[iPos]->GetTextNode()->GetAttrOutlineLevel() > nLevel);
1041 
1042  // get the correct end node
1043  // the outline node may be in frames, headers, footers special section of doc model
1044  SwNode* pStartOfSectionNodeSttNd = pSttNd->StartOfSectionNode();
1045  while (pStartOfSectionNodeSttNd->StartOfSectionNode()
1046  != pStartOfSectionNodeSttNd->StartOfSectionNode()->StartOfSectionNode())
1047  {
1048  pStartOfSectionNodeSttNd = pStartOfSectionNodeSttNd->StartOfSectionNode();
1049  }
1050  pEndNd = pStartOfSectionNodeSttNd->EndOfSectionNode();
1051 
1052  if (iPos < rOutlineNodes.size())
1053  {
1054  SwNode* pStartOfSectionNode = rOutlineNodes[iPos]->StartOfSectionNode();
1055  while (pStartOfSectionNode->StartOfSectionNode()
1056  != pStartOfSectionNode->StartOfSectionNode()->StartOfSectionNode())
1057  {
1058  pStartOfSectionNode = pStartOfSectionNode->StartOfSectionNode();
1059  }
1060  if (pStartOfSectionNodeSttNd == pStartOfSectionNode)
1061  pEndNd = rOutlineNodes[iPos];
1062  }
1063  }
1064 
1065  // table, text box, header, footer
1066  if (pSttNd->GetTableBox() || pSttNd->GetIndex() < rNodes.GetEndOfExtras().GetIndex())
1067  {
1068  // insert before section end node
1069  if (pSttNd->EndOfSectionIndex() < pEndNd->GetIndex())
1070  {
1071  SwNodeIndex aIdx(*pSttNd->EndOfSectionNode());
1072  while (aIdx.GetNode().IsEndNode())
1073  --aIdx;
1074  ++aIdx;
1075  pEndNd = &aIdx.GetNode();
1076  }
1077  }
1078  // if pSttNd isn't in table but pEndNd is then insert after table
1079  else if (pEndNd->GetTableBox())
1080  {
1081  pEndNd = pEndNd->FindTableNode();
1082  SwNodeIndex aIdx(*pEndNd, -1);
1083  // account for nested tables
1084  while (aIdx.GetNode().GetTableBox())
1085  {
1086  pEndNd = aIdx.GetNode().FindTableNode();
1087  aIdx.Assign(*pEndNd, -1);
1088  }
1089  aIdx.Assign(*pEndNd->EndOfSectionNode(), +1);
1090  pEndNd = &aIdx.GetNode();
1091  }
1092  // end node determined
1093 
1094  // now insert the new outline node
1095  SwDoc* pDoc = pThis->GetDoc();
1096 
1097  // insert at end of tablebox doesn't work correct without
1099 
1100  SwTextNode* pNd = pDoc->GetNodes().MakeTextNode(*pEndNd, pTextNode->GetTextColl(), true);
1101 
1102  (void) rOutlineNodes.Seek_Entry(pNd, &nPos);
1103  pThis->GotoOutline(nPos);
1104 
1105  if (pDoc->GetIDocumentUndoRedo().DoesUndo())
1106  {
1107  pDoc->GetIDocumentUndoRedo().ClearRedo();
1108  pDoc->GetIDocumentUndoRedo().AppendUndo(std::make_unique<SwUndoInsert>(*pNd));
1109  pDoc->GetIDocumentUndoRedo().AppendUndo(std::make_unique<SwUndoFormatColl>
1110  (*pNd, pNd->GetTextColl(), true, true));
1111  }
1112 
1113  pThis->SetModified();
1114  return true;
1115  }
1116  }
1117  return false;
1118 }
1119 
1120 // SplitNode; also, because
1121 // - of deleting selected content;
1122 // - of reset of the Cursorstack if necessary.
1123 
1124 void SwWrtShell::SplitNode( bool bAutoFormat )
1125 {
1126  ResetCursorStack();
1127  if( !CanInsert() )
1128  return;
1129 
1130  SwActContext aActContext(this);
1131 
1132  m_rView.GetEditWin().FlushInBuffer();
1133  StartUndo(SwUndoId::SPLITNODE);
1134 
1135  bool bHasSel = HasSelection();
1136  if (bHasSel)
1137  DelRight();
1138 
1139  bool bHandled = false;
1140  if (GetViewOptions()->IsShowOutlineContentVisibilityButton() && IsEndPara())
1141  bHandled = lcl_FoldedOutlineNodeEndOfParaSplit(this);
1142 
1143  if (!bHandled)
1144  SwFEShell::SplitNode( bAutoFormat );
1145 
1147 }
1148 
1149 // Turn on numbering
1150 // Parameter: Optional specification of a name for the named list;
1151 // this indicates a position if it is possible to convert them
1152 // into a number and less than nMaxRules.
1153 
1154 // To test the CharFormats at the numbering
1155 // external void SetNumChrFormat( SwWrtShell*, SwNumRules& );
1156 
1157 // -> #i40041#
1158 // Preconditions (as far as OD has figured out):
1159 // - <SwEditShell::HasNumber()> is false, if <bNum> is true
1160 // - <SwEditShell::HasBullet()> is false, if <bNum> is false
1161 // Behavior of method is determined by the current situation at the current
1162 // cursor position in the document.
1164 {
1165  // determine numbering rule found at current cursor position in the document.
1166  const SwNumRule* pCurRule = GetNumRuleAtCurrCursorPos();
1167 
1168  StartUndo(SwUndoId::NUMORNONUM);
1169 
1170  const SwNumRule * pNumRule = pCurRule;
1171 
1172  // - activate outline rule respectively turning on outline rule for
1173  // current text node. But, only for turning on a numbering (<bNum> == true).
1174  // - overwrite found numbering rule at current cursor position, if
1175  // no numbering rule can be retrieved from the paragraph style.
1176  bool bContinueFoundNumRule( false );
1177  bool bActivateOutlineRule( false );
1178  int nActivateOutlineLvl( MAXLEVEL ); // only relevant, if <bActivateOutlineRule> == true
1180  if ( pColl )
1181  {
1182  // retrieve numbering rule at paragraph
1183  // style, which is found at current cursor position in the document.
1184  SwNumRule* pCollRule = mxDoc->FindNumRulePtr(pColl->GetNumRule().GetValue());
1185  // #125993# - The outline numbering rule isn't allowed
1186  // to be derived from a parent paragraph style to a derived one.
1187  // Thus check, if the found outline numbering rule is directly
1188  // set at the paragraph style <pColl>. If not, set <pCollRule> to NULL
1189  if ( pCollRule && pCollRule == GetDoc()->GetOutlineNumRule() )
1190  {
1191  const SwNumRule* pDirectCollRule =
1192  mxDoc->FindNumRulePtr(pColl->GetNumRule( false ).GetValue());
1193  if ( !pDirectCollRule )
1194  {
1195  pCollRule = nullptr;
1196  }
1197  }
1198 
1199  if ( !pCollRule )
1200  {
1201  pNumRule = pCollRule;
1202  }
1203  // no activation or continuation of outline numbering in Writer/Web document
1204  else if ( bNum &&
1205  !dynamic_cast<SwWebDocShell*>(GetDoc()->GetDocShell()) &&
1206  pCollRule == GetDoc()->GetOutlineNumRule() )
1207  {
1208  if ( pNumRule == pCollRule )
1209  {
1210  // check, if text node at current cursor positioned is counted.
1211  // If not, let it been counted. Then it has to be checked,
1212  // of the outline numbering has to be activated or continued.
1213  SwTextNode const*const pTextNode = sw::GetParaPropsNode(
1214  *GetLayout(), GetCursor()->GetPoint()->nNode);
1215  if ( pTextNode && !pTextNode->IsCountedInList() )
1216  {
1217  // check, if numbering of the outline level of the paragraph
1218  // style is active. If not, activate this outline level.
1219  nActivateOutlineLvl = pColl->GetAssignedOutlineStyleLevel();
1220  OSL_ENSURE( pColl->IsAssignedToListLevelOfOutlineStyle(),
1221  "<SwWrtShell::NumOrBulletOn(..)> - paragraph style with outline rule, but no outline level" );
1222  if ( pColl->IsAssignedToListLevelOfOutlineStyle() &&
1223  pCollRule->Get( o3tl::narrowing<sal_uInt16>(nActivateOutlineLvl) ).GetNumberingType()
1224  == SVX_NUM_NUMBER_NONE )
1225  {
1226  // activate outline numbering
1227  bActivateOutlineRule = true;
1228  }
1229  else
1230  {
1231  // turning on outline numbering at current cursor position
1232  bContinueFoundNumRule = true;
1233  }
1234  }
1235  else
1236  {
1237  // #i101234#
1238  // activate outline numbering, because from the precondition
1239  // it's known, that <SwEdit::HasNumber()> == false
1240  bActivateOutlineRule = true;
1241  nActivateOutlineLvl = pColl->GetAssignedOutlineStyleLevel();
1242  }
1243  }
1244  else if ( !pNumRule )
1245  {
1246  // #i101234#
1247  // Check, if corresponding list level of the outline numbering
1248  // has already a numbering format set.
1249  nActivateOutlineLvl = pColl->GetAssignedOutlineStyleLevel();
1250  if ( pCollRule->Get( o3tl::narrowing<sal_uInt16>(nActivateOutlineLvl) ).GetNumberingType()
1251  == SVX_NUM_NUMBER_NONE )
1252  {
1253  // activate outline numbering, because from the precondition
1254  // it's known, that <SwEdit::HasNumber()> == false
1255  bActivateOutlineRule = true;
1256  }
1257  else
1258  {
1259  // turning on outline numbering at current cursor position
1260  bContinueFoundNumRule = true;
1261  }
1262  }
1263  else
1264  {
1265  // check, if numbering of the outline level of the paragraph
1266  // style is active. If not, activate this outline level.
1267  nActivateOutlineLvl = pColl->GetAssignedOutlineStyleLevel();
1268  OSL_ENSURE( pColl->IsAssignedToListLevelOfOutlineStyle(),
1269  "<SwWrtShell::NumOrBulletOn(..)> - paragraph style with outline rule, but no outline level" );
1270  if ( pColl->IsAssignedToListLevelOfOutlineStyle() &&
1271  pCollRule->Get( o3tl::narrowing<sal_uInt16>(nActivateOutlineLvl) ).GetNumberingType()
1272  == SVX_NUM_NUMBER_NONE )
1273  {
1274  // activate outline numbering
1275  bActivateOutlineRule = true;
1276  }
1277  else
1278  {
1279  // turning on outline numbering at current cursor position
1280  bContinueFoundNumRule = true;
1281  }
1282  }
1283  pNumRule = pCollRule;
1284  }
1285  }
1286 
1287  // Only automatic numbering/bullet rules should be changed.
1288  // Note: The outline numbering rule is also an automatic one. It's only
1289  // changed, if it has to be activated.
1290  if ( pNumRule )
1291  {
1292  if ( !pNumRule->IsAutoRule() )
1293  {
1294  pNumRule = nullptr;
1295  }
1296  else if ( pNumRule == GetDoc()->GetOutlineNumRule() &&
1297  !bActivateOutlineRule && !bContinueFoundNumRule )
1298  {
1299  pNumRule = nullptr;
1300  }
1301  }
1302 
1303  // Search for a previous numbering/bullet rule to continue it.
1304  OUString sContinuedListId;
1305  if ( !pNumRule )
1306  {
1307  pNumRule = GetDoc()->SearchNumRule( *GetCursor()->GetPoint(),
1308  false, bNum, false, 0,
1309  sContinuedListId, GetLayout() );
1310  bContinueFoundNumRule = pNumRule != nullptr;
1311  }
1312 
1313  if (pNumRule)
1314  {
1315  SwNumRule aNumRule(*pNumRule);
1316 
1317  // do not change found numbering/bullet rule, if it should only be continued.
1318  if ( !bContinueFoundNumRule )
1319  {
1320  SwTextNode const*const pTextNode = sw::GetParaPropsNode(
1321  *GetLayout(), GetCursor()->GetPoint()->nNode);
1322 
1323  if (pTextNode)
1324  {
1325  // use above retrieve outline level, if outline numbering has to be activated.
1326  int nLevel = bActivateOutlineRule
1327  ? nActivateOutlineLvl
1328  : pTextNode->GetActualListLevel();
1329 
1330  if (nLevel < 0)
1331  nLevel = 0;
1332 
1333  if (nLevel >= MAXLEVEL)
1334  nLevel = MAXLEVEL - 1;
1335 
1336  SwNumFormat aFormat(aNumRule.Get(o3tl::narrowing<sal_uInt16>(nLevel)));
1337 
1338  if (bNum)
1340  else
1341  {
1342  // #i63395# Only apply user defined default bullet font
1344  {
1345  const vcl::Font* pFnt = &numfunc::GetDefBulletFont();
1346  aFormat.SetBulletFont( pFnt );
1347  }
1348  aFormat.SetBulletChar( numfunc::GetBulletChar(static_cast<sal_uInt8>(nLevel)));
1349  aFormat.SetNumberingType(SVX_NUM_CHAR_SPECIAL);
1350  // #i93908# clear suffix for bullet lists
1351  aFormat.SetPrefix(OUString());
1352  aFormat.SetSuffix(OUString());
1353  }
1354  aNumRule.Set(o3tl::narrowing<sal_uInt16>(nLevel), aFormat);
1355  }
1356  }
1357 
1358  // reset indent attribute on applying list style
1359  SetCurNumRule( aNumRule, false, sContinuedListId, true );
1360  }
1361  else
1362  {
1363  // #i95907#
1364  const SvxNumberFormat::SvxNumPositionAndSpaceMode ePosAndSpaceMode(
1366  SwNumRule aNumRule( GetUniqueNumRuleName(), ePosAndSpaceMode );
1367  // Append the character template at the numbering.
1368  SwCharFormat* pChrFormat;
1369  SwDocShell* pDocSh = GetView().GetDocShell();
1370  // #i63395#
1371  // Only apply user defined default bullet font
1374  : nullptr;
1375 
1376  if (bNum)
1377  {
1378  pChrFormat = GetCharFormatFromPool( RES_POOLCHR_NUM_LEVEL );
1379  }
1380  else
1381  {
1382  pChrFormat = GetCharFormatFromPool( RES_POOLCHR_BULLET_LEVEL );
1383  }
1384 
1385  const SwTextNode *const pTextNode = sw::GetParaPropsNode(*GetLayout(),
1386  GetCursor()->GetPoint()->nNode);
1387  const SwTwips nWidthOfTabs = pTextNode
1388  ? pTextNode->GetWidthOfLeadingTabs()
1389  : 0;
1390  GetDoc()->getIDocumentContentOperations().RemoveLeadingWhiteSpace( *GetCursor()->GetPoint() );
1391 
1392  const bool bHtml = dynamic_cast<SwWebDocShell*>( pDocSh ) != nullptr;
1393  const bool bRightToLeft = IsInRightToLeftText();
1394  for( sal_uInt8 nLvl = 0; nLvl < MAXLEVEL; ++nLvl )
1395  {
1396  SwNumFormat aFormat( aNumRule.Get( nLvl ) );
1397  aFormat.SetCharFormat( pChrFormat );
1398 
1399  if (! bNum)
1400  {
1401  // #i63395#
1402  // Only apply user defined default bullet font
1403  if ( pFnt )
1404  {
1405  aFormat.SetBulletFont( pFnt );
1406  }
1407  aFormat.SetBulletChar( numfunc::GetBulletChar(nLvl) );
1408  aFormat.SetNumberingType(SVX_NUM_CHAR_SPECIAL);
1409  // #i93908# clear suffix for bullet lists
1410  aFormat.SetPrefix(OUString());
1411  aFormat.SetSuffix(OUString());
1412  }
1413 
1414  // #i95907#
1415  if ( ePosAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
1416  {
1417  if(bHtml && nLvl)
1418  {
1419  // 1/2" for HTML
1420  aFormat.SetAbsLSpace(nLvl * 720);
1421  }
1422  else if ( nWidthOfTabs > 0 )
1423  {
1424  aFormat.SetAbsLSpace(nWidthOfTabs + nLvl * 720);
1425  }
1426  }
1427 
1428  // #i38904# Default alignment for
1429  // numbering/bullet should be rtl in rtl paragraph:
1430  if ( bRightToLeft )
1431  {
1432  aFormat.SetNumAdjust( SvxAdjust::Right );
1433  }
1434 
1435  aNumRule.Set( nLvl, aFormat );
1436  }
1437 
1438  // #i95907#
1439  if ( pTextNode &&
1440  ePosAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
1441  {
1442 
1443  const SwTwips nTextNodeIndent = pTextNode->GetAdditionalIndentForStartingNewList();
1444  if ( ( nTextNodeIndent + nWidthOfTabs ) != 0 )
1445  {
1446  // #i111172#/fdo#85666
1447  // If text node is already inside a list, assure that the indents
1448  // are the same. Thus, adjust the indent change value by subtracting
1449  // indents of to be applied list style.
1450  SwTwips nIndentChange = nTextNodeIndent + nWidthOfTabs;
1451  if ( pTextNode->GetNumRule() )
1452  {
1453  int nLevel = pTextNode->GetActualListLevel();
1454 
1455  if (nLevel < 0)
1456  nLevel = 0;
1457 
1458  if (nLevel >= MAXLEVEL)
1459  nLevel = MAXLEVEL - 1;
1460 
1461  const SwNumFormat& aFormat( aNumRule.Get( nLevel ) );
1462  if ( aFormat.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT )
1463  {
1464  nIndentChange -= aFormat.GetIndentAt() + aFormat.GetFirstLineIndent();
1465  }
1466  }
1467  aNumRule.ChangeIndent( nIndentChange );
1468  }
1469  }
1470  // reset indent attribute on applying list style
1471  // start new list
1472  SetCurNumRule( aNumRule, true, OUString(), true );
1473  }
1474 
1476 }
1477 // <- #i40041#
1478 
1480 {
1481  NumOrBulletOn(true);
1482 }
1483 
1485 {
1486  const SwNumRule * pCurNumRule = GetNumRuleAtCurrCursorPos();
1487 
1488  if (!pCurNumRule)
1489  return;
1490 
1491  if (pCurNumRule->IsOutlineRule())
1492  {
1493  SwNumRule aNumRule(*pCurNumRule);
1494 
1495  SwTextNode * pTextNode =
1496  sw::GetParaPropsNode(*GetLayout(), GetCursor()->GetPoint()->nNode);
1497 
1498  if (pTextNode)
1499  {
1500  int nLevel = pTextNode->GetActualListLevel();
1501 
1502  if (nLevel < 0)
1503  nLevel = 0;
1504 
1505  if (nLevel >= MAXLEVEL)
1506  nLevel = MAXLEVEL - 1;
1507 
1508  SwNumFormat aFormat(aNumRule.Get(o3tl::narrowing<sal_uInt16>(nLevel)));
1509 
1511  aNumRule.Set(nLevel, aFormat);
1512 
1513  // no start or continuation of a list - the outline style is only changed.
1514  SetCurNumRule( aNumRule, false );
1515  }
1516  }
1517  else
1518  {
1519  DelNumRules();
1520  }
1521 
1522  // #126346# - Cursor can not be anymore in front of
1523  // a label, because numbering/bullet is switched off.
1524  SetInFrontOfLabel( false );
1525 }
1526 // <- #i29560#
1527 
1528 // Request Default-Bulletlist
1529 
1531 {
1532  NumOrBulletOn(false);
1533 }
1534 
1536 {
1537  // ContentType cannot be determined within a Start-/EndAction.
1538  // Because there is no invalid value TEXT will be returned.
1539  // The value does not matter, it may be updated in EndAction anyway.
1540 
1541  if (ActionPend())
1542  return IsSelFrameMode() ? SelectionType::Frame : SelectionType::Text;
1543 
1544  SwView &_rView = const_cast<SwView&>(GetView());
1545  if (_rView.GetPostItMgr() && _rView.GetPostItMgr()->HasActiveSidebarWin() )
1546  return SelectionType::PostIt;
1547 
1548  // Inserting a frame is not a DrawMode
1549  SelectionType nCnt;
1550  if ( !_rView.GetEditWin().IsFrameAction() &&
1551  (IsObjSelected() || (_rView.IsDrawMode() && !IsFrameSelected()) ))
1552  {
1553  if (GetDrawView()->IsTextEdit())
1555  else
1556  {
1557  if (GetView().IsFormMode()) // Only Form selected
1558  nCnt = SelectionType::DbForm;
1559  else
1560  nCnt = SelectionType::DrawObject; // Any draw object
1561 
1562  if (_rView.IsBezierEditMode())
1563  nCnt |= SelectionType::Ornament;
1564  else if( GetDrawView()->GetContext() == SdrViewContext::Media )
1565  nCnt |= SelectionType::Media;
1566 
1567  if (svx::checkForSelectedCustomShapes( GetDrawView(), true /* bOnlyExtruded */ ))
1568  {
1570  }
1571 
1572  if (svx::checkForSelectedFontWork( GetDrawView() ))
1573  {
1574  nCnt |= SelectionType::FontWork;
1575  }
1576  }
1577 
1578  return nCnt;
1579  }
1580 
1581  nCnt = static_cast<SelectionType>(GetCntType());
1582 
1583  if ( IsFrameSelected() )
1584  {
1585  if (_rView.IsDrawMode())
1586  _rView.LeaveDrawCreate(); // clean up (Bug #45639)
1587  if ( !(nCnt & (SelectionType::Graphic | SelectionType::Ole)) )
1588  return SelectionType::Frame;
1589  }
1590 
1591  if ( IsCursorInTable() )
1592  nCnt |= SelectionType::Table;
1593 
1594  if ( IsTableMode() )
1595  {
1597  SwTable::SearchType eTableSel = GetEnhancedTableSelection();
1598  if ( eTableSel == SwTable::SEARCH_ROW )
1599  nCnt |= SelectionType::TableRow;
1600  else if ( eTableSel == SwTable::SEARCH_COL )
1601  nCnt |= SelectionType::TableCol;
1602  }
1603 
1604  // Do not pop up numbering toolbar, if the text node has a numbering of type SVX_NUM_NUMBER_NONE.
1605  const SwNumRule* pNumRule = GetNumRuleAtCurrCursorPos();
1606  if ( pNumRule )
1607  {
1608  const SwTextNode* pTextNd =
1609  sw::GetParaPropsNode(*GetLayout(), GetCursor()->GetPoint()->nNode);
1610 
1611  if ( pTextNd && pTextNd->IsInList() )
1612  {
1613  int nLevel = pTextNd->GetActualListLevel();
1614 
1615  if (nLevel < 0)
1616  nLevel = 0;
1617 
1618  if (nLevel >= MAXLEVEL)
1619  nLevel = MAXLEVEL - 1;
1620 
1621  const SwNumFormat& rFormat = pNumRule->Get(nLevel);
1622  if ( SVX_NUM_NUMBER_NONE != rFormat.GetNumberingType() )
1623  nCnt |= SelectionType::NumberList;
1624  }
1625  }
1626 
1627  return nCnt;
1628 }
1629 
1630 // Find the text collection with the name rCollname
1631 // Returns: Pointer at the collection or 0, if no
1632 // text collection with this name exists, or
1633 // this is a default template.
1634 
1635 SwTextFormatColl *SwWrtShell::GetParaStyle(const OUString &rCollName, GetStyle eCreate )
1636 {
1637  SwTextFormatColl* pColl = FindTextFormatCollByName( rCollName );
1638  if( !pColl && GETSTYLE_NOCREATE != eCreate )
1639  {
1641  if( USHRT_MAX != nId || GETSTYLE_CREATEANY == eCreate )
1642  pColl = GetTextCollFromPool( nId );
1643  }
1644  return pColl;
1645 }
1646 
1647 // Find the text collection with the name rCollname
1648 // Returns: Pointer at the collection or 0, if no
1649 // character template with this name exists, or
1650 // this is a default template or template is automatic.
1651 
1652 SwCharFormat *SwWrtShell::GetCharStyle(const OUString &rFormatName, GetStyle eCreate )
1653 {
1654  SwCharFormat* pFormat = FindCharFormatByName( rFormatName );
1655  if( !pFormat && GETSTYLE_NOCREATE != eCreate )
1656  {
1658  if( USHRT_MAX != nId || GETSTYLE_CREATEANY == eCreate )
1659  pFormat = static_cast<SwCharFormat*>(GetFormatFromPool( nId ));
1660  }
1661  return pFormat;
1662 }
1663 
1664 // Find the table format with the name rFormatname
1665 // Returns: Pointer at the collection or 0, if no
1666 // frame format with this name exists or
1667 // this is a default format or the format is automatic.
1668 
1669 SwFrameFormat *SwWrtShell::GetTableStyle(std::u16string_view rFormatName)
1670 {
1671  for( size_t i = GetTableFrameFormatCount(); i; )
1672  {
1673  SwFrameFormat *pFormat = &GetTableFrameFormat( --i );
1674  if( !pFormat->IsDefault() &&
1675  pFormat->GetName() == rFormatName && IsUsed( *pFormat ) )
1676  return pFormat;
1677  }
1678  return nullptr;
1679 }
1680 
1682  SwPaM* pPaM = GetCursor();
1683  m_aNavigationMgr.addEntry(*pPaM->GetPoint());
1684 }
1685 
1686 // Applying templates
1687 
1688 void SwWrtShell::SetPageStyle(const OUString &rCollName)
1689 {
1690  if( !SwCursorShell::HasSelection() && !IsSelFrameMode() && !IsObjSelected() )
1691  {
1692  SwPageDesc* pDesc = FindPageDescByName( rCollName, true );
1693  if( pDesc )
1694  ChgCurPageDesc( *pDesc );
1695  }
1696 }
1697 
1698 // Access templates
1699 
1700 OUString const & SwWrtShell::GetCurPageStyle() const
1701 {
1702  return GetPageDesc(GetCurPageDesc( false/*bCalcFrame*/ )).GetName();
1703 }
1704 
1705 // Change the current template referring to the existing change.
1706 
1708 {
1710 
1711  // Default cannot be changed
1712  if(pColl && !pColl->IsDefault())
1713  {
1714  FillByEx(pColl);
1715  // Also apply the template to remove hard attribute assignment.
1716  SetTextFormatColl(pColl);
1717  }
1718 }
1719 
1720 void SwWrtShell::AutoUpdatePara(SwTextFormatColl* pColl, const SfxItemSet& rStyleSet, SwPaM* pPaM )
1721 {
1722  SwPaM* pCursor = pPaM ? pPaM : GetCursor( );
1727  SID_ATTR_TABSTOP_DEFAULTS,SID_ATTR_TABSTOP_OFFSET,
1728  SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER,
1729  SID_ATTR_PARA_MODEL, SID_ATTR_PARA_KEEP,
1730  SID_ATTR_PARA_PAGENUM, SID_ATTR_PARA_PAGENUM> aCoreSet( GetAttrPool() );
1731  GetPaMAttr( pCursor, aCoreSet );
1732  bool bReset = false;
1733  SfxItemIter aParaIter( aCoreSet );
1734  for (auto pParaItem = aParaIter.GetCurItem(); pParaItem; pParaItem = aParaIter.NextItem())
1735  {
1736  if(!IsInvalidItem(pParaItem))
1737  {
1738  sal_uInt16 nWhich = pParaItem->Which();
1739  if(SfxItemState::SET == aCoreSet.GetItemState(nWhich) &&
1740  SfxItemState::SET == rStyleSet.GetItemState(nWhich))
1741  {
1742  aCoreSet.ClearItem(nWhich);
1743  bReset = true;
1744  }
1745  }
1746  }
1747  StartAction();
1748  if(bReset)
1749  {
1750  ResetAttr({}, pCursor);
1751  SetAttrSet(aCoreSet, SetAttrMode::DEFAULT, pCursor);
1752  }
1753  mxDoc->ChgFormat(*pColl, rStyleSet );
1754  EndAction();
1755 }
1756 
1757 void SwWrtShell::AutoUpdateFrame( SwFrameFormat* pFormat, const SfxItemSet& rStyleSet )
1758 {
1759  StartAction();
1760 
1761  ResetFlyFrameAttr( &rStyleSet );
1762  pFormat->SetFormatAttr( rStyleSet );
1763 
1764  EndAction();
1765 }
1766 
1768 {
1769  ResetCursorStack();
1770  if(!CanInsert())
1771  return;
1772 
1773  bool bStarted = false;
1774  SwRewriter aRewriter;
1775 
1776  if(HasSelection())
1777  {
1778  // Only parentheses here, because the regular insert
1779  // is already clipped to the editshell
1780  StartAllAction();
1781 
1782  OUString aTmpStr1 = SwResId(STR_START_QUOTE) +
1783  GetSelText() +
1784  SwResId(STR_END_QUOTE);
1785  OUString aTmpStr3 = SwResId(STR_START_QUOTE) +
1786  OUStringChar(cChar) +
1787  SwResId(STR_END_QUOTE);
1788  aRewriter.AddRule( UndoArg1, aTmpStr1 );
1789  aRewriter.AddRule( UndoArg2, SwResId(STR_YIELDS) );
1790  aRewriter.AddRule( UndoArg3, aTmpStr3 );
1791 
1792  StartUndo( SwUndoId::REPLACE, &aRewriter );
1793  bStarted = true;
1794  DelRight();
1795  }
1796  SwEditShell::AutoCorrect( rACorr, IsInsMode(), cChar );
1797 
1798  if(bStarted)
1799  {
1800  EndAllAction();
1801  EndUndo( SwUndoId::REPLACE, &aRewriter );
1802  }
1803 }
1804 
1805 // Some kind of controlled copy ctor
1806 
1808  : SwFEShell(rSh, _pWin)
1809  , m_rView(rShell)
1810  , m_aNavigationMgr(*this)
1811 {
1813  CurrShell aCurr( this );
1814 
1815  SetSfxViewShell( static_cast<SfxViewShell *>(&rShell) );
1816  SetFlyMacroLnk( LINK(this, SwWrtShell, ExecFlyMac) );
1817 
1818  // place the cursor on the first field...
1819  IFieldmark *pBM = nullptr;
1820  if ( IsFormProtected() && ( pBM = GetFieldmarkAfter( ) ) !=nullptr ) {
1821  GotoFieldmark(pBM);
1822  }
1823 }
1824 
1826  const SwViewOption *pViewOpt )
1827  : SwFEShell(rDoc, _pWin, pViewOpt)
1828  , m_rView(rShell)
1829  , m_aNavigationMgr(*this)
1830 {
1832  CurrShell aCurr( this );
1833  SetSfxViewShell( static_cast<SfxViewShell *>(&rShell) );
1834  SetFlyMacroLnk( LINK(this, SwWrtShell, ExecFlyMac) );
1835 
1836  // place the cursor on the first field...
1837  IFieldmark *pBM = nullptr;
1838  if ( IsFormProtected() && ( pBM = GetFieldmarkAfter( ) ) !=nullptr ) {
1839  GotoFieldmark(pBM);
1840  }
1841 }
1842 
1844 {
1845  CurrShell aCurr( this );
1846  while(IsModePushed())
1847  PopMode();
1848  while(PopCursor(false))
1849  ;
1851 }
1852 
1854 {
1855  bool bRet = SwCursorShell::Pop(eDelete);
1856  if( bRet && IsSelection() )
1857  {
1858  if (!IsAddMode())
1859  {
1862  }
1863  }
1864  return bRet;
1865 }
1866 
1868 {
1869  if(IsSelFrameMode())
1870  {
1871  return false;
1872  }
1873 
1874  if(IsObjSelected())
1875  {
1876  return false;
1877  }
1878 
1879  if(GetView().GetDrawFuncPtr())
1880  {
1881  return false;
1882  }
1883 
1884  if(GetView().GetPostItMgr()->GetActiveSidebarWin())
1885  {
1886  return false;
1887  }
1888 
1889  return true;
1890 }
1891 
1892 void SwWrtShell::ChgDBData(const SwDBData& aDBData)
1893 {
1894  SwEditShell::ChgDBData(aDBData);
1895  //notify the db-beamer if available
1897 }
1898 
1899 OUString SwWrtShell::GetSelDescr() const
1900 {
1901  OUString aResult;
1902 
1903  SelectionType nSelType = GetSelectionType();
1904  switch (nSelType)
1905  {
1907  aResult = SwResId(STR_GRAPHIC);
1908 
1909  break;
1910  case SelectionType::Frame:
1911  {
1912  const SwFrameFormat * pFrameFormat = GetSelectedFrameFormat();
1913 
1914  if (pFrameFormat)
1915  aResult = pFrameFormat->GetDescription();
1916  }
1917  break;
1919  {
1920  aResult = SwResId(STR_DRAWING_OBJECTS);
1921  }
1922  break;
1923  default:
1924  if (mxDoc)
1925  aResult = GetCursorDescr();
1926  }
1927 
1928  return aResult;
1929 }
1930 
1932 {
1934  //#i115062# invalidate meta character slot
1936 }
1937 
1939 {
1942 }
1943 
1944 // Switch on/off header or footer of a page style - if an empty name is
1945 // given all styles are changed
1946 
1948  std::u16string_view rStyleName, bool bHeader, bool bOn, bool bShowWarning)
1949 {
1950  SdrView *const pSdrView = GetDrawView();
1951  if (pSdrView && pSdrView->IsTextEdit())
1952  { // tdf#107474 deleting header may delete active drawing object
1953  pSdrView->SdrEndTextEdit(true);
1954  }
1956  StartAllAction();
1957  StartUndo( SwUndoId::HEADER_FOOTER ); // #i7983#
1958  bool bExecute = true;
1959  bool bCursorSet = false;
1960  for( size_t nFrom = 0, nTo = GetPageDescCnt();
1961  nFrom < nTo; ++nFrom )
1962  {
1963  SwPageDesc aDesc( GetPageDesc( nFrom ));
1964  OUString sTmp(aDesc.GetName());
1965  if( rStyleName.empty() || rStyleName == sTmp )
1966  {
1967  bool bChgd = false;
1968 
1969  if( bShowWarning && !bOn && GetActiveView() && GetActiveView() == &GetView() &&
1970  ( (bHeader && aDesc.GetMaster().GetHeader().IsActive()) ||
1971  (!bHeader && aDesc.GetMaster().GetFooter().IsActive()) ) )
1972  {
1973  bShowWarning = false;
1974  //Actions have to be closed while the dialog is showing
1975  EndAllAction();
1976 
1977  weld::Window* pParent = GetView().GetFrameWeld();
1978  short nResult;
1979  if (bHeader) {
1980  nResult = DeleteHeaderDialog(pParent).run();
1981  } else {
1982  nResult = DeleteFooterDialog(pParent).run();
1983  }
1984 
1985  bExecute = nResult == RET_YES;
1986  StartAllAction();
1987  if (nResult == RET_YES)
1989  }
1990  if( bExecute )
1991  {
1992  bChgd = true;
1993  SwFrameFormat &rMaster = aDesc.GetMaster();
1994  if(bHeader)
1995  rMaster.SetFormatAttr( SwFormatHeader( bOn ));
1996  else
1997  rMaster.SetFormatAttr( SwFormatFooter( bOn ));
1998  if( bOn )
1999  {
2001  SvxULSpaceItem aUL(bHeader ? 0 : constTwips_5mm, bHeader ? constTwips_5mm : 0, RES_UL_SPACE );
2002  SwFrameFormat* pFormat = bHeader ?
2003  const_cast<SwFrameFormat*>(rMaster.GetHeader().GetHeaderFormat()) :
2004  const_cast<SwFrameFormat*>(rMaster.GetFooter().GetFooterFormat());
2005  pFormat->SetFormatAttr( aUL );
2006  XFillStyleItem aFill(drawing::FillStyle_NONE);
2007  pFormat->SetFormatAttr(aFill);
2008  }
2009  }
2010  if( bChgd )
2011  {
2012  ChgPageDesc( nFrom, aDesc );
2013 
2014  if( !bCursorSet && bOn )
2015  {
2016  if ( !IsHeaderFooterEdit() )
2018  bCursorSet = SetCursorInHdFt(
2019  rStyleName.empty() ? SIZE_MAX : nFrom,
2020  bHeader );
2021  }
2022  }
2023  }
2024  }
2025  EndUndo( SwUndoId::HEADER_FOOTER ); // #i7983#
2026  EndAllAction();
2027 }
2028 
2030 {
2031  SwViewShell::SetShowHeaderFooterSeparator( eControl, bShow );
2032  if ( !bShow )
2034 }
2035 
2036 void SwWrtShell::InsertPostIt(SwFieldMgr& rFieldMgr, const SfxRequest& rReq)
2037 {
2038  SwPostItField* pPostIt = dynamic_cast<SwPostItField*>(rFieldMgr.GetCurField());
2039  bool bNew = !(pPostIt && pPostIt->GetTyp()->Which() == SwFieldIds::Postit);
2040  if (bNew || GetView().GetPostItMgr()->IsAnswer())
2041  {
2042  const SvxPostItAuthorItem* pAuthorItem = rReq.GetArg<SvxPostItAuthorItem>(SID_ATTR_POSTIT_AUTHOR);
2043  OUString sAuthor;
2044  if ( pAuthorItem )
2045  sAuthor = pAuthorItem->GetValue();
2046  else
2047  {
2048  std::size_t nAuthor = SW_MOD()->GetRedlineAuthor();
2049  sAuthor = SW_MOD()->GetRedlineAuthor(nAuthor);
2050  }
2051 
2052  const SvxPostItTextItem* pTextItem = rReq.GetArg<SvxPostItTextItem>(SID_ATTR_POSTIT_TEXT);
2053  OUString sText;
2054  if ( pTextItem )
2055  sText = pTextItem->GetValue();
2056 
2057  // If we have a text already registered for answer, use that
2058  if (GetView().GetPostItMgr()->IsAnswer() && !GetView().GetPostItMgr()->GetAnswerText().isEmpty())
2059  {
2060  sText = GetView().GetPostItMgr()->GetAnswerText();
2061  GetView().GetPostItMgr()->RegisterAnswerText(OUString());
2062  }
2063 
2064  if ( HasSelection() && !IsTableMode() )
2065  {
2066  KillPams();
2067  }
2068 
2069  // #i120513# Inserting a comment into an autocompletion crashes
2070  // --> suggestion has to be removed before
2072 
2073  SwInsertField_Data aData(SwFieldTypesEnum::Postit, 0, sAuthor, sText, 0);
2074 
2075  if (IsSelFrameMode())
2076  {
2077  SwFlyFrame* pFly = GetSelectedFlyFrame();
2078 
2079  // Remember the anchor of the selected object before deletion.
2080  std::unique_ptr<SwPosition> pAnchor;
2081  if (pFly)
2082  {
2083  SwFrameFormat* pFormat = pFly->GetFormat();
2084  if (pFormat)
2085  {
2086  RndStdIds eAnchorId = pFormat->GetAnchor().GetAnchorId();
2087  if ((eAnchorId == RndStdIds::FLY_AS_CHAR || eAnchorId == RndStdIds::FLY_AT_CHAR) && pFormat->GetAnchor().GetContentAnchor())
2088  {
2089  pAnchor.reset(new SwPosition(*pFormat->GetAnchor().GetContentAnchor()));
2090  }
2091  }
2092  }
2093 
2094  // A frame is selected, end frame selection.
2095  EnterStdMode();
2096  GetView().AttrChangedNotify(nullptr);
2097 
2098  // Set up text selection, so the anchor of the frame will be the anchor of the
2099  // comment.
2100  if (pFly)
2101  {
2102  *GetCurrentShellCursor().GetPoint() = *pAnchor;
2103  SwFrameFormat* pFormat = pFly->GetFormat();
2104  if (pFormat && pFormat->GetAnchor().GetAnchorId() == RndStdIds::FLY_AS_CHAR)
2105  {
2106  Right(CRSR_SKIP_CELLS, /*bSelect=*/true, 1, /*bBasicCall=*/false, /*bVisual=*/true);
2107  }
2108  else if (pFormat && pFormat->GetAnchor().GetAnchorId() == RndStdIds::FLY_AT_CHAR)
2109  {
2110  aData.m_pAnnotationRange.reset(new SwPaM(*GetCurrentShellCursor().Start(),
2111  *GetCurrentShellCursor().End()));
2112  }
2113  }
2114  }
2115 
2116  rFieldMgr.InsertField( aData );
2117 
2118  Push();
2120  pPostIt = static_cast<SwPostItField*>(rFieldMgr.GetCurField());
2121  Pop(SwCursorShell::PopMode::DeleteCurrent); // Restore cursor position
2122  }
2123 
2124  // Client has disabled annotations rendering, no need to
2125  // focus the postit field
2127  return;
2128 
2129  if (pPostIt)
2130  {
2132  if(auto pFormat = pType->FindFormatForField(pPostIt))
2133  pFormat->Broadcast( SwFormatFieldHint( nullptr, SwFormatFieldHintWhich::FOCUS, &GetView() ) );
2134  }
2135 }
2136 
2138 {
2139  const SwOutlineNodes& rOutlineNodes = GetDoc()->GetNodes().GetOutLineNds();
2140  const SwNode* pOutlineNode = rOutlineNodes[nPos];
2141 
2142  // no layout frame means outline folding is set to include sub levels and the outline node has
2143  // a parent outline node with outline content visible attribute false (folded outline content)
2144  if (!pOutlineNode->GetTextNode()->getLayoutFrame(nullptr))
2145  return false;
2146 
2147  // try the next node to determine if this outline node has visible content
2148  SwNodeIndex aIdx(*pOutlineNode, +1);
2149  if (&aIdx.GetNode() == &aIdx.GetNodes().GetEndOfContent()) // end of regular content
2150  return false;
2151 
2152  if (aIdx.GetNode().IsTextNode() || aIdx.GetNode().IsTableNode() ||
2153  aIdx.GetNode().IsSectionNode())
2154  {
2155  // * sublevels treated as outline content
2156  // If next node (aIdx) doesn't have a layout frame
2157  // then this outline node does not have visible outline content.
2158  // * sublevels NOT treated as outline content
2159  // If the next node (aIdx) is the next outline node
2160  // then return the outline content visible attribute value.
2162  nPos + 1 < rOutlineNodes.size() &&
2163  rOutlineNodes[nPos + 1] == &aIdx.GetNode())
2164  return GetAttrOutlineContentVisible(nPos);
2165 
2166  if (aIdx.GetNode().IsTextNode())
2167  return aIdx.GetNode().GetTextNode()->getLayoutFrame(nullptr);
2168  if (aIdx.GetNode().IsTableNode())
2169  {
2170  SwTable& rTable = aIdx.GetNode().GetTableNode()->GetTable();
2171  return rTable.HasLayout();
2172  }
2173  if (aIdx.GetNode().IsSectionNode())
2174  {
2175  const SwSectionFormat* pFormat =
2177  if (!pFormat)
2178  return false;
2179  SwPtrMsgPoolItem aAskItem(RES_CONTENT_VISIBLE, nullptr);
2180  pFormat->GetInfo(aAskItem);
2181  return aAskItem.pObject;
2182  }
2183  }
2184 
2185  return true;
2186 }
2187 
2188 void SwWrtShell::MakeOutlineContentVisible(const size_t nPos, bool bMakeVisible)
2189 {
2190  const SwNodes& rNodes = GetNodes();
2191  const SwOutlineNodes& rOutlineNodes = rNodes.GetOutLineNds();
2192 
2193  SwNode* pSttNd = rOutlineNodes[nPos];
2194 
2195  // determine end node
2196  SwNode* pEndNd = &rNodes.GetEndOfContent();
2197  if (rOutlineNodes.size() > nPos + 1)
2198  pEndNd = rOutlineNodes[nPos + 1];
2199 
2201  {
2202  // get the last outline node to include (iPos)
2203  int nLevel = pSttNd->GetTextNode()->GetAttrOutlineLevel();
2204  SwOutlineNodes::size_type iPos = nPos;
2205  while (++iPos < rOutlineNodes.size() &&
2206  rOutlineNodes[iPos]->GetTextNode()->GetAttrOutlineLevel() > nLevel);
2207 
2208  // get the correct end node
2209  // the outline node may be in frames, headers, footers special section of doc model
2210  SwNode* pStartOfSectionNodeSttNd = pSttNd->StartOfSectionNode();
2211  while (pStartOfSectionNodeSttNd->StartOfSectionNode()
2212  != pStartOfSectionNodeSttNd->StartOfSectionNode()->StartOfSectionNode())
2213  {
2214  pStartOfSectionNodeSttNd = pStartOfSectionNodeSttNd->StartOfSectionNode();
2215  }
2216  pEndNd = pStartOfSectionNodeSttNd->EndOfSectionNode();
2217 
2218  if (iPos < rOutlineNodes.size())
2219  {
2220  SwNode* pStartOfSectionNode = rOutlineNodes[iPos]->StartOfSectionNode();
2221  while (pStartOfSectionNode->StartOfSectionNode()
2222  != pStartOfSectionNode->StartOfSectionNode()->StartOfSectionNode())
2223  {
2224  pStartOfSectionNode = pStartOfSectionNode->StartOfSectionNode();
2225  }
2226  if (pStartOfSectionNodeSttNd == pStartOfSectionNode)
2227  pEndNd = rOutlineNodes[iPos];
2228  }
2229  }
2230 
2231  // table, text box, header, footer
2232  if (pSttNd->GetTableBox() || pSttNd->GetIndex() < rNodes.GetEndOfExtras().GetIndex())
2233  {
2234  // limit to within section
2235  if (pSttNd->EndOfSectionIndex() < pEndNd->GetIndex())
2236  pEndNd = pSttNd->EndOfSectionNode();
2237  }
2238  // if pSttNd isn't in table but pEndNd is, skip over all outline nodes in table
2239  else if (pEndNd->GetTableBox())
2240  {
2241  pEndNd = &rNodes.GetEndOfContent();
2242  for (size_t nOutlinePos = nPos + 2; nOutlinePos < rOutlineNodes.size(); nOutlinePos++)
2243  {
2244  if (!(rOutlineNodes[nOutlinePos]->GetTableBox()))
2245  {
2246  pEndNd = rOutlineNodes[nOutlinePos];
2247  break;
2248  }
2249  }
2250  }
2251  // end node determined
2252 
2253  // Remove content frames from the next node after the starting outline node to
2254  // the determined ending node. Always do this to prevent the chance of duplicate
2255  // frames being made. They will be remade below if needed.
2256  SwNodeIndex aIdx(*pSttNd, +1);
2257  while (aIdx != *pEndNd)
2258  {
2259  SwNode* pNd = &aIdx.GetNode();
2260  if (pNd->IsContentNode())
2261  pNd->GetContentNode()->DelFrames(nullptr);
2262  else if (pNd->IsTableNode())
2263  pNd->GetTableNode()->DelFrames(nullptr);
2264  aIdx++;
2265  }
2266 
2267  if (bMakeVisible) // make outline nodes outline content visible
2268  {
2269  // reset the index marker and make frames
2270  aIdx.Assign(*pSttNd, +1);
2271  MakeFrames(GetDoc(), aIdx, *pEndNd);
2272 
2273  pSttNd->GetTextNode()->SetAttrOutlineContentVisible(true);
2274 
2275  // make outline content made visible that have outline visible attribute false not visible
2276  while (aIdx != *pEndNd)
2277  {
2278  SwNode* pNd = &aIdx.GetNode();
2279  if (pNd->IsTextNode() && pNd->GetTextNode()->IsOutline())
2280  {
2281  SwTextNode* pTextNd = pNd->GetTextNode();
2282  bool bOutlineContentVisibleAttr = true;
2283  pTextNd->GetAttrOutlineContentVisible(bOutlineContentVisibleAttr);
2284  if (!bOutlineContentVisibleAttr)
2285  {
2287  if (rOutlineNodes.Seek_Entry(pTextNd, &iPos))
2288  {
2289  if (pTextNd->getLayoutFrame(nullptr))
2290  MakeOutlineContentVisible(iPos, false);
2291  }
2292  }
2293  }
2294  aIdx++;
2295  }
2296  }
2297  else
2298  pSttNd->GetTextNode()->SetAttrOutlineContentVisible(false);
2299 }
2300 
2301 // make content visible or not visible only if needed
2303 {
2305 
2306  const SwOutlineNodes& rOutlineNds = GetNodes().GetOutLineNds();
2307  for (SwOutlineNodes::size_type nPos = 0; nPos < rOutlineNds.size(); ++nPos)
2308  {
2309  bool bIsOutlineContentVisible = IsOutlineContentVisible(nPos);
2310  bool bOutlineContentVisibleAttr = true;
2311  rOutlineNds[nPos]->GetTextNode()->GetAttrOutlineContentVisible(bOutlineContentVisibleAttr);
2312  if (!bIsOutlineContentVisible && bOutlineContentVisibleAttr)
2314  else if (bIsOutlineContentVisible && !bOutlineContentVisibleAttr)
2316  }
2317 }
2318 
2320 {
2321  // deselect any drawing or frame and leave editing mode
2322  SdrView* pSdrView = GetDrawView();
2323  if (pSdrView && pSdrView->IsTextEdit() )
2324  {
2325  bool bLockView = IsViewLocked();
2326  LockView(true);
2327  EndTextEdit();
2328  LockView(bLockView);
2329  }
2330 
2331  if (IsSelFrameMode() || IsObjSelected())
2332  {
2333  UnSelectFrame();
2336  EnterStdMode();
2337  DrawSelChanged();
2338  GetView().StopShellTimer();
2339  }
2340  else
2341  EnterStdMode();
2342 
2344 
2345  if (bMakeVisible)
2346  {
2347  // make all content visible
2348 
2349  // When shortcut is assigned to the show outline content visibility button and used to
2350  // toggle the feature and the mouse pointer is on an outline frame the button will not
2351  // be removed. An easy way to make sure the button does not remain shown is to use the
2352  // HideControls function.
2354 
2355  // temporarily set outline content visible attribute true for folded outline nodes
2356  std::vector<SwNode*> aFoldedOutlineNodeArray;
2357  for (SwNode* pNd: GetNodes().GetOutLineNds())
2358  {
2359  bool bOutlineContentVisibleAttr = true;
2360  pNd->GetTextNode()->GetAttrOutlineContentVisible(bOutlineContentVisibleAttr);
2361  if (!bOutlineContentVisibleAttr)
2362  {
2363  aFoldedOutlineNodeArray.push_back(pNd);
2364  pNd->GetTextNode()->SetAttrOutlineContentVisible(true);
2365  }
2366  }
2367 
2368  StartAction();
2370  EndAction();
2371 
2372  // restore outline content visible attribute for folded outline nodes
2373  for (SwNode* pNd: aFoldedOutlineNodeArray)
2374  pNd->GetTextNode()->SetAttrOutlineContentVisible(false);
2375  }
2376  else
2377  {
2378  StartAction();
2380  EndAction();
2381 
2382  // If needed, find visible outline node to place cursor.
2383  if (nPos != SwOutlineNodes::npos && !IsOutlineContentVisible(nPos))
2384  {
2385  while (nPos != SwOutlineNodes::npos && !GetNodes().GetOutLineNds()[nPos]->GetTextNode()->getLayoutFrame(nullptr))
2386  --nPos;
2387  if (nPos != SwOutlineNodes::npos)
2388  GotoOutline(nPos);
2389  }
2390  }
2391 }
2392 
2394 {
2395  bool bVisibleAttr = true;
2396  GetNodes().GetOutLineNds()[nPos]->GetTextNode()->GetAttrOutlineContentVisible(bVisibleAttr);
2397  return bVisibleAttr;
2398 }
2399 
2400 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void InsertLineBreak()
Definition: wrtsh1.cxx:933
const Fraction & GetScaleWidth() const
SfxViewFrame * GetViewFrame() const
SvxNumType GetNumberingType() const
Instances of SwFields and those derived from it occur 0 to n times.
Definition: fldbas.hxx:242
const SwEndNode * EndOfSectionNode() const
Definition: node.hxx:684
void StopShellTimer()
Definition: view.cxx:1790
css::uno::Reference< css::embed::XEmbeddedObject > CreateEmbeddedObject(const css::uno::Sequence< sal_Int8 > &, OUString &, OUString const *pBaseURL=nullptr)
const SfxSlot * GetSlot(sal_uInt16 nId) const
const css::uno::Reference< css::embed::XEmbeddedObject > & GetObject() const
bool Right(sal_uInt16 nMode, bool bSelect, sal_uInt16 nCount, bool bBasicCall, bool bVisual=false)
Definition: move.cxx:127
void KillPams()
Definition: crsrsh.cxx:1021
virtual css::uno::Reference< css::io::XInputStream > GetIconIfIconified(OUString *pGraphicMediaType)=0
SwNode & GetNode(bool bPoint=true) const
Definition: pam.hxx:224
void SplitNode(bool bAutoFormat=false)
Definition: wrtsh1.cxx:1124
virtual const SwFlyFrameFormat * GetFormat() const override
Definition: fly.cxx:2876
int GetAssignedOutlineStyleLevel() const
Definition: fmtcol.cxx:613
OUString const & GetCurPageStyle() const
Definition: wrtsh1.cxx:1700
SwNodeOffset EndOfSectionIndex() const
Definition: node.hxx:679
void ChgDBData(const SwDBData &SwDBData)
Definition: edfld.cxx:295
bool bVisible
Represents the style of a paragraph.
Definition: fmtcol.hxx:56
Rect of current FlyFrame.
static SvxAutoCorrCfg & Get()
Marks a position in the document model.
Definition: pam.hxx:36
virtual SdrEndTextEditKind SdrEndTextEdit(bool bDontDeleteReally=false)
void InsertByWord(const OUString &)
Definition: wrtsh1.cxx:197
const SwNodes & GetNodes() const
Definition: viewsh.cxx:2143
bool IsAutoCorrFlag(ACFlags nFlag) const
bool IsSectionNode() const
Definition: node.hxx:646
virtual void DrawSelChanged() override
Definition: wrtsh3.cxx:105
bool IsDrawMode() const
Definition: view.hxx:539
SdrView * GetDrawView()
Definition: vnew.cxx:373
Pagedescriptor Client of SwPageDesc that is "described" by the attribute.
Definition: fmtpdsc.hxx:35
size_t GetPageDescCnt() const
Definition: fedesc.cxx:38
void InsertObject( const svt::EmbeddedObjectRef &, SvGlobalName const *pName, sal_uInt16 nSlotId=0)
Definition: wrtsh1.cxx:372
bool IsDefault() const
Definition: format.hxx:113
bool SetObjArea(const tools::Rectangle &)
constexpr auto toTwips(N number, Length from)
SwTableBox * GetTableBox() const
If node is in a table return the respective table box.
Definition: node.cxx:754
void DelFrames(SwRootFrame const *pLayout=nullptr)
Method deletes all views of document for the node.
Definition: ndtbl.cxx:2445
void BulletOn()
Definition: wrtsh1.cxx:1530
bool HasLayout() const
Definition: swtable.cxx:2846
void setWidth(tools::Long nWidth)
SwView * GetActiveView()
Definition: swmodul1.cxx:116
bool IsOutline() const
Returns if this text node is an outline.
Definition: ndtxt.cxx:3953
const SwFormatHeader & GetHeader(bool=true) const
Definition: fmthdft.hxx:97
OutlinerParaObject * IsAnswer()
Definition: PostItMgr.hxx:257
void UpdateAttrMgr()
Definition: frmmgr.cxx:136
bool IsBezierEditMode() const
Definition: viewdraw.cxx:626
void MakeOutlineContentVisible(const size_t nPos, bool bMakeVisible=true)
Definition: wrtsh1.cxx:2188
void InvalidateOutlineContentVisibility()
Definition: wrtsh1.cxx:2302
SAL_WARN_UNUSED_RESULT Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
static void ClearSelection(const SwWrtShell &rSh, const SwFrameShell *pCreator=nullptr)
Definition: swdtflvr.cxx:4185
virtual SwFieldType * GetFieldType(SwFieldIds nResId, const OUString &rName, bool bDbFieldMatching) const =0
bool IsTableMode() const
Definition: crsrsh.hxx:643
constexpr TypedWhichId< SwFormatFrameSize > RES_FRM_SIZE(89)
void SetFlyMacroLnk(const Link< const SwFlyFrameFormat *, void > &rLnk)
Definition: crsrsh.hxx:479
sal_uInt16 char char * pDesc
void Remove(const SvGlobalName &)
SVX_NUM_NUMBER_NONE
static SvxAbstractDialogFactory * Create()
long Long
css::beans::PropertyValue makePropertyValue(const OUString &rName, T &&rValue)
void StopQuickHelp()
Definition: edtwin.cxx:5952
bool Pop(SwCursorShell::PopMode=SwCursorShell::PopMode::DeleteStack)
Definition: wrtsh1.cxx:1853
bool IsAutoRule() const
Definition: numrule.hxx:230
virtual void SetShowHeaderFooterSeparator(FrameControlType eControl, bool bShow) override
Definition: wrtsh1.cxx:2029
SwContentFrame * getLayoutFrame(const SwRootFrame *, const SwPosition *pPos=nullptr, std::pair< Point, bool > const *pViewPosAndCalcFrame=nullptr) const
Definition: node.cxx:1213
virtual OUString GetDescription() const
Definition: atrfrm.cxx:2860
Definition: doc.hxx:188
constexpr sal_uInt16 RES_FRMATR_END(133)
void SetNumStr(const OUString &rStr)
Definition: fmtftn.hxx:73
void HideControls(FrameControlType eType)
constexpr sal_uInt8 MAXLEVEL
Definition: swtypes.hxx:93
sal_Int16 nId
css::uno::Sequence< sal_Int8 > GetByteSequence() const
void AutoCorrect(SvxAutoCorrect &rACorr, bool bInsertMode, sal_Unicode cChar)
Call AutoCorrect.
Definition: edws.cxx:255
SwUndoId EndUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Closes parenthesis of nUndoId, not used by UI.
Definition: edws.cxx:234
constexpr TypedWhichId< SvxFormatBreakItem > RES_BREAK(94)
OUString GetSelDescr() const
Definition: wrtsh1.cxx:1899
SwNode & GetNode() const
Definition: ndindex.hxx:121
bool Left(sal_uInt16 nCnt, sal_uInt16 nMode, bool bAllowVisual=false)
Definition: crsrsh.hxx:349
static bool lcl_FoldedOutlineNodeEndOfParaSplit(SwWrtShell *pThis)
Definition: wrtsh1.cxx:1012
SwTwips GetWidthOfLeadingTabs() const
Returns the width of leading tabs/blanks in this paragraph.
Definition: itratr.cxx:1449
static bool lcl_IsAllowed(const SwWrtShell *rSh)
Definition: wrtsh1.cxx:133
void EnterStdMode()
Definition: select.cxx:551
SwEditWin & GetEditWin()
Definition: view.hxx:416
SwFormatField * FindFormatForField(const SwField *) const
Definition: fldbas.cxx:174
void SetPageStyle(const OUString &rCollName)
Definition: wrtsh1.cxx:1688
SwSectionFormat * GetFormat()
Definition: section.hxx:336
void Pos(const Point &rNew)
Definition: swrect.hxx:171
void LaunchOLEObj(sal_Int32 nVerb=css::embed::EmbedVerbs::MS_OLEVERB_PRIMARY)
Definition: wrtsh1.cxx:617
IDocumentUndoRedo & GetIDocumentUndoRedo()
Definition: doc.cxx:144
ErrCode DoVerb(sal_Int32 nVerb)
bool GetAttrOutlineContentVisible(const size_t nPos)
Definition: wrtsh1.cxx:2393
Of course Writer needs its own rectangles.
Definition: swrect.hxx:34
void SetModified()
Definition: edws.cxx:70
void AutoUpdatePara(SwTextFormatColl *pColl, const SfxItemSet &rStyleSet, SwPaM *pPaM=nullptr)
Definition: wrtsh1.cxx:1720
void Invalidate(sal_uInt16 nId)
SwFlyFrame * GetSelectedFlyFrame() const
Definition: fefly1.cxx:277
bool InsertField(const SwInsertField_Data &rData)
Definition: fldmgr.cxx:894
bool InsertOleObject(const svt::EmbeddedObjectRef &xObj, SwFlyFrameFormat **pFlyFrameFormat=nullptr)
Definition: wrtsh1.cxx:476
OUString GetCursorDescr() const
Returns textual description of the current selection.
Definition: crsrsh.cxx:3662
RndStdIds GetAnchor() const
Definition: frmmgr.hxx:167
void DelAttr(sal_uInt16 nId)
Definition: frmmgr.cxx:535
void EndAllAction()
Definition: edws.cxx:97
int GetActualListLevel() const
Returns the actual list level of this text node, when it is a list item.
Definition: ndtxt.cxx:4063
static sal_uInt16 IsChart(const SvGlobalName &rName)
void InsertPostIt(SwFieldMgr &rFieldMgr, const SfxRequest &rReq)
Inserts a new annotation/comment at the current cursor position / selection.
Definition: wrtsh1.cxx:2036
int GetAttrOutlineLevel() const
Returns outline level of this text node.
Definition: ndtxt.cxx:3983
void NoEdit(bool bHideCursor=true)
Definition: wrtsh1.cxx:173
virtual void SetReadonlyOption(bool bSet)
Definition: viewsh.cxx:2420
bool HasSelection() const
Does the current cursor create a selection?
Definition: crsrsh.cxx:2517
void SetAttrOutlineContentVisible(bool bVisible)
Definition: ndtxt.cxx:4006
const OUString & GetName() const
Definition: pagedesc.hxx:196
bool IsActive() const
Definition: fmthdft.hxx:89
const SwSection & GetSection() const
Definition: node.hxx:543
Used by the UI to modify the document model.
Definition: wrtsh.hxx:93
OUString SwResId(TranslateId aId)
Definition: swmodule.cxx:165
constexpr tools::Long Width() const
static UITestLogger & getInstance()
IDocumentFieldsAccess const & getIDocumentFieldsAccess() const
Definition: doc.cxx:357
bool IsHeaderFooterEdit() const
Acts both for headers / footers, depending on the bShow(Header|Footer)Separator flags.
Definition: viewsh.hxx:563
void logEvent(const EventDescription &rDescription)
bool isLetterNumeric(const OUString &rStr, sal_Int32 nPos) const
sal_uInt16 sal_Unicode
const SfxPoolItem * NextItem()
tools::Long ResetSelect(const Point *, bool)
Definition: select.cxx:333
bool IsAssignedToListLevelOfOutlineStyle() const
Definition: fmtcol.hxx:120
constexpr SwTwips DFLT_WIDTH
Definition: frmmgr.hxx:38
virtual void ApplyViewOptions(const SwViewOption &rOpt) override
Apply ViewOptions with Start-/EndAction.
Definition: editsh.cxx:1082
SwTableNode * GetTableNode()
Definition: node.hxx:601
const SwView & GetView() const
Definition: wrtsh.hxx:431
SwFrameControlsManager & GetFrameControlsManager()
Definition: edtwin.cxx:6608
RET_YES
Sequence< PropertyValue > aArguments
constexpr sal_uInt16 RES_PARATR_BEGIN(RES_TXTATR_END)
rtl::Reference< SwDoc > mxDoc
The document; never 0.
Definition: viewsh.hxx:171
sal_Unicode GetBulletChar(sal_uInt8 nLevel)
retrieve unicode of character used for the default bullet list for the given list level ...
Definition: number.cxx:1353
tools::Long CalcHeightBorder()
Definition: frmmgr.hxx:135
const OUString & GetName() const
Definition: format.hxx:115
void Edit()
Definition: wrtsh1.cxx:179
Footer, for pageformats Client of FrameFormat describing the footer.
Definition: fmthdft.hxx:64
SVX_NUM_ARABIC
SELECTFUNC m_fnSetCursor
Definition: wrtsh.hxx:112
static SW_DLLPUBLIC sal_uInt16 GetPoolIdFromUIName(const OUString &rName, SwGetPoolIdFromName)
bool checkForSelectedFontWork(SdrView const *pSdrView)
void Width(tools::Long nNew)
Definition: swrect.hxx:189
const SfxItemSet & GetAttrSet() const
Definition: frmmgr.hxx:124
const SwTable & GetTable() const
Definition: node.hxx:500
Numbering symbols.
Definition: poolfmt.hxx:117
SwDoc * GetDoc() const
Definition: viewsh.hxx:282
SwFrameFormat * GetTableStyle(std::u16string_view rFormatName)
Definition: wrtsh1.cxx:1669
bool checkForSelectedCustomShapes(SdrView const *pSdrView, bool bOnlyExtruded)
static sal_uInt16 IsMath(const SvGlobalName &rName)
virtual void MoveObjectIfActive(svt::EmbeddedObjectRef &xObj, const Point &rOffset) override
The layout has been changed, so the active object has to be moved after that.
Definition: wrtsh1.cxx:653
size_type size() const
bool IsEmpty() const
Definition: swrect.hxx:304
virtual bool DoesUndo() const =0
Is Undo enabled?
void Insert(SwField const &, SwPaM *pAnnotationRange=nullptr)
Definition: wrtsh2.cxx:62
void MakeFrames(SwDoc *pDoc, const SwNodeIndex &rSttIdx, const SwNodeIndex &rEndIdx)
Definition: frmtool.cxx:1984
void NumOn()
Definition: wrtsh1.cxx:1479
constexpr OUStringLiteral aData
Definition: ww8scan.hxx:48
bool IsFormProtected()
Definition: crbm.cxx:276
SwNode & GetEndOfContent() const
Regular ContentSection (i.e. the BodyText).
Definition: ndarr.hxx:161
bool IsShowOutlineContentVisibilityButton() const
Definition: viewopt.cxx:99
SwWrtShell(SwWrtShell &, vcl::Window *pWin, SwView &rShell)
Definition: wrtsh1.cxx:1807
void SetReadonlyControls(bool bReadonly)
SVX_NUM_CHAR_SPECIAL
weld::Window * GetFrameWeld(const SfxFrame *pFrame)
Definition: dialoghelp.cxx:19
void SetHeightSizeType(SwFrameSize eType)
Definition: frmmgr.cxx:593
virtual bool IsProtected() const
bool IsContentNode() const
Definition: node.hxx:630
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:137
Class for automated call of Start- and EndAction().
Definition: editsh.hxx:1013
bool IsSelection() const
Definition: crsrsh.hxx:876
virtual void AppendUndo(std::unique_ptr< SwUndo > pUndo)=0
Add new Undo action.
static void EndUndo(SwWrtShell &rSh)
Definition: basesh.cxx:2803
sal_uInt16 char * pName
std::unique_ptr< SwPaM > m_pAnnotationRange
Marks the PostIt field's annotation start/end if it differs from the cursor selection.
Definition: fldmgr.hxx:83
static css::uno::Reference< css::embed::XStorage > GetTemporaryStorage(const css::uno::Reference< css::uno::XComponentContext > &rxContext=css::uno::Reference< css::uno::XComponentContext >())
virtual void ClearRedo()=0
Delete all Redo actions.
Style of a layout element.
Definition: frmfmt.hxx:59
SwNodeIndex & Assign(SwNodes const &rNds, SwNodeOffset)
Definition: ndindex.hxx:274
bool HasSelection() const
Definition: wrtsh.hxx:144
#define SW_MOD()
Definition: swmodule.hxx:256
static constexpr auto npos
Definition: ndarr.hxx:79
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 Insert2(const OUString &, const bool bForceExpandHints=false)
Definition: editsh.cxx:80
uno_Any a
const SwStartNode * StartOfSectionNode() const
Definition: node.hxx:133
bool IsFrameAction() const
Definition: edtwin.hxx:218
const SwFrameFormat * GetFooterFormat() const
Definition: fmthdft.hxx:85
const SwPosition * GetPoint() const
Definition: pam.hxx:208
bool SetCursorInHdFt(size_t nDescNo, bool bInHeader)
Definition: crstrvl.cxx:195
const vcl::Font & GetDefBulletFont()
retrieve font used for the default bullet list characters
Definition: number.cxx:1348
RndStdIds GetAnchorId() const
Definition: fmtanchr.hxx:65
SelectionType
const SwPosition * GetContentAnchor() const
Definition: fmtanchr.hxx:67
virtual void SetShowHeaderFooterSeparator(FrameControlType eControl, bool bShow)
Definition: viewsh.cxx:96
void Push()
store a copy of the current cursor on the cursor stack
Definition: crsrsh.cxx:2239
SwCharFormat * GetCharStyle(const OUString &rFormatName, GetStyle eCreate=GETSTYLE_NOCREATE)
Definition: wrtsh1.cxx:1652
SvxAutoCorrect * GetAutoCorrect()
SfxBindings & GetBindings()
void Assign(const css::uno::Reference< css::embed::XEmbeddedObject > &xObj, sal_Int64 nAspect)
SwContentNode * GetContentNode()
Definition: node.hxx:617
SwNodeOffset GetIndex() const
Definition: node.hxx:292
const OUString & GetValue() const
const SwPageDesc & GetPageDesc(size_t i) const
Definition: fedesc.cxx:126
void SetTextFormatColl(const css::uno::Any &rAny, SwPaM &rPaM)
const T * GetArg(sal_uInt16 nSlotId) const
void SetSfxViewShell(SfxViewShell *pNew)
Definition: viewsh.hxx:443
void DelFrames(SwRootFrame const *pLayout)
Method deletes all views of document for the node.
Definition: node.cxx:1411
virtual SwCursor & GetCurrentShellCursor() override
Return the current shell cursor.
Definition: crsrsh.cxx:185
SwUndoId StartUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Undo: set up Undo parenthesis, return nUndoId of this parenthesis.
Definition: edws.cxx:223
SwField * GetCurField()
Definition: fldmgr.cxx:429
void AddRule(SwUndoArg eWhat, const OUString &rWith)
Definition: SwRewriter.cxx:25
const SwFormatFooter & GetFooter(bool=true) const
Definition: fmthdft.hxx:99
void SetGraphicStream(const css::uno::Reference< css::io::XInputStream > &xInGrStream, const OUString &rMediaType)
SwNumRule * GetNumRule(bool bInParent=true) const
Returns numbering rule of this text node.
Definition: ndtxt.cxx:2777
void SetAnchor(RndStdIds eId)
Definition: frmmgr.cxx:227
void NumOrBulletOff()
Definition: wrtsh1.cxx:1484
Marks a node in the document model.
Definition: ndindex.hxx:32
void ToggleHeaderFooterEdit()
Definition: fews.cxx:1320
const SwOutlineNodes & GetOutLineNds() const
Array of all OutlineNodes.
Definition: ndarr.hxx:229
void MakeAllFoldedOutlineContentVisible(bool bMakeVisible=true)
Definition: wrtsh1.cxx:2319
virtual void SetReadonlyOption(bool bSet) override
Definition: wrtsh1.cxx:1938
#define CNT_OLE
Definition: editsh.hxx:131
SwOutlineNodes::size_type GetOutlinePos(sal_uInt8 nLevel=UCHAR_MAX, SwPaM *pPaM=nullptr)
search "outline position" before previous outline node at given level
Definition: crstrvl.cxx:1159
void SSize(const Size &rNew)
Definition: swrect.hxx:180
void PopMode()
Definition: select.cxx:284
void LeaveDrawCreate()
Definition: view.hxx:538
void Insert(const OUString &rGrfName, const OUString &rFltName, const Graphic *pGraphic, const SfxItemSet *pFlyAttrSet)
Definition: fefly1.cxx:836
Represents the style of a text portion.
Definition: charfmt.hxx:26
Frame cannot be moved in Var-direction.
tools::Long SwTwips
Definition: swtypes.hxx:52
SwTable is one table in the document model, containing rows (which contain cells).
Definition: swtable.hxx:113
const SwNumRuleItem & GetNumRule(bool=true) const
Definition: paratr.hxx:232
const char * GetUnoName() const
SwTextNode * GetParaPropsNode(SwRootFrame const &rLayout, SwNodeIndex const &rNode)
Definition: txtfrm.cxx:328
SwFieldType * GetTyp() const
Definition: fldbas.hxx:396
SwFrameFormat * GetSelectedFrameFormat() const
If frame then frame style, else 0.
Definition: fefly1.cxx:1215
void ChangeIndent(const sal_Int32 nDiff)
change indent of all list levels by given difference
Definition: number.cxx:960
SW_DLLPUBLIC bool HasActiveSidebarWin() const
Definition: PostItMgr.cxx:2357
virtual void CalcAndSetScale(svt::EmbeddedObjectRef &xObj, const SwRect *pFlyPrtRect=nullptr, const SwRect *pFlyFrameRect=nullptr, const bool bNoTextFramePrtAreaChanged=false) override
Client for OleObject has to be up-to-date regarding scaling.
Definition: wrtsh1.cxx:676
void StartAction()
Definition: crsrsh.cxx:226
virtual bool SetFormatAttr(const SfxPoolItem &rAttr)
Definition: format.cxx:450
void ChangeHeaderOrFooter(std::u16string_view rStyleName, bool bHeader, bool bOn, bool bShowWarning)
Definition: wrtsh1.cxx:1947
static void Get1PixelInLogic(const SwViewShell &rSh, tools::Long *pX=nullptr, tools::Long *pY=nullptr)
Definition: viscrs.cxx:654
SwFlyFrameFormat * InsertObject(const svt::EmbeddedObjectRef &, SfxItemSet *pFlyAttrSet)
Definition: fefly1.cxx:929
const SwNumFormat & Get(sal_uInt16 i) const
Definition: number.cxx:86
const sal_uInt16 CRSR_SKIP_CELLS
Definition: swcrsr.hxx:66
virtual css::uno::Reference< css::embed::XEmbeddedObject > GetObject()=0
void InsertFootnote(const OUString &, bool bEndNote=false, bool bEdit=true)
Definition: wrtsh1.cxx:982
FrameControlType
Definition: swtypes.hxx:234
Class for automated call of Start- and EndCursorMove().
Definition: editsh.hxx:1021
SwFrameFormat & GetMaster()
Definition: pagedesc.hxx:238
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:79
void NumOrBulletOn(bool bNum)
Turns on numbering or bullets.
Definition: wrtsh1.cxx:1163
void addCurrentPosition()
Definition: wrtsh1.cxx:1681
void Set(sal_uInt16 i, const SwNumFormat *)
Definition: number.cxx:617
virtual ~SwWrtShell() override
Definition: wrtsh1.cxx:1843
void SetCharFormat(SwCharFormat *)
Definition: number.cxx:280
SwCursor * GetCursor(bool bMakeTableCursor=true) const
Return pointer to the current shell cursor.
Definition: crsrsh.cxx:194
#define BITFLD_INI_LIST
Definition: wrtsh1.cxx:150
::sw::mark::IFieldmark * GetFieldmarkAfter()
Definition: crbm.cxx:288
virtual bool IsTextEdit() const final override
tools::Rectangle SVRect() const
Definition: swrect.hxx:292
constexpr sal_uInt16 RES_CHRATR_BEGIN(HINT_BEGIN)
bool IsOutlineContentVisible(const size_t nPos)
Definition: wrtsh1.cxx:2137
SvxNumberFormat::SvxNumPositionAndSpaceMode GetDefaultPositionAndSpaceMode()
Definition: number.cxx:1514
weld::Window * GetFrameWeld() const
general base class for all free-flowing frames
Definition: flyfrm.hxx:78
bool IsDefBulletFontUserDefined()
determine if default bullet font is user defined
Definition: number.cxx:1343
static MapUnit UnoEmbed2VCLMapUnit(sal_Int32 nUnoEmbedMapUnit)
constexpr tools::Long Height() const
constexpr SwTwips DFLT_HEIGHT
Definition: frmmgr.hxx:39
unsigned char sal_uInt8
const SwNodes & GetNodes() const
Definition: ndindex.hxx:158
void LockView(bool b)
Definition: viewsh.hxx:463
const SwViewOption * GetViewOptions() const
Definition: viewsh.hxx:424
tools::Long CalcWidthBorder()
Definition: frmmgr.hxx:134
OUString aName
bool IsCountedInList() const
Definition: ndtxt.cxx:4201
const tools::Rectangle & GetObjArea() const
SwNodes & GetNodes()
Definition: doc.hxx:409
tools::Long AdjustWidth(tools::Long n)
bool IsModePushed() const
Definition: wrtsh.hxx:135
void ChgPageDesc(size_t i, const SwPageDesc &)
Definition: fedesc.cxx:111
constexpr sal_uInt16 RES_PARATR_END(82)
SwPostItMgr * GetPostItMgr()
Definition: view.hxx:639
void GotoOutline(SwOutlineNodes::size_type nIdx)
Definition: move.cxx:617
bool CanInsert()
Definition: wrtsh1.cxx:1867
void NotifyDBChanged()
Definition: view.cxx:1885
Size GetSize(MapMode const *pTargetMapMode) const
void EndTextEdit()
Deletes object if required.
Definition: feshview.cxx:1308
size_t IsObjSelected() const
Definition: feshview.cxx:1240
void UnSelectFrame()
Definition: select.cxx:323
void SetSize(const Size &rLSize)
Definition: frmmgr.cxx:614
void SetObjAreaAndScale(const tools::Rectangle &, const Fraction &, const Fraction &)
void AutoUpdateFrame(SwFrameFormat *pFormat, const SfxItemSet &rStyleSet)
Definition: wrtsh1.cxx:1757
tools::Long AdjustHeight(tools::Long n)
Header, for PageFormats Client of FrameFormat describing the header.
Definition: fmthdft.hxx:33
#define FN_VIEW_META_CHARS
Definition: cmdid.h:159
void InsertColumnBreak()
Definition: wrtsh1.cxx:956
constexpr sal_uInt16 RES_CHRATR_END(46)
SAL_DLLPRIVATE tools::Long SetCursorKillSel(const Point *, bool bProp)
Definition: select.cxx:316
const SwPostItMgr * GetPostItMgr() const
Definition: viewsh.hxx:557
SwTableNode * FindTableNode()
Search table node, in which it is.
Definition: node.cxx:357
bool IsTreatSubOutlineLevelsAsContent() const
Definition: viewopt.cxx:105
void LeaveSelFrameMode()
Definition: select.cxx:720
virtual bool IsCreateNew()=0
SwFormatColl * GetCurTextFormatColl(SwPaM &rPam, const bool bConditional)
Definition: unoobj.cxx:617
void setHeight(tools::Long nHeight)
void AutoCorrect(SvxAutoCorrect &rACorr, sal_Unicode cChar)
Definition: wrtsh1.cxx:1767
void Overwrite(const OUString &)
Definition: editsh.cxx:170
static SvxAutoCorrect * lcl_IsAutoCorr()
Definition: wrtsh1.cxx:163
bool IsEndWrd()
Definition: wrtsh1.cxx:187
const sal_uInt16 CRSR_SKIP_CHARS
Definition: swcrsr.hxx:65
MapUnit
void * pObject
Definition: hints.hxx:60
RndStdIds
void SetNumOffset(const ::std::optional< sal_uInt16 > &oNum)
Definition: fmtpdsc.hxx:65
bool IsTableNode() const
Definition: node.hxx:642
SwTwips GetAdditionalIndentForStartingNewList() const
Definition: ndtxt.cxx:3200
bool IsInList() const
Definition: ndtxt.cxx:4305
void InsertPageBreak(const OUString *pPageDesc=nullptr, const ::std::optional< sal_uInt16 > &rPgNum=std::nullopt)
Definition: wrtsh1.cxx:895
static bool TryRunningState(const css::uno::Reference< css::embed::XEmbeddedObject > &)
bool IsAddMode() const
Definition: wrtsh.hxx:159
const Point & GetLastFlyFramePrtRectPos() const
Definition: frmfmt.hxx:248
SwSectionNode * GetSectionNode()
Definition: node.hxx:609
Left
void ChgDBData(const SwDBData &SwDBData)
Definition: wrtsh1.cxx:1892
constexpr tools::Long constTwips_5mm
Definition: pggrid.cxx:39
bool IsEndPara() const
Definition: crsrsh.cxx:1113
SAL_DLLPRIVATE bool PopCursor(bool bUpdate, bool bSelect=false)
Definition: move.cxx:485
virtual bool GetInfo(SfxPoolItem &) const override
Definition: section.cxx:832
void SplitNode(bool bAutoFormat=false, bool bCheckTableStart=true)
Definition: editsh.cxx:184
bool Pop(PopMode)
delete cursor
Definition: crsrsh.cxx:2261
bool Seek_Entry(SwNode *rP, size_type *pnPos) const
Definition: ndnum.cxx:32
const Size & GetSize() const
Definition: frmmgr.hxx:138
void GetAttrOutlineContentVisible(bool &bOutlineContentVisibleAttr)
GetAttrOutlineContentVisible.
Definition: ndtxt.cxx:3998
void SetNumberingType(SvxNumType nSet)
virtual void ConnectObj(svt::EmbeddedObjectRef &xIPObj, const SwRect &rPrt, const SwRect &rFrame) override
Connect objects with ActivateWhenVisible at Paint.
Definition: wrtsh1.cxx:884
std::map< OUString, OUString > aParameters
bool IsActive() const
Definition: fmthdft.hxx:58
sal_Int64 GetViewAspect() const
bool IsInvalidItem(const SfxPoolItem *pItem)
std::vector< SwNode * >::size_type size_type
SwNode & GetEndOfExtras() const
This is the last EndNode of a special section.
Definition: ndarr.hxx:159
SelectionType GetSelectionType() const
Definition: wrtsh1.cxx:1535
virtual void ApplyViewOptions(const SwViewOption &rOpt) override
Apply ViewOptions with Start-/EndAction.
Definition: wrtsh1.cxx:1931
void StartAllAction()
For all views of this document.
Definition: edws.cxx:86
const Fraction & GetScaleHeight() const
bool GotoFieldmark(::sw::mark::IFieldmark const *const pMark)
Definition: wrtsh3.cxx:86
virtual void Insert(SotClipboardFormatId nFormat, const OUString &rFormatName) override
void RegisterAnswerText(const OUString &aAnswerText)
Definition: PostItMgr.hxx:258
tools::Long GetIndentAt() const
constexpr TypedWhichId< SwPtrMsgPoolItem > RES_CONTENT_VISIBLE(185)
CharClass & GetAppCharClass()
Definition: init.cxx:702
bool IsTextNode() const
Definition: node.hxx:638
void Height(tools::Long nNew)
Definition: swrect.hxx:193
const OUString & GetAnswerText() const
Definition: PostItMgr.hxx:259
SwFieldIds Which() const
Definition: fldbas.hxx:274
sal_Int32 nState
constexpr sal_uInt16 RES_FRMATR_BEGIN(RES_PARATR_LIST_END)
Rect of PrtArea of FlyFrame.
void QuickUpdateStyle()
Definition: wrtsh1.cxx:1707
constexpr TypedWhichId< SvxULSpaceItem > RES_UL_SPACE(92)
bool IsViewLocked() const
Definition: viewsh.hxx:462
bool IsOutlineRule() const
Definition: numrule.hxx:242
Definition: view.hxx:144
SELECTFUNC m_fnKillSel
Definition: wrtsh.hxx:114
const SwFrameFormat * GetHeaderFormat() const
Definition: fmthdft.hxx:54
sal_uInt16 nPos
const SfxPoolItem * GetCurItem() const
bool IsSelFrameMode() const
Definition: wrtsh.hxx:173
SwTextFormatColl * GetParaStyle(const OUString &rCollName, GetStyle eCreate=GETSTYLE_NOCREATE)
Definition: wrtsh1.cxx:1635
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
Definition: ndtxt.hxx:856
void UpdateFlyFrame()
Definition: frmmgr.cxx:160
SwTextNode * MakeTextNode(const SwNodeIndex &rWhere, SwTextFormatColl *pColl, bool bNewFrames=true)
Implementations of "Make...Node" are in the given .cxx-files.
Definition: ndtxt.cxx:105
void EndAction(const bool bIdleEnd=false)
Definition: crsrsh.cxx:243
Base class of the Writer document model elements.
Definition: node.hxx:81
SwTextFormatColl * GetTextColl() const
Definition: ndtxt.hxx:850
typedef void(CALLTYPE *GetFuncDataPtr)(sal_uInt16 &nNo