writerfilter/source/rtftok/rtfsdrimport.cxx |   19 +++++++------------
 1 file changed, 7 insertions(+), 12 deletions(-)

New commits:
commit fe84ced08668ef0030fbd37bea52424fd86c8e7a
Author:     Justin Luth <justin.l...@collabora.com>
AuthorDate: Fri Feb 9 13:40:10 2024 -0500
Commit:     Justin Luth <jl...@mail.com>
CommitDate: Sat Feb 24 13:14:03 2024 +0100

    tdf#126533 rtf import: page background fill
    
    I worked on this mainly to see what the impact of the
    docx changes would be on RTF.
    It seemed to be OK. This patch shows that RTF
    can now import gradient page backgrounds.
    
    It does NOT import image backgrounds
    (at least no the ones I tested)
    because they were specified as
        XML_sn: fillBlip
        XML_sv: <shape_as_text_string>
    which is an unknown property in RTFSdrImport::resolve.
    
    The only fill type that RTFSdrImport::resolve knows about
    is XML_gradient.
    
    The only existing unit test I noted was
    page-background.rtf
    
    Change-Id: Ie40b91468d21b29a102472c859cd1eecfcb2a5f7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163199
    Tested-by: Jenkins
    Reviewed-by: Justin Luth <jl...@mail.com>

diff --git a/writerfilter/source/rtftok/rtfsdrimport.cxx 
b/writerfilter/source/rtftok/rtfsdrimport.cxx
index 031f24117d00..9c673e871835 100644
--- a/writerfilter/source/rtftok/rtfsdrimport.cxx
+++ b/writerfilter/source/rtftok/rtfsdrimport.cxx
@@ -1136,18 +1136,6 @@ void RTFSdrImport::resolve(RTFShape& rShape, bool 
bClose, ShapeOrPict const shap
         return;
     }
 
-    if (m_rImport.isInBackground())
-    {
-        RTFSprms aAttributes;
-        aAttributes.set(NS_ooxml::LN_CT_Background_color,
-                        new 
RTFValue(xPropertySet->getPropertyValue("FillColor").get<sal_Int32>()));
-        m_rImport.Mapper().props(new 
RTFReferenceProperties(std::move(aAttributes)));
-
-        uno::Reference<lang::XComponent> xComponent(xShape, uno::UNO_QUERY);
-        xComponent->dispose();
-        return;
-    }
-
     // Send it to dmapper
     if (xShape.is())
     {
@@ -1158,6 +1146,13 @@ void RTFSdrImport::resolve(RTFShape& rShape, bool 
bClose, ShapeOrPict const shap
         }
     }
 
+    if (m_rImport.isInBackground())
+    {
+        RTFSprms aSprms;
+        aSprms.set(NS_ooxml::LN_background_background, new RTFValue()); // 
action="end"
+        m_rImport.Mapper().props(new RTFReferenceProperties(RTFSprms(), 
std::move(aSprms)));
+    }
+
     // If the shape has an inner shape, the inner object's properties should 
not be influenced by
     // the outer one.
     rShape.getProperties().clear();

Reply via email to