From c3efbb1d23fcdd9df4f6f77525dc8db0b527b115 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 10 Nov 2015 10:20:48 +0200 Subject: fix build, std::make_unique is C++14, use o3tl::make_unique after my recent boost::ptr_vector->std::vector conversions Change-Id: I5ebea198365bb2fddf43851c70ebea3f3e19d61b --- chart2/source/view/charttypes/GL3DBarChart.cxx | 27 +++++++++++++------------- chart2/source/view/main/ChartView.cxx | 3 ++- 2 files changed, 16 insertions(+), 14 deletions(-) (limited to 'chart2') diff --git a/chart2/source/view/charttypes/GL3DBarChart.cxx b/chart2/source/view/charttypes/GL3DBarChart.cxx index d5cadc5b2f2c..8ee0cc65c55c 100644 --- a/chart2/source/view/charttypes/GL3DBarChart.cxx +++ b/chart2/source/view/charttypes/GL3DBarChart.cxx @@ -24,6 +24,7 @@ #include #endif #include +#include #define CALC_POS_EVENT_ID 1 #define SHAPE_START_ID 10 @@ -641,7 +642,7 @@ void GL3DBarChart::create3DShapes(const std::vector { mnColorRate = 0; } - maShapes.push_back(std::make_unique(mpRenderer.get())); + maShapes.push_back(o3tl::make_unique(mpRenderer.get())); mpCamera = static_cast(maShapes.back().get()); sal_Int32 nSeriesIndex = 0; @@ -674,7 +675,7 @@ void GL3DBarChart::create3DShapes(const std::vector if(!aSeriesName.isEmpty()) { - maShapes.push_back(std::make_unique(mpRenderer.get(), + maShapes.push_back(o3tl::make_unique(mpRenderer.get(), *mpTextCache, aSeriesName, nId)); nId += ID_STEP; opengl3D::Text* p = static_cast(maShapes.back().get()); @@ -725,7 +726,7 @@ void GL3DBarChart::create3DShapes(const std::vector processAutoFly(nId, nColor); } } - maShapes.push_back(std::make_unique(mpRenderer.get(), aBarPosition, nColor, nId)); + maShapes.push_back(o3tl::make_unique(mpRenderer.get(), aBarPosition, nColor, nId)); nId += ID_STEP; } @@ -739,7 +740,7 @@ void GL3DBarChart::create3DShapes(const std::vector nYPos += BAR_SIZE_Y + BAR_DISTANCE_Y; // X axis - maShapes.push_back(std::make_unique(mpRenderer.get(), nId)); + maShapes.push_back(o3tl::make_unique(mpRenderer.get(), nId)); nId += ID_STEP; opengl3D::Line* pAxis = static_cast(maShapes.back().get()); glm::vec3 aBegin; @@ -750,7 +751,7 @@ void GL3DBarChart::create3DShapes(const std::vector pAxis->setLineColor(COL_BLUE); // Y axis - maShapes.push_back(std::make_unique(mpRenderer.get(), nId)); + maShapes.push_back(o3tl::make_unique(mpRenderer.get(), nId)); nId += ID_STEP; pAxis = static_cast(maShapes.back().get()); aBegin.x = aBegin.y = 0; @@ -760,7 +761,7 @@ void GL3DBarChart::create3DShapes(const std::vector pAxis->setLineColor(COL_BLUE); // Chart background. - maShapes.push_back(std::make_unique(mpRenderer.get(), nId)); + maShapes.push_back(o3tl::make_unique(mpRenderer.get(), nId)); nId += ID_STEP; opengl3D::Rectangle* pRect = static_cast(maShapes.back().get()); glm::vec3 aTopLeft; @@ -787,7 +788,7 @@ void GL3DBarChart::create3DShapes(const std::vector float nXPos = i * (BAR_SIZE_X + BAR_DISTANCE_X); - maShapes.push_back(std::make_unique(mpRenderer.get(), *mpTextCache, + maShapes.push_back(o3tl::make_unique(mpRenderer.get(), *mpTextCache, aCats[i], nId)); nId += ID_STEP; opengl3D::Text* p = static_cast(maShapes.back().get()); @@ -801,7 +802,7 @@ void GL3DBarChart::create3DShapes(const std::vector // create shapes on other side as well - maShapes.push_back(std::make_unique(mpRenderer.get(), *mpTextCache, + maShapes.push_back(o3tl::make_unique(mpRenderer.get(), *mpTextCache, aCats[i], nId)); nId += ID_STEP; p = static_cast(maShapes.back().get()); @@ -971,7 +972,7 @@ void GL3DBarChart::clickedAt(const Point& rPos, sal_uInt16 nButtons) glm::vec3 aTextPos = glm::vec3(rBarInfo.maPos.x + BAR_SIZE_X / 2.0f, rBarInfo.maPos.y + BAR_SIZE_Y / 2.0f, rBarInfo.maPos.z); - maShapes.push_back(std::make_unique(mpRenderer.get(), *mpTextCache, + maShapes.push_back(o3tl::make_unique(mpRenderer.get(), *mpTextCache, "Value: " + OUString::number(rBarInfo.mnVal), glm::vec4(0.0f, 0.0f, 1.0f, 1.0f), CALC_POS_EVENT_ID)); opengl3D::ScreenText* pScreenText = static_cast(maShapes.back().get()); pScreenText->setPosition(glm::vec2(-0.9f, 0.9f), glm::vec2(-0.6f, 0.8f), aTextPos); @@ -1131,7 +1132,7 @@ void GL3DBarChart::contextDestroyed() float GL3DBarChart::addScreenTextShape(OUString &nStr, const glm::vec2& rLeftOrRightTop, float nTextHeight, bool bLeftTopFlag, const glm::vec4& rColor, const glm::vec3& rPos, sal_uInt32 nEvent) { - maScreenTextShapes.push_back(std::make_unique(mpRenderer.get(), *mpTextCache, nStr, rColor, nEvent)); + maScreenTextShapes.push_back(o3tl::make_unique(mpRenderer.get(), *mpTextCache, nStr, rColor, nEvent)); const opengl3D::TextCacheItem& rTextCache = mpTextCache->getText(nStr); float nRectWidth = (float)rTextCache.maSize.Width() / (float)rTextCache.maSize.Height() * nTextHeight / 2.0f; opengl3D::ScreenText* pScreenText = static_cast(maScreenTextShapes.back().get()); @@ -1241,7 +1242,7 @@ void GL3DBarChart::addMovementScreenText(sal_uInt32 nBarId) rBarInfo.maPos.y + BAR_SIZE_Y / 2.0f, rBarInfo.maPos.z); OUString aBarValue = "Value: " + OUString::number(rBarInfo.mnVal); - maScreenTextShapes.push_back(std::make_unique(mpRenderer.get(), *mpTextCache, aBarValue, glm::vec4(0.0f, 0.0f, 1.0f, 0.0f), CALC_POS_EVENT_ID, true)); + maScreenTextShapes.push_back(o3tl::make_unique(mpRenderer.get(), *mpTextCache, aBarValue, glm::vec4(0.0f, 0.0f, 1.0f, 0.0f), CALC_POS_EVENT_ID, true)); const opengl3D::TextCacheItem& rTextCache = mpTextCache->getText(aBarValue); float nRectWidth = (float)rTextCache.maSize.Width() / (float)rTextCache.maSize.Height() * 0.024; opengl3D::ScreenText* pScreenText = static_cast(maScreenTextShapes.back().get()); @@ -1312,7 +1313,7 @@ void GL3DBarChart::updateClickEvent() } //add translucent back ground aTitle = " "; - maScreenTextShapes.push_back(std::make_unique(mpRenderer.get(), *mpTextCache, aTitle, glm::vec4(0.0f, 0.0f, 0.0f, 0.5f), 0)); + maScreenTextShapes.push_back(o3tl::make_unique(mpRenderer.get(), *mpTextCache, aTitle, glm::vec4(0.0f, 0.0f, 0.0f, 0.5f), 0)); opengl3D::ScreenText* pScreenText = static_cast(maScreenTextShapes.back().get()); pScreenText->setPosition(glm::vec2(nMinXCoord, 0.99f), glm::vec2(nMaxXCoord, 0.99f - nMaxHight)); } @@ -1438,7 +1439,7 @@ void GL3DBarChart::updateScroll() for(size_t i = 0; i < aBarInfoList.size(); i++) { OUString aBarValue = "Value: " + OUString::number(aBarInfoList[i].mnVal); - maScreenTextShapes.push_back(std::make_unique(mpRenderer.get(), *mpTextCache, aBarValue, glm::vec4(0.0f, 0.0f, 1.0f, 0.0f), CALC_POS_EVENT_ID, true)); + maScreenTextShapes.push_back(o3tl::make_unique(mpRenderer.get(), *mpTextCache, aBarValue, glm::vec4(0.0f, 0.0f, 1.0f, 0.0f), CALC_POS_EVENT_ID, true)); const opengl3D::TextCacheItem& rTextCache = mpTextCache->getText(aBarValue); float nRectWidth = (float)rTextCache.maSize.Width() / (float)rTextCache.maSize.Height() * 0.024; glm::vec3 aTextPos = glm::vec3(aBarInfoList[i].maPos.x + BAR_SIZE_X / 2.0f, diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx index 722a93ff9f09..5625512a58c4 100644 --- a/chart2/source/view/main/ChartView.cxx +++ b/chart2/source/view/main/ChartView.cxx @@ -114,6 +114,7 @@ #include #include +#include #include @@ -3396,7 +3397,7 @@ void ChartView::createShapes3D() if(!xDataSeries.is()) continue; - aDataSeries.push_back(std::make_unique(xDataSeries)); + aDataSeries.push_back(o3tl::make_unique(xDataSeries)); } std::unique_ptr pCatProvider(new ExplicitCategoriesProvider(xCooSys, mrChartModel)); -- cgit