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 <svx/svdogrp.hxx>
52#include <vcl/unohelp2.hxx>
53#include <swabstdlg.hxx>
54#include <swundo.hxx>
55#include <com/sun/star/text/HoriOrientation.hpp>
56#include <com/sun/star/text/VertOrientation.hpp>
57#include <com/sun/star/text/RelOrientation.hpp>
58#include <com/sun/star/uno/Reference.hxx>
60#include <fmtfollowtextflow.hxx>
61#include <textboxhelper.hxx>
63
64using namespace ::com::sun::star;
65using namespace css::beans;
66using namespace css::drawing;
67using namespace css::uno;
68
70
71void 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,
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, pSh->GetLayerId().get()));
140
141 pSh->GetObjAttr(aSet);
144
145 if (pDlg->Execute() == RET_OK)
146 {
147 const SfxItemSet* pOutSet = pDlg->GetOutputItemSet();
148 if(const SfxInt16Item* pWrapItem = pOutSet->GetItemIfSet(FN_DRAW_WRAP_DLG, false))
149 {
150 short nLayer = pWrapItem->GetValue();
151 if (nLayer == 1)
152 pSh->SelectionToHeaven();
153 else
154 pSh->SelectionToHell();
155 }
156
157 pSh->SetObjAttr(*pOutSet);
158 }
159 }
160 }
161 }
162 }
163 break;
164
165 case SID_ATTR_TRANSFORM:
166 {
167 if(pSdrView->AreObjectsMarked())
168 {
169 if(!pArgs)
170 {
171 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
172 if( rMarkList.GetMark(0) != nullptr )
173 {
174 SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
176 bool bCaption = false;
177
178 // Allowed anchorages:
179 RndStdIds nAnchor = pSh->GetAnchorId();
180 SvxAnchorIds nAllowedAnchors = SvxAnchorIds::Paragraph | SvxAnchorIds::Character | SvxAnchorIds::Page;
181 sal_uInt16 nHtmlMode = ::GetHtmlMode(pSh->GetView().GetDocShell());
182
183 if ( pSh->IsFlyInFly() )
184 nAllowedAnchors |= SvxAnchorIds::Fly;
185
186 if (pObj->GetObjIdentifier() == SdrObjKind::Caption )
187 bCaption = true;
188
189 if (bCaption)
190 {
193 pFact->CreateCaptionDialog( rReq.GetFrameWeld(), pSdrView, nAllowedAnchors );
194 pDlg.reset(pCaptionDlg);
195 pCaptionDlg->SetValidateFramePosLink( LINK(this, SwDrawBaseShell, ValidatePosition) );
196 }
197 else
198 {
201 pFact->CreateSvxTransformTabDialog(rReq.GetFrameWeld(), nullptr, pSdrView, nAllowedAnchors);
202 pDlg.reset(pTransform);
203 pTransform->SetValidateFramePosLink( LINK(this, SwDrawBaseShell, ValidatePosition) );
204 }
205 SfxItemSet aNewAttr(pSdrView->GetGeoAttrFromMarked());
206
207 const WhichRangesContainer& pRange = pDlg->GetInputRanges( *aNewAttr.GetPool() );
208 SfxItemSet aSet( *aNewAttr.GetPool(), pRange );
209 FieldUnit eMetric = ::GetDfltMetric( dynamic_cast<SwWebView*>(&GetView()) != nullptr );
210 SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric)) );
211
212 aSet.Put( aNewAttr, false );
213
214 if (bCaption)
215 pSdrView->GetAttributes( aSet );
216
217 aSet.Put(SfxInt16Item(SID_ATTR_TRANSFORM_ANCHOR, static_cast<sal_Int16>(nAnchor)));
218 bool bRTL;
219 bool bVertL2R;
220 aSet.Put(SfxBoolItem(SID_ATTR_TRANSFORM_IN_VERTICAL_TEXT, pSh->IsFrameVertical(true, bRTL, bVertL2R)));
221 aSet.Put(SfxBoolItem(SID_ATTR_TRANSFORM_IN_RTL_TEXT, bRTL));
222
223 SwFrameFormat* pFrameFormat = FindFrameFormat( pObj );
224
225 aSet.Put( pFrameFormat->GetFormatAttr(RES_FOLLOW_TEXT_FLOW) );
226
227 SwFormatVertOrient aVOrient(pFrameFormat->GetFormatAttr(RES_VERT_ORIENT));
228 aSet.Put(SfxInt16Item(SID_ATTR_TRANSFORM_VERT_ORIENT, aVOrient.GetVertOrient()));
229 aSet.Put(SfxInt16Item(SID_ATTR_TRANSFORM_VERT_RELATION, aVOrient.GetRelationOrient() ));
230 aSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_VERT_POSITION, aVOrient.GetPos()));
231
232 SwFormatHoriOrient aHOrient(pFrameFormat->GetFormatAttr(RES_HORI_ORIENT));
233 aSet.Put(SfxInt16Item(SID_ATTR_TRANSFORM_HORI_ORIENT, aHOrient.GetHoriOrient()));
234 aSet.Put(SfxInt16Item(SID_ATTR_TRANSFORM_HORI_RELATION, aHOrient.GetRelationOrient() ));
235 aSet.Put(SfxBoolItem(SID_ATTR_TRANSFORM_HORI_MIRROR, aHOrient.IsPosToggle()));
236 aSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_HORI_POSITION, aHOrient.GetPos()));
237
238 aSet.Put(SfxUInt16Item(SID_HTML_MODE, nHtmlMode));
239
240 pDlg->SetInputSet( &aSet );
241
242 pDlg->StartExecuteAsync([bCaption, bChanged, pDlg, pFrameFormat, pSdrView,
243 pSh, &rMarkList, this](
244 sal_Int32 nResult){
245 pSdrView->GetModel().SetChanged(false);
246
247 if (nResult == RET_OK)
248 {
249 SwFormatVertOrient aVOrientFinal(pFrameFormat->GetFormatAttr(RES_VERT_ORIENT));
250 SwFormatHoriOrient aHOrientFinal(pFrameFormat->GetFormatAttr(RES_HORI_ORIENT));
251
252 const SfxItemSet* pOutSet = pDlg->GetOutputItemSet();
253 pSh->StartAllAction();
254
255 // #i30451#
257
258 pSdrView->SetGeoAttrToMarked(*pOutSet);
259
260 if (bCaption)
261 pSdrView->SetAttributes(*pOutSet);
262
263 bool bPosCorr =
264 SfxItemState::SET != pOutSet->GetItemState(
265 SID_ATTR_TRANSFORM_POS_X, false ) &&
266 SfxItemState::SET != pOutSet->GetItemState(
267 SID_ATTR_TRANSFORM_POS_Y, false );
268
270
271 bool bSingleSelection = rMarkList.GetMarkCount() == 1;
272
273 if(const SfxInt16Item* pAnchorItem = pOutSet->GetItemIfSet(
274 SID_ATTR_TRANSFORM_ANCHOR, false))
275 {
276 if(!bSingleSelection)
277 pSh->ChgAnchor(static_cast<RndStdIds>(pAnchorItem
278 ->GetValue()), false, bPosCorr );
279 else
280 {
281 SwFormatAnchor aAnchor(pFrameFormat->GetAnchor());
282 aAnchor.SetType(static_cast<RndStdIds>(pAnchorItem->GetValue()));
283 aFrameAttrSet.Put( aAnchor );
284 }
285 }
286 const SfxInt16Item* pHoriOrient =
287 pOutSet->GetItemIfSet(SID_ATTR_TRANSFORM_HORI_ORIENT, false);
288 const SfxInt16Item* pHoriRelation =
289 pOutSet->GetItemIfSet(SID_ATTR_TRANSFORM_HORI_RELATION, false);
290 const SfxInt32Item* pHoriPosition =
291 pOutSet->GetItemIfSet(SID_ATTR_TRANSFORM_HORI_POSITION, false);
292 const SfxBoolItem* pHoriMirror =
293 pOutSet->GetItemIfSet(SID_ATTR_TRANSFORM_HORI_MIRROR, false);
294 if(pHoriOrient || pHoriRelation || pHoriPosition || pHoriMirror)
295 {
296 if(pHoriOrient)
297 aHOrientFinal.SetHoriOrient(pHoriOrient->GetValue());
298 if(pHoriRelation)
299 aHOrientFinal.SetRelationOrient(pHoriRelation->GetValue());
300 if(pHoriPosition)
301 aHOrientFinal.SetPos( pHoriPosition->GetValue());
302 if(pHoriMirror)
303 aHOrientFinal.SetPosToggle( pHoriMirror->GetValue());
304 aFrameAttrSet.Put(aHOrientFinal);
305 }
306
307 const SfxInt16Item* pVertOrient =
308 pOutSet->GetItemIfSet(SID_ATTR_TRANSFORM_VERT_ORIENT, false);
309 const SfxInt16Item* pVertRelation =
310 pOutSet->GetItemIfSet(SID_ATTR_TRANSFORM_VERT_RELATION, false);
311 const SfxInt32Item* pVertPosition =
312 pOutSet->GetItemIfSet(SID_ATTR_TRANSFORM_VERT_POSITION, false);
313 if(pVertOrient || pVertRelation || pVertPosition )
314 {
315 if(pVertOrient)
316 aVOrientFinal.SetVertOrient(pVertOrient->GetValue());
317 if(pVertRelation)
318 aVOrientFinal.SetRelationOrient(pVertRelation->GetValue());
319 if(pVertPosition)
320 aVOrientFinal.SetPos( pVertPosition->GetValue());
321 aFrameAttrSet.Put( aVOrientFinal );
322 }
323 const SwFormatFollowTextFlow* pFollowItem =
324 pOutSet->GetItemIfSet(RES_FOLLOW_TEXT_FLOW, false);
325 if(pFollowItem)
326 aFrameAttrSet.Put(*pFollowItem);
327
328 if(aFrameAttrSet.Count())
329 pSh->SetDrawingAttr(aFrameAttrSet);
330
332
333 // #i30451#
335
336 pSh->EndAllAction();
337 }
338
339 if (pSdrView->GetModel().IsChanged())
340 pSh->SetModified();
341 else if (bChanged)
342 pSdrView->GetModel().SetChanged();
343
344 pDlg->disposeOnce();
345 });
346 }
347 }
348 else
349 {
350 pSh->StartAllAction();
351 pSdrView->SetGeoAttrToMarked( *pArgs );
352 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
353 SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
354 if (pObj)
355 {
356 SwFrameFormat* pFrameFormat = FindFrameFormat(pObj);
357 if (pFrameFormat)
358 {
359 const SwFormatAnchor& rAnchor = pFrameFormat->GetAnchor();
360 // Don't change shape position / size, just update the anchor doc model
361 // position.
362 pSh->ChgAnchor(rAnchor.GetAnchorId(), /*bSameOnly=*/true);
363 }
364 }
365 pSh->EndAllAction();
366 }
367 }
368 }
369 break;
370
371 case SID_DELETE:
372 case FN_BACKSPACE:
373 if (pSh->IsObjSelected() && !pSdrView->IsTextEdit())
374 {
375 bDone = true;
376
377 const Point aPt = pSh->GetObjRect().TopLeft(); // tdf#150589
378
379 if( GetView().IsDrawRotate() )
380 {
381 pSh->SetDragMode( SdrDragMode::Move );
383 }
384
385 pSh->SetModified();
386 pSh->DelSelectedObj();
387
388 if (rReq.IsAPI() ||
389 GetView().GetEditWin().IsObjectSelect() )
390 {
391 // If basic call, then back to the text shell, because the
392 // Basic otherwise has no possibility to return.
393 if (GetView().GetDrawFuncPtr())
394 {
396 GetView().SetDrawFuncPtr(nullptr);
397 }
398 GetView().LeaveDrawCreate(); // Switch to selection mode
399 }
400
401 if (pSh->IsSelFrameMode())
402 {
403 pSh->LeaveSelFrameMode();
404 // #105852# FME <- perhaps fixed by tdf#150589
405 static_cast<SwEditShell*>(pSh)->SetCursor(aPt);
406 }
407
408 }
409 break;
410
411 case SID_GROUP:
412 if (pSh->IsObjSelected() > 1 && pSh->IsGroupAllowed())
413 {
414 pSh->GroupSelection();
415 rBind.Invalidate(SID_UNGROUP);
416 }
417 break;
418
419 case SID_UNGROUP:
420 if (pSh->IsGroupSelected(true) && pSh->IsUnGroupAllowed())
421 {
422 pSh->UnGroupSelection();
423 rBind.Invalidate(SID_GROUP);
424 }
425 break;
426
427 case SID_ENTER_GROUP:
428 if (pSh->IsGroupSelected(false))
429 {
430 pSdrView->EnterMarkedGroup();
431 rBind.InvalidateAll(false);
432 }
433 break;
434
435 case SID_LEAVE_GROUP:
436 if (pSdrView->IsGroupEntered())
437 {
438 pSdrView->LeaveOneGroup();
439 rBind.Invalidate(SID_ENTER_GROUP);
440 rBind.Invalidate(SID_UNGROUP);
441 }
442 break;
443
444 case SID_REGENERATE_DIAGRAM:
445 case SID_EDIT_DIAGRAM:
446 {
447 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
448
449 if (1 == rMarkList.GetMarkCount())
450 {
451 SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
452
453 // Support advanced DiagramHelper
454 if(nullptr != pObj && pObj->isDiagram())
455 {
456 if(SID_REGENERATE_DIAGRAM == nSlotId)
457 {
458 pSdrView->UnmarkAll();
459 pObj->getDiagramHelper()->reLayout(*static_cast<SdrObjGroup*>(pObj));
460 pSdrView->MarkObj(pObj, pSdrView->GetSdrPageView());
461 }
462 else // SID_EDIT_DIAGRAM
463 {
467 *static_cast<SdrObjGroup*>(pObj));
468 pDlg->Execute();
469 }
470 }
471 }
472 }
473 break;
474
475 case SID_OBJECT_ALIGN_LEFT:
476 case SID_OBJECT_ALIGN_CENTER:
477 case SID_OBJECT_ALIGN_RIGHT:
478 case SID_OBJECT_ALIGN_UP:
479 case SID_OBJECT_ALIGN_MIDDLE:
480 case SID_OBJECT_ALIGN_DOWN:
481 {
482 if ( bAlignPossible )
483 {
484 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
485 if (rMarkList.GetMarkCount() == 1
487 {
488 sal_Int16 nHorizOrient = -1, nVertOrient = -1;
489
490 switch (nSlotId)
491 {
492 case SID_OBJECT_ALIGN_LEFT:
493 nHorizOrient = text::HoriOrientation::LEFT;
494 break;
495 case SID_OBJECT_ALIGN_CENTER:
496 nHorizOrient = text::HoriOrientation::CENTER;
497 break;
498 case SID_OBJECT_ALIGN_RIGHT:
499 nHorizOrient = text::HoriOrientation::RIGHT;
500 break;
501 case SID_OBJECT_ALIGN_UP:
502 nVertOrient = text::VertOrientation::TOP;
503 break;
504 case SID_OBJECT_ALIGN_MIDDLE:
505 nVertOrient = text::VertOrientation::CENTER;
506 break;
507 case SID_OBJECT_ALIGN_DOWN:
508 nVertOrient = text::VertOrientation::BOTTOM;
509 break;
510 default:
511 break;
512 }
513
514 if (nHorizOrient != -1)
515 {
516 pSh->StartAction();
517 SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
518 SwFrameFormat* pFrameFormat = FindFrameFormat( pObj );
519 SwFormatHoriOrient aHOrient(pFrameFormat->GetFormatAttr(RES_HORI_ORIENT));
520 aHOrient.SetHoriOrient( nHorizOrient );
521 pFrameFormat->SetFormatAttr(aHOrient);
522 pSh->EndAction();
523 }
524
525 if (nVertOrient != -1)
526 {
527 pSh->StartAction();
528 SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
529 SwFrameFormat* pFrameFormat = FindFrameFormat( pObj );
530 SwFormatVertOrient aVOrient(pFrameFormat->GetFormatAttr(RES_VERT_ORIENT));
531 aVOrient.SetVertOrient( nVertOrient );
532 pFrameFormat->SetFormatAttr(aVOrient);
533 pSh->EndAction();
534 }
535
536 break;
537 }
538
539 pSh->StartAction();
540 switch (nSlotId)
541 {
542 case SID_OBJECT_ALIGN_LEFT:
543 pSdrView->AlignMarkedObjects(SdrHorAlign::Left, SdrVertAlign::NONE);
544 break;
545 case SID_OBJECT_ALIGN_CENTER:
546 pSdrView->AlignMarkedObjects(SdrHorAlign::Center, SdrVertAlign::NONE);
547 break;
548 case SID_OBJECT_ALIGN_RIGHT:
549 pSdrView->AlignMarkedObjects(SdrHorAlign::Right, SdrVertAlign::NONE);
550 break;
551 case SID_OBJECT_ALIGN_UP:
552 pSdrView->AlignMarkedObjects(SdrHorAlign::NONE, SdrVertAlign::Top);
553 break;
554 case SID_OBJECT_ALIGN_MIDDLE:
555 pSdrView->AlignMarkedObjects(SdrHorAlign::NONE, SdrVertAlign::Center);
556 break;
557 case SID_OBJECT_ALIGN_DOWN:
558 pSdrView->AlignMarkedObjects(SdrHorAlign::NONE, SdrVertAlign::Bottom);
559 break;
560 }
561 pSh->EndAction();
562 }
563 }
564 break;
565
566 case FN_FRAME_UP:
567 bTopParam = false;
568 [[fallthrough]];
569 case SID_FRAME_TO_TOP:
570 pSh->SelectionToTop( bTopParam );
571 break;
572
573 case FN_FRAME_DOWN:
574 bBottomParam = false;
575 [[fallthrough]];
576 case SID_FRAME_TO_BOTTOM:
577 pSh->SelectionToBottom( bBottomParam );
578 break;
579
580 case FN_NAME_SHAPE:
581 {
582 bDone = true;
583
584 if(1 == pSdrView->GetMarkedObjectCount())
585 {
586 // #i68101#
587 SdrObject* pSelected = pSdrView->GetMarkedObjectByIndex(0);
588 OSL_ENSURE(pSelected, "DrawViewShell::FuTemp03: nMarkCount, but no object (!)");
589 OUString aName(pSelected->GetName());
590
593
594 pDlg->SetCheckNameHdl(LINK(this, SwDrawBaseShell, CheckGroupShapeNameHdl));
595
596 if(RET_OK == pDlg->Execute())
597 {
598 pDlg->GetName(aName);
599 pSelected->SetName(aName);
600 pSh->SetModified();
601 }
602 }
603
604 break;
605 }
606
607 // #i68101#
609 {
610 bDone = true;
611
612 if(1 == pSdrView->GetMarkedObjectCount())
613 {
614 SdrObject* pSelected = pSdrView->GetMarkedObjectByIndex(0);
615 OSL_ENSURE(pSelected, "DrawViewShell::FuTemp03: nMarkCount, but no object (!)");
616 OUString aTitle(pSelected->GetTitle());
617 OUString aDescription(pSelected->GetDescription());
618
621 aTitle, aDescription));
622
623 if(RET_OK == pDlg->Execute())
624 {
625 pDlg->GetTitle(aTitle);
626 pDlg->GetDescription(aDescription);
627
628 pSelected->SetTitle(aTitle);
629 pSelected->SetDescription(aDescription);
630
631 pSh->SetModified();
632 }
633 }
634
635 break;
636 }
637
638 case SID_OPEN_HYPERLINK:
639 {
640 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
641 SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
643 /*rTargetFrameName=*/OUString());
644 break;
645 }
646
647 case SID_EDIT_HYPERLINK:
648 case SID_HYPERLINK_DIALOG:
649 {
650 GetView().GetViewFrame().SetChildWindow(SID_HYPERLINK_DIALOG, true);
651 break;
652 }
653
654 case SID_HYPERLINK_SETLINK:
655 {
656 if(pItem)
657 {
658 const SvxHyperlinkItem& rHLinkItem = *static_cast<const SvxHyperlinkItem *>(pItem);
659 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
660 SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
661 pObj->setHyperlink(rHLinkItem.GetURL());
662 }
663 break;
664 }
665
666 case SID_REMOVE_HYPERLINK:
667 {
668 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
669 SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
670 pObj->setHyperlink(OUString());
671 break;
672 }
673
674 case SID_COPY_HYPERLINK_LOCATION:
675 {
676 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
677 SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
678 uno::Reference<datatransfer::clipboard::XClipboard> xClipboard
681 break;
682 }
683
684 default:
685 OSL_ENSURE(false, "wrong Dispatcher");
686 return;
687 }
688 if(!bDone)
689 {
690 if(nSlotId >= SID_OBJECT_ALIGN_LEFT && nSlotId <= SID_OBJECT_ALIGN_DOWN)
691 rBind.Invalidate(SID_ATTR_LONG_LRSPACE);
692 if (pSdrView->GetModel().IsChanged())
693 pSh->SetModified();
694 else if (bChanged)
695 pSdrView->GetModel().SetChanged();
696 }
697}
698
699// Checks whether a given name is allowed for a group shape
700
701IMPL_LINK( SwDrawBaseShell, CheckGroupShapeNameHdl, AbstractSvxObjectNameDialog&, rNameDialog, bool )
702{
703 SwWrtShell &rSh = GetShell();
704 SdrView *pSdrView = rSh.GetDrawView();
705 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
706 OSL_ENSURE(rMarkList.GetMarkCount() == 1, "wrong draw selection");
707 SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
708 const OUString sCurrentName = pObj->GetName();
709 OUString sNewName;
710 rNameDialog.GetName(sNewName);
711 bool bRet = false;
712 if (sNewName.isEmpty() || sCurrentName == sNewName)
713 bRet = true;
714 else
715 {
716 bRet = true;
718 SdrObjListIter aIter( pModel->GetPage(0), SdrIterMode::DeepWithGroups );
719 while( aIter.IsMore() )
720 {
721 SdrObject* pTempObj = aIter.Next();
722 if ( pObj != pTempObj && pTempObj->GetName() == sNewName )
723 {
724 bRet = false;
725 break;
726 }
727 }
728 }
729 return bRet;
730}
731
733{
734 SwWrtShell &rSh = GetShell();
735 SdrView* pSdrView = rSh.GetDrawViewWithValidMarkList();
736 SfxWhichIter aIter( rSet );
737 sal_uInt16 nWhich = aIter.FirstWhich();
739
740 if (!bProtected) // Look in the parent
742
743 while( nWhich )
744 {
745 switch( nWhich )
746 {
747 case FN_DRAW_WRAP_DLG:
748 case SID_ATTR_TRANSFORM:
749 case SID_FRAME_TO_TOP:
750 case SID_FRAME_TO_BOTTOM:
751 case FN_FRAME_UP:
752 case FN_FRAME_DOWN:
753 case SID_DELETE:
754 case FN_BACKSPACE:
755 if( bProtected || !rSh.IsObjSelected() )
756 rSet.DisableItem( nWhich );
757 break;
758 case SID_GROUP:
759 if ( rSh.IsObjSelected() < 2 || bProtected || !rSh.IsGroupAllowed() )
760 rSet.DisableItem( nWhich );
761 break;
762 case SID_UNGROUP:
763 if ( !rSh.IsGroupSelected(true) || bProtected || !rSh.IsUnGroupAllowed() )
764 rSet.DisableItem( nWhich );
765 break;
766 case SID_ENTER_GROUP:
767 if ( !rSh.IsGroupSelected(false) )
768 rSet.DisableItem( nWhich );
769 break;
770 case SID_LEAVE_GROUP:
771 if ( !pSdrView->IsGroupEntered() )
772 rSet.DisableItem( nWhich );
773 break;
774 case SID_OBJECT_ALIGN_LEFT:
775 case SID_OBJECT_ALIGN_CENTER:
776 case SID_OBJECT_ALIGN_RIGHT:
777 case SID_OBJECT_ALIGN_UP:
778 case SID_OBJECT_ALIGN_MIDDLE:
779 case SID_OBJECT_ALIGN_DOWN:
780 case SID_OBJECT_ALIGN:
781 {
782 bool bDisableThis = false;
783 bool bDisableHoriz = false;
784 bool bHoriz = (nWhich == SID_OBJECT_ALIGN_LEFT || nWhich == SID_OBJECT_ALIGN_CENTER ||
785 nWhich == SID_OBJECT_ALIGN_RIGHT);
786 bool bVert = (nWhich == SID_OBJECT_ALIGN_UP || nWhich == SID_OBJECT_ALIGN_MIDDLE ||
787 nWhich == SID_OBJECT_ALIGN_DOWN);
788 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
789 if ( !rSh.IsAlignPossible() || bProtected )
790 {
791 bDisableThis = true;
792 rSet.DisableItem( nWhich );
793 }
794 else if ( rSh.GetAnchorId() == RndStdIds::FLY_AS_CHAR )
795 {
796 //if only one object is selected it can only be vertically
797 // aligned because it is character bound
798 if( rMarkList.GetMarkCount() == 1 )
799 {
800 bDisableHoriz = true;
801 rSet.DisableItem(SID_OBJECT_ALIGN_LEFT);
802 rSet.DisableItem(SID_OBJECT_ALIGN_CENTER);
803 rSet.DisableItem(SID_OBJECT_ALIGN_RIGHT);
804 }
805 }
806
807 if (bHoriz && !bDisableThis && !bDisableHoriz &&
808 rMarkList.GetMarkCount() == 1)
809 {
810 sal_Int16 nHoriOrient = -1;
811 switch(nWhich)
812 {
813 case SID_OBJECT_ALIGN_LEFT:
814 nHoriOrient = text::HoriOrientation::LEFT;
815 break;
816 case SID_OBJECT_ALIGN_CENTER:
817 nHoriOrient = text::HoriOrientation::CENTER;
818 break;
819 case SID_OBJECT_ALIGN_RIGHT:
820 nHoriOrient = text::HoriOrientation::RIGHT;
821 break;
822 default:
823 break;
824 }
825
826 SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
827 SwFrameFormat* pFrameFormat = FindFrameFormat(pObj);
828 SwFormatHoriOrient aHOrient(pFrameFormat->GetFormatAttr(RES_HORI_ORIENT));
829 rSet.Put(SfxBoolItem(nWhich, aHOrient.GetHoriOrient() == nHoriOrient));
830 }
831
832 if (bVert && !bDisableThis && rMarkList.GetMarkCount() == 1)
833 {
834 sal_Int16 nVertOrient = -1;
835 switch(nWhich)
836 {
837 case SID_OBJECT_ALIGN_UP:
838 nVertOrient = text::VertOrientation::TOP;
839 break;
840 case SID_OBJECT_ALIGN_MIDDLE:
841 nVertOrient = text::VertOrientation::CENTER;
842 break;
843 case SID_OBJECT_ALIGN_DOWN:
844 nVertOrient = text::VertOrientation::BOTTOM;
845 break;
846 default:
847 break;
848 }
849
850 SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
851 SwFrameFormat* pFrameFormat = FindFrameFormat(pObj);
852 SwFormatVertOrient aVOrient(pFrameFormat->GetFormatAttr(RES_VERT_ORIENT));
853 rSet.Put(SfxBoolItem(nWhich, aVOrient.GetVertOrient() == nVertOrient));
854 }
855 }
856 break;
857
858 case FN_NAME_SHAPE :
859 {
860 if(1 != pSdrView->GetMarkedObjectCount())
861 {
862 rSet.DisableItem( nWhich );
863 }
864 }
865 break;
866
867 // #i68101#
869 {
870 const bool bIsWebView(nullptr != dynamic_cast<SwWebView*>(&GetView()));
871
872 if(!bIsWebView && 1 != pSdrView->GetMarkedObjectCount())
873 {
874 rSet.DisableItem( nWhich );
875 }
876 }
877 break;
878
879 case SID_OPEN_HYPERLINK:
880 case SID_EDIT_HYPERLINK:
881 case SID_HYPERLINK_DIALOG:
882 case SID_REMOVE_HYPERLINK:
883 case SID_COPY_HYPERLINK_LOCATION:
884 {
885 if (pSdrView->GetMarkedObjectCount() != 1)
886 {
887 rSet.DisableItem(nWhich);
888 break;
889 }
890
891 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
892 SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
893 SdrObjKind nObjType = pObj->GetObjIdentifier();
894
895 // Only enable hyperlink for the following types
896 switch (nObjType)
897 {
898 case SdrObjKind::PathFill:
899 case SdrObjKind::CircleSection:
900 case SdrObjKind::Line:
901 case SdrObjKind::CustomShape:
902 case SdrObjKind::Text:
903 case SdrObjKind::Rectangle:
904 case SdrObjKind::Caption:
905 case SdrObjKind::Polygon:
906 case SdrObjKind::PolyLine:
907 case SdrObjKind::E3D_Scene:
908 case SdrObjKind::Measure:
909 case SdrObjKind::Edge:
910 break;
911 default:
912 rSet.DisableItem(nWhich);
913 break;
914 }
915
916 if (nWhich == SID_OPEN_HYPERLINK || nWhich == SID_REMOVE_HYPERLINK
917 || nWhich == SID_EDIT_HYPERLINK || nWhich == SID_COPY_HYPERLINK_LOCATION)
918 {
919 if (pObj->getHyperlink().isEmpty())
920 rSet.DisableItem(nWhich);
921 }
922 }
923 break;
924
925 case SID_HYPERLINK_GETLINK:
926 {
927 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
928 if (rMarkList.GetMark(0) != nullptr)
929 {
930 SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
931 OUString sHyperLink = pObj->getHyperlink();
932 SvxHyperlinkItem aHLinkItem;
933 aHLinkItem.SetURL(sHyperLink);
934 rSet.Put(aHLinkItem);
935 }
936 }
937 break;
938
939 case SID_REGENERATE_DIAGRAM:
940 case SID_EDIT_DIAGRAM:
941 {
942 bool bDisable(true);
943 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
944 if (nullptr != rMarkList.GetMark(0))
945 {
946 SdrObject* pObj(rMarkList.GetMark(0)->GetMarkedSdrObj());
947
948 if(nullptr != pObj && pObj->isDiagram())
949 {
950 bDisable = false;
951 }
952 }
953
954 if(bDisable)
955 {
956 rSet.DisableItem(nWhich);
957 }
958 }
959 break;
960
961
962 }
963 nWhich = aIter.NextWhich();
964 }
965}
966
968{
969 SwWrtShell *pSh = &GetShell();
970 SdrView* pSdrView = pSh->GetDrawView();
971 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
972 if( rMarkList.GetMark(0) != nullptr )
973 {
974 SfxItemSet aNewAttr(pSdrView->GetGeoAttrFromMarked());
975 rSet.Put(aNewAttr,false);
976 }
977}
978
979bool SwDrawBaseShell::Disable(SfxItemSet& rSet, sal_uInt16 nWhich)
980{
982
983 if (bDisable)
984 {
985 if (nWhich)
986 rSet.DisableItem( nWhich );
987 else
988 {
989 SfxWhichIter aIter( rSet );
990 nWhich = aIter.FirstWhich();
991 while (nWhich)
992 {
993 rSet.DisableItem( nWhich );
994 nWhich = aIter.NextWhich();
995 }
996 }
997 }
998
999 return bDisable;
1000}
1001
1003{
1004 SwWrtShell *pSh = &GetShell();
1005 SdrView* pSdrView = pSh->GetDrawView();
1006 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
1007 const size_t nMarkCount = rMarkList.GetMarkCount();
1008 bool bShowArea = true, bShowMeasure = true;
1009
1010 for (size_t i = 0; i < nMarkCount && i < 50; ++i)
1011 {
1012 SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
1013 SdrObjKind nObjType = pObj->GetObjIdentifier();
1014
1015 if ( nObjType != SdrObjKind::Measure )
1016 bShowMeasure = false;
1017
1018 // If marked object is 2D, disable format area command.
1019 if ( nObjType == SdrObjKind::PolyLine ||
1020 nObjType == SdrObjKind::Line ||
1021 nObjType == SdrObjKind::PathLine ||
1022 nObjType == SdrObjKind::FreehandLine ||
1023 nObjType == SdrObjKind::Edge ||
1024 nObjType == SdrObjKind::CircleArc ||
1025 bShowMeasure )
1026 bShowArea = false;
1027
1028 if (!bShowArea && !bShowMeasure)
1029 break;
1030 }
1031
1032 if (!bShowArea)
1033 rSet.DisableItem(SID_ATTRIBUTES_AREA);
1034
1035 if (!bShowMeasure)
1036 rSet.DisableItem(SID_MEASURE_DLG);
1037
1038 Disable(rSet);
1039
1040}
1041
1042// Validate of drawing positions
1043
1044IMPL_LINK(SwDrawBaseShell, ValidatePosition, SvxSwFrameValidation&, rValidation, void )
1045{
1046 SwWrtShell *pSh = &GetShell();
1047 rValidation.nMinHeight = MINFLY;
1048 rValidation.nMinWidth = MINFLY;
1049
1050 SwRect aBoundRect;
1051
1052 // OD 18.09.2003 #i18732# - adjustment for allowing vertical position
1053 // aligned to page for fly frame anchored to paragraph or to character.
1054 const RndStdIds eAnchorType = rValidation.nAnchorType;
1055 const SwFormatAnchor* pAnchor = nullptr;
1056 SdrView* pSdrView = pSh->GetDrawView();
1057 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
1058 if( rMarkList.GetMarkCount() == 1 )
1059 {
1060 SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
1061 SwFrameFormat* pFrameFormat = FindFrameFormat( pObj );
1062 pAnchor = &pFrameFormat->GetAnchor();
1063 }
1064
1065 pSh->CalcBoundRect( aBoundRect, eAnchorType,
1066 rValidation.nHRelOrient,
1067 rValidation.nVRelOrient,
1068 pAnchor,
1069 rValidation.bFollowTextFlow,
1070 rValidation.bMirror, nullptr, &rValidation.aPercentSize);
1071
1072 bool bIsInVertical( false );
1073 {
1074 bool bRTL;
1075 bool bVertL2R;
1076 bIsInVertical = pSh->IsFrameVertical(true, bRTL, bVertL2R);
1077 }
1078 if(bIsInVertical)
1079 {
1080 Point aPos(aBoundRect.Pos());
1081 tools::Long nTmp = aPos.X();
1082 aPos.setX( aPos.Y() );
1083 aPos.setY( nTmp );
1084 Size aSize(aBoundRect.SSize());
1085 nTmp = aSize.Width();
1086 aSize.setWidth( aSize.Height() );
1087 aSize.setHeight( nTmp );
1088 aBoundRect.Chg( aPos, aSize );
1089 //exchange width/height to enable correct values
1090 nTmp = rValidation.nWidth;
1091 rValidation.nWidth = rValidation.nHeight;
1092 rValidation.nHeight = nTmp;
1093 }
1094 if ((eAnchorType == RndStdIds::FLY_AT_PAGE) || (eAnchorType == RndStdIds::FLY_AT_FLY))
1095 {
1096 // MinimalPosition
1097 rValidation.nMinHPos = aBoundRect.Left();
1098 rValidation.nMinVPos = aBoundRect.Top();
1099 SwTwips nH = rValidation.nHPos;
1100 SwTwips nV = rValidation.nVPos;
1101
1102 if (rValidation.nHPos + rValidation.nWidth > aBoundRect.Right())
1103 {
1104 if (rValidation.nHoriOrient == text::HoriOrientation::NONE)
1105 {
1106 rValidation.nHPos -= ((rValidation.nHPos + rValidation.nWidth) - aBoundRect.Right());
1107 nH = rValidation.nHPos;
1108 }
1109 else
1110 rValidation.nWidth = aBoundRect.Right() - rValidation.nHPos;
1111 }
1112
1113 if (rValidation.nHPos + rValidation.nWidth > aBoundRect.Right())
1114 rValidation.nWidth = aBoundRect.Right() - rValidation.nHPos;
1115
1116 if (rValidation.nVPos + rValidation.nHeight > aBoundRect.Bottom())
1117 {
1118 if (rValidation.nVertOrient == text::VertOrientation::NONE)
1119 {
1120 rValidation.nVPos -= ((rValidation.nVPos + rValidation.nHeight) - aBoundRect.Bottom());
1121 nV = rValidation.nVPos;
1122 }
1123 else
1124 rValidation.nHeight = aBoundRect.Bottom() - rValidation.nVPos;
1125 }
1126
1127 if (rValidation.nVPos + rValidation.nHeight > aBoundRect.Bottom())
1128 rValidation.nHeight = aBoundRect.Bottom() - rValidation.nVPos;
1129
1130 if ( rValidation.nVertOrient != text::VertOrientation::NONE )
1131 nV = aBoundRect.Top();
1132
1133 if ( rValidation.nHoriOrient != text::HoriOrientation::NONE )
1134 nH = aBoundRect.Left();
1135
1136 rValidation.nMaxHPos = aBoundRect.Right() - rValidation.nWidth;
1137 rValidation.nMaxHeight = aBoundRect.Bottom() - nV;
1138
1139 rValidation.nMaxVPos = aBoundRect.Bottom() - rValidation.nHeight;
1140 rValidation.nMaxWidth = aBoundRect.Right() - nH;
1141 }
1142 else if ((eAnchorType == RndStdIds::FLY_AT_PARA) || (eAnchorType == RndStdIds::FLY_AT_CHAR))
1143 {
1144 if (rValidation.nHPos + rValidation.nWidth > aBoundRect.Right())
1145 {
1146 if (rValidation.nHoriOrient == text::HoriOrientation::NONE)
1147 {
1148 rValidation.nHPos -= ((rValidation.nHPos + rValidation.nWidth) - aBoundRect.Right());
1149 }
1150 else
1151 rValidation.nWidth = aBoundRect.Right() - rValidation.nHPos;
1152 }
1153
1154 // OD 29.09.2003 #i17567#, #i18732# - consider following the text flow
1155 // and alignment at page areas.
1156 const bool bMaxVPosAtBottom = !rValidation.bFollowTextFlow ||
1157 rValidation.nVRelOrient == text::RelOrientation::PAGE_FRAME ||
1158 rValidation.nVRelOrient == text::RelOrientation::PAGE_PRINT_AREA ||
1159 rValidation.nVRelOrient == text::RelOrientation::PAGE_PRINT_AREA_BOTTOM;
1160 {
1161 SwTwips nTmpMaxVPos = ( bMaxVPosAtBottom
1162 ? aBoundRect.Bottom()
1163 : aBoundRect.Height() ) -
1164 rValidation.nHeight;
1165 if ( rValidation.nVPos > nTmpMaxVPos )
1166 {
1167 if (rValidation.nVertOrient == text::VertOrientation::NONE)
1168 {
1169 rValidation.nVPos = nTmpMaxVPos;
1170 }
1171 else
1172 {
1173 rValidation.nHeight = ( bMaxVPosAtBottom
1174 ? aBoundRect.Bottom()
1175 : aBoundRect.Height() ) - rValidation.nVPos;
1176 }
1177 }
1178 }
1179
1180 rValidation.nMinHPos = aBoundRect.Left();
1181 rValidation.nMaxHPos = aBoundRect.Right() - rValidation.nWidth;
1182
1183 rValidation.nMinVPos = aBoundRect.Top();
1184 // OD 26.09.2003 #i17567#, #i18732# - determine maximum vertical position
1185 if ( bMaxVPosAtBottom )
1186 {
1187 rValidation.nMaxVPos = aBoundRect.Bottom() - rValidation.nHeight;
1188 }
1189 else
1190 {
1191 rValidation.nMaxVPos = aBoundRect.Height() - rValidation.nHeight;
1192 }
1193
1194 // Maximum width height
1195 const SwTwips nH = ( rValidation.nHoriOrient != text::HoriOrientation::NONE )
1196 ? aBoundRect.Left()
1197 : rValidation.nHPos;
1198 const SwTwips nV = ( rValidation.nVertOrient != text::VertOrientation::NONE )
1199 ? aBoundRect.Top()
1200 : rValidation.nVPos;
1201 rValidation.nMaxHeight = rValidation.nMaxVPos + rValidation.nHeight - nV;
1202 rValidation.nMaxWidth = rValidation.nMaxHPos + rValidation.nWidth - nH;
1203 }
1204 else if (eAnchorType == RndStdIds::FLY_AS_CHAR)
1205 {
1206 rValidation.nMinHPos = 0;
1207 rValidation.nMaxHPos = 0;
1208
1209 rValidation.nMaxHeight = aBoundRect.Height();
1210 rValidation.nMaxWidth = aBoundRect.Width();
1211
1212 rValidation.nMaxVPos = aBoundRect.Height();
1213 rValidation.nMinVPos = -aBoundRect.Height() + rValidation.nHeight;
1214 if (rValidation.nMaxVPos < rValidation.nMinVPos)
1215 {
1216 rValidation.nMinVPos = rValidation.nMaxVPos;
1217 rValidation.nMaxVPos = -aBoundRect.Height();
1218 }
1219 }
1220 if(bIsInVertical)
1221 {
1222 //restore width/height exchange
1223 tools::Long nTmp = rValidation.nWidth;
1224 rValidation.nWidth = rValidation.nHeight;
1225 rValidation.nHeight = nTmp;
1226 }
1227
1228 if (rValidation.nMaxWidth < rValidation.nWidth)
1229 rValidation.nWidth = rValidation.nMaxWidth;
1230 if (rValidation.nMaxHeight < rValidation.nHeight)
1231 rValidation.nHeight = rValidation.nMaxHeight;
1232}
1233
1234/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SvxAnchorIds
sal_Int32 GetValue() const
virtual const SwDrawModel * GetDrawModel() const =0
Draw Model and id accessors.
void SetGeoAttrToMarked(const SfxItemSet &rAttr, bool addPageMargin=false)
void AlignMarkedObjects(SdrHorAlign eHor, SdrVertAlign eVert)
SfxItemSet GetGeoAttrFromMarked() const
size_t GetMarkCount() const
SdrMark * GetMark(size_t nNum) const
const SdrMarkList & GetMarkedObjectList() const
bool AreObjectsMarked() const
SdrObject * GetMarkedObjectByIndex(size_t nNum) const
size_t GetMarkedObjectCount() const
void EnterMarkedGroup()
bool MarkObj(const Point &rPnt, short nTol=-2, bool bToggle=false, bool bDeep=false)
SdrObject * GetMarkedSdrObj() const
virtual void SetChanged(bool bFlg=true)
bool IsChanged() const
const SdrPage * GetPage(sal_uInt16 nPgNum) const
virtual bool IsTextEdit() const final override
SdrObject * Next()
bool IsMore() const
const OUString & getHyperlink() const
virtual OUString GetTitle() const
virtual void SetTitle(const OUString &rStr)
bool isDiagram() const
virtual const std::shared_ptr< svx::diagram::IDiagramHelper > & getDiagramHelper() const
virtual void SetDescription(const OUString &rStr)
virtual OUString GetDescription() const
virtual const OUString & GetName() const
virtual SdrObjKind GetObjIdentifier() const
virtual void SetName(const OUString &rStr, const bool bSetChanged=true)
void setHyperlink(const OUString &sHyperlink)
bool IsGroupEntered() const
void LeaveOneGroup()
SdrPageView * GetSdrPageView() const
SdrModel & GetModel() const
bool SetAttributes(const SfxItemSet &rSet, bool bReplaceAll=false)
void UnmarkAll()
void GetAttributes(SfxItemSet &rTargetSet, bool bOnlyHardAttr=false) const
void Invalidate(sal_uInt16 nId)
void InvalidateAll(bool bWithMsg)
bool GetValue() const
sal_Int16 GetValue() const
SfxItemPool * GetPool() const
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
void DisableItem(sal_uInt16 nWhich)
sal_uInt16 GetSlot() const
const SfxItemSet * GetArgs() const
weld::Window * GetFrameWeld() const
bool IsAPI() const
SfxItemPool & GetPool() const
SfxBindings & GetBindings()
void SetChildWindow(sal_uInt16 nId, bool bVisible, bool bSetFocus=true)
SfxViewFrame & GetViewFrame() const
sal_uInt16 FirstWhich()
sal_uInt16 NextWhich()
constexpr tools::Long Height() const
void setWidth(tools::Long nWidth)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
virtual VclPtr< AbstractSvxTransformTabDialog > CreateSvxTransformTabDialog(weld::Window *pParent, const SfxItemSet *pAttr, const SdrView *pView, SvxAnchorIds nAnchorTypes=SvxAnchorIds::NONE)=0
virtual VclPtr< AbstractSvxObjectTitleDescDialog > CreateSvxObjectTitleDescDialog(weld::Window *pParent, const OUString &rTitle, const OUString &rDescription)=0
virtual VclPtr< AbstractSvxCaptionDialog > CreateCaptionDialog(weld::Window *pParent, const SdrView *pView, SvxAnchorIds nAnchorTypes=SvxAnchorIds::NONE)=0
virtual VclPtr< AbstractSvxObjectNameDialog > CreateSvxObjectNameDialog(weld::Window *pParent, const OUString &rName)=0
static SvxAbstractDialogFactory * Create()
const OUString & GetURL() const
void SetURL(const OUString &rURL)
virtual VclPtr< SfxAbstractDialog > CreateSwWrapDlg(weld::Window *pParent, SfxItemSet &rSet, SwWrtShell *pSh)=0
static SwAbstractDialogFactory * Create()
Definition: swabstdlg.cxx:36
SwWrtShell & GetShell()
Definition: basesh.cxx:2997
SwView & GetView()
Definition: basesh.hxx:59
void StartAction()
Definition: crsrsh.cxx:226
void EndAction(const bool bIdleEnd=false)
Definition: crsrsh.cxx:243
void GetState(SfxItemSet &)
Definition: drwbassh.cxx:732
void Execute(SfxRequest const &)
Definition: drwbassh.cxx:98
SwDrawBaseShell(SwView &rShell)
Definition: drwbassh.cxx:76
void DisableState(SfxItemSet &rSet)
Definition: drwbassh.cxx:1002
bool Disable(SfxItemSet &rSet, sal_uInt16 nWhich=0)
Definition: drwbassh.cxx:979
void GetDrawAttrStateForIFBX(SfxItemSet &rSet)
Definition: drwbassh.cxx:967
virtual ~SwDrawBaseShell() override
Definition: drwbassh.cxx:91
virtual void Deactivate()
Definition: drawbase.cxx:444
void StartAllAction()
For all views of this document.
Definition: edws.cxx:86
SwUndoId StartUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Undo: set up Undo parenthesis, return nUndoId of this parenthesis.
Definition: edws.cxx:223
void SetModified()
Definition: edws.cxx:70
SwUndoId EndUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Closes parenthesis of nUndoId, not used by UI.
Definition: edws.cxx:234
void EndAllAction()
Definition: edws.cxx:97
Window class for the Writer edit area, this is the one handling mouse and keyboard events and doing t...
Definition: edtwin.hxx:61
void StdDrawMode(SdrObjKind eSdrObjectKind, bool bObjSelect)
Definition: edtwin.cxx:734
void SetBezierMode(sal_uInt16 eBezMode)
Definition: edtwin.hxx:221
void SelectionToHell()
Below document.
Definition: feshview.cxx:1279
void SetObjAttr(const SfxItemSet &rSet)
Definition: feshview.cxx:2831
FlyProtectFlags IsSelObjProtected(FlyProtectFlags eType) const
Which Protection is set at selected object?
Definition: feshview.cxx:2740
RndStdIds GetAnchorId() const
Anchor type of selected object, RndStdIds::UNKNOWN if ambiguous or in case of frame selection.
Definition: feshview.cxx:2368
void SelectionToHeaven()
Above document.
Definition: feshview.cxx:1274
void GroupSelection()
Afterwards the group is selected.
Definition: feshview.cxx:2609
bool SetDrawingAttr(SfxItemSet &rSet)
Definition: fefly1.cxx:1147
bool IsFrameVertical(const bool bEnvironment, bool &bRightToLeft, bool &bVertL2R) const
Determines whether a frame or its environment is vertically formatted and right-to-left.
Definition: fews.cxx:1270
void SelectionToTop(bool bTop=true)
Move selection upwards or downwards (Z-Order).
Definition: feshview.cxx:1087
void SelectionToBottom(bool bBottom=true)
Definition: feshview.cxx:1156
void ChgAnchor(RndStdIds eAnchorId, bool bSameOnly=false, bool bPosCorr=true)
frmatr.hxx.
Definition: feshview.cxx:2398
void DelSelectedObj()
Definition: feshview.cxx:2416
bool GetObjAttr(SfxItemSet &rSet) const
Attention: Ambiguities if multiple selections.
Definition: feshview.cxx:2808
bool IsGroupSelected(bool bAllowDiagams)
Create and destroy group, don't when frame is selected.
Definition: feshview.cxx:2477
void SetDragMode(SdrDragMode eSdrDragMode)
Set DragMode (e.g. Rotate), but do nothing when frame is selected.
Definition: feshview.cxx:706
SdrLayerID GetLayerId() const
1 Heaven, 0 Hell, SDRLAYER_NOTFOUND Ambiguous.
Definition: feshview.cxx:1208
SwRect GetObjRect() const
For adjustment of PosAttr when anchor changes.
Definition: fefly1.cxx:1298
bool IsUnGroupAllowed() const
Definition: feshview.cxx:2592
size_t IsObjSelected() const
Definition: feshview.cxx:1284
void CalcBoundRect(SwRect &_orRect, const RndStdIds _nAnchorId, const sal_Int16 _eHoriRelOrient=css::text::RelOrientation::FRAME, const sal_Int16 _eVertRelOrient=css::text::RelOrientation::FRAME, const SwFormatAnchor *_pToCharContentPos=nullptr, const bool _bFollowTextFlow=false, bool _bMirror=false, Point *_opRef=nullptr, Size *_opPercent=nullptr, const SwFormatFrameSize *pFormatFrameSize=nullptr) const
i#17567 - adjustments to allow negative vertical positions for fly frames anchored to paragraph or to...
Definition: fews.cxx:690
void UnGroupSelection()
The individual objects are selected, but it is possible that there are groups included.
Definition: feshview.cxx:2624
bool IsAlignPossible() const
Definition: feshview.cxx:2857
bool IsGroupAllowed() const
Definition: feshview.cxx:2532
const SwFrameFormat * IsFlyInFly()
Is selected frame within another frame?
Definition: fefly1.cxx:312
FlyAnchors.
Definition: fmtanchr.hxx:37
RndStdIds GetAnchorId() const
Definition: fmtanchr.hxx:67
void SetType(RndStdIds nRndId)
Definition: fmtanchr.hxx:68
Defines the horizontal position of a fly frame.
Definition: fmtornt.hxx:73
void SetPos(SwTwips nNew)
Definition: fmtornt.hxx:100
void SetPosToggle(bool bNew)
Definition: fmtornt.hxx:103
void SetHoriOrient(sal_Int16 eNew)
Definition: fmtornt.hxx:96
sal_Int16 GetHoriOrient() const
Definition: fmtornt.hxx:94
void SetRelationOrient(sal_Int16 eNew)
Definition: fmtornt.hxx:97
SwTwips GetPos() const
Definition: fmtornt.hxx:99
bool IsPosToggle() const
Definition: fmtornt.hxx:102
sal_Int16 GetRelationOrient() const
Definition: fmtornt.hxx:95
Defines the vertical position of a fly frame.
Definition: fmtornt.hxx:37
sal_Int16 GetRelationOrient() const
Definition: fmtornt.hxx:58
SwTwips GetPos() const
Definition: fmtornt.hxx:62
void SetVertOrient(sal_Int16 eNew)
Definition: fmtornt.hxx:59
void SetPos(SwTwips nNew)
Definition: fmtornt.hxx:63
void SetRelationOrient(sal_Int16 eNew)
Definition: fmtornt.hxx:60
sal_Int16 GetVertOrient() const
Definition: fmtornt.hxx:57
const SwFormatAnchor & GetAnchor(bool=true) const
Definition: fmtanchr.hxx:88
const SfxPoolItem & GetFormatAttr(sal_uInt16 nWhich, bool bInParents=true) const
If bInParents is FALSE, search only in this format for attribute.
Definition: format.cxx:366
virtual bool SetFormatAttr(const SfxPoolItem &rAttr)
Definition: format.cxx:447
Style of a layout element.
Definition: frmfmt.hxx:72
Of course Writer needs its own rectangles.
Definition: swrect.hxx:35
void Chg(const Point &rNP, const Size &rNS)
Definition: swrect.hxx:166
void Height(tools::Long nNew)
Definition: swrect.hxx:193
Point TopLeft() const
Definition: swrect.hxx:254
void Top(const tools::Long nTop)
Definition: swrect.hxx:206
void Right(const tools::Long nRight)
Definition: swrect.hxx:202
void Bottom(const tools::Long nBottom)
Definition: swrect.hxx:211
void Pos(const Point &rNew)
Definition: swrect.hxx:171
void SSize(const Size &rNew)
Definition: swrect.hxx:180
void Left(const tools::Long nLeft)
Definition: swrect.hxx:197
void Width(tools::Long nNew)
Definition: swrect.hxx:189
static bool hasTextFrame(const SdrObject *pObj)
Returns true if the SdrObject has a SwTextFrame otherwise false.
static void ClearSelection(const SwWrtShell &rSh, const SwFrameShell *pCreator=nullptr)
Definition: swdtflvr.cxx:4377
static void CreateSelection(SwWrtShell &rSh, const SwFrameShell *pCreator=nullptr)
Definition: swdtflvr.cxx:4365
SdrView * GetDrawViewWithValidMarkList()
Definition: vnew.cxx:376
const IDocumentDrawModelAccess & getIDocumentDrawModelAccess() const
Provides access to the document draw model interface.
Definition: viewsh.cxx:2807
SdrView * GetDrawView()
Definition: vnew.cxx:371
Definition: view.hxx:146
void FlipDrawRotate()
Definition: view.hxx:541
SwDrawBase * GetDrawFuncPtr() const
Definition: view.hxx:537
SwEditWin & GetEditWin()
Definition: view.hxx:426
void SetDrawFuncPtr(std::unique_ptr< SwDrawBase > pFuncPtr)
Definition: viewdraw.cxx:641
void ExitDraw()
Definition: viewdraw.cxx:389
SwDocShell * GetDocShell()
Definition: view.cxx:1180
void LeaveDrawCreate()
Definition: view.hxx:549
Used by the UI to modify the document model.
Definition: wrtsh.hxx:97
bool IsSelFrameMode() const
Definition: wrtsh.hxx:177
void LeaveSelFrameMode()
Definition: select.cxx:729
void NoEdit(bool bHideCursor=true)
Definition: wrtsh1.cxx:182
void Edit()
Definition: wrtsh1.cxx:188
const SwView & GetView() const
Definition: wrtsh.hxx:443
virtual VclPtr< AbstractDiagramDialog > CreateDiagramDialog(weld::Window *pParent, SdrObjGroup &rDiagram)=0
static VclAbstractDialogFactory * Create()
void reset(reference_type *pBody)
css::uno::Reference< css::datatransfer::clipboard::XClipboard > GetClipboard()
static void CopyStringTo(const OUString &rContent, const css::uno::Reference< css::datatransfer::clipboard::XClipboard > &rxClipboard, const vcl::ILibreOfficeKitNotifier *pNotifier=nullptr)
#define FN_FRAME_UP
Definition: cmdid.h:401
#define FN_BACKSPACE
Definition: cmdid.h:698
#define FN_FRAME_DOWN
Definition: cmdid.h:402
#define FN_TITLE_DESCRIPTION_SHAPE
Definition: cmdid.h:475
#define FN_DRAW_WRAP_DLG
Definition: cmdid.h:155
#define FN_NAME_SHAPE
Definition: cmdid.h:473
SwFrameFormat * FindFrameFormat(SdrObject *pObj)
The Get reverse way: seeks the format to the specified object.
Definition: dcontact.cxx:121
weld::Window * GetFrameWeld(const SfxFrame *pFrame)
Definition: dialoghelp.cxx:19
SFX_IMPL_SUPERCLASS_INTERFACE(DrawDocShell, SfxObjectShell)
IMPL_LINK(SwDrawBaseShell, CheckGroupShapeNameHdl, AbstractSvxObjectNameDialog &, rNameDialog, bool)
Definition: drwbassh.cxx:701
@ Parent
Check only parents.
FieldUnit
constexpr sal_uInt16 RES_FRMATR_BEGIN(RES_PARATR_LIST_END)
constexpr TypedWhichId< SwFormatHoriOrient > RES_HORI_ORIENT(109)
constexpr TypedWhichId< SwFormatVertOrient > RES_VERT_ORIENT(108)
constexpr sal_uInt16 RES_FRMATR_END(141)
constexpr TypedWhichId< SwFormatWrapInfluenceOnObjPos > RES_WRAP_INFLUENCE_ON_OBJPOS(132)
constexpr TypedWhichId< SwFormatAnchor > RES_ANCHOR(110)
constexpr TypedWhichId< SwFormatSurround > RES_SURROUND(107)
constexpr TypedWhichId< SwFormatFollowTextFlow > RES_FOLLOW_TEXT_FLOW(130)
constexpr TypedWhichId< SvxLRSpaceItem > RES_LR_SPACE(97)
constexpr TypedWhichId< SvxULSpaceItem > RES_UL_SPACE(98)
OUString aName
if(aStr !=aBuf) UpdateName_Impl(m_xFollowLb.get()
Shell * GetShell()
int i
long Long
const char GetValue[]
static SfxItemSet & rSet
UNDERLYING_TYPE get() const
SdrObjKind
RndStdIds
#define SW_MOD()
Definition: swmodule.hxx:256
tools::Long SwTwips
Definition: swtypes.hxx:51
#define MINFLY
Definition: swtypes.hxx:61
SW_DLLPUBLIC FieldUnit GetDfltMetric(bool bWeb)
Definition: uitool.cxx:755
RET_OK
sal_uInt16 GetHtmlMode(const SwDocShell *pShell)
Definition: viewopt.cxx:418
void LoadURL(SwViewShell &rVSh, const OUString &rURL, LoadUrlFlags nFilter, const OUString &rTargetFrameName)
Definition: wrtsh2.cxx:555