[Libreoffice-commits] core.git: sfx2/source

Caolán McNamara caolanm at redhat.com
Sun Oct 9 19:51:55 UTC 2016


 sfx2/source/dialog/dinfdlg.cxx |   22 +++++
 sfx2/source/dialog/dinfdlg.src |  160 ++++++++++++++++++++++++++++++-----------
 sfx2/source/inc/sfxlocal.hrc   |    2 
 3 files changed, 141 insertions(+), 43 deletions(-)

New commits:
commit 1bfb59ba81984b056d96c442405a31cc3aeb744d
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Oct 9 20:43:31 2016 +0100

    de-src solo ComboBox
    
    Change-Id: Ie3f687f203c66f93114f5b2421af924ae4c2f76a

diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index 62176bf..c763f6a 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -21,6 +21,7 @@
 #include <svl/urihelper.hxx>
 #include <tools/datetime.hxx>
 #include <tools/urlobj.hxx>
+#include <tools/StringListResource.hxx>
 #include <vcl/layout.hxx>
 #include <vcl/mnemonic.hxx>
 #include <vcl/svapp.hxx>
@@ -1402,9 +1403,26 @@ void CustomPropertiesYesNoButton::Resize()
     m_aNoButton->SetPosSizePixel(aPos, aSize);
 }
 
+namespace
+{
+    VclPtr<ComboBox> makeComboBox(vcl::Window *pParent)
+    {
+        VclPtr<ComboBox> aNameBox(VclPtr<ComboBox>::Create(pParent, WB_TABSTOP|WB_DROPDOWN|
+                                                                    WB_AUTOSIZE|WB_AUTOHSCROLL));
+        Point aPos(aNameBox->LogicToPixel(Point(0, 2), MapUnit::MapAppFont));
+        Size aSize(aNameBox->LogicToPixel(Size(60, 72), MapUnit::MapAppFont));
+        aNameBox->SetPosSizePixel(aPos, aSize);
+        std::vector<OUString> aList;
+        tools::StringListResource aRes(SfxResId(RID_STR_TYPE_CONST), aList);
+        for (const auto& rName : aList)
+            aNameBox->InsertEntry(rName);
+        return aNameBox;
+    }
+}
+
 // struct CustomPropertyLine ---------------------------------------------
 CustomPropertyLine::CustomPropertyLine( vcl::Window* pParent ) :
-    m_aNameBox      ( VclPtr<ComboBox>::Create(pParent, SfxResId( SFX_CB_PROPERTY_NAME )) ),
+    m_aNameBox      ( makeComboBox(pParent) ),
     m_aTypeBox      ( VclPtr<CustomPropertiesTypeBox>::Create(pParent, SfxResId( SFX_LB_PROPERTY_TYPE ), this) ),
     m_aValueEdit    ( VclPtr<CustomPropertiesEdit>::Create(pParent, WB_BORDER|WB_TABSTOP|WB_LEFT, this ) ),
     m_aDateField    ( VclPtr<CustomPropertiesDateField>::Create(pParent, WB_BORDER|WB_TABSTOP|WB_SPIN|WB_LEFT ) ),
@@ -1451,7 +1469,7 @@ CustomPropertiesWindow::CustomPropertiesWindow(vcl::Window* pParent,
     m_pHeaderAccName(pHeaderAccName),
     m_pHeaderAccType(pHeaderAccType),
     m_pHeaderAccValue(pHeaderAccValue),
-    m_aNameBox      ( VclPtr<ComboBox>::Create( this, SfxResId( SFX_CB_PROPERTY_NAME ) ) ),
+    m_aNameBox      ( makeComboBox(this) ),
     m_aTypeBox      ( VclPtr<ListBox>::Create( this, SfxResId( SFX_LB_PROPERTY_TYPE ) ) ),
     m_aValueEdit    ( VclPtr<Edit>::Create( this, WB_BORDER|WB_TABSTOP|WB_LEFT ) ),
     m_aDateField    ( VclPtr<DateField>::Create( this, WB_BORDER|WB_TABSTOP|WB_SPIN|WB_LEFT ) ),
diff --git a/sfx2/source/dialog/dinfdlg.src b/sfx2/source/dialog/dinfdlg.src
index 2a92900..30cf6f9 100644
--- a/sfx2/source/dialog/dinfdlg.src
+++ b/sfx2/source/dialog/dinfdlg.src
@@ -28,50 +28,130 @@ String STR_SFX_NEWOFFICEDOC
     Text [ en-US ] = "%PRODUCTNAME document" ;
 };
 
