xref: /trunk/main/sw/source/core/text/frminf.cxx (revision cf6516809c57e1bb0a940545cca99cdad54d4ce2)
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 #include <pam.hxx>          // GetSpaces
29cdf0e10cSrcweir #include <txtcfg.hxx>
30cdf0e10cSrcweir #include <frminf.hxx>       // SwTxtFrminfo
31cdf0e10cSrcweir #include <itrtxt.hxx>       // SwTxtMargin
32cdf0e10cSrcweir 
33cdf0e10cSrcweir /*************************************************************************
34cdf0e10cSrcweir  *                   SwTxtMargin::GetTxtStart()
35cdf0e10cSrcweir  *************************************************************************/
36cdf0e10cSrcweir 
GetTxtStart() const37cdf0e10cSrcweir xub_StrLen SwTxtMargin::GetTxtStart() const
38cdf0e10cSrcweir {
39cdf0e10cSrcweir     const XubString &rTxt = GetInfo().GetTxt();
40cdf0e10cSrcweir     const xub_StrLen nTmpPos = nStart;
41cdf0e10cSrcweir     const xub_StrLen nEnd = nTmpPos + pCurr->GetLen();
42cdf0e10cSrcweir     xub_StrLen i;
43cdf0e10cSrcweir 
44cdf0e10cSrcweir     for( i = nTmpPos; i < nEnd; ++i )
45cdf0e10cSrcweir     {
46cdf0e10cSrcweir         const xub_Unicode aChar = rTxt.GetChar( i );
47cdf0e10cSrcweir         if( CH_TAB != aChar && ' ' != aChar )
48cdf0e10cSrcweir             return i;
49cdf0e10cSrcweir     }
50cdf0e10cSrcweir     return i;
51cdf0e10cSrcweir }
52cdf0e10cSrcweir 
53cdf0e10cSrcweir /*************************************************************************
54cdf0e10cSrcweir  *                   SwTxtMargin::GetTxtEnd()
55cdf0e10cSrcweir  *************************************************************************/
56cdf0e10cSrcweir 
GetTxtEnd() const57cdf0e10cSrcweir xub_StrLen SwTxtMargin::GetTxtEnd() const
58cdf0e10cSrcweir {
59cdf0e10cSrcweir     const XubString &rTxt = GetInfo().GetTxt();
60cdf0e10cSrcweir     const xub_StrLen nTmpPos = nStart;
61cdf0e10cSrcweir     const xub_StrLen nEnd = nTmpPos + pCurr->GetLen();
62cdf0e10cSrcweir     long i;
63cdf0e10cSrcweir     for( i = nEnd - 1; i >= nTmpPos; --i )
64cdf0e10cSrcweir     {
65cdf0e10cSrcweir         xub_Unicode aChar = rTxt.GetChar( static_cast<xub_StrLen>(i) );
66cdf0e10cSrcweir         if( CH_TAB != aChar && CH_BREAK != aChar && ' ' != aChar )
67cdf0e10cSrcweir             return static_cast<xub_StrLen>(i + 1);
68cdf0e10cSrcweir     }
69cdf0e10cSrcweir     return static_cast<xub_StrLen>(i + 1);
70cdf0e10cSrcweir }
71cdf0e10cSrcweir 
72cdf0e10cSrcweir /*************************************************************************
73cdf0e10cSrcweir  *                   SwTxtFrmInfo::IsOneLine()
74cdf0e10cSrcweir  *************************************************************************/
75cdf0e10cSrcweir 
76cdf0e10cSrcweir // Passt der Absatz in eine Zeile?
IsOneLine() const77cdf0e10cSrcweir sal_Bool SwTxtFrmInfo::IsOneLine() const
78cdf0e10cSrcweir {
79cdf0e10cSrcweir     const SwLineLayout *pLay = pFrm->GetPara();
80cdf0e10cSrcweir     if( !pLay )
81cdf0e10cSrcweir         return sal_False;
82cdf0e10cSrcweir     else
83cdf0e10cSrcweir     {
84cdf0e10cSrcweir         // 6575: bei Follows natuerlich sal_False
85cdf0e10cSrcweir         if( pFrm->GetFollow() )
86cdf0e10cSrcweir             return sal_False;
87cdf0e10cSrcweir         pLay = pLay->GetNext();
88cdf0e10cSrcweir         while( pLay )
89cdf0e10cSrcweir         {
90cdf0e10cSrcweir             if( pLay->GetLen() )
91cdf0e10cSrcweir                 return sal_False;
92cdf0e10cSrcweir             pLay = pLay->GetNext();
93cdf0e10cSrcweir         }
94cdf0e10cSrcweir         return sal_True;
95cdf0e10cSrcweir     }
96cdf0e10cSrcweir }
97cdf0e10cSrcweir 
98cdf0e10cSrcweir /*************************************************************************
99cdf0e10cSrcweir  *                   SwTxtFrmInfo::IsFilled()
100cdf0e10cSrcweir  *************************************************************************/
101cdf0e10cSrcweir 
102cdf0e10cSrcweir // Ist die Zeile zu X% gefuellt?
IsFilled(const sal_uInt8 nPercent) const103cdf0e10cSrcweir sal_Bool SwTxtFrmInfo::IsFilled( const sal_uInt8 nPercent ) const
104cdf0e10cSrcweir {
105cdf0e10cSrcweir     const SwLineLayout *pLay = pFrm->GetPara();
106cdf0e10cSrcweir     if( !pLay )
107cdf0e10cSrcweir         return sal_False;
108cdf0e10cSrcweir     else
109cdf0e10cSrcweir     {
110cdf0e10cSrcweir         long nWidth = pFrm->Prt().Width();
111cdf0e10cSrcweir         nWidth *= nPercent;
112cdf0e10cSrcweir         nWidth /= 100;
113cdf0e10cSrcweir         return KSHORT(nWidth) <= pLay->Width();
114cdf0e10cSrcweir     }
115cdf0e10cSrcweir }
116cdf0e10cSrcweir 
117cdf0e10cSrcweir /*************************************************************************
118cdf0e10cSrcweir  *                   SwTxtFrmInfo::GetLineStart()
119cdf0e10cSrcweir  *************************************************************************/
120cdf0e10cSrcweir 
121cdf0e10cSrcweir // Wo beginnt der Text (ohne whitespaces)? ( Dokument global )
GetLineStart(const SwTxtCursor & rLine) const122cdf0e10cSrcweir SwTwips SwTxtFrmInfo::GetLineStart( const SwTxtCursor &rLine ) const
123cdf0e10cSrcweir {
124cdf0e10cSrcweir     xub_StrLen nTxtStart = rLine.GetTxtStart();
125cdf0e10cSrcweir     SwTwips nStart;
126cdf0e10cSrcweir     if( rLine.GetStart() == nTxtStart )
127cdf0e10cSrcweir         nStart = rLine.GetLineStart();
128cdf0e10cSrcweir     else
129cdf0e10cSrcweir     {
130cdf0e10cSrcweir         SwRect aRect;
131cdf0e10cSrcweir         if( ((SwTxtCursor&)rLine).GetCharRect( &aRect, nTxtStart ) )
132cdf0e10cSrcweir             nStart = aRect.Left();
133cdf0e10cSrcweir         else
134cdf0e10cSrcweir             nStart = rLine.GetLineStart();
135cdf0e10cSrcweir     }
136cdf0e10cSrcweir     return nStart;
137cdf0e10cSrcweir }
138cdf0e10cSrcweir 
139cdf0e10cSrcweir 
140cdf0e10cSrcweir /*************************************************************************
141cdf0e10cSrcweir  *                   SwTxtFrmInfo::GetLineStart()
142cdf0e10cSrcweir  *************************************************************************/
143cdf0e10cSrcweir 
144cdf0e10cSrcweir // Wo beginnt der Text (ohne whitespaces)? (rel. im Frame)
GetLineStart() const145cdf0e10cSrcweir SwTwips SwTxtFrmInfo::GetLineStart() const
146cdf0e10cSrcweir {
147cdf0e10cSrcweir     SwTxtSizeInfo aInf( (SwTxtFrm*)pFrm );
148cdf0e10cSrcweir     SwTxtCursor aLine( (SwTxtFrm*)pFrm, &aInf );
149cdf0e10cSrcweir     return GetLineStart( aLine ) - pFrm->Frm().Left() - pFrm->Prt().Left();
150cdf0e10cSrcweir }
151cdf0e10cSrcweir 
152cdf0e10cSrcweir // errechne die Position des Zeichens und gebe die Mittelposition zurueck
GetCharPos(xub_StrLen nChar,sal_Bool bCenter) const153cdf0e10cSrcweir SwTwips SwTxtFrmInfo::GetCharPos( xub_StrLen nChar, sal_Bool bCenter ) const
154cdf0e10cSrcweir {
155cdf0e10cSrcweir     SWRECTFN( pFrm )
156cdf0e10cSrcweir     SwFrmSwapper aSwapper( pFrm, sal_True );
157cdf0e10cSrcweir 
158cdf0e10cSrcweir     SwTxtSizeInfo aInf( (SwTxtFrm*)pFrm );
159cdf0e10cSrcweir     SwTxtCursor aLine( (SwTxtFrm*)pFrm, &aInf );
160cdf0e10cSrcweir 
161cdf0e10cSrcweir     SwTwips nStt, nNext;
162cdf0e10cSrcweir     SwRect aRect;
163cdf0e10cSrcweir     if( ((SwTxtCursor&)aLine).GetCharRect( &aRect, nChar ) )
164cdf0e10cSrcweir     {
165cdf0e10cSrcweir         if ( bVert )
166cdf0e10cSrcweir             pFrm->SwitchHorizontalToVertical( aRect );
167cdf0e10cSrcweir 
168cdf0e10cSrcweir         nStt = (aRect.*fnRect->fnGetLeft)();
169cdf0e10cSrcweir     }
170cdf0e10cSrcweir     else
171cdf0e10cSrcweir         nStt = aLine.GetLineStart();
172cdf0e10cSrcweir 
173cdf0e10cSrcweir     if( !bCenter )
174cdf0e10cSrcweir         return nStt - (pFrm->Frm().*fnRect->fnGetLeft)();
175cdf0e10cSrcweir 
176cdf0e10cSrcweir     if( ((SwTxtCursor&)aLine).GetCharRect( &aRect, nChar+1 ) )
177cdf0e10cSrcweir     {
178cdf0e10cSrcweir         if ( bVert )
179cdf0e10cSrcweir             pFrm->SwitchHorizontalToVertical( aRect );
180cdf0e10cSrcweir 
181cdf0e10cSrcweir         nNext = (aRect.*fnRect->fnGetLeft)();
182cdf0e10cSrcweir     }
183cdf0e10cSrcweir     else
184cdf0e10cSrcweir         nNext = aLine.GetLineStart();
185cdf0e10cSrcweir 
186cdf0e10cSrcweir     return (( nNext + nStt ) / 2 ) - (pFrm->Frm().*fnRect->fnGetLeft)();
187cdf0e10cSrcweir }
188cdf0e10cSrcweir 
189cdf0e10cSrcweir /*************************************************************************
190cdf0e10cSrcweir  *                   SwTxtFrmInfo::GetSpaces()
191cdf0e10cSrcweir  *************************************************************************/
192cdf0e10cSrcweir 
AddPam(SwPaM * pPam,const SwTxtFrm * pTxtFrm,const xub_StrLen nPos,const xub_StrLen nLen)193cdf0e10cSrcweir SwPaM *AddPam( SwPaM *pPam, const SwTxtFrm* pTxtFrm,
194cdf0e10cSrcweir                 const xub_StrLen nPos, const xub_StrLen nLen )
195cdf0e10cSrcweir {
196cdf0e10cSrcweir     if( nLen )
197cdf0e10cSrcweir     {
198cdf0e10cSrcweir         // Es koennte auch der erste sein.
199cdf0e10cSrcweir         if( pPam->HasMark() )
200cdf0e10cSrcweir         {
201cdf0e10cSrcweir             // liegt die neue Position genau hinter der aktuellen, dann
202cdf0e10cSrcweir             // erweiter den Pam einfach
203cdf0e10cSrcweir             if( nPos == pPam->GetPoint()->nContent.GetIndex() )
204cdf0e10cSrcweir             {
205cdf0e10cSrcweir                 pPam->GetPoint()->nContent += nLen;
206cdf0e10cSrcweir                 return pPam;
207cdf0e10cSrcweir             }
208cdf0e10cSrcweir             pPam = new SwPaM( *pPam );
209cdf0e10cSrcweir         }
210cdf0e10cSrcweir 
211cdf0e10cSrcweir         SwIndex &rContent = pPam->GetPoint()->nContent;
212cdf0e10cSrcweir         rContent.Assign( (SwTxtNode*)pTxtFrm->GetTxtNode(), nPos );
213cdf0e10cSrcweir         pPam->SetMark();
214cdf0e10cSrcweir         rContent += nLen;
215cdf0e10cSrcweir     }
216cdf0e10cSrcweir     return pPam;
217cdf0e10cSrcweir }
218cdf0e10cSrcweir 
219cdf0e10cSrcweir // Sammelt die whitespaces am Zeilenbeginn und -ende im Pam
GetSpaces(SwPaM & rPam,sal_Bool bWithLineBreak) const220cdf0e10cSrcweir void SwTxtFrmInfo::GetSpaces( SwPaM &rPam, sal_Bool bWithLineBreak ) const
221cdf0e10cSrcweir {
222cdf0e10cSrcweir     SwTxtSizeInfo aInf( (SwTxtFrm*)pFrm );
223cdf0e10cSrcweir     SwTxtMargin aLine( (SwTxtFrm*)pFrm, &aInf );
224cdf0e10cSrcweir     SwPaM *pPam = &rPam;
225cdf0e10cSrcweir     sal_Bool bFirstLine = sal_True;
226cdf0e10cSrcweir     do {
227cdf0e10cSrcweir 
228cdf0e10cSrcweir         if( aLine.GetCurr()->GetLen() )
229cdf0e10cSrcweir         {
230cdf0e10cSrcweir             xub_StrLen nPos = aLine.GetTxtStart();
231cdf0e10cSrcweir             // Bug 49649: von der ersten Line die Blanks/Tabs NICHT
232cdf0e10cSrcweir             //              mit selektieren
233cdf0e10cSrcweir             if( !bFirstLine && nPos > aLine.GetStart() )
234cdf0e10cSrcweir                 pPam = AddPam( pPam, pFrm, aLine.GetStart(),
235cdf0e10cSrcweir                                 nPos - aLine.GetStart() );
236cdf0e10cSrcweir 
237cdf0e10cSrcweir             // Bug 49649: von der letzten Line die Blanks/Tabs NICHT
238cdf0e10cSrcweir             //              mit selektieren
239cdf0e10cSrcweir             if( aLine.GetNext() )
240cdf0e10cSrcweir             {
241cdf0e10cSrcweir                 nPos = aLine.GetTxtEnd();
242cdf0e10cSrcweir 
243cdf0e10cSrcweir                 if( nPos < aLine.GetEnd() )
244cdf0e10cSrcweir                 {
245cdf0e10cSrcweir                     MSHORT nOff = !bWithLineBreak && CH_BREAK ==
246cdf0e10cSrcweir                                 aLine.GetInfo().GetChar( aLine.GetEnd() - 1 )
247cdf0e10cSrcweir                                 ? 1 : 0;
248cdf0e10cSrcweir                     pPam = AddPam( pPam, pFrm, nPos, aLine.GetEnd() - nPos - nOff );
249cdf0e10cSrcweir                 }
250cdf0e10cSrcweir             }
251cdf0e10cSrcweir         }
252cdf0e10cSrcweir         bFirstLine = sal_False;
253cdf0e10cSrcweir     }
254cdf0e10cSrcweir     while( aLine.Next() );
255cdf0e10cSrcweir }
256cdf0e10cSrcweir 
257cdf0e10cSrcweir /*************************************************************************
258cdf0e10cSrcweir  *                   SwTxtFrmInfo::IsBullet()
259cdf0e10cSrcweir  *************************************************************************/
260cdf0e10cSrcweir 
261cdf0e10cSrcweir // Ist an der Textposition ein Bullet/Symbol etc?
262cdf0e10cSrcweir // Fonts: CharSet, SYMBOL und DONTKNOW
IsBullet(xub_StrLen nTxtStart) const263cdf0e10cSrcweir sal_Bool SwTxtFrmInfo::IsBullet( xub_StrLen nTxtStart ) const
264cdf0e10cSrcweir {
265cdf0e10cSrcweir     SwTxtSizeInfo aInf( (SwTxtFrm*)pFrm );
266cdf0e10cSrcweir     SwTxtMargin aLine( (SwTxtFrm*)pFrm, &aInf );
267cdf0e10cSrcweir     aInf.SetIdx( nTxtStart );
268cdf0e10cSrcweir     return aLine.IsSymbol( nTxtStart );
269cdf0e10cSrcweir }
270cdf0e10cSrcweir 
271cdf0e10cSrcweir /*************************************************************************
272cdf0e10cSrcweir  *                   SwTxtFrmInfo::GetFirstIndent()
273cdf0e10cSrcweir  *************************************************************************/
274cdf0e10cSrcweir 
275cdf0e10cSrcweir // Ermittelt Erstzeileneinzug
276cdf0e10cSrcweir // Voraussetzung fuer pos. oder neg. EZE ist, dass alle
277cdf0e10cSrcweir // Zeilen ausser der ersten Zeile den selben linken Rand haben.
278cdf0e10cSrcweir // Wir wollen nicht so knauserig sein und arbeiten mit einer Toleranz
279cdf0e10cSrcweir // von TOLERANCE Twips.
280cdf0e10cSrcweir 
281cdf0e10cSrcweir #define TOLERANCE 20
282cdf0e10cSrcweir 
GetFirstIndent() const283cdf0e10cSrcweir SwTwips SwTxtFrmInfo::GetFirstIndent() const
284cdf0e10cSrcweir {
285cdf0e10cSrcweir     SwTxtSizeInfo aInf( (SwTxtFrm*)pFrm );
286cdf0e10cSrcweir     SwTxtCursor aLine( (SwTxtFrm*)pFrm, &aInf );
287cdf0e10cSrcweir     const SwTwips nFirst = GetLineStart( aLine );
288cdf0e10cSrcweir     if( !aLine.Next() )
289cdf0e10cSrcweir         return 0;
290cdf0e10cSrcweir 
291cdf0e10cSrcweir     SwTwips nLeft = GetLineStart( aLine );
292cdf0e10cSrcweir     while( aLine.Next() )
293cdf0e10cSrcweir     {
294cdf0e10cSrcweir         if( aLine.GetCurr()->GetLen() )
295cdf0e10cSrcweir         {
296cdf0e10cSrcweir             const SwTwips nCurrLeft = GetLineStart( aLine );
297cdf0e10cSrcweir             if( nLeft + TOLERANCE < nCurrLeft ||
298cdf0e10cSrcweir                 nLeft - TOLERANCE > nCurrLeft )
299cdf0e10cSrcweir                 return 0;
300cdf0e10cSrcweir         }
301cdf0e10cSrcweir     }
302cdf0e10cSrcweir 
303cdf0e10cSrcweir     // Vorerst wird nur +1, -1 und 0 returnt.
304cdf0e10cSrcweir     if( nLeft == nFirst )
305cdf0e10cSrcweir         return 0;
306cdf0e10cSrcweir     else
307cdf0e10cSrcweir         if( nLeft > nFirst )
308cdf0e10cSrcweir             return -1;
309cdf0e10cSrcweir         else
310cdf0e10cSrcweir             return +1;
311cdf0e10cSrcweir }
312cdf0e10cSrcweir 
313cdf0e10cSrcweir /*************************************************************************
314cdf0e10cSrcweir  *                   SwTxtFrmInfo::GetBigIndent()
315cdf0e10cSrcweir  *************************************************************************/
316cdf0e10cSrcweir 
GetBigIndent(xub_StrLen & rFndPos,const SwTxtFrm * pNextFrm) const317cdf0e10cSrcweir KSHORT SwTxtFrmInfo::GetBigIndent( xub_StrLen& rFndPos,
318cdf0e10cSrcweir                                     const SwTxtFrm *pNextFrm ) const
319cdf0e10cSrcweir {
320cdf0e10cSrcweir     SwTxtSizeInfo aInf( (SwTxtFrm*)pFrm );
321cdf0e10cSrcweir     SwTxtCursor aLine( (SwTxtFrm*)pFrm, &aInf );
322cdf0e10cSrcweir     SwTwips nNextIndent = 0;
323cdf0e10cSrcweir 
324cdf0e10cSrcweir     if( pNextFrm )
325cdf0e10cSrcweir     {
326cdf0e10cSrcweir         // ich bin einzeilig
327cdf0e10cSrcweir         SwTxtSizeInfo aNxtInf( (SwTxtFrm*)pNextFrm );
328cdf0e10cSrcweir         SwTxtCursor aNxtLine( (SwTxtFrm*)pNextFrm, &aNxtInf );
329cdf0e10cSrcweir         nNextIndent = GetLineStart( aNxtLine );
330cdf0e10cSrcweir     }
331cdf0e10cSrcweir     else
332cdf0e10cSrcweir     {
333cdf0e10cSrcweir         // ich bin mehrzeilig
334cdf0e10cSrcweir         if( aLine.Next() )
335cdf0e10cSrcweir         {
336cdf0e10cSrcweir             nNextIndent = GetLineStart( aLine );
337cdf0e10cSrcweir             aLine.Prev();
338cdf0e10cSrcweir         }
339cdf0e10cSrcweir     }
340cdf0e10cSrcweir 
341cdf0e10cSrcweir     if( nNextIndent <= GetLineStart( aLine ) )
342cdf0e10cSrcweir         return 0;
343cdf0e10cSrcweir 
344cdf0e10cSrcweir     const Point aPoint( nNextIndent, aLine.Y() );
345cdf0e10cSrcweir     rFndPos = aLine.GetCrsrOfst( 0, aPoint, sal_False );
346cdf0e10cSrcweir     if( 1 >= rFndPos )
347cdf0e10cSrcweir         return 0;
348cdf0e10cSrcweir 
349cdf0e10cSrcweir     // steht vor einem "nicht Space"
350cdf0e10cSrcweir     const XubString& rTxt = aInf.GetTxt();
351cdf0e10cSrcweir     xub_Unicode aChar = rTxt.GetChar( rFndPos );
352cdf0e10cSrcweir     if( CH_TAB == aChar || CH_BREAK == aChar || ' ' == aChar ||
353cdf0e10cSrcweir         (( CH_TXTATR_BREAKWORD == aChar || CH_TXTATR_INWORD == aChar ) &&
354cdf0e10cSrcweir             aInf.HasHint( rFndPos ) ) )
355cdf0e10cSrcweir         return 0;
356cdf0e10cSrcweir 
357cdf0e10cSrcweir     // und hinter einem "Space"
358cdf0e10cSrcweir     aChar = rTxt.GetChar( rFndPos - 1 );
359cdf0e10cSrcweir     if( CH_TAB != aChar && CH_BREAK != aChar &&
360cdf0e10cSrcweir         ( ( CH_TXTATR_BREAKWORD != aChar && CH_TXTATR_INWORD != aChar ) ||
361cdf0e10cSrcweir             !aInf.HasHint( rFndPos - 1 ) ) &&
362cdf0e10cSrcweir         // mehr als 2 Blanks !!
363cdf0e10cSrcweir         ( ' ' != aChar || ' ' != rTxt.GetChar( rFndPos - 2 ) ) )
364cdf0e10cSrcweir         return 0;
365cdf0e10cSrcweir 
366cdf0e10cSrcweir     SwRect aRect;
367cdf0e10cSrcweir     return aLine.GetCharRect( &aRect, rFndPos )
368cdf0e10cSrcweir             ? KSHORT( aRect.Left() - pFrm->Frm().Left() - pFrm->Prt().Left())
369cdf0e10cSrcweir             : 0;
370cdf0e10cSrcweir }
371