summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2006-07-10 13:15:07 +0000
committerOliver Bolte <obo@openoffice.org>2006-07-10 13:15:07 +0000
commitfb078e5987e156bbe7b11db075f7082be8e42c66 (patch)
tree2007c406d4046b11a3bf208bc2e56d99bbcb9425
parent3232f015c6a2bd65bc6252908f31ea9a128c8db4 (diff)
INTEGRATION: CWS dr48 (1.25.156); FILE MERGED
2006/05/03 14:59:15 dr 1.25.156.1: #134146# load FrameChild records corerctly
-rw-r--r--svx/source/msfilter/msocximex.cxx167
1 files changed, 80 insertions, 87 deletions
diff --git a/svx/source/msfilter/msocximex.cxx b/svx/source/msfilter/msocximex.cxx
index 78c43fb8cc8f..9149f0fa09c4 100644
--- a/svx/source/msfilter/msocximex.cxx
+++ b/svx/source/msfilter/msocximex.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: msocximex.cxx,v $
*
- * $Revision: 1.26 $
+ * $Revision: 1.27 $
*
- * last change: $Author: hr $ $Date: 2006-06-19 16:20:04 $
+ * last change: $Author: obo $ $Date: 2006-07-10 14:15:07 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -648,111 +648,104 @@ class ContainerRecReader
bool bOk = true;
for (sal_uInt32 nRecord = 0; nRecord < nNoRecords; ++nRecord)
{
+ // DR #134146# redo loading of FrameChild data
+
ContainerRecord rec;
- sal_uInt16 nUnknown12;
- *pS >> nUnknown12;
- sal_uInt16 nRecordLen;
- *pS >> nRecordLen;
- sal_uInt32 nUnknown13;
- *pS >> nUnknown13;
- sal_uInt32 nNameLen;
- *pS >> nNameLen;
- /*
- i.e. the "i"nSubStorage directory contains the contents if its a
- frame
- */
- *pS >> rec.nSubStorageId;
- long nCount = 12;
-
- sal_uInt32 nSkipLen = 0;
- bool bHasControlTip = false;
-#if 0
-// alternative to below, yet to be proven
- sal_uInt8* pFlags;
- pFlags = static_cast<sal_uInt8*>(&nUnknown13);
- if ( pFlags[0] == 0xf5 )
+ // record header
+ sal_uInt16 nId, nSize;
+ *pS >> nId >> nSize;
+ sal_Size nStartPos = pS->Tell();
+
+ // content flags
+ sal_uInt32 nContentFlags;
+ *pS >> nContentFlags;
+
+ // length of control name
+ sal_uInt32 nNameLen = 0;
+ if( nContentFlags & 0x00000001 )
+ *pS >> nNameLen;
+ // length of control tag
+ sal_uInt32 nTagLen = 0;
+ if( nContentFlags & 0x00000002 )
+ *pS >> nTagLen;
+ // substorage id for frames
+ if( nContentFlags & 0x00000004 )
+ *pS >> rec.nSubStorageId;
+ // help-context id
+ if( nContentFlags & 0x00000008 )
+ pS->SeekRel( 4 );
+ // option flags
+ if( nContentFlags & 0x00000010 )
+ pS->SeekRel( 4 );
+ // substream size
+ if( nContentFlags & 0x00000020 )
+ *pS >> rec.nSubStreamLen;
+ // tabstop position
+ if( nContentFlags & 0x00000040 )
+ *pS >> rec.nTabPos;
+ // control type
+ if( nContentFlags & 0x00000080 )
+ *pS >> rec.nTypeIdent;
+ // length of infotip
+ sal_uInt32 nTipLen = 0;
+ if( nContentFlags & 0x00000800 )
{
- nSkipLen = 4;
+ ReadAlign( pS, pS->Tell() - nStartPos, 4 );
+ *pS >> nTipLen;
}
- else
+ // length of control source name
+ sal_uInt32 nCtrlSrcLen = 0;
+ if( nContentFlags & 0x00002000 )
{
- nSkipLen = 4;
+ ReadAlign( pS, pS->Tell() - nStartPos, 4 );
+ *pS >> nCtrlSrcLen;
}
- if ( pFlags[1] != 0x01 )
+
+ // control name
+ sal_Char* pName = 0;
+ sal_uInt32 nNameBufSize = lclGetBufferSize( nNameLen );
+ if( nNameBufSize > 0 )
{
- bHasControlTip = true;
+ pName = new char[ nNameBufSize ];
+ ReadAlign( pS, pS->Tell() - nStartPos, 4 );
+ pS->Read( pName, nNameBufSize );
}
-#else
- switch (nUnknown13)
+ // control tag
+ sal_uInt32 nTagBufSize = lclGetBufferSize( nTagLen );
+ if( nTagBufSize > 0 )
{
- default:
- bOk = false;
- break;
- case 0x3E5:
- case 0x9d5:
- case 0x9e5:
- case 0x11e5:
- case 0x21e5:
- case 0x41e5:
- nSkipLen = 0;
- bHasControlTip = true;
- break;
- case 0x1D5:
- case 0x1E5:
- nSkipLen = 0;
- break;
- case 0x3f5:
- case 0x9f5:
- case 0x11f5: //
- case 0x21f5: // Guess
- case 0x41f5: //
- nSkipLen = 4;
- bHasControlTip = true;
- break;
- case 0x1F5:
- nSkipLen = 4;
- break;
+ ReadAlign( pS, pS->Tell() - nStartPos, 4 );
+ pS->SeekRel( nTagBufSize );
}
-#endif
- if (!bOk)
- break;
- pS->SeekRel(nSkipLen);
- nCount += nSkipLen;
-
- *pS >> rec.nSubStreamLen;
- *pS >> rec.nTabPos;
- *pS >> rec.nTypeIdent;
- nCount += 4;
- sal_uInt32 nControlTipLen = 0;
- if (bHasControlTip)
+ // control position
+ if( nContentFlags & 0x00000100 )
{
- *pS >> nControlTipLen;
- nCount += 4;
+ ReadAlign( pS, pS->Tell() - nStartPos, 4 );
+ *pS >> rec.nLeft >> rec.nTop;
}
- sal_Char *pName = 0;
- sal_uInt32 nBufSize = lclGetBufferSize(nNameLen);
- if (nBufSize)
+ // control infotip
+ sal_uInt32 nTipBufSize = lclGetBufferSize( nTipLen );
+ if( nTipBufSize > 0 )
{
- pName = new char[ nBufSize ];
- pS->Read( pName, nBufSize );
- nCount += nBufSize;
+ ReadAlign( pS, pS->Tell() - nStartPos, 4 );
+ pS->SeekRel( nTipBufSize );
}
-
- nCount += ReadAlign(pS, nCount, 4);
-
- if ( !isMultiPage )
+ // control source name
+ sal_uInt32 nCtrlSrcBufSize = lclGetBufferSize( nCtrlSrcLen );
+ if( nCtrlSrcBufSize > 0 )
{
- *pS >> rec.nLeft;
- *pS >> rec.nTop;
- nCount += 8;
+ ReadAlign( pS, pS->Tell() - nStartPos, 4 );
+ pS->SeekRel( nCtrlSrcBufSize );
}
- pS->SeekRel(nRecordLen - nCount);
+
+ // seek to end of data
+ pS->Seek( nStartPos + nSize );
rec.cName = lclCreateOUString(pName, nNameLen);
- delete pName;
+ delete[] pName;
OCX_Control* pControl = NULL;
if( pContainerControl->createFromContainerRecord( rec, pControl ) &&