[Libreoffice-commits] core.git: 2 commits - include/sfx2 sc/AllLangResTarget_sc.mk sc/source sc/uiconfig sc/UIConfig_scalc.mk sd/AllLangResTarget_sd.mk sd/source sd/UIConfig_simpress.mk sfx2/source svx/source sw/AllLangResTarget_sw.mk sw/inc sw/source sw/uiconfig sw/UIConfig_swriter.mk

Caolán McNamara caolanm at redhat.com
Fri Aug 9 12:46:48 PDT 2013


 include/sfx2/styledlg.hxx                  |    6 
 sc/AllLangResTarget_sc.mk                  |    1 
 sc/UIConfig_scalc.mk                       |    2 
 sc/source/ui/inc/styledlg.hrc              |   32 -
 sc/source/ui/inc/styledlg.hxx              |   20 
 sc/source/ui/pagedlg/pagedlg.hrc           |    4 
 sc/source/ui/styleui/styledlg.cxx          |  141 ++----
 sc/source/ui/styleui/styledlg.src          |  131 ------
 sc/uiconfig/scalc/ui/pagetemplatedialog.ui |  203 +++++++++
 sc/uiconfig/scalc/ui/paratemplatedialog.ui |  246 +++++++++++
 sd/AllLangResTarget_sd.mk                  |    1 
 sd/UIConfig_simpress.mk                    |   15 
 sd/source/ui/dlg/tabtempl.cxx              |  207 ++++-----
 sd/source/ui/dlg/tabtempl.src              |  148 ------
 sd/source/ui/inc/tabtempl.hrc              |   23 -
 sd/source/ui/inc/tabtempl.hxx              |   27 -
 sfx2/source/dialog/dialog.hrc              |    1 
 sfx2/source/dialog/dialog.src              |    4 
 sfx2/source/dialog/styledlg.cxx            |   27 -
 svx/source/items/algitem.cxx               |    8 
 svx/source/xoutdev/xattr.cxx               |    6 
 sw/AllLangResTarget_sw.mk                  |    1 
 sw/UIConfig_swriter.mk                     |    5 
 sw/inc/docsh.hxx                           |    4 
 sw/inc/fmtui.hrc                           |   52 --
 sw/inc/globals.hrc                         |   22 -
 sw/inc/swabstdlg.hxx                       |    6 
 sw/source/ui/app/docst.cxx                 |    9 
 sw/source/ui/chrdlg/pardlg.cxx             |    6 
 sw/source/ui/dialog/swdlgfact.cxx          |   11 
 sw/source/ui/dialog/swdlgfact.hxx          |    8 
 sw/source/ui/docvw/HeaderFooterWin.cxx     |    9 
 sw/source/ui/docvw/PageBreakWin.cxx        |    2 
 sw/source/ui/fmtui/tmpdlg.cxx              |  633 ++++++++++++++---------------
 sw/source/ui/fmtui/tmpdlg.src              |  373 -----------------
 sw/source/ui/inc/swuipardlg.hxx            |    2 
 sw/source/ui/inc/tmpdlg.hxx                |   41 +
 sw/source/ui/misc/titlepage.cxx            |    2 
 sw/source/ui/shells/annotsh.cxx            |    2 
 sw/source/ui/shells/basesh.cxx             |   16 
 sw/source/ui/shells/drwtxtex.cxx           |    2 
 sw/source/ui/shells/textsh1.cxx            |   10 
 sw/source/ui/uiview/viewmdi.cxx            |    9 
 sw/uiconfig/swriter/ui/templatedialog1.ui  |  235 ++++++++++
 sw/uiconfig/swriter/ui/templatedialog16.ui |  220 ++++++++++
 sw/uiconfig/swriter/ui/templatedialog2.ui  |  347 +++++++++++++++
 sw/uiconfig/swriter/ui/templatedialog4.ui  |  249 +++++++++++
 sw/uiconfig/swriter/ui/templatedialog8.ui  |  248 +++++++++++
 48 files changed, 2377 insertions(+), 1400 deletions(-)

New commits:
commit f41e7c704898fa0e86d6d128f5bd28f37c081e92
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Aug 9 14:20:59 2013 +0100

    convert SfxStyleDialogs to .ui
    
    Change-Id: I32aa538026669e22e0756cd062b72e67f8d179e5

diff --git a/include/sfx2/styledlg.hxx b/include/sfx2/styledlg.hxx
index 0580e4c..da2e2a0 100644
--- a/include/sfx2/styledlg.hxx
+++ b/include/sfx2/styledlg.hxx
@@ -31,13 +31,13 @@ class SFX2_DLLPUBLIC SfxStyleDialog: public SfxTabDialog
 private:
     SfxStyleSheetBase*          pStyle;
     DECL_DLLPRIVATE_LINK( CancelHdl, Button * );
+    sal_uInt16 m_nOrganizerId;
 protected:
     virtual const SfxItemSet*   GetRefreshedSet();
 
 public:
-#define ID_TABPAGE_MANAGESTYLES 1
-    SfxStyleDialog( Window* pParent, const ResId& rResId, SfxStyleSheetBase&,
-                    sal_Bool bFreeRes = sal_True, const String* pUserBtnTxt = 0 );
+    SfxStyleDialog(Window* pParent, const OString& rID,
+        const OUString& rUIXMLDescription, SfxStyleSheetBase&);
 
     ~SfxStyleDialog();
 
diff --git a/sc/AllLangResTarget_sc.mk b/sc/AllLangResTarget_sc.mk
index 55ad9d2..4147daf 100644
--- a/sc/AllLangResTarget_sc.mk
+++ b/sc/AllLangResTarget_sc.mk
@@ -61,7 +61,6 @@ $(eval $(call gb_SrsTarget_add_files,sc/res,\
     sc/source/ui/navipi/navipi.src \
     sc/source/ui/pagedlg/pagedlg.src \
     sc/source/ui/styleui/scstyles.src \
-    sc/source/ui/styleui/styledlg.src \
     sc/source/ui/dbgui/pivot.src \
     sc/source/ui/dbgui/dpgroupdlg.src \
     sc/source/ui/dbgui/pvfundlg.src \
diff --git a/sc/UIConfig_scalc.mk b/sc/UIConfig_scalc.mk
index 43dee84..7776682 100644
--- a/sc/UIConfig_scalc.mk
+++ b/sc/UIConfig_scalc.mk
@@ -95,6 +95,8 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/scalc,\
 	sc/uiconfig/scalc/ui/optdlg \
 	sc/uiconfig/scalc/ui/optformula \
 	sc/uiconfig/scalc/ui/optsortlists \
+	sc/uiconfig/scalc/ui/pagetemplatedialog \
+	sc/uiconfig/scalc/ui/paratemplatedialog \
 	sc/uiconfig/scalc/ui/printareasdialog \
 	sc/uiconfig/scalc/ui/printeroptions \
 	sc/uiconfig/scalc/ui/protectsheetdlg \
diff --git a/sc/source/ui/inc/styledlg.hrc b/sc/source/ui/inc/styledlg.hrc
deleted file mode 100644
index e453229..0000000
--- a/sc/source/ui/inc/styledlg.hrc
+++ /dev/null
@@ -1,32 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-#define TP_NUMBER       2
-#define TP_FONT         3
-#define TP_ALIGNMENT    4
-#define TP_BORDER       5
-#define TP_BACKGROUND   6
-#define TP_PROTECTION   7
-#define TP_PAGE_STD 8
-#define TP_PAGE_HEADER  9
-#define TP_PAGE_FOOTER 10
-#define TP_TABLE       11
-#define TP_FONTEFF     12
-#define TP_ASIAN       13
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/styledlg.hxx b/sc/source/ui/inc/styledlg.hxx
index e99e056..5201fec 100644
--- a/sc/source/ui/inc/styledlg.hxx
+++ b/sc/source/ui/inc/styledlg.hxx
@@ -29,10 +29,9 @@ class SfxStyleSheetBase;
 class ScStyleDlg : public SfxStyleDialog
 {
 public:
-                ScStyleDlg( Window*             pParent,
-                            SfxStyleSheetBase&  rStyleBase,
-                            sal_uInt16              nRscId );
-                ~ScStyleDlg();
+    ScStyleDlg( Window*             pParent,
+                SfxStyleSheetBase&  rStyleBase,
+                sal_uInt16          nRscId );
 
 protected:
     virtual void                PageCreated( sal_uInt16 nPageId, SfxTabPage& rTabPage );
@@ -40,6 +39,19 @@ protected:
 
 private:
     sal_uInt16 nDlgRsc;
+
+    sal_uInt16 m_nNumberId;
+    sal_uInt16 m_nFontId;
+    sal_uInt16 m_nFontEffectId;
+    sal_uInt16 m_nAlignmentId;
+    sal_uInt16 m_nAsianId;
+    sal_uInt16 m_nBorderId;
+    sal_uInt16 m_nBackgroundId;
+    sal_uInt16 m_nProtectId;
+    sal_uInt16 m_nPageId;
+    sal_uInt16 m_nHeaderId;
+    sal_uInt16 m_nFooterId;
+    sal_uInt16 m_nSheetId;
 };
 
 
diff --git a/sc/source/ui/pagedlg/pagedlg.hrc b/sc/source/ui/pagedlg/pagedlg.hrc
index 6d2d792..99ae920 100644
--- a/sc/source/ui/pagedlg/pagedlg.hrc
+++ b/sc/source/ui/pagedlg/pagedlg.hrc
@@ -21,10 +21,6 @@
 #include "sc.hrc"   // -> RID_SCDLG_PAGE
                     // -> RID_SCPAGE_AREAS
 
-#define TP_PAGE_STD     1
-#define TP_PAGE_HEADER  2
-#define TP_PAGE_FOOTER  3
-
 //================================================
 // TabPage: Tabelle
 
diff --git a/sc/source/ui/styleui/styledlg.cxx b/sc/source/ui/styleui/styledlg.cxx
index 1a24d15..fcbc7ae 100644
--- a/sc/source/ui/styleui/styledlg.cxx
+++ b/sc/source/ui/styleui/styledlg.cxx
@@ -36,7 +36,6 @@
 #include "tptable.hxx"      // Seitenvorlage: Tabelle
 #include "scresid.hxx"
 #include "sc.hrc"
-#include "styledlg.hrc"
 #include <svx/svxdlg.hxx>
 #include <svx/svxids.hrc>
 #include <svx/dialogs.hrc>
@@ -50,11 +49,27 @@ ScStyleDlg::ScStyleDlg( Window*             pParent,
                         SfxStyleSheetBase&  rStyleBase,
                         sal_uInt16              nRscId )
 
-    :   SfxStyleDialog  ( pParent,
-                          ScResId( nRscId ),
-                          rStyleBase,
-                          false ),
-        nDlgRsc         ( nRscId )
+    : SfxStyleDialog  ( pParent,
+                        nRscId == RID_SCDLG_STYLES_PAR ?
+                          OString("ParaTemplateDialog") :
+                          OString("PageTemplateDialog"),
+                        nRscId == RID_SCDLG_STYLES_PAR ?
+                          OUString("modules/scalc/ui/paratemplatedialog.ui") :
+                          OUString("modules/scalc/ui/pagetemplatedialog.ui"),
+                        rStyleBase )
+    , nDlgRsc         ( nRscId )
+    , m_nNumberId(0)
+    , m_nFontId(0)
+    , m_nFontEffectId(0)
+    , m_nAlignmentId(0)
+    , m_nAsianId(0)
+    , m_nBorderId(0)
+    , m_nBackgroundId(0)
+    , m_nProtectId(0)
+    , m_nPageId(0)
+    , m_nHeaderId(0)
+    , m_nFooterId(0)
+    , m_nSheetId(0)
 {
     SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
     OSL_ENSURE(pFact, "Dialogdiet fail!");
@@ -65,31 +80,31 @@ ScStyleDlg::ScStyleDlg( Window*             pParent,
                 SvtCJKOptions aCJKOptions;
                 OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_NUMBERFORMAT ), "GetTabPageCreatorFunc fail!");
                 OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_NUMBERFORMAT ), "GetTabPageRangesFunc fail!");
