I have a .odb file that I set up years ago. (Just in case of very unlikely significance, the backend is MySQL.) One of the forms was originally set up with two tabular subforms that used queries as their data sources. To indicate that the table controls of those subforms are for informational display only, their backgrounds were set to a pale yellow color. Somewhere along the lines, perhaps because of an update (either to LO or to Windows) or perhaps because I started using a dark system theme, one and only one of those subforms became unuseable because the text started displaying in white instead of black (providing insufficient contrast against the pale yellow). I’m trying to come up with a way to make it display in black again. To get a closer look at what’s going on, I unzipped the .odb file, and using a file content search of the contents, determined that the form in question corresponded to one of the ObjXX directories’ content.xml
files. Examining that file shed a little light on why the two subforms are not presenting identiacally.
Here is the portion directly defining the Table Control that is displaying black text:
<form:grid form:name="Chirp" form:control-implementation="ooo:com.sun.star.form.component.GridControl" xml:id="control12" form:id="control12">
<form:properties>
<form:property form:property-name="DefaultControl" office:value-type="string" office:string-value="com.sun.star.form.control.GridControl"/>
</form:properties>
<form:column form:name="NAME" form:control-implementation="ooo:TextField" form:label="NAME">
<form:text xml:id="control13" form:id="control13" form:max-length="20" form:data-field="NAME" form:input-required="false" form:convert-empty-to-null="true">
<form:properties>
<form:property form:property-name="ControlTypeinMSO" office:value-type="float" office:value="0"/>
<form:property form:property-name="DefaultControl" office:value-type="string" office:string-value="com.sun.star.form.control.TextField"/>
<form:property form:property-name="ObjIDinMSO" office:value-type="float" office:value="65535"/>
<form:property form:property-name="Width" office:value-type="float" office:value="0"/>
</form:properties>
</form:text>
</form:column>
<form:column form:name="NOMINAL" form:control-implementation="ooo:FormattedField" form:label="NOMINAL" form:text-style-name="ctrl1">
<form:formatted-text xml:id="control14" form:id="control14" form:data-field="NOMINAL" form:input-required="false" form:convert-empty-to-null="true">
<form:properties>
<form:property form:property-name="ControlTypeinMSO" office:value-type="float" office:value="0"/>
<form:property form:property-name="DefaultControl" office:value-type="string" office:string-value="com.sun.star.form.control.FormattedField"/>
<form:property form:property-name="MouseWheelBehavior" office:value-type="float" office:value="0"/>
<form:property form:property-name="ObjIDinMSO" office:value-type="float" office:value="65535"/>
<form:property form:property-name="Width" office:value-type="float" office:value="0"/>
</form:properties>
</form:formatted-text>
</form:column>
<form:column form:name="TOLERANCE" form:control-implementation="ooo:TextField" form:label="TOLERANCE">
<form:text xml:id="control15" form:id="control15" form:max-length="29" form:data-field="TOLERANCE" form:input-required="false" form:convert-empty-to-null="true">
<form:properties>
<form:property form:property-name="ControlTypeinMSO" office:value-type="float" office:value="0"/>
<form:property form:property-name="DefaultControl" office:value-type="string" office:string-value="com.sun.star.form.control.TextField"/>
<form:property form:property-name="ObjIDinMSO" office:value-type="float" office:value="65535"/>
<form:property form:property-name="Width" office:value-type="float" office:value="0"/>
</form:properties>
</form:text>
</form:column>
<form:column form:name="TAGNO" form:control-implementation="ooo:TextField" form:label="TAGNO">
<form:text xml:id="control16" form:id="control16" form:max-length="20" form:data-field="TAGNO" form:input-required="false" form:convert-empty-to-null="true">
<form:properties>
<form:property form:property-name="ControlTypeinMSO" office:value-type="float" office:value="0"/>
<form:property form:property-name="DefaultControl" office:value-type="string" office:string-value="com.sun.star.form.control.TextField"/>
<form:property form:property-name="ObjIDinMSO" office:value-type="float" office:value="65535"/>
<form:property form:property-name="Width" office:value-type="float" office:value="0"/>
</form:properties>
</form:text>
</form:column>
<form:column form:name="RESULT" form:control-implementation="ooo:FormattedField" form:label="RESULT" form:text-style-name="ctrl2">
<form:formatted-text xml:id="control17" form:id="control17" form:data-field="RESULT" form:input-required="false" form:convert-empty-to-null="true">
<form:properties>
<form:property form:property-name="ControlTypeinMSO" office:value-type="float" office:value="0"/>
<form:property form:property-name="DefaultControl" office:value-type="string" office:string-value="com.sun.star.form.control.FormattedField"/>
<form:property form:property-name="MouseWheelBehavior" office:value-type="float" office:value="0"/>
<form:property form:property-name="ObjIDinMSO" office:value-type="float" office:value="65535"/>
<form:property form:property-name="Width" office:value-type="float" office:value="0"/>
</form:properties>
</form:formatted-text>
</form:column>
<form:column form:name="UNCERTAINTY" form:control-implementation="ooo:FormattedField" form:label="UNCERTAINTY" form:text-style-name="ctrl2">
<form:formatted-text xml:id="control18" form:id="control18" form:data-field="UNCERTAINTY" form:input-required="false" form:convert-empty-to-null="true">
<form:properties>
<form:property form:property-name="ControlTypeinMSO" office:value-type="float" office:value="0"/>
<form:property form:property-name="DefaultControl" office:value-type="string" office:string-value="com.sun.star.form.control.FormattedField"/>
<form:property form:property-name="MouseWheelBehavior" office:value-type="float" office:value="0"/>
<form:property form:property-name="ObjIDinMSO" office:value-type="float" office:value="65535"/>
<form:property form:property-name="Width" office:value-type="float" office:value="0"/>
</form:properties>
</form:formatted-text>
</form:column>
<form:column form:name="COMPLIANCE" form:control-implementation="ooo:TextField" form:label="COMPLIANCE">
<form:text xml:id="control19" form:id="control19" form:max-length="16" form:data-field="COMPLIANCE" form:input-required="false" form:convert-empty-to-null="true">
<form:properties>
<form:property form:property-name="ControlTypeinMSO" office:value-type="float" office:value="0"/>
<form:property form:property-name="DefaultControl" office:value-type="string" office:string-value="com.sun.star.form.control.TextField"/>
<form:property form:property-name="ObjIDinMSO" office:value-type="float" office:value="65535"/>
<form:property form:property-name="Width" office:value-type="float" office:value="0"/>
</form:properties>
</form:text>
</form:column>
</form:grid>
As you can see, the definitions of some of the columns set the text-style-name to either “ctrl1” or “ctrl2”, which are both defined in the same content.xml file:
<style:style style:name="ctrl1" style:family="paragraph" style:data-style-name="C129"/>
<style:style style:name="ctrl2" style:family="paragraph" style:data-style-name="C130"/>
I don’t see anything in those definitions that specifies text color, but the application of that style to the columns must be making the difference, because here’s the portion of the xml corresponding to the Table Control that’s displaying white text:
<form:grid form:name="Hoot" form:control-implementation="ooo:com.sun.star.form.component.GridControl" xml:id="control4" form:id="control4">
<form:properties>
<form:property form:property-name="DefaultControl" office:value-type="string" office:string-value="com.sun.star.form.control.GridControl"/>
</form:properties>
<form:column form:name="TextField1" form:control-implementation="ooo:TextField" form:label="TAGNO" form:text-style-name="ctrl1">
<form:text xml:id="control5" form:id="control5" form:data-field="TAGNO" form:input-required="false" form:convert-empty-to-null="true">
<form:properties>
<form:property form:property-name="ControlTypeinMSO" office:value-type="float" office:value="0"/>
<form:property form:property-name="DefaultControl" office:value-type="string" office:string-value="com.sun.star.form.control.TextField"/>
<form:property form:property-name="ObjIDinMSO" office:value-type="float" office:value="65535"/>
</form:properties>
</form:text>
</form:column>
<form:column form:name="TextField2" form:control-implementation="ooo:TextField" form:label="MANUFACTURER">
<form:text xml:id="control6" form:id="control6" form:data-field="MANUFACTURER" form:input-required="false" form:convert-empty-to-null="true">
<form:properties>
<form:property form:property-name="ControlTypeinMSO" office:value-type="float" office:value="0"/>
<form:property form:property-name="DefaultControl" office:value-type="string" office:string-value="com.sun.star.form.control.TextField"/>
<form:property form:property-name="ObjIDinMSO" office:value-type="float" office:value="65535"/>
</form:properties>
</form:text>
</form:column>
<form:column form:name="TextField3" form:control-implementation="ooo:TextField" form:label="MODEL">
<form:text xml:id="control7" form:id="control7" form:data-field="MODEL" form:input-required="false" form:convert-empty-to-null="true">
<form:properties>
<form:property form:property-name="ControlTypeinMSO" office:value-type="float" office:value="0"/>
<form:property form:property-name="DefaultControl" office:value-type="string" office:string-value="com.sun.star.form.control.TextField"/>
<form:property form:property-name="ObjIDinMSO" office:value-type="float" office:value="65535"/>
</form:properties>
</form:text>
</form:column>
<form:column form:name="TextField4" form:control-implementation="ooo:TextField" form:label="DESCRIPTION">
<form:text xml:id="control8" form:id="control8" form:data-field="DESCRIPTION" form:input-required="false" form:convert-empty-to-null="true">
<form:properties>
<form:property form:property-name="ControlTypeinMSO" office:value-type="float" office:value="0"/>
<form:property form:property-name="DefaultControl" office:value-type="string" office:string-value="com.sun.star.form.control.TextField"/>
<form:property form:property-name="ObjIDinMSO" office:value-type="float" office:value="65535"/>
</form:properties>
</form:text>
</form:column>
<form:column form:name="TextField5" form:control-implementation="ooo:TextField" form:label="SERIALNO">
<form:text xml:id="control9" form:id="control9" form:data-field="SERIALNO" form:input-required="false" form:convert-empty-to-null="true">
<form:properties>
<form:property form:property-name="ControlTypeinMSO" office:value-type="float" office:value="0"/>
<form:property form:property-name="DefaultControl" office:value-type="string" office:string-value="com.sun.star.form.control.TextField"/>
<form:property form:property-name="ObjIDinMSO" office:value-type="float" office:value="65535"/>
</form:properties>
</form:text>
</form:column>
<form:column form:name="TextField6" form:control-implementation="ooo:TextField" form:label="CALIBDATE">
<form:text xml:id="control10" form:id="control10" form:data-field="CALIBDATE" form:input-required="false" form:convert-empty-to-null="true">
<form:properties>
<form:property form:property-name="ControlTypeinMSO" office:value-type="float" office:value="0"/>
<form:property form:property-name="DefaultControl" office:value-type="string" office:string-value="com.sun.star.form.control.TextField"/>
<form:property form:property-name="ObjIDinMSO" office:value-type="float" office:value="65535"/>
</form:properties>
</form:text>
</form:column>
<form:column form:name="TextField7" form:control-implementation="ooo:TextField" form:label="CALIBDUE">
<form:text xml:id="control11" form:id="control11" form:data-field="CALIBDUE" form:input-required="false" form:convert-empty-to-null="true">
<form:properties>
<form:property form:property-name="ControlTypeinMSO" office:value-type="float" office:value="0"/>
<form:property form:property-name="DefaultControl" office:value-type="string" office:string-value="com.sun.star.form.control.TextField"/>
<form:property form:property-name="ObjIDinMSO" office:value-type="float" office:value="65535"/>
</form:properties>
</form:text>
</form:column>
</form:grid>
It’s apparent to me, based on how one subform has all the columns named the query result column names and the other does not, that the two were not created in exactly the same way, but that was years ago, so there’s no way I can remember how each was specifically created. What I’m looking for is a way to make both Table Controls display their text in black. I’ve tried adding “text-style-name=“ctrl2”” or “text-style-name=“ctrl1””to the definition of the first column in the Table control that’s currently displaying white text, but that just made the .odb file unusable and irreparable. Any other ideas?
P.S.–The version I posted contains my attempt to add the style to the one that was not displaying black text, so if you see that, know it wasn’t originally that way.