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