summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/edit/acorrect.cxx6
-rw-r--r--sw/source/core/edit/autofmt.cxx6
-rw-r--r--sw/source/core/inc/acorrect.hxx7
-rw-r--r--sw/source/uibase/docvw/edtwin.cxx26
-rw-r--r--sw/source/uibase/shells/textsh.cxx4
-rw-r--r--sw/source/uibase/wrtsh/wrtsh1.cxx6
6 files changed, 29 insertions, 26 deletions
diff --git a/sw/source/core/edit/acorrect.cxx b/sw/source/core/edit/acorrect.cxx
index 709db86d2b76..e8f4a72e9e9b 100644
--- a/sw/source/core/edit/acorrect.cxx
+++ b/sw/source/core/edit/acorrect.cxx
@@ -410,7 +410,7 @@ bool SwAutoCorrDoc::ChgAutoCorrWord( sal_Int32& rSttPos, sal_Int32 nEndPos,
// - FnCapitalStartSentence
// after the exchange of characters. Then the words, if necessary, can be inserted
// into the exception list.
-void SwAutoCorrDoc::SaveCpltSttWord( sal_uLong nFlag, sal_Int32 nPos,
+void SwAutoCorrDoc::SaveCpltSttWord( ACFlags nFlag, sal_Int32 nPos,
const OUString& rExceptWord,
sal_Unicode cChar )
{
@@ -443,9 +443,9 @@ void SwAutoCorrExceptWord::CheckChar( const SwPosition& rPos, sal_Unicode cChr )
SvxAutoCorrect* pACorr = SvxAutoCorrCfg::Get().GetAutoCorrect();
// then add to the list:
- if (CapitalStartWord & m_nFlags)
+ if (ACFlags::CapitalStartWord & m_nFlags)
pACorr->AddWrtSttException(m_sWord, m_eLanguage);
- else if (CapitalStartSentence & m_nFlags)
+ else if (ACFlags::CapitalStartSentence & m_nFlags)
pACorr->AddCplSttException(m_sWord, m_eLanguage);
}
}
diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx
index 5674124a266e..f80c39a0017b 100644
--- a/sw/source/core/edit/autofmt.cxx
+++ b/sw/source/core/edit/autofmt.cxx
@@ -1802,9 +1802,9 @@ void SwAutoFormat::BuildHeadLine( sal_uInt16 nLvl )
void SwAutoFormat::AutoCorrect( sal_Int32 nPos )
{
SvxAutoCorrect* pATst = SvxAutoCorrCfg::Get().GetAutoCorrect();
- long aSvxFlags = pATst->GetFlags( );
- bool bReplaceQuote = ( aSvxFlags & ChgQuotes ) > 0;
- bool bReplaceSglQuote = ( aSvxFlags & ChgSglQuotes ) > 0;
+ ACFlags aSvxFlags = pATst->GetFlags( );
+ bool bReplaceQuote( aSvxFlags & ACFlags::ChgQuotes );
+ bool bReplaceSglQuote( aSvxFlags & ACFlags::ChgSglQuotes );
if( m_aFlags.bAFormatByInput ||
(!m_aFlags.bAutoCorrect && !bReplaceQuote && !bReplaceSglQuote &&
diff --git a/sw/source/core/inc/acorrect.hxx b/sw/source/core/inc/acorrect.hxx
index caae1184e99f..5cfcdb88425d 100644
--- a/sw/source/core/inc/acorrect.hxx
+++ b/sw/source/core/inc/acorrect.hxx
@@ -83,7 +83,7 @@ public:
// - FnCapitalStartWord and
// - FnCapitalStartSentence.
// Afterwards the words can be added into exception list if needed.
- virtual void SaveCpltSttWord( sal_uLong nFlag, sal_Int32 nPos,
+ virtual void SaveCpltSttWord( ACFlags nFlag, sal_Int32 nPos,
const OUString& rExceptWord, sal_Unicode cChar ) override;
virtual LanguageType GetLanguage( sal_Int32 nPos ) const override;
};
@@ -91,14 +91,15 @@ public:
class SwAutoCorrExceptWord
{
OUString m_sWord;
- sal_uLong m_nFlags, m_nNode;
+ ACFlags m_nFlags;
+ sal_uLong m_nNode;
sal_Int32 m_nContent;
sal_Unicode m_cChar;
LanguageType m_eLanguage;
bool m_bDeleted;
public:
- SwAutoCorrExceptWord(sal_uLong nAFlags, sal_uLong nNd, sal_Int32 nContent,
+ SwAutoCorrExceptWord(ACFlags nAFlags, sal_uLong nNd, sal_Int32 nContent,
const OUString& rWord, sal_Unicode cChr,
LanguageType eLang)
: m_sWord(rWord), m_nFlags(nAFlags), m_nNode(nNd), m_nContent(nContent),
diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx
index a5a91f83f04e..5e509ee18ec3 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -2366,10 +2366,10 @@ KEYINPUT_CHECKTABLE:
const bool bIsAutoCorrectChar = SvxAutoCorrect::IsAutoCorrectChar( aCh );
if( !aKeyEvent.GetRepeat() && pACorr && ( bIsAutoCorrectChar || rSh.IsNbspRunNext() ) &&
pACfg->IsAutoFormatByInput() &&
- (( pACorr->IsAutoCorrFlag( ChgWeightUnderl ) &&
+ (( pACorr->IsAutoCorrFlag( ACFlags::ChgWeightUnderl ) &&
( '*' == aCh || '_' == aCh ) ) ||
- ( pACorr->IsAutoCorrFlag( ChgQuotes ) && ('\"' == aCh ))||
- ( pACorr->IsAutoCorrFlag( ChgSglQuotes ) && ( '\'' == aCh))))
+ ( pACorr->IsAutoCorrFlag( ACFlags::ChgQuotes ) && ('\"' == aCh ))||
+ ( pACorr->IsAutoCorrFlag( ACFlags::ChgSglQuotes ) && ( '\'' == aCh))))
{
FlushInBuffer();
rSh.AutoCorrect( *pACorr, aCh );
@@ -2378,10 +2378,10 @@ KEYINPUT_CHECKTABLE:
}
else if( !aKeyEvent.GetRepeat() && pACorr && ( bIsAutoCorrectChar || rSh.IsNbspRunNext() ) &&
pACfg->IsAutoFormatByInput() &&
- pACorr->IsAutoCorrFlag( CapitalStartSentence | CapitalStartWord |
- ChgOrdinalNumber | AddNonBrkSpace |
- ChgToEnEmDash | SetINetAttr |
- Autocorrect ) &&
+ pACorr->IsAutoCorrFlag( ACFlags::CapitalStartSentence | ACFlags::CapitalStartWord |
+ ACFlags::ChgOrdinalNumber | ACFlags::AddNonBrkSpace |
+ ACFlags::ChgToEnEmDash | ACFlags::SetINetAttr |
+ ACFlags::Autocorrect ) &&
'\"' != aCh && '\'' != aCh && '*' != aCh && '_' != aCh
)
{
@@ -2412,10 +2412,10 @@ KEYINPUT_CHECKTABLE:
case SwKeyState::CheckAutoCorrect:
{
if( pACorr && pACfg->IsAutoFormatByInput() &&
- pACorr->IsAutoCorrFlag( CapitalStartSentence | CapitalStartWord |
- ChgOrdinalNumber |
- ChgToEnEmDash | SetINetAttr |
- Autocorrect ) &&
+ pACorr->IsAutoCorrFlag( ACFlags::CapitalStartSentence | ACFlags::CapitalStartWord |
+ ACFlags::ChgOrdinalNumber |
+ ACFlags::ChgToEnEmDash | ACFlags::SetINetAttr |
+ ACFlags::Autocorrect ) &&
!rSh.HasReadonlySel() )
{
FlushInBuffer();
@@ -5293,8 +5293,8 @@ void SwEditWin::Command( const CommandEvent& rCEvt )
SvxAutoCorrCfg& rACfg = SvxAutoCorrCfg::Get();
SvxAutoCorrect* pACorr = rACfg.GetAutoCorrect();
if(pACorr &&
- (( pACorr->IsAutoCorrFlag( ChgQuotes ) && ('\"' == aCh ))||
- ( pACorr->IsAutoCorrFlag( ChgSglQuotes ) && ( '\'' == aCh))))
+ (( pACorr->IsAutoCorrFlag( ACFlags::ChgQuotes ) && ('\"' == aCh ))||
+ ( pACorr->IsAutoCorrFlag( ACFlags::ChgSglQuotes ) && ( '\'' == aCh))))
{
rSh.DelLeft();
rSh.AutoCorrect( *pACorr, aCh );
diff --git a/sw/source/uibase/shells/textsh.cxx b/sw/source/uibase/shells/textsh.cxx
index 357d0483184e..b5dc483ebad5 100644
--- a/sw/source/uibase/shells/textsh.cxx
+++ b/sw/source/uibase/shells/textsh.cxx
@@ -161,7 +161,9 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
SvxAutoCorrect* pACorr = rACfg.GetAutoCorrect();
if( pACorr && rACfg.IsAutoFormatByInput()
&& pACorr->IsAutoCorrFlag(
- CapitalStartSentence | CapitalStartWord | AddNonBrkSpace | ChgOrdinalNumber | ChgToEnEmDash | SetINetAttr | Autocorrect ) )
+ ACFlags::CapitalStartSentence | ACFlags::CapitalStartWord |
+ ACFlags::AddNonBrkSpace | ACFlags::ChgOrdinalNumber |
+ ACFlags::ChgToEnEmDash | ACFlags::SetINetAttr | ACFlags::Autocorrect ) )
{
rSh.AutoCorrect( *pACorr, cIns );
}
diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx b/sw/source/uibase/wrtsh/wrtsh1.cxx
index 2ed8db43218f..720308feb756 100644
--- a/sw/source/uibase/wrtsh/wrtsh1.cxx
+++ b/sw/source/uibase/wrtsh/wrtsh1.cxx
@@ -135,9 +135,9 @@ using namespace com::sun::star;
static SvxAutoCorrect* lcl_IsAutoCorr()
{
SvxAutoCorrect* pACorr = SvxAutoCorrCfg::Get().GetAutoCorrect();
- if( pACorr && !pACorr->IsAutoCorrFlag( CapitalStartSentence | CapitalStartWord |
- AddNonBrkSpace | ChgOrdinalNumber |
- ChgToEnEmDash | SetINetAttr | Autocorrect ))
+ if( pACorr && !pACorr->IsAutoCorrFlag( ACFlags::CapitalStartSentence | ACFlags::CapitalStartWord |
+ ACFlags::AddNonBrkSpace | ACFlags::ChgOrdinalNumber |
+ ACFlags::ChgToEnEmDash | ACFlags::SetINetAttr | ACFlags::Autocorrect ))
pACorr = nullptr;
return pACorr;
}