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