-                AddTabPage( TP_NUMBER, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_NUMBERFORMAT ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_NUMBERFORMAT ) );
+                m_nNumberId = AddTabPage("numbers", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_NUMBERFORMAT ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_NUMBERFORMAT ));
                 OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_NAME ), "GetTabPageCreatorFunc fail!");
                 OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_NAME ), "GetTabPageRangesFunc fail!");
-                AddTabPage( TP_FONT, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_NAME ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_NAME ) );
+                m_nFontId = AddTabPage("font", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_NAME ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_NAME ));
                 OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_EFFECTS ), "GetTabPageCreatorFunc fail!");
                 OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_EFFECTS ), "GetTabPageRangesFunc fail!");
-                AddTabPage( TP_FONTEFF, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_EFFECTS ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_EFFECTS ) );
+                m_nFontEffectId = AddTabPage("fonteffects", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_EFFECTS ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_EFFECTS ));
                 OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_ALIGNMENT ), "GetTabPageCreatorFunc fail!");
                 OSL_ENSURE( pFact->GetTabPageRangesFunc( RID_SVXPAGE_ALIGNMENT ), "GetTabPageRangesFunc fail!");
-                AddTabPage( TP_ALIGNMENT, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_ALIGNMENT ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_ALIGNMENT ) );
+                m_nAlignmentId = AddTabPage("alignment", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_ALIGNMENT ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_ALIGNMENT ));
                 if ( aCJKOptions.IsAsianTypographyEnabled() )
                 {
                     OSL_ENSURE(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_PARA_ASIAN), "GetTabPageCreatorFunc fail!");
                     OSL_ENSURE(pFact->GetTabPageRangesFunc(RID_SVXPAGE_PARA_ASIAN), "GetTabPageRangesFunc fail!");
-                    AddTabPage( TP_ASIAN,   pFact->GetTabPageCreatorFunc(RID_SVXPAGE_PARA_ASIAN),       pFact->GetTabPageRangesFunc(RID_SVXPAGE_PARA_ASIAN) );
+                    m_nAsianId = AddTabPage("asiantypo", pFact->GetTabPageCreatorFunc(RID_SVXPAGE_PARA_ASIAN),       pFact->GetTabPageRangesFunc(RID_SVXPAGE_PARA_ASIAN));
                 }
                 else
-                    RemoveTabPage( TP_ASIAN );
+                    RemoveTabPage("asiantypo");
                 OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), "GetTabPageCreatorFunc fail!");
                 OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ), "GetTabPageRangesFunc fail!");
-                AddTabPage( TP_BORDER, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ) );
+                m_nBorderId = AddTabPage("borders", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ));
                 OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageCreatorFunc fail!");
                 OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageRangesFunc fail!");
-                AddTabPage( TP_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ) );
-                AddTabPage( TP_PROTECTION, &ScTabPageProtection::Create,    &ScTabPageProtection::GetRanges );
+                m_nBackgroundId = AddTabPage("background", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ));
+                m_nProtectId = AddTabPage("protection", &ScTabPageProtection::Create,    &ScTabPageProtection::GetRanges);
             }
             break;
 
@@ -97,31 +112,22 @@ ScStyleDlg::ScStyleDlg( Window*             pParent,
             {
                 OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_PAGE ), "GetTabPageCreatorFunc fail!");
                 OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_PAGE ), "GetTabPageRangesFunc fail!");
-                AddTabPage( TP_PAGE_STD, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_PAGE ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_PAGE ) );
+                m_nPageId = AddTabPage("page", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_PAGE ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_PAGE ) );
                 OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), "GetTabPageCreatorFunc fail!");
                 OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ), "GetTabPageRangesFunc fail!");
-                AddTabPage( TP_BORDER, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ) );
+                m_nBorderId = AddTabPage("borders", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ) );
                 OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageCreatorFunc fail!");
                 OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageRangesFunc fail!");
-                AddTabPage( TP_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ) );
-                AddTabPage( TP_PAGE_HEADER, &ScHeaderPage::Create,      &ScHeaderPage::GetRanges );
-                AddTabPage( TP_PAGE_FOOTER, &ScFooterPage::Create,      &ScFooterPage::GetRanges );
-                AddTabPage( TP_TABLE, &ScTablePage::Create,     &ScTablePage::GetRanges );
+                m_nBackgroundId = AddTabPage("background", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ) );
+                m_nHeaderId = AddTabPage("header", &ScHeaderPage::Create,      &ScHeaderPage::GetRanges );
+                m_nFooterId = AddTabPage("footer", &ScFooterPage::Create,      &ScFooterPage::GetRanges );
+                m_nSheetId = AddTabPage("sheet", &ScTablePage::Create,     &ScTablePage::GetRanges );
             }
             break;
 
         default:
             OSL_FAIL( "Family not supported" );
     }
-
-    //--------------------------------------------------------------------
-    FreeResource();
-}
-
-// -----------------------------------------------------------------------
-
-ScStyleDlg::~ScStyleDlg()
-{
 }
 
 // -----------------------------------------------------------------------
@@ -132,62 +138,45 @@ void ScStyleDlg::PageCreated( sal_uInt16 nPageId, SfxTabPage& rTabPage )
     {
         SfxObjectShell* pDocSh = SfxObjectShell::Current();
         SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
-        switch ( nPageId )
+        if (nPageId == m_nNumberId)
         {
-            case TP_NUMBER:
-                {
-                    const SfxPoolItem* pInfoItem
-                        = pDocSh->GetItem( SID_ATTR_NUMBERFORMAT_INFO );
-
-                    OSL_ENSURE( pInfoItem, "NumberInfoItem nicht gefunden!" );
+            const SfxPoolItem* pInfoItem
+                = pDocSh->GetItem( SID_ATTR_NUMBERFORMAT_INFO );
 
-                    aSet.Put (SvxNumberInfoItem( (const SvxNumberInfoItem&)*pInfoItem ) );
-                    rTabPage.PageCreated(aSet);
-                }
-                break;
-
-            case TP_FONT:
-                {
-                    const SfxPoolItem* pInfoItem
-                        = pDocSh->GetItem( SID_ATTR_CHAR_FONTLIST );
+            OSL_ENSURE( pInfoItem, "NumberInfoItem nicht gefunden!" );
 
-                    OSL_ENSURE( pInfoItem, "FontListItem nicht gefunden!" );
+            aSet.Put (SvxNumberInfoItem( (const SvxNumberInfoItem&)*pInfoItem ) );
+            rTabPage.PageCreated(aSet);
+        }
+        else if (nPageId == m_nFontId)
+        {
+            const SfxPoolItem* pInfoItem
+                = pDocSh->GetItem( SID_ATTR_CHAR_FONTLIST );
 
-                    aSet.Put (SvxFontListItem(((const SvxFontListItem&)*pInfoItem).GetFontList(), SID_ATTR_CHAR_FONTLIST));
-                    rTabPage.PageCreated(aSet);
-                }
-                break;
+            OSL_ENSURE( pInfoItem, "FontListItem nicht gefunden!" );
 
-            default:
-            break;
+            aSet.Put (SvxFontListItem(((const SvxFontListItem&)*pInfoItem).GetFontList(), SID_ATTR_CHAR_FONTLIST));
+            rTabPage.PageCreated(aSet);
         }
     }
     else if ( nDlgRsc == RID_SCDLG_STYLES_PAGE )
     {
         SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
-        switch ( nPageId )
+        if (nPageId == m_nPageId)
+        {
+            aSet.Put (SfxAllEnumItem((const sal_uInt16)SID_ENUM_PAGE_MODE, SVX_PAGE_MODE_CENTER));
+            rTabPage.PageCreated(aSet);
+        }
+        else if (nPageId == m_nHeaderId || nPageId == m_nFooterId)
+        {
+            ((ScHFPage&)rTabPage).SetStyleDlg( this );
+            ((ScHFPage&)rTabPage).SetPageStyle( GetStyleSheet().GetName() );
+            ((ScHFPage&)rTabPage).DisableDeleteQueryBox();
+        }
+        else if (nPageId == m_nBackgroundId)
         {
-            case TP_PAGE_STD:
-                aSet.Put (SfxAllEnumItem((const sal_uInt16)SID_ENUM_PAGE_MODE, SVX_PAGE_MODE_CENTER));
-                rTabPage.PageCreated(aSet);
-                break;
-
-            case TP_PAGE_HEADER:
-            case TP_PAGE_FOOTER:
-                ((ScHFPage&)rTabPage).SetStyleDlg( this );
-                ((ScHFPage&)rTabPage).SetPageStyle( GetStyleSheet().GetName() );
-                ((ScHFPage&)rTabPage).DisableDeleteQueryBox();
-                break;
-            case TP_BACKGROUND:
-                    if( nDlgRsc == RID_SCDLG_STYLES_PAGE)
-                    {
-                        aSet.Put (SfxUInt32Item(SID_FLAG_TYPE, SVX_SHOW_SELECTOR));
-                        rTabPage.PageCreated(aSet);
-                    }
-                break;
-
-            default:
-                break;
+            aSet.Put (SfxUInt32Item(SID_FLAG_TYPE, SVX_SHOW_SELECTOR));
+            rTabPage.PageCreated(aSet);
         }
     }
 }
@@ -203,6 +192,4 @@ const SfxItemSet* ScStyleDlg::GetRefreshedSet()
     return pItemSet;
 }
 
