2010-10-14 08:30:41 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2000-09-18 23:08:29 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-10 13:30:50 +00:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
2010-02-12 15:01:35 +01:00
|
|
|
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
2008-04-10 13:30:50 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
2008-04-10 13:30:50 +00:00
|
|
|
* This file is part of OpenOffice.org.
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
2008-04-10 13:30:50 +00:00
|
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
* only, as published by the Free Software Foundation.
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
2008-04-10 13:30:50 +00:00
|
|
|
* OpenOffice.org is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License version 3 for more details
|
|
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
2008-04-10 13:30:50 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
|
|
* <http://www.openoffice.org/license.html>
|
|
|
|
* for a copy of the LGPLv3 License.
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
|
|
|
************************************************************************/
|
2010-09-30 16:03:07 +02:00
|
|
|
#ifndef SW_TABFRM_HXX
|
|
|
|
#define SW_TABFRM_HXX
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
#include <tools/mempool.hxx>
|
|
|
|
#include "layfrm.hxx"
|
|
|
|
#include "flowfrm.hxx"
|
|
|
|
|
|
|
|
class SwTable;
|
|
|
|
class SwBorderAttrs;
|
|
|
|
class SwAttrSetChg;
|
|
|
|
|
|
|
|
class SwTabFrm: public SwLayoutFrm, public SwFlowFrm
|
|
|
|
{
|
2003-04-17 09:11:35 +00:00
|
|
|
// OD 14.03.2003 #i11760# - adjustment, because of method signature change
|
2000-09-18 23:08:29 +00:00
|
|
|
//darf mit den Flags spielen.
|
2003-04-17 09:11:35 +00:00
|
|
|
friend void CalcCntnt( SwLayoutFrm *pLay, bool bNoColl, bool bNoCalcFollow );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
//Fuert Spezialbehandlung fuer _Get[Next|Prev]Leaf() durch.
|
2007-09-27 07:58:50 +00:00
|
|
|
using SwFrm::GetLeaf;
|
2011-01-17 15:06:54 +01:00
|
|
|
SwLayoutFrm *GetLeaf( MakePageType eMakePage, sal_Bool bFwd );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2004-07-12 12:33:12 +00:00
|
|
|
SwTable* pTable;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bComplete :1; //Eintrage als Repaint ohne das CompletePaint
|
2000-09-18 23:08:29 +00:00
|
|
|
//der Basisklasse gesetzt werden muss. Damit
|
|
|
|
//sollen unertraegliche Tabellen-Repaints
|
|
|
|
//vermieden werden.
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bCalcLowers :1; //Im MakeAll auf jedenfall auch fuer Stabilitaet
|
2000-09-18 23:08:29 +00:00
|
|
|
//des Inhaltes sorgen.
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bLowersFormatted :1;//Kommunikation zwischen MakeAll und Layact
|
|
|
|
sal_Bool bLockBackMove :1; //BackMove-Test hat der Master erledigt.
|
|
|
|
sal_Bool bResizeHTMLTable :1; //Resize des HTMLTableLayout rufen im MakeAll
|
2000-09-18 23:08:29 +00:00
|
|
|
//Zur Optimierung, damit dies nicht im
|
|
|
|
//CntntFrm::Grow gerufen werden muss, denn dann
|
|
|
|
//wird es ggf. fuer jede Zelle gerufen #47483#
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bONECalcLowers :1; //Primaer fuer die StarONE-SS. Beim MakeAll werden
|
2000-09-18 23:08:29 +00:00
|
|
|
//die Cntnts auf jedenfall per Calc() formatiert.
|
|
|
|
//es finden keine zusaetzlichen Invalidierungen
|
|
|
|
//statt und dieser Weg kann auch kaum garantien
|
|
|
|
//geben.
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bHasFollowFlowLine :1; // Means that the first line in the follow
|
2004-01-13 10:13:20 +00:00
|
|
|
// is indented to contain content from a broken
|
|
|
|
// cell
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bIsRebuildLastLine :1; // Means that currently the last line of the
|
2004-01-13 10:13:20 +00:00
|
|
|
// TabFrame is rebuilded. In this case we
|
|
|
|
// do not want any notification to the master
|
|
|
|
// table
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bRestrictTableGrowth :1; // Usually, the table may grow infinite,
|
2004-01-13 10:13:20 +00:00
|
|
|
// because the table can be split in
|
|
|
|
// SwTabFrm::MakeAll. In MakeAll, this
|
|
|
|
// flag is set to indicate that the table
|
|
|
|
// may only grow inside its upper. This
|
|
|
|
// is necessary, in order to let the text
|
|
|
|
// flow into the FollowFlowLine
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bRemoveFollowFlowLinePending :1;
|
2004-11-16 14:43:02 +00:00
|
|
|
// --> OD 2004-10-04 #i26945#
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bConsiderObjsForMinCellHeight :1; // Usually, the floating screen objects
|
2004-11-16 14:43:02 +00:00
|
|
|
// are considered on the calculation
|
|
|
|
// for the minimal cell height.
|
|
|
|
// For splitting table rows algorithm
|
|
|
|
// it's needed not to consider floating
|
|
|
|
// screen object for the preparation
|
|
|
|
// of the re-calculation of the
|
|
|
|
// last table row.
|
|
|
|
// <--
|
|
|
|
// --> OD 2004-10-15 #i26945#
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bObjsDoesFit :1; // For splitting table rows algorithm, this boolean
|
2004-11-16 14:43:02 +00:00
|
|
|
// indicates, if the floating screen objects fits
|
|
|
|
// <--
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bDummy4 :1;
|
2004-01-13 10:13:20 +00:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
//Split() spaltet den Frm an der angegebenen Stelle, es wird ein
|
|
|
|
//Follow erzeugt und aufgebaut und direkt hinter this gepastet.
|
|
|
|
//Join() Holt sich den Inhalt aus dem Follow und vernichtet diesen.
|
2006-03-09 13:06:11 +00:00
|
|
|
bool Split( const SwTwips nCutPos, bool bTryToSplit, bool bTableRowKeep );
|
2004-01-13 10:13:20 +00:00
|
|
|
bool Join();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
void _UpdateAttr( SfxPoolItem*, SfxPoolItem*, sal_uInt8 &,
|
2000-09-18 23:08:29 +00:00
|
|
|
SwAttrSetChg *pa = 0, SwAttrSetChg *pb = 0 );
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
virtual sal_Bool ShouldBwdMoved( SwLayoutFrm *pNewUpper, sal_Bool bHead, sal_Bool &rReformat );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void MakeAll();
|
|
|
|
virtual void Format( const SwBorderAttrs *pAttrs = 0 );
|
|
|
|
//Aendert nur die Framesize, nicht die PrtArea-SSize
|
2011-01-17 15:06:54 +01:00
|
|
|
virtual SwTwips GrowFrm ( SwTwips, sal_Bool bTst = sal_False, sal_Bool bInfo = sal_False );
|
2000-09-18 23:08:29 +00:00
|
|
|
public:
|
|
|
|
SwTabFrm( SwTable & ); //Immer nach dem erzeugen _und_ pasten das
|
|
|
|
//Regist Flys rufen!
|
|
|
|
SwTabFrm( SwTabFrm & ); //_Nur_ zum erzeugen von Follows
|
|
|
|
~SwTabFrm();
|
|
|
|
|
|
|
|
void JoinAndDelFollows(); //Fuer DelFrms des TableNodes!
|
|
|
|
|
|
|
|
//Ruft das RegistFlys der Zeilen.
|
|
|
|
void RegistFlys();
|
|
|
|
|
|
|
|
inline const SwTabFrm *GetFollow() const;
|
|
|
|
inline SwTabFrm *GetFollow();
|
2004-01-13 10:13:20 +00:00
|
|
|
SwTabFrm* FindMaster( bool bFirstMaster = false ) const;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
virtual void Modify( SfxPoolItem*, SfxPoolItem* );
|
2011-01-17 15:06:54 +01:00
|
|
|
virtual sal_Bool GetInfo( SfxPoolItem &rHnt ) const;
|
2010-09-30 16:03:07 +02:00
|
|
|
virtual void Paint( SwRect const&,
|
|
|
|
SwPrintData const*const pPrintData = NULL ) const;
|
2011-01-17 15:06:54 +01:00
|
|
|
virtual void CheckDirection( sal_Bool bVert );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
virtual void Cut();
|
|
|
|
virtual void Paste( SwFrm* pParent, SwFrm* pSibling = 0 );
|
|
|
|
|
2002-01-10 14:36:36 +00:00
|
|
|
virtual void Prepare( const PrepareHint ePrep = PREP_CLEAR,
|
|
|
|
const void *pVoid = 0, sal_Bool bNotify = sal_True );
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
SwCntntFrm *FindLastCntnt();
|
|
|
|
inline const SwCntntFrm *FindLastCntnt() const;
|
|
|
|
|
|
|
|
const SwTable *GetTable() const { return pTable; }
|
|
|
|
SwTable *GetTable() { return pTable; }
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool IsComplete() { return bComplete; }
|
|
|
|
void SetComplete() { bComplete = sal_True; }
|
|
|
|
void ResetComplete() { bComplete = sal_False; }
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool IsLowersFormatted() const { return bLowersFormatted; }
|
|
|
|
void SetLowersFormatted( sal_Bool b ) { bLowersFormatted = b; }
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
void SetCalcLowers() { bCalcLowers = sal_True; } //Sparsam einsetzen!
|
|
|
|
void SetResizeHTMLTable() { bResizeHTMLTable = sal_True; } //dito
|
|
|
|
void SetONECalcLowers() { bONECalcLowers = sal_True; }
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2004-05-03 12:46:31 +00:00
|
|
|
//
|
|
|
|
// Start: New stuff for breaking table rows
|
|
|
|
//
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool HasFollowFlowLine() const { return bHasFollowFlowLine; }
|
|
|
|
void SetFollowFlowLine( sal_Bool bNew ) { bHasFollowFlowLine = bNew; }
|
2004-01-13 10:13:20 +00:00
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool IsRebuildLastLine() const { return bIsRebuildLastLine; }
|
|
|
|
void SetRebuildLastLine( sal_Bool bNew ) { bIsRebuildLastLine = bNew; }
|
2004-01-13 10:13:20 +00:00
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool IsRestrictTableGrowth() const { return bRestrictTableGrowth; }
|
|
|
|
void SetRestrictTableGrowth( sal_Bool bNew ) { bRestrictTableGrowth = bNew; }
|
2004-01-13 10:13:20 +00:00
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool IsRemoveFollowFlowLinePending() const { return bRemoveFollowFlowLinePending; }
|
|
|
|
void SetRemoveFollowFlowLinePending( sal_Bool bNew ) { bRemoveFollowFlowLinePending = bNew; }
|
2004-01-13 10:13:20 +00:00
|
|
|
|
2004-11-16 14:43:02 +00:00
|
|
|
// --> OD 2004-10-04 #i26945#
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool IsConsiderObjsForMinCellHeight() const
|
2004-11-16 14:43:02 +00:00
|
|
|
{
|
|
|
|
return bConsiderObjsForMinCellHeight;
|
|
|
|
}
|
2011-01-17 15:06:54 +01:00
|
|
|
void SetConsiderObjsForMinCellHeight( sal_Bool _bNewConsiderObjsForMinCellHeight )
|
2004-11-16 14:43:02 +00:00
|
|
|
{
|
|
|
|
bConsiderObjsForMinCellHeight = _bNewConsiderObjsForMinCellHeight;
|
|
|
|
}
|
|
|
|
// <--
|
|
|
|
// --> OD 2004-10-04 #i26945#
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool DoesObjsFit() const
|
2004-11-16 14:43:02 +00:00
|
|
|
{
|
|
|
|
return bObjsDoesFit;
|
|
|
|
}
|
2011-01-17 15:06:54 +01:00
|
|
|
void SetDoesObjsFit( sal_Bool _bNewObjsDoesFit )
|
2004-11-16 14:43:02 +00:00
|
|
|
{
|
|
|
|
bObjsDoesFit = _bNewObjsDoesFit;
|
|
|
|
}
|
|
|
|
// <--
|
|
|
|
|
2006-01-19 17:20:06 +00:00
|
|
|
bool RemoveFollowFlowLine();
|
2004-05-03 12:46:31 +00:00
|
|
|
//
|
|
|
|
// End: New stuff for breaking table rows
|
|
|
|
//
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool CalcFlyOffsets( SwTwips& rUpper, long& rLeftOffset,
|
2000-09-18 23:08:29 +00:00
|
|
|
long& rRightOffset ) const;
|
2004-03-17 11:48:25 +00:00
|
|
|
|
2004-06-01 06:43:18 +00:00
|
|
|
SwTwips CalcHeightOfFirstContentLine() const;
|
|
|
|
|
2006-01-19 17:20:06 +00:00
|
|
|
bool IsInHeadline( const SwFrm& rFrm ) const;
|
2004-05-03 12:46:31 +00:00
|
|
|
SwRowFrm* GetFirstNonHeadlineRow() const;
|
|
|
|
|
2004-03-17 11:48:25 +00:00
|
|
|
bool IsLayoutSplitAllowed() const;
|
|
|
|
|
2004-07-12 12:33:12 +00:00
|
|
|
// --> collapsing borders FME 2005-05-27 #i29550#
|
|
|
|
bool IsCollapsingBorders() const;
|
|
|
|
|
|
|
|
// used for collapsing border lines:
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 GetBottomLineSize() const;
|
2004-07-12 12:33:12 +00:00
|
|
|
// <-- collapsing
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
DECL_FIXEDMEMPOOL_NEWDEL(SwTabFrm)
|
|
|
|
};
|
|
|
|
|
|
|
|
inline const SwCntntFrm *SwTabFrm::FindLastCntnt() const
|
|
|
|
{
|
|
|
|
return ((SwTabFrm*)this)->FindLastCntnt();
|
|
|
|
}
|
|
|
|
|
|
|
|
inline const SwTabFrm *SwTabFrm::GetFollow() const
|
|
|
|
{
|
|
|
|
return (const SwTabFrm*)SwFlowFrm::GetFollow();
|
|
|
|
}
|
|
|
|
inline SwTabFrm *SwTabFrm::GetFollow()
|
|
|
|
{
|
|
|
|
return (SwTabFrm*)SwFlowFrm::GetFollow();
|
|
|
|
}
|
|
|
|
|
2010-09-30 16:03:07 +02:00
|
|
|
#endif // SW_TABFRM_HXX
|
2010-10-14 08:30:41 +02:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|