22#include <com/sun/star/chart2/XDiagram.hpp>
41 return pToolBoxColorControl;
46 css::uno::Reference<css::frame::XController>
xController(
xModel->getCurrentController());
47 css::uno::Reference<css::view::XSelectionSupplier> xSelectionSupplier(xController, css::uno::UNO_QUERY);
48 if (!xSelectionSupplier.is())
51 css::uno::Any aAny = xSelectionSupplier->getSelection();
55 ChartController* pController =
dynamic_cast<ChartController*
>(
xController.get());
59 xSelectionSupplier = css::uno::Reference<css::view::XSelectionSupplier>(xController, css::uno::UNO_QUERY);
60 if (xSelectionSupplier.is())
61 aAny = xSelectionSupplier->getSelection();
74css::uno::Reference<css::beans::XPropertySet> getPropSet(
77 OUString aCID = getCID(xModel);
78 css::uno::Reference<css::beans::XPropertySet> xPropSet =
84 css::uno::Reference<css::chart2::XDiagram> xDiagram(
85 xPropSet, css::uno::UNO_QUERY);
89 xPropSet.set(xDiagram->getWall());
95ChartController* getController(
const css::uno::Reference<css::frame::XModel>& xModel)
97 css::uno::Reference<css::frame::XController>
xController =
xModel->getCurrentController();
99 throw std::exception();
101 ChartController* pController =
dynamic_cast<ChartController*
>(
xController.get());
103 throw std::exception();
108ViewElementListProvider getViewElementListProvider(
const css::uno::Reference<css::frame::XModel>& xModel)
110 ChartController* pController = getController(xModel);
111 ViewElementListProvider aProvider = pController->getViewElementListProvider();
115DrawModelWrapper* getDrawModelWrapper(
const css::uno::Reference<css::frame::XModel>& xModel)
117 ChartController* pController = getController(xModel);
118 return pController->GetDrawModelWrapper();
121XFillGradientItem getXGradientForName(
const css::uno::Reference<css::frame::XModel>& xModel,
122 const OUString& rName)
124 css::uno::Reference<css::lang::XMultiServiceFactory> xFact(xModel, css::uno::UNO_QUERY);
125 css::uno::Reference<css::container::XNameAccess> xNameAccess(
126 xFact->createInstance(
"com.sun.star.drawing.GradientTable"), css::uno::UNO_QUERY);
127 if (!xNameAccess.is())
130 if (!xNameAccess->hasByName(rName))
133 css::uno::Any aAny = xNameAccess->getByName(rName);
137 aItem.
PutValue(aAny, MID_FILLGRADIENT);
144 const OUString& rName)
146 css::uno::Reference<css::lang::XMultiServiceFactory> xFact(xModel, css::uno::UNO_QUERY);
147 css::uno::Reference<css::container::XNameAccess> xNameAccess(
148 xFact->createInstance(
"com.sun.star.drawing.TransparencyGradientTable"), css::uno::UNO_QUERY);
149 if (!xNameAccess.is())
152 if (!xNameAccess->hasByName(rName))
155 css::uno::Any aAny = xNameAccess->getByName(rName);
159 aItem.
PutValue(aAny, MID_FILLGRADIENT);
165XHatch getXHatchFromName(
const css::uno::Reference<css::frame::XModel>& xModel,
170 ViewElementListProvider aProvider = getViewElementListProvider(xModel);
172 size_t n = aRef->Count();
173 for (
size_t i = 0;
i <
n; ++
i)
179 if (pHatch->
GetName().equalsIgnoreAsciiCase(rName))
195GraphicObject getXBitmapFromName(
const css::uno::Reference<css::frame::XModel>& xModel,
196 std::u16string_view rName)
200 ViewElementListProvider aProvider = getViewElementListProvider(xModel);
204 size_t n = aBmpRef->Count();
205 for (
size_t i = 0;
i <
n; ++
i)
211 if (pBitmap->
GetName().equalsIgnoreAsciiCase(rName))
218 size_t m = aPatRef->Count();
219 for (
size_t i = 0;
i <
m; ++
i)
225 if (pBitmap->
GetName().equalsIgnoreAsciiCase(rName))
242 explicit PreventUpdate(
bool& bUpdate):
261 const css::uno::Reference<css::frame::XFrame>& rxFrame,
264 if (pParent ==
nullptr)
265 throw css::lang::IllegalArgumentException(
"no parent Window given to ChartAxisPanel::Create",
nullptr, 0);
267 throw css::lang::IllegalArgumentException(
"no XFrame given to ChartAxisPanel::Create",
nullptr, 1);
269 return std::make_unique<ChartAreaPanel>(pParent, rxFrame, pController);
273 const css::uno::Reference<css::frame::XFrame>& rxFrame,
275 svx::sidebar::AreaPropertyPanelBase(pParent, rxFrame),
276 mxModel(pController->getChartModel()),
281 maFillColorWrapper(
mxModel, getColorToolBoxControl(*mxColorDispatch),
"FillColor")
299 css::uno::Reference<css::view::XSelectionSupplier> xSelectionSupplier(
mxModel->getCurrentController(), css::uno::UNO_QUERY);
300 if (xSelectionSupplier.is())
312 css::uno::Reference<css::beans::XPropertySet> xPropSet = getPropSet(
mxModel);
316 xPropSet->setPropertyValue(
"FillTransparence", css::uno::Any(rItem.GetValue()));
323 css::uno::Reference<css::beans::XPropertySet> xPropSet = getPropSet(
mxModel);
329 xPropSet->setPropertyValue(
"FillTransparenceGradientName", css::uno::Any(OUString()));
334 css::uno::Any aGradientVal;
337 xPropSet->setPropertyValue(
"FillTransparenceGradientName", css::uno::Any(aNewName));
343 css::uno::Reference<css::beans::XPropertySet> xPropSet = getPropSet(
mxModel);
347 xPropSet->setPropertyValue(
"FillStyle", css::uno::Any(rItem.GetValue()));
353 css::uno::Reference<css::beans::XPropertySet> xPropSet = getPropSet(
mxModel);
358 xPropSet->setPropertyValue(
"FillStyle", css::uno::Any(pStyleItem->GetValue()));
359 xPropSet->setPropertyValue(
"FillColor", css::uno::Any(rColorItem.GetValue()));
366 css::uno::Reference<css::beans::XPropertySet> xPropSet = getPropSet(
mxModel);
371 xPropSet->setPropertyValue(
"FillStyle", css::uno::Any(pStyleItem->GetValue()));
374 css::uno::Any aGradientVal;
377 xPropSet->setPropertyValue(
"FillGradientName", css::uno::Any(aNewName));
384 css::uno::Reference<css::beans::XPropertySet> xPropSet = getPropSet(
mxModel);
389 xPropSet->setPropertyValue(
"FillStyle", css::uno::Any(pStyleItem->GetValue()));
390 xPropSet->setPropertyValue(
"FillHatchName", css::uno::Any(rHatchItem.GetValue()));
397 css::uno::Reference<css::beans::XPropertySet> xPropSet = getPropSet(
mxModel);
402 xPropSet->setPropertyValue(
"FillStyle", css::uno::Any(pStyleItem->GetValue()));
404 css::uno::Any aBitmap;
406 const OUString& aPreferredName = rBitmapItem.
GetName();
408 xPropSet->setPropertyValue(
"FillBitmapName", aBitmap);
422 css::uno::Reference<css::beans::XPropertySet> xPropSet = getPropSet(
mxModel);
426 css::uno::Reference<css::beans::XPropertySetInfo> xInfo(xPropSet->getPropertySetInfo());
431 if (xInfo->hasPropertyByName(
"FillStyle"))
433 css::drawing::FillStyle eFillStyle = css::drawing::FillStyle_SOLID;
434 xPropSet->getPropertyValue(
"FillStyle") >>= eFillStyle;
439 if (xInfo->hasPropertyByName(
"FillTransparence"))
441 sal_uInt16 nFillTransparence = 0;
442 xPropSet->getPropertyValue(
"FillTransparence") >>= nFillTransparence;
447 if (xInfo->hasPropertyByName(
"FillGradientName"))
449 OUString aGradientName;
450 xPropSet->getPropertyValue(
"FillGradientName") >>= aGradientName;
455 if (xInfo->hasPropertyByName(
"FillHatchName"))
458 xPropSet->getPropertyValue(
"FillHatchName") >>= aHatchName;
464 if (xInfo->hasPropertyByName(
"FillBitmapName"))
466 OUString aBitmapName;
467 xPropSet->getPropertyValue(
"FillBitmapName") >>= aBitmapName;
470 std::unique_ptr<XFillBitmapItem> pBitmapItem;
482 updateFillBitmap(
false,
true, pBitmapItem ? pBitmapItem.get() : &aBitmapItem);
485 if (xInfo->hasPropertyByName(
"FillTransparenceGradientName"))
487 OUString aFillFloatTransparenceName;
488 xPropSet->getPropertyValue(
"FillTransparenceGradientName") >>= aFillFloatTransparenceName;
495 if (xInfo->hasPropertyByName(
"FillColor"))
497 sal_uInt32 nFillColor = 0;
498 xPropSet->getPropertyValue(
"FillColor") >>= nFillColor;
521 css::uno::Reference<css::view::XSelectionSupplier> oldSelectionSupplier(
522 mxModel->getCurrentController(), css::uno::UNO_QUERY);
523 if (oldSelectionSupplier.is()) {
536 css::uno::Reference<css::view::XSelectionSupplier> xSelectionSupplier(
mxModel->getCurrentController(), css::uno::UNO_QUERY);
537 if (xSelectionSupplier.is())
543 ::chart::ChartModel* pModel =
dynamic_cast<::chart::ChartModel*
>(
xModel.get());
544 assert(!
xModel || pModel);
css::uno::Reference< css::frame::XModel2 > mxModel
OUString const & GetName() const
void SetName(const OUString &rName)
const GraphicObject & GetGraphicObject() const
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
std::unique_ptr< XFillBitmapItem > checkForUniqueItem(SdrModel *pModel) const
void SetEnabled(bool bEnable)
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
const XHatch & GetHatch() const
const OUString & GetName() const
static OUString createClassifiedIdentifier(enum ObjectType eObjectType, std::u16string_view rParticleID)
static css::uno::Reference< css::beans::XPropertySet > getObjectPropertySet(std::u16string_view rObjectCID, const rtl::Reference< ::chart::ChartModel > &xChartDocument)
ObjectType getObjectType() const
Reference< script::XScriptListener > mxListener
OOO_DLLPUBLIC_CHARTTOOLS OUString addGradientUniqueNameToTable(const css::uno::Any &rValue, const css::uno::Reference< css::lang::XMultiServiceFactory > &xFact, const OUString &rPreferredName)
adds a gradient with a unique name to the gradient obtained by the given factory.
OOO_DLLPUBLIC_CHARTTOOLS OUString addBitmapUniqueNameToTable(const css::uno::Any &rValue, const css::uno::Reference< css::lang::XMultiServiceFactory > &xFact, const OUString &rPreferredName)
adds a bitmap with a unique name to the gradient obtained by the given factory.
OOO_DLLPUBLIC_CHARTTOOLS OUString addTransparencyGradientUniqueNameToTable(const css::uno::Any &rValue, const css::uno::Reference< css::lang::XMultiServiceFactory > &xFact, const OUString &rPreferredName)
adds a transparency gradient with a unique name to the gradient obtained by the given factory.
Reference< XController > xController
Reference< XModel > xModel