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