[okular] fix Arabic & Hebrew search

Review Request #125442 - Created Sept. 29, 2015 and updated

Information
Fahad Al-Saidi
okular
207748
Reviewers
okular

Since arabic search does not work properly in all but pdf backends, this is a quick attempt to fix this problem. I assumed that text in okular document is in the logical order[ it is a bug by itself]. So by mirroring the search text, the search function works again.

The limitation:
- you can not search arabic and english text together.

Future work:
we need to check that text generated by poppler is placed in Visual order, so when we copy it and paste it in text editor is still readable.

Tested in Arabic & Hebrew pdfs and it works fine.

Issues

  • 1
  • 0
  • 0
  • 1
Description From Last Updated
Before submitting patches, check with a git diff that you don't add whitespaces... Olivier Churlaud Olivier Churlaud
Fahad Al-Saidi
Review request changed

Testing Done:

~  

Test in Arabic & Hebrew pdfs and it works fine.

  ~

Tested in Arabic & Hebrew pdfs and it works fine.

Olivier Churlaud

Is the "future work" a lot to do? Because if is part of solving your problem, you should had this to the review.

  1. Well, the bug itself needs to be retested against Poppler >= 0.40 because of this:
    https://bugs.freedesktop.org/show_bug.cgi?id=55977

    Unfortunatly, I am using kde 4 & ubuntu 14.04 and it is diffcult for me to upgrade right now.

  2. I have a newer poppler, so if you add to the bug (on bugzilla) a file test, with a word to test (because I don't have an hebrew or arabic keyboard), I can test it.

  3. done. please test

  4. well, the current patch will fix the problem though is not the best solution IMHO. We need refactoring text layer in okular that okular get text from poppler without any modification the same way envice does.I mean by future work is another bug relating to RTL in general.
    If it fine with you to go ahead with this patch, I will clean it up.

  5. I'll speak with Albert about that. Honestly this would be a workaround and this means okular does extra work. I'm not familiar with this part of the codebase. I'll keep you updated

Olivier Churlaud

   
ui/searchlineedit.cpp (Diff revision 1)
 
 

Before submitting patches, check with a git diff that you don't add whitespaces...

  1. I've migrated this patch to Phabricator and cleaned up the whitespace issues.

    https://phabricator.kde.org/D10298

Loading...