Bug 95927 - Search for format does not work
Summary: Search for format does not work
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
3.5.7.2 release
Hardware: All All
: low minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected
: 103400 105725 111977 122197 126338 (view as bug list)
Depends on:
Blocks: Find-Search
  Show dependency treegraph
 
Reported: 2015-11-19 11:10 UTC by sm8ps
Modified: 2020-10-22 12:46 UTC (History)
9 users (show)

See Also:
Crash report or crash signature:


Attachments
First test case: text-only; all words "gubergren" manually formatted as italic (28.21 KB, application/vnd.oasis.opendocument.text)
2015-11-19 11:10 UTC, sm8ps
Details
Test case 2: text-only; no styles; some words manually formatted as italic (56.58 KB, application/vnd.oasis.opendocument.text)
2015-11-19 11:11 UTC, sm8ps
Details
testcase search manual page break (25.96 KB, application/vnd.oasis.opendocument.text)
2016-03-28 12:21 UTC, Heinrich Hartl
Details

Note You need to log in before you can comment on or make changes to this bug.
Description sm8ps 2015-11-19 11:10:07 UTC
Created attachment 120656 [details]
First test case: text-only; all words "gubergren" manually formatted as italic

Searching for italic format does not work.

First test case:

1. The attached document 'Lorem Ipsum, italic manually.odt' contains a simple Lorem Ipsum created on LO 3.5.7.2 without any styles. The only change made is that I searched for the word "gubergren" and *manually* formatted all of them italic.

2. Searching for all italic formats (via Edit> Find&Replace...; More Options> Format> Font: Style = Italic; Find All) results in the message "Search key not found."

Expected result is to find all appearances of the word "gubergren" and having them selected.

The same behavior is seen when opening the document on LO 5.0.0.5. I remember seeing the expected behavior with some version prior to 3.5.7.2 but cannot recall which exactly.

Ditto for an analogous document where a few words are selected at random and manually formatted as italic. So the behavior does not seem to be related to the way the words were selected.

The searching does produce the expected result if the option "Including Styles" is activated. This should not be the case, however, as the whole document uses paragraph style "Default" and the italic formatting is applied manually.


Second test case:

1. The attached file 'OpenOffice.odt' is similar to the above in the way that no styles used but only some selected words were manually formatted as italic.

2. Searching for all italic formats (via Edit> Find&Replace...; More Options> Format> Font: Style = Italic; Find All) results in a very peculiar selection of text. 
It is hard to describe precisely but to me it seems that every paragraph *containing* any italic letters is selected; *some* of the italic words are selected as well, others are not.

Expected result is to have all italic words selected but none else.

The same behavior is seen when opening the document on LO 5.0.0.5. I remember seeing the expected behavior with some version prior to 3.5.7.2 but cannot recall which exactly.


Comment:

