[Libreoffice-commits] core.git: 6 commits - officecfg/registry sc/source sc/uiconfig xmloff/source
Markus Mohrhard
markus.mohrhard at googlemail.com
Sun Mar 17 18:32:02 PDT 2013
officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu | 2
sc/source/ui/view/drawvie4.cxx | 90 ++++++++--
sc/uiconfig/scalc/menubar/menubar.xml | 2
xmloff/source/chart/SchXMLPlotAreaContext.cxx | 20 +-
xmloff/source/chart/SchXMLPlotAreaContext.hxx | 4
xmloff/source/chart/SchXMLSeries2Context.cxx | 6
6 files changed, 94 insertions(+), 30 deletions(-)
New commits:
commit 094bab7f9097fba62800d3dd578bd42640d8c6e2
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Mar 18 01:57:03 2013 +0100
we need to register data sequences during import, fdo#52159
Change-Id: I203be719a6ee19c87ed232218f7700d875c2871f
diff --git a/xmloff/source/chart/SchXMLPlotAreaContext.cxx b/xmloff/source/chart/SchXMLPlotAreaContext.cxx
index 9d3c474..a6ca2b5 100644
--- a/xmloff/source/chart/SchXMLPlotAreaContext.cxx
+++ b/xmloff/source/chart/SchXMLPlotAreaContext.cxx
@@ -958,7 +958,8 @@ void SchXMLStockContext::StartElement( const uno::Reference< xml::sax::XAttribut
static void lcl_setErrorBarSequence ( const uno::Reference< chart2::XChartDocument > &xDoc,
const uno::Reference< beans::XPropertySet > &xBarProp,
const rtl::OUString &aXMLRange,
- bool bPositiveValue, bool bYError )
+ bool bPositiveValue, bool bYError,
+ tSchXMLLSequencesPerIndex& rSequences)
{
uno::Reference< com::sun::star::chart2::data::XDataProvider > xDataProvider(xDoc->getDataProvider());
uno::Reference< com::sun::star::chart2::data::XDataSource > xDataSource( xBarProp, uno::UNO_QUERY );
@@ -999,6 +1000,9 @@ static void lcl_setErrorBarSequence ( const uno::Reference< chart2::XChartDocume
Reference< chart2::data::XLabeledDataSequence > xLabelSeq( chart2::data::LabeledDataSequence::create(xContext),
uno::UNO_QUERY_THROW );
+ rSequences.insert( tSchXMLLSequencesPerIndex::value_type(
+ tSchXMLIndexWithPart( -2, SCH_XML_PART_ERROR_BARS ), xLabelSeq ) );
+
xLabelSeq->setValues( xNewSequence );
uno::Sequence< Reference< chart2::data::XLabeledDataSequence > > aSequences(
@@ -1021,7 +1025,8 @@ SchXMLStatisticsObjectContext::SchXMLStatisticsObjectContext(
const ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XDataSeries >& xSeries,
ContextType eContextType,
- const awt::Size & rChartSize ) :
+ const awt::Size & rChartSize,
+ tSchXMLLSequencesPerIndex & rLSequencesPerIndex) :
SvXMLImportContext( rImport, nPrefix, rLocalName ),
mrImportHelper( rImpHelper ),
@@ -1029,7 +1034,8 @@ SchXMLStatisticsObjectContext::SchXMLStatisticsObjectContext(
m_xSeries( xSeries ),
meContextType( eContextType ),
maChartSize( rChartSize ),
- maSeriesStyleName( rSeriesStyleName)
+ maSeriesStyleName( rSeriesStyleName),
+ mrLSequencesPerIndex(rLSequencesPerIndex)
{}
SchXMLStatisticsObjectContext::~SchXMLStatisticsObjectContext()
@@ -1217,10 +1223,10 @@ void SchXMLStatisticsObjectContext::StartElement( const uno::Reference< xml::sax
uno::Reference< chart2::XChartDocument > xDoc(GetImport().GetModel(),uno::UNO_QUERY);
if (!aPosRange.isEmpty())
- lcl_setErrorBarSequence(xDoc,xBarProp,aPosRange,true,bYError);
+ lcl_setErrorBarSequence(xDoc,xBarProp,aPosRange,true,bYError, mrLSequencesPerIndex);
if (!aNegRange.isEmpty())
- lcl_setErrorBarSequence(xDoc,xBarProp,aNegRange,false,bYError);
+ lcl_setErrorBarSequence(xDoc,xBarProp,aNegRange,false,bYError, mrLSequencesPerIndex);
if ( !bYError )
{
diff --git a/xmloff/source/chart/SchXMLPlotAreaContext.hxx b/xmloff/source/chart/SchXMLPlotAreaContext.hxx
index 8ed329a..3f4d133 100644
--- a/xmloff/source/chart/SchXMLPlotAreaContext.hxx
+++ b/xmloff/source/chart/SchXMLPlotAreaContext.hxx
@@ -265,7 +265,8 @@ public:
const ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XDataSeries >& xSeries,
ContextType eContextType,
- const ::com::sun::star::awt::Size & rChartSize );
+ const ::com::sun::star::awt::Size & rChartSize,
+ tSchXMLLSequencesPerIndex & rLSequencesPerIndex );
virtual ~SchXMLStatisticsObjectContext();
@@ -283,6 +284,7 @@ private:
ContextType meContextType;
::com::sun::star::awt::Size maChartSize;
rtl::OUString maSeriesStyleName;
+ tSchXMLLSequencesPerIndex& mrLSequencesPerIndex;
};
// ----------------------------------------
diff --git a/xmloff/source/chart/SchXMLSeries2Context.cxx b/xmloff/source/chart/SchXMLSeries2Context.cxx
index 07dd9e2..222a365 100644
--- a/xmloff/source/chart/SchXMLSeries2Context.cxx
+++ b/xmloff/source/chart/SchXMLSeries2Context.cxx
@@ -648,7 +648,7 @@ SvXMLImportContext* SchXMLSeries2Context::CreateChildContext(
nPrefix, rLocalName, msAutoStyleName,
mrStyleList, m_xSeries,
SchXMLStatisticsObjectContext::CONTEXT_TYPE_MEAN_VALUE_LINE,
- maChartSize );
+ maChartSize, mrLSequencesPerIndex );
break;
case XML_TOK_SERIES_REGRESSION_CURVE:
pContext = new SchXMLStatisticsObjectContext(
@@ -656,7 +656,7 @@ SvXMLImportContext* SchXMLSeries2Context::CreateChildContext(
nPrefix, rLocalName, msAutoStyleName,
mrStyleList, m_xSeries,
SchXMLStatisticsObjectContext::CONTEXT_TYPE_REGRESSION_CURVE,
- maChartSize );
+ maChartSize, mrLSequencesPerIndex );
break;
case XML_TOK_SERIES_ERROR_INDICATOR:
pContext = new SchXMLStatisticsObjectContext(
@@ -664,7 +664,7 @@ SvXMLImportContext* SchXMLSeries2Context::CreateChildContext(
nPrefix, rLocalName, msAutoStyleName,
mrStyleList, m_xSeries,
SchXMLStatisticsObjectContext::CONTEXT_TYPE_ERROR_INDICATOR,
- maChartSize );
+ maChartSize, mrLSequencesPerIndex );
break;
case XML_TOK_SERIES_DATA_POINT:
commit e15d8ef44fbf9fc23da58648e4d288782a81c7c1
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Sun Mar 17 02:53:02 2013 +0100
error bar range is also part of chart range, related fdo#52159
Change-Id: I344448db559de8435dcc26e2be4597c385724a7b
diff --git a/sc/source/ui/view/drawvie4.cxx b/sc/source/ui/view/drawvie4.cxx
index 82e70f7..b30d3d1 100644
--- a/sc/source/ui/view/drawvie4.cxx
+++ b/sc/source/ui/view/drawvie4.cxx
@@ -44,6 +44,9 @@
#include <com/sun/star/embed/Aspects.hpp>
#include <com/sun/star/embed/XEmbeddedObject.hpp>
#include <com/sun/star/embed/XComponentSupplier.hpp>
+#include <com/sun/star/chart2/XChartTypeContainer.hpp>
+#include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
+#include <com/sun/star/chart2/XDataSeriesContainer.hpp>
using namespace com::sun::star;
@@ -141,6 +144,70 @@ sal_Bool ScDrawView::BeginDrag( Window* pWindow, const Point& rStartPos )
namespace {
+void getRangeFromDataSource( uno::Reference< chart2::data::XDataSource > xDataSource, std::vector<OUString>& rRangeRep)
+{
+ uno::Sequence<uno::Reference<chart2::data::XLabeledDataSequence> > xSeqs = xDataSource->getDataSequences();
+ for (sal_Int32 i = 0, n = xSeqs.getLength(); i < n; ++i)
+ {
+ uno::Reference<chart2::data::XLabeledDataSequence> xLS = xSeqs[i];
+ uno::Reference<chart2::data::XDataSequence> xSeq = xLS->getValues();
+ if (xSeq.is())
+ {
+ OUString aRep = xSeq->getSourceRangeRepresentation();
+ rRangeRep.push_back(aRep);
+ }
+ xSeq = xLS->getLabel();
+ if (xSeq.is())
+ {
+ OUString aRep = xSeq->getSourceRangeRepresentation();
+ rRangeRep.push_back(aRep);
+ }
+ }
+}
+
+
+void getRangeFromErrorBar(const uno::Reference< chart2::XChartDocument > xChartDoc, std::vector<OUString>& rRangeRep)
+{
+ uno::Reference <chart2::XDiagram > xDiagram = xChartDoc->getFirstDiagram();
+ if(!xDiagram.is())
+ return;
+
+ uno::Reference< chart2::XCoordinateSystemContainer > xCooSysContainer( xDiagram, uno::UNO_QUERY);
+ if(!xCooSysContainer.is())
+ return;
+
+ uno::Sequence< uno::Reference< chart2::XCoordinateSystem > > xCooSysSequence( xCooSysContainer->getCoordinateSystems());
+ for(sal_Int32 i = 0; i < xCooSysSequence.getLength(); ++i)
+ {
+ uno::Reference< chart2::XChartTypeContainer > xChartTypeContainer( xCooSysSequence[i], uno::UNO_QUERY);
+ if(!xChartTypeContainer.is())
+ continue;
+
+ uno::Sequence< uno::Reference< chart2::XChartType > > xChartTypeSequence( xChartTypeContainer->getChartTypes() );
+ for(sal_Int32 nChartType = 0; nChartType < xChartTypeSequence.getLength(); ++nChartType)
+ {
+ uno::Reference< chart2::XDataSeriesContainer > xDataSequenceContainer( xChartTypeSequence[nChartType], uno::UNO_QUERY);
+ if(!xDataSequenceContainer.is())
+ continue;
+
+ uno::Sequence< uno::Reference< chart2::XDataSeries > > xSeriesSequence( xDataSequenceContainer->getDataSeries() );
+ for(sal_Int32 nDataSeries = 0; nDataSeries < xSeriesSequence.getLength(); ++nDataSeries)
+ {
+ uno::Reference< chart2::XDataSeries > xSeries = xSeriesSequence[nDataSeries];
+ uno::Reference< beans::XPropertySet > xPropSet( xSeries, uno::UNO_QUERY);
+ uno::Reference< chart2::data::XDataSource > xErrorBarY;
+ xPropSet->getPropertyValue("ErrorBarY") >>= xErrorBarY;
+ if(xErrorBarY.is())
+ getRangeFromDataSource(xErrorBarY, rRangeRep);
+ uno::Reference< chart2::data::XDataSource > xErrorBarX;
+ xPropSet->getPropertyValue("ErrorBarX") >>= xErrorBarX;
+ if(xErrorBarX.is())
+ getRangeFromDataSource(xErrorBarX, rRangeRep);
+ }
+ }
+ }
+}
+
void getRangeFromOle2Object(const SdrOle2Obj& rObj, std::vector<OUString>& rRangeRep)
{
if (!rObj.IsChart())
@@ -162,28 +229,14 @@ void getRangeFromOle2Object(const SdrOle2Obj& rObj, std::vector<OUString>& rRang
if(xChartDoc->hasInternalDataProvider())
return;
+ getRangeFromErrorBar(xChartDoc, rRangeRep);
+
uno::Reference<chart2::data::XDataSource> xDataSource(xChartDoc, uno::UNO_QUERY);
if (!xDataSource.is())
return;
// Get all data sources used in this chart.
- uno::Sequence<uno::Reference<chart2::data::XLabeledDataSequence> > xSeqs = xDataSource->getDataSequences();
- for (sal_Int32 i = 0, n = xSeqs.getLength(); i < n; ++i)
- {
- uno::Reference<chart2::data::XLabeledDataSequence> xLS = xSeqs[i];
- uno::Reference<chart2::data::XDataSequence> xSeq = xLS->getValues();
- if (xSeq.is())
- {
- OUString aRep = xSeq->getSourceRangeRepresentation();
- rRangeRep.push_back(aRep);
- }
- xSeq = xLS->getLabel();
- if (xSeq.is())
- {
- OUString aRep = xSeq->getSourceRangeRepresentation();
- rRangeRep.push_back(aRep);
- }
- }
+ getRangeFromDataSource(xDataSource, rRangeRep);
}
/**
commit 7b12b4677f658fd2dc9ff40371823da59533fa45
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Sun Mar 17 01:46:05 2013 +0100
for internal data providers this makes no sense
Change-Id: Ic2651defd0ec8846dc0b0a81faee5dd6743310fb
diff --git a/sc/source/ui/view/drawvie4.cxx b/sc/source/ui/view/drawvie4.cxx
index a6289d0..82e70f7 100644
--- a/sc/source/ui/view/drawvie4.cxx
+++ b/sc/source/ui/view/drawvie4.cxx
@@ -159,6 +159,9 @@ void getRangeFromOle2Object(const SdrOle2Obj& rObj, std::vector<OUString>& rRang
if (!xChartDoc.is())
return;
+ if(xChartDoc->hasInternalDataProvider())
+ return;
+
uno::Reference<chart2::data::XDataSource> xDataSource(xChartDoc, uno::UNO_QUERY);
if (!xDataSource.is())
return;
commit a6d12acda9bb24f2acca45e0bd1aea577e49fbbf
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Sat Mar 16 01:04:44 2013 +0100
use the right range representation, fdo#52159
Change-Id: I36ede89ccb8836708a4f87c4815bbe2fb6d6f3cf
diff --git a/xmloff/source/chart/SchXMLPlotAreaContext.cxx b/xmloff/source/chart/SchXMLPlotAreaContext.cxx
index 463308a..9d3c474 100644
--- a/xmloff/source/chart/SchXMLPlotAreaContext.cxx
+++ b/xmloff/source/chart/SchXMLPlotAreaContext.cxx
@@ -957,7 +957,7 @@ void SchXMLStockContext::StartElement( const uno::Reference< xml::sax::XAttribut
static void lcl_setErrorBarSequence ( const uno::Reference< chart2::XChartDocument > &xDoc,
const uno::Reference< beans::XPropertySet > &xBarProp,
- const rtl::OUString &aRange,
+ const rtl::OUString &aXMLRange,
bool bPositiveValue, bool bYError )
{
uno::Reference< com::sun::star::chart2::data::XDataProvider > xDataProvider(xDoc->getDataProvider());
@@ -966,7 +966,7 @@ static void lcl_setErrorBarSequence ( const uno::Reference< chart2::XChartDocume
assert( xDataSink.is() && xDataSource.is() && xDataProvider.is() );
- rtl::OUString aXMLRange(lcl_ConvertRange(aRange,xDoc));
+ rtl::OUString aRange(lcl_ConvertRange(aXMLRange,xDoc));
uno::Reference< chart2::data::XDataSequence > xNewSequence(
xDataProvider->createDataSequenceByRangeRepresentation( aRange ));
commit 145ca863553e27e28f76e940071e713c539db0dd
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Fri Mar 15 05:29:39 2013 +0100
reorganize the menu a little bit
Change-Id: I956abc2cfa680f18df5712a131a7930610f57931
diff --git a/sc/uiconfig/scalc/menubar/menubar.xml b/sc/uiconfig/scalc/menubar/menubar.xml
index de494d5..e461fce 100644
--- a/sc/uiconfig/scalc/menubar/menubar.xml
+++ b/sc/uiconfig/scalc/menubar/menubar.xml
@@ -206,7 +206,6 @@
<menu:menuitem menu:id=".uno:InsertGraphic"/>
</menu:menupopup>
</menu:menu>
- <menu:menuitem menu:id=".uno:InsertAVMedia"/>
<menu:menu menu:id=".uno:ObjectMenu">
<menu:menupopup>
<menu:menuitem menu:id=".uno:InsertObject"/>
@@ -218,6 +217,7 @@
<menu:menuitem menu:id=".uno:InsertObjectChartFromFile"/>
</menu:menupopup>
</menu:menu>
+ <menu:menuitem menu:id=".uno:InsertAVMedia"/>
<menu:menuitem menu:id=".uno:InsertObjectFloatingFrame"/>
</menu:menupopup>
</menu:menu>
commit 9e7df9113496ee6e91d97999a1bc1c789c154467
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Fri Mar 15 05:00:01 2013 +0100
better wording for the menu entry
Change-Id: I7ddb4e3b4fc39b542e2ab54a188d0953a2b7ce8d
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu
index b03d7d4..0feec3b 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu
@@ -382,7 +382,7 @@
</node>
<node oor:name=".uno:InsertObjectChartFromFile" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">Load Chart From File</value>
+ <value xml:lang="en-US">Chart From File</value>
</prop>
</node>
<node oor:name=".uno:StarChartDialog" oor:op="replace">
More information about the Libreoffice-commits
mailing list