-
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/styleui/styledlg.src b/sc/source/ui/styleui/styledlg.src
deleted file mode 100644
index 9df424a..0000000
--- a/sc/source/ui/styleui/styledlg.src
+++ /dev/null
@@ -1,131 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include "sc.hrc"
-#include "styledlg.hrc" // -> TP_xxx
-
-TabDialog RID_SCDLG_STYLES_PAR
-{
-    OutputSize = TRUE ;
-    SVLook = TRUE ;
-    Size = MAP_APPFONT ( 289 , 176 ) ;
-    Text [ en-US ] = "Cell Style" ;
-    Moveable = TRUE ;
-    Closeable = FALSE ;
-    TabControl 1
-    {
-        OutputSize = TRUE ;
-        Pos = MAP_APPFONT ( 3 , 3 ) ;
-        Size = MAP_APPFONT ( 260 , 135 ) ;
-        PageList =
-        {
-            PageItem
-            {
-                Identifier = TP_NUMBER ;
-                Text [ en-US ] = "Numbers" ;
-            };
-            PageItem
-            {
-                Identifier = TP_FONT ;
-                Text [ en-US ] = "Font" ;
-            };
-            PageItem
-            {
-                Identifier = TP_FONTEFF ;
-                Text [ en-US ] = "Font Effects";
-            };
-            PageItem
-            {
-                Identifier = TP_ALIGNMENT ;
-                Text [ en-US ] = "Alignment" ;
-            };
-            PageItem
-            {
-                Identifier = TP_ASIAN ;
-                Text [ en-US ] = "Asian Typography";
-            };
-            PageItem
-            {
-                Identifier = TP_BORDER ;
-                Text [ en-US ] = "Borders" ;
-            };
-            PageItem
-            {
-                Identifier = TP_BACKGROUND ;
-                Text [ en-US ] = "Background" ;
-            };
-            PageItem
-            {
-                Identifier = TP_PROTECTION ;
-                Text [ en-US ] = "Cell Protection" ;
-            };
-        };
-    };
-};
-
-TabDialog RID_SCDLG_STYLES_PAGE
-{
-    OutputSize = TRUE ;
-    SVLook = TRUE ;
-    Size = MAP_APPFONT ( 280 , 165 ) ;
-    Text [ en-US ] = "Page Style" ;
-    Moveable = TRUE ;
-    Closeable = FALSE ;
-    TabControl 1
-    {
-        OutputSize = TRUE ;
-        Pos = MAP_APPFONT ( 3 , 6 ) ;
-        Size = MAP_APPFONT ( 260 , 135 ) ;
-        PageList =
-        {
-            PageItem
-            {
-                Identifier = TP_PAGE_STD ;
-                Text [ en-US ] = "Page" ;
-            };
-            PageItem
-            {
-                Identifier = TP_BORDER ;
-                Text [ en-US ] = "Borders" ;
-            };
-            PageItem
-            {
-                Identifier = TP_BACKGROUND ;
-                Text [ en-US ] = "Background" ;
-            };
-            PageItem
-            {
-                Identifier = TP_PAGE_HEADER ;
-                Text [ en-US ] = "Header" ;
-            };
-            PageItem
-            {
-                Identifier = TP_PAGE_FOOTER ;
-                Text [ en-US ] = "Footer" ;
-            };
-            PageItem
-            {
-                Identifier = TP_TABLE ;
-                Text [ en-US ] = "Sheet" ;
-            };
-        };
-    };
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/uiconfig/scalc/ui/pagetemplatedialog.ui b/sc/uiconfig/scalc/ui/pagetemplatedialog.ui
new file mode 100644
index 0000000..192ed97
--- /dev/null
+++ b/sc/uiconfig/scalc/ui/pagetemplatedialog.ui
@@ -0,0 +1,203 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 3.0 -->
+  <object class="GtkDialog" id="PageTemplateDialog">
+    <property name="can_focus">False</property>
+    <property name="border_width">6</property>
+    <property name="title" translatable="yes">Page Style</property>
+    <property name="type_hint">dialog</property>
+    <child internal-child="vbox">
+      <object class="GtkBox" id="dialog-vbox1">
+        <property name="can_focus">False</property>
+        <property name="orientation">vertical</property>
+        <property name="spacing">12</property>
+        <child internal-child="action_area">
+          <object class="GtkButtonBox" id="dialog-action_area1">
+            <property name="can_focus">False</property>
+            <property name="layout_style">end</property>
+            <child>
+              <object class="GtkButton" id="ok">
+                <property name="label">gtk-ok</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="can_default">True</property>
+                <property name="has_default">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="cancel">
+                <property name="label">gtk-cancel</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="help">
+                <property name="label">gtk-help</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">2</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="reset">
+                <property name="label">gtk-revert-to-saved</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">3</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="GtkNotebook" id="tabcontrol">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="hexpand">True</property>
+            <property name="vexpand">True</property>
+            <child>
+              <placeholder/>
+            </child>
+            <child type="tab">
+              <object class="GtkLabel" id="organizer">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Organizer</property>
+              </object>
+              <packing>
+                <property name="tab_fill">False</property>
+              </packing>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child type="tab">
+              <object class="GtkLabel" id="page">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Page</property>
+              </object>
+              <packing>
+                <property name="position">1</property>
+                <property name="tab_fill">False</property>
+              </packing>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child type="tab">
+              <object class="GtkLabel" id="borders">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Borders</property>
+              </object>
+              <packing>
+                <property name="position">2</property>
+                <property name="tab_fill">False</property>
+              </packing>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child type="tab">
+              <object class="GtkLabel" id="background">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Background</property>
+              </object>
+              <packing>
+                <property name="position">3</property>
+                <property name="tab_fill">False</property>
+              </packing>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child type="tab">
+              <object class="GtkLabel" id="header">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Header</property>
+              </object>
+              <packing>
+                <property name="position">4</property>
+                <property name="tab_fill">False</property>
+              </packing>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child type="tab">
+              <object class="GtkLabel" id="footer">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Footer</property>
+              </object>
+              <packing>
+                <property name="position">5</property>
+                <property name="tab_fill">False</property>
+              </packing>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child type="tab">
+              <object class="GtkLabel" id="sheet">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Sheet</property>
+              </object>
+              <packing>
+                <property name="position">6</property>
+                <property name="tab_fill">False</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</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">reset</action-widget>
+    </action-widgets>
+  </object>
+</interface>
diff --git a/sc/uiconfig/scalc/ui/paratemplatedialog.ui b/sc/uiconfig/scalc/ui/paratemplatedialog.ui
new file mode 100644
index 0000000..3551b39
--- /dev/null
+++ b/sc/uiconfig/scalc/ui/paratemplatedialog.ui
@@ -0,0 +1,246 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 3.0 -->
+  <object class="GtkDialog" id="ParaTemplateDialog">
+    <property name="can_focus">False</property>
+    <property name="border_width">6</property>
+    <property name="title" translatable="yes">Cell Style</property>
+    <property name="type_hint">dialog</property>
+    <child internal-child="vbox">
+      <object class="GtkBox" id="dialog-vbox1">
+        <property name="can_focus">False</property>
+        <property name="orientation">vertical</property>
+        <property name="spacing">12</property>
+        <child internal-child="action_area">
+          <object class="GtkButtonBox" id="dialog-action_area1">
+            <property name="can_focus">False</property>
+            <property name="layout_style">end</property>
+            <child>
+              <object class="GtkButton" id="ok">
+                <property name="label">gtk-ok</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="can_default">True</property>
+                <property name="has_default">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="cancel">
+                <property name="label">gtk-cancel</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="help">
+                <property name="label">gtk-help</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">2</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="reset">
+                <property name="label">gtk-revert-to-saved</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">3</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="standard">
+                <property name="label">_Standard</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_underline">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">4</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="GtkNotebook" id="tabcontrol">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="hexpand">True</property>
+            <property name="vexpand">True</property>
+            <child>
+              <placeholder/>
+            </child>
+            <child type="tab">
+              <object class="GtkLabel" id="organizer">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Organizer</property>
+              </object>
+              <packing>
+                <property name="tab_fill">False</property>
+              </packing>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child type="tab">
+              <object class="GtkLabel" id="numbers">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Numbers</property>
+              </object>
+              <packing>
+                <property name="position">1</property>
+                <property name="tab_fill">False</property>
+              </packing>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child type="tab">
+              <object class="GtkLabel" id="font">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Font</property>
+              </object>
+              <packing>
+                <property name="position">2</property>
+                <property name="tab_fill">False</property>
+              </packing>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child type="tab">
+              <object class="GtkLabel" id="fonteffects">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Font Effects</property>
+              </object>
+              <packing>
+                <property name="position">3</property>
+                <property name="tab_fill">False</property>
+              </packing>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child type="tab">
+              <object class="GtkLabel" id="alignment">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Alignment</property>
+              </object>
+              <packing>
+                <property name="position">4</property>
+                <property name="tab_fill">False</property>
+              </packing>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child type="tab">
+              <object class="GtkLabel" id="asiantypo">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Asian Typography</property>
+              </object>
+              <packing>
+                <property name="position">5</property>
+                <property name="tab_fill">False</property>
+              </packing>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child type="tab">
+              <object class="GtkLabel" id="borders">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Borders</property>
+              </object>
+              <packing>
+                <property name="position">6</property>
+                <property name="tab_fill">False</property>
+              </packing>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child type="tab">
+              <object class="GtkLabel" id="background">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Background</property>
+              </object>
+              <packing>
+                <property name="position">7</property>
+                <property name="tab_fill">False</property>
+              </packing>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child type="tab">
+              <object class="GtkLabel" id="protection">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Cell Protection</property>
+              </object>
+              <packing>
+                <property name="position">8</property>
+                <property name="tab_fill">False</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</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">reset</action-widget>
+      <action-widget response="0">standard</action-widget>
+    </action-widgets>
+  </object>
+</interface>
diff --git a/sd/AllLangResTarget_sd.mk b/sd/AllLangResTarget_sd.mk
index f9ab04e..cf72ea4 100644
--- a/sd/AllLangResTarget_sd.mk
+++ b/sd/AllLangResTarget_sd.mk
@@ -61,7 +61,6 @@ $(eval $(call gb_SrsTarget_add_files,sd/res,\
     sd/source/ui/dlg/prltempl.src \
     sd/source/ui/dlg/RemoteDialog.src \
     sd/source/ui/dlg/sdpreslt.src \
-    sd/source/ui/dlg/tabtempl.src \
     sd/source/ui/dlg/tpaction.src \
     sd/source/ui/dlg/vectdlg.src \
     sd/source/ui/slideshow/slideshow.src \
diff --git a/sd/UIConfig_simpress.mk b/sd/UIConfig_simpress.mk
index 5706e46..5485eff 100644
--- a/sd/UIConfig_simpress.mk
+++ b/sd/UIConfig_simpress.mk
@@ -70,18 +70,19 @@ $(eval $(call gb_UIConfig_add_toolbarfiles,modules/simpress,\
 ))
 
 $(eval $(call gb_UIConfig_add_uifiles,modules/simpress,\
+	sd/uiconfig/simpress/ui/customanimationcreatedialog \
+	sd/uiconfig/simpress/ui/customanimationcreatetab \
+	sd/uiconfig/simpress/ui/customanimationspanel \
+	sd/uiconfig/simpress/ui/customslideshows \
 	sd/uiconfig/simpress/ui/definecustomslideshow \
 	sd/uiconfig/simpress/ui/masterlayoutdlg \
-	sd/uiconfig/simpress/ui/sdviewpage \
+	sd/uiconfig/simpress/ui/optimpressgeneralpage \
+	sd/uiconfig/simpress/ui/photoalbum \
 	sd/uiconfig/simpress/ui/presentationdialog \
 	sd/uiconfig/simpress/ui/printeroptions \
-	sd/uiconfig/simpress/ui/photoalbum \
-	sd/uiconfig/simpress/ui/customslideshows \
-	sd/uiconfig/simpress/ui/optimpressgeneralpage \
 	sd/uiconfig/simpress/ui/prntopts \
-	sd/uiconfig/simpress/ui/customanimationspanel \
-	sd/uiconfig/simpress/ui/customanimationcreatedialog \
-	sd/uiconfig/simpress/ui/customanimationcreatetab \
+	sd/uiconfig/simpress/ui/sdviewpage \
+	sd/uiconfig/simpress/ui/templatedialog \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/sd/source/ui/dlg/tabtempl.cxx b/sd/source/ui/dlg/tabtempl.cxx
index 33b34cd..7077321 100644
--- a/sd/source/ui/dlg/tabtempl.cxx
+++ b/sd/source/ui/dlg/tabtempl.cxx
@@ -38,7 +38,6 @@
 
 #include "DrawDocShell.hxx"
 #include "tabtempl.hxx"
-#include "tabtempl.hrc"
 #include "sdresid.hxx"
 #include "dlg_char.hxx"
 #include "paragr.hxx"
@@ -51,39 +50,53 @@ SdTabTemplateDlg::SdTabTemplateDlg( Window* pParent,
                                 const SfxObjectShell* pDocShell,
                                 SfxStyleSheetBase& rStyleBase,
                                 SdrModel* pModel,
-                                SdrView* pView ) :
-        SfxStyleDialog      ( pParent, SdResId( TAB_TEMPLATE ), rStyleBase, sal_False ),
-        rDocShell           ( *pDocShell ),
-        pSdrView            ( pView ),
-        pColorList          ( pModel->GetColorList() ),
-        pGradientList       ( pModel->GetGradientList() ),
-        pHatchingList       ( pModel->GetHatchList() ),
-        pBitmapList         ( pModel->GetBitmapList() ),
-        pDashList           ( pModel->GetDashList() ),
-        pLineEndList        ( pModel->GetLineEndList() )
+                                SdrView* pView )
+    : SfxStyleDialog(pParent, "TemplateDialog",
+        "modules/simpress/ui/templatedialog.ui",
+        rStyleBase)
+    , rDocShell(*pDocShell)
+    , pSdrView(pView)
+    , pColorList(pModel->GetColorList())
+    , pGradientList(pModel->GetGradientList())
+    , pHatchingList(pModel->GetHatchList())
+    , pBitmapList(pModel->GetBitmapList())
+    , pDashList(pModel->GetDashList())
+    , pLineEndList(pModel->GetLineEndList())
+    , m_nLineId(0)
+    , m_nAreaId(0)
+    , m_nShadowId(0)
+    , m_nTransparencyId(0)
+    , m_nFontId(0)
+    , m_nFontEffectId(0)
+    , m_nIndentsId(0)
+    , m_nTextId(0)
+    , m_nAnimationId(0)
+    , m_nDimensionId(0)
+    , m_nConnectorId(0)
+    , m_nAlignId(0)
+    , m_nTabId(0)
+    , m_nAsianTypoId(0)
 {
-    FreeResource();
-
     // fill Listbox and overload Select-Handler
 
-    AddTabPage( RID_SVXPAGE_LINE);
-    AddTabPage( RID_SVXPAGE_AREA);
-    AddTabPage( RID_SVXPAGE_SHADOW);
-    AddTabPage( RID_SVXPAGE_TRANSPARENCE);
-    AddTabPage( RID_SVXPAGE_CHAR_NAME );
-    AddTabPage( RID_SVXPAGE_CHAR_EFFECTS );
-    AddTabPage( RID_SVXPAGE_STD_PARAGRAPH );
-    AddTabPage( RID_SVXPAGE_TEXTATTR );
-    AddTabPage( RID_SVXPAGE_TEXTANIMATION );
-    AddTabPage( RID_SVXPAGE_MEASURE);
-    AddTabPage( RID_SVXPAGE_CONNECTION);
-    AddTabPage( RID_SVXPAGE_ALIGN_PARAGRAPH );
-    AddTabPage( RID_SVXPAGE_TABULATOR );
+    m_nLineId = AddTabPage("line", RID_SVXPAGE_LINE);
+    m_nAreaId = AddTabPage("area", RID_SVXPAGE_AREA);
+    m_nShadowId = AddTabPage("shadowing", RID_SVXPAGE_SHADOW);
+    m_nTransparencyId = AddTabPage("transparency", RID_SVXPAGE_TRANSPARENCE);
+    m_nFontId = AddTabPage("font", RID_SVXPAGE_CHAR_NAME);
+    m_nFontEffectId = AddTabPage("fonteffect", RID_SVXPAGE_CHAR_EFFECTS);
+    m_nIndentsId = AddTabPage("indents", RID_SVXPAGE_STD_PARAGRAPH);
+    m_nTextId = AddTabPage("text", RID_SVXPAGE_TEXTATTR);
+    m_nAnimationId = AddTabPage("animation", RID_SVXPAGE_TEXTANIMATION);
+    m_nDimensionId = AddTabPage("dimensioning", RID_SVXPAGE_MEASURE);
+    m_nConnectorId = AddTabPage("connector", RID_SVXPAGE_CONNECTION);
+    m_nAlignId = AddTabPage("alignment", RID_SVXPAGE_ALIGN_PARAGRAPH);
+    m_nTabId = AddTabPage("tabs", RID_SVXPAGE_TABULATOR);
     SvtCJKOptions aCJKOptions;
     if( aCJKOptions.IsAsianTypographyEnabled() )
-        AddTabPage( RID_SVXPAGE_PARA_ASIAN );
+        m_nAsianTypoId = AddTabPage("asiantype", RID_SVXPAGE_PARA_ASIAN);
     else
-        RemoveTabPage( RID_SVXPAGE_PARA_ASIAN );
+        RemoveTabPage("asiantypo");
 
     nDlgType = 1;
     nPageType = 0;
@@ -97,90 +110,68 @@ SdTabTemplateDlg::SdTabTemplateDlg( Window* pParent,
 
 // -----------------------------------------------------------------------
 
-SdTabTemplateDlg::~SdTabTemplateDlg()
-{
-}
-
-// -----------------------------------------------------------------------
-
 void SdTabTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
 {
     SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
-    switch( nId )
+    if (nId == m_nLineId)
+    {
+        aSet.Put (SvxColorListItem(pColorList,SID_COLOR_TABLE));
+        aSet.Put (SvxDashListItem(pDashList,SID_DASH_LIST));
+        aSet.Put (SvxLineEndListItem(pLineEndList,SID_LINEEND_LIST));
+        aSet.Put (SfxUInt16Item(SID_DLG_TYPE,nDlgType));
+        rPage.PageCreated(aSet);
+    }
+    else if (nId == m_nAreaId)
+    {
+        aSet.Put (SvxColorListItem(pColorList,SID_COLOR_TABLE));
+        aSet.Put (SvxGradientListItem(pGradientList,SID_GRADIENT_LIST));
+        aSet.Put (SvxHatchListItem(pHatchingList,SID_HATCH_LIST));
+        aSet.Put (SvxBitmapListItem(pBitmapList,SID_BITMAP_LIST));
+        aSet.Put (SfxUInt16Item(SID_PAGE_TYPE,nPageType));
+        aSet.Put (SfxUInt16Item(SID_DLG_TYPE,nDlgType));
+        aSet.Put (SfxUInt16Item(SID_TABPAGE_POS,nPos));
+        rPage.PageCreated(aSet);
+    }
+    else if (nId == m_nShadowId)
+    {
+        aSet.Put (SvxColorListItem(pColorList,SID_COLOR_TABLE));
+        aSet.Put (SfxUInt16Item(SID_PAGE_TYPE,nPageType));
+        aSet.Put (SfxUInt16Item(SID_DLG_TYPE,nDlgType));
+        rPage.PageCreated(aSet);
+    }
+    else if (nId == m_nTransparencyId)
+    {
+        aSet.Put (SfxUInt16Item(SID_PAGE_TYPE,nPageType));
+        aSet.Put (SfxUInt16Item(SID_DLG_TYPE,nDlgType));
+        rPage.PageCreated(aSet);
+    }
+    else if (nId == m_nFontId)
+    {
+        SvxFontListItem aItem(*( (const SvxFontListItem*)
+            ( rDocShell.GetItem( SID_ATTR_CHAR_FONTLIST) ) ) );
+
+        aSet.Put (SvxFontListItem( aItem.GetFontList(), SID_ATTR_CHAR_FONTLIST));
+        rPage.PageCreated(aSet);
+    }
+    else if (nId == m_nFontEffectId)
+    {
+        aSet.Put (SfxUInt16Item(SID_DISABLE_CTL,DISABLE_CASEMAP));
+        rPage.PageCreated(aSet);
+    }
+    else if (nId == m_nTextId)
+    {
+        aSet.Put(OfaPtrItem(SID_SVXTEXTATTRPAGE_VIEW,pSdrView));
+        rPage.PageCreated(aSet);
+    }
+    else if (nId == m_nDimensionId)
+    {
+        aSet.Put (OfaPtrItem(SID_OBJECT_LIST,pSdrView));
+        rPage.PageCreated(aSet);
+    }
+    else if (nId == m_nConnectorId)
     {
-        case RID_SVXPAGE_LINE:
-            aSet.Put (SvxColorListItem(pColorList,SID_COLOR_TABLE));
-            aSet.Put (SvxDashListItem(pDashList,SID_DASH_LIST));
-            aSet.Put (SvxLineEndListItem(pLineEndList,SID_LINEEND_LIST));
-            aSet.Put (SfxUInt16Item(SID_DLG_TYPE,nDlgType));
-            rPage.PageCreated(aSet);
-            break;
-
-        case RID_SVXPAGE_AREA:
-            aSet.Put (SvxColorListItem(pColorList,SID_COLOR_TABLE));
-            aSet.Put (SvxGradientListItem(pGradientList,SID_GRADIENT_LIST));
-            aSet.Put (SvxHatchListItem(pHatchingList,SID_HATCH_LIST));
-            aSet.Put (SvxBitmapListItem(pBitmapList,SID_BITMAP_LIST));
-            aSet.Put (SfxUInt16Item(SID_PAGE_TYPE,nPageType));
-            aSet.Put (SfxUInt16Item(SID_DLG_TYPE,nDlgType));
-            aSet.Put (SfxUInt16Item(SID_TABPAGE_POS,nPos));
-            rPage.PageCreated(aSet);
-
-
-        break;
-
-        case RID_SVXPAGE_SHADOW:
-                aSet.Put (SvxColorListItem(pColorList,SID_COLOR_TABLE));
-                aSet.Put (SfxUInt16Item(SID_PAGE_TYPE,nPageType));
-                aSet.Put (SfxUInt16Item(SID_DLG_TYPE,nDlgType));
-                rPage.PageCreated(aSet);
-            break;
-
-        case RID_SVXPAGE_TRANSPARENCE:
-                    aSet.Put (SfxUInt16Item(SID_PAGE_TYPE,nPageType));
-                    aSet.Put (SfxUInt16Item(SID_DLG_TYPE,nDlgType));
-                    rPage.PageCreated(aSet);
-        break;
-
-        case RID_SVXPAGE_CHAR_NAME:
-        {
-            SvxFontListItem aItem(*( (const SvxFontListItem*)
-                ( rDocShell.GetItem( SID_ATTR_CHAR_FONTLIST) ) ) );
-
-            aSet.Put (SvxFontListItem( aItem.GetFontList(), SID_ATTR_CHAR_FONTLIST));
-            rPage.PageCreated(aSet);
-        }
-        break;
-
-        case RID_SVXPAGE_CHAR_EFFECTS:
-            aSet.Put (SfxUInt16Item(SID_DISABLE_CTL,DISABLE_CASEMAP));
-            rPage.PageCreated(aSet);
-        break;
-
-        case RID_SVXPAGE_STD_PARAGRAPH:
-        break;
-
-        case RID_SVXPAGE_TEXTATTR:
-        {
-            aSet.Put(OfaPtrItem(SID_SVXTEXTATTRPAGE_VIEW,pSdrView));
-            rPage.PageCreated(aSet);
-        }
-        break;
-
-        case RID_SVXPAGE_TEXTANIMATION:
-        break;
-
-        case RID_SVXPAGE_MEASURE:
-            aSet.Put (OfaPtrItem(SID_OBJECT_LIST,pSdrView));
-            rPage.PageCreated(aSet);
-        break;
-
-        case RID_SVXPAGE_CONNECTION:
-        {
-            aSet.Put (OfaPtrItem(SID_OBJECT_LIST,pSdrView));
-            rPage.PageCreated(aSet);
-        }
-        break;
+        aSet.Put (OfaPtrItem(SID_OBJECT_LIST,pSdrView));
+        rPage.PageCreated(aSet);
     }
 }
 
diff --git a/sd/source/ui/dlg/tabtempl.src b/sd/source/ui/dlg/tabtempl.src
deleted file mode 100644
index be905b9..0000000
--- a/sd/source/ui/dlg/tabtempl.src
+++ /dev/null
@@ -1,148 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include "tabtempl.hrc"
-#include <svx/dialogs.hrc>
-TabDialog TAB_TEMPLATE
-{
-    OutputSize = TRUE ;
-    SVLook = TRUE ;
-    Size = MAP_APPFONT ( 289 , 176 ) ;
-    Text [ en-US ] = "Graphics Styles" ;
-    Moveable = TRUE ;
-     // Closeable = TRUE; // This dialog has an OK and/or a Cancel button! (KH)
-    TabControl 1
-    {
-        OutputSize = TRUE ;
-        Pos = MAP_APPFONT ( 3 , 3 ) ;
-        Size = MAP_APPFONT ( 260 , 135 ) ;
-        PageList =
-        {
-            PageItem
-            {
-                Identifier = RID_SVXPAGE_LINE ;
-                Text [ en-US ] = "Line" ;
-                PageResID = RID_SVXPAGE_LINE ;
-            };
-            PageItem
-            {
-                Identifier = RID_SVXPAGE_AREA ;
-                Text [ en-US ] = "Area" ;
-                PageResID = RID_SVXPAGE_AREA ;
-            };
-            PageItem
-            {
-                Identifier = RID_SVXPAGE_SHADOW ;
-                PageResID = RID_SVXPAGE_SHADOW ;
-                Text [ en-US ] = "Shadowing" ;
-            };
-            PageItem
-            {
-                Identifier = RID_SVXPAGE_TRANSPARENCE ;
-                Text [ en-US ] = "Transparency";
-            };
-            PageItem
-            {
-                Identifier = RID_SVXPAGE_CHAR_NAME;
-                Text [ en-US ] = "Font" ;
-                PageResID = RID_SVXPAGE_CHAR_NAME ;
-            };
-            PageItem
-            {
-                Identifier = RID_SVXPAGE_CHAR_EFFECTS ;
-                Text [ en-US ] = "Font Effect" ;
-                PageResID = RID_SVXPAGE_CHAR_EFFECTS ;
-            };
-            PageItem
-            {
-                Identifier = RID_SVXPAGE_STD_PARAGRAPH ;
-                Text [ en-US ] = "Indents & Spacing" ;
-                PageResID = RID_SVXPAGE_STD_PARAGRAPH ;
-            };
-            PageItem
-            {
-                Identifier = RID_SVXPAGE_TEXTATTR ;
-                PageResID = RID_SVXPAGE_TEXTATTR ;
-                Text [ en-US ] = "Text" ;
-            };
-            PageItem
-            {
-                Identifier = RID_SVXPAGE_TEXTANIMATION ;
-                PageResID = RID_SVXPAGE_TEXTANIMATION ;
-                Text [ en-US ] = "Text Animation" ;
-            };
-            PageItem
-            {
-                Identifier = RID_SVXPAGE_MEASURE ;
-                Text [ en-US ] = "Dimensioning" ;
-                PageResID = RID_SVXPAGE_MEASURE ;
-            };
-            PageItem
-            {
-                Identifier = RID_SVXPAGE_CONNECTION ;
-                Text [ en-US ] = "Connector" ;
-            };
-            PageItem
-            {
-                Identifier = RID_SVXPAGE_ALIGN_PARAGRAPH ;
-                PageResID = RID_SVXPAGE_ALIGN_PARAGRAPH ;
-                Text [ en-US ] = "Alignment" ;
-            };
-            PageItem
-            {
-                Identifier = RID_SVXPAGE_PARA_ASIAN ;
-                PageResID = RID_SVXPAGE_PARA_ASIAN ;
-                Text[ en-US ] = "Asian Typography";
-            };
-            PageItem
-            {
-                Identifier = RID_SVXPAGE_TABULATOR ;
-                Text [ en-US ] = "Tabs" ;
-                PageResID = RID_SVXPAGE_TABULATOR ;
-            };
-        };
-    };
-    OKButton 1
-    {
-        Pos = MAP_APPFONT ( 6 , 151 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-        TabStop = TRUE ;
-    };
-    CancelButton 1
-    {
-        Pos = MAP_APPFONT ( 60 , 151 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-        TabStop = TRUE ;
-    };
-    HelpButton 1
-    {
-        Pos = MAP_APPFONT ( 114 , 151 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-        TabStop = TRUE ;
-    };
-    PushButton 1
-    {
-        Pos = MAP_APPFONT ( 169 , 151 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-        Text [ en-US ] = "Back" ;
-        TabStop = TRUE ;
-    };
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/inc/tabtempl.hrc b/sd/source/ui/inc/tabtempl.hrc
deleted file mode 100644
index f477747..0000000
--- a/sd/source/ui/inc/tabtempl.hrc
+++ /dev/null
@@ -1,23 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-#include <sfx2/sfx.hrc>
-/* #define TAB_TEMPLATE     RID_APP_START+??? */
-#define TAB_TEMPLATE        637
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/inc/tabtempl.hxx b/sd/source/ui/inc/tabtempl.hxx
index b118282..3728870 100644
--- a/sd/source/ui/inc/tabtempl.hxx
+++ b/sd/source/ui/inc/tabtempl.hxx
@@ -52,17 +52,30 @@ private:
     ChangeType          nGradientListState;
     ChangeType          nHatchingListState;
 
+    sal_uInt16 m_nLineId;
+    sal_uInt16 m_nAreaId;
+    sal_uInt16 m_nShadowId;
+    sal_uInt16 m_nTransparencyId;
+    sal_uInt16 m_nFontId;
+    sal_uInt16 m_nFontEffectId;
+    sal_uInt16 m_nIndentsId;
+    sal_uInt16 m_nTextId;
+    sal_uInt16 m_nAnimationId;
+    sal_uInt16 m_nDimensionId;
+    sal_uInt16 m_nConnectorId;
+    sal_uInt16 m_nAlignId;
+    sal_uInt16 m_nTabId;
+    sal_uInt16 m_nAsianTypoId;
+
     virtual void                PageCreated( sal_uInt16 nId, SfxTabPage &rPage );
     virtual const SfxItemSet*   GetRefreshedSet();
 
 public:
-                    SdTabTemplateDlg( Window* pParent,
-                            const SfxObjectShell* pDocShell,
-                            SfxStyleSheetBase& rStyleBase,
-                            SdrModel* pModel,
-                            SdrView* pView );
-                    ~SdTabTemplateDlg();
-
+    SdTabTemplateDlg(Window* pParent,
+            const SfxObjectShell* pDocShell,
+            SfxStyleSheetBase& rStyleBase,
+            SdrModel* pModel,
+            SdrView* pView);
 };
 
 
diff --git a/sfx2/source/dialog/dialog.hrc b/sfx2/source/dialog/dialog.hrc
index 1e36560..6f9a8d1 100644
--- a/sfx2/source/dialog/dialog.hrc
+++ b/sfx2/source/dialog/dialog.hrc
@@ -35,7 +35,6 @@
 #define RID_DLG_ALIEN_WARNING           ( RC_DIALOG_BEGIN + 0)
 #define STR_RESET                       ( RC_DIALOG_BEGIN + 0)
 
-#define STR_TABPAGE_MANAGESTYLES        ( RC_DIALOG_BEGIN + 12)
 #define MSG_TABPAGE_INVALIDNAME         ( RC_DIALOG_BEGIN + 13)
 #define MSG_TABPAGE_INVALIDSTYLE        ( RC_DIALOG_BEGIN + 14)
 #define DLG_NEW_STYLE_BY_EXAMPLE        ( RC_DIALOG_BEGIN + 15)
diff --git a/sfx2/source/dialog/dialog.src b/sfx2/source/dialog/dialog.src
index d137b57..b1fffdb 100644
--- a/sfx2/source/dialog/dialog.src
+++ b/sfx2/source/dialog/dialog.src
@@ -30,10 +30,6 @@ String STR_APPLY
 {
     Text [ en-US ] = "Apply";
 };
-String STR_TABPAGE_MANAGESTYLES
-{
-    Text [ en-US ] = "Organizer" ;
-};
 InfoBox MSG_TABPAGE_INVALIDNAME
 {
     BUTTONS = WB_OK ;
diff --git a/sfx2/source/dialog/styledlg.cxx b/sfx2/source/dialog/styledlg.cxx
index 35236ca..933b4da 100644
--- a/sfx2/source/dialog/styledlg.cxx
+++ b/sfx2/source/dialog/styledlg.cxx
@@ -32,36 +32,31 @@
 
 SfxStyleDialog::SfxStyleDialog
 (
-    Window* pParent,            // Parent
-    const ResId& rResId,        // ResId
-    SfxStyleSheetBase& rStyle,  // stylesheet to be processed
-    sal_Bool bFreeRes,              // Flag release resources
-    const String* pUserBtnTxt
-) :
+    Window* pParent,           // Parent
+    const OString& rID, const OUString& rUIXMLDescription,
+    SfxStyleSheetBase& rStyle  // stylesheet to be processed
+)
 
 /*  [Description]
 
     Constructor: Add Manage TabPage, set ExampleSet from style.
 */
 
-    SfxTabDialog( pParent, rResId,
+    : SfxTabDialog( pParent, rID, rUIXMLDescription,
                   rStyle.GetItemSet().Clone(),
                   // return TRUE also without ParentSupport , but extended
                   // to suppress the standardButton
-                  rStyle.HasParentSupport() ? sal_True : 2,
-                  pUserBtnTxt ),
+                  rStyle.HasParentSupport() ? sal_True : 2 )
 
-    pStyle( &rStyle )
+    , pStyle( &rStyle )
 
 {
-    AddTabPage( ID_TABPAGE_MANAGESTYLES,
-                SfxResId( STR_TABPAGE_MANAGESTYLES ).toString(),
-                SfxManageStyleSheetPage::Create, 0, sal_False, 0 );
+    m_nOrganizerId = AddTabPage("organizer", SfxManageStyleSheetPage::Create, 0);
 
     // With new template always set the management page as the current page
 
     if( rStyle.GetName().isEmpty() )
-        SetCurPageId( ID_TABPAGE_MANAGESTYLES );
+        SetCurPageId(m_nOrganizerId);
     else
     {
         OUString sTxt = OUString(GetText()) + ": " + rStyle.GetName();
@@ -70,8 +65,6 @@ SfxStyleDialog::SfxStyleDialog
     delete pExampleSet; // in SfxTabDialog::Ctor() already created
     pExampleSet = &pStyle->GetItemSet();
 
-    if ( bFreeRes )
-        FreeResource();
     GetCancelButton().SetClickHdl( LINK(this, SfxStyleDialog, CancelHdl) );
 }
 
@@ -131,7 +124,7 @@ IMPL_LINK( SfxStyleDialog, CancelHdl, Button *, pButton )
 
 {
     (void)pButton; //unused
-    SfxTabPage* pPage = GetTabPage( ID_TABPAGE_MANAGESTYLES );
+    SfxTabPage* pPage = GetTabPage(m_nOrganizerId);
 
     const SfxItemSet* pInSet = GetInputSetImpl();
     SfxWhichIter aIter( *pInSet );
diff --git a/sw/AllLangResTarget_sw.mk b/sw/AllLangResTarget_sw.mk
index 0d1cc07..c847ef7 100644
--- a/sw/AllLangResTarget_sw.mk
+++ b/sw/AllLangResTarget_sw.mk
@@ -111,7 +111,6 @@ $(eval $(call gb_SrsTarget_add_files,sw/res,\
     sw/source/ui/fldui/fldtdlg.src \
     sw/source/ui/fldui/fldui.src \
     sw/source/ui/fldui/fldvar.src \
-    sw/source/ui/fmtui/tmpdlg.src \
     sw/source/ui/frmdlg/frmpage.src \
     sw/source/ui/frmdlg/frmui.src \
     sw/source/ui/globdoc/globdoc.src \
diff --git a/sw/UIConfig_swriter.mk b/sw/UIConfig_swriter.mk
index 634ee53..f573d71 100644
--- a/sw/UIConfig_swriter.mk
+++ b/sw/UIConfig_swriter.mk
@@ -144,6 +144,11 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\
 	sw/uiconfig/swriter/ui/tablecolumnpage \
 	sw/uiconfig/swriter/ui/tableproperties \
 	sw/uiconfig/swriter/ui/tabletextflowpage \
+	sw/uiconfig/swriter/ui/templatedialog1 \
+	sw/uiconfig/swriter/ui/templatedialog2 \
+	sw/uiconfig/swriter/ui/templatedialog4 \
+	sw/uiconfig/swriter/ui/templatedialog8 \
+	sw/uiconfig/swriter/ui/templatedialog16 \
 	sw/uiconfig/swriter/ui/textgridpage \
 	sw/uiconfig/swriter/ui/titlepage \
 	sw/uiconfig/swriter/ui/viewoptionspage \
diff --git a/sw/inc/docsh.hxx b/sw/inc/docsh.hxx
index 48c5612..e060cb7 100644
--- a/sw/inc/docsh.hxx
+++ b/sw/inc/docsh.hxx
@@ -111,7 +111,7 @@ class SW_DLLPUBLIC SwDocShell: public SfxObjectShell, public SfxListener
         const sal_uInt16 nFamily,
         sal_uInt16 nMask,
         const sal_Bool bNew,
-        const sal_uInt16 nSlot = 0,
+        const OString sPageId = OString(),
         SwWrtShell* pActShell = 0,
         const sal_Bool bBasic = sal_False );
 
@@ -241,7 +241,7 @@ public:
     // Identifies slot by which the dialog is triggered. Used to activate certain dialog pane
     void FormatPage(
         const String& rPage,
-        const sal_uInt16 nSlot,
+        const OString& rPageId,
         SwWrtShell& rActShell );
 
     // #i59688#
diff --git a/sw/inc/fmtui.hrc b/sw/inc/fmtui.hrc
deleted file mode 100644
index 7e9f5fa..0000000
--- a/sw/inc/fmtui.hrc
+++ /dev/null
@@ -1,52 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef _FMTUI_HRC
-#define _FMTUI_HRC
-
-#include "rcid.hrc"
-
-#define DLG_NEW_FILE                (RC_FMTUI_BEGIN + 1)
-#define STR_PAGE_STD                            (RC_FMTUI_BEGIN + 2)
-#define STR_PAGE_BORDER                         (RC_FMTUI_BEGIN + 3)
-#define STR_PAGE_HEADER                         (RC_FMTUI_BEGIN + 4)
-#define STR_PAGE_FOOTER                         (RC_FMTUI_BEGIN + 5)
-#define STR_PAGE_COLUMN                         (RC_FMTUI_BEGIN + 6)
-#define STR_PAGE_FOOTNOTE                       (RC_FMTUI_BEGIN + 7)
-#define STR_PAGE_TEXTGRID                       (RC_FMTUI_BEGIN + 8)
-
-#define ST_CUSTOMIZE                1
-
-// Do not change relations to base 2!!!
-#define DLG_TEMPLATE_BASE           (RC_FMTUI_BEGIN + 40)
-#define DLG_TEMPLATE_1              (RC_FMTUI_BEGIN + 41)
-#define DLG_TEMPLATE_2              (RC_FMTUI_BEGIN + 42)
-#define DLG_TEMPLATE_3              (RC_FMTUI_BEGIN + 44)
-#define DLG_TEMPLATE_4              (RC_FMTUI_BEGIN + 48)
-#define DLG_TEMPLATE_5              (RC_FMTUI_BEGIN + 56)
-
-
-#if DLG_TEMPLATE_5 > RC_FMTUI_END
-#error Resource-Id Ueberlauf in #file, #line
-#endif
-
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/inc/globals.hrc b/sw/inc/globals.hrc
index a68ef4e..1d11797 100644
--- a/sw/inc/globals.hrc
+++ b/sw/inc/globals.hrc
@@ -129,26 +129,12 @@
 
 // TABPAGES -----------------------------------------------------------
 
-#define TP_PAGE_STD                 (RC_GLOBALS_BEGIN +  1)
-
-#define TP_PARA_STD                 (RC_GLOBALS_BEGIN +  3)
-#define TP_PARA_EXT                 (RC_GLOBALS_BEGIN +  4)
-
-#define TP_CHAR_STD                 (RC_GLOBALS_BEGIN +  7)
-#define TP_CHAR_EXT                 (RC_GLOBALS_BEGIN +  8)
-
-#define TP_TABULATOR                (RC_GLOBALS_BEGIN +  9)
-#define TP_DROPCAPS                 (RC_GLOBALS_BEGIN +  10)
 #define TP_BACKGROUND               (RC_GLOBALS_BEGIN +  11)
 #define TP_BORDER                   (RC_GLOBALS_BEGIN +  12)
 #define TP_COLUMN                   (RC_GLOBALS_BEGIN +  13)
 
 #define TP_DOC_STAT                 (RC_GLOBALS_BEGIN +  15)
 
-#define TP_HEADER_PAGE              (RC_GLOBALS_BEGIN +  16)
-#define TP_FOOTER_PAGE              (RC_GLOBALS_BEGIN +  17)
-#define TP_FOOTNOTE_PAGE            (RC_GLOBALS_BEGIN +  18)
-
 // Sw-pages
 #define TP_OPTTEST_PAGE             (RC_GLOBALS_BEGIN +  25)
 #define TP_OPTPRINT_PAGE            (RC_GLOBALS_BEGIN +  26)
@@ -171,8 +157,6 @@
 #define TP_FRM_WRAP                 (RC_GLOBALS_BEGIN +  49)
 #define TP_FRM_ADD                  (RC_GLOBALS_BEGIN +  51)
 
-#define TP_PARA_ALIGN               (RC_GLOBALS_BEGIN +  55)
-
 #define TP_NUMBER                   (RC_GLOBALS_BEGIN +  57)
 
 #define TP_FLD_DB                   (RC_GLOBALS_BEGIN +  64)
@@ -183,8 +167,6 @@
 #define TP_FLD_REF                  (RC_GLOBALS_BEGIN +  69)
 
 #define TP_OPTSHDWCRSR              (RC_GLOBALS_BEGIN +  70)
-#define TP_NUMPARA                  (RC_GLOBALS_BEGIN +  73)
-
 
 
 #define TP_OPTCAPTION_PAGE          (RC_GLOBALS_BEGIN +  78)
@@ -198,10 +180,6 @@
 #define DLG_ADD_IDX_STYLES          (RC_GLOBALS_BEGIN +  94)
 #define TP_PRIVATE_DATA             (RC_GLOBALS_BEGIN +  95)
 #define TP_BUSINESS_DATA            (RC_GLOBALS_BEGIN +  96)
-#define TP_CHAR_POS                 (RC_GLOBALS_BEGIN +  98)
-#define TP_CHAR_TWOLN               (RC_GLOBALS_BEGIN +  99)
-#define TP_PARA_ASIAN               (RC_GLOBALS_BEGIN +  100)
-#define TP_TEXTGRID_PAGE            (RC_GLOBALS_BEGIN +  101)
 #define TP_OPTCOMPATIBILITY_PAGE    (RC_GLOBALS_BEGIN +  103)
 #define TP_MAILCONFIG               (RC_GLOBALS_BEGIN +  104)
 //maximum: RC_GLOBALS_BEGIN +  120
diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx
index ad7c3f1..1d372b2 100644
--- a/sw/inc/swabstdlg.hxx
+++ b/sw/inc/swabstdlg.hxx
@@ -367,7 +367,7 @@ public:
                                                     sal_uInt8 nDialogMode,
                                                     const String *pCollName = 0,
                                                     sal_Bool bDraw = sal_False,
-                                                    sal_uInt16 nDefPage = 0) = 0;
+                                                    OString sDefPage = OString() ) = 0;
 
     virtual AbstractSwSelGlossaryDlg * CreateSwSelGlossaryDlg(Window * pParent, const String &rShortName) = 0; //add for SwSelGlossaryDlg
 
@@ -406,9 +406,9 @@ public:
                                                 Window*             pParent,
                                                 SfxStyleSheetBase&  rBase,
                                                 sal_uInt16          nRegion,
-                                                const sal_uInt16 nSlot = 0,
+                                                OString             sPage = OString(),
                                                 SwWrtShell*         pActShell = 0,
-                                                sal_Bool            bNew = sal_False ) = 0; //add for SwTemplateDlg
+                                                bool                bNew = false) = 0; //add for SwTemplateDlg
     virtual AbstractGlossaryDlg*        CreateGlossaryDlg(SfxViewFrame* pViewFrame,
                                                 SwGlossaryHdl* pGlosHdl,
                                                 SwWrtShell *pWrtShell) = 0; //add for SwGlossaryDlg
diff --git a/sw/source/ui/app/docst.cxx b/sw/source/ui/app/docst.cxx
index 6e0594f..18095f9 100644
--- a/sw/source/ui/app/docst.cxx
+++ b/sw/source/ui/app/docst.cxx
@@ -73,7 +73,6 @@
 #include "unochart.hxx"
 
 #include "app.hrc"
-#include <fmtui.hrc>
 #include "swabstdlg.hxx"
 
 #include <list.hxx>
@@ -620,7 +619,7 @@ sal_uInt16 SwDocShell::Edit(
     const sal_uInt16 nFamily,
     sal_uInt16 nMask,
     const sal_Bool bNew,
-    const sal_uInt16 nSlot,
+    const OString sPage,
     SwWrtShell* pActShell,
     const sal_Bool bBasic )
 {
@@ -785,7 +784,7 @@ sal_uInt16 SwDocShell::Edit(
         SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
         OSL_ENSURE(pFact, "Dialogdiet fail!");
         SfxAbstractApplyTabDialog* pDlg = pFact->CreateTemplateDialog(
-                                                    0, *(xTmp.get()), nFamily, nSlot,
+                                                    0, *(xTmp.get()), nFamily, sPage,
                                                     pActShell ? pActShell : pWrtShell, bNew);
         OSL_ENSURE(pDlg, "Dialogdiet fail!");
         ApplyStyle aApplyStyleHelper(*this, bNew, pStyle, nRet, xTmp, nFamily, pDlg, mxBasePool, bModified);
@@ -1314,10 +1313,10 @@ void SwDocShell::_LoadStyles( SfxObjectShell& rSource, sal_Bool bPreserveCurrent
 
 void SwDocShell::FormatPage(
     const String& rPage,
-    const sal_uInt16 nSlot,
+    const OString& rPageId,
     SwWrtShell& rActShell )
 {
-    Edit( rPage, aEmptyStr, SFX_STYLE_FAMILY_PAGE, 0, sal_False, nSlot, &rActShell);
+    Edit( rPage, aEmptyStr, SFX_STYLE_FAMILY_PAGE, 0, sal_False, rPageId, &rActShell);
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/chrdlg/pardlg.cxx b/sw/source/ui/chrdlg/pardlg.cxx
index 20b4f95..7686e40 100644
--- a/sw/source/ui/chrdlg/pardlg.cxx
+++ b/sw/source/ui/chrdlg/pardlg.cxx
@@ -50,7 +50,7 @@ SwParaDlg::SwParaDlg(Window *pParent,
                     sal_uInt8 nDialogMode,
                     const String *pTitle,
                     sal_Bool bDraw,
-                    sal_uInt16 nDefPage)
+                    OString sDefPage)
     : SfxTabDialog(pParent,
                  "ParagraphPropertiesDialog",
                  "modules/swriter/ui/paradialog.ui",
@@ -162,8 +162,8 @@ SwParaDlg::SwParaDlg(Window *pParent,
         m_nParaBorder = AddTabPage("labelTP_BORDER", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ) );
     }
 
-    if (nDefPage)
-        SetCurPageId(nDefPage);
+    if (!sDefPage.isEmpty())
+        SetCurPageId(sDefPage);
 }
 
 
diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx
index ea0dd39b..5192ddb 100644
--- a/sw/source/ui/dialog/swdlgfact.cxx
+++ b/sw/source/ui/dialog/swdlgfact.cxx
@@ -32,7 +32,6 @@
 #include "dochdl.hrc"
 #include <index.hrc>
 #include <regionsw.hrc>
-#include <fmtui.hrc>
 
 #include <wordcountdialog.hxx>
 #include "abstract.hxx" // add for SwInsertAbstractDlg
@@ -822,9 +821,9 @@ SfxAbstractTabDialog* SwAbstractDialogFactory_Impl::CreateSwParaDlg ( Window *pP
                                                     sal_uInt8 nDialogMode,
                                                     const String *pCollName,
                                                     sal_Bool bDraw ,
-                                                    sal_uInt16 nDefPage)
+                                                    OString sDefPage)
 {
-    SfxTabDialog* pDlg = new SwParaDlg( pParent, rVw, rCoreSet,nDialogMode, pCollName, bDraw, nDefPage );
+    SfxTabDialog* pDlg = new SwParaDlg( pParent, rVw, rCoreSet,nDialogMode, pCollName, bDraw, sDefPage );
     return new AbstractTabDialog_Impl( pDlg );
 }
 
@@ -987,11 +986,11 @@ SfxAbstractApplyTabDialog* SwAbstractDialogFactory_Impl::CreateTemplateDialog(
                                                 Window*             pParent,
                                                 SfxStyleSheetBase&  rBase,
                                                 sal_uInt16          nRegion,
-                                                const sal_uInt16    nSlot,
+                                                OString             sPage,
                                                 SwWrtShell*         pActShell,
-                                                sal_Bool            bNew ) //add for SwTemplateDlg
+                                                bool                bNew ) //add for SwTemplateDlg
 {
-    SfxTabDialog* pDlg = new SwTemplateDlg( pParent, rBase, nRegion, nSlot, pActShell, bNew );
+    SfxTabDialog* pDlg = new SwTemplateDlg( pParent, rBase, nRegion, sPage, pActShell, bNew );
     return new AbstractApplyTabDialog_Impl( pDlg );
 }
 
diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx
index e006049..3d2c25a 100644
--- a/sw/source/ui/dialog/swdlgfact.hxx
+++ b/sw/source/ui/dialog/swdlgfact.hxx
@@ -468,7 +468,7 @@ public:
                                                     sal_uInt8 nDialogMode,
                                                     const String *pCollName = 0,
                                                     sal_Bool bDraw = sal_False,
-                                                    sal_uInt16 nDefPage = 0);
+                                                    OString sDefPage = OString() );
 
     virtual AbstractSwSelGlossaryDlg * CreateSwSelGlossaryDlg(Window * pParent, const String &rShortName); //add for SwSelGlossaryDlg
     virtual VclAbstractDialog * CreateVclAbstractDialog ( Window * pParent, SwWrtShell &rSh, int nResId ); //add for  SwTableHeightDlg SwSortDlg
@@ -501,10 +501,10 @@ public:
     virtual SfxAbstractApplyTabDialog*  CreateTemplateDialog(
                                                 Window*             pParent,
                                                 SfxStyleSheetBase&  rBase,
-                                                sal_uInt16              nRegion,
-                                                const sal_uInt16 nSlot = 0,
+                                                sal_uInt16          nRegion,
+                                                OString             sPage = OString(),
                                                 SwWrtShell*         pActShell = 0,
-                                                sal_Bool                bNew = sal_False ); //add for SwTemplateDlg
+                                                bool                bNew = false); //add for SwTemplateDlg
     virtual AbstractGlossaryDlg*        CreateGlossaryDlg(SfxViewFrame* pViewFrame,
                                                 SwGlossaryHdl* pGlosHdl,
                                                 SwWrtShell *pWrtShell); //add for SwGlossaryDlg
diff --git a/sw/source/ui/docvw/HeaderFooterWin.cxx b/sw/source/ui/docvw/HeaderFooterWin.cxx
index b4b7ec7..edb65e6 100644
--- a/sw/source/ui/docvw/HeaderFooterWin.cxx
+++ b/sw/source/ui/docvw/HeaderFooterWin.cxx
@@ -401,13 +401,8 @@ void SwHeaderFooterWin::ExecuteCommand( sal_uInt16 nSlot )
     {
         case FN_HEADERFOOTER_EDIT:
             {
-                sal_uInt16 nPageId = TP_FOOTER_PAGE;
-                if ( m_bIsHeader )
-                    nPageId = TP_HEADER_PAGE;
-
-                rView.GetDocShell()->FormatPage(
-                        rStyleName,
-                        nPageId, rSh );
+                OString sPageId = m_bIsHeader ? OString("header") : OString("footer");
+                rView.GetDocShell()->FormatPage(rStyleName, sPageId, rSh);
             }
             break;
         case FN_HEADERFOOTER_BORDERBACK:
diff --git a/sw/source/ui/docvw/PageBreakWin.cxx b/sw/source/ui/docvw/PageBreakWin.cxx
index e61c901..507f3f5 100644
--- a/sw/source/ui/docvw/PageBreakWin.cxx
+++ b/sw/source/ui/docvw/PageBreakWin.cxx
@@ -243,7 +243,7 @@ void SwPageBreakWin::Select( )
 
                         SwPaM aPaM( *pNd );
                         SwPaMItem aPaMItem( pEditWin->GetView().GetPool( ).GetWhich( FN_PARAM_PAM ), &aPaM );
-                        SfxUInt16Item aItem( pEditWin->GetView().GetPool( ).GetWhich( SID_PARA_DLG ), TP_PARA_EXT );
+                        SfxStringItem aItem( pEditWin->GetView().GetPool( ).GetWhich( SID_PARA_DLG ), "textflow" );
                         pEditWin->GetView().GetViewFrame()->GetDispatcher()->Execute(
                                 SID_PARA_DLG, SFX_CALLMODE_SYNCHRON|SFX_CALLMODE_RECORD, &aItem, &aPaMItem, NULL );
                     }
diff --git a/sw/source/ui/fmtui/tmpdlg.cxx b/sw/source/ui/fmtui/tmpdlg.cxx
index 7ad860e..7e977dc 100644
--- a/sw/source/ui/fmtui/tmpdlg.cxx
+++ b/sw/source/ui/fmtui/tmpdlg.cxx
@@ -55,7 +55,6 @@
 #include <cmdid.h>
 #include <helpid.h>
 #include <globals.hrc>
-#include <fmtui.hrc>
 #include <SwStyleNameMapper.hxx>
 #include <svx/svxids.hrc>
 #include <svl/stritem.hxx>
@@ -73,23 +72,51 @@ extern SW_DLLPUBLIC SwWrtShell* GetActiveWrtShell();
     Description:    the dialog's carrier
  --------------------------------------------------------------------*/
 
-SwTemplateDlg::SwTemplateDlg(Window*            pParent,
+SwTemplateDlg::SwTemplateDlg(Window* pParent,
                              SfxStyleSheetBase& rBase,
-                             sal_uInt16             nRegion,
-                             const sal_uInt16 nSlot,
-                             SwWrtShell*        pActShell,
-                             sal_Bool               bNew ) :
-    SfxStyleDialog( pParent,
-                    SW_RES(DLG_TEMPLATE_BASE + nRegion),
-                    rBase,
-                    sal_False,
-                    0 ),
-    nType( nRegion ),
-    pWrtShell(pActShell),
-    bNewStyle(bNew)
+                             sal_uInt16 nRegion,
+                             OString sPage,
+                             SwWrtShell* pActShell,
+                             bool bNew)
+    : SfxStyleDialog(pParent,
+                    OString("TemplateDialog") + OString::number(nRegion),
+                    OUString("modules/swriter/ui/templatedialog") +
+                        OUString::number(nRegion) + OUString(".ui"),
+                    rBase)
+    , nType(nRegion)
+    , pWrtShell(pActShell)
+    , bNewStyle(bNew)
+    , m_nIndentsId(0)
+    , m_nAlignId(0)
+    , m_nTextFlowId(0)
+    , m_nAsianTypo(0)
+    , m_nFontId(0)
+    , m_nFontEffectId(0)
+    , m_nPositionId(0)
+    , m_nAsianLayoutId(0)
+    , m_nTabId(0)
+    , m_nOutlineId(0)
+    , m_nDropCapsId(0)
+    , m_nBackgroundId(0)
+    , m_nBorderId(0)
+    , m_nConditionId(0)
+    , m_nTypeId(0)
+    , m_nOptionsId(0)
+    , m_nWrapId(0)
+    , m_nColumnId(0)
+    , m_nMacroId(0)
+    , m_nHeaderId(0)
+    , m_nFooterId(0)
+    , m_nPageId(0)
+    , m_nFootNoteId(0)
+    , m_nTextGridId(0)
+    , m_nSingleId(0)
+    , m_nBulletId(0)
+    , m_nNumId(0)
+    , m_nBmpId(0)
+    , m_nNumOptId(0)
+    , m_nNumPosId(0)
 {
-    FreeResource();
-
     nHtmlMode = ::GetHtmlMode(pWrtShell->GetView().GetDocShell());
     SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
     OSL_ENSURE(pFact, "Dialogdiet fail!");
@@ -101,136 +128,134 @@ SwTemplateDlg::SwTemplateDlg(Window*            pParent,
         {
             OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_NAME ), "GetTabPageCreatorFunc fail!");
             OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_NAME ) , "GetTabPageRangesFunc fail!");
-            AddTabPage(TP_CHAR_STD, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_NAME ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_NAME ) );
+            m_nFontId = AddTabPage("font", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_NAME ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_NAME ));
 
             OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_EFFECTS ), "GetTabPageCreatorFunc fail!");
             OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_EFFECTS ) , "GetTabPageRangesFunc fail!");
