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