sw/sdi/_docsh.sdi              |    2 +-
 sw/source/uibase/app/docsh.cxx |    6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)

New commits:
commit 304df2a40a7e459c70e691a262f554c3c87c7838
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Sat Dec 21 19:48:45 2024 +0000
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Sat Dec 21 21:39:14 2024 +0100

    crashreporting: disable load from template during print preview
    
    Change-Id: Ifc60a01f0e5e1f6cdab3680e69202f98471c2a7a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179090
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Tested-by: Jenkins

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!");
 

Reply via email to