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 
29 #include <svx/dialogs.hrc>
30 #include <svx/svxids.hrc>
31 
32 #include <math.h>
33 #include <hintids.hxx>
34 #include <sot/exchange.hxx>
35 #include <svx/hdft.hxx>
36 #include <svx/svdview.hxx>
37 #include <svl/itemiter.hxx>
38 #include <tools/bigint.hxx>
39 #include <svtools/insdlg.hxx>
40 #include <sfx2/frmdescr.hxx>
41 #include <sfx2/ipclient.hxx>
42 #include <svtools/ehdl.hxx>
43 #include <svtools/soerr.hxx>
45 #include <editeng/rsiditem.hxx>
46 #include <editeng/sizeitem.hxx>
48 #include <editeng/svxacorr.hxx>
49 #include <editeng/ulspitem.hxx>
50 #include <vcl/graph.hxx>
51 #include <sfx2/printer.hxx>
52 #include <unotools/charclass.hxx>
54 #include <svx/svxdlg.hxx>
55 #include <svx/extrusionbar.hxx>
56 #include <svx/fontworkbar.hxx>
57 #include <frmfmt.hxx>
58 #include <fmtftn.hxx>
59 #include <fmthdft.hxx>
60 #include <fmtpdsc.hxx>
61 #include <txtfrm.hxx>
62 #include <wdocsh.hxx>
63 #include <basesh.hxx>
64 #include <swmodule.hxx>
65 #include <wrtsh.hxx>
66 #include <view.hxx>
67 #include <uitool.hxx>
68 #include <cmdid.h>
69 #include <cfgitems.hxx>
70 #include <pagedesc.hxx>
71 #include <frmmgr.hxx>
72 #include <shellio.hxx>
73 #include <uinums.hxx>
74 #include <swundo.hxx>
75 #include <swcli.hxx>
76 #include <poolfmt.hxx>
77 #include <wview.hxx>
78 #include <edtwin.hxx>
79 #include <fmtcol.hxx>
80 #include <swtable.hxx>
81 #include <caption.hxx>
82 #include <viscrs.hxx>
83 #include <swdtflvr.hxx>
84 #include <doc.hxx>
86 #include <SwStyleNameMapper.hxx>
87 #include <sfx2/request.hxx>
88 #include <paratr.hxx>
89 #include <ndtxt.hxx>
90 #include <editeng/acorrcfg.hxx>
91 #include <IMark.hxx>
92 #include <sfx2/bindings.hxx>
93 #include <fchrfmt.hxx>
94 #include <flyfrm.hxx>
95 
96 // -> #111827#
97 #include <SwRewriter.hxx>
98 #include <strings.hrc>
99 // <- #111827#
100 
102 #include <sfx2/viewfrm.hxx>
103 #include <vcl/uitest/logger.hxx>
105 
106 #include <PostItMgr.hxx>
107 #include <FrameControlsManager.hxx>
108 #include <fldmgr.hxx>
109 #include <docufld.hxx>
110 #include <IDocumentFieldsAccess.hxx>
111 #include <fmtfld.hxx>
112 
113 #include <sfx2/msgpool.hxx>
114 #include <sfx2/msg.hxx>
115 #include <svtools/embedhlp.hxx>
116 #include <svx/postattr.hxx>
117 #include <comphelper/lok.hxx>
118 #include <memory>
119 
120 using namespace sw::mark;
121 using namespace com::sun::star;
122 namespace {
123 
124 void collectUIInformation(const OUString& rAction, const OUString& aParameters)
125 {
126  EventDescription aDescription;
127  aDescription.aAction = rAction;
128  aDescription.aParameters = {{"parameters", aParameters}};
129  aDescription.aID = "writer_edit";
130  aDescription.aKeyWord = "SwEditWinUIObject";
131  aDescription.aParent = "MainWindow";
132  UITestLogger::getInstance().logEvent(aDescription);
133 }
134 
135 }
136 
137 #define BITFLD_INI_LIST \
138  m_bClearMark = \
139  m_bIns = true;\
140  m_bAddMode = \
141  m_bBlockMode = \
142  m_bExtMode = \
143  m_bInSelect = \
144  m_bLayoutMode = \
145  m_bSelWrd = \
146  m_bSelLn = \
147  m_bRetainSelection = false; \
148  m_bIsInClickToEdit = false;
149 
151 {
153  if( pACorr && !pACorr->IsAutoCorrFlag( ACFlags::CapitalStartSentence | ACFlags::CapitalStartWord |
154  ACFlags::AddNonBrkSpace | ACFlags::ChgOrdinalNumber |
155  ACFlags::ChgToEnEmDash | ACFlags::SetINetAttr | ACFlags::Autocorrect ))
156  pACorr = nullptr;
157  return pACorr;
158 }
159 
160 void SwWrtShell::NoEdit(bool bHideCursor)
161 {
162  if(bHideCursor)
163  HideCursor();
164 }
165 
167 {
168  if (CanInsert())
169  {
170  ShowCursor();
171  }
172 }
173 
175 {
176  SwMvContext aMvContext(this);
177  if(IsEndPara() && !IsSttPara())
178  return true;
179 
180  return IsEndWord();
181 }
182 
183 // Insert string
184 void SwWrtShell::InsertByWord( const OUString & rStr)
185 {
186  if( !rStr.isEmpty() )
187  {
188  bool bDelim = GetAppCharClass().isLetterNumeric( rStr, 0 );
189  sal_Int32 nPos = 0, nStt = 0;
190  for( ; nPos < rStr.getLength(); nPos++ )
191  {
192  bool bTmpDelim = GetAppCharClass().isLetterNumeric( rStr, nPos );
193  if( bTmpDelim != bDelim )
194  {
195  Insert( rStr.copy( nStt, nPos - nStt ));
196  nStt = nPos;
197  }
198  }
199  if( nStt != nPos )
200  Insert( rStr.copy( nStt, nPos - nStt ));
201  }
202 }
203 
204 void SwWrtShell::Insert( const OUString &rStr )
205 {
206  ResetCursorStack();
207  if( !CanInsert() )
208  return;
209 
210  bool bStarted = false;
211  bool bHasSel = HasSelection(),
212  bCallIns = m_bIns /*|| bHasSel*/;
213  bool bDeleted = false;
214 
215  SfxItemSet aCharAttrSet(
216  GetAttrPool(),
219 
220  if( bHasSel || ( !m_bIns && SelectHiddenRange() ) )
221  {
222  // Only here parenthesizing, because the normal
223  // insert is already in parentheses at Editshell.
224  StartAllAction();
225 
226  SwRewriter aRewriter;
227 
228  aRewriter.AddRule(UndoArg1, GetCursorDescr());
229  aRewriter.AddRule(UndoArg2, SwResId(STR_YIELDS));
230  {
231  OUString aTmpStr;
232  aTmpStr += SwResId(STR_START_QUOTE);
233  aTmpStr += rStr;
234  aTmpStr += SwResId(STR_END_QUOTE);
235 
236  aRewriter.AddRule(UndoArg3, aTmpStr);
237  }
238 
239  // tdf#79717 Save character formatting of the start of the selection
240  const SwPosition *pStart = GetCursor()->Start();
241  SwPaM aPaM(pStart->nNode.GetNode(), pStart->nContent.GetIndex(),
242  pStart->nNode.GetNode(), pStart->nContent.GetIndex() + 1);
243  aCharAttrSet.ClearItem(RES_CHRATR_RSID);
244  GetPaMAttr(&aPaM, aCharAttrSet);
245 
246  StartUndo(SwUndoId::REPLACE, &aRewriter);
247  bStarted = true;
248  bDeleted = DelRight();
249  }
250 
251  bCallIns ?
252  SwEditShell::Insert2( rStr, bDeleted ) : SwEditShell::Overwrite( rStr );
253 
254  if( bDeleted )
255  {
256  // tdf#79717 Restore formatting of the deleted selection
257  SwPosition* pEnd = GetCursor()->Start();
258  SwPaM aPaM(pEnd->nNode.GetNode(), pEnd->nContent.GetIndex() - rStr.getLength(),
259  pEnd->nNode.GetNode(), pEnd->nContent.GetIndex());
260 
261  std::set<sal_uInt16> aAttribs;
262  for (sal_uInt16 i = RES_CHRATR_BEGIN; i < RES_CHRATR_END; ++i)
263  if (i != sal_uInt16(RES_CHRATR_RSID))
264  aAttribs.insert(aAttribs.end(), i);
265  aAttribs.insert(aAttribs.end(), RES_TXTATR_CHARFMT);
266  ResetAttr(aAttribs, &aPaM);
267 
268  SetAttrSet(aCharAttrSet, SetAttrMode::DEFAULT, &aPaM);
269  }
270 
271  if( bStarted )
272  {
273  EndAllAction();
274  EndUndo();
275  }
276 }
277 
278 // Maximum height limit not possible, because the maximum height
279 // of the current frame can not be obtained.
280 
281 void SwWrtShell::Insert( const OUString &rPath, const OUString &rFilter,
282  const Graphic &rGrf, SwFlyFrameAttrMgr *pFrameMgr,
283  RndStdIds nAnchorType )
284 {
285  ResetCursorStack();
286  if ( !CanInsert() )
287  return;
288 
289  StartAllAction();
290 
291  SwRewriter aRewriter;
292  aRewriter.AddRule(UndoArg1, SwResId(STR_GRAPHIC));
293 
294  StartUndo(SwUndoId::INSERT, &aRewriter);
295 
296  if ( HasSelection() )
297  DelRight();
298  // Inserted graphics in its own paragraph,
299  // if at the end of a non-empty paragraph.
300  //For i120928,avoid to split node
301 
302  EnterSelFrameMode();
303 
304  bool bSetGrfSize = true;
305  bool bOwnMgr = false;
306 
307  if ( !pFrameMgr )
308  {
309  bOwnMgr = true;
310  pFrameMgr = new SwFlyFrameAttrMgr( true, this, Frmmgr_Type::GRF );
311 
312  // CAUTION
313  // GetAttrSet makes an adjustment
314  // While pasting is a SwFrameSize present
315  // because of the DEF-Framesize
316  // These must be removed explicitly for the optimal size.
317  pFrameMgr->DelAttr(RES_FRM_SIZE);
318 
319  if (nAnchorType != RndStdIds::FLY_AT_PARA)
320  // Something other than at-para was requested.
321  pFrameMgr->SetAnchor(nAnchorType);
322  }
323  else
324  {
325  Size aSz( pFrameMgr->GetSize() );
326  if ( !aSz.Width() || !aSz.Height() )
327  {
328  aSz.setWidth(567);
329  aSz.setHeight( 567);
330  pFrameMgr->SetSize( aSz );
331  }
332  else if ( aSz.Width() != DFLT_WIDTH && aSz.Height() != DFLT_HEIGHT )
333  bSetGrfSize = false;
334 
335  pFrameMgr->SetHeightSizeType(ATT_FIX_SIZE);
336  }
337 
338  // Insert the graphic
339  SwFEShell::Insert(rPath, rFilter, &rGrf, &pFrameMgr->GetAttrSet());
340  if ( bOwnMgr )
341  pFrameMgr->UpdateAttrMgr();
342 
343  if( bSetGrfSize )
344  {
345  Size aGrfSize, aBound = GetGraphicDefaultSize();
346  GetGrfSize( aGrfSize );
347 
348  // Add the margin attributes to GrfSize,
349  // because these counts at the margin additionally
350  aGrfSize.AdjustWidth(pFrameMgr->CalcWidthBorder() );
351  aGrfSize.AdjustHeight(pFrameMgr->CalcHeightBorder() );
352 
353  const BigInt aTempWidth( aGrfSize.Width() );
354  const BigInt aTempHeight( aGrfSize.Height());
355 
356  // Fit width if necessary, scale down the height proportional thereafter.
357  if( aGrfSize.Width() > aBound.Width() )
358  {
359  aGrfSize.setWidth( aBound.Width() );
360  aGrfSize.setHeight( BigInt(aBound.Width()) * aTempHeight / aTempWidth );
361  }
362  // Fit height if necessary, scale down the width proportional thereafter.
363  if( aGrfSize.Height() > aBound.Height() )
364  {
365  aGrfSize.setHeight( aBound.Height() );
366  aGrfSize.setWidth( BigInt(aBound.Height()) * aTempWidth / aTempHeight );
367  }
368  pFrameMgr->SetSize( aGrfSize );
369  pFrameMgr->UpdateFlyFrame();
370  }
371  if ( bOwnMgr )
372  delete pFrameMgr;
373 
374  EndUndo();
375  EndAllAction();
376 }
377 
378 // Insert an OLE-Object into the CORE.
379 // if no object is transferred, then one will be created.
380 
382  sal_uInt16 nSlotId )
383 {
384  ResetCursorStack();
385  if( !CanInsert() )
386  return;
387 
388  if( !xRef.is() )
389  {
390  // temporary storage
392  uno::Reference < embed::XStorage > xStor = comphelper::OStorageHelper::GetTemporaryStorage();
393  bool bDoVerb = true;
394  if ( pName )
395  {
397  OUString aName;
398  // TODO/LATER: get aspect?
399  xObj.Assign( aCnt.CreateEmbeddedObject( pName->GetByteSequence(), aName ), embed::Aspects::MSOLE_CONTENT );
400  }
401  else
402  {
403  SvObjectServerList aServerList;
404  switch (nSlotId)
405  {
406  case SID_INSERT_OBJECT:
407  {
408  aServerList.FillInsertObjects();
409  aServerList.Remove( SwDocShell::Factory().GetClassId() );
410  [[fallthrough]];
411  }
412 
413  // TODO/LATER: recording! Convert properties to items
414  case SID_INSERT_FLOATINGFRAME:
415  {
416  SfxSlotPool* pSlotPool = SW_MOD()->GetSlotPool();
417  const SfxSlot* pSlot = pSlotPool->GetSlot(nSlotId);
418  OString aCmd(".uno:");
419  aCmd += pSlot->GetUnoName();
421  vcl::Window* pWin = GetWin();
422  ScopedVclPtr<SfxAbstractInsertObjectDialog> pDlg(pFact->CreateInsertObjectDialog(pWin ? pWin->GetFrameWeld() : nullptr,
423  OUString::fromUtf8( aCmd ), xStor, &aServerList));
424  if (pDlg)
425  {
426  pDlg->Execute();
427  bDoVerb = pDlg->IsCreateNew();
428  OUString aIconMediaType;
429  uno::Reference< io::XInputStream > xIconMetaFile = pDlg->GetIconIfIconified( &aIconMediaType );
430  xObj.Assign( pDlg->GetObject(),
431  xIconMetaFile.is() ? embed::Aspects::MSOLE_ICON : embed::Aspects::MSOLE_CONTENT );
432  if ( xIconMetaFile.is() )
433  xObj.SetGraphicStream( xIconMetaFile, aIconMediaType );
434  }
435 
436  break;
437  }
438 
439  default:
440  break;
441  }
442  }
443 
444  if ( xObj.is() )
445  {
446  if( InsertOleObject( xObj ) && bDoVerb )
447  {
448  SfxInPlaceClient* pClient = GetView().FindIPClient( xObj.GetObject(), &GetView().GetEditWin() );
449  if ( !pClient )
450  {
451  pClient = new SwOleClient( &GetView(), &GetView().GetEditWin(), xObj );
452  SetCheckForOLEInCaption( true );
453  }
454 
455  if ( xObj.GetViewAspect() == embed::Aspects::MSOLE_ICON )
456  {
457  SwRect aArea = GetAnyCurRect( CurRectType::FlyEmbeddedPrt, nullptr, xObj.GetObject() );
458  aArea.Pos() += GetAnyCurRect( CurRectType::FlyEmbedded, nullptr, xObj.GetObject() ).Pos();
459  MapMode aMapMode( MapUnit::MapTwip );
460  Size aSize = xObj.GetSize( &aMapMode );
461  aArea.Width( aSize.Width() );
462  aArea.Height( aSize.Height() );
463  RequestObjectResize( aArea, xObj.GetObject() );
464  }
465  else
466  CalcAndSetScale( xObj );
467 
468  //#50270# We don't need to handle error, this is handled by the
469  //DoVerb in the SfxViewShell
470  pClient->DoVerb(embed::EmbedVerbs::MS_OLEVERB_SHOW);
471 
472  // TODO/LATER: set document name - should be done in Client
473  }
474  }
475  }
476  else
477  {
478  if( HasSelection() )
479  DelRight();
480  InsertOleObject( xRef );
481  }
482 }
483 
484 // Insert object into the Core.
485 // From ClipBoard or Insert
486 
488 {
489  //tdf#125100 Ensure that ole object is initially shown as pictogram
490  comphelper::EmbeddedObjectContainer& rEmbeddedObjectContainer = mxDoc->GetDocShell()->getEmbeddedObjectContainer();
491  bool bSaveUserAllowsLinkUpdate = rEmbeddedObjectContainer.getUserAllowsLinkUpdate();
492  rEmbeddedObjectContainer.setUserAllowsLinkUpdate(true);
493 
494  ResetCursorStack();
495  StartAllAction();
496 
497  StartUndo(SwUndoId::INSERT);
498 
499  //Some differences between StarMath and any other objects:
500  //1. Selections should be deleted. For StarMath the Text should be
501  // passed to the Object
502  //2. If the cursor is at the end of a non empty paragraph a paragraph
503  // break should be inserted. StarMath objects are character bound and
504  // no break should be inserted.
505  //3. If an selection is passed to a StarMath object, this object should
506  // not be activated. false should be returned then.
507  bool bStarMath = true;
508  bool bActivate = true;
509 
510  // set parent to get correct VisArea(in case of object needing parent printer)
511  uno::Reference < container::XChild > xChild( xRef.GetObject(), uno::UNO_QUERY );
512  if ( xChild.is() )
513  xChild->setParent( mxDoc->GetDocShell()->GetModel() );
514 
515  SvGlobalName aCLSID( xRef->getClassID() );
516  bStarMath = ( SotExchange::IsMath( aCLSID ) != 0 );
517  if( IsSelection() )
518  {
519  if( bStarMath )
520  {
521  OUString aMathData;
522  GetSelectedText( aMathData, ParaBreakType::ToOnlyCR );
523 
524  if( !aMathData.isEmpty() && svt::EmbeddedObjectRef::TryRunningState( xRef.GetObject() ) )
525  {
526  uno::Reference < beans::XPropertySet > xSet( xRef->getComponent(), uno::UNO_QUERY );
527  if ( xSet.is() )
528  {
529  try
530  {
531  xSet->setPropertyValue("Formula", uno::makeAny( aMathData ) );
532  bActivate = false;
533  }
534  catch (const uno::Exception&)
535  {
536  }
537  }
538  }
539  }
540  DelRight();
541  }
542 
543  if ( !bStarMath )
544  SwFEShell::SplitNode( false, false );
545 
546  EnterSelFrameMode();
547 
548  SwFlyFrameAttrMgr aFrameMgr( true, this, Frmmgr_Type::OLE );
549  aFrameMgr.SetHeightSizeType(ATT_FIX_SIZE);
550 
551  SwRect aBound;
552  CalcBoundRect( aBound, aFrameMgr.GetAnchor() );
553 
554  //The Size should be suggested by the OLE server
555  MapMode aMapMode( MapUnit::MapTwip );
556  Size aSz = xRef.GetSize( &aMapMode );
557 
558  //Object size can be limited
559  if ( aSz.Width() > aBound.Width() )
560  {
561  //Always limit proportional.
562  aSz.setHeight( aSz.Height() * aBound.Width() / aSz.Width() );
563  aSz.setWidth( aBound.Width() );
564  }
565  aFrameMgr.SetSize( aSz );
566  SwFlyFrameFormat *pFormat = SwFEShell::InsertObject( xRef, &aFrameMgr.GetAttrSet() );
567 
568  // --> #i972#
569  if ( bStarMath && mxDoc->getIDocumentSettingAccess().get( DocumentSettingId::MATH_BASELINE_ALIGNMENT ) )
570  AlignFormulaToBaseline( xRef.GetObject() );
571 
572  if (pFlyFrameFormat)
573  *pFlyFrameFormat = pFormat;
574 
575  if ( SotExchange::IsChart( aCLSID ) )
576  {
577  uno::Reference< embed::XEmbeddedObject > xEmbeddedObj = xRef.GetObject();
578  if ( xEmbeddedObj.is() )
579  {
580  bool bDisableDataTableDialog = false;
582  uno::Reference< beans::XPropertySet > xProps( xEmbeddedObj->getComponent(), uno::UNO_QUERY );
583  if ( xProps.is() &&
584  ( xProps->getPropertyValue("DisableDataTableDialog") >>= bDisableDataTableDialog ) &&
585  bDisableDataTableDialog )
586  {
587  xProps->setPropertyValue("DisableDataTableDialog",
588  uno::makeAny( false ) );
589  xProps->setPropertyValue("DisableComplexChartTypes",
590  uno::makeAny( false ) );
591  uno::Reference< util::XModifiable > xModifiable( xProps, uno::UNO_QUERY );
592  if ( xModifiable.is() )
593  {
594  xModifiable->setModified( true );
595  }
596  }
597  }
598  }
599 
600  EndAllAction();
601  GetView().AutoCaption(OLE_CAP, &aCLSID);
602 
603  SwRewriter aRewriter;
604 
605  if ( bStarMath )
606  aRewriter.AddRule(UndoArg1, SwResId(STR_MATH_FORMULA));
607  else if ( SotExchange::IsChart( aCLSID ) )
608  aRewriter.AddRule(UndoArg1, SwResId(STR_CHART));
609  else
610  aRewriter.AddRule(UndoArg1, SwResId(STR_OLE));
611 
612  EndUndo(SwUndoId::INSERT, &aRewriter);
613 
614  rEmbeddedObjectContainer.setUserAllowsLinkUpdate(bSaveUserAllowsLinkUpdate);
615 
616  return bActivate;
617 }
618 
619 // The current selected OLE object will be loaded with the
620 // verb into the server.
621 
622 void SwWrtShell::LaunchOLEObj( long nVerb )
623 {
624  if ( GetCntType() == CNT_OLE &&
625  !GetView().GetViewFrame()->GetFrame().IsInPlace() )
626  {
627  svt::EmbeddedObjectRef& xRef = GetOLEObject();
628  OSL_ENSURE( xRef.is(), "OLE not found" );
629 
630  SfxInPlaceClient* pCli = GetView().FindIPClient( xRef.GetObject(), &GetView().GetEditWin() );
631  if ( !pCli )
632  pCli = new SwOleClient( &GetView(), &GetView().GetEditWin(), xRef );
633 
634  static_cast<SwOleClient*>(pCli)->SetInDoVerb( true );
635 
636  CalcAndSetScale( xRef );
637  pCli->DoVerb( nVerb );
638 
639  static_cast<SwOleClient*>(pCli)->SetInDoVerb( false );
640  CalcAndSetScale( xRef );
641  }
642 }
643 
645 {
646  try
647  {
648  sal_Int32 nState = xObj->getCurrentState();
649  if ( nState == css::embed::EmbedStates::INPLACE_ACTIVE
650  || nState == css::embed::EmbedStates::UI_ACTIVE )
651  {
652  SfxInPlaceClient* pCli =
653  GetView().FindIPClient( xObj.GetObject(), &(GetView().GetEditWin()) );
654  if ( pCli )
655  {
656  tools::Rectangle aArea = pCli->GetObjArea();
657  aArea += rOffset;
658  pCli->SetObjArea( aArea );
659  }
660  }
661  }
662  catch (const uno::Exception&)
663  {
664  }
665 }
666 
668  const SwRect *pFlyPrtRect,
669  const SwRect *pFlyFrameRect,
670  const bool bNoTextFramePrtAreaChanged )
671 {
672  // Setting the scale of the client. This arises from the difference
673  // between the VisArea of the object and the ObjArea.
674  OSL_ENSURE( xObj.is(), "ObjectRef not valid" );
675 
676  sal_Int64 nAspect = xObj.GetViewAspect();
677  if ( nAspect == embed::Aspects::MSOLE_ICON )
678  return; // the replacement image is completely controlled by container in this case
679 
680  sal_Int64 nMisc = 0;
681  bool bLinkingChart = false;
682 
683  try
684  {
685  nMisc = xObj->getStatus( nAspect );
686 
687  // This can surely only be a non-active object, if desired they
688  // get the new size set as VisArea (StarChart).
689  if( embed::EmbedMisc::MS_EMBED_RECOMPOSEONRESIZE & nMisc )
690  {
691  // TODO/MBA: testing
692  SwRect aRect( pFlyPrtRect ? *pFlyPrtRect
693  : GetAnyCurRect( CurRectType::FlyEmbeddedPrt, nullptr, xObj.GetObject() ));
694  if( !aRect.IsEmpty() )
695  {
696  // TODO/LEAN: getMapUnit can switch object to running state
697  // xObj.TryRunningState();
698 
699  MapUnit aUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( nAspect ) );
700 
701  // TODO/LATER: needs complete VisArea?!
702  Size aSize( OutputDevice::LogicToLogic(aRect.SVRect(), MapMode(MapUnit::MapTwip), MapMode(aUnit)).GetSize() );
703  awt::Size aSz;
704  aSz.Width = aSize.Width();
705  aSz.Height = aSize.Height();
706 
707  // Action 'setVisualAreaSize' doesn't have to turn on the
708  // modified state of the document, either.
709  bool bModified = false;
710  uno::Reference<util::XModifiable> xModifiable(xObj->getComponent(), uno::UNO_QUERY);
711  if (xModifiable.is())
712  bModified = xModifiable->isModified();
713  xObj->setVisualAreaSize( nAspect, aSz );
714  xModifiable.set(xObj->getComponent(), uno::UNO_QUERY);
715  if (xModifiable.is() && xModifiable->isModified() && !bModified)
716  xModifiable->setModified(bModified);
717 
718  // #i48419# - action 'UpdateReplacement' doesn't
719  // have to change the modified state of the document.
720  // This is only a workaround for the defect, that this action
721  // modifies a document after load, because unnecessarily the
722  // replacement graphic is updated, in spite of the fact that
723  // nothing has been changed.
724  // If the replacement graphic changes by this action, the document
725  // will be already modified via other mechanisms.
726  {
727  bool bResetEnableSetModified(false);
728  if ( GetDoc()->GetDocShell()->IsEnableSetModified() )
729  {
730  GetDoc()->GetDocShell()->EnableSetModified( false );
731  bResetEnableSetModified = true;
732  }
733 
734  //#i79576# don't destroy chart replacement images on load
735  //#i79578# don't request a new replacement image for charts to often
736  //a chart sends a modified call to the framework if it was changed
737  //thus the replacement update is already handled elsewhere
738  if ( !SotExchange::IsChart( xObj->getClassID() ) )
739  xObj.UpdateReplacement();
740 
741  if ( bResetEnableSetModified )
742  {
743  GetDoc()->GetDocShell()->EnableSetModified();
744  }
745  }
746  }
747 
748  // TODO/LATER: this is only a workaround,
749  uno::Reference< chart2::XChartDocument > xChartDocument( xObj->getComponent(), uno::UNO_QUERY );
750  bLinkingChart = ( xChartDocument.is() && !xChartDocument->hasInternalDataProvider() );
751  }
752  }
753  catch (const uno::Exception&)
754  {
755  // TODO/LATER: handle the error
756  return;
757  }
758 
759  SfxInPlaceClient* pCli = GetView().FindIPClient( xObj.GetObject(), &GetView().GetEditWin() );
760  if ( !pCli )
761  {
762  if ( (embed::EmbedMisc::EMBED_ACTIVATEIMMEDIATELY & nMisc)
763  || bLinkingChart
764  // --> OD #i117189# - refine condition for non-resizable objects
765  // non-resizable objects need to be set the size back by this method
766  || ( bNoTextFramePrtAreaChanged && nMisc & embed::EmbedMisc::EMBED_NEVERRESIZE ) )
767  {
768  pCli = new SwOleClient( &GetView(), &GetView().GetEditWin(), xObj );
769  }
770  else
771  return;
772  }
773 
774  // TODO/LEAN: getMapUnit can switch object to running state
775  // xObj.TryRunningState();
776 
777  awt::Size aSize;
778  try
779  {
780  aSize = xObj->getVisualAreaSize( nAspect );
781  }
782  catch (const embed::NoVisualAreaSizeException&)
783  {
784  OSL_FAIL("Can't get visual area size!" );
785  // the scaling will not be done
786  }
787  catch (const uno::Exception&)
788  {
789  // TODO/LATER: handle the error
790  OSL_FAIL("Can't get visual area size!" );
791  return;
792  }
793 
794  Size _aVisArea( aSize.Width, aSize.Height );
795 
796  Fraction aScaleWidth( 1, 1 );
797  Fraction aScaleHeight( 1, 1 );
798 
799  bool bUseObjectSize = false;
800 
801  // As long as there comes no reasonable size from the object,
802  // nothing can be scaled.
803  if( _aVisArea.Width() && _aVisArea.Height() )
804  {
805  const MapMode aTmp( MapUnit::MapTwip );
806  MapUnit aUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( nAspect ) );
807  _aVisArea = OutputDevice::LogicToLogic(_aVisArea, MapMode(aUnit), aTmp);
808  Size aObjArea;
809  if ( pFlyPrtRect )
810  aObjArea = pFlyPrtRect->SSize();
811  else
812  aObjArea = GetAnyCurRect( CurRectType::FlyEmbeddedPrt, nullptr, xObj.GetObject() ).SSize();
813 
814  // differ the aObjArea and _aVisArea by 1 Pixel then set new VisArea
815  long nX, nY;
816  SwSelPaintRects::Get1PixelInLogic( *this, &nX, &nY );
817  if( !( _aVisArea.Width() - nX <= aObjArea.Width() &&
818  _aVisArea.Width() + nX >= aObjArea.Width() &&
819  _aVisArea.Height()- nY <= aObjArea.Height()&&
820  _aVisArea.Height()+ nY >= aObjArea.Height() ))
821  {
822  if ( nMisc & embed::EmbedMisc::EMBED_NEVERRESIZE )
823  {
824  // the object must not be scaled,
825  // the size stored in object must be used for restoring
826  bUseObjectSize = true;
827  }
828  else
829  {
830  aScaleWidth = Fraction( aObjArea.Width(), _aVisArea.Width() );
831  aScaleHeight = Fraction( aObjArea.Height(), _aVisArea.Height());
832  }
833  }
834  }
835 
836  // Now is the favorable time to set the ObjArea.
837  // The Scaling must be considered.
838  SwRect aArea;
839  if ( pFlyPrtRect )
840  {
841  aArea = *pFlyPrtRect;
842  aArea += pFlyFrameRect->Pos();
843  }
844  else
845  {
846  aArea = GetAnyCurRect( CurRectType::FlyEmbeddedPrt, nullptr, xObj.GetObject() );
847  aArea.Pos() += GetAnyCurRect( CurRectType::FlyEmbedded, nullptr, xObj.GetObject() ).Pos();
848  }
849 
850  if ( bUseObjectSize )
851  {
852  // --> this moves non-resizable object so that when adding borders the baseline remains the same
853  const SwFlyFrameFormat *pFlyFrameFormat = dynamic_cast< const SwFlyFrameFormat * >( GetFlyFrameFormat() );
854  OSL_ENSURE( pFlyFrameFormat, "Could not find fly frame." );
855  if ( pFlyFrameFormat )
856  {
857  const Point &rPoint = pFlyFrameFormat->GetLastFlyFramePrtRectPos();
858  SwRect aRect( pFlyPrtRect ? *pFlyPrtRect
859  : GetAnyCurRect( CurRectType::FlyEmbeddedPrt, nullptr, xObj.GetObject() ));
860  aArea += rPoint - aRect.Pos(); // adjust area by diff of printing area position in order to keep baseline alignment correct.
861  }
862  aArea.Width ( _aVisArea.Width() );
863  aArea.Height( _aVisArea.Height() );
864  RequestObjectResize( aArea, xObj.GetObject() );
865  }
866  else
867  {
868  aArea.Width ( long( aArea.Width() / pCli->GetScaleWidth() ) );
869  aArea.Height( long( aArea.Height() / pCli->GetScaleHeight() ) );
870  }
871 
872  pCli->SetObjAreaAndScale( aArea.SVRect(), aScaleWidth, aScaleHeight );
873 }
874 
876  const SwRect &rFrame )
877 {
878  SfxInPlaceClient* pCli = GetView().FindIPClient( xObj.GetObject(), &GetView().GetEditWin());
879  if ( !pCli )
880  new SwOleClient( &GetView(), &GetView().GetEditWin(), xObj );
881  CalcAndSetScale( xObj, &rPrt, &rFrame );
882 }
883 
884 // Insert hard page break;
885 // Selections will be overwritten
886 void SwWrtShell::InsertPageBreak(const OUString *pPageDesc, const ::boost::optional<sal_uInt16>& oPgNum )
887 {
888  ResetCursorStack();
889  if( CanInsert() )
890  {
891  SwActContext aActContext(this);
893 
894  if ( !IsCursorInTable() )
895  {
896  if(HasSelection())
897  DelRight();
899  // delete the numbered attribute of the last line if the last line is empty
900  GetDoc()->ClearLineNumAttrs( *GetCursor()->GetPoint() );
901  }
902 
903  const SwPageDesc *pDesc = pPageDesc
904  ? FindPageDescByName( *pPageDesc, true ) : nullptr;
905  if( pDesc )
906  {
907  SwFormatPageDesc aDesc( pDesc );
908  aDesc.SetNumOffset( oPgNum );
909  SetAttrItem( aDesc );
910  }
911  else
912  SetAttrItem( SvxFormatBreakItem(SvxBreak::PageBefore, RES_BREAK) );
914  }
915  collectUIInformation("BREAK_PAGE", "parameter");
916 }
917 
918 // Insert hard page break;
919 // Selections will be overwritten
920 
922 {
923  ResetCursorStack();
924  if( CanInsert() )
925  {
926  if(HasSelection())
927  DelRight();
928 
929  const sal_Unicode cIns = 0x0A;
930  SvxAutoCorrect* pACorr = lcl_IsAutoCorr();
931  if( pACorr )
932  AutoCorrect( *pACorr, cIns );
933  else
934  SwWrtShell::Insert( OUString( cIns ) );
935  }
936 }
937 
938 // Insert hard column break;
939 // Selections will be overwritten
940 
942 {
943  SwActContext aActContext(this);
944  ResetCursorStack();
945  if( CanInsert() )
946  {
948 
949  if ( !IsCursorInTable() )
950  {
951  if(HasSelection())
952  DelRight();
953  SwFEShell::SplitNode( false, false );
954  }
955  SetAttrItem(SvxFormatBreakItem(SvxBreak::ColumnBefore, RES_BREAK));
956 
958  }
959 }
960 
961 // Insert footnote
962 // rStr - optional footnote mark
963 
964 void SwWrtShell::InsertFootnote(const OUString &rStr, bool bEndNote, bool bEdit )
965 {
966  ResetCursorStack();
967  if( CanInsert() )
968  {
969  if(HasSelection())
970  {
971  //collapse cursor to the end
972  if(!IsCursorPtAtEnd())
973  SwapPam();
974  ClearMark();
975  }
976  SwPosition aPos = *GetCursor()->GetPoint();
977  SwFormatFootnote aFootNote( bEndNote );
978  if(!rStr.isEmpty())
979  aFootNote.SetNumStr( rStr );
980 
981  SetAttrItem(aFootNote);
982 
983  if( bEdit )
984  {
985  // For editing the footnote text.
986  Left(CRSR_SKIP_CHARS, false, 1, false );
987  GotoFootnoteText();
988  }
989  m_aNavigationMgr.addEntry(aPos);
990  }
991 }
992 
993 // SplitNode; also, because
994 // - of deleting selected content;
995 // - of reset of the Cursorstack if necessary.
996 
997 void SwWrtShell::SplitNode( bool bAutoFormat )
998 {
999  ResetCursorStack();
1000  if( CanInsert() )
1001  {
1002  SwActContext aActContext(this);
1003 
1004  m_rView.GetEditWin().FlushInBuffer();
1005  bool bHasSel = HasSelection();
1006  if( bHasSel )
1007  {
1008  StartUndo( SwUndoId::INSERT );
1009  DelRight();
1010  }
1011 
1012  SwFEShell::SplitNode( bAutoFormat );
1013  if( bHasSel )
1014  EndUndo( SwUndoId::INSERT );
1015  }
1016 }
1017 
1018 // Turn on numbering
1019 // Parameter: Optional specification of a name for the named list;
1020 // this indicates a position if it is possible to convert them
1021 // into a number and less than nMaxRules.
1022 
1023 // To test the CharFormats at the numbering
1024 // external void SetNumChrFormat( SwWrtShell*, SwNumRules& );
1025 
1026 // -> #i40041#
1027 // Preconditions (as far as OD has figured out):
1028 // - <SwEditShell::HasNumber()> is false, if <bNum> is true
1029 // - <SwEditShell::HasBullet()> is false, if <bNum> is false
1030 // Behavior of method is determined by the current situation at the current
1031 // cursor position in the document.
1033 {
1034  // determine numbering rule found at current cursor position in the document.
1035  const SwNumRule* pCurRule = GetNumRuleAtCurrCursorPos();
1036 
1037  StartUndo(SwUndoId::NUMORNONUM);
1038 
1039  const SwNumRule * pNumRule = pCurRule;
1040 
1041  // - activate outline rule respectively turning on outline rule for
1042  // current text node. But, only for turning on a numbering (<bNum> == true).
1043  // - overwrite found numbering rule at current cursor position, if
1044  // no numbering rule can be retrieved from the paragraph style.
1045  bool bContinueFoundNumRule( false );
1046  bool bActivateOutlineRule( false );
1047  int nActivateOutlineLvl( MAXLEVEL ); // only relevant, if <bActivateOutlineRule> == true
1049  if ( pColl )
1050  {
1051  // retrieve numbering rule at paragraph
1052  // style, which is found at current cursor position in the document.
1053  SwNumRule* pCollRule = mxDoc->FindNumRulePtr(pColl->GetNumRule().GetValue());
1054  // #125993# - The outline numbering rule isn't allowed
1055  // to be derived from a parent paragraph style to a derived one.
1056  // Thus check, if the found outline numbering rule is directly
1057  // set at the paragraph style <pColl>. If not, set <pCollRule> to NULL
1058  if ( pCollRule && pCollRule == GetDoc()->GetOutlineNumRule() )
1059  {
1060  const SwNumRule* pDirectCollRule =
1061  mxDoc->FindNumRulePtr(pColl->GetNumRule( false ).GetValue());
1062  if ( !pDirectCollRule )
1063  {
1064  pCollRule = nullptr;
1065  }
1066  }
1067 
1068  if ( !pCollRule )
1069  {
1070  pNumRule = pCollRule;
1071  }
1072  // no activation or continuation of outline numbering in Writer/Web document
1073  else if ( bNum &&
1074  !dynamic_cast<SwWebDocShell*>(GetDoc()->GetDocShell()) &&
1075  pCollRule == GetDoc()->GetOutlineNumRule() )
1076  {
1077  if ( pNumRule == pCollRule )
1078  {
1079  // check, if text node at current cursor positioned is counted.
1080  // If not, let it been counted. Then it has to be checked,
1081  // of the outline numbering has to be activated or continued.
1082  SwTextNode const*const pTextNode = sw::GetParaPropsNode(
1083  *GetLayout(), GetCursor()->GetPoint()->nNode);
1084  if ( pTextNode && !pTextNode->IsCountedInList() )
1085  {
1086  // check, if numbering of the outline level of the paragraph
1087  // style is active. If not, activate this outline level.
1088  nActivateOutlineLvl = pColl->GetAssignedOutlineStyleLevel();
1089  OSL_ENSURE( pColl->IsAssignedToListLevelOfOutlineStyle(),
1090  "<SwWrtShell::NumOrBulletOn(..)> - paragraph style with outline rule, but no outline level" );
1091  if ( pColl->IsAssignedToListLevelOfOutlineStyle() &&
1092  pCollRule->Get( static_cast<sal_uInt16>(nActivateOutlineLvl) ).GetNumberingType()
1093  == SVX_NUM_NUMBER_NONE )
1094  {
1095  // activate outline numbering
1096  bActivateOutlineRule = true;
1097  }
1098  else
1099  {
1100  // turning on outline numbering at current cursor position
1101  bContinueFoundNumRule = true;
1102  }
1103  }
1104  else
1105  {
1106  // #i101234#
1107  // activate outline numbering, because from the precondition
1108  // it's known, that <SwEdit::HasNumber()> == false
1109  bActivateOutlineRule = true;
1110  nActivateOutlineLvl = pColl->GetAssignedOutlineStyleLevel();
1111  }
1112  }
1113  else if ( !pNumRule )
1114  {
1115  // #i101234#
1116  // Check, if corresponding list level of the outline numbering
1117  // has already a numbering format set.
1118  nActivateOutlineLvl = pColl->GetAssignedOutlineStyleLevel();
1119  if ( pCollRule->Get( static_cast<sal_uInt16>(nActivateOutlineLvl) ).GetNumberingType()
1120  == SVX_NUM_NUMBER_NONE )
1121  {
1122  // activate outline numbering, because from the precondition
1123  // it's known, that <SwEdit::HasNumber()> == false
1124  bActivateOutlineRule = true;
1125  }
1126  else
1127  {
1128  // turning on outline numbering at current cursor position
1129  bContinueFoundNumRule = true;
1130  }
1131  }
1132  else
1133  {
1134  // check, if numbering of the outline level of the paragraph
1135  // style is active. If not, activate this outline level.
1136  nActivateOutlineLvl = pColl->GetAssignedOutlineStyleLevel();
1137  OSL_ENSURE( pColl->IsAssignedToListLevelOfOutlineStyle(),
1138  "<SwWrtShell::NumOrBulletOn(..)> - paragraph style with outline rule, but no outline level" );
1139  if ( pColl->IsAssignedToListLevelOfOutlineStyle() &&
1140  pCollRule->Get( static_cast<sal_uInt16>(nActivateOutlineLvl) ).GetNumberingType()
1141  == SVX_NUM_NUMBER_NONE )
1142  {
1143  // activate outline numbering
1144  bActivateOutlineRule = true;
1145  }
1146  else
1147  {
1148  // turning on outline numbering at current cursor position
1149  bContinueFoundNumRule = true;
1150  }
1151  }
1152  pNumRule = pCollRule;
1153  }
1154  }
1155 
1156  // Only automatic numbering/bullet rules should be changed.
1157  // Note: The outline numbering rule is also an automatic one. It's only
1158  // changed, if it has to be activated.
1159  if ( pNumRule )
1160  {
1161  if ( !pNumRule->IsAutoRule() )
1162  {
1163  pNumRule = nullptr;
1164  }
1165  else if ( pNumRule == GetDoc()->GetOutlineNumRule() &&
1166  !bActivateOutlineRule && !bContinueFoundNumRule )
1167  {
1168  pNumRule = nullptr;
1169  }
1170  }
1171 
1172  // Search for a previous numbering/bullet rule to continue it.
1173  OUString sContinuedListId;
1174  if ( !pNumRule )
1175  {
1176  pNumRule = GetDoc()->SearchNumRule( *GetCursor()->GetPoint(),
1177  false, bNum, false, 0,
1178  sContinuedListId, GetLayout() );
1179  bContinueFoundNumRule = pNumRule != nullptr;
1180  }
1181 
1182  if (pNumRule)
1183  {
1184  SwNumRule aNumRule(*pNumRule);
1185 
1186  // do not change found numbering/bullet rule, if it should only be continued.
1187  if ( !bContinueFoundNumRule )
1188  {
1189  SwTextNode const*const pTextNode = sw::GetParaPropsNode(
1190  *GetLayout(), GetCursor()->GetPoint()->nNode);
1191 
1192  if (pTextNode)
1193  {
1194  // use above retrieve outline level, if outline numbering has to be activated.
1195  int nLevel = bActivateOutlineRule
1196  ? nActivateOutlineLvl
1197  : pTextNode->GetActualListLevel();
1198 
1199  if (nLevel < 0)
1200  nLevel = 0;
1201 
1202  if (nLevel >= MAXLEVEL)
1203  nLevel = MAXLEVEL - 1;
1204 
1205  SwNumFormat aFormat(aNumRule.Get(static_cast<sal_uInt16>(nLevel)));
1206 
1207  if (bNum)
1209  else
1210  {
1211  // #i63395# Only apply user defined default bullet font
1213  {
1214  const vcl::Font* pFnt = &numfunc::GetDefBulletFont();
1215  aFormat.SetBulletFont( pFnt );
1216  }
1217  aFormat.SetBulletChar( numfunc::GetBulletChar(static_cast<sal_uInt8>(nLevel)));
1218  aFormat.SetNumberingType(SVX_NUM_CHAR_SPECIAL);
1219  // #i93908# clear suffix for bullet lists
1220  aFormat.SetPrefix(OUString());
1221  aFormat.SetSuffix(OUString());
1222  }
1223  aNumRule.Set(static_cast<sal_uInt16>(nLevel), aFormat);
1224  }
1225  }
1226 
1227  // reset indent attribute on applying list style
1228  SetCurNumRule( aNumRule, false, sContinuedListId, true );
1229  }
1230  else
1231  {
1232  // #i95907#
1233  const SvxNumberFormat::SvxNumPositionAndSpaceMode ePosAndSpaceMode(
1235  SwNumRule aNumRule( GetUniqueNumRuleName(), ePosAndSpaceMode );
1236  // Append the character template at the numbering.
1237  SwCharFormat* pChrFormat;
1238  SwDocShell* pDocSh = GetView().GetDocShell();
1239  // #i63395#
1240  // Only apply user defined default bullet font
1243  : nullptr;
1244 
1245  if (bNum)
1246  {
1247  pChrFormat = GetCharFormatFromPool( RES_POOLCHR_NUM_LEVEL );
1248  }
1249  else
1250  {
1251  pChrFormat = GetCharFormatFromPool( RES_POOLCHR_BUL_LEVEL );
1252  }
1253 
1254  const SwTextNode *const pTextNode = sw::GetParaPropsNode(*GetLayout(),
1255  GetCursor()->GetPoint()->nNode);
1256  const SwTwips nWidthOfTabs = pTextNode
1257  ? pTextNode->GetWidthOfLeadingTabs()
1258  : 0;
1259  GetDoc()->getIDocumentContentOperations().RemoveLeadingWhiteSpace( *GetCursor()->GetPoint() );
1260 
1261  const bool bHtml = dynamic_cast<SwWebDocShell*>( pDocSh ) != nullptr;
1262  const bool bRightToLeft = IsInRightToLeftText();
1263  for( sal_uInt8 nLvl = 0; nLvl < MAXLEVEL; ++nLvl )
1264  {
1265  SwNumFormat aFormat( aNumRule.Get( nLvl ) );
1266  aFormat.SetCharFormat( pChrFormat );
1267 
1268  if (! bNum)
1269  {
1270  // #i63395#
1271  // Only apply user defined default bullet font
1272  if ( pFnt )
1273  {
1274  aFormat.SetBulletFont( pFnt );
1275  }
1276  aFormat.SetBulletChar( numfunc::GetBulletChar(nLvl) );
1277  aFormat.SetNumberingType(SVX_NUM_CHAR_SPECIAL);
1278  // #i93908# clear suffix for bullet lists
1279  aFormat.SetPrefix(OUString());
1280  aFormat.SetSuffix(OUString());
1281  }
1282 
1283  // #i95907#
1284  if ( ePosAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
1285  {
1286  if(bHtml && nLvl)
1287  {
1288  // 1/2" for HTML
1289  aFormat.SetAbsLSpace(nLvl * 720);
1290  }
1291  else if ( nWidthOfTabs > 0 )
1292  {
1293  aFormat.SetAbsLSpace(nWidthOfTabs + nLvl * 720);
1294  }
1295  }
1296 
1297  // #i38904# Default alignment for
1298  // numbering/bullet should be rtl in rtl paragraph:
1299  if ( bRightToLeft )
1300  {
1301  aFormat.SetNumAdjust( SvxAdjust::Right );
1302  }
1303 
1304  aNumRule.Set( nLvl, aFormat );
1305  }
1306 
1307  // #i95907#
1308  if ( pTextNode &&
1309  ePosAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
1310  {
1311 
1312  const SwTwips nTextNodeIndent = pTextNode->GetAdditionalIndentForStartingNewList();
1313  if ( ( nTextNodeIndent + nWidthOfTabs ) != 0 )
1314  {
1315  // #i111172#/fdo#85666
1316  // If text node is already inside a list, assure that the indents
1317  // are the same. Thus, adjust the indent change value by subtracting
1318  // indents of to be applied list style.
1319  SwTwips nIndentChange = nTextNodeIndent + nWidthOfTabs;
1320  if ( pTextNode->GetNumRule() )
1321  {
1322  int nLevel = pTextNode->GetActualListLevel();
1323 
1324  if (nLevel < 0)
1325  nLevel = 0;
1326 
1327  if (nLevel >= MAXLEVEL)
1328  nLevel = MAXLEVEL - 1;
1329 
1330  const SwNumFormat& aFormat( aNumRule.Get( nLevel ) );
1331  if ( aFormat.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT )
1332  {
1333  nIndentChange -= aFormat.GetIndentAt() + aFormat.GetFirstLineIndent();
1334  }
1335  }
1336  aNumRule.ChangeIndent( nIndentChange );
1337  }
1338  }
1339  // reset indent attribute on applying list style
1340  // start new list
1341  SetCurNumRule( aNumRule, true, OUString(), true );
1342  }
1343 
1344  EndUndo(SwUndoId::NUMORNONUM);
1345 }
1346 // <- #i40041#
1347 
1349 {
1350  NumOrBulletOn(true);
1351 }
1352 
1354 {
1355  const SwNumRule * pCurNumRule = GetNumRuleAtCurrCursorPos();
1356 
1357  if (pCurNumRule)
1358  {
1359  if (pCurNumRule->IsOutlineRule())
1360  {
1361  SwNumRule aNumRule(*pCurNumRule);
1362 
1363  SwTextNode * pTextNode =
1364  sw::GetParaPropsNode(*GetLayout(), GetCursor()->GetPoint()->nNode);
1365 
1366  if (pTextNode)
1367  {
1368  int nLevel = pTextNode->GetActualListLevel();
1369 
1370  if (nLevel < 0)
1371  nLevel = 0;
1372 
1373  if (nLevel >= MAXLEVEL)
1374  nLevel = MAXLEVEL - 1;
1375 
1376  SwNumFormat aFormat(aNumRule.Get(static_cast<sal_uInt16>(nLevel)));
1377 
1379  aNumRule.Set(nLevel, aFormat);
1380 
1381  // no start or continuation of a list - the outline style is only changed.
1382  SetCurNumRule( aNumRule, false );
1383  }
1384  }
1385  else
1386  {
1387  DelNumRules();
1388  }
1389 
1390  // #126346# - Cursor can not be anymore in front of
1391  // a label, because numbering/bullet is switched off.
1392  SetInFrontOfLabel( false );
1393  }
1394 }
1395 // <- #i29560#
1396 
1397 // Request Default-Bulletlist
1398 
1400 {
1401  NumOrBulletOn(false);
1402 }
1403 
1405 {
1406  // ContentType cannot be determined within a Start-/EndAction.
1407  // Because there is no invalid value TEXT will be returned.
1408  // The value does not matter, it may be updated in EndAction anyway.
1409 
1410  if (ActionPend())
1411  return IsSelFrameMode() ? SelectionType::Frame : SelectionType::Text;
1412 
1413  SwView &_rView = const_cast<SwView&>(GetView());
1414  if (_rView.GetPostItMgr() && _rView.GetPostItMgr()->HasActiveSidebarWin() )
1415  return SelectionType::PostIt;
1416 
1417  // Inserting a frame is not a DrawMode
1418  SelectionType nCnt;
1419  if ( !_rView.GetEditWin().IsFrameAction() &&
1420  (IsObjSelected() || (_rView.IsDrawMode() && !IsFrameSelected()) ))
1421  {
1422  if (GetDrawView()->IsTextEdit())
1424  else
1425  {
1426  if (GetView().IsFormMode()) // Only Form selected
1427  nCnt = SelectionType::DbForm;
1428  else
1429  nCnt = SelectionType::DrawObject; // Any draw object
1430 
1431  if (_rView.IsBezierEditMode())
1432  nCnt |= SelectionType::Ornament;
1433  else if( GetDrawView()->GetContext() == SdrViewContext::Media )
1434  nCnt |= SelectionType::Media;
1435 
1436  if (svx::checkForSelectedCustomShapes( GetDrawView(), true /* bOnlyExtruded */ ))
1437  {
1439  }
1440  sal_uInt32 nCheckStatus = 0;
1441  if (svx::checkForSelectedFontWork( GetDrawView(), nCheckStatus ))
1442  {
1443  nCnt |= SelectionType::FontWork;
1444  }
1445  }
1446 
1447  return nCnt;
1448  }
1449 
1450  nCnt = static_cast<SelectionType>(GetCntType());
1451 
1452  if ( IsFrameSelected() )
1453  {
1454  if (_rView.IsDrawMode())
1455  _rView.LeaveDrawCreate(); // clean up (Bug #45639)
1456  if ( !(nCnt & (SelectionType::Graphic | SelectionType::Ole)) )
1457  return SelectionType::Frame;
1458  }
1459 
1460  if ( IsCursorInTable() )
1461  nCnt |= SelectionType::Table;
1462 
1463  if ( IsTableMode() )
1465 
1466  // Do not pop up numbering toolbar, if the text node has a numbering of type SVX_NUM_NUMBER_NONE.
1467  const SwNumRule* pNumRule = GetNumRuleAtCurrCursorPos();
1468  if ( pNumRule )
1469  {
1470  const SwTextNode* pTextNd =
1471  sw::GetParaPropsNode(*GetLayout(), GetCursor()->GetPoint()->nNode);
1472 
1473  if ( pTextNd && pTextNd->IsInList() )
1474  {
1475  int nLevel = pTextNd->GetActualListLevel();
1476 
1477  if (nLevel < 0)
1478  nLevel = 0;
1479 
1480  if (nLevel >= MAXLEVEL)
1481  nLevel = MAXLEVEL - 1;
1482 
1483  const SwNumFormat& rFormat = pNumRule->Get(nLevel);
1484  if ( SVX_NUM_NUMBER_NONE != rFormat.GetNumberingType() )
1485  nCnt |= SelectionType::NumberList;
1486  }
1487  }
1488 
1489  return nCnt;
1490 }
1491 
1492 // Find the text collection with the name rCollname
1493 // Returns: Pointer at the collection or 0, if no
1494 // text collection with this name exists, or
1495 // this is a default template.
1496 
1497 SwTextFormatColl *SwWrtShell::GetParaStyle(const OUString &rCollName, GetStyle eCreate )
1498 {
1499  SwTextFormatColl* pColl = FindTextFormatCollByName( rCollName );
1500  if( !pColl && GETSTYLE_NOCREATE != eCreate )
1501  {
1503  if( USHRT_MAX != nId || GETSTYLE_CREATEANY == eCreate )
1504  pColl = GetTextCollFromPool( nId );
1505  }
1506  return pColl;
1507 }
1508 
1509 // Find the text collection with the name rCollname
1510 // Returns: Pointer at the collection or 0, if no
1511 // character template with this name exists, or
1512 // this is a default template or template is automatic.
1513 
1514 SwCharFormat *SwWrtShell::GetCharStyle(const OUString &rFormatName, GetStyle eCreate )
1515 {
1516  SwCharFormat* pFormat = FindCharFormatByName( rFormatName );
1517  if( !pFormat && GETSTYLE_NOCREATE != eCreate )
1518  {
1520  if( USHRT_MAX != nId || GETSTYLE_CREATEANY == eCreate )
1521  pFormat = static_cast<SwCharFormat*>(GetFormatFromPool( nId ));
1522  }
1523  return pFormat;
1524 }
1525 
1526 // Find the table format with the name rFormatname
1527 // Returns: Pointer at the collection or 0, if no
1528 // frame format with this name exists or
1529 // this is a default format or the format is automatic.
1530 
1531 SwFrameFormat *SwWrtShell::GetTableStyle(const OUString &rFormatName)
1532 {
1533  for( size_t i = GetTableFrameFormatCount(); i; )
1534  {
1535  SwFrameFormat *pFormat = &GetTableFrameFormat( --i );
1536  if( !pFormat->IsDefault() &&
1537  pFormat->GetName() == rFormatName && IsUsed( *pFormat ) )
1538  return pFormat;
1539  }
1540  return nullptr;
1541 }
1542 
1544  SwPaM* pPaM = GetCursor();
1545  m_aNavigationMgr.addEntry(*pPaM->GetPoint());
1546 }
1547 
1548 // Applying templates
1549 
1550 void SwWrtShell::SetPageStyle(const OUString &rCollName)
1551 {
1552  if( !SwCursorShell::HasSelection() && !IsSelFrameMode() && !IsObjSelected() )
1553  {
1554  SwPageDesc* pDesc = FindPageDescByName( rCollName, true );
1555  if( pDesc )
1556  ChgCurPageDesc( *pDesc );
1557  }
1558 }
1559 
1560 // Access templates
1561 
1562 OUString const & SwWrtShell::GetCurPageStyle() const
1563 {
1564  return GetPageDesc(GetCurPageDesc( false/*bCalcFrame*/ )).GetName();
1565 }
1566 
1567 // Change the current template referring to the existing change.
1568 
1570 {
1572 
1573  // Default cannot be changed
1574  if(pColl && !pColl->IsDefault())
1575  {
1576  FillByEx(pColl);
1577  // Also apply the template to remove hard attribute assignment.
1578  SetTextFormatColl(pColl);
1579  }
1580 }
1581 
1582 void SwWrtShell::AutoUpdatePara(SwTextFormatColl* pColl, const SfxItemSet& rStyleSet, SwPaM* pPaM )
1583 {
1584  SwPaM* pCursor = pPaM ? pPaM : GetCursor( );
1585  SfxItemSet aCoreSet(
1586  GetAttrPool(),
1587  svl::Items<
1591  SID_ATTR_TABSTOP_DEFAULTS,SID_ATTR_TABSTOP_OFFSET,
1592  SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER,
1593  SID_ATTR_PARA_MODEL, SID_ATTR_PARA_KEEP,
1594  SID_ATTR_PARA_PAGENUM, SID_ATTR_PARA_PAGENUM>{});
1595  GetPaMAttr( pCursor, aCoreSet );
1596  bool bReset = false;
1597  SfxItemIter aParaIter( aCoreSet );
1598  const SfxPoolItem* pParaItem = aParaIter.FirstItem();
1599  while( pParaItem )
1600  {
1601  if(!IsInvalidItem(pParaItem))
1602  {
1603  sal_uInt16 nWhich = pParaItem->Which();
1604  if(SfxItemState::SET == aCoreSet.GetItemState(nWhich) &&
1605  SfxItemState::SET == rStyleSet.GetItemState(nWhich))
1606  {
1607  aCoreSet.ClearItem(nWhich);
1608  bReset = true;
1609  }
1610  }
1611  pParaItem = aParaIter.NextItem();
1612  }
1613  StartAction();
1614  if(bReset)
1615  {
1616  ResetAttr( std::set<sal_uInt16>(), pCursor );
1617  SetAttrSet(aCoreSet, SetAttrMode::DEFAULT, pCursor);
1618  }
1619  mxDoc->ChgFormat(*pColl, rStyleSet );
1620  EndAction();
1621 }
1622 
1623 void SwWrtShell::AutoUpdateFrame( SwFrameFormat* pFormat, const SfxItemSet& rStyleSet )
1624 {
1625  StartAction();
1626 
1627  ResetFlyFrameAttr( &rStyleSet );
1628  pFormat->SetFormatAttr( rStyleSet );
1629 
1630  EndAction();
1631 }
1632 
1634 {
1635  ResetCursorStack();
1636  if(CanInsert())
1637  {
1638  bool bStarted = false;
1639  SwRewriter aRewriter;
1640 
1641  if(HasSelection())
1642  {
1643  // Only parentheses here, because the regular insert
1644  // is already clipped to the editshell
1645  StartAllAction();
1646 
1647  OUString aTmpStr1;
1648  aTmpStr1 += SwResId(STR_START_QUOTE);
1649  aTmpStr1 += GetSelText();
1650  aTmpStr1 += SwResId(STR_END_QUOTE);
1651  OUString aTmpStr3;
1652  aTmpStr3 += SwResId(STR_START_QUOTE);
1653  aTmpStr3 += OUStringLiteral1(cChar);
1654  aTmpStr3 += SwResId(STR_END_QUOTE);
1655  aRewriter.AddRule( UndoArg1, aTmpStr1 );
1656  aRewriter.AddRule( UndoArg2, SwResId(STR_YIELDS) );
1657  aRewriter.AddRule( UndoArg3, aTmpStr3 );
1658 
1659  StartUndo( SwUndoId::REPLACE, &aRewriter );
1660  bStarted = true;
1661  DelRight();
1662  }
1663  SwEditShell::AutoCorrect( rACorr, IsInsMode(), cChar );
1664 
1665  if(bStarted)
1666  {
1667  EndAllAction();
1668  EndUndo( SwUndoId::REPLACE, &aRewriter );
1669  }
1670  }
1671 }
1672 
1673 // Some kind of controlled copy ctor
1674 
1676  : SwFEShell(rSh, _pWin)
1677  , m_rView(rShell)
1678  , m_aNavigationMgr(*this)
1679 {
1681  SET_CURR_SHELL( this );
1682 
1683  SetSfxViewShell( static_cast<SfxViewShell *>(&rShell) );
1684  SetFlyMacroLnk( LINK(this, SwWrtShell, ExecFlyMac) );
1685 
1686  // place the cursor on the first field...
1687  IFieldmark *pBM = nullptr;
1688  if ( IsFormProtected() && ( pBM = GetFieldmarkAfter( ) ) !=nullptr ) {
1689  GotoFieldmark(pBM);
1690  }
1691 }
1692 
1694  const SwViewOption *pViewOpt )
1695  : SwFEShell(rDoc, _pWin, pViewOpt)
1696  , m_rView(rShell)
1697  , m_aNavigationMgr(*this)
1698 {
1700  SET_CURR_SHELL( this );
1701  SetSfxViewShell( static_cast<SfxViewShell *>(&rShell) );
1702  SetFlyMacroLnk( LINK(this, SwWrtShell, ExecFlyMac) );
1703 
1704  // place the cursor on the first field...
1705  IFieldmark *pBM = nullptr;
1706  if ( IsFormProtected() && ( pBM = GetFieldmarkAfter( ) ) !=nullptr ) {
1707  GotoFieldmark(pBM);
1708  }
1709 }
1710 
1712 {
1713  SET_CURR_SHELL( this );
1714  while(IsModePushed())
1715  PopMode();
1716  while(PopCursor(false))
1717  ;
1719 }
1720 
1722 {
1723  bool bRet = SwCursorShell::Pop(eDelete);
1724  if( bRet && IsSelection() )
1725  {
1728  }
1729  return bRet;
1730 }
1731 
1733 {
1734  if(IsSelFrameMode())
1735  {
1736  return false;
1737  }
1738 
1739  if(IsObjSelected())
1740  {
1741  return false;
1742  }
1743 
1744  if(GetView().GetDrawFuncPtr())
1745  {
1746  return false;
1747  }
1748 
1749  if(GetView().GetPostItMgr()->GetActiveSidebarWin())
1750  {
1751  return false;
1752  }
1753 
1754  return true;
1755 }
1756 
1757 void SwWrtShell::ChgDBData(const SwDBData& aDBData)
1758 {
1759  SwEditShell::ChgDBData(aDBData);
1760  //notify the db-beamer if available
1762 }
1763 
1764 OUString SwWrtShell::GetSelDescr() const
1765 {
1766  OUString aResult;
1767 
1768  SelectionType nSelType = GetSelectionType();
1769  switch (nSelType)
1770  {
1772  aResult = SwResId(STR_GRAPHIC);
1773 
1774  break;
1775  case SelectionType::Frame:
1776  {
1777  const SwFrameFormat * pFrameFormat = GetSelectedFrameFormat();
1778 
1779  if (pFrameFormat)
1780  aResult = pFrameFormat->GetDescription();
1781  }
1782  break;
1784  {
1785  aResult = SwResId(STR_DRAWING_OBJECTS);
1786  }
1787  break;
1788  default:
1789  if (mxDoc)
1790  aResult = GetCursorDescr();
1791  }
1792 
1793  return aResult;
1794 }
1795 
1797 {
1799  //#i115062# invalidate meta character slot
1801 }
1802 
1804 {
1807 }
1808 
1809 // Switch on/off header or footer of a page style - if an empty name is
1810 // given all styles are changed
1811 
1813  const OUString& rStyleName, bool bHeader, bool bOn, bool bShowWarning)
1814 {
1815  SdrView *const pSdrView = GetDrawView();
1816  if (pSdrView && pSdrView->IsTextEdit())
1817  { // tdf#107474 deleting header may delete active drawing object
1818  pSdrView->SdrEndTextEdit(true);
1819  }
1821  StartAllAction();
1822  StartUndo( SwUndoId::HEADER_FOOTER ); // #i7983#
1823  bool bExecute = true;
1824  bool bCursorSet = false;
1825  for( size_t nFrom = 0, nTo = GetPageDescCnt();
1826  nFrom < nTo; ++nFrom )
1827  {
1828  SwPageDesc aDesc( GetPageDesc( nFrom ));
1829  OUString sTmp(aDesc.GetName());
1830  if( rStyleName.isEmpty() || rStyleName == sTmp )
1831  {
1832  bool bChgd = false;
1833 
1834  if( bShowWarning && !bOn && GetActiveView() && GetActiveView() == &GetView() &&
1835  ( (bHeader && aDesc.GetMaster().GetHeader().IsActive()) ||
1836  (!bHeader && aDesc.GetMaster().GetFooter().IsActive()) ) )
1837  {
1838  bShowWarning = false;
1839  //Actions have to be closed while the dialog is showing
1840  EndAllAction();
1841 
1842  weld::Window* pParent = GetView().GetFrameWeld();
1843  short nResult;
1844  if (bHeader) {
1845  nResult = DeleteHeaderDialog(pParent).run();
1846  } else {
1847  nResult = DeleteFooterDialog(pParent).run();
1848  }
1849 
1850  bExecute = nResult == RET_YES;
1851  StartAllAction();
1852  if (nResult == RET_YES)
1854  }
1855  if( bExecute )
1856  {
1857  bChgd = true;
1858  SwFrameFormat &rMaster = aDesc.GetMaster();
1859  if(bHeader)
1860  rMaster.SetFormatAttr( SwFormatHeader( bOn ));
1861  else
1862  rMaster.SetFormatAttr( SwFormatFooter( bOn ));
1863  if( bOn )
1864  {
1865  SvxULSpaceItem aUL(bHeader ? 0 : MM50, bHeader ? MM50 : 0, RES_UL_SPACE );
1866  SwFrameFormat* pFormat = bHeader ?
1867  const_cast<SwFrameFormat*>(rMaster.GetHeader().GetHeaderFormat()) :
1868  const_cast<SwFrameFormat*>(rMaster.GetFooter().GetFooterFormat());
1869  pFormat->SetFormatAttr( aUL );
1870  }
1871  }
1872  if( bChgd )
1873  {
1874  ChgPageDesc( nFrom, aDesc );
1875 
1876  if( !bCursorSet && bOn )
1877  {
1878  if ( !IsHeaderFooterEdit() )
1880  bCursorSet = SetCursorInHdFt(
1881  rStyleName.isEmpty() ? SIZE_MAX : nFrom,
1882  bHeader );
1883  }
1884  }
1885  }
1886  }
1887  EndUndo( SwUndoId::HEADER_FOOTER ); // #i7983#
1888  EndAllAction();
1889 }
1890 
1892 {
1893  SwViewShell::SetShowHeaderFooterSeparator( eControl, bShow );
1894  if ( !bShow )
1896 }
1897 
1899 {
1900  SwPostItField* pPostIt = dynamic_cast<SwPostItField*>(rFieldMgr.GetCurField());
1901  bool bNew = !(pPostIt && pPostIt->GetTyp()->Which() == SwFieldIds::Postit);
1902  if (bNew || GetView().GetPostItMgr()->IsAnswer())
1903  {
1904  const SvxPostItAuthorItem* pAuthorItem = rReq.GetArg<SvxPostItAuthorItem>(SID_ATTR_POSTIT_AUTHOR);
1905  OUString sAuthor;
1906  if ( pAuthorItem )
1907  sAuthor = pAuthorItem->GetValue();
1908  else
1909  {
1910  std::size_t nAuthor = SW_MOD()->GetRedlineAuthor();
1911  sAuthor = SW_MOD()->GetRedlineAuthor(nAuthor);
1912  }
1913 
1914  const SvxPostItTextItem* pTextItem = rReq.GetArg<SvxPostItTextItem>(SID_ATTR_POSTIT_TEXT);
1915  OUString sText;
1916  if ( pTextItem )
1917  sText = pTextItem->GetValue();
1918 
1919  // If we have a text already registered for answer, use that
1920  if (GetView().GetPostItMgr()->IsAnswer() && !GetView().GetPostItMgr()->GetAnswerText().isEmpty())
1921  {
1922  sText = GetView().GetPostItMgr()->GetAnswerText();
1923  GetView().GetPostItMgr()->RegisterAnswerText(OUString());
1924  }
1925 
1926  if ( HasSelection() && !IsTableMode() )
1927  {
1928  KillPams();
1929  }
1930 
1931  // #i120513# Inserting a comment into an autocompletion crashes
1932  // --> suggestion has to be removed before
1934 
1935  SwInsertField_Data aData(TYP_POSTITFLD, 0, sAuthor, sText, 0);
1936 
1937  if (IsSelFrameMode())
1938  {
1939  SwFlyFrame* pFly = GetSelectedFlyFrame();
1940 
1941  // Remember the anchor of the selected object before deletion.
1942  std::unique_ptr<SwPosition> pAnchor;
1943  if (pFly)
1944  {
1945  SwFrameFormat* pFormat = pFly->GetFormat();
1946  if (pFormat)
1947  {
1948  RndStdIds eAnchorId = pFormat->GetAnchor().GetAnchorId();
1949  if ((eAnchorId == RndStdIds::FLY_AS_CHAR || eAnchorId == RndStdIds::FLY_AT_CHAR) && pFormat->GetAnchor().GetContentAnchor())
1950  {
1951  pAnchor.reset(new SwPosition(*pFormat->GetAnchor().GetContentAnchor()));
1952  }
1953  }
1954  }
1955 
1956  // A frame is selected, end frame selection.
1957  EnterStdMode();
1958  GetView().AttrChangedNotify(this);
1959 
1960  // Set up text selection, so the anchor of the frame will be the anchor of the
1961  // comment.
1962  if (pFly)
1963  {
1964  *GetCurrentShellCursor().GetPoint() = *pAnchor;
1965  SwFrameFormat* pFormat = pFly->GetFormat();
1966  if (pFormat && pFormat->GetAnchor().GetAnchorId() == RndStdIds::FLY_AS_CHAR)
1967  {
1968  Right(CRSR_SKIP_CELLS, /*bSelect=*/true, 1, /*bBasicCall=*/false, /*bVisual=*/true);
1969  }
1970  else if (pFormat && pFormat->GetAnchor().GetAnchorId() == RndStdIds::FLY_AT_CHAR)
1971  {
1972  aData.m_pAnnotationRange.reset(new SwPaM(*GetCurrentShellCursor().Start(),
1973  *GetCurrentShellCursor().End()));
1974  }
1975  }
1976  }
1977 
1978  rFieldMgr.InsertField( aData );
1979 
1980  Push();
1982  pPostIt = static_cast<SwPostItField*>(rFieldMgr.GetCurField());
1983  Pop(SwCursorShell::PopMode::DeleteCurrent); // Restore cursor position
1984  }
1985 
1986  // Client has disabled annotations rendering, no need to
1987  // focus the postit field
1989  return;
1990 
1991  if (pPostIt)
1992  {
1994  SwIterator<SwFormatField,SwFieldType> aIter( *pType );
1995  SwFormatField* pSwFormatField = aIter.First();
1996  while( pSwFormatField )
1997  {
1998  if ( pSwFormatField->GetField() == pPostIt )
1999  {
2000  pSwFormatField->Broadcast( SwFormatFieldHint( nullptr, SwFormatFieldHintWhich::FOCUS, &GetView() ) );
2001  break;
2002  }
2003  pSwFormatField = aIter.Next();
2004  }
2005  }
2006 }
2007 
2008 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void InsertLineBreak()
Definition: wrtsh1.cxx:921
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:233
long Width() const
css::uno::Reference< css::embed::XEmbeddedObject > CreateEmbeddedObject(const css::uno::Sequence< sal_Int8 > &, OUString &, OUString const *pBaseURL=nullptr)
void InsertPostIt(SwFieldMgr &rFieldMgr, SfxRequest &rReq)
Inserts a new annotation/comment at the current cursor position / selection.
Definition: wrtsh1.cxx:1898
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:119
void KillPams()
Definition: crsrsh.cxx:1009
#define RES_FRM_SIZE
Definition: hintids.hxx:194
virtual css::uno::Reference< css::io::XInputStream > GetIconIfIconified(OUString *pGraphicMediaType)=0
void SplitNode(bool bAutoFormat=false)
Definition: wrtsh1.cxx:997
virtual const SwFlyFrameFormat * GetFormat() const override
Definition: fly.cxx:2816
int GetAssignedOutlineStyleLevel() const
Definition: fmtcol.cxx:588
OUString const & GetCurPageStyle() const
Definition: wrtsh1.cxx:1562
void ChgDBData(const SwDBData &SwDBData)
Definition: edfld.cxx:308
Represents the style of a paragraph.
Definition: fmtcol.hxx:55
Rect of current FlyFrame.
static SvxAutoCorrCfg & Get()
Marks a position in the document model.
Definition: pam.hxx:35
virtual SdrEndTextEditKind SdrEndTextEdit(bool bDontDeleteReally=false)
void InsertByWord(const OUString &)
Definition: wrtsh1.cxx:184
bool IsAutoCorrFlag(ACFlags nFlag) const
const SwField * GetField() const
Definition: fmtfld.hxx:71
SdrView * GetDrawView()
Definition: vnew.cxx:376
Pagedescriptor Client of SwPageDesc that is "described" by the attribute.
Definition: fmtpdsc.hxx:35
size_t GetPageDescCnt() const
Definition: fedesc.cxx:39
void InsertPageBreak(const OUString *pPageDesc=nullptr, const ::boost::optional< sal_uInt16 > &rPgNum=boost::none)
Definition: wrtsh1.cxx:886
bool IsDrawMode()
Definition: view.hxx:526
void InsertObject( const svt::EmbeddedObjectRef &, SvGlobalName const *pName, sal_uInt16 nSlotId=0)
Definition: wrtsh1.cxx:381
bool IsDefault() const
Definition: format.hxx:109
bool SetObjArea(const tools::Rectangle &)
void BulletOn()
Definition: wrtsh1.cxx:1399
long AdjustWidth(long n)
SwView * GetActiveView()
Definition: swmodul1.cxx:123
const SwFormatHeader & GetHeader(bool=true) const
Definition: fmthdft.hxx:97
OutlinerParaObject * IsAnswer()
Definition: PostItMgr.hxx:258
void UpdateAttrMgr()
Definition: frmmgr.cxx:119
Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
const OUString & GetAnswerText()
Definition: PostItMgr.hxx:260
long Height() const
virtual SwFieldType * GetFieldType(SwFieldIds nResId, const OUString &rName, bool bDbFieldMatching) const =0
SwNodeIndex nNode
Definition: pam.hxx:37
bool IsTableMode() const
Definition: crsrsh.hxx:646
void SetFlyMacroLnk(const Link< const SwFlyFrameFormat *, void > &rLnk)
Definition: crsrsh.hxx:482
void ChangeHeaderOrFooter(const OUString &rStyleName, bool bHeader, bool bOn, bool bShowWarning)
Definition: wrtsh1.cxx:1812
void Remove(const SvGlobalName &)
SVX_NUM_NUMBER_NONE
static SvxAbstractDialogFactory * Create()
void StopQuickHelp()
Definition: edtwin.cxx:5827
bool Pop(SwCursorShell::PopMode=SwCursorShell::PopMode::DeleteStack)
Definition: wrtsh1.cxx:1721
bool IsAutoRule() const
Definition: numrule.hxx:227
virtual void SetShowHeaderFooterSeparator(FrameControlType eControl, bool bShow) override
Definition: wrtsh1.cxx:1891
#define RES_FRMATR_END
Definition: hintids.hxx:236
virtual OUString GetDescription() const
Definition: atrfrm.cxx:2774
Definition: doc.hxx:185
void SetNumStr(const OUString &rStr)
Definition: fmtftn.hxx:75
void HideControls(FrameControlType eType)
TElementType * Next()
Definition: calbck.hxx:376
void Height(long nNew)
Definition: swrect.hxx:189
sal_uInt16 sal_Char sal_Char * pDesc
sal_Int16 nId
css::uno::Sequence< sal_Int8 > GetByteSequence() const
void AutoCorrect(SvxAutoCorrect &rACorr, bool bInsertMode, sal_Unicode cChar)
Call AutoCorrect.
Definition: edws.cxx:254
SwUndoId EndUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Closes parenthesis of nUndoId, not used by UI.
Definition: edws.cxx:233
OUString GetSelDescr() const
Definition: wrtsh1.cxx:1764
SwNode & GetNode() const
Definition: ndindex.hxx:118
bool Left(sal_uInt16 nCnt, sal_uInt16 nMode, bool bAllowVisual=false)
Definition: crsrsh.hxx:352
long SwTwips
Definition: swtypes.hxx:49
SwTwips GetWidthOfLeadingTabs() const
Returns the width of leading tabs/blanks in this paragraph.
Definition: itratr.cxx:1397
void EnterStdMode()
Definition: select.cxx:552
SwEditWin & GetEditWin()
Definition: view.hxx:403
void SetPageStyle(const OUString &rCollName)
Definition: wrtsh1.cxx:1550
void Pos(const Point &rNew)
Definition: swrect.hxx:167
Of course Writer needs its own rectangles.
Definition: swrect.hxx:34
#define RES_TXTATR_CHARFMT
Definition: hintids.hxx:142
void AutoUpdatePara(SwTextFormatColl *pColl, const SfxItemSet &rStyleSet, SwPaM *pPaM=nullptr)
Definition: wrtsh1.cxx:1582
void Invalidate(sal_uInt16 nId)
SwFlyFrame * GetSelectedFlyFrame() const
Definition: fefly1.cxx:281
bool InsertField(const SwInsertField_Data &rData)
Definition: fldmgr.cxx:895
bool InsertOleObject(const svt::EmbeddedObjectRef &xObj, SwFlyFrameFormat **pFlyFrameFormat=nullptr)
Definition: wrtsh1.cxx:487
OUString GetCursorDescr() const
Returns textual description of the current selection.
Definition: crsrsh.cxx:3595
Frame cannot be moved in Var-direction.
Definition: fmtfsize.hxx:38
RndStdIds GetAnchor() const
Definition: frmmgr.hxx:166
void DelAttr(sal_uInt16 nId)
Definition: frmmgr.cxx:518
void EndAllAction()
Definition: edws.cxx:96
long AdjustHeight(long n)
int GetActualListLevel() const
Returns the actual list level of this text node, when it is a list item.
Definition: ndtxt.cxx:4096
const SfxPoolItem * FirstItem()
bool checkForSelectedCustomShapes(SdrView const *pSdrView, bool bOnlyExtruded)
static sal_uInt16 IsChart(const SvGlobalName &rName)
void NoEdit(bool bHideCursor=true)
Definition: wrtsh1.cxx:160
virtual void SetReadonlyOption(bool bSet)
Definition: viewsh.cxx:2303
bool HasSelection() const
Does the current cursor create a selection?
Definition: crsrsh.cxx:2486
const OUString & GetName() const
Definition: pagedesc.hxx:186
bool IsActive() const
Definition: fmthdft.hxx:89
Used by the UI to modify the document model.
Definition: wrtsh.hxx:88
static UITestLogger & getInstance()
IDocumentFieldsAccess const & getIDocumentFieldsAccess() const
Definition: doc.cxx:389
bool IsHeaderFooterEdit() const
Acts both for headers / footers, depending on the bShow(Header|Footer)Separator flags.
Definition: viewsh.hxx:565
weld::Window * GetFrameWeld() const
void logEvent(const EventDescription &rDescription)
bool isLetterNumeric(const OUString &rStr, sal_Int32 nPos) const
sal_uInt16 sal_Unicode
#define RES_CHRATR_END
Definition: hintids.hxx:114
bool IsAssignedToListLevelOfOutlineStyle() const
Definition: fmtcol.hxx:109
virtual void ApplyViewOptions(const SwViewOption &rOpt) override
Apply ViewOptions with Start-/EndAction.
Definition: editsh.cxx:1055
const SwTwips DFLT_HEIGHT
Definition: frmmgr.hxx:38
const SwView & GetView() const
Definition: wrtsh.hxx:426
SwFrameControlsManager & GetFrameControlsManager()
Definition: edtwin.cxx:6405
RET_YES
rtl::Reference< SwDoc > mxDoc
The document; never 0.
Definition: viewsh.hxx:174
SwIndex nContent
Definition: pam.hxx:38
sal_Unicode GetBulletChar(sal_uInt8 nLevel)
retrieve unicode of character used for the default bullet list for the given list level ...
Definition: number.cxx:1269
const OUString & GetName() const
Definition: format.hxx:111
void Edit()
Definition: wrtsh1.cxx:166
Footer, for pageformats Client of FrameFormat describing the footer.
Definition: fmthdft.hxx:64
SVX_NUM_ARABIC
const sal_uInt8 MAXLEVEL
Definition: swtypes.hxx:95
SELECTFUNC m_fnSetCursor
Definition: wrtsh.hxx:107
static SW_DLLPUBLIC sal_uInt16 GetPoolIdFromUIName(const OUString &rName, SwGetPoolIdFromName)
const SfxItemSet & GetAttrSet() const
Definition: frmmgr.hxx:123
#define RES_UL_SPACE
Definition: hintids.hxx:197
void SetNumOffset(const ::boost::optional< sal_uInt16 > &oNum)
Definition: fmtpdsc.hxx:66
Numbering symbols.
Definition: poolfmt.hxx:118
SwDoc * GetDoc() const
Definition: viewsh.hxx:284
#define RES_PARATR_BEGIN
Definition: hintids.hxx:160
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:644
bool IsEmpty() const
Definition: swrect.hxx:294
void Insert(SwField const &, SwPaM *pAnnotationRange=nullptr)
Definition: wrtsh2.cxx:71
void NumOn()
Definition: wrtsh1.cxx:1348
bool IsFormProtected()
Definition: crbm.cxx:278
SwWrtShell(SwWrtShell &, vcl::Window *pWin, SwView &rShell)
Definition: wrtsh1.cxx:1675
void SetReadonlyControls(bool bReadonly)
SVX_NUM_CHAR_SPECIAL
void LaunchOLEObj(long nVerb=0)
Definition: wrtsh1.cxx:622
void SetHeightSizeType(SwFrameSize eType)
Definition: frmmgr.cxx:576
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:136
Class for automated call of Start- and EndAction().
Definition: editsh.hxx:1016
bool IsSelection() const
Definition: crsrsh.hxx:878
std::unique_ptr< SwPaM > m_pAnnotationRange
Marks the PostIt field's annotation start/end if it differs from the cursor selection.
Definition: fldmgr.hxx:84
static css::uno::Reference< css::embed::XStorage > GetTemporaryStorage(const css::uno::Reference< css::uno::XComponentContext > &rxContext=css::uno::Reference< css::uno::XComponentContext >())
Style of a layout element.
Definition: frmfmt.hxx:57
virtual SwPaM & GetCurrentShellCursor() override
Return the current shell cursor.
Definition: crsrsh.cxx:175
bool HasSelection() const
Definition: wrtsh.hxx:139
#define SW_MOD()
Definition: swmodule.hxx:256
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SwFormatAnchor & GetAnchor(bool=true) const
Definition: fmtanchr.hxx:81
void Insert2(const OUString &, const bool bForceExpandHints=false)
Definition: editsh.cxx:85
bool IsFrameAction() const
Definition: edtwin.hxx:215
bool checkForSelectedFontWork(SdrView const *pSdrView, sal_uInt32 &nCheckStatus)
const SwFrameFormat * GetFooterFormat() const
Definition: fmthdft.hxx:85
const SwPosition * GetPoint() const
Definition: pam.hxx:207
bool SetCursorInHdFt(size_t nDescNo, bool bInHeader)
Definition: crstrvl.cxx:191
const vcl::Font & GetDefBulletFont()
retrieve font used for the default bullet list characters
Definition: number.cxx:1264
RndStdIds GetAnchorId() const
Definition: fmtanchr.hxx:65
SwFlyFrameFormat * InsertObject(const svt::EmbeddedObjectRef &, const SfxItemSet *pFlyAttrSet)
Definition: fefly1.cxx:891
const SwPosition * GetContentAnchor() const
Definition: fmtanchr.hxx:67
virtual void SetShowHeaderFooterSeparator(FrameControlType eControl, bool bShow)
Definition: viewsh.cxx:102
void Push()
store a copy of the current cursor on the cursor stack
Definition: crsrsh.cxx:2221
SwCharFormat * GetCharStyle(const OUString &rFormatName, GetStyle eCreate=GETSTYLE_NOCREATE)
Definition: wrtsh1.cxx:1514
SvxAutoCorrect * GetAutoCorrect()
SfxBindings & GetBindings()
TElementType * First()
Definition: calbck.hxx:345
int i
void Assign(const css::uno::Reference< css::embed::XEmbeddedObject > &xObj, sal_Int64 nAspect)
const OUString & GetValue() const
const SwPageDesc & GetPageDesc(size_t i) const
Definition: fedesc.cxx:127
const SfxPoolItem * NextItem()
void SetTextFormatColl(const css::uno::Any &rAny, SwPaM &rPaM)
const T * GetArg(sal_uInt16 nSlotId) const
void SetSfxViewShell(SfxViewShell *pNew)
Definition: viewsh.hxx:445
SwUndoId StartUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Undo: set up Undo parenthesis, return nUndoId of this parenthesis.
Definition: edws.cxx:222
SwField * GetCurField()
Definition: fldmgr.cxx:433
void AddRule(SwUndoArg eWhat, const OUString &rWith)
Definition: SwRewriter.cxx:29
#define RES_CHRATR_BEGIN
Definition: hintids.hxx:68
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:2813
void SetAnchor(RndStdIds eId)
Definition: frmmgr.cxx:210
void NumOrBulletOff()
Definition: wrtsh1.cxx:1353
#define SET_CURR_SHELL(shell)
Definition: swtypes.hxx:101
long ResetSelect(const Point *, bool)
Definition: select.cxx:337
void ToggleHeaderFooterEdit()
Definition: fews.cxx:1344
sal_uInt16 sal_Char * pName
virtual void SetReadonlyOption(bool bSet) override
Definition: wrtsh1.cxx:1803
#define CNT_OLE
Definition: editsh.hxx:133
GUIDCNamePair const aData
OUString SwResId(const char *pId)
Definition: swmodule.cxx:191
void SSize(const Size &rNew)
Definition: swrect.hxx:176
void PopMode()
Definition: select.cxx:288
void LeaveDrawCreate()
Definition: view.hxx:525
void Insert(const OUString &rGrfName, const OUString &rFltName, const Graphic *pGraphic, const SfxItemSet *pFlyAttrSet)
Definition: fefly1.cxx:808
const SwNumRuleItem & GetNumRule(bool=true) const
Definition: paratr.hxx:218
const char * GetUnoName() const
SwTextNode * GetParaPropsNode(SwRootFrame const &rLayout, SwNodeIndex const &rNode)
Definition: txtfrm.cxx:336
SwFieldType * GetTyp() const
Definition: fldbas.hxx:382
SwFrameFormat * GetTableStyle(const OUString &rFormatName)
Definition: wrtsh1.cxx:1531
SwFrameFormat * GetSelectedFrameFormat() const
If frame then frame style, else 0.
Definition: fefly1.cxx:1178
void ChangeIndent(const sal_Int32 nDiff)
change indent of all list levels by given difference
Definition: number.cxx:885
SW_DLLPUBLIC bool HasActiveSidebarWin() const
Definition: PostItMgr.cxx:2324
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:667
SelectionType
Definition: wrtsh.hxx:58
long GetIndentAt() const
virtual bool SetFormatAttr(const SfxPoolItem &rAttr)
Definition: format.cxx:458
const SwNumFormat & Get(sal_uInt16 i) const
Definition: number.cxx:83
const sal_uInt16 CRSR_SKIP_CELLS
Definition: swcrsr.hxx:64
static void Get1PixelInLogic(const SwViewShell &rSh, long *pX=nullptr, long *pY=nullptr)
Definition: viscrs.cxx:507
virtual css::uno::Reference< css::embed::XEmbeddedObject > GetObject()=0
void InsertFootnote(const OUString &, bool bEndNote=false, bool bEdit=true)
Definition: wrtsh1.cxx:964
FrameControlType
Definition: swtypes.hxx:246
Class for automated call of Start- and EndCursorMove().
Definition: editsh.hxx:1024
SwFrameFormat & GetMaster()
Definition: pagedesc.hxx:216
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:79
void Broadcast(const SfxHint &rHint)
void NumOrBulletOn(bool bNum)
Turns on numbering or bullets.
Definition: wrtsh1.cxx:1032
void addCurrentPosition()
Definition: wrtsh1.cxx:1543
void Set(sal_uInt16 i, const SwNumFormat *)
Definition: number.cxx:592
virtual ~SwWrtShell() override
Definition: wrtsh1.cxx:1711
void SetCharFormat(SwCharFormat *)
Definition: number.cxx:277
#define BITFLD_INI_LIST
Definition: wrtsh1.cxx:137
::sw::mark::IFieldmark * GetFieldmarkAfter()
Definition: crbm.cxx:290
virtual bool IsTextEdit() const final override
tools::Rectangle SVRect() const
Definition: swrect.hxx:282
long CalcWidthBorder()
Definition: frmmgr.hxx:133
SvxNumberFormat::SvxNumPositionAndSpaceMode GetDefaultPositionAndSpaceMode()
Definition: number.cxx:1386
weld::Window * GetFrameWeld() const
#define MM50
Definition: swtypes.hxx:59
general base class for all free-flowing frames
Definition: flyfrm.hxx:60
bool IsDefBulletFontUserDefined()
determine if default bullet font is user defined
Definition: number.cxx:1259
static MapUnit UnoEmbed2VCLMapUnit(sal_Int32 nUnoEmbedMapUnit)
unsigned char sal_uInt8
void Width(long nNew)
Definition: swrect.hxx:185
static void ClearSelection(SwWrtShell &rSh, const SwFrameShell *pCreator=nullptr)
Definition: swdtflvr.cxx:3876
const o3tl::enumarray< SvxAdjust, unsigned short > aSvxToUnoAdjust USHRT_MAX
Definition: unosett.cxx:261
sal_Int32 GetIndex() const
Definition: index.hxx:95
bool IsCountedInList() const
Definition: ndtxt.cxx:4239
const tools::Rectangle & GetObjArea() const
bool IsModePushed() const
Definition: wrtsh.hxx:130
void ChgPageDesc(size_t i, const SwPageDesc &)
Definition: fedesc.cxx:112
SwPostItMgr * GetPostItMgr()
Definition: view.hxx:622
bool CanInsert()
Definition: wrtsh1.cxx:1732
void NotifyDBChanged()
Definition: view.cxx:1850
Size GetSize(MapMode const *pTargetMapMode) const
size_t IsObjSelected() const
Definition: feshview.cxx:1167
void SetSize(const Size &rLSize)
Definition: frmmgr.cxx:597
void SetObjAreaAndScale(const tools::Rectangle &, const Fraction &, const Fraction &)
void AutoUpdateFrame(SwFrameFormat *pFormat, const SfxItemSet &rStyleSet)
Definition: wrtsh1.cxx:1623
SAL_DLLPRIVATE long SetCursorKillSel(const Point *, bool bProp)
Definition: select.cxx:320
Header, for PageFormats Client of FrameFormat describing the header.
Definition: fmthdft.hxx:33
#define FN_VIEW_META_CHARS
Definition: cmdid.h:160
void InsertColumnBreak()
Definition: wrtsh1.cxx:941
ErrCode DoVerb(long nVerb)
const SwPostItMgr * GetPostItMgr() const
Definition: viewsh.hxx:559
virtual bool IsCreateNew()=0
SwFormatColl * GetCurTextFormatColl(SwPaM &rPam, const bool bConditional)
Definition: unoobj.cxx:612
void AutoCorrect(SvxAutoCorrect &rACorr, sal_Unicode cChar)
Definition: wrtsh1.cxx:1633
OString const aName
void Overwrite(const OUString &)
Definition: editsh.cxx:174
static SvxAutoCorrect * lcl_IsAutoCorr()
Definition: wrtsh1.cxx:150
bool IsEndWrd()
Definition: wrtsh1.cxx:174
const sal_uInt16 CRSR_SKIP_CHARS
Definition: swcrsr.hxx:63
MapUnit
RndStdIds
SwTwips GetAdditionalIndentForStartingNewList() const
Definition: ndtxt.cxx:3247
bool IsInList() const
Definition: ndtxt.cxx:4343
static bool TryRunningState(const css::uno::Reference< css::embed::XEmbeddedObject > &)
const Point & GetLastFlyFramePrtRectPos() const
Definition: frmfmt.hxx:244
Left
void ChgDBData(const SwDBData &SwDBData)
Definition: wrtsh1.cxx:1757
SAL_DLLPRIVATE bool PopCursor(bool bUpdate, bool bSelect=false)
Definition: move.cxx:477
void SplitNode(bool bAutoFormat=false, bool bCheckTableStart=true)
Definition: editsh.cxx:188
bool Pop(PopMode)
delete cursor
Definition: crsrsh.cxx:2243
const Size & GetSize() const
Definition: frmmgr.hxx:137
long CalcHeightBorder()
Definition: frmmgr.hxx:134
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:875
std::map< OUString, OUString > aParameters
bool IsActive() const
Definition: fmthdft.hxx:58
sal_Int64 GetViewAspect() const
bool IsInvalidItem(const SfxPoolItem *pItem)
const SwTwips DFLT_WIDTH
Definition: frmmgr.hxx:37
#define RES_BREAK
Definition: hintids.hxx:199
SelectionType GetSelectionType() const
Definition: wrtsh1.cxx:1404
virtual void ApplyViewOptions(const SwViewOption &rOpt) override
Apply ViewOptions with Start-/EndAction.
Definition: wrtsh1.cxx:1796
void StartAllAction()
For all views of this document.
Definition: edws.cxx:85
const Fraction & GetScaleHeight() const
bool GotoFieldmark(::sw::mark::IFieldmark const *const pMark)
Definition: wrtsh3.cxx:90
sal_Int32 nPos
bool IsBezierEditMode()
Definition: viewdraw.cxx:627
void RegisterAnswerText(const OUString &aAnswerText)
Definition: PostItMgr.hxx:259
CharClass & GetAppCharClass()
Definition: init.cxx:745
void setWidth(long nWidth)
#define RES_FRMATR_BEGIN
Definition: hintids.hxx:192
SwFieldIds Which() const
Definition: fldbas.hxx:265
Rect of PrtArea of FlyFrame.
void QuickUpdateStyle()
Definition: wrtsh1.cxx:1569
sal_uInt16 Which() const
bool IsOutlineRule() const
Definition: numrule.hxx:239
Definition: view.hxx:146
SELECTFUNC m_fnKillSel
Definition: wrtsh.hxx:109
const SwFrameFormat * GetHeaderFormat() const
Definition: fmthdft.hxx:54
bool IsSelFrameMode() const
Definition: wrtsh.hxx:168
SwTextFormatColl * GetParaStyle(const OUString &rCollName, GetStyle eCreate=GETSTYLE_NOCREATE)
Definition: wrtsh1.cxx:1497
void UpdateFlyFrame()
Definition: frmmgr.cxx:143
#define RES_PARATR_END
Definition: hintids.hxx:180
#define RES_CHRATR_RSID
Definition: hintids.hxx:107
void setHeight(long nHeight)