Problem with reading 'writing-mode' ODF attribute in Impress
Regina Henschel
rb.henschel at t-online.de
Mon Aug 29 10:25:08 UTC 2022
Hi Miklos,
I think I made some progress during the weekend.
Miklos Vajna schrieb am 29.08.2022 um 09:28:
> Hi Regina,
>
> On Fri, Aug 26, 2022 at 10:41:06AM +0200, Regina Henschel wrote:
>>> The import side is easier, simply the property map has 2 entries and we
>>> read all enum values from both namespaces.
>>
>> The import part is the problem. loext:writing-mode="bt-lr" is not read, when
>> it is used for a shape. When it is used for a frame, there is no problem.
>>
>> Which "property map" do you mean?
>
> E.g. the one for Writer TextFrames:
>
> https://github.com/libreoffice/core/blob/95aea41eb9fbb99452097e5b36f09b8782c8dfff/xmloff/source/text/txtprmap.cxx#L871
That one I have looked for examples.
>
>> Problem is, that style:writing-mode="tb-lr" (OOXML vert="eaVert") and
>> style:writing-mode="tb-lr" (OOXML vert="mongolianVert") are correctly loaded
>> into 'WritingMode' API-attribute, but loext:writing-mode="bt-lr" (OOXML
>> vert="vert270") and my new loext:writing-mode="tb-rl90" (OOXML vert="vert")
>> are not loaded. And I have no clue where they are lost.
>
> You could try to see which C++ class implements the setPropertyValue()
> member function handling your WritingMode.
I had done that and found that is was too late in the process and the
error happens earlier.
In the meantime I have learned, that the property map needs two entries,
one for XML_NAMESPACE_STYLE and one for XML_NAMESPACE_LO_EXT.
So I had added this to aXMLSDProperties[]:
GMAPV( "WritingMode", XML_NAMESPACE_LO_EXT, XML_WRITING_MODE,
XML_SD_TYPE_WRITINGMODE2|MID_FLAG_NO_PROPERTY_EXPORT, CTF_WRITINGMODE,
SvtSaveOptions::ODFSVER_FUTURE_EXTENDED),
But that produces the error, that the text direction of Frames is not
read correctly. Your unit test for bt-lr fails as you can see in Gerrit.
Now I use the entry
{"WritingMode", XML_NAMESPACE_LO_EXT, XML_WRITING_MODE,
XML_SD_TYPE_WRITINGMODE2|XML_TYPE_PROP_GRAPHIC, 0,
SvtSaveOptions::ODFSVER_FUTURE_EXTENDED, true},
That seems to work so that the value of WritingMode attribute is correct.
I need to rebase and update the build and run checks. That takes some
time. Then I will upload a new version to Gerrit.
Thank you for thinking about the problem.
Kind regards,
Regina
More information about the LibreOffice
mailing list