summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2016-08-31 23:36:19 +0200
committerMichael Stahl <mstahl@redhat.com>2016-08-31 23:45:58 +0200
commit75c39b903f06b656293edf20ec4a5173a0755fb6 (patch)
treefa9972a4f9e3553fda5307c4fe1d1f0807f46237 /sd
parentfa8db4cb890ffbbd20790eff2e295dfbc048b7b4 (diff)
let's make Impress crash less - SfxStyleFamily edition
Commit bcb41235deaf4b7ca90522bda3ba21a686819e6e - in addition to introducing the enum SfxStyleFamily - inconsistently converted one call of DrawDocShell::SetStyleFamily to use enum SfxStyleFamily instead of a mysterious "5", but did not adapt all of the code that extracts the SfxUInt16Item that subsequently extracts this value and expects a number 0-5. Since it's clearly inexcusably stupid to have 2 different public sets of integers identifying styles, make the usage of the second "array index" integers private to templdlg.cxx; the SfxUInt16 item now always contains enum SfxStyleFamily. (regression from bcb41235deaf4b7ca90522bda3ba21a686819e6e) Change-Id: I333575c504277c2046f8f5a6b36ae3f86b3b3201
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/view/drviewsf.cxx10
-rw-r--r--sd/source/ui/view/outlnvsh.cxx2
-rw-r--r--sd/source/ui/view/viewshe3.cxx4
3 files changed, 8 insertions, 8 deletions
diff --git a/sd/source/ui/view/drviewsf.cxx b/sd/source/ui/view/drviewsf.cxx
index e75001f347ba..12f7ac8b4403 100644
--- a/sd/source/ui/view/drviewsf.cxx
+++ b/sd/source/ui/view/drviewsf.cxx
@@ -491,7 +491,7 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet )
std::unique_ptr<SfxPoolItem> pItem;
GetViewFrame()->GetBindings().QueryState(SID_STYLE_FAMILY, pItem);
SfxUInt16Item* pFamilyItem = dynamic_cast<SfxUInt16Item*>(pItem.get());
- if (pFamilyItem && SfxTemplate::NIdToSfxFamilyId(pFamilyItem->GetValue()) == SD_STYLE_FAMILY_PSEUDO)
+ if (pFamilyItem && static_cast<SfxStyleFamily>(pFamilyItem->GetValue()) == SD_STYLE_FAMILY_PSEUDO)
rSet.Put(SfxBoolItem(nWhich,false));
else
{
@@ -506,7 +506,7 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet )
std::unique_ptr<SfxPoolItem> pItem;
GetViewFrame()->GetBindings().QueryState(SID_STYLE_FAMILY, pItem);
SfxUInt16Item* pFamilyItem = dynamic_cast<SfxUInt16Item*>(pItem.get());
- if (pFamilyItem && SfxTemplate::NIdToSfxFamilyId(pFamilyItem->GetValue()) == SD_STYLE_FAMILY_PSEUDO)
+ if (pFamilyItem && static_cast<SfxStyleFamily>(pFamilyItem->GetValue()) == SD_STYLE_FAMILY_PSEUDO)
{
rSet.DisableItem(nWhich);
}
@@ -518,7 +518,7 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet )
std::unique_ptr<SfxPoolItem> pItem;
GetViewFrame()->GetBindings().QueryState(SID_STYLE_FAMILY, pItem);
SfxUInt16Item* pFamilyItem = dynamic_cast<SfxUInt16Item*>(pItem.get());
- if (pFamilyItem && SfxTemplate::NIdToSfxFamilyId(pFamilyItem->GetValue()) == SD_STYLE_FAMILY_PSEUDO)
+ if (pFamilyItem && static_cast<SfxStyleFamily>(pFamilyItem->GetValue()) == SD_STYLE_FAMILY_PSEUDO)
rSet.DisableItem(nWhich);
}
break;
@@ -533,11 +533,11 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet )
SfxUInt16Item* pFamilyItem = dynamic_cast<SfxUInt16Item*>(pItem.get());
if (pFamilyItem)
{
- if (SfxTemplate::NIdToSfxFamilyId(pFamilyItem->GetValue()) == SD_STYLE_FAMILY_PSEUDO)
+ if (static_cast<SfxStyleFamily>(pFamilyItem->GetValue()) == SD_STYLE_FAMILY_PSEUDO)
{
rSet.DisableItem(nWhich);
}
- else if (SfxTemplate::NIdToSfxFamilyId(pFamilyItem->GetValue()) == SD_STYLE_FAMILY_GRAPHICS)
+ else if (static_cast<SfxStyleFamily>(pFamilyItem->GetValue()) == SD_STYLE_FAMILY_GRAPHICS)
{
if (!mpDrawView->AreObjectsMarked())
{
diff --git a/sd/source/ui/view/outlnvsh.cxx b/sd/source/ui/view/outlnvsh.cxx
index 7da4bd9c1061..647e538e5a41 100644
--- a/sd/source/ui/view/outlnvsh.cxx
+++ b/sd/source/ui/view/outlnvsh.cxx
@@ -1475,7 +1475,7 @@ void OutlineViewShell::GetAttrState( SfxItemSet& rSet )
std::unique_ptr<SfxPoolItem> pItem;
GetViewFrame()->GetBindings().QueryState(SID_STYLE_FAMILY, pItem);
SfxUInt16Item* pFamilyItem = dynamic_cast<SfxUInt16Item*>(pItem.get());
- if (pFamilyItem && SfxTemplate::NIdToSfxFamilyId(pFamilyItem->GetValue()) == SD_STYLE_FAMILY_PSEUDO)
+ if (pFamilyItem && static_cast<SfxStyleFamily>(pFamilyItem->GetValue()) == SD_STYLE_FAMILY_PSEUDO)
{
SfxItemSet aSet(*rSet.GetPool(), SID_STATUS_LAYOUT, SID_STATUS_LAYOUT);
GetStatusBarState(aSet);
diff --git a/sd/source/ui/view/viewshe3.cxx b/sd/source/ui/view/viewshe3.cxx
index dbf6037a3165..8368cf74969a 100644
--- a/sd/source/ui/view/viewshe3.cxx
+++ b/sd/source/ui/view/viewshe3.cxx
@@ -90,7 +90,7 @@ void ViewShell::GetMenuState( SfxItemSet &rSet )
{
if( SfxItemState::DEFAULT == rSet.GetItemState( SID_STYLE_FAMILY ) )
{
- sal_uInt16 nFamily = (sal_uInt16)GetDocSh()->GetStyleFamily();
+ SfxStyleFamily const nFamily = GetDocSh()->GetStyleFamily();
SdrView* pDrView = GetDrawView();
@@ -109,7 +109,7 @@ void ViewShell::GetMenuState( SfxItemSet &rSet )
}
}
- rSet.Put(SfxUInt16Item(SID_STYLE_FAMILY, nFamily ));
+ rSet.Put(SfxUInt16Item(SID_STYLE_FAMILY, static_cast<sal_uInt16>(nFamily)));
}
if(SfxItemState::DEFAULT == rSet.GetItemState(SID_GETUNDOSTRINGS))