summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Glazunov <vg@openoffice.org>2009-12-14 10:54:46 +0100
committerVladimir Glazunov <vg@openoffice.org>2009-12-14 10:54:46 +0100
commit6961443a97e571f7d58add81846989cb3aed1bf1 (patch)
treebe397b9dd1458e9c64961e1d546efc4c2d8e10fe
parent8daf136a25fa5f91d768c57fea91d043ca396d28 (diff)
parent97116f6e7af5bef7a6390b530a323c50d8920f75 (diff)
CWS-TOOLING: integrate CWS ooo32gsl09_DEV300
-rw-r--r--vcl/source/gdi/pdfwriter_impl.hxx3
-rw-r--r--vcl/unx/source/printergfx/glyphset.cxx38
2 files changed, 34 insertions, 7 deletions
diff --git a/vcl/source/gdi/pdfwriter_impl.hxx b/vcl/source/gdi/pdfwriter_impl.hxx
index 4a7f8ab0e33a..e058cfa487db 100644
--- a/vcl/source/gdi/pdfwriter_impl.hxx
+++ b/vcl/source/gdi/pdfwriter_impl.hxx
@@ -683,6 +683,7 @@ private:
m_aOverlineColor( COL_TRANSPARENT ),
m_nAntiAlias( 1 ),
m_nLayoutMode( 0 ),
+ m_aDigitLanguage( 0 ),
m_nTransparentPercent( 0 ),
m_nFlags( 0xffff ),
m_nUpdateFlags( 0xffff )
@@ -697,6 +698,7 @@ private:
m_aClipRegion( rState.m_aClipRegion ),
m_nAntiAlias( rState.m_nAntiAlias ),
m_nLayoutMode( rState.m_nLayoutMode ),
+ m_aDigitLanguage( rState.m_aDigitLanguage ),
m_nTransparentPercent( rState.m_nTransparentPercent ),
m_nFlags( rState.m_nFlags ),
m_nUpdateFlags( rState.m_nUpdateFlags )
@@ -714,6 +716,7 @@ private:
m_aClipRegion = rState.m_aClipRegion;
m_nAntiAlias = rState.m_nAntiAlias;
m_nLayoutMode = rState.m_nLayoutMode;
+ m_aDigitLanguage = rState.m_aDigitLanguage;
m_nTransparentPercent = rState.m_nTransparentPercent;
m_nFlags = rState.m_nFlags;
m_nUpdateFlags = rState.m_nUpdateFlags;
diff --git a/vcl/unx/source/printergfx/glyphset.cxx b/vcl/unx/source/printergfx/glyphset.cxx
index 156517d98220..5adff6683267 100644
--- a/vcl/unx/source/printergfx/glyphset.cxx
+++ b/vcl/unx/source/printergfx/glyphset.cxx
@@ -46,6 +46,7 @@
#include <set>
#include <map>
+#include <algorithm>
using namespace vcl;
using namespace psp;
@@ -785,6 +786,17 @@ GlyphSet::PSUploadEncoding(osl::File* pOutFile, PrinterGfx &rGfx)
return sal_True;
}
+struct EncEntry
+{
+ sal_uChar aEnc;
+ long aGID;
+
+ EncEntry() : aEnc( 0 ), aGID( 0 ) {}
+
+ bool operator<( const EncEntry& rRight ) const
+ { return aEnc < rRight.aEnc; }
+};
+
static void CreatePSUploadableFont( TrueTypeFont* pSrcFont, FILE* pTmpFile,
const char* pGlyphSetName, int nGlyphCount,
/*const*/ sal_uInt16* pRequestedGlyphs, /*const*/ sal_uChar* pEncoding,
@@ -796,17 +808,29 @@ static void CreatePSUploadableFont( TrueTypeFont* pSrcFont, FILE* pTmpFile,
if( bAllowType42 )
nTargetMask |= FontSubsetInfo::TYPE42_FONT;
+ std::vector< EncEntry > aSorted( nGlyphCount, EncEntry() );
+ for( int i = 0; i < nGlyphCount; i++ )
+ {
+ aSorted[i].aEnc = pEncoding[i];
+ aSorted[i].aGID = pRequestedGlyphs[i];
+ }
+
+ std::stable_sort( aSorted.begin(), aSorted.end() );
+
+ std::vector< sal_uChar > aEncoding( nGlyphCount );
+ std::vector< long > aRequestedGlyphs( nGlyphCount );
+
+ for( int i = 0; i < nGlyphCount; i++ )
+ {
+ aEncoding[i] = aSorted[i].aEnc;
+ aRequestedGlyphs[i] = aSorted[i].aGID;
+ }
+
FontSubsetInfo aInfo;
aInfo.LoadFont( pSrcFont );
-#if 1 // TODO: remove 16bit->long conversion when input args has been changed
- long aRequestedGlyphs[256];
- for( int i = 0; i < nGlyphCount; ++i )
- aRequestedGlyphs[i] = pRequestedGlyphs[i];
-#endif
-
aInfo.CreateFontSubset( nTargetMask, pTmpFile, pGlyphSetName,
- aRequestedGlyphs, pEncoding, nGlyphCount, NULL );
+ &aRequestedGlyphs[0], &aEncoding[0], nGlyphCount, NULL );
}
sal_Bool