[Libreoffice-commits] core.git: sw/qa writerfilter/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Tue Nov 6 06:20:14 UTC 2018
sw/qa/extras/ooxmlexport/ooxmlexport9.cxx | 6 ++++++
writerfilter/source/dmapper/DomainMapper.cxx | 7 +++++--
writerfilter/source/dmapper/DomainMapper.hxx | 4 ++++
writerfilter/source/dmapper/OLEHandler.cxx | 3 +++
4 files changed, 18 insertions(+), 2 deletions(-)
New commits:
commit 8f8d6bee47b5c41ef551e18d2f9d117d82f01e3f
Author: Justin Luth <justin_luth at sil.org>
AuthorDate: Mon Oct 29 08:01:14 2018 +0300
Commit: Justin Luth <justin_luth at sil.org>
CommitDate: Tue Nov 6 07:19:09 2018 +0100
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 at sil.org>
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
index 750a3cc24e07..e396ac0bea0b 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
@@ -26,6 +26,7 @@
#include <com/sun/star/text/RelOrientation.hpp>
#include <com/sun/star/text/VertOrientation.hpp>
#include <com/sun/star/text/WrapTextMode.hpp>
+#include <com/sun/star/view/XFormLayerAccess.hpp>
#include <com/sun/star/view/XViewSettingsSupplier.hpp>
#include <com/sun/star/view/XSelectionSupplier.hpp>
#include <com/sun/star/style/LineSpacing.hpp>
@@ -976,6 +977,11 @@ DECLARE_OOXMLEXPORT_TEST( testActiveXTextfield, "activex_textbox.docx" )
// Check textfield is single-line
CPPUNIT_ASSERT_EQUAL( false, getProperty<bool>(xPropertySet2, "MultiLine") );
+
+ // Don't open in design mode when form controls exist
+ uno::Reference<frame::XModel> xModel(mxComponent, uno::UNO_QUERY);
+ uno::Reference<view::XFormLayerAccess> xFormLayerAccess(xModel->getCurrentController(), uno::UNO_QUERY);
+ CPPUNIT_ASSERT( !xFormLayerAccess->isFormDesignMode() );
}
DECLARE_OOXMLEXPORT_TEST( testActiveXCheckbox, "activex_checkbox.docx" )
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() )
{
More information about the Libreoffice-commits
mailing list