summaryrefslogtreecommitdiff
path: root/cui/source/tabpages/autocdlg.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'cui/source/tabpages/autocdlg.cxx')
-rw-r--r--cui/source/tabpages/autocdlg.cxx31
1 files changed, 18 insertions, 13 deletions
diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx
index 0ee3c38c1e1d..aaea68cfa1ef 100644
--- a/cui/source/tabpages/autocdlg.cxx
+++ b/cui/source/tabpages/autocdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -224,7 +225,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 +270,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 +310,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 +320,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 +451,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 +479,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 +613,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 +729,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 +748,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 );
@@ -1013,10 +1025,7 @@ OfaAutocorrReplacePage::OfaAutocorrReplacePage( Window* pParent,
::com::sun::star::lang::Locale aLcl( SvxCreateLocale(eLastDialogLanguage ));
pCompareClass = new CollatorWrapper( GetProcessFact() );
- pCompareCaseClass = new CollatorWrapper( GetProcessFact() );
- pCompareClass->loadDefaultCollator( aLcl, ::com::sun::star::i18n::
- CollatorOptions::CollatorOptions_IGNORE_CASE );
- pCompareCaseClass->loadDefaultCollator( aLcl, 0 );
+ pCompareClass->loadDefaultCollator( aLcl, 0 );
pCharClass = new CharClass( aLcl );
static long nTabs[] = { 2 /* Tab-Count */, 1, 61 };
@@ -1046,7 +1055,6 @@ OfaAutocorrReplacePage::~OfaAutocorrReplacePage()
delete pFormatText;
lcl_ClearTable(aDoubleStringTable);
delete pCompareClass;
- delete pCompareCaseClass;
delete pCharClass;
}
/*-----------------14.10.96 15.58-------------------
@@ -1111,7 +1119,7 @@ BOOL OfaAutocorrReplacePage::FillItemSet( SfxItemSet& )
nLastPos = nPos - 1;
bFound = TRUE;
if( !(pWordPtr->IsTextOnly() == (0 == pDouble->pUserData)
- && 0 == pCompareCaseClass->compareString(
+ && 0 == pCompareClass->compareString(
pWordPtr->GetLong(), pDouble->sLong ) ) )
{
pAutoCorrect->PutText(sEntry, pDouble->sLong, eCurLang);
@@ -1174,7 +1182,7 @@ BOOL OfaAutocorrReplacePage::FillItemSet( SfxItemSet& )
bFound = TRUE;
String sLong = aReplaceTLB.GetEntryText(pEntry, 1);
if( !(pWordPtr->IsTextOnly() == (0 == pEntry->GetUserData())
- && 0 == pCompareCaseClass->compareString(
+ && 0 == pCompareClass->compareString(
pWordPtr->GetLong(), sLong )))
{
pAutoCorrect->PutText(sEntry, sLong, eLang);
@@ -1343,15 +1351,11 @@ void OfaAutocorrReplacePage::SetLanguage(LanguageType eSet)
RefillReplaceBox(FALSE, eLang, eSet);
eLastDialogLanguage = eSet;
delete pCompareClass;
- delete pCompareCaseClass;
delete pCharClass;
::com::sun::star::lang::Locale aLcl( SvxCreateLocale(eLastDialogLanguage ));
pCompareClass = new CollatorWrapper( GetProcessFact() );
- pCompareCaseClass = new CollatorWrapper( GetProcessFact() );
- pCompareClass->loadDefaultCollator( aLcl, ::com::sun::star::i18n::
- CollatorOptions::CollatorOptions_IGNORE_CASE );
- pCompareCaseClass->loadDefaultCollator( aLcl, 0 );
+ pCompareClass->loadDefaultCollator( aLcl, 0 );
pCharClass = new CharClass( aLcl );
ModifyHdl(&aShortED);
}
@@ -2865,3 +2869,4 @@ void OfaSmartTagOptionsTabPage::ActivatePage( const SfxItemSet& )
((OfaAutoCorrDlg*)GetTabDialog())->EnableLanguage( FALSE );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */