Hello, I'm DaeHyun Sung, from South Korea. I found the Bugzilla report "tdf#144747 FILEOPEN When opening any Hancom Word hwp document garbage is displayed" https://bugs.documentfoundation.org/show_bug.cgi?id=144747 (Thanks Ming Hua to inform me. )
So, I read hwpfilter module on LibreOffice. LibreOffice only supported hwp v3.0(HWP97 version) file format. However, In Korea, Broadly used to hwp v5.0 file format. It is zipped Compound File Binary Format. So, I added read & check zipped format I submitted my works on gerrit (WIP) https://gerrit.libreoffice.org/c/core/+/125782 Though, I added a check zip file format code. But, It doesn't check and error. Below is added my code === uno::Reference<uno::XComponentContext> xContext = comphelper::getProcessComponentContext(); SAL_WARN("HwpImportFilter::detect", "xContext"); uno::Reference<packages::zip::XZipFileAccess2> xZip( packages::zip::ZipFileAccess::createWithURL(xContext, sURL)); if (xZip.is()) { SAL_WARN("HwpImportFilter::detect", "That maybe HWP v5.0 format"); uno::Reference<io::XInputStream> const isHwpV5FileHeaderStream(xZip->getByName("FileHeader"), uno::UNO_QUERY); } === In my opinion, I found the reading zip module follows LibreOffice core source codes. But It doesn't works. So, I have a question. How to check Zipped file(It contained Compound File Binary Format) on LibreOffice? Check it please! Below is after opening hwp v5 file log. ======== warn:sfx.dialog:157960:158136:sfx2/source/dialog/filtergrouping.cxx:357: already have an element for WordPerfect warn:sfx.dialog:157960:158136:sfx2/source/dialog/filtergrouping.cxx:357: already have an element for writerweb8_writer_template warn:sfx.dialog:157960:158136:sfx2/source/dialog/filtergrouping.cxx:357: already have an element for writerglobal8 warn:HwpImportFilter::detect:157960:158136:hwpfilter/source/hwpreader.cxx:4932: HwpImportFilter::detect warn:HwpImportFilter::detect:157960:158136:hwpfilter/source/hwpreader.cxx:4947: filter warn:HwpImportFilter::detect:157960:158136:hwpfilter/source/hwpreader.cxx:4948: sType warn:HwpImportFilter::detect:157960:158136:hwpfilter/source/hwpreader.cxx:4949: sURL file:///C:/Users/dhsung/Downloads/000000000001.hwp warn:HwpImportFilter::detect:157960:158136:hwpfilter/source/hwpreader.cxx:4955: xContext Throwing InvalidHeaderException Throwing InvalidHeaderException warn:oox.storage:157960:158136:oox/source/helper/zipstorage.cxx:68: ZipStorage::ZipStorage exception opening input storage com.sun.star.io.IOException warn:oox:157960:158136:oox/source/crypto/DocumentDecryption.cxx:166: Encrypted package does not contain DataSpaceMap Throwing InvalidHeaderException Throwing InvalidHeaderException AbiDocument::isFileFormatSupported Found xml parser severity error Document is empty Throwing InvalidHeaderException warn:oox.storage:157960:158136:oox/source/helper/zipstorage.cxx:68: ZipStorage::ZipStorage exception opening input storage com.sun.star.io.IOException warn:oox:157960:158136:oox/source/crypto/DocumentDecryption.cxx:166: Encrypted package does not contain DataSpaceMap warn:oox.storage:157960:158136:oox/source/helper/zipstorage.cxx:68: ZipStorage::ZipStorage exception opening input storage com.sun.star.io.IOException warn:oox:157960:158136:oox/source/crypto/DocumentDecryption.cxx:166: Encrypted package does not contain DataSpaceMap warn:oox.storage:157960:158136:oox/source/helper/zipstorage.cxx:68: ZipStorage::ZipStorage exception opening input storage com.sun.star.io.IOException warn:oox:157960:158136:oox/source/crypto/DocumentDecryption.cxx:166: Encrypted package does not contain DataSpaceMap warn:oox.storage:157960:158136:oox/source/helper/zipstorage.cxx:68: ZipStorage::ZipStorage exception opening input storage com.sun.star.io.IOException warn:oox:157960:158136:oox/source/crypto/DocumentDecryption.cxx:166: Encrypted package does not contain DataSpaceMap warn:oox.storage:157960:158136:oox/source/helper/zipstorage.cxx:68: ZipStorage::ZipStorage exception opening input storage com.sun.star.io.IOException warn:oox:157960:158136:oox/source/crypto/DocumentDecryption.cxx:166: Encrypted package does not contain DataSpaceMap warn:oox.storage:157960:158136:oox/source/helper/zipstorage.cxx:68: ZipStorage::ZipStorage exception opening input storage com.sun.star.io.IOException warn:oox:157960:158136:oox/source/crypto/DocumentDecryption.cxx:166: Encrypted package does not contain DataSpaceMap warn:oox.storage:157960:158136:oox/source/helper/zipstorage.cxx:68: ZipStorage::ZipStorage exception opening input storage com.sun.star.io.IOException warn:oox:157960:158136:oox/source/crypto/DocumentDecryption.cxx:166: Encrypted package does not contain DataSpaceMap warn:oox.storage:157960:158136:oox/source/helper/zipstorage.cxx:68: ZipStorage::ZipStorage exception opening input storage com.sun.star.io.IOException warn:oox:157960:158136:oox/source/crypto/DocumentDecryption.cxx:166: Encrypted package does not contain DataSpaceMap warn:oox.storage:157960:158136:oox/source/helper/zipstorage.cxx:68: ZipStorage::ZipStorage exception opening input storage com.sun.star.io.IOException warn:oox:157960:158136:oox/source/crypto/DocumentDecryption.cxx:166: Encrypted package does not contain DataSpaceMap warn:oox.storage:157960:158136:oox/source/helper/zipstorage.cxx:68: ZipStorage::ZipStorage exception opening input storage com.sun.star.io.IOException warn:oox:157960:158136:oox/source/crypto/DocumentDecryption.cxx:166: Encrypted package does not contain DataSpaceMap warn:oox.storage:157960:158136:oox/source/helper/zipstorage.cxx:68: ZipStorage::ZipStorage exception opening input storage com.sun.star.io.IOException warn:oox:157960:158136:oox/source/crypto/DocumentDecryption.cxx:166: Encrypted package does not contain DataSpaceMap warn:oox.storage:157960:158136:oox/source/helper/zipstorage.cxx:68: ZipStorage::ZipStorage exception opening input storage com.sun.star.io.IOException warn:oox:157960:158136:oox/source/crypto/DocumentDecryption.cxx:166: Encrypted package does not contain DataSpaceMap warn:oox.storage:157960:158136:oox/source/helper/zipstorage.cxx:68: ZipStorage::ZipStorage exception opening input storage com.sun.star.io.IOException warn:oox:157960:158136:oox/source/crypto/DocumentDecryption.cxx:166: Encrypted package does not contain DataSpaceMap warn:oox.storage:157960:158136:oox/source/helper/zipstorage.cxx:68: ZipStorage::ZipStorage exception opening input storage com.sun.star.io.IOException warn:oox:157960:158136:oox/source/crypto/DocumentDecryption.cxx:166: Encrypted package does not contain DataSpaceMap warn:oox.storage:157960:158136:oox/source/helper/zipstorage.cxx:68: ZipStorage::ZipStorage exception opening input storage com.sun.star.io.IOException warn:oox:157960:158136:oox/source/crypto/DocumentDecryption.cxx:166: Encrypted package does not contain DataSpaceMap warn:oox.storage:157960:158136:oox/source/helper/zipstorage.cxx:68: ZipStorage::ZipStorage exception opening input storage com.sun.star.io.IOException warn:oox:157960:158136:oox/source/crypto/DocumentDecryption.cxx:166: Encrypted package does not contain DataSpaceMap warn:oox.storage:157960:158136:oox/source/helper/zipstorage.cxx:68: ZipStorage::ZipStorage exception opening input storage com.sun.star.io.IOException warn:oox:157960:158136:oox/source/crypto/DocumentDecryption.cxx:166: Encrypted package does not contain DataSpaceMap VisioDocument: version 0 Found xml parser severity error Document is empty ============ Sincerely, DaeHyun Sung(성대현, 成大鉉, ソン・デヒョン) -- Korean Open Source Developer, Contributor, Translator. LibreOffice, KDE, GNOME Contributor. The Document Foundation Member in Korea. GNOME Foundation Member in Korea. Interested in LibreOffice, KDE, GNOME, Web, etc. LibreOffice – free and open source office suite: https://www.libreoffice.org Respects your privacy, and gives you back control over your data