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