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 2025/10/13 18:51:21 UTC
svn commit: r1929129 - pdfbox/branches/3.0/pdfbox/src/main/java/org/apache/pdfbox/text
Author: tilman
Date: Mon Oct 13 18:51:21 2025
New Revision: 1929129
Log:
PDFBOX-6084: remove dead code, as suggested by Valery Bokov
Modified:
pdfbox/branches/3.0/pdfbox/src/main/java/org/apache/pdfbox/text/PDFMarkedContentExtractor.java
Modified: pdfbox/branches/3.0/pdfbox/src/main/java/org/apache/pdfbox/text/PDFMarkedContentExtractor.java
==============================================================================
--- pdfbox/branches/3.0/pdfbox/src/main/java/org/apache/pdfbox/text/PDFMarkedContentExtractor.java Mon Oct 13 18:27:38 2025 (r1929128)
+++ pdfbox/branches/3.0/pdfbox/src/main/java/org/apache/pdfbox/text/PDFMarkedContentExtractor.java Mon Oct 13 18:51:21 2025 (r1929129)
@@ -203,48 +203,9 @@ public class PDFMarkedContentExtractor e
}
}
- if( showCharacter )
+ if (showCharacter && !this.currentMarkedContents.isEmpty())
{
- List<TextPosition> textList = new ArrayList<>();
-
- /* In the wild, some PDF encoded documents put diacritics (accents on
- * top of characters) into a separate Tj element. When displaying them
- * graphically, the two chunks get overlaid. With text output though,
- * we need to do the overlay. This code recombines the diacritic with
- * its associated character if the two are consecutive.
- */
- if(textList.isEmpty())
- {
- textList.add(text);
- }
- else
- {
- /* test if we overlap the previous entry.
- * Note that we are making an assumption that we need to only look back
- * one TextPosition to find what we are overlapping.
- * This may not always be true. */
- TextPosition previousTextPosition = textList.get(textList.size()-1);
- if(text.isDiacritic() && previousTextPosition.contains(text))
- {
- previousTextPosition.mergeDiacritic(text);
- }
- /* If the previous TextPosition was the diacritic, merge it into this
- * one and remove it from the list. */
- else if(previousTextPosition.isDiacritic() && text.contains(previousTextPosition))
- {
- text.mergeDiacritic(previousTextPosition);
- textList.remove(textList.size()-1);
- textList.add(text);
- }
- else
- {
- textList.add(text);
- }
- }
- if (!this.currentMarkedContents.isEmpty())
- {
- this.currentMarkedContents.peek().addText(text);
- }
+ this.currentMarkedContents.peek().addText(text);
}
}