diff options
-rw-r--r-- | sfx2/source/view/classificationcontroller.cxx | 17 | ||||
-rw-r--r-- | sw/sdi/_basesh.sdi | 1 | ||||
-rw-r--r-- | sw/source/uibase/app/docst.cxx | 4 |
3 files changed, 15 insertions, 7 deletions
diff --git a/sfx2/source/view/classificationcontroller.cxx b/sfx2/source/view/classificationcontroller.cxx index b05431c7ce4d..fa54a9b86fbe 100644 --- a/sfx2/source/view/classificationcontroller.cxx +++ b/sfx2/source/view/classificationcontroller.cxx @@ -122,7 +122,7 @@ IMPL_LINK_NOARG_TYPED(ClassificationCategoriesController, SelectHdl, ListBox&, v void ClassificationCategoriesController::statusChanged(const frame::FeatureStateEvent& /*rEvent*/) throw (uno::RuntimeException, std::exception) { - if (!m_pCategories || m_pCategories->GetEntryCount() > 0) + if (!m_pCategories) return; SfxObjectShell* pObjectShell = SfxObjectShell::Current(); @@ -130,12 +130,15 @@ void ClassificationCategoriesController::statusChanged(const frame::FeatureState return; SfxClassificationHelper aHelper(*pObjectShell); - std::vector<OUString> aNames = aHelper.GetBACNames(); - for (const OUString& rName : aNames) - m_pCategories->InsertEntry(rName); - // Normally VclBuilder::makeObject() does this. - m_pCategories->EnableAutoSize(true); - m_pCategories->SetSizePixel(m_pCategories->GetOptimalSize()); + if (m_pCategories->GetEntryCount() == 0) + { + std::vector<OUString> aNames = aHelper.GetBACNames(); + for (const OUString& rName : aNames) + m_pCategories->InsertEntry(rName); + // Normally VclBuilder::makeObject() does this. + m_pCategories->EnableAutoSize(true); + m_pCategories->SetSizePixel(m_pCategories->GetOptimalSize()); + } // Restore state based on the doc. model. const OUString& rCategoryName = aHelper.GetBACName(); diff --git a/sw/sdi/_basesh.sdi b/sw/sdi/_basesh.sdi index 22a5c133ad68..87de4941bc8e 100644 --- a/sw/sdi/_basesh.sdi +++ b/sw/sdi/_basesh.sdi @@ -364,6 +364,7 @@ interface BaseTextSelection SID_CLASSIFICATION_APPLY [ ExecMethod = Execute ; + StateMethod = StateStyle ; ] //OS: Selection.Escape gibt es zusaetzlich zu Window.Escape diff --git a/sw/source/uibase/app/docst.cxx b/sw/source/uibase/app/docst.cxx index cdd704ef0b27..c6680785c650 100644 --- a/sw/source/uibase/app/docst.cxx +++ b/sw/source/uibase/app/docst.cxx @@ -256,6 +256,10 @@ void SwDocShell::StateStyleSheet(SfxItemSet& rSet, SwWrtShell* pSh) } break; + case SID_CLASSIFICATION_APPLY: + // Just trigger ClassificationCategoriesController::statusChanged(). + rSet.InvalidateItem(nWhich); + break; default: OSL_FAIL("Invalid SlotId"); } |