From dfab7782e1577ce40bab68330347edc48ff05389 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sat, 21 Dec 2024 19:48:45 +0000 Subject: crashreporting: disable load from template during print preview MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ifc60a01f0e5e1f6cdab3680e69202f98471c2a7a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179089 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- sw/sdi/_docsh.sdi | 2 +- sw/source/uibase/app/docsh.cxx | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'sw') diff --git a/sw/sdi/_docsh.sdi b/sw/sdi/_docsh.sdi index 5a398feff6d8..d82819ef2d57 100644 --- a/sw/sdi/_docsh.sdi +++ b/sw/sdi/_docsh.sdi @@ -69,7 +69,7 @@ interface BaseTextDocument SID_TEMPLATE_LOAD [ ExecMethod = Execute ; - StateMethod = NoState ; + StateMethod = GetState; ] SID_GET_COLORLIST diff --git a/sw/source/uibase/app/docsh.cxx b/sw/source/uibase/app/docsh.cxx index 4bbd44ce78b1..539d056eac6f 100644 --- a/sw/source/uibase/app/docsh.cxx +++ b/sw/source/uibase/app/docsh.cxx @@ -1128,6 +1128,12 @@ void SwDocShell::GetState(SfxItemSet& rSet) rSet.DisableItem(nWhich); } break; + case SID_TEMPLATE_LOAD: + // In the launched template dialog the subsequent "Load" button depends + // on m_pWrtShell existing + if (!m_pWrtShell) + rSet.DisableItem(nWhich); + break; default: OSL_ENSURE(false,"You cannot get here!"); -- cgit