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 bool isDecorative(pSelected->IsDecorative());
619
622 aTitle, aDescription, isDecorative));
623
624 if(RET_OK == pDlg->Execute())
625 {
626 pDlg->GetTitle(aTitle);
627 pDlg->GetDescription(aDescription);
628 pDlg->IsDecorative(isDecorative);
629
630 pSelected->SetTitle(aTitle);
631 pSelected->SetDescription(aDescription);
632 pSelected->SetDecorative(isDecorative);
633
634 pSh->SetModified();
635 }
636 }
637
638 break;
639 }
640
641 case SID_OPEN_HYPERLINK:
642 {
643 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
644 SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
646 /*rTargetFrameName=*/OUString());
647 break;
648 }
649
650 case SID_EDIT_HYPERLINK:
651 case SID_HYPERLINK_DIALOG:
652 {
653 GetView().GetViewFrame().SetChildWindow(SID_HYPERLINK_DIALOG, true);
654 break;
655 }
656
657 case SID_HYPERLINK_SETLINK:
658 {
659 if(pItem)
660 {
661 const SvxHyperlinkItem& rHLinkItem = *static_cast<const SvxHyperlinkItem *>(pItem);
662 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
663 SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
664 pObj->setHyperlink(rHLinkItem.GetURL());
665 }
666 break;
667 }
668
669 case SID_REMOVE_HYPERLINK:
670 {
671 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
672 SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
673 pObj->setHyperlink(OUString());
674 break;
675 }
676
677 case SID_COPY_HYPERLINK_LOCATION:
678 {
679 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
680 SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
681 uno::Reference<datatransfer::clipboard::XClipboard> xClipboard
684 break;
685 }
686
687 default:
688 OSL_ENSURE(false, "wrong Dispatcher");
689 return;
690 }
691 if(!bDone)
692 {
693 if(nSlotId >= SID_OBJECT_ALIGN_LEFT && nSlotId <= SID_OBJECT_ALIGN_DOWN)
694 rBind.Invalidate(SID_ATTR_LONG_LRSPACE);
695 if (pSdrView->GetModel().IsChanged())
696 pSh->SetModified();
697 else if (bChanged)
698 pSdrView->GetModel().SetChanged();
699 }
700}
701
702// Checks whether a given name is allowed for a group shape
703
704IMPL_LINK( SwDrawBaseShell, CheckGroupShapeNameHdl, AbstractSvxObjectNameDialog&, rNameDialog, bool )
705{
706 SwWrtShell &rSh = GetShell();
707 SdrView *pSdrView = rSh.GetDrawView();
708 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
709 OSL_ENSURE(rMarkList.GetMarkCount() == 1, "wrong draw selection");
710 SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
711 const OUString sCurrentName = pObj->GetName();
712 OUString sNewName;
713 rNameDialog.GetName(sNewName);
714 bool bRet = false;
715 if (sNewName.isEmpty() || sCurrentName == sNewName)
716 bRet = true;
717 else
718 {
719 bRet = true;
721 SdrObjListIter aIter( pModel->GetPage(0), SdrIterMode::DeepWithGroups );
722 while( aIter.IsMore() )
723 {
724 SdrObject* pTempObj = aIter.Next();
725 if ( pObj != pTempObj && pTempObj->GetName() == sNewName )
726 {
727 bRet = false;
728 break;
729 }
730 }
731 }
732 return bRet;
733}
734
736{
737 SwWrtShell &rSh = GetShell();
738 SdrView* pSdrView = rSh.GetDrawViewWithValidMarkList();
739 SfxWhichIter aIter( rSet );
740 sal_uInt16 nWhich = aIter.FirstWhich();
742
743 if (!bProtected) // Look in the parent
745
746 while( nWhich )
747 {
748 switch( nWhich )
749 {
750 case FN_DRAW_WRAP_DLG:
751 case SID_ATTR_TRANSFORM:
752 case SID_FRAME_TO_TOP:
753 case SID_FRAME_TO_BOTTOM:
754 case FN_FRAME_UP:
755 case FN_FRAME_DOWN:
756 case SID_DELETE:
757 case FN_BACKSPACE:
758 if( bProtected || !rSh.IsObjSelected() )
759 rSet.DisableItem( nWhich );
760 break;
761 case SID_GROUP:
762 if ( rSh.IsObjSelected() < 2 || bProtected || !rSh.IsGroupAllowed() )
763 rSet.DisableItem( nWhich );
764 break;
765 case SID_UNGROUP:
766 if ( !rSh.IsGroupSelected(true) || bProtected || !rSh.IsUnGroupAllowed() )
767 rSet.DisableItem( nWhich );
768 break;
769 case SID_ENTER_GROUP:
770 if ( !rSh.IsGroupSelected(false) )
771 rSet.DisableItem( nWhich );
772 break;
773 case SID_LEAVE_GROUP:
774 if ( !pSdrView->IsGroupEntered() )
775 rSet.DisableItem( nWhich );
776 break;
777 case SID_OBJECT_ALIGN_LEFT:
778 case SID_OBJECT_ALIGN_CENTER:
779 case SID_OBJECT_ALIGN_RIGHT:
780 case SID_OBJECT_ALIGN_UP:
781 case SID_OBJECT_ALIGN_MIDDLE:
782 case SID_OBJECT_ALIGN_DOWN:
783 case SID_OBJECT_ALIGN:
784 {
785 bool bDisableThis = false;
786 bool bDisableHoriz = false;
787 bool bHoriz = (nWhich == SID_OBJECT_ALIGN_LEFT || nWhich == SID_OBJECT_ALIGN_CENTER ||
788 nWhich == SID_OBJECT_ALIGN_RIGHT);
789 bool bVert = (nWhich == SID_OBJECT_ALIGN_UP || nWhich == SID_OBJECT_ALIGN_MIDDLE ||
790 nWhich == SID_OBJECT_ALIGN_DOWN);
791 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
792 if ( !rSh.IsAlignPossible() || bProtected )
793 {
794 bDisableThis = true;
795 rSet.DisableItem( nWhich );
796 }
797 else if ( rSh.GetAnchorId() == RndStdIds::FLY_AS_CHAR )
798 {
799 //if only one object is selected it can only be vertically
800 // aligned because it is character bound
801 if( rMarkList.GetMarkCount() == 1 )
802 {
803 bDisableHoriz = true;
804 rSet.DisableItem(SID_OBJECT_ALIGN_LEFT);
805 rSet.DisableItem(SID_OBJECT_ALIGN_CENTER);
806 rSet.DisableItem(SID_OBJECT_ALIGN_RIGHT);
807 }
808 }
809
810 if (bHoriz && !bDisableThis && !bDisableHoriz &&
811 rMarkList.GetMarkCount() == 1)
812 {
813 sal_Int16 nHoriOrient = -1;
814 switch(nWhich)
815 {
816 case SID_OBJECT_ALIGN_LEFT:
817 nHoriOrient = text::HoriOrientation::LEFT;
818 break;
819 case SID_OBJECT_ALIGN_CENTER:
820 nHoriOrient = text::HoriOrientation::CENTER;
821 break;
822 case SID_OBJECT_ALIGN_RIGHT:
823 nHoriOrient = text::HoriOrientation::RIGHT;
824 break;
825 default:
826 break;
827 }
828
829 SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
830 SwFrameFormat* pFrameFormat = FindFrameFormat(pObj);
831 SwFormatHoriOrient aHOrient(pFrameFormat->GetFormatAttr(RES_HORI_ORIENT));
832 rSet.Put(SfxBoolItem(nWhich, aHOrient.GetHoriOrient() == nHoriOrient));
833 }
834
835 if (bVert && !bDisableThis && rMarkList.GetMarkCount() == 1)
836 {
837 sal_Int16 nVertOrient = -1;
838 switch(nWhich)
839 {
840 case SID_OBJECT_ALIGN_UP:
841 nVertOrient = text::VertOrientation::TOP;
842 break;
843 case SID_OBJECT_ALIGN_MIDDLE:
844 nVertOrient = text::VertOrientation::CENTER;
845 break;
846 case SID_OBJECT_ALIGN_DOWN:
847 nVertOrient = text::VertOrientation::BOTTOM;
848 break;
849 default:
850 break;
851 }
852
853 SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
854 SwFrameFormat* pFrameFormat = FindFrameFormat(pObj);
855 SwFormatVertOrient aVOrient(pFrameFormat->GetFormatAttr(RES_VERT_ORIENT));
856 rSet.Put(SfxBoolItem(nWhich, aVOrient.GetVertOrient() == nVertOrient));
857 }
858 }
859 break;
860
861 case FN_NAME_SHAPE :
862 {
863 if(1 != pSdrView->GetMarkedObjectCount())
864 {
865 rSet.DisableItem( nWhich );
866 }
867 }
868 break;
869
870 // #i68101#
872 {
873 const bool bIsWebView(nullptr != dynamic_cast<SwWebView*>(&GetView()));
874
875 if(!bIsWebView && 1 != pSdrView->GetMarkedObjectCount())
876 {
877 rSet.DisableItem( nWhich );
878 }
879 }
880 break;
881
882 case SID_OPEN_HYPERLINK:
883 case SID_EDIT_HYPERLINK:
884 case SID_HYPERLINK_DIALOG:
885 case SID_REMOVE_HYPERLINK:
886 case SID_COPY_HYPERLINK_LOCATION:
887 {
888 if (pSdrView->GetMarkedObjectCount() != 1)
889 {
890 rSet.DisableItem(nWhich);
891 break;
892 }
893
894 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
895 SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
896 SdrObjKind nObjType = pObj->GetObjIdentifier();
897
898 // Only enable hyperlink for the following types
899 switch (nObjType)
900 {
901 case SdrObjKind::PathFill:
902 case SdrObjKind::CircleSection:
903 case SdrObjKind::Line:
904 case SdrObjKind::CustomShape:
905 case SdrObjKind::Text:
906 case SdrObjKind::Rectangle:
907 case SdrObjKind::Caption:
908 case SdrObjKind::Polygon:
909 case SdrObjKind::PolyLine:
910 case SdrObjKind::E3D_Scene:
911 case SdrObjKind::Measure:
912 case SdrObjKind::Edge:
913 break;
914 default:
915 rSet.DisableItem(nWhich);
916 break;
917 }
918
919 if (nWhich == SID_OPEN_HYPERLINK || nWhich == SID_REMOVE_HYPERLINK
920 || nWhich == SID_EDIT_HYPERLINK || nWhich == SID_COPY_HYPERLINK_LOCATION)
921 {
922 if (pObj->getHyperlink().isEmpty())
923 rSet.DisableItem(nWhich);
924 }
925 }
926 break;
927
928 case SID_HYPERLINK_GETLINK:
929 {
930 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
931 if (rMarkList.GetMark(0) != nullptr)
932 {
933 SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
934 OUString sHyperLink = pObj->getHyperlink();
935 SvxHyperlinkItem aHLinkItem;
936 aHLinkItem.SetURL(sHyperLink);
937 rSet.Put(aHLinkItem);
938 }
939 }
940 break;
941
942 case SID_REGENERATE_DIAGRAM:
943 case SID_EDIT_DIAGRAM:
944 {
945 bool bDisable(true);
946 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
947 if (nullptr != rMarkList.GetMark(0))
948 {
949 SdrObject* pObj(rMarkList.GetMark(0)->GetMarkedSdrObj());
950
951 if(nullptr != pObj && pObj->isDiagram())
952 {
953 bDisable = false;
954 }
955 }
956
957 if(bDisable)
958 {
959 rSet.DisableItem(nWhich);
960 }
961 }
962 break;
963
964
965 }
966 nWhich = aIter.NextWhich();
967 }
968}
969
971{
972 SwWrtShell *pSh = &GetShell();
973 SdrView* pSdrView = pSh->GetDrawView();
974 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
975 if( rMarkList.GetMark(0) != nullptr )
976 {
977 SfxItemSet aNewAttr(pSdrView->GetGeoAttrFromMarked());
978 rSet.Put(aNewAttr,false);
979 }
980}
981
982bool SwDrawBaseShell::Disable(SfxItemSet& rSet, sal_uInt16 nWhich)
983{
985
986 if (bDisable)
987 {
988 if (nWhich)
989 rSet.DisableItem( nWhich );
990 else
991 {
992 SfxWhichIter aIter( rSet );
993 nWhich = aIter.FirstWhich();
994 while (nWhich)
995 {
996 rSet.DisableItem( nWhich );
997 nWhich = aIter.NextWhich();
998 }
999 }
1000 }
1001
1002 return bDisable;
1003}
1004
1006{
1007 SwWrtShell *pSh = &GetShell();
1008 SdrView* pSdrView = pSh->GetDrawView();
1009 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
1010 const size_t nMarkCount = rMarkList.GetMarkCount();
1011 bool bShowArea = true, bShowMeasure = true;
1012
1013 for (size_t i = 0; i < nMarkCount && i < 50; ++i)
1014 {
1015 SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
1016 SdrObjKind nObjType = pObj->GetObjIdentifier();
1017
1018 if ( nObjType != SdrObjKind::Measure )
1019 bShowMeasure = false;
1020
1021 // If marked object is 2D, disable format area command.
1022 if ( nObjType == SdrObjKind::PolyLine ||
1023 nObjType == SdrObjKind::Line ||
1024 nObjType == SdrObjKind::PathLine ||
1025 nObjType == SdrObjKind::FreehandLine ||
1026 nObjType == SdrObjKind::Edge ||
1027 nObjType == SdrObjKind::CircleArc ||
1028 bShowMeasure )
1029 bShowArea = false;
1030
1031 if (!bShowArea && !bShowMeasure)
1032 break;
1033 }
1034
1035 if (!bShowArea)
1036 rSet.DisableItem(SID_ATTRIBUTES_AREA);
1037
1038 if (!bShowMeasure)
1039 rSet.DisableItem(SID_MEASURE_DLG);
1040
1041 Disable(rSet);
1042
1043}
1044
1045// Validate of drawing positions
1046
1047IMPL_LINK(SwDrawBaseShell, ValidatePosition, SvxSwFrameValidation&, rValidation, void )
1048{
1049 SwWrtShell *pSh = &GetShell();
1050 rValidation.nMinHeight = MINFLY;
1051 rValidation.nMinWidth = MINFLY;
1052
1053 SwRect aBoundRect;
1054
1055 // OD 18.09.2003 #i18732# - adjustment for allowing vertical position
1056 // aligned to page for fly frame anchored to paragraph or to character.
1057 const RndStdIds eAnchorType = rValidation.nAnchorType;
1058 const SwFormatAnchor* pAnchor = nullptr;
1059 SdrView* pSdrView = pSh->GetDrawView();
1060 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
1061 if( rMarkList.GetMarkCount() == 1 )
1062 {
1063 SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
1064 SwFrameFormat* pFrameFormat = FindFrameFormat( pObj );
1065 pAnchor = &pFrameFormat->GetAnchor();
1066 }
1067
1068 pSh->CalcBoundRect( aBoundRect, eAnchorType,
1069 rValidation.nHRelOrient,
1070 rValidation.nVRelOrient,
1071 pAnchor,
1072 rValidation.bFollowTextFlow,
1073 rValidation.bMirror, nullptr, &rValidation.aPercentSize);
1074
1075 bool bIsInVertical( false );
1076 {
1077 bool bRTL;
1078 bool bVertL2R;
1079 bIsInVertical = pSh->IsFrameVertical(true, bRTL, bVertL2R);
1080 }
1081 if(bIsInVertical)
1082 {
1083 Point aPos(aBoundRect.Pos());
1084 tools::Long nTmp = aPos.X();
1085 aPos.setX( aPos.Y() );
1086 aPos.setY( nTmp );
1087 Size aSize(aBoundRect.SSize());
1088 nTmp = aSize.Width();
1089 aSize.setWidth( aSize.Height() );
1090 aSize.setHeight( nTmp );
1091 aBoundRect.Chg( aPos, aSize );
1092 //exchange width/height to enable correct values
1093 nTmp = rValidation.nWidth;
1094 rValidation.nWidth = rValidation.nHeight;
1095 rValidation.nHeight = nTmp;
1096 }
1097 if ((eAnchorType == RndStdIds::FLY_AT_PAGE) || (eAnchorType == RndStdIds::FLY_AT_FLY))
1098 {
1099 // MinimalPosition
1100 rValidation.nMinHPos = aBoundRect.Left();
1101 rValidation.nMinVPos = aBoundRect.Top();
1102 SwTwips nH = rValidation.nHPos;
1103 SwTwips nV = rValidation.nVPos;
1104
1105 if (rValidation.nHPos + rValidation.nWidth > aBoundRect.Right())
1106 {
1107 if (rValidation.nHoriOrient == text::HoriOrientation::NONE)
1108 {
1109 rValidation.nHPos -= ((rValidation.nHPos + rValidation.nWidth) - aBoundRect.Right());
1110 nH = rValidation.nHPos;
1111 }
1112 else
1113 rValidation.nWidth = aBoundRect.Right() - rValidation.nHPos;
1114 }
1115
1116 if (rValidation.nHPos + rValidation.nWidth > aBoundRect.Right())
1117 rValidation.nWidth = aBoundRect.Right() - rValidation.nHPos;
1118
1119 if (rValidation.nVPos + rValidation.nHeight > aBoundRect.Bottom())
1120 {
1121 if (rValidation.nVertOrient == text::VertOrientation::NONE)
1122 {
1123 rValidation.nVPos -= ((rValidation.nVPos + rValidation.nHeight) - aBoundRect.Bottom());
1124 nV = rValidation.nVPos;
1125 }
1126 else
1127 rValidation.nHeight = aBoundRect.Bottom() - rValidation.nVPos;
1128 }
1129
1130 if (rValidation.nVPos + rValidation.nHeight > aBoundRect.Bottom())
1131 rValidation.nHeight = aBoundRect.Bottom() - rValidation.nVPos;
1132
1133 if ( rValidation.nVertOrient != text::VertOrientation::NONE )
1134 nV = aBoundRect.Top();
1135
1136 if ( rValidation.nHoriOrient != text::HoriOrientation::NONE )
1137 nH = aBoundRect.Left();
1138
1139 rValidation.nMaxHPos = aBoundRect.Right() - rValidation.nWidth;
1140 rValidation.nMaxHeight = aBoundRect.Bottom() - nV;
1141
1142 rValidation.nMaxVPos = aBoundRect.Bottom() - rValidation.nHeight;
1143 rValidation.nMaxWidth = aBoundRect.Right() - nH;
1144 }
1145 else if ((eAnchorType == RndStdIds::FLY_AT_PARA) || (eAnchorType == RndStdIds::FLY_AT_CHAR))
1146 {
1147 if (rValidation.nHPos + rValidation.nWidth > aBoundRect.Right())
1148 {
1149 if (rValidation.nHoriOrient == text::HoriOrientation::NONE)
1150 {
1151 rValidation.nHPos -= ((rValidation.nHPos + rValidation.nWidth) - aBoundRect.Right());
1152 }
1153 else
1154 rValidation.nWidth = aBoundRect.Right() - rValidation.nHPos;
1155 }
1156
1157 // OD 29.09.2003 #i17567#, #i18732# - consider following the text flow
1158 // and alignment at page areas.
1159 const bool bMaxVPosAtBottom = !rValidation.bFollowTextFlow ||
1160 rValidation.nVRelOrient == text::RelOrientation::PAGE_FRAME ||
1161 rValidation.nVRelOrient == text::RelOrientation::PAGE_PRINT_AREA ||
1162 rValidation.nVRelOrient == text::RelOrientation::PAGE_PRINT_AREA_BOTTOM;
1163 {
1164 SwTwips nTmpMaxVPos = ( bMaxVPosAtBottom
1165 ? aBoundRect.Bottom()
1166 : aBoundRect.Height() ) -
1167 rValidation.nHeight;
1168 if ( rValidation.nVPos > nTmpMaxVPos )
1169 {
1170 if (rValidation.nVertOrient == text::VertOrientation::NONE)
1171 {
1172 rValidation.nVPos = nTmpMaxVPos;
1173 }
1174 else
1175 {
1176 rValidation.nHeight = ( bMaxVPosAtBottom
1177 ? aBoundRect.Bottom()
1178 : aBoundRect.Height() ) - rValidation.nVPos;
1179 }
1180 }
1181 }
1182
1183 rValidation.nMinHPos = aBoundRect.Left();
1184 rValidation.nMaxHPos = aBoundRect.Right() - rValidation.nWidth;
1185
1186 rValidation.nMinVPos = aBoundRect.Top();
1187 // OD 26.09.2003 #i17567#, #i18732# - determine maximum vertical position
1188 if ( bMaxVPosAtBottom )
1189 {
1190 rValidation.nMaxVPos = aBoundRect.Bottom() - rValidation.nHeight;
1191 }
1192 else
1193 {
1194 rValidation.nMaxVPos = aBoundRect.Height() - rValidation.nHeight;
1195 }
1196
1197 // Maximum width height
1198 const SwTwips nH = ( rValidation.nHoriOrient != text::HoriOrientation::NONE )
1199 ? aBoundRect.Left()
1200 : rValidation.nHPos;
1201 const SwTwips nV = ( rValidation.nVertOrient != text::VertOrientation::NONE )
1202 ? aBoundRect.Top()
1203 : rValidation.nVPos;
1204 rValidation.nMaxHeight = rValidation.nMaxVPos + rValidation.nHeight - nV;
1205 rValidation.nMaxWidth = rValidation.nMaxHPos + rValidation.nWidth - nH;
1206 }
1207 else if (eAnchorType == RndStdIds::FLY_AS_CHAR)
1208 {
1209 rValidation.nMinHPos = 0;
1210 rValidation.nMaxHPos = 0;
1211
1212 rValidation.nMaxHeight = aBoundRect.Height();
1213 rValidation.nMaxWidth = aBoundRect.Width();
1214
1215 rValidation.nMaxVPos = aBoundRect.Height();
1216 rValidation.nMinVPos = -aBoundRect.Height() + rValidation.nHeight;
1217 if (rValidation.nMaxVPos < rValidation.nMinVPos)
1218 {
1219 rValidation.nMinVPos = rValidation.nMaxVPos;
1220 rValidation.nMaxVPos = -aBoundRect.Height();
1221 }
1222 }
1223 if(bIsInVertical)
1224 {
1225 //restore width/height exchange
1226 tools::Long nTmp = rValidation.nWidth;
1227 rValidation.nWidth = rValidation.nHeight;
1228 rValidation.nHeight = nTmp;
1229 }
1230
1231 if (rValidation.nMaxWidth < rValidation.nWidth)
1232 rValidation.nWidth = rValidation.nMaxWidth;
1233 if (rValidation.nMaxHeight < rValidation.nHeight)
1234 rValidation.nHeight = rValidation.nMaxHeight;
1235}
1236
1237/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SvxAnchorIds
sal_Int32 GetValue() const
virtual const SwDrawModel * GetDrawModel() const =0
Draw Model and id accessors.
constexpr tools::Long Y() const
void setX(tools::Long nX)
void setY(tools::Long nY)
constexpr tools::Long X() const
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 SetDecorative(bool isDecorative)
virtual void SetName(const OUString &rStr, const bool bSetChanged=true)
virtual bool IsDecorative() const
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< AbstractSvxObjectTitleDescDialog > CreateSvxObjectTitleDescDialog(weld::Window *pParent, const OUString &rTitle, const OUString &rDescription, bool isDecorative)=0
virtual VclPtr< AbstractSvxTransformTabDialog > CreateSvxTransformTabDialog(weld::Window *pParent, const SfxItemSet *pAttr, const SdrView *pView, SvxAnchorIds nAnchorTypes=SvxAnchorIds::NONE)=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:3001
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:735
void Execute(SfxRequest const &)
Definition: drwbassh.cxx:98
SwDrawBaseShell(SwView &rShell)
Definition: drwbassh.cxx:76
void DisableState(SfxItemSet &rSet)
Definition: drwbassh.cxx:1005
bool Disable(SfxItemSet &rSet, sal_uInt16 nWhich=0)
Definition: drwbassh.cxx:982
void GetDrawAttrStateForIFBX(SfxItemSet &rSet)
Definition: drwbassh.cxx:970
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:742
void SetBezierMode(sal_uInt16 eBezMode)
Definition: edtwin.hxx:222
void SelectionToHell()
Below document.
Definition: feshview.cxx:1120
void SetObjAttr(const SfxItemSet &rSet)
Definition: feshview.cxx:2672
FlyProtectFlags IsSelObjProtected(FlyProtectFlags eType) const
Which Protection is set at selected object?
Definition: feshview.cxx:2581
RndStdIds GetAnchorId() const
Anchor type of selected object, RndStdIds::UNKNOWN if ambiguous or in case of frame selection.
Definition: feshview.cxx:2209
void SelectionToHeaven()
Above document.
Definition: feshview.cxx:1115
void GroupSelection()
Afterwards the group is selected.
Definition: feshview.cxx:2450
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:928
void SelectionToBottom(bool bBottom=true)
Definition: feshview.cxx:997
void ChgAnchor(RndStdIds eAnchorId, bool bSameOnly=false, bool bPosCorr=true)
frmatr.hxx.
Definition: feshview.cxx:2239
void DelSelectedObj()
Definition: feshview.cxx:2257
bool GetObjAttr(SfxItemSet &rSet) const
Attention: Ambiguities if multiple selections.
Definition: feshview.cxx:2649
bool IsGroupSelected(bool bAllowDiagams)
Create and destroy group, don't when frame is selected.
Definition: feshview.cxx:2318
void SetDragMode(SdrDragMode eSdrDragMode)
Set DragMode (e.g. Rotate), but do nothing when frame is selected.
Definition: feshview.cxx:675
SdrLayerID GetLayerId() const
1 Heaven, 0 Hell, SDRLAYER_NOTFOUND Ambiguous.
Definition: feshview.cxx:1049
SwRect GetObjRect() const
For adjustment of PosAttr when anchor changes.
Definition: fefly1.cxx:1298
bool IsUnGroupAllowed() const
Definition: feshview.cxx:2433
size_t IsObjSelected() const
Definition: feshview.cxx:1125
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:2465
bool IsAlignPossible() const
Definition: feshview.cxx:2698
bool IsGroupAllowed() const
Definition: feshview.cxx:2373
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:4382
static void CreateSelection(SwWrtShell &rSh, const SwFrameShell *pCreator=nullptr)
Definition: swdtflvr.cxx:4370
SdrView * GetDrawViewWithValidMarkList()
Definition: vnew.cxx:391
const IDocumentDrawModelAccess & getIDocumentDrawModelAccess() const
Provides access to the document draw model interface.
Definition: viewsh.cxx:2823
SdrView * GetDrawView()
Definition: vnew.cxx:386
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:1193
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:704
@ 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:254
tools::Long SwTwips
Definition: swtypes.hxx:51
#define MINFLY
Definition: swtypes.hxx:61
SW_DLLPUBLIC FieldUnit GetDfltMetric(bool bWeb)
Definition: uitool.cxx:756
RET_OK
sal_uInt16 GetHtmlMode(const SwDocShell *pShell)
Definition: viewopt.cxx:415
void LoadURL(SwViewShell &rVSh, const OUString &rURL, LoadUrlFlags nFilter, const OUString &rTargetFrameName)
Definition: wrtsh2.cxx:555