diff options
author | Thomas Arnhold <thomas@arnhold.org> | 2012-02-18 14:33:54 +0100 |
---|---|---|
committer | Thomas Arnhold <thomas@arnhold.org> | 2012-02-18 14:33:54 +0100 |
commit | 04af52609aef5b4ccbbf82553ac190ef43700652 (patch) | |
tree | c7596981f1f2375e85a0c488005838f9c70a1c74 /vcl/source/gdi/outdev3.cxx | |
parent | 8ecea48c050b77c86159ebdcb41096160ec6a090 (diff) |
vcl: bring ImplFindByLocale back (windows build)
Partially reverts 78e9ba6febb7402d4661fbf7934a2526efc8629a
This is used by WinGlyphFallbackSubstititution::FindFontSubstitute
Diffstat (limited to 'vcl/source/gdi/outdev3.cxx')
-rwxr-xr-x | vcl/source/gdi/outdev3.cxx | 77 |
1 files changed, 73 insertions, 4 deletions
diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx index 598823e675db..6cd8e34d8891 100755 --- a/vcl/source/gdi/outdev3.cxx +++ b/vcl/source/gdi/outdev3.cxx @@ -26,6 +26,8 @@ * ************************************************************************/ +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_vcl.hxx" #include "i18npool/mslangid.hxx" @@ -416,6 +418,35 @@ sal_uInt16 OutputDevice::GetFontSubstituteCount() // ----------------------------------------------------------------------- +void OutputDevice::GetFontSubstitute( sal_uInt16 n, + XubString& rFontName, + XubString& rReplaceFontName, + sal_uInt16& rFlags ) +{ + const ImplDirectFontSubstitution* pSubst = ImplGetSVData()->maGDIData.mpDirectFontSubst; + if( pSubst ) + pSubst->GetFontSubstitute( n, rFontName, rReplaceFontName, rFlags ); +} + +// ----------------------------------------------------------------------- + +bool ImplDirectFontSubstitution::GetFontSubstitute( int nIndex, + String& rFontName, String& rSubstFontName, sal_uInt16& rFlags ) const +{ + FontSubstList::const_iterator it = maFontSubstList.begin(); + for( int nCount = 0; (it != maFontSubstList.end()) && (nCount++ != nIndex); ++it ) ; + if( it == maFontSubstList.end() ) + return false; + + const ImplFontSubstEntry* pEntry = &(*it); + rFontName = pEntry->maName; + rSubstFontName = pEntry->maReplaceName; + rFlags = pEntry->mnFlags; + return true; +} + +// ----------------------------------------------------------------------- + bool ImplDirectFontSubstitution::FindFontSubstitute( String& rSubstName, const String& rSearchName, sal_uInt16 nFlags ) const { @@ -1668,6 +1699,18 @@ void ImplDevFontList::InitMatchData() const } } +//---------------------------------------------------------------------------- +ImplDevFontListData* ImplDevFontList::ImplFindByLocale( com::sun::star::lang::Locale& rLocale ) const +{ + // get the default font for a specified locale + const DefaultFontConfiguration& rDefaults = DefaultFontConfiguration::get(); + const String aDefault = rDefaults.getUserInterfaceFont( rLocale ); + ImplDevFontListData* pFontData = ImplFindByTokenNames( aDefault ); + if( pFontData ) + return pFontData; + return NULL; +} + // ----------------------------------------------------------------------- ImplDevFontListData* ImplDevFontList::ImplFindByAttributes( sal_uLong nSearchType, @@ -3135,6 +3178,15 @@ bool OutputDevice::ImplNewFont() const // ----------------------------------------------------------------------- +long OutputDevice::ImplGetTextWidth( const SalLayout& rSalLayout ) const +{ + long nWidth = rSalLayout.GetTextWidth(); + nWidth /= rSalLayout.GetUnitsPerPixel(); + return nWidth; +} + +// ----------------------------------------------------------------------- + void OutputDevice::ImplDrawTextRect( long nBaseX, long nBaseY, long nDistX, long nDistY, long nWidth, long nHeight ) { @@ -5460,6 +5512,13 @@ void OutputDevice::DrawTextLine( const Point& rPos, long nWidth, // ------------------------------------------------------------------------ +sal_Bool OutputDevice::IsTextUnderlineAbove( const Font& rFont ) +{ + return ImplIsUnderlineAbove( rFont ); +} + +// ------------------------------------------------------------------------ + void OutputDevice::DrawWaveLine( const Point& rStartPos, const Point& rEndPos, sal_uInt16 nStyle ) { @@ -5967,9 +6026,7 @@ SalLayout* OutputDevice::ImplLayout( const String& rOrigStr, if( bFilter ) { xub_StrLen nCutStart, nCutStop, nOrgLen = nLen; - rtl::OUString aTmpStr(aStr); - bool bFiltered = mpGraphics->filterText( rOrigStr, aTmpStr, nMinIndex, nLen, nCutStart, nCutStop ); - aStr = aTmpStr; + bool bFiltered = mpGraphics->filterText( rOrigStr, aStr, nMinIndex, nLen, nCutStart, nCutStop ); if( !nLen ) return NULL; @@ -6416,7 +6473,8 @@ void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const Rectangle& r nFormatLines = nLines-1; pLineInfo = aMultiLineInfo.GetLine( nFormatLines ); - aLastLine = convertLineEnd(aStr.Copy(pLineInfo->GetIndex()), LINEEND_LF); + aLastLine = aStr.Copy( pLineInfo->GetIndex() ); + aLastLine.ConvertLineEnd( LINEEND_LF ); // Alle LineFeed's durch Spaces ersetzen xub_StrLen nLastLineLen = aLastLine.Len(); for ( i = 0; i < nLastLineLen; i++ ) @@ -7438,6 +7496,17 @@ long OutputDevice::GetMinKashida() const ImplFontMetricData* pMetric = &(pEntry->maMetric); return ImplDevicePixelToLogicWidth( pMetric->mnMinKashida ); } +// ----------------------------------------------------------------------- + +long OutputDevice::GetMinKashida( const Font& rFont ) const +{ + // select font, query Kashida, select original font again + Font aOldFont = GetFont(); + const_cast<OutputDevice*>(this)->SetFont( rFont ); + long aKashida = GetMinKashida(); + const_cast<OutputDevice*>(this)->SetFont( aOldFont ); + return aKashida; +} // ----------------------------------------------------------------------- xub_StrLen OutputDevice::ValidateKashidas ( const String& rTxt, |