2000-09-18 23:08:29 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-10 13:16:52 +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:16:52 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
2008-04-10 13:16:52 +00:00
|
|
|
* This file is part of OpenOffice.org.
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
2008-04-10 13:16:52 +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:16:52 +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:16:52 +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
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
#ifndef _FRMTOOL_HXX
|
|
|
|
#define _FRMTOOL_HXX
|
|
|
|
#include "swtypes.hxx"
|
|
|
|
#include "layfrm.hxx"
|
|
|
|
#include "frmatr.hxx"
|
|
|
|
#include "swcache.hxx"
|
2008-12-16 08:01:40 +00:00
|
|
|
// --> OD 2008-12-04 #i96772#
|
2010-01-08 18:32:51 +01:00
|
|
|
#include <editeng/lrspitem.hxx>
|
2008-12-16 08:01:40 +00:00
|
|
|
// <--
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
class SwPageFrm;
|
|
|
|
class SwFlyFrm;
|
|
|
|
class SwCntntFrm;
|
|
|
|
class SwDoc;
|
|
|
|
class SwAttrSet;
|
|
|
|
class SdrObject;
|
|
|
|
class BigInt;
|
|
|
|
class SvxBrushItem;
|
|
|
|
class SdrMarkList;
|
|
|
|
class SwNodeIndex;
|
|
|
|
class OutputDevice;
|
|
|
|
class SwPageDesc;
|
2007-02-28 14:45:00 +00:00
|
|
|
class SwTableBox;
|
|
|
|
struct SwFindRowSpanCacheObj;
|
2006-08-14 15:20:13 +00:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
#if defined(MSC)
|
|
|
|
#define MA_FASTCALL __fastcall
|
|
|
|
#else
|
|
|
|
#define MA_FASTCALL
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define WEIT_WECH LONG_MAX - 20000 //Initale Position der Flys.
|
2004-12-09 15:41:01 +00:00
|
|
|
#define BROWSE_HEIGHT 56700L * 10L //10 Meter
|
|
|
|
//#define BROWSE_HEIGHT 1440L * 45L // 45 inch, maximum size for pdf files
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
#define GRFNUM_NO 0
|
|
|
|
#define GRFNUM_YES 1
|
|
|
|
#define GRFNUM_REPLACE 2
|
|
|
|
|
|
|
|
//Painten des Hintergrunds. Mit Brush oder Graphic.
|
2003-03-27 14:45:43 +00:00
|
|
|
// OD 05.08.2002 #99657# - add 6th parameter to indicate that method should
|
|
|
|
// consider background transparency, saved in the color of the brush item
|
2000-09-18 23:08:29 +00:00
|
|
|
void MA_FASTCALL DrawGraphic( const SvxBrushItem *, OutputDevice *,
|
2002-08-28 10:58:11 +00:00
|
|
|
const SwRect &rOrg, const SwRect &rOut, const BYTE nGrfNum = GRFNUM_NO,
|
|
|
|
const sal_Bool bConsiderBackgroundTransparency = sal_False );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2003-03-27 14:45:43 +00:00
|
|
|
// OD 24.01.2003 #106593# - method to align rectangle
|
|
|
|
// Created declaration here to avoid <extern> declarations
|
|
|
|
void MA_FASTCALL SwAlignRect( SwRect &rRect, ViewShell *pSh );
|
|
|
|
|
|
|
|
// OD 24.01.2003 #106593# - method to align graphic rectangle
|
|
|
|
// Created declaration here to avoid <extern> declarations
|
|
|
|
void SwAlignGrfRect( SwRect *pGrfRect, const OutputDevice &rOut );
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
//Fly besorgen, wenn keine List hineingereicht wird, wir die der aktuellen
|
|
|
|
//Shell benutzt.
|
|
|
|
//Implementierung in feshview.cxx
|
|
|
|
SwFlyFrm *GetFlyFromMarked( const SdrMarkList *pLst, ViewShell *pSh );
|
|
|
|
|
|
|
|
//Nicht gleich die math.lib anziehen.
|
|
|
|
ULONG MA_FASTCALL SqRt( BigInt nX );
|
|
|
|
|
2006-01-19 17:19:15 +00:00
|
|
|
SwFrm *SaveCntnt( SwLayoutFrm *pLay, SwFrm *pStart );
|
|
|
|
void RestoreCntnt( SwFrm *pSav, SwLayoutFrm *pParent, SwFrm *pSibling, bool bGrow );
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
//CntntNodes besorgen, CntntFrms erzeugen und in den LayFrm haengen.
|
|
|
|
void MA_FASTCALL _InsertCnt( SwLayoutFrm *pLay, SwDoc *pDoc, ULONG nIndex,
|
|
|
|
BOOL bPages = FALSE, ULONG nEndIndex = 0,
|
|
|
|
SwFrm *pPrv = 0 );
|
|
|
|
|
|
|
|
//Erzeugen der Frames fuer einen bestimmten Bereich, verwendet _InsertCnt
|
|
|
|
void MakeFrms( SwDoc *pDoc, const SwNodeIndex &rSttIdx,
|
|
|
|
const SwNodeIndex &rEndIdx );
|
|
|
|
|
|
|
|
//Um z.B. fuer Tabelleheadlines das Erzeugen der Flys in _InsertCnt zu unterbinden.
|
2007-09-27 07:57:00 +00:00
|
|
|
extern BOOL bDontCreateObjects;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
//Fuer FlyCnts, siehe SwFlyAtCntFrm::MakeAll()
|
2007-09-27 07:57:00 +00:00
|
|
|
extern BOOL bSetCompletePaintOnInvalidate;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
//Fuer Tabelleneinstellung per Tastatur.
|
|
|
|
long MA_FASTCALL CalcRowRstHeight( SwLayoutFrm *pRow );
|
|
|
|
long MA_FASTCALL CalcHeightWidthFlys( const SwFrm *pFrm ); //MA_FLY_HEIGHT
|
|
|
|
|
|
|
|
//Neue Seite einsetzen
|
|
|
|
SwPageFrm * MA_FASTCALL InsertNewPage( SwPageDesc &rDesc, SwFrm *pUpper,
|
2001-03-02 09:29:57 +00:00
|
|
|
BOOL bOdd, BOOL bInsertEmpty, BOOL bFtn,
|
2000-09-18 23:08:29 +00:00
|
|
|
SwFrm *pSibling );
|
|
|
|
|
|
|
|
//Flys bei der Seite anmelden.
|
|
|
|
void RegistFlys( SwPageFrm*, const SwLayoutFrm* );
|
|
|
|
|
|
|
|
//Benachrichtung des Fly Hintergrundes wenn Notwendig.
|
2004-02-16 10:57:33 +00:00
|
|
|
void Notify( SwFlyFrm *pFly, SwPageFrm *pOld, const SwRect &rOld,
|
|
|
|
const SwRect* pOldRect = 0 );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2004-06-28 12:36:42 +00:00
|
|
|
void Notify_Background( const SdrObject* pObj,
|
|
|
|
SwPageFrm* pPage,
|
|
|
|
const SwRect& rRect,
|
|
|
|
const PrepareHint eHint,
|
|
|
|
const BOOL bInva );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
const SwFrm* GetVirtualUpper( const SwFrm* pFrm, const Point& rPos );
|
|
|
|
|
|
|
|
BOOL Is_Lower_Of( const SwFrm *pCurrFrm, const SdrObject* pObj );
|
|
|
|
|
|
|
|
const SwFrm *FindKontext( const SwFrm *pFrm, USHORT nAdditionalKontextTyp );
|
|
|
|
|
|
|
|
BOOL IsFrmInSameKontext( const SwFrm *pInnerFrm, const SwFrm *pFrm );
|
|
|
|
|
|
|
|
const SwFrm * MA_FASTCALL FindPage( const SwRect &rRect, const SwFrm *pPage );
|
|
|
|
|
|
|
|
// JP 07.05.98: wird von SwCntntNode::GetFrm und von SwFlyFrm::GetFrm
|
|
|
|
// gerufen
|
2010-01-05 16:37:42 +01:00
|
|
|
SwFrm* GetFrmOfModify( SwModify const&, USHORT const nFrmType, const Point* = 0,
|
2000-09-18 23:08:29 +00:00
|
|
|
const SwPosition *pPos = 0,
|
|
|
|
const BOOL bCalcFrm = FALSE );
|
|
|
|
|
|
|
|
//Sollen ExtraDaten (Reline-Strich, Zeilennummern) gepaintet werden?
|
2007-09-27 07:57:00 +00:00
|
|
|
BOOL IsExtraData( const SwDoc *pDoc );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2003-04-17 09:11:24 +00:00
|
|
|
// OD 14.03.2003 #i11760# - method declaration <CalcCntnt(..)>
|
|
|
|
void CalcCntnt( SwLayoutFrm *pLay,
|
|
|
|
bool bNoColl = false,
|
|
|
|
bool bNoCalcFollow = false );
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
//Die Notify-Klassen merken sich im CTor die aktuellen Groessen und fuehren
|
|
|
|
//im DTor ggf. die notwendigen Benachrichtigungen durch.
|
|
|
|
|
|
|
|
class SwFrmNotify
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
SwFrm *pFrm;
|
|
|
|
const SwRect aFrm;
|
|
|
|
const SwRect aPrt;
|
2003-05-22 08:45:51 +00:00
|
|
|
SwTwips mnFlyAnchorOfst;
|
|
|
|
SwTwips mnFlyAnchorOfstNoWrap;
|
2007-09-27 07:57:00 +00:00
|
|
|
BOOL bHadFollow;
|
|
|
|
BOOL bInvaKeep;
|
|
|
|
BOOL bValidSize;
|
2005-09-28 10:08:31 +00:00
|
|
|
protected:
|
|
|
|
// --> OD 2005-07-29 #i49383#
|
|
|
|
bool mbFrmDeleted;
|
|
|
|
// <--
|
2002-03-08 12:23:38 +00:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
public:
|
|
|
|
SwFrmNotify( SwFrm *pFrm );
|
|
|
|
~SwFrmNotify();
|
|
|
|
|
|
|
|
const SwRect &Frm() const { return aFrm; }
|
|
|
|
const SwRect &Prt() const { return aPrt; }
|
|
|
|
void SetInvaKeep() { bInvaKeep = TRUE; }
|
2005-09-28 10:08:31 +00:00
|
|
|
// --> OD 2005-07-29 #i49383#
|
|
|
|
void FrmDeleted()
|
|
|
|
{
|
|
|
|
mbFrmDeleted = true;
|
|
|
|
}
|
|
|
|
// <--
|
2000-09-18 23:08:29 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class SwLayNotify : public SwFrmNotify
|
|
|
|
{
|
2007-09-27 07:57:00 +00:00
|
|
|
BOOL bLowersComplete;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
SwLayoutFrm *GetLay() { return (SwLayoutFrm*)pFrm; }
|
|
|
|
public:
|
|
|
|
SwLayNotify( SwLayoutFrm *pLayFrm );
|
|
|
|
~SwLayNotify();
|
|
|
|
|
2007-09-27 07:57:00 +00:00
|
|
|
void SetLowersComplete( BOOL b ) { bLowersComplete = b; }
|
|
|
|
BOOL IsLowersComplete() { return bLowersComplete; }
|
2000-09-18 23:08:29 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class SwFlyNotify : public SwLayNotify
|
|
|
|
{
|
|
|
|
SwPageFrm *pOldPage;
|
|
|
|
const SwRect aFrmAndSpace;
|
|
|
|
SwFlyFrm *GetFly() { return (SwFlyFrm*)pFrm; }
|
|
|
|
public:
|
|
|
|
SwFlyNotify( SwFlyFrm *pFlyFrm );
|
|
|
|
~SwFlyNotify();
|
|
|
|
|
|
|
|
SwPageFrm *GetOldPage() const { return pOldPage; }
|
|
|
|
};
|
|
|
|
|
|
|
|
class SwCntntNotify : public SwFrmNotify
|
|
|
|
{
|
2004-02-26 15:59:24 +00:00
|
|
|
private:
|
|
|
|
// OD 08.01.2004 #i11859#
|
|
|
|
bool mbChkHeightOfLastLine;
|
|
|
|
SwTwips mnHeightOfLastLine;
|
|
|
|
|
2004-03-09 08:53:11 +00:00
|
|
|
// OD 2004-02-26 #i25029#
|
|
|
|
bool mbInvalidatePrevPrtArea;
|
|
|
|
bool mbBordersJoinedWithPrev;
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
SwCntntFrm *GetCnt() { return (SwCntntFrm*)pFrm; }
|
2004-02-26 15:59:24 +00:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
public:
|
|
|
|
SwCntntNotify( SwCntntFrm *pCntFrm );
|
|
|
|
~SwCntntNotify();
|
2004-03-09 08:53:11 +00:00
|
|
|
|
|
|
|
// OD 2004-02-26 #i25029#
|
|
|
|
void SetInvalidatePrevPrtArea()
|
|
|
|
{
|
|
|
|
mbInvalidatePrevPrtArea = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
void SetBordersJoinedWithPrev()
|
|
|
|
{
|
|
|
|
mbBordersJoinedWithPrev = true;
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//SwBorderAttrs kapselt die Berechnung fuer die Randattribute inclusive
|
|
|
|
//Umrandung. Die Attribute und die errechneten Werte werden gecached.
|
|
|
|
//Neu: Die gesammte Klasse wird gecached.
|
|
|
|
|
|
|
|
//!!!Achtung: Wenn weitere Attribute gecached werden muss unbedingt die
|
|
|
|
//Methode Modify::Modify mitgepflegt werden!!!
|
|
|
|
|
2003-03-27 14:45:43 +00:00
|
|
|
// OD 23.01.2003 #106895# - delete old method <SwBorderAttrs::CalcRight()> and
|
|
|
|
// the stuff that belongs to it.
|
2000-09-18 23:08:29 +00:00
|
|
|
class SwBorderAttrs : public SwCacheObj
|
|
|
|
{
|
|
|
|
const SwAttrSet &rAttrSet;
|
|
|
|
const SvxULSpaceItem &rUL;
|
2008-12-16 08:01:40 +00:00
|
|
|
// --> OD 2008-12-04 #i96772#
|
|
|
|
SvxLRSpaceItem rLR;
|
|
|
|
// <--
|
2000-09-18 23:08:29 +00:00
|
|
|
const SvxBoxItem &rBox;
|
|
|
|
const SvxShadowItem &rShadow;
|
|
|
|
const Size aFrmSize; //Die FrmSize
|
|
|
|
|
|
|
|
BOOL bBorderDist :1; //Ist's ein Frm der auch ohne Linie
|
|
|
|
//einen Abstand haben kann?
|
|
|
|
|
|
|
|
//Mit den Folgenden Bools werden die gecache'ten Werte fuer UNgueltig
|
|
|
|
//erklaert - bis sie einmal berechnet wurden.
|
|
|
|
BOOL bTopLine :1;
|
|
|
|
BOOL bBottomLine :1;
|
|
|
|
BOOL bLeftLine :1;
|
|
|
|
BOOL bRightLine :1;
|
|
|
|
BOOL bTop :1;
|
|
|
|
BOOL bBottom :1;
|
|
|
|
BOOL bLine :1;
|
|
|
|
|
|
|
|
BOOL bIsLine :1; //Umrandung an mind. einer Kante?
|
|
|
|
|
|
|
|
BOOL bCacheGetLine :1; //GetTopLine(), GetBottomLine() cachen?
|
|
|
|
BOOL bCachedGetTopLine :1; //GetTopLine() gecached?
|
2003-05-27 15:10:51 +00:00
|
|
|
BOOL bCachedGetBottomLine :1; //GetBottomLine() gecached?
|
|
|
|
// OD 21.05.2003 #108789# - booleans indicating, if values <bJoinedWithPrev>
|
|
|
|
// and <bJoinedWithNext> are cached and valid.
|
|
|
|
// Caching depends on value of <bCacheGetLine>.
|
|
|
|
mutable BOOL bCachedJoinedWithPrev :1;
|
|
|
|
mutable BOOL bCachedJoinedWithNext :1;
|
|
|
|
// OD 21.05.2003 #108789# - booleans indicating, if borders are joined
|
|
|
|
// with previous/next frame.
|
|
|
|
BOOL bJoinedWithPrev :1;
|
|
|
|
BOOL bJoinedWithNext :1;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
//Die gecache'ten Werte, undefiniert bis sie einmal berechnet wurden.
|
|
|
|
USHORT nTopLine,
|
|
|
|
nBottomLine,
|
|
|
|
nLeftLine,
|
|
|
|
nRightLine,
|
|
|
|
nTop,
|
|
|
|
nBottom,
|
|
|
|
nGetTopLine,
|
|
|
|
nGetBottomLine;
|
|
|
|
|
|
|
|
//Nur die Lines + Shadow errechnen.
|
|
|
|
void _CalcTopLine();
|
|
|
|
void _CalcBottomLine();
|
|
|
|
void _CalcLeftLine();
|
|
|
|
void _CalcRightLine();
|
|
|
|
|
|
|
|
//Lines + Shadow + Abstaende
|
|
|
|
void _CalcTop();
|
|
|
|
void _CalcBottom();
|
|
|
|
|
|
|
|
void _IsLine();
|
|
|
|
|
2004-03-09 08:53:11 +00:00
|
|
|
// OD 2004-02-26 #i25029# - add optional 2nd parameter <_pPrevFrm>
|
|
|
|
// If set, its value is taken for testing, if borders/shadow have to joined
|
|
|
|
// with previous frame.
|
|
|
|
void _GetTopLine ( const SwFrm& _rFrm,
|
|
|
|
const SwFrm* _pPrevFrm = 0L );
|
|
|
|
void _GetBottomLine( const SwFrm& _rFrm );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2003-05-27 15:10:51 +00:00
|
|
|
// OD 21.05.2003 #108789# - private methods to calculate cached values
|
|
|
|
// <bJoinedWithPrev> and <bJoinedWithNext>.
|
2004-03-09 08:53:11 +00:00
|
|
|
// OD 2004-02-26 #i25029# - add optional 2nd parameter <_pPrevFrm>
|
|
|
|
// If set, its value is taken for testing, if borders/shadow have to joined
|
|
|
|
// with previous frame.
|
|
|
|
void _CalcJoinedWithPrev( const SwFrm& _rFrm,
|
|
|
|
const SwFrm* _pPrevFrm = 0L );
|
2003-05-27 15:10:51 +00:00
|
|
|
void _CalcJoinedWithNext( const SwFrm& _rFrm );
|
|
|
|
|
|
|
|
// OD 21.05.2003 #108789# - internal helper method for methods
|
|
|
|
// <_CalcJoinedWithPrev> and <_CalcJoinedWithNext>.
|
|
|
|
BOOL _JoinWithCmp( const SwFrm& _rCallerFrm,
|
|
|
|
const SwFrm& _rCmpFrm ) const;
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
//Rechte und linke Linie sowie LRSpace gleich?
|
2003-05-27 15:10:51 +00:00
|
|
|
// OD 21.05.2003 #108789# - change name of 1st parameter - "rAttrs" -> "rCmpAttrs".
|
|
|
|
BOOL CmpLeftRight( const SwBorderAttrs &rCmpAttrs,
|
|
|
|
const SwFrm *pCaller,
|
2000-09-18 23:08:29 +00:00
|
|
|
const SwFrm *pCmp ) const;
|
|
|
|
|
|
|
|
public:
|
|
|
|
DECL_FIXEDMEMPOOL_NEWDEL(SwBorderAttrs)
|
|
|
|
|
|
|
|
SwBorderAttrs( const SwModify *pOwner, const SwFrm *pConstructor );
|
|
|
|
~SwBorderAttrs();
|
|
|
|
|
|
|
|
inline const SwAttrSet &GetAttrSet() const { return rAttrSet; }
|
|
|
|
inline const SvxULSpaceItem &GetULSpace() const { return rUL; }
|
|
|
|
inline const SvxLRSpaceItem &GetLRSpace() const { return rLR; }
|
|
|
|
inline const SvxBoxItem &GetBox() const { return rBox; }
|
|
|
|
inline const SvxShadowItem &GetShadow() const { return rShadow; }
|
|
|
|
|
|
|
|
inline USHORT CalcTopLine() const;
|
|
|
|
inline USHORT CalcBottomLine() const;
|
|
|
|
inline USHORT CalcLeftLine() const;
|
|
|
|
inline USHORT CalcRightLine() const;
|
|
|
|
inline USHORT CalcTop() const;
|
|
|
|
inline USHORT CalcBottom() const;
|
|
|
|
long CalcLeft( const SwFrm *pCaller ) const;
|
2003-03-27 14:45:43 +00:00
|
|
|
long CalcRight( const SwFrm *pCaller ) const;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
inline BOOL IsLine() const;
|
|
|
|
|
|
|
|
inline const Size &GetSize() const { return aFrmSize; }
|
|
|
|
|
|
|
|
inline BOOL IsBorderDist() const { return bBorderDist; }
|
|
|
|
|
|
|
|
//Sollen obere bzw. untere Umrandung fuer den Frm ausgewertet werden?
|
2004-03-09 08:53:11 +00:00
|
|
|
// OD 2004-02-26 #i25029# - add optional 2nd parameter <_pPrevFrm>
|
|
|
|
// If set, its value is taken for testing, if borders/shadow have to joined
|
|
|
|
// with previous frame.
|
|
|
|
inline USHORT GetTopLine ( const SwFrm& _rFrm,
|
|
|
|
const SwFrm* _pPrevFrm = 0L ) const;
|
|
|
|
inline USHORT GetBottomLine( const SwFrm& _rFrm ) const;
|
2000-09-18 23:08:29 +00:00
|
|
|
inline void SetGetCacheLine( BOOL bNew ) const;
|
2003-05-27 15:10:51 +00:00
|
|
|
// OD 21.05.2003 #108789# - accessors for cached values <bJoinedWithPrev>
|
|
|
|
// and <bJoinedWithPrev>
|
2004-03-09 08:53:11 +00:00
|
|
|
// OD 2004-02-26 #i25029# - add optional 2nd parameter <_pPrevFrm>
|
|
|
|
// If set, its value is taken for testing, if borders/shadow have to joined
|
|
|
|
// with previous frame.
|
|
|
|
BOOL JoinedWithPrev( const SwFrm& _rFrm,
|
|
|
|
const SwFrm* _pPrevFrm = 0L ) const;
|
2003-05-27 15:10:51 +00:00
|
|
|
BOOL JoinedWithNext( const SwFrm& _rFrm ) const;
|
2000-09-18 23:08:29 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class SwBorderAttrAccess : public SwCacheAccess
|
|
|
|
{
|
|
|
|
const SwFrm *pConstructor; //opt: Zur weitergabe an SwBorderAttrs
|
|
|
|
protected:
|
|
|
|
virtual SwCacheObj *NewObj();
|
|
|
|
|
|
|
|
public:
|
|
|
|
SwBorderAttrAccess( SwCache &rCache, const SwFrm *pOwner );
|
|
|
|
|
|
|
|
SwBorderAttrs *Get();
|
|
|
|
};
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
//Iterator fuer die DrawObjecte einer Seite. Die Objecte werden Nach ihrer
|
|
|
|
//Z-Order iteriert.
|
|
|
|
//Das iterieren ist nicht eben billig, denn fuer alle Operationen muss jeweils
|
|
|
|
//ueber das gesamte SortArray iteriert werden.
|
|
|
|
class SwOrderIter
|
|
|
|
{
|
|
|
|
const SwPageFrm *pPage;
|
|
|
|
const SdrObject *pCurrent;
|
2007-09-27 07:57:00 +00:00
|
|
|
const BOOL bFlysOnly;
|
2000-09-18 23:08:29 +00:00
|
|
|
public:
|
2007-09-27 07:57:00 +00:00
|
|
|
SwOrderIter( const SwPageFrm *pPage, BOOL bFlysOnly = TRUE );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
void Current( const SdrObject *pNew ) { pCurrent = pNew; }
|
|
|
|
const SdrObject *Current() const { return pCurrent; }
|
|
|
|
const SdrObject *operator()() const { return pCurrent; }
|
|
|
|
const SdrObject *Top();
|
|
|
|
const SdrObject *Bottom();
|
|
|
|
const SdrObject *Next();
|
|
|
|
const SdrObject *Prev();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class StackHack
|
|
|
|
{
|
|
|
|
static BYTE nCnt;
|
|
|
|
static BOOL bLocked;
|
|
|
|
public:
|
|
|
|
StackHack()
|
|
|
|
{
|
|
|
|
if ( ++StackHack::nCnt > 50 )
|
|
|
|
StackHack::bLocked = TRUE;
|
|
|
|
}
|
|
|
|
~StackHack()
|
|
|
|
{
|
2004-11-09 12:46:06 +00:00
|
|
|
if ( --StackHack::nCnt < 5 )
|
2000-09-18 23:08:29 +00:00
|
|
|
StackHack::bLocked = FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static BOOL IsLocked() { return StackHack::bLocked; }
|
|
|
|
static BYTE Count() { return StackHack::nCnt; }
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
//Sollen obere bzw. untere Umrandung fuer den Frm ausgewertet werden?
|
2004-03-09 08:53:11 +00:00
|
|
|
// OD 2004-02-26 #i25029# - add optional 2nd parameter <_pPrevFrm>
|
|
|
|
// If set, its value is taken for testing, if borders/shadow have to joined
|
|
|
|
// with previous frame.
|
|
|
|
inline USHORT SwBorderAttrs::GetTopLine ( const SwFrm& _rFrm,
|
|
|
|
const SwFrm* _pPrevFrm ) const
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2004-03-09 08:53:11 +00:00
|
|
|
if ( !bCachedGetTopLine || _pPrevFrm )
|
|
|
|
{
|
|
|
|
const_cast<SwBorderAttrs*>(this)->_GetTopLine( _rFrm, _pPrevFrm );
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
return nGetTopLine;
|
|
|
|
}
|
2004-03-09 08:53:11 +00:00
|
|
|
inline USHORT SwBorderAttrs::GetBottomLine( const SwFrm& _rFrm ) const
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
if ( !bCachedGetBottomLine )
|
2004-03-09 08:53:11 +00:00
|
|
|
const_cast<SwBorderAttrs*>(this)->_GetBottomLine( _rFrm );
|
2000-09-18 23:08:29 +00:00
|
|
|
return nGetBottomLine;
|
|
|
|
}
|
|
|
|
inline void SwBorderAttrs::SetGetCacheLine( BOOL bNew ) const
|
|
|
|
{
|
|
|
|
((SwBorderAttrs*)this)->bCacheGetLine = bNew;
|
|
|
|
((SwBorderAttrs*)this)->bCachedGetBottomLine =
|
|
|
|
((SwBorderAttrs*)this)->bCachedGetTopLine = FALSE;
|
2003-05-27 15:10:51 +00:00
|
|
|
// OD 21.05.2003 #108789# - invalidate cache for values <bJoinedWithPrev>
|
|
|
|
// and <bJoinedWithNext>.
|
|
|
|
bCachedJoinedWithPrev = FALSE;
|
|
|
|
bCachedJoinedWithNext = FALSE;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
inline USHORT SwBorderAttrs::CalcTopLine() const
|
|
|
|
{
|
|
|
|
if ( bTopLine )
|
|
|
|
((SwBorderAttrs*)this)->_CalcTopLine();
|
|
|
|
return nTopLine;
|
|
|
|
}
|
|
|
|
inline USHORT SwBorderAttrs::CalcBottomLine() const
|
|
|
|
{
|
|
|
|
if ( bBottomLine )
|
|
|
|
((SwBorderAttrs*)this)->_CalcBottomLine();
|
|
|
|
return nBottomLine;
|
|
|
|
}
|
|
|
|
inline USHORT SwBorderAttrs::CalcLeftLine() const
|
|
|
|
{
|
|
|
|
if ( bLeftLine )
|
|
|
|
((SwBorderAttrs*)this)->_CalcLeftLine();
|
|
|
|
return nLeftLine;
|
|
|
|
}
|
|
|
|
inline USHORT SwBorderAttrs::CalcRightLine() const
|
|
|
|
{
|
|
|
|
if ( bRightLine )
|
|
|
|
((SwBorderAttrs*)this)->_CalcRightLine();
|
|
|
|
return nRightLine;
|
|
|
|
}
|
|
|
|
inline USHORT SwBorderAttrs::CalcTop() const
|
|
|
|
{
|
|
|
|
if ( bTop )
|
|
|
|
((SwBorderAttrs*)this)->_CalcTop();
|
|
|
|
return nTop;
|
|
|
|
}
|
|
|
|
inline USHORT SwBorderAttrs::CalcBottom() const
|
|
|
|
{
|
|
|
|
if ( bBottom )
|
|
|
|
((SwBorderAttrs*)this)->_CalcBottom();
|
|
|
|
return nBottom;
|
|
|
|
}
|
|
|
|
inline BOOL SwBorderAttrs::IsLine() const
|
|
|
|
{
|
|
|
|
if ( bLine )
|
|
|
|
((SwBorderAttrs*)this)->_IsLine();
|
|
|
|
return bIsLine;
|
|
|
|
}
|
2004-08-02 13:05:16 +00:00
|
|
|
|
|
|
|
/** method to determine the spacing values of a frame
|
|
|
|
|
|
|
|
OD 2004-03-10 #i28701#
|
|
|
|
Values only provided for flow frames (table, section or text frames)
|
|
|
|
Note: line spacing value is only determined for text frames
|
2009-09-08 13:44:38 +00:00
|
|
|
OD 2009-08-28 #i102458#
|
|
|
|
Add output parameter <obIsLineSpacingProportional>
|
2004-08-02 13:05:16 +00:00
|
|
|
|
2009-09-08 13:44:38 +00:00
|
|
|
@param rFrm
|
2004-08-02 13:05:16 +00:00
|
|
|
input parameter - frame, for which the spacing values are determined.
|
|
|
|
|
2009-09-08 13:44:38 +00:00
|
|
|
@param onPrevLowerSpacing
|
2004-08-02 13:05:16 +00:00
|
|
|
output parameter - lower spacing of the frame in SwTwips
|
|
|
|
|
2009-09-08 13:44:38 +00:00
|
|
|
@param onPrevLineSpacing
|
2004-08-02 13:05:16 +00:00
|
|
|
output parameter - line spacing of the frame in SwTwips
|
|
|
|
|
2009-09-08 13:44:38 +00:00
|
|
|
@param obIsLineSpacingProportional
|
|
|
|
|
2004-08-02 13:05:16 +00:00
|
|
|
@author OD
|
|
|
|
*/
|
2009-09-08 13:44:38 +00:00
|
|
|
void GetSpacingValuesOfFrm( const SwFrm& rFrm,
|
|
|
|
SwTwips& onLowerSpacing,
|
|
|
|
SwTwips& onLineSpacing,
|
|
|
|
bool& obIsLineSpacingProportional );
|
2004-08-02 13:05:16 +00:00
|
|
|
|
2005-09-28 10:08:31 +00:00
|
|
|
/** method to get the content of the table cell
|
|
|
|
|
|
|
|
Content from any nested tables will be omitted.
|
|
|
|
Note: line spacing value is only determined for text frames
|
|
|
|
|
|
|
|
@param rCell_
|
|
|
|
input parameter - the cell which should be searched for content.
|
|
|
|
|
|
|
|
return
|
|
|
|
pointer to the found content frame or 0
|
|
|
|
*/
|
|
|
|
|
|
|
|
const SwCntntFrm* GetCellCntnt( const SwLayoutFrm& rCell_ );
|
|
|
|
|
2005-10-27 15:00:53 +00:00
|
|
|
|
|
|
|
/** helper class to check if a frame has been deleted during an operation
|
|
|
|
* !!!WARNING!!! This should only be used as a last and desperate means
|
|
|
|
* to make the code robust.
|
|
|
|
*/
|
|
|
|
|
|
|
|
class SwDeletionChecker
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
|
|
|
|
const SwFrm* mpFrm;
|
|
|
|
const SwModify* mpRegIn;
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
SwDeletionChecker( const SwFrm* pFrm )
|
|
|
|
: mpFrm( pFrm ),
|
|
|
|
mpRegIn( pFrm ? pFrm->GetRegisteredIn() : 0 )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* return
|
|
|
|
* true if mpFrm != 0 and mpFrm is not client of pRegIn
|
|
|
|
* false otherwise
|
|
|
|
*/
|
|
|
|
bool HasBeenDeleted();
|
|
|
|
};
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
#endif //_FRMTOOL_HXX
|