summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2009-11-13 18:29:26 +0100
committerKurt Zenker <kz@openoffice.org>2009-11-13 18:29:26 +0100
commite66f4ee8e5923ccb16ef6869b3b9e9cb816a5966 (patch)
tree2a01fc92488ed360772e48183efcc360f5e4ec24 /vcl/source
parent24534f00dd8799b3c2b2365ccd8c0009e19cddd5 (diff)
parent04c0a8dfe8e68ee04348206ba95872123d584e7e (diff)
CWS-TOOLING: integrate CWS vcl106
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/fontsubset/gsub.cxx8
-rw-r--r--vcl/source/gdi/pdfextoutdevdata.cxx13
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx44
-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
7 files changed, 62 insertions, 50 deletions
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/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 e7ee18ec7705..dc3ead5d2d6f 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;
}
@@ -8792,6 +8795,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/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;
}