[Libreoffice-commits] core.git: sd/source sd/uiconfig sd/UIConfig_simpress.mk

Caolán McNamara caolanm at redhat.com
Thu Apr 13 13:01:25 UTC 2017


 sd/UIConfig_simpress.mk                           |    1 
 sd/source/ui/animations/CustomAnimation.hrc       |    1 
 sd/source/ui/animations/CustomAnimation.src       |   27 --------------
 sd/source/ui/animations/CustomAnimationDialog.cxx |   21 ++++-------
 sd/uiconfig/simpress/ui/fontsizemenu.ui           |   41 ++++++++++++++++++++++
 5 files changed, 51 insertions(+), 40 deletions(-)

New commits:
commit 3f2b80579831e400a4a454ce8b2677fb1e08dfb3
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Apr 13 13:59:13 2017 +0100

    convert font size popup to .ui
    
    Change-Id: I1b1b08c3d2a3e628cce1055e0e5cdbda1549b6cc

diff --git a/sd/UIConfig_simpress.mk b/sd/UIConfig_simpress.mk
index 9561e5c5518f..60d250604268 100644
--- a/sd/UIConfig_simpress.mk
+++ b/sd/UIConfig_simpress.mk
@@ -118,6 +118,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/simpress,\
 	sd/uiconfig/simpress/ui/dlgfield \
 	sd/uiconfig/simpress/ui/dockinganimation \
 	sd/uiconfig/simpress/ui/effectmenu \
+	sd/uiconfig/simpress/ui/fontsizemenu \
 	sd/uiconfig/simpress/ui/headerfooterdialog \
 	sd/uiconfig/simpress/ui/headerfootertab \
 	sd/uiconfig/simpress/ui/insertslides \
diff --git a/sd/source/ui/animations/CustomAnimation.hrc b/sd/source/ui/animations/CustomAnimation.hrc
index 9124b4386eb1..0f0a69bdf8d7 100644
--- a/sd/source/ui/animations/CustomAnimation.hrc
+++ b/sd/source/ui/animations/CustomAnimation.hrc
@@ -27,7 +27,6 @@
 // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
 #define RID_CUSTOMANIMATION_ROTATION_POPUP              RID_CUSTOMANIMATION_START+9
-#define RID_CUSTOMANIMATION_FONTSIZE_POPUP              RID_CUSTOMANIMATION_START+10
 #define RID_CUSTOMANIMATION_SCALE_POPUP                 RID_CUSTOMANIMATION_START+11
 #define RID_CUSTOMANIMATION_FONTSTYLE_POPUP             RID_CUSTOMANIMATION_START+12
 
diff --git a/sd/source/ui/animations/CustomAnimation.src b/sd/source/ui/animations/CustomAnimation.src
index 34eedb138aad..ae5fe4267a6c 100644
--- a/sd/source/ui/animations/CustomAnimation.src
+++ b/sd/source/ui/animations/CustomAnimation.src
@@ -19,33 +19,6 @@
 
 #include "CustomAnimation.hrc"
 
-Menu RID_CUSTOMANIMATION_FONTSIZE_POPUP
-{
-    ItemList =
-    {
-        MenuItem
-        {
-            Identifier = CM_SIZE_25 ;
-            Text [ en-US ] = "Tiny" ;
-        };
-        MenuItem
-        {
-            Identifier = CM_SIZE_50 ;
-            Text [ en-US ] = "Smaller" ;
-        };
-        MenuItem
-        {
-            Identifier = CM_SIZE_150 ;
-            Text [ en-US ] = "Larger" ;
-        };
-        MenuItem
-        {
-            Identifier = CM_SIZE_400 ;
-            Text [ en-US ] = "Extra large" ;
-        };
-    };
-};
-
 Menu RID_CUSTOMANIMATION_SCALE_POPUP
 {
     ItemList =
diff --git a/sd/source/ui/animations/CustomAnimationDialog.cxx b/sd/source/ui/animations/CustomAnimationDialog.cxx
index 333065e0229d..6facfeef0f9b 100644
--- a/sd/source/ui/animations/CustomAnimationDialog.cxx
+++ b/sd/source/ui/animations/CustomAnimationDialog.cxx
@@ -420,21 +420,24 @@ public:
 
 private:
     DECL_LINK( EditModifyHdl, Edit&, void );
+    VclBuilder maBuilder;
     VclPtr<DropdownMenuBox> mpControl;
     VclPtr<PopupMenu> mpMenu;
     VclPtr<MetricField> mpMetric;
     Link<LinkParamNone*,void> maModifyHdl;
 };
 
