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