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