[Libreoffice-commits] core.git: extras/source sw/inc sw/source sw/uiconfig sw/UIConfig_swriter.mk

sk94 eszkadev at gmail.com
Thu Jun 12 01:49:40 PDT 2014


 extras/source/glade/libreoffice-catalog.xml.in |    3 
 sw/UIConfig_swriter.mk                         |    1 
 sw/inc/dbui.hrc                                |    2 
 sw/source/ui/app/app.src                       |    5 
 sw/source/ui/config/optload.cxx                |    2 
 sw/source/ui/dbui/mmaddressblockpage.cxx       |  154 +++++++++++++++++--------
 sw/source/ui/dbui/mmaddressblockpage.hrc       |   13 --
 sw/source/ui/dbui/mmaddressblockpage.hxx       |   14 --
 sw/source/ui/dbui/mmaddressblockpage.src       |  139 ++++------------------
 sw/source/uibase/inc/app.hrc                   |    3 
 sw/uiconfig/swriter/ui/assignfieldsdialog.ui   |  146 +++++++++++++++++++++++
 11 files changed, 292 insertions(+), 190 deletions(-)

New commits:
commit 8e6eb6fb219a20383f79df71883feabfdc8fa899
Author: sk94 <eszkadev at gmail.com>
Date:   Tue Jun 10 20:29:02 2014 +0200

    DLG_MM_ASSIGNFIELDS conversion to .ui
    
    Change-Id: Ia625de9edd46c185c2712c0c5a7154ba1abb2894
    Reviewed-on: https://gerrit.libreoffice.org/9726
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/extras/source/glade/libreoffice-catalog.xml.in b/extras/source/glade/libreoffice-catalog.xml.in
index d005444..a39e779 100644
--- a/extras/source/glade/libreoffice-catalog.xml.in
+++ b/extras/source/glade/libreoffice-catalog.xml.in
@@ -432,6 +432,9 @@
     <glade-widget-class title="Address Preview" name="swlo-SwAddressPreview"
                         generic-name="Address Preview" parent="GtkDrawingArea"
                         icon-name="widget-gtk-drawingarea"/>
+    <glade-widget-class title="Assign Fields Control" name="swuilo-SwAssignFieldsControl"
+                        generic-name="Assign Fields Control" parent="GtkDrawingArea"
+                        icon-name="widget-gtk-drawingarea"/>
     <glade-widget-class title="Rectangle Control" name="svxlo-SvxRectCtl"
                         generic-name="Rectangle Control" parent="GtkDrawingArea"
                         icon-name="widget-gtk-drawingarea"/>
diff --git a/sw/UIConfig_swriter.mk b/sw/UIConfig_swriter.mk
index 6a45ead..f9763e1 100644
--- a/sw/UIConfig_swriter.mk
+++ b/sw/UIConfig_swriter.mk
@@ -65,6 +65,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\
 	sw/uiconfig/swriter/ui/addressblockdialog \
 	sw/uiconfig/swriter/ui/alreadyexistsdialog \
 	sw/uiconfig/swriter/ui/asciifilterdialog \
+	sw/uiconfig/swriter/ui/assignfieldsdialog \
 	sw/uiconfig/swriter/ui/assignstylesdialog \
 	sw/uiconfig/swriter/ui/attachnamedialog \
 	sw/uiconfig/swriter/ui/authenticationsettingsdialog \
diff --git a/sw/inc/dbui.hrc b/sw/inc/dbui.hrc
index e7c6a73..f22bb76 100644
--- a/sw/inc/dbui.hrc
+++ b/sw/inc/dbui.hrc
@@ -28,8 +28,6 @@
 #define DLG_MM_SELECTDBTABLEDDIALOG (RC_DBUI_BEGIN + 12)
 #define DLG_MM_DBTABLEPREVIEWDIALOG (RC_DBUI_BEGIN + 13)
 
-#define DLG_MM_ASSIGNFIELDS           (RC_DBUI_BEGIN + 20)
-
 #define DLG_MM_MAILBODY               (RC_DBUI_BEGIN + 24)
 #define DLG_MM_SENDMAILS              (RC_DBUI_BEGIN + 25)
 #define DLG_MAILMERGECHILD            (RC_DBUI_BEGIN + 26)
diff --git a/sw/source/ui/app/app.src b/sw/source/ui/app/app.src
index 1ff3070..2b19c9f 100644
--- a/sw/source/ui/app/app.src
+++ b/sw/source/ui/app/app.src
@@ -722,9 +722,4 @@ String STR_CAPTION_OLE
     Text [ en-US ] = "Other OLE Objects";
 };
 
