Bug 148818 - FILEOPEN: text is missing
Summary: FILEOPEN: text is missing
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Impress (show other bugs)
Version:
(earliest affected)
7.4.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Hossein
URL:
Whiteboard: target:7.4.0
Keywords: bibisected, bisected, regression
Depends on:
Blocks: OOXML-SmartArt
  Show dependency treegraph
 
Reported: 2022-04-27 11:36 UTC by Xisco Faulí
Modified: 2022-05-18 19:48 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Comparison LibreOffice 7.4 master and PP 2016 (47.28 KB, image/png)
2022-04-27 11:36 UTC, Xisco Faulí
Details
Another file affected (31.62 KB, application/vnd.oasis.opendocument.presentation)
2022-05-04 11:36 UTC, Xisco Faulí
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Xisco Faulí 2022-04-27 11:36:20 UTC
Created attachment 179808 [details]
Comparison LibreOffice 7.4 master and PP 2016

This is a follow-up of bug 148665 that I found while creating the unittest

1. Open attachment 179734 [details] from bug 148735

-> Text 'Fufufu' is missing. See comparison
Comment 1 Xisco Faulí 2022-04-27 11:37:23 UTC
Regression introduced by:

author	Szymon Kłos <szymon.klos@collabora.com>	2022-02-23 11:18:59 +0100
committer	Szymon Kłos <szymon.klos@collabora.com>	2022-02-24 11:36:56 +0100
commit cf2449aac0141711a7610d67f7c50cd108e12443 (patch)
tree 680d11518c093a4e0730ad3f3e013cf8a67b4c91
parent 76e11015a877da0eee21bb97b84a0f17bce41760 (diff)
tdf#72776 Allow text removal in the shapes

Bisected with: bibisect-linux64-7.4

Adding Cc: to Szymon Kłos
Comment 2 Xisco Faulí 2022-04-27 11:55:57 UTC
The issue is fixed if '&& mpOutliner->GetParagraphCount() != 2)' is removed in svx/source/unodraw/unoshtxt.cxx:778
Comment 3 Hossein 2022-04-28 06:35:36 UTC
(In reply to Xisco Faulí from comment #2)
> The issue is fixed if '&& mpOutliner->GetParagraphCount() != 2)' is removed
> in svx/source/unodraw/unoshtxt.cxx:778
Good starting point.

But this change actually fails to pass checks: (patch set 1)

tdf#148818 Fix missing text in shapes
https://gerrit.libreoffice.org/c/core/+/133527

If you load this file: sd/qa/unit/data/odp/shapes-test.odp
in page 3, the rightmost shape (a flower like shape) is displayed incorrectly with a too long height. When trying to type a word over the shape, it then goes back to the correct shape.

In patch set 2, I have negated the condition to provide a better explanation of what the condition should be. Checked first paragraph to be of zero length if the paragraph count is 1 (like before), and also checked both the first and second paragraph to be of zero length if the paragraph count is 2.

This is the new conditional sentence:

if ( (mpOutliner->GetParagraphCount() == 1 &&
        mpOutliner->GetEditEngine().GetTextLen( 0 ) == 0 )
  || (mpOutliner->GetParagraphCount() == 2
        && mpOutliner->GetEditEngine().GetTextLen( 0 ) == 0
        && mpOutliner->GetEditEngine().GetTextLen( 1 ) == 0) )
{
    ...
}
else
{
    ...
}

I will try to write a generalized solution not limited to paragraph count of 1 and 2, to see if it works.
Comment 4 Xisco Faulí 2022-05-04 09:32:15 UTC
attachment 156608 [details] from bug 129430 is also affected by this issue. The slide is completely blank, while it should have text.
Comment 5 Xisco Faulí 2022-05-04 10:42:00 UTC
(In reply to Xisco Faulí from comment #4)
> attachment 156608 [details] from bug 129430 is also affected by this issue.
> The slide is completely blank, while it should have text.

not reproducible with Hossein's commit in place.
Comment 6 Xisco Faulí 2022-05-04 11:36:00 UTC
Created attachment 179918 [details]
Another file affected
Comment 7 Commit Notification 2022-05-05 15:25:30 UTC
Hossein committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/759792e40aceb17a621c37ed725d1e998acbd30d

tdf#148818 Fix missing text in boxes with empty first paragraph

It will be available in 7.4.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 8 BogdanB 2022-05-18 19:48:26 UTC
It's ok. Fufufu is here. ;)
Version: 7.4.0.0.alpha1+ / LibreOffice Community
Build ID: 75f7e057039aaa49558e22d18cad651d11589da9
CPU threads: 16; OS: Linux 5.13; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded