ooo-build r11748 - in trunk: . patches/src680



Author: kyoshida
Date: Thu Feb 28 20:06:25 2008
New Revision: 11748
URL: http://svn.gnome.org/viewvc/ooo-build?rev=11748&view=rev

Log:
2008-02-28  Kohei Yoshida  <kyoshida novell com>

	* patches/src680/autocorrect-accidental-caps-lock-offapi.diff:
	* patches/src680/autocorrect-accidental-caps-lock-officecfg.diff:
	* patches/src680/autocorrect-accidental-caps-lock-sc.diff:
	* patches/src680/autocorrect-accidental-caps-lock-solenv.diff:
	* patches/src680/autocorrect-accidental-caps-lock-svx.diff:
	* patches/src680/autocorrect-accidental-caps-lock-vcl.diff: new patch
	set to enable automatic correction of accidental cAPS LOCK USE.  Note:
	right now this option is present in all four applications, but it only
	works in Calc.  I'll get to the other three applications shortly.  Also,
	This does not yet work on Windows or MacOS X.

	* patches/src680/apply: new section [ AutoCorrectCapsLock ], enabled for
	NovellBase for now.


Added:
   trunk/patches/src680/autocorrect-accidental-caps-lock-offapi.diff
   trunk/patches/src680/autocorrect-accidental-caps-lock-officecfg.diff
   trunk/patches/src680/autocorrect-accidental-caps-lock-sc.diff
   trunk/patches/src680/autocorrect-accidental-caps-lock-solenv.diff
   trunk/patches/src680/autocorrect-accidental-caps-lock-svx.diff
   trunk/patches/src680/autocorrect-accidental-caps-lock-vcl.diff
Modified:
   trunk/ChangeLog
   trunk/patches/src680/apply

Modified: trunk/patches/src680/apply
==============================================================================
--- trunk/patches/src680/apply	(original)
+++ trunk/patches/src680/apply	Thu Feb 28 20:06:25 2008
@@ -40,7 +40,7 @@
 # Novell
 NovellBase : LinuxCommon, NovellOnly, NovellOnlyUnix, \
 	     NotDebian, Lockdown, CalcSolver, Split, Shrink, \
-	     CalcDataPilotDrillDown
+	     CalcDataPilotDrillDown, AutoCorrectCapsLock
 SUSE-9.1  : NovellBase
 SUSE-9.2  : NovellBase
 SUSE-9.3  : NovellBase
@@ -1984,6 +1984,17 @@
 cws-layout-transex3.diff
 
 
+[ AutoCorrectCapsLock ]
+SectionOwner => kohei
+
+autocorrect-accidental-caps-lock-offapi.diff
+autocorrect-accidental-caps-lock-officecfg.diff
+autocorrect-accidental-caps-lock-sc.diff
+autocorrect-accidental-caps-lock-solenv.diff
+autocorrect-accidental-caps-lock-svx.diff
+autocorrect-accidental-caps-lock-vcl.diff
+
+
 [ UnitTesting ]
 SectionOwner => jholesov
 # FIXME: file when ready

Added: trunk/patches/src680/autocorrect-accidental-caps-lock-offapi.diff
==============================================================================
--- (empty file)
+++ trunk/patches/src680/autocorrect-accidental-caps-lock-offapi.diff	Thu Feb 28 20:06:25 2008
@@ -0,0 +1,23 @@
+diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=offapi.vpj offapi.clean/com/sun/star/awt/Key.idl offapi/com/sun/star/awt/Key.idl
+--- offapi.clean/com/sun/star/awt/Key.idl	2008-02-28 13:06:00.000000000 -0500
++++ offapi/com/sun/star/awt/Key.idl	2008-02-28 13:13:24.000000000 -0500
+@@ -454,6 +454,19 @@ published constants Key
+ 
+ 	const short QUOTELEFT = 1311;
+ 
++    //------------------------------------------------------------------------- 
++
++    const short CAPSLOCK = 1312;
++
++    //------------------------------------------------------------------------- 
++
++    const short NUMLOCK = 1313;
++
++    //------------------------------------------------------------------------- 
++
++    const short SCROLLLOCK = 1314;
++
++    //------------------------------------------------------------------------- 
+ }; 
+  
+ //============================================================================= 

Added: trunk/patches/src680/autocorrect-accidental-caps-lock-officecfg.diff
==============================================================================
--- (empty file)
+++ trunk/patches/src680/autocorrect-accidental-caps-lock-officecfg.diff	Thu Feb 28 20:06:25 2008
@@ -0,0 +1,19 @@
+diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=officecfg.vpj officecfg.clean/registry/schema/org/openoffice/Office/Common.xcs officecfg/registry/schema/org/openoffice/Office/Common.xcs
+--- officecfg.clean/registry/schema/org/openoffice/Office/Common.xcs	2008-02-20 15:04:19.000000000 -0500
++++ officecfg/registry/schema/org/openoffice/Office/Common.xcs	2008-02-25 18:29:09.000000000 -0500
+@@ -1194,6 +1194,15 @@ Dymamic border coloring means that when 
+ 				</info>
+ 				<value>false</value>
+ 			</prop>
++			<prop oor:name="CorrectAccidentalCapsLock" oor:type="xs:boolean">
++				<!-- UIHints: Tools  AutoCorrect/AutoFormat  Options  Correct accidental use of cAPS LOCK key -->
++				<info>
++					<author>Kohei Yoshida</author>
++					<desc>Specifies whether or not to correct accidental use of CAPS lock key.</desc>
++					<label>Correct accidental use of cAPS LOCK key</label>
++				</info>
++				<value>true</value>
++			</prop>
+ 			<prop oor:name="ReplaceSingleQuote" oor:type="xs:boolean">
+ 				<!-- OldPath: AutoCorrect/Options/All -->
+ 				<!-- OldLocation: Soffice.cfg -->

Added: trunk/patches/src680/autocorrect-accidental-caps-lock-sc.diff
==============================================================================
--- (empty file)
+++ trunk/patches/src680/autocorrect-accidental-caps-lock-sc.diff	Thu Feb 28 20:06:25 2008
@@ -0,0 +1,32 @@
+Only in sc: out.ann
+diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=sc.vpj sc.clean/source/ui/app/inputhdl.cxx sc/source/ui/app/inputhdl.cxx
+--- sc.clean/source/ui/app/inputhdl.cxx	2008-02-05 11:16:55.000000000 -0500
++++ sc/source/ui/app/inputhdl.cxx	2008-02-28 14:23:24.000000000 -0500
+@@ -2039,10 +2039,12 @@ void ScInputHandler::EnterHandler( BYTE 
+             lcl_SelectionToEnd(pTableView);
+         }
+ 
++        Window* pFrameWin = pActiveViewSh ? pActiveViewSh->GetFrameWin() : NULL;
++
+ 		if (pTopView)
+ 			pTopView->CompleteAutoCorrect();	// #59759# CompleteAutoCorrect fuer beide Views
+ 		if (pTableView)
+-			pTableView->CompleteAutoCorrect();
++			pTableView->CompleteAutoCorrect(pFrameWin);
+ 		aString = GetEditText(pEngine);
+ 	}
+ 	lcl_RemoveTabs(aString);
+@@ -2774,8 +2776,11 @@ BOOL ScInputHandler::KeyInput( const Key
+ 				else
+ 				{
+ 					if (pTableView)
+-						if ( pTableView->PostKeyEvent( rKEvt ) )
+-							bUsed = TRUE;
++                    {
++                        Window* pFrameWin = pActiveViewSh ? pActiveViewSh->GetFrameWin() : NULL;
++                        if ( pTableView->PostKeyEvent( rKEvt, pFrameWin ) )
++                            bUsed = TRUE;
++                    }
+ 					if (pTopView)
+ 						if ( pTopView->PostKeyEvent( rKEvt ) )
+ 							bUsed = TRUE;

Added: trunk/patches/src680/autocorrect-accidental-caps-lock-solenv.diff
==============================================================================
--- (empty file)
+++ trunk/patches/src680/autocorrect-accidental-caps-lock-solenv.diff	Thu Feb 28 20:06:25 2008
@@ -0,0 +1,14 @@
+diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=solenv.vpj solenv.clean/inc/unxlngi6.mk solenv/inc/unxlngi6.mk
+--- solenv.clean/inc/unxlngi6.mk	2008-02-27 10:53:41.000000000 -0500
++++ solenv/inc/unxlngi6.mk	2008-02-28 13:04:07.000000000 -0500
+@@ -208,6 +208,10 @@ STDLIBCUIMT+=-ldl -lpthread -lm
+ STDSHLGUIMT+=-lX11 -lXext -ldl -lpthread -lm
+ STDSHLCUIMT+=-ldl -lpthread -lm
+ 
++# XTest - X11 extension
++STDLIBGUIMT+=-lXtst
++STDSHLGUIMT+=-lXtst
++
+ LIBSALCPPRT*=-Wl,--whole-archive -lsalcpprt -Wl,--no-whole-archive
+ 
+ .IF "$(USE_STLP_DEBUG)" != ""

Added: trunk/patches/src680/autocorrect-accidental-caps-lock-svx.diff
==============================================================================
--- (empty file)
+++ trunk/patches/src680/autocorrect-accidental-caps-lock-svx.diff	Thu Feb 28 20:06:25 2008
@@ -0,0 +1,507 @@
+diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=svx.vpj svx.clean/inc/svx/editeng.hxx svx/inc/svx/editeng.hxx
+--- svx.clean/inc/svx/editeng.hxx	2008-02-25 11:50:16.000000000 -0500
++++ svx/inc/svx/editeng.hxx	2008-02-27 23:29:13.000000000 -0500
+@@ -61,6 +61,7 @@ class Rectangle;
+ class SvStream;
+ class Link;
+ class OutputDevice;
++class Window;
+ class SvUShorts;
+ class SfxPoolItem;
+ class SvxNumBulletItem;
+@@ -133,7 +134,7 @@ private:
+ 	SVX_DLLPRIVATE EditEngine&		operator=( const EditEngine& );
+ 
+ //#if 0 // _SOLAR__PRIVATE
+-	SVX_DLLPRIVATE BOOL				PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pView );
++	SVX_DLLPRIVATE BOOL				PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pView, Window* pFrameWin = NULL );
+ //#endif
+ 
+ public:
+diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=svx.vpj svx.clean/inc/svx/editview.hxx svx/inc/svx/editview.hxx
+--- svx.clean/inc/svx/editview.hxx	2008-02-25 11:50:16.000000000 -0500
++++ svx/inc/svx/editview.hxx	2008-02-27 23:15:13.000000000 -0500
+@@ -162,7 +162,7 @@ public:
+ 
+ 	void			InsertText( const String& rNew, BOOL bSelect = FALSE );
+ 
+-	BOOL			PostKeyEvent( const KeyEvent& rKeyEvent );
++	BOOL			PostKeyEvent( const KeyEvent& rKeyEvent, Window* pFrameWin = NULL );
+ 
+ 	BOOL			MouseButtonUp( const MouseEvent& rMouseEvent );
+ 	BOOL			MouseButtonDown( const MouseEvent& rMouseEvent );
+@@ -225,7 +225,7 @@ public:
+ 
+ 	BOOL			MatchGroup();
+ 
+-	void			CompleteAutoCorrect();
++	void			CompleteAutoCorrect( Window* pFrameWin = NULL );
+ 
+ 	EESpellState	StartSpeller( BOOL bMultipleDoc = FALSE );
+ 	EESpellState	StartThesaurus();
+diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=svx.vpj svx.clean/inc/svx/svxacorr.hxx svx/inc/svx/svxacorr.hxx
+--- svx.clean/inc/svx/svxacorr.hxx	2008-02-25 11:50:16.000000000 -0500
++++ svx/inc/svx/svxacorr.hxx	2008-02-28 11:46:04.000000000 -0500
+@@ -75,6 +75,7 @@ class SvxAutoCorrLanguageTable_Impl;
+ class SvxAutoCorrLastFileAskTable_Impl;
+ class SotStorageRef;
+ class SotStorage;
++class Window;
+ 
+ // Flags fuer die AutoKorrekt-Flags
+ const long CptlSttSntnc		= 0x00000001;	// Gross-Buchstaben am SatzAnfang
+@@ -90,6 +91,7 @@ const long SaveWordCplSttLst= 0x00000200
+ const long SaveWordWrdSttLst= 0x00000400;	// 2 GrB. am WortAnf. auto. aufnehmen
+ const long IngnoreDoubleSpace= 0x00000800;	// 2 Spaces ignorieren
+ const long ChgSglQuotes		= 0x00001000;	// einfache Quotes ersetzen
++const long CorrectCapsLock  = 0x00002000;   // Correct accidental use of cAPS LOCK key
+ 
+ const long ChgWordLstLoad	= 0x20000000;	// Ersetzungsliste geladen
+ const long CplSttLstLoad	= 0x40000000;	// Exceptionlist fuer CplStart geladen
+@@ -277,7 +279,7 @@ public:
+ 	// fuehre eine AutoKorrektur aus.
+ 	// returnt was ausgefuehrt wurde; entsprechend den obigen Flags
+ 	ULONG AutoCorrect( SvxAutoCorrDoc& rDoc, const String& rTxt,
+-						xub_StrLen nPos, sal_Unicode cInsChar, BOOL bInsert );
++						xub_StrLen nPos, sal_Unicode cInsChar, BOOL bInsert, Window* pFrameWin = NULL );
+ 
+ 	// return fuer die Autotext Expandierung das vorherige Wort, was dem
+ 	// AutoCorrect - Algorythmus entspricht.
+@@ -402,6 +404,10 @@ public:
+ 								xub_StrLen nSttPos, xub_StrLen nEndPos,
+ 								LanguageType eLang  = LANGUAGE_SYSTEM);
+ 
++    bool FnCorrectCapsLock( SvxAutoCorrDoc&, const String&, 
++                            xub_StrLen nSttPos, xub_StrLen nEndPos,
++                            LanguageType eLang  = LANGUAGE_SYSTEM );
++
+ 	static long			GetDefaultFlags();
+ 
+ // returns TRUE for charcters where the function
+diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=svx.vpj svx.clean/source/dialog/autocdlg.cxx svx/source/dialog/autocdlg.cxx
+--- svx.clean/source/dialog/autocdlg.cxx	2008-02-25 11:50:19.000000000 -0500
++++ svx/source/dialog/autocdlg.cxx	2008-02-25 23:26:30.000000000 -0500
+@@ -260,7 +260,8 @@ OfaAutocorrOptionsPage::OfaAutocorrOptio
+     sNoDblSpaces        (SVX_RES(STR_NO_DBL_SPACES    )),
+     sHalf               (SVX_RES(ST_FRACTION          )),
+ 	sDash    			(SVX_RES(ST_DASH	         	)),
+-    sFirst              (SVX_RES(ST_ORDINAL           ))
++    sFirst              (SVX_RES(ST_ORDINAL           )),
++    sAccidentalCaps     (SVX_RES(ST_CORRECT_ACCIDENTAL_CAPS_LOCK))
+ {
+ 	FreeResource();
+ 
+@@ -306,6 +307,7 @@ BOOL OfaAutocorrOptionsPage::FillItemSet
+ 	pAutoCorrect->SetAutoCorrFlag(ChgFractionSymbol,	aCheckLB.IsChecked(nPos++));
+ 	pAutoCorrect->SetAutoCorrFlag(ChgToEnEmDash,		aCheckLB.IsChecked(nPos++));
+ 	pAutoCorrect->SetAutoCorrFlag(IngnoreDoubleSpace,	aCheckLB.IsChecked(nPos++));
++    pAutoCorrect->SetAutoCorrFlag(CorrectCapsLock,      aCheckLB.IsChecked(nPos++));
+ 
+ 	BOOL bReturn = nFlags != pAutoCorrect->GetFlags();
+ 	if(bReturn )
+@@ -347,6 +349,7 @@ void OfaAutocorrOptionsPage::Reset( cons
+ 	aCheckLB.InsertEntry(sHalf);
+ 	aCheckLB.InsertEntry(sDash);
+ 	aCheckLB.InsertEntry(sNoDblSpaces);
++    aCheckLB.InsertEntry(sAccidentalCaps);
+ 
+ 	USHORT nPos = 0;
+ 	aCheckLB.CheckEntryPos( nPos++, 0 != (nFlags & Autocorrect) );
+@@ -358,6 +361,7 @@ void OfaAutocorrOptionsPage::Reset( cons
+ 	aCheckLB.CheckEntryPos( nPos++, 0 != (nFlags & ChgFractionSymbol) );
+ 	aCheckLB.CheckEntryPos( nPos++, 0 != (nFlags & ChgToEnEmDash) );
+ 	aCheckLB.CheckEntryPos( nPos++, 0 != (nFlags & IngnoreDoubleSpace) );
++    aCheckLB.CheckEntryPos( nPos++, 0 != (nFlags & CorrectCapsLock) );
+ 
+ 	aCheckLB.SetUpdateMode(TRUE);
+ }
+@@ -490,6 +494,7 @@ enum OfaAutoFmtOptions
+ 	DEL_SPACES_AT_STT_END,
+ 	DEL_SPACES_BETWEEN_LINES,
+ 	IGNORE_DBLSPACE,
++    CORRECT_CAPS_LOCK,
+ 	APPLY_NUMBERING,
+ 	INSERT_BORDER,
+ 	CREATE_TABLE,
+@@ -519,6 +524,7 @@ OfaSwAutoFmtOptionsPage::OfaSwAutoFmtOpt
+ 	sBullet				(SVX_RES(	ST_BULLET       )),
+ 	sBoldUnder			(SVX_RES(	ST_BOLD_UNDER   )),
+ 	sNoDblSpaces		(SVX_RES(	STR_NO_DBL_SPACES)),
++    sCorrectCapsLock    (SVX_RES(   ST_CORRECT_ACCIDENTAL_CAPS_LOCK)),
+ 	sFraction			(SVX_RES(	ST_FRACTION     )),
+ 	sDetectURL			(SVX_RES(	ST_DETECT_URL   )),
+ 	sDash				(SVX_RES(	ST_DASH         )),
+@@ -659,6 +665,9 @@ BOOL OfaSwAutoFmtOptionsPage::FillItemSe
+ 	pAutoCorrect->SetAutoCorrFlag(IngnoreDoubleSpace,
+ 						aCheckLB.IsChecked(IGNORE_DBLSPACE, CBCOL_SECOND));
+ 
++    pAutoCorrect->SetAutoCorrFlag(CorrectCapsLock,
++                        aCheckLB.IsChecked(CORRECT_CAPS_LOCK, CBCOL_SECOND));
++
+ 	bCheck = aCheckLB.IsChecked(DETECT_URL, CBCOL_FIRST);
+ 	bModified |= pOpt->bSetINetAttr != bCheck;
+ 	pOpt->bSetINetAttr = bCheck;
+@@ -790,6 +799,7 @@ void OfaSwAutoFmtOptionsPage::Reset( con
+ 	aCheckLB.GetModel()->Insert(CreateEntry(sDelSpaceBetweenLines, CBCOL_BOTH  ));
+ 
+ 	aCheckLB.GetModel()->Insert(CreateEntry(sNoDblSpaces,		CBCOL_SECOND));
++    aCheckLB.GetModel()->Insert(CreateEntry(sCorrectCapsLock,   CBCOL_SECOND));
+ 	aCheckLB.GetModel()->Insert(CreateEntry(sNum,				CBCOL_SECOND));
+ 	aCheckLB.GetModel()->Insert(CreateEntry(sBorder,			CBCOL_SECOND));
+ 	aCheckLB.GetModel()->Insert(CreateEntry(sTable,				CBCOL_SECOND));
+@@ -809,6 +819,7 @@ void OfaSwAutoFmtOptionsPage::Reset( con
+ 	aCheckLB.CheckEntryPos( BOLD_UNDERLINE,		CBCOL_FIRST,	pOpt->bChgWeightUnderl );
+ 	aCheckLB.CheckEntryPos( BOLD_UNDERLINE,		CBCOL_SECOND,	0 != (nFlags & ChgWeightUnderl) );
+ 	aCheckLB.CheckEntryPos( IGNORE_DBLSPACE,	CBCOL_SECOND,	0 != (nFlags & IngnoreDoubleSpace) );
++    aCheckLB.CheckEntryPos( CORRECT_CAPS_LOCK,  CBCOL_SECOND,   0 != (nFlags & CorrectCapsLock) );
+ 	aCheckLB.CheckEntryPos( DETECT_URL,			CBCOL_FIRST,	pOpt->bSetINetAttr );
+ 	aCheckLB.CheckEntryPos( DETECT_URL,			CBCOL_SECOND,	0 != (nFlags & SetINetAttr) );
+ 	aCheckLB.CheckEntryPos( REPLACE_1ST,		CBCOL_FIRST,	pOpt->bChgOrdinalNumber );
+diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=svx.vpj svx.clean/source/dialog/autocdlg.hrc svx/source/dialog/autocdlg.hrc
+--- svx.clean/source/dialog/autocdlg.hrc	2008-02-25 11:50:19.000000000 -0500
++++ svx/source/dialog/autocdlg.hrc	2008-02-25 17:43:51.000000000 -0500
+@@ -157,6 +157,7 @@
+ #define ST_DASH                         208
+ #define FT_LANG                         209
+ #define LB_LANG                         210
++#define ST_CORRECT_ACCIDENTAL_CAPS_LOCK 211
+ 
+ #define CB_SMARTTAGS                    220
+ #define FT_SMARTTAGS                    221
+diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=svx.vpj svx.clean/source/dialog/autocdlg.hxx svx/source/dialog/autocdlg.hxx
+--- svx.clean/source/dialog/autocdlg.hxx	2008-02-25 11:50:19.000000000 -0500
++++ svx/source/dialog/autocdlg.hxx	2008-02-25 19:07:16.000000000 -0500
+@@ -149,6 +149,7 @@ private:
+ 	String		sHalf;
+ 	String		sDash;
+ 	String		sFirst;
++    String      sAccidentalCaps;
+ 
+ public:
+ 						OfaAutocorrOptionsPage( Window* pParent, const SfxItemSet& rSet );
+@@ -187,6 +188,7 @@ class OfaSwAutoFmtOptionsPage : public S
+ 	String			sByInputBullet;
+ 	String			sBoldUnder;
+ 	String			sNoDblSpaces;
++    String          sCorrectCapsLock;
+ 	String			sFraction;
+ 	String			sDetectURL;
+ 	String          sDash;
+diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=svx.vpj svx.clean/source/dialog/autocdlg.src svx/source/dialog/autocdlg.src
+--- svx.clean/source/dialog/autocdlg.src	2008-02-25 11:50:19.000000000 -0500
++++ svx/source/dialog/autocdlg.src	2008-02-25 17:46:00.000000000 -0500
+@@ -145,7 +145,11 @@ TabDialog RID_OFA_AUTOCORR_DLG
+     String ST_DASH \
+     { \
+         Text [ en-US ] = "Replace dashes" ; \
+-	};
++	}; \
++    String ST_CORRECT_ACCIDENTAL_CAPS_LOCK \
++    { \
++        Text [ en-US ] = "Correct accidental use of cAPS LOCK key" ; \
++    };
+ 
+ /**************************************************************************/
+ /*                                                                        */
+diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=svx.vpj svx.clean/source/editeng/acorrcfg.cxx svx/source/editeng/acorrcfg.cxx
+--- svx.clean/source/editeng/acorrcfg.cxx	2008-02-25 11:50:18.000000000 -0500
++++ svx/source/editeng/acorrcfg.cxx	2008-02-25 19:15:21.000000000 -0500
+@@ -139,9 +139,10 @@ Sequence<OUString> 	SvxBaseAutoCorrCfg::
+ 		"SingleQuoteAtEnd",						// 13
+ 		"ReplaceDoubleQuote",					// 14
+ 		"DoubleQuoteAtStart",					// 15
+-		"DoubleQuoteAtEnd"						// 16
++		"DoubleQuoteAtEnd",						// 16
++        "CorrectAccidentalCapsLock"             // 17
+ 	};
+-	const int nCount = 17;
++	const int nCount = 18;
+ 	Sequence<OUString> aNames(nCount);
+ 	OUString* pNames = aNames.getArray();
+ 	for(int i = 0; i < nCount; i++)
+@@ -241,6 +242,10 @@ void SvxBaseAutoCorrCfg::Load(sal_Bool b
+ 						rParent.pAutoCorrect->SetEndDoubleQuote(
+                             sal::static_int_cast< sal_Unicode >( nTemp ) );
+ 					break;//"DoubleQuoteAtEnd"
++                    case 17:
++                        if(*(sal_Bool*)pValues[nProp].getValue())
++                            nFlags |= CorrectCapsLock;
++                    break;//"CorrectAccidentalCapsLock"
+ 				}
+ 			}
+ 		}
+@@ -345,6 +350,10 @@ void SvxBaseAutoCorrCfg::Commit()
+ 			case 16:
+ 				pValues[nProp] <<= (sal_Int32) rParent.pAutoCorrect->GetEndDoubleQuote();
+ 			break;//"DoubleQuoteAtEnd"
++            case 17:
++                bVal = 0 != (nFlags & CorrectCapsLock);
++                pValues[nProp].setValue(&bVal, rType);
++            break;//"CorrectAccidentalCapsLock"
+ 		}
+ 	}
+ 	PutProperties(aNames, aValues);
+diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=svx.vpj svx.clean/source/editeng/editeng.cxx svx/source/editeng/editeng.cxx
+--- svx.clean/source/editeng/editeng.cxx	2008-02-25 11:50:18.000000000 -0500
++++ svx/source/editeng/editeng.cxx	2008-02-28 14:24:30.000000000 -0500
+@@ -831,7 +831,7 @@ ESelection EditEngine::CursorRight( cons
+ 	return pE->pImpEditEngine->CreateESel( aSel );
+ }
+ 
+-sal_Bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditView )
++sal_Bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditView, Window* pFrameWin )
+ {
+ 	DBG_CHKTHIS( EditEngine, 0 );
+ 	DBG_CHKOBJ( pEditView, EditView, 0 );
+@@ -1018,7 +1018,7 @@ sal_Bool EditEngine::PostKeyEvent( const
+ 						if ( bSel )
+ 							pImpEditEngine->UndoActionStart( EDITUNDO_INSERT );
+ 						if ( pImpEditEngine->GetStatus().DoAutoCorrect() )
+-							aCurSel = pImpEditEngine->AutoCorrect( aCurSel, 0, !pEditView->IsInsertMode() );
++							aCurSel = pImpEditEngine->AutoCorrect( aCurSel, 0, !pEditView->IsInsertMode(), pFrameWin );
+ 						aCurSel = pImpEditEngine->InsertTab( aCurSel );
+ 						if ( bSel )
+ 							pImpEditEngine->UndoActionEnd( EDITUNDO_INSERT );
+@@ -1039,7 +1039,7 @@ sal_Bool EditEngine::PostKeyEvent( const
+ 						pImpEditEngine->UndoActionStart( EDITUNDO_INSERT );
+ 						if ( rKeyEvent.GetKeyCode().IsShift() )
+                         {
+-                            aCurSel = pImpEditEngine->AutoCorrect( aCurSel, 0, !pEditView->IsInsertMode() );
++                            aCurSel = pImpEditEngine->AutoCorrect( aCurSel, 0, !pEditView->IsInsertMode(), pFrameWin );
+ 							aCurSel = pImpEditEngine->InsertLineBreak( aCurSel );
+                         }
+ 						else
+@@ -1047,7 +1047,7 @@ sal_Bool EditEngine::PostKeyEvent( const
+ 							if ( !aAutoText.Len() )
+ 							{
+ 								if ( pImpEditEngine->GetStatus().DoAutoCorrect() )
+-									aCurSel = pImpEditEngine->AutoCorrect( aCurSel, 0, !pEditView->IsInsertMode() );
++									aCurSel = pImpEditEngine->AutoCorrect( aCurSel, 0, !pEditView->IsInsertMode(), pFrameWin );
+ 								aCurSel = pImpEditEngine->InsertParaBreak( aCurSel );
+ 							}
+ 							else
+@@ -1095,7 +1095,8 @@ sal_Bool EditEngine::PostKeyEvent( const
+ 						 	( nCharCode == '\"' ) || ( nCharCode == '\'' ) ||
+ 							( nCharCode == '_' )  ))
+ 					{
+-						aCurSel = pImpEditEngine->AutoCorrect( aCurSel, nCharCode, !pEditView->IsInsertMode() );
++						aCurSel = pImpEditEngine->AutoCorrect( 
++                            aCurSel, nCharCode, !pEditView->IsInsertMode(), pFrameWin );
+ 					}
+ 					else
+ 					{
+diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=svx.vpj svx.clean/source/editeng/editview.cxx svx/source/editeng/editview.cxx
+--- svx.clean/source/editeng/editview.cxx	2008-02-25 11:50:18.000000000 -0500
++++ svx/source/editeng/editview.cxx	2008-02-28 11:52:15.000000000 -0500
+@@ -59,6 +59,7 @@
+ #include <helpid.hrc>
+ #include <i18npool/lang.h>
+ #include <vcl/menu.hxx>
++#include <vcl/window.hxx>
+ #include <acorrcfg.hxx>
+ 
+ #ifndef _UNO_LINGU_HXX
+@@ -434,11 +435,11 @@ void EditView::InsertText( const XubStri
+ 	pImpEE->FormatAndUpdate( this );
+ }
+ 
+-sal_Bool EditView::PostKeyEvent( const KeyEvent& rKeyEvent )
++sal_Bool EditView::PostKeyEvent( const KeyEvent& rKeyEvent, Window* pFrameWin )
+ {
+ 	DBG_CHKTHIS( EditView, 0 );
+ 	DBG_CHKOBJ( pImpEditView->pEditEngine, EditEngine, 0 );
+-	return pImpEditView->PostKeyEvent( rKeyEvent );
++	return pImpEditView->PostKeyEvent( rKeyEvent, pFrameWin );
+ }
+ 
+ sal_Bool EditView::MouseButtonUp( const MouseEvent& rMouseEvent )
+@@ -934,7 +935,7 @@ sal_Bool EditView::MatchGroup()
+ 	return sal_False;
+ }
+ 
+-void EditView::CompleteAutoCorrect()
++void EditView::CompleteAutoCorrect( Window* pFrameWin )
+ {
+ 	DBG_CHKTHIS( EditView, 0 );
+ 	DBG_CHKOBJ( pImpEditView->pEditEngine, EditEngine, 0 );
+@@ -944,7 +945,7 @@ void EditView::CompleteAutoCorrect()
+ 		EditSelection aSel = pImpEditView->GetEditSelection();
+ 		aSel = PIMPEE->EndOfWord( aSel.Max() );
+ 		// MT 06/00: Why pass EditSelection to AutoCorrect, not EditPaM?!
+-		aSel = PIMPEE->AutoCorrect( aSel, 0, !IsInsertMode() );
++		aSel = PIMPEE->AutoCorrect( aSel, 0, !IsInsertMode(), pFrameWin );
+ 		pImpEditView->SetEditSelection( aSel );
+ 		if ( PIMPEE->IsModified() )
+ 			PIMPEE->FormatAndUpdate( this );
+diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=svx.vpj svx.clean/source/editeng/impedit2.cxx svx/source/editeng/impedit2.cxx
+--- svx.clean/source/editeng/impedit2.cxx	2008-02-25 11:50:18.000000000 -0500
++++ svx/source/editeng/impedit2.cxx	2008-02-28 11:56:17.000000000 -0500
+@@ -2428,7 +2428,8 @@ void ImpEditEngine::ImpRemoveParagraph( 
+ 	}
+ }
+ 
+-EditPaM ImpEditEngine::AutoCorrect( const EditSelection& rCurSel, xub_Unicode c, BOOL bOverwrite )
++EditPaM ImpEditEngine::AutoCorrect( const EditSelection& rCurSel, xub_Unicode c, 
++                                    bool bOverwrite, Window* pFrameWin )
+ {
+ 	EditSelection aSel( rCurSel );
+ #ifndef SVX_LIGHT
+@@ -2478,7 +2479,7 @@ EditPaM ImpEditEngine::AutoCorrect( cons
+ 		ContentNode* pNode = aSel.Max().GetNode();
+ 		USHORT nIndex = aSel.Max().GetIndex();
+ 		EdtAutoCorrDoc aAuto( this, pNode, nIndex, c );
+-		pAutoCorrect->AutoCorrect( aAuto, *pNode, nIndex, c, !bOverwrite );
++		pAutoCorrect->AutoCorrect( aAuto, *pNode, nIndex, c, !bOverwrite, pFrameWin );
+ 		aSel.Max().SetIndex( aAuto.GetCursor() );
+ 
+ 		// #i78661 since the SvxAutoCorrect object used here is
+diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=svx.vpj svx.clean/source/editeng/impedit.cxx svx/source/editeng/impedit.cxx
+--- svx.clean/source/editeng/impedit.cxx	2008-02-25 11:50:18.000000000 -0500
++++ svx/source/editeng/impedit.cxx	2008-02-28 02:02:11.000000000 -0500
+@@ -1041,7 +1041,7 @@ Pair ImpEditView::Scroll( long ndX, long
+ 	return Pair( nRealDiffX, nRealDiffY );
+ }
+ 
+-sal_Bool ImpEditView::PostKeyEvent( const KeyEvent& rKeyEvent )
++sal_Bool ImpEditView::PostKeyEvent( const KeyEvent& rKeyEvent, Window* pFrameWin )
+ {
+     BOOL bDone = FALSE;
+ 
+@@ -1085,7 +1085,7 @@ sal_Bool ImpEditView::PostKeyEvent( cons
+     }
+ 
+     if( !bDone )
+-	    bDone = pEditEngine->PostKeyEvent( rKeyEvent, GetEditViewPtr() );
++	    bDone = pEditEngine->PostKeyEvent( rKeyEvent, GetEditViewPtr(), pFrameWin );
+ 
+     return bDone;
+ }
+diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=svx.vpj svx.clean/source/editeng/impedit.hxx svx/source/editeng/impedit.hxx
+--- svx.clean/source/editeng/impedit.hxx	2008-02-25 11:50:18.000000000 -0500
++++ svx/source/editeng/impedit.hxx	2008-02-28 11:51:11.000000000 -0500
+@@ -138,6 +138,8 @@ class TextRanger;
+ class SvKeyValueIterator;
+ class SvxForbiddenCharactersTable;
+ class SvtCTLOptions;
++class Window;
++
+ #ifndef SVX_SPELL_PORTIONS_HXX
+ #include <svx/SpellPortions.hxx>
+ #endif
+@@ -333,7 +335,7 @@ public:
+ 
+ 	BOOL			IsVertical() const;
+ 
+-	BOOL			PostKeyEvent( const KeyEvent& rKeyEvent );
++	BOOL			PostKeyEvent( const KeyEvent& rKeyEvent, Window* pFrameWin = NULL );
+ 
+ 	BOOL			MouseButtonUp( const MouseEvent& rMouseEvent );
+ 	BOOL			MouseButtonDown( const MouseEvent& rMouseEvent );
+@@ -833,7 +835,7 @@ public:
+ 	EditPaM			DeleteSelected( EditSelection aEditSelection);
+     EditPaM         InsertText( const EditSelection& rCurEditSelection, sal_Unicode c, sal_Bool bOverwrite, sal_Bool bIsUserInput = sal_False );
+ 	EditPaM			InsertText( EditSelection aCurEditSelection, const String& rStr );
+-	EditPaM			AutoCorrect( const EditSelection& rCurEditSelection, sal_Unicode c, sal_Bool bOverwrite );
++	EditPaM			AutoCorrect( const EditSelection& rCurEditSelection, sal_Unicode c, bool bOverwrite, Window* pFrameWin = NULL );
+ 	EditPaM			DeleteLeftOrRight( const EditSelection& rEditSelection, BYTE nMode, BYTE nDelMode = DELMODE_SIMPLE );
+ 	EditPaM			InsertParaBreak( EditSelection aEditSelection );
+ 	EditPaM			InsertLineBreak( EditSelection aEditSelection );
+diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=svx.vpj svx.clean/source/editeng/svxacorr.cxx svx/source/editeng/svxacorr.cxx
+--- svx.clean/source/editeng/svxacorr.cxx	2008-02-25 11:50:18.000000000 -0500
++++ svx/source/editeng/svxacorr.cxx	2008-02-28 14:25:20.000000000 -0500
+@@ -119,6 +119,7 @@
+ #include <svx/escpitem.hxx>
+ #include <svx/svxacorr.hxx>
+ #include "unolingu.hxx"
++#include "vcl/window.hxx"
+ 
+ #ifndef _SVX_HELPID_HRC
+ #include <helpid.hrc>
+@@ -412,7 +413,8 @@ long SvxAutoCorrect::GetDefaultFlags()
+ 					| SetINetAttr
+ 					| ChgQuotes
+ 					| SaveWordCplSttLst
+-					| SaveWordWrdSttLst;
++					| SaveWordWrdSttLst
++                    | CorrectCapsLock;
+ 	LanguageType eLang = GetAppLang();
+ 	switch( eLang )
+ 	{
+@@ -1113,6 +1115,49 @@ BOOL SvxAutoCorrect::FnCptlSttSntnc( Svx
+ 
+ 	return bRet;
+ }
++
++bool SvxAutoCorrect::FnCorrectCapsLock( SvxAutoCorrDoc& rDoc, const String& rTxt,
++                                        xub_StrLen nSttPos, xub_StrLen nEndPos,
++                                        LanguageType eLang )
++{
++    if (nEndPos - nSttPos < 2)
++        // string must be at least 2-character long.
++        return false;
++
++    CharClass& rCC = GetCharClass( eLang );
++
++    // Check the first 2 letters.
++    if ( !IsLowerLetter(rCC.getCharacterType(rTxt, nSttPos)) )
++        return false;
++
++    if ( !IsUpperLetter(rCC.getCharacterType(rTxt, nSttPos+1)) )
++        return false;
++
++    String aConverted;
++    aConverted.Append( rCC.upper(rTxt.GetChar(nSttPos)) );
++    aConverted.Append( rCC.lower(rTxt.GetChar(nSttPos+1)) );
++
++    for (xub_StrLen i = nSttPos+2; i < nEndPos; ++i)
++    {
++        if ( IsLowerLetter(rCC.getCharacterType(rTxt, i)) )
++            // A lowercase letter disqualifies the whole text.
++            return false;
++
++        if ( IsUpperLetter(rCC.getCharacterType(rTxt, i)) )
++            // Another uppercase letter.  Convert it.
++            aConverted.Append( rCC.lower(rTxt.GetChar(i)) );
++        else
++            // This is not an alphabetic letter.  Leave it as-is.
++            aConverted.Append(rTxt.GetChar(i));
++    }
++
++    // Replace the word.
++    rDoc.Delete(nSttPos, nEndPos);
++    rDoc.Insert(nSttPos, aConverted);
++
++    return true;
++}
++
+ //The method below is renamed from _GetQuote to GetQuote by BerryJia for Bug95846 Time:2002-8-13 15:50
+ sal_Unicode SvxAutoCorrect::GetQuote( sal_Unicode cInsChar, BOOL bSttQuote,
+ 										LanguageType eLang ) const
+@@ -1226,8 +1271,10 @@ String SvxAutoCorrect::GetQuote( SvxAuto
+ 
+ ULONG SvxAutoCorrect::AutoCorrect( SvxAutoCorrDoc& rDoc, const String& rTxt,
+ 									xub_StrLen nInsPos, sal_Unicode cChar,
+-									BOOL bInsert )
++									BOOL bInsert, Window* pFrameWin )
+ {
++    bool bLockKeyOn = pFrameWin && (pFrameWin->GetIndicatorState() & INDICATOR_CAPSLOCK);
++
+ 	ULONG nRet = 0;
+ 	do{		                            // only for middle check loop !!
+ 		if( cChar )
+@@ -1383,6 +1430,15 @@ ULONG SvxAutoCorrect::AutoCorrect( SvxAu
+ 			if( IsAutoCorrFlag( ChgToEnEmDash ) &&
+ 				FnChgToEnEmDash( rDoc, rTxt, nCapLttrPos, nInsPos, eLang ) )
+ 				nRet |= ChgToEnEmDash;
++
++            if ( bLockKeyOn && IsAutoCorrFlag( CorrectCapsLock ) &&
++                 FnCorrectCapsLock( rDoc, rTxt, nCapLttrPos, nInsPos, eLang ) )
++                // Correct accidental use of cAPS LOCK key (do this only when 
++                // the caps or shift lock key is pressed).
++            {
++                nRet |= CorrectCapsLock;
++                pFrameWin->SimulateKeyPress( KEY_CAPSLOCK );
++            }
+ 		}
+ 
+ 	} while( FALSE );

Added: trunk/patches/src680/autocorrect-accidental-caps-lock-vcl.diff
==============================================================================
--- (empty file)
+++ trunk/patches/src680/autocorrect-accidental-caps-lock-vcl.diff	Thu Feb 28 20:06:25 2008
@@ -0,0 +1,402 @@
+diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=vcl.vpj vcl.clean/aqua/inc/salframe.h vcl/aqua/inc/salframe.h
+--- vcl.clean/aqua/inc/salframe.h	2008-01-14 11:13:04.000000000 -0500
++++ vcl/aqua/inc/salframe.h	2008-02-28 12:57:14.000000000 -0500
+@@ -146,6 +146,8 @@ public:
+     virtual void				Beep( SoundType eSoundType );
+     virtual const SystemEnvData*	GetSystemData() const;
+     virtual SalPointerState		GetPointerState();
++    virtual SalIndicatorState   GetIndicatorState();
++    virtual void                SimulateKeyPress( USHORT nKeyCode );
+     virtual void				SetParent( SalFrame* pNewParent );
+     virtual bool				SetPluginParent( SystemParentData* pNewParent );
+     virtual void                SetExtendedFrameStyle( SalExtStyle );
+diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=vcl.vpj vcl.clean/aqua/source/window/salframe.cxx vcl/aqua/source/window/salframe.cxx
+--- vcl.clean/aqua/source/window/salframe.cxx	2008-01-14 11:18:51.000000000 -0500
++++ vcl/aqua/source/window/salframe.cxx	2008-02-28 12:57:39.000000000 -0500
+@@ -1197,6 +1197,17 @@ SalPointerState	AquaSalFrame::GetPointer
+     return state;
+ }
+ 
++SalFrame::SalIndicatorState AquaSalFrame::GetIndicatorState()
++{
++    SalIndicatorState aState;
++    aState.mnState = 0;
++    return aState;
++}
++
++void AquaSalFrame::SimulateKeyPress( USHORT /*nKeyCode*/ )
++{
++}
++
+ bool AquaSalFrame::SetPluginParent( SystemParentData* pNewParent )
+ {
+     // plugin parent may be killed unexpectedly by
+Only in vcl: Debug
+diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=vcl.vpj vcl.clean/inc/vcl/keycodes.hxx vcl/inc/vcl/keycodes.hxx
+--- vcl.clean/inc/vcl/keycodes.hxx	2008-01-14 11:20:04.000000000 -0500
++++ vcl/inc/vcl/keycodes.hxx	2008-02-28 14:28:37.000000000 -0500
+@@ -171,6 +171,10 @@
+ #define KEY_TILDE       ((USHORT)::com::sun::star::awt::Key::TILDE)
+ #define KEY_QUOTELEFT   ((USHORT)::com::sun::star::awt::Key::QUOTELEFT)
+ 
++#define KEY_CAPSLOCK    ((USHORT)::com::sun::star::awt::Key::CAPSLOCK)
++#define KEY_NUMLOCK     ((USHORT)::com::sun::star::awt::Key::NUMLOCK)
++#define KEY_SCROLLLOCK  ((USHORT)::com::sun::star::awt::Key::SCROLLLOCK)
++
+ #define KEY_CODE		((USHORT)0x0FFF)
+ 
+ // Modifier-Tasten
+@@ -200,4 +204,12 @@
+ #define MOUSE_MIDDLE	((USHORT)0x0002)
+ #define MOUSE_RIGHT 	((USHORT)0x0004)
+ 
++// -------------------
++// - Indicator-Types -
++// -------------------
++
++#define INDICATOR_CAPSLOCK      0x0001
++#define INDICATOR_NUMLOCK       0x0002
++#define INDICATOR_SCROLLLOCK    0x0004
++
+ #endif // _SV_KEYCODES_HXX
+diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=vcl.vpj vcl.clean/inc/vcl/salframe.hxx vcl/inc/vcl/salframe.hxx
+--- vcl.clean/inc/vcl/salframe.hxx	2007-10-09 11:17:45.000000000 -0400
++++ vcl/inc/vcl/salframe.hxx	2008-02-28 11:21:03.000000000 -0500
+@@ -272,6 +272,15 @@ public:
+ 
+     virtual SalPointerState		GetPointerState() = 0;
+ 
++    struct SalIndicatorState
++    {
++        USHORT  mnState;
++    };
++
++    virtual SalIndicatorState   GetIndicatorState() = 0;
++
++    virtual void                SimulateKeyPress( USHORT nKeyCode ) = 0;
++
+     // set new parent window
+     virtual void				SetParent( SalFrame* pNewParent ) = 0;
+     // reparent window to act as a plugin; implementation
+diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=vcl.vpj vcl.clean/inc/vcl/window.hxx vcl/inc/vcl/window.hxx
+--- vcl.clean/inc/vcl/window.hxx	2008-01-14 08:04:14.000000000 -0500
++++ vcl/inc/vcl/window.hxx	2008-02-28 02:11:44.000000000 -0500
+@@ -1121,6 +1121,22 @@ public:
+     /* mark Window for deletion in top of event queue
+     */
+     void doLazyDelete();
++
++    //-------------------------------------
++    //  Keyboard access functions
++    //-------------------------------------
++
++    /** Query the states of keyboard indicators - Caps Lock, Num Lock and
++        Scroll Lock.  Use the following mask to retrieve the state of each
++        indicator:
++        
++            INDICATOR_CAPS_LOCK
++            INDICATOR_NUM_LOCK
++            INDICATOR_SCROLL_LOCK
++      */
++    USHORT GetIndicatorState() const;
++
++    void SimulateKeyPress( USHORT nKeyCode ) const;
+ };
+ 
+ 
+diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=vcl.vpj vcl.clean/os2/inc/salframe.h vcl/os2/inc/salframe.h
+--- vcl.clean/os2/inc/salframe.h	2007-11-02 08:44:25.000000000 -0400
++++ vcl/os2/inc/salframe.h	2008-02-28 13:00:17.000000000 -0500
+@@ -168,6 +168,8 @@ public:
+     virtual void				Beep( SoundType eSoundType );
+     virtual const SystemEnvData*	GetSystemData() const;
+     virtual SalPointerState		GetPointerState();
++    virtual SalIndicatorState   GetIndicatorState();
++    virtual void                SimulateKeyPress( USHORT nKeyCode );
+     virtual void				SetParent( SalFrame* pNewParent );
+     virtual bool				SetPluginParent( SystemParentData* pNewParent );
+     virtual void                SetBackgroundBitmap( SalBitmap* );
+diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=vcl.vpj vcl.clean/os2/source/window/salframe.cxx vcl/os2/source/window/salframe.cxx
+--- vcl.clean/os2/source/window/salframe.cxx	2007-11-02 08:51:30.000000000 -0400
++++ vcl/os2/source/window/salframe.cxx	2008-02-28 13:01:25.000000000 -0500
+@@ -2335,6 +2335,19 @@ SalFrame::SalPointerState Os2SalFrame::G
+ 
+ // -----------------------------------------------------------------------
+ 
++SalFrame::SalIndicatorState Os2SalFrame::GetIndicatorState()
++{
++    SalIndicatorState aState;
++    aState.mnState = 0;
++    return aState;
++}
++
++void Os2SalFrame::SimulateKeyPress( USHORT /*nKeyCode*/ )
++{
++}
++
++// -----------------------------------------------------------------------
++
+ void Os2SalFrame::SetBackgroundBitmap( SalBitmap* )
+ {
+ }
+diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=vcl.vpj vcl.clean/source/window/window.cxx vcl/source/window/window.cxx
+--- vcl.clean/source/window/window.cxx	2008-01-29 11:18:41.000000000 -0500
++++ vcl/source/window/window.cxx	2008-02-28 14:00:43.000000000 -0500
+@@ -4797,6 +4797,16 @@ void Window::doLazyDelete()
+     vcl::LazyDeletor<Window>::Delete( this );
+ }
+ 
++USHORT Window::GetIndicatorState() const
++{
++    return mpWindowImpl->mpFrame->GetIndicatorState().mnState;
++}
++
++void Window::SimulateKeyPress( USHORT nKeyCode ) const
++{
++    mpWindowImpl->mpFrame->SimulateKeyPress(nKeyCode);
++}
++
+ // -----------------------------------------------------------------------
+ 
+ void Window::MouseMove( const MouseEvent& rMEvt )
+diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=vcl.vpj vcl.clean/unx/gtk/window/gtkframe.cxx vcl/unx/gtk/window/gtkframe.cxx
+--- vcl.clean/unx/gtk/window/gtkframe.cxx	2008-01-29 11:21:11.000000000 -0500
++++ vcl/unx/gtk/window/gtkframe.cxx	2008-02-28 14:02:01.000000000 -0500
+@@ -2068,6 +2068,18 @@ SalFrame::SalPointerState GtkSalFrame::G
+     return aState;
+ }
+ 
++SalFrame::SalIndicatorState GtkSalFrame::GetIndicatorState()
++{
++    SalIndicatorState aState;
++    aState.mnState = GetX11SalData()->GetDisplay()->GetIndicatorState();
++    return aState;
++}
++
++void GtkSalFrame::SimulateKeyPress( USHORT nKeyCode )
++{
++    GetX11SalData()->GetDisplay()->SimulateKeyPress(nKeyCode);
++}
++
+ void GtkSalFrame::SetInputContext( SalInputContext* pContext )
+ {
+     if( ! pContext )
+diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=vcl.vpj vcl.clean/unx/headless/svpframe.cxx vcl/unx/headless/svpframe.cxx
+--- vcl.clean/unx/headless/svpframe.cxx	2007-08-03 10:09:51.000000000 -0400
++++ vcl/unx/headless/svpframe.cxx	2008-02-28 11:27:06.000000000 -0500
+@@ -396,6 +396,17 @@ SalFrame::SalPointerState SvpSalFrame::G
+     return aState;
+ }
+ 
++SalFrame::SalIndicatorState SvpSalFrame::GetIndicatorState()
++{
++    SalIndicatorState aState;
++    aState.mnState = 0;
++    return aState;
++}
++
++void SvpSalFrame::SimulateKeyPress( USHORT /*nKeyCode*/ )
++{
++}
++
+ void SvpSalFrame::SetParent( SalFrame* pNewParent )
+ {
+     if( m_pParent )
+diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=vcl.vpj vcl.clean/unx/headless/svpframe.hxx vcl/unx/headless/svpframe.hxx
+--- vcl.clean/unx/headless/svpframe.hxx	2007-07-24 06:27:17.000000000 -0400
++++ vcl/unx/headless/svpframe.hxx	2008-02-28 11:26:40.000000000 -0500
+@@ -119,6 +119,8 @@ public:
+     virtual void				Beep( SoundType eSoundType );
+     virtual const SystemEnvData*	GetSystemData() const;
+     virtual SalPointerState     GetPointerState();
++    virtual SalIndicatorState   GetIndicatorState();
++    virtual void                SimulateKeyPress( USHORT nKeyCode );
+     virtual void				SetParent( SalFrame* pNewParent );
+     virtual bool				SetPluginParent( SystemParentData* pNewParent );
+     virtual void                SetBackgroundBitmap( SalBitmap* pBitmap );
+diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=vcl.vpj vcl.clean/unx/inc/plugins/gtk/gtkframe.hxx vcl/unx/inc/plugins/gtk/gtkframe.hxx
+--- vcl.clean/unx/inc/plugins/gtk/gtkframe.hxx	2008-01-29 11:21:43.000000000 -0500
++++ vcl/unx/inc/plugins/gtk/gtkframe.hxx	2008-02-28 11:22:22.000000000 -0500
+@@ -364,6 +364,10 @@ public:
+     // get current modifier and button mask
+     virtual SalPointerState     GetPointerState();
+ 
++    virtual SalIndicatorState   GetIndicatorState();
++
++    virtual void                SimulateKeyPress( USHORT nKeyCode );
++
+     // set new parent window
+     virtual void                SetParent( SalFrame* pNewParent );
+     // reparent window to act as a plugin; implementation
+diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=vcl.vpj vcl.clean/unx/inc/postx.h vcl/unx/inc/postx.h
+--- vcl.clean/unx/inc/postx.h	2006-06-19 15:46:31.000000000 -0400
++++ vcl/unx/inc/postx.h	2008-02-28 12:46:34.000000000 -0500
+@@ -58,7 +58,6 @@
+ #undef Min
+ #undef Max
+ #undef DestroyAll
+-#undef Success
+ 
+ #undef Printer
+ /* #undef FontInfo */
+@@ -80,5 +79,13 @@ Error KeyPress must be Equal 2
+ #endif
+ #define XLIB_KeyPress 2
+ 
++#ifdef Success
++#if Success != 0
++Error Success must be equal to 0
++#endif
++#undef Success
++#endif
++#define XLIB_Success 0
++
+ #endif
+ 
+diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=vcl.vpj vcl.clean/unx/inc/prex.h vcl/unx/inc/prex.h
+--- vcl.clean/unx/inc/prex.h	2007-04-26 06:40:23.000000000 -0400
++++ vcl/unx/inc/prex.h	2008-02-28 12:35:39.000000000 -0500
+@@ -64,6 +64,12 @@ extern "C" {
+ #define __XKeyboardExtension__ 0
+ #endif
+ 
++#if defined(LINUX)
++#define __XTestExtension__ 1
++#else
++#define __XTestExtension__ 0
++#endif
++
+ #include <X11/X.h>
+ #include <X11/Xlib.h>
+ #include <X11/Xutil.h>
+diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=vcl.vpj vcl.clean/unx/inc/saldisp.hxx vcl/unx/inc/saldisp.hxx
+--- vcl.clean/unx/inc/saldisp.hxx	2008-01-29 11:21:27.000000000 -0500
++++ vcl/unx/inc/saldisp.hxx	2008-02-28 10:16:38.000000000 -0500
+@@ -457,6 +457,8 @@ public:
+     void			Beep() const;
+ 
+     void			ModifierMapping();
++    void            SimulateKeyPress( USHORT nKeyCode );
++    USHORT          GetIndicatorState() const;
+     String			GetKeyNameFromKeySym( KeySym keysym ) const;
+     XubString		GetKeyName( USHORT nKeyCode ) const;
+     USHORT			GetKeyCode( KeySym keysym, char*pcPrintable ) const;
+diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=vcl.vpj vcl.clean/unx/inc/salframe.h vcl/unx/inc/salframe.h
+--- vcl.clean/unx/inc/salframe.h	2007-08-30 09:56:30.000000000 -0400
++++ vcl/unx/inc/salframe.h	2008-02-28 11:25:36.000000000 -0500
+@@ -272,6 +272,8 @@ public:
+     virtual void				Beep( SoundType eSoundType );
+     virtual const SystemEnvData*	GetSystemData() const;
+     virtual SalPointerState     GetPointerState();
++    virtual SalIndicatorState   GetIndicatorState();
++    virtual void                SimulateKeyPress( USHORT nKeyCode );
+     virtual void				SetParent( SalFrame* pNewParent );
+     virtual bool				SetPluginParent( SystemParentData* pNewParent );
+     virtual void                SetBackgroundBitmap( SalBitmap* pBitmap );
+diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=vcl.vpj vcl.clean/unx/source/app/saldisp.cxx vcl/unx/source/app/saldisp.cxx
+--- vcl.clean/unx/source/app/saldisp.cxx	2008-01-29 11:22:34.000000000 -0500
++++ vcl/unx/source/app/saldisp.cxx	2008-02-28 13:17:22.000000000 -0500
+@@ -86,6 +86,10 @@ Status XineramaGetInfo(Display*, int, XR
+ #endif
+ #endif
+ 
++#if __XTestExtension__
++#include <X11/extensions/XTest.h>
++#endif
++
+ #include <postx.h>
+ 
+ #include <salunx.h>
+@@ -1074,6 +1078,35 @@ void SalDisplay::Beep() const
+ 
+ // Keyboard
+ // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
++
++void SalDisplay::SimulateKeyPress( USHORT nKeyCode )
++{
++#if __XTestExtension__
++    if (nKeyCode == KEY_CAPSLOCK)
++    {
++        XLIB_KeyCode keyCaps = XKeysymToKeycode(GetDisplay(), XK_Caps_Lock);
++        if (!XTestFakeKeyEvent(GetDisplay(), keyCaps, true, CurrentTime) == XLIB_Success)
++            XTestFakeKeyEvent(GetDisplay(), keyCaps, false, CurrentTime);
++    }
++#endif
++}
++
++USHORT SalDisplay::GetIndicatorState() const
++{
++    unsigned int _state;
++    USHORT nState = 0;
++    XkbGetIndicatorState(pDisp_, XkbUseCoreKbd, &_state);
++
++    if ((_state & 0x00000001))
++        nState |= INDICATOR_CAPSLOCK;
++    if ((_state & 0x00000002))
++        nState |= INDICATOR_NUMLOCK;
++    if ((_state & 0x00000004))
++        nState |= INDICATOR_SCROLLLOCK;
++
++    return nState;
++}
++
+ String SalDisplay::GetKeyNameFromKeySym( KeySym nKeySym ) const
+ {
+ 	String aRet;
+diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=vcl.vpj vcl.clean/unx/source/window/salframe.cxx vcl/unx/source/window/salframe.cxx
+--- vcl.clean/unx/source/window/salframe.cxx	2008-01-30 04:12:30.000000000 -0500
++++ vcl/unx/source/window/salframe.cxx	2008-02-28 11:26:21.000000000 -0500
+@@ -2757,6 +2757,18 @@ SalFrame::SalPointerState X11SalFrame::G
+     return aState;
+ }
+ 
++SalFrame::SalIndicatorState X11SalFrame::GetIndicatorState()
++{
++    SalIndicatorState aState;
++    aState.mnState = GetX11SalData()->GetDisplay()->GetIndicatorState();
++    return aState;
++}
++
++void X11SalFrame::SimulateKeyPress( USHORT nKeyCode )
++{
++    GetX11SalData()->GetDisplay()->SimulateKeyPress(nKeyCode);
++}
++
+ long X11SalFrame::HandleMouseEvent( XEvent *pEvent )
+ {
+ 	SalMouseEvent		aMouseEvt;
+diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=vcl.vpj vcl.clean/win/inc/salframe.h vcl/win/inc/salframe.h
+--- vcl.clean/win/inc/salframe.h	2007-07-24 06:33:22.000000000 -0400
++++ vcl/win/inc/salframe.h	2008-02-28 12:58:19.000000000 -0500
+@@ -149,6 +149,8 @@ public:
+     virtual void				Beep( SoundType eSoundType );
+     virtual const SystemEnvData*	GetSystemData() const;
+     virtual SalPointerState		GetPointerState();
++    virtual SalIndicatorState   GetIndicatorState();
++    virtual void                SimulateKeyPress( USHORT nKeyCode );
+     virtual void				SetParent( SalFrame* pNewParent );
+     virtual bool				SetPluginParent( SystemParentData* pNewParent );
+     virtual void                SetBackgroundBitmap( SalBitmap* );
+diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=vcl.vpj vcl.clean/win/source/window/salframe.cxx vcl/win/source/window/salframe.cxx
+--- vcl.clean/win/source/window/salframe.cxx	2008-01-15 08:25:15.000000000 -0500
++++ vcl/win/source/window/salframe.cxx	2008-02-28 12:59:31.000000000 -0500
+@@ -3177,6 +3177,19 @@ SalFrame::SalPointerState WinSalFrame::G
+ 
+ // -----------------------------------------------------------------------
+ 
++SalFrame::SalIndicatorState WinSalFrame::GetIndicatorState()
++{
++    SalIndicatorState aState;
++    aState.mnState = 0;
++    return aState;
++}
++
++void WinSalFrame::SimulateKeyPress( USHORT /*nKeyCode*/ )
++{
++}
++
++// -----------------------------------------------------------------------
++
+ void WinSalFrame::SetBackgroundBitmap( SalBitmap* )
+ {
+ }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]