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

New commits:
commit c1fe4f2f62abdda098f77f01eff70d8ca91fec71
Author:     Caolán McNamara <[email protected]>
AuthorDate: Sat Dec 21 19:48:45 2024 +0000
Commit:     Xisco Fauli <[email protected]>
CommitDate: Sun Dec 22 20:48:11 2024 +0100

    crashreporting: disable load from template during print preview
    
    Change-Id: Ifc60a01f0e5e1f6cdab3680e69202f98471c2a7a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179091
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <[email protected]>

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 6f8673eaff12..aea8ba51f87d 100644
--- a/sw/source/uibase/app/docsh.cxx
+++ b/sw/source/uibase/app/docsh.cxx
@@ -1124,6 +1124,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