[Libreoffice-commits] .: 3 commits - chart2/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Thu Sep 20 14:51:56 PDT 2012
chart2/source/view/main/ChartView.cxx | 39 +++++++++-------------------------
chart2/source/view/main/ChartView.hxx | 34 +++++++++++------------------
2 files changed, 24 insertions(+), 49 deletions(-)
New commits:
commit f188ca44d8a7f7567ea76a3fd635c0fa6fcf4c4b
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Thu Sep 20 17:39:46 2012 -0400
std::auto_ptr is deprecated.
For this usage, boost::shared_ptr is probably an appropriate replacement.
Change-Id: I89bea80d330f362e60af4ce66a23316d0029e0d8
diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx
index f1be106..763994e 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -105,10 +105,9 @@
#include <rtl/strbuf.hxx>
#include <rtl/ustring.hxx>
-//.............................................................................
-namespace chart
-{
-//.............................................................................
+#include <boost/shared_ptr.hpp>
+
+namespace chart {
using namespace ::com::sun::star;
using namespace ::com::sun::star::chart2;
@@ -2122,8 +2121,7 @@ void changePositionOfAxisTitle( VTitle* pVTitle, TitleAlignment eAlignment
pVTitle->changePosition( aNewPosition );
}
-SAL_WNODEPRECATED_DECLARATIONS_PUSH
-std::auto_ptr<VTitle> lcl_createTitle( TitleHelper::eTitleType eType
+boost::shared_ptr<VTitle> lcl_createTitle( TitleHelper::eTitleType eType
, const uno::Reference< drawing::XShapes>& xPageShapes
, const uno::Reference< lang::XMultiServiceFactory>& xShapeFactory
, const uno::Reference< frame::XModel >& xChartModel
@@ -2132,7 +2130,7 @@ std::auto_ptr<VTitle> lcl_createTitle( TitleHelper::eTitleType eType
, TitleAlignment eAlignment
, bool& rbAutoPosition )
{
- std::auto_ptr<VTitle> apVTitle;
+ boost::shared_ptr<VTitle> apVTitle;
// #i109336# Improve auto positioning in chart
double fPercentage = lcl_getPageLayoutDistancePercentage();
@@ -2159,7 +2157,7 @@ std::auto_ptr<VTitle> lcl_createTitle( TitleHelper::eTitleType eType
if( !aCompleteString.isEmpty() )
{
//create title
- apVTitle = std::auto_ptr<VTitle>(new VTitle(xTitle));
+ apVTitle.reset(new VTitle(xTitle));
rtl::OUString aCID( ObjectIdentifier::createClassifiedIdentifierForObject( xTitle, xChartModel ) );
apVTitle->init(xPageShapes,xShapeFactory,aCID);
apVTitle->createShapes( awt::Point(0,0), rPageSize );
@@ -2265,7 +2263,6 @@ std::auto_ptr<VTitle> lcl_createTitle( TitleHelper::eTitleType eType
}
return apVTitle;
}
-SAL_WNODEPRECATED_DECLARATIONS_POP
bool lcl_createLegend( const uno::Reference< XLegend > & xLegend
, const uno::Reference< drawing::XShapes>& xPageShapes
@@ -2504,9 +2501,7 @@ void ChartView::createShapes()
//------------ create x axis title
bool bAutoPosition_XTitle = true;
- SAL_WNODEPRECATED_DECLARATIONS_PUSH
- std::auto_ptr<VTitle> apVTitle_X;
- SAL_WNODEPRECATED_DECLARATIONS_POP
+ boost::shared_ptr<VTitle> apVTitle_X;
if( ChartTypeHelper::isSupportingMainAxis( xChartType, nDimension, 0 ) )
apVTitle_X = lcl_createTitle( TitleHelper::TITLE_AT_STANDARD_X_AXIS_POSITION, xPageShapes, m_xShapeFactory, m_xChartModel
, aRemainingSpace, aPageSize, ALIGN_BOTTOM, bAutoPosition_XTitle );
@@ -2515,9 +2510,7 @@ void ChartView::createShapes()
//------------ create y axis title
bool bAutoPosition_YTitle = true;
- SAL_WNODEPRECATED_DECLARATIONS_PUSH
- std::auto_ptr<VTitle> apVTitle_Y;
- SAL_WNODEPRECATED_DECLARATIONS_POP
+ boost::shared_ptr<VTitle> apVTitle_Y;
if( ChartTypeHelper::isSupportingMainAxis( xChartType, nDimension, 1 ) )
apVTitle_Y = lcl_createTitle( TitleHelper::TITLE_AT_STANDARD_Y_AXIS_POSITION, xPageShapes, m_xShapeFactory, m_xChartModel
, aRemainingSpace, aPageSize, ALIGN_LEFT, bAutoPosition_YTitle );
@@ -2526,9 +2519,7 @@ void ChartView::createShapes()
//------------ create z axis title
bool bAutoPosition_ZTitle = true;
- SAL_WNODEPRECATED_DECLARATIONS_PUSH
- std::auto_ptr<VTitle> apVTitle_Z;
- SAL_WNODEPRECATED_DECLARATIONS_POP
+ boost::shared_ptr<VTitle> apVTitle_Z;
if( ChartTypeHelper::isSupportingMainAxis( xChartType, nDimension, 2 ) )
apVTitle_Z = lcl_createTitle( TitleHelper::Z_AXIS_TITLE, xPageShapes, m_xShapeFactory, m_xChartModel
, aRemainingSpace, aPageSize, ALIGN_RIGHT, bAutoPosition_ZTitle );
@@ -2540,9 +2531,7 @@ void ChartView::createShapes()
//------------ create secondary x axis title
bool bAutoPosition_SecondXTitle = true;
- SAL_WNODEPRECATED_DECLARATIONS_PUSH
- std::auto_ptr<VTitle> apVTitle_SecondX;
- SAL_WNODEPRECATED_DECLARATIONS_POP
+ boost::shared_ptr<VTitle> apVTitle_SecondX;
if( ChartTypeHelper::isSupportingSecondaryAxis( xChartType, nDimension, 0 ) )
apVTitle_SecondX = lcl_createTitle( TitleHelper::SECONDARY_X_AXIS_TITLE, xPageShapes, m_xShapeFactory, m_xChartModel
, aRemainingSpace, aPageSize, bIsVertical? ALIGN_RIGHT : ALIGN_TOP, bAutoPosition_SecondXTitle );
@@ -2551,9 +2540,7 @@ void ChartView::createShapes()
//------------ create secondary y axis title
bool bAutoPosition_SecondYTitle = true;
- SAL_WNODEPRECATED_DECLARATIONS_PUSH
- std::auto_ptr<VTitle> apVTitle_SecondY;
- SAL_WNODEPRECATED_DECLARATIONS_POP
+ boost::shared_ptr<VTitle> apVTitle_SecondY;
if( ChartTypeHelper::isSupportingSecondaryAxis( xChartType, nDimension, 1 ) )
apVTitle_SecondY = lcl_createTitle( TitleHelper::SECONDARY_Y_AXIS_TITLE, xPageShapes, m_xShapeFactory, m_xChartModel
, aRemainingSpace, aPageSize, bIsVertical? ALIGN_TOP : ALIGN_RIGHT, bAutoPosition_SecondYTitle );
commit 526c2b3c01162dddadd09a63f45759306cfb12ba
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Thu Sep 20 17:30:30 2012 -0400
Unused local variable.
Change-Id: I67fea6c4749b2c69868132bacd761e90933ed84b
diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx
index 86a6e56..f1be106 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -2473,10 +2473,6 @@ void ChartView::createShapes()
uno::Reference< drawing::XShapes > xDiagramPlusAxes_Shapes( ShapeFactory(m_xShapeFactory).createGroup2D(xDiagramPlusAxesPlusMarkHandlesGroup_Shapes ) );
- //------------ create some titles
- SAL_WNODEPRECATED_DECLARATIONS_PUSH
- std::auto_ptr<VTitle> apVTitle(0);
- SAL_WNODEPRECATED_DECLARATIONS_POP
bool bAutoPositionDummy = true;
//------------ create main title shape
commit 707bedff4fee68dfe2ac38ca7b36244ce09af2b7
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Thu Sep 20 17:28:42 2012 -0400
More cosmetic cleanups.
Change-Id: I78a461609bc85cff3cc44dcdf993b16c0a1e37b1
diff --git a/chart2/source/view/main/ChartView.hxx b/chart2/source/view/main/ChartView.hxx
index 904c509..5b58d5d 100644
--- a/chart2/source/view/main/ChartView.hxx
+++ b/chart2/source/view/main/ChartView.hxx
@@ -45,32 +45,26 @@
class SdrPage;
-//.............................................................................
-namespace chart
-{
-//.............................................................................
+namespace chart {
class VCoordinateSystem;
class DrawModelWrapper;
class SeriesPlotterContainer;
-//-----------------------------------------------------------------------------
-/** The ChartView is responsible to manage the generation of Drawing Objects
-for visualization on a given OutputDevice. The ChartModel is responsible to notify changes to the view.
-The view than changes to state dirty. The view can be updated with call 'update'.
-
-The View is not responsible to handle single user events (that is instead done by the ChartWindow).
-*/
-
+/**
+ * The ChartView is responsible to manage the generation of Drawing Objects
+ * for visualization on a given OutputDevice. The ChartModel is responsible
+ * to notify changes to the view. The view than changes to state dirty. The
+ * view can be updated with call 'update'.
+ *
+ * The View is not responsible to handle single user events (that is instead
+ * done by the ChartWindow).
+ */
class ChartView : public ::cppu::WeakImplHelper10<
::com::sun::star::lang::XInitialization
- , ::com::sun::star::lang::XServiceInfo
- , ::com::sun::star::datatransfer::XTransferable
+ ,::com::sun::star::lang::XServiceInfo
+ ,::com::sun::star::datatransfer::XTransferable
,::com::sun::star::lang::XUnoTunnel
- //::com::sun::star::lang::XComponent ???
- //::com::sun::star::uno::XWeak // implemented by WeakImplHelper(optional interface)
- //::com::sun::star::uno::XInterface // implemented by WeakImplHelper(optional interface)
- //::com::sun::star::lang::XTypeProvider // implemented by WeakImplHelper
,::com::sun::star::util::XModifyListener
,::com::sun::star::util::XModeChangeBroadcaster
,::com::sun::star::util::XUpdatable
@@ -252,9 +246,7 @@ private: //member
::com::sun::star::awt::Rectangle m_aResultingDiagramRectangleExcludingAxes;
};
-//.............................................................................
-} //namespace chart
-//.............................................................................
+}
#endif
More information about the Libreoffice-commits
mailing list