diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-05-29 11:16:47 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-05-30 11:55:34 +0100 |
commit | 3988f17d14ee28b4bb117ca9961708ad3a867fb1 (patch) | |
tree | e5d2acf8488814ad837cc63929a448994df678a3 /sw | |
parent | 6e6e03c9b7d591802c485acc5eb979c0e3ba5610 (diff) |
Resolves: fdo#79360 impress hangs on using sidebar new style
because those styles are "pseudo-styles" and a new one cannot be
added. The possibility is supposed to be disabled, and it is
disabled in the floating stylelist. The old code assumes there
can only be one of these stylelists and when a stylelist
queries if the "new" should be disabled the callback asks
the stylelist what family is selected, but only asks the floating one.
So, floating closed, sidebar open, the new is not disabled.
Implement the ancient TODO now that we have to. Instead of asking
the stylelist what family is selected, query the frame for what
is the current SID_STYLE_FAMILY as set by whatever is the active
stylelist.
What's disturbing is the SID_STYLE_FAMILY values are not SfxStyleFamily, but
indexes that have to be mapped to SfxStyleFamily. I bet there are a pile of
bugs around that, especially with little islands of different conversion
codesites
(cherry picked from commit 7a211e834fc271d3f28d7f8c49197c925242d862)
Conflicts:
sfx2/source/appl/appmisc.cxx
convert from NId to FamilyId instead of FamilyId to NId
should be equivalent for comparison purposes
(cherry picked from commit f48f5138ecedd3bb9ec0b454b9fe216001610156)
remove unused virtual method, slim this down initially
(cherry picked from commit fa551c422426962194b6bff4234f12eb5bdf57ca)
Change-Id: I85c8032d7c26ae6eea245685748f89b2a860e767
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/uibase/app/docst.cxx | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/sw/source/core/uibase/app/docst.cxx b/sw/source/core/uibase/app/docst.cxx index 75e38c6c1c49..dc5af5c35665 100644 --- a/sw/source/core/uibase/app/docst.cxx +++ b/sw/source/core/uibase/app/docst.cxx @@ -100,9 +100,14 @@ void SwDocShell::StateStyleSheet(SfxItemSet& rSet, SwWrtShell* pSh) else { SfxViewFrame* pFrame = pShell->GetView().GetViewFrame(); - const ISfxTemplateCommon* pCommon = SFX_APP()->GetCurrentTemplateCommon(pFrame->GetBindings()); - if( pCommon ) - nActualFamily = static_cast< sal_uInt16 >(pCommon->GetActualFamily()); + SfxPoolItem* pItem = NULL; + pFrame->GetBindings().QueryState(SID_STYLE_FAMILY, pItem); + SfxUInt16Item* pFamilyItem = dynamic_cast<SfxUInt16Item*>(pItem); + if (pFamilyItem) + { + nActualFamily = static_cast<sal_uInt16>(SfxTemplateDialog::NIdToSfxFamilyId(pFamilyItem->GetValue())); + } + delete pItem; } while (nWhich) |