summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@suse.cz>2011-03-23 16:58:51 +0100
committerJan Holesovsky <kendy@suse.cz>2011-03-23 16:58:51 +0100
commitacfdc69e78cc1d93a2b6d65ea9cd44a709e84bad (patch)
treeaebfe3cfaaff0f6f0b92674293a0809a711e6dab /chart2
parenta0872eae81c09edcadc3ceac0f96e2be82340d82 (diff)
parentd3bd824556722068e2893dd96821554ccbb1d662 (diff)
Merge commit 'ooo/DEV300_m103'
Conflicts: sc/source/filter/starcalc/scflt.cxx sc/source/ui/unoobj/chart2uno.cxx
Diffstat (limited to 'chart2')
-rw-r--r--chart2/source/controller/itemsetwrapper/CharacterPropertyItemConverter.cxx67
-rw-r--r--chart2/source/controller/main/ChartController_Position.cxx11
-rw-r--r--chart2/source/controller/main/ChartController_Window.cxx9
-rw-r--r--chart2/source/inc/CharacterProperties.hxx3
-rw-r--r--chart2/source/inc/ExponentialRegressionCurveCalculator.hxx7
-rw-r--r--[-rwxr-xr-x]chart2/source/model/main/Diagram.cxx1
-rw-r--r--[-rwxr-xr-x]chart2/source/tools/CharacterProperties.cxx25
-rw-r--r--chart2/source/tools/ExponentialRegressionCurveCalculator.cxx77
-rw-r--r--chart2/source/view/axes/ScaleAutomatism.cxx28
-rwxr-xr-xchart2/source/view/charttypes/VSeriesPlotter.cxx16
-rw-r--r--chart2/source/view/main/ChartView.cxx7
-rw-r--r--chart2/source/view/main/PropertyMapper.cxx3
-rwxr-xr-x[-rw-r--r--]chart2/source/view/main/VLegend.cxx4
13 files changed, 204 insertions, 54 deletions
diff --git a/chart2/source/controller/itemsetwrapper/CharacterPropertyItemConverter.cxx b/chart2/source/controller/itemsetwrapper/CharacterPropertyItemConverter.cxx
index d047a6ac03b6..4597499f7032 100644
--- a/chart2/source/controller/itemsetwrapper/CharacterPropertyItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/CharacterPropertyItemConverter.cxx
@@ -185,6 +185,40 @@ void CharacterPropertyItemConverter::FillSpecialItem(
}
break;
+ case EE_CHAR_OVERLINE:
+ {
+ SvxOverlineItem aItem( UNDERLINE_NONE, EE_CHAR_OVERLINE );
+ bool bModified = false;
+
+ uno::Any aValue( GetPropertySet()->getPropertyValue( C2U( "CharOverline" ) ) );
+ if ( aValue.hasValue() )
+ {
+ aItem.PutValue( aValue, MID_TL_STYLE );
+ bModified = true;
+ }
+
+ aValue = GetPropertySet()->getPropertyValue( C2U( "CharOverlineHasColor" ) );
+ if ( aValue.hasValue() &&
+ ( *reinterpret_cast< const sal_Bool* >( aValue.getValue() ) != sal_False ) )
+ {
+ aItem.PutValue( aValue, MID_TL_HASCOLOR );
+ bModified = true;
+ }
+
+ aValue = GetPropertySet()->getPropertyValue( C2U( "CharOverlineColor" ) );
+ if ( aValue.hasValue() )
+ {
+ aItem.PutValue( aValue, MID_TL_COLOR );
+ bModified = true;
+ }
+
+ if ( bModified )
+ {
+ rOutItemSet.Put( aItem );
+ }
+ }
+ break;
+
case EE_CHAR_ITALIC:
case EE_CHAR_ITALIC_CJK:
case EE_CHAR_ITALIC_CTL:
@@ -389,6 +423,39 @@ bool CharacterPropertyItemConverter::ApplySpecialItem(
}
break;
+ case EE_CHAR_OVERLINE:
+ {
+ const SvxOverlineItem& rItem = static_cast< const SvxOverlineItem & >( rItemSet.Get( nWhichId ) );
+
+ if ( rItem.QueryValue( aValue, MID_TL_STYLE ) )
+ {
+ if ( aValue != GetPropertySet()->getPropertyValue( C2U( "CharOverline" ) ) )
+ {
+ GetPropertySet()->setPropertyValue( C2U( "CharOverline" ), aValue );
+ bChanged = true;
+ }
+ }
+
+ if ( rItem.QueryValue( aValue, MID_TL_COLOR ) )
+ {
+ if ( aValue != GetPropertySet()->getPropertyValue( C2U( "CharOverlineColor" ) ) )
+ {
+ GetPropertySet()->setPropertyValue( C2U( "CharOverlineColor" ), aValue );
+ bChanged = true;
+ }
+ }
+
+ if ( rItem.QueryValue( aValue, MID_TL_HASCOLOR ) )
+ {
+ if ( aValue != GetPropertySet()->getPropertyValue( C2U( "CharOverlineHasColor" ) ) )
+ {
+ GetPropertySet()->setPropertyValue( C2U( "CharOverlineHasColor" ), aValue );
+ bChanged = true;
+ }
+ }
+ }
+ break;
+
case EE_CHAR_ITALIC:
case EE_CHAR_ITALIC_CJK:
case EE_CHAR_ITALIC_CTL:
diff --git a/chart2/source/controller/main/ChartController_Position.cxx b/chart2/source/controller/main/ChartController_Position.cxx
index ffbaf72d8677..52b337ec93d6 100644
--- a/chart2/source/controller/main/ChartController_Position.cxx
+++ b/chart2/source/controller/main/ChartController_Position.cxx
@@ -63,7 +63,7 @@ using namespace ::com::sun::star::chart2;
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-void lcl_getPositionAndSizeFromItemSet( const SfxItemSet& rItemSet, Rectangle& rPosAndSize, const awt::Size aOriginalSize )
+void lcl_getPositionAndSizeFromItemSet( const SfxItemSet& rItemSet, awt::Rectangle& rPosAndSize, const awt::Size aOriginalSize )
{
long nPosX(0);
long nPosY(0);
@@ -122,7 +122,7 @@ void lcl_getPositionAndSizeFromItemSet( const SfxItemSet& rItemSet, Rectangle& r
break;
}
- rPosAndSize = Rectangle(Point(nPosX,nPosY),Size(nSizX,nSizY));
+ rPosAndSize = awt::Rectangle(nPosX,nPosY,nSizX,nSizY);
}
void SAL_CALL ChartController::executeDispatch_PositionAndSize()
@@ -167,19 +167,18 @@ void SAL_CALL ChartController::executeDispatch_PositionAndSize()
const SfxItemSet* pOutItemSet = pDlg->GetOutputItemSet();
if(pOutItemSet)
{
- Rectangle aObjectRect;
+ awt::Rectangle aObjectRect;
aItemSet.Put(*pOutItemSet);//overwrite old values with new values (-> all items are set)
lcl_getPositionAndSizeFromItemSet( aItemSet, aObjectRect, aSelectedSize );
awt::Size aPageSize( ChartModelHelper::getPageSize( getModel() ) );
- Rectangle aPageRect( 0,0,aPageSize.Width,aPageSize.Height );
+ awt::Rectangle aPageRect( 0,0,aPageSize.Width,aPageSize.Height );
bool bChanged = false;
if ( eObjectType == OBJECTTYPE_LEGEND )
bChanged = DiagramHelper::switchDiagramPositioningToExcludingPositioning( getModel(), false , true );
bool bMoved = PositionAndSizeHelper::moveObject( m_aSelection.getSelectedCID(), getModel()
- , awt::Rectangle(aObjectRect.getX(),aObjectRect.getY(),aObjectRect.getWidth(),aObjectRect.getHeight())
- , awt::Rectangle(aPageRect.getX(),aPageRect.getY(),aPageRect.getWidth(),aPageRect.getHeight()) );
+ , aObjectRect, aPageRect );
if( bMoved || bChanged )
aUndoGuard.commit();
}
diff --git a/chart2/source/controller/main/ChartController_Window.cxx b/chart2/source/controller/main/ChartController_Window.cxx
index a39a2c1f54c7..668cadcb1cd0 100644
--- a/chart2/source/controller/main/ChartController_Window.cxx
+++ b/chart2/source/controller/main/ChartController_Window.cxx
@@ -1658,7 +1658,16 @@ bool ChartController::requestQuickHelp(
if ( bSuccess )
{
+ SolarMutexGuard aGuard;
+ if ( m_pDrawViewWrapper && m_pDrawViewWrapper->IsTextEdit() )
+ {
+ this->EndTextEdit();
+ }
this->impl_selectObjectAndNotiy();
+ if ( m_pChartWindow )
+ {
+ m_pChartWindow->Invalidate();
+ }
return sal_True;
}
diff --git a/chart2/source/inc/CharacterProperties.hxx b/chart2/source/inc/CharacterProperties.hxx
index 14310ed6c252..2a9dae5bd0ca 100644
--- a/chart2/source/inc/CharacterProperties.hxx
+++ b/chart2/source/inc/CharacterProperties.hxx
@@ -64,6 +64,9 @@ public:
PROP_CHAR_UNDERLINE,
PROP_CHAR_UNDERLINE_COLOR,
PROP_CHAR_UNDERLINE_HAS_COLOR,
+ PROP_CHAR_OVERLINE,
+ PROP_CHAR_OVERLINE_COLOR,
+ PROP_CHAR_OVERLINE_HAS_COLOR,
PROP_CHAR_WEIGHT,
PROP_CHAR_POSTURE,
PROP_CHAR_AUTO_KERNING,
diff --git a/chart2/source/inc/ExponentialRegressionCurveCalculator.hxx b/chart2/source/inc/ExponentialRegressionCurveCalculator.hxx
index 456de82cb375..27a16e2b2664 100644
--- a/chart2/source/inc/ExponentialRegressionCurveCalculator.hxx
+++ b/chart2/source/inc/ExponentialRegressionCurveCalculator.hxx
@@ -64,9 +64,10 @@ private:
throw (::com::sun::star::lang::IllegalArgumentException,
::com::sun::star::uno::RuntimeException);
- // formula is: f(x) = m_fSlope ^ x + m_fIntercept
- double m_fSlope;
- double m_fIntercept;
+ // formula is: f(x) = exp(m_fLogIntercept) * exp( m_fLogSlope * x )
+ // mathematical model f(x) = Intercept * Slope^x
+ double m_fLogSlope;
+ double m_fLogIntercept;
};
} // namespace chart
diff --git a/chart2/source/model/main/Diagram.cxx b/chart2/source/model/main/Diagram.cxx
index e1df573402d6..e8d2b1cdc4b9 100755..100644
--- a/chart2/source/model/main/Diagram.cxx
+++ b/chart2/source/model/main/Diagram.cxx
@@ -197,6 +197,7 @@ private:
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DIAGRAM_INCLUDE_HIDDEN_CELLS, true );
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DIAGRAM_RIGHT_ANGLED_AXES, false );
::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_DIAGRAM_STARTING_ANGLE, 90 );
+ ::chart::SceneProperties::AddDefaultsToMap( rOutMap );
}
};
diff --git a/chart2/source/tools/CharacterProperties.cxx b/chart2/source/tools/CharacterProperties.cxx
index aae087fce910..a0d519862829 100755..100644
--- a/chart2/source/tools/CharacterProperties.cxx
+++ b/chart2/source/tools/CharacterProperties.cxx
@@ -149,6 +149,28 @@ void CharacterProperties::AddPropertiesToVector(
::getBooleanCppuType(),
beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::MAYBEDEFAULT ));
+ // CharOverline (see awt.FontUnderline)
+ rOutProperties.push_back(
+ Property( C2U( "CharOverline" ),
+ PROP_CHAR_OVERLINE,
+ ::getCppuType( reinterpret_cast< const sal_Int16* >( 0 ) ),
+ beans::PropertyAttribute::BOUND
+ | beans::PropertyAttribute::MAYBEDEFAULT ) );
+ // CharOverlineColor
+ rOutProperties.push_back(
+ Property( C2U( "CharOverlineColor" ),
+ PROP_CHAR_OVERLINE_COLOR,
+ ::getCppuType( reinterpret_cast< const sal_Int32* >( 0 ) ),
+ beans::PropertyAttribute::BOUND
+ | beans::PropertyAttribute::MAYBEDEFAULT
+ | beans::PropertyAttribute::MAYBEVOID ) );
+ // CharOverlineHasColor
+ rOutProperties.push_back(
+ Property( C2U( "CharOverlineHasColor" ),
+ PROP_CHAR_OVERLINE_HAS_COLOR,
+ ::getBooleanCppuType(),
+ beans::PropertyAttribute::BOUND
+ | beans::PropertyAttribute::MAYBEDEFAULT ) );
// CharWeight (see awt.FontWeight)
rOutProperties.push_back(
Property( C2U( "CharWeight" ),
@@ -416,6 +438,9 @@ void CharacterProperties::AddDefaultsToMap(
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_UNDERLINE, awt::FontUnderline::NONE );
::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_CHAR_UNDERLINE_COLOR, -1 ); //automatic color (COL_AUTO)
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_UNDERLINE_HAS_COLOR, false );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_OVERLINE, awt::FontUnderline::NONE );
+ ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_CHAR_OVERLINE_COLOR, -1 ); //automatic color (COL_AUTO)
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_OVERLINE_HAS_COLOR, false );
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_WEIGHT, awt::FontWeight::NORMAL );
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_POSTURE, awt::FontSlant_NONE );
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_AUTO_KERNING, true );
diff --git a/chart2/source/tools/ExponentialRegressionCurveCalculator.cxx b/chart2/source/tools/ExponentialRegressionCurveCalculator.cxx
index fd97cfda7615..3bb08f27b1bd 100644
--- a/chart2/source/tools/ExponentialRegressionCurveCalculator.cxx
+++ b/chart2/source/tools/ExponentialRegressionCurveCalculator.cxx
@@ -44,11 +44,11 @@ namespace chart
{
ExponentialRegressionCurveCalculator::ExponentialRegressionCurveCalculator() :
- m_fSlope( 0.0 ),
- m_fIntercept( 0.0 )
+ m_fLogSlope( 0.0 ),
+ m_fLogIntercept( 0.0 )
{
- ::rtl::math::setNan( & m_fSlope );
- ::rtl::math::setNan( & m_fIntercept );
+ ::rtl::math::setNan( & m_fLogSlope );
+ ::rtl::math::setNan( & m_fLogIntercept );
}
ExponentialRegressionCurveCalculator::~ExponentialRegressionCurveCalculator()
@@ -68,9 +68,9 @@ void SAL_CALL ExponentialRegressionCurveCalculator::recalculateRegression(
const size_t nMax = aValues.first.size();
if( nMax == 0 )
{
- ::rtl::math::setNan( & m_fSlope );
- ::rtl::math::setNan( & m_fIntercept );
- ::rtl::math::setNan( & m_fCorrelationCoeffitient );
+ ::rtl::math::setNan( & m_fLogSlope );
+ ::rtl::math::setNan( & m_fLogIntercept );
+ ::rtl::math::setNan( & m_fCorrelationCoeffitient );// actual it is coefficient of determination
return;
}
@@ -97,12 +97,10 @@ void SAL_CALL ExponentialRegressionCurveCalculator::recalculateRegression(
fQxy += fDeltaX * fDeltaY;
}
- m_fSlope = fQxy / fQx;
- m_fIntercept = fAverageY - m_fSlope * fAverageX;
+ m_fLogSlope = fQxy / fQx;
+ m_fLogIntercept = fAverageY - m_fLogSlope * fAverageX;
m_fCorrelationCoeffitient = fQxy / sqrt( fQx * fQy );
- m_fSlope = exp( m_fSlope );
- m_fIntercept = exp( m_fIntercept );
}
double SAL_CALL ExponentialRegressionCurveCalculator::getCurveValue( double x )
@@ -112,10 +110,10 @@ double SAL_CALL ExponentialRegressionCurveCalculator::getCurveValue( double x )
double fResult;
::rtl::math::setNan( & fResult );
- if( ! ( ::rtl::math::isNan( m_fSlope ) ||
- ::rtl::math::isNan( m_fIntercept )))
+ if( ! ( ::rtl::math::isNan( m_fLogSlope ) ||
+ ::rtl::math::isNan( m_fLogIntercept )))
{
- fResult = m_fIntercept * pow( m_fSlope, x );
+ fResult = exp(m_fLogIntercept + x * m_fLogSlope);
}
return fResult;
@@ -151,31 +149,48 @@ OUString ExponentialRegressionCurveCalculator::ImplGetRepresentation(
const uno::Reference< util::XNumberFormatter >& xNumFormatter,
::sal_Int32 nNumberFormatKey ) const
{
+ double fIntercept = exp(m_fLogIntercept);
+ double fSlope = exp(m_fLogSlope);
+ bool bHasSlope = !rtl::math::approxEqual( fSlope, 1.0 );
+ bool bHasIntercept = !rtl::math::approxEqual( fIntercept, 1.0 );
+
OUStringBuffer aBuf( C2U( "f(x) = " ));
- if( m_fIntercept == 0.0 ||
- m_fSlope == 0.0 )
- {
- aBuf.append( sal_Unicode( '0' ));
- }
- else if( rtl::math::approxEqual( m_fSlope, 1.0 ) )
+ if ( fIntercept == 0.0)
{
- aBuf.append( getFormattedString( xNumFormatter, nNumberFormatKey, m_fIntercept ));
+ // underflow, a true zero is impossible
+ aBuf.append( C2U( "exp( " ));
+ aBuf.append( getFormattedString( xNumFormatter, nNumberFormatKey, m_fLogIntercept) );
+ aBuf.append( (m_fLogSlope < 0.0) ? C2U( " - " ) : C2U( " + " ));
+ aBuf.append( getFormattedString( xNumFormatter, nNumberFormatKey, fabs(m_fLogSlope)) );
+ aBuf.append( C2U( " x )" ));
}
else
{
- if( ! rtl::math::approxEqual( m_fIntercept, 1.0 ) )
+ if (bHasIntercept)
{
- aBuf.append( getFormattedString( xNumFormatter, nNumberFormatKey, m_fIntercept ));
- aBuf.append( sal_Unicode( 0x00b7 ));
+ aBuf.append( getFormattedString( xNumFormatter, nNumberFormatKey, fIntercept) );
+ aBuf.append( C2U( " exp( " ));
+ aBuf.append( getFormattedString( xNumFormatter, nNumberFormatKey, m_fLogSlope) );
+ aBuf.append( C2U( " x )" ));
+ }
+ else
+ {
+ // show logarithmic output, if intercept and slope both are near one
+ // otherwise drop output of intercept, which is 1 here
+ aBuf.append( C2U( " exp( " ));
+ if (!bHasSlope)
+ {
+ aBuf.append( getFormattedString( xNumFormatter, nNumberFormatKey, m_fLogIntercept) );
+ aBuf.append( (m_fLogSlope < 0.0) ? C2U( " - " ) : C2U( " + " ));
+ aBuf.append( getFormattedString( xNumFormatter, nNumberFormatKey, fabs(m_fLogSlope)) );
+ }
+ else
+ {
+ aBuf.append( getFormattedString( xNumFormatter, nNumberFormatKey, m_fLogSlope) );
+ }
+ aBuf.append( C2U( " x )" ));
}
-
- if( m_fSlope < 0.0 )
- aBuf.append( sal_Unicode( '(' ));
- aBuf.append( getFormattedString( xNumFormatter, nNumberFormatKey, m_fSlope ));
- if( m_fSlope < 0.0 )
- aBuf.append( sal_Unicode( ')' ));
- aBuf.appendAscii( RTL_CONSTASCII_STRINGPARAM( "^x" ));
}
return aBuf.makeStringAndClear();
diff --git a/chart2/source/view/axes/ScaleAutomatism.cxx b/chart2/source/view/axes/ScaleAutomatism.cxx
index dcd987a0bbc3..c188fec09a0c 100644
--- a/chart2/source/view/axes/ScaleAutomatism.cxx
+++ b/chart2/source/view/axes/ScaleAutomatism.cxx
@@ -50,9 +50,16 @@ using ::com::sun::star::chart::TimeUnit::MONTH;
using ::com::sun::star::chart::TimeUnit::YEAR;
const sal_Int32 MAXIMUM_MANUAL_INCREMENT_COUNT = 500;
-const sal_Int32 MAXIMUM_AUTO_INCREMENT_COUNT = 10;
const sal_Int32 MAXIMUM_SUB_INCREMENT_COUNT = 100;
+sal_Int32 lcl_getMaximumAutoIncrementCount( sal_Int32 nAxisType )
+{
+ sal_Int32 nMaximumAutoIncrementCount = 10;
+ if( nAxisType==AxisType::DATE )
+ nMaximumAutoIncrementCount = MAXIMUM_MANUAL_INCREMENT_COUNT;
+ return nMaximumAutoIncrementCount;
+}
+
namespace
{
@@ -103,7 +110,7 @@ ScaleAutomatism::ScaleAutomatism( const ScaleData& rSourceScale, const Date& rNu
: m_aSourceScale( rSourceScale )
, m_fValueMinimum( 0.0 )
, m_fValueMaximum( 0.0 )
- , m_nMaximumAutoMainIncrementCount( MAXIMUM_AUTO_INCREMENT_COUNT )
+ , m_nMaximumAutoMainIncrementCount( lcl_getMaximumAutoIncrementCount( rSourceScale.AxisType ) )
, m_bExpandBorderToIncrementRhythm( false )
, m_bExpandIfValuesCloseToBorder( false )
, m_bExpandWideValuesToZero( false )
@@ -150,8 +157,8 @@ void ScaleAutomatism::setMaximumAutoMainIncrementCount( sal_Int32 nMaximumAutoMa
{
if( nMaximumAutoMainIncrementCount < 2 )
m_nMaximumAutoMainIncrementCount = 2; //#i82006
- else if( nMaximumAutoMainIncrementCount > MAXIMUM_AUTO_INCREMENT_COUNT )
- m_nMaximumAutoMainIncrementCount = MAXIMUM_AUTO_INCREMENT_COUNT;
+ else if( nMaximumAutoMainIncrementCount > lcl_getMaximumAutoIncrementCount( m_aSourceScale.AxisType ) )
+ m_nMaximumAutoMainIncrementCount = lcl_getMaximumAutoIncrementCount( m_aSourceScale.AxisType );
else
m_nMaximumAutoMainIncrementCount = nMaximumAutoMainIncrementCount;
}
@@ -693,6 +700,19 @@ void ScaleAutomatism::calculateExplicitIncrementAndScaleForDateTimeAxis(
nNumer = static_cast<sal_Int32>( rtl::math::approxCeil( nIntervalDays/nDaysPerInterval ) );
if(nNumer<=0)
nNumer=1;
+ if( rExplicitIncrement.MajorTimeInterval.TimeUnit == DAY )
+ {
+ if( nNumer>2 && nNumer<7 )
+ nNumer=7;
+ else if( nNumer>7 )
+ {
+ rExplicitIncrement.MajorTimeInterval.TimeUnit = MONTH;
+ nDaysPerInterval = 31.0;
+ nNumer = static_cast<sal_Int32>( rtl::math::approxCeil( nIntervalDays/nDaysPerInterval ) );
+ if(nNumer<=0)
+ nNumer=1;
+ }
+ }
rExplicitIncrement.MajorTimeInterval.Number = nNumer;
nMainIncrementCount = nDayCount/(nNumer*nDaysPerInterval);
}
diff --git a/chart2/source/view/charttypes/VSeriesPlotter.cxx b/chart2/source/view/charttypes/VSeriesPlotter.cxx
index 1b8783de2549..69138fe0c550 100755
--- a/chart2/source/view/charttypes/VSeriesPlotter.cxx
+++ b/chart2/source/view/charttypes/VSeriesPlotter.cxx
@@ -1139,9 +1139,19 @@ void VSeriesPlotter::createRegressionCurveEquationShapes(
if( xTextShape.is())
{
ShapeFactory::setShapeName( xTextShape, rEquationCID );
- xTextShape->setPosition(
- RelativePositionHelper::getUpperLeftCornerOfAnchoredObject(
- aScreenPosition2D, xTextShape->getSize(), aRelativePosition.Anchor ));
+ awt::Size aSize( xTextShape->getSize() );
+ awt::Point aPos( RelativePositionHelper::getUpperLeftCornerOfAnchoredObject(
+ aScreenPosition2D, aSize, aRelativePosition.Anchor ) );
+ //ensure that the equation is fully placed within the page (if possible)
+ if( (aPos.X + aSize.Width) > m_aPageReferenceSize.Width )
+ aPos.X = m_aPageReferenceSize.Width - aSize.Width;
+ if( aPos.X < 0 )
+ aPos.X = 0;
+ if( (aPos.Y + aSize.Height) > m_aPageReferenceSize.Height )
+ aPos.Y = m_aPageReferenceSize.Height - aSize.Height;
+ if( aPos.Y < 0 )
+ aPos.Y = 0;
+ xTextShape->setPosition(aPos);
}
}
}
diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx
index e54a7ab59f66..9200f6974149 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -2164,12 +2164,9 @@ std::auto_ptr<VTitle> lcl_createTitle( TitleHelper::eTitleType eType
}
uno::Reference< XTitle > xTitle( TitleHelper::getTitle( eType, xChartModel ) );
- if(xTitle.is())
+ rtl::OUString aCompleteString( TitleHelper::getCompleteString( xTitle ) );
+ if( aCompleteString.getLength() != 0 )
{
- rtl::OUString aCompleteString( TitleHelper::getCompleteString( xTitle ) );
- if ( aCompleteString.getLength() == 0 )
- return apVTitle;//don't create empty titles as the resulting diagram position is wrong then
-
//create title
apVTitle = std::auto_ptr<VTitle>(new VTitle(xTitle));
rtl::OUString aCID( ObjectIdentifier::createClassifiedIdentifierForObject( xTitle, xChartModel ) );
diff --git a/chart2/source/view/main/PropertyMapper.cxx b/chart2/source/view/main/PropertyMapper.cxx
index 99b1ec8a2f21..9e9e987ae0b5 100644
--- a/chart2/source/view/main/PropertyMapper.cxx
+++ b/chart2/source/view/main/PropertyMapper.cxx
@@ -214,6 +214,9 @@ const tMakePropertyNameMap& PropertyMapper::getPropertyNameMapForCharacterProper
( C2U( "CharUnderline" ), C2U("CharUnderline") )
( C2U( "CharUnderlineColor" ), C2U("CharUnderlineColor") )
( C2U( "CharUnderlineHasColor" ), C2U("CharUnderlineHasColor") )
+ ( C2U( "CharOverline" ), C2U("CharOverline") )
+ ( C2U( "CharOverlineColor" ), C2U("CharOverlineColor") )
+ ( C2U( "CharOverlineHasColor" ), C2U("CharOverlineHasColor") )
( C2U( "CharWeight" ), C2U("CharWeight") )
( C2U( "CharWeightAsian" ), C2U("CharWeightAsian") )
( C2U( "CharWeightComplex" ), C2U("CharWeightComplex") )
diff --git a/chart2/source/view/main/VLegend.cxx b/chart2/source/view/main/VLegend.cxx
index e0f2bdc17713..e67099fdc326 100644..100755
--- a/chart2/source/view/main/VLegend.cxx
+++ b/chart2/source/view/main/VLegend.cxx
@@ -898,8 +898,8 @@ void VLegend::createShapes(
RelativeSize aRelativeSize;
if ((xLegendProp->getPropertyValue( C2U( "RelativeSize" )) >>= aRelativeSize))
{
- aLegendSize.Width = aRelativeSize.Primary * rPageSize.Width;
- aLegendSize.Height = aRelativeSize.Secondary * rPageSize.Height;
+ aLegendSize.Width = ::rtl::math::approxCeil( aRelativeSize.Primary * rPageSize.Width );
+ aLegendSize.Height = ::rtl::math::approxCeil( aRelativeSize.Secondary * rPageSize.Height );
}
else
eExpansion = ::com::sun::star::chart::ChartLegendExpansion_HIGH;