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