chart2: add UI to the data table
This adds a new object type "Data Table", with all the object identifiers and converters of properties. The data table is now shown in the drop-down of chart elements. A properties dialog was added, which allows to change properties of a data table. This contains the area, line and font tab pages and a new tab page specific for data tables, to change if the horiz. or vert. borders, key or the outline should be show. Change-Id: I9b4cd58cffbcc952daaa2c0c8f8a5a17e38ac293 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138246 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
This commit is contained in:
committed by
Tomaž Vajngerl
parent
7601cf11ea
commit
300ea910ba
@@ -138,6 +138,7 @@ $(eval $(call gb_Library_add_exception_objects,chartcontroller,\
|
||||
chart2/source/controller/dialogs/tp_DataLabel \
|
||||
chart2/source/controller/dialogs/tp_DataPointOption \
|
||||
chart2/source/controller/dialogs/tp_DataSource \
|
||||
chart2/source/controller/dialogs/tp_DataTable \
|
||||
chart2/source/controller/dialogs/tp_ErrorBars \
|
||||
chart2/source/controller/dialogs/tp_LegendPosition \
|
||||
chart2/source/controller/dialogs/tp_PointGeometry \
|
||||
@@ -153,6 +154,7 @@ $(eval $(call gb_Library_add_exception_objects,chartcontroller,\
|
||||
chart2/source/controller/itemsetwrapper/AxisItemConverter \
|
||||
chart2/source/controller/itemsetwrapper/CharacterPropertyItemConverter \
|
||||
chart2/source/controller/itemsetwrapper/DataPointItemConverter \
|
||||
chart2/source/controller/itemsetwrapper/DataTableItemConverter \
|
||||
chart2/source/controller/itemsetwrapper/ErrorBarItemConverter \
|
||||
chart2/source/controller/itemsetwrapper/GraphicPropertyItemConverter \
|
||||
chart2/source/controller/itemsetwrapper/ItemConverter \
|
||||
|
||||
@@ -68,6 +68,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/schart,\
|
||||
chart2/uiconfig/ui/tp_DataLabel \
|
||||
chart2/uiconfig/ui/tp_DataPointOption \
|
||||
chart2/uiconfig/ui/tp_DataSource \
|
||||
chart2/uiconfig/ui/tp_DataTable \
|
||||
chart2/uiconfig/ui/tp_ErrorBars \
|
||||
chart2/uiconfig/ui/tp_LegendPosition \
|
||||
chart2/uiconfig/ui/tp_PolarOptions \
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
#define STR_PAGE_APPEARANCE NC_("STR_PAGE_APPEARANCE", "Appearance")
|
||||
#define STR_PAGE_ILLUMINATION NC_("STR_PAGE_ILLUMINATION", "Illumination")
|
||||
#define STR_PAGE_ASIAN NC_("STR_PAGE_ASIAN", "Asian Typography")
|
||||
#define STR_PAGE_DATA_TABLE NC_("STR_PAGE_DATA_TABLE", "Data Table")
|
||||
#define STR_OBJECT_AVERAGE_LINE_WITH_PARAMETERS NC_("STR_OBJECT_AVERAGE_LINE_WITH_PARAMETERS", "Mean value line with value %AVERAGE_VALUE and standard deviation %STD_DEVIATION")
|
||||
#define STR_OBJECT_AXIS NC_("STR_OBJECT_AXIS", "Axis")
|
||||
#define STR_OBJECT_AXIS_X NC_("STR_OBJECT_AXIS_X", "X Axis")
|
||||
@@ -97,6 +98,7 @@
|
||||
#define STR_OBJECT_DIAGRAM_WALL NC_("STR_OBJECT_DIAGRAM_WALL", "Chart Wall")
|
||||
#define STR_OBJECT_DIAGRAM_FLOOR NC_("STR_OBJECT_DIAGRAM_FLOOR", "Chart Floor")
|
||||
#define STR_OBJECT_SHAPE NC_("STR_OBJECT_SHAPE", "Drawing Object")
|
||||
#define STR_OBJECT_DATA_TABLE NC_("STR_OBJECT_DATA_TABLE", "Data Table")
|
||||
#define STR_TIP_DATASERIES NC_("STR_TIP_DATASERIES", "Data Series '%SERIESNAME'")
|
||||
#define STR_TIP_DATAPOINT_INDEX NC_("STR_TIP_DATAPOINT_INDEX", "Data Point %POINTNUMBER")
|
||||
#define STR_TIP_DATAPOINT_VALUES NC_("STR_TIP_DATAPOINT_VALUES", "Values: %POINTVALUES")
|
||||
|
||||
@@ -314,6 +314,9 @@ OUString ObjectNameProvider::getName( ObjectType eObjectType, bool bPlural )
|
||||
case OBJECTTYPE_DATA_CURVE_EQUATION:
|
||||
aRet=SchResId(STR_OBJECT_CURVE_EQUATION);
|
||||
break;
|
||||
case OBJECTTYPE_DATA_TABLE:
|
||||
aRet=SchResId(STR_OBJECT_DATA_TABLE);
|
||||
break;
|
||||
default: //OBJECTTYPE_UNKNOWN
|
||||
;
|
||||
}
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#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>
|
||||
@@ -458,6 +459,12 @@ SchAttribTabDlg::SchAttribTabDlg(weld::Window* pParent,
|
||||
case OBJECTTYPE_UNKNOWN:
|
||||
// nothing
|
||||
break;
|
||||
case OBJECTTYPE_DATA_TABLE:
|
||||
AddTabPage("datatable", SchResId(STR_PAGE_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);
|
||||
break;
|
||||
case OBJECTTYPE_DATA_CURVE_EQUATION:
|
||||
AddTabPage("border", SchResId(STR_PAGE_BORDER), RID_SVXPAGE_LINE);
|
||||
AddTabPage("area", SchResId(STR_PAGE_AREA), RID_SVXPAGE_AREA);
|
||||
|
||||
@@ -0,0 +1,113 @@
|
||||
/* -*- 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/.
|
||||
*/
|
||||
|
||||
#include "tp_DataTable.hxx"
|
||||
|
||||
#include <chartview/ChartSfxItemIds.hxx>
|
||||
#include <svl/eitem.hxx>
|
||||
|
||||
namespace chart
|
||||
{
|
||||
DataTableTabPage::DataTableTabPage(weld::Container* pPage, weld::DialogController* pController,
|
||||
const SfxItemSet& rInAttrs)
|
||||
: SfxTabPage(pPage, pController, "modules/schart/ui/tp_DataTable.ui", "DataTableTabPage",
|
||||
&rInAttrs)
|
||||
, m_xCbHorizontalBorder(m_xBuilder->weld_check_button("horizontalBorderCB"))
|
||||
, m_xCbVerticalBorder(m_xBuilder->weld_check_button("verticalBorderCB"))
|
||||
, m_xCbOutilne(m_xBuilder->weld_check_button("outlineCB"))
|
||||
, m_xCbKeys(m_xBuilder->weld_check_button("keysCB"))
|
||||
{
|
||||
}
|
||||
|
||||
DataTableTabPage::~DataTableTabPage() = default;
|
||||
|
||||
std::unique_ptr<SfxTabPage> DataTableTabPage::Create(weld::Container* pPage,
|
||||
weld::DialogController* pController,
|
||||
const SfxItemSet* rAttrs)
|
||||
{
|
||||
return std::make_unique<DataTableTabPage>(pPage, pController, *rAttrs);
|
||||
}
|
||||
|
||||
bool DataTableTabPage::FillItemSet(SfxItemSet* rOutAttrs)
|
||||
{
|
||||
if (m_xCbHorizontalBorder->get_state() != TRISTATE_INDET)
|
||||
{
|
||||
rOutAttrs->Put(
|
||||
SfxBoolItem(SCHATTR_DATA_TABLE_HORIZONTAL_BORDER, m_xCbHorizontalBorder->get_active()));
|
||||
}
|
||||
if (m_xCbVerticalBorder->get_state() != TRISTATE_INDET)
|
||||
{
|
||||
rOutAttrs->Put(
|
||||
SfxBoolItem(SCHATTR_DATA_TABLE_VERTICAL_BORDER, m_xCbVerticalBorder->get_active()));
|
||||
}
|
||||
if (m_xCbOutilne->get_state() != TRISTATE_INDET)
|
||||
{
|
||||
rOutAttrs->Put(SfxBoolItem(SCHATTR_DATA_TABLE_OUTLINE, m_xCbOutilne->get_active()));
|
||||
}
|
||||
if (m_xCbKeys->get_state() != TRISTATE_INDET)
|
||||
{
|
||||
rOutAttrs->Put(SfxBoolItem(SCHATTR_DATA_TABLE_KEYS, m_xCbKeys->get_active()));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void DataTableTabPage::Reset(const SfxItemSet* pInAttrs)
|
||||
{
|
||||
const SfxPoolItem* pPoolItem = nullptr;
|
||||
SfxItemState aState;
|
||||
|
||||
aState = pInAttrs->GetItemState(SCHATTR_DATA_TABLE_HORIZONTAL_BORDER, false, &pPoolItem);
|
||||
if (aState == SfxItemState::DONTCARE)
|
||||
{
|
||||
m_xCbHorizontalBorder->set_state(TRISTATE_INDET);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (aState == SfxItemState::SET)
|
||||
m_xCbHorizontalBorder->set_active(
|
||||
static_cast<const SfxBoolItem*>(pPoolItem)->GetValue());
|
||||
}
|
||||
|
||||
aState = pInAttrs->GetItemState(SCHATTR_DATA_TABLE_VERTICAL_BORDER, false, &pPoolItem);
|
||||
if (aState == SfxItemState::DONTCARE)
|
||||
{
|
||||
m_xCbVerticalBorder->set_state(TRISTATE_INDET);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (aState == SfxItemState::SET)
|
||||
m_xCbVerticalBorder->set_active(static_cast<const SfxBoolItem*>(pPoolItem)->GetValue());
|
||||
}
|
||||
|
||||
aState = pInAttrs->GetItemState(SCHATTR_DATA_TABLE_OUTLINE, false, &pPoolItem);
|
||||
if (aState == SfxItemState::DONTCARE)
|
||||
{
|
||||
m_xCbOutilne->set_state(TRISTATE_INDET);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (aState == SfxItemState::SET)
|
||||
m_xCbOutilne->set_active(static_cast<const SfxBoolItem*>(pPoolItem)->GetValue());
|
||||
}
|
||||
|
||||
aState = pInAttrs->GetItemState(SCHATTR_DATA_TABLE_KEYS, false, &pPoolItem);
|
||||
if (aState == SfxItemState::DONTCARE)
|
||||
{
|
||||
m_xCbKeys->set_state(TRISTATE_INDET);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (aState == SfxItemState::SET)
|
||||
m_xCbKeys->set_active(static_cast<const SfxBoolItem*>(pPoolItem)->GetValue());
|
||||
}
|
||||
}
|
||||
|
||||
} //namespace chart
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||
@@ -0,0 +1,43 @@
|
||||
/* -*- 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/.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <sfx2/tabdlg.hxx>
|
||||
|
||||
namespace weld
|
||||
{
|
||||
class CheckButton;
|
||||
}
|
||||
|
||||
namespace chart
|
||||
{
|
||||
class DataTableTabPage : public SfxTabPage
|
||||
{
|
||||
private:
|
||||
std::unique_ptr<weld::CheckButton> m_xCbHorizontalBorder;
|
||||
std::unique_ptr<weld::CheckButton> m_xCbVerticalBorder;
|
||||
std::unique_ptr<weld::CheckButton> m_xCbOutilne;
|
||||
std::unique_ptr<weld::CheckButton> m_xCbKeys;
|
||||
|
||||
public:
|
||||
DataTableTabPage(weld::Container* pPage, weld::DialogController* pController,
|
||||
const SfxItemSet& rInAttrs);
|
||||
virtual ~DataTableTabPage() override;
|
||||
|
||||
static std::unique_ptr<SfxTabPage>
|
||||
Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rInAttrs);
|
||||
|
||||
virtual bool FillItemSet(SfxItemSet* rOutAttrs) override;
|
||||
virtual void Reset(const SfxItemSet* rInAttrs) override;
|
||||
};
|
||||
|
||||
} //namespace chart
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||
@@ -0,0 +1,57 @@
|
||||
/* -*- 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/.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "ItemConverter.hxx"
|
||||
#include <rtl/ref.hxx>
|
||||
#include <vector>
|
||||
|
||||
namespace com::sun::star::awt
|
||||
{
|
||||
struct Size;
|
||||
}
|
||||
namespace com::sun::star::beans
|
||||
{
|
||||
class XPropertySet;
|
||||
}
|
||||
namespace chart
|
||||
{
|
||||
class ChartModel;
|
||||
}
|
||||
|
||||
class SdrModel;
|
||||
|
||||
namespace chart::wrapper
|
||||
{
|
||||
class DataTableItemConverter final : public ItemConverter
|
||||
{
|
||||
public:
|
||||
DataTableItemConverter(const css::uno::Reference<css::beans::XPropertySet>& rPropertySet,
|
||||
SfxItemPool& rItemPool, SdrModel& rDrawModel,
|
||||
const rtl::Reference<::chart::ChartModel>& xChartDoc,
|
||||
const css::awt::Size* pRefSize);
|
||||
|
||||
virtual ~DataTableItemConverter() override;
|
||||
|
||||
virtual void FillItemSet(SfxItemSet& rOutItemSet) const override;
|
||||
virtual bool ApplyItemSet(const SfxItemSet& rItemSet) override;
|
||||
|
||||
protected:
|
||||
virtual const WhichRangesContainer& GetWhichPairs() const override;
|
||||
virtual bool GetItemProperty(tWhichIdType nWhichId,
|
||||
tPropertyNameWithMemberId& rOutProperty) const override;
|
||||
|
||||
private:
|
||||
std::vector<std::unique_ptr<ItemConverter>> m_aConverters;
|
||||
rtl::Reference<::chart::ChartModel> m_xChartDoc;
|
||||
};
|
||||
}
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||
@@ -0,0 +1,112 @@
|
||||
/* -*- 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/.
|
||||
*/
|
||||
|
||||
#include <DataTableItemConverter.hxx>
|
||||
#include <ItemPropertyMap.hxx>
|
||||
#include <CharacterPropertyItemConverter.hxx>
|
||||
#include <GraphicPropertyItemConverter.hxx>
|
||||
#include <chartview/ChartSfxItemIds.hxx>
|
||||
#include <chartview/ExplicitScaleValues.hxx>
|
||||
#include <chartview/ExplicitValueProvider.hxx>
|
||||
#include "SchWhichPairs.hxx"
|
||||
#include <ChartModelHelper.hxx>
|
||||
#include <ChartModel.hxx>
|
||||
#include <CommonConverters.hxx>
|
||||
#include <ChartType.hxx>
|
||||
#include <ChartTypeHelper.hxx>
|
||||
#include <Diagram.hxx>
|
||||
#include <unonames.hxx>
|
||||
#include <BaseCoordinateSystem.hxx>
|
||||
#include <memory>
|
||||
|
||||
#include <osl/diagnose.h>
|
||||
#include <o3tl/any.hxx>
|
||||
#include <svl/eitem.hxx>
|
||||
#include <svx/chrtitem.hxx>
|
||||
#include <svx/sdangitm.hxx>
|
||||
#include <svl/intitem.hxx>
|
||||
#include <rtl/math.hxx>
|
||||
|
||||
using namespace css;
|
||||
|
||||
namespace chart::wrapper
|
||||
{
|
||||
namespace
|
||||
{
|
||||
ItemPropertyMapType& lclDataTablePropertyMap()
|
||||
{
|
||||
static ItemPropertyMapType aPropertyMap{
|
||||
{ SCHATTR_DATA_TABLE_HORIZONTAL_BORDER, { "HBorder", 0 } },
|
||||
{ SCHATTR_DATA_TABLE_VERTICAL_BORDER, { "VBorder", 0 } },
|
||||
{ SCHATTR_DATA_TABLE_OUTLINE, { "Outline", 0 } },
|
||||
{ SCHATTR_DATA_TABLE_KEYS, { "Keys", 0 } },
|
||||
};
|
||||
return aPropertyMap;
|
||||
};
|
||||
}
|
||||
|
||||
DataTableItemConverter::DataTableItemConverter(
|
||||
const uno::Reference<beans::XPropertySet>& rPropertySet, SfxItemPool& rItemPool,
|
||||
SdrModel& rDrawModel, const rtl::Reference<::chart::ChartModel>& xChartDoc,
|
||||
const awt::Size* pRefSize)
|
||||
: ItemConverter(rPropertySet, rItemPool)
|
||||
, m_xChartDoc(xChartDoc)
|
||||
{
|
||||
m_aConverters.emplace_back(new GraphicPropertyItemConverter(
|
||||
rPropertySet, rItemPool, rDrawModel, xChartDoc, GraphicObjectType::LineProperties));
|
||||
m_aConverters.emplace_back(
|
||||
new CharacterPropertyItemConverter(rPropertySet, rItemPool, pRefSize, "ReferencePageSize"));
|
||||
}
|
||||
|
||||
DataTableItemConverter::~DataTableItemConverter() = default;
|
||||
|
||||
void DataTableItemConverter::FillItemSet(SfxItemSet& rOutItemSet) const
|
||||
{
|
||||
for (const auto& pConv : m_aConverters)
|
||||
{
|
||||
pConv->FillItemSet(rOutItemSet);
|
||||
}
|
||||
|
||||
// own items
|
||||
ItemConverter::FillItemSet(rOutItemSet);
|
||||
}
|
||||
|
||||
bool DataTableItemConverter::ApplyItemSet(const SfxItemSet& rItemSet)
|
||||
{
|
||||
bool bResult = false;
|
||||
|
||||
for (const auto& pConv : m_aConverters)
|
||||
{
|
||||
bResult = pConv->ApplyItemSet(rItemSet) || bResult;
|
||||
}
|
||||
|
||||
// own items
|
||||
return ItemConverter::ApplyItemSet(rItemSet) || bResult;
|
||||
}
|
||||
|
||||
const WhichRangesContainer& DataTableItemConverter::GetWhichPairs() const
|
||||
{
|
||||
return nDataTableWhichPairs;
|
||||
}
|
||||
|
||||
bool DataTableItemConverter::GetItemProperty(tWhichIdType nWhichId,
|
||||
tPropertyNameWithMemberId& rOutProperty) const
|
||||
{
|
||||
ItemPropertyMapType& rMap(lclDataTablePropertyMap());
|
||||
auto aIt = rMap.find(nWhichId);
|
||||
if (aIt == rMap.cend())
|
||||
return false;
|
||||
|
||||
rOutProperty = (*aIt).second;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||
@@ -171,4 +171,12 @@ const WhichRangesContainer nRegEquationWhichPairs(svl::Items<
|
||||
SID_CHAR_DLG_PREVIEW_STRING, SID_CHAR_DLG_PREVIEW_STRING // Characters
|
||||
>);
|
||||
|
||||
const WhichRangesContainer nDataTableWhichPairs(svl::Items<
|
||||
SCHATTR_TEXT_START, SCHATTR_TEXT_END,
|
||||
SCHATTR_DATA_TABLE_START, SCHATTR_DATA_TABLE_END,
|
||||
XATTR_LINE_FIRST, XATTR_LINE_LAST, // 1000 - 1016 svx/xdef.hxx
|
||||
XATTR_FILL_FIRST, XATTR_FILL_LAST, // 1018 - 1046 svx/xdef.hxx
|
||||
EE_ITEMS_START, EE_ITEMS_END
|
||||
>);
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include <MultipleChartConverters.hxx>
|
||||
#include <TitleItemConverter.hxx>
|
||||
#include <LegendItemConverter.hxx>
|
||||
#include <DataTableItemConverter.hxx>
|
||||
#include <RegressionCurveItemConverter.hxx>
|
||||
#include <RegressionEquationItemConverter.hxx>
|
||||
#include <ErrorBarItemConverter.hxx>
|
||||
@@ -287,6 +288,17 @@ wrapper::ItemConverter* createItemConverter(
|
||||
rDrawModel, xChartModel,
|
||||
wrapper::GraphicObjectType::LineAndFillProperties );
|
||||
break;
|
||||
case OBJECTTYPE_DATA_TABLE:
|
||||
{
|
||||
std::unique_ptr<awt::Size> pRefSize;
|
||||
if (pRefSizeProvider)
|
||||
pRefSize.reset(new awt::Size(pRefSizeProvider->getPageSize()));
|
||||
|
||||
pItemConverter = new wrapper::DataTableItemConverter(
|
||||
xObjectProperties, rDrawModel.GetItemPool(),
|
||||
rDrawModel, xChartModel, pRefSize.get());
|
||||
}
|
||||
break;
|
||||
default: //OBJECTTYPE_UNKNOWN
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -217,6 +217,14 @@ void ObjectHierarchy::createAxesTree(
|
||||
if( !bSupportsAxesGrids )
|
||||
return;
|
||||
|
||||
// Data Table
|
||||
uno::Reference<chart2::XDataTable> xDataTable = xDiagram->getDataTable();
|
||||
if (xDataTable.is())
|
||||
{
|
||||
rContainer.push_back(ObjectIdentifier::createClassifiedIdentifierForObject(xDataTable, xChartDoc));
|
||||
}
|
||||
|
||||
// Axes
|
||||
std::vector< rtl::Reference< Axis > > aAxes = AxisHelper::getAllAxesOfDiagram( xDiagram, /* bOnlyVisible = */ true );
|
||||
if( !m_bOrderingForElementSelector )
|
||||
{
|
||||
|
||||
@@ -74,6 +74,7 @@ enum ObjectType
|
||||
OBJECTTYPE_DATA_STOCK_RANGE,
|
||||
OBJECTTYPE_DATA_STOCK_LOSS,
|
||||
OBJECTTYPE_DATA_STOCK_GAIN,
|
||||
OBJECTTYPE_DATA_TABLE,
|
||||
OBJECTTYPE_SHAPE,
|
||||
OBJECTTYPE_UNKNOWN
|
||||
};
|
||||
@@ -149,6 +150,9 @@ public:
|
||||
static OUString createParticleForLegend(
|
||||
const rtl::Reference<::chart::ChartModel>& xChartModel );
|
||||
|
||||
static OUString createParticleForDataTable(
|
||||
const rtl::Reference<::chart::ChartModel>& xChartModel );
|
||||
|
||||
static OUString addChildParticle( std::u16string_view rParticle, std::u16string_view rChildParticle );
|
||||
static OUString createChildParticleWithIndex( ObjectType eObjectType, sal_Int32 nIndex );
|
||||
static sal_Int32 getIndexFromParticleOrCID( const OUString& rParticleOrCID );
|
||||
|
||||
@@ -194,7 +194,14 @@ constexpr TypedWhichId<SfxStringItem> SCHATTR_REGRESSION_YNAME
|
||||
constexpr TypedWhichId<SfxInt32Item> SCHATTR_REGRESSION_MOVING_TYPE (SCHATTR_REGRESSION_START + 12);
|
||||
constexpr sal_uInt16 SCHATTR_REGRESSION_END (SCHATTR_REGRESSION_MOVING_TYPE);
|
||||
|
||||
constexpr sal_uInt16 SCHATTR_END (SCHATTR_REGRESSION_END);
|
||||
constexpr sal_uInt16 SCHATTR_DATA_TABLE_START (SCHATTR_REGRESSION_END + 1);
|
||||
constexpr TypedWhichId<SfxBoolItem> SCHATTR_DATA_TABLE_HORIZONTAL_BORDER (SCHATTR_DATA_TABLE_START + 0);
|
||||
constexpr TypedWhichId<SfxBoolItem> SCHATTR_DATA_TABLE_VERTICAL_BORDER (SCHATTR_DATA_TABLE_START + 1);
|
||||
constexpr TypedWhichId<SfxBoolItem> SCHATTR_DATA_TABLE_OUTLINE (SCHATTR_DATA_TABLE_START + 2);
|
||||
constexpr TypedWhichId<SfxBoolItem> SCHATTR_DATA_TABLE_KEYS (SCHATTR_DATA_TABLE_START + 3);
|
||||
constexpr sal_uInt16 SCHATTR_DATA_TABLE_END (SCHATTR_DATA_TABLE_KEYS);
|
||||
|
||||
constexpr sal_uInt16 SCHATTR_END (SCHATTR_DATA_TABLE_END);
|
||||
|
||||
// values for Items
|
||||
|
||||
|
||||
@@ -322,6 +322,12 @@ OUString ObjectIdentifier::createClassifiedIdentifierForObject(
|
||||
|
||||
}
|
||||
|
||||
uno::Reference<chart2::XDataTable> xDataTable(xObject, uno::UNO_QUERY);
|
||||
if (xDataTable.is())
|
||||
{
|
||||
return createClassifiedIdentifierForParticle(createParticleForDataTable(xChartModel));
|
||||
}
|
||||
|
||||
//axis
|
||||
Reference< XAxis > xAxis( xObject, uno::UNO_QUERY );
|
||||
if( xAxis.is() )
|
||||
@@ -544,6 +550,11 @@ OUString ObjectIdentifier::createParticleForLegend(
|
||||
return ObjectIdentifier::createParticleForDiagram() + ":" + getStringForType( OBJECTTYPE_LEGEND ) + "=";
|
||||
}
|
||||
|
||||
OUString ObjectIdentifier::createParticleForDataTable(const rtl::Reference<::chart::ChartModel>& /* xChartModel */)
|
||||
{
|
||||
return ObjectIdentifier::createParticleForDiagram() + ":" + getStringForType(OBJECTTYPE_DATA_TABLE) + "=";
|
||||
}
|
||||
|
||||
OUString ObjectIdentifier::createClassifiedIdentifier(
|
||||
enum ObjectType eObjectType //e.g. OBJECTTYPE_DATA_SERIES
|
||||
, std::u16string_view rParticleID )//e.g. SeriesID
|
||||
@@ -870,6 +881,9 @@ OUString ObjectIdentifier::getStringForType( ObjectType eObjectType )
|
||||
case OBJECTTYPE_DATA_STOCK_GAIN:
|
||||
aRet="StockGain";
|
||||
break;
|
||||
case OBJECTTYPE_DATA_TABLE:
|
||||
aRet="DataTable";
|
||||
break;
|
||||
default: //OBJECTTYPE_UNKNOWN
|
||||
;
|
||||
}
|
||||
@@ -941,6 +955,8 @@ ObjectType ObjectIdentifier::getObjectType( std::u16string_view aCID )
|
||||
eRet = OBJECTTYPE_DATA_STOCK_LOSS;
|
||||
else if( o3tl::starts_with(aCID, u"StockGain") )
|
||||
eRet = OBJECTTYPE_DATA_STOCK_GAIN;
|
||||
else if( o3tl::starts_with(aCID, u"DataTable") )
|
||||
eRet = OBJECTTYPE_DATA_TABLE;
|
||||
else
|
||||
eRet = OBJECTTYPE_UNKNOWN;
|
||||
|
||||
@@ -1240,6 +1256,13 @@ Reference< beans::XPropertySet > ObjectIdentifier::getObjectPropertySet(
|
||||
xChartType->getPropertyValue( "WhiteDay" ) >>= xObjectProperties;
|
||||
}
|
||||
break;
|
||||
case OBJECTTYPE_DATA_TABLE:
|
||||
{
|
||||
if (xDiagram.is())
|
||||
xObjectProperties.set(xDiagram->getDataTable(), uno::UNO_QUERY);
|
||||
}
|
||||
break;
|
||||
break;
|
||||
default: //OBJECTTYPE_UNKNOWN
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -175,6 +175,11 @@ ChartItemPool::ChartItemPool():
|
||||
rPoolDefaults[SCHATTR_REGRESSION_YNAME - SCHATTR_START] = new SfxStringItem(SCHATTR_REGRESSION_YNAME, "f(x)");
|
||||
rPoolDefaults[SCHATTR_REGRESSION_MOVING_TYPE - SCHATTR_START] = new SfxInt32Item(SCHATTR_REGRESSION_MOVING_TYPE, css::chart2::MovingAverageType::Prior);
|
||||
|
||||
rPoolDefaults[SCHATTR_DATA_TABLE_HORIZONTAL_BORDER - SCHATTR_START] = new SfxBoolItem(SCHATTR_DATA_TABLE_HORIZONTAL_BORDER, false);
|
||||
rPoolDefaults[SCHATTR_DATA_TABLE_VERTICAL_BORDER - SCHATTR_START] = new SfxBoolItem(SCHATTR_DATA_TABLE_VERTICAL_BORDER, false);
|
||||
rPoolDefaults[SCHATTR_DATA_TABLE_OUTLINE - SCHATTR_START] = new SfxBoolItem(SCHATTR_DATA_TABLE_OUTLINE, false);
|
||||
rPoolDefaults[SCHATTR_DATA_TABLE_KEYS - SCHATTR_START] = new SfxBoolItem(SCHATTR_DATA_TABLE_KEYS, false);
|
||||
|
||||
/**************************************************************************
|
||||
* ItemInfos
|
||||
**************************************************************************/
|
||||
|
||||
@@ -0,0 +1,115 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.38.2 -->
|
||||
<interface domain="chart">
|
||||
<requires lib="gtk+" version="3.20"/>
|
||||
<object class="GtkBox" id="DataTableTabPage">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="vexpand">True</property>
|
||||
<property name="border-width">6</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">12</property>
|
||||
<child>
|
||||
<object class="GtkFrame" id="frame2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="vexpand">True</property>
|
||||
<property name="label-xalign">0</property>
|
||||
<property name="shadow-type">none</property>
|
||||
<child>
|
||||
<object class="GtkBox" id="box4">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="margin-start">12</property>
|
||||
<property name="margin-top">6</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="vexpand">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="horizontalBorderCB">
|
||||
<property name="label" translatable="yes" context="tp_DataTable|horizontalBorderCB">Show Horizontal Border</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="use-underline">True</property>
|
||||
<property name="draw-indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="verticalBorderCB">
|
||||
<property name="label" translatable="yes" context="tp_DataTable|verticalBorderCB">Show Vertical Border</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="use-underline">True</property>
|
||||
<property name="draw-indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="outlineCB">
|
||||
<property name="label" translatable="yes" context="tp_DataTable|outlineCB">Show Outline</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="use-underline">True</property>
|
||||
<property name="draw-indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="keysCB">
|
||||
<property name="label" translatable="yes" context="tp_DataTable|keysCB">Show Keys</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="use-underline">True</property>
|
||||
<property name="draw-indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child type="label">
|
||||
<object class="GtkLabel" id="dataTablePropertiesLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes" context="tp_axisLabel|textflowL">Data Table Properties</property>
|
||||
<attributes>
|
||||
<attribute name="weight" value="bold"/>
|
||||
</attributes>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
Reference in New Issue
Block a user