-ComboBox SFX_CB_PROPERTY_NAME
+Resource RID_STR_TYPE_CONST
 {
-    Pos = MAP_APPFONT ( 0 , 2 ) ;
-    Size = MAP_APPFONT ( 60 , 72 ) ;
-    TabStop = TRUE ;
-    DropDown = TRUE ;
-    AutoSize = TRUE ;
-    AutoHScroll = TRUE ;
-    DDExtraWidth = TRUE ;
-    QuickHelpText [ en-US ] = "Property Name" ;
-    StringList [ en-US ] =
+    String 1
+    {
+        Text [ en-US ] = "Checked by";
+    };
+    String 2
+    {
+        Text [ en-US ] = "Client";
+    };
+    String 3
+    {
+        Text [ en-US ] = "Date completed";
+    };
+    String 4
+    {
+        Text [ en-US ] = "Department";
+    };
+    String 5
+    {
+        Text [ en-US ] = "Destinations";
+    };
+    String 6
+    {
+        Text [ en-US ] = "Disposition";
+    };
+    String 7
+    {
+        Text [ en-US ] = "Division";
+    };
+    String 8
+    {
+        Text [ en-US ] = "Document number";
+    };
+    String 9
+    {
+        Text [ en-US ] = "Editor";
+    };
+    String 10
+    {
+        Text [ en-US ] = "E-Mail";
+    };
+    String 11
+    {
+        Text [ en-US ] = "Forward to";
+    };
+    String 12
+    {
+        Text [ en-US ] = "Group";
+    };
+    String 13
+    {
+        Text [ en-US ] = "Info";
+    };
+    String 14
+    {
+        Text [ en-US ] = "Language";
+    };
+    String 15
+    {
+        Text [ en-US ] = "Mailstop";
+    };
+    String 16
+    {
+        Text [ en-US ] = "Matter";
+    };
+    String 17
+    {
+        Text [ en-US ] = "Office";
+    };
+    String 18
+    {
+        Text [ en-US ] = "Owner";
+    };
+    String 19
+    {
+        Text [ en-US ] = "Project";
+    };
+    String 20
+    {
+        Text [ en-US ] = "Publisher";
+    };
+    String 21
+    {
+        Text [ en-US ] = "Purpose";
+    };
+    String 22
+    {
+        Text [ en-US ] = "Received from";
+    };
+    String 23
     {
-        "Checked by";
-        "Client";
-        "Date completed";
-        "Department";
-        "Destinations";
-        "Disposition";
-        "Division";
-        "Document number";
-        "Editor";
-        "E-Mail";
-        "Forward to";
-        "Group";
-        "Info";
-        "Language";
-        "Mailstop";
-        "Matter";
-        "Office";
-        "Owner";
-        "Project";
-        "Publisher";
-        "Purpose";
-        "Received from";
-        "Recorded by";
-        "Recorded date";
-        "Reference";
-        "Source";
-        "Status";
-        "Telephone number";
-        "Typist";
-        "URL";
+        Text [ en-US ] = "Recorded by";
+    };
+    String 24
+    {
+        Text [ en-US ] = "Recorded date";
+    };
+    String 25
+    {
+        Text [ en-US ] = "Reference";
+    };
+    String 26
+    {
+        Text [ en-US ] = "Source";
+    };
+    String 27
+    {
+        Text [ en-US ] = "Status";
+    };
+    String 28
+    {
+        Text [ en-US ] = "Telephone number";
+    };
+    String 29
+    {
+        Text [ en-US ] = "Typist";
+    };
+    String 30
+    {
+        Text [ en-US ] = "URL";
     };
 };
+
 ListBox SFX_LB_PROPERTY_TYPE
 {
     Pos = MAP_APPFONT ( 63 , 2 ) ;
diff --git a/sfx2/source/inc/sfxlocal.hrc b/sfx2/source/inc/sfxlocal.hrc
index 65360c9..1cfca1f 100644
--- a/sfx2/source/inc/sfxlocal.hrc
+++ b/sfx2/source/inc/sfxlocal.hrc
@@ -37,7 +37,6 @@
 #define STR_SFX_QUERY_WRONG_TYPE            (RID_SFX_SFXLOCAL_START + 11)
 
 // Controls --------------------------------------------------------------
-#define SFX_CB_PROPERTY_NAME                (RID_SFX_SFXLOCAL_START +  0)
 #define SFX_LB_PROPERTY_TYPE                (RID_SFX_SFXLOCAL_START +  4)
 #define SFX_WIN_PROPERTY_YESNO              (RID_SFX_SFXLOCAL_START +  6)
 #define SFX_ST_DURATION_FORMAT              (RID_SFX_SFXLOCAL_START +  13)
@@ -47,6 +46,7 @@
 #define SFX_IMG_PROPERTY_REMOVE             (RID_SFX_SFXLOCAL_START +  0)
 #define SFX_IMG_CLOSE_DOC                   (RID_SFX_SFXLOCAL_START +  2)
 
+#define RID_STR_TYPE_CONST                  (RID_SFX_SFXLOCAL_START + 9)
 #define RID_MENU_NOTEBOOKBAR                (RID_SFX_SFXLOCAL_START + 10)
 
 #endif


More information about the Libreoffice-commits mailing list