LibreOffice Module sw (master)  1
docdesc.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 <cmdid.h>
21 #include <init.hxx>
22 #include <editeng/lrspitem.hxx>
23 #include <editeng/ulspitem.hxx>
24 #include <editeng/paperinf.hxx>
25 #include <editeng/frmdiritem.hxx>
26 #include <sfx2/bindings.hxx>
27 #include <sfx2/dispatch.hxx>
28 #include <tools/globname.hxx>
29 #include <sal/log.hxx>
31 #include <fmtfsize.hxx>
32 #include <fmthdft.hxx>
33 #include <fmtcntnt.hxx>
34 #include <ftninfo.hxx>
35 #include <fesh.hxx>
36 #include <ndole.hxx>
37 #include <mdiexp.hxx>
38 #include <doc.hxx>
39 #include <IDocumentUndoRedo.hxx>
42 #include <IDocumentState.hxx>
44 #include <rootfrm.hxx>
45 #include <poolfmt.hxx>
46 #include <docsh.hxx>
47 #include <ftnidx.hxx>
48 #include <fmtftn.hxx>
49 #include <txtftn.hxx>
50 #include <fldbas.hxx>
51 #include <GetMetricVal.hxx>
52 #include <strings.hrc>
53 #include <hints.hxx>
54 #include <SwUndoPageDesc.hxx>
55 #include <pagedeschint.hxx>
56 #include <tgrditem.hxx>
57 #include <unotools/configmgr.hxx>
58 #include <unotools/syslocale.hxx>
59 #include <svx/swframetypes.hxx>
60 #include <com/sun/star/embed/XEmbeddedObject.hpp>
61 
62 using namespace com::sun::star;
63 
64 static void lcl_DefaultPageFormat( sal_uInt16 nPoolFormatId,
65  SwFrameFormat &rFormat1,
66  SwFrameFormat &rFormat2,
67  SwFrameFormat &rFormat3,
68  SwFrameFormat &rFormat4)
69 {
70  // --> #i41075# Printer on demand
71  // This function does not require a printer anymore.
72  // The default page size is obtained from the application
73  //locale
74 
76  const Size aPhysSize = SvxPaperInfo::GetDefaultPaperSize();
77  aFrameSize.SetSize( aPhysSize );
78 
79  // Prepare for default margins.
80  // Margins have a default minimum size.
81  // If the printer forces a larger margins, that's ok too.
82  // The HTML page desc had A4 as page size always.
83  // This has been changed to take the page size from the printer.
84  // Unfortunately, the margins of the HTML page desc are smaller than
85  // the margins used here in general, so one extra case is required.
86  // In the long term, this needs to be changed to always keep the
87  // margins from the page desc.
88  sal_Int32 nMinTop, nMinBottom, nMinLeft, nMinRight;
89  if( RES_POOLPAGE_HTML == nPoolFormatId )
90  {
91  nMinRight = nMinTop = nMinBottom = GetMetricVal( CM_1 );
92  nMinLeft = nMinRight * 2;
93  }
94  else if (!utl::ConfigManager::IsFuzzing() && MeasurementSystem::Metric == SvtSysLocale().GetLocaleData().getMeasurementSystemEnum() )
95  {
96  nMinTop = nMinBottom = nMinLeft = nMinRight = 1134; // 2 centimeters
97  }
98  else
99  {
100  nMinTop = nMinBottom = 1440; // as in MS Word: 1 Inch
101  nMinLeft = nMinRight = 1800; // 1,25 Inch
102  }
103 
104  // set margins
107 
108  aUL.SetUpper( static_cast<sal_uInt16>(nMinTop) );
109  aUL.SetLower( static_cast<sal_uInt16>(nMinBottom) );
110  aLR.SetRight( nMinRight );
111  aLR.SetLeft( nMinLeft );
112 
113  rFormat1.SetFormatAttr( aFrameSize );
114  rFormat1.SetFormatAttr( aLR );
115  rFormat1.SetFormatAttr( aUL );
116 
117  rFormat2.SetFormatAttr( aFrameSize );
118  rFormat2.SetFormatAttr( aLR );
119  rFormat2.SetFormatAttr( aUL );
120 
121  rFormat3.SetFormatAttr( aFrameSize );
122  rFormat3.SetFormatAttr( aLR );
123  rFormat3.SetFormatAttr( aUL );
124 
125  rFormat4.SetFormatAttr( aFrameSize );
126  rFormat4.SetFormatAttr( aLR );
127  rFormat4.SetFormatAttr( aUL );
128 }
129 
130 static void lcl_DescSetAttr( const SwFrameFormat &rSource, SwFrameFormat &rDest,
131  const bool bPage = true )
132 {
133  // We should actually use ItemSet's Intersect here, but that doesn't work
134  // correctly if we have different WhichRanges.
135 
136  // Take over the attributes which are of interest.
137  sal_uInt16 const aIdArr[] = {
138  RES_FRM_SIZE, RES_UL_SPACE, // [83..86
139  RES_BACKGROUND, RES_SHADOW, // [99..101
140  RES_COL, RES_COL, // [103
141  RES_TEXTGRID, RES_TEXTGRID, // [109
142  RES_FRAMEDIR, RES_FRAMEDIR, // [114
145 
146  // take over DrawingLayer FillStyles
148 
149  0};
150 
151  const SfxPoolItem* pItem;
152  for( sal_uInt16 n = 0; aIdArr[ n ]; n += 2 )
153  {
154  for( sal_uInt16 nId = aIdArr[ n ]; nId <= aIdArr[ n+1]; ++nId )
155  {
156  // #i45539#
157  // bPage == true:
158  // All in aIdArr except from RES_HEADER_FOOTER_EAT_SPACING
159  // bPage == false:
160  // All in aIdArr except from RES_COL and RES_PAPER_BIN:
161  bool bExecuteId(true);
162 
163  if(bPage)
164  {
165  // When Page
166  switch(nId)
167  {
168  // All in aIdArr except from RES_HEADER_FOOTER_EAT_SPACING
170  // take out SvxBrushItem; it's the result of the fallback
171  // at SwFormat::GetItemState and not really in state SfxItemState::SET
172  case RES_BACKGROUND:
173  bExecuteId = false;
174  break;
175  default:
176  break;
177  }
178  }
179  else
180  {
181  // When not Page
182  switch(nId)
183  {
184  // When not Page: All in aIdArr except from RES_COL and RES_PAPER_BIN:
185  case RES_COL:
186  case RES_PAPER_BIN:
187  bExecuteId = false;
188  break;
189  default:
190  break;
191  }
192  }
193 
194  if(bExecuteId)
195  {
196  if (SfxItemState::SET == rSource.GetItemState(nId, false, &pItem))
197  {
198  rDest.SetFormatAttr(*pItem);
199  }
200  else
201  {
202  rDest.ResetFormatAttr(nId);
203  }
204  }
205  }
206  }
207 
208  // Transmit pool and help IDs too
209  rDest.SetPoolFormatId( rSource.GetPoolFormatId() );
210  rDest.SetPoolHelpId( rSource.GetPoolHelpId() );
211  rDest.SetPoolHlpFileId( rSource.GetPoolHlpFileId() );
212 }
213 
214 namespace
215 {
216  SwFrameFormat& getFrameFormat(SwPageDesc &rDesc, bool bLeft, bool bFirst)
217  {
218  if (bFirst)
219  {
220  if (bLeft)
221  return rDesc.GetFirstLeft();
222  return rDesc.GetFirstMaster();
223  }
224  return rDesc.GetLeft();
225  }
226 
227  const SwFrameFormat& getConstFrameFormat(const SwPageDesc &rDesc, bool bLeft, bool bFirst)
228  {
229  return getFrameFormat(const_cast<SwPageDesc&>(rDesc), bLeft, bFirst);
230  }
231 }
232 
233 void SwDoc::CopyMasterHeader(const SwPageDesc &rChged, const SwFormatHeader &rHead, SwPageDesc &rDesc, bool bLeft, bool bFirst)
234 {
235  assert(bLeft || bFirst);
236  SwFrameFormat& rDescFrameFormat = getFrameFormat(rDesc, bLeft, bFirst);
237  if (bFirst && bLeft)
238  {
239  // special case: always shared with something
240  rDescFrameFormat.SetFormatAttr( rChged.IsFirstShared()
241  ? rDesc.GetLeft().GetHeader()
242  : rDesc.GetFirstMaster().GetHeader());
243  }
244  else if ((bFirst ? rChged.IsFirstShared() : rChged.IsHeaderShared())
245  || !rHead.IsActive())
246  {
247  // Left or first shares the header with the Master.
248  rDescFrameFormat.SetFormatAttr( rDesc.GetMaster().GetHeader() );
249  }
250  else if ( rHead.IsActive() )
251  { // Left or first gets its own header if the Format doesn't already have one.
252  // If it already has one and it points to the same Section as the
253  // Right one, it needs to get an own Header.
254  // The content is evidently copied.
255  const SwFormatHeader &rFormatHead = rDescFrameFormat.GetHeader();
256  if ( !rFormatHead.IsActive() )
257  {
258  SwFormatHeader aHead( getIDocumentLayoutAccess().MakeLayoutFormat( RndStdIds::HEADERL, nullptr ) );
259  rDescFrameFormat.SetFormatAttr( aHead );
260  // take over additional attributes (margins, borders ...)
261  ::lcl_DescSetAttr( *rHead.GetHeaderFormat(), *aHead.GetHeaderFormat(), false);
262  }
263  else
264  {
265  const SwFrameFormat *pRight = rHead.GetHeaderFormat();
266  const SwFormatContent &aRCnt = pRight->GetContent();
267  const SwFormatContent &aCnt = rFormatHead.GetHeaderFormat()->GetContent();
268 
269  if (!aCnt.GetContentIdx())
270  {
271  const SwFrameFormat& rChgedFrameFormat = getConstFrameFormat(rChged, bLeft, bFirst);
272  rDescFrameFormat.SetFormatAttr( rChgedFrameFormat.GetHeader() );
273  }
274  else if ((*aRCnt.GetContentIdx() == *aCnt.GetContentIdx()) ||
275  // The ContentIdx is _always_ different when called from
276  // SwDocStyleSheet::SetItemSet, because it deep-copies the
277  // PageDesc. So check if it was previously shared.
278  (bFirst ? rDesc.IsFirstShared() : rDesc.IsHeaderShared()))
279  {
280  SwFrameFormat *pFormat = new SwFrameFormat( GetAttrPool(),
281  bFirst ? "First header" : "Left header",
282  GetDfltFrameFormat() );
283  ::lcl_DescSetAttr( *pRight, *pFormat, false );
284  // The section which the right header attribute is pointing
285  // is copied, and the Index to the StartNode is set to
286  // the left or first header attribute.
287  SwNodeIndex aTmp( GetNodes().GetEndOfAutotext() );
289  SwNodeRange aRange( aRCnt.GetContentIdx()->GetNode(), 0,
290  *aRCnt.GetContentIdx()->GetNode().EndOfSectionNode() );
291  aTmp = *pSttNd->EndOfSectionNode();
292  GetNodes().Copy_( aRange, aTmp, false );
293  aTmp = *pSttNd;
294  GetDocumentContentOperationsManager().CopyFlyInFlyImpl(aRange, nullptr, aTmp);
295  SwPaM const source(aRange.aStart, aRange.aEnd);
296  SwPosition dest(aTmp);
297  sw::CopyBookmarks(source, dest);
298  pFormat->SetFormatAttr( SwFormatContent( pSttNd ) );
299  rDescFrameFormat.SetFormatAttr( SwFormatHeader( pFormat ) );
300  }
301  else
302  ::lcl_DescSetAttr( *pRight,
303  *const_cast<SwFrameFormat*>(rFormatHead.GetHeaderFormat()), false );
304  }
305  }
306 }
307 
308 void SwDoc::CopyMasterFooter(const SwPageDesc &rChged, const SwFormatFooter &rFoot, SwPageDesc &rDesc, bool bLeft, bool bFirst)
309 {
310  assert(bLeft || bFirst);
311  SwFrameFormat& rDescFrameFormat = getFrameFormat(rDesc, bLeft, bFirst);
312  if (bFirst && bLeft)
313  {
314  // special case: always shared with something
315  rDescFrameFormat.SetFormatAttr( rChged.IsFirstShared()
316  ? rDesc.GetLeft().GetFooter()
317  : rDesc.GetFirstMaster().GetFooter());
318  }
319  else if ((bFirst ? rChged.IsFirstShared() : rChged.IsFooterShared())
320  || !rFoot.IsActive())
321  {
322  // Left or first shares the Header with the Master.
323  rDescFrameFormat.SetFormatAttr( rDesc.GetMaster().GetFooter() );
324  }
325  else if ( rFoot.IsActive() )
326  { // Left or first gets its own Footer if the Format does not already have one.
327  // If the Format already has a Footer and it points to the same section as the Right one,
328  // it needs to get an own one.
329  // The content is evidently copied.
330  const SwFormatFooter &rFormatFoot = rDescFrameFormat.GetFooter();
331  if ( !rFormatFoot.IsActive() )
332  {
333  SwFormatFooter aFoot( getIDocumentLayoutAccess().MakeLayoutFormat( RndStdIds::FOOTER, nullptr ) );
334  rDescFrameFormat.SetFormatAttr( aFoot );
335  // Take over additional attributes (margins, borders ...).
336  ::lcl_DescSetAttr( *rFoot.GetFooterFormat(), *aFoot.GetFooterFormat(), false);
337  }
338  else
339  {
340  const SwFrameFormat *pRight = rFoot.GetFooterFormat();
341  const SwFormatContent &aRCnt = pRight->GetContent();
342  const SwFormatContent &aLCnt = rFormatFoot.GetFooterFormat()->GetContent();
343  if( !aLCnt.GetContentIdx() )
344  {
345  const SwFrameFormat& rChgedFrameFormat = getConstFrameFormat(rChged, bLeft, bFirst);
346  rDescFrameFormat.SetFormatAttr( rChgedFrameFormat.GetFooter() );
347  }
348  else if ((*aRCnt.GetContentIdx() == *aLCnt.GetContentIdx()) ||
349  // The ContentIdx is _always_ different when called from
350  // SwDocStyleSheet::SetItemSet, because it deep-copies the
351  // PageDesc. So check if it was previously shared.
352  (bFirst ? rDesc.IsFirstShared() : rDesc.IsFooterShared()))
353  {
354  SwFrameFormat *pFormat = new SwFrameFormat( GetAttrPool(),
355  bFirst ? "First footer" : "Left footer",
356  GetDfltFrameFormat() );
357  ::lcl_DescSetAttr( *pRight, *pFormat, false );
358  // The section to which the right footer attribute is pointing
359  // is copied, and the Index to the StartNode is set to
360  // the left footer attribute.
361  SwNodeIndex aTmp( GetNodes().GetEndOfAutotext() );
363  SwNodeRange aRange( aRCnt.GetContentIdx()->GetNode(), 0,
364  *aRCnt.GetContentIdx()->GetNode().EndOfSectionNode() );
365  aTmp = *pSttNd->EndOfSectionNode();
366  GetNodes().Copy_( aRange, aTmp, false );
367  aTmp = *pSttNd;
368  GetDocumentContentOperationsManager().CopyFlyInFlyImpl(aRange, nullptr, aTmp);
369  SwPaM const source(aRange.aStart, aRange.aEnd);
370  SwPosition dest(aTmp);
371  sw::CopyBookmarks(source, dest);
372  pFormat->SetFormatAttr( SwFormatContent( pSttNd ) );
373  rDescFrameFormat.SetFormatAttr( SwFormatFooter( pFormat ) );
374  }
375  else
376  ::lcl_DescSetAttr( *pRight,
377  *const_cast<SwFrameFormat*>(rFormatFoot.GetFooterFormat()), false );
378  }
379  }
380 }
381 
382 void SwDoc::ChgPageDesc( size_t i, const SwPageDesc &rChged )
383 {
384  assert(i < m_PageDescs.size() && "PageDescs is out of range.");
385 
386  SwPageDesc& rDesc = *m_PageDescs[i];
387  SwRootFrame* pTmpRoot = getIDocumentLayoutAccess().GetCurrentLayout();
388 
389  if (GetIDocumentUndoRedo().DoesUndo())
390  {
391  GetIDocumentUndoRedo().AppendUndo(
392  std::make_unique<SwUndoPageDesc>(rDesc, rChged, this));
393  }
394  ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo());
395 
396  // Mirror at first if needed.
397  if ( rChged.GetUseOn() == UseOnPage::Mirror )
398  const_cast<SwPageDesc&>(rChged).Mirror();
399  else
400  {
401  // Or else transfer values from Master to Left
402  ::lcl_DescSetAttr(rChged.GetMaster(),
403  const_cast<SwPageDesc&>(rChged).GetLeft());
404  }
405  ::lcl_DescSetAttr(rChged.GetMaster(),
406  const_cast<SwPageDesc&>(rChged).GetFirstMaster());
407  ::lcl_DescSetAttr(rChged.GetLeft(),
408  const_cast<SwPageDesc&>(rChged).GetFirstLeft());
409 
410  // Take over NumType.
411  if( rChged.GetNumType().GetNumberingType() != rDesc.GetNumType().GetNumberingType() )
412  {
413  rDesc.SetNumType( rChged.GetNumType() );
414  // Notify page number fields that NumFormat has changed
415  getIDocumentFieldsAccess().GetSysFieldType( SwFieldIds::PageNumber )->UpdateFields();
416  getIDocumentFieldsAccess().GetSysFieldType( SwFieldIds::RefPageGet )->UpdateFields();
417 
418  // If the numbering scheme has changed we could have QuoVadis/ErgoSum texts
419  // that refer to a changed page, so we invalidate foot notes.
420  SwFootnoteIdxs& rFootnoteIdxs = GetFootnoteIdxs();
421  for( SwFootnoteIdxs::size_type nPos = 0; nPos < rFootnoteIdxs.size(); ++nPos )
422  {
423  SwTextFootnote *pTextFootnote = rFootnoteIdxs[ nPos ];
424  const SwFormatFootnote &rFootnote = pTextFootnote->GetFootnote();
425  pTextFootnote->SetNumber(rFootnote.GetNumber(), rFootnote.GetNumberRLHidden(), rFootnote.GetNumStr());
426  }
427  }
428 
429  // Take over orientation
430  rDesc.SetLandscape( rChged.GetLandscape() );
431 
432  // #i46909# no undo if header or footer changed
433  bool bHeaderFooterChanged = false;
434 
435  // Synch header.
436  const SwFormatHeader &rHead = rChged.GetMaster().GetHeader();
437  if (undoGuard.UndoWasEnabled())
438  {
439  // #i46909# no undo if header or footer changed
440  // Did something change in the nodes?
441  const SwFormatHeader &rOldHead = rDesc.GetMaster().GetHeader();
442  bHeaderFooterChanged |=
443  ( rHead.IsActive() != rOldHead.IsActive() ||
444  rChged.IsHeaderShared() != rDesc.IsHeaderShared() ||
445  rChged.IsFirstShared() != rDesc.IsFirstShared() );
446  }
447  rDesc.GetMaster().SetFormatAttr( rHead );
448  CopyMasterHeader(rChged, rHead, rDesc, true, false); // Copy left header
449  CopyMasterHeader(rChged, rHead, rDesc, false, true); // Copy first master
450  CopyMasterHeader(rChged, rHead, rDesc, true, true); // Copy first left
451  rDesc.ChgHeaderShare( rChged.IsHeaderShared() );
452 
453  // Synch Footer.
454  const SwFormatFooter &rFoot = rChged.GetMaster().GetFooter();
455  if (undoGuard.UndoWasEnabled())
456  {
457  // #i46909# no undo if header or footer changed
458  // Did something change in the Nodes?
459  const SwFormatFooter &rOldFoot = rDesc.GetMaster().GetFooter();
460  bHeaderFooterChanged |=
461  ( rFoot.IsActive() != rOldFoot.IsActive() ||
462  rChged.IsFooterShared() != rDesc.IsFooterShared() );
463  }
464  rDesc.GetMaster().SetFormatAttr( rFoot );
465  CopyMasterFooter(rChged, rFoot, rDesc, true, false); // Copy left footer
466  CopyMasterFooter(rChged, rFoot, rDesc, false, true); // Copy first master
467  CopyMasterFooter(rChged, rFoot, rDesc, true, true); // Copy first left
468  rDesc.ChgFooterShare( rChged.IsFooterShared() );
469  // there is just one first shared flag for both header and footer?
470  rDesc.ChgFirstShare( rChged.IsFirstShared() );
471 
472  if ( rDesc.GetName() != rChged.GetName() )
473  rDesc.SetName( rChged.GetName() );
474 
475  // A RegisterChange is triggered, if necessary
476  rDesc.SetRegisterFormatColl( rChged.GetRegisterFormatColl() );
477 
478  // If UseOn or the Follow change, the paragraphs need to know about it.
479  bool bUseOn = false;
480  bool bFollow = false;
481  if (rDesc.GetUseOn() != rChged.GetUseOn())
482  {
483  rDesc.SetUseOn( rChged.GetUseOn() );
484  bUseOn = true;
485  }
486  if (rDesc.GetFollow() != rChged.GetFollow())
487  {
488  if (rChged.GetFollow() == &rChged)
489  {
490  if (rDesc.GetFollow() != &rDesc)
491  {
492  rDesc.SetFollow( &rDesc );
493  bFollow = true;
494  }
495  }
496  else
497  {
498  rDesc.SetFollow( rChged.m_pFollow );
499  bFollow = true;
500  }
501  }
502 
503  if ( (bUseOn || bFollow) && pTmpRoot)
504  // Inform layout!
505  {
506  for( auto aLayout : GetAllLayouts() )
507  aLayout->AllCheckPageDescs();
508  }
509 
510  // Take over the page attributes.
511  ::lcl_DescSetAttr( rChged.GetMaster(), rDesc.GetMaster() );
512  ::lcl_DescSetAttr( rChged.GetLeft(), rDesc.GetLeft() );
513  ::lcl_DescSetAttr( rChged.GetFirstMaster(), rDesc.GetFirstMaster() );
514  ::lcl_DescSetAttr( rChged.GetFirstLeft(), rDesc.GetFirstLeft() );
515 
516  // If the FootnoteInfo changes, the pages are triggered.
517  if( !(rDesc.GetFootnoteInfo() == rChged.GetFootnoteInfo()) )
518  {
519  rDesc.SetFootnoteInfo( rChged.GetFootnoteInfo() );
520  sw::PageFootnoteHint aHint;
521  rDesc.GetMaster().CallSwClientNotify(aHint);
522  rDesc.GetLeft().CallSwClientNotify(aHint);
523  rDesc.GetFirstMaster().CallSwClientNotify(aHint);
524  rDesc.GetFirstLeft().CallSwClientNotify(aHint);
525  }
526  getIDocumentState().SetModified();
527 
528  // #i46909# no undo if header or footer changed
529  if( bHeaderFooterChanged )
530  {
531  GetIDocumentUndoRedo().DelAllUndoObj();
532  }
533 
534  SfxBindings* pBindings =
535  ( GetDocShell() && GetDocShell()->GetDispatcher() ) ? GetDocShell()->GetDispatcher()->GetBindings() : nullptr;
536  if ( pBindings )
537  {
538  pBindings->Invalidate( SID_ATTR_PAGE_COLUMN );
539  pBindings->Invalidate( SID_ATTR_PAGE );
540  pBindings->Invalidate( SID_ATTR_PAGE_SIZE );
541  pBindings->Invalidate( SID_ATTR_PAGE_ULSPACE );
542  pBindings->Invalidate( SID_ATTR_PAGE_LRSPACE );
543  }
544 
545  //h/f of first-left page must not be unique but same as first master or left
546  assert((rDesc.IsFirstShared())
547  ? rDesc.GetFirstLeft().GetHeader().GetHeaderFormat() == rDesc.GetLeft().GetHeader().GetHeaderFormat()
548  : rDesc.GetFirstLeft().GetHeader().GetHeaderFormat() == rDesc.GetFirstMaster().GetHeader().GetHeaderFormat());
549  assert((rDesc.IsFirstShared())
550  ? rDesc.GetFirstLeft().GetFooter().GetFooterFormat() == rDesc.GetLeft().GetFooter().GetFooterFormat()
551  : rDesc.GetFirstLeft().GetFooter().GetFooterFormat() == rDesc.GetFirstMaster().GetFooter().GetFooterFormat());
552 }
553 
555 // #i7983#
557 {
558  if (nullptr == pDel)
559  return;
560 
561  // mba: test iteration as clients are removed while iteration
562  SwPageDescHint aHint( m_PageDescs[0] );
563  pDel->CallSwClientNotify( aHint );
564 
565  bool bHasLayout = getIDocumentLayoutAccess().HasLayout();
566  if ( mpFootnoteInfo->DependsOn( pDel ) )
567  {
568  mpFootnoteInfo->ChgPageDesc( m_PageDescs[0] );
569  if ( bHasLayout )
570  {
571  for( auto aLayout : GetAllLayouts() )
572  aLayout->CheckFootnotePageDescs(false);
573  }
574  }
575  else if ( mpEndNoteInfo->DependsOn( pDel ) )
576  {
577  mpEndNoteInfo->ChgPageDesc( m_PageDescs[0] );
578  if ( bHasLayout )
579  {
580  for( auto aLayout : GetAllLayouts() )
581  aLayout->CheckFootnotePageDescs(true);
582  }
583  }
584 
585  for (SwPageDesc* pPageDesc : m_PageDescs)
586  {
587  if (pPageDesc->GetFollow() == pDel)
588  {
589  pPageDesc->SetFollow(nullptr);
590  if( bHasLayout )
591  {
592  for( auto aLayout : GetAllLayouts() )
593  aLayout->AllCheckPageDescs();
594  }
595  }
596  }
597 }
598 
599 void SwDoc::BroadcastStyleOperation(const OUString& rName, SfxStyleFamily eFamily,
600  SfxHintId nOp)
601 {
602  if (mpDocShell)
603  {
604  SfxStyleSheetBasePool * pPool = mpDocShell->GetStyleSheetPool();
605 
606  if (pPool)
607  {
608  SfxStyleSheetBase* pBase = pPool->Find(rName, eFamily);
609 
610  if (pBase != nullptr)
611  pPool->Broadcast(SfxStyleSheetHint( nOp, *pBase ));
612  }
613  }
614 }
615 
616 void SwDoc::DelPageDesc( size_t i, bool bBroadcast )
617 {
618  OSL_ENSURE(i < m_PageDescs.size(), "PageDescs is out of range.");
619  OSL_ENSURE( i != 0, "You cannot delete the default Pagedesc.");
620  if ( i == 0 )
621  return;
622 
623  SwPageDesc &rDel = *m_PageDescs[i];
624 
625  if (bBroadcast)
626  BroadcastStyleOperation(rDel.GetName(), SfxStyleFamily::Page,
627  SfxHintId::StyleSheetErased);
628 
629  if (GetIDocumentUndoRedo().DoesUndo())
630  {
631  GetIDocumentUndoRedo().AppendUndo(
632  std::make_unique<SwUndoPageDescDelete>(rDel, this));
633  }
634 
635  PreDelPageDesc(&rDel); // #i7983#
636 
637  m_PageDescs.erase(m_PageDescs.begin() + i);
638  getIDocumentState().SetModified();
639 }
640 
641 SwPageDesc* SwDoc::MakePageDesc(const OUString &rName, const SwPageDesc *pCpy,
642  bool bRegardLanguage, bool bBroadcast)
643 {
644  SwPageDesc *pNew;
645  if( pCpy )
646  {
647  pNew = new SwPageDesc( *pCpy );
648  pNew->SetName( rName );
649  if( rName != pCpy->GetName() )
650  {
651  pNew->SetPoolFormatId( USHRT_MAX );
652  pNew->SetPoolHelpId( USHRT_MAX );
653  pNew->SetPoolHlpFileId( UCHAR_MAX );
654  }
655  }
656  else
657  {
658  pNew = new SwPageDesc( rName, GetDfltFrameFormat(), this );
659  // Set the default page format.
660  lcl_DefaultPageFormat( USHRT_MAX, pNew->GetMaster(), pNew->GetLeft(), pNew->GetFirstMaster(), pNew->GetFirstLeft() );
661 
662  SvxFrameDirection aFrameDirection = bRegardLanguage ?
664  : SvxFrameDirection::Horizontal_LR_TB;
665 
666  pNew->GetMaster().SetFormatAttr( SvxFrameDirectionItem(aFrameDirection, RES_FRAMEDIR) );
667  pNew->GetLeft().SetFormatAttr( SvxFrameDirectionItem(aFrameDirection, RES_FRAMEDIR) );
668  pNew->GetFirstMaster().SetFormatAttr( SvxFrameDirectionItem(aFrameDirection, RES_FRAMEDIR) );
669  pNew->GetFirstLeft().SetFormatAttr( SvxFrameDirectionItem(aFrameDirection, RES_FRAMEDIR) );
670  }
671 
672  std::pair<SwPageDescs::const_iterator, bool> res = m_PageDescs.push_back( pNew );
673  SAL_WARN_IF(!res.second, "sw", "MakePageDesc called with existing name" );
674 
675  if (bBroadcast)
676  BroadcastStyleOperation(rName, SfxStyleFamily::Page,
677  SfxHintId::StyleSheetCreated);
678 
679  if (GetIDocumentUndoRedo().DoesUndo())
680  {
681  GetIDocumentUndoRedo().AppendUndo(std::make_unique<SwUndoPageDescCreate>(pNew, this));
682  }
683 
684  getIDocumentState().SetModified();
685  return pNew;
686 }
687 
688 void SwDoc::PrtOLENotify( bool bAll )
689 {
690  SwFEShell *pShell = nullptr;
691  {
692  SwViewShell *pSh = getIDocumentLayoutAccess().GetCurrentViewShell();
693  if ( pSh )
694  {
695  for(SwViewShell& rShell : pSh->GetRingContainer())
696  {
697  if(auto pFEShell = dynamic_cast<SwFEShell*>( &rShell))
698  {
699  pShell = pFEShell;
700  break;
701  }
702  }
703  }
704  }
705  if ( !pShell )
706  {
707  // This doesn't make sense without a Shell and thus without a client, because
708  // the communication about size changes is implemented by these components.
709  // Because we don't have a Shell we remember this unfortunate situation
710  // in the document,
711  // which is made up for later on when creating the first Shell.
712  mbOLEPrtNotifyPending = true;
713  if ( bAll )
714  mbAllOLENotify = true;
715  }
716  else
717  {
718  if ( mbAllOLENotify )
719  bAll = true;
720 
721  mbOLEPrtNotifyPending = mbAllOLENotify = false;
722 
723  std::unique_ptr<SwOLENodes> pNodes = SwContentNode::CreateOLENodesArray( *GetDfltGrfFormatColl(), !bAll );
724  if ( pNodes )
725  {
726  ::StartProgress( STR_STATSTR_SWGPRTOLENOTIFY,
727  0, pNodes->size(), GetDocShell());
728  getIDocumentLayoutAccess().GetCurrentLayout()->StartAllAction();
729 
730  for( SwOLENodes::size_type i = 0; i < pNodes->size(); ++i )
731  {
732  ::SetProgressState( i, GetDocShell() );
733 
734  SwOLENode* pOLENd = (*pNodes)[i];
735  pOLENd->SetOLESizeInvalid( false );
736 
737  // At first load the Infos and see if it's not already in the exclude list.
739 
740  svt::EmbeddedObjectRef& xObj = pOLENd->GetOLEObj().GetObject();
741  if ( xObj.is() )
742  aName = SvGlobalName( xObj->getClassID() );
743  else // Not yet loaded
744  {
745  // TODO/LATER: retrieve ClassID of an unloaded object
746  // aName = ????
747  }
748 
749  bool bFound = false;
750  for ( std::vector<SvGlobalName>::size_type j = 0;
751  j < pGlobalOLEExcludeList->size() && !bFound;
752  ++j )
753  {
754  bFound = (*pGlobalOLEExcludeList)[j] == aName;
755  }
756  if ( bFound )
757  continue;
758 
759  // We don't know it, so the object has to be loaded.
760  // If it doesn't want to be informed
761  if ( xObj.is() )
762  {
763  pGlobalOLEExcludeList->push_back( aName );
764  }
765  }
766  pNodes.reset();
767  getIDocumentLayoutAccess().GetCurrentLayout()->EndAllAction();
768  ::EndProgress( GetDocShell() );
769  }
770  }
771 }
772 
773 IMPL_LINK_NOARG( SwDoc, DoUpdateModifiedOLE, Timer *, void )
774 {
775  SwFEShell* pSh = static_cast<SwFEShell*>(GetEditShell());
776  if( !pSh )
777  return;
778 
779  mbOLEPrtNotifyPending = mbAllOLENotify = false;
780 
781  std::unique_ptr<SwOLENodes> pNodes = SwContentNode::CreateOLENodesArray( *GetDfltGrfFormatColl(), true );
782  if( !pNodes )
783  return;
784 
785  ::StartProgress( STR_STATSTR_SWGPRTOLENOTIFY,
786  0, pNodes->size(), GetDocShell());
787  getIDocumentLayoutAccess().GetCurrentLayout()->StartAllAction();
788  SwUpdateAttr aHint(0,0,0);
789  for( SwOLENodes::size_type i = 0; i < pNodes->size(); ++i )
790  {
791  ::SetProgressState( i, GetDocShell() );
792 
793  SwOLENode* pOLENd = (*pNodes)[i];
794  pOLENd->SetOLESizeInvalid( false );
795 
796  // We don't know it, so the object has to be loaded.
797  // If it doesn't want to be informed
798  if( pOLENd->GetOLEObj().GetOleRef().is() ) // Broken?
799  {
800  pOLENd->UpdateAttr(aHint);
801  }
802  }
803  getIDocumentLayoutAccess().GetCurrentLayout()->EndAllAction();
804  ::EndProgress( GetDocShell() );
805 }
806 
807 static SwPageDesc* lcl_FindPageDesc( const SwPageDescs *pPageDescs,
808  size_t *pPos, const OUString &rName )
809 {
810  SwPageDesc* res = nullptr;
811  SwPageDescs::const_iterator it = pPageDescs->find( rName );
812  if( it != pPageDescs->end() )
813  {
814  res = *it;
815  if( pPos )
816  *pPos = std::distance( pPageDescs->begin(), it );
817  }
818  else if( pPos )
819  *pPos = SIZE_MAX;
820  return res;
821 }
822 
823 SwPageDesc* SwDoc::FindPageDesc( const OUString & rName, size_t* pPos ) const
824 {
825  return lcl_FindPageDesc( &m_PageDescs, pPos, rName );
826 }
827 
828 bool SwDoc::ContainsPageDesc( const SwPageDesc *pDesc, size_t* pPos ) const
829 {
830  if( pDesc == nullptr )
831  return false;
832  if( !m_PageDescs.contains( const_cast <SwPageDesc*>( pDesc ) ) ) {
833  if( pPos )
834  *pPos = SIZE_MAX;
835  return false;
836  }
837  if( ! pPos )
838  return true;
839 
841  &m_PageDescs, pPos, pDesc->GetName() );
842  SAL_WARN_IF( desc != pDesc, "sw", "SwPageDescs container is broken!" );
843  return true;
844 }
845 
846 void SwDoc::DelPageDesc( const OUString & rName, bool bBroadcast )
847 {
848  size_t nI;
849 
850  if (FindPageDesc(rName, &nI))
851  DelPageDesc(nI, bBroadcast);
852 }
853 
854 void SwDoc::ChgPageDesc( const OUString & rName, const SwPageDesc & rDesc)
855 {
856  size_t nI;
857 
858  if (FindPageDesc(rName, &nI))
859  ChgPageDesc(nI, rDesc);
860 }
861 
862 /*
863  * The HTML import cannot resist changing the page descriptions, I don't
864  * know why. This function is meant to check the page descriptors for invalid
865  * values.
866  */
868 {
869  for ( size_t i = 0; i < GetPageDescCnt(); ++i )
870  {
871  SwPageDesc& rDesc = GetPageDesc( i );
872 
873  SwFrameFormat& rMaster = rDesc.GetMaster();
874  SwFrameFormat& rLeft = rDesc.GetLeft();
875 
876  const SwFormatFrameSize& rMasterSize = rMaster.GetFrameSize();
877  const SwFormatFrameSize& rLeftSize = rLeft.GetFrameSize();
878 
879  const bool bSetSize = INVALID_TWIPS == rMasterSize.GetWidth() ||
880  INVALID_TWIPS == rMasterSize.GetHeight() ||
881  INVALID_TWIPS == rLeftSize.GetWidth() ||
882  INVALID_TWIPS == rLeftSize.GetHeight();
883 
884  if ( bSetSize )
885  lcl_DefaultPageFormat( rDesc.GetPoolFormatId(), rDesc.GetMaster(), rDesc.GetLeft(), rDesc.GetFirstMaster(), rDesc.GetFirstLeft() );
886  }
887 }
888 
889 void SwDoc::SetDefaultPageMode(bool bSquaredPageMode)
890 {
891  if( !bSquaredPageMode == !IsSquaredPageMode() )
892  return;
893 
894  const SwTextGridItem& rGrid = GetDefault( RES_TEXTGRID );
895  SwTextGridItem aNewGrid = rGrid;
896  aNewGrid.SetSquaredMode(bSquaredPageMode);
897  aNewGrid.Init();
898  SetDefault(aNewGrid);
899 
900  for ( size_t i = 0; i < GetPageDescCnt(); ++i )
901  {
902  SwPageDesc& rDesc = GetPageDesc( i );
903 
904  SwFrameFormat& rMaster = rDesc.GetMaster();
905  SwFrameFormat& rLeft = rDesc.GetLeft();
906 
907  SwTextGridItem aGrid(rMaster.GetFormatAttr(RES_TEXTGRID));
908  aGrid.SwitchPaperMode( bSquaredPageMode );
909  rMaster.SetFormatAttr(aGrid);
910  rLeft.SetFormatAttr(aGrid);
911  }
912 }
913 
915 {
916  const SwTextGridItem& rGrid = GetDefault( RES_TEXTGRID );
917  return rGrid.IsSquaredMode();
918 }
919 
920 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SvxNumType GetNumberingType() const
const SwEndNode * EndOfSectionNode() const
Definition: node.hxx:685
Starts a section of nodes in the document model.
Definition: node.hxx:311
static void lcl_DescSetAttr(const SwFrameFormat &rSource, SwFrameFormat &rDest, const bool bPage=true)
Definition: docdesc.cxx:130
constexpr TypedWhichId< SvxFrameDirectionItem > RES_FRAMEDIR(120)
tools::Long GetWidth() const
bool UndoWasEnabled() const
constexpr TypedWhichId< SvXMLAttrContainerItem > RES_UNKNOWNATR_CONTAINER(RES_UNKNOWNATR_BEGIN)
static std::unique_ptr< SwOLENodes > CreateOLENodesArray(const SwFormatColl &rColl, bool bOnlyWithInvalidSize)
Definition: node.cxx:2092
bool ContainsPageDesc(const SwPageDesc *pDesc, size_t *pPos) const
Definition: docdesc.cxx:828
SfxHintId
constexpr TypedWhichId< SwHeaderAndFooterEatSpacingItem > RES_HEADER_FOOTER_EAT_SPACING(121)
void SetRight(const tools::Long nR, const sal_uInt16 nProp=100)
static void lcl_DefaultPageFormat(sal_uInt16 nPoolFormatId, SwFrameFormat &rFormat1, SwFrameFormat &rFormat2, SwFrameFormat &rFormat3, SwFrameFormat &rFormat4)
Definition: docdesc.cxx:64
const_iterator end() const
Definition: pagedesc.hxx:434
Marks a position in the document model.
Definition: pam.hxx:35
const_iterator begin() const
Definition: pagedesc.hxx:433
SwFrameFormat & GetLeft()
Definition: pagedesc.hxx:217
#define SID_ATTR_PAGE_COLUMN
Definition: cmdid.h:861
void SetPoolHelpId(sal_uInt16 nId)
Definition: format.hxx:169
const SwOLEObj & GetOLEObj() const
Definition: ndole.hxx:112
const SwFormatHeader & GetHeader(bool=true) const
Definition: fmthdft.hxx:97
const_iterator find(const OUString &name) const
Definition: pagedesc.hxx:427
void SetPoolHelpId(sal_uInt16 const nId)
Definition: pagedesc.hxx:256
constexpr TypedWhichId< SwFormatCol > RES_COL(109)
void CopyMasterHeader(const SwPageDesc &rChged, const SwFormatHeader &rHead, SwPageDesc &pDesc, bool bLeft, bool bFirst)
Definition: docdesc.cxx:233
void DelPageDesc(const OUString &rName, bool bBroadcast=false)
Definition: docdesc.cxx:846
constexpr TypedWhichId< SwFormatFrameSize > RES_FRM_SIZE(89)
sal_uInt16 char char * pDesc
constexpr TypedWhichId< SvxPaperBinItem > RES_PAPER_BIN(90)
SwFrameFormat & GetFirstMaster()
Definition: pagedesc.hxx:218
css::uno::Reference< css::embed::XEmbeddedObject > const & GetOleRef()
Definition: ndole.cxx:915
sal_Int64 n
Definition: doc.hxx:186
sal_Int16 nId
SwNode & GetNode() const
Definition: ndindex.hxx:119
Content, content of frame (header, footer, fly).
Definition: fmtcntnt.hxx:31
void EndProgress(SwDocShell const *pDocShell)
Definition: mainwn.cxx:92
SvxFrameDirection
void Invalidate(sal_uInt16 nId)
#define INVALID_TWIPS
Definition: swtypes.hxx:52
The root element of a Writer document layout.
Definition: rootfrm.hxx:82
UseOnPage GetUseOn() const
Definition: pagedesc.hxx:331
const OUString & GetName() const
Definition: pagedesc.hxx:186
bool IsActive() const
Definition: fmthdft.hxx:89
std::vector< SvGlobalName > * pGlobalOLEExcludeList
Definition: init.cxx:438
void SetSquaredMode(bool bNew)
Definition: tgrditem.hxx:106
const SwPageFootnoteInfo & GetFootnoteInfo() const
Definition: pagedesc.hxx:195
void StartProgress(const char *pMessResId, tools::Long nStartValue, tools::Long nEndValue, SwDocShell *pDocShell)
Definition: mainwn.cxx:52
void SetPoolFormatId(sal_uInt16 nId)
Definition: format.hxx:165
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
sal_uInt16 GetPoolFormatId() const
Query and set PoolFormat-Id.
Definition: pagedesc.hxx:253
void PrtOLENotify(bool bAll)
Definition: docdesc.cxx:688
ByPos::const_iterator const_iterator
Definition: pagedesc.hxx:409
IMPL_LINK_NOARG(SwDoc, DoUpdateModifiedOLE, Timer *, void)
Definition: docdesc.cxx:773
svt::EmbeddedObjectRef & GetObject()
Definition: ndole.cxx:967
static bool IsFuzzing()
Footer, for pageformats Client of FrameFormat describing the footer.
Definition: fmthdft.hxx:64
void SetPoolHlpFileId(sal_uInt8 nId)
Definition: format.hxx:171
bool IsSquaredMode() const
Definition: tgrditem.hxx:104
void SetPoolHlpFileId(sal_uInt8 const nId)
Definition: pagedesc.hxx:258
const OUString & GetNumStr() const
Definition: fmtftn.hxx:68
SfxStyleFamily
size_type size() const
sal_uInt16 GetPoolFormatId() const
Get and set Pool style IDs.
Definition: format.hxx:164
void SetLower(const sal_uInt16 nL, const sal_uInt16 nProp=100)
SwPageDesc * FindPageDesc(const OUString &rName, size_t *pPos=nullptr) const
Definition: docdesc.cxx:823
static Size GetDefaultPaperSize(MapUnit eUnit=MapUnit::MapTwip)
void SetNumber(sal_uInt16 nNumber, sal_uInt16 nNumberRLHidden, const OUString &sNumStr)
Definition: atrftn.cxx:359
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:136
bool IsHeaderShared() const
Definition: pagedesc.hxx:297
void CheckDefaultPageFormat()
The html import sometimes overwrites the page sizes set in the page descriptions. ...
Definition: docdesc.cxx:867
Style of a layout element.
Definition: frmfmt.hxx:58
SfxBindings * GetBindings() const
int i
const SwFrameFormat * GetFooterFormat() const
Definition: fmthdft.hxx:85
bool GetLandscape() const
Definition: pagedesc.hxx:189
SwPageDesc * MakePageDesc(const OUString &rName, const SwPageDesc *pCpy=nullptr, bool bRegardLanguage=true, bool bBroadcast=false)
Definition: docdesc.cxx:641
sal_uInt16 GetNumberRLHidden() const
Definition: fmtftn.hxx:70
constexpr sal_uInt16 XATTR_FILL_FIRST(XATTRSET_LINE+1)
sal_uInt8 GetPoolHlpFileId() const
Definition: format.hxx:170
const SwFormatFooter & GetFooter(bool=true) const
Definition: fmthdft.hxx:99
const SwTextFormatColl * GetRegisterFormatColl() const
retrieve the style for the grid alignment
Definition: pagedesc.cxx:203
void ChgPageDesc(const OUString &rName, const SwPageDesc &)
Definition: docdesc.cxx:854
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
Definition: format.cxx:402
Marks a node in the document model.
Definition: ndindex.hxx:31
bool IsFooterShared() const
Definition: pagedesc.hxx:301
ring_container GetRingContainer()
Definition: ring.hxx:240
void CopyMasterFooter(const SwPageDesc &rChged, const SwFormatFooter &rFoot, SwPageDesc &pDesc, bool bLeft, bool bFirst)
Definition: docdesc.cxx:308
void SetPoolFormatId(sal_uInt16 const nId)
Definition: pagedesc.hxx:254
tools::Long GetHeight() const
void SetDefaultPageMode(bool bSquaredPageMode)
Definition: docdesc.cxx:889
const SwFormatFootnote & GetFootnote() const
Definition: txatbase.hxx:200
#define CM_1
Frame cannot be moved in Var-direction.
const SwPageDesc * GetFollow() const
Definition: pagedesc.hxx:245
const SwNodeIndex * GetContentIdx() const
Definition: fmtcntnt.hxx:46
virtual bool SetFormatAttr(const SfxPoolItem &rAttr)
Definition: format.cxx:464
void UpdateAttr(const SwUpdateAttr &)
Definition: node.cxx:1096
SwFrameFormat & GetMaster()
Definition: pagedesc.hxx:216
void Broadcast(const SfxHint &rHint)
virtual bool ResetFormatAttr(sal_uInt16 nWhich1, sal_uInt16 nWhich2=0)
Definition: format.cxx:642
constexpr TypedWhichId< SwTextGridItem > RES_TEXTGRID(115)
bool IsSquaredPageMode() const
Definition: docdesc.cxx:914
constexpr TypedWhichId< SvxBrushItem > RES_BACKGROUND(105)
void SetLeft(const tools::Long nL, const sal_uInt16 nProp=100)
sal_uInt16 GetPoolHelpId() const
Get and set Help-IDs for document templates.
Definition: format.hxx:168
#define SAL_WARN_IF(condition, area, stream)
static SwPageDesc * lcl_FindPageDesc(const SwPageDescs *pPageDescs, size_t *pPos, const OUString &rName)
Definition: docdesc.cxx:807
void SwitchPaperMode(bool bNew)
Definition: atrfrm.cxx:2358
const o3tl::enumarray< SvxAdjust, unsigned short > aSvxToUnoAdjust USHRT_MAX
Definition: unosett.cxx:254
SwFrameFormat & GetFirstLeft()
Definition: pagedesc.hxx:219
OUString aName
void SetProgressState(tools::Long nPosition, SwDocShell const *pDocShell)
Definition: mainwn.cxx:82
LanguageType GetAppLanguage()
Definition: init.cxx:728
SwPageDesc * m_pFollow
Definition: pagedesc.hxx:153
void SetSize(const Size &rSize)
bool SetName(const OUString &rNewName)
Definition: pagedesc.cxx:128
const SfxPoolItem & GetFormatAttr(sal_uInt16 nWhich, bool bInParents=true) const
If bInParents is FALSE, search only in this format for attribute.
Definition: format.cxx:383
constexpr TypedWhichId< SvxLRSpaceItem > RES_LR_SPACE(91)
Header, for PageFormats Client of FrameFormat describing the header.
Definition: fmthdft.hxx:33
const SwFormatFrameSize & GetFrameSize(bool=true) const
Definition: fmtfsize.hxx:104
const SwFormatContent & GetContent(bool=true) const
Definition: fmtcntnt.hxx:55
virtual void CallSwClientNotify(const SfxHint &rHint) const override
Definition: calbck.cxx:363
SvxFrameDirection GetDefaultFrameDirection(LanguageType nLanguage)
Return the AutoCollection by its Id.
Definition: poolfmt.cxx:79
void SetOLESizeInvalid(bool b)
Definition: ndole.hxx:134
SfxDispatcher * GetDispatcher() const
constexpr sal_uInt16 XATTR_FILL_LAST(XATTR_FILLBACKGROUND)
bool IsFirstShared() const
Definition: pagedesc.cxx:375
bool IsActive() const
Definition: fmthdft.hxx:58
std::vector< SwTextFootnote * >::size_type size_type
void PreDelPageDesc(SwPageDesc const *pDel)
All descriptors whose Follow point to the to-be-deleted have to be adapted.
Definition: docdesc.cxx:556
sal_uInt16 GetMetricVal(int n)
virtual SfxStyleSheetBase * Find(const OUString &, SfxStyleFamily eFam, SfxStyleSearchBits n=SfxStyleSearchBits::All)
void SetUpper(const sal_uInt16 nU, const sal_uInt16 nProp=100)
sal_uInt16 GetNumber() const
Definition: fmtftn.hxx:69
void CopyBookmarks(const SwPaM &rPam, SwPosition &rCpyPam)
constexpr TypedWhichId< SvxULSpaceItem > RES_UL_SPACE(92)
constexpr TypedWhichId< SvxShadowItem > RES_SHADOW(107)
void BroadcastStyleOperation(const OUString &rName, SfxStyleFamily eFamily, SfxHintId nOp)
Definition: docdesc.cxx:599
static SwPageDesc * FindPageDesc(SwDoc *pDoc, sal_uInt16 nPoolId)
Definition: htmlcss1.cxx:1327
const SwFrameFormat * GetHeaderFormat() const
Definition: fmthdft.hxx:54
sal_uInt16 nPos
const LocaleDataWrapper & GetLocaleData()
static SwStartNode * MakeEmptySection(const SwNodeIndex &rIdx, SwStartNodeType=SwNormalStartNode)
Create an empty section of Start- and EndNote.
Definition: nodes.cxx:1876
const SvxNumberType & GetNumType() const
Definition: pagedesc.hxx:192