diff options
author | Tim Allison <tallison@apache.org> | 2018-10-29 15:48:44 +0000 |
---|---|---|
committer | Tim Allison <tallison@apache.org> | 2018-10-29 15:48:44 +0000 |
commit | b5653e882986e219b3f2c0faf7b73c2d16f11f41 (patch) | |
tree | c692df17f0c69092bc2076b6d28a33c189bdfb42 /src/testcases/org/apache/poi/poifs | |
parent | cc131eeab945f374729322f7e09ce31bce4dab05 (diff) | |
download | poi-b5653e882986e219b3f2c0faf7b73c2d16f11f41.tar.gz poi-b5653e882986e219b3f2c0faf7b73c2d16f11f41.zip |
bug 62624 -- fix npe by adding processing of module name mapping in VBAMacroReader
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1845138 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/testcases/org/apache/poi/poifs')
-rw-r--r-- | src/testcases/org/apache/poi/poifs/macros/TestVBAMacroReader.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/testcases/org/apache/poi/poifs/macros/TestVBAMacroReader.java b/src/testcases/org/apache/poi/poifs/macros/TestVBAMacroReader.java index b4885f1d23..673f82e64f 100644 --- a/src/testcases/org/apache/poi/poifs/macros/TestVBAMacroReader.java +++ b/src/testcases/org/apache/poi/poifs/macros/TestVBAMacroReader.java @@ -286,4 +286,18 @@ public class TestVBAMacroReader { assertContains(content, "Attribute VB_Customizable = True"); r.close(); } + + @Test + public void bug62624() throws IOException { + //macro comes from Common Crawl: HRLOXHGMGLFIJQQU27RIWXOARRHAAAAS + File f = POIDataSamples.getSpreadSheetInstance().getFile("62624.bin"); + VBAMacroReader r = new VBAMacroReader(f); + + Map<String, Module> macros = r.readMacroModules(); + assertEquals(13, macros.size()); + assertNotNull(macros.get("M\u00F3dulo1")); + assertContains(macros.get("M\u00F3dulo1").getContent(), "Calcula_tributos"); + assertEquals(Module.ModuleType.Module, macros.get("M\u00F3dulo1").geModuleType()); + r.close(); + } } |