-            AddTabPage(TP_CHAR_EXT, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_EFFECTS ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_EFFECTS ) );
+            m_nFontEffectId = AddTabPage("fonteffect", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_EFFECTS ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_EFFECTS ));
 
             OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_POSITION ), "GetTabPageCreatorFunc fail!");
             OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_POSITION ) , "GetTabPageRangesFunc fail!");
-            AddTabPage(TP_CHAR_POS, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_POSITION ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_POSITION ) );
+            m_nPositionId = AddTabPage("position", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_POSITION ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_POSITION ));
 
             OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_TWOLINES ), "GetTabPageCreatorFunc fail!");
             OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_TWOLINES ) , "GetTabPageRangesFunc fail!");
-            AddTabPage(TP_CHAR_TWOLN, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_TWOLINES ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_TWOLINES ) );
+            m_nAsianLayoutId = AddTabPage("asianlayout", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_TWOLINES ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_TWOLINES ));
 
             OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageCreatorFunc fail!");
             OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ) , "GetTabPageRangesFunc fail!");
-            AddTabPage(TP_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ) );
+            m_nBackgroundId = AddTabPage("background", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ));
 
             SAL_WARN_IF(!pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), "sw.ui", "GetTabPageCreatorFunc fail!");
             SAL_WARN_IF(!pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ), "sw.ui", "GetTabPageRangesFunc fail!");
