incubator-ooo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fernand Vanrie <...@pmgroup.be>
Subject Re: Convert table from absolute width to relative
Date Thu, 16 Feb 2012 17:55:53 GMT
Matheus

Get the ViewCursor

oViewCursor = oDocument.getCurrentController().getViewCursor()

this object can tell you nearly everyting,  about the the page and the 
evnvolved pagestyle where you can find the width etc..

Hope it helps

Fernand
> Hi,
>
> I need to programmatically convert some documents which contains some
> table with absolute width to relative sizes. The purpose of that change
> is that when converted to HTML the width of that absolute table is also
> fixed, and that leads to scrollbars appearing when document is viewed in
> small screen devices.
>
> I don't know a better way to do that, so I thought on creating an event
> handler to do these changes during the onSave and onSaveAs event. The
> event is being caught, but I'm in doubt on how to get the necessary info
> to do these changes.
>
> More specifically, I've create a procedure to loop into all tables, and
> test if it is relative width or not. If its has absolute width, I want
> to change sizes. There are a lot of details involved, but in the
> simplest case, I just need to get the fraction of page width that the
> table occupies.
>
> So that's my situation: if have a XTextTable, how can I get the page
> width that contains that table? I tried to call getAnchor() without
> success, as its said the TextTable docs that "(...) the anchor of the
> actual implementation for text tables does not have a position in the
> text. Thus that anchor can not be used for some operation like
> XTextContent::attach or XText::insertTextContent or other function that
> require the object to have a position in the text. (...)"
>
> Does any of you can help me in solving that? Or is there another way to
> do these transformations?
>
> Best regards,
> Matheus
>


Mime
View raw message