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 if( GetView().IsDrawRotate() )
378 {
379 pSh->SetDragMode( SdrDragMode::Move );
381 }
382
383 pSh->SetModified();
384 pSh->DelSelectedObj();
385
386 if (rReq.IsAPI() ||
387 GetView().GetEditWin().IsObjectSelect() )
388 {
389 // If basic call, then back to the text shell, because the
390 // Basic otherwise has no possibility to return.
391 if (GetView().GetDrawFuncPtr())
392 {
394 GetView().SetDrawFuncPtr(nullptr);
395 }
396 GetView().LeaveDrawCreate(); // Switch to selection mode
397 }
398
399 if (pSh->IsSelFrameMode())
400 {
401 pSh->LeaveSelFrameMode();
402 // #105852# FME
403 }
404 }
405 break;
406
407 case SID_GROUP:
408 if (pSh->IsObjSelected() > 1 && pSh->IsGroupAllowed())
409 {
410 pSh->GroupSelection();
411 rBind.Invalidate(SID_UNGROUP);
412 }
413 break;
414
415 case SID_UNGROUP:
416 if (pSh->IsGroupSelected(true) && pSh->IsUnGroupAllowed())
417 {
418 pSh->UnGroupSelection();
419 rBind.Invalidate(SID_GROUP);
420 }
421 break;
422
423 case SID_ENTER_GROUP:
424 if (pSh->IsGroupSelected(false))
425 {
426 pSdrView->EnterMarkedGroup();
427 rBind.InvalidateAll(false);
428 }
429 break;
430
431 case SID_LEAVE_GROUP:
432 if (pSdrView->IsGroupEntered())
433 {
434 pSdrView->LeaveOneGroup();
435 rBind.Invalidate(SID_ENTER_GROUP);
436 rBind.Invalidate(SID_UNGROUP);
437 }
438 break;
439
440 case SID_REGENERATE_DIAGRAM:
441 case SID_EDIT_DIAGRAM:
442 {
443 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
444
445 if (1 == rMarkList.GetMarkCount())
446 {
447 SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
448
449 // Support advanced DiagramHelper
450 if(nullptr != pObj && pObj->isDiagram())
451 {
452 if(SID_REGENERATE_DIAGRAM == nSlotId)
453 {
454 pSdrView->UnmarkAll();
455 pObj->getDiagramHelper()->reLayout(*static_cast<SdrObjGroup*>(pObj));
456 pSdrView->MarkObj(pObj, pSdrView->GetSdrPageView());
457 }
458 else // SID_EDIT_DIAGRAM
459 {
463 *static_cast<SdrObjGroup*>(pObj));
464 pDlg->Execute();
465 }
466 }
467 }
468 }
469 break;
470
471 case SID_OBJECT_ALIGN_LEFT:
472 case SID_OBJECT_ALIGN_CENTER:
473 case SID_OBJECT_ALIGN_RIGHT:
474 case SID_OBJECT_ALIGN_UP:
475 case SID_OBJECT_ALIGN_MIDDLE:
476 case SID_OBJECT_ALIGN_DOWN:
477 {
478 if ( bAlignPossible )
479 {
480 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
481 if (rMarkList.GetMarkCount() == 1
483 {
484 sal_Int16 nHorizOrient = -1, nVertOrient = -1;
485
486 switch (nSlotId)
487 {
488 case SID_OBJECT_ALIGN_LEFT:
489 nHorizOrient = text::HoriOrientation::LEFT;
490 break;
491 case SID_OBJECT_ALIGN_CENTER:
492 nHorizOrient = text::HoriOrientation::CENTER;
493 break;
494 case SID_OBJECT_ALIGN_RIGHT:
495 nHorizOrient = text::HoriOrientation::RIGHT;
496 break;
497 case SID_OBJECT_ALIGN_UP:
498 nVertOrient = text::VertOrientation::TOP;
499 break;
500 case SID_OBJECT_ALIGN_MIDDLE:
501 nVertOrient = text::VertOrientation::CENTER;
502 break;
503 case SID_OBJECT_ALIGN_DOWN:
504 nVertOrient = text::VertOrientation::BOTTOM;
505 break;
506 default:
507 break;
508 }
509
510 if (nHorizOrient != -1)
511 {
512 pSh->StartAction();
513 SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
514 SwFrameFormat* pFrameFormat = FindFrameFormat( pObj );
515 SwFormatHoriOrient aHOrient(pFrameFormat->GetFormatAttr(RES_HORI_ORIENT));
516 aHOrient.SetHoriOrient( nHorizOrient );
517 pFrameFormat->SetFormatAttr(aHOrient);
518 pSh->EndAction();
519 }
520
521 if (nVertOrient != -1)
522 {
523 pSh->StartAction();
524 SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
525 SwFrameFormat* pFrameFormat = FindFrameFormat( pObj );
526 SwFormatVertOrient aVOrient(pFrameFormat->GetFormatAttr(RES_VERT_ORIENT));
527 aVOrient.SetVertOrient( nVertOrient );
528 pFrameFormat->SetFormatAttr(aVOrient);
529 pSh->EndAction();
530 }
531
532 break;
533 }
534
535 pSh->StartAction();
536 switch (nSlotId)
537 {
538 case SID_OBJECT_ALIGN_LEFT:
539 pSdrView->AlignMarkedObjects(SdrHorAlign::Left, SdrVertAlign::NONE);
540 break;
541 case SID_OBJECT_ALIGN_CENTER:
542 pSdrView->AlignMarkedObjects(SdrHorAlign::Center, SdrVertAlign::NONE);
543 break;
544 case SID_OBJECT_ALIGN_RIGHT:
545 pSdrView->AlignMarkedObjects(SdrHorAlign::Right, SdrVertAlign::NONE);
546 break;
547 case SID_OBJECT_ALIGN_UP:
548 pSdrView->AlignMarkedObjects(SdrHorAlign::NONE, SdrVertAlign::Top);
549 break;
550 case SID_OBJECT_ALIGN_MIDDLE:
551 pSdrView->AlignMarkedObjects(SdrHorAlign::NONE, SdrVertAlign::Center);
552 break;
553 case SID_OBJECT_ALIGN_DOWN:
554 pSdrView->AlignMarkedObjects(SdrHorAlign::NONE, SdrVertAlign::Bottom);
555 break;
556 }
557 pSh->EndAction();
558 }
559 }
560 break;
561
562 case FN_FRAME_UP:
563 bTopParam = false;
564 [[fallthrough]];
565 case SID_FRAME_TO_TOP:
566 pSh->SelectionToTop( bTopParam );
567 break;
568
569 case FN_FRAME_DOWN:
570 bBottomParam = false;
571 [[fallthrough]];
572 case SID_FRAME_TO_BOTTOM:
573 pSh->SelectionToBottom( bBottomParam );
574 break;
575
576 case FN_NAME_SHAPE:
577 {
578 bDone = true;
579
580 if(1 == pSdrView->GetMarkedObjectCount())
581 {
582 // #i68101#
583 SdrObject* pSelected = pSdrView->GetMarkedObjectByIndex(0);
584 OSL_ENSURE(pSelected, "DrawViewShell::FuTemp03: nMarkCount, but no object (!)");
585 OUString aName(pSelected->GetName());
586
589
590 pDlg->SetCheckNameHdl(LINK(this, SwDrawBaseShell, CheckGroupShapeNameHdl));
591
592 if(RET_OK == pDlg->Execute())
593 {
594 pDlg->GetName(aName);
595 pSelected->SetName(aName);
596 pSh->SetModified();
597 }
598 }
599
600 break;
601 }
602
603 // #i68101#
605 {
606 bDone = true;
607
608 if(1 == pSdrView->GetMarkedObjectCount())
609 {
610 SdrObject* pSelected = pSdrView->GetMarkedObjectByIndex(0);
611 OSL_ENSURE(pSelected, "DrawViewShell::FuTemp03: nMarkCount, but no object (!)");
612 OUString aTitle(pSelected->GetTitle());
613 OUString aDescription(pSelected->GetDescription());
614
617 aTitle, aDescription));
618
619 if(RET_OK == pDlg->Execute())
620 {
621 pDlg->GetTitle(aTitle);
622 pDlg->GetDescription(aDescription);
623
624 pSelected->SetTitle(aTitle);
625 pSelected->SetDescription(aDescription);
626
627 pSh->SetModified();
628 }
629 }
630
631 break;
632 }
633
634 case SID_OPEN_HYPERLINK:
635 {
636 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
637 SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
639 /*rTargetFrameName=*/OUString());
640 break;
641 }
642
643 case SID_EDIT_HYPERLINK:
644 case SID_HYPERLINK_DIALOG:
645 {
646 GetView().GetViewFrame()->SetChildWindow(SID_HYPERLINK_DIALOG, true);
647 break;
648 }
649
650 case SID_HYPERLINK_SETLINK:
651 {
652 if(pItem)
653 {
654 const SvxHyperlinkItem& rHLinkItem = *static_cast<const SvxHyperlinkItem *>(pItem);
655 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
656 SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
657 pObj->setHyperlink(rHLinkItem.GetURL());
658 }
659 break;
660 }
661
662 case SID_REMOVE_HYPERLINK:
663 {
664 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
665 SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
666 pObj->setHyperlink(OUString());
667 break;
668 }
669
670 case SID_COPY_HYPERLINK_LOCATION:
671 {
672 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
673 SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
674 uno::Reference<datatransfer::clipboard::XClipboard> xClipboard
677 break;
678 }
679
680 default:
681 OSL_ENSURE(false, "wrong Dispatcher");
682 return;
683 }
684 if(!bDone)
685 {
686 if(nSlotId >= SID_OBJECT_ALIGN_LEFT && nSlotId <= SID_OBJECT_ALIGN_DOWN)
687 rBind.Invalidate(SID_ATTR_LONG_LRSPACE);
688 if (pSdrView->GetModel()->IsChanged())
689 pSh->SetModified();
690 else if (bChanged)
691 pSdrView->GetModel()->SetChanged();
692 }
693}
694
695// Checks whether a given name is allowed for a group shape
696
697IMPL_LINK( SwDrawBaseShell, CheckGroupShapeNameHdl, AbstractSvxObjectNameDialog&, rNameDialog, bool )
698{
699 SwWrtShell &rSh = GetShell();
700 SdrView *pSdrView = rSh.GetDrawView();
701 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
702 OSL_ENSURE(rMarkList.GetMarkCount() == 1, "wrong draw selection");
703 SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
704 const OUString sCurrentName = pObj->GetName();
705 OUString sNewName;
706 rNameDialog.GetName(sNewName);
707 bool bRet = false;
708 if (sNewName.isEmpty() || sCurrentName == sNewName)
709 bRet = true;
710 else
711 {
712 bRet = true;
714 SdrObjListIter aIter( pModel->GetPage(0), SdrIterMode::DeepWithGroups );
715 while( aIter.IsMore() )
716 {
717 SdrObject* pTempObj = aIter.Next();
718 if ( pObj != pTempObj && pTempObj->GetName() == sNewName )
719 {
720 bRet = false;
721 break;
722 }
723 }
724 }
725 return bRet;
726}
727
729{
730 SwWrtShell &rSh = GetShell();
731 SdrView* pSdrView = rSh.GetDrawViewWithValidMarkList();
732 SfxWhichIter aIter( rSet );
733 sal_uInt16 nWhich = aIter.FirstWhich();
735
736 if (!bProtected) // Look in the parent
738
739 while( nWhich )
740 {
741 switch( nWhich )
742 {
743 case FN_DRAW_WRAP_DLG:
744 case SID_ATTR_TRANSFORM:
745 case SID_FRAME_TO_TOP:
746 case SID_FRAME_TO_BOTTOM:
747 case FN_FRAME_UP:
748 case FN_FRAME_DOWN:
749 case SID_DELETE:
750 case FN_BACKSPACE:
751 if( bProtected || !rSh.IsObjSelected() )
752 rSet.DisableItem( nWhich );
753 break;
754 case SID_GROUP:
755 if ( rSh.IsObjSelected() < 2 || bProtected || !rSh.IsGroupAllowed() )
756 rSet.DisableItem( nWhich );
757 break;
758 case SID_UNGROUP:
759 if ( !rSh.IsGroupSelected(true) || bProtected || !rSh.IsUnGroupAllowed() )
760 rSet.DisableItem( nWhich );
761 break;
762 case SID_ENTER_GROUP:
763 if ( !rSh.IsGroupSelected(false) )
764 rSet.DisableItem( nWhich );
765 break;
766 case SID_LEAVE_GROUP:
767 if ( !pSdrView->IsGroupEntered() )
768 rSet.DisableItem( nWhich );
769 break;
770 case SID_OBJECT_ALIGN_LEFT:
771 case SID_OBJECT_ALIGN_CENTER:
772 case SID_OBJECT_ALIGN_RIGHT:
773 case SID_OBJECT_ALIGN_UP:
774 case SID_OBJECT_ALIGN_MIDDLE:
775 case SID_OBJECT_ALIGN_DOWN:
776 case SID_OBJECT_ALIGN:
777 {
778 bool bDisableThis = false;
779 bool bDisableHoriz = false;
780 bool bHoriz = (nWhich == SID_OBJECT_ALIGN_LEFT || nWhich == SID_OBJECT_ALIGN_CENTER ||
781 nWhich == SID_OBJECT_ALIGN_RIGHT);
782 bool bVert = (nWhich == SID_OBJECT_ALIGN_UP || nWhich == SID_OBJECT_ALIGN_MIDDLE ||
783 nWhich == SID_OBJECT_ALIGN_DOWN);
784 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
785 if ( !rSh.IsAlignPossible() || bProtected )
786 {
787 bDisableThis = true;
788 rSet.DisableItem( nWhich );
789 }
790 else if ( rSh.GetAnchorId() == RndStdIds::FLY_AS_CHAR )
791 {
792 //if only one object is selected it can only be vertically
793 // aligned because it is character bound
794 if( rMarkList.GetMarkCount() == 1 )
795 {
796 bDisableHoriz = true;
797 rSet.DisableItem(SID_OBJECT_ALIGN_LEFT);
798 rSet.DisableItem(SID_OBJECT_ALIGN_CENTER);
799 rSet.DisableItem(SID_OBJECT_ALIGN_RIGHT);
800 }
801 }
802
803 if (bHoriz && !bDisableThis && !bDisableHoriz &&
804 rMarkList.GetMarkCount() == 1)
805 {
806 sal_Int16 nHoriOrient = -1;
807 switch(nWhich)
808 {
809 case SID_OBJECT_ALIGN_LEFT:
810 nHoriOrient = text::HoriOrientation::LEFT;
811 break;
812 case SID_OBJECT_ALIGN_CENTER:
813 nHoriOrient = text::HoriOrientation::CENTER;
814 break;
815 case SID_OBJECT_ALIGN_RIGHT:
816 nHoriOrient = text::HoriOrientation::RIGHT;
817 break;
818 default:
819 break;
820 }
821
822 SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
823 SwFrameFormat* pFrameFormat = FindFrameFormat(pObj);
824 SwFormatHoriOrient aHOrient(pFrameFormat->GetFormatAttr(RES_HORI_ORIENT));
825 rSet.Put(SfxBoolItem(nWhich, aHOrient.GetHoriOrient() == nHoriOrient));
826 }
827
828 if (bVert && !bDisableThis && rMarkList.GetMarkCount() == 1)
829 {
830 sal_Int16 nVertOrient = -1;
831 switch(nWhich)
832 {
833 case SID_OBJECT_ALIGN_UP:
834 nVertOrient = text::VertOrientation::TOP;
835 break;
836 case SID_OBJECT_ALIGN_MIDDLE:
837 nVertOrient = text::VertOrientation::CENTER;
838 break;
839 case SID_OBJECT_ALIGN_DOWN:
840 nVertOrient = text::VertOrientation::BOTTOM;
841 break;
842 default:
843 break;
844 }
845
846 SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
847 SwFrameFormat* pFrameFormat = FindFrameFormat(pObj);
848 SwFormatVertOrient aVOrient(pFrameFormat->GetFormatAttr(RES_VERT_ORIENT));
849 rSet.Put(SfxBoolItem(nWhich, aVOrient.GetVertOrient() == nVertOrient));
850 }
851 }
852 break;
853
854 case FN_NAME_SHAPE :
855 {
856 if(1 != pSdrView->GetMarkedObjectCount())
857 {
858 rSet.DisableItem( nWhich );
859 }
860 }
861 break;
862
863 // #i68101#
865 {
866 const bool bIsWebView(nullptr != dynamic_cast<SwWebView*>(&GetView()));
867
868 if(!bIsWebView && 1 != pSdrView->GetMarkedObjectCount())
869 {
870 rSet.DisableItem( nWhich );
871 }
872 }
873 break;
874
875 case SID_OPEN_HYPERLINK:
876 case SID_EDIT_HYPERLINK:
877 case SID_HYPERLINK_DIALOG:
878 case SID_REMOVE_HYPERLINK:
879 case SID_COPY_HYPERLINK_LOCATION:
880 {
881 if (pSdrView->GetMarkedObjectCount() != 1)
882 {
883 rSet.DisableItem(nWhich);
884 break;
885 }
886
887 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
888 SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
889 SdrObjKind nObjType = pObj->GetObjIdentifier();
890
891 // Only enable hyperlink for the following types
892 switch (nObjType)
893 {
894 case SdrObjKind::PathFill:
895 case SdrObjKind::CircleSection:
896 case SdrObjKind::Line:
897 case SdrObjKind::CustomShape:
898 case SdrObjKind::Text:
899 case SdrObjKind::Rectangle:
900 case SdrObjKind::Caption:
901 case SdrObjKind::Polygon:
902 case SdrObjKind::PolyLine:
903 case SdrObjKind::E3D_Scene:
904 case SdrObjKind::Measure:
905 case SdrObjKind::Edge:
906 break;
907 default:
908 rSet.DisableItem(nWhich);
909 break;
910 }
911
912 if (nWhich == SID_OPEN_HYPERLINK || nWhich == SID_REMOVE_HYPERLINK
913 || nWhich == SID_EDIT_HYPERLINK || nWhich == SID_COPY_HYPERLINK_LOCATION)
914 {
915 if (pObj->getHyperlink().isEmpty())
916 rSet.DisableItem(nWhich);
917 }
918 }
919 break;
920
921 case SID_HYPERLINK_GETLINK:
922 {
923 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
924 if (rMarkList.GetMark(0) != nullptr)
925 {
926 SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
927 OUString sHyperLink = pObj->getHyperlink();
928 SvxHyperlinkItem aHLinkItem;
929 aHLinkItem.SetURL(sHyperLink);
930 rSet.Put(aHLinkItem);
931 }
932 }
933 break;
934
935 case SID_REGENERATE_DIAGRAM:
936 case SID_EDIT_DIAGRAM:
937 {
938 bool bDisable(true);
939 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
940 if (nullptr != rMarkList.GetMark(0))
941 {
942 SdrObject* pObj(rMarkList.GetMark(0)->GetMarkedSdrObj());
943
944 if(nullptr != pObj && pObj->isDiagram())
945 {
946 bDisable = false;
947 }
948 }
949
950 if(bDisable)
951 {
952 rSet.DisableItem(nWhich);
953 }
954 }
955 break;
956
957
958 }
959 nWhich = aIter.NextWhich();
960 }
961}
962
964{
965 SwWrtShell *pSh = &GetShell();
966 SdrView* pSdrView = pSh->GetDrawView();
967 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
968 if( rMarkList.GetMark(0) != nullptr )
969 {
970 SfxItemSet aNewAttr(pSdrView->GetGeoAttrFromMarked());
971 rSet.Put(aNewAttr,false);
972 }
973}
974
975bool SwDrawBaseShell::Disable(SfxItemSet& rSet, sal_uInt16 nWhich)
976{
978
979 if (bDisable)
980 {
981 if (nWhich)
982 rSet.DisableItem( nWhich );
983 else
984 {
985 SfxWhichIter aIter( rSet );
986 nWhich = aIter.FirstWhich();
987 while (nWhich)
988 {
989 rSet.DisableItem( nWhich );
990 nWhich = aIter.NextWhich();
991 }
992 }
993 }
994
995 return bDisable;
996}
997
999{
1000 SwWrtShell *pSh = &GetShell();
1001 SdrView* pSdrView = pSh->GetDrawView();
1002 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
1003 const size_t nMarkCount = rMarkList.GetMarkCount();
1004 bool bShowArea = true, bShowMeasure = true;
1005
1006 for (size_t i = 0; i < nMarkCount && i < 50; ++i)
1007 {
1008 SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
1009 SdrObjKind nObjType = pObj->GetObjIdentifier();
1010
1011 if ( nObjType != SdrObjKind::Measure )
1012 bShowMeasure = false;
1013
1014 // If marked object is 2D, disable format area command.
1015 if ( nObjType == SdrObjKind::PolyLine ||
1016 nObjType == SdrObjKind::Line ||
1017 nObjType == SdrObjKind::PathLine ||
1018 nObjType == SdrObjKind::FreehandLine ||
1019 nObjType == SdrObjKind::Edge ||
1020 nObjType == SdrObjKind::CircleArc ||
1021 bShowMeasure )
1022 bShowArea = false;
1023
1024 if (!bShowArea && !bShowMeasure)
1025 break;
1026 }
1027
1028 if (!bShowArea)
1029 rSet.DisableItem(SID_ATTRIBUTES_AREA);
1030
1031 if (!bShowMeasure)
1032 rSet.DisableItem(SID_MEASURE_DLG);
1033
1034 Disable(rSet);
1035
1036}
1037
1038// Validate of drawing positions
1039
1040IMPL_LINK(SwDrawBaseShell, ValidatePosition, SvxSwFrameValidation&, rValidation, void )
1041{
1042 SwWrtShell *pSh = &GetShell();
1043 rValidation.nMinHeight = MINFLY;
1044 rValidation.nMinWidth = MINFLY;
1045
1046 SwRect aBoundRect;
1047
1048 // OD 18.09.2003 #i18732# - adjustment for allowing vertical position
1049 // aligned to page for fly frame anchored to paragraph or to character.
1050 const RndStdIds eAnchorType = rValidation.nAnchorType;
1051 const SwPosition* pContentPos = nullptr;
1052 SdrView* pSdrView = pSh->GetDrawView();
1053 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
1054 if( rMarkList.GetMarkCount() == 1 )
1055 {
1056 SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
1057 SwFrameFormat* pFrameFormat = FindFrameFormat( pObj );
1058 pContentPos = pFrameFormat->GetAnchor().GetContentAnchor();
1059 }
1060
1061 pSh->CalcBoundRect( aBoundRect, eAnchorType,
1062 rValidation.nHRelOrient,
1063 rValidation.nVRelOrient,
1064 pContentPos,
1065 rValidation.bFollowTextFlow,
1066 rValidation.bMirror, nullptr, &rValidation.aPercentSize);
1067
1068 bool bIsInVertical( false );
1069 {
1070 bool bRTL;
1071 bool bVertL2R;
1072 bIsInVertical = pSh->IsFrameVertical(true, bRTL, bVertL2R);
1073 }
1074 if(bIsInVertical)
1075 {
1076 Point aPos(aBoundRect.Pos());
1077 tools::Long nTmp = aPos.X();
1078 aPos.setX( aPos.Y() );
1079 aPos.setY( nTmp );
1080 Size aSize(aBoundRect.SSize());
1081 nTmp = aSize.Width();
1082 aSize.setWidth( aSize.Height() );
1083 aSize.setHeight( nTmp );
1084 aBoundRect.Chg( aPos, aSize );
1085 //exchange width/height to enable correct values
1086 nTmp = rValidation.nWidth;
1087 rValidation.nWidth = rValidation.nHeight;
1088 rValidation.nHeight = nTmp;
1089 }
1090 if ((eAnchorType == RndStdIds::FLY_AT_PAGE) || (eAnchorType == RndStdIds::FLY_AT_FLY))
1091 {
1092 // MinimalPosition
1093 rValidation.nMinHPos = aBoundRect.Left();
1094 rValidation.nMinVPos = aBoundRect.Top();
1095 SwTwips nH = rValidation.nHPos;
1096 SwTwips nV = rValidation.nVPos;
1097
1098 if (rValidation.nHPos + rValidation.nWidth > aBoundRect.Right())
1099 {
1100 if (rValidation.nHoriOrient == text::HoriOrientation::NONE)
1101 {
1102 rValidation.nHPos -= ((rValidation.nHPos + rValidation.nWidth) - aBoundRect.Right());
1103 nH = rValidation.nHPos;
1104 }
1105 else
1106 rValidation.nWidth = aBoundRect.Right() - rValidation.nHPos;
1107 }
1108
1109 if (rValidation.nHPos + rValidation.nWidth > aBoundRect.Right())
1110 rValidation.nWidth = aBoundRect.Right() - rValidation.nHPos;
1111
1112 if (rValidation.nVPos + rValidation.nHeight > aBoundRect.Bottom())
1113 {
1114 if (rValidation.nVertOrient == text::VertOrientation::NONE)
1115 {
1116 rValidation.nVPos -= ((rValidation.nVPos + rValidation.nHeight) - aBoundRect.Bottom());
1117 nV = rValidation.nVPos;
1118 }
1119 else
1120 rValidation.nHeight = aBoundRect.Bottom() - rValidation.nVPos;
1121 }
1122
1123 if (rValidation.nVPos + rValidation.nHeight > aBoundRect.Bottom())
1124 rValidation.nHeight = aBoundRect.Bottom() - rValidation.nVPos;
1125
1126 if ( rValidation.nVertOrient != text::VertOrientation::NONE )
1127 nV = aBoundRect.Top();
1128
1129 if ( rValidation.nHoriOrient != text::HoriOrientation::NONE )
1130 nH = aBoundRect.Left();
1131
1132 rValidation.nMaxHPos = aBoundRect.Right() - rValidation.nWidth;
1133 rValidation.nMaxHeight = aBoundRect.Bottom() - nV;
1134
1135 rValidation.nMaxVPos = aBoundRect.Bottom() - rValidation.nHeight;
1136 rValidation.nMaxWidth = aBoundRect.Right() - nH;
1137 }
1138 else if ((eAnchorType == RndStdIds::FLY_AT_PARA) || (eAnchorType == RndStdIds::FLY_AT_CHAR))
1139 {
1140 if (rValidation.nHPos + rValidation.nWidth > aBoundRect.Right())
1141 {
1142 if (rValidation.nHoriOrient == text::HoriOrientation::NONE)
1143 {
1144 rValidation.nHPos -= ((rValidation.nHPos + rValidation.nWidth) - aBoundRect.Right());
1145 }
1146 else
1147 rValidation.nWidth = aBoundRect.Right() - rValidation.nHPos;
1148 }
1149
1150 // OD 29.09.2003 #i17567#, #i18732# - consider following the text flow
1151 // and alignment at page areas.
1152 const bool bMaxVPosAtBottom = !rValidation.bFollowTextFlow ||
1153 rValidation.nVRelOrient == text::RelOrientation::PAGE_FRAME ||
1154 rValidation.nVRelOrient == text::RelOrientation::PAGE_PRINT_AREA ||
1155 rValidation.nVRelOrient == text::RelOrientation::PAGE_PRINT_AREA_BOTTOM;
1156 {
1157 SwTwips nTmpMaxVPos = ( bMaxVPosAtBottom
1158 ? aBoundRect.Bottom()
1159 : aBoundRect.Height() ) -
1160 rValidation.nHeight;
1161 if ( rValidation.nVPos > nTmpMaxVPos )
1162 {
1163 if (rValidation.nVertOrient == text::VertOrientation::NONE)
1164 {
1165 rValidation.nVPos = nTmpMaxVPos;
1166 }
1167 else
1168 {
1169 rValidation.nHeight = ( bMaxVPosAtBottom
1170 ? aBoundRect.Bottom()
1171 : aBoundRect.Height() ) - rValidation.nVPos;
1172 }
1173 }
1174 }
1175
1176 rValidation.nMinHPos = aBoundRect.Left();
1177 rValidation.nMaxHPos = aBoundRect.Right() - rValidation.nWidth;
1178
1179 rValidation.nMinVPos = aBoundRect.Top();
1180 // OD 26.09.2003 #i17567#, #i18732# - determine maximum vertical position
1181 if ( bMaxVPosAtBottom )
1182 {
1183 rValidation.nMaxVPos = aBoundRect.Bottom() - rValidation.nHeight;
1184 }
1185 else
1186 {
1187 rValidation.nMaxVPos = aBoundRect.Height() - rValidation.nHeight;
1188 }
1189
1190 // Maximum width height
1191 const SwTwips nH = ( rValidation.nHoriOrient != text::HoriOrientation::NONE )
1192 ? aBoundRect.Left()
1193 : rValidation.nHPos;
1194 const SwTwips nV = ( rValidation.nVertOrient != text::VertOrientation::NONE )
1195 ? aBoundRect.Top()
1196 : rValidation.nVPos;
1197 rValidation.nMaxHeight = rValidation.nMaxVPos + rValidation.nHeight - nV;
1198 rValidation.nMaxWidth = rValidation.nMaxHPos + rValidation.nWidth - nH;
1199 }
1200 else if (eAnchorType == RndStdIds::FLY_AS_CHAR)
1201 {
1202 rValidation.nMinHPos = 0;
1203 rValidation.nMaxHPos = 0;
1204
1205 rValidation.nMaxHeight = aBoundRect.Height();
1206 rValidation.nMaxWidth = aBoundRect.Width();
1207
1208 rValidation.nMaxVPos = aBoundRect.Height();
1209 rValidation.nMinVPos = -aBoundRect.Height() + rValidation.nHeight;
1210 if (rValidation.nMaxVPos < rValidation.nMinVPos)
1211 {
1212 rValidation.nMinVPos = rValidation.nMaxVPos;
1213 rValidation.nMaxVPos = -aBoundRect.Height();
1214 }
1215 }
1216 if(bIsInVertical)
1217 {
1218 //restore width/height exchange
1219 tools::Long nTmp = rValidation.nWidth;
1220 rValidation.nWidth = rValidation.nHeight;
1221 rValidation.nHeight = nTmp;
1222 }
1223
1224 if (rValidation.nMaxWidth < rValidation.nWidth)
1225 rValidation.nWidth = rValidation.nMaxWidth;
1226 if (rValidation.nMaxHeight < rValidation.nHeight)
1227 rValidation.nHeight = rValidation.nMaxHeight;
1228}
1229
1230/* 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
OUString GetTitle() const
void SetTitle(const OUString &rStr)
bool isDiagram() const
virtual const std::shared_ptr< svx::diagram::IDiagramHelper > & getDiagramHelper() const
void SetDescription(const OUString &rStr)
OUString GetDescription() const
const OUString & GetName() const
virtual SdrObjKind GetObjIdentifier() const
void SetName(const OUString &rStr, const bool bSetChanged=true)
void setHyperlink(const OUString &sHyperlink)
bool IsGroupEntered() const
void LeaveOneGroup()
SdrModel * GetModel() const
SdrPageView * GetSdrPageView() 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:2820
SwView & GetView()
Definition: basesh.hxx:59
void StartAction()
Definition: crsrsh.cxx:227
void EndAction(const bool bIdleEnd=false)
Definition: crsrsh.cxx:244
void GetState(SfxItemSet &)
Definition: drwbassh.cxx:728
void Execute(SfxRequest const &)
Definition: drwbassh.cxx:98
SwDrawBaseShell(SwView &rShell)
Definition: drwbassh.cxx:76
void DisableState(SfxItemSet &rSet)
Definition: drwbassh.cxx:998
bool Disable(SfxItemSet &rSet, sal_uInt16 nWhich=0)
Definition: drwbassh.cxx:975
void GetDrawAttrStateForIFBX(SfxItemSet &rSet)
Definition: drwbassh.cxx:963
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:730
void SetBezierMode(sal_uInt16 eBezMode)
Definition: edtwin.hxx:221
void SelectionToHell()
Below document.
Definition: feshview.cxx:1241
void SetObjAttr(const SfxItemSet &rSet)
Definition: feshview.cxx:2795
FlyProtectFlags IsSelObjProtected(FlyProtectFlags eType) const
Which Protection is set at selected object?
Definition: feshview.cxx:2704
RndStdIds GetAnchorId() const
Anchor type of selected object, RndStdIds::UNKNOWN if ambiguous or in case of frame selection.
Definition: feshview.cxx:2331
void SelectionToHeaven()
Above document.
Definition: feshview.cxx:1236
void GroupSelection()
Afterwards the group is selected.
Definition: feshview.cxx:2572
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:1271
void SelectionToTop(bool bTop=true)
Move selection upwards or downwards (Z-Order).
Definition: feshview.cxx:1049
void SelectionToBottom(bool bBottom=true)
Definition: feshview.cxx:1118
void ChgAnchor(RndStdIds eAnchorId, bool bSameOnly=false, bool bPosCorr=true)
frmatr.hxx.
Definition: feshview.cxx:2361
void DelSelectedObj()
Definition: feshview.cxx:2379
bool GetObjAttr(SfxItemSet &rSet) const
Attention: Ambiguities if multiple selections.
Definition: feshview.cxx:2772
bool IsGroupSelected(bool bAllowDiagams)
Create and destroy group, don't when frame is selected.
Definition: feshview.cxx:2440
void SetDragMode(SdrDragMode eSdrDragMode)
Set DragMode (e.g. Rotate), but do nothing when frame is selected.
Definition: feshview.cxx:667
SdrLayerID GetLayerId() const
1 Heaven, 0 Hell, SDRLAYER_NOTFOUND Ambiguous.
Definition: feshview.cxx:1170
bool IsUnGroupAllowed() const
Definition: feshview.cxx:2555
size_t IsObjSelected() const
Definition: feshview.cxx:1246
void UnGroupSelection()
The individual objects are selected, but it is possible that there are groups included.
Definition: feshview.cxx:2587
bool IsAlignPossible() const
Definition: feshview.cxx:2821
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
bool IsGroupAllowed() const
Definition: feshview.cxx:2495
const SwFrameFormat * IsFlyInFly()
Is selected frame within another frame?
Definition: fefly1.cxx:312
FlyAnchors.
Definition: fmtanchr.hxx:35
RndStdIds GetAnchorId() const
Definition: fmtanchr.hxx:65
void SetType(RndStdIds nRndId)
Definition: fmtanchr.hxx:71
const SwPosition * GetContentAnchor() const
Definition: fmtanchr.hxx:67
void SetPos(SwTwips nNew)
Definition: fmtornt.hxx:93
void SetPosToggle(bool bNew)
Definition: fmtornt.hxx:96
void SetHoriOrient(sal_Int16 eNew)
Definition: fmtornt.hxx:89
sal_Int16 GetHoriOrient() const
Definition: fmtornt.hxx:87
void SetRelationOrient(sal_Int16 eNew)
Definition: fmtornt.hxx:90
SwTwips GetPos() const
Definition: fmtornt.hxx:92
bool IsPosToggle() const
Definition: fmtornt.hxx:95
sal_Int16 GetRelationOrient() const
Definition: fmtornt.hxx:88
sal_Int16 GetRelationOrient() const
Definition: fmtornt.hxx:55
SwTwips GetPos() const
Definition: fmtornt.hxx:59
void SetVertOrient(sal_Int16 eNew)
Definition: fmtornt.hxx:56
void SetPos(SwTwips nNew)
Definition: fmtornt.hxx:60
void SetRelationOrient(sal_Int16 eNew)
Definition: fmtornt.hxx:57
sal_Int16 GetVertOrient() const
Definition: fmtornt.hxx:54
const SwFormatAnchor & GetAnchor(bool=true) const
Definition: fmtanchr.hxx:81
const SfxPoolItem & GetFormatAttr(sal_uInt16 nWhich, bool bInParents=true) const
If bInParents is FALSE, search only in this format for attribute.
Definition: format.cxx:367
virtual bool SetFormatAttr(const SfxPoolItem &rAttr)
Definition: format.cxx:448
Style of a layout element.
Definition: frmfmt.hxx:61
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
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:4330
static void CreateSelection(SwWrtShell &rSh, const SwFrameShell *pCreator=nullptr)
Definition: swdtflvr.cxx:4318
SdrView * GetDrawViewWithValidMarkList()
Definition: vnew.cxx:378
const IDocumentDrawModelAccess & getIDocumentDrawModelAccess() const
Provides access to the document draw model interface.
Definition: viewsh.cxx:2783
SdrView * GetDrawView()
Definition: vnew.cxx:373
Definition: view.hxx:145
void FlipDrawRotate()
Definition: view.hxx:530
SwDrawBase * GetDrawFuncPtr() const
Definition: view.hxx:526
SwEditWin & GetEditWin()
Definition: view.hxx:416
void SetDrawFuncPtr(std::unique_ptr< SwDrawBase > pFuncPtr)
Definition: viewdraw.cxx:641
void ExitDraw()
Definition: viewdraw.cxx:389
SwDocShell * GetDocShell()
Definition: view.cxx:1133
void LeaveDrawCreate()
Definition: view.hxx:538
Used by the UI to modify the document model.
Definition: wrtsh.hxx:97
bool IsSelFrameMode() const
Definition: wrtsh.hxx:176
void LeaveSelFrameMode()
Definition: select.cxx:720
void NoEdit(bool bHideCursor=true)
Definition: wrtsh1.cxx:179
void Edit()
Definition: wrtsh1.cxx:185
const SwView & GetView() const
Definition: wrtsh.hxx:437
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:378
#define FN_BACKSPACE
Definition: cmdid.h:674
#define FN_FRAME_DOWN
Definition: cmdid.h:379
#define FN_TITLE_DESCRIPTION_SHAPE
Definition: cmdid.h:452
#define FN_DRAW_WRAP_DLG
Definition: cmdid.h:153
#define FN_NAME_SHAPE
Definition: cmdid.h:450
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:697
@ Parent
Check only parents.
FieldUnit
constexpr sal_uInt16 RES_FRMATR_BEGIN(RES_PARATR_LIST_END)
constexpr sal_uInt16 RES_FRMATR_END(133)
constexpr TypedWhichId< SwFormatFollowTextFlow > RES_FOLLOW_TEXT_FLOW(123)
constexpr TypedWhichId< SwFormatSurround > RES_SURROUND(101)
constexpr TypedWhichId< SwFormatWrapInfluenceOnObjPos > RES_WRAP_INFLUENCE_ON_OBJPOS(125)
constexpr TypedWhichId< SwFormatHoriOrient > RES_HORI_ORIENT(103)
constexpr TypedWhichId< SvxULSpaceItem > RES_UL_SPACE(92)
constexpr TypedWhichId< SwFormatAnchor > RES_ANCHOR(104)
constexpr TypedWhichId< SwFormatVertOrient > RES_VERT_ORIENT(102)
constexpr TypedWhichId< SvxLRSpaceItem > RES_LR_SPACE(91)
OUString aName
if(aStr !=aBuf) UpdateName_Impl(m_xFollowLb.get()
Shell * GetShell()
int i
long Long
std::string GetValue
static SfxItemSet & rSet
Marks a position in the document model.
Definition: pam.hxx:37
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:354
void LoadURL(SwViewShell &rVSh, const OUString &rURL, LoadUrlFlags nFilter, const OUString &rTargetFrameName)
Definition: wrtsh2.cxx:505