67#include <com/sun/star/io/IOException.hpp>
68#include <com/sun/star/text/XTextDocument.hpp>
72using namespace ::
cppu;
91 std::unique_ptr<SvMemoryStream> aDecompressed(
new SvMemoryStream(4096, 4096));
92 unsigned char buffer[512];
94 aDecompressed->WriteBytes(buffer, 16);
97 std::unique_ptr<OpenStormBento::LtcBenContainer> pBentoContainer;
104 std::unique_ptr<LtcUtBenValueStream> aWordProData(
105 pBentoContainer->FindValueStreamWithPropertyName(
"WordProData"));
111 Decompression decompress(aWordProData.get(), aDecompressed.get());
115 sal_uInt32
nPos = aWordProData->GetSize();
119 while (sal_uInt32 iRead = pCompressed->
ReadBytes(buffer, 512))
120 aDecompressed->WriteBytes(buffer, iRead);
123 aDecompressed->SetResizeOffset(0);
126 pOutDecompressed = aDecompressed.release();
144 if (nTag != 0x3750574c)
149 pLwpSvStream =
nullptr;
153 pDecompressed->
Seek(0);
156 pLwpSvStream =
nullptr;
157 bool bCompressed =
false;
161 pLwpSvStream =
new LwpSvStream(pDecompressed, pOriginalLwpSvStream);
171 uno::Reference<css::xml::sax::XDocumentHandler>
const& xHandler)
177 std::unique_ptr<LwpSvStream> aLwpSvStream;
178 std::unique_ptr<LwpSvStream> aCompressedLwpSvStream;
179 std::unique_ptr<SvStream> aDecompressed;
185 aDecompressed.reset(pDecompressed);
190 if (!pRawLwpSvStream)
196 aLwpSvStream.reset(pRawLwpSvStream);
199 Lwp9Reader reader(aLwpSvStream.get(), &aStrm);
202 const bool bOk = reader.
Read();
sal_Int32 explode()
decompress from instream to outstream
Reader framework class for Lotus Word Pro 9 file.
bool Read()
@descr The entrance of Word Pro 9 import filter.
encapsulate XInputStream to provide SvStream like interfaces
LwpSvStream * GetCompressedStream()
SvStream & ReadUInt32(sal_uInt32 &rUInt32)
sal_uInt64 Seek(sal_uInt64 nPos)
std::size_t ReadBytes(void *pData, std::size_t nSize)
Sax stream object, XDocumentHandler wrapper.
static bool GetLwpSvStream(SvStream *pStream, LwpSvStream *&pLwpSvStream)
@descr Get LwpSvStream, if small file, both compressed/decompressed stream Otherwise,...
static bool Decompress(SvStream *pCompressed, SvStream *&pOutDecompressed)
int ReadWordproFile(SvStream &rStream, uno::Reference< css::xml::sax::XDocumentHandler > const &xHandler)
sal_uLong BenOpenContainer(LwpSvStream *pStream, std::unique_ptr< LtcBenContainer > *ppContainer)
New bento container from file stream.