sw/qa/extras/ww8export/ww8export3.cxx |    7 +++++++
 sw/source/filter/ww8/wrtw8esh.cxx     |    5 +++--
 2 files changed, 10 insertions(+), 2 deletions(-)

New commits:
commit 589ac948c0650a16c734db7337c6c31b950be151
Author:     Justin Luth <justin.l...@collabora.com>
AuthorDate: Mon Feb 26 09:56:11 2024 -0500
Commit:     Justin Luth <jl...@mail.com>
CommitDate: Mon Feb 26 17:16:55 2024 +0100

    related tdf#126533 doc export: don't lose "tiled" aspect of image fill.
    
    This affects patterns as well as textures/images.
    
    make CppunitTest_sw_ww8export3 
CPPUNIT_TEST_NAME=testTdf101826_xattrTextBoxFill
    
    Change-Id: I2742a6f333fc6688b3570772a1dbc8371741f210
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163948
    Tested-by: Jenkins
    Reviewed-by: Justin Luth <jl...@mail.com>

diff --git a/sw/qa/extras/ww8export/ww8export3.cxx 
b/sw/qa/extras/ww8export/ww8export3.cxx
index 97ea979d01e8..66c5ae5c471c 100644
--- a/sw/qa/extras/ww8export/ww8export3.cxx
+++ b/sw/qa/extras/ww8export/ww8export3.cxx
@@ -11,6 +11,7 @@
 
 #include <com/sun/star/beans/XPropertySet.hpp>
 #include <com/sun/star/container/XIndexAccess.hpp>
+#include <com/sun/star/drawing/BitmapMode.hpp>
 #include <com/sun/star/drawing/FillStyle.hpp>
 #include <com/sun/star/drawing/LineDash.hpp>
 #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
@@ -621,6 +622,12 @@ DECLARE_WW8EXPORT_TEST(testTdf101826_xattrTextBoxFill, 
"tdf101826_xattrTextBoxFi
     CPPUNIT_ASSERT_MESSAGE("background color", Color(0xFF, 0xFF, 0x00) != 
getProperty<Color>(getShape(4), "BackColor"));
     //Basic Picture Fill: Tux image
     CPPUNIT_ASSERT_EQUAL_MESSAGE("background image", 
drawing::FillStyle_BITMAP, getProperty<drawing::FillStyle>(getShape(5), 
"FillStyle"));
+    // Basic Pattern fill: many thin, green, vertical stripes on yellow 
background
+    auto eMode = getProperty<drawing::BitmapMode>(getShapeByName(u"Frame2"), 
"FillBitmapMode");
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("tiled pattern", drawing::BitmapMode_REPEAT, 
eMode);
+    // Basic Texture fill: tiled blue denim texture
+    eMode = getProperty<drawing::BitmapMode>(getShapeByName(u"Frame6"), 
"FillBitmapMode");
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("tiled texture", drawing::BitmapMode_REPEAT, 
eMode);
 }
 
 DECLARE_WW8EXPORT_TEST(testTdf123433_fillStyleStop, 
"tdf123433_fillStyleStop.doc")
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx 
b/sw/source/filter/ww8/wrtw8esh.cxx
index 7931387e32fa..55c140e2a7c9 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -1849,8 +1849,9 @@ void SwBasicEscherEx::WriteBrushAttr(const SvxBrushItem 
&rBrush,
         nOpaque = 255 - pGraphicObject->GetAttr().GetAlpha();
         if (0 != nOpaque)
             bSetOpacity = true;
-
-        rPropOpt.AddOpt( ESCHER_Prop_fillType, ESCHER_FillPicture );
+        const ESCHER_FillStyle eFillType
+            = rBrush.GetGraphicPos() == GPOS_TILED ? ESCHER_FillTexture : 
ESCHER_FillPicture;
+        rPropOpt.AddOpt(ESCHER_Prop_fillType, eFillType);
         rPropOpt.AddOpt( ESCHER_Prop_fNoFillHitTest, 0x140014 );
         rPropOpt.AddOpt( ESCHER_Prop_fillBackColor, 0 );
     }

Reply via email to