diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-10-18 13:00:41 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-10-20 13:52:34 +0200 |
commit | 8947c9b1d8cd407131fdfb6fc3c77c8532e9d2a0 (patch) | |
tree | f47becc099d139ae601fc41d9e8f49f24672f0e0 /chart2 | |
parent | b361413eef7e46f340d921708faca9986c63c9f8 (diff) |
weld SchAttribTabDlg
Change-Id: Ia53547b7b42a3ff8848085ab8f8d214259d5cc7b
Reviewed-on: https://gerrit.libreoffice.org/61959
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'chart2')
5 files changed, 207 insertions, 234 deletions
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> |