summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Sherlock <chris.sherlock79@gmail.com>2016-01-09 11:44:01 +1100
committerChris Sherlock <chris.sherlock79@gmail.com>2016-01-09 11:44:19 +1100
commit85ac3cd63f6720ff2d3c4b7491f4ad296219fa53 (patch)
treeaa8c3fba6a62d8a8ff8b8aea9708c86fc35eeae5
parent6ee8ba1e451f7a2bd890b265d0c0c0030519da31 (diff)
vcl: move FontSelectPatternAttributes constructor to fontselect.cxx
Change-Id: I49041e086c1da6d9cc23781e10b00997f227da8e
-rw-r--r--vcl/source/font/fontselect.cxx68
-rw-r--r--vcl/source/outdev/font.cxx32
2 files changed, 68 insertions, 32 deletions
diff --git a/vcl/source/font/fontselect.cxx b/vcl/source/font/fontselect.cxx
index e1b875734a42..82c33f56c9ec 100644
--- a/vcl/source/font/fontselect.cxx
+++ b/vcl/source/font/fontselect.cxx
@@ -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.
#ifdef WNT
FontSelectPatternAttributes::FontSelectPatternAttributes( const PhysicalFontFace& rFontData,
@@ -89,6 +123,40 @@ FontSelectPatternAttributes::FontSelectPatternAttributes( const PhysicalFontFace
// 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,
const Size& rSize, float fExactHeight, int nOrientation, bool bVertical )
: FontSelectPatternAttributes(rFontData, rSize, fExactHeight, nOrientation, bVertical)
diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx
index 5032cbbc293b..80c85fc7af48 100644
--- a/vcl/source/outdev/font.cxx
+++ b/vcl/source/outdev/font.cxx
@@ -979,38 +979,6 @@ vcl::Font OutputDevice::GetDefaultFont( DefaultFontType nType, LanguageType eLan
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
{
if( !mpFontCollection->Count() )