You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by al...@apache.org on 2013/03/20 15:06:22 UTC

svn commit: r1458836 - /openoffice/branches/sidebar/main/svx/source/tbxctrls/fillctrl.cxx

Author: alg
Date: Wed Mar 20 14:06:22 2013
New Revision: 1458836

URL: http://svn.apache.org/r1458836
Log:
i121788 In SvxFillToolBoxControl always correct selected FillStyle list entry when fill value changes

Modified:
    openoffice/branches/sidebar/main/svx/source/tbxctrls/fillctrl.cxx

Modified: openoffice/branches/sidebar/main/svx/source/tbxctrls/fillctrl.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/svx/source/tbxctrls/fillctrl.cxx?rev=1458836&r1=1458835&r2=1458836&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/svx/source/tbxctrls/fillctrl.cxx (original)
+++ openoffice/branches/sidebar/main/svx/source/tbxctrls/fillctrl.cxx Wed Mar 20 14:06:22 2013
@@ -129,14 +129,6 @@ void SvxFillToolBoxControl::StateChanged
 				delete pStyleItem;
 				pStyleItem = (XFillStyleItem*) pState->Clone();
 				pFillTypeLB->Enable();
-
-				eLastXFS = pFillTypeLB->GetSelectEntryPos();
-				bUpdate = sal_True;
-
-				XFillStyle eXFS = (XFillStyle)pStyleItem->GetValue();
-				pFillTypeLB->SelectEntryPos(
-                    sal::static_int_cast< sal_uInt16 >( eXFS ) );
-				pFillAttrLB->Enable();
 			}
 			else if( pStyleItem )
 			{
@@ -175,7 +167,28 @@ void SvxFillToolBoxControl::StateChanged
 						bEnableControls = sal_True;
 				}
 			}
-			if( bEnableControls )
+
+            if( pStyleItem )
+            {
+                // ensure that the correct entry is selected in pFillTypeLB. It
+                // might have been changed by nSID == SID_ATTR_FILL_STYLE, but
+                // it might also be in an in-between state when user had started to
+                // change fillstyle, but not yet changed fillvalue for new style
+                // and when nSID == SID_ATTR_FILL_COLOR/SID_ATTR_FILL_GRADIENT/
+                // SID_ATTR_FILL_HATCH/SID_ATTR_FILL_BITMAP value change is triggered
+                eLastXFS = pFillTypeLB->GetSelectEntryPos();
+                XFillStyle eXFS = (XFillStyle)pStyleItem->GetValue();
+
+                if(eLastXFS != eXFS)
+                {
+                    bUpdate = sal_True;
+                    pFillTypeLB->SelectEntryPos( sal::static_int_cast< sal_uInt16 >( eXFS ) );
+                }
+
+                pFillAttrLB->Enable();
+            }
+
+            if( bEnableControls )
 			{
 				//pFillTypeLB->Enable();
 				pFillAttrLB->Enable();