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 14:20:56 +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 14:20:56 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
2008-04-10 14:20:56 +00:00
|
|
|
* This file is part of OpenOffice.org.
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
2008-04-10 14:20:56 +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 14:20:56 +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 14:20:56 +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 _INFTXT_HXX
|
|
|
|
#define _INFTXT_HXX
|
2000-11-06 08:24:36 +00:00
|
|
|
#include <com/sun/star/linguistic2/XHyphenatedWord.hpp>
|
2001-03-29 07:02:02 +00:00
|
|
|
#include <com/sun/star/beans/PropertyValues.hpp>
|
2006-08-14 15:37:36 +00:00
|
|
|
|
2001-04-09 09:44:17 +00:00
|
|
|
#include <tools/table.hxx>
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
#include "swtypes.hxx"
|
|
|
|
#include "txttypes.hxx"
|
|
|
|
#include "swrect.hxx"
|
|
|
|
#include "txtfly.hxx"
|
|
|
|
#include "swfont.hxx"
|
|
|
|
#include "porlay.hxx"
|
|
|
|
#include "txtfrm.hxx"
|
|
|
|
#include "ndtxt.hxx"
|
2010-01-08 18:32:51 +01:00
|
|
|
#include <editeng/paravertalignitem.hxx>
|
2001-04-12 06:47:49 +00:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
class Font;
|
|
|
|
class OutputDevice;
|
|
|
|
class SvxBrushItem;
|
|
|
|
class SvxLineSpacingItem;
|
|
|
|
class SvxTabStop;
|
|
|
|
class SvxTabStopItem;
|
|
|
|
class SwAttrSet;
|
|
|
|
class SwFldPortion;
|
|
|
|
class SwFlyPortion;
|
|
|
|
class SwFmtDrop;
|
|
|
|
class SwLineLayout;
|
|
|
|
class SwLinePortion;
|
|
|
|
class SwParaPortion;
|
|
|
|
class SwTabPortion;
|
|
|
|
class SwTxtFrm;
|
|
|
|
class SwTxtSizeInfo;
|
|
|
|
class SwViewOption;
|
|
|
|
class ViewShell;
|
|
|
|
class SwTxtFtn;
|
2000-12-11 10:05:15 +00:00
|
|
|
class SwAttrIter;
|
2001-02-06 14:26:49 +00:00
|
|
|
struct SwMultiCreator;
|
2002-03-21 08:19:43 +00:00
|
|
|
class SwMultiPortion;
|
2007-01-29 15:56:15 +00:00
|
|
|
class SwWrongList;
|
2002-03-21 08:19:43 +00:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
/* Minimum: Prozentwert fuers kernen */
|
|
|
|
#define MINKERNPERCENT 5
|
|
|
|
#define ARROW_WIDTH 200
|
2001-01-19 14:27:04 +00:00
|
|
|
#define DIR_LEFT2RIGHT 0
|
|
|
|
#define DIR_BOTTOM2TOP 1
|
|
|
|
#define DIR_RIGHT2LEFT 2
|
|
|
|
#define DIR_TOP2BOTTOM 3
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2010-11-07 23:00:23 +02:00
|
|
|
#if OSL_DEBUG_LEVEL > 1
|
2000-09-18 23:08:29 +00:00
|
|
|
#define OPTCALM( rInf ) (rInf).IsOptCalm()
|
|
|
|
#define OPTLOW( rInf ) (rInf).IsOptLow()
|
|
|
|
#define OPTDBG( rInf ) (rInf).IsOptDbg()
|
|
|
|
#else
|
|
|
|
#define OPTCALM( rInf ) sal_True
|
|
|
|
#define OPTLOW( rInf ) sal_False
|
|
|
|
#define OPTDBG( rInf ) sal_False
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* class SwLineInfo
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
// Beruecksichtigt das Attribut LineSpace bei der Hoehen/Ascentberechnung.
|
|
|
|
|
|
|
|
class SwLineInfo
|
|
|
|
{
|
|
|
|
friend class SwTxtIter;
|
|
|
|
|
2008-03-05 16:05:36 +00:00
|
|
|
SvxTabStopItem* pRuler;
|
2000-09-18 23:08:29 +00:00
|
|
|
const SvxLineSpacingItem *pSpace;
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 nVertAlign;
|
2000-09-18 23:08:29 +00:00
|
|
|
KSHORT nDefTabStop;
|
2008-03-05 16:05:36 +00:00
|
|
|
bool bListTabStopIncluded;
|
|
|
|
long nListTabStopPosition;
|
|
|
|
|
|
|
|
void CtorInitLineInfo( const SwAttrSet& rAttrSet,
|
|
|
|
const SwTxtNode& rTxtNode );
|
|
|
|
|
|
|
|
SwLineInfo();
|
|
|
|
~SwLineInfo();
|
2000-09-18 23:08:29 +00:00
|
|
|
public:
|
2008-03-05 16:05:36 +00:00
|
|
|
// const SvxTabStop *GetTabStop( const SwTwips nLinePos,
|
|
|
|
// const SwTwips nLeft,
|
2008-01-10 11:29:51 +00:00
|
|
|
// #i24363# tab stops relative to indent - returns the tab stop following nSearchPos or NULL
|
|
|
|
const SvxTabStop *GetTabStop( const SwTwips nSearchPos,
|
2000-11-30 14:13:56 +00:00
|
|
|
const SwTwips nRight ) const;
|
2000-09-18 23:08:29 +00:00
|
|
|
inline const SvxLineSpacingItem *GetLineSpacing() const { return pSpace; }
|
|
|
|
inline KSHORT GetDefTabStop() const { return nDefTabStop; }
|
|
|
|
inline void SetDefTabStop( KSHORT nNew ) const
|
|
|
|
{ ( (SwLineInfo*)this )->nDefTabStop = nNew; }
|
2001-04-12 06:47:49 +00:00
|
|
|
|
|
|
|
// vertical alignment
|
2011-01-17 15:06:54 +01:00
|
|
|
inline sal_uInt16 GetVertAlign() const { return nVertAlign; }
|
2002-11-14 07:55:47 +00:00
|
|
|
inline sal_Bool HasSpecialAlign( sal_Bool bVert ) const
|
|
|
|
{ return bVert ?
|
|
|
|
( SvxParaVertAlignItem::BASELINE != nVertAlign ) :
|
|
|
|
( SvxParaVertAlignItem::BASELINE != nVertAlign &&
|
|
|
|
SvxParaVertAlignItem::AUTOMATIC != nVertAlign ); }
|
2001-04-12 06:47:49 +00:00
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 NumberOfTabStops() const;
|
2006-02-09 12:44:21 +00:00
|
|
|
|
2008-03-05 16:05:36 +00:00
|
|
|
inline bool IsListTabStopIncluded() const
|
|
|
|
{
|
|
|
|
return bListTabStopIncluded;
|
|
|
|
}
|
|
|
|
inline long GetListTabStopPosition() const
|
|
|
|
{
|
|
|
|
return nListTabStopPosition;
|
|
|
|
}
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
// friend ostream &operator<<( ostream &rOS, const SwLineInfo &rInf );
|
|
|
|
friend SvStream &operator<<( SvStream &rOS, const SwLineInfo &rInf );
|
|
|
|
};
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* class SwTxtInfo
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
class SwTxtInfo
|
|
|
|
{
|
|
|
|
// Implementation in txthyph.cxx
|
|
|
|
friend void SetParaPortion( SwTxtInfo *pInf, SwParaPortion *pRoot );
|
|
|
|
SwParaPortion *pPara;
|
|
|
|
xub_StrLen nTxtStart; // TxtOfst bei Follows
|
|
|
|
|
|
|
|
protected:
|
2011-02-20 15:05:44 +01:00
|
|
|
inline SwTxtInfo() : pPara(0) {}
|
2000-09-18 23:08:29 +00:00
|
|
|
public:
|
2007-09-27 08:13:19 +00:00
|
|
|
void CtorInitTxtInfo( SwTxtFrm *pFrm );
|
2000-09-18 23:08:29 +00:00
|
|
|
SwTxtInfo( const SwTxtInfo &rInf );
|
2007-09-27 08:13:19 +00:00
|
|
|
inline SwTxtInfo( SwTxtFrm *pFrm ) { CtorInitTxtInfo( pFrm ); }
|
2000-09-18 23:08:29 +00:00
|
|
|
inline SwParaPortion *GetParaPortion() { return pPara; }
|
|
|
|
inline const SwParaPortion *GetParaPortion() const { return pPara; }
|
|
|
|
inline xub_StrLen GetTxtStart() const { return nTxtStart; }
|
|
|
|
|
|
|
|
friend SvStream &operator<<( SvStream &rOS, const SwTxtInfo &rInf );
|
|
|
|
};
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* class SwTxtSizeInfo
|
|
|
|
*************************************************************************/
|
|
|
|
|
2005-10-06 09:51:16 +00:00
|
|
|
DECLARE_TABLE( SwTxtPortionTable, sal_IntPtr )
|
2001-04-09 09:44:17 +00:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
class SwTxtSizeInfo : public SwTxtInfo
|
|
|
|
{
|
|
|
|
protected:
|
2001-04-09 09:44:17 +00:00
|
|
|
// during formatting, a small database is built, mapping portion pointers
|
|
|
|
// to their maximum size (used for kana compression)
|
|
|
|
SwTxtPortionTable aMaxWidth;
|
|
|
|
// for each line, an array of compression values is calculated
|
|
|
|
// this array is passed over to the info structure
|
2011-07-13 15:55:53 +01:00
|
|
|
std::deque<sal_uInt16>* pKanaComp;
|
2001-04-09 09:44:17 +00:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
ViewShell *pVsh;
|
2003-04-01 08:56:05 +00:00
|
|
|
|
|
|
|
// pOut is the output device, pRef is the device used for formatting
|
2003-10-15 08:55:46 +00:00
|
|
|
OutputDevice* pOut;
|
|
|
|
OutputDevice* pRef;
|
2003-04-01 08:56:05 +00:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
SwFont *pFnt;
|
2002-11-14 07:55:47 +00:00
|
|
|
SwUnderlineFont *pUnderFnt; // Font for underlining
|
2000-09-18 23:08:29 +00:00
|
|
|
SwTxtFrm *pFrm;
|
|
|
|
const SwViewOption *pOpt;
|
|
|
|
const XubString *pTxt;
|
|
|
|
xub_StrLen nIdx, nLen;
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 nKanaIdx;
|
2000-09-18 23:08:29 +00:00
|
|
|
sal_Bool bOnWin : 1;
|
|
|
|
sal_Bool bNotEOL : 1;
|
|
|
|
sal_Bool bURLNotify : 1;
|
|
|
|
sal_Bool bStopUnderFlow : 1;// Underflow gestoppt z.B. von einer FlyPortion
|
|
|
|
sal_Bool bFtnInside : 1; // the current line contains a footnote
|
2010-03-16 09:54:03 +01:00
|
|
|
sal_Bool bOtherThanFtnInside : 1; // the current line contains another portion than a footnote portion.
|
|
|
|
// needed for checking keep together of footnote portion with previous portion
|
2000-10-16 12:21:25 +00:00
|
|
|
sal_Bool bMulti : 1; // inside a multiportion
|
2001-03-13 08:56:21 +00:00
|
|
|
sal_Bool bFirstMulti : 1; // this flag is used for two purposes:
|
|
|
|
// - the multiportion is the first lineportion
|
|
|
|
// - indicates, if we are currently in second
|
|
|
|
// line of multi portion
|
2000-11-06 08:20:28 +00:00
|
|
|
sal_Bool bRuby : 1; // during the formatting of a phonetic line
|
2000-11-24 14:40:56 +00:00
|
|
|
sal_Bool bHanging : 1; // formatting of hanging punctuation allowed
|
|
|
|
sal_Bool bScriptSpace : 1; // space between different scripts (Asian/Latin)
|
2000-11-29 12:25:34 +00:00
|
|
|
sal_Bool bForbiddenChars : 1; // Forbidden start/endline characters
|
2002-02-07 10:20:40 +00:00
|
|
|
sal_Bool bSnapToGrid : 1; // paragraph snaps to grid
|
2001-01-19 14:27:04 +00:00
|
|
|
sal_uInt8 nDirection : 2; // writing direction: 0/90/180/270 degree
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
protected:
|
2007-09-27 08:13:19 +00:00
|
|
|
void CtorInitTxtSizeInfo( SwTxtFrm *pFrm, SwFont *pFnt = 0,
|
2000-09-18 23:08:29 +00:00
|
|
|
const xub_StrLen nIdx = 0,
|
|
|
|
const xub_StrLen nLen = STRING_LEN );
|
2011-02-20 15:05:44 +01:00
|
|
|
SwTxtSizeInfo() : pKanaComp(0), pVsh(0), pOut(0), pRef(0), pFnt(0), pUnderFnt(0), pFrm(0), pOpt(0), pTxt(0) {}
|
2000-09-18 23:08:29 +00:00
|
|
|
public:
|
|
|
|
SwTxtSizeInfo( const SwTxtSizeInfo &rInf );
|
|
|
|
SwTxtSizeInfo( const SwTxtSizeInfo &rInf, const XubString &rTxt,
|
|
|
|
const xub_StrLen nIdx = 0,
|
|
|
|
const xub_StrLen nLen = STRING_LEN );
|
|
|
|
|
2007-09-27 08:13:19 +00:00
|
|
|
inline SwTxtSizeInfo( SwTxtFrm *pTxtFrm, SwFont *pTxtFnt = 0,
|
|
|
|
const xub_StrLen nIndex = 0,
|
|
|
|
const xub_StrLen nLength = STRING_LEN )
|
|
|
|
{ CtorInitTxtSizeInfo( pTxtFrm, pTxtFnt, nIndex, nLength ); }
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2000-11-09 10:37:59 +00:00
|
|
|
// GetMultiAttr returns the text attribute of the multiportion,
|
|
|
|
// if rPos is inside any multi-line part.
|
|
|
|
// rPos will set to the end of the multi-line part.
|
2002-03-21 08:19:43 +00:00
|
|
|
SwMultiCreator* GetMultiCreator( xub_StrLen &rPos, SwMultiPortion* pM ) const;
|
2000-10-16 12:21:25 +00:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
inline sal_Bool OnWin() const { return bOnWin; }
|
|
|
|
inline void SetOnWin( const sal_Bool bNew ) { bOnWin = bNew; }
|
|
|
|
inline sal_Bool NotEOL() const { return bNotEOL; }
|
|
|
|
inline void SetNotEOL( const sal_Bool bNew ) { bNotEOL = bNew; }
|
|
|
|
inline sal_Bool URLNotify() const { return bURLNotify; }
|
|
|
|
inline void SetURLNotify( const sal_Bool bNew ) { bURLNotify = bNew; }
|
|
|
|
inline sal_Bool StopUnderFlow() const { return bStopUnderFlow; }
|
|
|
|
inline void SetStopUnderFlow( const sal_Bool bNew ) { bStopUnderFlow = bNew; }
|
2001-11-15 15:40:55 +00:00
|
|
|
inline sal_Bool IsFtnInside() const { return bFtnInside; }
|
|
|
|
inline void SetFtnInside( const sal_Bool bNew ) { bFtnInside = bNew; }
|
2010-03-16 09:54:03 +01:00
|
|
|
inline sal_Bool IsOtherThanFtnInside() const { return bOtherThanFtnInside; }
|
|
|
|
inline void SetOtherThanFtnInside( const sal_Bool bNew ) { bOtherThanFtnInside = bNew; }
|
2000-10-16 12:21:25 +00:00
|
|
|
inline sal_Bool IsMulti() const { return bMulti; }
|
|
|
|
inline void SetMulti( const sal_Bool bNew ) { bMulti = bNew; }
|
|
|
|
inline sal_Bool IsFirstMulti() const { return bFirstMulti; }
|
|
|
|
inline void SetFirstMulti( const sal_Bool bNew ) { bFirstMulti = bNew; }
|
2000-11-06 08:20:28 +00:00
|
|
|
inline sal_Bool IsRuby() const { return bRuby; }
|
|
|
|
inline void SetRuby( const sal_Bool bNew ) { bRuby = bNew; }
|
2000-11-24 14:40:56 +00:00
|
|
|
inline sal_Bool IsHanging() const { return bHanging; }
|
|
|
|
inline void SetHanging( const sal_Bool bNew ) { bHanging = bNew; }
|
|
|
|
inline sal_Bool HasScriptSpace() const { return bScriptSpace; }
|
|
|
|
inline void SetScriptSpace( const sal_Bool bNew ) { bScriptSpace = bNew; }
|
2000-11-29 12:25:34 +00:00
|
|
|
inline sal_Bool HasForbiddenChars() const { return bForbiddenChars; }
|
|
|
|
inline void SetForbiddenChars( const sal_Bool bN ) { bForbiddenChars = bN; }
|
2002-02-07 10:20:40 +00:00
|
|
|
inline sal_Bool SnapToGrid() const { return bSnapToGrid; }
|
|
|
|
inline void SetSnapToGrid( const sal_Bool bN ) { bSnapToGrid = bN; }
|
2001-01-19 14:27:04 +00:00
|
|
|
inline sal_uInt8 GetDirection() const { return nDirection; }
|
|
|
|
inline void SetDirection( const sal_uInt8 nNew ) { nDirection = nNew; }
|
|
|
|
inline sal_Bool IsRotated() const { return 0 != ( 1 & nDirection ); }
|
2001-11-15 15:40:55 +00:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
inline ViewShell *GetVsh() { return pVsh; }
|
|
|
|
inline const ViewShell *GetVsh() const { return pVsh; }
|
2003-04-01 08:56:05 +00:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
inline OutputDevice *GetOut() { return pOut; }
|
|
|
|
inline const OutputDevice *GetOut() const { return pOut; }
|
2002-11-04 11:27:25 +00:00
|
|
|
inline void SetOut( OutputDevice* pNewOut ) { pOut = pNewOut; }
|
2003-04-01 08:56:05 +00:00
|
|
|
|
|
|
|
inline OutputDevice *GetRefDev() { return pRef; }
|
|
|
|
inline const OutputDevice *GetRefDev() const { return pRef; }
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
inline SwFont *GetFont() { return pFnt; }
|
|
|
|
inline const SwFont *GetFont() const { return pFnt; }
|
|
|
|
inline void SetFont( SwFont *pNew ) { pFnt = pNew; }
|
|
|
|
void SelectFont();
|
2002-11-14 07:55:47 +00:00
|
|
|
inline void SetUnderFnt( SwUnderlineFont* pNew ) { pUnderFnt = pNew; }
|
|
|
|
inline SwUnderlineFont* GetUnderFnt() const { return pUnderFnt; }
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
inline const SwViewOption &GetOpt() const { return *pOpt; }
|
|
|
|
inline const XubString &GetTxt() const { return *pTxt; }
|
2008-10-10 13:02:43 +00:00
|
|
|
inline xub_Unicode GetChar( const xub_StrLen nPos ) const
|
2000-09-18 23:08:29 +00:00
|
|
|
{ return pTxt->GetChar( nPos ); }
|
|
|
|
|
|
|
|
inline KSHORT GetTxtHeight() const;
|
2001-04-09 09:44:17 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// GetTxtSize
|
|
|
|
//
|
2003-10-15 08:55:46 +00:00
|
|
|
SwPosSize GetTxtSize( OutputDevice* pOut, const SwScriptInfo* pSI,
|
2001-04-09 09:44:17 +00:00
|
|
|
const XubString& rTxt, const xub_StrLen nIdx,
|
2011-01-17 15:06:54 +01:00
|
|
|
const xub_StrLen nLen, const sal_uInt16 nComp ) const;
|
2001-04-09 09:44:17 +00:00
|
|
|
SwPosSize GetTxtSize() const;
|
|
|
|
void GetTxtSize( const SwScriptInfo* pSI, const xub_StrLen nIdx,
|
2011-01-17 15:06:54 +01:00
|
|
|
const xub_StrLen nLen, const sal_uInt16 nComp,
|
|
|
|
sal_uInt16& nMinSize, sal_uInt16& nMaxSizeDiff ) const;
|
2001-04-09 09:44:17 +00:00
|
|
|
inline SwPosSize GetTxtSize( const SwScriptInfo* pSI, const xub_StrLen nIdx,
|
2011-01-17 15:06:54 +01:00
|
|
|
const xub_StrLen nLen, const sal_uInt16 nComp ) const;
|
2000-09-18 23:08:29 +00:00
|
|
|
inline SwPosSize GetTxtSize( const XubString &rTxt ) const;
|
2001-04-09 09:44:17 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// GetTxtBreak
|
|
|
|
//
|
2004-08-12 11:35:15 +00:00
|
|
|
xub_StrLen GetTxtBreak( const long nLineWidth,
|
2001-04-09 09:44:17 +00:00
|
|
|
const xub_StrLen nMaxLen,
|
2011-01-17 15:06:54 +01:00
|
|
|
const sal_uInt16 nComp ) const;
|
2004-08-12 11:35:15 +00:00
|
|
|
xub_StrLen GetTxtBreak( const long nLineWidth,
|
2001-04-09 09:44:17 +00:00
|
|
|
const xub_StrLen nMaxLen,
|
2011-01-17 15:06:54 +01:00
|
|
|
const sal_uInt16 nComp,
|
2001-04-09 09:44:17 +00:00
|
|
|
xub_StrLen& rExtraCharPos ) const;
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
inline KSHORT GetAscent() const;
|
|
|
|
|
|
|
|
inline xub_StrLen GetIdx() const { return nIdx; }
|
|
|
|
inline void SetIdx( const xub_StrLen nNew ) { nIdx = nNew; }
|
|
|
|
inline xub_StrLen GetLen() const { return nLen; }
|
|
|
|
inline void SetLen( const xub_StrLen nNew ) { nLen = nNew; }
|
|
|
|
inline void SetTxt( const XubString &rNew ){ pTxt = &rNew; }
|
|
|
|
|
|
|
|
friend SvStream &operator<<( SvStream &rOS, const SwTxtSizeInfo &rInf );
|
|
|
|
|
|
|
|
// 7780: Keine Bullets beim Symbol-Zeichensatz!
|
|
|
|
inline sal_Bool IsNoSymbol() const
|
|
|
|
{ return RTL_TEXTENCODING_SYMBOL != pFnt->GetCharSet( pFnt->GetActual() ); }
|
|
|
|
|
2003-04-01 08:56:05 +00:00
|
|
|
void NoteAnimation() const;
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
// Home is where Your heart is...
|
|
|
|
inline SwTxtFrm *GetTxtFrm() { return pFrm; }
|
|
|
|
inline const SwTxtFrm *GetTxtFrm() const { return pFrm; }
|
|
|
|
|
|
|
|
inline sal_Bool HasHint( xub_StrLen nPos ) const
|
|
|
|
{ return _HasHint( pFrm->GetTxtNode(), nPos ); }
|
|
|
|
static sal_Bool _HasHint( const SwTxtNode* pTxtNode, xub_StrLen nPos );
|
|
|
|
|
2001-04-09 09:44:17 +00:00
|
|
|
// If Kana Compression is enabled, a minimum and maximum portion width
|
|
|
|
// is calculated. We format lines with minimal size and share remaining
|
|
|
|
// space among compressed kanas.
|
|
|
|
// During formatting, the maximum values of compressable portions are
|
|
|
|
// stored in aMaxWidth and discarded after a line has been formatted.
|
2011-01-17 15:06:54 +01:00
|
|
|
inline void SetMaxWidthDiff( sal_uLong nKey, sal_uInt16 nVal )
|
2001-04-09 09:44:17 +00:00
|
|
|
{
|
|
|
|
aMaxWidth.Insert( nKey, nVal );
|
|
|
|
};
|
2011-01-17 15:06:54 +01:00
|
|
|
inline sal_uInt16 GetMaxWidthDiff( sal_uLong nKey )
|
2001-04-09 09:44:17 +00:00
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
return (sal_uInt16)aMaxWidth.Get( nKey );
|
2001-04-09 09:44:17 +00:00
|
|
|
};
|
|
|
|
inline void ResetMaxWidthDiff()
|
|
|
|
{
|
|
|
|
aMaxWidth.Clear();
|
|
|
|
};
|
|
|
|
inline sal_Bool CompressLine()
|
|
|
|
{
|
2001-04-12 06:47:49 +00:00
|
|
|
return (sal_Bool)aMaxWidth.Count();
|
2001-04-09 09:44:17 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//
|
|
|
|
// Feature: Kana Compression
|
|
|
|
//
|
2008-10-10 13:02:43 +00:00
|
|
|
inline MSHORT GetKanaIdx() const { return nKanaIdx; }
|
2001-04-09 09:44:17 +00:00
|
|
|
inline void ResetKanaIdx(){ nKanaIdx = 0; }
|
|
|
|
inline void SetKanaIdx( MSHORT nNew ) { nKanaIdx = nNew; }
|
|
|
|
inline void IncKanaIdx() { ++nKanaIdx; }
|
2011-07-13 15:55:53 +01:00
|
|
|
inline void SetKanaComp( std::deque<sal_uInt16> *pNew ){ pKanaComp = pNew; }
|
|
|
|
inline std::deque<sal_uInt16>* GetpKanaComp() const { return pKanaComp; }
|
2011-01-17 15:06:54 +01:00
|
|
|
inline sal_uInt16 GetKanaComp() const
|
2011-07-13 15:55:53 +01:00
|
|
|
{ return ( pKanaComp && nKanaIdx < pKanaComp->size() )
|
2001-04-09 09:44:17 +00:00
|
|
|
? (*pKanaComp)[nKanaIdx] : 0; }
|
|
|
|
|
2010-11-16 10:51:51 +01:00
|
|
|
#if OSL_DEBUG_LEVEL > 1
|
2000-09-18 23:08:29 +00:00
|
|
|
sal_Bool IsOptCalm() const;
|
|
|
|
sal_Bool IsOptLow() const;
|
|
|
|
sal_Bool IsOptDbg() const;
|
|
|
|
sal_Bool IsOptTest1() const;
|
|
|
|
sal_Bool IsOptTest2() const;
|
|
|
|
sal_Bool IsOptTest3() const;
|
|
|
|
sal_Bool IsOptTest4() const;
|
|
|
|
sal_Bool IsOptTest5() const;
|
|
|
|
sal_Bool IsOptTest6() const;
|
|
|
|
sal_Bool IsOptTest7() const;
|
|
|
|
sal_Bool IsOptTest8() const;
|
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* class SwTxtPaintInfo
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
class SwTxtPaintInfo : public SwTxtSizeInfo
|
|
|
|
{
|
2007-01-29 15:56:15 +00:00
|
|
|
const SwWrongList *pWrongList;
|
2008-02-26 08:46:21 +00:00
|
|
|
const SwWrongList *pGrammarCheckList;
|
2007-01-29 15:56:15 +00:00
|
|
|
const SwWrongList *pSmartTags; // SMARTTAGS
|
2005-04-18 13:35:16 +00:00
|
|
|
std::vector<long>* pSpaceAdd;
|
2000-09-18 23:08:29 +00:00
|
|
|
const SvxBrushItem *pBrushItem; // Fuer den Hintergrund
|
|
|
|
SwRect aItemRect; // ebenfalls fuer den Hintergrund
|
|
|
|
SwTxtFly aTxtFly; // FlyFrm-Berechnung
|
|
|
|
Point aPos; // Ausgabeposition
|
|
|
|
SwRect aPaintRect; // Original Ausgaberechteck (aus Layout-Paint)
|
|
|
|
|
|
|
|
MSHORT nSpaceIdx;
|
|
|
|
void _DrawText( const XubString &rText, const SwLinePortion &rPor,
|
|
|
|
const xub_StrLen nIdx, const xub_StrLen nLen,
|
2007-01-02 15:50:38 +00:00
|
|
|
const sal_Bool bKern, const sal_Bool bWrong = sal_False,
|
2008-02-26 08:46:21 +00:00
|
|
|
const sal_Bool bSmartTag = sal_False,
|
|
|
|
const sal_Bool bGrammarCheck = sal_False ); // SMARTTAGS
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
SwTxtPaintInfo &operator=(const SwTxtPaintInfo&);
|
|
|
|
void _NotifyURL( const SwLinePortion &rPor ) const;
|
|
|
|
void _DrawBackBrush( const SwLinePortion &rPor ) const;
|
|
|
|
|
|
|
|
protected:
|
2010-11-25 17:08:45 +01:00
|
|
|
#if OSL_DEBUG_LEVEL > 1
|
2008-02-26 08:46:21 +00:00
|
|
|
SwTxtPaintInfo() { pFrm = 0; pWrongList = 0; pGrammarCheckList = 0; pSmartTags = 0; pSpaceAdd = 0;
|
2001-10-10 14:19:15 +00:00
|
|
|
pBrushItem = ((SvxBrushItem*)-1);}
|
2010-11-25 17:08:45 +01:00
|
|
|
#else
|
|
|
|
SwTxtPaintInfo() { pFrm = 0; pWrongList = 0; pGrammarCheckList = 0; pWrongList = 0; pSmartTags = 0; pSpaceAdd = 0; pBrushItem = 0;}
|
2000-09-18 23:08:29 +00:00
|
|
|
#endif
|
|
|
|
public:
|
|
|
|
SwTxtPaintInfo( const SwTxtPaintInfo &rInf );
|
|
|
|
SwTxtPaintInfo( const SwTxtPaintInfo &rInf, const XubString &rTxt );
|
|
|
|
|
2007-09-27 08:13:19 +00:00
|
|
|
void CtorInitTxtPaintInfo( SwTxtFrm *pFrame, const SwRect &rPaint );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
void SetBack( const SvxBrushItem *pItem,
|
|
|
|
const SwRect &rRect ) { pBrushItem = pItem; aItemRect = rRect;}
|
|
|
|
const SvxBrushItem *GetBrushItem() const { return pBrushItem; }
|
|
|
|
const SwRect &GetBrushRect() const { return aItemRect; }
|
|
|
|
|
|
|
|
inline SwTxtPaintInfo( SwTxtFrm *pFrame, const SwRect &rPaint )
|
2007-09-27 08:13:19 +00:00
|
|
|
{ CtorInitTxtPaintInfo( pFrame, rPaint ); }
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
inline SwTwips X() const { return aPos.X(); }
|
|
|
|
inline void X( const long nNew ) { aPos.X() = nNew; }
|
|
|
|
inline SwTwips Y() const { return aPos.Y(); }
|
|
|
|
inline void Y( const SwTwips nNew ) { aPos.Y() = nNew; }
|
|
|
|
|
|
|
|
inline SwTxtFly *GetTxtFly() { return &aTxtFly; }
|
|
|
|
inline const SwTxtFly *GetTxtFly() const { return &aTxtFly; }
|
|
|
|
inline void DrawText( const XubString &rText, const SwLinePortion &rPor,
|
|
|
|
const xub_StrLen nIdx = 0,
|
|
|
|
const xub_StrLen nLen = STRING_LEN,
|
|
|
|
const sal_Bool bKern = sal_False) const;
|
|
|
|
inline void DrawText( const SwLinePortion &rPor, const xub_StrLen nLen,
|
|
|
|
const sal_Bool bKern = sal_False ) const;
|
2007-01-02 15:50:38 +00:00
|
|
|
inline void DrawMarkedText( const SwLinePortion &rPor, const xub_StrLen nLen,
|
|
|
|
const sal_Bool bKern,
|
|
|
|
const sal_Bool bWrong,
|
2008-02-26 08:46:21 +00:00
|
|
|
const sal_Bool bSmartTags,
|
|
|
|
const sal_Bool bGrammarCheck ) const;
|
2007-01-02 15:50:38 +00:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
void DrawRect( const SwRect &rRect, sal_Bool bNoGraphic = sal_False,
|
|
|
|
sal_Bool bRetouche = sal_True ) const;
|
|
|
|
void DrawTab( const SwLinePortion &rPor ) const;
|
|
|
|
void DrawLineBreak( const SwLinePortion &rPor ) const;
|
2002-01-21 07:30:44 +00:00
|
|
|
void DrawRedArrow( const SwLinePortion &rPor ) const;
|
2000-09-18 23:08:29 +00:00
|
|
|
void DrawPostIts( const SwLinePortion &rPor, sal_Bool bScript ) const;
|
|
|
|
void DrawBackground( const SwLinePortion &rPor ) const;
|
|
|
|
void DrawViewOpt( const SwLinePortion &rPor, const MSHORT nWhich ) const;
|
|
|
|
inline void DrawBackBrush( const SwLinePortion &rPor ) const
|
2008-09-04 09:20:17 +00:00
|
|
|
{ /* if( pFnt->GetBackColor() ) */ _DrawBackBrush( rPor ); }
|
|
|
|
|
2010-04-21 08:33:47 +02:00
|
|
|
void DrawCheckBox( const SwFieldFormPortion &rPor, bool checked) const;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
inline void NotifyURL( const SwLinePortion &rPor ) const
|
|
|
|
{ if( URLNotify() ) _NotifyURL( rPor ); }
|
|
|
|
|
2004-09-08 15:11:37 +00:00
|
|
|
void CalcRect( const SwLinePortion& rPor, SwRect* pRect, SwRect* pIntersect = 0 ) const;
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
inline SwTwips GetPaintOfst() const;
|
|
|
|
inline void SetPaintOfst( const SwTwips nNew );
|
|
|
|
inline const Point &GetPos() const { return aPos; }
|
|
|
|
inline void SetPos( const Point &rNew ) { aPos = rNew; }
|
|
|
|
|
|
|
|
inline const SwRect &GetPaintRect() const { return aPaintRect; }
|
|
|
|
inline void SetPaintRect( const SwRect &rNew ) { aPaintRect = rNew; }
|
|
|
|
|
|
|
|
friend SvStream &operator<<( SvStream &rOS, const SwTxtPaintInfo &rInf );
|
|
|
|
|
2005-04-18 13:35:16 +00:00
|
|
|
//
|
|
|
|
// STUFF FOR JUSTIFIED ALIGNMENT
|
|
|
|
//
|
2008-10-10 13:02:43 +00:00
|
|
|
inline MSHORT GetSpaceIdx() const { return nSpaceIdx; }
|
2000-09-18 23:08:29 +00:00
|
|
|
inline void ResetSpaceIdx(){nSpaceIdx = 0; }
|
2000-10-30 09:06:45 +00:00
|
|
|
inline void SetSpaceIdx( MSHORT nNew ) { nSpaceIdx = nNew; }
|
2000-09-18 23:08:29 +00:00
|
|
|
inline void IncSpaceIdx() { ++nSpaceIdx; }
|
2005-04-18 13:35:16 +00:00
|
|
|
inline void RemoveFirstSpaceAdd() { pSpaceAdd->erase( pSpaceAdd->begin() ); }
|
2008-10-10 13:02:43 +00:00
|
|
|
inline long GetSpaceAdd() const
|
2005-04-18 13:35:16 +00:00
|
|
|
{ return ( pSpaceAdd && nSpaceIdx < pSpaceAdd->size() )
|
2000-09-18 23:08:29 +00:00
|
|
|
? (*pSpaceAdd)[nSpaceIdx] : 0; }
|
2001-04-09 09:44:17 +00:00
|
|
|
|
2005-04-18 13:35:16 +00:00
|
|
|
inline void SetpSpaceAdd( std::vector<long>* pNew ){ pSpaceAdd = pNew; }
|
|
|
|
inline std::vector<long>* GetpSpaceAdd() const { return pSpaceAdd; }
|
|
|
|
|
|
|
|
|
2007-01-29 15:56:15 +00:00
|
|
|
inline void SetWrongList( const SwWrongList *pNew ){ pWrongList = pNew; }
|
|
|
|
inline const SwWrongList* GetpWrongList() const { return pWrongList; }
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2008-02-26 08:46:21 +00:00
|
|
|
inline void SetGrammarCheckList( const SwWrongList *pNew ){ pGrammarCheckList = pNew; }
|
|
|
|
inline const SwWrongList* GetGrammarCheckList() const { return pGrammarCheckList; }
|
|
|
|
|
2007-01-02 15:50:38 +00:00
|
|
|
// SMARTTAGS
|
2007-01-29 15:56:15 +00:00
|
|
|
inline void SetSmartTags( const SwWrongList *pNew ){ pSmartTags = pNew; }
|
|
|
|
inline const SwWrongList* GetSmartTags() const { return pSmartTags; }
|
2000-09-18 23:08:29 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* class SwTxtFormatInfo
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
class SwTxtFormatInfo : public SwTxtPaintInfo
|
|
|
|
{
|
2001-03-29 07:02:02 +00:00
|
|
|
// temporary arguments for hyphenation
|
|
|
|
com::sun::star::beans::PropertyValues aHyphVals;
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
SwLineLayout *pRoot; // die Root der aktuellen Zeile (pCurr)
|
|
|
|
SwLinePortion *pLast; // die letzte Portion
|
|
|
|
SwFlyPortion *pFly; // die nachfolgende FlyPortion
|
|
|
|
SwFldPortion *pLastFld; // umgebrochenes Feld
|
|
|
|
SwLinePortion *pUnderFlow; // Unterlaufsituation: letzte Portion
|
|
|
|
SwLinePortion *pRest; // Rest ist der Beginn der naechsten Zeile
|
|
|
|
|
|
|
|
SwTabPortion *pLastTab; // die _letzte_ TabPortion
|
|
|
|
|
|
|
|
xub_StrLen nSoftHyphPos; // SoftHyphPos fuer Hyphenate
|
|
|
|
xub_StrLen nHyphStart; // TxtPos, an der die interakt.Tr.z.Z. steht
|
|
|
|
xub_StrLen nHyphWrdStart; // gefundene Wort-Position
|
|
|
|
xub_StrLen nHyphWrdLen; // gefundene Wort-Laenge
|
|
|
|
xub_StrLen nLineStart; // aktueller Zeilenbeginn im rTxt
|
2001-10-10 14:19:15 +00:00
|
|
|
xub_StrLen nUnderScorePos; // enlarge repaint if underscore has been found
|
2011-04-16 22:42:13 -03:00
|
|
|
// #i34348# Changed type from sal_uInt16 to SwTwips
|
2004-12-23 09:09:33 +00:00
|
|
|
SwTwips nLeft; // linker Rand
|
|
|
|
SwTwips nRight; // rechter Rand
|
|
|
|
SwTwips nFirst; // EZE
|
2000-09-18 23:08:29 +00:00
|
|
|
KSHORT nRealWidth; // "echte" Zeilenbreite
|
|
|
|
KSHORT nWidth; // "virtuelle" Zeilenbreite
|
|
|
|
KSHORT nLineHeight; // endgueltige Hoehe nach CalcLine
|
2001-04-26 09:37:23 +00:00
|
|
|
KSHORT nLineNettoHeight; // line height without spacing
|
2000-09-18 23:08:29 +00:00
|
|
|
KSHORT nForcedLeftMargin; // Verschiebung des linken Rands wg. Rahmen
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Int16 nMinLeading; // minimum number of chars before hyphenation point
|
|
|
|
sal_Int16 nMinTrailing; // minimum number of chars after hyphenation point
|
|
|
|
sal_Int16 nMinWordLength; // minimum length of word to be hyphenated
|
2001-03-29 07:02:02 +00:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
sal_Bool bFull : 1; // Zeile ist voll
|
|
|
|
sal_Bool bFtnDone : 1; // Ftn bereits formatiert
|
|
|
|
sal_Bool bErgoDone : 1; // ErgoDone bereits formatiert
|
|
|
|
sal_Bool bNumDone : 1; // bNumDone bereits formatiert
|
2006-10-13 07:19:00 +00:00
|
|
|
sal_Bool bArrowDone : 1; // Pfeil nach links bei gescrollten Absaetzen
|
2000-09-18 23:08:29 +00:00
|
|
|
sal_Bool bStop : 1; // Sofort abbrechen, Zeile verwerfen.
|
|
|
|
sal_Bool bNewLine : 1; // Noch eine weitere Zeile formatieren.
|
|
|
|
sal_Bool bShift : 1; // Positionsaend.: Repaint bis auf Weiteres
|
|
|
|
sal_Bool bUnderFlow : 1; // Kontext: UnderFlow() ?
|
|
|
|
sal_Bool bInterHyph: 1; // interaktive Trennung ?
|
|
|
|
sal_Bool bAutoHyph : 1; // automatische Trennung ?
|
|
|
|
sal_Bool bDropInit : 1; // DropWidth einstellen.
|
|
|
|
sal_Bool bQuick : 1; // FormatQuick()
|
|
|
|
sal_Bool bNoEndHyph : 1; // Trennung am Zeilenende abgeschaltet wg. MaxHyphens
|
|
|
|
sal_Bool bNoMidHyph : 1; // Trennung vor Flies abgeschaltet wg. MaxHyphens
|
|
|
|
sal_Bool bIgnoreFly: 1; // FitToContent ignoriert Flies
|
2001-05-07 10:39:40 +00:00
|
|
|
sal_Bool bFakeLineStart: 1; // String has been replaced by field portion
|
|
|
|
// info structure only pretends that we are at
|
|
|
|
// the beginning of a line
|
2011-10-31 17:39:16 +01:00
|
|
|
sal_Bool bTabOverflow; // Tabs are expanding after the end margin
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
xub_Unicode cTabDecimal; // das _aktuelle_ Dezimalzeichen
|
|
|
|
xub_Unicode cHookChar; // fuer Tabs in Feldern etc.
|
|
|
|
sal_uInt8 nMaxHyph; // max. Zeilenanz. aufeinanderfolg. Trenn.
|
|
|
|
sal_Bool bTestFormat; // Testformatierung aus WouldFit, keine Benachrichtigungen etc.
|
|
|
|
|
|
|
|
// Hyphenating ...
|
|
|
|
sal_Bool InitHyph( const sal_Bool bAuto = sal_False );
|
|
|
|
sal_Bool _CheckFtnPortion( SwLineLayout* pCurr );
|
|
|
|
|
|
|
|
public:
|
2007-09-27 08:13:19 +00:00
|
|
|
void CtorInitTxtFormatInfo( SwTxtFrm *pFrm, const sal_Bool bInterHyph = sal_False,
|
2000-10-16 12:21:25 +00:00
|
|
|
const sal_Bool bQuick = sal_False, const sal_Bool bTst = sal_False );
|
2007-09-27 08:13:19 +00:00
|
|
|
inline SwTxtFormatInfo(SwTxtFrm *pFrame,const sal_Bool bInterHyphL=sal_False,
|
|
|
|
const sal_Bool bQuickL = sal_False, const sal_Bool bTst = sal_False )
|
|
|
|
{ CtorInitTxtFormatInfo( pFrame, bInterHyphL, bQuickL, bTst ); }
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2000-10-16 12:21:25 +00:00
|
|
|
// For the formatting inside a double line in a line (multi-line portion)
|
|
|
|
// we need a modified text-format-info:
|
|
|
|
SwTxtFormatInfo( const SwTxtFormatInfo& rInf, SwLineLayout& rLay,
|
|
|
|
SwTwips nActWidth );
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
inline KSHORT Width() const { return nWidth; }
|
|
|
|
inline void Width( const KSHORT nNew ) { nWidth = nNew; }
|
|
|
|
void Init();
|
|
|
|
|
|
|
|
// liefert die erste veraenderte Position im Absatz zurueck
|
|
|
|
inline xub_StrLen GetReformatStart() const;
|
|
|
|
|
|
|
|
// Raender
|
2004-12-23 09:09:33 +00:00
|
|
|
inline SwTwips Left() const { return nLeft; }
|
|
|
|
inline void Left( const SwTwips nNew ) { nLeft = nNew; }
|
|
|
|
inline SwTwips Right() const { return nRight; }
|
|
|
|
inline void Right( const SwTwips nNew ) { nRight = nNew; }
|
|
|
|
inline SwTwips First() const { return nFirst; }
|
|
|
|
inline void First( const SwTwips nNew ) { nFirst = nNew; }
|
|
|
|
inline SwTwips CurrLeft() const { return (nLineStart ? nLeft : nFirst); }
|
2000-09-18 23:08:29 +00:00
|
|
|
inline KSHORT RealWidth() const { return nRealWidth; }
|
|
|
|
inline void RealWidth( const KSHORT nNew ) { nRealWidth = nNew; }
|
|
|
|
inline KSHORT ForcedLeftMargin() const { return nForcedLeftMargin; }
|
|
|
|
inline void ForcedLeftMargin( const KSHORT nN ) { nForcedLeftMargin = nN; }
|
|
|
|
|
|
|
|
inline sal_uInt8 &MaxHyph() { return nMaxHyph; }
|
|
|
|
inline const sal_uInt8 &MaxHyph() const { return nMaxHyph; }
|
|
|
|
|
|
|
|
inline SwLineLayout *GetRoot() { return pRoot; }
|
|
|
|
inline const SwLineLayout *GetRoot() const { return pRoot; }
|
|
|
|
|
|
|
|
inline void SetRoot( SwLineLayout *pNew ) { pRoot = pNew; }
|
|
|
|
inline SwLinePortion *GetLast() { return pLast; }
|
|
|
|
inline void SetLast( SwLinePortion *pNewLast ) { pLast = pNewLast; }
|
|
|
|
inline sal_Bool IsFull() const { return bFull; }
|
|
|
|
inline void SetFull( const sal_Bool bNew ) { bFull = bNew; }
|
|
|
|
inline sal_Bool IsHyphForbud() const
|
|
|
|
{ return pFly ? bNoMidHyph : bNoEndHyph; }
|
|
|
|
inline void SetHyphForbud( const sal_Bool bNew )
|
|
|
|
{ if ( pFly ) bNoMidHyph = bNew; else bNoEndHyph = bNew; }
|
|
|
|
inline void ChkNoHyph( const sal_uInt8 bEnd, const sal_uInt8 bMid )
|
|
|
|
{ bNoEndHyph = (nMaxHyph && bEnd >= nMaxHyph);
|
|
|
|
bNoMidHyph = (nMaxHyph && bMid >= nMaxHyph); }
|
|
|
|
inline sal_Bool IsIgnoreFly() const { return bIgnoreFly; }
|
|
|
|
inline void SetIgnoreFly( const sal_Bool bNew ) { bIgnoreFly = bNew; }
|
2001-05-07 10:39:40 +00:00
|
|
|
inline sal_Bool IsFakeLineStart() const { return bFakeLineStart; }
|
|
|
|
inline void SetFakeLineStart( const sal_Bool bNew ) { bFakeLineStart = bNew; }
|
2000-09-18 23:08:29 +00:00
|
|
|
inline sal_Bool IsStop() const { return bStop; }
|
|
|
|
inline void SetStop( const sal_Bool bNew ) { bStop = bNew; }
|
|
|
|
inline SwLinePortion *GetRest() { return pRest; }
|
|
|
|
inline void SetRest( SwLinePortion *pNewRest ) { pRest = pNewRest; }
|
|
|
|
inline sal_Bool IsNewLine() const { return bNewLine; }
|
|
|
|
inline void SetNewLine( const sal_Bool bNew ) { bNewLine = bNew; }
|
|
|
|
inline sal_Bool IsShift() const { return bShift; }
|
|
|
|
inline void SetShift( const sal_Bool bNew ) { bShift = bNew; }
|
|
|
|
inline sal_Bool IsInterHyph() const { return bInterHyph; }
|
|
|
|
inline sal_Bool IsAutoHyph() const { return bAutoHyph; }
|
|
|
|
inline sal_Bool IsUnderFlow() const { return bUnderFlow; }
|
|
|
|
inline void ClrUnderFlow() { bUnderFlow = sal_False; }
|
|
|
|
inline sal_Bool IsDropInit() const { return bDropInit; }
|
|
|
|
inline void SetDropInit( const sal_Bool bNew ) { bDropInit = bNew; }
|
|
|
|
inline sal_Bool IsQuick() const { return bQuick; }
|
|
|
|
inline sal_Bool IsTest() const { return bTestFormat; }
|
|
|
|
|
|
|
|
inline xub_StrLen GetLineStart() const { return nLineStart; }
|
|
|
|
inline void SetLineStart( const xub_StrLen nNew ) { nLineStart = nNew; }
|
2001-04-26 09:37:23 +00:00
|
|
|
|
|
|
|
// these are used during fly calculation
|
2000-09-18 23:08:29 +00:00
|
|
|
inline KSHORT GetLineHeight() const { return nLineHeight; }
|
|
|
|
inline void SetLineHeight( const KSHORT nNew ) { nLineHeight = nNew; }
|
2001-04-26 09:37:23 +00:00
|
|
|
inline KSHORT GetLineNettoHeight() const { return nLineNettoHeight; }
|
|
|
|
inline void SetLineNettoHeight( const KSHORT nNew ) { nLineNettoHeight = nNew; }
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
inline const SwLinePortion *GetUnderFlow() const { return pUnderFlow; }
|
|
|
|
inline SwLinePortion *GetUnderFlow() { return pUnderFlow; }
|
|
|
|
inline void SetUnderFlow( SwLinePortion *pNew )
|
|
|
|
{ pUnderFlow = pNew; bUnderFlow = sal_True; }
|
|
|
|
inline xub_StrLen GetSoftHyphPos() const { return nSoftHyphPos; }
|
|
|
|
inline void SetSoftHyphPos( const xub_StrLen nNew ) { nSoftHyphPos = nNew; }
|
|
|
|
|
|
|
|
inline void SetParaFtn();
|
|
|
|
|
|
|
|
// FlyFrms
|
|
|
|
inline SwFlyPortion *GetFly() { return pFly; }
|
|
|
|
inline void SetFly( SwFlyPortion *pNew ) { pFly = pNew; }
|
|
|
|
|
|
|
|
inline const SwAttrSet& GetCharAttr() const;
|
|
|
|
|
|
|
|
// Tabs
|
|
|
|
inline SwTabPortion *GetLastTab() { return pLastTab; }
|
|
|
|
inline void SetLastTab( SwTabPortion *pNew ) { pLastTab = pNew; }
|
|
|
|
inline xub_Unicode GetTabDecimal() const { return cTabDecimal; }
|
|
|
|
inline void SetTabDecimal( const xub_Unicode cNew ) { cTabDecimal = cNew;}
|
|
|
|
|
|
|
|
// Last*
|
|
|
|
inline SwFldPortion *GetLastFld() { return pLastFld; }
|
|
|
|
inline void SetLastFld( SwFldPortion *pNew ) { pLastFld = pNew; }
|
|
|
|
|
|
|
|
inline void ClearHookChar() { cHookChar = 0; }
|
|
|
|
inline void SetHookChar( const xub_Unicode cNew ) { cHookChar = cNew; }
|
|
|
|
inline xub_Unicode GetHookChar() const { return cHookChar; }
|
|
|
|
|
|
|
|
// Done-Flags
|
|
|
|
inline sal_Bool IsFtnDone() const { return bFtnDone; }
|
|
|
|
inline void SetFtnDone( const sal_Bool bNew ) { bFtnDone = bNew; }
|
|
|
|
inline sal_Bool IsErgoDone() const { return bErgoDone; }
|
|
|
|
inline void SetErgoDone( const sal_Bool bNew ) { bErgoDone = bNew; }
|
|
|
|
inline sal_Bool IsNumDone() const { return bNumDone; }
|
|
|
|
inline void SetNumDone( const sal_Bool bNew ) { bNumDone = bNew; }
|
|
|
|
inline sal_Bool IsArrowDone() const { return bArrowDone; }
|
|
|
|
inline void SetArrowDone( const sal_Bool bNew ) { bArrowDone = bNew; }
|
|
|
|
|
|
|
|
// Fuer SwTxtPortion::Hyphenate
|
|
|
|
inline sal_Bool IsSoftHyph( const xub_StrLen nPos ) const;
|
|
|
|
sal_Bool ChgHyph( const sal_Bool bNew );
|
|
|
|
|
|
|
|
// Soll die Trennhilfe angeschmissen werden?
|
|
|
|
sal_Bool IsHyphenate() const;
|
|
|
|
inline void SetHyphStart( const xub_StrLen nNew ) { nHyphStart = nNew; }
|
|
|
|
inline xub_StrLen GetHyphStart() const { return nHyphStart; }
|
|
|
|
inline void SetHyphWrdStart( const xub_StrLen nNew ) { nHyphWrdStart = nNew; }
|
|
|
|
inline xub_StrLen GetHyphWrdStart() const { return nHyphWrdStart; }
|
|
|
|
inline void SetHyphWrdLen( const xub_StrLen nNew ) { nHyphWrdLen = nNew; }
|
|
|
|
inline xub_StrLen GetHyphWrdLen() const { return nHyphWrdLen; }
|
2001-10-10 14:19:15 +00:00
|
|
|
inline xub_StrLen GetUnderScorePos() const { return nUnderScorePos; }
|
|
|
|
inline void SetUnderScorePos( xub_StrLen nNew ) { nUnderScorePos = nNew; }
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
// ruft HyphenateWord() des Hyphenators
|
2000-10-27 11:17:04 +00:00
|
|
|
::com::sun::star::uno::Reference<
|
2000-11-06 08:24:36 +00:00
|
|
|
::com::sun::star::linguistic2::XHyphenatedWord >
|
2011-01-17 15:06:54 +01:00
|
|
|
HyphWord( const String &rTxt, const sal_uInt16 nMinTrail );
|
2001-03-29 07:02:02 +00:00
|
|
|
const com::sun::star::beans::PropertyValues &
|
|
|
|
GetHyphValues() const;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
sal_Bool CheckFtnPortion( SwLineLayout* pCurr )
|
|
|
|
{ return IsFtnInside() && _CheckFtnPortion( pCurr ); }
|
|
|
|
|
|
|
|
// Dropcaps vom SwTxtFormatter::CTOR gerufen.
|
|
|
|
const SwFmtDrop *GetDropFmt() const;
|
|
|
|
|
|
|
|
// setzt die FormatInfo wieder in den Anfangszustand
|
|
|
|
void Reset( const SwTxtFrm *pFrame); // , const sal_Bool bAll );
|
|
|
|
|
2001-04-09 09:44:17 +00:00
|
|
|
// Sets the last SwKernPortion as pLast, if it is followed by empty portions
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool LastKernPortion();
|
2001-04-09 09:44:17 +00:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
// Sucht ab nIdx bis nEnd nach Tabs, TabDec, TXTATR und BRK.
|
|
|
|
// Return: gefundene Position, setzt ggf. cHookChar
|
2003-03-27 14:45:43 +00:00
|
|
|
xub_StrLen ScanPortionEnd( const xub_StrLen nStart, const xub_StrLen nEnd );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
// friend ostream &operator<<( ostream &rOS, const SwTxtFormatInfo &rInf );
|
|
|
|
friend SvStream &operator<<( SvStream &rOS, const SwTxtFormatInfo &rInf );
|
2011-10-31 17:39:16 +01:00
|
|
|
|
|
|
|
inline void SetTabOverflow( sal_Bool bOverflow ) { bTabOverflow = bOverflow; }
|
|
|
|
inline sal_Bool IsTabOverflow( ) { return bTabOverflow; }
|
2000-09-18 23:08:29 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* class SwTxtSlot
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
// Fuer die Textersetzung und Restaurierung der SwTxtSizeInfo.
|
|
|
|
// Die Art und Weise ist etwas kriminell, rInf ist const und wird
|
|
|
|
// trotzdem veraendert. Da rInf im DTOR wieder restauriert wird,
|
|
|
|
// ist dies zulaessig, es handelt sich um ein "logisches const".
|
|
|
|
|
|
|
|
class SwTxtSlot
|
|
|
|
{
|
|
|
|
XubString aTxt;
|
|
|
|
const XubString *pOldTxt;
|
2007-01-29 15:56:15 +00:00
|
|
|
const SwWrongList* pOldSmartTagList;
|
2008-07-16 12:28:48 +00:00
|
|
|
const SwWrongList* pOldGrammarCheckList;
|
|
|
|
SwWrongList* pTempList;
|
2000-09-18 23:08:29 +00:00
|
|
|
xub_StrLen nIdx;
|
|
|
|
xub_StrLen nLen;
|
|
|
|
sal_Bool bOn;
|
|
|
|
protected:
|
|
|
|
SwTxtSizeInfo *pInf;
|
|
|
|
public:
|
|
|
|
// Der Ersetzungstring kommt wahlweise aus der Portion via GetExpText()
|
|
|
|
// oder aus dem char Pointer pCh, wenn dieser ungleich NULL ist.
|
2007-01-29 15:56:15 +00:00
|
|
|
SwTxtSlot( const SwTxtSizeInfo *pNew, const SwLinePortion *pPor, bool bTxtLen,
|
2008-07-16 12:28:48 +00:00
|
|
|
bool bExgLists, const sal_Char *pCh = NULL );
|
2007-01-29 15:56:15 +00:00
|
|
|
~SwTxtSlot();
|
2000-09-18 23:08:29 +00:00
|
|
|
inline sal_Bool IsOn() const { return bOn; }
|
|
|
|
};
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* class SwFontSave
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
class SwFontSave
|
|
|
|
{
|
|
|
|
SwTxtSizeInfo *pInf;
|
|
|
|
SwFont *pFnt;
|
2000-12-11 10:05:15 +00:00
|
|
|
SwAttrIter *pIter;
|
2000-09-18 23:08:29 +00:00
|
|
|
public:
|
2000-12-11 10:05:15 +00:00
|
|
|
SwFontSave( const SwTxtSizeInfo &rInf, SwFont *pFnt,
|
|
|
|
SwAttrIter* pItr = NULL );
|
2000-09-18 23:08:29 +00:00
|
|
|
~SwFontSave();
|
|
|
|
};
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* class SwDefFontSave
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
class SwDefFontSave
|
|
|
|
{
|
|
|
|
SwTxtSizeInfo *pInf;
|
|
|
|
SwFont *pFnt;
|
|
|
|
SwFont *pNewFnt;
|
|
|
|
sal_Bool bAlter;
|
|
|
|
public:
|
|
|
|
SwDefFontSave( const SwTxtSizeInfo &rInf );
|
|
|
|
~SwDefFontSave();
|
|
|
|
};
|
|
|
|
|
|
|
|
/*************************************************************************
|
2001-04-09 09:44:17 +00:00
|
|
|
* Inline-Implementierungen SwTxtSizeInfo
|
2000-09-18 23:08:29 +00:00
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
inline KSHORT SwTxtSizeInfo::GetAscent() const
|
|
|
|
{
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( GetOut(), "SwTxtSizeInfo::GetAscent() without pOut" );
|
2003-10-15 08:55:46 +00:00
|
|
|
return ((SwFont*)GetFont())->GetAscent( pVsh, *GetOut() );
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
inline KSHORT SwTxtSizeInfo::GetTxtHeight() const
|
|
|
|
{
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( GetOut(), "SwTxtSizeInfo::GetTxtHeight() without pOut" );
|
2003-10-15 08:55:46 +00:00
|
|
|
return ((SwFont*)GetFont())->GetHeight( pVsh, *GetOut() );
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
inline SwPosSize SwTxtSizeInfo::GetTxtSize( const XubString &rTxt ) const
|
|
|
|
{
|
2001-04-09 09:44:17 +00:00
|
|
|
return GetTxtSize( pOut, 0, rTxt, 0, rTxt.Len(), 0 );
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
2001-04-09 09:44:17 +00:00
|
|
|
inline SwPosSize SwTxtSizeInfo::GetTxtSize( const SwScriptInfo* pSI,
|
|
|
|
const xub_StrLen nNewIdx,
|
|
|
|
const xub_StrLen nNewLen,
|
2011-01-17 15:06:54 +01:00
|
|
|
const sal_uInt16 nCompress ) const
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2001-04-09 09:44:17 +00:00
|
|
|
return GetTxtSize( pOut, pSI, *pTxt, nNewIdx, nNewLen, nCompress );
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
2001-04-09 09:44:17 +00:00
|
|
|
/*************************************************************************
|
|
|
|
* Inline-Implementierungen SwTxtPaintInfo
|
|
|
|
*************************************************************************/
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
inline SwTwips SwTxtPaintInfo::GetPaintOfst() const
|
|
|
|
{
|
|
|
|
return GetParaPortion()->GetRepaint()->GetOfst();
|
|
|
|
}
|
|
|
|
|
|
|
|
inline void SwTxtPaintInfo::SetPaintOfst( const SwTwips nNew )
|
|
|
|
{
|
|
|
|
GetParaPortion()->GetRepaint()->SetOfst( nNew );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
inline void SwTxtPaintInfo::DrawText( const XubString &rText,
|
|
|
|
const SwLinePortion &rPor,
|
2007-09-27 08:13:19 +00:00
|
|
|
const xub_StrLen nStart, const xub_StrLen nLength,
|
2000-09-18 23:08:29 +00:00
|
|
|
const sal_Bool bKern ) const
|
|
|
|
{
|
2007-09-27 08:13:19 +00:00
|
|
|
((SwTxtPaintInfo*)this)->_DrawText( rText, rPor, nStart, nLength, bKern );
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
inline void SwTxtPaintInfo::DrawText( const SwLinePortion &rPor,
|
2007-09-27 08:13:19 +00:00
|
|
|
const xub_StrLen nLength, const sal_Bool bKern ) const
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2007-09-27 08:13:19 +00:00
|
|
|
((SwTxtPaintInfo*)this)->_DrawText( *pTxt, rPor, nIdx, nLength, bKern );
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
2007-01-02 15:50:38 +00:00
|
|
|
inline void SwTxtPaintInfo::DrawMarkedText( const SwLinePortion &rPor,
|
2007-09-27 08:13:19 +00:00
|
|
|
const xub_StrLen nLength,
|
2007-01-02 15:50:38 +00:00
|
|
|
const sal_Bool bKern,
|
|
|
|
const sal_Bool bWrong,
|
2008-02-26 08:46:21 +00:00
|
|
|
const sal_Bool bSmartTags,
|
|
|
|
const sal_Bool bGrammarCheck ) const
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2008-02-26 08:46:21 +00:00
|
|
|
((SwTxtPaintInfo*)this)->_DrawText( *pTxt, rPor, nIdx, nLength, bKern, bWrong, bSmartTags, bGrammarCheck );
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
2001-04-09 09:44:17 +00:00
|
|
|
/*************************************************************************
|
|
|
|
* Inline-Implementierungen SwTxtFormatInfo
|
|
|
|
*************************************************************************/
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
inline xub_StrLen SwTxtFormatInfo::GetReformatStart() const
|
|
|
|
{
|
|
|
|
return GetParaPortion()->GetReformat()->Start();
|
|
|
|
}
|
|
|
|
|
|
|
|
inline const SwAttrSet& SwTxtFormatInfo::GetCharAttr() const
|
|
|
|
{
|
|
|
|
return GetTxtFrm()->GetTxtNode()->GetSwAttrSet();
|
|
|
|
}
|
|
|
|
|
|
|
|
inline void SwTxtFormatInfo::SetParaFtn()
|
|
|
|
{
|
|
|
|
GetTxtFrm()->SetFtn( sal_True );
|
|
|
|
}
|
|
|
|
|
|
|
|
inline sal_Bool SwTxtFormatInfo::IsSoftHyph( const xub_StrLen nPos ) const
|
|
|
|
{
|
|
|
|
return CHAR_SOFTHYPHEN == GetTxtFrm()->GetTxtNode()->GetTxt().GetChar(nPos);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2010-10-14 08:30:41 +02:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|