sw: prefix members of SwEscherEx, SwWW8WrTabu, WW8_WrFkp and WW8_WrPlc0

See tdf#94879 for motivation.

Change-Id: Ia8f3150b7da815c7b5f253f76e65dada3ef8256a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135461
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
This commit is contained in:
Miklos Vajna 2022-06-07 07:57:25 +02:00
parent f30b49b82e
commit 410a64b472
5 changed files with 146 additions and 146 deletions

View file

@ -141,10 +141,10 @@ private:
class SwEscherEx : public SwBasicEscherEx
{
private:
std::vector<sal_uLong> aFollowShpIds;
EscherExHostAppData aHostData;
WinwordAnchoring aWinwordAnchoring;
WW8_WrPlcTextBoxes *pTextBxs;
std::vector<sal_uLong> m_aFollowShpIds;
EscherExHostAppData m_aHostData;
WinwordAnchoring m_aWinwordAnchoring;
WW8_WrPlcTextBoxes *m_pTextBxs;
sal_uInt32 GetFlyShapeId(const SwFrameFormat& rFormat,
unsigned int nHdFtIndex, DrawObjPointerVector &rPVec);
@ -171,7 +171,7 @@ public:
virtual void WriteFrameExtraData(const SwFrameFormat& rFormat) override;
EscherExHostAppData* StartShape(const css::uno::Reference< css::drawing::XShape > &, const tools::Rectangle*) override {return &aHostData;}
EscherExHostAppData* StartShape(const css::uno::Reference< css::drawing::XShape > &, const tools::Rectangle*) override {return &m_aHostData;}
private:
SwEscherEx(const SwEscherEx&) = delete;
SwEscherEx &operator=(const SwEscherEx&) = delete;

View file

@ -1763,8 +1763,8 @@ void SwBasicEscherEx::SetPicId(const SdrObject &, sal_uInt32,
void SwEscherEx::SetPicId(const SdrObject &rSdrObj, sal_uInt32 nShapeId,
EscherPropertyContainer &rPropOpt)
{
pTextBxs->Append(rSdrObj, nShapeId);
sal_uInt32 nPicId = pTextBxs->Count();
m_pTextBxs->Append(rSdrObj, nShapeId);
sal_uInt32 nPicId = m_pTextBxs->Count();
nPicId *= 0x10000;
rPropOpt.AddOpt( ESCHER_Prop_pictureId, nPicId );
}
@ -2169,9 +2169,9 @@ void SwBasicEscherEx::WritePictures()
SwEscherEx::SwEscherEx(SvStream* pStrm, WW8Export& rWW8Wrt)
: SwBasicEscherEx(pStrm, rWW8Wrt),
pTextBxs(nullptr)
m_pTextBxs(nullptr)
{
aHostData.SetClientData(&aWinwordAnchoring);
m_aHostData.SetClientData(&m_aWinwordAnchoring);
OpenContainer( ESCHER_DggContainer );
sal_uInt16 nColorCount = 4;
@ -2187,17 +2187,17 @@ SwEscherEx::SwEscherEx(SvStream* pStrm, WW8Export& rWW8Wrt)
sal_uInt8 i = 2; // for header/footer and the other
PlcDrawObj *pSdrObjs = mrWrt.m_pHFSdrObjs.get();
pTextBxs = mrWrt.m_pHFTextBxs.get();
m_pTextBxs = mrWrt.m_pHFTextBxs.get();
// if no header/footer -> skip over
if (!pSdrObjs->size())
{
--i;
pSdrObjs = mrWrt.m_pSdrObjs.get();
pTextBxs = mrWrt.m_pTextBxs.get();
m_pTextBxs = mrWrt.m_pTextBxs.get();
}
for( ; i--; pSdrObjs = mrWrt.m_pSdrObjs.get(), pTextBxs = mrWrt.m_pTextBxs.get() )
for( ; i--; pSdrObjs = mrWrt.m_pSdrObjs.get(), m_pTextBxs = mrWrt.m_pTextBxs.get() )
{
// "dummy char" (or any Count ?) - why? Only Microsoft knows it.
GetStream().WriteChar( i );
@ -2235,7 +2235,7 @@ SwEscherEx::SwEscherEx(SvStream* pStrm, WW8Export& rWW8Wrt)
break;
case ww8::Frame::eDrawing:
{
aWinwordAnchoring.SetAnchoring(rFormat);
m_aWinwordAnchoring.SetAnchoring(rFormat);
const SdrObject* pSdrObj = rFormat.FindRealSdrObject();
if (pSdrObj)
{
@ -2706,8 +2706,8 @@ void WinwordAnchoring::SetAnchoring(const SwFrameFormat& rFormat)
void SwEscherEx::WriteFrameExtraData( const SwFrameFormat& rFormat )
{
aWinwordAnchoring.SetAnchoring(rFormat);
aWinwordAnchoring.WriteData(*this);
m_aWinwordAnchoring.SetAnchoring(rFormat);
m_aWinwordAnchoring.WriteData(*this);
AddAtom(4, ESCHER_ClientAnchor);
GetStream().WriteInt32( 0 );
@ -2753,11 +2753,11 @@ sal_Int32 SwEscherEx::WriteFlyFrame(const DrawObj &rObj, sal_uInt32 &rShapeId,
rShapeId = GetFlyShapeId(rFormat, rObj.mnHdFtIndex, rPVec);
if( !nOff )
{
nTextId = pTextBxs->GetPos( pObj );
nTextId = m_pTextBxs->GetPos( pObj );
if( USHRT_MAX == nTextId )
{
pTextBxs->Append( *pObj, rShapeId );
nTextId = pTextBxs->Count();
m_pTextBxs->Append( *pObj, rShapeId );
nTextId = m_pTextBxs->Count();
}
else
++nTextId;
@ -2765,13 +2765,13 @@ sal_Int32 SwEscherEx::WriteFlyFrame(const DrawObj &rObj, sal_uInt32 &rShapeId,
else
{
const SdrObject* pPrevObj = pFormat->FindRealSdrObject();
nTextId = pTextBxs->GetPos( pPrevObj );
nTextId = m_pTextBxs->GetPos( pPrevObj );
if( USHRT_MAX == nTextId )
{
sal_uInt32 nPrevShapeId =
GetFlyShapeId(*pFormat, rObj.mnHdFtIndex, rPVec);
pTextBxs->Append( *pPrevObj, nPrevShapeId );
nTextId = pTextBxs->Count();
m_pTextBxs->Append( *pPrevObj, nPrevShapeId );
nTextId = m_pTextBxs->Count();
}
else
++nTextId;
@ -2791,8 +2791,8 @@ sal_Int32 SwEscherEx::WriteFlyFrame(const DrawObj &rObj, sal_uInt32 &rShapeId,
if( !rFormat.GetChain().GetPrev() )//obj in header/footer?
{
rShapeId = GetFlyShapeId(rFormat, rObj.mnHdFtIndex, rPVec);
pTextBxs->Append( &rFormat, rShapeId );
sal_uInt32 nTextId = pTextBxs->Count();
m_pTextBxs->Append( &rFormat, rShapeId );
sal_uInt32 nTextId = m_pTextBxs->Count();
nTextId *= 0x10000;
nBorderThick = WriteTextFlyFrame(rObj, rShapeId, nTextId, rPVec);
@ -2834,8 +2834,8 @@ sal_Int32 SwEscherEx::WriteTextFlyFrame(const DrawObj &rObj, sal_uInt32 nShapeId
if (const SwFrameFormat *pNext = rFormat.GetChain().GetNext())
{
sal_uInt16 nPos = FindPos(*pNext, rObj.mnHdFtIndex, rPVec);
if (USHRT_MAX != nPos && aFollowShpIds[nPos])
aPropOpt.AddOpt(ESCHER_Prop_hspNext, aFollowShpIds[nPos]);
if (USHRT_MAX != nPos && m_aFollowShpIds[nPos])
aPropOpt.AddOpt(ESCHER_Prop_hspNext, m_aFollowShpIds[nPos]);
}
nBorderThick = WriteFlyFrameAttr( rFormat, mso_sptTextBox, aPropOpt );
@ -2931,7 +2931,7 @@ void SwEscherEx::MakeZOrderArrAndFollowIds(
::lcl_makeZOrderArray(mrWrt, rSrcArr, rDstArr);
//Now set up the follow IDs
aFollowShpIds.clear();
m_aFollowShpIds.clear();
for (DrawObj* p : rDstArr)
{
@ -2947,7 +2947,7 @@ void SwEscherEx::MakeZOrderArrAndFollowIds(
sal_uLong nShapeId = bNeedsShapeId ? GenerateShapeId() : 0;
aFollowShpIds.push_back(nShapeId);
m_aFollowShpIds.push_back(nShapeId);
}
}
@ -2958,11 +2958,11 @@ sal_uInt32 SwEscherEx::GetFlyShapeId(const SwFrameFormat& rFormat,
sal_uInt32 nShapeId;
if (USHRT_MAX != nPos)
{
nShapeId = aFollowShpIds[nPos];
nShapeId = m_aFollowShpIds[nPos];
if (0 == nShapeId)
{
nShapeId = GenerateShapeId();
aFollowShpIds[ nPos ] = nShapeId;
m_aFollowShpIds[ nPos ] = nShapeId;
}
}
else
@ -2976,8 +2976,8 @@ sal_uInt32 SwEscherEx::QueryTextID(
sal_uInt32 nId = 0;
if (SdrObject* pObj = SdrObject::getSdrObjectFromXShape(xXShapeRef))
{
pTextBxs->Append( *pObj, nShapeId );
nId = pTextBxs->Count();
m_pTextBxs->Append( *pObj, nShapeId );
nId = m_pTextBxs->Count();
nId *= 0x10000;
}
return nId;

View file

@ -104,15 +104,15 @@ struct WW8_SED
class WW8_WrPlc0
{
private:
std::vector<sal_uLong> aPos; // PTRARR of CPs / FCs
sal_uLong nOfs;
std::vector<sal_uLong> m_aPos; // PTRARR of CPs / FCs
sal_uLong m_nOfs;
WW8_WrPlc0(WW8_WrPlc0 const&) = delete;
WW8_WrPlc0& operator=(WW8_WrPlc0 const&) = delete;
public:
explicit WW8_WrPlc0( sal_uLong nOffset );
sal_uInt16 Count() const { return aPos.size(); }
sal_uInt16 Count() const { return m_aPos.size(); }
void Append( sal_uLong nStartCpOrFc );
void Write( SvStream& rStrm );
};
@ -972,18 +972,18 @@ void wwFontHelper::WriteFontTable( const RtfAttributeOutput& rAttrOutput )
}
WW8_WrPlc0::WW8_WrPlc0( sal_uLong nOffset )
: nOfs( nOffset )
: m_nOfs( nOffset )
{
}
void WW8_WrPlc0::Append( sal_uLong nStartCpOrFc )
{
aPos.push_back( nStartCpOrFc - nOfs );
m_aPos.push_back( nStartCpOrFc - m_nOfs );
}
void WW8_WrPlc0::Write( SvStream& rStrm )
{
for( const auto& rPos : aPos )
for( const auto& rPos : m_aPos )
{
rStrm.WriteUInt32(rPos);
}

View file

@ -125,15 +125,15 @@ using namespace sw::types;
*/
class WW8_WrFkp
{
sal_uInt8* pFkp; // Fkp total ( first and only FCs and Sprms )
sal_uInt8* pOfs; // pointer to the offset area, later copied to pFkp
ePLCFT ePlc;
short nStartGrp; // from here on grpprls
short nOldStartGrp;
sal_uInt8 nItemSize;
sal_uInt8 nIMax; // number of entry pairs
sal_uInt8 nOldVarLen;
bool bCombined; // true : paste not allowed
sal_uInt8* m_pFkp; // Fkp total ( first and only FCs and Sprms )
sal_uInt8* m_pOfs; // pointer to the offset area, later copied to pFkp
ePLCFT m_ePlc;
short m_nStartGrp; // from here on grpprls
short m_nOldStartGrp;
sal_uInt8 m_nItemSize;
sal_uInt8 m_nIMax; // number of entry pairs
sal_uInt8 m_nOldVarLen;
bool m_bCombined; // true : paste not allowed
sal_uInt8 SearchSameSprm( sal_uInt16 nVarLen, const sal_uInt8* pSprms );
@ -148,12 +148,12 @@ public:
void Write( SvStream& rStrm, SwWW8WrGrf& rGrf );
bool IsEqualPos(WW8_FC nEndFc) const
{ return !bCombined && nIMax && nEndFc == reinterpret_cast<sal_Int32*>(pFkp)[nIMax]; }
{ return !m_bCombined && m_nIMax && nEndFc == reinterpret_cast<sal_Int32*>(m_pFkp)[m_nIMax]; }
void MergeToNew( short& rVarLen, sal_uInt8 *& pNewSprms );
bool IsEmptySprm() const
{ return !bCombined && nIMax && !nOldVarLen; }
{ return !m_bCombined && m_nIMax && !m_nOldVarLen; }
void SetNewEnd( WW8_FC nEnd )
{ reinterpret_cast<sal_Int32*>(pFkp)[nIMax] = nEnd; }
{ reinterpret_cast<sal_Int32*>(m_pFkp)[m_nIMax] = nEnd; }
WW8_FC GetStartFc() const;
WW8_FC GetEndFc() const;
@ -1081,21 +1081,21 @@ void WW8_WrPlcPn::WritePlc()
}
WW8_WrFkp::WW8_WrFkp(ePLCFT ePl, WW8_FC nStartFc)
: ePlc(ePl), nStartGrp(511), nOldStartGrp(511),
nItemSize( ( CHP == ePl ) ? 1 : 13 ),
nIMax(0), nOldVarLen(0), bCombined(false)
: m_ePlc(ePl), m_nStartGrp(511), m_nOldStartGrp(511),
m_nItemSize( ( CHP == ePl ) ? 1 : 13 ),
m_nIMax(0), m_nOldVarLen(0), m_bCombined(false)
{
pFkp = reinterpret_cast<sal_uInt8*>(new sal_Int32[128]); // 512 Byte
pOfs = reinterpret_cast<sal_uInt8*>(new sal_Int32[128]); // 512 Byte
memset( pFkp, 0, 4 * 128 );
memset( pOfs, 0, 4 * 128 );
reinterpret_cast<sal_Int32*>(pFkp)[0] = nStartFc; // 0th entry FC at nStartFc
m_pFkp = reinterpret_cast<sal_uInt8*>(new sal_Int32[128]); // 512 Byte
m_pOfs = reinterpret_cast<sal_uInt8*>(new sal_Int32[128]); // 512 Byte
memset( m_pFkp, 0, 4 * 128 );
memset( m_pOfs, 0, 4 * 128 );
reinterpret_cast<sal_Int32*>(m_pFkp)[0] = nStartFc; // 0th entry FC at nStartFc
}
WW8_WrFkp::~WW8_WrFkp()
{
delete[] reinterpret_cast<sal_Int32 *>(pFkp);
delete[] reinterpret_cast<sal_Int32 *>(pOfs);
delete[] reinterpret_cast<sal_Int32 *>(m_pFkp);
delete[] reinterpret_cast<sal_Int32 *>(m_pOfs);
}
sal_uInt8 WW8_WrFkp::SearchSameSprm( sal_uInt16 nVarLen, const sal_uInt8* pSprms )
@ -1111,13 +1111,13 @@ sal_uInt8 WW8_WrFkp::SearchSameSprm( sal_uInt16 nVarLen, const sal_uInt8* pSprms
}
short i;
for( i = 0; i < nIMax; i++ )
for( i = 0; i < m_nIMax; i++ )
{
sal_uInt8 nStart = pOfs[i * nItemSize];
sal_uInt8 nStart = m_pOfs[i * m_nItemSize];
if( nStart )
{ // has Sprms
const sal_uInt8* p = pFkp + ( o3tl::narrowing<sal_uInt16>(nStart) << 1 );
if( ( CHP == ePlc
const sal_uInt8* p = m_pFkp + ( o3tl::narrowing<sal_uInt16>(nStart) << 1 );
if( ( CHP == m_ePlc
? (*p++ == nVarLen)
: ((o3tl::narrowing<sal_uInt16>(*p++) << 1 ) == (( nVarLen+1) & 0xfffe)) )
&& !memcmp( p, pSprms, nVarLen ) )
@ -1132,14 +1132,14 @@ sal_uInt8 *WW8_WrFkp::CopyLastSprms(sal_uInt8 &rLen)
rLen=0;
sal_uInt8 *pStart=nullptr,*pRet=nullptr;
if (!bCombined)
pStart = pOfs;
if (!m_bCombined)
pStart = m_pOfs;
else
pStart = pFkp + ( nIMax + 1 ) * 4;
pStart = m_pFkp + ( m_nIMax + 1 ) * 4;
sal_uInt8 nStart = *(pStart + (nIMax-1) * nItemSize);
sal_uInt8 nStart = *(pStart + (m_nIMax-1) * m_nItemSize);
const sal_uInt8* p = pFkp + ( o3tl::narrowing<sal_uInt16>(nStart) << 1 );
const sal_uInt8* p = m_pFkp + ( o3tl::narrowing<sal_uInt16>(nStart) << 1 );
if (!*p)
p++;
@ -1147,7 +1147,7 @@ sal_uInt8 *WW8_WrFkp::CopyLastSprms(sal_uInt8 &rLen)
if (*p)
{
rLen = *p++;
if (PAP == ePlc)
if (PAP == m_ePlc)
rLen *= 2;
pRet = new sal_uInt8[rLen];
memcpy(pRet,p,rLen);
@ -1159,14 +1159,14 @@ bool WW8_WrFkp::Append( WW8_FC nEndFc, sal_uInt16 nVarLen, const sal_uInt8* pSpr
{
assert((!nVarLen || pSprms) && "Item pointer missing");
OSL_ENSURE( nVarLen < ( ( ePlc == PAP ) ? 497U : 502U ), "Sprms too long !" );
OSL_ENSURE( nVarLen < ( ( m_ePlc == PAP ) ? 497U : 502U ), "Sprms too long !" );
if( bCombined )
if( m_bCombined )
{
OSL_ENSURE( false, "Fkp::Append: Fkp is already combined" );
return false;
}
sal_Int32 n = reinterpret_cast<sal_Int32*>(pFkp)[nIMax]; // last entry
sal_Int32 n = reinterpret_cast<sal_Int32*>(m_pFkp)[m_nIMax]; // last entry
if( nEndFc <= n )
{
OSL_ENSURE( nEndFc >= n, "+Fkp: FC backwards" );
@ -1179,61 +1179,61 @@ bool WW8_WrFkp::Append( WW8_FC nEndFc, sal_uInt16 nVarLen, const sal_uInt8* pSpr
sal_uInt8 nOldP = nVarLen ? SearchSameSprm( nVarLen, pSprms ) : 0;
// Combine equal entries
short nOffset=0, nPos = nStartGrp;
short nOffset=0, nPos = m_nStartGrp;
if (nVarLen && !nOldP)
{
nPos = PAP == ePlc
? ( 13 == nItemSize // HACK: PAP and bWrtWW8 !!
? (nStartGrp & 0xFFFE ) - nVarLen - 1
: (nStartGrp - (((nVarLen + 1) & 0xFFFE)+1)) & 0xFFFE )
: ((nStartGrp - nVarLen - 1) & 0xFFFE);
nPos = PAP == m_ePlc
? ( 13 == m_nItemSize // HACK: PAP and bWrtWW8 !!
? (m_nStartGrp & 0xFFFE ) - nVarLen - 1
: (m_nStartGrp - (((nVarLen + 1) & 0xFFFE)+1)) & 0xFFFE )
: ((m_nStartGrp - nVarLen - 1) & 0xFFFE);
if( nPos < 0 )
return false; // doesn't fit at all
nOffset = nPos; // save offset (can also be uneven!)
nPos &= 0xFFFE; // Pos for Sprms ( gerade Pos )
}
if( o3tl::make_unsigned(nPos) <= ( nIMax + 2U ) * 4U + ( nIMax + 1U ) * nItemSize )
if( o3tl::make_unsigned(nPos) <= ( m_nIMax + 2U ) * 4U + ( m_nIMax + 1U ) * m_nItemSize )
// does it fits after the CPs and offsets?
return false; // no
reinterpret_cast<sal_Int32*>(pFkp)[nIMax + 1] = nEndFc; // insert FC
reinterpret_cast<sal_Int32*>(m_pFkp)[m_nIMax + 1] = nEndFc; // insert FC
nOldVarLen = static_cast<sal_uInt8>(nVarLen);
m_nOldVarLen = static_cast<sal_uInt8>(nVarLen);
if( nVarLen && !nOldP )
{ // insert it for real
nOldStartGrp = nStartGrp;
m_nOldStartGrp = m_nStartGrp;
nStartGrp = nPos;
pOfs[nIMax * nItemSize] = static_cast<sal_uInt8>( nStartGrp >> 1 );
m_nStartGrp = nPos;
m_pOfs[m_nIMax * m_nItemSize] = static_cast<sal_uInt8>( m_nStartGrp >> 1 );
// insert (start-of-data >> 1)
sal_uInt8 nCnt = static_cast< sal_uInt8 >(CHP == ePlc
sal_uInt8 nCnt = static_cast< sal_uInt8 >(CHP == m_ePlc
? ( nVarLen < 256 ) ? static_cast<sal_uInt8>(nVarLen) : 255
: ( ( nVarLen + 1 ) >> 1 ));
pFkp[ nOffset ] = nCnt; // Enter data length
memcpy( pFkp + nOffset + 1, pSprms, nVarLen ); // store Sprms
m_pFkp[ nOffset ] = nCnt; // Enter data length
memcpy( m_pFkp + nOffset + 1, pSprms, nVarLen ); // store Sprms
}
else
{
// do not enter for real ( no Sprms or recurrence )
// start-of-data 0 ( no data ) or recurrence
pOfs[nIMax * nItemSize] = nOldP;
m_pOfs[m_nIMax * m_nItemSize] = nOldP;
}
nIMax++;
m_nIMax++;
return true;
}
void WW8_WrFkp::Combine()
{
if( bCombined )
if( m_bCombined )
return;
if( nIMax )
memcpy( pFkp + ( nIMax + 1 ) * 4, pOfs, nIMax * nItemSize );
delete[] pOfs;
pOfs = nullptr;
pFkp[511] = nIMax;
bCombined = true;
if( m_nIMax )
memcpy( m_pFkp + ( m_nIMax + 1 ) * 4, m_pOfs, m_nIMax * m_nItemSize );
delete[] m_pOfs;
m_pOfs = nullptr;
m_pFkp[511] = m_nIMax;
m_bCombined = true;
#if defined OSL_BIGENDIAN // only the FCs will be rotated here
sal_uInt16 i; // the Sprms must be rotated elsewhere
@ -1249,8 +1249,8 @@ void WW8_WrFkp::Write( SvStream& rStrm, SwWW8WrGrf& rGrf )
Combine(); // If not already combined
sal_uInt8* p; // search magic for nPicLocFc
sal_uInt8* pEnd = pFkp + nStartGrp;
for( p = pFkp + 511 - 4; p >= pEnd; p-- )
sal_uInt8* pEnd = m_pFkp + m_nStartGrp;
for( p = m_pFkp + 511 - 4; p >= pEnd; p-- )
{
if( *p != GRF_MAGIC_1 ) // search for signature 0x12 0x34 0x56 0xXX
continue;
@ -1263,40 +1263,40 @@ void WW8_WrFkp::Write( SvStream& rStrm, SwWW8WrGrf& rGrf )
UInt32ToSVBT32( rGrf.GetFPos(), nPos ); // FilePos the graphics
memcpy( p, nPos, 4 ); // patch FilePos over the signature
}
rStrm.WriteBytes(pFkp, 512);
rStrm.WriteBytes(m_pFkp, 512);
}
void WW8_WrFkp::MergeToNew( short& rVarLen, sal_uInt8 *& rpNewSprms )
{
sal_uInt8 nStart = pOfs[ (nIMax-1) * nItemSize ];
sal_uInt8 nStart = m_pOfs[ (m_nIMax-1) * m_nItemSize ];
if( !nStart )
return;
// has Sprms
sal_uInt8* p = pFkp + ( o3tl::narrowing<sal_uInt16>(nStart) << 1 );
sal_uInt8* p = m_pFkp + ( o3tl::narrowing<sal_uInt16>(nStart) << 1 );
// old and new equal? Then copy only one into the new sprms
if( nOldVarLen == rVarLen && !memcmp( p+1, rpNewSprms, nOldVarLen ))
if( m_nOldVarLen == rVarLen && !memcmp( p+1, rpNewSprms, m_nOldVarLen ))
{
sal_uInt8* pNew = new sal_uInt8[ nOldVarLen ];
memcpy( pNew, p+1, nOldVarLen );
sal_uInt8* pNew = new sal_uInt8[ m_nOldVarLen ];
memcpy( pNew, p+1, m_nOldVarLen );
rpNewSprms = pNew;
}
else
{
sal_uInt8* pNew = new sal_uInt8[ nOldVarLen + rVarLen ];
memcpy( pNew, p+1, nOldVarLen );
memcpy( pNew + nOldVarLen, rpNewSprms, rVarLen );
sal_uInt8* pNew = new sal_uInt8[ m_nOldVarLen + rVarLen ];
memcpy( pNew, p+1, m_nOldVarLen );
memcpy( pNew + m_nOldVarLen, rpNewSprms, rVarLen );
rpNewSprms = pNew;
rVarLen = rVarLen + nOldVarLen;
rVarLen = rVarLen + m_nOldVarLen;
}
--nIMax;
--m_nIMax;
// if this Sprms don't used from others, remove it
bool bFnd = false;
for (sal_uInt16 n = 0; n < nIMax; ++n)
for (sal_uInt16 n = 0; n < m_nIMax; ++n)
{
if (nStart == pOfs[n * nItemSize])
if (nStart == m_pOfs[n * m_nItemSize])
{
bFnd = true;
break;
@ -1304,8 +1304,8 @@ void WW8_WrFkp::MergeToNew( short& rVarLen, sal_uInt8 *& rpNewSprms )
}
if (!bFnd)
{
nStartGrp = nOldStartGrp;
memset( p, 0, nOldVarLen+1 );
m_nStartGrp = m_nOldStartGrp;
memset( p, 0, m_nOldVarLen+1 );
}
}
@ -1314,16 +1314,16 @@ WW8_FC WW8_WrFkp::GetStartFc() const
// when bCombined, then the array beginning with pFkp is already byte-swapped
// to LittleEndian, so to extract the start and end positions they must
// be swapped back.
if( bCombined )
return SVBT32ToUInt32( pFkp ); // 0. Element
return reinterpret_cast<sal_Int32*>(pFkp)[0];
if( m_bCombined )
return SVBT32ToUInt32( m_pFkp ); // 0. Element
return reinterpret_cast<sal_Int32*>(m_pFkp)[0];
}
WW8_FC WW8_WrFkp::GetEndFc() const
{
if( bCombined )
return SVBT32ToUInt32( &(pFkp[nIMax*4]) ); // nIMax-th SVBT32-Element
return reinterpret_cast<sal_Int32*>(pFkp)[nIMax];
if( m_bCombined )
return SVBT32ToUInt32( &(m_pFkp[m_nIMax*4]) ); // nIMax-th SVBT32-Element
return reinterpret_cast<sal_Int32*>(m_pFkp)[m_nIMax];
}
// Method for managing the piece table

View file

@ -5060,11 +5060,11 @@ namespace {
class SwWW8WrTabu
{
std::unique_ptr<sal_uInt8[]> pDel; // DelArray
std::unique_ptr<sal_uInt8[]> pAddPos; // AddPos-Array
std::unique_ptr<sal_uInt8[]> pAddTyp; // AddTyp-Array
sal_uInt16 nAdd; // number of tabs to be added
sal_uInt16 nDel; // number of tabs to be deleted
std::unique_ptr<sal_uInt8[]> m_pDel; // DelArray
std::unique_ptr<sal_uInt8[]> m_pAddPos; // AddPos-Array
std::unique_ptr<sal_uInt8[]> m_pAddTyp; // AddTyp-Array
sal_uInt16 m_nAdd; // number of tabs to be added
sal_uInt16 m_nDel; // number of tabs to be deleted
SwWW8WrTabu(const SwWW8WrTabu&) = delete;
SwWW8WrTabu& operator=(const SwWW8WrTabu&) = delete;
@ -5080,12 +5080,12 @@ public:
}
SwWW8WrTabu::SwWW8WrTabu(sal_uInt16 nDelMax, sal_uInt16 nAddMax)
: nAdd(0), nDel(0)
: m_nAdd(0), m_nDel(0)
{
if (nDelMax)
pDel.reset( new sal_uInt8[nDelMax * 2] );
pAddPos.reset( new sal_uInt8[nAddMax * 2] );
pAddTyp.reset( new sal_uInt8[nAddMax] );
m_pDel.reset( new sal_uInt8[nDelMax * 2] );
m_pAddPos.reset( new sal_uInt8[nAddMax * 2] );
m_pAddTyp.reset( new sal_uInt8[nAddMax] );
}
/**
@ -5095,7 +5095,7 @@ void SwWW8WrTabu::Add(const SvxTabStop & rTS, tools::Long nAdjustment)
{
// insert tab position
ShortToSVBT16(msword_cast<sal_Int16>(rTS.GetTabPos() + nAdjustment),
pAddPos.get() + (nAdd * 2));
m_pAddPos.get() + (m_nAdd * 2));
// insert tab type
sal_uInt8 nPara = 0;
@ -5136,8 +5136,8 @@ void SwWW8WrTabu::Add(const SvxTabStop & rTS, tools::Long nAdjustment)
break;
}
pAddTyp[nAdd] = nPara;
++nAdd;
m_pAddTyp[m_nAdd] = nPara;
++m_nAdd;
}
/**
@ -5147,8 +5147,8 @@ void SwWW8WrTabu::Del(const SvxTabStop &rTS, tools::Long nAdjustment)
{
// insert tab position
ShortToSVBT16(msword_cast<sal_Int16>(rTS.GetTabPos() + nAdjustment),
pDel.get() + (nDel * 2));
++nDel;
m_pDel.get() + (m_nDel * 2));
++m_nDel;
}
/**
@ -5156,16 +5156,16 @@ void SwWW8WrTabu::Del(const SvxTabStop &rTS, tools::Long nAdjustment)
*/
void SwWW8WrTabu::PutAll(WW8Export& rWrt)
{
if (!nAdd && !nDel) //If it's a no-op
if (!m_nAdd && !m_nDel) //If it's a no-op
return;
OSL_ENSURE(nAdd <= 255, "more than 255 added tabstops?");
OSL_ENSURE(nDel <= 255, "more than 244 removed tabstops?");
if (nAdd > 255)
nAdd = 255;
if (nDel > 255)
nDel = 255;
OSL_ENSURE(m_nAdd <= 255, "more than 255 added tabstops?");
OSL_ENSURE(m_nDel <= 255, "more than 244 removed tabstops?");
if (m_nAdd > 255)
m_nAdd = 255;
if (m_nDel > 255)
m_nDel = 255;
sal_uInt16 nSiz = 2 * nDel + 3 * nAdd + 2;
sal_uInt16 nSiz = 2 * m_nDel + 3 * m_nAdd + 2;
if (nSiz > 255)
nSiz = 255;
@ -5173,12 +5173,12 @@ void SwWW8WrTabu::PutAll(WW8Export& rWrt)
// insert cch
rWrt.m_pO->push_back(msword_cast<sal_uInt8>(nSiz));
// write DelArr
rWrt.m_pO->push_back(msword_cast<sal_uInt8>(nDel));
rWrt.OutSprmBytes(pDel.get(), nDel * 2);
rWrt.m_pO->push_back(msword_cast<sal_uInt8>(m_nDel));
rWrt.OutSprmBytes(m_pDel.get(), m_nDel * 2);
// write InsArr
rWrt.m_pO->push_back(msword_cast<sal_uInt8>(nAdd));
rWrt.OutSprmBytes(pAddPos.get(), 2 * nAdd); // AddPosArray
rWrt.OutSprmBytes(pAddTyp.get(), nAdd); // AddTypArray
rWrt.m_pO->push_back(msword_cast<sal_uInt8>(m_nAdd));
rWrt.OutSprmBytes(m_pAddPos.get(), 2 * m_nAdd); // AddPosArray
rWrt.OutSprmBytes(m_pAddTyp.get(), m_nAdd); // AddTypArray
}
static void ParaTabStopAdd( WW8Export& rWrt,