summaryrefslogtreecommitdiffstats
path: root/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'chart2/source/controller/dialogs/dlg_ObjectProperties.cxx')
-rw-r--r--chart2/source/controller/dialogs/dlg_ObjectProperties.cxx62
1 files changed, 39 insertions, 23 deletions
diff --git a/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx b/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx
index 84740d9bf708..e885fdaef32e 100644
--- a/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx
+++ b/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx
@@ -17,6 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <sal/config.h>
+
+#include <cstddef>
+
#include <dlg_ObjectProperties.hxx>
#include <strings.hrc>
#include "tp_AxisLabel.hxx"
@@ -31,14 +35,18 @@
#include "tp_TitleRotation.hxx"
#include "tp_PolarOptions.hxx"
#include "tp_DataPointOption.hxx"
+#include "tp_DataTable.hxx"
#include <ResId.hxx>
#include <ViewElementListProvider.hxx>
#include <ChartModelHelper.hxx>
+#include <ChartType.hxx>
#include <ChartTypeHelper.hxx>
#include <ObjectNameProvider.hxx>
+#include <DataSeries.hxx>
#include <DiagramHelper.hxx>
#include <Diagram.hxx>
#include <NumberFormatterWrapper.hxx>
+#include <Axis.hxx>
#include <AxisHelper.hxx>
#include <ExplicitCategoriesProvider.hxx>
#include <ChartModel.hxx>
@@ -64,7 +72,8 @@
#include <svx/numinf.hxx>
#include <svl/cjkoptions.hxx>
-#include <tools/diagnose_ex.h>
+#include <utility>
+#include <comphelper/diagnose_ex.hxx>
namespace com::sun::star::chart2 { class XChartType; }
namespace com::sun::star::chart2 { class XDataSeries; }
@@ -79,8 +88,8 @@ using ::com::sun::star::uno::Sequence;
using ::com::sun::star::uno::Exception;
using ::com::sun::star::beans::XPropertySet;
-ObjectPropertiesDialogParameter::ObjectPropertiesDialogParameter( const OUString& rObjectCID )
- : m_aObjectCID( rObjectCID )
+ObjectPropertiesDialogParameter::ObjectPropertiesDialogParameter( OUString aObjectCID )
+ : m_aObjectCID(std::move( aObjectCID ))
, m_eObjectType( ObjectIdentifier::getObjectType( m_aObjectCID ) )
, m_bAffectsMultipleObjects(false)
, m_bHasGeometryProperties(false)
@@ -103,8 +112,8 @@ ObjectPropertiesDialogParameter::ObjectPropertiesDialogParameter( const OUString
, m_bComplexCategoriesAxis( false )
, m_nNbPoints( 0 )
{
- OUString aParticleID = ObjectIdentifier::getParticleID( m_aObjectCID );
- m_bAffectsMultipleObjects = (aParticleID == "ALLELEMENTS");
+ std::u16string_view aParticleID = ObjectIdentifier::getParticleID( m_aObjectCID );
+ m_bAffectsMultipleObjects = (aParticleID == u"ALLELEMENTS");
}
ObjectPropertiesDialogParameter::~ObjectPropertiesDialogParameter()
{
@@ -113,10 +122,12 @@ ObjectPropertiesDialogParameter::~ObjectPropertiesDialogParameter()
void ObjectPropertiesDialogParameter::init( const rtl::Reference<::chart::ChartModel>& xChartModel )
{
m_xChartDocument = xChartModel;
- rtl::Reference< Diagram > xDiagram = ChartModelHelper::findDiagram( xChartModel );
- uno::Reference< XDataSeries > xSeries = ObjectIdentifier::getDataSeriesForCID( m_aObjectCID, xChartModel );
- uno::Reference< XChartType > xChartType = ChartModelHelper::getChartTypeOfSeries( xChartModel, xSeries );
- sal_Int32 nDimensionCount = DiagramHelper::getDimension( xDiagram );
+ rtl::Reference< Diagram > xDiagram = xChartModel->getFirstChartDiagram();
+ rtl::Reference< DataSeries > xSeries = ObjectIdentifier::getDataSeriesForCID( m_aObjectCID, xChartModel );
+ rtl::Reference< ChartType > xChartType = ChartModelHelper::getChartTypeOfSeries( xChartModel, xSeries );
+ sal_Int32 nDimensionCount = 0;
+ if (xDiagram)
+ nDimensionCount = xDiagram->getDimension();
bool bHasSeriesProperties = (m_eObjectType==OBJECTTYPE_DATA_SERIES);
bool bHasDataPointproperties = (m_eObjectType==OBJECTTYPE_DATA_POINT);
@@ -153,7 +164,7 @@ void ObjectPropertiesDialogParameter::init( const rtl::Reference<::chart::ChartM
if( m_bHasScaleProperties )
{
- uno::Reference< XAxis > xAxis( ObjectIdentifier::getAxisForCID( m_aObjectCID, xChartModel ) );
+ rtl::Reference< Axis > xAxis = ObjectIdentifier::getAxisForCID( m_aObjectCID, xChartModel );
if( xAxis.is() )
{
//no scale page for series axis
@@ -211,14 +222,12 @@ void ObjectPropertiesDialogParameter::init( const rtl::Reference<::chart::ChartM
if( m_eObjectType == OBJECTTYPE_DATA_CURVE )
{
- uno::Reference< data::XDataSource > xSource( xSeries, uno::UNO_QUERY );
- Sequence< Reference< data::XLabeledDataSequence > > aDataSeqs( xSource->getDataSequences());
+ const std::vector< uno::Reference< chart2::data::XLabeledDataSequence > > & aDataSeqs( xSeries->getDataSequences2());
Sequence< double > aXValues, aYValues;
bool bXValuesFound = false, bYValuesFound = false;
m_nNbPoints = 0;
- sal_Int32 i = 0;
- for( i=0;
- ! (bXValuesFound && bYValuesFound) && i<aDataSeqs.getLength();
+ for( std::size_t i=0;
+ ! (bXValuesFound && bYValuesFound) && i<aDataSeqs.size();
++i )
{
try
@@ -251,7 +260,7 @@ void ObjectPropertiesDialogParameter::init( const rtl::Reference<::chart::ChartM
//first category (index 0) matches with real number 1.0
aXValues.realloc( aYValues.getLength() );
auto pXValues = aXValues.getArray();
- for( i=0; i<aXValues.getLength(); ++i )
+ for( sal_Int32 i=0; i<aXValues.getLength(); ++i )
pXValues[i] = i+1;
bXValuesFound = true;
}
@@ -309,10 +318,10 @@ void ObjectPropertiesDialogParameter::init( const rtl::Reference<::chart::ChartM
const sal_uInt16 nNoArrowNoShadowDlg = 1101;
void SchAttribTabDlg::setSymbolInformation( SfxItemSet&& rSymbolShapeProperties,
- std::unique_ptr<Graphic> pAutoSymbolGraphic )
+ std::optional<Graphic> oAutoSymbolGraphic )
{
m_oSymbolShapeProperties.emplace(std::move(rSymbolShapeProperties));
- m_pAutoSymbolGraphic = std::move(pAutoSymbolGraphic);
+ m_oAutoSymbolGraphic = std::move(oAutoSymbolGraphic);
}
void SchAttribTabDlg::SetAxisMinorStepWidthForErrorBarDecimals( double fMinorStepWidth )
@@ -452,6 +461,13 @@ SchAttribTabDlg::SchAttribTabDlg(weld::Window* pParent,
case OBJECTTYPE_UNKNOWN:
// nothing
break;
+ case OBJECTTYPE_DATA_TABLE:
+ AddTabPage("datatable", SchResId(STR_DATA_TABLE), DataTableTabPage::Create);
+ AddTabPage("border", SchResId(STR_PAGE_LINE), RID_SVXPAGE_LINE);
+ AddTabPage("area", SchResId(STR_PAGE_AREA), RID_SVXPAGE_AREA);
+ AddTabPage("fontname", SchResId(STR_PAGE_FONT), RID_SVXPAGE_CHAR_NAME);
+ AddTabPage("effects", SchResId(STR_PAGE_FONT_EFFECTS), RID_SVXPAGE_CHAR_EFFECTS);
+ break;
case OBJECTTYPE_DATA_CURVE_EQUATION:
AddTabPage("border", SchResId(STR_PAGE_BORDER), RID_SVXPAGE_LINE);
AddTabPage("area", SchResId(STR_PAGE_AREA), RID_SVXPAGE_AREA);
@@ -459,7 +475,7 @@ SchAttribTabDlg::SchAttribTabDlg(weld::Window* pParent,
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 (SvtCTLOptions().IsCTLFontEnabled())
+ if (SvtCTLOptions::IsCTLFontEnabled())
{
/* When rotation is supported for equation text boxes, use
SchAlignmentTabPage::Create here. The special
@@ -481,7 +497,7 @@ SchAttribTabDlg::~SchAttribTabDlg()
{
}
-void SchAttribTabDlg::PageCreated(const OString& rId, SfxTabPage &rPage)
+void SchAttribTabDlg::PageCreated(const OUString& rId, SfxTabPage &rPage)
{
SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
if (rId == "border")
@@ -497,8 +513,8 @@ void SchAttribTabDlg::PageCreated(const OString& rId, SfxTabPage &rPage)
aSet.Put(OfaPtrItem(SID_OBJECT_LIST,m_pViewElementListProvider->GetSymbolList()));
if( m_oSymbolShapeProperties )
aSet.Put(SfxTabDialogItem(SID_ATTR_SET, *m_oSymbolShapeProperties));
- if( m_pAutoSymbolGraphic )
- aSet.Put(SvxGraphicItem(*m_pAutoSymbolGraphic));
+ if( m_oAutoSymbolGraphic )
+ aSet.Put(SvxGraphicItem(*m_oAutoSymbolGraphic));
}
rPage.PageCreated(aSet);
}
@@ -568,7 +584,7 @@ void SchAttribTabDlg::PageCreated(const OString& rId, SfxTabPage &rPage)
}
else if (rId == "numberformat")
{
- aSet.Put (SvxNumberInfoItem( m_pNumberFormatter, static_cast<sal_uInt16>(SID_ATTR_NUMBERFORMAT_INFO)));
+ aSet.Put (SvxNumberInfoItem( m_pNumberFormatter, SID_ATTR_NUMBERFORMAT_INFO));
rPage.PageCreated(aSet);
}
else if (rId == "xerrorbar")