[ooo-build-commit] .: patches/dev300
Kohei Yoshida
kohei at kemper.freedesktop.org
Wed Sep 29 13:23:48 PDT 2010
patches/dev300/apply | 8
patches/dev300/autocorrect-accidental-caps-lock-offapi.diff | 30
patches/dev300/autocorrect-accidental-caps-lock-officecfg.diff | 27
patches/dev300/autocorrect-accidental-caps-lock-sc.diff | 38
patches/dev300/autocorrect-accidental-caps-lock-svx.diff | 590 ----------
patches/dev300/autocorrect-accidental-caps-lock-sw.diff | 20
patches/dev300/autocorrect-accidental-caps-lock-vcl.diff | 464 -------
7 files changed, 1177 deletions(-)
New commits:
commit 6dcb39fc5f78ab5a11952e6d23837a947659fb24
Author: Kohei Yoshida <kyoshida at novell.com>
Date: Wed Sep 29 16:21:59 2010 -0400
Removed autocorrect-accidental-caps-lock-*.diff; moved to the split repos.
diff --git a/patches/dev300/apply b/patches/dev300/apply
index 739542c..567197e 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -1876,14 +1876,6 @@ layout-generate-localize-sdf.diff, deb#570378, pmladek
SectionOwner => kohei
SectionIssue => i#62234
-# Correct accidental use of cAPS LOCK KEY!
-autocorrect-accidental-caps-lock-offapi.diff
-autocorrect-accidental-caps-lock-officecfg.diff
-autocorrect-accidental-caps-lock-sc.diff
-autocorrect-accidental-caps-lock-sw.diff
-autocorrect-accidental-caps-lock-svx.diff
-autocorrect-accidental-caps-lock-vcl.diff
-
# Fancy document modified status window
statusbar-fancy-modified-status-sc.diff, i#103862, kohei
statusbar-fancy-modified-status-sd.diff, i#103862, kohei
diff --git a/patches/dev300/autocorrect-accidental-caps-lock-offapi.diff b/patches/dev300/autocorrect-accidental-caps-lock-offapi.diff
deleted file mode 100644
index b1c64c3..0000000
--- a/patches/dev300/autocorrect-accidental-caps-lock-offapi.diff
+++ /dev/null
@@ -1,30 +0,0 @@
----
- offapi/com/sun/star/awt/Key.idl | 12 ++++++++++++
- 1 files changed, 12 insertions(+), 0 deletions(-)
-
-diff --git offapi/com/sun/star/awt/Key.idl offapi/com/sun/star/awt/Key.idl
-index 26176d8..ec0b3b4 100644
---- offapi/com/sun/star/awt/Key.idl
-+++ offapi/com/sun/star/awt/Key.idl
-@@ -447,6 +447,18 @@ published constants Key
- const short QUOTELEFT = 1311;
-
- //-------------------------------------------------------------------------
-+
-+ const short CAPSLOCK = 1312;
-+
-+ //-------------------------------------------------------------------------
-+
-+ const short NUMLOCK = 1313;
-+
-+ //-------------------------------------------------------------------------
-+
-+ const short SCROLLLOCK = 1314;
-+
-+ //-------------------------------------------------------------------------
-
- const short DELETE_TO_BEGIN_OF_LINE = 1536;
-
---
-1.7.0.1
-
diff --git a/patches/dev300/autocorrect-accidental-caps-lock-officecfg.diff b/patches/dev300/autocorrect-accidental-caps-lock-officecfg.diff
deleted file mode 100644
index 26d6b14..0000000
--- a/patches/dev300/autocorrect-accidental-caps-lock-officecfg.diff
+++ /dev/null
@@ -1,27 +0,0 @@
----
- .../schema/org/openoffice/Office/Common.xcs | 9 +++++++++
- 1 files changed, 9 insertions(+), 0 deletions(-)
-
-diff --git officecfg/registry/schema/org/openoffice/Office/Common.xcs officecfg/registry/schema/org/openoffice/Office/Common.xcs
-index cd948f9..e72e80f 100644
---- officecfg/registry/schema/org/openoffice/Office/Common.xcs
-+++ officecfg/registry/schema/org/openoffice/Office/Common.xcs
-@@ -1346,6 +1346,15 @@
- </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 -->
---
-1.7.0.1
-
diff --git a/patches/dev300/autocorrect-accidental-caps-lock-sc.diff b/patches/dev300/autocorrect-accidental-caps-lock-sc.diff
deleted file mode 100644
index 2670fb3..0000000
--- a/patches/dev300/autocorrect-accidental-caps-lock-sc.diff
+++ /dev/null
@@ -1,38 +0,0 @@
----
- sc/source/ui/app/inputhdl.cxx | 9 +++++++--
- 1 files changed, 7 insertions(+), 2 deletions(-)
-
-diff --git sc/source/ui/app/inputhdl.cxx sc/source/ui/app/inputhdl.cxx
-index 12a245a..1e71912 100644
---- sc/source/ui/app/inputhdl.cxx
-+++ sc/source/ui/app/inputhdl.cxx
-@@ -2425,10 +2425,12 @@ void ScInputHandler::EnterHandler( BYTE nBlockMode )
- 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);
-@@ -3174,8 +3176,11 @@ BOOL ScInputHandler::KeyInput( const KeyEvent& rKEvt, BOOL bStartEdit /* = FALSE
- else
- {
- if (pTableView)
-- if ( pTableView->PostKeyEvent( rKEvt ) )
-+ {
-+ Window* pFrameWin = pActiveViewSh ? pActiveViewSh->GetFrameWin() : NULL;
-+ if ( pTableView->PostKeyEvent( rKEvt, pFrameWin ) )
- bUsed = TRUE;
-+ }
- if (pTopView)
- if ( pTopView->PostKeyEvent( rKEvt ) )
- bUsed = TRUE;
---
-1.7.0.1
-
diff --git a/patches/dev300/autocorrect-accidental-caps-lock-svx.diff b/patches/dev300/autocorrect-accidental-caps-lock-svx.diff
deleted file mode 100644
index db189c1..0000000
--- a/patches/dev300/autocorrect-accidental-caps-lock-svx.diff
+++ /dev/null
@@ -1,590 +0,0 @@
----
- cui/source/inc/autocdlg.hxx | 2 +
- cui/source/tabpages/autocdlg.cxx | 13 +++++++-
- cui/source/tabpages/autocdlg.hrc | 1 +
- cui/source/tabpages/autocdlg.src | 4 ++
- editeng/inc/editeng/editeng.hxx | 3 +-
- editeng/inc/editeng/editview.hxx | 4 +-
- editeng/inc/editeng/outliner.hxx | 2 +-
- editeng/inc/editeng/svxacorr.hxx | 7 +++-
- editeng/source/editeng/editeng.cxx | 11 +++---
- editeng/source/editeng/editview.cxx | 9 +++--
- editeng/source/editeng/impedit.cxx | 4 +-
- editeng/source/editeng/impedit.hxx | 6 ++-
- editeng/source/editeng/impedit2.cxx | 5 ++-
- editeng/source/misc/acorrcfg.cxx | 13 ++++++-
- editeng/source/misc/svxacorr.cxx | 61 +++++++++++++++++++++++++++++++++-
- editeng/source/outliner/outlvw.cxx | 4 +-
- svx/source/svdraw/svdedxv.cxx | 2 +-
- 17 files changed, 123 insertions(+), 28 deletions(-)
-
-diff --git cui/source/inc/autocdlg.hxx cui/source/inc/autocdlg.hxx
-index 5b3b41e..848b2eb 100644
---- cui/source/inc/autocdlg.hxx
-+++ cui/source/inc/autocdlg.hxx
-@@ -116,6 +116,7 @@ private:
- String sDash;
- String sNonBrkSpace;
- String sFirst;
-+ String sAccidentalCaps;
-
- public:
- OfaAutocorrOptionsPage( Window* pParent, const SfxItemSet& rSet );
-@@ -153,6 +154,7 @@ class OfaSwAutoFmtOptionsPage : public SfxTabPage
- String sByInputBullet;
- String sBoldUnder;
- String sNoDblSpaces;
-+ String sCorrectCapsLock;
- String sDetectURL;
- String sDash;
- String sNonBrkSpace;
-diff --git cui/source/tabpages/autocdlg.cxx cui/source/tabpages/autocdlg.cxx
-index d274cb0..afb63d2 100644
---- cui/source/tabpages/autocdlg.cxx
-+++ cui/source/tabpages/autocdlg.cxx
-@@ -224,7 +224,8 @@ OfaAutocorrOptionsPage::OfaAutocorrOptionsPage( Window* pParent,
- sBoldUnderline (CUI_RES(ST_BOLD_UNDER )),
- sURL (CUI_RES(ST_DETECT_URL )),
- sNoDblSpaces (CUI_RES(STR_NO_DBL_SPACES )),
-- sDash (CUI_RES(ST_DASH ))
-+ sDash (CUI_RES(ST_DASH )),
-+ sAccidentalCaps (CUI_RES(ST_CORRECT_ACCIDENTAL_CAPS_LOCK))
- {
- FreeResource();
-
-@@ -268,6 +269,7 @@ BOOL OfaAutocorrOptionsPage::FillItemSet( SfxItemSet& )
- pAutoCorrect->SetAutoCorrFlag(SetINetAttr, aCheckLB.IsChecked(nPos++));
- pAutoCorrect->SetAutoCorrFlag(ChgToEnEmDash, aCheckLB.IsChecked(nPos++));
- pAutoCorrect->SetAutoCorrFlag(IgnoreDoubleSpace, aCheckLB.IsChecked(nPos++));
-+ pAutoCorrect->SetAutoCorrFlag(CorrectCapsLock, aCheckLB.IsChecked(nPos++));
-
- BOOL bReturn = nFlags != pAutoCorrect->GetFlags();
- if(bReturn )
-@@ -307,6 +309,7 @@ void OfaAutocorrOptionsPage::Reset( const SfxItemSet& )
- aCheckLB.InsertEntry(sURL);
- aCheckLB.InsertEntry(sDash);
- aCheckLB.InsertEntry(sNoDblSpaces);
-+ aCheckLB.InsertEntry(sAccidentalCaps);
-
- USHORT nPos = 0;
- aCheckLB.CheckEntryPos( nPos++, 0 != (nFlags & Autocorrect) );
-@@ -316,6 +319,7 @@ void OfaAutocorrOptionsPage::Reset( const SfxItemSet& )
- aCheckLB.CheckEntryPos( nPos++, 0 != (nFlags & SetINetAttr) );
- aCheckLB.CheckEntryPos( nPos++, 0 != (nFlags & ChgToEnEmDash) );
- aCheckLB.CheckEntryPos( nPos++, 0 != (nFlags & IgnoreDoubleSpace) );
-+ aCheckLB.CheckEntryPos( nPos++, 0 != (nFlags & CorrectCapsLock) );
-
- aCheckLB.SetUpdateMode(TRUE);
- }
-@@ -446,6 +450,7 @@ enum OfaAutoFmtOptions
- DEL_SPACES_AT_STT_END,
- DEL_SPACES_BETWEEN_LINES,
- IGNORE_DBLSPACE,
-+ CORRECT_CAPS_LOCK,
- APPLY_NUMBERING,
- INSERT_BORDER,
- CREATE_TABLE,
-@@ -473,6 +478,7 @@ OfaSwAutoFmtOptionsPage::OfaSwAutoFmtOptionsPage( Window* pParent,
- sBullet (CUI_RES( ST_BULLET )),
- sBoldUnder (CUI_RES( ST_BOLD_UNDER )),
- sNoDblSpaces (CUI_RES( STR_NO_DBL_SPACES)),
-+ sCorrectCapsLock (CUI_RES( ST_CORRECT_ACCIDENTAL_CAPS_LOCK)),
- sDetectURL (CUI_RES( ST_DETECT_URL )),
- sDash (CUI_RES( ST_DASH )),
- sRightMargin (CUI_RES( ST_RIGHT_MARGIN )),
-@@ -606,6 +612,9 @@ BOOL OfaSwAutoFmtOptionsPage::FillItemSet( SfxItemSet& )
- pAutoCorrect->SetAutoCorrFlag(IgnoreDoubleSpace,
- 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;
-@@ -719,6 +728,7 @@ void OfaSwAutoFmtOptionsPage::Reset( const SfxItemSet& )
- 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));
-@@ -737,6 +747,7 @@ void OfaSwAutoFmtOptionsPage::Reset( const SfxItemSet& )
- 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 & IgnoreDoubleSpace) );
-+ 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_DASHES, CBCOL_FIRST, pOpt->bChgToEnEmDash );
-diff --git cui/source/tabpages/autocdlg.hrc cui/source/tabpages/autocdlg.hrc
-index d95dcf5..e63684c 100644
---- cui/source/tabpages/autocdlg.hrc
-+++ cui/source/tabpages/autocdlg.hrc
-@@ -149,6 +149,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 --git cui/source/tabpages/autocdlg.src cui/source/tabpages/autocdlg.src
-index eea4e59..2fbbd21 100644
---- cui/source/tabpages/autocdlg.src
-+++ cui/source/tabpages/autocdlg.src
-@@ -129,6 +129,10 @@ 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 --git editeng/inc/editeng/editeng.hxx editeng/inc/editeng/editeng.hxx
-index 3ba1e82..efe2d42 100755
---- editeng/inc/editeng/editeng.hxx
-+++ editeng/inc/editeng/editeng.hxx
-@@ -53,6 +53,7 @@ class Rectangle;
- class SvStream;
- class Link;
- class OutputDevice;
-+class Window;
- class SvUShorts;
- class SfxPoolItem;
- class SvxNumBulletItem;
-@@ -124,7 +125,7 @@ private:
- EDITENG_DLLPRIVATE EditEngine& operator=( const EditEngine& );
-
- //#if 0 // _SOLAR__PRIVATE
-- EDITENG_DLLPRIVATE BOOL PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pView );
-+ EDITENG_DLLPRIVATE BOOL PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pView, Window* pFrameWin = NULL );
- //#endif
-
- protected:
-diff --git editeng/inc/editeng/editview.hxx editeng/inc/editeng/editview.hxx
-index 761f282..8450c44 100644
---- editeng/inc/editeng/editview.hxx
-+++ editeng/inc/editeng/editview.hxx
-@@ -145,7 +145,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 );
-@@ -208,7 +208,7 @@ public:
-
- BOOL MatchGroup();
-
-- void CompleteAutoCorrect();
-+ void CompleteAutoCorrect( Window* pFrameWin = NULL );
-
- EESpellState StartSpeller( BOOL bMultipleDoc = FALSE );
- EESpellState StartThesaurus();
-diff --git editeng/inc/editeng/outliner.hxx editeng/inc/editeng/outliner.hxx
-index 5e1e62a..10664cd 100644
---- editeng/inc/editeng/outliner.hxx
-+++ editeng/inc/editeng/outliner.hxx
-@@ -259,7 +259,7 @@ public:
- void Scroll( long nHorzScroll, long nVertScroll );
-
- void Paint( const Rectangle& rRect );
-- BOOL PostKeyEvent( const KeyEvent& rKEvt );
-+ BOOL PostKeyEvent( const KeyEvent& rKEvt, Window* pFrameWin = NULL );
- BOOL MouseButtonDown( const MouseEvent& );
- BOOL MouseButtonUp( const MouseEvent& );
- BOOL MouseMove( const MouseEvent& );
-diff --git editeng/inc/editeng/svxacorr.hxx editeng/inc/editeng/svxacorr.hxx
-index 333235b..d344e26 100644
---- editeng/inc/editeng/svxacorr.hxx
-+++ editeng/inc/editeng/svxacorr.hxx
-@@ -47,6 +47,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
-@@ -62,6 +63,7 @@ const long SaveWordCplSttLst= 0x00000200; // GrB. am SatzAnf. auto. aufnehmen
- const long SaveWordWrdSttLst= 0x00000400; // 2 GrB. am WortAnf. auto. aufnehmen
- const long IgnoreDoubleSpace= 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
-@@ -250,7 +252,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.
-@@ -375,6 +377,9 @@ public:
- BOOL FnCptlSttSntnc( SvxAutoCorrDoc&, const String&, BOOL bNormalPos,
- 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 );
-
- bool HasRunNext() { return bRunNext; }
-
-diff --git editeng/source/editeng/editeng.cxx editeng/source/editeng/editeng.cxx
-index 2a6e5f3..384ba17 100644
---- editeng/source/editeng/editeng.cxx
-+++ editeng/source/editeng/editeng.cxx
-@@ -821,7 +821,7 @@ ESelection EditEngine::SelectSentence( const ESelection& rCurSel ) const
- return pE->pImpEditEngine->CreateESel( aSentenceSel );
- }
-
--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 );
-@@ -1081,7 +1081,7 @@ sal_Bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditVie
- 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 );
-@@ -1102,7 +1102,7 @@ sal_Bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditVie
- 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
-@@ -1110,7 +1110,7 @@ sal_Bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditVie
- 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
-@@ -1158,7 +1158,8 @@ sal_Bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditVie
- ( SvxAutoCorrect::IsAutoCorrectChar( nCharCode ) ||
- pAutoCorrect->HasRunNext() ) )
- {
-- aCurSel = pImpEditEngine->AutoCorrect( aCurSel, nCharCode, !pEditView->IsInsertMode() );
-+ aCurSel = pImpEditEngine->AutoCorrect(
-+ aCurSel, nCharCode, !pEditView->IsInsertMode(), pFrameWin );
- }
- else
- {
-diff --git editeng/source/editeng/editview.cxx editeng/source/editeng/editview.cxx
-index c892117..36c0496 100755
---- editeng/source/editeng/editview.cxx
-+++ editeng/source/editeng/editview.cxx
-@@ -60,6 +60,7 @@
- #include <helpid.hrc>
- #include <i18npool/lang.h>
- #include <vcl/menu.hxx>
-+#include <vcl/window.hxx>
- #include <editeng/acorrcfg.hxx>
- #include <editeng/unolingu.hxx>
- #include <editeng/fontitem.hxx>
-@@ -419,11 +420,11 @@ void EditView::InsertText( const XubString& rStr, sal_Bool bSelect )
- 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 )
-@@ -920,7 +921,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 );
-@@ -930,7 +931,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 --git editeng/source/editeng/impedit.cxx editeng/source/editeng/impedit.cxx
-index dd38c4c..a6c4be7 100755
---- editeng/source/editeng/impedit.cxx
-+++ editeng/source/editeng/impedit.cxx
-@@ -993,7 +993,7 @@ Pair ImpEditView::Scroll( long ndX, long ndY, BYTE nRangeCheck )
- return Pair( nRealDiffX, nRealDiffY );
- }
-
--sal_Bool ImpEditView::PostKeyEvent( const KeyEvent& rKeyEvent )
-+sal_Bool ImpEditView::PostKeyEvent( const KeyEvent& rKeyEvent, Window* pFrameWin )
- {
- BOOL bDone = FALSE;
-
-@@ -1037,7 +1037,7 @@ sal_Bool ImpEditView::PostKeyEvent( const KeyEvent& rKeyEvent )
- }
-
- if( !bDone )
-- bDone = pEditEngine->PostKeyEvent( rKeyEvent, GetEditViewPtr() );
-+ bDone = pEditEngine->PostKeyEvent( rKeyEvent, GetEditViewPtr(), pFrameWin );
-
- return bDone;
- }
-diff --git editeng/source/editeng/impedit.hxx editeng/source/editeng/impedit.hxx
-index 9c425bc..02ccb76 100755
---- editeng/source/editeng/impedit.hxx
-+++ editeng/source/editeng/impedit.hxx
-@@ -91,6 +91,8 @@ class TextRanger;
- class SvKeyValueIterator;
- class SvxForbiddenCharactersTable;
- class SvtCTLOptions;
-+class Window;
-+
- #include <editeng/SpellPortions.hxx>
-
- #include <editeng/eedata.hxx>
-@@ -288,7 +290,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 );
-@@ -780,7 +782,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 --git editeng/source/editeng/impedit2.cxx editeng/source/editeng/impedit2.cxx
-index e0e780c..8308852 100755
---- editeng/source/editeng/impedit2.cxx
-+++ editeng/source/editeng/impedit2.cxx
-@@ -2576,7 +2576,8 @@ void ImpEditEngine::ImpRemoveParagraph( USHORT nPara )
- }
- }
-
--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
-@@ -2626,7 +2627,7 @@ EditPaM ImpEditEngine::AutoCorrect( const EditSelection& rCurSel, xub_Unicode c,
- 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 --git editeng/source/misc/acorrcfg.cxx editeng/source/misc/acorrcfg.cxx
-index 3bf26ec..7bf1a3b 100644
---- editeng/source/misc/acorrcfg.cxx
-+++ editeng/source/misc/acorrcfg.cxx
-@@ -118,9 +118,10 @@ Sequence<OUString> SvxBaseAutoCorrCfg::GetPropertyNames()
- "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++)
-@@ -220,6 +221,10 @@ void SvxBaseAutoCorrCfg::Load(sal_Bool bInit)
- rParent.pAutoCorrect->SetEndDoubleQuote(
- sal::static_int_cast< sal_Unicode >( nTemp ) );
- break;//"DoubleQuoteAtEnd"
-+ case 17:
-+ if(*(sal_Bool*)pValues[nProp].getValue())
-+ nFlags |= CorrectCapsLock;
-+ break;//"CorrectAccidentalCapsLock"
- }
- }
- }
-@@ -324,6 +329,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 --git editeng/source/misc/svxacorr.cxx editeng/source/misc/svxacorr.cxx
-index 78edae1..82ff177 100644
---- editeng/source/misc/svxacorr.cxx
-+++ editeng/source/misc/svxacorr.cxx
-@@ -60,6 +60,7 @@
- #include <editeng/escpitem.hxx>
- #include <editeng/svxacorr.hxx>
- #include <editeng/unolingu.hxx>
-+#include "vcl/window.hxx"
- #include <helpid.hrc>
- #include <comphelper/processfactory.hxx>
- #include <com/sun/star/xml/sax/InputSource.hpp>
-@@ -336,7 +337,8 @@ long SvxAutoCorrect::GetDefaultFlags()
- | SetINetAttr
- | ChgQuotes
- | SaveWordCplSttLst
-- | SaveWordWrdSttLst;
-+ | SaveWordWrdSttLst
-+ | CorrectCapsLock;
- LanguageType eLang = GetAppLang();
- switch( eLang )
- {
-@@ -1076,6 +1078,49 @@ BOOL SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc& rDoc,
-
- 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
-@@ -1189,7 +1234,7 @@ String SvxAutoCorrect::GetQuote( SvxAutoCorrDoc& rDoc, xub_StrLen nInsPos,
-
- ULONG SvxAutoCorrect::AutoCorrect( SvxAutoCorrDoc& rDoc, const String& rTxt,
- xub_StrLen nInsPos, sal_Unicode cChar,
-- BOOL bInsert )
-+ BOOL bInsert, Window* pFrameWin )
- {
- ULONG nRet = 0;
- bool bIsNextRun = bRunNext;
-@@ -1369,7 +1414,19 @@ ULONG SvxAutoCorrect::AutoCorrect( SvxAutoCorrDoc& rDoc, const String& rTxt,
- ;
- else
- {
-+ bool bLockKeyOn = pFrameWin && (pFrameWin->GetIndicatorState() & INDICATOR_CAPSLOCK);
-+
- nRet = 0;
-+ 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). Turn off the caps
-+ // lock afterwords.
-+ nRet |= CorrectCapsLock;
-+ pFrameWin->SimulateKeyPress( KEY_CAPSLOCK );
-+ }
-+
- // Grossbuchstabe am Satz-Anfang ??
- if( IsAutoCorrFlag( CptlSttSntnc ) &&
- FnCptlSttSntnc( rDoc, rTxt, TRUE, nCapLttrPos, nInsPos, eLang ) )
-diff --git editeng/source/outliner/outlvw.cxx editeng/source/outliner/outlvw.cxx
-index 4034b03..bf98d8b 100755
---- editeng/source/outliner/outlvw.cxx
-+++ editeng/source/outliner/outlvw.cxx
-@@ -103,7 +103,7 @@ void OutlinerView::Paint( const Rectangle& rRect )
- pEditView->Paint( rRect );
- }
-
--BOOL OutlinerView::PostKeyEvent( const KeyEvent& rKEvt )
-+BOOL OutlinerView::PostKeyEvent( const KeyEvent& rKEvt, Window* pFrameWin )
- {
- DBG_CHKTHIS( OutlinerView, 0 );
-
-@@ -268,7 +268,7 @@ BOOL OutlinerView::PostKeyEvent( const KeyEvent& rKEvt )
- }
- }
-
-- return bKeyProcessed ? TRUE : pEditView->PostKeyEvent( rKEvt );
-+ return bKeyProcessed ? TRUE : pEditView->PostKeyEvent( rKEvt, pFrameWin );
- }
-
-
-diff --git svx/source/svdraw/svdedxv.cxx svx/source/svdraw/svdedxv.cxx
-index 880c48e..f277e35 100644
---- svx/source/svdraw/svdedxv.cxx
-+++ svx/source/svdraw/svdedxv.cxx
-@@ -1162,7 +1162,7 @@ BOOL SdrObjEditView::KeyInput(const KeyEvent& rKEvt, Window* pWin)
- ShowItemBrowser();
- }
- #endif
-- if (pTextEditOutlinerView->PostKeyEvent(rKEvt))
-+ if (pTextEditOutlinerView->PostKeyEvent(rKEvt, pWin))
- {
- if( pMod /* && !pMod->IsChanged() */ )
- {
---
-1.7.0.1
-
diff --git a/patches/dev300/autocorrect-accidental-caps-lock-sw.diff b/patches/dev300/autocorrect-accidental-caps-lock-sw.diff
deleted file mode 100644
index 39887a6..0000000
--- a/patches/dev300/autocorrect-accidental-caps-lock-sw.diff
+++ /dev/null
@@ -1,20 +0,0 @@
----
- sw/source/core/edit/edws.cxx | 2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git sw/source/core/edit/edws.cxx sw/source/core/edit/edws.cxx
-index 3584929..0dd9fa3 100644
---- sw/source/core/edit/edws.cxx
-+++ sw/source/core/edit/edws.cxx
-@@ -344,7 +344,7 @@ void SwEditShell::AutoCorrect( SvxAutoCorrect& rACorr, sal_Bool bInsert,
- SwAutoCorrDoc aSwAutoCorrDoc( *this, *pCrsr, cChar );
- rACorr.AutoCorrect( aSwAutoCorrDoc,
- pTNd->GetTxt(), pCrsr->GetPoint()->nContent.GetIndex(),
-- cChar, bInsert );
-+ cChar, bInsert, GetWin() );
- if( cChar )
- SaveTblBoxCntnt( pCrsr->GetPoint() );
- EndAllAction();
---
-1.7.0.1
-
diff --git a/patches/dev300/autocorrect-accidental-caps-lock-vcl.diff b/patches/dev300/autocorrect-accidental-caps-lock-vcl.diff
deleted file mode 100644
index 71077ba..0000000
--- a/patches/dev300/autocorrect-accidental-caps-lock-vcl.diff
+++ /dev/null
@@ -1,464 +0,0 @@
----
- vcl/aqua/inc/salframe.h | 2 +
- vcl/aqua/source/window/salframe.cxx | 11 +++++
- vcl/inc/vcl/keycodes.hxx | 12 ++++++
- vcl/inc/vcl/salframe.hxx | 9 ++++
- vcl/inc/vcl/window.hxx | 16 +++++++
- vcl/os2/inc/salframe.h | 2 +
- vcl/os2/source/window/salframe.cxx | 13 ++++++
- vcl/source/window/window.cxx | 10 +++++
- vcl/unx/gtk/window/gtkframe.cxx | 12 ++++++
- vcl/unx/headless/svpframe.cxx | 11 +++++
- vcl/unx/headless/svpframe.hxx | 2 +
- vcl/unx/inc/plugins/gtk/gtkframe.hxx | 4 ++
- vcl/unx/inc/saldisp.hxx | 2 +
- vcl/unx/inc/salframe.h | 2 +
- vcl/unx/source/app/saldisp.cxx | 73 +++++++++++++++++++++++++++++++++-
- vcl/unx/source/window/salframe.cxx | 12 ++++++
- vcl/win/inc/salframe.h | 2 +
- vcl/win/source/window/salframe.cxx | 35 ++++++++++++++++
- 18 files changed, 229 insertions(+), 1 deletions(-)
-
-diff --git vcl/aqua/inc/salframe.h vcl/aqua/inc/salframe.h
-index af8811a..731b04e 100644
---- vcl/aqua/inc/salframe.h
-+++ vcl/aqua/inc/salframe.h
-@@ -152,6 +152,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 --git vcl/aqua/source/window/salframe.cxx vcl/aqua/source/window/salframe.cxx
-index 9406e78..6fb4d2e 100644
---- vcl/aqua/source/window/salframe.cxx
-+++ vcl/aqua/source/window/salframe.cxx
-@@ -1436,6 +1436,17 @@ SalPointerState AquaSalFrame::GetPointerState()
- 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
-diff --git vcl/inc/vcl/keycodes.hxx vcl/inc/vcl/keycodes.hxx
-index 8316ec7..7275947 100644
---- vcl/inc/vcl/keycodes.hxx
-+++ vcl/inc/vcl/keycodes.hxx
-@@ -158,6 +158,10 @@
- #define KEY_BRACKETLEFT ((USHORT)::com::sun::star::awt::Key::BRACKETLEFT)
- #define KEY_BRACKETRIGHT ((USHORT)::com::sun::star::awt::Key::BRACKETRIGHT)
-
-+#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
-@@ -190,4 +194,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 --git vcl/inc/vcl/salframe.hxx vcl/inc/vcl/salframe.hxx
-index 37b0f5f..4e40b3e 100644
---- vcl/inc/vcl/salframe.hxx
-+++ vcl/inc/vcl/salframe.hxx
-@@ -250,6 +250,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 --git vcl/inc/vcl/window.hxx vcl/inc/vcl/window.hxx
-index 96588a8..b7b5ad4 100644
---- vcl/inc/vcl/window.hxx
-+++ vcl/inc/vcl/window.hxx
-@@ -1101,6 +1101,22 @@ public:
- */
- 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;
-+
- virtual XubString GetSurroundingText() const;
- virtual Selection GetSurroundingTextSelection() const;
- };
-diff --git vcl/os2/inc/salframe.h vcl/os2/inc/salframe.h
-index 9c51ae4..5461c3c 100644
---- vcl/os2/inc/salframe.h
-+++ vcl/os2/inc/salframe.h
-@@ -152,6 +152,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 --git vcl/os2/source/window/salframe.cxx vcl/os2/source/window/salframe.cxx
-index 6217043..9cee199 100644
---- vcl/os2/source/window/salframe.cxx
-+++ vcl/os2/source/window/salframe.cxx
-@@ -2354,6 +2354,19 @@ SalFrame::SalPointerState Os2SalFrame::GetPointerState()
-
- // -----------------------------------------------------------------------
-
-+SalFrame::SalIndicatorState Os2SalFrame::GetIndicatorState()
-+{
-+ SalIndicatorState aState;
-+ aState.mnState = 0;
-+ return aState;
-+}
-+
-+void Os2SalFrame::SimulateKeyPress( USHORT /*nKeyCode*/ )
-+{
-+}
-+
-+// -----------------------------------------------------------------------
-+
- void Os2SalFrame::SetBackgroundBitmap( SalBitmap* )
- {
- }
-diff --git vcl/source/window/window.cxx vcl/source/window/window.cxx
-index a231e12..7aa3480 100644
---- vcl/source/window/window.cxx
-+++ vcl/source/window/window.cxx
-@@ -4790,6 +4790,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 --git vcl/unx/gtk/window/gtkframe.cxx vcl/unx/gtk/window/gtkframe.cxx
-index df15dd7..b2b7018 100644
---- vcl/unx/gtk/window/gtkframe.cxx
-+++ vcl/unx/gtk/window/gtkframe.cxx
-@@ -2271,6 +2271,18 @@ SalFrame::SalPointerState GtkSalFrame::GetPointerState()
- 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 --git vcl/unx/headless/svpframe.cxx vcl/unx/headless/svpframe.cxx
-index 7f30417..8e95917 100644
---- vcl/unx/headless/svpframe.cxx
-+++ vcl/unx/headless/svpframe.cxx
-@@ -415,6 +415,17 @@ SalFrame::SalPointerState SvpSalFrame::GetPointerState()
- 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 --git vcl/unx/headless/svpframe.hxx vcl/unx/headless/svpframe.hxx
-index 9e5fb60..957224d 100644
---- vcl/unx/headless/svpframe.hxx
-+++ vcl/unx/headless/svpframe.hxx
-@@ -112,6 +112,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 --git vcl/unx/inc/plugins/gtk/gtkframe.hxx vcl/unx/inc/plugins/gtk/gtkframe.hxx
-index 21c1ddd..1da7d0f 100644
---- vcl/unx/inc/plugins/gtk/gtkframe.hxx
-+++ vcl/unx/inc/plugins/gtk/gtkframe.hxx
-@@ -367,6 +367,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 --git vcl/unx/inc/saldisp.hxx vcl/unx/inc/saldisp.hxx
-index 58f3302..4f4185a 100644
---- vcl/unx/inc/saldisp.hxx
-+++ vcl/unx/inc/saldisp.hxx
-@@ -445,6 +445,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 --git vcl/unx/inc/salframe.h vcl/unx/inc/salframe.h
-index 49e7b64..f004a27 100644
---- vcl/unx/inc/salframe.h
-+++ vcl/unx/inc/salframe.h
-@@ -252,6 +252,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 --git vcl/unx/source/app/saldisp.cxx vcl/unx/source/app/saldisp.cxx
-index fbb00da..0ae370e 100644
---- vcl/unx/source/app/saldisp.cxx
-+++ vcl/unx/source/app/saldisp.cxx
-@@ -54,7 +54,7 @@
- #define XK_KOREAN
- #endif
- #include <X11/keysym.h>
--
-+#include <X11/XKBlib.h>
- #include <X11/Xatom.h>
-
- #ifdef USE_XINERAMA
-@@ -1039,6 +1039,77 @@ void SalDisplay::Beep() const
-
- // Keyboard
- // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-+
-+namespace {
-+
-+bool InitXkb(Display* dpy)
-+{
-+ int nOpcode, nEvent, nError;
-+ int nXkbMajor = XkbMajorVersion;
-+ int nXkbMinor = XkbMinorVersion;
-+
-+ if (!XkbLibraryVersion(&nXkbMajor, &nXkbMinor))
-+ return false;
-+
-+ return XkbQueryExtension(
-+ dpy, &nOpcode, &nEvent, &nError, &nXkbMajor, &nXkbMinor);
-+}
-+
-+unsigned int GetKeySymMask(Display* dpy, KeySym nKeySym)
-+{
-+ int nMask = 0;
-+ XModifierKeymap* pXmkMap = XGetModifierMapping(dpy);
-+ KeyCode nKeyCode = XKeysymToKeycode(dpy, nKeySym);
-+ if (nKeyCode == NoSymbol)
-+ return 0;
-+
-+ for (int i = 0; i < 8; ++i)
-+ {
-+ KeyCode nThisKeyCode = pXmkMap->modifiermap[pXmkMap->max_keypermod*i];
-+ if (nThisKeyCode == nKeyCode)
-+ nMask = 1 << i;
-+ }
-+ XFreeModifiermap(pXmkMap);
-+ return nMask;
-+}
-+
-+}
-+
-+void SalDisplay::SimulateKeyPress( USHORT nKeyCode )
-+{
-+ if (nKeyCode == KEY_CAPSLOCK)
-+ {
-+ Display* dpy = GetDisplay();
-+ if (!InitXkb(dpy))
-+ return;
-+
-+ unsigned int nMask = GetKeySymMask(dpy, XK_Caps_Lock);
-+ XkbStateRec xkbState;
-+ XkbGetState(dpy, XkbUseCoreKbd, &xkbState);
-+ unsigned int nCapsLockState = xkbState.locked_mods & nMask;
-+ if (nCapsLockState)
-+ XkbLockModifiers (dpy, XkbUseCoreKbd, nMask, 0);
-+ else
-+ XkbLockModifiers (dpy, XkbUseCoreKbd, nMask, nMask);
-+ }
-+}
-+
-+USHORT SalDisplay::GetIndicatorState() const
-+{
-+ unsigned int _state = 0;
-+ 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 --git vcl/unx/source/window/salframe.cxx vcl/unx/source/window/salframe.cxx
-index efcf323..b292ec2 100644
---- vcl/unx/source/window/salframe.cxx
-+++ vcl/unx/source/window/salframe.cxx
-@@ -2851,6 +2851,18 @@ SalFrame::SalPointerState X11SalFrame::GetPointerState()
- 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 --git vcl/win/inc/salframe.h vcl/win/inc/salframe.h
-index e846238..676a054 100644
---- vcl/win/inc/salframe.h
-+++ vcl/win/inc/salframe.h
-@@ -135,6 +135,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 --git vcl/win/source/window/salframe.cxx vcl/win/source/window/salframe.cxx
-index c87f49c..508f9b1 100644
---- vcl/win/source/window/salframe.cxx
-+++ vcl/win/source/window/salframe.cxx
-@@ -3200,6 +3200,41 @@ SalFrame::SalPointerState WinSalFrame::GetPointerState()
-
- // -----------------------------------------------------------------------
-
-+SalFrame::SalIndicatorState WinSalFrame::GetIndicatorState()
-+{
-+ SalIndicatorState aState;
-+ aState.mnState = 0;
-+ if (::GetKeyState(VK_CAPITAL))
-+ aState.mnState |= INDICATOR_CAPSLOCK;
-+
-+ if (::GetKeyState(VK_NUMLOCK))
-+ aState.mnState |= INDICATOR_NUMLOCK;
-+
-+ if (::GetKeyState(VK_SCROLL))
-+ aState.mnState |= INDICATOR_SCROLLLOCK;
-+
-+ return aState;
-+}
-+
-+void WinSalFrame::SimulateKeyPress( USHORT nKeyCode )
-+{
-+ BYTE nVKey = 0;
-+ switch (nKeyCode)
-+ {
-+ case KEY_CAPSLOCK:
-+ nVKey = VK_CAPITAL;
-+ break;
-+ }
-+
-+ if (nVKey > 0 && nVKey < 255)
-+ {
-+ ::keybd_event(nVKey, 0x45, KEYEVENTF_EXTENDEDKEY, 0);
-+ ::keybd_event(nVKey, 0x45, KEYEVENTF_EXTENDEDKEY|KEYEVENTF_KEYUP, 0);
-+ }
-+}
-+
-+// -----------------------------------------------------------------------
-+
- void WinSalFrame::SetBackgroundBitmap( SalBitmap* )
- {
- }
---
-1.7.0.1
-
More information about the ooo-build-commit
mailing list