summaryrefslogtreecommitdiff
path: root/sw/source/ui/app/docsh.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/ui/app/docsh.cxx')
-rw-r--r--sw/source/ui/app/docsh.cxx17
1 files changed, 17 insertions, 0 deletions
diff --git a/sw/source/ui/app/docsh.cxx b/sw/source/ui/app/docsh.cxx
index 7da8e090503b..72564f3a285c 100644
--- a/sw/source/ui/app/docsh.cxx
+++ b/sw/source/ui/app/docsh.cxx
@@ -105,6 +105,7 @@
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
#include <unomid.h>
+#include <unotextrange.hxx>
#include <sfx2/Metadatable.hxx>
#include <switerator.hxx>
@@ -123,6 +124,22 @@ TYPEINIT2(SwDocShell, SfxObjectShell, SfxListener);
SFX_IMPL_OBJECTFACTORY(SwDocShell, SvGlobalName(SO3_SW_CLASSID), SFXOBJECTSHELL_STD_NORMAL|SFXOBJECTSHELL_HASMENU, "swriter" )
+bool SwDocShell::InsertGeneratedStream(SfxMedium & rMedium,
+ uno::Reference<text::XTextRange> const& xInsertPosition)
+{
+ SwUnoInternalPaM aPam(*GetDoc()); // must have doc since called from SwView
+ if (!::sw::XTextRangeToSwPaM(aPam, xInsertPosition))
+ return false;
+ // similar to SwView::InsertMedium
+ SwReader *pReader(0);
+ Reader *const pRead = StartConvertFrom(rMedium, &pReader, 0, &aPam);
+ if (!pRead)
+ return false;
+ sal_uLong const nError = pReader->Read(*pRead);
+ delete pReader;
+ return 0 == nError;
+}
+
// Prepare loading
Reader* SwDocShell::StartConvertFrom(SfxMedium& rMedium, SwReader** ppRdr,
SwCrsrShell *pCrsrShell,