Bug 54526 - Selection background color turns black
Summary: Selection background color turns black
Status: RESOLVED FIXED
Alias: None
Product: poppler
Classification: Unclassified
Component: cairo backend (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: poppler-bugs
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-05 04:51 UTC by Jason Crain
Modified: 2012-11-24 13:55 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
example pdf (668 bytes, application/pdf)
2012-09-05 04:51 UTC, Jason Crain
Details
screenshot of error in evince (2.98 KB, image/png)
2012-09-05 04:53 UTC, Jason Crain
Details
Update fill and stroke color in CairoOutputDev::startPage (964 bytes, patch)
2012-09-05 04:56 UTC, Jason Crain
Details | Splinter Review

Description Jason Crain 2012-09-05 04:51:48 UTC
Created attachment 66649 [details]
example pdf

The attached document contains the text "s ab".  While using evince, if I select, from left to right, the characters " ab" so that the space is the first character selected, the background color for the "a" turns black.
Comment 1 Jason Crain 2012-09-05 04:53:21 UTC
Created attachment 66650 [details]
screenshot of error in evince

Attached is an image of the rendering error from evince.
Comment 2 Jason Crain 2012-09-05 04:56:25 UTC
Created attachment 66651 [details] [review]
Update fill and stroke color in CairoOutputDev::startPage

The problem occurs because in CairoOutputDev.cc, the current fill color is kept in two variables: fill_pattern and fill_color.  CairoOutputDev::updateFillColor checks if fill_color has changed before updating fill_pattern.  But in CairoOutputDev::startPage, fill_pattern is set to black without updating fill_color.  When fill_color and fill_pattern become desynchronized, updateFillColor may fail to update fill_pattern, leaving the pattern black.  The same is true for the stroke_pattern and stroke_color variables, but I have not seen any problem caused by that.

Attached patch fixes this problem by updating fill_color and stroke_color in startPage, to keep them in sync with fill_pattern and stroke_pattern.
Comment 3 Carlos Garcia Campos 2012-11-24 13:55:06 UTC
Sorry for the delay reviewing this too, patch pushed to git master, thank you very much.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.