This is an automated email from the ASF dual-hosted git repository.

jimjag pushed a commit to branch odf-devel
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit 9eca93128d1ab4022a5a094b58eb858654390e1b
Author: Jim Jagielski <[email protected]>
AuthorDate: Fri Oct 23 06:33:39 2026 -0400

    xmloff: write text for note-ref formats the schema rejects
    
    text:note-ref allows only `page`, `chapter`, `direction` and `text`. A note 
reference shows the note number whatever the part, so text reloads with the 
same display.
---
 main/xmloff/source/text/txtflde.cxx | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/main/xmloff/source/text/txtflde.cxx 
b/main/xmloff/source/text/txtflde.cxx
index 7bc30c5400..a88f7d09b4 100644
--- a/main/xmloff/source/text/txtflde.cxx
+++ b/main/xmloff/source/text/txtflde.cxx
@@ -1656,10 +1656,17 @@ void XMLTextFieldExport::ExportFieldHelper(
                // reference to end-/footnote: format, generate name, (and 
element)
                GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_NOTE_CLASS,
                        FIELD_ID_REF_ENDNOTE==nToken ? XML_ENDNOTE : 
XML_FOOTNOTE );
-               ProcessString(XML_REFERENCE_FORMAT,
-                                         MapReferenceType(GetInt16Property(
-                                                 sPropertyReferenceFieldPart, 
rPropSet)),
-                                         XML_TEMPLATE);
+               {
+                       sal_Int16 nPart = GetInt16Property(
+                               sPropertyReferenceFieldPart, rPropSet);
+                       // sequence-only formats; a note reference shows the 
same text
+                       if( ReferenceFieldPart::CATEGORY_AND_NUMBER == nPart ||
+                               ReferenceFieldPart::ONLY_CAPTION == nPart ||
+                               ReferenceFieldPart::ONLY_SEQUENCE_NUMBER == 
nPart )
+                               nPart = ReferenceFieldPart::TEXT;
+                       ProcessString(XML_REFERENCE_FORMAT, 
MapReferenceType(nPart),
+                                                 XML_TEMPLATE);
+               }
                ProcessString(XML_REF_NAME,
                                          MakeFootnoteRefName(GetInt16Property(
                                                  sPropertySequenceNumber, 
rPropSet)));

Reply via email to