24#include <osl/diagnose.h>
66 OSL_ENSURE(
false,
"Could not get Graphic from SvxBrushItem (!)");
115 if(0 != nGraphicTransparency)
121 else if (0xff != nTransparency)
129 rToSet.
Put(aFillColorItem);
150 rToSet.
Put(aFillColorItem);
167 nFillTransparence =
static_cast< sal_uInt16
>(((nStartLuminance + nEndLuminance) * 100) / 512);
170 return nFillTransparence;
177 Color aFillColor = rFillColorItem.GetColorValue();
182 if(0 != nFillTransparence)
189 aFillColor.
SetAlpha(255 - aTargetTrans);
192 return std::make_unique<SvxBrushItem>(aFillColor, aFillComplexColor, nBackgroundID);
199 if(!pXFillStyleItem || drawing::FillStyle_NONE == pXFillStyleItem->
GetValue())
205 if (!bXMLImportHack && aFillColor !=
Color(0))
210 return std::make_unique<SvxBrushItem>(aFillColor, nBackgroundID);
213 std::unique_ptr<SvxBrushItem> xRetval;
217 case drawing::FillStyle_NONE:
222 case drawing::FillStyle_SOLID:
228 case drawing::FillStyle_GRADIENT:
236 Color aMixedColor((aStartColor + aEndColor) * 0.5);
241 if(0 != nFillTransparence)
248 aMixedColor.
SetAlpha(255 - aTargetTrans);
251 xRetval = std::make_unique<SvxBrushItem>(aMixedColor, nBackgroundID);
254 case drawing::FillStyle_HATCH:
275 nFillTransparence = std::clamp(
static_cast<sal_uInt16
>((nFillTransparence / 2) + 50), sal_uInt16(0), sal_uInt16(255));
282 aHatchColor.
SetAlpha(255 - aTargetTrans);
283 xRetval = std::make_unique<SvxBrushItem>(aHatchColor, nBackgroundID);
288 case drawing::FillStyle_BITMAP:
326 xRetval = std::make_unique<SvxBrushItem>(aGraphic, aSvxGraphicPosition, nBackgroundID);
331 if(0 != nFillTransparence)
334 xRetval->setGraphicTransparency(
static_cast< sal_Int8 >(nFillTransparence));
340 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
const model::ComplexColor & getComplexColor() const
SvxGraphicPosition GetGraphicPos() const
void setComplexColor(model::ComplexColor const &rComplexColor)
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)