-            AddTabPage(TP_BORDER, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ) );
+            m_nBorderId = AddTabPage("borders", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ));
 
             SvtCJKOptions aCJKOptions;
             if(nHtmlMode & HTMLMODE_ON || !aCJKOptions.IsDoubleLinesEnabled())
-                RemoveTabPage(TP_CHAR_TWOLN);
+                RemoveTabPage("asianlayout");
         }
         break;
         // paragraph styles
         case SFX_STYLE_FAMILY_PARA:
         {
-                OSL_ENSURE(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_STD_PARAGRAPH), "GetTabPageCreatorFunc fail!");
-                OSL_ENSURE(pFact->GetTabPageRangesFunc(RID_SVXPAGE_STD_PARAGRAPH), "GetTabPageRangesFunc fail!");
-                AddTabPage( TP_PARA_STD,    pFact->GetTabPageCreatorFunc(RID_SVXPAGE_STD_PARAGRAPH),        pFact->GetTabPageRangesFunc(RID_SVXPAGE_STD_PARAGRAPH) );
-
-                OSL_ENSURE(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_ALIGN_PARAGRAPH), "GetTabPageCreatorFunc fail!");
-                OSL_ENSURE(pFact->GetTabPageRangesFunc(RID_SVXPAGE_ALIGN_PARAGRAPH), "GetTabPageRangesFunc fail!");
-                AddTabPage( TP_PARA_ALIGN,  pFact->GetTabPageCreatorFunc(RID_SVXPAGE_ALIGN_PARAGRAPH),      pFact->GetTabPageRangesFunc(RID_SVXPAGE_ALIGN_PARAGRAPH) );
+            OSL_ENSURE(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_STD_PARAGRAPH), "GetTabPageCreatorFunc fail!");
+            OSL_ENSURE(pFact->GetTabPageRangesFunc(RID_SVXPAGE_STD_PARAGRAPH), "GetTabPageRangesFunc fail!");
+            m_nIndentsId = AddTabPage("indents", pFact->GetTabPageCreatorFunc(RID_SVXPAGE_STD_PARAGRAPH),        pFact->GetTabPageRangesFunc(RID_SVXPAGE_STD_PARAGRAPH) );
 
