diff options
author | Cédric Bosdonnat <cedric.bosdonnat.ooo@free.fr> | 2011-11-10 16:10:25 +0100 |
---|---|---|
committer | Cédric Bosdonnat <cedric.bosdonnat.ooo@free.fr> | 2011-11-12 14:25:11 +0100 |
commit | 74b6759ee81c95ae75046dd411d2bd0bd2324a8b (patch) | |
tree | 15a68cf54c7b4dbfca407284d6d72a4035d16e81 /writerfilter/source/filter | |
parent | 75d38d0735f17549da5e4ec038f97478236c3048 (diff) |
n#707157: Word doesn't break the numberings and prefers hiding them
Added a compatibility option to reproduce Word's behavior when importing
Doc, docx and RTF files. The default behavior isn't changed.
Diffstat (limited to 'writerfilter/source/filter')
-rw-r--r-- | writerfilter/source/filter/ImportFilter.cxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/writerfilter/source/filter/ImportFilter.cxx b/writerfilter/source/filter/ImportFilter.cxx index 2950f9f521a8..5ac315c02d52 100644 --- a/writerfilter/source/filter/ImportFilter.cxx +++ b/writerfilter/source/filter/ImportFilter.cxx @@ -28,8 +28,10 @@ #include <osl/diagnose.h> #include <com/sun/star/uno/XComponentContext.hpp> +#include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/drawing/XDrawPageSupplier.hpp> #include <com/sun/star/io/XInputStream.hpp> +#include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <comphelper/mediadescriptor.hxx> #include <oox/core/filterdetect.hxx> #include <dmapper/DomainMapper.hxx> @@ -175,6 +177,13 @@ void WriterFilter::setTargetDocument( const uno::Reference< lang::XComponent >& throw (lang::IllegalArgumentException, uno::RuntimeException) { m_xDstDoc = xDoc; + + // Set some compatibility options that are valid for all the formats + uno::Reference< lang::XMultiServiceFactory > xFactory( xDoc, uno::UNO_QUERY ); + uno::Reference< beans::XPropertySet > xSettings( xFactory->createInstance( + rtl::OUString::createFromAscii( "com.sun.star.document.Settings" ) ), uno::UNO_QUERY ); + + xSettings->setPropertyValue( rtl::OUString::createFromAscii( "UnbreakableNumberings" ), uno::makeAny( sal_True ) ); } void WriterFilter::setSourceDocument( const uno::Reference< lang::XComponent >& xDoc ) |