Setting data in Writer chart from Basic
Jan Rheinländer
jrheinlaender at gmx.de
Sun Jan 31 11:23:09 PST 2016
Hi,
something like this:
set doc = thisComponent
set ctrl = thisComponent.CurrentController
xChart = ctrl.getModel().getEmbeddedObjects.getByName("Objekt2")
xChart.ExtendedControlOverEmbeddedObject.changeState(0)
xChart.ExtendedControlOverEmbeddedObject.changeState(1)
xChart.ExtendedControlOverEmbeddedObject.changeState(3)
xChart.ExtendedControlOverEmbeddedObject.changeState(1)
You can look up the numbers for the states in the
com::sun::star::embed::EmbedStates constant group
Regards,
Jan
Am 31.01.2016 um 13:19 schrieb sos:
> Did you tran
>
>
>
> Sent from my Samsung Galaxy smartphone.
> Did you translate the solution into basic code?
>
> Hi Fernand,
>
> thanks for the ideas. Sadly nothing you or anybody else posted helped.
> Finally I found this hack (here xChart has type Reference< XTextContent
> > xChart):
>
> Reference < XEmbeddedObjectSupplier2 >xEOS2(xChart, UNO_QUERY_THROW);
> Reference < XEmbeddedObject >
> xEmbObj(xEOS2->getExtendedControlOverEmbeddedObject());
>
> if (xEmbObj->getCurrentState() ==
> com::sun::star::embed::EmbedStates::LOADED)
> xEmbObj->changeState( com::sun::star::embed::EmbedStates::RUNNING);
> if (xEmbObj->getCurrentState() ==
> com::sun::star::embed::EmbedStates::RUNNING)
> xEmbObj->changeState(
> com::sun::star::embed::EmbedStates::INPLACE_ACTIVE);
> if (xEmbObj->getCurrentState() ==
> com::sun::star::embed::EmbedStates::INPLACE_ACTIVE)
> xEmbObj->changeState( com::sun::star::embed::EmbedStates::RUNNING);
>
> which works on Windows. On Linux this works better:
>
> Reference < XEmbeddedObjectSupplier > xEOS(xChart, UNO_QUERY_THROW);
> Reference < ::com::sun::star::chart::XChartDocument >
> cDoc(xEOS->getEmbeddedObject(), UNO_QUERY_THROW);
>
> Reference< XPropertySet > dProperties(cDoc->getDiagram(),
> UNO_QUERY_THROW);
> Any type = dProperties->getPropertyValue(OU("SplineType"));
> dProperties->setPropertyValue(OU("SplineType"), makeAny(sal_uInt32(0)));
> dProperties->setPropertyValue(OU("SplineType"), makeAny(sal_uInt32(1)));
> dProperties->setPropertyValue(OU("SplineType"), type);
>
> Regards,
> Jan
>
> _______________________________________________
> LibreOffice mailing list
> LibreOffice at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/libreoffice
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20160131/9421cd3c/attachment.html>
More information about the LibreOffice
mailing list