20#include <libxml/xmlwriter.h>
23#include <osl/diagnose.h>
53 if ( !(pDoc = pFormat->
GetDoc())->IsInDtor() && pFormat->HasOnlyOneListener() )
73 (void)xmlTextWriterStartElement(writer,
reinterpret_cast<const xmlChar*
>(
"column"));
76 (void)xmlTextWriterStartElement(writer, BAD_CAST(
"infos"));
78 (void)xmlTextWriterEndElement(writer);
81 (void)xmlTextWriterEndElement(writer);
87 "no columns to remove." );
94 "neighbor of ColumnFrame is no ColumnFrame." );
97 for ( sal_uInt16
i = 0;
i < nCnt; ++
i )
116 for (
i = 0; pTmp; pTmp = pTmp->
GetNext(), ++
i )
142 for ( nAdd = 1; pCol; pCol = pCol->
GetNext(), ++nAdd )
147 pNeighbourCol != pCont )
149 pNeighbourCol =
nullptr;
150 pNeighbour = aIter.
Next();
165 for ( sal_uInt16
i = 0;
i <
nCount; ++
i )
179 for ( sal_uInt16
i = 0;
i <
nCount; ++
i )
184 pTmp->
Paste( pCont );
204 const bool bChgFootnote )
216 sal_uInt16 nNewNum, nOldNum = 1;
220 while(
nullptr != (pCol=pCol->
GetNext()) )
233 bool bAdjustAttributes = nOldNum != rOld.
GetNumCols();
237 if( nOldNum != nNewNum || bChgFootnote )
240 OSL_ENSURE( pDoc,
"FrameFormat doesn't return a document." );
248 if ( nNewNum == 1 && !bAtEnd )
268 if ( nOldNum > nNewNum )
271 bAdjustAttributes =
true;
273 else if( nOldNum < nNewNum )
275 sal_uInt16 nAdd = nNewNum - nOldNum;
280 if ( !bAdjustAttributes )
285 bAdjustAttributes =
true;
292 bAdjustAttributes =
true;
330 if ( !bAdjustAttributes )
336 nAvail -= (pCol->getFrameArea().*fnRect->
fnGetWidth)();
346 const sal_uInt16 nMin = bLine ? sal_uInt16( 20 + ( pAttr->
GetLineWidth() / 2) ) : 0;
357 for ( sal_uInt16
i = 0;
i < pAttr->
GetNumCols() && pCol; ++
i )
365 const Size aColSz = bVert ?
381 if ( bOrtho || bAdjustAttributes )
391 const sal_uInt16 nLeft = pC->
GetLeft();
392 const sal_uInt16 nRight = pC->
GetRight();
401 aLR.
SetRight( std::max( nRight, nMin ) );
405 aLR.
SetLeft ( std::max( nLeft, nMin ) );
409 aLR.
SetLeft ( std::max( nLeft, nMin ) );
410 aLR.
SetRight( std::max( nRight, nMin ) );
414 if ( bAdjustAttributes )
448 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
void dumpAsXml(xmlTextWriterPtr writer=nullptr) const 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,...
void dumpInfosAsXml(xmlTextWriterPtr writer) const
SwLayoutFrame * GetUpper()
virtual void dumpAsXmlAttributes(xmlTextWriterPtr writer) const
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
void dumpChildrenAsXml(xmlTextWriterPtr writer) const
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)
struct _xmlTextWriter * xmlTextWriterPtr
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)