sd: use hexadecimal representation for colors
Change-Id: I7fbed6f2acf7ad7f4bb30514d59521cd9fe2b42f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114136 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
This commit is contained in:
parent
96d60ec785
commit
00f7309fb7
@ -572,7 +572,7 @@ void SdOOXMLExportTest1::testTableCellFillProperties()
|
||||
sal_Int32 nColor;
|
||||
xCell.set(xTable->getCellByPosition(0, 0), uno::UNO_QUERY_THROW);
|
||||
xCell->getPropertyValue("FillColor") >>= nColor;
|
||||
CPPUNIT_ASSERT_EQUAL(sal_Int32(6750207), nColor);
|
||||
CPPUNIT_ASSERT_EQUAL(sal_Int32(0x66ffff), nColor);
|
||||
|
||||
// Test Picture fill type for cell
|
||||
drawing::FillStyle aFillStyle( drawing::FillStyle_NONE );
|
||||
@ -847,26 +847,26 @@ void SdOOXMLExportTest1::testTableCellBorder()
|
||||
sal_Int32 nLeftBorder = aBorderLine.LineWidth * 2;
|
||||
nLeftBorder = oox::drawingml::convertHmmToEmu( nLeftBorder );
|
||||
CPPUNIT_ASSERT(nLeftBorder);
|
||||
CPPUNIT_ASSERT_EQUAL(util::Color(45296), aBorderLine.Color);
|
||||
CPPUNIT_ASSERT_EQUAL(sal_Int32(0xb0f0), aBorderLine.Color);
|
||||
|
||||
xCellPropSet->getPropertyValue("RightBorder") >>= aBorderLine;
|
||||
sal_Int32 nRightBorder = aBorderLine.LineWidth * 2;
|
||||
nRightBorder = oox::drawingml::convertHmmToEmu( nRightBorder );
|
||||
CPPUNIT_ASSERT(nRightBorder);
|
||||
CPPUNIT_ASSERT_EQUAL(util::Color(16777215), aBorderLine.Color);
|
||||
CPPUNIT_ASSERT_EQUAL(sal_Int32(0xffffff), aBorderLine.Color);
|
||||
|
||||
xCellPropSet->getPropertyValue("TopBorder") >>= aBorderLine;
|
||||
sal_Int32 nTopBorder = aBorderLine.LineWidth * 2;
|
||||
nTopBorder = oox::drawingml::convertHmmToEmu( nTopBorder );
|
||||
CPPUNIT_ASSERT(nTopBorder);
|
||||
CPPUNIT_ASSERT_EQUAL(util::Color(45296), aBorderLine.Color);
|
||||
CPPUNIT_ASSERT_EQUAL(sal_Int32(0xb0f0), aBorderLine.Color);
|
||||
|
||||
|
||||
xCellPropSet->getPropertyValue("BottomBorder") >>= aBorderLine;
|
||||
sal_Int32 nBottomBorder = aBorderLine.LineWidth * 2;
|
||||
nBottomBorder = oox::drawingml::convertHmmToEmu( nBottomBorder );
|
||||
CPPUNIT_ASSERT(nBottomBorder);
|
||||
CPPUNIT_ASSERT_EQUAL(util::Color(45296), aBorderLine.Color);
|
||||
CPPUNIT_ASSERT_EQUAL(sal_Int32(0xb0f0), aBorderLine.Color);
|
||||
|
||||
xDocShRef->DoClose();
|
||||
}
|
||||
@ -994,7 +994,7 @@ void SdOOXMLExportTest1::testTdf94238()
|
||||
// Without the accompanying fix in place, this test would have failed with
|
||||
// 'Expected: 0, Actual : 10592673', i.e. the start color of the gradient
|
||||
// was incorrect.
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), aGradient.StartColor);
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0x0), aGradient.StartColor);
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0x8B8B8B), aGradient.EndColor);
|
||||
|
||||
xDocShRef->DoClose();
|
||||
|
@ -659,7 +659,7 @@ void SdOOXMLExportTest2::testTdf80224()
|
||||
|
||||
sal_Int32 nCharColor;
|
||||
xPropSet->getPropertyValue("CharColor") >>= nCharColor;
|
||||
CPPUNIT_ASSERT_EQUAL(sal_Int32(6644396), nCharColor);
|
||||
CPPUNIT_ASSERT_EQUAL(sal_Int32(0x6562ac), nCharColor);
|
||||
xDocShRef->DoClose();
|
||||
}
|
||||
|
||||
@ -1123,8 +1123,8 @@ void SdOOXMLExportTest2::testTdf105739()
|
||||
com::sun::star::awt::Gradient aFillGradient;
|
||||
aXBackgroundPropSet->getPropertyValue("FillGradient") >>= aFillGradient;
|
||||
CPPUNIT_ASSERT_EQUAL(int(awt::GradientStyle_LINEAR), static_cast<int>(aFillGradient.Style));
|
||||
CPPUNIT_ASSERT_EQUAL(util::Color(0xff0000), aFillGradient.StartColor);
|
||||
CPPUNIT_ASSERT_EQUAL(util::Color(0x00b050), aFillGradient.EndColor);
|
||||
CPPUNIT_ASSERT_EQUAL(sal_Int32(0xff0000), aFillGradient.StartColor);
|
||||
CPPUNIT_ASSERT_EQUAL(sal_Int32(0x00b050), aFillGradient.EndColor);
|
||||
}
|
||||
|
||||
xShell->DoClose();
|
||||
|
@ -524,15 +524,15 @@ void SdExportTest::testBnc480256()
|
||||
|
||||
xCell.set(xTable->getCellByPosition(0, 0), uno::UNO_QUERY_THROW);
|
||||
xCell->getPropertyValue("FillColor") >>= nColor;
|
||||
CPPUNIT_ASSERT_EQUAL(sal_Int32(10208238), nColor);
|
||||
CPPUNIT_ASSERT_EQUAL(sal_Int32(0x9bc3ee), nColor);
|
||||
xCell->getPropertyValue("LeftBorder") >>= aBorderLine;
|
||||
CPPUNIT_ASSERT_EQUAL(util::Color(5609427), aBorderLine.Color);
|
||||
CPPUNIT_ASSERT_EQUAL(sal_Int32(0x5597d3), aBorderLine.Color);
|
||||
|
||||
xCell.set(xTable->getCellByPosition(0, 1), uno::UNO_QUERY_THROW);
|
||||
xCell->getPropertyValue("FillColor") >>= nColor;
|
||||
CPPUNIT_ASSERT_EQUAL(sal_Int32(13032959), nColor);
|
||||
CPPUNIT_ASSERT_EQUAL(sal_Int32(0xc6ddff), nColor);
|
||||
xCell->getPropertyValue("TopBorder") >>= aBorderLine;
|
||||
CPPUNIT_ASSERT_EQUAL(util::Color(5609427), aBorderLine.Color);
|
||||
CPPUNIT_ASSERT_EQUAL(sal_Int32(0x5597d3), aBorderLine.Color);
|
||||
|
||||
pTableObj = dynamic_cast<sdr::table::SdrTableObj*>(pPage->GetObj(1));
|
||||
CPPUNIT_ASSERT( pTableObj );
|
||||
@ -540,17 +540,17 @@ void SdExportTest::testBnc480256()
|
||||
|
||||
xCell.set(xTable->getCellByPosition(0, 0), uno::UNO_QUERY_THROW);
|
||||
xCell->getPropertyValue("FillColor") >>= nColor;
|
||||
CPPUNIT_ASSERT_EQUAL(sal_Int32(7056614), nColor);
|
||||
CPPUNIT_ASSERT_EQUAL(sal_Int32(0x6bace6), nColor);
|
||||
xCell->getPropertyValue("LeftBorder") >>= aBorderLine;
|
||||
CPPUNIT_ASSERT_EQUAL(util::Color(12505062), aBorderLine.Color);
|
||||
CPPUNIT_ASSERT_EQUAL(sal_Int32(0xbecfe6), aBorderLine.Color);
|
||||
|
||||
xCell.set(xTable->getCellByPosition(0, 1), uno::UNO_QUERY_THROW);
|
||||
xCell->getPropertyValue("FillColor") >>= nColor;
|
||||
CPPUNIT_ASSERT_EQUAL(sal_Int32(4626400), nColor);
|
||||
CPPUNIT_ASSERT_EQUAL(sal_Int32(0x4697e0), nColor);
|
||||
|
||||
xCell.set(xTable->getCellByPosition(1, 0), uno::UNO_QUERY_THROW);
|
||||
xCell->getPropertyValue("BottomBorder") >>= aBorderLine;
|
||||
CPPUNIT_ASSERT_EQUAL(util::Color(COL_AUTO), aBorderLine.Color);
|
||||
CPPUNIT_ASSERT_EQUAL(sal_Int32(COL_AUTO), aBorderLine.Color);
|
||||
|
||||
xDocShRef->DoClose();
|
||||
}
|
||||
|
@ -461,9 +461,9 @@ void SdImportTest::testHyperlinkColor()
|
||||
xPropSet3->getPropertyValue( "CharColor" ) >>= nCharColorGreen;
|
||||
|
||||
// Hyperlink colors should be blue, red, green.
|
||||
CPPUNIT_ASSERT_EQUAL( sal_Int32(4485828), nCharColorBlue );
|
||||
CPPUNIT_ASSERT_EQUAL( sal_Int32(16711680), nCharColorRed );
|
||||
CPPUNIT_ASSERT_EQUAL( sal_Int32(5538357), nCharColorGreen );
|
||||
CPPUNIT_ASSERT_EQUAL( sal_Int32(0x4472c4), nCharColorBlue );
|
||||
CPPUNIT_ASSERT_EQUAL( sal_Int32(0xff0000), nCharColorRed );
|
||||
CPPUNIT_ASSERT_EQUAL( sal_Int32(0x548235), nCharColorGreen );
|
||||
|
||||
xDocShRef->DoClose();
|
||||
}
|
||||
@ -749,7 +749,7 @@ void SdImportTest::testFdo68594()
|
||||
const SvxColorItem *pC = &pTxtObj->GetMergedItem(EE_CHAR_COLOR);
|
||||
CPPUNIT_ASSERT_MESSAGE( "no color item", pC != nullptr);
|
||||
// Color should be black
|
||||
CPPUNIT_ASSERT_EQUAL_MESSAGE( "Placeholder color mismatch", sal_uInt32(0), sal_uInt32(pC->GetValue()) );
|
||||
CPPUNIT_ASSERT_EQUAL_MESSAGE( "Placeholder color mismatch", sal_uInt32(0x0), sal_uInt32(pC->GetValue()) );
|
||||
|
||||
xDocShRef->DoClose();
|
||||
}
|
||||
@ -1037,15 +1037,15 @@ void SdImportTest::testPredefinedTableStyle()
|
||||
|
||||
xCell.set(xTable->getCellByPosition(0, 0), uno::UNO_QUERY_THROW);
|
||||
xCell->getPropertyValue("FillColor") >>= nColor;
|
||||
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), nColor);
|
||||
CPPUNIT_ASSERT_EQUAL(sal_Int32(0x0), nColor);
|
||||
|
||||
xCell.set(xTable->getCellByPosition(0, 1), uno::UNO_QUERY_THROW);
|
||||
xCell->getPropertyValue("FillColor") >>= nColor;
|
||||
CPPUNIT_ASSERT_EQUAL(sal_Int32(13421772), nColor);
|
||||
CPPUNIT_ASSERT_EQUAL(sal_Int32(0xcccccc), nColor);
|
||||
|
||||
xCell.set(xTable->getCellByPosition(0, 2), uno::UNO_QUERY_THROW);
|
||||
xCell->getPropertyValue("FillColor") >>= nColor;
|
||||
CPPUNIT_ASSERT_EQUAL(sal_Int32(15198183), nColor);
|
||||
CPPUNIT_ASSERT_EQUAL(sal_Int32(0xe7e7e7), nColor);
|
||||
|
||||
xDocShRef->DoClose();
|
||||
}
|
||||
@ -1066,31 +1066,31 @@ void SdImportTest::testBnc887225()
|
||||
|
||||
xCell.set(xTable->getCellByPosition(0, 0), uno::UNO_QUERY_THROW);
|
||||
xCell->getPropertyValue("FillColor") >>= nColor;
|
||||
CPPUNIT_ASSERT_EQUAL(sal_Int32(6003669), nColor);
|
||||
CPPUNIT_ASSERT_EQUAL(sal_Int32(0x5b9bd5), nColor);
|
||||
|
||||
xCell.set(xTable->getCellByPosition(0, 1), uno::UNO_QUERY_THROW);
|
||||
xCell->getPropertyValue("FillColor") >>= nColor;
|
||||
CPPUNIT_ASSERT_EQUAL(sal_Int32(6003669), nColor);
|
||||
CPPUNIT_ASSERT_EQUAL(sal_Int32(0x5b9bd5), nColor);
|
||||
|
||||
xCell.set(xTable->getCellByPosition(1, 1), uno::UNO_QUERY_THROW);
|
||||
xCell->getPropertyValue("FillColor") >>= nColor;
|
||||
CPPUNIT_ASSERT_EQUAL(sal_Int32(13754095), nColor);
|
||||
CPPUNIT_ASSERT_EQUAL(sal_Int32(0xd1deef), nColor);
|
||||
|
||||
xCell.set(xTable->getCellByPosition(1, 2), uno::UNO_QUERY_THROW);
|
||||
xCell->getPropertyValue("FillColor") >>= nColor;
|
||||
CPPUNIT_ASSERT_EQUAL(sal_Int32(15331319), nColor);
|
||||
CPPUNIT_ASSERT_EQUAL(sal_Int32(0xe9eff7), nColor);
|
||||
|
||||
xCell.set(xTable->getCellByPosition(1, 4), uno::UNO_QUERY_THROW);
|
||||
xCell->getPropertyValue("FillColor") >>= nColor;
|
||||
CPPUNIT_ASSERT_EQUAL(sal_Int32(6003669), nColor);
|
||||
CPPUNIT_ASSERT_EQUAL(sal_Int32(0x5b9bd5), nColor);
|
||||
|
||||
xCell.set(xTable->getCellByPosition(3, 2), uno::UNO_QUERY_THROW);
|
||||
xCell->getPropertyValue("FillColor") >>= nColor;
|
||||
CPPUNIT_ASSERT_EQUAL(sal_Int32(6003669), nColor);
|
||||
CPPUNIT_ASSERT_EQUAL(sal_Int32(0x5b9bd5), nColor);
|
||||
|
||||
xCell.set(xTable->getCellByPosition(3, 4), uno::UNO_QUERY_THROW);
|
||||
xCell->getPropertyValue("FillColor") >>= nColor;
|
||||
CPPUNIT_ASSERT_EQUAL(sal_Int32(6003669), nColor);
|
||||
CPPUNIT_ASSERT_EQUAL(sal_Int32(0x5b9bd5), nColor);
|
||||
|
||||
xDocShRef->DoClose();
|
||||
}
|
||||
@ -1531,7 +1531,7 @@ void SdImportTest::testBnc910045()
|
||||
|
||||
xCell.set(xTable->getCellByPosition(0, 0), uno::UNO_QUERY_THROW);
|
||||
xCell->getPropertyValue("FillColor") >>= nColor;
|
||||
CPPUNIT_ASSERT_EQUAL(sal_Int32(5210557), nColor);
|
||||
CPPUNIT_ASSERT_EQUAL(sal_Int32(0x4f81bd), nColor);
|
||||
|
||||
xDocShRef->DoClose();
|
||||
}
|
||||
@ -2812,7 +2812,7 @@ void SdImportTest::testTdf134174()
|
||||
|
||||
Graphic aGraphic(xGraphic);
|
||||
BitmapEx aBitmap(aGraphic.GetBitmapEx());
|
||||
CPPUNIT_ASSERT_EQUAL( Color(9118171), aBitmap.GetPixelColor( 0, 0 ));
|
||||
CPPUNIT_ASSERT_EQUAL( Color(0x8b21db), aBitmap.GetPixelColor( 0, 0 ));
|
||||
|
||||
xDocShRef->DoClose();
|
||||
}
|
||||
@ -2829,7 +2829,7 @@ void SdImportTest::testTdf134210()
|
||||
|
||||
Graphic aGraphic(xGraphic);
|
||||
BitmapEx aBitmap(aGraphic.GetBitmapEx());
|
||||
CPPUNIT_ASSERT_EQUAL( Color(6313534), aBitmap.GetPixelColor( 0, 0 ));
|
||||
CPPUNIT_ASSERT_EQUAL( Color(0x60563e), aBitmap.GetPixelColor( 0, 0 ));
|
||||
|
||||
xDocShRef->DoClose();
|
||||
}
|
||||
@ -3382,7 +3382,7 @@ void SdImportTest::testMirroredGraphic()
|
||||
CPPUNIT_ASSERT(xGraphic.is());
|
||||
Graphic aGraphic(xGraphic);
|
||||
BitmapEx aBitmap(aGraphic.GetBitmapEx());
|
||||
CPPUNIT_ASSERT_EQUAL( Color(5196117), aBitmap.GetPixelColor( 0, 0 ));
|
||||
CPPUNIT_ASSERT_EQUAL( Color(0x4f4955), aBitmap.GetPixelColor( 0, 0 ));
|
||||
xDocShRef->DoClose();
|
||||
}
|
||||
|
||||
@ -3397,7 +3397,7 @@ void SdImportTest::testTdf134210CropPosition()
|
||||
CPPUNIT_ASSERT(xGraphic.is());
|
||||
Graphic aGraphic(xGraphic);
|
||||
BitmapEx aBitmap(aGraphic.GetBitmapEx());
|
||||
CPPUNIT_ASSERT_EQUAL( Color(8508442), aBitmap.GetPixelColor( 0, 0 ));
|
||||
CPPUNIT_ASSERT_EQUAL( Color(0x81d41a), aBitmap.GetPixelColor( 0, 0 ));
|
||||
xDocShRef->DoClose();
|
||||
}
|
||||
|
||||
@ -3411,7 +3411,7 @@ void SdImportTest::testGreysScaleGraphic()
|
||||
CPPUNIT_ASSERT(xGraphic.is());
|
||||
Graphic aGraphic(xGraphic);
|
||||
BitmapEx aBitmap(aGraphic.GetBitmapEx());
|
||||
CPPUNIT_ASSERT_EQUAL( Color(3947580), aBitmap.GetPixelColor( 0, 0 ));
|
||||
CPPUNIT_ASSERT_EQUAL( Color(0x3c3c3c), aBitmap.GetPixelColor( 0, 0 ));
|
||||
xDocShRef->DoClose();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user