summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2018-04-26 17:03:55 +0900
committerMiklos Vajna <vmiklos@collabora.co.uk>2018-05-03 08:51:01 +0200
commit7f580d4fba2da90da2ccfbad7f0e21c12e810a26 (patch)
tree18fb7ab7d881c27d4c161181b10a7b9b6d5a52d2 /chart2
parentebcf27d419e41a497242c98fcfec08a2088c0720 (diff)
[API CHANGE] revert SymbolBitmapURL impl, add SymbolBitmap property
This adds back the implementation for setting the SymbolBitmapURL property (getting returns an empty string) and adds SymbolBitmap property to the UNO API (LineDiagram.idl). SymbolBitmapURL property was already deprecated, but we still need to add the SymbolBitmap for compatibility. [ Miklos Vajna: updated qadevOOo tests to handle the new write-only properties. ] Change-Id: Id00d78299b7fd5ba9d78c36c5f03a10d9e61c60a Reviewed-on: https://gerrit.libreoffice.org/53492 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'chart2')
-rw-r--r--chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx2
-rw-r--r--chart2/source/controller/chartapiwrapper/WrappedSymbolProperties.cxx51
2 files changed, 52 insertions, 1 deletions
diff --git a/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx b/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx
index f49bcb0d4fe5..31cf7ff0c9ba 100644
--- a/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx
@@ -591,7 +591,7 @@ beans::PropertyState SAL_CALL DataSeriesPointWrapper::getPropertyState( const OU
beans::PropertyState aState( beans::PropertyState_DIRECT_VALUE );
try
{
- if (rPropertyName == "SymbolBitmap")
+ if (rPropertyName == "SymbolBitmap" || rPropertyName == "SymbolBitmapURL")
{
uno::Any aAny = WrappedPropertySet::getPropertyValue("SymbolType");
sal_Int32 nVal = css::chart::ChartSymbolType::NONE;
diff --git a/chart2/source/controller/chartapiwrapper/WrappedSymbolProperties.cxx b/chart2/source/controller/chartapiwrapper/WrappedSymbolProperties.cxx
index a0bd74b8c82b..10a756ef1f9c 100644
--- a/chart2/source/controller/chartapiwrapper/WrappedSymbolProperties.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedSymbolProperties.cxx
@@ -27,6 +27,7 @@
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/chart/ChartSymbolType.hpp>
#include <com/sun/star/drawing/LineStyle.hpp>
+#include <vcl/GraphicLoader.hxx>
#include <editeng/unoprnms.hxx>
#include <vcl/graph.hxx>
@@ -58,6 +59,16 @@ public:
tSeriesOrDiagramPropertyType ePropertyType);
};
+class WrappedSymbolBitmapURLProperty : public WrappedSeriesOrDiagramProperty<OUString>
+{
+public:
+ virtual OUString getValueFromSeries(const Reference<beans::XPropertySet>& xSeriesPropertySet) const override;
+ virtual void setValueToSeries(const Reference<beans::XPropertySet> & xSeriesPropertySet, OUString const & xNewGraphicURL) const override;
+
+ explicit WrappedSymbolBitmapURLProperty(const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact,
+ tSeriesOrDiagramPropertyType ePropertyType);
+};
+
class WrappedSymbolBitmapProperty : public WrappedSeriesOrDiagramProperty<uno::Reference<graphic::XGraphic>>
{
public:
@@ -96,6 +107,7 @@ enum
{
//symbol properties
PROP_CHART_SYMBOL_TYPE = FAST_PROPERTY_ID_START_CHART_SYMBOL_PROP,
+ PROP_CHART_SYMBOL_BITMAP_URL,
PROP_CHART_SYMBOL_BITMAP,
PROP_CHART_SYMBOL_SIZE,
PROP_CHART_SYMBOL_AND_LINES
@@ -151,6 +163,7 @@ void lcl_addWrappedProperties( std::vector< WrappedProperty* >& rList
, tSeriesOrDiagramPropertyType ePropertyType )
{
rList.push_back( new WrappedSymbolTypeProperty( spChart2ModelContact, ePropertyType ) );
+ rList.push_back( new WrappedSymbolBitmapURLProperty( spChart2ModelContact, ePropertyType ) );
rList.push_back( new WrappedSymbolBitmapProperty( spChart2ModelContact, ePropertyType ) );
rList.push_back( new WrappedSymbolSizeProperty( spChart2ModelContact, ePropertyType ) );
rList.push_back( new WrappedSymbolAndLinesProperty( spChart2ModelContact, ePropertyType ) );
@@ -166,6 +179,12 @@ void WrappedSymbolProperties::addProperties( std::vector< Property > & rOutPrope
beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::MAYBEDEFAULT );
+ rOutProperties.emplace_back( "SymbolBitmapURL",
+ PROP_CHART_SYMBOL_BITMAP_URL,
+ cppu::UnoType<OUString>::get(),
+ beans::PropertyAttribute::BOUND
+ | beans::PropertyAttribute::MAYBEDEFAULT );
+
rOutProperties.emplace_back( "SymbolBitmap",
PROP_CHART_SYMBOL_BITMAP,
cppu::UnoType<graphic::XGraphic>::get(),
@@ -278,6 +297,38 @@ beans::PropertyState WrappedSymbolTypeProperty::getPropertyState( const Referenc
return WrappedProperty::getPropertyState( xInnerPropertyState );
}
+WrappedSymbolBitmapURLProperty::WrappedSymbolBitmapURLProperty(
+ const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact,
+ tSeriesOrDiagramPropertyType ePropertyType )
+ : WrappedSeriesOrDiagramProperty<OUString>("SymbolBitmapURL",
+ uno::Any(OUString()), spChart2ModelContact, ePropertyType)
+{
+}
+
+OUString WrappedSymbolBitmapURLProperty::getValueFromSeries(const Reference< beans::XPropertySet >& /*xSeriesPropertySet*/) const
+{
+ return OUString();
+}
+
+void WrappedSymbolBitmapURLProperty::setValueToSeries(
+ const Reference< beans::XPropertySet >& xSeriesPropertySet,
+ OUString const & xNewGraphicURL) const
+{
+ if (!xSeriesPropertySet.is())
+ return;
+
+ chart2::Symbol aSymbol;
+ if (xSeriesPropertySet->getPropertyValue("Symbol") >>= aSymbol)
+ {
+ if (!xNewGraphicURL.isEmpty())
+ {
+ Graphic aGraphic = vcl::graphic::loadFromURL(xNewGraphicURL);
+ aSymbol.Graphic.set(aGraphic.GetXGraphic());
+ xSeriesPropertySet->setPropertyValue("Symbol", uno::Any(aSymbol));
+ }
+ }
+}
+
WrappedSymbolBitmapProperty::WrappedSymbolBitmapProperty(
const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact,
tSeriesOrDiagramPropertyType ePropertyType )