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 <svx/hlnkitem.hxx>
31 #include <osl/diagnose.h>
32 #include <drawdoc.hxx>
33 #include <uitool.hxx>
34 #include <fmtornt.hxx>
35 #include <cmdid.h>
36 #include <swmodule.hxx>
37 #include <wrtsh.hxx>
38 #include <wview.hxx>
39 #include <edtwin.hxx>
40 #include <viewopt.hxx>
41 #include <dcontact.hxx>
42 #include <frmfmt.hxx>
43 #include <drawbase.hxx>
44 #include <drwbassh.hxx>
45 #include <swdtflvr.hxx>
46 #include <svx/svditer.hxx>
47 #define ShellClass_SwDrawBaseShell
48 #include <sfx2/msg.hxx>
49 #include <swslots.hxx>
50 #include <svx/svxdlg.hxx>
51 #include <vcl/unohelp2.hxx>
52 #include <swabstdlg.hxx>
53 #include <swundo.hxx>
54 #include <com/sun/star/beans/XPropertySet.hpp>
55 #include <com/sun/star/drawing/XShape.hpp>
56 #include <com/sun/star/text/HoriOrientation.hpp>
57 #include <com/sun/star/text/VertOrientation.hpp>
58 #include <com/sun/star/text/RelOrientation.hpp>
59 #include <com/sun/star/uno/Reference.hxx>
61 #include <fmtfollowtextflow.hxx>
62 #include <textboxhelper.hxx>
63 
64 using namespace ::com::sun::star;
65 using namespace css::beans;
66 using namespace css::drawing;
67 using namespace css::uno;
68 
70 
71 void SwDrawBaseShell::InitInterface_Impl()
72 {
73 }
74 
75 
77  : SwBaseShell(_rView)
78 {
79  GetShell().NoEdit();
80 
81  SwEditWin& rWin = GetView().GetEditWin();
82 
83  rWin.SetBezierMode(SID_BEZIER_MOVE);
84 
85  if ( !_rView.GetDrawFuncPtr() )
86  _rView.GetEditWin().StdDrawMode( OBJ_NONE, true );
87 
89 }
90 
92 {
93  GetView().ExitDraw();
94  GetShell().Edit();
96 }
97 
99 {
100  SwWrtShell *pSh = &GetShell();
101  SdrView* pSdrView = pSh->GetDrawView();
102  const SfxItemSet *pArgs = rReq.GetArgs();
103  sal_uInt16 nSlotId = rReq.GetSlot();
104  bool bChanged = pSdrView->GetModel()->IsChanged();
105  pSdrView->GetModel()->SetChanged(false);
106  const SfxPoolItem* pItem = nullptr;
107  if(pArgs)
108  pArgs->GetItemState(nSlotId, false, &pItem);
109 
110  bool bAlignPossible = pSh->IsAlignPossible();
111 
112  bool bTopParam = true, bBottomParam = true;
113  bool bDone = false;
115 
116  switch (nSlotId)
117  {
118  case FN_DRAW_WRAP_DLG:
119  {
120  if(pSdrView->AreObjectsMarked())
121  {
122  if(!pArgs)
123  {
124  const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
125  if( rMarkList.GetMark(0) != nullptr )
126  {
127  SfxItemSet aSet(
128  GetPool(),
129  svl::Items<
134  SID_HTML_MODE, SID_HTML_MODE,
136 
137  aSet.Put(SfxBoolItem(SID_HTML_MODE,
138  0 != ::GetHtmlMode(pSh->GetView().GetDocShell())));
139 
141 
142  pSh->GetObjAttr(aSet);
145 
146  if (pDlg->Execute() == RET_OK)
147  {
148  const SfxPoolItem* pWrapItem;
149  const SfxItemSet* pOutSet = pDlg->GetOutputItemSet();
150  if(SfxItemState::SET == pOutSet->GetItemState(FN_DRAW_WRAP_DLG, false, &pWrapItem))
151  {
152  short nLayer = static_cast<const SfxInt16Item*>(pWrapItem)->GetValue();
153  if (nLayer == 1)
154  pSh->SelectionToHeaven();
155  else
156  pSh->SelectionToHell();
157  }
158 
159  pSh->SetObjAttr(*pOutSet);
160  }
161  }
162  }
163  }
164  }
165  break;
166 
167  case SID_ATTR_TRANSFORM:
168  {
169  if(pSdrView->AreObjectsMarked())
170  {
171  if(!pArgs)
172  {
173  const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
174  if( rMarkList.GetMark(0) != nullptr )
175  {
176  SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
178  bool bCaption = false;
179 
180  // Allowed anchorages:
181  RndStdIds nAnchor = pSh->GetAnchorId();
182  SvxAnchorIds nAllowedAnchors = SvxAnchorIds::Paragraph | SvxAnchorIds::Character | SvxAnchorIds::Page;
183  sal_uInt16 nHtmlMode = ::GetHtmlMode(pSh->GetView().GetDocShell());
184 
185  if ( pSh->IsFlyInFly() )
186  nAllowedAnchors |= SvxAnchorIds::Fly;
187 
188  if (pObj->GetObjIdentifier() == OBJ_CAPTION )
189  bCaption = true;
190 
191  if (bCaption)
192  {
195  pFact->CreateCaptionDialog( rReq.GetFrameWeld(), pSdrView, nAllowedAnchors );
196  pDlg.reset(pCaptionDlg);
197  pCaptionDlg->SetValidateFramePosLink( LINK(this, SwDrawBaseShell, ValidatePosition) );
198  }
199  else
200  {
203  pFact->CreateSvxTransformTabDialog(rReq.GetFrameWeld(), nullptr, pSdrView, nAllowedAnchors);
204  pDlg.reset(pTransform);
205  pTransform->SetValidateFramePosLink( LINK(this, SwDrawBaseShell, ValidatePosition) );
206  }
207  SfxItemSet aNewAttr(pSdrView->GetGeoAttrFromMarked());
208 
209  const WhichRangesContainer& pRange = pDlg->GetInputRanges( *aNewAttr.GetPool() );
210  SfxItemSet aSet( *aNewAttr.GetPool(), pRange );
211  FieldUnit eMetric = ::GetDfltMetric( dynamic_cast<SwWebView*>(&GetView()) != nullptr );
212  SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric)) );
213 
214  aSet.Put( aNewAttr, false );
215 
216  if (bCaption)
217  pSdrView->GetAttributes( aSet );
218 
219  aSet.Put(SfxInt16Item(SID_ATTR_TRANSFORM_ANCHOR, static_cast<sal_Int16>(nAnchor)));
220  bool bRTL;
221  bool bVertL2R;
222  aSet.Put(SfxBoolItem(SID_ATTR_TRANSFORM_IN_VERTICAL_TEXT, pSh->IsFrameVertical(true, bRTL, bVertL2R)));
223  aSet.Put(SfxBoolItem(SID_ATTR_TRANSFORM_IN_RTL_TEXT, bRTL));
224 
225  SwFrameFormat* pFrameFormat = FindFrameFormat( pObj );
226 
227  aSet.Put( pFrameFormat->GetFormatAttr(RES_FOLLOW_TEXT_FLOW) );
228 
229  SwFormatVertOrient aVOrient(pFrameFormat->GetFormatAttr(RES_VERT_ORIENT));
230  aSet.Put(SfxInt16Item(SID_ATTR_TRANSFORM_VERT_ORIENT, aVOrient.GetVertOrient()));
231  aSet.Put(SfxInt16Item(SID_ATTR_TRANSFORM_VERT_RELATION, aVOrient.GetRelationOrient() ));
232  aSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_VERT_POSITION, aVOrient.GetPos()));
233 
234  SwFormatHoriOrient aHOrient(pFrameFormat->GetFormatAttr(RES_HORI_ORIENT));
235  aSet.Put(SfxInt16Item(SID_ATTR_TRANSFORM_HORI_ORIENT, aHOrient.GetHoriOrient()));
236  aSet.Put(SfxInt16Item(SID_ATTR_TRANSFORM_HORI_RELATION, aHOrient.GetRelationOrient() ));
237  aSet.Put(SfxBoolItem(SID_ATTR_TRANSFORM_HORI_MIRROR, aHOrient.IsPosToggle()));
238  aSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_HORI_POSITION, aHOrient.GetPos()));
239 
240  aSet.Put(SfxUInt16Item(SID_HTML_MODE, nHtmlMode));
241 
242  pDlg->SetInputSet( &aSet );
243 
244  pDlg->StartExecuteAsync([bCaption, bChanged, pDlg, pFrameFormat, pSdrView,
245  pSh, &rMarkList, this](
246  sal_Int32 nResult){
247  pSdrView->GetModel()->SetChanged(false);
248 
249  if (nResult == RET_OK)
250  {
251  SwFormatVertOrient aVOrientFinal(pFrameFormat->GetFormatAttr(RES_VERT_ORIENT));
252  SwFormatHoriOrient aHOrientFinal(pFrameFormat->GetFormatAttr(RES_HORI_ORIENT));
253 
254  const SfxItemSet* pOutSet = pDlg->GetOutputItemSet();
255  pSh->StartAllAction();
256 
257  // #i30451#
259 
260  pSdrView->SetGeoAttrToMarked(*pOutSet);
261 
262  if (bCaption)
263  pSdrView->SetAttributes(*pOutSet);
264 
265  bool bPosCorr =
266  SfxItemState::SET != pOutSet->GetItemState(
267  SID_ATTR_TRANSFORM_POS_X, false ) &&
268  SfxItemState::SET != pOutSet->GetItemState(
269  SID_ATTR_TRANSFORM_POS_Y, false );
270 
271  SfxItemSet aFrameAttrSet(GetPool(), svl::Items<RES_FRMATR_BEGIN, RES_FRMATR_END - 1>);
272 
273  bool bSingleSelection = rMarkList.GetMarkCount() == 1;
274 
275  const SfxPoolItem* pAnchorItem;
276  if(SfxItemState::SET == pOutSet->GetItemState(
277  SID_ATTR_TRANSFORM_ANCHOR, false, &pAnchorItem))
278  {
279  if(!bSingleSelection)
280  pSh->ChgAnchor(static_cast<RndStdIds>(static_cast<const SfxInt16Item*>(pAnchorItem)
281  ->GetValue()), false, bPosCorr );
282  else
283  {
284  SwFormatAnchor aAnchor(pFrameFormat->GetAnchor());
285  aAnchor.SetType(static_cast<RndStdIds>(static_cast<const SfxInt16Item*>(pAnchorItem)->GetValue()));
286  aFrameAttrSet.Put( aAnchor );
287  }
288  }
289  const SfxPoolItem* pHoriOrient = nullptr;
290  const SfxPoolItem* pHoriRelation = nullptr;
291  const SfxPoolItem* pHoriPosition = nullptr;
292  const SfxPoolItem* pHoriMirror = nullptr;
293  pOutSet->GetItemState(SID_ATTR_TRANSFORM_HORI_ORIENT, false, &pHoriOrient);
294  pOutSet->GetItemState(SID_ATTR_TRANSFORM_HORI_RELATION, false, &pHoriRelation);
295  pOutSet->GetItemState(SID_ATTR_TRANSFORM_HORI_POSITION, false, &pHoriPosition);
296  pOutSet->GetItemState(SID_ATTR_TRANSFORM_HORI_MIRROR, false, &pHoriMirror);
297  if(pHoriOrient || pHoriRelation || pHoriPosition || pHoriMirror)
298  {
299  if(pHoriOrient)
300  aHOrientFinal.SetHoriOrient(
301  static_cast<const SfxInt16Item*>(pHoriOrient)->GetValue());
302  if(pHoriRelation)
303  aHOrientFinal.SetRelationOrient(
304  static_cast<const SfxInt16Item*>(pHoriRelation)->GetValue());
305  if(pHoriPosition)
306  aHOrientFinal.SetPos( static_cast<const SfxInt32Item*>(pHoriPosition)->GetValue());
307  if(pHoriMirror)
308  aHOrientFinal.SetPosToggle( static_cast<const SfxBoolItem*>(pHoriMirror)->GetValue());
309  aFrameAttrSet.Put(aHOrientFinal);
310  }
311 
312  const SfxPoolItem* pVertOrient = nullptr;
313  const SfxPoolItem* pVertRelation = nullptr;
314  const SfxPoolItem* pVertPosition = nullptr;
315  pOutSet->GetItemState(SID_ATTR_TRANSFORM_VERT_ORIENT, false, &pVertOrient);
316  pOutSet->GetItemState(SID_ATTR_TRANSFORM_VERT_RELATION, false, &pVertRelation);
317  pOutSet->GetItemState(SID_ATTR_TRANSFORM_VERT_POSITION, false, &pVertPosition);
318  if(pVertOrient || pVertRelation || pVertPosition )
319  {
320  if(pVertOrient)
321  aVOrientFinal.SetVertOrient(
322  static_cast<const SfxInt16Item*>(pVertOrient)->GetValue());
323  if(pVertRelation)
324  aVOrientFinal.SetRelationOrient(
325  static_cast<const SfxInt16Item*>(pVertRelation)->GetValue());
326  if(pVertPosition)
327  aVOrientFinal.SetPos( static_cast<const SfxInt32Item*>(pVertPosition)->GetValue());
328  aFrameAttrSet.Put( aVOrientFinal );
329  }
330  const SfxPoolItem* pFollowItem = nullptr;
331  pOutSet->GetItemState(RES_FOLLOW_TEXT_FLOW, false, &pFollowItem);
332  if(pFollowItem)
333  aFrameAttrSet.Put(*pFollowItem);
334 
335  if(aFrameAttrSet.Count())
336  pSh->SetDrawingAttr(aFrameAttrSet);
337 
339 
340  // #i30451#
342 
343  pSh->EndAllAction();
344  }
345 
346  if (pSdrView->GetModel()->IsChanged())
347  pSh->SetModified();
348  else if (bChanged)
349  pSdrView->GetModel()->SetChanged();
350 
351  pDlg->disposeOnce();
352  });
353  }
354  }
355  else
356  {
357  pSh->StartAllAction();
358  pSdrView->SetGeoAttrToMarked( *pArgs );
359  const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
360  SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
361  if (pObj)
362  {
363  SwFrameFormat* pFrameFormat = FindFrameFormat(pObj);
364  if (pFrameFormat)
365  {
366  const SwFormatAnchor& rAnchor = pFrameFormat->GetAnchor();
367  // Don't change shape position / size, just update the anchor doc model
368  // position.
369  pSh->ChgAnchor(rAnchor.GetAnchorId(), /*bSameOnly=*/true);
370  }
371  }
372  pSh->EndAllAction();
373  }
374  }
375  }
376  break;
377 
378  case SID_DELETE:
379  case FN_BACKSPACE:
380  if (pSh->IsObjSelected() && !pSdrView->IsTextEdit())
381  {
382  bDone = true;
383 
384  if( GetView().IsDrawRotate() )
385  {
386  pSh->SetDragMode( SdrDragMode::Move );
388  }
389 
390  pSh->SetModified();
391  pSh->DelSelectedObj();
392 
393  if (rReq.IsAPI() ||
395  {
396  // If basic call, then back to the text shell, because the
397  // Basic otherwise has no possibility to return.
398  if (GetView().GetDrawFuncPtr())
399  {
401  GetView().SetDrawFuncPtr(nullptr);
402  }
403  GetView().LeaveDrawCreate(); // Switch to selection mode
404  }
405 
406  if (pSh->IsSelFrameMode())
407  {
408  pSh->LeaveSelFrameMode();
409  // #105852# FME
410  }
411  }
412  break;
413 
414  case SID_GROUP:
415  if (pSh->IsObjSelected() > 1 && pSh->IsGroupAllowed())
416  {
417  pSh->GroupSelection();
418  rBind.Invalidate(SID_UNGROUP);
419  }
420  break;
421 
422  case SID_UNGROUP:
423  if (pSh->IsGroupSelected() && pSh->IsUnGroupAllowed())
424  {
425  pSh->UnGroupSelection();
426  rBind.Invalidate(SID_GROUP);
427  }
428  break;
429 
430  case SID_ENTER_GROUP:
431  if (pSh->IsGroupSelected())
432  {
433  pSdrView->EnterMarkedGroup();
434  rBind.InvalidateAll(false);
435  }
436  break;
437 
438  case SID_LEAVE_GROUP:
439  if (pSdrView->IsGroupEntered())
440  {
441  pSdrView->LeaveOneGroup();
442  rBind.Invalidate(SID_ENTER_GROUP);
443  rBind.Invalidate(SID_UNGROUP);
444  }
445  break;
446 
447  case SID_OBJECT_ALIGN_LEFT:
448  case SID_OBJECT_ALIGN_CENTER:
449  case SID_OBJECT_ALIGN_RIGHT:
450  case SID_OBJECT_ALIGN_UP:
451  case SID_OBJECT_ALIGN_MIDDLE:
452  case SID_OBJECT_ALIGN_DOWN:
453  {
454  if ( bAlignPossible )
455  {
456  const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
457  if (rMarkList.GetMarkCount() == 1
459  {
460  sal_Int16 nHorizOrient = -1, nVertOrient = -1;
461 
462  switch (nSlotId)
463  {
464  case SID_OBJECT_ALIGN_LEFT:
465  nHorizOrient = text::HoriOrientation::LEFT;
466  break;
467  case SID_OBJECT_ALIGN_CENTER:
468  nHorizOrient = text::HoriOrientation::CENTER;
469  break;
470  case SID_OBJECT_ALIGN_RIGHT:
471  nHorizOrient = text::HoriOrientation::RIGHT;
472  break;
473  case SID_OBJECT_ALIGN_UP:
474  nVertOrient = text::VertOrientation::TOP;
475  break;
476  case SID_OBJECT_ALIGN_MIDDLE:
477  nVertOrient = text::VertOrientation::CENTER;
478  break;
479  case SID_OBJECT_ALIGN_DOWN:
480  nVertOrient = text::VertOrientation::BOTTOM;
481  break;
482  default:
483  break;
484  }
485 
486  if (nHorizOrient != -1)
487  {
488  pSh->StartAction();
489  SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
490  SwFrameFormat* pFrameFormat = FindFrameFormat( pObj );
491  SwFormatHoriOrient aHOrient(pFrameFormat->GetFormatAttr(RES_HORI_ORIENT));
492  aHOrient.SetHoriOrient( nHorizOrient );
493  pFrameFormat->SetFormatAttr(aHOrient);
494  pSh->EndAction();
495  }
496 
497  if (nVertOrient != -1)
498  {
499  pSh->StartAction();
500  SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
501  SwFrameFormat* pFrameFormat = FindFrameFormat( pObj );
502  SwFormatVertOrient aVOrient(pFrameFormat->GetFormatAttr(RES_VERT_ORIENT));
503  aVOrient.SetVertOrient( nVertOrient );
504  pFrameFormat->SetFormatAttr(aVOrient);
505  pSh->EndAction();
506  }
507 
508  break;
509  }
510 
511  pSh->StartAction();
512  switch (nSlotId)
513  {
514  case SID_OBJECT_ALIGN_LEFT:
515  pSdrView->AlignMarkedObjects(SdrHorAlign::Left, SdrVertAlign::NONE);
516  break;
517  case SID_OBJECT_ALIGN_CENTER:
518  pSdrView->AlignMarkedObjects(SdrHorAlign::Center, SdrVertAlign::NONE);
519  break;
520  case SID_OBJECT_ALIGN_RIGHT:
521  pSdrView->AlignMarkedObjects(SdrHorAlign::Right, SdrVertAlign::NONE);
522  break;
523  case SID_OBJECT_ALIGN_UP:
524  pSdrView->AlignMarkedObjects(SdrHorAlign::NONE, SdrVertAlign::Top);
525  break;
526  case SID_OBJECT_ALIGN_MIDDLE:
527  pSdrView->AlignMarkedObjects(SdrHorAlign::NONE, SdrVertAlign::Center);
528  break;
529  case SID_OBJECT_ALIGN_DOWN:
530  pSdrView->AlignMarkedObjects(SdrHorAlign::NONE, SdrVertAlign::Bottom);
531  break;
532  }
533  pSh->EndAction();
534  }
535  }
536  break;
537 
538  case FN_FRAME_UP:
539  bTopParam = false;
540  [[fallthrough]];
541  case SID_FRAME_TO_TOP:
542  pSh->SelectionToTop( bTopParam );
543  break;
544 
545  case FN_FRAME_DOWN:
546  bBottomParam = false;
547  [[fallthrough]];
548  case SID_FRAME_TO_BOTTOM:
549  pSh->SelectionToBottom( bBottomParam );
550  break;
551 
552  case FN_NAME_SHAPE:
553  {
554  bDone = true;
555 
556  if(1 == pSdrView->GetMarkedObjectCount())
557  {
558  // #i68101#
559  SdrObject* pSelected = pSdrView->GetMarkedObjectByIndex(0);
560  OSL_ENSURE(pSelected, "DrawViewShell::FuTemp03: nMarkCount, but no object (!)");
561  OUString aName(pSelected->GetName());
562 
564  ScopedVclPtr<AbstractSvxObjectNameDialog> pDlg(pFact->CreateSvxObjectNameDialog(GetView().GetFrameWeld(), aName));
565 
566  pDlg->SetCheckNameHdl(LINK(this, SwDrawBaseShell, CheckGroupShapeNameHdl));
567 
568  if(RET_OK == pDlg->Execute())
569  {
570  pDlg->GetName(aName);
571  pSelected->SetName(aName);
572  pSh->SetModified();
573  }
574  }
575 
576  break;
577  }
578 
579  // #i68101#
581  {
582  bDone = true;
583 
584  if(1 == pSdrView->GetMarkedObjectCount())
585  {
586  SdrObject* pSelected = pSdrView->GetMarkedObjectByIndex(0);
587  OSL_ENSURE(pSelected, "DrawViewShell::FuTemp03: nMarkCount, but no object (!)");
588  OUString aTitle(pSelected->GetTitle());
589  OUString aDescription(pSelected->GetDescription());
590 
592  ScopedVclPtr<AbstractSvxObjectTitleDescDialog> pDlg(pFact->CreateSvxObjectTitleDescDialog(GetView().GetFrameWeld(),
593  aTitle, aDescription));
594 
595  if(RET_OK == pDlg->Execute())
596  {
597  pDlg->GetTitle(aTitle);
598  pDlg->GetDescription(aDescription);
599 
600  pSelected->SetTitle(aTitle);
601  pSelected->SetDescription(aDescription);
602 
603  pSh->SetModified();
604  }
605  }
606 
607  break;
608  }
609 
610  case SID_OPEN_HYPERLINK:
611  {
612  const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
613  SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
615  /*rTargetFrameName=*/OUString());
616  break;
617  }
618 
619  case SID_EDIT_HYPERLINK:
620  case SID_HYPERLINK_DIALOG:
621  {
622  GetView().GetViewFrame()->SetChildWindow(SID_HYPERLINK_DIALOG, true);
623  break;
624  }
625 
626  case SID_HYPERLINK_SETLINK:
627  {
628  if(pItem)
629  {
630  const SvxHyperlinkItem& rHLinkItem = *static_cast<const SvxHyperlinkItem *>(pItem);
631  const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
632  SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
633  pObj->setHyperlink(rHLinkItem.GetURL());
634  }
635  break;
636  }
637 
638  case SID_REMOVE_HYPERLINK:
639  {
640  const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
641  SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
642  pObj->setHyperlink(OUString());
643  break;
644  }
645 
646  case SID_COPY_HYPERLINK_LOCATION:
647  {
648  const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
649  SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
650  uno::Reference<datatransfer::clipboard::XClipboard> xClipboard
653  break;
654  }
655 
656  default:
657  OSL_ENSURE(false, "wrong Dispatcher");
658  return;
659  }
660  if(!bDone)
661  {
662  if(nSlotId >= SID_OBJECT_ALIGN_LEFT && nSlotId <= SID_OBJECT_ALIGN_DOWN)
663  rBind.Invalidate(SID_ATTR_LONG_LRSPACE);
664  if (pSdrView->GetModel()->IsChanged())
665  pSh->SetModified();
666  else if (bChanged)
667  pSdrView->GetModel()->SetChanged();
668  }
669 }
670 
671 // Checks whether a given name is allowed for a group shape
672 
673 IMPL_LINK( SwDrawBaseShell, CheckGroupShapeNameHdl, AbstractSvxObjectNameDialog&, rNameDialog, bool )
674 {
675  SwWrtShell &rSh = GetShell();
676  SdrView *pSdrView = rSh.GetDrawView();
677  const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
678  OSL_ENSURE(rMarkList.GetMarkCount() == 1, "wrong draw selection");
679  SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
680  const OUString sCurrentName = pObj->GetName();
681  OUString sNewName;
682  rNameDialog.GetName(sNewName);
683  bool bRet = false;
684  if (sNewName.isEmpty() || sCurrentName == sNewName)
685  bRet = true;
686  else
687  {
688  bRet = true;
690  SdrObjListIter aIter( pModel->GetPage(0), SdrIterMode::DeepWithGroups );
691  while( aIter.IsMore() )
692  {
693  SdrObject* pTempObj = aIter.Next();
694  if ( pObj != pTempObj && pTempObj->GetName() == sNewName )
695  {
696  bRet = false;
697  break;
698  }
699  }
700  }
701  return bRet;
702 }
703 
705 {
706  SwWrtShell &rSh = GetShell();
707  SdrView* pSdrView = rSh.GetDrawViewWithValidMarkList();
708  SfxWhichIter aIter( rSet );
709  sal_uInt16 nWhich = aIter.FirstWhich();
711 
712  if (!bProtected) // Look in the parent
714 
715  while( nWhich )
716  {
717  switch( nWhich )
718  {
719  case FN_DRAW_WRAP_DLG:
720  case SID_ATTR_TRANSFORM:
721  case SID_FRAME_TO_TOP:
722  case SID_FRAME_TO_BOTTOM:
723  case FN_FRAME_UP:
724  case FN_FRAME_DOWN:
725  case SID_DELETE:
726  case FN_BACKSPACE:
727  if( bProtected || !rSh.IsObjSelected() )
728  rSet.DisableItem( nWhich );
729  break;
730  case SID_GROUP:
731  if ( rSh.IsObjSelected() < 2 || bProtected || !rSh.IsGroupAllowed() )
732  rSet.DisableItem( nWhich );
733  break;
734  case SID_UNGROUP:
735  if ( !rSh.IsGroupSelected() || bProtected || !rSh.IsUnGroupAllowed() )
736  rSet.DisableItem( nWhich );
737  break;
738  case SID_ENTER_GROUP:
739  if ( !rSh.IsGroupSelected() )
740  rSet.DisableItem( nWhich );
741  break;
742  case SID_LEAVE_GROUP:
743  if ( !pSdrView->IsGroupEntered() )
744  rSet.DisableItem( nWhich );
745  break;
746  case SID_OBJECT_ALIGN_LEFT:
747  case SID_OBJECT_ALIGN_CENTER:
748  case SID_OBJECT_ALIGN_RIGHT:
749  case SID_OBJECT_ALIGN_UP:
750  case SID_OBJECT_ALIGN_MIDDLE:
751  case SID_OBJECT_ALIGN_DOWN:
752  case SID_OBJECT_ALIGN:
753  {
754  bool bDisableThis = false;
755  bool bDisableHoriz = false;
756  bool bHoriz = (nWhich == SID_OBJECT_ALIGN_LEFT || nWhich == SID_OBJECT_ALIGN_CENTER ||
757  nWhich == SID_OBJECT_ALIGN_RIGHT);
758  bool bVert = (nWhich == SID_OBJECT_ALIGN_UP || nWhich == SID_OBJECT_ALIGN_MIDDLE ||
759  nWhich == SID_OBJECT_ALIGN_DOWN);
760  const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
761  if ( !rSh.IsAlignPossible() || bProtected )
762  {
763  bDisableThis = true;
764  rSet.DisableItem( nWhich );
765  }
766  else if ( rSh.GetAnchorId() == RndStdIds::FLY_AS_CHAR )
767  {
768  //if only one object is selected it can only be vertically
769  // aligned because it is character bound
770  if( rMarkList.GetMarkCount() == 1 )
771  {
772  bDisableHoriz = true;
773  rSet.DisableItem(SID_OBJECT_ALIGN_LEFT);
774  rSet.DisableItem(SID_OBJECT_ALIGN_CENTER);
775  rSet.DisableItem(SID_OBJECT_ALIGN_RIGHT);
776  }
777  }
778 
779  if (bHoriz && !bDisableThis && !bDisableHoriz &&
780  rMarkList.GetMarkCount() == 1)
781  {
782  sal_Int16 nHoriOrient = -1;
783  switch(nWhich)
784  {
785  case SID_OBJECT_ALIGN_LEFT:
786  nHoriOrient = text::HoriOrientation::LEFT;
787  break;
788  case SID_OBJECT_ALIGN_CENTER:
789  nHoriOrient = text::HoriOrientation::CENTER;
790  break;
791  case SID_OBJECT_ALIGN_RIGHT:
792  nHoriOrient = text::HoriOrientation::RIGHT;
793  break;
794  default:
795  break;
796  }
797 
798  SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
799  SwFrameFormat* pFrameFormat = FindFrameFormat(pObj);
800  SwFormatHoriOrient aHOrient(pFrameFormat->GetFormatAttr(RES_HORI_ORIENT));
801  rSet.Put(SfxBoolItem(nWhich, aHOrient.GetHoriOrient() == nHoriOrient));
802  }
803 
804  if (bVert && !bDisableThis && rMarkList.GetMarkCount() == 1)
805  {
806  sal_Int16 nVertOrient = -1;
807  switch(nWhich)
808  {
809  case SID_OBJECT_ALIGN_UP:
810  nVertOrient = text::VertOrientation::TOP;
811  break;
812  case SID_OBJECT_ALIGN_MIDDLE:
813  nVertOrient = text::VertOrientation::CENTER;
814  break;
815  case SID_OBJECT_ALIGN_DOWN:
816  nVertOrient = text::VertOrientation::BOTTOM;
817  break;
818  default:
819  break;
820  }
821 
822  SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
823  SwFrameFormat* pFrameFormat = FindFrameFormat(pObj);
824  SwFormatVertOrient aVOrient(pFrameFormat->GetFormatAttr(RES_VERT_ORIENT));
825  rSet.Put(SfxBoolItem(nWhich, aVOrient.GetVertOrient() == nVertOrient));
826  }
827  }
828  break;
829 
830  case FN_NAME_SHAPE :
831  {
832  if(1 != pSdrView->GetMarkedObjectCount())
833  {
834  rSet.DisableItem( nWhich );
835  }
836  }
837  break;
838 
839  // #i68101#
841  {
842  const bool bIsWebView(nullptr != dynamic_cast<SwWebView*>(&GetView()));
843 
844  if(!bIsWebView && 1 != pSdrView->GetMarkedObjectCount())
845  {
846  rSet.DisableItem( nWhich );
847  }
848  }
849  break;
850 
851  case SID_OPEN_HYPERLINK:
852  case SID_EDIT_HYPERLINK:
853  case SID_HYPERLINK_DIALOG:
854  case SID_REMOVE_HYPERLINK:
855  case SID_COPY_HYPERLINK_LOCATION:
856  {
857  if (pSdrView->GetMarkedObjectCount() != 1)
858  {
859  rSet.DisableItem(nWhich);
860  break;
861  }
862 
863  const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
864  SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
865  sal_uInt16 nObjType = pObj->GetObjIdentifier();
866 
867  // Only enable hyperlink for the following types
868  switch (nObjType)
869  {
870  case OBJ_PATHFILL:
871  case OBJ_SECT:
872  case OBJ_LINE:
873  case OBJ_CUSTOMSHAPE:
874  case OBJ_TEXT:
875  case OBJ_RECT:
876  case OBJ_CAPTION:
877  case OBJ_POLY:
878  case OBJ_PLIN:
879  case E3D_SCENE_ID:
880  case OBJ_MEASURE:
881  case OBJ_EDGE:
882  break;
883  default:
884  rSet.DisableItem(nWhich);
885  break;
886  }
887 
888  if (nWhich == SID_OPEN_HYPERLINK || nWhich == SID_REMOVE_HYPERLINK
889  || nWhich == SID_EDIT_HYPERLINK || nWhich == SID_COPY_HYPERLINK_LOCATION)
890  {
891  if (pObj->getHyperlink().isEmpty())
892  rSet.DisableItem(nWhich);
893  }
894  }
895  break;
896 
897  case SID_HYPERLINK_GETLINK:
898  {
899  const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
900  SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
901  OUString sHyperLink = pObj->getHyperlink();
902  SvxHyperlinkItem aHLinkItem;
903  aHLinkItem.SetURL(sHyperLink);
904  rSet.Put(aHLinkItem);
905  }
906  break;
907  }
908  nWhich = aIter.NextWhich();
909  }
910 }
911 
913 {
914  SwWrtShell *pSh = &GetShell();
915  SdrView* pSdrView = pSh->GetDrawView();
916  const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
917  if( rMarkList.GetMark(0) != nullptr )
918  {
919  SfxItemSet aNewAttr(pSdrView->GetGeoAttrFromMarked());
920  rSet.Put(aNewAttr,false);
921  }
922 }
923 
924 bool SwDrawBaseShell::Disable(SfxItemSet& rSet, sal_uInt16 nWhich)
925 {
927 
928  if (bDisable)
929  {
930  if (nWhich)
931  rSet.DisableItem( nWhich );
932  else
933  {
934  SfxWhichIter aIter( rSet );
935  nWhich = aIter.FirstWhich();
936  while (nWhich)
937  {
938  rSet.DisableItem( nWhich );
939  nWhich = aIter.NextWhich();
940  }
941  }
942  }
943 
944  return bDisable;
945 }
946 
948 {
949  SwWrtShell *pSh = &GetShell();
950  SdrView* pSdrView = pSh->GetDrawView();
951  const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
952  const size_t nMarkCount = rMarkList.GetMarkCount();
953  bool bShowArea = true, bShowMeasure = true;
954 
955  for (size_t i = 0; i < nMarkCount && i < 50; ++i)
956  {
957  SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
958  sal_uInt16 nObjType = pObj->GetObjIdentifier();
959 
960  if ( nObjType != OBJ_MEASURE )
961  bShowMeasure = false;
962 
963  // If marked object is 2D, disable format area command.
964  if ( nObjType == OBJ_PLIN ||
965  nObjType == OBJ_LINE ||
966  nObjType == OBJ_PATHLINE ||
967  nObjType == OBJ_FREELINE ||
968  nObjType == OBJ_EDGE ||
969  nObjType == OBJ_CARC ||
970  bShowMeasure )
971  bShowArea = false;
972 
973  if (!bShowArea && !bShowMeasure)
974  break;
975  }
976 
977  if (!bShowArea)
978  rSet.DisableItem(SID_ATTRIBUTES_AREA);
979 
980  if (!bShowMeasure)
981  rSet.DisableItem(SID_MEASURE_DLG);
982 
983  Disable(rSet);
984 
985 }
986 
987 // Validate of drawing positions
988 
989 IMPL_LINK(SwDrawBaseShell, ValidatePosition, SvxSwFrameValidation&, rValidation, void )
990 {
991  SwWrtShell *pSh = &GetShell();
992  rValidation.nMinHeight = MINFLY;
993  rValidation.nMinWidth = MINFLY;
994 
995  SwRect aBoundRect;
996 
997  // OD 18.09.2003 #i18732# - adjustment for allowing vertical position
998  // aligned to page for fly frame anchored to paragraph or to character.
999  const RndStdIds eAnchorType = rValidation.nAnchorType;
1000  const SwPosition* pContentPos = nullptr;
1001  SdrView* pSdrView = pSh->GetDrawView();
1002  const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
1003  if( rMarkList.GetMarkCount() == 1 )
1004  {
1005  SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
1006  SwFrameFormat* pFrameFormat = FindFrameFormat( pObj );
1007  pContentPos = pFrameFormat->GetAnchor().GetContentAnchor();
1008  }
1009 
1010  pSh->CalcBoundRect( aBoundRect, eAnchorType,
1011  rValidation.nHRelOrient,
1012  rValidation.nVRelOrient,
1013  pContentPos,
1014  rValidation.bFollowTextFlow,
1015  rValidation.bMirror, nullptr, &rValidation.aPercentSize);
1016 
1017  bool bIsInVertical( false );
1018  {
1019  bool bRTL;
1020  bool bVertL2R;
1021  bIsInVertical = pSh->IsFrameVertical(true, bRTL, bVertL2R);
1022  }
1023  if(bIsInVertical)
1024  {
1025  Point aPos(aBoundRect.Pos());
1026  tools::Long nTmp = aPos.X();
1027  aPos.setX( aPos.Y() );
1028  aPos.setY( nTmp );
1029  Size aSize(aBoundRect.SSize());
1030  nTmp = aSize.Width();
1031  aSize.setWidth( aSize.Height() );
1032  aSize.setHeight( nTmp );
1033  aBoundRect.Chg( aPos, aSize );
1034  //exchange width/height to enable correct values
1035  nTmp = rValidation.nWidth;
1036  rValidation.nWidth = rValidation.nHeight;
1037  rValidation.nHeight = nTmp;
1038  }
1039  if ((eAnchorType == RndStdIds::FLY_AT_PAGE) || (eAnchorType == RndStdIds::FLY_AT_FLY))
1040  {
1041  // MinimalPosition
1042  rValidation.nMinHPos = aBoundRect.Left();
1043  rValidation.nMinVPos = aBoundRect.Top();
1044  SwTwips nH = rValidation.nHPos;
1045  SwTwips nV = rValidation.nVPos;
1046 
1047  if (rValidation.nHPos + rValidation.nWidth > aBoundRect.Right())
1048  {
1049  if (rValidation.nHoriOrient == text::HoriOrientation::NONE)
1050  {
1051  rValidation.nHPos -= ((rValidation.nHPos + rValidation.nWidth) - aBoundRect.Right());
1052  nH = rValidation.nHPos;
1053  }
1054  else
1055  rValidation.nWidth = aBoundRect.Right() - rValidation.nHPos;
1056  }
1057 
1058  if (rValidation.nHPos + rValidation.nWidth > aBoundRect.Right())
1059  rValidation.nWidth = aBoundRect.Right() - rValidation.nHPos;
1060 
1061  if (rValidation.nVPos + rValidation.nHeight > aBoundRect.Bottom())
1062  {
1063  if (rValidation.nVertOrient == text::VertOrientation::NONE)
1064  {
1065  rValidation.nVPos -= ((rValidation.nVPos + rValidation.nHeight) - aBoundRect.Bottom());
1066  nV = rValidation.nVPos;
1067  }
1068  else
1069  rValidation.nHeight = aBoundRect.Bottom() - rValidation.nVPos;
1070  }
1071 
1072  if (rValidation.nVPos + rValidation.nHeight > aBoundRect.Bottom())
1073  rValidation.nHeight = aBoundRect.Bottom() - rValidation.nVPos;
1074 
1075  if ( rValidation.nVertOrient != text::VertOrientation::NONE )
1076  nV = aBoundRect.Top();
1077 
1078  if ( rValidation.nHoriOrient != text::HoriOrientation::NONE )
1079  nH = aBoundRect.Left();
1080 
1081  rValidation.nMaxHPos = aBoundRect.Right() - rValidation.nWidth;
1082  rValidation.nMaxHeight = aBoundRect.Bottom() - nV;
1083 
1084  rValidation.nMaxVPos = aBoundRect.Bottom() - rValidation.nHeight;
1085  rValidation.nMaxWidth = aBoundRect.Right() - nH;
1086  }
1087  else if ((eAnchorType == RndStdIds::FLY_AT_PARA) || (eAnchorType == RndStdIds::FLY_AT_CHAR))
1088  {
1089  if (rValidation.nHPos + rValidation.nWidth > aBoundRect.Right())
1090  {
1091  if (rValidation.nHoriOrient == text::HoriOrientation::NONE)
1092  {
1093  rValidation.nHPos -= ((rValidation.nHPos + rValidation.nWidth) - aBoundRect.Right());
1094  }
1095  else
1096  rValidation.nWidth = aBoundRect.Right() - rValidation.nHPos;
1097  }
1098 
1099  // OD 29.09.2003 #i17567#, #i18732# - consider following the text flow
1100  // and alignment at page areas.
1101  const bool bMaxVPosAtBottom = !rValidation.bFollowTextFlow ||
1102  rValidation.nVRelOrient == text::RelOrientation::PAGE_FRAME ||
1103  rValidation.nVRelOrient == text::RelOrientation::PAGE_PRINT_AREA ||
1104  rValidation.nVRelOrient == text::RelOrientation::PAGE_PRINT_AREA_BOTTOM;
1105  {
1106  SwTwips nTmpMaxVPos = ( bMaxVPosAtBottom
1107  ? aBoundRect.Bottom()
1108  : aBoundRect.Height() ) -
1109  rValidation.nHeight;
1110  if ( rValidation.nVPos > nTmpMaxVPos )
1111  {
1112  if (rValidation.nVertOrient == text::VertOrientation::NONE)
1113  {
1114  rValidation.nVPos = nTmpMaxVPos;
1115  }
1116  else
1117  {
1118  rValidation.nHeight = ( bMaxVPosAtBottom
1119  ? aBoundRect.Bottom()
1120  : aBoundRect.Height() ) - rValidation.nVPos;
1121  }
1122  }
1123  }
1124 
1125  rValidation.nMinHPos = aBoundRect.Left();
1126  rValidation.nMaxHPos = aBoundRect.Right() - rValidation.nWidth;
1127 
1128  rValidation.nMinVPos = aBoundRect.Top();
1129  // OD 26.09.2003 #i17567#, #i18732# - determine maximum vertical position
1130  if ( bMaxVPosAtBottom )
1131  {
1132  rValidation.nMaxVPos = aBoundRect.Bottom() - rValidation.nHeight;
1133  }
1134  else
1135  {
1136  rValidation.nMaxVPos = aBoundRect.Height() - rValidation.nHeight;
1137  }
1138 
1139  // Maximum width height
1140  const SwTwips nH = ( rValidation.nHoriOrient != text::HoriOrientation::NONE )
1141  ? aBoundRect.Left()
1142  : rValidation.nHPos;
1143  const SwTwips nV = ( rValidation.nVertOrient != text::VertOrientation::NONE )
1144  ? aBoundRect.Top()
1145  : rValidation.nVPos;
1146  rValidation.nMaxHeight = rValidation.nMaxVPos + rValidation.nHeight - nV;
1147  rValidation.nMaxWidth = rValidation.nMaxHPos + rValidation.nWidth - nH;
1148  }
1149  else if (eAnchorType == RndStdIds::FLY_AS_CHAR)
1150  {
1151  rValidation.nMinHPos = 0;
1152  rValidation.nMaxHPos = 0;
1153 
1154  rValidation.nMaxHeight = aBoundRect.Height();
1155  rValidation.nMaxWidth = aBoundRect.Width();
1156 
1157  rValidation.nMaxVPos = aBoundRect.Height();
1158  rValidation.nMinVPos = -aBoundRect.Height() + rValidation.nHeight;
1159  if (rValidation.nMaxVPos < rValidation.nMinVPos)
1160  {
1161  rValidation.nMinVPos = rValidation.nMaxVPos;
1162  rValidation.nMaxVPos = -aBoundRect.Height();
1163  }
1164  }
1165  if(bIsInVertical)
1166  {
1167  //restore width/height exchange
1168  tools::Long nTmp = rValidation.nWidth;
1169  rValidation.nWidth = rValidation.nHeight;
1170  rValidation.nHeight = nTmp;
1171  }
1172 
1173  if (rValidation.nMaxWidth < rValidation.nWidth)
1174  rValidation.nWidth = rValidation.nMaxWidth;
1175  if (rValidation.nMaxHeight < rValidation.nHeight)
1176  rValidation.nHeight = rValidation.nMaxHeight;
1177 }
1178 
1179 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void SetURL(const OUString &rURL)
SfxViewFrame * GetViewFrame() const
SFX_IMPL_SUPERCLASS_INTERFACE(DrawDocShell, SfxObjectShell)
void ExitDraw()
Definition: viewdraw.cxx:389
void UnGroupSelection()
The individual objects are selected, but it is possible that there are groups included.
Definition: feshview.cxx:2566
constexpr TypedWhichId< SwFormatSurround > RES_SURROUND(101)
static void CopyStringTo(const OUString &rContent, const css::uno::Reference< css::datatransfer::clipboard::XClipboard > &rxClipboard, const vcl::ILibreOfficeKitNotifier *pNotifier=nullptr)
FieldUnit
void Right(const tools::Long nRight)
Definition: swrect.hxx:199
void GetDrawAttrStateForIFBX(SfxItemSet &rSet)
Definition: drwbassh.cxx:912
OBJ_RECT
size_t GetMarkCount() const
Marks a position in the document model.
Definition: pam.hxx:35
bool IsAlignPossible() const
Definition: feshview.cxx:2800
void ChgAnchor(RndStdIds eAnchorId, bool bSameOnly=false, bool bPosCorr=true)
frmatr.hxx.
Definition: feshview.cxx:2349
bool IsUnGroupAllowed() const
Definition: feshview.cxx:2534
SwView & GetView()
Definition: basesh.hxx:59
SdrView * GetDrawView()
Definition: vnew.cxx:373
void AlignMarkedObjects(SdrHorAlign eHor, SdrVertAlign eVert)
static constexpr auto Items
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.
css::uno::Reference< css::datatransfer::clipboard::XClipboard > GetClipboard()
void Left(const tools::Long nLeft)
Definition: swrect.hxx:194
void setHyperlink(const OUString &sHyperlink)
void GroupSelection()
Afterwards the group is selected.
Definition: feshview.cxx:2551
bool AreObjectsMarked() const
SwWrtShell & GetShell()
Definition: basesh.cxx:2763
void FlipDrawRotate()
Definition: view.hxx:530
void SelectionToHeaven()
Above document.
Definition: feshview.cxx:1230
static SvxAbstractDialogFactory * Create()
#define MINFLY
Definition: swtypes.hxx:62
long Long
OUString GetDescription() const
OBJ_LINE
Check only parents.
OBJ_POLY
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
const OUString & getHyperlink() const
SdrMark * GetMark(size_t nNum) const
void Pos(const Point &rNew)
Definition: swrect.hxx:168
Of course Writer needs its own rectangles.
Definition: swrect.hxx:34
void SetModified()
Definition: edws.cxx:70
bool IsGroupSelected()
Create and destroy group, don't when frame is selected.
Definition: feshview.cxx:2428
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:167
sal_uInt16 NextWhich()
OBJ_SECT
SfxItemSet GetGeoAttrFromMarked() const
void SetDrawFuncPtr(std::unique_ptr< SwDrawBase > pFuncPtr)
Definition: viewdraw.cxx:641
void EnterMarkedGroup()
virtual void SetInputSet(const SfxItemSet *pInSet)=0
Used by the UI to modify the document model.
Definition: wrtsh.hxx:93
constexpr tools::Long Width() const
constexpr TypedWhichId< SwFormatVertOrient > RES_VERT_ORIENT(102)
void LoadURL(SwViewShell &rVSh, const OUString &rURL, LoadUrlFlags nFilter, const OUString &rTargetFrameName)
Definition: wrtsh2.cxx:498
const SwView & GetView() const
Definition: wrtsh.hxx:431
const SwFrameFormat * IsFlyInFly()
Is selected frame within another frame?
Definition: fefly1.cxx:312
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:4173
virtual VclPtr< AbstractSvxTransformTabDialog > CreateSvxTransformTabDialog(weld::Window *pParent, const SfxItemSet *pAttr, const SdrView *pView, SvxAnchorIds nAnchorTypes=SvxAnchorIds::NONE)=0
void Edit()
Definition: wrtsh1.cxx:173
void Width(tools::Long nNew)
Definition: swrect.hxx:186
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:2674
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:704
SfxItemPool & GetPool() const
void SelectionToHell()
Below document.
Definition: feshview.cxx:1235
void SelectionToBottom(bool bBottom=true)
Definition: feshview.cxx:1112
SdrObject * GetMarkedSdrObj() const
weld::Window * GetFrameWeld(const SfxFrame *pFrame)
Definition: dialoghelp.cxx:19
virtual ~SwDrawBaseShell() override
Definition: drwbassh.cxx:91
OBJ_PATHFILL
Style of a layout element.
Definition: frmfmt.hxx:59
const OUString & GetURL() const
#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:766
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:2751
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:98
SfxBindings & GetBindings()
OBJ_CAPTION
const SdrMarkList & GetMarkedObjectList() const
sal_uInt16 Count() 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
E3D_SCENE_ID
#define FN_FRAME_DOWN
Definition: cmdid.h:369
OBJ_PLIN
OBJ_FREELINE
bool IsGroupAllowed() const
Definition: feshview.cxx:2474
void LeaveOneGroup()
static SwAbstractDialogFactory * Create()
Definition: swabstdlg.cxx:36
bool IsDrawRotate() const
Definition: view.hxx:529
void SSize(const Size &rNew)
Definition: swrect.hxx:177
void SelectionToTop(bool bTop=true)
Move selection upwards or downwards (Z-Order).
Definition: feshview.cxx:1043
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:2319
tools::Long SwTwips
Definition: swtypes.hxx:52
FlyProtectFlags IsSelObjProtected(FlyProtectFlags eType) const
Which Protection is set at selected object?
Definition: feshview.cxx:2683
OUString GetName() const
bool Disable(SfxItemSet &rSet, sal_uInt16 nWhich=0)
Definition: drwbassh.cxx:924
SwDocShell * GetDocShell()
Definition: view.cxx:1127
bool IsChanged() const
void DisableState(SfxItemSet &rSet)
Definition: drwbassh.cxx:947
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:227
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:1164
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
void Bottom(const tools::Long nBottom)
Definition: swrect.hxx:208
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:4185
OBJ_MEASURE
SdrView * GetDrawViewWithValidMarkList()
Definition: vnew.cxx:378
virtual void SetValidateFramePosLink(const Link< SvxSwFrameValidation &, void > &rLink)=0
OUString aName
void GetAttributes(SfxItemSet &rTargetSet, bool bOnlyHardAttr=false) const
if(aStr!=aBuf) UpdateName_Impl(m_xFollowLb.get()
RET_OK
SvxAnchorIds
#define FN_BACKSPACE
Definition: cmdid.h:660
void SetChildWindow(sal_uInt16 nId, bool bVisible, bool bSetFocus=true)
void Top(const tools::Long nTop)
Definition: swrect.hxx:203
void SetDescription(const OUString &rStr)
size_t IsObjSelected() const
Definition: feshview.cxx:1240
void DelSelectedObj()
Definition: feshview.cxx:2367
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:2774
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
virtual WhichRangesContainer GetInputRanges(const SfxItemPool &)=0
OBJ_CUSTOMSHAPE
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:723
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
OBJ_TEXT
void Chg(const Point &rNP, const Size &rNS)
Definition: swrect.hxx:163
void Height(tools::Long nNew)
Definition: swrect.hxx:190
SdrModel * GetModel() const
IMPL_LINK(SwDrawBaseShell, CheckGroupShapeNameHdl, AbstractSvxObjectNameDialog &, rNameDialog, bool)
Definition: drwbassh.cxx:673
SwDrawBaseShell(SwView &rShell)
Definition: drwbassh.cxx:76
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:1149
constexpr TypedWhichId< SwFormatAnchor > RES_ANCHOR(104)
bool IsSelFrameMode() const
Definition: wrtsh.hxx:173
void EndAction(const bool bIdleEnd=false)
Definition: crsrsh.cxx:244