[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - sw/qa sw/source
Justin Luth
justin_luth at sil.org
Fri Apr 7 04:36:37 UTC 2017
sw/qa/extras/ooxmlexport/data/tdf106974_int32Crop.docx |binary
sw/qa/extras/ooxmlexport/ooxmlexport3.cxx | 10 ++++++++++
sw/source/filter/ww8/docxattributeoutput.cxx | 8 ++++----
3 files changed, 14 insertions(+), 4 deletions(-)
New commits:
commit dd3325f0938aeb79221a0bb765b0fbed0fef42e6
Author: Justin Luth <justin_luth at sil.org>
Date: Thu Apr 6 13:06:29 2017 +0300
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 at libreoffice.org>
Reviewed-by: Justin Luth <justin_luth at sil.org>
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
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf106974_int32Crop.docx 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;
More information about the Libreoffice-commits
mailing list