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