LibreOffice Module sw (master)  1
atrfrm.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 <sal/config.h>
21 
22 #include <com/sun/star/text/ColumnSeparatorStyle.hpp>
23 #include <com/sun/star/text/WrapTextMode.hpp>
24 #include <com/sun/star/text/TextContentAnchorType.hpp>
25 #include <com/sun/star/container/XIndexContainer.hpp>
26 #include <com/sun/star/text/TextGridMode.hpp>
27 #include <sal/log.hxx>
28 #include <o3tl/any.hxx>
29 #include <o3tl/safeint.hxx>
30 #include <osl/diagnose.h>
31 #include <svtools/unoimap.hxx>
32 #include <vcl/imap.hxx>
33 #include <vcl/imapobj.hxx>
34 #include <unotools/intlwrapper.hxx>
35 #include <unotools/syslocale.hxx>
36 #include <frmfmt.hxx>
37 #include <unocoll.hxx>
38 #include <unosett.hxx>
39 #include <fmtclds.hxx>
40 #include <fmtornt.hxx>
41 #include <fmthdft.hxx>
42 #include <fmtpdsc.hxx>
43 #include <fmtcntnt.hxx>
44 #include <fmtfsize.hxx>
45 #include <fmtfordr.hxx>
46 #include <fmtsrnd.hxx>
47 #include <fmtlsplt.hxx>
48 #include <fmtrowsplt.hxx>
49 #include <fmtftntx.hxx>
50 #include <fmteiro.hxx>
51 #include <fmturl.hxx>
52 #include <fmtcnct.hxx>
53 #include <section.hxx>
54 #include <fmtline.hxx>
55 #include <tgrditem.hxx>
56 #include <hfspacingitem.hxx>
58 #include <IDocumentUndoRedo.hxx>
61 #include <pagefrm.hxx>
62 #include <rootfrm.hxx>
63 #include <cntfrm.hxx>
64 #include <notxtfrm.hxx>
65 #include <txtfrm.hxx>
66 #include <crsrsh.hxx>
67 #include <dflyobj.hxx>
68 #include <dcontact.hxx>
69 #include <frmtool.hxx>
70 #include <flyfrms.hxx>
71 #include <pagedesc.hxx>
72 #include <grfatr.hxx>
73 #include <ndnotxt.hxx>
74 #include <node2lay.hxx>
75 #include <fmtclbl.hxx>
76 #include <swunohelper.hxx>
77 #include <unoframe.hxx>
78 #include <SwStyleNameMapper.hxx>
79 #include <editeng/brushitem.hxx>
80 #include <vcl/GraphicObject.hxx>
81 #include <unomid.h>
82 #include <strings.hrc>
83 #include <svx/svdundo.hxx>
84 #include <svx/SvxXTextColumns.hxx>
85 #include <sortedobjs.hxx>
86 #include <HandleAnchorNodeChg.hxx>
87 #include <calbck.hxx>
88 #include <pagedeschint.hxx>
89 #include <drawdoc.hxx>
90 #include <hints.hxx>
91 #include <frameformats.hxx>
92 #include <unoprnms.hxx>
93 
94 #include <ndtxt.hxx>
95 
97 #include <svl/itemiter.hxx>
98 #include <wrtsh.hxx>
99 #include <txtfld.hxx>
100 #include <cellatr.hxx>
101 
102 using namespace ::com::sun::star;
103 
104 namespace sw {
105 
106 bool GetAtPageRelOrientation(sal_Int16 & rOrientation, bool const isIgnorePrintArea)
107 {
108  switch (rOrientation)
109  {
110  case text::RelOrientation::CHAR:
111  case text::RelOrientation::FRAME:
112  rOrientation = text::RelOrientation::PAGE_FRAME;
113  return true;
114  case text::RelOrientation::PRINT_AREA:
115  if (isIgnorePrintArea)
116  {
117  return false;
118  }
119  else
120  {
121  rOrientation = text::RelOrientation::PAGE_PRINT_AREA;
122  return true;
123  }
124  case text::RelOrientation::FRAME_LEFT:
125  rOrientation = text::RelOrientation::PAGE_LEFT;
126  return true;
127  case text::RelOrientation::FRAME_RIGHT:
128  rOrientation = text::RelOrientation::PAGE_RIGHT;
129  return true;
130  default:
131  return false;
132  }
133 }
134 
135 } // namespace sw
136 
138 
139 static sal_Int16 lcl_IntToRelation(const uno::Any& rVal)
140 {
141  sal_Int16 nVal = text::RelOrientation::FRAME;
142  if (!(rVal >>= nVal))
143  SAL_WARN("sw.core", "lcl_IntToRelation: read from Any failed!");
144  return nVal;
145 }
146 
147 static void lcl_DelHFFormat( SwClient *pToRemove, SwFrameFormat *pFormat )
148 {
149  //If the client is the last one who uses this format, then we have to delete
150  //it - before this is done, we may need to delete the content-section.
151  SwDoc* pDoc = pFormat->GetDoc();
152  pFormat->Remove( pToRemove );
153  if( pDoc->IsInDtor() )
154  {
155  delete pFormat;
156  return;
157  }
158 
159  // Anything other than frames registered?
160  bool bDel = true;
161  {
162  // nested scope because DTOR of SwClientIter resets the flag bTreeChg.
163  // It's suboptimal if the format is deleted beforehand.
164  SwIterator<SwClient,SwFrameFormat> aIter(*pFormat);
165  for(SwClient* pLast = aIter.First(); bDel && pLast; pLast = aIter.Next())
166  if (dynamic_cast<const SwFrame*>(pLast) == nullptr)
167  bDel = false;
168  }
169 
170  if ( !bDel )
171  return;
172 
173  // If there is a Cursor registered in one of the nodes, we need to call the
174  // ParkCursor in an (arbitrary) shell.
175  SwFormatContent& rCnt = const_cast<SwFormatContent&>(pFormat->GetContent());
176  if ( rCnt.GetContentIdx() )
177  {
178  SwNode *pNode = nullptr;
179  {
180  // #i92993#
181  // Begin with start node of page header/footer to assure that
182  // complete content is checked for cursors and the complete content
183  // is deleted on below made method call <pDoc->getIDocumentContentOperations().DeleteSection(pNode)>
184  SwNodeIndex aIdx( *rCnt.GetContentIdx(), 0 );
185  // If there is a Cursor registered in one of the nodes, we need to call the
186  // ParkCursor in an (arbitrary) shell.
187  pNode = & aIdx.GetNode();
188  sal_uInt32 nEnd = pNode->EndOfSectionIndex();
189  while ( aIdx < nEnd )
190  {
191  if ( pNode->IsContentNode() &&
192  static_cast<SwContentNode*>(pNode)->HasWriterListeners() )
193  {
194  SwCursorShell *pShell = SwIterator<SwCursorShell,SwContentNode>( *static_cast<SwContentNode*>(pNode) ).First();
195  if( pShell )
196  {
197  pShell->ParkCursor( aIdx );
198  aIdx = nEnd-1;
199  }
200  }
201  ++aIdx;
202  pNode = & aIdx.GetNode();
203  }
204  }
205  rCnt.SetNewContentIdx( nullptr );
206 
207  // When deleting a header/footer-format, we ALWAYS need to disable
208  // the undo function (Bug 31069)
209  ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
210 
211  OSL_ENSURE( pNode, "A big problem." );
213  }
214  delete pFormat;
215 }
216 
218  // Don't inherit the SvxSizeItem override (might or might not be relevant; added "just in case"
219  // when changing SwFormatFrameSize to derive from SvxSizeItem instead of directly from
220  // SfxPoolItem):
221  return SfxPoolItem::ScaleMetrics(lMult, lDiv);
222 }
223 
225  // Don't inherit the SvxSizeItem override (might or might not be relevant; added "just in case"
226  // when changing SwFormatFrameSize to derive from SvxSizeItem instead of directly from
227  // SfxPoolItem):
228  return SfxPoolItem::HasMetrics();
229 }
230 
231 // Partially implemented inline in hxx
233  : SvxSizeItem( RES_FRM_SIZE, {nWidth, nHeight} ),
234  m_eFrameHeightType( eSize ),
235  m_eFrameWidthType( SwFrameSize::Fixed )
236 {
237  m_nWidthPercent = m_eWidthPercentRelation = m_nHeightPercent = m_eHeightPercentRelation = 0;
238 }
239 
240 bool SwFormatFrameSize::operator==( const SfxPoolItem& rAttr ) const
241 {
242  assert(SfxPoolItem::operator==(rAttr));
243  return( m_eFrameHeightType == static_cast<const SwFormatFrameSize&>(rAttr).m_eFrameHeightType &&
244  m_eFrameWidthType == static_cast<const SwFormatFrameSize&>(rAttr).m_eFrameWidthType &&
245  SvxSizeItem::operator==(rAttr)&&
246  m_nWidthPercent == static_cast<const SwFormatFrameSize&>(rAttr).GetWidthPercent() &&
247  m_eWidthPercentRelation == static_cast<const SwFormatFrameSize&>(rAttr).GetWidthPercentRelation() &&
248  m_nHeightPercent == static_cast<const SwFormatFrameSize&>(rAttr).GetHeightPercent() &&
249  m_eHeightPercentRelation == static_cast<const SwFormatFrameSize&>(rAttr).GetHeightPercentRelation() );
250 }
251 
253 {
254  return new SwFormatFrameSize( *this );
255 }
256 
257 bool SwFormatFrameSize::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
258 {
259  // here we convert always!
260  nMemberId &= ~CONVERT_TWIPS;
261  switch ( nMemberId )
262  {
263  case MID_FRMSIZE_SIZE:
264  {
265  awt::Size aTmp;
266  aTmp.Height = convertTwipToMm100(GetHeight());
267  aTmp.Width = convertTwipToMm100(GetWidth());
268  rVal <<= aTmp;
269  }
270  break;
272  rVal <<= static_cast<sal_Int16>(GetHeightPercent() != SwFormatFrameSize::SYNCED ? GetHeightPercent() : 0);
273  break;
275  rVal <<= GetHeightPercentRelation();
276  break;
278  rVal <<= static_cast<sal_Int16>(GetWidthPercent() != SwFormatFrameSize::SYNCED ? GetWidthPercent() : 0);
279  break;
281  rVal <<= GetWidthPercentRelation();
282  break;
285  break;
288  break;
289  case MID_FRMSIZE_WIDTH :
290  rVal <<= static_cast<sal_Int32>(convertTwipToMm100(GetWidth()));
291  break;
292  case MID_FRMSIZE_HEIGHT:
293  // #95848# returned size should never be zero.
294  // (there was a bug that allowed for setting height to 0.
295  // Thus there some documents existing with that not allowed
296  // attribute value which may cause problems on import.)
297  rVal <<= static_cast<sal_Int32>(convertTwipToMm100(GetHeight() < MINLAY ? MINLAY : GetHeight() ));
298  break;
300  rVal <<= static_cast<sal_Int16>(GetHeightSizeType());
301  break;
304  break;
306  rVal <<= static_cast<sal_Int16>(GetWidthSizeType());
307  break;
308  }
309  return true;
310 }
311 
312 bool SwFormatFrameSize::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
313 {
314  bool bConvert = 0 != (nMemberId&CONVERT_TWIPS);
315  nMemberId &= ~CONVERT_TWIPS;
316  bool bRet = true;
317  switch ( nMemberId )
318  {
319  case MID_FRMSIZE_SIZE:
320  {
321  awt::Size aVal;
322  if(!(rVal >>= aVal))
323  bRet = false;
324  else
325  {
326  Size aTmp(aVal.Width, aVal.Height);
327  if(bConvert)
328  {
329  aTmp.setHeight( convertMm100ToTwip(aTmp.Height()) );
330  aTmp.setWidth( convertMm100ToTwip(aTmp.Width()) );
331  }
332  SetSize(aTmp);
333  }
334  }
335  break;
337  {
338  sal_Int16 nSet = 0;
339  rVal >>= nSet;
340  if(nSet >= 0 && nSet < SwFormatFrameSize::SYNCED)
341  SetHeightPercent(static_cast<sal_uInt8>(nSet));
342  else
343  bRet = false;
344  }
345  break;
347  {
348  sal_Int16 eSet = 0;
349  rVal >>= eSet;
351  }
352  break;
354  {
355  sal_Int16 nSet = 0;
356  rVal >>= nSet;
357  if(nSet >= 0 && nSet < SwFormatFrameSize::SYNCED)
358  SetWidthPercent(static_cast<sal_uInt8>(nSet));
359  else
360  bRet = false;
361  }
362  break;
364  {
365  sal_Int16 eSet = 0;
366  rVal >>= eSet;
368  }
369  break;
371  {
372  bool bSet = *o3tl::doAccess<bool>(rVal);
373  if(bSet)
376  SetHeightPercent( 0 );
377  }
378  break;
380  {
381  bool bSet = *o3tl::doAccess<bool>(rVal);
382  if(bSet)
385  SetWidthPercent(0);
386  }
387  break;
388  case MID_FRMSIZE_WIDTH :
389  {
390  sal_Int32 nWd = 0;
391  if(rVal >>= nWd)
392  {
393  if(bConvert)
394  nWd = convertMm100ToTwip(nWd);
395  if(nWd < MINLAY)
396  nWd = MINLAY;
397  SetWidth(nWd);
398  }
399  else
400  bRet = false;
401  }
402  break;
403  case MID_FRMSIZE_HEIGHT:
404  {
405  sal_Int32 nHg = 0;
406  if(rVal >>= nHg)
407  {
408  if(bConvert)
409  nHg = convertMm100ToTwip(nHg);
410  if(nHg < MINLAY)
411  nHg = MINLAY;
412  SetHeight(nHg);
413  }
414  else
415  bRet = false;
416  }
417  break;
419  {
420  sal_Int16 nType = 0;
421  if((rVal >>= nType) && nType >= 0 && nType <= static_cast<int>(SwFrameSize::Minimum) )
422  {
423  SetHeightSizeType(static_cast<SwFrameSize>(nType));
424  }
425  else
426  bRet = false;
427  }
428  break;
430  {
431  bool bSet = *o3tl::doAccess<bool>(rVal);
433  }
434  break;
436  {
437  sal_Int16 nType = 0;
438  if((rVal >>= nType) && nType >= 0 && nType <= static_cast<int>(SwFrameSize::Minimum) )
439  {
440  SetWidthSizeType(static_cast<SwFrameSize>(nType));
441  }
442  else
443  bRet = false;
444  }
445  break;
446  default:
447  bRet = false;
448  }
449  return bRet;
450 }
451 
453 {
454  (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwFormatFrameSize"));
455  (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr()));
456 
457  std::stringstream aSize;
458  aSize << GetSize();
459  (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("size"), BAD_CAST(aSize.str().c_str()));
460 
461  (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("eFrameHeightType"), BAD_CAST(OString::number(static_cast<int>(m_eFrameHeightType)).getStr()));
462  (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("eFrameWidthType"), BAD_CAST(OString::number(static_cast<int>(m_eFrameWidthType)).getStr()));
463  (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nWidthPercent"), BAD_CAST(OString::number(m_nWidthPercent).getStr()));
464  (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("eWidthPercentRelation"), BAD_CAST(OString::number(m_eWidthPercentRelation).getStr()));
465  (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nHeightPercent"), BAD_CAST(OString::number(m_nHeightPercent).getStr()));
466  (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("eHeightPercentRelation"), BAD_CAST(OString::number(m_eHeightPercentRelation).getStr()));
467 
468  (void)xmlTextWriterEndElement(pWriter);
469 }
470 
471 // Partially implemented inline in hxx
473  : SfxEnumItem( RES_FILL_ORDER, nFO )
474 {}
475 
477 {
478  return new SwFormatFillOrder( GetValue() );
479 }
480 
482 {
484 }
485 
486 // Partially implemented inline in hxx
488  : SfxPoolItem( RES_HEADER ),
489  SwClient( pHeaderFormat ),
490  m_bActive( pHeaderFormat )
491 {
492 }
493 
495  : SfxPoolItem( RES_HEADER ),
496  SwClient( const_cast<sw::BroadcastingModify*>(static_cast<const sw::BroadcastingModify*>(rCpy.GetRegisteredIn())) ),
497  m_bActive( rCpy.IsActive() )
498 {
499 }
500 
502  : SfxPoolItem( RES_HEADER ),
503  SwClient( nullptr ),
504  m_bActive( bOn )
505 {
506 }
507 
509 {
510  if ( GetHeaderFormat() )
511  lcl_DelHFFormat( this, GetHeaderFormat() );
512 }
513 
514 bool SwFormatHeader::operator==( const SfxPoolItem& rAttr ) const
515 {
516  assert(SfxPoolItem::operator==(rAttr));
517  return ( GetRegisteredIn() == static_cast<const SwFormatHeader&>(rAttr).GetRegisteredIn() &&
518  m_bActive == static_cast<const SwFormatHeader&>(rAttr).IsActive() );
519 }
520 
522 {
523  return new SwFormatHeader( *this );
524 }
525 
527 {
528  rFormat.Add(this);
529 }
530 
531 // Partially implemented inline in hxx
533  : SfxPoolItem( RES_FOOTER ),
534  SwClient( pFooterFormat ),
535  m_bActive( pFooterFormat )
536 {
537 }
538 
540  : SfxPoolItem( RES_FOOTER ),
541  SwClient( const_cast<sw::BroadcastingModify*>(static_cast<const sw::BroadcastingModify*>(rCpy.GetRegisteredIn())) ),
542  m_bActive( rCpy.IsActive() )
543 {
544 }
545 
547  : SfxPoolItem( RES_FOOTER ),
548  SwClient( nullptr ),
549  m_bActive( bOn )
550 {
551 }
552 
554 {
555  if ( GetFooterFormat() )
556  lcl_DelHFFormat( this, GetFooterFormat() );
557 }
558 
560 {
561  rFormat.Add(this);
562 }
563 
564 bool SwFormatFooter::operator==( const SfxPoolItem& rAttr ) const
565 {
566  assert(SfxPoolItem::operator==(rAttr));
567  return ( GetRegisteredIn() == static_cast<const SwFormatFooter&>(rAttr).GetRegisteredIn() &&
568  m_bActive == static_cast<const SwFormatFooter&>(rAttr).IsActive() );
569 }
570 
572 {
573  return new SwFormatFooter( *this );
574 }
575 
576 // Partially implemented inline in hxx
579 {
580  m_pStartNode.reset( rCpy.GetContentIdx() ?
581  new SwNodeIndex( *rCpy.GetContentIdx() ) : nullptr);
582 }
583 
586 {
587  m_pStartNode.reset( pStartNd ? new SwNodeIndex( *pStartNd ) : nullptr);
588 }
589 
591 {
592 }
593 
595 {
596  m_pStartNode.reset( pIdx ? new SwNodeIndex( *pIdx ) : nullptr );
597 }
598 
599 bool SwFormatContent::operator==( const SfxPoolItem& rAttr ) const
600 {
601  assert(SfxPoolItem::operator==(rAttr));
602  if( static_cast<bool>(m_pStartNode) != static_cast<bool>(static_cast<const SwFormatContent&>(rAttr).m_pStartNode) )
603  return false;
604  if( m_pStartNode )
605  return ( *m_pStartNode == *static_cast<const SwFormatContent&>(rAttr).GetContentIdx() );
606  return true;
607 }
608 
610 {
611  return new SwFormatContent( *this );
612 }
613 
615 {
616  (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwFormatContent"));
617  (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr()));
618  if (m_pStartNode)
619  {
620  (void)xmlTextWriterWriteAttribute(
621  pWriter, BAD_CAST("startNode"),
622  BAD_CAST(OString::number(m_pStartNode->GetNode().GetIndex()).getStr()));
623  (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("startNodePtr"), "%p",
624  &m_pStartNode->GetNode());
625  }
626  (void)xmlTextWriterEndElement(pWriter);
627 }
628 
629 // Partially implemented inline in hxx
632  SwClient( const_cast<SwPageDesc*>(rCpy.GetPageDesc()) ),
633  m_oNumOffset( rCpy.m_oNumOffset ),
634  m_pDefinedIn( nullptr )
635 {
636 }
637 
640  SwClient( const_cast<SwPageDesc*>(pDesc) ),
641  m_pDefinedIn( nullptr )
642 {
643 }
644 
646 {
647  if(this == &rCpy)
648  return *this;
649 
650  if (rCpy.GetPageDesc())
651  RegisterToPageDesc(*const_cast<SwPageDesc*>(rCpy.GetPageDesc()));
652  m_oNumOffset = rCpy.m_oNumOffset;
653  m_pDefinedIn = nullptr;
654 
655  return *this;
656 }
657 
659 
661 {
662  return (GetRegisteredIn() != nullptr);
663 }
664 
665 bool SwFormatPageDesc::operator==( const SfxPoolItem& rAttr ) const
666 {
667  assert(SfxPoolItem::operator==(rAttr));
668  return ( m_pDefinedIn == static_cast<const SwFormatPageDesc&>(rAttr).m_pDefinedIn ) &&
669  ( m_oNumOffset == static_cast<const SwFormatPageDesc&>(rAttr).m_oNumOffset ) &&
670  ( GetPageDesc() == static_cast<const SwFormatPageDesc&>(rAttr).GetPageDesc() );
671 }
672 
674 {
675  return new SwFormatPageDesc( *this );
676 }
677 
679 {
680  if (const SwPageDescHint* pHint = dynamic_cast<const SwPageDescHint*>(&rHint))
681  {
682  // mba: shouldn't that be broadcasted also?
683  SwFormatPageDesc aDfltDesc(pHint->GetPageDesc());
684  SwPageDesc* pDesc = pHint->GetPageDesc();
685  const sw::BroadcastingModify* pMod = GetDefinedIn();
686  if(pMod)
687  {
688  if(auto pContentNode = dynamic_cast<const SwContentNode*>(pMod))
689  const_cast<SwContentNode*>(pContentNode)->SetAttr(aDfltDesc);
690  else if(auto pFormat = dynamic_cast<const SwFormat*>(pMod))
691  const_cast<SwFormat*>(pFormat)->SetFormatAttr( aDfltDesc );
692  else
693  {
694  SAL_WARN("sw.core", "SwFormatPageDesc registered at " << typeid(pMod).name() << ".");
695  RegisterToPageDesc(*pDesc);
696  }
697  }
698  else
699  // there could be an Undo-copy
700  RegisterToPageDesc(*pDesc);
701  }
702  else if (rHint.GetId() == SfxHintId::SwLegacyModify)
703  {
704  auto pLegacy = static_cast<const sw::LegacyModifyHint*>(&rHint);
705  if(RES_OBJECTDYING == pLegacy->GetWhich())
706  {
707  m_pDefinedIn = nullptr;
708  EndListeningAll();
709  }
710  }
711 }
712 
714 {
715  rDesc.Add( this );
716 }
717 
718 bool SwFormatPageDesc::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
719 {
720  // here we convert always!
721  nMemberId &= ~CONVERT_TWIPS;
722  bool bRet = true;
723  switch ( nMemberId )
724  {
726  {
727  ::std::optional<sal_uInt16> oOffset = GetNumOffset();
728  if (oOffset)
729  {
730  rVal <<= static_cast<sal_Int16>(*oOffset);
731  }
732  else
733  {
734  rVal.clear();
735  }
736  }
737  break;
738 
740  {
741  const SwPageDesc* pDesc = GetPageDesc();
742  if( pDesc )
743  {
744  OUString aString;
746  rVal <<= aString;
747  }
748  else
749  rVal.clear();
750  }
751  break;
752  default:
753  OSL_ENSURE( false, "unknown MemberId" );
754  bRet = false;
755  }
756  return bRet;
757 }
758 
759 bool SwFormatPageDesc::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
760 {
761  // here we convert always!
762  nMemberId &= ~CONVERT_TWIPS;
763  bool bRet = true;
764  switch ( nMemberId )
765  {
767  {
768  sal_Int16 nOffset = 0;
769  if (!rVal.hasValue())
770  {
771  SetNumOffset(std::nullopt);
772  }
773  else if (rVal >>= nOffset)
774  SetNumOffset( nOffset );
775  else
776  bRet = false;
777  }
778  break;
779 
781  /* Doesn't work, because the attribute doesn't need the name but a
782  * pointer to the PageDesc (it's a client of it). The pointer can
783  * only be requested from the document using the name.
784  */
785  default:
786  OSL_ENSURE( false, "unknown MemberId" );
787  bRet = false;
788  }
789  return bRet;
790 }
791 
793 {
794  (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwFormatPageDesc"));
795  (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr()));
796  if (m_oNumOffset)
797  (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("oNumOffset"), BAD_CAST(OString::number(*m_oNumOffset).getStr()));
798  else
799  (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("oNumOffset"), BAD_CAST("none"));
800  (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("pPageDesc"), "%p", GetPageDesc());
801  if (const SwPageDesc* pPageDesc = GetPageDesc())
802  (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("presentation"), BAD_CAST(pPageDesc->GetName().toUtf8().getStr()));
803  (void)xmlTextWriterEndElement(pWriter);
804 }
805 
806 // class SwFormatCol
807 // Partially implemented inline in hxx
808 
810  m_nWish ( 0 ),
811  m_nLeft ( 0 ),
812  m_nRight( 0 )
813 {
814 }
815 
816 bool SwColumn::operator==( const SwColumn &rCmp ) const
817 {
818  return m_nWish == rCmp.GetWishWidth() &&
819  GetLeft() == rCmp.GetLeft() &&
820  GetRight() == rCmp.GetRight();
821 }
822 
824 {
825  (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwColumn"));
826  (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nWish"), BAD_CAST(OString::number(m_nWish).getStr()));
827  (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nUpper"), BAD_CAST(OString::number(0).getStr()));
828  (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nLower"), BAD_CAST(OString::number(0).getStr()));
829  (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nLeft"), BAD_CAST(OString::number(m_nLeft).getStr()));
830  (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nRight"), BAD_CAST(OString::number(m_nRight).getStr()));
831  (void)xmlTextWriterEndElement(pWriter);
832 }
833 
835  : SfxPoolItem( RES_COL ),
836  m_eLineStyle( rCpy.m_eLineStyle ),
837  m_nLineWidth( rCpy.m_nLineWidth),
838  m_aLineColor( rCpy.m_aLineColor),
839  m_nLineHeight( rCpy.GetLineHeight() ),
840  m_eAdj( rCpy.GetLineAdj() ),
841  m_nWidth( rCpy.GetWishWidth() ),
842  m_aWidthAdjustValue( rCpy.m_aWidthAdjustValue ),
843  m_bOrtho( rCpy.IsOrtho() )
844 {
845  m_aColumns.reserve(rCpy.GetNumCols());
846  for ( sal_uInt16 i = 0; i < rCpy.GetNumCols(); ++i )
847  {
848  m_aColumns.emplace_back(rCpy.GetColumns()[i] );
849  }
850 }
851 
853 
855 {
856  if (this != &rCpy)
857  {
858  m_eLineStyle = rCpy.m_eLineStyle;
859  m_nLineWidth = rCpy.m_nLineWidth;
860  m_aLineColor = rCpy.m_aLineColor;
861  m_nLineHeight = rCpy.GetLineHeight();
862  m_eAdj = rCpy.GetLineAdj();
863  m_nWidth = rCpy.GetWishWidth();
865  m_bOrtho = rCpy.IsOrtho();
866 
867  m_aColumns.clear();
868  for ( sal_uInt16 i = 0; i < rCpy.GetNumCols(); ++i )
869  {
870  m_aColumns.emplace_back(rCpy.GetColumns()[i] );
871  }
872  }
873  return *this;
874 }
875 
877  : SfxPoolItem( RES_COL )
878  , m_eLineStyle( SvxBorderLineStyle::NONE)
879  ,
880  m_nLineWidth(0),
881  m_nLineHeight( 100 ),
882  m_eAdj( COLADJ_NONE ),
883  m_nWidth( USHRT_MAX ),
884  m_aWidthAdjustValue( 0 ),
885  m_bOrtho( true )
886 {
887 }
888 
889 bool SwFormatCol::operator==( const SfxPoolItem& rAttr ) const
890 {
891  assert(SfxPoolItem::operator==(rAttr));
892  const SwFormatCol &rCmp = static_cast<const SwFormatCol&>(rAttr);
893  if( !(m_eLineStyle == rCmp.m_eLineStyle &&
894  m_nLineWidth == rCmp.m_nLineWidth &&
895  m_aLineColor == rCmp.m_aLineColor &&
896  m_nLineHeight == rCmp.GetLineHeight() &&
897  m_eAdj == rCmp.GetLineAdj() &&
898  m_nWidth == rCmp.GetWishWidth() &&
899  m_bOrtho == rCmp.IsOrtho() &&
900  m_aColumns.size() == rCmp.GetNumCols() &&
902  ) )
903  return false;
904 
905  for ( size_t i = 0; i < m_aColumns.size(); ++i )
906  if ( !(m_aColumns[i] == rCmp.GetColumns()[i]) )
907  return false;
908 
909  return true;
910 }
911 
913 {
914  return new SwFormatCol( *this );
915 }
916 
917 sal_uInt16 SwFormatCol::GetGutterWidth( bool bMin ) const
918 {
919  sal_uInt16 nRet = 0;
920  if ( m_aColumns.size() == 2 )
921  nRet = m_aColumns[0].GetRight() + m_aColumns[1].GetLeft();
922  else if ( m_aColumns.size() > 2 )
923  {
924  bool bSet = false;
925  for ( size_t i = 1; i+1 < m_aColumns.size(); ++i )
926  {
927  const sal_uInt16 nTmp = m_aColumns[i].GetRight() + m_aColumns[i+1].GetLeft();
928  if ( bSet )
929  {
930  if ( nTmp != nRet )
931  {
932  if ( !bMin )
933  return USHRT_MAX;
934  if ( nRet > nTmp )
935  nRet = nTmp;
936  }
937  }
938  else
939  {
940  bSet = true;
941  nRet = nTmp;
942  }
943  }
944  }
945  return nRet;
946 }
947 
948 void SwFormatCol::SetGutterWidth( sal_uInt16 nNew, sal_uInt16 nAct )
949 {
950  if ( m_bOrtho )
951  Calc( nNew, nAct );
952  else
953  {
954  sal_uInt16 nHalf = nNew / 2;
955  for (size_t i = 0; i < m_aColumns.size(); ++i)
956  {
957  SwColumn &rCol = m_aColumns[i];
958  rCol.SetLeft(nHalf);
959  rCol.SetRight(nHalf);
960  if ( i == 0 )
961  rCol.SetLeft(0);
962  else if ( i+1 == m_aColumns.size() )
963  rCol.SetRight(0);
964  }
965  }
966 }
967 
968 void SwFormatCol::Init( sal_uInt16 nNumCols, sal_uInt16 nGutterWidth, sal_uInt16 nAct )
969 {
970  // Deleting seems to be a bit radical on the first sight; but otherwise we
971  // have to initialize all values of the remaining SwColumns.
972  m_aColumns.clear();
973  for ( sal_uInt16 i = 0; i < nNumCols; ++i )
974  {
975  m_aColumns.emplace_back( );
976  }
977  m_bOrtho = true;
978  m_nWidth = USHRT_MAX;
979  if( nNumCols )
980  Calc( nGutterWidth, nAct );
981 }
982 
983 void SwFormatCol::SetOrtho( bool bNew, sal_uInt16 nGutterWidth, sal_uInt16 nAct )
984 {
985  m_bOrtho = bNew;
986  if ( bNew && !m_aColumns.empty() )
987  Calc( nGutterWidth, nAct );
988 }
989 
990 sal_uInt16 SwFormatCol::CalcColWidth( sal_uInt16 nCol, sal_uInt16 nAct ) const
991 {
992  assert(nCol < m_aColumns.size());
993  if ( m_nWidth != nAct )
994  {
995  tools::Long nW = m_aColumns[nCol].GetWishWidth();
996  nW *= nAct;
997  nW /= m_nWidth;
998  return sal_uInt16(nW);
999  }
1000  else
1001  return m_aColumns[nCol].GetWishWidth();
1002 }
1003 
1004 sal_uInt16 SwFormatCol::CalcPrtColWidth( sal_uInt16 nCol, sal_uInt16 nAct ) const
1005 {
1006  assert(nCol < m_aColumns.size());
1007  sal_uInt16 nRet = CalcColWidth( nCol, nAct );
1008  const SwColumn *pCol = &m_aColumns[nCol];
1009  nRet = nRet - pCol->GetLeft();
1010  nRet = nRet - pCol->GetRight();
1011  return nRet;
1012 }
1013 
1014 void SwFormatCol::Calc( sal_uInt16 nGutterWidth, sal_uInt16 nAct )
1015 {
1016  if (!GetNumCols())
1017  return;
1018 
1019  //First set the column widths with the current width, then calculate the
1020  //column's requested width using the requested total width.
1021  const sal_uInt16 nGutterHalf = nGutterWidth ? nGutterWidth / 2 : 0;
1022 
1023  //Width of PrtAreas is totalwidth - spacings / count
1024  sal_uInt16 nSpacings;
1025  bool bFail = o3tl::checked_multiply<sal_uInt16>(GetNumCols() - 1, nGutterWidth, nSpacings);
1026  if (bFail)
1027  {
1028  SAL_WARN("sw.core", "SwFormatVertOrient::Calc: overflow");
1029  return;
1030  }
1031 
1032  const sal_uInt16 nPrtWidth = (nAct - nSpacings) / GetNumCols();
1033  sal_uInt16 nAvail = nAct;
1034 
1035  //The first column is PrtWidth + (gap width / 2)
1036  const sal_uInt16 nLeftWidth = nPrtWidth + nGutterHalf;
1037  SwColumn &rFirstCol = m_aColumns.front();
1038  rFirstCol.SetWishWidth(nLeftWidth);
1039  rFirstCol.SetRight(nGutterHalf);
1040  rFirstCol.SetLeft(0);
1041  nAvail = nAvail - nLeftWidth;
1042 
1043  //Column 2 to n-1 is PrtWidth + gap width
1044  const sal_uInt16 nMidWidth = nPrtWidth + nGutterWidth;
1045 
1046  for (sal_uInt16 i = 1; i < GetNumCols()-1; ++i)
1047  {
1048  SwColumn &rCol = m_aColumns[i];
1049  rCol.SetWishWidth(nMidWidth);
1050  rCol.SetLeft(nGutterHalf);
1051  rCol.SetRight(nGutterHalf);
1052  nAvail = nAvail - nMidWidth;
1053  }
1054 
1055  //The last column is equivalent to the first one - to compensate rounding
1056  //errors we add the remaining space of the other columns to the last one.
1057  SwColumn &rLastCol = m_aColumns.back();
1058  rLastCol.SetWishWidth(nAvail);
1059  rLastCol.SetLeft(nGutterHalf);
1060  rLastCol.SetRight(0);
1061 
1062  //Convert the current width to the requested width.
1063  for (SwColumn &rCol: m_aColumns)
1064  {
1065  tools::Long nTmp = rCol.GetWishWidth();
1066  nTmp *= GetWishWidth();
1067  nTmp /= nAct;
1068  rCol.SetWishWidth(sal_uInt16(nTmp));
1069  }
1070 }
1071 
1072 bool SwFormatCol::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
1073 {
1074  // here we convert always!
1075  nMemberId &= ~CONVERT_TWIPS;
1076  if(MID_COLUMN_SEPARATOR_LINE == nMemberId)
1077  {
1078  OSL_FAIL("not implemented");
1079  }
1080  else
1081  {
1082  uno::Reference<text::XTextColumns> xCols(SvxXTextColumns_createInstance(),
1083  css::uno::UNO_QUERY_THROW);
1084  uno::Reference<beans::XPropertySet> xProps(xCols, css::uno::UNO_QUERY_THROW);
1085 
1086  if (GetNumCols() > 0)
1087  {
1088  xCols->setColumnCount(GetNumCols());
1089  const sal_uInt16 nItemGutterWidth = GetGutterWidth();
1090  sal_Int32 nAutoDistance = IsOrtho() ? USHRT_MAX == nItemGutterWidth
1092  : static_cast<sal_Int32>(nItemGutterWidth)
1093  : 0;
1094  nAutoDistance = convertTwipToMm100(nAutoDistance);
1095  xProps->setPropertyValue(UNO_NAME_AUTOMATIC_DISTANCE, uno::Any(nAutoDistance));
1096 
1097  if (!IsOrtho())
1098  {
1099  auto aTextColumns = xCols->getColumns();
1100  text::TextColumn* pColumns = aTextColumns.getArray();
1101  const SwColumns& rCols = GetColumns();
1102  for (sal_Int32 i = 0; i < aTextColumns.getLength(); ++i)
1103  {
1104  const SwColumn* pCol = &rCols[i];
1105 
1106  pColumns[i].Width = pCol->GetWishWidth();
1107  pColumns[i].LeftMargin = convertTwipToMm100(pCol->GetLeft());
1108  pColumns[i].RightMargin = convertTwipToMm100(pCol->GetRight());
1109  }
1110  xCols->setColumns(aTextColumns); // sets "IsAutomatic" property to false
1111  }
1112  }
1113  uno::Any aVal;
1114  aVal <<= o3tl::narrowing<sal_Int32>(GetLineWidth());
1115  xProps->setPropertyValue(UNO_NAME_SEPARATOR_LINE_WIDTH, aVal);
1116  aVal <<= GetLineColor();
1117  xProps->setPropertyValue(UNO_NAME_SEPARATOR_LINE_COLOR, aVal);
1118  aVal <<= static_cast<sal_Int32>(GetLineHeight());
1119  xProps->setPropertyValue(UNO_NAME_SEPARATOR_LINE_RELATIVE_HEIGHT, aVal);
1120  aVal <<= GetLineAdj() != COLADJ_NONE;
1121  xProps->setPropertyValue(UNO_NAME_SEPARATOR_LINE_IS_ON, aVal);
1122  sal_Int16 nStyle;
1123  switch (GetLineStyle())
1124  {
1125  case SvxBorderLineStyle::SOLID:
1126  nStyle = css::text::ColumnSeparatorStyle::SOLID;
1127  break;
1128  case SvxBorderLineStyle::DOTTED:
1129  nStyle = css::text::ColumnSeparatorStyle::DOTTED;
1130  break;
1131  case SvxBorderLineStyle::DASHED:
1132  nStyle = css::text::ColumnSeparatorStyle::DASHED;
1133  break;
1134  case SvxBorderLineStyle::NONE:
1135  default:
1137  break;
1138  }
1139  aVal <<= nStyle;
1140  xProps->setPropertyValue(UNO_NAME_SEPARATOR_LINE_STYLE, aVal);
1141  style::VerticalAlignment eAlignment;
1142  switch (GetLineAdj())
1143  {
1144  case COLADJ_TOP:
1145  eAlignment = style::VerticalAlignment_TOP;
1146  break;
1147  case COLADJ_BOTTOM:
1148  eAlignment = style::VerticalAlignment_BOTTOM;
1149  break;
1150  case COLADJ_CENTER:
1151  case COLADJ_NONE:
1152  default:
1153  eAlignment = style::VerticalAlignment_MIDDLE;
1154  }
1155  aVal <<= eAlignment;
1156  xProps->setPropertyValue(UNO_NAME_SEPARATOR_LINE_VERTIVAL_ALIGNMENT, aVal);
1157  rVal <<= xCols;
1158  }
1159  return true;
1160 }
1161 
1162 bool SwFormatCol::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
1163 {
1164  // here we convert always!
1165  nMemberId &= ~CONVERT_TWIPS;
1166  bool bRet = false;
1167  if(MID_COLUMN_SEPARATOR_LINE == nMemberId)
1168  {
1169  OSL_FAIL("not implemented");
1170  }
1171  else
1172  {
1173  uno::Reference< text::XTextColumns > xCols;
1174  rVal >>= xCols;
1175  if(xCols.is())
1176  {
1177  uno::Sequence<text::TextColumn> aSetColumns = xCols->getColumns();
1178  const text::TextColumn* pArray = aSetColumns.getConstArray();
1179  m_aColumns.clear();
1180  //max count is 64k here - this is something the array can't do
1181  sal_uInt16 nCount = std::min( o3tl::narrowing<sal_uInt16>(aSetColumns.getLength()),
1182  sal_uInt16(0x3fff) );
1183  sal_uInt16 nWidthSum = 0;
1184  // #101224# one column is no column
1185 
1186  if(nCount > 1)
1187  for(sal_uInt16 i = 0; i < nCount; i++)
1188  {
1189  SwColumn aCol;
1190  aCol.SetWishWidth(pArray[i].Width );
1191  nWidthSum = nWidthSum + pArray[i].Width;
1192  aCol.SetLeft (convertMm100ToTwip(pArray[i].LeftMargin));
1193  aCol.SetRight(convertMm100ToTwip(pArray[i].RightMargin));
1194  m_aColumns.insert(m_aColumns.begin() + i, aCol);
1195  }
1196  bRet = true;
1197  m_nWidth = nWidthSum;
1198  m_bOrtho = false;
1199 
1200  if (uno::Reference<beans::XPropertySet> xProps{ xCols, css::uno::UNO_QUERY })
1201  {
1202  xProps->getPropertyValue(UNO_NAME_IS_AUTOMATIC) >>= m_bOrtho;
1203  xProps->getPropertyValue(UNO_NAME_SEPARATOR_LINE_WIDTH) >>= m_nLineWidth;
1204  xProps->getPropertyValue(UNO_NAME_SEPARATOR_LINE_COLOR) >>= m_aLineColor;
1205  if (sal_Int32 nHeight;
1206  xProps->getPropertyValue(UNO_NAME_SEPARATOR_LINE_RELATIVE_HEIGHT) >>= nHeight)
1207  m_nLineHeight = nHeight;
1208  switch (xProps->getPropertyValue(UNO_NAME_SEPARATOR_LINE_STYLE).get<sal_Int16>())
1209  {
1210  default:
1212  m_eLineStyle = SvxBorderLineStyle::NONE;
1213  break;
1214  case css::text::ColumnSeparatorStyle::SOLID:
1215  m_eLineStyle = SvxBorderLineStyle::SOLID;
1216  break;
1217  case css::text::ColumnSeparatorStyle::DOTTED:
1218  m_eLineStyle = SvxBorderLineStyle::DOTTED;
1219  break;
1220  case css::text::ColumnSeparatorStyle::DASHED:
1221  m_eLineStyle = SvxBorderLineStyle::DASHED;
1222  break;
1223  }
1224  if (!xProps->getPropertyValue(UNO_NAME_SEPARATOR_LINE_IS_ON).get<bool>())
1225  m_eAdj = COLADJ_NONE;
1226  else switch (xProps->getPropertyValue(UNO_NAME_SEPARATOR_LINE_VERTIVAL_ALIGNMENT).get<style::VerticalAlignment>())
1227  {
1228  case style::VerticalAlignment_TOP: m_eAdj = COLADJ_TOP; break;
1229  case style::VerticalAlignment_MIDDLE: m_eAdj = COLADJ_CENTER; break;
1230  case style::VerticalAlignment_BOTTOM: m_eAdj = COLADJ_BOTTOM; break;
1231  default: OSL_ENSURE( false, "unknown alignment" ); break;
1232  }
1233  }
1234  }
1235  }
1236  return bRet;
1237 }
1238 
1240 {
1241  (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwFormatCol"));
1242  (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr()));
1243  (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("eLineStyle"), BAD_CAST(OString::number(static_cast<sal_Int16>(m_eLineStyle)).getStr()));
1244  (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nLineWidth"), BAD_CAST(OString::number(m_nLineWidth).getStr()));
1245  (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("aLineColor"), BAD_CAST(m_aLineColor.AsRGBHexString().toUtf8().getStr()));
1246  (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nLineHeight"), BAD_CAST(OString::number(m_nLineHeight).getStr()));
1247  (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("eAdj"), BAD_CAST(OString::number(m_eAdj).getStr()));
1248  (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nWidth"), BAD_CAST(OString::number(m_nWidth).getStr()));
1249  (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nWidthAdjustValue"), BAD_CAST(OString::number(m_aWidthAdjustValue).getStr()));
1250  (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("bOrtho"), BAD_CAST(OString::boolean(m_bOrtho).getStr()));
1251 
1252  (void)xmlTextWriterStartElement(pWriter, BAD_CAST("aColumns"));
1253  for (const SwColumn& rColumn : m_aColumns)
1254  rColumn.dumpAsXml(pWriter);
1255  (void)xmlTextWriterEndElement(pWriter);
1256 
1257  (void)xmlTextWriterEndElement(pWriter);
1258 }
1259 
1260 // Partially implemented inline in hxx
1261 SwFormatSurround::SwFormatSurround( css::text::WrapTextMode eFly ) :
1262  SfxEnumItem( RES_SURROUND, eFly )
1263 {
1264  m_bAnchorOnly = m_bContour = m_bOutside = false;
1265 }
1266 
1267 bool SwFormatSurround::operator==( const SfxPoolItem& rAttr ) const
1268 {
1269  assert(SfxPoolItem::operator==(rAttr));
1270  return ( GetValue() == static_cast<const SwFormatSurround&>(rAttr).GetValue() &&
1271  m_bAnchorOnly== static_cast<const SwFormatSurround&>(rAttr).m_bAnchorOnly &&
1272  m_bContour== static_cast<const SwFormatSurround&>(rAttr).m_bContour &&
1273  m_bOutside== static_cast<const SwFormatSurround&>(rAttr).m_bOutside );
1274 }
1275 
1277 {
1278  return new SwFormatSurround( *this );
1279 }
1280 
1282 {
1283  return 6;
1284 }
1285 
1286 bool SwFormatSurround::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
1287 {
1288  // here we convert always!
1289  nMemberId &= ~CONVERT_TWIPS;
1290  bool bRet = true;
1291  switch ( nMemberId )
1292  {
1294  rVal <<= GetSurround();
1295  break;
1297  rVal <<= IsAnchorOnly();
1298  break;
1299  case MID_SURROUND_CONTOUR:
1300  rVal <<= IsContour();
1301  break;
1303  rVal <<= IsOutside();
1304  break;
1305  default:
1306  OSL_ENSURE( false, "unknown MemberId" );
1307  bRet = false;
1308  }
1309  return bRet;
1310 }
1311 
1312 bool SwFormatSurround::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
1313 {
1314  // here we convert always!
1315  nMemberId &= ~CONVERT_TWIPS;
1316  bool bRet = true;
1317  switch ( nMemberId )
1318  {
1320  {
1321  css::text::WrapTextMode eVal = static_cast<css::text::WrapTextMode>(SWUnoHelper::GetEnumAsInt32( rVal ));
1322  if( eVal >= css::text::WrapTextMode_NONE && eVal <= css::text::WrapTextMode_RIGHT )
1323  SetValue( eVal );
1324  else {
1325  //exception
1326  ;
1327  }
1328  }
1329  break;
1330 
1332  SetAnchorOnly( *o3tl::doAccess<bool>(rVal) );
1333  break;
1334  case MID_SURROUND_CONTOUR:
1335  SetContour( *o3tl::doAccess<bool>(rVal) );
1336  break;
1338  SetOutside( *o3tl::doAccess<bool>(rVal) );
1339  break;
1340  default:
1341  OSL_ENSURE( false, "unknown MemberId" );
1342  bRet = false;
1343  }
1344  return bRet;
1345 }
1346 
1348 {
1349  (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwFormatSurround"));
1350  (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr()));
1351  (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"), BAD_CAST(OString::number(static_cast<sal_Int32>(GetValue())).getStr()));
1352 
1353  OUString aPresentation;
1354  IntlWrapper aIntlWrapper(SvtSysLocale().GetUILanguageTag());
1355  GetPresentation(SfxItemPresentation::Nameless, MapUnit::Map100thMM, MapUnit::Map100thMM, aPresentation, aIntlWrapper);
1356  (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("presentation"), BAD_CAST(aPresentation.toUtf8().getStr()));
1357 
1358  (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("bAnchorOnly"), BAD_CAST(OString::boolean(m_bAnchorOnly).getStr()));
1359  (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("bContour"), BAD_CAST(OString::boolean(m_bContour).getStr()));
1360  (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("bOutside"), BAD_CAST(OString::boolean(m_bOutside).getStr()));
1361 
1362  (void)xmlTextWriterEndElement(pWriter);
1363 }
1364 
1365 // Partially implemented inline in hxx
1367  sal_Int16 eRel )
1369  m_nYPos( nY ),
1370  m_eOrient( eVert ),
1371  m_eRelation( eRel )
1372 {}
1373 
1375 {
1376  assert(SfxPoolItem::operator==(rAttr));
1377  return ( m_nYPos == static_cast<const SwFormatVertOrient&>(rAttr).m_nYPos &&
1378  m_eOrient == static_cast<const SwFormatVertOrient&>(rAttr).m_eOrient &&
1379  m_eRelation == static_cast<const SwFormatVertOrient&>(rAttr).m_eRelation );
1380 }
1381 
1383 {
1384  return new SwFormatVertOrient( *this );
1385 }
1386 
1387 bool SwFormatVertOrient::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
1388 {
1389  // here we convert always!
1390  nMemberId &= ~CONVERT_TWIPS;
1391  bool bRet = true;
1392  switch ( nMemberId )
1393  {
1394  case MID_VERTORIENT_ORIENT:
1395  {
1396  rVal <<= m_eOrient;
1397  }
1398  break;
1400  rVal <<= m_eRelation;
1401  break;
1403  rVal <<= static_cast<sal_Int32>(convertTwipToMm100(GetPos()));
1404  break;
1405  default:
1406  OSL_ENSURE( false, "unknown MemberId" );
1407  bRet = false;
1408  }
1409  return bRet;
1410 }
1411 
1412 bool SwFormatVertOrient::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
1413 {
1414  bool bConvert = 0 != (nMemberId&CONVERT_TWIPS);
1415  nMemberId &= ~CONVERT_TWIPS;
1416  bool bRet = true;
1417  switch ( nMemberId )
1418  {
1419  case MID_VERTORIENT_ORIENT:
1420  {
1421  sal_uInt16 nVal = text::VertOrientation::NONE;
1422  rVal >>= nVal;
1423  m_eOrient = nVal;
1424  }
1425  break;
1427  {
1429  }
1430  break;
1432  {
1433  sal_Int32 nVal = 0;
1434  rVal >>= nVal;
1435  if(bConvert)
1436  nVal = convertMm100ToTwip(nVal);
1437  SetPos( nVal );
1438  }
1439  break;
1440  default:
1441  OSL_ENSURE( false, "unknown MemberId" );
1442  bRet = false;
1443  }
1444  return bRet;
1445 }
1446 
1448 {
1449  (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwFormatVertOrient"));
1450  (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr()));
1451  (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nYPos"), BAD_CAST(OString::number(m_nYPos).getStr()));
1452  (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("eOrient"), BAD_CAST(OString::number(m_eOrient).getStr()));
1453  (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("eRelation"), BAD_CAST(OString::number(m_eRelation).getStr()));
1454  (void)xmlTextWriterEndElement(pWriter);
1455 }
1456 
1457 // Partially implemented inline in hxx
1459  sal_Int16 eRel, bool bPos )
1461  m_nXPos( nX ),
1462  m_eOrient( eHori ),
1463  m_eRelation( eRel ),
1464  m_bPosToggle( bPos )
1465 {}
1466 
1468 {
1469  assert(SfxPoolItem::operator==(rAttr));
1470  return ( m_nXPos == static_cast<const SwFormatHoriOrient&>(rAttr).m_nXPos &&
1471  m_eOrient == static_cast<const SwFormatHoriOrient&>(rAttr).m_eOrient &&
1472  m_eRelation == static_cast<const SwFormatHoriOrient&>(rAttr).m_eRelation &&
1473  m_bPosToggle == static_cast<const SwFormatHoriOrient&>(rAttr).m_bPosToggle );
1474 }
1475 
1477 {
1478  return new SwFormatHoriOrient( *this );
1479 }
1480 
1481 bool SwFormatHoriOrient::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
1482 {
1483  // here we convert always!
1484  nMemberId &= ~CONVERT_TWIPS;
1485  bool bRet = true;
1486  switch ( nMemberId )
1487  {
1488  case MID_HORIORIENT_ORIENT:
1489  {
1490  rVal <<= m_eOrient;
1491  }
1492  break;
1494  rVal <<= m_eRelation;
1495  break;
1497  rVal <<= static_cast<sal_Int32>(convertTwipToMm100(GetPos()));
1498  break;
1500  rVal <<= IsPosToggle();
1501  break;
1502  default:
1503  OSL_ENSURE( false, "unknown MemberId" );
1504  bRet = false;
1505  }
1506  return bRet;
1507 }
1508 
1509 bool SwFormatHoriOrient::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
1510 {
1511  bool bConvert = 0 != (nMemberId&CONVERT_TWIPS);
1512  nMemberId &= ~CONVERT_TWIPS;
1513  bool bRet = true;
1514  switch ( nMemberId )
1515  {
1516  case MID_HORIORIENT_ORIENT:
1517  {
1518  sal_Int16 nVal = text::HoriOrientation::NONE;
1519  rVal >>= nVal;
1520  m_eOrient = nVal;
1521  }
1522  break;
1524  {
1526  }
1527  break;
1529  {
1530  sal_Int32 nVal = 0;
1531  if(!(rVal >>= nVal))
1532  bRet = false;
1533  if(bConvert)
1534  nVal = convertMm100ToTwip(nVal);
1535  SetPos( nVal );
1536  }
1537  break;
1539  SetPosToggle( *o3tl::doAccess<bool>(rVal));
1540  break;
1541  default:
1542  OSL_ENSURE( false, "unknown MemberId" );
1543  bRet = false;
1544  }
1545  return bRet;
1546 }
1547 
1549 {
1550  (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwFormatHoriOrient"));
1551  (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr()));
1552  (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nXPos"), BAD_CAST(OString::number(m_nXPos).getStr()));
1553  (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("eOrient"), BAD_CAST(OString::number(m_eOrient).getStr()));
1554  (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("eRelation"), BAD_CAST(OString::number(m_eRelation).getStr()));
1555  (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("bPosToggle"), BAD_CAST(OString::boolean(m_bPosToggle).getStr()));
1556  (void)xmlTextWriterEndElement(pWriter);
1557 }
1558 
1559 // Partially implemented inline in hxx
1561  : SfxPoolItem( RES_ANCHOR ),
1562  m_eAnchorId( nRnd ),
1563  m_nPageNumber( nPage ),
1564  // OD 2004-05-05 #i28701# - get always new increased order number
1565  m_nOrder( ++s_nOrderCounter )
1566 {}
1567 
1569  : SfxPoolItem( RES_ANCHOR )
1570  , m_pContentAnchor( (rCpy.GetContentAnchor())
1571  ? new SwPosition( *rCpy.GetContentAnchor() ) : nullptr )
1572  , m_eAnchorId( rCpy.GetAnchorId() )
1573  , m_nPageNumber( rCpy.GetPageNum() )
1574  // OD 2004-05-05 #i28701# - get always new increased order number
1575  , m_nOrder( ++s_nOrderCounter )
1576 {
1577 }
1578 
1580 {
1581 }
1582 
1584 {
1585  // anchor only to paragraphs, or start nodes in case of RndStdIds::FLY_AT_FLY
1586  // also allow table node, this is used when a table is selected and is converted to a frame by the UI
1587  assert(!pPos
1588  || ((RndStdIds::FLY_AT_FLY == m_eAnchorId) &&
1589  dynamic_cast<SwStartNode*>(&pPos->nNode.GetNode()))
1590  || (RndStdIds::FLY_AT_PARA == m_eAnchorId && dynamic_cast<SwTableNode*>(&pPos->nNode.GetNode()))
1591  || dynamic_cast<SwTextNode*>(&pPos->nNode.GetNode()));
1592  m_pContentAnchor .reset( pPos ? new SwPosition( *pPos ) : nullptr );
1593  // Flys anchored AT paragraph should not point into the paragraph content
1594  if (m_pContentAnchor &&
1595  ((RndStdIds::FLY_AT_PARA == m_eAnchorId) || (RndStdIds::FLY_AT_FLY == m_eAnchorId)))
1596  {
1597  m_pContentAnchor->nContent.Assign( nullptr, 0 );
1598  }
1599 }
1600 
1602 {
1603  if (this != &rAnchor)
1604  {
1605  m_eAnchorId = rAnchor.GetAnchorId();
1606  m_nPageNumber = rAnchor.GetPageNum();
1607  // OD 2004-05-05 #i28701# - get always new increased order number
1609 
1610  m_pContentAnchor.reset( (rAnchor.GetContentAnchor())
1611  ? new SwPosition(*(rAnchor.GetContentAnchor()))
1612  : nullptr );
1613  }
1614  return *this;
1615 }
1616 
1617 bool SwFormatAnchor::operator==( const SfxPoolItem& rAttr ) const
1618 {
1619  assert(SfxPoolItem::operator==(rAttr));
1620  SwFormatAnchor const& rFormatAnchor(static_cast<SwFormatAnchor const&>(rAttr));
1621  // OD 2004-05-05 #i28701# - Note: <mnOrder> hasn't to be considered.
1622  return ( m_eAnchorId == rFormatAnchor.GetAnchorId() &&
1623  m_nPageNumber == rFormatAnchor.GetPageNum() &&
1624  // compare anchor: either both do not point into a textnode or
1625  // both do (valid m_pContentAnchor) and the positions are equal
1626  ((m_pContentAnchor.get() == rFormatAnchor.m_pContentAnchor.get()) ||
1627  (m_pContentAnchor && rFormatAnchor.GetContentAnchor() &&
1628  (*m_pContentAnchor == *rFormatAnchor.GetContentAnchor()))));
1629 }
1630 
1632 {
1633  return new SwFormatAnchor( *this );
1634 }
1635 
1636 // OD 2004-05-05 #i28701#
1637 sal_uInt32 SwFormatAnchor::s_nOrderCounter = 0;
1638 
1639 // OD 2004-05-05 #i28701#
1640 
1641 bool SwFormatAnchor::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
1642 {
1643  // here we convert always!
1644  nMemberId &= ~CONVERT_TWIPS;
1645  bool bRet = true;
1646  switch ( nMemberId )
1647  {
1648  case MID_ANCHOR_ANCHORTYPE:
1649 
1650  text::TextContentAnchorType eRet;
1651  switch (GetAnchorId())
1652  {
1653  case RndStdIds::FLY_AT_CHAR:
1654  eRet = text::TextContentAnchorType_AT_CHARACTER;
1655  break;
1656  case RndStdIds::FLY_AT_PAGE:
1657  eRet = text::TextContentAnchorType_AT_PAGE;
1658  break;
1659  case RndStdIds::FLY_AT_FLY:
1660  eRet = text::TextContentAnchorType_AT_FRAME;
1661  break;
1662  case RndStdIds::FLY_AS_CHAR:
1663  eRet = text::TextContentAnchorType_AS_CHARACTER;
1664  break;
1665  //case RndStdIds::FLY_AT_PARA:
1666  default:
1667  eRet = text::TextContentAnchorType_AT_PARAGRAPH;
1668  }
1669  rVal <<= eRet;
1670  break;
1671  case MID_ANCHOR_PAGENUM:
1672  rVal <<= static_cast<sal_Int16>(GetPageNum());
1673  break;
1675  {
1676  if (m_pContentAnchor && RndStdIds::FLY_AT_FLY == m_eAnchorId)
1677  {
1678  SwFrameFormat* pFormat = m_pContentAnchor->nNode.GetNode().GetFlyFormat();
1679  if(pFormat)
1680  {
1681  uno::Reference<text::XTextFrame> const xRet(
1682  SwXTextFrame::CreateXTextFrame(*pFormat->GetDoc(), pFormat));
1683  rVal <<= xRet;
1684  }
1685  }
1686  }
1687  break;
1688  default:
1689  OSL_ENSURE( false, "unknown MemberId" );
1690  bRet = false;
1691  }
1692  return bRet;
1693 }
1694 
1695 bool SwFormatAnchor::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
1696 {
1697  // here we convert always!
1698  nMemberId &= ~CONVERT_TWIPS;
1699  bool bRet = true;
1700  switch ( nMemberId )
1701  {
1702  case MID_ANCHOR_ANCHORTYPE:
1703  {
1704  RndStdIds eAnchor;
1705  switch( static_cast<text::TextContentAnchorType>(SWUnoHelper::GetEnumAsInt32( rVal )) )
1706  {
1707  case text::TextContentAnchorType_AS_CHARACTER:
1708  eAnchor = RndStdIds::FLY_AS_CHAR;
1709  break;
1710  case text::TextContentAnchorType_AT_PAGE:
1711  eAnchor = RndStdIds::FLY_AT_PAGE;
1712  if( GetPageNum() > 0 )
1713  {
1714  // If the anchor type is page and a valid page number
1715  // has been set, the content position isn't required
1716  // any longer.
1717  m_pContentAnchor.reset();
1718  }
1719  break;
1720  case text::TextContentAnchorType_AT_FRAME:
1721  eAnchor = RndStdIds::FLY_AT_FLY;
1722  break;
1723  case text::TextContentAnchorType_AT_CHARACTER:
1724  eAnchor = RndStdIds::FLY_AT_CHAR;
1725  break;
1726  //case text::TextContentAnchorType_AT_PARAGRAPH:
1727  default:
1728  eAnchor = RndStdIds::FLY_AT_PARA;
1729  break;
1730  }
1731  SetType( eAnchor );
1732  }
1733  break;
1734  case MID_ANCHOR_PAGENUM:
1735  {
1736  sal_Int16 nVal = 0;
1737  if((rVal >>= nVal) && nVal > 0)
1738  {
1739  SetPageNum( nVal );
1740  if (RndStdIds::FLY_AT_PAGE == GetAnchorId())
1741  {
1742  // If the anchor type is page and a valid page number
1743  // is set, the content position has to be deleted to not
1744  // confuse the layout (frmtool.cxx). However, if the
1745  // anchor type is not page, any content position will
1746  // be kept.
1747  m_pContentAnchor.reset();
1748  }
1749  }
1750  else
1751  bRet = false;
1752  }
1753  break;
1755  //no break here!;
1756  default:
1757  OSL_ENSURE( false, "unknown MemberId" );
1758  bRet = false;
1759  }
1760  return bRet;
1761 }
1762 
1764 {
1765  (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwFormatAnchor"));
1766  (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr()));
1767 
1768  if (m_pContentAnchor)
1769  {
1770  std::stringstream aContentAnchor;
1771  aContentAnchor << *m_pContentAnchor;
1772  (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("m_pContentAnchor"), BAD_CAST(aContentAnchor.str().c_str()));
1773  }
1774  else
1775  (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("m_pContentAnchor"), "%p", m_pContentAnchor.get());
1776  (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("m_eAnchorType"), BAD_CAST(OString::number(static_cast<int>(m_eAnchorId)).getStr()));
1777  (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("m_nPageNumber"), BAD_CAST(OString::number(m_nPageNumber).getStr()));
1778  (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("m_nOrder"), BAD_CAST(OString::number(m_nOrder).getStr()));
1779  (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("s_nOrderCounter"), BAD_CAST(OString::number(s_nOrderCounter).getStr()));
1780  OUString aPresentation;
1781  IntlWrapper aIntlWrapper(SvtSysLocale().GetUILanguageTag());
1782  GetPresentation(SfxItemPresentation::Nameless, MapUnit::Map100thMM, MapUnit::Map100thMM, aPresentation, aIntlWrapper);
1783  (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("presentation"), BAD_CAST(aPresentation.toUtf8().getStr()));
1784 
1785  (void)xmlTextWriterEndElement(pWriter);
1786 }
1787 
1788 // Partially implemented inline in hxx
1790  SfxPoolItem( RES_URL ),
1791  m_bIsServerMap( false )
1792 {
1793 }
1794 
1796  SfxPoolItem( RES_URL ),
1797  m_sTargetFrameName( rURL.GetTargetFrameName() ),
1798  m_sURL( rURL.GetURL() ),
1799  m_sName( rURL.GetName() ),
1800  m_bIsServerMap( rURL.IsServerMap() )
1801 {
1802  if (rURL.GetMap())
1803  m_pMap.reset( new ImageMap( *rURL.GetMap() ) );
1804 }
1805 
1807 {
1808 }
1809 
1810 bool SwFormatURL::operator==( const SfxPoolItem &rAttr ) const
1811 {
1812  assert(SfxPoolItem::operator==(rAttr));
1813  const SwFormatURL &rCmp = static_cast<const SwFormatURL&>(rAttr);
1814  bool bRet = m_bIsServerMap == rCmp.IsServerMap() &&
1815  m_sURL == rCmp.GetURL() &&
1817  m_sName == rCmp.GetName();
1818  if ( bRet )
1819  {
1820  if ( m_pMap && rCmp.GetMap() )
1821  bRet = *m_pMap == *rCmp.GetMap();
1822  else
1823  bRet = m_pMap.get() == rCmp.GetMap();
1824  }
1825  return bRet;
1826 }
1827 
1829 {
1830  return new SwFormatURL( *this );
1831 }
1832 
1833 void SwFormatURL::SetURL(const OUString &rURL, bool bServerMap)
1834 {
1835  m_sURL = rURL;
1836  m_bIsServerMap = bServerMap;
1837 }
1838 
1840 {
1841  m_pMap.reset( pM ? new ImageMap( *pM ) : nullptr);
1842 }
1843 
1844 bool SwFormatURL::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
1845 {
1846  // here we convert always!
1847  nMemberId &= ~CONVERT_TWIPS;
1848  bool bRet = true;
1849  switch ( nMemberId )
1850  {
1851  case MID_URL_URL:
1852  rVal <<= GetURL();
1853  break;
1854  case MID_URL_TARGET:
1855  rVal <<= GetTargetFrameName();
1856  break;
1857  case MID_URL_HYPERLINKNAME:
1858  rVal <<= GetName();
1859  break;
1860  case MID_URL_CLIENTMAP:
1861  {
1862  uno::Reference< uno::XInterface > xInt;
1863  if(m_pMap)
1864  {
1866  }
1867  else
1868  {
1869  ImageMap aEmptyMap;
1871  }
1872  uno::Reference< container::XIndexContainer > xCont(xInt, uno::UNO_QUERY);
1873  rVal <<= xCont;
1874  }
1875  break;
1876  case MID_URL_SERVERMAP:
1877  rVal <<= IsServerMap();
1878  break;
1879  default:
1880  OSL_ENSURE( false, "unknown MemberId" );
1881  bRet = false;
1882  }
1883  return bRet;
1884 }
1885 
1886 bool SwFormatURL::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
1887 {
1888  // here we convert always!
1889  nMemberId &= ~CONVERT_TWIPS;
1890  bool bRet = true;
1891  switch ( nMemberId )
1892  {
1893  case MID_URL_URL:
1894  {
1895  OUString sTmp;
1896  rVal >>= sTmp;
1897  SetURL( sTmp, m_bIsServerMap );
1898  }
1899  break;
1900  case MID_URL_TARGET:
1901  {
1902  OUString sTmp;
1903  rVal >>= sTmp;
1904  SetTargetFrameName( sTmp );
1905  }
1906  break;
1907  case MID_URL_HYPERLINKNAME:
1908  {
1909  OUString sTmp;
1910  rVal >>= sTmp;
1911  SetName( sTmp );
1912  }
1913  break;
1914  case MID_URL_CLIENTMAP:
1915  {
1916  uno::Reference<container::XIndexContainer> xCont;
1917  if(!rVal.hasValue())
1918  m_pMap.reset();
1919  else if(rVal >>= xCont)
1920  {
1921  if(!m_pMap)
1922  m_pMap.reset(new ImageMap);
1923  bRet = SvUnoImageMap_fillImageMap( xCont, *m_pMap );
1924  }
1925  else
1926  bRet = false;
1927  }
1928  break;
1929  case MID_URL_SERVERMAP:
1930  m_bIsServerMap = *o3tl::doAccess<bool>(rVal);
1931  break;
1932  default:
1933  OSL_ENSURE( false, "unknown MemberId" );
1934  bRet = false;
1935  }
1936  return bRet;
1937 }
1938 
1940 {
1941  return new SwFormatEditInReadonly( *this );
1942 }
1943 
1945 {
1946  return new SwFormatLayoutSplit( *this );
1947 }
1948 
1950 {
1951  return new SwFormatRowSplit( *this );
1952 }
1953 
1955 {
1956  return new SwFormatNoBalancedColumns( *this );
1957 }
1958 
1960 {
1961  (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwFormatNoBalancedColumns"));
1962  (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr()));
1963  (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"), BAD_CAST(OString::boolean(GetValue()).getStr()));
1964  (void)xmlTextWriterEndElement(pWriter);
1965 }
1966 
1967 // class SwFormatFootnoteEndAtTextEnd
1968 
1970 {
1971  return sal_uInt16( FTNEND_ATTXTEND_END );
1972 }
1973 
1975  const SwFormatFootnoteEndAtTextEnd& rAttr )
1976 {
1977  SfxEnumItem::SetValue( rAttr.GetValue() );
1978  m_aFormat = rAttr.m_aFormat;
1979  m_nOffset = rAttr.m_nOffset;
1980  m_sPrefix = rAttr.m_sPrefix;
1981  m_sSuffix = rAttr.m_sSuffix;
1982  return *this;
1983 }
1984 
1986 {
1987  const SwFormatFootnoteEndAtTextEnd& rAttr = static_cast<const SwFormatFootnoteEndAtTextEnd&>(rItem);
1988  return SfxEnumItem::operator==( rItem ) &&
1990  m_nOffset == rAttr.m_nOffset &&
1991  m_sPrefix == rAttr.m_sPrefix &&
1992  m_sSuffix == rAttr.m_sSuffix;
1993 }
1994 
1996 {
1997  nMemberId &= ~CONVERT_TWIPS;
1998  switch(nMemberId)
1999  {
2000  case MID_COLLECT :
2001  rVal <<= GetValue() >= FTNEND_ATTXTEND;
2002  break;
2003  case MID_RESTART_NUM :
2004  rVal <<= GetValue() >= FTNEND_ATTXTEND_OWNNUMSEQ;
2005  break;
2006  case MID_NUM_START_AT: rVal <<= static_cast<sal_Int16>(m_nOffset); break;
2007  case MID_OWN_NUM :
2008  rVal <<= GetValue() >= FTNEND_ATTXTEND_OWNNUMANDFMT;
2009  break;
2010  case MID_NUM_TYPE : rVal <<= static_cast<sal_Int16>(m_aFormat.GetNumberingType()); break;
2011  case MID_PREFIX : rVal <<= m_sPrefix; break;
2012  case MID_SUFFIX : rVal <<= m_sSuffix; break;
2013  default: return false;
2014  }
2015  return true;
2016 }
2017 
2019 {
2020  bool bRet = true;
2021  nMemberId &= ~CONVERT_TWIPS;
2022  switch(nMemberId)
2023  {
2024  case MID_COLLECT :
2025  {
2026  bool bVal = *o3tl::doAccess<bool>(rVal);
2027  if(!bVal && GetValue() >= FTNEND_ATTXTEND)
2029  else if(bVal && GetValue() < FTNEND_ATTXTEND)
2031  }
2032  break;
2033  case MID_RESTART_NUM :
2034  {
2035  bool bVal = *o3tl::doAccess<bool>(rVal);
2036  if(!bVal && GetValue() >= FTNEND_ATTXTEND_OWNNUMSEQ)
2038  else if(bVal && GetValue() < FTNEND_ATTXTEND_OWNNUMSEQ)
2040  }
2041  break;
2042  case MID_NUM_START_AT:
2043  {
2044  sal_Int16 nVal = 0;
2045  rVal >>= nVal;
2046  if(nVal >= 0)
2047  m_nOffset = nVal;
2048  else
2049  bRet = false;
2050  }
2051  break;
2052  case MID_OWN_NUM :
2053  {
2054  bool bVal = *o3tl::doAccess<bool>(rVal);
2055  if(!bVal && GetValue() >= FTNEND_ATTXTEND_OWNNUMANDFMT)
2057  else if(bVal && GetValue() < FTNEND_ATTXTEND_OWNNUMANDFMT)
2059  }
2060  break;
2061  case MID_NUM_TYPE :
2062  {
2063  sal_Int16 nVal = 0;
2064  rVal >>= nVal;
2065  if(nVal >= 0 &&
2066  (nVal <= SVX_NUM_ARABIC ||
2067  SVX_NUM_CHARS_UPPER_LETTER_N == nVal ||
2068  SVX_NUM_CHARS_LOWER_LETTER_N == nVal ))
2069  m_aFormat.SetNumberingType(static_cast<SvxNumType>(nVal));
2070  else
2071  bRet = false;
2072  }
2073  break;
2074  case MID_PREFIX :
2075  {
2076  OUString sVal; rVal >>= sVal;
2077  m_sPrefix = sVal;
2078  }
2079  break;
2080  case MID_SUFFIX :
2081  {
2082  OUString sVal; rVal >>= sVal;
2083  m_sSuffix = sVal;
2084  }
2085  break;
2086  default: bRet = false;
2087  }
2088  return bRet;
2089 }
2090 
2091 // class SwFormatFootnoteAtTextEnd
2092 
2094 {
2095  return new SwFormatFootnoteAtTextEnd(*this);
2096 }
2097 
2098 // class SwFormatEndAtTextEnd
2099 
2101 {
2102  return new SwFormatEndAtTextEnd(*this);
2103 }
2104 
2105 //class SwFormatChain
2106 
2107 bool SwFormatChain::operator==( const SfxPoolItem &rAttr ) const
2108 {
2109  assert(SfxPoolItem::operator==(rAttr));
2110 
2111  return GetPrev() == static_cast<const SwFormatChain&>(rAttr).GetPrev() &&
2112  GetNext() == static_cast<const SwFormatChain&>(rAttr).GetNext();
2113 }
2114 
2117 {
2118  SetPrev( rCpy.GetPrev() );
2119  SetNext( rCpy.GetNext() );
2120 }
2121 
2123 {
2124  SwFormatChain *pRet = new SwFormatChain;
2125  pRet->SetPrev( GetPrev() );
2126  pRet->SetNext( GetNext() );
2127  return pRet;
2128 }
2129 
2131 {
2132  if ( pFormat )
2133  pFormat->Add( &m_aPrev );
2134  else
2136 }
2137 
2139 {
2140  if ( pFormat )
2141  pFormat->Add( &m_aNext );
2142  else
2144 }
2145 
2146 bool SwFormatChain::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
2147 {
2148  // here we convert always!
2149  nMemberId &= ~CONVERT_TWIPS;
2150  bool bRet = true;
2151  OUString aRet;
2152  switch ( nMemberId )
2153  {
2154  case MID_CHAIN_PREVNAME:
2155  if ( GetPrev() )
2156  aRet = GetPrev()->GetName();
2157  break;
2158  case MID_CHAIN_NEXTNAME:
2159  if ( GetNext() )
2160  aRet = GetNext()->GetName();
2161  break;
2162  default:
2163  OSL_ENSURE( false, "unknown MemberId" );
2164  bRet = false;
2165  }
2166  rVal <<= aRet;
2167  return bRet;
2168 }
2169 
2172 {
2173  m_nStartValue = 0;
2174  m_bCountLines = true;
2175 }
2176 
2178 {
2179 }
2180 
2182 {
2183  assert(SfxPoolItem::operator==(rAttr));
2184 
2185  return m_nStartValue == static_cast<const SwFormatLineNumber&>(rAttr).GetStartValue() &&
2186  m_bCountLines == static_cast<const SwFormatLineNumber&>(rAttr).IsCount();
2187 }
2188 
2190 {
2191  return new SwFormatLineNumber( *this );
2192 }
2193 
2194 bool SwFormatLineNumber::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
2195 {
2196  // here we convert always!
2197  nMemberId &= ~CONVERT_TWIPS;
2198  bool bRet = true;
2199  switch ( nMemberId )
2200  {
2201  case MID_LINENUMBER_COUNT:
2202  rVal <<= IsCount();
2203  break;
2205  rVal <<= static_cast<sal_Int32>(GetStartValue());
2206  break;
2207  default:
2208  OSL_ENSURE( false, "unknown MemberId" );
2209  bRet = false;
2210  }
2211  return bRet;
2212 }
2213 
2214 bool SwFormatLineNumber::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
2215 {
2216  // here we convert always!
2217  nMemberId &= ~CONVERT_TWIPS;
2218  bool bRet = true;
2219  switch ( nMemberId )
2220  {
2221  case MID_LINENUMBER_COUNT:
2222  SetCountLines( *o3tl::doAccess<bool>(rVal) );
2223  break;
2225  {
2226  sal_Int32 nVal = 0;
2227  if(rVal >>= nVal)
2228  SetStartValue( nVal );
2229  else
2230  bRet = false;
2231  }
2232  break;
2233  default:
2234  OSL_ENSURE( false, "unknown MemberId" );
2235  bRet = false;
2236  }
2237  return bRet;
2238 }
2239 
2241  : SfxPoolItem( RES_TEXTGRID ), m_aColor( COL_LIGHTGRAY ), m_nLines( 20 )
2242  , m_nBaseHeight( 400 ), m_nRubyHeight( 200 ), m_eGridType( GRID_NONE )
2243  , m_bRubyTextBelow( false ), m_bPrintGrid( true ), m_bDisplayGrid( true )
2244  , m_nBaseWidth(400), m_bSnapToChars( true ), m_bSquaredMode(true)
2245 {
2246 }
2247 
2249 {
2250 }
2251 
2252 bool SwTextGridItem::operator==( const SfxPoolItem& rAttr ) const
2253 {
2254  assert(SfxPoolItem::operator==(rAttr));
2255  SwTextGridItem const& rOther(static_cast<SwTextGridItem const&>(rAttr));
2256  return m_eGridType == rOther.GetGridType()
2257  && m_nLines == rOther.GetLines()
2258  && m_nBaseHeight == rOther.GetBaseHeight()
2259  && m_nRubyHeight == rOther.GetRubyHeight()
2260  && m_bRubyTextBelow == rOther.GetRubyTextBelow()
2261  && m_bDisplayGrid == rOther.GetDisplayGrid()
2262  && m_bPrintGrid == rOther.GetPrintGrid()
2263  && m_aColor == rOther.GetColor()
2264  && m_nBaseWidth == rOther.GetBaseWidth()
2265  && m_bSnapToChars == rOther.GetSnapToChars()
2266  && m_bSquaredMode == rOther.GetSquaredMode();
2267 }
2268 
2270 {
2271  return new SwTextGridItem( *this );
2272 }
2273 
2274 bool SwTextGridItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
2275 {
2276  bool bRet = true;
2277 
2278  switch( nMemberId & ~CONVERT_TWIPS )
2279  {
2280  case MID_GRID_COLOR:
2281  rVal <<= GetColor();
2282  break;
2283  case MID_GRID_LINES:
2284  rVal <<= GetLines();
2285  break;
2286  case MID_GRID_RUBY_BELOW:
2287  rVal <<= m_bRubyTextBelow;
2288  break;
2289  case MID_GRID_PRINT:
2290  rVal <<= m_bPrintGrid;
2291  break;
2292  case MID_GRID_DISPLAY:
2293  rVal <<= m_bDisplayGrid;
2294  break;
2295  case MID_GRID_BASEHEIGHT:
2296  OSL_ENSURE( (nMemberId & CONVERT_TWIPS) != 0,
2297  "This value needs TWIPS-MM100 conversion" );
2298  rVal <<= static_cast<sal_Int32>(convertTwipToMm100(m_nBaseHeight));
2299  break;
2300  case MID_GRID_BASEWIDTH:
2301  OSL_ENSURE( (nMemberId & CONVERT_TWIPS) != 0,
2302  "This value needs TWIPS-MM100 conversion" );
2303  rVal <<= static_cast<sal_Int32>(convertTwipToMm100(m_nBaseWidth));
2304  break;
2305  case MID_GRID_RUBYHEIGHT:
2306  OSL_ENSURE( (nMemberId & CONVERT_TWIPS) != 0,
2307  "This value needs TWIPS-MM100 conversion" );
2308  rVal <<= static_cast<sal_Int32>(convertTwipToMm100(m_nRubyHeight));
2309  break;
2310  case MID_GRID_TYPE:
2311  switch( GetGridType() )
2312  {
2313  case GRID_NONE:
2314  rVal <<= text::TextGridMode::NONE;
2315  break;
2316  case GRID_LINES_ONLY:
2317  rVal <<= text::TextGridMode::LINES;
2318  break;
2319  case GRID_LINES_CHARS:
2320  rVal <<= text::TextGridMode::LINES_AND_CHARS;
2321  break;
2322  default:
2323  OSL_FAIL("unknown SwTextGrid value");
2324  bRet = false;
2325  break;
2326  }
2327  break;
2328  case MID_GRID_SNAPTOCHARS:
2329  rVal <<= m_bSnapToChars;
2330  break;
2332  rVal <<= !m_bSquaredMode;
2333  break;
2334  default:
2335  OSL_FAIL("Unknown SwTextGridItem member");
2336  bRet = false;
2337  break;
2338  }
2339 
2340  return bRet;
2341 }
2342 
2343 bool SwTextGridItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
2344 {
2345  bool bRet = true;
2346  switch( nMemberId & ~CONVERT_TWIPS )
2347  {
2348  case MID_GRID_COLOR:
2349  {
2350  Color nTmp;
2351  bRet = (rVal >>= nTmp);
2352  if( bRet )
2353  SetColor( nTmp );
2354  }
2355  break;
2356  case MID_GRID_LINES:
2357  {
2358  sal_Int16 nTmp = 0;
2359  bRet = (rVal >>= nTmp);
2360  if( bRet && (nTmp >= 0) )
2361  SetLines( o3tl::narrowing<sal_uInt16>(nTmp) );
2362  else
2363  bRet = false;
2364  }
2365  break;
2366  case MID_GRID_RUBY_BELOW:
2367  SetRubyTextBelow( *o3tl::doAccess<bool>(rVal) );
2368  break;
2369  case MID_GRID_PRINT:
2370  SetPrintGrid( *o3tl::doAccess<bool>(rVal) );
2371  break;
2372  case MID_GRID_DISPLAY:
2373  SetDisplayGrid( *o3tl::doAccess<bool>(rVal) );
2374  break;
2375  case MID_GRID_BASEHEIGHT:
2376  case MID_GRID_BASEWIDTH:
2377  case MID_GRID_RUBYHEIGHT:
2378  {
2379  OSL_ENSURE( (nMemberId & CONVERT_TWIPS) != 0,
2380  "This value needs TWIPS-MM100 conversion" );
2381  sal_Int32 nTmp = 0;
2382  bRet = (rVal >>= nTmp);
2383  nTmp = convertMm100ToTwip( nTmp );
2384  if( bRet && (nTmp >= 0) && ( nTmp <= SAL_MAX_UINT16) )
2385  {
2386  // rhbz#1043551 round up to 5pt -- 0 causes divide-by-zero
2387  // in layout; 1pt ties the painting code up in knots for
2388  // minutes with bazillion lines...
2389 #define MIN_TEXTGRID_SIZE 100
2390  if( (nMemberId & ~CONVERT_TWIPS) == MID_GRID_BASEHEIGHT )
2391  {
2392  nTmp = std::max<sal_Int32>(nTmp, MIN_TEXTGRID_SIZE);
2393  SetBaseHeight( o3tl::narrowing<sal_uInt16>(nTmp) );
2394  }
2395  else if( (nMemberId & ~CONVERT_TWIPS) == MID_GRID_BASEWIDTH )
2396  {
2397  nTmp = std::max<sal_Int32>(nTmp, MIN_TEXTGRID_SIZE);
2398  SetBaseWidth( o3tl::narrowing<sal_uInt16>(nTmp) );
2399  }
2400  else
2401  SetRubyHeight( o3tl::narrowing<sal_uInt16>(nTmp) );
2402  }
2403  else
2404  bRet = false;
2405  }
2406  break;
2407  case MID_GRID_TYPE:
2408  {
2409  sal_Int16 nTmp = 0;
2410  bRet = (rVal >>= nTmp);
2411  if( bRet )
2412  {
2413  switch( nTmp )
2414  {
2417  break;
2418  case text::TextGridMode::LINES:
2420  break;
2421  case text::TextGridMode::LINES_AND_CHARS:
2423  break;
2424  default:
2425  bRet = false;
2426  break;
2427  }
2428  }
2429  break;
2430  }
2431  case MID_GRID_SNAPTOCHARS:
2432  SetSnapToChars( *o3tl::doAccess<bool>(rVal) );
2433  break;
2435  {
2436  bool bStandard = *o3tl::doAccess<bool>(rVal);
2437  SetSquaredMode( !bStandard );
2438  break;
2439  }
2440  default:
2441  OSL_FAIL("Unknown SwTextGridItem member");
2442  bRet = false;
2443  }
2444 
2445  return bRet;
2446 }
2447 
2449 {
2450  if (bNew == m_bSquaredMode)
2451  {
2452  //same paper mode, not switch
2453  return;
2454  }
2455 
2456  // use default value when grid is disable
2457  if (m_eGridType == GRID_NONE)
2458  {
2459  m_bSquaredMode = bNew;
2460  Init();
2461  return;
2462  }
2463 
2464  if (m_bSquaredMode)
2465  {
2466  //switch from "squared mode" to "standard mode"
2469  m_nRubyHeight = 0;
2470  }
2471  else
2472  {
2473  //switch from "standard mode" to "squared mode"
2477  }
2479 }
2480 
2482 {
2483  if (m_bSquaredMode)
2484  {
2485  m_nLines = 20;
2486  m_nBaseHeight = 400;
2487  m_nRubyHeight = 200;
2489  m_bRubyTextBelow = false;
2490  m_bPrintGrid = true;
2491  m_bDisplayGrid = true;
2492  m_bSnapToChars = true;
2493  m_nBaseWidth = 400;
2494  }
2495  else
2496  {
2497  m_nLines = 44;
2498  m_nBaseHeight = 312;
2499  m_nRubyHeight = 0;
2501  m_bRubyTextBelow = false;
2502  m_bPrintGrid = true;
2503  m_bDisplayGrid = true;
2504  m_nBaseWidth = 210;
2505  m_bSnapToChars = true;
2506  }
2507 }
2508 
2510 {
2511  return new SwHeaderAndFooterEatSpacingItem( Which(), GetValue() );
2512 }
2513 
2515  SwAttrPool& rPool,
2516  const char* pFormatNm,
2517  SwFrameFormat *pDrvdFrame,
2518  sal_uInt16 nFormatWhich,
2519  const WhichRangesContainer& pWhichRange)
2520 : SwFormat(rPool, pFormatNm, pWhichRange, pDrvdFrame, nFormatWhich),
2521  m_wXObject(),
2522  maFillAttributes(),
2523  m_ffList(nullptr),
2524  m_pOtherTextBoxFormat(nullptr)
2525 {
2526 }
2527 
2529  SwAttrPool& rPool,
2530  const OUString &rFormatNm,
2531  SwFrameFormat *pDrvdFrame,
2532  sal_uInt16 nFormatWhich,
2533  const WhichRangesContainer& pWhichRange)
2534 : SwFormat(rPool, rFormatNm, pWhichRange, pDrvdFrame, nFormatWhich),
2535  m_wXObject(),
2536  maFillAttributes(),
2537  m_ffList(nullptr),
2538  m_pOtherTextBoxFormat(nullptr)
2539 {
2540 }
2541 
2543 {
2544  if( !GetDoc()->IsInDtor())
2545  {
2546  const SwFormatAnchor& rAnchor = GetAnchor();
2547  if (rAnchor.GetContentAnchor() != nullptr)
2548  {
2549  rAnchor.GetContentAnchor()->nNode.GetNode().RemoveAnchoredFly(this);
2550  }
2551  }
2552 
2553  if( nullptr != m_pOtherTextBoxFormat )
2554  {
2556  m_pOtherTextBoxFormat = nullptr;
2557  }
2558 }
2559 
2560 void SwFrameFormat::SetName( const OUString& rNewName, bool bBroadcast )
2561 {
2562  if (m_ffList != nullptr) {
2563  SwFrameFormats::iterator it = m_ffList->find( this );
2564  assert( m_ffList->end() != it );
2565  SAL_INFO_IF(m_aFormatName == rNewName, "sw.core", "SwFrmFmt not really renamed, as both names are equal");
2566 
2568  // As it's a non-unique list, rename should never fail!
2569  bool const renamed =
2570  m_ffList->m_PosIndex.modify( it,
2571  change_name( rNewName ), change_name( m_aFormatName ) );
2572  assert(renamed);
2573  (void)renamed; // unused in NDEBUG
2574  if (bBroadcast) {
2575  const SwStringMsgPoolItem aNew( RES_NAME_CHANGED, rNewName );
2576  GetNotifier().Broadcast(sw::LegacyModifyHint( &aOld, &aNew ));
2577  }
2578  }
2579  else
2580  SwFormat::SetName( rNewName, bBroadcast );
2581 }
2582 
2584 {
2585  if( nullptr != pFormat )
2586  {
2587  assert( (Which() == RES_DRAWFRMFMT && pFormat->Which() == RES_FLYFRMFMT)
2588  || (Which() == RES_FLYFRMFMT && pFormat->Which() == RES_DRAWFRMFMT) );
2589  assert( nullptr == m_pOtherTextBoxFormat );
2590  }
2591  else
2592  {
2593  assert( nullptr != m_pOtherTextBoxFormat );
2594  }
2595  bool bChanged = m_pOtherTextBoxFormat != pFormat;
2596  m_pOtherTextBoxFormat = pFormat;
2597 
2598  SdrObject* pObj = FindSdrObject();
2599 
2600  if (pObj)
2601  {
2602  SwFlyDrawObj* pSwFlyDraw = dynamic_cast<SwFlyDrawObj*>(pObj);
2603 
2604  if (pSwFlyDraw)
2605  pSwFlyDraw->SetTextBox(true);
2606  }
2607 
2608  if (m_pOtherTextBoxFormat && bChanged && Which() == RES_DRAWFRMFMT)
2609  {
2610  // This is a shape of a shape+frame pair and my frame has changed. Make sure my content is
2611  // in sync with the frame's content.
2613  {
2614  SwAttrSet aSet(GetAttrSet());
2616  aSet.Put(aContent);
2617  SetFormatAttr(aSet);
2618  }
2619  }
2620 }
2621 
2623 {
2624  return true;
2625 }
2626 
2627 void SwFrameFormat::SwClientNotify(const SwModify& rMod, const SfxHint& rHint)
2628 {
2629  if (rHint.GetId() != SfxHintId::SwLegacyModify)
2630  return;
2631  auto pLegacy = static_cast<const sw::LegacyModifyHint*>(&rHint);
2632  const sal_uInt16 nNewWhich = pLegacy->m_pNew ? pLegacy->m_pNew->Which() : 0;
2633  const SwAttrSetChg* pNewAttrSetChg = nullptr;
2634  const SwFormatHeader* pH = nullptr;
2635  const SwFormatFooter* pF = nullptr;
2636  const SwPosition* pNewAnchorPosition = nullptr;
2637  switch(nNewWhich)
2638  {
2639  case RES_ATTRSET_CHG:
2640  {
2641  pNewAttrSetChg = static_cast<const SwAttrSetChg*>(pLegacy->m_pNew);
2642  pH = pNewAttrSetChg->GetChgSet()->GetItem(RES_HEADER, false);
2643  pF = pNewAttrSetChg->GetChgSet()->GetItem(RES_FOOTER, false);
2644 
2645  // reset fill information
2647  {
2648  SfxItemIter aIter(*pNewAttrSetChg->GetChgSet());
2649  for(const SfxPoolItem* pItem = aIter.GetCurItem(); pItem; pItem = aIter.NextItem())
2650  {
2651  if(!IsInvalidItem(pItem) && pItem->Which() >= XATTR_FILL_FIRST && pItem->Which() <= XATTR_FILL_LAST)
2652  {
2653  maFillAttributes.reset();
2654  break;
2655  }
2656  }
2657  }
2658  const SwFormatAnchor* pAnchor = pNewAttrSetChg->GetChgSet()->GetItem(RES_ANCHOR, false);
2659  if(pAnchor)
2660  {
2661  pNewAnchorPosition = pAnchor->GetContentAnchor();
2662  assert(pNewAnchorPosition == nullptr || // style's set must not contain position!
2663  pNewAttrSetChg->GetTheChgdSet() == &m_aSet);
2664  }
2665  break;
2666  }
2667  case RES_FMT_CHG:
2668  {
2669  // reset fill information on format change (e.g. style changed)
2671  maFillAttributes.reset();
2672  break;
2673  }
2674  case RES_HEADER:
2675  pH = static_cast<const SwFormatHeader*>(pLegacy->m_pNew);
2676  break;
2677  case RES_FOOTER:
2678  pF = static_cast<const SwFormatFooter*>(pLegacy->m_pNew);
2679  break;
2680  case RES_ANCHOR:
2681  pNewAnchorPosition = static_cast<const SwFormatAnchor*>(pLegacy->m_pNew)->GetContentAnchor();
2682  break;
2683  }
2684  const sal_uInt16 nOldWhich = pLegacy->m_pOld ? pLegacy->m_pOld->Which() : 0;
2685  const SwPosition* pOldAnchorPosition = nullptr;
2686  switch(nOldWhich)
2687  {
2688  case RES_ATTRSET_CHG:
2689  {
2690  const SwAttrSetChg* pOldAttrSetChg = nullptr;
2691  pOldAttrSetChg = static_cast<const SwAttrSetChg*>(pLegacy->m_pOld);
2692  const SwFormatAnchor* pAnchor = pOldAttrSetChg->GetChgSet()->GetItem(RES_ANCHOR, false);
2693  if(pAnchor)
2694  {
2695  pOldAnchorPosition = pAnchor->GetContentAnchor();
2696  assert(pOldAnchorPosition == nullptr || // style's set must not contain position!
2697  pOldAttrSetChg->GetTheChgdSet() == &m_aSet);
2698  }
2699  break;
2700  }
2701  case RES_ANCHOR:
2702  pOldAnchorPosition = static_cast<const SwFormatAnchor*>(pLegacy->m_pOld)->GetContentAnchor();
2703  break;
2704  case RES_REMOVE_UNO_OBJECT:
2705  SetXObject(uno::Reference<uno::XInterface>(nullptr));
2706  break;
2707  }
2708 
2709  assert(nOldWhich == nNewWhich || !nOldWhich || !nNewWhich);
2710  if(pH && pH->IsActive() && !pH->GetHeaderFormat())
2711  { //If he doesn't have one, I'll add one
2712  SwFrameFormat* pFormat = GetDoc()->getIDocumentLayoutAccess().MakeLayoutFormat(RndStdIds::HEADER, nullptr);
2713  const_cast<SwFormatHeader*>(pH)->RegisterToFormat(*pFormat);
2714  }
2715  if(pF && pF->IsActive() && !pF->GetFooterFormat())
2716  { //If he doesn't have one, I'll add one
2717  SwFrameFormat* pFormat = GetDoc()->getIDocumentLayoutAccess().MakeLayoutFormat(RndStdIds::FOOTER, nullptr);
2718  const_cast<SwFormatFooter*>(pF)->RegisterToFormat(*pFormat);
2719  }
2720  SwFormat::SwClientNotify(rMod, rHint);
2721  if(pOldAnchorPosition != nullptr && (pNewAnchorPosition == nullptr || pOldAnchorPosition->nNode.GetIndex() != pNewAnchorPosition->nNode.GetIndex()))
2722  pOldAnchorPosition->nNode.GetNode().RemoveAnchoredFly(this);
2723  if(pNewAnchorPosition != nullptr && (pOldAnchorPosition == nullptr || pOldAnchorPosition->nNode.GetIndex() != pNewAnchorPosition->nNode.GetIndex()))
2724  pNewAnchorPosition->nNode.GetNode().AddAnchoredFly(this);
2725 }
2726 
2728 {
2729  rFormat.Add( this );
2730 }
2731 
2734 {
2735  SwIterator<SwFrame,SwFormat> aIter( *this );
2736  SwFrame * pLast = aIter.First();
2737  if( pLast )
2738  do {
2739  pLast->Cut();
2740  SwFrame::DestroyFrame(pLast);
2741  } while( nullptr != ( pLast = aIter.Next() ));
2742 }
2743 
2745 {
2746  assert(false); // unimplemented in base class
2747 }
2748 
2749 SwRect SwFrameFormat::FindLayoutRect( const bool bPrtArea, const Point* pPoint ) const
2750 {
2751  SwRect aRet;
2752  SwFrame *pFrame = nullptr;
2753  if( auto pSectionFormat = dynamic_cast<const SwSectionFormat*>( this ))
2754  {
2755  // get the Frame using Node2Layout
2756  const SwSectionNode* pSectNd = pSectionFormat->GetSectionNode();
2757  if( pSectNd )
2758  {
2759  SwNode2Layout aTmp( *pSectNd, pSectNd->GetIndex() - 1 );
2760  pFrame = aTmp.NextFrame();
2761 
2762  if( pFrame && !pFrame->KnowsFormat(*this) )
2763  {
2764  // the Section doesn't have his own Frame, so if someone
2765  // needs the real size, we have to implement this by requesting
2766  // the matching Frame from the end.
2767  // PROBLEM: what happens if SectionFrames overlaps multiple
2768  // pages?
2769  if( bPrtArea )
2770  aRet = pFrame->getFramePrintArea();
2771  else
2772  {
2773  aRet = pFrame->getFrameArea();
2774  aRet.Pos().AdjustY( -1 );
2775  }
2776  pFrame = nullptr; // the rect is finished by now
2777  }
2778  }
2779  }
2780  else
2781  {
2782  const SwFrameType nFrameType = RES_FLYFRMFMT == Which() ? SwFrameType::Fly : FRM_ALL;
2783  std::pair<Point, bool> tmp;
2784  if (pPoint)
2785  {
2786  tmp.first = *pPoint;
2787  tmp.second = false;
2788  }
2789  pFrame = ::GetFrameOfModify(nullptr, *this, nFrameType, nullptr, pPoint ? &tmp : nullptr);
2790  }
2791 
2792  if( pFrame )
2793  {
2794  if( bPrtArea )
2795  aRet = pFrame->getFramePrintArea();
2796  else
2797  aRet = pFrame->getFrameArea();
2798  }
2799  return aRet;
2800 }
2801 
2803 {
2804  if( RES_FLYFRMFMT == Which() )
2805  {
2806  Point aNullPt;
2807  std::pair<Point, bool> const tmp(aNullPt, false);
2808  SwFlyFrame* pFly = static_cast<SwFlyFrame*>(::GetFrameOfModify( nullptr, *this, SwFrameType::Fly,
2809  nullptr, &tmp));
2810  return pFly ? pFly->GetVirtDrawObj() : nullptr;
2811  }
2812  return FindSdrObject();
2813 }
2814 
2815 bool SwFrameFormat::IsLowerOf( const SwFrameFormat& rFormat ) const
2816 {
2817  //Also linking from inside to outside or from outside to inside is not
2818  //allowed.
2820  if( pSFly )
2821  {
2822  SwFlyFrame *pAskFly = SwIterator<SwFlyFrame,SwFormat>(rFormat).First();
2823  if( pAskFly )
2824  return pSFly->IsLowerOf( pAskFly );
2825  }
2826 
2827  // let's try it using the node positions
2828  const SwFormatAnchor* pAnchor = &rFormat.GetAnchor();
2829  if ((RndStdIds::FLY_AT_PAGE != pAnchor->GetAnchorId()) && pAnchor->GetContentAnchor())
2830  {
2831  const SwFrameFormats& rFormats = *GetDoc()->GetSpzFrameFormats();
2832  const SwNode* pFlyNd = pAnchor->GetContentAnchor()->nNode.GetNode().
2833  FindFlyStartNode();
2834  while( pFlyNd )
2835  {
2836  // then we walk up using the anchor
2837  size_t n;
2838  for( n = 0; n < rFormats.size(); ++n )
2839  {
2840  const SwFrameFormat* pFormat = rFormats[ n ];
2841  const SwNodeIndex* pIdx = pFormat->GetContent().GetContentIdx();
2842  if( pIdx && pFlyNd == &pIdx->GetNode() )
2843  {
2844  if( pFormat == this )
2845  return true;
2846 
2847  pAnchor = &pFormat->GetAnchor();
2848  if ((RndStdIds::FLY_AT_PAGE == pAnchor->GetAnchorId()) ||
2849  !pAnchor->GetContentAnchor() )
2850  {
2851  return false;
2852  }
2853 
2854  pFlyNd = pAnchor->GetContentAnchor()->nNode.GetNode().
2855  FindFlyStartNode();
2856  break;
2857  }
2858  }
2859  if( n >= rFormats.size() )
2860  {
2861  OSL_ENSURE( false, "Fly section but no format found" );
2862  return false;
2863  }
2864  }
2865  }
2866  return false;
2867 }
2868 
2869 // #i31698#
2871 {
2872  return SwFrameFormat::HORI_L2R;
2873 }
2874 
2876 {
2877  // empty body, because default implementation does nothing
2878 }
2879 
2880 // #i28749#
2882 {
2883  return text::PositionLayoutDir::PositionInLayoutDirOfAnchor;
2884 }
2886 {
2887  // empty body, because default implementation does nothing
2888 }
2889 
2891 {
2892  return SwResId(STR_FRAME);
2893 }
2894 
2896 {
2897  (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwFrameFormat"));
2898  (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", this);
2899  (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("name"), BAD_CAST(GetName().toUtf8().getStr()));
2900  (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("whichId"), "%d", Which());
2901 
2902  const char* pWhich = nullptr;
2903  switch (Which())
2904  {
2905  case RES_FLYFRMFMT:
2906  pWhich = "fly frame format";
2907  break;
2908  case RES_DRAWFRMFMT:
2909  pWhich = "draw frame format";
2910  break;
2911  }
2912  if (pWhich)
2913  (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("which"), BAD_CAST(pWhich));
2914 
2916  {
2917  (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("OtherTextBoxFormat"), "%p", m_pOtherTextBoxFormat);
2918  }
2919 
2920  GetAttrSet().dumpAsXml(pWriter);
2921 
2922  if (const SdrObject* pSdrObject = FindSdrObject())
2923  pSdrObject->dumpAsXml(pWriter);
2924 
2925  (void)xmlTextWriterEndElement(pWriter);
2926 }
2927 
2928 void SwFrameFormats::dumpAsXml(xmlTextWriterPtr pWriter, const char* pName) const
2929 {
2930  (void)xmlTextWriterStartElement(pWriter, BAD_CAST(pName));
2931  for (const SwFrameFormat *pFormat : m_PosIndex)
2932  pFormat->dumpAsXml(pWriter);
2933  (void)xmlTextWriterEndElement(pWriter);
2934 }
2935 
2936 
2937 SwFlyFrameFormat::SwFlyFrameFormat( SwAttrPool& rPool, const OUString &rFormatNm, SwFrameFormat *pDrvdFrame )
2938  : SwFrameFormat( rPool, rFormatNm, pDrvdFrame, RES_FLYFRMFMT )
2939 {}
2940 
2942 {
2943  SwIterator<SwFlyFrame,SwFormat> aIter( *this );
2944  SwFlyFrame * pLast = aIter.First();
2945  if( pLast )
2946  do
2947  {
2948  SwFrame::DestroyFrame(pLast);
2949  } while( nullptr != ( pLast = aIter.Next() ));
2950 
2951 }
2952 
2954 {
2955  if(!m_pContact)
2956  {
2957  SwDrawModel* pDrawModel(GetDoc()->getIDocumentDrawModelAccess().GetOrCreateDrawModel());
2958  m_pContact.reset(new SwFlyDrawContact(this, *pDrawModel));
2959  }
2960 
2961  return m_pContact.get();
2962 }
2963 
2967 {
2968  // is there a layout?
2969  if( !GetDoc()->getIDocumentLayoutAccess().GetCurrentViewShell() )
2970  return;
2971 
2972  sw::BroadcastingModify *pModify = nullptr;
2973  // OD 24.07.2003 #111032# - create local copy of anchor attribute for possible changes.
2974  SwFormatAnchor aAnchorAttr( GetAnchor() );
2975  switch( aAnchorAttr.GetAnchorId() )
2976  {
2977  case RndStdIds::FLY_AS_CHAR:
2978  case RndStdIds::FLY_AT_PARA:
2979  case RndStdIds::FLY_AT_CHAR:
2980  if( aAnchorAttr.GetContentAnchor() )
2981  {
2982  pModify = aAnchorAttr.GetContentAnchor()->nNode.GetNode().GetContentNode();
2983  }
2984  break;
2985 
2986  case RndStdIds::FLY_AT_FLY:
2987  if( aAnchorAttr.GetContentAnchor() )
2988  {
2989  //First search in the content because this is O(1)
2990  //This can go wrong for linked frames because in this case it's
2991  //possible, that no Frame exists for this content.
2992  //In such a situation we also need to search from StartNode to
2993  //FrameFormat.
2994  SwNodeIndex aIdx( aAnchorAttr.GetContentAnchor()->nNode );
2995  SwContentNode *pCNd = GetDoc()->GetNodes().GoNext( &aIdx );
2996  // #i105535#
2997  if ( pCNd == nullptr )
2998  {
2999  pCNd = aAnchorAttr.GetContentAnchor()->nNode.GetNode().GetContentNode();
3000  }
3001  if ( pCNd )
3002  {
3004  {
3005  pModify = pCNd;
3006  }
3007  }
3008  // #i105535#
3009  if ( pModify == nullptr )
3010  {
3011  const SwNodeIndex &rIdx = aAnchorAttr.GetContentAnchor()->nNode;
3012  SwFrameFormats& rFormats = *GetDoc()->GetSpzFrameFormats();
3013  for( size_t i = 0; i < rFormats.size(); ++i )
3014  {
3015  SwFrameFormat* pFlyFormat = rFormats[i];
3016  if( pFlyFormat->GetContent().GetContentIdx() &&
3017  rIdx == *pFlyFormat->GetContent().GetContentIdx() )
3018  {
3019  pModify = pFlyFormat;
3020  break;
3021  }
3022  }
3023  }
3024  }
3025  break;
3026 
3027  case RndStdIds::FLY_AT_PAGE:
3028  {
3029  sal_uInt16 nPgNum = aAnchorAttr.GetPageNum();
3031  if( nPgNum == 0 && aAnchorAttr.GetContentAnchor() )
3032  {
3033  SwContentNode *pCNd = aAnchorAttr.GetContentAnchor()->nNode.GetNode().GetContentNode();
3035  for ( SwFrame* pFrame = aIter.First(); pFrame != nullptr; pFrame = aIter.Next() )
3036  {
3037  pPage = pFrame->FindPageFrame();
3038  if( pPage )
3039  {
3040  nPgNum = pPage->GetPhyPageNum();
3041  aAnchorAttr.SetPageNum( nPgNum );
3042  aAnchorAttr.SetAnchor( nullptr );
3043  SetFormatAttr( aAnchorAttr );
3044  break;
3045  }
3046  }
3047  }
3048  while ( pPage )
3049  {
3050  if ( pPage->GetPhyPageNum() == nPgNum )
3051  {
3052  // #i50432# - adjust synopsis of <PlaceFly(..)>
3053  pPage->PlaceFly( nullptr, this );
3054  break;
3055  }
3056  pPage = static_cast<SwPageFrame*>(pPage->GetNext());
3057  }
3058  }
3059  break;
3060  default:
3061  break;
3062  }
3063 
3064  if( !pModify )
3065  return;
3066 
3068  for( SwFrame *pFrame = aIter.First(); pFrame; pFrame = aIter.Next() )
3069  {
3070  bool bAdd = !pFrame->IsContentFrame() ||
3071  !static_cast<SwContentFrame*>(pFrame)->IsFollow();
3072 
3073  if ( RndStdIds::FLY_AT_FLY == aAnchorAttr.GetAnchorId() && !pFrame->IsFlyFrame() )
3074  {
3075  SwFrame* pFlyFrame = pFrame->FindFlyFrame();
3076  if ( pFlyFrame )
3077  {
3078  pFrame = pFlyFrame;
3079  }
3080  else
3081  {
3082  aAnchorAttr.SetType( RndStdIds::FLY_AT_PARA );
3083  SetFormatAttr( aAnchorAttr );
3084  MakeFrames();
3085  return;
3086  }
3087  }
3088 
3089  if (bAdd)
3090  {
3091  switch (aAnchorAttr.GetAnchorId())
3092  {
3093  case RndStdIds::FLY_AS_CHAR:
3094  case RndStdIds::FLY_AT_PARA:
3095  case RndStdIds::FLY_AT_CHAR:
3096  {
3097  assert(pFrame->IsTextFrame());
3098  bAdd = IsAnchoredObjShown(*static_cast<SwTextFrame*>(pFrame), aAnchorAttr);
3099  }
3100  break;
3101  default:
3102  break;
3103  }
3104  }
3105 
3106  if (bAdd && pFrame->GetDrawObjs())
3107  {
3108  // #i28701# - new type <SwSortedObjs>
3109  SwSortedObjs &rObjs = *pFrame->GetDrawObjs();
3110  for(SwAnchoredObject* pObj : rObjs)
3111  {
3112  // #i28701# - consider changed type of
3113  // <SwSortedObjs> entries.
3114  if( dynamic_cast<const SwFlyFrame*>( pObj) != nullptr &&
3115  (&pObj->GetFrameFormat()) == this )
3116  {
3117  bAdd = false;
3118  break;
3119  }
3120  }
3121  }
3122 
3123  if( bAdd )
3124  {
3125  SwFlyFrame *pFly = nullptr; // avoid warnings
3126  switch( aAnchorAttr.GetAnchorId() )
3127  {
3128  case RndStdIds::FLY_AT_FLY:
3129  pFly = new SwFlyLayFrame( this, pFrame, pFrame );
3130  break;
3131 
3132  case RndStdIds::FLY_AT_PARA:
3133  case RndStdIds::FLY_AT_CHAR:
3134  pFly = new SwFlyAtContentFrame( this, pFrame, pFrame );
3135  break;
3136 
3137  case RndStdIds::FLY_AS_CHAR:
3138  pFly = new SwFlyInContentFrame( this, pFrame, pFrame );
3139  break;
3140 
3141  default:
3142  assert(false && "New anchor type" );
3143  }
3144  pFrame->AppendFly( pFly );
3145  pFly->GetFormat()->SetObjTitle(GetObjTitle());
3147  SwPageFrame *pPage = pFly->FindPageFrame();
3148  if( pPage )
3149  ::RegistFlys( pPage, pFly );
3150  }
3151  }
3152 }
3153 
3154 SwFlyFrame* SwFlyFrameFormat::GetFrame( const Point* pPoint ) const
3155 {
3156  std::pair<Point, bool> tmp;
3157  if (pPoint)
3158  {
3159  tmp.first = *pPoint;
3160  tmp.second = false;
3161  }
3162  return static_cast<SwFlyFrame*>(::GetFrameOfModify( nullptr, *this, SwFrameType::Fly,
3163  nullptr, &tmp));
3164 }
3165 
3167 {
3168  SwFlyFrame* pFlyFrame( GetFrame() );
3169  if ( pFlyFrame )
3170  {
3171  return pFlyFrame;
3172  }
3173  else
3174  {
3175  return nullptr;
3176  }
3177 }
3178 
3180 {
3181  bool bRet = true;
3182  switch( rInfo.Which() )
3183  {
3184  case RES_CONTENT_VISIBLE:
3185  {
3186  static_cast<SwPtrMsgPoolItem&>(rInfo).pObject = SwIterator<SwFrame,SwFormat>( *this ).First();
3187  }
3188  bRet = false;
3189  break;
3190 
3191  default:
3192  bRet = SwFrameFormat::GetInfo( rInfo );
3193  break;
3194  }
3195  return bRet;
3196 }
3197 
3198 // #i73249#
3199 void SwFlyFrameFormat::SetObjTitle( const OUString& rTitle, bool bBroadcast )
3200 {
3201  SdrObject* pMasterObject = FindSdrObject();
3202  OSL_ENSURE( pMasterObject, "<SwFlyFrameFormat::SetObjTitle(..)> - missing <SdrObject> instance" );
3203  msTitle = rTitle;
3204  if ( !pMasterObject )
3205  {
3206  return;
3207  }
3208 
3209  const SwStringMsgPoolItem aOld(RES_TITLE_CHANGED, pMasterObject->GetTitle());
3210  pMasterObject->SetTitle(rTitle);
3211  if(bBroadcast)
3212  {
3213  const SwStringMsgPoolItem aNew(RES_TITLE_CHANGED, rTitle);
3214  GetNotifier().Broadcast(sw::LegacyModifyHint(&aOld, &aNew));
3215  }
3216 }
3217 
3219 {
3220  const SdrObject* pMasterObject = FindSdrObject();
3221  OSL_ENSURE( pMasterObject, "<SwFlyFrameFormat::GetObjTitle(..)> - missing <SdrObject> instance" );
3222  if ( !pMasterObject )
3223  {
3224  return msTitle;
3225  }
3226  if (!pMasterObject->GetTitle().isEmpty())
3227  return pMasterObject->GetTitle();
3228  else
3229  return msTitle;
3230 }
3231 
3232 void SwFlyFrameFormat::SetObjDescription( const OUString& rDescription, bool bBroadcast )
3233 {
3234  SdrObject* pMasterObject = FindSdrObject();
3235  OSL_ENSURE( pMasterObject, "<SwFlyFrameFormat::SetDescription(..)> - missing <SdrObject> instance" );
3236  msDesc = rDescription;
3237  if ( !pMasterObject )
3238  {
3239  return;
3240  }
3241 
3242  const SwStringMsgPoolItem aOld( RES_DESCRIPTION_CHANGED, pMasterObject->GetDescription() );
3243  pMasterObject->SetDescription( rDescription );
3244  if(bBroadcast)
3245  {
3246  const SwStringMsgPoolItem aNew( RES_DESCRIPTION_CHANGED, rDescription );
3247  GetNotifier().Broadcast(sw::LegacyModifyHint(&aOld, &aNew));
3248  }
3249 }
3250 
3252 {
3253  const SdrObject* pMasterObject = FindSdrObject();
3254  OSL_ENSURE( pMasterObject, "<SwFlyFrameFormat::GetDescription(..)> - missing <SdrObject> instance" );
3255  if ( !pMasterObject )
3256  {
3257  return msDesc;
3258  }
3259  if (!pMasterObject->GetDescription().isEmpty())
3260  return pMasterObject->GetDescription();
3261  else
3262  return msDesc;
3263 }
3264 
3275 {
3277  {
3278  return getSdrAllFillAttributesHelper()->isTransparent();
3279  }
3280 
3281  // NOTE: If background color is "no fill"/"auto fill" (COL_TRANSPARENT)
3282  // and there is no background graphic, it "inherites" the background
3283  // from its anchor.
3284  std::unique_ptr<SvxBrushItem> aBackground(makeBackgroundBrushItem());
3285  if ( aBackground &&
3286  aBackground->GetColor().IsTransparent() &&
3287  aBackground->GetColor() != COL_TRANSPARENT
3288  )
3289  {
3290  return true;
3291  }
3292  else
3293  {
3294  const GraphicObject *pTmpGrf = aBackground->GetGraphicObject();
3295  if ( pTmpGrf &&
3296  pTmpGrf->GetAttr().IsTransparent()
3297  )
3298  {
3299  return true;
3300  }
3301  }
3302 
3303  return false;
3304 }
3305 
3317 {
3319  {
3320  return !getSdrAllFillAttributesHelper()->isUsed();
3321  }
3322  else
3323  {
3324  std::unique_ptr<SvxBrushItem> aBackground(makeBackgroundBrushItem());
3325  if ( aBackground &&
3326  (aBackground->GetColor() == COL_TRANSPARENT) &&
3327  !(aBackground->GetGraphicObject()) )
3328  {
3329  return true;
3330  }
3331  }
3332 
3333  return false;
3334 }
3335 
3337  const SwFormatAnchor& _rNewAnchorFormat,
3338  SwFlyFrame const * _pKeepThisFlyFrame )
3339  : mrFlyFrameFormat( _rFlyFrameFormat ),
3340  mbAnchorNodeChanged( false ),
3341  mpWrtShell(nullptr)
3342 {
3343  const SwFormatAnchor& aOldAnchorFormat(_rFlyFrameFormat.GetAnchor());
3344  const RndStdIds nNewAnchorType( _rNewAnchorFormat.GetAnchorId() );
3345  if ( ((nNewAnchorType == RndStdIds::FLY_AT_PARA) ||
3346  (nNewAnchorType == RndStdIds::FLY_AT_CHAR)) &&
3347  _rNewAnchorFormat.GetContentAnchor() &&
3348  _rNewAnchorFormat.GetContentAnchor()->nNode.GetNode().GetContentNode() )
3349  {
3350  if ( aOldAnchorFormat.GetAnchorId() == nNewAnchorType &&
3351  aOldAnchorFormat.GetContentAnchor() &&
3352  aOldAnchorFormat.GetContentAnchor()->nNode.GetNode().GetContentNode() &&
3353  aOldAnchorFormat.GetContentAnchor()->nNode !=
3354  _rNewAnchorFormat.GetContentAnchor()->nNode )
3355  {
3356  // determine 'old' number of anchor frames
3357  sal_uInt32 nOldNumOfAnchFrame( 0 );
3359  *(aOldAnchorFormat.GetContentAnchor()->nNode.GetNode().GetContentNode()) );
3360  for( SwFrame* pOld = aOldIter.First(); pOld; pOld = aOldIter.Next() )
3361  {
3362  ++nOldNumOfAnchFrame;
3363  }
3364  // determine 'new' number of anchor frames
3365  sal_uInt32 nNewNumOfAnchFrame( 0 );
3367  *(_rNewAnchorFormat.GetContentAnchor()->nNode.GetNode().GetContentNode()) );
3368  for( SwFrame* pNew = aNewIter.First(); pNew; pNew = aNewIter.Next() )
3369  {
3370  ++nNewNumOfAnchFrame;
3371  }
3372  if ( nOldNumOfAnchFrame != nNewNumOfAnchFrame )
3373  {
3374  // delete existing fly frames except <_pKeepThisFlyFrame>
3376  SwFrame* pFrame = aIter.First();
3377  if ( pFrame )
3378  {
3379  do {
3380  if ( pFrame != _pKeepThisFlyFrame )
3381  {
3382  pFrame->Cut();
3383  SwFrame::DestroyFrame(pFrame);
3384  }
3385  } while( nullptr != ( pFrame = aIter.Next() ));
3386  }
3387  // indicate, that re-creation of fly frames necessary
3388  mbAnchorNodeChanged = true;
3389  }
3390  }
3391  }
3392 
3393  if (aOldAnchorFormat.GetContentAnchor()
3394  && aOldAnchorFormat.GetAnchorId() == RndStdIds::FLY_AT_CHAR)
3395  {
3396  mpCommentAnchor.reset(new SwPosition(*aOldAnchorFormat.GetContentAnchor()));
3397  }
3398 
3399  if (_pKeepThisFlyFrame)
3400  {
3401  SwViewShell* pViewShell = _pKeepThisFlyFrame->getRootFrame()->GetCurrShell();
3402  mpWrtShell = dynamic_cast<SwWrtShell*>(pViewShell);
3403  }
3404 }
3405 
3407 {
3408  if ( mbAnchorNodeChanged )
3409  {
3411  }
3412 
3413  // See if the fly frame had a comment: if so, move it to the new anchor as well.
3414  if (!mpCommentAnchor)
3415  {
3416  return;
3417  }
3418 
3419  SwTextNode* pTextNode = mpCommentAnchor->nNode.GetNode().GetTextNode();
3420  if (!pTextNode)
3421  {
3422  return;
3423  }
3424 
3425  const SwTextField* pField = pTextNode->GetFieldTextAttrAt(mpCommentAnchor->nContent.GetIndex());
3426  if (!pField || pField->GetFormatField().GetField()->GetTyp()->Which() != SwFieldIds::Postit)
3427  {
3428  return;
3429  }
3430 
3431  if (!mpWrtShell)
3432  {
3433  return;
3434  }
3435 
3436  // Save current cursor position, so we can restore it later.
3437  mpWrtShell->Push();
3438 
3439  // Set up the source of the move: the old comment anchor.
3440  {
3441  SwPaM& rCursor = mpWrtShell->GetCurrentShellCursor();
3442  *rCursor.GetPoint() = *mpCommentAnchor;
3443  rCursor.SetMark();
3444  *rCursor.GetMark() = *mpCommentAnchor;
3445  ++rCursor.GetMark()->nContent;
3446  }
3447 
3448  // Set up the target of the move: the new comment anchor.
3449  const SwFormatAnchor& rNewAnchorFormat = mrFlyFrameFormat.GetAnchor();
3451  *mpWrtShell->GetCurrentShellCursor().GetPoint() = *rNewAnchorFormat.GetContentAnchor();
3452 
3453  // Move by copying and deleting.
3454  mpWrtShell->SwEditShell::Copy(*mpWrtShell);
3456 
3457  mpWrtShell->Delete();
3458 
3460 }
3461 
3462 namespace sw
3463 {
3475 }
3476 
3478 {
3480 }
3481 
3483 {
3485 }
3486 
3488 {
3490 }
3491 
3492 // #i31698#
3494 {
3495  return meLayoutDir;
3496 }
3497 
3499 {
3500  meLayoutDir = _eLayoutDir;
3501 }
3502 
3503 // #i28749#
3505 {
3506  return mnPositionLayoutDir;
3507 }
3508 void SwDrawFrameFormat::SetPositionLayoutDir( const sal_Int16 _nPositionLayoutDir )
3509 {
3510  switch ( _nPositionLayoutDir )
3511  {
3512  case text::PositionLayoutDir::PositionInHoriL2R:
3513  case text::PositionLayoutDir::PositionInLayoutDirOfAnchor:
3514  {
3515  mnPositionLayoutDir = _nPositionLayoutDir;
3516  }
3517  break;
3518  default:
3519  {
3520  OSL_FAIL( "<SwDrawFrameFormat::SetPositionLayoutDir(..)> - invalid attribute value." );
3521  }
3522  }
3523 }
3524 
3526 {
3527  OUString aResult;
3528  const SdrObject * pSdrObj = FindSdrObject();
3529 
3530  if (pSdrObj)
3531  {
3532  if (pSdrObj != m_pSdrObjectCached)
3533  {
3535  m_pSdrObjectCached = pSdrObj;
3536  }
3537 
3538  aResult = m_sSdrObjectCachedComment;
3539  }
3540  else
3541  aResult = SwResId(STR_GRAPHIC);
3542 
3543  return aResult;
3544 }
3545 
3547  const SwFlyFrame *pFly ) const
3548 {
3549  const SwFormatURL &rURL = GetURL();
3550  if( !rURL.GetMap() )
3551  return nullptr;
3552 
3553  if( !pFly )
3554  {
3555  pFly = SwIterator<SwFlyFrame,SwFormat>( *this ).First();
3556  if( !pFly )
3557  return nullptr;
3558  }
3559 
3560  //Original size for OLE and graphic is TwipSize, otherwise the size of
3561  //FrameFormat of the Fly.
3562  const SwFrame *pRef;
3563  const SwNoTextNode *pNd = nullptr;
3564  Size aOrigSz;
3565  if( pFly->Lower() && pFly->Lower()->IsNoTextFrame() )
3566  {
3567  pRef = pFly->Lower();
3568  pNd = static_cast<const SwNoTextFrame*>(pRef)->GetNode()->GetNoTextNode();
3569  aOrigSz = pNd->GetTwipSize();
3570  }
3571  else
3572  {
3573  pRef = pFly;
3574  aOrigSz = pFly->GetFormat()->GetFrameSize().GetSize();
3575  }
3576 
3577  if( !aOrigSz.IsEmpty() )
3578  {
3579  Point aPos( rPoint );
3580  Size aActSz ( pRef == pFly ? pFly->getFrameArea().SSize() : pRef->getFramePrintArea().SSize() );
3581  const MapMode aSrc ( MapUnit::MapTwip );
3582  const MapMode aDest( MapUnit::Map100thMM );
3583  aOrigSz = OutputDevice::LogicToLogic( aOrigSz, aSrc, aDest );
3584  aActSz = OutputDevice::LogicToLogic( aActSz, aSrc, aDest );
3585  aPos -= pRef->getFrameArea().Pos();
3586  aPos -= pRef->getFramePrintArea().Pos();
3587  aPos = OutputDevice::LogicToLogic( aPos, aSrc, aDest );
3588  sal_uInt32 nFlags = 0;
3589  if ( pFly != pRef && pNd->IsGrfNode() )
3590  {
3591  const MirrorGraph nMirror = pNd->GetSwAttrSet().
3592  GetMirrorGrf().GetValue();
3593  if ( MirrorGraph::Both == nMirror )
3595  else if ( MirrorGraph::Vertical == nMirror )
3596  nFlags = IMAP_MIRROR_VERT;
3597  else if ( MirrorGraph::Horizontal == nMirror )
3598  nFlags = IMAP_MIRROR_HORZ;
3599 
3600  }
3601  return const_cast<ImageMap*>(rURL.GetMap())->GetHitIMapObject( aOrigSz,
3602  aActSz, aPos, nFlags );
3603  }
3604 
3605  return nullptr;
3606 }
3607 
3609 {
3611  {
3612  // create FillAttributes on demand
3613  if(!maFillAttributes)
3614  {
3615  const_cast< SwFrameFormat* >(this)->maFillAttributes = std::make_shared<drawinglayer::attribute::SdrAllFillAttributesHelper>(GetAttrSet());
3616  }
3617  }
3618  else
3619  {
3620  // FALLBACKBREAKHERE assert wrong usage
3621  OSL_ENSURE(false, "getSdrAllFillAttributesHelper() call only valid for RES_FLYFRMFMT and RES_FRMFMT (!)");
3622  }
3623 
3624  return maFillAttributes;
3625 }
3626 
3627 void SwFrameFormat::MoveTableBox(SwTableBox& rTableBox, const SwFrameFormat* pOldFormat)
3628 {
3629  Add(&rTableBox);
3630  if(!pOldFormat)
3631  return;
3632  const auto& rOld = pOldFormat->GetFormatAttr(RES_BOXATR_FORMAT);
3633  const auto& rNew = GetFormatAttr(RES_BOXATR_FORMAT);
3634  if(rOld != rNew)
3635  SwClientNotify(*this, sw::LegacyModifyHint(&rOld, &rNew));
3636 }
3637 
3638 
3639 namespace sw {
3640 
3642 {
3643  const SwFlyFrameFormat* pFlyFrameFormat = dynamic_cast<const SwFlyFrameFormat*>(&rFormat);
3644  if (!pFlyFrameFormat)
3645  return false;
3646  SwFlyFrame* pFlyFrame = pFlyFrameFormat->GetFrame();
3647  if (!pFlyFrame) // fdo#54648: "hidden" drawing object has no layout frame
3648  {
3649  return false;
3650  }
3651  SwPageFrame* pPageFrame = pFlyFrame->FindPageFrameOfAnchor();
3652  SwFrame* pHeader = pPageFrame->Lower();
3653  if (pHeader->GetType() == SwFrameType::Header)
3654  {
3655  const SwFrame* pFrame = pFlyFrame->GetAnchorFrame();
3656  while (pFrame)
3657  {
3658  if (pFrame == pHeader)
3659  return true;
3660  pFrame = pFrame->GetUpper();
3661  }
3662  }
3663  return false;
3664 }
3665 
3667 {
3668 #if OSL_DEBUG_LEVEL > 0 && !defined NDEBUG
3669  SwNodes const& rNodes(rDoc.GetNodes());
3670  sal_uLong const count(rNodes.Count());
3671  for (sal_uLong i = 0; i != count; ++i)
3672  {
3673  SwNode const*const pNode(rNodes[i]);
3674  std::vector<SwFrameFormat*> const & rFlys(pNode->GetAnchoredFlys());
3675  for (const auto& rpFly : rFlys)
3676  {
3677  SwFormatAnchor const& rAnchor((*rpFly).GetAnchor(false));
3678  assert(&rAnchor.GetContentAnchor()->nNode.GetNode() == pNode);
3679  }
3680  }
3681  SwFrameFormats const*const pSpzFrameFormats(rDoc.GetSpzFrameFormats());
3682  if (!pSpzFrameFormats)
3683  return;
3684 
3685  for (auto it = pSpzFrameFormats->begin(); it != pSpzFrameFormats->end(); ++it)
3686  {
3687  SwFormatAnchor const& rAnchor((**it).GetAnchor(false));
3688  if (RndStdIds::FLY_AT_PAGE == rAnchor.GetAnchorId())
3689  {
3690  assert(!rAnchor.GetContentAnchor()
3691  // for invalid documents that lack text:anchor-page-number
3692  // it may have an anchor before MakeFrames() is called
3694  }
3695  else
3696  {
3697  SwNode & rNode(rAnchor.GetContentAnchor()->nNode.GetNode());
3698  std::vector<SwFrameFormat*> const& rFlys(rNode.GetAnchoredFlys());
3699  assert(std::find(rFlys.begin(), rFlys.end(), *it) != rFlys.end());
3700  switch (rAnchor.GetAnchorId())
3701  {
3702  case RndStdIds::FLY_AT_FLY:
3703  assert(rNode.IsStartNode());
3704  break;
3705  case RndStdIds::FLY_AT_PARA:
3706  assert(rNode.IsTextNode() || rNode.IsTableNode());
3707  break;
3708  case RndStdIds::FLY_AS_CHAR:
3709  case RndStdIds::FLY_AT_CHAR:
3710  assert(rNode.IsTextNode());
3711  break;
3712  default:
3713  assert(false);
3714  break;
3715  }
3716  }
3717  }
3718 #else
3719  (void) rDoc;
3720 #endif
3721 }
3722 
3723 } // namespace sw
3724 
3725 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual ~SwFormatURL() override
Definition: atrfrm.cxx:1806
OUString AsRGBHexString() const
sal_uInt16 m_nWish
Desired width, borders included.
Definition: fmtclds.hxx:35
SwFormatAnchor & operator=(const SwFormatAnchor &)
Definition: atrfrm.cxx:1601
SwFormatSurround(css::text::WrapTextMode eNew=css::text::WrapTextMode_PARALLEL)
Definition: atrfrm.cxx:1261
const SwAttrSet * GetChgSet() const
What has changed.
Definition: hints.hxx:299
#define MID_GRID_SNAPTOCHARS
Definition: unomid.h:129
virtual ~FindSdrObjectHint() override
Definition: atrfrm.cxx:3471
bool GetValue() const
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrdesc.cxx:425
SvxNumType GetNumberingType() const
virtual ~DrawFormatLayoutCopyHint() override
Definition: atrfrm.cxx:3467
void SetTextBox(bool bIsTextBox)
Definition: dflyobj.hxx:52
Starts a section of nodes in the document model.
Definition: node.hxx:312
const sw::BroadcastingModify * GetDefinedIn() const
Query / set where attribute is anchored.
Definition: fmtpdsc.hxx:68
bool IsContour() const
Definition: fmtsrnd.hxx:53
virtual void SwClientNotify(const SwModify &, const SfxHint &) override
Definition: atrfrm.cxx:2627
const SwVirtFlyDrawObj * GetVirtDrawObj() const
Definition: fly.cxx:2783
Base class of the Writer layout elements.
Definition: frame.hxx:313
tools::Long GetWidth() const
constexpr TypedWhichId< SwFormatPageDesc > RES_PAGEDESC(93)
void dumpAsXml(xmlTextWriterPtr pWriter) const override
Definition: atrfrm.cxx:1347
SwFrameFormats * m_ffList
Definition: frmfmt.hxx:74
const ::std::optional< sal_uInt16 > & GetNumOffset() const
Definition: fmtpdsc.hxx:64
constexpr TypedWhichId< SwFormatSurround > RES_SURROUND(101)
virtual void SwClientNotify(const SwModify &, const SfxHint &rHint) override
Definition: atrfrm.cxx:678
constexpr TypedWhichId< SwFormatFillOrder > RES_FILL_ORDER(RES_FRMATR_BEGIN)
SVX_NUM_CHARS_UPPER_LETTER_N
constexpr TypedWhichId< SwStringMsgPoolItem > RES_TITLE_CHANGED(188)
sal_uLong GetIndex() const
Definition: node.hxx:291
SwFlyDrawContact * GetOrCreateContact()
Definition: atrfrm.cxx:2953
bool hasValue()
void Add(SwClient *pDepend)
Definition: calbck.cxx:173
std::unique_ptr< SwPosition > m_pContentAnchor
0 for page-bound frames.
Definition: fmtanchr.hxx:36
virtual const SwFlyFrameFormat * GetFormat() const override
Definition: fly.cxx:2877
#define MID_SURROUND_SURROUNDTYPE
Definition: unomid.h:29
SwTextGrid m_eGridType
Definition: tgrditem.hxx:39
virtual SwFormatFillOrder * Clone(SfxItemPool *pPool=nullptr) const override
"Pure virtual methods" of SfxPoolItem.
Definition: atrfrm.cxx:476
#define MID_PREFIX
Definition: unomid.h:99
void SetWidthPercentRelation(sal_Int16 n)
Definition: fmtfsize.hxx:96
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: atrfrm.cxx:1481
Marks a position in the document model.
Definition: pam.hxx:35
void dumpAsXml(xmlTextWriterPtr pWriter) const
std::vector< SwColumn > SwColumns
Definition: fmtclds.hxx:57
const SwField * GetField() const
Definition: fmtfld.hxx:110
SwContentNode * GetNode(SwPaM &rPam, bool &rbFirst, SwMoveFnCollection const &fnMove, bool const bInReadOnly, SwRootFrame const *const i_pLayout)
This function returns the next node in direction of search.
Definition: pam.cxx:823
virtual SwFormatFooter * Clone(SfxItemPool *pPool=nullptr) const override
Definition: atrfrm.cxx:571
bool IsGrfNode() const
Definition: node.hxx:657
Pagedescriptor Client of SwPageDesc that is "described" by the attribute.
Definition: fmtpdsc.hxx:35
OUString GetObjDescription() const
Definition: atrfrm.cxx:3251
sal_Int16 mnPositionLayoutDir
Definition: frmfmt.hxx:364
bool m_bActive
Only for controlling (creation of content).
Definition: fmthdft.hxx:35
bool IsOrtho() const
Definition: fmtclds.hxx:121
void SetHeight(tools::Long n)
SwFlyFrameFormat & mrFlyFrameFormat
void SetPosToggle(bool bNew)
Definition: fmtornt.hxx:96
virtual SwFrameFormat * MakeLayoutFormat(RndStdIds eRequest, const SfxItemSet *pSet)=0
bool m_bOrtho
Only if this flag is set, the setting of GutterWidth will be accompanied by a "visual rearrangement"...
Definition: fmtclds.hxx:82
SwPageDesc * GetPageDesc()
Definition: fmtpdsc.hxx:61
void setWidth(tools::Long nWidth)
void dumpAsXml(xmlTextWriterPtr pWriter, const char *pName) const
Definition: atrfrm.cxx:2928
constexpr TypedWhichId< SwTableBoxNumFormat > RES_BOXATR_FORMAT(RES_BOXATR_BEGIN)
bool IsLowerOf(const SwLayoutFrame *pUpper) const
Definition: fly.cxx:2161
virtual SwFormatURL * Clone(SfxItemPool *pPool=nullptr) const override
Definition: atrfrm.cxx:1828
virtual const SwRootFrame * GetCurrentLayout() const =0
#define IMAP_MIRROR_HORZ
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: atrfrm.cxx:1886
bool GetDisplayGrid() const
Definition: tgrditem.hxx:93
void ScaleMetrics(tools::Long lMult, tools::Long lDiv) override
Definition: atrfrm.cxx:217
sal_Int16 m_eRelation
Definition: fmtornt.hxx:69
sal_uInt16 GetBaseWidth() const
Definition: tgrditem.hxx:97
virtual ~CheckDrawFrameFormatLayerHint() override
Definition: atrfrm.cxx:3465
constexpr TypedWhichId< SwFormatHeader > RES_HEADER(96)
constexpr TypedWhichId< SwFormatChg > RES_FMT_CHG(162)
OUString msDesc
Definition: frmfmt.hxx:191
SAL_WARN_UNUSED_RESULT Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
#define MID_FRMSIZE_SIZE_TYPE
Definition: unomid.h:76
constexpr TypedWhichId< SwFormatCol > RES_COL(109)
virtual SwFormatNoBalancedColumns * Clone(SfxItemPool *pPool=nullptr) const override
"pure virtual methods" of SfxPoolItem
Definition: atrfrm.cxx:1954
constexpr TypedWhichId< SwPtrMsgPoolItem > RES_REMOVE_UNO_OBJECT(181)
virtual SwFormatLineNumber * Clone(SfxItemPool *pPool=nullptr) const override
Definition: atrfrm.cxx:2189
void SetLeft(sal_uInt16 nNew)
Definition: fmtclds.hxx:47
const_iterator find(const value_type &x) const
Definition: docfmt.cxx:2067
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: atrfrm.cxx:2146
SwNodeIndex nNode
Definition: pam.hxx:37
constexpr TypedWhichId< SwFormatFrameSize > RES_FRM_SIZE(89)
std::unique_ptr< SwPosition > mpCommentAnchor
If the fly frame has a comment, this points to the old comment anchor.
virtual SwFormatContent * Clone(SfxItemPool *pPool=nullptr) const override
Definition: atrfrm.cxx:609
sal_uInt16 char char * pDesc
virtual bool HasMetrics() const
SwFrameType GetType() const
Definition: frame.hxx:518
bool m_bRubyTextBelow
Definition: tgrditem.hxx:40
#define MID_SUFFIX
Definition: unomid.h:100
SwFrameSize m_eFrameWidthType
Definition: fmtfsize.hxx:46
virtual SwFormatCol * Clone(SfxItemPool *pPool=nullptr) const override
Definition: atrfrm.cxx:912
virtual ~GetZOrderHint() override
Definition: atrfrm.cxx:3473
#define MID_FRMSIZE_IS_SYNC_WIDTH_TO_HEIGHT
Definition: unomid.h:84
#define MID_FRMSIZE_REL_WIDTH
Definition: unomid.h:72
sal_uInt16 GetPageNum() const
Definition: fmtanchr.hxx:66
virtual Size GetTwipSize() const =0
SwFormatFillOrder(SwFillOrder=ATT_TOP_DOWN)
Definition: atrfrm.cxx:472
SwTwips GetPos() const
Definition: fmtornt.hxx:92
sal_uIntPtr sal_uLong
#define SAL_INFO_IF(condition, area, stream)
-""- and with own numberformat
Definition: fmtftntx.hxx:33
sal_Int16 m_eRelation
Definition: fmtornt.hxx:37
long Long
constexpr::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
OUString m_aFormatName
Definition: format.hxx:50
const SwRect & getFramePrintArea() const
Definition: frame.hxx:179
OUString GetDescription() const
SwRect FindLayoutRect(const bool bPrtArea=false, const Point *pPoint=nullptr) const
Definition: atrfrm.cxx:2749
#define MINLAY
Definition: swtypes.hxx:61
Color m_aColor
sal_uInt16 m_nLeft
Left border.
Definition: fmtclds.hxx:38
const SwPosition * GetMark() const
Definition: pam.hxx:209
void SetRight(sal_uInt16 nNew)
Definition: fmtclds.hxx:48
bool IsAnchoredObjShown(SwTextFrame const &rFrame, SwFormatAnchor const &rAnchor)
Definition: frmtool.cxx:1297
bool Pop(SwCursorShell::PopMode=SwCursorShell::PopMode::DeleteStack)
Definition: wrtsh1.cxx:1752
virtual void ScaleMetrics(tools::Long lMult, tools::Long lDiv)
#define MID_VERTORIENT_RELATION
Definition: unomid.h:35
#define MID_URL_HYPERLINKNAME
Definition: unomid.h:47
sal_Int64 n
virtual OUString GetDescription() const
Definition: atrfrm.cxx:2890
If text in multi-column sections should be evenly distributed.
Definition: fmtclbl.hxx:28
ByPos & m_PosIndex
Definition: doc.hxx:188
void dumpAsXml(xmlTextWriterPtr pWriter) const
Definition: atrfrm.cxx:823
#define MID_PAGEDESC_PAGENUMOFFSET
Definition: unomid.h:27
TElementType * Next()
Definition: calbck.hxx:333
const SfxPoolItem * m_pNew
Definition: calbck.hxx:75
void SetRubyHeight(sal_uInt16 nNew)
Definition: tgrditem.hxx:79
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: atrfrm.cxx:1412
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: atrfrm.cxx:312
bool SvUnoImageMap_fillImageMap(const Reference< XInterface > &xImageMap, ImageMap &rMap)
SwFormatRowSplit(bool bSplit=true)
Definition: fmtrowsplt.hxx:32
SwAnchoredObject * GetAnchoredObj() const
Definition: atrfrm.cxx:3166
#define MIN_TEXTGRID_SIZE
void dumpAsXml(xmlTextWriterPtr pWriter) const override
Definition: atrfrm.cxx:792
sal_uInt8 m_nHeightPercent
Definition: fmtfsize.hxx:49
bool GetRubyTextBelow() const
Definition: tgrditem.hxx:85
virtual ~SwFlyFrameFormat() override
Definition: atrfrm.cxx:2941
Color m_aLineColor
Color of the separator line.
Definition: fmtclds.hxx:71
#define MID_NUM_START_AT
Definition: unomid.h:96
SwNode & GetNode() const
Definition: ndindex.hxx:119
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: atrfrm.cxx:759
virtual SwFormatLayoutSplit * Clone(SfxItemPool *pPool=nullptr) const override
"pure virtual methods" of SfxPoolItem
Definition: atrfrm.cxx:1944
MirrorGraph
Definition: grfatr.hxx:31
Content, content of frame (header, footer, fly).
Definition: fmtcntnt.hxx:31
void DestroyCursor()
transform TableCursor to normal cursor, nullify Tablemode
Definition: crsrsh.cxx:152
virtual SwFormatHeader * Clone(SfxItemPool *pPool=nullptr) const override
Definition: atrfrm.cxx:521
static void DestroyFrame(SwFrame *const pFrame)
this is the only way to delete a SwFrame instance
Definition: ssfrm.cxx:384
virtual ~SwTextGridItem() override
Definition: atrfrm.cxx:2248
void Pos(const Point &rNew)
Definition: swrect.hxx:168
#define MID_SURROUND_ANCHORONLY
Definition: unomid.h:30
#define IMAP_MIRROR_VERT
Dialog to specify the properties of date form field.
const Color & GetLineColor() const
Definition: fmtclds.hxx:118
IDocumentUndoRedo & GetIDocumentUndoRedo()
Definition: doc.cxx:144
constexpr::Color COL_LIGHTGRAY(0xC0, 0xC0, 0xC0)
Of course Writer needs its own rectangles.
Definition: swrect.hxx:34
SwFrameSize m_eFrameHeightType
Definition: fmtfsize.hxx:45
SwColLineAdj m_eAdj
Line will be adjusted top, centered or bottom.
Definition: fmtclds.hxx:76
SwAttrSet m_aSet
Definition: format.hxx:51
void SetPrev(SwFlyFrameFormat *pFormat)
Definition: atrfrm.cxx:2130
#define MID_PAGEDESC_PAGEDESCNAME
Definition: unomid.h:26
SwClient * Remove(SwClient *pDepend)
Definition: calbck.cxx:226
const_iterator end() const
IDocumentContentOperations const & getIDocumentContentOperations() const
Definition: doc.cxx:315
virtual SwTextGridItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: atrfrm.cxx:2269
void SetPageNum(sal_uInt16 nNew)
Definition: fmtanchr.hxx:72
EmbeddedObjectRef * pObject
virtual ~SwDrawFrameFormat() override
Definition: atrfrm.cxx:3477
css::uno::Reference< css::uno::XInterface > SvxXTextColumns_createInstance() noexcept
virtual ~CreatePortionHint() override
Definition: atrfrm.cxx:3470
SwHandleAnchorNodeChg(SwFlyFrameFormat &_rFlyFrameFormat, const SwFormatAnchor &_rNewAnchorFormat, SwFlyFrame const *_pKeepThisFlyFrame=nullptr)
checks, if re-creation of fly frames for an anchor node change at the given fly frame format is neces...
Definition: atrfrm.cxx:3336
void SetOutside(bool bNew)
Definition: fmtsrnd.hxx:58
virtual bool GetInfo(SfxPoolItem &) const override
Definition: calbck.cxx:162
void SetContour(bool bNew)
Definition: fmtsrnd.hxx:57
#define MID_ANCHOR_PAGENUM
Definition: unomid.h:44
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: atrfrm.cxx:1844
#define MID_COLLECT
Definition: unomid.h:94
const SwFrameFormats * GetSpzFrameFormats() const
Definition: doc.hxx:744
void SetNewContentIdx(const SwNodeIndex *pIdx)
Definition: atrfrm.cxx:594
void SetDisplayGrid(bool bNew)
Definition: tgrditem.hxx:94
SfxHintId GetId() const
Value in Var-direction gives minimum (can be exceeded but not be less).
constexpr TypedWhichId< SwFlyFrameFormat > RES_FLYFRMFMT(156)
constexpr SwTwips DEF_GUTTER_WIDTH
Definition: swtypes.hxx:64
SvxBorderLineStyle GetLineStyle() const
Definition: fmtclds.hxx:116
void SetOrtho(bool bNew, sal_uInt16 nGutterWidth, sal_uInt16 nAct)
This too re-arranges columns automatically if flag is set.
Definition: atrfrm.cxx:983
const OUString & GetName() const
Definition: pagedesc.hxx:196
virtual bool operator==(const SfxPoolItem &) const override
Definition: atrfrm.cxx:1985
#define UNO_NAME_SEPARATOR_LINE_WIDTH
Definition: unoprnms.hxx:496
bool m_bPrintGrid
Definition: tgrditem.hxx:41
bool IsActive() const
Definition: fmthdft.hxx:89
sal_uInt16 GetPhyPageNum() const
Definition: pagefrm.hxx:204
void AddAnchoredFly(SwFrameFormat *)
Definition: node.cxx:2117
constexpr auto convertTwipToMm100(N n)
Used by the UI to modify the document model.
Definition: wrtsh.hxx:93
constexpr tools::Long Width() const
virtual bool operator==(SfxPoolItem const &other) const override
virtual ~SwFormatHeader() override
Definition: atrfrm.cxx:508
void SetTargetFrameName(const OUString &rStr)
Definition: fmturl.hxx:61
SvxBorderLineStyle
void SetSquaredMode(bool bNew)
Definition: tgrditem.hxx:106
constexpr TypedWhichId< SwFormatVertOrient > RES_VERT_ORIENT(102)
#define MID_FRMSIZE_HEIGHT
Definition: unomid.h:75
bool GetSnapToChars() const
Definition: tgrditem.hxx:101
wrapper class for the positioning of Writer fly frames and drawing objects
std::unique_ptr< SvxBrushItem > makeBackgroundBrushItem(bool=true) const
Definition: format.cxx:742
virtual SwFormatFootnoteAtTextEnd * Clone(SfxItemPool *pPool=nullptr) const override
Definition: atrfrm.cxx:2093
OUString m_sName
void SetRubyTextBelow(bool bNew)
Definition: tgrditem.hxx:86
constexpr TypedWhichId< SwDrawFrameFormat > RES_DRAWFRMFMT(159)
#define MID_FRMSIZE_SIZE
Definition: unomid.h:70
void SetBaseWidth(sal_uInt16 nNew)
Definition: tgrditem.hxx:98
constexpr TypedWhichId< SwFormatHoriOrient > RES_HORI_ORIENT(103)
SwIndex nContent
Definition: pam.hxx:38
virtual ~RestoreFlyAnchorHint() override
Definition: atrfrm.cxx:3469
const SwRect & getFrameArea() const
Definition: frame.hxx:178
#define SAL_MAX_UINT16
virtual ~SwFormatFooter() override
Definition: atrfrm.cxx:553
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: atrfrm.cxx:1387
void dumpAsXml(xmlTextWriterPtr pWriter) const override
Definition: atrfrm.cxx:1763
#define MID_GRID_STANDARD_MODE
Definition: unomid.h:130
void SetOtherTextBoxFormat(SwFrameFormat *pFormat)
Definition: atrfrm.cxx:2583
SwFlyFrameFormat(const SwFlyFrameFormat &rCpy)=delete
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: atrfrm.cxx:1162
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: atrfrm.cxx:1312
virtual sal_Int16 GetPositionLayoutDir() const override
Definition: atrfrm.cxx:3504
const OUString & GetName() const
Definition: format.hxx:115
void dumpAsXml(xmlTextWriterPtr pWriter) const override
Definition: atrfrm.cxx:614
Footer, for pageformats Client of FrameFormat describing the footer.
Definition: fmthdft.hxx:64
int nCount
at page or document end
Definition: fmtftntx.hxx:30
sal_uLong GetIndex() const
Definition: ndindex.hxx:152
sal_Int16 m_eWidthPercentRelation
Definition: fmtfsize.hxx:48
void dumpAsXml(xmlTextWriterPtr pWriter) const override
Definition: atrfrm.cxx:1239
#define UNO_NAME_SEPARATOR_LINE_IS_ON
Definition: unoprnms.hxx:500
SVX_NUM_ARABIC
virtual void SetName(const OUString &rNewName, bool bBroadcast=false) override
Definition: atrfrm.cxx:2560
std::shared_ptr< SdrAllFillAttributesHelper > SdrAllFillAttributesHelperPtr
Definition: format.hxx:41
bool IsAnchorOnly() const
Definition: fmtsrnd.hxx:52
static sal_Int16 lcl_IntToRelation(const uno::Any &rVal)
Definition: atrfrm.cxx:139
#define FRM_ALL
Definition: frame.hxx:101
virtual void SwClientNotify(const SwModify &, const SfxHint &) override
Definition: format.cxx:227
virtual ~CollectTextObjectsHint() override
Definition: atrfrm.cxx:3472
virtual bool operator==(const SfxPoolItem &) const override
Definition: atrfrm.cxx:1267
sal_uLong GetStartValue() const
Definition: fmtline.hxx:57
virtual void DeleteSection(SwNode *pNode)=0
Delete section containing the node.
std::vector< SwFrameFormat * > const & GetAnchoredFlys() const
Definition: node.hxx:297
#define UNO_NAME_SEPARATOR_LINE_RELATIVE_HEIGHT
Definition: unoprnms.hxx:498
const SwFormatField & GetFormatField() const
Definition: txatbase.hxx:195
OUString GetObjTitle() const
Definition: atrfrm.cxx:3218
#define MID_LINENUMBER_STARTVALUE
Definition: unomid.h:61
SwFormatFootnoteAtTextEnd(SwFootnoteEndPosEnum ePos=FTNEND_ATPGORDOCEND)
Definition: fmtftntx.hxx:87
bool IsTransparent() const
SAL_DLLPRIVATE void SetXObject(css::uno::Reference< css::uno::XInterface > const &xObject)
Definition: frmfmt.hxx:170
bool m_bSquaredMode
Definition: tgrditem.hxx:47
OUString m_sURL
SwFlyFrame * FindFlyFrame()
Definition: frame.hxx:1108
void SetColor(const Color &rCol)
Definition: tgrditem.hxx:70
void SetMap(const ImageMap *pM)
Pointer will be copied.
Definition: atrfrm.cxx:1839
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: atrfrm.cxx:1072
sal_Int16 m_eOrient
Definition: fmtornt.hxx:36
sal_Int16 m_eOrient
Definition: fmtornt.hxx:68
virtual SwFormatEndAtTextEnd * Clone(SfxItemPool *pPool=nullptr) const override
Definition: atrfrm.cxx:2100
virtual void SetPositionLayoutDir(const sal_Int16 _nPositionLayoutDir) override
Definition: atrfrm.cxx:3508
virtual bool operator==(const SfxPoolItem &) const override
"Pure virtual methods" of SfxPoolItem.
Definition: atrfrm.cxx:1810
SwColumns m_aColumns
Information concerning the columns.
Definition: fmtclds.hxx:78
bool HasMetrics() const override
Definition: atrfrm.cxx:224
sal_uInt16 m_nBaseWidth
Definition: tgrditem.hxx:45
bool IsBackgroundBrushInherited() const
SwFlyFrameFormat::IsBackgroundBrushInherited.
Definition: atrfrm.cxx:3316
sal_uInt32 m_nOrder
#i28701# - getting anchor positions ordered
Definition: fmtanchr.hxx:43
SwFormatFrameSize(SwFrameSize eSize=SwFrameSize::Variable, SwTwips nWidth=0, SwTwips nHeight=0)
Definition: atrfrm.cxx:232
const OUString & GetName() const
Definition: fmturl.hxx:71
Specific frame formats (frames, DrawObjects).
#define MID_COLUMN_SEPARATOR_LINE
Definition: unomid.h:91
#define MID_SURROUND_CONTOUR
Definition: unomid.h:31
void EndListeningAll()
Definition: calbck.cxx:137
Base class for various Writer styles.
Definition: format.hxx:46
void SetHeightPercentRelation(sal_Int16 n)
Definition: fmtfsize.hxx:94
void PlaceFly(SwFlyFrame *pFly, SwFlyFrameFormat *pFormat)
Definition: flylay.cxx:1111
sw::BroadcastingModify * m_pDefinedIn
Points to the object in which the attribute was set (ContentNode/Format).
Definition: fmtpdsc.hxx:38
bool GetAtPageRelOrientation(sal_Int16 &rOrientation, bool const isIgnorePrintArea)
Definition: atrfrm.cxx:106
ContactObject for connection between frames (or their formats respectively) in SwClient and the drawo...
Definition: dcontact.hxx:175
virtual void Cut()=0
void MoveTableBox(SwTableBox &rTableBox, const SwFrameFormat *pOldFormat)
Definition: atrfrm.cxx:3627
#define MID_FRMSIZE_WIDTH
Definition: unomid.h:74
OUString m_sTargetFrameName
Target frame for URL.
Definition: fmturl.hxx:35
#define MID_CHAIN_NEXTNAME
Definition: unomid.h:57
virtual bool IsBackgroundTransparent() const override
SwFlyFrameFormat::IsBackgroundTransparent.
Definition: atrfrm.cxx:3274
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:136
#define MID_NUM_TYPE
Definition: unomid.h:98
void dumpAsXml(xmlTextWriterPtr pWriter) const override
Definition: atrfrm.cxx:1959
struct _xmlTextWriter * xmlTextWriterPtr
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: atrfrm.cxx:2274
virtual bool operator==(const SfxPoolItem &) const override
"Pure virtual methods" of SfxPoolItem.
Definition: atrfrm.cxx:2107
sal_uInt16 char * pName
#define MID_ANCHOR_ANCHORTYPE
Definition: unomid.h:43
bool m_bIsServerMap
A ServerSideImageMap with the URL.
Definition: fmturl.hxx:41
Style of a layout element.
Definition: frmfmt.hxx:58
virtual void MakeFrames() override
Register DrawObjects in the arrays at layout.
Definition: atrfrm.cxx:3482
virtual SwFormatRowSplit * Clone(SfxItemPool *pPool=nullptr) const override
Definition: atrfrm.cxx:1949
virtual sal_uInt16 GetValueCount() const override
Definition: atrfrm.cxx:481
virtual SwPaM & GetCurrentShellCursor() override
Return the current shell cursor.
Definition: crsrsh.cxx:186
SwFormatAnchor(RndStdIds eRnd=RndStdIds::FLY_AT_PAGE, sal_uInt16 nPageNum=0)
Definition: atrfrm.cxx:1560
virtual SwFormatSurround * Clone(SfxItemPool *pPool=nullptr) const override
Definition: atrfrm.cxx:1276
#define MID_GRID_LINES
Definition: unomid.h:121
#define MID_HORIORIENT_POSITION
Definition: unomid.h:40
#define MID_URL_CLIENTMAP
Definition: unomid.h:48
bool IsEmpty() const
#define MID_GRID_BASEHEIGHT
Definition: unomid.h:122
void Broadcast(const SfxHint &rHint)
SwPaM * CreateCursor()
delete the current cursor and make the following into the current
Definition: crsrsh.cxx:124
SwTwips m_nYPos
Contains always the current RelPos.
Definition: fmtornt.hxx:35
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: atrfrm.cxx:1641
const SwFormatAnchor & GetAnchor(bool=true) const
Definition: fmtanchr.hxx:81
virtual bool operator==(const SfxPoolItem &) const override
Definition: atrfrm.cxx:240
int i
const SwColumns & GetColumns() const
Definition: fmtclds.hxx:112
#define MID_URL_URL
Definition: unomid.h:50
bool m_bCountLines
Also count lines of paragraph.
Definition: fmtline.hxx:33
virtual SwFormatVertOrient * Clone(SfxItemPool *pPool=nullptr) const override
Definition: atrfrm.cxx:1382
virtual void SetLayoutDir(const SwFrameFormat::tLayoutDir _eLayoutDir) override
Definition: atrfrm.cxx:3498
const SwFrameFormat * GetFooterFormat() const
Definition: fmthdft.hxx:85
const SwPosition * GetPoint() const
Definition: pam.hxx:207
#define MID_FRMSIZE_WIDTH_TYPE
Definition: unomid.h:86
SwFrameType
Definition: frame.hxx:73
const IDocumentLayoutAccess & getIDocumentLayoutAccess() const
Provides access to the document layout interface.
Definition: format.cxx:720
virtual SwFrameFormat::tLayoutDir GetLayoutDir() const
Definition: atrfrm.cxx:2870
RndStdIds GetAnchorId() const
Definition: fmtanchr.hxx:65
#define MID_GRID_RUBYHEIGHT
Definition: unomid.h:123
#define MID_GRID_PRINT
Definition: unomid.h:126
SwFrame * GetFrameOfModify(const SwRootFrame *pLayout, sw::BroadcastingModify const &, SwFrameType const nFrameType, const SwPosition *pPos=nullptr, std::pair< Point, bool > const *pViewPosAndCalcFrame=nullptr)
const GraphicAttr & GetAttr() const
virtual ~SwFormatPageDesc() override
Definition: atrfrm.cxx:658
virtual bool GetInfo(SfxPoolItem &rInfo) const override
Definition: atrfrm.cxx:3179
const SwPosition * GetContentAnchor() const
Definition: fmtanchr.hxx:67
SwPageFrame * FindPageFrame()
Definition: frame.hxx:679
void Push()
store a copy of the current cursor on the cursor stack
Definition: crsrsh.cxx:2243
void ParkCursor(const SwNodeIndex &rIdx)
Remove selections and additional cursors of all shells.
Definition: crsrsh.cxx:2875
constexpr TypedWhichId< SwFormatURL > RES_URL(111)
sal_uInt8 GetLineHeight() const
Definition: fmtclds.hxx:123
#define MID_VERTORIENT_POSITION
Definition: unomid.h:36
const SwFrame * Lower() const
Definition: layfrm.hxx:101
sal_uInt16 GetGutterWidth(bool bMin=false) const
Definition: atrfrm.cxx:917
TElementType * First()
Definition: calbck.hxx:325
void SetPos(SwTwips nNew)
Definition: fmtornt.hxx:60
virtual bool operator==(const SfxPoolItem &) const override
"Pure virtual methods" of SfxPoolItem.
Definition: atrfrm.cxx:665
SwContentNode * GetContentNode()
Definition: node.hxx:616
virtual SwHeaderAndFooterEatSpacingItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: atrfrm.cxx:2509
FlyAnchors.
Definition: fmtanchr.hxx:34
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: atrfrm.cxx:1995
sal_uInt16 CalcColWidth(sal_uInt16 nCol, sal_uInt16 nAct) const
Calculates current width of column nCol.
Definition: atrfrm.cxx:990
void SetWidthSizeType(SwFrameSize eSize)
Definition: fmtfsize.hxx:84
SwClient m_aNext
Next SwFlyFrameFormat (if existent).
Definition: fmtcnct.hxx:33
SwNoTextNode * GetNoTextNode()
Definition: ndnotxt.hxx:96
sal_uInt8 GetHeightPercent() const
Definition: fmtfsize.hxx:88
SwTwips m_nXPos
Contains always the current RelPos.
Definition: fmtornt.hxx:67
const SwFormatURL & GetURL(bool=true) const
Definition: fmturl.hxx:78
constexpr TypedWhichId< SwStringMsgPoolItem > RES_DESCRIPTION_CHANGED(189)
sal_uInt16 m_nPageNumber
Page number for page-bound frames.
Definition: fmtanchr.hxx:40
SwLayoutFrame * GetUpper()
Definition: frame.hxx:677
constexpr sal_uInt16 XATTR_FILL_FIRST(XATTRSET_LINE+1)
virtual void SetName(const OUString &rNewName, bool bBroadcast=false)
Definition: format.cxx:146
constexpr TypedWhichId< SwAttrSetChg > RES_ATTRSET_CHG(163)
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: atrfrm.cxx:1509
virtual void DelFrames()
Destroys all Frames in aDepend (Frames are identified via dynamic_cast).
Definition: atrfrm.cxx:2733
virtual bool operator==(const SfxPoolItem &) const override
"Pure virtual methods" of SfxPoolItem.
Definition: atrfrm.cxx:1467
OUString GetTitle() const
virtual bool operator==(const SfxPoolItem &) const override
"pure virtual methods" of SfxPoolItem
Definition: atrfrm.cxx:1617
SwFormatPageDesc(const SwPageDesc *pDesc=nullptr)
Definition: atrfrm.cxx:638
SwFrameSize GetWidthSizeType() const
Definition: fmtfsize.hxx:83
sal_Int16 m_aWidthAdjustValue
Definition: fmtclds.hxx:80
virtual sal_uInt16 GetValueCount() const override
Definition: atrfrm.cxx:1281
constexpr auto convertMm100ToTwip(N n)
sal_uInt16 m_nWidth
Total desired width of all columns.
Definition: fmtclds.hxx:79
css::text::WrapTextMode GetSurround() const
Definition: fmtsrnd.hxx:51
bool KnowsPageDesc() const
Definition: atrfrm.cxx:660
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: atrfrm.cxx:1695
void SetBaseHeight(sal_uInt16 nNew)
Definition: tgrditem.hxx:76
Connection (text flow) between two FlyFrames.
Definition: fmtcnct.hxx:31
SwFrameSize
Definition: fmtfsize.hxx:35
Marks a node in the document model.
Definition: ndindex.hxx:31
#define MID_SURROUND_CONTOUROUTSIDE
Definition: unomid.h:32
sal_uInt16 m_nLineHeight
Percentile height of lines.
Definition: fmtclds.hxx:73
static SfxPoolItem * CreateDefault()
Definition: atrfrm.cxx:137
const SwAttrSet * GetTheChgdSet() const
Where it has changed.
Definition: hints.hxx:303
static void lcl_DelHFFormat(SwClient *pToRemove, SwFrameFormat *pFormat)
Definition: atrfrm.cxx:147
SwTextField * GetFieldTextAttrAt(const sal_Int32 nIndex, const bool bIncludeInputFieldAtStart=false) const
Definition: ndtxt.cxx:1760
SwFrameFormat * m_pOtherTextBoxFormat
Definition: frmfmt.hxx:76
virtual OUString GetDescription() const override
Definition: atrfrm.cxx:3525
RndStdIds m_eAnchorId
Definition: fmtanchr.hxx:39
void SetURL(const OUString &rURL, bool bServerMap)
Definition: atrfrm.cxx:1833
#define MID_FRMSIZE_IS_AUTO_HEIGHT
Definition: unomid.h:77
const SwDoc * GetDoc() const
The document is set in SwAttrPool now, therefore you always can access it.
Definition: format.hxx:123
sal_uInt8 GetWidthPercent() const
Definition: fmtfsize.hxx:91
SAL_DLLPRIVATE void Calc(sal_uInt16 nGutterWidth, sal_uInt16 nAct)
Definition: atrfrm.cxx:1014
void SSize(const Size &rNew)
Definition: swrect.hxx:177
tools::Long GetHeight() const
void dumpAsXml(xmlTextWriterPtr pWriter) const
Definition: atrfrm.cxx:2895
SwFormatVertOrient(SwTwips nY=0, sal_Int16 eVert=css::text::VertOrientation::NONE, sal_Int16 eRel=css::text::RelOrientation::PRINT_AREA)
Definition: atrfrm.cxx:1366
void RegisterToFormat(SwFormat &rFormat)
Definition: atrfrm.cxx:559
A page of the document layout.
Definition: pagefrm.hxx:57
SVX_NUM_CHARS_LOWER_LETTER_N
void SetAnchorOnly(bool bNew)
Definition: fmtsrnd.hxx:56
virtual SwFormatFrameSize * Clone(SfxItemPool *pPool=nullptr) const override
Definition: atrfrm.cxx:252
Frame cannot be moved in Var-direction.
tools::Long SwTwips
Definition: swtypes.hxx:50
static sal_uInt16 nPgNum
Definition: viewport.cxx:52
void SetCountLines(bool b)
Definition: fmtline.hxx:61
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
Definition: doc.cxx:405
constexpr TypedWhichId< SwFormatContent > RES_CNTNT(95)
virtual SwFormatAnchor * Clone(SfxItemPool *pPool=nullptr) const override
Definition: atrfrm.cxx:1631
sal_uInt16 GetLines() const
Definition: tgrditem.hxx:72
SwFlyFrameFormat * GetNext() const
Definition: fmtcnct.hxx:54
virtual bool operator==(const SfxPoolItem &) const override
Definition: atrfrm.cxx:2252
void SetWidth(tools::Long n)
SwFieldType * GetTyp() const
Definition: fldbas.hxx:392
sal_uInt16 m_nBaseHeight
Definition: tgrditem.hxx:37
std::unique_ptr< ImageMap > m_pMap
ClientSide images.
Definition: fmturl.hxx:39
at end of the current text end
Definition: fmtftntx.hxx:31
IMapObject * GetIMapObject(const Point &rPoint, const SwFlyFrame *pFly=nullptr) const
Definition: atrfrm.cxx:3546
OUString m_sURL
Simple URL.
Definition: fmturl.hxx:36
sal_Int16 GetHeightPercentRelation() const
Definition: fmtfsize.hxx:89
const SwNodeIndex * GetContentIdx() const
Definition: fmtcntnt.hxx:46
virtual drawinglayer::attribute::SdrAllFillAttributesHelperPtr getSdrAllFillAttributesHelper() const override
Definition: atrfrm.cxx:3608
bool Delete()
Delete content of all ranges.
Definition: eddel.cxx:125
virtual ~DrawFrameFormatHint() override
Definition: atrfrm.cxx:3464
const ImageMap * GetMap() const
Definition: fmturl.hxx:68
virtual bool SetFormatAttr(const SfxPoolItem &rAttr)
Definition: format.cxx:450
void SetHeightPercent(sal_uInt8 n)
Definition: fmtfsize.hxx:93
SvtBroadcaster & GetNotifier()
Definition: calbck.hxx:99
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: atrfrm.cxx:2194
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: atrfrm.cxx:1286
SwFormatHoriOrient(SwTwips nX=0, sal_Int16 eHori=css::text::HoriOrientation::NONE, sal_Int16 eRel=css::text::RelOrientation::PRINT_AREA, bool bPos=false)
Definition: atrfrm.cxx:1458
sal_Int16 GetAdjustValue() const
Definition: fmtclds.hxx:95
SwColumn()
Definition: atrfrm.cxx:809
void dumpAsXml(xmlTextWriterPtr pWriter) const override
Definition: atrfrm.cxx:452
sal_uInt16 Which() const
for Querying of Writer-functions.
Definition: format.hxx:82
const SdrObject * m_pSdrObjectCached
Definition: frmfmt.hxx:356
sal_uInt16 GetWishWidth() const
Definition: fmtclds.hxx:122
SwFrameFormat(SwAttrPool &rPool, const char *pFormatNm, SwFrameFormat *pDrvdFrame, sal_uInt16 nFormatWhich=RES_FRMFMT, const WhichRangesContainer &pWhichRange=aFrameFormatSetRange)
Definition: atrfrm.cxx:2514
sal_uLong EndOfSectionIndex() const
Definition: node.hxx:678
virtual ~SwFormatContent() override
Definition: atrfrm.cxx:590
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
SwFormatContent(const SwStartNode *pStartNode=nullptr)
Definition: atrfrm.cxx:584
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:79
#define MID_HORIORIENT_ORIENT
Definition: unomid.h:38
bool IsFlyFrameFormatInHeader(const SwFrameFormat &rFormat)
Definition: atrfrm.cxx:3641
virtual void DelFrames() override
DrawObjects are removed from the arrays at the layout.
Definition: atrfrm.cxx:3487
SwClient m_aPrev
Previous SwFlyFrameFormat (if existent).
Definition: fmtcnct.hxx:33
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: atrfrm.cxx:2018
#define MID_FRMSIZE_REL_HEIGHT_RELATION
Definition: unomid.h:88
virtual void MakeFrames() override
Creates the views.
Definition: atrfrm.cxx:2966
bool IsPosToggle() const
Definition: fmtornt.hxx:95
SwFillOrder
Definition: fmtfordr.hxx:26
virtual ~WW8AnchorConvHint() override
Definition: atrfrm.cxx:3468
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: atrfrm.cxx:2214
constexpr TypedWhichId< SwFormatChain > RES_CHAIN(114)
sal_uInt16 GetWishWidth() const
Definition: fmtclds.hxx:50
#define UNO_NAME_AUTOMATIC_DISTANCE
Definition: unoprnms.hxx:584
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: atrfrm.cxx:2343
void SetWishWidth(sal_uInt16 nNew)
Definition: fmtclds.hxx:46
void dumpAsXml(xmlTextWriterPtr pWriter) const override
Definition: atrfrm.cxx:1447
constexpr TypedWhichId< SwTextGridItem > RES_TEXTGRID(115)
virtual ~GetObjectConnectedHint() override
Definition: atrfrm.cxx:3474
#define MID_ANCHOR_ANCHORFRAME
Definition: unomid.h:45
#define MID_CHAIN_PREVNAME
Definition: unomid.h:56
#define MID_GRID_DISPLAY
Definition: unomid.h:127
sal_uInt16 CalcPrtColWidth(sal_uInt16 nCol, sal_uInt16 nAct) const
As above except that it.
Definition: atrfrm.cxx:1004
sal_uLong m_nLineWidth
Width of the separator line.
Definition: fmtclds.hxx:70
general base class for all free-flowing frames
Definition: flyfrm.hxx:78
sal_uInt16 GetRight() const
Definition: fmtclds.hxx:52
OUString msTitle
Definition: frmfmt.hxx:190
bool IsLowerOf(const SwFrameFormat &rFormat) const
Definition: atrfrm.cxx:2815
SwPageFrame * FindPageFrameOfAnchor()
method to determine the page frame, on which the 'anchor' of the given anchored object is...
#define MID_OWN_NUM
Definition: unomid.h:97
void SwitchPaperMode(bool bNew)
Definition: atrfrm.cxx:2448
constexpr tools::Long Height() const
#define MID_VERTORIENT_ORIENT
Definition: unomid.h:34
unsigned char sal_uInt8
void SetName(const OUString &rNm)
Definition: fmturl.hxx:72
#define MID_GRID_TYPE
Definition: unomid.h:124
bool m_bSnapToChars
Definition: tgrditem.hxx:46
void SetSnapToChars(bool bNew)
Definition: tgrditem.hxx:102
SwTwips GetPos() const
Definition: fmtornt.hxx:59
SwFormatHeader(bool bOn=false)
Definition: atrfrm.cxx:501
void SetWidthPercent(sal_uInt8 n)
Definition: fmtfsize.hxx:95
const OUString & GetTargetFrameName() const
Definition: fmturl.hxx:65
#define MID_FRMSIZE_IS_SYNC_HEIGHT_TO_WIDTH
Definition: unomid.h:85
#define MID_FRMSIZE_REL_WIDTH_RELATION
Definition: unomid.h:87
virtual sal_Int16 GetPositionLayoutDir() const
Definition: atrfrm.cxx:2881
SwFormatNoBalancedColumns(bool bFlag=false)
Definition: fmtclbl.hxx:31
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: atrfrm.cxx:718
#define MID_GRID_BASEWIDTH
Definition: unomid.h:128
const Color & GetColor() const
Definition: tgrditem.hxx:69
virtual bool operator==(const SfxPoolItem &) const override
"pure virtual methods" of SfxPoolItem
Definition: atrfrm.cxx:514
bool IsNoTextFrame() const
Definition: frame.hxx:1235
virtual void MakeFrames()
Creates the views.
Definition: atrfrm.cxx:2744
static void FillProgName(const OUString &rName, OUString &rFillName, SwGetPoolIdFromName)
SwNodes & GetNodes()
Definition: doc.hxx:409
virtual bool operator==(const SfxPoolItem &) const override
"pure virtual methods" of SfxPoolItem
Definition: atrfrm.cxx:564
virtual sal_uInt16 GetValueCount() const override
Definition: atrfrm.cxx:1969
void RemoveAnchoredFly(SwFrameFormat *)
Definition: node.cxx:2126
SwHeaderAndFooterEatSpacingItem(sal_uInt16 nId=RES_HEADER_FOOTER_EAT_SPACING, bool bPrt=false)
sal_uLong GetLineWidth() const
Definition: fmtclds.hxx:117
virtual SwFormatChain * Clone(SfxItemPool *pPool=nullptr) const override
Definition: atrfrm.cxx:2122
std::unique_ptr< SwNodeIndex > m_pStartNode
Definition: fmtcntnt.hxx:33
SwFormatEditInReadonly(sal_uInt16 nId=RES_EDIT_IN_READONLY, bool bPrt=false)
Definition: fmteiro.hxx:32
const SwModify * GetRegisteredIn() const
Definition: calbck.hxx:159
static SW_DLLPUBLIC css::uno::Reference< css::text::XTextFrame > CreateXTextFrame(SwDoc &rDoc, SwFrameFormat *pFrameFormat)
Definition: unoframe.cxx:3184
void SetDescription(const OUString &rStr)
SwTableBox is one table cell in the document model.
Definition: swtable.hxx:395
void SetSize(const Size &rSize)
virtual bool operator==(const SfxPoolItem &) const override
"pure virtual methods" of SfxPoolItem
Definition: atrfrm.cxx:889
#define UNO_NAME_IS_AUTOMATIC
Definition: unoprnms.hxx:467
QPRO_FUNC_TYPE nType
const char * name
virtual bool operator==(const SfxPoolItem &) const override
"Pure virtual methods" of SfxPoolItem.
Definition: atrfrm.cxx:2181
virtual SwFormatEditInReadonly * Clone(SfxItemPool *pPool=nullptr) const override
"pure virtual method" of SfxPoolItem
Definition: atrfrm.cxx:1939
const SfxPoolItem & GetFormatAttr(sal_uInt16 nWhich, bool bInParents=true) const
If bInParents is FALSE, search only in this format for attribute.
Definition: format.cxx:369
static sal_uInt32 s_nOrderCounter
Definition: fmtanchr.hxx:44
bool operator==(const SwColumn &) const
Definition: atrfrm.cxx:816
void RegisterToFormat(SwFormat &rFormat)
Definition: atrfrm.cxx:2727
sal_uInt16 m_nLines
Definition: tgrditem.hxx:36
ColumnDescriptor.
Definition: fmtclds.hxx:33
virtual bool supportsFullDrawingLayerFillAttributeSet() const override
Definition: atrfrm.cxx:2622
bool m_bDisplayGrid
Definition: tgrditem.hxx:42
SwFormatPageDesc & operator=(const SwFormatPageDesc &rCpy)
Definition: atrfrm.cxx:645
virtual SwFrameFormat::tLayoutDir GetLayoutDir() const override
Definition: atrfrm.cxx:3493
Header, for PageFormats Client of FrameFormat describing the header.
Definition: fmthdft.hxx:33
Color m_aColor
Definition: tgrditem.hxx:35
const SwFormatFrameSize & GetFrameSize(bool=true) const
Definition: fmtfsize.hxx:104
const SwAttrSet & GetSwAttrSet() const
Does node has already its own auto-attributes? Access to SwAttrSet.
Definition: node.hxx:715
const SwFormatContent & GetContent(bool=true) const
Definition: fmtcntnt.hxx:55
virtual void CallSwClientNotify(const SfxHint &rHint) const override
Definition: calbck.cxx:326
void dumpAsXml(xmlTextWriterPtr pWriter) const override
Definition: atrfrm.cxx:1548
-""- and with own number sequence
Definition: fmtftntx.hxx:32
constexpr TypedWhichId< SwStringMsgPoolItem > RES_NAME_CHANGED(187)
void SetPos(SwTwips nNew)
Definition: fmtornt.hxx:93
#define UNO_NAME_SEPARATOR_LINE_COLOR
Definition: unoprnms.hxx:497
#define MID_HORIORIENT_PAGETOGGLE
Definition: unomid.h:41
#define MID_HORIORIENT_RELATION
Definition: unomid.h:39
SwFormatFootnoteEndAtTextEnd & operator=(const SwFormatFootnoteEndAtTextEnd &rAttr)
Definition: atrfrm.cxx:1974
sal_uInt16 GetLeft() const
Definition: fmtclds.hxx:51
void setHeight(tools::Long nHeight)
void SetType(RndStdIds nRndId)
Definition: fmtanchr.hxx:71
#define MID_FRMSIZE_REL_HEIGHT
Definition: unomid.h:71
sal_uInt16 GetNumCols() const
Definition: fmtclds.hxx:114
bool IsInDtor() const
Definition: doc.hxx:404
constexpr TypedWhichId< SwFormatFooter > RES_FOOTER(97)
Reference< XInterface > SvUnoImageMap_createInstance()
std::unique_ptr< SwFlyDrawContact > m_pContact
Definition: frmfmt.hxx:198
::std::optional< sal_uInt16 > m_oNumOffset
Offset page number.
Definition: fmtpdsc.hxx:37
ByPos::iterator iterator
#define SAL_WARN(area, stream)
void SetNext(SwFlyFrameFormat *pFormat)
Definition: atrfrm.cxx:2138
RndStdIds
SvxBorderLineStyle m_eLineStyle
style of the separator line
Definition: fmtclds.hxx:69
void SetNumOffset(const ::std::optional< sal_uInt16 > &oNum)
Definition: fmtpdsc.hxx:65
constexpr TypedWhichId< SwFormatLineNumber > RES_LINENUMBER(116)
constexpr sal_uInt16 XATTR_FILL_LAST(XATTR_FILLBACKGROUND)
sal_uInt8 m_nWidthPercent
Definition: fmtfsize.hxx:47
void SetStartValue(sal_uLong nNew)
Definition: fmtline.hxx:60
bool GetSquaredMode() const
Definition: tgrditem.hxx:105
size_t size() const
#define MID_URL_TARGET
Definition: unomid.h:51
virtual OUString GetComment() const override
SwFormatCol & operator=(const SwFormatCol &)
Definition: atrfrm.cxx:854
SwTextGrid GetGridType() const
Definition: tgrditem.hxx:81
SwSectionNode * GetSectionNode()
Definition: node.hxx:608
void RegistFlys(SwPageFrame *, const SwLayoutFrame *)
Definition: frmtool.cxx:3175
#define UNO_NAME_SEPARATOR_LINE_VERTIVAL_ALIGNMENT
Definition: unoprnms.hxx:499
void SetObjTitle(const OUString &rTitle, bool bBroadcast=false)
Definition: atrfrm.cxx:3199
virtual bool operator==(const SfxPoolItem &) const override
"Pure virtual methods" of SfxPoolItem.
Definition: atrfrm.cxx:599
virtual void SetMark()
Unless this is called, the getter method of Mark will return Point.
Definition: pam.cxx:478
bool IsOutside() const
Definition: fmtsrnd.hxx:54
#define MID_GRID_RUBY_BELOW
Definition: unomid.h:125
const SwFrame * GetAnchorFrame() const
OUString m_sName
Name of the anchor.
Definition: fmturl.hxx:37
virtual bool operator==(const SfxPoolItem &) const override
"Pure virtual methods" of SfxPoolItem.
Definition: atrfrm.cxx:1374
bool IsCount() const
Definition: fmtline.hxx:58
const SwAttrSet & GetAttrSet() const
For querying the attribute array.
Definition: format.hxx:120
#define UNO_NAME_SEPARATOR_LINE_STYLE
Definition: unoprnms.hxx:816
#define MID_URL_SERVERMAP
Definition: unomid.h:49
void SetPrintGrid(bool bNew)
Definition: tgrditem.hxx:90
void SetNumberingType(SvxNumType nSet)
SwFormatEndAtTextEnd(SwFootnoteEndPosEnum ePos=FTNEND_ATPGORDOCEND)
Definition: fmtftntx.hxx:97
Frame is variable in Var-direction.
bool IsActive() const
Definition: fmthdft.hxx:58
bool m_bActive
Definition: fmthdft.hxx:66
bool IsInvalidItem(const SfxPoolItem *pItem)
sal_uInt16 GetBaseHeight() const
Definition: tgrditem.hxx:75
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrdesc.cxx:289
void Init(sal_uInt16 nNumCols, sal_uInt16 nGutterWidth, sal_uInt16 nAct)
This function allows to (repeatedly) initialize the columns.
Definition: atrfrm.cxx:968
SwFrameFormat::tLayoutDir meLayoutDir
Definition: frmfmt.hxx:362
drawinglayer::attribute::SdrAllFillAttributesHelperPtr maFillAttributes
Definition: frmfmt.hxx:71
bool m_bPosToggle
Flip position on even pages.
Definition: fmtornt.hxx:70
OUString SwResId(std::string_view aId)
Definition: swmodule.cxx:165
virtual ~SwFormatLineNumber() override
Definition: atrfrm.cxx:2177
sal_uInt16 m_nRubyHeight
Definition: tgrditem.hxx:38
SwFlyFrameFormat * GetPrev() const
Definition: fmtcnct.hxx:53
virtual ~ContactChangedHint() override
Definition: atrfrm.cxx:3466
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
sal_Int16 m_eHeightPercentRelation
Definition: fmtfsize.hxx:50
virtual ~SwFormatAnchor() override
Definition: atrfrm.cxx:1579
virtual SwFormatPageDesc * Clone(SfxItemPool *pPool=nullptr) const override
Definition: atrfrm.cxx:673
SwViewShell * GetCurrShell() const
Definition: rootfrm.hxx:207
bool IsServerMap() const
Definition: fmturl.hxx:67
void RegisterToPageDesc(SwPageDesc &)
Definition: atrfrm.cxx:713
class for collecting anchored objects
Definition: sortedobjs.hxx:48
void SetHeightSizeType(SwFrameSize eSize)
Definition: fmtfsize.hxx:81
constexpr TypedWhichId< SwPtrMsgPoolItem > RES_CONTENT_VISIBLE(185)
virtual ~SwFrameFormat() override
Definition: atrfrm.cxx:2542
void SetGutterWidth(sal_uInt16 nNew, sal_uInt16 nAct)
Adjusts borders for columns in aColumns.
Definition: atrfrm.cxx:948
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: atrfrm.cxx:257
#define MID_GRID_COLOR
Definition: unomid.h:120
const SvEventDescription * sw_GetSupportedMacroItems()
Definition: unocoll.cxx:460
const SwFormatContent & GetContent(bool=true) const
Definition: fmtcntnt.hxx:52
SwFieldIds Which() const
Definition: fldbas.hxx:272
void SetObjDescription(const OUString &rDescription, bool bBroadcast=false)
Definition: atrfrm.cxx:3232
virtual SwFormatHoriOrient * Clone(SfxItemPool *pPool=nullptr) const override
Definition: atrfrm.cxx:1476
void SetTitle(const OUString &rStr)
SwContentNode * GoNext(SwNodeIndex *) const
Definition: nodes.cxx:1293
virtual void SetPositionLayoutDir(const sal_Int16 _nPositionLayoutDir)
Definition: atrfrm.cxx:2885
sal_Int16 GetWidthPercentRelation() const
Definition: fmtfsize.hxx:92
SdrObject * FindSdrObject()
Definition: frmfmt.hxx:138
virtual void SetLayoutDir(const SwFrameFormat::tLayoutDir _eLayoutDir)
Definition: atrfrm.cxx:2875
sal_uInt16 GetRubyHeight() const
Definition: tgrditem.hxx:78
bool GetPrintGrid() const
Definition: tgrditem.hxx:89
#define MID_RESTART_NUM
Definition: unomid.h:95
sal_uInt16 Which() const
SwRootFrame * getRootFrame()
Definition: frame.hxx:678
SdrObject * FindRealSdrObject()
Definition: atrfrm.cxx:2802
sal_Int32 GetEnumAsInt32(const css::uno::Any &rVal)
Definition: swunohelper.cxx:50
SwFormatFooter(bool bOn=false)
Definition: atrfrm.cxx:546
void RegisterToFormat(SwFormat &rFormat)
Definition: atrfrm.cxx:526
void SetGridType(SwTextGrid eNew)
Definition: tgrditem.hxx:82
constexpr TypedWhichId< SwPtrMsgPoolItem > RES_OBJECTDYING(RES_MSG_BEGIN)
const Size & GetSize() const
~SwHandleAnchorNodeChg() COVERITY_NOEXCEPT_FALSE
calls , if re-creation of fly frames is necessary.
Definition: atrfrm.cxx:3406
const SwFrameFormat * GetHeaderFormat() const
Definition: fmthdft.hxx:54
OUString m_sSdrObjectCachedComment
Definition: frmfmt.hxx:357
void SetLines(sal_uInt16 nNew)
Definition: tgrditem.hxx:73
constexpr TypedWhichId< SwFormatAnchor > RES_ANCHOR(104)
sal_uInt16 m_nRight
Right border.
Definition: fmtclds.hxx:39
bool m_bAnchorOnly
Definition: fmtsrnd.hxx:33
SwFlyFrame * GetFrame(const Point *pDocPos=nullptr) const
Definition: atrfrm.cxx:3154
const IDocumentDrawModelAccess & getIDocumentDrawModelAccess() const
Provides access to the document draw model interface.
Definition: format.cxx:718
void SetAnchor(const SwPosition *pPos)
Definition: atrfrm.cxx:1583
SwColLineAdj GetLineAdj() const
Definition: fmtclds.hxx:120
virtual ~SwFormatCol() override
Definition: atrfrm.cxx:852
#define CONVERT_TWIPS
SwFrameSize GetHeightSizeType() const
Definition: fmtfsize.hxx:80
sal_uLong m_nStartValue
Starting value for the paragraph. 0 == no starting value.
Definition: fmtline.hxx:32
const OUString & GetURL() const
Definition: fmturl.hxx:66
SwFormatLayoutSplit(bool bSplit=true)
Definition: fmtlsplt.hxx:32
void CheckAnchoredFlyConsistency(SwDoc const &rDoc)
Definition: atrfrm.cxx:3666
SwFrame * GetNext()
Definition: frame.hxx:675
Base class of the Writer document model elements.
Definition: node.hxx:80
#define MID_LINENUMBER_COUNT
Definition: unomid.h:60
typedef void(CALLTYPE *GetFuncDataPtr)(sal_uInt16 &nNo