xref: /AOO41X/main/sw/source/core/text/porlin.cxx (revision efeef26f81c84063fb0a91bde3856d4a51172d90)
1*efeef26fSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*efeef26fSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*efeef26fSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*efeef26fSAndrew Rist  * distributed with this work for additional information
6*efeef26fSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*efeef26fSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*efeef26fSAndrew Rist  * "License"); you may not use this file except in compliance
9*efeef26fSAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*efeef26fSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*efeef26fSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*efeef26fSAndrew Rist  * software distributed under the License is distributed on an
15*efeef26fSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*efeef26fSAndrew Rist  * KIND, either express or implied.  See the License for the
17*efeef26fSAndrew Rist  * specific language governing permissions and limitations
18*efeef26fSAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20*efeef26fSAndrew Rist  *************************************************************/
21*efeef26fSAndrew Rist 
22*efeef26fSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_sw.hxx"
26cdf0e10cSrcweir 
27cdf0e10cSrcweir 
28cdf0e10cSrcweir #ifndef _OUTDEV_HXX //autogen
29cdf0e10cSrcweir #include <vcl/outdev.hxx>
30cdf0e10cSrcweir #endif
31cdf0e10cSrcweir #include <SwPortionHandler.hxx>
32cdf0e10cSrcweir 
33cdf0e10cSrcweir #include "errhdl.hxx"   // ASSERT
34cdf0e10cSrcweir 
35cdf0e10cSrcweir #include "txtcfg.hxx"
36cdf0e10cSrcweir #include "porlin.hxx"
37cdf0e10cSrcweir #include "inftxt.hxx"
38cdf0e10cSrcweir #include "portxt.hxx"
39cdf0e10cSrcweir #include "pormulti.hxx"
40cdf0e10cSrcweir #include "porglue.hxx"
41cdf0e10cSrcweir #include "inftxt.hxx"
42cdf0e10cSrcweir #include "blink.hxx"
43cdf0e10cSrcweir #ifdef DBG_UTIL
44cdf0e10cSrcweir 
ChkChain(SwLinePortion * pStart)45cdf0e10cSrcweir sal_Bool ChkChain( SwLinePortion *pStart )
46cdf0e10cSrcweir {
47cdf0e10cSrcweir 	SwLinePortion *pPor = pStart->GetPortion();
48cdf0e10cSrcweir 	MSHORT nCount = 0;
49cdf0e10cSrcweir 	while( pPor )
50cdf0e10cSrcweir 	{
51cdf0e10cSrcweir 		++nCount;
52cdf0e10cSrcweir 		ASSERT( nCount < 200 && pPor != pStart,
53cdf0e10cSrcweir 				"ChkChain(): lost in chains" );
54cdf0e10cSrcweir 		if( nCount >= 200 || pPor == pStart )
55cdf0e10cSrcweir 		{
56cdf0e10cSrcweir 			// der Lebensretter
57cdf0e10cSrcweir 			pPor = pStart->GetPortion();
58cdf0e10cSrcweir 			pStart->SetPortion(0);
59cdf0e10cSrcweir 			pPor->Truncate();
60cdf0e10cSrcweir 			pStart->SetPortion( pPor );
61cdf0e10cSrcweir 			return sal_False;
62cdf0e10cSrcweir 		}
63cdf0e10cSrcweir 		pPor = pPor->GetPortion();
64cdf0e10cSrcweir 	}
65cdf0e10cSrcweir 	return sal_True;
66cdf0e10cSrcweir }
67cdf0e10cSrcweir #endif
68cdf0e10cSrcweir 
69cdf0e10cSrcweir #if OSL_DEBUG_LEVEL > 1
70cdf0e10cSrcweir const sal_Char *GetPortionName( const MSHORT nType );
71cdf0e10cSrcweir #endif
72cdf0e10cSrcweir 
~SwLinePortion()73cdf0e10cSrcweir SwLinePortion::~SwLinePortion()
74cdf0e10cSrcweir {
75cdf0e10cSrcweir 	if( pBlink )
76cdf0e10cSrcweir 		pBlink->Delete( this );
77cdf0e10cSrcweir }
78cdf0e10cSrcweir 
Compress()79cdf0e10cSrcweir SwLinePortion *SwLinePortion::Compress()
80cdf0e10cSrcweir {
81cdf0e10cSrcweir 	return GetLen() || Width() ? this : 0;
82cdf0e10cSrcweir }
83cdf0e10cSrcweir 
GetViewWidth(const SwTxtSizeInfo &) const84cdf0e10cSrcweir KSHORT SwLinePortion::GetViewWidth( const SwTxtSizeInfo & ) const
85cdf0e10cSrcweir {
86cdf0e10cSrcweir 	return 0;
87cdf0e10cSrcweir }
88cdf0e10cSrcweir 
89cdf0e10cSrcweir /*************************************************************************
90cdf0e10cSrcweir  *				 SwLinePortion::SwLinePortion( )
91cdf0e10cSrcweir  *************************************************************************/
92cdf0e10cSrcweir 
SwLinePortion()93cdf0e10cSrcweir SwLinePortion::SwLinePortion( ) :
94cdf0e10cSrcweir     pPortion( NULL ),
95cdf0e10cSrcweir     nLineLength( 0 ),
96cdf0e10cSrcweir     nAscent( 0 )
97cdf0e10cSrcweir {
98cdf0e10cSrcweir }
99cdf0e10cSrcweir 
100cdf0e10cSrcweir /*************************************************************************
101cdf0e10cSrcweir  *               SwLinePortion::PrePaint()
102cdf0e10cSrcweir  *************************************************************************/
103cdf0e10cSrcweir 
PrePaint(const SwTxtPaintInfo & rInf,const SwLinePortion * pLast) const104cdf0e10cSrcweir void SwLinePortion::PrePaint( const SwTxtPaintInfo& rInf,
105cdf0e10cSrcweir                               const SwLinePortion* pLast ) const
106cdf0e10cSrcweir {
107cdf0e10cSrcweir     ASSERT( rInf.OnWin(), "SwLinePortion::PrePaint: don't prepaint on a printer");
108cdf0e10cSrcweir 	ASSERT( !Width(), "SwLinePortion::PrePaint: For Width()==0 only!");
109cdf0e10cSrcweir 
110cdf0e10cSrcweir     const KSHORT nViewWidth = GetViewWidth( rInf );
111cdf0e10cSrcweir 
112cdf0e10cSrcweir     if( ! nViewWidth )
113cdf0e10cSrcweir         return;
114cdf0e10cSrcweir 
115cdf0e10cSrcweir     const KSHORT nHalfView = nViewWidth / 2;
116cdf0e10cSrcweir     sal_uInt16 nLastWidth = pLast->Width();
117cdf0e10cSrcweir 
118cdf0e10cSrcweir     if ( pLast->InSpaceGrp() && rInf.GetSpaceAdd() )
119cdf0e10cSrcweir         nLastWidth = nLastWidth + (sal_uInt16)pLast->CalcSpacing( rInf.GetSpaceAdd(), rInf );
120cdf0e10cSrcweir 
121cdf0e10cSrcweir     KSHORT nPos;
122cdf0e10cSrcweir     SwTxtPaintInfo aInf( rInf );
123cdf0e10cSrcweir 
124cdf0e10cSrcweir     const sal_Bool bBidiPor = ( rInf.GetTxtFrm()->IsRightToLeft() ) !=
125cdf0e10cSrcweir                           ( 0 != ( TEXT_LAYOUT_BIDI_RTL & rInf.GetOut()->GetLayoutMode() ) );
126cdf0e10cSrcweir 
127cdf0e10cSrcweir     sal_uInt16 nDir = bBidiPor ?
128cdf0e10cSrcweir                   1800 :
129cdf0e10cSrcweir                   rInf.GetFont()->GetOrientation( rInf.GetTxtFrm()->IsVertical() );
130cdf0e10cSrcweir 
131cdf0e10cSrcweir     switch ( nDir )
132cdf0e10cSrcweir     {
133cdf0e10cSrcweir     case 0 :
134cdf0e10cSrcweir         nPos = KSHORT( rInf.X() );
135cdf0e10cSrcweir         if( nLastWidth > nHalfView )
136cdf0e10cSrcweir             nPos += nLastWidth - nHalfView;
137cdf0e10cSrcweir         aInf.X( nPos );
138cdf0e10cSrcweir         break;
139cdf0e10cSrcweir     case 900 :
140cdf0e10cSrcweir         nPos = KSHORT( rInf.Y() );
141cdf0e10cSrcweir         if( nLastWidth > nHalfView )
142cdf0e10cSrcweir             nPos -= nLastWidth + nHalfView;
143cdf0e10cSrcweir         aInf.Y( nPos );
144cdf0e10cSrcweir         break;
145cdf0e10cSrcweir     case 1800 :
146cdf0e10cSrcweir         nPos = KSHORT( rInf.X() );
147cdf0e10cSrcweir         if( nLastWidth > nHalfView )
148cdf0e10cSrcweir             nPos -= nLastWidth + nHalfView;
149cdf0e10cSrcweir         aInf.X( nPos );
150cdf0e10cSrcweir         break;
151cdf0e10cSrcweir     case 2700 :
152cdf0e10cSrcweir         nPos = KSHORT( rInf.Y() );
153cdf0e10cSrcweir         if( nLastWidth > nHalfView )
154cdf0e10cSrcweir             nPos += nLastWidth - nHalfView;
155cdf0e10cSrcweir         aInf.Y( nPos );
156cdf0e10cSrcweir         break;
157cdf0e10cSrcweir     }
158cdf0e10cSrcweir 
159cdf0e10cSrcweir 	SwLinePortion *pThis = (SwLinePortion*)this;
160cdf0e10cSrcweir 	pThis->Width( nViewWidth );
161cdf0e10cSrcweir 	Paint( aInf );
162cdf0e10cSrcweir 	pThis->Width(0);
163cdf0e10cSrcweir }
164cdf0e10cSrcweir 
165cdf0e10cSrcweir /*************************************************************************
166cdf0e10cSrcweir  *					SwLinePortion::CalcTxtSize()
167cdf0e10cSrcweir  *************************************************************************/
168cdf0e10cSrcweir 
CalcTxtSize(const SwTxtSizeInfo & rInf)169cdf0e10cSrcweir void SwLinePortion::CalcTxtSize( const SwTxtSizeInfo &rInf )
170cdf0e10cSrcweir {
171cdf0e10cSrcweir 	if( GetLen() == rInf.GetLen()  )
172cdf0e10cSrcweir 		*((SwPosSize*)this) = GetTxtSize( rInf );
173cdf0e10cSrcweir 	else
174cdf0e10cSrcweir 	{
175cdf0e10cSrcweir 		SwTxtSizeInfo aInf( rInf );
176cdf0e10cSrcweir 		aInf.SetLen( GetLen() );
177cdf0e10cSrcweir 		*((SwPosSize*)this) = GetTxtSize( aInf );
178cdf0e10cSrcweir 	}
179cdf0e10cSrcweir }
180cdf0e10cSrcweir 
181cdf0e10cSrcweir /*************************************************************************
182cdf0e10cSrcweir  *					SwLinePortion::Truncate()
183cdf0e10cSrcweir  *
184cdf0e10cSrcweir  * Es werden alle nachfolgenden Portions geloescht.
185cdf0e10cSrcweir  *************************************************************************/
186cdf0e10cSrcweir 
_Truncate()187cdf0e10cSrcweir void SwLinePortion::_Truncate()
188cdf0e10cSrcweir {
189cdf0e10cSrcweir 	SwLinePortion *pPos = pPortion;
190cdf0e10cSrcweir 	do
191cdf0e10cSrcweir 	{	ASSERT( pPos != this, "SwLinePortion::Truncate: loop" );
192cdf0e10cSrcweir 		SwLinePortion *pLast = pPos;
193cdf0e10cSrcweir 		pPos = pPos->GetPortion();
194cdf0e10cSrcweir 		pLast->SetPortion( 0 );
195cdf0e10cSrcweir 		delete pLast;
196cdf0e10cSrcweir 
197cdf0e10cSrcweir 	} while( pPos );
198cdf0e10cSrcweir 
199cdf0e10cSrcweir 	pPortion = 0;
200cdf0e10cSrcweir }
201cdf0e10cSrcweir 
202cdf0e10cSrcweir /*************************************************************************
203cdf0e10cSrcweir  *				  virtual SwLinePortion::Insert()
204cdf0e10cSrcweir  *
205cdf0e10cSrcweir  * Es wird immer hinter uns eingefuegt.
206cdf0e10cSrcweir  *************************************************************************/
207cdf0e10cSrcweir 
Insert(SwLinePortion * pIns)208cdf0e10cSrcweir SwLinePortion *SwLinePortion::Insert( SwLinePortion *pIns )
209cdf0e10cSrcweir {
210cdf0e10cSrcweir 	pIns->FindLastPortion()->SetPortion( pPortion );
211cdf0e10cSrcweir 	SetPortion( pIns );
212cdf0e10cSrcweir #ifdef DBG_UTIL
213cdf0e10cSrcweir 	ChkChain( this );
214cdf0e10cSrcweir #endif
215cdf0e10cSrcweir 	return pIns;
216cdf0e10cSrcweir }
217cdf0e10cSrcweir 
218cdf0e10cSrcweir /*************************************************************************
219cdf0e10cSrcweir  *					SwLinePortion::FindLastPortion()
220cdf0e10cSrcweir  *************************************************************************/
221cdf0e10cSrcweir 
FindLastPortion()222cdf0e10cSrcweir SwLinePortion *SwLinePortion::FindLastPortion()
223cdf0e10cSrcweir {
224cdf0e10cSrcweir 	SwLinePortion *pPos = this;
225cdf0e10cSrcweir 	// An das Ende wandern und pLinPortion an den letzten haengen ...
226cdf0e10cSrcweir 	while( pPos->GetPortion() )
227cdf0e10cSrcweir 	{
228cdf0e10cSrcweir 		DBG_LOOP;
229cdf0e10cSrcweir 		pPos = pPos->GetPortion();
230cdf0e10cSrcweir 	}
231cdf0e10cSrcweir 	return pPos;
232cdf0e10cSrcweir }
233cdf0e10cSrcweir 
234cdf0e10cSrcweir /*************************************************************************
235cdf0e10cSrcweir  *				  virtual SwLinePortion::Append()
236cdf0e10cSrcweir  *************************************************************************/
237cdf0e10cSrcweir 
Append(SwLinePortion * pIns)238cdf0e10cSrcweir SwLinePortion *SwLinePortion::Append( SwLinePortion *pIns )
239cdf0e10cSrcweir {
240cdf0e10cSrcweir 	SwLinePortion *pPos = FindLastPortion();
241cdf0e10cSrcweir 	pPos->SetPortion( pIns );
242cdf0e10cSrcweir 	pIns->SetPortion( 0 );
243cdf0e10cSrcweir #ifdef DBG_UTIL
244cdf0e10cSrcweir 	ChkChain( this );
245cdf0e10cSrcweir #endif
246cdf0e10cSrcweir 	return pIns;
247cdf0e10cSrcweir }
248cdf0e10cSrcweir 
249cdf0e10cSrcweir /*************************************************************************
250cdf0e10cSrcweir  *				  virtual SwLinePortion::Cut()
251cdf0e10cSrcweir  *************************************************************************/
252cdf0e10cSrcweir 
Cut(SwLinePortion * pVictim)253cdf0e10cSrcweir SwLinePortion *SwLinePortion::Cut( SwLinePortion *pVictim )
254cdf0e10cSrcweir {
255cdf0e10cSrcweir 	SwLinePortion *pPrev = pVictim->FindPrevPortion( this );
256cdf0e10cSrcweir 	ASSERT( pPrev, "SwLinePortion::Cut(): can't cut" );
257cdf0e10cSrcweir 	pPrev->SetPortion( pVictim->GetPortion() );
258cdf0e10cSrcweir 	pVictim->SetPortion(0);
259cdf0e10cSrcweir 	return pVictim;
260cdf0e10cSrcweir }
261cdf0e10cSrcweir 
262cdf0e10cSrcweir /*************************************************************************
263cdf0e10cSrcweir  *				  SwLinePortion::FindPrevPortion()
264cdf0e10cSrcweir  *************************************************************************/
265cdf0e10cSrcweir 
FindPrevPortion(const SwLinePortion * pRoot)266cdf0e10cSrcweir SwLinePortion *SwLinePortion::FindPrevPortion( const SwLinePortion *pRoot )
267cdf0e10cSrcweir {
268cdf0e10cSrcweir 	ASSERT( pRoot != this, "SwLinePortion::FindPrevPortion(): invalid root" );
269cdf0e10cSrcweir 	SwLinePortion *pPos = (SwLinePortion*)pRoot;
270cdf0e10cSrcweir 	while( pPos->GetPortion() && pPos->GetPortion() != this )
271cdf0e10cSrcweir 	{
272cdf0e10cSrcweir 		DBG_LOOP;
273cdf0e10cSrcweir 		pPos = pPos->GetPortion();
274cdf0e10cSrcweir 	}
275cdf0e10cSrcweir 	ASSERT( pPos->GetPortion(),
276cdf0e10cSrcweir 			"SwLinePortion::FindPrevPortion: blowing in the wind");
277cdf0e10cSrcweir 	return pPos;
278cdf0e10cSrcweir }
279cdf0e10cSrcweir 
280cdf0e10cSrcweir /*************************************************************************
281cdf0e10cSrcweir  *				  virtual SwLinePortion::GetCrsrOfst()
282cdf0e10cSrcweir  *************************************************************************/
283cdf0e10cSrcweir 
GetCrsrOfst(const KSHORT nOfst) const284cdf0e10cSrcweir xub_StrLen SwLinePortion::GetCrsrOfst( const KSHORT nOfst ) const
285cdf0e10cSrcweir {
286cdf0e10cSrcweir 	if( nOfst > ( PrtWidth() / 2 ) )
287cdf0e10cSrcweir 		return GetLen();
288cdf0e10cSrcweir 	else
289cdf0e10cSrcweir 		return 0;
290cdf0e10cSrcweir }
291cdf0e10cSrcweir 
292cdf0e10cSrcweir /*************************************************************************
293cdf0e10cSrcweir  *				  virtual SwLinePortion::GetTxtSize()
294cdf0e10cSrcweir  *************************************************************************/
295cdf0e10cSrcweir 
GetTxtSize(const SwTxtSizeInfo &) const296cdf0e10cSrcweir SwPosSize SwLinePortion::GetTxtSize( const SwTxtSizeInfo & ) const
297cdf0e10cSrcweir {
298cdf0e10cSrcweir 	ASSERT( !this, "SwLinePortion::GetTxtSize: don't ask me about sizes, "
299cdf0e10cSrcweir 				   "I'm only a stupid SwLinePortion" );
300cdf0e10cSrcweir 	return SwPosSize();
301cdf0e10cSrcweir }
302cdf0e10cSrcweir 
303cdf0e10cSrcweir #ifdef DBG_UTIL
304cdf0e10cSrcweir 
305cdf0e10cSrcweir /*************************************************************************
306cdf0e10cSrcweir  *				  virtual SwLinePortion::Check()
307cdf0e10cSrcweir  *************************************************************************/
308cdf0e10cSrcweir 
Check(SvStream &,SwTxtSizeInfo &)309cdf0e10cSrcweir sal_Bool SwLinePortion::Check( SvStream &, SwTxtSizeInfo & ) //$ ostream
310cdf0e10cSrcweir {
311cdf0e10cSrcweir 	return sal_True;
312cdf0e10cSrcweir }
313cdf0e10cSrcweir #endif
314cdf0e10cSrcweir 
315cdf0e10cSrcweir /*************************************************************************
316cdf0e10cSrcweir  *				   virtual SwLinePortion::Format()
317cdf0e10cSrcweir  *************************************************************************/
318cdf0e10cSrcweir 
Format(SwTxtFormatInfo & rInf)319cdf0e10cSrcweir sal_Bool SwLinePortion::Format( SwTxtFormatInfo &rInf )
320cdf0e10cSrcweir {
321cdf0e10cSrcweir 	if( rInf.X() > rInf.Width() )
322cdf0e10cSrcweir 	{
323cdf0e10cSrcweir 		Truncate();
324cdf0e10cSrcweir 		rInf.SetUnderFlow( this );
325cdf0e10cSrcweir 		return sal_True;
326cdf0e10cSrcweir 	}
327cdf0e10cSrcweir 
328cdf0e10cSrcweir 	const SwLinePortion *pLast = rInf.GetLast();
329cdf0e10cSrcweir 	Height( pLast->Height() );
330cdf0e10cSrcweir 	SetAscent( pLast->GetAscent() );
331cdf0e10cSrcweir     const KSHORT nNewWidth = static_cast<sal_uInt16>(rInf.X() + PrtWidth());
332cdf0e10cSrcweir 	// Nur Portions mit echter Breite koennen ein sal_True zurueckliefern
333cdf0e10cSrcweir 	// Notizen beispielsweise setzen niemals bFull==sal_True
334cdf0e10cSrcweir     if( rInf.Width() <= nNewWidth && PrtWidth() && ! IsKernPortion() )
335cdf0e10cSrcweir 	{
336cdf0e10cSrcweir 		Truncate();
337cdf0e10cSrcweir 		if( nNewWidth > rInf.Width() )
338cdf0e10cSrcweir 			PrtWidth( nNewWidth - rInf.Width() );
339cdf0e10cSrcweir 		rInf.GetLast()->FormatEOL( rInf );
340cdf0e10cSrcweir 		return sal_True;
341cdf0e10cSrcweir 	}
342cdf0e10cSrcweir 	return sal_False;
343cdf0e10cSrcweir }
344cdf0e10cSrcweir 
345cdf0e10cSrcweir /*************************************************************************
346cdf0e10cSrcweir  *				   virtual SwLinePortion::FormatEOL()
347cdf0e10cSrcweir  *************************************************************************/
348cdf0e10cSrcweir 
349cdf0e10cSrcweir // Format end of line
350cdf0e10cSrcweir 
FormatEOL(SwTxtFormatInfo &)351cdf0e10cSrcweir void SwLinePortion::FormatEOL( SwTxtFormatInfo & )
352cdf0e10cSrcweir { }
353cdf0e10cSrcweir 
354cdf0e10cSrcweir /*************************************************************************
355cdf0e10cSrcweir  *						SwLinePortion::Move()
356cdf0e10cSrcweir  *************************************************************************/
357cdf0e10cSrcweir 
Move(SwTxtPaintInfo & rInf)358cdf0e10cSrcweir void SwLinePortion::Move( SwTxtPaintInfo &rInf )
359cdf0e10cSrcweir {
360cdf0e10cSrcweir 	sal_Bool bB2T = rInf.GetDirection() == DIR_BOTTOM2TOP;
361cdf0e10cSrcweir     const sal_Bool bFrmDir = rInf.GetTxtFrm()->IsRightToLeft();
362cdf0e10cSrcweir     sal_Bool bCounterDir = ( ! bFrmDir && DIR_RIGHT2LEFT == rInf.GetDirection() ) ||
363cdf0e10cSrcweir                        (   bFrmDir && DIR_LEFT2RIGHT == rInf.GetDirection() );
364cdf0e10cSrcweir 
365cdf0e10cSrcweir     if ( InSpaceGrp() && rInf.GetSpaceAdd() )
366cdf0e10cSrcweir 	{
367cdf0e10cSrcweir 		SwTwips nTmp = PrtWidth() +	CalcSpacing( rInf.GetSpaceAdd(), rInf );
368cdf0e10cSrcweir 		if( rInf.IsRotated() )
369cdf0e10cSrcweir 			rInf.Y( rInf.Y() + ( bB2T ? -nTmp : nTmp ) );
370cdf0e10cSrcweir         else if ( bCounterDir )
371cdf0e10cSrcweir             rInf.X( rInf.X() - nTmp );
372cdf0e10cSrcweir         else
373cdf0e10cSrcweir             rInf.X( rInf.X() + nTmp );
374cdf0e10cSrcweir 	}
375cdf0e10cSrcweir 	else
376cdf0e10cSrcweir 	{
377cdf0e10cSrcweir         if( InFixMargGrp() && !IsMarginPortion() )
378cdf0e10cSrcweir 		{
379cdf0e10cSrcweir 			rInf.IncSpaceIdx();
380cdf0e10cSrcweir             rInf.IncKanaIdx();
381cdf0e10cSrcweir 		}
382cdf0e10cSrcweir 		if( rInf.IsRotated() )
383cdf0e10cSrcweir 			rInf.Y( rInf.Y() + ( bB2T ? -PrtWidth() : PrtWidth() ) );
384cdf0e10cSrcweir         else if ( bCounterDir )
385cdf0e10cSrcweir             rInf.X( rInf.X() - PrtWidth() );
386cdf0e10cSrcweir         else
387cdf0e10cSrcweir 			rInf.X( rInf.X() + PrtWidth() );
388cdf0e10cSrcweir 	}
389cdf0e10cSrcweir 	if( IsMultiPortion() && ((SwMultiPortion*)this)->HasTabulator() )
390cdf0e10cSrcweir 		rInf.IncSpaceIdx();
391cdf0e10cSrcweir 
392cdf0e10cSrcweir 	rInf.SetIdx( rInf.GetIdx() + GetLen() );
393cdf0e10cSrcweir }
394cdf0e10cSrcweir 
395cdf0e10cSrcweir /*************************************************************************
396cdf0e10cSrcweir  *				virtual SwLinePortion::CalcSpacing()
397cdf0e10cSrcweir  *************************************************************************/
398cdf0e10cSrcweir 
CalcSpacing(long,const SwTxtSizeInfo &) const399cdf0e10cSrcweir long SwLinePortion::CalcSpacing( long , const SwTxtSizeInfo & ) const
400cdf0e10cSrcweir {
401cdf0e10cSrcweir 	return 0;
402cdf0e10cSrcweir }
403cdf0e10cSrcweir 
404cdf0e10cSrcweir /*************************************************************************
405cdf0e10cSrcweir  *				virtual SwLinePortion::GetExpTxt()
406cdf0e10cSrcweir  *************************************************************************/
407cdf0e10cSrcweir 
GetExpTxt(const SwTxtSizeInfo &,XubString &) const408cdf0e10cSrcweir sal_Bool SwLinePortion::GetExpTxt( const SwTxtSizeInfo &, XubString & ) const
409cdf0e10cSrcweir {
410cdf0e10cSrcweir 	return sal_False;
411cdf0e10cSrcweir }
412cdf0e10cSrcweir 
413cdf0e10cSrcweir /*************************************************************************
414cdf0e10cSrcweir  *              virtual SwLinePortion::HandlePortion()
415cdf0e10cSrcweir  *************************************************************************/
416cdf0e10cSrcweir 
HandlePortion(SwPortionHandler & rPH) const417cdf0e10cSrcweir void SwLinePortion::HandlePortion( SwPortionHandler& rPH ) const
418cdf0e10cSrcweir {
419cdf0e10cSrcweir     String aString;
420cdf0e10cSrcweir     rPH.Special( GetLen(), aString, GetWhichPor() );
421cdf0e10cSrcweir }
422cdf0e10cSrcweir 
423