2000-09-18 16:07:07 +00:00
|
|
|
|
/*************************************************************************
|
|
|
|
|
*
|
2008-04-10 23:23:29 +00:00
|
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2000-09-18 16:07:07 +00:00
|
|
|
|
*
|
2008-04-10 23:23:29 +00:00
|
|
|
|
* Copyright 2008 by Sun Microsystems, Inc.
|
2000-09-18 16:07:07 +00:00
|
|
|
|
*
|
2008-04-10 23:23:29 +00:00
|
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2000-09-18 16:07:07 +00:00
|
|
|
|
*
|
2008-04-10 23:23:29 +00:00
|
|
|
|
* $RCSfile: editdoc.hxx,v $
|
|
|
|
|
* $Revision: 1.29 $
|
2000-09-18 16:07:07 +00:00
|
|
|
|
*
|
2008-04-10 23:23:29 +00:00
|
|
|
|
* This file is part of OpenOffice.org.
|
2000-09-18 16:07:07 +00:00
|
|
|
|
*
|
2008-04-10 23:23:29 +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 16:07:07 +00:00
|
|
|
|
*
|
2008-04-10 23:23:29 +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 16:07:07 +00:00
|
|
|
|
*
|
2008-04-10 23:23:29 +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 16:07:07 +00:00
|
|
|
|
*
|
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
#ifndef _EDITDOC_HXX
|
|
|
|
|
#define _EDITDOC_HXX
|
|
|
|
|
|
2006-03-14 08:39:50 +00:00
|
|
|
|
#ifndef _COM_SUN_STAR_I18N_XEXTENDEDINPUTSEQUENCECHECKER_HDL_
|
|
|
|
|
#include <com/sun/star/i18n/XExtendedInputSequenceChecker.hpp>
|
|
|
|
|
#endif
|
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
|
#include <editattr.hxx>
|
|
|
|
|
#include <edtspell.hxx>
|
2007-06-27 16:54:51 +00:00
|
|
|
|
#include <svx/svxfont.hxx>
|
2009-10-16 00:05:16 +02:00
|
|
|
|
#include <svl/itemset.hxx>
|
|
|
|
|
#include <svl/style.hxx>
|
|
|
|
|
#include <svl/itempool.hxx>
|
2000-09-18 16:07:07 +00:00
|
|
|
|
#include <tools/table.hxx>
|
|
|
|
|
|
|
|
|
|
class ImpEditEngine;
|
|
|
|
|
class SvxTabStop;
|
2006-03-14 08:39:50 +00:00
|
|
|
|
class SvtCTLOptions;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
2006-10-12 11:35:25 +00:00
|
|
|
|
DBG_NAMEEX( EE_TextPortion )
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
|
|
#define CHARPOSGROW 16
|
|
|
|
|
#define DEFTAB 720
|
|
|
|
|
|
2006-10-12 11:35:25 +00:00
|
|
|
|
void CreateFont( SvxFont& rFont, const SfxItemSet& rSet, bool bSearchInParent = true, short nScriptType = 0 );
|
2000-11-02 14:25:36 +00:00
|
|
|
|
USHORT GetScriptItemId( USHORT nItemId, short nScriptType );
|
|
|
|
|
BOOL IsScriptItemValid( USHORT nItemId, short nScriptType );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
|
|
EditCharAttrib* MakeCharAttrib( SfxItemPool& rPool, const SfxPoolItem& rAttr, USHORT nS, USHORT nE );
|
|
|
|
|
|
|
|
|
|
class ContentNode;
|
|
|
|
|
class EditDoc;
|
|
|
|
|
|
|
|
|
|
struct EPaM
|
|
|
|
|
{
|
|
|
|
|
USHORT nPara;
|
|
|
|
|
USHORT nIndex;
|
|
|
|
|
|
|
|
|
|
EPaM() { nPara = 0; nIndex = 0; }
|
|
|
|
|
EPaM( USHORT nP, USHORT nI ) { nPara = nP; nIndex = nI; }
|
|
|
|
|
EPaM( const EPaM& r) { nPara = r.nPara; nIndex = r.nIndex; }
|
|
|
|
|
EPaM& operator = ( const EPaM& r ) { nPara = r.nPara; nIndex = r.nIndex; return *this; }
|
|
|
|
|
inline BOOL operator == ( const EPaM& r ) const;
|
|
|
|
|
inline BOOL operator < ( const EPaM& r ) const;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
inline BOOL EPaM::operator < ( const EPaM& r ) const
|
|
|
|
|
{
|
|
|
|
|
return ( ( nPara < r.nPara ) ||
|
|
|
|
|
( ( nPara == r.nPara ) && nIndex < r.nIndex ) ) ? TRUE : FALSE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
inline BOOL EPaM::operator == ( const EPaM& r ) const
|
|
|
|
|
{
|
|
|
|
|
return ( ( nPara == r.nPara ) && ( nIndex == r.nIndex ) ) ? TRUE : FALSE;
|
|
|
|
|
}
|
|
|
|
|
|
2000-11-02 14:25:36 +00:00
|
|
|
|
struct ScriptTypePosInfo
|
|
|
|
|
{
|
|
|
|
|
short nScriptType;
|
|
|
|
|
USHORT nStartPos;
|
|
|
|
|
USHORT nEndPos;
|
|
|
|
|
|
|
|
|
|
ScriptTypePosInfo( short _Type, USHORT _Start, USHORT _End )
|
|
|
|
|
{
|
|
|
|
|
nScriptType = _Type;
|
|
|
|
|
nStartPos = _Start;
|
|
|
|
|
nEndPos = _End;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2006-10-12 11:35:25 +00:00
|
|
|
|
SV_DECL_VARARR( ScriptTypePosInfos, ScriptTypePosInfo, 0, 4 )
|
2000-11-02 14:25:36 +00:00
|
|
|
|
|
2002-07-12 09:31:21 +00:00
|
|
|
|
struct WritingDirectionInfo
|
|
|
|
|
{
|
|
|
|
|
BYTE nType;
|
|
|
|
|
USHORT nStartPos;
|
|
|
|
|
USHORT nEndPos;
|
|
|
|
|
|
|
|
|
|
WritingDirectionInfo( BYTE _Type, USHORT _Start, USHORT _End )
|
|
|
|
|
{
|
|
|
|
|
nType = _Type;
|
|
|
|
|
nStartPos = _Start;
|
|
|
|
|
nEndPos = _End;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2006-10-12 11:35:25 +00:00
|
|
|
|
SV_DECL_VARARR( WritingDirectionInfos, WritingDirectionInfo, 0, 4 )
|
2002-07-12 09:31:21 +00:00
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
|
typedef EditCharAttrib* EditCharAttribPtr;
|
2006-10-12 11:35:25 +00:00
|
|
|
|
SV_DECL_PTRARR( CharAttribArray, EditCharAttribPtr, 0, 4 )
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
|
|
class ContentAttribsInfo
|
|
|
|
|
{
|
|
|
|
|
private:
|
|
|
|
|
SfxItemSet aPrevParaAttribs;
|
|
|
|
|
CharAttribArray aPrevCharAttribs;
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
ContentAttribsInfo( const SfxItemSet& rParaAttribs );
|
|
|
|
|
|
|
|
|
|
const SfxItemSet& GetPrevParaAttribs() const { return aPrevParaAttribs; }
|
|
|
|
|
const CharAttribArray& GetPrevCharAttribs() const { return aPrevCharAttribs; }
|
|
|
|
|
|
|
|
|
|
CharAttribArray& GetPrevCharAttribs() { return aPrevCharAttribs; }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
typedef ContentAttribsInfo* ContentAttribsInfoPtr;
|
2006-10-12 11:35:25 +00:00
|
|
|
|
SV_DECL_PTRARR( ContentInfoArray, ContentAttribsInfoPtr, 1, 1 )
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
2001-06-21 11:47:31 +00:00
|
|
|
|
// ----------------------------------------------------------------------
|
2000-09-18 16:07:07 +00:00
|
|
|
|
// class SvxFontTable
|
|
|
|
|
// ----------------------------------------------------------------------
|
2006-10-12 11:35:25 +00:00
|
|
|
|
DECLARE_TABLE( DummyFontTable, SvxFontItem* )
|
2000-09-18 16:07:07 +00:00
|
|
|
|
class SvxFontTable : public DummyFontTable
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
SvxFontTable();
|
|
|
|
|
~SvxFontTable();
|
|
|
|
|
|
|
|
|
|
ULONG GetId( const SvxFontItem& rFont );
|
|
|
|
|
};
|
|
|
|
|
|
2001-06-21 11:47:31 +00:00
|
|
|
|
// ----------------------------------------------------------------------
|
2000-09-18 16:07:07 +00:00
|
|
|
|
// class SvxColorList
|
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
|
typedef ContentNode* ContentNodePtr;
|
2006-10-12 11:35:25 +00:00
|
|
|
|
DECLARE_LIST( DummyColorList, SvxColorItem* )
|
2000-09-18 16:07:07 +00:00
|
|
|
|
class SvxColorList : public DummyColorList
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
SvxColorList();
|
|
|
|
|
~SvxColorList();
|
|
|
|
|
|
|
|
|
|
ULONG GetId( const SvxColorItem& rColor );
|
|
|
|
|
};
|
|
|
|
|
|
2001-06-21 11:47:31 +00:00
|
|
|
|
// ----------------------------------------------------------------------
|
2000-09-18 16:07:07 +00:00
|
|
|
|
// class ItemList
|
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
|
typedef const SfxPoolItem* ConstPoolItemPtr;
|
2006-10-12 11:35:25 +00:00
|
|
|
|
DECLARE_LIST( DummyItemList, ConstPoolItemPtr )
|
2000-09-18 16:07:07 +00:00
|
|
|
|
class ItemList : public DummyItemList
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
const SfxPoolItem* FindAttrib( USHORT nWhich );
|
|
|
|
|
};
|
|
|
|
|
|
2001-06-21 11:47:31 +00:00
|
|
|
|
// -------------------------------------------------------------------------
|
2000-09-18 16:07:07 +00:00
|
|
|
|
// class ContentAttribs
|
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
|
class ContentAttribs
|
|
|
|
|
{
|
|
|
|
|
private:
|
|
|
|
|
SfxStyleSheet* pStyle;
|
|
|
|
|
SfxItemSet aAttribSet;
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
ContentAttribs( SfxItemPool& rItemPool );
|
|
|
|
|
ContentAttribs( const ContentAttribs& );
|
|
|
|
|
~ContentAttribs(); // erst bei umfangreicheren Tabs
|
|
|
|
|
|
|
|
|
|
SvxTabStop FindTabStop( long nCurPos, USHORT nDefTab );
|
|
|
|
|
SfxItemSet& GetItems() { return aAttribSet; }
|
|
|
|
|
SfxStyleSheet* GetStyleSheet() const { return pStyle; }
|
|
|
|
|
void SetStyleSheet( SfxStyleSheet* pS );
|
|
|
|
|
|
2001-03-21 11:02:04 +00:00
|
|
|
|
const SfxPoolItem& GetItem( USHORT nWhich );
|
|
|
|
|
BOOL HasItem( USHORT nWhich );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
};
|
|
|
|
|
|
2001-06-21 11:47:31 +00:00
|
|
|
|
// -------------------------------------------------------------------------
|
2000-09-18 16:07:07 +00:00
|
|
|
|
// class CharAttribList
|
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
|
class CharAttribList
|
|
|
|
|
{
|
|
|
|
|
private:
|
|
|
|
|
CharAttribArray aAttribs;
|
|
|
|
|
SvxFont aDefFont; // schneller, als jedesmal vom Pool!
|
|
|
|
|
BOOL bHasEmptyAttribs;
|
|
|
|
|
|
|
|
|
|
CharAttribList( const CharAttribList& ) {;}
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
CharAttribList();
|
|
|
|
|
~CharAttribList();
|
|
|
|
|
|
|
|
|
|
void DeleteEmptyAttribs( SfxItemPool& rItemPool );
|
|
|
|
|
void RemoveItemsFromPool( SfxItemPool* pItemPool );
|
|
|
|
|
|
|
|
|
|
EditCharAttrib* FindAttrib( USHORT nWhich, USHORT nPos );
|
|
|
|
|
EditCharAttrib* FindNextAttrib( USHORT nWhich, USHORT nFromPos ) const;
|
|
|
|
|
EditCharAttrib* FindEmptyAttrib( USHORT nWhich, USHORT nPos );
|
|
|
|
|
EditCharAttrib* FindFeature( USHORT nPos ) const;
|
|
|
|
|
|
2001-02-23 12:05:45 +00:00
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
|
void ResortAttribs();
|
2001-11-12 12:06:40 +00:00
|
|
|
|
void OptimizeRanges( SfxItemPool& rItemPool );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
|
|
USHORT Count() { return aAttribs.Count(); }
|
|
|
|
|
void Clear() { aAttribs.Remove( 0, aAttribs.Count()); }
|
|
|
|
|
void InsertAttrib( EditCharAttrib* pAttrib );
|
|
|
|
|
|
|
|
|
|
SvxFont& GetDefFont() { return aDefFont; }
|
|
|
|
|
|
|
|
|
|
BOOL HasEmptyAttribs() const { return bHasEmptyAttribs; }
|
|
|
|
|
BOOL& HasEmptyAttribs() { return bHasEmptyAttribs; }
|
|
|
|
|
BOOL HasBoundingAttrib( USHORT nBound );
|
|
|
|
|
BOOL HasAttrib( USHORT nWhich ) const;
|
2001-02-23 12:05:45 +00:00
|
|
|
|
BOOL HasAttrib( USHORT nStartPos, USHORT nEndPos ) const;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
|
|
CharAttribArray& GetAttribs() { return aAttribs; }
|
|
|
|
|
const CharAttribArray& GetAttribs() const { return aAttribs; }
|
|
|
|
|
|
|
|
|
|
// Debug:
|
|
|
|
|
BOOL DbgCheckAttribs();
|
|
|
|
|
};
|
|
|
|
|
|
2001-06-21 11:47:31 +00:00
|
|
|
|
// -------------------------------------------------------------------------
|
2000-09-18 16:07:07 +00:00
|
|
|
|
// class ContentNode
|
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
|
class ContentNode : public XubString
|
|
|
|
|
{
|
|
|
|
|
private:
|
|
|
|
|
ContentAttribs aContentAttribs;
|
|
|
|
|
CharAttribList aCharAttribList;
|
|
|
|
|
WrongList* pWrongList;
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
ContentNode( SfxItemPool& rItemPool );
|
|
|
|
|
ContentNode( const XubString& rStr, const ContentAttribs& rContentAttribs );
|
|
|
|
|
~ContentNode();
|
|
|
|
|
|
|
|
|
|
ContentAttribs& GetContentAttribs() { return aContentAttribs; }
|
|
|
|
|
CharAttribList& GetCharAttribs() { return aCharAttribList; }
|
|
|
|
|
|
|
|
|
|
void ExpandAttribs( USHORT nIndex, USHORT nNewChars, SfxItemPool& rItemPool );
|
|
|
|
|
void CollapsAttribs( USHORT nIndex, USHORT nDelChars, SfxItemPool& rItemPool );
|
|
|
|
|
void AppendAttribs( ContentNode* pNextNode );
|
|
|
|
|
void CopyAndCutAttribs( ContentNode* pPrevNode, SfxItemPool& rPool, BOOL bKeepEndingAttribs );
|
|
|
|
|
|
|
|
|
|
void SetStyleSheet( SfxStyleSheet* pS, BOOL bRecalcFont = TRUE );
|
|
|
|
|
void SetStyleSheet( SfxStyleSheet* pS, const SvxFont& rFontFromStyle );
|
|
|
|
|
SfxStyleSheet* GetStyleSheet() { return aContentAttribs.GetStyleSheet(); }
|
|
|
|
|
|
|
|
|
|
void CreateDefFont();
|
|
|
|
|
|
2006-01-10 13:01:03 +00:00
|
|
|
|
WrongList* GetWrongList() { return pWrongList; }
|
|
|
|
|
void SetWrongList( WrongList* p );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
|
|
void CreateWrongList();
|
|
|
|
|
void DestroyWrongList();
|
|
|
|
|
|
|
|
|
|
BOOL IsFeature( USHORT nPos ) const { return ( GetChar( nPos ) == CH_FEATURE ); }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
typedef ContentNode* ContentNodePtr;
|
2009-07-03 12:42:53 +00:00
|
|
|
|
SV_DECL_PTRARR( DummyContentList, ContentNodePtr, 0, 4 )
|
|
|
|
|
|
|
|
|
|
class ContentList : public DummyContentList
|
|
|
|
|
{
|
|
|
|
|
USHORT nLastCache;
|
|
|
|
|
public:
|
|
|
|
|
ContentList() : DummyContentList( 0, 4 ), nLastCache(0) {}
|
|
|
|
|
USHORT GetPos( const ContentNodePtr &rPtr ) const;
|
|
|
|
|
};
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
2001-06-21 11:47:31 +00:00
|
|
|
|
// -------------------------------------------------------------------------
|
2000-09-18 16:07:07 +00:00
|
|
|
|
// class EditPaM
|
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
|
class EditPaM
|
|
|
|
|
{
|
|
|
|
|
private:
|
|
|
|
|
ContentNode* pNode;
|
|
|
|
|
USHORT nIndex;
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
EditPaM() { pNode = NULL; nIndex = 0; }
|
|
|
|
|
EditPaM( ContentNode* p, USHORT n ) { pNode = p; nIndex = n; }
|
|
|
|
|
|
|
|
|
|
ContentNode* GetNode() const { return pNode; }
|
|
|
|
|
void SetNode( ContentNode* p) { pNode = p; }
|
|
|
|
|
|
|
|
|
|
USHORT GetIndex() const { return nIndex; }
|
|
|
|
|
USHORT& GetIndex() { return nIndex; }
|
|
|
|
|
void SetIndex( USHORT n ) { nIndex = n; }
|
|
|
|
|
|
|
|
|
|
BOOL IsParaStart() const { return nIndex == 0; }
|
|
|
|
|
BOOL IsParaEnd() const { return nIndex == pNode->Len(); }
|
|
|
|
|
|
|
|
|
|
BOOL DbgIsBuggy( EditDoc& rDoc );
|
|
|
|
|
|
|
|
|
|
EditPaM& operator = ( const EditPaM& rPaM );
|
|
|
|
|
friend BOOL operator == ( const EditPaM& r1, const EditPaM& r2 );
|
|
|
|
|
friend BOOL operator != ( const EditPaM& r1, const EditPaM& r2 );
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#define PORTIONKIND_TEXT 0
|
|
|
|
|
#define PORTIONKIND_TAB 1
|
|
|
|
|
#define PORTIONKIND_LINEBREAK 2
|
|
|
|
|
#define PORTIONKIND_FIELD 3
|
|
|
|
|
#define PORTIONKIND_HYPHENATOR 4
|
2001-05-11 07:06:32 +00:00
|
|
|
|
// #define PORTIONKIND_EXTRASPACE 5
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
|
|
#define DELMODE_SIMPLE 0
|
|
|
|
|
#define DELMODE_RESTOFWORD 1
|
|
|
|
|
#define DELMODE_RESTOFCONTENT 2
|
|
|
|
|
|
2001-06-21 11:47:31 +00:00
|
|
|
|
#define CHAR_NORMAL 0x00
|
|
|
|
|
#define CHAR_KANA 0x01
|
|
|
|
|
#define CHAR_PUNCTUATIONLEFT 0x02
|
|
|
|
|
#define CHAR_PUNCTUATIONRIGHT 0x04
|
|
|
|
|
|
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
|
// struct ExtraPortionInfos
|
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
|
struct ExtraPortionInfo
|
|
|
|
|
{
|
|
|
|
|
long nOrgWidth;
|
|
|
|
|
long nWidthFullCompression;
|
|
|
|
|
|
|
|
|
|
long nPortionOffsetX;
|
|
|
|
|
|
|
|
|
|
USHORT nMaxCompression100thPercent;
|
|
|
|
|
|
|
|
|
|
BYTE nAsianCompressionTypes;
|
|
|
|
|
BOOL bFirstCharIsRightPunktuation;
|
|
|
|
|
BOOL bCompressed;
|
|
|
|
|
|
2005-10-05 12:23:30 +00:00
|
|
|
|
sal_Int32* pOrgDXArray;
|
2001-06-21 11:47:31 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ExtraPortionInfo();
|
|
|
|
|
~ExtraPortionInfo();
|
|
|
|
|
|
2005-10-05 12:23:30 +00:00
|
|
|
|
void SaveOrgDXArray( const sal_Int32* pDXArray, USHORT nLen );
|
2001-06-21 11:47:31 +00:00
|
|
|
|
void DestroyOrgDXArray();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// -------------------------------------------------------------------------
|
2000-09-18 16:07:07 +00:00
|
|
|
|
// class TextPortion
|
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
|
class TextPortion
|
|
|
|
|
{
|
|
|
|
|
private:
|
2001-06-21 11:47:31 +00:00
|
|
|
|
ExtraPortionInfo* pExtraInfos;
|
|
|
|
|
USHORT nLen;
|
|
|
|
|
Size aOutSz;
|
|
|
|
|
BYTE nKind;
|
2002-07-12 09:31:21 +00:00
|
|
|
|
BYTE nRightToLeft;
|
2001-06-21 11:47:31 +00:00
|
|
|
|
sal_Unicode nExtraValue;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
2001-06-21 11:47:31 +00:00
|
|
|
|
|
|
|
|
|
TextPortion() { DBG_CTOR( EE_TextPortion, 0 );
|
2002-07-12 09:31:21 +00:00
|
|
|
|
pExtraInfos = NULL; nLen = 0; nKind = PORTIONKIND_TEXT; nExtraValue = 0; nRightToLeft = FALSE;}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
TextPortion( USHORT nL ) : aOutSz( -1, -1 )
|
|
|
|
|
{ DBG_CTOR( EE_TextPortion, 0 );
|
2002-07-12 09:31:21 +00:00
|
|
|
|
pExtraInfos = NULL; nLen = nL; nKind = PORTIONKIND_TEXT; nExtraValue = 0; nRightToLeft = FALSE;}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
TextPortion( const TextPortion& r ) : aOutSz( r.aOutSz )
|
|
|
|
|
{ DBG_CTOR( EE_TextPortion, 0 );
|
2002-07-12 09:31:21 +00:00
|
|
|
|
pExtraInfos = NULL; nLen = r.nLen; nKind = r.nKind; nExtraValue = r.nExtraValue; nRightToLeft = r.nRightToLeft; }
|
2001-06-21 11:47:31 +00:00
|
|
|
|
|
|
|
|
|
~TextPortion() { DBG_DTOR( EE_TextPortion, 0 ); delete pExtraInfos; }
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
|
|
USHORT GetLen() const { return nLen; }
|
|
|
|
|
USHORT& GetLen() { return nLen; }
|
|
|
|
|
void SetLen( USHORT nL ) { nLen = nL; }
|
|
|
|
|
|
|
|
|
|
Size& GetSize() { return aOutSz; }
|
|
|
|
|
Size GetSize() const { return aOutSz; }
|
|
|
|
|
|
|
|
|
|
BYTE& GetKind() { return nKind; }
|
|
|
|
|
BYTE GetKind() const { return nKind; }
|
|
|
|
|
|
2002-07-12 09:31:21 +00:00
|
|
|
|
void SetRightToLeft( BYTE b ) { nRightToLeft = b; }
|
|
|
|
|
BYTE GetRightToLeft() const { return nRightToLeft; }
|
|
|
|
|
BOOL IsRightToLeft() const { return (nRightToLeft&1); }
|
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
|
sal_Unicode GetExtraValue() const { return nExtraValue; }
|
|
|
|
|
void SetExtraValue( sal_Unicode n ) { nExtraValue = n; }
|
|
|
|
|
|
|
|
|
|
BOOL HasValidSize() const { return aOutSz.Width() != (-1); }
|
|
|
|
|
|
2001-06-21 11:47:31 +00:00
|
|
|
|
ExtraPortionInfo* GetExtraInfos() const { return pExtraInfos; }
|
|
|
|
|
void SetExtraInfos( ExtraPortionInfo* p ) { delete pExtraInfos; pExtraInfos = p; }
|
|
|
|
|
};
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
2001-06-21 11:47:31 +00:00
|
|
|
|
// -------------------------------------------------------------------------
|
2000-09-18 16:07:07 +00:00
|
|
|
|
// class TextPortionList
|
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
|
typedef TextPortion* TextPortionPtr;
|
2006-10-12 11:35:25 +00:00
|
|
|
|
SV_DECL_PTRARR( TextPortionArray, TextPortionPtr, 0, 8 )
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
|
|
class TextPortionList : public TextPortionArray
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
TextPortionList();
|
|
|
|
|
~TextPortionList();
|
|
|
|
|
|
|
|
|
|
void Reset();
|
2002-07-12 09:31:21 +00:00
|
|
|
|
USHORT FindPortion( USHORT nCharPos, USHORT& rPortionStart, BOOL bPreferStartingPortion = FALSE );
|
2001-06-21 11:47:31 +00:00
|
|
|
|
USHORT GetStartPos( USHORT nPortion );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
void DeleteFromPortion( USHORT nDelFrom );
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class ParaPortion;
|
|
|
|
|
|
2006-10-12 11:35:25 +00:00
|
|
|
|
SV_DECL_VARARR( CharPosArray, sal_Int32, 0, CHARPOSGROW )
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
2001-06-21 11:47:31 +00:00
|
|
|
|
// ------------------------------------------------------------------------
|
2000-09-18 16:07:07 +00:00
|
|
|
|
// class EditLine
|
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
|
class EditLine
|
|
|
|
|
{
|
|
|
|
|
private:
|
|
|
|
|
CharPosArray aPositions;
|
2002-07-12 09:31:21 +00:00
|
|
|
|
long nTxtWidth;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
USHORT nStartPosX;
|
|
|
|
|
USHORT nStart; // koennte durch nStartPortion ersetzt werden
|
|
|
|
|
USHORT nEnd; // koennte durch nEndPortion ersetzt werden
|
|
|
|
|
USHORT nStartPortion;
|
|
|
|
|
USHORT nEndPortion;
|
|
|
|
|
USHORT nHeight; // Gesamthoehe der Zeile
|
|
|
|
|
USHORT nTxtHeight; // Reine Texthoehe
|
|
|
|
|
USHORT nCrsrHeight; // Bei Konturfluss hohe Zeilen => Cursor zu gro<72>.
|
|
|
|
|
USHORT nMaxAscent;
|
2001-05-11 07:06:32 +00:00
|
|
|
|
BOOL bHangingPunctuation;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
BOOL bInvalid; // fuer geschickte Formatierung
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
EditLine();
|
|
|
|
|
EditLine( const EditLine& );
|
|
|
|
|
~EditLine();
|
|
|
|
|
|
|
|
|
|
BOOL IsIn( USHORT nIndex ) const
|
|
|
|
|
{ return ( (nIndex >= nStart ) && ( nIndex < nEnd ) ); }
|
|
|
|
|
|
|
|
|
|
BOOL IsIn( USHORT nIndex, BOOL bInclEnd ) const
|
|
|
|
|
{ return ( ( nIndex >= nStart ) && ( bInclEnd ? ( nIndex <= nEnd ) : ( nIndex < nEnd ) ) ); }
|
|
|
|
|
|
|
|
|
|
void SetStart( USHORT n ) { nStart = n; }
|
|
|
|
|
USHORT GetStart() const { return nStart; }
|
|
|
|
|
USHORT& GetStart() { return nStart; }
|
|
|
|
|
|
|
|
|
|
void SetEnd( USHORT n ) { nEnd = n; }
|
|
|
|
|
USHORT GetEnd() const { return nEnd; }
|
|
|
|
|
USHORT& GetEnd() { return nEnd; }
|
|
|
|
|
|
|
|
|
|
void SetStartPortion( USHORT n ) { nStartPortion = n; }
|
|
|
|
|
USHORT GetStartPortion() const { return nStartPortion; }
|
|
|
|
|
USHORT& GetStartPortion() { return nStartPortion; }
|
|
|
|
|
|
|
|
|
|
void SetEndPortion( USHORT n ) { nEndPortion = n; }
|
|
|
|
|
USHORT GetEndPortion() const { return nEndPortion; }
|
|
|
|
|
USHORT& GetEndPortion() { return nEndPortion; }
|
|
|
|
|
|
|
|
|
|
void SetHeight( USHORT nH, USHORT nTxtH = 0, USHORT nCrsrH = 0 )
|
|
|
|
|
{ nHeight = nH;
|
|
|
|
|
nTxtHeight = ( nTxtH ? nTxtH : nH );
|
|
|
|
|
nCrsrHeight = ( nCrsrH ? nCrsrH : nTxtHeight );
|
|
|
|
|
}
|
2002-07-12 09:31:21 +00:00
|
|
|
|
USHORT GetHeight() const { return nHeight; }
|
|
|
|
|
USHORT GetTxtHeight() const { return nTxtHeight; }
|
|
|
|
|
USHORT GetCrsrHeight() const { return nCrsrHeight; }
|
|
|
|
|
|
|
|
|
|
void SetTextWidth( long n ) { nTxtWidth = n; }
|
|
|
|
|
long GetTextWidth() const { return nTxtWidth; }
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
|
|
void SetMaxAscent( USHORT n ) { nMaxAscent = n; }
|
|
|
|
|
USHORT GetMaxAscent() const { return nMaxAscent; }
|
|
|
|
|
|
2001-05-11 07:06:32 +00:00
|
|
|
|
void SetHangingPunctuation( BOOL b ) { bHangingPunctuation = b; }
|
|
|
|
|
BOOL IsHangingPunctuation() const { return bHangingPunctuation; }
|
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
|
USHORT GetLen() const { return nEnd - nStart; }
|
|
|
|
|
|
|
|
|
|
USHORT GetStartPosX() const { return nStartPosX; }
|
2006-06-19 14:38:37 +00:00
|
|
|
|
void SetStartPosX( USHORT start ) { nStartPosX = start; }
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
|
|
Size CalcTextSize( ParaPortion& rParaPortion );
|
|
|
|
|
|
|
|
|
|
BOOL IsInvalid() const { return bInvalid; }
|
|
|
|
|
BOOL IsValid() const { return !bInvalid; }
|
|
|
|
|
void SetInvalid() { bInvalid = TRUE; }
|
|
|
|
|
void SetValid() { bInvalid = FALSE; }
|
|
|
|
|
|
|
|
|
|
BOOL IsEmpty() const { return (nEnd > nStart) ? FALSE : TRUE; }
|
|
|
|
|
|
|
|
|
|
CharPosArray& GetCharPosArray() { return aPositions; }
|
|
|
|
|
|
|
|
|
|
EditLine* Clone() const;
|
|
|
|
|
|
|
|
|
|
EditLine& operator = ( const EditLine& rLine );
|
|
|
|
|
friend BOOL operator == ( const EditLine& r1, const EditLine& r2 );
|
|
|
|
|
friend BOOL operator != ( const EditLine& r1, const EditLine& r2 );
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
2001-06-21 11:47:31 +00:00
|
|
|
|
// -------------------------------------------------------------------------
|
2000-09-18 16:07:07 +00:00
|
|
|
|
// class LineList
|
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
|
typedef EditLine* EditLinePtr;
|
2006-10-12 11:35:25 +00:00
|
|
|
|
SV_DECL_PTRARR( LineArray, EditLinePtr, 0, 4 )
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
|
|
class EditLineList : public LineArray
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
EditLineList();
|
|
|
|
|
~EditLineList();
|
|
|
|
|
|
|
|
|
|
void Reset();
|
|
|
|
|
void DeleteFromLine( USHORT nDelFrom );
|
|
|
|
|
USHORT FindLine( USHORT nChar, BOOL bInclEnd );
|
|
|
|
|
};
|
|
|
|
|
|
2001-06-21 11:47:31 +00:00
|
|
|
|
// -------------------------------------------------------------------------
|
2000-09-18 16:07:07 +00:00
|
|
|
|
// class ParaPortion
|
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
|
class ParaPortion
|
|
|
|
|
{
|
|
|
|
|
friend class ImpEditEngine; // zum Einstellen der Hoehe
|
|
|
|
|
private:
|
2000-11-02 14:25:36 +00:00
|
|
|
|
EditLineList aLineList;
|
|
|
|
|
TextPortionList aTextPortionList;
|
|
|
|
|
ContentNode* pNode;
|
|
|
|
|
long nHeight;
|
|
|
|
|
|
2002-07-12 09:31:21 +00:00
|
|
|
|
ScriptTypePosInfos aScriptInfos;
|
|
|
|
|
WritingDirectionInfos aWritingDirectionInfos;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
2000-11-02 14:25:36 +00:00
|
|
|
|
USHORT nInvalidPosStart;
|
|
|
|
|
USHORT nFirstLineOffset; // Fuer Writer-LineSpacing-Interpretation
|
|
|
|
|
USHORT nBulletX;
|
|
|
|
|
short nInvalidDiff;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
2000-11-02 14:25:36 +00:00
|
|
|
|
BOOL bInvalid : 1;
|
|
|
|
|
BOOL bSimple : 1; // nur lineares Tippen
|
|
|
|
|
BOOL bVisible : 1; // MT 05/00: Gehoert an den Node!!!
|
|
|
|
|
BOOL bForceRepaint : 1;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
2000-11-02 14:25:36 +00:00
|
|
|
|
ParaPortion( const ParaPortion& );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
ParaPortion( ContentNode* pNode );
|
|
|
|
|
~ParaPortion();
|
|
|
|
|
|
|
|
|
|
USHORT GetLineNumber( USHORT nIndex );
|
|
|
|
|
|
|
|
|
|
EditLineList& GetLines() { return aLineList; }
|
|
|
|
|
|
|
|
|
|
BOOL IsInvalid() const { return bInvalid; }
|
|
|
|
|
BOOL IsSimpleInvalid() const { return bSimple; }
|
|
|
|
|
void SetValid() { bInvalid = FALSE; bSimple = TRUE;}
|
|
|
|
|
|
|
|
|
|
BOOL MustRepaint() const { return bForceRepaint; }
|
|
|
|
|
void SetMustRepaint( BOOL bRP ) { bForceRepaint = bRP; }
|
|
|
|
|
|
|
|
|
|
USHORT GetBulletX() const { return nBulletX; }
|
|
|
|
|
void SetBulletX( USHORT n ) { nBulletX = n; }
|
|
|
|
|
|
|
|
|
|
void MarkInvalid( USHORT nStart, short nDiff);
|
|
|
|
|
void MarkSelectionInvalid( USHORT nStart, USHORT nEnd );
|
|
|
|
|
|
|
|
|
|
void SetVisible( BOOL bVisible );
|
|
|
|
|
BOOL IsVisible() { return bVisible; }
|
|
|
|
|
|
|
|
|
|
long GetHeight() const { return ( bVisible ? nHeight : 0 ); }
|
|
|
|
|
USHORT GetFirstLineOffset() const { return ( bVisible ? nFirstLineOffset : 0 ); }
|
|
|
|
|
void ResetHeight() { nHeight = 0; nFirstLineOffset = 0; }
|
|
|
|
|
|
|
|
|
|
ContentNode* GetNode() const { return pNode; }
|
|
|
|
|
TextPortionList& GetTextPortions() { return aTextPortionList; }
|
|
|
|
|
|
|
|
|
|
USHORT GetInvalidPosStart() const { return nInvalidPosStart; }
|
|
|
|
|
short GetInvalidDiff() const { return nInvalidDiff; }
|
|
|
|
|
|
|
|
|
|
void CorrectValuesBehindLastFormattedLine( USHORT nLastFormattedLine );
|
|
|
|
|
|
|
|
|
|
BOOL DbgCheckTextPortions();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
typedef ParaPortion* ParaPortionPtr;
|
2006-10-12 11:35:25 +00:00
|
|
|
|
SV_DECL_PTRARR( DummyParaPortionList, ParaPortionPtr, 0, 4 )
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
2001-06-21 11:47:31 +00:00
|
|
|
|
// -------------------------------------------------------------------------
|
2000-09-18 16:07:07 +00:00
|
|
|
|
// class ParaPortionList
|
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
|
class ParaPortionList : public DummyParaPortionList
|
|
|
|
|
{
|
2009-07-03 12:42:53 +00:00
|
|
|
|
USHORT nLastCache;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
public:
|
|
|
|
|
ParaPortionList();
|
|
|
|
|
~ParaPortionList();
|
|
|
|
|
|
|
|
|
|
void Reset();
|
|
|
|
|
long GetYOffset( ParaPortion* pPPortion );
|
|
|
|
|
USHORT FindParagraph( long nYOffset );
|
|
|
|
|
|
|
|
|
|
inline ParaPortion* SaveGetObject( USHORT nPos ) const
|
|
|
|
|
{ return ( nPos < Count() ) ? GetObject( nPos ) : 0; }
|
|
|
|
|
|
2009-07-03 12:42:53 +00:00
|
|
|
|
USHORT GetPos( const ParaPortionPtr &rPtr ) const;
|
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
|
// temporaer:
|
|
|
|
|
void DbgCheck( EditDoc& rDoc );
|
|
|
|
|
};
|
|
|
|
|
|
2001-06-21 11:47:31 +00:00
|
|
|
|
// -------------------------------------------------------------------------
|
2000-09-18 16:07:07 +00:00
|
|
|
|
// class EditSelection
|
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
|
class EditSelection
|
|
|
|
|
{
|
|
|
|
|
private:
|
|
|
|
|
EditPaM aStartPaM;
|
|
|
|
|
EditPaM aEndPaM;
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
EditSelection(); // kein CCTOR und DTOR, geht autom. richtig!
|
|
|
|
|
EditSelection( const EditPaM& rStartAndAnd );
|
|
|
|
|
EditSelection( const EditPaM& rStart, const EditPaM& rEnd );
|
|
|
|
|
|
|
|
|
|
EditPaM& Min() { return aStartPaM; }
|
|
|
|
|
EditPaM& Max() { return aEndPaM; }
|
|
|
|
|
|
|
|
|
|
const EditPaM& Min() const { return aStartPaM; }
|
|
|
|
|
const EditPaM& Max() const { return aEndPaM; }
|
|
|
|
|
|
|
|
|
|
BOOL HasRange() const { return aStartPaM != aEndPaM; }
|
2006-03-14 08:39:50 +00:00
|
|
|
|
BOOL IsInvalid() const;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
BOOL DbgIsBuggy( EditDoc& rDoc );
|
|
|
|
|
|
|
|
|
|
BOOL Adjust( const ContentList& rNodes );
|
|
|
|
|
|
|
|
|
|
EditSelection& operator = ( const EditPaM& r );
|
|
|
|
|
BOOL operator == ( const EditSelection& r ) const
|
|
|
|
|
{ return ( ( aStartPaM == r.aStartPaM ) && ( aEndPaM == r.aEndPaM ) )
|
|
|
|
|
? TRUE : FALSE; }
|
2001-12-07 12:26:06 +00:00
|
|
|
|
BOOL operator != ( const EditSelection& r ) const { return !( r == *this ); }
|
2000-09-18 16:07:07 +00:00
|
|
|
|
};
|
|
|
|
|
|
2001-06-21 11:47:31 +00:00
|
|
|
|
// -------------------------------------------------------------------------
|
2000-09-18 16:07:07 +00:00
|
|
|
|
// class DeletedNodeInfo
|
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
|
class DeletedNodeInfo
|
|
|
|
|
{
|
|
|
|
|
private:
|
|
|
|
|
ULONG nInvalidAdressPtr;
|
|
|
|
|
USHORT nInvalidParagraph;
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
DeletedNodeInfo( ULONG nInvAdr, USHORT nPos )
|
|
|
|
|
{ nInvalidAdressPtr = nInvAdr;
|
|
|
|
|
nInvalidParagraph = nPos; }
|
|
|
|
|
|
|
|
|
|
ULONG GetInvalidAdress() { return nInvalidAdressPtr; }
|
|
|
|
|
USHORT GetPosition() { return nInvalidParagraph; }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
typedef DeletedNodeInfo* DeletedNodeInfoPtr;
|
2006-10-12 11:35:25 +00:00
|
|
|
|
SV_DECL_PTRARR( DeletedNodesList, DeletedNodeInfoPtr, 0, 4 )
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
2001-06-21 11:47:31 +00:00
|
|
|
|
// -------------------------------------------------------------------------
|
2000-09-18 16:07:07 +00:00
|
|
|
|
// class EditDoc
|
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
|
class EditDoc : public ContentList
|
|
|
|
|
{
|
|
|
|
|
private:
|
|
|
|
|
SfxItemPool* pItemPool;
|
2002-10-10 11:17:38 +00:00
|
|
|
|
Link aModifyHdl;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
|
|
SvxFont aDefFont; //schneller, als jedesmal vom Pool!
|
|
|
|
|
USHORT nDefTab;
|
2000-11-20 10:53:50 +00:00
|
|
|
|
BOOL bIsVertical;
|
2003-09-01 11:00:48 +00:00
|
|
|
|
BOOL bIsFixedCellHeight;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
|
|
BOOL bOwnerOfPool;
|
|
|
|
|
BOOL bModified;
|
|
|
|
|
|
2001-01-30 15:52:42 +00:00
|
|
|
|
protected:
|
|
|
|
|
void ImplDestroyContents();
|
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
|
public:
|
|
|
|
|
EditDoc( SfxItemPool* pItemPool );
|
|
|
|
|
~EditDoc();
|
|
|
|
|
|
|
|
|
|
BOOL IsModified() const { return bModified; }
|
2002-10-10 11:17:38 +00:00
|
|
|
|
void SetModified( BOOL b );
|
|
|
|
|
|
|
|
|
|
void SetModifyHdl( const Link& rLink ) { aModifyHdl = rLink; }
|
|
|
|
|
Link GetModifyHdl() const { return aModifyHdl; }
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
|
|
void CreateDefFont( BOOL bUseStyles );
|
|
|
|
|
const SvxFont& GetDefFont() { return aDefFont; }
|
|
|
|
|
|
|
|
|
|
void SetDefTab( USHORT nTab ) { nDefTab = nTab ? nTab : DEFTAB; }
|
|
|
|
|
USHORT GetDefTab() const { return nDefTab; }
|
|
|
|
|
|
2000-11-20 10:53:50 +00:00
|
|
|
|
void SetVertical( BOOL bVertical ) { bIsVertical = bVertical; }
|
|
|
|
|
BOOL IsVertical() const { return bIsVertical; }
|
|
|
|
|
|
2003-09-01 11:00:48 +00:00
|
|
|
|
void SetFixedCellHeight( BOOL bUseFixedCellHeight ) { bIsFixedCellHeight = bUseFixedCellHeight; }
|
|
|
|
|
BOOL IsFixedCellHeight() const { return bIsFixedCellHeight; }
|
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
|
EditPaM Clear();
|
|
|
|
|
EditPaM RemoveText();
|
|
|
|
|
EditPaM RemoveChars( EditPaM aPaM, USHORT nChars );
|
|
|
|
|
void InsertText( const EditPaM& rPaM, xub_Unicode c );
|
|
|
|
|
EditPaM InsertText( EditPaM aPaM, const XubString& rStr );
|
|
|
|
|
EditPaM InsertParaBreak( EditPaM aPaM, BOOL bKeepEndingAttribs );
|
|
|
|
|
EditPaM InsertFeature( EditPaM aPaM, const SfxPoolItem& rItem );
|
|
|
|
|
EditPaM ConnectParagraphs( ContentNode* pLeft, ContentNode* pRight );
|
|
|
|
|
|
|
|
|
|
String GetText( LineEnd eEnd ) const;
|
|
|
|
|
ULONG GetTextLen() const;
|
|
|
|
|
|
|
|
|
|
XubString GetParaAsString( USHORT nNode ) const;
|
2001-03-09 12:13:53 +00:00
|
|
|
|
XubString GetParaAsString( ContentNode* pNode, USHORT nStartPos = 0, USHORT nEndPos = 0xFFFF, BOOL bResolveFields = TRUE ) const;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
|
|
inline EditPaM GetStartPaM() const;
|
|
|
|
|
inline EditPaM GetEndPaM() const;
|
|
|
|
|
|
|
|
|
|
SfxItemPool& GetItemPool() { return *pItemPool; }
|
|
|
|
|
const SfxItemPool& GetItemPool() const { return *pItemPool; }
|
|
|
|
|
|
|
|
|
|
void RemoveItemsFromPool( ContentNode* pNode );
|
|
|
|
|
|
|
|
|
|
void InsertAttrib( const SfxPoolItem& rItem, ContentNode* pNode, USHORT nStart, USHORT nEnd );
|
|
|
|
|
void InsertAttrib( ContentNode* pNode, USHORT nStart, USHORT nEnd, const SfxPoolItem& rPoolItem );
|
|
|
|
|
void InsertAttribInSelection( ContentNode* pNode, USHORT nStart, USHORT nEnd, const SfxPoolItem& rPoolItem );
|
|
|
|
|
BOOL RemoveAttribs( ContentNode* pNode, USHORT nStart, USHORT nEnd, USHORT nWhich = 0 );
|
|
|
|
|
BOOL RemoveAttribs( ContentNode* pNode, USHORT nStart, USHORT nEnd, EditCharAttrib*& rpStarting, EditCharAttrib*& rpEnding, USHORT nWhich = 0 );
|
|
|
|
|
void FindAttribs( ContentNode* pNode, USHORT nStartPos, USHORT nEndPos, SfxItemSet& rCurSet );
|
|
|
|
|
|
|
|
|
|
USHORT GetPos( ContentNode* pNode ) const { return ContentList::GetPos(pNode); }
|
|
|
|
|
ContentNode* SaveGetObject( USHORT nPos ) const { return ( nPos < Count() ) ? GetObject( nPos ) : 0; }
|
|
|
|
|
|
|
|
|
|
static XubString GetSepStr( LineEnd eEnd );
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
inline EditPaM EditDoc::GetStartPaM() const
|
|
|
|
|
{
|
|
|
|
|
return EditPaM( GetObject( 0 ), 0 );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
inline EditPaM EditDoc::GetEndPaM() const
|
|
|
|
|
{
|
|
|
|
|
ContentNode* pLastNode = GetObject( Count()-1 );
|
|
|
|
|
return EditPaM( pLastNode, pLastNode->Len() );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
inline EditCharAttrib* GetAttrib( const CharAttribArray& rAttribs, USHORT nAttr )
|
|
|
|
|
{
|
|
|
|
|
return ( nAttr < rAttribs.Count() ) ? rAttribs[nAttr] : 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BOOL CheckOrderedList( CharAttribArray& rAttribs, BOOL bStart );
|
|
|
|
|
|
2001-06-21 11:47:31 +00:00
|
|
|
|
// -------------------------------------------------------------------------
|
2000-09-18 16:07:07 +00:00
|
|
|
|
// class EditEngineItemPool
|
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
|
class EditEngineItemPool : public SfxItemPool
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
EditEngineItemPool( BOOL bPersistenRefCounts );
|
CWS-TOOLING: integrate CWS aw063
2009-02-12 13:10:24 +0100 aw r267649 : #i99123# when a primitive is invisible, it is not sufficient to produce no output when decomposing, but to add invisible data using HitTestPrimitive2D. This is needed for the slideshow which relies on geometry data in MetaFiles when painting invisible objects
2009-02-12 13:08:39 +0100 aw r267648 : #i99123# do not ignore HitTestPrimitive2D, but draw empty rectangles instead. This is needed since Slideshow is based on getting MetaFile content when painting invisible objects
2009-02-11 16:04:28 +0100 aw r267620 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:04:10 +0100 aw r267619 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:03:56 +0100 aw r267618 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:03:39 +0100 aw r267617 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:03:21 +0100 aw r267615 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:02:48 +0100 aw r267614 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:02:24 +0100 aw r267613 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:02:01 +0100 aw r267612 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:01:32 +0100 aw r267611 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:01:05 +0100 aw r267610 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:00:15 +0100 aw r267608 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 11:27:33 +0100 aw r267585 : #i98788# added missing include for STL
2009-02-10 17:46:50 +0100 aw r267570 : #i98788# added reaction on pool destruction
2009-02-10 17:11:58 +0100 aw r267562 : #i98788# added messaging mechanism to register for pool destruction
2009-02-10 13:35:35 +0100 aw r267549 : #i98788# removing changes, too complicated and risky for 3.1
2009-02-10 12:13:48 +0100 aw r267546 : #i98788# 4th round
2009-02-10 12:13:37 +0100 aw r267545 : #i98788# 4th round
2009-02-10 12:13:26 +0100 aw r267544 : #i98788# 4th round
2009-02-10 12:13:14 +0100 aw r267543 : #i98788# 4th round
2009-02-10 12:13:03 +0100 aw r267542 : #i98788# 4th round
2009-02-10 12:12:50 +0100 aw r267541 : #i98788# 4th round
2009-02-10 12:12:37 +0100 aw r267540 : #i98788# 4th round
2009-02-08 14:38:22 +0100 aw r267495 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:38:06 +0100 aw r267494 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:37:48 +0100 aw r267493 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:37:17 +0100 aw r267492 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:36:56 +0100 aw r267491 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:36:44 +0100 aw r267490 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:36:29 +0100 aw r267489 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:36:16 +0100 aw r267488 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:36:02 +0100 aw r267487 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:35:46 +0100 aw r267486 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-05 12:20:39 +0100 aw r267415 : #i98788# 2nd batch of adaptions for SfxItemPoolHolder addition
2009-02-04 15:12:54 +0100 aw r267385 : #i98788# added newline at EOF
2009-02-04 13:26:04 +0100 aw r267379 : #i98788# make SfxItemPool holdable
2009-02-04 13:25:40 +0100 aw r267378 : #i98788# make SfxItemPool holdable
2009-02-04 13:25:08 +0100 aw r267377 : #i98788# make SfxItemPool holdable
2009-02-04 13:24:42 +0100 aw r267376 : #i98788# make SfxItemPool holdable
2009-02-04 13:23:14 +0100 aw r267375 : #i98788# make SfxItemPool holdable
2009-02-04 13:23:02 +0100 aw r267374 : #i98788# make SfxItemPool holdable
2009-01-29 17:08:31 +0100 aw r267159 : #i97628# completed the fix
2009-01-29 17:08:15 +0100 aw r267158 : #i97628# completed the fix
2009-01-29 14:09:07 +0100 aw r267132 : #i97628# Corrected usage of ParagraphData in headers
2009-01-29 14:06:58 +0100 iha r267131 : #i98344# incorrect font size in charts
2009-01-29 12:13:46 +0100 aw r267115 : #i97628# back to old state; triggers too many errors in other modules
2009-01-29 12:03:51 +0100 aw r267114 : #i97628# enabled exceptions due to STL vector include
2009-01-29 11:21:37 +0100 aw r267107 : #i97628# added needed include
2009-01-28 17:58:29 +0100 aw r267077 : #i97628# first version of newly implemented OutlinerParaObject and adaptions
2009-01-28 17:58:12 +0100 aw r267076 : #i97628# first version of newly implemented OutlinerParaObject and adaptions
2009-01-28 17:57:51 +0100 aw r267074 : #i97628# first version of newly implemented OutlinerParaObject and adaptions
2009-01-28 17:57:21 +0100 aw r267073 : #i97628# first version of newly implemented OutlinerParaObject and adaptions
2009-01-27 17:07:33 +0100 aw r267011 : #i98402# added support for ViewRange when exporting MetaFiles in ObjectContactOfPageView::DoProcessDisplay to avoid to paint too much
2009-01-27 11:45:48 +0100 aw r266973 : #i98404# Added a warning to a place where a conversion to rectangle should not be copied from
2009-01-26 21:44:36 +0100 iha r266949 : #i98497# 3D charts are rendered with wrong size
2009-01-26 20:47:07 +0100 aw r266947 : #i98404# handle BackgroundColorPrimitive2D directly in PixelRenderers and avoid AA under all circumstances
2009-01-26 14:50:36 +0100 aw r266926 : #i98386# secured cloning of SdrObject in IMapUserData by boost::shared_prt usage
2009-01-26 12:51:30 +0100 aw r266916 : #i96581# added separated FontStretching and fallback for small X!=Y scale differences
2009-01-23 16:14:55 +0100 aw r266834 : #i96475# added missing implementation of TextDecoratedPortionPrimitive2D::getB2DRange
2009-01-23 15:24:34 +0100 aw r266826 : #i98405# fixed fallback to DrawAlphaRect to use the correctly sized rectangle
2009-01-23 13:34:43 +0100 aw r266813 : #i96474# fixed impSplitSingleWords for an unexpected case
2009-01-23 10:47:31 +0100 aw r266786 : #i98289#,#i96474# tooling and new flags for tasks
2009-01-23 10:47:20 +0100 aw r266785 : #i98289#,#i96474# tooling and new flags for tasks
2009-01-23 10:47:09 +0100 aw r266783 : #i98289#,#i96474# tooling and new flags for tasks
2009-01-23 10:46:58 +0100 aw r266782 : #i98289#,#i96474# tooling and new flags for tasks
2009-01-23 10:46:48 +0100 aw r266781 : #i98289#,#i96474# tooling and new flags for tasks
2009-03-04 14:16:02 +00:00
|
|
|
|
protected:
|
|
|
|
|
virtual ~EditEngineItemPool();
|
|
|
|
|
public:
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
|
|
virtual SvStream& Store( SvStream& rStream ) const;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // _EDITDOC_HXX
|