From 377e91fb621f3eb737a8a95227feddb9addae583 Mon Sep 17 00:00:00 2001
From: RĂ¼diger Timm <rt@openoffice.org>
Date: Thu, 24 Apr 2003 14:17:30 +0000
Subject: INTEGRATION: CWS sb4 (1.93.6); FILE MERGED 2003/04/23 11:45:30 ssa
 1.93.6.1: #102812# new method: GetInputLanguage

---
 vcl/win/source/window/salframe.cxx | 27 ++++++++++++++++++++++-----
 1 file changed, 22 insertions(+), 5 deletions(-)

(limited to 'vcl/win')

diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx
index 69e33828edda..7ff0170fbbc9 100644
--- a/vcl/win/source/window/salframe.cxx
+++ b/vcl/win/source/window/salframe.cxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: salframe.cxx,v $
  *
- *  $Revision: 1.93 $
+ *  $Revision: 1.94 $
  *
- *  last change: $Author: vg $ $Date: 2003-04-15 16:12:31 $
+ *  last change: $Author: rt $ $Date: 2003-04-24 15:17:30 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -3302,22 +3302,39 @@ static UINT ImplStrToNum( const sal_Char* pStr )
 
 // -----------------------------------------------------------------------
 
+LanguageType SalFrame::GetInputLanguage()
+{
+    if( !maFrameData.mnInputLang )
+        return LANGUAGE_DONTKNOW;
+    else
+        return (LanguageType) maFrameData.mnInputLang;
+}
+
+// -----------------------------------------------------------------------
+
 static sal_Unicode ImplGetCharCode( SalFrame* pFrame, WPARAM nCharCode )
 {
+    BOOL bLanguageChange = FALSE;
+    UINT nLang = LOWORD( GetKeyboardLayout( 0 ) );
+    if ( nLang && nLang != pFrame->maFrameData.mnInputLang )
+    {
+        // keep input lang up-to-date
+        pFrame->maFrameData.mnInputLang = nLang;
+        bLanguageChange = TRUE;
+    }
+
     // 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;
 
-    UINT nLang = LOWORD( GetKeyboardLayout( 0 ) );
     if ( !nLang )
     {
         pFrame->maFrameData.mnInputLang     = 0;
         pFrame->maFrameData.mnInputCodePage = GetACP();
     }
-    else if ( nLang != pFrame->maFrameData.mnInputLang )
+    else if ( bLanguageChange )
     {
-        pFrame->maFrameData.mnInputLang = nLang;
         sal_Char aBuf[10];
         if ( GetLocaleInfoA( MAKELCID( nLang, SORT_DEFAULT ), LOCALE_IDEFAULTANSICODEPAGE,
                              aBuf, sizeof(aBuf) ) > 0 )
-- 
cgit