-                OSL_ENSURE(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_EXT_PARAGRAPH), "GetTabPageCreatorFunc fail!");
-                OSL_ENSURE(pFact->GetTabPageRangesFunc(RID_SVXPAGE_EXT_PARAGRAPH), "GetTabPageRangesFunc fail!");
-                AddTabPage( TP_PARA_EXT,    pFact->GetTabPageCreatorFunc(RID_SVXPAGE_EXT_PARAGRAPH),        pFact->GetTabPageRangesFunc(RID_SVXPAGE_EXT_PARAGRAPH) );
+            OSL_ENSURE(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_ALIGN_PARAGRAPH), "GetTabPageCreatorFunc fail!");
+            OSL_ENSURE(pFact->GetTabPageRangesFunc(RID_SVXPAGE_ALIGN_PARAGRAPH), "GetTabPageRangesFunc fail!");
+            m_nAlignId = AddTabPage("alignment", pFact->GetTabPageCreatorFunc(RID_SVXPAGE_ALIGN_PARAGRAPH),      pFact->GetTabPageRangesFunc(RID_SVXPAGE_ALIGN_PARAGRAPH) );
 
-                OSL_ENSURE(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_PARA_ASIAN), "GetTabPageCreatorFunc fail!");
-                OSL_ENSURE(pFact->GetTabPageRangesFunc(RID_SVXPAGE_PARA_ASIAN), "GetTabPageRangesFunc fail!");
-                AddTabPage( TP_PARA_ASIAN,  pFact->GetTabPageCreatorFunc(RID_SVXPAGE_PARA_ASIAN),       pFact->GetTabPageRangesFunc(RID_SVXPAGE_PARA_ASIAN) );
+            OSL_ENSURE(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_EXT_PARAGRAPH), "GetTabPageCreatorFunc fail!");
+            OSL_ENSURE(pFact->GetTabPageRangesFunc(RID_SVXPAGE_EXT_PARAGRAPH), "GetTabPageRangesFunc fail!");
+            m_nTextFlowId = AddTabPage("textflow", pFact->GetTabPageCreatorFunc(RID_SVXPAGE_EXT_PARAGRAPH),        pFact->GetTabPageRangesFunc(RID_SVXPAGE_EXT_PARAGRAPH) );
 
