diff options
author | Michael Stahl <mstahl@redhat.com> | 2016-08-31 23:36:19 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2016-08-31 23:45:58 +0200 |
commit | 75c39b903f06b656293edf20ec4a5173a0755fb6 (patch) | |
tree | fa9972a4f9e3553fda5307c4fe1d1f0807f46237 /sc | |
parent | fa8db4cb890ffbbd20790eff2e295dfbc048b7b4 (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 'sc')
-rw-r--r-- | sc/source/ui/view/formatsh.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx index 569b04f9f96a..2fcce12b0741 100644 --- a/sc/source/ui/view/formatsh.cxx +++ b/sc/source/ui/view/formatsh.cxx @@ -217,7 +217,7 @@ void ScFormatShell::GetStyleState( SfxItemSet& rSet ) pTabViewShell->GetViewFrame()->GetBindings().QueryState(SID_STYLE_FAMILY, pItem); SfxUInt16Item* pFamilyItem = dynamic_cast<SfxUInt16Item*>(pItem.get()); - bool bPage = pFamilyItem && SfxStyleFamily::Page == SfxTemplate::NIdToSfxFamilyId(pFamilyItem->GetValue()); + bool bPage = pFamilyItem && SfxStyleFamily::Page == static_cast<SfxStyleFamily>(pFamilyItem->GetValue()); if ( bProtected || bPage ) rSet.DisableItem( nSlotId ); @@ -232,7 +232,7 @@ void ScFormatShell::GetStyleState( SfxItemSet& rSet ) std::unique_ptr<SfxPoolItem> pItem; pTabViewShell->GetViewFrame()->GetBindings().QueryState(SID_STYLE_FAMILY, pItem); SfxUInt16Item* pFamilyItem = dynamic_cast<SfxUInt16Item*>(pItem.get()); - bool bPage = pFamilyItem && SfxStyleFamily::Page == SfxTemplate::NIdToSfxFamilyId(pFamilyItem->GetValue()); + bool bPage = pFamilyItem && SfxStyleFamily::Page == static_cast<SfxStyleFamily>(pFamilyItem->GetValue()); if ( bProtected && !bPage ) rSet.DisableItem( nSlotId ); |