diff options
author | Justin Luth <justin.luth@collabora.com> | 2018-09-28 20:41:34 +0300 |
---|---|---|
committer | Justin Luth <justin_luth@sil.org> | 2018-09-29 20:26:47 +0200 |
commit | a7756236858788b11816cbaba433768ba4ccc72a (patch) | |
tree | a4e49ded79b778d4a4edcdd20da41029e072c6a0 | |
parent | c01b66846d6651600893ae5d3c590e9076065032 (diff) |
tdf#111980 sc optionbutton autoGroups different for form/activeX
This patch only affects calc. (Perhaps .xls* is the only
format that supports non-activeX radio buttons?)
Commit 9f969799629fe6bdf8b922d8cb922846aa646ece worried
about form and activeX buttons sharing the autoGroup_.
This patch prevents that.
Change-Id: Ia57a14f1cdd6363aa5d6d991469668fcc56016ca
Reviewed-on: https://gerrit.libreoffice.org/61095
Tested-by: Jenkins
Reviewed-by: Justin Luth <justin_luth@sil.org>
-rw-r--r-- | sc/qa/unit/subsequent_filters-test.cxx | 24 | ||||
-rw-r--r-- | sc/source/filter/oox/drawingfragment.cxx | 2 |
2 files changed, 22 insertions, 4 deletions
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx index ef2b5ee22aef..0b0406127e82 100644 --- a/sc/qa/unit/subsequent_filters-test.cxx +++ b/sc/qa/unit/subsequent_filters-test.cxx @@ -1694,18 +1694,34 @@ void ScFiltersTest::testActiveXOptionButtonGroup() xPropertySet->getPropertyValue("GroupName") >>= sGroupName; CPPUNIT_ASSERT_EQUAL(OUString("Sheet1"), sGroupName); - // Form optionbuttons (without Group names) were not grouped. + // Optionbuttons (without Group names) were not grouped. // The two optionbuttons should have the same auto-generated group name. + OUString sGroupName2; //ActiveX controls + xControlShape.set(xIA_DrawPage->getByIndex(2), uno::UNO_QUERY_THROW); + xPropertySet.set(xControlShape->getControl(), uno::UNO_QUERY_THROW); + xPropertySet->getPropertyValue("GroupName") >>= sGroupName2; + CPPUNIT_ASSERT_EQUAL( false, sGroupName2.isEmpty() ); + + OUString sGroupName3; + xControlShape.set(xIA_DrawPage->getByIndex(3), uno::UNO_QUERY_THROW); + xPropertySet.set(xControlShape->getControl(), uno::UNO_QUERY_THROW); + xPropertySet->getPropertyValue("GroupName") >>= sGroupName3; + CPPUNIT_ASSERT_EQUAL( sGroupName2, sGroupName3 ); + CPPUNIT_ASSERT( sGroupName != sGroupName3 ); + + OUString sGroupName4; //Form controls xControlShape.set(xIA_DrawPage->getByIndex(4), uno::UNO_QUERY_THROW); xPropertySet.set(xControlShape->getControl(), uno::UNO_QUERY_THROW); - xPropertySet->getPropertyValue("GroupName") >>= sGroupName; - CPPUNIT_ASSERT_EQUAL(false, sGroupName.isEmpty()); + xPropertySet->getPropertyValue("GroupName") >>= sGroupName4; + CPPUNIT_ASSERT_EQUAL( false, sGroupName4.isEmpty() ); OUString sGroupName5; xControlShape.set(xIA_DrawPage->getByIndex(5), uno::UNO_QUERY_THROW); xPropertySet.set(xControlShape->getControl(), uno::UNO_QUERY_THROW); xPropertySet->getPropertyValue("GroupName") >>= sGroupName5; - CPPUNIT_ASSERT_EQUAL(sGroupName, sGroupName5); + CPPUNIT_ASSERT_EQUAL( sGroupName4, sGroupName5 ); + CPPUNIT_ASSERT( sGroupName2 != sGroupName5 ); + CPPUNIT_ASSERT( sGroupName != sGroupName5 ); } void ScFiltersTest::testChartImportODS() diff --git a/sc/source/filter/oox/drawingfragment.cxx b/sc/source/filter/oox/drawingfragment.cxx index 5ad5f48a7b02..52c349f31fd8 100644 --- a/sc/source/filter/oox/drawingfragment.cxx +++ b/sc/source/filter/oox/drawingfragment.cxx @@ -536,6 +536,8 @@ Reference< XShape > VmlDrawing::createAndInsertClientXShape( const ::oox::vml::S case XML_Radio: { AxOptionButtonModel& rAxModel = aControl.createModel< AxOptionButtonModel >(); + // unique name to prevent autoGroping with ActiveX controls. + rAxModel.maGroupName = "autoGroup_formControl"; convertControlText( rAxModel.maFontData, rAxModel.mnTextColor, rAxModel.maCaption, pTextBox, pClientData->mnTextHAlign ); convertControlBackground( rAxModel, rShape ); rAxModel.maValue = OUString::number( pClientData->mnChecked ); |