summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2021-04-22 16:38:09 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2021-04-22 21:25:44 +0200
commita7d862560e273442891432a88dff9a320c80575a (patch)
treea25d86e388acb25cff75d08184fc56fd36d8d75d
parent89515908f14f8f90e6dcb2ffcdcf2eb42e3394e6 (diff)
sd/qa: some sal_Int32 -> Color conversions
When they fail, the output is human readable Since a080727522e04b8e1fc1641c892af9227d2e8dad < sd: improve output when asserting colors > Change-Id: I5dc943fc6076879b5bf56575c0e0c3ceb10b85d7 Change-Id: Ia25ef5e066673a55a1c5b3ec38772d2a1ea8e420 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114489 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
-rw-r--r--sd/qa/unit/activex-controls-tests.cxx126
-rw-r--r--sd/qa/unit/export-tests-ooxml1.cxx8
-rw-r--r--sd/qa/unit/export-tests-ooxml2.cxx36
-rw-r--r--sd/qa/unit/export-tests.cxx27
-rw-r--r--sd/qa/unit/import-tests-smartart.cxx33
-rw-r--r--sd/qa/unit/import-tests.cxx68
6 files changed, 152 insertions, 146 deletions
diff --git a/sd/qa/unit/activex-controls-tests.cxx b/sd/qa/unit/activex-controls-tests.cxx
index 8d595a8b1451..4adbea72b516 100644
--- a/sd/qa/unit/activex-controls-tests.cxx
+++ b/sd/qa/unit/activex-controls-tests.cxx
@@ -65,7 +65,7 @@ void SdActiveXControlsTest::testBackgroundColor()
// Check whether all system colors are imported correctly
sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/control_background_color.pptx"), PPTX);
- const std::vector<sal_Int32> vBackgroundColors =
+ const std::vector<Color> vBackgroundColors =
{
0xD4D0C8, // Scroll Bars
0x004E98, // Desktop
@@ -100,7 +100,7 @@ void SdActiveXControlsTest::testBackgroundColor()
uno::Reference< drawing::XControlShape > xControlShape(getShapeFromPage(i, 0, xDocShRef), uno::UNO_QUERY_THROW);
uno::Reference<beans::XPropertySet> xPropertySet(xControlShape->getControl(), uno::UNO_QUERY);
- sal_Int32 nColor;
+ Color nColor;
xPropertySet->getPropertyValue("BackgroundColor") >>= nColor;
OString sMessage = "The wrong control's index is: " + OString::number(i);
CPPUNIT_ASSERT_EQUAL_MESSAGE(sMessage.getStr(), vBackgroundColors[i], nColor);
@@ -129,12 +129,12 @@ void SdActiveXControlsTest::testLabelProperties()
xPropertySet->getPropertyValue("MultiLine") >>= bMultiLine;
CPPUNIT_ASSERT_EQUAL(true, bMultiLine);
- sal_Int32 nColor;
+ Color nColor;
xPropertySet->getPropertyValue("TextColor") >>= nColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0x000000), nColor);
+ CPPUNIT_ASSERT_EQUAL(COL_BLACK, nColor);
xPropertySet->getPropertyValue("BackgroundColor") >>= nColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0xFFFFFF), nColor);
+ CPPUNIT_ASSERT_EQUAL(COL_WHITE, nColor);
sal_Int16 nBorderStyle;
xPropertySet->getPropertyValue("Border") >>= nBorderStyle;
@@ -162,17 +162,17 @@ void SdActiveXControlsTest::testLabelProperties()
CPPUNIT_ASSERT_EQUAL(false, bMultiLine);
xPropertySet->getPropertyValue("TextColor") >>= nColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0xE0E0E0), nColor);
+ CPPUNIT_ASSERT_EQUAL(Color(0xE0E0E0), nColor);
xPropertySet->getPropertyValue("BackgroundColor") >>= nColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0x0000FF), nColor);
+ CPPUNIT_ASSERT_EQUAL(Color(0x0000FF), nColor);
xPropertySet->getPropertyValue("Border") >>= nBorderStyle;
CPPUNIT_ASSERT_EQUAL(sal_Int16(2), nBorderStyle);
- sal_Int32 nBorderColor;
+ Color nBorderColor;
xPropertySet->getPropertyValue("BorderColor") >>= nBorderColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0x00FF00), nBorderColor);
+ CPPUNIT_ASSERT_EQUAL(Color(0x00FF00), nBorderColor);
xPropertySet->getPropertyValue("Align") >>= nAlign;
CPPUNIT_ASSERT_EQUAL(sal_Int16(awt::TextAlign::CENTER), nAlign);
@@ -209,12 +209,12 @@ void SdActiveXControlsTest::testTextBoxProperties()
xPropertySet->getPropertyValue("MultiLine") >>= bMultiLine;
CPPUNIT_ASSERT_EQUAL(false, bMultiLine);
- sal_Int32 nColor;
+ Color nColor;
xPropertySet->getPropertyValue("TextColor") >>= nColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0x000000), nColor);
+ CPPUNIT_ASSERT_EQUAL(COL_BLACK, nColor);
xPropertySet->getPropertyValue("BackgroundColor") >>= nColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0xFFFFFF), nColor);
+ CPPUNIT_ASSERT_EQUAL(COL_WHITE, nColor);
sal_Int16 nBorderStyle;
xPropertySet->getPropertyValue("Border") >>= nBorderStyle;
@@ -266,10 +266,10 @@ void SdActiveXControlsTest::testTextBoxProperties()
CPPUNIT_ASSERT_EQUAL(false, bMultiLine);
xPropertySet->getPropertyValue("TextColor") >>= nColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0x404040), nColor);
+ CPPUNIT_ASSERT_EQUAL(Color(0x404040), nColor);
xPropertySet->getPropertyValue("BackgroundColor") >>= nColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0x00C000), nColor);
+ CPPUNIT_ASSERT_EQUAL(Color(0x00C000), nColor);
xPropertySet->getPropertyValue("Border") >>= nBorderStyle;
CPPUNIT_ASSERT_EQUAL(sal_Int16(2), nBorderStyle);
@@ -338,9 +338,9 @@ void SdActiveXControlsTest::testSpinButtonProperties()
xPropertySet->getPropertyValue("Enabled") >>= bEnabled;
CPPUNIT_ASSERT_EQUAL(true, bEnabled);
- sal_Int32 nColor;
+ Color nColor;
xPropertySet->getPropertyValue("BackgroundColor") >>= nColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0xECE9D8), nColor);
+ CPPUNIT_ASSERT_EQUAL(Color(0xECE9D8), nColor);
sal_Int32 nMax;
xPropertySet->getPropertyValue("SpinValueMax") >>= nMax;
@@ -362,9 +362,9 @@ void SdActiveXControlsTest::testSpinButtonProperties()
xPropertySet->getPropertyValue("RepeatDelay") >>= nDelay;
CPPUNIT_ASSERT_EQUAL(sal_Int32(50), nDelay);
- sal_Int32 nArrowColor;
+ Color nArrowColor;
xPropertySet->getPropertyValue("SymbolColor") >>= nArrowColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0x000000), nArrowColor);
+ CPPUNIT_ASSERT_EQUAL(COL_BLACK, nArrowColor);
sal_Int32 nOrientation;
xPropertySet->getPropertyValue("Orientation") >>= nOrientation;
@@ -382,7 +382,7 @@ void SdActiveXControlsTest::testSpinButtonProperties()
CPPUNIT_ASSERT_EQUAL(false, bEnabled);
xPropertySet->getPropertyValue("BackgroundColor") >>= nColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0xFFFF00), nColor);
+ CPPUNIT_ASSERT_EQUAL(Color(0xFFFF00), nColor);
xPropertySet->getPropertyValue("SpinValueMax") >>= nMax;
CPPUNIT_ASSERT_EQUAL(sal_Int32(320), nMax);
@@ -400,7 +400,7 @@ void SdActiveXControlsTest::testSpinButtonProperties()
CPPUNIT_ASSERT_EQUAL(sal_Int32(123), nDelay);
xPropertySet->getPropertyValue("SymbolColor") >>= nArrowColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0x00FF00), nArrowColor);
+ CPPUNIT_ASSERT_EQUAL(Color(0x00FF00), nArrowColor);
xPropertySet->getPropertyValue("Orientation") >>= nOrientation;
CPPUNIT_ASSERT_EQUAL(sal_Int32(awt::ScrollBarOrientation::VERTICAL), nOrientation);
@@ -438,12 +438,12 @@ void SdActiveXControlsTest::testCommandButtonProperties()
xPropertySet->getPropertyValue("MultiLine") >>= bMultiLine;
CPPUNIT_ASSERT_EQUAL(false, bMultiLine);
- sal_Int32 nColor;
+ Color nColor;
xPropertySet->getPropertyValue("BackgroundColor") >>= nColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0xECE9D8), nColor);
+ CPPUNIT_ASSERT_EQUAL(Color(0xECE9D8), nColor);
xPropertySet->getPropertyValue("TextColor") >>= nColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0x000000), nColor);
+ CPPUNIT_ASSERT_EQUAL(COL_BLACK, nColor);
bool bFocusOnClick;
xPropertySet->getPropertyValue("FocusOnClick") >>= bFocusOnClick;
@@ -467,10 +467,10 @@ void SdActiveXControlsTest::testCommandButtonProperties()
CPPUNIT_ASSERT_EQUAL(true, bMultiLine);
xPropertySet->getPropertyValue("BackgroundColor") >>= nColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0x0000FF), nColor);
+ CPPUNIT_ASSERT_EQUAL(Color(0x0000FF), nColor);
xPropertySet->getPropertyValue("TextColor") >>= nColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0xFFFF80), nColor);
+ CPPUNIT_ASSERT_EQUAL(Color(0xFFFF80), nColor);
xPropertySet->getPropertyValue("FocusOnClick") >>= bFocusOnClick;
CPPUNIT_ASSERT_EQUAL(false, bFocusOnClick);
@@ -484,7 +484,7 @@ void SdActiveXControlsTest::testCommandButtonProperties()
// Transparent background
xPropertySet->getPropertyValue("BackgroundColor") >>= nColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0xFFFFFF), nColor);
+ CPPUNIT_ASSERT_EQUAL(COL_WHITE, nColor);
xDocShRef->DoClose();
}
@@ -501,12 +501,12 @@ void SdActiveXControlsTest::testScrollBarProperties()
xPropertySet->getPropertyValue("Enabled") >>= bEnabled;
CPPUNIT_ASSERT_EQUAL(true, bEnabled);
- sal_Int32 nColor;
+ Color nColor;
xPropertySet->getPropertyValue("BackgroundColor") >>= nColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0xECE9D8), nColor);
+ CPPUNIT_ASSERT_EQUAL(Color(0xECE9D8), nColor);
xPropertySet->getPropertyValue("SymbolColor") >>= nColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0x000000), nColor);
+ CPPUNIT_ASSERT_EQUAL(COL_BLACK, nColor);
sal_Int32 nDelay;
xPropertySet->getPropertyValue("RepeatDelay") >>= nDelay;
@@ -552,10 +552,10 @@ void SdActiveXControlsTest::testScrollBarProperties()
CPPUNIT_ASSERT_EQUAL(false, bEnabled);
xPropertySet->getPropertyValue("BackgroundColor") >>= nColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0x00FFFF), nColor);
+ CPPUNIT_ASSERT_EQUAL(Color(0x00FFFF), nColor);
xPropertySet->getPropertyValue("SymbolColor") >>= nColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0xFF0000), nColor);
+ CPPUNIT_ASSERT_EQUAL(Color(0xFF0000), nColor);
xPropertySet->getPropertyValue("RepeatDelay") >>= nDelay;
CPPUNIT_ASSERT_EQUAL(sal_Int32(230), nDelay);
@@ -613,12 +613,12 @@ void SdActiveXControlsTest::testCheckBoxProperties()
xPropertySet->getPropertyValue("Enabled") >>= bEnabled;
CPPUNIT_ASSERT_EQUAL(true, bEnabled);
- sal_Int32 nColor;
+ Color nColor;
xPropertySet->getPropertyValue("BackgroundColor") >>= nColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0xFFFFFF), nColor);
+ CPPUNIT_ASSERT_EQUAL(COL_WHITE, nColor);
xPropertySet->getPropertyValue("TextColor") >>= nColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0x000000), nColor);
+ CPPUNIT_ASSERT_EQUAL(COL_BLACK, nColor);
bool bMultiLine;
xPropertySet->getPropertyValue("MultiLine") >>= bMultiLine;
@@ -651,10 +651,10 @@ void SdActiveXControlsTest::testCheckBoxProperties()
CPPUNIT_ASSERT_EQUAL(false, bEnabled);
xPropertySet->getPropertyValue("BackgroundColor") >>= nColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0xFF0000), nColor);
+ CPPUNIT_ASSERT_EQUAL(Color(0xFF0000), nColor);
xPropertySet->getPropertyValue("TextColor") >>= nColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0xFF80FF), nColor);
+ CPPUNIT_ASSERT_EQUAL(Color(0xFF80FF), nColor);
xPropertySet->getPropertyValue("MultiLine") >>= bMultiLine;
CPPUNIT_ASSERT_EQUAL(false, bMultiLine);
@@ -706,12 +706,12 @@ void SdActiveXControlsTest::testOptionButtonProperties()
xPropertySet->getPropertyValue("Enabled") >>= bEnabled;
CPPUNIT_ASSERT_EQUAL(true, bEnabled);
- sal_Int32 nColor;
+ Color nColor;
xPropertySet->getPropertyValue("BackgroundColor") >>= nColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0xFFFFFF), nColor);
+ CPPUNIT_ASSERT_EQUAL(COL_WHITE, nColor);
xPropertySet->getPropertyValue("TextColor") >>= nColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0x000000), nColor);
+ CPPUNIT_ASSERT_EQUAL(COL_BLACK, nColor);
bool bMultiLine;
xPropertySet->getPropertyValue("MultiLine") >>= bMultiLine;
@@ -740,10 +740,10 @@ void SdActiveXControlsTest::testOptionButtonProperties()
CPPUNIT_ASSERT_EQUAL(false, bEnabled);
xPropertySet->getPropertyValue("BackgroundColor") >>= nColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0x00FFFF), nColor);
+ CPPUNIT_ASSERT_EQUAL(Color(0x00FFFF), nColor);
xPropertySet->getPropertyValue("TextColor") >>= nColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0xFF0000), nColor);
+ CPPUNIT_ASSERT_EQUAL(Color(0xFF0000), nColor);
xPropertySet->getPropertyValue("MultiLine") >>= bMultiLine;
CPPUNIT_ASSERT_EQUAL(false, bMultiLine);
@@ -785,12 +785,12 @@ void SdActiveXControlsTest::testComboBoxProperties()
xPropertySet->getPropertyValue("Enabled") >>= bEnabled;
CPPUNIT_ASSERT_EQUAL(true, bEnabled);
- sal_Int32 nColor;
+ Color nColor;
xPropertySet->getPropertyValue("BackgroundColor") >>= nColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0xFFFFFF), nColor);
+ CPPUNIT_ASSERT_EQUAL(COL_WHITE, nColor);
xPropertySet->getPropertyValue("TextColor") >>= nColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0x000000), nColor);
+ CPPUNIT_ASSERT_EQUAL(COL_BLACK, nColor);
bool bAutocomplete;
xPropertySet->getPropertyValue("Autocomplete") >>= bAutocomplete;
@@ -800,9 +800,9 @@ void SdActiveXControlsTest::testComboBoxProperties()
xPropertySet->getPropertyValue("Border") >>= nBorderStyle;
CPPUNIT_ASSERT_EQUAL(sal_Int16(1), nBorderStyle);
- sal_Int32 nBorderColor;
+ Color nBorderColor;
xPropertySet->getPropertyValue("BorderColor") >>= nBorderColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0x000000), nBorderColor);
+ CPPUNIT_ASSERT_EQUAL(COL_BLACK, nBorderColor);
bool bDropdown;
xPropertySet->getPropertyValue("Dropdown") >>= bDropdown;
@@ -836,10 +836,10 @@ void SdActiveXControlsTest::testComboBoxProperties()
CPPUNIT_ASSERT_EQUAL(false, bEnabled);
xPropertySet->getPropertyValue("BackgroundColor") >>= nColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0x800000), nColor);
+ CPPUNIT_ASSERT_EQUAL(Color(0x800000), nColor);
xPropertySet->getPropertyValue("TextColor") >>= nColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0xFFFFFF), nColor);
+ CPPUNIT_ASSERT_EQUAL(COL_WHITE, nColor);
xPropertySet->getPropertyValue("Autocomplete") >>= bAutocomplete;
CPPUNIT_ASSERT_EQUAL(true, bAutocomplete);
@@ -848,7 +848,7 @@ void SdActiveXControlsTest::testComboBoxProperties()
CPPUNIT_ASSERT_EQUAL(sal_Int16(2), nBorderStyle);
xPropertySet->getPropertyValue("BorderColor") >>= nBorderColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0x404040), nBorderColor);
+ CPPUNIT_ASSERT_EQUAL(Color(0x404040), nBorderColor);
xPropertySet->getPropertyValue("Dropdown") >>= bDropdown;
CPPUNIT_ASSERT_EQUAL(true, bDropdown);
@@ -899,20 +899,20 @@ void SdActiveXControlsTest::testListBoxProperties()
xPropertySet->getPropertyValue("Enabled") >>= bEnabled;
CPPUNIT_ASSERT_EQUAL(true, bEnabled);
- sal_Int32 nColor;
+ Color nColor;
xPropertySet->getPropertyValue("BackgroundColor") >>= nColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0xFFFFFF), nColor);
+ CPPUNIT_ASSERT_EQUAL(COL_WHITE, nColor);
xPropertySet->getPropertyValue("TextColor") >>= nColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0x000000), nColor);
+ CPPUNIT_ASSERT_EQUAL(COL_BLACK, nColor);
sal_Int16 nBorderStyle;
xPropertySet->getPropertyValue("Border") >>= nBorderStyle;
CPPUNIT_ASSERT_EQUAL(sal_Int16(1), nBorderStyle);
- sal_Int32 nBorderColor;
+ Color nBorderColor;
xPropertySet->getPropertyValue("BorderColor") >>= nBorderColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0x000000), nBorderColor);
+ CPPUNIT_ASSERT_EQUAL(COL_BLACK, nBorderColor);
bool bDropdown;
xPropertySet->getPropertyValue("Dropdown") >>= bDropdown;
@@ -942,16 +942,16 @@ void SdActiveXControlsTest::testListBoxProperties()
CPPUNIT_ASSERT_EQUAL(false, bEnabled);
xPropertySet->getPropertyValue("BackgroundColor") >>= nColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0xFFFF00), nColor);
+ CPPUNIT_ASSERT_EQUAL(Color(0xFFFF00), nColor);
xPropertySet->getPropertyValue("TextColor") >>= nColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0xFF0000), nColor);
+ CPPUNIT_ASSERT_EQUAL(Color(0xFF0000), nColor);
xPropertySet->getPropertyValue("Border") >>= nBorderStyle;
CPPUNIT_ASSERT_EQUAL(sal_Int16(2), nBorderStyle);
xPropertySet->getPropertyValue("BorderColor") >>= nBorderColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0xFF00FF), nBorderColor);
+ CPPUNIT_ASSERT_EQUAL(Color(0xFF00FF), nBorderColor);
xPropertySet->getPropertyValue("MultiSelection") >>= bMultiSelection;
CPPUNIT_ASSERT_EQUAL(true, bMultiSelection);
@@ -995,12 +995,12 @@ void SdActiveXControlsTest::testToggleButtonProperties()
xPropertySet->getPropertyValue("MultiLine") >>= bMultiLine;
CPPUNIT_ASSERT_EQUAL(true, bMultiLine);
- sal_Int32 nColor;
+ Color nColor;
xPropertySet->getPropertyValue("BackgroundColor") >>= nColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0xECE9D8), nColor);
+ CPPUNIT_ASSERT_EQUAL(Color(0xECE9D8), nColor);
xPropertySet->getPropertyValue("TextColor") >>= nColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0x000000), nColor);
+ CPPUNIT_ASSERT_EQUAL(COL_BLACK, nColor);
bool bToggle;
xPropertySet->getPropertyValue("Toggle") >>= bToggle;
@@ -1028,10 +1028,10 @@ void SdActiveXControlsTest::testToggleButtonProperties()
CPPUNIT_ASSERT_EQUAL(false, bMultiLine);
xPropertySet->getPropertyValue("BackgroundColor") >>= nColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0xFF80FF), nColor);
+ CPPUNIT_ASSERT_EQUAL(Color(0xFF80FF), nColor);
xPropertySet->getPropertyValue("TextColor") >>= nColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0x808080), nColor);
+ CPPUNIT_ASSERT_EQUAL(Color(0x808080), nColor);
xPropertySet->getPropertyValue("Toggle") >>= bToggle;
CPPUNIT_ASSERT_EQUAL(true, bToggle);
@@ -1054,7 +1054,7 @@ void SdActiveXControlsTest::testToggleButtonProperties()
// Transparent background
xPropertySet->getPropertyValue("BackgroundColor") >>= nColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0xFFFFFF), nColor);
+ CPPUNIT_ASSERT_EQUAL(COL_WHITE, nColor);
xDocShRef->DoClose();
}
diff --git a/sd/qa/unit/export-tests-ooxml1.cxx b/sd/qa/unit/export-tests-ooxml1.cxx
index 196e3b7e90e4..fded47a1c2c9 100644
--- a/sd/qa/unit/export-tests-ooxml1.cxx
+++ b/sd/qa/unit/export-tests-ooxml1.cxx
@@ -229,10 +229,10 @@ void SdOOXMLExportTest1::testTdf127237()
CPPUNIT_ASSERT(pTableObj != nullptr);
uno::Reference< table::XCellRange > xTable(pTableObj->getTable(), uno::UNO_QUERY_THROW);
- sal_Int32 nFillColor = 0;
+ Color nFillColor;
uno::Reference< beans::XPropertySet > xCell(xTable->getCellByPosition(0, 0), uno::UNO_QUERY_THROW);
xCell->getPropertyValue("FillColor") >>= nFillColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0x0070C0), nFillColor);
+ CPPUNIT_ASSERT_EQUAL(Color(0x0070C0), nFillColor);
xDocShRef->DoClose();
}
@@ -569,10 +569,10 @@ void SdOOXMLExportTest1::testTableCellFillProperties()
uno::Reference< beans::XPropertySet > xCell;
// Test Solid fill color
- sal_Int32 nColor;
+ Color nColor;
xCell.set(xTable->getCellByPosition(0, 0), uno::UNO_QUERY_THROW);
xCell->getPropertyValue("FillColor") >>= nColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0x66ffff), nColor);
+ CPPUNIT_ASSERT_EQUAL(Color(0x66ffff), nColor);
// Test Picture fill type for cell
drawing::FillStyle aFillStyle( drawing::FillStyle_NONE );
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx
index d3ec0063f9d2..7d3acad7ab04 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -688,9 +688,9 @@ void SdOOXMLExportTest2::testTdf80224()
uno::Reference<text::XTextRange> const xParagraph( getParagraphFromShape( 0, xShape ) );
uno::Reference< beans::XPropertySet > xPropSet( xParagraph->getStart(), uno::UNO_QUERY_THROW );
- sal_Int32 nCharColor;
+ Color nCharColor;
xPropSet->getPropertyValue("CharColor") >>= nCharColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0x6562ac), nCharColor);
+ CPPUNIT_ASSERT_EQUAL(Color(0x6562ac), nCharColor);
xDocShRef->DoClose();
}
@@ -1862,9 +1862,9 @@ void SdOOXMLExportTest2::testTdf107608()
xPropSet->getPropertyValue("FillBackground") >>= bBackgroundFill;
CPPUNIT_ASSERT(bBackgroundFill);
- sal_Int32 nBackgroundColor;
+ Color nBackgroundColor;
xPropSet->getPropertyValue("FillColor") >>= nBackgroundColor;
- CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0x92D050), nBackgroundColor);
+ CPPUNIT_ASSERT_EQUAL(Color(0x92D050), nBackgroundColor);
xDocShRef->DoClose();
}
@@ -1879,9 +1879,9 @@ void SdOOXMLExportTest2::testTdf111786()
uno::Reference< beans::XPropertySet > xShape( getShapeFromPage( 0, 0, xDocShRef ) );
uno::Reference< beans::XPropertySet > xPropSet( xShape, uno::UNO_SET_THROW );
- sal_uInt32 nLineColor;
+ Color nLineColor;
xPropSet->getPropertyValue("LineColor") >>= nLineColor;
- CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt32>(0x3465A4), nLineColor);
+ CPPUNIT_ASSERT_EQUAL(Color(0x3465A4), nLineColor);
sal_Int16 nTransparency;
xPropSet->getPropertyValue("LineTransparence") >>= nTransparency;
@@ -2079,9 +2079,9 @@ void SdOOXMLExportTest2::testTdf130058()
CPPUNIT_ASSERT_EQUAL(static_cast<double>(0), fShadowDist);
xShape->getPropertyValue("ShadowYDistance") >>= fShadowDist;
CPPUNIT_ASSERT_EQUAL(static_cast<double>(141), fShadowDist);
- sal_Int32 nColor = 0;
+ Color nColor;
xShape->getPropertyValue("ShadowColor") >>= nColor;
- CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0x000000), nColor);
+ CPPUNIT_ASSERT_EQUAL(COL_BLACK, nColor);
sal_Int32 nTransparency = 0;
xShape->getPropertyValue("ShadowTransparence") >>= nTransparency;
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(57), nTransparency);
@@ -2113,9 +2113,9 @@ void SdOOXMLExportTest2::testTdf111789()
CPPUNIT_ASSERT_EQUAL(static_cast<double>(273), fShadowDist);
xShape->getPropertyValue("ShadowYDistance") >>= fShadowDist;
CPPUNIT_ASSERT_EQUAL(static_cast<double>(273), fShadowDist);
- sal_Int32 nColor = 0;
+ Color nColor;
xShape->getPropertyValue("ShadowColor") >>= nColor;
- CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0xFF0000), nColor);
+ CPPUNIT_ASSERT_EQUAL(Color(0xFF0000), nColor);
sal_Int32 nTransparency = 0;
xShape->getPropertyValue("ShadowTransparence") >>= nTransparency;
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(7), nTransparency);
@@ -2566,9 +2566,9 @@ void SdOOXMLExportTest2::testTdf125346()
xPropSet->getPropertyValue("FillStyle") >>= aFillStyle;
CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, aFillStyle);
- sal_Int32 nFillColor;
+ Color nFillColor;
xPropSet->getPropertyValue("FillColor") >>= nFillColor;
- CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0x90C226), nFillColor);
+ CPPUNIT_ASSERT_EQUAL(Color(0x90C226), nFillColor);
xDocShRef->DoClose();
}
@@ -2589,9 +2589,9 @@ void SdOOXMLExportTest2::testTdf125346_2()
xPropSet->getPropertyValue("FillStyle") >>= aFillStyle;
CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, aFillStyle);
- sal_Int32 nFillColor;
+ Color nFillColor;
xPropSet->getPropertyValue("FillColor") >>= nFillColor;
- CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0x90C226), nFillColor);
+ CPPUNIT_ASSERT_EQUAL(Color(0x90C226), nFillColor);
}
{
@@ -2602,9 +2602,9 @@ void SdOOXMLExportTest2::testTdf125346_2()
xPropSet->getPropertyValue("FillStyle") >>= aFillStyle;
CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, aFillStyle);
- sal_Int32 nFillColor;
+ Color nFillColor;
xPropSet->getPropertyValue("FillColor") >>= nFillColor;
- CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0x052F61), nFillColor);
+ CPPUNIT_ASSERT_EQUAL(Color(0x052F61), nFillColor);
}
{
@@ -2615,9 +2615,9 @@ void SdOOXMLExportTest2::testTdf125346_2()
xPropSet->getPropertyValue("FillStyle") >>= aFillStyle;
CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, aFillStyle);
- sal_Int32 nFillColor;
+ Color nFillColor;
xPropSet->getPropertyValue("FillColor") >>= nFillColor;
- CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0x90C226), nFillColor);
+ CPPUNIT_ASSERT_EQUAL(Color(0x90C226), nFillColor);
}
xDocShRef->DoClose();
diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index 8b3614e6b52d..76e8cdc02948 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -517,7 +517,7 @@ void SdExportTest::testBnc480256()
sdr::table::SdrTableObj *pTableObj;
uno::Reference< table::XCellRange > xTable;
uno::Reference< beans::XPropertySet > xCell;
- sal_Int32 nColor;
+ Color nColor;
table::BorderLine2 aBorderLine;
pTableObj = dynamic_cast<sdr::table::SdrTableObj*>(pPage->GetObj(0));
@@ -526,13 +526,13 @@ void SdExportTest::testBnc480256()
xCell.set(xTable->getCellByPosition(0, 0), uno::UNO_QUERY_THROW);
xCell->getPropertyValue("FillColor") >>= nColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0x9bc3ee), nColor);
+ CPPUNIT_ASSERT_EQUAL(Color(0x9bc3ee), nColor);
xCell->getPropertyValue("LeftBorder") >>= aBorderLine;
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(0xc6ddff), nColor);
+ CPPUNIT_ASSERT_EQUAL(Color(0xc6ddff), nColor);
xCell->getPropertyValue("TopBorder") >>= aBorderLine;
CPPUNIT_ASSERT_EQUAL(sal_Int32(0x5597d3), aBorderLine.Color);
@@ -542,13 +542,13 @@ void SdExportTest::testBnc480256()
xCell.set(xTable->getCellByPosition(0, 0), uno::UNO_QUERY_THROW);
xCell->getPropertyValue("FillColor") >>= nColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0x6bace6), nColor);
+ CPPUNIT_ASSERT_EQUAL(Color(0x6bace6), nColor);
xCell->getPropertyValue("LeftBorder") >>= aBorderLine;
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(0x4697e0), nColor);
+ CPPUNIT_ASSERT_EQUAL(Color(0x4697e0), nColor);
xCell.set(xTable->getCellByPosition(1, 0), uno::UNO_QUERY_THROW);
xCell->getPropertyValue("BottomBorder") >>= aBorderLine;
@@ -1293,9 +1293,9 @@ void SdExportTest::testGlow()
sal_Int32 nGlowEffectRad = 0;
CPPUNIT_ASSERT(xShape->getPropertyValue("GlowEffectRadius") >>= nGlowEffectRad);
CPPUNIT_ASSERT_EQUAL(sal_Int32(529), nGlowEffectRad); // 15 pt = 529.166... mm/100
- sal_Int32 nGlowEffectColor = 0;
+ Color nGlowEffectColor;
CPPUNIT_ASSERT(xShape->getPropertyValue("GlowEffectColor") >>= nGlowEffectColor);
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0x00FF4000), nGlowEffectColor); // "Brick"
+ CPPUNIT_ASSERT_EQUAL(Color(0x00FF4000), nGlowEffectColor); // "Brick"
sal_Int16 nGlowEffectTransparency = 0;
CPPUNIT_ASSERT(xShape->getPropertyValue("GlowEffectTransparency") >>= nGlowEffectTransparency);
CPPUNIT_ASSERT_EQUAL(sal_Int16(60), nGlowEffectTransparency); // 60%
@@ -1416,6 +1416,7 @@ void SdExportTest::testMasterPageBackgroundFullSize()
// page margins and the flag synchronized across all master pages)
uno::Reference<drawing::XMasterPagesSupplier> xMPS(xDocShRef->GetDoc()->getUnoModel(), uno::UNO_QUERY);
uno::Reference<drawing::XDrawPages> xMPs(xMPS->getMasterPages());
+ Color nFillColor;
{
uno::Reference<beans::XPropertySet> xMP(xMPs->getByIndex(0), uno::UNO_QUERY);
CPPUNIT_ASSERT(!xMP->getPropertyValue("BackgroundFullSize").get<bool>());
@@ -1426,7 +1427,8 @@ void SdExportTest::testMasterPageBackgroundFullSize()
uno::Reference<beans::XPropertySet> xBackgroundProps(
xMP->getPropertyValue("Background").get<uno::Reference<beans::XPropertySet>>());
CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, xBackgroundProps->getPropertyValue("FillStyle").get<drawing::FillStyle>());
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0x729fcf), xBackgroundProps->getPropertyValue("FillColor").get<sal_Int32>());
+ xBackgroundProps->getPropertyValue("FillColor") >>= nFillColor;
+ CPPUNIT_ASSERT_EQUAL(Color(0x729fcf), nFillColor);
CPPUNIT_ASSERT_EQUAL(sal_Int16(0), xBackgroundProps->getPropertyValue("FillTransparence").get<sal_Int16>());
}
{
@@ -1439,7 +1441,8 @@ void SdExportTest::testMasterPageBackgroundFullSize()
uno::Reference<beans::XPropertySet> xBackgroundProps(
xMP->getPropertyValue("Background").get<uno::Reference<beans::XPropertySet>>());
CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, xBackgroundProps->getPropertyValue("FillStyle").get<drawing::FillStyle>());
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0x729fcf), xBackgroundProps->getPropertyValue("FillColor").get<sal_Int32>());
+ xBackgroundProps->getPropertyValue("FillColor") >>= nFillColor;
+ CPPUNIT_ASSERT_EQUAL(Color(0x729fcf), nFillColor);
CPPUNIT_ASSERT_EQUAL(sal_Int16(0), xBackgroundProps->getPropertyValue("FillTransparence").get<sal_Int16>());
}
{
@@ -1484,7 +1487,8 @@ void SdExportTest::testMasterPageBackgroundFullSize()
uno::Reference<beans::XPropertySet> xBackgroundProps(
xMP->getPropertyValue("Background").get<uno::Reference<beans::XPropertySet>>());
CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, xBackgroundProps->getPropertyValue("FillStyle").get<drawing::FillStyle>());
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0x729fcf), xBackgroundProps->getPropertyValue("FillColor").get<sal_Int32>());
+ xBackgroundProps->getPropertyValue("FillColor") >>= nFillColor;
+ CPPUNIT_ASSERT_EQUAL(Color(0x729fcf), nFillColor);
CPPUNIT_ASSERT_EQUAL(sal_Int16(0), xBackgroundProps->getPropertyValue("FillTransparence").get<sal_Int16>());
}
{
@@ -1497,7 +1501,8 @@ void SdExportTest::testMasterPageBackgroundFullSize()
uno::Reference<beans::XPropertySet> xBackgroundProps(
xMP->getPropertyValue("Background").get<uno::Reference<beans::XPropertySet>>());
CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, xBackgroundProps->getPropertyValue("FillStyle").get<drawing::FillStyle>());
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0x729fcf), xBackgroundProps->getPropertyValue("FillColor").get<sal_Int32>());
+ xBackgroundProps->getPropertyValue("FillColor") >>= nFillColor;
+ CPPUNIT_ASSERT_EQUAL(Color(0x729fcf), nFillColor);
CPPUNIT_ASSERT_EQUAL(sal_Int16(0), xBackgroundProps->getPropertyValue("FillTransparence").get<sal_Int16>());
}
{
diff --git a/sd/qa/unit/import-tests-smartart.cxx b/sd/qa/unit/import-tests-smartart.cxx
index 7a2056e2295d..096a4516294e 100644
--- a/sd/qa/unit/import-tests-smartart.cxx
+++ b/sd/qa/unit/import-tests-smartart.cxx
@@ -195,9 +195,9 @@ void SdImportTestSmartArt::testBase()
uno::Reference<beans::XPropertySet> xShape(xShapeGroup->getByIndex(1), uno::UNO_QUERY_THROW);
- sal_Int32 nFillColor = 0;
+ Color nFillColor;
xShape->getPropertyValue("FillColor") >>= nFillColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0x4F81BD), nFillColor);
+ CPPUNIT_ASSERT_EQUAL(Color(0x4F81BD), nFillColor);
sal_Int16 nParaAdjust = 0;
uno::Reference<text::XTextRange> xParagraph(getParagraphFromShape(0, xShape));
@@ -614,9 +614,9 @@ void SdImportTestSmartArt::testBaseRtoL()
uno::Reference<beans::XPropertySet> xShape(xShapeGroup->getByIndex(1), uno::UNO_QUERY_THROW);
- sal_Int32 nFillColor = 0;
+ Color nFillColor;
xShape->getPropertyValue("FillColor") >>= nFillColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0x4F81BD), nFillColor);
+ CPPUNIT_ASSERT_EQUAL(Color(0x4F81BD), nFillColor);
sal_Int16 nParaAdjust = 0;
uno::Reference<text::XTextRange> xParagraph(getParagraphFromShape(0, xShape));
@@ -870,10 +870,11 @@ void SdImportTestSmartArt::testOrgChart()
uno::Reference<container::XEnumerationAccess> xRunEnumAccess(xPara, uno::UNO_QUERY);
uno::Reference<container::XEnumeration> xRunEnum = xRunEnumAccess->createEnumeration();
uno::Reference<beans::XPropertySet> xRun(xRunEnum->nextElement(), uno::UNO_QUERY);
- sal_Int32 nActualColor = xRun->getPropertyValue("CharColor").get<sal_Int32>();
+ Color nActualColor;
+ xRun->getPropertyValue("CharColor") >>= nActualColor;
// Without the accompanying fix in place, this test would have failed: the
// "Manager" font color was black, not white.
- CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0xffffff), nActualColor);
+ CPPUNIT_ASSERT_EQUAL(COL_WHITE, nActualColor);
uno::Reference<drawing::XShape> xManagerShape(xManager, uno::UNO_QUERY);
CPPUNIT_ASSERT(xManagerShape.is());
@@ -997,11 +998,11 @@ void SdImportTestSmartArt::testCycleMatrix()
uno::Reference<beans::XPropertySet> xB1Props(xB1, uno::UNO_QUERY);
CPPUNIT_ASSERT(xB1Props.is());
- sal_Int32 nFillColor = 0;
+ Color nFillColor;
xB1Props->getPropertyValue("FillColor") >>= nFillColor;
// Without the accompanying fix in place, this test would have failed: the background color was
// 0x4f81bd, i.e. blue, not orange.
- CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0xf79646), nFillColor);
+ CPPUNIT_ASSERT_EQUAL(Color(0xf79646), nFillColor);
// Without the accompanying fix in place, this test would have failed: the
// content of the "A2" shape was lost.
@@ -1027,9 +1028,9 @@ void SdImportTestSmartArt::testCycleMatrix()
// Test line color of B2, should be orange.
uno::Reference<beans::XPropertySet> xB2Props(xB2, uno::UNO_QUERY);
CPPUNIT_ASSERT(xB2Props.is());
- sal_Int32 nLineColor = 0;
+ Color nLineColor = 0;
xB2Props->getPropertyValue("LineColor") >>= nLineColor;
- CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0xf79646), nLineColor);
+ CPPUNIT_ASSERT_EQUAL(Color(0xf79646), nLineColor);
uno::Reference<text::XText> xC2(getChildShape(getChildShape(getChildShape(xGroup, 1), 2), 1),
uno::UNO_QUERY);
@@ -1187,9 +1188,9 @@ void SdImportTestSmartArt::testBackground()
xPropertySet->getPropertyValue("FillStyle") >>= eFillStyle;
CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, eFillStyle);
- sal_Int32 nFillColor = 0;
+ Color nFillColor;
xPropertySet->getPropertyValue("FillColor") >>= nFillColor;
- CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0x339933), nFillColor);
+ CPPUNIT_ASSERT_EQUAL(Color(0x339933), nFillColor);
bool bMoveProtect = false;
xPropertySet->getPropertyValue("MoveProtect") >>= bMoveProtect;
@@ -1226,9 +1227,9 @@ void SdImportTestSmartArt::testBackgroundDrawingmlFallback()
xPropertySet->getPropertyValue("FillStyle") >>= eFillStyle;
CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, eFillStyle);
- sal_Int32 nFillColor = 0;
+ Color nFillColor;
xPropertySet->getPropertyValue("FillColor") >>= nFillColor;
- CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0x339933), nFillColor);
+ CPPUNIT_ASSERT_EQUAL(Color(0x339933), nFillColor);
bool bMoveProtect = false;
xPropertySet->getPropertyValue("MoveProtect") >>= bMoveProtect;
@@ -1559,13 +1560,13 @@ void SdImportTestSmartArt::testFillColorList()
uno::Reference<drawing::XShape> xGroup(getShapeFromPage(0, 0, xDocShRef), uno::UNO_QUERY);
uno::Reference<drawing::XShape> xShape = getChildShape(getChildShape(xGroup, 1), 0);
uno::Reference<beans::XPropertySet> xPropertySet(xShape, uno::UNO_QUERY_THROW);
- sal_Int32 nFillColor = 0;
+ Color nFillColor;
xPropertySet->getPropertyValue("FillColor") >>= nFillColor;
// Without the accompanying fix in place, this test would have failed with:
// - Expected: 12603469 (0xc0504d)
// - Actual : 16225862 (0xf79646)
// i.e. the background of the "A" shape was orange-ish, rather than red-ish.
- CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0xC0504D), nFillColor);
+ CPPUNIT_ASSERT_EQUAL(Color(0xC0504D), nFillColor);
// Without the accompanying fix in place, this test would have failed with:
// - Expected: 2239
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index a1f21f97394a..cbe6c061d90e 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -445,25 +445,25 @@ void SdImportTest::testHyperlinkColor()
// Get run of the first paragraph
uno::Reference<text::XTextRange> xRun1( getRunFromParagraph (0, xParagraph1 ) );
uno::Reference< beans::XPropertySet > xPropSet1( xRun1, uno::UNO_QUERY_THROW );
- sal_Int32 nCharColorBlue;
+ Color nCharColorBlue;
xPropSet1->getPropertyValue( "CharColor" ) >>= nCharColorBlue;
// Get run of the second paragraph
uno::Reference<text::XTextRange> xRun2( getRunFromParagraph (1, xParagraph2 ) );
uno::Reference< beans::XPropertySet > xPropSet2( xRun2, uno::UNO_QUERY_THROW );
- sal_Int32 nCharColorRed;
+ Color nCharColorRed;
xPropSet2->getPropertyValue( "CharColor" ) >>= nCharColorRed;
// Get run of the third paragraph
uno::Reference<text::XTextRange> xRun3( getRunFromParagraph (2, xParagraph3 ) );
uno::Reference< beans::XPropertySet > xPropSet3( xRun3, uno::UNO_QUERY_THROW );
- sal_Int32 nCharColorGreen;
+ Color nCharColorGreen;
xPropSet3->getPropertyValue( "CharColor" ) >>= nCharColorGreen;
// Hyperlink colors should be blue, red, green.
- CPPUNIT_ASSERT_EQUAL( sal_Int32(0x4472c4), nCharColorBlue );
- CPPUNIT_ASSERT_EQUAL( sal_Int32(0xff0000), nCharColorRed );
- CPPUNIT_ASSERT_EQUAL( sal_Int32(0x548235), nCharColorGreen );
+ CPPUNIT_ASSERT_EQUAL( Color(0x4472c4), nCharColorBlue );
+ CPPUNIT_ASSERT_EQUAL( Color(0xff0000), nCharColorRed );
+ CPPUNIT_ASSERT_EQUAL( Color(0x548235), nCharColorGreen );
xDocShRef->DoClose();
}
@@ -1033,19 +1033,19 @@ void SdImportTest::testPredefinedTableStyle()
uno::Reference< table::XCellRange > xTable(pTableObj->getTable(), uno::UNO_QUERY_THROW);
uno::Reference< beans::XPropertySet > xCell;
- sal_Int32 nColor;
+ Color nColor;
xCell.set(xTable->getCellByPosition(0, 0), uno::UNO_QUERY_THROW);
xCell->getPropertyValue("FillColor") >>= nColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0x0), nColor);
+ CPPUNIT_ASSERT_EQUAL(COL_BLACK, nColor);
xCell.set(xTable->getCellByPosition(0, 1), uno::UNO_QUERY_THROW);
xCell->getPropertyValue("FillColor") >>= nColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0xcccccc), nColor);
+ CPPUNIT_ASSERT_EQUAL(Color(0xcccccc), nColor);
xCell.set(xTable->getCellByPosition(0, 2), uno::UNO_QUERY_THROW);
xCell->getPropertyValue("FillColor") >>= nColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0xe7e7e7), nColor);
+ CPPUNIT_ASSERT_EQUAL(Color(0xe7e7e7), nColor);
xDocShRef->DoClose();
}
@@ -1062,35 +1062,35 @@ void SdImportTest::testBnc887225()
CPPUNIT_ASSERT( pTableObj );
uno::Reference< table::XCellRange > xTable(pTableObj->getTable(), uno::UNO_QUERY_THROW);
uno::Reference< beans::XPropertySet > xCell;
- sal_Int32 nColor;
+ Color nColor;
xCell.set(xTable->getCellByPosition(0, 0), uno::UNO_QUERY_THROW);
xCell->getPropertyValue("FillColor") >>= nColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0x5b9bd5), nColor);
+ CPPUNIT_ASSERT_EQUAL(Color(0x5b9bd5), nColor);
xCell.set(xTable->getCellByPosition(0, 1), uno::UNO_QUERY_THROW);
xCell->getPropertyValue("FillColor") >>= nColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0x5b9bd5), nColor);
+ CPPUNIT_ASSERT_EQUAL(Color(0x5b9bd5), nColor);
xCell.set(xTable->getCellByPosition(1, 1), uno::UNO_QUERY_THROW);
xCell->getPropertyValue("FillColor") >>= nColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0xd1deef), nColor);
+ CPPUNIT_ASSERT_EQUAL(Color(0xd1deef), nColor);
xCell.set(xTable->getCellByPosition(1, 2), uno::UNO_QUERY_THROW);
xCell->getPropertyValue("FillColor") >>= nColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0xe9eff7), nColor);
+ CPPUNIT_ASSERT_EQUAL(Color(0xe9eff7), nColor);
xCell.set(xTable->getCellByPosition(1, 4), uno::UNO_QUERY_THROW);
xCell->getPropertyValue("FillColor") >>= nColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0x5b9bd5), nColor);
+ CPPUNIT_ASSERT_EQUAL(Color(0x5b9bd5), nColor);
xCell.set(xTable->getCellByPosition(3, 2), uno::UNO_QUERY_THROW);
xCell->getPropertyValue("FillColor") >>= nColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0x5b9bd5), nColor);
+ CPPUNIT_ASSERT_EQUAL(Color(0x5b9bd5), nColor);
xCell.set(xTable->getCellByPosition(3, 4), uno::UNO_QUERY_THROW);
xCell->getPropertyValue("FillColor") >>= nColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0x5b9bd5), nColor);
+ CPPUNIT_ASSERT_EQUAL(Color(0x5b9bd5), nColor);
xDocShRef->DoClose();
}
@@ -1350,11 +1350,11 @@ void SdImportTest::testBnc862510_6()
// Get first run of the paragraph
uno::Reference<text::XTextRange> xRun( getRunFromParagraph( 0, xParagraph ) );
uno::Reference< beans::XPropertySet > xPropSet( xRun, uno::UNO_QUERY_THROW );
- sal_Int32 nCharColor;
+ Color nCharColor;
xPropSet->getPropertyValue( "CharColor" ) >>= nCharColor;
// Color should be gray
- CPPUNIT_ASSERT_EQUAL( sal_Int32(0x8B8B8B), nCharColor );
+ CPPUNIT_ASSERT_EQUAL( Color(0x8B8B8B), nCharColor );
xDocShRef->DoClose();
}
@@ -1527,11 +1527,11 @@ void SdImportTest::testBnc910045()
CPPUNIT_ASSERT( pTableObj );
uno::Reference< table::XCellRange > xTable(pTableObj->getTable(), uno::UNO_QUERY_THROW);
uno::Reference< beans::XPropertySet > xCell;
- sal_Int32 nColor;
+ Color nColor;
xCell.set(xTable->getCellByPosition(0, 0), uno::UNO_QUERY_THROW);
xCell->getPropertyValue("FillColor") >>= nColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0x4f81bd), nColor);
+ CPPUNIT_ASSERT_EQUAL(Color(0x4f81bd), nColor);
xDocShRef->DoClose();
}
@@ -1598,14 +1598,14 @@ void SdImportTest::testTdf127129()
uno::Reference< text::XTextRange > xRun( getRunFromParagraph( 0, xParagraph ) );
uno::Reference< beans::XPropertySet > xPropSet( xRun, uno::UNO_QUERY_THROW );
- sal_Int32 nCharColor;
+ Color nCharColor;
xPropSet->getPropertyValue( "CharColor" ) >>= nCharColor;
- CPPUNIT_ASSERT_EQUAL( sal_Int32(0x000000), nCharColor );
+ CPPUNIT_ASSERT_EQUAL( COL_BLACK, nCharColor );
// Without the accompanying fix in place, the highlight would be -1
- sal_Int32 nCharBackColor;
+ Color nCharBackColor;
xPropSet->getPropertyValue( "CharBackColor" ) >>= nCharBackColor;
- CPPUNIT_ASSERT_EQUAL( sal_Int32(0xFF00), nCharBackColor );
+ CPPUNIT_ASSERT_EQUAL( Color(0xFF00), nCharBackColor );
xDocShRef->DoClose();
}
@@ -1821,9 +1821,9 @@ void SdImportTest::testTdf89927()
uno::Reference< text::XTextRange > xRun( getRunFromParagraph( 0, xParagraph ) );
uno::Reference< beans::XPropertySet > xPropSet( xRun, uno::UNO_QUERY_THROW );
- sal_Int32 nCharColor;
+ Color nCharColor;
xPropSet->getPropertyValue( "CharColor" ) >>= nCharColor;
- CPPUNIT_ASSERT_EQUAL( sal_Int32(0xFFFFFF), nCharColor );
+ CPPUNIT_ASSERT_EQUAL( COL_WHITE, nCharColor );
xDocShRef->DoClose();
}
@@ -1868,7 +1868,7 @@ void SdImportTest::testTdf99030()
xDoc->getMasterPages()->getByIndex( 0 ), uno::UNO_QUERY_THROW );
uno::Reference< beans::XPropertySet > xPropSet( xPage, uno::UNO_QUERY );
- sal_Int32 nFillColor(0);
+ Color nFillColor;
uno::Any aAny = xPropSet->getPropertyValue( "Background" );
if (aAny.hasValue())
{
@@ -1876,7 +1876,7 @@ void SdImportTest::testTdf99030()
aAny >>= xBackgroundPropSet;
xBackgroundPropSet->getPropertyValue( "FillColor" ) >>= nFillColor;
}
- CPPUNIT_ASSERT_EQUAL( sal_Int32(0x676A55), nFillColor );
+ CPPUNIT_ASSERT_EQUAL( Color(0x676A55), nFillColor );
xDocShRef->DoClose();
}
@@ -2039,9 +2039,9 @@ void SdImportTest::testTdf103876()
CPPUNIT_ASSERT_EQUAL(style::ParagraphAdjust_CENTER, static_cast<style::ParagraphAdjust>(nParaAdjust));
// Check character color
- sal_Int32 nCharColor;
+ Color nCharColor;
xShape->getPropertyValue( "CharColor" ) >>= nCharColor;
- CPPUNIT_ASSERT_EQUAL( sal_Int32(0xFF0000), nCharColor );
+ CPPUNIT_ASSERT_EQUAL( Color(0xFF0000), nCharColor );
xDocShRef->DoClose();
}
@@ -3101,11 +3101,11 @@ void SdImportTest::testTdf120028b()
uno::Reference<text::XTextRange> xParagraph(getParagraphFromShape(0, xCell));
uno::Reference<text::XTextRange> xRun(getRunFromParagraph(0, xParagraph));
uno::Reference<beans::XPropertySet> xPropSet(xRun, uno::UNO_QUERY);
- sal_Int32 nCharColor = 0;
+ Color nCharColor;
xPropSet->getPropertyValue("CharColor") >>= nCharColor;
// This was 0x1f497d, not white: text list style from placeholder shape
// from slide layout was ignored.
- CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0xffffff), nCharColor);
+ CPPUNIT_ASSERT_EQUAL(COL_WHITE, nCharColor);
xDocShRef->DoClose();
}