76#include <osl/diagnose.h>
91 maLineCap(css::
drawing::LineCap_BUTT),
92 maDash(css::
drawing::DashStyle_RECT, 0, 0, 0, 0, 0),
101 mbLastObjWasPolyWithoutLine(false),
104 mbLastObjWasLine(false)
106 mpVD->EnableOutput(
false);
107 mpVD->SetLineColor();
108 mpVD->SetFillColor();
110 mpLineAttr = std::make_unique<SfxItemSetFixed<XATTR_LINE_FIRST, XATTR_LINE_LAST>>(rModel.
GetItemPool());
111 mpFillAttr = std::make_unique<SfxItemSetFixed<XATTR_FILL_FIRST, XATTR_FILL_LAST>>(rModel.
GetItemPool());
126 OSL_ENSURE(
false,
"OOps, no action at valid position (!)");
132 case MetaActionType::PIXEL :
break;
133 case MetaActionType::POINT :
break;
179 case MetaActionType::WALLPAPER : OSL_ENSURE(
false,
"Tried to construct SdrObject from MetaWallpaperAction: not supported (!)");
break;
181 case MetaActionType::EPS : OSL_ENSURE(
false,
"Tried to construct SdrObject from MetaEPSAction: not supported (!)");
break;
184 case MetaActionType::TEXTLINE : OSL_ENSURE(
false,
"Tried to construct SdrObject from MetaTextLineAction: not supported (!)");
break;
193 if(pProgrInfo && pActionsToReport)
195 (*pActionsToReport)++;
197 if(*pActionsToReport >= 16)
202 *pActionsToReport = 0;
256 sal_uInt32 nActionsToReport(0);
264 nActionsToReport = 0;
282 nActionsToReport = 0;
296 if(nActionsToReport >= 32)
299 nActionsToReport = 0;
317 bool bLine(!bForceTextAttr);
318 bool bFill(!pObj || (pObj->
IsClosedObj() && !bForceTextAttr));
334 if(
mpVD->IsLineColor())
379 if(
mpVD->IsFillColor())
466 const SfxItemSet aOldItemSet(pObj->GetMergedItemSet());
470 if(pSdrTextObj && pSdrTextObj->
HasText())
481 if(!aClipRange.
overlaps(aTextRange))
512 OSL_ENSURE(pCandidate &&
dynamic_cast< SdrObjGroup*
>(pCandidate) ==
nullptr,
"SdrObjListIter with SdrIterMode::DeepNoGroups error (!)");
521 OSL_ENSURE(
false,
"SdrObject::Clone() failed (!)");
558 pObj->SetLayer(aOldLayer);
559 pObj->SetMergedItemSet(aOldItemSet);
570 aTrans.
scale(fScaleX, fScaleY);
574 const Point aClipTopLeft(
577 const Size aClipSize(
602 if(pObj->HasLineStyle())
607 if(!
bVisible && pObj->HasFillStyle())
616 if(pTextObj && pTextObj->
HasText())
641 const bool bClosed(pObj->IsClosedObj());
660 if(aStart.
equal(aEnd))
671 const sal_Int32 nNewLineWidth(rLineInfo.
GetWidth());
672 bool bCreateLineObject(
true);
676 bCreateLineObject =
false;
679 if(!bCreateLineObject)
719 pRect->SetMergedItemSet(aSet);
806 const sal_uInt32 nMaxDstPnt(aDstPoly.
count() - 1);
807 const sal_uInt32 nMaxSrcPnt(rSrcPoly.
count() - 1);
811 aDstPoly.
append(rSrcPoly, 1, rSrcPoly.
count() - 1);
824 aDstPoly.
append(rSrcPoly, 1, rSrcPoly.
count() - 1);
878 if(!
mpVD->IsClipRegion())
881 maClip =
mpVD->GetClipRegion().GetAsB2DPolyPolygon();
913 const sal_Int32 nNewLineWidth(rLineInfo.
GetWidth());
914 bool bCreateLineObject(
true);
918 bCreateLineObject =
false;
922 bCreateLineObject =
false;
925 if(!bCreateLineObject)
1002 sal_Int32 nTextWidth =
static_cast<sal_Int32
>(
mpVD->GetTextWidth( rStr ) *
mfScaleX );
1003 sal_Int32 nTextHeight =
static_cast<sal_Int32
>(
mpVD->GetTextHeight() *
mfScaleY );
1006 Size aSize( nTextWidth, nTextHeight );
1011 aPos.AdjustY( -nTextHeight );
1037 pText->NbcSetText( rStr );
1039 pText->SetSnapRect( aTextRect );
1046 pText->SetMergedItemSet(aAttr);
1050 pText->SdrAttrObj::NbcRotate(aPos,nAngle);
1141 if(!aSource.
count())
1154 std::move(aSource));
1157 css::drawing::HatchStyle eStyle;
1161 case HatchStyle::Triple :
1163 eStyle = css::drawing::HatchStyle_TRIPLE;
1167 case HatchStyle::Double :
1169 eStyle = css::drawing::HatchStyle_DOUBLE;
1175 eStyle = css::drawing::HatchStyle_SINGLE;
1183 pPath->SetMergedItemSet(aHatchAttr);
1207 bool bMov2(aMapOrg.X() != 0 || aMapOrg.Y() != 0);
1225 bool aSkipComment =
false;
1232 if( pAct && pAct->
GetType() == MetaActionType::GRADIENTEX )
1245 std::move(aSource));
1273 pPath->SetMergedItemSet(aGradAttr);
1279 aSkipComment =
true;
1289 && ((pSkipAct->
GetType() != MetaActionType::COMMENT )
1397 css::awt::GradientStyle getXGradientStyleFromGradientStyle(
const GradientStyle& rGradientStyle)
1399 css::awt::GradientStyle aXGradientStyle(css::awt::GradientStyle_LINEAR);
1401 switch(rGradientStyle)
1403 case GradientStyle::Linear: aXGradientStyle = css::awt::GradientStyle_LINEAR;
break;
1404 case GradientStyle::Axial: aXGradientStyle = css::awt::GradientStyle_AXIAL;
break;
1405 case GradientStyle::Radial: aXGradientStyle = css::awt::GradientStyle_RADIAL;
break;
1406 case GradientStyle::Elliptical: aXGradientStyle = css::awt::GradientStyle_ELLIPTICAL;
break;
1407 case GradientStyle::Square: aXGradientStyle = css::awt::GradientStyle_SQUARE;
break;
1408 case GradientStyle::Rect: aXGradientStyle = css::awt::GradientStyle_RECT;
break;
1414 case GradientStyle::FORCE_EQUAL_SIZE:
break;
1419 return aXGradientStyle;
1442 const css::awt::GradientStyle aXGradientStyle(getXGradientStyleFromGradientStyle(rGradient.
GetStyle()));
1458 aGradientAttr.
Put(aXFillGradientItem);
1459 pRect->SetMergedItemSet(aGradientAttr);
1468 if(!aSource.
count())
1478 std::move(aSource));
1488 if(!aSource.
count())
1501 std::move(aSource));
1504 const css::awt::GradientStyle aXGradientStyle(getXGradientStyleFromGradientStyle(rGradient.
GetStyle()));
1520 aGradientAttr.
Put(aXFillGradientItem);
1521 pPath->SetMergedItemSet(aGradientAttr);
1557 const bool bEqualColors(aStart == aEnd);
1558 const bool bNoSteps(1 == rGradient.
GetSteps());
1559 bool bCreateObject(
true);
1560 bool bHasNewMask(
false);
1562 double fTransparence(0.0);
1563 bool bFixedTransparence(
false);
1565 if(bEqualColors || bNoSteps)
1578 bCreateObject =
false;
1583 bFixedTransparence =
true;
1594 aNewMask =
AlphaMask(pVDev->GetBitmap(
Point(0, 0), pVDev->GetOutputSizePixel()));
1601 if(bHasNewMask || bFixedTransparence)
1606 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
GradientStyle GetStyle() 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
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
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 SetEndIntens(sal_uInt16 nNewIntens)
void SetBorder(sal_uInt16 nNewBorder)
void SetStartColor(const Color &rColor)
void SetGradientStyle(css::awt::GradientStyle eNewStyle)
void SetXOffset(sal_uInt16 nNewOffset)
void SetEndColor(const Color &rColor)
void SetAngle(Degree10 nNewAngle)
void SetStartIntens(sal_uInt16 nNewIntens)
void SetYOffset(sal_uInt16 nNewOffset)
void SetSteps(sal_uInt16 nSteps)
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)
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,...