diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-03-08 10:06:35 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-03-09 07:14:22 +0100 |
commit | ba43b0cb7a62f34fcda214d43122c7c66df2e5a0 (patch) | |
tree | 146d062c82fd942ff06b087390e5901c3eba0cfa | |
parent | 612ed5e752a0b317cf63a27ff1bb663a774022ef (diff) |
drop getColor() method of Color
no longer necessary
Change-Id: I9e0fcea1134e8c5e27f9effbb5eb79fe5446e33d
Reviewed-on: https://gerrit.libreoffice.org/50925
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | basctl/source/accessibility/accessibledialogcontrolshape.cxx | 16 | ||||
-rw-r--r-- | basctl/source/accessibility/accessibledialogwindow.cxx | 16 | ||||
-rw-r--r-- | include/tools/color.hxx | 6 | ||||
-rw-r--r-- | sc/qa/extras/new_cond_format.cxx | 12 | ||||
-rw-r--r-- | sc/qa/unit/subsequent_export-test.cxx | 2 | ||||
-rw-r--r-- | sd/qa/unit/export-tests-ooxml1.cxx | 6 | ||||
-rw-r--r-- | sd/qa/unit/import-tests.cxx | 4 | ||||
-rw-r--r-- | sd/qa/unit/sdmodeltestbase.hxx | 2 | ||||
-rw-r--r-- | vcl/quartz/salbmp.cxx | 6 |
9 files changed, 33 insertions, 37 deletions
diff --git a/basctl/source/accessibility/accessibledialogcontrolshape.cxx b/basctl/source/accessibility/accessibledialogcontrolshape.cxx index 5502cde6d32b..25f90d11090c 100644 --- a/basctl/source/accessibility/accessibledialogcontrolshape.cxx +++ b/basctl/source/accessibility/accessibledialogcontrolshape.cxx @@ -447,12 +447,12 @@ sal_Int32 AccessibleDialogControlShape::getForeground( ) { OExternalLockGuard aGuard( this ); - sal_Int32 nColor = 0; + Color nColor; vcl::Window* pWindow = GetWindow(); if ( pWindow ) { if ( pWindow->IsControlForeground() ) - nColor = pWindow->GetControlForeground().GetColor(); + nColor = pWindow->GetControlForeground(); else { vcl::Font aFont; @@ -460,11 +460,11 @@ sal_Int32 AccessibleDialogControlShape::getForeground( ) aFont = pWindow->GetControlFont(); else aFont = pWindow->GetFont(); - nColor = aFont.GetColor().GetColor(); + nColor = aFont.GetColor(); } } - return nColor; + return sal_Int32(nColor); } @@ -472,17 +472,17 @@ sal_Int32 AccessibleDialogControlShape::getBackground( ) { OExternalLockGuard aGuard( this ); - sal_Int32 nColor = 0; + Color nColor; vcl::Window* pWindow = GetWindow(); if ( pWindow ) { if ( pWindow->IsControlBackground() ) - nColor = pWindow->GetControlBackground().GetColor(); + nColor = pWindow->GetControlBackground(); else - nColor = pWindow->GetBackground().GetColor().GetColor(); + nColor = pWindow->GetBackground().GetColor(); } - return nColor; + return sal_Int32(nColor); } diff --git a/basctl/source/accessibility/accessibledialogwindow.cxx b/basctl/source/accessibility/accessibledialogwindow.cxx index 473f698d53d8..c7f66797e2a8 100644 --- a/basctl/source/accessibility/accessibledialogwindow.cxx +++ b/basctl/source/accessibility/accessibledialogwindow.cxx @@ -758,11 +758,11 @@ sal_Int32 AccessibleDialogWindow::getForeground( ) { OExternalLockGuard aGuard( this ); - sal_Int32 nColor = 0; + Color nColor; if ( m_pDialogWindow ) { if ( m_pDialogWindow->IsControlForeground() ) - nColor = m_pDialogWindow->GetControlForeground().GetColor(); + nColor = m_pDialogWindow->GetControlForeground(); else { vcl::Font aFont; @@ -770,11 +770,11 @@ sal_Int32 AccessibleDialogWindow::getForeground( ) aFont = m_pDialogWindow->GetControlFont(); else aFont = m_pDialogWindow->GetFont(); - nColor = aFont.GetColor().GetColor(); + nColor = aFont.GetColor(); } } - return nColor; + return sal_Int32(nColor); } @@ -782,16 +782,16 @@ sal_Int32 AccessibleDialogWindow::getBackground( ) { OExternalLockGuard aGuard( this ); - sal_Int32 nColor = 0; + Color nColor; if ( m_pDialogWindow ) { if ( m_pDialogWindow->IsControlBackground() ) - nColor = m_pDialogWindow->GetControlBackground().GetColor(); + nColor = m_pDialogWindow->GetControlBackground(); else - nColor = m_pDialogWindow->GetBackground().GetColor().GetColor(); + nColor = m_pDialogWindow->GetBackground().GetColor(); } - return nColor; + return sal_Int32(nColor); } diff --git a/include/tools/color.hxx b/include/tools/color.hxx index 7d9202282ea9..1b8fb3eecdd1 100644 --- a/include/tools/color.hxx +++ b/include/tools/color.hxx @@ -74,7 +74,7 @@ public: bool operator<(const Color& b) const { - return mnColor < b.GetColor(); + return mnColor < b.mnColor; } void SetRed(sal_uInt8 nRed); @@ -98,10 +98,6 @@ public: return COLORDATA_TRANSPARENCY(mnColor); } - sal_uInt32 GetColor() const - { - return mnColor; - } Color GetRGBColor() const { return COLORDATA_RGB(mnColor); diff --git a/sc/qa/extras/new_cond_format.cxx b/sc/qa/extras/new_cond_format.cxx index b6587e6059e7..e3bf1e2a44ad 100644 --- a/sc/qa/extras/new_cond_format.cxx +++ b/sc/qa/extras/new_cond_format.cxx @@ -201,26 +201,26 @@ void testUseGradient(uno::Reference<beans::XPropertySet> const & xPropSet, bool void testPositiveColor(uno::Reference<beans::XPropertySet> const & xPropSet, Color aColor) { - sal_Int32 nColor = 0; + ::Color nColor; uno::Any aAny = xPropSet->getPropertyValue("Color"); CPPUNIT_ASSERT(aAny >>= nColor); - CPPUNIT_ASSERT_EQUAL(aColor.GetColor(), sal_uInt32(nColor)); + CPPUNIT_ASSERT_EQUAL(aColor, nColor); } void testNegativeColor(uno::Reference<beans::XPropertySet> const & xPropSet, Color aColor) { - sal_Int32 nColor = 0; + ::Color nColor; uno::Any aAny = xPropSet->getPropertyValue("NegativeColor"); CPPUNIT_ASSERT(aAny >>= nColor); - CPPUNIT_ASSERT_EQUAL(aColor.GetColor(), sal_uInt32(nColor)); + CPPUNIT_ASSERT_EQUAL(aColor, nColor); } void testAxisColor(uno::Reference<beans::XPropertySet> const & xPropSet, Color aColor) { - sal_Int32 nColor = 0; + ::Color nColor; uno::Any aAny = xPropSet->getPropertyValue("AxisColor"); CPPUNIT_ASSERT(aAny >>= nColor); - CPPUNIT_ASSERT_EQUAL(aColor.GetColor(), sal_uInt32(nColor)); + CPPUNIT_ASSERT_EQUAL(aColor, nColor); } void testDataBarEntryValue(uno::Reference<sheet::XDataBarEntry> const & xEntry, diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx index fe073203818b..688378166014 100644 --- a/sc/qa/unit/subsequent_export-test.cxx +++ b/sc/qa/unit/subsequent_export-test.cxx @@ -2691,7 +2691,7 @@ void ScExportTest::testSheetTabColorsXLSX() for (size_t i = 0; i < SAL_N_ELEMENTS(aXclColors); ++i) { - if (aXclColors[i] != rDoc.GetTabBgColor(i).GetColor()) + if (aXclColors[i] != rDoc.GetTabBgColor(i)) { cerr << "wrong sheet color for sheet " << i << endl; return false; diff --git a/sd/qa/unit/export-tests-ooxml1.cxx b/sd/qa/unit/export-tests-ooxml1.cxx index 54e411a482f7..8c920a516973 100644 --- a/sd/qa/unit/export-tests-ooxml1.cxx +++ b/sd/qa/unit/export-tests-ooxml1.cxx @@ -377,12 +377,12 @@ void SdOOXMLExportTest1::testBnc880763() CPPUNIT_ASSERT(pObjGroup); const SdrObject *pObj = pObjGroup->GetSubList()->GetObj(0); CPPUNIT_ASSERT_MESSAGE( "no object", pObj != nullptr); - CPPUNIT_ASSERT_EQUAL( sal_uInt32(0x0000ff),(static_cast< const XColorItem& >(pObj->GetMergedItem(XATTR_FILLCOLOR))).GetColorValue().GetColor()); + CPPUNIT_ASSERT_EQUAL( Color(0x0000ff),(static_cast< const XColorItem& >(pObj->GetMergedItem(XATTR_FILLCOLOR))).GetColorValue()); // Second object at the front has green background color pObj = pPage->GetObj(2); // FIXME should be 1, smartart import creates an additional empty group for some reason CPPUNIT_ASSERT_MESSAGE( "no object", pObj != nullptr); - CPPUNIT_ASSERT_EQUAL( sal_uInt32(0x00ff00),(static_cast< const XColorItem& >(pObj->GetMergedItem(XATTR_FILLCOLOR))).GetColorValue().GetColor()); + CPPUNIT_ASSERT_EQUAL( Color(0x00ff00),(static_cast< const XColorItem& >(pObj->GetMergedItem(XATTR_FILLCOLOR))).GetColorValue()); xDocShRef->DoClose(); } @@ -617,7 +617,7 @@ void SdOOXMLExportTest1::testBulletColor() const EditTextObject& aEdit = pTxtObj->GetOutlinerParaObject()->GetTextObject(); const SvxNumBulletItem *pNumFmt = aEdit.GetParaAttribs(0).GetItem(EE_PARA_NUMBULLET); CPPUNIT_ASSERT(pNumFmt); - CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bullet's color is wrong!", sal_uInt32(0xff0000),pNumFmt->GetNumRule()->GetLevel(0).GetBulletColor().GetColor()); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bullet's color is wrong!", Color(0xff0000),pNumFmt->GetNumRule()->GetLevel(0).GetBulletColor()); xDocShRef->DoClose(); } diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index bc343af65ba5..27265d21bb21 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -450,7 +450,7 @@ void SdImportTest::testN862510_4() for( std::vector<EECharAttrib>::reverse_iterator it = rLst.rbegin(); it != rLst.rend(); ++it ) { const SvxColorItem *pC = dynamic_cast<const SvxColorItem *>( (*it).pAttr ); - CPPUNIT_ASSERT_MESSAGE( "gradfill for text color not handled!", !( pC && pC->GetValue().GetColor() == 0 ) ); + CPPUNIT_ASSERT_MESSAGE( "gradfill for text color not handled!", !( pC && pC->GetValue() == Color(0) ) ); } } @@ -1774,7 +1774,7 @@ void SdImportTest::testTdf103477() const EditTextObject& aEdit = pTxtObj->GetOutlinerParaObject()->GetTextObject(); const SvxNumBulletItem *pNumFmt = aEdit.GetParaAttribs(0).GetItem(EE_PARA_NUMBULLET); CPPUNIT_ASSERT(pNumFmt); - CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bullet's color is wrong!", sal_uInt32(0x000000), pNumFmt->GetNumRule()->GetLevel(1).GetBulletColor().GetColor()); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bullet's color is wrong!", Color(0x000000), pNumFmt->GetNumRule()->GetLevel(1).GetBulletColor()); xDocShRef->DoClose(); } diff --git a/sd/qa/unit/sdmodeltestbase.hxx b/sd/qa/unit/sdmodeltestbase.hxx index 512e945cad86..a51bc3c260a1 100644 --- a/sd/qa/unit/sdmodeltestbase.hxx +++ b/sd/qa/unit/sdmodeltestbase.hxx @@ -412,7 +412,7 @@ template<> struct assertion_traits<Color> static std::string toString( const Color& c ) { OStringStream ost; - ost << static_cast<unsigned int>(c.GetColor()); + ost << static_cast<sal_uInt32>(c); return ost.str(); } }; diff --git a/vcl/quartz/salbmp.cxx b/vcl/quartz/salbmp.cxx index dde6470aeb08..f9a10a44020b 100644 --- a/vcl/quartz/salbmp.cxx +++ b/vcl/quartz/salbmp.cxx @@ -465,7 +465,7 @@ public: } virtual Color ReadPixel() override { - return mrPalette[ *pData++ ].GetColor().GetColor(); + return mrPalette[ *pData++ ].GetColor(); } virtual void WritePixel( Color nColor ) override { @@ -508,7 +508,7 @@ public: const BitmapColor& rColor = mrPalette[( pData[mnX >> 1] >> mnShift) & 0x0f]; mnX++; mnShift ^= 4; - return rColor.GetColor().GetColor(); + return rColor.GetColor(); } virtual void WritePixel( Color nColor ) override { @@ -546,7 +546,7 @@ public: { const BitmapColor& rColor = mrPalette[ (pData[mnX >> 3 ] >> ( 7 - ( mnX & 7 ) )) & 1]; mnX++; - return rColor.GetColor().GetColor(); + return rColor.GetColor(); } virtual void WritePixel( Color nColor ) override { |