LibreOffice Module sd (master) 1
fuconrec.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 <fuconrec.hxx>
21#include <svx/svdpagv.hxx>
22
23#include <svx/svxids.hrc>
24#include <svx/strings.hrc>
25#include <svx/dialmgr.hxx>
26
27#include <app.hrc>
28#include <svl/itemset.hxx>
30#include <svx/xlineit0.hxx>
31#include <svx/xlnstwit.hxx>
32#include <svx/xlnedwit.hxx>
33#include <svx/xlnedit.hxx>
34#include <svx/xlnstit.hxx>
35#include <svx/xlnwtit.hxx>
36#include <sfx2/viewfrm.hxx>
37#include <svx/sdtmfitm.hxx>
38#include <svx/sxekitm.hxx>
39#include <svx/sderitm.hxx>
40#include <sfx2/dispatch.hxx>
41#include <svx/svdopath.hxx>
42#include <svx/svdocirc.hxx>
43#include <svl/intitem.hxx>
44#include <sfx2/request.hxx>
46#include <editeng/eeitem.hxx>
47#include <svx/xtable.hxx>
48#include <svx/xfltrit.hxx>
49#include <svx/xflclit.hxx>
50#include <svx/sdtagitm.hxx>
51#include <svx/sdtditm.hxx>
52
53#include <svx/svdocapt.hxx>
54
55#include <svx/svdomeas.hxx>
56#include <ViewShell.hxx>
57#include <ViewShellBase.hxx>
58#include <ToolBarManager.hxx>
62#include <svx/xfillit0.hxx>
64#include <osl/diagnose.h>
65
66#include <sdresid.hxx>
67#include <View.hxx>
68#include <sdpage.hxx>
69#include <Window.hxx>
70#include <drawdoc.hxx>
71#include <unokywds.hxx>
72
73#include <strings.hrc>
74
75using namespace com::sun::star;
76
77namespace sd {
78
79
81 ViewShell* pViewSh,
82 ::sd::Window* pWin,
83 ::sd::View* pView,
84 SdDrawDocument* pDoc,
85 SfxRequest& rReq)
86 : FuConstruct(pViewSh, pWin, pView, pDoc, rReq)
87 , mnFillTransparence(0)
88 , mnLineStyle(SAL_MAX_UINT16)
89{
90}
91
92namespace{
93
96bool isSticky(const SfxRequest& rReq)
97{
98 const SfxItemSet *pArgs = rReq.GetArgs ();
99 if (pArgs)
100 {
101 const SfxBoolItem* pIsSticky = rReq.GetArg<SfxBoolItem>(FN_PARAM_4);
102 if (pIsSticky && pIsSticky->GetValue())
103 return true;
104 }
105
106 return false;
107}
108
109}
110
112{
114 rtl::Reference<FuPoor> xFunc( pFunc = new FuConstructRectangle( pViewSh, pWin, pView, pDoc, rReq ) );
115 xFunc->DoExecute(rReq);
116 pFunc->SetPermanent(bPermanent || isSticky(rReq));
117 return xFunc;
118}
119
121{
123
127
128 const SfxItemSet *pArgs = rReq.GetArgs ();
129
130 if (pArgs)
131 {
132 switch (nSlotId)
133 {
134 case SID_DRAW_ELLIPSE :
135 {
136 const SfxUInt32Item* pCenterX = rReq.GetArg<SfxUInt32Item>(ID_VAL_CENTER_X);
137 const SfxUInt32Item* pCenterY = rReq.GetArg<SfxUInt32Item>(ID_VAL_CENTER_Y);
138 const SfxUInt32Item* pAxisX = rReq.GetArg<SfxUInt32Item>(ID_VAL_AXIS_X);
139 const SfxUInt32Item* pAxisY = rReq.GetArg<SfxUInt32Item>(ID_VAL_AXIS_Y);
140
141 if (!pCenterX || !pCenterY || !pAxisX || !pAxisY)
142 break;
143
144 ::tools::Rectangle aNewRectangle (pCenterX->GetValue () - pAxisX->GetValue () / 2,
145 pCenterY->GetValue () - pAxisY->GetValue () / 2,
146 pCenterX->GetValue () + pAxisX->GetValue () / 2,
147 pCenterY->GetValue () + pAxisY->GetValue () / 2);
148 rtl::Reference<SdrCircObj> pNewCircle = new SdrCircObj(
150 SdrCircKind::Full,
151 aNewRectangle);
153
154 mpView->InsertObjectAtView(pNewCircle.get(), *pPV, SdrInsertFlags::SETDEFLAYER | SdrInsertFlags::SETDEFATTR);
155 }
156 break;
157
158 case SID_DRAW_RECT :
159 {
160 const SfxUInt32Item* pMouseStartX = rReq.GetArg<SfxUInt32Item>(ID_VAL_MOUSESTART_X);
161 const SfxUInt32Item* pMouseStartY = rReq.GetArg<SfxUInt32Item>(ID_VAL_MOUSESTART_Y);
162 const SfxUInt32Item* pMouseEndX = rReq.GetArg<SfxUInt32Item>(ID_VAL_MOUSEEND_X);
163 const SfxUInt32Item* pMouseEndY = rReq.GetArg<SfxUInt32Item>(ID_VAL_MOUSEEND_Y);
164 const SfxUInt16Item* pFillTransparence = rReq.GetArg<SfxUInt16Item>(FN_PARAM_1);
165 const SfxStringItem* pFillColor = rReq.GetArg<SfxStringItem>(FN_PARAM_2);
166 const SfxUInt16Item* pLineStyle = rReq.GetArg<SfxUInt16Item>(FN_PARAM_3);
167 const SfxStringItem* pShapeName = rReq.GetArg<SfxStringItem>(SID_SHAPE_NAME);
168
169 if (pFillTransparence && pFillTransparence->GetValue() > 0)
170 {
171 mnFillTransparence = pFillTransparence->GetValue();
172 }
173 if (pFillColor && !pFillColor->GetValue().isEmpty())
174 {
175 msFillColor = pFillColor->GetValue();
176 }
177 if (pLineStyle)
178 {
179 mnLineStyle = pLineStyle->GetValue();
180 }
181 if (pShapeName && !pShapeName->GetValue().isEmpty())
182 {
183 msShapeName = pShapeName->GetValue();
184 }
185
186 if (!pMouseStartX || !pMouseStartY || !pMouseEndX || !pMouseEndY)
187 break;
188
189 ::tools::Rectangle aNewRectangle (pMouseStartX->GetValue (),
190 pMouseStartY->GetValue (),
191 pMouseEndX->GetValue (),
192 pMouseEndY->GetValue ());
195 aNewRectangle);
197
198 mpView->InsertObjectAtView(pNewRect.get(), *pPV, SdrInsertFlags::SETDEFLAYER | SdrInsertFlags::SETDEFATTR);
199 }
200 break;
201 }
202 }
203
204 if (nSlotId == SID_TOOL_CONNECTOR ||
205 nSlotId == SID_CONNECTOR_ARROW_START ||
206 nSlotId == SID_CONNECTOR_ARROW_END ||
207 nSlotId == SID_CONNECTOR_ARROWS ||
208 nSlotId == SID_CONNECTOR_CIRCLE_START ||
209 nSlotId == SID_CONNECTOR_CIRCLE_END ||
210 nSlotId == SID_CONNECTOR_CIRCLES ||
211 nSlotId == SID_CONNECTOR_LINE ||
212 nSlotId == SID_CONNECTOR_LINE_ARROW_START ||
213 nSlotId == SID_CONNECTOR_LINE_ARROW_END ||
214 nSlotId == SID_CONNECTOR_LINE_ARROWS ||
215 nSlotId == SID_CONNECTOR_LINE_CIRCLE_START ||
216 nSlotId == SID_CONNECTOR_LINE_CIRCLE_END ||
217 nSlotId == SID_CONNECTOR_LINE_CIRCLES ||
218 nSlotId == SID_CONNECTOR_CURVE ||
219 nSlotId == SID_CONNECTOR_CURVE_ARROW_START ||
220 nSlotId == SID_CONNECTOR_CURVE_ARROW_END ||
221 nSlotId == SID_CONNECTOR_CURVE_ARROWS ||
222 nSlotId == SID_CONNECTOR_CURVE_CIRCLE_START ||
223 nSlotId == SID_CONNECTOR_CURVE_CIRCLE_END ||
224 nSlotId == SID_CONNECTOR_CURVE_CIRCLES ||
225 nSlotId == SID_CONNECTOR_LINES ||
226 nSlotId == SID_CONNECTOR_LINES_ARROW_START ||
227 nSlotId == SID_CONNECTOR_LINES_ARROW_END ||
228 nSlotId == SID_CONNECTOR_LINES_ARROWS ||
229 nSlotId == SID_CONNECTOR_LINES_CIRCLE_START ||
230 nSlotId == SID_CONNECTOR_LINES_CIRCLE_END ||
231 nSlotId == SID_CONNECTOR_LINES_CIRCLES ||
232 nSlotId == SID_LINE_ARROW_START ||
233 nSlotId == SID_LINE_ARROW_END ||
234 nSlotId == SID_LINE_ARROWS ||
235 nSlotId == SID_LINE_ARROW_CIRCLE ||
236 nSlotId == SID_LINE_CIRCLE_ARROW ||
237 nSlotId == SID_LINE_ARROW_SQUARE ||
238 nSlotId == SID_LINE_SQUARE_ARROW )
239 {
240 mpView->UnmarkAll();
241 }
242}
243
245{
246 bool bReturn = FuConstruct::MouseButtonDown(rMEvt);
247
248 if ( rMEvt.IsLeft() && !mpView->IsAction() )
249 {
250 Point aPnt( mpWindow->PixelToLogic( rMEvt.GetPosPixel() ) );
251
252 mpWindow->CaptureMouse();
253 sal_uInt16 nDrgLog = sal_uInt16 ( mpWindow->PixelToLogic(Size(mpView->GetDragThresholdPixels(),0)).Width() );
254
255 if (mpView->GetCurrentObjIdentifier() == SdrObjKind::Caption)
256 {
257 Size aCaptionSize(846, 846); // (4x2)cm
258 bReturn = mpView->BegCreateCaptionObj(aPnt, aCaptionSize,
259 nullptr, nDrgLog);
260 }
261 else
262 {
263 mpView->BegCreateObj(aPnt, nullptr, nDrgLog);
264 }
265
266 SdrObject* pObj = mpView->GetCreateObj();
267
268 if (pObj)
269 {
270 SfxItemSet aAttr(mpDoc->GetPool());
271 SetStyleSheet(aAttr, pObj);
272 SetAttributes(aAttr, pObj);
273 SetLineEnds(aAttr, *pObj);
274 pObj->SetMergedItemSet(aAttr);
275
276 if( nSlotId == SID_DRAW_CAPTION_VERTICAL )
277 static_cast<SdrTextObj*>(pObj)->SetVerticalWriting( true );
278 }
279 }
280 return bReturn;
281}
282
284{
286 return false;
287
288 bool bReturn(false);
289
290 if(mpView->IsCreateObj() && rMEvt.IsLeft())
291 {
292 SdrObject* pObj = mpView->GetCreateObj();
293
294 if(pObj && mpView->EndCreateObj(SdrCreateCmd::ForceEnd))
295 {
296 if(SID_DRAW_MEASURELINE == nSlotId)
297 {
298 SdrLayerAdmin& rAdmin = mpDoc->GetLayerAdmin();
300 }
301
302 // init text position when vertical caption object is created
303 if( dynamic_cast< const SdrCaptionObj *>( pObj ) != nullptr && SID_DRAW_CAPTION_VERTICAL == nSlotId)
304 {
305 // draw text object, needs to be initialized when vertical text is used
306 SfxItemSet aSet(pObj->GetMergedItemSet());
307
310
311 // Correct the value of SDRATTR_TEXTDIRECTION to avoid SetItemSet
312 // calling SetVerticalWriting() again since this item may not yet
313 // be set at the object and thus may differ from vertical state of
314 // the object.
315 aSet.Put(SvxWritingModeItem(css::text::WritingMode_TB_RL, SDRATTR_TEXTDIRECTION));
316 pObj->SetMergedItemSet(aSet);
317 }
318
319 bReturn = true;
320 }
321 else
322 {
323 //Drag was too small to create object, so insert default object at click pos
324 Point aClickPos(mpWindow->PixelToLogic(rMEvt.GetPosPixel()));
325 sal_uInt32 nDefaultObjectSize(1500);
326 sal_Int32 nCenterOffset(-sal_Int32(nDefaultObjectSize / 2));
327 aClickPos.AdjustX(nCenterOffset);
328 aClickPos.AdjustY(nCenterOffset);
329
331 if(mpView->IsSnapEnabled())
332 aClickPos = mpView->GetSnapPos(aClickPos, pPV);
333
334 ::tools::Rectangle aNewObjectRectangle(aClickPos, Size(nDefaultObjectSize, nDefaultObjectSize));
335 rtl::Reference<SdrObject> pObjDefault = CreateDefaultObject(nSlotId, aNewObjectRectangle);
336
337 bReturn = mpView->InsertObjectAtView(pObjDefault.get(), *pPV);
338 }
339 }
340
341 bReturn = FuConstruct::MouseButtonUp (rMEvt) || bReturn;
342
343 if (!bPermanent)
344 mpViewShell->GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SfxCallMode::ASYNCHRON);
345
346 return bReturn;
347}
348
350{
351 SdrObjKind aObjKind;
352
353 switch (nSlotId)
354 {
355 case SID_LINE_ARROW_START:
356 case SID_LINE_ARROW_END:
357 case SID_LINE_ARROWS:
358 case SID_LINE_ARROW_CIRCLE:
359 case SID_LINE_CIRCLE_ARROW:
360 case SID_LINE_ARROW_SQUARE:
361 case SID_LINE_SQUARE_ARROW:
363 [[fallthrough]];
364 case SID_DRAW_LINE :
365 case SID_DRAW_XLINE:
366 aObjKind = SdrObjKind::Line;
367 break;
368
369 case SID_DRAW_MEASURELINE:
370 {
371 aObjKind = SdrObjKind::Measure;
372 }
373 break;
374
375 case SID_DRAW_RECT :
376 case SID_DRAW_RECT_NOFILL :
377 case SID_DRAW_RECT_ROUND :
378 case SID_DRAW_RECT_ROUND_NOFILL:
379 case SID_DRAW_SQUARE :
380 case SID_DRAW_SQUARE_NOFILL :
381 case SID_DRAW_SQUARE_ROUND :
382 case SID_DRAW_SQUARE_ROUND_NOFILL:
383 {
384 aObjKind = SdrObjKind::Rectangle;
385 }
386 break;
387
388 case SID_DRAW_ELLIPSE :
389 case SID_DRAW_ELLIPSE_NOFILL:
390 case SID_DRAW_CIRCLE :
391 case SID_DRAW_CIRCLE_NOFILL :
392 {
393 aObjKind = SdrObjKind::CircleOrEllipse;
394 }
395 break;
396
397 case SID_DRAW_CAPTION:
398 case SID_DRAW_CAPTION_VERTICAL:
399 {
400 aObjKind = SdrObjKind::Caption;
401 }
402 break;
403
404 case SID_TOOL_CONNECTOR:
405 case SID_CONNECTOR_ARROW_START:
406 case SID_CONNECTOR_ARROW_END:
407 case SID_CONNECTOR_ARROWS:
408 case SID_CONNECTOR_CIRCLE_START:
409 case SID_CONNECTOR_CIRCLE_END:
410 case SID_CONNECTOR_CIRCLES:
411 case SID_CONNECTOR_LINE:
412 case SID_CONNECTOR_LINE_ARROW_START:
413 case SID_CONNECTOR_LINE_ARROW_END:
414 case SID_CONNECTOR_LINE_ARROWS:
415 case SID_CONNECTOR_LINE_CIRCLE_START:
416 case SID_CONNECTOR_LINE_CIRCLE_END:
417 case SID_CONNECTOR_LINE_CIRCLES:
418 case SID_CONNECTOR_CURVE:
419 case SID_CONNECTOR_CURVE_ARROW_START:
420 case SID_CONNECTOR_CURVE_ARROW_END:
421 case SID_CONNECTOR_CURVE_ARROWS:
422 case SID_CONNECTOR_CURVE_CIRCLE_START:
423 case SID_CONNECTOR_CURVE_CIRCLE_END:
424 case SID_CONNECTOR_CURVE_CIRCLES:
425 case SID_CONNECTOR_LINES:
426 case SID_CONNECTOR_LINES_ARROW_START:
427 case SID_CONNECTOR_LINES_ARROW_END:
428 case SID_CONNECTOR_LINES_ARROWS:
429 case SID_CONNECTOR_LINES_CIRCLE_START:
430 case SID_CONNECTOR_LINES_CIRCLE_END:
431 case SID_CONNECTOR_LINES_CIRCLES:
432 {
433 aObjKind = SdrObjKind::Edge;
435 }
436 break;
437 case SID_INSERT_SIGNATURELINE:
438 {
439 aObjKind = SdrObjKind::Graphic;
440 }
441 break;
442
443 default:
444 {
445 aObjKind = SdrObjKind::Rectangle;
446 }
447 break;
448 }
449
450 mpView->SetCurrentObj(aObjKind);
451
453}
454
456{
457 if( nSlotId == SID_TOOL_CONNECTOR ||
458 nSlotId == SID_CONNECTOR_ARROW_START ||
459 nSlotId == SID_CONNECTOR_ARROW_END ||
460 nSlotId == SID_CONNECTOR_ARROWS ||
461 nSlotId == SID_CONNECTOR_CIRCLE_START ||
462 nSlotId == SID_CONNECTOR_CIRCLE_END ||
463 nSlotId == SID_CONNECTOR_CIRCLES ||
464 nSlotId == SID_CONNECTOR_LINE ||
465 nSlotId == SID_CONNECTOR_LINE_ARROW_START ||
466 nSlotId == SID_CONNECTOR_LINE_ARROW_END ||
467 nSlotId == SID_CONNECTOR_LINE_ARROWS ||
468 nSlotId == SID_CONNECTOR_LINE_CIRCLE_START ||
469 nSlotId == SID_CONNECTOR_LINE_CIRCLE_END ||
470 nSlotId == SID_CONNECTOR_LINE_CIRCLES ||
471 nSlotId == SID_CONNECTOR_CURVE ||
472 nSlotId == SID_CONNECTOR_CURVE_ARROW_START ||
473 nSlotId == SID_CONNECTOR_CURVE_ARROW_END ||
474 nSlotId == SID_CONNECTOR_CURVE_ARROWS ||
475 nSlotId == SID_CONNECTOR_CURVE_CIRCLE_START ||
476 nSlotId == SID_CONNECTOR_CURVE_CIRCLE_END ||
477 nSlotId == SID_CONNECTOR_CURVE_CIRCLES ||
478 nSlotId == SID_CONNECTOR_LINES ||
479 nSlotId == SID_CONNECTOR_LINES_ARROW_START ||
480 nSlotId == SID_CONNECTOR_LINES_ARROW_END ||
481 nSlotId == SID_CONNECTOR_LINES_ARROWS ||
482 nSlotId == SID_CONNECTOR_LINES_CIRCLE_START ||
483 nSlotId == SID_CONNECTOR_LINES_CIRCLE_END ||
484 nSlotId == SID_CONNECTOR_LINES_CIRCLES ||
485 nSlotId == SID_LINE_ARROW_START ||
486 nSlotId == SID_LINE_ARROW_END ||
487 nSlotId == SID_LINE_ARROWS ||
488 nSlotId == SID_LINE_ARROW_CIRCLE ||
489 nSlotId == SID_LINE_CIRCLE_ARROW ||
490 nSlotId == SID_LINE_ARROW_SQUARE ||
491 nSlotId == SID_LINE_SQUARE_ARROW )
492 {
493 mpView->SetGlueVisible( false );
494 }
496
497 if (nSlotId != SID_INSERT_SIGNATURELINE)
498 {
499 return;
500 }
501
502 const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
503 if (rMarkList.GetMarkCount() < 1)
504 {
505 // Just switching pages, no signature rectangle yet.
506 return;
507 }
508
509 // Finished drawing a signature rectangle, now set it up.
510 if (!mpViewShell)
511 {
512 return;
513 }
514
515 uno::Reference<security::XCertificate> xCertificate
518 if (!xCertificate.is())
519 {
520 return;
521 }
522
524
525 // Update infobar to offer "finish signing".
527 if (pFrame && pFrame->HasInfoBarWithID(u"readonly"))
528 {
529 pFrame->RemoveInfoBar(u"readonly");
530 pFrame->AppendReadOnlyInfobar();
531 }
532}
533
534namespace {
537Color strToColor(std::u16string_view sColor)
538{
539 Color aColor = COL_AUTO;
540
541 if (sColor == u"COL_GRAY")
542 aColor = COL_GRAY;
543 else if (sColor == u"COL_GRAY3")
544 aColor = COL_GRAY3;
545 else if (sColor == u"COL_GRAY7")
546 aColor = COL_GRAY7;
547
548 return aColor;
549}
550}
551
556{
557 if (nSlotId == SID_DRAW_RECT_ROUND ||
558 nSlotId == SID_DRAW_RECT_ROUND_NOFILL ||
559 nSlotId == SID_DRAW_SQUARE_ROUND ||
560 nSlotId == SID_DRAW_SQUARE_ROUND_NOFILL)
561 {
562 // round corner
563 rAttr.Put(makeSdrEckenradiusItem(500));
564 }
565 else if (nSlotId == SID_CONNECTOR_LINE ||
566 nSlotId == SID_CONNECTOR_LINE_ARROW_START ||
567 nSlotId == SID_CONNECTOR_LINE_ARROW_END ||
568 nSlotId == SID_CONNECTOR_LINE_ARROWS ||
569 nSlotId == SID_CONNECTOR_LINE_CIRCLE_START ||
570 nSlotId == SID_CONNECTOR_LINE_CIRCLE_END ||
571 nSlotId == SID_CONNECTOR_LINE_CIRCLES)
572 {
573 // direct connector
574 rAttr.Put(SdrEdgeKindItem(SdrEdgeKind::OneLine));
575 }
576 else if (nSlotId == SID_CONNECTOR_LINES ||
577 nSlotId == SID_CONNECTOR_LINES_ARROW_START ||
578 nSlotId == SID_CONNECTOR_LINES_ARROW_END ||
579 nSlotId == SID_CONNECTOR_LINES_ARROWS ||
580 nSlotId == SID_CONNECTOR_LINES_CIRCLE_START ||
581 nSlotId == SID_CONNECTOR_LINES_CIRCLE_END ||
582 nSlotId == SID_CONNECTOR_LINES_CIRCLES)
583 {
584 // line connector
585 rAttr.Put(SdrEdgeKindItem(SdrEdgeKind::ThreeLines));
586 }
587 else if (nSlotId == SID_CONNECTOR_CURVE ||
588 nSlotId == SID_CONNECTOR_CURVE_ARROW_START ||
589 nSlotId == SID_CONNECTOR_CURVE_ARROW_END ||
590 nSlotId == SID_CONNECTOR_CURVE_ARROWS ||
591 nSlotId == SID_CONNECTOR_CURVE_CIRCLE_START ||
592 nSlotId == SID_CONNECTOR_CURVE_CIRCLE_END ||
593 nSlotId == SID_CONNECTOR_CURVE_CIRCLES)
594 {
595 // curve connector
596 rAttr.Put(SdrEdgeKindItem(SdrEdgeKind::Bezier));
597 }
598 else if ( nSlotId == SID_DRAW_CAPTION || nSlotId == SID_DRAW_CAPTION_VERTICAL )
599 {
600 // legend object
601 Size aSize(pObj->GetLogicRect().GetSize());
602 rAttr.Put( makeSdrTextMinFrameHeightItem( aSize.Height() ) );
603 rAttr.Put( makeSdrTextMinFrameWidthItem( aSize.Width() ) );
604 rAttr.Put( makeSdrTextAutoGrowHeightItem( true ) );
605 rAttr.Put( makeSdrTextAutoGrowWidthItem( true ) );
606
607 // Support full with for vertical caption objects, too
608 if(SID_DRAW_CAPTION == nSlotId)
610 else
612
613 rAttr.Put( SvxAdjustItem( SvxAdjust::Center, EE_PARA_JUST ) );
614 rAttr.Put( makeSdrTextLeftDistItem( 100 ) );
615 rAttr.Put( makeSdrTextRightDistItem( 100 ) );
616 rAttr.Put( makeSdrTextUpperDistItem( 100 ) );
617 rAttr.Put( makeSdrTextLowerDistItem( 100 ) );
618 }
619 else if (nSlotId == SID_DRAW_MEASURELINE)
620 {
621 // dimension line
622 SdPage* pPage = static_cast<SdPage*>( mpView->GetSdrPageView()->GetPage() );
623 OUString aName(SdResId(STR_POOLSHEET_MEASURE));
624 SfxStyleSheet* pSheet(
625 static_cast< SfxStyleSheet* >(
626 pPage->getSdrModelFromSdrPage().GetStyleSheetPool()->Find(aName, SfxStyleFamily::Para)));
627 DBG_ASSERT(pSheet, "StyleSheet missing");
628
629 if (pSheet)
630 {
631 pObj->SetStyleSheet(pSheet, false);
632 }
633
634 SdrLayerAdmin& rAdmin = mpDoc->GetLayerAdmin();
636 }
637 else if (nSlotId == SID_DRAW_RECT)
638 {
639 if (mnFillTransparence > 0 && mnFillTransparence <= 100)
641 if (!msFillColor.isEmpty())
642 rAttr.Put(XFillColorItem(OUString(), strToColor(msFillColor)));
643 if (!msShapeName.isEmpty())
644 pObj->SetName(msShapeName);
645
646 switch(mnLineStyle)
647 {
648 case 0:
649 rAttr.Put( XLineStyleItem(css::drawing::LineStyle_NONE ) );
650 break;
651 case 1:
652 rAttr.Put( XLineStyleItem(css::drawing::LineStyle_SOLID ) );
653 break;
654 case 2:
655 rAttr.Put( XLineStyleItem(css::drawing::LineStyle_DASH ) );
656 break;
657 default:
658 // Leave it to the defaults
659 break;
660 }
661 }
662 else if (nSlotId == SID_INSERT_SIGNATURELINE)
663 {
664 // Avoid the default solid fill and line, we'll set a graphic instead.
665 rAttr.Put(XFillStyleItem(drawing::FillStyle_NONE));
666 rAttr.Put(XLineStyleItem(drawing::LineStyle_NONE));
667 }
668}
669
674{
675 if ( !((rObj.GetObjIdentifier() == SdrObjKind::Edge &&
676 nSlotId != SID_TOOL_CONNECTOR &&
677 nSlotId != SID_CONNECTOR_LINE &&
678 nSlotId != SID_CONNECTOR_LINES &&
679 nSlotId != SID_CONNECTOR_CURVE) ||
680 nSlotId == SID_LINE_ARROW_START ||
681 nSlotId == SID_LINE_ARROW_END ||
682 nSlotId == SID_LINE_ARROWS ||
683 nSlotId == SID_LINE_ARROW_CIRCLE ||
684 nSlotId == SID_LINE_CIRCLE_ARROW ||
685 nSlotId == SID_LINE_ARROW_SQUARE ||
686 nSlotId == SID_LINE_SQUARE_ARROW) )
687 return;
688
689 // set attributes of line start and ends
690 SdrModel& rModel(rObj.getSdrModelFromSdrObject());
691
692 // arrowhead
693 ::basegfx::B2DPolyPolygon aArrow(ConstructHelper::GetLineEndPoly(RID_SVXSTR_ARROW, rModel));
694 if( !aArrow.count() )
695 {
696 ::basegfx::B2DPolygon aNewArrow;
697 aNewArrow.append(::basegfx::B2DPoint(10.0, 0.0));
698 aNewArrow.append(::basegfx::B2DPoint(0.0, 30.0));
699 aNewArrow.append(::basegfx::B2DPoint(20.0, 30.0));
700 aNewArrow.setClosed(true);
701 aArrow.append(aNewArrow);
702 }
703
704 // Circles
705 ::basegfx::B2DPolyPolygon aCircle(ConstructHelper::GetLineEndPoly(RID_SVXSTR_CIRCLE, rModel));
706 if( !aCircle.count() )
707 {
708 ::basegfx::B2DPolygon aNewCircle = ::basegfx::utils::createPolygonFromEllipse(::basegfx::B2DPoint(0.0, 0.0), 250.0, 250.0);
709 aNewCircle.setClosed(true);
710 aCircle.append(aNewCircle);
711 }
712
713 // Square
714 ::basegfx::B2DPolyPolygon aSquare(ConstructHelper::GetLineEndPoly(RID_SVXSTR_SQUARE, rModel));
715 if( !aSquare.count() )
716 {
717 ::basegfx::B2DPolygon aNewSquare;
718 aNewSquare.append(::basegfx::B2DPoint(0.0, 0.0));
719 aNewSquare.append(::basegfx::B2DPoint(10.0, 0.0));
720 aNewSquare.append(::basegfx::B2DPoint(10.0, 10.0));
721 aNewSquare.append(::basegfx::B2DPoint(0.0, 10.0));
722 aNewSquare.setClosed(true);
723 aSquare.append(aNewSquare);
724 }
725
726 SfxItemSet aSet( mpDoc->GetPool() );
727 mpView->GetAttributes( aSet );
728
729 // #i3908# Here, the default Line Start/End width for arrow construction is
730 // set. To have the same value in all situations (construction) in i3908
731 // it was decided to change the default to 0.03 cm for all situations.
732 ::tools::Long nWidth = 300; // (1/100th mm)
733
734 // determine line width and calculate with it the line end width
735 if( aSet.GetItemState( XATTR_LINEWIDTH ) != SfxItemState::DONTCARE )
736 {
737 ::tools::Long nValue = aSet.Get( XATTR_LINEWIDTH ).GetValue();
738 if( nValue > 0 )
739 nWidth = nValue * 3;
740 }
741
742 switch (nSlotId)
743 {
744 case SID_CONNECTOR_ARROWS:
745 case SID_CONNECTOR_LINE_ARROWS:
746 case SID_CONNECTOR_LINES_ARROWS:
747 case SID_CONNECTOR_CURVE_ARROWS:
748 case SID_LINE_ARROWS:
749 {
750 // connector with arrow ends
751 rAttr.Put(XLineStartItem(SvxResId(RID_SVXSTR_ARROW), aArrow));
752 rAttr.Put(XLineStartWidthItem(nWidth));
753 rAttr.Put(XLineEndItem(SvxResId(RID_SVXSTR_ARROW), aArrow));
754 rAttr.Put(XLineEndWidthItem(nWidth));
755 }
756 break;
757
758 case SID_CONNECTOR_ARROW_START:
759 case SID_CONNECTOR_LINE_ARROW_START:
760 case SID_CONNECTOR_LINES_ARROW_START:
761 case SID_CONNECTOR_CURVE_ARROW_START:
762 case SID_LINE_ARROW_START:
763 case SID_LINE_ARROW_CIRCLE:
764 case SID_LINE_ARROW_SQUARE:
765 {
766 // connector with arrow start
767 rAttr.Put(XLineStartItem(SvxResId(RID_SVXSTR_ARROW), aArrow));
768 rAttr.Put(XLineStartWidthItem(nWidth));
769 }
770 break;
771
772 case SID_CONNECTOR_ARROW_END:
773 case SID_CONNECTOR_LINE_ARROW_END:
774 case SID_CONNECTOR_LINES_ARROW_END:
775 case SID_CONNECTOR_CURVE_ARROW_END:
776 case SID_LINE_ARROW_END:
777 case SID_LINE_CIRCLE_ARROW:
778 case SID_LINE_SQUARE_ARROW:
779 {
780 // connector with arrow end
781 rAttr.Put(XLineEndItem(SvxResId(RID_SVXSTR_ARROW), aArrow));
782 rAttr.Put(XLineEndWidthItem(nWidth));
783 }
784 break;
785
786 case SID_CONNECTOR_CIRCLES:
787 case SID_CONNECTOR_LINE_CIRCLES:
788 case SID_CONNECTOR_LINES_CIRCLES:
789 case SID_CONNECTOR_CURVE_CIRCLES:
790 {
791 // connector with circle ends
792 rAttr.Put(XLineStartItem(SvxResId(RID_SVXSTR_CIRCLE), aCircle));
793 rAttr.Put(XLineStartWidthItem(nWidth));
794 rAttr.Put(XLineEndItem(SvxResId(RID_SVXSTR_CIRCLE), aCircle));
795 rAttr.Put(XLineEndWidthItem(nWidth));
796 }
797 break;
798
799 case SID_CONNECTOR_CIRCLE_START:
800 case SID_CONNECTOR_LINE_CIRCLE_START:
801 case SID_CONNECTOR_LINES_CIRCLE_START:
802 case SID_CONNECTOR_CURVE_CIRCLE_START:
803 {
804 // connector with circle start
805 rAttr.Put(XLineStartItem(SvxResId(RID_SVXSTR_CIRCLE), aCircle));
806 rAttr.Put(XLineStartWidthItem(nWidth));
807 }
808 break;
809
810 case SID_CONNECTOR_CIRCLE_END:
811 case SID_CONNECTOR_LINE_CIRCLE_END:
812 case SID_CONNECTOR_LINES_CIRCLE_END:
813 case SID_CONNECTOR_CURVE_CIRCLE_END:
814 {
815 // connector with circle ends
816 rAttr.Put(XLineEndItem(SvxResId(RID_SVXSTR_CIRCLE), aCircle));
817 rAttr.Put(XLineEndWidthItem(nWidth));
818 }
819 break;
820 }
821
822 // and again, for the still missing ends
823 switch (nSlotId)
824 {
825 case SID_LINE_ARROW_CIRCLE:
826 {
827 // circle end
828 rAttr.Put(XLineEndItem(SvxResId(RID_SVXSTR_CIRCLE), aCircle));
829 rAttr.Put(XLineEndWidthItem(nWidth));
830 }
831 break;
832
833 case SID_LINE_CIRCLE_ARROW:
834 {
835 // circle start
836 rAttr.Put(XLineStartItem(SvxResId(RID_SVXSTR_CIRCLE), aCircle));
837 rAttr.Put(XLineStartWidthItem(nWidth));
838 }
839 break;
840
841 case SID_LINE_ARROW_SQUARE:
842 {
843 // square end
844 rAttr.Put(XLineEndItem(SvxResId(RID_SVXSTR_SQUARE), aSquare));
845 rAttr.Put(XLineEndWidthItem(nWidth));
846 }
847 break;
848
849 case SID_LINE_SQUARE_ARROW:
850 {
851 // square start
852 rAttr.Put(XLineStartItem(SvxResId(RID_SVXSTR_SQUARE), aSquare));
853 rAttr.Put(XLineStartWidthItem(nWidth));
854 }
855 break;
856 }
857}
858
859rtl::Reference<SdrObject> FuConstructRectangle::CreateDefaultObject(const sal_uInt16 nID, const ::tools::Rectangle& rRectangle)
860{
861 DBG_ASSERT( (nID != SID_DRAW_FONTWORK) && (nID != SID_DRAW_FONTWORK_VERTICAL ), "FuConstRectangle::CreateDefaultObject can not create Fontwork shapes!" );
862
863 // case SID_DRAW_LINE:
864 // case SID_DRAW_XLINE:
865 // case SID_DRAW_MEASURELINE:
866 // case SID_LINE_ARROW_START:
867 // case SID_LINE_ARROW_END:
868 // case SID_LINE_ARROWS:
869 // case SID_LINE_ARROW_CIRCLE:
870 // case SID_LINE_CIRCLE_ARROW:
871 // case SID_LINE_ARROW_SQUARE:
872 // case SID_LINE_SQUARE_ARROW:
873 // case SID_DRAW_RECT:
874 // case SID_DRAW_RECT_NOFILL:
875 // case SID_DRAW_RECT_ROUND:
876 // case SID_DRAW_RECT_ROUND_NOFILL:
877 // case SID_DRAW_SQUARE:
878 // case SID_DRAW_SQUARE_NOFILL:
879 // case SID_DRAW_SQUARE_ROUND:
880 // case SID_DRAW_SQUARE_ROUND_NOFILL:
881 // case SID_DRAW_ELLIPSE:
882 // case SID_DRAW_ELLIPSE_NOFILL:
883 // case SID_DRAW_CIRCLE:
884 // case SID_DRAW_CIRCLE_NOFILL:
885 // case SID_DRAW_CAPTION:
886 // case SID_DRAW_CAPTION_VERTICAL:
887 // case SID_TOOL_CONNECTOR:
888 // case SID_CONNECTOR_ARROW_START:
889 // case SID_CONNECTOR_ARROW_END:
890 // case SID_CONNECTOR_ARROWS:
891 // case SID_CONNECTOR_CIRCLE_START:
892 // case SID_CONNECTOR_CIRCLE_END:
893 // case SID_CONNECTOR_CIRCLES:
894 // case SID_CONNECTOR_LINE:
895 // case SID_CONNECTOR_LINE_ARROW_START:
896 // case SID_CONNECTOR_LINE_ARROW_END:
897 // case SID_CONNECTOR_LINE_ARROWS:
898 // case SID_CONNECTOR_LINE_CIRCLE_START:
899 // case SID_CONNECTOR_LINE_CIRCLE_END:
900 // case SID_CONNECTOR_LINE_CIRCLES:
901 // case SID_CONNECTOR_CURVE:
902 // case SID_CONNECTOR_CURVE_ARROW_START:
903 // case SID_CONNECTOR_CURVE_ARROW_END:
904 // case SID_CONNECTOR_CURVE_ARROWS:
905 // case SID_CONNECTOR_CURVE_CIRCLE_START:
906 // case SID_CONNECTOR_CURVE_CIRCLE_END:
907 // case SID_CONNECTOR_CURVE_CIRCLES:
908 // case SID_CONNECTOR_LINES:
909 // case SID_CONNECTOR_LINES_ARROW_START:
910 // case SID_CONNECTOR_LINES_ARROW_END:
911 // case SID_CONNECTOR_LINES_ARROWS:
912 // case SID_CONNECTOR_LINES_CIRCLE_START:
913 // case SID_CONNECTOR_LINES_CIRCLE_END:
914 // case SID_CONNECTOR_LINES_CIRCLES:
915
920
921 if(pObj)
922 {
923 ::tools::Rectangle aRect(rRectangle);
924
925 if(SID_DRAW_SQUARE == nID ||
926 SID_DRAW_SQUARE_NOFILL == nID ||
927 SID_DRAW_SQUARE_ROUND == nID ||
928 SID_DRAW_SQUARE_ROUND_NOFILL == nID ||
929 SID_DRAW_CIRCLE == nID ||
930 SID_DRAW_CIRCLE_NOFILL == nID)
931 {
932 // force quadratic
933 ImpForceQuadratic(aRect);
934 }
935
936 Point aStart = aRect.TopLeft();
937 Point aEnd = aRect.BottomRight();
938
939 switch(nID)
940 {
941 case SID_DRAW_LINE:
942 case SID_DRAW_XLINE:
943 case SID_LINE_ARROW_START:
944 case SID_LINE_ARROW_END:
945 case SID_LINE_ARROWS:
946 case SID_LINE_ARROW_CIRCLE:
947 case SID_LINE_CIRCLE_ARROW:
948 case SID_LINE_ARROW_SQUARE:
949 case SID_LINE_SQUARE_ARROW:
950 {
951 if( auto pPathObj = dynamic_cast<SdrPathObj *>( pObj.get() ) )
952 {
953 sal_Int32 nYMiddle((aRect.Top() + aRect.Bottom()) / 2);
954
955 ::basegfx::B2DPolygon aB2DPolygon;
956 aB2DPolygon.append(::basegfx::B2DPoint(aStart.X(), nYMiddle));
957 aB2DPolygon.append(::basegfx::B2DPoint(aEnd.X(), nYMiddle));
958 pPathObj->SetPathPoly(::basegfx::B2DPolyPolygon(aB2DPolygon));
959 }
960 else
961 {
962 OSL_FAIL("Object is NO line object");
963 }
964
965 break;
966 }
967
968 case SID_DRAW_MEASURELINE:
969 {
970 if( auto pMeasureObj = dynamic_cast< SdrMeasureObj *>( pObj.get() ) )
971 {
972 sal_Int32 nYMiddle((aRect.Top() + aRect.Bottom()) / 2);
973 pMeasureObj->SetPoint(Point(aStart.X(), nYMiddle), 0);
974 pMeasureObj->SetPoint(Point(aEnd.X(), nYMiddle), 1);
975 }
976 else
977 {
978 OSL_FAIL("Object is NO measure object");
979 }
980
981 break;
982 }
983
984 case SID_TOOL_CONNECTOR:
985 case SID_CONNECTOR_ARROW_START:
986 case SID_CONNECTOR_ARROW_END:
987 case SID_CONNECTOR_ARROWS:
988 case SID_CONNECTOR_CIRCLE_START:
989 case SID_CONNECTOR_CIRCLE_END:
990 case SID_CONNECTOR_CIRCLES:
991 case SID_CONNECTOR_LINE:
992 case SID_CONNECTOR_LINE_ARROW_START:
993 case SID_CONNECTOR_LINE_ARROW_END:
994 case SID_CONNECTOR_LINE_ARROWS:
995 case SID_CONNECTOR_LINE_CIRCLE_START:
996 case SID_CONNECTOR_LINE_CIRCLE_END:
997 case SID_CONNECTOR_LINE_CIRCLES:
998 case SID_CONNECTOR_CURVE:
999 case SID_CONNECTOR_CURVE_ARROW_START:
1000 case SID_CONNECTOR_CURVE_ARROW_END:
1001 case SID_CONNECTOR_CURVE_ARROWS:
1002 case SID_CONNECTOR_CURVE_CIRCLE_START:
1003 case SID_CONNECTOR_CURVE_CIRCLE_END:
1004 case SID_CONNECTOR_CURVE_CIRCLES:
1005 case SID_CONNECTOR_LINES:
1006 case SID_CONNECTOR_LINES_ARROW_START:
1007 case SID_CONNECTOR_LINES_ARROW_END:
1008 case SID_CONNECTOR_LINES_ARROWS:
1009 case SID_CONNECTOR_LINES_CIRCLE_START:
1010 case SID_CONNECTOR_LINES_CIRCLE_END:
1011 case SID_CONNECTOR_LINES_CIRCLES:
1012 {
1013 if( auto pEdgeObj = dynamic_cast< SdrEdgeObj *>( pObj.get() ) )
1014 {
1015 pEdgeObj->SetTailPoint(false, aStart);
1016 pEdgeObj->SetTailPoint(true, aEnd);
1017 }
1018 else
1019 {
1020 OSL_FAIL("Object is NO connector object");
1021 }
1022
1023 break;
1024 }
1025 case SID_DRAW_CAPTION:
1026 case SID_DRAW_CAPTION_VERTICAL:
1027 {
1028 if( auto pCaptionObj = dynamic_cast< SdrCaptionObj *>( pObj.get() ) )
1029 {
1030 bool bIsVertical(SID_DRAW_CAPTION_VERTICAL == nID);
1031
1032 pCaptionObj->SetVerticalWriting(bIsVertical);
1033
1034 if(bIsVertical)
1035 {
1036 SfxItemSet aSet(pObj->GetMergedItemSet());
1039 pObj->SetMergedItemSet(aSet);
1040 }
1041
1042 // The default text is not inserted anymore.
1043
1044 pCaptionObj->SetLogicRect(aRect);
1045 pCaptionObj->SetTailPos(
1046 aRect.TopLeft() - Point(aRect.GetWidth() / 2, aRect.GetHeight() / 2));
1047 }
1048 else
1049 {
1050 OSL_FAIL("Object is NO caption object");
1051 }
1052
1053 break;
1054 }
1055
1056 default:
1057 {
1058 pObj->SetLogicRect(aRect);
1059
1060 break;
1061 }
1062 }
1063
1064 SfxItemSet aAttr(mpDoc->GetPool());
1065 SetStyleSheet(aAttr, pObj.get());
1066 SetAttributes(aAttr, pObj.get());
1067 SetLineEnds(aAttr, *pObj);
1068 pObj->SetMergedItemSet(aAttr);
1069 }
1070
1071 return pObj;
1072}
1073
1074} // end of namespace sd
1075
1076/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_uInt32 GetValue() const
::basegfx::B2DPolyPolygon GetLineEndPoly(TranslateId pResId, const SdrModel &rModel)
const Point & GetPosPixel() const
bool IsLeft() const
tools::Long AdjustY(tools::Long nVertMove)
tools::Long AdjustX(tools::Long nHorzMove)
constexpr tools::Long X() const
SAL_DLLPRIVATE SfxItemPool & GetPool()
Definition: drawdoc.hxx:237
bool BegCreateObj(const Point &rPnt, OutputDevice *pOut=nullptr, short nMinMov=-3)
bool IsCreateObj() const
bool EndCreateObj(SdrCreateCmd eCmd)
SdrInventor GetCurrentObjInventor() const
SdrObjKind GetCurrentObjIdentifier() const
virtual bool IsAction() const override
void SetCurrentObj(SdrObjKind nIdent, SdrInventor nInvent=SdrInventor::Default)
SdrObject * GetCreateObj() const
bool BegCreateCaptionObj(const Point &rPnt, const Size &rObjSiz, OutputDevice *pOut=nullptr, short nMinMov=-3)
sal_Int32 GetDragThresholdPixels() const
bool InsertObjectAtView(SdrObject *pObj, SdrPageView &rPV, SdrInsertFlags nOptions=SdrInsertFlags::NONE)
SdrLayerID GetLayerID(const OUString &rName) const
size_t GetMarkCount() const
const SdrMarkList & GetMarkedObjectList() const
SfxStyleSheetBasePool * GetStyleSheetPool() const
const SdrLayerAdmin & GetLayerAdmin() const
static rtl::Reference< SdrObject > MakeNewObject(SdrModel &rSdrModel, SdrInventor nInventor, SdrObjKind nObjIdentifier, const tools::Rectangle *pSnapRect=nullptr)
void SetStyleSheet(SfxStyleSheet *pNewStyleSheet, bool bDontRemoveHardAttr)
void SetMergedItemSet(const SfxItemSet &rSet, bool bClearAllItems=false)
SdrModel & getSdrModelFromSdrObject() const
virtual SdrObjKind GetObjIdentifier() const
const SfxItemSet & GetMergedItemSet() const
virtual void SetLayer(SdrLayerID nLayer)
virtual void SetName(const OUString &rStr, const bool bSetChanged=true)
virtual const tools::Rectangle & GetLogicRect() const
SdrPage * GetPage() const
SdrModel & getSdrModelFromSdrPage() const
SdrModel & getSdrModelFromSdrView() const
void SetGlueVisible(bool bOn=true)
SdrPageView * GetSdrPageView() const
bool IsSnapEnabled() const
Point GetSnapPos(const Point &rPnt, const SdrPageView *pPV) const
void UnmarkAll()
bool GetValue() const
const SfxPoolItem * Execute(sal_uInt16 nSlot, SfxCallMode nCall=SfxCallMode::SLOT, const SfxPoolItem **pArgs=nullptr, sal_uInt16 nModi=0, const SfxPoolItem **pInternalArgs=nullptr)
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
const SfxItemSet * GetArgs() const
const T * GetArg(sal_uInt16 nSlotId) const
virtual SfxObjectShell * GetObjectShell()
virtual SfxStyleSheetBase * Find(const OUString &, SfxStyleFamily eFam, SfxStyleSearchBits n=SfxStyleSearchBits::All)
void RemoveInfoBar(std::u16string_view sId)
void AppendReadOnlyInfobar()
SfxDispatcher * GetDispatcher()
bool HasInfoBarWithID(std::u16string_view sId)
constexpr tools::Long Height() const
constexpr tools::Long Width() const
void append(const B2DPolygon &rPolygon, sal_uInt32 nCount=1)
sal_uInt32 count() const
void append(const basegfx::B2DPoint &rPoint, sal_uInt32 nCount)
void setClosed(bool bNew)
draw rectangle
Definition: fuconrec.hxx:34
virtual void Activate() override
activates the function
Definition: fuconrec.cxx:349
virtual void Deactivate() override
deactivates the function
Definition: fuconrec.cxx:455
virtual void DoExecute(SfxRequest &rReq) override
Definition: fuconrec.cxx:120
virtual bool MouseButtonDown(const MouseEvent &rMEvt) override
Definition: fuconrec.cxx:244
static rtl::Reference< FuPoor > Create(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq, bool bPermanent)
Definition: fuconrec.cxx:111
void SetAttributes(SfxItemSet &rAttr, SdrObject *pObj)
set attribute for the object to be created
Definition: fuconrec.cxx:555
FuConstructRectangle(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
Definition: fuconrec.cxx:80
virtual bool MouseButtonUp(const MouseEvent &rMEvt) override
Definition: fuconrec.cxx:283
void SetLineEnds(SfxItemSet &rAttr, SdrObject const &rObj)
set line starts and ends for the object to be created
Definition: fuconrec.cxx:673
virtual rtl::Reference< SdrObject > CreateDefaultObject(const sal_uInt16 nID, const ::tools::Rectangle &rRectangle) override
Definition: fuconrec.cxx:859
sal_uInt16 mnFillTransparence
Definition: fuconrec.hxx:37
virtual bool MouseButtonUp(const MouseEvent &rMEvt) override
Definition: fuconstr.cxx:128
virtual bool MouseButtonDown(const MouseEvent &rMEvt) override
Definition: fuconstr.cxx:64
virtual void Deactivate() override
deactivates the function
Definition: fuconstr.cxx:227
virtual void Activate() override
activates the function
Definition: fuconstr.cxx:221
void SetStyleSheet(SfxItemSet &rAttr, SdrObject *pObj)
set style sheet for the object to be created
Definition: fuconstr.cxx:249
bool IsIgnoreUnexpectedMouseButtonUp()
Definition: fuconstr.cxx:233
bool bPermanent
Definition: fudraw.hxx:76
void SetPermanent(bool bSet)
Definition: fudraw.hxx:52
SdDrawDocument * mpDoc
Definition: fupoor.hxx:148
VclPtr< ::sd::Window > mpWindow
Definition: fupoor.hxx:146
static void ImpForceQuadratic(::tools::Rectangle &rRect)
Definition: fupoor.cxx:1018
ViewShell * mpViewShell
Definition: fupoor.hxx:145
sal_uInt16 nSlotId
Definition: fupoor.hxx:150
::sd::View * mpView
Definition: fupoor.hxx:144
virtual void DoExecute(SfxRequest &rReq)
Definition: fupoor.cxx:1129
static constexpr OUStringLiteral msDrawingObjectToolBar
std::shared_ptr< ToolBarManager > const & GetToolBarManager() const
Base class of the stacked shell hierarchy.
Definition: ViewShell.hxx:92
SD_DLLPUBLIC weld::Window * GetFrameWeld() const
Definition: viewshel.cxx:1582
SD_DLLPUBLIC ViewShellBase & GetViewShellBase() const
Definition: viewshel.cxx:1397
SD_DLLPUBLIC SfxViewFrame * GetViewFrame() const
Definition: viewshel.cxx:118
virtual void GetAttributes(SfxItemSet &rTargetSet, bool bOnlyHardAttr=false) const
Definition: sdview.cxx:515
An SdWindow contains the actual working area of ViewShell.
Definition: Window.hxx:45
constexpr tools::Long GetWidth() const
constexpr tools::Long Top() const
constexpr Point TopLeft() const
constexpr Size GetSize() const
constexpr Point BottomRight() const
constexpr tools::Long GetHeight() const
constexpr tools::Long Bottom() const
constexpr ::Color COL_GRAY(0x80, 0x80, 0x80)
constexpr ::Color COL_GRAY3(0xCC, 0xCC, 0xCC)
constexpr ::Color COL_GRAY7(0x66, 0x66, 0x66)
constexpr ::Color COL_AUTO(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
#define DBG_ASSERT(sCon, aError)
SVXCORE_DLLPUBLIC OUString SvxResId(TranslateId aId)
float u
constexpr TypedWhichId< SvxAdjustItem > EE_PARA_JUST(EE_PARA_START+16)
sal_Int16 nValue
OUString aName
constexpr int nCenterOffset
uno::Reference< security::XCertificate > getSignatureCertificate(SfxObjectShell *pShell, weld::Window *pParent)
void setShapeCertificate(const SdrView *pView, const css::uno::Reference< css::security::XCertificate > &xCertificate)
long Long
SdrMetricItem makeSdrEckenradiusItem(tools::Long nRadius)
OUString SdResId(TranslateId aId)
Definition: sdmod.cxx:83
SdrOnOffItem makeSdrTextAutoGrowHeightItem(bool bAuto)
SdrOnOffItem makeSdrTextAutoGrowWidthItem(bool bAuto)
SDRTEXTVERTADJUST_BLOCK
SDRTEXTVERTADJUST_CENTER
SDRTEXTHORZADJUST_BLOCK
SDRTEXTHORZADJUST_RIGHT
SdrMetricItem makeSdrTextUpperDistItem(tools::Long mnHeight)
SdrMetricItem makeSdrTextRightDistItem(tools::Long mnHeight)
SdrMetricItem makeSdrTextLowerDistItem(tools::Long mnHeight)
SdrMetricItem makeSdrTextLeftDistItem(tools::Long mnHeight)
SdrMetricItem makeSdrTextMinFrameHeightItem(tools::Long mnHeight)
SdrMetricItem makeSdrTextMinFrameWidthItem(tools::Long mnWidth)
constexpr TypedWhichId< SvxWritingModeItem > SDRATTR_TEXTDIRECTION(SDRATTR_NOTPERSIST_FIRST+34)
SdrObjKind
#define SAL_MAX_UINT16
constexpr OUStringLiteral sUNO_LayerName_measurelines
Definition: unokywds.hxx:33
constexpr TypedWhichId< XLineWidthItem > XATTR_LINEWIDTH(XATTR_LINE_FIRST+2)