[Libreoffice-commits] .: 3 commits - sfx2/inc sfx2/source sw/inc sw/source sw/uiconfig vcl/inc vcl/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Dec 13 06:59:53 PST 2012


 sfx2/inc/sfx2/sfxdlg.hxx                 |   20 +--
 sfx2/inc/sfx2/tabdlg.hxx                 |   12 +
 sfx2/source/dialog/tabdlg.cxx            |   20 +--
 sfx2/source/view/printer.cxx             |    2 
 sw/inc/swabstdlg.hxx                     |    2 
 sw/source/ui/app/docst.cxx               |  202 ++++++++++++++++++-------------
 sw/source/ui/dialog/swdlgfact.cxx        |   30 ++--
 sw/source/ui/dialog/swdlgfact.hxx        |   19 ++
 sw/source/ui/fmtui/tmpdlg.cxx            |   12 -
 sw/source/ui/inc/tmpdlg.hxx              |    1 
 sw/uiconfig/swriter/ui/captionoptions.ui |   14 +-
 sw/uiconfig/swriter/ui/insertcaption.ui  |   12 +
 vcl/inc/vcl/dialog.hxx                   |    4 
 vcl/source/window/dialog.cxx             |   10 +
 14 files changed, 226 insertions(+), 134 deletions(-)

New commits:
commit 0157f0b1ba364f7f9af2aacd1be9fbb5ddec2b4d
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Dec 13 10:12:13 2012 +0000

    Related: fdo#38606 keep style dialog open when apply is clicked
    
    i.e. don't close and reopen, just stay open
    
    Change-Id: I11cdc492e3c4adfb75c9a0dfa52e5ba351914858

diff --git a/sfx2/inc/sfx2/sfxdlg.hxx b/sfx2/inc/sfx2/sfxdlg.hxx
index 3585645..0465dbb 100644
--- a/sfx2/inc/sfx2/sfxdlg.hxx
+++ b/sfx2/inc/sfx2/sfxdlg.hxx
@@ -55,7 +55,7 @@ namespace com { namespace sun { namespace star { namespace frame {
     class XModel;
 } } } }
 
-class SfxAbstractDialog : public VclAbstractDialog
+class SfxAbstractDialog : virtual public VclAbstractDialog
 {
 public:
     virtual const SfxItemSet*   GetOutputItemSet() const = 0;
@@ -63,15 +63,21 @@ public:
     virtual String              GetText() const = 0;
 };
 
-class SfxAbstractTabDialog : public SfxAbstractDialog
+class SfxAbstractTabDialog : virtual public SfxAbstractDialog
 {
 public:
     virtual void                SetCurPageId( sal_uInt16 nId ) = 0;
-    virtual const sal_uInt16*       GetInputRanges( const SfxItemPool& ) = 0;
+    virtual const sal_uInt16*   GetInputRanges( const SfxItemPool& ) = 0;
     virtual void                SetInputSet( const SfxItemSet* pInSet ) = 0;
 };
 
-class SfxAbstractInsertObjectDialog : public VclAbstractDialog
+class SfxAbstractApplyTabDialog : virtual public SfxAbstractTabDialog
+{
+public:
+    virtual void                SetApplyHdl( const Link& rLink ) = 0;
+};
+
+class SfxAbstractInsertObjectDialog : virtual public VclAbstractDialog
 {
 public:
     virtual com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject > GetObject()=0;
@@ -79,7 +85,7 @@ public:
     virtual sal_Bool IsCreateNew()=0;
 };
 
-class SfxAbstractPasteDialog : public VclAbstractDialog
+class SfxAbstractPasteDialog : virtual public VclAbstractDialog
 {
 public:
     virtual void Insert( SotFormatStringId nFormat, const String & rFormatName ) = 0;
@@ -89,11 +95,11 @@ public:
                         const TransferableObjectDescriptor* pDesc=0 ) = 0;
 };
 
-class SfxAbstractLinksDialog : public VclAbstractDialog
+class SfxAbstractLinksDialog : virtual public VclAbstractDialog
 {
 };
 
-class AbstractScriptSelectorDialog : public VclAbstractDialog
+class AbstractScriptSelectorDialog : virtual public VclAbstractDialog
 {
 public:
     virtual String              GetScriptURL() const = 0;
diff --git a/sfx2/inc/sfx2/tabdlg.hxx b/sfx2/inc/sfx2/tabdlg.hxx
index 6b1e985..c07c012 100644
--- a/sfx2/inc/sfx2/tabdlg.hxx
+++ b/sfx2/inc/sfx2/tabdlg.hxx
@@ -201,7 +201,13 @@ public:
     void                SetApplyHandler(const Link& _rHdl);
 
     SAL_DLLPRIVATE void Start_Impl();
-    SAL_DLLPRIVATE sal_Bool OK_Impl() { return PrepareLeaveCurrentPage(); }
+    bool OK_Impl()
+    {
+        bool bRet = PrepareLeaveCurrentPage();
+        if (bRet)
+            Ok();
+        return bRet;
+    }
 };
 
 namespace sfx { class ItemConnectionBase; }
diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx
index 555680f..a6f8ab5 100644
--- a/sw/inc/swabstdlg.hxx
+++ b/sw/inc/swabstdlg.hxx
@@ -416,7 +416,7 @@ public:
                                                 sal_Bool            bFmt     = sal_False,
                                                 sal_uInt16          nDefPage = 0,
                                                 const String*   pFmtStr  = 0) = 0;  //add for SwFrmDlg
-    virtual SfxAbstractTabDialog*       CreateTemplateDialog( int nResId,
+    virtual SfxAbstractApplyTabDialog*  CreateTemplateDialog(
                                                 Window*             pParent,
                                                 SfxStyleSheetBase&  rBase,
                                                 sal_uInt16              nRegion,
diff --git a/sw/source/ui/app/docst.cxx b/sw/source/ui/app/docst.cxx
index 3685eb1..ad8c702 100644
--- a/sw/source/ui/app/docst.cxx
+++ b/sw/source/ui/app/docst.cxx
@@ -497,6 +497,118 @@ void SwDocShell::ExecStyleSheet( SfxRequest& rReq )
 
 }
 
+class ApplyStyle
+{
+public:
+    ApplyStyle(SwDocShell &rDocSh, bool bNew, SfxStyleSheetBase* pStyle,
+        sal_uInt16 nRet, rtl::Reference< SwDocStyleSheet > xTmp,
+        sal_uInt16 nFamily, SfxAbstractApplyTabDialog *pDlg,
+        rtl::Reference< SfxStyleSheetBasePool > xBasePool,
+        bool bModified)
+        : m_rDocSh(rDocSh)
+        , m_bNew(bNew)
+        , m_pStyle(pStyle)
+        , m_nRet(nRet)
+        , m_xTmp(xTmp)
+        , m_nFamily(nFamily)
+        , m_pDlg(pDlg)
+        , m_xBasePool(xBasePool)
+        , m_bModified(bModified)
+    {
+    }
+    DECL_LINK( ApplyHdl, void* );
+    void apply()
+    {
+        ApplyHdl(NULL);
+    }
+    sal_uInt16 getRet() const { return m_nRet; }
+private:
+    SwDocShell &m_rDocSh;
+    bool m_bNew;
+    SfxStyleSheetBase* m_pStyle;
+    sal_uInt16 m_nRet;
+    rtl::Reference< SwDocStyleSheet > m_xTmp;
+    sal_uInt16 m_nFamily;
+    SfxAbstractApplyTabDialog *m_pDlg;
+    rtl::Reference< SfxStyleSheetBasePool > m_xBasePool;
+    bool m_bModified;
+};
+
+IMPL_LINK_NOARG(ApplyStyle, ApplyHdl)
+{
+    SwWrtShell* pWrtShell = m_rDocSh.GetWrtShell();
+    SwDoc* pDoc = m_rDocSh.GetDoc();
+    SwView* pView = m_rDocSh.GetView();
+
+    pWrtShell->StartAllAction();
+
+    // newly set the mask only with paragraph-templates
+    if( m_bNew )
+    {
+        m_nRet = SFX_STYLE_FAMILY_PARA == m_pStyle->GetFamily()
+                ? m_xTmp->GetMask()
+                : SFXSTYLEBIT_USERDEF;
+    }
+    else if( m_pStyle->GetMask() != m_xTmp->GetMask() )
+        m_nRet = m_xTmp->GetMask();
+
+    if( SFX_STYLE_FAMILY_PARA == m_nFamily )
+    {
+        SfxItemSet aSet( *m_pDlg->GetOutputItemSet() );
+        ::SfxToSwPageDescAttr( *pWrtShell, aSet  );
+        // reset indent attributes at paragraph style, if a list style
+        // will be applied and no indent attributes will be applied.
+        m_xTmp->SetItemSet( aSet, true );
+    }
+    else
+    {
+        if(SFX_STYLE_FAMILY_PAGE == m_nFamily)
+        {
+            static const sal_uInt16 aInval[] = {
+                SID_IMAGE_ORIENTATION,
+                SID_ATTR_CHAR_FONT,
+                FN_INSERT_CTRL, FN_INSERT_OBJ_CTRL, 0};
+            pView->GetViewFrame()->GetBindings().Invalidate(aInval);
+        }
+        SfxItemSet aTmpSet( *m_pDlg->GetOutputItemSet() );
+        if( SFX_STYLE_FAMILY_CHAR == m_nFamily )
+        {
+            const SfxPoolItem *pTmpBrush;
+            if( SFX_ITEM_SET == aTmpSet.GetItemState( RES_BACKGROUND,
+                sal_False, &pTmpBrush ) )
+            {
+                SvxBrushItem aTmpBrush( *((SvxBrushItem*)pTmpBrush) );
+                aTmpBrush.SetWhich( RES_CHRATR_BACKGROUND );
+                aTmpSet.Put( aTmpBrush );
+            }
+            aTmpSet.ClearItem( RES_BACKGROUND );
+        }
+        m_xTmp->SetItemSet( aTmpSet );
+
+        if( SFX_STYLE_FAMILY_PAGE == m_nFamily && SvtLanguageOptions().IsCTLFontEnabled() )
+        {
+            const SfxPoolItem *pItem = NULL;
+            if( aTmpSet.GetItemState( m_rDocSh.GetPool().GetTrueWhich( SID_ATTR_FRAMEDIRECTION, sal_False ) , sal_True, &pItem ) == SFX_ITEM_SET )
+                SwChartHelper::DoUpdateAllCharts( pDoc );
+        }
+    }
+    if(SFX_STYLE_FAMILY_PAGE == m_nFamily)
+        pView->InvalidateRulerPos();
+
+    if( m_bNew )
+        m_xBasePool->Broadcast( SfxStyleSheetHint( SFX_STYLESHEET_CREATED, *m_xTmp.get() ) );
+
+    pDoc->SetModified();
+    if( !m_bModified )    // Bug 57028
+    {
+        pDoc->GetIDocumentUndoRedo().SetUndoNoResetModified();
+    }
+
+    pWrtShell->EndAllAction();
+
+    return m_nRet;
+}
+
 /*--------------------------------------------------------------------
     Description:    Edit
  --------------------------------------------------------------------*/
@@ -654,86 +766,16 @@ sal_uInt16 SwDocShell::Edit( const String &rName, const String &rParent, sal_uIn
         SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric)));
         SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
         OSL_ENSURE(pFact, "Dialogdiet fail!");
