summaryrefslogtreecommitdiff
path: root/dbaccess/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-08-18 21:09:18 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-08-19 10:12:38 +0200
commit6724040e61c1efbee0b1456e3480b1e7b0827732 (patch)
tree9f64aa59dd59b0644e3bdb0bc2ace67c8a3418ef /dbaccess/source
parentcee0a2a93e2956e1a29019ef3ca92d4dd5d69c1f (diff)
don't include syntax highlighting in undo/redo
Change-Id: I7d7560fe94a7c9748ddd1a5e5584ef3e4b1efea2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100959 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'dbaccess/source')
-rw-r--r--dbaccess/source/ui/control/sqledit.cxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/dbaccess/source/ui/control/sqledit.cxx b/dbaccess/source/ui/control/sqledit.cxx
index 5abf5e228f7c..9790cdab297d 100644
--- a/dbaccess/source/ui/control/sqledit.cxx
+++ b/dbaccess/source/ui/control/sqledit.cxx
@@ -201,6 +201,10 @@ void SQLEditView::UpdateData()
{
m_bInUpdate = true;
EditEngine& rEditEngine = GetEditEngine();
+
+ bool bUndoEnabled = rEditEngine.IsUndoEnabled();
+ rEditEngine.EnableUndo(false);
+
// syntax highlighting
bool bOrigModified = rEditEngine.IsModified();
for (sal_Int32 nLine=0; nLine < rEditEngine.GetParagraphCount(); ++nLine)
@@ -226,6 +230,8 @@ void SQLEditView::UpdateData()
rEditEngine.ClearModifyFlag();
m_bInUpdate = false;
+ rEditEngine.EnableUndo(bUndoEnabled);
+
Invalidate();
}
@@ -265,6 +271,9 @@ void SQLEditView::DoBracketHilight(sal_uInt16 nKey)
if (nChar == -1)
return;
+ bool bUndoEnabled = m_xEditEngine->IsUndoEnabled();
+ m_xEditEngine->EnableUndo(false);
+
sal_uInt32 nPara = nStartPara;
do
{
@@ -299,6 +308,8 @@ void SQLEditView::DoBracketHilight(sal_uInt16 nKey)
++nCount;
}
} while (nPara--);
+
+ m_xEditEngine->EnableUndo(bUndoEnabled);
}
Color SQLEditView::GetSyntaxHighlightColor(const svtools::ColorConfig& rColorConfig, HighlighterLanguage eLanguage, TokenType aToken)