[Libreoffice-commits] .: Branch 'feature/cmclayouttrans' - 3 commits - sw/inc sw/source sw/uiconfig sw/UI_swriter.mk vcl/inc vcl/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Sep 25 03:36:36 PDT 2012


 sw/UI_swriter.mk                          |    1 
 sw/inc/helpid.h                           |    1 
 sw/inc/swabstdlg.hxx                      |    1 
 sw/source/core/doc/tblafmt.cxx            |    3 
 sw/source/ui/app/app.src                  |   70 ++++++
 sw/source/ui/dbui/dbinsdlg.cxx            |    2 
 sw/source/ui/dialog/swdlgfact.cxx         |   22 -
 sw/source/ui/dialog/swdlgfact.hxx         |    1 
 sw/source/ui/inc/app.hrc                  |   17 +
 sw/source/ui/inc/table.hrc                |    2 
 sw/source/ui/inc/tautofmt.hxx             |   29 +-
 sw/source/ui/shells/tabsh.cxx             |    2 
 sw/source/ui/table/convert.cxx            |    2 
 sw/source/ui/table/instable.cxx           |    2 
 sw/source/ui/table/tautofmt.cxx           |  233 ++++++++++----------
 sw/source/ui/table/tautofmt.hrc           |   14 -
 sw/source/ui/table/tautofmt.src           |  190 ----------------
 sw/uiconfig/swriter/ui/autoformattable.ui |  341 ++++++++++++++++++++++++++++++
 vcl/inc/svids.hrc                         |    2 
 vcl/source/src/btntext.src                |   10 
 vcl/source/window/builder.cxx             |   42 ++-
 21 files changed, 613 insertions(+), 374 deletions(-)

New commits:
commit d8145c8c64a00ed1dd53c7fd5f903323d6600d33
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Sep 25 11:35:47 2012 +0100

    adapt code to new table autoformat dialog
    
    Change-Id: I7bc8c1b37fa9757c5d47902d54865d0319135517

