[Libreoffice-commits] core.git: 2 commits - officecfg/registry sc/sdi sc/source sc/uiconfig sc/UIConfig_scalc.mk sd/sdi sd/source sd/uiconfig sd/UIConfig_simpress.mk

Miklos Vajna vmiklos at collabora.co.uk
Thu Mar 3 12:46:10 UTC 2016


 officecfg/registry/data/org/openoffice/Office/UI/CalcWindowState.xcu    |   17 +++++++
 officecfg/registry/data/org/openoffice/Office/UI/ImpressWindowState.xcu |   17 +++++++
 sc/UIConfig_scalc.mk                                                    |    1 
 sc/sdi/formatsh.sdi                                                     |    1 
 sc/source/ui/view/formatsh.cxx                                          |   13 +++++
 sc/uiconfig/scalc/toolbar/classificationbar.xml                         |   12 +++++
 sd/UIConfig_simpress.mk                                                 |    1 
 sd/sdi/_drvwsh.sdi                                                      |    4 +
 sd/source/ui/view/drviews2.cxx                                          |   24 ++++++++++
 sd/uiconfig/simpress/toolbar/classificationbar.xml                      |   12 +++++
 10 files changed, 102 insertions(+)

New commits:
commit e4fe540aa4f77a4d76e4c6042d5790211aebc450
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Thu Mar 3 12:18:59 2016 +0100

    sc: add classification toolbar
    
    Again this is just UI to call into sfx2, where the functionality is
    shared with Writer and Impress.
    
    Change-Id: I73ce6fb54d50c23df19ed2c610766b7c515e94d6

diff --git a/officecfg/registry/data/org/openoffice/Office/UI/CalcWindowState.xcu b/officecfg/registry/data/org/openoffice/Office/UI/CalcWindowState.xcu
index a89f8a5..4a8cbb7 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/CalcWindowState.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/CalcWindowState.xcu
@@ -133,6 +133,23 @@
           <value>true</value>
         </prop>
       </node>
+      <node oor:name="private:resource/toolbar/classificationbar" oor:op="replace">
+        <prop oor:name="DockPos" oor:type="xs:string">
+          <value>0,3</value>
+        </prop>
+        <prop oor:name="DockingArea" oor:type="xs:int">
+          <value>0</value>
+        </prop>
+        <prop oor:name="Docked" oor:type="xs:boolean">
+          <value>true</value>
+        </prop>
+        <prop oor:name="Visible" oor:type="xs:boolean">
+          <value>false</value>
+        </prop>
+        <prop oor:name="UIName" oor:type="xs:string">
+          <value xml:lang="en-US">Classification</value>
+        </prop>
+      </node>
       <node oor:name="private:resource/toolbar/graphicobjectbar" oor:op="replace">
         <prop oor:name="DockPos" oor:type="xs:string">
           <value>0,2</value>
diff --git a/sc/UIConfig_scalc.mk b/sc/UIConfig_scalc.mk
index 0594195..74cb375 100644
--- a/sc/UIConfig_scalc.mk
+++ b/sc/UIConfig_scalc.mk
@@ -50,6 +50,7 @@ $(eval $(call gb_UIConfig_add_toolbarfiles,modules/scalc,\
 	sc/uiconfig/scalc/toolbar/arrowshapes \
 	sc/uiconfig/scalc/toolbar/basicshapes \
 	sc/uiconfig/scalc/toolbar/calloutshapes \
+	sc/uiconfig/scalc/toolbar/classificationbar \
 	sc/uiconfig/scalc/toolbar/colorbar \
 	sc/uiconfig/scalc/toolbar/datastreams \
 	sc/uiconfig/scalc/toolbar/drawbar \
diff --git a/sc/sdi/formatsh.sdi b/sc/sdi/formatsh.sdi
index 2c90f60..740e002 100644
--- a/sc/sdi/formatsh.sdi
+++ b/sc/sdi/formatsh.sdi
@@ -56,6 +56,7 @@ interface FormatForSelection
     SID_STYLE_SHOW              [ ExecMethod = ExecuteStyle; StateMethod = GetStyleState; ]
     SID_STYLE_PREVIEW           [ ExecMethod = ExecuteStyle; ]
     SID_STYLE_END_PREVIEW           [ ExecMethod = ExecuteStyle; ]
+    SID_CLASSIFICATION_APPLY [ ExecMethod = ExecuteStyle; ]
     // } Slot's die in der DrawShell disabled werden.
 
     SID_ATTR_ALIGN_HOR_JUSTIFY    [ ExecMethod = ExecuteAlignment; StateMethod = GetAttrState; ]
diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index c7d4097..8d7440b 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -81,6 +81,7 @@
 
 #include "scabstdlg.hxx"
 #include <editeng/fontitem.hxx>
+#include <sfx2/classificationhelper.hxx>
 
 #include <memory>
 
@@ -967,6 +968,18 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq )
         if ( bListAction )
             pDocSh->GetUndoManager()->LeaveListAction();
     }
