diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-03-06 11:11:12 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-03-06 12:52:32 +0100 |
commit | 4a0ca3a2ec5290419617b6dace216e981b03254e (patch) | |
tree | 464ac48c91ac5610436f7c50790ed9b08d912405 | |
parent | b8b7f8a8f8d97088181d287bb75e74facece16c6 (diff) |
use more Color in svx
Change-Id: I78ea8db0d9c882cdc3813ff4fac0cdce9caf6ad1
Reviewed-on: https://gerrit.libreoffice.org/50801
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
25 files changed, 93 insertions, 97 deletions
diff --git a/svx/source/accessibility/AccessibleFrameSelector.cxx b/svx/source/accessibility/AccessibleFrameSelector.cxx index 470f9275874e..4f31f7665b7c 100644 --- a/svx/source/accessibility/AccessibleFrameSelector.cxx +++ b/svx/source/accessibility/AccessibleFrameSelector.cxx @@ -353,14 +353,14 @@ sal_Int32 AccFrameSelector::getForeground( ) { SolarMutexGuard aGuard; IsValid(); - return mpFrameSel->GetControlForeground().GetColor(); + return sal_Int32(mpFrameSel->GetControlForeground()); } sal_Int32 AccFrameSelector::getBackground( ) { SolarMutexGuard aGuard; IsValid(); - return mpFrameSel->GetControlBackground().GetColor(); + return sal_Int32(mpFrameSel->GetControlBackground()); } void AccFrameSelector::addAccessibleEventListener( const Reference< XAccessibleEventListener >& xListener ) diff --git a/svx/source/accessibility/AccessibleShape.cxx b/svx/source/accessibility/AccessibleShape.cxx index cd3a84889f86..c7ca57d87d8e 100644 --- a/svx/source/accessibility/AccessibleShape.cxx +++ b/svx/source/accessibility/AccessibleShape.cxx @@ -685,7 +685,7 @@ sal_Int32 SAL_CALL AccessibleShape::getForeground() sal_Int32 SAL_CALL AccessibleShape::getBackground() { ThrowIfDisposed (); - sal_Int32 nColor (0); + Color nColor; try { @@ -708,14 +708,14 @@ sal_Int32 SAL_CALL AccessibleShape::getBackground() nTrans = short(256 - nTrans / 100. * 256); crBk.SetTransparency(sal_uInt8(nTrans)); } - nColor = crBk.GetColor(); + nColor = crBk; } } catch (const css::beans::UnknownPropertyException &) { // Ignore exception and return default color. } - return nColor; + return sal_Int32(nColor); } // XAccessibleEventBroadcaster diff --git a/svx/source/accessibility/GraphCtlAccessibleContext.cxx b/svx/source/accessibility/GraphCtlAccessibleContext.cxx index 57585a5715f3..5b886c8a7d4d 100644 --- a/svx/source/accessibility/GraphCtlAccessibleContext.cxx +++ b/svx/source/accessibility/GraphCtlAccessibleContext.cxx @@ -439,7 +439,7 @@ sal_Int32 SAL_CALL SvxGraphCtrlAccessibleContext::getForeground() sal_Int32 SAL_CALL SvxGraphCtrlAccessibleContext::getBackground() { - sal_uInt32 nColor = Application::GetSettings().GetStyleSettings().GetWindowColor().GetColor(); + Color nColor = Application::GetSettings().GetStyleSettings().GetWindowColor(); return static_cast<sal_Int32>(nColor); } diff --git a/svx/source/accessibility/charmapacc.cxx b/svx/source/accessibility/charmapacc.cxx index 02b67240f626..1f19eafc2fff 100644 --- a/svx/source/accessibility/charmapacc.cxx +++ b/svx/source/accessibility/charmapacc.cxx @@ -760,11 +760,11 @@ sal_Int32 SAL_CALL SvxShowCharSetVirtualAcc::getForeground( ) { OExternalLockGuard aGuard( this ); - sal_Int32 nColor = 0; + Color nColor; if ( mpParent ) { if ( mpParent->IsControlForeground() ) - nColor = mpParent->GetControlForeground().GetColor(); + nColor = mpParent->GetControlForeground(); else { vcl::Font aFont; @@ -772,26 +772,26 @@ sal_Int32 SAL_CALL SvxShowCharSetVirtualAcc::getForeground( ) aFont = mpParent->GetControlFont(); else aFont = mpParent->GetFont(); - nColor = aFont.GetColor().GetColor(); + nColor = aFont.GetColor(); } } - return nColor; + return sal_Int32(nColor); } sal_Int32 SAL_CALL SvxShowCharSetVirtualAcc::getBackground( ) { OExternalLockGuard aGuard( this ); - sal_Int32 nColor = 0; + Color nColor; if ( mpParent ) { if ( mpParent->IsControlBackground() ) - nColor = mpParent->GetControlBackground().GetColor(); + nColor = mpParent->GetControlBackground(); else - nColor = mpParent->GetBackground().GetColor().GetColor(); + nColor = mpParent->GetBackground().GetColor(); } - return nColor; + return sal_Int32(nColor); } sal_Int32 SAL_CALL SvxShowCharSetAcc::getForeground( ) diff --git a/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx b/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx index c97f280eb1c3..181db684e748 100644 --- a/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx +++ b/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx @@ -264,13 +264,13 @@ void SvxPixelCtlAccessible::grabFocus( ) sal_Int32 SvxPixelCtlAccessible::getForeground( ) { ::osl::MutexGuard aGuard( m_aMutex ); - return mrPixelCtl.GetControlForeground().GetColor(); + return sal_Int32(mrPixelCtl.GetControlForeground()); } sal_Int32 SvxPixelCtlAccessible::getBackground( ) { ::osl::MutexGuard aGuard( m_aMutex ); - return mrPixelCtl.GetControlBackground().GetColor(); + return sal_Int32(mrPixelCtl.GetControlBackground()); } OUString SvxPixelCtlAccessible::getImplementationName( ) @@ -596,14 +596,14 @@ sal_Int32 SvxPixelCtlAccessibleChild::getForeground( ) { ::osl::MutexGuard aGuard( m_aMutex ); ThrowExceptionIfNotAlive(); - return mrParentWindow.GetControlForeground().GetColor(); + return sal_Int32(mrParentWindow.GetControlForeground()); } sal_Int32 SvxPixelCtlAccessibleChild::getBackground( ) { ::osl::MutexGuard aGuard( m_aMutex ); ThrowExceptionIfNotAlive(); - return mrParentWindow.GetControlBackground().GetColor(); + return sal_Int32(mrParentWindow.GetControlBackground()); } // XAccessibleContext diff --git a/svx/source/accessibility/svxrectctaccessiblecontext.cxx b/svx/source/accessibility/svxrectctaccessiblecontext.cxx index 4405b70bcaa8..bc0d4501d60d 100644 --- a/svx/source/accessibility/svxrectctaccessiblecontext.cxx +++ b/svx/source/accessibility/svxrectctaccessiblecontext.cxx @@ -398,7 +398,7 @@ sal_Int32 SvxRectCtlAccessibleContext::getForeground( ) ::osl::MutexGuard aGuard( m_aMutex ); ThrowExceptionIfNotAlive(); - return mpRepr->GetControlForeground().GetColor(); + return sal_Int32(mpRepr->GetControlForeground()); } sal_Int32 SvxRectCtlAccessibleContext::getBackground( ) { @@ -406,7 +406,7 @@ sal_Int32 SvxRectCtlAccessibleContext::getBackground( ) ::osl::MutexGuard aGuard( m_aMutex ); ThrowExceptionIfNotAlive(); - return mpRepr->GetControlBackground().GetColor(); + return sal_Int32(mpRepr->GetControlBackground()); } // XServiceInfo @@ -708,7 +708,7 @@ sal_Int32 SvxRectCtlChildAccessibleContext::getForeground( ) ::SolarMutexGuard aSolarGuard; ::osl::MutexGuard aGuard( maMutex ); ThrowExceptionIfNotAlive(); - return mrParentWindow.GetControlForeground().GetColor(); + return sal_Int32(mrParentWindow.GetControlForeground()); } sal_Int32 SvxRectCtlChildAccessibleContext::getBackground( ) { @@ -716,7 +716,7 @@ sal_Int32 SvxRectCtlChildAccessibleContext::getBackground( ) ::osl::MutexGuard aGuard( maMutex ); ThrowExceptionIfNotAlive(); - return mrParentWindow.GetControlBackground().GetColor(); + return sal_Int32(mrParentWindow.GetControlBackground()); } // XAccessibleContext diff --git a/svx/source/dialog/fntctrl.cxx b/svx/source/dialog/fntctrl.cxx index b95ff217f943..276f3ab607d5 100644 --- a/svx/source/dialog/fntctrl.cxx +++ b/svx/source/dialog/fntctrl.cxx @@ -839,13 +839,13 @@ void SvxFontPrevWindow::AutoCorrectFontColor() { Color aFontColor( GetTextColor() ); - if (COL_AUTO == pImpl->maFont.GetColor().GetColor()) + if (COL_AUTO == pImpl->maFont.GetColor()) pImpl->maFont.SetColor(aFontColor); - if (COL_AUTO == pImpl->maCJKFont.GetColor().GetColor()) + if (COL_AUTO == pImpl->maCJKFont.GetColor()) pImpl->maCJKFont.SetColor(aFontColor); - if (COL_AUTO == pImpl->maCTLFont.GetColor().GetColor()) + if (COL_AUTO == pImpl->maCTLFont.GetColor()) pImpl->maCTLFont.SetColor(aFontColor); } diff --git a/svx/source/dialog/svxruler.cxx b/svx/source/dialog/svxruler.cxx index ebfbefd4139a..a699ab62fbc8 100644 --- a/svx/source/dialog/svxruler.cxx +++ b/svx/source/dialog/svxruler.cxx @@ -3617,4 +3617,4 @@ void SvxRuler::SetValues(RulerChangeType type, long diffValue) else if (type == RulerChangeType::MARGIN2) SetMargin2( GetMargin2() - diffValue); ApplyMargins(); -}
\ No newline at end of file +} diff --git a/svx/source/fmcomp/fmgridif.cxx b/svx/source/fmcomp/fmgridif.cxx index 96200e7776cd..742db63c6cff 100644 --- a/svx/source/fmcomp/fmgridif.cxx +++ b/svx/source/fmcomp/fmgridif.cxx @@ -1821,7 +1821,7 @@ void FmXGridPeer::setProperty( const OUString& PropertyName, const Any& Value) if ( PropertyName == FM_PROP_TEXTLINECOLOR ) { - ::Color aTextLineColor( bVoid ? COL_TRANSPARENT : ::comphelper::getINT32( Value ) ); + ::Color aTextLineColor( bVoid ? COL_TRANSPARENT : ::Color(::comphelper::getINT32( Value )) ); if (bVoid) { pGrid->SetTextLineColor(); @@ -2038,11 +2038,11 @@ Any FmXGridPeer::getProperty( const OUString& _rPropertyName ) } else if ( _rPropertyName == FM_PROP_TEXTCOLOR ) { - aProp <<= static_cast<sal_Int32>(pDataWindow->GetControlForeground().GetColor()); + aProp <<= pDataWindow->GetControlForeground(); } else if ( _rPropertyName == FM_PROP_BACKGROUNDCOLOR ) { - aProp <<= static_cast<sal_Int32>(pDataWindow->GetControlBackground().GetColor()); + aProp <<= pDataWindow->GetControlBackground(); } else if ( _rPropertyName == FM_PROP_ROWHEIGHT ) { diff --git a/svx/source/form/fmcontrolbordermanager.cxx b/svx/source/form/fmcontrolbordermanager.cxx index 3e4824f4e762..301b146b933f 100644 --- a/svx/source/form/fmcontrolbordermanager.cxx +++ b/svx/source/form/fmcontrolbordermanager.cxx @@ -150,7 +150,7 @@ namespace svxform } - sal_Int32 ControlBorderManager::getControlColorByStatus( ControlStatus _nStatus ) + Color ControlBorderManager::getControlColorByStatus( ControlStatus _nStatus ) { // "invalid" is ranked highest if ( _nStatus & ControlStatus::Invalid ) @@ -165,7 +165,7 @@ namespace svxform return m_nMouseHoveColor; OSL_FAIL( "ControlBorderManager::getControlColorByStatus: invalid status!" ); - return 0x00000000; + return Color(0); } @@ -282,7 +282,7 @@ namespace svxform } - void ControlBorderManager::setStatusColor( ControlStatus _nStatus, sal_Int32 _nColor ) + void ControlBorderManager::setStatusColor( ControlStatus _nStatus, Color _nColor ) { switch ( _nStatus ) { diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx index 5fc8ea4f226b..3af5b2fdddc7 100644 --- a/svx/source/form/fmshimp.cxx +++ b/svx/source/form/fmshimp.cxx @@ -2259,7 +2259,7 @@ IMPL_LINK(FmXFormShell, OnFoundData_Lock, FmFoundRecordInformation&, rfriWhere, Reference< XPropertySet> xModelSet(xControlModel, UNO_QUERY); DBG_ASSERT(xModelSet.is(), "FmXFormShell::OnFoundData : invalid control model (no property set) !"); xModelSet->setPropertyValue( FM_PROP_ALWAYSSHOWCURSOR, makeAny( true ) ); - xModelSet->setPropertyValue( FM_PROP_CURSORCOLOR, makeAny( sal_Int32( COL_LIGHTRED ) ) ); + xModelSet->setPropertyValue( FM_PROP_CURSORCOLOR, makeAny( COL_LIGHTRED ) ); m_xLastGridFound = xControlModel; if ( xGrid.is() ) diff --git a/svx/source/form/formcontroller.cxx b/svx/source/form/formcontroller.cxx index 2408b2bf30ae..40d1157461e5 100644 --- a/svx/source/form/formcontroller.cxx +++ b/svx/source/form/formcontroller.cxx @@ -1907,7 +1907,7 @@ void FormController::setModel(const Reference< XTabControllerModel > & Model) else m_aControlBorderManager.disableDynamicBorderColor(); - sal_Int32 nColor = 0; + Color nColor; if ( xModelProps->getPropertyValue( FM_PROP_CONTROL_BORDER_COLOR_FOCUS ) >>= nColor ) m_aControlBorderManager.setStatusColor( ControlStatus::Focused, nColor ); if ( xModelProps->getPropertyValue( FM_PROP_CONTROL_BORDER_COLOR_MOUSE ) >>= nColor ) diff --git a/svx/source/inc/fmcontrolbordermanager.hxx b/svx/source/inc/fmcontrolbordermanager.hxx index 56928376809b..9375d02934a5 100644 --- a/svx/source/inc/fmcontrolbordermanager.hxx +++ b/svx/source/inc/fmcontrolbordermanager.hxx @@ -26,6 +26,7 @@ #include <com/sun/star/awt/XVclWindowPeer.hpp> #include <comphelper/stl_types.hxx> #include <o3tl/typed_flags_set.hxx> +#include <tools/color.hxx> #include <set> @@ -51,11 +52,10 @@ namespace svxform struct BorderDescriptor { sal_Int16 nBorderType; - sal_Int32 nBorderColor; + Color nBorderColor; BorderDescriptor() :nBorderType( css::awt::VisualEffect::FLAT ) - ,nBorderColor( 0x00000000 ) { } }; @@ -63,15 +63,14 @@ namespace svxform struct UnderlineDescriptor { sal_Int16 nUnderlineType; - sal_Int32 nUnderlineColor; + Color nUnderlineColor; UnderlineDescriptor() :nUnderlineType( css::awt::FontUnderline::NONE ) - ,nUnderlineColor( 0x00000000 ) { } - UnderlineDescriptor( sal_Int16 _nUnderlineType, sal_Int32 _nUnderlineColor ) + UnderlineDescriptor( sal_Int16 _nUnderlineType, Color _nUnderlineColor ) :nUnderlineType( _nUnderlineType ) ,nUnderlineColor( _nUnderlineColor ) { @@ -124,9 +123,9 @@ namespace svxform // attributes - sal_Int32 m_nFocusColor; - sal_Int32 m_nMouseHoveColor; - sal_Int32 m_nInvalidColor; + Color m_nFocusColor; + Color m_nMouseHoveColor; + Color m_nInvalidColor; bool m_bDynamicBorderColors; public: @@ -155,7 +154,7 @@ namespace svxform @param _nColor the color to apply for the given status */ - void setStatusColor( ControlStatus _nStatus, sal_Int32 _nColor ); + void setStatusColor( ControlStatus _nStatus, Color _nColor ); /** restores all colors of all controls where we possibly changed them */ @@ -195,7 +194,7 @@ namespace svxform @param _eStatus the status of the control. Must not be <member>ControlStatus::none</member> */ - sal_Int32 getControlColorByStatus( ControlStatus _eStatus ); + Color getControlColorByStatus( ControlStatus _eStatus ); /** sets the border color for a given control, depending on its status @param _rxControl diff --git a/svx/source/sdr/overlay/overlaymanagerbuffered.cxx b/svx/source/sdr/overlay/overlaymanagerbuffered.cxx index d26367a646fc..c78f15990e63 100644 --- a/svx/source/sdr/overlay/overlaymanagerbuffered.cxx +++ b/svx/source/sdr/overlay/overlaymanagerbuffered.cxx @@ -317,7 +317,7 @@ namespace sdr *mpOutputBufferDevice.get()); // debug - /*getOutputDevice().SetLineColor(COL_RED); + /*getOutputDevice().SetLineCOL_RED); getOutputDevice().SetFillColor(); getOutputDevice().DrawRect(Rectangle(aTopLeft, aSize));*/ diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index ac46823402b7..af6977fc3cbe 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -276,9 +276,9 @@ namespace // TextDecoratedPortionPrimitive2D needed, prepare some more data // get overline and underline color. If it's on automatic (0xffffffff) use FontColor instead const Color aUnderlineColor(rInfo.maTextLineColor); - const basegfx::BColor aBUnderlineColor((0xffffffff == aUnderlineColor.GetColor()) ? aBFontColor : aUnderlineColor.getBColor()); + const basegfx::BColor aBUnderlineColor((Color(0xffffffff) == aUnderlineColor) ? aBFontColor : aUnderlineColor.getBColor()); const Color aOverlineColor(rInfo.maOverlineColor); - const basegfx::BColor aBOverlineColor((0xffffffff == aOverlineColor.GetColor()) ? aBFontColor : aOverlineColor.getBColor()); + const basegfx::BColor aBOverlineColor((Color(0xffffffff) == aOverlineColor) ? aBFontColor : aOverlineColor.getBColor()); // prepare overline and underline data const drawinglayer::primitive2d::TextLine eFontOverline( diff --git a/svx/source/svdraw/svdpagv.cxx b/svx/source/svdraw/svdpagv.cxx index 728c06b861c3..9be7f874c8b1 100644 --- a/svx/source/svdraw/svdpagv.cxx +++ b/svx/source/svdraw/svdpagv.cxx @@ -135,7 +135,7 @@ SdrPageView::SdrPageView(SdrPage* pPage1, SdrView& rNewView) : mrView(rNewView), // col_auto color lets the view takes the default SvxColorConfig entry maDocumentColor( COL_AUTO ), - maBackgroundColor(COL_AUTO ), // #i48367# also react on autocolor + maBackgroundColor( COL_AUTO ), // #i48367# also react on autocolor mpPreparedPageWindow(nullptr) // #i72752# { mpPage = pPage1; diff --git a/svx/source/svdraw/svdpntv.cxx b/svx/source/svdraw/svdpntv.cxx index d10a49689d2a..88c6856c616a 100644 --- a/svx/source/svdraw/svdpntv.cxx +++ b/svx/source/svdraw/svdpntv.cxx @@ -595,7 +595,7 @@ void SdrPaintView::CompleteRedraw(OutputDevice* pOut, const vcl::Region& rReg, s //while(aOptimizedRepaintRegion.GetEnumRects(aRegionHandle, aRegionRectangle)) //{ - // pWindow->SetLineColor(COL_LIGHTGREEN); + // pWindow->SetLineCOL_LIGHTGREEN); // pWindow->SetFillColor(); // pWindow->DrawRect(aRegionRectangle); //} diff --git a/svx/source/tbxctrls/PaletteManager.cxx b/svx/source/tbxctrls/PaletteManager.cxx index ff8117085e58..32b3aa11edf6 100644 --- a/svx/source/tbxctrls/PaletteManager.cxx +++ b/svx/source/tbxctrls/PaletteManager.cxx @@ -284,7 +284,7 @@ void PaletteManager::AddRecentColor(const Color& rRecentColor, const OUString& r css::uno::Sequence< OUString > aColorNameList(maRecentColors.size()); for (size_t i = 0; i < maRecentColors.size(); ++i) { - aColorList[i] = static_cast<sal_Int32>(maRecentColors[i].first.GetColor()); + aColorList[i] = static_cast<sal_Int32>(maRecentColors[i].first); aColorNameList[i] = maRecentColors[i].second; } std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create(m_context)); @@ -341,7 +341,7 @@ void PaletteManager::DispatchColorCommand(const OUString& aCommand, const NamedC Sequence<PropertyValue> aArgs(1); aArgs[0].Name = aObj.GetURLPath(); - aArgs[0].Value <<= sal_Int32(rColor.first.GetColor()); + aArgs[0].Value <<= sal_Int32(rColor.first); URL aTargetURL; aTargetURL.Complete = aCommand; diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index e839dbed3d56..14d6441feee9 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -1553,7 +1553,7 @@ void SvxColorWindow::statusChanged( const css::frame::FeatureStateEvent& rEvent { sal_Int32 nValue; if (rEvent.State >>= nValue) - aColor = nValue; + aColor = Color(nValue); } SelectEntry(aColor); @@ -1631,9 +1631,8 @@ bool BorderColorStatus::statusChanged( const css::frame::FeatureStateEvent& rEve if ( rEvent.FeatureURL.Complete == ".uno:FrameLineColor" ) { - sal_Int32 nValue; - if ( rEvent.IsEnabled && ( rEvent.State >>= nValue ) ) - aColor = nValue; + if ( rEvent.IsEnabled ) + rEvent.State >>= aColor; maColor = aColor; return true; @@ -1642,7 +1641,7 @@ bool BorderColorStatus::statusChanged( const css::frame::FeatureStateEvent& rEve { css::table::BorderLine2 aTable; if ( rEvent.IsEnabled && ( rEvent.State >>= aTable ) ) - aColor = aTable.Color; + aColor = Color(aTable.Color); if ( rEvent.FeatureURL.Complete == ".uno:BorderTLBR" ) { @@ -2902,9 +2901,7 @@ void SvxColorToolBoxControl::statusChanged( const css::frame::FeatureStateEvent& } else if ( rEvent.IsEnabled ) { - sal_Int32 nValue; - if ( rEvent.State >>= nValue ) - aColor = nValue; + rEvent.State >>= aColor; } m_xBtnUpdater->Update( aColor ); if (m_xPaletteManager) @@ -2940,7 +2937,7 @@ void SvxColorToolBoxControl::execute(sal_Int16 /*nSelectModifier*/) Color aColor = m_xPaletteManager->GetLastColor(); auto aArgs( comphelper::InitPropertySequence( { - { m_aCommandURL.copy(5), css::uno::makeAny( m_xPaletteManager->GetLastColor().GetColor() ) } + { m_aCommandURL.copy(5), css::uno::makeAny( m_xPaletteManager->GetLastColor() ) } } ) ); dispatchCommand( aCommand, aArgs ); diff --git a/svx/source/tbxctrls/tbxcolorupdate.cxx b/svx/source/tbxctrls/tbxcolorupdate.cxx index 3529584cc3ae..07d952e42368 100644 --- a/svx/source/tbxctrls/tbxcolorupdate.cxx +++ b/svx/source/tbxctrls/tbxcolorupdate.cxx @@ -93,7 +93,7 @@ namespace svx mbWasHiContrastMode = mpTbx->GetSettings().GetStyleSettings().GetHighContrastMode(); - if ((COL_TRANSPARENT != aColor.GetColor()) && (maBmpSize.Width() == maBmpSize.Height())) + if ((COL_TRANSPARENT != aColor) && (maBmpSize.Width() == maBmpSize.Height())) pVirDev->SetLineColor(aColor); else if( mpTbx->GetBackground().GetColor().IsDark() ) pVirDev->SetLineColor(COL_WHITE); diff --git a/svx/source/unodraw/XPropertyTable.cxx b/svx/source/unodraw/XPropertyTable.cxx index a2675cafa5f5..5b1f20f1902d 100644 --- a/svx/source/unodraw/XPropertyTable.cxx +++ b/svx/source/unodraw/XPropertyTable.cxx @@ -257,7 +257,7 @@ uno::Reference< uno::XInterface > SvxUnoXColorTable_createInstance( XPropertyLis // SvxUnoXPropertyTable uno::Any SvxUnoXColorTable::getAny( const XPropertyEntry* pEntry ) const throw() { - return uno::Any( static_cast<sal_Int32>(static_cast<const XColorEntry*>(pEntry)->GetColor().GetColor()) ); + return uno::Any( static_cast<sal_Int32>(static_cast<const XColorEntry*>(pEntry)->GetColor()) ); } std::unique_ptr<XPropertyEntry> SvxUnoXColorTable::createEntry(const OUString& rName, const uno::Any& rAny) const @@ -463,7 +463,7 @@ uno::Any SvxUnoXHatchTable::getAny( const XPropertyEntry* pEntry ) const throw() drawing::Hatch aUnoHatch; aUnoHatch.Style = aHatch.GetHatchStyle(); - aUnoHatch.Color = aHatch.GetColor().GetColor(); + aUnoHatch.Color = sal_Int32(aHatch.GetColor()); aUnoHatch.Distance = aHatch.GetDistance(); aUnoHatch.Angle = aHatch.GetAngle(); @@ -478,7 +478,7 @@ std::unique_ptr<XPropertyEntry> SvxUnoXHatchTable::createEntry(const OUString& r XHatch aXHatch; aXHatch.SetHatchStyle( aUnoHatch.Style ); - aXHatch.SetColor( aUnoHatch.Color ); + aXHatch.SetColor( Color(aUnoHatch.Color) ); aXHatch.SetDistance( aUnoHatch.Distance ); aXHatch.SetAngle( aUnoHatch.Angle ); @@ -534,8 +534,8 @@ uno::Any SvxUnoXGradientTable::getAny( const XPropertyEntry* pEntry ) const thro awt::Gradient aGradient; aGradient.Style = aXGradient.GetGradientStyle(); - aGradient.StartColor = static_cast<sal_Int32>(aXGradient.GetStartColor().GetColor()); - aGradient.EndColor = static_cast<sal_Int32>(aXGradient.GetEndColor().GetColor()); + aGradient.StartColor = static_cast<sal_Int32>(aXGradient.GetStartColor()); + aGradient.EndColor = static_cast<sal_Int32>(aXGradient.GetEndColor()); aGradient.Angle = static_cast<short>(aXGradient.GetAngle()); aGradient.Border = aXGradient.GetBorder(); aGradient.XOffset = aXGradient.GetXOffset(); @@ -556,8 +556,8 @@ std::unique_ptr<XPropertyEntry> SvxUnoXGradientTable::createEntry(const OUString XGradient aXGradient; aXGradient.SetGradientStyle( aGradient.Style ); - aXGradient.SetStartColor( aGradient.StartColor ); - aXGradient.SetEndColor( aGradient.EndColor ); + aXGradient.SetStartColor( Color(aGradient.StartColor) ); + aXGradient.SetEndColor( Color(aGradient.EndColor) ); aXGradient.SetAngle( aGradient.Angle ); aXGradient.SetBorder( aGradient.Border ); aXGradient.SetXOffset( aGradient.XOffset ); diff --git a/svx/source/unodraw/unobrushitemhelper.cxx b/svx/source/unodraw/unobrushitemhelper.cxx index b48e5c360c45..bc3015e5a9ee 100644 --- a/svx/source/unodraw/unobrushitemhelper.cxx +++ b/svx/source/unodraw/unobrushitemhelper.cxx @@ -198,7 +198,7 @@ SvxBrushItem getSvxBrushItemFromSourceSet(const SfxItemSet& rSourceSet, sal_uInt Color aFillColor(rSourceSet.Get(XATTR_FILLCOLOR, bSearchInParents).GetColorValue()); // for writerfilter: when fill style is none, then don't allow anything other than 0 or auto. - if (!bXMLImportHack && aFillColor.GetColor() != 0) + if (!bXMLImportHack && aFillColor != Color(0)) aFillColor = COL_AUTO; aFillColor.SetTransparency(0xff); diff --git a/svx/source/unodraw/unoctabl.cxx b/svx/source/unodraw/unoctabl.cxx index a2474deb9052..d6b0a443accb 100644 --- a/svx/source/unodraw/unoctabl.cxx +++ b/svx/source/unodraw/unoctabl.cxx @@ -114,7 +114,7 @@ void SAL_CALL SvxUnoColorTable::removeByName( const OUString& Name ) // XNameReplace void SAL_CALL SvxUnoColorTable::replaceByName( const OUString& aName, const uno::Any& aElement ) { - sal_Int32 nColor = 0; + Color nColor; if( !(aElement >>= nColor) ) throw lang::IllegalArgumentException(); @@ -122,7 +122,7 @@ void SAL_CALL SvxUnoColorTable::replaceByName( const OUString& aName, const uno: if( nIndex == -1 ) throw container::NoSuchElementException(); - pList->Replace(nIndex, o3tl::make_unique<XColorEntry>(static_cast<Color>(nColor), aName )); + pList->Replace(nIndex, o3tl::make_unique<XColorEntry>(nColor, aName )); } // XNameAccess diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx index 45cffa92bfae..a3c72b8dc74b 100644 --- a/svx/source/xoutdev/xattr.cxx +++ b/svx/source/xoutdev/xattr.cxx @@ -294,7 +294,7 @@ const Color& XColorItem::GetColorValue() const bool XColorItem::QueryValue( css::uno::Any& rVal, sal_uInt8 /*nMemberId*/) const { - rVal <<= static_cast<sal_Int32>(GetColorValue().GetRGBColor()); + rVal <<= GetColorValue().GetRGBColor(); return true; } @@ -302,7 +302,7 @@ bool XColorItem::PutValue( const css::uno::Any& rVal, sal_uInt8 /*nMemberId*/) { sal_Int32 nValue = 0; rVal >>= nValue; - SetColorValue( nValue ); + SetColorValue( Color(nValue) ); return true; } @@ -946,7 +946,7 @@ bool XLineColorItem::GetPresentation bool XLineColorItem::QueryValue( css::uno::Any& rVal, sal_uInt8 /*nMemberId*/) const { - rVal <<= static_cast<sal_Int32>(GetColorValue().GetRGBColor()); + rVal <<= GetColorValue().GetRGBColor(); return true; } @@ -956,7 +956,7 @@ bool XLineColorItem::PutValue( const css::uno::Any& rVal, sal_uInt8 /*nMemberId* if(!(rVal >>= nValue)) return false; - SetColorValue( nValue ); + SetColorValue( Color(nValue) ); return true; } @@ -1868,7 +1868,7 @@ bool XFillColorItem::GetPresentation bool XFillColorItem::QueryValue( css::uno::Any& rVal, sal_uInt8 /*nMemberId*/) const { - rVal <<= static_cast<sal_Int32>(GetColorValue().GetRGBColor()); + rVal <<= GetColorValue().GetRGBColor(); return true; } @@ -1879,7 +1879,7 @@ bool XFillColorItem::PutValue( const css::uno::Any& rVal, sal_uInt8 /*nMemberId* if(!(rVal >>= nValue )) return false; - SetColorValue( nValue ); + SetColorValue( Color(nValue) ); return true; } @@ -2046,8 +2046,8 @@ bool XFillGradientItem::QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId ) c const XGradient& aXGradient = GetGradientValue(); aGradient2.Style = aXGradient.GetGradientStyle(); - aGradient2.StartColor = static_cast<sal_Int32>(aXGradient.GetStartColor().GetColor()); - aGradient2.EndColor = static_cast<sal_Int32>(aXGradient.GetEndColor().GetColor()); + aGradient2.StartColor = static_cast<sal_Int32>(aXGradient.GetStartColor()); + aGradient2.EndColor = static_cast<sal_Int32>(aXGradient.GetEndColor()); aGradient2.Angle = static_cast<short>(aXGradient.GetAngle()); aGradient2.Border = aXGradient.GetBorder(); aGradient2.XOffset = aXGradient.GetXOffset(); @@ -2070,8 +2070,8 @@ bool XFillGradientItem::QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId ) c css::awt::Gradient aGradient2; aGradient2.Style = aXGradient.GetGradientStyle(); - aGradient2.StartColor = static_cast<sal_Int32>(aXGradient.GetStartColor().GetColor()); - aGradient2.EndColor = static_cast<sal_Int32>(aXGradient.GetEndColor().GetColor()); + aGradient2.StartColor = static_cast<sal_Int32>(aXGradient.GetStartColor()); + aGradient2.EndColor = static_cast<sal_Int32>(aXGradient.GetEndColor()); aGradient2.Angle = static_cast<short>(aXGradient.GetAngle()); aGradient2.Border = aXGradient.GetBorder(); aGradient2.XOffset = aXGradient.GetXOffset(); @@ -2091,8 +2091,8 @@ bool XFillGradientItem::QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId ) c } case MID_GRADIENT_STYLE: rVal <<= static_cast<sal_Int16>(GetGradientValue().GetGradientStyle()); break; - case MID_GRADIENT_STARTCOLOR: rVal <<= static_cast<sal_Int32>(GetGradientValue().GetStartColor().GetColor()); break; - case MID_GRADIENT_ENDCOLOR: rVal <<= static_cast<sal_Int32>(GetGradientValue().GetEndColor().GetColor()); break; + case MID_GRADIENT_STARTCOLOR: rVal <<= GetGradientValue().GetStartColor(); break; + case MID_GRADIENT_ENDCOLOR: rVal <<= GetGradientValue().GetEndColor(); break; case MID_GRADIENT_ANGLE: rVal <<= static_cast<sal_Int16>(GetGradientValue().GetAngle()); break; case MID_GRADIENT_BORDER: rVal <<= GetGradientValue().GetBorder(); break; case MID_GRADIENT_XOFFSET: rVal <<= GetGradientValue().GetXOffset(); break; @@ -2139,8 +2139,8 @@ bool XFillGradientItem::PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId XGradient aXGradient; aXGradient.SetGradientStyle( aGradient2.Style ); - aXGradient.SetStartColor( aGradient2.StartColor ); - aXGradient.SetEndColor( aGradient2.EndColor ); + aXGradient.SetStartColor( Color(aGradient2.StartColor) ); + aXGradient.SetEndColor( Color(aGradient2.EndColor) ); aXGradient.SetAngle( aGradient2.Angle ); aXGradient.SetBorder( aGradient2.Border ); aXGradient.SetXOffset( aGradient2.XOffset ); @@ -2176,8 +2176,8 @@ bool XFillGradientItem::PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId XGradient aXGradient; aXGradient.SetGradientStyle( aGradient2.Style ); - aXGradient.SetStartColor( aGradient2.StartColor ); - aXGradient.SetEndColor( aGradient2.EndColor ); + aXGradient.SetStartColor( Color(aGradient2.StartColor) ); + aXGradient.SetEndColor( Color(aGradient2.EndColor) ); aXGradient.SetAngle( aGradient2.Angle ); aXGradient.SetBorder( aGradient2.Border ); aXGradient.SetXOffset( aGradient2.XOffset ); @@ -2200,9 +2200,9 @@ bool XFillGradientItem::PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId XGradient aXGradient = GetGradientValue(); if ( nMemberId == MID_GRADIENT_STARTCOLOR ) - aXGradient.SetStartColor( nVal ); + aXGradient.SetStartColor( Color(nVal) ); else - aXGradient.SetEndColor( nVal ); + aXGradient.SetEndColor( Color(nVal) ); SetGradientValue( aXGradient ); break; } @@ -2463,7 +2463,7 @@ bool XFillHatchItem::QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId ) cons css::drawing::Hatch aUnoHatch; aUnoHatch.Style = aHatch.GetHatchStyle(); - aUnoHatch.Color = aHatch.GetColor().GetColor(); + aUnoHatch.Color = sal_Int32(aHatch.GetColor()); aUnoHatch.Distance = aHatch.GetDistance(); aUnoHatch.Angle = aHatch.GetAngle(); @@ -2480,7 +2480,7 @@ bool XFillHatchItem::QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId ) cons css::drawing::Hatch aUnoHatch; aUnoHatch.Style = aHatch.GetHatchStyle(); - aUnoHatch.Color = aHatch.GetColor().GetColor(); + aUnoHatch.Color = sal_Int32(aHatch.GetColor()); aUnoHatch.Distance = aHatch.GetDistance(); aUnoHatch.Angle = aHatch.GetAngle(); rVal <<= aUnoHatch; @@ -2496,7 +2496,7 @@ bool XFillHatchItem::QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId ) cons case MID_HATCH_STYLE: rVal <<= aHatch.GetHatchStyle(); break; case MID_HATCH_COLOR: - rVal <<= static_cast<sal_Int32>(aHatch.GetColor().GetColor()); break; + rVal <<= aHatch.GetColor(); break; case MID_HATCH_DISTANCE: rVal <<= aHatch.GetDistance(); break; case MID_HATCH_ANGLE: @@ -2537,7 +2537,7 @@ bool XFillHatchItem::PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) if ( bHatch ) { aHatch.SetHatchStyle( aUnoHatch.Style ); - aHatch.SetColor( aUnoHatch.Color ); + aHatch.SetColor( Color(aUnoHatch.Color) ); aHatch.SetDistance( aUnoHatch.Distance ); aHatch.SetAngle( aUnoHatch.Angle ); } @@ -2555,7 +2555,7 @@ bool XFillHatchItem::PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) return false; aHatch.SetHatchStyle( aUnoHatch.Style ); - aHatch.SetColor( aUnoHatch.Color ); + aHatch.SetColor( Color(aUnoHatch.Color) ); aHatch.SetDistance( aUnoHatch.Distance ); aHatch.SetAngle( aUnoHatch.Angle ); break; @@ -2588,7 +2588,7 @@ bool XFillHatchItem::PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) return false; if ( nMemberId == MID_HATCH_COLOR ) - aHatch.SetColor( nVal ); + aHatch.SetColor( Color(nVal) ); else if ( nMemberId == MID_HATCH_DISTANCE ) aHatch.SetDistance( nVal ); else diff --git a/svx/source/xoutdev/xtabcolr.cxx b/svx/source/xoutdev/xtabcolr.cxx index 3d3627cee23a..f8edca7ed90e 100644 --- a/svx/source/xoutdev/xtabcolr.cxx +++ b/svx/source/xoutdev/xtabcolr.cxx @@ -99,7 +99,7 @@ bool XColorList::Create() SvxResId(RID_SVXSTR_COLOR_TURQUOISE), SvxResId(RID_SVXSTR_COLOR_GREEN), SvxResId(RID_SVXSTR_COLOR_YELLOWGREEN) }; - const sal_uInt32 aStdCol[nNumColorsInGroup * nNumGroups] = { + static const sal_uInt32 aStdCol[nNumColorsInGroup * nNumGroups] = { 0xffff99, 0xff6600, 0xff3333, 0xff00cc, 0xff33ff, 0x9900ff, 0x6666ff, 0x00ccff, 0x66ffff, 0x33ff99, 0x99ff66, 0xccff00, 0xffff66, 0xffcc00, 0xff9999, 0xff66cc, 0xff99ff, 0xcc66ff, 0x9999ff, 0x9999ff, 0x99ffff, 0x66ff99, 0x99ff99, 0xccff66, 0xffff00, 0xff9900, 0xff6666, 0xff3399, 0xff66ff, 0x9933ff, 0x3333ff, 0x3399ff, 0x00ffff, 0x00ff66, 0x66ff66, 0x99ff33, @@ -121,7 +121,7 @@ bool XColorList::Create() for(b = 0; b < nNumColorsInGroup; b++) { - Insert( o3tl::make_unique<XColorEntry>( aStdCol[nOffset + b], aStrCol[b] + aSuffix ) ); + Insert( o3tl::make_unique<XColorEntry>( Color(aStdCol[nOffset + b]), aStrCol[b] + aSuffix ) ); } } |