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/xgrad.hxx>
36#include <svx/xflgrit.hxx>
37#include <editeng/fontitem.hxx>
38#include <editeng/wrlmitem.hxx>
40#include <editeng/colritem.hxx>
41#include <vcl/canvastools.hxx>
42#include <vcl/metric.hxx>
44#include <svx/xflhtit.hxx>
45#include <svx/sdmetitm.hxx>
46#include <svx/sdtagitm.hxx>
47#include <svx/sdtaitm.hxx>
48#include <svx/sdtditm.hxx>
49#include <svx/sdtfsitm.hxx>
50#include <svx/svdmodel.hxx>
51#include <svx/svdpage.hxx>
52#include <svx/svdobj.hxx>
53#include <svx/svdotext.hxx>
54#include <svx/svdorect.hxx>
55#include <svx/svdocirc.hxx>
56#include <svx/svdograf.hxx>
57#include <svx/svdopath.hxx>
58#include <svx/svdetc.hxx>
59#include <svl/itemset.hxx>
61#include <tools/helpers.hxx>
64#include <svx/xlinjoit.hxx>
65#include <svx/xlndsit.hxx>
67#include <svx/xbtmpit.hxx>
68#include <svx/xfltrit.hxx>
69#include <svx/xflbmtit.hxx>
70#include <svx/xflbstit.hxx>
71#include <svx/svdpntv.hxx>
73#include <svx/svditer.hxx>
74#include <svx/svdogrp.hxx>
75#include <vcl/BitmapTools.hxx>
76#include <osl/diagnose.h>
77
78using namespace com::sun::star;
79
81 SdrModel& rModel,
82 SdrLayerID nLay,
83 const tools::Rectangle& rRect)
84: mpVD(VclPtr<VirtualDevice>::Create()),
85 maScaleRect(rRect),
86 mnMapScalingOfs(0),
87 mpModel(&rModel),
88 mnLayer(nLay),
89 mnLineWidth(0),
90 maLineJoin(basegfx::B2DLineJoin::NONE),
91 maLineCap(css::drawing::LineCap_BUTT),
92 maDash(css::drawing::DashStyle_RECT, 0, 0, 0, 0, 0),
93 mbMov(false),
94 mbSize(false),
95 maOfs(0, 0),
96 mfScaleX(1.0),
97 mfScaleY(1.0),
98 maScaleX(1.0),
99 maScaleY(1.0),
100 mbFntDirty(true),
101 mbLastObjWasPolyWithoutLine(false),
102 mbNoLine(false),
103 mbNoFill(false),
104 mbLastObjWasLine(false)
105{
106 mpVD->EnableOutput(false);
107 mpVD->SetLineColor();
108 mpVD->SetFillColor();
109 maOldLineColor.SetRed( mpVD->GetLineColor().GetRed() + 1 );
110 mpLineAttr = std::make_unique<SfxItemSetFixed<XATTR_LINE_FIRST, XATTR_LINE_LAST>>(rModel.GetItemPool());
111 mpFillAttr = std::make_unique<SfxItemSetFixed<XATTR_FILL_FIRST, XATTR_FILL_LAST>>(rModel.GetItemPool());
112 mpTextAttr = std::make_unique<SfxItemSetFixed<EE_ITEMS_START, EE_ITEMS_END>>(rModel.GetItemPool());
113 checkClip();
114}
115
116void ImpSdrGDIMetaFileImport::DoLoopActions(GDIMetaFile const & rMtf, SvdProgressInfo* pProgrInfo, sal_uInt32* pActionsToReport)
117{
118 const sal_uLong nCount(rMtf.GetActionSize());
119
120 for(sal_uLong a(0); a < nCount; a++)
121 {
122 MetaAction* pAct = rMtf.GetAction(a);
123
124 if(!pAct)
125 {
126 OSL_ENSURE(false, "OOps, no action at valid position (!)");
127 pAct = rMtf.GetAction(0);
128 }
129
130 switch (pAct->GetType())
131 {
132 case MetaActionType::PIXEL : break;
133 case MetaActionType::POINT : break;
134 case MetaActionType::LINE : DoAction(static_cast<MetaLineAction &>(*pAct)); break;
135 case MetaActionType::RECT : DoAction(static_cast<MetaRectAction &>(*pAct)); break;
136 case MetaActionType::ROUNDRECT : DoAction(static_cast<MetaRoundRectAction &>(*pAct)); break;
137 case MetaActionType::ELLIPSE : DoAction(static_cast<MetaEllipseAction &>(*pAct)); break;
138 case MetaActionType::ARC : DoAction(static_cast<MetaArcAction &>(*pAct)); break;
139 case MetaActionType::PIE : DoAction(static_cast<MetaPieAction &>(*pAct)); break;
140 case MetaActionType::CHORD : DoAction(static_cast<MetaChordAction &>(*pAct)); break;
141 case MetaActionType::POLYLINE : DoAction(static_cast<MetaPolyLineAction &>(*pAct)); break;
142 case MetaActionType::POLYGON : DoAction(static_cast<MetaPolygonAction &>(*pAct)); break;
143 case MetaActionType::POLYPOLYGON : DoAction(static_cast<MetaPolyPolygonAction &>(*pAct)); break;
144 case MetaActionType::TEXT : DoAction(static_cast<MetaTextAction &>(*pAct)); break;
145 case MetaActionType::TEXTARRAY : DoAction(static_cast<MetaTextArrayAction &>(*pAct)); break;
146 case MetaActionType::STRETCHTEXT : DoAction(static_cast<MetaStretchTextAction &>(*pAct)); break;
147 case MetaActionType::BMP : DoAction(static_cast<MetaBmpAction &>(*pAct)); break;
148 case MetaActionType::BMPSCALE : DoAction(static_cast<MetaBmpScaleAction &>(*pAct)); break;
149 case MetaActionType::BMPEX : DoAction(static_cast<MetaBmpExAction &>(*pAct)); break;
150 case MetaActionType::BMPEXSCALE : DoAction(static_cast<MetaBmpExScaleAction &>(*pAct)); break;
151 case MetaActionType::LINECOLOR : DoAction(static_cast<MetaLineColorAction &>(*pAct)); break;
152 case MetaActionType::FILLCOLOR : DoAction(static_cast<MetaFillColorAction &>(*pAct)); break;
153 case MetaActionType::TEXTCOLOR : DoAction(static_cast<MetaTextColorAction &>(*pAct)); break;
154 case MetaActionType::TEXTFILLCOLOR : DoAction(static_cast<MetaTextFillColorAction &>(*pAct)); break;
155 case MetaActionType::FONT : DoAction(static_cast<MetaFontAction &>(*pAct)); break;
156 case MetaActionType::TEXTALIGN : DoAction(static_cast<MetaTextAlignAction &>(*pAct)); break;
157 case MetaActionType::MAPMODE : DoAction(static_cast<MetaMapModeAction &>(*pAct)); break;
158 case MetaActionType::CLIPREGION : DoAction(static_cast<MetaClipRegionAction &>(*pAct)); break;
159 case MetaActionType::MOVECLIPREGION : DoAction(static_cast<MetaMoveClipRegionAction &>(*pAct)); break;
160 case MetaActionType::ISECTRECTCLIPREGION: DoAction(static_cast<MetaISectRectClipRegionAction&>(*pAct)); break;
161 case MetaActionType::ISECTREGIONCLIPREGION: DoAction(static_cast<MetaISectRegionClipRegionAction&>(*pAct)); break;
162 case MetaActionType::RASTEROP : DoAction(static_cast<MetaRasterOpAction &>(*pAct)); break;
163 case MetaActionType::PUSH : DoAction(static_cast<MetaPushAction &>(*pAct)); break;
164 case MetaActionType::POP : DoAction(static_cast<MetaPopAction &>(*pAct)); break;
165 case MetaActionType::HATCH : DoAction(static_cast<MetaHatchAction &>(*pAct)); break;
166
167 // #i125211# MetaCommentAction may change index, thus hand it over
168 case MetaActionType::COMMENT : DoAction(static_cast<MetaCommentAction&>(*pAct), rMtf, a);
169 break;
170
171 // missing actions added
172 case MetaActionType::TEXTRECT : DoAction(static_cast<MetaTextRectAction&>(*pAct)); break;
173 case MetaActionType::BMPSCALEPART : DoAction(static_cast<MetaBmpScalePartAction&>(*pAct)); break;
174 case MetaActionType::BMPEXSCALEPART : DoAction(static_cast<MetaBmpExScalePartAction&>(*pAct)); break;
175 case MetaActionType::MASK : DoAction(static_cast<MetaMaskAction&>(*pAct)); break;
176 case MetaActionType::MASKSCALE : DoAction(static_cast<MetaMaskScaleAction&>(*pAct)); break;
177 case MetaActionType::MASKSCALEPART : DoAction(static_cast<MetaMaskScalePartAction&>(*pAct)); break;
178 case MetaActionType::GRADIENT : DoAction(static_cast<MetaGradientAction&>(*pAct)); break;
179 case MetaActionType::WALLPAPER : OSL_ENSURE(false, "Tried to construct SdrObject from MetaWallpaperAction: not supported (!)"); break;
180 case MetaActionType::Transparent : DoAction(static_cast<MetaTransparentAction&>(*pAct)); break;
181 case MetaActionType::EPS : OSL_ENSURE(false, "Tried to construct SdrObject from MetaEPSAction: not supported (!)"); break;
182 case MetaActionType::REFPOINT : DoAction(static_cast<MetaRefPointAction&>(*pAct)); break;
183 case MetaActionType::TEXTLINECOLOR : DoAction(static_cast<MetaTextLineColorAction&>(*pAct)); break;
184 case MetaActionType::TEXTLINE : OSL_ENSURE(false, "Tried to construct SdrObject from MetaTextLineAction: not supported (!)"); break;
185 case MetaActionType::FLOATTRANSPARENT : DoAction(static_cast<MetaFloatTransparentAction&>(*pAct)); break;
186 case MetaActionType::GRADIENTEX : DoAction(static_cast<MetaGradientExAction&>(*pAct)); break;
187 case MetaActionType::LAYOUTMODE : DoAction(static_cast<MetaLayoutModeAction&>(*pAct)); break;
188 case MetaActionType::TEXTLANGUAGE : DoAction(static_cast<MetaTextLanguageAction&>(*pAct)); break;
189 case MetaActionType::OVERLINECOLOR : DoAction(static_cast<MetaOverlineColorAction&>(*pAct)); break;
190 default: break;
191 }
192
193 if(pProgrInfo && pActionsToReport)
194 {
195 (*pActionsToReport)++;
196
197 if(*pActionsToReport >= 16) // update all 16 actions
198 {
199 if(!pProgrInfo->ReportActions(*pActionsToReport))
200 break;
201
202 *pActionsToReport = 0;
203 }
204 }
205 }
206}
207
209 const GDIMetaFile& rMtf,
210 SdrObjList& rOL,
211 size_t nInsPos,
212 SvdProgressInfo* pProgrInfo)
213{
214 // setup some global scale parameter
215 // mfScaleX, mfScaleY, maScaleX, maScaleY, mbMov, mbSize
216 mfScaleX = mfScaleY = 1.0;
217 const Size aMtfSize(rMtf.GetPrefSize());
218
219 if(aMtfSize.Width() & aMtfSize.Height() && (!maScaleRect.IsEmpty()))
220 {
222
223 if(aMtfSize.Width() != (maScaleRect.GetWidth() - 1))
224 {
225 mfScaleX = static_cast<double>( maScaleRect.GetWidth() - 1 ) / static_cast<double>(aMtfSize.Width());
226 }
227
228 if(aMtfSize.Height() != (maScaleRect.GetHeight() - 1))
229 {
230 mfScaleY = static_cast<double>( maScaleRect.GetHeight() - 1 ) / static_cast<double>(aMtfSize.Height());
231 }
232 }
233
234 mbMov = maOfs.X()!=0 || maOfs.Y()!=0;
235 mbSize = false;
236 maScaleX = Fraction( 1, 1 );
237 maScaleY = Fraction( 1, 1 );
238
239 if(aMtfSize.Width() != (maScaleRect.GetWidth() - 1))
240 {
241 maScaleX = Fraction(maScaleRect.GetWidth() - 1, aMtfSize.Width());
242 mbSize = true;
243 }
244
245 if(aMtfSize.Height() != (maScaleRect.GetHeight() - 1))
246 {
247 maScaleY = Fraction(maScaleRect.GetHeight() - 1, aMtfSize.Height());
248 mbSize = true;
249 }
250
251 if(pProgrInfo)
252 {
253 pProgrInfo->SetActionCount(rMtf.GetActionSize());
254 }
255
256 sal_uInt32 nActionsToReport(0);
257
258 // execute
259 DoLoopActions(rMtf, pProgrInfo, &nActionsToReport);
260
261 if(pProgrInfo)
262 {
263 pProgrInfo->ReportActions(nActionsToReport);
264 nActionsToReport = 0;
265 }
266
267 // MapMode scaling
268 MapScaling();
269
270 // To calculate the progress meter, we use GetActionSize()*3.
271 // However, maTmpList has a lower entry count limit than GetActionSize(),
272 // so the actions that were assumed were too much have to be re-added.
273 nActionsToReport = (rMtf.GetActionSize() - maTmpList.size()) * 2;
274
275 // announce all currently unannounced rescales
276 if(pProgrInfo)
277 {
278 pProgrInfo->ReportRescales(nActionsToReport);
279 pProgrInfo->SetInsertCount(maTmpList.size());
280 }
281
282 nActionsToReport = 0;
283
284 // insert all objects cached in aTmpList now into rOL from nInsPos
285 nInsPos = std::min(nInsPos, rOL.GetObjCount());
286
288 {
289 rOL.NbcInsertObject(pObj.get(), nInsPos);
290 nInsPos++;
291
292 if(pProgrInfo)
293 {
294 nActionsToReport++;
295
296 if(nActionsToReport >= 32) // update all 32 actions
297 {
298 pProgrInfo->ReportInserts(nActionsToReport);
299 nActionsToReport = 0;
300 }
301 }
302 }
303
304 // report all remaining inserts for the last time
305 if(pProgrInfo)
306 {
307 pProgrInfo->ReportInserts(nActionsToReport);
308 }
309
310 return maTmpList.size();
311}
312
313void ImpSdrGDIMetaFileImport::SetAttributes(SdrObject* pObj, bool bForceTextAttr)
314{
315 mbNoLine = false;
316 mbNoFill = false;
317 bool bLine(!bForceTextAttr);
318 bool bFill(!pObj || (pObj->IsClosedObj() && !bForceTextAttr));
319 bool bText(bForceTextAttr || (pObj && pObj->GetOutlinerParaObject()));
320
321 if(bLine)
322 {
323 if(mnLineWidth)
324 {
326 }
327 else
328 {
329 mpLineAttr->Put(XLineWidthItem(0));
330 }
331
332 maOldLineColor = mpVD->GetLineColor();
333
334 if(mpVD->IsLineColor())
335 {
336 mpLineAttr->Put(XLineStyleItem(drawing::LineStyle_SOLID));
337 mpLineAttr->Put(XLineColorItem(OUString(), mpVD->GetLineColor()));
338 }
339 else
340 {
341 mpLineAttr->Put(XLineStyleItem(drawing::LineStyle_NONE));
342 }
343
344 switch(maLineJoin)
345 {
347 mpLineAttr->Put(XLineJointItem(css::drawing::LineJoint_NONE));
348 break;
350 mpLineAttr->Put(XLineJointItem(css::drawing::LineJoint_BEVEL));
351 break;
353 mpLineAttr->Put(XLineJointItem(css::drawing::LineJoint_MITER));
354 break;
356 mpLineAttr->Put(XLineJointItem(css::drawing::LineJoint_ROUND));
357 break;
358 }
359
360 // Add LineCap support
362
364 {
365 mpLineAttr->Put(XLineDashItem(OUString(), maDash));
366 }
367 else
368 {
369 mpLineAttr->Put(XLineDashItem(OUString(), XDash(css::drawing::DashStyle_RECT)));
370 }
371 }
372 else
373 {
374 mbNoLine = true;
375 }
376
377 if(bFill)
378 {
379 if(mpVD->IsFillColor())
380 {
381 mpFillAttr->Put(XFillStyleItem(drawing::FillStyle_SOLID));
382 mpFillAttr->Put(XFillColorItem(OUString(), mpVD->GetFillColor()));
383 }
384 else
385 {
386 mpFillAttr->Put(XFillStyleItem(drawing::FillStyle_NONE));
387 }
388 }
389 else
390 {
391 mbNoFill = true;
392 }
393
394 if(bText && mbFntDirty)
395 {
396 vcl::Font aFnt(mpVD->GetFont());
397 const sal_uInt32 nHeight(FRound(aFnt.GetFontSize().Height() * mfScaleY));
398
399 mpTextAttr->Put( SvxFontItem( aFnt.GetFamilyType(), aFnt.GetFamilyName(), aFnt.GetStyleName(), aFnt.GetPitch(), aFnt.GetCharSet(), EE_CHAR_FONTINFO ) );
404 mpTextAttr->Put( SvxFontHeightItem( nHeight, 100, EE_CHAR_FONTHEIGHT ) );
405 mpTextAttr->Put( SvxFontHeightItem( nHeight, 100, EE_CHAR_FONTHEIGHT_CJK ) );
406 mpTextAttr->Put( SvxFontHeightItem( nHeight, 100, EE_CHAR_FONTHEIGHT_CTL ) );
412
413 // #i118485# Setting this item leads to problems (written #i118498# for this)
414 // mpTextAttr->Put(SvxAutoKernItem(aFnt.IsKerning(), EE_CHAR_KERNING));
415
418 mpTextAttr->Put(SvxColorItem(mpVD->GetTextColor(), EE_CHAR_COLOR));
419 //... svxfont textitem svditext
420 mbFntDirty = false;
421 }
422
423 if(!pObj)
424 return;
425
426 pObj->SetLayer(mnLayer);
427
428 if(bLine)
429 {
431 }
432
433 if(bFill)
434 {
436 }
437
438 if(bText)
439 {
442 }
443}
444
446{
447 rtl::Reference<SdrObject> pObj = pObj1;
448 if(bScale && !maScaleRect.IsEmpty())
449 {
450 if(mbSize)
451 {
452 pObj->NbcResize(Point(), maScaleX, maScaleY);
453 }
454
455 if(mbMov)
456 {
457 pObj->NbcMove(Size(maOfs.X(), maOfs.Y()));
458 }
459 }
460
461 if(isClip())
462 {
463 const basegfx::B2DPolyPolygon aPoly(pObj->TakeXorPoly());
464 const basegfx::B2DRange aOldRange(aPoly.getB2DRange());
465 const SdrLayerID aOldLayer(pObj->GetLayer());
466 const SfxItemSet aOldItemSet(pObj->GetMergedItemSet());
467 const SdrGrafObj* pSdrGrafObj = dynamic_cast< SdrGrafObj* >(pObj.get());
468 const SdrTextObj* pSdrTextObj = DynCastSdrTextObj(pObj.get());
469
470 if(pSdrTextObj && pSdrTextObj->HasText())
471 {
472 // all text objects are created from ImportText and have no line or fill attributes, so
473 // it is okay to concentrate on the text itself
474 while(true)
475 {
476 const basegfx::B2DPolyPolygon aTextContour(pSdrTextObj->TakeContour());
477 const basegfx::B2DRange aTextRange(aTextContour.getB2DRange());
478 const basegfx::B2DRange aClipRange(maClip.getB2DRange());
479
480 // no overlap -> completely outside
481 if(!aClipRange.overlaps(aTextRange))
482 {
483 pObj.clear();
484 break;
485 }
486
487 // when the clip is a rectangle fast check for inside is possible
488 if(basegfx::utils::isRectangle(maClip) && aClipRange.isInside(aTextRange))
489 {
490 // completely inside ClipRect
491 break;
492 }
493
494 // here text needs to be clipped; to do so, convert to SdrObjects with polygons
495 // and add these recursively. Delete original object, do not add in this run
496 rtl::Reference<SdrObject> pConverted = pSdrTextObj->ConvertToPolyObj(true, true);
497 pObj.clear();
498
499 if(pConverted)
500 {
501 // recursively add created conversion; per definition this shall not
502 // contain further SdrTextObjs. Visit only non-group objects
503 SdrObjListIter aIter(*pConverted, SdrIterMode::DeepNoGroups);
504
505 // work with clones; the created conversion may contain group objects
506 // and when working with the original objects the loop itself could
507 // break and the cleanup later would be pretty complicated (only delete group
508 // objects, are these empty, ...?)
509 while(aIter.IsMore())
510 {
511 SdrObject* pCandidate = aIter.Next();
512 OSL_ENSURE(pCandidate && dynamic_cast< SdrObjGroup* >(pCandidate) == nullptr, "SdrObjListIter with SdrIterMode::DeepNoGroups error (!)");
513 rtl::Reference<SdrObject> pNewClone(pCandidate->CloneSdrObject(pCandidate->getSdrModelFromSdrObject()));
514
515 if(pNewClone)
516 {
517 InsertObj(pNewClone.get(), false);
518 }
519 else
520 {
521 OSL_ENSURE(false, "SdrObject::Clone() failed (!)");
522 }
523 }
524 }
525
526 break;
527 }
528 }
529 else
530 {
531 BitmapEx aBitmapEx;
532
533 if(pSdrGrafObj)
534 {
535 aBitmapEx = pSdrGrafObj->GetGraphic().GetBitmapEx();
536 }
537
538 pObj.clear();
539
540 if(!aOldRange.isEmpty())
541 {
542 // clip against ClipRegion
543 const basegfx::B2DPolyPolygon aNewPoly(
545 aPoly,
546 maClip,
547 true,
548 !aPoly.isClosed()));
549 const basegfx::B2DRange aNewRange(aNewPoly.getB2DRange());
550
551 if(!aNewRange.isEmpty())
552 {
553 pObj = new SdrPathObj(
554 *mpModel,
556 aNewPoly);
557
558 pObj->SetLayer(aOldLayer);
559 pObj->SetMergedItemSet(aOldItemSet);
560
561 if(!aBitmapEx.IsEmpty())
562 {
563 // aNewRange is inside of aOldRange and defines which part of aBitmapEx is used
564 const double fScaleX(aBitmapEx.GetSizePixel().Width() / (aOldRange.getWidth() ? aOldRange.getWidth() : 1.0));
565 const double fScaleY(aBitmapEx.GetSizePixel().Height() / (aOldRange.getHeight() ? aOldRange.getHeight() : 1.0));
566 basegfx::B2DRange aPixel(aNewRange);
568
569 aTrans.translate(-aOldRange.getMinX(), -aOldRange.getMinY());
570 aTrans.scale(fScaleX, fScaleY);
571 aPixel.transform(aTrans);
572
573 const Size aOrigSizePixel(aBitmapEx.GetSizePixel());
574 const Point aClipTopLeft(
575 basegfx::fround(floor(std::max(0.0, aPixel.getMinX()))),
576 basegfx::fround(floor(std::max(0.0, aPixel.getMinY()))));
577 const Size aClipSize(
578 basegfx::fround(ceil(std::min(static_cast<double>(aOrigSizePixel.Width()), aPixel.getWidth()))),
579 basegfx::fround(ceil(std::min(static_cast<double>(aOrigSizePixel.Height()), aPixel.getHeight()))));
580 const BitmapEx aClippedBitmap(
581 aBitmapEx,
582 aClipTopLeft,
583 aClipSize);
584
585 pObj->SetMergedItem(XFillStyleItem(drawing::FillStyle_BITMAP));
586 pObj->SetMergedItem(XFillBitmapItem(OUString(), Graphic(aClippedBitmap)));
587 pObj->SetMergedItem(XFillBmpTileItem(false));
588 pObj->SetMergedItem(XFillBmpStretchItem(true));
589 }
590 }
591 }
592 }
593 }
594
595 if(!pObj)
596 return;
597
598 // #i111954# check object for visibility
599 // used are SdrPathObj, SdrRectObj, SdrCircObj, SdrGrafObj
600 bool bVisible(false);
601
602 if(pObj->HasLineStyle())
603 {
604 bVisible = true;
605 }
606
607 if(!bVisible && pObj->HasFillStyle())
608 {
609 bVisible = true;
610 }
611
612 if(!bVisible)
613 {
614 SdrTextObj* pTextObj = DynCastSdrTextObj(pObj.get());
615
616 if(pTextObj && pTextObj->HasText())
617 {
618 bVisible = true;
619 }
620 }
621
622 if(!bVisible)
623 {
624 SdrGrafObj* pGrafObj = dynamic_cast< SdrGrafObj* >(pObj.get());
625
626 if(pGrafObj)
627 {
628 // this may be refined to check if the graphic really is visible. It
629 // is here to ensure that graphic objects without fill, line and text
630 // get created
631 bVisible = true;
632 }
633 }
634
635 if(bVisible)
636 {
637 maTmpList.push_back(pObj);
638
639 if(dynamic_cast< SdrPathObj* >(pObj.get()))
640 {
641 const bool bClosed(pObj->IsClosedObj());
642
644 mbLastObjWasLine = !bClosed;
645 }
646 else
647 {
649 mbLastObjWasLine = false;
650 }
651 }
652}
653
655{
656 // #i73407# reformulation to use new B2DPolygon classes
657 const basegfx::B2DPoint aStart(rAct.GetStartPoint().X(), rAct.GetStartPoint().Y());
658 const basegfx::B2DPoint aEnd(rAct.GetEndPoint().X(), rAct.GetEndPoint().Y());
659
660 if(aStart.equal(aEnd))
661 return;
662
665
666 aLine.append(aStart);
667 aLine.append(aEnd);
668 aLine.transform(aTransform);
669
670 const LineInfo& rLineInfo = rAct.GetLineInfo();
671 const sal_Int32 nNewLineWidth(rLineInfo.GetWidth());
672 bool bCreateLineObject(true);
673
674 if(mbLastObjWasLine && (nNewLineWidth == mnLineWidth) && CheckLastLineMerge(aLine))
675 {
676 bCreateLineObject = false;
677 }
678
679 if(!bCreateLineObject)
680 return;
681
683 *mpModel,
686 mnLineWidth = nNewLineWidth;
687 maLineJoin = rLineInfo.GetLineJoin();
688 maLineCap = rLineInfo.GetLineCap();
689 maDash = XDash(css::drawing::DashStyle_RECT,
690 rLineInfo.GetDotCount(), rLineInfo.GetDotLen(),
691 rLineInfo.GetDashCount(), rLineInfo.GetDashLen(),
692 rLineInfo.GetDistance());
693 SetAttributes(pPath.get());
694 mnLineWidth = 0;
696 maDash = XDash();
697 InsertObj(pPath.get(), false);
698}
699
701{
703 *mpModel,
704 rAct.GetRect());
705 SetAttributes(pRect.get());
706 InsertObj(pRect.get());
707}
708
710{
712 *mpModel,
713 rAct.GetRect());
714 SetAttributes(pRect.get());
715 tools::Long nRad=(rAct.GetHorzRound()+rAct.GetVertRound())/2;
716 if (nRad!=0) {
719 pRect->SetMergedItemSet(aSet);
720 }
721 InsertObj(pRect.get());
722}
723
725{
727 *mpModel,
729 rAct.GetRect());
730 SetAttributes(pCirc.get());
731 InsertObj(pCirc.get());
732}
733
735{
736 Point aCenter(rAct.GetRect().Center());
737 Degree100 nStart=GetAngle(rAct.GetStartPoint()-aCenter);
738 Degree100 nEnd=GetAngle(rAct.GetEndPoint()-aCenter);
740 *mpModel,
742 rAct.GetRect(),nStart,nEnd);
743 SetAttributes(pCirc.get());
744 InsertObj(pCirc.get());
745}
746
748{
749 Point aCenter(rAct.GetRect().Center());
750 Degree100 nStart=GetAngle(rAct.GetStartPoint()-aCenter);
751 Degree100 nEnd=GetAngle(rAct.GetEndPoint()-aCenter);
753 *mpModel,
755 rAct.GetRect(),
756 nStart,
757 nEnd);
758 SetAttributes(pCirc.get());
759 InsertObj(pCirc.get());
760}
761
763{
764 Point aCenter(rAct.GetRect().Center());
765 Degree100 nStart=GetAngle(rAct.GetStartPoint()-aCenter);
766 Degree100 nEnd=GetAngle(rAct.GetEndPoint()-aCenter);
768 *mpModel,
770 rAct.GetRect(),
771 nStart,
772 nEnd);
773 SetAttributes(pCirc.get());
774 InsertObj(pCirc.get());
775}
776
778{
779 // #i102706# Do not merge closed polygons
780 if(rSrcPoly.isClosed())
781 {
782 return false;
783 }
784
785 // #i73407# reformulation to use new B2DPolygon classes
786 if(mbLastObjWasLine && (maOldLineColor == mpVD->GetLineColor()) && rSrcPoly.count())
787 {
788 SdrObject* pTmpObj = !maTmpList.empty() ? maTmpList[maTmpList.size() - 1].get() : nullptr;
789 SdrPathObj* pLastPoly = dynamic_cast< SdrPathObj* >(pTmpObj);
790
791 if(pLastPoly)
792 {
793 if(1 == pLastPoly->GetPathPoly().count())
794 {
795 bool bOk(false);
796 basegfx::B2DPolygon aDstPoly(pLastPoly->GetPathPoly().getB2DPolygon(0));
797
798 // #i102706# Do not merge closed polygons
799 if(aDstPoly.isClosed())
800 {
801 return false;
802 }
803
804 if(aDstPoly.count())
805 {
806 const sal_uInt32 nMaxDstPnt(aDstPoly.count() - 1);
807 const sal_uInt32 nMaxSrcPnt(rSrcPoly.count() - 1);
808
809 if(aDstPoly.getB2DPoint(nMaxDstPnt) == rSrcPoly.getB2DPoint(0))
810 {
811 aDstPoly.append(rSrcPoly, 1, rSrcPoly.count() - 1);
812 bOk = true;
813 }
814 else if(aDstPoly.getB2DPoint(0) == rSrcPoly.getB2DPoint(nMaxSrcPnt))
815 {
816 basegfx::B2DPolygon aNew(rSrcPoly);
817 aNew.append(aDstPoly, 1, aDstPoly.count() - 1);
818 aDstPoly = aNew;
819 bOk = true;
820 }
821 else if(aDstPoly.getB2DPoint(0) == rSrcPoly.getB2DPoint(0))
822 {
823 aDstPoly.flip();
824 aDstPoly.append(rSrcPoly, 1, rSrcPoly.count() - 1);
825 bOk = true;
826 }
827 else if(aDstPoly.getB2DPoint(nMaxDstPnt) == rSrcPoly.getB2DPoint(nMaxSrcPnt))
828 {
829 basegfx::B2DPolygon aNew(rSrcPoly);
830 aNew.flip();
831 aDstPoly.append(aNew, 1, aNew.count() - 1);
832 bOk = true;
833 }
834 }
835
836 if(bOk)
837 {
838 pLastPoly->NbcSetPathPoly(basegfx::B2DPolyPolygon(aDstPoly));
839 }
840
841 return bOk;
842 }
843 }
844 }
845
846 return false;
847}
848
850{
851 // #i73407# reformulation to use new B2DPolygon classes
853 {
854 SdrObject* pTmpObj = !maTmpList.empty() ? maTmpList[maTmpList.size() - 1].get() : nullptr;
855 SdrPathObj* pLastPoly = dynamic_cast< SdrPathObj* >(pTmpObj);
856
857 if(pLastPoly)
858 {
859 if(pLastPoly->GetPathPoly() == rPolyPolygon)
860 {
861 SetAttributes(nullptr);
862
863 if(!mbNoLine && mbNoFill)
864 {
865 pLastPoly->SetMergedItemSet(*mpLineAttr);
866
867 return true;
868 }
869 }
870 }
871 }
872
873 return false;
874}
875
877{
878 if(!mpVD->IsClipRegion())
879 return;
880
881 maClip = mpVD->GetClipRegion().GetAsB2DPolyPolygon();
882
883 if(isClip())
884 {
885 const basegfx::B2DHomMatrix aTransform(
887 mfScaleX,
888 mfScaleY,
889 maOfs.X(),
890 maOfs.Y()));
891
892 maClip.transform(aTransform);
893 }
894}
895
897{
898 return !maClip.getB2DRange().isEmpty();
899}
900
902{
903 // #i73407# reformulation to use new B2DPolygon classes
905
906 if(aSource.count())
907 {
909 aSource.transform(aTransform);
910 }
911
912 const LineInfo& rLineInfo = rAct.GetLineInfo();
913 const sal_Int32 nNewLineWidth(rLineInfo.GetWidth());
914 bool bCreateLineObject(true);
915
916 if(mbLastObjWasLine && (nNewLineWidth == mnLineWidth) && CheckLastLineMerge(aSource))
917 {
918 bCreateLineObject = false;
919 }
921 {
922 bCreateLineObject = false;
923 }
924
925 if(!bCreateLineObject)
926 return;
927
929 *mpModel,
931 basegfx::B2DPolyPolygon(aSource));
932 mnLineWidth = nNewLineWidth;
933 maLineJoin = rLineInfo.GetLineJoin();
934 maLineCap = rLineInfo.GetLineCap();
935 maDash = XDash(css::drawing::DashStyle_RECT,
936 rLineInfo.GetDotCount(), rLineInfo.GetDotLen(),
937 rLineInfo.GetDashCount(), rLineInfo.GetDashLen(),
938 rLineInfo.GetDistance());
939 SetAttributes(pPath.get());
940 mnLineWidth = 0;
942 maDash = XDash();
943 InsertObj(pPath.get(), false);
944}
945
947{
948 // #i73407# reformulation to use new B2DPolygon classes
950
951 if(!aSource.count())
952 return;
953
955 aSource.transform(aTransform);
956
958 {
959 // #i73407# make sure polygon is closed, it's a filled primitive
960 aSource.setClosed(true);
962 *mpModel,
964 basegfx::B2DPolyPolygon(aSource));
965 SetAttributes(pPath.get());
966 InsertObj(pPath.get(), false);
967 }
968}
969
971{
972 // #i73407# reformulation to use new B2DPolygon classes
974
975 if(!aSource.count())
976 return;
977
979 aSource.transform(aTransform);
980
982 {
983 // #i73407# make sure polygon is closed, it's a filled primitive
984 aSource.setClosed(true);
986 *mpModel,
988 std::move(aSource));
989 SetAttributes(pPath.get());
990 InsertObj(pPath.get(), false);
991 }
992}
993
994void ImpSdrGDIMetaFileImport::ImportText( const Point& rPos, const OUString& rStr, const MetaAction& rAct )
995{
996 // calc text box size, add 5% to make it fit safely
997
998 FontMetric aFontMetric( mpVD->GetFontMetric() );
999 vcl::Font aFnt( mpVD->GetFont() );
1000 TextAlign eAlg( aFnt.GetAlignment() );
1001
1002 sal_Int32 nTextWidth = static_cast<sal_Int32>( mpVD->GetTextWidth( rStr ) * mfScaleX );
1003 sal_Int32 nTextHeight = static_cast<sal_Int32>( mpVD->GetTextHeight() * mfScaleY );
1004
1005 Point aPos( FRound(rPos.X() * mfScaleX + maOfs.X()), FRound(rPos.Y() * mfScaleY + maOfs.Y()) );
1006 Size aSize( nTextWidth, nTextHeight );
1007
1008 if ( eAlg == ALIGN_BASELINE )
1009 aPos.AdjustY( -(FRound(aFontMetric.GetAscent() * mfScaleY)) );
1010 else if ( eAlg == ALIGN_BOTTOM )
1011 aPos.AdjustY( -nTextHeight );
1012
1013 tools::Rectangle aTextRect( aPos, aSize );
1015 *mpModel,
1017 aTextRect);
1018
1019 pText->SetMergedItem ( makeSdrTextUpperDistItem (0));
1020 pText->SetMergedItem ( makeSdrTextLowerDistItem (0));
1021 pText->SetMergedItem ( makeSdrTextRightDistItem (0));
1022 pText->SetMergedItem ( makeSdrTextLeftDistItem (0));
1023
1024 if ( aFnt.GetAverageFontWidth() || ( rAct.GetType() == MetaActionType::STRETCHTEXT ) )
1025 {
1026 pText->ClearMergedItem( SDRATTR_TEXT_AUTOGROWWIDTH );
1027 pText->SetMergedItem( makeSdrTextAutoGrowHeightItem( false ) );
1028 // don't let the margins eat the space needed for the text
1029 pText->SetMergedItem( SdrTextFitToSizeTypeItem(drawing::TextFitToSizeType_ALLLINES) );
1030 }
1031 else
1032 {
1033 pText->SetMergedItem( makeSdrTextAutoGrowWidthItem( true ) );
1034 }
1035
1036 pText->SetLayer(mnLayer);
1037 pText->NbcSetText( rStr );
1038 SetAttributes( pText.get(), true );
1039 pText->SetSnapRect( aTextRect );
1040
1041 if (!aFnt.IsTransparent())
1042 {
1044 aAttr.Put(XFillStyleItem(drawing::FillStyle_SOLID));
1045 aAttr.Put(XFillColorItem(OUString(), aFnt.GetFillColor()));
1046 pText->SetMergedItemSet(aAttr);
1047 }
1048 Degree100 nAngle = to<Degree100>(aFnt.GetOrientation());
1049 if ( nAngle )
1050 pText->SdrAttrObj::NbcRotate(aPos,nAngle);
1051 InsertObj( pText.get(), false );
1052}
1053
1055{
1056 OUString aStr(rAct.GetText());
1057 aStr = aStr.copy(rAct.GetIndex(), rAct.GetLen());
1058 ImportText( rAct.GetPoint(), aStr, rAct );
1059}
1060
1061void ImpSdrGDIMetaFileImport::DoAction(MetaTextArrayAction const & rAct)
1062{
1063 OUString aStr(rAct.GetText());
1064 aStr = aStr.copy(rAct.GetIndex(), rAct.GetLen());
1065 ImportText( rAct.GetPoint(), aStr, rAct );
1066}
1067
1069{
1070 OUString aStr(rAct.GetText());
1071 aStr = aStr.copy(rAct.GetIndex(), rAct.GetLen());
1072 ImportText( rAct.GetPoint(), aStr, rAct );
1073}
1074
1076{
1077 tools::Rectangle aRect(rAct.GetPoint(),rAct.GetBitmap().GetSizePixel());
1078 aRect.AdjustRight( 1 ); aRect.AdjustBottom( 1 );
1080 *mpModel,
1081 Graphic(BitmapEx(rAct.GetBitmap())),
1082 aRect);
1083
1084 // This action is not creating line and fill, set directly, do not use SetAttributes(..)
1085 pGraf->SetMergedItem(XLineStyleItem(drawing::LineStyle_NONE));
1086 pGraf->SetMergedItem(XFillStyleItem(drawing::FillStyle_NONE));
1087 InsertObj(pGraf.get());
1088}
1089
1091{
1092 tools::Rectangle aRect(rAct.GetPoint(),rAct.GetSize());
1093 aRect.AdjustRight( 1 ); aRect.AdjustBottom( 1 );
1095 *mpModel,
1096 Graphic(BitmapEx(rAct.GetBitmap())),
1097 aRect);
1098
1099 // This action is not creating line and fill, set directly, do not use SetAttributes(..)
1100 pGraf->SetMergedItem(XLineStyleItem(drawing::LineStyle_NONE));
1101 pGraf->SetMergedItem(XFillStyleItem(drawing::FillStyle_NONE));
1102 InsertObj(pGraf.get());
1103}
1104
1106{
1107 tools::Rectangle aRect(rAct.GetPoint(),rAct.GetBitmapEx().GetSizePixel());
1108 aRect.AdjustRight( 1 ); aRect.AdjustBottom( 1 );
1110 *mpModel,
1111 rAct.GetBitmapEx(),
1112 aRect);
1113
1114 // This action is not creating line and fill, set directly, do not use SetAttributes(..)
1115 pGraf->SetMergedItem(XLineStyleItem(drawing::LineStyle_NONE));
1116 pGraf->SetMergedItem(XFillStyleItem(drawing::FillStyle_NONE));
1117 InsertObj(pGraf.get());
1118}
1119
1121{
1122 tools::Rectangle aRect(rAct.GetPoint(),rAct.GetSize());
1123 aRect.AdjustRight( 1 ); aRect.AdjustBottom( 1 );
1125 *mpModel,
1126 rAct.GetBitmapEx(),
1127 aRect);
1128
1129 // This action is not creating line and fill, set directly, do not use SetAttributes(..)
1130 pGraf->SetMergedItem(XLineStyleItem(drawing::LineStyle_NONE));
1131 pGraf->SetMergedItem(XFillStyleItem(drawing::FillStyle_NONE));
1132 InsertObj(pGraf.get());
1133}
1134
1135
1137{
1138 // #i73407# reformulation to use new B2DPolygon classes
1140
1141 if(!aSource.count())
1142 return;
1143
1145 aSource.transform(aTransform);
1146
1148 return;
1149
1150 const Hatch& rHatch = rAct.GetHatch();
1152 *mpModel,
1154 std::move(aSource));
1155 // #i125211# Use the ranges from the SdrObject to create a new empty SfxItemSet
1156 SfxItemSet aHatchAttr(mpModel->GetItemPool(), pPath->GetMergedItemSet().GetRanges());
1157 css::drawing::HatchStyle eStyle;
1158
1159 switch(rHatch.GetStyle())
1160 {
1161 case HatchStyle::Triple :
1162 {
1163 eStyle = css::drawing::HatchStyle_TRIPLE;
1164 break;
1165 }
1166
1167 case HatchStyle::Double :
1168 {
1169 eStyle = css::drawing::HatchStyle_DOUBLE;
1170 break;
1171 }
1172
1173 default:
1174 {
1175 eStyle = css::drawing::HatchStyle_SINGLE;
1176 break;
1177 }
1178 }
1179
1180 SetAttributes(pPath.get());
1181 aHatchAttr.Put(XFillStyleItem(drawing::FillStyle_HATCH));
1182 aHatchAttr.Put(XFillHatchItem(XHatch(rHatch.GetColor(), eStyle, rHatch.GetDistance(), rHatch.GetAngle())));
1183 pPath->SetMergedItemSet(aHatchAttr);
1184
1185 InsertObj(pPath.get(), false);
1186}
1187
1188
1190{
1191 rAct.Execute(mpVD);
1192}
1193
1195{
1196 MapScaling();
1197 rAct.Execute(mpVD);
1199 mbLastObjWasLine = false;
1200}
1201
1203{
1204 const size_t nCount(maTmpList.size());
1205 const MapMode& rMap = mpVD->GetMapMode();
1206 Point aMapOrg( rMap.GetOrigin() );
1207 bool bMov2(aMapOrg.X() != 0 || aMapOrg.Y() != 0);
1208
1209 if(bMov2)
1210 {
1211 for(size_t i = mnMapScalingOfs; i < nCount; i++)
1212 {
1213 SdrObject* pObj = maTmpList[i].get();
1214
1215 pObj->NbcMove(Size(aMapOrg.X(), aMapOrg.Y()));
1216 }
1217 }
1218
1220}
1221
1222
1223void ImpSdrGDIMetaFileImport::DoAction( MetaCommentAction const & rAct, GDIMetaFile const & rMtf, sal_uLong& a) // GDIMetaFile* pMtf )
1224{
1225 bool aSkipComment = false;
1226
1227 if (a < rMtf.GetActionSize() && rAct.GetComment().equalsIgnoreAsciiCase("XGRAD_SEQ_BEGIN"))
1228 {
1229 // #i125211# Check if next action is a MetaGradientExAction
1230 MetaGradientExAction* pAct = dynamic_cast< MetaGradientExAction* >(rMtf.GetAction(a + 1));
1231
1232 if( pAct && pAct->GetType() == MetaActionType::GRADIENTEX )
1233 {
1234 // #i73407# reformulation to use new B2DPolygon classes
1236
1237 if(aSource.count())
1238 {
1240 {
1241 const Gradient& rGrad = pAct->GetGradient();
1243 *mpModel,
1245 std::move(aSource));
1246 // #i125211# Use the ranges from the SdrObject to create a new empty SfxItemSet
1247 SfxItemSet aGradAttr(mpModel->GetItemPool(), pPath->GetMergedItemSet().GetRanges());
1248 XGradient aXGradient;
1249
1250 aXGradient.SetGradientStyle(static_cast<css::awt::GradientStyle>(rGrad.GetStyle()));
1251 aXGradient.SetStartColor(rGrad.GetStartColor());
1252 aXGradient.SetEndColor(rGrad.GetEndColor());
1253 aXGradient.SetAngle(rGrad.GetAngle());
1254 aXGradient.SetBorder(rGrad.GetBorder());
1255 aXGradient.SetXOffset(rGrad.GetOfsX());
1256 aXGradient.SetYOffset(rGrad.GetOfsY());
1257 aXGradient.SetStartIntens(rGrad.GetStartIntensity());
1258 aXGradient.SetEndIntens(rGrad.GetEndIntensity());
1259 aXGradient.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(aXGradient));
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
1305void ImpSdrGDIMetaFileImport::DoAction(MetaBmpScalePartAction const & rAct)
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
1324void ImpSdrGDIMetaFileImport::DoAction(MetaBmpExScalePartAction const & rAct)
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
1395namespace
1396{
1397 css::awt::GradientStyle getXGradientStyleFromGradientStyle(const GradientStyle& rGradientStyle)
1398 {
1399 css::awt::GradientStyle aXGradientStyle(css::awt::GradientStyle_LINEAR);
1400
1401 switch(rGradientStyle)
1402 {
1403 case GradientStyle::Linear: aXGradientStyle = css::awt::GradientStyle_LINEAR; break;
1404 case GradientStyle::Axial: aXGradientStyle = css::awt::GradientStyle_AXIAL; break;
1405 case GradientStyle::Radial: aXGradientStyle = css::awt::GradientStyle_RADIAL; break;
1406 case GradientStyle::Elliptical: aXGradientStyle = css::awt::GradientStyle_ELLIPTICAL; break;
1407 case GradientStyle::Square: aXGradientStyle = css::awt::GradientStyle_SQUARE; break;
1408 case GradientStyle::Rect: aXGradientStyle = css::awt::GradientStyle_RECT; break;
1409
1410 // Needed due to GradientStyle::FORCE_EQUAL_SIZE; this again is needed
1411 // to force the enum defines in VCL to a defined size for the compilers,
1412 // so despite it is never used it cannot be removed (would break the
1413 // API implementation probably).
1414 case GradientStyle::FORCE_EQUAL_SIZE: break;
1415 default:
1416 break;
1417 }
1418
1419 return aXGradientStyle;
1420 }
1421}
1422
1424{
1426
1427 if(aRange.isEmpty())
1428 return;
1429
1431 aRange.transform(aTransform);
1432 const Gradient& rGradient = rAct.GetGradient();
1434 *mpModel,
1436 floor(aRange.getMinX()),
1437 floor(aRange.getMinY()),
1438 ceil(aRange.getMaxX()),
1439 ceil(aRange.getMaxY())));
1440 // #i125211# Use the ranges from the SdrObject to create a new empty SfxItemSet
1441 SfxItemSet aGradientAttr(mpModel->GetItemPool(), pRect->GetMergedItemSet().GetRanges());
1442 const css::awt::GradientStyle aXGradientStyle(getXGradientStyleFromGradientStyle(rGradient.GetStyle()));
1443 const XFillGradientItem aXFillGradientItem(
1444 XGradient(
1445 rGradient.GetStartColor(),
1446 rGradient.GetEndColor(),
1447 aXGradientStyle,
1448 rGradient.GetAngle(),
1449 rGradient.GetOfsX(),
1450 rGradient.GetOfsY(),
1451 rGradient.GetBorder(),
1452 rGradient.GetStartIntensity(),
1453 rGradient.GetEndIntensity(),
1454 rGradient.GetSteps()));
1455
1456 SetAttributes(pRect.get());
1457 aGradientAttr.Put(XFillStyleItem(drawing::FillStyle_GRADIENT)); // #i125211#
1458 aGradientAttr.Put(aXFillGradientItem);
1459 pRect->SetMergedItemSet(aGradientAttr);
1460
1461 InsertObj(pRect.get(), false);
1462}
1463
1465{
1467
1468 if(!aSource.count())
1469 return;
1470
1472 aSource.transform(aTransform);
1473 aSource.setClosed(true);
1474
1476 *mpModel,
1478 std::move(aSource));
1479 SetAttributes(pPath.get());
1480 pPath->SetMergedItem(XFillTransparenceItem(rAct.GetTransparence()));
1481 InsertObj(pPath.get(), false);
1482}
1483
1485{
1487
1488 if(!aSource.count())
1489 return;
1490
1492 aSource.transform(aTransform);
1493
1495 return;
1496
1497 const Gradient& rGradient = rAct.GetGradient();
1499 *mpModel,
1501 std::move(aSource));
1502 // #i125211# Use the ranges from the SdrObject to create a new empty SfxItemSet
1503 SfxItemSet aGradientAttr(mpModel->GetItemPool(), pPath->GetMergedItemSet().GetRanges());
1504 const css::awt::GradientStyle aXGradientStyle(getXGradientStyleFromGradientStyle(rGradient.GetStyle()));
1505 const XFillGradientItem aXFillGradientItem(
1506 XGradient(
1507 rGradient.GetStartColor(),
1508 rGradient.GetEndColor(),
1509 aXGradientStyle,
1510 rGradient.GetAngle(),
1511 rGradient.GetOfsX(),
1512 rGradient.GetOfsY(),
1513 rGradient.GetBorder(),
1514 rGradient.GetStartIntensity(),
1515 rGradient.GetEndIntensity(),
1516 rGradient.GetSteps()));
1517
1518 SetAttributes(pPath.get());
1519 aGradientAttr.Put(XFillStyleItem(drawing::FillStyle_GRADIENT)); // #i125211#
1520 aGradientAttr.Put(aXFillGradientItem);
1521 pPath->SetMergedItemSet(aGradientAttr);
1522
1523 InsertObj(pPath.get(), false);
1524}
1525
1527{
1528 const GDIMetaFile& rMtf = rAct.GetGDIMetaFile();
1529
1530 if(!rMtf.GetActionSize())
1531 return;
1532
1533 const tools::Rectangle aRect(rAct.GetPoint(),rAct.GetSize());
1534
1535 // convert metafile sub-content to BitmapEx
1536 BitmapEx aBitmapEx(
1538 rMtf,
1540 125000));
1541
1542 // handle colors
1543 const Gradient& rGradient = rAct.GetGradient();
1544 basegfx::BColor aStart(rGradient.GetStartColor().getBColor());
1545 basegfx::BColor aEnd(rGradient.GetEndColor().getBColor());
1546
1547 if(100 != rGradient.GetStartIntensity())
1548 {
1549 aStart *= static_cast<double>(rGradient.GetStartIntensity()) / 100.0;
1550 }
1551
1552 if(100 != rGradient.GetEndIntensity())
1553 {
1554 aEnd *= static_cast<double>(rGradient.GetEndIntensity()) / 100.0;
1555 }
1556
1557 const bool bEqualColors(aStart == aEnd);
1558 const bool bNoSteps(1 == rGradient.GetSteps());
1559 bool bCreateObject(true);
1560 bool bHasNewMask(false);
1561 AlphaMask aNewMask;
1562 double fTransparence(0.0);
1563 bool bFixedTransparence(false);
1564
1565 if(bEqualColors || bNoSteps)
1566 {
1567 // single transparence
1568 const basegfx::BColor aMedium(basegfx::average(aStart, aEnd));
1569 fTransparence = aMedium.luminance();
1570
1571 if(basegfx::fTools::lessOrEqual(fTransparence, 0.0))
1572 {
1573 // no transparence needed, all done
1574 }
1575 else if(basegfx::fTools::moreOrEqual(fTransparence, 1.0))
1576 {
1577 // all transparent, no object
1578 bCreateObject = false;
1579 }
1580 else
1581 {
1582 // 0.0 < transparence < 1.0, apply fixed transparence
1583 bFixedTransparence = true;
1584 }
1585 }
1586 else
1587 {
1588 // gradient transparence
1590
1591 pVDev->SetOutputSizePixel(aBitmapEx.GetBitmap().GetSizePixel());
1592 pVDev->DrawGradient(tools::Rectangle(Point(0, 0), pVDev->GetOutputSizePixel()), rGradient);
1593
1594 aNewMask = AlphaMask(pVDev->GetBitmap(Point(0, 0), pVDev->GetOutputSizePixel()));
1595 bHasNewMask = true;
1596 }
1597
1598 if(!bCreateObject)
1599 return;
1600
1601 if(bHasNewMask || bFixedTransparence)
1602 {
1603 if(!aBitmapEx.IsAlpha())
1604 {
1605 // no transparence yet, apply new one
1606 if(bFixedTransparence)
1607 {
1608 sal_uInt8 aAlpha(basegfx::fround(fTransparence * 255.0));
1609
1610 aNewMask = AlphaMask(aBitmapEx.GetBitmap().GetSizePixel(), &aAlpha);
1611 }
1612
1613 aBitmapEx = BitmapEx(aBitmapEx.GetBitmap(), aNewMask);
1614 }
1615 else
1616 {
1617 vcl::bitmap::DrawAlphaBitmapAndAlphaGradient(aBitmapEx, bFixedTransparence, fTransparence, aNewMask);
1618 }
1619 }
1620
1621 // create and add object
1623 *mpModel,
1624 aBitmapEx,
1625 aRect);
1626
1627 // for MetaFloatTransparentAction, do not use SetAttributes(...)
1628 // since these metafile content is not used to draw line/fill
1629 // dependent of these setting at the device content
1630 pGraf->SetMergedItem(XLineStyleItem(drawing::LineStyle_NONE));
1631 pGraf->SetMergedItem(XFillStyleItem(drawing::FillStyle_NONE));
1632 InsertObj(pGraf.get());
1633}
1634
1635/* 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
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
GradientStyle GetStyle() 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
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:445
ImpSdrGDIMetaFileImport(const ImpSdrGDIMetaFileImport &)=delete
bool CheckLastPolyLineAndFillMerge(const basegfx::B2DPolyPolygon &rPolyPolygon)
Definition: svdfmtf.cxx:849
css::drawing::LineCap maLineCap
Definition: svdfmtf.hxx:60
std::unique_ptr< SfxItemSet > mpLineAttr
Definition: svdfmtf.hxx:52
bool isClip() const
Definition: svdfmtf.cxx:896
::std::vector< rtl::Reference< SdrObject > > maTmpList
Definition: svdfmtf.hxx:48
void SetAttributes(SdrObject *pObj, bool bForceTextAttr=false)
Definition: svdfmtf.cxx:313
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:116
bool mbLastObjWasPolyWithoutLine
Definition: svdfmtf.hxx:74
void ImportText(const Point &rPos, const OUString &rStr, const MetaAction &rAct)
Definition: svdfmtf.cxx:994
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:208
bool CheckLastLineMerge(const basegfx::B2DPolygon &rSrcPoly)
Definition: svdfmtf.cxx:777
void DoAction(MetaLineAction const &rAct)
Definition: svdfmtf.cxx:654
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 & GetPoint() const
const Size & GetSize() const
const Bitmap & GetBitmap() 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
DrawTextFlags GetStyle() const
const tools::Rectangle & GetRect() const
const OUString & GetText() const
sal_uInt16 GetTransparence() const
const tools::PolyPolygon & GetPolyPolygon() 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:816
virtual void NbcInsertObject(SdrObject *pObj, size_t nPos=SAL_MAX_SIZE)
Definition: svdpage.cxx:281
Abstract DrawObject.
Definition: svdobj.hxx:261
bool IsClosedObj() const
Definition: svdobj.hxx:745
virtual OutlinerParaObject * GetOutlinerParaObject() const
Definition: svdobj.cxx:1836
void SetMergedItemSet(const SfxItemSet &rSet, bool bClearAllItems=false)
Definition: svdobj.cxx:2002
rtl::Reference< SdrObject > ConvertToPolyObj(bool bBezier, bool bLineToArea) const
Definition: svdobj.cxx:2623
SdrModel & getSdrModelFromSdrObject() const
Definition: svdobj.cxx:289
void SetMergedItem(const SfxPoolItem &rItem)
Definition: svdobj.cxx:1987
virtual void SetLayer(SdrLayerID nLayer)
Definition: svdobj.cxx:667
virtual rtl::Reference< SdrObject > CloneSdrObject(SdrModel &rTargetModel) const
Definition: svdobj.cxx:1047
virtual void NbcMove(const Size &rSiz)
The methods Move, Resize, Rotate, Mirror, Shear, SetSnapRect and SetLogicRect call the corresponding ...
Definition: svdobj.cxx:1404
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:1102
virtual bool HasText() const override
Definition: svdotxat.cxx:418
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:113
void ReportInserts(size_t nInsertCount)
Definition: svdetc.cxx:443
void SetActionCount(size_t _nActionCount)
Definition: svdetc.cxx:457
bool ReportActions(size_t nActionCount)
Definition: svdetc.cxx:433
void SetInsertCount(size_t _nInsertCount)
Definition: svdetc.cxx:462
void ReportRescales(size_t nRescaleCount)
Definition: svdetc.cxx:451
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 SetEndIntens(sal_uInt16 nNewIntens)
Definition: xgrad.hxx:65
void SetBorder(sal_uInt16 nNewBorder)
Definition: xgrad.hxx:61
void SetStartColor(const Color &rColor)
Definition: xgrad.hxx:58
void SetGradientStyle(css::awt::GradientStyle eNewStyle)
Definition: xgrad.hxx:57
void SetXOffset(sal_uInt16 nNewOffset)
Definition: xgrad.hxx:62
void SetEndColor(const Color &rColor)
Definition: xgrad.hxx:59
void SetAngle(Degree10 nNewAngle)
Definition: xgrad.hxx:60
void SetStartIntens(sal_uInt16 nNewIntens)
Definition: xgrad.hxx:64
void SetYOffset(sal_uInt16 nNewOffset)
Definition: xgrad.hxx:63
void SetSteps(sal_uInt16 nSteps)
Definition: xgrad.hxx:66
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
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:3217
@ 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
GradientStyle