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