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  aReferer = "";
317  aFilterName = "";
318  }
319  NbcSetGraphic(rGraphic);
320  if (!rGraphic.getOriginURL().isEmpty())
321  {
322  ImpRegisterLink();
323  mpGraphicObject->SetUserData();
324  }
325  SetChanged();
327  ForceSwapIn();
328 }
329 
331 {
332  return mpGraphicObject->GetGraphic();
333 }
334 
336 {
337  // Refactored most of the code to GraphicObject, where
338  // everybody can use e.g. the cropping functionality
339  MapMode aDestMap(
340  getSdrModelFromSdrObject().GetScaleUnit(),
341  Point(),
342  getSdrModelFromSdrObject().GetScaleFraction(),
343  getSdrModelFromSdrObject().GetScaleFraction());
344  const Size aDestSize( GetLogicRect().GetSize() );
345  GraphicAttr aActAttr = GetGraphicAttr(nTransformFlags);
346 
347  // Delegate to moved code in GraphicObject
348  return GetGraphicObject().GetTransformedGraphic( aDestSize, aDestMap, aActAttr );
349 }
350 
352 {
353  return mpGraphicObject->GetType();
354 }
355 
357 {
358  GraphicAttr aActAttr;
359 
361  if( SdrGrafObjTransformsAttrs::NONE != nTransformFlags &&
362  GraphicType::NONE != eType )
363  {
364  const bool bMirror = bool( nTransformFlags & SdrGrafObjTransformsAttrs::MIRROR );
365  const bool bRotate = bool( nTransformFlags & SdrGrafObjTransformsAttrs::ROTATE ) &&
366  (aGeo.nRotationAngle && aGeo.nRotationAngle != 18000);
367 
368  // Need cropping info earlier
369  const_cast<SdrGrafObj*>(this)->ImpSetAttrToGrafInfo();
370 
371  // Actually transform the graphic only in this case.
372  // Cropping always happens, though.
373  aActAttr = aGrafInfo;
374 
375  if( bMirror )
376  {
377  sal_uInt16 nMirrorCase = ( aGeo.nRotationAngle == 18000 ) ? ( bMirrored ? 3 : 4 ) : ( bMirrored ? 2 : 1 );
378  bool bHMirr = nMirrorCase == 2 || nMirrorCase == 4;
379  bool bVMirr = nMirrorCase == 3 || nMirrorCase == 4;
380 
381  aActAttr.SetMirrorFlags( ( bHMirr ? BmpMirrorFlags::Horizontal : BmpMirrorFlags::NONE ) | ( bVMirr ? BmpMirrorFlags::Vertical : BmpMirrorFlags::NONE ) );
382  }
383 
384  if( bRotate )
385  aActAttr.SetRotation( sal_uInt16(aGeo.nRotationAngle / 10) );
386  }
387 
388  return aActAttr;
389 }
390 
392 {
393  return mpGraphicObject->IsAnimated();
394 }
395 
396 bool SdrGrafObj::IsEPS() const
397 {
398  return mpGraphicObject->IsEPS();
399 }
400 
402 {
403  return mpGraphicObject->GetPrefMapMode();
404 }
405 
407 {
408  return mpGraphicObject->GetPrefSize();
409 }
410 
411 void SdrGrafObj::SetGrafStreamURL( const OUString& rGraphicStreamURL )
412 {
413  if( rGraphicStreamURL.isEmpty() )
414  {
415  mpGraphicObject->SetUserData();
416  }
417  else if(getSdrModelFromSdrObject().IsSwapGraphics() )
418  {
419  mpGraphicObject->SetUserData( rGraphicStreamURL );
420  }
421 }
422 
423 OUString const & SdrGrafObj::GetGrafStreamURL() const
424 {
425  return mpGraphicObject->GetUserData();
426 }
427 
429 {
430  Size aSize = GetGrafPrefSize();
431 
432  if (aGrafInfo.IsCropped())
433  {
438  const long aCroppedWidth(aSize.getWidth() - aCroppedLeft + aCroppedRight);
439  const long aCroppedHeight(aSize.getHeight() - aCroppedTop + aCroppedBottom);
440 
441  aSize = Size ( aCroppedWidth, aCroppedHeight);
442  }
443 
444  if ( GetGrafPrefMapMode().GetMapUnit() == MapUnit::MapPixel )
445  aSize = Application::GetDefaultDevice()->PixelToLogic(aSize, MapMode(getSdrModelFromSdrObject().GetScaleUnit()));
446  else
448 
449  return aSize;
450 }
451 
452 // TODO Remove
454 {
455  if (pGraphicLink && (mpGraphicObject->GetType() == GraphicType::NONE ||
456  mpGraphicObject->GetType() == GraphicType::Default) )
457  {
458  pGraphicLink->Update();
459  }
460 }
461 
463 {
464  sfx2::LinkManager* pLinkManager(getSdrModelFromSdrObject().GetLinkManager());
465 
466  if( pLinkManager != nullptr && pGraphicLink == nullptr )
467  {
468  if (!aFileName.isEmpty())
469  {
470  pGraphicLink = new SdrGraphicLink( *this );
471  pLinkManager->InsertFileLink(
474  }
475  }
476 }
477 
479 {
480  sfx2::LinkManager* pLinkManager(getSdrModelFromSdrObject().GetLinkManager());
481 
482  if( pLinkManager != nullptr && pGraphicLink!=nullptr)
483  {
484  // When using Remove, the *pGraphicLink is implicitly deleted
485  pLinkManager->Remove( pGraphicLink );
486  pGraphicLink=nullptr;
487  }
488 }
489 
490 void SdrGrafObj::SetGraphicLink(const OUString& rFileName, const OUString& /*rReferer*/, const OUString& /*rFilterName*/)
491 {
492  Graphic aGraphic;
493  aGraphic.setOriginURL(rFileName);
494  SetGraphic(aGraphic);
495 }
496 
498 {
500  aFileName.clear();
501  aReferer.clear();
502  aFilterName.clear();
503 }
504 
506 {
507  return !mpGraphicObject->GetGraphic().getOriginURL().isEmpty();
508 }
509 
511 {
512  bool bNoPresGrf = ( mpGraphicObject->GetType() != GraphicType::NONE ) && !bEmptyPresObj;
513 
514  rInfo.bResizeFreeAllowed = aGeo.nRotationAngle % 9000 == 0 ||
515  aGeo.nRotationAngle % 18000 == 0 ||
516  aGeo.nRotationAngle % 27000 == 0;
517 
518  rInfo.bResizePropAllowed = true;
519  rInfo.bRotateFreeAllowed = bNoPresGrf;
520  rInfo.bRotate90Allowed = bNoPresGrf;
521  rInfo.bMirrorFreeAllowed = bNoPresGrf;
522  rInfo.bMirror45Allowed = bNoPresGrf;
524  rInfo.bTransparenceAllowed = false;
525 
526  // #i118485# Shear allowed and possible now
527  rInfo.bShearAllowed = true;
528 
529  rInfo.bEdgeRadiusAllowed=false;
530  rInfo.bCanConvToPath = !IsEPS();
531  rInfo.bCanConvToPathLineToArea = false;
532  rInfo.bCanConvToPolyLineToArea = false;
533  rInfo.bCanConvToPoly = !IsEPS();
535 }
536 
538 {
539  return sal_uInt16( OBJ_GRAF );
540 }
541 
543 {
544  const bool bIsChanged(getSdrModelFromSdrObject().IsChanged());
545  NbcSetGraphic( rGraphic );
546  ActionChanged();
548  getSdrModelFromSdrObject().SetChanged(bIsChanged);
549 }
550 
552 {
553  if (!mpGraphicObject)
554  return OUString();
555 
556  auto const & rVectorGraphicDataPtr = mpGraphicObject->GetGraphic().getVectorGraphicData();
557 
558  OUStringBuffer sName;
559 
560  if (rVectorGraphicDataPtr)
561  {
562  switch (rVectorGraphicDataPtr->getVectorGraphicDataType())
563  {
564  case VectorGraphicDataType::Wmf:
565  {
566  sName.append(SvxResId(STR_ObjNameSingulGRAFWMF));
567  break;
568  }
569  case VectorGraphicDataType::Emf:
570  {
571  sName.append(SvxResId(STR_ObjNameSingulGRAFEMF));
572  break;
573  }
574  default: // case VectorGraphicDataType::Svg:
575  {
576  sName.append(SvxResId(STR_ObjNameSingulGRAFSVG));
577  break;
578  }
579  }
580  }
581  else
582  {
583  switch( mpGraphicObject->GetType() )
584  {
585  case GraphicType::Bitmap:
586  {
587  const char* pId = ( ( mpGraphicObject->IsTransparent() || GetObjectItem( SDRATTR_GRAFTRANSPARENCE ).GetValue() ) ?
588  ( IsLinkedGraphic() ? STR_ObjNameSingulGRAFBMPTRANSLNK : STR_ObjNameSingulGRAFBMPTRANS ) :
589  ( IsLinkedGraphic() ? STR_ObjNameSingulGRAFBMPLNK : STR_ObjNameSingulGRAFBMP ) );
590 
591  sName.append(SvxResId(pId));
592  }
593  break;
594 
595  case GraphicType::GdiMetafile:
596  sName.append(SvxResId(IsLinkedGraphic() ? STR_ObjNameSingulGRAFMTFLNK : STR_ObjNameSingulGRAFMTF));
597  break;
598 
599  case GraphicType::NONE:
600  sName.append(SvxResId(IsLinkedGraphic() ? STR_ObjNameSingulGRAFNONELNK : STR_ObjNameSingulGRAFNONE));
601  break;
602 
603  default:
604  sName.append(SvxResId(IsLinkedGraphic() ? STR_ObjNameSingulGRAFLNK : STR_ObjNameSingulGRAF));
605  break;
606  }
607  }
608 
609  const OUString aName(GetName());
610 
611  if (!aName.isEmpty())
612  {
613  sName.append(" '");
614  sName.append(aName);
615  sName.append('\'' );
616  }
617 
618  return sName.makeStringAndClear();
619 }
620 
622 {
623  if (!mpGraphicObject)
624  return OUString();
625 
626  auto const & rVectorGraphicDataPtr = mpGraphicObject->GetGraphic().getVectorGraphicData();
627 
628  OUStringBuffer sName;
629 
630  if (rVectorGraphicDataPtr)
631  {
632  switch (rVectorGraphicDataPtr->getVectorGraphicDataType())
633  {
634  case VectorGraphicDataType::Wmf:
635  {
636  sName.append(SvxResId(STR_ObjNamePluralGRAFWMF));
637  break;
638  }
639  case VectorGraphicDataType::Emf:
640  {
641  sName.append(SvxResId(STR_ObjNamePluralGRAFEMF));
642  break;
643  }
644  default: // case VectorGraphicDataType::Svg:
645  {
646  sName.append(SvxResId(STR_ObjNamePluralGRAFSVG));
647  break;
648  }
649  }
650  }
651  else
652  {
653  switch(mpGraphicObject->GetType())
654  {
655  case GraphicType::Bitmap:
656  {
657  const char* pId = ( ( mpGraphicObject->IsTransparent() || GetObjectItem( SDRATTR_GRAFTRANSPARENCE ).GetValue() ) ?
658  ( IsLinkedGraphic() ? STR_ObjNamePluralGRAFBMPTRANSLNK : STR_ObjNamePluralGRAFBMPTRANS ) :
659  ( IsLinkedGraphic() ? STR_ObjNamePluralGRAFBMPLNK : STR_ObjNamePluralGRAFBMP ) );
660 
661  sName.append(SvxResId(pId));
662  }
663  break;
664 
665  case GraphicType::GdiMetafile:
666  sName.append(SvxResId(IsLinkedGraphic() ? STR_ObjNamePluralGRAFMTFLNK : STR_ObjNamePluralGRAFMTF));
667  break;
668 
669  case GraphicType::NONE:
670  sName.append(SvxResId(IsLinkedGraphic() ? STR_ObjNamePluralGRAFNONELNK : STR_ObjNamePluralGRAFNONE));
671  break;
672 
673  default:
674  sName.append(SvxResId(IsLinkedGraphic() ? STR_ObjNamePluralGRAFLNK : STR_ObjNamePluralGRAF));
675  break;
676  }
677  }
678 
679  const OUString aName(GetName());
680 
681  if (!aName.isEmpty())
682  {
683  sName.append(" '");
684  sName.append(aName);
685  sName.append('\'');
686  }
687 
688  return sName.makeStringAndClear();
689 }
690 
692 {
693  // call parent
695 
696  // #i103116# the full drag clone leads to problems
697  // with linked graphics, so reset the link in this
698  // temporary interaction object and load graphic
699  if(pRetval && IsLinkedGraphic())
700  {
701  static_cast< SdrGrafObj* >(pRetval.get())->ReleaseGraphicLink();
702  }
703 
704  return pRetval;
705 }
706 
708 {
709  return CloneHelper< SdrGrafObj >(rTargetModel);
710 }
711 
713 {
714  if( this == &rObj )
715  return *this;
716  SdrRectObj::operator=( rObj );
717 
718  aFileName = rObj.aFileName;
719  aFilterName = rObj.aFilterName;
720  bMirrored = rObj.bMirrored;
721 
730  mbSignatureLineIsSigned = false;
732 
733  if(rObj.mpQrCode)
734  {
735  mpQrCode = std::make_unique<css::drawing::QRCode>(*rObj.mpQrCode);
736  }
737  else
738  {
739  mpQrCode.reset();
740  }
741 
744  else
745  mpGraphicObject->SetGraphic( rObj.GetGraphic(), &rObj.GetGraphicObject() );
746 
747  if( rObj.IsLinkedGraphic() )
748  {
750  }
751 
753  return *this;
754 }
755 
756 sal_uInt32 SdrGrafObj::GetHdlCount() const
757 {
758  return 8;
759 }
760 
762 {
763  SdrHdlList tempList(nullptr);
764  SdrRectObj::AddToHdlList( tempList );
765  tempList.RemoveHdl(0);
766  tempList.MoveTo(rHdlList);
767 }
768 
769 void SdrGrafObj::NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact)
770 {
771  SdrRectObj::NbcResize( rRef, xFact, yFact );
772 
773  bool bMirrX = xFact.GetNumerator() < 0;
774  bool bMirrY = yFact.GetNumerator() < 0;
775 
776  if( bMirrX != bMirrY )
777  bMirrored = !bMirrored;
778 }
779 
780 void SdrGrafObj::NbcMirror(const Point& rRef1, const Point& rRef2)
781 {
782  SdrRectObj::NbcMirror(rRef1,rRef2);
783  bMirrored = !bMirrored;
784 }
785 
787 {
788  return new SdrGrafObjGeoData;
789 }
790 
792 {
794  SdrGrafObjGeoData& rGGeo=static_cast<SdrGrafObjGeoData&>(rGeo);
795  rGGeo.bMirrored=bMirrored;
796 }
797 
799 {
801  const SdrGrafObjGeoData& rGGeo=static_cast<const SdrGrafObjGeoData&>(rGeo);
802  bMirrored=rGGeo.bMirrored;
803 }
804 
805 void SdrGrafObj::handlePageChange(SdrPage* pOldPage, SdrPage* pNewPage)
806 {
807  const bool bRemove(pNewPage == nullptr && pOldPage != nullptr);
808  const bool bInsert(pNewPage != nullptr && pOldPage == nullptr);
809 
810  if( bRemove )
811  {
812  // No SwapIn necessary here, because if something's not loaded, it can't be animated either.
813  if( mpGraphicObject->IsAnimated())
814  mpGraphicObject->StopAnimation();
815 
816  if( pGraphicLink != nullptr )
818  }
819 
820  // call parent
821  SdrRectObj::handlePageChange(pOldPage, pNewPage);
822 
823  if (!aFileName.isEmpty() && bInsert)
824  {
825  ImpRegisterLink();
826  }
827 }
828 
830 {
832 }
833 
835 {
836  return( mpGraphicObject->GetType() == GraphicType::GdiMetafile );
837 }
838 
840 {
841  return GraphicType::Bitmap == GetGraphicType() && GetGraphic().getVectorGraphicData();
842 }
843 
845 {
846  GDIMetaFile aRetval;
847 
849  {
851  const tools::Rectangle aBoundRect(GetCurrentBoundRect());
852  const MapMode aMap(
853  getSdrModelFromSdrObject().GetScaleUnit(),
854  Point(),
855  getSdrModelFromSdrObject().GetScaleFraction(),
856  getSdrModelFromSdrObject().GetScaleFraction());
857 
858  pOut->EnableOutput(false);
859  pOut->SetMapMode(aMap);
860  aRetval.Record(pOut);
861  SingleObjectPainter(*pOut);
862  aRetval.Stop();
863  aRetval.WindStart();
864  aRetval.Move(-aBoundRect.Left(), -aBoundRect.Top());
865  aRetval.SetPrefMapMode(aMap);
866  aRetval.SetPrefSize(aBoundRect.GetSize());
867  }
868 
869  return aRetval;
870 }
871 
873 {
875  {
876  // Embedded Vector Graphic Data
877  // There is currently no helper to create SdrObjects from primitives (even if I'm thinking
878  // about writing one for some time). To get the roundtrip to SdrObjects it is necessary to
879  // use the old converter path over the MetaFile mechanism. Create Metafile from Svg
880  // primitives here pretty directly
881  rGraphicType = GraphicType::GdiMetafile;
883  }
884  else if (GraphicType::GdiMetafile == rGraphicType)
885  {
887  }
888  return GDIMetaFile();
889 }
890 
891 SdrObjectUniquePtr SdrGrafObj::DoConvertToPolyObj(bool bBezier, bool bAddText ) const
892 {
893  SdrObject* pRetval = nullptr;
894  GraphicType aGraphicType(GetGraphicType());
895  GDIMetaFile aMtf(GetMetaFile(aGraphicType));
896  switch(aGraphicType)
897  {
898  case GraphicType::GdiMetafile:
899  {
900  // Sort into group and return ONLY those objects that can be created from the MetaFile.
901  ImpSdrGDIMetaFileImport aFilter(
903  GetLayer(),
904  maRect);
906 
907  if(aFilter.DoImport(aMtf, *pGrp->GetSubList(), 0))
908  {
909  {
910  // copy transformation
911  GeoStat aGeoStat(GetGeoStat());
912 
913  if(aGeoStat.nShearAngle)
914  {
915  aGeoStat.RecalcTan();
916  pGrp->NbcShear(maRect.TopLeft(), aGeoStat.nShearAngle, aGeoStat.nTan, false);
917  }
918 
919  if(aGeoStat.nRotationAngle)
920  {
921  aGeoStat.RecalcSinCos();
922  pGrp->NbcRotate(maRect.TopLeft(), aGeoStat.nRotationAngle, aGeoStat.nSin, aGeoStat.nCos);
923  }
924  }
925 
926  pRetval = pGrp;
927  pGrp->NbcSetLayer(GetLayer());
928 
929  if(bAddText)
930  {
931  pRetval = ImpConvertAddText(SdrObjectUniquePtr(pRetval), bBezier).release();
932  }
933 
934  // convert all children
935  if( pRetval )
936  {
937  SdrObject* pHalfDone = pRetval;
938  pRetval = pRetval->DoConvertToPolyObj(bBezier, bAddText).release();
939  SdrObject::Free( pHalfDone ); // resulting object is newly created
940 
941  if( pRetval )
942  {
943  // flatten subgroups. As we call
944  // DoConvertToPolyObj() on the resulting group
945  // objects, subgroups can exist (e.g. text is
946  // a group object for every line).
947  SdrObjList* pList = pRetval->GetSubList();
948  if( pList )
949  pList->FlattenGroups();
950  }
951  }
952  }
953  else
954  {
955  // always use SdrObject::Free(...) for SdrObjects (!)
956  SdrObject* pTemp(pGrp);
957  SdrObject::Free(pTemp);
958  }
959 
960  // #i118485# convert line and fill
961  SdrObjectUniquePtr pLineFill = SdrRectObj::DoConvertToPolyObj(bBezier, false);
962 
963  if(pLineFill)
964  {
965  if(pRetval)
966  {
967  pGrp = dynamic_cast< SdrObjGroup* >(pRetval);
968 
969  if(!pGrp)
970  {
972  pGrp->NbcSetLayer(GetLayer());
973  pGrp->GetSubList()->NbcInsertObject(pRetval);
974  }
975 
976  pGrp->GetSubList()->NbcInsertObject(pLineFill.release(), 0);
977  }
978  else
979  {
980  pRetval = pLineFill.release();
981  }
982  }
983 
984  break;
985  }
986  case GraphicType::Bitmap:
987  {
988  // create basic object and add fill
989  pRetval = SdrRectObj::DoConvertToPolyObj(bBezier, bAddText).release();
990 
991  // save bitmap as an attribute
992  if(pRetval)
993  {
994  // retrieve bitmap for the fill
996 
997  aSet.Put(XFillStyleItem(drawing::FillStyle_BITMAP));
998  const BitmapEx aBitmapEx(GetTransformedGraphic().GetBitmapEx());
999  aSet.Put(XFillBitmapItem(OUString(), Graphic(aBitmapEx)));
1000  aSet.Put(XFillBmpTileItem(false));
1001 
1002  pRetval->SetMergedItemSet(aSet);
1003  }
1004  break;
1005  }
1006  case GraphicType::NONE:
1007  case GraphicType::Default:
1008  {
1009  pRetval = SdrRectObj::DoConvertToPolyObj(bBezier, bAddText).release();
1010  break;
1011  }
1012  }
1013 
1014  return SdrObjectUniquePtr(pRetval);
1015 }
1016 
1017 void SdrGrafObj::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
1018 {
1019  SetXPolyDirty();
1020  SdrRectObj::Notify( rBC, rHint );
1022 }
1023 
1024 
1025 void SdrGrafObj::SetMirrored( bool _bMirrored )
1026 {
1027  bMirrored = _bMirrored;
1028 }
1029 
1031 {
1032  const SfxItemSet& rSet = GetObjectItemSet();
1033  const sal_uInt16 nTrans = rSet.Get( SDRATTR_GRAFTRANSPARENCE ).GetValue();
1034  const SdrGrafCropItem& rCrop = rSet.Get( SDRATTR_GRAFCROP );
1035 
1036  aGrafInfo.SetLuminance( rSet.Get( SDRATTR_GRAFLUMINANCE ).GetValue() );
1037  aGrafInfo.SetContrast( rSet.Get( SDRATTR_GRAFCONTRAST ).GetValue() );
1038  aGrafInfo.SetChannelR( rSet.Get( SDRATTR_GRAFRED ).GetValue() );
1039  aGrafInfo.SetChannelG( rSet.Get( SDRATTR_GRAFGREEN ).GetValue() );
1040  aGrafInfo.SetChannelB( rSet.Get( SDRATTR_GRAFBLUE ).GetValue() );
1041  aGrafInfo.SetGamma( rSet.Get( SDRATTR_GRAFGAMMA ).GetValue() * 0.01 );
1042  aGrafInfo.SetTransparency( static_cast<sal_uInt8>(FRound( std::min( nTrans, sal_uInt16(100) ) * 2.55 )) );
1043  aGrafInfo.SetInvert( rSet.Get( SDRATTR_GRAFINVERT ).GetValue() );
1044  aGrafInfo.SetDrawMode( rSet.Get( SDRATTR_GRAFMODE ).GetValue() );
1045  aGrafInfo.SetCrop( rCrop.GetLeft(), rCrop.GetTop(), rCrop.GetRight(), rCrop.GetBottom() );
1046 
1047  SetXPolyDirty();
1048  SetRectsDirty();
1049 }
1050 
1051 void SdrGrafObj::AdjustToMaxRect( const tools::Rectangle& rMaxRect, bool bShrinkOnly )
1052 {
1053  Size aSize;
1054  Size aMaxSize( rMaxRect.GetSize() );
1055  if (mpGraphicObject->GetPrefMapMode().GetMapUnit() == MapUnit::MapPixel)
1056  aSize = Application::GetDefaultDevice()->PixelToLogic(mpGraphicObject->GetPrefSize(), MapMode(MapUnit::Map100thMM));
1057  else
1058  aSize = OutputDevice::LogicToLogic( mpGraphicObject->GetPrefSize(),
1059  mpGraphicObject->GetPrefMapMode(),
1060  MapMode( MapUnit::Map100thMM ) );
1061 
1062  if( !aSize.IsEmpty() )
1063  {
1064  Point aPos( rMaxRect.TopLeft() );
1065 
1066  // if the graphic is too large, fit it to page
1067  if ( (!bShrinkOnly ||
1068  ( aSize.Height() > aMaxSize.Height() ) ||
1069  ( aSize.Width() > aMaxSize.Width() ) )&&
1070  aSize.Height() && aMaxSize.Height() )
1071  {
1072  float fGrfWH = static_cast<float>(aSize.Width()) /
1073  static_cast<float>(aSize.Height());
1074  float fWinWH = static_cast<float>(aMaxSize.Width()) /
1075  static_cast<float>(aMaxSize.Height());
1076 
1077  // Scale graphic to page size
1078  if ( fGrfWH < fWinWH )
1079  {
1080  aSize.setWidth( static_cast<long>(aMaxSize.Height() * fGrfWH) );
1081  aSize.setHeight( aMaxSize.Height() );
1082  }
1083  else if ( fGrfWH > 0.F )
1084  {
1085  aSize.setWidth( aMaxSize.Width() );
1086  aSize.setHeight( static_cast<long>(aMaxSize.Width() / fGrfWH) );
1087  }
1088 
1089  aPos = rMaxRect.Center();
1090  }
1091 
1092  if( bShrinkOnly )
1093  aPos = maRect.TopLeft();
1094 
1095  aPos.AdjustX( -(aSize.Width() / 2) );
1096  aPos.AdjustY( -(aSize.Height() / 2) );
1097  SetLogicRect( tools::Rectangle( aPos, aSize ) );
1098  }
1099 }
1100 
1102 {
1103  if(mbGrafAnimationAllowed != bNew)
1104  {
1105  mbGrafAnimationAllowed = bNew;
1106  ActionChanged();
1107  }
1108 }
1109 
1111 {
1113 
1114  if (mpGraphicObject && GetGraphic().IsGfxLink())
1115  {
1116  Graphic aGraphic( GetGraphic() );
1117  GfxLink aLink( aGraphic.GetGfxLink() );
1118  sal_uInt32 nSize = aLink.GetDataSize();
1119  const void* pSourceData = static_cast<const void*>(aLink.GetData());
1120  if( nSize && pSourceData )
1121  {
1122  sal_uInt8 * pBuffer = new sal_uInt8[ nSize ];
1123  memcpy( pBuffer, pSourceData, nSize );
1124 
1125  SvMemoryStream* pStream = new SvMemoryStream( static_cast<void*>(pBuffer), static_cast<std::size_t>(nSize), StreamMode::READ );
1126  pStream->ObjectOwnsMemory( true );
1127  xStream.set( new utl::OInputStreamWrapper( pStream, true ) );
1128  }
1129  }
1130 
1131  if (!xStream.is() && !aFileName.isEmpty())
1132  {
1133  SvFileStream* pStream = new SvFileStream( aFileName, StreamMode::READ );
1134  xStream.set( new utl::OInputStreamWrapper( pStream ) );
1135  }
1136 
1137  return xStream;
1138 }
1139 
1140 // moved crop handle creation here; this is the object type using them
1142 {
1143  basegfx::B2DHomMatrix aMatrix;
1144  basegfx::B2DPolyPolygon aPolyPolygon;
1145 
1146  // get object transformation
1147  TRGetBaseGeometry(aMatrix, aPolyPolygon);
1148 
1149  // part of object transformation correction, but used later, so defined outside next scope
1150  double fShearX(0.0), fRotate(0.0);
1151 
1152  { // TTTT correct shear, it comes currently mirrored from TRGetBaseGeometry, can be removed with aw080
1153  basegfx::B2DTuple aScale;
1154  basegfx::B2DTuple aTranslate;
1155 
1156  aMatrix.decompose(aScale, aTranslate, fRotate, fShearX);
1157 
1158  if(!basegfx::fTools::equalZero(fShearX))
1159  {
1160  // shearX is used, correct it
1161  fShearX = -fShearX;
1162  }
1163 
1165  aScale,
1166  fShearX,
1167  fRotate,
1168  aTranslate);
1169  }
1170 
1171  // get crop values
1172  const SdrGrafCropItem& rCrop = GetMergedItem(SDRATTR_GRAFCROP);
1173 
1174  if(rCrop.GetLeft() || rCrop.GetTop() || rCrop.GetRight() ||rCrop.GetBottom())
1175  {
1176  // decompose object transformation to have current translate and scale
1177  basegfx::B2DVector aScale, aTranslate;
1178  double fLclRotate, fLclShearX;
1179 
1180  aMatrix.decompose(aScale, aTranslate, fLclRotate, fLclShearX);
1181 
1182  if(!aScale.equalZero())
1183  {
1184  // get crop scale
1185  const basegfx::B2DVector aCropScaleFactor(
1186  GetGraphicObject().calculateCropScaling(
1187  aScale.getX(),
1188  aScale.getY(),
1189  rCrop.GetLeft(),
1190  rCrop.GetTop(),
1191  rCrop.GetRight(),
1192  rCrop.GetBottom()));
1193 
1194  // apply crop scale
1195  const double fCropLeft(rCrop.GetLeft() * aCropScaleFactor.getX());
1196  const double fCropTop(rCrop.GetTop() * aCropScaleFactor.getY());
1197  const double fCropRight(rCrop.GetRight() * aCropScaleFactor.getX());
1198  const double fCropBottom(rCrop.GetBottom() * aCropScaleFactor.getY());
1199  basegfx::B2DHomMatrix aMatrixForCropViewHdl(aMatrix);
1200 
1201  if(IsMirrored())
1202  {
1203  // create corrected new matrix, TTTT can be removed with aw080
1204  // the old mirror only can mirror horizontally; the vertical mirror
1205  // is faked by using the horizontal and 180 degree rotation. Since
1206  // the object can be rotated differently from 180 degree, this is
1207  // not safe to detect. Just correct horizontal mirror (which is
1208  // in IsMirrored()) and keep the rotation angle
1209  // caution: Do not modify aMatrix, it is used below to calculate
1210  // the exact handle positions
1211  basegfx::B2DHomMatrix aPreMultiply;
1212 
1213  // mirrored X, apply
1214  aPreMultiply.translate(-0.5, 0.0);
1215  aPreMultiply.scale(-1.0, 1.0);
1216  aPreMultiply.translate(0.5, 0.0);
1217 
1218  aMatrixForCropViewHdl = aMatrixForCropViewHdl * aPreMultiply;
1219  }
1220 
1221  rTarget.AddHdl(
1222  std::make_unique<SdrCropViewHdl>(
1223  aMatrixForCropViewHdl,
1225  fCropLeft,
1226  fCropTop,
1227  fCropRight,
1228  fCropBottom));
1229  }
1230  }
1231 
1232  basegfx::B2DPoint aPos;
1233 
1234  aPos = aMatrix * basegfx::B2DPoint(0.0, 0.0);
1235  rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), SdrHdlKind::UpperLeft, fShearX, fRotate));
1236  aPos = aMatrix * basegfx::B2DPoint(0.5, 0.0);
1237  rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), SdrHdlKind::Upper, fShearX, fRotate));
1238  aPos = aMatrix * basegfx::B2DPoint(1.0, 0.0);
1239  rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), SdrHdlKind::UpperRight, fShearX, fRotate));
1240  aPos = aMatrix * basegfx::B2DPoint(0.0, 0.5);
1241  rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), SdrHdlKind::Left , fShearX, fRotate));
1242  aPos = aMatrix * basegfx::B2DPoint(1.0, 0.5);
1243  rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), SdrHdlKind::Right, fShearX, fRotate));
1244  aPos = aMatrix * basegfx::B2DPoint(0.0, 1.0);
1245  rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), SdrHdlKind::LowerLeft, fShearX, fRotate));
1246  aPos = aMatrix * basegfx::B2DPoint(0.5, 1.0);
1247  rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), SdrHdlKind::Lower, fShearX, fRotate));
1248  aPos = aMatrix * basegfx::B2DPoint(1.0, 1.0);
1249  rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), SdrHdlKind::LowerRight, fShearX, fRotate));
1250 }
1251 
1252 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void RestGeoData(const SdrObjGeoData &rGeo) override
Definition: svdograf.cxx:798
std::unique_ptr< SdrHdl > RemoveHdl(size_t nNum)
Definition: svdhdl.cxx:2234
Point TopLeft() const
virtual void AdjustToMaxRect(const tools::Rectangle &rMaxRect, bool bShrinkOnly=false) override
Definition: svdograf.cxx:1051
long Width() const
bool IsEPS() const
Definition: svdograf.cxx:396
void SetTransparency(sal_uInt8 cTransparency)
OUString aFilterName
Definition: svdograf.hxx:98
virtual SdrObjectUniquePtr DoConvertToPolyObj(bool bBezier, bool bAddText) const override
Definition: svdograf.cxx:891
void SetGamma(double fGamma)
OutlineText, special text object for StarDraw.
Definition: svdobj.hxx:136
bool mbIsSignatureLineCanAddComment
Definition: svdograf.hxx:114
constexpr TypedWhichId< SdrGrafGamma100Item > SDRATTR_GRAFGAMMA(SDRATTR_GRAF_FIRST+5)
GDIMetaFile getMetafileFromEmbeddedVectorGraphicData() const
Definition: svdograf.cxx:844
OUString maSignatureLineId
Definition: svdograf.hxx:108
virtual void addCropHandles(SdrHdlList &rTarget) const override
Definition: svdograf.cxx:1141
bool bEmptyPresObj
Definition: svdobj.hxx:938
void NbcSetGraphic(const Graphic &rGrf)
Definition: svdograf.cxx:302
virtual const tools::Rectangle & GetCurrentBoundRect() const
Definition: svdobj.cxx:854
void ImpRegisterLink()
Definition: svdograf.cxx:462
long FRound(double fVal)
virtual void NbcMirror(const Point &rRef1, const Point &rRef2) override
Definition: svdorect.cxx:485
friend class SdrGraphicLink
Definition: svdograf.hxx:88
Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
long Height() const
virtual void NbcResize(const Point &rRef, const Fraction &xFact, const Fraction &yFact) override
Definition: svdograf.cxx:769
double nSin
Definition: svdtrans.hxx:219
GeoStat aGeo
Definition: svdotext.hxx:185
GDIMetaFile GetMetaFile(GraphicType &rGraphicType) const
Definition: svdograf.cxx:872
void SetMirrored(bool _bMirrored)
Definition: svdograf.cxx:1025
void SetInvert(bool bInvert)
virtual void NbcInsertObject(SdrObject *pObj, size_t nPos=SAL_MAX_SIZE)
Definition: svdpage.cxx:292
long GetRightCrop() const
virtual void NbcSetLayer(SdrLayerID nLayer) override
Definition: svdogrp.cxx:150
virtual SdrObjectUniquePtr DoConvertToPolyObj(bool bBezier, bool bAddText) const
Definition: svdobj.cxx:2530
long nRotationAngle
Definition: svdtrans.hxx:216
double getX() const
GraphicType
void SetPrefSize(const Size &rSize)
Size getOriginalSize() const
Definition: svdograf.cxx:428
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:96
virtual void AddToHdlList(SdrHdlList &rHdlList) const override
Definition: svdograf.cxx:761
virtual void handlePageChange(SdrPage *pOldPage, SdrPage *pNewPage) override
Definition: svdograf.cxx:805
const GraphicObject & GetGraphicObject(bool bForceSwapIn=false) const
Definition: svdograf.cxx:275
std::unique_ptr< GraphicObject > mpGraphicObject
Definition: svdograf.hxx:99
static void Free(SdrObject *&_rpObject)
Definition: svdobj.cxx:396
long GetTopCrop() const
OUString maSignatureLineSuggestedSignerEmail
Definition: svdograf.hxx:111
void RecalcTan()
Definition: svdtrans.cxx:463
virtual SdrObjectUniquePtr getFullDragClone() const override
Definition: svdotext.cxx:2025
GraphicType GetGraphicType() const
Definition: svdograf.cxx:351
All geometrical data of an arbitrary object for use in undo/redo.
Definition: svdobj.hxx:226
void SetDrawMode(GraphicDrawMode eDrawMode)
virtual SdrObjList * GetSubList() const
Definition: svdobj.cxx:647
Graphic GetTransformedGraphic(const Size &rDestSize, const MapMode &rDestMap, const GraphicAttr &rAttr) const
Size GetGrafPrefSize() const
Definition: svdograf.cxx:406
virtual SdrObjectUniquePtr getFullDragClone() const override
Definition: svdograf.cxx:691
void ImpSetLinkedGraphic(const Graphic &rGraphic)
Definition: svdograf.cxx:542
Rectangle objects (rectangle, circle, ...)
Definition: svdorect.hxx:39
static OutputDevice * GetDefaultDevice()
HashMap_OWString_Interface aMap
Provides information about various ZObject properties.
Definition: svdobj.hxx:248
void ImpDeregisterLink()
Definition: svdograf.cxx:478
MapUnit GetScaleUnit() const
Definition: svdmodel.hxx:367
void Record(OutputDevice *pOutDev)
Reference< XInputStream > xStream
OUString SvxResId(const char *pId)
Definition: dialmgr.cxx:28
virtual void SaveGeoData(SdrObjGeoData &rGeo) const override
Definition: svdotext.cxx:1432
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:453
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:1017
const SfxItemSet & GetObjectItemSet() const
Definition: svdobj.cxx:1884
oslFileHandle & pOut
virtual OUString TakeObjNameSingul() const override
Definition: svdograf.cxx:551
tools::Rectangle maRect
Definition: svdotext.hxx:182
const GDIMetaFile & GetGDIMetaFile() const
void SetMergedItemSet(const SfxItemSet &rSet, bool bClearAllItems=false)
Definition: svdobj.cxx:1914
bool bNoShear
Definition: svdotext.hxx:232
void SetGrafStreamURL(const OUString &rGraphicStreamURL)
Definition: svdograf.cxx:411
long Top() const
SotClipboardFormatId
const GeoStat & GetGeoStat() const
Definition: svdotext.hxx:399
bool mbSignatureLineIsSigned
Definition: svdograf.hxx:115
virtual void SetChanged(bool bFlg=true)
Definition: svdmodel.cxx:1261
B2IRange fround(const B2DRange &rRange)
OUString maSignatureLineSigningInstructions
Definition: svdograf.hxx:112
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:1919
virtual void SaveGeoData(SdrObjGeoData &rGeo) const override
Definition: svdograf.cxx:791
constexpr TypedWhichId< SdrGrafTransparenceItem > SDRATTR_GRAFTRANSPARENCE(SDRATTR_GRAF_FIRST+6)
long GetLeftCrop() const
bool IsAnimated() const
Definition: svdograf.cxx:391
virtual void handlePageChange(SdrPage *pOldPage, SdrPage *pNewPage) override
Definition: svdotext.cxx:442
virtual void NbcShear(const Point &rRef, long nAngle, double tn, bool bVShear) override
Definition: svdogrp.cxx:452
Graphic GetTransformedGraphic(SdrGrafObjTransformsAttrs nTransformFlags=SdrGrafObjTransformsAttrs::ALL) const
Definition: svdograf.cxx:335
bool mbSupportTextIndentingOnLineWidthChange
Definition: svdobj.hxx:949
OUString maSignatureLineSuggestedSignerName
Definition: svdograf.hxx:109
double nCos
Definition: svdtrans.hxx:220
bool IsCropped() const
bool IsEmpty() const
css::uno::Reference< css::graphic::XGraphic > mpSignatureLineUnsignedGraphic
Definition: svdograf.hxx:116
constexpr TypedWhichId< SdrGrafLuminanceItem > SDRATTR_GRAFLUMINANCE(SDRATTR_GRAF_FIRST+3)
void MoveTo(SdrHdlList &rOther)
Definition: svdhdl.cxx:2328
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
void SetCrop(long nLeft_100TH_MM, long nTop_100TH_MM, long nRight_100TH_MM, long nBottom_100TH_MM)
const GraphicObject * GetReplacementGraphicObject() const
Definition: svdograf.cxx:282
const Graphic & GetGraphic() const
Definition: svdograf.cxx:330
void SetGraphicLink(const OUString &rFileName, const OUString &rReferer, const OUString &rFilterName)
Definition: svdograf.cxx:490
void BroadcastObjectChange() const
Definition: svdobj.cxx:905
constexpr TypedWhichId< SdrGrafBlueItem > SDRATTR_GRAFBLUE(SDRATTR_GRAF_FIRST+2)
const primitive2d::ObjectInfoPrimitive2D * getResult() const
bool mbIsSignatureLine
Definition: svdograf.hxx:107
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
virtual ~SdrGrafObj() override
Definition: svdograf.cxx:260
SdrGraphicLink * pGraphicLink
Definition: svdograf.hxx:101
virtual void NbcRotate(const Point &rRef, long nAngle, double sn, double cs) override
Definition: svdogrp.cxx:418
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:1631
virtual SdrObjList * GetSubList() const override
Definition: svdogrp.cxx:170
OUString getOriginURL() const
MapUnit GetMapUnit() const
virtual void TakeObjInfo(SdrObjTransformInfoRec &rInfo) const override
Definition: svdograf.cxx:510
const SfxPoolItem & GetMergedItem(const sal_uInt16 nWhich) const
Definition: svdobj.cxx:1924
void SetChannelR(short nChannelRPercent)
void WindStart()
This class represents an embedded or linked bitmap graphic object.
Definition: svdograf.hxx:79
GfxLink GetGfxLink() const
SdrGrafObjTransformsAttrs
Options for GetTransformedGraphic()
Definition: svdograf.hxx:50
Abstract DrawObject.
Definition: svdobj.hxx:312
constexpr TypedWhichId< SdrGrafCropItem > SDRATTR_GRAFCROP(SDRATTR_GRAF_FIRST+9)
void SetGrafAnimationAllowed(bool bNew)
Definition: svdograf.cxx:1101
OUString GetName() const
Definition: svdobj.cxx:698
Size GetSize() const
long nShearAngle
Definition: svdtrans.hxx:217
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:1110
bool IsLinkedGraphic() const
Definition: svdograf.cxx:505
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:118
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:621
static SotClipboardFormatId GetFormatIdFromMimeType(const OUString &rMimeType)
void SetLuminance(short nLuminancePercent)
void Move(long nX, long nY)
OUString aName
std::unique_ptr< GraphicObject > mpReplacementGraphicObject
Definition: svdograf.hxx:100
void ObjectOwnsMemory(bool bOwn)
bool HasGDIMetaFile() const
Definition: svdograf.cxx:834
virtual SdrGrafObj * CloneSdrObject(SdrModel &rTargetModel) const override
Definition: svdograf.cxx:707
void SetDescription(const OUString &rStr)
Definition: svdobj.cxx:752
SdrGrafObj(SdrModel &rSdrModel)
Definition: svdograf.cxx:183
OUString aReferer
Definition: svdograf.hxx:97
bool bMirrored
Definition: svdograf.hxx:102
sal_Int32 GetNumerator() const
std::unique_ptr< SdrObject, SdrObjectFreeOp > SdrObjectUniquePtr
Definition: svdobj.hxx:114
void ReleaseGraphicLink()
Definition: svdograf.cxx:497
long Left() const
void translate(double fX, double fY)
long GetBottomCrop() const
virtual void NbcMirror(const Point &rRef1, const Point &rRef2) override
Definition: svdograf.cxx:780
GraphicAttr aGrafInfo
Definition: svdograf.hxx:94
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:786
bool IsMirrored() const
Definition: svdograf.hxx:208
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:1577
bool LineGeometryUsageIsNecessary() const
Definition: svdobj.cxx:962
bool mbGrafAnimationAllowed
Definition: svdograf.hxx:105
SdrGrafObj & operator=(const SdrGrafObj &rObj)
Definition: svdograf.cxx:712
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:1030
long getHeight() const
static SotClipboardFormatId RegisterStatusInfoId()
const std::shared_ptr< VectorGraphicData > & getVectorGraphicData() const
GraphicAttr GetGraphicAttr(SdrGrafObjTransformsAttrs nTransformFlags=SdrGrafObjTransformsAttrs::ALL) const
Definition: svdograf.cxx:356
virtual void SetChanged()
Definition: svdobj.cxx:929
long getWidth() const
void SetName(const OUString &rStr)
Definition: svdobj.cxx:664
void setWidth(long nWidth)
virtual sal_uInt16 GetObjIdentifier() const override
Definition: svdograf.cxx:537
bool isEmbeddedVectorGraphicData() const
Definition: svdograf.cxx:839
void SetTitle(const OUString &rStr)
Definition: svdobj.cxx:708
bool mbLineIsOutsideGeometry
Definition: svdobj.hxx:947
void SetRotation(sal_uInt16 nRotate10)
OUString const & GetGrafStreamURL() const
Definition: svdograf.cxx:423
OUString maSignatureLineSuggestedSignerTitle
Definition: svdograf.hxx:110
SfxLinkUpdateMode
MapMode GetGrafPrefMapMode() const
Definition: svdograf.cxx:401
Point Center() const
bool mbIsSignatureLineShowSignDate
Definition: svdograf.hxx:113
void AddHdl(std::unique_ptr< SdrHdl > pHdl)
Definition: svdhdl.cxx:2294
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:756
void SetPrefMapMode(const MapMode &rMapMode)
void StartAnimation()
Definition: svdograf.cxx:829
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
void setHeight(long nHeight)