chart2/source/controller/dialogs/dlg_ObjectProperties.cxx    |  368 +++++------
 chart2/source/controller/inc/dlg_ObjectProperties.hxx        |   10 
 chart2/source/controller/main/ChartController_Insert.cxx     |   18 
 chart2/source/controller/main/ChartController_Properties.cxx |   12 
 chart2/uiconfig/ui/attributedialog.ui                        |   33 
 include/sfx2/tabdlg.hxx                                      |   15 
 include/vcl/weld.hxx                                         |    1 
 sd/uiconfig/simpress/ui/templatedialog.ui                    |    4 
 sfx2/source/dialog/tabdlg.cxx                                |   41 -
 vcl/source/app/salvtables.cxx                                |   23 
 vcl/unx/gtk3/gtk3gtkinst.cxx                                 |   16 
 11 files changed, 290 insertions(+), 251 deletions(-)

New commits:
commit 8947c9b1d8cd407131fdfb6fc3c77c8532e9d2a0
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Thu Oct 18 13:00:41 2018 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Sat Oct 20 13:52:34 2018 +0200

    weld SchAttribTabDlg
    
    Change-Id: Ia53547b7b42a3ff8848085ab8f8d214259d5cc7b
    Reviewed-on: https://gerrit.libreoffice.org/61959
    Reviewed-by: Caolán McNamara <caol...@redhat.com>
    Tested-by: Caolán McNamara <caol...@redhat.com>

diff --git a/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx 
b/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx
index 47315d30a9ce..114d0cf97612 100644
--- a/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx
+++ b/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx
@@ -318,13 +318,12 @@ void 
SchAttribTabDlg::SetAxisMinorStepWidthForErrorBarDecimals( double fMinorSte
     m_fAxisMinorStepWidthForErrorBarDecimals = fMinorStepWidth;
 }
 
-SchAttribTabDlg::SchAttribTabDlg(vcl::Window* pParent,
+SchAttribTabDlg::SchAttribTabDlg(weld::Window* pParent,
                                  const SfxItemSet* pAttr,
                                  const ObjectPropertiesDialogParameter* 
pDialogParameter,
                                  const ViewElementListProvider* 
pViewElementListProvider,
-                                 const uno::Reference< 
util::XNumberFormatsSupplier >& xNumberFormatsSupplier
-                                 )
-    : SfxTabDialog(pParent, "AttributeDialog", 
"modules/schart/ui/attributedialog.ui", pAttr)
+                                 const uno::Reference< 
util::XNumberFormatsSupplier >& xNumberFormatsSupplier)
+    : SfxTabDialogController(pParent, "modules/schart/ui/attributedialog.ui", 
"AttributeDialog", pAttr)
     , nDlgType(nNoArrowNoShadowDlg)
     , m_pParameter( pDialogParameter )
     , m_pViewElementListProvider( pViewElementListProvider )