-                OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_NAME ), "GetTabPageCreatorFunc fail!");
-                OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_NAME ), "GetTabPageRangesFunc fail!");
-                AddTabPage(TP_CHAR_STD, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_NAME ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_NAME ) );
+            OSL_ENSURE(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_PARA_ASIAN), "GetTabPageCreatorFunc fail!");
+            OSL_ENSURE(pFact->GetTabPageRangesFunc(RID_SVXPAGE_PARA_ASIAN), "GetTabPageRangesFunc fail!");
+            m_nAsianTypo = AddTabPage("asiantypo",  pFact->GetTabPageCreatorFunc(RID_SVXPAGE_PARA_ASIAN),       pFact->GetTabPageRangesFunc(RID_SVXPAGE_PARA_ASIAN) );
 
-                OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_EFFECTS ), "GetTabPageCreatorFunc fail!");
-                OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_EFFECTS ), "GetTabPageRangesFunc fail!");
-                AddTabPage(TP_CHAR_EXT, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_EFFECTS ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_EFFECTS ) );
+            OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_NAME ), "GetTabPageCreatorFunc fail!");
+            OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_NAME ), "GetTabPageRangesFunc fail!");
+            m_nFontId = AddTabPage("font", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_NAME ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_NAME ) );
 
-                OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_POSITION ), "GetTabPageCreatorFunc fail!");
-                OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_POSITION ) , "GetTabPageRangesFunc fail!");
-                AddTabPage(TP_CHAR_POS, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_POSITION ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_POSITION ) );
+            OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_EFFECTS ), "GetTabPageCreatorFunc fail!");
+            OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_EFFECTS ), "GetTabPageRangesFunc fail!");
+            m_nFontEffectId = AddTabPage("fonteffect", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_EFFECTS ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_EFFECTS ) );
 
