1 /**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_sw.hxx"
26 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil -*- */
27 #include <doc.hxx>
28 #include "writerhelper.hxx"
29 #include <com/sun/star/embed/XClassifiedObject.hpp>
30
31 #include <algorithm>
32 #include <functional>
33 #include <osl/endian.h>
34 #include <sot/storage.hxx>
35 #include <com/sun/star/drawing/XShape.hpp>
36 #include <hintids.hxx>
37 #include <svx/svdoole2.hxx>
38 #include <filter/msfilter/msdffimp.hxx>
39 #include <svx/unoapi.hxx>
40 #include <filter/msfilter/msocximex.hxx>
41
42 #include <sot/exchange.hxx>
43 #include <swtypes.hxx>
44 #include <fmtanchr.hxx>
45 #include <fmtcntnt.hxx>
46 #include <dcontact.hxx>
47 #include <frmfmt.hxx>
48 #include <pam.hxx>
49 #include <ndgrf.hxx>
50 #include <docsh.hxx> // fuer Ole-Node
51 #include <mdiexp.hxx> // Progress
52 #include <redline.hxx>
53 #include <fltshell.hxx>
54 #include <unodraw.hxx>
55 #include <shellio.hxx>
56 #include <ndole.hxx>
57
58 #include <svtools/filter.hxx>
59
60 #include "ww8scan.hxx"
61 #include "ww8par.hxx"
62 #include "ww8par2.hxx" // WWFlyPara::BoxUpWidth()
63
64 struct OLE_MFP
65 {
66 sal_Int16 mm; // 0x6 int
67 sal_Int16 xExt; // 0x8 int in 1/100 mm
68 sal_Int16 yExt; // 0xa int in 1/100 mm
69 sal_Int16 hMF; // 0xc int
70 };
71
72 using namespace ::com::sun::star;
73
74 // SV_IMPL_OP_PTRARR_SORT(WW8AuthorInfos, WW8AuthorInfo_Ptr)
SV_IMPL_OP_PTRARR_SORT(WW8OleMaps,WW8OleMap_Ptr)75 SV_IMPL_OP_PTRARR_SORT(WW8OleMaps, WW8OleMap_Ptr)
76
77 static bool SwWw8ReadScaling(long& rX, long& rY, SvStorageRef& rSrc1)
78 {
79 // Skalierungsfaktoren holen:
80 // Informationen in PIC-Stream ( durch ausprobieren )
81 // 0x0 (l)cb
82 // 0x08 .. 0x0a Flags ??
83 // 0x08 Inh: 1 / 0
84 // 0x09 Inh: 0,8,0x18
85 // 0x0a Inh: immer 8, MAP_ANISOTROPIC ???
86 // 0x0b Inh: immer 0
87 // 0x0c, 0x10 Originalgroesse x,y in 1/100 mm
88 // 0x14, 0x16 Originalgroesse x,y in tw
89 // 0x2c, 0x30 Skalierung x,y in Promille
90 // 0x34, 0x38, 0x3c, 0x40 Crop Left, Top, Right, Bot in tw
91
92 SvStorageStreamRef xSrc3 = rSrc1->OpenSotStream( CREATE_CONST_ASC( "\3PIC" ),
93 STREAM_STD_READ | STREAM_NOCREATE);
94 SvStorageStream* pS = xSrc3;
95 pS->SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
96 pS->Seek( STREAM_SEEK_TO_END );
97
98 ASSERT( pS->Tell() >= 76, "+OLE-PIC-Stream is shorter than 76 Byte" );
99
100 sal_Int32 nOrgWidth,
101 nOrgHeight,
102 nScaleX,
103 nScaleY,
104 nCropLeft,
105 nCropTop,
106 nCropRight,
107 nCropBottom;
108 pS->Seek( 0x14 );
109 *pS >> nOrgWidth // Original Size in 1/100 mm
110 >> nOrgHeight;
111 pS->Seek( 0x2c );
112 *pS >> nScaleX // Scaling in Promille
113 >> nScaleY
114 >> nCropLeft // Cropping in 1/100 mm
115 >> nCropTop
116 >> nCropRight
117 >> nCropBottom;
118
119 rX = nOrgWidth - nCropLeft - nCropRight;
120 rY = nOrgHeight - nCropTop - nCropBottom;
121 if (10 > nScaleX || 65536 < nScaleX || 10 > nScaleY || 65536 < nScaleY)
122 {
123 ASSERT( !pS, "+OLE-Scalinginformation in PIC-Stream wrong" );
124 return false;
125 }
126 else
127 {
128 rX = (rX * nScaleX) / 1000;
129 rY = (rY * nScaleY) / 1000;
130 }
131 return true;
132 }
133
SwWw6ReadMetaStream(GDIMetaFile & rWMF,OLE_MFP * pMfp,SvStorageRef & rSrc1)134 static bool SwWw6ReadMetaStream(GDIMetaFile& rWMF, OLE_MFP* pMfp,
135 SvStorageRef& rSrc1)
136 {
137 SvStorageStreamRef xSrc2 = rSrc1->OpenSotStream( CREATE_CONST_ASC("\3META"),
138 STREAM_STD_READ | STREAM_NOCREATE);
139 SvStorageStream* pSt = xSrc2;
140 pSt->SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
141 sal_uLong nRead = pSt->Read( pMfp, sizeof(*pMfp ) );
142 // Mini-Placable-Header lesen
143 if (nRead != sizeof(*pMfp))
144 return false;
145
146 #if defined OSL_BIGENDIAN
147 pMfp->mm = SWAPSHORT( pMfp->mm );
148 pMfp->xExt = SWAPSHORT( pMfp->xExt );
149 pMfp->yExt = SWAPSHORT( pMfp->yExt );
150 #endif // OSL_BIGENDIAN
151
152 if( pMfp->mm == 94 || pMfp->mm == 99 )
153 {
154 ASSERT( !pSt, "+OLE: Falscher Metafile-Typ" );
155 return false;
156 }
157 if( pMfp->mm != 8 )
158 {
159 ASSERT( !pSt, "+OLE: Falscher Metafile-Typ ( nicht Anisotropic )" );
160 }
161 if( !pMfp->xExt || !pMfp->yExt )
162 {
163 ASSERT( !pSt, "+OLE: Groesse von 0 ???" );
164 return false;
165 }
166 bool bOk = ReadWindowMetafile( *pSt, rWMF, NULL ) ? true : false; // WMF lesen
167 // *pSt >> aWMF geht nicht ohne placable Header
168 if (!bOk || pSt->GetError() || rWMF.GetActionCount() == 0)
169 {
170 ASSERT( !pSt, "+OLE: Konnte Metafile nicht lesen" );
171 return false;
172 }
173
174 rWMF.SetPrefMapMode( MapMode( MAP_100TH_MM ) );
175
176
177 // MetaFile auf neue Groesse skalieren und
178 // neue Groesse am MetaFile setzen
179 Size aOldSiz( rWMF.GetPrefSize() );
180 Size aNewSiz( pMfp->xExt, pMfp->yExt );
181 Fraction aFracX( aNewSiz.Width(), aOldSiz.Width() );
182 Fraction aFracY( aNewSiz.Height(), aOldSiz.Height() );
183
184 rWMF.Scale( aFracX, aFracY );
185 rWMF.SetPrefSize( aNewSiz );
186
187 return true;
188 }
189
SwWw6ReadMacPICTStream(Graphic & rGraph,SvStorageRef & rSrc1)190 static bool SwWw6ReadMacPICTStream(Graphic& rGraph, SvStorageRef& rSrc1)
191 {
192 // 03-META-Stream nicht da. Vielleicht ein 03-PICT ?
193 SvStorageStreamRef xSrc4 = rSrc1->OpenSotStream( CREATE_CONST_ASC( "\3PICT" ));
194 SvStorageStream* pStp = xSrc4;
195 pStp->SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
196 sal_uInt8 aTestA[10]; // Ist der 01Ole-Stream ueberhaupt vorhanden
197 sal_uLong nReadTst = pStp->Read( aTestA, sizeof( aTestA ) );
198 if (nReadTst != sizeof(aTestA))
199 return false;
200
201 pStp->Seek( STREAM_SEEK_TO_BEGIN );
202
203 #ifdef DEBUGDUMP
204 SvStream *pDbg = sw::hack::CreateDebuggingStream(CREATE_CONST_ASC(".pct"));
205 pDbg->Seek(0x200); //Prepend extra 0x200 of zeros to make this a valid PICT
206 sw::hack::DumpStream(*pStp, *pDbg);
207 delete pDbg;
208 #endif
209
210 // Mac-Pict steht im 03PICT-StorageStream allerdings ohne die ersten 512
211 // Bytes, die bei einem MAC-PICT egal sind ( werden nicht ausgewertet )
212 return SwWW8ImplReader::GetPictGrafFromStream(rGraph, *pStp);
213 }
214
InsertOle(SdrOle2Obj & rObject,const SfxItemSet & rFlySet,const SfxItemSet & rGrfSet)215 SwFlyFrmFmt* SwWW8ImplReader::InsertOle(SdrOle2Obj &rObject,
216 const SfxItemSet &rFlySet, const SfxItemSet &rGrfSet)
217 {
218 SfxObjectShell *pPersist = rDoc.GetPersist();
219 ASSERT(pPersist, "No persist, cannot insert objects correctly");
220 if (!pPersist)
221 return 0;
222
223 SwFlyFrmFmt *pRet = 0;
224
225 SfxItemSet *pMathFlySet = 0;
226 uno::Reference < embed::XClassifiedObject > xClass( rObject.GetObjRef(), uno::UNO_QUERY );
227 if( xClass.is() )
228 {
229 SvGlobalName aClassName( xClass->getClassID() );
230 if (SotExchange::IsMath(aClassName))
231 {
232 /*
233 StarMath sets it own fixed size, so its counter productive to use the
234 size word says it is. i.e. Don't attempt to override its size.
235 */
236 pMathFlySet = new SfxItemSet(rFlySet);
237 pMathFlySet->ClearItem(RES_FRM_SIZE);
238 }
239 }
240
241 /*
242 Take complete responsibility of the object away from SdrOle2Obj and to
243 me here locally. This utility class now owns the object.
244 */
245
246 // TODO/MBA: is the object inserted multiple times here? Testing!
247 // And is it a problem that we now use the same naming scheme as in the other apps?
248 sw::hack::DrawingOLEAdaptor aOLEObj(rObject, *pPersist);
249 ::rtl::OUString sNewName;
250 bool bSuccess = aOLEObj.TransferToDoc(sNewName);
251
252 ASSERT(bSuccess, "Insert OLE failed");
253 if (bSuccess)
254 {
255 const SfxItemSet *pFlySet = pMathFlySet ? pMathFlySet : &rFlySet;
256 pRet = rDoc.InsertOLE(*pPaM, sNewName, rObject.GetAspect(), pFlySet, &rGrfSet, 0);
257 }
258 delete pMathFlySet;
259 return pRet;
260 }
261
ImportOle(const Graphic * pGrf,const SfxItemSet * pFlySet,const SfxItemSet * pGrfSet,const Rectangle & aVisArea)262 SwFrmFmt* SwWW8ImplReader::ImportOle(const Graphic* pGrf,
263 const SfxItemSet* pFlySet, const SfxItemSet *pGrfSet, const Rectangle& aVisArea )
264 {
265 ::SetProgressState(nProgress, mpDocShell); // Update
266 SwFrmFmt* pFmt = 0;
267
268 GrafikCtor();
269
270 Graphic aGraph;
271 SdrObject* pRet = ImportOleBase(aGraph, pGrf, pFlySet, aVisArea );
272
273 // create flyset
274 SfxItemSet* pTempSet = 0;
275 if( !pFlySet )
276 {
277 pTempSet = new SfxItemSet( rDoc.GetAttrPool(), RES_FRMATR_BEGIN,
278 RES_FRMATR_END-1);
279
280 pFlySet = pTempSet;
281
282 // Abstand/Umrandung raus
283 if (!mbNewDoc)
284 Reader::ResetFrmFmtAttrs( *pTempSet );
285
286 SwFmtAnchor aAnchor( FLY_AS_CHAR );
287 aAnchor.SetAnchor( pPaM->GetPoint() );
288 pTempSet->Put( aAnchor );
289
290 const Size aSizeTwip = OutputDevice::LogicToLogic(
291 aGraph.GetPrefSize(), aGraph.GetPrefMapMode(), MAP_TWIP );
292
293 pTempSet->Put( SwFmtFrmSize( ATT_FIX_SIZE, aSizeTwip.Width(),
294 aSizeTwip.Height() ) );
295 pTempSet->Put( SwFmtVertOrient( 0, text::VertOrientation::TOP, text::RelOrientation::FRAME ));
296
297 if( pSFlyPara )
298 {
299 // OLE im Rahmen ? ok, Rahmen auf Bildgroesse vergroessern (
300 // nur wenn Auto-Breite )
301 pSFlyPara->BoxUpWidth( aSizeTwip.Width() );
302 }
303 }
304
305 if (pRet) // Ole-Object wurde eingefuegt
306 {
307 if (pRet->ISA(SdrOle2Obj))
308 {
309 pFmt = InsertOle(*((SdrOle2Obj*)pRet), *pFlySet, *pGrfSet);
310 SdrObject::Free( pRet ); // das brauchen wir nicht mehr
311 }
312 else
313 pFmt = rDoc.InsertDrawObj(*pPaM, *pRet, *pFlySet );
314 }
315 else if (
316 GRAPHIC_GDIMETAFILE == aGraph.GetType() ||
317 GRAPHIC_BITMAP == aGraph.GetType()
318 )
319 {
320 pFmt = rDoc.Insert(*pPaM, aEmptyStr, aEmptyStr, &aGraph, pFlySet,
321 pGrfSet, NULL);
322 }
323 delete pTempSet;
324 return pFmt;
325 }
326
ImportOleWMF(SvStorageRef xSrc1,GDIMetaFile & rWMF,long & rX,long & rY)327 bool SwWW8ImplReader::ImportOleWMF(SvStorageRef xSrc1,GDIMetaFile &rWMF,
328 long &rX,long &rY)
329 {
330 bool bOk = false;
331 OLE_MFP aMfp;
332 if( SwWw6ReadMetaStream( rWMF, &aMfp, xSrc1 ) )
333 {
334 /*
335 take scaling factor as found in PIC and apply it to graphic.
336 */
337 SwWw8ReadScaling( rX, rY, xSrc1 );
338 Size aFinalSize, aOrigSize;
339 aFinalSize.Width() = rX;
340 aFinalSize.Height() = rY;
341 aFinalSize = OutputDevice::LogicToLogic(
342 aFinalSize, MAP_TWIP, rWMF.GetPrefMapMode() );
343 aOrigSize = rWMF.GetPrefSize();
344 Fraction aScaleX(aFinalSize.Width(),aOrigSize.Width());
345 Fraction aScaleY(aFinalSize.Height(),aOrigSize.Height());
346 rWMF.Scale( aScaleX, aScaleY );
347 bOk = true;
348 }
349 return bOk;
350 }
351
ImportOleBase(Graphic & rGraph,const Graphic * pGrf,const SfxItemSet * pFlySet,const Rectangle & aVisArea)352 SdrObject* SwWW8ImplReader::ImportOleBase( Graphic& rGraph,
353 const Graphic* pGrf, const SfxItemSet* pFlySet, const Rectangle& aVisArea )
354 {
355 SdrObject* pRet = 0;
356 ASSERT( pStg, "ohne storage geht hier fast gar nichts!" );
357
358 ::SetProgressState( nProgress, rDoc.GetDocShell() ); // Update
359
360 long nX=0, nY=0; // nX, nY is graphic size
361 bool bOleOk = true;
362
363 String aSrcStgName = '_';
364 // ergibt Name "_4711"
365 aSrcStgName += String::CreateFromInt32( nObjLocFc );
366
367 SvStorageRef xSrc0 = pStg->OpenSotStorage(CREATE_CONST_ASC(SL::aObjectPool));
368 SvStorageRef xSrc1 = xSrc0->OpenSotStorage( aSrcStgName,
369 STREAM_READWRITE| STREAM_SHARE_DENYALL );
370
371
372 if (pGrf)
373 {
374 rGraph = *pGrf;
375 const Size aSizeTwip = OutputDevice::LogicToLogic(
376 rGraph.GetPrefSize(), rGraph.GetPrefMapMode(), MAP_TWIP );
377 nX = aSizeTwip.Width();
378 nY = aSizeTwip.Height();
379 }
380 else
381 {
382 GDIMetaFile aWMF;
383
384 if (ImportOleWMF(xSrc1,aWMF,nX,nY))
385 rGraph = Graphic( aWMF );
386 else if( SwWw6ReadMacPICTStream( rGraph, xSrc1 ) )
387 {
388 // 03-META-Stream nicht da. Vielleicht ein 03-PICT ?
389 const Size aSizeTwip = OutputDevice::LogicToLogic(
390 rGraph.GetPrefSize(), rGraph.GetPrefMapMode(), MAP_TWIP );
391 nX = aSizeTwip.Width();
392 nY = aSizeTwip.Height();
393 // PICT: kein WMF da -> Grafik statt OLE
394 bOleOk = false;
395 }
396 } // StorageStreams wieder zu
397
398
399 Rectangle aRect(0, 0, nX, nY);
400
401 if (pFlySet)
402 {
403 if (const SwFmtFrmSize* pSize =
404 (const SwFmtFrmSize*)pFlySet->GetItem(RES_FRM_SIZE, false))
405 {
406 aRect.SetSize(pSize->GetSize());
407 }
408 }
409
410 if (!(bIsHeader || bIsFooter))
411 {
412 //Can't put them in headers/footers :-(
413 uno::Reference< drawing::XShape > xRef;
414 ASSERT(pFormImpl, "Impossible");
415 if (pFormImpl && pFormImpl->ReadOCXStream(xSrc1, &xRef, false))
416 {
417 pRet = GetSdrObjectFromXShape(xRef);
418 ASSERT(pRet, "Impossible");
419 if (pRet)
420 pRet->SetLogicRect(aRect);
421 return pRet;
422 }
423 }
424
425 if (GRAPHIC_GDIMETAFILE == rGraph.GetType() ||
426 GRAPHIC_BITMAP == rGraph.GetType())
427 {
428 ::SetProgressState(nProgress, mpDocShell); // Update
429
430 if (bOleOk)
431 {
432 sal_uLong nOldPos = pDataStream->Tell();
433 pDataStream->Seek(STREAM_SEEK_TO_END);
434 SvStream *pTmpData = 0;
435 if (nObjLocFc < pDataStream->Tell())
436 {
437 pTmpData = pDataStream;
438 pTmpData->Seek( nObjLocFc );
439 }
440
441 sal_Int64 nAspect = embed::Aspects::MSOLE_CONTENT;
442
443 {
444 SvStorageStreamRef xObjInfoSrc = xSrc1->OpenSotStream( CREATE_CONST_ASC( "\3ObjInfo" ),
445 STREAM_STD_READ | STREAM_NOCREATE );
446 if ( xObjInfoSrc.Is() && !xObjInfoSrc->GetError() )
447 {
448 sal_uInt8 nByte = 0;
449 *xObjInfoSrc >> nByte;
450 if ( ( nByte >> 4 ) & embed::Aspects::MSOLE_ICON )
451 nAspect = embed::Aspects::MSOLE_ICON;
452 }
453 }
454
455 ErrCode nError = ERRCODE_NONE;
456 pRet = SvxMSDffManager::CreateSdrOLEFromStorage(
457 aSrcStgName, xSrc0, mpDocShell->GetStorage(), rGraph, aRect, aVisArea, pTmpData, nError,
458 SwMSDffManager::GetFilterFlags(), nAspect );
459 pDataStream->Seek( nOldPos );
460 }
461 }
462 return pRet;
463 }
464
ReadRevMarkAuthorStrTabl(SvStream & rStrm,sal_Int32 nTblPos,sal_Int32 nTblSiz,SwDoc & rDocOut)465 void SwWW8ImplReader::ReadRevMarkAuthorStrTabl( SvStream& rStrm,
466 sal_Int32 nTblPos, sal_Int32 nTblSiz, SwDoc& rDocOut )
467 {
468 ::std::vector<String> aAuthorNames;
469 WW8ReadSTTBF( !bVer67, rStrm, nTblPos, nTblSiz, bVer67 ? 2 : 0,
470 eStructCharSet, aAuthorNames );
471
472 sal_uInt16 nCount = static_cast< sal_uInt16 >(aAuthorNames.size());
473 for( sal_uInt16 nAuthor = 0; nAuthor < nCount; ++nAuthor )
474 {
475 // Store author in doc
476 sal_uInt16 nSWId = rDocOut.InsertRedlineAuthor(aAuthorNames[nAuthor]);
477 // Store matchpair
478 if( !pAuthorInfos )
479 pAuthorInfos = new sw::util::AuthorInfos;
480 sw::util::AuthorInfo* pAutorInfo = new sw::util::AuthorInfo( nAuthor, nSWId );
481 if( 0 == pAuthorInfos->Insert( pAutorInfo ) )
482 delete pAutorInfo;
483 }
484 }
485
486 /*
487 Revision Marks ( == Redlining )
488 */
489 // insert or delete content (change char attributes resp.)
Read_CRevisionMark(RedlineType_t eType,const sal_uInt8 * pData,short nLen)490 void SwWW8ImplReader::Read_CRevisionMark(RedlineType_t eType,
491 const sal_uInt8* pData, short nLen )
492 {
493 // there *must* be a SprmCIbstRMark[Del] and a SprmCDttmRMark[Del]
494 // pointing to the very same char position as our SprmCFRMark[Del]
495 if (!pPlcxMan)
496 return;
497 const sal_uInt8* pSprmCIbstRMark;
498 const sal_uInt8* pSprmCDttmRMark;
499 if( nsRedlineType_t::REDLINE_FORMAT == eType )
500 {
501 pSprmCIbstRMark = pData+1;
502 pSprmCDttmRMark = pData+3;
503 }
504 else
505 {
506 /*
507 #101578#
508 It is possible to have a number of date stamps for the created time
509 of the change, (possibly a word bug) so we must use the "get a full
510 list" variant of HasCharSprm and take the last one as the true one.
511 */
512 std::vector<const sal_uInt8 *> aResult;
513 bool bIns = (nsRedlineType_t::REDLINE_INSERT == eType);
514 if( bVer67 )
515 {
516 pPlcxMan->HasCharSprm(69, aResult);
517 pSprmCIbstRMark = aResult.empty() ? 0 : aResult.back();
518 aResult.clear();
519 pPlcxMan->HasCharSprm(70, aResult);
520 pSprmCDttmRMark = aResult.empty() ? 0 : aResult.back();
521 }
522 else
523 {
524 pPlcxMan->HasCharSprm( bIns ? 0x4804 : 0x4863, aResult);
525 pSprmCIbstRMark = aResult.empty() ? 0 : aResult.back();
526 aResult.clear();
527 pPlcxMan->HasCharSprm( bIns ? 0x6805 : 0x6864, aResult);
528 pSprmCDttmRMark = aResult.empty() ? 0 : aResult.back();
529 }
530 }
531
532 if (nLen < 0)
533 mpRedlineStack->close(*pPaM->GetPoint(), eType, pTableDesc );
534 else
535 {
536 // start of new revision mark, if not there default to first entry
537 sal_uInt16 nWWAutNo = pSprmCIbstRMark ? SVBT16ToShort( pSprmCIbstRMark ) : 0;
538 sw::util::AuthorInfo aEntry(nWWAutNo);
539 sal_uInt16 nPos;
540 if (pAuthorInfos && pAuthorInfos->Seek_Entry(&aEntry, &nPos))
541 {
542 if (const sw::util::AuthorInfo* pAuthor = pAuthorInfos->GetObject(nPos))
543 {
544 sal_uInt32 nWWDate = pSprmCDttmRMark ? SVBT32ToUInt32(pSprmCDttmRMark): 0;
545 DateTime aStamp(sw::ms::DTTM2DateTime(nWWDate));
546 sal_uInt16 nAutorNo = pAuthor->nOurId;
547 SwFltRedline aNewAttr(eType, nAutorNo, aStamp);
548
549 NewAttr(aNewAttr);
550 }
551 }
552 }
553 }
554
555 // insert new content
Read_CFRMark(sal_uInt16,const sal_uInt8 * pData,short nLen)556 void SwWW8ImplReader::Read_CFRMark(sal_uInt16 , const sal_uInt8* pData, short nLen)
557 {
558 Read_CRevisionMark( nsRedlineType_t::REDLINE_INSERT, pData, nLen );
559 }
560
561 // delete old content
Read_CFRMarkDel(sal_uInt16,const sal_uInt8 * pData,short nLen)562 void SwWW8ImplReader::Read_CFRMarkDel(sal_uInt16 , const sal_uInt8* pData, short nLen)
563 {
564 Read_CRevisionMark( nsRedlineType_t::REDLINE_DELETE, pData, nLen );
565 }
566
567 // change properties of content ( == char formatting)
Read_CPropRMark(sal_uInt16,const sal_uInt8 * pData,short nLen)568 void SwWW8ImplReader::Read_CPropRMark(sal_uInt16 , const sal_uInt8* pData, short nLen)
569 {
570 // complex (len is always 7)
571 // 1 byte - chp.fPropRMark
572 // 2 bytes - chp.ibstPropRMark
573 // 4 bytes - chp.dttmPropRMark;
574 Read_CRevisionMark( nsRedlineType_t::REDLINE_FORMAT, pData, nLen );
575 }
576
577 /* vi:set tabstop=4 shiftwidth=4 expandtab: */
578