diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2012-10-16 18:15:19 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2012-10-16 18:17:28 +0200 |
commit | 074bb522927c60f2575fdc5bcb83eb17a4dfc4b7 (patch) | |
tree | c8a46daa852c02e60dfbbe5982337a63d2a51ce0 /writerfilter/source | |
parent | vml import: only apply width-percent attribute if it's != 0 (diff) | |
download | core-074bb522927c60f2575fdc5bcb83eb17a4dfc4b7.tar.gz core-074bb522927c60f2575fdc5bcb83eb17a4dfc4b7.zip |
RtfFilter::filter: add code to dump input stream for copy&paste
This is especially useful when creating testcases for handling
copy&paste input.
Change-Id: I11be65484e7ac4dfac3d28576249143b7532a976
Diffstat (limited to 'writerfilter/source')
-rw-r--r-- | writerfilter/source/filter/RtfFilter.cxx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/writerfilter/source/filter/RtfFilter.cxx b/writerfilter/source/filter/RtfFilter.cxx index 22f710817753..35f84da26bd0 100644 --- a/writerfilter/source/filter/RtfFilter.cxx +++ b/writerfilter/source/filter/RtfFilter.cxx @@ -27,6 +27,11 @@ #include <rtftok/RTFDocument.hxx> #include <com/sun/star/frame/XFrame.hpp> #include <com/sun/star/task/XStatusIndicator.hpp> +#ifdef DBG_COPYPASTE +#include <unotools/localfilehelper.hxx> +#include <tools/stream.hxx> +#include <unotools/ucbstreamhelper.hxx> +#endif using namespace ::rtl; using namespace ::cppu; @@ -82,6 +87,17 @@ sal_Bool RtfFilter::filter( const uno::Sequence< beans::PropertyValue >& aDescri aMediaDesc.addInputStream(); aMediaDesc[ MediaDescriptor::PROP_INPUTSTREAM() ] >>= xInputStream; +#ifdef DBG_COPYPASTE + OUString aOutStr; + if (utl::LocalFileHelper::ConvertPhysicalNameToURL("/tmp/stream.rtf", aOutStr)) + { + SvStream* pOut = utl::UcbStreamHelper::CreateStream(aOutStr, STREAM_WRITE); + SvStream* pIn = utl::UcbStreamHelper::CreateStream(xInputStream); + *pOut << *pIn; + delete pOut; + } +#endif + uno::Reference<frame::XFrame> xFrame = aMediaDesc.getUnpackedValueOrDefault(MediaDescriptor::PROP_FRAME(), uno::Reference<frame::XFrame>()); |