summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-02-02 12:19:04 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-02-03 16:04:03 +0100
commita4fbb496ef001d62fce0ad3cdd7a829f99aa182e (patch)
tree46251b839097ec9486da8da98bacf507ba4692e9 /svx
parentaa7f880e8a847686bc4ec2d8ca5f74f39c32abac (diff)
more TypedWhichId in SfxShell and SfxTabDialog
and remove some unnecessary local copies of pool items Change-Id: Ifdac8d84658fd4b803267038592d7da370e23a0d Reviewed-on: https://gerrit.libreoffice.org/49138 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/sidebar/area/AreaPropertyPanelBase.cxx70
-rw-r--r--svx/source/sidebar/line/LinePropertyPanelBase.cxx6
-rw-r--r--svx/source/tbxctrls/fillctrl.cxx63
-rw-r--r--svx/source/tbxctrls/itemwin.cxx7
4 files changed, 62 insertions, 84 deletions
diff --git a/svx/source/sidebar/area/AreaPropertyPanelBase.cxx b/svx/source/sidebar/area/AreaPropertyPanelBase.cxx
index 69bb7a5bd8e3..79053e69db68 100644
--- a/svx/source/sidebar/area/AreaPropertyPanelBase.cxx
+++ b/svx/source/sidebar/area/AreaPropertyPanelBase.cxx
@@ -207,8 +207,7 @@ IMPL_LINK_NOARG(AreaPropertyPanelBase, ClickImportBitmapHdl, Button*, void)
LeaveWait();
if( nError == ERRCODE_NONE )
{
- const SvxBitmapListItem aItem( *static_cast<const SvxBitmapListItem*>(SfxObjectShell::Current()->GetItem(SID_BITMAP_LIST)));
- XBitmapListRef pList = aItem.GetBitmapList();
+ XBitmapListRef pList = SfxObjectShell::Current()->GetItem(SID_BITMAP_LIST)->GetBitmapList();
INetURLObject aURL( aDlg.GetPath() );
OUString aFileName = aURL.GetName().getToken( 0, '.' );
OUString aName = aFileName;
@@ -303,11 +302,11 @@ IMPL_LINK_NOARG(AreaPropertyPanelBase, SelectFillTypeHdl, ListBox&, void)
mpMTRAngle->Enable();
mpLbFillAttr->Clear();
- const SvxGradientListItem aItem(*static_cast<const SvxGradientListItem*>(pSh->GetItem(SID_GRADIENT_LIST)));
+ const SvxGradientListItem * pItem = pSh->GetItem(SID_GRADIENT_LIST);
- if(0 < aItem.GetGradientList()->Count())
+ if(0 < pItem->GetGradientList()->Count())
{
- const XGradient aGradient = aItem.GetGradientList()->GetGradient(0)->GetGradient();
+ const XGradient aGradient = pItem->GetGradientList()->GetGradient(0)->GetGradient();
const XFillGradientItem aXFillGradientItem(aGradient);
// #i122676# change FillStyle and Gradient in one call
@@ -332,10 +331,10 @@ IMPL_LINK_NOARG(AreaPropertyPanelBase, SelectFillTypeHdl, ListBox&, void)
mpToolBoxColor->Hide();
mpBmpImport->Hide();
- const SvxHatchListItem* aItem( static_cast<const SvxHatchListItem*>(pSh->GetItem(SID_HATCH_LIST)));
- if(aItem)
+ const SvxHatchListItem* pItem( pSh->GetItem(SID_HATCH_LIST) );
+ if(pItem)
{
- XHatchListRef pXHatchList(aItem->GetHatchList());
+ XHatchListRef pXHatchList(pItem->GetHatchList());
mpLbFillAttr->Enable();
mpLbFillAttr->Clear();
mpLbFillAttr->Fill(pXHatchList);
@@ -379,10 +378,10 @@ IMPL_LINK_NOARG(AreaPropertyPanelBase, SelectFillTypeHdl, ListBox&, void)
if(nPos == static_cast< sal_Int32 >(BITMAP))
{
mpBmpImport->Show();
- const SvxBitmapListItem* aItem( static_cast<const SvxBitmapListItem*>(pSh->GetItem(SID_BITMAP_LIST)));
- if(aItem)
+ const SvxBitmapListItem* pItem = pSh->GetItem(SID_BITMAP_LIST);
+ if(pItem)
{
- XBitmapListRef pXBitmapList(aItem->GetBitmapList());
+ XBitmapListRef pXBitmapList(pItem->GetBitmapList());
mpLbFillAttr->Fill(pXBitmapList);
mpLbFillAttr->AdaptDropDownLineCountToMaximum();
@@ -406,10 +405,10 @@ IMPL_LINK_NOARG(AreaPropertyPanelBase, SelectFillTypeHdl, ListBox&, void)
else if(nPos == static_cast< sal_Int32 >(PATTERN))
{
mpBmpImport->Hide();
- const SvxPatternListItem* aItem( static_cast<const SvxPatternListItem*>(pSh->GetItem(SID_PATTERN_LIST)));
- if(aItem)
+ const SvxPatternListItem* pItem = pSh->GetItem(SID_PATTERN_LIST);
+ if(pItem)
{
- XPatternListRef pXPatternList(aItem->GetPatternList());
+ XPatternListRef pXPatternList(pItem->GetPatternList());
mpLbFillAttr->Fill(pXPatternList);
mpLbFillAttr->AdaptDropDownLineCountToMaximum();
@@ -524,11 +523,11 @@ void AreaPropertyPanelBase::SelectFillAttrHdl_Impl()
if(LISTBOX_ENTRY_NOTFOUND != nPos && pSh && pSh->GetItem(SID_HATCH_LIST))
{
- const SvxHatchListItem aItem(*static_cast<const SvxHatchListItem*>(pSh->GetItem(SID_HATCH_LIST)));
+ const SvxHatchListItem * pItem = pSh->GetItem(SID_HATCH_LIST);
- if(nPos < aItem.GetHatchList()->Count())
+ if(nPos < pItem->GetHatchList()->Count())
{
- const XHatch aHatch = aItem.GetHatchList()->GetHatch(nPos)->GetHatch();
+ const XHatch aHatch = pItem->GetHatchList()->GetHatch(nPos)->GetHatch();
const XFillHatchItem aXFillHatchItem( mpLbFillAttr->GetSelectedEntry(), aHatch);
// #i122676# Change FillStyle and Hatch in one call
@@ -554,11 +553,11 @@ void AreaPropertyPanelBase::SelectFillAttrHdl_Impl()
if(LISTBOX_ENTRY_NOTFOUND != nPos && pSh && pSh->GetItem(SID_BITMAP_LIST))
{
- const SvxBitmapListItem aItem(*static_cast<const SvxBitmapListItem*>(pSh->GetItem(SID_BITMAP_LIST)));
+ const SvxBitmapListItem * pItem = pSh->GetItem(SID_BITMAP_LIST);
- if(nPos < aItem.GetBitmapList()->Count())
+ if(nPos < pItem->GetBitmapList()->Count())
{
- const XBitmapEntry* pXBitmapEntry = aItem.GetBitmapList()->GetBitmap(nPos);
+ const XBitmapEntry* pXBitmapEntry = pItem->GetBitmapList()->GetBitmap(nPos);
const XFillBitmapItem aXFillBitmapItem(mpLbFillAttr->GetSelectedEntry(), pXBitmapEntry->GetGraphicObject());
// #i122676# Change FillStyle and Bitmap in one call
@@ -584,11 +583,11 @@ void AreaPropertyPanelBase::SelectFillAttrHdl_Impl()
if(LISTBOX_ENTRY_NOTFOUND != nPos && pSh && pSh->GetItem(SID_PATTERN_LIST))
{
- const SvxPatternListItem aItem(*static_cast<const SvxPatternListItem*>(pSh->GetItem(SID_PATTERN_LIST)));
+ const SvxPatternListItem * pItem = pSh->GetItem(SID_PATTERN_LIST);
- if(nPos < aItem.GetPatternList()->Count())
+ if(nPos < pItem->GetPatternList()->Count())
{
- const XBitmapEntry* pXPatternEntry = aItem.GetPatternList()->GetBitmap(nPos);
+ const XBitmapEntry* pXPatternEntry = pItem->GetPatternList()->GetBitmap(nPos);
const XFillBitmapItem aXFillBitmapItem(mpLbFillAttr->GetSelectedEntry(), pXPatternEntry->GetGraphicObject());
// #i122676# Change FillStyle and Bitmap in one call
@@ -1024,11 +1023,10 @@ void AreaPropertyPanelBase::NotifyItemUpdate(
{
const OUString aString( mpFillGradientItem->GetName() );
const SfxObjectShell* pSh = SfxObjectShell::Current();
- const SvxGradientListItem aItem( *static_cast<const SvxGradientListItem*>(pSh->GetItem(SID_GRADIENT_LIST)));
mpLbFillAttr->Clear();
mpLbFillAttr->Enable();
- mpLbFillAttr->Fill(aItem.GetGradientList());
+ mpLbFillAttr->Fill(pSh->GetItem(SID_GRADIENT_LIST)->GetGradientList());
mpLbFillAttr->SelectEntry(aString);
}
else
@@ -1049,11 +1047,10 @@ void AreaPropertyPanelBase::NotifyItemUpdate(
{
const OUString aString( mpHatchItem->GetName() );
const SfxObjectShell* pSh = SfxObjectShell::Current();
- const SvxHatchListItem aItem(*static_cast<const SvxHatchListItem*>(pSh->GetItem(SID_HATCH_LIST)));
mpLbFillAttr->Clear();
mpLbFillAttr->Enable();
- mpLbFillAttr->Fill(aItem.GetHatchList());
+ mpLbFillAttr->Fill(pSh->GetItem(SID_HATCH_LIST)->GetHatchList());
mpLbFillAttr->SelectEntry(aString);
}
else
@@ -1079,14 +1076,11 @@ void AreaPropertyPanelBase::NotifyItemUpdate(
mpLbFillAttr->Show();
if(nSID == SID_BITMAP_LIST)
{
- const SvxBitmapListItem aItem(*static_cast<const SvxBitmapListItem*>(pSh->GetItem(SID_BITMAP_LIST)));
-
- mpLbFillAttr->Fill(aItem.GetBitmapList());
+ mpLbFillAttr->Fill(pSh->GetItem(SID_BITMAP_LIST)->GetBitmapList());
}
else if(nSID == SID_PATTERN_LIST)
{
- const SvxPatternListItem aItem(*static_cast<const SvxPatternListItem*>(pSh->GetItem(SID_PATTERN_LIST)));
- mpLbFillAttr->Fill(aItem.GetPatternList());
+ mpLbFillAttr->Fill(pSh->GetItem(SID_PATTERN_LIST)->GetPatternList());
}
mpLbFillAttr->SelectEntry(aString);
}
@@ -1146,10 +1140,9 @@ void AreaPropertyPanelBase::Update()
if(pSh && pSh->GetItem(SID_GRADIENT_LIST))
{
- const SvxGradientListItem aItem(*static_cast<const SvxGradientListItem*>(pSh->GetItem(SID_GRADIENT_LIST)));
mpLbFillAttr->Enable();
mpLbFillAttr->Clear();
- mpLbFillAttr->Fill(aItem.GetGradientList());
+ mpLbFillAttr->Fill(pSh->GetItem(SID_GRADIENT_LIST)->GetGradientList());
mpLbFillGradTo->SetNoSelection();
mpLbFillGradFrom->SetNoSelection();
if (mpFillGradientItem)
@@ -1189,10 +1182,9 @@ void AreaPropertyPanelBase::Update()
if(pSh && pSh->GetItem(SID_HATCH_LIST))
{
- const SvxHatchListItem aItem(*static_cast<const SvxHatchListItem*>(pSh->GetItem(SID_HATCH_LIST)));
mpLbFillAttr->Enable();
mpLbFillAttr->Clear();
- mpLbFillAttr->Fill(aItem.GetHatchList());
+ mpLbFillAttr->Fill(pSh->GetItem(SID_HATCH_LIST)->GetHatchList());
if(mpHatchItem)
{
@@ -1229,8 +1221,7 @@ void AreaPropertyPanelBase::Update()
{
mpBmpImport->Show();
mpLbFillType->SelectEntryPos(sal_uInt32(BITMAP));
- const SvxBitmapListItem aItem(*static_cast<const SvxBitmapListItem*>(pSh->GetItem(SID_BITMAP_LIST)));
- mpLbFillAttr->Fill(aItem.GetBitmapList());
+ mpLbFillAttr->Fill(pSh->GetItem(SID_BITMAP_LIST)->GetBitmapList());
const OUString aString(mpBitmapItem->GetName());
mpLbFillAttr->SelectEntry(aString);
@@ -1239,8 +1230,7 @@ void AreaPropertyPanelBase::Update()
{
mpBmpImport->Hide();
mpLbFillType->SelectEntryPos(sal_uInt32(PATTERN));
- const SvxPatternListItem aItem(*static_cast<const SvxPatternListItem*>(pSh->GetItem(SID_PATTERN_LIST)));
- mpLbFillAttr->Fill(aItem.GetPatternList());
+ mpLbFillAttr->Fill(pSh->GetItem(SID_PATTERN_LIST)->GetPatternList());
const OUString aString(mpBitmapItem->GetName());
mpLbFillAttr->SelectEntry(aString);
diff --git a/svx/source/sidebar/line/LinePropertyPanelBase.cxx b/svx/source/sidebar/line/LinePropertyPanelBase.cxx
index 715c51696733..2903a8cc0bca 100644
--- a/svx/source/sidebar/line/LinePropertyPanelBase.cxx
+++ b/svx/source/sidebar/line/LinePropertyPanelBase.cxx
@@ -741,8 +741,7 @@ void LinePropertyPanelBase::FillLineEndList()
if ( pSh && pSh->GetItem( SID_LINEEND_LIST ) )
{
mpLBStart->Enable();
- SvxLineEndListItem aItem( *static_cast<const SvxLineEndListItem*>(pSh->GetItem( SID_LINEEND_LIST ) ) );
- mxLineEndList = aItem.GetLineEndList();
+ mxLineEndList = pSh->GetItem( SID_LINEEND_LIST )->GetLineEndList();
if (mxLineEndList.is())
{
@@ -770,8 +769,7 @@ void LinePropertyPanelBase::FillLineStyleList()
if ( pSh && pSh->GetItem( SID_DASH_LIST ) )
{
mpLBStyle->Enable();
- SvxDashListItem aItem( *static_cast<const SvxDashListItem*>(pSh->GetItem( SID_DASH_LIST ) ) );
- mxLineStyleList = aItem.GetDashList();
+ mxLineStyleList = pSh->GetItem( SID_DASH_LIST )->GetDashList();
if (mxLineStyleList.is())
{
diff --git a/svx/source/tbxctrls/fillctrl.cxx b/svx/source/tbxctrls/fillctrl.cxx
index ff85cc43d00c..de2daa040229 100644
--- a/svx/source/tbxctrls/fillctrl.cxx
+++ b/svx/source/tbxctrls/fillctrl.cxx
@@ -250,11 +250,10 @@ void SvxFillToolBoxControl::StateChanged(
{
const OUString aString( mpFillGradientItem->GetName() );
const SfxObjectShell* pSh = SfxObjectShell::Current();
- const SvxGradientListItem aItem( *static_cast<const SvxGradientListItem*>(pSh->GetItem(SID_GRADIENT_LIST)));
mpLbFillAttr->Clear();
mpLbFillAttr->Enable();
- mpLbFillAttr->Fill(aItem.GetGradientList());
+ mpLbFillAttr->Fill(pSh->GetItem(SID_GRADIENT_LIST)->GetGradientList());
mpLbFillAttr->SelectEntry(aString);
}
else
@@ -275,11 +274,10 @@ void SvxFillToolBoxControl::StateChanged(
{
const OUString aString( mpHatchItem->GetName() );
const SfxObjectShell* pSh = SfxObjectShell::Current();
- const SvxHatchListItem aItem(*static_cast<const SvxHatchListItem*>(pSh->GetItem(SID_HATCH_LIST)));
mpLbFillAttr->Clear();
mpLbFillAttr->Enable();
- mpLbFillAttr->Fill(aItem.GetHatchList());
+ mpLbFillAttr->Fill(pSh->GetItem(SID_HATCH_LIST)->GetHatchList());
mpLbFillAttr->SelectEntry(aString);
}
else
@@ -300,11 +298,10 @@ void SvxFillToolBoxControl::StateChanged(
{
const OUString aString( mpBitmapItem->GetName() );
const SfxObjectShell* pSh = SfxObjectShell::Current();
- const SvxBitmapListItem aItem(*static_cast<const SvxBitmapListItem*>(pSh->GetItem(SID_BITMAP_LIST)));
mpLbFillAttr->Clear();
mpLbFillAttr->Enable();
- mpLbFillAttr->Fill(aItem.GetBitmapList());
+ mpLbFillAttr->Fill(pSh->GetItem(SID_BITMAP_LIST)->GetBitmapList());
mpLbFillAttr->SelectEntry(aString);
}
else
@@ -349,10 +346,9 @@ void SvxFillToolBoxControl::Update()
if(pSh && pSh->GetItem(SID_GRADIENT_LIST))
{
- const SvxGradientListItem aItem(*static_cast<const SvxGradientListItem*>(pSh->GetItem(SID_GRADIENT_LIST)));
mpLbFillAttr->Enable();
mpLbFillAttr->Clear();
- mpLbFillAttr->Fill(aItem.GetGradientList());
+ mpLbFillAttr->Fill(pSh->GetItem(SID_GRADIENT_LIST)->GetGradientList());
if(mpFillGradientItem)
{
@@ -408,10 +404,9 @@ void SvxFillToolBoxControl::Update()
if(pSh && pSh->GetItem(SID_HATCH_LIST))
{
- const SvxHatchListItem aItem(*static_cast<const SvxHatchListItem*>(pSh->GetItem(SID_HATCH_LIST)));
mpLbFillAttr->Enable();
mpLbFillAttr->Clear();
- mpLbFillAttr->Fill(aItem.GetHatchList());
+ mpLbFillAttr->Fill(pSh->GetItem(SID_HATCH_LIST)->GetHatchList());
if(mpHatchItem)
{
@@ -467,10 +462,9 @@ void SvxFillToolBoxControl::Update()
if(pSh && pSh->GetItem(SID_BITMAP_LIST))
{
- const SvxBitmapListItem aItem(*static_cast<const SvxBitmapListItem*>(pSh->GetItem(SID_BITMAP_LIST)));
mpLbFillAttr->Enable();
mpLbFillAttr->Clear();
- mpLbFillAttr->Fill(aItem.GetBitmapList());
+ mpLbFillAttr->Fill(pSh->GetItem(SID_BITMAP_LIST)->GetBitmapList());
if(mpBitmapItem)
{
@@ -620,21 +614,20 @@ IMPL_LINK_NOARG(SvxFillToolBoxControl, SelectFillTypeHdl, ListBox&, void)
{
if(!mpLbFillAttr->GetEntryCount())
{
- const SvxGradientListItem aItem(*static_cast<const SvxGradientListItem*>(pSh->GetItem(SID_GRADIENT_LIST)));
mpLbFillAttr->Enable();
mpLbFillAttr->Clear();
- mpLbFillAttr->Fill(aItem.GetGradientList());
+ mpLbFillAttr->Fill(pSh->GetItem(SID_GRADIENT_LIST)->GetGradientList());
}
mpLbFillAttr->AdaptDropDownLineCountToMaximum();
if(LISTBOX_ENTRY_NOTFOUND != mnLastPosGradient)
{
- const SvxGradientListItem aItem(*static_cast<const SvxGradientListItem*>(pSh->GetItem(SID_GRADIENT_LIST)));
+ const SvxGradientListItem * pItem = pSh->GetItem(SID_GRADIENT_LIST);
- if(mnLastPosGradient < aItem.GetGradientList()->Count())
+ if(mnLastPosGradient < pItem->GetGradientList()->Count())
{
- const XGradient aGradient = aItem.GetGradientList()->GetGradient(mnLastPosGradient)->GetGradient();
+ const XGradient aGradient = pItem->GetGradientList()->GetGradient(mnLastPosGradient)->GetGradient();
const XFillGradientItem aXFillGradientItem(mpLbFillAttr->GetEntry(mnLastPosGradient), aGradient);
// #i122676# change FillStyle and Gradient in one call
@@ -660,21 +653,20 @@ IMPL_LINK_NOARG(SvxFillToolBoxControl, SelectFillTypeHdl, ListBox&, void)
{
if(!mpLbFillAttr->GetEntryCount())
{
- const SvxHatchListItem aItem( *static_cast<const SvxHatchListItem*>(pSh->GetItem(SID_HATCH_LIST)));
mpLbFillAttr->Enable();
mpLbFillAttr->Clear();
- mpLbFillAttr->Fill(aItem.GetHatchList());
+ mpLbFillAttr->Fill(pSh->GetItem(SID_HATCH_LIST)->GetHatchList());
}
mpLbFillAttr->AdaptDropDownLineCountToMaximum();
if(LISTBOX_ENTRY_NOTFOUND != mnLastPosHatch)
{
- const SvxHatchListItem aItem(*static_cast<const SvxHatchListItem*>(pSh->GetItem(SID_HATCH_LIST)));
+ const SvxHatchListItem * pItem = pSh->GetItem(SID_HATCH_LIST);
- if(mnLastPosHatch < aItem.GetHatchList()->Count())
+ if(mnLastPosHatch < pItem->GetHatchList()->Count())
{
- const XHatch aHatch = aItem.GetHatchList()->GetHatch(mnLastPosHatch)->GetHatch();
+ const XHatch aHatch = pItem->GetHatchList()->GetHatch(mnLastPosHatch)->GetHatch();
const XFillHatchItem aXFillHatchItem(mpLbFillAttr->GetSelectedEntry(), aHatch);
// #i122676# change FillStyle and Hatch in one call
@@ -700,21 +692,20 @@ IMPL_LINK_NOARG(SvxFillToolBoxControl, SelectFillTypeHdl, ListBox&, void)
{
if(!mpLbFillAttr->GetEntryCount())
{
- const SvxBitmapListItem aItem( *static_cast<const SvxBitmapListItem*>(pSh->GetItem(SID_BITMAP_LIST)));
mpLbFillAttr->Enable();
mpLbFillAttr->Clear();
- mpLbFillAttr->Fill(aItem.GetBitmapList());
+ mpLbFillAttr->Fill(pSh->GetItem(SID_BITMAP_LIST)->GetBitmapList());
}
mpLbFillAttr->AdaptDropDownLineCountToMaximum();
if(LISTBOX_ENTRY_NOTFOUND != mnLastPosBitmap)
{
- const SvxBitmapListItem aItem(*static_cast<const SvxBitmapListItem*>(pSh->GetItem(SID_BITMAP_LIST)));
+ const SvxBitmapListItem * pItem = pSh->GetItem(SID_BITMAP_LIST);
- if(mnLastPosBitmap < aItem.GetBitmapList()->Count())
+ if(mnLastPosBitmap < pItem->GetBitmapList()->Count())
{
- const XBitmapEntry* pXBitmapEntry = aItem.GetBitmapList()->GetBitmap(mnLastPosBitmap);
+ const XBitmapEntry* pXBitmapEntry = pItem->GetBitmapList()->GetBitmap(mnLastPosBitmap);
const XFillBitmapItem aXFillBitmapItem(mpLbFillAttr->GetSelectedEntry(), pXBitmapEntry->GetGraphicObject());
// #i122676# change FillStyle and Bitmap in one call
@@ -776,11 +767,11 @@ IMPL_LINK_NOARG(SvxFillToolBoxControl, SelectFillAttrHdl, ListBox&, void)
if(LISTBOX_ENTRY_NOTFOUND != nPos && pSh && pSh->GetItem(SID_GRADIENT_LIST))
{
- const SvxGradientListItem aItem(*static_cast<const SvxGradientListItem*>(pSh->GetItem(SID_GRADIENT_LIST)));
+ const SvxGradientListItem * pItem = pSh->GetItem(SID_GRADIENT_LIST);
- if(nPos < aItem.GetGradientList()->Count())
+ if(nPos < pItem->GetGradientList()->Count())
{
- const XGradient aGradient = aItem.GetGradientList()->GetGradient(nPos)->GetGradient();
+ const XGradient aGradient = pItem->GetGradientList()->GetGradient(nPos)->GetGradient();
const XFillGradientItem aXFillGradientItem(mpLbFillAttr->GetSelectedEntry(), aGradient);
// #i122676# Change FillStyle and Gradinet in one call
@@ -809,11 +800,11 @@ IMPL_LINK_NOARG(SvxFillToolBoxControl, SelectFillAttrHdl, ListBox&, void)
if(LISTBOX_ENTRY_NOTFOUND != nPos && pSh && pSh->GetItem(SID_HATCH_LIST))
{
- const SvxHatchListItem aItem(*static_cast<const SvxHatchListItem*>(pSh->GetItem(SID_HATCH_LIST)));
+ const SvxHatchListItem * pItem = pSh->GetItem(SID_HATCH_LIST);
- if(nPos < aItem.GetHatchList()->Count())
+ if(nPos < pItem->GetHatchList()->Count())
{
- const XHatch aHatch = aItem.GetHatchList()->GetHatch(nPos)->GetHatch();
+ const XHatch aHatch = pItem->GetHatchList()->GetHatch(nPos)->GetHatch();
const XFillHatchItem aXFillHatchItem( mpLbFillAttr->GetSelectedEntry(), aHatch);
// #i122676# Change FillStyle and Hatch in one call
@@ -842,11 +833,11 @@ IMPL_LINK_NOARG(SvxFillToolBoxControl, SelectFillAttrHdl, ListBox&, void)
if(LISTBOX_ENTRY_NOTFOUND != nPos && pSh && pSh->GetItem(SID_BITMAP_LIST))
{
- const SvxBitmapListItem aItem(*static_cast<const SvxBitmapListItem*>(pSh->GetItem(SID_BITMAP_LIST)));
+ const SvxBitmapListItem * pItem = pSh->GetItem(SID_BITMAP_LIST);
- if(nPos < aItem.GetBitmapList()->Count())
+ if(nPos < pItem->GetBitmapList()->Count())
{
- const XBitmapEntry* pXBitmapEntry = aItem.GetBitmapList()->GetBitmap(nPos);
+ const XBitmapEntry* pXBitmapEntry = pItem->GetBitmapList()->GetBitmap(nPos);
const XFillBitmapItem aXFillBitmapItem(mpLbFillAttr->GetSelectedEntry(), pXBitmapEntry->GetGraphicObject());
// #i122676# Change FillStyle and Bitmap in one call
diff --git a/svx/source/tbxctrls/itemwin.cxx b/svx/source/tbxctrls/itemwin.cxx
index a61343f98329..9c14f76826a9 100644
--- a/svx/source/tbxctrls/itemwin.cxx
+++ b/svx/source/tbxctrls/itemwin.cxx
@@ -110,10 +110,9 @@ void SvxLineBox::Select()
{
// LineDashItem will only be sent if it also has a dash.
// Notify cares!
- SvxDashListItem aItem( *static_cast<const SvxDashListItem*>(
- SfxObjectShell::Current()->GetItem( SID_DASH_LIST ) ) );
+ SvxDashListItem const * pItem = SfxObjectShell::Current()->GetItem( SID_DASH_LIST );
XLineDashItem aLineDashItem( GetSelectedEntry(),
- aItem.GetDashList()->GetDash( nPos - 2 )->GetDash() );
+ pItem->GetDashList()->GetDash( nPos - 2 )->GetDash() );
Any a;
Sequence< PropertyValue > aArgs( 1 );
@@ -235,7 +234,7 @@ void SvxLineBox::FillControl()
if( mpSh )
{
- const SvxDashListItem* pItem = static_cast<const SvxDashListItem*>( mpSh->GetItem( SID_DASH_LIST ) );
+ const SvxDashListItem* pItem = mpSh->GetItem( SID_DASH_LIST );
if ( pItem )
Fill( pItem->GetDashList() );
}