LibreOffice Module svx (master) 1
svdfmtf.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 "svdfmtf.hxx"
21#include <math.h>
22#include <editeng/eeitem.hxx>
23#include <editeng/fhgtitem.hxx>
24#include <editeng/wghtitem.hxx>
25#include <editeng/postitem.hxx>
26#include <editeng/udlnitem.hxx>
28#include <editeng/shdditem.hxx>
29#include <svx/xlineit0.hxx>
30#include <svx/xlnclit.hxx>
31#include <svx/xlncapit.hxx>
32#include <svx/xlnwtit.hxx>
33#include <svx/xfillit0.hxx>
34#include <svx/xflclit.hxx>
35#include <svx/xflgrit.hxx>
36#include <editeng/fontitem.hxx>
37#include <editeng/wrlmitem.hxx>
39#include <editeng/colritem.hxx>
40#include <vcl/canvastools.hxx>
41#include <vcl/metric.hxx>
43#include <svx/xflhtit.hxx>
44#include <svx/sdmetitm.hxx>
45#include <svx/sdtagitm.hxx>
46#include <svx/sdtaitm.hxx>
47#include <svx/sdtditm.hxx>
48#include <svx/sdtfsitm.hxx>
49#include <svx/svdmodel.hxx>
50#include <svx/svdpage.hxx>
51#include <svx/svdobj.hxx>
52#include <svx/svdotext.hxx>
53#include <svx/svdorect.hxx>
54#include <svx/svdocirc.hxx>
55#include <svx/svdograf.hxx>
56#include <svx/svdopath.hxx>
57#include <svx/svdetc.hxx>
58#include <svl/itemset.hxx>
60#include <tools/helpers.hxx>
63#include <svx/xlinjoit.hxx>
64#include <svx/xlndsit.hxx>
66#include <svx/xbtmpit.hxx>
67#include <svx/xfltrit.hxx>
68#include <svx/xflbmtit.hxx>
69#include <svx/xflbstit.hxx>
70#include <svx/svdpntv.hxx>
72#include <svx/svditer.hxx>
73#include <svx/svdogrp.hxx>
74#include <vcl/BitmapTools.hxx>
75#include <osl/diagnose.h>
76
77using namespace com::sun::star;
78
80 SdrModel& rModel,
81 SdrLayerID nLay,
82 const tools::Rectangle& rRect)
83: mpVD(VclPtr<VirtualDevice>::Create()),
84 maScaleRect(rRect),
85 mnMapScalingOfs(0),
86 mpModel(&rModel),
87 mnLayer(nLay),
88 mnLineWidth(0),
89 maLineJoin(basegfx::B2DLineJoin::NONE),
90 maLineCap(css::drawing::LineCap_BUTT),
91 maDash(css::drawing::DashStyle_RECT, 0, 0, 0, 0, 0),
92 mbMov(false),
93 mbSize(false),
94 maOfs(0, 0),
95 mfScaleX(1.0),
96 mfScaleY(1.0),
97 maScaleX(1.0),
98 maScaleY(1.0),
99 mbFntDirty(true),
100 mbLastObjWasPolyWithoutLine(false),
101 mbNoLine(false),
102 mbNoFill(false),
103 mbLastObjWasLine(false)
104{
105 mpVD->EnableOutput(false);
106 mpVD->SetLineColor();
107 mpVD->SetFillColor();
108 maOldLineColor.SetRed( mpVD->GetLineColor().GetRed() + 1 );
109 mpLineAttr = std::make_unique<SfxItemSetFixed<XATTR_LINE_FIRST, XATTR_LINE_LAST>>(rModel.GetItemPool());
110 mpFillAttr = std::make_unique<SfxItemSetFixed<XATTR_FILL_FIRST, XATTR_FILL_LAST>>(rModel.GetItemPool());
111 mpTextAttr = std::make_unique<SfxItemSetFixed<EE_ITEMS_START, EE_ITEMS_END>>(rModel.GetItemPool());
112 checkClip();
113}
114
115void ImpSdrGDIMetaFileImport::DoLoopActions(GDIMetaFile const & rMtf, SvdProgressInfo* pProgrInfo, sal_uInt32* pActionsToReport)
116{
117 const sal_uLong nCount(rMtf.GetActionSize());
118
119 for(sal_uLong a(0); a < nCount; a++)
120 {
121 MetaAction* pAct = rMtf.GetAction(a);
122
123 if(!pAct)
124 {
125 OSL_ENSURE(false, "OOps, no action at valid position (!)");
126 pAct = rMtf.GetAction(0);
127 }
128
129 switch (pAct->GetType())
130 {
131 case MetaActionType::PIXEL : break;
132 case MetaActionType::POINT : break;
133 case MetaActionType::LINE : DoAction(static_cast<MetaLineAction &>(*pAct)); break;
134 case MetaActionType::RECT : DoAction(static_cast<MetaRectAction &>(*pAct)); break;
135 case MetaActionType::ROUNDRECT : DoAction(static_cast<MetaRoundRectAction &>(*pAct)); break;
136 case MetaActionType::ELLIPSE : DoAction(static_cast<MetaEllipseAction &>(*pAct)); break;
137 case MetaActionType::ARC : DoAction(static_cast<MetaArcAction &>(*pAct)); break;
138 case MetaActionType::PIE : DoAction(static_cast<MetaPieAction &>(*pAct)); break;
139 case MetaActionType::CHORD : DoAction(static_cast<MetaChordAction &>(*pAct)); break;
140 case MetaActionType::POLYLINE : DoAction(static_cast<MetaPolyLineAction &>(*pAct)); break;
141 case MetaActionType::POLYGON : DoAction(static_cast<MetaPolygonAction &>(*pAct)); break;
142 case MetaActionType::POLYPOLYGON : DoAction(static_cast<MetaPolyPolygonAction &>(*pAct)); break;
143 case MetaActionType::TEXT : DoAction(static_cast<MetaTextAction &>(*pAct)); break;
144 case MetaActionType::TEXTARRAY : DoAction(static_cast<MetaTextArrayAction &>(*pAct)); break;
145 case MetaActionType::STRETCHTEXT : DoAction(static_cast<MetaStretchTextAction &>(*pAct)); break;
146 case MetaActionType::BMP : DoAction(static_cast<MetaBmpAction &>(*pAct)); break;
147 case MetaActionType::BMPSCALE : DoAction(static_cast<MetaBmpScaleAction &>(*pAct)); break;
148 case MetaActionType::BMPEX : DoAction(static_cast<MetaBmpExAction &>(*pAct)); break;
149 case MetaActionType::BMPEXSCALE : DoAction(static_cast<MetaBmpExScaleAction &>(*pAct)); break;
150 case MetaActionType::LINECOLOR : DoAction(static_cast<MetaLineColorAction &>(*pAct)); break;
151 case MetaActionType::FILLCOLOR : DoAction(static_cast<MetaFillColorAction &>(*pAct)); break;
152 case MetaActionType::TEXTCOLOR : DoAction(static_cast<MetaTextColorAction &>(*pAct)); break;
153 case MetaActionType::TEXTFILLCOLOR : DoAction(static_cast<MetaTextFillColorAction &>(*pAct)); break;
154 case MetaActionType::FONT : DoAction(static_cast<MetaFontAction &>(*pAct)); break;
155 case MetaActionType::TEXTALIGN : DoAction(static_cast<MetaTextAlignAction &>(*pAct)); break;
156 case MetaActionType::MAPMODE : DoAction(static_cast<MetaMapModeAction &>(*pAct)); break;
157 case MetaActionType::CLIPREGION : DoAction(static_cast<MetaClipRegionAction &>(*pAct)); break;
158 case MetaActionType::MOVECLIPREGION : DoAction(static_cast<MetaMoveClipRegionAction &>(*pAct)); break;
159 case MetaActionType::ISECTRECTCLIPREGION: DoAction(static_cast<MetaISectRectClipRegionAction&>(*pAct)); break;
160 case MetaActionType::ISECTREGIONCLIPREGION: DoAction(static_cast<MetaISectRegionClipRegionAction&>(*pAct)); break;
161 case MetaActionType::RASTEROP : DoAction(static_cast<MetaRasterOpAction &>(*pAct)); break;
162 case MetaActionType::PUSH : DoAction(static_cast<MetaPushAction &>(*pAct)); break;
163 case MetaActionType::POP : DoAction(static_cast<MetaPopAction &>(*pAct)); break;
164 case MetaActionType::HATCH : DoAction(static_cast<MetaHatchAction &>(*pAct)); break;
165
166 // #i125211# MetaCommentAction may change index, thus hand it over
167 case MetaActionType::COMMENT : DoAction(static_cast<MetaCommentAction&>(*pAct), rMtf, a);
168 break;
169
170 // missing actions added
171 case MetaActionType::TEXTRECT : DoAction(static_cast<MetaTextRectAction&>(*pAct)); break;
172 case MetaActionType::BMPSCALEPART : DoAction(static_cast<MetaBmpScalePartAction&>(*pAct)); break;
173 case MetaActionType::BMPEXSCALEPART : DoAction(static_cast<MetaBmpExScalePartAction&>(*pAct)); break;
174 case MetaActionType::MASK : DoAction(static_cast<MetaMaskAction&>(*pAct)); break;
175 case MetaActionType::MASKSCALE : DoAction(static_cast<MetaMaskScaleAction&>(*pAct)); break;
176 case MetaActionType::MASKSCALEPART : DoAction(static_cast<MetaMaskScalePartAction&>(*pAct)); break;
177 case MetaActionType::GRADIENT : DoAction(static_cast<MetaGradientAction&>(*pAct)); break;
178 case MetaActionType::WALLPAPER : OSL_ENSURE(false, "Tried to construct SdrObject from MetaWallpaperAction: not supported (!)"); break;
179 case MetaActionType::Transparent : DoAction(static_cast<MetaTransparentAction&>(*pAct)); break;
180 case MetaActionType::EPS : OSL_ENSURE(false, "Tried to construct SdrObject from MetaEPSAction: not supported (!)"); break;
181 case MetaActionType::REFPOINT : DoAction(static_cast<MetaRefPointAction&>(*pAct)); break;
182 case MetaActionType::TEXTLINECOLOR : DoAction(static_cast<MetaTextLineColorAction&>(*pAct)); break;
183 case MetaActionType::TEXTLINE : OSL_ENSURE(false, "Tried to construct SdrObject from MetaTextLineAction: not supported (!)"); break;
184 case MetaActionType::FLOATTRANSPARENT : DoAction(static_cast<MetaFloatTransparentAction&>(*pAct)); break;
185 case MetaActionType::GRADIENTEX : DoAction(static_cast<MetaGradientExAction&>(*pAct)); break;
186 case MetaActionType::LAYOUTMODE : DoAction(static_cast<MetaLayoutModeAction&>(*pAct)); break;
187 case MetaActionType::TEXTLANGUAGE : DoAction(static_cast<MetaTextLanguageAction&>(*pAct)); break;
188 case MetaActionType::OVERLINECOLOR : DoAction(static_cast<MetaOverlineColorAction&>(*pAct)); break;
189 default: break;
190 }
191
192 if(pProgrInfo && pActionsToReport)
193 {
194 (*pActionsToReport)++;
195
196 if(*pActionsToReport >= 16) // update all 16 actions
197 {
198 if(!pProgrInfo->ReportActions(*pActionsToReport))
199 break;
200
201 *pActionsToReport = 0;
202 }
203 }
204 }
205}
206
208 const GDIMetaFile& rMtf,
209 SdrObjList& rOL,
210 size_t nInsPos,
211 SvdProgressInfo* pProgrInfo)
212{
213 // setup some global scale parameter
214 // mfScaleX, mfScaleY, maScaleX, maScaleY, mbMov, mbSize
215 mfScaleX = mfScaleY = 1.0;
216 const Size aMtfSize(rMtf.GetPrefSize());
217
218 if(aMtfSize.Width() & aMtfSize.Height() && (!maScaleRect.IsEmpty()))
219 {
221
222 if(aMtfSize.Width() != (maScaleRect.GetWidth() - 1))
223 {
224 mfScaleX = static_cast<double>( maScaleRect.GetWidth() - 1 ) / static_cast<double>(aMtfSize.Width());
225 }
226
227 if(aMtfSize.Height() != (maScaleRect.GetHeight() - 1))
228 {
229 mfScaleY = static_cast<double>( maScaleRect.GetHeight() - 1 ) / static_cast<double>(aMtfSize.Height());
230 }
231 }
232
233 mbMov = maOfs.X()!=0 || maOfs.Y()!=0;
234 mbSize = false;
235 maScaleX = Fraction( 1, 1 );
236 maScaleY = Fraction( 1, 1 );
237
238 if(aMtfSize.Width() != (maScaleRect.GetWidth() - 1))
239 {
240 maScaleX = Fraction(maScaleRect.GetWidth() - 1, aMtfSize.Width());
241 mbSize = true;
242 }
243
244 if(aMtfSize.Height() != (maScaleRect.GetHeight() - 1))
245 {
246 maScaleY = Fraction(maScaleRect.GetHeight() - 1, aMtfSize.Height());
247 mbSize = true;
248 }
249
250 if(pProgrInfo)
251 {
252 pProgrInfo->SetActionCount(rMtf.GetActionSize());
253 }
254
255 sal_uInt32 nActionsToReport(0);
256
257 // execute
258 DoLoopActions(rMtf, pProgrInfo, &nActionsToReport);
259
260 if(pProgrInfo)
261 {
262 pProgrInfo->ReportActions(nActionsToReport);
263 nActionsToReport = 0;
264 }
265
266 // MapMode scaling
267 MapScaling();
268
269 // To calculate the progress meter, we use GetActionSize()*3.
270 // However, maTmpList has a lower entry count limit than GetActionSize(),
271 // so the actions that were assumed were too much have to be re-added.
272 nActionsToReport = (rMtf.GetActionSize() - maTmpList.size()) * 2;
273
274 // announce all currently unannounced rescales
275 if(pProgrInfo)
276 {
277 pProgrInfo->ReportRescales(nActionsToReport);
278 pProgrInfo->SetInsertCount(maTmpList.size());
279 }
280
281 nActionsToReport = 0;
282
283 // insert all objects cached in aTmpList now into rOL from nInsPos
284 nInsPos = std::min(nInsPos, rOL.GetObjCount());
285
287 {
288 rOL.NbcInsertObject(pObj.get(), nInsPos);
289 nInsPos++;
290
291 if(pProgrInfo)
292 {
293 nActionsToReport++;
294
295 if(nActionsToReport >= 32) // update all 32 actions
296 {
297 pProgrInfo->ReportInserts(nActionsToReport);
298 nActionsToReport = 0;
299 }
300 }
301 }
302
303 // report all remaining inserts for the last time
304 if(pProgrInfo)
305 {
306 pProgrInfo->ReportInserts(nActionsToReport);
307 }
308
309 return maTmpList.size();
310}
311
312void ImpSdrGDIMetaFileImport::SetAttributes(SdrObject* pObj, bool bForceTextAttr)
313{
314 mbNoLine = false;
315 mbNoFill = false;
316 bool bLine(!bForceTextAttr);
317 bool bFill(!pObj || (pObj->IsClosedObj() && !bForceTextAttr));
318 bool bText(bForceTextAttr || (pObj && pObj->GetOutlinerParaObject()));
319
320 if(bLine)
321 {
322 if(mnLineWidth)
323 {
325 }
326 else
327 {
328 mpLineAttr->Put(XLineWidthItem(0));
329 }
330
331 maOldLineColor = mpVD->GetLineColor();
332
333 if(mpVD->IsLineColor())
334 {
335 mpLineAttr->Put(XLineStyleItem(drawing::LineStyle_SOLID));
336 mpLineAttr->Put(XLineColorItem(OUString(), mpVD->GetLineColor()));
337 }
338 else
339 {
340 mpLineAttr->Put(XLineStyleItem(drawing::LineStyle_NONE));
341 }
342
343 switch(maLineJoin)
344 {
346 mpLineAttr->Put(XLineJointItem(css::drawing::LineJoint_NONE));
347 break;
349 mpLineAttr->Put(XLineJointItem(css::drawing::LineJoint_BEVEL));
350 break;
352 mpLineAttr->Put(XLineJointItem(css::drawing::LineJoint_MITER));
353 break;
355 mpLineAttr->Put(XLineJointItem(css::drawing::LineJoint_ROUND));
356 break;
357 }
358
359 // Add LineCap support
361
363 {
364 mpLineAttr->Put(XLineDashItem(OUString(), maDash));
365 }
366 else
367 {
368 mpLineAttr->Put(XLineDashItem(OUString(), XDash(css::drawing::DashStyle_RECT)));
369 }
370 }
371 else
372 {
373 mbNoLine = true;
374 }
375
376 if(bFill)
377 {
378 if(mpVD->IsFillColor())
379 {
380 mpFillAttr->Put(XFillStyleItem(drawing::FillStyle_SOLID));
381 mpFillAttr->Put(XFillColorItem(OUString(), mpVD->GetFillColor()));
382 }
383 else
384 {
385 mpFillAttr->Put(XFillStyleItem(drawing::FillStyle_NONE));
386 }
387 }
388 else
389 {
390 mbNoFill = true;
391 }
392
393 if(bText && mbFntDirty)
394 {
395 vcl::Font aFnt(mpVD->GetFont());
396 const sal_uInt32 nHeight(FRound(aFnt.GetFontSize().Height() * mfScaleY));
397
398 mpTextAttr->Put( SvxFontItem( aFnt.GetFamilyType(), aFnt.GetFamilyName(), aFnt.GetStyleName(), aFnt.GetPitch(), aFnt.GetCharSet(), EE_CHAR_FONTINFO ) );
403 mpTextAttr->Put( SvxFontHeightItem( nHeight, 100, EE_CHAR_FONTHEIGHT ) );
404 mpTextAttr->Put( SvxFontHeightItem( nHeight, 100, EE_CHAR_FONTHEIGHT_CJK ) );
405 mpTextAttr->Put( SvxFontHeightItem( nHeight, 100, EE_CHAR_FONTHEIGHT_CTL ) );
411
412 // #i118485# Setting this item leads to problems (written #i118498# for this)
413 // mpTextAttr->Put(SvxAutoKernItem(aFnt.IsKerning(), EE_CHAR_KERNING));
414
417 mpTextAttr->Put(SvxColorItem(mpVD->GetTextColor(), EE_CHAR_COLOR));
418 //... svxfont textitem svditext
419 mbFntDirty = false;
420 }
421
422 if(!pObj)
423 return;
424
425 pObj->SetLayer(mnLayer);
426
427 if(bLine)
428 {
430 }
431
432 if(bFill)
433 {
435 }
436
437 if(bText)
438 {
441 }
442}
443
445{
446 rtl::Reference<SdrObject> pObj = pObj1;
447 if(bScale && !maScaleRect.IsEmpty())
448 {
449 if(mbSize)
450 {
451 pObj->NbcResize(Point(), maScaleX, maScaleY);
452 }
453
454 if(mbMov)
455 {
456 pObj->NbcMove(Size(maOfs.X(), maOfs.Y()));
457 }
458 }
459
460 if(isClip())
461 {
462 const basegfx::B2DPolyPolygon aPoly(pObj->TakeXorPoly());
463 const basegfx::B2DRange aOldRange(aPoly.getB2DRange());
464 const SdrLayerID aOldLayer(pObj->GetLayer());
465 const SfxItemSet aOldItemSet(pObj->GetMergedItemSet());
466 const SdrGrafObj* pSdrGrafObj = dynamic_cast< SdrGrafObj* >(pObj.get());
467 const SdrTextObj* pSdrTextObj = DynCastSdrTextObj(pObj.get());
468
469 if(pSdrTextObj && pSdrTextObj->HasText())
470 {
471 // all text objects are created from ImportText and have no line or fill attributes, so
472 // it is okay to concentrate on the text itself
473 while(true)
474 {
475 const basegfx::B2DPolyPolygon aTextContour(pSdrTextObj->TakeContour());
476 const basegfx::B2DRange aTextRange(aTextContour.getB2DRange());
477 const basegfx::B2DRange aClipRange(maClip.getB2DRange());
478
479 // no overlap -> completely outside
480 if(!aClipRange.overlaps(aTextRange))
481 {
482 pObj.clear();
483 break;
484 }
485
486 // when the clip is a rectangle fast check for inside is possible
487 if(basegfx::utils::isRectangle(maClip) && aClipRange.isInside(aTextRange))
488 {
489 // completely inside ClipRect
490 break;
491 }
492
493 // here text needs to be clipped; to do so, convert to SdrObjects with polygons
494 // and add these recursively. Delete original object, do not add in this run
495 rtl::Reference<SdrObject> pConverted = pSdrTextObj->ConvertToPolyObj(true, true);
496 pObj.clear();
497
498 if(pConverted)
499 {
500 // recursively add created conversion; per definition this shall not
501 // contain further SdrTextObjs. Visit only non-group objects
502 SdrObjListIter aIter(*pConverted, SdrIterMode::DeepNoGroups);
503
504 // work with clones; the created conversion may contain group objects
505 // and when working with the original objects the loop itself could
506 // break and the cleanup later would be pretty complicated (only delete group
507 // objects, are these empty, ...?)
508 while(aIter.IsMore())
509 {
510 SdrObject* pCandidate = aIter.Next();
511 OSL_ENSURE(pCandidate && dynamic_cast< SdrObjGroup* >(pCandidate) == nullptr, "SdrObjListIter with SdrIterMode::DeepNoGroups error (!)");
512 rtl::Reference<SdrObject> pNewClone(pCandidate->CloneSdrObject(pCandidate->getSdrModelFromSdrObject()));
513
514 if(pNewClone)
515 {
516 InsertObj(pNewClone.get(), false);
517 }
518 else
519 {
520 OSL_ENSURE(false, "SdrObject::Clone() failed (!)");
521 }
522 }
523 }
524
525 break;
526 }
527 }
528 else
529 {
530 BitmapEx aBitmapEx;
531
532 if(pSdrGrafObj)
533 {
534 aBitmapEx = pSdrGrafObj->GetGraphic().GetBitmapEx();
535 }
536
537 pObj.clear();
538
539 if(!aOldRange.isEmpty())
540 {
541 // clip against ClipRegion
542 const basegfx::B2DPolyPolygon aNewPoly(
544 aPoly,
545 maClip,
546 true,
547 !aPoly.isClosed()));
548 const basegfx::B2DRange aNewRange(aNewPoly.getB2DRange());
549
550 if(!aNewRange.isEmpty())
551 {
552 pObj = new SdrPathObj(
553 *mpModel,
555 aNewPoly);
556
557 pObj->SetLayer(aOldLayer);
558 pObj->SetMergedItemSet(aOldItemSet);
559
560 if(!aBitmapEx.IsEmpty())
561 {
562 // aNewRange is inside of aOldRange and defines which part of aBitmapEx is used
563 const double fScaleX(aBitmapEx.GetSizePixel().Width() / (aOldRange.getWidth() ? aOldRange.getWidth() : 1.0));
564 const double fScaleY(aBitmapEx.GetSizePixel().Height() / (aOldRange.getHeight() ? aOldRange.getHeight() : 1.0));
565 basegfx::B2DRange aPixel(aNewRange);
567
568 aTrans.translate(-aOldRange.getMinX(), -aOldRange.getMinY());
569 aTrans.scale(fScaleX, fScaleY);
570 aPixel.transform(aTrans);
571
572 const Size aOrigSizePixel(aBitmapEx.GetSizePixel());
573 const Point aClipTopLeft(
574 basegfx::fround(floor(std::max(0.0, aPixel.getMinX()))),
575 basegfx::fround(floor(std::max(0.0, aPixel.getMinY()))));
576 const Size aClipSize(
577 basegfx::fround(ceil(std::min(static_cast<double>(aOrigSizePixel.Width()), aPixel.getWidth()))),
578 basegfx::fround(ceil(std::min(static_cast<double>(aOrigSizePixel.Height()), aPixel.getHeight()))));
579 const BitmapEx aClippedBitmap(
580 aBitmapEx,
581 aClipTopLeft,
582 aClipSize);
583
584 pObj->SetMergedItem(XFillStyleItem(drawing::FillStyle_BITMAP));
585 pObj->SetMergedItem(XFillBitmapItem(OUString(), Graphic(aClippedBitmap)));
586 pObj->SetMergedItem(XFillBmpTileItem(false));
587 pObj->SetMergedItem(XFillBmpStretchItem(true));
588 }
589 }
590 }
591 }
592 }
593
594 if(!pObj)
595 return;
596
597 // #i111954# check object for visibility
598 // used are SdrPathObj, SdrRectObj, SdrCircObj, SdrGrafObj
599 bool bVisible(false);
600
601 if(pObj->HasLineStyle())
602 {
603 bVisible = true;
604 }
605
606 if(!bVisible && pObj->HasFillStyle())
607 {
608 bVisible = true;
609 }
610
611 if(!bVisible)
612 {
613 SdrTextObj* pTextObj = DynCastSdrTextObj(pObj.get());
614
615 if(pTextObj && pTextObj->HasText())
616 {
617 bVisible = true;
618 }
619 }
620
621 if(!bVisible)
622 {
623 SdrGrafObj* pGrafObj = dynamic_cast< SdrGrafObj* >(pObj.get());
624
625 if(pGrafObj)
626 {
627 // this may be refined to check if the graphic really is visible. It
628 // is here to ensure that graphic objects without fill, line and text
629 // get created
630 bVisible = true;
631 }
632 }
633
634 if(bVisible)
635 {
636 maTmpList.push_back(pObj);
637
638 if(dynamic_cast< SdrPathObj* >(pObj.get()))
639 {
640 const bool bClosed(pObj->IsClosedObj());
641
643 mbLastObjWasLine = !bClosed;
644 }
645 else
646 {
648 mbLastObjWasLine = false;
649 }
650 }
651}
652
654{
655 // #i73407# reformulation to use new B2DPolygon classes
656 const basegfx::B2DPoint aStart(rAct.GetStartPoint().X(), rAct.GetStartPoint().Y());
657 const basegfx::B2DPoint aEnd(rAct.GetEndPoint().X(), rAct.GetEndPoint().Y());
658
659 if(aStart.equal(aEnd))
660 return;
661
664
665 aLine.append(aStart);
666 aLine.append(aEnd);
667 aLine.transform(aTransform);
668
669 const LineInfo& rLineInfo = rAct.GetLineInfo();
670 const sal_Int32 nNewLineWidth(rLineInfo.GetWidth());
671 bool bCreateLineObject(true);
672
673 if(mbLastObjWasLine && (nNewLineWidth == mnLineWidth) && CheckLastLineMerge(aLine))
674 {
675 bCreateLineObject = false;
676 }
677
678 if(!bCreateLineObject)
679 return;
680
682 *mpModel,
685 mnLineWidth = nNewLineWidth;
686 maLineJoin = rLineInfo.GetLineJoin();
687 maLineCap = rLineInfo.GetLineCap();
688 maDash = XDash(css::drawing::DashStyle_RECT,
689 rLineInfo.GetDotCount(), rLineInfo.GetDotLen(),
690 rLineInfo.GetDashCount(), rLineInfo.GetDashLen(),
691 rLineInfo.GetDistance());
692 SetAttributes(pPath.get());
693 mnLineWidth = 0;
695 maDash = XDash();
696 InsertObj(pPath.get(), false);
697}
698
700{
702 *mpModel,
703 rAct.GetRect());
704 SetAttributes(pRect.get());
705 InsertObj(pRect.get());
706}
707
709{
711 *mpModel,
712 rAct.GetRect());
713 SetAttributes(pRect.get());
714 tools::Long nRad=(rAct.GetHorzRound()+rAct.GetVertRound())/2;
715 if (nRad!=0) {
718 pRect->SetMergedItemSet(aSet);
719 }
720 InsertObj(pRect.get());
721}
722
724{
726 *mpModel,
728 rAct.GetRect());
729 SetAttributes(pCirc.get());
730 InsertObj(pCirc.get());
731}
732
734{
735 Point aCenter(rAct.GetRect().Center());
736 Degree100 nStart=GetAngle(rAct.GetStartPoint()-aCenter);
737 Degree100 nEnd=GetAngle(rAct.GetEndPoint()-aCenter);
739 *mpModel,
741 rAct.GetRect(),nStart,nEnd);
742 SetAttributes(pCirc.get());
743 InsertObj(pCirc.get());
744}
745
747{
748 Point aCenter(rAct.GetRect().Center());
749 Degree100 nStart=GetAngle(rAct.GetStartPoint()-aCenter);
750 Degree100 nEnd=GetAngle(rAct.GetEndPoint()-aCenter);
752 *mpModel,
754 rAct.GetRect(),
755 nStart,
756 nEnd);
757 SetAttributes(pCirc.get());
758 InsertObj(pCirc.get());
759}
760
762{
763 Point aCenter(rAct.GetRect().Center());
764 Degree100 nStart=GetAngle(rAct.GetStartPoint()-aCenter);
765 Degree100 nEnd=GetAngle(rAct.GetEndPoint()-aCenter);
767 *mpModel,
769 rAct.GetRect(),
770 nStart,
771 nEnd);
772 SetAttributes(pCirc.get());
773 InsertObj(pCirc.get());
774}
775
777{
778 // #i102706# Do not merge closed polygons
779 if(rSrcPoly.isClosed())
780 {
781 return false;
782 }
783
784 // #i73407# reformulation to use new B2DPolygon classes
785 if(mbLastObjWasLine && (maOldLineColor == mpVD->GetLineColor()) && rSrcPoly.count())
786 {
787 SdrObject* pTmpObj = !maTmpList.empty() ? maTmpList[maTmpList.size() - 1].get() : nullptr;
788 SdrPathObj* pLastPoly = dynamic_cast< SdrPathObj* >(pTmpObj);
789
790 if(pLastPoly)
791 {
792 if(1 == pLastPoly->GetPathPoly().count())
793 {
794 bool bOk(false);
795 basegfx::B2DPolygon aDstPoly(pLastPoly->GetPathPoly().getB2DPolygon(0));
796
797 // #i102706# Do not merge closed polygons
798 if(aDstPoly.isClosed())
799 {
800 return false;
801 }
802
803 if(aDstPoly.count())
804 {
805 const sal_uInt32 nMaxDstPnt(aDstPoly.count() - 1);
806 const sal_uInt32 nMaxSrcPnt(rSrcPoly.count() - 1);
807
808 if(aDstPoly.getB2DPoint(nMaxDstPnt) == rSrcPoly.getB2DPoint(0))
809 {
810 aDstPoly.append(rSrcPoly, 1, rSrcPoly.count() - 1);
811 bOk = true;
812 }
813 else if(aDstPoly.getB2DPoint(0) == rSrcPoly.getB2DPoint(nMaxSrcPnt))
814 {
815 basegfx::B2DPolygon aNew(rSrcPoly);
816 aNew.append(aDstPoly, 1, aDstPoly.count() - 1);
817 aDstPoly = aNew;
818 bOk = true;
819 }
820 else if(aDstPoly.getB2DPoint(0) == rSrcPoly.getB2DPoint(0))
821 {
822 aDstPoly.flip();
823 aDstPoly.append(rSrcPoly, 1, rSrcPoly.count() - 1);
824 bOk = true;
825 }
826 else if(aDstPoly.getB2DPoint(nMaxDstPnt) == rSrcPoly.getB2DPoint(nMaxSrcPnt))
827 {
828 basegfx::B2DPolygon aNew(rSrcPoly);
829 aNew.flip();
830 aDstPoly.append(aNew, 1, aNew.count() - 1);
831 bOk = true;
832 }
833 }
834
835 if(bOk)
836 {
837 pLastPoly->NbcSetPathPoly(basegfx::B2DPolyPolygon(aDstPoly));
838 }
839
840 return bOk;
841 }
842 }
843 }
844
845 return false;
846}
847
849{
850 // #i73407# reformulation to use new B2DPolygon classes
852 {
853 SdrObject* pTmpObj = !maTmpList.empty() ? maTmpList[maTmpList.size() - 1].get() : nullptr;
854 SdrPathObj* pLastPoly = dynamic_cast< SdrPathObj* >(pTmpObj);
855
856 if(pLastPoly)
857 {
858 if(pLastPoly->GetPathPoly() == rPolyPolygon)
859 {
860 SetAttributes(nullptr);
861
862 if(!mbNoLine && mbNoFill)
863 {
864 pLastPoly->SetMergedItemSet(*mpLineAttr);
865
866 return true;
867 }
868 }
869 }
870 }
871
872 return false;
873}
874
876{
877 if(!mpVD->IsClipRegion())
878 return;
879
880 maClip = mpVD->GetClipRegion().GetAsB2DPolyPolygon();
881
882 if(isClip())
883 {
884 const basegfx::B2DHomMatrix aTransform(
886 mfScaleX,
887 mfScaleY,
888 maOfs.X(),
889 maOfs.Y()));
890
891 maClip.transform(aTransform);
892 }
893}
894
896{
897 return !maClip.getB2DRange().isEmpty();
898}
899
901{
902 // #i73407# reformulation to use new B2DPolygon classes
904
905 if(aSource.count())
906 {
908 aSource.transform(aTransform);
909 }
910
911 const LineInfo& rLineInfo = rAct.GetLineInfo();
912 const sal_Int32 nNewLineWidth(rLineInfo.GetWidth());
913 bool bCreateLineObject(true);
914
915 if(mbLastObjWasLine && (nNewLineWidth == mnLineWidth) && CheckLastLineMerge(aSource))
916 {
917 bCreateLineObject = false;
918 }
920 {
921 bCreateLineObject = false;
922 }
923
924 if(!bCreateLineObject)
925 return;
926
928 *mpModel,
930 basegfx::B2DPolyPolygon(aSource));
931 mnLineWidth = nNewLineWidth;
932 maLineJoin = rLineInfo.GetLineJoin();
933 maLineCap = rLineInfo.GetLineCap();
934 maDash = XDash(css::drawing::DashStyle_RECT,
935 rLineInfo.GetDotCount(), rLineInfo.GetDotLen(),
936 rLineInfo.GetDashCount(), rLineInfo.GetDashLen(),
937 rLineInfo.GetDistance());
938 SetAttributes(pPath.get());
939 mnLineWidth = 0;
941 maDash = XDash();
942 InsertObj(pPath.get(), false);
943}
944
946{
947 // #i73407# reformulation to use new B2DPolygon classes
949
950 if(!aSource.count())
951 return;
952
954 aSource.transform(aTransform);
955
957 {
958 // #i73407# make sure polygon is closed, it's a filled primitive
959 aSource.setClosed(true);
961 *mpModel,
963 basegfx::B2DPolyPolygon(aSource));
964 SetAttributes(pPath.get());
965 InsertObj(pPath.get(), false);
966 }
967}
968
970{
971 // #i73407# reformulation to use new B2DPolygon classes
973
974 if(!aSource.count())
975 return;
976
978 aSource.transform(aTransform);
979
981 {
982 // #i73407# make sure polygon is closed, it's a filled primitive
983 aSource.setClosed(true);
985 *mpModel,
987 std::move(aSource));
988 SetAttributes(pPath.get());
989 InsertObj(pPath.get(), false);
990 }
991}
992
993void ImpSdrGDIMetaFileImport::ImportText( const Point& rPos, const OUString& rStr, const MetaAction& rAct )
994{
995 // calc text box size, add 5% to make it fit safely
996
997 FontMetric aFontMetric( mpVD->GetFontMetric() );
998 vcl::Font aFnt( mpVD->GetFont() );
999 TextAlign eAlg( aFnt.GetAlignment() );
1000
1001 sal_Int32 nTextWidth = static_cast<sal_Int32>( mpVD->GetTextWidth( rStr ) * mfScaleX );
1002 sal_Int32 nTextHeight = static_cast<sal_Int32>( mpVD->GetTextHeight() * mfScaleY );
1003
1004 Point aPos( FRound(rPos.X() * mfScaleX + maOfs.X()), FRound(rPos.Y() * mfScaleY + maOfs.Y()) );
1005 Size aSize( nTextWidth, nTextHeight );
1006
1007 if ( eAlg == ALIGN_BASELINE )
1008 aPos.AdjustY( -(FRound(aFontMetric.GetAscent() * mfScaleY)) );
1009 else if ( eAlg == ALIGN_BOTTOM )
1010 aPos.AdjustY( -nTextHeight );
1011
1012 tools::Rectangle aTextRect( aPos, aSize );
1014 *mpModel,
1016 aTextRect);
1017
1018 pText->SetMergedItem ( makeSdrTextUpperDistItem (0));
1019 pText->SetMergedItem ( makeSdrTextLowerDistItem (0));
1020 pText->SetMergedItem ( makeSdrTextRightDistItem (0));
1021 pText->SetMergedItem ( makeSdrTextLeftDistItem (0));
1022
1023 if ( aFnt.GetAverageFontWidth() || ( rAct.GetType() == MetaActionType::STRETCHTEXT ) )
1024 {
1025 pText->ClearMergedItem( SDRATTR_TEXT_AUTOGROWWIDTH );
1026 pText->SetMergedItem( makeSdrTextAutoGrowHeightItem( false ) );
1027 // don't let the margins eat the space needed for the text
1028 pText->SetMergedItem( SdrTextFitToSizeTypeItem(drawing::TextFitToSizeType_ALLLINES) );
1029 }
1030 else
1031 {
1032 pText->SetMergedItem( makeSdrTextAutoGrowWidthItem( true ) );
1033 }
1034
1035 pText->SetLayer(mnLayer);
1036 pText->NbcSetText( rStr );
1037 SetAttributes( pText.get(), true );
1038 pText->SetSnapRect( aTextRect );
1039
1040 if (!aFnt.IsTransparent())
1041 {
1043 aAttr.Put(XFillStyleItem(drawing::FillStyle_SOLID));
1044 aAttr.Put(XFillColorItem(OUString(), aFnt.GetFillColor()));
1045 pText->SetMergedItemSet(aAttr);
1046 }
1047 Degree100 nAngle = to<Degree100>(aFnt.GetOrientation());
1048 if ( nAngle )
1049 pText->SdrAttrObj::NbcRotate(aPos,nAngle);
1050 InsertObj( pText.get(), false );
1051}
1052
1054{
1055 OUString aStr(rAct.GetText());
1056 aStr = aStr.copy(rAct.GetIndex(), rAct.GetLen());
1057 ImportText( rAct.GetPoint(), aStr, rAct );
1058}
1059
1061{
1062 OUString aStr(rAct.GetText());
1063 aStr = aStr.copy(rAct.GetIndex(), rAct.GetLen());
1064 ImportText( rAct.GetPoint(), aStr, rAct );
1065}
1066
1068{
1069 OUString aStr(rAct.GetText());
1070 aStr = aStr.copy(rAct.GetIndex(), rAct.GetLen());
1071 ImportText( rAct.GetPoint(), aStr, rAct );
1072}
1073
1075{
1076 tools::Rectangle aRect(rAct.GetPoint(),rAct.GetBitmap().GetSizePixel());
1077 aRect.AdjustRight( 1 ); aRect.AdjustBottom( 1 );
1079 *mpModel,
1080 Graphic(BitmapEx(rAct.GetBitmap())),
1081 aRect);
1082
1083 // This action is not creating line and fill, set directly, do not use SetAttributes(..)
1084 pGraf->SetMergedItem(XLineStyleItem(drawing::LineStyle_NONE));
1085 pGraf->SetMergedItem(XFillStyleItem(drawing::FillStyle_NONE));
1086 InsertObj(pGraf.get());
1087}
1088
1090{
1091 tools::Rectangle aRect(rAct.GetPoint(),rAct.GetSize());
1092 aRect.AdjustRight( 1 ); aRect.AdjustBottom( 1 );
1094 *mpModel,
1095 Graphic(BitmapEx(rAct.GetBitmap())),
1096 aRect);
1097
1098 // This action is not creating line and fill, set directly, do not use SetAttributes(..)
1099 pGraf->SetMergedItem(XLineStyleItem(drawing::LineStyle_NONE));
1100 pGraf->SetMergedItem(XFillStyleItem(drawing::FillStyle_NONE));
1101 InsertObj(pGraf.get());
1102}
1103
1105{
1106 tools::Rectangle aRect(rAct.GetPoint(),rAct.GetBitmapEx().GetSizePixel());
1107 aRect.AdjustRight( 1 ); aRect.AdjustBottom( 1 );
1109 *mpModel,
1110 rAct.GetBitmapEx(),
1111 aRect);
1112
1113 // This action is not creating line and fill, set directly, do not use SetAttributes(..)
1114 pGraf->SetMergedItem(XLineStyleItem(drawing::LineStyle_NONE));
1115 pGraf->SetMergedItem(XFillStyleItem(drawing::FillStyle_NONE));
1116 InsertObj(pGraf.get());
1117}
1118
1120{
1121 tools::Rectangle aRect(rAct.GetPoint(),rAct.GetSize());
1122 aRect.AdjustRight( 1 ); aRect.AdjustBottom( 1 );
1124 *mpModel,
1125 rAct.GetBitmapEx(),
1126 aRect);
1127
1128 // This action is not creating line and fill, set directly, do not use SetAttributes(..)
1129 pGraf->SetMergedItem(XLineStyleItem(drawing::LineStyle_NONE));
1130 pGraf->SetMergedItem(XFillStyleItem(drawing::FillStyle_NONE));
1131 InsertObj(pGraf.get());
1132}
1133
1134
1136{
1137 // #i73407# reformulation to use new B2DPolygon classes
1139
1140 if(!aSource.count())
1141 return;
1142
1144 aSource.transform(aTransform);
1145
1147 return;
1148
1149 const Hatch& rHatch = rAct.GetHatch();
1151 *mpModel,
1153 std::move(aSource));
1154 // #i125211# Use the ranges from the SdrObject to create a new empty SfxItemSet
1155 SfxItemSet aHatchAttr(mpModel->GetItemPool(), pPath->GetMergedItemSet().GetRanges());
1156 css::drawing::HatchStyle eStyle;
1157
1158 switch(rHatch.GetStyle())
1159 {
1160 case HatchStyle::Triple :
1161 {
1162 eStyle = css::drawing::HatchStyle_TRIPLE;
1163 break;
1164 }
1165
1166 case HatchStyle::Double :
1167 {
1168 eStyle = css::drawing::HatchStyle_DOUBLE;
1169 break;
1170 }
1171
1172 default:
1173 {
1174 eStyle = css::drawing::HatchStyle_SINGLE;
1175 break;
1176 }
1177 }
1178
1179 SetAttributes(pPath.get());
1180 aHatchAttr.Put(XFillStyleItem(drawing::FillStyle_HATCH));
1181 aHatchAttr.Put(XFillHatchItem(XHatch(rHatch.GetColor(), eStyle, rHatch.GetDistance(), rHatch.GetAngle())));
1182 pPath->SetMergedItemSet(aHatchAttr);
1183
1184 InsertObj(pPath.get(), false);
1185}
1186
1187
1189{
1190 rAct.Execute(mpVD);
1191}
1192
1194{
1195 MapScaling();
1196 rAct.Execute(mpVD);
1198 mbLastObjWasLine = false;
1199}
1200
1202{
1203 const size_t nCount(maTmpList.size());
1204 const MapMode& rMap = mpVD->GetMapMode();
1205 Point aMapOrg( rMap.GetOrigin() );
1206 bool bMov2(aMapOrg.X() != 0 || aMapOrg.Y() != 0);
1207
1208 if(bMov2)
1209 {
1210 for(size_t i = mnMapScalingOfs; i < nCount; i++)
1211 {
1212 SdrObject* pObj = maTmpList[i].get();
1213
1214 pObj->NbcMove(Size(aMapOrg.X(), aMapOrg.Y()));
1215 }
1216 }
1217
1219}
1220
1221
1222void ImpSdrGDIMetaFileImport::DoAction( MetaCommentAction const & rAct, GDIMetaFile const & rMtf, sal_uLong& a) // GDIMetaFile* pMtf )
1223{
1224 bool aSkipComment = false;
1225
1226 if (a < rMtf.GetActionSize() && rAct.GetComment().equalsIgnoreAsciiCase("XGRAD_SEQ_BEGIN"))
1227 {
1228 // #i125211# Check if next action is a MetaGradientExAction
1229 MetaGradientExAction* pAct = dynamic_cast< MetaGradientExAction* >(rMtf.GetAction(a + 1));
1230
1231 if( pAct && pAct->GetType() == MetaActionType::GRADIENTEX )
1232 {
1233 // #i73407# reformulation to use new B2DPolygon classes
1235
1236 if(aSource.count())
1237 {
1239 {
1240 const Gradient& rGrad = pAct->GetGradient();
1242 *mpModel,
1244 std::move(aSource));
1245 // #i125211# Use the ranges from the SdrObject to create a new empty SfxItemSet
1246 SfxItemSet aGradAttr(mpModel->GetItemPool(), pPath->GetMergedItemSet().GetRanges());
1247 basegfx::BGradient aBGradient(
1249 rGrad.GetStartColor().getBColor(),
1250 rGrad.GetEndColor().getBColor()));
1251
1252 aBGradient.SetGradientStyle(rGrad.GetStyle());
1253 aBGradient.SetAngle(rGrad.GetAngle());
1254 aBGradient.SetBorder(rGrad.GetBorder());
1255 aBGradient.SetXOffset(rGrad.GetOfsX());
1256 aBGradient.SetYOffset(rGrad.GetOfsY());
1257 aBGradient.SetStartIntens(rGrad.GetStartIntensity());
1258 aBGradient.SetEndIntens(rGrad.GetEndIntensity());
1259 aBGradient.SetSteps(rGrad.GetSteps());
1260
1261 // no need to use SetAttributes(..) here since line and fill style
1262 // need to be set individually
1263 // SetAttributes(pPath);
1264
1265 // switch line off; if there was one there will be a
1266 // MetaActionType::POLYLINE following creating another object
1267 aGradAttr.Put(XLineStyleItem(drawing::LineStyle_NONE));
1268
1269 // add detected gradient fillstyle
1270 aGradAttr.Put(XFillStyleItem(drawing::FillStyle_GRADIENT));
1271 aGradAttr.Put(XFillGradientItem(aBGradient));
1272
1273 pPath->SetMergedItemSet(aGradAttr);
1274
1275 InsertObj(pPath.get());
1276 }
1277 }
1278
1279 aSkipComment = true;
1280 }
1281 }
1282
1283 if(aSkipComment)
1284 {
1285 // #i125211# forward until closing MetaCommentAction
1286 MetaAction* pSkipAct = rMtf.GetAction(++a);
1287
1288 while( pSkipAct
1289 && ((pSkipAct->GetType() != MetaActionType::COMMENT )
1290 || !(static_cast<MetaCommentAction*>(pSkipAct)->GetComment().equalsIgnoreAsciiCase("XGRAD_SEQ_END"))))
1291 {
1292 pSkipAct = rMtf.GetAction(++a);
1293 }
1294 }
1295}
1296
1298{
1299 GDIMetaFile aTemp;
1300
1301 mpVD->AddTextRectActions(rAct.GetRect(), rAct.GetText(), rAct.GetStyle(), aTemp);
1302 DoLoopActions(aTemp, nullptr, nullptr);
1303}
1304
1306{
1307 tools::Rectangle aRect(rAct.GetDestPoint(), rAct.GetDestSize());
1308 BitmapEx aBitmapEx(rAct.GetBitmap());
1309
1310 aRect.AdjustRight( 1 );
1311 aRect.AdjustBottom( 1 );
1312 aBitmapEx.Crop(tools::Rectangle(rAct.GetSrcPoint(), rAct.GetSrcSize()));
1314 *mpModel,
1315 aBitmapEx,
1316 aRect);
1317
1318 // This action is not creating line and fill, set directly, do not use SetAttributes(..)
1319 pGraf->SetMergedItem(XLineStyleItem(drawing::LineStyle_NONE));
1320 pGraf->SetMergedItem(XFillStyleItem(drawing::FillStyle_NONE));
1321 InsertObj(pGraf.get());
1322}
1323
1325{
1326 tools::Rectangle aRect(rAct.GetDestPoint(),rAct.GetDestSize());
1327 BitmapEx aBitmapEx(rAct.GetBitmapEx());
1328
1329 aRect.AdjustRight( 1 );
1330 aRect.AdjustBottom( 1 );
1331 aBitmapEx.Crop(tools::Rectangle(rAct.GetSrcPoint(), rAct.GetSrcSize()));
1333 *mpModel,
1334 aBitmapEx,
1335 aRect);
1336
1337 // This action is not creating line and fill, set directly, do not use SetAttributes(..)
1338 pGraf->SetMergedItem(XLineStyleItem(drawing::LineStyle_NONE));
1339 pGraf->SetMergedItem(XFillStyleItem(drawing::FillStyle_NONE));
1340 InsertObj(pGraf.get());
1341}
1342
1344{
1345 tools::Rectangle aRect(rAct.GetPoint(), rAct.GetBitmap().GetSizePixel());
1346 BitmapEx aBitmapEx(rAct.GetBitmap(), rAct.GetColor());
1347
1348 aRect.AdjustRight( 1 ); aRect.AdjustBottom( 1 );
1350 *mpModel,
1351 aBitmapEx,
1352 aRect);
1353
1354 // This action is not creating line and fill, set directly, do not use SetAttributes(..)
1355 pGraf->SetMergedItem(XLineStyleItem(drawing::LineStyle_NONE));
1356 pGraf->SetMergedItem(XFillStyleItem(drawing::FillStyle_NONE));
1357 InsertObj(pGraf.get());
1358}
1359
1361{
1362 tools::Rectangle aRect(rAct.GetPoint(), rAct.GetSize());
1363 BitmapEx aBitmapEx(rAct.GetBitmap(), rAct.GetColor());
1364
1365 aRect.AdjustRight( 1 ); aRect.AdjustBottom( 1 );
1367 *mpModel,
1368 aBitmapEx,
1369 aRect);
1370
1371 // This action is not creating line and fill, set directly, do not use SetAttributes(..)
1372 pGraf->SetMergedItem(XLineStyleItem(drawing::LineStyle_NONE));
1373 pGraf->SetMergedItem(XFillStyleItem(drawing::FillStyle_NONE));
1374 InsertObj(pGraf.get());
1375}
1376
1378{
1379 tools::Rectangle aRect(rAct.GetDestPoint(), rAct.GetDestSize());
1380 BitmapEx aBitmapEx(rAct.GetBitmap(), rAct.GetColor());
1381
1382 aRect.AdjustRight( 1 ); aRect.AdjustBottom( 1 );
1383 aBitmapEx.Crop(tools::Rectangle(rAct.GetSrcPoint(), rAct.GetSrcSize()));
1385 *mpModel,
1386 aBitmapEx,
1387 aRect);
1388
1389 // This action is not creating line and fill, set directly, do not use SetAttributes(..)
1390 pGraf->SetMergedItem(XLineStyleItem(drawing::LineStyle_NONE));
1391 pGraf->SetMergedItem(XFillStyleItem(drawing::FillStyle_NONE));
1392 InsertObj(pGraf.get());
1393}
1394
1396{
1398
1399 if(aRange.isEmpty())
1400 return;
1401
1403 aRange.transform(aTransform);
1404 const Gradient& rGradient = rAct.GetGradient();
1406 *mpModel,
1408 floor(aRange.getMinX()),
1409 floor(aRange.getMinY()),
1410 ceil(aRange.getMaxX()),
1411 ceil(aRange.getMaxY())));
1412 // #i125211# Use the ranges from the SdrObject to create a new empty SfxItemSet
1413 SfxItemSet aGradientAttr(mpModel->GetItemPool(), pRect->GetMergedItemSet().GetRanges());
1414 const XFillGradientItem aXFillGradientItem(
1417 rGradient.GetStartColor().getBColor(),
1418 rGradient.GetEndColor().getBColor()),
1419 rGradient.GetStyle(),
1420 rGradient.GetAngle(),
1421 rGradient.GetOfsX(),
1422 rGradient.GetOfsY(),
1423 rGradient.GetBorder(),
1424 rGradient.GetStartIntensity(),
1425 rGradient.GetEndIntensity(),
1426 rGradient.GetSteps()));
1427
1428 SetAttributes(pRect.get());
1429 aGradientAttr.Put(XFillStyleItem(drawing::FillStyle_GRADIENT)); // #i125211#
1430 aGradientAttr.Put(aXFillGradientItem);
1431 pRect->SetMergedItemSet(aGradientAttr);
1432
1433 InsertObj(pRect.get(), false);
1434}
1435
1437{
1439
1440 if(!aSource.count())
1441 return;
1442
1444 aSource.transform(aTransform);
1445 aSource.setClosed(true);
1446
1448 *mpModel,
1450 std::move(aSource));
1451 SetAttributes(pPath.get());
1452 pPath->SetMergedItem(XFillTransparenceItem(rAct.GetTransparence()));
1453 InsertObj(pPath.get(), false);
1454}
1455
1457{
1459
1460 if(!aSource.count())
1461 return;
1462
1464 aSource.transform(aTransform);
1465
1467 return;
1468
1469 const Gradient& rGradient = rAct.GetGradient();
1471 *mpModel,
1473 std::move(aSource));
1474 // #i125211# Use the ranges from the SdrObject to create a new empty SfxItemSet
1475 SfxItemSet aGradientAttr(mpModel->GetItemPool(), pPath->GetMergedItemSet().GetRanges());
1476 const XFillGradientItem aXFillGradientItem(
1479 rGradient.GetStartColor().getBColor(),
1480 rGradient.GetEndColor().getBColor()),
1481 rGradient.GetStyle(),
1482 rGradient.GetAngle(),
1483 rGradient.GetOfsX(),
1484 rGradient.GetOfsY(),
1485 rGradient.GetBorder(),
1486 rGradient.GetStartIntensity(),
1487 rGradient.GetEndIntensity(),
1488 rGradient.GetSteps()));
1489
1490 SetAttributes(pPath.get());
1491 aGradientAttr.Put(XFillStyleItem(drawing::FillStyle_GRADIENT)); // #i125211#
1492 aGradientAttr.Put(aXFillGradientItem);
1493 pPath->SetMergedItemSet(aGradientAttr);
1494
1495 InsertObj(pPath.get(), false);
1496}
1497
1499{
1500 const GDIMetaFile& rMtf = rAct.GetGDIMetaFile();
1501
1502 if(!rMtf.GetActionSize())
1503 return;
1504
1505 const tools::Rectangle aRect(rAct.GetPoint(),rAct.GetSize());
1506
1507 // convert metafile sub-content to BitmapEx
1508 BitmapEx aBitmapEx(
1510 rMtf,
1512 125000));
1513
1514 // handle colors
1515 const Gradient& rGradient = rAct.GetGradient();
1516 basegfx::BColor aStart(rGradient.GetStartColor().getBColor());
1517 basegfx::BColor aEnd(rGradient.GetEndColor().getBColor());
1518
1519 if(100 != rGradient.GetStartIntensity())
1520 {
1521 aStart *= static_cast<double>(rGradient.GetStartIntensity()) / 100.0;
1522 }
1523
1524 if(100 != rGradient.GetEndIntensity())
1525 {
1526 aEnd *= static_cast<double>(rGradient.GetEndIntensity()) / 100.0;
1527 }
1528
1529 const bool bEqualColors(aStart == aEnd);
1530 const bool bNoSteps(1 == rGradient.GetSteps());
1531 bool bCreateObject(true);
1532 bool bHasNewMask(false);
1533 AlphaMask aNewMask;
1534 double fTransparence(0.0);
1535 bool bFixedTransparence(false);
1536
1537 if(bEqualColors || bNoSteps)
1538 {
1539 // single transparence
1540 const basegfx::BColor aMedium(basegfx::average(aStart, aEnd));
1541 fTransparence = aMedium.luminance();
1542
1543 if(basegfx::fTools::lessOrEqual(fTransparence, 0.0))
1544 {
1545 // no transparence needed, all done
1546 }
1547 else if(basegfx::fTools::moreOrEqual(fTransparence, 1.0))
1548 {
1549 // all transparent, no object
1550 bCreateObject = false;
1551 }
1552 else
1553 {
1554 // 0.0 < transparence < 1.0, apply fixed transparence
1555 bFixedTransparence = true;
1556 }
1557 }
1558 else
1559 {
1560 // gradient transparence
1562
1563 pVDev->SetOutputSizePixel(aBitmapEx.GetBitmap().GetSizePixel());
1564 pVDev->DrawGradient(tools::Rectangle(Point(0, 0), pVDev->GetOutputSizePixel()), rGradient);
1565
1566 aNewMask = AlphaMask(pVDev->GetBitmap(Point(0, 0), pVDev->GetOutputSizePixel()));
1567 aNewMask.Invert(); // convert transparency to alpha
1568 bHasNewMask = true;
1569 }
1570
1571 if(!bCreateObject)
1572 return;
1573
1574 if(bHasNewMask || bFixedTransparence)
1575 {
1576 if(!aBitmapEx.IsAlpha())
1577 {
1578 // no transparence yet, apply new one
1579 if(bFixedTransparence)
1580 {
1581 sal_uInt8 nTransparence(basegfx::fround(fTransparence * 255.0));
1582
1583 aNewMask = AlphaMask(aBitmapEx.GetBitmap().GetSizePixel(), &nTransparence);
1584 }
1585
1586 aBitmapEx = BitmapEx(aBitmapEx.GetBitmap(), aNewMask);
1587 }
1588 else
1589 {
1590 vcl::bitmap::DrawAlphaBitmapAndAlphaGradient(aBitmapEx, bFixedTransparence, fTransparence, aNewMask);
1591 }
1592 }
1593
1594 // create and add object
1596 *mpModel,
1597 aBitmapEx,
1598 aRect);
1599
1600 // for MetaFloatTransparentAction, do not use SetAttributes(...)
1601 // since these metafile content is not used to draw line/fill
1602 // dependent of these setting at the device content
1603 pGraf->SetMergedItem(XLineStyleItem(drawing::LineStyle_NONE));
1604 pGraf->SetMergedItem(XFillStyleItem(drawing::FillStyle_NONE));
1605 InsertObj(pGraf.get());
1606}
1607
1608/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const int mnLayer
bool IsAlpha() const
bool IsEmpty() const
Bitmap GetBitmap(Color aTransparentReplaceColor) const
bool Crop(const tools::Rectangle &rRectPixel)
const Size & GetSizePixel() const
Size GetSizePixel() const
bool Invert()
void SetRed(sal_uInt8 nRed)
basegfx::BColor getBColor() const
tools::Long GetAscent() const
size_t GetActionSize() const
const Size & GetPrefSize() const
MetaAction * GetAction(size_t nAction) const
sal_uInt16 GetStartIntensity() const
Degree10 GetAngle() const
sal_uInt16 GetEndIntensity() const
sal_uInt16 GetOfsX() const
sal_uInt16 GetBorder() const
const Color & GetEndColor() const
sal_uInt16 GetOfsY() const
const Color & GetStartColor() const
css::awt::GradientStyle GetStyle() const
sal_uInt16 GetSteps() const
BitmapEx GetBitmapEx(const GraphicConversionParameters &rParameters=GraphicConversionParameters()) const
Degree10 GetAngle() const
HatchStyle GetStyle() const
tools::Long GetDistance() const
const Color & GetColor() const
std::unique_ptr< SfxItemSet > mpFillAttr
Definition: svdfmtf.hxx:53
basegfx::B2DPolyPolygon maClip
Definition: svdfmtf.hxx:82
void InsertObj(SdrObject *pObj, bool bScale=true)
Definition: svdfmtf.cxx:444
ImpSdrGDIMetaFileImport(const ImpSdrGDIMetaFileImport &)=delete
bool CheckLastPolyLineAndFillMerge(const basegfx::B2DPolyPolygon &rPolyPolygon)
Definition: svdfmtf.cxx:848
css::drawing::LineCap maLineCap
Definition: svdfmtf.hxx:60
std::unique_ptr< SfxItemSet > mpLineAttr
Definition: svdfmtf.hxx:52
bool isClip() const
Definition: svdfmtf.cxx:895
::std::vector< rtl::Reference< SdrObject > > maTmpList
Definition: svdfmtf.hxx:48
void SetAttributes(SdrObject *pObj, bool bForceTextAttr=false)
Definition: svdfmtf.cxx:312
tools::Rectangle maScaleRect
Definition: svdfmtf.hxx:50
std::unique_ptr< SfxItemSet > mpTextAttr
Definition: svdfmtf.hxx:54
void DoLoopActions(GDIMetaFile const &rMtf, SvdProgressInfo *pProgrInfo, sal_uInt32 *pActionsToReport)
Definition: svdfmtf.cxx:115
bool mbLastObjWasPolyWithoutLine
Definition: svdfmtf.hxx:74
void ImportText(const Point &rPos, const OUString &rStr, const MetaAction &rAct)
Definition: svdfmtf.cxx:993
basegfx::B2DLineJoin maLineJoin
Definition: svdfmtf.hxx:59
ScopedVclPtr< VirtualDevice > mpVD
Definition: svdfmtf.hxx:49
size_t DoImport(const GDIMetaFile &rMtf, SdrObjList &rDestList, size_t nInsPos, SvdProgressInfo *pProgrInfo=nullptr)
Definition: svdfmtf.cxx:207
bool CheckLastLineMerge(const basegfx::B2DPolygon &rSrcPoly)
Definition: svdfmtf.cxx:776
void DoAction(MetaLineAction const &rAct)
Definition: svdfmtf.cxx:653
double GetWidth() const
basegfx::B2DLineJoin GetLineJoin() const
double GetDotLen() const
double GetDistance() const
sal_uInt16 GetDashCount() const
double GetDashLen() const
css::drawing::LineCap GetLineCap() const
sal_uInt16 GetDotCount() const
const Point & GetOrigin() const
MetaActionType GetType() const
const Point & GetStartPoint() const
const tools::Rectangle & GetRect() const
const Point & GetEndPoint() const
const Bitmap & GetBitmap() const
const Point & GetPoint() const
const BitmapEx & GetBitmapEx() const
const Point & GetPoint() const
const Size & GetSize() const
const Point & GetPoint() const
const BitmapEx & GetBitmapEx() const
const Point & GetSrcPoint() const
const Size & GetDestSize() const
const Point & GetDestPoint() const
const Size & GetSrcSize() const
const BitmapEx & GetBitmapEx() const
const Point & GetPoint() const
const Size & GetSize() const
const Bitmap & GetBitmap() const
const Bitmap & GetBitmap() const
const Point & GetDestPoint() const
const Point & GetSrcPoint() const
const Size & GetSrcSize() const
const Size & GetDestSize() const
const tools::Rectangle & GetRect() const
const Point & GetStartPoint() const
const Point & GetEndPoint() const
const OString & GetComment() const
const tools::Rectangle & GetRect() const
const Gradient & GetGradient() const
const Size & GetSize() const
const GDIMetaFile & GetGDIMetaFile() const
const Point & GetPoint() const
const tools::Rectangle & GetRect() const
const Gradient & GetGradient() const
const tools::PolyPolygon & GetPolyPolygon() const
const Gradient & GetGradient() const
const tools::PolyPolygon & GetPolyPolygon() const
const Hatch & GetHatch() const
const LineInfo & GetLineInfo() const
const Point & GetEndPoint() const
const Point & GetStartPoint() const
virtual void Execute(OutputDevice *pOut) override
virtual void Execute(OutputDevice *pOut) override
const Point & GetPoint() const
const Bitmap & GetBitmap() const
const Color & GetColor() const
const Bitmap & GetBitmap() const
const Point & GetPoint() const
const Color & GetColor() const
const Size & GetSize() const
const Bitmap & GetBitmap() const
const Point & GetSrcPoint() const
const Color & GetColor() const
const Size & GetSrcSize() const
const Point & GetDestPoint() const
const Size & GetDestSize() const
const Point & GetEndPoint() const
const Point & GetStartPoint() const
const tools::Rectangle & GetRect() const
const LineInfo & GetLineInfo() const
const tools::Polygon & GetPolygon() const
const tools::PolyPolygon & GetPolyPolygon() const
const tools::Polygon & GetPolygon() const
const tools::Rectangle & GetRect() const
sal_uInt32 GetHorzRound() const
sal_uInt32 GetVertRound() const
const tools::Rectangle & GetRect() const
sal_Int32 GetLen() const
sal_Int32 GetIndex() const
const OUString & GetText() const
const Point & GetPoint() const
const Point & GetPoint() const
sal_Int32 GetLen() const
const OUString & GetText() const
sal_Int32 GetIndex() const
sal_Int32 GetIndex() const
sal_Int32 GetLen() const
const OUString & GetText() const
const Point & GetPoint() const
DrawTextFlags GetStyle() const
const tools::Rectangle & GetRect() const
const OUString & GetText() const
sal_uInt16 GetTransparence() const
const tools::PolyPolygon & GetPolyPolygon() const
constexpr tools::Long Y() const
tools::Long AdjustY(tools::Long nVertMove)
constexpr tools::Long X() const
This class represents an embedded or linked bitmap graphic object.
Definition: svdograf.hxx:68
const Graphic & GetGraphic() const
Definition: svdograf.cxx:381
const SfxItemPool & GetItemPool() const
Definition: svdmodel.hxx:318
SdrObject * Next()
Definition: svditer.hxx:63
bool IsMore() const
Definition: svditer.hxx:62
size_t GetObjCount() const
Definition: svdpage.cxx:779
virtual void NbcInsertObject(SdrObject *pObj, size_t nPos=SAL_MAX_SIZE)
Definition: svdpage.cxx:244
Abstract DrawObject.
Definition: svdobj.hxx:260
bool IsClosedObj() const
Definition: svdobj.hxx:745
virtual OutlinerParaObject * GetOutlinerParaObject() const
Definition: svdobj.cxx:1833
void SetMergedItemSet(const SfxItemSet &rSet, bool bClearAllItems=false)
Definition: svdobj.cxx:1999
rtl::Reference< SdrObject > ConvertToPolyObj(bool bBezier, bool bLineToArea) const
Definition: svdobj.cxx:2620
SdrModel & getSdrModelFromSdrObject() const
Definition: svdobj.cxx:289
virtual rtl::Reference< SdrObject > CloneSdrObject(SdrModel &rTargetModel) const =0
void SetMergedItem(const SfxPoolItem &rItem)
Definition: svdobj.cxx:1984
virtual void SetLayer(SdrLayerID nLayer)
Definition: svdobj.cxx:669
virtual void NbcMove(const Size &rSiz)
The methods Move, Resize, Rotate, Mirror, Shear, SetSnapRect and SetLogicRect call the corresponding ...
Definition: svdobj.cxx:1439
void NbcSetPathPoly(const basegfx::B2DPolyPolygon &rPathPoly)
Definition: svdopath.cxx:2727
const basegfx::B2DPolyPolygon & GetPathPoly() const
Definition: svdopath.hxx:141
Rectangle objects (rectangle, circle, ...)
Definition: svdorect.hxx:39
virtual basegfx::B2DPolyPolygon TakeContour() const override
contour for TextToContour
Definition: svdotext.cxx:1113
virtual bool HasText() const override
Definition: svdotxat.cxx:420
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
constexpr tools::Long Height() const
constexpr tools::Long Width() const
Helper class for the communication between the dialog In order to break open Metafiles (sd/source/ui/...
Definition: svdetc.hxx:111
void ReportInserts(size_t nInsertCount)
Definition: svdetc.cxx:435
void SetActionCount(size_t _nActionCount)
Definition: svdetc.cxx:449
bool ReportActions(size_t nActionCount)
Definition: svdetc.cxx:425
void SetInsertCount(size_t _nInsertCount)
Definition: svdetc.cxx:454
void ReportRescales(size_t nRescaleCount)
Definition: svdetc.cxx:443
Definition: xdash.hxx:32
double GetDotLen() const
Definition: xdash.hxx:56
double GetDashLen() const
Definition: xdash.hxx:58
double GetDistance() const
Definition: xdash.hxx:59
sal_uInt16 GetDots() const
Definition: xdash.hxx:55
sal_uInt16 GetDashes() const
Definition: xdash.hxx:57
void translate(double fX, double fY)
void scale(double fX, double fY)
B2DPolygon const & getB2DPolygon(sal_uInt32 nIndex) const
void transform(const basegfx::B2DHomMatrix &rMatrix)
void setClosed(bool bNew)
B2DRange getB2DRange() const
sal_uInt32 count() const
bool isClosed() const
basegfx::B2DPoint const & getB2DPoint(sal_uInt32 nIndex) const
void transform(const basegfx::B2DHomMatrix &rMatrix)
void append(const basegfx::B2DPoint &rPoint, sal_uInt32 nCount)
sal_uInt32 count() const
void setClosed(bool bNew)
BASEGFX_DLLPUBLIC void transform(const B2DHomMatrix &rMatrix)
double luminance() const
void SetGradientStyle(css::awt::GradientStyle eNewStyle)
void SetEndIntens(sal_uInt16 nNewIntens)
void SetYOffset(sal_uInt16 nNewOffset)
void SetXOffset(sal_uInt16 nNewOffset)
void SetSteps(sal_uInt16 nSteps)
void SetBorder(sal_uInt16 nNewBorder)
void SetStartIntens(sal_uInt16 nNewIntens)
void SetAngle(Degree10 nNewAngle)
TYPE getMaxX() const
TYPE getWidth() const
TYPE getMinX() const
TYPE getMinY() const
TYPE getMaxY() const
bool isInside(const Tuple2D< TYPE > &rTuple) const
bool isEmpty() const
TYPE getHeight() const
bool overlaps(const Range2D &rRange) const
bool equal(const Tuple2D< TYPE > &rTup) const
::basegfx::B2DPolyPolygon getB2DPolyPolygon() const
::basegfx::B2DPolygon getB2DPolygon() const
constexpr Point Center() const
constexpr tools::Long GetWidth() const
constexpr Point TopLeft() const
tools::Long AdjustRight(tools::Long nHorzMoveDelta)
constexpr tools::Long GetHeight() const
tools::Long AdjustBottom(tools::Long nVertMoveDelta)
constexpr bool IsEmpty() const
FontFamily GetFamilyType()
const OUString & GetStyleName() const
FontStrikeout GetStrikeout() const
bool IsShadow() const
FontLineStyle GetOverline() const
FontItalic GetItalic()
bool IsTransparent() const
const OUString & GetFamilyName() const
TextAlign GetAlignment() const
const Size & GetFontSize() const
FontPitch GetPitch()
FontWeight GetWeight()
FontLineStyle GetUnderline() const
rtl_TextEncoding GetCharSet() const
bool IsOutline() const
bool IsWordLineMode() const
Degree10 GetOrientation() const
const Color & GetFillColor() const
tools::Long GetAverageFontWidth() const
int nCount
constexpr TypedWhichId< SvxContourItem > EE_CHAR_OUTLINE(EE_CHAR_START+8)
constexpr TypedWhichId< SvxFontItem > EE_CHAR_FONTINFO_CJK(EE_CHAR_START+17)
constexpr TypedWhichId< SvxUnderlineItem > EE_CHAR_UNDERLINE(EE_CHAR_START+5)
constexpr TypedWhichId< SvxFontHeightItem > EE_CHAR_FONTHEIGHT(EE_CHAR_START+2)
constexpr TypedWhichId< SvxShadowedItem > EE_CHAR_SHADOW(EE_CHAR_START+9)
constexpr TypedWhichId< SvxOverlineItem > EE_CHAR_OVERLINE(EE_CHAR_START+29)
constexpr TypedWhichId< SvxWeightItem > EE_CHAR_WEIGHT(EE_CHAR_START+4)
constexpr TypedWhichId< SvxColorItem > EE_CHAR_COLOR(EE_CHAR_START+0)
constexpr TypedWhichId< SvxCrossedOutItem > EE_CHAR_STRIKEOUT(EE_CHAR_START+6)
constexpr TypedWhichId< SvxPostureItem > EE_CHAR_ITALIC(EE_CHAR_START+7)
constexpr TypedWhichId< SvxFontHeightItem > EE_CHAR_FONTHEIGHT_CTL(EE_CHAR_START+20)
constexpr TypedWhichId< SvxFontItem > EE_CHAR_FONTINFO_CTL(EE_CHAR_START+18)
constexpr TypedWhichId< SvxCharScaleWidthItem > EE_CHAR_FONTWIDTH(EE_CHAR_START+3)
constexpr TypedWhichId< SvxWordLineModeItem > EE_CHAR_WLM(EE_CHAR_START+13)
constexpr TypedWhichId< SvxFontHeightItem > EE_CHAR_FONTHEIGHT_CJK(EE_CHAR_START+19)
constexpr TypedWhichId< SvxFontItem > EE_CHAR_FONTINFO(EE_CHAR_START+1)
ALIGN_BOTTOM
ALIGN_BASELINE
tools::Long FRound(double fVal)
uno_Any a
aStr
NONE
bool lessOrEqual(const T &rfValA, const T &rfValB)
bool moreOrEqual(const T &rfValA, const T &rfValB)
B2DHomMatrix createScaleTranslateB2DHomMatrix(double fScaleX, double fScaleY, double fTranslateX, double fTranslateY)
bool isRectangle(const B2DPolygon &rPoly)
B2DPolyPolygon clipPolyPolygonOnPolyPolygon(const B2DPolyPolygon &rCandidate, const B2DPolyPolygon &rClip, bool bInside, bool bStroke, size_t *pPointLimit)
B2DTuple average(const B2DTuple &rOld1, const B2DTuple &rOld2)
B2IRange fround(const B2DRange &rRange)
B2DLineJoin
int i
void Create(SvxOrientationItem &rItem, SvStream &rStrm, sal_uInt16)
Definition: legacyitem.cxx:34
TextAlign
long Long
void DrawAlphaBitmapAndAlphaGradient(BitmapEx &rBitmapEx, bool bFixedTransparence, float fTransparence, AlphaMask &rNewMask)
basegfx::B2DRange b2DRectangleFromRectangle(const ::tools::Rectangle &rRect)
SdrOnOffItem makeSdrTextAutoGrowHeightItem(bool bAuto)
Definition: sdtagitm.hxx:25
SdrOnOffItem makeSdrTextAutoGrowWidthItem(bool bAuto)
Definition: sdtagitm.hxx:30
@ SDRTEXTHORZADJUST_LEFT
Definition: sdtaitm.hxx:53
SdrMetricItem makeSdrTextUpperDistItem(tools::Long mnHeight)
Definition: sdtditm.hxx:35
SdrMetricItem makeSdrTextRightDistItem(tools::Long mnHeight)
Definition: sdtditm.hxx:30
SdrMetricItem makeSdrTextLowerDistItem(tools::Long mnHeight)
Definition: sdtditm.hxx:40
SdrMetricItem makeSdrTextLeftDistItem(tools::Long mnHeight)
Definition: sdtditm.hxx:25
sal_uIntPtr sal_uLong
constexpr TypedWhichId< SdrOnOffItem > SDRATTR_TEXT_AUTOGROWWIDTH(SDRATTR_MISC_FIRST+12)
constexpr TypedWhichId< SdrMetricItem > SDRATTR_CORNER_RADIUS(SDRATTR_MISC_FIRST+0)
SdrTextObj * DynCastSdrTextObj(SdrObject *pObj)
Definition: svdobj.cxx:3212
@ Line
object group
@ Polygon
circle cut
@ Text
closed free-hand line
@ PolyLine
polygon, PolyPolygon
BitmapEx convertMetafileToBitmapEx(const GDIMetaFile &rMtf, const basegfx::B2DRange &rTargetRange, const sal_uInt32 nMaximumQuadraticPixels)
Helper to convert any GDIMetaFile to a good quality BitmapEx, using default parameters and graphic::X...
Definition: svdpntv.cxx:107
Degree100 GetAngle(const Point &rPnt)
The Y axis points down! The function negates the Y axis, when calculating the angle,...
Definition: svdtrans.cxx:387
bool bVisible
unsigned char sal_uInt8