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

Caolán McNamara caolanm at redhat.com
Sat Dec 28 02:52:18 PST 2013


 include/svx/fmresids.hrc     |    1 
 svx/UIConfig_svx.mk          |    1 
 svx/inc/fmhelp.hrc           |    1 
 svx/source/form/datanavi.cxx |   59 +++++++++++++--------------------
 svx/source/form/datanavi.src |   75 -------------------------------------------
 svx/source/inc/datanavi.hrc  |    7 ----
 svx/source/inc/datanavi.hxx  |   34 +++++++------------
 7 files changed, 38 insertions(+), 140 deletions(-)

New commits:
commit 0139ec9dac4b874854326879c776048a5c803e73
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Dec 28 10:16:40 2013 +0000

    convert add condition dialog to .ui
    
    Change-Id: I0cc014909cf49d7cbfadcb5d5d8730395d558eda

diff --git a/include/svx/fmresids.hrc b/include/svx/fmresids.hrc
index 75c6832..e877802 100644
--- a/include/svx/fmresids.hrc
+++ b/include/svx/fmresids.hrc
@@ -61,7 +61,6 @@
 
 // Dialog-Id's -----------------------------------------------------------
 #define RID_SVX_FMEXPLORER                          (RID_FORMS_START + 6)
-#define RID_SVXDLG_ADD_CONDITION                    (RID_FORMS_START + 13)
 #define RID_SVXDLG_NAMESPACE_ITEM                   (RID_FORMS_START + 14)
 
 #define RID_SVXWIN_DATANAVIGATOR                    (RID_FORMS_START + 19)
