summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/gdi/gfxlink.cxx59
-rw-r--r--vcl/source/gdi/imgcons.cxx574
-rw-r--r--vcl/source/gdi/makefile.mk1
-rw-r--r--vcl/source/gdi/outdev2.cxx71
-rw-r--r--vcl/source/gdi/outdev6.cxx40
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx1
-rw-r--r--vcl/source/glyphs/graphite_adaptors.cxx56
-rw-r--r--vcl/source/glyphs/graphite_cache.cxx2
-rw-r--r--vcl/source/glyphs/graphite_layout.cxx67
-rw-r--r--vcl/source/glyphs/graphite_textsrc.hxx1
10 files changed, 148 insertions, 724 deletions
diff --git a/vcl/source/gdi/gfxlink.cxx b/vcl/source/gdi/gfxlink.cxx
index 4d32990f9335..60ad94a63273 100644
--- a/vcl/source/gdi/gfxlink.cxx
+++ b/vcl/source/gdi/gfxlink.cxx
@@ -28,6 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
+#include <osl/file.h>
#include <tools/vcompat.hxx>
#include <tools/urlobj.hxx>
#include <tools/debug.hxx>
@@ -398,12 +399,10 @@ ImpSwap::ImpSwap( BYTE* pData, ULONG nDataSize ) :
{
::utl::TempFile aTempFile;
- maURL = INetURLObject(aTempFile.GetURL());
-
- if( maURL.GetMainURL( INetURLObject::NO_DECODE ).getLength() )
+ maURL = aTempFile.GetURL();
+ if( maURL.getLength() )
{
- SvStream* pOStm = ::utl::UcbStreamHelper::CreateStream( maURL.GetMainURL( INetURLObject::NO_DECODE ), STREAM_READWRITE | STREAM_SHARE_DENYWRITE );
-
+ SvStream* pOStm = ::utl::UcbStreamHelper::CreateStream( maURL, STREAM_READWRITE | STREAM_SHARE_DENYWRITE );
if( pOStm )
{
pOStm->Write( pData, mnDataSize );
@@ -412,28 +411,8 @@ ImpSwap::ImpSwap( BYTE* pData, ULONG nDataSize ) :
if( bError )
{
- try
- {
- ::ucbhelper::Content aCnt( maURL.GetMainURL( INetURLObject::NO_DECODE ),
- ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >() );
-
- aCnt.executeCommand( ::rtl::OUString::createFromAscii( "delete" ),
- ::com::sun::star::uno::makeAny( sal_Bool( sal_True ) ) );
- }
- catch( const ::com::sun::star::ucb::ContentCreationException& )
- {
- }
- catch( const ::com::sun::star::uno::RuntimeException& )
- {
- }
- catch( const ::com::sun::star::ucb::CommandAbortedException& )
- {
- }
- catch( const ::com::sun::star::uno::Exception& )
- {
- }
-
- maURL = INetURLObject();
+ osl_removeFile( maURL.pData );
+ maURL = String();
}
}
}
@@ -445,28 +424,7 @@ ImpSwap::ImpSwap( BYTE* pData, ULONG nDataSize ) :
ImpSwap::~ImpSwap()
{
if( IsSwapped() )
- {
- try
- {
- ::ucbhelper::Content aCnt( maURL.GetMainURL( INetURLObject::NO_DECODE ),
- ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >() );
-
- aCnt.executeCommand( ::rtl::OUString::createFromAscii( "delete" ),
- ::com::sun::star::uno::makeAny( sal_Bool( sal_True ) ) );
- }
- catch( const ::com::sun::star::ucb::ContentCreationException& )
- {
- }
- catch( const ::com::sun::star::uno::RuntimeException& )
- {
- }
- catch( const ::com::sun::star::ucb::CommandAbortedException& )
- {
- }
- catch( const ::com::sun::star::uno::Exception& )
- {
- }
- }
+ osl_removeFile( maURL.pData );
}
// ------------------------------------------------------------------------
@@ -477,8 +435,7 @@ BYTE* ImpSwap::GetData() const
if( IsSwapped() )
{
- SvStream* pIStm = ::utl::UcbStreamHelper::CreateStream( maURL.GetMainURL( INetURLObject::NO_DECODE ), STREAM_READWRITE );
-
+ SvStream* pIStm = ::utl::UcbStreamHelper::CreateStream( maURL, STREAM_READWRITE );
if( pIStm )
{
pData = new BYTE[ mnDataSize ];
diff --git a/vcl/source/gdi/imgcons.cxx b/vcl/source/gdi/imgcons.cxx
deleted file mode 100644
index 0826c5f2310b..000000000000
--- a/vcl/source/gdi/imgcons.cxx
+++ /dev/null
@@ -1,574 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_vcl.hxx"
-
-#include <tools/stream.hxx>
-#include <vcl/bmpacc.hxx>
-#include <vcl/bitmapex.hxx>
-#include <vcl/image.hxx>
-#include <vcl/imgcons.hxx>
-
-// -------------------
-// - ImplColorMapper -
-// -------------------
-
-class ImplColorMapper
-{
- Color maCol;
- ULONG mnR;
- ULONG mnG;
- ULONG mnB;
- ULONG mnT;
- ULONG mnRShift;
- ULONG mnGShift;
- ULONG mnBShift;
- ULONG mnTShift;
-
- ULONG ImplCalcMaskShift( ULONG nVal );
-
-public:
-
- ImplColorMapper( ULONG nRMask, ULONG nGMask, ULONG nBMask, ULONG nTMask );
- ~ImplColorMapper();
-
- const Color& ImplGetColor( ULONG nColor )
- {
- maCol.SetRed( (UINT8) ( ( nColor & mnR ) >> mnRShift ) );
- maCol.SetGreen( (UINT8) ( ( nColor & mnG ) >> mnGShift ) );
- maCol.SetBlue( (UINT8) ( ( nColor & mnB ) >> mnBShift ) );
- maCol.SetTransparency( (UINT8) ( ( nColor & mnT ) >> mnTShift ) );
- return maCol;
- }
-};
-
-// -----------------------------------------------------------------------------
-
-ImplColorMapper::ImplColorMapper( ULONG nRMask, ULONG nGMask, ULONG nBMask, ULONG nTMask ) :
- mnR( nRMask ),
- mnG( nGMask ),
- mnB( nBMask ),
- mnT( nTMask )
-{
- mnRShift = ImplCalcMaskShift( mnR );
- mnGShift = ImplCalcMaskShift( mnG );
- mnBShift = ImplCalcMaskShift( mnB );
- mnTShift = ImplCalcMaskShift( mnT );
-}
-
-// -----------------------------------------------------------------------------
-
-ImplColorMapper::~ImplColorMapper()
-{
-}
-
-// -----------------------------------------------------------------------------
-
-ULONG ImplColorMapper::ImplCalcMaskShift( ULONG nVal )
-{
- DBG_ASSERT( nVal > 0, "Mask has no value!" );
-
- ULONG nRet = 0UL;
-
- for( ULONG i = 0UL; i < 32; i++ )
- {
- if( nVal & ( 1UL << i ) )
- {
- nRet = i;
- break;
- }
- }
-
- return nRet;
-}
-
-// -----------------
-// - ImageConsumer -
-// -----------------
-
-ImageConsumer::ImageConsumer() :
- mpMapper( NULL ),
- mpPal ( NULL ),
- mnStatus( 0UL ),
- mbTrans ( FALSE )
-{
-}
-
-// -----------------------------------------------------------------------------
-
-ImageConsumer::~ImageConsumer()
-{
- delete[] mpPal;
- delete mpMapper;
-}
-
-// -----------------------------------------------------------------------------
-
-void ImageConsumer::Init( sal_uInt32 nWidth, sal_uInt32 nHeight )
-{
- maSize = Size( nWidth, nHeight );
- maBitmap = maMask = Bitmap();
- mnStatus = 0UL;
- mbTrans = FALSE;
-}
-
-// -----------------------------------------------------------------------------
-
-void ImageConsumer::SetColorModel( USHORT nBitCount,
- sal_uInt32 nPalEntries, const sal_uInt32* pRGBAPal,
- sal_uInt32 nRMask, sal_uInt32 nGMask, sal_uInt32 nBMask, sal_uInt32 nAMask )
-{
- DBG_ASSERT( maSize.Width() && maSize.Height(), "Missing call to ImageConsumer::Init(...)!" );
-
- BitmapPalette aPal( Min( (USHORT) nPalEntries, (USHORT) 256 ) );
-
- if( nPalEntries )
- {
- BitmapColor aCol;
- const sal_Int32* pTmp = (sal_Int32*) pRGBAPal;
-
- delete mpMapper;
- mpMapper = NULL;
-
- delete[] mpPal;
- mpPal = new Color[ nPalEntries ];
-
- for( ULONG i = 0; i < nPalEntries; i++, pTmp++ )
- {
- Color& rCol = mpPal[ i ];
- BYTE cVal;
-
- cVal = (BYTE) ( ( *pTmp & 0xff000000UL ) >> 24L );
- rCol.SetRed( cVal );
-
- if( i < (ULONG) aPal.GetEntryCount() )
- aPal[ (USHORT) i ].SetRed( cVal );
-
- cVal = (BYTE) ( ( *pTmp & 0x00ff0000UL ) >> 16L );
- rCol.SetGreen( cVal );
-
- if( i < (ULONG) aPal.GetEntryCount() )
- aPal[ (USHORT) i ].SetGreen( cVal );
-
- cVal = (BYTE) ( ( *pTmp & 0x0000ff00UL ) >> 8L );
- rCol.SetBlue( cVal );
-
- if( i < (ULONG) aPal.GetEntryCount() )
- aPal[ (USHORT) i ].SetBlue( cVal );
-
- rCol.SetTransparency( (BYTE) ( ( *pTmp & 0x000000ffL ) ) );
- }
-
- if( nBitCount <= 1 )
- nBitCount = 1;
- else if( nBitCount <= 4 )
- nBitCount = 4;
- else if( nBitCount <= 8 )
- nBitCount = 8;
- else
- nBitCount = 24;
- }
- else
- {
- delete mpMapper;
- mpMapper = new ImplColorMapper( nRMask, nGMask, nBMask, nAMask );
-
- delete[] mpPal;
- mpPal = NULL;
-
- nBitCount = 24;
- }
-
- if( !maBitmap )
- {
-
- maBitmap = Bitmap( maSize, nBitCount, &aPal );
- maMask = Bitmap( maSize, 1 );
- maMask.Erase( COL_BLACK );
- mbTrans = FALSE;
- }
-}
-
-// -----------------------------------------------------------------------------
-
-void ImageConsumer::SetPixelsByBytes( sal_uInt32 nConsX, sal_uInt32 nConsY,
- sal_uInt32 nConsWidth, sal_uInt32 nConsHeight,
- const BYTE* pData, sal_uInt32 nOffset, sal_uInt32 nScanSize )
-{
- DBG_ASSERT( !!maBitmap && !!maMask, "Missing call to ImageConsumer::SetColorModel(...)!" );
-
- BitmapWriteAccess* pBmpAcc = maBitmap.AcquireWriteAccess();
- BitmapWriteAccess* pMskAcc = maMask.AcquireWriteAccess();
- sal_Bool bDataChanged = sal_False;
-
- if( pBmpAcc && pMskAcc )
- {
- const long nWidth = pBmpAcc->Width();
- const long nHeight = pBmpAcc->Height();
-
- maChangedRect = Rectangle( Point(), Size( nWidth, nHeight ) );
- maChangedRect.Intersection( Rectangle( Point( nConsX, nConsY ), Size( nConsWidth, nConsHeight ) ) );
-
- if( !maChangedRect.IsEmpty() )
- {
- const long nStartX = maChangedRect.Left();
- const long nEndX = maChangedRect.Right();
- const long nStartY = maChangedRect.Top();
- const long nEndY = maChangedRect.Bottom();
-
- if( mpMapper && ( pBmpAcc->GetBitCount() > 8 ) )
- {
- BitmapColor aCol;
- BitmapColor aMskWhite( pMskAcc->GetBestMatchingColor( Color( COL_WHITE ) ) );
-
- for( long nY = nStartY; nY <= nEndY; nY++ )
- {
- const BYTE* pTmp = pData + ( nY - nStartY ) * nScanSize + nOffset;
-
- for( long nX = nStartX; nX <= nEndX; nX++ )
- {
- const Color& rCol = mpMapper->ImplGetColor( *pTmp++ );
-
- // 0: Transparent; >0: Non-Transparent
- if( !rCol.GetTransparency() )
- {
- pMskAcc->SetPixel( nY, nX, aMskWhite );
- mbTrans = TRUE;
- }
- else
- {
- aCol.SetRed( rCol.GetRed() );
- aCol.SetGreen( rCol.GetGreen() );
- aCol.SetBlue( rCol.GetBlue() );
- pBmpAcc->SetPixel( nY, nX, aCol );
- }
- }
- }
-
- bDataChanged = sal_True;
- }
- else if( mpPal && ( pBmpAcc->GetBitCount() <= 8 ) )
- {
- BitmapColor aIndex( (BYTE) 0 );
- BitmapColor aMskWhite( pMskAcc->GetBestMatchingColor( Color( COL_WHITE ) ) );
-
- for( long nY = nStartY; nY <= nEndY; nY++ )
- {
- const BYTE* pTmp = pData + ( nY - nStartY ) * nScanSize + nOffset;
-
- for( long nX = nStartX; nX <= nEndX; nX++ )
- {
- const BYTE cIndex = *pTmp++;
- const Color& rCol = mpPal[ cIndex ];
-
- // 0: Transparent; >0: Non-Transparent
- if( !rCol.GetTransparency() )
- {
- pMskAcc->SetPixel( nY, nX, aMskWhite );
- mbTrans = TRUE;
- }
- else
- {
- aIndex.SetIndex( cIndex );
- pBmpAcc->SetPixel( nY, nX, aIndex );
- }
- }
- }
-
- bDataChanged = sal_True;
- }
- else if( mpPal && ( pBmpAcc->GetBitCount() > 8 ) )
- {
- BitmapColor aCol;
- BitmapColor aMskWhite( pMskAcc->GetBestMatchingColor( Color( COL_WHITE ) ) );
-
- for( long nY = nStartY; nY <= nEndY; nY++ )
- {
- const BYTE* pTmp = pData + ( nY - nStartY ) * nScanSize + nOffset;
-
- for( long nX = nStartX; nX <= nEndX; nX++ )
- {
- const BYTE cIndex = *pTmp++;
- const Color& rCol = mpPal[ cIndex ];
-
- // 0: Transparent; >0: Non-Transparent
- if( !rCol.GetTransparency() )
- {
- pMskAcc->SetPixel( nY, nX, aMskWhite );
- mbTrans = TRUE;
- }
- else
- {
- aCol.SetRed( rCol.GetRed() );
- aCol.SetGreen( rCol.GetGreen() );
- aCol.SetBlue( rCol.GetBlue() );
- pBmpAcc->SetPixel( nY, nX, aCol );
- }
- }
- }
-
- bDataChanged = sal_True;
- }
- else
- {
- DBG_ERROR( "Producer format error!" );
- maChangedRect.SetEmpty();
- }
- }
- }
- else
- maChangedRect.SetEmpty();
-
- maBitmap.ReleaseAccess( pBmpAcc );
- maMask.ReleaseAccess( pMskAcc );
-
- if( bDataChanged )
- DataChanged();
-}
-
-// -----------------------------------------------------------------------------
-
-void ImageConsumer::SetPixelsByLongs( sal_uInt32 nConsX, sal_uInt32 nConsY,
- sal_uInt32 nConsWidth, sal_uInt32 nConsHeight,
- const sal_uInt32* pData, sal_uInt32 nOffset, sal_uInt32 nScanSize )
-{
- DBG_ASSERT( !!maBitmap && !!maMask, "Missing call to ImageConsumer::SetColorModel(...)!" );
-
- BitmapWriteAccess* pBmpAcc = maBitmap.AcquireWriteAccess();
- BitmapWriteAccess* pMskAcc = maMask.AcquireWriteAccess();
- sal_Bool bDataChanged = sal_False;
-
- if( pBmpAcc && pMskAcc )
- {
- const long nWidth = pBmpAcc->Width();
- const long nHeight = pBmpAcc->Height();
-
- maChangedRect = Rectangle( Point(), Size( nWidth, nHeight ) );
- maChangedRect.Intersection( Rectangle( Point( nConsX, nConsY ), Size( nConsWidth, nConsHeight ) ) );
-
- if( !maChangedRect.IsEmpty() )
- {
- const long nStartX = maChangedRect.Left();
- const long nEndX = maChangedRect.Right();
- const long nStartY = maChangedRect.Top();
- const long nEndY = maChangedRect.Bottom();
-
- if( mpMapper && ( pBmpAcc->GetBitCount() > 8 ) )
- {
- BitmapColor aCol;
- BitmapColor aMskWhite( pMskAcc->GetBestMatchingColor( Color( COL_WHITE ) ) );
-
- for( long nY = nStartY; nY <= nEndY; nY++ )
- {
- const sal_Int32* pTmp = (sal_Int32*) pData + ( nY - nStartY ) * nScanSize + nOffset;
-
- for( long nX = nStartX; nX <= nEndX; nX++ )
- {
- const Color& rCol = mpMapper->ImplGetColor( *pTmp++ );
-
- // 0: Transparent; >0: Non-Transparent
- if( !rCol.GetTransparency() )
- {
- pMskAcc->SetPixel( nY, nX, aMskWhite );
- mbTrans = TRUE;
- }
- else
- {
- aCol.SetRed( rCol.GetRed() );
- aCol.SetGreen( rCol.GetGreen() );
- aCol.SetBlue( rCol.GetBlue() );
- pBmpAcc->SetPixel( nY, nX, aCol );
- }
- }
- }
-
- bDataChanged = sal_True;
- }
- else if( mpPal && ( pBmpAcc->GetBitCount() <= 8 ) )
- {
- BitmapColor aIndex( (BYTE) 0 );
- BitmapColor aMskWhite( pMskAcc->GetBestMatchingColor( Color( COL_WHITE ) ) );
-
- for( long nY = nStartY; nY <= nEndY; nY++ )
- {
- const sal_Int32* pTmp = (sal_Int32*) pData + ( nY - nStartY ) * nScanSize + nOffset;
-
- for( long nX = nStartX; nX <= nEndX; nX++ )
- {
- const sal_Int32 nIndex = *pTmp++;
- const Color& rCol = mpPal[ nIndex ];
-
- // 0: Transparent; >0: Non-Transparent
- if( !rCol.GetTransparency() )
- {
- pMskAcc->SetPixel( nY, nX, aMskWhite );
- mbTrans = TRUE;
- }
- else
- {
- aIndex.SetIndex( (BYTE) nIndex );
- pBmpAcc->SetPixel( nY, nX, aIndex );
- }
- }
- }
-
- bDataChanged = sal_True;
- }
- else if( mpPal && ( pBmpAcc->GetBitCount() > 8 ) )
- {
- BitmapColor aCol;
- BitmapColor aMskWhite( pMskAcc->GetBestMatchingColor( Color( COL_WHITE ) ) );
-
- for( long nY = nStartY; nY <= nEndY; nY++ )
- {
- const sal_Int32* pTmp = (sal_Int32*) pData + ( nY - nStartY ) * nScanSize + nOffset;
-
- for( long nX = nStartX; nX <= nEndX; nX++ )
- {
- const sal_Int32 nIndex = *pTmp++;
- const Color& rCol = mpPal[ nIndex ];
-
- // 0: Transparent; >0: Non-Transparent
- if( !rCol.GetTransparency() )
- {
- pMskAcc->SetPixel( nY, nX, aMskWhite );
- mbTrans = TRUE;
- }
- else
- {
- aCol.SetRed( rCol.GetRed() );
- aCol.SetGreen( rCol.GetGreen() );
- aCol.SetBlue( rCol.GetBlue() );
- pBmpAcc->SetPixel( nY, nX, aCol );
- }
- }
- }
-
- bDataChanged = sal_True;
- }
- else
- {
- DBG_ERROR( "Producer format error!" );
- maChangedRect.SetEmpty();
- }
- }
- }
- else
- maChangedRect.SetEmpty();
-
- maBitmap.ReleaseAccess( pBmpAcc );
- maMask.ReleaseAccess( pMskAcc );
-
- if( bDataChanged )
- DataChanged();
-}
-
-// -----------------------------------------------------------------------------
-
-void ImageConsumer::Completed( sal_uInt32 nStatus /*, ImageProducer& rProducer */ )
-{
- delete mpMapper;
- mpMapper = NULL;
- delete[] mpPal;
- mpPal = NULL;
- maSize = Size();
- mnStatus = nStatus;
-
- switch( nStatus )
- {
- case( SINGLEFRAMEDONE ):
- case( STATICIMAGEDONE ):
- {
- if( !mbTrans )
- maMask = Bitmap();
- }
- break;
-
- case( IMAGEERROR ):
- case( IMAGEABORTED ):
- maBitmap = maMask = Bitmap();
- break;
-
- default:
- break;
- }
-
-// rProducer.RemoveConsumer( *this );
-
- if( maDoneLink.IsSet() )
- maDoneLink.Call( this );
-}
-
-// -----------------------------------------------------------------------------
-
-void ImageConsumer::DataChanged()
-{
- if( maChgLink.IsSet() )
- maChgLink.Call( this );
-}
-
-// -----------------------------------------------------------------------------
-
-sal_uInt32 ImageConsumer::GetStatus() const
-{
- return mnStatus;
-}
-
-// -----------------------------------------------------------------------------
-
-BOOL ImageConsumer::GetData( BitmapEx& rBmpEx ) const
-{
- const BOOL bRet = ( SINGLEFRAMEDONE == mnStatus || STATICIMAGEDONE == mnStatus );
-
- if( bRet )
- {
- if( !!maMask )
- rBmpEx = BitmapEx( maBitmap, maMask );
- else
- rBmpEx = BitmapEx( maBitmap );
- }
-
- return bRet;
-}
-
-// -----------------------------------------------------------------------------
-
-BOOL ImageConsumer::GetData( Image& rImage ) const
-{
- const BOOL bRet = ( SINGLEFRAMEDONE == mnStatus || STATICIMAGEDONE == mnStatus );
-
- if( bRet )
- {
- if( !!maMask )
- rImage = Image( maBitmap, maMask );
- else
- rImage = Image( maBitmap );
- }
-
- return bRet;
-}
diff --git a/vcl/source/gdi/makefile.mk b/vcl/source/gdi/makefile.mk
index 55d09d266019..77df20976c73 100644
--- a/vcl/source/gdi/makefile.mk
+++ b/vcl/source/gdi/makefile.mk
@@ -85,7 +85,6 @@ SLOFILES= $(EXCEPTIONSFILES) \
$(SLO)$/bitmap4.obj \
$(SLO)$/alpha.obj \
$(SLO)$/bitmapex.obj \
- $(SLO)$/imgcons.obj \
$(SLO)$/bmpacc.obj \
$(SLO)$/bmpacc2.obj \
$(SLO)$/bmpacc3.obj \
diff --git a/vcl/source/gdi/outdev2.cxx b/vcl/source/gdi/outdev2.cxx
index 3826a3dbc7b0..bea307a4c38d 100644
--- a/vcl/source/gdi/outdev2.cxx
+++ b/vcl/source/gdi/outdev2.cxx
@@ -1614,6 +1614,18 @@ void OutputDevice::DrawPixel( const Polygon& rPts, const Color& rColor )
// ------------------------------------------------------------------------
+namespace
+{
+ BYTE lcl_calcColor( const BYTE nSourceColor, const BYTE nSourceOpaq, const BYTE nDestColor )
+ {
+ int c = ( (int)nDestColor * ( 255 - nSourceOpaq ) )
+ + (int)nSourceOpaq * (int)nSourceColor;
+ return BYTE( c / 255 );
+ }
+}
+
+// ------------------------------------------------------------------------
+
Bitmap OutputDevice::ImplBlendWithAlpha( Bitmap aBmp,
BitmapReadAccess* pP,
BitmapReadAccess* pA,
@@ -1626,7 +1638,6 @@ Bitmap OutputDevice::ImplBlendWithAlpha( Bitmap aBmp,
const long* pMapY )
{
BitmapColor aDstCol,aSrcCol;
- BYTE nSrcAlpha, nDstAlpha;
Bitmap res;
int nX, nOutX, nY, nOutY;
@@ -1660,36 +1671,23 @@ Bitmap OutputDevice::ImplBlendWithAlpha( Bitmap aBmp,
aSrcCol = pP->GetColor( nMapY, nMapX );
aDstCol = pB->GetColor( nY, nX );
- nSrcAlpha = 255 - pA->GetPixel( nMapY, nMapX ).GetBlueOrIndex();
- nDstAlpha = 255 - pAlphaW->GetPixel( nY, nX ).GetBlueOrIndex();
+ const BYTE nSrcOpaq = 255 - pA->GetPixel( nMapY, nMapX ).GetBlueOrIndex();
+ const BYTE nDstOpaq = 255 - pAlphaW->GetPixel( nY, nX ).GetBlueOrIndex();
- if( nSrcAlpha + nDstAlpha == 0 )
- {
- // #i70653# zero alpha -> zero color values
- aIndex.SetIndex( (BYTE) ( nVCLRLut[ ( nVCLLut[ 0 ] + nD ) >> 16UL ] +
- nVCLGLut[ ( nVCLLut[ 0 ] + nD ) >> 16UL ] +
- nVCLBLut[ ( nVCLLut[ 0 ] + nD ) >> 16UL ] ) );
- }
- else
- {
- aDstCol.SetRed( (BYTE)(((int)(aSrcCol.GetRed())*nSrcAlpha + (int)(aDstCol.GetRed())*nDstAlpha) /
- (nSrcAlpha+nDstAlpha)) );
- aDstCol.SetGreen( (BYTE)(((int)(aSrcCol.GetGreen())*nSrcAlpha + (int)(aDstCol.GetGreen())*nDstAlpha) /
- (nSrcAlpha+nDstAlpha)) );
- aDstCol.SetBlue( (BYTE)(((int)(aSrcCol.GetBlue())*nSrcAlpha + (int)(aDstCol.GetBlue())*nDstAlpha) /
- (nSrcAlpha+nDstAlpha)) );
-
- aIndex.SetIndex( (BYTE) ( nVCLRLut[ ( nVCLLut[ aDstCol.GetRed() ] + nD ) >> 16UL ] +
- nVCLGLut[ ( nVCLLut[ aDstCol.GetGreen() ] + nD ) >> 16UL ] +
- nVCLBLut[ ( nVCLLut[ aDstCol.GetBlue() ] + nD ) >> 16UL ] ) );
- }
+ aDstCol.SetRed( lcl_calcColor( aSrcCol.GetRed(), nSrcOpaq, aDstCol.GetRed() ) );
+ aDstCol.SetBlue( lcl_calcColor( aSrcCol.GetBlue(), nSrcOpaq, aDstCol.GetBlue() ) );
+ aDstCol.SetGreen( lcl_calcColor( aSrcCol.GetGreen(), nSrcOpaq, aDstCol.GetGreen() ) );
+
+ aIndex.SetIndex( (BYTE) ( nVCLRLut[ ( nVCLLut[ aDstCol.GetRed() ] + nD ) >> 16UL ] +
+ nVCLGLut[ ( nVCLLut[ aDstCol.GetGreen() ] + nD ) >> 16UL ] +
+ nVCLBLut[ ( nVCLLut[ aDstCol.GetBlue() ] + nD ) >> 16UL ] ) );
pW->SetPixel( nY, nX, aIndex );
// Have to perform the compositing 'algebra' in
// the inverse alpha space (with 255 meaning
// opaque), otherwise, transitivity is not
// achieved.
- nSrcAlpha = 255-COLOR_CHANNEL_MERGE( 255, (BYTE)nDstAlpha, nSrcAlpha );
+ const BYTE nSrcAlpha = 255-COLOR_CHANNEL_MERGE( 255, (BYTE)nDstOpaq, nSrcOpaq );
aIndex.SetIndex( (BYTE) ( nVCLRLut[ ( nVCLLut[ nSrcAlpha ] + nD ) >> 16UL ] +
nVCLGLut[ ( nVCLLut[ nSrcAlpha ] + nD ) >> 16UL ] +
@@ -1718,25 +1716,12 @@ Bitmap OutputDevice::ImplBlendWithAlpha( Bitmap aBmp,
aSrcCol = pP->GetColor( nMapY, nMapX );
aDstCol = pB->GetColor( nY, nX );
- nSrcAlpha = 255 - pA->GetPixel( nMapY, nMapX ).GetBlueOrIndex();
- nDstAlpha = 255 - pAlphaW->GetPixel( nY, nX ).GetBlueOrIndex();
+ const BYTE nSrcOpaq = 255 - pA->GetPixel( nMapY, nMapX ).GetBlueOrIndex();
+ const BYTE nDstOpaq = 255 - pAlphaW->GetPixel( nY, nX ).GetBlueOrIndex();
- if( nSrcAlpha + nDstAlpha == 0 )
- {
- // #i70653# zero alpha -> zero color values
- aDstCol.SetRed(0);
- aDstCol.SetGreen(0);
- aDstCol.SetBlue(0);
- }
- else
- {
- aDstCol.SetRed( (BYTE)(((int)(aSrcCol.GetRed())*nSrcAlpha + (int)(aDstCol.GetRed())*nDstAlpha) /
- (nSrcAlpha+nDstAlpha)) );
- aDstCol.SetGreen( (BYTE)(((int)(aSrcCol.GetGreen())*nSrcAlpha + (int)(aDstCol.GetGreen())*nDstAlpha) /
- (nSrcAlpha+nDstAlpha)) );
- aDstCol.SetBlue( (BYTE)(((int)(aSrcCol.GetBlue())*nSrcAlpha + (int)(aDstCol.GetBlue())*nDstAlpha) /
- (nSrcAlpha+nDstAlpha)) );
- }
+ aDstCol.SetRed( lcl_calcColor( aSrcCol.GetRed(), nSrcOpaq, aDstCol.GetRed() ) );
+ aDstCol.SetBlue( lcl_calcColor( aSrcCol.GetBlue(), nSrcOpaq, aDstCol.GetBlue() ) );
+ aDstCol.SetGreen( lcl_calcColor( aSrcCol.GetGreen(), nSrcOpaq, aDstCol.GetGreen() ) );
pB->SetPixel( nY, nX, aDstCol );
@@ -1744,7 +1729,7 @@ Bitmap OutputDevice::ImplBlendWithAlpha( Bitmap aBmp,
// the inverse alpha space (with 255 meaning
// opaque), otherwise, transitivity is not
// achieved.
- nSrcAlpha = 255-COLOR_CHANNEL_MERGE( 255, (BYTE)nDstAlpha, nSrcAlpha );
+ const BYTE nSrcAlpha = 255-COLOR_CHANNEL_MERGE( 255, (BYTE)nDstOpaq, nSrcOpaq );
pAlphaW->SetPixel( nY, nX, Color(nSrcAlpha, nSrcAlpha, nSrcAlpha) );
}
diff --git a/vcl/source/gdi/outdev6.cxx b/vcl/source/gdi/outdev6.cxx
index 2ef8682d10ac..5b8d228bb141 100644
--- a/vcl/source/gdi/outdev6.cxx
+++ b/vcl/source/gdi/outdev6.cxx
@@ -345,6 +345,12 @@ void OutputDevice::DrawTransparent( const PolyPolygon& rPolyPoly,
if( OUTDEV_PRINTER == meOutDevType )
{
+ if(100 <= nTransparencePercent)
+ {
+ // #i112959# 100% transparent, draw nothing
+ return;
+ }
+
Rectangle aPolyRect( LogicToPixel( rPolyPoly ).GetBoundRect() );
const Size aDPISize( LogicToPixel( Size( 1, 1 ), MAP_INCH ) );
const long nBaseExtent = Max( FRound( aDPISize.Width() / 300. ), 1L );
@@ -359,30 +365,40 @@ void OutputDevice::DrawTransparent( const PolyPolygon& rPolyPoly,
case( 25 ): nMove = nBaseExtent * 3; break;
case( 50 ): nMove = nBaseExtent * 4; break;
case( 75 ): nMove = nBaseExtent * 6; break;
- // TODO What is the correct VALUE???
+
+ // #i112959# very transparent (88 < nTransparencePercent <= 99)
+ case( 100 ): nMove = nBaseExtent * 8; break;
+
+ // #i112959# not transparent (nTransparencePercent < 13)
default: nMove = 0; break;
}
Push( PUSH_CLIPREGION | PUSH_LINECOLOR );
IntersectClipRegion( rPolyPoly );
SetLineColor( GetFillColor() );
-
- Rectangle aRect( aPolyRect.TopLeft(), Size( aPolyRect.GetWidth(), nBaseExtent ) );
-
const BOOL bOldMap = mbMap;
EnableMapMode( FALSE );
- while( aRect.Top() <= aPolyRect.Bottom() )
+ if(nMove)
{
- DrawRect( aRect );
- aRect.Move( 0, nMove );
- }
+ Rectangle aRect( aPolyRect.TopLeft(), Size( aPolyRect.GetWidth(), nBaseExtent ) );
+ while( aRect.Top() <= aPolyRect.Bottom() )
+ {
+ DrawRect( aRect );
+ aRect.Move( 0, nMove );
+ }
- aRect = Rectangle( aPolyRect.TopLeft(), Size( nBaseExtent, aPolyRect.GetHeight() ) );
- while( aRect.Left() <= aPolyRect.Right() )
+ aRect = Rectangle( aPolyRect.TopLeft(), Size( nBaseExtent, aPolyRect.GetHeight() ) );
+ while( aRect.Left() <= aPolyRect.Right() )
+ {
+ DrawRect( aRect );
+ aRect.Move( nMove, 0 );
+ }
+ }
+ else
{
- DrawRect( aRect );
- aRect.Move( nMove, 0 );
+ // #i112959# if not transparent, draw full rectangle in clip region
+ DrawRect( aPolyRect );
}
EnableMapMode( bOldMap );
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 6cb0a7d07697..7b7f3bbcb4d3 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -32,6 +32,7 @@
#include <math.h>
#include <algorithm>
+#include <tools/urlobj.hxx>
#include <pdfwriter_impl.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/polygon/b2dpolypolygon.hxx>
diff --git a/vcl/source/glyphs/graphite_adaptors.cxx b/vcl/source/glyphs/graphite_adaptors.cxx
index f66f5b48e39e..f82e3afe39c8 100644
--- a/vcl/source/glyphs/graphite_adaptors.cxx
+++ b/vcl/source/glyphs/graphite_adaptors.cxx
@@ -99,12 +99,18 @@ FontProperties::FontProperties(const FreetypeServerFont &font) throw()
fItalic = false;
}
- // Get the font name.
+ // Get the font name, but prefix with file name hash in case
+ // there are 2 fonts on the system with the same face name
+ sal_Int32 nHashCode = font.GetFontFileName()->hashCode();
+ ::rtl::OUStringBuffer nHashFaceName;
+ nHashFaceName.append(nHashCode, 16);
const sal_Unicode * name = font.GetFontSelData().maName.GetBuffer();
- const size_t name_sz = std::min(sizeof szFaceName/sizeof(wchar_t)-1,
- size_t(font.GetFontSelData().maName.Len()));
+ nHashFaceName.append(name);
- std::copy(name, name + name_sz, szFaceName);
+ const size_t name_sz = std::min(sizeof szFaceName/sizeof(wchar_t)-1,
+ static_cast<size_t>(nHashFaceName.getLength()));
+
+ std::copy(nHashFaceName.getStr(), nHashFaceName.getStr() + name_sz, szFaceName);
szFaceName[name_sz] = '\0';
}
@@ -120,13 +126,13 @@ GraphiteFontAdaptor::GraphiteFontAdaptor(ServerFont & sfont, const sal_Int32 dpi
mfEmUnits(static_cast<FreetypeServerFont &>(sfont).GetMetricsFT().y_ppem),
mpFeatures(NULL)
{
- //std::wstring face_name(maFontProperties.szFaceName);
const rtl::OString aLang = MsLangId::convertLanguageToIsoByteString( sfont.GetFontSelData().meLanguage );
-#ifdef DEBUG
- printf("GraphiteFontAdaptor %lx\n", (long)this);
-#endif
rtl::OString name = rtl::OUStringToOString(
sfont.GetFontSelData().maTargetName, RTL_TEXTENCODING_UTF8 );
+#ifdef DEBUG
+ printf("GraphiteFontAdaptor %lx %s italic=%u bold=%u\n", (long)this, name.getStr(),
+ maFontProperties.fItalic, maFontProperties.fBold);
+#endif
sal_Int32 nFeat = name.indexOf(grutils::GrFeatureParser::FEAT_PREFIX) + 1;
if (nFeat > 0)
{
@@ -259,21 +265,24 @@ const void * GraphiteFontAdaptor::getTable(gr::fontTableId32 table_id, size_t *
// Return the glyph's metrics in pixels.
void GraphiteFontAdaptor::getGlyphMetrics(gr::gid16 nGlyphId, gr::Rect & aBounding, gr::Point & advances)
{
- // Graphite gets really confused if the glyphs have been transformed, so
- // if orientation has been set we can't use the font's glyph cache
- // unfortunately the font selection data, doesn't always have the orientation
- // set, even if it was when the glyphs were cached, so we use our own cache.
-
-// const GlyphMetric & metric = mrFont.GetGlyphMetric(nGlyphId);
-//
-// aBounding.right = aBounding.left = metric.GetOffset().X();
-// aBounding.bottom = aBounding.top = -metric.GetOffset().Y();
-// aBounding.right += metric.GetSize().Width();
-// aBounding.bottom -= metric.GetSize().Height();
-//
-// advances.x = metric.GetDelta().X();
-// advances.y = -metric.GetDelta().Y();
-
+ // There used to be problems when orientation was set however, this no
+ // longer seems to be the case and the Glyph Metric cache in
+ // FreetypeServerFont is more efficient since it lasts between calls to VCL
+#if 1
+ const GlyphMetric & metric = mrFont.GetGlyphMetric(nGlyphId);
+
+ aBounding.right = aBounding.left = metric.GetOffset().X();
+ aBounding.bottom = aBounding.top = -metric.GetOffset().Y();
+ aBounding.right += metric.GetSize().Width();
+ aBounding.bottom -= metric.GetSize().Height();
+
+ advances.x = metric.GetDelta().X();
+ advances.y = -metric.GetDelta().Y();
+
+#else
+ // The problem with the code below is that the cache only lasts
+ // as long as the life time of the GraphiteFontAdaptor, which
+ // is created once per call to X11SalGraphics::GetTextLayout
GlyphMetricMap::const_iterator gm_itr = maGlyphMetricMap.find(nGlyphId);
if (gm_itr != maGlyphMetricMap.end())
{
@@ -321,6 +330,7 @@ void GraphiteFontAdaptor::getGlyphMetrics(gr::gid16 nGlyphId, gr::Rect & aBoundi
// Now add an entry to our metrics map.
maGlyphMetricMap[nGlyphId] = std::make_pair(aBounding, advances);
}
+#endif
}
#endif
diff --git a/vcl/source/glyphs/graphite_cache.cxx b/vcl/source/glyphs/graphite_cache.cxx
index 64bbb0a38d60..389accd631f0 100644
--- a/vcl/source/glyphs/graphite_cache.cxx
+++ b/vcl/source/glyphs/graphite_cache.cxx
@@ -105,7 +105,7 @@ GrSegRecord * GraphiteSegmentCache::cacheSegment(TextSourceAdaptor * adapter, gr
// when the next key is added, the record for the prevKey's m_nextKey field
// is updated to the newest key so that m_oldestKey can be updated to the
// next oldest key when the record for m_oldestKey is deleted
- if (m_segMap.size() > SEG_CACHE_SIZE)
+ if (m_segMap.size() > m_nSegCacheSize)
{
GraphiteSegMap::iterator oldestPair = m_segMap.find(reinterpret_cast<long>(m_oldestKey));
// oldest record may no longer exist if a buffer was changed
diff --git a/vcl/source/glyphs/graphite_layout.cxx b/vcl/source/glyphs/graphite_layout.cxx
index ff2fd8f306b1..ae7ec8246e33 100644
--- a/vcl/source/glyphs/graphite_layout.cxx
+++ b/vcl/source/glyphs/graphite_layout.cxx
@@ -56,6 +56,10 @@
#include <svsys.h>
#endif
+#ifdef UNX
+#include <vcl/graphite_adaptors.hxx>
+#endif
+
#include <vcl/salgdi.hxx>
#include <unicode/uchar.h>
@@ -175,7 +179,8 @@ GraphiteLayout::Glyphs::fill_from(gr::Segment & rSegment, ImplLayoutArgs &rArgs,
glyph_range_t iGlyphs = rSegment.glyphs();
int nGlyphs = iGlyphs.second - iGlyphs.first;
gr::GlyphIterator prevBase = iGlyphs.second;
- float fMinX = rSegment.advanceWidth();
+ float fSegmentAdvance = rSegment.advanceWidth();
+ float fMinX = fSegmentAdvance;
float fMaxX = 0.0f;
rGlyph2Char.assign(nGlyphs, -1);
long nDxOffset = 0;
@@ -222,7 +227,8 @@ GraphiteLayout::Glyphs::fill_from(gr::Segment & rSegment, ImplLayoutArgs &rArgs,
nFirstGlyphInCluster != nGlyphIndex)
{
std::pair <float,float> aBounds =
- appendCluster(rSegment, rArgs, bRtl, nFirstCharInCluster,
+ appendCluster(rSegment, rArgs, bRtl,
+ fSegmentAdvance, nFirstCharInCluster,
nNextChar, nFirstGlyphInCluster, nGlyphIndex, fScaling,
rChar2Base, rGlyph2Char, rCharDxs, nDxOffset);
fMinX = std::min(aBounds.first, fMinX);
@@ -285,7 +291,8 @@ GraphiteLayout::Glyphs::fill_from(gr::Segment & rSegment, ImplLayoutArgs &rArgs,
nFirstGlyphInCluster != nGlyphIndex)
{
std::pair <float,float> aBounds =
- appendCluster(rSegment, rArgs, bRtl, nFirstCharInCluster, nNextChar,
+ appendCluster(rSegment, rArgs, bRtl, fSegmentAdvance,
+ nFirstCharInCluster, nNextChar,
nFirstGlyphInCluster, nGlyphIndex, fScaling,
rChar2Base, rGlyph2Char, rCharDxs, nDxOffset);
fMinX = std::min(aBounds.first, fMinX);
@@ -334,11 +341,11 @@ GraphiteLayout::Glyphs::fill_from(gr::Segment & rSegment, ImplLayoutArgs &rArgs,
}
}
-std::pair<float,float> GraphiteLayout::Glyphs::appendCluster(gr::Segment & rSeg,
- ImplLayoutArgs & rArgs, bool bRtl, int nFirstCharInCluster, int nNextChar,
- int nFirstGlyphInCluster, int nNextGlyph, float fScaling,
- std::vector<int> & rChar2Base, std::vector<int> & rGlyph2Char,
- std::vector<int> & rCharDxs, long & rDXOffset)
+std::pair<float,float> GraphiteLayout::Glyphs::appendCluster(gr::Segment& rSeg,
+ ImplLayoutArgs & rArgs, bool bRtl,float fSegmentAdvance,
+ int nFirstCharInCluster, int nNextChar, int nFirstGlyphInCluster,
+ int nNextGlyph, float fScaling, std::vector<int> & rChar2Base,
+ std::vector<int> & rGlyph2Char, std::vector<int> & rCharDxs, long & rDXOffset)
{
glyph_range_t iGlyphs = rSeg.glyphs();
int nGlyphs = iGlyphs.second - iGlyphs.first;
@@ -402,9 +409,9 @@ std::pair<float,float> GraphiteLayout::Glyphs::appendCluster(gr::Segment & rSeg,
gr::GlyphInfo aGlyph = *(iGlyphs.first + j);
if (j + nDelta >= nGlyphs || j + nDelta < 0) // at rhs ltr,rtl
{
- fNextOrigin = rSeg.advanceWidth();
- nNextOrigin = round(rSeg.advanceWidth() * fScaling + rDXOffset);
- aBounds.second = std::max(rSeg.advanceWidth(), aBounds.second);
+ fNextOrigin = fSegmentAdvance;
+ nNextOrigin = round(fSegmentAdvance * fScaling + rDXOffset);
+ aBounds.second = std::max(fSegmentAdvance, aBounds.second);
}
else
{
@@ -546,7 +553,7 @@ GraphiteLayout::GraphiteLayout(const gr::Font & font, const grutils::GrFeaturePa
// If true, it can cause end of line spaces to be hidden e.g. Doulos SIL
maLayout.setStartOfLine(false);
maLayout.setEndOfLine(false);
-// maLayout.setDumbFallback(false);
+ maLayout.setDumbFallback(true);
// trailing ws doesn't seem to always take affect if end of line is true
maLayout.setTrailingWs(gr::ktwshAll);
#ifdef GRLAYOUT_DEBUG
@@ -598,6 +605,8 @@ bool GraphiteLayout::LayoutText(ImplLayoutArgs & rArgs)
else delete pSegment;
#else
gr::Segment * pSegment = CreateSegment(rArgs);
+ if (!pSegment)
+ return false;
bool success = LayoutGlyphs(rArgs, pSegment);
delete pSegment;
#endif
@@ -649,7 +658,19 @@ public:
#endif
return hash;
};
-
+protected:
+ virtual void UniqueCacheInfo(std::wstring & stuFace, bool & fBold, bool & fItalic)
+ {
+#ifdef WIN32
+ dynamic_cast<GraphiteWinFont&>(mrRealFont).UniqueCacheInfo(stuFace, fBold, fItalic);
+#else
+#ifdef UNX
+ dynamic_cast<GraphiteFontAdaptor&>(mrRealFont).UniqueCacheInfo(stuFace, fBold, fItalic);
+#else
+#error Unknown base type for gr::Font::UniqueCacheInfo
+#endif
+#endif
+ }
private:
gr::Font & mrRealFont;
};
@@ -738,6 +759,14 @@ gr::Segment * GraphiteLayout::CreateSegment(ImplLayoutArgs& rArgs)
}
else
{
+#ifdef GRLAYOUT_DEBUG
+ fprintf(grLog(), "Gr::LayoutText failed: ");
+ for (int i = mnMinCharPos; i < limit; i++)
+ {
+ fprintf(grLog(), "%04x ", rArgs.mpStr[i]);
+ }
+ fprintf(grLog(), "\n");
+#endif
clear();
return NULL;
}
@@ -897,7 +926,7 @@ long GraphiteLayout::FillDXArray( sal_Int32* pDXArray ) const
if (i > 0) pDXArray[i] -= mvCharDxs[i-1];
}
#ifdef GRLAYOUT_DEBUG
- fprintf(grLog(),"%d,%d,%ld ", (int)i, (int)mvCharDxs[i], pDXArray[i]);
+ fprintf(grLog(),"%d,%d,%d ", (int)i, (int)mvCharDxs[i], pDXArray[i]);
#endif
}
//std::adjacent_difference(mvCharDxs.begin(), mvCharDxs.end(), pDXArray);
@@ -1020,7 +1049,7 @@ void GraphiteLayout::ApplyDXArray(ImplLayoutArgs &args, std::vector<int> & rDelt
#ifdef GRLAYOUT_DEBUG
for (size_t iDx = 0; iDx < mvCharDxs.size(); iDx++)
- fprintf(grLog(),"%d,%d,%ld ", (int)iDx, (int)mvCharDxs[iDx], args.mpDXArray[iDx]);
+ fprintf(grLog(),"%d,%d,%d ", (int)iDx, (int)mvCharDxs[iDx], args.mpDXArray[iDx]);
fprintf(grLog(),"ApplyDx\n");
#endif
bool bRtl = mnLayoutFlags & SAL_LAYOUT_BIDI_RTL;
@@ -1090,7 +1119,7 @@ void GraphiteLayout::ApplyDXArray(ImplLayoutArgs &args, std::vector<int> & rDelt
}
long nDWidth = nNewClusterWidth - nOrigClusterWidth;
#ifdef GRLAYOUT_DEBUG
- fprintf(grLog(), "c%d last glyph %d/%d\n", i, nLastGlyph, mvGlyphs.size());
+ fprintf(grLog(), "c%lu last glyph %d/%lu\n", i, nLastGlyph, mvGlyphs.size());
#endif
assert((nLastGlyph > -1) && (nLastGlyph < (signed)mvGlyphs.size()));
mvGlyphs[nLastGlyph].mnNewWidth += nDWidth;
@@ -1128,7 +1157,7 @@ void GraphiteLayout::ApplyDXArray(ImplLayoutArgs &args, std::vector<int> & rDelt
std::copy(args.mpDXArray, args.mpDXArray + nChars,
mvCharDxs.begin() + (args.mnMinCharPos - mnMinCharPos));
#ifdef GRLAYOUT_DEBUG
- fprintf(grLog(),"ApplyDx %ld(%ld)\n", args.mpDXArray[nChars - 1], mnWidth);
+ fprintf(grLog(),"ApplyDx %d(%ld)\n", args.mpDXArray[nChars - 1], mnWidth);
#endif
mnWidth = args.mpDXArray[nChars - 1];
}
@@ -1170,7 +1199,7 @@ void GraphiteLayout::kashidaJustify(std::vector<int>& rDeltaWidths, sal_GlyphId
}
nKashidaCount = 1 + (nGapWidth / nKashidaWidth);
#ifdef GRLAYOUT_DEBUG
- printf("inserting %d kashidas at %ld\n", nKashidaCount, (*i).mnGlyphIndex);
+ printf("inserting %d kashidas at %u\n", nKashidaCount, (*i).mnGlyphIndex);
#endif
GlyphItem glyphItem = *i;
Point aPos(0, 0);
@@ -1309,7 +1338,7 @@ void GraphiteLayout::GetCaretPositions( int nArraySize, sal_Int32* pCaretXArray
pCaretXArray[i] = pCaretXArray[i+1] = 0;
}
#ifdef GRLAYOUT_DEBUG
- fprintf(grLog(),"%d,%ld-%ld\t", nCharSlot, pCaretXArray[i], pCaretXArray[i+1]);
+ fprintf(grLog(),"%d,%d-%d\t", nCharSlot, pCaretXArray[i], pCaretXArray[i+1]);
#endif
}
#ifdef GRLAYOUT_DEBUG
diff --git a/vcl/source/glyphs/graphite_textsrc.hxx b/vcl/source/glyphs/graphite_textsrc.hxx
index 2b9c705a5ea7..3912977cc9be 100644
--- a/vcl/source/glyphs/graphite_textsrc.hxx
+++ b/vcl/source/glyphs/graphite_textsrc.hxx
@@ -93,6 +93,7 @@ public:
virtual ext_std::pair<gr::toffset, gr::toffset> propertyRange(gr::toffset ich);
virtual size_t getFontFeatures(gr::toffset ich, gr::FeatureSetting * prgfset);
virtual bool sameSegment(gr::toffset ich1, gr::toffset ich2);
+ virtual bool featureVariations() { return false; }
operator ImplLayoutArgs & () throw();
void setFeatures(const grutils::GrFeatureParser * pFeatures);