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 83b30299d0c5bcf2e9139b7425af17bbcac79b2c
Author: Jim Jagielski <[email protected]>
AuthorDate: Fri Oct 23 08:51:37 2026 -0400

    xmloff: write style:background-image for header and footer graphics
    
    The header/footer graphic ids collided with the repeat-offset ids, so the 
URL was dropped. 1.0, 1.1 and 1.2 saves now write the element; ODF 1.2 Extended 
output is unchanged.
---
 main/xmloff/inc/xmloff/PageMasterStyleMap.hxx           |  8 ++++----
 main/xmloff/source/style/PageMasterExportPropMapper.cxx | 13 +++++++++++++
 2 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/main/xmloff/inc/xmloff/PageMasterStyleMap.hxx 
b/main/xmloff/inc/xmloff/PageMasterStyleMap.hxx
index 8b94aa0df3..26808181fb 100644
--- a/main/xmloff/inc/xmloff/PageMasterStyleMap.hxx
+++ b/main/xmloff/inc/xmloff/PageMasterStyleMap.hxx
@@ -128,8 +128,8 @@
 #define CTF_PM_HEADERMINHEIGHT                 
(CTF_PM_HEADERFLAG|(XML_PM_CTF_START + 0x0032))
 #define CTF_PM_HEADERDYNAMIC                   
(CTF_PM_HEADERFLAG|(XML_PM_CTF_START + 0x0033))
 #define CTF_PM_HEADERGRAPHICPOSITION   (CTF_PM_HEADERFLAG|(XML_PM_CTF_START + 
0x0034))
-#define CTF_PM_HEADERGRAPHICFILTER             
(CTF_PM_HEADERFLAG|(XML_PM_CTF_START + 0x0035))
-#define CTF_PM_HEADERGRAPHICURL                        
(CTF_PM_HEADERFLAG|(XML_PM_CTF_START + 0x0036))
+#define CTF_PM_HEADERGRAPHICFILTER             
(CTF_PM_HEADERFLAG|(XML_PM_CTF_START + 0x0041))
+#define CTF_PM_HEADERGRAPHICURL                        
(CTF_PM_HEADERFLAG|(XML_PM_CTF_START + 0x0042))
 #define CTF_PM_HEADERMARGINALL          (CTF_PM_HEADERFLAG|CTF_PM_MARGINALL)
 #define CTF_PM_HEADERMARGINTOP          (CTF_PM_HEADERFLAG|CTF_PM_MARGINTOP)
 #define CTF_PM_HEADERMARGINBOTTOM       (CTF_PM_HEADERFLAG|CTF_PM_MARGINBOTTOM)
@@ -164,8 +164,8 @@
 #define CTF_PM_FOOTERMINHEIGHT                 
(CTF_PM_FOOTERFLAG|(XML_PM_CTF_START + 0x0032))
 #define CTF_PM_FOOTERDYNAMIC                   
(CTF_PM_FOOTERFLAG|(XML_PM_CTF_START + 0x0033))
 #define CTF_PM_FOOTERGRAPHICPOSITION   (CTF_PM_FOOTERFLAG|(XML_PM_CTF_START + 
0x0034))
-#define CTF_PM_FOOTERGRAPHICFILTER             
(CTF_PM_FOOTERFLAG|(XML_PM_CTF_START + 0x0035))
-#define CTF_PM_FOOTERGRAPHICURL                        
(CTF_PM_FOOTERFLAG|(XML_PM_CTF_START + 0x0036))
+#define CTF_PM_FOOTERGRAPHICFILTER             
(CTF_PM_FOOTERFLAG|(XML_PM_CTF_START + 0x0041))
+#define CTF_PM_FOOTERGRAPHICURL                        
(CTF_PM_FOOTERFLAG|(XML_PM_CTF_START + 0x0042))
 #define CTF_PM_FOOTERMARGINALL          (CTF_PM_FOOTERFLAG|CTF_PM_MARGINALL)
 #define CTF_PM_FOOTERMARGINTOP          (CTF_PM_FOOTERFLAG|CTF_PM_MARGINTOP)
 #define CTF_PM_FOOTERMARGINBOTTOM       (CTF_PM_FOOTERFLAG|CTF_PM_MARGINBOTTOM)
diff --git a/main/xmloff/source/style/PageMasterExportPropMapper.cxx 
b/main/xmloff/source/style/PageMasterExportPropMapper.cxx
index 571b8bbd07..476014f427 100644
--- a/main/xmloff/source/style/PageMasterExportPropMapper.cxx
+++ b/main/xmloff/source/style/PageMasterExportPropMapper.cxx
@@ -337,6 +337,8 @@ void XMLPageMasterExportPropMapper::ContextFilter(
        XMLPropertyState*               pPMStandardMode         = NULL;
        XMLPropertyState*               pPMGridBaseWidth        = NULL;
        XMLPropertyState*               pPMGridSnapToChars      = NULL;
+       XMLPropertyState*               pPMHeaderGraphicUrl = NULL;
+       XMLPropertyState*               pPMFooterGraphicUrl = NULL;
 
     XMLPropertyState*       pPrint              = NULL;
 
@@ -405,6 +407,8 @@ void XMLPageMasterExportPropMapper::ContextFilter(
             case CTF_PM_STANDARD_MODE:         pPMStandardMode         = 
pProp;        break;
             case CTP_PM_GRID_BASE_WIDTH:               pPMGridBaseWidth        
= pProp;        break;
             case CTP_PM_GRID_SNAP_TO_CHARS:            pPMGridSnapToChars      
= pProp;        break;
+            case CTF_PM_HEADERGRAPHICURL:              pPMHeaderGraphicUrl     
= pProp;        break;
+            case CTF_PM_FOOTERGRAPHICURL:              pPMFooterGraphicUrl     
= pProp;        break;
 
             //UUUU
             case CTF_PM_REPEAT_OFFSET_X:
@@ -527,6 +531,15 @@ void XMLPageMasterExportPropMapper::ContextFilter(
                        lcl_RemoveState(pPMGridSnapToChars);
        }
 
+       // ext output stays as before (the ids once collided with the repeat 
offsets, so none was written)
+       if( SvtSaveOptions().GetODFDefaultVersion() > 
SvtSaveOptions::ODFVER_012 )
+       {
+               if( pPMHeaderGraphicUrl )
+                       lcl_RemoveState(pPMHeaderGraphicUrl);
+               if( pPMFooterGraphicUrl )
+                       lcl_RemoveState(pPMFooterGraphicUrl);
+       }
+
        if( pPMGridBaseWidth && pPMStandardMode )
                lcl_RemoveState(pPMStandardMode);
 

Reply via email to