Kaydet (Commit) 4034d96a authored tarafından Miklos Vajna's avatar Miklos Vajna

writerfilter: respect WinWordToWriter config setting

The binary filter uses this setting to decide if the embedded object is
converted into a native Writer document (so it can be edited) or not (so
it's preserved better), let's do the same.

Change-Id: I47b48867b3d0abf6cd8de2430513587a6776461e
üst 7890a726
......@@ -1319,7 +1319,7 @@ void DomainMapper_Impl::appendOLE( const OUString& rStreamName, OLEHandlerPtr pO
uno::Reference< text::XTextContent > xOLE( m_xTextFactory->createInstance(sEmbeddedService), uno::UNO_QUERY_THROW );
uno::Reference< beans::XPropertySet > xOLEProperties(xOLE, uno::UNO_QUERY_THROW);
OUString aCLSID = pOLEHandler->getCLSID();
OUString aCLSID = pOLEHandler->getCLSID(m_xComponentContext);
if (aCLSID.isEmpty())
xOLEProperties->setPropertyValue(PropertyNameSupplier::GetPropertyNameSupplier().GetName( PROP_STREAM_NAME ),
uno::makeAny( rStreamName ));
......
......@@ -25,6 +25,7 @@
#include <ooxml/resourceids.hxx>
#include <rtl/ustring.hxx>
#include <unotools/mediadescriptor.hxx>
#include <officecfg/Office/Common.hxx>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/document/XEmbeddedObjectResolver.hpp>
......@@ -247,11 +248,11 @@ void OLEHandler::importStream(uno::Reference<uno::XComponentContext> xComponentC
saveInteropProperties(xTextDocument, xPropertySet->getPropertyValue("StreamName").get<OUString>(), m_aURL);
}
OUString OLEHandler::getCLSID()
OUString OLEHandler::getCLSID(uno::Reference<uno::XComponentContext> xComponentContext) const
{
OUString aRet;
if (m_sProgId == "Word.Document.12")
if (officecfg::Office::Common::Filter::Microsoft::Import::WinWordToWriter::get(xComponentContext) && m_sProgId == "Word.Document.12")
aRet = "8BC6B165-B1B2-4EDD-aa47-dae2ee689dd6";
return aRet;
......
......@@ -94,7 +94,7 @@ public:
css::uno::Reference<css::text::XTextContent> xOLE);
/// Get the CLSID of the OLE object, in case we can find one based on m_sProgId.
OUString getCLSID();
OUString getCLSID(css::uno::Reference<css::uno::XComponentContext> xComponentContext) const;
OUString copyOLEOStream( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextDocument > const & xTextDocument );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment