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