summaryrefslogtreecommitdiff
path: root/lotuswordpro/source/filter/lwpgrfobj.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'lotuswordpro/source/filter/lwpgrfobj.cxx')
-rw-r--r--lotuswordpro/source/filter/lwpgrfobj.cxx25
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());
}
/**