-                OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_TWOLINES ), "GetTabPageCreatorFunc fail!");
-                OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_TWOLINES ) , "GetTabPageRangesFunc fail!");
-                AddTabPage(TP_CHAR_TWOLN, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_TWOLINES ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_TWOLINES ) );
+            OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_POSITION ), "GetTabPageCreatorFunc fail!");
+            OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_POSITION ) , "GetTabPageRangesFunc fail!");
+            m_nPositionId = AddTabPage("position", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_POSITION ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_POSITION ) );
 
+            OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_TWOLINES ), "GetTabPageCreatorFunc fail!");
+            OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_TWOLINES ) , "GetTabPageRangesFunc fail!");
+            m_nAsianLayoutId = AddTabPage("asianlayout", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_TWOLINES ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_TWOLINES ) );
 
             OSL_ENSURE(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_TABULATOR), "GetTabPageCreatorFunc fail!");
             OSL_ENSURE(pFact->GetTabPageRangesFunc(RID_SVXPAGE_TABULATOR), "GetTabPageRangesFunc fail!");
-            AddTabPage( TP_TABULATOR,   pFact->GetTabPageCreatorFunc(RID_SVXPAGE_TABULATOR),        pFact->GetTabPageRangesFunc(RID_SVXPAGE_TABULATOR) );
-
+            m_nTabId = AddTabPage("tabs", pFact->GetTabPageCreatorFunc(RID_SVXPAGE_TABULATOR),        pFact->GetTabPageRangesFunc(RID_SVXPAGE_TABULATOR) );
 
-            AddTabPage(TP_NUMPARA,   SwParagraphNumTabPage::Create,
+            m_nOutlineId = AddTabPage("outline", SwParagraphNumTabPage::Create,
                                     SwParagraphNumTabPage::GetRanges);
-            AddTabPage(TP_DROPCAPS,     SwDropCapsPage::Create,
+            m_nDropCapsId = AddTabPage("dropcaps", SwDropCapsPage::Create,
                                         SwDropCapsPage::GetRanges );
             OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageCreatorFunc fail!");
             OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageRangesFunc fail!");
-            AddTabPage(TP_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ) );
+            m_nBackgroundId = AddTabPage("background", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ) );
             OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), "GetTabPageCreatorFunc fail!");
             OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ), "GetTabPageRangesFunc fail!");
-            AddTabPage(TP_BORDER, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ) );
+            m_nBorderId = AddTabPage("borders", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ) );
 
-            AddTabPage( TP_CONDCOLL,    SwCondCollPage::Create,
+            m_nConditionId = AddTabPage("condition", SwCondCollPage::Create,
                                         SwCondCollPage::GetRanges );
             if( (!bNewStyle && RES_CONDTXTFMTCOLL != ((SwDocStyleSheet&)rBase).GetCollection()->Which())
             || nHtmlMode & HTMLMODE_ON )
-                RemoveTabPage(TP_CONDCOLL);
+                RemoveTabPage("condition");
 
             SvtCJKOptions aCJKOptions;
             if(nHtmlMode & HTMLMODE_ON)
             {
                 SvxHtmlOptions& rHtmlOpt = SvxHtmlOptions::Get();
                 if (!rHtmlOpt.IsPrintLayoutExtension())
-                    RemoveTabPage(TP_PARA_EXT);
-                RemoveTabPage(TP_PARA_ASIAN);
-                RemoveTabPage(TP_TABULATOR);
-                RemoveTabPage(TP_NUMPARA);
-                RemoveTabPage(TP_CHAR_TWOLN);
+                    RemoveTabPage("textflow");
+                RemoveTabPage("asiantypo");
+                RemoveTabPage("tabs");
+                RemoveTabPage("outline");
+                RemoveTabPage("asianlayout");
                 if(!(nHtmlMode & HTMLMODE_FULL_STYLES))
                 {
-                    RemoveTabPage(TP_BACKGROUND);
-                    RemoveTabPage(TP_DROPCAPS);
+                    RemoveTabPage("background");
+                    RemoveTabPage("dropcaps");
                 }
             }
             else
             {
                 if(!aCJKOptions.IsAsianTypographyEnabled())
-                    RemoveTabPage(TP_PARA_ASIAN);
+                    RemoveTabPage("asiantypo");
                 if(!aCJKOptions.IsDoubleLinesEnabled())
-                    RemoveTabPage(TP_CHAR_TWOLN);
+                    RemoveTabPage("asianlayout");
             }
         }
         break;
         // frame styles
         case SFX_STYLE_FAMILY_FRAME:
         {
-            AddTabPage(TP_FRM_STD,      SwFrmPage::Create,
-                                        SwFrmPage::GetRanges );
-            AddTabPage(TP_FRM_ADD,      SwFrmAddPage::Create,
-                                        SwFrmAddPage::GetRanges );
-            AddTabPage(TP_FRM_WRAP,     SwWrapTabPage::Create,
-                                        SwWrapTabPage::GetRanges );
+            m_nTypeId = AddTabPage("type", SwFrmPage::Create,
+                                        SwFrmPage::GetRanges);
+            m_nOptionsId = AddTabPage("options", SwFrmAddPage::Create,
+                                        SwFrmAddPage::GetRanges);
+            m_nWrapId = AddTabPage("wrap", SwWrapTabPage::Create,
+                                        SwWrapTabPage::GetRanges);
             OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageCreatorFunc fail!");
             OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageRangesFunc fail!");
-            AddTabPage(TP_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ) );
+            m_nBackgroundId = AddTabPage("background", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ) );
             OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), "GetTabPageCreatorFunc fail!");
             OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ), "GetTabPageRangesFunc fail!");
-            AddTabPage(TP_BORDER, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ) );
+            m_nBorderId = AddTabPage("borders", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ) );
 
-            AddTabPage(TP_COLUMN,       SwColumnPage::Create,
+            m_nColumnId = AddTabPage("columns", SwColumnPage::Create,
                                         SwColumnPage::GetRanges );
 
-            AddTabPage( TP_MACRO_ASSIGN, pFact->GetTabPageCreatorFunc(RID_SVXPAGE_MACROASSIGN), 0);
+            m_nMacroId = AddTabPage("macros", pFact->GetTabPageCreatorFunc(RID_SVXPAGE_MACROASSIGN), 0);
 
         break;
         }
@@ -239,74 +264,52 @@ SwTemplateDlg::SwTemplateDlg(Window*            pParent,
         {
             OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageCreatorFunc fail!");
             OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageRangesFunc fail!");
-            AddTabPage(TP_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ) );
-            AddTabPage(TP_HEADER_PAGE,      String(SW_RES(STR_PAGE_HEADER)),
-                                            SvxHeaderPage::Create,
-                                            SvxHeaderPage::GetRanges );
-            AddTabPage(TP_FOOTER_PAGE,      String(SW_RES(STR_PAGE_FOOTER)),

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list