diff options
Diffstat (limited to 'sw/source/ui/app/docsh.cxx')
-rw-r--r-- | sw/source/ui/app/docsh.cxx | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/sw/source/ui/app/docsh.cxx b/sw/source/ui/app/docsh.cxx index e4f95338416f..e96af964120e 100644 --- a/sw/source/ui/app/docsh.cxx +++ b/sw/source/ui/app/docsh.cxx @@ -106,6 +106,7 @@ #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp> #include <unomid.h> +#include <unotextrange.hxx> #include <sfx2/Metadatable.hxx> #include <switerator.hxx> @@ -124,6 +125,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, |