Lines 28-34
Link Here
|
28 |
// MARKER(update_precomp.py): autogen include statement, do not remove |
28 |
// MARKER(update_precomp.py): autogen include statement, do not remove |
29 |
#include "precompiled_sw.hxx" |
29 |
#include "precompiled_sw.hxx" |
30 |
|
30 |
|
31 |
|
|
|
32 |
#include <ctype.h> |
31 |
#include <ctype.h> |
33 |
#include <editeng/unolingu.hxx> |
32 |
#include <editeng/unolingu.hxx> |
34 |
#include <tools/shl.hxx> // needed for SW_MOD() macro |
33 |
#include <tools/shl.hxx> // needed for SW_MOD() macro |
Lines 46-51
Link Here
|
46 |
#include <com/sun/star/i18n/WordType.hpp> |
45 |
#include <com/sun/star/i18n/WordType.hpp> |
47 |
#include <unotools/charclass.hxx> |
46 |
#include <unotools/charclass.hxx> |
48 |
#include <porfld.hxx> |
47 |
#include <porfld.hxx> |
|
|
48 |
#include <paratr.hxx> |
49 |
|
49 |
|
50 |
using ::rtl::OUString; |
50 |
using ::rtl::OUString; |
51 |
using namespace ::com::sun::star; |
51 |
using namespace ::com::sun::star; |
Lines 69-75
Link Here
|
69 |
{ |
69 |
{ |
70 |
nCutPos = rInf.GetIdx(); |
70 |
nCutPos = rInf.GetIdx(); |
71 |
|
71 |
|
72 |
// Leere Strings sind immer 0 |
72 |
// Empty strings are always 0 |
73 |
if( !rInf.GetLen() || !rInf.GetTxt().Len() ) |
73 |
if( !rInf.GetLen() || !rInf.GetTxt().Len() ) |
74 |
return sal_False; |
74 |
return sal_False; |
75 |
|
75 |
|
Lines 192-199
Link Here
|
192 |
|
192 |
|
193 |
nBreakWidth = nMinSize; |
193 |
nBreakWidth = nMinSize; |
194 |
|
194 |
|
195 |
// Der folgende Vergleich sollte eigenlich immer sal_True ergeben, sonst |
195 |
// The following comparison should always give sal_True, otherwise |
196 |
// hat es wohl bei GetTxtBreak einen Pixel-Rundungsfehler gegeben... |
196 |
// a pixel rounding error in GetTxtBreak will appear |
197 |
if ( nBreakWidth <= nLineWidth ) |
197 |
if ( nBreakWidth <= nLineWidth ) |
198 |
{ |
198 |
{ |
199 |
if( nItalic && ( nBreakPos + 1 ) >= rInf.GetTxt().Len() ) |
199 |
if( nItalic && ( nBreakPos + 1 ) >= rInf.GetTxt().Len() ) |
Lines 223-243
Link Here
|
223 |
{ |
223 |
{ |
224 |
nBreakPos = nCutPos; |
224 |
nBreakPos = nCutPos; |
225 |
xub_StrLen nX = nBreakPos; |
225 |
xub_StrLen nX = nBreakPos; |
|
|
226 |
|
227 |
const SvxAdjust& rAdjust = rInf.GetTxtFrm()->GetTxtNode()->GetSwAttrSet().GetAdjust().GetAdjust(); |
228 |
if ( rAdjust == SVX_ADJUST_LEFT ) |
229 |
{ |
230 |
// we step back until a non blank character has been found |
231 |
// or there is only one more character left |
232 |
while( nX && nBreakPos > rInf.GetTxt().Len() && |
233 |
( CH_BLANK == ( cCutChar = rInf.GetChar( --nX ) ) || |
234 |
CH_FULL_BLANK == cCutChar ) ) |
235 |
--nBreakPos; |
236 |
} |
237 |
else |
238 |
{ |
239 |
while( nX && nBreakPos > rInf.GetLineStart() + 1 && |
240 |
( CH_BLANK == ( cCutChar = rInf.GetChar( --nX ) ) || |
241 |
CH_FULL_BLANK == cCutChar ) ) |
242 |
--nBreakPos; |
243 |
} |
226 |
|
244 |
|
227 |
// we step back until a non blank character has been found |
245 |
if( nBreakPos > rInf.GetIdx() ) |
228 |
// or there is only one more character left |
246 |
nPorLen = nBreakPos - rInf.GetIdx(); |
229 |
while( nX && nBreakPos > rInf.GetLineStart() + 1 && |
|
|
230 |
( CH_BLANK == ( cCutChar = rInf.GetChar( --nX ) ) || |
231 |
CH_FULL_BLANK == cCutChar ) ) |
232 |
--nBreakPos; |
233 |
|
234 |
if( nBreakPos > rInf.GetIdx() ) |
235 |
nPorLen = nBreakPos - rInf.GetIdx(); |
236 |
while( ++nCutPos < rInf.GetTxt().Len() && |
247 |
while( ++nCutPos < rInf.GetTxt().Len() && |
237 |
( CH_BLANK == ( cCutChar = rInf.GetChar( nCutPos ) ) || |
248 |
( CH_BLANK == ( cCutChar = rInf.GetChar( nCutPos ) ) || |
238 |
CH_FULL_BLANK == cCutChar ) ) |
249 |
CH_FULL_BLANK == cCutChar ) ) |
239 |
; // nothing |
250 |
; // nothing |
240 |
|
251 |
|
241 |
nBreakStart = nCutPos; |
252 |
nBreakStart = nCutPos; |
242 |
} |
253 |
} |
243 |
else if( pBreakIt->GetBreakIter().is() ) |
254 |
else if( pBreakIt->GetBreakIter().is() ) |
Lines 433-448
Link Here
|
433 |
CHAR_SOFTHYPHEN == rInf.GetTxt().GetChar( nBreakPos - 1 ) ) |
444 |
CHAR_SOFTHYPHEN == rInf.GetTxt().GetChar( nBreakPos - 1 ) ) |
434 |
nBreakPos = rInf.GetIdx() - 1; |
445 |
nBreakPos = rInf.GetIdx() - 1; |
435 |
|
446 |
|
436 |
// Delete any blanks at the end of a line, but be careful: |
447 |
const SvxAdjust& rAdjust = rInf.GetTxtFrm()->GetTxtNode()->GetSwAttrSet().GetAdjust().GetAdjust(); |
437 |
// If a field has been expanded, we do not want to delete any |
448 |
if( rAdjust != SVX_ADJUST_LEFT ) |
438 |
// blanks inside the field portion. This would cause an unwanted |
449 |
{ |
439 |
// underflow |
450 |
// Delete any blanks at the end of a line, but be careful: |
440 |
xub_StrLen nX = nBreakPos; |
451 |
// If a field has been expanded, we do not want to delete any |
441 |
while( nX > rInf.GetLineStart() && |
452 |
// blanks inside the field portion. This would cause an unwanted |
442 |
( CH_TXTATR_BREAKWORD != cFldChr || nX > rInf.GetIdx() ) && |
453 |
// underflow |
443 |
( CH_BLANK == rInf.GetChar( --nX ) || |
454 |
xub_StrLen nX = nBreakPos; |
444 |
CH_FULL_BLANK == rInf.GetChar( nX ) ) ) |
455 |
while( nX > rInf.GetLineStart() && |
445 |
nBreakPos = nX; |
456 |
( CH_TXTATR_BREAKWORD != cFldChr || nX > rInf.GetIdx() ) && |
|
|
457 |
( CH_BLANK == rInf.GetChar( --nX ) || |
458 |
CH_FULL_BLANK == rInf.GetChar( nX ) ) ) |
459 |
nBreakPos = nX; |
460 |
} |
446 |
if( nBreakPos > rInf.GetIdx() ) |
461 |
if( nBreakPos > rInf.GetIdx() ) |
447 |
nPorLen = nBreakPos - rInf.GetIdx(); |
462 |
nPorLen = nBreakPos - rInf.GetIdx(); |
448 |
} |
463 |
} |