diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-05-01 10:18:09 +0100 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-05-01 13:24:55 +0200 |
commit | 1d95bd8e5fcdcc241f4c945a4f01486df8e61f88 (patch) | |
tree | 2ba805a39e4fcc3855c58bc0abfdf8c0ecc480ae /editeng | |
parent | 867eee280bd968b9d6ca7d6a7b0d88ab1dc0d73a (diff) |
call SfxViewShell::Current() just once
Change-Id: I8a4770d5018b3f3c4a4eb43763a211cfb636d7ac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166953
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/editeng/impedit3.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index c0a8b1fc734c..b03f4d27afef 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -4786,10 +4786,11 @@ Color ImpEditEngine::GetAutoColor() const { Color aColor; - if (comphelper::LibreOfficeKit::isActive() && SfxViewShell::Current()) + SfxViewShell* pKitSh = comphelper::LibreOfficeKit::isActive() ? SfxViewShell::Current() : nullptr; + if (pKitSh) { // Get document background color from current view instead - aColor = SfxViewShell::Current()->GetColorConfigColor(svtools::DOCCOLOR); + aColor = pKitSh->GetColorConfigColor(svtools::DOCCOLOR); if (aColor.IsDark()) aColor = COL_WHITE; else |