@@ -335,89 +334,89 @@ SchAttribTabDlg::SchAttribTabDlg(vcl::Window* pParent,
     NumberFormatterWrapper aNumberFormatterWrapper( xNumberFormatsSupplier );
     m_pNumberFormatter = aNumberFormatterWrapper.getSvNumberFormatter();
 
-    SetText( pDialogParameter->getLocalizedName() );
+    m_xDialog->set_title(pDialogParameter->getLocalizedName());
 
     SvtCJKOptions aCJKOptions;
 
     switch (pDialogParameter->getObjectType())
     {
         case OBJECTTYPE_TITLE:
-            AddTabPage(RID_SVXPAGE_LINE, SchResId(STR_PAGE_BORDER));
-            AddTabPage(RID_SVXPAGE_AREA, SchResId(STR_PAGE_AREA));
-            AddTabPage(RID_SVXPAGE_TRANSPARENCE, 
SchResId(STR_PAGE_TRANSPARENCY));
-            AddTabPage(RID_SVXPAGE_CHAR_NAME, SchResId(STR_PAGE_FONT));
-            AddTabPage(RID_SVXPAGE_CHAR_EFFECTS, 
SchResId(STR_PAGE_FONT_EFFECTS));
-            AddTabPage(TP_ALIGNMENT, SchResId(STR_PAGE_ALIGNMENT), 
SchAlignmentTabPage::Create);
+            AddTabPage("border", SchResId(STR_PAGE_BORDER), RID_SVXPAGE_LINE);
+            AddTabPage("area", SchResId(STR_PAGE_AREA), RID_SVXPAGE_AREA);
+            AddTabPage("transparent", SchResId(STR_PAGE_TRANSPARENCY), 
RID_SVXPAGE_TRANSPARENCE);
+            AddTabPage("fontname", SchResId(STR_PAGE_FONT), 
RID_SVXPAGE_CHAR_NAME);
+            AddTabPage("effects", SchResId(STR_PAGE_FONT_EFFECTS), 
RID_SVXPAGE_CHAR_EFFECTS);
+            AddTabPage("alignment", SchResId(STR_PAGE_ALIGNMENT), 
SchAlignmentTabPage::Create, nullptr);
             if( aCJKOptions.IsAsianTypographyEnabled() )
-                AddTabPage(RID_SVXPAGE_PARA_ASIAN, SchResId(STR_PAGE_ASIAN));
+                AddTabPage("asian", SchResId(STR_PAGE_ASIAN), 
RID_SVXPAGE_PARA_ASIAN);
             break;
 
         case OBJECTTYPE_LEGEND:
-            AddTabPage(RID_SVXPAGE_LINE, SchResId(STR_PAGE_BORDER));
-            AddTabPage(RID_SVXPAGE_AREA, SchResId(STR_PAGE_AREA));
-            AddTabPage(RID_SVXPAGE_TRANSPARENCE, 
SchResId(STR_PAGE_TRANSPARENCY));
-            AddTabPage(RID_SVXPAGE_CHAR_NAME, SchResId(STR_PAGE_FONT));
-            AddTabPage(RID_SVXPAGE_CHAR_EFFECTS, 
SchResId(STR_PAGE_FONT_EFFECTS));
-            AddTabPage(TP_LEGEND_POS, SchResId(STR_PAGE_POSITION), 
SchLegendPosTabPage::Create);
-            if( aCJKOptions.IsAsianTypographyEnabled() )
-                AddTabPage(RID_SVXPAGE_PARA_ASIAN, SchResId(STR_PAGE_ASIAN));
+            AddTabPage("border", SchResId(STR_PAGE_BORDER), RID_SVXPAGE_LINE);
+            AddTabPage("area", SchResId(STR_PAGE_AREA), RID_SVXPAGE_AREA);
+            AddTabPage("transparent", SchResId(STR_PAGE_TRANSPARENCY), 
RID_SVXPAGE_TRANSPARENCE);
+            AddTabPage("fontname", SchResId(STR_PAGE_FONT), 
RID_SVXPAGE_CHAR_NAME);
+            AddTabPage("effects", SchResId(STR_PAGE_FONT_EFFECTS), 
RID_SVXPAGE_CHAR_EFFECTS);
+            AddTabPage("legendpos", SchResId(STR_PAGE_POSITION), 
SchLegendPosTabPage::Create, nullptr);
+            if (aCJKOptions.IsAsianTypographyEnabled())
+                AddTabPage("asian", SchResId(STR_PAGE_ASIAN), 
RID_SVXPAGE_PARA_ASIAN);
             break;
 
         case OBJECTTYPE_DATA_SERIES:
         case OBJECTTYPE_DATA_POINT:
             if( m_pParameter->ProvidesSecondaryYAxis() || 
m_pParameter->ProvidesOverlapAndGapWidth() || 
m_pParameter->ProvidesMissingValueTreatments() )
-                AddTabPage(TP_OPTIONS, 
SchResId(STR_PAGE_OPTIONS),SchOptionTabPage::Create);
+                AddTabPage("options", 
SchResId(STR_PAGE_OPTIONS),SchOptionTabPage::Create, nullptr);
             if( m_pParameter->ProvidesStartingAngle())
-                AddTabPage(TP_POLAROPTIONS, 
SchResId(STR_PAGE_OPTIONS),PolarOptionsTabPage::Create);
+                AddTabPage("polaroptions", SchResId(STR_PAGE_OPTIONS), 
PolarOptionsTabPage::Create, nullptr);
 
             if( m_pParameter->HasGeometryProperties() )
-                AddTabPage(TP_LAYOUT, 
SchResId(STR_PAGE_LAYOUT),SchLayoutTabPage::Create);
+                AddTabPage("layout", SchResId(STR_PAGE_LAYOUT), 
SchLayoutTabPage::Create, nullptr);
 
             if(m_pParameter->HasAreaProperties())
             {
-                AddTabPage(RID_SVXPAGE_AREA, SchResId(STR_PAGE_AREA));
-                AddTabPage(RID_SVXPAGE_TRANSPARENCE, 
SchResId(STR_PAGE_TRANSPARENCY));
+                AddTabPage("area", SchResId(STR_PAGE_AREA), RID_SVXPAGE_AREA);
+                AddTabPage("transparent", SchResId(STR_PAGE_TRANSPARENCY), 
RID_SVXPAGE_TRANSPARENCE);
             }
-            AddTabPage(RID_SVXPAGE_LINE, SchResId( 
m_pParameter->HasAreaProperties() ? STR_PAGE_BORDER : STR_PAGE_LINE ));
+            AddTabPage("border", SchResId( m_pParameter->HasAreaProperties() ? 
STR_PAGE_BORDER : STR_PAGE_LINE ), RID_SVXPAGE_LINE);
             break;
 
         case OBJECTTYPE_DATA_LABEL:
         case OBJECTTYPE_DATA_LABELS:
-            AddTabPage(RID_SVXPAGE_LINE, SchResId(STR_PAGE_BORDER));
-            AddTabPage(TP_DATA_DESCR, SchResId(STR_OBJECT_DATALABELS), 
DataLabelsTabPage::Create);
-            AddTabPage(RID_SVXPAGE_CHAR_NAME, SchResId(STR_PAGE_FONT));
-            AddTabPage(RID_SVXPAGE_CHAR_EFFECTS, 
SchResId(STR_PAGE_FONT_EFFECTS));
+            AddTabPage("border", SchResId(STR_PAGE_BORDER), RID_SVXPAGE_LINE);
+            AddTabPage("datalabels", SchResId(STR_OBJECT_DATALABELS), 
DataLabelsTabPage::Create, nullptr);
+            AddTabPage("fontname", SchResId(STR_PAGE_FONT), 
RID_SVXPAGE_CHAR_NAME);
+            AddTabPage("effects", SchResId(STR_PAGE_FONT_EFFECTS), 
RID_SVXPAGE_CHAR_EFFECTS);
             if( aCJKOptions.IsAsianTypographyEnabled() )
-                AddTabPage(RID_SVXPAGE_PARA_ASIAN, SchResId(STR_PAGE_ASIAN));
+                AddTabPage("asian", SchResId(STR_PAGE_ASIAN), 
RID_SVXPAGE_PARA_ASIAN);
 
             break;
 
         case OBJECTTYPE_AXIS:
         {
             if( m_pParameter->HasScaleProperties() )
-                AddTabPage(TP_SCALE, SchResId(STR_PAGE_SCALE), 
ScaleTabPage::Create);
+                AddTabPage("scale", SchResId(STR_PAGE_SCALE), 
ScaleTabPage::Create, nullptr);
 
             if( m_pParameter->HasScaleProperties() )//no positioning page for 
z axes so far as the tickmarks are not shown so far
-                AddTabPage(TP_AXIS_POSITIONS, SchResId(STR_PAGE_POSITIONING), 
AxisPositionsTabPage::Create);
-            AddTabPage(RID_SVXPAGE_LINE, SchResId(STR_PAGE_LINE));
-            AddTabPage(TP_AXIS_LABEL, SchResId(STR_OBJECT_LABEL), 
SchAxisLabelTabPage::Create);
+                AddTabPage("axispos", SchResId(STR_PAGE_POSITIONING), 
AxisPositionsTabPage::Create, nullptr);
+            AddTabPage("border", SchResId(STR_PAGE_LINE), RID_SVXPAGE_LINE);
+            AddTabPage("axislabel", SchResId(STR_OBJECT_LABEL), 
SchAxisLabelTabPage::Create, nullptr);
             if( m_pParameter->HasNumberProperties() )
-                AddTabPage(RID_SVXPAGE_NUMBERFORMAT, 
SchResId(STR_PAGE_NUMBERS));
-            AddTabPage(RID_SVXPAGE_CHAR_NAME, SchResId(STR_PAGE_FONT));
-            AddTabPage(RID_SVXPAGE_CHAR_EFFECTS, 
SchResId(STR_PAGE_FONT_EFFECTS));
+                AddTabPage("numberformat", SchResId(STR_PAGE_NUMBERS), 
RID_SVXPAGE_NUMBERFORMAT);
+            AddTabPage("fontname", SchResId(STR_PAGE_FONT), 
RID_SVXPAGE_CHAR_NAME);
+            AddTabPage("effects", SchResId(STR_PAGE_FONT_EFFECTS), 
RID_SVXPAGE_CHAR_EFFECTS);
             if( aCJKOptions.IsAsianTypographyEnabled() )
-                AddTabPage(RID_SVXPAGE_PARA_ASIAN, SchResId(STR_PAGE_ASIAN));
+                AddTabPage("asian", SchResId(STR_PAGE_ASIAN), 
RID_SVXPAGE_PARA_ASIAN);
             break;
         }
 
         case OBJECTTYPE_DATA_ERRORS_X:
-            AddTabPage(TP_XERRORBAR, SchResId(STR_PAGE_XERROR_BARS), 
ErrorBarsTabPage::Create);
-            AddTabPage(RID_SVXPAGE_LINE, SchResId(STR_PAGE_LINE));
+            AddTabPage("xerrorbar", SchResId(STR_PAGE_XERROR_BARS), 
ErrorBarsTabPage::Create, nullptr);
+            AddTabPage("border", SchResId(STR_PAGE_LINE), RID_SVXPAGE_LINE);
             break;
 
         case OBJECTTYPE_DATA_ERRORS_Y:
-            AddTabPage(TP_YERRORBAR, SchResId(STR_PAGE_YERROR_BARS), 
ErrorBarsTabPage::Create);
-            AddTabPage(RID_SVXPAGE_LINE, SchResId(STR_PAGE_LINE));
+            AddTabPage("yerrorbar", SchResId(STR_PAGE_YERROR_BARS), 
ErrorBarsTabPage::Create, nullptr);
+            AddTabPage("border", SchResId(STR_PAGE_LINE), RID_SVXPAGE_LINE);
             break;
 
         case OBJECTTYPE_DATA_ERRORS_Z:
@@ -427,12 +426,12 @@ SchAttribTabDlg::SchAttribTabDlg(vcl::Window* pParent,
         case OBJECTTYPE_SUBGRID:
         case OBJECTTYPE_DATA_AVERAGE_LINE:
         case OBJECTTYPE_DATA_STOCK_RANGE:
-            AddTabPage(RID_SVXPAGE_LINE, SchResId(STR_PAGE_LINE));
+            AddTabPage("border", SchResId(STR_PAGE_LINE), RID_SVXPAGE_LINE);
             break;
 
         case OBJECTTYPE_DATA_CURVE:
-            AddTabPage(TP_TRENDLINE, SchResId(STR_PAGE_TRENDLINE_TYPE), 
TrendlineTabPage::Create);
-            AddTabPage(RID_SVXPAGE_LINE, SchResId(STR_PAGE_LINE));
+            AddTabPage("trendline", SchResId(STR_PAGE_TRENDLINE_TYPE), 
TrendlineTabPage::Create, nullptr);
+            AddTabPage("border", SchResId(STR_PAGE_LINE), RID_SVXPAGE_LINE);
             break;
 
         case OBJECTTYPE_DATA_STOCK_LOSS:
@@ -441,9 +440,9 @@ SchAttribTabDlg::SchAttribTabDlg(vcl::Window* pParent,
         case OBJECTTYPE_DIAGRAM_FLOOR:
         case OBJECTTYPE_DIAGRAM_WALL:
         case OBJECTTYPE_DIAGRAM:
-            AddTabPage(RID_SVXPAGE_LINE, SchResId(STR_PAGE_BORDER));
-            AddTabPage(RID_SVXPAGE_AREA, SchResId(STR_PAGE_AREA));
-            AddTabPage(RID_SVXPAGE_TRANSPARENCE, 
SchResId(STR_PAGE_TRANSPARENCY));
+            AddTabPage("border", SchResId(STR_PAGE_BORDER), RID_SVXPAGE_LINE);
+            AddTabPage("area", SchResId(STR_PAGE_AREA), RID_SVXPAGE_AREA);
+            AddTabPage("transparent", SchResId(STR_PAGE_TRANSPARENCY), 
RID_SVXPAGE_TRANSPARENCE);
             break;
 
         case OBJECTTYPE_LEGEND_ENTRY:
@@ -452,17 +451,19 @@ SchAttribTabDlg::SchAttribTabDlg(vcl::Window* pParent,
             // nothing
             break;
         case OBJECTTYPE_DATA_CURVE_EQUATION:
-            AddTabPage(RID_SVXPAGE_LINE, SchResId(STR_PAGE_BORDER));
-            AddTabPage(RID_SVXPAGE_AREA, SchResId(STR_PAGE_AREA));
-            AddTabPage(RID_SVXPAGE_TRANSPARENCE, 
SchResId(STR_PAGE_TRANSPARENCY));
-            AddTabPage(RID_SVXPAGE_CHAR_NAME, SchResId(STR_PAGE_FONT));
-            AddTabPage(RID_SVXPAGE_CHAR_EFFECTS, 
SchResId(STR_PAGE_FONT_EFFECTS));
-            AddTabPage(RID_SVXPAGE_NUMBERFORMAT, SchResId(STR_PAGE_NUMBERS));
-            if( SvtLanguageOptions().IsCTLFontEnabled() )
+            AddTabPage("border", SchResId(STR_PAGE_BORDER), RID_SVXPAGE_LINE);
+            AddTabPage("area", SchResId(STR_PAGE_AREA), RID_SVXPAGE_AREA);
+            AddTabPage("transparent", SchResId(STR_PAGE_TRANSPARENCY), 
RID_SVXPAGE_TRANSPARENCE);
+            AddTabPage("fontname", SchResId(STR_PAGE_FONT), 
RID_SVXPAGE_CHAR_NAME);
+            AddTabPage("effects", SchResId(STR_PAGE_FONT_EFFECTS), 
RID_SVXPAGE_CHAR_EFFECTS);
+            AddTabPage("numberformat", SchResId(STR_PAGE_NUMBERS), 
RID_SVXPAGE_NUMBERFORMAT);
+            if (SvtLanguageOptions().IsCTLFontEnabled())
+            {
                 /*  When rotation is supported for equation text boxes, use
                     SchAlignmentTabPage::Create here. The special
                     SchAlignmentTabPage::CreateWithoutRotation can be deleted. 
*/
-                AddTabPage(TP_ALIGNMENT, SchResId(STR_PAGE_ALIGNMENT), 
SchAlignmentTabPage::CreateWithoutRotation);
+                AddTabPage("alignment", SchResId(STR_PAGE_ALIGNMENT), 
SchAlignmentTabPage::CreateWithoutRotation, nullptr);
+            }
             break;
         default:
             break;
@@ -471,174 +472,145 @@ SchAttribTabDlg::SchAttribTabDlg(vcl::Window* pParent,
     // used to find out if user left the dialog with OK. When OK is pressed but
     // no changes were done, Cancel is returned by the SfxTabDialog. See method
     // DialogWasClosedWithOK.
-    m_aOriginalOKClickHdl = GetOKButton().GetClickHdl();
-    GetOKButton().SetClickHdl( LINK( this, SchAttribTabDlg, OKPressed ));
+    GetOKButton().connect_clicked(LINK(this, SchAttribTabDlg, OKPressed));
 }
 
 SchAttribTabDlg::~SchAttribTabDlg()
 {
-    disposeOnce();
-}
-
-void SchAttribTabDlg::dispose()
-{
-    m_pSymbolShapeProperties.reset();
-    m_pAutoSymbolGraphic.reset();
-    SfxTabDialog::dispose();
 }
 
-void SchAttribTabDlg::PageCreated(sal_uInt16 nId, SfxTabPage &rPage)
+void SchAttribTabDlg::PageCreated(const OString& rId, SfxTabPage &rPage)
 {
     SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
-    switch (nId)
+    if (rId == "border")
     {
-        case TP_LAYOUT:
-        break;
-        case RID_SVXPAGE_LINE:
-            aSet.Put 
(SvxColorListItem(m_pViewElementListProvider->GetColorTable(),SID_COLOR_TABLE));
-            aSet.Put 
(SvxDashListItem(m_pViewElementListProvider->GetDashList(),SID_DASH_LIST));
-            aSet.Put 
(SvxLineEndListItem(m_pViewElementListProvider->GetLineEndList(),SID_LINEEND_LIST));
-            aSet.Put (SfxUInt16Item(SID_PAGE_TYPE,0));
-            aSet.Put (SfxUInt16Item(SID_DLG_TYPE,nDlgType));
-
-            if( m_pParameter->HasSymbolProperties() )
-            {
-                
aSet.Put(OfaPtrItem(SID_OBJECT_LIST,m_pViewElementListProvider->GetSymbolList()));
-                if( m_pSymbolShapeProperties )
-                    
aSet.Put(SfxTabDialogItem(SID_ATTR_SET,*m_pSymbolShapeProperties));
-                if( m_pAutoSymbolGraphic )
-                    aSet.Put(SvxGraphicItem(*m_pAutoSymbolGraphic));
-            }
-            rPage.PageCreated(aSet);
-            break;
-
-        case RID_SVXPAGE_AREA:
-            
aSet.Put(SvxColorListItem(m_pViewElementListProvider->GetColorTable(),SID_COLOR_TABLE));
-            
aSet.Put(SvxGradientListItem(m_pViewElementListProvider->GetGradientList(),SID_GRADIENT_LIST));
-            
aSet.Put(SvxHatchListItem(m_pViewElementListProvider->GetHatchList(),SID_HATCH_LIST));
-            
aSet.Put(SvxBitmapListItem(m_pViewElementListProvider->GetBitmapList(),SID_BITMAP_LIST));
-            
aSet.Put(SvxPatternListItem(m_pViewElementListProvider->GetPatternList(),SID_PATTERN_LIST));
-            aSet.Put(SfxUInt16Item(SID_PAGE_TYPE,0));
-            aSet.Put(SfxUInt16Item(SID_DLG_TYPE,nDlgType));
-            rPage.PageCreated(aSet);
-            break;
-
-        case RID_SVXPAGE_TRANSPARENCE:
-            aSet.Put (SfxUInt16Item(SID_PAGE_TYPE,0));
-            aSet.Put (SfxUInt16Item(SID_DLG_TYPE,nDlgType));
-            rPage.PageCreated(aSet);
-            break;
-
-        case RID_SVXPAGE_CHAR_NAME:
-
-            aSet.Put 
(SvxFontListItem(m_pViewElementListProvider->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;
+        aSet.Put 
(SvxColorListItem(m_pViewElementListProvider->GetColorTable(),SID_COLOR_TABLE));
+        aSet.Put 
(SvxDashListItem(m_pViewElementListProvider->GetDashList(),SID_DASH_LIST));
+        aSet.Put 
(SvxLineEndListItem(m_pViewElementListProvider->GetLineEndList(),SID_LINEEND_LIST));
+        aSet.Put (SfxUInt16Item(SID_PAGE_TYPE,0));
+        aSet.Put (SfxUInt16Item(SID_DLG_TYPE,nDlgType));
 
-        case TP_AXIS_LABEL:
+        if( m_pParameter->HasSymbolProperties() )
         {
-            bool bShowStaggeringControls = 
m_pParameter->CanAxisLabelsBeStaggered();
-            static_cast<SchAxisLabelTabPage&>(rPage).ShowStaggeringControls( 
bShowStaggeringControls );
-            dynamic_cast< SchAxisLabelTabPage& >( rPage 
).SetComplexCategories( m_pParameter->IsComplexCategoriesAxis() );
-            break;
+            
aSet.Put(OfaPtrItem(SID_OBJECT_LIST,m_pViewElementListProvider->GetSymbolList()));
+            if( m_pSymbolShapeProperties )
+                
aSet.Put(SfxTabDialogItem(SID_ATTR_SET,*m_pSymbolShapeProperties));
+            if( m_pAutoSymbolGraphic )
+                aSet.Put(SvxGraphicItem(*m_pAutoSymbolGraphic));
         }
-
-        case TP_ALIGNMENT:
-            break;
-
-        case TP_AXIS_POSITIONS:
-            {
-                AxisPositionsTabPage* pPage = dynamic_cast< 
AxisPositionsTabPage* >( &rPage );
-                if(pPage)
-                {
-                    pPage->SetNumFormatter( m_pNumberFormatter );
-                    if( m_pParameter->IsCrossingAxisIsCategoryAxis() )
-                    {
-                        pPage->SetCrossingAxisIsCategoryAxis( 
m_pParameter->IsCrossingAxisIsCategoryAxis() );
-                        pPage->SetCategories( m_pParameter->GetCategories() );
-                    }
-                    pPage->SupportAxisPositioning( 
m_pParameter->IsSupportingAxisPositioning() );
-                }
-            }
-            break;
-
-        case TP_SCALE:
-            {
-                ScaleTabPage* pScaleTabPage = dynamic_cast< ScaleTabPage* >( 
&rPage );
-                if(pScaleTabPage)
-                {
-                    pScaleTabPage->SetNumFormatter( m_pNumberFormatter );
-                    pScaleTabPage->ShowAxisOrigin( 
m_pParameter->ShowAxisOrigin() );
-                }
-            }
-            break;
-
-        case TP_DATA_DESCR:
-            {
-                DataLabelsTabPage* pLabelPage = dynamic_cast< 
DataLabelsTabPage* >( &rPage );
-                if( pLabelPage )
-                    pLabelPage->SetNumberFormatter( m_pNumberFormatter );
-            }
-            break;
-
-        case RID_SVXPAGE_NUMBERFORMAT:
-               aSet.Put (SvxNumberInfoItem( m_pNumberFormatter, 
static_cast<sal_uInt16>(SID_ATTR_NUMBERFORMAT_INFO)));
-            rPage.PageCreated(aSet);
-            break;
-        case TP_XERRORBAR:
+        rPage.PageCreated(aSet);
+    }
+    else if (rId == "area")
+    {
+        
aSet.Put(SvxColorListItem(m_pViewElementListProvider->GetColorTable(),SID_COLOR_TABLE));
+        
aSet.Put(SvxGradientListItem(m_pViewElementListProvider->GetGradientList(),SID_GRADIENT_LIST));
+        
aSet.Put(SvxHatchListItem(m_pViewElementListProvider->GetHatchList(),SID_HATCH_LIST));
+        
aSet.Put(SvxBitmapListItem(m_pViewElementListProvider->GetBitmapList(),SID_BITMAP_LIST));
+        
aSet.Put(SvxPatternListItem(m_pViewElementListProvider->GetPatternList(),SID_PATTERN_LIST));
+        aSet.Put(SfxUInt16Item(SID_PAGE_TYPE,0));
+        aSet.Put(SfxUInt16Item(SID_DLG_TYPE,nDlgType));
+        rPage.PageCreated(aSet);
+    }
+    else if (rId == "transparent")
+    {
+        aSet.Put (SfxUInt16Item(SID_PAGE_TYPE,0));
+        aSet.Put (SfxUInt16Item(SID_DLG_TYPE,nDlgType));
+        rPage.PageCreated(aSet);
+    }
+    else if (rId == "fontname")
+    {
+        aSet.Put (SvxFontListItem(m_pViewElementListProvider->getFontList(), 
SID_ATTR_CHAR_FONTLIST));
+        rPage.PageCreated(aSet);
+    }
+    else if (rId == "effects")
+    {
+        aSet.Put (SfxUInt16Item(SID_DISABLE_CTL,DISABLE_CASEMAP));
+        rPage.PageCreated(aSet);
+    }
+    else if (rId == "axislabel")
+    {
+        bool bShowStaggeringControls = 
m_pParameter->CanAxisLabelsBeStaggered();
+        static_cast<SchAxisLabelTabPage&>(rPage).ShowStaggeringControls( 
bShowStaggeringControls );
+        dynamic_cast< SchAxisLabelTabPage& >( rPage ).SetComplexCategories( 
m_pParameter->IsComplexCategoriesAxis() );
+    }
+    else if (rId == "axispos")
+    {
+        AxisPositionsTabPage* pPage = dynamic_cast< AxisPositionsTabPage* >( 
&rPage );
+        if(pPage)
         {
-            ErrorBarsTabPage * pTabPage = dynamic_cast< ErrorBarsTabPage * >( 
&rPage );
-            OSL_ASSERT( pTabPage );
-            if( pTabPage )
+            pPage->SetNumFormatter( m_pNumberFormatter );
+            if( m_pParameter->IsCrossingAxisIsCategoryAxis() )
             {
-                pTabPage->SetAxisMinorStepWidthForErrorBarDecimals( 
m_fAxisMinorStepWidthForErrorBarDecimals );
-                pTabPage->SetErrorBarType( ErrorBarResources::ERROR_BAR_X );
-                pTabPage->SetChartDocumentForRangeChoosing( 
m_pParameter->getDocument());
+                pPage->SetCrossingAxisIsCategoryAxis( 
m_pParameter->IsCrossingAxisIsCategoryAxis() );
+                pPage->SetCategories( m_pParameter->GetCategories() );
             }
-            break;
+            pPage->SupportAxisPositioning( 
m_pParameter->IsSupportingAxisPositioning() );
         }
-        case TP_YERRORBAR:
+    }
+    else if (rId == "scale")
+    {
+        ScaleTabPage* pScaleTabPage = dynamic_cast< ScaleTabPage* >( &rPage );
+        if(pScaleTabPage)
         {
-            ErrorBarsTabPage * pTabPage = dynamic_cast< ErrorBarsTabPage * >( 
&rPage );
-            OSL_ASSERT( pTabPage );
-            if( pTabPage )
-            {
-                pTabPage->SetAxisMinorStepWidthForErrorBarDecimals( 
m_fAxisMinorStepWidthForErrorBarDecimals );
-                pTabPage->SetErrorBarType( ErrorBarResources::ERROR_BAR_Y );
-                pTabPage->SetChartDocumentForRangeChoosing( 
m_pParameter->getDocument());
-            }
-            break;
+            pScaleTabPage->SetNumFormatter( m_pNumberFormatter );
+            pScaleTabPage->ShowAxisOrigin( m_pParameter->ShowAxisOrigin() );
         }
-        case TP_OPTIONS:
+    }
+    else if (rId == "datalabels")
+    {
+        DataLabelsTabPage* pLabelPage = dynamic_cast< DataLabelsTabPage* >( 
&rPage );
+        if( pLabelPage )
+            pLabelPage->SetNumberFormatter( m_pNumberFormatter );
+    }
+    else if (rId == "numberformat")
+    {
+        aSet.Put (SvxNumberInfoItem( m_pNumberFormatter, 
static_cast<sal_uInt16>(SID_ATTR_NUMBERFORMAT_INFO)));
+        rPage.PageCreated(aSet);
+    }
+    else if (rId == "xerrorbar")
+    {
+        ErrorBarsTabPage * pTabPage = dynamic_cast< ErrorBarsTabPage * >( 
&rPage );
+        OSL_ASSERT( pTabPage );
+        if( pTabPage )
         {
-            SchOptionTabPage* pTabPage = dynamic_cast< SchOptionTabPage* >( 
&rPage );
-            if( pTabPage && m_pParameter )
-                pTabPage->Init( m_pParameter->ProvidesSecondaryYAxis(), 
m_pParameter->ProvidesOverlapAndGapWidth(),
-                    m_pParameter->ProvidesBarConnectors() );
-            break;
+            pTabPage->SetAxisMinorStepWidthForErrorBarDecimals( 
m_fAxisMinorStepWidthForErrorBarDecimals );
+            pTabPage->SetErrorBarType( ErrorBarResources::ERROR_BAR_X );
+            pTabPage->SetChartDocumentForRangeChoosing( 
m_pParameter->getDocument());
         }
-        case TP_TRENDLINE:
+    }
+    else if (rId == "yerrorbar")
+    {
+        ErrorBarsTabPage * pTabPage = dynamic_cast< ErrorBarsTabPage * >( 
&rPage );
+        OSL_ASSERT( pTabPage );
+        if( pTabPage )
         {
-            TrendlineTabPage* pTrendlineTabPage = dynamic_cast< 
TrendlineTabPage* >( &rPage );
-            if(pTrendlineTabPage)
-            {
-                pTrendlineTabPage->SetNumFormatter( m_pNumberFormatter );
-                pTrendlineTabPage->SetNbPoints( m_pParameter->getNbPoints() );
-            }
-            break;
+            pTabPage->SetAxisMinorStepWidthForErrorBarDecimals( 
m_fAxisMinorStepWidthForErrorBarDecimals );
+            pTabPage->SetErrorBarType( ErrorBarResources::ERROR_BAR_Y );
+            pTabPage->SetChartDocumentForRangeChoosing( 
m_pParameter->getDocument());
+        }
+    }
+    else if (rId == "options")
+    {
+        SchOptionTabPage* pTabPage = dynamic_cast< SchOptionTabPage* >( &rPage 
);
+        if( pTabPage && m_pParameter )
+            pTabPage->Init( m_pParameter->ProvidesSecondaryYAxis(), 
m_pParameter->ProvidesOverlapAndGapWidth(),
+                m_pParameter->ProvidesBarConnectors() );
+    }
+    else if (rId == "trendline")
+    {
+        TrendlineTabPage* pTrendlineTabPage = dynamic_cast< TrendlineTabPage* 
>( &rPage );
+        if(pTrendlineTabPage)
+        {
+            pTrendlineTabPage->SetNumFormatter( m_pNumberFormatter );
+            pTrendlineTabPage->SetNbPoints( m_pParameter->getNbPoints() );
         }
     }
 }
 
-IMPL_LINK(SchAttribTabDlg, OKPressed, Button*, pButton, void)
+IMPL_LINK(SchAttribTabDlg, OKPressed, weld::Button&, rButton, void)
 {
     m_bOKPressed = true;
-    m_aOriginalOKClickHdl.Call( pButton );
+    OkHdl(rButton);
 }
 
 } //namespace chart
diff --git a/chart2/source/controller/inc/dlg_ObjectProperties.hxx 
b/chart2/source/controller/inc/dlg_ObjectProperties.hxx
index 2e6ac7beed6c..d136a1a3f701 100644
--- a/chart2/source/controller/inc/dlg_ObjectProperties.hxx
+++ b/chart2/source/controller/inc/dlg_ObjectProperties.hxx
@@ -104,7 +104,7 @@ private:
 
 class ViewElementListProvider;
 
-class SchAttribTabDlg : public SfxTabDialog
+class SchAttribTabDlg : public SfxTabDialogController
 {
 private:
     sal_uInt16                   nDlgType;
@@ -119,18 +119,16 @@ private:
     double          m_fAxisMinorStepWidthForErrorBarDecimals;
     bool            m_bOKPressed;
 
-    virtual void PageCreated(sal_uInt16 nId, SfxTabPage& rPage) override;
+    DECL_LINK(OKPressed, weld::Button&, void);
 
-    Link<Button*,void> m_aOriginalOKClickHdl;
-    DECL_LINK( OKPressed, Button*, void );
+    virtual void PageCreated(const OString& rId, SfxTabPage& rPage) override;
 
 public:
-    SchAttribTabDlg(vcl::Window* pParent, const SfxItemSet* pAttr,
+    SchAttribTabDlg(weld::Window* pParent, const SfxItemSet* pAttr,
                     const ObjectPropertiesDialogParameter* pDialogParameter,
                     const ViewElementListProvider* pViewElementListProvider,
                     const css::uno::Reference< 
css::util::XNumberFormatsSupplier >& xNumberFormatsSupplier );
     virtual ~SchAttribTabDlg() override;
-    virtual void dispose() override;
 
     //pSymbolShapeProperties: Properties to be set on the symbollist shapes
     //pAutoSymbolGraphic: Graphic to be shown if AutoSymbol gets selected
diff --git a/chart2/source/controller/main/ChartController_Insert.cxx 
b/chart2/source/controller/main/ChartController_Insert.cxx
index 815227817cad..fcba8c63ba75 100644
--- a/chart2/source/controller/main/ChartController_Insert.cxx
+++ b/chart2/source/controller/main/ChartController_Insert.cxx
@@ -390,17 +390,17 @@ void ChartController::executeDispatch_InsertTrendline()
     aDialogParameter.init( getModel() );
     ViewElementListProvider aViewElementListProvider( 
m_pDrawModelWrapper.get());
     SolarMutexGuard aGuard;
-    ScopedVclPtrInstance<SchAttribTabDlg> aDialog(
-        GetChartWindow(), &aItemSet, &aDialogParameter,
+    SchAttribTabDlg aDialog(
+        GetChartFrame(), &aItemSet, &aDialogParameter,
         &aViewElementListProvider,
         uno::Reference< util::XNumberFormatsSupplier >(
                 getModel(), uno::UNO_QUERY ) );
 
     // note: when a user pressed "OK" but didn't change any settings in the
     // dialog, the SfxTabDialog returns "Cancel"
-    if( aDialog->Execute() == RET_OK || aDialog->DialogWasClosedWithOK())
+    if( aDialog.execute() == RET_OK || aDialog.DialogWasClosedWithOK())
     {
-        const SfxItemSet* pOutItemSet = aDialog->GetOutputItemSet();
+        const SfxItemSet* pOutItemSet = aDialog.GetOutputItemSet();
         if( pOutItemSet )
         {
             ControllerLockGuardUNO aCLGuard( getModel() );
@@ -448,20 +448,20 @@ void ChartController::executeDispatch_InsertErrorBars( 
bool bYError )
         aDialogParameter.init( getModel() );
         ViewElementListProvider aViewElementListProvider( 
m_pDrawModelWrapper.get());
         SolarMutexGuard aGuard;
-        ScopedVclPtrInstance<SchAttribTabDlg> aDlg(
-                GetChartWindow(), &aItemSet, &aDialogParameter,
+        SchAttribTabDlg aDlg(
+                GetChartFrame(), &aItemSet, &aDialogParameter,
                 &aViewElementListProvider,
                 uno::Reference< util::XNumberFormatsSupplier >(
                         getModel(), uno::UNO_QUERY ) );
-        aDlg->SetAxisMinorStepWidthForErrorBarDecimals(
+        aDlg.SetAxisMinorStepWidthForErrorBarDecimals(
             InsertErrorBarsDialog::getAxisMinorStepWidthForErrorBarDecimals( 
getModel(),
                                                                              
m_xChartView, m_aSelection.getSelectedCID()));
 
         // note: when a user pressed "OK" but didn't change any settings in the
         // dialog, the SfxTabDialog returns "Cancel"
-        if( aDlg->Execute() == RET_OK || aDlg->DialogWasClosedWithOK())
+        if (aDlg.execute() == RET_OK || aDlg.DialogWasClosedWithOK())
         {
-            const SfxItemSet* pOutItemSet = aDlg->GetOutputItemSet();
+            const SfxItemSet* pOutItemSet = aDlg.GetOutputItemSet();
             if( pOutItemSet )
             {
                 ControllerLockGuardUNO aCLGuard( getModel() );
diff --git a/chart2/source/controller/main/ChartController_Properties.cxx 
b/chart2/source/controller/main/ChartController_Properties.cxx
index b561f959c0d9..717c678a05da 100644
--- a/chart2/source/controller/main/ChartController_Properties.cxx
+++ b/chart2/source/controller/main/ChartController_Properties.cxx
@@ -760,8 +760,8 @@ bool 
ChartController::executeDlg_ObjectProperties_withoutUndoGuard(
         ViewElementListProvider aViewElementListProvider( 
m_pDrawModelWrapper.get() );
 
         SolarMutexGuard aGuard;
-        ScopedVclPtrInstance<SchAttribTabDlg> aDlg(
-                GetChartWindow(), &aItemSet, &aDialogParameter,
+        SchAttribTabDlg aDlg(
+                GetChartFrame(), &aItemSet, &aDialogParameter,
                 &aViewElementListProvider,
                 uno::Reference< util::XNumberFormatsSupplier >(
                         getModel(), uno::UNO_QUERY ) );
@@ -783,18 +783,18 @@ bool 
ChartController::executeDlg_ObjectProperties_withoutUndoGuard(
             sal_Int32 const nStandardSymbol=0;//@todo get from somewhere
             std::unique_ptr<Graphic> pAutoSymbolGraphic(new Graphic( 
aViewElementListProvider.GetSymbolGraphic( nStandardSymbol, 
pSymbolShapeProperties.get() ) ));
             // note: the dialog takes the ownership of pSymbolShapeProperties 
and pAutoSymbolGraphic
-            aDlg->setSymbolInformation( std::move(pSymbolShapeProperties), 
std::move(pAutoSymbolGraphic) );
+            aDlg.setSymbolInformation( std::move(pSymbolShapeProperties), 
std::move(pAutoSymbolGraphic) );
         }
         if( aDialogParameter.HasStatisticProperties() )
         {
-            aDlg->SetAxisMinorStepWidthForErrorBarDecimals(
+            aDlg.SetAxisMinorStepWidthForErrorBarDecimals(
                 
InsertErrorBarsDialog::getAxisMinorStepWidthForErrorBarDecimals( getModel(), 
m_xChartView, rObjectCID ) );
         }
 
         //open the dialog
-        if (aDlg->Execute() == RET_OK || (bSuccessOnUnchanged && 
aDlg->DialogWasClosedWithOK()))
+        if (aDlg.execute() == RET_OK || (bSuccessOnUnchanged && 
aDlg.DialogWasClosedWithOK()))
         {
-            const SfxItemSet* pOutItemSet = aDlg->GetOutputItemSet();
+            const SfxItemSet* pOutItemSet = aDlg.GetOutputItemSet();
             if(pOutItemSet)
             {
                 ControllerLockGuardUNO aCLGuard( getModel());
diff --git a/chart2/uiconfig/ui/attributedialog.ui 
b/chart2/uiconfig/ui/attributedialog.ui
index 2644c521350d..7d3e0802cbf2 100644
--- a/chart2/uiconfig/ui/attributedialog.ui
+++ b/chart2/uiconfig/ui/attributedialog.ui
@@ -1,11 +1,14 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.18.3 -->
+<!-- Generated with glade 3.22.1 -->
 <interface domain="chart">
   <requires lib="gtk+" version="3.18"/>
   <object class="GtkDialog" id="AttributeDialog">
     <property name="can_focus">False</property>
     <property name="border_width">6</property>
     <property name="type_hint">dialog</property>
+    <child>
+      <placeholder/>
+    </child>
     <child internal-child="vbox">
       <object class="GtkBox" id="dialog-vbox1">
         <property name="can_focus">False</property>
@@ -16,12 +19,10 @@
             <property name="can_focus">False</property>
             <property name="layout_style">end</property>
             <child>
-              <object class="GtkButton" id="ok">
-                <property name="label">gtk-ok</property>
+              <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="can_default">True</property>
-                <property name="has_default">True</property>
                 <property name="receives_default">True</property>
                 <property name="use_stock">True</property>
               </object>
@@ -32,10 +33,12 @@
               </packing>
             </child>
             <child>
-              <object class="GtkButton" id="cancel">
-                <property name="label">gtk-cancel</property>
+              <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>
@@ -46,8 +49,8 @@
               </packing>
             </child>
             <child>
-              <object class="GtkButton" id="help">
-                <property name="label">gtk-help</property>
+              <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>
@@ -56,13 +59,12 @@
               <packing>
                 <property name="expand">False</property>
                 <property name="fill">True</property>
-                <property name="position">3</property>
-                <property name="secondary">True</property>
+                <property name="position">2</property>
               </packing>
             </child>
             <child>
-              <object class="GtkButton" id="reset">
-                <property name="label">gtk-revert-to-saved</property>
+              <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>
@@ -71,7 +73,8 @@
               <packing>
                 <property name="expand">False</property>
                 <property name="fill">True</property>
-                <property name="position">4</property>
+                <property name="position">3</property>
+                <property name="secondary">True</property>
               </packing>
             </child>
           </object>
@@ -100,10 +103,10 @@
       </object>
     </child>
     <action-widgets>
+      <action-widget response="101">reset</action-widget>
       <action-widget response="-5">ok</action-widget>
       <action-widget response="-6">cancel</action-widget>
       <action-widget response="-11">help</action-widget>
-      <action-widget response="0">reset</action-widget>
     </action-widgets>
   </object>
 </interface>
diff --git a/include/sfx2/tabdlg.hxx b/include/sfx2/tabdlg.hxx
index 79748b30afe9..d46d243f4252 100644
--- a/include/sfx2/tabdlg.hxx
+++ b/include/sfx2/tabdlg.hxx
@@ -262,12 +262,21 @@ public:
                            const SfxItemSet * = nullptr, bool bEditFmt = 
false);
     virtual ~SfxTabDialogController() override;
 
-    void                AddTabPage(const OString& rName,           // Name of 
the label for the page in the notebook .ui
+    void                AddTabPage(const OString& rName,           // Name of 
the label for the existing page in the notebook .ui
                                    CreateTabPage pCreateFunc,      // != 0
                                    GetTabPageRanges pRangesFunc);  // can be 0
 
-    void                AddTabPage(const OString &rName,          // Name of 
the label for the page in the notebook .ui
-                                   sal_uInt16 nPageCreateId);     // 
Identifier of the Factory Method to create the page
+    void                AddTabPage(const OString& rName,           // Name of 
the label for the existing page in the notebook .ui
+                                   sal_uInt16 nPageCreateId);      // 
Identifier of the Factory Method to create the page
+
+    void                AddTabPage(const OString& rName,           // Name of 
the label for the new page to create
+                                   const OUString& rLabel,         // UI Label 
for the new page to create
+                                   CreateTabPage pCreateFunc,      // != 0
+                                   GetTabPageRanges pRangesFunc);  // can be 0
+
+    void                AddTabPage(const OString& rName,           // Name of 
the label for the new page to create
+                                   const OUString& rLabel,         // UI Label 
for the new page to create
+                                   sal_uInt16 nPageCreateId);      // 
Identifier of the Factory Method to create the page
 
     void                RemoveTabPage( const OString& rName ); // Name of the 
label for the page in the notebook .ui
 
diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index 93e3e6a0c5e6..c854468ffa5b 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -175,6 +175,7 @@ public:
     virtual void set_current_page(int nPage) = 0;
     virtual void set_current_page(const OString& rIdent) = 0;
     virtual void remove_page(const OString& rIdent) = 0;
+    virtual void append_page(const OString& rIdent, const OUString& rLabel) = 
0;
     virtual OUString get_tab_label_text(const OString& rIdent) const = 0;
     virtual int get_n_pages() const = 0;
     virtual weld::Container* get_page(const OString& rIdent) const = 0;
diff --git a/sd/uiconfig/simpress/ui/templatedialog.ui 
b/sd/uiconfig/simpress/ui/templatedialog.ui
index 4e06ce899d07..e31f85a111ad 100644
--- a/sd/uiconfig/simpress/ui/templatedialog.ui
+++ b/sd/uiconfig/simpress/ui/templatedialog.ui
@@ -869,8 +869,8 @@
       </object>
     </child>
     <action-widgets>
-      <action-widget response="0">reset</action-widget>
-      <action-widget response="0">standard</action-widget>
+      <action-widget response="101">reset</action-widget>
+      <action-widget response="102">standard</action-widget>
       <action-widget response="-5">ok</action-widget>
       <action-widget response="-6">cancel</action-widget>
       <action-widget response="-11">help</action-widget>
diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx
index e91ad194932e..37df9f36e67b 100644
--- a/sfx2/source/dialog/tabdlg.cxx
+++ b/sfx2/source/dialog/tabdlg.cxx
@@ -1996,22 +1996,15 @@ void SfxTabDialogController::SavePosAndId()
     Adds a page to the dialog. The Name must correspond to a entry in the
     TabControl in the dialog .ui
 */
-void SfxTabDialogController::AddTabPage
-(
-    const OString &rName,          // Page ID
-    CreateTabPage pCreateFunc,     // Pointer to the Factory Method
-    GetTabPageRanges pRangesFunc   // Pointer to the Method for querying
-                                   // Ranges onDemand
-)
+void SfxTabDialogController::AddTabPage(const OString &rName /* Page ID */,
+                                        CreateTabPage pCreateFunc  /* Pointer 
to the Factory Method */,
+                                        GetTabPageRanges pRangesFunc /* 
Pointer to the Method for querying Ranges onDemand */)
 {
     m_pImpl->aData.push_back(new Data_Impl(m_pImpl->aData.size(), rName, 
pCreateFunc, pRangesFunc));
 }
 
-void SfxTabDialogController::AddTabPage
-(
-    const OString &rName,          // Page ID
-    sal_uInt16 nPageCreateId       // Identifier of the Factory Method to 
create the page
-)
+void SfxTabDialogController::AddTabPage(const OString &rName /* Page ID */,
+                                        sal_uInt16 nPageCreateId /* Identifier 
of the Factory Method to create the page */)
 {
     SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
     CreateTabPage pCreateFunc = pFact->GetTabPageCreatorFunc(nPageCreateId);
@@ -2019,6 +2012,30 @@ void SfxTabDialogController::AddTabPage
     AddTabPage(rName, pCreateFunc, pRangesFunc);
 }
 
+/*  [Description]
+
+    Add a page to the dialog. The Rider text is passed on, the page has no
+    counterpart in the TabControl in the resource of the dialogue.
+*/
+
+void SfxTabDialogController::AddTabPage(const OString &rName, /* Page ID */
+                                        const OUString& rRiderText,
+                                        CreateTabPage pCreateFunc  /* Pointer 
to the Factory Method */,
+                                        GetTabPageRanges pRangesFunc /* 
Pointer to the Method for querying Ranges onDemand */)
+{
+    assert(!m_xTabCtrl->get_page(rName) && "Double Page-Ids in the Tabpage");
+    m_xTabCtrl->append_page(rName, rRiderText);
+    AddTabPage(rName, pCreateFunc, pRangesFunc);
+}
+
+void SfxTabDialogController::AddTabPage(const OString &rName, const OUString& 
rRiderText,
+                                        sal_uInt16 nPageCreateId /* Identifier 
of the Factory Method to create the page */)
+{
+    assert(!m_xTabCtrl->get_page(rName) && "Double Page-Ids in the Tabpage");
+    m_xTabCtrl->append_page(rName, rRiderText);
+    AddTabPage(rName, nPageCreateId);
+}
+
 void SfxTabDialogController::CreatePages()
 {
     for (auto pDataObject : m_pImpl->aData)
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index c0967e15f66a..00f31f36f702 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -1025,6 +1025,8 @@ class SalInstanceNotebook : public SalInstanceContainer, 
public virtual weld::No
 private:
     VclPtr<TabControl> m_xNotebook;
     mutable std::vector<std::unique_ptr<SalInstanceContainer>> m_aPages;
+    std::vector<VclPtr<TabPage>> m_aAddedPages;
+    std::vector<VclPtr<VclGrid>> m_aAddedGrids;
 
     DECL_LINK(DeactivatePageHdl, TabControl*, bool);
     DECL_LINK(ActivatePageHdl, TabControl*, void);
@@ -1078,6 +1080,23 @@ public:
         m_xNotebook->RemovePage(m_xNotebook->GetPageId(rIdent));
     }
 
+    virtual void append_page(const OString& rIdent, const OUString& rLabel) 
override
+    {
+        sal_uInt16 nNewPageCount = m_xNotebook->GetPageCount() + 1;
+        sal_uInt16 nNewPageId = nNewPageCount;
+        m_xNotebook->InsertPage(nNewPageId, rLabel);
+        VclPtrInstance<TabPage> xPage(m_xNotebook);
+        VclPtrInstance<VclGrid> xGrid(xPage);
+        xPage->Show();
+        xGrid->set_hexpand(true);
+        xGrid->set_vexpand(true);
+        xGrid->Show();
+        m_xNotebook->SetTabPage(nNewPageId, xPage);
+        m_xNotebook->SetPageName(nNewPageId, rIdent);
+        m_aAddedPages.push_back(xPage);
+        m_aAddedGrids.push_back(xGrid);
+    }
+
     virtual int get_n_pages() const override
     {
         return m_xNotebook->GetPageCount();
@@ -1090,6 +1109,10 @@ public:
 
     virtual ~SalInstanceNotebook() override
     {
+        for (auto &rGrid : m_aAddedGrids)
+            rGrid.disposeAndClear();
+        for (auto &rPage : m_aAddedPages)
+            rPage.disposeAndClear();
         m_xNotebook->SetActivatePageHdl(Link<TabControl*,void>());
         m_xNotebook->SetDeactivatePageHdl(Link<TabControl*,bool>());
     }
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index f43d6dc46da4..13c1f3b49c96 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -2937,6 +2937,22 @@ public:
         enable_notify_events();
     }
 
+    virtual void append_page(const OString& rIdent, const OUString& rLabel) 
override
+    {
+        disable_notify_events();
+
+        GtkWidget *pTabWidget = 
gtk_label_new(MapToGtkAccelerator(rLabel).getStr());
+        gtk_buildable_set_name(GTK_BUILDABLE(pTabWidget), rIdent.getStr());
+
+        GtkWidget *pChild = gtk_grid_new();
+        gtk_notebook_append_page(m_pNotebook, pChild, pTabWidget);
+        gtk_widget_show_all(pChild);
+        gtk_widget_show_all(pTabWidget);
+
+        update_tab_pos();
+        enable_notify_events();
+    }
+
     virtual ~GtkInstanceNotebook() override
     {
         g_signal_handler_disconnect(m_pNotebook, m_nSwitchPageSignalId);
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to