Kaydet (Commit) 85ac3cd6 authored tarafından Chris Sherlock's avatar Chris Sherlock

vcl: move FontSelectPatternAttributes constructor to fontselect.cxx

Change-Id: I49041e086c1da6d9cc23781e10b00997f227da8e
üst 6ee8ba1e
...@@ -71,6 +71,40 @@ FontSelectPattern::FontSelectPattern( const vcl::Font& rFont, ...@@ -71,6 +71,40 @@ FontSelectPattern::FontSelectPattern( const vcl::Font& rFont,
{ {
} }
FontSelectPatternAttributes::FontSelectPatternAttributes( const vcl::Font& rFont,
const OUString& rSearchName, const Size& rSize, float fExactHeight )
: maSearchName( rSearchName )
, mnWidth( rSize.Width() )
, mnHeight( rSize.Height() )
, mfExactHeight( fExactHeight)
, mnOrientation( rFont.GetOrientation() )
, meLanguage( rFont.GetLanguage() )
, mbVertical( rFont.IsVertical() )
, mbNonAntialiased( false )
, mbEmbolden( false )
{
maTargetName = GetFamilyName();
rFont.GetFontAttributes( *this );
// normalize orientation between 0 and 3600
if( 3600 <= (unsigned)mnOrientation )
{
if( mnOrientation >= 0 )
mnOrientation %= 3600;
else
mnOrientation = 3600 - (-mnOrientation % 3600);
}
// normalize width and height
if( mnHeight < 0 )
mnHeight = -mnHeight;
if( mnWidth < 0 )
mnWidth = -mnWidth;
}
// NOTE: this ctor is still used on Windows. Do not remove. // NOTE: this ctor is still used on Windows. Do not remove.
#ifdef WNT #ifdef WNT
FontSelectPatternAttributes::FontSelectPatternAttributes( const PhysicalFontFace& rFontData, FontSelectPatternAttributes::FontSelectPatternAttributes( const PhysicalFontFace& rFontData,
...@@ -89,6 +123,40 @@ FontSelectPatternAttributes::FontSelectPatternAttributes( const PhysicalFontFace ...@@ -89,6 +123,40 @@ FontSelectPatternAttributes::FontSelectPatternAttributes( const PhysicalFontFace
// NOTE: no normalization for width/height/orientation // NOTE: no normalization for width/height/orientation
} }
FontSelectPatternAttributes::FontSelectPatternAttributes( const vcl::Font& rFont,
const OUString& rSearchName, const Size& rSize, float fExactHeight )
: maSearchName( rSearchName )
, mnWidth( rSize.Width() )
, mnHeight( rSize.Height() )
, mfExactHeight( fExactHeight)
, mnOrientation( rFont.GetOrientation() )
, meLanguage( rFont.GetLanguage() )
, mbVertical( rFont.IsVertical() )
, mbNonAntialiased( false )
, mbEmbolden( false )
{
maTargetName = GetFamilyName();
rFont.GetFontAttributes( *this );
// normalize orientation between 0 and 3600
if( 3600 <= (unsigned)mnOrientation )
{
if( mnOrientation >= 0 )
mnOrientation %= 3600;
else
mnOrientation = 3600 - (-mnOrientation % 3600);
}
// normalize width and height
if( mnHeight < 0 )
mnHeight = -mnHeight;
if( mnWidth < 0 )
mnWidth = -mnWidth;
}
FontSelectPattern::FontSelectPattern( const PhysicalFontFace& rFontData, FontSelectPattern::FontSelectPattern( const PhysicalFontFace& rFontData,
const Size& rSize, float fExactHeight, int nOrientation, bool bVertical ) const Size& rSize, float fExactHeight, int nOrientation, bool bVertical )
: FontSelectPatternAttributes(rFontData, rSize, fExactHeight, nOrientation, bVertical) : FontSelectPatternAttributes(rFontData, rSize, fExactHeight, nOrientation, bVertical)
......
...@@ -979,38 +979,6 @@ vcl::Font OutputDevice::GetDefaultFont( DefaultFontType nType, LanguageType eLan ...@@ -979,38 +979,6 @@ vcl::Font OutputDevice::GetDefaultFont( DefaultFontType nType, LanguageType eLan
return aFont; return aFont;
} }
FontSelectPatternAttributes::FontSelectPatternAttributes( const vcl::Font& rFont,
const OUString& rSearchName, const Size& rSize, float fExactHeight )
: maSearchName( rSearchName )
, mnWidth( rSize.Width() )
, mnHeight( rSize.Height() )
, mfExactHeight( fExactHeight)
, mnOrientation( rFont.GetOrientation() )
, meLanguage( rFont.GetLanguage() )
, mbVertical( rFont.IsVertical() )
, mbNonAntialiased( false )
, mbEmbolden( false )
{
maTargetName = GetFamilyName();
rFont.GetFontAttributes( *this );
// normalize orientation between 0 and 3600
if( 3600 <= (unsigned)mnOrientation )
{
if( mnOrientation >= 0 )
mnOrientation %= 3600;
else
mnOrientation = 3600 - (-mnOrientation % 3600);
}
// normalize width and height
if( mnHeight < 0 )
mnHeight = -mnHeight;
if( mnWidth < 0 )
mnWidth = -mnWidth;
}
void OutputDevice::ImplInitFontList() const void OutputDevice::ImplInitFontList() const
{ {
if( !mpFontCollection->Count() ) if( !mpFontCollection->Count() )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment