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