summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--extensions/source/propctrlr/standardcontrol.cxx36
-rw-r--r--svx/source/tbxctrls/tbcontrl.cxx9
2 files changed, 17 insertions, 28 deletions
diff --git a/extensions/source/propctrlr/standardcontrol.cxx b/extensions/source/propctrlr/standardcontrol.cxx
index af15abfb508e..b99445c6e315 100644
--- a/extensions/source/propctrlr/standardcontrol.cxx
+++ b/extensions/source/propctrlr/standardcontrol.cxx
@@ -642,47 +642,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 ) throw (IllegalTypeException, RuntimeException, std::exception)
{
- 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() throw (RuntimeException, std::exception)
{
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;
}
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 95ec9f400143..7b5a6cfd7843 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -1300,6 +1300,11 @@ SvxColorWindow::SvxColorWindow(const OUString& rCommand,
mpButtonAutoColor->SetText( SVX_RESSTR( RID_SVXSTR_AUTOMATIC ) );
break;
}
+ case SID_FM_CTL_PROPERTIES:
+ {
+ mpButtonAutoColor->SetText( SVX_RESSTR( RID_SVXSTR_AUTOMATIC ) );
+ break;
+ }
default:
{
mpButtonAutoColor->Hide();
@@ -1499,6 +1504,10 @@ namespace
aColor = COL_TRANSPARENT;
sColorName = SVX_RESSTR(RID_SVXSTR_TRANSPARENT);
break;
+ case SID_FM_CTL_PROPERTIES:
+ aColor = COL_TRANSPARENT;
+ sColorName = SVX_RESSTR(RID_SVXSTR_AUTOMATIC);
+ break;
case SID_ATTR_CHAR_COLOR:
case SID_ATTR_CHAR_COLOR2:
case SID_EXTRUSION_3D_COLOR: