address forward incompatibility of InputRequired default change
commit fec8c14e96
changed the default value
of InputRequired as read from the file; that is the value InputRequired
has when it is set to neither false nor true in the file
This is to mitigate the fact that InputRequired was not property
enforced and now suddenly is, but its default value was "true"! So
lots of past forms have InputRequired==true everywhere, users did not
pay attention to it because it was not enforced, and now it is
enforced, which suddenly is a huge PITA for users because they have to
update most controls in all forms. Since older versions of LibreOffice
omitted the input-required attribute in the file (the XML stream) when
it had its then-default value (namely "true"), we changed that to now
mean "false". As a side-effect, newer LibreOffice omits the attribute
in the XML stream when InputRequired has its new default value, namely
"false".
So the situation is that any file saved with an older LibreOffice will
have all its form controls with InputRequired==false when opened with
a newer LibreOffice, and any file saved with a newer LibreOffice will
have all its form controls with InputRequired==true when opened with
an older LibreOffice.
This commit makes LibreOffice always write the XML attribute. So that
any file saved with a newer LibreOffice will have the same
InputRequired values when opened in an older LibreOffice.
This enhances forward compatibility, because InputRequired was
enforced in older versions when the underlying database field was
marked NOT NULL. So the current situation leads to unwanted
enforcement in older LibreOffice versions, with a file that is saved
from newer LibreOffice with a control having InputRequired==false and
bound to a database field marked NOT NULL. This commit fixes that, by
ensuring that any form control with InputRequired==false in newer
LibreOffice will also have InputRequired==false in older LibreOffice.
Change-Id: I92ef48ad99c4e2ead43e95376282cc861c181ab3
Reviewed-on: https://gerrit.libreoffice.org/64642
Tested-by: Jenkins
Reviewed-by: Lionel Elie Mamane <lionel@mamane.lu>
Reviewed-by: Eike Rathke <erack@redhat.com>
This commit is contained in:
parent
6ca8d2c895
commit
97a0a7f403
2 changed files with 11 additions and 1 deletions
|
@ -2313,6 +2313,16 @@ xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.
|
|||
</rng:optional>
|
||||
</rng:define>
|
||||
|
||||
<!-- TODO no proposal; see 7a5d79f2297a43d0a854e304b0792164272edfe0 -->
|
||||
<!-- FIXME this is almost certainly incomplete: need to figure out which elements can have this and which named pattern can be extended with it to get exactly these elements -->
|
||||
<rng:define name="form-checkbox-attlist" combine="interleave">
|
||||
<rng:optional>
|
||||
<rng:attribute name="form:input-required">
|
||||
<rng:ref name="boolean"/>
|
||||
</rng:attribute>
|
||||
</rng:optional>
|
||||
</rng:define>
|
||||
|
||||
<!-- just a test-case for user-defined attributes, move along, nothing to see here... -->
|
||||
<rng:define name="style-table-cell-properties-attlist" combine="interleave">
|
||||
<rng:optional>
|
||||
|
|
|
@ -835,7 +835,7 @@ namespace xmloff
|
|||
OAttributeMetaData::getDatabaseAttributeNamespace(),
|
||||
OAttributeMetaData::getDatabaseAttributeName( DAFlags::InputRequired ),
|
||||
PROPERTY_INPUT_REQUIRED,
|
||||
BoolAttrFlags::DefaultFalse
|
||||
BoolAttrFlags::DefaultFalse | BoolAttrFlags::DefaultVoid
|
||||
);
|
||||
RESET_BIT( nIncludeDatabase, DAFlags::InputRequired );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue