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