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
1565 m_eAnchorId( nRnd ),
1566 m_nPageNumber( nPage ),
1567 // OD 2004-05-05 #i28701# - get always new increased order number
1568 m_nOrder( ++s_nOrderCounter )
1569{
1570 assert( m_eAnchorId == RndStdIds::FLY_AT_PARA
1571 || m_eAnchorId == RndStdIds::FLY_AS_CHAR
1572 || m_eAnchorId == RndStdIds::FLY_AT_PAGE
1573 || m_eAnchorId == RndStdIds::FLY_AT_FLY
1574 || m_eAnchorId == RndStdIds::FLY_AT_CHAR);
1575 // only FLY_AT_PAGE should have a valid page
1576 assert( m_eAnchorId == RndStdIds::FLY_AT_PAGE || nPage == 0 );
1577}
1578
1581 , m_oContentAnchor( rCpy.m_oContentAnchor )
1582 , m_eAnchorId( rCpy.m_eAnchorId )
1583 , m_nPageNumber( rCpy.m_nPageNumber )
1584 // OD 2004-05-05 #i28701# - get always new increased order number
1585 , m_nOrder( ++s_nOrderCounter )
1586{
1587}
1588
1590{
1591}
1592
1594{
1595 if (!pPos)
1596 {
1597 m_oContentAnchor.reset();
1598 return;
1599 }
1600 // anchor only to paragraphs, or start nodes in case of RndStdIds::FLY_AT_FLY
1601 // also allow table node, this is used when a table is selected and is converted to a frame by the UI
1602 assert((RndStdIds::FLY_AT_FLY == m_eAnchorId && pPos->GetNode().GetStartNode())
1603 || (RndStdIds::FLY_AT_PARA == m_eAnchorId && pPos->GetNode().GetTableNode())
1604 || pPos->GetNode().GetTextNode());
1605 // verify that the SwPosition being passed to us is not screwy
1606 assert(!pPos->nContent.GetContentNode()
1607 || &pPos->nNode.GetNode() == pPos->nContent.GetContentNode());
1608 m_oContentAnchor.emplace(*pPos);
1609 // Flys anchored AT paragraph should not point into the paragraph content
1610 if ((RndStdIds::FLY_AT_PARA == m_eAnchorId) || (RndStdIds::FLY_AT_FLY == m_eAnchorId))
1611 m_oContentAnchor->nContent.Assign( nullptr, 0 );
1612}
1613
1615{
1616 if (!m_oContentAnchor)
1617 return nullptr;
1618 if (auto pCntNd = m_oContentAnchor->nContent.GetContentNode())
1619 return const_cast<SwContentNode*>(pCntNd);
1620 return &m_oContentAnchor->nNode.GetNode();
1621}
1622
1624{
1625 SwNode* pAnchorNode = GetAnchorNode();
1626 if (pAnchorNode)
1627 return pAnchorNode->GetContentNode();
1628 return nullptr;
1629}
1630
1632{
1633 if (!m_oContentAnchor)
1634 return 0;
1635 if (m_oContentAnchor->nContent.GetContentNode())
1636 return m_oContentAnchor->nContent.GetIndex();
1637 return 0;
1638}
1639
1641{
1642 if (this != &rAnchor)
1643 {
1644 m_eAnchorId = rAnchor.m_eAnchorId;
1645 m_nPageNumber = rAnchor.m_nPageNumber;
1646 // OD 2004-05-05 #i28701# - get always new increased order number
1649 }
1650 return *this;
1651}
1652
1653bool SwFormatAnchor::operator==( const SfxPoolItem& rAttr ) const
1654{
1655 assert(SfxPoolItem::operator==(rAttr));
1656 SwFormatAnchor const& rFormatAnchor(static_cast<SwFormatAnchor const&>(rAttr));
1657 // OD 2004-05-05 #i28701# - Note: <mnOrder> hasn't to be considered.
1658 return ( m_eAnchorId == rFormatAnchor.m_eAnchorId &&
1659 m_nPageNumber == rFormatAnchor.m_nPageNumber &&
1660 // compare anchor: either both do not point into a textnode or
1661 // both do (valid m_oContentAnchor) and the positions are equal
1662 (m_oContentAnchor == rFormatAnchor.m_oContentAnchor) );
1663}
1664
1666{
1667 return new SwFormatAnchor( *this );
1668}
1669
1670// OD 2004-05-05 #i28701#
1671sal_uInt32 SwFormatAnchor::s_nOrderCounter = 0;
1672
1673// OD 2004-05-05 #i28701#
1674
1675bool SwFormatAnchor::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
1676{
1677 // here we convert always!
1678 nMemberId &= ~CONVERT_TWIPS;
1679 bool bRet = true;
1680 switch ( nMemberId )
1681 {
1683
1684 text::TextContentAnchorType eRet;
1685 switch (m_eAnchorId)
1686 {
1687 case RndStdIds::FLY_AT_CHAR:
1688 eRet = text::TextContentAnchorType_AT_CHARACTER;
1689 break;
1690 case RndStdIds::FLY_AT_PAGE:
1691 eRet = text::TextContentAnchorType_AT_PAGE;
1692 break;
1693 case RndStdIds::FLY_AT_FLY:
1694 eRet = text::TextContentAnchorType_AT_FRAME;
1695 break;
1696 case RndStdIds::FLY_AS_CHAR:
1697 eRet = text::TextContentAnchorType_AS_CHARACTER;
1698 break;
1699 //case RndStdIds::FLY_AT_PARA:
1700 default:
1701 eRet = text::TextContentAnchorType_AT_PARAGRAPH;
1702 }
1703 rVal <<= eRet;
1704 break;
1705 case MID_ANCHOR_PAGENUM:
1706 rVal <<= static_cast<sal_Int16>(GetPageNum());
1707 break;
1709 {
1710 if (m_oContentAnchor && RndStdIds::FLY_AT_FLY == m_eAnchorId)
1711 {
1712 SwFrameFormat* pFormat = m_oContentAnchor->GetNode().GetFlyFormat();
1713 if(pFormat)
1714 {
1715 uno::Reference<text::XTextFrame> const xRet(
1716 SwXTextFrame::CreateXTextFrame(*pFormat->GetDoc(), pFormat));
1717 rVal <<= xRet;
1718 }
1719 }
1720 }
1721 break;
1722 default:
1723 OSL_ENSURE( false, "unknown MemberId" );
1724 bRet = false;
1725 }
1726 return bRet;
1727}
1728
1729bool SwFormatAnchor::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
1730{
1731 // here we convert always!
1732 nMemberId &= ~CONVERT_TWIPS;
1733 bool bRet = true;
1734 switch ( nMemberId )
1735 {
1737 {
1738 RndStdIds eAnchor;
1739 switch( static_cast<text::TextContentAnchorType>(SWUnoHelper::GetEnumAsInt32( rVal )) )
1740 {
1741 case text::TextContentAnchorType_AS_CHARACTER:
1742 eAnchor = RndStdIds::FLY_AS_CHAR;
1743 break;
1744 case text::TextContentAnchorType_AT_PAGE:
1745 eAnchor = RndStdIds::FLY_AT_PAGE;
1746 if( GetPageNum() > 0 )
1747 {
1748 // If the anchor type is page and a valid page number
1749 // has been set, the content position isn't required
1750 // any longer.
1751 m_oContentAnchor.reset();
1752 }
1753 break;
1754 case text::TextContentAnchorType_AT_FRAME:
1755 eAnchor = RndStdIds::FLY_AT_FLY;
1756 break;
1757 case text::TextContentAnchorType_AT_CHARACTER:
1758 eAnchor = RndStdIds::FLY_AT_CHAR;
1759 break;
1760 case text::TextContentAnchorType_AT_PARAGRAPH:
1761 eAnchor = RndStdIds::FLY_AT_PARA;
1762 break;
1763 default:
1764 eAnchor = RndStdIds::FLY_AT_PARA; // just to keep some compilers happy
1765 assert(false);
1766 }
1767 SetType( eAnchor );
1768 }
1769 break;
1770 case MID_ANCHOR_PAGENUM:
1771 {
1772 sal_Int16 nVal = 0;
1773 if((rVal >>= nVal) && nVal > 0)
1774 {
1775 if (RndStdIds::FLY_AT_PAGE == m_eAnchorId)
1776 {
1777 SetPageNum( nVal );
1778 // If the anchor type is page and a valid page number
1779 // is set, the content position has to be deleted to not
1780 // confuse the layout (frmtool.cxx). However, if the
1781 // anchor type is not page, any content position will
1782 // be kept.
1783 m_oContentAnchor.reset();
1784 }
1785 else
1786 {
1787 assert(false && "cannot set page number on this anchor type");
1788 bRet = false;
1789 }
1790 }
1791 else
1792 bRet = false;
1793 }
1794 break;
1796 //no break here!;
1797 default:
1798 OSL_ENSURE( false, "unknown MemberId" );
1799 bRet = false;
1800 }
1801 return bRet;
1802}
1803
1805{
1806 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwFormatAnchor"));
1807 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr()));
1808
1809 if (m_oContentAnchor)
1810 {
1811 std::stringstream aContentAnchor;
1812 aContentAnchor << *m_oContentAnchor;
1813 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("m_pContentAnchor"), BAD_CAST(aContentAnchor.str().c_str()));
1814 }
1815 else
1816 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("m_pContentAnchor"), BAD_CAST("(nil)"));
1817 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("m_eAnchorType"), BAD_CAST(OString::number(static_cast<int>(m_eAnchorId)).getStr()));
1818 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("m_nPageNumber"), BAD_CAST(OString::number(m_nPageNumber).getStr()));
1819 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("m_nOrder"), BAD_CAST(OString::number(m_nOrder).getStr()));
1820 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("s_nOrderCounter"), BAD_CAST(OString::number(s_nOrderCounter).getStr()));
1821 OUString aPresentation;
1822 IntlWrapper aIntlWrapper(SvtSysLocale().GetUILanguageTag());
1823 GetPresentation(SfxItemPresentation::Nameless, MapUnit::Map100thMM, MapUnit::Map100thMM, aPresentation, aIntlWrapper);
1824 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("presentation"), BAD_CAST(aPresentation.toUtf8().getStr()));
1825
1826 (void)xmlTextWriterEndElement(pWriter);
1827}
1828
1829// Partially implemented inline in hxx
1832 m_bIsServerMap( false )
1833{
1834}
1835
1838 m_sTargetFrameName( rURL.GetTargetFrameName() ),
1839 m_sURL( rURL.GetURL() ),
1840 m_sName( rURL.GetName() ),
1841 m_bIsServerMap( rURL.IsServerMap() )
1842{
1843 if (rURL.GetMap())
1844 m_pMap.reset( new ImageMap( *rURL.GetMap() ) );
1845}
1846
1848{
1849}
1850
1851bool SwFormatURL::operator==( const SfxPoolItem &rAttr ) const
1852{
1853 assert(SfxPoolItem::operator==(rAttr));
1854 const SwFormatURL &rCmp = static_cast<const SwFormatURL&>(rAttr);
1855 bool bRet = m_bIsServerMap == rCmp.IsServerMap() &&
1856 m_sURL == rCmp.GetURL() &&
1858 m_sName == rCmp.GetName();
1859 if ( bRet )
1860 {
1861 if ( m_pMap && rCmp.GetMap() )
1862 bRet = *m_pMap == *rCmp.GetMap();
1863 else
1864 bRet = m_pMap.get() == rCmp.GetMap();
1865 }
1866 return bRet;
1867}
1868
1870{
1871 return new SwFormatURL( *this );
1872}
1873
1874void SwFormatURL::SetURL(const OUString &rURL, bool bServerMap)
1875{
1876 m_sURL = rURL;
1877 m_bIsServerMap = bServerMap;
1878}
1879
1881{
1882 m_pMap.reset( pM ? new ImageMap( *pM ) : nullptr);
1883}
1884
1885bool SwFormatURL::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
1886{
1887 // here we convert always!
1888 nMemberId &= ~CONVERT_TWIPS;
1889 bool bRet = true;
1890 switch ( nMemberId )
1891 {
1892 case MID_URL_URL:
1893 rVal <<= GetURL();
1894 break;
1895 case MID_URL_TARGET:
1896 rVal <<= GetTargetFrameName();
1897 break;
1899 rVal <<= GetName();
1900 break;
1901 case MID_URL_CLIENTMAP:
1902 {
1903 uno::Reference< uno::XInterface > xInt;
1904 if(m_pMap)
1905 {
1907 }
1908 else
1909 {
1910 ImageMap aEmptyMap;
1912 }
1913 uno::Reference< container::XIndexContainer > xCont(xInt, uno::UNO_QUERY);
1914 rVal <<= xCont;
1915 }
1916 break;
1917 case MID_URL_SERVERMAP:
1918 rVal <<= IsServerMap();
1919 break;
1920 default:
1921 OSL_ENSURE( false, "unknown MemberId" );
1922 bRet = false;
1923 }
1924 return bRet;
1925}
1926
1927bool SwFormatURL::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
1928{
1929 // here we convert always!
1930 nMemberId &= ~CONVERT_TWIPS;
1931 bool bRet = true;
1932 switch ( nMemberId )
1933 {
1934 case MID_URL_URL:
1935 {
1936 OUString sTmp;
1937 rVal >>= sTmp;
1938 SetURL( sTmp, m_bIsServerMap );
1939 }
1940 break;
1941 case MID_URL_TARGET:
1942 {
1943 OUString sTmp;
1944 rVal >>= sTmp;
1945 SetTargetFrameName( sTmp );
1946 }
1947 break;
1949 {
1950 OUString sTmp;
1951 rVal >>= sTmp;
1952 SetName( sTmp );
1953 }
1954 break;
1955 case MID_URL_CLIENTMAP:
1956 {
1957 uno::Reference<container::XIndexContainer> xCont;
1958 if(!rVal.hasValue())
1959 m_pMap.reset();
1960 else if(rVal >>= xCont)
1961 {
1962 if(!m_pMap)
1963 m_pMap.reset(new ImageMap);
1964 bRet = SvUnoImageMap_fillImageMap( xCont, *m_pMap );
1965 }
1966 else
1967 bRet = false;
1968 }
1969 break;
1970 case MID_URL_SERVERMAP:
1971 m_bIsServerMap = *o3tl::doAccess<bool>(rVal);
1972 break;
1973 default:
1974 OSL_ENSURE( false, "unknown MemberId" );
1975 bRet = false;
1976 }
1977 return bRet;
1978}
1979
1981{
1982 return new SwFormatEditInReadonly( *this );
1983}
1984
1986{
1987 return new SwFormatLayoutSplit( *this );
1988}
1989
1991{
1992 return new SwFormatRowSplit( *this );
1993}
1994
1996{
1997 return new SwFormatNoBalancedColumns( *this );
1998}
1999
2001{
2002 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwFormatNoBalancedColumns"));
2003 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr()));
2004 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"), BAD_CAST(OString::boolean(GetValue()).getStr()));
2005 (void)xmlTextWriterEndElement(pWriter);
2006}
2007
2008// class SwFormatFootnoteEndAtTextEnd
2009
2011{
2012 return sal_uInt16( FTNEND_ATTXTEND_END );
2013}
2014
2016 const SwFormatFootnoteEndAtTextEnd& rAttr )
2017{
2019 m_aFormat = rAttr.m_aFormat;
2020 m_nOffset = rAttr.m_nOffset;
2021 m_sPrefix = rAttr.m_sPrefix;
2022 m_sSuffix = rAttr.m_sSuffix;
2023 return *this;
2024}
2025
2027{
2028 const SwFormatFootnoteEndAtTextEnd& rAttr = static_cast<const SwFormatFootnoteEndAtTextEnd&>(rItem);
2029 return SfxEnumItem::operator==( rItem ) &&
2031 m_nOffset == rAttr.m_nOffset &&
2032 m_sPrefix == rAttr.m_sPrefix &&
2033 m_sSuffix == rAttr.m_sSuffix;
2034}
2035
2037{
2038 nMemberId &= ~CONVERT_TWIPS;
2039 switch(nMemberId)
2040 {
2041 case MID_COLLECT :
2042 rVal <<= GetValue() >= FTNEND_ATTXTEND;
2043 break;
2044 case MID_RESTART_NUM :
2045 rVal <<= GetValue() >= FTNEND_ATTXTEND_OWNNUMSEQ;
2046 break;
2047 case MID_NUM_START_AT: rVal <<= static_cast<sal_Int16>(m_nOffset); break;
2048 case MID_OWN_NUM :
2050 break;
2051 case MID_NUM_TYPE : rVal <<= static_cast<sal_Int16>(m_aFormat.GetNumberingType()); break;
2052 case MID_PREFIX : rVal <<= m_sPrefix; break;
2053 case MID_SUFFIX : rVal <<= m_sSuffix; break;
2054 default: return false;
2055 }
2056 return true;
2057}
2058
2060{
2061 bool bRet = true;
2062 nMemberId &= ~CONVERT_TWIPS;
2063 switch(nMemberId)
2064 {
2065 case MID_COLLECT :
2066 {
2067 bool bVal = *o3tl::doAccess<bool>(rVal);
2068 if(!bVal && GetValue() >= FTNEND_ATTXTEND)
2070 else if(bVal && GetValue() < FTNEND_ATTXTEND)
2072 }
2073 break;
2074 case MID_RESTART_NUM :
2075 {
2076 bool bVal = *o3tl::doAccess<bool>(rVal);
2077 if(!bVal && GetValue() >= FTNEND_ATTXTEND_OWNNUMSEQ)
2079 else if(bVal && GetValue() < FTNEND_ATTXTEND_OWNNUMSEQ)
2081 }
2082 break;
2083 case MID_NUM_START_AT:
2084 {
2085 sal_Int16 nVal = 0;
2086 rVal >>= nVal;
2087 if(nVal >= 0)
2088 m_nOffset = nVal;
2089 else
2090 bRet = false;
2091 }
2092 break;
2093 case MID_OWN_NUM :
2094 {
2095 bool bVal = *o3tl::doAccess<bool>(rVal);
2096 if(!bVal && GetValue() >= FTNEND_ATTXTEND_OWNNUMANDFMT)
2098 else if(bVal && GetValue() < FTNEND_ATTXTEND_OWNNUMANDFMT)
2100 }
2101 break;
2102 case MID_NUM_TYPE :
2103 {
2104 sal_Int16 nVal = 0;
2105 rVal >>= nVal;
2106 if(nVal >= 0 &&
2107 (nVal <= SVX_NUM_ARABIC ||
2110 m_aFormat.SetNumberingType(static_cast<SvxNumType>(nVal));
2111 else
2112 bRet = false;
2113 }
2114 break;
2115 case MID_PREFIX :
2116 {
2117 OUString sVal; rVal >>= sVal;
2118 m_sPrefix = sVal;
2119 }
2120 break;
2121 case MID_SUFFIX :
2122 {
2123 OUString sVal; rVal >>= sVal;
2124 m_sSuffix = sVal;
2125 }
2126 break;
2127 default: bRet = false;
2128 }
2129 return bRet;
2130}
2131
2132// class SwFormatFootnoteAtTextEnd
2133
2135{
2136 return new SwFormatFootnoteAtTextEnd(*this);
2137}
2138
2139// class SwFormatEndAtTextEnd
2140
2142{
2143 return new SwFormatEndAtTextEnd(*this);
2144}
2145
2146//class SwFormatChain
2147
2148bool SwFormatChain::operator==( const SfxPoolItem &rAttr ) const
2149{
2150 assert(SfxPoolItem::operator==(rAttr));
2151
2152 return GetPrev() == static_cast<const SwFormatChain&>(rAttr).GetPrev() &&
2153 GetNext() == static_cast<const SwFormatChain&>(rAttr).GetNext();
2154}
2155
2158{
2159 SetPrev( rCpy.GetPrev() );
2160 SetNext( rCpy.GetNext() );
2161}
2162
2164{
2165 SwFormatChain *pRet = new SwFormatChain;
2166 pRet->SetPrev( GetPrev() );
2167 pRet->SetNext( GetNext() );
2168 return pRet;
2169}
2170
2172{
2173 if ( pFormat )
2174 pFormat->Add( &m_aPrev );
2175 else
2177}
2178
2180{
2181 if ( pFormat )
2182 pFormat->Add( &m_aNext );
2183 else
2185}
2186
2187bool SwFormatChain::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
2188{
2189 // here we convert always!
2190 nMemberId &= ~CONVERT_TWIPS;
2191 bool bRet = true;
2192 OUString aRet;
2193 switch ( nMemberId )
2194 {
2195 case MID_CHAIN_PREVNAME:
2196 if ( GetPrev() )
2197 aRet = GetPrev()->GetName();
2198 break;
2199 case MID_CHAIN_NEXTNAME:
2200 if ( GetNext() )
2201 aRet = GetNext()->GetName();
2202 break;
2203 default:
2204 OSL_ENSURE( false, "unknown MemberId" );
2205 bRet = false;
2206 }
2207 rVal <<= aRet;
2208 return bRet;
2209}
2210
2213{
2214 m_nStartValue = 0;
2215 m_bCountLines = true;
2216}
2217
2219{
2220}
2221
2223{
2224 assert(SfxPoolItem::operator==(rAttr));
2225
2226 return m_nStartValue == static_cast<const SwFormatLineNumber&>(rAttr).GetStartValue() &&
2227 m_bCountLines == static_cast<const SwFormatLineNumber&>(rAttr).IsCount();
2228}
2229
2231{
2232 return new SwFormatLineNumber( *this );
2233}
2234
2236{
2237 // here we convert always!
2238 nMemberId &= ~CONVERT_TWIPS;
2239 bool bRet = true;
2240 switch ( nMemberId )
2241 {
2243 rVal <<= IsCount();
2244 break;
2246 rVal <<= static_cast<sal_Int32>(GetStartValue());
2247 break;
2248 default:
2249 OSL_ENSURE( false, "unknown MemberId" );
2250 bRet = false;
2251 }
2252 return bRet;
2253}
2254
2256{
2257 // here we convert always!
2258 nMemberId &= ~CONVERT_TWIPS;
2259 bool bRet = true;
2260 switch ( nMemberId )
2261 {
2263 SetCountLines( *o3tl::doAccess<bool>(rVal) );
2264 break;
2266 {
2267 sal_Int32 nVal = 0;
2268 if(rVal >>= nVal)
2269 SetStartValue( nVal );
2270 else
2271 bRet = false;
2272 }
2273 break;
2274 default:
2275 OSL_ENSURE( false, "unknown MemberId" );
2276 bRet = false;
2277 }
2278 return bRet;
2279}
2280
2282 : SfxPoolItem( RES_TEXTGRID ), m_aColor( COL_LIGHTGRAY ), m_nLines( 20 )
2283 , m_nBaseHeight( 400 ), m_nRubyHeight( 200 ), m_eGridType( GRID_NONE )
2284 , m_bRubyTextBelow( false ), m_bPrintGrid( true ), m_bDisplayGrid( true )
2285 , m_nBaseWidth(400), m_bSnapToChars( true ), m_bSquaredMode(true)
2286{
2287}
2288
2290{
2291}
2292
2293bool SwTextGridItem::operator==( const SfxPoolItem& rAttr ) const
2294{
2295 assert(SfxPoolItem::operator==(rAttr));
2296 SwTextGridItem const& rOther(static_cast<SwTextGridItem const&>(rAttr));
2297 return m_eGridType == rOther.GetGridType()
2298 && m_nLines == rOther.GetLines()
2299 && m_nBaseHeight == rOther.GetBaseHeight()
2300 && m_nRubyHeight == rOther.GetRubyHeight()
2301 && m_bRubyTextBelow == rOther.GetRubyTextBelow()
2302 && m_bDisplayGrid == rOther.GetDisplayGrid()
2303 && m_bPrintGrid == rOther.GetPrintGrid()
2304 && m_aColor == rOther.GetColor()
2305 && m_nBaseWidth == rOther.GetBaseWidth()
2306 && m_bSnapToChars == rOther.GetSnapToChars()
2307 && m_bSquaredMode == rOther.GetSquaredMode();
2308}
2309
2311{
2312 return new SwTextGridItem( *this );
2313}
2314
2315bool SwTextGridItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
2316{
2317 bool bRet = true;
2318
2319 switch( nMemberId & ~CONVERT_TWIPS )
2320 {
2321 case MID_GRID_COLOR:
2322 rVal <<= GetColor();
2323 break;
2324 case MID_GRID_LINES:
2325 rVal <<= GetLines();
2326 break;
2328 rVal <<= m_bRubyTextBelow;
2329 break;
2330 case MID_GRID_PRINT:
2331 rVal <<= m_bPrintGrid;
2332 break;
2333 case MID_GRID_DISPLAY:
2334 rVal <<= m_bDisplayGrid;
2335 break;
2337 OSL_ENSURE( (nMemberId & CONVERT_TWIPS) != 0,
2338 "This value needs TWIPS-MM100 conversion" );
2339 rVal <<= static_cast<sal_Int32>(convertTwipToMm100(m_nBaseHeight));
2340 break;
2341 case MID_GRID_BASEWIDTH:
2342 OSL_ENSURE( (nMemberId & CONVERT_TWIPS) != 0,
2343 "This value needs TWIPS-MM100 conversion" );
2344 rVal <<= static_cast<sal_Int32>(convertTwipToMm100(m_nBaseWidth));
2345 break;
2347 OSL_ENSURE( (nMemberId & CONVERT_TWIPS) != 0,
2348 "This value needs TWIPS-MM100 conversion" );
2349 rVal <<= static_cast<sal_Int32>(convertTwipToMm100(m_nRubyHeight));
2350 break;
2351 case MID_GRID_TYPE:
2352 switch( GetGridType() )
2353 {
2354 case GRID_NONE:
2355 rVal <<= text::TextGridMode::NONE;
2356 break;
2357 case GRID_LINES_ONLY:
2358 rVal <<= text::TextGridMode::LINES;
2359 break;
2360 case GRID_LINES_CHARS:
2361 rVal <<= text::TextGridMode::LINES_AND_CHARS;
2362 break;
2363 default:
2364 OSL_FAIL("unknown SwTextGrid value");
2365 bRet = false;
2366 break;
2367 }
2368 break;
2370 rVal <<= m_bSnapToChars;
2371 break;
2373 rVal <<= !m_bSquaredMode;
2374 break;
2375 default:
2376 OSL_FAIL("Unknown SwTextGridItem member");
2377 bRet = false;
2378 break;
2379 }
2380
2381 return bRet;
2382}
2383
2384bool SwTextGridItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
2385{
2386 bool bRet = true;
2387 switch( nMemberId & ~CONVERT_TWIPS )
2388 {
2389 case MID_GRID_COLOR:
2390 {
2391 Color nTmp;
2392 bRet = (rVal >>= nTmp);
2393 if( bRet )
2394 SetColor( nTmp );
2395 }
2396 break;
2397 case MID_GRID_LINES:
2398 {
2399 sal_Int16 nTmp = 0;
2400 bRet = (rVal >>= nTmp);
2401 if( bRet && (nTmp >= 0) )
2402 SetLines( nTmp );
2403 else
2404 bRet = false;
2405 }
2406 break;
2408 SetRubyTextBelow( *o3tl::doAccess<bool>(rVal) );
2409 break;
2410 case MID_GRID_PRINT:
2411 SetPrintGrid( *o3tl::doAccess<bool>(rVal) );
2412 break;
2413 case MID_GRID_DISPLAY:
2414 SetDisplayGrid( *o3tl::doAccess<bool>(rVal) );
2415 break;
2417 case MID_GRID_BASEWIDTH:
2419 {
2420 OSL_ENSURE( (nMemberId & CONVERT_TWIPS) != 0,
2421 "This value needs TWIPS-MM100 conversion" );
2422 sal_Int32 nTmp = 0;
2423 bRet = (rVal >>= nTmp);
2424 nTmp = o3tl::toTwips(nTmp, o3tl::Length::mm100);
2425 if( bRet && (nTmp >= 0) && ( nTmp <= SAL_MAX_UINT16) )
2426 {
2427 // rhbz#1043551 round up to 5pt -- 0 causes divide-by-zero
2428 // in layout; 1pt ties the painting code up in knots for
2429 // minutes with bazillion lines...
2430#define MIN_TEXTGRID_SIZE 100
2431 if( (nMemberId & ~CONVERT_TWIPS) == MID_GRID_BASEHEIGHT )
2432 {
2433 nTmp = std::max<sal_Int32>(nTmp, MIN_TEXTGRID_SIZE);
2434 SetBaseHeight( o3tl::narrowing<sal_uInt16>(nTmp) );
2435 }
2436 else if( (nMemberId & ~CONVERT_TWIPS) == MID_GRID_BASEWIDTH )
2437 {
2438 nTmp = std::max<sal_Int32>(nTmp, MIN_TEXTGRID_SIZE);
2439 SetBaseWidth( o3tl::narrowing<sal_uInt16>(nTmp) );
2440 }
2441 else
2442 SetRubyHeight( o3tl::narrowing<sal_uInt16>(nTmp) );
2443 }
2444 else
2445 bRet = false;
2446 }
2447 break;
2448 case MID_GRID_TYPE:
2449 {
2450 sal_Int16 nTmp = 0;
2451 bRet = (rVal >>= nTmp);
2452 if( bRet )
2453 {
2454 switch( nTmp )
2455 {
2458 break;
2459 case text::TextGridMode::LINES:
2461 break;
2462 case text::TextGridMode::LINES_AND_CHARS:
2464 break;
2465 default:
2466 bRet = false;
2467 break;
2468 }
2469 }
2470 break;
2471 }
2473 SetSnapToChars( *o3tl::doAccess<bool>(rVal) );
2474 break;
2476 {
2477 bool bStandard = *o3tl::doAccess<bool>(rVal);
2478 SetSquaredMode( !bStandard );
2479 break;
2480 }
2481 default:
2482 OSL_FAIL("Unknown SwTextGridItem member");
2483 bRet = false;
2484 }
2485
2486 return bRet;
2487}
2488
2490{
2491 if (bNew == m_bSquaredMode)
2492 {
2493 //same paper mode, not switch
2494 return;
2495 }
2496
2497 // use default value when grid is disable
2498 if (m_eGridType == GRID_NONE)
2499 {
2500 m_bSquaredMode = bNew;
2501 Init();
2502 return;
2503 }
2504
2505 if (m_bSquaredMode)
2506 {
2507 //switch from "squared mode" to "standard mode"
2510 m_nRubyHeight = 0;
2511 }
2512 else
2513 {
2514 //switch from "standard mode" to "squared mode"
2518 }
2520}
2521
2523{
2524 if (m_bSquaredMode)
2525 {
2526 m_nLines = 20;
2527 m_nBaseHeight = 400;
2528 m_nRubyHeight = 200;
2530 m_bRubyTextBelow = false;
2531 m_bPrintGrid = true;
2532 m_bDisplayGrid = true;
2533 m_bSnapToChars = true;
2534 m_nBaseWidth = 400;
2535 }
2536 else
2537 {
2538 m_nLines = 44;
2539 m_nBaseHeight = 312;
2540 m_nRubyHeight = 0;
2542 m_bRubyTextBelow = false;
2543 m_bPrintGrid = true;
2544 m_bDisplayGrid = true;
2545 m_nBaseWidth = 210;
2546 m_bSnapToChars = true;
2547 }
2548}
2549
2551{
2553}
2554
2556 SwAttrPool& rPool,
2557 const char* pFormatNm,
2558 SwFrameFormat *pDrvdFrame,
2559 sal_uInt16 nFormatWhich,
2560 const WhichRangesContainer& pWhichRange)
2561: SwFormat(rPool, pFormatNm, pWhichRange, pDrvdFrame, nFormatWhich),
2562 m_ffList(nullptr)
2563{
2564}
2565
2567 SwAttrPool& rPool,
2568 const OUString &rFormatNm,
2569 SwFrameFormat *pDrvdFrame,
2570 sal_uInt16 nFormatWhich,
2571 const WhichRangesContainer& pWhichRange)
2572: SwFormat(rPool, rFormatNm, pWhichRange, pDrvdFrame, nFormatWhich),
2573 m_ffList(nullptr)
2574{
2575}
2576
2578{
2579 if( !GetDoc()->IsInDtor())
2580 {
2581 const SwFormatAnchor& rAnchor = GetAnchor();
2582 if (SwNode* pAnchorNode = rAnchor.GetAnchorNode())
2583 {
2584 pAnchorNode->RemoveAnchoredFly(this);
2585 }
2586 }
2587
2588 // Check if there any textboxes attached to this format.
2589 if( nullptr == m_pOtherTextBoxFormats )
2590 return;
2591
2592 // This is a fly-frame-format just delete this
2593 // textbox entry from the textbox collection.
2594 // Note: Do not delete it from the doc, as that
2595 // is already in progress.
2596 if (Which() == RES_FLYFRMFMT)
2597 m_pOtherTextBoxFormats->DelTextBox(this);
2598
2599 // This is a draw-frame-format what belongs to
2600 // a shape with textbox(es). Delete all of them.
2601 if (Which() == RES_DRAWFRMFMT)
2602 m_pOtherTextBoxFormats->ClearAll();
2603
2604 // Release the pointer.
2605 m_pOtherTextBoxFormats.reset();
2606}
2607
2608void SwFrameFormat::SetFormatName( const OUString& rNewName, bool bBroadcast )
2609{
2610 if (m_ffList != nullptr) {
2611 SAL_INFO_IF(m_aFormatName == rNewName, "sw.core", "SwFrmFmt not really renamed, as both names are equal");
2612 sw::NameChanged aHint(m_aFormatName, rNewName);
2613 m_ffList->Rename(*this, rNewName);
2614 if (bBroadcast) {
2615 GetNotifier().Broadcast(aHint);
2616 }
2617 }
2618 else
2619 SwFormat::SetFormatName( rNewName, bBroadcast );
2620}
2621
2623{
2624 return true;
2625}
2626
2627void SwFrameFormat::SwClientNotify(const SwModify& rMod, const SfxHint& rHint)
2628{
2629 if (rHint.GetId() != SfxHintId::SwLegacyModify)
2630 return;
2631 auto pLegacy = static_cast<const sw::LegacyModifyHint*>(&rHint);
2632 const sal_uInt16 nNewWhich = pLegacy->m_pNew ? pLegacy->m_pNew->Which() : 0;
2633 const SwAttrSetChg* pNewAttrSetChg = nullptr;
2634 const SwFormatHeader* pH = nullptr;
2635 const SwFormatFooter* pF = nullptr;
2636 SwNode* pNewAnchorNode = nullptr;
2637 switch(nNewWhich)
2638 {
2639 case RES_ATTRSET_CHG:
2640 {
2641 pNewAttrSetChg = static_cast<const SwAttrSetChg*>(pLegacy->m_pNew);
2642 pH = pNewAttrSetChg->GetChgSet()->GetItem(RES_HEADER, false);
2643 pF = pNewAttrSetChg->GetChgSet()->GetItem(RES_FOOTER, false);
2644
2645 // reset fill information
2647 {
2648 SfxItemIter aIter(*pNewAttrSetChg->GetChgSet());
2649 for(const SfxPoolItem* pItem = aIter.GetCurItem(); pItem; pItem = aIter.NextItem())
2650 {
2651 if(!IsInvalidItem(pItem) && pItem->Which() >= XATTR_FILL_FIRST && pItem->Which() <= XATTR_FILL_LAST)
2652 {
2653 maFillAttributes.reset();
2654 break;
2655 }
2656 }
2657 }
2658 const SwFormatAnchor* pAnchor = pNewAttrSetChg->GetChgSet()->GetItem(RES_ANCHOR, false);
2659 if(pAnchor)
2660 {
2661 pNewAnchorNode = pAnchor->GetAnchorNode();
2662 assert(pNewAnchorNode == nullptr || // style's set must not contain position!
2663 pNewAttrSetChg->GetTheChgdSet() == &m_aSet);
2664 }
2665 break;
2666 }
2667 case RES_FMT_CHG:
2668 {
2669 // reset fill information on format change (e.g. style changed)
2671 maFillAttributes.reset();
2672 break;
2673 }
2674 case RES_HEADER:
2675 pH = static_cast<const SwFormatHeader*>(pLegacy->m_pNew);
2676 break;
2677 case RES_FOOTER:
2678 pF = static_cast<const SwFormatFooter*>(pLegacy->m_pNew);
2679 break;
2680 case RES_ANCHOR:
2681 pNewAnchorNode = static_cast<const SwFormatAnchor*>(pLegacy->m_pNew)->GetAnchorNode();
2682 break;
2683 }
2684 const sal_uInt16 nOldWhich = pLegacy->m_pOld ? pLegacy->m_pOld->Which() : 0;
2685 SwNode* pOldAnchorNode = nullptr;
2686 switch(nOldWhich)
2687 {
2688 case RES_ATTRSET_CHG:
2689 {
2690 const SwAttrSetChg* pOldAttrSetChg = nullptr;
2691 pOldAttrSetChg = static_cast<const SwAttrSetChg*>(pLegacy->m_pOld);
2692 const SwFormatAnchor* pAnchor = pOldAttrSetChg->GetChgSet()->GetItem(RES_ANCHOR, false);
2693 if(pAnchor)
2694 {
2695 pOldAnchorNode = pAnchor->GetAnchorNode();
2696 assert(pOldAnchorNode == nullptr || // style's set must not contain position!
2697 pOldAttrSetChg->GetTheChgdSet() == &m_aSet);
2698 }
2699 break;
2700 }
2701 case RES_ANCHOR:
2702 pOldAnchorNode = static_cast<const SwFormatAnchor*>(pLegacy->m_pOld)->GetAnchorNode();
2703 break;
2705 SetXObject(uno::Reference<uno::XInterface>(nullptr));
2706 break;
2707 }
2708
2709 assert(nOldWhich == nNewWhich || !nOldWhich || !nNewWhich);
2710 if(pH && pH->IsActive() && !pH->GetHeaderFormat())
2711 { //If he doesn't have one, I'll add one
2712 SwFrameFormat* pFormat = GetDoc()->getIDocumentLayoutAccess().MakeLayoutFormat(RndStdIds::HEADER, nullptr);
2713 const_cast<SwFormatHeader*>(pH)->RegisterToFormat(*pFormat);
2714 }
2715 if(pF && pF->IsActive() && !pF->GetFooterFormat())
2716 { //If he doesn't have one, I'll add one
2717 SwFrameFormat* pFormat = GetDoc()->getIDocumentLayoutAccess().MakeLayoutFormat(RndStdIds::FOOTER, nullptr);
2718 const_cast<SwFormatFooter*>(pF)->RegisterToFormat(*pFormat);
2719 }
2720 SwFormat::SwClientNotify(rMod, rHint);
2721 if(pOldAnchorNode != nullptr && (pNewAnchorNode == nullptr || pOldAnchorNode->GetIndex() != pNewAnchorNode->GetIndex()))
2722 pOldAnchorNode->RemoveAnchoredFly(this);
2723 if(pNewAnchorNode != nullptr && (pOldAnchorNode == nullptr || pOldAnchorNode->GetIndex() != pNewAnchorNode->GetIndex()))
2724 pNewAnchorNode->AddAnchoredFly(this);
2725}
2726
2728{
2729 rFormat.Add( this );
2730}
2731
2734{
2735 SwIterator<SwFrame,SwFormat> aIter( *this );
2736 SwFrame * pLast = aIter.First();
2737 if( pLast )
2738 do {
2739 pLast->Cut();
2740 SwFrame::DestroyFrame(pLast);
2741 } while( nullptr != ( pLast = aIter.Next() ));
2742}
2743
2745{
2746 assert(false); // unimplemented in base class
2747}
2748
2749SwRect SwFrameFormat::FindLayoutRect( const bool bPrtArea, const Point* pPoint ) const
2750{
2751 SwRect aRet;
2752 SwFrame *pFrame = nullptr;
2753 if( auto pSectionFormat = dynamic_cast<const SwSectionFormat*>( this ))
2754 {
2755 // get the Frame using Node2Layout
2756 const SwSectionNode* pSectNd = pSectionFormat->GetSectionNode();
2757 if( pSectNd )
2758 {
2759 SwNode2Layout aTmp( *pSectNd, pSectNd->GetIndex() - 1 );
2760 pFrame = aTmp.NextFrame();
2761
2762 if( pFrame && !pFrame->KnowsFormat(*this) )
2763 {
2764 // the Section doesn't have his own Frame, so if someone
2765 // needs the real size, we have to implement this by requesting
2766 // the matching Frame from the end.
2767 // PROBLEM: what happens if SectionFrames overlaps multiple
2768 // pages?
2769 if( bPrtArea )
2770 aRet = pFrame->getFramePrintArea();
2771 else
2772 {
2773 aRet = pFrame->getFrameArea();
2774 aRet.Pos().AdjustY( -1 );
2775 }
2776 pFrame = nullptr; // the rect is finished by now
2777 }
2778 }
2779 }
2780 else
2781 {
2782 const SwFrameType nFrameType = RES_FLYFRMFMT == Which() ? SwFrameType::Fly : FRM_ALL;
2783 std::pair<Point, bool> tmp;
2784 if (pPoint)
2785 {
2786 tmp.first = *pPoint;
2787 tmp.second = false;
2788 }
2789 pFrame = ::GetFrameOfModify(nullptr, *this, nFrameType, nullptr, pPoint ? &tmp : nullptr);
2790 }
2791
2792 if( pFrame )
2793 {
2794 if( bPrtArea )
2795 aRet = pFrame->getFramePrintArea();
2796 else
2797 aRet = pFrame->getFrameArea();
2798 }
2799 return aRet;
2800}
2801
2803{
2804 if( RES_FLYFRMFMT == Which() )
2805 {
2806 Point aNullPt;
2807 std::pair<Point, bool> const tmp(aNullPt, false);
2808 SwFlyFrame* pFly = static_cast<SwFlyFrame*>(::GetFrameOfModify( nullptr, *this, SwFrameType::Fly,
2809 nullptr, &tmp));
2810 if( pFly )
2811 return pFly->GetVirtDrawObj();
2812
2813 if( !GetDoc() || !GetDoc()->GetDocShell() ||
2814 GetDoc()->GetDocShell()->GetCreateMode() != SfxObjectCreateMode::EMBEDDED )
2815 return nullptr;
2816
2817 // tdf#126477 fix lost charts in embedded documents
2818 }
2819 return FindSdrObject();
2820}
2821
2822bool SwFrameFormat::IsLowerOf( const SwFrameFormat& rFormat ) const
2823{
2824 //Also linking from inside to outside or from outside to inside is not
2825 //allowed.
2827 if( pSFly )
2828 {
2829 SwFlyFrame *pAskFly = SwIterator<SwFlyFrame,SwFormat>(rFormat).First();
2830 if( pAskFly )
2831 return pSFly->IsLowerOf( pAskFly );
2832 }
2833
2834 // let's try it using the node positions
2835 const SwFormatAnchor* pAnchor = &rFormat.GetAnchor();
2836 if ((RndStdIds::FLY_AT_PAGE != pAnchor->GetAnchorId()) && pAnchor->GetAnchorNode())
2837 {
2838 const SwNode* pFlyNd = pAnchor->GetAnchorNode()->FindFlyStartNode();
2839 while( pFlyNd )
2840 {
2841 // then we walk up using the anchor
2842 for(const sw::SpzFrameFormat* pFormat: *GetDoc()->GetSpzFrameFormats())
2843 {
2844 const SwNodeIndex* pIdx = pFormat->GetContent().GetContentIdx();
2845 if( pIdx && pFlyNd == &pIdx->GetNode() )
2846 {
2847 if( pFormat == this )
2848 return true;
2849
2850 pAnchor = &pFormat->GetAnchor();
2851 if ((RndStdIds::FLY_AT_PAGE == pAnchor->GetAnchorId()) ||
2852 !pAnchor->GetAnchorNode() )
2853 {
2854 return false;
2855 }
2856
2857 pFlyNd = pAnchor->GetAnchorNode()->FindFlyStartNode();
2858 break;
2859 }
2860 }
2861 }
2862 }
2863 return false;
2864}
2865
2866// #i31698#
2868{
2870}
2871
2873{
2874 // empty body, because default implementation does nothing
2875}
2876
2877// #i28749#
2879{
2880 return text::PositionLayoutDir::PositionInLayoutDirOfAnchor;
2881}
2883{
2884 // empty body, because default implementation does nothing
2885}
2886
2888{
2889 return SwResId(STR_FRAME);
2890}
2891
2893{
2894 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwFrameFormat"));
2895 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", this);
2896 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("name"), BAD_CAST(GetName().toUtf8().getStr()));
2897 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("whichId"), "%d", Which());
2898
2899 const char* pWhich = nullptr;
2900 switch (Which())
2901 {
2902 case RES_FLYFRMFMT:
2903 pWhich = "fly frame format";
2904 break;
2905 case RES_DRAWFRMFMT:
2906 pWhich = "draw frame format";
2907 break;
2908 }
2909 if (pWhich)
2910 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("which"), BAD_CAST(pWhich));
2911
2913 {
2914 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("OtherTextBoxFormat"), "%p", m_pOtherTextBoxFormats.get());
2915 }
2916
2917 GetAttrSet().dumpAsXml(pWriter);
2918
2919 if (const SdrObject* pSdrObject = FindSdrObject())
2920 pSdrObject->dumpAsXml(pWriter);
2921
2922 (void)xmlTextWriterEndElement(pWriter);
2923}
2924
2925SwFlyFrameFormat::SwFlyFrameFormat(SwAttrPool& rPool, const OUString &rFormatName, SwFrameFormat* pDerivedFrame)
2926 : sw::SpzFrameFormat(rPool, rFormatName, pDerivedFrame, RES_FLYFRMFMT)
2927{}
2928
2930{
2931 SwIterator<SwFlyFrame,SwFormat> aIter( *this );
2932 SwFlyFrame * pLast = aIter.First();
2933 if( pLast )
2934 do
2935 {
2936 SwFrame::DestroyFrame(pLast);
2937 } while( nullptr != ( pLast = aIter.Next() ));
2938
2939}
2940
2942{
2943 if(!m_pContact)
2944 {
2945 SwDrawModel* pDrawModel(GetDoc()->getIDocumentDrawModelAccess().GetOrCreateDrawModel());
2946 m_pContact.reset(new SwFlyDrawContact(this, *pDrawModel));
2947 }
2948
2949 return m_pContact.get();
2950}
2951
2955{
2956 // is there a layout?
2957 if( !GetDoc()->getIDocumentLayoutAccess().GetCurrentViewShell() )
2958 return;
2959
2960 sw::BroadcastingModify *pModify = nullptr;
2961 // OD 24.07.2003 #111032# - create local copy of anchor attribute for possible changes.
2962 SwFormatAnchor aAnchorAttr( GetAnchor() );
2963 switch( aAnchorAttr.GetAnchorId() )
2964 {
2965 case RndStdIds::FLY_AS_CHAR:
2966 case RndStdIds::FLY_AT_PARA:
2967 case RndStdIds::FLY_AT_CHAR:
2968 if( aAnchorAttr.GetAnchorNode() )
2969 {
2970 pModify = aAnchorAttr.GetAnchorNode()->GetContentNode();
2971 }
2972 break;
2973
2974 case RndStdIds::FLY_AT_FLY:
2975 if( aAnchorAttr.GetAnchorNode() )
2976 {
2977 //First search in the content because this is O(1)
2978 //This can go wrong for linked frames because in this case it's
2979 //possible, that no Frame exists for this content.
2980 //In such a situation we also need to search from StartNode to
2981 //FrameFormat.
2982 SwNodeIndex aIdx( *aAnchorAttr.GetAnchorNode() );
2983 SwContentNode *pCNd = GetDoc()->GetNodes().GoNext( &aIdx );
2984 // #i105535#
2985 if ( pCNd == nullptr )
2986 {
2987 pCNd = aAnchorAttr.GetAnchorNode()->GetContentNode();
2988 }
2989 if ( pCNd )
2990 {
2992 {
2993 pModify = pCNd;
2994 }
2995 }
2996 // #i105535#
2997 if ( pModify == nullptr )
2998 {
2999 const SwNode & rNd = *aAnchorAttr.GetAnchorNode();
3000 for(sw::SpzFrameFormat* pFlyFormat: *GetDoc()->GetSpzFrameFormats())
3001 {
3002 if( pFlyFormat->GetContent().GetContentIdx() &&
3003 rNd == pFlyFormat->GetContent().GetContentIdx()->GetNode() )
3004 {
3005 pModify = pFlyFormat;
3006 break;
3007 }
3008 }
3009 }
3010 }
3011 break;
3012
3013 case RndStdIds::FLY_AT_PAGE:
3014 {
3015 sal_uInt16 nPgNum = aAnchorAttr.GetPageNum();
3017 if( nPgNum == 0 && aAnchorAttr.GetAnchorNode() )
3018 {
3019 SwContentNode *pCNd = aAnchorAttr.GetAnchorNode()->GetContentNode();
3021 for ( SwFrame* pFrame = aIter.First(); pFrame != nullptr; pFrame = aIter.Next() )
3022 {
3023 pPage = pFrame->FindPageFrame();
3024 if( pPage )
3025 {
3026 nPgNum = pPage->GetPhyPageNum();
3027 aAnchorAttr.SetPageNum( nPgNum );
3028 aAnchorAttr.SetAnchor( nullptr );
3029 SetFormatAttr( aAnchorAttr );
3030 break;
3031 }
3032 }
3033 }
3034 while ( pPage )
3035 {
3036 if ( pPage->GetPhyPageNum() == nPgNum )
3037 {
3038 // #i50432# - adjust synopsis of <PlaceFly(..)>
3039 pPage->PlaceFly( nullptr, this );
3040 break;
3041 }
3042 pPage = static_cast<SwPageFrame*>(pPage->GetNext());
3043 }
3044 }
3045 break;
3046 default:
3047 break;
3048 }
3049
3050 if( !pModify )
3051 return;
3052
3054 for( SwFrame *pFrame = aIter.First(); pFrame; pFrame = aIter.Next() )
3055 {
3056 bool bAdd = !pFrame->IsContentFrame() ||
3057 !static_cast<SwContentFrame*>(pFrame)->IsFollow();
3058
3059 if ( RndStdIds::FLY_AT_FLY == aAnchorAttr.GetAnchorId() && !pFrame->IsFlyFrame() )
3060 {
3061 SwFrame* pFlyFrame = pFrame->FindFlyFrame();
3062 if ( pFlyFrame )
3063 {
3064 pFrame = pFlyFrame;
3065 }
3066 else
3067 {
3068 aAnchorAttr.SetType( RndStdIds::FLY_AT_PARA );
3069 SetFormatAttr( aAnchorAttr );
3070 MakeFrames();
3071 return;
3072 }
3073 }
3074
3075 if (bAdd)
3076 {
3077 switch (aAnchorAttr.GetAnchorId())
3078 {
3079 case RndStdIds::FLY_AS_CHAR:
3080 case RndStdIds::FLY_AT_PARA:
3081 case RndStdIds::FLY_AT_CHAR:
3082 {
3083 assert(pFrame->IsTextFrame());
3084 bAdd = IsAnchoredObjShown(*static_cast<SwTextFrame*>(pFrame), aAnchorAttr);
3085 }
3086 break;
3087 default:
3088 break;
3089 }
3090 }
3091
3092 if (bAdd && pFrame->GetDrawObjs())
3093 {
3094 // #i28701# - new type <SwSortedObjs>
3095 SwSortedObjs &rObjs = *pFrame->GetDrawObjs();
3096 for(SwAnchoredObject* pObj : rObjs)
3097 {
3098 // #i28701# - consider changed type of
3099 // <SwSortedObjs> entries.
3100 if( pObj->DynCastFlyFrame() != nullptr &&
3101 (&pObj->GetFrameFormat()) == this )
3102 {
3103 bAdd = false;
3104 break;
3105 }
3106 }
3107 }
3108
3109 if( bAdd )
3110 {
3111 SwFlyFrame *pFly = nullptr; // avoid warnings
3112 switch( aAnchorAttr.GetAnchorId() )
3113 {
3114 case RndStdIds::FLY_AT_FLY:
3115 pFly = new SwFlyLayFrame( this, pFrame, pFrame );
3116 break;
3117
3118 case RndStdIds::FLY_AT_PARA:
3119 case RndStdIds::FLY_AT_CHAR:
3120 pFly = new SwFlyAtContentFrame( this, pFrame, pFrame );
3121 break;
3122
3123 case RndStdIds::FLY_AS_CHAR:
3124 pFly = new SwFlyInContentFrame( this, pFrame, pFrame );
3125 break;
3126
3127 default:
3128 assert(false && "New anchor type" );
3129 }
3130 pFrame->AppendFly( pFly );
3131 pFly->GetFormat()->SetObjTitle(GetObjTitle());
3133 SwPageFrame *pPage = pFly->FindPageFrame();
3134 if( pPage )
3135 ::RegistFlys( pPage, pFly );
3136 }
3137 }
3138}
3139
3141{
3142 std::pair<Point, bool> tmp;
3143 if (pPoint)
3144 {
3145 tmp.first = *pPoint;
3146 tmp.second = false;
3147 }
3148 return static_cast<SwFlyFrame*>(::GetFrameOfModify( nullptr, *this, SwFrameType::Fly,
3149 nullptr, &tmp));
3150}
3151
3153{
3154 SwFlyFrame* pFlyFrame( GetFrame() );
3155 if ( pFlyFrame )
3156 {
3157 return pFlyFrame;
3158 }
3159 else
3160 {
3161 return nullptr;
3162 }
3163}
3164
3165// #i73249#
3166void SwFlyFrameFormat::SetObjTitle( const OUString& rTitle, bool bBroadcast )
3167{
3168 SdrObject* pMasterObject = FindSdrObject();
3169 OSL_ENSURE( pMasterObject, "<SwFlyFrameFormat::SetObjTitle(..)> - missing <SdrObject> instance" );
3170 msTitle = rTitle;
3171 if ( !pMasterObject )
3172 {
3173 return;
3174 }
3175
3176 const sw::TitleChanged aHint(pMasterObject->GetTitle(), rTitle);
3177 pMasterObject->SetTitle(rTitle);
3178 if(bBroadcast)
3179 {
3180 GetNotifier().Broadcast(aHint);
3181 }
3182}
3183
3185{
3186 const SdrObject* pMasterObject = FindSdrObject();
3187 OSL_ENSURE( pMasterObject, "<SwFlyFrameFormat::GetObjTitle(..)> - missing <SdrObject> instance" );
3188 if ( !pMasterObject )
3189 {
3190 return msTitle;
3191 }
3192 if (!pMasterObject->GetTitle().isEmpty())
3193 return pMasterObject->GetTitle();
3194 else
3195 return msTitle;
3196}
3197
3198void SwFlyFrameFormat::SetObjTooltip(const OUString& rTooltip)
3199{
3200 msTooltip = rTooltip;
3201}
3202
3203const OUString & SwFlyFrameFormat::GetObjTooltip() const
3204{
3205 return msTooltip;
3206}
3207
3208void SwFlyFrameFormat::SetObjDescription( const OUString& rDescription, bool bBroadcast )
3209{
3210 SdrObject* pMasterObject = FindSdrObject();
3211 OSL_ENSURE( pMasterObject, "<SwFlyFrameFormat::SetDescription(..)> - missing <SdrObject> instance" );
3212 msDesc = rDescription;
3213 if ( !pMasterObject )
3214 {
3215 return;
3216 }
3217
3218 const sw::DescriptionChanged aHint;
3219 pMasterObject->SetDescription(rDescription);
3220 if(bBroadcast)
3221 {
3222 GetNotifier().Broadcast(aHint);
3223 }
3224}
3225
3227{
3228 const SdrObject* pMasterObject = FindSdrObject();
3229 OSL_ENSURE( pMasterObject, "<SwFlyFrameFormat::GetDescription(..)> - missing <SdrObject> instance" );
3230 if ( !pMasterObject )
3231 {
3232 return msDesc;
3233 }
3234 if (!pMasterObject->GetDescription().isEmpty())
3235 return pMasterObject->GetDescription();
3236 else
3237 return msDesc;
3238}
3239
3240void SwFlyFrameFormat::SetObjDecorative(bool const isDecorative)
3241{
3242 SdrObject* pMasterObject = FindSdrObject();
3243 OSL_ENSURE( pMasterObject, "<SwFlyFrameFormat::SetDescription(..)> - missing <SdrObject> instance" );
3244 if ( !pMasterObject )
3245 {
3246 return;
3247 }
3248
3250 pMasterObject->SetDecorative(isDecorative);
3251 // does anybody care about a broadcast?
3252}
3253
3254
3265{
3267 {
3268 return getSdrAllFillAttributesHelper()->isTransparent();
3269 }
3270
3271 // NOTE: If background color is "no fill"/"auto fill" (COL_TRANSPARENT)
3272 // and there is no background graphic, it "inherites" the background
3273 // from its anchor.
3274 std::unique_ptr<SvxBrushItem> aBackground(makeBackgroundBrushItem());
3275 if ( aBackground->GetColor().IsTransparent() &&
3276 aBackground->GetColor() != COL_TRANSPARENT
3277 )
3278 {
3279 return true;
3280 }
3281 else
3282 {
3283 const GraphicObject *pTmpGrf = aBackground->GetGraphicObject();
3284 if ( pTmpGrf &&
3285 pTmpGrf->GetAttr().IsTransparent()
3286 )
3287 {
3288 return true;
3289 }
3290 }
3291
3292 return false;
3293}
3294
3306{
3308 {
3309 return !getSdrAllFillAttributesHelper()->isUsed();
3310 }
3311 else
3312 {
3313 std::unique_ptr<SvxBrushItem> aBackground(makeBackgroundBrushItem());
3314 if ( (aBackground->GetColor() == COL_TRANSPARENT) &&
3315 !(aBackground->GetGraphicObject()) )
3316 {
3317 return true;
3318 }
3319 }
3320
3321 return false;
3322}
3323
3325 const SwFormatAnchor& _rNewAnchorFormat,
3326 SwFlyFrame const * _pKeepThisFlyFrame )
3327 : mrFlyFrameFormat( _rFlyFrameFormat ),
3328 mbAnchorNodeChanged( false ),
3329 mpWrtShell(nullptr)
3330{
3331 const SwFormatAnchor& aOldAnchorFormat(_rFlyFrameFormat.GetAnchor());
3332 const RndStdIds nNewAnchorType( _rNewAnchorFormat.GetAnchorId() );
3333 if ( ((nNewAnchorType == RndStdIds::FLY_AT_PARA) ||
3334 (nNewAnchorType == RndStdIds::FLY_AT_CHAR)) &&
3335 _rNewAnchorFormat.GetAnchorNode() &&
3336 _rNewAnchorFormat.GetAnchorNode()->GetContentNode() )
3337 {
3338 if ( aOldAnchorFormat.GetAnchorId() == nNewAnchorType &&
3339 aOldAnchorFormat.GetAnchorNode() &&
3340 aOldAnchorFormat.GetAnchorNode()->GetContentNode() &&
3341 aOldAnchorFormat.GetContentAnchor()->GetNode() !=
3342 _rNewAnchorFormat.GetContentAnchor()->GetNode() )
3343 {
3344 // determine 'old' number of anchor frames
3345 sal_uInt32 nOldNumOfAnchFrame( 0 );
3347 *(aOldAnchorFormat.GetAnchorNode()->GetContentNode()) );
3348 for( SwFrame* pOld = aOldIter.First(); pOld; pOld = aOldIter.Next() )
3349 {
3350 ++nOldNumOfAnchFrame;
3351 }
3352 // determine 'new' number of anchor frames
3353 sal_uInt32 nNewNumOfAnchFrame( 0 );
3355 *(_rNewAnchorFormat.GetAnchorNode()->GetContentNode()) );
3356 for( SwFrame* pNew = aNewIter.First(); pNew; pNew = aNewIter.Next() )
3357 {
3358 ++nNewNumOfAnchFrame;
3359 }
3360 if ( nOldNumOfAnchFrame != nNewNumOfAnchFrame )
3361 {
3362 // delete existing fly frames except <_pKeepThisFlyFrame>
3364 SwFrame* pFrame = aIter.First();
3365 if ( pFrame )
3366 {
3367 do {
3368 if ( pFrame != _pKeepThisFlyFrame )
3369 {
3370 pFrame->Cut();
3371 SwFrame::DestroyFrame(pFrame);
3372 }
3373 } while( nullptr != ( pFrame = aIter.Next() ));
3374 }
3375 // indicate, that re-creation of fly frames necessary
3376 mbAnchorNodeChanged = true;
3377 }
3378 }
3379 }
3380
3381 if (aOldAnchorFormat.GetAnchorNode()
3382 && aOldAnchorFormat.GetAnchorId() == RndStdIds::FLY_AT_CHAR)
3383 {
3384 moCommentAnchor.emplace(*aOldAnchorFormat.GetContentAnchor());
3385 }
3386
3387 if (_pKeepThisFlyFrame)
3388 {
3389 SwViewShell* pViewShell = _pKeepThisFlyFrame->getRootFrame()->GetCurrShell();
3390 mpWrtShell = dynamic_cast<SwWrtShell*>(pViewShell);
3391 }
3392}
3393
3395{
3396 if ( mbAnchorNodeChanged )
3397 {
3399 }
3400
3401 // See if the fly frame had a comment: if so, move it to the new anchor as well.
3402 if (!moCommentAnchor)
3403 {
3404 return;
3405 }
3406
3407 SwTextNode* pTextNode = moCommentAnchor->GetNode().GetTextNode();
3408 if (!pTextNode)
3409 {
3410 return;
3411 }
3412
3413 const SwTextField* pField = pTextNode->GetFieldTextAttrAt(moCommentAnchor->GetContentIndex());
3414 if (!pField || pField->GetFormatField().GetField()->GetTyp()->Which() != SwFieldIds::Postit)
3415 {
3416 return;
3417 }
3418
3419 if (!mpWrtShell)
3420 {
3421 return;
3422 }
3423
3424 // Save current cursor position, so we can restore it later.
3425 mpWrtShell->Push();
3426
3427 // Set up the source of the move: the old comment anchor.
3428 {
3430 *rCursor.GetPoint() = *moCommentAnchor;
3431 rCursor.SetMark();
3432 *rCursor.GetMark() = *moCommentAnchor;
3433 rCursor.GetMark()->AdjustContent(+1);
3434 }
3435
3436 // Set up the target of the move: the new comment anchor.
3437 const SwFormatAnchor& rNewAnchorFormat = mrFlyFrameFormat.GetAnchor();
3439 *mpWrtShell->GetCurrentShellCursor().GetPoint() = *rNewAnchorFormat.GetContentAnchor();
3440
3441 // Move by copying and deleting.
3442 mpWrtShell->SwEditShell::Copy(*mpWrtShell);
3444
3445 mpWrtShell->Delete(false);
3446
3448}
3449
3451{
3453}
3454
3455namespace sw
3456{
3468}
3469
3471{
3473}
3474
3476{
3478}
3479
3481{
3483}
3484
3485// #i31698#
3487{
3488 return meLayoutDir;
3489}
3490
3492{
3493 meLayoutDir = _eLayoutDir;
3494}
3495
3496// #i28749#
3498{
3499 return mnPositionLayoutDir;
3500}
3501void SwDrawFrameFormat::SetPositionLayoutDir( const sal_Int16 _nPositionLayoutDir )
3502{
3503 switch ( _nPositionLayoutDir )
3504 {
3505 case text::PositionLayoutDir::PositionInHoriL2R:
3506 case text::PositionLayoutDir::PositionInLayoutDirOfAnchor:
3507 {
3508 mnPositionLayoutDir = _nPositionLayoutDir;
3509 }
3510 break;
3511 default:
3512 {
3513 OSL_FAIL( "<SwDrawFrameFormat::SetPositionLayoutDir(..)> - invalid attribute value." );
3514 }
3515 }
3516}
3517
3519{
3520 OUString aResult;
3521 const SdrObject * pSdrObj = FindSdrObject();
3522
3523 if (pSdrObj)
3524 {
3525 if (pSdrObj != m_pSdrObjectCached)
3526 {
3528 m_pSdrObjectCached = pSdrObj;
3529 }
3530
3531 aResult = m_sSdrObjectCachedComment;
3532 }
3533 else
3534 aResult = SwResId(STR_GRAPHIC);
3535
3536 return aResult;
3537}
3538
3540 const SwFlyFrame *pFly ) const
3541{
3542 const SwFormatURL &rURL = GetURL();
3543 if( !rURL.GetMap() )
3544 return nullptr;
3545
3546 if( !pFly )
3547 {
3548 pFly = SwIterator<SwFlyFrame,SwFormat>( *this ).First();
3549 if( !pFly )
3550 return nullptr;
3551 }
3552
3553 //Original size for OLE and graphic is TwipSize, otherwise the size of
3554 //FrameFormat of the Fly.
3555 const SwFrame *pRef;
3556 const SwNoTextNode *pNd = nullptr;
3557 Size aOrigSz;
3558 if( pFly->Lower() && pFly->Lower()->IsNoTextFrame() )
3559 {
3560 pRef = pFly->Lower();
3561 pNd = static_cast<const SwNoTextFrame*>(pRef)->GetNode()->GetNoTextNode();
3562 aOrigSz = pNd->GetTwipSize();
3563 }
3564 else
3565 {
3566 pRef = pFly;
3567 aOrigSz = pFly->GetFormat()->GetFrameSize().GetSize();
3568 }
3569
3570 if( !aOrigSz.IsEmpty() )
3571 {
3572 Point aPos( rPoint );
3573 Size aActSz ( pRef == pFly ? pFly->getFrameArea().SSize() : pRef->getFramePrintArea().SSize() );
3574 const o3tl::Length aSrc ( o3tl::Length::twip );
3575 const o3tl::Length aDest( o3tl::Length::mm100 );
3576 aOrigSz = o3tl::convert( aOrigSz, aSrc, aDest );
3577 aActSz = o3tl::convert( aActSz, aSrc, aDest );
3578 aPos -= pRef->getFrameArea().Pos();
3579 aPos -= pRef->getFramePrintArea().Pos();
3580 aPos = o3tl::convert( aPos, aSrc, aDest );
3581 sal_uInt32 nFlags = 0;
3582 if ( pFly != pRef && pNd->IsGrfNode() )
3583 {
3584 const MirrorGraph nMirror = pNd->GetSwAttrSet().
3585 GetMirrorGrf().GetValue();
3586 if ( MirrorGraph::Both == nMirror )
3588 else if ( MirrorGraph::Vertical == nMirror )
3589 nFlags = IMAP_MIRROR_VERT;
3590 else if ( MirrorGraph::Horizontal == nMirror )
3591 nFlags = IMAP_MIRROR_HORZ;
3592
3593 }
3594 return rURL.GetMap()->GetHitIMapObject( aOrigSz, aActSz, aPos, nFlags );
3595 }
3596
3597 return nullptr;
3598}
3599
3601{
3603 {
3604 // create FillAttributes on demand
3605 if(!maFillAttributes)
3606 {
3607 const_cast< SwFrameFormat* >(this)->maFillAttributes = std::make_shared<drawinglayer::attribute::SdrAllFillAttributesHelper>(GetAttrSet());
3608 }
3609 }
3610 else
3611 {
3612 // FALLBACKBREAKHERE assert wrong usage
3613 OSL_ENSURE(false, "getSdrAllFillAttributesHelper() call only valid for RES_FLYFRMFMT and RES_FRMFMT (!)");
3614 }
3615
3616 return maFillAttributes;
3617}
3618
3619void SwFrameFormat::MoveTableBox(SwTableBox& rTableBox, const SwFrameFormat* pOldFormat)
3620{
3621 Add(&rTableBox);
3622 if(!pOldFormat)
3623 return;
3624 const auto& rOld = pOldFormat->GetFormatAttr(RES_BOXATR_FORMAT);
3625 const auto& rNew = GetFormatAttr(RES_BOXATR_FORMAT);
3626 if(rOld != rNew)
3627 SwClientNotify(*this, sw::LegacyModifyHint(&rOld, &rNew));
3628}
3629
3630
3632{
3634};
3635
3636namespace sw {
3637
3639{
3640 const SwFlyFrameFormat* pFlyFrameFormat = dynamic_cast<const SwFlyFrameFormat*>(&rFormat);
3641 if (!pFlyFrameFormat)
3642 return false;
3643 SwFlyFrame* pFlyFrame = pFlyFrameFormat->GetFrame();
3644 if (!pFlyFrame) // fdo#54648: "hidden" drawing object has no layout frame
3645 {
3646 return false;
3647 }
3648 SwPageFrame* pPageFrame = pFlyFrame->FindPageFrameOfAnchor();
3649 SwFrame* pHeader = pPageFrame->Lower();
3650 if (pHeader->GetType() == SwFrameType::Header)
3651 {
3652 const SwFrame* pFrame = pFlyFrame->GetAnchorFrame();
3653 while (pFrame)
3654 {
3655 if (pFrame == pHeader)
3656 return true;
3657 pFrame = pFrame->GetUpper();
3658 }
3659 }
3660 return false;
3661}
3662
3664{
3665#if OSL_DEBUG_LEVEL > 0 && !defined NDEBUG
3666 SwNodes const& rNodes(rDoc.GetNodes());
3667 SwNodeOffset const count(rNodes.Count());
3668 for (SwNodeOffset i(0); i != count; ++i)
3669 {
3670 SwNode const*const pNode(rNodes[i]);
3671 std::vector<SwFrameFormat*> const & rFlys(pNode->GetAnchoredFlys());
3672 for (const auto& rpFly : rFlys)
3673 {
3674 SwFormatAnchor const& rAnchor((*rpFly).GetAnchor(false));
3675 assert(rAnchor.GetAnchorNode() == pNode);
3676 }
3677 }
3678 if(!rDoc.GetSpzFrameFormats())
3679 return;
3680
3681 for(sw::SpzFrameFormat* pSpz: *rDoc.GetSpzFrameFormats())
3682 {
3683 SwFormatAnchor const& rAnchor(pSpz->GetAnchor(false));
3684 if (RndStdIds::FLY_AT_PAGE == rAnchor.GetAnchorId())
3685 {
3686 assert(!rAnchor.GetAnchorNode()
3687 // for invalid documents that lack text:anchor-page-number
3688 // it may have an anchor before MakeFrames() is called
3690 }
3691 else
3692 {
3693 SwNode & rNode(*rAnchor.GetAnchorNode());
3694 std::vector<SwFrameFormat*> const& rFlys(rNode.GetAnchoredFlys());
3695 assert(std::find(rFlys.begin(), rFlys.end(), pSpz) != rFlys.end());
3696 switch (rAnchor.GetAnchorId())
3697 {
3698 case RndStdIds::FLY_AT_FLY:
3699 assert(rNode.IsStartNode());
3700 break;
3701 case RndStdIds::FLY_AT_PARA:
3702 assert(rNode.IsTextNode() || rNode.IsTableNode());
3703 break;
3704 case RndStdIds::FLY_AS_CHAR:
3705 case RndStdIds::FLY_AT_CHAR:
3706 assert(rNode.IsTextNode());
3707 break;
3708 default:
3709 assert(false);
3710 break;
3711 }
3712 }
3713 }
3714#else
3715 (void) rDoc;
3716#endif
3717}
3718
3719} // namespace sw
3720
3721/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SVXCORE_DLLPUBLIC css::uno::Reference< css::uno::XInterface > SvxXTextColumns_createInstance() noexcept
constexpr auto convertTwipToMm100(N n)
#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
IMapObject * GetHitIMapObject(const Size &rOriginalSize, const Size &rDisplaySize, const Point &rRelHitPoint, sal_uLong nFlags=0) const
virtual OUString GetTitle() const
virtual void SetTitle(const OUString &rStr)
virtual void SetDescription(const OUString &rStr)
virtual OUString GetDescription() const
virtual void SetDecorative(bool isDecorative)
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:351
const SwAttrSet * GetChgSet() const
What has changed.
Definition: hints.hxx:347
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:59
const SwContentNode * GetContentNode() const
const SwAttrSet & GetSwAttrSet() const
Does node has already its own auto-attributes? Access to SwAttrSet.
Definition: node.hxx:727
void Push()
store a copy of the current cursor on the cursor stack
Definition: crsrsh.cxx:2550
void ParkCursor(const SwNode &rIdx)
Remove selections and additional cursors of all shells.
Definition: crsrsh.cxx:3188
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:197
bool IsInDtor() const
Definition: doc.hxx:417
IDocumentContentOperations const & getIDocumentContentOperations() const
Definition: doc.cxx:329
IDocumentUndoRedo & GetIDocumentUndoRedo()
Definition: doc.cxx:158
SwNodes & GetNodes()
Definition: doc.hxx:422
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
Definition: doc.cxx:419
const sw::FrameFormats< sw::SpzFrameFormat * > * GetSpzFrameFormats() const
Definition: doc.hxx:759
SwDocShell * GetDocShell()
Definition: doc.hxx:1370
virtual SwFrameFormat::tLayoutDir GetLayoutDir() const override
Definition: atrfrm.cxx:3486
virtual void SetPositionLayoutDir(const sal_Int16 _nPositionLayoutDir) override
Definition: atrfrm.cxx:3501
virtual void MakeFrames() override
Register DrawObjects in the arrays at layout.
Definition: atrfrm.cxx:3475
const SdrObject * m_pSdrObjectCached
Definition: frmfmt.hxx:412
OUString m_sSdrObjectCachedComment
Definition: frmfmt.hxx:413
SwFrameFormat::tLayoutDir meLayoutDir
Definition: frmfmt.hxx:418
virtual sal_Int16 GetPositionLayoutDir() const override
Definition: atrfrm.cxx:3497
sal_Int16 mnPositionLayoutDir
Definition: frmfmt.hxx:420
virtual void DelFrames() override
DrawObjects are removed from the arrays at the layout.
Definition: atrfrm.cxx:3480
virtual void SetLayoutDir(const SwFrameFormat::tLayoutDir _eLayoutDir) override
Definition: atrfrm.cxx:3491
virtual OUString GetDescription() const override
Definition: atrfrm.cxx:3518
virtual ~SwDrawFrameFormat() override
Definition: atrfrm.cxx:3470
bool Delete(bool isArtificialSelection=false)
Delete content of all ranges.
Definition: eddel.cxx:134
SwFieldIds Which() const
Definition: fldbas.hxx:276
SwFieldType * GetTyp() const
Definition: fldbas.hxx:402
Flys that are anchored to content (at-para, at-char) but not in content (as-char).
Definition: flyfrms.hxx:163
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:2954
void SetObjDescription(const OUString &rDescription, bool bBroadcast=false)
Definition: atrfrm.cxx:3208
OUString GetObjDescription() const
Definition: atrfrm.cxx:3226
bool IsBackgroundBrushInherited() const
SwFlyFrameFormat::IsBackgroundBrushInherited.
Definition: atrfrm.cxx:3305
SwFlyFrame * GetFrame(const Point *pDocPos=nullptr) const
Definition: atrfrm.cxx:3140
void SetObjDecorative(bool isDecorative)
Definition: atrfrm.cxx:3240
const OUString & GetObjTooltip() const
Definition: atrfrm.cxx:3203
SwFlyDrawContact * GetOrCreateContact()
Definition: atrfrm.cxx:2941
OUString msDesc
Definition: frmfmt.hxx:223
virtual ~SwFlyFrameFormat() override
Definition: atrfrm.cxx:2929
OUString GetObjTitle() const
Definition: atrfrm.cxx:3184
OUString msTitle
Definition: frmfmt.hxx:222
SwAnchoredObject * GetAnchoredObj() const
Definition: atrfrm.cxx:3152
virtual bool IsBackgroundTransparent() const override
SwFlyFrameFormat::IsBackgroundTransparent.
Definition: atrfrm.cxx:3264
OUString msTooltip
A tooltip has priority over an SwFormatURL and is not persisted to files.
Definition: frmfmt.hxx:225
std::unique_ptr< SwFlyDrawContact > m_pContact
Definition: frmfmt.hxx:232
void SetObjTitle(const OUString &rTitle, bool bBroadcast=false)
Definition: atrfrm.cxx:3166
void SetObjTooltip(const OUString &rTooltip)
Definition: atrfrm.cxx:3198
SwFlyFrameFormat(const SwFlyFrameFormat &rCpy)=delete
general base class for all free-flowing frames
Definition: flyfrm.hxx:79
const SwVirtFlyDrawObj * GetVirtDrawObj() const
Definition: fly.cxx:3025
virtual const SwFlyFrameFormat * GetFormat() const override
Definition: fly.cxx:3119
bool IsLowerOf(const SwLayoutFrame *pUpper) const
Definition: fly.cxx:2392
Flys that are anchored as a character in the content.
Definition: flyfrms.hxx:210
Flys that are bound to layout frames (to-frame) and not to/as content.
Definition: flyfrms.hxx:151
FlyAnchors.
Definition: fmtanchr.hxx:37
virtual SwFormatAnchor * Clone(SfxItemPool *pPool=nullptr) const override
Definition: atrfrm.cxx:1665
sal_Int32 GetAnchorContentOffset() const
Definition: atrfrm.cxx:1631
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:1563
RndStdIds m_eAnchorId
Definition: fmtanchr.hxx:41
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: atrfrm.cxx:1675
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:1804
SwContentNode * GetAnchorContentNode() const
Definition: atrfrm.cxx:1623
virtual bool operator==(const SfxPoolItem &) const override
"pure virtual methods" of SfxPoolItem
Definition: atrfrm.cxx:1653
void SetAnchor(const SwPosition *pPos)
Definition: atrfrm.cxx:1593
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:1640
virtual ~SwFormatAnchor() override
Definition: atrfrm.cxx:1589
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:1729
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:1614
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:2179
void SetPrev(SwFlyFrameFormat *pFormat)
Definition: atrfrm.cxx:2171
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: atrfrm.cxx:2187
virtual SwFormatChain * Clone(SfxItemPool *pPool=nullptr) const override
Definition: atrfrm.cxx:2163
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:2148
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:1980
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:2141
const SwField * GetField() const
Definition: fmtfld.hxx:131
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:2134
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:2026
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: atrfrm.cxx:2059
virtual sal_uInt16 GetValueCount() const override
Definition: atrfrm.cxx:2010
SwFormatFootnoteEndAtTextEnd & operator=(const SwFormatFootnoteEndAtTextEnd &rAttr)
Definition: atrfrm.cxx:2015
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: atrfrm.cxx:2036
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:1985
Contains the line numbering properties of this paragraph.
Definition: fmtline.hxx:33
bool IsCount() const
Definition: fmtline.hxx:60
sal_uLong m_nStartValue
Starting value for the paragraph. 0 == no starting value.
Definition: fmtline.hxx:34
bool m_bCountLines
Also count lines of paragraph.
Definition: fmtline.hxx:35
static SfxPoolItem * CreateDefault()
Definition: atrfrm.cxx:139
sal_uLong GetStartValue() const
Definition: fmtline.hxx:59
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: atrfrm.cxx:2255
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: atrfrm.cxx:2235
virtual ~SwFormatLineNumber() override
Definition: atrfrm.cxx:2218
virtual SwFormatLineNumber * Clone(SfxItemPool *pPool=nullptr) const override
Definition: atrfrm.cxx:2230
void SetCountLines(bool b)
Definition: fmtline.hxx:63
virtual bool operator==(const SfxPoolItem &) const override
"Pure virtual methods" of SfxPoolItem.
Definition: atrfrm.cxx:2222
void SetStartValue(sal_uLong nNew)
Definition: fmtline.hxx:62
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:1995
void dumpAsXml(xmlTextWriterPtr pWriter) const override
Definition: atrfrm.cxx:2000
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
Controls if a table row is allowed to split or not.
Definition: fmtrowsplt.hxx:32
virtual SwFormatRowSplit * Clone(SfxItemPool *pPool=nullptr) const override
Definition: atrfrm.cxx:1990
SwFormatRowSplit(bool bSplit=true)
Definition: fmtrowsplt.hxx:34
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
SfxPoolItem subclass that wraps a URL.
Definition: fmturl.hxx:33
const ImageMap * GetMap() const
Definition: fmturl.hxx:67
virtual bool operator==(const SfxPoolItem &) const override
"Pure virtual methods" of SfxPoolItem.
Definition: atrfrm.cxx:1851
std::unique_ptr< ImageMap > m_pMap
ClientSide images.
Definition: fmturl.hxx:38
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: atrfrm.cxx:1885
OUString m_sTargetFrameName
Target frame for URL.
Definition: fmturl.hxx:34
virtual SwFormatURL * Clone(SfxItemPool *pPool=nullptr) const override
Definition: atrfrm.cxx:1869
const OUString & GetName() const
Definition: fmturl.hxx:70
void SetName(const OUString &rNm)
Definition: fmturl.hxx:71
const OUString & GetTargetFrameName() const
Definition: fmturl.hxx:64
OUString m_sName
Name of the anchor.
Definition: fmturl.hxx:36
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: atrfrm.cxx:1927
bool m_bIsServerMap
A ServerSideImageMap with the URL.
Definition: fmturl.hxx:40
const OUString & GetURL() const
Definition: fmturl.hxx:65
void SetURL(const OUString &rURL, bool bServerMap)
Definition: atrfrm.cxx:1874
bool IsServerMap() const
Definition: fmturl.hxx:66
virtual ~SwFormatURL() override
Definition: atrfrm.cxx:1847
void SetMap(const ImageMap *pM)
Pointer will be copied.
Definition: atrfrm.cxx:1880
OUString m_sURL
Simple URL.
Definition: fmturl.hxx:35
void SetTargetFrameName(const OUString &rStr)
Definition: fmturl.hxx:60
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:77
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
virtual void Rename(const SwFrameFormat &, const OUString &)
Definition: docary.hxx:52
const SwRect & getFrameArea() const
Definition: frame.hxx:179
const SwRect & getFramePrintArea() const
Definition: frame.hxx:180
Style of a layout element.
Definition: frmfmt.hxx:72
virtual bool IsVisible() const
Definition: atrfrm.cxx:3631
virtual ~SwFrameFormat() override
Definition: atrfrm.cxx:2577
virtual bool supportsFullDrawingLayerFillAttributeSet() const override
Definition: atrfrm.cxx:2622
virtual void DelFrames()
Destroys all Frames in aDepend (Frames are identified via dynamic_cast).
Definition: atrfrm.cxx:2733
void RegisterToFormat(SwFormat &rFormat)
Definition: atrfrm.cxx:2727
SAL_DLLPRIVATE void SetXObject(css::uno::Reference< css::uno::XInterface > const &xObject)
Definition: frmfmt.hxx:185
virtual void SetPositionLayoutDir(const sal_Int16 _nPositionLayoutDir)
Definition: atrfrm.cxx:2882
virtual void SwClientNotify(const SwModify &, const SfxHint &) override
Definition: atrfrm.cxx:2627
SwFormatsBase * m_ffList
Definition: frmfmt.hxx:88
IMapObject * GetIMapObject(const Point &rPoint, const SwFlyFrame *pFly=nullptr) const
Definition: atrfrm.cxx:3539
virtual void MakeFrames()
Creates the views.
Definition: atrfrm.cxx:2744
std::shared_ptr< SwTextBoxNode > m_pOtherTextBoxFormats
Definition: frmfmt.hxx:90
bool IsLowerOf(const SwFrameFormat &rFormat) const
Definition: atrfrm.cxx:2822
void dumpAsXml(xmlTextWriterPtr pWriter) const
Definition: atrfrm.cxx:2892
virtual drawinglayer::attribute::SdrAllFillAttributesHelperPtr getSdrAllFillAttributesHelper() const override
Definition: atrfrm.cxx:3600
virtual OUString GetDescription() const
Definition: atrfrm.cxx:2887
virtual void SetFormatName(const OUString &rNewName, bool bBroadcast=false) override
Definition: atrfrm.cxx:2608
SwRect FindLayoutRect(const bool bPrtArea=false, const Point *pPoint=nullptr) const
Definition: atrfrm.cxx:2749
virtual sal_Int16 GetPositionLayoutDir() const
Definition: atrfrm.cxx:2878
void MoveTableBox(SwTableBox &rTableBox, const SwFrameFormat *pOldFormat)
Definition: atrfrm.cxx:3619
SdrObject * FindRealSdrObject()
Definition: atrfrm.cxx:2802
SdrObject * FindSdrObject()
Definition: frmfmt.hxx:153
virtual void SetLayoutDir(const SwFrameFormat::tLayoutDir _eLayoutDir)
Definition: atrfrm.cxx:2872
drawinglayer::attribute::SdrAllFillAttributesHelperPtr maFillAttributes
Definition: frmfmt.hxx:85
virtual SwFrameFormat::tLayoutDir GetLayoutDir() const
Definition: atrfrm.cxx:2867
Base class of the Writer layout elements.
Definition: frame.hxx:315
virtual void Cut()=0
SwFlyFrame * FindFlyFrame()
Definition: frame.hxx:1117
SwFrame * GetNext()
Definition: frame.hxx:682
SwFrameType GetType() const
Definition: frame.hxx:521
bool KnowsFormat(const SwFormat &rFormat) const
Definition: wsfrm.cxx:333
SwLayoutFrame * GetUpper()
Definition: frame.hxx:684
SwRootFrame * getRootFrame()
Definition: frame.hxx:685
bool IsNoTextFrame() const
Definition: frame.hxx:1244
SwPageFrame * FindPageFrame()
Definition: frame.hxx:686
static void DestroyFrame(SwFrame *const pFrame)
this is the only way to delete a SwFrame instance
Definition: ssfrm.cxx:390
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:3450
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:3324
SwHeaderAndFooterEatSpacingItem(sal_uInt16 nId=RES_HEADER_FOOTER_EAT_SPACING, bool bPrt=false)
virtual SwHeaderAndFooterEatSpacingItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: atrfrm.cxx:2550
TElementType * Next()
Definition: calbck.hxx:380
TElementType * First()
Definition: calbck.hxx:372
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:123
Base class of the Writer document model elements.
Definition: node.hxx:98
bool IsGrfNode() const
Definition: node.hxx:195
SwStartNode * GetStartNode()
Definition: node.hxx:642
void AddAnchoredFly(SwFrameFormat *)
Definition: node.cxx:2162
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
Definition: ndtxt.hxx:901
SwSectionNode * GetSectionNode()
Definition: node.hxx:658
SwNodeOffset GetIndex() const
Definition: node.hxx:312
bool IsContentNode() const
Definition: node.hxx:188
void RemoveAnchoredFly(SwFrameFormat *)
Definition: node.cxx:2171
bool IsStartNode() const
Definition: node.hxx:187
const SwStartNode * FindFlyStartNode() const
Definition: node.hxx:220
bool IsTableNode() const
Definition: node.hxx:191
bool IsTextNode() const
Definition: node.hxx:190
SwNodeOffset EndOfSectionIndex() const
Definition: node.hxx:691
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:188
const SwPosition * GetMark() const
Definition: pam.hxx:255
virtual void SetMark()
Unless this is called, the getter method of Mark will return Point.
Definition: pam.cxx:643
const SwPosition * GetPoint() const
Definition: pam.hxx:253
const OUString & GetName() const
Definition: pagedesc.hxx:196
A page of the document layout.
Definition: pagefrm.hxx:60
void PlaceFly(SwFlyFrame *pFly, SwFlyFrameFormat *pFormat)
Definition: flylay.cxx:1139
sal_uInt16 GetPhyPageNum() const
Definition: pagefrm.hxx:209
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:215
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:443
const SwFormatField & GetFormatField() const
Definition: txatbase.hxx:199
Represents the visualization of a paragraph.
Definition: txtfrm.hxx:168
bool m_bSnapToChars
Definition: tgrditem.hxx:46
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: atrfrm.cxx:2384
bool GetSnapToChars() const
Definition: tgrditem.hxx:101
virtual ~SwTextGridItem() override
Definition: atrfrm.cxx:2289
void SwitchPaperMode(bool bNew)
Definition: atrfrm.cxx:2489
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:2293
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:2310
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
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
sal_Int32 m_nLines
Definition: tgrditem.hxx:36
void SetGridType(SwTextGrid eNew)
Definition: tgrditem.hxx:82
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
void SetLines(sal_Int32 nNew)
Definition: tgrditem.hxx:73
SwTextGrid m_eGridType
Definition: tgrditem.hxx:39
sal_uInt16 m_nBaseHeight
Definition: tgrditem.hxx:37
sal_Int32 GetLines() const
Definition: tgrditem.hxx:72
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: atrfrm.cxx:2315
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:112
SwTextField * GetFieldTextAttrAt(const sal_Int32 nIndex, ::sw::GetTextAttrMode const eMode=::sw::GetTextAttrMode::Expand) const
Definition: ndtxt.cxx:1849
Used by the UI to modify the document model.
Definition: wrtsh.hxx:97
bool Pop(SwCursorShell::PopMode, ::std::optional< SwCallLink > &roLink)
Definition: wrtsh1.cxx:2047
static SW_DLLPUBLIC rtl::Reference< SwXTextFrame > CreateXTextFrame(SwDoc &rDoc, SwFrameFormat *pFrameFormat)
Definition: unoframe.cxx:3234
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
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:3238
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:3813
bool IsAnchoredObjShown(SwTextFrame const &rFrame, SwFormatAnchor const &rAnchor)
Definition: frmtool.cxx:1330
MirrorGraph
Definition: grfatr.hxx:32
constexpr TypedWhichId< SwPtrMsgPoolItem > RES_REMOVE_UNO_OBJECT(181)
constexpr TypedWhichId< SwFormatURL > RES_URL(117)
constexpr TypedWhichId< SwFormatHeader > RES_HEADER(102)
constexpr TypedWhichId< SwFormatFrameSize > RES_FRM_SIZE(89)
constexpr TypedWhichId< SwFormatCol > RES_COL(115)
constexpr TypedWhichId< SwFormatHoriOrient > RES_HORI_ORIENT(109)
constexpr TypedWhichId< SwFormatVertOrient > RES_VERT_ORIENT(108)
constexpr TypedWhichId< SwFormatPageDesc > RES_PAGEDESC(99)
constexpr TypedWhichId< SwFormatFillOrder > RES_FILL_ORDER(RES_FRMATR_BEGIN)
constexpr TypedWhichId< SwTextGridItem > RES_TEXTGRID(121)
constexpr TypedWhichId< SwAttrSetChg > RES_ATTRSET_CHG(169)
constexpr TypedWhichId< SwFlyFrameFormat > RES_FLYFRMFMT(162)
constexpr TypedWhichId< SwFormatLineNumber > RES_LINENUMBER(122)
constexpr TypedWhichId< SwFormatFooter > RES_FOOTER(103)
constexpr TypedWhichId< SwTableBoxNumFormat > RES_BOXATR_FORMAT(RES_BOXATR_BEGIN)
constexpr TypedWhichId< SwDrawFrameFormat > RES_DRAWFRMFMT(165)
constexpr TypedWhichId< SwFormatAnchor > RES_ANCHOR(110)
constexpr TypedWhichId< SfxBoolItem > RES_DECORATIVE(140)
constexpr TypedWhichId< SwFormatChain > RES_CHAIN(120)
constexpr TypedWhichId< SwFormatSurround > RES_SURROUND(107)
constexpr TypedWhichId< SwFormatContent > RES_CNTNT(101)
constexpr TypedWhichId< SwPtrMsgPoolItem > RES_OBJECTDYING(RES_FORMAT_MSG_BEGIN)
constexpr TypedWhichId< SwFormatChg > RES_FMT_CHG(168)
const char * name
#define IMAP_MIRROR_VERT
#define IMAP_MIRROR_HORZ
#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:3663
bool IsFlyFrameFormatInHeader(const SwFrameFormat &rFormat)
Definition: atrfrm.cxx:3638
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:1043
#define CONVERT_TWIPS
bool IsInvalidItem(const SfxPoolItem *pItem)
QPRO_FUNC_TYPE nType
Marks a position in the document model.
Definition: pam.hxx:38
SwNode & GetNode() const
Definition: pam.hxx:81
SwNodeIndex nNode
Definition: pam.hxx:39
void AdjustContent(sal_Int32 nDelta)
Adjust content index, only valid to call this if the position points to a SwContentNode subclass.
Definition: pam.cxx:262
SwContentIndex nContent
Definition: pam.hxx:40
virtual ~CheckDrawFrameFormatLayerHint() override
Definition: atrfrm.cxx:3458
virtual ~CollectTextObjectsHint() override
Definition: atrfrm.cxx:3465
virtual ~ContactChangedHint() override
Definition: atrfrm.cxx:3459
virtual ~CreatePortionHint() override
Definition: atrfrm.cxx:3463
virtual ~DrawFormatLayoutCopyHint() override
Definition: atrfrm.cxx:3460
virtual ~DrawFrameFormatHint() override
Definition: atrfrm.cxx:3457
virtual ~FindSdrObjectHint() override
Definition: atrfrm.cxx:3464
virtual ~GetObjectConnectedHint() override
Definition: atrfrm.cxx:3467
virtual ~GetZOrderHint() override
Definition: atrfrm.cxx:3466
const SfxPoolItem * m_pNew
Definition: calbck.hxx:78
virtual ~RestoreFlyAnchorHint() override
Definition: atrfrm.cxx:3462
virtual ~WW8AnchorConvHint() override
Definition: atrfrm.cxx:3461
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:539
constexpr OUStringLiteral UNO_NAME_AUTOMATIC_DISTANCE
Definition: unoprnms.hxx:632
constexpr OUStringLiteral UNO_NAME_IS_AUTOMATIC
Definition: unoprnms.hxx:502
constexpr OUStringLiteral UNO_NAME_SEPARATOR_LINE_STYLE
Definition: unoprnms.hxx:854
constexpr OUStringLiteral UNO_NAME_SEPARATOR_LINE_COLOR
Definition: unoprnms.hxx:535
constexpr OUStringLiteral UNO_NAME_SEPARATOR_LINE_WIDTH
Definition: unoprnms.hxx:534
constexpr OUStringLiteral UNO_NAME_SEPARATOR_LINE_IS_ON
Definition: unoprnms.hxx:540
constexpr OUStringLiteral UNO_NAME_SEPARATOR_LINE_RELATIVE_HEIGHT
Definition: unoprnms.hxx:537
static sal_uInt16 nPgNum
Definition: viewport.cxx:52
constexpr sal_uInt16 XATTR_FILL_FIRST(XATTRSET_LINE+1)
constexpr sal_uInt16 XATTR_FILL_LAST(XATTR_FILLUSESLIDEBACKGROUND)