[Libreoffice-commits] core.git: include/svx svx/source svx/uiconfig svx/UIConfig_svx.mk

Caolán McNamara caolanm at redhat.com
Tue Apr 18 08:55:09 UTC 2017


 include/svx/fmresids.hrc          |    1 
 svx/UIConfig_svx.mk               |    1 
 svx/source/form/fmexpl.src        |  147 ---------------------------------
 svx/source/form/fmshell.cxx       |    6 -
 svx/source/form/fmshimp.cxx       |  110 +++++++++++++------------
 svx/source/form/navigatortree.cxx |   18 ++--
 svx/source/inc/fmshimp.hxx        |   12 +-
 svx/uiconfig/ui/convertmenu.ui    |  167 ++++++++++++++++++++++++++++++++++++++
 8 files changed, 252 insertions(+), 210 deletions(-)

New commits:
commit ea37507b9d9afbc747af04af5d9a27bf1a9f3727
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Apr 16 21:46:16 2017 +0100

    convert RID_FMSHELL_CONVERSIONMENU menu to .ui
    
    Change-Id: I6b38611063690a4038862f3a2810dd3c695b62d2

diff --git a/include/svx/fmresids.hrc b/include/svx/fmresids.hrc
index bd6422a3c731..7a82ef7b9390 100644
--- a/include/svx/fmresids.hrc
+++ b/include/svx/fmresids.hrc
@@ -62,7 +62,6 @@
 #define RID_SVXTBX_FORMDESIGN                       (RID_FORMS_START +  6)
 
 // Menu-Id's -----------------------------------------------------------
-#define RID_FMSHELL_CONVERSIONMENU                  (RID_FORMS_START + 4)
 #define RID_FM_FILTER_MENU                          (RID_FORMS_START + 5)
 
 // String-Id's -----------------------------------------------------------
