summaryrefslogtreecommitdiff
path: root/vcl/source/window
diff options
context:
space:
mode:
authorChris Sherlock <chris.sherlock79@gmail.com>2014-05-03 23:23:06 +1000
committerChris Sherlock <chris.sherlock79@gmail.com>2014-05-04 06:32:53 +0000
commitf76026a43acc65465882924796d93e635c35fd90 (patch)
tree607708153a16190d6370c5932cce1c116976f18e /vcl/source/window
parente4d61b3c556189bf0733ab6e7bedaf975427a35a (diff)
Move ImplInitAppFontData from Window to Application
I have renamed ImplInitAppFontData to InitAppFontData and moved it from Window to Application. This is because this is something that sets *application* global variables, it just so happens it gets it from a Window parameter. But it should be set when the application starts, so I have moved it to Main(). Change-Id: I9d98aa5b533166f91352218af267930034648c7a Reviewed-on: https://gerrit.libreoffice.org/9242 Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
Diffstat (limited to 'vcl/source/window')
-rw-r--r--vcl/source/window/window.cxx48
1 files changed, 0 insertions, 48 deletions
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 2747c4547de1..d1bc3491d508 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -533,50 +533,6 @@ bool Window::HasMirroredGraphics() const
return pOutDev->OutputDevice::HasMirroredGraphics();
}
-void Window::ImplInitAppFontData( Window* pWindow )
-{
- ImplSVData* pSVData = ImplGetSVData();
- long nTextHeight = pWindow->GetTextHeight();
- long nTextWidth = pWindow->approximate_char_width() * 8;
- long nSymHeight = nTextHeight*4;
- // Make the basis wider if the font is too narrow
- // such that the dialog looks symmetrical and does not become too narrow.
- // Add some extra space when the dialog has the same width,
- // as a little more space is better.
- if ( nSymHeight > nTextWidth )
- nTextWidth = nSymHeight;
- else if ( nSymHeight+5 > nTextWidth )
- nTextWidth = nSymHeight+5;
- pSVData->maGDIData.mnAppFontX = nTextWidth * 10 / 8;
- pSVData->maGDIData.mnAppFontY = nTextHeight * 10;
-
- // FIXME: this is currently only on OS X, check with other
- // platforms
- if( pSVData->maNWFData.mbNoFocusRects )
- {
- // try to find out whether there is a large correction
- // of control sizes, if yes, make app font scalings larger
- // so dialog positioning is not completely off
- ImplControlValue aControlValue;
- Rectangle aCtrlRegion( Point(), Size( nTextWidth < 10 ? 10 : nTextWidth, nTextHeight < 10 ? 10 : nTextHeight ) );
- Rectangle aBoundingRgn( aCtrlRegion );
- Rectangle aContentRgn( aCtrlRegion );
- if( pWindow->GetNativeControlRegion( CTRL_EDITBOX, PART_ENTIRE_CONTROL, aCtrlRegion,
- CTRL_STATE_ENABLED, aControlValue, OUString(),
- aBoundingRgn, aContentRgn ) )
- {
- // comment: the magical +6 is for the extra border in bordered
- // (which is the standard) edit fields
- if( aContentRgn.GetHeight() - nTextHeight > (nTextHeight+4)/4 )
- pSVData->maGDIData.mnAppFontY = (aContentRgn.GetHeight()-4) * 10;
- }
- }
-
- pSVData->maGDIData.mnRealAppFontX = pSVData->maGDIData.mnAppFontX;
- if ( pSVData->maAppData.mnDialogScaleX )
- pSVData->maGDIData.mnAppFontX += (pSVData->maGDIData.mnAppFontX*pSVData->maAppData.mnDialogScaleX)/100;
-}
-
bool Window::ImplCheckUIFont( const Font& rFont )
{
if( ImplGetSVData()->maGDIData.mbNativeFontConfig )
@@ -1198,10 +1154,6 @@ void Window::ImplInit( Window* pParent, WinBits nStyle, SystemParentData* pSyste
ImplUpdatePos();
- // calculate app font res (except for the Intro Window or the default window)
- if ( mpWindowImpl->mbFrame && !pSVData->maGDIData.mnAppFontX && ! (nStyle & (WB_INTROWIN|WB_DEFAULTWIN)) )
- ImplInitAppFontData( this );
-
if ( GetAccessibleParentWindow() && GetParent() != Application::GetDefDialogParent() )
GetAccessibleParentWindow()->ImplCallEventListeners( VCLEVENT_WINDOW_CHILDCREATED, this );
}