merge the formfield patch from ooo-build
[ooovba.git] / applied_patches / 0182-calc-xls-export-encryption-condfmt-fix.diff
blob4e2ae3c5048179932e17f0e5cad17a09404c6e39
1 diff --git sc/source/filter/xcl97/xcl97rec.cxx sc/source/filter/xcl97/xcl97rec.cxx
2 index 97bd958..eea4ec0 100644
3 --- sc/source/filter/xcl97/xcl97rec.cxx
4 +++ sc/source/filter/xcl97/xcl97rec.cxx
5 @@ -1496,8 +1496,10 @@ XclExpInterfaceEnd::~XclExpInterfaceEnd()
6 rStrm << aData[i];
9 -void XclExpInterfaceEnd::WriteBody( XclExpStream& /*rStrm*/ )
10 +void XclExpInterfaceEnd::WriteBody( XclExpStream& rStrm )
12 + // Don't forget to re-enable encryption.
13 + rStrm.EnableEncryption();
16 // ============================================================================
17 diff --git sc/source/filter/excel/xecontent.cxx sc/source/filter/excel/xecontent.cxx
18 index ae987eb..4575fca 100644
19 --- sc/source/filter/excel/xecontent.cxx
20 +++ sc/source/filter/excel/xecontent.cxx
21 @@ -761,19 +761,19 @@ void XclExpCFImpl::WriteBody( XclExpStream& rStrm )
22 // font used flag for underline -> 0 = used, 1 = default
23 sal_uInt32 nFontFlags3 = mbUnderlUsed ? 0 : EXC_CF_FONT_UNDERL;
25 - rStrm.WriteZeroBytes( 64 );
26 + rStrm.WriteZeroBytesToRecord( 64 );
27 rStrm << nHeight
28 << nStyle
29 << maFontData.mnWeight
30 << EXC_FONTESC_NONE
31 << maFontData.mnUnderline;
32 - rStrm.WriteZeroBytes( 3 );
33 + rStrm.WriteZeroBytesToRecord( 3 );
34 rStrm << nColor
35 << sal_uInt32( 0 )
36 << nFontFlags1
37 << EXC_CF_FONT_ESCAPEM // escapement never used -> set the flag
38 << nFontFlags3;
39 - rStrm.WriteZeroBytes( 16 );
40 + rStrm.WriteZeroBytesToRecord( 16 );
41 rStrm << sal_uInt16( 1 ); // must be 1
44 diff --git sc/source/filter/excel/xestream.cxx sc/source/filter/excel/xestream.cxx
45 index 0f8262c..2d10d80 100644
46 --- sc/source/filter/excel/xestream.cxx
47 +++ sc/source/filter/excel/xestream.cxx
48 @@ -258,6 +258,17 @@ void XclExpStream::WriteZeroBytes( sal_Size nBytes )
49 WriteRawZeroBytes( nBytes );
52 +void XclExpStream::WriteZeroBytesToRecord( sal_Size nBytes )
54 + if (!mbInRec)
55 + // not in record.
56 + return;
58 + sal_uInt8 nZero = 0;
59 + for (sal_Size i = 0; i < nBytes; ++i)
60 + *this << nZero;
63 sal_Size XclExpStream::CopyFromStream( SvStream& rInStrm, sal_Size nBytes )
65 sal_Size nStrmPos = rInStrm.Tell();
66 diff --git sc/source/filter/inc/xestream.hxx sc/source/filter/inc/xestream.hxx
67 index 84bf4ce..aaa56b2 100644
68 --- sc/source/filter/inc/xestream.hxx
69 +++ sc/source/filter/inc/xestream.hxx
70 @@ -126,6 +126,9 @@ public:
71 sal_Size Write( const void* pData, sal_Size nBytes );
72 /** Writes a sequence of nBytes zero bytes (respects slice setting). */
73 void WriteZeroBytes( sal_Size nBytes );
75 + void WriteZeroBytesToRecord( sal_Size nBytes );
77 /** Copies nBytes bytes from current position of the stream rInStrm.
78 @descr Omitting the second parameter means: read to end of stream. */
79 sal_Size CopyFromStream( SvStream& rInStrm, sal_Size nBytes = STREAM_SEEK_TO_END );