21#include <osl/diagnose.h>
51 if ( !(pDoc = pFormat->
GetDoc())->IsInDtor() && pFormat->HasOnlyOneListener() )
72 "no columns to remove." );
79 "neighbor of ColumnFrame is no ColumnFrame." );
82 for ( sal_uInt16
i = 0;
i < nCnt; ++
i )
101 for (
i = 0; pTmp; pTmp = pTmp->
GetNext(), ++
i )
127 for ( nAdd = 1; pCol; pCol = pCol->
GetNext(), ++nAdd )
132 pNeighbourCol != pCont )
134 pNeighbourCol =
nullptr;
135 pNeighbour = aIter.
Next();
150 for ( sal_uInt16
i = 0;
i <
nCount; ++
i )
164 for ( sal_uInt16
i = 0;
i <
nCount; ++
i )
169 pTmp->
Paste( pCont );
189 const bool bChgFootnote )
201 sal_uInt16 nNewNum, nOldNum = 1;
205 while(
nullptr != (pCol=pCol->
GetNext()) )
218 bool bAdjustAttributes = nOldNum != rOld.
GetNumCols();
222 if( nOldNum != nNewNum || bChgFootnote )
225 OSL_ENSURE( pDoc,
"FrameFormat doesn't return a document." );
233 if ( nNewNum == 1 && !bAtEnd )
253 if ( nOldNum > nNewNum )
256 bAdjustAttributes =
true;
258 else if( nOldNum < nNewNum )
260 sal_uInt16 nAdd = nNewNum - nOldNum;
265 if ( !bAdjustAttributes )
270 bAdjustAttributes =
true;
277 bAdjustAttributes =
true;
315 if ( !bAdjustAttributes )
321 nAvail -= (pCol->getFrameArea().*fnRect->
fnGetWidth)();
331 const sal_uInt16 nMin = bLine ? sal_uInt16( 20 + ( pAttr->
GetLineWidth() / 2) ) : 0;
342 for ( sal_uInt16
i = 0;
i < pAttr->
GetNumCols() && pCol; ++
i )
350 const Size aColSz = bVert ?
366 if ( bOrtho || bAdjustAttributes )
376 const sal_uInt16 nLeft = pC->
GetLeft();
377 const sal_uInt16 nRight = pC->
GetRight();
386 aLR.
SetRight( std::max( nRight, nMin ) );
390 aLR.
SetLeft ( std::max( nLeft, nMin ) );
394 aLR.
SetLeft ( std::max( nLeft, nMin ) );
395 aLR.
SetRight( std::max( nRight, nMin ) );
399 if ( bAdjustAttributes )
433 const Size aColSz = bVert ?
virtual const SwRootFrame * GetCurrentLayout() const =0
virtual void ResetModified()=0
virtual bool IsModified() const =0
Changes of document?
void SetRight(const tools::Long nR, const sal_uInt16 nProp=100)
tools::Long GetRight() const
tools::Long GetLeft() const
void SetLeft(const tools::Long nL, const sal_uInt16 nProp=100)
void SetLower(const sal_uInt16 nL, const sal_uInt16 nProp=100)
void SetUpper(const sal_uInt16 nU, const sal_uInt16 nProp=100)
const SvxLRSpaceItem & GetLRSpace(bool=true) const
const SvxULSpaceItem & GetULSpace(bool=true) const
Container of body content (i.e.
virtual void DestroyImpl() override
SwColumnFrame(SwFrameFormat *, SwFrame *)
virtual ~SwColumnFrame() override
sal_uInt16 GetLeft() const
sal_uInt16 GetRight() const
SwFrameFormat * MakeFrameFormat(const OUString &rFormatName, SwFrameFormat *pDerivedFrom, bool bBroadcast=false, bool bAuto=true)
IDocumentState const & getIDocumentState() const
const SwFrameFormat * GetColumnContFormat() const
IDocumentUndoRedo & GetIDocumentUndoRedo()
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
void DelFrameFormat(SwFrameFormat *pFormat, bool bBroadcast=false)
const SwFrameFormat * GetDfltFrameFormat() const
const SwRect & getFramePrintArea() const
Base class of the Writer layout elements.
void InsertBehind(SwLayoutFrame *pParent, SwFrame *pBefore)
Insert SwFrame into existing structure.
bool IsColumnFrame() const
bool IsRightToLeft() const
void InsertBefore(SwLayoutFrame *pParent, SwFrame *pBehind)
Insert SwFrame into existing structure.
bool IsPageBodyFrame() const
const SwAttrSet * GetAttrSet() const
WARNING: this may not return correct RES_PAGEDESC/RES_BREAK items for SwTextFrame,...
SwLayoutFrame * GetUpper()
bool IsNoTextFrame() const
SwPageFrame * FindPageFrame()
virtual Size ChgSize(const Size &aNewSize)
static void DestroyFrame(SwFrame *const pFrame)
this is the only way to delete a SwFrame instance
bool IsLayoutFrame() const
A layout frame is a frame that contains other frames (m_pLower), e.g. SwPageFrame or SwTabFrame.
void SetFrameFormat(SwFrameFormat *)
void AdjustColumns(const SwFormatCol *pCol, bool bAdjustAttributes)
virtual const SwFrameFormat * GetFormat() const
virtual void DestroyImpl() override
friend void RestoreContent(SwFrame *, SwLayoutFrame *, SwFrame *pSibling)
virtual void Paste(SwFrame *pParent, SwFrame *pSibling=nullptr) override
const SwFrame * GetLastLower() const
friend SwFrame * SaveContent(SwLayoutFrame *, SwFrame *)
void ChgColumns(const SwFormatCol &rOld, const SwFormatCol &rNew, const bool bChgFootnote=false)
add or remove columns from a layoutframe.
const SwFrame * Lower() const
virtual void Cut() override
A page of the document layout.
void RemoveFootnotes(SwPageFrame *pPage=nullptr, bool bPageOnly=false, bool bEndNotes=false)
Remove all footnotes (but no references)
static SwLayoutFrame * lcl_FindColumns(SwLayoutFrame *pLay, sal_uInt16 nCount)
static void lcl_RemoveColumns(SwLayoutFrame *pCont, sal_uInt16 nCnt)
static bool lcl_AddColumns(SwLayoutFrame *pCont, sal_uInt16 nCount)
SwRectFn fnRectVertL2RB2T
void sw_RemoveFootnotes(SwFootnoteBossFrame *pBoss, bool bPageOnly, bool bEndNotes)
remove all footnotes (not the references) and all footnote pages
SwNodeOffset min(const SwNodeOffset &a, const SwNodeOffset &b)