-        SfxAbstractTabDialog* pDlg = pFact->CreateTemplateDialog( DLG_TEMPLATE_BASE,
+        SfxAbstractApplyTabDialog* pDlg = pFact->CreateTemplateDialog(
                                                     0, *(xTmp.get()), nFamily, nPageId,
                                                     pActShell ? pActShell : pWrtShell, bNew);
         OSL_ENSURE(pDlg, "Dialogdiet fail!");
-        while (true)
-        {
-            short nButton = pDlg->Execute();
-            if(RET_OK == nButton || RET_APPLY_TEMPLATE == nButton)
-        {
-            GetWrtShell()->StartAllAction();
-
-            // newly set the mask only with paragraph-templates
-            if( bNew )
-            {
-                nRet = SFX_STYLE_FAMILY_PARA == pStyle->GetFamily()
-                        ? xTmp->GetMask()
-                        : SFXSTYLEBIT_USERDEF;
-            }
-            else if( pStyle->GetMask() != xTmp->GetMask() )
-                nRet = xTmp->GetMask();
-
-            if( SFX_STYLE_FAMILY_PARA == nFamily )
-            {
-                SfxItemSet aSet( *pDlg->GetOutputItemSet() );
-                ::SfxToSwPageDescAttr( *GetWrtShell(), aSet  );
-                // reset indent attributes at paragraph style, if a list style
-                // will be applied and no indent attributes will be applied.
-                xTmp->SetItemSet( aSet, true );
-            }
-            else
-            {
-                if(SFX_STYLE_FAMILY_PAGE == nFamily)
-                {
-                    static const sal_uInt16 aInval[] = {
-                        SID_IMAGE_ORIENTATION,
-                        SID_ATTR_CHAR_FONT,
-                        FN_INSERT_CTRL, FN_INSERT_OBJ_CTRL, 0};
-                    pView->GetViewFrame()->GetBindings().Invalidate(aInval);
-                }
-                SfxItemSet aTmpSet( *pDlg->GetOutputItemSet() );
-                if( SFX_STYLE_FAMILY_CHAR == nFamily )
-                {
-                    const SfxPoolItem *pTmpBrush;
-                    if( SFX_ITEM_SET == aTmpSet.GetItemState( RES_BACKGROUND,
-                        sal_False, &pTmpBrush ) )
-                    {
-                        SvxBrushItem aTmpBrush( *((SvxBrushItem*)pTmpBrush) );
-                        aTmpBrush.SetWhich( RES_CHRATR_BACKGROUND );
-                        aTmpSet.Put( aTmpBrush );
-                    }
-                    aTmpSet.ClearItem( RES_BACKGROUND );
-                }
-                xTmp->SetItemSet( aTmpSet );
+        ApplyStyle aApplyStyleHelper(*this, bNew, pStyle, nRet, xTmp, nFamily, pDlg, mxBasePool, bModified);
+        pDlg->SetApplyHdl(LINK(&aApplyStyleHelper, ApplyStyle, ApplyHdl));
 
-                if( SFX_STYLE_FAMILY_PAGE == nFamily && SvtLanguageOptions().IsCTLFontEnabled() )
-                {
-                    const SfxPoolItem *pItem = NULL;
-                    if( aTmpSet.GetItemState( GetPool().GetTrueWhich( SID_ATTR_FRAMEDIRECTION, sal_False ) , sal_True, &pItem ) == SFX_ITEM_SET )
-                        SwChartHelper::DoUpdateAllCharts( pDoc );
-                }
-            }
-            if(SFX_STYLE_FAMILY_PAGE == nFamily)
-                pView->InvalidateRulerPos();
-
-            if( bNew )
-                mxBasePool->Broadcast( SfxStyleSheetHint( SFX_STYLESHEET_CREATED, *xTmp.get() ) );
-
-            // Destroy dialog before EndAction - with page-templates the
-            // ItemSet must be destroyed, so that the cursors get removed
-            // from Headers/Footers. Otherwise "GPF" happen!!!
-            if(RET_OK == nButton)
-                delete pDlg;
-
-            pDoc->SetModified();
-            if( !bModified )    // Bug 57028
-            {
-                pDoc->GetIDocumentUndoRedo().SetUndoNoResetModified();
-            }
-
-            GetWrtShell()->EndAllAction();
+        if (RET_OK == pDlg->Execute())
+        {
+            aApplyStyleHelper.apply();
         }
         else
         {
@@ -745,11 +787,11 @@ sal_uInt16 SwDocShell::Edit( const String &rName, const String &rParent, sal_uIn
 
             if( !bModified )
                 pDoc->ResetModified();
-            delete pDlg;
-        }
-            if(RET_APPLY_TEMPLATE != nButton)
-                break;
         }
+
+        nRet = aApplyStyleHelper.getRet();
+
+        delete pDlg;
     }
     else
     {
diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx
index 8c157c0..437c2bb 100644
--- a/sw/source/ui/dialog/swdlgfact.cxx
+++ b/sw/source/ui/dialog/swdlgfact.cxx
@@ -157,6 +157,19 @@ String AbstractTabDialog_Impl::GetText() const
     return pDlg->GetText();
 }
 
+IMPL_LINK_NOARG(AbstractApplyTabDialog_Impl, ApplyHdl)
+{
+    if (pDlg->OK_Impl())
+        m_aHandler.Call(NULL);
+    return 0;
+}
+
+void AbstractApplyTabDialog_Impl::SetApplyHdl( const Link& rLink )
+{
+    m_aHandler = rLink;
+    pDlg->SetApplyHandler(LINK(this, AbstractApplyTabDialog_Impl, ApplyHdl));
+}
+
 sal_uInt8 AbstractSwInsertAbstractDlg_Impl::GetLevel() const
 {
     return pDlg->GetLevel();
@@ -1103,7 +1116,7 @@ SfxAbstractTabDialog* SwAbstractDialogFactory_Impl::CreateFrmTabDialog( int nRes
     return 0;
 }
 
-SfxAbstractTabDialog* SwAbstractDialogFactory_Impl::CreateTemplateDialog( int nResId,
+SfxAbstractApplyTabDialog* SwAbstractDialogFactory_Impl::CreateTemplateDialog(
                                                 Window*             pParent,
                                                 SfxStyleSheetBase&  rBase,
                                                 sal_uInt16              nRegion,
@@ -1111,19 +1124,8 @@ SfxAbstractTabDialog* SwAbstractDialogFactory_Impl::CreateTemplateDialog( int nR
                                                 SwWrtShell*         pActShell,
                                                 sal_Bool                bNew ) //add for SwTemplateDlg
 {
-    SfxTabDialog* pDlg=NULL;
-    switch ( nResId )
-    {
-        case DLG_TEMPLATE_BASE :
-            pDlg = new SwTemplateDlg( pParent, rBase, nRegion, nPageId, pActShell, bNew );
-            break;
-        default:
-            break;
-    }
-
-    if ( pDlg )
-        return new AbstractTabDialog_Impl( pDlg );
-    return 0;
+    SfxTabDialog* pDlg = new SwTemplateDlg( pParent, rBase, nRegion, nPageId, pActShell, bNew );
+    return new AbstractApplyTabDialog_Impl( pDlg );
 }
 
 AbstractGlossaryDlg* SwAbstractDialogFactory_Impl::CreateGlossaryDlg( int nResId,
diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx
index e8fc6cb..6da4756 100644
--- a/sw/source/ui/dialog/swdlgfact.hxx
+++ b/sw/source/ui/dialog/swdlgfact.hxx
@@ -46,6 +46,7 @@ class DropDownFieldDialog;
 }
 
 #define DECL_ABSTDLG_BASE(Class,DialogClass)        \
+protected:                                          \
     DialogClass*        pDlg;                       \
 public:                                             \
                     Class( DialogClass* p)          \
@@ -53,7 +54,6 @@ public:                                             \
                      {}                             \
     virtual         ~Class();                       \
     virtual short   Execute() ;
-//  virtual void    Show( sal_Bool bVisible = sal_True, sal_uInt16 nFlags = 0 )
 
 #define IMPL_ABSTDLG_BASE(Class)                    \
 Class::~Class()                                     \
@@ -129,7 +129,7 @@ class AbstractSplitTableDialog_Impl : public AbstractSplitTableDialog // add for
 // add for SwBreakDlg end
 
 //add for SwCharDlg , SwEnvDlg , SwFootNoteOptionDlg SwParaDlg  SwTableTabDlg begin
-class AbstractTabDialog_Impl : public SfxAbstractTabDialog
+class AbstractTabDialog_Impl : virtual public SfxAbstractTabDialog
 {
     DECL_ABSTDLG_BASE( AbstractTabDialog_Impl,SfxTabDialog )
     virtual void                SetCurPageId( sal_uInt16 nId );
@@ -142,6 +142,19 @@ class AbstractTabDialog_Impl : public SfxAbstractTabDialog
 };
 //add for SwCharDlg, SwEnvDlg ,SwFootNoteOptionDlg SwParaDlg  SwTableTabDlg end
 
+class AbstractApplyTabDialog_Impl : public AbstractTabDialog_Impl, virtual public SfxAbstractApplyTabDialog
+{
+public:
+    AbstractApplyTabDialog_Impl( SfxTabDialog* p)
+        : AbstractTabDialog_Impl(p)
+    {
+    }
+    DECL_LINK(ApplyHdl, void*);
+private:
+    Link m_aHandler;
+    virtual void                SetApplyHdl( const Link& rLink );
+};
+
 //add for SwConvertTableDlg begin
 class AbstractSwConvertTableDlg_Impl :  public AbstractSwConvertTableDlg // add for SwConvertTableDlg
 {
@@ -484,7 +497,7 @@ public:
                                                 sal_Bool            bFmt     = sal_False,
                                                 sal_uInt16          nDefPage = 0,
                                                 const String*   pFmtStr  = 0); //add for SwFrmDlg
-    virtual SfxAbstractTabDialog*       CreateTemplateDialog( int nResId,
+    virtual SfxAbstractApplyTabDialog*  CreateTemplateDialog(
                                                 Window*             pParent,
                                                 SfxStyleSheetBase&  rBase,
                                                 sal_uInt16              nRegion,
diff --git a/sw/source/ui/fmtui/tmpdlg.cxx b/sw/source/ui/fmtui/tmpdlg.cxx
index 3fca711..8003ed5 100644
--- a/sw/source/ui/fmtui/tmpdlg.cxx
+++ b/sw/source/ui/fmtui/tmpdlg.cxx
@@ -293,24 +293,12 @@ SwTemplateDlg::SwTemplateDlg(Window*            pParent,
 
     }
     EnableApplyButton( true );
-    SetApplyHandler( LINK(this, SwTemplateDlg, ApplyHdl ) );
 }
 
 SwTemplateDlg::~SwTemplateDlg()
 {
 }
 
-IMPL_LINK( SwTemplateDlg, ApplyHdl, void*, pVoid )
-{
-    (void)pVoid; //unused
-    if ( OK_Impl() )
-    {
-        Ok();
-        EndDialog( RET_APPLY_TEMPLATE );
-    }
-    return 0;
-}
-
 short SwTemplateDlg::Ok()
 {
     short nRet = SfxTabDialog::Ok();
diff --git a/sw/source/ui/inc/tmpdlg.hxx b/sw/source/ui/inc/tmpdlg.hxx
index 3d91220..c2ca989 100644
--- a/sw/source/ui/inc/tmpdlg.hxx
+++ b/sw/source/ui/inc/tmpdlg.hxx
@@ -36,7 +36,6 @@ class SwTemplateDlg: public SfxStyleDialog
     sal_Bool        bNewStyle;
 
     DECL_LINK( NumOptionsHdl, PushButton* );
-    DECL_LINK( ApplyHdl, void* );
 
 public:
     SwTemplateDlg(  Window*             pParent,
commit 263da33c4948e879d169e8f714cad43f0143fa8e
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Dec 13 13:48:04 2012 +0000

    expand edits and comboboxes to fill dialog if resized
    
    Change-Id: I468cb3dd2664d7ab05b0c9bd3ffb8e652c7af066

diff --git a/sw/uiconfig/swriter/ui/captionoptions.ui b/sw/uiconfig/swriter/ui/captionoptions.ui
index 25d3295..918a2f1 100644
--- a/sw/uiconfig/swriter/ui/captionoptions.ui
+++ b/sw/uiconfig/swriter/ui/captionoptions.ui
@@ -14,11 +14,14 @@
           <object class="GtkBox" id="box1">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
+            <property name="hexpand">True</property>
+            <property name="vexpand">True</property>
             <property name="orientation">vertical</property>
             <child>
               <object class="GtkFrame" id="frame1">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
+                <property name="hexpand">True</property>
                 <property name="label_xalign">0</property>
                 <property name="shadow_type">none</property>
                 <child>
@@ -32,6 +35,7 @@
                       <object class="GtkGrid" id="grid2">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
+                        <property name="hexpand">True</property>
                         <property name="row_spacing">6</property>
                         <property name="column_spacing">6</property>
                         <property name="column_homogeneous">True</property>
@@ -39,6 +43,7 @@
                           <object class="GtkComboBox" id="level">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
+                            <property name="hexpand">True</property>
                           </object>
                           <packing>
                             <property name="left_attach">1</property>
@@ -51,6 +56,7 @@
                           <object class="GtkEntry" id="separator">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
+                            <property name="hexpand">True</property>
                             <property name="invisible_char">•</property>
                           </object>
                           <packing>
@@ -113,6 +119,7 @@
               <object class="GtkFrame" id="frame2">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
+                <property name="hexpand">True</property>
                 <property name="label_xalign">0</property>
                 <property name="shadow_type">none</property>
                 <child>
@@ -126,6 +133,7 @@
                       <object class="GtkGrid" id="grid1">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
+                        <property name="hexpand">True</property>
                         <property name="row_spacing">6</property>
                         <property name="column_spacing">6</property>
                         <property name="column_homogeneous">True</property>
@@ -148,6 +156,7 @@
                           <object class="GtkComboBox" id="style">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
+                            <property name="hexpand">True</property>
                           </object>
                           <packing>
                             <property name="left_attach">1</property>
@@ -200,6 +209,7 @@
               <object class="GtkFrame" id="frame3">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
+                <property name="hexpand">True</property>
                 <property name="label_xalign">0</property>
                 <property name="shadow_type">none</property>
                 <child>
@@ -213,6 +223,7 @@
                       <object class="GtkGrid" id="grid3">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
+                        <property name="hexpand">True</property>
                         <property name="row_spacing">6</property>
                         <property name="column_spacing">6</property>
                         <property name="column_homogeneous">True</property>
@@ -235,6 +246,7 @@
                           <object class="GtkComboBox" id="caption_order">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
+                            <property name="hexpand">True</property>
                             <property name="model">liststore1</property>
                           </object>
                           <packing>
@@ -267,7 +279,7 @@
             </child>
           </object>
           <packing>
-            <property name="expand">False</property>
+            <property name="expand">True</property>
             <property name="fill">True</property>
             <property name="position">0</property>
           </packing>
diff --git a/sw/uiconfig/swriter/ui/insertcaption.ui b/sw/uiconfig/swriter/ui/insertcaption.ui
index 9af1ea5..b88a3cf 100644
--- a/sw/uiconfig/swriter/ui/insertcaption.ui
+++ b/sw/uiconfig/swriter/ui/insertcaption.ui
@@ -14,12 +14,15 @@
           <object class="GtkBox" id="box1">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
+            <property name="hexpand">True</property>
+            <property name="vexpand">True</property>
             <property name="orientation">vertical</property>
             <property name="spacing">12</property>
             <child>
               <object class="GtkFrame" id="frame1">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
+                <property name="hexpand">True</property>
                 <property name="label_xalign">0</property>
                 <property name="shadow_type">none</property>
                 <child>
@@ -61,6 +64,7 @@
               <object class="GtkFrame" id="frame2">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
+                <property name="hexpand">True</property>
                 <property name="label_xalign">0</property>
                 <property name="shadow_type">none</property>
                 <child>
@@ -72,6 +76,7 @@
                       <object class="GtkGrid" id="grid1">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
+                        <property name="hexpand">True</property>
                         <property name="row_spacing">6</property>
                         <property name="column_spacing">6</property>
                         <child>
@@ -122,6 +127,7 @@
                           <object class="GtkComboBox" id="numbering">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
+                            <property name="hexpand">True</property>
                           </object>
                           <packing>
                             <property name="left_attach">1</property>
@@ -134,6 +140,7 @@
                           <object class="GtkEntry" id="separator_edit">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
+                            <property name="hexpand">True</property>
                             <property name="invisible_char">•</property>
                             <property name="text" translatable="yes">: </property>
                           </object>
@@ -163,6 +170,7 @@
                           <object class="GtkEntry" id="num_seperator_edit">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
+                            <property name="hexpand">True</property>
                             <property name="invisible_char">•</property>
                             <property name="text" translatable="yes">. </property>
                           </object>
@@ -177,6 +185,7 @@
                           <object class="GtkComboBox" id="position">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
+                            <property name="hexpand">True</property>
                           </object>
                           <packing>
                             <property name="left_attach">1</property>
@@ -239,6 +248,7 @@
               <object class="GtkFrame" id="frame3">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
+                <property name="hexpand">True</property>
                 <property name="label_xalign">0</property>
                 <property name="shadow_type">none</property>
                 <child>
@@ -277,7 +287,7 @@
             </child>
           </object>
           <packing>
-            <property name="expand">False</property>
+            <property name="expand">True</property>
             <property name="fill">True</property>
             <property name="position">0</property>
           </packing>
commit d29529cf9badda40eeb151a355fa0e6bd50912db
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Dec 12 15:06:31 2012 +0000

    add get_content_area and get_action_area to Dialog
    
    Change-Id: I147cea986b8152e54586a0296e446652bd695a18

diff --git a/sfx2/inc/sfx2/tabdlg.hxx b/sfx2/inc/sfx2/tabdlg.hxx
index c3e010a..6b1e985 100644
--- a/sfx2/inc/sfx2/tabdlg.hxx
+++ b/sfx2/inc/sfx2/tabdlg.hxx
@@ -65,7 +65,7 @@ friend class SfxTabDialogController;
 
     SfxViewFrame*   pFrame;
 
-    VclVBox *m_pVBox;
+    VclBox *m_pBox;
     TabControl *m_pTabCtrl;
 
     OKButton *m_pOKBtn;
@@ -114,7 +114,7 @@ protected:
     virtual void                PageCreated( sal_uInt16 nId, SfxTabPage &rPage );
     virtual long                Notify( NotifyEvent& rNEvt );
 
-    VclHButtonBox*  m_pActionArea;
+    VclButtonBox*   m_pActionArea;
     SfxItemSet*     pExampleSet;
     SfxItemSet*     GetInputSetImpl();
     SfxTabPage*     GetTabPage( sal_uInt16 nPageId ) const;
diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx
index eda2375..a7574c5 100644
--- a/sfx2/source/dialog/tabdlg.cxx
+++ b/sfx2/source/dialog/tabdlg.cxx
@@ -513,7 +513,7 @@ SfxTabDialog::~SfxTabDialog()
     if (m_bOwnsTabCtrl)
         delete m_pTabCtrl;
     if (m_bOwnsVBox)
-        delete m_pVBox;
+        delete m_pBox;
 }
 
 // -----------------------------------------------------------------------
@@ -526,26 +526,26 @@ void SfxTabDialog::Init_Impl( sal_Bool bFmtFlag, const String* pUserButtonText,
 */
 
 {
-    m_pVBox = m_pUIBuilder ? m_pUIBuilder->get<VclVBox>("dialog-vbox1") : NULL;
-    m_bOwnsVBox = m_pVBox == NULL;
+    m_pBox = get_content_area();
+    m_bOwnsVBox = m_pBox == NULL;
     if (m_bOwnsVBox)
     {
-        m_pVBox = new VclVBox(this, false, 7);
-        m_pVBox->set_expand(true);
+        m_pBox = new VclVBox(this, false, 7);
+        m_pBox->set_expand(true);
     }
 
     m_pTabCtrl = m_pUIBuilder ? m_pUIBuilder->get<TabControl>(SAL_STRINGIFY(ID_TABCONTROL)) : NULL;
     m_bOwnsTabCtrl = m_pTabCtrl == NULL;
     if (m_bOwnsTabCtrl)
     {
-        m_pTabCtrl = new TabControl(m_pVBox, ResId(ID_TABCONTROL, *rResId.GetResMgr()));
+        m_pTabCtrl = new TabControl(m_pBox, ResId(ID_TABCONTROL, *rResId.GetResMgr()));
         m_pTabCtrl->set_expand(true);
     }
 
-    m_pActionArea = m_pUIBuilder ? m_pUIBuilder->get<VclHButtonBox>("dialog-action_area1") : NULL;
+    m_pActionArea = get_action_area();
     m_bOwnsActionArea = m_pActionArea == NULL;
     if (m_bOwnsActionArea)
-        m_pActionArea = new VclHButtonBox(m_pVBox);
+        m_pActionArea = new VclHButtonBox(m_pBox);
 
     m_pOKBtn = m_pUIBuilder ? m_pUIBuilder->get<OKButton>("ok") : NULL;
     m_bOwnsOKBtn = m_pOKBtn == NULL;
@@ -593,7 +593,7 @@ void SfxTabDialog::Init_Impl( sal_Bool bFmtFlag, const String* pUserButtonText,
     m_pTabCtrl->SetDeactivatePageHdl(
             LINK( this, SfxTabDialog, DeactivatePageHdl ) );
     m_pActionArea->Show();
-    m_pVBox->Show();
+    m_pBox->Show();
     m_pTabCtrl->Show();
     m_pOKBtn->Show();
     m_pCancelBtn->Show();
@@ -1084,7 +1084,7 @@ IMPL_LINK_NOARG(SfxTabDialog, OkHdl)
     Handler of the Ok-Buttons
     This calls the current page <SfxTabPage::DeactivatePage(SfxItemSet *)>.
     Returns <SfxTabPage::LEAVE_PAGE>, <SfxTabDialog::Ok()> is called
-    anf the Dialog is ended.
+    and the Dialog is ended.
 */
 
 {
diff --git a/sfx2/source/view/printer.cxx b/sfx2/source/view/printer.cxx
index efdcd6a..7439760 100644
--- a/sfx2/source/view/printer.cxx
+++ b/sfx2/source/view/printer.cxx
@@ -208,7 +208,7 @@ SfxPrintOptionsDialog::SfxPrintOptionsDialog(Window *pParent,
     , pViewSh(pViewShell)
     , pOptions(pSet->Clone())
 {
-    VclContainer *pVBox = m_pUIBuilder->get<VclVBox>("dialog-vbox1");
+    VclContainer *pVBox = get_content_area();
 
     // Insert TabPage
     pPage = pViewSh->CreatePrintOptionsPage(pVBox, *pOptions);
diff --git a/vcl/inc/vcl/dialog.hxx b/vcl/inc/vcl/dialog.hxx
index 3700c8b..6f5b0c0 100644
--- a/vcl/inc/vcl/dialog.hxx
+++ b/vcl/inc/vcl/dialog.hxx
@@ -34,6 +34,8 @@
 // - Dialog -
 // ----------
 struct DialogImpl;
+class VclBox;
+class VclButtonBox;
 class VclContainer;
 
 class VCL_DLLPUBLIC Dialog
@@ -95,6 +97,8 @@ public:
     void            setInitialLayoutSize();
     void            queue_layout();
     virtual bool set_property(const rtl::OString &rKey, const rtl::OString &rValue);
+    VclButtonBox* get_action_area();
+    VclBox* get_content_area();
 
     virtual sal_Bool    Close();
 
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index bea6412..d76d359 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -560,6 +560,16 @@ WinBits Dialog::init(Window *pParent, const ResId& rResId)
     return nStyle;
 }
 
+VclButtonBox* Dialog::get_action_area()
+{
+    return m_pUIBuilder ? m_pUIBuilder->get<VclButtonBox>("dialog-action_area1") : NULL;
+}
+
+VclBox* Dialog::get_content_area()
+{
+    return m_pUIBuilder ? m_pUIBuilder->get<VclBox>("dialog-vbox1") : NULL;
+}
+
 // -----------------------------------------------------------------------
 
 Dialog::~Dialog()


More information about the Libreoffice-commits mailing list