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