summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2017-04-06 13:06:29 +0300
committerMichael Stahl <mstahl@redhat.com>2017-04-06 19:03:27 +0000
commit20feed528a9b9d57b35805611a4279000a474c3d (patch)
tree46fa5bc98de39d371a6f6a49ddf736aa33f3a91f /sw
parentd8604338c4b289c01d311b95a5587b250f0d6ff2 (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/36200 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'sw')
-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 7f36628e2164..a431fc812b07 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
@@ -661,6 +661,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 dc8ab99bc126..d63cba52dccf 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -4163,10 +4163,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;