-CharHeightPropertyBox::CharHeightPropertyBox( sal_Int32 nControlType, vcl::Window* pParent, const Any& rValue, const Link<LinkParamNone*,void>& rModifyHdl )
-: PropertySubControl( nControlType ), maModifyHdl(rModifyHdl)
+CharHeightPropertyBox::CharHeightPropertyBox(sal_Int32 nControlType, vcl::Window* pParent, const Any& rValue, const Link<LinkParamNone*,void>& rModifyHdl)
+    : PropertySubControl(nControlType)
+    , maBuilder(nullptr, VclBuilderContainer::getUIRootDir(), "modules/simpress/ui/fontsizemenu.ui", "")
+    , maModifyHdl(rModifyHdl)
 {
     mpMetric.set( VclPtr<MetricField>::Create( pParent, WB_TABSTOP|WB_IGNORETAB| WB_NOBORDER) );
     mpMetric->SetUnit( FUNIT_PERCENT );
     mpMetric->SetMin( 0 );
     mpMetric->SetMax( 1000 );
 
-    mpMenu = VclPtr<PopupMenu>::Create(SdResId( RID_CUSTOMANIMATION_FONTSIZE_POPUP ) );
+    mpMenu = maBuilder.get_menu("menu");
     mpControl = VclPtr<DropdownMenuBox>::Create( pParent, mpMetric, mpMenu );
     mpControl->SetMenuSelectHdl( LINK( this, CharHeightPropertyBox, implMenuSelectHdl ));
     mpControl->SetModifyHdl( LINK( this, CharHeightPropertyBox, EditModifyHdl ) );
@@ -446,6 +449,7 @@ CharHeightPropertyBox::CharHeightPropertyBox( sal_Int32 nControlType, vcl::Windo
 
 CharHeightPropertyBox::~CharHeightPropertyBox()
 {
+    maBuilder.disposeBuilder();
     mpControl.disposeAndClear();
 }
 
@@ -456,15 +460,8 @@ IMPL_LINK_NOARG( CharHeightPropertyBox, EditModifyHdl, Edit&, void )
 
 IMPL_LINK( CharHeightPropertyBox, implMenuSelectHdl, MenuButton*, pPb, void )
 {
-    long nValue = 100;
-    switch( pPb->GetCurItemId() )
-    {
-    case CM_SIZE_25: nValue = 25; break;
-    case CM_SIZE_50: nValue = 50; break;
-    case CM_SIZE_150: nValue = 150; break;
-    case CM_SIZE_400: nValue = 400; break;
-    }
-    mpMetric->SetValue( nValue );
+    sal_Int32 nValue = pPb->GetCurItemIdent().toInt32();
+    mpMetric->SetValue(nValue);
     mpMetric->Modify();
 }
 
diff --git a/sd/uiconfig/simpress/ui/fontsizemenu.ui b/sd/uiconfig/simpress/ui/fontsizemenu.ui
new file mode 100644
index 000000000000..05f563f4058e
--- /dev/null
+++ b/sd/uiconfig/simpress/ui/fontsizemenu.ui
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.20.0 -->
+<interface>
+  <requires lib="gtk+" version="3.10"/>
+  <object class="GtkMenu" id="menu">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <child>
+      <object class="GtkMenuItem" id="25">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label" translatable="yes">Tiny</property>
+        <property name="use_underline">True</property>
+      </object>
+    </child>
+    <child>
+      <object class="GtkMenuItem" id="50">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label" translatable="yes">Smaller</property>
+        <property name="use_underline">True</property>
+      </object>
+    </child>
+    <child>
+      <object class="GtkMenuItem" id="150">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label" translatable="yes">Larger</property>
+        <property name="use_underline">True</property>
+      </object>
+    </child>
+    <child>
+      <object class="GtkMenuItem" id="400">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label" translatable="yes">Extra Large</property>
+        <property name="use_underline">True</property>
+      </object>
+    </child>
+  </object>
+</interface>


More information about the Libreoffice-commits mailing list