diff --git a/svx/UIConfig_svx.mk b/svx/UIConfig_svx.mk
index cfe6260de78f..5367c59b4743 100644
--- a/svx/UIConfig_svx.mk
+++ b/svx/UIConfig_svx.mk
@@ -24,6 +24,7 @@ $(eval $(call gb_UIConfig_add_uifiles,svx,\
 	svx/uiconfig/ui/colorwindow \
 	svx/uiconfig/ui/colsmenu \
 	svx/uiconfig/ui/compressgraphicdialog \
+	svx/uiconfig/ui/convertmenu \
 	svx/uiconfig/ui/crashreportdlg \
 	svx/uiconfig/ui/datanavigator \
 	svx/uiconfig/ui/defaultshapespanel \
diff --git a/svx/source/form/fmexpl.src b/svx/source/form/fmexpl.src
index 3b0994616bcc..2513a80eda60 100644
--- a/svx/source/form/fmexpl.src
+++ b/svx/source/form/fmexpl.src
@@ -22,153 +22,6 @@
 #include <svx/svxcommands.h>
 #include "fmhelp.hrc"
 
-Menu RID_FMSHELL_CONVERSIONMENU
-{
-    ItemList =
-    {
-        MenuItem
-        {
-            Identifier = SID_FM_CONVERTTO_EDIT ;
-            HelpId = CMD_SID_FM_CONVERTTO_EDIT ;
-            Command = ".uno:ConvertToEdit" ;
-            Text [ en-US ] = "~Text Box";
-        };
-        MenuItem
-        {
-            Identifier = SID_FM_CONVERTTO_BUTTON ;
-            HelpId = CMD_SID_FM_CONVERTTO_BUTTON ;
-            Command = ".uno:ConvertToButton" ;
-            Text [ en-US ] = "~Button";
-        };
-        MenuItem
-        {
-            Identifier = SID_FM_CONVERTTO_FIXEDTEXT ;
-            HelpId = CMD_SID_FM_CONVERTTO_FIXEDTEXT ;
-            Command = ".uno:ConvertToFixed" ;
-            Text [ en-US ] = "La~bel field";
-        };
-        MenuItem
-        {
-            Identifier = SID_FM_CONVERTTO_GROUPBOX ;
-            HelpId = CMD_SID_FM_CONVERTTO_GROUPBOX ;
-            Command = ".uno:ConvertToGroup" ;
-            Text [ en-US ] = "G~roup Box";
-        };
-        MenuItem
-        {
-            Identifier = SID_FM_CONVERTTO_LISTBOX ;
-            HelpId = CMD_SID_FM_CONVERTTO_LISTBOX ;
-            Command = ".uno:ConvertToList" ;
-            Text [ en-US ] = "L~ist Box";
-        };
-        MenuItem
-        {
-            Identifier = SID_FM_CONVERTTO_CHECKBOX ;
-            HelpId = CMD_SID_FM_CONVERTTO_CHECKBOX ;
-            Command = ".uno:ConvertToCheckBox" ;
-            Text [ en-US ] = "~Check Box";
-        };
-        MenuItem
-        {
-            Identifier = SID_FM_CONVERTTO_RADIOBUTTON ;
-            HelpId = CMD_SID_FM_CONVERTTO_RADIOBUTTON ;
-            Command = ".uno:ConvertToRadio" ;
-            Text [ en-US ] = "~Radio Button";
-        };
-        MenuItem
-        {
-            Identifier = SID_FM_CONVERTTO_COMBOBOX ;
-            HelpId = CMD_SID_FM_CONVERTTO_COMBOBOX ;
-            Command = ".uno:ConvertToCombo" ;
-            Text [ en-US ] = "Combo Bo~x";
-        };
-        MenuItem
-        {
-            Identifier = SID_FM_CONVERTTO_IMAGEBUTTON ;
-            HelpId = CMD_SID_FM_CONVERTTO_IMAGEBUTTON ;
-            Command = ".uno:ConvertToImageBtn" ;
-            Text [ en-US ] = "I~mage Button";
-        };
-        MenuItem
-        {
-            Identifier = SID_FM_CONVERTTO_FILECONTROL ;
-            HelpId = CMD_SID_FM_CONVERTTO_FILECONTROL ;
-            Command = ".uno:ConvertToFileControl" ;
-            Text [ en-US ] = "~File Selection";
-        };
-        MenuItem
-        {
-            Identifier = SID_FM_CONVERTTO_DATE ;
-            HelpId = CMD_SID_FM_CONVERTTO_DATE ;
-            Command = ".uno:ConvertToDate" ;
-            Text [ en-US ] = "~Date Field";
-        };
-        MenuItem
-        {
-            Identifier = SID_FM_CONVERTTO_TIME ;
-            HelpId = CMD_SID_FM_CONVERTTO_TIME ;
-            Command = ".uno:ConvertToTime" ;
-            Text [ en-US ] = "Tim~e Field";
-        };
-        MenuItem
-        {
-            Identifier = SID_FM_CONVERTTO_NUMERIC ;
-            HelpId = CMD_SID_FM_CONVERTTO_NUMERIC ;
-            Command = ".uno:ConvertToNumeric" ;
-            Text [ en-US ] = "~Numerical Field";
-        };
-        MenuItem
-        {
-            Identifier = SID_FM_CONVERTTO_CURRENCY ;
-            HelpId = CMD_SID_FM_CONVERTTO_CURRENCY ;
-            Command = ".uno:ConvertToCurrency" ;
-            Text [ en-US ] = "C~urrency Field";
-        };
-        MenuItem
-        {
-            Identifier = SID_FM_CONVERTTO_PATTERN ;
-            HelpId = CMD_SID_FM_CONVERTTO_PATTERN ;
-            Command = ".uno:ConvertToPattern" ;
-            Text [ en-US ] = "~Pattern Field";
-        };
-        MenuItem
-        {
-            Identifier = SID_FM_CONVERTTO_IMAGECONTROL ;
-            HelpId = CMD_SID_FM_CONVERTTO_IMAGECONTROL ;
-            Command = ".uno:ConvertToImageControl" ;
-            Text [ en-US ] = "Ima~ge Control";
-        };
-        MenuItem
-        {
-            Identifier = SID_FM_CONVERTTO_FORMATTED ;
-            HelpId = CMD_SID_FM_CONVERTTO_FORMATTED ;
-            Command = ".uno:ConvertToFormatted" ;
-            Text [ en-US ] = "Fo~rmatted Field";
-        };
-        MenuItem
-        {
-            Identifier = SID_FM_CONVERTTO_SCROLLBAR ;
-            HelpId = CMD_SID_FM_CONVERTTO_SCROLLBAR ;
-            Command = ".uno:ConvertToScrollBar" ;
-            Text [ en-US ] = "Scroll bar";
-        };
-        MenuItem
-        {
-            Identifier = SID_FM_CONVERTTO_SPINBUTTON;
-            HelpId = CMD_SID_FM_CONVERTTO_SPINBUTTON;
-            Command = ".uno:ConvertToSpinButton" ;
-            Text [ en-US ] = "Spin Button";
-        };
-        MenuItem
-        {
-            Identifier = SID_FM_CONVERTTO_NAVIGATIONBAR;
-            HelpId = CMD_SID_FM_CONVERTTO_NAVIGATIONBAR;
-            Command = ".uno:ConvertToNavigationBar" ;
-            Text [ en-US ] = "Navigation Bar" ;
-        };
-    };
-};
-
 Bitmap RID_SVXBMP_FORM
 {
     File = "sx10593.png";
diff --git a/svx/source/form/fmshell.cxx b/svx/source/form/fmshell.cxx
index 31306a94dd73..93ff871278cb 100644
--- a/svx/source/form/fmshell.cxx
+++ b/svx/source/form/fmshell.cxx
@@ -576,7 +576,7 @@ void FmFormShell::Execute(SfxRequest &rReq)
         case SID_FM_CONVERTTO_SCROLLBAR     :
         case SID_FM_CONVERTTO_SPINBUTTON    :
         case SID_FM_CONVERTTO_NAVIGATIONBAR :
-            GetImpl()->executeControlConversionSlot( nSlot );
+            GetImpl()->executeControlConversionSlot(FmXFormShell::SlotToIdent(nSlot));
             // nach dem Konvertieren die Selektion neu bestimmern, da sich ja das selektierte Objekt
             // geaendert hat
             GetImpl()->SetSelection(GetFormView()->GetMarkedObjectList());
@@ -1021,7 +1021,7 @@ void FmFormShell::GetState(SfxItemSet &rSet)
                     rSet.DisableItem( nWhich );
                 else
                 {
-                    if ( !GetImpl()->canConvertCurrentSelectionToControl( SID_FM_CONVERTTO_FIXEDTEXT ) )
+                    if (!GetImpl()->canConvertCurrentSelectionToControl("ConvertToFixed"))
                         // if it cannot be converted to a fixed text, it is no single control
                         rSet.DisableItem( nWhich );
                 }
@@ -1048,7 +1048,7 @@ void FmFormShell::GetState(SfxItemSet &rSet)
             case SID_FM_CONVERTTO_FORMATTED     :
             case SID_FM_CONVERTTO_SPINBUTTON    :
             {
-                if ( !m_pFormView || !m_bDesignMode || !GetImpl()->canConvertCurrentSelectionToControl( nWhich ) )
+                if (!m_pFormView || !m_bDesignMode || !GetImpl()->canConvertCurrentSelectionToControl(FmXFormShell::SlotToIdent(nWhich)))
                     rSet.DisableItem( nWhich );
                 else
                 {
diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx
index 95ab5fa4fc34..358832f8f375 100644
--- a/svx/source/form/fmshimp.cxx
+++ b/svx/source/form/fmshimp.cxx
@@ -179,28 +179,28 @@ static const sal_Int16 SelObjectSlotMap[] =  // vom SelObject abhaengige Slots
 
 // die folgenden Arrays muessen kosistent sein, also einander entsprechende Eintraege an der selben relativen Position
 // innerhalb ihres jeweiligen Arrays stehen
-static const sal_Int16 nConvertSlots[] =
-{
-    SID_FM_CONVERTTO_EDIT,
-    SID_FM_CONVERTTO_BUTTON,
-    SID_FM_CONVERTTO_FIXEDTEXT,
-    SID_FM_CONVERTTO_LISTBOX,
-    SID_FM_CONVERTTO_CHECKBOX,
-    SID_FM_CONVERTTO_RADIOBUTTON,
-    SID_FM_CONVERTTO_GROUPBOX,
-    SID_FM_CONVERTTO_COMBOBOX,
-    SID_FM_CONVERTTO_IMAGEBUTTON,
-    SID_FM_CONVERTTO_FILECONTROL,
-    SID_FM_CONVERTTO_DATE,
-    SID_FM_CONVERTTO_TIME,
-    SID_FM_CONVERTTO_NUMERIC,
-    SID_FM_CONVERTTO_CURRENCY,
-    SID_FM_CONVERTTO_PATTERN,
-    SID_FM_CONVERTTO_IMAGECONTROL,
-    SID_FM_CONVERTTO_FORMATTED,
-    SID_FM_CONVERTTO_SCROLLBAR,
-    SID_FM_CONVERTTO_SPINBUTTON,
-    SID_FM_CONVERTTO_NAVIGATIONBAR
+static const char* aConvertSlots[] =
+{
+    "ConvertToEdit",
+    "ConvertToButton",
+    "ConvertToFixed",
+    "ConvertToList",
+    "ConvertToCheckBox",
+    "ConvertToRadio",
+    "ConvertToGroup",
+    "ConvertToCombo",
+    "ConvertToImageBtn",
+    "ConvertToFileControl",
+    "ConvertToDate",
+    "ConvertToTime",
+    "ConvertToNumeric",
+    "ConvertToCurrency",
+    "ConvertToPattern",
+    "ConvertToImageControl",
+    "ConvertToFormatted",
+    "ConvertToScrollBar",
+    "ConvertToSpinButton",
+    "ConvertToNavigationBar"
 };
 
 static const sal_Int16 nImgIds[] =
@@ -1028,38 +1028,50 @@ void FmXFormShell::ForceUpdateSelection()
     }
 }
 
-VclPtr<PopupMenu> FmXFormShell::GetConversionMenu()
+VclBuilder* FmXFormShell::GetConversionMenu()
 {
-
-    VclPtrInstance<PopupMenu> pNewMenu(SVX_RES( RID_FMSHELL_CONVERSIONMENU ));
-    for ( size_t i = 0; i < SAL_N_ELEMENTS(nConvertSlots); ++i )
+    VclBuilder* pBuilder = new VclBuilder(nullptr, VclBuilderContainer::getUIRootDir(), "svx/ui/convertmenu.ui", "");
+    VclPtr<PopupMenu> pNewMenu(pBuilder->get_menu("menu"));
+    for (size_t i = 0; i < SAL_N_ELEMENTS(aConvertSlots); ++i)
     {
         // das entsprechende Image dran
-        pNewMenu->SetItemImage(nConvertSlots[i], Image(BitmapEx(SVX_RES(nImgIds[i]))));
+        pNewMenu->SetItemImage(pNewMenu->GetItemId(aConvertSlots[i]), Image(BitmapEx(SVX_RES(nImgIds[i]))));
     }
-    return pNewMenu;
+    return pBuilder;
 }
 
-bool FmXFormShell::isControlConversionSlot( sal_uInt16 nSlotId )
+OString FmXFormShell::SlotToIdent(sal_uInt16 nSlot)
 {
-    for (sal_Int16 nConvertSlot : nConvertSlots)
-        if (nConvertSlot == nSlotId)
+    assert(SAL_N_ELEMENTS(SelObjectSlotMap) >= SAL_N_ELEMENTS(aConvertSlots));
+
+    for (size_t i = 0; i < SAL_N_ELEMENTS(aConvertSlots); ++i)
+    {
+        if (nSlot == SelObjectSlotMap[i])
+            return aConvertSlots[i];
+    }
+
+    return OString();
+}
+
+bool FmXFormShell::isControlConversionSlot(const OString& rIdent)
+{
+    for (const auto& rConvertSlot : aConvertSlots)
+        if (rIdent == rConvertSlot)
             return true;
     return false;
 }
 
-void FmXFormShell::executeControlConversionSlot( sal_uInt16 _nSlotId )
+void FmXFormShell::executeControlConversionSlot(const OString &rIdent)
 {
-    OSL_PRECOND( canConvertCurrentSelectionToControl( _nSlotId ), "FmXFormShell::executeControlConversionSlot: illegal call!" );
+    OSL_PRECOND( canConvertCurrentSelectionToControl(rIdent), "FmXFormShell::executeControlConversionSlot: illegal call!" );
     InterfaceBag::const_iterator aSelectedElement = m_aCurrentSelection.begin();
     if ( aSelectedElement == m_aCurrentSelection.end() )
         return;
 
-    executeControlConversionSlot( Reference< XFormComponent >( *aSelectedElement, UNO_QUERY ), _nSlotId );
+    executeControlConversionSlot(Reference< XFormComponent >(*aSelectedElement, UNO_QUERY), rIdent);
 }
 
-
-bool FmXFormShell::executeControlConversionSlot( const Reference< XFormComponent >& _rxObject, sal_uInt16 _nSlotId )
+bool FmXFormShell::executeControlConversionSlot(const Reference< XFormComponent >& _rxObject, const OString& rIdent)
 {
     if ( impl_checkDisposed() )
         return false;
@@ -1077,9 +1089,9 @@ bool FmXFormShell::executeControlConversionSlot( const Reference< XFormComponent
     OSL_ENSURE( isSolelySelected( _rxObject ),
         "FmXFormShell::executeControlConversionSlot: hmm ... shouldn't this parameter be redundant?" );
 
-    for ( size_t lookupSlot = 0; lookupSlot < SAL_N_ELEMENTS(nConvertSlots); ++lookupSlot )
+    for (size_t lookupSlot = 0; lookupSlot < SAL_N_ELEMENTS(aConvertSlots); ++lookupSlot)
     {
-        if (nConvertSlots[lookupSlot] == _nSlotId)
+        if (rIdent == aConvertSlots[lookupSlot])
         {
             Reference< XInterface > xNormalizedObject( _rxObject, UNO_QUERY );
 
@@ -1265,8 +1277,7 @@ bool FmXFormShell::executeControlConversionSlot( const Reference< XFormComponent
     return false;
 }
 
-
-bool FmXFormShell::canConvertCurrentSelectionToControl( sal_Int16 nConversionSlot )
+bool FmXFormShell::canConvertCurrentSelectionToControl(const OString& rIdent)
 {
     if ( m_aCurrentSelection.empty() )
         return false;
@@ -1293,25 +1304,26 @@ bool FmXFormShell::canConvertCurrentSelectionToControl( sal_Int16 nConversionSlo
        )
         return false;   // those types cannot be converted
 
-    DBG_ASSERT(SAL_N_ELEMENTS(nConvertSlots) == SAL_N_ELEMENTS(nObjectTypes),
-        "FmXFormShell::canConvertCurrentSelectionToControl: nConvertSlots & nObjectTypes must have the same size !");
+    DBG_ASSERT(SAL_N_ELEMENTS(aConvertSlots) == SAL_N_ELEMENTS(nObjectTypes),
+        "FmXFormShell::canConvertCurrentSelectionToControl: aConvertSlots & nObjectTypes must have the same size !");
 
-    for ( size_t i = 0; i < SAL_N_ELEMENTS( nConvertSlots ); ++i )
-        if (nConvertSlots[i] == nConversionSlot)
+    for (size_t i = 0; i < SAL_N_ELEMENTS(aConvertSlots); ++i)
+        if (rIdent == aConvertSlots[i])
             return nObjectTypes[i] != nObjectType;
 
     return true;    // all other slots: assume "yes"
 }
 
-
-void FmXFormShell::checkControlConversionSlotsForCurrentSelection( Menu& rMenu )
+void FmXFormShell::checkControlConversionSlotsForCurrentSelection(Menu& rMenu)
 {
-    for (sal_Int16 i=0; i<rMenu.GetItemCount(); ++i)
+    for (sal_Int16 i = 0; i < rMenu.GetItemCount(); ++i)
+    {
         // der Context ist schon von einem Typ, der dem Eitnrag entspricht -> disable
-        rMenu.EnableItem( rMenu.GetItemId(i), canConvertCurrentSelectionToControl( rMenu.GetItemId( i ) ) );
+        const sal_uInt16 nId = rMenu.GetItemId(i);
+        rMenu.EnableItem(nId, canConvertCurrentSelectionToControl(rMenu.GetItemIdent(nId)));
+    }
 }
 
-
 void FmXFormShell::LoopGrids(LoopGridsSync nSync, LoopGridsFlags nFlags)
 {
     if ( impl_checkDisposed() )
diff --git a/svx/source/form/navigatortree.cxx b/svx/source/form/navigatortree.cxx
index d0ae2f7a2b57..d7157b319c3e 100644
--- a/svx/source/form/navigatortree.cxx
+++ b/svx/source/form/navigatortree.cxx
@@ -409,12 +409,16 @@ namespace svxform
                     // the same for automatic control focus
                     aContextMenu->EnableItem(aContextMenu->GetItemId("controlfocus"), m_bRootSelected);
 
+                    std::unique_ptr<VclBuilder> xBuilder;
+                    VclPtr<PopupMenu> xConversionMenu;
                     // ConvertTo-Slots are enabled, if one control is selected
                     // the corresponding slot is disabled
                     const sal_Int16 nChangeId = aContextMenu->GetItemId("change");
                     if (!m_bRootSelected && !m_nFormsSelected && (m_nControlsSelected == 1))
                     {
-                        aContextMenu->SetPopupMenu(nChangeId, FmXFormShell::GetConversionMenu() );
+                        xBuilder.reset(FmXFormShell::GetConversionMenu());
+                        xConversionMenu = xBuilder->get_menu("menu");
+                        aContextMenu->SetPopupMenu(nChangeId, xConversionMenu);
 #if OSL_DEBUG_LEVEL > 0
                         FmControlData* pCurrent = static_cast<FmControlData*>((*m_arrCurrentSelection.begin())->GetUserData());
                         OSL_ENSURE( pFormShell->GetImpl()->isSolelySelected( pCurrent->GetFormComponent() ),
@@ -434,10 +438,14 @@ namespace svxform
                     aContextMenu->CheckItem(aContextMenu->GetItemId("designmode"), pFormModel->GetOpenInDesignMode());
                     aContextMenu->CheckItem(aContextMenu->GetItemId("controlfocus"), pFormModel->GetAutoControlFocus());
 
-                    sal_uInt16 nSlotId = aContextMenu->Execute(this, ptWhere);
-                    OString sIdent = aContextMenu->GetCurItemIdent();
+                    aContextMenu->Execute(this, ptWhere);
+                    OString sIdent;
+                    if (xConversionMenu)
+                        sIdent = xConversionMenu->GetCurItemIdent();
                     if (sIdent.isEmpty())
                         sIdent = pSubMenuNew->GetCurItemIdent();
+                    if (sIdent.isEmpty())
+                        sIdent = aContextMenu->GetCurItemIdent();
                     if (sIdent == "form")
                     {
                         OUString aStr(SVX_RESSTR(RID_STR_FORM));
@@ -499,10 +507,10 @@ namespace svxform
                         pFormModel->SetAutoControlFocus( !pFormModel->GetAutoControlFocus() );
                         pFormShell->GetViewShell()->GetViewFrame()->GetBindings().Invalidate(SID_FM_AUTOCONTROLFOCUS);
                     }
-                    else if (FmXFormShell::isControlConversionSlot(nSlotId))
+                    else if (FmXFormShell::isControlConversionSlot(sIdent))
                     {
                         FmControlData* pCurrent = static_cast<FmControlData*>((*m_arrCurrentSelection.begin())->GetUserData());
-                        if ( pFormShell->GetImpl()->executeControlConversionSlot( pCurrent->GetFormComponent(), nSlotId ) )
+                        if (pFormShell->GetImpl()->executeControlConversionSlot(pCurrent->GetFormComponent(), sIdent))
                             ShowSelectionProperties();
                     }
                 }
diff --git a/svx/source/inc/fmshimp.hxx b/svx/source/inc/fmshimp.hxx
index 6a92aa8149eb..c8ed5a1d72cb 100644
--- a/svx/source/inc/fmshimp.hxx
+++ b/svx/source/inc/fmshimp.hxx
@@ -416,21 +416,21 @@ public:
     SAL_DLLPRIVATE void startFiltering();
     SAL_DLLPRIVATE void stopFiltering(bool bSave);
 
-    SAL_DLLPRIVATE static VclPtr<PopupMenu> GetConversionMenu();
+    SAL_DLLPRIVATE static VclBuilder* GetConversionMenu();
         // ein Menue, das alle ControlConversion-Eintraege enthaelt
 
     /// checks whether a given control conversion slot can be applied to the current selection
-    SAL_DLLPRIVATE        bool canConvertCurrentSelectionToControl( sal_Int16 nConversionSlot );
+    SAL_DLLPRIVATE        bool canConvertCurrentSelectionToControl(const OString& rIdent);
     /// enables or disables all conversion slots in a menu, according to the current selection
     SAL_DLLPRIVATE        void checkControlConversionSlotsForCurrentSelection( Menu& rMenu );
     /// executes a control conversion slot for a given object
-    SAL_DLLPRIVATE        bool executeControlConversionSlot( const css::uno::Reference< css::form::XFormComponent >& _rxObject, sal_uInt16 _nSlotId );
+    SAL_DLLPRIVATE        bool executeControlConversionSlot(const css::uno::Reference< css::form::XFormComponent >& _rxObject, const OString& rIdent);
     /** executes a control conversion slot for the current selection
         @precond canConvertCurrentSelectionToControl( <arg>_nSlotId</arg> ) must return <TRUE/>
     */
-    SAL_DLLPRIVATE        void executeControlConversionSlot( sal_uInt16 _nSlotId );
+    SAL_DLLPRIVATE        void executeControlConversionSlot(const OString& rIdent);
     /// checks whether the given slot id denotes a control conversion slot
-    SAL_DLLPRIVATE static bool isControlConversionSlot( sal_uInt16 _nSlotId );
+    SAL_DLLPRIVATE static bool isControlConversionSlot(const OString& rIdent);
 
     SAL_DLLPRIVATE void    ExecuteTextAttribute( SfxRequest& _rReq );
     SAL_DLLPRIVATE void    GetTextAttributeState( SfxItemSet& _rSet );
@@ -526,6 +526,8 @@ public:
     */
     SAL_DLLPRIVATE bool    IsFormSlotEnabled( sal_Int32 _nSlot, css::form::runtime::FeatureState* _pCompleteState );
 
+    SAL_DLLPRIVATE static OString SlotToIdent(sal_uInt16 nSlot);
+
 protected:
     DECL_DLLPRIVATE_LINK( OnLoadForms, void*, void );
 };
diff --git a/svx/uiconfig/ui/convertmenu.ui b/svx/uiconfig/ui/convertmenu.ui
new file mode 100644
index 000000000000..24e551979e04
--- /dev/null
+++ b/svx/uiconfig/ui/convertmenu.ui
@@ -0,0 +1,167 @@
+<?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="ConvertToEdit">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label" translatable="yes">_Text Box</property>
+        <property name="use_underline">True</property>
+      </object>
+    </child>
+    <child>
+      <object class="GtkMenuItem" id="ConvertToButton">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label" translatable="yes">_Button</property>
+        <property name="use_underline">True</property>
+      </object>
+    </child>
+    <child>
+      <object class="GtkMenuItem" id="ConvertToFixed">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label" translatable="yes">La_bel field</property>
+        <property name="use_underline">True</property>
+      </object>
+    </child>
+    <child>
+      <object class="GtkMenuItem" id="ConvertToGroup">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label" translatable="yes">G_roup Box</property>
+        <property name="use_underline">True</property>
+      </object>
+    </child>
+    <child>
+      <object class="GtkMenuItem" id="ConvertToList">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label" translatable="yes">L_ist Box</property>
+        <property name="use_underline">True</property>
+      </object>
+    </child>
+    <child>
+      <object class="GtkMenuItem" id="ConvertToCheckBox">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label" translatable="yes">_Check Box</property>
+        <property name="use_underline">True</property>
+      </object>
+    </child>
+    <child>
+      <object class="GtkMenuItem" id="ConvertToRadio">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label" translatable="yes">_Radio Button</property>
+        <property name="use_underline">True</property>
+      </object>
+    </child>
+    <child>
+      <object class="GtkMenuItem" id="ConvertToCombo">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label" translatable="yes">Combo Bo_x</property>
+        <property name="use_underline">True</property>
+      </object>
+    </child>
+    <child>
+      <object class="GtkMenuItem" id="ConvertToImageBtn">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label" translatable="yes">I_mage Button</property>
+        <property name="use_underline">True</property>
+      </object>
+    </child>
+    <child>
+      <object class="GtkMenuItem" id="ConvertToFileControl">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label" translatable="yes">_File Selection</property>
+        <property name="use_underline">True</property>
+      </object>
+    </child>
+    <child>
+      <object class="GtkMenuItem" id="ConvertToDate">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label" translatable="yes">_Date Field</property>
+        <property name="use_underline">True</property>
+      </object>
+    </child>
+    <child>
+      <object class="GtkMenuItem" id="ConvertToTime">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label" translatable="yes">Tim_e Field</property>
+      </object>
+    </child>
+    <child>
+      <object class="GtkMenuItem" id="ConvertToNumeric">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label" translatable="yes">_Numerical Field</property>
+      </object>
+    </child>
+    <child>
+      <object class="GtkMenuItem" id="ConvertToCurrency">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label" translatable="yes">C_urrency Field</property>
+        <property name="use_underline">True</property>
+      </object>
+    </child>
+    <child>
+      <object class="GtkMenuItem" id="ConvertToPattern">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label" translatable="yes">_Pattern Field</property>
+        <property name="use_underline">True</property>
+      </object>
+    </child>
+    <child>
+      <object class="GtkMenuItem" id="ConvertToImageControl">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label" translatable="yes">Ima_ge Control</property>
+        <property name="use_underline">True</property>
+      </object>
+    </child>
+    <child>
+      <object class="GtkMenuItem" id="ConvertToFormatted">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label" translatable="yes">Fo_rmatted Field</property>
+        <property name="use_underline">True</property>
+      </object>
+    </child>
+    <child>
+      <object class="GtkMenuItem" id="ConvertToScrollBar">
+        <property name="sensitive">False</property>
+        <property name="can_focus">False</property>
+        <property name="label" translatable="yes">Scroll bar</property>
+        <property name="use_underline">True</property>
+      </object>
+    </child>
+    <child>
+      <object class="GtkMenuItem" id="ConvertToSpinButton">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label" translatable="yes">Spin Button</property>
+        <property name="use_underline">True</property>
+      </object>
+    </child>
+    <child>
+      <object class="GtkMenuItem" id="ConvertToNavigationBar">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label" translatable="yes">Navigation Bar</property>
+        <property name="use_underline">True</property>
+      </object>
+    </child>
+  </object>
+</interface>


More information about the Libreoffice-commits mailing list