diff --git a/sw/UI_swriter.mk b/sw/UI_swriter.mk
index a9371ff..9a3338c 100644
--- a/sw/UI_swriter.mk
+++ b/sw/UI_swriter.mk
@@ -10,6 +10,7 @@
 $(eval $(call gb_UI_UI,modules/swriter))
 
 $(eval $(call gb_UI_add_uifiles,modules/swriter,\
+	sw/uiconfig/swriter/ui/autoformattable \
 	sw/uiconfig/swriter/ui/charurlpage \
 	sw/uiconfig/swriter/ui/columnwidth \
 	sw/uiconfig/swriter/ui/converttexttable \
diff --git a/sw/inc/helpid.h b/sw/inc/helpid.h
index 9675f30..46581d9 100644
--- a/sw/inc/helpid.h
+++ b/sw/inc/helpid.h
@@ -609,7 +609,6 @@
 #define HID_TABLE_DELETE_ROW                                    "SW_HID_TABLE_DELETE_ROW"
 #define HID_TABLE_DELETE_COL                                    "SW_HID_TABLE_DELETE_COL"
 #define HID_TABLE_MERGE_CELLS                                   "SW_HID_TABLE_MERGE_CELLS"
-#define HID_AUTOFMT_TABLE                                       "SW_HID_AUTOFMT_TABLE"
 #define HID_SWDLG_STRINPUT                                      "SW_HID_SWDLG_STRINPUT"
 #define HID_TABLE_SET_ULSPACE                                   "SW_HID_TABLE_SET_ULSPACE"
 #define HID_TABLE_SET_GRID                                      "SW_HID_TABLE_SET_GRID"
diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx
index 1d86404..502d4ab 100644
--- a/sw/inc/swabstdlg.hxx
+++ b/sw/inc/swabstdlg.hxx
@@ -399,7 +399,6 @@ public:
     virtual AbstractSplitTableDialog * CreateSplitTblDialog ( Window * pParent, SwWrtShell &rSh ) = 0; //add for  SwSplitTblDlg
 
     virtual AbstractSwAutoFormatDlg * CreateSwAutoFormatDlg( Window* pParent, SwWrtShell* pShell, //add for SwAutoFormatDlg
-                                                            int nResId,
                                                             sal_Bool bSetAutoFmt = sal_True,
                                                             const SwTableAutoFmt* pSelFmt = 0 ) = 0;
     virtual SfxAbstractDialog * CreateSwBorderDlg ( Window* pParent, SfxItemSet& rSet, sal_uInt16 nType, int nResId ) = 0;//add for SwBorderDlg
diff --git a/sw/source/ui/app/app.src b/sw/source/ui/app/app.src
index dfec7f3..b4f0e5d 100644
--- a/sw/source/ui/app/app.src
+++ b/sw/source/ui/app/app.src
@@ -570,6 +570,76 @@ String STR_SYMBOL
     Text [ en-US ] = "Symbol" ;
 };
 
+String STR_ADD_AUTOFORMAT_TITLE
+{
+    Text [ en-US ] = "Add AutoFormat" ;
+};
+
+String STR_ADD_AUTOFORMAT_LABEL
+{
+    Text [ en-US ] = "Name" ;
+};
+
+String STR_DEL_AUTOFORMAT_TITLE
+{
+    Text [ en-US ] = "Delete AutoFormat" ;
+};
+
+String STR_DEL_AUTOFORMAT_MSG
+{
+    Text [ en-US ] = "The following AutoFormat entry will be deleted:" ;
+};
+
+String STR_RENAME_AUTOFORMAT_TITLE
+{
+    Text [ en-US ] = "Rename AutoFormat" ;
+};
+
+String STR_BTN_AUTOFORMAT_CLOSE
+{
+    Text [ en-US ] = "~Close" ;
+};
+
+String STR_JAN
+{
+    Text [ en-US ] = "Jan" ;
+};
+
+String STR_FEB
+{
+    Text [ en-US ] = "Feb" ;
+};
+
+String STR_MAR
+{
+    Text [ en-US ] = "Mar" ;
+};
+
+String STR_NORTH
+{
+    Text [ en-US ] = "North" ;
+};
+
+String STR_MID
+{
+    Text [ en-US ] = "Mid" ;
+};
+
+String STR_SOUTH
+{
+    Text [ en-US ] = "South" ;
+};
+
+String STR_SUM
+{
+    Text [ en-US ] = "Sum" ;
+};
+
+String STR_INVALID_AUTOFORMAT_NAME
+{
+    Text [ en-US ] = "You have entered an invalid name.\nThe desired AutoFormat could not be created. \nTry again using a different name." ;
+};
+
 ToolBox RID_MODULE_TOOLBOX
 {
     HelpID = HID_MODULE_TOOLBOX ;
diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx
index 8d2cf87..39ba036 100644
--- a/sw/source/ui/dbui/dbinsdlg.cxx
+++ b/sw/source/ui/dbui/dbinsdlg.cxx
@@ -783,7 +783,7 @@ IMPL_LINK( SwInsertDBColAutoPilot, AutoFmtHdl, PushButton*, pButton )
     SwAbstractDialogFactory* pFact = swui::GetFactory();
     OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
 
-    AbstractSwAutoFormatDlg* pDlg = pFact->CreateSwAutoFormatDlg(pButton, pView->GetWrtShellPtr(),DLG_AUTOFMT_TABLE, sal_False, pTAutoFmt);
+    AbstractSwAutoFormatDlg* pDlg = pFact->CreateSwAutoFormatDlg(pButton, pView->GetWrtShellPtr(), sal_False, pTAutoFmt);
     OSL_ENSURE(pDlg, "Dialogdiet fail!");
     if( RET_OK == pDlg->Execute())
         pDlg->FillAutoFmtOfIndex( pTAutoFmt );
diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx
index 6efcfc7..aad8ecb 100644
--- a/sw/source/ui/dialog/swdlgfact.cxx
+++ b/sw/source/ui/dialog/swdlgfact.cxx
@@ -974,25 +974,11 @@ AbstractSwSelGlossaryDlg * SwAbstractDialogFactory_Impl::CreateSwSelGlossaryDlg
     return 0;
 }
 
-AbstractSwAutoFormatDlg * SwAbstractDialogFactory_Impl::CreateSwAutoFormatDlg( Window* pParent, SwWrtShell* pShell,
-                                                                                    int nResId,
-                                                                                    sal_Bool bSetAutoFmt,
-                                                                                    const SwTableAutoFmt* pSelFmt )
+AbstractSwAutoFormatDlg * SwAbstractDialogFactory_Impl::CreateSwAutoFormatDlg(Window* pParent,
+    SwWrtShell* pShell, sal_Bool bSetAutoFmt, const SwTableAutoFmt* pSelFmt)
 {
-    SwAutoFormatDlg* pDlg=NULL;
-    switch ( nResId )
-    {
-        case DLG_AUTOFMT_TABLE :
-            pDlg = new SwAutoFormatDlg( pParent, pShell,bSetAutoFmt,pSelFmt);
-            break;
-
-        default:
-            break;
-    }
-
-    if ( pDlg )
-        return new AbstractSwAutoFormatDlg_Impl( pDlg );
-    return 0;
+    SwAutoFormatDlg* pDlg = new SwAutoFormatDlg(pParent, pShell, bSetAutoFmt, pSelFmt);
+    return new AbstractSwAutoFormatDlg_Impl(pDlg);
 }
 
 SfxAbstractDialog * SwAbstractDialogFactory_Impl::CreateSwBorderDlg (Window* pParent, SfxItemSet& rSet, sal_uInt16 nType,int nResId )
diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx
index 4abcabd..8a158d1 100644
--- a/sw/source/ui/dialog/swdlgfact.hxx
+++ b/sw/source/ui/dialog/swdlgfact.hxx
@@ -478,7 +478,6 @@ public:
     virtual AbstractSplitTableDialog * CreateSplitTblDialog ( Window * pParent, SwWrtShell &rSh ); //add for  SwSplitTblDlg
 
     virtual AbstractSwAutoFormatDlg * CreateSwAutoFormatDlg( Window* pParent, SwWrtShell* pShell, //add for SwAutoFormatDlg
-                                                            int nResId,
                                                             sal_Bool bSetAutoFmt = sal_True,
                                                             const SwTableAutoFmt* pSelFmt = 0 );
     virtual SfxAbstractDialog * CreateSwBorderDlg (Window* pParent, SfxItemSet& rSet, sal_uInt16 nType,int nResId );//add for SwBorderDlg
diff --git a/sw/source/ui/inc/app.hrc b/sw/source/ui/inc/app.hrc
index 8c61154..8346d0e 100644
--- a/sw/source/ui/inc/app.hrc
+++ b/sw/source/ui/inc/app.hrc
@@ -97,7 +97,22 @@
 #define STR_STATUSBAR_WORDCOUNT_NO_SELECTION (RC_APP_BEGIN + 110)
 #define STR_STATUSBAR_WORDCOUNT              (RC_APP_BEGIN + 111)
 
-#define APP_ACT_END                     STR_STATUSBAR_WORDCOUNT
+#define STR_ADD_AUTOFORMAT_TITLE        (RC_APP_BEGIN + 112)
+#define STR_ADD_AUTOFORMAT_LABEL        (RC_APP_BEGIN + 113)
+#define STR_DEL_AUTOFORMAT_TITLE        (RC_APP_BEGIN + 114)
+#define STR_DEL_AUTOFORMAT_MSG          (RC_APP_BEGIN + 115)
+#define STR_RENAME_AUTOFORMAT_TITLE     (RC_APP_BEGIN + 116)
+#define STR_BTN_AUTOFORMAT_CLOSE        (RC_APP_BEGIN + 117)
+#define STR_INVALID_AUTOFORMAT_NAME     (RC_APP_BEGIN + 118)
+#define STR_JAN                         (RC_APP_BEGIN + 119)
+#define STR_FEB                         (RC_APP_BEGIN + 120)
+#define STR_MAR                         (RC_APP_BEGIN + 121)
+#define STR_NORTH                       (RC_APP_BEGIN + 122)
+#define STR_MID                         (RC_APP_BEGIN + 123)
+#define STR_SOUTH                       (RC_APP_BEGIN + 124)
+#define STR_SUM                         (RC_APP_BEGIN + 125)
+
+#define APP_ACT_END                     STR_SUM
 
 #if APP_ACT_END > RC_APP_END
 #error Resource-Id Ueberlauf in #file, #line
diff --git a/sw/source/ui/inc/table.hrc b/sw/source/ui/inc/table.hrc
index f41bc6d..3844cbb 100644
--- a/sw/source/ui/inc/table.hrc
+++ b/sw/source/ui/inc/table.hrc
@@ -25,7 +25,7 @@
 
 #define MSG_ERR_TABLE_MERGE     (RC_TABLE_BEGIN + 7)
 
-#define DLG_AUTOFMT_TABLE       (RC_TABLE_BEGIN + 9)
+
 #define DLG_SWDLG_STRINPUT      (RC_TABLE_BEGIN + 10)
 #define TP_TABLE_COLUMN         (RC_TABLE_BEGIN + 11)
 #define DLG_INSERT_CHART        (RC_TABLE_BEGIN + 12)
diff --git a/sw/source/ui/inc/tautofmt.hxx b/sw/source/ui/inc/tautofmt.hxx
index ef1ef18..8f8d29a 100644
--- a/sw/source/ui/inc/tautofmt.hxx
+++ b/sw/source/ui/inc/tautofmt.hxx
@@ -52,21 +52,18 @@ enum AutoFmtLine { TOP_LINE, BOTTOM_LINE, LEFT_LINE, RIGHT_LINE };
 
 class SwAutoFormatDlg : public SfxModalDialog
 {
-    FixedLine       aFlFormat;
-    ListBox         aLbFormat;
-    FixedLine       aFlFormats;
-    CheckBox        aBtnNumFormat;
-    CheckBox        aBtnBorder;
-    CheckBox        aBtnFont;
-    CheckBox        aBtnPattern;
-    CheckBox        aBtnAlignment;
-    OKButton        aBtnOk;
-    CancelButton    aBtnCancel;
-    HelpButton      aBtnHelp;
-    PushButton      aBtnAdd;
-    PushButton      aBtnRemove;
-    PushButton      aBtnRename;
-    MoreButton      aBtnMore;
+    ListBox*        m_pLbFormat;
+    VclContainer*   m_pFormatting;
+    CheckBox*       m_pBtnNumFormat;
+    CheckBox*       m_pBtnBorder;
+    CheckBox*       m_pBtnFont;
+    CheckBox*       m_pBtnPattern;
+    CheckBox*       m_pBtnAlignment;
+    OKButton*       m_pBtnOk;
+    CancelButton*   m_pBtnCancel;
+    PushButton*     m_pBtnAdd;
+    PushButton*     m_pBtnRemove;
+    PushButton*     m_pBtnRename;
     String          aStrTitle;
     String          aStrLabel;
     String          aStrClose;
@@ -74,7 +71,7 @@ class SwAutoFormatDlg : public SfxModalDialog
     String          aStrDelMsg;
     String          aStrRenameTitle;
     String          aStrInvalidFmt;
-    AutoFmtPreview* pWndPreview;
+    AutoFmtPreview* m_pWndPreview;
 
     //------------------------
     SwWrtShell*             pShell;
diff --git a/sw/source/ui/shells/tabsh.cxx b/sw/source/ui/shells/tabsh.cxx
index 2e14c57..fe8fa48 100644
--- a/sw/source/ui/shells/tabsh.cxx
+++ b/sw/source/ui/shells/tabsh.cxx
@@ -809,7 +809,7 @@ void SwTableShell::Execute(SfxRequest &rReq)
             SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
             OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
 
-            AbstractSwAutoFormatDlg* pDlg = pFact->CreateSwAutoFormatDlg(&GetView().GetViewFrame()->GetWindow(), &rSh , DLG_AUTOFMT_TABLE );
+            AbstractSwAutoFormatDlg* pDlg = pFact->CreateSwAutoFormatDlg(&GetView().GetViewFrame()->GetWindow(), &rSh);
             OSL_ENSURE(pDlg, "Dialogdiet fail!");
             pDlg->Execute();
             delete pDlg;
diff --git a/sw/source/ui/table/convert.cxx b/sw/source/ui/table/convert.cxx
index e2066b6..55495b8 100644
--- a/sw/source/ui/table/convert.cxx
+++ b/sw/source/ui/table/convert.cxx
@@ -206,7 +206,7 @@ IMPL_LINK( SwConvertTableDlg, AutoFmtHdl, PushButton*, pButton )
     SwAbstractDialogFactory* pFact = swui::GetFactory();
     OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
 
-    AbstractSwAutoFormatDlg* pDlg = pFact->CreateSwAutoFormatDlg(pButton, pShell, DLG_AUTOFMT_TABLE, sal_False, pTAutoFmt);
+    AbstractSwAutoFormatDlg* pDlg = pFact->CreateSwAutoFormatDlg(pButton, pShell, sal_False, pTAutoFmt);
     OSL_ENSURE(pDlg, "Dialogdiet fail!");
     if( RET_OK == pDlg->Execute())
         pDlg->FillAutoFmtOfIndex( pTAutoFmt );
diff --git a/sw/source/ui/table/instable.cxx b/sw/source/ui/table/instable.cxx
index 3f8e5c6..d2c1834 100644
--- a/sw/source/ui/table/instable.cxx
+++ b/sw/source/ui/table/instable.cxx
@@ -201,7 +201,7 @@ IMPL_LINK( SwInsTableDlg, AutoFmtHdl, PushButton*, pButton )
     SwAbstractDialogFactory* pFact = swui::GetFactory();
     OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
 
-    AbstractSwAutoFormatDlg* pDlg = pFact->CreateSwAutoFormatDlg(pButton,pShell, DLG_AUTOFMT_TABLE, sal_False, pTAutoFmt );
+    AbstractSwAutoFormatDlg* pDlg = pFact->CreateSwAutoFormatDlg(pButton,pShell, sal_False, pTAutoFmt);
     OSL_ENSURE(pDlg, "Dialogdiet fail!");
     if( RET_OK == pDlg->Execute())
         pDlg->FillAutoFmtOfIndex( pTAutoFmt );
diff --git a/sw/source/ui/table/tautofmt.cxx b/sw/source/ui/table/tautofmt.cxx
index 984d09e..974e231 100644
--- a/sw/source/ui/table/tautofmt.cxx
+++ b/sw/source/ui/table/tautofmt.cxx
@@ -31,10 +31,8 @@
 #undef SW_DLLIMPLEMENTATION
 #endif
 
-
-
-
 #include <vcl/edit.hxx>
+#include <vcl/layout.hxx>
 #include <vcl/msgbox.hxx>
 #include <vcl/svapp.hxx>
 #include <svl/zforlist.hxx>
@@ -44,6 +42,7 @@
 #include <svtools/scriptedtext.hxx>
 #include <svtools/accessibilityoptions.hxx>
 #include <svx/framelinkarray.hxx>
+#include "app.hrc"
 #include "swmodule.hxx"
 #include "swtypes.hxx"
 #include "view.hxx"
@@ -62,11 +61,14 @@ using namespace com::sun::star;
 class AutoFmtPreview : public Window
 {
 public:
-            AutoFmtPreview( Window* pParent, const ResId& rRes, SwWrtShell* pWrtShell );
-            ~AutoFmtPreview();
+    AutoFmtPreview(Window* pParent);
+    ~AutoFmtPreview();
 
     void NotifyChange( const SwTableAutoFmt& rNewData );
 
+    void DetectRTL(SwWrtShell* pWrtShell);
+
+    virtual void Resize();
 protected:
     virtual void Paint( const Rectangle& rRect );
 
@@ -169,45 +171,40 @@ SwStringInputDlg::~SwStringInputDlg()
 
 SwAutoFormatDlg::SwAutoFormatDlg( Window* pParent, SwWrtShell* pWrtShell,
                     sal_Bool bSetAutoFormat, const SwTableAutoFmt* pSelFmt )
-    : SfxModalDialog( pParent, SW_RES( DLG_AUTOFMT_TABLE ) ),
-    //
-    aFlFormat       ( this, SW_RES( FL_FORMAT ) ),
-    aLbFormat       ( this, SW_RES( LB_FORMAT ) ),
-    aFlFormats       ( this, SW_RES( FL_FORMATS ) ),
-
-    aBtnNumFormat   ( this, SW_RES( BTN_NUMFORMAT ) ),
-    aBtnBorder      ( this, SW_RES( BTN_BORDER ) ),
-    aBtnFont        ( this, SW_RES( BTN_FONT ) ),
-    aBtnPattern     ( this, SW_RES( BTN_PATTERN ) ),
-    aBtnAlignment   ( this, SW_RES( BTN_ALIGNMENT ) ),
-    aBtnOk          ( this, SW_RES( BTN_OK ) ),
-    aBtnCancel      ( this, SW_RES( BTN_CANCEL ) ),
-    aBtnHelp        ( this, SW_RES( BTN_HELP ) ),
-    aBtnAdd         ( this, SW_RES( BTN_ADD ) ),
-    aBtnRemove      ( this, SW_RES( BTN_REMOVE ) ),
-    aBtnRename      ( this, SW_RES( BTN_RENAME ) ),
-    aBtnMore        ( this, SW_RES( BTN_MORE ) ),
-    aStrTitle       ( SW_RES( STR_ADD_TITLE ) ),
-    aStrLabel       ( SW_RES( STR_ADD_LABEL ) ),
-    aStrClose       ( SW_RES( STR_BTN_CLOSE ) ),
-    aStrDelTitle    ( SW_RES( STR_DEL_TITLE ) ),
-    aStrDelMsg      ( SW_RES( STR_DEL_MSG ) ),
-    aStrRenameTitle ( SW_RES( STR_RENAME_TITLE ) ),
-    aStrInvalidFmt  ( SW_RES( STR_INVALID_AFNAME )),
-    pWndPreview     ( new AutoFmtPreview( this, SW_RES( WND_PREVIEW ), pWrtShell )),
-    //
-    pShell          ( pWrtShell ),
-    nIndex          ( 0 ),
-    nDfltStylePos   ( 0 ),
-    bCoreDataChanged( sal_False ),
-    bSetAutoFmt     ( bSetAutoFormat )
+    : SfxModalDialog(pParent, "AutoFormatTableDialog", "modules/swriter/ui/autoformattable.ui")
+    , aStrTitle(SW_RES(STR_ADD_AUTOFORMAT_TITLE))
+    , aStrLabel(SW_RES(STR_ADD_AUTOFORMAT_LABEL))
+    , aStrClose(SW_RES(STR_BTN_AUTOFORMAT_CLOSE))
+    , aStrDelTitle(SW_RES(STR_DEL_AUTOFORMAT_TITLE))
+    , aStrDelMsg(SW_RES(STR_DEL_AUTOFORMAT_MSG))
+    , aStrRenameTitle(SW_RES(STR_RENAME_AUTOFORMAT_TITLE))
+    , aStrInvalidFmt(SW_RES(STR_INVALID_AUTOFORMAT_NAME))
+    , pShell(pWrtShell)
+    , nIndex(0)
+    , nDfltStylePos(0)
+    , bCoreDataChanged(sal_False)
+    , bSetAutoFmt(bSetAutoFormat)
 {
+    get(m_pLbFormat, "formatlb");
+    get(m_pFormatting, "formatting");
+    get(m_pBtnNumFormat, "numformatcb");
+    get(m_pBtnBorder, "bordercb");
+    get(m_pBtnFont, "fontcb");
+    get(m_pBtnPattern, "patterncb");
+    get(m_pBtnAlignment, "alignmentcb");
+    get(m_pBtnOk, "ok");
+    get(m_pBtnCancel, "cancel");
+    get(m_pBtnAdd, "add");
+    get(m_pBtnRemove, "remove");
+    get(m_pBtnRename, "rename");
+    get(m_pWndPreview, "preview");
+
+    m_pWndPreview->DetectRTL(pWrtShell);
+
     pTableTbl = new SwTableAutoFmtTbl;
     pTableTbl->Load();
 
-    Init( pSelFmt );
-    //------------- >
-    FreeResource();
+    Init(pSelFmt);
 }
 
 //------------------------------------------------------------------------
@@ -215,9 +212,7 @@ SwAutoFormatDlg::SwAutoFormatDlg( Window* pParent, SwWrtShell* pWrtShell,
 
 SwAutoFormatDlg::~SwAutoFormatDlg()
 {
-    delete pWndPreview;
-
-    if( bCoreDataChanged )
+    if (bCoreDataChanged)
         pTableTbl->Save();
     delete pTableTbl;
 }
@@ -228,33 +223,25 @@ SwAutoFormatDlg::~SwAutoFormatDlg()
 void SwAutoFormatDlg::Init( const SwTableAutoFmt* pSelFmt )
 {
     Link aLk( LINK( this, SwAutoFormatDlg, CheckHdl ) );
-    aBtnBorder.SetClickHdl( aLk );
-    aBtnFont.SetClickHdl( aLk );
-    aBtnPattern.SetClickHdl( aLk );
-    aBtnAlignment.SetClickHdl( aLk );
-    aBtnNumFormat.SetClickHdl( aLk );
-
-    aBtnAdd.SetClickHdl ( LINK( this, SwAutoFormatDlg, AddHdl ) );
-    aBtnRemove.SetClickHdl ( LINK( this, SwAutoFormatDlg, RemoveHdl ) );
-    aBtnRename.SetClickHdl ( LINK( this, SwAutoFormatDlg, RenameHdl ) );
-    aBtnOk.SetClickHdl ( LINK( this, SwAutoFormatDlg, OkHdl ) );
-    aLbFormat.SetSelectHdl( LINK( this, SwAutoFormatDlg, SelFmtHdl ) );
-
-    aBtnMore.AddWindow( &aBtnNumFormat );
-    aBtnMore.AddWindow( &aBtnBorder );
-    aBtnMore.AddWindow( &aBtnFont );
-    aBtnMore.AddWindow( &aBtnPattern );
-    aBtnMore.AddWindow( &aBtnAlignment );
-    aBtnMore.AddWindow( &aFlFormats );
-    aBtnMore.AddWindow( &aBtnRename );
-
-    aBtnAdd.Enable( bSetAutoFmt );
+    m_pBtnBorder->SetClickHdl( aLk );
+    m_pBtnFont->SetClickHdl( aLk );
+    m_pBtnPattern->SetClickHdl( aLk );
+    m_pBtnAlignment->SetClickHdl( aLk );
+    m_pBtnNumFormat->SetClickHdl( aLk );
+
+    m_pBtnAdd->SetClickHdl ( LINK( this, SwAutoFormatDlg, AddHdl ) );
+    m_pBtnRemove->SetClickHdl ( LINK( this, SwAutoFormatDlg, RemoveHdl ) );
+    m_pBtnRename->SetClickHdl ( LINK( this, SwAutoFormatDlg, RenameHdl ) );
+    m_pBtnOk->SetClickHdl ( LINK( this, SwAutoFormatDlg, OkHdl ) );
+    m_pLbFormat->SetSelectHdl( LINK( this, SwAutoFormatDlg, SelFmtHdl ) );
+
+    m_pBtnAdd->Enable( bSetAutoFmt );
 
     nIndex = 0;
     if( !bSetAutoFmt )
     {
         // dann muss die Liste um den Eintrag <Keins> erweitert werden.
-        aLbFormat.InsertEntry( ViewShell::GetShellRes()->aStrNone );
+        m_pLbFormat->InsertEntry( ViewShell::GetShellRes()->aStrNone );
         nDfltStylePos = 1;
         nIndex = 255;
     }
@@ -263,12 +250,12 @@ void SwAutoFormatDlg::Init( const SwTableAutoFmt* pSelFmt )
             i < nCount; i++)
     {
         SwTableAutoFmt const& rFmt = (*pTableTbl)[ i ];
-        aLbFormat.InsertEntry(rFmt.GetName());
+        m_pLbFormat->InsertEntry(rFmt.GetName());
         if (pSelFmt && rFmt.GetName() == pSelFmt->GetName())
             nIndex = i;
     }
 
-    aLbFormat.SelectEntryPos( 255 != nIndex ? (nDfltStylePos + nIndex) : 0 );
+    m_pLbFormat->SelectEntryPos( 255 != nIndex ? (nDfltStylePos + nIndex) : 0 );
     SelFmtHdl( 0 );
 }
 
@@ -277,20 +264,20 @@ void SwAutoFormatDlg::Init( const SwTableAutoFmt* pSelFmt )
 
 void SwAutoFormatDlg::UpdateChecks( const SwTableAutoFmt& rFmt, sal_Bool bEnable )
 {
-    aBtnNumFormat.Enable( bEnable );
-    aBtnNumFormat.Check( rFmt.IsValueFormat() );
+    m_pBtnNumFormat->Enable( bEnable );
+    m_pBtnNumFormat->Check( rFmt.IsValueFormat() );
 
-    aBtnBorder.Enable( bEnable );
-    aBtnBorder.Check( rFmt.IsFrame() );
+    m_pBtnBorder->Enable( bEnable );
+    m_pBtnBorder->Check( rFmt.IsFrame() );
 
-    aBtnFont.Enable( bEnable );
-    aBtnFont.Check( rFmt.IsFont() );
+    m_pBtnFont->Enable( bEnable );
+    m_pBtnFont->Check( rFmt.IsFont() );
 
-    aBtnPattern.Enable( bEnable );
-    aBtnPattern.Check( rFmt.IsBackground() );
+    m_pBtnPattern->Enable( bEnable );
+    m_pBtnPattern->Check( rFmt.IsBackground() );
 
-    aBtnAlignment.Enable( bEnable );
-    aBtnAlignment.Check( rFmt.IsJustify() );
+    m_pBtnAlignment->Enable( bEnable );
+    m_pBtnAlignment->Check( rFmt.IsJustify() );
 }
 
 void SwAutoFormatDlg::FillAutoFmtOfIndex( SwTableAutoFmt*& rToFill ) const
@@ -317,15 +304,15 @@ IMPL_LINK( SwAutoFormatDlg, CheckHdl, Button *, pBtn )
     SwTableAutoFmt* pData  = &(*pTableTbl)[nIndex];
     sal_Bool bCheck = ((CheckBox*)pBtn)->IsChecked(), bDataChgd = sal_True;
 
-    if( pBtn == &aBtnNumFormat )
+    if( pBtn == m_pBtnNumFormat )
         pData->SetValueFormat( bCheck );
-    else if ( pBtn == &aBtnBorder )
+    else if ( pBtn == m_pBtnBorder )
         pData->SetFrame( bCheck );
-    else if ( pBtn == &aBtnFont )
+    else if ( pBtn == m_pBtnFont )
         pData->SetFont( bCheck );
-    else if ( pBtn == &aBtnPattern )
+    else if ( pBtn == m_pBtnPattern )
         pData->SetBackground( bCheck );
-    else if ( pBtn == &aBtnAlignment )
+    else if ( pBtn == m_pBtnAlignment )
         pData->SetJustify( bCheck );
     else
         bDataChgd = sal_False;
@@ -334,11 +321,11 @@ IMPL_LINK( SwAutoFormatDlg, CheckHdl, Button *, pBtn )
     {
         if( !bCoreDataChanged )
         {
-            aBtnCancel.SetText( aStrClose );
+            m_pBtnCancel->SetText( aStrClose );
             bCoreDataChanged = sal_True;
         }
 
-        pWndPreview->NotifyChange( *pData );
+        m_pWndPreview->NotifyChange( *pData );
     }
     return 0;
 }
@@ -381,13 +368,13 @@ IMPL_LINK_NOARG(SwAutoFormatDlg, AddHdl)
                             break;
 
                     pTableTbl->InsertAutoFmt(n, pNewData);
-                    aLbFormat.InsertEntry( aFormatName, nDfltStylePos + n );
-                    aLbFormat.SelectEntryPos( nDfltStylePos + n );
+                    m_pLbFormat->InsertEntry( aFormatName, nDfltStylePos + n );
+                    m_pLbFormat->SelectEntryPos( nDfltStylePos + n );
                     bFmtInserted = sal_True;
-                    aBtnAdd.Enable( sal_False );
+                    m_pBtnAdd->Enable( sal_False );
                     if ( !bCoreDataChanged )
                     {
-                        aBtnCancel.SetText( aStrClose );
+                        m_pBtnCancel->SetText( aStrClose );
                         bCoreDataChanged = sal_True;
                     }
 
@@ -417,7 +404,7 @@ IMPL_LINK_NOARG(SwAutoFormatDlg, RemoveHdl)
 {
     String aMessage = aStrDelMsg ;
     aMessage.AppendAscii("\n\n");
-    aMessage += aLbFormat.GetSelectEntry() ;
+    aMessage += m_pLbFormat->GetSelectEntry() ;
     aMessage += '\n';
 
     MessBox* pBox = new MessBox( this, WinBits( WB_OK_CANCEL ),
@@ -425,21 +412,21 @@ IMPL_LINK_NOARG(SwAutoFormatDlg, RemoveHdl)
 
     if ( pBox->Execute() == RET_OK )
     {
-        aLbFormat.RemoveEntry( nDfltStylePos + nIndex );
-        aLbFormat.SelectEntryPos( nDfltStylePos + nIndex-1 );
+        m_pLbFormat->RemoveEntry( nDfltStylePos + nIndex );
+        m_pLbFormat->SelectEntryPos( nDfltStylePos + nIndex-1 );
 
         pTableTbl->EraseAutoFmt(nIndex);
         nIndex--;
 
         if( !nIndex )
         {
-            aBtnRemove.Enable(sal_False);
-            aBtnRename.Enable(sal_False);
+            m_pBtnRemove->Enable(sal_False);
+            m_pBtnRename->Enable(sal_False);
         }
 
         if( !bCoreDataChanged )
         {
-            aBtnCancel.SetText( aStrClose );
+            m_pBtnCancel->SetText( aStrClose );
             bCoreDataChanged = sal_True;
         }
     }
@@ -456,7 +443,7 @@ IMPL_LINK_NOARG(SwAutoFormatDlg, RenameHdl)
     while( !bOk )
     {
         SwStringInputDlg* pDlg = new SwStringInputDlg( this,
-                        aStrRenameTitle, aLbFormat.GetSelectEntry(),
+                        aStrRenameTitle, m_pLbFormat->GetSelectEntry(),
                                                         aEmptyStr );
         if( pDlg->Execute() == RET_OK )
         {
@@ -474,7 +461,7 @@ IMPL_LINK_NOARG(SwAutoFormatDlg, RenameHdl)
                 if( n >= pTableTbl->size() )
                 {
                     // no format with this name exists, so rename it
-                    aLbFormat.RemoveEntry( nDfltStylePos + nIndex );
+                    m_pLbFormat->RemoveEntry( nDfltStylePos + nIndex );
                     SwTableAutoFmt* p = &(*pTableTbl)[ nIndex ];
 
                     p->SetName( aFormatName );
@@ -488,12 +475,12 @@ IMPL_LINK_NOARG(SwAutoFormatDlg, RenameHdl)
                         }
 
                     pTableTbl->MoveAutoFmt(n, nIndex);
-                    aLbFormat.InsertEntry( aFormatName, nDfltStylePos + n );
-                    aLbFormat.SelectEntryPos( nDfltStylePos + n );
+                    m_pLbFormat->InsertEntry( aFormatName, nDfltStylePos + n );
+                    m_pLbFormat->SelectEntryPos( nDfltStylePos + n );
 
                     if ( !bCoreDataChanged )
                     {
-                        aBtnCancel.SetText( aStrClose );
+                        m_pBtnCancel->SetText( aStrClose );
                         bCoreDataChanged = sal_True;
                     }
 
@@ -523,11 +510,11 @@ IMPL_LINK_NOARG(SwAutoFormatDlg, RenameHdl)
 IMPL_LINK_NOARG(SwAutoFormatDlg, SelFmtHdl)
 {
     sal_Bool bBtnEnable = sal_False;
-    sal_uInt8 nSelPos = (sal_uInt8) aLbFormat.GetSelectEntryPos(), nOldIdx = nIndex;
+    sal_uInt8 nSelPos = (sal_uInt8) m_pLbFormat->GetSelectEntryPos(), nOldIdx = nIndex;
     if( nSelPos >= nDfltStylePos )
     {
         nIndex = nSelPos - nDfltStylePos;
-        pWndPreview->NotifyChange( (*pTableTbl)[nIndex] );
+        m_pWndPreview->NotifyChange( (*pTableTbl)[nIndex] );
         bBtnEnable = 0 != nIndex;
         UpdateChecks( (*pTableTbl)[nIndex], sal_True );
     }
@@ -544,12 +531,12 @@ IMPL_LINK_NOARG(SwAutoFormatDlg, SelFmtHdl)
         aTmp.SetWidthHeight( sal_False );
 
         if( nOldIdx != nIndex )
-            pWndPreview->NotifyChange( aTmp );
+            m_pWndPreview->NotifyChange( aTmp );
         UpdateChecks( aTmp, sal_False );
     }
 
-    aBtnRemove.Enable( bBtnEnable );
-    aBtnRename.Enable( bBtnEnable );
+    m_pBtnRemove->Enable( bBtnEnable );
+    m_pBtnRename->Enable( bBtnEnable );
 
     return 0;
 }
@@ -569,19 +556,13 @@ IMPL_LINK_NOARG_INLINE_END(SwAutoFormatDlg, OkHdl)
 
 //------------------------------------------------------------------------
 
-AutoFmtPreview::AutoFmtPreview( Window* pParent, const ResId& rRes, SwWrtShell* pWrtShell ) :
-        Window          ( pParent, rRes ),
-
+AutoFmtPreview::AutoFmtPreview(Window* pParent) :
+        Window          ( pParent ),
         aCurData        ( aEmptyStr ),
         aVD             ( *this ),
         aScriptedText   ( aVD ),
         bFitWidth       ( sal_False ),
         mbRTL           ( false ),
-        aPrvSize        ( GetSizePixel().Width() - 6, GetSizePixel().Height() - 30 ),
-        nLabelColWidth  ( (aPrvSize.Width() - 4) / 4 - 12 ),
-        nDataColWidth1  ( (aPrvSize.Width() - 4 - 2 * nLabelColWidth) / 3 ),
-        nDataColWidth2  ( (aPrvSize.Width() - 4 - 2 * nLabelColWidth) / 4 ),
-        nRowHeight      ( (aPrvSize.Height() - 4) / 5 ),
         aStrJan         ( SW_RES( STR_JAN ) ),
         aStrFeb         ( SW_RES( STR_FEB ) ),
         aStrMar         ( SW_RES( STR_MAR ) ),
@@ -591,11 +572,6 @@ AutoFmtPreview::AutoFmtPreview( Window* pParent, const ResId& rRes, SwWrtShell*
         aStrSum         ( SW_RES( STR_SUM ) ),
         m_xMSF          ( comphelper::getProcessServiceFactory() )
 {
-    if (!pWrtShell->IsCrsrInTbl()) // We haven't created the table yet
-        mbRTL = Application::GetSettings().GetLayoutRTL();
-    else
-        mbRTL = pWrtShell->IsTableRightToLeft();
-
     OSL_ENSURE( m_xMSF.is(), "AutoFmtPreview: no MultiServiceFactory");
     if ( m_xMSF.is() )
     {
@@ -609,6 +585,29 @@ AutoFmtPreview::AutoFmtPreview( Window* pParent, const ResId& rRes, SwWrtShell*
     Init();
 }
 
+extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeAutoFmtPreview(Window *pParent, VclBuilder::stringmap &)
+{
+    return new AutoFmtPreview(pParent);
+}
+
+void AutoFmtPreview::Resize()
+{
+    aPrvSize = Size(GetSizePixel().Width() - 6, GetSizePixel().Height() - 30);
+    nLabelColWidth = (aPrvSize.Width() - 4) / 4 - 12;
+    nDataColWidth1 = (aPrvSize.Width() - 4 - 2 * nLabelColWidth) / 3;
+    nDataColWidth2 = (aPrvSize.Width() - 4 - 2 * nLabelColWidth) / 4;
+    nRowHeight = (aPrvSize.Height() - 4) / 5;
+    NotifyChange(aCurData);
+}
+
+void AutoFmtPreview::DetectRTL(SwWrtShell* pWrtShell)
+{
+    if (!pWrtShell->IsCrsrInTbl()) // We haven't created the table yet
+        mbRTL = Application::GetSettings().GetLayoutRTL();
+    else
+        mbRTL = pWrtShell->IsTableRightToLeft();
+}
+
 //------------------------------------------------------------------------
 
 AutoFmtPreview::~AutoFmtPreview()
diff --git a/sw/source/ui/table/tautofmt.hrc b/sw/source/ui/table/tautofmt.hrc
index 082283b..0ac480d 100644
--- a/sw/source/ui/table/tautofmt.hrc
+++ b/sw/source/ui/table/tautofmt.hrc
@@ -41,20 +41,6 @@
 #define BTN_FONT        23
 #define BTN_PATTERN     24
 #define BTN_ALIGNMENT   25
-#define STR_ADD_TITLE   100
-#define STR_ADD_LABEL   101
-#define STR_DEL_TITLE   102
-#define STR_DEL_MSG     103
-#define STR_INVALID_AFNAME 104
-#define STR_RENAME_TITLE    105
-    // Autoformat-Preview:
-#define STR_JAN         121
-#define STR_FEB         122
-#define STR_MAR         123
-#define STR_NORTH       124
-#define STR_MID         125
-#define STR_SOUTH       126
-#define STR_SUM         127
 
 // Gruppierung setzen/aufheben:
 #define BTN_GROUP_COLS  1
diff --git a/sw/source/ui/table/tautofmt.src b/sw/source/ui/table/tautofmt.src
index ef6041f..620f6e5 100644
--- a/sw/source/ui/table/tautofmt.src
+++ b/sw/source/ui/table/tautofmt.src
@@ -27,196 +27,6 @@
 
 #include "tautofmt.hrc"
 #include "helpid.h"
-ModalDialog DLG_AUTOFMT_TABLE
-{
-    OutputSize = TRUE ;
-    SVLook = TRUE ;
-    HelpID = HID_AUTOFMT_TABLE ;
-    Size = MAP_APPFONT ( 312 , 120 ) ;
-    Text [ en-US ] = "AutoFormat" ;
-    Moveable = TRUE ;
-    FixedLine FL_FORMAT
-    {
-        Pos = MAP_APPFONT ( 6 , 3 ) ;
-        Size = MAP_APPFONT ( 243 , 8 ) ;
-        Text [ en-US ] = "Format" ;
-    };
-    ListBox LB_FORMAT
-    {
-        HelpID = "sw:ListBox:DLG_AUTOFMT_TABLE:LB_FORMAT";
-        Border = TRUE ;
-        Pos = MAP_APPFONT ( 12 , 14 ) ;
-        Size = MAP_APPFONT ( 65 , 100 ) ;
-        TabStop = TRUE ;
-    };
-    Window WND_PREVIEW
-    {
-        Pos = MAP_APPFONT ( 83 , 14 ) ;
-        Size = MAP_APPFONT ( 161 , 100 ) ;
-        Border = TRUE;
-    };
-    CheckBox BTN_NUMFORMAT
-    {
-        HelpID = "sw:CheckBox:DLG_AUTOFMT_TABLE:BTN_NUMFORMAT";
-        Hide = TRUE ;
-        Pos = MAP_APPFONT ( 12 , 131 ) ;
-        Size = MAP_APPFONT ( 60 , 10 ) ;
-        Text [ en-US ] = "~Number format" ;
-        TabStop = TRUE ;
-    };
-    CheckBox BTN_BORDER
-    {
-        HelpID = "sw:CheckBox:DLG_AUTOFMT_TABLE:BTN_BORDER";
-        Hide = TRUE ;
-        Pos = MAP_APPFONT ( 12 , 147 ) ;
-        Size = MAP_APPFONT ( 60 , 10 ) ;
-        Text [ en-US ] = "~Borders" ;
-        TabStop = TRUE ;
-    };
-    CheckBox BTN_FONT
-    {
-        HelpID = "sw:CheckBox:DLG_AUTOFMT_TABLE:BTN_FONT";
-        Hide = TRUE ;
-        Pos = MAP_APPFONT ( 85 , 131 ) ;
-        Size = MAP_APPFONT ( 60 , 10 ) ;
-        Text [ en-US ] = "F~ont" ;
-        TabStop = TRUE ;
-    };
-    CheckBox BTN_PATTERN
-    {
-        HelpID = "sw:CheckBox:DLG_AUTOFMT_TABLE:BTN_PATTERN";
-        Hide = TRUE ;
-        Pos = MAP_APPFONT ( 85 , 147 ) ;
-        Size = MAP_APPFONT ( 60 , 10 ) ;
-        Text [ en-US ] = "~Pattern" ;
-        TabStop = TRUE ;
-    };
-    CheckBox BTN_ALIGNMENT
-    {
-        HelpID = "sw:CheckBox:DLG_AUTOFMT_TABLE:BTN_ALIGNMENT";
-        Hide = TRUE ;
-        Pos = MAP_APPFONT ( 150 , 131 ) ;
-        Size = MAP_APPFONT ( 60 , 10 ) ;
-        Text [ en-US ] = "Alignmen~t" ;
-        TabStop = TRUE ;
-    };
-    FixedLine FL_FORMATS
-    {
-        Hide = TRUE ;
-        Pos = MAP_APPFONT ( 6 , 120 ) ;
-        Size = MAP_APPFONT ( 243 , 8 ) ;
-        Text [ en-US ] = "Formatting" ;
-    };
-    OKButton BTN_OK
-    {
-        Pos = MAP_APPFONT ( 255 , 6 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-        TabStop = TRUE ;
-        DefButton = TRUE ;
-    };
-    CancelButton BTN_CANCEL
-    {
-        Pos = MAP_APPFONT ( 255 , 23 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-        TabStop = TRUE ;
-    };
-    MoreButton BTN_MORE
-    {
-        HelpID = "sw:MoreButton:DLG_AUTOFMT_TABLE:BTN_MORE";
-        Pos = MAP_APPFONT ( 255 , 101 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-        Text [ en-US ] = "~More" ;
-        TabStop = TRUE ;
-        MapUnit = MAP_APPFONT ;
-        Delta = 48 ;
-    };
-    PushButton BTN_ADD
-    {
-        HelpID = "sw:PushButton:DLG_AUTOFMT_TABLE:BTN_ADD";
-        Pos = MAP_APPFONT ( 255 , 64 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-        Text [ en-US ] = "~Add" ;
-        TabStop = TRUE ;
-    };
-    PushButton BTN_REMOVE
-    {
-        HelpID = "sw:PushButton:DLG_AUTOFMT_TABLE:BTN_REMOVE";
-        Pos = MAP_APPFONT ( 255 , 81 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-        Text [ en-US ] = "~Delete" ;
-        TabStop = TRUE ;
-    };
-    PushButton BTN_RENAME
-    {
-        HelpID = "sw:PushButton:DLG_AUTOFMT_TABLE:BTN_RENAME";
-        Pos = MAP_APPFONT ( 255 , 123 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-        TabStop = TRUE ;
-        Text [ en-US ] = "~Rename" ;
-    };
-    HelpButton BTN_HELP
-    {
-        Pos = MAP_APPFONT ( 255 , 43 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-        TabStop = TRUE ;
-    };
-    String STR_ADD_TITLE
-    {
-        Text [ en-US ] = "Add AutoFormat" ;
-    };
-    String STR_ADD_LABEL
-    {
-        Text [ en-US ] = "Name" ;
-    };
-    String STR_DEL_TITLE
-    {
-        Text [ en-US ] = "Delete AutoFormat" ;
-    };
-    String STR_DEL_MSG
-    {
-        Text [ en-US ] = "The following AutoFormat entry will be deleted:" ;
-    };
-    String STR_RENAME_TITLE
-    {
-        Text [ en-US ] = "Rename AutoFormat" ;
-    };
-    String STR_BTN_CLOSE
-    {
-        Text [ en-US ] = "~Close" ;
-    };
-    String STR_JAN
-    {
-        Text [ en-US ] = "Jan" ;
-    };
-    String STR_FEB
-    {
-        Text [ en-US ] = "Feb" ;
-    };
-    String STR_MAR
-    {
-        Text [ en-US ] = "Mar" ;
-    };
-    String STR_NORTH
-    {
-        Text [ en-US ] = "North" ;
-    };
-    String STR_MID
-    {
-        Text [ en-US ] = "Mid" ;
-    };
-    String STR_SOUTH
-    {
-        Text [ en-US ] = "South" ;
-    };
-    String STR_SUM
-    {
-        Text [ en-US ] = "Sum" ;
-    };
-    String STR_INVALID_AFNAME
-    {
-        Text [ en-US ] = "You have entered an invalid name.\nThe desired AutoFormat could not be created. \nTry again using a different name." ;
-    };
-};
 ModalDialog DLG_SWDLG_STRINPUT
 {
     OutputSize = TRUE ;
diff --git a/vcl/inc/svids.hrc b/vcl/inc/svids.hrc
index 57e3d3a..76fc51f 100644
--- a/vcl/inc/svids.hrc
+++ b/vcl/inc/svids.hrc
@@ -148,6 +148,8 @@
 #define SV_BUTTONTEXT_ABORT                 10109
 #define SV_BUTTONTEXT_LESS                  10110
 #define SV_BUTTONTEXT_RESET                 10111
+#define SV_BUTTONTEXT_ADD                   10112
+#define SV_BUTTONTEXT_DELETE                10113
 
 #define SV_STDTEXT_FIRST                    SV_STDTEXT_SERVICENOTAVAILABLE
 #define SV_STDTEXT_SERVICENOTAVAILABLE      10200
diff --git a/vcl/source/src/btntext.src b/vcl/source/src/btntext.src
index 6d0bb15..cd6103c 100644
--- a/vcl/source/src/btntext.src
+++ b/vcl/source/src/btntext.src
@@ -83,3 +83,13 @@ String SV_BUTTONTEXT_RESET
 {
     Text [ en-US ] = "R~eset";
 };
+
+String SV_BUTTONTEXT_ADD
+{
+    Text [ en-US ] = "~Add";
+};
+
+String SV_BUTTONTEXT_DELETE
+{
+    Text [ en-US ] = "~Delete";
+};
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index d3fa857..9edf197 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -27,6 +27,7 @@
  */
 
 #include <osl/module.hxx>
+#include <sal/log.hxx>
 #include <vcl/builder.hxx>
 #include <vcl/button.hxx>
 #include <vcl/dialog.hxx>
@@ -280,8 +281,22 @@ namespace
                 pBtn->SetText(VclResId(SV_BUTTONTEXT_RESET).toString());
                 pWindow = pBtn;
             }
+            else if (sType.equalsL(RTL_CONSTASCII_STRINGPARAM("gtk-add")))
+            {
+                PushButton *pBtn = new PushButton(pParent, nBits);
+                pBtn->SetText(VclResId(SV_BUTTONTEXT_ADD).toString());
+                pWindow = pBtn;
+            }
+            else if (sType.equalsL(RTL_CONSTASCII_STRINGPARAM("gtk-delete")))
+            {
+                PushButton *pBtn = new PushButton(pParent, nBits);
+                pBtn->SetText(VclResId(SV_BUTTONTEXT_DELETE).toString());
+                pWindow = pBtn;
+            }
             else
-                fprintf(stderr, "unknown stock type %s\n", sType.getStr());
+            {
+                SAL_WARN("vcl.layout", "unknown stock type: " << sType.getStr());
+            }
         }
 
         if (!pWindow)
@@ -481,12 +496,12 @@ Window *VclBuilder::makeObject(Window *pParent, const rtl::OString &name, const
 
         if (sPattern.isEmpty())
         {
-            fprintf(stderr, "making numeric field for %s %s\n", name.getStr(), sUnit.getStr());
+            SAL_INFO("vcl.layout", "making numeric field for " << name.getStr() << " " << sUnit.getStr());
             pWindow = new NumericField(pParent, nBits);
         }
         else
         {
-            fprintf(stderr, "making metric field for %s %s\n", name.getStr(), sUnit.getStr());
+            SAL_INFO("vcl.layout", "making metric field for " << name.getStr() << " " << sUnit.getStr());
             MetricField *pField = new MetricField(pParent, nBits);
             pField->SetUnit(eUnit);
             pWindow = pField;
@@ -552,12 +567,16 @@ Window *VclBuilder::makeObject(Window *pParent, const rtl::OString &name, const
                 pWindow = (*pFunction)(pParent, rMap);
         }
     }
-    if (!pWindow)
-        fprintf(stderr, "TO-DO, implement %s or add a make%s function\n", name.getStr(), name.getStr());
+    SAL_WARN_IF(!pWindow, "vcl.layout", "implement " << name.getStr() << "or add a make" << name.getStr() << " function");
     if (pWindow)
     {
         pWindow->SetHelpId(m_sHelpRoot + id);
-        fprintf(stderr, "for %s, created %p child of %p (%p/%p/%p) with helpid %s\n", name.getStr(), pWindow, pParent, pWindow->mpWindowImpl->mpParent, pWindow->mpWindowImpl->mpRealParent, pWindow->mpWindowImpl->mpBorderWindow, pWindow->GetHelpId().getStr());
+        SAL_INFO("vcl.layout", "for " << name.getStr() <<
+            ", created << " << pWindow << " child of " <<
+            pParent << "(" << pWindow->mpWindowImpl->mpParent << "/" <<
+            pWindow->mpWindowImpl->mpRealParent << "/" <<
+            pWindow->mpWindowImpl->mpBorderWindow << ") with helpid " <<
+            pWindow->GetHelpId().getStr());
         m_aChildren.push_back(WinAndId(id, pWindow));
     }
     return pWindow;
@@ -1114,7 +1133,9 @@ void VclBuilder::applyPackingProperty(Window *pCurrent,
                 set_window_packing_position(pCurrent, sValue.toInt32());
             }
             else
-                fprintf(stderr, "unknown packing %s\n", sKey.getStr());
+            {
+                SAL_WARN("vcl.layout", "unknown packing: " << sKey.getStr());
+            }
         }
     }
 }
@@ -1258,7 +1279,6 @@ void VclBuilder::swapGuts(Window &rOrig, Window &rReplacement)
     reorderWithinParent(rReplacement, nPosition);
 
     assert(nPosition == getPositionWithinParent(rReplacement));
-    fprintf(stderr, "swapped %p for %p %p/%p/%p\n", &rReplacement, &rOrig, rReplacement.mpWindowImpl->mpParent, rReplacement.mpWindowImpl->mpRealParent, rReplacement.mpWindowImpl->mpBorderWindow);
 }
 
 bool VclBuilder::replace(rtl::OString sID, Window &rReplacement)
@@ -1277,7 +1297,7 @@ bool VclBuilder::replace(rtl::OString sID, Window &rReplacement)
             return true;
         }
     }
-    fprintf(stderr, "no sign of %s\n", sID.getStr());
+    SAL_WARN("vcl.layout", "no sign of :" << sID.getStr());
     return false;
 }
 
@@ -1330,7 +1350,9 @@ void VclBuilder::mungeadjustment(NumericFormatter &rTarget, Adjustment &rAdjustm
             rTarget.SetSpinSize(nSpinSize);
         }
         else
-            fprintf(stderr, "unhandled property %s\n", rKey.getStr());
+        {
+            SAL_WARN("vcl.layout", "unhandled property :" << rKey.getStr());
+        }
     }
 }
 
commit 831b9ec2ab809d07189123931712f72e72f08674
Author: Gokul <gokul.cdac at gmail.com>
Date:   Tue Sep 25 11:33:50 2012 +0100

    convert autoformat table dialog
    
    Change-Id: I645565afe1a3bac4402abdfaba821ca9235c6087

diff --git a/sw/uiconfig/swriter/ui/autoformattable.ui b/sw/uiconfig/swriter/ui/autoformattable.ui
new file mode 100644
index 0000000..e6ea40e
--- /dev/null
+++ b/sw/uiconfig/swriter/ui/autoformattable.ui
@@ -0,0 +1,341 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 3.0 -->
+  <object class="GtkDialog" id="AutoFormatTableDialog">
+    <property name="can_focus">False</property>
+    <property name="border_width">5</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="spacing">2</property>
+        <child internal-child="action_area">
+          <object class="GtkButtonBox" id="dialog-action_area1">
+            <property name="can_focus">False</property>
+            <property name="orientation">vertical</property>
+            <property name="homogeneous">True</property>
+            <property name="layout_style">start</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_action_appearance">False</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_action_appearance">False</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_action_appearance">False</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>
+            <child>
+              <object class="GtkButton" id="add">
+                <property name="label">gtk-add</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_action_appearance">False</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">3</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="remove">
+                <property name="label">gtk-delete</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_action_appearance">False</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">4</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="rename">
+                <property name="label" translatable="yes">Rename</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_action_appearance">False</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">5</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>
+            <child>
+              <object class="GtkFrame" id="format">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label_xalign">0</property>
+                <property name="shadow_type">none</property>
+                <child>
+                  <object class="GtkAlignment" id="alignment1">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="left_padding">12</property>
+                    <child>
+                      <object class="GtkGrid" id="grid2">
+                        <property name="width_request">400</property>
+                        <property name="height_request">200</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="row_spacing">6</property>
+                        <property name="column_spacing">6</property>
+                        <child>
+                          <object class="GtkTreeView" id="formatlb">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="vexpand">True</property>
+                          </object>
+                          <packing>
+                            <property name="left_attach">0</property>
+                            <property name="top_attach">0</property>
+                            <property name="width">1</property>
+                            <property name="height">1</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="swuilo:AutoFmtPreview" id="preview">
+                            <property name="width_request">200</property>
+                            <property name="height_request">200</property>
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="hexpand">True</property>
+                            <property name="vexpand">True</property>
+                          </object>
+                          <packing>
+                            <property name="left_attach">1</property>
+                            <property name="top_attach">0</property>
+                            <property name="width">1</property>
+                            <property name="height">1</property>
+                          </packing>
+                        </child>
+                      </object>
+                    </child>
+                  </object>
+                </child>
+                <child type="label">
+                  <object class="GtkLabel" id="label1">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="label" translatable="yes">Format</property>
+                    <property name="use_markup">True</property>
+                  </object>
+                </child>
+              </object>
+              <packing>
+                <property name="expand">True</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkFrame" id="formatting">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label_xalign">0</property>
+                <property name="shadow_type">none</property>
+                <child>
+                  <object class="GtkAlignment" id="alignment2">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="left_padding">12</property>
+                    <child>
+                      <object class="GtkGrid" id="grid4">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="row_spacing">5</property>
+                        <property name="column_spacing">5</property>
+                        <child>
+                          <object class="GtkCheckButton" id="numformatcb">
+                            <property name="label" translatable="yes">Number format</property>
+                            <property name="use_action_appearance">False</property>
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">False</property>
+                            <property name="use_action_appearance">False</property>
+                            <property name="xalign">0</property>
+                            <property name="draw_indicator">True</property>
+                          </object>
+                          <packing>
+                            <property name="left_attach">0</property>
+                            <property name="top_attach">0</property>
+                            <property name="width">1</property>
+                            <property name="height">1</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkCheckButton" id="bordercb">
+                            <property name="label" translatable="yes">Borders</property>
+                            <property name="use_action_appearance">False</property>
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">False</property>
+                            <property name="use_action_appearance">False</property>
+                            <property name="xalign">0</property>
+                            <property name="draw_indicator">True</property>
+                          </object>
+                          <packing>
+                            <property name="left_attach">0</property>
+                            <property name="top_attach">1</property>
+                            <property name="width">1</property>
+                            <property name="height">1</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkCheckButton" id="fontcb">
+                            <property name="label" translatable="yes">Font</property>
+                            <property name="use_action_appearance">False</property>
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">False</property>
+                            <property name="use_action_appearance">False</property>
+                            <property name="xalign">0</property>
+                            <property name="draw_indicator">True</property>
+                          </object>
+                          <packing>
+                            <property name="left_attach">1</property>
+                            <property name="top_attach">0</property>
+                            <property name="width">1</property>
+                            <property name="height">1</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkCheckButton" id="patterncb">
+                            <property name="label" translatable="yes">Pattern</property>
+                            <property name="use_action_appearance">False</property>
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">False</property>
+                            <property name="use_action_appearance">False</property>
+                            <property name="xalign">0</property>
+                            <property name="draw_indicator">True</property>
+                          </object>
+                          <packing>
+                            <property name="left_attach">1</property>
+                            <property name="top_attach">1</property>
+                            <property name="width">1</property>
+                            <property name="height">1</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkCheckButton" id="alignmentcb">
+                            <property name="label" translatable="yes">Alignment</property>
+                            <property name="use_action_appearance">False</property>
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">False</property>
+                            <property name="use_action_appearance">False</property>
+                            <property name="xalign">0</property>
+                            <property name="draw_indicator">True</property>
+                          </object>
+                          <packing>
+                            <property name="left_attach">2</property>
+                            <property name="top_attach">0</property>
+                            <property name="width">1</property>
+                            <property name="height">1</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <placeholder/>
+                        </child>
+                      </object>
+                    </child>
+                  </object>
+                </child>
+                <child type="label">
+                  <object class="GtkLabel" id="label2">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="label" translatable="yes">Formatting</property>
+                    <property name="use_markup">True</property>
+                  </object>
+                </child>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="pack_type">end</property>
+                <property name="position">1</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-widget response="0">add</action-widget>
+      <action-widget response="0">remove</action-widget>
+      <action-widget response="0">rename</action-widget>
+    </action-widgets>
+  </object>
+</interface>
commit bdd8cbf38ab3e0b68f6a8a68dc2a70ff7e9e18a1
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Sep 25 11:32:25 2012 +0100

    avoid self assignment crash
    
    Change-Id: I8cbe5873aa39ac8b17f330c836985b7780ea2047

diff --git a/sw/source/core/doc/tblafmt.cxx b/sw/source/core/doc/tblafmt.cxx
index 65f2620..eabafd1 100644
--- a/sw/source/core/doc/tblafmt.cxx
+++ b/sw/source/core/doc/tblafmt.cxx
@@ -630,6 +630,9 @@ SwTableAutoFmt::SwTableAutoFmt( const SwTableAutoFmt& rNew )
 
 SwTableAutoFmt& SwTableAutoFmt::operator=( const SwTableAutoFmt& rNew )
 {
+    if (&rNew == this)
+        return *this;
+
     for( sal_uInt8 n = 0; n < 16; ++n )
     {
         if( aBoxAutoFmt[ n ] )


More information about the Libreoffice-commits mailing list