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