diff --git a/sw/source/ui/shells/textsh1.cxx b/sw/source/ui/shells/textsh1.cxx index 1e8ef39..c2a0cf1 100644 --- a/sw/source/ui/shells/textsh1.cxx +++ b/sw/source/ui/shells/textsh1.cxx @@ -1120,17 +1120,20 @@ void SwTextShell::Execute(SfxRequest &rReq) if(pItem) { aSet = ((const SvxColorItem*)pItem)->GetValue(); - rEdtWin.SetTextBackColor(aSet); + rEdtWin.SetTextBackColor(aSet); //select last color } + else + rEdtWin.SetTextBackColor(Color(COL_TRANSPARENT)); //if last was "no fill" + if(!pApply && (rWrtSh.HasSelection() || rReq.IsAPI())) { SvxBrushItem aBrushItem(RES_CHRATR_BACKGROUND); if(pItem) - aBrushItem.SetColor(aSet); + aBrushItem.SetColor(aSet); //set the selected color else - aBrushItem.SetColor(Color(COL_TRANSPARENT)); + aBrushItem.SetColor(Color(COL_TRANSPARENT));//set "no fill" color rWrtSh.SetAttr( aBrushItem ); - } + } else if(!pApply || pApply->nColor != SID_ATTR_CHAR_COLOR_BACKGROUND_EXT) { GetView().GetViewFrame()->GetDispatcher()->Execute(SID_ATTR_CHAR_COLOR_BACKGROUND_EXT);