its my first post here - but i have already a lot of reader-experience and learned a lot here
maybe someone can help me with my current question:
I'm generating series of a report written with ooo-writer that contain embedded objecs (diagrams). The sourcedata for the diagrams is a table, which was pasted from a ooo-calc sheet as DDE-link.
With a maco I change the data in calc and store the henc changed writer-doc as PDF. Works fine, but has one problem: How can the "redrawing" of the diagrams be controlled. The main loop containing
- datachange in the calc componente
- a refresh call on all Links in the writer component
- a component.storeToUrl()
is simply faster than the redrawing of all diagrams!
Behavior is unpredictable. Some graphs are updated, some not. The stored files are incorrect. Sometimes graphs aren't updated at all, until i click them and than double-click or change some legend-texts or change the objects size a little.
How is this repaint called from basic? Is there a way (some raised event maybe) to determine if the repaint is already finished?
I have "xrayed" a lot and also tried to find it in the api
Currently, to work around this all, I'm doing: (which is not really g.p.)
Code: Select all
let wdoc be a valid writer component:
Dim EO,currEO,i
'get the collection of embedded objects inside the writer-component
EO=wdoc.EmbeddedObjects
if EO.hasElements() then
while i<EO.count
currEO=EO.getByIndex(i)
Dim aSize: aSize=currEO.ExtendedControlOverEmbeddedObject.getVisualAreaSize(1)
Dim oSize As New com.sun.star.awt.Size
oSize.Width = 1000
oSize.Height = 1000
'change the size in order to force redraw on embedded object
currEO.ExtendedControlOverEmbeddedObject.setVisualAreaSize(1,oSize)
currEO.ExtendedControlOverEmbeddedObject.setVisualAreaSize(1,aSize)
i=i+1
wend
endif
'wait some time and hope the the redraw for all eo's will be REALLY done
wait 2000
'TODO : thats just awfull - a correct method for the repaint would be needet, or at
'least wait until some raised signal is cought....