oox/source/drawingml/fillproperties.cxx                     |    5 +----
 sw/qa/extras/ooxmlexport/data/tdf141652_fillBitmapName.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport6.cxx                   |   10 ++++++++++
 3 files changed, 11 insertions(+), 4 deletions(-)

New commits:
commit 18cc1240565e697859dd7d17058f91d5e01df929
Author:     Justin Luth <justin_l...@sil.org>
AuthorDate: Mon Jan 10 20:42:17 2022 +0200
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Tue Feb 1 13:31:33 2022 +0100

    tdf#141652 partial revert "Reset ShapeProperty priority...
    
    ... and handle only crop case."
    
    This reverts a portion of a tdf#134210 related, LO 7.2/7.1.2ish
    commit b90a67838e189f3aee6a50724c78c0a50d416970
    that was introduced for no apparent reason.
    
    I have no understanding about shapes, and so
    I have no idea why setting FillBitmap to an xGraphic
    is different from setting it to a name, but it makes
    a huge difference on the image size,
    and the crop values aren't scaled to the reduced size.
    
    Since this section of code looks like a cut/paste
    relic of early stages of developing the fix,
    lets just revert this portion since the original
    author has made no response at all to the regression report.
    
    Change-Id: I9488c419ceb41bd4ebd7b10494a52fb816654832
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128260
    Tested-by: Jenkins
    Reviewed-by: Justin Luth <jl...@mail.com>

diff --git a/oox/source/drawingml/fillproperties.cxx 
b/oox/source/drawingml/fillproperties.cxx
index 6a60a685c84f..480bbe641737 100644
--- a/oox/source/drawingml/fillproperties.cxx
+++ b/oox/source/drawingml/fillproperties.cxx
@@ -789,10 +789,7 @@ void FillProperties::pushToPropMap( ShapePropertyMap& 
rPropMap,
                             if(bIsCustomShape && bHasCropValues && bNeedCrop)
                             {
                                 xGraphic = lclCropGraphic(xGraphic, aFillRect);
-                                if 
(rPropMap.supportsProperty(ShapeProperty::FillBitmapName))
-                                    
rPropMap.setProperty(ShapeProperty::FillBitmapName, xGraphic);
-                                else
-                                    
rPropMap.setProperty(ShapeProperty::FillBitmap, xGraphic);
+                                
rPropMap.setProperty(ShapeProperty::FillBitmap, xGraphic);
                             }
                         }
                     }
diff --git a/sw/qa/extras/ooxmlexport/data/tdf141652_fillBitmapName.docx 
b/sw/qa/extras/ooxmlexport/data/tdf141652_fillBitmapName.docx
new file mode 100644
index 000000000000..4a47a544d6bb
Binary files /dev/null and 
b/sw/qa/extras/ooxmlexport/data/tdf141652_fillBitmapName.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx
index cb8d8b4cb4c7..e79b531b39ac 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx
@@ -282,6 +282,16 @@ DECLARE_OOXMLEXPORT_TEST(testDMLShapeFillBitmapCrop, 
"dml-shape-fillbitmapcrop.d
 
 }
 
+DECLARE_OOXMLEXPORT_TEST(test141652_fillBitmapName, 
"tdf141652_fillBitmapName.docx")
+{
+    text::GraphicCrop aGraphicCropStruct = 
getProperty<text::GraphicCrop>(getShape(1), "GraphicCrop");
+    CPPUNIT_ASSERT_DOUBLES_EQUAL( sal_Int32(-769), aGraphicCropStruct.Right, 
10);
+
+    CPPUNIT_ASSERT_EQUAL( sal_Int32( 0 ), aGraphicCropStruct.Left );
+    CPPUNIT_ASSERT_EQUAL( sal_Int32( 0 ), aGraphicCropStruct.Top );
+    CPPUNIT_ASSERT_EQUAL( sal_Int32( 0 ), aGraphicCropStruct.Bottom );
+}
+
 DECLARE_OOXMLEXPORT_TEST(testDMLShapeFillPattern, "dml-shape-fillpattern.docx")
 {
     // Hatching was ignored by the export.

Reply via email to