include/sfx2/dinfdlg.hxx | 7 - sfx2/source/dialog/dinfdlg.cxx | 33 +++++--- sfx2/source/dialog/dinfdlg.src | 162 ++++++++--------------------------------- sfx2/source/inc/sfxlocal.hrc | 4 - 4 files changed, 62 insertions(+), 144 deletions(-)
New commits: commit b7e8d6aacc58ba328e9a33a651fa3f570d404928 Author: Caolán McNamara <caol...@redhat.com> Date: Wed Oct 12 12:55:57 2016 +0100 turn this into a more natural StringArray Change-Id: Iaf3773608c30dc291cf65a4bc8c282b9f15ee04b diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx index 23d7a92..07f496a 100644 --- a/sfx2/source/dialog/dinfdlg.cxx +++ b/sfx2/source/dialog/dinfdlg.cxx @@ -22,7 +22,6 @@ #include <tools/datetime.hxx> #include <tools/resary.hxx> #include <tools/urlobj.hxx> -#include <tools/StringListResource.hxx> #include <vcl/layout.hxx> #include <vcl/mnemonic.hxx> #include <vcl/svapp.hxx> @@ -1410,13 +1409,11 @@ namespace { 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); + aNameBox->SetPosSizePixel(aNameBox->LogicToPixel(Point(0, 2), MapUnit::MapAppFont), + aNameBox->LogicToPixel(Size(60, 72), MapUnit::MapAppFont)); + ResStringArray aStrArr(SfxResId(SFX_CB_PROPERTY_STRINGARRAY)); + for (sal_uInt32 i = 0; i < aStrArr.Count(); ++i) + aNameBox->InsertEntry(aStrArr.GetString(i)); return aNameBox; } } diff --git a/sfx2/source/dialog/dinfdlg.src b/sfx2/source/dialog/dinfdlg.src index 996096a..b050419 100644 --- a/sfx2/source/dialog/dinfdlg.src +++ b/sfx2/source/dialog/dinfdlg.src @@ -28,127 +28,40 @@ String STR_SFX_NEWOFFICEDOC Text [ en-US ] = "%PRODUCTNAME document" ; }; -Resource RID_STR_TYPE_CONST +StringArray SFX_CB_PROPERTY_STRINGARRAY { - 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 - { - 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 + ItemList [ en-US ] = { - Text [ en-US ] = "URL"; + < "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"; >; }; }; diff --git a/sfx2/source/inc/sfxlocal.hrc b/sfx2/source/inc/sfxlocal.hrc index 41fc033..e8d2d5d 100644 --- a/sfx2/source/inc/sfxlocal.hrc +++ b/sfx2/source/inc/sfxlocal.hrc @@ -36,6 +36,7 @@ #define STR_SFX_UNDOCK (RID_SFX_SFXLOCAL_START + 8) #define STR_SFX_QUERY_WRONG_TYPE (RID_SFX_SFXLOCAL_START + 11) #define SFX_LB_PROPERTY_STRINGARRAY (RID_SFX_SFXLOCAL_START + 12) +#define SFX_CB_PROPERTY_STRINGARRAY (RID_SFX_SFXLOCAL_START + 13) // Controls -------------------------------------------------------------- #define SFX_WIN_PROPERTY_YESNO (RID_SFX_SFXLOCAL_START + 6) @@ -46,7 +47,6 @@ #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 commit 56f84749b8fd51963a50c5bf069f62b70c9494d9 Author: Caolán McNamara <caol...@redhat.com> Date: Wed Oct 12 12:38:03 2016 +0100 de-src CustomPropertiesTypeBox widgetry Change-Id: If98c76ec38708b73158456f4a2c93b5afbe825cd diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx index 1d3a2f0..23d7a92 100644 --- a/sfx2/source/dialog/dinfdlg.cxx +++ b/sfx2/source/dialog/dinfdlg.cxx @@ -20,6 +20,7 @@ #include <svl/eitem.hxx> #include <svl/urihelper.hxx> #include <tools/datetime.hxx> +#include <tools/resary.hxx> #include <tools/urlobj.hxx> #include <tools/StringListResource.hxx> #include <vcl/layout.hxx> @@ -1421,9 +1422,18 @@ namespace } CustomPropertiesTypeBox::CustomPropertiesTypeBox(vcl::Window* pParent, CustomPropertyLine* pLine) - : ListBox(pParent, SfxResId(SFX_LB_PROPERTY_TYPE)) + : ListBox(pParent, WB_BORDER|WB_DROPDOWN) , m_pLine(pLine) { + SetPosSizePixel(LogicToPixel(Point(63, 2), MapUnit::MapAppFont), + LogicToPixel(Size(60, 80), MapUnit::MapAppFont)); + ResStringArray aStrArr(SfxResId(SFX_LB_PROPERTY_STRINGARRAY)); + for (sal_uInt32 i = 0; i < aStrArr.Count(); ++i) + { + InsertEntry(aStrArr.GetString(i)); + SetEntryData(i, reinterpret_cast<void*>(aStrArr.GetValue(i))); + } + SelectEntryPos(0); } // struct CustomPropertyLine --------------------------------------------- diff --git a/sfx2/source/dialog/dinfdlg.src b/sfx2/source/dialog/dinfdlg.src index 30cf6f9..996096a 100644 --- a/sfx2/source/dialog/dinfdlg.src +++ b/sfx2/source/dialog/dinfdlg.src @@ -152,14 +152,9 @@ Resource RID_STR_TYPE_CONST }; }; -ListBox SFX_LB_PROPERTY_TYPE +StringArray SFX_LB_PROPERTY_STRINGARRAY { - Pos = MAP_APPFONT ( 63 , 2 ) ; - Size = MAP_APPFONT ( 60 , 80 ) ; - DropDown = TRUE; - Border = TRUE; - CurPos = 0; - StringList [ en-US ] = + ItemList [ en-US ] = { < "Text" ; CUSTOM_TYPE_TEXT ; > ; < "DateTime" ; CUSTOM_TYPE_DATETIME ; > ; diff --git a/sfx2/source/inc/sfxlocal.hrc b/sfx2/source/inc/sfxlocal.hrc index 1cfca1f..41fc033 100644 --- a/sfx2/source/inc/sfxlocal.hrc +++ b/sfx2/source/inc/sfxlocal.hrc @@ -35,9 +35,9 @@ #define STR_SFX_DOCK (RID_SFX_SFXLOCAL_START + 7) #define STR_SFX_UNDOCK (RID_SFX_SFXLOCAL_START + 8) #define STR_SFX_QUERY_WRONG_TYPE (RID_SFX_SFXLOCAL_START + 11) +#define SFX_LB_PROPERTY_STRINGARRAY (RID_SFX_SFXLOCAL_START + 12) // Controls -------------------------------------------------------------- -#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) commit f8897e4ed69d5620ae70ede2ecf0790828e4f759 Author: Caolán McNamara <caol...@redhat.com> Date: Wed Oct 12 12:14:51 2016 +0100 reuse CustomPropertiesTypeBox for SFX_LB_PROPERTY_TYPE Change-Id: I83195b6927bf11c6695b965b72347f7d51b844a1 diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx index e2bb529..1d3a2f0 100644 --- a/sfx2/source/dialog/dinfdlg.cxx +++ b/sfx2/source/dialog/dinfdlg.cxx @@ -1476,7 +1476,7 @@ CustomPropertiesWindow::CustomPropertiesWindow(vcl::Window* pParent, m_pHeaderAccType(pHeaderAccType), m_pHeaderAccValue(pHeaderAccValue), m_aNameBox ( makeComboBox(this) ), - m_aTypeBox ( VclPtr<ListBox>::Create( this, SfxResId( SFX_LB_PROPERTY_TYPE ) ) ), + m_aTypeBox ( VclPtr<CustomPropertiesTypeBox>::Create(pParent, nullptr) ), 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 ) ), m_aTimeField ( VclPtr<TimeField>::Create( this, WB_BORDER|WB_TABSTOP|WB_SPIN|WB_LEFT ) ), commit 1606171e91f854296e04e186a37d8d6da4d12c05 Author: Caolán McNamara <caol...@redhat.com> Date: Wed Oct 12 12:13:42 2016 +0100 rearrange CustomPropertiesTypeBox Change-Id: Ib30389f7ddf0a85d03b519b586bacf45b3c8adc7 diff --git a/include/sfx2/dinfdlg.hxx b/include/sfx2/dinfdlg.hxx index 6926a21..43d36f7 100644 --- a/include/sfx2/dinfdlg.hxx +++ b/include/sfx2/dinfdlg.hxx @@ -289,12 +289,7 @@ private: CustomPropertyLine* m_pLine; public: - CustomPropertiesTypeBox(vcl::Window* pParent, const ResId& rResId, CustomPropertyLine* pLine) - : ListBox(pParent, rResId) - , m_pLine(pLine) - { - } - + CustomPropertiesTypeBox(vcl::Window* pParent, CustomPropertyLine* pLine); CustomPropertyLine* GetLine() const { return m_pLine; } }; diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx index c763f6a..e2bb529 100644 --- a/sfx2/source/dialog/dinfdlg.cxx +++ b/sfx2/source/dialog/dinfdlg.cxx @@ -1420,10 +1420,16 @@ namespace } } +CustomPropertiesTypeBox::CustomPropertiesTypeBox(vcl::Window* pParent, CustomPropertyLine* pLine) + : ListBox(pParent, SfxResId(SFX_LB_PROPERTY_TYPE)) + , m_pLine(pLine) +{ +} + // struct CustomPropertyLine --------------------------------------------- CustomPropertyLine::CustomPropertyLine( vcl::Window* pParent ) : m_aNameBox ( makeComboBox(pParent) ), - m_aTypeBox ( VclPtr<CustomPropertiesTypeBox>::Create(pParent, SfxResId( SFX_LB_PROPERTY_TYPE ), this) ), + m_aTypeBox ( VclPtr<CustomPropertiesTypeBox>::Create(pParent, 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 ) ), m_aTimeField ( VclPtr<CustomPropertiesTimeField>::Create(pParent, WB_BORDER|WB_TABSTOP|WB_SPIN|WB_LEFT ) ), commit e6a05e9f3276cccce5d72adce24a8d2fee6b8b7b Author: Caolán McNamara <caol...@redhat.com> Date: Wed Oct 12 12:03:30 2016 +0100 annoyings inlines Change-Id: I0823b29ac99b99b9e9cd8b402e4de71ac176d784 diff --git a/include/sfx2/dinfdlg.hxx b/include/sfx2/dinfdlg.hxx index 684dd6c..6926a21 100644 --- a/include/sfx2/dinfdlg.hxx +++ b/include/sfx2/dinfdlg.hxx @@ -289,11 +289,13 @@ private: CustomPropertyLine* m_pLine; public: - inline CustomPropertiesTypeBox( - vcl::Window* pParent, const ResId& rResId, CustomPropertyLine* pLine ) : - ListBox( pParent, rResId ), m_pLine( pLine ) {} + CustomPropertiesTypeBox(vcl::Window* pParent, const ResId& rResId, CustomPropertyLine* pLine) + : ListBox(pParent, rResId) + , m_pLine(pLine) + { + } - inline CustomPropertyLine* GetLine() const { return m_pLine; } + CustomPropertyLine* GetLine() const { return m_pLine; } }; class CustomPropertiesDateField : public DateField
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits