main/chart2/source/tools/ReferenceSizeProvider.cxx
/** sets the auto-resize at all objects that support this feature for text.
    eNewState must be either AUTO_RESIZE_YES or AUTO_RESIZE_NO
*/
sets the auto-resize at all objects that support this feature for text.
sets the auto - resize at all objects that support this feature for text .
void ReferenceSizeProvider::setAutoResizeState( ReferenceSizeProvider::AutoResizeState eNewState )
{
    m_bUseAutoScale = (eNewState == AUTO_RESIZE_YES);
    impl_setValuesAtTitled( Reference< XTitled >( m_xChartDoc, uno::UNO_QUERY ));
    Reference< XDiagram > xDiagram( ChartModelHelper::findDiagram( m_xChartDoc ), uno::UNO_QUERY );
    if( ! xDiagram.is())
        return;
    impl_setValuesAtTitled( Reference< XTitled >( xDiagram, uno::UNO_QUERY ));
    Reference< beans::XPropertySet > xLegendProp( xDiagram->getLegend(), uno::UNO_QUERY );
    if( xLegendProp.is())
        setValuesAtPropertySet( xLegendProp );
    Sequence< Reference< XAxis > > aAxes( AxisHelper::getAllAxesOfDiagram( xDiagram ) );
    for( sal_Int32 i=0; i<aAxes.getLength(); ++i )
    {
        Reference< beans::XPropertySet > xProp( aAxes[i], uno::UNO_QUERY );
        if( xProp.is())
            setValuesAtPropertySet( xProp );
        impl_setValuesAtTitled( Reference< XTitled >( aAxes[i], uno::UNO_QUERY ));
    }
    setValuesAtAllDataSeries();
    m_bUseAutoScale = (getAutoResizeState( m_xChartDoc ) == AUTO_RESIZE_YES);
}
void ReferenceSizeProvider :: setAutoResizeState ( ReferenceSizeProvider :: AutoResizeState eNewState ) { m_bUseAutoScale = ( eNewState == AUTO_RESIZE_YES ) ; impl_setValuesAtTitled ( Reference < XTitled > ( m_xChartDoc , uno :: UNO_QUERY ) ) ; Reference < XDiagram > xDiagram ( ChartModelHelper :: findDiagram ( m_xChartDoc ) , uno :: UNO_QUERY ) ; if ( ! xDiagram . is ( ) ) return ; impl_setValuesAtTitled ( Reference < XTitled > ( xDiagram , uno :: UNO_QUERY ) ) ; Reference < beans :: XPropertySet > xLegendProp ( xDiagram -> getLegend ( ) , uno :: UNO_QUERY ) ; if ( xLegendProp . is ( ) ) setValuesAtPropertySet ( xLegendProp ) ; Sequence < Reference < XAxis > > aAxes ( AxisHelper :: getAllAxesOfDiagram ( xDiagram ) ) ; for ( sal_Int32 i = 0 ; i < aAxes . getLength ( ) ; ++ i ) { Reference < beans :: XPropertySet > xProp ( aAxes [ i ] , uno :: UNO_QUERY ) ; if ( xProp . is ( ) ) setValuesAtPropertySet ( xProp ) ; impl_setValuesAtTitled ( Reference < XTitled > ( aAxes [ i ] , uno :: UNO_QUERY ) ) ; } setValuesAtAllDataSeries ( ) ; m_bUseAutoScale = ( getAutoResizeState ( m_xChartDoc ) == AUTO_RESIZE_YES ) ; }
sets the auto-resize at all objects that support this feature for text.
sets the auto - resize at all objects that support this feature for text .
// Main Title // diagram is needed by the rest of the objects // Sub Title // Legend // Axes (incl. Axis Titles) // DataSeries/Points // recalculate new state (in case it stays unknown or is ambiguous