summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
Diffstat (limited to 'vcl')
-rw-r--r--vcl/aqua/inc/salgdi.h1
-rwxr-xr-xvcl/aqua/source/gdi/salatslayout.cxx10
-rw-r--r--vcl/aqua/source/gdi/salatsuifontutils.cxx9
-rw-r--r--vcl/aqua/source/gdi/salnativewidgets.cxx5
-rwxr-xr-xvcl/aqua/source/window/salframeview.mm4
-rw-r--r--vcl/inc/vcl/pdfwriter.hxx2
-rw-r--r--vcl/os2/source/gdi/salgdi.cxx2
-rw-r--r--vcl/os2/source/window/salframe.cxx6
-rw-r--r--vcl/source/fontsubset/gsub.cxx8
-rw-r--r--vcl/source/gdi/cvtsvm.cxx40
-rw-r--r--vcl/source/gdi/metaact.cxx37
-rw-r--r--vcl/source/gdi/outdev3.cxx2
-rw-r--r--vcl/source/gdi/pdfextoutdevdata.cxx13
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx44
-rw-r--r--vcl/source/gdi/region.cxx8
-rw-r--r--vcl/source/gdi/salmisc.cxx8
-rw-r--r--vcl/source/glyphs/gcach_ftyp.cxx10
-rw-r--r--vcl/source/glyphs/graphite_adaptors.cxx10
-rw-r--r--vcl/source/glyphs/makefile.mk3
-rw-r--r--vcl/source/window/menu.cxx24
-rw-r--r--vcl/unx/gtk/a11y/atkutil.cxx13
-rw-r--r--vcl/unx/kde4/KDESalFrame.cxx28
-rw-r--r--vcl/unx/kde4/KDESalGraphics.cxx2
-rw-r--r--vcl/unx/kde4/KDEXLib.cxx13
-rw-r--r--vcl/unx/source/dtrans/X11_selection.cxx40
-rw-r--r--vcl/win/source/window/salframe.cxx26
26 files changed, 247 insertions, 121 deletions
diff --git a/vcl/aqua/inc/salgdi.h b/vcl/aqua/inc/salgdi.h
index 11abd6086ce7..4933dbc48586 100644
--- a/vcl/aqua/inc/salgdi.h
+++ b/vcl/aqua/inc/salgdi.h
@@ -358,6 +358,7 @@ private:
void ApplyXorContext();
void Pattern50Fill();
+ UInt32 getState( ControlState nState );
};
class XorEmulation
diff --git a/vcl/aqua/source/gdi/salatslayout.cxx b/vcl/aqua/source/gdi/salatslayout.cxx
index 7ecef01cf0d5..3021e85fed5c 100755
--- a/vcl/aqua/source/gdi/salatslayout.cxx
+++ b/vcl/aqua/source/gdi/salatslayout.cxx
@@ -302,16 +302,14 @@ void ATSLayout::AdjustLayout( ImplLayoutArgs& rArgs )
nPixelWidth = rArgs.mpDXArray[ mnCharCount - 1 ];
// workaround for ATSUI not using trailing spaces for justification
- mnTrailingSpaceWidth = 0;
int i = mnCharCount;
- while( (--i > 0) && IsSpacingGlyph( rArgs.mpStr[mnMinCharPos+i]|GF_ISCHAR ) )
- mnTrailingSpaceWidth += rArgs.mpDXArray[i] - rArgs.mpDXArray[i-1];
- if( i <= 0 )
+ while( (--i >= 0) && IsSpacingGlyph( rArgs.mpStr[mnMinCharPos+i]|GF_ISCHAR ) ) {}
+ if( i < 0 ) // nothing to do if the text is all spaces
return;
// #i91685# trailing letters are left aligned (right aligned for RTL)
- mnTrailingSpaceWidth += rArgs.mpDXArray[i];
+ mnTrailingSpaceWidth = rArgs.mpDXArray[ mnCharCount-1 ];
if( i > 0 )
- mnTrailingSpaceWidth -= rArgs.mpDXArray[i-1];
+ mnTrailingSpaceWidth -= rArgs.mpDXArray[ i-1 ];
InitGIA(); // ensure valid mpCharWidths[]
mnTrailingSpaceWidth -= Fixed2Vcl( mpCharWidths[i] );
// ignore trailing space for calculating the available width
diff --git a/vcl/aqua/source/gdi/salatsuifontutils.cxx b/vcl/aqua/source/gdi/salatsuifontutils.cxx
index 8e38981a3c7c..23755ae2f571 100644
--- a/vcl/aqua/source/gdi/salatsuifontutils.cxx
+++ b/vcl/aqua/source/gdi/salatsuifontutils.cxx
@@ -207,6 +207,13 @@ static bool GetDevFontAttributes( ATSUFontID nFontID, ImplDevFontAttributes& rDF
rDFA.meItalic = ITALIC_NONE;
rDFA.mbSymbolFlag = false;
+ // ignore bitmap fonts
+ ATSFontRef rATSFontRef = FMGetATSFontRefFromFont( nFontID );
+ ByteCount nHeadLen = 0;
+ OSStatus rc = ATSFontGetTable( rATSFontRef, 0x68656164/*head*/, 0, 0, NULL, &nHeadLen );
+ if( (rc != noErr) || (nHeadLen <= 0) )
+ return false;
+
// all scalable fonts on this platform are subsettable
rDFA.mbSubsettable = true;
rDFA.mbEmbeddable = false;
@@ -216,7 +223,7 @@ static bool GetDevFontAttributes( ATSUFontID nFontID, ImplDevFontAttributes& rDF
// prepare iterating over all name strings of the font
ItemCount nFontNameCount = 0;
- OSStatus rc = ATSUCountFontNames( nFontID, &nFontNameCount );
+ rc = ATSUCountFontNames( nFontID, &nFontNameCount );
if( rc != noErr )
return false;
int nBestNameValue = 0;
diff --git a/vcl/aqua/source/gdi/salnativewidgets.cxx b/vcl/aqua/source/gdi/salnativewidgets.cxx
index 6cd4e78a2d1a..754358823a93 100644
--- a/vcl/aqua/source/gdi/salnativewidgets.cxx
+++ b/vcl/aqua/source/gdi/salnativewidgets.cxx
@@ -430,9 +430,10 @@ BOOL AquaSalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart
#define CTRL_STATE_SELECTED 0x0040
#define CTRL_CACHING_ALLOWED 0x8000 // set when the control is completely visible (i.e. not clipped)
*/
-static ThemeDrawState getState( ControlState nState )
+UInt32 AquaSalGraphics::getState( ControlState nState )
{
- if( (nState & CTRL_STATE_ENABLED) == 0 )
+ bool bDrawActive = mpFrame ? ([mpFrame->getWindow() isKeyWindow] ? true : false) : true;
+ if( (nState & CTRL_STATE_ENABLED) == 0 || ! bDrawActive )
{
if( (nState & CTRL_STATE_HIDDEN) == 0 )
return kThemeStateInactive;
diff --git a/vcl/aqua/source/window/salframeview.mm b/vcl/aqua/source/window/salframeview.mm
index 68ea2c2062f2..0305b4cadb43 100755
--- a/vcl/aqua/source/window/salframeview.mm
+++ b/vcl/aqua/source/window/salframeview.mm
@@ -215,6 +215,7 @@ static AquaSalFrame* getMouseContainerFrame()
AquaSalMenu::enableMainMenu( false );
#endif
mpFrame->CallCallback( SALEVENT_GETFOCUS, 0 );
+ mpFrame->SendPaintEvent(); // repaint controls as active
}
}
@@ -223,7 +224,10 @@ static AquaSalFrame* getMouseContainerFrame()
YIELD_GUARD;
if( mpFrame && AquaSalFrame::isAlive( mpFrame ) )
+ {
mpFrame->CallCallback(SALEVENT_LOSEFOCUS, 0);
+ mpFrame->SendPaintEvent(); // repaint controls as inactive
+ }
}
-(void)windowDidChangeScreen: (NSNotification*)pNotification
diff --git a/vcl/inc/vcl/pdfwriter.hxx b/vcl/inc/vcl/pdfwriter.hxx
index bdf636754c77..a4a6c4d53170 100644
--- a/vcl/inc/vcl/pdfwriter.hxx
+++ b/vcl/inc/vcl/pdfwriter.hxx
@@ -546,6 +546,7 @@ The following structure describes the permissions used in PDF security
will be submitted.
*/
PDFWriter::ExportDataFormat SubmitFormat;
+ bool AllowDuplicateFieldNames;
/* the following data members are used to customize the PDF viewer
preferences
*/
@@ -590,6 +591,7 @@ The following structure describes the permissions used in PDF security
Tagged( false ),
EmbedStandardFonts( false ),
SubmitFormat( PDFWriter::FDF ),
+ AllowDuplicateFieldNames( false ),
PDFDocumentMode( PDFWriter::ModeDefault ),
PDFDocumentAction( PDFWriter::ActionDefault ),
Zoom( 100 ),
diff --git a/vcl/os2/source/gdi/salgdi.cxx b/vcl/os2/source/gdi/salgdi.cxx
index b6616eb3a24b..082e690c09e7 100644
--- a/vcl/os2/source/gdi/salgdi.cxx
+++ b/vcl/os2/source/gdi/salgdi.cxx
@@ -1016,7 +1016,7 @@ BOOL Os2SalGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight, void*
}
}
- delete pBuf;
+ delete [] pBuf;
return bRet;
}
diff --git a/vcl/os2/source/window/salframe.cxx b/vcl/os2/source/window/salframe.cxx
index 345573b268c3..5e4b843c7cff 100644
--- a/vcl/os2/source/window/salframe.cxx
+++ b/vcl/os2/source/window/salframe.cxx
@@ -3320,7 +3320,7 @@ static long ImplHandleIMEConversion( Os2SalFrame* pFrame, MPARAM nMP2Param )
if ( pBuf )
{
aEvt.maText = XubString( pBuf, (USHORT)nBufLen );
- delete pBuf;
+ delete [] pBuf;
if ( pAttrBuf )
{
USHORT nTextLen = aEvt.maText.Len();
@@ -3346,7 +3346,7 @@ static long ImplHandleIMEConversion( Os2SalFrame* pFrame, MPARAM nMP2Param )
}
aEvt.mpTextAttr = pSalAttrAry;
}
- delete pAttrBuf;
+ delete [] pAttrBuf;
}
if ( bLastCursor )
aEvt.mnCursorPos = aEvt.maText.Len();
@@ -3358,7 +3358,7 @@ static long ImplHandleIMEConversion( Os2SalFrame* pFrame, MPARAM nMP2Param )
// wieder zerstoeren
pFrame->CallCallback( SALEVENT_EXTTEXTINPUT, (void*)&aEvt );
if ( pSalAttrAry )
- delete pSalAttrAry;
+ delete [] pSalAttrAry;
}
else
pIMEData->mpReleaseIME( hWnd, hIMI );
diff --git a/vcl/source/fontsubset/gsub.cxx b/vcl/source/fontsubset/gsub.cxx
index 9715e7fc8585..600c03194210 100644
--- a/vcl/source/fontsubset/gsub.cxx
+++ b/vcl/source/fontsubset/gsub.cxx
@@ -32,6 +32,8 @@
#include "gsub.h"
+#include <osl/diagnose.h>
+
#include <vector>
#include <map>
#include <algorithm>
@@ -280,9 +282,11 @@ int ReadGSUB( struct _TrueTypeFont* pTTFile,
{
const USHORT nGlyph0 = NEXT_UShort( pCoverage );
const USHORT nGlyph1 = NEXT_UShort( pCoverage );
- const USHORT nCovIdx = NEXT_UShort( pCoverage );
+ const USHORT nStartCoverageIndex = NEXT_UShort( pCoverage );
+ OSL_ENSURE( aSubstVector.size() == nStartCoverageIndex, "coverage index mismatch");
+ (void)nStartCoverageIndex;
for( USHORT j = nGlyph0; j <= nGlyph1; ++j )
- aSubstVector.push_back( GlyphSubst( j + nCovIdx, 0 ) );
+ aSubstVector.push_back( GlyphSubst( j, 0 ) );
}
}
break;
diff --git a/vcl/source/gdi/cvtsvm.cxx b/vcl/source/gdi/cvtsvm.cxx
index c1c02b673658..4ecb89ec5a8e 100644
--- a/vcl/source/gdi/cvtsvm.cxx
+++ b/vcl/source/gdi/cvtsvm.cxx
@@ -90,12 +90,17 @@ void ImplReadPoly( SvStream& rIStm, Polygon& rPoly )
void ImplWritePoly( SvStream& rOStm, const Polygon& rPoly )
{
- INT32 nSize = rPoly.GetSize();
+ // #i102224# Here the evtl. curved nature of Polygon was
+ // ignored (for all those Years). Adapted to at least write
+ // a polygon representing the curve as good as possible
+ Polygon aSimplePoly;
+ rPoly.AdaptiveSubdivide(aSimplePoly);
+ INT32 nSize = aSimplePoly.GetSize();
rOStm << nSize;
for( INT32 i = 0; i < nSize; i++ )
- rOStm << rPoly[ (USHORT) i ];
+ rOStm << aSimplePoly[ (USHORT) i ];
}
// ------------------------------------------------------------------------
@@ -131,13 +136,18 @@ void ImplWritePolyPolyAction( SvStream& rOStm, const PolyPolygon& rPolyPoly )
for( n = 0; n < nPoly; n++ )
{
+ // #i102224# Here the evtl. curved nature of Polygon was
+ // ignored (for all those Years). Adapted to at least write
+ // a polygon representing the curve as good as possible
const Polygon& rPoly = rPolyPoly[ n ];
- const USHORT nSize = rPoly.GetSize();
+ Polygon aSimplePoly;
+ rPoly.AdaptiveSubdivide(aSimplePoly);
+ const USHORT nSize = aSimplePoly.GetSize();
rOStm << (INT32) nSize;
for( USHORT j = 0; j < nSize; j++ )
- rOStm << rPoly[ j ];
+ rOStm << aSimplePoly[ j ];
}
}
@@ -1354,8 +1364,15 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
{
MetaPolyLineAction* pAct = (MetaPolyLineAction*) pAction;
const Polygon& rPoly = pAct->GetPolygon();
+
+ // #i102224# Here the evtl. curved nature of Polygon was
+ // ignored (for all those Years). Adapted to at least write
+ // a polygon representing the curve as good as possible
+ Polygon aSimplePoly;
+ rPoly.AdaptiveSubdivide(aSimplePoly);
+
const LineInfo& rInfo = pAct->GetLineInfo();
- const USHORT nPoints = rPoly.GetSize();
+ const USHORT nPoints = aSimplePoly.GetSize();
const BOOL bFatLine = ( !rInfo.IsDefault() && ( LINE_NONE != rInfo.GetStyle() ) );
if( bFatLine )
@@ -1369,7 +1386,7 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
rOStm << (INT32) nPoints;
for( USHORT n = 0; n < nPoints; n++ )
- rOStm << rPoly[ n ];
+ rOStm << aSimplePoly[ n ];
nCount++;
@@ -1385,14 +1402,21 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
{
MetaPolygonAction* pAct = (MetaPolygonAction*) pAction;
const Polygon& rPoly = pAct->GetPolygon();
- const USHORT nPoints = rPoly.GetSize();
+
+ // #i102224# Here the evtl. curved nature of Polygon was
+ // ignored (for all those Years). Adapted to at least write
+ // a polygon representing the curve as good as possible
+ Polygon aSimplePoly;
+ rPoly.AdaptiveSubdivide(aSimplePoly);
+
+ const USHORT nPoints = aSimplePoly.GetSize();
rOStm << (INT16) GDI_POLYGON_ACTION;
rOStm << (INT32) ( 8 + ( nPoints << 3 ) );
rOStm << (INT32) nPoints;
for( USHORT n = 0; n < nPoints; n++ )
- rOStm << rPoly[ n ];
+ rOStm << aSimplePoly[ n ];
nCount++;
}
diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx
index 4fe9a41be797..82566b2b4362 100644
--- a/vcl/source/gdi/metaact.cxx
+++ b/vcl/source/gdi/metaact.cxx
@@ -989,7 +989,7 @@ void MetaPolyLineAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
WRITE_BASE_COMPAT( rOStm, 3, pData );
Polygon aSimplePoly;
- maPoly.GetSimple( aSimplePoly );
+ maPoly.AdaptiveSubdivide( aSimplePoly );
rOStm << aSimplePoly; // Version 1
rOStm << maLineInfo; // Version 2
@@ -1077,7 +1077,7 @@ void MetaPolygonAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
WRITE_BASE_COMPAT( rOStm, 2, pData );
Polygon aSimplePoly; // Version 1
- maPoly.GetSimple( aSimplePoly );
+ maPoly.AdaptiveSubdivide( aSimplePoly );
rOStm << aSimplePoly;
sal_uInt8 bHasPolyFlags = maPoly.HasFlags(); // Version 2
@@ -1169,7 +1169,7 @@ void MetaPolyPolygonAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
const Polygon& rPoly = maPolyPoly.GetObject( i );
if ( rPoly.HasFlags() )
nNumberOfComplexPolygons++;
- rPoly.GetSimple( aSimplePoly );
+ rPoly.AdaptiveSubdivide( aSimplePoly );
rOStm << aSimplePoly;
}
@@ -2581,7 +2581,13 @@ sal_Bool MetaGradientExAction::Compare( const MetaAction& rMetaAction ) const
void MetaGradientExAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
{
WRITE_BASE_COMPAT( rOStm, 1, pData );
- rOStm << maPolyPoly << maGradient;
+
+ // #i105373# see comment at MetaTransparentAction::Write
+ PolyPolygon aNoCurvePolyPolygon;
+ maPolyPoly.AdaptiveSubdivide(aNoCurvePolyPolygon);
+
+ rOStm << aNoCurvePolyPolygon;
+ rOStm << maGradient;
}
// ------------------------------------------------------------------------
@@ -2649,7 +2655,13 @@ sal_Bool MetaHatchAction::Compare( const MetaAction& rMetaAction ) const
void MetaHatchAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
{
WRITE_BASE_COMPAT( rOStm, 1, pData );
- rOStm << maPolyPoly << maHatch;
+
+ // #i105373# see comment at MetaTransparentAction::Write
+ PolyPolygon aNoCurvePolyPolygon;
+ maPolyPoly.AdaptiveSubdivide(aNoCurvePolyPolygon);
+
+ rOStm << aNoCurvePolyPolygon;
+ rOStm << maHatch;
}
// ------------------------------------------------------------------------
@@ -3716,7 +3728,20 @@ sal_Bool MetaTransparentAction::Compare( const MetaAction& rMetaAction ) const
void MetaTransparentAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
{
WRITE_BASE_COMPAT( rOStm, 1, pData );
- rOStm << maPolyPoly;
+
+ // #i105373# The PolyPolygon in this action may be a curve; this
+ // was ignored until now what is an error. To make older office
+ // versions work with MetaFiles, i opt for applying AdaptiveSubdivide
+ // to the PolyPoylgon.
+ // The alternative would be to really write the curve information
+ // like in MetaPolyPolygonAction::Write (where someone extended it
+ // correctly, but not here :-( ).
+ // The golden solution would be to combine both, but i think it's
+ // not necessary; a good subdivision will be sufficient.
+ PolyPolygon aNoCurvePolyPolygon;
+ maPolyPoly.AdaptiveSubdivide(aNoCurvePolyPolygon);
+
+ rOStm << aNoCurvePolyPolygon;
rOStm << mnTransPercent;
}
diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index 0a7a8b765b6b..8a057b3f3c7b 100644
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -4835,7 +4835,7 @@ void OutputDevice::ImplGetEmphasisMark( PolyPolygon& rPolyPoly, BOOL& rPolyLine,
double dScale = ((double)nDotSize)/1000.0;
aPoly.Scale( dScale, dScale );
Polygon aTemp;
- aPoly.GetSimple( aTemp );
+ aPoly.AdaptiveSubdivide( aTemp );
Rectangle aBoundRect = aTemp.GetBoundRect();
rWidth = aBoundRect.GetWidth();
nDotSize = aBoundRect.GetHeight();
diff --git a/vcl/source/gdi/pdfextoutdevdata.cxx b/vcl/source/gdi/pdfextoutdevdata.cxx
index a7d91abcbd5f..9c8c1ec1bf5e 100644
--- a/vcl/source/gdi/pdfextoutdevdata.cxx
+++ b/vcl/source/gdi/pdfextoutdevdata.cxx
@@ -283,8 +283,6 @@ struct PageSyncData
std::deque< Graphic > mGraphics;
std::deque< ::boost::shared_ptr< PDFWriter::AnyWidget > >
mControls;
- std::set< ::rtl::OUString > mControlNames;
-
GlobalSyncData* mpGlobalData;
sal_Bool mbGroupIgnoreGDIMtfActions;
@@ -375,7 +373,6 @@ sal_Bool PageSyncData::PlaySyncPageAct( PDFWriter& rWriter, sal_uInt32& rCurGDIM
if ( pControl.get() )
rWriter.CreateControl( *pControl );
mControls.pop_front();
- mControlNames.erase( pControl->Name );
}
break;
case PDFExtOutDevDataSync::BeginGroup :
@@ -772,16 +769,6 @@ void PDFExtOutDevData::CreateControl( const PDFWriter::AnyWidget& rControlType,
mpPageSyncData->PushAction( mrOutDev, PDFExtOutDevDataSync::CreateControl );
::boost::shared_ptr< PDFWriter::AnyWidget > pClone( rControlType.Clone() );
- // ensure a unique name
- ::rtl::OUString sUniqueName( pClone->Name );
- sal_Int32 nUniqueNumber( 0 );
- while ( mpPageSyncData->mControlNames.find( sUniqueName ) != mpPageSyncData->mControlNames.end() )
- {
- sUniqueName = pClone->Name + ::rtl::OUString::valueOf( ++nUniqueNumber );
- }
- pClone->Name = sUniqueName;
- mpPageSyncData->mControlNames.insert( pClone->Name );
-
mpPageSyncData->mControls.push_back( pClone );
}
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 146196e86877..164dc85702a7 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -667,26 +667,29 @@ OString PDFWriterImpl::convertWidgetFieldName( const rtl::OUString& rString )
}
OString aRet = aBuffer.makeStringAndClear();
- std::hash_map<OString, sal_Int32, OStringHash>::iterator it = m_aFieldNameMap.find( aRet );
-
- if( it != m_aFieldNameMap.end() ) // not unique
+ if( ! m_aContext.AllowDuplicateFieldNames )
{
- std::hash_map< OString, sal_Int32, OStringHash >::const_iterator check_it;
- OString aTry;
- do
+ std::hash_map<OString, sal_Int32, OStringHash>::iterator it = m_aFieldNameMap.find( aRet );
+
+ if( it != m_aFieldNameMap.end() ) // not unique
{
- OStringBuffer aUnique( aRet.getLength() + 16 );
- aUnique.append( aRet );
- aUnique.append( '_' );
- aUnique.append( it->second );
- it->second++;
- aTry = aUnique.makeStringAndClear();
- check_it = m_aFieldNameMap.find( aTry );
- } while( check_it != m_aFieldNameMap.end() );
- aRet = aTry;
+ std::hash_map< OString, sal_Int32, OStringHash >::const_iterator check_it;
+ OString aTry;
+ do
+ {
+ OStringBuffer aUnique( aRet.getLength() + 16 );
+ aUnique.append( aRet );
+ aUnique.append( '_' );
+ aUnique.append( it->second );
+ it->second++;
+ aTry = aUnique.makeStringAndClear();
+ check_it = m_aFieldNameMap.find( aTry );
+ } while( check_it != m_aFieldNameMap.end() );
+ aRet = aTry;
+ }
+ else
+ m_aFieldNameMap[ aRet ] = 2;
}
- else
- m_aFieldNameMap[ aRet ] = 2;
return aRet;
}
@@ -8787,6 +8790,13 @@ bool PDFWriterImpl::writeTransparentObject( TransparencyEmit& rObject )
aLine.append( ' ' );
appendFixedInt( rObject.m_aBoundRect.Bottom()+1, aLine );
aLine.append( " ]\n" );
+ if( ! rObject.m_pSoftMaskStream )
+ {
+ if( ! m_bIsPDF_A1 )
+ {
+ aLine.append( "/Group<</S/Transparency/CS/DeviceRGB/K true>>\n" );
+ }
+ }
/* #i42884# the PDF reference recommends that each Form XObject
* should have a resource dict; alas if that is the same object
* as the one of the page it triggers an endless recursion in
diff --git a/vcl/source/gdi/region.cxx b/vcl/source/gdi/region.cxx
index 43bb224aaa94..5314837143de 100644
--- a/vcl/source/gdi/region.cxx
+++ b/vcl/source/gdi/region.cxx
@@ -2537,7 +2537,13 @@ SvStream& operator<<( SvStream& rOStrm, const Region& rRegion )
rOStrm << bHasPolyPolygon;
if( bHasPolyPolygon )
- rOStrm << rRegion.GetPolyPolygon();
+ {
+ // #i105373#
+ PolyPolygon aNoCurvePolyPolygon;
+ rRegion.GetPolyPolygon().AdaptiveSubdivide(aNoCurvePolyPolygon);
+
+ rOStrm << aNoCurvePolyPolygon;
+ }
}
return rOStrm;
diff --git a/vcl/source/gdi/salmisc.cxx b/vcl/source/gdi/salmisc.cxx
index fc24c0289b50..8b442086eabf 100644
--- a/vcl/source/gdi/salmisc.cxx
+++ b/vcl/source/gdi/salmisc.cxx
@@ -426,10 +426,10 @@ BitmapBuffer* StretchAndConvert( const BitmapBuffer& rSrcBuffer, const SalTwoRec
// memory exception, clean up
// remark: the buffer ptr causing the exception
// is still NULL here
- delete pSrcScan;
- delete pDstScan;
- delete pMapX;
- delete pMapY;
+ delete[] pSrcScan;
+ delete[] pDstScan;
+ delete[] pMapX;
+ delete[] pMapY;
delete pDstBuffer;
return NULL;
}
diff --git a/vcl/source/glyphs/gcach_ftyp.cxx b/vcl/source/glyphs/gcach_ftyp.cxx
index 712c2334b35c..18857b94af8f 100644
--- a/vcl/source/glyphs/gcach_ftyp.cxx
+++ b/vcl/source/glyphs/gcach_ftyp.cxx
@@ -135,7 +135,8 @@ static int nFTVERSION = 0;
static FT_Error (*pFTNewSize)(FT_Face,FT_Size*);
static FT_Error (*pFTActivateSize)(FT_Size);
static FT_Error (*pFTDoneSize)(FT_Size);
-static FT_Error (*pFTEmbolden)(FT_GlyphSlot);
+FT_Error (*pFTEmbolden)(FT_GlyphSlot);
+FT_Error (*pFTOblique)(FT_GlyphSlot);
static bool bEnableSizeFT = false;
struct EqStr{ bool operator()(const char* a, const char* b) const { return !strcmp(a,b); } };
@@ -472,6 +473,7 @@ FreetypeManager::FreetypeManager()
pFTActivateSize = (FT_Error(*)(FT_Size))(sal_IntPtr)dlsym( RTLD_DEFAULT, "FT_Activate_Size" );
pFTDoneSize = (FT_Error(*)(FT_Size))(sal_IntPtr)dlsym( RTLD_DEFAULT, "FT_Done_Size" );
pFTEmbolden = (FT_Error(*)(FT_GlyphSlot))(sal_IntPtr)dlsym( RTLD_DEFAULT, "FT_GlyphSlot_Embolden" );
+ pFTOblique = (FT_Error(*)(FT_GlyphSlot))(sal_IntPtr)dlsym( RTLD_DEFAULT, "FT_GlyphSlot_Oblique" );
bEnableSizeFT = (pFTNewSize!=NULL) && (pFTActivateSize!=NULL) && (pFTDoneSize!=NULL);
@@ -2487,10 +2489,12 @@ bool FreetypeServerFont::ApplyGSUB( const ImplFontSelectData& rFSD )
{
const USHORT nGlyph0 = GetUShort( pCoverage+0 );
const USHORT nGlyph1 = GetUShort( pCoverage+2 );
- const USHORT nCovIdx = GetUShort( pCoverage+4 );
+ const USHORT nStartCoverageIndex = GetUShort( pCoverage+4 );
+ DBG_ASSERT( aSubstVector.size() == nStartCoverageIndex, "coverage index mismatch");
+ (void)nStartCoverageIndex;
pCoverage += 6;
for( USHORT j = nGlyph0; j <= nGlyph1; ++j )
- aSubstVector.push_back( GlyphSubst( j + nCovIdx, 0 ) );
+ aSubstVector.push_back( GlyphSubst( j, 0 ) );
}
}
break;
diff --git a/vcl/source/glyphs/graphite_adaptors.cxx b/vcl/source/glyphs/graphite_adaptors.cxx
index 9b16318fdc40..34e2f5f5bbe3 100644
--- a/vcl/source/glyphs/graphite_adaptors.cxx
+++ b/vcl/source/glyphs/graphite_adaptors.cxx
@@ -71,6 +71,8 @@ namespace
typedef std::hash_map<long,bool> SilfMap;
SilfMap sSilfMap;
}
+extern FT_Error (*pFTEmbolden)(FT_GlyphSlot);
+extern FT_Error (*pFTOblique)(FT_GlyphSlot);
// class CharacterRenderProperties implentation.
//
@@ -303,11 +305,11 @@ void GraphiteFontAdaptor::getGlyphMetrics(gr::gid16 nGlyphId, gr::Rect & aBoundi
return;
}
// check whether we need synthetic bold/italic otherwise metric is wrong
- if (mrFont.NeedsArtificialBold())
- FT_GlyphSlot_Embolden(aFace->glyph);
+ if (mrFont.NeedsArtificialBold() && pFTEmbolden)
+ (*pFTEmbolden)(aFace->glyph);
- if (mrFont.NeedsArtificialItalic())
- FT_GlyphSlot_Oblique(aFace->glyph);
+ if (mrFont.NeedsArtificialItalic() && pFTOblique)
+ (*pFTOblique)(aFace->glyph);
const FT_Glyph_Metrics &gm = aFace->glyph->metrics;
diff --git a/vcl/source/glyphs/makefile.mk b/vcl/source/glyphs/makefile.mk
index 3e79cdc63da2..e43daaeac2ee 100644
--- a/vcl/source/glyphs/makefile.mk
+++ b/vcl/source/glyphs/makefile.mk
@@ -42,9 +42,6 @@ ENABLE_EXCEPTIONS=true
.INCLUDE : $(PRJ)$/util$/makefile2.pmk
CFLAGS+= $(FREETYPE_CFLAGS)
-.IF "$(USE_FT_EMBOLDEN)" == "YES"
-CFLAGS+=-DUSE_FT_EMBOLDEN
-.ENDIF
# --- Files --------------------------------------------------------
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index ebd4475a80fc..c9e0c23e7f16 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -5136,15 +5136,23 @@ IMPL_LINK( MenuBarWindow, CloserHdl, PushButton*, EMPTYARG )
return 0;
if( aCloser.GetCurItemId() == IID_DOCUMENTCLOSE )
- return ((MenuBar*)pMenu)->GetCloserHdl().Call( pMenu );
- std::map<USHORT,AddButtonEntry>::iterator it = m_aAddButtons.find( aCloser.GetCurItemId() );
- if( it != m_aAddButtons.end() )
{
- MenuBar::MenuBarButtonCallbackArg aArg;
- aArg.nId = it->first;
- aArg.bHighlight = (aCloser.GetHighlightItemId() == it->first);
- aArg.pMenuBar = dynamic_cast<MenuBar*>(pMenu);
- return it->second.m_aSelectLink.Call( &aArg );
+ // #i106052# call close hdl asynchronously to ease handler implementation
+ // this avoids still being in the handler while the DecoToolBox already
+ // gets destroyed
+ Application::PostUserEvent( ((MenuBar*)pMenu)->GetCloserHdl(), pMenu );
+ }
+ else
+ {
+ std::map<USHORT,AddButtonEntry>::iterator it = m_aAddButtons.find( aCloser.GetCurItemId() );
+ if( it != m_aAddButtons.end() )
+ {
+ MenuBar::MenuBarButtonCallbackArg aArg;
+ aArg.nId = it->first;
+ aArg.bHighlight = (aCloser.GetHighlightItemId() == it->first);
+ aArg.pMenuBar = dynamic_cast<MenuBar*>(pMenu);
+ return it->second.m_aSelectLink.Call( &aArg );
+ }
}
return 0;
}
diff --git a/vcl/unx/gtk/a11y/atkutil.cxx b/vcl/unx/gtk/a11y/atkutil.cxx
index 5206c8ce87ca..c92a69d3fb49 100644
--- a/vcl/unx/gtk/a11y/atkutil.cxx
+++ b/vcl/unx/gtk/a11y/atkutil.cxx
@@ -221,7 +221,7 @@ void DocumentFocusListener::notifyEvent( const accessibility::AccessibleEventObj
if( accessibility::AccessibleStateType::FOCUSED == nState )
atk_wrapper_focus_tracker_notify_when_idle( getAccessible(aEvent) );
}
- catch(lang::IndexOutOfBoundsException e)
+ catch(const lang::IndexOutOfBoundsException &e)
{
g_warning("Focused object has invalid index in parent");
}
@@ -577,7 +577,14 @@ static void handle_get_focus(::VclWindowEvent const * pEvent)
if( g_aWindowList.find(pWindow) == g_aWindowList.end() )
{
g_aWindowList.insert(pWindow);
- aDocumentFocusListener->attachRecursive(xAccessible, xContext, xStateSet);
+ try
+ {
+ aDocumentFocusListener->attachRecursive(xAccessible, xContext, xStateSet);
+ }
+ catch( const uno::Exception &e )
+ {
+ g_warning( "Exception caught processing focus events" );
+ }
}
#ifdef ENABLE_TRACING
else
@@ -608,7 +615,7 @@ static void handle_menu_highlighted(::VclMenuEvent const * pEvent)
}
}
}
- catch( uno::Exception e )
+ catch( const uno::Exception& e )
{
g_warning( "Exception caught processing menu highlight events" );
}
diff --git a/vcl/unx/kde4/KDESalFrame.cxx b/vcl/unx/kde4/KDESalFrame.cxx
index 796350a63d50..202d3dbcd517 100644
--- a/vcl/unx/kde4/KDESalFrame.cxx
+++ b/vcl/unx/kde4/KDESalFrame.cxx
@@ -181,7 +181,6 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings )
StyleSettings style( rSettings.GetStyleSettings() );
BOOL bSetTitleFont = false;
-
// General settings
QPalette pal = kapp->palette();
@@ -214,6 +213,14 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings )
pKey = "Theme";
if ( aGroup.hasKey( pKey ) )
style.SetPreferredSymbolsStyleName( readEntryUntranslated( &aGroup, pKey ) );
+
+ //toolbar
+ pKey = "toolbarFont";
+ if ( aGroup.hasKey( pKey ) )
+ {
+ Font aFont = toFont( aGroup.readEntry( pKey, QFont() ), rSettings.GetUILocale() );
+ style.SetToolFont( aFont );
+ }
}
Color aFore = toColor( pal.color( QPalette::Active, QPalette::WindowText ) );
@@ -288,7 +295,7 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings )
style.SetFloatTitleFont( aFont );
style.SetMenuFont( aFont ); // will be changed according to pMenuBar
- style.SetToolFont( aFont ); // will be changed according to pToolBar
+ //style.SetToolFont( aFont ); //already set above
style.SetLabelFont( aFont );
style.SetInfoFont( aFont );
style.SetRadioCheckFont( aFont );
@@ -300,11 +307,9 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings )
int flash_time = QApplication::cursorFlashTime();
style.SetCursorBlinkTime( flash_time != 0 ? flash_time/2 : STYLE_CURSOR_NOBLINKTIME );
- KMainWindow qMainWindow;
-
// Menu
style.SetSkipDisabledInMenus( TRUE );
- KMenuBar *pMenuBar = qMainWindow.menuBar();
+ KMenuBar* pMenuBar = new KMenuBar();
if ( pMenuBar )
{
// Color
@@ -337,22 +342,11 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings )
style.SetMenuFont( aFont );
}
- // Tool bar
- KToolBar *pToolBar = qMainWindow.toolBar();
- if ( pToolBar )
- {
- aFont = toFont( pToolBar->font(), rSettings.GetUILocale() );
- style.SetToolFont( aFont );
- }
+ delete pMenuBar;
// Scroll bar size
style.SetScrollBarSize( kapp->style()->pixelMetric( QStyle::PM_ScrollBarExtent ) );
- // #i59364# high contrast mode
- BOOL bHC = ( style.GetFaceColor().IsDark() ||
- style.GetWindowColor().IsDark() );
- style.SetHighContrastMode( bHC );
-
rSettings.SetStyleSettings( style );
}
diff --git a/vcl/unx/kde4/KDESalGraphics.cxx b/vcl/unx/kde4/KDESalGraphics.cxx
index 2e8f0dcad96b..1c9882923b43 100644
--- a/vcl/unx/kde4/KDESalGraphics.cxx
+++ b/vcl/unx/kde4/KDESalGraphics.cxx
@@ -513,10 +513,12 @@ BOOL KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
}
else if (type == CTRL_FRAME)
{
+ pixmap.fill(KApplication::palette().color(QPalette::Window));
lcl_drawFrame( widgetRect, painter, QStyle::PE_Frame, nControlState, value );
}
else if (type == CTRL_FIXEDBORDER)
{
+ pixmap.fill(KApplication::palette().color(QPalette::Window));
lcl_drawFrame( widgetRect, painter, QStyle::PE_FrameWindow, nControlState, value );
}
else if (type == CTRL_WINDOW_BACKGROUND)
diff --git a/vcl/unx/kde4/KDEXLib.cxx b/vcl/unx/kde4/KDEXLib.cxx
index 70b1796df7f0..dedda64d157e 100644
--- a/vcl/unx/kde4/KDEXLib.cxx
+++ b/vcl/unx/kde4/KDEXLib.cxx
@@ -77,24 +77,30 @@ void KDEXLib::Init()
pInputMethod->SetLocale();
XrmInitialize();
- KAboutData *kAboutData = new KAboutData( "OpenOffice.org",
- "OpenOffice.org",
+ KAboutData *kAboutData = new KAboutData("OpenOffice.org",
+ "kdelibs4",
ki18n( "OpenOffice.org" ),
"3.0.0",
ki18n( "OpenOffice.org with KDE Native Widget Support." ),
KAboutData::License_LGPL,
- ki18n( "Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008 Novell, Inc"),
+ ki18n( "Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Novell, Inc"),
ki18n( "OpenOffice.org is an office suite.\n" ),
"http://kde.openoffice.org/index.html",
"dev@kde.openoffice.org" );
+
kAboutData->addAuthor( ki18n( "Jan Holesovsky" ),
ki18n( "Original author and maintainer of the KDE NWF." ),
"kendy@artax.karlin.mff.cuni.cz",
"http://artax.karlin.mff.cuni.cz/~kendy" );
+ kAboutData->addAuthor( ki18n("Roman Shtylman"),
+ ki18n( "Porting to KDE 4." ),
+ "shtylman@gmail.com", "http://shtylman.com" );
kAboutData->addAuthor( ki18n("Eric Bischoff"),
ki18n( "Accessibility fixes, porting to KDE 4." ),
"bischoff@kde.org" );
+ //kAboutData->setProgramIconName("OpenOffice");
+
m_nFakeCmdLineArgs = 1;
USHORT nIdx;
vos::OExtCommandLine aCommandLine;
@@ -135,6 +141,7 @@ void KDEXLib::Init()
m_pApplication = new VCLKDEApplication();
kapp->disableSessionManagement();
+ KApplication::setQuitOnLastWindowClosed(false);
Display* pDisp = QX11Info::display();
SalKDEDisplay *pSalDisplay = new SalKDEDisplay(pDisp);
diff --git a/vcl/unx/source/dtrans/X11_selection.cxx b/vcl/unx/source/dtrans/X11_selection.cxx
index 3f7dfc2df709..c6036ae4f78e 100644
--- a/vcl/unx/source/dtrans/X11_selection.cxx
+++ b/vcl/unx/source/dtrans/X11_selection.cxx
@@ -219,28 +219,64 @@ SelectionManager::SelectionManager() :
m_aWindow( None ),
m_nSelectionTimeout( 0 ),
m_nSelectionTimestamp( CurrentTime ),
+ m_bDropEnterSent( true ),
m_aCurrentDropWindow( None ),
+ m_nDropTime( None ),
+ m_nLastDropAction( 0 ),
+ m_nLastX( 0 ),
+ m_nLastY( 0 ),
+ m_nDropTimestamp( 0 ),
m_bDropWaitingForCompletion( false ),
m_aDropWindow( None ),
m_aDropProxy( None ),
m_aDragSourceWindow( None ),
+ m_nLastDragX( 0 ),
+ m_nLastDragY( 0 ),
m_nNoPosX( 0 ),
m_nNoPosY( 0 ),
m_nNoPosWidth( 0 ),
m_nNoPosHeight( 0 ),
+ m_nDragButton( 0 ),
+ m_nUserDragAction( 0 ),
+ m_nTargetAcceptAction( 0 ),
+ m_nSourceActions( 0 ),
m_bLastDropAccepted( false ),
m_bDropSuccess( false ),
m_bDropSent( false ),
m_bWaitingForPrimaryConversion( false ),
+ m_nDragTimestamp( None ),
m_aMoveCursor( None ),
m_aCopyCursor( None ),
m_aLinkCursor( None ),
m_aNoneCursor( None ),
m_aCurrentCursor( None ),
- m_nCurrentProtocolVersion( nXdndProtocolRevision )
+ m_nCurrentProtocolVersion( nXdndProtocolRevision ),
+ m_nCLIPBOARDAtom( None ),
+ m_nTARGETSAtom( None ),
+ m_nTIMESTAMPAtom( None ),
+ m_nTEXTAtom( None ),
+ m_nINCRAtom( None ),
+ m_nCOMPOUNDAtom( None ),
+ m_nMULTIPLEAtom( None ),
+ m_nUTF16Atom( None ),
+ m_nImageBmpAtom( None ),
+ m_nXdndAware( None ),
+ m_nXdndEnter( None ),
+ m_nXdndLeave( None ),
+ m_nXdndPosition( None ),
+ m_nXdndStatus( None ),
+ m_nXdndDrop( None ),
+ m_nXdndFinished( None ),
+ m_nXdndSelection( None ),
+ m_nXdndTypeList( None ),
+ m_nXdndProxy( None ),
+ m_nXdndActionCopy( None ),
+ m_nXdndActionMove( None ),
+ m_nXdndActionLink( None ),
+ m_nXdndActionAsk( None ),
+ m_nXdndActionPrivate( None )
{
m_aDropEnterEvent.data.l[0] = None;
- m_bDropEnterSent = true;
m_aDragRunning.reset();
}
diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx
index 78c4e4e6ddcc..53f822a1e409 100644
--- a/vcl/win/source/window/salframe.cxx
+++ b/vcl/win/source/window/salframe.cxx
@@ -2158,15 +2158,15 @@ static void ImplSalToTop( HWND hWnd, USHORT nFlags )
if ( nFlags & SAL_FRAME_TOTOP_FOREGROUNDTASK )
{
- // This magic code is necessary to connect the input focus of the
- // current window thread and the thread which owns the window that
- // should be the new foreground window.
- HWND hCurrWnd = GetForegroundWindow();
- DWORD myThreadID = GetCurrentThreadId();
- DWORD currThreadID = GetWindowThreadProcessId(hCurrWnd,NULL);
- AttachThreadInput(myThreadID, currThreadID,TRUE);
- SetForegroundWindow(hWnd);
- AttachThreadInput(myThreadID,currThreadID,FALSE);
+ // This magic code is necessary to connect the input focus of the
+ // current window thread and the thread which owns the window that
+ // should be the new foreground window.
+ HWND hCurrWnd = GetForegroundWindow();
+ DWORD myThreadID = GetCurrentThreadId();
+ DWORD currThreadID = GetWindowThreadProcessId(hCurrWnd,NULL);
+ AttachThreadInput(myThreadID, currThreadID,TRUE);
+ SetForegroundWindow(hWnd);
+ AttachThreadInput(myThreadID,currThreadID,FALSE);
}
if ( nFlags & SAL_FRAME_TOTOP_RESTOREWHENMIN )
@@ -5436,7 +5436,7 @@ static BOOL ImplHandleIMECompositionInput( WinSalFrame* pFrame,
WCHAR* pTextBuf = new WCHAR[nTextLen];
ImmGetCompositionStringW( hIMC, GCS_RESULTSTR, pTextBuf, nTextLen*sizeof( WCHAR ) );
aEvt.maText = XubString( reinterpret_cast<const xub_Unicode*>(pTextBuf), (xub_StrLen)nTextLen );
- delete pTextBuf;
+ delete [] pTextBuf;
}
aEvt.mnCursorPos = aEvt.maText.Len();
@@ -5462,7 +5462,7 @@ static BOOL ImplHandleIMECompositionInput( WinSalFrame* pFrame,
WCHAR* pTextBuf = new WCHAR[nTextLen];
ImmGetCompositionStringW( hIMC, GCS_COMPSTR, pTextBuf, nTextLen*sizeof( WCHAR ) );
aEvt.maText = XubString( reinterpret_cast<const xub_Unicode*>(pTextBuf), (xub_StrLen)nTextLen );
- delete pTextBuf;
+ delete [] pTextBuf;
WIN_BYTE* pAttrBuf = NULL;
LONG nAttrLen = ImmGetCompositionStringW( hIMC, GCS_COMPATTR, 0, 0 );
@@ -5498,7 +5498,7 @@ static BOOL ImplHandleIMECompositionInput( WinSalFrame* pFrame,
}
aEvt.mpTextAttr = pSalAttrAry;
- delete pAttrBuf;
+ delete [] pAttrBuf;
}
}
@@ -5535,7 +5535,7 @@ static BOOL ImplHandleIMECompositionInput( WinSalFrame* pFrame,
}
if ( pSalAttrAry )
- delete pSalAttrAry;
+ delete [] pSalAttrAry;
}
return !bDef;