LibreOffice Module sw (master)  1
ww8par4.cxx
Go to the documentation of this file.
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>
22 #include "writerhelper.hxx"
23 #include <com/sun/star/embed/XClassifiedObject.hpp>
24 #include <com/sun/star/embed/Aspects.hpp>
25 
26 #include <algorithm>
27 #include <cstddef>
28 #include <functional>
29 #include <osl/endian.h>
30 #include <sot/storage.hxx>
31 #include <com/sun/star/drawing/XShape.hpp>
32 #include <hintids.hxx>
33 #include <svx/svdoole2.hxx>
35 #include "sprmids.hxx"
36 #include <svx/unoapi.hxx>
37 #include <sal/log.hxx>
38 
39 #include <sot/exchange.hxx>
40 #include <swtypes.hxx>
41 #include <fmtanchr.hxx>
42 #include <fmtcntnt.hxx>
43 #include <dcontact.hxx>
44 #include <frmfmt.hxx>
45 #include <pam.hxx>
46 #include <ndgrf.hxx>
47 #include <docsh.hxx>
48 #include <mdiexp.hxx>
49 #include <redline.hxx>
50 #include <fltshell.hxx>
51 #include <unodraw.hxx>
52 #include <shellio.hxx>
53 #include <ndole.hxx>
54 
55 #include <vcl/graphicfilter.hxx>
56 #include <vcl/wmf.hxx>
57 #include <vcl/gdimtf.hxx>
58 
59 #include "ww8scan.hxx"
60 #include "ww8par.hxx"
61 #include "ww8par2.hxx"
62 
63 struct OLE_MFP
64 {
65  sal_Int16 mm; // 0x6 int
66  sal_Int16 xExt; // 0x8 int in 1/100 mm
67  sal_Int16 yExt; // 0xa int in 1/100 mm
68  sal_Int16 hMF; // 0xc int
69 };
70 
71 using namespace ::com::sun::star;
72 
73 static bool SwWw8ReadScaling(long& rX, long& rY, tools::SvRef<SotStorage> const & rSrc1)
74 {
75  // Getting the scaling factor:
76  // Information in the PIC-stream (by trying out)
77  // 0x0 (l)cb
78  // 0x08 .. 0x0a Flags ??
79  // 0x08 contains: 1 / 0
80  // 0x09 contains: 0,8,0x18
81  // 0x0a contains: always 8, MAP_ANISOTROPIC ???
82  // 0x0b contains: always 0
83  // 0x0c, 0x10 original size x,y in 1/100 mm
84  // 0x14, 0x16 original size x,y in tw
85  // 0x2c, 0x30 scaling x,y in per thousand
86  // 0x34, 0x38, 0x3c, 0x40 Crop Left, Top, Right, Bot in tw
87 
88  tools::SvRef<SotStorageStream> xSrc3 = rSrc1->OpenSotStream( "\3PIC",
89  StreamMode::STD_READ );
90  SotStorageStream* pS = xSrc3.get();
91  pS->SetEndian( SvStreamEndian::LITTLE );
92  pS->Seek( STREAM_SEEK_TO_END );
93 
94  OSL_ENSURE( pS->Tell() >= 76, "+OLE-PIC-Stream is shorter than 76 Byte" );
95 
96  sal_Int32 nOrgWidth,
97  nOrgHeight,
98  nScaleX,
99  nScaleY,
100  nCropLeft,
101  nCropTop,
102  nCropRight,
103  nCropBottom;
104  pS->Seek( 0x14 );
105  pS->ReadInt32( nOrgWidth ) // Original Size in 1/100 mm
106  .ReadInt32( nOrgHeight );
107  pS->Seek( 0x2c );
108  pS->ReadInt32( nScaleX ) // Scaling in Promille
109  .ReadInt32( nScaleY )
110  .ReadInt32( nCropLeft ) // Cropping in 1/100 mm
111  .ReadInt32( nCropTop )
112  .ReadInt32( nCropRight )
113  .ReadInt32( nCropBottom );
114 
115  rX = nOrgWidth - nCropLeft - nCropRight;
116  rY = nOrgHeight - nCropTop - nCropBottom;
117  if (10 > nScaleX || 65536 < nScaleX || 10 > nScaleY || 65536 < nScaleY)
118  {
119  OSL_ENSURE( !pS, "+OLE-scaling information in PIC-stream wrong" );
120  return false;
121  }
122  else
123  {
124  rX = (rX * nScaleX) / 1000;
125  rY = (rY * nScaleY) / 1000;
126  }
127  return true;
128 }
129 
130 static bool SwWw6ReadMetaStream(GDIMetaFile& rWMF, OLE_MFP* pMfp,
131  tools::SvRef<SotStorage> const & rSrc1)
132 {
133  tools::SvRef<SotStorageStream> xSrc2 = rSrc1->OpenSotStream( "\3META",
134  StreamMode::STD_READ );
135  SotStorageStream* pSt = xSrc2.get();
136  pSt->SetEndian( SvStreamEndian::LITTLE );
137  size_t const nRead = pSt->ReadBytes(pMfp, sizeof(*pMfp));
138  // read mini-placable-header
139  if (nRead != sizeof(*pMfp))
140  return false;
141 
142 #if defined OSL_BIGENDIAN
143  pMfp->mm = OSL_SWAPWORD( pMfp->mm );
144  pMfp->xExt = OSL_SWAPWORD( pMfp->xExt );
145  pMfp->yExt = OSL_SWAPWORD( pMfp->yExt );
146 #endif // OSL_BIGENDIAN
147 
148  if( pMfp->mm == 94 || pMfp->mm == 99 )
149  {
150  SAL_WARN("sw.ww8", "+OLE: wrong metafile type");
151  return false;
152  }
153  if( pMfp->mm != 8 )
154  {
155  SAL_WARN("sw.ww8", "OLE: wrong mMetafile type (not anisotropic)");
156  }
157  if( !pMfp->xExt || !pMfp->yExt )
158  {
159  SAL_WARN("sw.ww8", "+OLE: size of 0?");
160  return false;
161  }
162  bool bOk = ReadWindowMetafile( *pSt, rWMF ); // read WMF
163  // *pSt >> aWMF doesn't work without the placable header
164  if (!bOk || pSt->GetError() || rWMF.GetActionSize() == 0)
165  {
166  SAL_WARN("sw.ww8", "+OLE: could not read the metafile");
167  return false;
168  }
169 
170  rWMF.SetPrefMapMode( MapMode( MapUnit::Map100thMM ) );
171 
172  // Scale MetaFile to new size and save new size to MetaFile
173  Size aOldSiz( rWMF.GetPrefSize() );
174  Size aNewSiz( pMfp->xExt, pMfp->yExt );
175  Fraction aFracX( aNewSiz.Width(), aOldSiz.Width() );
176  Fraction aFracY( aNewSiz.Height(), aOldSiz.Height() );
177 
178  rWMF.Scale( aFracX, aFracY );
179  rWMF.SetPrefSize( aNewSiz );
180 
181  return true;
182 }
183 
184 static bool SwWw6ReadMacPICTStream(Graphic& rGraph, tools::SvRef<SotStorage> const & rSrc1)
185 {
186  // 03-META-stream does not exist. Maybe a 03-PICT?
187  tools::SvRef<SotStorageStream> xSrc4 = rSrc1->OpenSotStream("\3PICT");
188  SotStorageStream* pStp = xSrc4.get();
189  pStp->SetEndian( SvStreamEndian::LITTLE );
190  sal_uInt8 aTestA[10]; // Does the 01Ole-stream even exist?
191  size_t const nReadTst = pStp->ReadBytes(aTestA, sizeof(aTestA));
192  if (nReadTst != sizeof(aTestA))
193  return false;
194 
195  pStp->Seek( STREAM_SEEK_TO_BEGIN );
196 
197  // Mac-Pict is in the 03PICT-StorageStream but without the first 512 Bytes
198  // which are not relevant in a MAC-PICT (they are not evaluated)
199  return SwWW8ImplReader::GetPictGrafFromStream(rGraph, *pStp);
200 }
201 
203  const SfxItemSet &rFlySet, const SfxItemSet *rGrfSet)
204 {
205  SfxObjectShell *pPersist = m_rDoc.GetPersist();
206  OSL_ENSURE(pPersist, "No persist, cannot insert objects correctly");
207  if (!pPersist)
208  return nullptr;
209 
210  SwFlyFrameFormat *pRet = nullptr;
211 
212  std::unique_ptr<SfxItemSet> pMathFlySet;
213  uno::Reference < embed::XClassifiedObject > xClass = rObject.GetObjRef();
214  if( xClass.is() )
215  {
216  SvGlobalName aClassName( xClass->getClassID() );
217  if (SotExchange::IsMath(aClassName))
218  {
219  // StarMath sets it own fixed size, so its counter productive to use
220  // the size Word says it is. i.e. Don't attempt to override its size.
221  pMathFlySet.reset(new SfxItemSet(rFlySet));
222  pMathFlySet->ClearItem(RES_FRM_SIZE);
223  }
224  }
225 
226  /*
227  Take complete responsibility of the object away from SdrOle2Obj and to
228  me here locally. This utility class now owns the object.
229  */
230 
231  // TODO/MBA: is the object inserted multiple times here? Testing!
232  // And is it a problem that we now use the same naming scheme as in the other apps?
233  sw::hack::DrawingOLEAdaptor aOLEObj(rObject, *pPersist);
234  OUString sNewName;
235  bool bSuccess = aOLEObj.TransferToDoc(sNewName);
236 
237  OSL_ENSURE(bSuccess, "Insert OLE failed");
238  if (bSuccess)
239  {
240  const SfxItemSet *pFlySet = pMathFlySet ? pMathFlySet.get() : &rFlySet;
241  pRet = m_rDoc.getIDocumentContentOperations().InsertOLE(*m_pPaM, sNewName, rObject.GetAspect(), pFlySet, rGrfSet);
242  }
243  return pRet;
244 }
245 
247  const SfxItemSet* pFlySet, const SfxItemSet *pGrfSet, const tools::Rectangle& aVisArea )
248 {
250  SwFrameFormat* pFormat = nullptr;
251 
252  GrafikCtor();
253 
254  Graphic aGraph;
255  SdrObject* pRet = ImportOleBase(aGraph, pGrf, pFlySet, aVisArea );
256 
257  // create flyset
258  std::unique_ptr<SfxItemSet> pTempSet;
259  if( !pFlySet )
260  {
261  pTempSet.reset( new SfxItemSet( m_rDoc.GetAttrPool(), svl::Items<RES_FRMATR_BEGIN,
262  RES_FRMATR_END-1>{}) );
263 
264  pFlySet = pTempSet.get();
265 
266  // Remove distance/borders
267  Reader::ResetFrameFormatAttrs( *pTempSet );
268 
269  SwFormatAnchor aAnchor( RndStdIds::FLY_AS_CHAR );
270  aAnchor.SetAnchor( m_pPaM->GetPoint() );
271  pTempSet->Put( aAnchor );
272 
273  const Size aSizeTwip = OutputDevice::LogicToLogic(
274  aGraph.GetPrefSize(), aGraph.GetPrefMapMode(), MapMode(MapUnit::MapTwip));
275 
276  pTempSet->Put( SwFormatFrameSize( ATT_FIX_SIZE, aSizeTwip.Width(),
277  aSizeTwip.Height() ) );
278  pTempSet->Put( SwFormatVertOrient( 0, text::VertOrientation::TOP, text::RelOrientation::FRAME ));
279 
280  if (m_xSFlyPara)
281  {
282  // Resize the frame to the picture size if there is an OLE object
283  // in the frame (only if auto-width)
284  m_xSFlyPara->BoxUpWidth(aSizeTwip.Width());
285  }
286  }
287 
288  if (pRet) // OLE object was inserted
289  {
290  if (SdrOle2Obj *pOleObj = dynamic_cast<SdrOle2Obj*>(pRet))
291  {
292  pFormat = InsertOle(*pOleObj, *pFlySet, pGrfSet);
293  SdrObject::Free(pRet); // we don't need this anymore
294  }
295  else
296  pFormat = m_rDoc.getIDocumentContentOperations().InsertDrawObj(*m_pPaM, *pRet, *pFlySet );
297  }
298  else if (
299  GraphicType::GdiMetafile == aGraph.GetType() ||
300  GraphicType::Bitmap == aGraph.GetType()
301  )
302  {
304  *m_pPaM, OUString(), OUString(), &aGraph, pFlySet,
305  pGrfSet, nullptr);
306  }
307  return pFormat;
308 }
309 
311  long& rX, long& rY)
312 {
313  bool bOk = false;
314  OLE_MFP aMfp;
315  if( SwWw6ReadMetaStream( rWMF, &aMfp, xSrc1 ) )
316  {
317  // take scaling factor as found in PIC and apply it to graphic.
318  SwWw8ReadScaling( rX, rY, xSrc1 );
319  Size aFinalSize, aOrigSize;
320  aFinalSize.setWidth( rX );
321  aFinalSize.setHeight( rY );
322  aFinalSize = OutputDevice::LogicToLogic(
323  aFinalSize, MapMode(MapUnit::MapTwip), rWMF.GetPrefMapMode() );
324  aOrigSize = rWMF.GetPrefSize();
325  Fraction aScaleX(aFinalSize.Width(),aOrigSize.Width());
326  Fraction aScaleY(aFinalSize.Height(),aOrigSize.Height());
327  rWMF.Scale( aScaleX, aScaleY );
328  bOk = true;
329  }
330  return bOk;
331 }
332 
334  const Graphic* pGrf, const SfxItemSet* pFlySet, const tools::Rectangle& aVisArea )
335 {
336  if (!m_pStg)
337  {
338  SAL_WARN("sw.ww8", "no storage for ole objects");
339  return nullptr;
340  }
341 
343 
344  long nX=0, nY=0; // nX, nY is graphic size
345  bool bOleOk = true;
346 
347  OUString aSrcStgName('_');
348  // results in the name "_4711"
349  aSrcStgName += OUString::number( m_nObjLocFc );
350 
352  tools::SvRef<SotStorage> xSrc1 = xSrc0->OpenSotStorage( aSrcStgName );
353 
354  if (pGrf)
355  {
356  rGraph = *pGrf;
357  const Size aSizeTwip = OutputDevice::LogicToLogic(
358  rGraph.GetPrefSize(), rGraph.GetPrefMapMode(), MapMode(MapUnit::MapTwip));
359  nX = aSizeTwip.Width();
360  nY = aSizeTwip.Height();
361  }
362  else
363  {
364  GDIMetaFile aWMF;
365 
366  if (ImportOleWMF(xSrc1,aWMF,nX,nY))
367  rGraph = Graphic( aWMF );
368  else if( SwWw6ReadMacPICTStream( rGraph, xSrc1 ) )
369  {
370  // 03-META stream is not available. Maybe it's a 03-PICT?
371  const Size aSizeTwip = OutputDevice::LogicToLogic(
372  rGraph.GetPrefSize(), rGraph.GetPrefMapMode(), MapMode(MapUnit::MapTwip));
373  nX = aSizeTwip.Width();
374  nY = aSizeTwip.Height();
375  // PICT: no WMF available -> Graphic instead of OLE
376  bOleOk = false;
377  }
378  } // StorageStreams closed again
379 
380  tools::Rectangle aRect(0, 0, nX, nY);
381 
382  if (pFlySet)
383  {
384  if (const SwFormatFrameSize* pSize = pFlySet->GetItem<SwFormatFrameSize>(RES_FRM_SIZE, false))
385  {
386  aRect.SetSize(pSize->GetSize());
387  }
388  }
389 
390  SdrObject* pRet = nullptr;
391 
392  if (!(m_bIsHeader || m_bIsFooter))
393  {
394  //Can't put them in headers/footers :-(
395  uno::Reference< drawing::XShape > xRef;
396  OSL_ENSURE(m_xFormImpl, "Impossible");
397  if (m_xFormImpl && m_xFormImpl->ReadOCXStream(xSrc1, &xRef))
398  {
399  pRet = GetSdrObjectFromXShape(xRef);
400  OSL_ENSURE(pRet, "Impossible");
401  if (pRet)
402  pRet->SetLogicRect(aRect);
403  return pRet;
404  }
405  }
406 
407  if (GraphicType::GdiMetafile == rGraph.GetType() ||
408  GraphicType::Bitmap == rGraph.GetType())
409  {
411 
412  if (bOleOk)
413  {
414  sal_uLong nOldPos = m_pDataStream->Tell();
416  SvStream *pTmpData = nullptr;
417  if (m_nObjLocFc < m_pDataStream->Tell())
418  {
419  pTmpData = m_pDataStream;
420  pTmpData->Seek( m_nObjLocFc );
421  }
422 
423  sal_Int64 nAspect = embed::Aspects::MSOLE_CONTENT;
424 
425  {
426  tools::SvRef<SotStorageStream> xObjInfoSrc = xSrc1->OpenSotStream("\3ObjInfo",
427  StreamMode::STD_READ );
428  if ( xObjInfoSrc.is() && !xObjInfoSrc->GetError() )
429  {
430  sal_uInt8 nByte = 0;
431  xObjInfoSrc->ReadUChar( nByte );
432  if ( ( nByte >> 4 ) & embed::Aspects::MSOLE_ICON )
433  nAspect = embed::Aspects::MSOLE_ICON;
434  }
435  }
436 
437  ErrCode nError = ERRCODE_NONE;
438  GrafikCtor();
439 
441  *m_pDrawModel,
442  aSrcStgName,
443  xSrc0,
445  rGraph,
446  aRect,
447  aVisArea,
448  pTmpData,
449  nError,
451  nAspect,
452  GetBaseURL());
453  m_pDataStream->Seek( nOldPos );
454  }
455  }
456  return pRet;
457 }
458 
460  sal_Int32 nTablePos, sal_Int32 nTableSiz, SwDoc& rDocOut )
461 {
462  std::vector<OUString> aAuthorNames;
463  WW8ReadSTTBF( !m_bVer67, rStrm, nTablePos, nTableSiz, m_bVer67 ? 2 : 0,
464  m_eStructCharSet, aAuthorNames );
465 
466  sal_uInt16 nCount = static_cast< sal_uInt16 >(aAuthorNames.size());
467  for( sal_uInt16 nAuthor = 0; nAuthor < nCount; ++nAuthor )
468  {
469  // Store author in doc
470  std::size_t nSWId = rDocOut.getIDocumentRedlineAccess().InsertRedlineAuthor(aAuthorNames[nAuthor]);
471  // Store matchpair
472  m_aAuthorInfos[nAuthor] = nSWId;
473  }
474 }
475 
476 /*
477  Revision Marks ( == Redlining )
478 */
479 // insert or delete content (change char attributes resp.)
481  const sal_uInt8* pData, short nLen )
482 {
483  // there *must* be a SprmCIbstRMark[Del] and a SprmCDttmRMark[Del]
484  // pointing to the very same char position as our SprmCFRMark[Del]
485  if (!m_xPlcxMan)
486  return;
487  const sal_uInt8* pSprmCIbstRMark;
488  const sal_uInt8* pSprmCDttmRMark;
489  if( RedlineType::Format == eType )
490  {
491  pSprmCIbstRMark = nLen >= 3 ? pData+1 : nullptr;
492  pSprmCDttmRMark = nLen >= 7 ? pData+3 : nullptr;
493  }
494  else
495  {
496  /* It is possible to have a number of date stamps for the created time
497  * of the change, (possibly a word bug) so we must use the "get a full
498  * list" variant of HasCharSprm and take the last one as the true one.
499  */
500  std::vector<SprmResult> aResult;
501  bool bIns = (RedlineType::Insert == eType);
502  if( m_bVer67 )
503  {
504  m_xPlcxMan->HasCharSprm(69, aResult);
505  pSprmCIbstRMark = (aResult.empty() || aResult.back().nRemainingData < 2) ? nullptr : aResult.back().pSprm;
506  aResult.clear();
507  m_xPlcxMan->HasCharSprm(70, aResult);
508  pSprmCDttmRMark = (aResult.empty() || aResult.back().nRemainingData < 4) ? nullptr : aResult.back().pSprm;
509  }
510  else
511  {
512  m_xPlcxMan->HasCharSprm( bIns ? 0x4804 : 0x4863, aResult);
513  pSprmCIbstRMark = (aResult.empty() || aResult.back().nRemainingData < 2) ? nullptr : aResult.back().pSprm;
514  aResult.clear();
515  m_xPlcxMan->HasCharSprm( bIns ? 0x6805 : NS_sprm::sprmCDttmRMarkDel, aResult);
516  pSprmCDttmRMark = (aResult.empty() || aResult.back().nRemainingData < 4) ? nullptr : aResult.back().pSprm;
517  }
518  }
519 
520  if (nLen < 0)
521  m_xRedlineStack->close(*m_pPaM->GetPoint(), eType, m_xTableDesc.get());
522  else
523  {
524  // start of new revision mark, if not there default to first entry
525  sal_uInt16 nWWAutNo = pSprmCIbstRMark ? SVBT16ToUInt16(pSprmCIbstRMark) : 0;
526  sal_uInt32 nWWDate = pSprmCDttmRMark ? SVBT32ToUInt32(pSprmCDttmRMark): 0;
527  DateTime aStamp(msfilter::util::DTTM2DateTime(nWWDate));
528  std::size_t nAuthorNo = m_aAuthorInfos[nWWAutNo];
529  SwFltRedline aNewAttr(eType, nAuthorNo, aStamp);
530  NewAttr(aNewAttr);
531  }
532 }
533 
534 // insert new content
535 void SwWW8ImplReader::Read_CFRMark(sal_uInt16 , const sal_uInt8* pData, short nLen)
536 {
537  Read_CRevisionMark( RedlineType::Insert, pData, nLen );
538 }
539 
540 // delete old content
541 void SwWW8ImplReader::Read_CFRMarkDel(sal_uInt16 , const sal_uInt8* pData, short nLen)
542 {
543  Read_CRevisionMark( RedlineType::Delete, pData, nLen );
544 }
545 
546 // change properties of content ( == char formatting)
547 void SwWW8ImplReader::Read_CPropRMark(sal_uInt16 , const sal_uInt8* pData, short nLen)
548 {
549  // complex (len is always 7)
550  // 1 byte - chp.fPropRMark
551  // 2 bytes - chp.ibstPropRMark
552  // 4 bytes - chp.dttmPropRMark;
553  Read_CRevisionMark( RedlineType::Format, pData, nLen );
554 }
555 
556 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool TransferToDoc(OUString &rName)
Transfer ownership of the OLE object to a document's SvPersist.
long Width() const
bool is() const
sal_Int16 xExt
Definition: ww8par4.cxx:66
#define RES_FRM_SIZE
Definition: hintids.hxx:194
sal_Int16 mm
Definition: ww8par4.cxx:65
rtl_TextEncoding m_eStructCharSet
Definition: ww8par.hxx:1284
static sal_uInt32 GetFilterFlags()
Definition: ww8par.cxx:485
css::uno::Reference< css::embed::XEmbeddedObject > const & GetObjRef() const
static SdrOle2Obj * CreateSdrOLEFromStorage(SdrModel &rSdrModel, const OUString &rStorageName, tools::SvRef< SotStorage > const &rSrcStorage, const css::uno::Reference< css::embed::XStorage > &xDestStg, const Graphic &rGraf, const tools::Rectangle &rBoundRect, const tools::Rectangle &rVisArea, SvStream *pDataStrrm, ErrCode &rError, sal_uInt32 nConvertFlags, sal_Int64 nAspect, OUString const &rBaseURL)
sw::util::AuthorInfos m_aAuthorInfos
Definition: ww8par.hxx:1263
virtual SwFlyFrameFormat * InsertGraphic(const SwPaM &rRg, const OUString &rGrfName, const OUString &rFltName, const Graphic *pGraphic, const SfxItemSet *pFlyAttrSet, const SfxItemSet *pGrfAttrSet, SwFrameFormat *)=0
Insert graphic or formula.
SwDocShell * GetDocShell()
Definition: doc.hxx:1341
SotStorage * m_pStg
Definition: ww8par.hxx:1087
Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
void Read_CFRMark(sal_uInt16, const sal_uInt8 *pData, short nLen)
Definition: ww8par4.cxx:535
const sal_uInt16 sprmCDttmRMarkDel
Definition: sprmids.hxx:328
long Height() const
bool ReadWindowMetafile(SvStream &rStream, GDIMetaFile &rMTF)
sal_uInt16 m_nProgress
Definition: ww8par.hxx:1286
const MapMode & GetPrefMapMode() const
sal_uIntPtr sal_uLong
#define RES_FRMATR_END
Definition: hintids.hxx:236
Make inserting an OLE object into a Writer document easy.
Definition: doc.hxx:185
void SetPrefSize(const Size &rSize)
#define STREAM_SEEK_TO_END
sal_uInt64 Seek(sal_uInt64 nPos)
static bool SwWw6ReadMacPICTStream(Graphic &rGraph, tools::SvRef< SotStorage > const &rSrc1)
Definition: ww8par4.cxx:184
std::unique_ptr< WW8TabDesc > m_xTableDesc
Definition: ww8par.hxx:1243
static void Free(SdrObject *&_rpObject)
IDocumentContentOperations const & getIDocumentContentOperations() const
Definition: doc.cxx:347
Frame cannot be moved in Var-direction.
Definition: fmtfsize.hxx:38
SwFrameFormat * ImportOle(const Graphic *=nullptr, const SfxItemSet *pFlySet=nullptr, const SfxItemSet *pGrfSet=nullptr, const tools::Rectangle &aVisArea=tools::Rectangle())
Definition: ww8par4.cxx:246
css::uno::Reference< css::embed::XStorage > const & GetStorage()
SwFlyFrameFormat * InsertOle(SdrOle2Obj &rObject, const SfxItemSet &rFlySet, const SfxItemSet *rGrfSet)
Definition: ww8par4.cxx:202
std::unique_ptr< sw::util::RedlineStack > m_xRedlineStack
Definition: ww8par.hxx:1104
static void ResetFrameFormatAttrs(SfxItemSet &rFrameSet)
Definition: shellio.cxx:609
DateTime DTTM2DateTime(long lDTTM)
SotStorage * OpenSotStorage(const OUString &rEleName, StreamMode=StreamMode::STD_READWRITE, bool transacted=true)
static bool SwWw6ReadMetaStream(GDIMetaFile &rWMF, OLE_MFP *pMfp, tools::SvRef< SotStorage > const &rSrc1)
Definition: ww8par4.cxx:130
static bool GetPictGrafFromStream(Graphic &rGraphic, SvStream &rSrc)
Definition: ww8graf2.cxx:227
void GrafikCtor()
Definition: ww8graf.cxx:3180
static sal_uInt16 IsMath(const SvGlobalName &rName)
virtual SwFlyFrameFormat * InsertOLE(const SwPaM &rRg, const OUString &rObjName, sal_Int64 nAspect, const SfxItemSet *pFlyAttrSet, const SfxItemSet *pGrfAttrSet)=0
static sal_uInt8 nTablePos
Definition: basesh.cxx:132
void SetProgressState(long nPosition, SwDocShell const *pDocShell)
Definition: mainwn.cxx:78
void Read_CFRMarkDel(sal_uInt16, const sal_uInt8 *pData, short nLen)
Definition: ww8par4.cxx:541
const char aObjectPool[]
Definition: ww8scan.hxx:44
void Read_CRevisionMark(RedlineType eType, const sal_uInt8 *pData, short nLen)
Definition: ww8par4.cxx:480
T * get() const
Style of a layout element.
Definition: frmfmt.hxx:57
sal_Int16 hMF
Definition: ww8par4.cxx:68
const Size & GetPrefSize() const
SwDoc & m_rDoc
Definition: ww8par.hxx:1093
SotStorageStream * OpenSotStream(const OUString &rEleName, StreamMode=StreamMode::STD_READWRITE)
const SwPosition * GetPoint() const
Definition: pam.hxx:207
GraphicType GetType() const
#define STREAM_SEEK_TO_BEGIN
void SetSize(const Size &rSize)
FlyAnchors.
Definition: fmtanchr.hxx:34
std::unique_ptr< SwMSConvertControls > m_xFormImpl
Definition: ww8par.hxx:1196
void NewAttr(const SfxPoolItem &rAttr, const bool bFirstLineOfStSet=false, const bool bLeftIndentSet=false)
Definition: ww8par6.cxx:2741
SwDocShell * m_pDocShell
Definition: ww8par.hxx:1072
void WW8ReadSTTBF(bool bVer8, SvStream &rStrm, sal_uInt32 nStart, sal_Int32 nLen, sal_uInt16 nExtraLen, rtl_TextEncoding eCS, std::vector< OUString > &rArray, std::vector< ww::bytes > *pExtraArray, std::vector< OUString > *pValueArray)
reads array of strings (see MS documentation: String Table stored in File) returns NOT the original p...
Definition: ww8scan.cxx:4119
virtual void SetLogicRect(const tools::Rectangle &rRect)
static bool SwWw8ReadScaling(long &rX, long &rY, tools::SvRef< SotStorage > const &rSrc1)
Definition: ww8par4.cxx:73
virtual std::size_t InsertRedlineAuthor(const OUString &rAuthor)=0
void Read_CPropRMark(sal_uInt16, const sal_uInt8 *pData, short nLen)
Definition: ww8par4.cxx:547
Size GetPrefSize() const
SVX_DLLPUBLIC SdrObject * GetSdrObjectFromXShape(const css::uno::Reference< css::drawing::XShape > &xShape)
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
Definition: doc.cxx:367
virtual SwDrawFrameFormat * InsertDrawObj(const SwPaM &rRg, SdrObject &rDrawObj, const SfxItemSet &rFlyAttrSet)=0
Insert a DrawObject.
static bool ImportOleWMF(const tools::SvRef< SotStorage > &xSrc1, GDIMetaFile &rWMF, long &rX, long &rY)
Definition: ww8par4.cxx:310
sal_Int64 GetAspect() const
#define ERRCODE_NONE
MapMode GetPrefMapMode() const
unsigned char sal_uInt8
SdrObject * ImportOleBase(Graphic &rGraph, const Graphic *pGrf=nullptr, const SfxItemSet *pFlySet=nullptr, const tools::Rectangle &aVisArea=tools::Rectangle())
Definition: ww8par4.cxx:333
SfxObjectShell * GetPersist() const
Definition: docnew.cxx:634
void Scale(double fScaleX, double fScaleY)
void ReadRevMarkAuthorStrTabl(SvStream &rStrm, sal_Int32 nTablePos, sal_Int32 nTableSiz, SwDoc &rDoc)
Definition: ww8par4.cxx:459
sal_uInt64 Tell() const
size_t GetActionSize() const
sal_Int16 yExt
Definition: ww8par4.cxx:67
std::shared_ptr< WW8PLCFMan > m_xPlcxMan
Definition: ww8par.hxx:1223
#define SAL_WARN(area, stream)
std::unique_ptr< WW8SwFlyPara > m_xSFlyPara
Definition: ww8par.hxx:1241
sal_uLong m_nObjLocFc
Definition: ww8par.hxx:1278
SdrModel * m_pDrawModel
Definition: ww8par.hxx:1250
SvStream * m_pDataStream
Definition: ww8par.hxx:1090
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
void setWidth(long nWidth)
#define RES_FRMATR_BEGIN
Definition: hintids.hxx:192
SwPaM * m_pPaM
Definition: ww8par.hxx:1095
const SwAttrPool & GetAttrPool() const
Definition: doc.hxx:1308
const OUString & GetBaseURL() const
Definition: ww8par.hxx:1905
void SetPrefMapMode(const MapMode &rMapMode)
void SetAnchor(const SwPosition *pPos)
Definition: atrfrm.cxx:1486
void setHeight(long nHeight)