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