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