summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2017-04-06 13:06:29 +0300
committerJustin Luth <justin_luth@sil.org>2017-04-07 04:36:10 +0000
commitdd3325f0938aeb79221a0bb765b0fbed0fef42e6 (patch)
tree6c5aad6c6d2115ce69c41c5ddf1e4b4433d311bb
parentbb8b699f217dd0d0f25e4efb37ef5380074c61ca (diff)
tdf#106974 docx export: Crop is "long", not sal_Int16
I got size sal_Int16 from the return value type of the border spacing, but somehow failed to lookup the return value of GraphicCrop. It now matches .doc export's sal_Int32. Bad mistake: regression 8eff1decd91cbfb10094c25d4cf1d2b434a4da72 Change-Id: Ie149630b9da9a067de319149f23ca21f78a186cf Reviewed-on: https://gerrit.libreoffice.org/36231 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org>
-rwxr-xr-xsw/qa/extras/ooxmlexport/data/tdf106974_int32Crop.docxbin0 -> 374376 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport3.cxx10
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx8
3 files changed, 14 insertions, 4 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf106974_int32Crop.docx b/sw/qa/extras/ooxmlexport/data/tdf106974_int32Crop.docx
new file mode 100755
index 000000000000..e73cf5e28dcf
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf106974_int32Crop.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
index e5e4880556c4..08fafb1f25b3 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
@@ -629,6 +629,16 @@ DECLARE_OOXMLEXPORT_TEST(testImageCrop, "ImageCrop.docx")
CPPUNIT_ASSERT_EQUAL( sal_Int32( 2291 ), aGraphicCropStruct.Bottom );
}
+DECLARE_OOXMLEXPORT_TEST(testTdf106974_int32Crop, "tdf106974_int32Crop.docx")
+{
+ uno::Reference<drawing::XShape> image = getShape(1);
+ uno::Reference<beans::XPropertySet> imageProperties(image, uno::UNO_QUERY);
+ css::text::GraphicCrop aGraphicCropStruct;
+
+ imageProperties->getPropertyValue( "GraphicCrop" ) >>= aGraphicCropStruct;
+ CPPUNIT_ASSERT( sal_Int32( 46000 ) < aGraphicCropStruct.Right );
+}
+
DECLARE_OOXMLEXPORT_TEST(testLineSpacingexport, "test_line_spacing.docx")
{
// The Problem was that the w:line attribute value in w:spacing tag was incorrect
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 1b6b786c8b7f..845fac3cf733 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -4140,10 +4140,10 @@ void DocxAttributeOutput::WriteSrcRect(const SdrObject* pSdrObj, const SwFrameFo
css::text::GraphicCrop aGraphicCropStruct;
xPropSet->getPropertyValue( "GraphicCrop" ) >>= aGraphicCropStruct;
- sal_Int16 nCropL = aGraphicCropStruct.Left;
- sal_Int16 nCropR = aGraphicCropStruct.Right;
- sal_Int16 nCropT = aGraphicCropStruct.Top;
- sal_Int16 nCropB = aGraphicCropStruct.Bottom;
+ sal_Int32 nCropL = aGraphicCropStruct.Left;
+ sal_Int32 nCropR = aGraphicCropStruct.Right;
+ sal_Int32 nCropT = aGraphicCropStruct.Top;
+ sal_Int32 nCropB = aGraphicCropStruct.Bottom;
// simulate border padding as a negative crop.
const SfxPoolItem* pItem;