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