[Libreoffice-commits] core.git: Branch 'feature/sidebar' - svx/source

Armin Le Grand alg at apache.org
Thu May 9 09:08:14 PDT 2013


 svx/source/sidebar/area/AreaPropertyPanel.cxx       | 1030 ++++++++++----------
 svx/source/sidebar/area/AreaPropertyPanel.hxx       |    5 
 svx/source/sidebar/graphic/GraphicPropertyPanel.cxx |  344 +++---
 svx/source/sidebar/line/LinePropertyPanel.cxx       |    4 
 svx/source/sidebar/possize/PosSizePropertyPanel.cxx |   78 +
 svx/source/sidebar/possize/PosSizePropertyPanel.hxx |   15 
 6 files changed, 809 insertions(+), 667 deletions(-)

New commits:
commit 5141082c9a51df446f81c2e3f2dcbfed0097c330
Author: Armin Le Grand <alg at apache.org>
Date:   Wed Apr 24 09:50:54 2013 +0000

    Related: #i122111# Adapted pState usages in NotifyItemUpdate methods
    
    adapted control positioning in PosSizePanel
    
    (cherry picked from commit 76e55d0f6effee49090d1e931c372671ec184123)
    
    Conflicts:
    	svx/source/sidebar/area/AreaPropertyPanel.cxx
    	svx/source/sidebar/area/AreaPropertyPanel.hxx
    
    Change-Id: I5762c5208259ca071decebcc937bfaab8e0464b2

