diff options
author | Eike Rathke <erack@redhat.com> | 2017-08-23 17:44:16 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2017-08-24 00:30:37 +0200 |
commit | 06d14411a447cd798d1f0678a3c5e06f5278a1cb (patch) | |
tree | 37fd5ccedaff3491bb8d17a1072d60371d3801a0 /sw/inc/editsh.hxx | |
parent | 5a9b20c8bd0c2d7065cde37ebef330aaee0056e2 (diff) |
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.
Change-Id: I79a26d2ba44cc40771979a78b686c89f0c80b412
Reviewed-on: https://gerrit.libreoffice.org/41475
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'sw/inc/editsh.hxx')
-rw-r--r-- | sw/inc/editsh.hxx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sw/inc/editsh.hxx b/sw/inc/editsh.hxx index df4d0de6e148..411c8eed3921 100644 --- a/sw/inc/editsh.hxx +++ b/sw/inc/editsh.hxx @@ -947,6 +947,8 @@ public: character attribute dialog. */ sal_uInt16 GetScalingOfSelectedText() const; + bool IsNbspRunNext() const { return m_bNbspRunNext; } + /// Ctor/Dtor. SwEditShell( SwDoc&, vcl::Window*, const SwViewOption *pOpt ); @@ -957,6 +959,16 @@ public: private: SwEditShell(const SwEditShell &) = delete; const SwEditShell &operator=(const SwEditShell &) = delete; + + /* TODO: this flag may have to be invalidated / reset to false at various + * places if it was true and the edit cursor position changes. It's somehow + * overkill though because it can only be true if a NO-BREAK SPACE was + * inserted by the last DoAutoCorrect() call (in French language), any + * subsequent call will reset it anyway and just if the cursor is + * positioned behind "x :" and the next character inserted is not a space + * the existing nb-space will be removed. Bear this in mind if that problem + * arises. */ + bool m_bNbspRunNext; ///< NO-BREAK SPACE state flag passed to and maintained by SvxAutoCorrect::DoAutoCorrect() }; inline const sfx2::LinkManager& SwEditShell::GetLinkManager() const |