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(getSdrModelFromSdrObject().GetScaleUnit());
391 const Size aDestSize( GetLogicRect().GetSize() );
392 GraphicAttr aActAttr = GetGraphicAttr(nTransformFlags);
393
394 // Delegate to moved code in GraphicObject
395 return GetGraphicObject().GetTransformedGraphic( aDestSize, aDestMap, aActAttr );
396}
397
399{
400 return mpGraphicObject->GetType();
401}
402
404{
405 GraphicAttr aActAttr;
406
408 if( SdrGrafObjTransformsAttrs::NONE != nTransformFlags &&
409 GraphicType::NONE != eType )
410 {
411 const bool bMirror = bool( nTransformFlags & SdrGrafObjTransformsAttrs::MIRROR );
412 const bool bRotate = bool( nTransformFlags & SdrGrafObjTransformsAttrs::ROTATE ) &&
413 (maGeo.m_nRotationAngle && maGeo.m_nRotationAngle != 18000_deg100);
414
415 // Need cropping info earlier
416 const_cast<SdrGrafObj*>(this)->ImpSetAttrToGrafInfo();
417
418 // Actually transform the graphic only in this case.
419 // Cropping always happens, though.
420 aActAttr = aGrafInfo;
421
422 if( bMirror )
423 {
424 sal_uInt16 nMirrorCase = ( maGeo.m_nRotationAngle == 18000_deg100 ) ? ( bMirrored ? 3 : 4 ) : ( bMirrored ? 2 : 1 );
425 bool bHMirr = nMirrorCase == 2 || nMirrorCase == 4;
426 bool bVMirr = nMirrorCase == 3 || nMirrorCase == 4;
427
428 aActAttr.SetMirrorFlags( ( bHMirr ? BmpMirrorFlags::Horizontal : BmpMirrorFlags::NONE ) | ( bVMirr ? BmpMirrorFlags::Vertical : BmpMirrorFlags::NONE ) );
429 }
430
431 if( bRotate )
432 aActAttr.SetRotation( to<Degree10>(maGeo.m_nRotationAngle ) );
433 }
434
435 return aActAttr;
436}
437
439{
440 return mpGraphicObject->IsAnimated();
441}
442
444{
445 return mpGraphicObject->IsEPS();
446}
447
449{
450 return mpGraphicObject->GetPrefMapMode();
451}
452
454{
455 return mpGraphicObject->GetPrefSize();
456}
457
458void SdrGrafObj::SetGrafStreamURL( const OUString& rGraphicStreamURL )
459{
460 if( rGraphicStreamURL.isEmpty() )
461 {
462 mpGraphicObject->SetUserData();
463 }
464 else if(getSdrModelFromSdrObject().IsSwapGraphics() )
465 {
466 mpGraphicObject->SetUserData( rGraphicStreamURL );
467 }
468}
469
470OUString const & SdrGrafObj::GetGrafStreamURL() const
471{
472 return mpGraphicObject->GetUserData();
473}
474
476{
477 Size aSize = GetGrafPrefSize();
478
479 if (GetGrafPrefMapMode().GetMapUnit() == MapUnit::MapPixel)
481 else
483
484 if (aGrafInfo.IsCropped())
485 {
486 const tools::Long aCroppedWidth(aSize.getWidth() - aGrafInfo.GetLeftCrop()
488 const tools::Long aCroppedHeight(aSize.getHeight() - aGrafInfo.GetTopCrop()
490
491 aSize = Size(aCroppedWidth, aCroppedHeight);
492 }
493
494 return aSize;
495}
496
497// TODO Remove
499{
500 if (pGraphicLink && (mpGraphicObject->GetType() == GraphicType::NONE ||
501 mpGraphicObject->GetType() == GraphicType::Default) )
502 {
504 }
505}
506
508{
509 sfx2::LinkManager* pLinkManager(getSdrModelFromSdrObject().GetLinkManager());
510
511 if( pLinkManager != nullptr && pGraphicLink == nullptr )
512 {
513 if (!aFileName.isEmpty())
514 {
515 pGraphicLink = new SdrGraphicLink( *this );
516 pLinkManager->InsertFileLink(
519 }
520 }
521}
522
524{
525 sfx2::LinkManager* pLinkManager(getSdrModelFromSdrObject().GetLinkManager());
526
527 if( pLinkManager != nullptr && pGraphicLink!=nullptr)
528 {
529 // When using Remove, the *pGraphicLink is implicitly deleted
530 pLinkManager->Remove( pGraphicLink );
531 pGraphicLink=nullptr;
532 }
533}
534
535void SdrGrafObj::SetGraphicLink(const OUString& rFileName)
536{
537 Graphic aGraphic;
538 aGraphic.setOriginURL(rFileName);
539 SetGraphic(aGraphic);
540}
541
543{
545 aFileName.clear();
546 aFilterName.clear();
547
548 auto aGraphic = mpGraphicObject->GetGraphic();
549 aGraphic.setOriginURL("");
550 SetGraphic(aGraphic);
551}
552
554{
555 return !mpGraphicObject->GetGraphic().getOriginURL().isEmpty();
556}
557
559{
560 bool bNoPresGrf = ( mpGraphicObject->GetType() != GraphicType::NONE ) && !m_bEmptyPresObj;
561
562 rInfo.bResizeFreeAllowed = maGeo.m_nRotationAngle.get() % 9000 == 0 ||
563 maGeo.m_nRotationAngle.get() % 18000 == 0 ||
564 maGeo.m_nRotationAngle.get() % 27000 == 0;
565
566 rInfo.bResizePropAllowed = true;
567 rInfo.bRotateFreeAllowed = bNoPresGrf;
568 rInfo.bRotate90Allowed = bNoPresGrf;
569 rInfo.bMirrorFreeAllowed = bNoPresGrf;
570 rInfo.bMirror45Allowed = bNoPresGrf;
572 rInfo.bTransparenceAllowed = false;
573
574 // #i118485# Shear allowed and possible now
575 rInfo.bShearAllowed = true;
576
577 rInfo.bEdgeRadiusAllowed=false;
578 rInfo.bCanConvToPath = !IsEPS();
579 rInfo.bCanConvToPathLineToArea = false;
580 rInfo.bCanConvToPolyLineToArea = false;
581 rInfo.bCanConvToPoly = !IsEPS();
583}
584
586{
587 return SdrObjKind::Graphic;
588}
589
591{
592 const bool bIsChanged(getSdrModelFromSdrObject().IsChanged());
593 NbcSetGraphic( rGraphic );
597}
598
600{
601 if (!mpGraphicObject)
602 return OUString();
603
604 auto const & rVectorGraphicDataPtr = mpGraphicObject->GetGraphic().getVectorGraphicData();
605
606 OUStringBuffer sName;
607
608 if (rVectorGraphicDataPtr)
609 {
610 switch (rVectorGraphicDataPtr->getType())
611 {
612 case VectorGraphicDataType::Svg:
613 {
614 sName.append(SvxResId(STR_ObjNameSingulGRAFSVG));
615 break;
616 }
617 case VectorGraphicDataType::Wmf:
618 {
619 sName.append(SvxResId(STR_ObjNameSingulGRAFWMF));
620 break;
621 }
622 case VectorGraphicDataType::Emf:
623 {
624 sName.append(SvxResId(STR_ObjNameSingulGRAFEMF));
625 break;
626 }
627 case VectorGraphicDataType::Pdf:
628 {
629 sName.append(SvxResId(STR_ObjNameSingulGRAFPDF));
630 break;
631 }
632 } //no default, see tdf#137813
633 }
634 else
635 {
636 switch( mpGraphicObject->GetType() )
637 {
638 case GraphicType::Bitmap:
639 {
640 TranslateId pId = ( ( mpGraphicObject->IsTransparent() || GetObjectItem( SDRATTR_GRAFTRANSPARENCE ).GetValue() ) ?
641 ( IsLinkedGraphic() ? STR_ObjNameSingulGRAFBMPTRANSLNK : STR_ObjNameSingulGRAFBMPTRANS ) :
642 ( IsLinkedGraphic() ? STR_ObjNameSingulGRAFBMPLNK : STR_ObjNameSingulGRAFBMP ) );
643
644 sName.append(SvxResId(pId));
645 }
646 break;
647
648 case GraphicType::GdiMetafile:
649 sName.append(SvxResId(IsLinkedGraphic() ? STR_ObjNameSingulGRAFMTFLNK : STR_ObjNameSingulGRAFMTF));
650 break;
651
652 case GraphicType::NONE:
653 sName.append(SvxResId(IsLinkedGraphic() ? STR_ObjNameSingulGRAFNONELNK : STR_ObjNameSingulGRAFNONE));
654 break;
655
656 default:
657 sName.append(SvxResId(IsLinkedGraphic() ? STR_ObjNameSingulGRAFLNK : STR_ObjNameSingulGRAF));
658 break;
659 }
660 }
661
662 const OUString aName(GetName());
663
664 if (!aName.isEmpty())
665 {
666 sName.append(" '" + aName + "\'" );
667 }
668
669 return sName.makeStringAndClear();
670}
671
673{
674 if (!mpGraphicObject)
675 return OUString();
676
677 auto const & rVectorGraphicDataPtr = mpGraphicObject->GetGraphic().getVectorGraphicData();
678
679 OUStringBuffer sName;
680
681 if (rVectorGraphicDataPtr)
682 {
683 switch (rVectorGraphicDataPtr->getType())
684 {
685 case VectorGraphicDataType::Svg:
686 {
687 sName.append(SvxResId(STR_ObjNamePluralGRAFSVG));
688 break;
689 }
690 case VectorGraphicDataType::Wmf:
691 {
692 sName.append(SvxResId(STR_ObjNamePluralGRAFWMF));
693 break;
694 }
695 case VectorGraphicDataType::Emf:
696 {
697 sName.append(SvxResId(STR_ObjNamePluralGRAFEMF));
698 break;
699 }
700 case VectorGraphicDataType::Pdf:
701 {
702 sName.append(SvxResId(STR_ObjNamePluralGRAFPDF));
703 break;
704 }
705 } //no default, see tdf#137813
706 }
707 else
708 {
709 switch(mpGraphicObject->GetType())
710 {
711 case GraphicType::Bitmap:
712 {
713 TranslateId pId = ( ( mpGraphicObject->IsTransparent() || GetObjectItem( SDRATTR_GRAFTRANSPARENCE ).GetValue() ) ?
714 ( IsLinkedGraphic() ? STR_ObjNamePluralGRAFBMPTRANSLNK : STR_ObjNamePluralGRAFBMPTRANS ) :
715 ( IsLinkedGraphic() ? STR_ObjNamePluralGRAFBMPLNK : STR_ObjNamePluralGRAFBMP ) );
716
717 sName.append(SvxResId(pId));
718 }
719 break;
720
721 case GraphicType::GdiMetafile:
722 sName.append(SvxResId(IsLinkedGraphic() ? STR_ObjNamePluralGRAFMTFLNK : STR_ObjNamePluralGRAFMTF));
723 break;
724
725 case GraphicType::NONE:
726 sName.append(SvxResId(IsLinkedGraphic() ? STR_ObjNamePluralGRAFNONELNK : STR_ObjNamePluralGRAFNONE));
727 break;
728
729 default:
730 sName.append(SvxResId(IsLinkedGraphic() ? STR_ObjNamePluralGRAFLNK : STR_ObjNamePluralGRAF));
731 break;
732 }
733 }
734
735 const OUString aName(GetName());
736
737 if (!aName.isEmpty())
738 {
739 sName.append(" '" + aName + "\'");
740 }
741
742 return sName.makeStringAndClear();
743}
744
746{
747 // call parent
749
750 // #i103116# the full drag clone leads to problems
751 // with linked graphics, so reset the link in this
752 // temporary interaction object and load graphic
753 if(pRetval && IsLinkedGraphic())
754 {
755 static_cast< SdrGrafObj* >(pRetval.get())->ReleaseGraphicLink();
756 }
757
758 return pRetval;
759}
760
762{
763 return new SdrGrafObj(rTargetModel, *this);
764}
765
766sal_uInt32 SdrGrafObj::GetHdlCount() const
767{
768 return 8;
769}
770
772{
773 SdrHdlList tempList(nullptr);
774 SdrRectObj::AddToHdlList( tempList );
775 tempList.RemoveHdl(0);
776 tempList.MoveTo(rHdlList);
777}
778
779void SdrGrafObj::NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact)
780{
781 SdrRectObj::NbcResize( rRef, xFact, yFact );
782
783 bool bMirrX = xFact.GetNumerator() < 0;
784 bool bMirrY = yFact.GetNumerator() < 0;
785
786 if( bMirrX != bMirrY )
788}
789
790void SdrGrafObj::NbcMirror(const Point& rRef1, const Point& rRef2)
791{
792 SdrRectObj::NbcMirror(rRef1,rRef2);
794}
795
796std::unique_ptr<SdrObjGeoData> SdrGrafObj::NewGeoData() const
797{
798 return std::make_unique<SdrGrafObjGeoData>();
799}
800
802{
804 SdrGrafObjGeoData& rGGeo=static_cast<SdrGrafObjGeoData&>(rGeo);
805 rGGeo.bMirrored=bMirrored;
806}
807
809{
811 const SdrGrafObjGeoData& rGGeo=static_cast<const SdrGrafObjGeoData&>(rGeo);
812 bMirrored=rGGeo.bMirrored;
813}
814
816{
817 const bool bRemove(pNewPage == nullptr && pOldPage != nullptr);
818 const bool bInsert(pNewPage != nullptr && pOldPage == nullptr);
819
820 if( bRemove )
821 {
822 // No SwapIn necessary here, because if something's not loaded, it can't be animated either.
823 if( mpGraphicObject->IsAnimated())
824 mpGraphicObject->StopAnimation();
825
826 if( pGraphicLink != nullptr )
828 }
829
830 // call parent
831 SdrRectObj::handlePageChange(pOldPage, pNewPage);
832
833 if (!aFileName.isEmpty() && bInsert)
834 {
836 }
837}
838
840{
842}
843
845{
846 return( mpGraphicObject->GetType() == GraphicType::GdiMetafile );
847}
848
850{
851 return GraphicType::Bitmap == GetGraphicType() && GetGraphic().getVectorGraphicData();
852}
853
855{
856 GDIMetaFile aRetval;
857
859 {
861 const tools::Rectangle aBoundRect(GetCurrentBoundRect());
862 const MapMode aMap(getSdrModelFromSdrObject().GetScaleUnit());
863
864 pOut->EnableOutput(false);
865 pOut->SetMapMode(aMap);
866 aRetval.Record(pOut);
868 aRetval.Stop();
869 aRetval.WindStart();
870 aRetval.Move(-aBoundRect.Left(), -aBoundRect.Top());
871 aRetval.SetPrefMapMode(aMap);
872 aRetval.SetPrefSize(aBoundRect.GetSize());
873 }
874
875 return aRetval;
876}
877
879{
881 {
882 // Embedded Vector Graphic Data
883 // There is currently no helper to create SdrObjects from primitives (even if I'm thinking
884 // about writing one for some time). To get the roundtrip to SdrObjects it is necessary to
885 // use the old converter path over the MetaFile mechanism. Create Metafile from Svg
886 // primitives here pretty directly
887 rGraphicType = GraphicType::GdiMetafile;
889 }
890 else if (GraphicType::GdiMetafile == rGraphicType)
891 {
893 }
894 return GDIMetaFile();
895}
896
898{
900 GraphicType aGraphicType(GetGraphicType());
901 GDIMetaFile aMtf(GetMetaFile(aGraphicType));
902 switch(aGraphicType)
903 {
904 case GraphicType::GdiMetafile:
905 {
906 // Sort into group and return ONLY those objects that can be created from the MetaFile.
909 GetLayer(),
910 getRectangle());
912
913 if(aFilter.DoImport(aMtf, *pGrp->GetSubList(), 0))
914 {
915 {
916 // copy transformation
917 GeoStat aGeoStat(GetGeoStat());
918
919 if(aGeoStat.m_nShearAngle)
920 {
921 aGeoStat.RecalcTan();
922 pGrp->NbcShear(getRectangle().TopLeft(), aGeoStat.m_nShearAngle, aGeoStat.mfTanShearAngle, false);
923 }
924
925 if(aGeoStat.m_nRotationAngle)
926 {
927 aGeoStat.RecalcSinCos();
928 pGrp->NbcRotate(getRectangle().TopLeft(), aGeoStat.m_nRotationAngle, aGeoStat.mfSinRotationAngle, aGeoStat.mfCosRotationAngle);
929 }
930 }
931
932 pRetval = pGrp;
933 pGrp->NbcSetLayer(GetLayer());
934
935 if(bAddText)
936 {
937 pRetval = ImpConvertAddText(pRetval, bBezier);
938 }
939
940 // convert all children
941 if( pRetval )
942 {
943 pRetval = pRetval->DoConvertToPolyObj(bBezier, bAddText);
944
945 if( pRetval )
946 {
947 // flatten subgroups. As we call
948 // DoConvertToPolyObj() on the resulting group
949 // objects, subgroups can exist (e.g. text is
950 // a group object for every line).
951 SdrObjList* pList = pRetval->GetSubList();
952 if( pList )
953 pList->FlattenGroups();
954 }
955 }
956 }
957 else
958 pGrp.clear();
959
960 // #i118485# convert line and fill
962
963 if(pLineFill)
964 {
965 if(pRetval)
966 {
967 pGrp = dynamic_cast< SdrObjGroup* >(pRetval.get());
968
969 if(!pGrp)
970 {
972 pGrp->NbcSetLayer(GetLayer());
973 pGrp->GetSubList()->NbcInsertObject(pRetval.get());
974 }
975
976 pGrp->GetSubList()->NbcInsertObject(pLineFill.get(), 0);
977 }
978 else
979 {
980 pRetval = pLineFill;
981 }
982 }
983
984 break;
985 }
986 case GraphicType::Bitmap:
987 {
988 // create basic object and add fill
989 pRetval = SdrRectObj::DoConvertToPolyObj(bBezier, bAddText);
990
991 // save bitmap as an attribute
992 if(pRetval)
993 {
994 // retrieve bitmap for the fill
996
997 aSet.Put(XFillStyleItem(drawing::FillStyle_BITMAP));
998 const BitmapEx aBitmapEx(GetTransformedGraphic().GetBitmapEx());
999 aSet.Put(XFillBitmapItem(OUString(), Graphic(aBitmapEx)));
1000 aSet.Put(XFillBmpTileItem(false));
1001
1002 pRetval->SetMergedItemSet(aSet);
1003 }
1004 break;
1005 }
1006 case GraphicType::NONE:
1007 case GraphicType::Default:
1008 {
1009 pRetval = SdrRectObj::DoConvertToPolyObj(bBezier, bAddText);
1010 break;
1011 }
1012 }
1013
1014 return pRetval;
1015}
1016
1018{
1019 SetXPolyDirty();
1020 SdrRectObj::Notify( rBC, rHint );
1022}
1023
1024
1025void SdrGrafObj::SetMirrored( bool _bMirrored )
1026{
1027 bMirrored = _bMirrored;
1028}
1029
1031{
1032 const SfxItemSet& rSet = GetObjectItemSet();
1033 const sal_uInt16 nTrans = rSet.Get( SDRATTR_GRAFTRANSPARENCE ).GetValue();
1034 const SdrGrafCropItem& rCrop = rSet.Get( SDRATTR_GRAFCROP );
1035
1038 aGrafInfo.SetChannelR( rSet.Get( SDRATTR_GRAFRED ).GetValue() );
1041 aGrafInfo.SetGamma( rSet.Get( SDRATTR_GRAFGAMMA ).GetValue() * 0.01 );
1042 aGrafInfo.SetAlpha( 255 - static_cast<sal_uInt8>(FRound( std::min( nTrans, sal_uInt16(100) ) * 2.55 )) );
1045 aGrafInfo.SetCrop( rCrop.GetLeft(), rCrop.GetTop(), rCrop.GetRight(), rCrop.GetBottom() );
1046
1047 SetXPolyDirty();
1049}
1050
1051void SdrGrafObj::AdjustToMaxRect( const tools::Rectangle& rMaxRect, bool bShrinkOnly )
1052{
1053 Size aSize;
1054 Size aMaxSize( rMaxRect.GetSize() );
1055 if (mpGraphicObject->GetPrefMapMode().GetMapUnit() == MapUnit::MapPixel)
1056 aSize = Application::GetDefaultDevice()->PixelToLogic(mpGraphicObject->GetPrefSize(), MapMode(MapUnit::Map100thMM));
1057 else
1058 aSize = OutputDevice::LogicToLogic( mpGraphicObject->GetPrefSize(),
1059 mpGraphicObject->GetPrefMapMode(),
1060 MapMode( MapUnit::Map100thMM ) );
1061
1062 if( aSize.IsEmpty() )
1063 return;
1064
1065 Point aPos( rMaxRect.TopLeft() );
1066
1067 // if the graphic is too large, fit it to page
1068 if ( (!bShrinkOnly ||
1069 ( aSize.Height() > aMaxSize.Height() ) ||
1070 ( aSize.Width() > aMaxSize.Width() ) )&&
1071 aSize.Height() && aMaxSize.Height() )
1072 {
1073 float fGrfWH = static_cast<float>(aSize.Width()) /
1074 static_cast<float>(aSize.Height());
1075 float fWinWH = static_cast<float>(aMaxSize.Width()) /
1076 static_cast<float>(aMaxSize.Height());
1077
1078 // Scale graphic to page size
1079 if ( fGrfWH < fWinWH )
1080 {
1081 aSize.setWidth( static_cast<tools::Long>(aMaxSize.Height() * fGrfWH) );
1082 aSize.setHeight( aMaxSize.Height() );
1083 }
1084 else if ( fGrfWH > 0.F )
1085 {
1086 aSize.setWidth( aMaxSize.Width() );
1087 aSize.setHeight( static_cast<tools::Long>(aMaxSize.Width() / fGrfWH) );
1088 }
1089
1090 aPos = rMaxRect.Center();
1091 }
1092
1093 if( bShrinkOnly )
1094 aPos = getRectangle().TopLeft();
1095
1096 aPos.AdjustX( -(aSize.Width() / 2) );
1097 aPos.AdjustY( -(aSize.Height() / 2) );
1098 SetLogicRect( tools::Rectangle( aPos, aSize ) );
1099}
1100
1102{
1103 if(mbGrafAnimationAllowed != bNew)
1104 {
1106 ActionChanged();
1107 }
1108}
1109
1110uno::Reference<io::XInputStream> SdrGrafObj::getInputStream() const
1111{
1112 uno::Reference<io::XInputStream> xStream;
1113
1114 if (mpGraphicObject && GetGraphic().IsGfxLink())
1115 {
1116 Graphic aGraphic( GetGraphic() );
1117 GfxLink aLink( aGraphic.GetGfxLink() );
1118 sal_uInt32 nSize = aLink.GetDataSize();
1119 const void* pSourceData = static_cast<const void*>(aLink.GetData());
1120 if( nSize && pSourceData )
1121 {
1122 sal_uInt8 * pBuffer = new sal_uInt8[ nSize ];
1123 memcpy( pBuffer, pSourceData, nSize );
1124
1125 SvMemoryStream* pStream = new SvMemoryStream( static_cast<void*>(pBuffer), static_cast<std::size_t>(nSize), StreamMode::READ );
1126 pStream->ObjectOwnsMemory( true );
1127 xStream.set( new utl::OInputStreamWrapper( pStream, true ) );
1128 }
1129 }
1130
1131 if (!xStream.is() && !aFileName.isEmpty())
1132 {
1133 SvFileStream* pStream = new SvFileStream( aFileName, StreamMode::READ );
1134 xStream.set( new utl::OInputStreamWrapper( pStream ) );
1135 }
1136
1137 return xStream;
1138}
1139
1140// moved crop handle creation here; this is the object type using them
1142{
1143 basegfx::B2DHomMatrix aMatrix;
1144 basegfx::B2DPolyPolygon aPolyPolygon;
1145
1146 // get object transformation
1147 TRGetBaseGeometry(aMatrix, aPolyPolygon);
1148
1149 // part of object transformation correction, but used later, so defined outside next scope
1150 double fShearX(0.0), fRotate(0.0);
1151
1152 { // TTTT correct shear, it comes currently mirrored from TRGetBaseGeometry, can be removed with aw080
1153 basegfx::B2DTuple aScale;
1154 basegfx::B2DTuple aTranslate;
1155
1156 aMatrix.decompose(aScale, aTranslate, fRotate, fShearX);
1157
1158 if(!basegfx::fTools::equalZero(fShearX))
1159 {
1160 // shearX is used, correct it
1161 fShearX = -fShearX;
1162 }
1163
1165 aScale,
1166 fShearX,
1167 fRotate,
1168 aTranslate);
1169 }
1170
1171 // get crop values
1172 const SdrGrafCropItem& rCrop = GetMergedItem(SDRATTR_GRAFCROP);
1173
1174 if(rCrop.GetLeft() || rCrop.GetTop() || rCrop.GetRight() ||rCrop.GetBottom())
1175 {
1176 // decompose object transformation to have current translate and scale
1177 basegfx::B2DVector aScale, aTranslate;
1178 double fLclRotate, fLclShearX;
1179
1180 aMatrix.decompose(aScale, aTranslate, fLclRotate, fLclShearX);
1181
1182 if(!aScale.equalZero())
1183 {
1184 // get crop scale
1185 const basegfx::B2DVector aCropScaleFactor(
1186 GetGraphicObject().calculateCropScaling(
1187 aScale.getX(),
1188 aScale.getY(),
1189 rCrop.GetLeft(),
1190 rCrop.GetTop(),
1191 rCrop.GetRight(),
1192 rCrop.GetBottom()));
1193
1194 // apply crop scale
1195 const double fCropLeft(rCrop.GetLeft() * aCropScaleFactor.getX());
1196 const double fCropTop(rCrop.GetTop() * aCropScaleFactor.getY());
1197 const double fCropRight(rCrop.GetRight() * aCropScaleFactor.getX());
1198 const double fCropBottom(rCrop.GetBottom() * aCropScaleFactor.getY());
1199 basegfx::B2DHomMatrix aMatrixForCropViewHdl(aMatrix);
1200
1201 if(IsMirrored())
1202 {
1203 // create corrected new matrix, TTTT can be removed with aw080
1204 // the old mirror only can mirror horizontally; the vertical mirror
1205 // is faked by using the horizontal and 180 degree rotation. Since
1206 // the object can be rotated differently from 180 degree, this is
1207 // not safe to detect. Just correct horizontal mirror (which is
1208 // in IsMirrored()) and keep the rotation angle
1209 // caution: Do not modify aMatrix, it is used below to calculate
1210 // the exact handle positions
1211 basegfx::B2DHomMatrix aPreMultiply;
1212
1213 // mirrored X, apply
1214 aPreMultiply.translate(-0.5, 0.0);
1215 aPreMultiply.scale(-1.0, 1.0);
1216 aPreMultiply.translate(0.5, 0.0);
1217
1218 aMatrixForCropViewHdl = aMatrixForCropViewHdl * aPreMultiply;
1219 }
1220
1221 rTarget.AddHdl(
1222 std::make_unique<SdrCropViewHdl>(
1223 aMatrixForCropViewHdl,
1225 fCropLeft,
1226 fCropTop,
1227 fCropRight,
1228 fCropBottom));
1229 }
1230 }
1231
1232 basegfx::B2DPoint aPos;
1233
1234 aPos = aMatrix * basegfx::B2DPoint(0.0, 0.0);
1235 rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), SdrHdlKind::UpperLeft, fShearX, fRotate));
1236 aPos = aMatrix * basegfx::B2DPoint(0.5, 0.0);
1237 rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), SdrHdlKind::Upper, fShearX, fRotate));
1238 aPos = aMatrix * basegfx::B2DPoint(1.0, 0.0);
1239 rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), SdrHdlKind::UpperRight, fShearX, fRotate));
1240 aPos = aMatrix * basegfx::B2DPoint(0.0, 0.5);
1241 rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), SdrHdlKind::Left , fShearX, fRotate));
1242 aPos = aMatrix * basegfx::B2DPoint(1.0, 0.5);
1243 rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), SdrHdlKind::Right, fShearX, fRotate));
1244 aPos = aMatrix * basegfx::B2DPoint(0.0, 1.0);
1245 rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), SdrHdlKind::LowerLeft, fShearX, fRotate));
1246 aPos = aMatrix * basegfx::B2DPoint(0.5, 1.0);
1247 rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), SdrHdlKind::Lower, fShearX, fRotate));
1248 aPos = aMatrix * basegfx::B2DPoint(1.0, 1.0);
1249 rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), SdrHdlKind::LowerRight, fShearX, fRotate));
1250}
1251
1252/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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
double mfSinRotationAngle
Definition: svdtrans.hxx:206
void RecalcTan()
Definition: svdtrans.cxx:456
void RecalcSinCos()
Definition: svdtrans.cxx:444
Degree100 m_nShearAngle
Definition: svdtrans.hxx:204
Degree100 m_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:207
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
tools::Long AdjustY(tools::Long nVertMove)
tools::Long AdjustX(tools::Long nHorzMove)
This class represents an embedded or linked bitmap graphic object.
Definition: svdograf.hxx:68
bool IsEPS() const
Definition: svdograf.cxx:443
OUString maSignatureLineSigningInstructions
Definition: svdograf.hxx:99
MapMode GetGrafPrefMapMode() const
Definition: svdograf.cxx:448
virtual rtl::Reference< SdrObject > CloneSdrObject(SdrModel &rTargetModel) const override
Definition: svdograf.cxx:761
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:796
bool mbSignatureLineIsSigned
Definition: svdograf.hxx:102
void StartAnimation()
Definition: svdograf.cxx:839
virtual void handlePageChange(SdrPage *pOldPage, SdrPage *pNewPage) override
Definition: svdograf.cxx:815
GraphicAttr GetGraphicAttr(SdrGrafObjTransformsAttrs nTransformFlags=SdrGrafObjTransformsAttrs::ALL) const
Definition: svdograf.cxx:403
virtual void AdjustToMaxRect(const tools::Rectangle &rMaxRect, bool bShrinkOnly=false) override
Definition: svdograf.cxx:1051
bool IsLinkedGraphic() const
Definition: svdograf.cxx:553
bool HasGDIMetaFile() const
Definition: svdograf.cxx:844
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:672
virtual rtl::Reference< SdrObject > getFullDragClone() const override
Definition: svdograf.cxx:745
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:766
OUString maSignatureLineSuggestedSignerEmail
Definition: svdograf.hxx:98
virtual SdrObjKind GetObjIdentifier() const override
Definition: svdograf.cxx:585
GDIMetaFile getMetafileFromEmbeddedVectorGraphicData() const
Definition: svdograf.cxx:854
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:1030
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:779
virtual void RestoreGeoData(const SdrObjGeoData &rGeo) override
Definition: svdograf.cxx:808
bool bMirrored
Definition: svdograf.hxx:89
virtual void addCropHandles(SdrHdlList &rTarget) const override
Definition: svdograf.cxx:1141
OUString aFileName
Definition: svdograf.hxx:84
void ReleaseGraphicLink()
Definition: svdograf.cxx:542
bool mbIsSignatureLine
Definition: svdograf.hxx:94
bool IsMirrored() const
Definition: svdograf.hxx:195
void ImpSetLinkedGraphic(const Graphic &rGraphic)
Definition: svdograf.cxx:590
SdrGraphicLink * pGraphicLink
Definition: svdograf.hxx:88
OUString maSignatureLineSuggestedSignerName
Definition: svdograf.hxx:96
virtual void TakeObjInfo(SdrObjTransformInfoRec &rInfo) const override
Definition: svdograf.cxx:558
std::unique_ptr< css::drawing::BarCode > mpBarCode
Definition: svdograf.hxx:105
void SetMirrored(bool _bMirrored)
Definition: svdograf.cxx:1025
GraphicType GetGraphicType() const
Definition: svdograf.cxx:398
void ImpRegisterLink()
Definition: svdograf.cxx:507
void SetGrafStreamURL(const OUString &rGraphicStreamURL)
Definition: svdograf.cxx:458
bool IsAnimated() const
Definition: svdograf.cxx:438
virtual rtl::Reference< SdrObject > DoConvertToPolyObj(bool bBezier, bool bAddText) const override
Definition: svdograf.cxx:897
virtual void AddToHdlList(SdrHdlList &rHdlList) const override
Definition: svdograf.cxx:771
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:599
void SetGrafAnimationAllowed(bool bNew)
Definition: svdograf.cxx:1101
void ImpDeregisterLink()
Definition: svdograf.cxx:523
virtual void SaveGeoData(SdrObjGeoData &rGeo) const override
Definition: svdograf.cxx:801
void onGraphicChanged()
Definition: svdograf.cxx:130
Size GetGrafPrefSize() const
Definition: svdograf.cxx:453
GDIMetaFile GetMetaFile(GraphicType &rGraphicType) const
Definition: svdograf.cxx:878
void SetGraphicLink(const OUString &rFileName)
Definition: svdograf.cxx:535
virtual void NbcMirror(const Point &rRef1, const Point &rRef2) override
Definition: svdograf.cxx:790
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:470
bool isEmbeddedVectorGraphicData() const
Definition: svdograf.cxx:849
bool mbIsSignatureLineCanAddComment
Definition: svdograf.hxx:101
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Detects when a stylesheet is changed.
Definition: svdograf.cxx:1017
friend class SdrGraphicLink
Definition: svdograf.hxx:76
css::uno::Reference< css::io::XInputStream > getInputStream() const
Definition: svdograf.cxx:1110
void ForceSwapIn() const
Definition: svdograf.cxx:498
Size getOriginalSize() const
Definition: svdograf.cxx:475
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:1143
sfx2::LinkManager * GetLinkManager()
Definition: svdmodel.hxx:352
All geometrical data of an arbitrary object for use in undo/redo.
Definition: svdobj.hxx:174
void FlattenGroups()
Makes the object list flat, i.e.
Definition: svdpage.cxx:823
Provides information about various ZObject properties.
Definition: svdobj.hxx:196
const SfxPoolItem & GetMergedItem(const sal_uInt16 nWhich) const
Definition: svdobj.cxx:2009
void ActionChanged() const
Definition: svdobj.cxx:273
bool mbLineIsOutsideGeometry
Definition: svdobj.hxx:920
bool LineGeometryUsageIsNecessary() const
Definition: svdobj.cxx:1075
void BroadcastObjectChange() const
Definition: svdobj.cxx:1018
virtual void SetTitle(const OUString &rStr)
Definition: svdobj.cxx:783
bool mbSupportTextIndentingOnLineWidthChange
Definition: svdobj.hxx:922
virtual void SetDescription(const OUString &rStr)
Definition: svdobj.cxx:827
void SingleObjectPainter(OutputDevice &rOut) const
Definition: svdobj.cxx:1064
const SfxPoolItem & GetObjectItem(const sal_uInt16 nWhich) const
Definition: svdobj.cxx:2004
virtual const tools::Rectangle & GetCurrentBoundRect() const
Definition: svdobj.cxx:962
SdrModel & getSdrModelFromSdrObject() const
Definition: svdobj.cxx:289
virtual void SetLogicRect(const tools::Rectangle &rRect)
Definition: svdobj.cxx:1696
virtual const OUString & GetName() const
Definition: svdobj.cxx:771
virtual void SetChanged()
Definition: svdobj.cxx:1042
virtual SdrLayerID GetLayer() const
Definition: svdobj.cxx:645
virtual void SetName(const OUString &rStr, const bool bSetChanged=true)
Definition: svdobj.cxx:734
bool m_bEmptyPresObj
Definition: svdobj.hxx:911
virtual void SetBoundAndSnapRectsDirty(bool bNotMyself=false, bool bRecursive=true)
Definition: svdobj.cxx:509
const SfxItemSet & GetObjectItemSet() const
Definition: svdobj.cxx:1969
A SdrPage contains exactly one SdrObjList and a description of the physical page dimensions (size / m...
Definition: svdpage.hxx:379
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:533
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:561
virtual void RestoreGeoData(const SdrObjGeoData &rGeo) override
Definition: svdorect.cxx:567
virtual void NbcMirror(const Point &rRef1, const Point &rRef2) override
Definition: svdorect.cxx:469
GeoStat maGeo
Definition: svdotext.hxx:196
virtual void SaveGeoData(SdrObjGeoData &rGeo) const override
Definition: svdotext.cxx:1499
tools::Rectangle const & getRectangle() const
Definition: svdotext.hxx:170
virtual const tools::Rectangle & GetLogicRect() const override
Definition: svdotxtr.cxx:70
virtual void handlePageChange(SdrPage *pOldPage, SdrPage *pNewPage) override
Definition: svdotext.cxx:480
virtual rtl::Reference< SdrObject > getFullDragClone() const override
Definition: svdotext.cxx:2132
const GeoStat & GetGeoStat() const
Definition: svdotext.hxx:419
bool mbNoShear
Definition: svdotext.hxx:243
rtl::Reference< SdrObject > ImpConvertAddText(rtl::Reference< SdrObject > pObj, bool bBezier) const
Definition: svdotxtr.cxx:459
virtual bool TRGetBaseGeometry(basegfx::B2DHomMatrix &rMatrix, basegfx::B2DPolyPolygon &rPolyPolygon) const override
Definition: svdotext.cxx:1654
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(std::u16string_view 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(std::u16string_view 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