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. 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

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?

Thanks for your help,
Alan

Caolan McNamara wrote:

On Tue, 2006-11-07 at 08:43 +0200, Alan Yaniger wrote:
Hi list-members,

When I export a document to MS Word format, the style for footnotes is always left-aligned, even for RTL footnotes. Where could I change the alignment of the exported style for RTL footnotes?

The footnote paragraph style itself should be exported like any other
style, in wrtw8sty.cxx WW8WrtStyle::WW8WrtStyle where the styles are
collected and exported. So for a style which is r2l then
OutWW8_SvxFrameDirection should be called for that style and l2r or r2l
set (sprm 0x2441)

The problem *possibly* arises because most of the defaults for these
styles in writer are "use super-ordinate" direction, and word doesn't
have this setting, so we resolve at export time the real direction of
each instance of a paragraph using such a style and set that manually
for each one. But at style-time we have no idea which direction to use
and set no direction on the actual style. So if the style in writer is
"use super-ordinate" then no direction should be exported on the style
itself, but individually on the paragraphs that use it.

Assuming the super-ordinate case...

The direction is supposed to be determined in wrtw8nds.cxx at
WW8_SwAttrIter::WW8_SwAttrIter where we find the direction of the
paragraph (SwTxtNode) we are exporting.

OutWW8_SwTxtNode which exports a paragraph creates such an attribute
iterator, and checks to see if the current paragraph has no hardcoded
direction property and adds such a property if needed to the propertyset
to be exported (pTmpSet) and the whole bundle (hopefully with either a
pre-existing direction property, or the new calculated one) is exported
at the rWW8Wrt.Out_SfxItemSet line.

So, OutWW8_SwTxtNode, the test for direction and the few lines around
the "If a given para is using the FRMDIR_ENVIRONMENT direction we cannot export that..." comment might be helpful to see what's going on.

It might be the case that footnotes themselves are being handled
sufficiently differently from body text paragraphs that they're falling
through some trapdoor which either skips setting the direction on the
exported paragraph or some silly bug where the exporter took the wrong
direction.

C.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to