diff options
author | Eike Rathke <erack@redhat.com> | 2017-08-23 17:44:16 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-09-05 16:24:11 +0200 |
commit | c5fcab1ec72be1cf2868215ee71d3cb2668498c1 (patch) | |
tree | 8f3d3875bd402ec9f397ae9803db9a75dbb54301 /include | |
parent | 02b95a0e8191fc560637b2fa3a62bca0bd51b9c4 (diff) |
Resolves: tdf#108795 merge table EditEngine language attributes to input line
... and change SvxAutoCorrect to be stateless again to make that work.
This is a combination of 3 commits.
Related: tdf#108795 a shared SvxAutoCorrect instance can not be stateful
An SvxAutoCorrect instance is shared via SvxAutoCorrCfg::Get().GetAutoCorrect().
Since commit 284eb106767d094fc5c547efd6c11cc390e3538a and following the
SvxAutoCorrect::bRunNext/HasRunNext() introduced a state whether a previously
inserted NO-BREAK SPACE should be removed again, depending on the next
character input. That does not work, for example, if
SvxAutoCorrect::DoAutoCorrect() is called from two different EditEngine
instances, like it is the case in the Calc input line and cell which are
synchronized; or any other two or more instances for that matter. The caller
has to pass and remember a flag that is maintained by SvxAutoCorrect.
Reviewed-on: https://gerrit.libreoffice.org/41475
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins <ci@libreoffice.org>
(cherry picked from commit 06d14411a447cd798d1f0678a3c5e06f5278a1cb)
Backported.
Related: tdf#108795 never use an unresolved LANGUAGE_SYSTEM in SvxAutoCorrect
Substitute with the current work locale, using MsLangId::getSystemLanguage()
instead was also wrong.
Reviewed-on: https://gerrit.libreoffice.org/41476
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins <ci@libreoffice.org>
(cherry picked from commit 311be7d70146e4963e4dfd1f39d6c71d45d241ca)
Resolves: tdf#108795 merge table EditEngine language attributes to input line
... when editing there, so the SvxAutoCorrect behaviour is synchronized.
Depends on commit 06d14411a447cd798d1f0678a3c5e06f5278a1cb that disentangles
the stateful SvxAutoCorrect instance.
Reviewed-on: https://gerrit.libreoffice.org/41521
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
(cherry picked from commit d31a8263d564ebd7886f6debdf36cedd031915ea)
55db3bc1f76329320afc1f366d7426a8c2f66fb2
c6aac1f2acc36b500144be50a20a4784a3ba62dc
Change-Id: I79a26d2ba44cc40771979a78b686c89f0c80b412
Reviewed-on: https://gerrit.libreoffice.org/41525
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'include')
-rw-r--r-- | include/editeng/svxacorr.hxx | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/include/editeng/svxacorr.hxx b/include/editeng/svxacorr.hxx index 1cc14c0214ae..30ce54016545 100644 --- a/include/editeng/svxacorr.hxx +++ b/include/editeng/svxacorr.hxx @@ -236,8 +236,6 @@ class EDITENG_DLLPUBLIC SvxAutoCorrect std::map<LanguageTag, sal_Int64> aLastFileTable; std::unique_ptr<CharClass> pCharClass; - bool bRunNext; - LanguageType eCharClassLang; long nFlags; @@ -274,13 +272,19 @@ public: SvxAutoCorrect( const SvxAutoCorrect& ); virtual ~SvxAutoCorrect(); - // Execute an AutoCorrect. - // Returns what has been executed, according to the above flags + /** Execute an AutoCorrect. + Returns what has been executed, according to the above auto correct flags. + @param io_bNbspRunNext + Remembers if a NO-BREAK SPACE was added (eg. in "fr" language) + (set to <TRUE/>) at the last character input that may have to + be removed again depending on what character is following. + */ // FIXME: this has the horrible flaw that the rTxt must be a reference // to the actual SwTxtNode/EditNode string because it inserts the character // in rDoc and expects that to side-effect rTxt void DoAutoCorrect( SvxAutoCorrDoc& rDoc, const OUString& rTxt, - sal_Int32 nPos, sal_Unicode cInsChar, bool bInsert, vcl::Window* pFrameWin = nullptr ); + sal_Int32 nPos, sal_Unicode cInsChar, bool bInsert, bool& io_bNbspRunNext, + vcl::Window* pFrameWin = nullptr ); // Return for the autotext expansion the previous word, // AutoCorrect - corresponding algorithm @@ -383,7 +387,7 @@ public: LanguageType eLang ); bool FnAddNonBrkSpace( SvxAutoCorrDoc&, const OUString&, sal_Int32 nEndPos, - LanguageType eLang ); + LanguageType eLang, bool& io_bNbspRunNext ); bool FnSetINetAttr( SvxAutoCorrDoc&, const OUString&, sal_Int32 nSttPos, sal_Int32 nEndPos, LanguageType eLang ); @@ -396,8 +400,6 @@ public: sal_Int32 nSttPos, sal_Int32 nEndPos, LanguageType eLang ); - bool HasRunNext() { return bRunNext; } - static long GetDefaultFlags(); // returns sal_True for characters where the function |