On Tue, 2006-11-07 at 13:12 +0200, Alan Yaniger wrote: > Hi Caolan, > > Thanks for your reply. A few days ago, I posted a patch to Issue 58982 > which checks the paragraph direction in the way you suggested, only for > the purpose of fixing a different bug, namely that RTL numbering was > exported with the numbers outside of the margin. (I fixed the same bug > elsewhere for footnotes, by setting the footnote's LRSpace.FirstLineOfst > to 0. ) > > My situation now is that when I export a document, the footnotes > themselves look fine. My problems begin if try to add another footnote > to the exported file, either in Word or if I import it back to OOo. > There are two issues here in the "Footnote" style: one is the text > direction, and the second is the text alignment. I have a question about > each: > > 1) > Regarding text direction: > Let's say I export to DOC format an OOo file with a footnote. Then I > reload the exported file, and add a footnote. The new footnote number > appears on the right, as it should, but when I type text, the text is to > the right of the number instead of to the left, and the number gets > pushed to the left as I continue to type. This is not right. I used the > information you gave me to fix this as follows: > > In OutWW8_SvxFrameDirection, there is a check for FRMDIR_ENVIRONMENT, > after which the text direction is set, as you described. There I changed : > nDir = FRMDIR_HORI_LEFT_TOP; //what else can we do :-( > to: > nDir = FRMDIR_HORI_RIGHT_TOP; > > and the text direction was correctly exported as RTL. I'm not sure that > this is the way I should fix it, though.
That would be... else if (rWrtWW8.pOutFmtNode->ISA(SwTxtFmtColl)) nDir = FRMDIR_HORI_LEFT_TOP; i.e. on exporting a style which has a FRMDIR_ENVIRONMENT set for direction. This *should* happen when exporting the style itself, not for the paragraph that uses it, so we don't want to touch this, as we don't know the proper direction to use an environment direction when we are exporting a style, as there isn't an environment yet. > Is it possible for me to check > if this is a footnote and if I am in RTL context, like the other checks > there: > if (rWrtWW8.bOutFlyFrmAttrs) //frame > else if (rWrtWW8.pOutFmtNode->ISA(SwCntntNode)) //pagagraph I'm rusty here, but IIRC what we want to happen is that when we get to exporting the content of a footnote or any paragraph, that we detect that this paragraph (due to inheriting from a style) still has a FRMDIR_ENVIRONMENT direction setting, and force a LEFT or a RIGHT on (a copy of) its attribute set and then export this, which should cause OutWW8_SvxFrameDirection to be called for this paragraph specifically, and in theory, this time the rWrtWW8.pOutFmtNode->ISA(SwCntntNode will be true and we will export a direction property for this paragraph. So maybe a little test on writing some normal text into the body of an empty document and set that paragraph to the "footnote" style and compare what happens between a) when that footnote style paragraph in the main text area hits OutWW8_SwTxtNode and the FRMDIR_ENVIRONMENT test there b) and a footnote in the footnote area to see if the existing "force a direction on a paragraph" code is working when the footnote style using paragraph is in the main text vs in the footnote area. > 2) Regarding text alignment: > In my OOo document, the text alignment of the footnote style is "Right". > When I export the file to DOC format, it stays "Right". Then if I add > another footnote, save the file (still in DOC format) and reload it, the > footnote style has the alignment as "Left". The old footnote from the > original document is still right-aligned, but the new footnote that I > added after re-loading is now aligned to the left. Where would I look to > see how the alignment (not text direction) is being exported? Sounds nasty, and I'm not sure what exactly may have gone wrong here.But OutWW8_SvxAdjust in ww8atr.cxx is this left/right adjustment. Here we (bit of guesswork) reckon that we have the legacy adjust values for non CTL aware .doc implementations, and a parallel set of CTL ones, Again you can see the same sort of "if content and environmenal direction find real direction, but if this is a style give up and force it on content that uses it" pain. SwWW8Writer::Out_SfxItemSet which outputs a property set has a similar to the previously discussed paragraph direction test to take the result of that para direction test and force an adjust property output is a direction property output was also forced C. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
