diff options
author | jing.zhao <jing.zhao@ck-telecom.com> | 2015-04-17 09:22:02 +0800 |
---|---|---|
committer | Jorge Ruesga <jorge@ruesga.com> | 2015-04-17 10:10:37 +0000 |
commit | a09cb8fa69295e992c0ae9dadaa64260fd4cc82a (patch) | |
tree | 41cd72116971c20bfd17feebc1c14acc74a8174c | |
parent | 21d641ccee97ee011ea2587808c2cb78c435144a (diff) | |
download | android_packages_apps_CMFileManager-a09cb8fa69295e992c0ae9dadaa64260fd4cc82a.tar.gz android_packages_apps_CMFileManager-a09cb8fa69295e992c0ae9dadaa64260fd4cc82a.tar.bz2 android_packages_apps_CMFileManager-a09cb8fa69295e992c0ae9dadaa64260fd4cc82a.zip |
CMFileManager: Printing preview content is not show complete.
fix the PageCount from int to double
Change-Id: I72f1577f22b563456b43dded4058572d328009c3
(cherry picked from commit ed63368d1d085d4021329d6720ab7a32765b7768)
-rw-r--r-- | src/com/cyanogenmod/filemanager/ui/policy/PrintActionPolicy.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/com/cyanogenmod/filemanager/ui/policy/PrintActionPolicy.java b/src/com/cyanogenmod/filemanager/ui/policy/PrintActionPolicy.java index 6f7087c8..38e44940 100644 --- a/src/com/cyanogenmod/filemanager/ui/policy/PrintActionPolicy.java +++ b/src/com/cyanogenmod/filemanager/ui/policy/PrintActionPolicy.java @@ -351,8 +351,8 @@ public final class PrintActionPolicy extends ActionsPolicy { } private int calculatePageCount(int rowsPerPage) { - int pages = mAdjustedLines.size() / rowsPerPage; - return pages <= 0 ? PrintDocumentInfo.PAGE_COUNT_UNKNOWN : pages; + double pages = (double) mAdjustedLines.size() / rowsPerPage; + return pages <= 0 ? PrintDocumentInfo.PAGE_COUNT_UNKNOWN : (int) Math.ceil(pages); } private int rowsPerPage(Rect pageContentRect) { |