summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorJustin Luth <justin.luth@collabora.com>2018-09-27 21:46:18 +0300
committerMichael Meeks <michael.meeks@collabora.com>2018-09-28 09:58:11 +0200
commit3df4131b3ce211a53eb2213f3c954aff1694878c (patch)
tree6b7735668066e6d71e5836a3ba2985fb9d2ba4f7 /oox
parent1abdff93273b4f97692b02e5fc00254b56cd6802 (diff)
tdf#111980 oox: connect empty radio groups
affects doc, docx, xls, xlsx (at least). Handling optionbutton groups is new since 2017, so incremental enhancements are OK. In LO, if an option button with an empty groupName (like any form control which has no groupName option), then it stands alone, which is a ridiculous position to be in for a radio button. So, lets put them all together into an automatic group. In MSO, buttons without any explicit group stick together, so the effective group is the entire document, or entire sheet. One complication is that ActiveX radio buttons don't interact with Form radio buttons, even if all of them have no group name. That situation is not handled by this patch (and not very likely to happen since ActiveX defaults the group name to the sheet name). (A Group Box can also be used, which automatically groups all buttons fully within its area. That will be much harder to implement since every object will need to first be categorized as groupbox or optionControl - meaning that everything must first be imported. That implies a function call from every application doing the import.) Change-Id: I204adaea75ce99999a16c0cc4e9c3b8b08da9433 Reviewed-on: https://gerrit.libreoffice.org/61064 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.meeks@collabora.com> (cherry picked from commit 9f969799629fe6bdf8b922d8cb922846aa646ece) Reviewed-on: https://gerrit.libreoffice.org/61072 Tested-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/ole/axcontrol.cxx12
1 files changed, 11 insertions, 1 deletions
diff --git a/oox/source/ole/axcontrol.cxx b/oox/source/ole/axcontrol.cxx
index 1e1b249e1bc7..bb6fdbc6b1c7 100644
--- a/oox/source/ole/axcontrol.cxx
+++ b/oox/source/ole/axcontrol.cxx
@@ -1554,7 +1554,17 @@ void AxMorphDataModelBase::convertProperties( PropertyMap& rPropMap, const Contr
rPropMap.setProperty( PROP_Enabled, getFlag( mnFlags, AX_FLAGS_ENABLED ) );
rConv.convertColor( rPropMap, PROP_TextColor, mnTextColor );
if ( mnDisplayStyle == AX_DISPLAYSTYLE_OPTBUTTON )
- rPropMap.setProperty( PROP_GroupName, maGroupName );
+ {
+ // Form Radio Controls (non-ActiveX) have no group name, but autoGroup
+ // with their group box, or frame, or sheet, or document.
+ // So ensure that SOME name is given for a group name
+ // TODO: ActiveX controls without a Group name shouldn't autogroup
+ // with non-ActiveX option buttons.
+ // TODO: each application should test if control's area is fully inside
+ // a GroupBox, and give those a separate group name.
+ OUString sGroupName = !maGroupName.isEmpty() ? maGroupName : "autoGroup_";
+ rPropMap.setProperty( PROP_GroupName, sGroupName );
+ }
AxFontDataModel::convertProperties( rPropMap, rConv );
}