diff --git a/svx/source/sidebar/area/AreaPropertyPanel.cxx b/svx/source/sidebar/area/AreaPropertyPanel.cxx
index f4166fa..6340978 100644
--- a/svx/source/sidebar/area/AreaPropertyPanel.cxx
+++ b/svx/source/sidebar/area/AreaPropertyPanel.cxx
@@ -93,10 +93,6 @@ AreaPropertyPanel::AreaPropertyPanel(
       mpFillGradientItem(),
       mpHatchItem(),
       mpBitmapItem(),
-      mpColorListItem(),
-      mpGradientListItem(),
-      mpHatchListItem(),
-      mpBitmapListItem(),
       maStyleControl(SID_ATTR_FILL_STYLE, *pBindings, *this),
       maColorControl(SID_ATTR_FILL_COLOR, *pBindings, *this),
       maGradientControl(SID_ATTR_FILL_GRADIENT, *pBindings, *this),
@@ -123,7 +119,6 @@ AreaPropertyPanel::AreaPropertyPanel(
       mpTransparanceItem(),
       mxFrame(rxFrame),
       mpBindings(pBindings),
-      mbTBShow(true),
       mbColorAvail(true)
 {
     Initialize();
@@ -269,151 +264,156 @@ void AreaPropertyPanel::Initialize()
 
 IMPL_LINK( AreaPropertyPanel, SelectFillTypeHdl, ListBox *, pToolBox )
 {
-    XFillStyle  eXFS = (XFillStyle)mpLbFillType->GetSelectEntryPos();
+    const XFillStyle eXFS = (XFillStyle)mpLbFillType->GetSelectEntryPos();
 
-    if( (XFillStyle) meLastXFS != eXFS )
+    if((XFillStyle)meLastXFS != eXFS)
     {
-            mpLbFillAttr->Clear();
-            SfxObjectShell* pSh = SfxObjectShell::Current();
-            XFillStyleItem aXFillStyleItem( eXFS );
-            GetBindings()->GetDispatcher()->Execute(SID_ATTR_FILL_STYLE, SFX_CALLMODE_RECORD, &aXFillStyleItem, 0L);
+        mpLbFillAttr->Clear();
+        SfxObjectShell* pSh = SfxObjectShell::Current();
+        const XFillStyleItem aXFillStyleItem(eXFS);
+        GetBindings()->GetDispatcher()->Execute(SID_ATTR_FILL_STYLE, SFX_CALLMODE_RECORD, &aXFillStyleItem, 0L);
 
-            switch( eXFS )
-            {
+        switch( eXFS )
+        {
             case XFILL_NONE:
-                {
-                    mpLbFillAttr->Show();
-                    mpToolBoxColor->Hide();
-                    mbTBShow = false;
-                    mpLbFillType->Selected();
-                    mpLbFillAttr->Disable();
-                }
+            {
+                mpLbFillAttr->Show();
+                mpToolBoxColor->Hide();
+                mpLbFillType->Selected();
+                mpLbFillAttr->Disable();
                 break;
-
+            }
             case XFILL_SOLID:
-                {
-                    mpLbFillAttr->Hide();
-                    mpToolBoxColor->Show();
-                    mbTBShow = true;
-                    String aTmpStr;
-                    Color aColor = maLastColor;
-                    XFillColorItem aXFillColorItem( aTmpStr, aColor );
-                    GetBindings()->GetDispatcher()->Execute(SID_ATTR_FILL_COLOR, SFX_CALLMODE_RECORD, &aXFillColorItem, 0L);
-                }
+            {
+                mpLbFillAttr->Hide();
+                mpToolBoxColor->Show();
+                const String aTmpStr;
+                const Color aColor = maLastColor;
+                const XFillColorItem aXFillColorItem( aTmpStr, aColor );
+                GetBindings()->GetDispatcher()->Execute(SID_ATTR_FILL_COLOR, SFX_CALLMODE_RECORD, &aXFillColorItem, 0L);
                 break;
-
+            }
             case XFILL_GRADIENT:
+            {
+                mpLbFillAttr->Show();
+                mpToolBoxColor->Hide();
+
+                if(pSh && pSh->GetItem(SID_GRADIENT_LIST))
                 {
-                    mpLbFillAttr->Show();
-                    mpToolBoxColor->Hide();
-                    mbTBShow = false;
-                    if ( pSh && pSh->GetItem( SID_GRADIENT_LIST ) )
+                    if(!mpLbFillAttr->GetEntryCount())
                     {
-                        if(mpLbFillAttr->GetEntryCount() == 0)
-                        {
-                            SvxGradientListItem aItem( *(const SvxGradientListItem*)(
-                            pSh->GetItem( SID_GRADIENT_LIST ) ) );
-                            mpLbFillAttr->Enable();
-                            mpLbFillAttr->Clear();
-                            mpLbFillAttr->Fill( aItem.GetGradientList() );
-                        }
+                        const SvxGradientListItem aItem(*(const SvxGradientListItem*)(pSh->GetItem(SID_GRADIENT_LIST)));
+                        mpLbFillAttr->Enable();
+                        mpLbFillAttr->Clear();
+                        mpLbFillAttr->Fill(aItem.GetGradientList());
+                    }
+
+                    mpLbFillAttr->AdaptDropDownLineCountToMaximum();
 
-                        mpLbFillAttr->AdaptDropDownLineCountToMaximum();
+                    if(LISTBOX_ENTRY_NOTFOUND != mnLastPosGradient)
+                    {
+                        const SvxGradientListItem aItem(*(const SvxGradientListItem*)(pSh->GetItem(SID_GRADIENT_LIST)));
 
-                        if ( mnLastPosGradient != LISTBOX_ENTRY_NOTFOUND)
+                        if(mnLastPosGradient < aItem.GetGradientList()->Count())
                         {
-                            SvxGradientListItem aItem( *(const SvxGradientListItem*)( pSh->GetItem( SID_GRADIENT_LIST ) ) );
-                            if ( mnLastPosGradient < aItem.GetGradientList()->Count() )
-                            {
-                                XGradient aGradient = aItem.GetGradientList()->GetGradient( mnLastPosGradient )->GetGradient();
-                                XFillGradientItem aXFillGradientItem( mpLbFillAttr->GetEntry(mnLastPosGradient), aGradient );
-                                GetBindings()->GetDispatcher()->Execute(SID_ATTR_FILL_GRADIENT, SFX_CALLMODE_RECORD, &aXFillGradientItem, 0L);
-                                mpLbFillAttr->SelectEntryPos(mnLastPosGradient);    //add
-                            }
+                            const XGradient aGradient = aItem.GetGradientList()->GetGradient(mnLastPosGradient)->GetGradient();
+                            const XFillGradientItem aXFillGradientItem(mpLbFillAttr->GetEntry(mnLastPosGradient), aGradient);
+                            GetBindings()->GetDispatcher()->Execute(SID_ATTR_FILL_GRADIENT, SFX_CALLMODE_RECORD, &aXFillGradientItem, 0L);
+                            mpLbFillAttr->SelectEntryPos(mnLastPosGradient);
                         }
                     }
-                    else
-                        mpLbFillAttr->Disable();
+                }
+                else
+                {
+                    mpLbFillAttr->Disable();
                 }
                 break;
-
+            }
             case XFILL_HATCH:
+            {
+                mpLbFillAttr->Show();
+                mpToolBoxColor->Hide();
+
+                if(pSh && pSh->GetItem(SID_HATCH_LIST))
                 {
-                    mpLbFillAttr->Show();
-                    mpToolBoxColor->Hide();
-                    mbTBShow = false;
-                    if ( pSh && pSh->GetItem( SID_HATCH_LIST ) )
+                    if(!mpLbFillAttr->GetEntryCount())
                     {
-                        if(mpLbFillAttr->GetEntryCount() == 0)
-                        {
-                            SvxHatchListItem aItem( *(const SvxHatchListItem*)(
-                                pSh->GetItem( SID_HATCH_LIST ) ) );
-                            mpLbFillAttr->Enable();
-                            mpLbFillAttr->Clear();
-                            mpLbFillAttr->Fill( aItem.GetHatchList() );
-                        }
+                        const SvxHatchListItem aItem( *(const SvxHatchListItem*)(pSh->GetItem(SID_HATCH_LIST)));
+                        mpLbFillAttr->Enable();
+                        mpLbFillAttr->Clear();
+                        mpLbFillAttr->Fill(aItem.GetHatchList());
+                    }
 
-                        mpLbFillAttr->AdaptDropDownLineCountToMaximum();
+                    mpLbFillAttr->AdaptDropDownLineCountToMaximum();
 
-                        if ( mnLastPosHatch != LISTBOX_ENTRY_NOTFOUND )
+                    if(LISTBOX_ENTRY_NOTFOUND != mnLastPosHatch)
+                    {
+                        const SvxHatchListItem aItem(*(const SvxHatchListItem*)(pSh->GetItem(SID_HATCH_LIST)));
+
+                        if(mnLastPosHatch < aItem.GetHatchList()->Count())
                         {
-                            SvxHatchListItem aItem( *(const SvxHatchListItem*)( pSh->GetItem( SID_HATCH_LIST ) ) );
-                            if ( mnLastPosHatch < aItem.GetHatchList()->Count() )
-                            {
-                                XHatch aHatch = aItem.GetHatchList()->GetHatch( mnLastPosHatch )->GetHatch();
-                                XFillHatchItem aXFillHatchItem( mpLbFillAttr->GetSelectEntry(), aHatch );
-                                GetBindings()->GetDispatcher()->Execute(SID_ATTR_FILL_HATCH, SFX_CALLMODE_RECORD, &aXFillHatchItem, 0L);
-                                mpLbFillAttr->SelectEntryPos(mnLastPosHatch); //add
-                            }
+                            const XHatch aHatch = aItem.GetHatchList()->GetHatch(mnLastPosHatch)->GetHatch();
+                            const XFillHatchItem aXFillHatchItem(mpLbFillAttr->GetSelectEntry(), aHatch);
+                            GetBindings()->GetDispatcher()->Execute(SID_ATTR_FILL_HATCH, SFX_CALLMODE_RECORD, &aXFillHatchItem, 0L);
+                            mpLbFillAttr->SelectEntryPos(mnLastPosHatch);
                         }
                     }
-                    else
-                        mpLbFillAttr->Disable();
+                }
+                else
+                {
+                    mpLbFillAttr->Disable();
                 }
                 break;
-
+            }
             case XFILL_BITMAP:
+            {
+                mpLbFillAttr->Show();
+                mpToolBoxColor->Hide();
+
+                if(pSh && pSh->GetItem(SID_BITMAP_LIST))
                 {
-                    mpLbFillAttr->Show();
-                    mpToolBoxColor->Hide();
-                    mbTBShow = false;
-                    if ( pSh && pSh->GetItem( SID_BITMAP_LIST ) )
+                    if(!mpLbFillAttr->GetEntryCount())
                     {
-                        if(mpLbFillAttr->GetEntryCount() == 0)
-                        {
-                            SvxBitmapListItem aItem( *(const SvxBitmapListItem*)(
-                                pSh->GetItem( SID_BITMAP_LIST ) ) );
-                            mpLbFillAttr->Enable();
-                            mpLbFillAttr->Clear();
-                            mpLbFillAttr->Fill( aItem.GetBitmapList() );
-                        }
+                        const SvxBitmapListItem aItem( *(const SvxBitmapListItem*)(pSh->GetItem(SID_BITMAP_LIST)));
+                        mpLbFillAttr->Enable();
+                        mpLbFillAttr->Clear();
+                        mpLbFillAttr->Fill(aItem.GetBitmapList());
+                    }
 
-                        mpLbFillAttr->AdaptDropDownLineCountToMaximum();
+                    mpLbFillAttr->AdaptDropDownLineCountToMaximum();
+
+                    if(LISTBOX_ENTRY_NOTFOUND != mnLastPosBitmap)
+                    {
+                        const SvxBitmapListItem aItem(*(const SvxBitmapListItem*)(pSh->GetItem(SID_BITMAP_LIST)));
 
-                        if ( mnLastPosBitmap != LISTBOX_ENTRY_NOTFOUND )
+                        if(mnLastPosBitmap < aItem.GetBitmapList()->Count())
                         {
-                            SvxBitmapListItem aItem( *(const SvxBitmapListItem*)( pSh->GetItem( SID_BITMAP_LIST ) ) );
-                            if ( mnLastPosBitmap < aItem.GetBitmapList()->Count() )
-                            {
-                                const XBitmapEntry* pXBitmapEntry = aItem.GetBitmapList()->GetBitmap(mnLastPosBitmap);
-                                XFillBitmapItem aXFillBitmapItem( mpLbFillAttr->GetSelectEntry(), pXBitmapEntry->GetGraphicObject() );
-                                GetBindings()->GetDispatcher()->Execute(SID_ATTR_FILL_BITMAP, SFX_CALLMODE_RECORD, &aXFillBitmapItem, 0L);
-                                mpLbFillAttr->SelectEntryPos(mnLastPosBitmap); //add
-                            }
+                            const XBitmapEntry* pXBitmapEntry = aItem.GetBitmapList()->GetBitmap(mnLastPosBitmap);
+                            const XFillBitmapItem aXFillBitmapItem(mpLbFillAttr->GetSelectEntry(), pXBitmapEntry->GetGraphicObject());
+                            GetBindings()->GetDispatcher()->Execute(SID_ATTR_FILL_BITMAP, SFX_CALLMODE_RECORD, &aXFillBitmapItem, 0L);
+                            mpLbFillAttr->SelectEntryPos(mnLastPosBitmap);
                         }
                     }
-                    else
-                        mpLbFillAttr->Disable();
+                }
+                else
+                {
+                    mpLbFillAttr->Disable();
                 }
                 break;
             }
-            meLastXFS = (sal_uInt16)eXFS;
-            if( eXFS != XFILL_NONE )
+        }
+
+        meLastXFS = (sal_uInt16)eXFS;
+
+        if(XFILL_NONE != eXFS)
+        {
+            if(pToolBox)
             {
-                if ( pToolBox )
-                    mpLbFillType->Selected();
+                mpLbFillType->Selected();
             }
+        }
     }
+
     return 0;
 }
 
@@ -421,20 +421,20 @@ IMPL_LINK( AreaPropertyPanel, SelectFillTypeHdl, ListBox *, pToolBox )
 
 IMPL_LINK( AreaPropertyPanel, SelectFillAttrHdl, ListBox*, pToolBox )
 {
-    XFillStyle eXFS = (XFillStyle)mpLbFillType->GetSelectEntryPos();
-    XFillStyleItem aXFillStyleItem( eXFS );
+    const XFillStyle eXFS = (XFillStyle)mpLbFillType->GetSelectEntryPos();
+    const XFillStyleItem aXFillStyleItem(eXFS);
     SfxObjectShell* pSh = SfxObjectShell::Current();
 
     if(pToolBox)
     {
-        if( (XFillStyle) meLastXFS != eXFS )
+        if((XFillStyle) meLastXFS != eXFS)
         {
-            GetBindings()->GetDispatcher()->Execute(SID_ATTR_FILL_STYLE, SFX_CALLMODE_RECORD, &aXFillStyleItem, 0L); //Added  20090909
+            GetBindings()->GetDispatcher()->Execute(SID_ATTR_FILL_STYLE, SFX_CALLMODE_RECORD, &aXFillStyleItem, 0L);
         }
 
-        switch( eXFS )
+        switch(eXFS)
         {
-        case XFILL_SOLID:
+            case XFILL_SOLID:
             //{
             //  //String aTmpStr = mpLbFillAttr->GetSelectEntry();
             //  //Color aColor = mpLbFillAttr->GetSelectEntryColor();
@@ -447,88 +447,111 @@ IMPL_LINK( AreaPropertyPanel, SelectFillAttrHdl, ListBox*, pToolBox )
             //}
             break;
 
-        case XFILL_GRADIENT:
+            case XFILL_GRADIENT:
             {
                 sal_uInt16 nPos = mpLbFillAttr->GetSelectEntryPos();
-                if( nPos == LISTBOX_ENTRY_NOTFOUND )
+
+                if(LISTBOX_ENTRY_NOTFOUND == nPos)
+                {
                     nPos = mnLastPosGradient;
+                }
 
-                if ( nPos != LISTBOX_ENTRY_NOTFOUND && pSh && pSh->GetItem( SID_GRADIENT_LIST ) )
+                if(LISTBOX_ENTRY_NOTFOUND != nPos && pSh && pSh->GetItem(SID_GRADIENT_LIST))
                 {
-                    SvxGradientListItem aItem( *(const SvxGradientListItem*)( pSh->GetItem( SID_GRADIENT_LIST ) ) );
-                    if ( nPos < aItem.GetGradientList()->Count() )
+                    const SvxGradientListItem aItem(*(const SvxGradientListItem*)(pSh->GetItem(SID_GRADIENT_LIST)));
+
+                    if(nPos < aItem.GetGradientList()->Count())
                     {
-                        XGradient aGradient = aItem.GetGradientList()->GetGradient( nPos )->GetGradient();
-                        XFillGradientItem aXFillGradientItem( mpLbFillAttr->GetSelectEntry(), aGradient );
+                        const XGradient aGradient = aItem.GetGradientList()->GetGradient(nPos)->GetGradient();
+                        const XFillGradientItem aXFillGradientItem(mpLbFillAttr->GetSelectEntry(), aGradient);
                         GetBindings()->GetDispatcher()->Execute(SID_ATTR_FILL_GRADIENT, SFX_CALLMODE_RECORD, &aXFillGradientItem, 0L);
                     }
                 }
-                if(nPos != LISTBOX_ENTRY_NOTFOUND)
+
+                if(LISTBOX_ENTRY_NOTFOUND != nPos)
+                {
                     mnLastPosGradient = nPos;
+                }
+                break;
             }
-            break;
-
-        case XFILL_HATCH:
+            case XFILL_HATCH:
             {
                 sal_uInt16 nPos = mpLbFillAttr->GetSelectEntryPos();
-                if( nPos == LISTBOX_ENTRY_NOTFOUND )
+
+                if(LISTBOX_ENTRY_NOTFOUND == nPos)
+                {
                     nPos = mnLastPosHatch;
-                if ( nPos != LISTBOX_ENTRY_NOTFOUND && pSh && pSh->GetItem( SID_HATCH_LIST ) )
+                }
+
+                if(LISTBOX_ENTRY_NOTFOUND != nPos && pSh && pSh->GetItem(SID_HATCH_LIST))
                 {
-                    SvxHatchListItem aItem( *(const SvxHatchListItem*)( pSh->GetItem( SID_HATCH_LIST ) ) );
-                    if ( nPos < aItem.GetHatchList()->Count() )
+                    const SvxHatchListItem aItem(*(const SvxHatchListItem*)(pSh->GetItem(SID_HATCH_LIST)));
+
+                    if(nPos < aItem.GetHatchList()->Count())
                     {
-                        XHatch aHatch = aItem.GetHatchList()->GetHatch( nPos )->GetHatch();
-                        XFillHatchItem aXFillHatchItem( mpLbFillAttr->GetSelectEntry(), aHatch );
+                        const XHatch aHatch = aItem.GetHatchList()->GetHatch(nPos)->GetHatch();
+                        const XFillHatchItem aXFillHatchItem( mpLbFillAttr->GetSelectEntry(), aHatch);
                         GetBindings()->GetDispatcher()->Execute(SID_ATTR_FILL_HATCH, SFX_CALLMODE_RECORD, &aXFillHatchItem, 0L);
                     }
                 }
-                if(nPos != LISTBOX_ENTRY_NOTFOUND)
+
+                if(LISTBOX_ENTRY_NOTFOUND != nPos)
+                {
                     mnLastPosHatch = nPos;
+                }
+                break;
             }
-            break;
-
-        case XFILL_BITMAP:
+            case XFILL_BITMAP:
             {
                 sal_uInt16 nPos = mpLbFillAttr->GetSelectEntryPos();
-                if( nPos == LISTBOX_ENTRY_NOTFOUND )
+
+                if(LISTBOX_ENTRY_NOTFOUND == nPos)
+                {
                     nPos = mnLastPosBitmap;
-                if ( nPos != LISTBOX_ENTRY_NOTFOUND && pSh && pSh->GetItem( SID_BITMAP_LIST ) )
+                }
+
+                if(LISTBOX_ENTRY_NOTFOUND != nPos && pSh && pSh->GetItem(SID_BITMAP_LIST))
                 {
-                    SvxBitmapListItem aItem( *(const SvxBitmapListItem*)( pSh->GetItem( SID_BITMAP_LIST ) ) );
-                    if ( nPos < aItem.GetBitmapList()->Count() )
+                    const SvxBitmapListItem aItem(*(const SvxBitmapListItem*)(pSh->GetItem(SID_BITMAP_LIST)));
+
+                    if(nPos < aItem.GetBitmapList()->Count())
                     {
                         const XBitmapEntry* pXBitmapEntry = aItem.GetBitmapList()->GetBitmap(nPos);
-                        XFillBitmapItem aXFillBitmapItem( mpLbFillAttr->GetSelectEntry(), pXBitmapEntry->GetGraphicObject() );
+                        const XFillBitmapItem aXFillBitmapItem(mpLbFillAttr->GetSelectEntry(), pXBitmapEntry->GetGraphicObject());
                         GetBindings()->GetDispatcher()->Execute(SID_ATTR_FILL_BITMAP, SFX_CALLMODE_RECORD, &aXFillBitmapItem, 0L);
                     }
                 }
-                if(nPos != LISTBOX_ENTRY_NOTFOUND)
+
+                if(LISTBOX_ENTRY_NOTFOUND != nPos)
+                {
                     mnLastPosBitmap = nPos;
+                }
+                break;
             }
-            break;
-
-                    default:
-                        break;
+            default: break;
         }
     }
+
     return 0;
 }
 
 
-//add  for color picker
-
 IMPL_LINK(AreaPropertyPanel, ToolBoxColorDropHdl, ToolBox*, pToolBox)
 {
-    sal_uInt16 nId = pToolBox->GetCurItemId();
+    const sal_uInt16 nId = pToolBox->GetCurItemId();
 
-    if(nId == TBI_COLOR)
+    if(TBI_COLOR == nId)
     {
         maColorPopup.Show(*pToolBox);
+
         if (mpColorItem)
+        {
             maColorPopup.SetCurrentColor(mpColorItem->GetColorValue(), mbColorAvail);
+        }
         else
+        {
             maColorPopup.SetCurrentColor(COL_WHITE, false);
+        }
     }
 
     return 0;
@@ -540,7 +563,7 @@ void AreaPropertyPanel::SetColor (
     const String& rsColorName,
     const Color aColor)
 {
-    XFillColorItem aXFillColorItem (rsColorName, aColor);
+    const XFillColorItem aXFillColorItem(rsColorName, aColor);
     mpBindings->GetDispatcher()->Execute(SID_ATTR_FILL_COLOR, SFX_CALLMODE_RECORD, &aXFillColorItem, 0L);
     maLastColor = aColor;
 }
@@ -618,7 +641,7 @@ void AreaPropertyPanel::DataChanged(
 
 void AreaPropertyPanel::ImpUpdateTransparencies()
 {
-    if(mpTransparanceItem.get() || mpFloatTransparenceItem.get())
+    if(mpTransparanceItem.get() && mpFloatTransparenceItem.get())
     {
         bool bZeroValue(false);
 
@@ -739,313 +762,338 @@ void AreaPropertyPanel::NotifyItemUpdate(
     const bool bIsEnabled)
 {
     (void)bIsEnabled;
+    const bool bDisabled(SFX_ITEM_DISABLED == eState);
 
-    XFillStyle eXFS;
-    SfxObjectShell* pSh = SfxObjectShell::Current();
-    bool bFillTransparenceChanged(false);
-
-    if(SID_ATTR_FILL_TRANSPARENCE == nSID)
+    switch(nSID)
     {
-        bFillTransparenceChanged = true;
-
-        if(eState >= SFX_ITEM_AVAILABLE)
+        case SID_ATTR_FILL_TRANSPARENCE:
+        case SID_ATTR_FILL_FLOATTRANSPARENCE:
         {
-            const SfxUInt16Item* pItem = dynamic_cast< const SfxUInt16Item* >(pState);
+            bool bFillTransparenceChanged(false);
 
-            if(pItem && (!mpTransparanceItem || *pItem != *mpTransparanceItem))
+            if(SID_ATTR_FILL_TRANSPARENCE == nSID)
             {
-                mpTransparanceItem.reset((SfxUInt16Item*)pItem->Clone());
+                bFillTransparenceChanged = true;
+
+                if(eState >= SFX_ITEM_AVAILABLE)
+                {
+                    const SfxUInt16Item* pItem = dynamic_cast< const SfxUInt16Item* >(pState);
+
+                    if(pItem && (!mpTransparanceItem || *pItem != *mpTransparanceItem))
+                    {
+                        mpTransparanceItem.reset((SfxUInt16Item*)pItem->Clone());
+                    }
+                    else
+                    {
+                        mpTransparanceItem.reset();
+                    }
+                }
+                else
+                {
+                    mpTransparanceItem.reset();
+                }
             }
-            else
+            else // if(SID_ATTR_FILL_FLOATTRANSPARENCE == nSID)
             {
-                mpTransparanceItem.reset();
-            }
-        }
-        else
-        {
-            mpTransparanceItem.reset();
-        }
-    }
-    else if(SID_ATTR_FILL_FLOATTRANSPARENCE == nSID)
-    {
-        bFillTransparenceChanged = true;
+                bFillTransparenceChanged = true;
 
-        if(eState >= SFX_ITEM_AVAILABLE)
-        {
-            const XFillFloatTransparenceItem* pItem = dynamic_cast< const XFillFloatTransparenceItem* >(pState);
+                if(eState >= SFX_ITEM_AVAILABLE)
+                {
+                    const XFillFloatTransparenceItem* pItem = dynamic_cast< const XFillFloatTransparenceItem* >(pState);
 
-            if(pItem && (!mpFloatTransparenceItem || *pItem != *mpFloatTransparenceItem))
-            {
-                mpFloatTransparenceItem.reset((XFillFloatTransparenceItem*)pItem->Clone());
+                    if(pItem && (!mpFloatTransparenceItem || *pItem != *mpFloatTransparenceItem))
+                    {
+                        mpFloatTransparenceItem.reset((XFillFloatTransparenceItem*)pItem->Clone());
+                    }
+                    else
+                    {
+                        mpFloatTransparenceItem.reset();
+                    }
+                }
+                else
+                {
+                    mpFloatTransparenceItem.reset();
+                }
             }
-            else
+
+            if(bFillTransparenceChanged)
             {
-                mpFloatTransparenceItem.reset();
+                // update transparency settings dependent of mpTransparanceItem and mpFloatTransparenceItem
+                ImpUpdateTransparencies();
             }
+            break;
         }
-        else
-        {
-            mpFloatTransparenceItem.reset();
-        }
-    }
-
-    if(bFillTransparenceChanged)
-    {
-        // update transparency settings dependent of mpTransparanceItem and mpFloatTransparenceItem
-        ImpUpdateTransparencies();
-    }
-
-    if  (nSID == SID_ATTR_FILL_STYLE )
-    {
-        if( eState == SFX_ITEM_DISABLED )
-        {
-            mpLbFillType->Disable();
-            mpLbFillType->SetNoSelection();
-            mpLbFillAttr->Show();
-            mpLbFillAttr->Disable();
-            mpLbFillAttr->SetNoSelection();
-            mpToolBoxColor->Hide();
-            mbTBShow = false;
-            meLastXFS = -1;
-            mpStyleItem.reset();
-        }
-        else if( SFX_ITEM_AVAILABLE == eState )
+        case SID_ATTR_FILL_STYLE:
         {
-            mpStyleItem.reset(pState ? (XFillStyleItem*)pState->Clone() : 0);
-            mpLbFillType->Enable();
-
-            eXFS = (XFillStyle)mpStyleItem->GetValue();
-            meLastXFS = eXFS;
-            mpLbFillType->SelectEntryPos(
-                sal::static_int_cast< sal_uInt16 >( eXFS ) );
-            //Added for select invisable
-            if(eXFS == XFILL_NONE)
+            if(bDisabled)
             {
-                mpLbFillAttr->SetNoSelection();
+                mpLbFillType->Disable();
+                mpLbFillType->SetNoSelection();
+                mpLbFillAttr->Show();
                 mpLbFillAttr->Disable();
+                mpLbFillAttr->SetNoSelection();
+                mpToolBoxColor->Hide();
+                meLastXFS = -1;
+                mpStyleItem.reset();
             }
-            //else
-            //  mpLbFillAttr->Enable();
-            Update();
-            //SelectFillTypeHdl( NULL );
-        }
-        else
-        {
+
+            if(eState >= SFX_ITEM_AVAILABLE)
+            {
+                const XFillStyleItem* pItem = dynamic_cast< const XFillStyleItem* >(pState);
+
+                if(pItem)
+                {
+                    mpStyleItem.reset(dynamic_cast< XFillStyleItem* >(pItem->Clone()));
+                    mpLbFillType->Enable();
+                    XFillStyle eXFS = (XFillStyle)mpStyleItem->GetValue();
+                    meLastXFS = eXFS;
+                    mpLbFillType->SelectEntryPos(sal::static_int_cast< sal_uInt16 >(eXFS));
+
+                    if(XFILL_NONE == eXFS)
+                    {
+                        mpLbFillAttr->SetNoSelection();
+                        mpLbFillAttr->Disable();
+                    }
+
+                    Update();
+                    break;
+                }
+            }
+
             mpLbFillType->SetNoSelection();
             mpLbFillAttr->Show();
             mpLbFillAttr->Disable();
             mpLbFillAttr->SetNoSelection();
             mpToolBoxColor->Hide();
-            mbTBShow = false;
-            meLastXFS = -1;  //Added
+            meLastXFS = -1;
             mpStyleItem.reset();
+            break;
         }
-    }
-    else if(nSID == SID_ATTR_FILL_COLOR)
-    {
-        if( SFX_ITEM_AVAILABLE == eState)
-        {
-            mpColorItem.reset(pState ? (XFillColorItem*)pState->Clone() : 0);
-        }
-        if( mpStyleItem && (XFillStyle)mpStyleItem->GetValue() == XFILL_SOLID)
+        case SID_ATTR_FILL_COLOR:
         {
-            mpLbFillAttr->Hide();
-            mpToolBoxColor->Show();
-            mbTBShow = true;
-            if( SFX_ITEM_AVAILABLE == eState)
-            {
-                mpToolBoxColor->Enable();
-                mbColorAvail = true;    //
-                // maLastColor = mpColorItem->GetColorValue();
-                Update();
-            }
-            else if(SFX_ITEM_DISABLED == eState )
+            if(SFX_ITEM_AVAILABLE == eState)
             {
-                mpToolBoxColor->Disable();
-                mbColorAvail = false;   //
-                mpColorUpdater->Update(COL_WHITE);
+                mpColorItem.reset(pState ? (XFillColorItem*)pState->Clone() : 0);
             }
-            else
+
+            if(mpStyleItem && XFILL_SOLID == (XFillStyle)mpStyleItem->GetValue())
             {
-                mbColorAvail = false;   //
-                mpColorUpdater->Update(COL_WHITE);
+                mpLbFillAttr->Hide();
+                mpToolBoxColor->Show();
+
+                if(SFX_ITEM_AVAILABLE == eState)
+                {
+                    mpToolBoxColor->Enable();
+                    mbColorAvail = true;
+                    // maLastColor = mpColorItem->GetColorValue();
+                    Update();
+                }
+                else if(SFX_ITEM_DISABLED == eState)
+                {
+                    mpToolBoxColor->Disable();
+                    mbColorAvail = false;
+                    mpColorUpdater->Update(COL_WHITE);
+                }
+                else
+                {
+                    mbColorAvail = false;
+                    mpColorUpdater->Update(COL_WHITE);
+                }
             }
+            break;
         }
-    }
-    else if(nSID == SID_ATTR_FILL_GRADIENT)
-    {
-        if( SFX_ITEM_AVAILABLE == eState)
-        {
-            mpFillGradientItem.reset(pState ? (XFillGradientItem*)pState->Clone() : 0);
-        }
-        if( mpStyleItem && (XFillStyle)mpStyleItem->GetValue() == XFILL_GRADIENT )
+        case SID_ATTR_FILL_GRADIENT:
         {
-            mpLbFillAttr->Show();
-            mpToolBoxColor->Hide();
-            mbTBShow = false;
-            if( SFX_ITEM_AVAILABLE == eState)
+            if(SFX_ITEM_AVAILABLE == eState)
             {
-                mpLbFillAttr->Enable();
-                Update();
+                mpFillGradientItem.reset(pState ? (XFillGradientItem*)pState->Clone() : 0);
             }
 
-            else if(SFX_ITEM_DISABLED == eState )
+            if(mpStyleItem && XFILL_GRADIENT == (XFillStyle)mpStyleItem->GetValue())
             {
-                mpLbFillAttr->Disable();
-                mpLbFillAttr->SetNoSelection();
+                mpLbFillAttr->Show();
+                mpToolBoxColor->Hide();
+
+                if(SFX_ITEM_AVAILABLE == eState)
+                {
+                    mpLbFillAttr->Enable();
+                    Update();
+                }
+                else if(SFX_ITEM_DISABLED == eState )
+                {
+                    mpLbFillAttr->Disable();
+                    mpLbFillAttr->SetNoSelection();
+                }
+                else
+                {
+                    mpLbFillAttr->SetNoSelection();
+                }
             }
-            else
-                mpLbFillAttr->SetNoSelection();
-        }
-    }
-    else if(nSID == SID_ATTR_FILL_HATCH)
-    {
-        if( SFX_ITEM_AVAILABLE == eState)
-        {
-            mpHatchItem.reset(pState ? (XFillHatchItem*)pState->Clone() : 0);
+            break;
         }
-        if( mpStyleItem && (XFillStyle)mpStyleItem->GetValue() == XFILL_HATCH )
+        case SID_ATTR_FILL_HATCH:
         {
-            mpLbFillAttr->Show();
-            mpToolBoxColor->Hide();
-            mbTBShow = false;
-            if( SFX_ITEM_AVAILABLE == eState)
+            if(SFX_ITEM_AVAILABLE == eState)
             {
-                mpLbFillAttr->Enable();
-                Update();
+                mpHatchItem.reset(pState ? (XFillHatchItem*)pState->Clone() : 0);
             }
-            else if(SFX_ITEM_DISABLED == eState )
+
+            if(mpStyleItem && XFILL_HATCH == (XFillStyle)mpStyleItem->GetValue())
             {
-                mpLbFillAttr->Disable();
-                mpLbFillAttr->SetNoSelection();
+                mpLbFillAttr->Show();
+                mpToolBoxColor->Hide();
+
+                if(SFX_ITEM_AVAILABLE == eState)
+                {
+                    mpLbFillAttr->Enable();
+                    Update();
+                }
+                else if(SFX_ITEM_DISABLED == eState )
+                {
+                    mpLbFillAttr->Disable();
+                    mpLbFillAttr->SetNoSelection();
+                }
+                else
+                {
+                    mpLbFillAttr->SetNoSelection();
+                }
             }
-            else
-                mpLbFillAttr->SetNoSelection();
-        }
-    }
-    else if(nSID == SID_ATTR_FILL_BITMAP)
-    {
-        if( SFX_ITEM_AVAILABLE == eState)
-        {
-            mpBitmapItem.reset(pState ? (XFillBitmapItem*)pState->Clone() : 0);
+            break;
         }
-        if( mpStyleItem && (XFillStyle)mpStyleItem->GetValue() == XFILL_BITMAP )
+        case SID_ATTR_FILL_BITMAP:
         {
-            mpLbFillAttr->Show();
-            mpToolBoxColor->Hide();
-            mbTBShow = false;
-            if( SFX_ITEM_AVAILABLE == eState)
+            if(SFX_ITEM_AVAILABLE == eState)
             {
-                mpLbFillAttr->Enable();
-                Update();
+                mpBitmapItem.reset(pState ? (XFillBitmapItem*)pState->Clone() : 0);
             }
-            else if(SFX_ITEM_DISABLED == eState )
-            {
-                mpLbFillAttr->Disable();
-                mpLbFillAttr->SetNoSelection();
-            }
-            else
-                mpLbFillAttr->SetNoSelection();
-        }
-    }
-    else if(nSID == SID_COLOR_TABLE)
-    {
-        if( SFX_ITEM_AVAILABLE == eState)
-        {
-            mpColorListItem.reset(pState ? (SvxColorListItem*)pState->Clone() : 0);
 
-            if( mpStyleItem && (XFillStyle)mpStyleItem->GetValue()== XFILL_SOLID)
+            if(mpStyleItem && XFILL_BITMAP == (XFillStyle)mpStyleItem->GetValue())
             {
-                if ( mpColorItem )
+                mpLbFillAttr->Show();
+                mpToolBoxColor->Hide();
+
+                if(SFX_ITEM_AVAILABLE == eState)
                 {
-                    String aString( mpColorItem->GetName() );
-                    Color aColor = mpColorItem->GetColorValue();
-                    mpLbFillAttr->Clear();
-                    SvxColorListItem aItem( *(const SvxColorListItem*)(
-                        pSh->GetItem( SID_COLOR_TABLE ) ) );
                     mpLbFillAttr->Enable();
-                    mpLbFillAttr->Fill( aItem.GetColorList() );
-                    mpLbFillAttr->SelectEntry( aColor );
+                    Update();
+                }
+                else if(SFX_ITEM_DISABLED == eState )
+                {
+                    mpLbFillAttr->Disable();
+                    mpLbFillAttr->SetNoSelection();
                 }
                 else
+                {
                     mpLbFillAttr->SetNoSelection();
+                }
             }
+            break;
         }
-    }
-    else if(nSID == SID_GRADIENT_LIST)
-    {
-        if( SFX_ITEM_AVAILABLE == eState)
+        case SID_COLOR_TABLE:
         {
-            mpGradientListItem.reset(pState ? (SvxGradientListItem*)pState->Clone() : 0);
-
-            if( mpStyleItem && (XFillStyle)mpStyleItem->GetValue() == XFILL_GRADIENT)
+            if(SFX_ITEM_AVAILABLE == eState)
             {
-                if ( mpFillGradientItem )
+                if(mpStyleItem && XFILL_SOLID == (XFillStyle)mpStyleItem->GetValue())
                 {
-                    String aString( mpFillGradientItem->GetName() );
-                    mpLbFillAttr->Clear();
-                    SvxGradientListItem aItem( *(const SvxGradientListItem*)(
-                        pSh->GetItem( SID_GRADIENT_LIST ) ) );
-                    mpLbFillAttr->Enable();
-                    mpLbFillAttr->Fill( aItem.GetGradientList() );
-                    mpLbFillAttr->SelectEntry( aString );
+                    if(mpColorItem)
+                    {
+                        const Color aColor = mpColorItem->GetColorValue();
+                        const SfxObjectShell* pSh = SfxObjectShell::Current();
+                        const SvxColorListItem aItem(*(const SvxColorListItem*)(pSh->GetItem(SID_COLOR_TABLE)));
+
+                        mpLbFillAttr->Clear();
+                        mpLbFillAttr->Enable();
+                        mpLbFillAttr->Fill(aItem.GetColorList());
+                        mpLbFillAttr->SelectEntry(aColor);
+                    }
+                    else
+                    {
+                        mpLbFillAttr->SetNoSelection();
+                    }
                 }
-                else
-                    mpLbFillAttr->SetNoSelection();
             }
+            break;
         }
-    }
-    else if(nSID == SID_HATCH_LIST)
-    {
-        if( SFX_ITEM_AVAILABLE == eState)
+        case SID_GRADIENT_LIST:
         {
-            mpHatchListItem.reset(pState ? (SvxHatchListItem*)pState->Clone() : 0);
-
-            if( mpStyleItem && (XFillStyle)mpStyleItem->GetValue() == XFILL_HATCH )
+            if(SFX_ITEM_AVAILABLE == eState)
             {
-                if ( mpHatchItem)
+                if(mpStyleItem && XFILL_GRADIENT == (XFillStyle)mpStyleItem->GetValue())
                 {
-                    String aString( mpHatchItem->GetName() );
-                    mpLbFillAttr->Clear();
-                    SvxHatchListItem aItem( *(const SvxHatchListItem*)(
-                        pSh->GetItem( SID_HATCH_LIST ) ) );
-                    mpLbFillAttr->Enable();
-                    mpLbFillAttr->Fill( aItem.GetHatchList() );
-                    mpLbFillAttr->SelectEntry( aString );
+                    if(mpFillGradientItem)
+                    {
+                        const String aString( mpFillGradientItem->GetName() );
+                        const SfxObjectShell* pSh = SfxObjectShell::Current();
+                        const SvxGradientListItem aItem( *(const SvxGradientListItem*)(pSh->GetItem(SID_GRADIENT_LIST)));
+
+                        mpLbFillAttr->Clear();
+                        mpLbFillAttr->Enable();
+                        mpLbFillAttr->Fill(aItem.GetGradientList());
+                        mpLbFillAttr->SelectEntry(aString);
+                    }
+                    else
+                    {
+                        mpLbFillAttr->SetNoSelection();
+                    }
                 }
-                else
-                    mpLbFillAttr->SetNoSelection();
             }
+            break;
         }
-    }
-    else if(nSID == SID_BITMAP_LIST)
-    {
-        if( SFX_ITEM_AVAILABLE == eState)
+        case SID_HATCH_LIST:
         {
-            mpBitmapListItem.reset(pState ? (SvxBitmapListItem*)pState->Clone() : 0);
-
-            if( mpStyleItem && (XFillStyle)mpStyleItem->GetValue() == XFILL_BITMAP )
+            if(SFX_ITEM_AVAILABLE == eState)
             {
-                if ( mpBitmapItem )
+                if(mpStyleItem && XFILL_HATCH == (XFillStyle)mpStyleItem->GetValue())
                 {
-                    String aString( mpBitmapItem->GetName() );
-                    mpLbFillAttr->Clear();
-                    SvxBitmapListItem aItem( *(const SvxBitmapListItem*)(
-                        pSh->GetItem( SID_BITMAP_LIST ) ) );
-                    mpLbFillAttr->Enable();
-                    mpLbFillAttr->Fill( aItem.GetBitmapList() );
-                    mpLbFillAttr->SelectEntry( aString );
+                    if(mpHatchItem)
+                    {
+                        const String aString( mpHatchItem->GetName() );
+                        const SfxObjectShell* pSh = SfxObjectShell::Current();
+                        const SvxHatchListItem aItem(*(const SvxHatchListItem*)(pSh->GetItem(SID_HATCH_LIST)));
+
+                        mpLbFillAttr->Clear();
+                        mpLbFillAttr->Enable();
+                        mpLbFillAttr->Fill(aItem.GetHatchList());
+                        mpLbFillAttr->SelectEntry(aString);
+                    }
+                    else
+                    {
+                        mpLbFillAttr->SetNoSelection();
+                    }
+                }
+            }
+            break;
+        }
+        case SID_BITMAP_LIST:
+        {
+            if(SFX_ITEM_AVAILABLE == eState)
+            {
+                if(mpStyleItem && XFILL_BITMAP == (XFillStyle)mpStyleItem->GetValue())
+                {
+                    if(mpBitmapItem)
+                    {
+                        const String aString( mpBitmapItem->GetName() );
+                        const SfxObjectShell* pSh = SfxObjectShell::Current();
+                        const SvxBitmapListItem aItem(*(const SvxBitmapListItem*)(pSh->GetItem(SID_BITMAP_LIST)));
+
+                        mpLbFillAttr->Clear();
+                        mpLbFillAttr->Enable();
+                        mpLbFillAttr->Fill(aItem.GetBitmapList());
+                        mpLbFillAttr->SelectEntry(aString);
+                    }
+                    else
+                    {
+                        mpLbFillAttr->SetNoSelection();
+                    }
                 }
-                else
-                    mpLbFillAttr->SetNoSelection();
             }
+            break;
         }
     }
 }
 
 
 
-
 SfxBindings* AreaPropertyPanel::GetBindings()
 {
     return mpBindings;
@@ -1055,113 +1103,122 @@ SfxBindings* AreaPropertyPanel::GetBindings()
 
 void AreaPropertyPanel::Update()
 {
-    if ( mpStyleItem )
+    if(mpStyleItem)
     {
-        XFillStyle eXFS = (XFillStyle)mpStyleItem->GetValue();
+        const XFillStyle eXFS = (XFillStyle)mpStyleItem->GetValue();
         SfxObjectShell* pSh = SfxObjectShell::Current();
 
         switch( eXFS )
         {
             case XFILL_NONE:
             {
-                mpLbFillAttr->Show();   //wj for new color picker
-                mpToolBoxColor->Hide(); //wj for new color picker
-                mbTBShow = false;
+                mpLbFillAttr->Show();
+                mpToolBoxColor->Hide();
+                break;
             }
-            break;
-
             case XFILL_SOLID:
             {
-                if ( mpColorItem )
+                if(mpColorItem)
                 {
-                    mpLbFillAttr->Hide();   //wj for new color picker
-                    mpToolBoxColor->Show(); //wj for new color picker
-                    mbTBShow = true;
+                    mpLbFillAttr->Hide();
+                    mpToolBoxColor->Show();
                     mpColorUpdater->Update(mpColorItem->GetColorValue());
                 }
                 else
+                {
                     mpColorUpdater->Update(COL_WHITE);
+                }
+                break;
             }
-            break;
-
             case XFILL_GRADIENT:
             {
-                mpLbFillAttr->Show();   //wj for new color picker
-                mpToolBoxColor->Hide(); //wj for new color picker
-                mbTBShow = false;
-                if ( pSh && pSh->GetItem( SID_GRADIENT_LIST ) )
+                mpLbFillAttr->Show();
+                mpToolBoxColor->Hide();
+
+                if(pSh && pSh->GetItem(SID_GRADIENT_LIST))
                 {
-                    SvxGradientListItem aItem( *(const SvxGradientListItem*)(
-                        pSh->GetItem( SID_GRADIENT_LIST ) ) );
+                    const SvxGradientListItem aItem(*(const SvxGradientListItem*)(pSh->GetItem(SID_GRADIENT_LIST)));
                     mpLbFillAttr->Enable();
                     mpLbFillAttr->Clear();
-                    mpLbFillAttr->Fill( aItem.GetGradientList() );
-                    if ( mpFillGradientItem )
+                    mpLbFillAttr->Fill(aItem.GetGradientList());
+
+                    if(mpFillGradientItem)
                     {
-                        String aString( mpFillGradientItem->GetName() );
-                        mpLbFillAttr->SelectEntry( aString );
+                        const String aString(mpFillGradientItem->GetName());
+
+                        mpLbFillAttr->SelectEntry(aString);
                     }
                     else
+                    {
                         mpLbFillAttr->SetNoSelection();
+                    }
                 }
                 else
+                {
                     mpLbFillAttr->SetNoSelection();
+                }
+                break;
             }
-            break;
-
             case XFILL_HATCH:
             {
-                mpLbFillAttr->Show();   //wj for new color picker
-                mpToolBoxColor->Hide(); //wj for new color picker
-                mbTBShow = false;
-                if ( pSh && pSh->GetItem( SID_HATCH_LIST ) )
+                mpLbFillAttr->Show();
+                mpToolBoxColor->Hide();
+
+                if(pSh && pSh->GetItem(SID_HATCH_LIST))
                 {
-                    SvxHatchListItem aItem( *(const SvxHatchListItem*)(
-                        pSh->GetItem( SID_HATCH_LIST ) ) );
+                    const SvxHatchListItem aItem(*(const SvxHatchListItem*)(pSh->GetItem(SID_HATCH_LIST)));
                     mpLbFillAttr->Enable();
                     mpLbFillAttr->Clear();
-                    mpLbFillAttr->Fill( aItem.GetHatchList() );
-                    if ( mpHatchItem )
+                    mpLbFillAttr->Fill(aItem.GetHatchList());
+
+                    if(mpHatchItem)
                     {
-                        String aString( mpHatchItem->GetName() );
+                        const String aString(mpHatchItem->GetName());
+
                         mpLbFillAttr->SelectEntry( aString );
                     }
                     else
+                    {
                         mpLbFillAttr->SetNoSelection();
+                    }
                 }
                 else
+                {
                     mpLbFillAttr->SetNoSelection();
+                }
+                break;
             }
-            break;
-
             case XFILL_BITMAP:
             {
-                mpLbFillAttr->Show();   //wj for new color picker
-                mpToolBoxColor->Hide(); //wj for new color picker
-                mbTBShow = false;
-                //mpLbFillAttr->Fill( mpBitmapListItem->GetBitmapList() );
-                if ( pSh && pSh->GetItem( SID_BITMAP_LIST ) )
+                mpLbFillAttr->Show();
+                mpToolBoxColor->Hide();
+
+                if(pSh && pSh->GetItem(SID_BITMAP_LIST))
                 {
-                    SvxBitmapListItem aItem( *(const SvxBitmapListItem*)(
-                        pSh->GetItem( SID_BITMAP_LIST ) ) );
+                    const SvxBitmapListItem aItem(*(const SvxBitmapListItem*)(pSh->GetItem(SID_BITMAP_LIST)));
                     mpLbFillAttr->Enable();
                     mpLbFillAttr->Clear();
-                    mpLbFillAttr->Fill( aItem.GetBitmapList() );
-                    if ( mpBitmapItem )
+                    mpLbFillAttr->Fill(aItem.GetBitmapList());
+
+                    if(mpBitmapItem)
                     {
-                        String aString( mpBitmapItem->GetName() );
-                        mpLbFillAttr->SelectEntry( aString );
+                        const String aString(mpBitmapItem->GetName());
+
+                        mpLbFillAttr->SelectEntry(aString);
                     }
                     else
+                    {
                         mpLbFillAttr->SetNoSelection();
+                    }
                 }
                 else
+                {
                     mpLbFillAttr->SetNoSelection();
+                }
+                break;
             }
-            break;
-
             default:
-                OSL_ENSURE(false, "Nicht unterstuetzter Flaechentyp");
+                OSL_ENSURE(false, "Non supported FillType (!)");
             break;
         }
     }
@@ -1179,9 +1236,7 @@ IMPL_LINK( AreaPropertyPanel, ImplPopupModeEndHdl, FloatingWindow*, EMPTYARG )
 IMPL_LINK( AreaPropertyPanel, ClickTrGrHdl_Impl, ToolBox*, pToolBox )
 {
     maTrGrPopup.Rearrange(mpFloatTransparenceItem.get());
-
     OSL_ASSERT(pToolBox->GetCurItemId() == TBI_BTX_GRADIENT);
-
     maTrGrPopup.Show(*pToolBox);
 
     return (0L);
@@ -1195,86 +1250,87 @@ IMPL_LINK(AreaPropertyPanel, ChangeTrgrTypeHdl_Impl, void *, EMPTYARG)
     bool bGradient = false;
     sal_uInt16 nTrans = 0;
 
-    if (nSelectType == 0)
+    if(!nSelectType)
     {
         mpBTNGradient->Hide();
         mpMTRTransparent->Show();
         mpMTRTransparent->Enable();
         mpMTRTransparent->SetValue(0);
     }
-    else if (nSelectType == 1)
+    else if(1 == nSelectType)
     {
         mpBTNGradient->Hide();
         mpMTRTransparent->Show();
         nTrans = mnLastTransSolid;
         mpMTRTransparent->SetValue(nTrans);
-        mpLBTransType->SelectEntryPos(1);// for multi-selected, choose solid no selection
+        mpLBTransType->SelectEntryPos(1);
         mpMTRTransparent->Enable();
     }
     else
     {
         mpBTNGradient->Show();
-        //for beta1
-        switch ( nSelectType )
+
+        switch (nSelectType)
         {
-        case 2:
-            mpBTNGradient->SetItemImage(TBI_BTX_GRADIENT, maImgLinear); // high contrast
-            break;
-        case 3:
-            mpBTNGradient->SetItemImage(TBI_BTX_GRADIENT, maImgAxial);
-            break;
-        case 4:
-            mpBTNGradient->SetItemImage(TBI_BTX_GRADIENT, maImgRadial);
-            break;
-        case 5:
-            mpBTNGradient->SetItemImage(TBI_BTX_GRADIENT, maImgElli );
-            break;
-        case 6:
-            mpBTNGradient->SetItemImage(TBI_BTX_GRADIENT, maImgQuad );
-            break;
-        case 7:
-            mpBTNGradient->SetItemImage(TBI_BTX_GRADIENT, maImgSquare);
-            break;
+            case 2:
+                mpBTNGradient->SetItemImage(TBI_BTX_GRADIENT, maImgLinear);
+                break;
+            case 3:
+                mpBTNGradient->SetItemImage(TBI_BTX_GRADIENT, maImgAxial);
+                break;
+            case 4:
+                mpBTNGradient->SetItemImage(TBI_BTX_GRADIENT, maImgRadial);
+                break;
+            case 5:
+                mpBTNGradient->SetItemImage(TBI_BTX_GRADIENT, maImgElli );
+                break;
+            case 6:
+                mpBTNGradient->SetItemImage(TBI_BTX_GRADIENT, maImgQuad );
+                break;
+            case 7:
+                mpBTNGradient->SetItemImage(TBI_BTX_GRADIENT, maImgSquare);
+                break;
         }
-        //end of new code
+
         mpMTRTransparent->Hide();
         mpBTNGradient->Enable();
         bGradient = true;
     }
 
-    XFillTransparenceItem aLinearItem(nTrans);
+    const XFillTransparenceItem aLinearItem(nTrans);
     GetBindings()->GetDispatcher()->Execute( SID_ATTR_FILL_TRANSPARENCE, SFX_CALLMODE_RECORD, &aLinearItem, 0L );
 
-    if (nSelectType > 1) nSelectType = nSelectType-2;
+    if(nSelectType > 1)
+    {
+        nSelectType -= 2;
+    }
 
     XGradient aTmpGradient;
 
     switch(nSelectType)
     {
-    case XGRAD_LINEAR:
-        aTmpGradient = maGradientLinear;
-        break;
-    case XGRAD_AXIAL:
-        aTmpGradient = maGradientAxial;
-        break;
-    case XGRAD_RADIAL:
-        aTmpGradient = maGradientRadial;
-        break;
-    case XGRAD_ELLIPTICAL:
-        aTmpGradient = maGradientElliptical;
-        break;
-    case XGRAD_SQUARE:
-        aTmpGradient = maGradientSquare;
-        break;
-    case XGRAD_RECT:
-        aTmpGradient = maGradientRect;
-        break;
+        case XGRAD_LINEAR:
+            aTmpGradient = maGradientLinear;
+            break;
+        case XGRAD_AXIAL:
+            aTmpGradient = maGradientAxial;
+            break;
+        case XGRAD_RADIAL:
+            aTmpGradient = maGradientRadial;
+            break;
+        case XGRAD_ELLIPTICAL:
+            aTmpGradient = maGradientElliptical;
+            break;
+        case XGRAD_SQUARE:
+            aTmpGradient = maGradientSquare;
+            break;
+        case XGRAD_RECT:
+            aTmpGradient = maGradientRect;
+            break;
     }
-    SfxItemPool* pPool = NULL;
-    bool bEnable = false;
-    if (bGradient) bEnable = true;
-    XFillFloatTransparenceItem aGradientItem(pPool,aTmpGradient, bEnable );
 
+    SfxItemPool* pPool = 0;
+    const XFillFloatTransparenceItem aGradientItem(pPool, aTmpGradient, sal_Bool(bGradient));
     GetBindings()->GetDispatcher()->Execute( SID_ATTR_FILL_FLOATTRANSPARENCE, SFX_CALLMODE_RECORD, &aGradientItem, 0L );
 
     return( 0L );
@@ -1284,12 +1340,16 @@ IMPL_LINK(AreaPropertyPanel, ChangeTrgrTypeHdl_Impl, void *, EMPTYARG)
 
 IMPL_LINK(AreaPropertyPanel, ModifyTransparentHdl_Impl, void*, EMPTYARG)
 {
-    sal_uInt16 nTrans = (sal_uInt16)mpMTRTransparent->GetValue();
+    const sal_uInt16 nTrans = (sal_uInt16)mpMTRTransparent->GetValue();
     mnLastTransSolid = nTrans;
-    sal_uInt16 nSelectType = mpLBTransType->GetSelectEntryPos();
-    if (nTrans != 0 && nSelectType == 0)
+    const sal_uInt16 nSelectType = mpLBTransType->GetSelectEntryPos();
+
+    if(nTrans && !nSelectType)
+    {
         mpLBTransType->SelectEntryPos(1);
-    XFillTransparenceItem aLinearItem(nTrans);
+    }
+
+    const XFillTransparenceItem aLinearItem(nTrans);
     GetBindings()->GetDispatcher()->Execute( SID_ATTR_FILL_TRANSPARENCE, SFX_CALLMODE_RECORD, &aLinearItem, 0L );
 
     return 0L;
diff --git a/svx/source/sidebar/area/AreaPropertyPanel.hxx b/svx/source/sidebar/area/AreaPropertyPanel.hxx
index 4f8da6f..caf005a 100644
--- a/svx/source/sidebar/area/AreaPropertyPanel.hxx
+++ b/svx/source/sidebar/area/AreaPropertyPanel.hxx
@@ -116,10 +116,6 @@ private:
     ::boost::scoped_ptr< XFillGradientItem >            mpFillGradientItem;
     ::boost::scoped_ptr< XFillHatchItem >               mpHatchItem;
     ::boost::scoped_ptr< XFillBitmapItem >              mpBitmapItem;
-    ::boost::scoped_ptr< SvxColorListItem >             mpColorListItem;
-    ::boost::scoped_ptr< SvxGradientListItem >          mpGradientListItem;
-    ::boost::scoped_ptr< SvxHatchListItem >             mpHatchListItem;
-    ::boost::scoped_ptr< SvxBitmapListItem >            mpBitmapListItem;
 
     ::sfx2::sidebar::ControllerItem                     maStyleControl;
     ::sfx2::sidebar::ControllerItem                     maColorControl;
@@ -154,7 +150,6 @@ private:
     SfxBindings*                                        mpBindings;
 
     /// bitfield
-    bool                                                mbTBShow : 1;
     bool                                                mbColorAvail : 1;
 
     DECL_LINK(SelectFillTypeHdl, ListBox* );
diff --git a/svx/source/sidebar/graphic/GraphicPropertyPanel.cxx b/svx/source/sidebar/graphic/GraphicPropertyPanel.cxx
index f55a408..14433b7 100644
--- a/svx/source/sidebar/graphic/GraphicPropertyPanel.cxx
+++ b/svx/source/sidebar/graphic/GraphicPropertyPanel.cxx
@@ -139,10 +139,9 @@ void GraphicPropertyPanel::Initialize()
 
 IMPL_LINK( GraphicPropertyPanel, ModifyBrightnessHdl, void *, EMPTYARG )
 {
-    sal_Int16 nBright = mpMtrBrightness->GetValue();
-    SfxInt16Item aBrightItem( SID_ATTR_GRAF_LUMINANCE, nBright );
-    GetBindings()->GetDispatcher()->Execute(
-        SID_ATTR_GRAF_LUMINANCE, SFX_CALLMODE_RECORD, &aBrightItem, 0L);
+    const sal_Int16 nBright = mpMtrBrightness->GetValue();
+    const SfxInt16Item aBrightItem( SID_ATTR_GRAF_LUMINANCE, nBright );
+    GetBindings()->GetDispatcher()->Execute(SID_ATTR_GRAF_LUMINANCE, SFX_CALLMODE_RECORD, &aBrightItem, 0L);
     return 0L;
 }
 
@@ -150,10 +149,9 @@ IMPL_LINK( GraphicPropertyPanel, ModifyBrightnessHdl, void *, EMPTYARG )
 
 IMPL_LINK( GraphicPropertyPanel, ModifyContrastHdl, void *, EMPTYARG )
 {
-    sal_Int16 nContrast = mpMtrContrast->GetValue();
-    SfxInt16Item aContrastItem( SID_ATTR_GRAF_CONTRAST, nContrast );
-    GetBindings()->GetDispatcher()->Execute(
-        SID_ATTR_GRAF_CONTRAST, SFX_CALLMODE_RECORD, &aContrastItem, 0L);
+    const sal_Int16 nContrast = mpMtrContrast->GetValue();
+    const SfxInt16Item aContrastItem( SID_ATTR_GRAF_CONTRAST, nContrast );
+    GetBindings()->GetDispatcher()->Execute(SID_ATTR_GRAF_CONTRAST, SFX_CALLMODE_RECORD, &aContrastItem, 0L);
     return 0L;
 }
 
@@ -161,10 +159,9 @@ IMPL_LINK( GraphicPropertyPanel, ModifyContrastHdl, void *, EMPTYARG )
 
 IMPL_LINK( GraphicPropertyPanel, ModifyTransHdl, void *, EMPTYARG )
 {
-    sal_Int16 nTrans = mpMtrTrans->GetValue();
-    SfxInt16Item aTransItem( SID_ATTR_GRAF_TRANSPARENCE, nTrans );
-    GetBindings()->GetDispatcher()->Execute(
-        SID_ATTR_GRAF_TRANSPARENCE, SFX_CALLMODE_RECORD, &aTransItem, 0L);
+    const sal_Int16 nTrans = mpMtrTrans->GetValue();
+    const SfxInt16Item aTransItem( SID_ATTR_GRAF_TRANSPARENCE, nTrans );
+    GetBindings()->GetDispatcher()->Execute(SID_ATTR_GRAF_TRANSPARENCE, SFX_CALLMODE_RECORD, &aTransItem, 0L);
     return 0L;
 }
 
@@ -172,10 +169,9 @@ IMPL_LINK( GraphicPropertyPanel, ModifyTransHdl, void *, EMPTYARG )
 
 IMPL_LINK_NOARG( GraphicPropertyPanel, ClickColorModeHdl )
 {
-    sal_Int16 nTrans = mpLBColorMode->GetSelectEntryPos();
-    SfxInt16Item aTransItem( SID_ATTR_GRAF_MODE, nTrans );
-    GetBindings()->GetDispatcher()->Execute(
-        SID_ATTR_GRAF_MODE, SFX_CALLMODE_RECORD, &aTransItem, 0L);
+    const sal_Int16 nTrans = mpLBColorMode->GetSelectEntryPos();
+    const SfxInt16Item aTransItem( SID_ATTR_GRAF_MODE, nTrans );
+    GetBindings()->GetDispatcher()->Execute(SID_ATTR_GRAF_MODE, SFX_CALLMODE_RECORD, &aTransItem, 0L);
     return 0L;
 }
 
@@ -183,10 +179,9 @@ IMPL_LINK_NOARG( GraphicPropertyPanel, ClickColorModeHdl )
 
 IMPL_LINK( GraphicPropertyPanel, RedHdl, void*, EMPTYARG )
 {
-    sal_Int16 nRed = mpMtrRed->GetValue();
-    SfxInt16Item aRedItem( SID_ATTR_GRAF_RED, nRed );
-    GetBindings()->GetDispatcher()->Execute(
-        SID_ATTR_GRAF_RED, SFX_CALLMODE_RECORD, &aRedItem, 0L);
+    const sal_Int16 nRed = mpMtrRed->GetValue();
+    const SfxInt16Item aRedItem( SID_ATTR_GRAF_RED, nRed );
+    GetBindings()->GetDispatcher()->Execute(SID_ATTR_GRAF_RED, SFX_CALLMODE_RECORD, &aRedItem, 0L);
     return 0L;
 }
 
@@ -194,10 +189,9 @@ IMPL_LINK( GraphicPropertyPanel, RedHdl, void*, EMPTYARG )
 
 IMPL_LINK( GraphicPropertyPanel, GreenHdl, void*, EMPTYARG )
 {
-    sal_Int16 nGreen = mpMtrGreen->GetValue();
-    SfxInt16Item aGreenItem( SID_ATTR_GRAF_GREEN, nGreen );
-    GetBindings()->GetDispatcher()->Execute(
-        SID_ATTR_GRAF_GREEN, SFX_CALLMODE_RECORD, &aGreenItem, 0L);
+    const sal_Int16 nGreen = mpMtrGreen->GetValue();
+    const SfxInt16Item aGreenItem( SID_ATTR_GRAF_GREEN, nGreen );
+    GetBindings()->GetDispatcher()->Execute(SID_ATTR_GRAF_GREEN, SFX_CALLMODE_RECORD, &aGreenItem, 0L);
     return 0L;
 }
 
@@ -205,10 +199,9 @@ IMPL_LINK( GraphicPropertyPanel, GreenHdl, void*, EMPTYARG )
 
 IMPL_LINK(GraphicPropertyPanel, BlueHdl, void *, EMPTYARG)
 {
-    sal_Int16 nBlue = mpMtrBlue->GetValue();
-    SfxInt16Item aBlueItem( SID_ATTR_GRAF_BLUE, nBlue );
-    GetBindings()->GetDispatcher()->Execute(
-        SID_ATTR_GRAF_BLUE, SFX_CALLMODE_RECORD, &aBlueItem, 0L);
+    const sal_Int16 nBlue = mpMtrBlue->GetValue();
+    const SfxInt16Item aBlueItem( SID_ATTR_GRAF_BLUE, nBlue );
+    GetBindings()->GetDispatcher()->Execute(SID_ATTR_GRAF_BLUE, SFX_CALLMODE_RECORD, &aBlueItem, 0L);
     return 0L;
 }
 
@@ -216,10 +209,9 @@ IMPL_LINK(GraphicPropertyPanel, BlueHdl, void *, EMPTYARG)
 
 IMPL_LINK(GraphicPropertyPanel, GammaHdl, void *, EMPTYARG)
 {
-    sal_Int32 nGamma = mpMtrGamma->GetValue();
-    SfxInt32Item nGammaItem( SID_ATTR_GRAF_GAMMA, nGamma );
-    GetBindings()->GetDispatcher()->Execute(
-        SID_ATTR_GRAF_GAMMA, SFX_CALLMODE_RECORD, &nGammaItem, 0L);
+    const sal_Int32 nGamma = mpMtrGamma->GetValue();
+    const SfxInt32Item nGammaItem( SID_ATTR_GRAF_GAMMA, nGamma );
+    GetBindings()->GetDispatcher()->Execute(SID_ATTR_GRAF_GAMMA, SFX_CALLMODE_RECORD, &nGammaItem, 0L);
     return 0L;
 }
 
@@ -279,166 +271,198 @@ void GraphicPropertyPanel::NotifyItemUpdate(
 
     switch( nSID )
     {
-    case SID_ATTR_GRAF_LUMINANCE:
-        if( eState >= SFX_ITEM_AVAILABLE)
+        case SID_ATTR_GRAF_LUMINANCE:
         {
-            mpMtrBrightness->Enable();
-            const SfxInt16Item* pItem = dynamic_cast< const SfxInt16Item* >(pState);
-
-            if(pItem)
+            if(eState >= SFX_ITEM_AVAILABLE)
             {
-                sal_Int64 nBright = pItem->GetValue();
-                mpMtrBrightness->SetValue(nBright);
+                mpMtrBrightness->Enable();
+                const SfxInt16Item* pItem = dynamic_cast< const SfxInt16Item* >(pState);
+
+                if(pItem)
+                {
+                    const sal_Int64 nBright = pItem->GetValue();
+                    mpMtrBrightness->SetValue(nBright);
+                }
             }
-        }
-        else if( eState == SFX_ITEM_DISABLED )
-            mpMtrBrightness->Disable();
-        else
-        {
-            mpMtrBrightness->Enable();
-            mpMtrBrightness->SetText( String());
-        }
-        break;
-    case SID_ATTR_GRAF_CONTRAST:
-        if( eState >= SFX_ITEM_AVAILABLE)
-        {
-            mpMtrContrast->Enable();
-            const SfxInt16Item* pItem = dynamic_cast< const SfxInt16Item* >(pState);
-
-            if(pItem)
+            else if(SFX_ITEM_DISABLED == eState)
             {
-                sal_Int64 nContrast = pItem->GetValue();
-                mpMtrContrast->SetValue(nContrast);
+                mpMtrBrightness->Disable();
             }
-        }
-        else if( eState == SFX_ITEM_DISABLED )
-            mpMtrContrast->Disable();
-        else
-        {
-            mpMtrContrast->Enable();
-            mpMtrContrast->SetText( String());
-        }
-        break;
-    case SID_ATTR_GRAF_TRANSPARENCE:
-        if( eState >= SFX_ITEM_AVAILABLE)
-        {
-            mpMtrTrans->Enable();
-            const SfxUInt16Item* pItem = dynamic_cast< const SfxUInt16Item* >(pState);
-
-            if(pItem)
+            else
             {
-                sal_Int64 nTrans = pItem->GetValue();
-                mpMtrTrans->SetValue(nTrans);
+                mpMtrBrightness->Enable();
+                mpMtrBrightness->SetText(String());
             }
+            break;
         }
-        else if( eState == SFX_ITEM_DISABLED )
-            mpMtrTrans->Disable();
-        else
+        case SID_ATTR_GRAF_CONTRAST:
         {
-            mpMtrTrans->Enable();
-            mpMtrTrans->SetText( String());
-        }
-        break;
-    case SID_ATTR_GRAF_MODE:
-        if( eState >= SFX_ITEM_AVAILABLE)
-        {
-            mpLBColorMode->Enable();
-            const SfxUInt16Item* pItem = dynamic_cast< const SfxUInt16Item* >(pState);
-
-            if(pItem)
+            if(eState >= SFX_ITEM_AVAILABLE)
             {
-                sal_Int64 nTrans = pItem->GetValue();
-                mpLBColorMode->SelectEntryPos(nTrans);
+                mpMtrContrast->Enable();
+                const SfxInt16Item* pItem = dynamic_cast< const SfxInt16Item* >(pState);
+
+                if(pItem)
+                {
+                    const sal_Int64 nContrast = pItem->GetValue();
+                    mpMtrContrast->SetValue(nContrast);
+                }
             }
-        }
-        else if( eState == SFX_ITEM_DISABLED )
-            mpLBColorMode->Disable();
-        else
-        {
-            mpLBColorMode->Enable();
-            mpLBColorMode->SetNoSelection();
-        }
-        break;
-    case SID_ATTR_GRAF_RED:
-        if( eState >= SFX_ITEM_AVAILABLE)
-        {
-            mpMtrRed->Enable();
-            const SfxInt16Item* pItem = dynamic_cast< const SfxInt16Item* >(pState);
-
-            if(pItem)
+            else if(SFX_ITEM_DISABLED == eState)
             {
-                sal_Int64 nRed = pItem->GetValue();
-                mpMtrRed->SetValue( nRed );
+                mpMtrContrast->Disable();
             }
+            else
+            {
+                mpMtrContrast->Enable();
+                mpMtrContrast->SetText(String());
+            }
+            break;
         }
-        else if( eState == SFX_ITEM_DISABLED )
-            mpMtrRed->Disable();
-        else
-        {
-            mpMtrRed->Enable();
-            mpMtrRed->SetText( String());
-        }
-        break;
-    case SID_ATTR_GRAF_GREEN:
-        if( eState >= SFX_ITEM_AVAILABLE)
+        case SID_ATTR_GRAF_TRANSPARENCE:
         {
-            mpMtrGreen->Enable();
-            const SfxInt16Item* pItem = dynamic_cast< const SfxInt16Item* >(pState);
-
-            if(pItem)
+            if(eState >= SFX_ITEM_AVAILABLE)
+            {
+                mpMtrTrans->Enable();
+                const SfxUInt16Item* pItem = dynamic_cast< const SfxUInt16Item* >(pState);
+
+                if(pItem)
+                {
+                    const sal_Int64 nTrans = pItem->GetValue();
+                    mpMtrTrans->SetValue(nTrans);
+                }
+            }
+            else if(SFX_ITEM_DISABLED == eState)
+            {
+                mpMtrTrans->Disable();
+            }
+            else
             {
-                sal_Int64 nGreen = pItem->GetValue();
-                mpMtrGreen->SetValue( nGreen );
+                mpMtrTrans->Enable();
+                mpMtrTrans->SetText(String());
             }
+            break;
         }
-        else if( eState == SFX_ITEM_DISABLED )
-            mpMtrGreen->Disable();
-        else
+        case SID_ATTR_GRAF_MODE:
         {
-            mpMtrGreen->Enable();
-            mpMtrGreen->SetText( String());
+            if(eState >= SFX_ITEM_AVAILABLE)
+            {
+                mpLBColorMode->Enable();
+                const SfxUInt16Item* pItem = dynamic_cast< const SfxUInt16Item* >(pState);
+
+                if(pItem)
+                {
+                    const sal_Int64 nTrans = pItem->GetValue();
+                    mpLBColorMode->SelectEntryPos(nTrans);
+                }
+            }
+            else if(SFX_ITEM_DISABLED == eState)
+            {
+                mpLBColorMode->Disable();
+            }
+            else
+            {
+                mpLBColorMode->Enable();
+                mpLBColorMode->SetNoSelection();
+            }
+            break;
         }
-        break;
-    case SID_ATTR_GRAF_BLUE:
-        if( eState >= SFX_ITEM_AVAILABLE)
+        case SID_ATTR_GRAF_RED:
         {
-            mpMtrBlue->Enable();
-            const SfxInt16Item* pItem = dynamic_cast< const SfxInt16Item* >(pState);
-
-            if(pItem)
+            if(eState >= SFX_ITEM_AVAILABLE)
             {
-                sal_Int64 nBlue = pItem->GetValue();
-                mpMtrBlue->SetValue( nBlue );
+                mpMtrRed->Enable();
+                const SfxInt16Item* pItem = dynamic_cast< const SfxInt16Item* >(pState);
+
+                if(pItem)
+                {
+                    const sal_Int64 nRed = pItem->GetValue();
+                    mpMtrRed->SetValue( nRed );
+                }
             }
+            else if(SFX_ITEM_DISABLED == eState)
+            {
+                mpMtrRed->Disable();
+            }
+            else
+            {
+                mpMtrRed->Enable();
+                mpMtrRed->SetText(String());
+            }
+            break;
         }
-        else if( eState == SFX_ITEM_DISABLED )
-            mpMtrBlue->Disable();
-        else
+        case SID_ATTR_GRAF_GREEN:
         {
-            mpMtrBlue->Enable();
-            mpMtrBlue->SetText( String());
+            if(eState >= SFX_ITEM_AVAILABLE)
+            {
+                mpMtrGreen->Enable();
+                const SfxInt16Item* pItem = dynamic_cast< const SfxInt16Item* >(pState);
+
+                if(pItem)
+                {
+                    const sal_Int64 nGreen = pItem->GetValue();
+                    mpMtrGreen->SetValue( nGreen );
+                }
+            }
+            else if(SFX_ITEM_DISABLED == eState)
+            {
+                mpMtrGreen->Disable();
+            }
+            else
+            {
+                mpMtrGreen->Enable();
+                mpMtrGreen->SetText(String());
+            }
+            break;
         }
-        break;
-    case SID_ATTR_GRAF_GAMMA:
-        if( eState >= SFX_ITEM_AVAILABLE)
+        case SID_ATTR_GRAF_BLUE:
         {
-            mpMtrGamma->Enable();
-            const SfxUInt32Item* pItem = dynamic_cast< const SfxUInt32Item* >(pState);
-
-            if(pItem)
+            if(eState >= SFX_ITEM_AVAILABLE)
+            {
+                mpMtrBlue->Enable();
+                const SfxInt16Item* pItem = dynamic_cast< const SfxInt16Item* >(pState);
+
+                if(pItem)
+                {
+                    const sal_Int64 nBlue = pItem->GetValue();
+                    mpMtrBlue->SetValue( nBlue );
+                }
+            }
+            else if(SFX_ITEM_DISABLED == eState)
+            {
+                mpMtrBlue->Disable();
+            }
+            else
             {
-                sal_Int64 nGamma = pItem->GetValue();
-                mpMtrGamma->SetValue( nGamma );
+                mpMtrBlue->Enable();
+                mpMtrBlue->SetText(String());
             }
+            break;
         }
-        else if( eState == SFX_ITEM_DISABLED )
-            mpMtrGamma->Disable();
-        else
+        case SID_ATTR_GRAF_GAMMA:
         {
-            mpMtrGamma->Enable();
-            mpMtrGamma->SetText( String());
+            if(eState >= SFX_ITEM_AVAILABLE)
+            {
+                mpMtrGamma->Enable();
+                const SfxUInt32Item* pItem = dynamic_cast< const SfxUInt32Item* >(pState);
+
+                if(pItem)
+                {
+                    const sal_Int64 nGamma = pItem->GetValue();
+                    mpMtrGamma->SetValue( nGamma );
+                }
+            }
+            else if(SFX_ITEM_DISABLED == eState)
+            {
+                mpMtrGamma->Disable();
+            }
+            else
+            {
+                mpMtrGamma->Enable();
+                mpMtrGamma->SetText(String());
+            }
+            break;
         }
-        break;
     }
 }
 
diff --git a/svx/source/sidebar/line/LinePropertyPanel.cxx b/svx/source/sidebar/line/LinePropertyPanel.cxx
index 61f07b0..071f4ec 100644
--- a/svx/source/sidebar/line/LinePropertyPanel.cxx
+++ b/svx/source/sidebar/line/LinePropertyPanel.cxx
@@ -700,9 +700,9 @@ void LinePropertyPanel::NotifyItemUpdate(
                         break;
                     }
                 }
-
-                mpLBCapStyle->SetNoSelection();
             }
+
+            mpLBCapStyle->SetNoSelection();
             break;
         }
     }
diff --git a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
index 367e5c8..7136304 100644
--- a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
+++ b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
@@ -99,6 +99,16 @@ PosSizePropertyPanel::PosSizePropertyPanel(
     mxFrame(rxFrame),
     maContext(),
     mpBindings(pBindings),
+    maFtWidthOrigPos(mpFtWidth->GetPosPixel()),
+    maMtrWidthOrigPos(mpMtrWidth->GetPosPixel()),
+    maFtHeightOrigPos(mpFtHeight->GetPosPixel()),
+    maMtrHeightOrigPos(mpMtrHeight->GetPosPixel()),
+    maCbxScaleOrigPos(mpCbxScale->GetPosPixel()),
+    maFtAngleOrigPos(mpFtAngle->GetPosPixel()),
+    maMtrAnglOrigPos(mpMtrAngle->GetPosPixel()),
+    maFlipTbxOrigPos(mpFlipTbx->GetPosPixel()),
+    maDialOrigPos(mpDial->GetPosPixel()),
+    maFtFlipOrigPos(mpFtFlip->GetPosPixel()),
     mbMtrPosXMirror(false),
     mbSizeProtected(false),
     mbPositionProtected(false),
@@ -106,7 +116,6 @@ PosSizePropertyPanel::PosSizePropertyPanel(
     mbAutoHeight(false),
     mbAdjustEnabled(false),
     mbIsFlip(false),
-    mbInDestructor(false),
     mxSidebar(rxSidebar)
 {
     Initialize();
@@ -122,8 +131,6 @@ PosSizePropertyPanel::PosSizePropertyPanel(
 
 PosSizePropertyPanel::~PosSizePropertyPanel()
 {
-    mbInDestructor = true;
-
     // Destroy the background windows of the toolboxes.
     mpFlipTbx.reset();
     mpFlipTbxBackground.reset();
@@ -285,6 +292,46 @@ void PosSizePropertyPanel::DataChanged(
 
 
 
+void PosSizePropertyPanel::AdaptWidthHeightScalePosition(bool bOriginal)
+{
+    if(bOriginal)
+    {
+        mpFtWidth->SetPosPixel(maFtWidthOrigPos);
+        mpMtrWidth->SetPosPixel(maMtrWidthOrigPos);
+        mpFtHeight->SetPosPixel(maFtHeightOrigPos);
+        mpMtrHeight->SetPosPixel(maMtrHeightOrigPos);
+        mpCbxScale->SetPosPixel(maCbxScaleOrigPos);
+    }
+    else
+    {
+        mpFtWidth->SetPosPixel(Point(LogicToPixel(Point(FT_POSITION_X_X,FT_POSITION_X_Y), MAP_APPFONT)));
+        mpMtrWidth->SetPosPixel(Point(LogicToPixel(Point(MF_POSITION_X_X,MF_POSITION_X_Y), MAP_APPFONT)));
+        mpFtHeight->SetPosPixel(Point(LogicToPixel(Point(FT_POSITION_Y_X,FT_POSITION_Y_Y), MAP_APPFONT)));
+        mpMtrHeight->SetPosPixel(Point(LogicToPixel(Point(MF_POSITION_Y_X,MF_POSITION_Y_Y), MAP_APPFONT)));
+        mpCbxScale->SetPosPixel(Point(LogicToPixel(Point(FT_WIDTH_X,FT_WIDTH_Y), MAP_APPFONT)));
+    }
+}
+
+void PosSizePropertyPanel::AdaptAngleFlipDialPosition(bool bOriginal)
+{
+    if(bOriginal)
+    {
+        mpFtAngle->SetPosPixel(maFtAngleOrigPos);
+        mpMtrAngle->SetPosPixel(maMtrAnglOrigPos);
+        mpFlipTbx->SetPosPixel(maFlipTbxOrigPos);
+        mpDial->SetPosPixel(maDialOrigPos);
+        mpFtFlip->SetPosPixel(maFtFlipOrigPos);
+    }
+    else
+    {
+        mpFtAngle->SetPosPixel(Point(LogicToPixel(Point(FT_ANGLE_X,FT_ANGLE_Y), MAP_APPFONT)));
+        mpMtrAngle->SetPosPixel(Point(LogicToPixel(Point(MF_ANGLE_X2,MF_ANGLE_Y2), MAP_APPFONT)));
+        mpFlipTbx->SetPosPixel(Point(LogicToPixel(Point(FLIP_HORI_X2,FLIP_HORI_Y2), MAP_APPFONT)));
+        mpDial->SetPosPixel(Point(LogicToPixel(Point(ROTATE_CONTROL_X2,ROTATE_CONTROL_Y2), MAP_APPFONT)));
+        mpFtFlip->SetPosPixel(Point(LogicToPixel(Point(FT_FLIP_X2,FT_FLIP_Y2), MAP_APPFONT)));
+    }
+}
+
 void PosSizePropertyPanel::HandleContextChange(
     const ::sfx2::sidebar::EnumContext aContext)
 {
@@ -332,6 +379,7 @@ void PosSizePropertyPanel::HandleContextChange(
             nLayoutMode = 3;
             break;
     }
+
     switch (nLayoutMode)
     {
         case 0:
@@ -355,11 +403,8 @@ void PosSizePropertyPanel::HandleContextChange(
             mpFlipTbx->SetOutputSizePixel( aTbxSize );
             mbIsFlip = true;
 
-            mpFtWidth->SetPosPixel(Point(LogicToPixel(Point(FT_POSITION_X_X,FT_POSITION_X_Y), MAP_APPFONT)));
-            mpMtrWidth->SetPosPixel(Point(LogicToPixel(Point(MF_POSITION_X_X,MF_POSITION_X_Y), MAP_APPFONT)));
-            mpFtHeight->SetPosPixel(Point(LogicToPixel(Point(FT_POSITION_Y_X,FT_POSITION_Y_Y), MAP_APPFONT)));
-            mpMtrHeight->SetPosPixel(Point(LogicToPixel(Point(MF_POSITION_Y_X,MF_POSITION_Y_Y), MAP_APPFONT)));
-            mpCbxScale->SetPosPixel(Point(LogicToPixel(Point(FT_WIDTH_X,FT_WIDTH_Y), MAP_APPFONT)));
+            AdaptWidthHeightScalePosition(false);
+            AdaptAngleFlipDialPosition(false);
 
             mpFtAngle->SetPosPixel(Point(LogicToPixel(Point(FT_ANGLE_X,FT_ANGLE_Y), MAP_APPFONT)));
             mpMtrAngle->SetPosPixel(Point(LogicToPixel(Point(MF_ANGLE_X2,MF_ANGLE_Y2), MAP_APPFONT)));
@@ -394,11 +439,8 @@ void PosSizePropertyPanel::HandleContextChange(
             mpFtFlip->Hide();
             mbIsFlip = false;
 
-            mpFtWidth->SetPosPixel(Point(LogicToPixel(Point(FT_POSITION_X_X,FT_POSITION_X_Y), MAP_APPFONT)));
-            mpMtrWidth->SetPosPixel(Point(LogicToPixel(Point(MF_POSITION_X_X,MF_POSITION_X_Y), MAP_APPFONT)));
-            mpFtHeight->SetPosPixel(Point(LogicToPixel(Point(FT_POSITION_Y_X,FT_POSITION_Y_Y), MAP_APPFONT)));
-            mpMtrHeight->SetPosPixel(Point(LogicToPixel(Point(MF_POSITION_Y_X,MF_POSITION_Y_Y), MAP_APPFONT)));
-            mpCbxScale->SetPosPixel(Point(LogicToPixel(Point(FT_WIDTH_X,FT_WIDTH_Y), MAP_APPFONT)));
+            AdaptWidthHeightScalePosition(false);
+            AdaptAngleFlipDialPosition(true);
 
             Size aSize(GetOutputSizePixel().Width(),PS_SECTIONPAGE_HEIGHT3);
             aSize = LogicToPixel( aSize, MapMode(MAP_APPFONT) );
@@ -429,6 +471,9 @@ void PosSizePropertyPanel::HandleContextChange(
             mpFlipTbx->SetOutputSizePixel( aTbxSize );
             mbIsFlip = true;
 
+            AdaptWidthHeightScalePosition(true);
+            AdaptAngleFlipDialPosition(true);
+
             Size aSize(GetOutputSizePixel().Width(),PS_SECTIONPAGE_HEIGHT);
             aSize = LogicToPixel( aSize, MapMode(MAP_APPFONT) );
             SetSizePixel(aSize);
@@ -456,6 +501,9 @@ void PosSizePropertyPanel::HandleContextChange(
             mpFtFlip->Hide();
             mbIsFlip = false;
 
+            AdaptWidthHeightScalePosition(true);
+            AdaptAngleFlipDialPosition(true);
+
             Size aSize(GetOutputSizePixel().Width(),PS_SECTIONPAGE_HEIGHT4);
             aSize = LogicToPixel( aSize, MapMode(MAP_APPFONT) );
             SetSizePixel(aSize);
@@ -909,7 +957,8 @@ void PosSizePropertyPanel::NotifyItemUpdate(
         {
             sal_uInt16 nMarkObj = 0;
             bool isNoEdge = true;
-            while(rMarkList.GetMark(nMarkObj))
+
+            while(isNoEdge && rMarkList.GetMark(nMarkObj))
             {
                 const SdrObject* pObj = rMarkList.GetMark(nMarkObj)->GetMarkedSdrObj();
                 const SdrObjKind eKind((SdrObjKind)pObj->GetObjIdentifier());
@@ -924,6 +973,7 @@ void PosSizePropertyPanel::NotifyItemUpdate(
                 }
                 nMarkObj++;
             }
+
             if(!isNoEdge)
             {
                 mpFtAngle->Disable();
diff --git a/svx/source/sidebar/possize/PosSizePropertyPanel.hxx b/svx/source/sidebar/possize/PosSizePropertyPanel.hxx
index fb5ce8e..29d9289 100644
--- a/svx/source/sidebar/possize/PosSizePropertyPanel.hxx
+++ b/svx/source/sidebar/possize/PosSizePropertyPanel.hxx
@@ -125,6 +125,18 @@ private:
     ::sfx2::sidebar::EnumContext            maContext;
     SfxBindings*                            mpBindings;
 
+    // to remember original positions for restoring these for different layouts
+    Point                                   maFtWidthOrigPos;
+    Point                                   maMtrWidthOrigPos;
+    Point                                   maFtHeightOrigPos;
+    Point                                   maMtrHeightOrigPos;
+    Point                                   maCbxScaleOrigPos;
+    Point                                   maFtAngleOrigPos;
+    Point                                   maMtrAnglOrigPos;
+    Point                                   maFlipTbxOrigPos;
+    Point                                   maDialOrigPos;
+    Point                                   maFtFlipOrigPos;
+
     /// bitfield
     bool                                    mbMtrPosXMirror : 1;
     bool                                    mbSizeProtected : 1;
@@ -133,7 +145,6 @@ private:
     bool                                    mbAutoHeight : 1;
     bool                                    mbAdjustEnabled : 1;
     bool                                    mbIsFlip : 1;
-    bool                                    mbInDestructor : 1;
 
     cssu::Reference<css::ui::XSidebar> mxSidebar;
 
@@ -163,6 +174,8 @@ private:
     void MetricState( SfxItemState eState, const SfxPoolItem* pState );
     FieldUnit GetCurrentUnit( SfxItemState eState, const SfxPoolItem* pState );
     void DisableControls();
+    void AdaptWidthHeightScalePosition(bool bOriginal);
+    void AdaptAngleFlipDialPosition(bool bOriginal);
 };
 
 


More information about the Libreoffice-commits mailing list