I try to find a way to disable buttons ( items ) from the toolbar using the C++ sdk. Between the red lines are items that I may want to remove/hide. I've looked at this topic and I think it's gonna be similar.
For now I have something like this :
Code: Select all
Reference<XLayoutManager> xLayoutManager;
{
Reference< XPropertySet > xPropSet(xFrame, UNO_QUERY);
xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("LayoutManager"))) >>= xLayoutManager;
}
Sequence<Reference<XUIElement>> elements = xLayoutManager->getElements();
for (auto & e : elements)
{
OUString url = e.get()->getResourceURL();
if (url == "private:resource/toolbar/standardbar")
{
Reference<css::drawing::framework::XToolBar> bar(e, UNO_QUERY_THROW);
}
Thanks in advance !