View | Details | Raw Unified | Return to issue 74188
Collapse All | Expand All

(-)a/editeng/source/editeng/impedit2.cxx (+10 lines)
Lines 4198-4204 Link Here
4198
					DBG_ERROR("svx::ImpEditEngine::GetXPos(), index out of range!");
4198
					DBG_ERROR("svx::ImpEditEngine::GetXPos(), index out of range!");
4199
				}
4199
				}
4200
4200
4201
#if 0
4201
				long nPosInPortion = pLine->GetCharPosArray().GetObject( nPos );
4202
				long nPosInPortion = pLine->GetCharPosArray().GetObject( nPos );
4203
#else
4204
				SvxFont aTmpFont( pParaPortion->GetNode()->GetCharAttribs().GetDefFont() );
4205
				SeekCursor( pParaPortion->GetNode(), nPos+1, aTmpFont );
4206
				aTmpFont.SetPhysFont( GetRefDevice() );
4207
				ImplInitDigitMode( GetRefDevice(), 0, 0, 0, aTmpFont.GetLanguage() );
4208
				String sSegment(*pParaPortion->GetNode(), pLine->GetStart(), nPos+1);
4209
				long nPosInPortion = aTmpFont.QuickGetTextSize( GetRefDevice(),
4210
					sSegment, 0, nPos+1, NULL ).Width();
4211
#endif
4202
4212
4203
				if ( !pPortion->IsRightToLeft() )
4213
				if ( !pPortion->IsRightToLeft() )
4204
				{
4214
				{
(-)a/editeng/source/editeng/impedit4.cxx (-1 / +6 lines)
Lines 82-87 Link Here
82
#include <vcl/help.hxx>
82
#include <vcl/help.hxx>
83
#include <svtools/rtfkeywd.hxx>
83
#include <svtools/rtfkeywd.hxx>
84
#include <editeng/edtdlg.hxx>
84
#include <editeng/edtdlg.hxx>
85
#include <stdio.h>
85
86
86
using namespace ::com::sun::star;
87
using namespace ::com::sun::star;
87
using namespace ::com::sun::star::uno;
88
using namespace ::com::sun::star::uno;
Lines 1443-1449 Link Here
1443
1444
1444
::com::sun::star::lang::Locale ImpEditEngine::GetLocale( const EditPaM& rPaM ) const
1445
::com::sun::star::lang::Locale ImpEditEngine::GetLocale( const EditPaM& rPaM ) const
1445
{
1446
{
1446
	return SvxCreateLocale( GetLanguage( rPaM ) );
1447
	::com::sun::star::lang::Locale aRet = SvxCreateLocale( GetLanguage( rPaM ) );
1448
	fprintf(stderr, "locale is %s %s\n",
1449
		rtl::OUStringToOString(aRet.Language, RTL_TEXTENCODING_UTF8).getStr(),
1450
		rtl::OUStringToOString(aRet.Country, RTL_TEXTENCODING_UTF8).getStr());
1451
	return aRet;
1447
}
1452
}
1448
1453
1449
Reference< XSpellChecker1 > ImpEditEngine::GetSpeller()
1454
Reference< XSpellChecker1 > ImpEditEngine::GetSpeller()
(-)a/editeng/source/items/svxfont.cxx (-17 / +31 lines)
Lines 42-47 Link Here
42
#include <editeng/svxfont.hxx>
42
#include <editeng/svxfont.hxx>
43
#include <editeng/escpitem.hxx>
43
#include <editeng/escpitem.hxx>
44
44
45
#include <stdio.h>
46
45
// Minimum: Prozentwert fuers kernen
47
// Minimum: Prozentwert fuers kernen
46
#define MINKERNPERCENT 5
48
#define MINKERNPERCENT 5
47
49
Lines 458-487 Link Here
458
Size SvxFont::QuickGetTextSize( const OutputDevice *pOut, const XubString &rTxt,
460
Size SvxFont::QuickGetTextSize( const OutputDevice *pOut, const XubString &rTxt,
459
						 const USHORT nIdx, const USHORT nLen, sal_Int32* pDXArray ) const
461
						 const USHORT nIdx, const USHORT nLen, sal_Int32* pDXArray ) const
460
{
462
{
463
	Size aTxtSize;
461
	if ( !IsCaseMap() && !IsKern() )
464
	if ( !IsCaseMap() && !IsKern() )
462
		return Size( pOut->GetTextArray( rTxt, pDXArray, nIdx, nLen ),
465
	{
466
		aTxtSize = Size( pOut->GetTextArray( rTxt, pDXArray, nIdx, nLen ),
463
					 pOut->GetTextHeight() );
467
					 pOut->GetTextHeight() );
464
468
465
	Size aTxtSize;
469
//	for (int i = 0;i < nLen; i++)
466
	aTxtSize.setHeight( pOut->GetTextHeight() );
470
//		fprintf(stderr, "initial pos %d is at %d\n", i, pDXArray[i]);
467
	if ( !IsCaseMap() )
471
468
		aTxtSize.setWidth( pOut->GetTextArray( rTxt, pDXArray, nIdx, nLen ) );
472
	}
469
	else
473
	else
470
		aTxtSize.setWidth( pOut->GetTextArray( CalcCaseMap( rTxt ),
474
	{
471
						   pDXArray, nIdx, nLen ) );
475
			aTxtSize.setHeight( pOut->GetTextHeight() );
476
			if ( !IsCaseMap() )
477
				aTxtSize.setWidth( pOut->GetTextArray( rTxt, pDXArray, nIdx, nLen ) );
478
			else
479
				aTxtSize.setWidth( pOut->GetTextArray( CalcCaseMap( rTxt ),
480
								   pDXArray, nIdx, nLen ) );
472
481
473
	if( IsKern() && ( nLen > 1 ) )
482
			if( IsKern() && ( nLen > 1 ) )
474
	{
483
			{
475
		aTxtSize.Width() += ( ( nLen-1 ) * long( nKern ) );
484
				aTxtSize.Width() += ( ( nLen-1 ) * long( nKern ) );
476
485
477
		if ( pDXArray )
486
				if ( pDXArray )
478
		{
487
				{
479
			for ( xub_StrLen i = 0; i < nLen; i++ )
488
					for ( xub_StrLen i = 0; i < nLen; i++ )
480
				pDXArray[i] += ( (i+1) * long( nKern ) );
489
						pDXArray[i] += ( (i+1) * long( nKern ) );
481
			// Der letzte ist um ein nKern zu gross:
490
					// Der letzte ist um ein nKern zu gross:
482
			pDXArray[nLen-1] -= nKern;
491
					pDXArray[nLen-1] -= nKern;
483
		}
492
				}
493
			}
484
	}
494
	}
495
496
//	for (int i = 0;i < nLen; i++)
497
//		fprintf(stderr, "pos %d is at %d\n", i, pDXArray[i]);
498
485
	return aTxtSize;
499
	return aTxtSize;
486
}
500
}
487
501

Return to issue 74188