[Libreoffice-commits] core.git: 2 commits - officecfg/registry sfx2/source sw/sdi sw/source
Miklos Vajna
vmiklos at collabora.co.uk
Tue Mar 1 14:41:31 UTC 2016
officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu | 5 ++
sfx2/source/view/classificationcontroller.cxx | 17 +++++-----
sw/sdi/_basesh.sdi | 1
sw/source/uibase/app/docst.cxx | 4 ++
4 files changed, 20 insertions(+), 7 deletions(-)
New commits:
commit 58a22dc030460e7164663ef84acd01f7a993af28
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Tue Mar 1 15:19:27 2016 +0100
officecfg: add .uno:ClassificationApply tooltip
Change-Id: I03d3cff3365e7ffb6a1218398cb0a6b3de1ce3be
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
index 1dcf8b8a..b9fd7a4 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
@@ -6015,6 +6015,11 @@
<value xml:lang="en-US">3D Model...</value>
</prop>
</node>
+ <node oor:name=".uno:ClassificationApply" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Apply Document Classification</value>
+ </prop>
+ </node>
</node>
</node>
</oor:component-data>
commit e0e6d8a5827ce1cbc73caeab10c2e7ba9e66035b
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Tue Mar 1 14:58:46 2016 +0100
sfx2 classification: select current toolbar listbox entry when state changes
With this, if .uno:ClassificationApply is invoked from e.g. a macro, the
toolbar listbox is updated to reflect the classification of the
document. Previously the listbox wasn't updated.
Change-Id: I45a7c6ee2f3b06e048fa119264c615e78bc46b37
diff --git a/sfx2/source/view/classificationcontroller.cxx b/sfx2/source/view/classificationcontroller.cxx
index b05431c..fa54a9b 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 22a5c13..87de494 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 cdd704e..c668078 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");
}
More information about the Libreoffice-commits
mailing list