summaryrefslogtreecommitdiff
path: root/chart2/source/tools
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2009-12-01 17:30:38 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2009-12-01 17:30:38 +0000
commit11f52cbb87982809d3b677b8a59917027778a3e8 (patch)
treea1c86d91706e614d5f5fc5bd91057f6aa49a03dc /chart2/source/tools
parent41bc566f76d09ccc48771aa2f82a18e79323761f (diff)
parentf1b4f077bec4a899462d643c31d36c87d144a1e4 (diff)
chartshapes: merge with DEV300 m50
Diffstat (limited to 'chart2/source/tools')
-rw-r--r--chart2/source/tools/AxisHelper.cxx12
-rw-r--r--chart2/source/tools/CachedDataSequence.cxx62
-rw-r--r--chart2/source/tools/CharacterProperties.cxx8
-rw-r--r--chart2/source/tools/ChartModelHelper.cxx129
-rw-r--r--chart2/source/tools/CommonConverters.cxx186
-rw-r--r--chart2/source/tools/ConfigColorScheme.cxx6
-rw-r--r--chart2/source/tools/DataSeriesHelper.cxx91
-rw-r--r--chart2/source/tools/DataSourceHelper.cxx37
-rw-r--r--chart2/source/tools/ErrorBar.cxx9
-rw-r--r--chart2/source/tools/ImplUndoManager.cxx4
-rw-r--r--chart2/source/tools/InternalDataProvider.cxx55
-rw-r--r--chart2/source/tools/LabeledDataSequence.cxx6
-rw-r--r--chart2/source/tools/ModifyListenerHelper.cxx10
-rw-r--r--chart2/source/tools/NameContainer.cxx6
-rw-r--r--chart2/source/tools/OPropertySet.cxx26
-rw-r--r--chart2/source/tools/ObjectIdentifier.cxx8
-rw-r--r--chart2/source/tools/RangeHighlighter.cxx10
-rw-r--r--chart2/source/tools/ReferenceSizeProvider.cxx20
-rw-r--r--chart2/source/tools/RegressionCurveModel.cxx4
-rw-r--r--chart2/source/tools/StatisticsHelper.cxx2
-rw-r--r--chart2/source/tools/TitleHelper.cxx6
-rw-r--r--chart2/source/tools/UncachedDataSequence.cxx28
22 files changed, 363 insertions, 362 deletions
diff --git a/chart2/source/tools/AxisHelper.cxx b/chart2/source/tools/AxisHelper.cxx
index b9778042baed..5e6c0bce8717 100644
--- a/chart2/source/tools/AxisHelper.cxx
+++ b/chart2/source/tools/AxisHelper.cxx
@@ -40,6 +40,7 @@
#include "ContainerHelper.hxx"
#include "servicenames_coosystems.hxx"
#include "DataSeriesHelper.hxx"
+#include "Scaling.hxx"
#include <svtools/saveopt.hxx>
@@ -66,6 +67,17 @@ using namespace ::com::sun::star::chart2;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence;
+//static
+Reference< chart2::XScaling > AxisHelper::createLinearScaling()
+{
+ return new LinearScaling( 1.0, 0.0 );
+}
+
+//static
+Reference< chart2::XScaling > AxisHelper::createLogarithmicScaling( double fBase )
+{
+ return new LogarithmicScaling( fBase );
+}
//static
ScaleData AxisHelper::createDefaultScale()
diff --git a/chart2/source/tools/CachedDataSequence.cxx b/chart2/source/tools/CachedDataSequence.cxx
index 68cbcb50caa7..09a814f277c8 100644
--- a/chart2/source/tools/CachedDataSequence.cxx
+++ b/chart2/source/tools/CachedDataSequence.cxx
@@ -68,9 +68,7 @@ enum
{
// PROP_SOURCE_IDENTIFIER,
PROP_NUMBERFORMAT_KEY,
- PROP_PROPOSED_ROLE,
- PROP_HIDDEN,
- PROP_HIDDEN_VALUES
+ PROP_PROPOSED_ROLE
};
} // anonymous namespace
@@ -82,67 +80,31 @@ namespace chart
CachedDataSequence::CachedDataSequence()
: OPropertyContainer( GetBroadcastHelper()),
CachedDataSequence_Base( GetMutex()),
- m_bIsHidden( true ),
m_eCurrentDataType( NUMERICAL ),
- m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder())
+ m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder())
{
registerProperties();
}
CachedDataSequence::CachedDataSequence( const Reference< uno::XComponentContext > & /*xContext*/ )
: OPropertyContainer( GetBroadcastHelper()),
CachedDataSequence_Base( GetMutex()),
- m_bIsHidden( true ),
m_eCurrentDataType( MIXED ),
- m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder( ))
+ m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder( ))
{
registerProperties();
}
-CachedDataSequence::CachedDataSequence( const ::std::vector< double > & rVector )
- : OPropertyContainer( GetBroadcastHelper()),
- CachedDataSequence_Base( GetMutex()),
- m_bIsHidden( true ),
- m_eCurrentDataType( NUMERICAL ),
- m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder())
-{
- m_aNumericalSequence = ContainerToSequence( rVector );
- registerProperties();
-}
-
-CachedDataSequence::CachedDataSequence( const ::std::vector< OUString > & rVector )
- : OPropertyContainer( GetBroadcastHelper()),
- CachedDataSequence_Base( GetMutex()),
- m_bIsHidden( true ),
- m_eCurrentDataType( TEXTUAL ),
- m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder())
-{
- m_aTextualSequence = ContainerToSequence( rVector );
- registerProperties();
-}
-
CachedDataSequence::CachedDataSequence( const OUString & rSingleText )
: OPropertyContainer( GetBroadcastHelper()),
CachedDataSequence_Base( GetMutex()),
- m_bIsHidden( true ),
m_eCurrentDataType( TEXTUAL ),
- m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder())
+ m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder())
{
m_aTextualSequence.realloc(1);
m_aTextualSequence[0] = rSingleText;
registerProperties();
}
-CachedDataSequence::CachedDataSequence( const ::std::vector< Any > & rVector )
- : OPropertyContainer( GetBroadcastHelper()),
- CachedDataSequence_Base( GetMutex()),
- m_bIsHidden( true ),
- m_eCurrentDataType( MIXED ),
- m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder())
-{
- m_aMixedSequence = ContainerToSequence( rVector );
- registerProperties();
-}
-
CachedDataSequence::CachedDataSequence( const CachedDataSequence & rSource )
: OMutexAndBroadcastHelper(),
OPropertyContainer( GetBroadcastHelper()),
@@ -150,10 +112,8 @@ CachedDataSequence::CachedDataSequence( const CachedDataSequence & rSource )
CachedDataSequence_Base( GetMutex()),
m_nNumberFormatKey( rSource.m_nNumberFormatKey ),
m_sRole( rSource.m_sRole ),
- m_bIsHidden( rSource.m_bIsHidden ),
- m_aHiddenValues( rSource.m_aHiddenValues ),
m_eCurrentDataType( rSource.m_eCurrentDataType ),
- m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder())
+ m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder())
{
switch( m_eCurrentDataType )
{
@@ -187,18 +147,6 @@ void CachedDataSequence::registerProperties()
0, // PropertyAttributes
& m_sRole,
::getCppuType( & m_sRole ) );
-
- registerProperty( C2U( "IsHidden" ),
- PROP_HIDDEN,
- 0, // PropertyAttributes
- & m_bIsHidden,
- ::getCppuType( & m_bIsHidden ) );
-
- registerProperty( C2U( "HiddenValues" ),
- PROP_HIDDEN_VALUES,
- 0, // PropertyAttributes
- & m_aHiddenValues,
- ::getCppuType( & m_aHiddenValues ) );
}
Sequence< double > CachedDataSequence::Impl_getNumericalData() const
diff --git a/chart2/source/tools/CharacterProperties.cxx b/chart2/source/tools/CharacterProperties.cxx
index 937aec554215..e9893bae0a89 100644
--- a/chart2/source/tools/CharacterProperties.cxx
+++ b/chart2/source/tools/CharacterProperties.cxx
@@ -463,6 +463,13 @@ void CharacterProperties::AddPropertiesToVector(
::getCppuType( reinterpret_cast< const sal_Int16 * >(0)), /*com::sun::star::text::WritingMode2*/
beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::MAYBEDEFAULT ));
+
+ rOutProperties.push_back(
+ Property( C2U( "ParaIsCharacterDistance" ),
+ PROP_PARA_IS_CHARACTER_DISTANCE,
+ ::getBooleanCppuType(),
+ beans::PropertyAttribute::BOUND
+ | beans::PropertyAttribute::MAYBEDEFAULT ));
}
void CharacterProperties::AddDefaultsToMap(
@@ -541,6 +548,7 @@ void CharacterProperties::AddDefaultsToMap(
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_COMPLEX_FONT_PITCH, sal_Int16(aFontCTL.GetPitch()) );
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_WRITING_MODE, sal_Int16( com::sun::star::text::WritingMode2::PAGE ) );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_PARA_IS_CHARACTER_DISTANCE, sal_True );
}
bool CharacterProperties::IsCharacterPropertyHandle( sal_Int32 nHandle )
diff --git a/chart2/source/tools/ChartModelHelper.cxx b/chart2/source/tools/ChartModelHelper.cxx
index 4dcc452bf939..2d6ce7cbfd9d 100644
--- a/chart2/source/tools/ChartModelHelper.cxx
+++ b/chart2/source/tools/ChartModelHelper.cxx
@@ -33,6 +33,12 @@
#include "ChartModelHelper.hxx"
#include "macros.hxx"
#include "DiagramHelper.hxx"
+#include "DataSourceHelper.hxx"
+#include "ControllerLockGuard.hxx"
+#include "UndoManager.hxx"
+#include "RangeHighlighter.hxx"
+#include "InternalDataProvider.hxx"
+
#include <com/sun/star/chart2/data/XDataReceiver.hpp>
#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/chart2/XChartTypeContainer.hpp>
@@ -53,6 +59,39 @@ using namespace ::com::sun::star;
using namespace ::com::sun::star::chart2;
//static
+uno::Reference< chart2::XUndoManager > ChartModelHelper::createUndoManager()
+{
+ return new UndoManager();
+}
+
+//static
+uno::Reference< chart2::data::XRangeHighlighter > ChartModelHelper::createRangeHighlighter(
+ const uno::Reference< view::XSelectionSupplier > & xSelectionSupplier )
+{
+ return new RangeHighlighter( xSelectionSupplier );
+}
+
+//static
+uno::Reference< chart2::data::XDataProvider > ChartModelHelper::createInternalDataProvider()
+{
+ return new InternalDataProvider();
+}
+
+//static
+uno::Reference< chart2::data::XDataProvider > ChartModelHelper::createInternalDataProvider(
+ const uno::Reference< ::com::sun::star::chart::XChartDataArray >& xDataToCopy )
+{
+ return new InternalDataProvider( xDataToCopy );
+}
+
+//static
+uno::Reference< chart2::data::XDataProvider > ChartModelHelper::createInternalDataProvider(
+ const uno::Reference< ::com::sun::star::chart2::XChartDocument >& xChartDoc )
+{
+ return new InternalDataProvider( xChartDoc );
+}
+
+//static
uno::Reference< XDiagram > ChartModelHelper::findDiagram( const uno::Reference< frame::XModel >& xModel )
{
uno::Reference< XChartDocument > xChartDoc( xModel, uno::UNO_QUERY );
@@ -137,6 +176,96 @@ void ChartModelHelper::triggerRangeHighlighting( const uno::Reference< frame::XM
}
}
+bool ChartModelHelper::isIncludeHiddenCells( const uno::Reference< frame::XModel >& xChartModel )
+{
+ bool bIncluded = true; // hidden cells are included by default.
+
+ uno::Reference< chart2::XDiagram > xDiagram( ChartModelHelper::findDiagram(xChartModel) );
+ if (!xDiagram.is())
+ return bIncluded;
+
+ uno::Reference< beans::XPropertySet > xProp( xDiagram, uno::UNO_QUERY );
+ if (!xProp.is())
+ return bIncluded;
+
+ try
+ {
+ xProp->getPropertyValue(C2U("IncludeHiddenCells")) >>= bIncluded;
+ }
+ catch( const beans::UnknownPropertyException& )
+ {
+ }
+
+ return bIncluded;
+}
+
+bool ChartModelHelper::setIncludeHiddenCells( bool bIncludeHiddenCells, const uno::Reference< frame::XModel >& xChartModel )
+{
+ bool bChanged = false;
+ try
+ {
+ ControllerLockGuard aLockedControllers( xChartModel );
+
+ uno::Reference< beans::XPropertySet > xDiagramProperties( ChartModelHelper::findDiagram(xChartModel), uno::UNO_QUERY );
+ if (xDiagramProperties.is())
+ {
+ bool bOldValue = bIncludeHiddenCells;
+ xDiagramProperties->getPropertyValue( C2U("IncludeHiddenCells") ) >>= bOldValue;
+ if( bOldValue == bIncludeHiddenCells )
+ bChanged = true;
+
+ //set the property on all instances in all cases to get the different objects in sync!
+
+ uno::Any aNewValue = uno::makeAny(bIncludeHiddenCells);
+
+ try
+ {
+ uno::Reference< chart2::XChartDocument > xChartDoc( xChartModel, uno::UNO_QUERY );
+ if( xChartDoc.is() )
+ {
+ uno::Reference< beans::XPropertySet > xDataProviderProperties( xChartDoc->getDataProvider(), uno::UNO_QUERY );
+ if( xDataProviderProperties.is() )
+ xDataProviderProperties->setPropertyValue(C2U("IncludeHiddenCells"), aNewValue );
+ }
+ }
+ catch( const beans::UnknownPropertyException& )
+ {
+ //the property is optional!
+ }
+
+ try
+ {
+ uno::Reference< chart2::data::XDataSource > xUsedData( DataSourceHelper::getUsedData( xChartModel ) );
+ if( xUsedData.is() )
+ {
+ uno::Reference< beans::XPropertySet > xProp;
+ uno::Sequence< uno::Reference< chart2::data::XLabeledDataSequence > > aData( xUsedData->getDataSequences());
+ for( sal_Int32 i=0; i<aData.getLength(); ++i )
+ {
+ xProp.set( uno::Reference< beans::XPropertySet >( aData[i]->getValues(), uno::UNO_QUERY ) );
+ if(xProp.is())
+ xProp->setPropertyValue(C2U("IncludeHiddenCells"), aNewValue );
+ xProp.set( uno::Reference< beans::XPropertySet >( aData[i]->getLabel(), uno::UNO_QUERY ) );
+ if(xProp.is())
+ xProp->setPropertyValue(C2U("IncludeHiddenCells"), aNewValue );
+ }
+ }
+ }
+ catch( const beans::UnknownPropertyException& )
+ {
+ //the property is optional!
+ }
+
+ xDiagramProperties->setPropertyValue( C2U("IncludeHiddenCells"), aNewValue);
+ }
+ }
+ catch (uno::Exception& e)
+ {
+ ASSERT_EXCEPTION(e);
+ }
+ return bChanged;
+}
+
//.............................................................................
} //namespace chart
//.............................................................................
diff --git a/chart2/source/tools/CommonConverters.cxx b/chart2/source/tools/CommonConverters.cxx
index 787d79668ca3..692f6ee54a1b 100644
--- a/chart2/source/tools/CommonConverters.cxx
+++ b/chart2/source/tools/CommonConverters.cxx
@@ -155,15 +155,6 @@ drawing::Position3D B3DPointToPosition3D( const ::basegfx::B3DPoint& rPoint)
);
}
-::basegfx::B3DPoint Direction3DToB3DPoint( const drawing::Direction3D& rDirection)
-{
- return ::basegfx::B3DPoint(
- rDirection.DirectionX
- , rDirection.DirectionY
- , rDirection.DirectionZ
- );
-}
-
::basegfx::B3DVector Direction3DToB3DVector( const drawing::Direction3D& rDirection)
{
return ::basegfx::B3DVector(
@@ -173,39 +164,6 @@ drawing::Position3D B3DPointToPosition3D( const ::basegfx::B3DPoint& rPoint)
);
}
-drawing::PolyPolygonShape3D MakeLine3D(
- const drawing::Position3D & rStart,
- const drawing::Position3D & rEnd )
-{
- drawing::PolyPolygonShape3D aPP;
-
- aPP.SequenceX.realloc(1);
- aPP.SequenceY.realloc(1);
- aPP.SequenceZ.realloc(1);
-
- drawing::DoubleSequence* pOuterSequenceX = aPP.SequenceX.getArray();
- drawing::DoubleSequence* pOuterSequenceY = aPP.SequenceY.getArray();
- drawing::DoubleSequence* pOuterSequenceZ = aPP.SequenceZ.getArray();
-
- pOuterSequenceX->realloc(2);
- pOuterSequenceY->realloc(2);
- pOuterSequenceZ->realloc(2);
-
- double* pInnerSequenceX = pOuterSequenceX->getArray();
- double* pInnerSequenceY = pOuterSequenceY->getArray();
- double* pInnerSequenceZ = pOuterSequenceZ->getArray();
-
- *pInnerSequenceX++ = rStart.PositionX;
- *pInnerSequenceY++ = rStart.PositionY;
- *pInnerSequenceZ++ = rStart.PositionZ;
-
- *pInnerSequenceX++ = rEnd.PositionX;
- *pInnerSequenceY++ = rEnd.PositionY;
- *pInnerSequenceZ++ = rEnd.PositionZ;
-
- return aPP;
-}
-
void AddPointToPoly( drawing::PolyPolygonShape3D& rPoly, const drawing::Position3D& rPos, sal_Int32 nPolygonIndex )
{
if(nPolygonIndex<0)
@@ -298,110 +256,6 @@ void appendPoly( drawing::PolyPolygonShape3D& rRet, const drawing::PolyPolygonSh
}
}
-/*
-drawing::PolyPolygonShape3D operator+(
- const drawing::PolyPolygonShape3D& rPoly1
- , const drawing::PolyPolygonShape3D& rPoly2 )
-{
- drawing::PolyPolygonShape3D aRet;
-
- sal_Int32 nOuterCount = Max( rPoly1.SequenceX.getLength(), rPoly2.SequenceX.getLength() );
- aRet.SequenceX.realloc(nOuterCount);
- aRet.SequenceY.realloc(nOuterCount);
- aRet.SequenceZ.realloc(nOuterCount);
-
- for( sal_Int32 nOuter=0;nOuter<nOuterCount;nOuter++ )
- {
- sal_Int32 nPointCount_1 = 0;
- sal_Int32 nPointCount_2 = 0;
- if(nOuter<rPoly1.SequenceX.getLength())
- nPointCount_1 = rPoly1.SequenceX[nOuter].getLength();
- if(nOuter<rPoly2.SequenceX.getLength())
- nPointCount_2 = rPoly2.SequenceX[nOuter].getLength();
-
- sal_Int32 nPointCount = nPointCount_1 + nPointCount_2;
-
- aRet.SequenceX[nOuter].realloc(nPointCount);
- aRet.SequenceY[nOuter].realloc(nPointCount);
- aRet.SequenceZ[nOuter].realloc(nPointCount);
-
- sal_Int32 nPointTarget=0;
-
- {
- sal_Int32 nPointSourceCount = nPointCount_1;
- const drawing::PolyPolygonShape3D* pPoly = &rPoly1;
- for( sal_Int32 nPointSource=0; nPointSource<nPointSourceCount ; nPointSource++,nPointTarget++ )
- {
- aRet.SequenceX[nOuter][nPointTarget] = pPoly->SequenceX[nOuter][nPointSource];
- aRet.SequenceY[nOuter][nPointTarget] = pPoly->SequenceY[nOuter][nPointSource];
- aRet.SequenceZ[nOuter][nPointTarget] = pPoly->SequenceZ[nOuter][nPointSource];
- }
- }
- {
- sal_Int32 nPointSourceCount = nPointCount_2;
- const drawing::PolyPolygonShape3D* pPoly = &rPoly2;
- for( sal_Int32 nPointSource=nPointSourceCount; nPointSource-- ; nPointTarget++ )
- {
- aRet.SequenceX[nOuter][nPointTarget] = pPoly->SequenceX[nOuter][nPointSource];
- aRet.SequenceY[nOuter][nPointTarget] = pPoly->SequenceY[nOuter][nPointSource];
- aRet.SequenceZ[nOuter][nPointTarget] = pPoly->SequenceZ[nOuter][nPointSource];
- }
- }
- }
- return aRet;
-}
-*/
-/*
-drawing::PolyPolygonShape3D operator+(
- const drawing::PolyPolygonShape3D& rPoly1
- , const drawing::PolyPolygonShape3D& rPoly2 )
-{
- drawing::PolyPolygonShape3D aRet;
-
- sal_Int32 nOuterCount = rPoly1.SequenceX.getLength()+rPoly2.SequenceX.getLength();
- aRet.SequenceX.realloc(nOuterCount);
- aRet.SequenceY.realloc(nOuterCount);
- aRet.SequenceZ.realloc(nOuterCount);
-
- drawing::DoubleSequence* pOuterSequenceX = aRet.SequenceX.getArray();
- drawing::DoubleSequence* pOuterSequenceY = aRet.SequenceY.getArray();
- drawing::DoubleSequence* pOuterSequenceZ = aRet.SequenceZ.getArray();
-
- for( sal_Int32 nOuterTarget=0;nOuterTarget<nOuterCount;nOuterTarget++ )
- {
- const drawing::PolyPolygonShape3D* pPoly = &rPoly1;
- sal_Int32 nOuterSource = nOuterTarget;
- if(nOuterTarget>=rPoly1.SequenceX.getLength())
- {
- pPoly = &rPoly2;
- nOuterSource -= rPoly1.SequenceX.getLength();
- }
-
- sal_Int32 nPointCount = pPoly->SequenceX[nOuterSource].getLength();
-
- pOuterSequenceX->realloc(nPointCount);
- pOuterSequenceY->realloc(nPointCount);
- pOuterSequenceZ->realloc(nPointCount);
-
- double* pInnerSequenceX = pOuterSequenceX->getArray();
- double* pInnerSequenceY = pOuterSequenceY->getArray();
- double* pInnerSequenceZ = pOuterSequenceZ->getArray();
-
- for( sal_Int32 nPoint=0;nPoint<nPointCount;nPoint++ )
- {
- *pInnerSequenceX = pPoly->SequenceX[nOuterSource][nPoint];
- *pInnerSequenceY = pPoly->SequenceY[nOuterSource][nPoint];
- *pInnerSequenceZ = pPoly->SequenceZ[nOuterSource][nPoint];
-
- pInnerSequenceX++; pInnerSequenceY++; pInnerSequenceZ++;
- }
-
- pOuterSequenceX++; pOuterSequenceY++; pOuterSequenceZ++;
- }
- return aRet;
-}
-*/
-
drawing::PolyPolygonShape3D BezierToPoly(
const drawing::PolyPolygonBezierCoords& rBezier )
{
@@ -494,26 +348,6 @@ drawing::Position3D operator+( const drawing::Position3D& rPos
);
}
-drawing::Direction3D operator+( const drawing::Direction3D& rDirection
- , const drawing::Direction3D& rDirectionAdd)
-{
- return drawing::Direction3D(
- rDirection.DirectionX + rDirectionAdd.DirectionX
- , rDirection.DirectionY + rDirectionAdd.DirectionY
- , rDirection.DirectionZ + rDirectionAdd.DirectionZ
- );
-}
-
-drawing::Position3D operator-( const drawing::Position3D& rPos
- , const drawing::Direction3D& rDirection)
-{
- return drawing::Position3D(
- rPos.PositionX - rDirection.DirectionX
- , rPos.PositionY - rDirection.DirectionY
- , rPos.PositionZ - rDirection.DirectionZ
- );
-}
-
drawing::Direction3D operator-( const drawing::Position3D& rPos1
, const drawing::Position3D& rPos2)
{
@@ -524,16 +358,6 @@ drawing::Direction3D operator-( const drawing::Position3D& rPos1
);
}
-drawing::Direction3D operator*( const drawing::Direction3D& rDirection
- , double fFraction)
-{
- return drawing::Direction3D(
- fFraction*rDirection.DirectionX
- , fFraction*rDirection.DirectionY
- , fFraction*rDirection.DirectionZ
- );
-}
-
bool operator==( const drawing::Position3D& rPos1
, const drawing::Position3D& rPos2)
{
@@ -597,16 +421,6 @@ uno::Sequence< double > Position3DToSequence( const drawing::Position3D& rPositi
return aRet;
}
-drawing::Direction3D operator/( const drawing::Direction3D& rDirection, double f )
-{
- OSL_ENSURE(f,"a Direction3D is divided by NULL");
- return drawing::Direction3D(
- rDirection.DirectionX/f
- , rDirection.DirectionY/f
- , rDirection.DirectionZ/f
- );
-}
-
using namespace ::com::sun::star::chart2;
uno::Sequence< double > DataSequenceToDoubleSequence(
diff --git a/chart2/source/tools/ConfigColorScheme.cxx b/chart2/source/tools/ConfigColorScheme.cxx
index 7e418f04ab7b..835872aad8e4 100644
--- a/chart2/source/tools/ConfigColorScheme.cxx
+++ b/chart2/source/tools/ConfigColorScheme.cxx
@@ -56,6 +56,12 @@ static const OUString aSeriesPropName( RTL_CONSTASCII_USTRINGPARAM("Series"));
namespace chart
{
+
+uno::Reference< chart2::XColorScheme > createConfigColorScheme( const uno::Reference< uno::XComponentContext > & xContext )
+{
+ return new ConfigColorScheme( xContext );
+}
+
namespace impl
{
class ChartConfigItem : public ::utl::ConfigItem
diff --git a/chart2/source/tools/DataSeriesHelper.cxx b/chart2/source/tools/DataSeriesHelper.cxx
index 8c3431905699..61fecf18b5e7 100644
--- a/chart2/source/tools/DataSeriesHelper.cxx
+++ b/chart2/source/tools/DataSeriesHelper.cxx
@@ -644,5 +644,96 @@ bool areAllSeriesAttachedToSameAxis( const uno::Reference< chart2::XChartType >&
}
}
+namespace
+{
+
+bool lcl_SequenceHasUnhiddenData( const uno::Reference< chart2::data::XDataSequence >& xDataSequence )
+{
+ if( !xDataSequence.is() )
+ return false;
+ uno::Reference< beans::XPropertySet > xProp( xDataSequence, uno::UNO_QUERY );
+ if( xProp.is() )
+ {
+ uno::Sequence< sal_Int32 > aHiddenValues;
+ try
+ {
+ xProp->getPropertyValue( C2U( "HiddenValues" ) ) >>= aHiddenValues;
+ if( !aHiddenValues.getLength() )
+ return true;
+ }
+ catch( uno::Exception& e )
+ {
+ (void)e; // avoid warning
+ return true;
+ }
+ }
+ if( xDataSequence->getData().getLength() )
+ return true;
+ return false;
+}
+
+}
+
+bool hasUnhiddenData( const uno::Reference< chart2::XDataSeries >& xSeries )
+{
+ uno::Reference< chart2::data::XDataSource > xDataSource =
+ uno::Reference< chart2::data::XDataSource >( xSeries, uno::UNO_QUERY );
+
+ uno::Sequence< uno::Reference< chart2::data::XLabeledDataSequence > > aDataSequences = xDataSource->getDataSequences();
+
+ for(sal_Int32 nN = aDataSequences.getLength();nN--;)
+ {
+ if( !aDataSequences[nN].is() )
+ continue;
+ if( lcl_SequenceHasUnhiddenData( aDataSequences[nN]->getValues() ) )
+ return true;
+ if( lcl_SequenceHasUnhiddenData( aDataSequences[nN]->getLabel() ) )
+ return true;
+ }
+ return false;
+}
+
+struct lcl_LessIndex
+{
+ inline bool operator() ( const sal_Int32& first, const sal_Int32& second )
+ {
+ return ( first < second );
+ }
+};
+
+sal_Int32 translateIndexFromHiddenToFullSequence( sal_Int32 nIndex, const Reference< chart2::data::XDataSequence >& xDataSequence, bool bTranslate )
+{
+ if( !bTranslate )
+ return nIndex;
+
+ try
+ {
+ uno::Reference<beans::XPropertySet> xProp( xDataSequence, uno::UNO_QUERY );
+ if( xProp.is())
+ {
+ Sequence<sal_Int32> aHiddenIndicesSeq;
+ xProp->getPropertyValue( C2U("HiddenValues") ) >>= aHiddenIndicesSeq;
+ if( aHiddenIndicesSeq.getLength() )
+ {
+ ::std::vector< sal_Int32 > aHiddenIndices( ContainerHelper::SequenceToVector( aHiddenIndicesSeq ) );
+ ::std::sort( aHiddenIndices.begin(), aHiddenIndices.end(), lcl_LessIndex() );
+
+ sal_Int32 nHiddenCount = static_cast<sal_Int32>(aHiddenIndices.size());
+ for( sal_Int32 nN = 0; nN < nHiddenCount; ++nN)
+ {
+ if( aHiddenIndices[nN] <= nIndex )
+ nIndex += 1;
+ else
+ break;
+ }
+ }
+ }
+ }
+ catch (const beans::UnknownPropertyException&)
+ {
+ }
+ return nIndex;
+}
+
} // namespace DataSeriesHelper
} // namespace chart
diff --git a/chart2/source/tools/DataSourceHelper.cxx b/chart2/source/tools/DataSourceHelper.cxx
index 0de52f8a53ea..37c3a609ac9f 100644
--- a/chart2/source/tools/DataSourceHelper.cxx
+++ b/chart2/source/tools/DataSourceHelper.cxx
@@ -40,6 +40,8 @@
#include "ContainerHelper.hxx"
#include "ControllerLockGuard.hxx"
#include "PropertyHelper.hxx"
+#include "CachedDataSequence.hxx"
+#include "LabeledDataSequence.hxx"
#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/chart2/data/XDataSource.hpp>
@@ -117,6 +119,41 @@ void lcl_addErrorBarRanges(
} // anonymous namespace
+Reference< chart2::data::XDataSource > DataSourceHelper::createDataSource(
+ const Sequence< Reference< chart2::data::XLabeledDataSequence > >& rSequences )
+{
+ return new DataSource(rSequences);
+}
+
+Reference< chart2::data::XDataSequence > DataSourceHelper::createCachedDataSequence()
+{
+ return new ::chart::CachedDataSequence();
+}
+
+Reference< chart2::data::XDataSequence > DataSourceHelper::createCachedDataSequence( const ::rtl::OUString& rSingleText )
+{
+ return new ::chart::CachedDataSequence( rSingleText );
+}
+
+Reference< chart2::data::XLabeledDataSequence > DataSourceHelper::createLabeledDataSequence(
+ const Reference< chart2::data::XDataSequence >& xValues ,
+ const Reference< chart2::data::XDataSequence >& xLabels )
+{
+ return new ::chart::LabeledDataSequence( xValues, xLabels );
+}
+
+Reference< chart2::data::XLabeledDataSequence > DataSourceHelper::createLabeledDataSequence(
+ const Reference< chart2::data::XDataSequence >& xValues )
+{
+ return new ::chart::LabeledDataSequence( xValues );
+}
+
+Reference< chart2::data::XLabeledDataSequence > DataSourceHelper::createLabeledDataSequence(
+ const Reference< uno::XComponentContext >& xContext )
+{
+ return new ::chart::LabeledDataSequence( xContext );
+}
+
uno::Sequence< beans::PropertyValue > DataSourceHelper::createArguments(
bool bUseColumns, bool bFirstCellAsLabel, bool bHasCategories )
{
diff --git a/chart2/source/tools/ErrorBar.cxx b/chart2/source/tools/ErrorBar.cxx
index 6a704dbc54d8..a1b8b7c02106 100644
--- a/chart2/source/tools/ErrorBar.cxx
+++ b/chart2/source/tools/ErrorBar.cxx
@@ -166,11 +166,16 @@ bool lcl_isInternalData( const uno::Reference< chart2::data::XLabeledDataSequenc
namespace chart
{
+uno::Reference< beans::XPropertySet > createErrorBar( const uno::Reference< uno::XComponentContext > & xContext )
+{
+ return new ErrorBar( xContext );
+}
+
ErrorBar::ErrorBar(
uno::Reference< uno::XComponentContext > const & xContext ) :
::property::OPropertySet( m_aMutex ),
m_xContext( xContext ),
- m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder())
+ m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder())
{}
ErrorBar::ErrorBar( const ErrorBar & rOther ) :
@@ -178,7 +183,7 @@ ErrorBar::ErrorBar( const ErrorBar & rOther ) :
impl::ErrorBar_Base(),
::property::OPropertySet( rOther, m_aMutex ),
m_xContext( rOther.m_xContext ),
- m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder())
+ m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder())
{
if( ! rOther.m_aDataSequences.empty())
{
diff --git a/chart2/source/tools/ImplUndoManager.cxx b/chart2/source/tools/ImplUndoManager.cxx
index d5eab1b4b652..91d5f869bc53 100644
--- a/chart2/source/tools/ImplUndoManager.cxx
+++ b/chart2/source/tools/ImplUndoManager.cxx
@@ -37,6 +37,7 @@
#include "ControllerLockGuard.hxx"
#include "PropertyHelper.hxx"
#include "DataSourceHelper.hxx"
+#include "ChartModelHelper.hxx"
#include <com/sun/star/chart/XChartDataArray.hpp>
#include <com/sun/star/chart2/XChartDocument.hpp>
@@ -170,6 +171,9 @@ void UndoElement::applyModelContentToModel(
Reference< chart2::XChartDocument > xSource( xModelToCopyFrom, uno::UNO_QUERY_THROW );
Reference< chart2::XChartDocument > xDestination( xInOutModelToChange, uno::UNO_QUERY_THROW );
+ // propagate the correct flag for plotting of hidden values to the data provider and all used sequences
+ ChartModelHelper::setIncludeHiddenCells( ChartModelHelper::isIncludeHiddenCells( xModelToCopyFrom ) , xInOutModelToChange );
+
// diagram
xDestination->setFirstDiagram( xSource->getFirstDiagram());
diff --git a/chart2/source/tools/InternalDataProvider.cxx b/chart2/source/tools/InternalDataProvider.cxx
index 3257821e521f..880cd5c72984 100644
--- a/chart2/source/tools/InternalDataProvider.cxx
+++ b/chart2/source/tools/InternalDataProvider.cxx
@@ -138,13 +138,6 @@ public:
void setColumnLabels( const ::std::vector< OUString > & rNewColumnLabels );
::std::vector< OUString > getColumnLabels() const;
- /** returns whether the data source was created by putting sequence contents
- into columns (true) or rows (false)
- */
- bool setDataByDataSource(
- const Reference< chart2::data::XDataSource > & xDataSource,
- const Sequence< beans::PropertyValue > & rArgs );
-
#if OSL_DEBUG_LEVEL > 2
void traceData() const;
#endif
@@ -628,49 +621,6 @@ void InternalData::setColumnLabels( const ::std::vector< OUString > & rNewColumn
return m_aColumnLabels;
}
-bool InternalData::setDataByDataSource(
- const Reference< chart2::data::XDataSource > & xDataSource,
- const Sequence< beans::PropertyValue > & rArgs )
-{
- OUString aRangeRepresentation;
- uno::Sequence< sal_Int32 > aSequenceMapping; //yyyy todo...? InternalData::setDataByDataSource
- bool bUseColumns = true;
- bool bFirstCellAsLabel = true;
- bool bHasCategories = true;
-
- DataSourceHelper::readArguments( rArgs, aRangeRepresentation, aSequenceMapping, bUseColumns, bFirstCellAsLabel, bHasCategories );
-
- typedef ::std::vector< Reference< chart2::data::XLabeledDataSequence > > tLSeqCntType;
- tLSeqCntType aLSeqVec( ContainerHelper::SequenceToVector( xDataSource->getDataSequences()));
- tLSeqCntType::const_iterator aIt( aLSeqVec.begin());
- const tLSeqCntType::const_iterator aEndIt( aLSeqVec.end());
-
- if( bHasCategories && aIt != aEndIt )
- {
- if( bUseColumns )
- setRowLabels( ContainerHelper::SequenceToVector(
- DataSequenceToStringSequence( (*aIt)->getValues() )));
- else
- setColumnLabels( ContainerHelper::SequenceToVector(
- DataSequenceToStringSequence( (*aIt)->getValues() )));
- ++aIt;
- }
-
- ::std::vector< Sequence< double > > aDataVec;
- ::std::vector< OUString > aLabelVec;
- transform( aIt, aEndIt, back_inserter( aDataVec ), lcl_ValuesOfLabeledSequence());
- transform( aIt, aEndIt, back_inserter( aLabelVec ), lcl_LabelOfLabeledSequence());
-
- setData( ContainerHelper::ContainerToSequence( aDataVec ), bUseColumns );
-
- if( bUseColumns )
- setColumnLabels( aLabelVec );
- else
- setRowLabels( aLabelVec );
-
- return bUseColumns;
-}
-
#if OSL_DEBUG_LEVEL > 2
void InternalData::traceData() const
{
@@ -1049,8 +999,9 @@ Reference< chart2::data::XDataSource > SAL_CALL InternalDataProvider::createData
impl::InternalData & rData( getInternalData());
// categories
- aResultLSeqVec.push_back(
- new LabeledDataSequence( createDataSequenceAndAddToMap( lcl_aCategoriesRangeName, lcl_aCategoriesRoleName )));
+ if ( bHasCategories )
+ aResultLSeqVec.push_back(
+ new LabeledDataSequence( createDataSequenceAndAddToMap( lcl_aCategoriesRangeName, lcl_aCategoriesRoleName )));
// data with labels
::std::vector< Reference< chart2::data::XLabeledDataSequence > > aDataVec;
diff --git a/chart2/source/tools/LabeledDataSequence.cxx b/chart2/source/tools/LabeledDataSequence.cxx
index 83c3a1e5a059..bb0ec7053497 100644
--- a/chart2/source/tools/LabeledDataSequence.cxx
+++ b/chart2/source/tools/LabeledDataSequence.cxx
@@ -46,13 +46,13 @@ namespace chart
LabeledDataSequence::LabeledDataSequence( const Reference< uno::XComponentContext > & xContext ) :
m_xContext( xContext ),
- m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder())
+ m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder())
{}
LabeledDataSequence::LabeledDataSequence(
const uno::Reference< chart2::data::XDataSequence > & rValues ) :
m_xData( rValues ),
- m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder())
+ m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder())
{
ModifyListenerHelper::addListener( m_xData, m_xModifyEventForwarder );
}
@@ -62,7 +62,7 @@ LabeledDataSequence::LabeledDataSequence(
const uno::Reference< chart2::data::XDataSequence > & rLabel ) :
m_xData( rValues ),
m_xLabel( rLabel ),
- m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder())
+ m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder())
{
ModifyListenerHelper::addListener( m_xData, m_xModifyEventForwarder );
ModifyListenerHelper::addListener( m_xLabel, m_xModifyEventForwarder );
diff --git a/chart2/source/tools/ModifyListenerHelper.cxx b/chart2/source/tools/ModifyListenerHelper.cxx
index 42943d192c0f..722ecb82e155 100644
--- a/chart2/source/tools/ModifyListenerHelper.cxx
+++ b/chart2/source/tools/ModifyListenerHelper.cxx
@@ -106,6 +106,11 @@ namespace chart
namespace ModifyListenerHelper
{
+uno::Reference< util::XModifyListener > createModifyEventForwarder()
+{
+ return new ModifyEventForwarder();
+}
+
ModifyEventForwarder::ModifyEventForwarder() :
::cppu::WeakComponentImplHelper2<
::com::sun::star::util::XModifyBroadcaster,
@@ -114,11 +119,6 @@ ModifyEventForwarder::ModifyEventForwarder() :
{
}
-void ModifyEventForwarder::FireEvent( const Reference< uno::XWeak > & xSource )
-{
- lcl_fireModifyEvent( m_aModifyListeners, xSource, 0 );
-}
-
void ModifyEventForwarder::FireEvent( const lang::EventObject & rEvent )
{
lcl_fireModifyEvent( m_aModifyListeners, Reference< uno::XWeak >(), & rEvent );
diff --git a/chart2/source/tools/NameContainer.cxx b/chart2/source/tools/NameContainer.cxx
index 3fefe3a920df..815f72257490 100644
--- a/chart2/source/tools/NameContainer.cxx
+++ b/chart2/source/tools/NameContainer.cxx
@@ -50,6 +50,12 @@ namespace chart
{
//.............................................................................
+uno::Reference< container::XNameContainer > createNameContainer(
+ const ::com::sun::star::uno::Type& rType, const rtl::OUString& rServicename, const rtl::OUString& rImplementationName )
+{
+ return new NameContainer( rType, rServicename, rImplementationName );
+}
+
NameContainer::NameContainer( const ::com::sun::star::uno::Type& rType, const OUString& rServicename, const OUString& rImplementationName )
: m_aType( rType )
, m_aServicename( rServicename )
diff --git a/chart2/source/tools/OPropertySet.cxx b/chart2/source/tools/OPropertySet.cxx
index d3988bb93671..4ba7f99edcc1 100644
--- a/chart2/source/tools/OPropertySet.cxx
+++ b/chart2/source/tools/OPropertySet.cxx
@@ -63,7 +63,8 @@ OPropertySet::OPropertySet( ::osl::Mutex & par_rMutex ) :
// the following causes a warning; there seems to be no way to avoid it
OPropertySetHelper( static_cast< OBroadcastHelper & >( *this )),
m_rMutex( par_rMutex ),
- m_pImplProperties( new impl::ImplOPropertySet() )
+ m_pImplProperties( new impl::ImplOPropertySet() ),
+ m_bSetNewValuesExplicitlyEvenIfTheyEqualDefault(false)
{
}
@@ -71,7 +72,8 @@ OPropertySet::OPropertySet( const OPropertySet & rOther, ::osl::Mutex & par_rMut
OBroadcastHelper( par_rMutex ),
// the following causes a warning; there seems to be no way to avoid it
OPropertySetHelper( static_cast< OBroadcastHelper & >( *this )),
- m_rMutex( par_rMutex )
+ m_rMutex( par_rMutex ),
+ m_bSetNewValuesExplicitlyEvenIfTheyEqualDefault(false)
{
// /--
MutexGuard aGuard( m_rMutex );
@@ -80,6 +82,11 @@ OPropertySet::OPropertySet( const OPropertySet & rOther, ::osl::Mutex & par_rMut
// \--
}
+void OPropertySet::SetNewValuesExplicitlyEvenIfTheyEqualDefault()
+{
+ m_bSetNewValuesExplicitlyEvenIfTheyEqualDefault = true;
+}
+
OPropertySet::~OPropertySet()
{}
@@ -322,6 +329,8 @@ sal_Bool SAL_CALL OPropertySet::convertFastPropertyValue
}
}
rConvertedValue = rValue;
+ if( !m_bSetNewValuesExplicitlyEvenIfTheyEqualDefault && rOldValue == rConvertedValue )
+ return sal_False;//no change necessary
return sal_True;
}
@@ -341,7 +350,20 @@ void SAL_CALL OPropertySet::setFastPropertyValue_NoBroadcast
}
#endif
+ Any aDefault;
+ try
+ {
+ aDefault = GetDefaultValue( nHandle );
+ }
+ catch( beans::UnknownPropertyException ex )
+ {
+ aDefault.clear();
+ }
m_pImplProperties->SetPropertyValueByHandle( nHandle, rValue );
+ if( !m_bSetNewValuesExplicitlyEvenIfTheyEqualDefault && aDefault.hasValue() && aDefault == rValue ) //#i98893# don't export defaults to file
+ m_pImplProperties->SetPropertyToDefault( nHandle );
+ else
+ m_pImplProperties->SetPropertyValueByHandle( nHandle, rValue );
}
void SAL_CALL OPropertySet::getFastPropertyValue
diff --git a/chart2/source/tools/ObjectIdentifier.cxx b/chart2/source/tools/ObjectIdentifier.cxx
index 57c8ef01d5d6..07f8d16efffd 100644
--- a/chart2/source/tools/ObjectIdentifier.cxx
+++ b/chart2/source/tools/ObjectIdentifier.cxx
@@ -439,14 +439,6 @@ OUString ObjectIdentifier::createParticleForGrid(
return aRet.makeStringAndClear();
}
-OUString ObjectIdentifier::createClassifiedIdentifierForAxis(
- const Reference< XAxis >& xAxis
- , const Reference< frame::XModel >& xChartModel )
-{
- rtl::OUString aAxisCID( createClassifiedIdentifierForObject( xAxis,xChartModel ) );
- return aAxisCID;
-}
-
//static
OUString ObjectIdentifier::createClassifiedIdentifierForGrid(
const Reference< XAxis >& xAxis
diff --git a/chart2/source/tools/RangeHighlighter.cxx b/chart2/source/tools/RangeHighlighter.cxx
index 4049cc20b447..2ea3b515f027 100644
--- a/chart2/source/tools/RangeHighlighter.cxx
+++ b/chart2/source/tools/RangeHighlighter.cxx
@@ -38,6 +38,7 @@
#include "ContainerHelper.hxx"
#include "macros.hxx"
#include "ObjectIdentifier.hxx"
+#include "DataSeriesHelper.hxx"
#include <com/sun/star/chart2/XDataSeries.hpp>
#include <com/sun/star/chart/ErrorBarStyle.hpp>
@@ -79,7 +80,8 @@ RangeHighlighter::RangeHighlighter(
const Reference< view::XSelectionSupplier > & xSelectionSupplier ) :
impl::RangeHighlighter_Base( m_aMutex ),
m_xSelectionSupplier( xSelectionSupplier ),
- m_nAddedListenerCount( 0 )
+ m_nAddedListenerCount( 0 ),
+ m_bIncludeHiddenCells(true)
{
}
@@ -105,6 +107,8 @@ void RangeHighlighter::determineRanges()
if( xController.is())
xChartModel.set( xController->getModel());
+ m_bIncludeHiddenCells = ChartModelHelper::isIncludeHiddenCells( xChartModel );
+
uno::Any aSelection( m_xSelectionSupplier->getSelection());
const uno::Type& rType = aSelection.getValueType();
@@ -287,11 +291,13 @@ void RangeHighlighter::fillRangesForDataPoint( const Reference< uno::XInterface
-1,
nPreferredColor,
sal_False ));
+
+ sal_Int32 nUnhiddenIndex = DataSeriesHelper::translateIndexFromHiddenToFullSequence( nIndex, xValues, !m_bIncludeHiddenCells );
if( xValues.is())
aHilightedRanges.push_back(
chart2::data::HighlightedRange(
xValues->getSourceRangeRepresentation(),
- nIndex,
+ nUnhiddenIndex,
nPreferredColor,
sal_False ));
}
diff --git a/chart2/source/tools/ReferenceSizeProvider.cxx b/chart2/source/tools/ReferenceSizeProvider.cxx
index 93ba4b43cfc3..ddddc7d71ee4 100644
--- a/chart2/source/tools/ReferenceSizeProvider.cxx
+++ b/chart2/source/tools/ReferenceSizeProvider.cxx
@@ -226,32 +226,18 @@ void ReferenceSizeProvider::getAutoResizeFromPropSet(
}
}
-void ReferenceSizeProvider::getAutoResizeFromTitle(
- const Reference< XTitle > & xTitle,
- ReferenceSizeProvider::AutoResizeState & rInOutState )
-{
- Reference< beans::XPropertySet > xProp( xTitle, uno::UNO_QUERY );
- if( xProp.is())
- getAutoResizeFromPropSet( xProp, rInOutState );
-}
-
void ReferenceSizeProvider::impl_getAutoResizeFromTitled(
const Reference< XTitled > & xTitled,
ReferenceSizeProvider::AutoResizeState & rInOutState )
{
if( xTitled.is())
{
- Reference< XTitle > xTitle( xTitled->getTitleObject());
- if( xTitle.is())
- getAutoResizeFromTitle( xTitle, rInOutState );
+ Reference< beans::XPropertySet > xProp( xTitled->getTitleObject(), uno::UNO_QUERY );
+ if( xProp.is())
+ getAutoResizeFromPropSet( xProp, rInOutState );
}
}
-ReferenceSizeProvider::AutoResizeState ReferenceSizeProvider::getAutoResizeState() const
-{
- return getAutoResizeState( m_xChartDoc );
-}
-
/** Retrieves the state auto-resize from all objects that support this
feature. If all objects return the same state, AUTO_RESIZE_YES or
AUTO_RESIZE_NO is returned.
diff --git a/chart2/source/tools/RegressionCurveModel.cxx b/chart2/source/tools/RegressionCurveModel.cxx
index 377f087315ae..dea90a312845 100644
--- a/chart2/source/tools/RegressionCurveModel.cxx
+++ b/chart2/source/tools/RegressionCurveModel.cxx
@@ -109,7 +109,7 @@ RegressionCurveModel::RegressionCurveModel(
::property::OPropertySet( m_aMutex ),
m_xContext( xContext ),
m_eRegressionCurveType( eCurveType ),
- m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder()),
+ m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder()),
m_xEquationProperties( new RegressionEquation( xContext ))
{
// set 0 line width (default) hard, so that it is always written to XML,
@@ -125,7 +125,7 @@ RegressionCurveModel::RegressionCurveModel( const RegressionCurveModel & rOther
::property::OPropertySet( rOther, m_aMutex ),
m_xContext( rOther.m_xContext ),
m_eRegressionCurveType( rOther.m_eRegressionCurveType ),
- m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder())
+ m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder())
{
m_xEquationProperties.set( CloneHelper::CreateRefClone< uno::Reference< beans::XPropertySet > >()( rOther.m_xEquationProperties ));
ModifyListenerHelper::addListener( m_xEquationProperties, m_xModifyEventForwarder );
diff --git a/chart2/source/tools/StatisticsHelper.cxx b/chart2/source/tools/StatisticsHelper.cxx
index 83f9cde5f783..f820fb78c89e 100644
--- a/chart2/source/tools/StatisticsHelper.cxx
+++ b/chart2/source/tools/StatisticsHelper.cxx
@@ -337,7 +337,7 @@ Reference< beans::XPropertySet > StatisticsHelper::addErrorBars(
if( !( xSeriesProp->getPropertyValue( aPropName ) >>= xErrorBar ) ||
!xErrorBar.is())
{
- xErrorBar.set( new ErrorBar( xContext ));
+ xErrorBar.set( createErrorBar( xContext ));
}
OSL_ASSERT( xErrorBar.is());
diff --git a/chart2/source/tools/TitleHelper.cxx b/chart2/source/tools/TitleHelper.cxx
index 24e55ccfc90e..43006920951a 100644
--- a/chart2/source/tools/TitleHelper.cxx
+++ b/chart2/source/tools/TitleHelper.cxx
@@ -191,7 +191,7 @@ uno::Reference< XTitle > TitleHelper::createTitle(
switch( eTitleType )
{
case TitleHelper::SUB_TITLE:
- chart::TitleHelper::setCompleteString(
+ TitleHelper::setCompleteString(
rTitleText, xTitle, xContext, & fDefaultCharHeightSub );
break;
case TitleHelper::X_AXIS_TITLE:
@@ -201,11 +201,11 @@ uno::Reference< XTitle > TitleHelper::createTitle(
case TitleHelper::TITLE_AT_STANDARD_Y_AXIS_POSITION:
case TitleHelper::SECONDARY_X_AXIS_TITLE:
case TitleHelper::SECONDARY_Y_AXIS_TITLE:
- chart::TitleHelper::setCompleteString(
+ TitleHelper::setCompleteString(
rTitleText, xTitle, xContext, & fDefaultCharHeightAxis );
break;
default:
- chart::TitleHelper::setCompleteString( rTitleText, xTitle, xContext );
+ TitleHelper::setCompleteString( rTitleText, xTitle, xContext );
break;
}
diff --git a/chart2/source/tools/UncachedDataSequence.cxx b/chart2/source/tools/UncachedDataSequence.cxx
index 9f265bd364ba..53a1f1d93c68 100644
--- a/chart2/source/tools/UncachedDataSequence.cxx
+++ b/chart2/source/tools/UncachedDataSequence.cxx
@@ -63,8 +63,6 @@ enum
// PROP_SOURCE_IDENTIFIER,
PROP_NUMBERFORMAT_KEY,
PROP_PROPOSED_ROLE,
- PROP_HIDDEN,
- PROP_HIDDEN_VALUES,
PROP_XML_RANGE
};
} // anonymous namespace
@@ -79,10 +77,10 @@ UncachedDataSequence::UncachedDataSequence(
const OUString & rRangeRepresentation )
: OPropertyContainer( GetBroadcastHelper()),
UncachedDataSequence_Base( GetMutex()),
- m_bIsHidden( true ),
+ m_nNumberFormatKey(0),
m_xDataProvider( xIntDataProv ),
m_aSourceRepresentation( rRangeRepresentation ),
- m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder())
+ m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder())
{
registerProperties();
}
@@ -93,10 +91,10 @@ UncachedDataSequence::UncachedDataSequence(
const OUString & rRole )
: OPropertyContainer( GetBroadcastHelper()),
UncachedDataSequence_Base( GetMutex()),
- m_bIsHidden( true ),
+ m_nNumberFormatKey(0),
m_xDataProvider( xIntDataProv ),
m_aSourceRepresentation( rRangeRepresentation ),
- m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder())
+ m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder())
{
registerProperties();
setFastPropertyValue_NoBroadcast( PROP_PROPOSED_ROLE, uno::makeAny( rRole ));
@@ -109,11 +107,9 @@ UncachedDataSequence::UncachedDataSequence( const UncachedDataSequence & rSource
UncachedDataSequence_Base( GetMutex()),
m_nNumberFormatKey( rSource.m_nNumberFormatKey ),
m_sRole( rSource.m_sRole ),
- m_bIsHidden( rSource.m_bIsHidden ),
- m_aHiddenValues( rSource.m_aHiddenValues ),
m_xDataProvider( rSource.m_xDataProvider ),
m_aSourceRepresentation( rSource.m_aSourceRepresentation ),
- m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder())
+ m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder())
{
registerProperties();
}
@@ -135,18 +131,6 @@ void UncachedDataSequence::registerProperties()
& m_sRole,
::getCppuType( & m_sRole ) );
- registerProperty( C2U( "IsHidden" ),
- PROP_HIDDEN,
- 0, // PropertyAttributes
- & m_bIsHidden,
- ::getCppuType( & m_bIsHidden ) );
-
- registerProperty( C2U( "HiddenValues" ),
- PROP_HIDDEN_VALUES,
- 0, // PropertyAttributes
- & m_aHiddenValues,
- ::getCppuType( & m_aHiddenValues ) );
-
registerProperty( C2U( "CachedXMLRange" ),
PROP_XML_RANGE,
0, // PropertyAttributes
@@ -266,7 +250,7 @@ Sequence< OUString > SAL_CALL UncachedDataSequence::generateLabel( chart2::data:
throw (lang::IndexOutOfBoundsException,
uno::RuntimeException)
{
- return 0;
+ return m_nNumberFormatKey;
}
// ____ XIndexReplace ____