LibreOffice Module sw (master)  1
drwbassh.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 <hintids.hxx>
21 #include <swtypes.hxx>
22 #include <sfx2/objface.hxx>
23 #include <sfx2/request.hxx>
24 #include <sfx2/bindings.hxx>
25 #include <sfx2/viewfrm.hxx>
26 #include <svx/svdview.hxx>
27 #include <svl/whiter.hxx>
29 #include <svx/anchorid.hxx>
30 #include <drawdoc.hxx>
31 #include <uitool.hxx>
32 #include <fmtornt.hxx>
33 #include <cmdid.h>
34 #include <swmodule.hxx>
35 #include <wrtsh.hxx>
36 #include <wview.hxx>
37 #include <edtwin.hxx>
38 #include <viewopt.hxx>
39 #include <dcontact.hxx>
40 #include <frmfmt.hxx>
41 #include <drawbase.hxx>
42 #include <drwbassh.hxx>
43 #include <swdtflvr.hxx>
44 #include <svx/svditer.hxx>
45 #define ShellClass_SwDrawBaseShell
46 #include <sfx2/msg.hxx>
47 #include <swslots.hxx>
48 #include <svx/svxdlg.hxx>
49 #include <swabstdlg.hxx>
50 #include <swundo.hxx>
51 #include <com/sun/star/text/HoriOrientation.hpp>
52 #include <com/sun/star/text/VertOrientation.hpp>
53 #include <com/sun/star/text/RelOrientation.hpp>
55 #include <fmtfollowtextflow.hxx>
56 
57 using namespace ::com::sun::star;
58 
60 
61 void SwDrawBaseShell::InitInterface_Impl()
62 {
63 }
64 
65 
67  : SwBaseShell(_rView)
68 {
69  GetShell().NoEdit();
70 
71  SwEditWin& rWin = GetView().GetEditWin();
72 
73  rWin.SetBezierMode(SID_BEZIER_MOVE);
74 
75  if ( !_rView.GetDrawFuncPtr() )
76  _rView.GetEditWin().StdDrawMode( OBJ_NONE, true );
77 
79 }
80 
82 {
83  GetView().ExitDraw();
84  GetShell().Edit();
86 }
87 
89 {
90  SwWrtShell *pSh = &GetShell();
91  SdrView* pSdrView = pSh->GetDrawView();
92  const SfxItemSet *pArgs = rReq.GetArgs();
93  sal_uInt16 nSlotId = rReq.GetSlot();
94  bool bChanged = pSdrView->GetModel()->IsChanged();
95  pSdrView->GetModel()->SetChanged(false);
96  const SfxPoolItem* pItem = nullptr;
97  if(pArgs)
98  pArgs->GetItemState(nSlotId, false, &pItem);
99 
100  bool bAlignPossible = pSh->IsAlignPossible();
101 
102  bool bTopParam = true, bBottomParam = true;
103  bool bDone = false;
105 
106  switch (nSlotId)
107  {
108  case FN_DRAW_WRAP_DLG:
109  {
110  if(pSdrView->AreObjectsMarked())
111  {
112  if(!pArgs)
113  {
114  const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
115  if( rMarkList.GetMark(0) != nullptr )
116  {
117  SfxItemSet aSet(
118  GetPool(),
119  svl::Items<
124  SID_HTML_MODE, SID_HTML_MODE,
126 
127  aSet.Put(SfxBoolItem(SID_HTML_MODE,
128  0 != ::GetHtmlMode(pSh->GetView().GetDocShell())));
129 
131 
132  pSh->GetObjAttr(aSet);
135 
136  if (pDlg->Execute() == RET_OK)
137  {
138  const SfxPoolItem* pWrapItem;
139  const SfxItemSet* pOutSet = pDlg->GetOutputItemSet();
140  if(SfxItemState::SET == pOutSet->GetItemState(FN_DRAW_WRAP_DLG, false, &pWrapItem))
141  {
142  short nLayer = static_cast<const SfxInt16Item*>(pWrapItem)->GetValue();
143  if (nLayer == 1)
144  pSh->SelectionToHeaven();
145  else
146  pSh->SelectionToHell();
147  }
148 
149  pSh->SetObjAttr(*pOutSet);
150  }
151  }
152  }
153  }
154  }
155  break;
156 
157  case SID_ATTR_TRANSFORM:
158  {
159  if(pSdrView->AreObjectsMarked())
160  {
161  if(!pArgs)
162  {
163  const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
164  if( rMarkList.GetMark(0) != nullptr )
165  {
166  SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
168  bool bCaption = false;
169 
170  // Allowed anchorages:
171  RndStdIds nAnchor = pSh->GetAnchorId();
172  SvxAnchorIds nAllowedAnchors = SvxAnchorIds::Paragraph | SvxAnchorIds::Character | SvxAnchorIds::Page;
173  sal_uInt16 nHtmlMode = ::GetHtmlMode(pSh->GetView().GetDocShell());
174 
175  if ( pSh->IsFlyInFly() )
176  nAllowedAnchors |= SvxAnchorIds::Fly;
177 
178  if (pObj->GetObjIdentifier() == OBJ_CAPTION )
179  bCaption = true;
180 
181  if (bCaption)
182  {
185  pFact->CreateCaptionDialog( rReq.GetFrameWeld(), pSdrView, nAllowedAnchors );
186  pDlg.reset(pCaptionDlg);
187  pCaptionDlg->SetValidateFramePosLink( LINK(this, SwDrawBaseShell, ValidatePosition) );
188  }
189  else
190  {
193  pFact->CreateSvxTransformTabDialog(rReq.GetFrameWeld(), nullptr, pSdrView, nAllowedAnchors);
194  pDlg.reset(pTransform);
195  pTransform->SetValidateFramePosLink( LINK(this, SwDrawBaseShell, ValidatePosition) );
196  }
197  SfxItemSet aNewAttr(pSdrView->GetGeoAttrFromMarked());
198 
199  const sal_uInt16* pRange = pDlg->GetInputRanges( *aNewAttr.GetPool() );
200  SfxItemSet aSet( *aNewAttr.GetPool(), pRange );
201  FieldUnit eMetric = ::GetDfltMetric( dynamic_cast<SwWebView*>(&GetView()) != nullptr );
202  SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric)) );
203 
204  aSet.Put( aNewAttr, false );
205 
206  if (bCaption)
207  pSdrView->GetAttributes( aSet );
208 
209  aSet.Put(SfxInt16Item(SID_ATTR_TRANSFORM_ANCHOR, static_cast<sal_Int16>(nAnchor)));
210  bool bRTL;
211  bool bVertL2R;
212  aSet.Put(SfxBoolItem(SID_ATTR_TRANSFORM_IN_VERTICAL_TEXT, pSh->IsFrameVertical(true, bRTL, bVertL2R)));
213  aSet.Put(SfxBoolItem(SID_ATTR_TRANSFORM_IN_RTL_TEXT, bRTL));
214 
215  SwFrameFormat* pFrameFormat = FindFrameFormat( pObj );
216 
217  aSet.Put( pFrameFormat->GetFormatAttr(RES_FOLLOW_TEXT_FLOW) );
218 
219  SwFormatVertOrient aVOrient(pFrameFormat->GetFormatAttr(RES_VERT_ORIENT));
220  aSet.Put(SfxInt16Item(SID_ATTR_TRANSFORM_VERT_ORIENT, aVOrient.GetVertOrient()));
221  aSet.Put(SfxInt16Item(SID_ATTR_TRANSFORM_VERT_RELATION, aVOrient.GetRelationOrient() ));
222  aSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_VERT_POSITION, aVOrient.GetPos()));
223 
224  SwFormatHoriOrient aHOrient(pFrameFormat->GetFormatAttr(RES_HORI_ORIENT));
225  aSet.Put(SfxInt16Item(SID_ATTR_TRANSFORM_HORI_ORIENT, aHOrient.GetHoriOrient()));
226  aSet.Put(SfxInt16Item(SID_ATTR_TRANSFORM_HORI_RELATION, aHOrient.GetRelationOrient() ));
227  aSet.Put(SfxBoolItem(SID_ATTR_TRANSFORM_HORI_MIRROR, aHOrient.IsPosToggle()));
228  aSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_HORI_POSITION, aHOrient.GetPos()));
229 
230  aSet.Put(SfxUInt16Item(SID_HTML_MODE, nHtmlMode));
231 
232  pDlg->SetInputSet( &aSet );
233 
234  pDlg->StartExecuteAsync([bCaption, bChanged, pDlg, pFrameFormat, pSdrView,
235  pSh, &rMarkList, this](
236  sal_Int32 nResult){
237  if (nResult == RET_OK)
238  {
239  SwFormatVertOrient aVOrientFinal(pFrameFormat->GetFormatAttr(RES_VERT_ORIENT));
240  SwFormatHoriOrient aHOrientFinal(pFrameFormat->GetFormatAttr(RES_HORI_ORIENT));
241 
242  const SfxItemSet* pOutSet = pDlg->GetOutputItemSet();
243  pSh->StartAllAction();
244 
245  // #i30451#
247 
248  pSdrView->SetGeoAttrToMarked(*pOutSet);
249 
250  if (bCaption)
251  pSdrView->SetAttributes(*pOutSet);
252 
253  bool bPosCorr =
254  SfxItemState::SET != pOutSet->GetItemState(
255  SID_ATTR_TRANSFORM_POS_X, false ) &&
256  SfxItemState::SET != pOutSet->GetItemState(
257  SID_ATTR_TRANSFORM_POS_Y, false );
258 
260 
261  bool bSingleSelection = rMarkList.GetMarkCount() == 1;
262 
263  const SfxPoolItem* pAnchorItem;
264  if(SfxItemState::SET == pOutSet->GetItemState(
265  SID_ATTR_TRANSFORM_ANCHOR, false, &pAnchorItem))
266  {
267  if(!bSingleSelection)
268  pSh->ChgAnchor(static_cast<RndStdIds>(static_cast<const SfxInt16Item*>(pAnchorItem)
269  ->GetValue()), false, bPosCorr );
270  else
271  {
272  SwFormatAnchor aAnchor(pFrameFormat->GetAnchor());
273  aAnchor.SetType(static_cast<RndStdIds>(static_cast<const SfxInt16Item*>(pAnchorItem)->GetValue()));
274  aFrameAttrSet.Put( aAnchor );
275  }
276  }
277  const SfxPoolItem* pHoriOrient = nullptr;
278  const SfxPoolItem* pHoriRelation = nullptr;
279  const SfxPoolItem* pHoriPosition = nullptr;
280  const SfxPoolItem* pHoriMirror = nullptr;
281  pOutSet->GetItemState(SID_ATTR_TRANSFORM_HORI_ORIENT, false, &pHoriOrient);
282  pOutSet->GetItemState(SID_ATTR_TRANSFORM_HORI_RELATION, false, &pHoriRelation);
283  pOutSet->GetItemState(SID_ATTR_TRANSFORM_HORI_POSITION, false, &pHoriPosition);
284  pOutSet->GetItemState(SID_ATTR_TRANSFORM_HORI_MIRROR, false, &pHoriMirror);
285  if(pHoriOrient || pHoriRelation || pHoriPosition || pHoriMirror)
286  {
287  if(pHoriOrient)
288  aHOrientFinal.SetHoriOrient(
289  static_cast<const SfxInt16Item*>(pHoriOrient)->GetValue());
290  if(pHoriRelation)
291  aHOrientFinal.SetRelationOrient(
292  static_cast<const SfxInt16Item*>(pHoriRelation)->GetValue());
293  if(pHoriPosition)
294  aHOrientFinal.SetPos( static_cast<const SfxInt32Item*>(pHoriPosition)->GetValue());
295  if(pHoriMirror)
296  aHOrientFinal.SetPosToggle( static_cast<const SfxBoolItem*>(pHoriMirror)->GetValue());
297  aFrameAttrSet.Put(aHOrientFinal);
298  }
299 
300  const SfxPoolItem* pVertOrient = nullptr;
301  const SfxPoolItem* pVertRelation = nullptr;
302  const SfxPoolItem* pVertPosition = nullptr;
303  pOutSet->GetItemState(SID_ATTR_TRANSFORM_VERT_ORIENT, false, &pVertOrient);
304  pOutSet->GetItemState(SID_ATTR_TRANSFORM_VERT_RELATION, false, &pVertRelation);
305  pOutSet->GetItemState(SID_ATTR_TRANSFORM_VERT_POSITION, false, &pVertPosition);
306  if(pVertOrient || pVertRelation || pVertPosition )
307  {
308  if(pVertOrient)
309  aVOrientFinal.SetVertOrient(
310  static_cast<const SfxInt16Item*>(pVertOrient)->GetValue());
311  if(pVertRelation)
312  aVOrientFinal.SetRelationOrient(
313  static_cast<const SfxInt16Item*>(pVertRelation)->GetValue());
314  if(pVertPosition)
315  aVOrientFinal.SetPos( static_cast<const SfxInt32Item*>(pVertPosition)->GetValue());
316  aFrameAttrSet.Put( aVOrientFinal );
317  }
318  const SfxPoolItem* pFollowItem = nullptr;
319  pOutSet->GetItemState(RES_FOLLOW_TEXT_FLOW, false, &pFollowItem);
320  if(pFollowItem)
321  aFrameAttrSet.Put(*pFollowItem);
322 
323  if(aFrameAttrSet.Count())
324  pSh->SetDrawingAttr(aFrameAttrSet);
325 
327 
328  // #i30451#
330 
331  pSh->EndAllAction();
332  }
333 
334  if (pSdrView->GetModel()->IsChanged())
335  pSh->SetModified();
336  else if (bChanged)
337  pSdrView->GetModel()->SetChanged();
338 
339  pDlg->disposeOnce();
340  });
341  }
342  }
343  else
344  {
345  pSh->StartAllAction();
346  pSdrView->SetGeoAttrToMarked( *pArgs );
347  const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
348  SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
349  if (pObj)
350  {
351  SwFrameFormat* pFrameFormat = FindFrameFormat(pObj);
352  if (pFrameFormat)
353  {
354  const SwFormatAnchor& rAnchor = pFrameFormat->GetAnchor();
355  // Don't change shape position / size, just update the anchor doc model
356  // position.
357  pSh->ChgAnchor(rAnchor.GetAnchorId(), /*bSameOnly=*/true);
358  }
359  }
360  pSh->EndAllAction();
361  }
362  }
363  }
364  break;
365 
366  case SID_DELETE:
367  case FN_BACKSPACE:
368  if (pSh->IsObjSelected() && !pSdrView->IsTextEdit())
369  {
370  bDone = true;
371 
372  if( GetView().IsDrawRotate() )
373  {
374  pSh->SetDragMode( SdrDragMode::Move );
376  }
377 
378  pSh->SetModified();
379  pSh->DelSelectedObj();
380 
381  if (rReq.IsAPI() ||
383  {
384  // If basic call, then back to the text shell, because the
385  // Basic otherwise has no possibility to return.
386  if (GetView().GetDrawFuncPtr())
387  {
389  GetView().SetDrawFuncPtr(nullptr);
390  }
391  GetView().LeaveDrawCreate(); // Switch to selection mode
392  }
393 
394  if (pSh->IsSelFrameMode())
395  {
396  pSh->LeaveSelFrameMode();
397  // #105852# FME
398  }
399  }
400  break;
401 
402  case SID_GROUP:
403  if (pSh->IsObjSelected() > 1 && pSh->IsGroupAllowed())
404  {
405  pSh->GroupSelection();
406  rBind.Invalidate(SID_UNGROUP);
407  }
408  break;
409 
410  case SID_UNGROUP:
411  if (pSh->IsGroupSelected() && pSh->IsUnGroupAllowed())
412  {
413  pSh->UnGroupSelection();
414  rBind.Invalidate(SID_GROUP);
415  }
416  break;
417 
418  case SID_ENTER_GROUP:
419  if (pSh->IsGroupSelected())
420  {
421  pSdrView->EnterMarkedGroup();
422  rBind.InvalidateAll(false);
423  }
424  break;
425 
426  case SID_LEAVE_GROUP:
427  if (pSdrView->IsGroupEntered())
428  {
429  pSdrView->LeaveOneGroup();
430  rBind.Invalidate(SID_ENTER_GROUP);
431  rBind.Invalidate(SID_UNGROUP);
432  }
433  break;
434 
435  case SID_OBJECT_ALIGN_LEFT:
436  case SID_OBJECT_ALIGN_CENTER:
437  case SID_OBJECT_ALIGN_RIGHT:
438  case SID_OBJECT_ALIGN_UP:
439  case SID_OBJECT_ALIGN_MIDDLE:
440  case SID_OBJECT_ALIGN_DOWN:
441  {
442  if ( bAlignPossible )
443  {
444  const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
445  if ( rMarkList.GetMarkCount() == 1 )
446  {
447  sal_Int16 nHorizOrient = -1, nVertOrient = -1;
448 
449  switch (nSlotId)
450  {
451  case SID_OBJECT_ALIGN_LEFT:
452  nHorizOrient = text::HoriOrientation::LEFT;
453  break;
454  case SID_OBJECT_ALIGN_CENTER:
455  nHorizOrient = text::HoriOrientation::CENTER;
456  break;
457  case SID_OBJECT_ALIGN_RIGHT:
458  nHorizOrient = text::HoriOrientation::RIGHT;
459  break;
460  case SID_OBJECT_ALIGN_UP:
461  nVertOrient = text::VertOrientation::TOP;
462  break;
463  case SID_OBJECT_ALIGN_MIDDLE:
464  nVertOrient = text::VertOrientation::CENTER;
465  break;
466  case SID_OBJECT_ALIGN_DOWN:
467  nVertOrient = text::VertOrientation::BOTTOM;
468  break;
469  default:
470  break;
471  }
472 
473  if (nHorizOrient != -1)
474  {
475  pSh->StartAction();
476  SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
477  SwFrameFormat* pFrameFormat = FindFrameFormat( pObj );
478  SwFormatHoriOrient aHOrient(pFrameFormat->GetFormatAttr(RES_HORI_ORIENT));
479  aHOrient.SetHoriOrient( nHorizOrient );
480  pFrameFormat->SetFormatAttr(aHOrient);
481  pSh->EndAction();
482  }
483 
484  if (nVertOrient != -1)
485  {
486  pSh->StartAction();
487  SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
488  SwFrameFormat* pFrameFormat = FindFrameFormat( pObj );
489  SwFormatVertOrient aVOrient(pFrameFormat->GetFormatAttr(RES_VERT_ORIENT));
490  aVOrient.SetVertOrient( nVertOrient );
491  pFrameFormat->SetFormatAttr(aVOrient);
492  pSh->EndAction();
493  }
494 
495  break;
496  }
497 
498  pSh->StartAction();
499  switch (nSlotId)
500  {
501  case SID_OBJECT_ALIGN_LEFT:
502  pSdrView->AlignMarkedObjects(SdrHorAlign::Left, SdrVertAlign::NONE);
503  break;
504  case SID_OBJECT_ALIGN_CENTER:
505  pSdrView->AlignMarkedObjects(SdrHorAlign::Center, SdrVertAlign::NONE);
506  break;
507  case SID_OBJECT_ALIGN_RIGHT:
508  pSdrView->AlignMarkedObjects(SdrHorAlign::Right, SdrVertAlign::NONE);
509  break;
510  case SID_OBJECT_ALIGN_UP:
511  pSdrView->AlignMarkedObjects(SdrHorAlign::NONE, SdrVertAlign::Top);
512  break;
513  case SID_OBJECT_ALIGN_MIDDLE:
514  pSdrView->AlignMarkedObjects(SdrHorAlign::NONE, SdrVertAlign::Center);
515  break;
516  case SID_OBJECT_ALIGN_DOWN:
517  pSdrView->AlignMarkedObjects(SdrHorAlign::NONE, SdrVertAlign::Bottom);
518  break;
519  }
520  pSh->EndAction();
521  }
522  }
523  break;
524 
525  case FN_FRAME_UP:
526  bTopParam = false;
527  [[fallthrough]];
528  case SID_FRAME_TO_TOP:
529  pSh->SelectionToTop( bTopParam );
530  break;
531 
532  case FN_FRAME_DOWN:
533  bBottomParam = false;
534  [[fallthrough]];
535  case SID_FRAME_TO_BOTTOM:
536  pSh->SelectionToBottom( bBottomParam );
537  break;
538 
539  case FN_NAME_SHAPE:
540  {
541  bDone = true;
542 
543  if(1 == pSdrView->GetMarkedObjectCount())
544  {
545  // #i68101#
546  SdrObject* pSelected = pSdrView->GetMarkedObjectByIndex(0);
547  OSL_ENSURE(pSelected, "DrawViewShell::FuTemp03: nMarkCount, but no object (!)");
548  OUString aName(pSelected->GetName());
549 
551  ScopedVclPtr<AbstractSvxObjectNameDialog> pDlg(pFact->CreateSvxObjectNameDialog(GetView().GetFrameWeld(), aName));
552 
553  pDlg->SetCheckNameHdl(LINK(this, SwDrawBaseShell, CheckGroupShapeNameHdl));
554 
555  if(RET_OK == pDlg->Execute())
556  {
557  pDlg->GetName(aName);
558  pSelected->SetName(aName);
559  pSh->SetModified();
560  }
561  }
562 
563  break;
564  }
565 
566  // #i68101#
568  {
569  bDone = true;
570 
571  if(1 == pSdrView->GetMarkedObjectCount())
572  {
573  SdrObject* pSelected = pSdrView->GetMarkedObjectByIndex(0);
574  OSL_ENSURE(pSelected, "DrawViewShell::FuTemp03: nMarkCount, but no object (!)");
575  OUString aTitle(pSelected->GetTitle());
576  OUString aDescription(pSelected->GetDescription());
577 
579  ScopedVclPtr<AbstractSvxObjectTitleDescDialog> pDlg(pFact->CreateSvxObjectTitleDescDialog(GetView().GetFrameWeld(),
580  aTitle, aDescription));
581 
582  if(RET_OK == pDlg->Execute())
583  {
584  pDlg->GetTitle(aTitle);
585  pDlg->GetDescription(aDescription);
586 
587  pSelected->SetTitle(aTitle);
588  pSelected->SetDescription(aDescription);
589 
590  pSh->SetModified();
591  }
592  }
593 
594  break;
595  }
596 
597  default:
598  OSL_ENSURE(false, "wrong Dispatcher");
599  return;
600  }
601  if(!bDone)
602  {
603  if(nSlotId >= SID_OBJECT_ALIGN_LEFT && nSlotId <= SID_OBJECT_ALIGN_DOWN)
604  rBind.Invalidate(SID_ATTR_LONG_LRSPACE);
605  if (pSdrView->GetModel()->IsChanged())
606  pSh->SetModified();
607  else if (bChanged)
608  pSdrView->GetModel()->SetChanged();
609  }
610 }
611 
612 // Checks whether a given name is allowed for a group shape
613 
614 IMPL_LINK( SwDrawBaseShell, CheckGroupShapeNameHdl, AbstractSvxObjectNameDialog&, rNameDialog, bool )
615 {
616  SwWrtShell &rSh = GetShell();
617  SdrView *pSdrView = rSh.GetDrawView();
618  const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
619  OSL_ENSURE(rMarkList.GetMarkCount() == 1, "wrong draw selection");
620  SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
621  const OUString sCurrentName = pObj->GetName();
622  OUString sNewName;
623  rNameDialog.GetName(sNewName);
624  bool bRet = false;
625  if (sNewName.isEmpty() || sCurrentName == sNewName)
626  bRet = true;
627  else
628  {
629  bRet = true;
631  SdrObjListIter aIter( pModel->GetPage(0), SdrIterMode::DeepWithGroups );
632  while( aIter.IsMore() )
633  {
634  SdrObject* pTempObj = aIter.Next();
635  if ( pObj != pTempObj && pTempObj->GetName() == sNewName )
636  {
637  bRet = false;
638  break;
639  }
640  }
641  }
642  return bRet;
643 }
644 
646 {
647  SwWrtShell &rSh = GetShell();
648  SdrView* pSdrView = rSh.GetDrawViewWithValidMarkList();
649  SfxWhichIter aIter( rSet );
650  sal_uInt16 nWhich = aIter.FirstWhich();
652 
653  if (!bProtected) // Look in the parent
655 
656  while( nWhich )
657  {
658  switch( nWhich )
659  {
660  case FN_DRAW_WRAP_DLG:
661  case SID_ATTR_TRANSFORM:
662  case SID_FRAME_TO_TOP:
663  case SID_FRAME_TO_BOTTOM:
664  case FN_FRAME_UP:
665  case FN_FRAME_DOWN:
666  case SID_DELETE:
667  case FN_BACKSPACE:
668  if( bProtected || !rSh.IsObjSelected() )
669  rSet.DisableItem( nWhich );
670  break;
671  case SID_GROUP:
672  if ( rSh.IsObjSelected() < 2 || bProtected || !rSh.IsGroupAllowed() )
673  rSet.DisableItem( nWhich );
674  break;
675  case SID_UNGROUP:
676  if ( !rSh.IsGroupSelected() || bProtected || !rSh.IsUnGroupAllowed() )
677  rSet.DisableItem( nWhich );
678  break;
679  case SID_ENTER_GROUP:
680  if ( !rSh.IsGroupSelected() )
681  rSet.DisableItem( nWhich );
682  break;
683  case SID_LEAVE_GROUP:
684  if ( !pSdrView->IsGroupEntered() )
685  rSet.DisableItem( nWhich );
686  break;
687  case SID_OBJECT_ALIGN_LEFT:
688  case SID_OBJECT_ALIGN_CENTER:
689  case SID_OBJECT_ALIGN_RIGHT:
690  case SID_OBJECT_ALIGN_UP:
691  case SID_OBJECT_ALIGN_MIDDLE:
692  case SID_OBJECT_ALIGN_DOWN:
693  case SID_OBJECT_ALIGN:
694  {
695  bool bDisableThis = false;
696  bool bDisableHoriz = false;
697  bool bHoriz = (nWhich == SID_OBJECT_ALIGN_LEFT || nWhich == SID_OBJECT_ALIGN_CENTER ||
698  nWhich == SID_OBJECT_ALIGN_RIGHT);
699  const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
700  if ( !rSh.IsAlignPossible() || bProtected )
701  {
702  bDisableThis = true;
703  rSet.DisableItem( nWhich );
704  }
705  else if ( rSh.GetAnchorId() == RndStdIds::FLY_AS_CHAR )
706  {
707  //if only one object is selected it can only be vertically
708  // aligned because it is character bound
709  if( rMarkList.GetMarkCount() == 1 )
710  {
711  bDisableHoriz = true;
712  rSet.DisableItem(SID_OBJECT_ALIGN_LEFT);
713  rSet.DisableItem(SID_OBJECT_ALIGN_CENTER);
714  rSet.DisableItem(SID_OBJECT_ALIGN_RIGHT);
715  }
716  }
717 
718  if (bHoriz && !bDisableThis && !bDisableHoriz &&
719  rMarkList.GetMarkCount() == 1)
720  {
721  sal_Int16 nHoriOrient = -1;
722  switch(nWhich)
723  {
724  case SID_OBJECT_ALIGN_LEFT:
725  nHoriOrient = text::HoriOrientation::LEFT;
726  break;
727  case SID_OBJECT_ALIGN_CENTER:
728  nHoriOrient = text::HoriOrientation::CENTER;
729  break;
730  case SID_OBJECT_ALIGN_RIGHT:
731  nHoriOrient = text::HoriOrientation::RIGHT;
732  break;
733  default:
734  break;
735  }
736 
737  SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
738  SwFrameFormat* pFrameFormat = FindFrameFormat(pObj);
739  SwFormatHoriOrient aHOrient(pFrameFormat->GetFormatAttr(RES_HORI_ORIENT));
740  rSet.Put(SfxBoolItem(nWhich, aHOrient.GetHoriOrient() == nHoriOrient));
741  }
742  }
743  break;
744 
745  case FN_NAME_SHAPE :
746  {
747  if(1 != pSdrView->GetMarkedObjectCount())
748  {
749  rSet.DisableItem( nWhich );
750  }
751  }
752  break;
753 
754  // #i68101#
756  {
757  const bool bIsWebView(nullptr != dynamic_cast<SwWebView*>(&GetView()));
758 
759  if(!bIsWebView && 1 != pSdrView->GetMarkedObjectCount())
760  {
761  rSet.DisableItem( nWhich );
762  }
763  }
764  break;
765  }
766  nWhich = aIter.NextWhich();
767  }
768 }
769 
771 {
772  SwWrtShell *pSh = &GetShell();
773  SdrView* pSdrView = pSh->GetDrawView();
774  const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
775  if( rMarkList.GetMark(0) != nullptr )
776  {
777  SfxItemSet aNewAttr(pSdrView->GetGeoAttrFromMarked());
778  rSet.Put(aNewAttr,false);
779  }
780 }
781 
782 bool SwDrawBaseShell::Disable(SfxItemSet& rSet, sal_uInt16 nWhich)
783 {
785 
786  if (bDisable)
787  {
788  if (nWhich)
789  rSet.DisableItem( nWhich );
790  else
791  {
792  SfxWhichIter aIter( rSet );
793  nWhich = aIter.FirstWhich();
794  while (nWhich)
795  {
796  rSet.DisableItem( nWhich );
797  nWhich = aIter.NextWhich();
798  }
799  }
800  }
801 
802  return bDisable;
803 }
804 
806 {
807  SwWrtShell *pSh = &GetShell();
808  SdrView* pSdrView = pSh->GetDrawView();
809  const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
810  const size_t nMarkCount = rMarkList.GetMarkCount();
811  bool bShowArea = true, bShowMeasure = true;
812 
813  for (size_t i = 0; i < nMarkCount && i < 50; ++i)
814  {
815  SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
816  sal_uInt16 nObjType = pObj->GetObjIdentifier();
817 
818  if ( nObjType != OBJ_MEASURE )
819  bShowMeasure = false;
820 
821  // If marked object is 2D, disable format area command.
822  if ( nObjType == OBJ_PLIN ||
823  nObjType == OBJ_LINE ||
824  nObjType == OBJ_PATHLINE ||
825  nObjType == OBJ_FREELINE ||
826  nObjType == OBJ_EDGE ||
827  nObjType == OBJ_CARC ||
828  bShowMeasure )
829  bShowArea = false;
830 
831  if (!bShowArea && !bShowMeasure)
832  break;
833  }
834 
835  if (!bShowArea)
836  rSet.DisableItem(SID_ATTRIBUTES_AREA);
837 
838  if (!bShowMeasure)
839  rSet.DisableItem(SID_MEASURE_DLG);
840 
841  Disable(rSet);
842 
843 }
844 
845 // Validate of drawing positions
846 
847 IMPL_LINK(SwDrawBaseShell, ValidatePosition, SvxSwFrameValidation&, rValidation, void )
848 {
849  SwWrtShell *pSh = &GetShell();
850  rValidation.nMinHeight = MINFLY;
851  rValidation.nMinWidth = MINFLY;
852 
853  SwRect aBoundRect;
854 
855  // OD 18.09.2003 #i18732# - adjustment for allowing vertical position
856  // aligned to page for fly frame anchored to paragraph or to character.
857  const RndStdIds eAnchorType = rValidation.nAnchorType;
858  const SwPosition* pContentPos = nullptr;
859  SdrView* pSdrView = pSh->GetDrawView();
860  const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
861  if( rMarkList.GetMarkCount() == 1 )
862  {
863  SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
864  SwFrameFormat* pFrameFormat = FindFrameFormat( pObj );
865  pContentPos = pFrameFormat->GetAnchor().GetContentAnchor();
866  }
867 
868  pSh->CalcBoundRect( aBoundRect, eAnchorType,
869  rValidation.nHRelOrient,
870  rValidation.nVRelOrient,
871  pContentPos,
872  rValidation.bFollowTextFlow,
873  rValidation.bMirror, nullptr, &rValidation.aPercentSize);
874 
875  bool bIsInVertical( false );
876  {
877  bool bRTL;
878  bool bVertL2R;
879  bIsInVertical = pSh->IsFrameVertical(true, bRTL, bVertL2R);
880  }
881  if(bIsInVertical)
882  {
883  Point aPos(aBoundRect.Pos());
884  long nTmp = aPos.X();
885  aPos.setX( aPos.Y() );
886  aPos.setY( nTmp );
887  Size aSize(aBoundRect.SSize());
888  nTmp = aSize.Width();
889  aSize.setWidth( aSize.Height() );
890  aSize.setHeight( nTmp );
891  aBoundRect.Chg( aPos, aSize );
892  //exchange width/height to enable correct values
893  nTmp = rValidation.nWidth;
894  rValidation.nWidth = rValidation.nHeight;
895  rValidation.nHeight = nTmp;
896  }
897  if ((eAnchorType == RndStdIds::FLY_AT_PAGE) || (eAnchorType == RndStdIds::FLY_AT_FLY))
898  {
899  // MinimalPosition
900  rValidation.nMinHPos = aBoundRect.Left();
901  rValidation.nMinVPos = aBoundRect.Top();
902  SwTwips nH = rValidation.nHPos;
903  SwTwips nV = rValidation.nVPos;
904 
905  if (rValidation.nHPos + rValidation.nWidth > aBoundRect.Right())
906  {
907  if (rValidation.nHoriOrient == text::HoriOrientation::NONE)
908  {
909  rValidation.nHPos -= ((rValidation.nHPos + rValidation.nWidth) - aBoundRect.Right());
910  nH = rValidation.nHPos;
911  }
912  else
913  rValidation.nWidth = aBoundRect.Right() - rValidation.nHPos;
914  }
915 
916  if (rValidation.nHPos + rValidation.nWidth > aBoundRect.Right())
917  rValidation.nWidth = aBoundRect.Right() - rValidation.nHPos;
918 
919  if (rValidation.nVPos + rValidation.nHeight > aBoundRect.Bottom())
920  {
921  if (rValidation.nVertOrient == text::VertOrientation::NONE)
922  {
923  rValidation.nVPos -= ((rValidation.nVPos + rValidation.nHeight) - aBoundRect.Bottom());
924  nV = rValidation.nVPos;
925  }
926  else
927  rValidation.nHeight = aBoundRect.Bottom() - rValidation.nVPos;
928  }
929 
930  if (rValidation.nVPos + rValidation.nHeight > aBoundRect.Bottom())
931  rValidation.nHeight = aBoundRect.Bottom() - rValidation.nVPos;
932 
933  if ( rValidation.nVertOrient != text::VertOrientation::NONE )
934  nV = aBoundRect.Top();
935 
936  if ( rValidation.nHoriOrient != text::HoriOrientation::NONE )
937  nH = aBoundRect.Left();
938 
939  rValidation.nMaxHPos = aBoundRect.Right() - rValidation.nWidth;
940  rValidation.nMaxHeight = aBoundRect.Bottom() - nV;
941 
942  rValidation.nMaxVPos = aBoundRect.Bottom() - rValidation.nHeight;
943  rValidation.nMaxWidth = aBoundRect.Right() - nH;
944  }
945  else if ((eAnchorType == RndStdIds::FLY_AT_PARA) || (eAnchorType == RndStdIds::FLY_AT_CHAR))
946  {
947  if (rValidation.nHPos + rValidation.nWidth > aBoundRect.Right())
948  {
949  if (rValidation.nHoriOrient == text::HoriOrientation::NONE)
950  {
951  rValidation.nHPos -= ((rValidation.nHPos + rValidation.nWidth) - aBoundRect.Right());
952  }
953  else
954  rValidation.nWidth = aBoundRect.Right() - rValidation.nHPos;
955  }
956 
957  // OD 29.09.2003 #i17567#, #i18732# - consider following the text flow
958  // and alignment at page areas.
959  const bool bMaxVPosAtBottom = !rValidation.bFollowTextFlow ||
960  rValidation.nVRelOrient == text::RelOrientation::PAGE_FRAME ||
961  rValidation.nVRelOrient == text::RelOrientation::PAGE_PRINT_AREA ||
962  rValidation.nVRelOrient == text::RelOrientation::PAGE_PRINT_AREA_BOTTOM;
963  {
964  SwTwips nTmpMaxVPos = ( bMaxVPosAtBottom
965  ? aBoundRect.Bottom()
966  : aBoundRect.Height() ) -
967  rValidation.nHeight;
968  if ( rValidation.nVPos > nTmpMaxVPos )
969  {
970  if (rValidation.nVertOrient == text::VertOrientation::NONE)
971  {
972  rValidation.nVPos = nTmpMaxVPos;
973  }
974  else
975  {
976  rValidation.nHeight = ( bMaxVPosAtBottom
977  ? aBoundRect.Bottom()
978  : aBoundRect.Height() ) - rValidation.nVPos;
979  }
980  }
981  }
982 
983  rValidation.nMinHPos = aBoundRect.Left();
984  rValidation.nMaxHPos = aBoundRect.Right() - rValidation.nWidth;
985 
986  rValidation.nMinVPos = aBoundRect.Top();
987  // OD 26.09.2003 #i17567#, #i18732# - determine maximum vertical position
988  if ( bMaxVPosAtBottom )
989  {
990  rValidation.nMaxVPos = aBoundRect.Bottom() - rValidation.nHeight;
991  }
992  else
993  {
994  rValidation.nMaxVPos = aBoundRect.Height() - rValidation.nHeight;
995  }
996 
997  // Maximum width height
998  const SwTwips nH = ( rValidation.nHoriOrient != text::HoriOrientation::NONE )
999  ? aBoundRect.Left()
1000  : rValidation.nHPos;
1001  const SwTwips nV = ( rValidation.nVertOrient != text::VertOrientation::NONE )
1002  ? aBoundRect.Top()
1003  : rValidation.nVPos;
1004  rValidation.nMaxHeight = rValidation.nMaxVPos + rValidation.nHeight - nV;
1005  rValidation.nMaxWidth = rValidation.nMaxHPos + rValidation.nWidth - nH;
1006  }
1007  else if (eAnchorType == RndStdIds::FLY_AS_CHAR)
1008  {
1009  rValidation.nMinHPos = 0;
1010  rValidation.nMaxHPos = 0;
1011 
1012  rValidation.nMaxHeight = aBoundRect.Height();
1013  rValidation.nMaxWidth = aBoundRect.Width();
1014 
1015  rValidation.nMaxVPos = aBoundRect.Height();
1016  rValidation.nMinVPos = -aBoundRect.Height() + rValidation.nHeight;
1017  if (rValidation.nMaxVPos < rValidation.nMinVPos)
1018  {
1019  rValidation.nMinVPos = rValidation.nMaxVPos;
1020  rValidation.nMaxVPos = -aBoundRect.Height();
1021  }
1022  }
1023  if(bIsInVertical)
1024  {
1025  //restore width/height exchange
1026  long nTmp = rValidation.nWidth;
1027  rValidation.nWidth = rValidation.nHeight;
1028  rValidation.nHeight = nTmp;
1029  }
1030 
1031  if (rValidation.nMaxWidth < rValidation.nWidth)
1032  rValidation.nWidth = rValidation.nMaxWidth;
1033  if (rValidation.nMaxHeight < rValidation.nHeight)
1034  rValidation.nHeight = rValidation.nMaxHeight;
1035 }
1036 
1037 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SfxViewFrame * GetViewFrame() const
SFX_IMPL_SUPERCLASS_INTERFACE(DrawDocShell, SfxObjectShell)
long Width() const
void ExitDraw()
Definition: viewdraw.cxx:380
void UnGroupSelection()
The individual objects are selected, but it is possible that there are groups included.
Definition: feshview.cxx:2480
constexpr TypedWhichId< SwFormatSurround > RES_SURROUND(101)
FieldUnit
void GetDrawAttrStateForIFBX(SfxItemSet &rSet)
Definition: drwbassh.cxx:770
size_t GetMarkCount() const
Marks a position in the document model.
Definition: pam.hxx:35
bool IsAlignPossible() const
Definition: feshview.cxx:2709
void ChgAnchor(RndStdIds eAnchorId, bool bSameOnly=false, bool bPosCorr=true)
frmatr.hxx.
Definition: feshview.cxx:2263
bool IsUnGroupAllowed() const
Definition: feshview.cxx:2448
SwView & GetView()
Definition: basesh.hxx:57
SdrView * GetDrawView()
Definition: vnew.cxx:375
void AlignMarkedObjects(SdrHorAlign eHor, SdrVertAlign eVert)
virtual const SfxItemSet * GetOutputItemSet() const =0
std::string GetValue
void GroupSelection()
Afterwards the group is selected.
Definition: feshview.cxx:2465
bool AreObjectsMarked() const
SwWrtShell & GetShell()
Definition: basesh.cxx:2673
void FlipDrawRotate()
Definition: view.hxx:517
void SelectionToHeaven()
Above document.
Definition: feshview.cxx:1140
static SvxAbstractDialogFactory * Create()
#define MINFLY
Definition: swtypes.hxx:65
void SetGeoAttrToMarked(const SfxItemSet &rAttr)
OUString GetDescription() const
Check only parents.
void Height(long nNew)
Definition: swrect.hxx:191
sal_uInt16 FirstWhich()
SwUndoId EndUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Closes parenthesis of nUndoId, not used by UI.
Definition: edws.cxx:234
long SwTwips
Definition: swtypes.hxx:49
SwEditWin & GetEditWin()
Definition: view.hxx:403
SdrMark * GetMark(size_t nNum) const
OBJ_EDGE
void Pos(const Point &rNew)
Definition: swrect.hxx:169
Of course Writer needs its own rectangles.
Definition: swrect.hxx:35
void SetModified()
Definition: edws.cxx:70
bool IsGroupSelected()
Create and destroy group, don't when frame is selected.
Definition: feshview.cxx:2342
const SfxItemSet * GetArgs() const
void Invalidate(sal_uInt16 nId)
void EndAllAction()
Definition: edws.cxx:97
OBJ_PLIN
OBJ_MEASURE
virtual VclPtr< AbstractSvxCaptionDialog > CreateCaptionDialog(weld::Window *pParent, const SdrView *pView, SvxAnchorIds nAnchorTypes=SvxAnchorIds::NONE)=0
void NoEdit(bool bHideCursor=true)
Definition: wrtsh1.cxx:143
sal_uInt16 NextWhich()
virtual const sal_uInt16 * GetInputRanges(const SfxItemPool &)=0
SfxItemSet GetGeoAttrFromMarked() const
void SetDrawFuncPtr(std::unique_ptr< SwDrawBase > pFuncPtr)
Definition: viewdraw.cxx:632
void EnterMarkedGroup()
virtual void SetInputSet(const SfxItemSet *pInSet)=0
Used by the UI to modify the document model.
Definition: wrtsh.hxx:90
constexpr TypedWhichId< SwFormatVertOrient > RES_VERT_ORIENT(102)
const SwView & GetView() const
Definition: wrtsh.hxx:428
void Top(const long nTop)
Definition: swrect.hxx:204
OBJ_CAPTION
const SwFrameFormat * IsFlyInFly()
Is selected frame within another frame?
Definition: fefly1.cxx:310
void SetHoriOrient(sal_Int16 eNew)
Definition: fmtornt.hxx:89
constexpr TypedWhichId< SwFormatHoriOrient > RES_HORI_ORIENT(103)
static void CreateSelection(SwWrtShell &rSh, const SwFrameShell *pCreator=nullptr)
Definition: swdtflvr.cxx:4085
virtual VclPtr< AbstractSvxTransformTabDialog > CreateSvxTransformTabDialog(weld::Window *pParent, const SfxItemSet *pAttr, const SdrView *pView, SvxAnchorIds nAnchorTypes=SvxAnchorIds::NONE)=0
void Edit()
Definition: wrtsh1.cxx:149
OBJ_PATHLINE
virtual VclPtr< SfxAbstractDialog > CreateSwWrapDlg(weld::Window *pParent, SfxItemSet &rSet, SwWrtShell *pSh)=0
SwFrameFormat * FindFrameFormat(SdrObject *pObj)
The Get reverse way: seeks the format to the specified object.
Definition: dcontact.cxx:120
void Right(const long nRight)
Definition: swrect.hxx:200
const IDocumentDrawModelAccess & getIDocumentDrawModelAccess() const
Provides access to the document draw model interface.
Definition: viewsh.cxx:2591
virtual void Deactivate()
Definition: drawbase.cxx:439
virtual void SetChanged(bool bFlg=true)
constexpr TypedWhichId< SwFormatWrapInfluenceOnObjPos > RES_WRAP_INFLUENCE_ON_OBJPOS(125)
if(nullptr==pCandidateA||nullptr==pCandidateB)
void GetState(SfxItemSet &)
Definition: drwbassh.cxx:645
SfxItemPool & GetPool() const
void SelectionToHell()
Below document.
Definition: feshview.cxx:1145
void SelectionToBottom(bool bBottom=true)
Definition: feshview.cxx:1055
SdrObject * GetMarkedSdrObj() const
weld::Window * GetFrameWeld(const SfxFrame *pFrame)
Definition: dialoghelp.cxx:20
virtual ~SwDrawBaseShell() override
Definition: drwbassh.cxx:81
OBJ_LINE
Style of a layout element.
Definition: frmfmt.hxx:57
#define SW_MOD()
Definition: swmodule.hxx:256
Shell * GetShell()
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
SW_DLLPUBLIC FieldUnit GetDfltMetric(bool bWeb)
Definition: uitool.cxx:687
const SwFormatAnchor & GetAnchor(bool=true) const
Definition: fmtanchr.hxx:81
int i
bool GetObjAttr(SfxItemSet &rSet) const
Attention: Ambiguities if multiple selections.
Definition: feshview.cxx:2660
void SetVertOrient(sal_Int16 eNew)
Definition: fmtornt.hxx:56
void EndAction(const bool bIdleEnd=false, const bool DoSetPosX=false)
Definition: crsrsh.cxx:238
virtual sal_uInt16 GetObjIdentifier() const
Window class for the Writer edit area, this is the one handling mouse and keyboard events and doing t...
Definition: edtwin.hxx:58
RndStdIds GetAnchorId() const
Definition: fmtanchr.hxx:65
size_t GetMarkedObjectCount() const
const SwPosition * GetContentAnchor() const
Definition: fmtanchr.hxx:67
void Execute(SfxRequest const &)
Definition: drwbassh.cxx:88
OBJ_NONE
SfxBindings & GetBindings()
const SdrMarkList & GetMarkedObjectList() const
FlyAnchors.
Definition: fmtanchr.hxx:34
sal_uInt16 GetHtmlMode(const SwDocShell *pShell)
Definition: viewopt.cxx:337
bool SetAttributes(const SfxItemSet &rSet, bool bReplaceAll=false)
const SdrPage * GetPage(sal_uInt16 nPgNum) const
virtual const SwDrawModel * GetDrawModel() const =0
Draw Model and id accessors.
SwUndoId StartUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Undo: set up Undo parenthesis, return nUndoId of this parenthesis.
Definition: edws.cxx:223
OUString GetTitle() const
#define FN_FRAME_DOWN
Definition: cmdid.h:364
bool IsGroupAllowed() const
Definition: feshview.cxx:2388
void LeaveOneGroup()
static SwAbstractDialogFactory * Create()
Definition: swabstdlg.cxx:36
bool IsDrawRotate() const
Definition: view.hxx:516
void SSize(const Size &rNew)
Definition: swrect.hxx:178
void SelectionToTop(bool bTop=true)
Move selection upwards or downwards (Z-Order).
Definition: feshview.cxx:1035
void LeaveDrawCreate()
Definition: view.hxx:525
SwDrawBase * GetDrawFuncPtr() const
Definition: view.hxx:513
RndStdIds GetAnchorId() const
Anchor type of selected object, RndStdIds::UNKNOWN if ambiguous or in case of frame selection...
Definition: feshview.cxx:2233
FlyProtectFlags IsSelObjProtected(FlyProtectFlags eType) const
Which Protection is set at selected object?
Definition: feshview.cxx:2597
OUString GetName() const
bool Disable(SfxItemSet &rSet, sal_uInt16 nWhich=0)
Definition: drwbassh.cxx:782
SwDocShell * GetDocShell()
Definition: view.cxx:1107
bool IsChanged() const
void DisableState(SfxItemSet &rSet)
Definition: drwbassh.cxx:805
void CalcBoundRect(SwRect &_orRect, const RndStdIds _nAnchorId, const sal_Int16 _eHoriRelOrient=css::text::RelOrientation::FRAME, const sal_Int16 _eVertRelOrient=css::text::RelOrientation::FRAME, const SwPosition *_pToCharContentPos=nullptr, const bool _bFollowTextFlow=false, bool _bMirror=false, Point *_opRef=nullptr, Size *_opPercent=nullptr, const SwFormatFrameSize *pFormatFrameSize=nullptr) const
i#17567 - adjustments to allow negative vertical positions for fly frames anchored to paragraph or to...
Definition: fews.cxx:689
void reset(reference_type *pBody)
void StartAction()
Definition: crsrsh.cxx:221
virtual bool SetFormatAttr(const SfxPoolItem &rAttr)
Definition: format.cxx:458
weld::Window * GetFrameWeld() const
virtual void SetValidateFramePosLink(const Link< SvxSwFrameValidation &, void > &rLink)=0
SdrLayerID GetLayerId() const
1 Heaven, 0 Hell, SDRLAYER_NOTFOUND Ambiguous.
Definition: feshview.cxx:1077
OBJ_FREELINE
void Left(const long nLeft)
Definition: swrect.hxx:195
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
OBJ_CARC
void Bottom(const long nBottom)
Definition: swrect.hxx:209
sal_uInt16 GetSlot() const
void DisableItem(sal_uInt16 nWhich)
virtual bool IsTextEdit() const final override
bool IsFrameVertical(const bool bEnvironment, bool &bRightToLeft, bool &bVertL2R) const
Determines whether a frame or its environment is vertically formatted and right-to-left.
Definition: fews.cxx:1268
#define FN_FRAME_UP
Definition: cmdid.h:363
bool IsObjectSelect() const
Definition: edtwin.hxx:209
unsigned char sal_uInt8
void Width(long nNew)
Definition: swrect.hxx:187
static void ClearSelection(SwWrtShell &rSh, const SwFrameShell *pCreator=nullptr)
Definition: swdtflvr.cxx:4097
SdrView * GetDrawViewWithValidMarkList()
Definition: vnew.cxx:380
virtual void SetValidateFramePosLink(const Link< SvxSwFrameValidation &, void > &rLink)=0
OUString aName
void GetAttributes(SfxItemSet &rTargetSet, bool bOnlyHardAttr=false) const
RET_OK
SvxAnchorIds
#define FN_BACKSPACE
Definition: cmdid.h:656
void SetDescription(const OUString &rStr)
size_t IsObjSelected() const
Definition: feshview.cxx:1150
void DelSelectedObj()
Definition: feshview.cxx:2281
const SfxPoolItem & GetFormatAttr(sal_uInt16 nWhich, bool bInParents=true) const
If bInParents is FALSE, search only in this format for attribute.
Definition: format.cxx:377
constexpr TypedWhichId< SvxLRSpaceItem > RES_LR_SPACE(91)
SdrObject * GetMarkedObjectByIndex(size_t nNum) const
void SetObjAttr(const SfxItemSet &rSet)
Definition: feshview.cxx:2683
void SetDragMode(SdrDragMode eSdrDragMode)
Set DragMode (e.g. Rotate), but do nothing when frame is selected.
Definition: feshview.cxx:661
void LeaveSelFrameMode()
Definition: select.cxx:719
void SetType(RndStdIds nRndId)
Definition: fmtanchr.hxx:71
void SetBezierMode(sal_uInt16 eBezMode)
Definition: edtwin.hxx:217
void InvalidateAll(bool bWithMsg)
RndStdIds
bool IsAPI() const
void StdDrawMode(SdrObjKind eSdrObjectKind, bool bObjSelect)
Definition: edtwin.cxx:688
constexpr TypedWhichId< SwFormatFollowTextFlow > RES_FOLLOW_TEXT_FLOW(123)
void StartAllAction()
For all views of this document.
Definition: edws.cxx:86
#define FN_TITLE_DESCRIPTION_SHAPE
Definition: cmdid.h:439
void SetName(const OUString &rStr)
void Chg(const Point &rNP, const Size &rNS)
Definition: swrect.hxx:164
SdrModel * GetModel() const
IMPL_LINK(SwDrawBaseShell, CheckGroupShapeNameHdl, AbstractSvxObjectNameDialog &, rNameDialog, bool)
Definition: drwbassh.cxx:614
SwDrawBaseShell(SwView &rShell)
Definition: drwbassh.cxx:66
bool IsGroupEntered() const
void SetTitle(const OUString &rStr)
constexpr TypedWhichId< SvxULSpaceItem > RES_UL_SPACE(92)
#define FN_DRAW_WRAP_DLG
Definition: cmdid.h:151
#define FN_NAME_SHAPE
Definition: cmdid.h:437
Definition: view.hxx:146
bool SetDrawingAttr(SfxItemSet &rSet)
Definition: fefly1.cxx:1121
constexpr TypedWhichId< SwFormatAnchor > RES_ANCHOR(104)
bool IsSelFrameMode() const
Definition: wrtsh.hxx:170