24#include <svx/svxids.hrc>
38#include <svx/strings.hrc>
44 OUString aCommandURL, sal_uInt16 nSlotId,
45 css::uno::Reference<css::frame::XFrame> xFrame)
46 : mbWideButton(bWideButton)
47 , mbWasHiContrastMode(
Application::GetSettings().GetStyleSettings().GetHighContrastMode())
51 , maCommandLabel(
std::move(aCommandLabel))
52 , maCommandURL(
std::move(aCommandURL))
67 auto pDocSh =
xModel->GetObjectShell();
69 if (
auto oColor = pDocSh->GetRecentColor(nSlotId))
78 case SID_ATTR_CHAR_COLOR:
79 case SID_ATTR_CHAR_COLOR2:
82 case SID_FRAME_LINECOLOR:
85 case SID_ATTR_CHAR_COLOR_BACKGROUND:
86 case SID_ATTR_CHAR_BACK_COLOR:
87 case SID_BACKGROUND_COLOR:
88 case SID_TABLE_CELL_BACKGROUND_COLOR:
91 case SID_ATTR_LINE_COLOR:
94 case SID_ATTR_FILL_COLOR:
104 if (rHint.
GetId() == SfxHintId::Dying)
108 else if (rHint.
GetId() == SfxHintId::ColorsChanged)
125 const OUString& rCommandLabel,
const OUString& rCommandURL,
126 const css::uno::Reference<css::frame::XFrame>& rFrame)
148 assert(pMtf &&
"should have been set in ToolboxButtonColorUpdaterBase::Update");
165 return mpTbx->GetImageSize();
183 OUString colorSuffix = OUString(
" (%1)").replaceFirst(
"%1", rNamedColor.
m_aName);
196 const bool bSizeChanged = (
meImageType != eImageType);
199 Color aColor(rColor);
205 if ((
maCurColor == aColor) && !bSizeChanged && !bDisplayModeChanged && !bForceUpdate)
209 Image aImage(xImage);
216 pVirDev->SetOutputSizePixel(aItemSize);
219 std::unique_ptr<GDIMetaFile> xMetaFile;
223 xMetaFile->SetPrefSize(pVirDev->GetOutputSize());
224 xMetaFile->SetPrefMapMode(pVirDev->GetMapMode());
225 xMetaFile->Record(pVirDev.
get());
226 pVirDev->EnableOutput(
false);
242 pVirDev->SetClipRegion(aRegion);
244 pVirDev->DrawImage(
Point(0, 0), aImage);
252 pVirDev->SetLineColor(aColor);
261 if (bIsFullyTransparent)
263 pVirDev->SetFillColor();
280 sal_Int32 nStart = sColorName.indexOf(
'(');
281 sColorName = sColorName.copy( nStart + 1 );
282 sal_Int32
nLength = sColorName.getLength();
284 sColorName = sColorName.copy( 0,
nLength - 1);
289 const OUString& rCommandLabel,
const css::uno::Reference<css::frame::XFrame>& rFrame)
324 auto nWidth = rImageSize.
Width();
331 : m_eXLS(css::
drawing::LineStyle_NONE)
332 , m_nDashStyleIndex(-1)
338 if (rEvent.FeatureURL.Complete ==
".uno:LineDash")
350 aDashItem.
PutValue(rEvent.State, 0);
356 const XDashEntry* pEntry = xLineStyleList->GetDash(
i);
365 else if (rEvent.FeatureURL.Complete ==
".uno:XLineStyle")
368 aLineStyleItem.
PutValue(rEvent.State, 0);
379 case css::drawing::LineStyle_NONE:
382 case css::drawing::LineStyle_SOLID:
const StyleSettings & GetStyleSettings() const
static const AllSettings & GetSettings()
bool IsFullyTransparent() const
css::uno::Reference< css::graphic::XGraphic > GetXGraphic() const
Size GetSizePixel() const
GDIMetaFile * GetConnectMetaFile() const
void StartListening(SfxBroadcaster &rBroadcaster, DuplicateHandling eDuplicateHanding=DuplicateHandling::Unexpected)
static SAL_WARN_UNUSED_RESULT SfxObjectShell * Current()
const SfxPoolItem * GetItem(sal_uInt16 nSlotId) const
constexpr tools::Long Height() const
constexpr tools::Long Width() const
bool GetHighContrastMode() const
const Color & GetDisableColor() const
const XDashListRef & GetDashList() const
reference_type * get() const
static VclPtr< reference_type > Create(Arg &&... arg)
const XDash & GetDash() const
const XDash & GetDashValue() const
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
void Exclude(const tools::Rectangle &rRegion)
constexpr ::Color COL_AUTO(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
constexpr ::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
OUString SvxResId(TranslateId aId)
Reference< graphic::XGraphic > GetXGraphicForCommand(const OUString &rsCommandName, const Reference< frame::XFrame > &rxFrame, vcl::ImageType eImageType)
Reference< XFrame > xFrame
Reference< XModel > xModel
#define COL_DEFAULT_SHAPE_FILLING
#define COL_DEFAULT_HIGHLIGHT
#define COL_DEFAULT_SHAPE_STROKE
#define COL_DEFAULT_FRAMELINE