1 diff -u -r /opt/OpenOffice/svn-HEAD/build/ooo310-m4/svx/source/editeng/editdoc2.cxx svx/source/editeng/editdoc2.cxx
2 --- svx/source/editeng/editdoc2.cxx
3 +++ svx/source/editeng/editdoc2.cxx
5 DBG_ASSERT( aLineList[ aLineList.Count()-1 ]->GetEnd() == pNode->Len(), "CorrectLines: Ende stimmt nicht!" );
8 +// Shared reverse lookup acceleration pieces ...
10 +static USHORT FastGetPos( const VoidPtr *pPtrArray, USHORT nPtrArrayLen,
11 + VoidPtr pPtr, USHORT &rLastPos )
13 + // Through certain filter code-paths we do a lot of appends, which in
14 + // turn call GetPos - creating some N^2 nightmares. If we have a
15 + // non-trivially large list, do a few checks from the end first.
19 + if (rLastPos > nPtrArrayLen - 2)
20 + nEnd = nPtrArrayLen;
22 + nEnd = rLastPos + 2;
24 + for( USHORT nIdx = rLastPos - 2; nIdx < nEnd; nIdx++ )
26 + if( pPtrArray[ nIdx ] == pPtr )
33 + // The world's lamest linear search from svarray ...
34 + for( USHORT nIdx = 0; nIdx < nPtrArrayLen; nIdx++ )
35 + if (pPtrArray[ nIdx ] == pPtr )
36 + return rLastPos = nIdx;
40 \f// -------------------------------------------------------------------------
41 // class ParaPortionList
42 // -------------------------------------------------------------------------
43 -ParaPortionList::ParaPortionList()
44 +ParaPortionList::ParaPortionList() : nLastCache( 0 )
52 +USHORT ParaPortionList::GetPos( const ParaPortionPtr &rPtr ) const
54 + return FastGetPos( reinterpret_cast<const VoidPtr *>( GetData() ),
55 + Count(), static_cast<VoidPtr>( rPtr ),
56 + ((ParaPortionList *)this)->nLastCache );
59 +USHORT ContentList::GetPos( const ContentNodePtr &rPtr ) const
61 + return FastGetPos( reinterpret_cast<const VoidPtr *>( GetData() ),
62 + Count(), static_cast<VoidPtr>( rPtr ),
63 + ((ContentList *)this)->nLastCache );
66 void ParaPortionList::Reset()
68 for ( USHORT nPortion = 0; nPortion < Count(); nPortion++ )
69 diff -u -r /opt/OpenOffice/svn-HEAD/build/ooo310-m4/svx/source/editeng/editdoc.cxx svx/source/editeng/editdoc.cxx
70 --- /opt/OpenOffice/svn-HEAD/build/ooo310-m4/svx/source/editeng/editdoc.cxx 2009-02-26 08:39:48.000000000 +0000
71 +++ svx/source/editeng/editdoc.cxx 2009-04-06 14:04:09.000000000 +0100
73 4035, 4036, 4037, 4038
76 -SV_IMPL_PTRARR( ContentList, ContentNode* );
77 +SV_IMPL_PTRARR( DummyContentList, ContentNode* );
78 SV_IMPL_VARARR( ScriptTypePosInfos, ScriptTypePosInfo );
79 SV_IMPL_VARARR( WritingDirectionInfos, WritingDirectionInfo );
80 // SV_IMPL_VARARR( ExtraCharInfos, ExtraCharInfo );
81 diff -u -r /opt/OpenOffice/svn-HEAD/build/ooo310-m4/svx/source/editeng/editdoc.hxx svx/source/editeng/editdoc.hxx
82 --- /opt/OpenOffice/svn-HEAD/build/ooo310-m4/svx/source/editeng/editdoc.hxx 2009-02-26 08:39:48.000000000 +0000
83 +++ svx/source/editeng/editdoc.hxx 2009-04-06 14:03:23.000000000 +0100
87 typedef ContentNode* ContentNodePtr;
88 -SV_DECL_PTRARR( ContentList, ContentNodePtr, 0, 4 )
89 +SV_DECL_PTRARR( DummyContentList, ContentNodePtr, 0, 4 )
91 +class ContentList : public DummyContentList
95 + ContentList() : DummyContentList( 0, 4 ), nLastCache(0) {}
96 + USHORT GetPos( const ContentNodePtr &rPtr ) const;
99 // -------------------------------------------------------------------------
102 // -------------------------------------------------------------------------
103 class ParaPortionList : public DummyParaPortionList
110 inline ParaPortion* SaveGetObject( USHORT nPos ) const
111 { return ( nPos < Count() ) ? GetObject( nPos ) : 0; }
113 + USHORT GetPos( const ParaPortionPtr &rPtr ) const;
116 void DbgCheck( EditDoc& rDoc );