summaryrefslogtreecommitdiff
path: root/lotuswordpro/source
diff options
context:
space:
mode:
Diffstat (limited to 'lotuswordpro/source')
-rw-r--r--lotuswordpro/source/filter/lwpgrfobj.cxx25
1 files changed, 10 insertions, 15 deletions
diff --git a/lotuswordpro/source/filter/lwpgrfobj.cxx b/lotuswordpro/source/filter/lwpgrfobj.cxx
index c732b611a0f1..26b3b8a52be5 100644
--- a/lotuswordpro/source/filter/lwpgrfobj.cxx
+++ b/lotuswordpro/source/filter/lwpgrfobj.cxx
@@ -112,7 +112,6 @@ void LwpGraphicObject::Read()
m_sDataFormat[strsize] = '\0';
}
sal_uInt32 nServerContextSize = m_pObjStrm->QuickReaduInt32();
- unsigned char *pServerContext = nullptr;
if (nServerContextSize > 0)
{
sal_uInt16 nMaxPossibleSize = m_pObjStrm->remainingSize();
@@ -123,16 +122,16 @@ void LwpGraphicObject::Read()
nServerContextSize = nMaxPossibleSize;
}
- pServerContext = new unsigned char[nServerContextSize];
- m_pObjStrm->QuickRead(pServerContext, static_cast<sal_uInt16>(nServerContextSize));
+ std::vector<unsigned char> aServerContext(nServerContextSize);
+ m_pObjStrm->QuickRead(aServerContext.data(), static_cast<sal_uInt16>(nServerContextSize));
if (nServerContextSize > 44)
{
- m_aIPData.nBrightness = pServerContext[14];
- m_aIPData.nContrast = pServerContext[19];
- m_aIPData.nEdgeEnchancement = pServerContext[24];
- m_aIPData.nSmoothing = pServerContext[29];
- m_aIPData.bInvertImage = (pServerContext[34] == 0x01);
- m_aIPData.bAutoContrast = (pServerContext[44] == 0x00);
+ m_aIPData.nBrightness = aServerContext[14];
+ m_aIPData.nContrast = aServerContext[19];
+ m_aIPData.nEdgeEnchancement = aServerContext[24];
+ m_aIPData.nSmoothing = aServerContext[29];
+ m_aIPData.bInvertImage = (aServerContext[34] == 0x01);
+ m_aIPData.bAutoContrast = (aServerContext[44] == 0x00);
}
}
m_pObjStrm->QuickReaduInt16(); //disksize
@@ -153,7 +152,6 @@ void LwpGraphicObject::Read()
}
m_nCachedBaseLine = m_pObjStrm->QuickReadInt32();
m_bIsLinked = m_pObjStrm->QuickReadInt16();
- unsigned char * pFilterContext = nullptr;
if (m_bIsLinked)
{
@@ -170,8 +168,8 @@ void LwpGraphicObject::Read()
nFilterContextSize = nMaxPossibleSize;
}
- pFilterContext = new unsigned char[nFilterContextSize];
- m_pObjStrm->QuickRead(pFilterContext, static_cast<sal_uInt16>(nFilterContextSize));
+ std::vector<unsigned char> aFilterContext(nFilterContextSize);
+ m_pObjStrm->QuickRead(aFilterContext.data(), static_cast<sal_uInt16>(nFilterContextSize));
}
if (LwpFileHeader::m_nFileRevision >= 0x000b)
{
@@ -200,9 +198,6 @@ void LwpGraphicObject::Read()
{
m_WatermarkName = m_pObjStrm->QuickReadStringPtr();
}
-
- delete[] pServerContext;
- delete[] pFilterContext;
}
void LwpGraphicObject::XFConvert (XFContentContainer* pCont)