diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-01-20 21:09:29 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-01-21 21:16:31 +0100 |
commit | 6d6421d3e66aa012cd0ca0d903c3825e4212c643 (patch) | |
tree | 6ddf19b25bf1ad64985fc859a769258656bbf877 /lotuswordpro/source/filter/lwpgrfobj.cxx | |
parent | 398b0195b7833ca8fab29a600954c84527b25cf9 (diff) |
rework to remove intermediate stream
Change-Id: I6ff66cf6ea6ac38f7c36da7668b612b2062e4852
Reviewed-on: https://gerrit.libreoffice.org/48257
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'lotuswordpro/source/filter/lwpgrfobj.cxx')
-rw-r--r-- | lotuswordpro/source/filter/lwpgrfobj.cxx | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/lotuswordpro/source/filter/lwpgrfobj.cxx b/lotuswordpro/source/filter/lwpgrfobj.cxx index 30431b7a1bb3..f0e355125249 100644 --- a/lotuswordpro/source/filter/lwpgrfobj.cxx +++ b/lotuswordpro/source/filter/lwpgrfobj.cxx @@ -302,14 +302,13 @@ void LwpGraphicObject::CreateDrawObjects() GetBentoNamebyID(rMyID, aGrfObjName); // get bento stream by the name - SvStream* pDrawObjStream = pBentoContainer->CreateGraphicStream(aGrfObjName.c_str()); - if (pDrawObjStream) + std::vector<sal_uInt8> aData = pBentoContainer->GetGraphicData(aGrfObjName.c_str()); + if (!aData.empty()) { - LwpSdwFileLoader fileLoader(pDrawObjStream, this); - fileLoader.CreateDrawObjects(&m_vXFDrawObjects); + SvMemoryStream aDrawObjStream(aData.data(), aData.size(), StreamMode::READ); - delete pDrawObjStream; - pDrawObjStream = nullptr; + LwpSdwFileLoader fileLoader(&aDrawObjStream, this); + fileLoader.CreateDrawObjects(&m_vXFDrawObjects); } } @@ -352,18 +351,8 @@ std::vector<sal_uInt8> LwpGraphicObject::GetRawGrafData() std::string aGrfObjName; GetBentoNamebyID(rMyID, aGrfObjName); - // get bento stream by the name - SvMemoryStream* pMemGrafStream = pBentoContainer->CreateGraphicStream(aGrfObjName.c_str()); - if (pMemGrafStream) - { - // read image data - aGrafData.resize(pMemGrafStream->GetEndOfData()); - pMemGrafStream->ReadBytes(aGrafData.data(), aGrafData.size()); - - delete pMemGrafStream; - } - - return aGrafData; + // get bento stream by the name and read image data + return pBentoContainer->GetGraphicData(aGrfObjName.c_str()); } /** |