LibreOffice Module sw (master)  1
writer.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 <hintids.hxx>
22 
23 #include <sot/storage.hxx>
24 #include <sfx2/docfile.hxx>
25 #include <svl/urihelper.hxx>
26 #include <vcl/graphicfilter.hxx>
27 #include <tools/diagnose_ex.h>
28 #include <editeng/fontitem.hxx>
29 #include <editeng/eeitem.hxx>
30 #include <sal/log.hxx>
31 #include <osl/diagnose.h>
32 #include <shellio.hxx>
33 #include <doc.hxx>
34 #include <docary.hxx>
35 #include <IMark.hxx>
37 #include <IDocumentMarkAccess.hxx>
38 #include <numrule.hxx>
39 #include <swerror.h>
40 #include <com/sun/star/ucb/ContentCreationException.hpp>
41 
42 using namespace css;
43 
44 namespace
45 {
46  SvStream& lcl_OutLongExt( SvStream& rStrm, sal_uLong nVal, bool bNeg )
47  {
48  sal_Char aBuf[28];
49 
50  int i = SAL_N_ELEMENTS(aBuf);
51  aBuf[--i] = 0;
52  do
53  {
54  aBuf[--i] = '0' + static_cast<sal_Char>(nVal % 10);
55  nVal /= 10;
56  } while (nVal);
57 
58  if (bNeg)
59  aBuf[--i] = '-';
60 
61  return rStrm.WriteCharPtr( &aBuf[i] );
62  }
63 }
64 
65 typedef std::multimap<sal_uLong, const ::sw::mark::IMark*> SwBookmarkNodeTable;
66 
68 {
70 
71  std::unique_ptr< std::map<OUString, OUString> > pFileNameMap;
72  std::vector<const SvxFontItem*> aFontRemoveLst;
73  SwBookmarkNodeTable aBkmkNodePos;
74 
75  Writer_Impl();
76 
77  void RemoveFontList( SwDoc& rDoc );
78  void InsertBkmk( const ::sw::mark::IMark& rBkmk );
79 };
80 
82  : m_pStream(nullptr)
83 {
84 }
85 
87 {
88  for( const auto& rpFontItem : aFontRemoveLst )
89  {
90  rDoc.GetAttrPool().Remove( *rpFontItem );
91  }
92 }
93 
94 void Writer_Impl::InsertBkmk(const ::sw::mark::IMark& rBkmk)
95 {
96  sal_uLong nNd = rBkmk.GetMarkPos().nNode.GetIndex();
97 
98  aBkmkNodePos.emplace( nNd, &rBkmk );
99 
100  if(rBkmk.IsExpanded() && rBkmk.GetOtherMarkPos().nNode != nNd)
101  {
102  nNd = rBkmk.GetOtherMarkPos().nNode.GetIndex();
103  aBkmkNodePos.emplace( nNd, &rBkmk );
104  }
105 }
106 
107 /*
108  * This module is the central collection point for all writer-filters
109  * and is a DLL !
110  *
111  * So that the Writer can work with different writers, the output-functions
112  * of the content carrying objects have to be mapped to the various
113  * output-functions.
114  *
115  * For that, to inquire its output function, every object can be gripped
116  * via the which-value in a table.
117  * These functions are available in the corresponding Writer-DLL's.
118  */
119 
121  : m_pImpl(std::make_unique<Writer_Impl>())
122  , m_pOrigFileName(nullptr), m_pDoc(nullptr), m_pOrigPam(nullptr)
123  , m_bHideDeleteRedlines(false)
124 {
128  m_bOrganizerMode = false;
130 }
131 
133 {
134 }
135 
136 /*
137  * Document Interface Access
138  */
143 
145 {
146  m_pImpl->RemoveFontList( *m_pDoc );
147  m_pImpl.reset(new Writer_Impl);
148 
149  if( m_pCurrentPam )
150  {
151  while (m_pCurrentPam->GetNext() != m_pCurrentPam.get())
152  delete m_pCurrentPam->GetNext();
153  m_pCurrentPam.reset();
154  }
155  m_pCurrentPam = nullptr;
156  m_pOrigFileName = nullptr;
157  m_pDoc = nullptr;
158 
162  m_bOrganizerMode = false;
163 }
164 
165 bool Writer::CopyNextPam( SwPaM ** ppPam )
166 {
167  if( (*ppPam)->GetNext() == m_pOrigPam )
168  {
169  *ppPam = m_pOrigPam; // set back to the beginning pam
170  return false; // end of the ring
171  }
172 
173  // otherwise copy the next value from the next Pam
174  *ppPam = (*ppPam)->GetNext();
175 
176  *m_pCurrentPam->GetPoint() = *(*ppPam)->Start();
177  *m_pCurrentPam->GetMark() = *(*ppPam)->End();
178 
179  return true;
180 }
181 
182 // search the next Bookmark-Position from the Bookmark-Table
183 
184 sal_Int32 Writer::FindPos_Bkmk(const SwPosition& rPos) const
185 {
186  const IDocumentMarkAccess* const pMarkAccess = m_pDoc->getIDocumentMarkAccess();
188  if(ppBkmk != pMarkAccess->getBookmarksEnd())
189  return ppBkmk - pMarkAccess->getBookmarksBegin();
190  return -1;
191 }
192 
193 std::shared_ptr<SwUnoCursor>
194 Writer::NewUnoCursor(SwDoc & rDoc, sal_uLong const nStartIdx, sal_uLong const nEndIdx)
195 {
196  SwNodes *const pNds = &rDoc.GetNodes();
197 
198  SwNodeIndex aStt( *pNds, nStartIdx );
199  SwContentNode* pCNode = aStt.GetNode().GetContentNode();
200  if( !pCNode && nullptr == pNds->GoNext( &aStt ) )
201  {
202  OSL_FAIL( "No more ContentNode at StartPos" );
203  }
204 
205  auto const pNew = rDoc.CreateUnoCursor(SwPosition(aStt), false);
206  pNew->SetMark();
207  aStt = nEndIdx;
208  pCNode = aStt.GetNode().GetContentNode();
209  if (!pCNode)
210  pCNode = SwNodes::GoPrevious(&aStt);
211  assert(pCNode && "No more ContentNode at StartPos");
212  pCNode->MakeEndIndex( &pNew->GetPoint()->nContent );
213  pNew->GetPoint()->nNode = aStt;
214  return pNew;
215 }
216 
217 // Stream-specific
219 {
220  assert(m_pImpl->m_pStream && "Oh-oh. Writer with no Stream!");
221  return *m_pImpl->m_pStream;
222 }
223 
224 void Writer::SetStream(SvStream *const pStream)
225 {
226  m_pImpl->m_pStream = pStream;
227 }
228 
229 SvStream& Writer::OutLong( SvStream& rStrm, long nVal )
230 {
231  const bool bNeg = nVal < 0;
232  if (bNeg)
233  nVal = -nVal;
234 
235  return lcl_OutLongExt(rStrm, static_cast<sal_uLong>(nVal), bNeg);
236 }
237 
239 {
240  return lcl_OutLongExt(rStrm, nVal, false);
241 }
242 
243 ErrCode Writer::Write( SwPaM& rPaM, SvStream& rStrm, const OUString* pFName )
244 {
245  if ( IsStgWriter() )
246  {
247  ErrCode nResult = ERRCODE_ABORT;
248  try
249  {
250  tools::SvRef<SotStorage> aRef = new SotStorage( rStrm );
251  nResult = Write( rPaM, *aRef, pFName );
252  if ( nResult == ERRCODE_NONE )
253  aRef->Commit();
254  }
255  catch (const css::ucb::ContentCreationException &)
256  {
257  TOOLS_WARN_EXCEPTION("sw", "Writer::Write caught");
258  }
259  return nResult;
260  }
261 
262  m_pDoc = rPaM.GetDoc();
263  m_pOrigFileName = pFName;
264  m_pImpl->m_pStream = &rStrm;
265 
266  // Copy PaM, so that it can be modified
267  m_pCurrentPam = m_pDoc->CreateUnoCursor(*rPaM.End(), false);
268  m_pCurrentPam->SetMark();
269  *m_pCurrentPam->GetPoint() = *rPaM.Start();
270  // for comparison secure to the current Pam
271  m_pOrigPam = &rPaM;
272 
273  ErrCode nRet = WriteStream();
274 
275  ResetWriter();
276 
277  return nRet;
278 }
279 
281 {}
282 
283 ErrCode Writer::Write( SwPaM& rPam, SfxMedium& rMedium, const OUString* pFileName )
284 {
285  SetupFilterOptions(rMedium);
286  // This method must be overridden in SwXMLWriter a storage from medium will be used there.
287  // The microsoft format can write to storage but the storage will be based on the stream.
288  return Write( rPam, *rMedium.GetOutStream(), pFileName );
289 }
290 
291 ErrCode Writer::Write( SwPaM& /*rPam*/, SotStorage&, const OUString* )
292 {
293  OSL_ENSURE( false, "Write in Storages on a stream?" );
294  return ERR_SWG_WRITE_ERROR;
295 }
296 
297 ErrCode Writer::Write( SwPaM&, const uno::Reference < embed::XStorage >&, const OUString*, SfxMedium* )
298 {
299  OSL_ENSURE( false, "Write in Storages on a stream?" );
300  return ERR_SWG_WRITE_ERROR;
301 }
302 
303 bool Writer::CopyLocalFileToINet( OUString& rFileNm )
304 {
305  if( !m_pOrigFileName ) // can be happen, by example if we
306  return false; // write into the clipboard
307 
308  bool bRet = false;
309  INetURLObject aFileUrl( rFileNm ), aTargetUrl( *m_pOrigFileName );
310 
311 // this is our old without the Mail-Export
312  if( ! ( INetProtocol::File == aFileUrl.GetProtocol() &&
313  INetProtocol::File != aTargetUrl.GetProtocol() &&
314  INetProtocol::Ftp <= aTargetUrl.GetProtocol() &&
315  INetProtocol::VndSunStarWebdav >= aTargetUrl.GetProtocol() ) )
316  return bRet;
317 
318  if (m_pImpl->pFileNameMap)
319  {
320  // has the file been moved?
321  std::map<OUString, OUString>::iterator it = m_pImpl->pFileNameMap->find( rFileNm );
322  if ( it != m_pImpl->pFileNameMap->end() )
323  {
324  rFileNm = it->second;
325  return true;
326  }
327  }
328  else
329  {
330  m_pImpl->pFileNameMap.reset( new std::map<OUString, OUString> );
331  }
332 
333  OUString aSrc = rFileNm;
334  OUString aDest = aTargetUrl.GetPartBeforeLastName();
335  aDest += aFileUrl.GetLastName();
336 
337  SfxMedium aSrcFile( aSrc, StreamMode::READ );
338  SfxMedium aDstFile( aDest, StreamMode::WRITE | StreamMode::SHARE_DENYNONE );
339 
340  aDstFile.GetOutStream()->WriteStream( *aSrcFile.GetInStream() );
341 
342  aSrcFile.Close();
343  aDstFile.Commit();
344 
345  bRet = ERRCODE_NONE == aDstFile.GetError();
346 
347  if( bRet )
348  {
349  m_pImpl->pFileNameMap->insert( std::make_pair( aSrc, aDest ) );
350  rFileNm = aDest;
351  }
352 
353  return bRet;
354 }
355 
357 {
358  // then there are a few fonts in the NumRules
359  // These put into the Pool. After this does they have a RefCount > 1
360  // it can be removed - it is already in the Pool
361  SfxItemPool& rPool = m_pDoc->GetAttrPool();
362  const SwNumRuleTable& rListTable = m_pDoc->GetNumRuleTable();
363  const SwNumRule* pRule;
364  const SwNumFormat* pFormat;
365  const vcl::Font* pFont;
366  const vcl::Font* pDefFont = &numfunc::GetDefBulletFont();
367  bool bCheck = false;
368 
369  for( size_t nGet = rListTable.size(); nGet; )
370  if( SwDoc::IsUsed( *(pRule = rListTable[ --nGet ] )))
371  for( sal_uInt8 nLvl = 0; nLvl < MAXLEVEL; ++nLvl )
372  if( SVX_NUM_CHAR_SPECIAL == (pFormat = &pRule->Get( nLvl ))->GetNumberingType() ||
373  SVX_NUM_BITMAP == pFormat->GetNumberingType() )
374  {
375  if( nullptr == ( pFont = pFormat->GetBulletFont() ) )
376  pFont = pDefFont;
377 
378  if( bCheck )
379  {
380  if( *pFont == *pDefFont )
381  continue;
382  }
383  else if( *pFont == *pDefFont )
384  bCheck = true;
385 
386  AddFontItem( rPool, SvxFontItem( pFont->GetFamilyType(),
387  pFont->GetFamilyName(), pFont->GetStyleName(),
388  pFont->GetPitch(), pFont->GetCharSet(), RES_CHRATR_FONT ));
389  }
390 }
391 
393 {
394  SfxItemPool& rPool = m_pDoc->GetAttrPool();
395  if( rPool.GetSecondaryPool() )
396  {
400  }
401 }
402 
403 void Writer::AddFontItems_( SfxItemPool& rPool, sal_uInt16 nW )
404 {
405  const SvxFontItem* pFont = static_cast<const SvxFontItem*>(&rPool.GetDefaultItem( nW ));
406  AddFontItem( rPool, *pFont );
407 
408  if( nullptr != ( pFont = static_cast<const SvxFontItem*>(rPool.GetPoolDefaultItem( nW ))) )
409  AddFontItem( rPool, *pFont );
410 
411  for (const SfxPoolItem* pItem : rPool.GetItemSurrogates(nW))
412  AddFontItem( rPool, *static_cast<const SvxFontItem*>(pItem) );
413 }
414 
415 void Writer::AddFontItem( SfxItemPool& rPool, const SvxFontItem& rFont )
416 {
417  const SvxFontItem* pItem;
418  if( RES_CHRATR_FONT != rFont.Which() )
419  {
420  SvxFontItem aFont( rFont );
421  aFont.SetWhich( RES_CHRATR_FONT );
422  pItem = &rPool.Put( aFont );
423  }
424  else
425  pItem = &rPool.Put( rFont );
426 
427  if( 1 < pItem->GetRefCount() )
428  rPool.Remove( *pItem );
429  else
430  {
431  m_pImpl->aFontRemoveLst.push_back( pItem );
432  }
433 }
434 
435 // build a bookmark table, which is sort by the node position. The
436 // OtherPos of the bookmarks also inserted.
438 {
439  const IDocumentMarkAccess* const pMarkAccess = m_pDoc->getIDocumentMarkAccess();
440  for(IDocumentMarkAccess::const_iterator_t ppBkmk = pMarkAccess->getBookmarksBegin();
441  ppBkmk != pMarkAccess->getBookmarksEnd();
442  ++ppBkmk)
443  {
444  m_pImpl->InsertBkmk(**ppBkmk);
445  }
446 }
447 
448 // search all Bookmarks in the range and return it in the Array
449 bool Writer::GetBookmarks(const SwContentNode& rNd, sal_Int32 nStt,
450  sal_Int32 nEnd, std::vector< const ::sw::mark::IMark* >& rArr)
451 {
452  OSL_ENSURE( rArr.empty(), "there are still entries available" );
453 
454  sal_uLong nNd = rNd.GetIndex();
455  std::pair<SwBookmarkNodeTable::const_iterator, SwBookmarkNodeTable::const_iterator> aIterPair
456  = m_pImpl->aBkmkNodePos.equal_range( nNd );
457  if( aIterPair.first != aIterPair.second )
458  {
459  // there exist some bookmarks, search now all which is in the range
460  if( !nStt && nEnd == rNd.Len() )
461  // all
462  for( SwBookmarkNodeTable::const_iterator it = aIterPair.first; it != aIterPair.second; ++it )
463  rArr.push_back( it->second );
464  else
465  {
466  for( SwBookmarkNodeTable::const_iterator it = aIterPair.first; it != aIterPair.second; ++it )
467  {
468  const ::sw::mark::IMark& rBkmk = *(it->second);
469  sal_Int32 nContent;
470  if( rBkmk.GetMarkPos().nNode == nNd &&
471  (nContent = rBkmk.GetMarkPos().nContent.GetIndex() ) >= nStt &&
472  nContent < nEnd )
473  {
474  rArr.push_back( &rBkmk );
475  }
476  else if( rBkmk.IsExpanded() && nNd ==
477  rBkmk.GetOtherMarkPos().nNode.GetIndex() && (nContent =
478  rBkmk.GetOtherMarkPos().nContent.GetIndex() ) >= nStt &&
479  nContent < nEnd )
480  {
481  rArr.push_back( &rBkmk );
482  }
483  }
484  }
485  }
486  return !rArr.empty();
487 }
488 
489 // Storage-specific
491 {
492  OSL_ENSURE( false, "Write in Storages on a stream?" );
493  return ERR_SWG_WRITE_ERROR;
494 }
495 
496 ErrCode StgWriter::Write( SwPaM& rPaM, SotStorage& rStg, const OUString* pFName )
497 {
498  SetStream(nullptr);
499  pStg = &rStg;
500  m_pDoc = rPaM.GetDoc();
501  m_pOrigFileName = pFName;
502 
503  // Copy PaM, so that it can be modified
504  m_pCurrentPam = m_pDoc->CreateUnoCursor(*rPaM.End(), false);
505  m_pCurrentPam->SetMark();
506  *m_pCurrentPam->GetPoint() = *rPaM.Start();
507  // for comparison secure to the current Pam
508  m_pOrigPam = &rPaM;
509 
510  ErrCode nRet = WriteStorage();
511 
512  pStg = nullptr;
513  ResetWriter();
514 
515  return nRet;
516 }
517 
518 ErrCode StgWriter::Write( SwPaM& rPaM, const uno::Reference < embed::XStorage >& rStg, const OUString* pFName, SfxMedium* pMedium )
519 {
520  SetStream(nullptr);
521  pStg = nullptr;
522  xStg = rStg;
523  m_pDoc = rPaM.GetDoc();
524  m_pOrigFileName = pFName;
525 
526  // Copy PaM, so that it can be modified
527  m_pCurrentPam = m_pDoc->CreateUnoCursor(*rPaM.End(), false);
528  m_pCurrentPam->SetMark();
529  *m_pCurrentPam->GetPoint() = *rPaM.Start();
530  // for comparison secure to the current Pam
531  m_pOrigPam = &rPaM;
532 
533  ErrCode nRet = pMedium ? WriteMedium( *pMedium ) : WriteStorage();
534 
535  pStg = nullptr;
536  ResetWriter();
537 
538  return nRet;
539 }
540 
541 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SvxNumType GetNumberingType() const
std::shared_ptr< SwUnoCursor > CreateUnoCursor(const SwPosition &rPos, bool bTableCursor=false)
Definition: doc.cxx:1807
virtual sal_Int32 Len() const
Definition: node.cxx:1181
#define EE_CHAR_FONTINFO
sal_uLong GetIndex() const
Definition: node.hxx:282
tools::SvRef< SotStorage > pStg
Definition: shellio.hxx:476
Marks a position in the document model.
Definition: pam.hxx:35
const OUString & GetFamilyName() const
std::unique_ptr< Writer_Impl > m_pImpl
Definition: shellio.hxx:378
bool GetBookmarks(const SwContentNode &rNd, sal_Int32 nStt, sal_Int32 nEnd, std::vector< const ::sw::mark::IMark * > &rArr)
Definition: writer.cxx:449
static SvStream & OutLong(SvStream &rStrm, long nVal)
Definition: writer.cxx:229
#define ERR_SWG_WRITE_ERROR
Definition: swerror.h:30
const OUString & GetStyleName() const
const SfxPoolItem * GetPoolDefaultItem(sal_uInt16 nWhich) const
wrapper iterator: wraps iterator of implementation while hiding MarkBase class; only IMark instances ...
sal_uIntPtr sal_uLong
void ResetWriter()
Definition: writer.cxx:144
SvStream * m_pStream
Definition: writer.cxx:69
Provides access to the marks of a document.
Definition: doc.hxx:185
virtual const_iterator_t findFirstBookmarkStartsAfter(const SwPosition &rPos) const =0
Finds the first mark that is starting after.
aBuf
bool Commit()
#define RES_CHRATR_FONT
Definition: hintids.hxx:75
static SwContentNode * GoPrevious(SwNodeIndex *)
Definition: nodes.cxx:1290
SwNode & GetNode() const
Definition: ndindex.hxx:118
bool m_bASCII_ParaAsCR
Definition: shellio.hxx:410
virtual ErrCode WriteStream() override
Definition: writer.cxx:490
IDocumentMarkAccess * getIDocumentMarkAccess()
Definition: docbm.cxx:1552
void Remove(const SfxPoolItem &)
SvStream & WriteCharPtr(const char *pBuf)
ErrCode GetError() const
IDocumentSettingAccess & getIDocumentSettingAccess()
Definition: writer.cxx:139
bool Commit()
FontFamily GetFamilyType()
bool m_bWriteAll
Definition: shellio.hxx:406
void Close(bool bInDestruction=false)
bool m_bOrganizerMode
Definition: shellio.hxx:417
bool m_bWriteOnlyFirstTable
Definition: shellio.hxx:409
IDocumentStylePoolAccess const & getIDocumentStylePoolAccess() const
Definition: doc.cxx:458
bool m_bASCII_ParaAsBlank
Definition: shellio.hxx:411
char sal_Char
virtual ErrCode WriteMedium(SfxMedium &)=0
const sal_uInt8 MAXLEVEL
Definition: swtypes.hxx:95
void RemoveFontList(SwDoc &rDoc)
Definition: writer.cxx:86
SvStream * GetOutStream()
virtual ErrCode WriteStorage()=0
virtual ErrCode WriteStream()=0
SwPaM * GetNext()
Definition: pam.hxx:264
#define SAL_N_ELEMENTS(arr)
std::multimap< sal_uLong, const ::sw::mark::IMark * > SwBookmarkNodeTable
Definition: writer.cxx:65
SVX_NUM_BITMAP
SVX_NUM_CHAR_SPECIAL
bool m_bWriteClipboardDoc
Definition: shellio.hxx:408
bool m_bASCII_NoLastLineEnd
Definition: shellio.hxx:412
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:136
virtual const_iterator_t getBookmarksEnd() const =0
returns a STL-like random access iterator to the end of the sequence of IBookmarks.
bool CopyNextPam(SwPaM **)
Definition: writer.cxx:165
SwPaM * m_pOrigPam
Definition: shellio.hxx:404
void PutNumFormatFontsInAttrPool()
Definition: writer.cxx:356
#define TOOLS_WARN_EXCEPTION(area, stream)
virtual ErrCode Write(SwPaM &, SfxMedium &, const OUString *)
Definition: writer.cxx:283
FontPitch GetPitch()
const vcl::Font & GetDefBulletFont()
retrieve font used for the default bullet list characters
Definition: number.cxx:1264
Writer()
Definition: writer.cxx:120
std::vector< const SvxFontItem * > aFontRemoveLst
Definition: writer.cxx:72
void PutEditEngFontsInAttrPool()
Definition: writer.cxx:392
int i
SwContentNode * GetContentNode()
Definition: node.hxx:615
const vcl::Font * GetBulletFont() const
SwDoc * GetDoc() const
Definition: pam.hxx:243
size_t size() const
Definition: docary.hxx:91
Provides access to settings of a document.
Marks a node in the document model.
Definition: ndindex.hxx:31
void SetStream(SvStream *const pStream)
Definition: writer.cxx:224
bool m_bBlock
Definition: shellio.hxx:416
SwBookmarkNodeTable aBkmkNodePos
Definition: writer.cxx:73
void AddFontItem(SfxItemPool &rPool, const SvxFontItem &rFont)
Definition: writer.cxx:415
const SfxPoolItem & GetDefaultItem(sal_uInt16 nWhich) const
SvStream & WriteStream(SvStream &rStream)
const SwPosition * Start() const
Definition: pam.hxx:212
Writer_Impl()
Definition: writer.cxx:81
SfxItemPool * GetSecondaryPool() const
const SwNumFormat & Get(sal_uInt16 i) const
Definition: number.cxx:83
bool m_bUCS2_WithStartChar
Definition: shellio.hxx:413
SvStream * GetInStream()
static std::shared_ptr< SwUnoCursor > NewUnoCursor(SwDoc &rDoc, sal_uLong const nStartIdx, sal_uLong const nEndIdx)
Definition: writer.cxx:194
std::unique_ptr< std::map< OUString, OUString > > pFileNameMap
Definition: writer.cxx:71
#define EE_CHAR_FONTINFO_CJK
void AddFontItems_(SfxItemPool &rPool, sal_uInt16 nWhichId)
Definition: writer.cxx:403
virtual ErrCode Write(SwPaM &, const css::uno::Reference< css::embed::XStorage > &, const OUString *, SfxMedium *=nullptr) override
#define ERRCODE_NONE
unsigned char sal_uInt8
OUString GetPartBeforeLastName() const
const SwNumRuleTable & GetNumRuleTable() const
Definition: doc.hxx:1056
virtual const_iterator_t getBookmarksBegin() const =0
returns a STL-like random access iterator to the begin of the sequence the IBookmarks.
css::uno::Reference< css::embed::XStorage > xStg
Definition: shellio.hxx:477
bool IsUsed(const SwModify &) const
Definition: poolfmt.cxx:122
INetProtocol GetProtocol() const
static SvStream & OutULong(SvStream &rStrm, sal_uLong nVal)
Definition: writer.cxx:238
IDocumentSettingAccess const & getIDocumentSettingAccess() const
Definition: doc.cxx:208
SwNodes & GetNodes()
Definition: doc.hxx:402
Item2Range GetItemSurrogates(sal_uInt16 nWhich) const
const SwPosition * End() const
Definition: pam.hxx:217
const T & Put(std::unique_ptr< T > xItem, sal_uInt16 nWhich=0)
IDocumentStylePoolAccess & getIDocumentStylePoolAccess()
Definition: writer.cxx:141
sal_Int32 FindPos_Bkmk(const SwPosition &rPos) const
Definition: writer.cxx:184
std::shared_ptr< SwUnoCursor > m_pCurrentPam
Definition: shellio.hxx:405
SvStream & Strm()
Definition: writer.cxx:218
#define ERRCODE_ABORT
const OUString * m_pOrigFileName
Definition: shellio.hxx:385
Access to the style pool.
#define EE_CHAR_FONTINFO_CTL
virtual void SetupFilterOptions(SfxMedium &rMedium)
Definition: writer.cxx:280
bool m_bExportPargraphNumbering
Definition: shellio.hxx:414
virtual bool IsStgWriter() const
Definition: fltini.cxx:206
SwContentNode * GoNext(SwNodeIndex *) const
Definition: nodes.cxx:1273
void MakeEndIndex(SwIndex *pIdx)
Definition: node.hxx:392
rtl_TextEncoding GetCharSet() const
SwDoc * m_pDoc
Definition: shellio.hxx:403
void InsertBkmk(const ::sw::mark::IMark &rBkmk)
Definition: writer.cxx:94
const SwAttrPool & GetAttrPool() const
Definition: doc.hxx:1308
bool CopyLocalFileToINet(OUString &rFileNm)
Definition: writer.cxx:303
virtual ~Writer() override
Definition: writer.cxx:132
void CreateBookmarkTable()
Definition: writer.cxx:437
bool m_bShowProgress
Definition: shellio.hxx:407