I am copying a text frame from one Impress presentation to another, when suddenly I realized a problem with the alignment of the text inside the frame. So I made a file demonstrating the problem: it is posted as test.odp ; and also exported as Flat XML odp format: test-f.odp (NB: .fodp
is currently not allowed for upload, see Add fodp, fodt … to allowed upload filename extensions for Ask.LibO - so after downloading test-f.odp
, rename it to test.fodp
; for more on Flat XML, see Exporting an office document as single, flat, plain-text XML file?)
Anyways, the problem can be seen more clearly here (note: composited image in Gimp - otherwise, if you select two textframes in Impress, Impress will not show their bounding boxes individually, just the total):
Note that the “This aligns center” text to the right (which was added to the .odp manually through the Text tool), aligns center by using the whole width of the text frame, as expected; however, the “This text here \n Will not align center” text to the left (which was pasted from another .odp, which may have previously had content pasted or converted from PowerPoint), while it does align center according to the width of the longest line of text - it does not align according to the text frame width!
So, I thought, that must be some sort of a problematic style entry, so I tried right-clicking on the text frame to the left, and choosing “Edit Style…”, and what I get is this:
… and I find this absolutely overwhelming - in terms of easily finding exactly what is the problem. To make it worse, LO uses “modal dialogs”, so I cannot open another “Edit Style” properties for the other text frame, so as to compare the styles to the correctly formatted text frame. (and I’m pretty sure soffice
will not allow being ran in two instances, nor will it allow two Impress windows for the same document).
So my questions are:
- Is there a GUI tool - either inside LibreOffice or standalone, which could accept references to document elements/objects as inputs, and show a side-by-side comparison of their styles?
- Why does the problematic alignment happen, and how can I fix it using the LibreOffice GUI?
I guess the only other thing I can do, is compare the raw XML of the elements (hence the export to “Flat XML” - besides being a single file, it is also “pretty-printed” with indented lines, unlike content.xml
in an .odp
zip file); and try figuring out from there where the problem is…
Edit: results of analysis of XML in .fodp
file; the text frames are (added linebreaks manually, for easier reading):
<draw:frame draw:style-name="gr3" draw:text-style-name="P3"
draw:layer="layout" svg:width="7.197cm" svg:height="1.361cm"
draw:transform="rotate (-1.5707963267949) translate (8.473cm 12.107cm)"
>
<draw:text-box>
<text:p text:style-name="P4">
<text:span text:style-name="T1">This text here </text:span>
</text:p>
<text:p text:style-name="P4">
<text:span text:style-name="T2">Will not align center</text:span>
</text:p>
</draw:text-box>
</draw:frame>
<draw:frame draw:style-name="gr4" draw:text-style-name="P4"
draw:layer="layout" svg:width="7.112cm" svg:height="0.962cm"
svg:x="14.478cm" svg:y="13.97cm"
>
<draw:text-box>
<text:p text:style-name="P4">This aligns center</text:p>
</draw:text-box>
</draw:frame>
So, they both use style P4
as text-style, and styles gr3
and gr4
as draw styles; here are the corresponding XML snippets:
<style:style style:name="P4" style:family="paragraph">
<style:paragraph-properties fo:text-align="center"/>
</style:style>
<style:style style:name="gr3"
style:family="graphic" style:parent-style-name="standard"
>
<style:graphic-properties
draw:stroke="none" svg:stroke-color="#000000"
draw:fill="none" draw:fill-color="#ffffff"
draw:textarea-horizontal-align="left"
draw:auto-grow-height="true" draw:auto-grow-width="false"
fo:min-height="1.111cm" fo:min-width="4.818cm"/
>
</style:style>
<style:style style:name="gr4"
style:family="graphic" style:parent-style-name="standard"
>
<style:graphic-properties
draw:stroke="none" svg:stroke-color="#000000"
draw:fill="none" draw:fill-color="#ffffff"
draw:auto-grow-height="true" draw:auto-grow-width="false"
fo:max-height="0cm" fo:min-height="0cm"/
>
</style:style>
Style P4
is as expected; and the difference between gr3
and gr4
is:
-
gr3
hasdraw:textarea-horizontal-align="left"
,fo:min-width="4.818cm"
- andfo:min-height="1.111cm"
-
gr4
hasfo:max-height="0cm"
- andfo:min-height="0cm"
So I tried deleting first the fo:min-width
from gr3
, and reloading the .fodp - that didn’t work; then I deleted the most obvious suspect: draw:textarea-horizontal-align="left"
from gr3
- and that finally worked!
Ok - but notice how tedious this process is; so - how would I do this from the Impress GUI? Where would I find this draw:textarea-horizontal-align
in there ??