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