Kaydet (Commit) a7756236 authored tarafından Justin Luth's avatar Justin Luth Kaydeden (comit) Justin Luth

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 9f969799 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: 's avatarJustin Luth <justin_luth@sil.org>
üst c01b6684
......@@ -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()
......
......@@ -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 );
......
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