| Commit-Queue | +1 |
Haven't gotten the chance to test locally so just running this here.
Recently cleaned my system and rebuliding would take another hour or so (Don't have the patience :)).
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +1 |
Hey guys, decided to add public api for the /C argument (the optional color argument for Bookmarks). Wanted to also get some thoughts on a Set API for this maybe so that users in the chromium frontend can have bookmarks of custom colours allowing them to better categorize them (perhaps red for problem sets, blue for chapter summaries etc).
Thanks!
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
struct ColorReturn {
bool success;
FX_RGB_STRUCT<float> color;
};
Let's use std::optional<FX_RGB_STRUCT<float>>
// aren't in the range or if the bookmark does not specify a color.needs to say experimental on all new APIs.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +1 |
bool success;
FX_RGB_STRUCT<float> color;
};
Let's use std::optional<FX_RGB_STRUCT<float>>
Yep mb, forgot c++ existed for a second and decided to do it the struct way (as with public API sometimes).
Done.
// aren't in the range or if the bookmark does not specify a color.needs to say experimental on all new APIs.
Forgot about that, edited now.
But... I am so confused... where did EXEs come from?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
// aren't in the range or if the bookmark does not specify a color.Aryan Krishnanneeds to say experimental on all new APIs.
Forgot about that, edited now.
But... I am so confused... where did EXEs come from?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
// aren't in the range or if the bookmark does not specify a color.Aryan Krishnanneeds to say experimental on all new APIs.
Tom SepezForgot about that, edited now.
But... I am so confused... where did EXEs come from?
Not sure what you are asking, Aryan.
... Right... I saw nothing and 100% NOT a suggested edit that mentions "EXE being an example of an application type"... Yeah... I saw nothing i just... was multitasking with something about windows so... somehow thought about exe ... don't worry about it :)
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
This CL Introduces a new public API function, FPDFBookmark_GetColor,Either write "Introduces" lowercase, or just write "Introduce a new ..."
get values from the optional "C" array from the underlying bookmark/C
To support this, the CPDF_Bookmark::GetColor() method has been added to
get values from the optional "C" array from the underlying bookmarkUse active voice. "add Foo() to get foo".
RetainPtr<const CPDF_Array> RGB_array = dict_->GetArrayFor("C");Style: No capital letters in variable names.
auto color = cpdf_bookmark.GetColor();Write the type out. Most readers will not be able to do this type deduction in their head.
if (color->red > 1 || color->green > 1 || color->blue > 1) {What about color component values less than 0?
100 600 TD (Page1)TjMaybe consistently write 1 operator per line. Space in front of Tj.
{{object 9 0}} <<For better test coverage, how about having bookmark nodes with these properties?
/C [ 1 1 1 ]Here, line 98, and others - no spaces immediately inside the brackets. i.e. Be consistent with line 40.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
This CL Introduces a new public API function, FPDFBookmark_GetColor,Either write "Introduces" lowercase, or just write "Introduce a new ..."
Done
To support this, the CPDF_Bookmark::GetColor() method has been added to
get values from the optional "C" array from the underlying bookmarkUse active voice. "add Foo() to get foo".
Done
get values from the optional "C" array from the underlying bookmarkAryan Krishnan/C
Done
RetainPtr<const CPDF_Array> RGB_array = dict_->GetArrayFor("C");Style: No capital letters in variable names.
Done
Write the type out. Most readers will not be able to do this type deduction in their head.
Done
if (color->red > 1 || color->green > 1 || color->blue > 1) {What about color component values less than 0?
They should also be rejected. Added the check.
Maybe consistently write 1 operator per line. Space in front of Tj.
Done
For better test coverage, how about having bookmark nodes with these properties?
- No /C
- /C is not an array
- /C is an array, but with the wrong number of elements
- /C with 3 elements, but out of range array element value > 1
- /C with 3 elements, but out of range array element value < 0
- Perfectly valid /C value
Done
Here, line 98, and others - no spaces immediately inside the brackets. i.e. Be consistent with line 40.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
To support this, This CL adds the CPDF_Bookmark::GetColor() method tolowercase
ScopedFPDFWideString title = GetFPDFWideString(L"A Good Beginning");Maybe if the bookmarks had names like "No Color", that would provide better documentation of what their color characteristics are.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +1 |
To support this, This CL adds the CPDF_Bookmark::GetColor() method toAryan Krishnanlowercase
Done
ScopedFPDFWideString title = GetFPDFWideString(L"A Good Beginning");Maybe if the bookmarks had names like "No Color", that would provide better documentation of what their color characteristics are.
Done, and now that they are self-documenting, removed the additional comments as well.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Add FPDFBookmark_GetColor public API
This CL introduces a new public API function, FPDFBookmark_GetColor,
which allows emedders to retrieve the RGB color components of a PDF
outline item (bookmark).
To support this, this CL adds the CPDF_Bookmark::GetColor() method to
get values from the optional "/C" array from the underlying bookmark
dictionary. The API validates that the RGB color components are present,
correctly formed, and conform to the PDF specification limits (values
between 0.0 and 1.0).
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |