summaryrefslogtreecommitdiff
path: root/vcl/source/app/svapp.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-05-09 11:07:34 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-05-09 13:47:57 +0100
commit60eff2f44270c04ba95ee16444880c095f4d2b7b (patch)
treef05d5ff77f530f9b3451bd7f30d21908f05ba68a /vcl/source/app/svapp.cxx
parentf6422b3dfcb00e451ef103127aace1856dc752a9 (diff)
Revert font initialization foo
this reverts 081a0854635f4bc9f6f743ef4e2675c208405f74 because the heights and widths of the non .ui-converted dialogs are all too low and everything is squished in them Change-Id: I103eda4b3d43365c02ecedb6f37b995a682b2cf9
Diffstat (limited to 'vcl/source/app/svapp.cxx')
-rw-r--r--vcl/source/app/svapp.cxx57
1 files changed, 1 insertions, 56 deletions
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index a750ad03d8f8..10458ef5b44d 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -549,7 +549,7 @@ void Application::SetSettings( const AllSettings& rSettings )
{
nOldDPIX = pFirstFrame->mnDPIX;
nOldDPIY = pFirstFrame->mnDPIY;
- Application::InitAppFontData();
+ Window::ImplInitAppFontData(pFirstFrame);
}
Window* pFrame = pFirstFrame;
while ( pFrame )
@@ -1653,59 +1653,4 @@ Application::createFolderPicker( const Reference< uno::XComponentContext >& xSM
return pSVData->mpDefInst->createFolderPicker( xSM );
}
-void Application::InitAppFontData()
-{
- ImplSVData* pSVData = ImplGetSVData();
-
- Window *pWindow = pSVData->mpDefaultWin;
-
- if (!pWindow)
- pWindow = new WorkWindow( NULL, 0 );
-
- 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;
-
- // a temporary WorkWindow was created, we need to delete it
- if (!pSVData->mpDefaultWin && pWindow)
- delete pWindow;
-}
-
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */