diff options
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/font/font.cxx | 8 | ||||
-rw-r--r-- | vcl/source/font/fontselect.cxx | 2 | ||||
-rw-r--r-- | vcl/source/fontsubset/sft.cxx | 2 | ||||
-rw-r--r-- | vcl/source/fontsubset/ttcr.cxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/gdimtf.cxx | 4 | ||||
-rw-r--r-- | vcl/source/gdi/metaact.cxx | 6 | ||||
-rw-r--r-- | vcl/source/gdi/pdfwriter_impl.cxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/sallayout.cxx | 127 | ||||
-rw-r--r-- | vcl/source/outdev/outdev.cxx | 2 |
9 files changed, 69 insertions, 86 deletions
diff --git a/vcl/source/font/font.cxx b/vcl/source/font/font.cxx index 84aeb02baabe..872963a5d96a 100644 --- a/vcl/source/font/font.cxx +++ b/vcl/source/font/font.cxx @@ -377,7 +377,7 @@ SvStream& ReadImplFont( SvStream& rIStm, ImplFont& rImplFont ) rIStm.ReadUInt16( nTmp16 ); rImplFont.meUnderline = (FontLineStyle) nTmp16; rIStm.ReadUInt16( nTmp16 ); rImplFont.meStrikeout = (FontStrikeout) nTmp16; rIStm.ReadUInt16( nTmp16 ); rImplFont.SetItalic( (FontItalic) nTmp16 ); - rIStm.ReadUInt16( nTmp16 ); rImplFont.maLanguageTag.reset( (LanguageType) nTmp16); + rIStm.ReadUInt16( nTmp16 ); rImplFont.maLanguageTag.reset( LanguageType(nTmp16) ); rIStm.ReadUInt16( nTmp16 ); rImplFont.meWidthType = (FontWidth) nTmp16; rIStm.ReadInt16( rImplFont.mnOrientation ); @@ -390,7 +390,7 @@ SvStream& ReadImplFont( SvStream& rIStm, ImplFont& rImplFont ) if( aCompat.GetVersion() >= 2 ) { rIStm.ReadUChar( nTmp8 ); rImplFont.meRelief = (FontRelief)nTmp8; - rIStm.ReadUInt16( nTmp16 ); rImplFont.maCJKLanguageTag.reset( (LanguageType)nTmp16); + rIStm.ReadUInt16( nTmp16 ); rImplFont.maCJKLanguageTag.reset( LanguageType(nTmp16) ); rIStm.ReadCharAsBool( bTmp ); rImplFont.mbVertical = bTmp; rIStm.ReadUInt16( nTmp16 ); rImplFont.meEmphasisMark = (FontEmphasisMark)nTmp16; } @@ -420,7 +420,7 @@ SvStream& WriteImplFont( SvStream& rOStm, const ImplFont& rImplFont ) rOStm.WriteUInt16( rImplFont.meUnderline ); rOStm.WriteUInt16( rImplFont.meStrikeout ); rOStm.WriteUInt16( rImplFont.GetItalicNoAsk() ); - rOStm.WriteUInt16( rImplFont.maLanguageTag.getLanguageType( false) ); + rOStm.WriteUInt16( (sal_uInt16)rImplFont.maLanguageTag.getLanguageType( false) ); rOStm.WriteUInt16( rImplFont.GetWidthTypeNoAsk() ); rOStm.WriteInt16( rImplFont.mnOrientation ); @@ -432,7 +432,7 @@ SvStream& WriteImplFont( SvStream& rOStm, const ImplFont& rImplFont ) // new in version 2 rOStm.WriteUChar( (sal_uChar)rImplFont.meRelief ); - rOStm.WriteUInt16( rImplFont.maCJKLanguageTag.getLanguageType( false) ); + rOStm.WriteUInt16( (sal_uInt16)rImplFont.maCJKLanguageTag.getLanguageType( false) ); rOStm.WriteBool( rImplFont.mbVertical ); rOStm.WriteUInt16( (sal_uInt16)rImplFont.meEmphasisMark ); diff --git a/vcl/source/font/fontselect.cxx b/vcl/source/font/fontselect.cxx index f4b4f77ca3a5..8141c859ba94 100644 --- a/vcl/source/font/fontselect.cxx +++ b/vcl/source/font/fontselect.cxx @@ -118,7 +118,7 @@ size_t FontSelectPatternAttributes::hashCode() const nHash += 19 * GetWeight(); nHash += 29 * GetItalic(); nHash += 37 * mnOrientation; - nHash += 41 * meLanguage; + nHash += 41 * (sal_uInt16)meLanguage; if( mbVertical ) nHash += 53; return nHash; diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx index f18622cbcc7b..713494c640b3 100644 --- a/vcl/source/fontsubset/sft.cxx +++ b/vcl/source/fontsubset/sft.cxx @@ -2613,7 +2613,7 @@ int GetTTNameRecords(TrueTypeFont *ttf, NameRecord **nr) rec[i].platformID = GetUInt16(table, 6 + 0 + 12 * i); rec[i].encodingID = GetUInt16(table, 6 + 2 + 12 * i); - rec[i].languageID = GetUInt16(table, 6 + 4 + 12 * i); + rec[i].languageID = LanguageType(GetUInt16(table, 6 + 4 + 12 * i)); rec[i].nameID = GetUInt16(table, 6 + 6 + 12 * i); rec[i].slen = GetUInt16(table, 6 + 8 + 12 * i); int nStrOffset = GetUInt16(table, nLargestFixedOffsetPos); diff --git a/vcl/source/fontsubset/ttcr.cxx b/vcl/source/fontsubset/ttcr.cxx index ac335512a6bc..a29dd9f61944 100644 --- a/vcl/source/fontsubset/ttcr.cxx +++ b/vcl/source/fontsubset/ttcr.cxx @@ -779,7 +779,7 @@ static int GetRawData_name(TrueTypeTable *_this, sal_uInt8 **ptr, sal_uInt32 *le for (i = 0; i < n; i++) { PutUInt16(nr[i].platformID, p1, 0, 1); PutUInt16(nr[i].encodingID, p1, 2, 1); - PutUInt16(nr[i].languageID, p1, 4, 1); + PutUInt16((sal_uInt16)nr[i].languageID, p1, 4, 1); PutUInt16(nr[i].nameID, p1, 6, 1); PutUInt16(nr[i].slen, p1, 8, 1); PutUInt16((sal_uInt16)(p2 - (name + 6 + 12 * n)), p1, 10, 1); diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx index e8d86b8b018e..d339f7f5ff46 100644 --- a/vcl/source/gdi/gdimtf.cxx +++ b/vcl/source/gdi/gdimtf.cxx @@ -346,7 +346,7 @@ void GDIMetaFile::Play( OutputDevice* pOut, size_t nPos ) // those states. pOut->Push( PushFlags::TEXTLAYOUTMODE|PushFlags::TEXTLANGUAGE ); pOut->SetLayoutMode( ComplexTextLayoutFlags::Default ); - pOut->SetDigitLanguage( 0 ); + pOut->SetDigitLanguage( LANGUAGE_SYSTEM ); SAL_INFO( "vcl.gdi", "GDIMetaFile::Play on device of size: " << pOut->GetOutputSizePixel().Width() << " " << pOut->GetOutputSizePixel().Height()); @@ -499,7 +499,7 @@ void GDIMetaFile::Play( OutputDevice* pOut, const Point& rPos, // recent add-ons. Newer metafiles must of course explicitly set // those states. pOut->SetLayoutMode( ComplexTextLayoutFlags::Default ); - pOut->SetDigitLanguage( 0 ); + pOut->SetDigitLanguage( LANGUAGE_SYSTEM ); Play( pOut ); diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx index 1ce4182bafa4..1376476634c2 100644 --- a/vcl/source/gdi/metaact.cxx +++ b/vcl/source/gdi/metaact.cxx @@ -3443,13 +3443,15 @@ void MetaTextLanguageAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) { MetaAction::Write(rOStm, pData); VersionCompat aCompat(rOStm, StreamMode::WRITE, 1); - rOStm.WriteUInt16( meTextLanguage ); + rOStm.WriteUInt16( (sal_uInt16)meTextLanguage ); } void MetaTextLanguageAction::Read( SvStream& rIStm, ImplMetaReadData* ) { VersionCompat aCompat(rIStm, StreamMode::READ); - rIStm.ReadUInt16( meTextLanguage ); + sal_uInt16 nTmp = 0; + rIStm.ReadUInt16( nTmp ); + meTextLanguage = static_cast<LanguageType>(nTmp); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index bf250518495c..aaa8f9710ef2 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -13148,7 +13148,7 @@ bool PDFWriterImpl::setStructureAttributeNumerical( enum PDFWriter::StructAttrib { if( eAttr == PDFWriter::Language ) { - m_aStructure[ m_nCurrentStructElement ].m_aLocale = LanguageTag( (LanguageType)nValue ).getLocale(); + m_aStructure[ m_nCurrentStructElement ].m_aLocale = LanguageTag( LanguageType(nValue) ).getLocale(); return true; } diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx index 764ad4ce75e1..bf362a034b06 100644 --- a/vcl/source/gdi/sallayout.cxx +++ b/vcl/source/gdi/sallayout.cxx @@ -148,82 +148,63 @@ sal_UCS4 GetLocalizedChar( sal_UCS4 nChar, LanguageType eLang ) // eLang & LANGUAGE_MASK_PRIMARY catches language independent of region. // CAVEAT! To some like Mongolian MS assigned the same primary language // although the script type is different! - switch( eLang & LANGUAGE_MASK_PRIMARY ) - { - default: - nOffset = 0; - break; - case LANGUAGE_ARABIC_SAUDI_ARABIA & LANGUAGE_MASK_PRIMARY: - nOffset = 0x0660 - '0'; // arabic-indic digits - break; - case LANGUAGE_FARSI & LANGUAGE_MASK_PRIMARY: - case LANGUAGE_URDU_PAKISTAN & LANGUAGE_MASK_PRIMARY: - case LANGUAGE_PUNJABI & LANGUAGE_MASK_PRIMARY: //??? - case LANGUAGE_SINDHI & LANGUAGE_MASK_PRIMARY: - nOffset = 0x06F0 - '0'; // eastern arabic-indic digits - break; - case LANGUAGE_BENGALI & LANGUAGE_MASK_PRIMARY: - nOffset = 0x09E6 - '0'; // bengali - break; - case LANGUAGE_HINDI & LANGUAGE_MASK_PRIMARY: - nOffset = 0x0966 - '0'; // devanagari - break; - case LANGUAGE_AMHARIC_ETHIOPIA & LANGUAGE_MASK_PRIMARY: - case LANGUAGE_TIGRIGNA_ETHIOPIA & LANGUAGE_MASK_PRIMARY: + LanguageType pri = primary(eLang); + if( pri == primary(LANGUAGE_ARABIC_SAUDI_ARABIA) ) + nOffset = 0x0660 - '0'; // arabic-indic digits + else if ( pri.anyOf( + primary(LANGUAGE_FARSI), + primary(LANGUAGE_URDU_PAKISTAN), + primary(LANGUAGE_PUNJABI), //??? + primary(LANGUAGE_SINDHI))) + nOffset = 0x06F0 - '0'; // eastern arabic-indic digits + else if ( pri == primary(LANGUAGE_BENGALI) ) + nOffset = 0x09E6 - '0'; // bengali + else if ( pri == primary(LANGUAGE_HINDI) ) + nOffset = 0x0966 - '0'; // devanagari + else if ( pri.anyOf( + primary(LANGUAGE_AMHARIC_ETHIOPIA), + primary(LANGUAGE_TIGRIGNA_ETHIOPIA))) // TODO case: - nOffset = 0x1369 - '0'; // ethiopic - break; - case LANGUAGE_GUJARATI & LANGUAGE_MASK_PRIMARY: - nOffset = 0x0AE6 - '0'; // gujarati - break; + nOffset = 0x1369 - '0'; // ethiopic + else if ( pri == primary(LANGUAGE_GUJARATI) ) + nOffset = 0x0AE6 - '0'; // gujarati #ifdef LANGUAGE_GURMUKHI // TODO case: - case LANGUAGE_GURMUKHI & LANGUAGE_MASK_PRIMARY: - nOffset = 0x0A66 - '0'; // gurmukhi - break; + else if ( pri == primary(LANGUAGE_GURMUKHI) ) + nOffset = 0x0A66 - '0'; // gurmukhi #endif - case LANGUAGE_KANNADA & LANGUAGE_MASK_PRIMARY: - nOffset = 0x0CE6 - '0'; // kannada - break; - case LANGUAGE_KHMER & LANGUAGE_MASK_PRIMARY: - nOffset = 0x17E0 - '0'; // khmer - break; - case LANGUAGE_LAO & LANGUAGE_MASK_PRIMARY: - nOffset = 0x0ED0 - '0'; // lao - break; - case LANGUAGE_MALAYALAM & LANGUAGE_MASK_PRIMARY: - nOffset = 0x0D66 - '0'; // malayalam - break; - case LANGUAGE_MONGOLIAN_MONGOLIAN_LSO & LANGUAGE_MASK_PRIMARY: - switch (eLang) - { - case LANGUAGE_MONGOLIAN_MONGOLIAN_MONGOLIA: - case LANGUAGE_MONGOLIAN_MONGOLIAN_CHINA: - case LANGUAGE_MONGOLIAN_MONGOLIAN_LSO: - nOffset = 0x1810 - '0'; // mongolian - break; - default: - nOffset = 0; // mongolian cyrillic - break; - } - break; - case LANGUAGE_BURMESE & LANGUAGE_MASK_PRIMARY: - nOffset = 0x1040 - '0'; // myanmar - break; - case LANGUAGE_ODIA & LANGUAGE_MASK_PRIMARY: - nOffset = 0x0B66 - '0'; // odia - break; - case LANGUAGE_TAMIL & LANGUAGE_MASK_PRIMARY: - nOffset = 0x0BE7 - '0'; // tamil - break; - case LANGUAGE_TELUGU & LANGUAGE_MASK_PRIMARY: - nOffset = 0x0C66 - '0'; // telugu - break; - case LANGUAGE_THAI & LANGUAGE_MASK_PRIMARY: - nOffset = 0x0E50 - '0'; // thai - break; - case LANGUAGE_TIBETAN & LANGUAGE_MASK_PRIMARY: - nOffset = 0x0F20 - '0'; // tibetan - break; + else if ( pri == primary(LANGUAGE_KANNADA) ) + nOffset = 0x0CE6 - '0'; // kannada + else if ( pri == primary(LANGUAGE_KHMER)) + nOffset = 0x17E0 - '0'; // khmer + else if ( pri == primary(LANGUAGE_LAO) ) + nOffset = 0x0ED0 - '0'; // lao + else if ( pri == primary(LANGUAGE_MALAYALAM) ) + nOffset = 0x0D66 - '0'; // malayalam + else if ( pri == primary(LANGUAGE_MONGOLIAN_MONGOLIAN_LSO)) + { + if (eLang.anyOf( + LANGUAGE_MONGOLIAN_MONGOLIAN_MONGOLIA, + LANGUAGE_MONGOLIAN_MONGOLIAN_CHINA, + LANGUAGE_MONGOLIAN_MONGOLIAN_LSO)) + nOffset = 0x1810 - '0'; // mongolian + else + nOffset = 0; // mongolian cyrillic + } + else if ( pri == primary(LANGUAGE_BURMESE) ) + nOffset = 0x1040 - '0'; // myanmar + else if ( pri == primary(LANGUAGE_ODIA) ) + nOffset = 0x0B66 - '0'; // odia + else if ( pri == primary(LANGUAGE_TAMIL) ) + nOffset = 0x0BE7 - '0'; // tamil + else if ( pri == primary(LANGUAGE_TELUGU) ) + nOffset = 0x0C66 - '0'; // telugu + else if ( pri == primary(LANGUAGE_THAI) ) + nOffset = 0x0E50 - '0'; // thai + else if ( pri == primary(LANGUAGE_TIBETAN) ) + nOffset = 0x0F20 - '0'; // tibetan + else + { + nOffset = 0; } nChar += nOffset; diff --git a/vcl/source/outdev/outdev.cxx b/vcl/source/outdev/outdev.cxx index 31449f224342..27752f25b47b 100644 --- a/vcl/source/outdev/outdev.cxx +++ b/vcl/source/outdev/outdev.cxx @@ -96,7 +96,7 @@ OutputDevice::OutputDevice() : meTextAlign = maFont.GetAlignment(); meRasterOp = RasterOp::OverPaint; mnAntialiasing = AntialiasingFlags::NONE; - meTextLanguage = 0; // TODO: get default from configuration? + meTextLanguage = LANGUAGE_SYSTEM; // TODO: get default from configuration? mbLineColor = true; mbFillColor = true; mbInitLineColor = true; |