I am astonished that no one else has noticed this behavior and raised a bug about it. However, I have thoroughly tested these cases with different installations and am confident about it being relevant in general.
Comment 1 sm8ps 2015-11-19 11:11:30 UTC
Created attachment 120658 [details]
Test case 2: text-only; no styles; some words manually formatted as italic
Comment 2 Buovjaga 2015-11-27 09:09:24 UTC Comment hidden (obsolete)
Comment 3 sm8ps 2015-11-27 23:49:01 UTC Comment hidden (obsolete)
Comment 4 Buovjaga 2015-11-28 09:33:53 UTC
(In reply to sm8ps from comment #3)
> Thanks! What exactly do you mean by "I guess there was some glitch with
> saving those documents in 3.5."?

I mean only documents coming from 3.5 (or specifically your documents?) are affected. That's why this should be seen as low priority.

When using documents created with 5, the format find all works perfectly.
Comment 5 sm8ps 2015-11-28 20:31:49 UTC
Your comment makes perfect sense now, Beluga. Thanks for pointing this out! In fact, the idea simply did not cross my mind to check with a similar document *created* on LO 5. So this issue really is of low priority.
Comment 6 Heinrich Hartl 2016-03-28 12:17:59 UTC
Comment on attachment 120656 [details]
First test case: text-only; all words "gubergren" manually formatted as italic

more specifically: Search for format breaks seems not to work either.
Edit / find & replace / other options format / text flow Breaks /
This submenue seems to be inactive / not selectable.
I couldn't find a way to search for the manually inserted (page-) breaks otherwise.
As a testcase a attach "LoremIpsum_break-hh.odt" (created with Writer 5.0.5.2 pasting unformatted text from attachment "Lorem Ipsum, italic manually.odt" and inserting a manual break prior to Duis autem, to start page 4.
Is there a display option to show manual breaks (not just by beginning a new page but to indicate a forced new page)?
Comment 7 Heinrich Hartl 2016-03-28 12:21:38 UTC
Created attachment 123901 [details]
testcase search manual page break
Comment 8 QA Administrators 2017-05-22 13:20:06 UTC Comment hidden (obsolete)
Comment 9 Buovjaga 2017-11-30 12:58:11 UTC
*** Bug 111977 has been marked as a duplicate of this bug. ***
Comment 10 QA Administrators 2018-12-03 03:59:55 UTC Comment hidden (obsolete)
Comment 11 Heinrich Hartl 2019-01-15 17:22:09 UTC
I tried first Test case using
Version: 6.1.3.2 (x64)
Build-ID: 86daf60bf00efa86ad547e59e09d6bb77c699acb
CPU-Threads: 4; BS: Windows 6.1; UI-Render: Standard; 
Gebietsschema: de-DE (de_DE); Calc: group threaded

I found the error persists but I also found means to get correct behaviour:
I marked all of the text and chose to assign a different font.
The test case file uses font Linux Libertine # which is not part of Writer 6.1!
I chose font Linux Libertine G or Linux Libertine Display G and the problem was gone. May be the observed dependancy "only documents affected created with some old version" is actually that the font Linux Libertine was only available in that version. 
However even if this explaines behaviour I think behaviour is not correct. The display process correctly displays italic (Test: step char by char through text and observe the font attribute shown in the top bar) - only search fails to detect this correctly
Comment 12 Heinrich Hartl 2019-01-15 17:40:20 UTC
I retested also Test case 2 using
Version: 6.1.3.2 (x64)
Build-ID: 86daf60bf00efa86ad547e59e09d6bb77c699acb
CPU-Threads: 4; BS: Windows 6.1; UI-Render: Standard; 
Gebietsschema: de-DE (de_DE); Calc: group threaded

========= I found the error persists.
find and replace when searching for Format italic marks very arbitrary parts of the text.

To find out if this is a problem of the document I did the same search for italic  using the extension "Alternate search&Replace" V1.4.2.

Alternate search and replace tells me it is searching for [:::CharPosture::] to find italic text and properly marks all the italic text portions and nothing else!

========= It can be done correctly -> it should be done correctly also by standard find&replace!
Comment 13 Heinrich Hartl 2019-01-15 17:55:53 UTC
I was looking around in the current version if I can find a way to search for manual page break. Unfortunately this is not true, only "Alternate serch&replace" is offering that.
If extension "Alternate search&replace (Altsearch)" was a regular part of the distribution I couldn't complain... It does what I want!
Comment 14 m_a_riosv 2019-09-23 20:42:21 UTC
*** Bug 127725 has been marked as a duplicate of this bug. ***
Comment 15 Alexis 2019-09-24 20:01:49 UTC
The variation of this bug (I reported as https://bugs.documentfoundation.org/show_bug.cgi?id=127725) persists in LO 6.2.7.1 on Ubuntu 19.04..
Comment 16 Timur 2020-10-22 11:12:22 UTC
I reproduced in older LO 5.0. Selecting Italic would also show Normal in Find.
Seems fixed in 6.3, good in master 7.1+. So I set WFM. Please test yourself.
Comment 17 Timur 2020-10-22 11:13:11 UTC
*** Bug 103400 has been marked as a duplicate of this bug. ***
Comment 18 Timur 2020-10-22 11:13:26 UTC
*** Bug 105725 has been marked as a duplicate of this bug. ***
Comment 19 Timur 2020-10-22 11:49:18 UTC
More changes in Lo 6.3, from crashing, selecting Normal and other to Italic.
This is the final. Bibisect in Linux.

commit 2f564bd1391be29762cd3d7a2d7db4c71dbae653
Date:   Thu Aug 29 11:05:26 2019 +0200

    source 0417dd10991b0e92b5163167ddba59f1ffe6d73d
    prev source 482a97009a729e6198a4eae07869913f90a90c3c

author	Caolán McNamara <caolanm@redhat.com>	2019-08-19 16:30:23 +0100
committer	Michael Stahl <Michael.Stahl@cib.de>	2019-08-29 10:26:00 +0200
commit 0417dd10991b0e92b5163167ddba59f1ffe6d73d (patch)
tree ab371be674d6eb07568dba2def3523892b06baa1
parent 482a97009a729e6198a4eae07869913f90a90c3c (diff)
Related: tdf#127029 true was substituted for FALSE
presumably accidentally by...

commit 6ed0bcdd5bc07692fc81406942509eb9c30d3904
Date:   Tue Oct 5 07:57:51 2010 -0500

Description is different so I'll mark Fixed, not duplicate.
Comment 20 Timur 2020-10-22 12:16:16 UTC
*** Bug 126338 has been marked as a duplicate of this bug. ***
Comment 21 Timur 2020-10-22 12:46:54 UTC
*** Bug 122197 has been marked as a duplicate of this bug. ***