LibreOffice Module sw (master)  1
wrtww8gr.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 <memory>
21 #include <com/sun/star/embed/XEmbedPersist.hpp>
22 #include <com/sun/star/embed/Aspects.hpp>
23 #include <com/sun/star/embed/ElementModes.hpp>
24 #include <sal/log.hxx>
25 #include <vcl/graphicfilter.hxx>
26 #include <vcl/gdimtf.hxx>
27 #include <svl/itemiter.hxx>
28 
29 #include <svtools/embedhlp.hxx>
30 
31 #include <hintids.hxx>
32 #include <editeng/boxitem.hxx>
33 #include <editeng/shaditem.hxx>
35 #include <editeng/fhgtitem.hxx>
36 #include <svx/svdoole2.hxx>
37 
39 #include <fmtanchr.hxx>
40 #include <ndgrf.hxx>
41 #include <frmfmt.hxx>
42 #include <grfatr.hxx>
43 #include <ndole.hxx>
44 #include <ndtxt.hxx>
45 #include <fmtfsize.hxx>
46 #include <fmtornt.hxx>
47 
48 #include "sprmids.hxx"
49 
50 #include <doc.hxx>
51 #include "writerhelper.hxx"
52 #include "writerwordglue.hxx"
53 #include "ww8struc.hxx"
54 #include "wrtww8.hxx"
55 #include "ww8par.hxx"
56 #include "escher.hxx"
57 //Added for i120568
58 #include "ww8attributeoutput.hxx"
59 #include <fmturl.hxx>
60 
62 #include <drawdoc.hxx>
63 
64 using namespace ::com::sun::star;
65 
66 // TODO:
67 // 5. convert the MapModes that Widows can't handle
68 
69 // OutGrf () is called for every GrfNode in the document. A PicLocFc-Sprm
70 // will be inserted, which contains a magic number instead of an address.
71 // The GrfNode-Ptr is saved in Graf-Class (used later for output of
72 // the graphic and patching of the PicLocFc attributes)
73 
74 void WW8Export::OutputGrfNode( const SwGrfNode& /*rNode*/ )
75 {
76  SAL_INFO("sw", "WW8Export::OutputGrfNode( const SwGrfNode& )" );
77  OSL_ENSURE( m_pParentFrame, "frame not set!" );
78  if ( m_pParentFrame )
79  {
81  pFib->m_fHasPic = true;
82  }
83 }
84 
86  const tools::SvRef<SotStorage>& xObjStg,
87  OUString const& rStorageName, SwOLENode* pOLENd)
88 {
89  bool bGraphicNeeded = false;
90  SfxItemIter aIter( rSet );
91  for (auto pItem = aIter.GetCurItem(); !bGraphicNeeded && pItem; pItem = aIter.NextItem())
92  {
93  switch (pItem->Which())
94  {
95  /*
96  For an inline object these properties are irrelevant because they
97  will be the same as the defaults that msword applies in their
98  absence, so if that is all that there is for these inline objects
99  then if there turns out to be enough information in the object
100  itself to regenerate the correct size and preview of the object
101  then we will not need to provide an additional graphics preview in
102  the data stream, which can save a lot of disk space.
103  */
104  case RES_FRM_SIZE:
105  case RES_CNTNT:
106  case RES_VERT_ORIENT:
107  case RES_ANCHOR:
108  break;
109  default:
110  bGraphicNeeded = true;
111  }
112  }
113 
114  /*
115  Now we must see if the object contains a preview itself which is equal to
116  the preview that we are currently using. If the graphics are equal then we
117  don't need to store another preview
118  */
119  GDIMetaFile aWMF;
120  long nX=0,nY=0;
121  if (!bGraphicNeeded && SwWW8ImplReader::ImportOleWMF(xOleStg,aWMF,nX,nY))
122  {
123  // bGraphicNeeded set to true is right / fixes #i51670#.
124  bGraphicNeeded = true;
125  tools::Rectangle aRect( Point(), Size( nX, nY ) );
126  Graphic aGraph(aWMF);
127 
128  ErrCode nErr = ERRCODE_NONE;
129  sal_Int64 nAspect = embed::Aspects::MSOLE_CONTENT;
130  if ( pOLENd )
131  nAspect = pOLENd->GetAspect();
134  rStorageName,
135  xObjStg,
137  aGraph,
138  aRect,
140  nullptr,
141  nErr,
142  0,
143  nAspect,
144  m_pWriter->GetBaseURL());
145 
146  if (pRet)
147  {
148  uno::Reference< embed::XEmbeddedObject > xObj = pOLENd->GetOLEObj().GetOleRef();
149  if ( xObj.is() )
150  {
151  std::unique_ptr<SvStream> pGraphicStream;
153  try
154  {
155  uno::Reference< embed::XEmbedPersist > xPersist(
156  xObj,
157  uno::UNO_QUERY_THROW );
158 
159  // it makes no sense to search the object in the container by reference since the object was created
160  // outside of the container and was not inserted there, only the name makes sense
161  pGraphicStream =
162  ::utl::UcbStreamHelper::CreateStream( aCnt.GetGraphicStream( xPersist->getEntryName() ) );
163  }
164  catch( const uno::Exception& )
165  {}
166 
167  OSL_ENSURE( pGraphicStream && !pGraphicStream->GetError(), "No graphic stream available!" );
168  if ( pGraphicStream && !pGraphicStream->GetError() )
169  {
170  Graphic aGr1;
172  if( rGF.ImportGraphic( aGr1, OUString(), *pGraphicStream ) == ERRCODE_NONE )
173  {
174  Graphic aGr2;
175  pGraphicStream =
176  ::utl::UcbStreamHelper::CreateStream( aCnt.GetGraphicStream( pRet->GetObjRef() ) );
177  if( pGraphicStream && rGF.ImportGraphic( aGr2, OUString(), *pGraphicStream ) == ERRCODE_NONE )
178  {
179  if ( aGr1 == aGr2 )
180  bGraphicNeeded = false;
181  }
182  }
183  }
184  }
185 
186  // always use SdrObject::Free(...) for SdrObjects (!)
187  SdrObject* pTemp(pRet);
188  SdrObject::Free(pTemp);
189  }
190  }
191  else
192  bGraphicNeeded = true;
193  return bGraphicNeeded;
194 }
195 
196 void WW8Export::OutputOLENode( const SwOLENode& rOLENode )
197 {
198  SAL_INFO("sw", "WW8Export::OutputOLENode( const SwOLENode& rOLENode )" );
199  sal_uInt8 *pSpecOLE;
200  sal_uInt8 *pDataAdr;
201  short nSize;
202  static sal_uInt8 aSpecOLE_WW8[] = {
203  0x03, 0x6a, 0, 0, 0, 0, // sprmCPicLocation
204  0x0a, 0x08, 1, // sprmCFOLE2
205  0x56, 0x08, 1 // sprmCFObj
206  };
207 
208  pSpecOLE = aSpecOLE_WW8;
209  nSize = sizeof( aSpecOLE_WW8 );
210  pDataAdr = pSpecOLE + 2; //WW6 sprm is 1 but has 1 byte len as well.
211 
213 
214  if( xObjStg.is() )
215  {
216  uno::Reference < embed::XEmbeddedObject > xObj(const_cast<SwOLENode&>(rOLENode).GetOLEObj().GetOleRef());
217  if( xObj.is() )
218  {
219  const embed::XEmbeddedObject *pObj = xObj.get();
220  //Don't want to use pointer ids, as is traditional, because we need
221  //to put this into a 32bit value, and on 64bit the bottom bits
222  //might collide and two unrelated ole objects end up considered the
223  //same. Don't want to simply start at 0 which is a special value
224  sal_Int32 nPictureId = SAL_MAX_INT32 - m_aOleMap.size();
225  WW8OleMap::value_type entry = std::make_pair(pObj, nPictureId);
226  std::pair<WW8OleMap::iterator, bool> aRes = m_aOleMap.insert(entry);
227  bool bIsNotDuplicate = aRes.second; //.second is false when element already existed
228  nPictureId = aRes.first->second;
229  Set_UInt32(pDataAdr, nPictureId);
230  OUString sStorageName = "_" + OUString::number( nPictureId );
231  tools::SvRef<SotStorage> xOleStg = xObjStg->OpenSotStorage( sStorageName );
232  if( xOleStg.is() )
233  {
234  /*
235  If this object storage has been written already don't
236  waste time rewriting it
237  */
238  if (bIsNotDuplicate)
239  {
240  sal_Int64 nAspect = rOLENode.GetAspect();
241  svt::EmbeddedObjectRef aObjRef( xObj, nAspect );
242  m_pOLEExp->ExportOLEObject( aObjRef, *xOleStg );
243  if ( nAspect == embed::Aspects::MSOLE_ICON )
244  {
245  OUString aObjInfo( "\3ObjInfo" );
246  if ( !xOleStg->IsStream( aObjInfo ) )
247  {
248  const sal_uInt8 pObjInfoData[] = { 0x40, 0x00, 0x03, 0x00 };
249  tools::SvRef<SotStorageStream> rObjInfoStream = xOleStg->OpenSotStream( aObjInfo );
250  if ( rObjInfoStream.is() && !rObjInfoStream->GetError() )
251  {
252  rObjInfoStream->WriteBytes(pObjInfoData, sizeof(pObjInfoData));
253  xOleStg->Commit();
254  }
255  }
256  }
257  }
258 
259  // write as embedded field - the other things will be done
260  // in the escher export
261  OUString sServer = FieldString(ww::eEMBED) + xOleStg->GetUserName() + " ";
262 
263  OutputField(nullptr, ww::eEMBED, sServer, FieldFlags::Start |
265 
266  m_pChpPlc->AppendFkpEntry( Strm().Tell(),
267  nSize, pSpecOLE );
268 
269  bool bEndCR = true;
270  /*
271  In the word filter we only need a preview image for
272  floating images, and then only (the usual case) if the
273  object doesn't contain enough information to reconstruct
274  what we need.
275 
276  We don't need a graphic for inline objects, so we don't
277  even need the overhead of a graphic in that case.
278  */
279  bool bGraphicNeeded = false;
280 
281  if (m_pParentFrame)
282  {
283  bGraphicNeeded = true;
284 
285  if (m_pParentFrame->IsInline())
286  {
287  const SwAttrSet& rSet =
289  bEndCR = false;
290  bGraphicNeeded = TestOleNeedsGraphic(rSet,
291  xOleStg, xObjStg, sStorageName, const_cast<SwOLENode*>(&rOLENode));
292  }
293  }
294 
295  if (!bGraphicNeeded)
296  WriteChar(0x1);
297  else
298  {
299  /*
300  ##897##
301  We need to insert the graphic representation of
302  this object for the inline case, otherwise word
303  has no place to find the dimensions of the ole
304  object, and will not be able to draw it
305  */
307  }
308 
309  OutputField(nullptr, ww::eEMBED, OUString(),
311 
312  if (bEndCR) //No newline in inline case
313  WriteCR();
314  }
315  }
316  }
317 }
318 
319 void WW8Export::OutputLinkedOLE( const OUString& rOleId )
320 {
321  uno::Reference< embed::XStorage > xDocStg = m_pDoc->GetDocStorage();
322  uno::Reference< embed::XStorage > xOleStg = xDocStg->openStorageElement( "OLELinks", embed::ElementModes::READ );
323  tools::SvRef<SotStorage> xObjSrc = SotStorage::OpenOLEStorage( xOleStg, rOleId, StreamMode::READ );
324 
326 
327  if( xObjStg.is() && xObjSrc.is() )
328  {
329  tools::SvRef<SotStorage> xOleDst = xObjStg->OpenSotStorage( rOleId );
330  if ( xOleDst.is() )
331  xObjSrc->CopyTo( xOleDst.get() );
332 
333  if ( !xOleDst->GetError( ) )
334  {
335  xOleDst->Commit();
336 
337  // Output the cPicLocation attribute
338  std::unique_ptr<ww::bytes> pBuf( new ww::bytes );
340  SwWW8Writer::InsUInt32( *pBuf, rOleId.copy( 1 ).toInt32() );
341 
343  pBuf->push_back( 1 );
344 
346  pBuf->push_back( 1 );
347 
349  pBuf->push_back( 1 );
350 
351  m_pChpPlc->AppendFkpEntry( Strm().Tell(), pBuf->size(), pBuf->data() );
352  }
353  }
354 }
355 
356 void WW8Export::OutGrf(const ww8::Frame &rFrame)
357 {
358  //Added for i120568,the hyperlink info within a graphic whose anchor type is "As character"
359  //will be exported to ensure the fidelity
360  const SwFormatURL& rURL = rFrame.GetFrameFormat().GetAttrSet().GetURL();
361  bool bURLStarted = false;
362  if( !rURL.GetURL().isEmpty() && rFrame.GetWriterType() == ww8::Frame::eGraphic)
363  {
364  bURLStarted = true;
365  m_pAttrOutput->StartURL( rURL.GetURL(), rURL.GetTargetFrameName() );
366  }
367 
368  // Store the graphic settings in GrfNode so they may be written-out later
369  m_pGrf->Insert(rFrame);
370 
371  m_pChpPlc->AppendFkpEntry( Strm().Tell(), pO->size(), pO->data() );
372  pO->clear();
373 
374  // #i29408#
375  // linked, as-character anchored graphics have to be exported as fields.
376  const SwGrfNode* pGrfNd = rFrame.IsInline() && rFrame.GetContent()
377  ? rFrame.GetContent()->GetGrfNode() : nullptr;
378  if ( pGrfNd && pGrfNd->IsLinkedFile() )
379  {
380  OUString sStr;
381  pGrfNd->GetFileFilterNms(&sStr, nullptr);
382  sStr = FieldString(ww::eINCLUDEPICTURE) + " \"" + sStr + "\" \\d";
383 
384  OutputField( nullptr, ww::eINCLUDEPICTURE, sStr,
386  }
387 
388  WriteChar( char(1) ); // paste graphic symbols in the main text
389 
390  sal_uInt8 aArr[ 18 ];
391  sal_uInt8* pArr = aArr;
392 
393  const SwFrameFormat &rFlyFormat = rFrame.GetFrameFormat();
394  const RndStdIds eAn = rFlyFormat.GetAttrSet().GetAnchor(false).GetAnchorId();
395  if (eAn == RndStdIds::FLY_AS_CHAR)
396  {
397  sal_Int16 eVert = rFlyFormat.GetVertOrient().GetVertOrient();
398  if ((eVert == text::VertOrientation::CHAR_CENTER) || (eVert == text::VertOrientation::LINE_CENTER))
399  {
400  bool bVert = false;
401  //The default for word in vertical text mode is to center,
402  //otherwise a sub/super script hack is employed
403  if (dynamic_cast< const SwContentNode *>( m_pOutFormatNode ) )
404  {
405  const SwTextNode* pTextNd = static_cast<const SwTextNode*>(m_pOutFormatNode);
406  SwPosition aPos(*pTextNd);
407  bVert = m_pDoc->IsInVerticalText(aPos);
408  }
409  if (!bVert)
410  {
411  SwTwips nHeight = rFlyFormat.GetFrameSize().GetHeight();
412  nHeight/=20; //nHeight was in twips, want it in half points, but
413  //then half of total height.
414  long nFontHeight = GetItem(RES_CHRATR_FONTSIZE).GetHeight();
415  nHeight-=nFontHeight/20;
416 
418  Set_UInt16( pArr, - static_cast<sal_Int16>(nHeight));
419  }
420  }
421  }
422 
423  // sprmCFSpec
424  Set_UInt16( pArr, 0x855 );
425  Set_UInt8( pArr, 1 );
426 
427  // sprmCPicLocation
429  Set_UInt32( pArr, GRF_MAGIC_321 );
430 
431  // vary Magic, so that different graphic attributes will not be merged
432  static sal_uInt8 nAttrMagicIdx = 0;
433  --pArr;
434  Set_UInt8( pArr, nAttrMagicIdx++ );
435  m_pChpPlc->AppendFkpEntry( Strm().Tell(), static_cast< short >(pArr - aArr), aArr );
436 
437  // #i75464#
438  // Check, if graphic isn't exported as-character anchored.
439  // Otherwise, an additional paragraph is exported for a graphic, which is
440  // forced to be treated as inline, because it's anchored inside another frame.
441  if ( !rFrame.IsInline() &&
442  ( (eAn == RndStdIds::FLY_AT_PARA) ||
443  (eAn == RndStdIds::FLY_AT_PAGE) ) )
444  {
445  WriteChar( char(0x0d) ); // close the surrounding frame with CR
446 
447  static sal_uInt8 nSty[2] = { 0, 0 };
448  pO->insert( pO->end(), nSty, nSty+2 ); // Style #0
449  bool bOldGrf = m_bOutGrf;
450  m_bOutGrf = true;
451 
452  OutputFormat( rFrame.GetFrameFormat(), false, false, true ); // Fly-Attrs
453 
454  m_bOutGrf = bOldGrf;
455  m_pPapPlc->AppendFkpEntry( Strm().Tell(), pO->size(), pO->data() );
456  pO->clear();
457  }
458  // #i29408#
459  // linked, as-character anchored graphics have to be exported as fields.
460  else if ( pGrfNd && pGrfNd->IsLinkedFile() )
461  {
462  OutputField( nullptr, ww::eINCLUDEPICTURE, OUString(), FieldFlags::Close );
463  }
464  //Added for i120568,the hyperlink info within a graphic whose anchor type is
465  //"As character" will be exported to ensure the fidelity
466  if( bURLStarted )
467  m_pAttrOutput->EndURL(false);
468 }
469 
471 {
472  const Size aSize( rFly.GetLayoutSize() );
473  const sal_uInt16 nWidth = static_cast< sal_uInt16 >(aSize.Width());
474  const sal_uInt16 nHeight = static_cast< sal_uInt16 >(aSize.Height());
475  maDetails.emplace_back(rFly, nWidth, nHeight);
476 }
477 
479  sal_uInt16 mm, sal_uInt16 nWidth, sal_uInt16 nHeight, const SwAttrSet* pAttrSet)
480 {
481  sal_Int16 nXSizeAdd = 0, nYSizeAdd = 0;
482  sal_Int16 nCropL = 0, nCropR = 0, nCropT = 0, nCropB = 0;
483 
484  // write Crop-Attribute content in Header ( if available )
485  const SfxPoolItem* pItem;
486  if (pAttrSet && (SfxItemState::SET
487  == pAttrSet->GetItemState(RES_GRFATR_CROPGRF, false, &pItem)))
488  {
489  const SwCropGrf& rCr = *static_cast<const SwCropGrf*>(pItem);
490  nCropL = static_cast<sal_Int16>(rCr.GetLeft());
491  nCropR = static_cast<sal_Int16>(rCr.GetRight());
492  nCropT = static_cast<sal_Int16>(rCr.GetTop());
493  nCropB = static_cast<sal_Int16>(rCr.GetBottom());
494  nXSizeAdd = nXSizeAdd - static_cast<sal_Int16>( rCr.GetLeft() + rCr.GetRight() );
495  nYSizeAdd = nYSizeAdd - static_cast<sal_Int16>( rCr.GetTop() + rCr.GetBottom() );
496  }
497 
498  Size aGrTwipSz(rFly.GetSize());
499  sal_uInt16 nHdrLen = 0x44;
500 
501  sal_uInt8 aArr[ 0x44 ] = { 0 };
502 
503  sal_uInt8* pArr = aArr + 0x2E; // Do borders first
504 
505  const SwAttrSet& rAttrSet = rFly.GetFrameFormat().GetAttrSet();
506  if (SfxItemState::SET == rAttrSet.GetItemState(RES_BOX, false, &pItem))
507  {
508  const SvxBoxItem* pBox = static_cast<const SvxBoxItem*>(pItem);
509  if( pBox )
510  {
511  bool bShadow = false; // Shadow ?
512  if (const SvxShadowItem* pSI = rAttrSet.GetItem<SvxShadowItem>(RES_SHADOW))
513  {
514  bShadow = (pSI->GetLocation() != SvxShadowLocation::NONE) &&
515  (pSI->GetWidth() != 0);
516  }
517 
518  static const SvxBoxItemLine aLnArr[4] = { SvxBoxItemLine::TOP, SvxBoxItemLine::LEFT,
519  SvxBoxItemLine::BOTTOM, SvxBoxItemLine::RIGHT };
520  for(const SvxBoxItemLine & i : aLnArr)
521  {
522  const ::editeng::SvxBorderLine* pLn = pBox->GetLine( i );
523  WW8_BRC aBrc;
524  if (pLn)
525  {
527  pBox->GetDistance( i ), bShadow );
529  aBrc90.cv()));
530  aBrc = WW8_BRC(aBrc90.dptLineWidth(), aBrc90.brcType(), ico,
531  aBrc90.dptSpace(), aBrc90.fShadow(), aBrc90.fFrame());
532  }
533 
534  // use importer logic to determine how large the exported
535  // border will really be in word and adjust accordingly
536  short nSpacing;
537  short nThick = aBrc.DetermineBorderProperties(&nSpacing);
538  switch (i)
539  {
540  case SvxBoxItemLine::TOP:
541  case SvxBoxItemLine::BOTTOM:
542  nHeight -= bShadow ? nThick*2 : nThick;
543  nHeight = nHeight - nSpacing;
544  break;
545  case SvxBoxItemLine::LEFT:
546  case SvxBoxItemLine::RIGHT:
547  default:
548  nWidth -= bShadow ? nThick*2 : nThick;
549  nWidth = nWidth - nSpacing;
550  break;
551  }
552  memcpy( pArr, &aBrc.aBits1, 2);
553  pArr+=2;
554 
555  memcpy( pArr, &aBrc.aBits2, 2);
556  pArr+=2;
557  }
558  }
559  }
560 
561  pArr = aArr + 4; // skip lcb
562  Set_UInt16( pArr, nHdrLen ); // set cbHeader
563 
564  Set_UInt16( pArr, mm ); // set mm
565 
566  /*
567  Just in case our original size is too big to fit inside a ushort we can
568  substitute the final size and lose on retaining the scaling factor but
569  still keep the correct display size anyway.
570  */
571  const bool bIsSubstitutedSize = (aGrTwipSz.Width() > SHRT_MAX) || (aGrTwipSz.Height() > SHRT_MAX) ||
572  aGrTwipSz.IsEmpty();
573  if ( bIsSubstitutedSize )
574  {
575  aGrTwipSz.setWidth( nWidth );
576  aGrTwipSz.setHeight( nHeight );
577  }
578  using namespace sw::types;
579  // set xExt & yExt
580  Set_UInt16(pArr, msword_cast<sal_uInt16>(convertTwipToMm100(aGrTwipSz.Width())));
581  Set_UInt16(pArr, msword_cast<sal_uInt16>(convertTwipToMm100(aGrTwipSz.Height())));
582  pArr += 16;
583  // skip hMF & rcWinMF
584  // set dxaGoal & dyaGoal
585  Set_UInt16(pArr, msword_cast<sal_uInt16>(aGrTwipSz.Width()));
586  Set_UInt16(pArr, msword_cast<sal_uInt16>(aGrTwipSz.Height()));
587 
588  if ( aGrTwipSz.Width() + nXSizeAdd ) // set mx
589  {
590  if ( !bIsSubstitutedSize )
591  {
592  const double fVal = nWidth * 1000.0 / (aGrTwipSz.Width() + nXSizeAdd );
593  Set_UInt16( pArr, static_cast<sal_uInt16>(::rtl::math::round(fVal)) );
594  }
595  else
596  {
597  Set_UInt16( pArr, 1000 );
598  }
599  }
600  else
601  {
602  pArr += 2;
603  }
604 
605  if ( aGrTwipSz.Height() + nYSizeAdd ) // set my
606  {
607  if ( !bIsSubstitutedSize )
608  {
609  const double fVal = nHeight * 1000.0 / (aGrTwipSz.Height() + nYSizeAdd);
610  Set_UInt16( pArr, static_cast<sal_uInt16>(::rtl::math::round(fVal)) );
611  }
612  else
613  {
614  Set_UInt16( pArr, 1000 );
615  }
616  }
617  else
618  {
619  pArr += 2;
620  }
621 
622  if ( !bIsSubstitutedSize )
623  {
624  Set_UInt16( pArr, nCropL ); // set dxaCropLeft
625  Set_UInt16( pArr, nCropT ); // set dyaCropTop
626  Set_UInt16( pArr, nCropR ); // set dxaCropRight
627  Set_UInt16( pArr, nCropB ); // set dyaCropBottom
628  }
629 
630  rStrm.WriteBytes(aArr, nHdrLen);
631 }
632 
634  const ww8::Frame &rFly, sal_uInt16 nWidth, sal_uInt16 nHeight)
635 {
636  if (rGrfNd.IsLinkedFile()) // Linked File
637  {
638  OUString aFileN;
639  rGrfNd.GetFileFilterNms( &aFileN, nullptr );
640 
641  sal_uInt16 const mm = 94; // 94 = BMP, GIF
642 
643  WritePICFHeader(rStrm, rFly, mm, nWidth, nHeight,
644  rGrfNd.GetpSwAttrSet());
645  rStrm.WriteUChar( aFileN.getLength() ); // write Pascal-String
646  SwWW8Writer::WriteString8(rStrm, aFileN, false,
647  RTL_TEXTENCODING_MS_1252);
648  }
649  else // Embedded File or DDE or something like that
650  {
651  WritePICFHeader(rStrm, rFly, 0x64, nWidth, nHeight,
652  rGrfNd.GetpSwAttrSet());
653  SwBasicEscherEx aInlineEscher(&rStrm, rWrt);
654  aInlineEscher.WriteGrfFlyFrame(rFly.GetFrameFormat(), 0x401);
655  aInlineEscher.WritePictures();
656  }
657 }
658 //For i120928,export graphic info of bullet
660  sal_uInt16 mm, sal_uInt16 nWidth, sal_uInt16 nHeight)
661 {
662  sal_Int16 nXSizeAdd = 0, nYSizeAdd = 0;
663 
664  Size aGrTwipSz(rGrf.GetPrefSize());
665  sal_uInt16 nHdrLen = 0x44;
666 
667  sal_uInt8 aArr[ 0x44 ] = { 0 };
668 
669  sal_uInt8* pArr = aArr + 0x2E; //Do borders first
670 
671  static const SvxBoxItemLine aLnArr[4] = { SvxBoxItemLine::TOP, SvxBoxItemLine::LEFT,
672  SvxBoxItemLine::BOTTOM, SvxBoxItemLine::RIGHT };
673  for(const SvxBoxItemLine & i : aLnArr)
674  {
675  WW8_BRC aBrc;
676 
677  short nSpacing;
678  short nThick = aBrc.DetermineBorderProperties(&nSpacing);
679  switch (i)
680  {
681  case SvxBoxItemLine::TOP:
682  case SvxBoxItemLine::BOTTOM:
683  nHeight -= nThick;
684  nHeight = nHeight - nSpacing;
685  break;
686  case SvxBoxItemLine::LEFT:
687  case SvxBoxItemLine::RIGHT:
688  default:
689  nWidth -= nThick;
690  nWidth = nWidth - nSpacing;
691  break;
692  }
693  memcpy( pArr, &aBrc.aBits1, 2);
694  pArr+=2;
695 
696  memcpy(pArr, &aBrc.aBits2, 2);
697  pArr+=2;
698  }
699 
700  pArr = aArr + 4; //skip lcb
701  Set_UInt16( pArr, nHdrLen ); // set cbHeader
702 
703  Set_UInt16( pArr, mm ); // set mm
704 
705  if ( (convertTwipToMm100(aGrTwipSz.Width()) > USHRT_MAX ) || ( convertTwipToMm100(aGrTwipSz.Height()) > USHRT_MAX )
706  || aGrTwipSz.IsEmpty() )
707  {
708  aGrTwipSz.setWidth( nWidth );
709  aGrTwipSz.setHeight( nHeight );
710  }
711  using namespace sw::types;
712  // set xExt & yExt
713  Set_UInt16(pArr, msword_cast<sal_uInt16>(convertTwipToMm100(aGrTwipSz.Width())));
714  Set_UInt16(pArr, msword_cast<sal_uInt16>(convertTwipToMm100(aGrTwipSz.Height())));
715  pArr += 16;
716  // skip hMF & rcWinMF
717  // set dxaGoal & dyaGoal
718  Set_UInt16(pArr, msword_cast<sal_uInt16>(aGrTwipSz.Width()));
719  Set_UInt16(pArr, msword_cast<sal_uInt16>(aGrTwipSz.Height()));
720 
721  if( aGrTwipSz.Width() + nXSizeAdd ) // set mx
722  {
723  double fVal = nWidth * 1000.0 / (aGrTwipSz.Width() + nXSizeAdd);
724  Set_UInt16( pArr, static_cast<sal_uInt16>(::rtl::math::round(fVal)) );
725  }
726  else
727  pArr += 2;
728 
729  if( aGrTwipSz.Height() + nYSizeAdd ) // set my
730  {
731  double fVal = nHeight * 1000.0 / (aGrTwipSz.Height() + nYSizeAdd);
732  Set_UInt16( pArr, static_cast<sal_uInt16>(::rtl::math::round(fVal)) );
733  }
734  else
735  pArr += 2;
736 
737  Set_UInt16( pArr, 0 ); // set dxaCropLeft
738  Set_UInt16( pArr, 0 ); // set dyaCropTop
739  Set_UInt16( pArr, 0 ); // set dxaCropRight
740  Set_UInt16( pArr, 0 ); // set dyaCropBottom
741 
742  rStrm.WriteBytes(aArr, nHdrLen);
743 }
744 
745 void SwWW8WrGrf::WriteGrfForBullet(SvStream& rStrm, const Graphic &rGrf, sal_uInt16 nWidth, sal_uInt16 nHeight)
746 {
747  WritePICBulletFHeader(rStrm,rGrf, 0x64,nWidth,nHeight);
748  SwBasicEscherEx aInlineEscher(&rStrm, rWrt);
749  aInlineEscher.WriteGrfBullet(rGrf);
750  aInlineEscher.WritePictures();
751 }
752 
754 {
755  sal_uInt16 nWidth = rItem.mnWid;
756  sal_uInt16 nHeight = rItem.mnHei;
757  sal_uInt32 nPos = rStrm.Tell(); // store start of graphic
758 
759  const ww8::Frame &rFly = rItem.maFly;
760  switch (rFly.GetWriterType())
761  {
763  {
764  const SwNode *pNode = rItem.maFly.GetContent();
765  const SwGrfNode *pNd = pNode ? pNode->GetGrfNode() : nullptr;
766  OSL_ENSURE(pNd, "Impossible");
767  if (pNd)
768  WriteGrfFromGrfNode(rStrm, *pNd, rItem.maFly, nWidth, nHeight);
769  }
770  break;
771  //For i120928,add branch to export graphic of bullet
773  {
774  if (rItem.maFly.HasGraphic())
775  {
776  const Graphic& rGrf = rItem.maFly.GetGraphic();
777  WriteGrfForBullet(rStrm, rGrf, nWidth, nHeight);
778  }
779  }
780  break;
781 
782  case ww8::Frame::eOle:
783  {
784  const SwNode *pNode = rItem.maFly.GetContent();
785  const SwOLENode *pNd = pNode ? pNode->GetOLENode() : nullptr;
786  OSL_ENSURE(pNd, "Impossible");
787  if (pNd)
788  {
789 #ifdef OLE_PREVIEW_AS_EMF
790  //Convert this ole2 preview in ww8+ to an EMF for better unicode
791  //support (note that at this moment this breaks StarSymbol
792  //using graphics because I need to embed starsymbol in exported
793  //documents.
794  WritePICFHeader(rStrm, rFly, 0x64, nWidth, nHeight,
795  pNd->GetpSwAttrSet());
796  SwBasicEscherEx aInlineEscher(&rStrm, rWrt);
797  aInlineEscher.WriteOLEFlyFrame(rFly.GetFrameFormat(), 0x401);
798  aInlineEscher.WritePictures();
799 #else
800  // cast away const
801  SwOLENode *pOleNd = const_cast<SwOLENode*>(pNd);
802  SwOLEObj& rSObj= pOleNd->GetOLEObj();
803 
804  // TODO/LATER: do we need to load object?
805  Graphic* pGr = SdrOle2Obj::GetGraphicFromObject( pOleNd->GetDoc()->GetDocStorage(), rObj );
806 
807  //TODO/LATER: do we really want to use GDIMetafile?!
808  GDIMetaFile aMtf;
809  if ( pGr )
810  aMtf = pGr->GetGDIMetaFile();
811 
812  Size aS(aMtf.GetPrefSize());
813  aMtf.WindStart();
814  aMtf.Play(Application::GetDefaultDevice(), Point(0, 0),
815  Size(2880, 2880));
816 
817  WritePICFHeader(rStrm, rFly, 8, nWidth, nHeight,
818  pNd->GetpSwAttrSet());
819  WriteWindowMetafileBits(rStrm, aMtf);
820  delete pGr;
821 #endif
822  }
823  }
824  break;
828  /*
829  #i3958# We only export an empty dummy picture frame here, this is
830  what word does the escher export should contain an anchored to
831  character element which is drawn over this dummy and the whole
832  shebang surrounded with a SHAPE field. This isn't *my* hack :-),
833  it's what word does.
834  */
835  {
836  WritePICFHeader(rStrm, rFly, 0x64, nWidth, nHeight);
837  SwBasicEscherEx aInlineEscher(&rStrm, rWrt);
838  aInlineEscher.WriteEmptyFlyFrame(rFly.GetFrameFormat(), 0x401);
839  }
840  break;
841  default:
842  OSL_ENSURE(false, "Some inline export not implemented");
843  break;
844  }
845 
846  sal_uInt32 nPos2 = rStrm.Tell(); // store the end
847  rStrm.Seek( nPos );
848  rStrm.WriteUInt32(nPos2 - nPos); // patch graphic length in the header
849  rStrm.Seek( nPos2 ); // restore Pos
850 }
851 
852 // SwWW8WrGrf::Write() is called after the text.
853 // It writes out all the graphics and remembers the file locations of the graphics,
854 // so when writing the attributes of the items it can be patched into PicLocFc-SPRMs.
855 // The search in the attributes for the Magic sal_uLong and patching
856 // happens when writing the attributes. Class SwWW8WrGrf provides with
857 // GetFPos() sequentially the positions
859 {
861  auto aEnd = maDetails.end();
862  for (auto aIter = maDetails.begin(); aIter != aEnd; ++aIter)
863  {
864  sal_uInt32 nPos = rStrm.Tell(); // align to 4 Bytes
865  if( nPos & 0x3 )
866  SwWW8Writer::FillCount( rStrm, 4 - ( nPos & 0x3 ) );
867 
868  auto aIter2 = std::find(maDetails.begin(), aIter, *aIter);
869  if (aIter2 != aIter)
870  {
871  aIter->mnPos = aIter2->mnPos;
872  }
873  else
874  {
875  aIter->mnPos = rStrm.Tell();
876  WriteGraphicNode(rStrm, *aIter);
877  }
878  }
879 }
880 
881 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Reference< css::embed::XStorage > GetDocStorage()
Definition: docnew.cxx:606
constexpr TypedWhichId< SwCropGrf > RES_GRFATR_CROPGRF(132)
bool is() const
static void InsUInt32(ww::bytes &rO, sal_uInt32 n)
Definition: wrtww8.cxx:1730
const OUString & GetBaseURL() const
Definition: shellio.hxx:445
sal_Int64 GetAspect() const
Definition: ndole.hxx:136
sal_uInt8 brcType() const
Definition: ww8struc.hxx:325
SVBT16 aBits1
Definition: ww8struc.hxx:263
std::unique_ptr< ww::bytes > pO
Buffer.
Definition: wrtww8.hxx:999
std::unique_ptr< SvxMSExportOLEObjects > m_pOLEExp
Definition: wrtww8.hxx:480
Marks a position in the document model.
Definition: pam.hxx:35
sal_Int32 GetLeft() const
ErrCode ImportGraphic(Graphic &rGraphic, const INetURLObject &rPath, sal_uInt16 nFormat=GRFILTER_FORMAT_DONTKNOW, sal_uInt16 *pDeterminedFormat=nullptr, GraphicFilterImportFlags nImportFlags=GraphicFilterImportFlags::NONE)
std::unique_ptr< WW8Fib > pFib
File Information Block.
Definition: wrtww8.hxx:1003
const SfxPoolItem & GetItem(sal_uInt16 nWhich) const
Definition: wrtww8.cxx:794
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)
SwOLENode * GetOLENode()
Inline methods from Node.hxx.
Definition: ndole.hxx:161
const SwOLEObj & GetOLEObj() const
Definition: ndole.hxx:112
OUString GetUserName()
bool HasGraphic() const
const SwFormatVertOrient & GetVertOrient(bool=true) const
Definition: fmtornt.hxx:106
const SwFormatURL & GetURL(bool=true) const
Definition: fmturl.hxx:75
constexpr TypedWhichId< SwFormatFrameSize > RES_FRM_SIZE(89)
std::vector< sal_uInt8 > bytes
Definition: types.hxx:29
ErrCode GetError() const
sal_uInt8 TransColToIco(const Color &rCol)
static void WriteString8(SvStream &rStrm, const OUString &rStr, bool bAddZero, rtl_TextEncoding eCodeSet)
Definition: wrtww8.cxx:1781
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_FONTSIZE(8)
const SwFormatAnchor & GetAnchor(bool=true) const
Definition: fmtanchr.hxx:78
static void WritePICBulletFHeader(SvStream &rStrm, const Graphic &rGrf, sal_uInt16 mm, sal_uInt16 nWidth, sal_uInt16 nHeight)
Definition: wrtww8gr.cxx:659
css::uno::Reference< css::embed::XEmbeddedObject > const & GetOleRef()
Definition: ndole.cxx:912
static SotStorage * OpenOLEStorage(css::uno::Reference< css::embed::XStorage > const &xStorage, OUString const &rEleName, StreamMode=StreamMode::STD_READWRITE)
sal_uInt16 GetDistance(SvxBoxItemLine nLine) const
bool IsLinkedFile() const
Definition: ndgrf.hxx:163
sal_uInt64 Seek(sal_uInt64 nPos)
long SwTwips
Definition: swtypes.hxx:49
bool IsStream(const OUString &rEleName) const
void Set_UInt32(sal_uInt8 *&p, sal_uInt32 n)
Definition: ww8struc.hxx:53
static void Free(SdrObject *&_rpObject)
bool WriteWindowMetafileBits(SvStream &rStream, const GDIMetaFile &rMTF)
OUString FieldString(ww::eField eIndex)
Definition: ww8atr.cxx:2616
bool Commit()
IDocumentDrawModelAccess const & getIDocumentDrawModelAccess() const
Definition: doc.cxx:154
static OutputDevice * GetDefaultDevice()
static void WritePICFHeader(SvStream &rStrm, const ww8::Frame &rFly, sal_uInt16 mm, sal_uInt16 nWidth, sal_uInt16 nHeight, const SwAttrSet *pAttrSet=nullptr)
Definition: wrtww8gr.cxx:478
constexpr TypedWhichId< SwFormatVertOrient > RES_VERT_ORIENT(102)
const SfxPoolItem * NextItem()
virtual void OutputOLENode(const SwOLENode &) override
Output SwOLENode.
Definition: wrtww8gr.cxx:196
SotStorage * OpenSotStorage(const OUString &rEleName, StreamMode=StreamMode::STD_READWRITE, bool transacted=true)
virtual void OutputField(const SwField *pField, ww::eField eFieldType, const OUString &rFieldCmd, FieldFlags nMode=FieldFlags::All) override
Write the field.
Definition: ww8atr.cxx:1763
static std::unique_ptr< SvStream > CreateStream(const OUString &rFileName, StreamMode eOpenMode, css::uno::Reference< css::awt::XWindow > xParentWin=nullptr)
bool fFrame() const
Definition: ww8struc.hxx:331
void OutputFormat(const SwFormat &rFormat, bool bPapFormat, bool bChpFormat, bool bFlyFormat=false)
Output attributes.
Definition: ww8atr.cxx:788
sal_uInt32 cv() const
Definition: ww8struc.hxx:321
bool IsInVerticalText(const SwPosition &rPos) const
Definition: doclay.cxx:1663
sal_uInt8 dptSpace() const
Definition: ww8struc.hxx:327
const Size & GetLayoutSize() const
The layout size of the contained element.
WW8Export & rWrt
for access to the variables
Definition: wrtww8.hxx:1418
bool CopyTo(SotStorage *pDestStg)
const GDIMetaFile & GetGDIMetaFile() const
SvStream & WriteUInt32(sal_uInt32 nUInt32)
short DetermineBorderProperties(short *pSpace) const
Definition: ww8scan.cxx:1354
void Set_UInt16(sal_uInt8 *&p, sal_uInt16 n)
Definition: ww8struc.hxx:47
const editeng::SvxBorderLine * GetLine(SvxBoxItemLine nLine) const
void OutGrf(const ww8::Frame &rFrame)
Definition: wrtww8gr.cxx:356
static WW8_BRCVer9 TranslateBorderLine(const ::editeng::SvxBorderLine &pLine, sal_uInt16 nDist, bool bShadow)
Definition: ww8atr.cxx:4289
void WriteChar(sal_Unicode c) override
Definition: wrtww8.cxx:1887
bool GetFileFilterNms(OUString *pFileNm, OUString *pFilterNm) const
Definition: ndgrf.cxx:483
void WriteGraphicNode(SvStream &rStrm, const GraphicDetails &rItem)
Definition: wrtww8gr.cxx:753
void WriteGrfBullet(const Graphic &)
Definition: wrtw8esh.cxx:1566
sal_uInt32 BGRToRGB(sal_uInt32 nColour)
const SwFrameFormat & GetFrameFormat() const
Get the writer SwFrameFormat that this object describes.
sal_uInt16 mnWid
Definition: wrtww8.hxx:1397
std::vector< GraphicDetails > maDetails
Definition: wrtww8.hxx:1420
const char aObjectPool[]
Definition: ww8scan.hxx:44
const SwAttrSet * GetpSwAttrSet() const
Definition: node.hxx:443
std::unique_ptr< WW8_WrPlcPn > m_pPapPlc
Definition: wrtww8.hxx:503
T * get() const
static sal_uInt8 nAttrMagicIdx
Definition: wrtww8.cxx:1613
Style of a layout element.
Definition: frmfmt.hxx:57
#define SAL_MAX_INT32
const sal_uInt16 sprmCFSpec
Definition: sprmids.hxx:314
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
int i
SotStorageStream * OpenSotStream(const OUString &rEleName, StreamMode=StreamMode::STD_READWRITE)
RndStdIds GetAnchorId() const
Definition: fmtanchr.hxx:65
const SwModify * m_pOutFormatNode
Definition: wrtww8.hxx:542
void WriteGrfFromGrfNode(SvStream &rStrm, const SwGrfNode &rNd, const ww8::Frame &rFly, sal_uInt16 nWidth, sal_uInt16 nHeight)
Definition: wrtww8gr.cxx:633
const SvxPageUsage aArr[]
const ww8::Frame * m_pParentFrame
Definition: wrtww8.hxx:523
SwDoc * GetDoc()
Definition: node.hxx:702
std::size_t WriteBytes(const void *pData, std::size_t nSize)
const Graphic & GetGraphic() const
virtual void WriteCR(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner=ww8::WW8TableNodeInfoInner::Pointer_t()) override
Definition: wrtww8.cxx:1877
SwWW8Writer & GetWriter() const
Definition: wrtww8.hxx:1191
WW8OleMap m_aOleMap
Definition: wrtww8.hxx:482
constexpr TypedWhichId< SwFormatContent > RES_CNTNT(95)
SVBT16 aBits2
Definition: ww8struc.hxx:264
const sal_uInt16 sprmCPicLocation
Definition: sprmids.hxx:273
SwWW8Writer * m_pWriter
Pointer to the writer.
Definition: wrtww8.hxx:1012
sal_uInt8 dptLineWidth() const
Definition: ww8struc.hxx:323
Size GetPrefSize() const
sal_Int32 GetBottom() const
virtual void OutputGrfNode(const SwGrfNode &) override
Output SwGrfNode.
Definition: wrtww8gr.cxx:74
const SwNode * GetContent() const
Get the first node of content in the frame.
sal_Int32 GetTop() const
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:80
SotStorage & GetStorage() const
Definition: shellio.hxx:500
constexpr sal_Int64 convertTwipToMm100(sal_Int64 n)
static bool ImportOleWMF(const tools::SvRef< SotStorage > &xSrc1, GDIMetaFile &rWMF, long &rX, long &rY)
Definition: ww8par4.cxx:304
SvStream & Strm() const
Definition: wrtww8.hxx:1192
#define ERRCODE_NONE
unsigned char sal_uInt8
Make exporting a Writer Frame easy.
std::unique_ptr< SwWW8WrGrf > m_pGrf
Definition: wrtww8.hxx:540
const o3tl::enumarray< SvxAdjust, unsigned short > aSvxToUnoAdjust USHRT_MAX
Definition: unosett.cxx:253
const OUString & GetTargetFrameName() const
Definition: fmturl.hxx:65
virtual void WritePictures()
Definition: wrtw8esh.cxx:2180
#define GRF_MAGIC_321
Definition: wrtww8.hxx:142
#define SAL_INFO(area, stream)
SvStream & WriteUChar(unsigned char nChar)
SvStream * pDataStrm
Streams for WW97 Export.
Definition: wrtww8.hxx:1001
const Size & GetSize() const
The Size of the contained element.
virtual SwDrawModel * GetOrCreateDrawModel()=0
virtual void OutputLinkedOLE(const OUString &) override
Definition: wrtww8gr.cxx:319
SvxBoxItemLine
sal_uInt64 Tell() const
void WriteEmptyFlyFrame(const SwFrameFormat &rFormat, sal_uInt32 nShapeId)
Definition: wrtw8esh.cxx:1532
bool TestOleNeedsGraphic(const SwAttrSet &rSet, tools::SvRef< SotStorage > const &xOleStg, const tools::SvRef< SotStorage > &xObjStg, OUString const &rStorageName, SwOLENode *pOLENd)
Definition: wrtww8gr.cxx:85
sal_Int16 GetVertOrient() const
Definition: fmtornt.hxx:54
static void InsUInt16(ww::bytes &rO, sal_uInt16 n)
Definition: wrtww8.cxx:1722
constexpr TypedWhichId< SvxBoxItem > RES_BOX(106)
const SwFormatFrameSize & GetFrameSize(bool=true) const
Definition: fmtfsize.hxx:104
void Write()
Definition: wrtww8gr.cxx:858
const sal_uInt16 sprmCFOle2
Definition: sprmids.hxx:279
sal_Int32 GetRight() const
sal_uInt16 mnHei
Definition: wrtww8.hxx:1398
static GraphicFilter & GetGraphicFilter()
void Insert(const ww8::Frame &rFly)
Definition: wrtww8gr.cxx:470
const sal_uInt16 sprmCFObj
Definition: sprmids.hxx:315
void Set_UInt8(sal_uInt8 *&p, sal_uInt8 n)
Definition: ww8struc.hxx:41
RndStdIds
bool IsInline() const
Is this frame inline (as character)
WriterSource GetWriterType() const
Get the type of frame that this wraps.
ww8::Frame maFly
Definition: wrtww8.hxx:1395
SwGrfNode * GetGrfNode()
Definition: ndgrf.hxx:153
const SwAttrSet & GetAttrSet() const
For querying the attribute array.
Definition: format.hxx:116
long GetHeight() const
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
void SvStream & rStrm
void WriteGrfForBullet(SvStream &rStrm, const Graphic &rGrf, sal_uInt16 nWidth, sal_uInt16 nHeight)
Definition: wrtww8gr.cxx:745
static void FillCount(SvStream &rStrm, sal_uLong nCount)
Definition: wrtww8.cxx:945
const sal_uInt16 sprmCHpsPos
Definition: sprmids.hxx:303
std::unique_ptr< WW8_WrPlcPn > m_pChpPlc
Definition: wrtww8.hxx:504
constexpr TypedWhichId< SvxShadowItem > RES_SHADOW(107)
SwDoc * m_pDoc
Definition: wrtww8.hxx:579
sal_uInt16 nPos
const SfxPoolItem * GetCurItem() const
constexpr TypedWhichId< SwFormatAnchor > RES_ANCHOR(104)
const OUString & GetURL() const
Definition: fmturl.hxx:66
bool fShadow() const
Definition: ww8struc.hxx:329
Base class of the Writer document model elements.
Definition: node.hxx:79
std::unique_ptr< WW8AttributeOutput > m_pAttrOutput
Converting attributes to stream data.
Definition: wrtww8.hxx:1013