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