summaryrefslogtreecommitdiff
path: root/sw/source/uibase/wrtsh/wrtsh1.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/uibase/wrtsh/wrtsh1.cxx')
-rw-r--r--sw/source/uibase/wrtsh/wrtsh1.cxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx b/sw/source/uibase/wrtsh/wrtsh1.cxx
index 0dbb7aaf0796..8d369fa50e40 100644
--- a/sw/source/uibase/wrtsh/wrtsh1.cxx
+++ b/sw/source/uibase/wrtsh/wrtsh1.cxx
@@ -25,6 +25,7 @@
#include <com/sun/star/embed/NoVisualAreaSizeException.hpp>
#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/util/XModifiable.hpp>
+#include <com/sun/star/lang/XInitialization.hpp>
#include <hintids.hxx>
#include <sot/exchange.hxx>
@@ -98,6 +99,7 @@
#include <svtools/embedhlp.hxx>
#include <svx/postattr.hxx>
#include <comphelper/lok.hxx>
+#include <comphelper/propertyvalue.hxx>
#include <memory>
using namespace sw::mark;
@@ -622,6 +624,14 @@ void SwWrtShell::LaunchOLEObj( long nVerb )
if ( !pCli )
pCli = new SwOleClient( &GetView(), &GetView().GetEditWin(), xRef );
+ uno::Reference<lang::XInitialization> xOLEInit(xRef.GetObject(), uno::UNO_QUERY);
+ if (xOLEInit.is())
+ {
+ uno::Sequence<beans::PropertyValue> aArguments
+ = { comphelper::makePropertyValue("ReadOnly", pCli->IsProtected()) };
+ xOLEInit->initialize({ uno::makeAny(aArguments) });
+ }
+
static_cast<SwOleClient*>(pCli)->SetInDoVerb( true );
CalcAndSetScale( xRef );