Commit 28d2f439 authored by rbpotter's avatar rbpotter Committed by Commit Bot

Print Preview: Fix some issues with 0 page document in chrome://print

Bug: 986711
Change-Id: Ic0556f349fe7f129a2761daf26198273fdf1d620
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1715711Reviewed-by: default avatarDemetrios Papadopoulos <dpapad@chromium.org>
Commit-Queue: Rebekah Potter <rbpotter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#680165}
parent f9a7141c
...@@ -374,10 +374,8 @@ Polymer({ ...@@ -374,10 +374,8 @@ Polymer({
'pageRangeSyntaxInstruction', 'pageRangeSyntaxInstruction',
loadTimeData.getString('examplePageRangeText')); loadTimeData.getString('examplePageRangeText'));
} else { } else {
formattedMessage = (this.pageCount === 0) ? formattedMessage = loadTimeData.getStringF(
'' : 'pageRangeLimitInstructionWithValue', this.pageCount);
loadTimeData.getStringF(
'pageRangeLimitInstructionWithValue', this.pageCount);
} }
return formattedMessage.replace(/<\/b>|<b>/g, ''); return formattedMessage.replace(/<\/b>|<b>/g, '');
}, },
...@@ -404,6 +402,10 @@ Polymer({ ...@@ -404,6 +402,10 @@ Polymer({
* @private * @private
*/ */
getAllPagesString_: function() { getAllPagesString_: function() {
if (this.pageCount === 0) {
return '';
}
return this.pageCount === 1 ? '1' : `1-${this.pageCount}`; return this.pageCount === 1 ? '1' : `1-${this.pageCount}`;
}, },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment