[ooo-build-commit] .: cui/source

Kohei Yoshida kohei at kemper.freedesktop.org
Wed Sep 29 13:23:16 PDT 2010


 cui/source/inc/autocdlg.hxx      |    2 ++
 cui/source/tabpages/autocdlg.cxx |   13 ++++++++++++-
 cui/source/tabpages/autocdlg.hrc |    1 +
 cui/source/tabpages/autocdlg.src |    4 ++++
 4 files changed, 19 insertions(+), 1 deletion(-)

New commits:
commit cb1d46258d7e2af041d8ac982cd8045d3fcd41e9
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Wed Sep 29 16:19:57 2010 -0400

    Ported autocorrect-accidental-caps-lock-svx.diff from ooo-build.

diff --git a/cui/source/inc/autocdlg.hxx b/cui/source/inc/autocdlg.hxx
index 5b3b41e..848b2eb 100644
--- a/cui/source/inc/autocdlg.hxx
+++ b/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 a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx
index d274cb0..afb63d2 100644
--- a/cui/source/tabpages/autocdlg.cxx
+++ b/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 a/cui/source/tabpages/autocdlg.hrc b/cui/source/tabpages/autocdlg.hrc
index d95dcf5..e63684c 100644
--- a/cui/source/tabpages/autocdlg.hrc
+++ b/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 a/cui/source/tabpages/autocdlg.src b/cui/source/tabpages/autocdlg.src
index eea4e59..2fbbd21 100644
--- a/cui/source/tabpages/autocdlg.src
+++ b/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" ; \
     };
 
 /**************************************************************************/


More information about the ooo-build-commit mailing list