]> source.dussan.org Git - poi.git/commitdiff
allow subclassing of code to gen comments table
authorPJ Fanning <fanningpj@apache.org>
Mon, 15 Feb 2021 21:48:26 +0000 (21:48 +0000)
committerPJ Fanning <fanningpj@apache.org>
Mon, 15 Feb 2021 21:48:26 +0000 (21:48 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1886547 13f79535-47bb-0310-9956-ffa450edef68

src/ooxml/java/org/apache/poi/xssf/eventusermodel/XSSFReader.java

index 3a13bfb07e7a9ada33db5e3754a14cc49827216b..58dc00a5b0614af89f4a792f6bf8f8197e45a1e4 100644 (file)
@@ -353,7 +353,7 @@ public class XSSFReader {
                     PackageRelationship comments = commentsList.getRelationship(0);
                     PackagePartName commentsName = PackagingURIHelper.createPartName(comments.getTargetURI());
                     PackagePart commentsPart = sheetPkg.getPackage().getPart(commentsName);
-                    return new CommentsTable(commentsPart);
+                    return parseComments(commentsPart);
                 }
             } catch (InvalidFormatException|IOException e) {
                 LOGGER.log(POILogger.WARN, e);
@@ -362,6 +362,11 @@ public class XSSFReader {
             return null;
         }
 
+        //to allow subclassing
+        protected CommentsTable parseComments(PackagePart commentsPart) throws IOException {
+            return new CommentsTable(commentsPart);
+        }
+        
         /**
          * Returns the shapes associated with this sheet,
          * an empty list or null if there is an exception