You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ti...@apache.org on 2026/05/13 12:00:23 UTC
(pdfbox-jbig2) 06/11: PDFBOX-5660: use switch
This is an automated email from the ASF dual-hosted git repository.
asf-gitbox-commits pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pdfbox-jbig2.git
commit 34e0fb55860767ef2c41e6a35e20cb2e601a0b33
Author: Tilman Hausherr <ti...@apache.org>
AuthorDate: Wed May 13 13:53:25 2026 +0200
PDFBOX-5660: use switch
---
.../apache/pdfbox/jbig2/segments/TextRegion.java | 30 ++++++++++++----------
1 file changed, 16 insertions(+), 14 deletions(-)
diff --git a/src/main/java/org/apache/pdfbox/jbig2/segments/TextRegion.java b/src/main/java/org/apache/pdfbox/jbig2/segments/TextRegion.java
index f1c01e6..769b5bf 100644
--- a/src/main/java/org/apache/pdfbox/jbig2/segments/TextRegion.java
+++ b/src/main/java/org/apache/pdfbox/jbig2/segments/TextRegion.java
@@ -966,21 +966,23 @@ public class TextRegion implements Region
if (referenceCorner != 1)
{
- if (referenceCorner == 0)
+ switch (referenceCorner)
{
- // BL
- t -= ib.getHeight() - 1;
- }
- else if (referenceCorner == 2)
- {
- // BR
- t -= ib.getHeight() - 1;
- s -= ib.getWidth() - 1;
- }
- else if (referenceCorner == 3)
- {
- // TR
- s -= ib.getWidth() - 1;
+ case 0:
+ // BL
+ t -= ib.getHeight() - 1;
+ break;
+ case 2:
+ // BR
+ t -= ib.getHeight() - 1;
+ s -= ib.getWidth() - 1;
+ break;
+ case 3:
+ // TR
+ s -= ib.getWidth() - 1;
+ break;
+ default:
+ break;
}
}