Kaydet (Commit) 42603325 authored tarafından Maxim Monastirsky's avatar Maxim Monastirsky

reportdesign: Fix applying the last used color

The last used color is stored inside
SvxColorToolBoxControl, so we must call its Select method
to do that. (This also fixes using the last shape, See
commit ce842113ae728e8995c7c5398204a20d0707e843 for a
fix of exactly the same problem in chart2.)

For the font color, there was also another problem:
The SID used for that button is SID_ATTR_CHAR_COLOR2.
The problem is that SvxColorToolBoxControl::Select
actually calls for that SID the ".uno:CharColorExt"
command instead of ".uno:FontColor" (which activates
in writer the format paintbrush mode). Given that since
commit 584b4159 this
command also receives the last used color as argument,
the easiest solution is to register ".uno:CharColorExt"
here as well.

Change-Id: I2db25a7fb537ce10dfec7b1c2d049dd77d9f8f6b
üst 209eea54
......@@ -71,6 +71,7 @@ namespace rptui
virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
// XToolbarController
virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > SAL_CALL createPopupWindow() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
virtual void SAL_CALL execute( sal_Int16 KeyModifier ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
// XSubToolbarController
virtual sal_Bool SAL_CALL opensSubToolbar( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
......
......@@ -276,6 +276,12 @@ Reference< awt::XWindow > SAL_CALL OToolboxController::createPopupWindow() throw
return xRet;
}
void SAL_CALL OToolboxController::execute( sal_Int16 KeyModifier ) throw (uno::RuntimeException, std::exception)
{
if ( m_pToolbarController.is() )
m_pToolbarController.getRef()->execute( KeyModifier );
}
sal_Bool SAL_CALL OToolboxController::opensSubToolbar() throw (uno::RuntimeException, std::exception)
{
return ( m_nSlotId == SID_DRAWTBX_CS_BASIC ||
......
......@@ -1462,6 +1462,7 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >
break;
case SID_ATTR_CHAR_COLOR:
case SID_ATTR_CHAR_COLOR2:
case SID_ATTR_CHAR_COLOR_EXT:
{
const SequenceAsHashMap aMap(aArgs);
const util::Color aColor = aMap.getUnpackedValueOrDefault(PROPERTY_FONTCOLOR,util::Color());
......@@ -1857,6 +1858,7 @@ void OReportController::describeSupportedFeatures()
implDescribeSupportedFeature( ".uno:Underline", SID_ATTR_CHAR_UNDERLINE, CommandGroup::FORMAT );
implDescribeSupportedFeature( ".uno:BackColor", SID_ATTR_CHAR_COLOR_BACKGROUND, CommandGroup::FORMAT );
implDescribeSupportedFeature( ".uno:BackgroundColor", SID_BACKGROUND_COLOR, CommandGroup::FORMAT );
implDescribeSupportedFeature( ".uno:CharColorExt", SID_ATTR_CHAR_COLOR_EXT);
implDescribeSupportedFeature( ".uno:Color", SID_ATTR_CHAR_COLOR);
implDescribeSupportedFeature( ".uno:FontColor", SID_ATTR_CHAR_COLOR2, CommandGroup::FORMAT );
implDescribeSupportedFeature( ".uno:FontDialog", SID_CHAR_DLG, CommandGroup::FORMAT );
......
......@@ -128,11 +128,13 @@ SfxPopupWindow* SvxTbxCtlCustomShapes::CreatePopupWindow()
void SvxTbxCtlCustomShapes::Select(sal_uInt16 /*nSelectModifier*/)
void SvxTbxCtlCustomShapes::Select(sal_uInt16 nSelectModifier)
{
if ( !m_aCommand.isEmpty() )
{
com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > aParamSeq( 0 );
com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > aParamSeq( 1 );
aParamSeq[0].Name = "KeyModifier";
aParamSeq[0].Value <<= static_cast< sal_Int16 >( nSelectModifier );
Dispatch( m_aCommand, aParamSeq );
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment