diff options
| author | Svetoslav Ganov <svetoslavganov@google.com> | 2013-11-15 21:42:12 -0800 |
|---|---|---|
| committer | Svetoslav Ganov <svetoslavganov@google.com> | 2013-11-15 21:52:35 -0800 |
| commit | 1a85d9fb243aae3750001094aa1514d4303cb3e0 (patch) | |
| tree | 9019044fb37e264f2d05b8b668ec49137f49e3f8 /packages/PrintSpooler | |
| parent | 35aacf2eb325d24c67d01f4dbd706ed26ab9e8c3 (diff) | |
| download | frameworks_base-1a85d9fb243aae3750001094aa1514d4303cb3e0.zip frameworks_base-1a85d9fb243aae3750001094aa1514d4303cb3e0.tar.gz frameworks_base-1a85d9fb243aae3750001094aa1514d4303cb3e0.tar.bz2 | |
Fix incorrent page range parsing when custom print options used.
We have APIs for a print service to declare an activity with custom
print options. In this activity the service can add custom properties
as well as change the standard ones such as pages to print. The ranges
of selected pages from the custom activity was incorrectly parsed
resulting in an off by one error in what is shown to the user and as a
result getting an exception when trying to print.
bug:11719051
Change-Id: Id04c94608178895f1d47381a63133f0eba7645e1
Diffstat (limited to 'packages/PrintSpooler')
| -rw-r--r-- | packages/PrintSpooler/src/com/android/printspooler/PrintJobConfigActivity.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/packages/PrintSpooler/src/com/android/printspooler/PrintJobConfigActivity.java b/packages/PrintSpooler/src/com/android/printspooler/PrintJobConfigActivity.java index 88403a3..c1c7a4e 100644 --- a/packages/PrintSpooler/src/com/android/printspooler/PrintJobConfigActivity.java +++ b/packages/PrintSpooler/src/com/android/printspooler/PrintJobConfigActivity.java @@ -1529,9 +1529,13 @@ public class PrintJobConfigActivity extends Activity { builder.append(','); } PageRange pageRange = pageRanges[i]; - builder.append(pageRange.getStart()); - builder.append('-'); - builder.append(pageRange.getEnd()); + final int shownStartPage = pageRange.getStart() + 1; + final int shownEndPage = pageRange.getEnd() + 1; + builder.append(shownStartPage); + if (shownStartPage != shownEndPage) { + builder.append('-'); + builder.append(shownEndPage); + } } mPageRangeEditText.setText(builder.toString()); } |
