Skip to content

Commit 951539b

Browse files
committed
fixes after #504
1 parent 7e98e1d commit 951539b

2 files changed

Lines changed: 5 additions & 9 deletions

File tree

src/odr/internal/oldms/oldms_file.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,6 @@ FileMeta parse_meta(const abstract::ReadableFilesystem &files) {
3939
FileMeta result;
4040
result.document_meta = DocumentMeta();
4141

42-
if (files.is_file(AbsPath("/EncryptionInfo")) &&
43-
files.is_file(AbsPath("/EncryptedPackage"))) {
44-
result.type = FileType::office_open_xml_encrypted;
45-
result.password_encrypted = true;
46-
return result;
47-
}
48-
4942
for (const auto &[path, variant] : types) {
5043
if (files.is_file(path)) {
5144
result.type = variant.type;

src/odr/internal/oldms/text/doc_io.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
#include <odr/internal/util/byte_stream_util.hpp>
66
#include <odr/internal/util/string_util.hpp>
77

8+
#include <cstring>
9+
810
namespace odr::internal::oldms::text {
911

1012
namespace {
@@ -130,8 +132,9 @@ void text::read(std::istream &in, ParsedFib &out) {
130132
throw std::runtime_error("Unexpected cbRgFcLcb value: " +
131133
std::to_string(out.cbRgFcLcb));
132134
}
133-
return std::unique_ptr<FibRgFcLcb97>(
134-
reinterpret_cast<FibRgFcLcb97 *>(fibRgFcLcb.release()));
135+
auto result = std::make_unique<FibRgFcLcbType>();
136+
std::memcpy(result.get(), fibRgFcLcb.get(), out.cbRgFcLcb * 8);
137+
return result;
135138
});
136139
}
137140

0 commit comments

Comments
 (0)