summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/sdi/_docsh.sdi2
-rw-r--r--sw/source/uibase/app/docsh.cxx6
2 files changed, 7 insertions, 1 deletions
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!");