summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorHerbert Duerr [hdu] <herbert.duerr@oracle.com>2010-11-15 16:04:30 +0100
committerHerbert Duerr [hdu] <herbert.duerr@oracle.com>2010-11-15 16:04:30 +0100
commit9015fa6906c13e8c2e36ed29f1ce5c222612b6e4 (patch)
treeaafb1a3320d917918dca3157ad4db325fa8b3e8c /vcl
parent2d2592be455526fd7bfa9611eb166f37193fd4d3 (diff)
#i112446# win-port baseline nowdays assumes SalShlData::mbWNT==true
Diffstat (limited to 'vcl')
-rw-r--r--vcl/win/inc/saldata.hxx1
-rw-r--r--vcl/win/source/app/saldata.cxx37
-rw-r--r--vcl/win/source/app/salinst.cxx48
-rw-r--r--vcl/win/source/gdi/salgdi3.cxx208
-rw-r--r--vcl/win/source/gdi/winlayout.cxx90
-rwxr-xr-xvcl/win/source/window/salframe.cxx129
-rw-r--r--vcl/win/source/window/salobj.cxx12
7 files changed, 63 insertions, 462 deletions
diff --git a/vcl/win/inc/saldata.hxx b/vcl/win/inc/saldata.hxx
index ec67272ed07f..a960d117eed0 100644
--- a/vcl/win/inc/saldata.hxx
+++ b/vcl/win/inc/saldata.hxx
@@ -154,7 +154,6 @@ struct SalShlData
UINT mnWheelScrollChars; // WheelScrollChars
UINT mnWheelMsgId; // Wheel-Message-Id fuer W95
WORD mnVersion; // System-Version (311 == 3.11)
- WIN_BOOL mbWNT; // kein W16/W95/W98 sondern ein NT
WIN_BOOL mbW40; // Is System-Version >= 4.0
WIN_BOOL mbWXP; // Windows XP
WIN_BOOL mbWPrinter; // true: use unicode printer functions
diff --git a/vcl/win/source/app/saldata.cxx b/vcl/win/source/app/saldata.cxx
index bb8a198a96e6..5f94029ad817 100644
--- a/vcl/win/source/app/saldata.cxx
+++ b/vcl/win/source/app/saldata.cxx
@@ -119,42 +119,28 @@ int ImplSalWICompareAscii( const wchar_t* pStr1, const char* pStr2 )
LONG ImplSetWindowLong( HWND hWnd, int nIndex, DWORD dwNewLong )
{
- if ( aSalShlData.mbWNT )
- return SetWindowLongW( hWnd, nIndex, dwNewLong );
- else
- return SetWindowLongA( hWnd, nIndex, dwNewLong );
+ return SetWindowLongW( hWnd, nIndex, dwNewLong );
}
// -----------------------------------------------------------------------
LONG ImplGetWindowLong( HWND hWnd, int nIndex )
{
- if ( aSalShlData.mbWNT )
- return GetWindowLongW( hWnd, nIndex );
- else
- return GetWindowLongA( hWnd, nIndex );
+ return GetWindowLongW( hWnd, nIndex );
}
// -----------------------------------------------------------------------
WIN_BOOL ImplPostMessage( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam )
{
- if ( aSalShlData.mbWNT )
- return PostMessageW( hWnd, nMsg, wParam, lParam );
- else
- return PostMessageA( hWnd, nMsg, wParam, lParam );
+ return PostMessageW( hWnd, nMsg, wParam, lParam );
}
// -----------------------------------------------------------------------
WIN_BOOL ImplSendMessage( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam )
{
- WIN_BOOL bRet;
- if ( aSalShlData.mbWNT )
- bRet = SendMessageW( hWnd, nMsg, wParam, lParam );
- else
- bRet = SendMessageA( hWnd, nMsg, wParam, lParam );
-
+ WIN_BOOL bRet = SendMessageW( hWnd, nMsg, wParam, lParam );
return bRet;
}
@@ -162,29 +148,20 @@ WIN_BOOL ImplSendMessage( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam )
WIN_BOOL ImplGetMessage( LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax )
{
- if ( aSalShlData.mbWNT )
- return GetMessageW( lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax );
- else
- return GetMessageA( lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax );
+ return GetMessageW( lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax );
}
// -----------------------------------------------------------------------
WIN_BOOL ImplPeekMessage( LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg )
{
- if ( aSalShlData.mbWNT )
- return PeekMessageW( lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax, wRemoveMsg );
- else
- return PeekMessageA( lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax, wRemoveMsg );
+ return PeekMessageW( lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax, wRemoveMsg );
}
// -----------------------------------------------------------------------
LONG ImplDispatchMessage( CONST MSG *lpMsg )
{
- if ( aSalShlData.mbWNT )
- return DispatchMessageW( lpMsg );
- else
- return DispatchMessageA( lpMsg );
+ return DispatchMessageW( lpMsg );
}
diff --git a/vcl/win/source/app/salinst.cxx b/vcl/win/source/app/salinst.cxx
index 419723ee6442..d05f64d147ed 100644
--- a/vcl/win/source/app/salinst.cxx
+++ b/vcl/win/source/app/salinst.cxx
@@ -503,7 +503,6 @@ SalInstance* CreateSalInstance()
SalData* pSalData = GetSalData();
// determine the windows version
- aSalShlData.mbWNT = 0;
aSalShlData.mbWXP = 0;
aSalShlData.mbWPrinter = 0;
WORD nVer = (WORD)GetVersion();
@@ -516,7 +515,6 @@ SalInstance* CreateSalInstance()
{
if ( aSalShlData.maVersionInfo.dwPlatformId == VER_PLATFORM_WIN32_NT )
{
- aSalShlData.mbWNT = 1;
// Windows XP ?
if ( aSalShlData.maVersionInfo.dwMajorVersion > 5 ||
( aSalShlData.maVersionInfo.dwMajorVersion == 5 && aSalShlData.maVersionInfo.dwMinorVersion >= 1 ) )
@@ -531,8 +529,6 @@ SalInstance* CreateSalInstance()
// register frame class
if ( !pSalData->mhPrevInst )
{
- if ( aSalShlData.mbWNT )
- {
WNDCLASSEXW aWndClassEx;
aWndClassEx.cbSize = sizeof( aWndClassEx );
aWndClassEx.style = CS_OWNDC;
@@ -568,53 +564,11 @@ SalInstance* CreateSalInstance()
aWndClassEx.lpszClassName = SAL_COM_CLASSNAMEW;
if ( !RegisterClassExW( &aWndClassEx ) )
return NULL;
- }
- else
- {
- WNDCLASSEXA aWndClassEx;
- aWndClassEx.cbSize = sizeof( aWndClassEx );
- aWndClassEx.style = CS_OWNDC;
- aWndClassEx.lpfnWndProc = SalFrameWndProcA;
- aWndClassEx.cbClsExtra = 0;
- aWndClassEx.cbWndExtra = SAL_FRAME_WNDEXTRA;
- aWndClassEx.hInstance = pSalData->mhInst;
- aWndClassEx.hCursor = 0;
- aWndClassEx.hbrBackground = 0;
- aWndClassEx.lpszMenuName = 0;
- aWndClassEx.lpszClassName = SAL_FRAME_CLASSNAMEA;
- ImplLoadSalIcon( SAL_RESID_ICON_DEFAULT, aWndClassEx.hIcon, aWndClassEx.hIconSm );
- if ( !RegisterClassExA( &aWndClassEx ) )
- return NULL;
-
- aWndClassEx.hIcon = 0;
- aWndClassEx.hIconSm = 0;
- aWndClassEx.style |= CS_SAVEBITS;
- aWndClassEx.lpszClassName = SAL_SUBFRAME_CLASSNAMEA;
- if ( !RegisterClassExA( &aWndClassEx ) )
- return NULL;
-
- aWndClassEx.style = 0;
- aWndClassEx.lpfnWndProc = SalComWndProcA;
- aWndClassEx.cbWndExtra = 0;
- aWndClassEx.lpszClassName = SAL_COM_CLASSNAMEA;
- if ( !RegisterClassExA( &aWndClassEx ) )
- return NULL;
- }
}
- HWND hComWnd;
- if ( aSalShlData.mbWNT )
- {
- hComWnd = CreateWindowExW( WS_EX_TOOLWINDOW, SAL_COM_CLASSNAMEW,
+ HWND hComWnd = CreateWindowExW( WS_EX_TOOLWINDOW, SAL_COM_CLASSNAMEW,
L"", WS_POPUP, 0, 0, 0, 0, 0, 0,
pSalData->mhInst, NULL );
- }
- else
- {
- hComWnd = CreateWindowExA( WS_EX_TOOLWINDOW, SAL_COM_CLASSNAMEA,
- "", WS_POPUP, 0, 0, 0, 0, 0, 0,
- pSalData->mhInst, NULL );
- }
if ( !hComWnd )
return NULL;
diff --git a/vcl/win/source/gdi/salgdi3.cxx b/vcl/win/source/gdi/salgdi3.cxx
index c8e0210196e6..29e4bd786735 100644
--- a/vcl/win/source/gdi/salgdi3.cxx
+++ b/vcl/win/source/gdi/salgdi3.cxx
@@ -1366,10 +1366,6 @@ int CALLBACK SalEnumQueryFontProcExA( const ENUMLOGFONTEXA*,
bool ImplIsFontAvailable( HDC hDC, const UniString& rName )
{
- bool bAvailable = false;
-
- if ( aSalShlData.mbWNT )
- {
// Test, if Font available
LOGFONTW aLogFont;
memset( &aLogFont, 0, sizeof( aLogFont ) );
@@ -1381,27 +1377,9 @@ bool ImplIsFontAvailable( HDC hDC, const UniString& rName )
memcpy( aLogFont.lfFaceName, rName.GetBuffer(), nNameLen*sizeof( wchar_t ) );
aLogFont.lfFaceName[nNameLen] = 0;
- EnumFontFamiliesExW( hDC, &aLogFont, (FONTENUMPROCW)SalEnumQueryFontProcExW,
- (LPARAM)(void*)&bAvailable, 0 );
- }
- else
- {
- ByteString aTemp = ImplSalGetWinAnsiString( rName );
-
- // Test, if Font available
- LOGFONTA aLogFont;
- memset( &aLogFont, 0, sizeof( aLogFont ) );
- aLogFont.lfCharSet = DEFAULT_CHARSET;
-
- UINT nNameLen = aTemp.Len();
- if ( nNameLen > sizeof( aLogFont.lfFaceName )-1 )
- nNameLen = sizeof( aLogFont.lfFaceName )-1;
- memcpy( aLogFont.lfFaceName, aTemp.GetBuffer(), nNameLen );
- aLogFont.lfFaceName[nNameLen] = 0;
-
- EnumFontFamiliesExA( hDC, &aLogFont, (FONTENUMPROCA)SalEnumQueryFontProcExA,
+ bool bAvailable = false;
+ EnumFontFamiliesExW( hDC, &aLogFont, (FONTENUMPROCW)SalEnumQueryFontProcExW,
(LPARAM)(void*)&bAvailable, 0 );
- }
return bAvailable;
}
@@ -1564,7 +1542,7 @@ HFONT WinSalGraphics::ImplDoSetFont( ImplFontSelectData* i_pFont, float& o_rFont
// only required for virtual devices, see below for details
hdcScreen = GetDC(0);
- if( aSalShlData.mbWNT )
+ if( true/*aSalShlData.mbWNT*/ )
{
LOGFONTW aLogFont;
ImplGetLogFontFromFontSelect( mhDC, i_pFont, aLogFont, true );
@@ -1624,63 +1602,6 @@ HFONT WinSalGraphics::ImplDoSetFont( ImplFontSelectData* i_pFont, float& o_rFont
hNewFont = hNewFont2;
}
}
- else
- {
- if( !mpLogFont )
- // mpLogFont is needed for getting the kerning pairs
- // TODO: get them from somewhere else
- mpLogFont = new LOGFONTA;
- LOGFONTA& aLogFont = *mpLogFont;
- ImplGetLogFontFromFontSelect( mhDC, i_pFont, aLogFont, true );
-
- // on the display we prefer Courier New when Courier is a
- // bitmap only font and we need to stretch or rotate it
- if( mbScreen
- && (i_pFont->mnWidth != 0
- || i_pFont->mnOrientation != 0
- || i_pFont->mpFontData == NULL
- || (i_pFont->mpFontData->GetHeight() != i_pFont->mnHeight))
- && !bImplSalCourierScalable
- && bImplSalCourierNew
- && (stricmp( aLogFont.lfFaceName, "Courier" ) == 0) )
- strncpy( aLogFont.lfFaceName, "Courier New", 11 );
-
- // limit font requests to MAXFONTHEIGHT to work around driver problems
- // TODO: share MAXFONTHEIGHT font instance
- if( -aLogFont.lfHeight <= MAXFONTHEIGHT )
- o_rFontScale = 1.0;
- else
- {
- o_rFontScale = -aLogFont.lfHeight / (float)MAXFONTHEIGHT;
- aLogFont.lfHeight = -MAXFONTHEIGHT;
- aLogFont.lfWidth = static_cast<LONG>( aLogFont.lfWidth / o_rFontScale );
- }
-
- hNewFont = ::CreateFontIndirectA( &aLogFont );
- if( hdcScreen )
- {
- // select font into screen hdc first to get an antialiased font
- // see knowledge base article 305290:
- // "PRB: Fonts Not Drawn Antialiased on Device Context for DirectDraw Surface"
- ::SelectFont( hdcScreen, ::SelectFont( hdcScreen , hNewFont ) );
- }
- o_rOldFont = ::SelectFont( mhDC, hNewFont );
-
- TEXTMETRICA aTextMetricA;
- // when the font doesn't work try a replacement
- if ( !::GetTextMetricsA( mhDC, &aTextMetricA ) )
- {
- // the selected font doesn't work => try a replacement
- // TODO: use its font fallback instead
- LOGFONTA aTempLogFont = aLogFont;
- strncpy( aTempLogFont.lfFaceName, "Courier New", 11 );
- aTempLogFont.lfPitchAndFamily = FIXED_PITCH;
- HFONT hNewFont2 = CreateFontIndirectA( &aTempLogFont );
- ::SelectFont( mhDC, hNewFont2 );
- ::DeleteFont( hNewFont );
- hNewFont = hNewFont2;
- }
- }
if( hdcScreen )
::ReleaseDC( NULL, hdcScreen );
@@ -1767,18 +1688,9 @@ void WinSalGraphics::GetFontMetric( ImplFontMetricData* pMetric, int nFallbackLe
// temporarily change the HDC to the font in the fallback level
HFONT hOldFont = SelectFont( mhDC, mhFonts[nFallbackLevel] );
- if ( aSalShlData.mbWNT )
- {
wchar_t aFaceName[LF_FACESIZE+60];
if( ::GetTextFaceW( mhDC, sizeof(aFaceName)/sizeof(wchar_t), aFaceName ) )
pMetric->maName = reinterpret_cast<const sal_Unicode*>(aFaceName);
- }
- else
- {
- char aFaceName[LF_FACESIZE+60];
- if( ::GetTextFaceA( mhDC, sizeof(aFaceName), aFaceName ) )
- pMetric->maName = ImplSalGetUniString( aFaceName );
- }
// get the font metric
TEXTMETRICA aWinMetric;
@@ -1842,11 +1754,6 @@ void WinSalGraphics::GetFontMetric( ImplFontMetricData* pMetric, int nFallbackLe
pMetric->mnAscent += nHalfTmpExtLeading;
pMetric->mnDescent += nOtherHalfTmpExtLeading;
-
- // #109280# HACK korean only: increase descent for wavelines and impr
- if( !aSalShlData.mbWNT )
- if( mpWinFontData[nFallbackLevel]->SupportsKorean() )
- pMetric->mnDescent += pMetric->mnExtLeading;
}
pMetric->mnMinKashida = GetMinKashidaWidth();
@@ -2000,8 +1907,6 @@ ULONG WinSalGraphics::GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs )
}
mnFontKernPairCount = 0;
- if ( aSalShlData.mbWNT )
- {
KERNINGPAIR* pPairs = NULL;
int nCount = ::GetKerningPairsW( mhDC, 0, NULL );
if( nCount )
@@ -2019,27 +1924,6 @@ ULONG WinSalGraphics::GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs )
#endif // GCP_KERN_HACK
}
}
- else
- {
- if ( !mnFontCharSetCount )
- ImplGetAllFontCharSets( this );
-
- if ( mnFontCharSetCount <= 1 )
- ImplAddKerningPairs( this );
- else
- {
- // Query All Kerning Pairs from all possible CharSets
- for ( BYTE i = 0; i < mnFontCharSetCount; i++ )
- {
- mpLogFont->lfCharSet = mpFontCharSets[i];
- HFONT hNewFont = CreateFontIndirectA( mpLogFont );
- HFONT hOldFont = SelectFont( mhDC, hNewFont );
- ImplAddKerningPairs( this );
- SelectFont( mhDC, hOldFont );
- DeleteFont( hNewFont );
- }
- }
- }
mbFontKernInit = FALSE;
@@ -2270,19 +2154,7 @@ void ImplReleaseTempFonts( SalData& rSalData )
}
else
{
- if( aSalShlData.mbWNT )
- ::RemoveFontResourceW( reinterpret_cast<LPCWSTR>(p->maFontFilePath.getStr()) );
- else
- {
- // poor man's string conversion because converter is gone
- int nLen = p->maFontFilePath.getLength();
- char* pNameA = new char[ nLen + 1 ];
- for( int i = 0; i < nLen; ++i )
- pNameA[i] = (char)(p->maFontFilePath.getStr())[i];
- pNameA[ nLen ] = 0;
- ::RemoveFontResourceA( pNameA );
- delete[] pNameA;
- }
+ ::RemoveFontResourceW( reinterpret_cast<LPCWSTR>(p->maFontFilePath.getStr()) );
}
rSalData.mpTempFontItem = p->mpNextItem;
@@ -2424,14 +2296,6 @@ bool WinSalGraphics::AddTempDevFont( ImplDevFontList* pFontList,
return false;
UINT nPreferedCharSet = DEFAULT_CHARSET;
- if ( !aSalShlData.mbWNT )
- {
- // for W98 guess charset preference from active codepage
- CHARSETINFO aCharSetInfo;
- DWORD nCP = GetACP();
- if ( TranslateCharsetInfo( (DWORD*)nCP, &aCharSetInfo, TCI_SRCCODEPAGE ) )
- nPreferedCharSet = aCharSetInfo.ciCharset;
- }
// create matching FontData struct
aDFA.mbSymbolFlag = false; // TODO: how to know it without accessing the font?
@@ -2536,24 +2400,12 @@ void WinSalGraphics::GetDevFontList( ImplDevFontList* pFontList )
if ( TranslateCharsetInfo( (DWORD*)nCP, &aCharSetInfo, TCI_SRCCODEPAGE ) )
aInfo.mnPreferedCharSet = aCharSetInfo.ciCharset;
- if ( aSalShlData.mbWNT )
- {
- LOGFONTW aLogFont;
- memset( &aLogFont, 0, sizeof( aLogFont ) );
- aLogFont.lfCharSet = DEFAULT_CHARSET;
- aInfo.mpLogFontW = &aLogFont;
- EnumFontFamiliesExW( mhDC, &aLogFont,
+ LOGFONTW aLogFont;
+ memset( &aLogFont, 0, sizeof( aLogFont ) );
+ aLogFont.lfCharSet = DEFAULT_CHARSET;
+ aInfo.mpLogFontW = &aLogFont;
+ EnumFontFamiliesExW( mhDC, &aLogFont,
(FONTENUMPROCW)SalEnumFontsProcExW, (LPARAM)(void*)&aInfo, 0 );
- }
- else
- {
- LOGFONTA aLogFont;
- memset( &aLogFont, 0, sizeof( aLogFont ) );
- aLogFont.lfCharSet = DEFAULT_CHARSET;
- aInfo.mpLogFontA = &aLogFont;
- EnumFontFamiliesExA( mhDC, &aLogFont,
- (FONTENUMPROCA)SalEnumFontsProcExA, (LPARAM)(void*)&aInfo, 0 );
- }
// Feststellen, was es fuer Courier-Schriften auf dem Bildschirm gibt,
// um in SetFont() evt. Courier auf Courier New zu mappen
@@ -2592,12 +2444,7 @@ BOOL WinSalGraphics::GetGlyphBoundRect( long nIndex, Rectangle& rRect )
GLYPHMETRICS aGM;
aGM.gmptGlyphOrigin.x = aGM.gmptGlyphOrigin.y = 0;
aGM.gmBlackBoxX = aGM.gmBlackBoxY = 0;
- DWORD nSize = GDI_ERROR;
- if ( aSalShlData.mbWNT )
- nSize = ::GetGlyphOutlineW( hDC, nIndex, nGGOFlags, &aGM, 0, NULL, &aMat );
- else if( (nGGOFlags & GGO_GLYPH_INDEX) || (nIndex <= 255) )
- nSize = ::GetGlyphOutlineA( hDC, nIndex, nGGOFlags, &aGM, 0, NULL, &aMat );
-
+ DWORD nSize = ::GetGlyphOutlineW( hDC, nIndex, nGGOFlags, &aGM, 0, NULL, &aMat );
if( nSize == GDI_ERROR )
return false;
@@ -2617,7 +2464,6 @@ BOOL WinSalGraphics::GetGlyphOutline( long nIndex,
{
rB2DPolyPoly.clear();
- BOOL bRet = FALSE;
HDC hDC = mhDC;
// use unity matrix
@@ -2631,29 +2477,20 @@ BOOL WinSalGraphics::GetGlyphOutline( long nIndex,
nIndex &= GF_IDXMASK;
GLYPHMETRICS aGlyphMetrics;
- DWORD nSize1 = GDI_ERROR;
- if ( aSalShlData.mbWNT )
- nSize1 = ::GetGlyphOutlineW( hDC, nIndex, nGGOFlags, &aGlyphMetrics, 0, NULL, &aMat );
- else if( (nGGOFlags & GGO_GLYPH_INDEX) || (nIndex <= 255) )
- nSize1 = ::GetGlyphOutlineA( hDC, nIndex, nGGOFlags, &aGlyphMetrics, 0, NULL, &aMat );
-
+ const DWORD nSize1 = ::GetGlyphOutlineW( hDC, nIndex, nGGOFlags, &aGlyphMetrics, 0, NULL, &aMat );
if( !nSize1 ) // blank glyphs are ok
- bRet = TRUE;
- else if( nSize1 != GDI_ERROR )
- {
- BYTE* pData = new BYTE[ nSize1 ];
- DWORD nSize2;
- if ( aSalShlData.mbWNT )
- nSize2 = ::GetGlyphOutlineW( hDC, nIndex, nGGOFlags,
- &aGlyphMetrics, nSize1, pData, &aMat );
- else
- nSize2 = ::GetGlyphOutlineA( hDC, nIndex, nGGOFlags,
- &aGlyphMetrics, nSize1, pData, &aMat );
+ return TRUE;
+ else if( nSize1 == GDI_ERROR )
+ return FALSE;
- if( nSize1 == nSize2 )
- {
- bRet = TRUE;
+ BYTE* pData = new BYTE[ nSize1 ];
+ const DWORD nSize2 = ::GetGlyphOutlineW( hDC, nIndex, nGGOFlags,
+ &aGlyphMetrics, nSize1, pData, &aMat );
+ if( nSize1 != nSize2 )
+ return FALSE;
+
+ // TODO: avoid tools polygon by creating B2DPolygon directly
int nPtSize = 512;
Point* pPoints = new Point[ nPtSize ];
BYTE* pFlags = new BYTE[ nPtSize ];
@@ -2791,7 +2628,6 @@ BOOL WinSalGraphics::GetGlyphOutline( long nIndex,
delete[] pPoints;
delete[] pFlags;
- }
delete[] pData;
}
@@ -2803,7 +2639,7 @@ BOOL WinSalGraphics::GetGlyphOutline( long nIndex,
rB2DPolyPoly.transform(basegfx::tools::createScaleB2DHomMatrix(fFactor, fFactor));
}
- return bRet;
+ return TRUE;
}
// -----------------------------------------------------------------------
diff --git a/vcl/win/source/gdi/winlayout.cxx b/vcl/win/source/gdi/winlayout.cxx
index 82fa9bb4b5e1..6a4bbe885bd3 100644
--- a/vcl/win/source/gdi/winlayout.cxx
+++ b/vcl/win/source/gdi/winlayout.cxx
@@ -244,24 +244,11 @@ HFONT WinLayout::DisableFontScaling() const
if( mfFontScale == 1.0 )
return 0;
- HFONT hHugeFont = 0;
- if( aSalShlData.mbWNT )
- {
- LOGFONTW aLogFont;
- ::GetObjectW( mhFont, sizeof(LOGFONTW), &aLogFont);
- aLogFont.lfHeight = (LONG)(mfFontScale * aLogFont.lfHeight);
- aLogFont.lfWidth = (LONG)(mfFontScale * aLogFont.lfWidth);
- hHugeFont = ::CreateFontIndirectW( &aLogFont);
- }
- else
- {
- LOGFONTA aLogFont;
- ::GetObjectA( mhFont, sizeof(LOGFONTA), &aLogFont);
- aLogFont.lfHeight = (LONG)(mfFontScale * aLogFont.lfHeight);
- aLogFont.lfWidth = (LONG)(mfFontScale * aLogFont.lfWidth);
- hHugeFont = ::CreateFontIndirectA( &aLogFont);
- }
-
+ LOGFONTW aLogFont;
+ ::GetObjectW( mhFont, sizeof(LOGFONTW), &aLogFont);
+ aLogFont.lfHeight = (LONG)(mfFontScale * aLogFont.lfHeight);
+ aLogFont.lfWidth = (LONG)(mfFontScale * aLogFont.lfWidth);
+ HFONT hHugeFont = ::CreateFontIndirectW( &aLogFont);
if( !hHugeFont )
return 0;
@@ -671,57 +658,30 @@ void SimpleWinLayout::DrawText( SalGraphics& rGraphics ) const
Point aPos = GetDrawPosition( Point( mnBaseAdv, 0 ) );
- // #108267#, limit the number of glyphs to avoid paint errors
- UINT limitedGlyphCount = Min( 8192, mnGlyphCount );
- if( mnDrawOptions || aSalShlData.mbWNT )
- {
- // #108267#, break up into glyph portions of a limited size required by Win32 API
- const unsigned int maxGlyphCount = 8192;
- UINT numGlyphPortions = mnGlyphCount / maxGlyphCount;
- UINT remainingGlyphs = mnGlyphCount % maxGlyphCount;
+ // #108267#, break up into glyph portions of a limited size required by Win32 API
+ const unsigned int maxGlyphCount = 8192;
+ UINT numGlyphPortions = mnGlyphCount / maxGlyphCount;
+ UINT remainingGlyphs = mnGlyphCount % maxGlyphCount;
- if( numGlyphPortions )
- {
- // #108267#,#109387# break up string into smaller chunks
- // the output positions will be updated by windows (SetTextAlign)
- unsigned int i,n;
- POINT oldPos;
- UINT oldTa = ::GetTextAlign( aHDC );
- ::SetTextAlign( aHDC, (oldTa & ~TA_NOUPDATECP) | TA_UPDATECP );
- ::MoveToEx( aHDC, aPos.X(), aPos.Y(), &oldPos );
- for( i=n=0; n<numGlyphPortions; n++, i+=maxGlyphCount )
- ::ExtTextOutW( aHDC, 0, 0, mnDrawOptions, NULL,
- mpOutGlyphs+i, maxGlyphCount, mpGlyphAdvances+i );
+ if( numGlyphPortions )
+ {
+ // #108267#,#109387# break up string into smaller chunks
+ // the output positions will be updated by windows (SetTextAlign)
+ POINT oldPos;
+ UINT oldTa = ::GetTextAlign( aHDC );
+ ::SetTextAlign( aHDC, (oldTa & ~TA_NOUPDATECP) | TA_UPDATECP );
+ ::MoveToEx( aHDC, aPos.X(), aPos.Y(), &oldPos );
+ for( int i = 0, n = 0; n < numGlyphPortions; ++n, i+=maxGlyphCount )
::ExtTextOutW( aHDC, 0, 0, mnDrawOptions, NULL,
- mpOutGlyphs+i, remainingGlyphs, mpGlyphAdvances+i );
- ::MoveToEx( aHDC, oldPos.x, oldPos.y, (LPPOINT) NULL);
- ::SetTextAlign( aHDC, oldTa );
- }
- else
- ::ExtTextOutW( aHDC, aPos.X(), aPos.Y(), mnDrawOptions, NULL,
- mpOutGlyphs, mnGlyphCount, mpGlyphAdvances );
+ mpOutGlyphs+i, maxGlyphCount, mpGlyphAdvances+i );
+ ::ExtTextOutW( aHDC, 0, 0, mnDrawOptions, NULL,
+ mpOutGlyphs+i, remainingGlyphs, mpGlyphAdvances+i );
+ ::MoveToEx( aHDC, oldPos.x, oldPos.y, (LPPOINT) NULL);
+ ::SetTextAlign( aHDC, oldTa );
}
else
- {
- // #108267#, On Win9x, we get paint errors when drawing huge strings, even when
- // split into pieces (see above), seems to be a problem in the internal text clipping
- // so we just cut off the string
- if( !mpGlyphOrigAdvs )
- ::ExtTextOutW( aHDC, aPos.X(), aPos.Y(), 0, NULL,
- mpOutGlyphs, limitedGlyphCount, NULL );
- else
- {
- // workaround for problem in #106259#
- long nXPos = mnBaseAdv;
- for( unsigned int i = 0; i < limitedGlyphCount; ++i )
- {
- ::ExtTextOutW( aHDC, aPos.X(), aPos.Y(), 0, NULL,
- mpOutGlyphs+i, 1, NULL );
- nXPos += mpGlyphAdvances[ i ];
- aPos = GetDrawPosition( Point( nXPos, 0 ) );
- }
- }
- }
+ ::ExtTextOutW( aHDC, aPos.X(), aPos.Y(), mnDrawOptions, NULL,
+ mpOutGlyphs, mnGlyphCount, mpGlyphAdvances );
if( hOrigFont )
DeleteFont( SelectFont( aHDC, hOrigFont ) );
diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx
index f0ca1d68ef41..d6b05c5bb032 100755
--- a/vcl/win/source/window/salframe.cxx
+++ b/vcl/win/source/window/salframe.cxx
@@ -508,7 +508,7 @@ SalFrame* ImplSalCreateFrame( WinSalInstance* pInst,
}
// create frame
- if ( aSalShlData.mbWNT )
+ if( true/*aSalShlData.mbWNT*/ )
{
LPCWSTR pClassName;
if ( bSubFrame )
@@ -536,17 +536,6 @@ SalFrame* ImplSalCreateFrame( WinSalInstance* pInst,
lpfnSetLayeredWindowAttributes( hWnd, 0, 230, 0x00000002 /*LWA_ALPHA*/ );
#endif
}
- else
- {
- LPCSTR pClassName;
- if ( bSubFrame )
- pClassName = SAL_SUBFRAME_CLASSNAMEA;
- else
- pClassName = SAL_FRAME_CLASSNAMEA;
- hWnd = CreateWindowExA( nExSysStyle, pClassName, "", nSysStyle,
- CW_USEDEFAULT, 0, CW_USEDEFAULT, 0,
- hWndParent, 0, pInst->mhInst, (void*)pFrame );
- }
if ( !hWnd )
{
delete pFrame;
@@ -617,21 +606,10 @@ HWND ImplSalReCreateHWND( HWND hWndParent, HWND oldhWnd, BOOL bAsChild )
nExSysStyle = 0;
}
- HWND hWnd = NULL;
- if ( aSalShlData.mbWNT )
- {
- LPCWSTR pClassName = SAL_SUBFRAME_CLASSNAMEW;
- hWnd = CreateWindowExW( nExSysStyle, pClassName, L"", nSysStyle,
- CW_USEDEFAULT, 0, CW_USEDEFAULT, 0,
- hWndParent, 0, hInstance, (void*)GetWindowPtr( oldhWnd ) );
- }
- else
- {
- LPCSTR pClassName = SAL_SUBFRAME_CLASSNAMEA;
- hWnd = CreateWindowExA( nExSysStyle, pClassName, "", nSysStyle,
+ LPCWSTR pClassName = SAL_SUBFRAME_CLASSNAMEW;
+ HWND hWnd = CreateWindowExW( nExSysStyle, pClassName, L"", nSysStyle,
CW_USEDEFAULT, 0, CW_USEDEFAULT, 0,
hWndParent, 0, hInstance, (void*)GetWindowPtr( oldhWnd ) );
- }
return hWnd;
}
@@ -2531,7 +2509,7 @@ static void ImplGetKeyNameText( LONG lParam, sal_Unicode* pBuf,
int nKeyLen = 0;
if ( lParam )
{
- if ( aSalShlData.mbWNT )
+ if ( true/*aSalShlData.mbWNT*/ )
{
nKeyLen = GetKeyNameTextW( lParam, aKeyBuf, nMaxKeyLen );
// #i12401# the current unicows.dll has a bug in CharUpperBuffW, which corrupts the stack
@@ -2553,32 +2531,6 @@ static void ImplGetKeyNameText( LONG lParam, sal_Unicode* pBuf,
}
}
}
- else // !mbWnt
- {
- sal_Char aAnsiKeyBuf[ nMaxKeyLen ];
- int nAnsiKeyLen = GetKeyNameTextA( lParam, aAnsiKeyBuf, nMaxKeyLen );
- DBG_ASSERT( nAnsiKeyLen <= nMaxKeyLen, "Invalid key name length!" );
- if( nAnsiKeyLen > nMaxKeyLen )
- nAnsiKeyLen = 0;
- else if( nAnsiKeyLen > 0 )
- {
- // Capitalize just the first letter of key names
- // TODO: check MCBS key names
- CharLowerBuffA( aAnsiKeyBuf, nAnsiKeyLen );
-
- bool bUpper = true;
- for( sal_Char *pA=aAnsiKeyBuf, *pE=pA+nAnsiKeyLen; pA < pE; ++pA )
- {
- if( bUpper )
- CharUpperBuffA( pA, 1 );
- bUpper = (*pA=='+') || (*pA=='-') || (*pA==' ') || (*pA=='.');
- }
-
- // Convert to Unicode and copy the data in the Unicode Buffer
- nKeyLen = MultiByteToWideChar( CP_ACP, MB_PRECOMPOSED,
- aAnsiKeyBuf, nAnsiKeyLen, aKeyBuf, nMaxKeyLen );
- }
- }
}
if ( (nKeyLen > 0) || pReplace )
@@ -3027,7 +2979,7 @@ void WinSalFrame::UpdateSettings( AllSettings& rSettings )
Font aAppFont = aStyleSettings.GetAppFont();
Font aIconFont = aStyleSettings.GetIconFont();
HDC hDC = GetDC( 0 );
- if ( aSalShlData.mbWNT )
+ if( true/*aSalShlData.mbWNT*/ )
{
NONCLIENTMETRICSW aNonClientMetrics;
aNonClientMetrics.cbSize = sizeof( aNonClientMetrics );
@@ -3044,23 +2996,6 @@ void WinSalFrame::UpdateSettings( AllSettings& rSettings )
ImplSalUpdateStyleFontW( hDC, aLogFont, aIconFont );
}
}
- else
- {
- NONCLIENTMETRICSA aNonClientMetrics;
- aNonClientMetrics.cbSize = sizeof( aNonClientMetrics );
- if ( SystemParametersInfoA( SPI_GETNONCLIENTMETRICS, sizeof( aNonClientMetrics ), &aNonClientMetrics, 0 ) )
- {
- ImplSalUpdateStyleFontA( hDC, aNonClientMetrics.lfMenuFont, aMenuFont );
- ImplSalUpdateStyleFontA( hDC, aNonClientMetrics.lfCaptionFont, aTitleFont );
- ImplSalUpdateStyleFontA( hDC, aNonClientMetrics.lfSmCaptionFont, aFloatTitleFont );
- ImplSalUpdateStyleFontA( hDC, aNonClientMetrics.lfStatusFont, aHelpFont );
- ImplSalUpdateStyleFontA( hDC, aNonClientMetrics.lfMessageFont, aAppFont );
-
- LOGFONTA aLogFont;
- if ( SystemParametersInfoA( SPI_GETICONTITLELOGFONT, 0, &aLogFont, 0 ) )
- ImplSalUpdateStyleFontA( hDC, aLogFont, aIconFont );
- }
- }
// get screen font resolution to calculate toolbox item size
long nDPIY = GetDeviceCaps( hDC, LOGPIXELSY );
@@ -3649,27 +3584,7 @@ static void ImplUpdateInputLang( WinSalFrame* pFrame )
// If we are on Windows NT we use Unicode FrameProcs and so we
// get Unicode charcodes directly from Windows
// no need to set up a code page
- if ( aSalShlData.mbWNT )
- return;
-
- if ( !nLang )
- {
- pFrame->mnInputLang = 0;
- pFrame->mnInputCodePage = GetACP();
- }
- else if ( bLanguageChange )
- {
- sal_Char aBuf[10];
- if ( GetLocaleInfoA( MAKELCID( nLang, SORT_DEFAULT ), LOCALE_IDEFAULTANSICODEPAGE,
- aBuf, sizeof(aBuf) ) > 0 )
- {
- pFrame->mnInputCodePage = ImplStrToNum( aBuf );
- if ( !pFrame->mnInputCodePage )
- pFrame->mnInputCodePage = GetACP();
- }
- else
- pFrame->mnInputCodePage = GetACP();
- }
+ return;
}
@@ -3679,29 +3594,7 @@ static sal_Unicode ImplGetCharCode( WinSalFrame* pFrame, WPARAM nCharCode )
// If we are on Windows NT we use Unicode FrameProcs and so we
// get Unicode charcodes directly from Windows
- if ( aSalShlData.mbWNT )
- return (sal_Unicode)nCharCode;
-
- sal_Char aCharBuf[2];
- int nCharLen;
- WCHAR c;
- if ( nCharCode > 0xFF )
- {
- aCharBuf[0] = (sal_Char)(nCharCode>>8);
- aCharBuf[1] = (sal_Char)nCharCode;
- nCharLen = 2;
- }
- else
- {
- aCharBuf[0] = (sal_Char)nCharCode;
- nCharLen = 1;
- }
- if ( ::MultiByteToWideChar( pFrame->mnInputCodePage,
- MB_PRECOMPOSED,
- aCharBuf, nCharLen, &c, 1 ) )
- return (sal_Unicode)c;
- else
- return (sal_Unicode)nCharCode;
+ return (sal_Unicode)nCharCode;
}
// -----------------------------------------------------------------------
@@ -4507,16 +4400,8 @@ static void ImplHandleSettingsChangeMsg( HWND hWnd, UINT nMsg,
{
if ( lParam )
{
- if ( aSalShlData.mbWNT )
- {
if ( ImplSalWICompareAscii( (const wchar_t*)lParam, "devices" ) == 0 )
nSalEvent = SALEVENT_PRINTERCHANGED;
- }
- else
- {
- if ( stricmp( (const char*)lParam, "devices" ) == 0 )
- nSalEvent = SALEVENT_PRINTERCHANGED;
- }
}
}
diff --git a/vcl/win/source/window/salobj.cxx b/vcl/win/source/window/salobj.cxx
index 2f657968284f..4c38ec49d403 100644
--- a/vcl/win/source/window/salobj.cxx
+++ b/vcl/win/source/window/salobj.cxx
@@ -493,20 +493,10 @@ SalObject* ImplSalCreateObject( WinSalInstance* pInst, WinSalFrame* pParent )
// Hook installieren, wenn es das erste SalObject ist
if ( !pSalData->mpFirstObject )
{
- if ( aSalShlData.mbWNT )
- {
- pSalData->mhSalObjMsgHook = SetWindowsHookExW( WH_CALLWNDPROC,
- SalSysMsgProc,
- pSalData->mhInst,
- pSalData->mnAppThreadId );
- }
- else
- {
- pSalData->mhSalObjMsgHook = SetWindowsHookExA( WH_CALLWNDPROC,
+ pSalData->mhSalObjMsgHook = SetWindowsHookExW( WH_CALLWNDPROC,
SalSysMsgProc,
pSalData->mhInst,
pSalData->mnAppThreadId );
- }
}
if ( !pSalData->mbObjClassInit )