summaryrefslogtreecommitdiff
path: root/extensions
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-05-22 12:05:17 +0100
committerCaolán McNamara <caolanm@redhat.com>2017-05-22 13:55:22 +0200
commit7539c77fd49889015ad3a952009e33fac5324df6 (patch)
treecbd8ef4889bd894728ab717da68e1e81f6a0e1ba /extensions
parent24b577127d16810a809b19e7ec869509fae8b901 (diff)
Resolves: tdf#107981 SID_FM_CTL_PROPERTIES colorbox needs a 'default' entry
we don't need MakeHexStr either, the colorbox will do that on its own Change-Id: Ifad523092c0f15cd51d0d829790c0cec1c96bb53 Reviewed-on: https://gerrit.libreoffice.org/37898 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'extensions')
-rw-r--r--extensions/source/propctrlr/standardcontrol.cxx36
1 files changed, 8 insertions, 28 deletions
diff --git a/extensions/source/propctrlr/standardcontrol.cxx b/extensions/source/propctrlr/standardcontrol.cxx
index 4fdecfc2dd67..242074428e10 100644
--- a/extensions/source/propctrlr/standardcontrol.cxx
+++ b/extensions/source/propctrlr/standardcontrol.cxx
@@ -643,47 +643,27 @@ namespace pcr
#define LB_DEFAULT_COUNT 20
- OUString MakeHexStr(sal_uInt32 nVal, sal_Int32 nLength)
- {
- OUStringBuffer aStr;
- while (nVal>0)
- {
- char c = char(nVal & 0x000F);
- nVal >>= 4;
- if (c<=9) c += '0';
- else c += 'A' - 10;
- aStr.insert(0, c);
- }
- while (aStr.getLength() < nLength) aStr.insert(0, '0');
- return aStr.makeStringAndClear();
- }
-
OColorControl::OColorControl(vcl::Window* pParent, WinBits nWinStyle)
: OColorControl_Base(PropertyControlType::ColorListBox, pParent, nWinStyle)
{
+ getTypedControlWindow()->SetSlotId(SID_FM_CTL_PROPERTIES);
}
void SAL_CALL OColorControl::setValue( const Any& _rValue )
{
- if ( _rValue.hasValue() )
- {
- css::util::Color nColor = COL_TRANSPARENT;
+ css::util::Color nColor = COL_TRANSPARENT;
+ if (_rValue.hasValue())
_rValue >>= nColor;
- ::Color aRgbCol((ColorData)nColor);
- getTypedControlWindow()->SelectEntry(std::make_pair(aRgbCol, MakeHexStr(nColor, 8)));
- }
- else
- getTypedControlWindow()->SetNoSelection();
+ getTypedControlWindow()->SelectEntry(::Color((ColorData)nColor));
}
Any SAL_CALL OColorControl::getValue()
{
Any aPropValue;
- if (!getTypedControlWindow()->IsNoSelection())
- {
- ::Color aRgbCol = getTypedControlWindow()->GetSelectEntryColor();
- aPropValue <<= (css::util::Color)aRgbCol.GetColor();
- }
+ ::Color aRgbCol = getTypedControlWindow()->GetSelectEntryColor();
+ if (aRgbCol == COL_TRANSPARENT)
+ return aPropValue;
+ aPropValue <<= (css::util::Color)aRgbCol.GetColor();
return aPropValue;
}