75#include <osl/diagnose.h>
90 maLineCap(css::
drawing::LineCap_BUTT),
91 maDash(css::
drawing::DashStyle_RECT, 0, 0, 0, 0, 0),
100 mbLastObjWasPolyWithoutLine(false),
103 mbLastObjWasLine(false)
105 mpVD->EnableOutput(
false);
106 mpVD->SetLineColor();
107 mpVD->SetFillColor();
109 mpLineAttr = std::make_unique<SfxItemSetFixed<XATTR_LINE_FIRST, XATTR_LINE_LAST>>(rModel.
GetItemPool());
110 mpFillAttr = std::make_unique<SfxItemSetFixed<XATTR_FILL_FIRST, XATTR_FILL_LAST>>(rModel.
GetItemPool());
125 OSL_ENSURE(
false,
"OOps, no action at valid position (!)");
131 case MetaActionType::PIXEL :
break;
132 case MetaActionType::POINT :
break;
178 case MetaActionType::WALLPAPER : OSL_ENSURE(
false,
"Tried to construct SdrObject from MetaWallpaperAction: not supported (!)");
break;
180 case MetaActionType::EPS : OSL_ENSURE(
false,
"Tried to construct SdrObject from MetaEPSAction: not supported (!)");
break;
183 case MetaActionType::TEXTLINE : OSL_ENSURE(
false,
"Tried to construct SdrObject from MetaTextLineAction: not supported (!)");
break;
192 if(pProgrInfo && pActionsToReport)
194 (*pActionsToReport)++;
196 if(*pActionsToReport >= 16)
201 *pActionsToReport = 0;
255 sal_uInt32 nActionsToReport(0);
263 nActionsToReport = 0;
281 nActionsToReport = 0;
295 if(nActionsToReport >= 32)
298 nActionsToReport = 0;
316 bool bLine(!bForceTextAttr);
317 bool bFill(!pObj || (pObj->
IsClosedObj() && !bForceTextAttr));
333 if(
mpVD->IsLineColor())
378 if(
mpVD->IsFillColor())
465 const SfxItemSet aOldItemSet(pObj->GetMergedItemSet());
469 if(pSdrTextObj && pSdrTextObj->
HasText())
480 if(!aClipRange.
overlaps(aTextRange))
511 OSL_ENSURE(pCandidate &&
dynamic_cast< SdrObjGroup*
>(pCandidate) ==
nullptr,
"SdrObjListIter with SdrIterMode::DeepNoGroups error (!)");
520 OSL_ENSURE(
false,
"SdrObject::Clone() failed (!)");
557 pObj->SetLayer(aOldLayer);
558 pObj->SetMergedItemSet(aOldItemSet);
569 aTrans.
scale(fScaleX, fScaleY);
573 const Point aClipTopLeft(
576 const Size aClipSize(
601 if(pObj->HasLineStyle())
606 if(!
bVisible && pObj->HasFillStyle())
615 if(pTextObj && pTextObj->
HasText())
640 const bool bClosed(pObj->IsClosedObj());
659 if(aStart.
equal(aEnd))
670 const sal_Int32 nNewLineWidth(rLineInfo.
GetWidth());
671 bool bCreateLineObject(
true);
675 bCreateLineObject =
false;
678 if(!bCreateLineObject)
718 pRect->SetMergedItemSet(aSet);
805 const sal_uInt32 nMaxDstPnt(aDstPoly.
count() - 1);
806 const sal_uInt32 nMaxSrcPnt(rSrcPoly.
count() - 1);
810 aDstPoly.
append(rSrcPoly, 1, rSrcPoly.
count() - 1);
823 aDstPoly.
append(rSrcPoly, 1, rSrcPoly.
count() - 1);
877 if(!
mpVD->IsClipRegion())
880 maClip =
mpVD->GetClipRegion().GetAsB2DPolyPolygon();
912 const sal_Int32 nNewLineWidth(rLineInfo.
GetWidth());
913 bool bCreateLineObject(
true);
917 bCreateLineObject =
false;
921 bCreateLineObject =
false;
924 if(!bCreateLineObject)
1001 sal_Int32 nTextWidth =
static_cast<sal_Int32
>(
mpVD->GetTextWidth( rStr ) *
mfScaleX );
1002 sal_Int32 nTextHeight =
static_cast<sal_Int32
>(
mpVD->GetTextHeight() *
mfScaleY );
1005 Size aSize( nTextWidth, nTextHeight );
1036 pText->NbcSetText( rStr );
1038 pText->SetSnapRect( aTextRect );
1045 pText->SetMergedItemSet(aAttr);
1049 pText->SdrAttrObj::NbcRotate(aPos,nAngle);
1140 if(!aSource.
count())
1153 std::move(aSource));
1156 css::drawing::HatchStyle eStyle;
1160 case HatchStyle::Triple :
1162 eStyle = css::drawing::HatchStyle_TRIPLE;
1166 case HatchStyle::Double :
1168 eStyle = css::drawing::HatchStyle_DOUBLE;
1174 eStyle = css::drawing::HatchStyle_SINGLE;
1182 pPath->SetMergedItemSet(aHatchAttr);
1206 bool bMov2(aMapOrg.
X() != 0 || aMapOrg.
Y() != 0);
1224 bool aSkipComment =
false;
1231 if( pAct && pAct->
GetType() == MetaActionType::GRADIENTEX )
1244 std::move(aSource));
1273 pPath->SetMergedItemSet(aGradAttr);
1279 aSkipComment =
true;
1289 && ((pSkipAct->
GetType() != MetaActionType::COMMENT )
1430 aGradientAttr.
Put(aXFillGradientItem);
1431 pRect->SetMergedItemSet(aGradientAttr);
1440 if(!aSource.
count())
1450 std::move(aSource));
1460 if(!aSource.
count())
1473 std::move(aSource));
1492 aGradientAttr.
Put(aXFillGradientItem);
1493 pPath->SetMergedItemSet(aGradientAttr);
1529 const bool bEqualColors(aStart == aEnd);
1530 const bool bNoSteps(1 == rGradient.
GetSteps());
1531 bool bCreateObject(
true);
1532 bool bHasNewMask(
false);
1534 double fTransparence(0.0);
1535 bool bFixedTransparence(
false);
1537 if(bEqualColors || bNoSteps)
1550 bCreateObject =
false;
1555 bFixedTransparence =
true;
1566 aNewMask =
AlphaMask(pVDev->GetBitmap(
Point(0, 0), pVDev->GetOutputSizePixel()));
1574 if(bHasNewMask || bFixedTransparence)
1579 if(bFixedTransparence)
Bitmap GetBitmap(Color aTransparentReplaceColor) const
bool Crop(const tools::Rectangle &rRectPixel)
const Size & GetSizePixel() const
Size GetSizePixel() const
void SetRed(sal_uInt8 nRed)
basegfx::BColor getBColor() const
tools::Long GetAscent() const
sal_uInt16 GetStartIntensity() const
Degree10 GetAngle() const
sal_uInt16 GetEndIntensity() const
sal_uInt16 GetOfsX() const
sal_uInt16 GetBorder() const
const Color & GetEndColor() const
sal_uInt16 GetOfsY() const
const Color & GetStartColor() const
css::awt::GradientStyle GetStyle() const
sal_uInt16 GetSteps() const
BitmapEx GetBitmapEx(const GraphicConversionParameters &rParameters=GraphicConversionParameters()) const
Degree10 GetAngle() const
HatchStyle GetStyle() const
tools::Long GetDistance() const
const Color & GetColor() const
basegfx::B2DLineJoin GetLineJoin() const
double GetDistance() const
sal_uInt16 GetDashCount() const
double GetDashLen() const
css::drawing::LineCap GetLineCap() const
sal_uInt16 GetDotCount() const
const Point & GetOrigin() const
sal_Int32 GetIndex() const
const OUString & GetText() const
const Point & GetPoint() const
const Point & GetPoint() const
const OUString & GetText() const
sal_Int32 GetIndex() const
sal_Int32 GetIndex() const
const OUString & GetText() const
const Point & GetPoint() const
DrawTextFlags GetStyle() const
const tools::Rectangle & GetRect() const
const OUString & GetText() const
constexpr tools::Long Y() const
tools::Long AdjustY(tools::Long nVertMove)
constexpr tools::Long X() const
This class represents an embedded or linked bitmap graphic object.
const Graphic & GetGraphic() const
const SfxItemPool & GetItemPool() const
size_t GetObjCount() const
virtual void NbcInsertObject(SdrObject *pObj, size_t nPos=SAL_MAX_SIZE)
virtual OutlinerParaObject * GetOutlinerParaObject() const
void SetMergedItemSet(const SfxItemSet &rSet, bool bClearAllItems=false)
rtl::Reference< SdrObject > ConvertToPolyObj(bool bBezier, bool bLineToArea) const
SdrModel & getSdrModelFromSdrObject() const
virtual rtl::Reference< SdrObject > CloneSdrObject(SdrModel &rTargetModel) const =0
void SetMergedItem(const SfxPoolItem &rItem)
virtual void SetLayer(SdrLayerID nLayer)
virtual void NbcMove(const Size &rSiz)
The methods Move, Resize, Rotate, Mirror, Shear, SetSnapRect and SetLogicRect call the corresponding ...
void NbcSetPathPoly(const basegfx::B2DPolyPolygon &rPathPoly)
const basegfx::B2DPolyPolygon & GetPathPoly() const
Rectangle objects (rectangle, circle, ...)
virtual basegfx::B2DPolyPolygon TakeContour() const override
contour for TextToContour
virtual bool HasText() const override
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
constexpr tools::Long Height() const
constexpr tools::Long Width() const
Helper class for the communication between the dialog In order to break open Metafiles (sd/source/ui/...
void ReportInserts(size_t nInsertCount)
void SetActionCount(size_t _nActionCount)
bool ReportActions(size_t nActionCount)
void SetInsertCount(size_t _nInsertCount)
void ReportRescales(size_t nRescaleCount)
double GetDashLen() const
double GetDistance() const
sal_uInt16 GetDots() const
sal_uInt16 GetDashes() const
void translate(double fX, double fY)
void scale(double fX, double fY)
B2DPolygon const & getB2DPolygon(sal_uInt32 nIndex) const
void transform(const basegfx::B2DHomMatrix &rMatrix)
void setClosed(bool bNew)
B2DRange getB2DRange() const
basegfx::B2DPoint const & getB2DPoint(sal_uInt32 nIndex) const
void transform(const basegfx::B2DHomMatrix &rMatrix)
void append(const basegfx::B2DPoint &rPoint, sal_uInt32 nCount)
void setClosed(bool bNew)
BASEGFX_DLLPUBLIC void transform(const B2DHomMatrix &rMatrix)
void SetGradientStyle(css::awt::GradientStyle eNewStyle)
void SetEndIntens(sal_uInt16 nNewIntens)
void SetYOffset(sal_uInt16 nNewOffset)
void SetXOffset(sal_uInt16 nNewOffset)
void SetSteps(sal_uInt16 nSteps)
void SetBorder(sal_uInt16 nNewBorder)
void SetStartIntens(sal_uInt16 nNewIntens)
void SetAngle(Degree10 nNewAngle)
bool isInside(const Tuple2D< TYPE > &rTuple) const
bool overlaps(const Range2D &rRange) const
bool equal(const Tuple2D< TYPE > &rTup) const
FontFamily GetFamilyType()
const OUString & GetStyleName() const
FontStrikeout GetStrikeout() const
FontLineStyle GetOverline() const
bool IsTransparent() const
const OUString & GetFamilyName() const
TextAlign GetAlignment() const
const Size & GetFontSize() const
FontLineStyle GetUnderline() const
rtl_TextEncoding GetCharSet() const
bool IsWordLineMode() const
Degree10 GetOrientation() const
const Color & GetFillColor() const
tools::Long GetAverageFontWidth() const
constexpr TypedWhichId< SvxContourItem > EE_CHAR_OUTLINE(EE_CHAR_START+8)
constexpr TypedWhichId< SvxFontItem > EE_CHAR_FONTINFO_CJK(EE_CHAR_START+17)
constexpr TypedWhichId< SvxUnderlineItem > EE_CHAR_UNDERLINE(EE_CHAR_START+5)
constexpr TypedWhichId< SvxFontHeightItem > EE_CHAR_FONTHEIGHT(EE_CHAR_START+2)
constexpr TypedWhichId< SvxShadowedItem > EE_CHAR_SHADOW(EE_CHAR_START+9)
constexpr TypedWhichId< SvxOverlineItem > EE_CHAR_OVERLINE(EE_CHAR_START+29)
constexpr TypedWhichId< SvxWeightItem > EE_CHAR_WEIGHT(EE_CHAR_START+4)
constexpr TypedWhichId< SvxColorItem > EE_CHAR_COLOR(EE_CHAR_START+0)
constexpr TypedWhichId< SvxCrossedOutItem > EE_CHAR_STRIKEOUT(EE_CHAR_START+6)
constexpr TypedWhichId< SvxPostureItem > EE_CHAR_ITALIC(EE_CHAR_START+7)
constexpr TypedWhichId< SvxFontHeightItem > EE_CHAR_FONTHEIGHT_CTL(EE_CHAR_START+20)
constexpr TypedWhichId< SvxFontItem > EE_CHAR_FONTINFO_CTL(EE_CHAR_START+18)
constexpr TypedWhichId< SvxCharScaleWidthItem > EE_CHAR_FONTWIDTH(EE_CHAR_START+3)
constexpr TypedWhichId< SvxWordLineModeItem > EE_CHAR_WLM(EE_CHAR_START+13)
constexpr TypedWhichId< SvxFontHeightItem > EE_CHAR_FONTHEIGHT_CJK(EE_CHAR_START+19)
constexpr TypedWhichId< SvxFontItem > EE_CHAR_FONTINFO(EE_CHAR_START+1)
tools::Long FRound(double fVal)
B2DHomMatrix createScaleTranslateB2DHomMatrix(double fScaleX, double fScaleY, double fTranslateX, double fTranslateY)
bool isRectangle(const B2DPolygon &rPoly)
B2DPolyPolygon clipPolyPolygonOnPolyPolygon(const B2DPolyPolygon &rCandidate, const B2DPolyPolygon &rClip, bool bInside, bool bStroke, size_t *pPointLimit)
B2DTuple average(const B2DTuple &rOld1, const B2DTuple &rOld2)
B2IRange fround(const B2DRange &rRange)
void Create(SvxOrientationItem &rItem, SvStream &rStrm, sal_uInt16)
void DrawAlphaBitmapAndAlphaGradient(BitmapEx &rBitmapEx, bool bFixedTransparence, float fTransparence, AlphaMask &rNewMask)
SdrOnOffItem makeSdrTextAutoGrowHeightItem(bool bAuto)
SdrOnOffItem makeSdrTextAutoGrowWidthItem(bool bAuto)
SdrMetricItem makeSdrTextUpperDistItem(tools::Long mnHeight)
SdrMetricItem makeSdrTextRightDistItem(tools::Long mnHeight)
SdrMetricItem makeSdrTextLowerDistItem(tools::Long mnHeight)
SdrMetricItem makeSdrTextLeftDistItem(tools::Long mnHeight)
constexpr TypedWhichId< SdrOnOffItem > SDRATTR_TEXT_AUTOGROWWIDTH(SDRATTR_MISC_FIRST+12)
constexpr TypedWhichId< SdrMetricItem > SDRATTR_CORNER_RADIUS(SDRATTR_MISC_FIRST+0)
SdrTextObj * DynCastSdrTextObj(SdrObject *pObj)
@ Text
closed free-hand line
@ PolyLine
polygon, PolyPolygon
BitmapEx convertMetafileToBitmapEx(const GDIMetaFile &rMtf, const basegfx::B2DRange &rTargetRange, const sal_uInt32 nMaximumQuadraticPixels)
Helper to convert any GDIMetaFile to a good quality BitmapEx, using default parameters and graphic::X...
Degree100 GetAngle(const Point &rPnt)
The Y axis points down! The function negates the Y axis, when calculating the angle,...