diff options
author | Justin Luth <justin_luth@sil.org> | 2018-10-29 08:01:14 +0300 |
---|---|---|
committer | Justin Luth <justin_luth@sil.org> | 2018-11-06 07:19:09 +0100 |
commit | 8f8d6bee47b5c41ef551e18d2f9d117d82f01e3f (patch) | |
tree | 9b84b8932fbf4abaaf989acf848fa646be7c2163 /writerfilter | |
parent | fff34169fa912ad5096f1652172ea2455e5cb4d3 (diff) |
tdf#118166 writerfilter: no design mode if ole controls exist
...just like sdt controls already turned off design mode.
I'm not sure why design mode wasn't entirely turned off
right from the start, but I don't want to do that now because
forms are becoming more prominent in Writer. If design
mode is ALWAYS turned off for .docx files, then the workflow
will be different for *new* forms, since writer defaults to on.
Change-Id: I91c771f1ebd5e640da8067d38cb06076d8c50d5a
Reviewed-on: https://gerrit.libreoffice.org/62491
Tested-by: Jenkins
Reviewed-by: Justin Luth <justin_luth@sil.org>
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper.cxx | 7 | ||||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper.hxx | 4 | ||||
-rw-r--r-- | writerfilter/source/dmapper/OLEHandler.cxx | 3 |
3 files changed, 12 insertions, 2 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index fce5cfe28b49..7d802249b2f4 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -106,6 +106,7 @@ DomainMapper::DomainMapper( const uno::Reference< uno::XComponentContext >& xCon LoggedStream("DomainMapper"), m_pImpl(new DomainMapper_Impl(*this, xContext, xModel, eDocumentType, rMediaDesc)), mbIsSplitPara(false) + ,mbHasControls(false) { // #i24363# tab stops relative to indent m_pImpl->SetDocumentSettingsProperty( @@ -193,12 +194,14 @@ DomainMapper::~DomainMapper() xEnumeration->nextElement(); } } - if( nIndexes || m_pImpl->m_pSdtHelper->hasElements()) + + mbHasControls |= m_pImpl->m_pSdtHelper->hasElements(); + if ( nIndexes || mbHasControls ) { //index update has to wait until first view is created uno::Reference< document::XEventBroadcaster > xBroadcaster(xIndexesSupplier, uno::UNO_QUERY); if (xBroadcaster.is()) - xBroadcaster->addEventListener(uno::Reference< document::XEventListener >(new ModelEventListener(nIndexes, m_pImpl->m_pSdtHelper->hasElements()))); + xBroadcaster->addEventListener(uno::Reference< document::XEventListener >(new ModelEventListener(nIndexes, mbHasControls))); } diff --git a/writerfilter/source/dmapper/DomainMapper.hxx b/writerfilter/source/dmapper/DomainMapper.hxx index b245bb000228..e6b082cfcd47 100644 --- a/writerfilter/source/dmapper/DomainMapper.hxx +++ b/writerfilter/source/dmapper/DomainMapper.hxx @@ -110,6 +110,9 @@ public: bool IsInHeaderFooter() const; bool IsInTable() const; bool IsStyleSheetImport() const; + + void hasControls( const bool bSet ) { mbHasControls = bSet; } + /** @see DomainMapper_Impl::processDeferredCharacterProperties() */ @@ -164,6 +167,7 @@ private: static css::style::TabAlign getTabAlignFromValue(const sal_Int32 nIntValue); static sal_Unicode getFillCharFromValue(const sal_Int32 nIntValue); bool mbIsSplitPara; + bool mbHasControls; std::unique_ptr< GraphicZOrderHelper > zOrderHelper; std::unique_ptr<GraphicNamingHelper> m_pGraphicNamingHelper; OUString m_sGlossaryEntryName; diff --git a/writerfilter/source/dmapper/OLEHandler.cxx b/writerfilter/source/dmapper/OLEHandler.cxx index 8ebf88c7c6f2..dee9ceb22ae1 100644 --- a/writerfilter/source/dmapper/OLEHandler.cxx +++ b/writerfilter/source/dmapper/OLEHandler.cxx @@ -106,7 +106,10 @@ void OLEHandler::lcl_attribute(Id rName, Value & rVal) // Control shape is handled on a different code path uno::Reference< lang::XServiceInfo > xSInfo( xTempShape, uno::UNO_QUERY_THROW ); if(xSInfo->supportsService("com.sun.star.drawing.ControlShape")) + { + m_rDomainMapper.hasControls(true); break; + } if( xTempShape.is() ) { |