Bug 85451 - Draw text box content is invisible when TextContourFrame property is true
Summary: Draw text box content is invisible when TextContourFrame property is true
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
(earliest affected) release
Hardware: All All
: medium major
Assignee: Not Assigned
Whiteboard: target:4.4.0 target:4.3.6
Keywords: bibisected, bisected, regression
Depends on:
Reported: 2014-10-25 17:08 UTC by Gilles Gravier
Modified: 2015-12-17 08:37 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:

The file is the document that exhibits the incorrect behavior (242.71 KB, application/vnd.oasis.opendocument.spreadsheet)
2014-10-25 17:08 UTC, Gilles Gravier
Minimal reproducer (10.79 KB, application/vnd.oasis.opendocument.text)
2014-11-09 21:18 UTC, Andras Timar

Note You need to log in before you can comment on or make changes to this bug.
Description Gilles Gravier 2014-10-25 17:08:41 UTC
Created attachment 108409 [details]
The file is the document that exhibits the incorrect behavior

Open the attached spreadsheet in LibreOffice 4.3.2 or 4.3.3rc

Under the title "Feuille de Personnage" is a big white rectangle. This is incorrect.

Open the same file with OpenOffice 4.1.1 and that big white rectangle is displayed properly with its contents.

It used to work with previous versions of LibreOffice.

Serious regression.

Comment 1 m_a_riosv 2014-10-25 17:47:59 UTC
Hi @Gilles, thanks for reporting.

Build ID: 7d55112667c8fcddb67bc3803796b46c93aa56b0
Build ID: 0a82645c360158f9cc0fdabe2a52f1ff8f981bed
TinderBox: Win-x86@39, Branch:master, Time: 2014-10-24_06:59:23

Seems works with:
Build ID: da2accb41f902c82436075dc9d0b85a6d7588fa1
TinderBox: Win-x86@42, Branch:libreoffice-4-2, Time: 2014-10-15_23:40:10
Comment 2 Buovjaga 2014-11-04 15:56:38 UTC
Confirmed that the stuff below Feuille de Personnage is hidden behind white.

Build ID: Arch Linux build-1
Comment 3 Xisco Faulí 2014-11-05 13:50:46 UTC
 206506b5a81e183bfab960d6abe62489c8438daf is the first bad commit
commit 206506b5a81e183bfab960d6abe62489c8438daf
Author: Bjoern Michaelsen <bjoern.michaelsen@canonical.com>
Date:   Sun May 11 08:41:16 2014 +0000

    commit 47811d4cf17688b2db5910e2cd500143137fd6f1
    Author:     Stephan Bergmann <sbergman@redhat.com>
    AuthorDate: Mon Feb 3 14:14:26 2014 +0100
    Commit:     Stephan Bergmann <sbergman@redhat.com>
    CommitDate: Mon Feb 3 16:05:11 2014 +0100
        Remove SC_DLLPRIVATE -> SAL_DLLPRIVATE indirection
        Change-Id: I1360a96ebe33bd6d70ac7728844c4ba1137e51ab

:100644 100644 5b474b38f50966351e24f947438fe5c5069517f7 3d3c3e89bc6ce55729a3f7156051928798021819 M	ccache.log
:100644 100644 a3fd0980c9745a4955053f7379284d92ac762c9e 94f6b2d78099d51d4c1555084912fc785cbb1e86 M	commitmsg
:100644 100644 250e6ec1dd90fc56a556820e4224a2172bbaf996 91055e0134afbd67da71b742d1b94f10a8f1a722 M	make.log
:040000 040000 155c2bf3bfc627df46fd3d59458da97e6b0356dc e3e391c3d3688aec478adb107e42ed4a144f0cab M	opt

# bad: [423a84c4f7068853974887d98442bc2a2d0cc91b] source-hash-c15927f20d4727c3b8de68497b6949e72f9e6e9e
# good: [65fd30f5cb4cdd37995a33420ed8273c0a29bf00] source-hash-d6cde02dbce8c28c6af836e2dc1120f8a6ef9932
git bisect start 'latest' 'oldest'
# good: [e02439a3d6297a1f5334fa558ddec5ef4212c574] source-hash-6b8393474974d2af7a2cb3c47b3d5c081b550bdb
git bisect good e02439a3d6297a1f5334fa558ddec5ef4212c574
# good: [4850941efe43ae800be5c76e1102ab80ac2c085d] source-hash-980a6e552502f02f12c15bfb1c9f8e6269499f4b
git bisect good 4850941efe43ae800be5c76e1102ab80ac2c085d
# bad: [a900e72b6357882284c5955bdf939bf14269f5fb] source-hash-dd1050b182260a26a1d0ba6d0ef3a6fecc3f4e07
git bisect bad a900e72b6357882284c5955bdf939bf14269f5fb
# bad: [e1d0365cd2b073a859f59ad0a4584385a66dc611] source-hash-2eea96c702a44ab009743b0d22ef639127f0b57b
git bisect bad e1d0365cd2b073a859f59ad0a4584385a66dc611
# good: [98a55bf95f3ec29298751fd8fba76dd2236dce43] source-hash-58dfc97ca697875c36b7ddf14f5505a93d7b9cf8
git bisect good 98a55bf95f3ec29298751fd8fba76dd2236dce43
# good: [1f32fb58159d7f43a4bcb838765261d5274cbf38] source-hash-4a169e4203c10ec8f76b9bcb33882c82b65c7bab
git bisect good 1f32fb58159d7f43a4bcb838765261d5274cbf38
# bad: [e8547c17def5e45d1a9ff2cf5eb28b142b3daca0] source-hash-53ca207a700c9501e76c7770f6b1e3af89edd630
git bisect bad e8547c17def5e45d1a9ff2cf5eb28b142b3daca0
# skip: [7055a406c05b6da54733841dd0174c91d35f8652] source-hash-f985e3add3870c1dee7fe88d37388281a333403a
git bisect skip 7055a406c05b6da54733841dd0174c91d35f8652
# bad: [90ec074ec2d27d01be33827b8143f231c5d9776a] source-hash-202d721e3cb35eb4402882dbe4b81ceccd9f4e0a
git bisect bad 90ec074ec2d27d01be33827b8143f231c5d9776a
# bad: [206506b5a81e183bfab960d6abe62489c8438daf] source-hash-47811d4cf17688b2db5910e2cd500143137fd6f1
git bisect bad 206506b5a81e183bfab960d6abe62489c8438daf
# first bad commit: [206506b5a81e183bfab960d6abe62489c8438daf] source-hash-47811d4cf17688b2db5910e2cd500143137fd6f1
Comment 4 Andras Timar 2014-11-06 21:09:23 UTC
 3cbfcee36dd16e451d76c561eaaaee0ff29b01a5 is the first bad commit
commit 3cbfcee36dd16e451d76c561eaaaee0ff29b01a5
Author: Norbert Thiebaud <nthiebaud@gmail.com>
Date:   Sun Feb 2 22:16:48 2014 -0600

    xub_StrLen and tools/string.hxx final straw
    Thre is still some 0xffff limit left and possibly some
    less than gracefully handled overflow/error cases
    Change-Id: I00957ee3a30b02f73918ea49d7353056263dc638
    Reviewed-on: https://gerrit.libreoffice.org/7787
    Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
    Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
Comment 5 Andras Timar 2014-11-07 10:26:24 UTC
Unfortunately the first bad commit is 8668 lines long. I debugged further.

In bugdoc, the invisible text is not in cells but in text boxes. These text boxes have the attribute draw:fit-to-contour="true". It is not possible to change this attribute from UI, because the corresponding Adjust to contour checkbox is disabled on Text page (rigth click on the textbox, select Text from the popup menu). When I deleted this attribute from .ods file, text became visible.
Comment 6 Gilles Gravier 2014-11-07 11:14:27 UTC
So this is a bug in interpreting : draw:fit-to-contour="true"

Understanding that setting it to "false" removes the issue is good.

But fixing this shouldn't require setting it to "false" since OpenOffice handles draw:fit-to-contour="true" properly. It's a regression.
Comment 7 Andras Timar 2014-11-09 21:18:22 UTC
Created attachment 109173 [details]
Minimal reproducer

The attached bugdoc may help debugging, it toggles the TextContourFrame property with a push button (macros must be enabled). 

I debugged the problem up to the point that in svx/source/sdr/primitive2d/sdrdecompositiontools.cxx createTextPrimitive() function creates a new SdrContourTextPrimitive2D object when TextContourFrame property is true, and a new SdrBlockTextPrimitive2D object when TextContourFrame property is false. Maybe we can go further this way. Or we could find the regression in the first bad commit. Or we could disable TextContourFrame property of this type of text box on import, because UI does not allow setting this property anyway.

I stop working on this for a while.
Comment 8 Commit Notification 2015-01-14 22:17:07 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-4-4":


fdo#85451 classic draw rectangles "fit to contour" utterly broken

It will be available in 4.4.1.

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:
Affected users are encouraged to test the fix and report feedback.
Comment 9 Andras Timar 2015-01-14 22:48:52 UTC
It's also fixed in libreoffice-4-3 branch: bd84dcc53f46d9aecf10224af7210c598646a19e
Comment 10 Robinson Tryon (qubit) 2015-12-17 08:37:38 UTC
Migrating Whiteboard tags to Keywords: (bibisected)