summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kyoshida@novell.com>2010-09-29 16:19:57 -0400
committerKohei Yoshida <kyoshida@novell.com>2010-09-29 16:19:57 -0400
commitcb1d46258d7e2af041d8ac982cd8045d3fcd41e9 (patch)
treec823b0c1c2b59412ab6105bccab4a5f13911bf5b
parentc43ac455fe23c130a394c3a561e09697e08752e1 (diff)
Ported autocorrect-accidental-caps-lock-svx.diff from ooo-build.linux-build-fridrich-20100930
-rw-r--r--cui/source/inc/autocdlg.hxx2
-rw-r--r--cui/source/tabpages/autocdlg.cxx13
-rw-r--r--cui/source/tabpages/autocdlg.hrc1
-rw-r--r--cui/source/tabpages/autocdlg.src4
4 files changed, 19 insertions, 1 deletions
diff --git a/cui/source/inc/autocdlg.hxx b/cui/source/inc/autocdlg.hxx
index 5b3b41ee8..848b2eb92 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 d274cb016..afb63d2c4 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 d95dcf5e9..e63684c96 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 eea4e599f..2fbbd2177 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" ; \
};
/**************************************************************************/