Kaydet (Commit) 4d814ec1 authored tarafından Armin Le Grand's avatar Armin Le Grand Kaydeden (comit) Michael Meeks

Related: #i122111# Adapted pState usages in NotifyItemUpdate methods

adapted control positioning in PosSizePanel

(cherry picked from commit 76e55d0f)

Conflicts:
	svx/source/sidebar/area/AreaPropertyPanel.cxx
	svx/source/sidebar/area/AreaPropertyPanel.hxx

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