24#include <osl/diagnose.h>
66 OSL_ENSURE(
false,
"Could not get Graphic from SvxBrushItem (!)");
115 if(0 != nGraphicTransparency)
121 else if (0xff != nTransparency)
164 nFillTransparence =
static_cast< sal_uInt16
>(((nStartLuminance + nEndLuminance) * 100) / 512);
167 return nFillTransparence;
177 if(0 != nFillTransparence)
184 aFillColor.
SetAlpha(255 - aTargetTrans);
187 return std::make_unique<SvxBrushItem>(aFillColor, nBackgroundID);
194 if(!pXFillStyleItem || drawing::FillStyle_NONE == pXFillStyleItem->
GetValue())
200 if (!bXMLImportHack && aFillColor !=
Color(0))
205 return std::make_unique<SvxBrushItem>(aFillColor, nBackgroundID);
208 std::unique_ptr<SvxBrushItem> xRetval;
212 case drawing::FillStyle_NONE:
217 case drawing::FillStyle_SOLID:
223 case drawing::FillStyle_GRADIENT:
231 Color aMixedColor((aStartColor + aEndColor) * 0.5);
236 if(0 != nFillTransparence)
243 aMixedColor.
SetAlpha(255 - aTargetTrans);
246 xRetval = std::make_unique<SvxBrushItem>(aMixedColor, nBackgroundID);
249 case drawing::FillStyle_HATCH:
270 nFillTransparence = std::clamp(
static_cast<sal_uInt16
>((nFillTransparence / 2) + 50), sal_uInt16(0), sal_uInt16(255));
277 aHatchColor.
SetAlpha(255 - aTargetTrans);
278 xRetval = std::make_unique<SvxBrushItem>(aHatchColor, nBackgroundID);
283 case drawing::FillStyle_BITMAP:
321 xRetval = std::make_unique<SvxBrushItem>(aGraphic, aSvxGraphicPosition, nBackgroundID);
326 if(0 != nFillTransparence)
329 xRetval->setGraphicTransparency(
static_cast< sal_Int8 >(nFillTransparence));
335 xRetval = std::make_unique<SvxBrushItem>(nBackgroundID);
Color GetRGBColor() const
sal_uInt8 GetLuminance() const
sal_uInt8 GetAlpha() const
void SetAlpha(sal_uInt8 nAlpha)
const Graphic & GetGraphic() const
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
const Color & GetColor() const
sal_Int8 getGraphicTransparency() const
const Graphic * GetGraphic(OUString const &referer=OUString()) const
SvxGraphicPosition GetGraphicPos() const
const GraphicObject & GetGraphicObject() const
const basegfx::BGradient & GetGradientValue() const
const Color & GetColor() const
sal_uInt16 GetStartIntens() const
const basegfx::BColorStops & GetColorStops() const
sal_uInt16 GetEndIntens() const
constexpr ::Color COL_AUTO(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
static std::unique_ptr< SvxBrushItem > getSvxBrushItemForSolid(const SfxItemSet &rSourceSet, bool bSearchInParents, sal_uInt16 nBackgroundID)
void setSvxBrushItemAsFillAttributesToTargetSet(const SvxBrushItem &rBrush, SfxItemSet &rToSet)
std::unique_ptr< SvxBrushItem > getSvxBrushItemFromSourceSet(const SfxItemSet &rSourceSet, sal_uInt16 nBackgroundID, bool bSearchInParents, bool bXMLImportHack)
static sal_uInt16 getTransparenceForSvxBrushItem(const SfxItemSet &rSourceSet, bool bSearchInParents)
constexpr TypedWhichId< XFillBmpPosItem > XATTR_FILLBMP_POS(XATTR_FILL_FIRST+8)
constexpr TypedWhichId< XFillColorItem > XATTR_FILLCOLOR(XATTR_FILL_FIRST+1)
constexpr TypedWhichId< XFillTransparenceItem > XATTR_FILLTRANSPARENCE(XATTR_FILL_FIRST+5)
constexpr TypedWhichId< XFillBmpStretchItem > XATTR_FILLBMP_STRETCH(XATTR_FILL_FIRST+16)
constexpr sal_uInt16 XATTR_FILL_FIRST(XATTRSET_LINE+1)
constexpr TypedWhichId< XFillHatchItem > XATTR_FILLHATCH(XATTR_FILL_FIRST+3)
constexpr sal_uInt16 XATTR_FILL_LAST(XATTR_FILLUSESLIDEBACKGROUND)
constexpr TypedWhichId< XFillBmpTileItem > XATTR_FILLBMP_TILE(XATTR_FILL_FIRST+7)
constexpr TypedWhichId< XFillBitmapItem > XATTR_FILLBITMAP(XATTR_FILL_FIRST+4)
constexpr TypedWhichId< XFillBackgroundItem > XATTR_FILLBACKGROUND(XATTR_FILL_FIRST+19)
constexpr TypedWhichId< XFillFloatTransparenceItem > XATTR_FILLFLOATTRANSPARENCE(XATTR_FILL_FIRST+11)
constexpr TypedWhichId< XFillStyleItem > XATTR_FILLSTYLE(XATTR_FILL_FIRST)
constexpr TypedWhichId< XFillGradientItem > XATTR_FILLGRADIENT(XATTR_FILL_FIRST+2)