+    else if (nSlotId == SID_CLASSIFICATION_APPLY)
+    {
+        const SfxPoolItem* pItem = 0;
+        if (pArgs && pArgs->GetItemState(nSlotId, false, &pItem) == SfxItemState::SET)
+        {
+            const OUString& rName = static_cast<const SfxStringItem*>(pItem)->GetValue();
+            SfxClassificationHelper aHelper(*pDocSh);
+            aHelper.SetBACName(rName);
+        }
+        else
+            SAL_WARN("sc.ui", "missing parameter for SID_CLASSIFICATION_APPLY");
+    }
     else
     {
         OSL_FAIL( "Unknown slot (ScViewShell::ExecuteStyle)" );
diff --git a/sc/uiconfig/scalc/toolbar/classificationbar.xml b/sc/uiconfig/scalc/toolbar/classificationbar.xml
new file mode 100644
index 0000000..3ee3407
--- /dev/null
+++ b/sc/uiconfig/scalc/toolbar/classificationbar.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE toolbar:toolbar PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "toolbar.dtd">
+<!--
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+-->
+<toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink" toolbar:id="toolbar">
+  <toolbar:toolbaritem xlink:href=".uno:ClassificationApply"/>
+</toolbar:toolbar>
commit a56ba98ec5e287f872d957493f9e81ee27a24c00
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Thu Mar 3 11:05:07 2016 +0100

    sd: add classification toolbar
    
    This is really just a UI, all the functionality is already shared in
    sfx2 with Writer.
    
    Change-Id: Ide5697fe51d30f74490306a70164a3957a8a6429

diff --git a/officecfg/registry/data/org/openoffice/Office/UI/ImpressWindowState.xcu b/officecfg/registry/data/org/openoffice/Office/UI/ImpressWindowState.xcu
index f67882d..2ad7488 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/ImpressWindowState.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/ImpressWindowState.xcu
@@ -410,6 +410,23 @@
           <value>true</value>
         </prop>
       </node>
+      <node oor:name="private:resource/toolbar/classificationbar" oor:op="replace">
+        <prop oor:name="DockPos" oor:type="xs:string">
+          <value>0,2</value>
+        </prop>
+        <prop oor:name="DockingArea" oor:type="xs:int">
+          <value>0</value>
+        </prop>
+        <prop oor:name="Docked" oor:type="xs:boolean">
+          <value>true</value>
+        </prop>
+        <prop oor:name="Visible" oor:type="xs:boolean">
+          <value>false</value>
+        </prop>
+        <prop oor:name="UIName" oor:type="xs:string">
+          <value xml:lang="en-US">Classification</value>
+        </prop>
+      </node>
       <node oor:name="private:resource/toolbar/basicshapes" oor:op="replace">
         <prop oor:name="Docked" oor:type="xs:boolean">
           <value>false</value>
diff --git a/sd/UIConfig_simpress.mk b/sd/UIConfig_simpress.mk
index b880ca7..531175a 100644
--- a/sd/UIConfig_simpress.mk
+++ b/sd/UIConfig_simpress.mk
@@ -58,6 +58,7 @@ $(eval $(call gb_UIConfig_add_toolbarfiles,modules/simpress,\
 	sd/uiconfig/simpress/toolbar/bezierobjectbar \
 	sd/uiconfig/simpress/toolbar/calloutshapes \
 	sd/uiconfig/simpress/toolbar/choosemodebar \
+	sd/uiconfig/simpress/toolbar/classificationbar \
 	sd/uiconfig/simpress/toolbar/colorbar \
 	sd/uiconfig/simpress/toolbar/commentsbar \
 	sd/uiconfig/simpress/toolbar/commontaskbar \
diff --git a/sd/sdi/_drvwsh.sdi b/sd/sdi/_drvwsh.sdi
index dee3df2..c8b3d53 100644
--- a/sd/sdi/_drvwsh.sdi
+++ b/sd/sdi/_drvwsh.sdi
@@ -2746,5 +2746,9 @@ interface DrawView
         ExecMethod = ExecGoToLastPage ;
         StateMethod = GetStateGoToLastPage ;
     ]
+    SID_CLASSIFICATION_APPLY
+    [
+        ExecMethod = FuTemporary ;
+    ]
 
 }
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index 3ee00b3..bf7ecd0 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -170,6 +170,7 @@
 #include "undolayer.hxx"
 #include "unmodpg.hxx"
 #include <sfx2/sidebar/Sidebar.hxx>
+#include <sfx2/classificationhelper.hxx>
 
 #include "ViewShellBase.hxx"
 #include <memory>
@@ -1141,6 +1142,29 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
         }
         break;
 #endif
+        case SID_CLASSIFICATION_APPLY:
+        {
+            const SfxItemSet* pArgs = rReq.GetArgs();
+            const SfxPoolItem* pItem = 0;
+            if (pArgs && pArgs->GetItemState(nSId, false, &pItem) == SfxItemState::SET)
+            {
+                const OUString& rName = static_cast<const SfxStringItem*>(pItem)->GetValue();
+                if (SfxViewFrame* pViewFrame = GetViewFrame())
+                {
+                    if (SfxObjectShell* pObjectShell = pViewFrame->GetObjectShell())
+                    {
+                        SfxClassificationHelper aHelper(*pObjectShell);
+                        aHelper.SetBACName(rName);
+                    }
+                }
+            }
+            else
+                SAL_WARN("sd.ui", "missing parameter for SID_CLASSIFICATION_APPLY");
+
+            Cancel();
+            rReq.Ignore();
+        }
+        break;
 
         case SID_COPYOBJECTS:
         {
diff --git a/sd/uiconfig/simpress/toolbar/classificationbar.xml b/sd/uiconfig/simpress/toolbar/classificationbar.xml
new file mode 100644
index 0000000..3ee3407
--- /dev/null
+++ b/sd/uiconfig/simpress/toolbar/classificationbar.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE toolbar:toolbar PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "toolbar.dtd">
+<!--
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+-->
+<toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink" toolbar:id="toolbar">
+  <toolbar:toolbaritem xlink:href=".uno:ClassificationApply"/>
+</toolbar:toolbar>


More information about the Libreoffice-commits mailing list