Bug 70942 - FILEOPEN: docx shapes imported as square if the shape contain text
Summary: FILEOPEN: docx shapes imported as square if the shape contain text
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
3.6.2.2 release
Hardware: Other All
: medium normal
Assignee: Miklos Vajna
URL:
Whiteboard: target:4.3.0
Keywords:
: 73182 74397 79289 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-10-28 05:33 UTC by Faisal Menawer
Modified: 2014-12-20 21:29 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:


Attachments
test file (18.12 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2013-10-28 05:34 UTC, Faisal Menawer
Details
screen shot from MS (33.32 KB, image/png)
2013-10-28 05:36 UTC, Faisal Menawer
Details
Screenshot with LO 4.3 (21.02.2014) (30.85 KB, image/png)
2014-02-21 15:45 UTC, Alexandr
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Faisal Menawer 2013-10-28 05:33:43 UTC
when writer open docx file contain different shapes that had text
the writer see all the shapes as squares .

step to reproduce:
1- open MS insert different shapes like triangle and put text in it.
2- open the file with writer.


Current behavior :
the shapes will be converted to squares.

Expected behavior:
all the shapes not converted.
Comment 1 Faisal Menawer 2013-10-28 05:34:17 UTC
Created attachment 88204 [details]
test file
Comment 2 Faisal Menawer 2013-10-28 05:36:45 UTC
Created attachment 88205 [details]
screen shot from MS
Comment 3 Jorendc 2013-11-16 00:01:47 UTC
Thanks for reporting.

I can confirm this behavior, tested using Mac OSX 10.9 with LibreOffice Version: 4.2.0.0.alpha1+ Build ID: 868103846b9b32bfecd77c08055fdca69d0265c2
TinderBox: MacOSX-x86@48-TDF, Branch:master, Time: 2013-11-14_23:51:46

Opens correctly using Word for Mac 2011.

Kind regards,
Joren
Comment 4 Jorendc 2013-11-16 00:02:52 UTC
PS: 3.6.2.2 is an outdated version of LibreOffice. Recommended is to use 4.1.3 instead http://www.libreoffice.org/download

See also our release plan https://wiki.documentfoundation.org/ReleasePlan :).

Kind regards,
Joren
Comment 6 Miklos Vajna 2013-12-18 08:53:52 UTC
The mailing list thread linked in comment 5 contains a detailed analysis of the problem; it's possible to solve it, but it's not trivial, either.
Comment 7 Nikhil Walvekar 2014-01-02 05:37:02 UTC
*** Bug 73182 has been marked as a duplicate of this bug. ***
Comment 8 Nikhil Walvekar 2014-01-02 05:40:00 UTC
I was able to render text and also preserve the shape type, but text properties such as text size were lost.
Comment 9 Miklos Vajna 2014-01-02 08:48:22 UTC
That's still something that can be fixed, as mentioned in comment 6, the harder parts come when you have anything that requires a real Writer paragraph, e.g. a field in the shape text, that's currently supported, but will fail if you replace the textframe with a real drawinglayer shape.
Comment 10 Commit Notification 2014-01-13 17:18:10 UTC
Nikhil Walvekar committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=3cf58da99ef152db31fa8378045d4bff041f7ff4

fdo#70942 Preserve original shape type, if shape contains text.



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 11 Alexandr 2014-02-13 16:35:41 UTC
*** Bug 74397 has been marked as a duplicate of this bug. ***
Comment 12 tommy27 2014-02-16 09:37:23 UTC
(In reply to comment #10)
> Nikhil Walvekar committed a patch related to this issue.
> It has been pushed to "master":
> 
> http://cgit.freedesktop.org/libreoffice/core/commit/
> ?id=3cf58da99ef152db31fa8378045d4bff041f7ff4
> 
> fdo#70942 Preserve original shape type, if shape contains text.
> 
> 


bug still reproducible with 4.2.0.4 and 4.3.0.0.alpha0+
Build ID: ecf22894f522374cbdb8196d3bdef88e2fba7af9
TinderBox: Win-x86@39, Branch:master, Time: 2014-02-15_01:01:17

@Nikhil Walvekar
it looks to me that that patch was not effective.
could you please check?
Comment 13 Nikhil Walvekar 2014-02-17 01:39:36 UTC
I will surely check it on latest build.
(In reply to comment #12)
> (In reply to comment #10)
> > Nikhil Walvekar committed a patch related to this issue.
> > It has been pushed to "master":
> > 
> > http://cgit.freedesktop.org/libreoffice/core/commit/
> > ?id=3cf58da99ef152db31fa8378045d4bff041f7ff4
> > 
> > fdo#70942 Preserve original shape type, if shape contains text.
> > 
> > 
> 
> 
> bug still reproducible with 4.2.0.4 and 4.3.0.0.alpha0+
> Build ID: ecf22894f522374cbdb8196d3bdef88e2fba7af9
> TinderBox: Win-x86@39, Branch:master, Time: 2014-02-15_01:01:17
> 
> @Nikhil Walvekar
> it looks to me that that patch was not effective.
> could you please check?
Comment 14 tommy27 2014-02-21 12:41:17 UTC
(In reply to comment #13)
> I will surely check it on latest build.

any news?
Comment 15 Nikhil Walvekar 2014-02-21 13:50:20 UTC
Checked on today's build (libo-master@7E2014-02-20_23.27.43_LibreOfficeDev_4.3.0.0.alpha0_Win_x86) shape types are preserved. I verified on MS 2010, need to check of MS 2007.
Comment 16 Alexandr 2014-02-21 15:45:56 UTC
Created attachment 94526 [details]
Screenshot with LO 4.3 (21.02.2014)

Still reproducible with LibreOffice 4.3.0.0.alpha0+
Build ID: db0222881be20744c071be451d77a7dc4a0dbb56
TinderBox: Linux-rpm_deb-x86_64@46-TDF, Branch:master, Time: 2014-02-21_10:31:05
Comment 17 Miklos Vajna 2014-02-21 16:25:27 UTC
I think the misunderstanding is that what Nikhil says is about *preserving* the shape information, so if you edit a long document, make a small change, and save it back, then when you open the docx again in Word, the shape will be OK.

What Alexandr is testing is how it *looks like* in LO, the above patch didn't touch that in any way. (See comment 5 for info about that part.)
Comment 18 Alexandr 2014-02-25 17:26:42 UTC
Thank you, Miklos, for explanation.
Unfortunately, it seems “preserving” is not working too.

What I do:
1) Open the test document in LibreOffice writer 4.3.0.0.alpha0+
Build ID: db0222881be20744c071be451d77a7dc4a0dbb56
TinderBox: Linux-rpm_deb-x86_64@46-TDF, Branch:master, Time: 2014-02-21_10:31:05
2) write some text
3) save the document
4) open it in MS Word 2007

I see squares instead of shapes.
Comment 19 Miklos Vajna 2014-07-02 09:59:33 UTC
http://cgit.freedesktop.org/libreoffice/core/commit/?id=d379d18666aa42031359ca8eb34b0021960347ae "oox: import WPS shape with text as shape with textbox" (and previous commits) should take care of this: now not only preservation, but full support is there for such shapes.

Note that this is quite a big change, so you need a master daily build to test it, ATM there is no plan to backport it to an earlier version.
Comment 20 Miklos Vajna 2014-09-30 19:07:45 UTC
*** Bug 79289 has been marked as a duplicate of this bug. ***
Comment 21 Mike §chinagl 2014-12-20 21:29:25 UTC
This bug fix comes with LibreOffice 4.4, see release notes at: 
https://wiki.documentfoundation.org/ReleaseNotes/4.4 

Writer shapes can now have a Textbox. It's possible to have complex Writer content and full drawinglayer geometry for a shape at the same time. 

See a graphic of the work:
https://wiki.documentfoundation.org/File:Swtextbox.png