LibreOffice Module svx (master)  1
svdograf.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 <unotools/streamwrap.hxx>
21 
22 #include <sfx2/lnkbase.hxx>
23 #include <rtl/ustrbuf.hxx>
24 #include <tools/helpers.hxx>
25 #include <tools/stream.hxx>
26 #include <sot/exchange.hxx>
27 #include <sot/formats.hxx>
28 #include <vcl/GraphicObject.hxx>
29 #include <vcl/svapp.hxx>
30 
31 #include <sfx2/linkmgr.hxx>
32 #include <svx/dialmgr.hxx>
33 #include <svx/strings.hrc>
34 #include <svx/svdhdl.hxx>
35 #include <svx/svdmodel.hxx>
36 #include <svx/svdpage.hxx>
37 #include <svx/svdograf.hxx>
38 #include <svx/svdogrp.hxx>
39 #include <svx/xbtmpit.hxx>
40 #include <svx/xfillit0.hxx>
41 #include <svx/xflbmtit.hxx>
42 #include "svdfmtf.hxx"
43 #include <sdgcoitm.hxx>
44 #include <svx/sdgcpitm.hxx>
45 #include <svx/sdggaitm.hxx>
46 #include <sdginitm.hxx>
47 #include <svx/sdgluitm.hxx>
48 #include <svx/sdgmoitm.hxx>
49 #include <sdgtritm.hxx>
55 #include <memory>
56 
57 using namespace ::com::sun::star;
58 using namespace ::com::sun::star::uno;
59 using namespace ::com::sun::star::io;
60 
62 {
64 
65 public:
66  explicit SdrGraphicLink(SdrGrafObj& rObj);
67 
68  virtual void Closed() override;
69 
70  virtual ::sfx2::SvBaseLink::UpdateResult DataChanged(
71  const OUString& rMimeType, const css::uno::Any & rValue ) override;
72 
73  void Connect() { GetRealObject(); }
74 };
75 
78 , rGrafObj( rObj )
79 {
80  SetSynchron( false );
81 }
82 
84  const OUString& rMimeType, const css::uno::Any & rValue )
85 {
87  sfx2::LinkManager* pLinkManager(rModel.GetLinkManager());
88 
89  if( pLinkManager && rValue.hasValue() )
90  {
92 
93  Graphic aGraphic;
94  if (pLinkManager->GetGraphicFromAny(rMimeType, rValue, aGraphic, nullptr))
95  {
96  rGrafObj.ImpSetLinkedGraphic(aGraphic);
97  }
99  {
100  // broadcasting, to update slide sorter
102  }
103  }
104  return SUCCESS;
105 }
106 
108 {
109  // close connection; set pLink of the object to NULL, as link instance is just about getting destructed.
111  rGrafObj.pGraphicLink=nullptr;
113  SvBaseLink::Closed();
114 }
115 
116 std::unique_ptr<sdr::properties::BaseProperties> SdrGrafObj::CreateObjectSpecificProperties()
117 {
118  return std::make_unique<sdr::properties::GraphicProperties>(*this);
119 }
120 
121 
122 // DrawContact section
123 
124 std::unique_ptr<sdr::contact::ViewContact> SdrGrafObj::CreateObjectSpecificViewContact()
125 {
126  return std::make_unique<sdr::contact::ViewContactOfGraphic>(*this);
127 }
128 
129 
130 // check if SVG and if try to get ObjectInfoPrimitive2D and extract info
131 
133 {
134  if (!mpGraphicObject || !mpGraphicObject->GetGraphic().isAvailable())
135  return;
136 
137  auto const & rVectorGraphicDataPtr = mpGraphicObject->GetGraphic().getVectorGraphicData();
138 
139  if (!rVectorGraphicDataPtr)
140  return;
141 
142  // Skip for PDF as it is only a bitmap primitive in a sequence and
143  // doesn't contain metadata. However getting the primitive sequence
144  // will also trigger a premature rendering of the PDF.
145  if (rVectorGraphicDataPtr->getVectorGraphicDataType() == VectorGraphicDataType::Pdf)
146  return;
147 
148  const drawinglayer::primitive2d::Primitive2DContainer aSequence(rVectorGraphicDataPtr->getPrimitive2DSequence());
149 
150  if (aSequence.empty())
151  return;
152 
154  drawinglayer::processor2d::ObjectInfoPrimitiveExtractor2D aProcessor(aViewInformation2D);
155 
156  aProcessor.process(aSequence);
157 
158  const drawinglayer::primitive2d::ObjectInfoPrimitive2D* pResult = aProcessor.getResult();
159 
160  if (!pResult)
161  return;
162 
163  OUString aName = pResult->getName();
164  OUString aTitle = pResult->getTitle();
165  OUString aDesc = pResult->getDesc();
166 
167  if(!aName.isEmpty())
168  {
169  SetName(aName);
170  }
171 
172  if(!aTitle.isEmpty())
173  {
174  SetTitle(aTitle);
175  }
176 
177  if(!aDesc.isEmpty())
178  {
179  SetDescription(aDesc);
180  }
181 }
182 
184 : SdrRectObj(rSdrModel)
185  ,mpGraphicObject(new GraphicObject)
186  ,pGraphicLink(nullptr)
187  ,bMirrored(false)
188  ,mbIsSignatureLine(false)
189  ,mbIsSignatureLineShowSignDate(true)
190  ,mbIsSignatureLineCanAddComment(false)
191  ,mbSignatureLineIsSigned(false)
192 {
194 
195  // #i118485# Shear allowed and possible now
196  bNoShear = false;
197 
198  mbGrafAnimationAllowed = true;
199 
200  // #i25616#
202 
203  // #i25616#
205 }
206 
208  SdrModel& rSdrModel,
209  const Graphic& rGraphic,
210  const tools::Rectangle& rRect)
211 : SdrRectObj(rSdrModel, rRect)
212  ,mpGraphicObject(new GraphicObject(rGraphic))
213  ,pGraphicLink(nullptr)
214  ,bMirrored(false)
215  ,mbIsSignatureLine(false)
216  ,mbIsSignatureLineShowSignDate(true)
217  ,mbIsSignatureLineCanAddComment(false)
218  ,mbSignatureLineIsSigned(false)
219 {
221 
222  // #i118485# Shear allowed and possible now
223  bNoShear = false;
224 
225  mbGrafAnimationAllowed = true;
226 
227  // #i25616#
229 
230  // #i25616#
232 }
233 
235  SdrModel& rSdrModel,
236  const Graphic& rGraphic)
237 : SdrRectObj(rSdrModel)
238  ,mpGraphicObject(new GraphicObject(rGraphic))
239  ,pGraphicLink(nullptr)
240  ,bMirrored(false)
241  ,mbIsSignatureLine(false)
242  ,mbIsSignatureLineShowSignDate(true)
243  ,mbIsSignatureLineCanAddComment(false)
244  ,mbSignatureLineIsSigned(false)
245 {
247 
248  // #i118485# Shear allowed and possible now
249  bNoShear = false;
250 
251  mbGrafAnimationAllowed = true;
252 
253  // #i25616#
255 
256  // #i25616#
258 }
259 
261 {
263 }
264 
265 void SdrGrafObj::SetGraphicObject(const GraphicObject& rGraphicObject)
266 {
267  mpGraphicObject.reset(new GraphicObject(rGraphicObject));
269  mpGraphicObject->SetUserData();
270  SetChanged();
273 }
274 
275 const GraphicObject& SdrGrafObj::GetGraphicObject(bool bForceSwapIn) const
276 {
277  if (bForceSwapIn)
278  ForceSwapIn();
279  return *mpGraphicObject;
280 }
281 
283 {
285  {
286  auto const & rVectorGraphicDataPtr = mpGraphicObject->GetGraphic().getVectorGraphicData();
287 
288  if (rVectorGraphicDataPtr)
289  {
290  const_cast< SdrGrafObj* >(this)->mpReplacementGraphicObject.reset(new GraphicObject(rVectorGraphicDataPtr->getReplacement()));
291  }
292  else if (mpGraphicObject->GetGraphic().GetType() == GraphicType::GdiMetafile)
293  {
294  // Replacement graphic for PDF and metafiles is just the bitmap.
295  const_cast<SdrGrafObj*>(this)->mpReplacementGraphicObject.reset(new GraphicObject(mpGraphicObject->GetGraphic().GetBitmapEx()));
296  }
297  }
298 
299  return mpReplacementGraphicObject.get();
300 }
301 
302 void SdrGrafObj::NbcSetGraphic(const Graphic& rGraphic)
303 {
304  mpGraphicObject->SetGraphic(rGraphic);
306  mpGraphicObject->SetUserData();
308 }
309 
310 void SdrGrafObj::SetGraphic( const Graphic& rGraphic )
311 {
312  if (!rGraphic.getOriginURL().isEmpty())
313  {
315  aFileName = rGraphic.getOriginURL();
316  aFilterName = "";
317  }
318  NbcSetGraphic(rGraphic);
319  if (!rGraphic.getOriginURL().isEmpty())
320  {
321  ImpRegisterLink();
322  mpGraphicObject->SetUserData();
323  }
324  SetChanged();
326  ForceSwapIn();
327 }
328 
330 {
331  return mpGraphicObject->GetGraphic();
332 }
333 
335 {
336  // Refactored most of the code to GraphicObject, where
337  // everybody can use e.g. the cropping functionality
338  MapMode aDestMap(
339  getSdrModelFromSdrObject().GetScaleUnit(),
340  Point(),
341  getSdrModelFromSdrObject().GetScaleFraction(),
342  getSdrModelFromSdrObject().GetScaleFraction());
343  const Size aDestSize( GetLogicRect().GetSize() );
344  GraphicAttr aActAttr = GetGraphicAttr(nTransformFlags);
345 
346  // Delegate to moved code in GraphicObject
347  return GetGraphicObject().GetTransformedGraphic( aDestSize, aDestMap, aActAttr );
348 }
349 
351 {
352  return mpGraphicObject->GetType();
353 }
354 
356 {
357  GraphicAttr aActAttr;
358 
360  if( SdrGrafObjTransformsAttrs::NONE != nTransformFlags &&
361  GraphicType::NONE != eType )
362  {
363  const bool bMirror = bool( nTransformFlags & SdrGrafObjTransformsAttrs::MIRROR );
364  const bool bRotate = bool( nTransformFlags & SdrGrafObjTransformsAttrs::ROTATE ) &&
365  (aGeo.nRotationAngle && aGeo.nRotationAngle != 18000);
366 
367  // Need cropping info earlier
368  const_cast<SdrGrafObj*>(this)->ImpSetAttrToGrafInfo();
369 
370  // Actually transform the graphic only in this case.
371  // Cropping always happens, though.
372  aActAttr = aGrafInfo;
373 
374  if( bMirror )
375  {
376  sal_uInt16 nMirrorCase = ( aGeo.nRotationAngle == 18000 ) ? ( bMirrored ? 3 : 4 ) : ( bMirrored ? 2 : 1 );
377  bool bHMirr = nMirrorCase == 2 || nMirrorCase == 4;
378  bool bVMirr = nMirrorCase == 3 || nMirrorCase == 4;
379 
380  aActAttr.SetMirrorFlags( ( bHMirr ? BmpMirrorFlags::Horizontal : BmpMirrorFlags::NONE ) | ( bVMirr ? BmpMirrorFlags::Vertical : BmpMirrorFlags::NONE ) );
381  }
382 
383  if( bRotate )
384  aActAttr.SetRotation( Degree10(aGeo.nRotationAngle / 10) );
385  }
386 
387  return aActAttr;
388 }
389 
391 {
392  return mpGraphicObject->IsAnimated();
393 }
394 
395 bool SdrGrafObj::IsEPS() const
396 {
397  return mpGraphicObject->IsEPS();
398 }
399 
401 {
402  return mpGraphicObject->GetPrefMapMode();
403 }
404 
406 {
407  return mpGraphicObject->GetPrefSize();
408 }
409 
410 void SdrGrafObj::SetGrafStreamURL( const OUString& rGraphicStreamURL )
411 {
412  if( rGraphicStreamURL.isEmpty() )
413  {
414  mpGraphicObject->SetUserData();
415  }
416  else if(getSdrModelFromSdrObject().IsSwapGraphics() )
417  {
418  mpGraphicObject->SetUserData( rGraphicStreamURL );
419  }
420 }
421 
422 OUString const & SdrGrafObj::GetGrafStreamURL() const
423 {
424  return mpGraphicObject->GetUserData();
425 }
426 
428 {
429  Size aSize = GetGrafPrefSize();
430 
431  if (aGrafInfo.IsCropped())
432  {
437  const tools::Long aCroppedWidth(aSize.getWidth() - aCroppedLeft + aCroppedRight);
438  const tools::Long aCroppedHeight(aSize.getHeight() - aCroppedTop + aCroppedBottom);
439 
440  aSize = Size ( aCroppedWidth, aCroppedHeight);
441  }
442 
443  if ( GetGrafPrefMapMode().GetMapUnit() == MapUnit::MapPixel )
444  aSize = Application::GetDefaultDevice()->PixelToLogic(aSize, MapMode(getSdrModelFromSdrObject().GetScaleUnit()));
445  else
447 
448  return aSize;
449 }
450 
451 // TODO Remove
453 {
454  if (pGraphicLink && (mpGraphicObject->GetType() == GraphicType::NONE ||
455  mpGraphicObject->GetType() == GraphicType::Default) )
456  {
457  pGraphicLink->Update();
458  }
459 }
460 
462 {
463  sfx2::LinkManager* pLinkManager(getSdrModelFromSdrObject().GetLinkManager());
464 
465  if( pLinkManager != nullptr && pGraphicLink == nullptr )
466  {
467  if (!aFileName.isEmpty())
468  {
469  pGraphicLink = new SdrGraphicLink( *this );
470  pLinkManager->InsertFileLink(
473  }
474  }
475 }
476 
478 {
479  sfx2::LinkManager* pLinkManager(getSdrModelFromSdrObject().GetLinkManager());
480 
481  if( pLinkManager != nullptr && pGraphicLink!=nullptr)
482  {
483  // When using Remove, the *pGraphicLink is implicitly deleted
484  pLinkManager->Remove( pGraphicLink );
485  pGraphicLink=nullptr;
486  }
487 }
488 
489 void SdrGrafObj::SetGraphicLink(const OUString& rFileName)
490 {
491  Graphic aGraphic;
492  aGraphic.setOriginURL(rFileName);
493  SetGraphic(aGraphic);
494 }
495 
497 {
499  aFileName.clear();
500  aFilterName.clear();
501 }
502 
504 {
505  return !mpGraphicObject->GetGraphic().getOriginURL().isEmpty();
506 }
507 
509 {
510  bool bNoPresGrf = ( mpGraphicObject->GetType() != GraphicType::NONE ) && !bEmptyPresObj;
511 
512  rInfo.bResizeFreeAllowed = aGeo.nRotationAngle % 9000 == 0 ||
513  aGeo.nRotationAngle % 18000 == 0 ||
514  aGeo.nRotationAngle % 27000 == 0;
515 
516  rInfo.bResizePropAllowed = true;
517  rInfo.bRotateFreeAllowed = bNoPresGrf;
518  rInfo.bRotate90Allowed = bNoPresGrf;
519  rInfo.bMirrorFreeAllowed = bNoPresGrf;
520  rInfo.bMirror45Allowed = bNoPresGrf;
522  rInfo.bTransparenceAllowed = false;
523 
524  // #i118485# Shear allowed and possible now
525  rInfo.bShearAllowed = true;
526 
527  rInfo.bEdgeRadiusAllowed=false;
528  rInfo.bCanConvToPath = !IsEPS();
529  rInfo.bCanConvToPathLineToArea = false;
530  rInfo.bCanConvToPolyLineToArea = false;
531  rInfo.bCanConvToPoly = !IsEPS();
533 }
534 
536 {
537  return OBJ_GRAF;
538 }
539 
541 {
542  const bool bIsChanged(getSdrModelFromSdrObject().IsChanged());
543  NbcSetGraphic( rGraphic );
544  ActionChanged();
546  getSdrModelFromSdrObject().SetChanged(bIsChanged);
547 }
548 
550 {
551  if (!mpGraphicObject)
552  return OUString();
553 
554  auto const & rVectorGraphicDataPtr = mpGraphicObject->GetGraphic().getVectorGraphicData();
555 
556  OUStringBuffer sName;
557 
558  if (rVectorGraphicDataPtr)
559  {
560  switch (rVectorGraphicDataPtr->getVectorGraphicDataType())
561  {
562  case VectorGraphicDataType::Svg:
563  {
564  sName.append(SvxResId(STR_ObjNameSingulGRAFSVG));
565  break;
566  }
567  case VectorGraphicDataType::Wmf:
568  {
569  sName.append(SvxResId(STR_ObjNameSingulGRAFWMF));
570  break;
571  }
572  case VectorGraphicDataType::Emf:
573  {
574  sName.append(SvxResId(STR_ObjNameSingulGRAFEMF));
575  break;
576  }
577  case VectorGraphicDataType::Pdf:
578  {
579  sName.append(SvxResId(STR_ObjNameSingulGRAFPDF));
580  break;
581  }
582  } //no default, see tdf#137813
583  }
584  else
585  {
586  switch( mpGraphicObject->GetType() )
587  {
588  case GraphicType::Bitmap:
589  {
590  const char* pId = ( ( mpGraphicObject->IsTransparent() || GetObjectItem( SDRATTR_GRAFTRANSPARENCE ).GetValue() ) ?
591  ( IsLinkedGraphic() ? STR_ObjNameSingulGRAFBMPTRANSLNK : STR_ObjNameSingulGRAFBMPTRANS ) :
592  ( IsLinkedGraphic() ? STR_ObjNameSingulGRAFBMPLNK : STR_ObjNameSingulGRAFBMP ) );
593 
594  sName.append(SvxResId(pId));
595  }
596  break;
597 
598  case GraphicType::GdiMetafile:
599  sName.append(SvxResId(IsLinkedGraphic() ? STR_ObjNameSingulGRAFMTFLNK : STR_ObjNameSingulGRAFMTF));
600  break;
601 
602  case GraphicType::NONE:
603  sName.append(SvxResId(IsLinkedGraphic() ? STR_ObjNameSingulGRAFNONELNK : STR_ObjNameSingulGRAFNONE));
604  break;
605 
606  default:
607  sName.append(SvxResId(IsLinkedGraphic() ? STR_ObjNameSingulGRAFLNK : STR_ObjNameSingulGRAF));
608  break;
609  }
610  }
611 
612  const OUString aName(GetName());
613 
614  if (!aName.isEmpty())
615  {
616  sName.append(" '");
617  sName.append(aName);
618  sName.append('\'' );
619  }
620 
621  return sName.makeStringAndClear();
622 }
623 
625 {
626  if (!mpGraphicObject)
627  return OUString();
628 
629  auto const & rVectorGraphicDataPtr = mpGraphicObject->GetGraphic().getVectorGraphicData();
630 
631  OUStringBuffer sName;
632 
633  if (rVectorGraphicDataPtr)
634  {
635  switch (rVectorGraphicDataPtr->getVectorGraphicDataType())
636  {
637  case VectorGraphicDataType::Svg:
638  {
639  sName.append(SvxResId(STR_ObjNamePluralGRAFSVG));
640  break;
641  }
642  case VectorGraphicDataType::Wmf:
643  {
644  sName.append(SvxResId(STR_ObjNamePluralGRAFWMF));
645  break;
646  }
647  case VectorGraphicDataType::Emf:
648  {
649  sName.append(SvxResId(STR_ObjNamePluralGRAFEMF));
650  break;
651  }
652  case VectorGraphicDataType::Pdf:
653  {
654  sName.append(SvxResId(STR_ObjNamePluralGRAFPDF));
655  break;
656  }
657  } //no default, see tdf#137813
658  }
659  else
660  {
661  switch(mpGraphicObject->GetType())
662  {
663  case GraphicType::Bitmap:
664  {
665  const char* pId = ( ( mpGraphicObject->IsTransparent() || GetObjectItem( SDRATTR_GRAFTRANSPARENCE ).GetValue() ) ?
666  ( IsLinkedGraphic() ? STR_ObjNamePluralGRAFBMPTRANSLNK : STR_ObjNamePluralGRAFBMPTRANS ) :
667  ( IsLinkedGraphic() ? STR_ObjNamePluralGRAFBMPLNK : STR_ObjNamePluralGRAFBMP ) );
668 
669  sName.append(SvxResId(pId));
670  }
671  break;
672 
673  case GraphicType::GdiMetafile:
674  sName.append(SvxResId(IsLinkedGraphic() ? STR_ObjNamePluralGRAFMTFLNK : STR_ObjNamePluralGRAFMTF));
675  break;
676 
677  case GraphicType::NONE:
678  sName.append(SvxResId(IsLinkedGraphic() ? STR_ObjNamePluralGRAFNONELNK : STR_ObjNamePluralGRAFNONE));
679  break;
680 
681  default:
682  sName.append(SvxResId(IsLinkedGraphic() ? STR_ObjNamePluralGRAFLNK : STR_ObjNamePluralGRAF));
683  break;
684  }
685  }
686 
687  const OUString aName(GetName());
688 
689  if (!aName.isEmpty())
690  {
691  sName.append(" '");
692  sName.append(aName);
693  sName.append('\'');
694  }
695 
696  return sName.makeStringAndClear();
697 }
698 
700 {
701  // call parent
703 
704  // #i103116# the full drag clone leads to problems
705  // with linked graphics, so reset the link in this
706  // temporary interaction object and load graphic
707  if(pRetval && IsLinkedGraphic())
708  {
709  static_cast< SdrGrafObj* >(pRetval.get())->ReleaseGraphicLink();
710  }
711 
712  return pRetval;
713 }
714 
716 {
717  return CloneHelper< SdrGrafObj >(rTargetModel);
718 }
719 
721 {
722  if( this == &rObj )
723  return *this;
724  SdrRectObj::operator=( rObj );
725 
726  aFileName = rObj.aFileName;
727  bMirrored = rObj.bMirrored;
728 
737  mbSignatureLineIsSigned = false;
739 
740  if(rObj.mpQrCode)
741  {
742  mpQrCode = std::make_unique<css::drawing::QRCode>(*rObj.mpQrCode);
743  }
744  else
745  {
746  mpQrCode.reset();
747  }
748 
751  else
752  mpGraphicObject->SetGraphic( rObj.GetGraphic() );
753 
754  if( rObj.IsLinkedGraphic() )
755  {
757  }
758 
760  return *this;
761 }
762 
763 sal_uInt32 SdrGrafObj::GetHdlCount() const
764 {
765  return 8;
766 }
767 
769 {
770  SdrHdlList tempList(nullptr);
771  SdrRectObj::AddToHdlList( tempList );
772  tempList.RemoveHdl(0);
773  tempList.MoveTo(rHdlList);
774 }
775 
776 void SdrGrafObj::NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact)
777 {
778  SdrRectObj::NbcResize( rRef, xFact, yFact );
779 
780  bool bMirrX = xFact.GetNumerator() < 0;
781  bool bMirrY = yFact.GetNumerator() < 0;
782 
783  if( bMirrX != bMirrY )
784  bMirrored = !bMirrored;
785 }
786 
787 void SdrGrafObj::NbcMirror(const Point& rRef1, const Point& rRef2)
788 {
789  SdrRectObj::NbcMirror(rRef1,rRef2);
790  bMirrored = !bMirrored;
791 }
792 
794 {
795  return new SdrGrafObjGeoData;
796 }
797 
799 {
801  SdrGrafObjGeoData& rGGeo=static_cast<SdrGrafObjGeoData&>(rGeo);
802  rGGeo.bMirrored=bMirrored;
803 }
804 
806 {
808  const SdrGrafObjGeoData& rGGeo=static_cast<const SdrGrafObjGeoData&>(rGeo);
809  bMirrored=rGGeo.bMirrored;
810 }
811 
812 void SdrGrafObj::handlePageChange(SdrPage* pOldPage, SdrPage* pNewPage)
813 {
814  const bool bRemove(pNewPage == nullptr && pOldPage != nullptr);
815  const bool bInsert(pNewPage != nullptr && pOldPage == nullptr);
816 
817  if( bRemove )
818  {
819  // No SwapIn necessary here, because if something's not loaded, it can't be animated either.
820  if( mpGraphicObject->IsAnimated())
821  mpGraphicObject->StopAnimation();
822 
823  if( pGraphicLink != nullptr )
825  }
826 
827  // call parent
828  SdrRectObj::handlePageChange(pOldPage, pNewPage);
829 
830  if (!aFileName.isEmpty() && bInsert)
831  {
832  ImpRegisterLink();
833  }
834 }
835 
837 {
839 }
840 
842 {
843  return( mpGraphicObject->GetType() == GraphicType::GdiMetafile );
844 }
845 
847 {
848  return GraphicType::Bitmap == GetGraphicType() && GetGraphic().getVectorGraphicData();
849 }
850 
852 {
853  GDIMetaFile aRetval;
854 
856  {
858  const tools::Rectangle aBoundRect(GetCurrentBoundRect());
859  const MapMode aMap(
860  getSdrModelFromSdrObject().GetScaleUnit(),
861  Point(),
862  getSdrModelFromSdrObject().GetScaleFraction(),
863  getSdrModelFromSdrObject().GetScaleFraction());
864 
865  pOut->EnableOutput(false);
866  pOut->SetMapMode(aMap);
867  aRetval.Record(pOut);
868  SingleObjectPainter(*pOut);
869  aRetval.Stop();
870  aRetval.WindStart();
871  aRetval.Move(-aBoundRect.Left(), -aBoundRect.Top());
872  aRetval.SetPrefMapMode(aMap);
873  aRetval.SetPrefSize(aBoundRect.GetSize());
874  }
875 
876  return aRetval;
877 }
878 
880 {
882  {
883  // Embedded Vector Graphic Data
884  // There is currently no helper to create SdrObjects from primitives (even if I'm thinking
885  // about writing one for some time). To get the roundtrip to SdrObjects it is necessary to
886  // use the old converter path over the MetaFile mechanism. Create Metafile from Svg
887  // primitives here pretty directly
888  rGraphicType = GraphicType::GdiMetafile;
890  }
891  else if (GraphicType::GdiMetafile == rGraphicType)
892  {
894  }
895  return GDIMetaFile();
896 }
897 
898 SdrObjectUniquePtr SdrGrafObj::DoConvertToPolyObj(bool bBezier, bool bAddText ) const
899 {
900  SdrObject* pRetval = nullptr;
901  GraphicType aGraphicType(GetGraphicType());
902  GDIMetaFile aMtf(GetMetaFile(aGraphicType));
903  switch(aGraphicType)
904  {
905  case GraphicType::GdiMetafile:
906  {
907  // Sort into group and return ONLY those objects that can be created from the MetaFile.
908  ImpSdrGDIMetaFileImport aFilter(
910  GetLayer(),
911  maRect);
913 
914  if(aFilter.DoImport(aMtf, *pGrp->GetSubList(), 0))
915  {
916  {
917  // copy transformation
918  GeoStat aGeoStat(GetGeoStat());
919 
920  if(aGeoStat.nShearAngle)
921  {
922  aGeoStat.RecalcTan();
923  pGrp->NbcShear(maRect.TopLeft(), aGeoStat.nShearAngle, aGeoStat.nTan, false);
924  }
925 
926  if(aGeoStat.nRotationAngle)
927  {
928  aGeoStat.RecalcSinCos();
929  pGrp->NbcRotate(maRect.TopLeft(), aGeoStat.nRotationAngle, aGeoStat.nSin, aGeoStat.nCos);
930  }
931  }
932 
933  pRetval = pGrp;
934  pGrp->NbcSetLayer(GetLayer());
935 
936  if(bAddText)
937  {
938  pRetval = ImpConvertAddText(SdrObjectUniquePtr(pRetval), bBezier).release();
939  }
940 
941  // convert all children
942  if( pRetval )
943  {
944  SdrObject* pHalfDone = pRetval;
945  pRetval = pRetval->DoConvertToPolyObj(bBezier, bAddText).release();
946  SdrObject::Free( pHalfDone ); // resulting object is newly created
947 
948  if( pRetval )
949  {
950  // flatten subgroups. As we call
951  // DoConvertToPolyObj() on the resulting group
952  // objects, subgroups can exist (e.g. text is
953  // a group object for every line).
954  SdrObjList* pList = pRetval->GetSubList();
955  if( pList )
956  pList->FlattenGroups();
957  }
958  }
959  }
960  else
961  {
962  // always use SdrObject::Free(...) for SdrObjects (!)
963  SdrObject* pTemp(pGrp);
964  SdrObject::Free(pTemp);
965  }
966 
967  // #i118485# convert line and fill
968  SdrObjectUniquePtr pLineFill = SdrRectObj::DoConvertToPolyObj(bBezier, false);
969 
970  if(pLineFill)
971  {
972  if(pRetval)
973  {
974  pGrp = dynamic_cast< SdrObjGroup* >(pRetval);
975 
976  if(!pGrp)
977  {
979  pGrp->NbcSetLayer(GetLayer());
980  pGrp->GetSubList()->NbcInsertObject(pRetval);
981  }
982 
983  pGrp->GetSubList()->NbcInsertObject(pLineFill.release(), 0);
984  }
985  else
986  {
987  pRetval = pLineFill.release();
988  }
989  }
990 
991  break;
992  }
993  case GraphicType::Bitmap:
994  {
995  // create basic object and add fill
996  pRetval = SdrRectObj::DoConvertToPolyObj(bBezier, bAddText).release();
997 
998  // save bitmap as an attribute
999  if(pRetval)
1000  {
1001  // retrieve bitmap for the fill
1002  SfxItemSet aSet(GetObjectItemSet());
1003 
1004  aSet.Put(XFillStyleItem(drawing::FillStyle_BITMAP));
1005  const BitmapEx aBitmapEx(GetTransformedGraphic().GetBitmapEx());
1006  aSet.Put(XFillBitmapItem(OUString(), Graphic(aBitmapEx)));
1007  aSet.Put(XFillBmpTileItem(false));
1008 
1009  pRetval->SetMergedItemSet(aSet);
1010  }
1011  break;
1012  }
1013  case GraphicType::NONE:
1014  case GraphicType::Default:
1015  {
1016  pRetval = SdrRectObj::DoConvertToPolyObj(bBezier, bAddText).release();
1017  break;
1018  }
1019  }
1020 
1021  return SdrObjectUniquePtr(pRetval);
1022 }
1023 
1024 void SdrGrafObj::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
1025 {
1026  SetXPolyDirty();
1027  SdrRectObj::Notify( rBC, rHint );
1029 }
1030 
1031 
1032 void SdrGrafObj::SetMirrored( bool _bMirrored )
1033 {
1034  bMirrored = _bMirrored;
1035 }
1036 
1038 {
1039  const SfxItemSet& rSet = GetObjectItemSet();
1040  const sal_uInt16 nTrans = rSet.Get( SDRATTR_GRAFTRANSPARENCE ).GetValue();
1041  const SdrGrafCropItem& rCrop = rSet.Get( SDRATTR_GRAFCROP );
1042 
1043  aGrafInfo.SetLuminance( rSet.Get( SDRATTR_GRAFLUMINANCE ).GetValue() );
1044  aGrafInfo.SetContrast( rSet.Get( SDRATTR_GRAFCONTRAST ).GetValue() );
1045  aGrafInfo.SetChannelR( rSet.Get( SDRATTR_GRAFRED ).GetValue() );
1046  aGrafInfo.SetChannelG( rSet.Get( SDRATTR_GRAFGREEN ).GetValue() );
1047  aGrafInfo.SetChannelB( rSet.Get( SDRATTR_GRAFBLUE ).GetValue() );
1048  aGrafInfo.SetGamma( rSet.Get( SDRATTR_GRAFGAMMA ).GetValue() * 0.01 );
1049  aGrafInfo.SetTransparency( static_cast<sal_uInt8>(FRound( std::min( nTrans, sal_uInt16(100) ) * 2.55 )) );
1050  aGrafInfo.SetInvert( rSet.Get( SDRATTR_GRAFINVERT ).GetValue() );
1051  aGrafInfo.SetDrawMode( rSet.Get( SDRATTR_GRAFMODE ).GetValue() );
1052  aGrafInfo.SetCrop( rCrop.GetLeft(), rCrop.GetTop(), rCrop.GetRight(), rCrop.GetBottom() );
1053 
1054  SetXPolyDirty();
1055  SetRectsDirty();
1056 }
1057 
1058 void SdrGrafObj::AdjustToMaxRect( const tools::Rectangle& rMaxRect, bool bShrinkOnly )
1059 {
1060  Size aSize;
1061  Size aMaxSize( rMaxRect.GetSize() );
1062  if (mpGraphicObject->GetPrefMapMode().GetMapUnit() == MapUnit::MapPixel)
1063  aSize = Application::GetDefaultDevice()->PixelToLogic(mpGraphicObject->GetPrefSize(), MapMode(MapUnit::Map100thMM));
1064  else
1065  aSize = OutputDevice::LogicToLogic( mpGraphicObject->GetPrefSize(),
1066  mpGraphicObject->GetPrefMapMode(),
1067  MapMode( MapUnit::Map100thMM ) );
1068 
1069  if( aSize.IsEmpty() )
1070  return;
1071 
1072  Point aPos( rMaxRect.TopLeft() );
1073 
1074  // if the graphic is too large, fit it to page
1075  if ( (!bShrinkOnly ||
1076  ( aSize.Height() > aMaxSize.Height() ) ||
1077  ( aSize.Width() > aMaxSize.Width() ) )&&
1078  aSize.Height() && aMaxSize.Height() )
1079  {
1080  float fGrfWH = static_cast<float>(aSize.Width()) /
1081  static_cast<float>(aSize.Height());
1082  float fWinWH = static_cast<float>(aMaxSize.Width()) /
1083  static_cast<float>(aMaxSize.Height());
1084 
1085  // Scale graphic to page size
1086  if ( fGrfWH < fWinWH )
1087  {
1088  aSize.setWidth( static_cast<tools::Long>(aMaxSize.Height() * fGrfWH) );
1089  aSize.setHeight( aMaxSize.Height() );
1090  }
1091  else if ( fGrfWH > 0.F )
1092  {
1093  aSize.setWidth( aMaxSize.Width() );
1094  aSize.setHeight( static_cast<tools::Long>(aMaxSize.Width() / fGrfWH) );
1095  }
1096 
1097  aPos = rMaxRect.Center();
1098  }
1099 
1100  if( bShrinkOnly )
1101  aPos = maRect.TopLeft();
1102 
1103  aPos.AdjustX( -(aSize.Width() / 2) );
1104  aPos.AdjustY( -(aSize.Height() / 2) );
1105  SetLogicRect( tools::Rectangle( aPos, aSize ) );
1106 }
1107 
1109 {
1110  if(mbGrafAnimationAllowed != bNew)
1111  {
1112  mbGrafAnimationAllowed = bNew;
1113  ActionChanged();
1114  }
1115 }
1116 
1118 {
1120 
1121  if (mpGraphicObject && GetGraphic().IsGfxLink())
1122  {
1123  Graphic aGraphic( GetGraphic() );
1124  GfxLink aLink( aGraphic.GetGfxLink() );
1125  sal_uInt32 nSize = aLink.GetDataSize();
1126  const void* pSourceData = static_cast<const void*>(aLink.GetData());
1127  if( nSize && pSourceData )
1128  {
1129  sal_uInt8 * pBuffer = new sal_uInt8[ nSize ];
1130  memcpy( pBuffer, pSourceData, nSize );
1131 
1132  SvMemoryStream* pStream = new SvMemoryStream( static_cast<void*>(pBuffer), static_cast<std::size_t>(nSize), StreamMode::READ );
1133  pStream->ObjectOwnsMemory( true );
1134  xStream.set( new utl::OInputStreamWrapper( pStream, true ) );
1135  }
1136  }
1137 
1138  if (!xStream.is() && !aFileName.isEmpty())
1139  {
1140  SvFileStream* pStream = new SvFileStream( aFileName, StreamMode::READ );
1141  xStream.set( new utl::OInputStreamWrapper( pStream ) );
1142  }
1143 
1144  return xStream;
1145 }
1146 
1147 // moved crop handle creation here; this is the object type using them
1149 {
1150  basegfx::B2DHomMatrix aMatrix;
1151  basegfx::B2DPolyPolygon aPolyPolygon;
1152 
1153  // get object transformation
1154  TRGetBaseGeometry(aMatrix, aPolyPolygon);
1155 
1156  // part of object transformation correction, but used later, so defined outside next scope
1157  double fShearX(0.0), fRotate(0.0);
1158 
1159  { // TTTT correct shear, it comes currently mirrored from TRGetBaseGeometry, can be removed with aw080
1160  basegfx::B2DTuple aScale;
1161  basegfx::B2DTuple aTranslate;
1162 
1163  aMatrix.decompose(aScale, aTranslate, fRotate, fShearX);
1164 
1165  if(!basegfx::fTools::equalZero(fShearX))
1166  {
1167  // shearX is used, correct it
1168  fShearX = -fShearX;
1169  }
1170 
1172  aScale,
1173  fShearX,
1174  fRotate,
1175  aTranslate);
1176  }
1177 
1178  // get crop values
1179  const SdrGrafCropItem& rCrop = GetMergedItem(SDRATTR_GRAFCROP);
1180 
1181  if(rCrop.GetLeft() || rCrop.GetTop() || rCrop.GetRight() ||rCrop.GetBottom())
1182  {
1183  // decompose object transformation to have current translate and scale
1184  basegfx::B2DVector aScale, aTranslate;
1185  double fLclRotate, fLclShearX;
1186 
1187  aMatrix.decompose(aScale, aTranslate, fLclRotate, fLclShearX);
1188 
1189  if(!aScale.equalZero())
1190  {
1191  // get crop scale
1192  const basegfx::B2DVector aCropScaleFactor(
1193  GetGraphicObject().calculateCropScaling(
1194  aScale.getX(),
1195  aScale.getY(),
1196  rCrop.GetLeft(),
1197  rCrop.GetTop(),
1198  rCrop.GetRight(),
1199  rCrop.GetBottom()));
1200 
1201  // apply crop scale
1202  const double fCropLeft(rCrop.GetLeft() * aCropScaleFactor.getX());
1203  const double fCropTop(rCrop.GetTop() * aCropScaleFactor.getY());
1204  const double fCropRight(rCrop.GetRight() * aCropScaleFactor.getX());
1205  const double fCropBottom(rCrop.GetBottom() * aCropScaleFactor.getY());
1206  basegfx::B2DHomMatrix aMatrixForCropViewHdl(aMatrix);
1207 
1208  if(IsMirrored())
1209  {
1210  // create corrected new matrix, TTTT can be removed with aw080
1211  // the old mirror only can mirror horizontally; the vertical mirror
1212  // is faked by using the horizontal and 180 degree rotation. Since
1213  // the object can be rotated differently from 180 degree, this is
1214  // not safe to detect. Just correct horizontal mirror (which is
1215  // in IsMirrored()) and keep the rotation angle
1216  // caution: Do not modify aMatrix, it is used below to calculate
1217  // the exact handle positions
1218  basegfx::B2DHomMatrix aPreMultiply;
1219 
1220  // mirrored X, apply
1221  aPreMultiply.translate(-0.5, 0.0);
1222  aPreMultiply.scale(-1.0, 1.0);
1223  aPreMultiply.translate(0.5, 0.0);
1224 
1225  aMatrixForCropViewHdl = aMatrixForCropViewHdl * aPreMultiply;
1226  }
1227 
1228  rTarget.AddHdl(
1229  std::make_unique<SdrCropViewHdl>(
1230  aMatrixForCropViewHdl,
1232  fCropLeft,
1233  fCropTop,
1234  fCropRight,
1235  fCropBottom));
1236  }
1237  }
1238 
1239  basegfx::B2DPoint aPos;
1240 
1241  aPos = aMatrix * basegfx::B2DPoint(0.0, 0.0);
1242  rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), SdrHdlKind::UpperLeft, fShearX, fRotate));
1243  aPos = aMatrix * basegfx::B2DPoint(0.5, 0.0);
1244  rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), SdrHdlKind::Upper, fShearX, fRotate));
1245  aPos = aMatrix * basegfx::B2DPoint(1.0, 0.0);
1246  rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), SdrHdlKind::UpperRight, fShearX, fRotate));
1247  aPos = aMatrix * basegfx::B2DPoint(0.0, 0.5);
1248  rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), SdrHdlKind::Left , fShearX, fRotate));
1249  aPos = aMatrix * basegfx::B2DPoint(1.0, 0.5);
1250  rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), SdrHdlKind::Right, fShearX, fRotate));
1251  aPos = aMatrix * basegfx::B2DPoint(0.0, 1.0);
1252  rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), SdrHdlKind::LowerLeft, fShearX, fRotate));
1253  aPos = aMatrix * basegfx::B2DPoint(0.5, 1.0);
1254  rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), SdrHdlKind::Lower, fShearX, fRotate));
1255  aPos = aMatrix * basegfx::B2DPoint(1.0, 1.0);
1256  rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), SdrHdlKind::LowerRight, fShearX, fRotate));
1257 }
1258 
1259 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void RestGeoData(const SdrObjGeoData &rGeo) override
Definition: svdograf.cxx:805
std::unique_ptr< SdrHdl > RemoveHdl(size_t nNum)
Definition: svdhdl.cxx:2230
Point TopLeft() const
virtual void AdjustToMaxRect(const tools::Rectangle &rMaxRect, bool bShrinkOnly=false) override
Definition: svdograf.cxx:1058
tools::Long GetBottomCrop() const
bool IsEPS() const
Definition: svdograf.cxx:395
void SetTransparency(sal_uInt8 cTransparency)
OUString aFilterName
Definition: svdograf.hxx:95
virtual SdrObjectUniquePtr DoConvertToPolyObj(bool bBezier, bool bAddText) const override
Definition: svdograf.cxx:898
void SetGamma(double fGamma)
bool mbIsSignatureLineCanAddComment
Definition: svdograf.hxx:111
constexpr TypedWhichId< SdrGrafGamma100Item > SDRATTR_GRAFGAMMA(SDRATTR_GRAF_FIRST+5)
GDIMetaFile getMetafileFromEmbeddedVectorGraphicData() const
Definition: svdograf.cxx:851
OUString maSignatureLineId
Definition: svdograf.hxx:105
virtual void addCropHandles(SdrHdlList &rTarget) const override
Definition: svdograf.cxx:1148
bool bEmptyPresObj
Definition: svdobj.hxx:888
void NbcSetGraphic(const Graphic &rGrf)
Definition: svdograf.cxx:302
virtual const tools::Rectangle & GetCurrentBoundRect() const
Definition: svdobj.cxx:854
void ImpRegisterLink()
Definition: svdograf.cxx:461
void setWidth(tools::Long nWidth)
virtual void NbcMirror(const Point &rRef1, const Point &rRef2) override
Definition: svdorect.cxx:485
friend class SdrGraphicLink
Definition: svdograf.hxx:86
Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
virtual void NbcResize(const Point &rRef, const Fraction &xFact, const Fraction &yFact) override
Definition: svdograf.cxx:776
double nSin
Definition: svdtrans.hxx:219
GeoStat aGeo
Definition: svdotext.hxx:185
tools::Long getWidth() const
GDIMetaFile GetMetaFile(GraphicType &rGraphicType) const
Definition: svdograf.cxx:879
void SetMirrored(bool _bMirrored)
Definition: svdograf.cxx:1032
void SetInvert(bool bInvert)
long Long
tools::Long nRotationAngle
Definition: svdtrans.hxx:216
virtual void NbcInsertObject(SdrObject *pObj, size_t nPos=SAL_MAX_SIZE)
Definition: svdpage.cxx:292
virtual void NbcSetLayer(SdrLayerID nLayer) override
Definition: svdogrp.cxx:148
virtual SdrObjectUniquePtr DoConvertToPolyObj(bool bBezier, bool bAddText) const
Definition: svdobj.cxx:2531
double getX() const
GraphicType
void SetPrefSize(const Size &rSize)
Size getOriginalSize() const
Definition: svdograf.cxx:427
void SetMirrorFlags(BmpMirrorFlags nMirrFlags)
void setOriginURL(OUString const &rOriginURL)
constexpr TypedWhichId< SdrGrafRedItem > SDRATTR_GRAFRED(SDRATTR_GRAF_FIRST+0)
double getY() const
SdrObjectUniquePtr ImpConvertAddText(SdrObjectUniquePtr pObj, bool bBezier) const
Definition: svdotxtr.cxx:463
OUString aFileName
Definition: svdograf.hxx:94
tools::Long GetTopCrop() const
virtual void AddToHdlList(SdrHdlList &rHdlList) const override
Definition: svdograf.cxx:768
virtual void handlePageChange(SdrPage *pOldPage, SdrPage *pNewPage) override
Definition: svdograf.cxx:812
const GraphicObject & GetGraphicObject(bool bForceSwapIn=false) const
Definition: svdograf.cxx:275
std::unique_ptr< GraphicObject > mpGraphicObject
Definition: svdograf.hxx:96
static void Free(SdrObject *&_rpObject)
Definition: svdobj.cxx:396
OUString maSignatureLineSuggestedSignerEmail
Definition: svdograf.hxx:108
void RecalcTan()
Definition: svdtrans.cxx:463
virtual SdrObjectUniquePtr getFullDragClone() const override
Definition: svdotext.cxx:2033
GraphicType GetGraphicType() const
Definition: svdograf.cxx:350
All geometrical data of an arbitrary object for use in undo/redo.
Definition: svdobj.hxx:174
void SetDrawMode(GraphicDrawMode eDrawMode)
virtual SdrObjList * GetSubList() const
Definition: svdobj.cxx:647
SdrObjKind
Definition: svdobjkind.hxx:24
Graphic GetTransformedGraphic(const Size &rDestSize, const MapMode &rDestMap, const GraphicAttr &rAttr) const
Size GetGrafPrefSize() const
Definition: svdograf.cxx:405
virtual SdrObjectUniquePtr getFullDragClone() const override
Definition: svdograf.cxx:699
void ImpSetLinkedGraphic(const Graphic &rGraphic)
Definition: svdograf.cxx:540
Rectangle objects (rectangle, circle, ...)
Definition: svdorect.hxx:39
static OutputDevice * GetDefaultDevice()
HashMap_OWString_Interface aMap
Provides information about various ZObject properties.
Definition: svdobj.hxx:196
void ImpDeregisterLink()
Definition: svdograf.cxx:477
MapUnit GetScaleUnit() const
Definition: svdmodel.hxx:366
void Record(OutputDevice *pOutDev)
Reference< XInputStream > xStream
tools::Long Left() const
OUString SvxResId(const char *pId)
Definition: dialmgr.cxx:25
virtual void SaveGeoData(SdrObjGeoData &rGeo) const override
Definition: svdotext.cxx:1440
B2DHomMatrix createScaleShearXRotateTranslateB2DHomMatrix(double fScaleX, double fScaleY, double fShearX, double fRadiant, double fTranslateX, double fTranslateY)
virtual std::unique_ptr< sdr::contact::ViewContact > CreateObjectSpecificViewContact() override
Definition: svdograf.cxx:124
The transformation of a rectangle into a polygon, by using angle parameters from GeoStat.
Definition: svdtrans.hxx:214
void ForceSwapIn() const
Definition: svdograf.cxx:452
void SetGraphic(const Graphic &rGrf)
Definition: svdograf.cxx:310
virtual SdrObjectUniquePtr DoConvertToPolyObj(bool bBezier, bool bAddText) const override
Definition: svdorect.cxx:543
void SetGraphicObject(const GraphicObject &rGrfObj)
Definition: svdograf.cxx:265
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Detects when a stylesheet is changed.
Definition: svdograf.cxx:1024
const SfxItemSet & GetObjectItemSet() const
Definition: svdobj.cxx:1885
oslFileHandle & pOut
virtual OUString TakeObjNameSingul() const override
Definition: svdograf.cxx:549
tools::Rectangle maRect
Definition: svdotext.hxx:182
const GDIMetaFile & GetGDIMetaFile() const
void SetMergedItemSet(const SfxItemSet &rSet, bool bClearAllItems=false)
Definition: svdobj.cxx:1915
bool bNoShear
Definition: svdotext.hxx:232
void SetGrafStreamURL(const OUString &rGraphicStreamURL)
Definition: svdograf.cxx:410
SotClipboardFormatId
const GeoStat & GetGeoStat() const
Definition: svdotext.hxx:399
bool mbSignatureLineIsSigned
Definition: svdograf.hxx:112
virtual void SetChanged(bool bFlg=true)
Definition: svdmodel.cxx:1261
B2IRange fround(const B2DRange &rRange)
OUString maSignatureLineSigningInstructions
Definition: svdograf.hxx:109
void InsertFileLink(sfx2::SvBaseLink &, SvBaseLinkObjectType nFileType, const OUString &rFileNm, const OUString *pFilterNm=nullptr, const OUString *pRange=nullptr)
DocumentType eType
const SfxPoolItem & GetObjectItem(const sal_uInt16 nWhich) const
Definition: svdobj.cxx:1920
tools::Long getHeight() const
virtual void SaveGeoData(SdrObjGeoData &rGeo) const override
Definition: svdograf.cxx:798
constexpr TypedWhichId< SdrGrafTransparenceItem > SDRATTR_GRAFTRANSPARENCE(SDRATTR_GRAF_FIRST+6)
bool IsAnimated() const
Definition: svdograf.cxx:390
virtual void handlePageChange(SdrPage *pOldPage, SdrPage *pNewPage) override
Definition: svdotext.cxx:442
Graphic GetTransformedGraphic(SdrGrafObjTransformsAttrs nTransformFlags=SdrGrafObjTransformsAttrs::ALL) const
Definition: svdograf.cxx:334
bool mbSupportTextIndentingOnLineWidthChange
Definition: svdobj.hxx:899
OUString maSignatureLineSuggestedSignerName
Definition: svdograf.hxx:106
double nCos
Definition: svdtrans.hxx:220
bool IsCropped() const
bool IsEmpty() const
css::uno::Reference< css::graphic::XGraphic > mpSignatureLineUnsignedGraphic
Definition: svdograf.hxx:113
constexpr TypedWhichId< SdrGrafLuminanceItem > SDRATTR_GRAFLUMINANCE(SDRATTR_GRAF_FIRST+3)
void MoveTo(SdrHdlList &rOther)
Definition: svdhdl.cxx:2323
void Remove(SvBaseLink const *pLink)
void SetContrast(short nContrastPercent)
void SingleObjectPainter(OutputDevice &rOut) const
Definition: svdobj.cxx:951
OUString sName
bool decompose(B2DTuple &rScale, B2DTuple &rTranslate, double &rRotate, double &rShearX) const
tools::Long FRound(double fVal)
const GraphicObject * GetReplacementGraphicObject() const
Definition: svdograf.cxx:282
const Graphic & GetGraphic() const
Definition: svdograf.cxx:329
void SetRotation(Degree10 nRotate10)
void BroadcastObjectChange() const
Definition: svdobj.cxx:905
constexpr TypedWhichId< SdrGrafBlueItem > SDRATTR_GRAFBLUE(SDRATTR_GRAF_FIRST+2)
tools::Long GetRightCrop() const
const primitive2d::ObjectInfoPrimitive2D * getResult() const
bool mbIsSignatureLine
Definition: svdograf.hxx:104
OutlineText, special text object for StarDraw.
Definition: svdobjkind.hxx:45
void ActionChanged() const
Definition: svdobj.cxx:257
double nTan
Definition: svdtrans.hxx:218
size_t DoImport(const GDIMetaFile &rMtf, SdrObjList &rDestList, size_t nInsPos, SvdProgressInfo *pProgrInfo=nullptr)
Definition: svdfmtf.cxx:210
virtual std::unique_ptr< sdr::properties::BaseProperties > CreateObjectSpecificProperties() override
Definition: svdograf.cxx:116
void SetChannelG(short nChannelGPercent)
static bool equalZero(const double &rfVal)
void SetXPolyDirty()
Definition: svdorect.cxx:94
tools::Long Width() const
virtual ~SdrGrafObj() override
Definition: svdograf.cxx:260
SdrGraphicLink * pGraphicLink
Definition: svdograf.hxx:98
constexpr TypedWhichId< SdrGrafModeItem > SDRATTR_GRAFMODE(SDRATTR_GRAF_FIRST+8)
void scale(double fX, double fY)
SdrModel & getSdrModelFromSdrObject() const
Definition: svdobj.cxx:273
void onGraphicChanged()
Definition: svdograf.cxx:132
void process(const primitive2d::Primitive2DContainer &rSource)
virtual void SetLogicRect(const tools::Rectangle &rRect)
Definition: svdobj.cxx:1632
virtual SdrObjList * GetSubList() const override
Definition: svdogrp.cxx:168
void Move(tools::Long nX, tools::Long nY)
OUString getOriginURL() const
MapUnit GetMapUnit() const
virtual void TakeObjInfo(SdrObjTransformInfoRec &rInfo) const override
Definition: svdograf.cxx:508
virtual SdrObjKind GetObjIdentifier() const override
Definition: svdograf.cxx:535
const SfxPoolItem & GetMergedItem(const sal_uInt16 nWhich) const
Definition: svdobj.cxx:1925
void SetChannelR(short nChannelRPercent)
void WindStart()
This class represents an embedded or linked bitmap graphic object.
Definition: svdograf.hxx:77
GfxLink GetGfxLink() const
tools::Long Top() const
SdrGrafObjTransformsAttrs
Options for GetTransformedGraphic()
Definition: svdograf.hxx:48
Abstract DrawObject.
Definition: svdobj.hxx:260
constexpr TypedWhichId< SdrGrafCropItem > SDRATTR_GRAFCROP(SDRATTR_GRAF_FIRST+9)
void SetGrafAnimationAllowed(bool bNew)
Definition: svdograf.cxx:1108
OUString GetName() const
Definition: svdobj.cxx:698
Size GetSize() const
void SetGraphicLink(const OUString &rFileName)
Definition: svdograf.cxx:489
void SetChannelB(short nChannelBPercent)
virtual SdrLayerID GetLayer() const
Definition: svdobj.cxx:577
constexpr TypedWhichId< SdrGrafGreenItem > SDRATTR_GRAFGREEN(SDRATTR_GRAF_FIRST+1)
Point PixelToLogic(const Point &rDevicePt) const
css::uno::Reference< css::io::XInputStream > getInputStream() const
Definition: svdograf.cxx:1117
bool IsLinkedGraphic() const
Definition: svdograf.cxx:503
static bool GetDisplayNames(const SvBaseLink *, OUString *pType, OUString *pFile=nullptr, OUString *pLink=nullptr, OUString *pFilter=nullptr)
std::unique_ptr< css::drawing::QRCode > mpQrCode
Definition: svdograf.hxx:115
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
SdrRectObj & operator=(const SdrRectObj &rCopy)
Definition: svdorect.cxx:251
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
bool equalZero() const
unsigned char sal_uInt8
void RecalcSinCos()
Definition: svdtrans.cxx:451
virtual void NbcResize(const Point &rRef, const Fraction &xFact, const Fraction &yFact) override
Definition: svdorect.cxx:467
virtual OUString TakeObjNamePlural() const override
Definition: svdograf.cxx:624
static SotClipboardFormatId GetFormatIdFromMimeType(const OUString &rMimeType)
void SetLuminance(short nLuminancePercent)
OUString aName
std::unique_ptr< GraphicObject > mpReplacementGraphicObject
Definition: svdograf.hxx:97
void ObjectOwnsMemory(bool bOwn)
bool HasGDIMetaFile() const
Definition: svdograf.cxx:841
tools::Long GetLeftCrop() const
virtual SdrGrafObj * CloneSdrObject(SdrModel &rTargetModel) const override
Definition: svdograf.cxx:715
virtual void NbcShear(const Point &rRef, tools::Long nAngle, double tn, bool bVShear) override
Definition: svdogrp.cxx:450
void SetDescription(const OUString &rStr)
Definition: svdobj.cxx:752
tools::Long Height() const
SdrGrafObj(SdrModel &rSdrModel)
Definition: svdograf.cxx:183
bool bMirrored
Definition: svdograf.hxx:99
sal_Int32 GetNumerator() const
std::unique_ptr< SdrObject, SdrObjectFreeOp > SdrObjectUniquePtr
Definition: svdobj.hxx:98
void ReleaseGraphicLink()
Definition: svdograf.cxx:496
void translate(double fX, double fY)
virtual void NbcMirror(const Point &rRef1, const Point &rRef2) override
Definition: svdograf.cxx:787
GraphicAttr aGrafInfo
Definition: svdograf.hxx:92
virtual void RestGeoData(const SdrObjGeoData &rGeo) override
Definition: svdorect.cxx:577
virtual void SetRectsDirty(bool bNotMyself=false, bool bRecursive=true)
Definition: svdobj.cxx:435
virtual void AddToHdlList(SdrHdlList &rHdlList) const override
Definition: svdorect.cxx:300
virtual SdrObjGeoData * NewGeoData() const override
A derived class must override these 3 methods if it has own geometric data that must be saved for Und...
Definition: svdograf.cxx:793
void setHeight(tools::Long nHeight)
bool IsMirrored() const
Definition: svdograf.hxx:205
virtual void NbcRotate(const Point &rRef, tools::Long nAngle, double sn, double cs) override
Definition: svdogrp.cxx:416
constexpr TypedWhichId< SdrGrafContrastItem > SDRATTR_GRAFCONTRAST(SDRATTR_GRAF_FIRST+4)
constexpr TypedWhichId< SdrGrafInvertItem > SDRATTR_GRAFINVERT(SDRATTR_GRAF_FIRST+7)
virtual bool TRGetBaseGeometry(basegfx::B2DHomMatrix &rMatrix, basegfx::B2DPolyPolygon &rPolyPolygon) const override
Definition: svdotext.cxx:1585
bool LineGeometryUsageIsNecessary() const
Definition: svdobj.cxx:962
bool mbGrafAnimationAllowed
Definition: svdograf.hxx:102
SdrGrafObj & operator=(const SdrGrafObj &rObj)
Definition: svdograf.cxx:720
A SdrPage contains exactly one SdrObjList and a description of the physical page dimensions (size / m...
Definition: svdpage.hxx:365
void ImpSetAttrToGrafInfo()
Definition: svdograf.cxx:1037
void SetCrop(tools::Long nLeft_100TH_MM, tools::Long nTop_100TH_MM, tools::Long nRight_100TH_MM, tools::Long nBottom_100TH_MM)
tools::Long nShearAngle
Definition: svdtrans.hxx:217
static SotClipboardFormatId RegisterStatusInfoId()
const std::shared_ptr< VectorGraphicData > & getVectorGraphicData() const
GraphicAttr GetGraphicAttr(SdrGrafObjTransformsAttrs nTransformFlags=SdrGrafObjTransformsAttrs::ALL) const
Definition: svdograf.cxx:355
virtual void SetChanged()
Definition: svdobj.cxx:929
void SetName(const OUString &rStr)
Definition: svdobj.cxx:664
bool isEmbeddedVectorGraphicData() const
Definition: svdograf.cxx:846
void SetTitle(const OUString &rStr)
Definition: svdobj.cxx:708
bool mbLineIsOutsideGeometry
Definition: svdobj.hxx:897
OUString const & GetGrafStreamURL() const
Definition: svdograf.cxx:422
OUString maSignatureLineSuggestedSignerTitle
Definition: svdograf.hxx:107
SfxLinkUpdateMode
MapMode GetGrafPrefMapMode() const
Definition: svdograf.cxx:400
Point Center() const
bool mbIsSignatureLineShowSignDate
Definition: svdograf.hxx:110
void AddHdl(std::unique_ptr< SdrHdl > pHdl)
Definition: svdhdl.cxx:2289
void FlattenGroups()
Makes the object list flat, i.e.
Definition: svdpage.cxx:782
virtual sal_uInt32 GetHdlCount() const override
Via GetHdlCount the number of Handles can be retrieved.
Definition: svdograf.cxx:763
void SetPrefMapMode(const MapMode &rMapMode)
void StartAnimation()
Definition: svdograf.cxx:836
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Detects when a stylesheet is changed.
Definition: svdorect.cxx:571
virtual const tools::Rectangle & GetLogicRect() const override
Definition: svdotxtr.cxx:69