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