From 12447b7c70cd1314c35fe7e2ae89078abdd9a4a6 Mon Sep 17 00:00:00 2001 From: Hossein Date: Thu, 16 May 2024 13:19:58 +0200 Subject: Fix odk examples build on 32 bit systems MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It is required to cast integer literals to sal_Int32 when passing them to Any(). Change-Id: I377f88fc3441d8e4bc7afdb2411c1fd140853134 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167739 Tested-by: Jenkins Reviewed-by: René Engelhard Tested-by: René Engelhard --- .../HelloTextTableShape/cxx/HelloTextTableShape.cxx | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'odk/examples/DevelopersGuide/FirstSteps/HelloTextTableShape') diff --git a/odk/examples/DevelopersGuide/FirstSteps/HelloTextTableShape/cxx/HelloTextTableShape.cxx b/odk/examples/DevelopersGuide/FirstSteps/HelloTextTableShape/cxx/HelloTextTableShape.cxx index 3fa9c1b960fc..b9f2a11ae528 100644 --- a/odk/examples/DevelopersGuide/FirstSteps/HelloTextTableShape/cxx/HelloTextTableShape.cxx +++ b/odk/examples/DevelopersGuide/FirstSteps/HelloTextTableShape/cxx/HelloTextTableShape.cxx @@ -171,7 +171,7 @@ void useWriter() //Object table = xIndexedTables.getByIndex(i); Any table = xIndexedTables->getByIndex(i); xTableProps = Reference(table, UNO_QUERY_THROW); - xTableProps->setPropertyValue("BackColor", Any(0xC8FFB9)); + xTableProps->setPropertyValue("BackColor", Any(static_cast(0xC8FFB9))); } } @@ -311,7 +311,7 @@ void manipulateTable(const Reference& xCellRange) xTableProps = Reference(xCellRange, UNO_QUERY_THROW); } // set cell background color - xCellProps->setPropertyValue(backColorPropertyName, Any(0x99CCFF)); + xCellProps->setPropertyValue(backColorPropertyName, Any(static_cast(0x99CCFF))); // set table borders // create description for blue line, width 10 @@ -336,14 +336,14 @@ void manipulateTable(const Reference& xCellRange) void manipulateShape(const Reference& xShape) { Reference xShapeProps = Reference(xShape, UNO_QUERY_THROW); - xShapeProps->setPropertyValue("FillColor", Any(0x99CCFF)); - xShapeProps->setPropertyValue("LineColor", Any(0x000099)); - xShapeProps->setPropertyValue("RotateAngle", Any(3000)); - - xShapeProps->setPropertyValue("TextLeftDistance", Any(0)); - xShapeProps->setPropertyValue("TextRightDistance", Any(0)); - xShapeProps->setPropertyValue("TextUpperDistance", Any(0)); - xShapeProps->setPropertyValue("TextLowerDistance", Any(0)); + xShapeProps->setPropertyValue("FillColor", Any(static_cast(0x99CCFF))); + xShapeProps->setPropertyValue("LineColor", Any(static_cast(0x000099))); + xShapeProps->setPropertyValue("RotateAngle", Any(static_cast(3000))); + + xShapeProps->setPropertyValue("TextLeftDistance", Any(static_cast(0))); + xShapeProps->setPropertyValue("TextRightDistance", Any(static_cast(0))); + xShapeProps->setPropertyValue("TextUpperDistance", Any(static_cast(0))); + xShapeProps->setPropertyValue("TextLowerDistance", Any(static_cast(0))); } Reference newDocComponent(const OUString docType) -- cgit