[Libreoffice-commits] core.git: schema/libreoffice xmloff/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Dec 13 18:50:05 UTC 2018


 schema/libreoffice/OpenDocument-schema-v1.3+libreoffice.rng |   10 ++++++++++
 xmloff/source/forms/elementexport.cxx                       |    2 +-
 2 files changed, 11 insertions(+), 1 deletion(-)

New commits:
commit 97a0a7f403d9514b6dc9017e6c1ac603efa9576c
Author:     Lionel Elie Mamane <lionel at mamane.lu>
AuthorDate: Wed Dec 5 17:17:21 2018 +0100
Commit:     Eike Rathke <erack at redhat.com>
CommitDate: Thu Dec 13 19:49:37 2018 +0100

    address forward incompatibility of InputRequired default change
    
    commit fec8c14e960fbcd639a04d6c3354caff2d0bd365 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 at mamane.lu>
    Reviewed-by: Eike Rathke <erack at redhat.com>

diff --git a/schema/libreoffice/OpenDocument-schema-v1.3+libreoffice.rng b/schema/libreoffice/OpenDocument-schema-v1.3+libreoffice.rng
index adae650eafc9..d59314e99771 100644
--- a/schema/libreoffice/OpenDocument-schema-v1.3+libreoffice.rng
+++ b/schema/libreoffice/OpenDocument-schema-v1.3+libreoffice.rng
@@ -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>
diff --git a/xmloff/source/forms/elementexport.cxx b/xmloff/source/forms/elementexport.cxx
index 8a4e99168e58..ddbc49a87210 100644
--- a/xmloff/source/forms/elementexport.cxx
+++ b/xmloff/source/forms/elementexport.cxx
@@ -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 );
         }


More information about the Libreoffice-commits mailing list