diff --git a/svx/UIConfig_svx.mk b/svx/UIConfig_svx.mk
index 1f07de4..c337ea5 100644
--- a/svx/UIConfig_svx.mk
+++ b/svx/UIConfig_svx.mk
@@ -11,6 +11,7 @@ $(eval $(call gb_UIConfig_UIConfig,svx))
 
 $(eval $(call gb_UIConfig_add_uifiles,svx,\
 	svx/uiconfig/ui/acceptrejectchangesdialog \
+	svx/uiconfig/ui/addconditiondialog \
 	svx/uiconfig/ui/adddataitemdialog \
 	svx/uiconfig/ui/addinstancedialog \
 	svx/uiconfig/ui/addmodeldialog \
diff --git a/svx/inc/fmhelp.hrc b/svx/inc/fmhelp.hrc
index 96199c7..5238b07 100644
--- a/svx/inc/fmhelp.hrc
+++ b/svx/inc/fmhelp.hrc
@@ -53,7 +53,6 @@
 #define UID_FORMPROPBROWSER_FRAME                             "SVX_UID_FORMPROPBROWSER_FRAME"
 #define UID_ABSOLUTE_RECORD_WINDOW                            "SVX_UID_ABSOLUTE_RECORD_WINDOW"
 #define HID_DATA_NAVIGATOR_WIN                                "SVX_HID_DATA_NAVIGATOR_WIN"
-#define HID_XFORMS_ADDCONDITION_DLG                           "SVX_HID_XFORMS_ADDCONDITION_DLG"
 #define HID_XFORMS_NAMESPACEITEM_DLG                          "SVX_HID_XFORMS_NAMESPACEITEM_DLG"
 #define HID_XFORMS_NAMESPACEITEM_LIST                         "SVX_HID_XFORMS_NAMESPACEITEM_LIST"
 #define HID_MN_XFORMS_MODELS_ADD                              "SVX_HID_MN_XFORMS_MODELS_ADD"
diff --git a/svx/source/form/datanavi.cxx b/svx/source/form/datanavi.cxx
index bfc0a85..200fc87 100644
--- a/svx/source/form/datanavi.cxx
+++ b/svx/source/form/datanavi.cxx
@@ -2763,34 +2763,28 @@ namespace svxform
     // class AddConditionDialog
     //========================================================================
 
-    AddConditionDialog::AddConditionDialog(
-        Window* pParent, const OUString& _rPropertyName,
-        const Reference< XPropertySet >& _rPropSet ) :
-
-        ModalDialog( pParent, SVX_RES( RID_SVXDLG_ADD_CONDITION ) ),
-
-        m_aConditionFT      ( this, SVX_RES( FT_CONDITION ) ),
-        m_aConditionED      ( this, SVX_RES( ED_CONDITION ) ),
-        m_aResultFT         ( this, SVX_RES( FT_RESULT ) ),
-        m_aResultWin        ( this, SVX_RES( FT_RESULT_PREVIEW ) ),
-        m_aEditNamespacesBtn( this, SVX_RES( PB_EDIT_NAMESPACES ) ),
-        m_aButtonsFL        ( this, SVX_RES( FL_DATANAV_BTN ) ),
-        m_aOKBtn            ( this, SVX_RES( BTN_DATANAV_OK ) ),
-        m_aEscBtn           ( this, SVX_RES( BTN_DATANAV_ESC ) ),
-        m_aHelpBtn          ( this, SVX_RES( BTN_DATANAV_HELP ) ),
-
-        m_sPropertyName     ( _rPropertyName ),
-        m_xBinding          ( _rPropSet )
+    AddConditionDialog::AddConditionDialog(Window* pParent,
+        const OUString& _rPropertyName,
+        const Reference< XPropertySet >& _rPropSet)
+        : ModalDialog(pParent, "AddConditionDialog", "svx/ui/addconditiondialog.ui")
+        , m_sPropertyName(_rPropertyName)
+        , m_xBinding(_rPropSet)
 
     {
-        FreeResource();
-
+        get(m_pConditionED, "condition");
+        get(m_pResultWin, "result");
+        get(m_pEditNamespacesBtn, "edit");
+        get(m_pOKBtn, "ok");
         DBG_ASSERT( m_xBinding.is(), "AddConditionDialog::Ctor(): no Binding" );
 
-        m_aResultWin.SetBackground( m_aConditionED.GetBackground() );
-        m_aConditionED.SetModifyHdl( LINK( this, AddConditionDialog, ModifyHdl ) );
-        m_aEditNamespacesBtn.SetClickHdl( LINK( this, AddConditionDialog, EditHdl ) );
-        m_aOKBtn.SetClickHdl( LINK( this, AddConditionDialog, OKHdl ) );
+        m_pConditionED->set_height_request(m_pConditionED->GetTextHeight() * 4);
+        m_pConditionED->set_width_request(m_pConditionED->approximate_char_width() * 62);
+        m_pResultWin->set_height_request(m_pResultWin->GetTextHeight() * 4);
+        m_pResultWin->set_width_request(m_pResultWin->approximate_char_width() * 62);
+
+        m_pConditionED->SetModifyHdl( LINK( this, AddConditionDialog, ModifyHdl ) );
+        m_pEditNamespacesBtn->SetClickHdl( LINK( this, AddConditionDialog, EditHdl ) );
+        m_pOKBtn->SetClickHdl( LINK( this, AddConditionDialog, OKHdl ) );
         m_aResultTimer.SetTimeout( 500 );
         m_aResultTimer.SetTimeoutHdl( LINK( this, AddConditionDialog, ResultHdl ) );
 
@@ -2802,19 +2796,19 @@ namespace svxform
                 if ( ( m_xBinding->getPropertyValue( m_sPropertyName ) >>= sTemp )
                     && !sTemp.isEmpty() )
                 {
-                    m_aConditionED.SetText( sTemp );
+                    m_pConditionED->SetText( sTemp );
                 }
                 else
                 {
 //!                 m_xBinding->setPropertyValue( m_sPropertyName, makeAny( TRUE_VALUE ) );
-                    m_aConditionED.SetText( TRUE_VALUE );
+                    m_pConditionED->SetText( TRUE_VALUE );
                 }
 
                 Reference< css::xforms::XModel > xModel;
                 if ( ( m_xBinding->getPropertyValue( PN_BINDING_MODEL ) >>= xModel ) && xModel.is() )
                     m_xUIHelper = Reference< css::xforms::XFormsUIHelper1 >( xModel, UNO_QUERY );
             }
-            catch ( Exception& )
+            catch (const Exception&)
             {
                 SAL_WARN( "svx.form", "AddConditionDialog::Ctor(): exception caught" );
             }
@@ -2825,11 +2819,6 @@ namespace svxform
     }
 
     //------------------------------------------------------------------------
-    AddConditionDialog::~AddConditionDialog()
-    {
-    }
-
-    //------------------------------------------------------------------------
     IMPL_LINK_NOARG(AddConditionDialog, EditHdl)
     {
         Reference< XNameContainer > xNameContnr;
@@ -2861,7 +2850,7 @@ namespace svxform
         try
         {
             if ( m_xBinding.is() )
-                m_xBinding->setPropertyValue( m_sPropertyName, makeAny( OUString( m_aConditionED.GetText() ) ) );
+                m_xBinding->setPropertyValue( m_sPropertyName, makeAny( OUString( m_pConditionED->GetText() ) ) );
         }
         catch( const Exception& )
         {
@@ -2882,7 +2871,7 @@ namespace svxform
     //------------------------------------------------------------------------
     IMPL_LINK_NOARG(AddConditionDialog, ResultHdl)
     {
-        OUString sCondition = comphelper::string::strip(m_aConditionED.GetText(), ' ');
+        OUString sCondition = comphelper::string::strip(m_pConditionED->GetText(), ' ');
         OUString sResult;
         if ( !sCondition.isEmpty() )
         {
@@ -2895,7 +2884,7 @@ namespace svxform
                 SAL_WARN( "svx.form", "AddConditionDialog::ResultHdl(): exception caught" );
             }
         }
-        m_aResultWin.SetText( sResult );
+        m_pResultWin->SetText( sResult );
         return 0;
     }
 
diff --git a/svx/source/form/datanavi.src b/svx/source/form/datanavi.src
index 15c169c..80b1de9 100644
--- a/svx/source/form/datanavi.src
+++ b/svx/source/form/datanavi.src
@@ -359,81 +359,6 @@ Menu RID_MENU_DATANAVIGATOR
     };
 };
 
-ModalDialog RID_SVXDLG_ADD_CONDITION
-{
-    HelpID = HID_XFORMS_ADDCONDITION_DLG ;
-    OutputSize = TRUE ;
-    SVLook = TRUE ;
-    Size = MAP_APPFONT ( 210 , 150 ) ;
-    Text [ en-US ] = "Add Condition" ;
-    Moveable = TRUE ;
-    FixedText FT_CONDITION
-    {
-        Pos = MAP_APPFONT ( 6 , 3 ) ;
-        Size = MAP_APPFONT ( 198 , 8 ) ;
-        LeftLabel = TRUE ;
-        Text [ en-US ] = "~Condition" ;
-    };
-    MultiLineEdit ED_CONDITION
-    {
-        HelpID = "svx:MultiLineEdit:RID_SVXDLG_ADD_CONDITION:ED_CONDITION";
-        Border = TRUE ;
-        Pos = MAP_APPFONT ( 6 , 14 ) ;
-        Size = MAP_APPFONT ( 198 , 34 ) ;
-        TabStop = TRUE ;
-        Left = TRUE ;
-        IgnoreTab = TRUE;
-    };
-    FixedText FT_RESULT
-    {
-        Pos = MAP_APPFONT ( 6 , 51 ) ;
-        Size = MAP_APPFONT ( 198 , 8 ) ;
-        LeftLabel = TRUE ;
-        Text [ en-US ] = "~Result" ;
-    };
-    FixedText FT_RESULT_PREVIEW
-    {
-        Pos = MAP_APPFONT ( 6 , 62 ) ;
-        Size = MAP_APPFONT ( 198 , 34 ) ;
-        Border = TRUE;
-        TabStop = TRUE ;
-        Left = TRUE ;
-        WordBreak = TRUE ;
-    };
-    PushButton PB_EDIT_NAMESPACES
-    {
-        HelpID = "svx:PushButton:RID_SVXDLG_ADD_CONDITION:PB_EDIT_NAMESPACES";
-        Pos = MAP_APPFONT ( 132 , 102 ) ;
-        Size = MAP_APPFONT ( 72 , 14 ) ;
-        TabStop = TRUE ;
-        Text [ en-US ] = "~Edit Namespaces..." ;
-    };
-    FixedLine FL_DATANAV_BTN
-    {
-        Pos = MAP_APPFONT ( 4 , 119 ) ;
-        Size = MAP_APPFONT ( 202 , 8 ) ;
-    };
-    OKButton BTN_DATANAV_OK
-    {
-        Pos = MAP_APPFONT ( 45 , 130 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-        TabStop = TRUE ;
-        DefButton = TRUE ;
-    };
-    CancelButton BTN_DATANAV_ESC
-    {
-        Pos = MAP_APPFONT ( 98 , 130 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-        TabStop = TRUE ;
-    };
-    HelpButton BTN_DATANAV_HELP
-    {
-        Pos = MAP_APPFONT ( 154 , 130 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-        TabStop = TRUE ;
-    };
-};
-
 ModalDialog RID_SVXDLG_NAMESPACE_ITEM
 {
     HelpID = HID_XFORMS_NAMESPACEITEM_DLG ;
diff --git a/svx/source/inc/datanavi.hrc b/svx/source/inc/datanavi.hrc
index b80726d..23f2a19 100644
--- a/svx/source/inc/datanavi.hrc
+++ b/svx/source/inc/datanavi.hrc
@@ -83,13 +83,6 @@
 #define IID_TEXT                5
 #define IID_OTHER               6
 
-// class AddConditionDialog
-#define FT_CONDITION            10
-#define ED_CONDITION            11
-#define FT_RESULT               12
-#define FT_RESULT_PREVIEW       13
-#define PB_EDIT_NAMESPACES      14
-
 // class NamespaceItemDialog
 #define FT_NAMESPACES           10
 #define LB_NAMESPACES           11
diff --git a/svx/source/inc/datanavi.hxx b/svx/source/inc/datanavi.hxx
index b119f5b..11216aa 100644
--- a/svx/source/inc/datanavi.hxx
+++ b/svx/source/inc/datanavi.hxx
@@ -465,15 +465,10 @@ namespace svxform
     class AddConditionDialog : public ModalDialog
     {
     private:
-        FixedText               m_aConditionFT;
-        MultiLineEdit           m_aConditionED;
-        FixedText               m_aResultFT;
-        FixedText               m_aResultWin;
-        PushButton              m_aEditNamespacesBtn;
-        FixedLine               m_aButtonsFL;
-        OKButton                m_aOKBtn;
-        CancelButton            m_aEscBtn;
-        HelpButton              m_aHelpBtn;
+        VclMultiLineEdit*       m_pConditionED;
+        VclMultiLineEdit*       m_pResultWin;
+        PushButton*             m_pEditNamespacesBtn;
+        OKButton*               m_pOKBtn;
 
         Timer                   m_aResultTimer;
         OUString         m_sPropertyName;
@@ -487,21 +482,18 @@ namespace svxform
         DECL_LINK(OKHdl, void *);
 
     public:
-        AddConditionDialog( Window* pParent,
-            const OUString& _rPropertyName, const XPropertySet_ref& _rBinding );
-        ~AddConditionDialog();
+        AddConditionDialog(Window* pParent,
+            const OUString& _rPropertyName, const XPropertySet_ref& _rBinding);
 
-        inline XFormsUIHelper1_ref  GetUIHelper() const { return m_xUIHelper; }
-        inline OUString             GetCondition() const { return m_aConditionED.GetText(); }
-        inline void                 SetCondition( const OUString& _rCondition );
+        XFormsUIHelper1_ref GetUIHelper() const { return m_xUIHelper; }
+        OUString GetCondition() const { return m_pConditionED->GetText(); }
+        void SetCondition(const OUString& _rCondition)
+        {
+            m_pConditionED->SetText(_rCondition);
+            m_aResultTimer.Start();
+        }
     };
 
-    inline void AddConditionDialog::SetCondition( const OUString& _rCondition )
-    {
-        m_aConditionED.SetText( _rCondition );
-        m_aResultTimer.Start();
-    }
-
     //========================================================================
     class NamespaceItemDialog : public ModalDialog
     {


More information about the Libreoffice-commits mailing list