LibreOffice Module sw (master)  1
shellio.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 <hintids.hxx>
21 #include <osl/diagnose.h>
22 #include <tools/date.hxx>
23 #include <tools/time.hxx>
24 #include <svl/urihelper.hxx>
25 #include <svl/fstathelper.hxx>
27 #include <sfx2/docfile.hxx>
28 #include <editeng/lrspitem.hxx>
29 #include <editeng/ulspitem.hxx>
30 #include <editeng/boxitem.hxx>
31 #include <editeng/paperinf.hxx>
32 #include <node.hxx>
33 #include <docary.hxx>
34 #include <fmtanchr.hxx>
35 #include <fmtfsize.hxx>
36 #include <fmtpdsc.hxx>
37 #include <swtypes.hxx>
38 #include <shellio.hxx>
39 #include <doc.hxx>
40 #include <IDocumentUndoRedo.hxx>
46 #include <IDocumentState.hxx>
48 #include <pam.hxx>
49 #include <editsh.hxx>
50 #include <undobj.hxx>
51 #include <swundo.hxx>
52 #include <swtable.hxx>
53 #include <tblafmt.hxx>
54 #include <tblsel.hxx>
55 #include <pagedesc.hxx>
56 #include <poolfmt.hxx>
57 #include <fltini.hxx>
58 #include <docsh.hxx>
59 #include <ndtxt.hxx>
60 #include <redline.hxx>
61 #include <swerror.h>
62 #include <paratr.hxx>
63 #include <pausethreadstarting.hxx>
64 
65 using namespace ::com::sun::star;
66 
67 static bool sw_MergePortions(SwNode *const& pNode, void *)
68 {
69  if (pNode->IsTextNode())
70  {
71  pNode->GetTextNode()->FileLoadedInitHints();
72  }
73  return true;
74 }
75 
76 ErrCode SwReader::Read( const Reader& rOptions )
77 {
78  // copy variables
79  Reader* po = const_cast<Reader*>(&rOptions);
80  po->m_pStream = pStrm;
81  po->m_pStorage = pStg;
82  po->m_xStorage = xStg;
83  po->m_bInsertMode = nullptr != pCursor;
85 
86  // if a Medium is selected, get its Stream
87  if( nullptr != (po->m_pMedium = pMedium ) &&
88  !po->SetStrmStgPtr() )
89  {
90  po->SetReadUTF8( false );
91  po->SetBlockMode( false );
92  po->SetOrganizerMode( false );
93  po->SetIgnoreHTMLComments( false );
95  }
96 
97  ErrCode nError = ERRCODE_NONE;
98 
99  GetDoc();
100 
101  // while reading, do not call OLE-Modified
102  Link<bool,void> aOLELink( mxDoc->GetOle2Link() );
103  mxDoc->SetOle2Link( Link<bool,void>() );
104 
105  mxDoc->SetInReading( true );
106  mxDoc->SetInXMLImport( dynamic_cast< XMLReader* >(po) != nullptr );
107 
108  SwPaM *pPam;
109  if( pCursor )
110  pPam = pCursor;
111  else
112  {
113  // if the Reader was not called by a Shell, create a PaM ourselves
114  SwNodeIndex nNode( mxDoc->GetNodes().GetEndOfContent(), -1 );
115  pPam = new SwPaM( nNode );
116  // For Web documents the default template was set already by InitNew,
117  // unless the filter is not HTML,
118  // or a SetTemplateName was called in ConvertFrom.
119  if( !mxDoc->getIDocumentSettingAccess().get(DocumentSettingId::HTML_MODE) || ReadHTML != po || !po->mxTemplate.is() )
120  po->SetTemplate( *mxDoc );
121  }
122 
123  // Pams are connected like rings; stop when we return to the 1st element
124  SwPaM *pEnd = pPam;
125 
126  bool bReadPageDescs = false;
127  bool const bDocUndo = mxDoc->GetIDocumentUndoRedo().DoesUndo();
128  bool bSaveUndo = bDocUndo && pCursor;
129  if( bSaveUndo )
130  {
131  // the reading of the page template cannot be undone!
132  bReadPageDescs = po->m_aOption.IsPageDescs();
133  if( bReadPageDescs )
134  {
135  bSaveUndo = false;
136  mxDoc->GetIDocumentUndoRedo().DelAllUndoObj();
137  }
138  else
139  {
140  mxDoc->GetIDocumentUndoRedo().ClearRedo();
141  mxDoc->GetIDocumentUndoRedo().StartUndo( SwUndoId::INSDOKUMENT, nullptr );
142  }
143  }
144  mxDoc->GetIDocumentUndoRedo().DoUndo(false);
145 
146  SwNodeIndex aSplitIdx( mxDoc->GetNodes() );
147 
148  RedlineFlags eOld = mxDoc->getIDocumentRedlineAccess().GetRedlineFlags();
149  RedlineFlags ePostReadRedlineFlags( RedlineFlags::Ignore );
150 
151  // Array of FlyFormats
152  SwFrameFormatsV aFlyFrameArr;
153  // only read templates? then ignore multi selection!
154  bool bFormatsOnly = po->m_aOption.IsFormatsOnly();
155 
156  while( true )
157  {
158  std::unique_ptr<SwUndoInsDoc> pUndo;
159  if( bSaveUndo )
160  pUndo.reset(new SwUndoInsDoc( *pPam ));
161 
162  mxDoc->getIDocumentRedlineAccess().SetRedlineFlags_intern( RedlineFlags::Ignore );
163 
164  std::unique_ptr<SwPaM> pUndoPam;
165  if( bDocUndo || pCursor )
166  {
167  // set Pam to the previous node, so that it is not also moved
168  const SwNodeIndex& rTmp = pPam->GetPoint()->nNode;
169  pUndoPam.reset(new SwPaM( rTmp, rTmp, 0, -1 ));
170  }
171 
172  // store for now all Fly's
173  if( pCursor )
174  {
175  std::copy(mxDoc->GetSpzFrameFormats()->begin(),
176  mxDoc->GetSpzFrameFormats()->end(), std::back_inserter(aFlyFrameArr));
177  }
178 
179  const sal_Int32 nSttContent = pPam->GetPoint()->nContent.GetIndex();
180 
181  // make sure the End position is correct for all Readers
182  SwContentNode* pCNd = pPam->GetContentNode();
183  sal_Int32 nEndContent = pCNd ? pCNd->Len() - nSttContent : 0;
184  SwNodeIndex aEndPos( pPam->GetPoint()->nNode, 1 );
185 
186  mxDoc->getIDocumentRedlineAccess().SetRedlineFlags_intern( eOld );
187 
188  nError = po->Read( *mxDoc, sBaseURL, *pPam, aFileName );
189 
190  // an ODF document may contain redline mode in settings.xml; save it!
191  ePostReadRedlineFlags = mxDoc->getIDocumentRedlineAccess().GetRedlineFlags();
192 
193  mxDoc->getIDocumentRedlineAccess().SetRedlineFlags_intern( RedlineFlags::Ignore );
194 
195  if( ! nError.IsError() ) // set the End position already
196  {
197  --aEndPos;
198  pCNd = aEndPos.GetNode().GetContentNode();
199  if( !pCNd && nullptr == ( pCNd = SwNodes::GoPrevious( &aEndPos ) ))
200  pCNd = mxDoc->GetNodes().GoNext( &aEndPos );
201 
202  pPam->GetPoint()->nNode = aEndPos;
203  const sal_Int32 nLen = pCNd->Len();
204  if( nLen < nEndContent )
205  nEndContent = 0;
206  else
207  nEndContent = nLen - nEndContent;
208  pPam->GetPoint()->nContent.Assign( pCNd, nEndContent );
209 
210  const SwStartNode* pTableBoxStart = pCNd->FindTableBoxStartNode();
211  if ( pTableBoxStart )
212  {
213  SwTableBox* pBox = pTableBoxStart->GetTableBox();
214  if ( pBox )
215  {
216  mxDoc->ChkBoxNumFormat( *pBox, true );
217  }
218  }
219  }
220 
221  if( pCursor )
222  {
223  *pUndoPam->GetMark() = *pPam->GetPoint();
224  ++pUndoPam->GetPoint()->nNode;
225  SwNode& rNd = pUndoPam->GetNode();
226  if( rNd.IsContentNode() )
227  pUndoPam->GetPoint()->nContent.Assign(
228  static_cast<SwContentNode*>(&rNd), nSttContent );
229  else
230  pUndoPam->GetPoint()->nContent.Assign( nullptr, 0 );
231 
232  bool bChkHeaderFooter = rNd.FindHeaderStartNode() ||
233  rNd.FindFooterStartNode();
234 
235  // search all new Fly's, and store them as individual Undo Objects
236  for( SwFrameFormats::size_type n = 0; n < mxDoc->GetSpzFrameFormats()->size(); ++n )
237  {
238  SwFrameFormat* pFrameFormat = (*mxDoc->GetSpzFrameFormats())[ n ];
239  const SwFormatAnchor& rAnchor = pFrameFormat->GetAnchor();
240  // ok, here IsAlive is a misnomer...
241  if (!aFlyFrameArr.IsAlive(pFrameFormat))
242  {
243  SwPosition const*const pFrameAnchor(
244  rAnchor.GetContentAnchor());
245  if ( (RndStdIds::FLY_AT_PAGE == rAnchor.GetAnchorId())
246  || ( pFrameAnchor
247  && ( ( (RndStdIds::FLY_AT_PARA == rAnchor.GetAnchorId())
248  && ( (pUndoPam->GetPoint()->nNode ==
249  pFrameAnchor->nNode)
250  || (pUndoPam->GetMark()->nNode ==
251  pFrameAnchor->nNode)
252  )
253  )
254  // #i97570# also check frames anchored AT char
255  || ( (RndStdIds::FLY_AT_CHAR == rAnchor.GetAnchorId())
257  *pFrameAnchor,
258  *pUndoPam->GetPoint(),
259  *pUndoPam->GetMark())
260  )
261  )
262  )
263  )
264  {
265  if( bChkHeaderFooter &&
266  (RndStdIds::FLY_AT_PARA == rAnchor.GetAnchorId()) &&
267  RES_DRAWFRMFMT == pFrameFormat->Which() )
268  {
269  // DrawObjects are not allowed in Headers/Footers!
270  pFrameFormat->DelFrames();
271  mxDoc->DelFrameFormat( pFrameFormat );
272  --n;
273  }
274  else
275  {
276  if( bSaveUndo )
277  {
278  mxDoc->getIDocumentRedlineAccess().SetRedlineFlags_intern( eOld );
279  // UGLY: temp. enable undo
280  mxDoc->GetIDocumentUndoRedo().DoUndo(true);
281  mxDoc->GetIDocumentUndoRedo().AppendUndo(
282  std::make_unique<SwUndoInsLayFormat>( pFrameFormat,0,0 ) );
283  mxDoc->GetIDocumentUndoRedo().DoUndo(false);
284  mxDoc->getIDocumentRedlineAccess().SetRedlineFlags_intern( RedlineFlags::Ignore );
285  }
286  if( pFrameFormat->HasWriterListeners() )
287  {
288  // Draw-Objects create a Frame when being inserted; thus delete them
289  pFrameFormat->DelFrames();
290  }
291 
292  if (RndStdIds::FLY_AT_PAGE == rAnchor.GetAnchorId())
293  {
294  if( !rAnchor.GetContentAnchor() )
295  {
296  pFrameFormat->MakeFrames();
297  }
298  else if( pCursor )
299  {
300  mxDoc->SetContainsAtPageObjWithContentAnchor( true );
301  }
302  }
303  else
304  pFrameFormat->MakeFrames();
305  }
306  }
307  }
308  }
309  aFlyFrameArr.clear();
310 
311  mxDoc->getIDocumentRedlineAccess().SetRedlineFlags_intern( eOld );
312  if( mxDoc->getIDocumentRedlineAccess().IsRedlineOn() )
313  mxDoc->getIDocumentRedlineAccess().AppendRedline( new SwRangeRedline( nsRedlineType_t::REDLINE_INSERT, *pUndoPam ), true);
314  else
315  mxDoc->getIDocumentRedlineAccess().SplitRedline( *pUndoPam );
316  mxDoc->getIDocumentRedlineAccess().SetRedlineFlags_intern( RedlineFlags::Ignore );
317  }
318  if( bSaveUndo )
319  {
320  mxDoc->getIDocumentRedlineAccess().SetRedlineFlags_intern( eOld );
321  pUndo->SetInsertRange( *pUndoPam, false );
322  // UGLY: temp. enable undo
323  mxDoc->GetIDocumentUndoRedo().DoUndo(true);
324  mxDoc->GetIDocumentUndoRedo().AppendUndo( std::move(pUndo) );
325  mxDoc->GetIDocumentUndoRedo().DoUndo(false);
326  mxDoc->getIDocumentRedlineAccess().SetRedlineFlags_intern( RedlineFlags::Ignore );
327  }
328 
329  pUndoPam.reset();
330 
331  pPam = pPam->GetNext();
332  if( pPam == pEnd )
333  break;
334 
335  // only read templates? then ignore multi selection! Bug 68593
336  if( bFormatsOnly )
337  break;
338 
339  /*
340  * !!! The Status of the Stream has to be reset directly. !!!
341  * When Seeking, the current Status-, EOF- and bad-Bit is set;
342  * nobody knows why
343  */
344  if( pStrm )
345  {
346  pStrm->Seek(0);
347  pStrm->ResetError();
348  }
349  }
350 
351  // fdo#52028: ODF file import does not result in MergePortions being called
352  // for every attribute, since that would be inefficient. So call it here.
353  // This is only necessary for formats that may contain RSIDs (ODF,MSO).
354  // It's too hard to figure out which nodes were inserted in Insert->File
355  // case (redlines, flys, footnotes, header/footer) so just do every node.
356  mxDoc->GetNodes().ForEach(&sw_MergePortions);
357 
358  mxDoc->SetInReading( false );
359  mxDoc->SetInXMLImport( false );
360 
361  mxDoc->InvalidateNumRules();
362  mxDoc->UpdateNumRule();
363  mxDoc->ChkCondColls();
364  mxDoc->SetAllUniqueFlyNames();
365  mxDoc->getIDocumentState().SetLoaded();
366  // Clear unassigned cell styles, because they aren't needed anymore.
367  mxDoc->GetCellStyles().clear();
368 
369  mxDoc->GetIDocumentUndoRedo().DoUndo(bDocUndo);
370  if (!bReadPageDescs && bSaveUndo )
371  {
372  mxDoc->getIDocumentRedlineAccess().SetRedlineFlags_intern( eOld );
373  mxDoc->GetIDocumentUndoRedo().EndUndo( SwUndoId::INSDOKUMENT, nullptr );
374  mxDoc->getIDocumentRedlineAccess().SetRedlineFlags_intern( RedlineFlags::Ignore );
375  }
376 
377  // delete Pam if it was created only for reading
378  if( !pCursor )
379  {
380  delete pPam; // open a new one
381 
382  // #i42634# Moved common code of SwReader::Read() and
383  // SwDocShell::UpdateLinks() to new SwDoc::UpdateLinks():
384  // ATM still with Update
385  mxDoc->getIDocumentLinksAdministration().UpdateLinks();
386 
387  // not insert: set the redline mode read from settings.xml
388  eOld = ePostReadRedlineFlags & ~RedlineFlags::Ignore;
389 
390  mxDoc->getIDocumentFieldsAccess().SetFieldsDirty(false, nullptr, 0);
391  }
392 
393  mxDoc->getIDocumentRedlineAccess().SetRedlineFlags_intern( eOld );
394  mxDoc->SetOle2Link( aOLELink );
395 
396  if( pCursor ) // the document is now modified
397  mxDoc->getIDocumentState().SetModified();
398  // #i38810# - If links have been updated, the document
399  // have to be modified. During update of links the OLE link at the document
400  // isn't set. Thus, the document's modified state has to be set again after
401  // the OLE link is restored - see above <mxDoc->SetOle2Link( aOLELink )>.
402  if ( mxDoc->getIDocumentLinksAdministration().LinksUpdated() )
403  {
404  mxDoc->getIDocumentState().SetModified();
405  }
406 
407  po->SetReadUTF8( false );
408  po->SetBlockMode( false );
409  po->SetOrganizerMode( false );
410  po->SetIgnoreHTMLComments( false );
411 
412  return nError;
413 }
414 
415 
416 SwReader::SwReader(SfxMedium& rMedium, const OUString& rFileName, SwDoc *pDocument)
417  : SwDocFac(pDocument), pStrm(nullptr), pMedium(&rMedium), pCursor(nullptr),
418  aFileName(rFileName), mbSkipImages(false)
419 {
420  SetBaseURL( rMedium.GetBaseURL() );
421  SetSkipImages( rMedium.IsSkipImages() );
422 }
423 
424 
425 // Read into an existing document
426 SwReader::SwReader(SvStream& rStrm, const OUString& rFileName, const OUString& rBaseURL, SwPaM& rPam)
427  : SwDocFac(rPam.GetDoc()), pStrm(&rStrm), pMedium(nullptr), pCursor(&rPam),
428  aFileName(rFileName), mbSkipImages(false)
429 {
430  SetBaseURL( rBaseURL );
431 }
432 
433 SwReader::SwReader(SfxMedium& rMedium, const OUString& rFileName, SwPaM& rPam)
434  : SwDocFac(rPam.GetDoc()), pStrm(nullptr), pMedium(&rMedium),
435  pCursor(&rPam), aFileName(rFileName), mbSkipImages(false)
436 {
437  SetBaseURL( rMedium.GetBaseURL() );
438 }
439 
440 SwReader::SwReader( const uno::Reference < embed::XStorage > &rStg, const OUString& rFilename, SwPaM &rPam )
441  : SwDocFac(rPam.GetDoc()), pStrm(nullptr), xStg( rStg ), pMedium(nullptr), pCursor(&rPam), aFileName(rFilename), mbSkipImages(false)
442 {
443 }
444 
446  : m_aDateStamp( Date::EMPTY ),
447  m_aTimeStamp( tools::Time::EMPTY ),
448  m_aCheckDateTime( DateTime::EMPTY ),
449  m_pStream(nullptr), m_pMedium(nullptr), m_bInsertMode(false),
450  m_bTemplateBrowseMode(false), m_bReadUTF8(false), m_bBlockMode(false), m_bOrganizerMode(false),
451  m_bHasAskTemplateName(false), m_bIgnoreHTMLComments(false), m_bSkipImages(false)
452 {
453 }
454 
456 {
457 }
458 
459 OUString Reader::GetTemplateName(SwDoc& /*rDoc*/) const
460 {
461  return OUString();
462 }
463 
464 // load the Filter template, set and release
466 {
467  if( !m_bHasAskTemplateName )
468  {
470  m_bHasAskTemplateName = true;
471  }
472 
473  if( m_aTemplateName.isEmpty() )
474  ClearTemplate();
475  else
476  {
478  const OUString aFileName = aTDir.GetMainURL( INetURLObject::DecodeMechanism::NONE );
479  OSL_ENSURE( !aTDir.HasError(), "No absolute path for template name!" );
480  DateTime aCurrDateTime( DateTime::SYSTEM );
481  bool bLoad = false;
482 
483  // if the template is already loaded, check once-a-minute if it has changed
484  if( !mxTemplate.is() || aCurrDateTime >= m_aCheckDateTime )
485  {
486  Date aTstDate( Date::EMPTY );
487  tools::Time aTstTime( tools::Time::EMPTY );
490  &aTstDate, &aTstTime ) &&
491  ( !mxTemplate.is() || m_aDateStamp != aTstDate || m_aTimeStamp != aTstTime ))
492  {
493  bLoad = true;
494  m_aDateStamp = aTstDate;
495  m_aTimeStamp = aTstTime;
496  }
497 
498  // only one minute later check if it has changed
499  m_aCheckDateTime = aCurrDateTime;
500  m_aCheckDateTime += tools::Time( 0, 1 );
501  }
502 
503  if (bLoad)
504  {
505  ClearTemplate();
506  OSL_ENSURE( !mxTemplate.is(), "Who holds the template doc?" );
507 
508  // If the writer module is not installed,
509  // we cannot create a SwDocShell. We could create a
510  // SwWebDocShell however, because this exists always
511  // for the help.
512  SvtModuleOptions aModuleOptions;
513  if (aModuleOptions.IsWriter())
514  {
515  SwDocShell *pDocSh = new SwDocShell(SfxObjectCreateMode::INTERNAL);
516  SfxObjectShellLock xDocSh = pDocSh;
517  if (pDocSh->DoInitNew())
518  {
519  mxTemplate = pDocSh->GetDoc();
520  mxTemplate->SetOle2Link( Link<bool,void>() );
521  // always FALSE
522  mxTemplate->GetIDocumentUndoRedo().DoUndo( false );
523  mxTemplate->getIDocumentSettingAccess().set(DocumentSettingId::BROWSE_MODE, m_bTemplateBrowseMode );
524  mxTemplate->RemoveAllFormatLanguageDependencies();
525 
526  ReadXML->SetOrganizerMode( true );
527  SfxMedium aMedium( aFileName, StreamMode::NONE );
528  SwReader aRdr( aMedium, OUString(), mxTemplate.get() );
529  aRdr.Read( *ReadXML );
530  ReadXML->SetOrganizerMode( false );
531  }
532  }
533  }
534 
535  OSL_ENSURE( !mxTemplate.is() || FStatHelper::IsDocument( aFileName ) || m_aTemplateName=="$$Dummy$$",
536  "TemplatePtr but no template exist!" );
537  }
538 
539  return mxTemplate.get();
540 }
541 
543 {
544  bool bRet = false;
545 
546  GetTemplateDoc(rDoc);
547  if( mxTemplate.is() )
548  {
550  rDoc.ReplaceStyles( *mxTemplate );
551  rDoc.getIDocumentFieldsAccess().SetFixFields(nullptr);
552  bRet = true;
553  }
554 
555  return bRet;
556 }
557 
559 {
560  mxTemplate.clear();
561 }
562 
563 void Reader::SetTemplateName( const OUString& rDir )
564 {
565  if( !rDir.isEmpty() && m_aTemplateName != rDir )
566  {
567  ClearTemplate();
568  m_aTemplateName = rDir;
569  }
570 }
571 
573 {
574  ClearTemplate();
575  mxTemplate = new SwDoc;
576  mxTemplate->getIDocumentSettingAccess().set(DocumentSettingId::BROWSE_MODE, m_bTemplateBrowseMode );
577  mxTemplate->getIDocumentDeviceAccess().getPrinter( true );
578  mxTemplate->RemoveAllFormatLanguageDependencies();
579  m_aCheckDateTime = Date( 1, 1, 2300 ); // year 2300 should be sufficient
580  m_aTemplateName = "$$Dummy$$";
581 }
582 
583 // Users that do not need to open these Streams / Storages,
584 // have to override this method
586 {
587  OSL_ENSURE( m_pMedium, "Where is the Media??" );
588 
589  if( m_pMedium->IsStorage() )
590  {
592  {
594  return true;
595  }
596  }
597  else
598  {
601  {
602  m_pStorage = new SotStorage( *m_pStream );
603  m_pStream = nullptr;
604  }
605  else if ( !(SwReaderType::Stream & GetReaderType()) )
606  {
607  m_pStream = nullptr;
608  return false;
609  }
610 
611  return true;
612  }
613  return false;
614 }
615 
617 {
618  return SwReaderType::Stream;
619 }
620 
621 void Reader::SetFltName( const OUString& )
622 {
623 }
624 
626 {
627  rFrameSet.Put( SvxLRSpaceItem(RES_LR_SPACE) );
628  rFrameSet.Put( SvxULSpaceItem(RES_UL_SPACE) );
629  rFrameSet.Put( SvxBoxItem(RES_BOX) );
630 }
631 
633 {
634  sal_uInt16 const s_ids[3] = {
636  };
637  for (sal_uInt16 i : s_ids)
638  {
639  SwFrameFormat *const pFrameFormat = rDoc.getIDocumentStylePoolAccess().GetFrameFormatFromPool( i );
640 
641  pFrameFormat->ResetFormatAttr( RES_LR_SPACE );
642  pFrameFormat->ResetFormatAttr( RES_UL_SPACE );
643  pFrameFormat->ResetFormatAttr( RES_BOX );
644  }
645 }
646 
647  // read the sections of the document, which is equal to the medium.
648  // returns the count of it
649 size_t Reader::GetSectionList(SfxMedium&, std::vector<OUString>&) const
650 {
651  return 0;
652 }
653 
654 bool SwReader::HasGlossaries( const Reader& rOptions )
655 {
656  // copy variables
657  Reader* po = const_cast<Reader*>(&rOptions);
658  po->m_pStream = pStrm;
659  po->m_pStorage = pStg;
660  po->m_bInsertMode = false;
661 
662  // if a Medium is selected, get its Stream
663  bool bRet = false;
664  if( nullptr == (po->m_pMedium = pMedium ) || po->SetStrmStgPtr() )
665  bRet = po->HasGlossaries();
666  return bRet;
667 }
668 
669 bool SwReader::ReadGlossaries( const Reader& rOptions,
670  SwTextBlocks& rBlocks, bool bSaveRelFiles )
671 {
672  // copy variables
673  Reader* po = const_cast<Reader*>(&rOptions);
674  po->m_pStream = pStrm;
675  po->m_pStorage = pStg;
676  po->m_bInsertMode = false;
677 
678  // if a Medium is selected, get its Stream
679  bool bRet = false;
680  if( nullptr == (po->m_pMedium = pMedium ) || po->SetStrmStgPtr() )
681  bRet = po->ReadGlossaries( rBlocks, bSaveRelFiles );
682  return bRet;
683 }
684 
686 {
687  return false;
688 }
689 
691 {
692  return false;
693 }
694 
696 {
697  return SwReaderType::Storage;
698 }
699 
700 /*
701  * Writer
702  */
703 
704 /*
705  * Constructors, Destructors are inline (inc/shellio.hxx).
706  */
707 
708 SwWriter::SwWriter(SvStream& rStrm, SwCursorShell &rShell, bool bInWriteAll)
709  : pStrm(&rStrm), pMedium(nullptr), pOutPam(nullptr), pShell(&rShell),
710  rDoc(*rShell.GetDoc()), bWriteAll(bInWriteAll)
711 {
712 }
713 
715  : pStrm(&rStrm), pMedium(nullptr), pOutPam(nullptr), pShell(nullptr), rDoc(rDocument),
716  bWriteAll(true)
717 {
718 }
719 
720 SwWriter::SwWriter(SvStream& rStrm, SwPaM& rPam, bool bInWriteAll)
721  : pStrm(&rStrm), pMedium(nullptr), pOutPam(&rPam), pShell(nullptr),
722  rDoc(*rPam.GetDoc()), bWriteAll(bInWriteAll)
723 {
724 }
725 
726 SwWriter::SwWriter( const uno::Reference < embed::XStorage >& rStg, SwDoc &rDocument)
727  : pStrm(nullptr), xStg( rStg ), pMedium(nullptr), pOutPam(nullptr), pShell(nullptr), rDoc(rDocument), bWriteAll(true)
728 {
729 }
730 
731 SwWriter::SwWriter(SfxMedium& rMedium, SwCursorShell &rShell, bool bInWriteAll)
732  : pStrm(nullptr), pMedium(&rMedium), pOutPam(nullptr), pShell(&rShell),
733  rDoc(*rShell.GetDoc()), bWriteAll(bInWriteAll)
734 {
735 }
736 
737 SwWriter::SwWriter(SfxMedium& rMedium, SwDoc &rDocument)
738  : pStrm(nullptr), pMedium(&rMedium), pOutPam(nullptr), pShell(nullptr), rDoc(rDocument),
739  bWriteAll(true)
740 {
741 }
742 
743 ErrCode SwWriter::Write( WriterRef const & rxWriter, const OUString* pRealFileName )
744 {
745  // #i73788#
746  SwPauseThreadStarting aPauseThreadStarting;
747 
748  bool bHasMark = false;
749  SwPaM * pPam;
750 
752 
753  if ( pShell && !bWriteAll && pShell->IsTableMode() )
754  {
755  bWriteAll = true;
756  xDoc = new SwDoc;
757 
758  // Copy parts of a table:
759  // Create a table with the width of the original and copy the selected cells.
760  // The sizes are corrected by ratio.
761 
762  // search the layout for cells
763  SwSelBoxes aBoxes;
764  GetTableSel( *pShell, aBoxes );
765  const SwTableNode* pTableNd = static_cast<const SwTableNode*>(aBoxes[0]->GetSttNd()->StartOfSectionNode());
766  SwNodeIndex aIdx( xDoc->GetNodes().GetEndOfExtras(), 2 );
767  SwContentNode *pNd = aIdx.GetNode().GetContentNode();
768  OSL_ENSURE( pNd, "Node not found" );
769  SwPosition aPos( aIdx, SwIndex( pNd ) );
770  pTableNd->GetTable().MakeCopy( xDoc.get(), aPos, aBoxes );
771  }
772 
773  if( !bWriteAll && ( pShell || pOutPam ))
774  {
775  if( pShell )
776  pPam = pShell->GetCursor();
777  else
778  pPam = pOutPam;
779 
780  SwPaM *pEnd = pPam;
781 
782  // 1st round: Check if there is a selection
783  while(true)
784  {
785  bHasMark = bHasMark || pPam->HasMark();
786  pPam = pPam->GetNext();
787  if(bHasMark || pPam == pEnd)
788  break;
789  }
790 
791  // if there is no selection, select the whole document
792  if(!bHasMark)
793  {
794  if( pShell )
795  {
796  pShell->Push();
797  pShell->SttEndDoc(true);
798  pShell->SetMark();
799  pShell->SttEndDoc(false);
800  }
801  else
802  {
803  pPam = new SwPaM( *pPam, pPam );
804  pPam->Move( fnMoveBackward, GoInDoc );
805  pPam->SetMark();
806  pPam->Move( fnMoveForward, GoInDoc );
807  }
808  }
809  // pPam is still the current Cursor !!
810  }
811  else
812  {
813  // no Shell or write-everything -> create a Pam
814  SwDoc* pOutDoc = xDoc.is() ? xDoc.get() : &rDoc;
815  pPam = new SwPaM( pOutDoc->GetNodes().GetEndOfContent() );
816  if( pOutDoc->IsClipBoard() )
817  {
818  pPam->Move( fnMoveBackward, GoInDoc );
819  pPam->SetMark();
820  pPam->Move( fnMoveForward, GoInDoc );
821  }
822  else
823  {
824  pPam->SetMark();
825  pPam->Move( fnMoveBackward, GoInDoc );
826  }
827  }
828 
829  rxWriter->m_bWriteAll = bWriteAll;
830  SwDoc* pOutDoc = xDoc.is() ? xDoc.get() : &rDoc;
831 
832  // If the default PageDesc has still the initial value,
833  // (e.g. if no printer was set) then set it to DIN A4.
834  // #i37248# - Modifications are only allowed at a new document.
835  // <pOutDoc> contains a new document, if <xDoc> is set - see above.
836  if ( xDoc.is() && !pOutDoc->getIDocumentDeviceAccess().getPrinter( false ) )
837  {
838  const SwPageDesc& rPgDsc = pOutDoc->GetPageDesc( 0 );
839  //const SwPageDesc& rPgDsc = *pOutDoc->GetPageDescFromPool( RES_POOLPAGE_STANDARD );
840  const SwFormatFrameSize& rSz = rPgDsc.GetMaster().GetFrameSize();
841  // Clipboard-Document is always created w/o printer; thus the
842  // default PageDesc is always aug LONG_MAX !! Set then to DIN A4
843  if( LONG_MAX == rSz.GetHeight() || LONG_MAX == rSz.GetWidth() )
844  {
845  SwPageDesc aNew( rPgDsc );
846  SwFormatFrameSize aNewSz( rSz );
848  aNewSz.SetHeight( a4.Width() );
849  aNewSz.SetWidth( a4.Height() );
850  aNew.GetMaster().SetFormatAttr( aNewSz );
851  pOutDoc->ChgPageDesc( 0, aNew );
852  }
853  }
854 
855  bool bLockedView(false);
856  SwEditShell* pESh = pOutDoc->GetEditShell();
857  if( pESh )
858  {
859  bLockedView = pESh->IsViewLocked();
860  pESh->LockView( true ); //lock visible section
861  pESh->StartAllAction();
862  }
863 
864  const bool bOrigPurgeOle = pOutDoc->getIDocumentSettingAccess().get(DocumentSettingId::PURGE_OLE);
866 
867  ErrCode nError = ERRCODE_NONE;
868  if( pMedium )
869  nError = rxWriter->Write( *pPam, *pMedium, pRealFileName );
870  else if( pStrm )
871  nError = rxWriter->Write( *pPam, *pStrm, pRealFileName );
872  else if( xStg.is() )
873  nError = rxWriter->Write( *pPam, xStg, pRealFileName );
874 
875  pOutDoc->getIDocumentSettingAccess().set(DocumentSettingId::PURGE_OLE, bOrigPurgeOle );
876 
877  if( pESh )
878  {
879  pESh->EndAllAction();
880  pESh->LockView( bLockedView );
881  }
882 
883  // If the selection was only created for printing, reset the old cursor before returning
884  if( !bWriteAll && ( pShell || pOutPam ))
885  {
886  if(!bHasMark)
887  {
888  if( pShell )
890  else
891  delete pPam;
892  }
893  }
894  else
895  {
896  delete pPam; // delete the created Pam
897  // Everything was written successfully? Tell the document!
898  if ( !nError.IsError() && !xDoc.is() )
899  {
901  // #i38810# - reset also flag, that indicates updated links
903  }
904  }
905 
906  if ( xDoc.is() )
907  {
908  xDoc.clear();
909  bWriteAll = false;
910  }
911 
912  return nError;
913 }
914 
915 bool SetHTMLTemplate( SwDoc & rDoc )
916 {
917  // get template name of the Sfx-HTML-Filter !!!
918  if( !ReadHTML->GetTemplateDoc(rDoc) )
920 
921  bool bRet = ReadHTML->SetTemplate( rDoc );
922 
923  SwNodes& rNds = rDoc.GetNodes();
924  SwNodeIndex aIdx( rNds.GetEndOfExtras(), 1 );
925  SwContentNode* pCNd = rNds.GoNext( &aIdx );
926  if( pCNd )
927  {
928  pCNd->SetAttr
930  pCNd->ChgFormatColl( rDoc.getIDocumentStylePoolAccess().GetTextCollFromPool( RES_POOLCOLL_TEXT, false ));
931  }
932 
933  return bRet;
934 }
935 
936 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Reader()
Definition: shellio.cxx:445
long Width() const
bool IsSkipImages()
Starts a section of nodes in the document model.
Definition: node.hxx:303
virtual sal_Int32 Len() const
Definition: node.cxx:1183
SfxMedium * pMedium
Definition: shellio.hxx:504
SVL_DLLPUBLIC bool IsDocument(const OUString &rURL)
virtual bool ReadGlossaries(SwTextBlocks &, bool bSaveRelFiles) const
Definition: shellio.cxx:690
const SwStartNode * FindHeaderStartNode() const
Definition: node.hxx:202
Marks a position in the document model.
Definition: pam.hxx:35
OUString sBaseURL
Definition: shellio.hxx:151
Pagedescriptor Client of SwPageDesc that is "described" by the attribute.
Definition: fmtpdsc.hxx:35
SwPaM * GetCursor(bool bMakeTableCursor=true) const
Return pointer to the current shell cursor.
Definition: crsrsh.cxx:185
bool ReadGlossaries(const Reader &, SwTextBlocks &, bool bSaveRelFiles)
Definition: shellio.cxx:669
SwTableBox * GetTableBox() const
If node is in a table return the respective table box.
Definition: node.cxx:745
tools::Time m_aTimeStamp
Definition: shellio.hxx:206
const SwStartNode * FindFooterStartNode() const
Definition: node.hxx:204
bool SttEndDoc(bool bStt)
Definition: crsrsh.cxx:563
void ClearTemplate()
Definition: shellio.cxx:558
IDocumentDeviceAccess const & getIDocumentDeviceAccess() const
Definition: doc.cxx:270
bool IsPageDescs() const
Definition: shellio.hxx:121
long Height() const
SwNodeIndex nNode
Definition: pam.hxx:37
bool IsTableMode() const
Definition: crsrsh.hxx:643
long GetWidth() const
virtual void SetLinksUpdated(const bool bNewLinksUpdated)=0
rtl::Reference< SwDoc > mxDoc
Definition: docfac.hxx:29
bool IsFormatsOnly() const
Definition: shellio.hxx:116
Date m_aDateStamp
Definition: shellio.hxx:205
SfxMedium *const pMedium
Definition: shellio.hxx:147
Definition: doc.hxx:185
IDocumentLinksAdministration const & getIDocumentLinksAdministration() const
Definition: doc.cxx:292
virtual SwReaderType GetReaderType() override
Definition: shellio.cxx:695
bool SetTemplate(SwDoc &rDoc)
Definition: shellio.cxx:542
void SetOrganizerMode(bool bSet)
Definition: shellio.hxx:257
SvStream * pStrm
Definition: shellio.hxx:144
bool m_bTemplateBrowseMode
Definition: shellio.hxx:217
sal_uInt64 Seek(sal_uInt64 nPos)
tools::SvRef< SotStorage > m_pStorage
Definition: shellio.hxx:211
static SwContentNode * GoPrevious(SwNodeIndex *)
Definition: nodes.cxx:1290
ErrCode Write(WriterRef const &rxWriter, const OUString *=nullptr)
Definition: shellio.cxx:743
bool m_bHasAskTemplateName
Definition: shellio.hxx:221
void SetReadUTF8(bool bSet)
Definition: shellio.hxx:251
bool HasError() const
bool IsDestroyFrameAnchoredAtChar(SwPosition const &rAnchorPos, SwPosition const &rStart, SwPosition const &rEnd, DelContentType const nDelContentType)
will DelContentIndex destroy a frame anchored at character at rAnchorPos?
Definition: undobj.cxx:1524
virtual SwFrameFormat * GetFrameFormatFromPool(sal_uInt16 nId)=0
Return required automatic format.
static bool IsStorageFile(OUString const &rFileName)
bool HasWriterListeners() const
Definition: calbck.hxx:211
void EndAllAction()
Definition: edws.cxx:96
void ReplaceStyles(const SwDoc &rSource, bool bIncludePageStyles=true)
Definition: docfmt.cxx:1548
SwContentNode * GetContentNode(bool bPoint=true) const
Definition: pam.hxx:229
SwPaM *const pOutPam
Definition: shellio.hxx:506
IDocumentFieldsAccess const & getIDocumentFieldsAccess() const
Definition: doc.cxx:389
bool IsStorage()
virtual void set(DocumentSettingId id, bool value)=0
Set the specified document setting.
void SetSkipImages(bool bSkipImages)
Definition: shellio.hxx:176
Reader * ReadXML
Definition: fltini.cxx:65
static void ResetFrameFormatAttrs(SfxItemSet &rFrameSet)
Definition: shellio.cxx:625
SwIndex nContent
Definition: pam.hxx:38
SwDoc * GetDoc()
Document is created after calling Read(...).
Definition: docfact.cxx:38
Unsorted, undeleting SwFrameFormat vector.
Definition: docary.hxx:278
IDocumentStylePoolAccess const & getIDocumentStylePoolAccess() const
Definition: doc.cxx:458
bool MakeCopy(SwDoc *, const SwPosition &, const SwSelBoxes &, bool bCpyName=false) const
Definition: tblrwcl.cxx:2030
void SetBlockMode(bool bSet)
Definition: shellio.hxx:254
PAPER_A4
Reader * ReadHTML
Definition: fltini.cxx:65
#define RES_UL_SPACE
Definition: hintids.hxx:197
const SwTable & GetTable() const
Definition: node.hxx:497
css::uno::Reference< css::embed::XStorage > GetStorage(bool bCreateTempIfNo=true)
SwReader(SfxMedium &, const OUString &rFilename, SwDoc *pDoc=nullptr)
Definition: shellio.cxx:416
SwPaM *const pCursor
Definition: shellio.hxx:149
SwDoc & rDoc
Definition: shellio.hxx:508
SwPaM * GetNext()
Definition: pam.hxx:264
virtual SwPageDesc * GetPageDescFromPool(sal_uInt16 nId, bool bRegardLanguage=true)=0
Return required automatic page style.
void SetWidth(long n)
bool IsAlive(typename std::remove_pointer< Value >::type const *const p) const
check that given format is still alive (i.e. contained here)
Definition: docary.hxx:143
SwNode & GetEndOfContent() const
Regular ContentSection (i.e. the BodyText).
Definition: ndarr.hxx:164
SwDoc * GetDoc()
returns Doc. But be careful!
Definition: docsh.hxx:202
bool IsContentNode() const
Definition: node.hxx:628
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:136
bool Move(SwMoveFnCollection const &fnMove=fnMoveForward, SwGoInDoc fnGo=GoInContent)
Movement of cursor.
Definition: pam.cxx:483
css::uno::Reference< css::embed::XStorage > xStg
Definition: shellio.hxx:146
Style of a layout element.
Definition: frmfmt.hxx:57
const SwFormatAnchor & GetAnchor(bool=true) const
Definition: fmtanchr.hxx:81
tools::SvRef< SotStorage > const pStg
Definition: shellio.hxx:145
void GetTableSel(const SwCursorShell &rShell, SwSelBoxes &rBoxes, const SwTableSearchType eSearchType)
Definition: tblsel.cxx:144
const SwPosition * GetPoint() const
Definition: pam.hxx:207
void SetIgnoreHTMLComments(bool bSet)
Definition: shellio.hxx:259
virtual bool SetStrmStgPtr()
Definition: shellio.cxx:585
SwIndex & Assign(SwIndexReg *, sal_Int32)
Definition: index.cxx:198
RndStdIds GetAnchorId() const
Definition: fmtanchr.hxx:65
const SwPageDesc & GetPageDesc(const size_t i) const
Definition: doc.hxx:875
SwEditShell const * GetEditShell() const
Definition: doccorr.cxx:323
const SwPosition * GetContentAnchor() const
Definition: fmtanchr.hxx:67
Helper class to pause starting of threads during existence of an instance of this class...
SwWriter(SvStream &, SwCursorShell &, bool bWriteAll=false)
Definition: shellio.cxx:708
void Push()
store a copy of the current cursor on the cursor stack
Definition: crsrsh.cxx:2143
Text body.
Definition: poolfmt.hxx:251
int i
SwContentNode * GetContentNode()
Definition: node.hxx:615
FlyAnchors.
Definition: fmtanchr.hxx:34
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
Definition: pam.hxx:205
bool m_bSkipImages
Definition: shellio.hxx:223
virtual void DelFrames()
Destroys all Frames in aDepend (Frames are identified via dynamic_cast).
Definition: atrfrm.cxx:2617
Marks a character position inside a document model node.
Definition: index.hxx:37
SwDoc * GetTemplateDoc(SwDoc &rDoc)
Definition: shellio.cxx:465
css::uno::Reference< css::embed::XStorage > xStg
Definition: shellio.hxx:503
OUString GetBaseURL(bool bForSaving=false)
OUString m_aTemplateName
Definition: shellio.hxx:203
IDocumentState const & getIDocumentState() const
Definition: doc.cxx:426
static bool sw_MergePortions(SwNode *const &pNode, void *)
Definition: shellio.cxx:67
void ChgPageDesc(const OUString &rName, const SwPageDesc &)
Definition: docdesc.cxx:860
void SetMark()
Definition: crsrsh.hxx:871
Marks a node in the document model.
Definition: ndindex.hxx:31
bool GoInDoc(SwPaM &rPam, SwMoveFnCollection const &fnMove)
Definition: pam.cxx:882
static Size GetPaperSize(Paper ePaper, MapUnit eUnit=MapUnit::MapTwip)
SwCursorShell * pShell
Definition: shellio.hxx:507
bool SetHTMLTemplate(SwDoc &rDoc)
Definition: shellio.cxx:915
virtual SfxPrinter * getPrinter(bool bCreate) const =0
Return the printer set at the document.
const long LONG_MAX
SwReaderType
Definition: shellio.hxx:182
virtual OUString GetTemplateName(SwDoc &rDoc) const
Definition: shellio.cxx:459
#define RES_LR_SPACE
Definition: hintids.hxx:196
virtual bool SetFormatAttr(const SfxPoolItem &rAttr)
Definition: format.cxx:460
void SetBaseURL(const OUString &rURL)
Definition: shellio.hxx:175
OUString GetMainURL(DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
void MakeHTMLDummyTemplateDoc()
Definition: shellio.cxx:572
ignore Redlines
bool IsError() const
ErrCode Read(const Reader &)
Definition: shellio.cxx:76
sal_uInt16 Which() const
for Querying of Writer-functions.
Definition: format.hxx:78
const RedlineType_t REDLINE_INSERT
SwFrameFormat & GetMaster()
Definition: pagedesc.hxx:216
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
SvStream * GetInStream()
virtual void SetFltName(const OUString &rFltNm)
Definition: shellio.cxx:621
virtual bool ResetFormatAttr(sal_uInt16 nWhich1, sal_uInt16 nWhich2=0)
Definition: format.cxx:652
SwgReaderOption m_aOption
Definition: shellio.hxx:215
virtual bool SetAttr(const SfxPoolItem &)
made virtual
Definition: node.cxx:1471
virtual ~Reader()
Definition: shellio.cxx:455
#define RES_DRAWFRMFMT
Definition: hintids.hxx:277
#define ERRCODE_NONE
bool mbSkipImages
Definition: shellio.hxx:152
void LockView(bool b)
Definition: viewsh.hxx:465
virtual bool HasGlossaries() const
Definition: shellio.cxx:685
SwMoveFnCollection const & fnMoveForward
SwPam::Move()/Find() default argument.
Definition: paminit.cxx:59
virtual ErrCode Read(SwDoc &, const OUString &rBaseURL, SwPaM &, const OUString &)=0
bool bWriteAll
Definition: shellio.hxx:510
virtual void SetFixFields(const DateTime *pNewDateTime)=0
sal_Int32 GetIndex() const
Definition: index.hxx:95
bool IsClipBoard() const
Definition: doc.hxx:954
virtual void MakeFrames()
Creates the views.
Definition: atrfrm.cxx:2628
bool DoInitNew(SfxMedium *pMedium=nullptr)
IDocumentSettingAccess const & getIDocumentSettingAccess() const
Definition: doc.cxx:208
SwNodes & GetNodes()
Definition: doc.hxx:403
virtual SwTextFormatColl * GetTextCollFromPool(sal_uInt16 nId, bool bRegardLanguage=true)=0
Return "Auto-Collection with ID.
void FileLoadedInitHints()
initialize the hints after file loading (which takes shortcuts)
Definition: ndtxt.cxx:270
SwTableBox is one table cell in the document model.
Definition: swtable.hxx:386
void SetHeight(long n)
SfxMedium * m_pMedium
Definition: shellio.hxx:213
SVL_DLLPUBLIC bool GetModifiedDateTimeOfFile(const OUString &rURL, Date *pDate, tools::Time *pTime)
SvStream * m_pStream
Definition: shellio.hxx:210
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
const SwFormatFrameSize & GetFrameSize(bool=true) const
Definition: fmtfsize.hxx:104
const SwStartNode * FindTableBoxStartNode() const
Definition: node.hxx:196
SwMoveFnCollection const & fnMoveBackward
Definition: paminit.cxx:58
rtl::Reference< SwDoc > mxTemplate
Definition: shellio.hxx:202
void RemoveAllFormatLanguageDependencies()
Definition: poolfmt.cxx:311
virtual size_t GetSectionList(SfxMedium &rMedium, std::vector< OUString > &rStrings) const
Definition: shellio.cxx:649
#define RES_BOX
Definition: hintids.hxx:211
css::uno::Reference< css::embed::XStorage > m_xStorage
Definition: shellio.hxx:212
virtual void ResetError()
SwFrameFormatsBase::size_type size_type
Definition: docary.hxx:216
virtual void SetMark()
Unless this is called, the getter method of Mark will return Point.
Definition: pam.cxx:457
DateTime m_aCheckDateTime
Definition: shellio.hxx:207
static void ResetFrameFormats(SwDoc &rDoc)
Definition: shellio.cxx:632
bool Pop(PopMode)
delete cursor
Definition: crsrsh.cxx:2165
void SetTemplateName(const OUString &rDir)
Definition: shellio.cxx:563
SvStream * pStrm
Definition: shellio.hxx:502
SwNode & GetEndOfExtras() const
This is the last EndNode of a special section.
Definition: ndarr.hxx:162
void StartAllAction()
For all views of this document.
Definition: edws.cxx:85
long GetHeight() const
bool IsTextNode() const
Definition: node.hxx:636
OUString const aFileName
Definition: shellio.hxx:150
SwContentNode * GoNext(SwNodeIndex *) const
Definition: nodes.cxx:1273
bool HasGlossaries(const Reader &)
Definition: shellio.cxx:654
#define ERR_SWG_FILE_FORMAT_ERROR
Definition: swerror.h:24
bool IsViewLocked() const
Definition: viewsh.hxx:464
virtual SwReaderType GetReaderType()
Definition: shellio.cxx:616
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
Definition: ndtxt.hxx:842
bool m_bInsertMode
Definition: shellio.hxx:216
virtual void ResetModified()=0
Base class of the Writer document model elements.
Definition: node.hxx:79