-String STR_CATEGORY_NONE
-{
-    Text [ en-US ] = "<None>" ;
-};
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/config/optload.cxx b/sw/source/ui/config/optload.cxx
index d3067ca..d886841 100644
--- a/sw/source/ui/config/optload.cxx
+++ b/sw/source/ui/config/optload.cxx
@@ -420,7 +420,7 @@ SwCaptionOptPage::SwCaptionOptPage( Window* pParent, const SfxItemSet& rSet )
     , m_sEnd(SW_RESSTR(STR_CAPTION_END))
     , m_sAbove(SW_RESSTR(STR_CAPTION_ABOVE))
     , m_sBelow(SW_RESSTR(STR_CAPTION_BELOW))
-    , m_sNone(SW_RESSTR(STR_CATEGORY_NONE))
+    , m_sNone(SW_RESSTR(SW_STR_NONE))
     , pMgr(new SwFldMgr())
     , bHTMLMode(false)
 {
diff --git a/sw/source/ui/dbui/mmaddressblockpage.cxx b/sw/source/ui/dbui/mmaddressblockpage.cxx
index 27eddc9..e7935ed 100644
--- a/sw/source/ui/dbui/mmaddressblockpage.cxx
+++ b/sw/source/ui/dbui/mmaddressblockpage.cxx
@@ -65,14 +65,14 @@ SwMailMergeAddressBlockPage::SwMailMergeAddressBlockPage( SwMailMergeWizard* _pP
     get(m_pSettingsFI, "settingsft");
     get(m_pAddressCB, "address");
     get(m_pSettingsWIN, "settingspreview");
-    Size aSize(LogicToPixel(Size(164 , 45), MapMode(MAP_APPFONT)));
+    Size aSize(LogicToPixel(Size(164 , 45), MAP_APPFONT));
     m_pSettingsWIN->set_width_request(aSize.Width());
     m_pSettingsWIN->set_height_request(aSize.Height());
     get(m_pSettingsPB, "settings");
     get(m_pHideEmptyParagraphsCB, "hideempty");
     get(m_pAssignPB, "assign");
     get(m_pPreviewWIN, "addresspreview");
-    aSize = LogicToPixel(Size(176, 46), MapMode(MAP_APPFONT));
+    aSize = LogicToPixel(Size(176, 46), MAP_APPFONT);
     m_pPreviewWIN->set_width_request(aSize.Width());
     m_pPreviewWIN->set_height_request(aSize.Height());
     get(m_pDocumentIndexFI, "documentindex");
@@ -304,7 +304,7 @@ SwSelectAddressBlockDialog::SwSelectAddressBlockDialog(
     , m_rConfig(rConfig)
 {
     get(m_pPreview, "preview");
-    Size aSize(m_pPreview->LogicToPixel(Size(192, 100), MapMode(MAP_APPFONT)));
+    Size aSize(m_pPreview->LogicToPixel(Size(192, 100), MAP_APPFONT));
     m_pPreview->set_width_request(aSize.Width());
     m_pPreview->set_height_request(aSize.Height());
     get(m_pNewPB, "new");
@@ -796,11 +796,11 @@ class SwAssignFieldsControl : public Control
     HeaderBar                   m_aHeaderHB;
     Window                      m_aWindow;
 
-    ::std::vector<FixedInfo*>   m_aFieldNames;
+    ::std::vector<FixedText*>   m_aFieldNames;
     ::std::vector<ListBox*>     m_aMatches;
-    ::std::vector<FixedInfo*>   m_aPreviews;
+    ::std::vector<FixedText*>   m_aPreviews;
 
-    SwMailMergeConfigItem&      m_rConfigItem;
+    SwMailMergeConfigItem*      m_rConfigItem;
 
     Link                        m_aModifyHdl;
 
@@ -817,38 +817,56 @@ class SwAssignFieldsControl : public Control
 
     void                MakeVisible( sal_Int32 nIndex );
 public:
-    SwAssignFieldsControl(Window* pParent, const ResId& rResId,
-                                SwMailMergeConfigItem& rConfigItem);
+    SwAssignFieldsControl(Window* pParent, WinBits nBits);
     virtual ~SwAssignFieldsControl();
 
+    void        Init(SwMailMergeConfigItem& rConfigItem);
     void        SetModifyHdl(const Link& rModifyHdl)
                 {
                     m_aModifyHdl = rModifyHdl;
                     m_aModifyHdl.Call(this);
                 }
+    virtual void Resize() SAL_OVERRIDE;
+    virtual Size GetOptimalSize() const SAL_OVERRIDE;
 };
 
-SwAssignFieldsControl::SwAssignFieldsControl(
-        Window* pParent, const ResId& rResId, SwMailMergeConfigItem& rConfigItem) :
-    Control(pParent, rResId),
-    m_aVScroll(this,  ResId(SCR_1, *rResId.GetResMgr()     )),
+extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSwAssignFieldsControl(Window *pParent, VclBuilder::stringmap &)
+{
+    return new SwAssignFieldsControl(pParent, WB_BORDER);
+}
+
+SwAssignFieldsControl::SwAssignFieldsControl(Window* pParent, WinBits nBits) :
+    Control(pParent, nBits | WB_DIALOGCONTROL | WB_TABSTOP | WB_DIALOGCONTROL),
+    m_aVScroll(this),
     m_aHeaderHB(this, WB_BUTTONSTYLE | WB_BOTTOMBORDER),
-    m_aWindow(this, ResId(WIN_DATA, *rResId.GetResMgr())),
-    m_rConfigItem(rConfigItem),
+    m_aWindow(this, WB_BORDER | WB_DIALOGCONTROL),
+    m_rConfigItem(NULL),
     m_nLBStartTopPos(0),
     m_nYOffset(0),
     m_nFirstYPos(0)
 {
-    SetStyle(GetStyle()|WB_TABSTOP|WB_DIALOGCONTROL);
     SetHelpId(HID_MM_ASSIGN_FIELDS);
     long nHBHeight = m_aHeaderHB.CalcWindowSizePixel().Height();
     Size aOutputSize(GetOutputSize());
+    m_aVScroll.Show();
     m_aHeaderHB.SetSizePixel(
         Size(aOutputSize.Width(), nHBHeight));
     m_aHeaderHB.Show();
     m_aWindow.SetPosPixel(Point( 0, nHBHeight) );
     m_aWindow.SetSizePixel(Size(aOutputSize.Width() - m_aVScroll.GetSizePixel().Width(), aOutputSize.Height() - nHBHeight));
     m_aWindow.Show();
+}
+
+Size SwAssignFieldsControl::GetOptimalSize() const
+{
+    return LogicToPixel(Size(248 , 120), MAP_APPFONT);
+}
+
+void SwAssignFieldsControl::Init(SwMailMergeConfigItem& rConfigItem)
+{
+    m_rConfigItem = &rConfigItem;
+    Size aOutputSize(GetOutputSize());
+    long nHBHeight = m_aHeaderHB.CalcWindowSizePixel().Height();
 
     //get the name of the default headers
     const ResStringArray& rHeaders = rConfigItem.GetDefaultAddressHeaders();
@@ -887,17 +905,24 @@ SwAssignFieldsControl::SwAssignFieldsControl(
     };
 
     //fill the controls
+    long nControlWidth = aOutputSize.Width() / 3;
+    long nControlHeight = 24;
     for(sal_uInt32 i = 0; i < rHeaders.Count(); ++i)
     {
         const OUString rHeader = rHeaders.GetString( i );
-        FixedInfo* pNewText = new FixedInfo(&m_aWindow, ResId( FT_FIELDS, *rResId.GetResMgr()));
+        FixedText* pNewText = new FixedText(&m_aWindow, WB_VCENTER);
         pNewText->SetText("<" + rHeader + ">");
-        ListBox* pNewLB = new ListBox(&m_aWindow, ResId(LB_FIELDS, *rResId.GetResMgr()));
+        ListBox* pNewLB = new ListBox(&m_aWindow, WB_DROPDOWN | WB_VCENTER | WB_TABSTOP);
+        pNewLB->InsertEntry(SW_RESSTR(SW_STR_NONE));
         pNewLB->SetHelpId( aHIDs[i] );
         pNewLB->SelectEntryPos(0);
+        pNewLB->SetDropDownLineCount(5);
         for(sal_Int32 nField = 0; nField < aFields.getLength(); ++nField)
             pNewLB->InsertEntry(pFields[nField]);
-        FixedInfo* pNewPreview = new FixedInfo(&m_aWindow, ResId( FT_PREVIEW, *rResId.GetResMgr() ));
+        FixedText* pNewPreview = new FixedText(&m_aWindow, WB_VCENTER);
+        pNewText->SetSizePixel(Size(nControlWidth - 6, nControlHeight));
+        pNewLB->SetSizePixel(Size(nControlWidth - 6, nControlHeight));
+        pNewPreview->SetSizePixel(Size(aOutputSize.Width() - 2 * nControlWidth, nControlHeight));
         //select the ListBox
         //if there is an assignment
         if(static_cast<sal_uInt32>(aAssignments.getLength()) > i && !aAssignments[i].isEmpty())
@@ -927,20 +952,22 @@ SwAssignFieldsControl::SwAssignFieldsControl(
             //determine the vertical offset, use the bottom position of the ListBox
             m_nFirstYPos = m_nYOffset = pNewLB->GetPosPixel().Y();
             m_nLBStartTopPos = m_nYOffset;
-            m_nYOffset += pNewLB->GetSizePixel().Height();
+            m_nYOffset += pNewLB->GetSizePixel().Height() + 6;
         }
 
         long nMove = m_nYOffset * i;
-        lcl_Move(pNewText, nMove);
-        lcl_Move(pNewLB, nMove);
-        lcl_Move(pNewPreview, nMove);
-        //set the select handler
         pNewLB->SetSelectHdl(aMatchHdl);
         pNewLB->SetGetFocusHdl(aFocusHdl);
 
         m_aFieldNames.push_back(pNewText);
         m_aMatches.push_back(pNewLB);
         m_aPreviews.push_back(pNewPreview);
+        pNewText->Show();
+        pNewText->SetPosPixel(Point(6, nMove));
+        pNewLB->Show();
+        pNewLB->SetPosPixel(Point(nControlWidth, nMove));
+        pNewPreview->Show();
+        pNewPreview->SetPosPixel(Point(2 * nControlWidth + 6, nMove));
     }
     m_aVScroll.SetRange(Range(0, rHeaders.Count()));
     m_aVScroll.SetPageSize((aOutputSize.Height() - nHBHeight - m_nLBStartTopPos)/ m_nYOffset);
@@ -948,15 +975,13 @@ SwAssignFieldsControl::SwAssignFieldsControl(
     m_aVScroll.SetVisibleSize(m_aVScroll.GetPageSize());
     m_aVScroll.SetScrollHdl(LINK(this, SwAssignFieldsControl, ScrollHdl_Impl));
 
-    FreeResource();
     m_aVScroll.SetPosPixel(Point(aOutputSize.Width() - m_aVScroll.GetSizePixel().Width(), nHBHeight));
     m_aVScroll.SetSizePixel(Size(m_aVScroll.GetSizePixel().Width(), aOutputSize.Height() - nHBHeight));
-
 }
 
 SwAssignFieldsControl::~SwAssignFieldsControl()
 {
-    ::std::vector<FixedInfo*>::iterator aFIIter;
+    ::std::vector<FixedText*>::iterator aFIIter;
     for(aFIIter = m_aFieldNames.begin(); aFIIter != m_aFieldNames.end(); ++aFIIter)
         delete *aFIIter;
     ::std::vector<ListBox*>::iterator aLBIter;
@@ -966,6 +991,45 @@ SwAssignFieldsControl::~SwAssignFieldsControl()
         delete *aFIIter;
 }
 
+void SwAssignFieldsControl::Resize()
+{
+    Window::Resize();
+
+    Size aOutputSize = GetOutputSize();
+    long nHBHeight = m_aHeaderHB.CalcWindowSizePixel().Height();
+    long nControlHeight = 24;
+
+    m_aWindow.SetSizePixel(Size(aOutputSize.Width() - m_aVScroll.GetSizePixel().Width(), aOutputSize.Height() - nHBHeight));
+
+    m_aVScroll.SetPosPixel(Point(aOutputSize.Width() - m_aVScroll.GetSizePixel().Width(), nHBHeight));
+    m_aVScroll.SetSizePixel(Size(m_aVScroll.GetSizePixel().Width(), aOutputSize.Height() - nHBHeight));
+    if(m_nYOffset)
+        m_aVScroll.SetPageSize((aOutputSize.Height() - nHBHeight - m_nLBStartTopPos)/ m_nYOffset);
+    m_aVScroll.SetVisibleSize(m_aVScroll.GetPageSize());
+    m_aVScroll.DoScroll(0);
+
+    sal_Int32 nColWidth = aOutputSize.Width() / 3;
+    m_aHeaderHB.SetSizePixel(Size(aOutputSize.Width(), nHBHeight));
+    m_aHeaderHB.SetItemSize( 1, nColWidth);
+    m_aHeaderHB.SetItemSize( 2, nColWidth);
+    m_aHeaderHB.SetItemSize( 3, nColWidth);
+
+    ::std::vector<FixedText*>::iterator aFIIter;
+    for(aFIIter = m_aFieldNames.begin(); aFIIter != m_aFieldNames.end(); ++aFIIter)
+        (*aFIIter)->SetSizePixel(Size(nColWidth - 6, nControlHeight));
+    ::std::vector<ListBox*>::iterator aLBIter;
+    for(aLBIter = m_aMatches.begin(); aLBIter != m_aMatches.end(); ++aLBIter)
+    {
+        long nPosY = (*aLBIter)->GetPosPixel().Y();
+        (*aLBIter)->SetPosSizePixel(Point(nColWidth, nPosY), Size(nColWidth - 6, nControlHeight));
+    }
+    for(aFIIter = m_aPreviews.begin(); aFIIter != m_aPreviews.end(); ++aFIIter)
+    {
+        long nPosY = (*aFIIter)->GetPosPixel().Y();
+        (*aFIIter)->SetPosSizePixel(Point(2 * nColWidth + 6, nPosY), Size(nColWidth, nControlHeight));
+    }
+}
+
 void SwAssignFieldsControl::Command( const CommandEvent& rCEvt )
 {
     switch ( rCEvt.GetCommand() )
@@ -1025,7 +1089,7 @@ IMPL_LINK(SwAssignFieldsControl, ScrollHdl_Impl, ScrollBar*, pScroll)
 
     SetUpdateMode(false);
     long nIndex;
-    ::std::vector<FixedInfo*>::iterator aFIIter;
+    ::std::vector<FixedText*>::iterator aFIIter;
     for(nIndex = 0, aFIIter = m_aFieldNames.begin(); aFIIter != m_aFieldNames.end(); ++aFIIter, ++nIndex)
         lcl_Move(*aFIIter, nMove);
     ::std::vector<ListBox*>::iterator aLBIter;
@@ -1041,7 +1105,7 @@ IMPL_LINK(SwAssignFieldsControl, ScrollHdl_Impl, ScrollBar*, pScroll)
 IMPL_LINK(SwAssignFieldsControl, MatchHdl_Impl, ListBox*, pBox)
 {
     const OUString sColumn = pBox->GetSelectEntry();
-    uno::Reference< XColumnsSupplier > xColsSupp( m_rConfigItem.GetResultSet(), uno::UNO_QUERY);
+    uno::Reference< XColumnsSupplier > xColsSupp( m_rConfigItem->GetResultSet(), uno::UNO_QUERY);
     uno::Reference <XNameAccess> xColAccess = xColsSupp.is() ? xColsSupp->getColumns() : 0;
     OUString sPreview;
     if(xColAccess.is() && xColAccess->hasByName(sColumn))
@@ -1096,30 +1160,31 @@ SwAssignFieldsDialog::SwAssignFieldsDialog(
         Window* pParent, SwMailMergeConfigItem& rConfigItem,
         const OUString& rPreview,
         bool bIsAddressBlock) :
-    SfxModalDialog(pParent, SW_RES(DLG_MM_ASSIGNFIELDS)),
-    m_aMatchingFI( this, SW_RES(     FI_MATCHING)),
-    m_pFieldsControl( new SwAssignFieldsControl(this, SW_RES(  CT_FIELDS  ), rConfigItem)),
-    m_aPreviewFI( this, SW_RES(      FI_PREVIEW )),
-    m_aPreviewWIN( this, SW_RES(     WIN_PREVIEW )),
-    m_aSeparatorFL( this, SW_RES(    FL_SEPARATOR)),
-    m_aOK( this, SW_RES(             PB_OK       )),
-    m_aCancel( this, SW_RES(         PB_CANCEL   )),
-    m_aHelp( this, SW_RES(           PB_HELP     )),
+    SfxModalDialog(pParent, "AssignFieldsDialog", "modules/swriter/ui/assignfieldsdialog.ui"),
     m_sNone(SW_RESSTR(SW_STR_NONE)),
     m_rPreviewString(rPreview),
     m_rConfigItem(rConfigItem)
 {
+    get(m_pMatchingFI, "MATCHING_LABEL");
+    get(m_pPreviewFI, "PREVIEW_LABEL");
+    get(m_pOK, "ok");
+    get(m_pPreviewWIN, "PREVIEW");
+    Size aSize(LogicToPixel(Size(248 , 45), MAP_APPFONT));
+    m_pPreviewWIN->set_width_request(aSize.Width());
+    m_pPreviewWIN->set_height_request(aSize.Height());
+    get(m_pFieldsControl, "FIELDS");
+    m_pFieldsControl->Init(rConfigItem);
     //resize the HeaderBar
     OUString sAddressElement( SW_RESSTR(ST_ADDRESSELEMENT) );
     const OUString sMatchesTo( SW_RESSTR(ST_MATCHESTO) );
     const OUString sPreview( SW_RESSTR(ST_PREVIEW) );
     if(!bIsAddressBlock)
     {
-        m_aPreviewFI.SetText(SW_RESSTR(ST_SALUTATIONPREVIEW));
-        m_aMatchingFI.SetText(SW_RESSTR(ST_SALUTATIONMATCHING));
+        m_pPreviewFI->SetText(SW_RESSTR(ST_SALUTATIONPREVIEW));
+        m_pMatchingFI->SetText(SW_RESSTR(ST_SALUTATIONMATCHING));
         sAddressElement = SW_RESSTR(ST_SALUTATIONELEMENT);
     }
-    FreeResource();
+
     Size aOutputSize(m_pFieldsControl->m_aHeaderHB.GetSizePixel());
     sal_Int32 nFirstWidth;
     sal_Int32 nSecondWidth = nFirstWidth = aOutputSize.Width() / 3;
@@ -1131,14 +1196,13 @@ SwAssignFieldsDialog::SwAssignFieldsDialog(
 
     m_pFieldsControl->SetModifyHdl(LINK(this, SwAssignFieldsDialog, AssignmentModifyHdl_Impl ));
 
-    m_aMatchingFI.SetText(m_aMatchingFI.GetText().replaceAll("%1", sMatchesTo));
+    m_pMatchingFI->SetText(m_pMatchingFI->GetText().replaceAll("%1", sMatchesTo));
 
-    m_aOK.SetClickHdl(LINK(this, SwAssignFieldsDialog, OkHdl_Impl));
+    m_pOK->SetClickHdl(LINK(this, SwAssignFieldsDialog, OkHdl_Impl));
 }
 
 SwAssignFieldsDialog::~SwAssignFieldsDialog()
 {
-    delete m_pFieldsControl;
 }
 
 uno::Sequence< OUString > SwAssignFieldsDialog::CreateAssignments()
@@ -1172,7 +1236,7 @@ IMPL_LINK_NOARG(SwAssignFieldsDialog, AssignmentModifyHdl_Impl)
     uno::Sequence< OUString > aAssignments = CreateAssignments();
     const OUString sPreview = SwAddressPreview::FillData(
             m_rPreviewString, m_rConfigItem, &aAssignments);
-    m_aPreviewWIN.SetAddress(sPreview);
+    m_pPreviewWIN->SetAddress(sPreview);
     return 0;
 }
 
@@ -1237,7 +1301,7 @@ AddressMultiLineEdit::AddressMultiLineEdit(Window* pParent, WinBits nBits)
 
 Size AddressMultiLineEdit::GetOptimalSize() const
 {
-    return LogicToPixel(Size(160, 60), MapMode(MAP_APPFONT));
+    return LogicToPixel(Size(160, 60), MAP_APPFONT);
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeAddressMultiLineEdit(Window *pParent, VclBuilder::stringmap &rMap)
diff --git a/sw/source/ui/dbui/mmaddressblockpage.hrc b/sw/source/ui/dbui/mmaddressblockpage.hrc
index e3cc2ff..3afdb63 100644
--- a/sw/source/ui/dbui/mmaddressblockpage.hrc
+++ b/sw/source/ui/dbui/mmaddressblockpage.hrc
@@ -19,31 +19,18 @@
 #ifndef _MAILMERGEADDRESSBLOCKPAGE_HRC
 #define _MAILMERGEADDRESSBLOCKPAGE_HRC
 
-#define FI_PREVIEW              7
-#define WIN_PREVIEW             8
 
 #define STR_DOCUMENT            13
 #define STR_CHANGEADDRESS       16
 
-#define FL_SEPARATOR            29
-#define PB_OK                   30
-#define PB_CANCEL               31
-#define PB_HELP                 32
 
-#define FI_MATCHING             70
-#define CT_FIELDS               71
 #define ST_SALUTATIONPREVIEW    72
 #define ST_SALUTATIONMATCHING   73
 #define ST_SALUTATIONELEMENT   74
 
-#define SCR_1                   1
 #define ST_ADDRESSELEMENT       2
 #define ST_MATCHESTO            3
 #define ST_PREVIEW              4
-#define FT_FIELDS               5
-#define LB_FIELDS               6
-#define FT_PREVIEW              7
-#define WIN_DATA                9
 
 #endif
 
diff --git a/sw/source/ui/dbui/mmaddressblockpage.hxx b/sw/source/ui/dbui/mmaddressblockpage.hxx
index e13069e..fe222a3 100644
--- a/sw/source/ui/dbui/mmaddressblockpage.hxx
+++ b/sw/source/ui/dbui/mmaddressblockpage.hxx
@@ -252,17 +252,15 @@ public:
 class SwAssignFieldsControl;
 class SwAssignFieldsDialog : public SfxModalDialog
 {
-    FixedInfo               m_aMatchingFI;
-    SwAssignFieldsControl*  m_pFieldsControl;
+    FixedText               *m_pMatchingFI;
+    SwAssignFieldsControl   *m_pFieldsControl;
 
-    FixedInfo               m_aPreviewFI;
-    SwAddressPreview        m_aPreviewWIN;
+    FixedText               *m_pPreviewFI;
+    SwAddressPreview        *m_pPreviewWIN;
 
-    FixedLine               m_aSeparatorFL;
 
-    OKButton                m_aOK;
-    CancelButton            m_aCancel;
-    HelpButton              m_aHelp;
+    OKButton                *m_pOK;
+    CancelButton            *m_pCancel;
 
     OUString                m_sNone;
     OUString                m_rPreviewString;
diff --git a/sw/source/ui/dbui/mmaddressblockpage.src b/sw/source/ui/dbui/mmaddressblockpage.src
index e9c2a7a..c06aecb 100644
--- a/sw/source/ui/dbui/mmaddressblockpage.src
+++ b/sw/source/ui/dbui/mmaddressblockpage.src
@@ -20,12 +20,6 @@
 #include <dbui.hrc>
 #include <helpid.h>
 
-#define  _ST_NONE_LIST              \
-        StringList [en-US]=    \
-        {                           \
-            < "< none >" ; > ;        \
-        };
-
 #define WORKAROUND\
     Text [ en-US ] = "New Address Block";
 
@@ -90,117 +84,34 @@ StringArray RA_PUNCTUATION
     };
 };
 
-ModalDialog DLG_MM_ASSIGNFIELDS
+String ST_SALUTATIONMATCHING
 {
-    OutputSize = TRUE ;
-    SVLook = TRUE ;
-    HelpID = HID_MM_ASSIGNFIELDS;
-    Size = MAP_APPFONT ( 260 , 245 ) ;
-    Moveable = TRUE ;
+    Text[ en-US ] = "Assign the fields from your data source to match the salutation elements." ;
+};
 
-    Text [ en-US ] = "Match Fields";
+String ST_SALUTATIONPREVIEW
+{
+    Text[ en-US ] = "Salutation preview";
+};
 
-    FixedText FI_MATCHING
-    {
-        Pos = MAP_APPFONT ( 6 , 3 ) ;
-        Size = MAP_APPFONT ( 240 , 20 ) ;
-        WordBreak = TRUE;
-        Text[ en-US ] = "Assign the fields from your data source to match the address elements." ;
-    };
-    String ST_SALUTATIONMATCHING
-    {
-        Text[ en-US ] = "Assign the fields from your data source to match the salutation elements." ;
-    };
-    Control CT_FIELDS
-    {
-        Pos = MAP_APPFONT ( 6 , 26 ) ;
-        Size = MAP_APPFONT ( 248 , 120 ) ;
-        Border = TRUE;
-        DialogControl = TRUE;
-        ScrollBar SCR_1
-        {
-            Pos = MAP_APPFONT ( 238 , 10 ) ;
-            Size = MAP_APPFONT ( 10 , 110 ) ;
-        };
-        FixedText FT_FIELDS
-        {
-            Pos = MAP_APPFONT ( 6 , 6 ) ;
-            Size = MAP_APPFONT ( 70 , 8 ) ;
-        };
-        Window WIN_DATA
-        {
-            Pos = MAP_APPFONT ( 0 , 0 ) ;
-            Size = MAP_APPFONT ( 248 , 120 ) ;
-            DialogControl = TRUE;
-        };
-        ListBox LB_FIELDS
-        {
-            HelpID = "sw:ListBox:DLG_MM_ASSIGNFIELDS:LB_FIELDS";
-            Pos = MAP_APPFONT ( 83 , 4 ) ;
-            Size = MAP_APPFONT ( 74 , 50 ) ;
-            TabStop = TRUE;
-            Border = TRUE;
-            DropDown = TRUE;
-            _ST_NONE_LIST
-        };
-        FixedText FT_PREVIEW
-        {
-            Pos = MAP_APPFONT ( 165 , 6 ) ;
-            Size = MAP_APPFONT ( 70 , 8 ) ;
-        };
-    };
-    FixedText       FI_PREVIEW
-    {
-        Pos = MAP_APPFONT ( 6 , 152 ) ;
-        Size = MAP_APPFONT ( 248 , 8 ) ;
-        Text[ en-US ] = "Address block preview";
-    };
-    String ST_SALUTATIONPREVIEW
-    {
-        Text[ en-US ] = "Salutation preview";
-    };
-    Window WIN_PREVIEW
-    {
-        Pos = MAP_APPFONT ( 6 , 163 ) ;
-        Size = MAP_APPFONT ( 248 , 45 ) ;
-        Border = TRUE;
-    };
-    FixedLine       FL_SEPARATOR
-    {
-        Pos = MAP_APPFONT ( 0 , 214 ) ;
-        Size = MAP_APPFONT ( 260 , 8 ) ;
-    };
-    OKButton        PB_OK
-    {
-        Pos = MAP_APPFONT ( 95 , 225 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-    };
-    CancelButton    PB_CANCEL
-    {
-        Pos = MAP_APPFONT ( 148 , 225 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-    };
-    HelpButton      PB_HELP
-    {
-        Pos = MAP_APPFONT ( 204 , 225 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-    };
-    String ST_ADDRESSELEMENT
-    {
-        Text[ en-US ] = "Address elements" ;
-    };
-    String ST_SALUTATIONELEMENT
-    {
-        Text[ en-US ] = "Salutation elements" ;
-    };
-    String ST_MATCHESTO
-    {
-        Text[ en-US ] = "Matches to field:" ;
-    };
-    String ST_PREVIEW
-    {
-        Text[ en-US ] = "Preview" ;
-    };
+String ST_ADDRESSELEMENT
+{
+    Text[ en-US ] = "Address elements" ;
+};
+
+String ST_SALUTATIONELEMENT
+{
+    Text[ en-US ] = "Salutation elements" ;
+};
+
+String ST_MATCHESTO
+{
+    Text[ en-US ] = "Matches to field:" ;
+};
+
+String ST_PREVIEW
+{
+    Text[ en-US ] = "Preview" ;
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/inc/app.hrc b/sw/source/uibase/inc/app.hrc
index 8896a3d..95cf3a9 100644
--- a/sw/source/uibase/inc/app.hrc
+++ b/sw/source/uibase/inc/app.hrc
@@ -103,9 +103,8 @@
 #define STR_CAPTION_FRAME               (RC_APP_BEGIN + 134)
 #define STR_CAPTION_GRAPHIC             (RC_APP_BEGIN + 135)
 #define STR_CAPTION_OLE                 (RC_APP_BEGIN + 136)
-#define STR_CATEGORY_NONE               (RC_APP_BEGIN + 137)
 
-#define APP_ACT_END                     STR_CATEGORY_NONE
+#define APP_ACT_END                     STR_CAPTION_OLE
 
 #if APP_ACT_END > RC_APP_END
 #error Resource-Id Ueberlauf in #file, #line
diff --git a/sw/uiconfig/swriter/ui/assignfieldsdialog.ui b/sw/uiconfig/swriter/ui/assignfieldsdialog.ui
new file mode 100644
index 0000000..d250861
--- /dev/null
+++ b/sw/uiconfig/swriter/ui/assignfieldsdialog.ui
@@ -0,0 +1,146 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.16.1 -->
+<interface>
+  <!-- interface-requires LibreOffice 1.0 -->
+  <requires lib="gtk+" version="3.0"/>
+  <object class="GtkDialog" id="AssignFieldsDialog">
+    <property name="can_focus">False</property>
+    <property name="border_width">6</property>
+    <property name="title" translatable="yes">Match Fields</property>
+    <property name="type_hint">dialog</property>
+    <child internal-child="vbox">
+      <object class="GtkBox" id="dialog-vbox1">
+        <property name="can_focus">False</property>
+        <property name="orientation">vertical</property>
+        <property name="spacing">12</property>
+        <child internal-child="action_area">
+          <object class="GtkButtonBox" id="dialog-action_area1">
+            <property name="can_focus">False</property>
+            <property name="layout_style">end</property>
+            <child>
+              <object class="GtkButton" id="ok">
+                <property name="label">gtk-ok</property>
+                <property name="use_action_appearance">False</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="cancel">
+                <property name="label">gtk-cancel</property>
+                <property name="use_action_appearance">False</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="help">
+                <property name="label">gtk-help</property>
+                <property name="use_action_appearance">False</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">2</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="pack_type">end</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkBox" id="box1">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="orientation">vertical</property>
+            <property name="spacing">6</property>
+            <child>
+              <object class="GtkLabel" id="MATCHING_LABEL">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="halign">start</property>
+                <property name="label" translatable="yes">Assign the fields from your data source to match the address elements.</property>
+                <property name="use_underline">True</property>
+                <property name="mnemonic_widget">FIELDS:border</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="swuilo-SwAssignFieldsControl" id="FIELDS:border">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+              </object>
+              <packing>
+                <property name="expand">True</property>
+                <property name="fill">True</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="PREVIEW_LABEL">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="halign">start</property>
+                <property name="label" translatable="yes">Address block preview</property>
+                <property name="use_underline">True</property>
+                <property name="mnemonic_widget">PREVIEW:border</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">2</property>
+              </packing>
+            </child>
+            <child>
+              <object class="swlo-SwAddressPreview" id="PREVIEW:border">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">3</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+    <action-widgets>
+      <action-widget response="0">ok</action-widget>
+      <action-widget response="0">cancel</action-widget>
+      <action-widget response="0">help</action-widget>
+    </action-widgets>
+  </object>
+</interface>


More information about the Libreoffice-commits mailing list