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