Bug 96391 - Text wrong layouted after pptx import
Summary: Text wrong layouted after pptx import
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Impress (show other bugs)
Version:
(earliest affected)
5.1.0.0.alpha1
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-10 16:40 UTC by Armin Le Grand
Modified: 2017-11-08 15:39 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Bugdoc for demonstration - load and see (30.89 KB, application/vnd.openxmlformats-officedocument.presentationml.presentation)
2015-12-10 16:40 UTC, Armin Le Grand
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Armin Le Grand 2015-12-10 16:40:20 UTC
Created attachment 121205 [details]
Bugdoc for demonstration - load and see

For text fields from PowerPoint that are too small for text (format text box to not autmatically resize and type much text) the imported text is wrong. To reproduce:

- import attacted bugdoc
-> the text should be inside the added lines

Office is already capable of text boxes which have 'overhanging' text, that was already added in the past. Still, the import is wrong in this case.

Selecting the text box (press TAB) and choosing 'Format/Text...' from menu (or context menu) and changing anchor to top-left cures this. There seems to be an error in the importer for this cases with text anchoring.
Comment 1 Samuel Mehrbrodt (allotropia) 2015-12-11 07:39:26 UTC
Confirmed with recent master.
Comment 2 Armin Le Grand 2015-12-14 10:40:37 UTC
Taking a look. As first, I saw that in curent versions the important format/text slot and settings is not editable in impress, wrote tdf#96478 for it.
Taking a look at the import...
Comment 3 Armin Le Grand 2015-12-14 13:52:14 UTC
All has to do with SvxAdjustItem, but not sure yet what happens. That item is already extra-handled on many places. In the EditEngine ItemPool (where it lives for SfxModels) it is initialized to SVX_ADJUST_LEFT (see GlobalEditData::GetDefItems()), but there is TextProperties::ForceDefaultAttributes() which sets SvxAdjustItem for all non-text frames to SVX_ADJUST_CENTER as hard attribute, so it will not react on style settings.
Comment 4 Armin Le Grand 2015-12-14 16:29:20 UTC
Basic problem is the different defaultfor alignment of non-growing text boxes (and it is not possible to create those CustomShape TextBoxes in LO using the UI). LO uses Top-Center while PPT uses Top-Left. At import of the token 'AnchorCtr' the importer sets TextHorizontalAdjust_CENTER. That token is only set if not top-left in PPT.
This means that we need to set TextHorizontalAdjust_LEFT when that token is not set and nothing when set (center is already the default). That works well at import. Changing our default is not a good idea since that would lead to problems with our own existing files.
Additionally that needs to be taken into account at save time, checking where to do that...
Comment 5 Armin Le Grand 2015-12-14 17:13:07 UTC
Checked, exportneeds no change. Import needs to set either/or. Had a pptx which needed repair after re-export, removed my changes again and checked, this also happens without my changes. Looking in some details...
Comment 6 Armin Le Grand 2015-12-15 09:36:49 UTC
Cannot do as proposed, that influences text boxes which have the flag for adapting size not switched off. Checking deeper for differences in pptx.
Comment 7 QA Administrators 2017-01-03 19:49:55 UTC Comment hidden (obsolete)
Comment 8 Xisco Faulí 2017-11-08 15:39:27 UTC
Bug no longer reproducible in

Version: 6.0.0.0.alpha1+
Build ID: 38a8157d9447134913d88c6c373d99a7aa472857
CPU threads: 4; OS: Linux 4.10; UI render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); Calc: group

Closing as RESOLVED WORKSFORME

[Improvement found by office-interoperability-tools]