From c275184ae37d145f428a459a07917e127bd67577 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 27 Apr 2020 11:01:47 +0200 Subject: loplugin:makeshared in vcl Change-Id: I990fafa8b01e94aef58d6cad30bc13de539ea496 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92968 Tested-by: Jenkins Reviewed-by: Noel Grandin --- vcl/source/app/settings.cxx | 3 ++- vcl/source/gdi/WidgetDefinition.cxx | 2 +- vcl/source/gdi/region.cxx | 28 ++++++++++++++-------------- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx index f54f05814258..8db54992b80f 100644 --- a/vcl/source/app/settings.cxx +++ b/vcl/source/app/settings.cxx @@ -596,7 +596,6 @@ ImplStyleData::ImplStyleData( const ImplStyleData& rData ) : mnUseFlatBorders(rData.mnUseFlatBorders), mbPreferredUseImagesInMenus(rData.mbPreferredUseImagesInMenus), mnMinThumbSize(rData.mnMinThumbSize), - mIconThemeScanner(rData.mIconThemeScanner?new vcl::IconThemeScanner(*rData.mIconThemeScanner):nullptr), mIconThemeSelector(std::make_shared(*rData.mIconThemeSelector)), mIconTheme(rData.mIconTheme), mbSkipDisabledInMenus(rData.mbSkipDisabledInMenus), @@ -618,6 +617,8 @@ ImplStyleData::ImplStyleData( const ImplStyleData& rData ) : maPersonaFooterBitmap( rData.maPersonaFooterBitmap ), maPersonaMenuBarTextColor( rData.maPersonaMenuBarTextColor ) { + if (rData.mIconThemeScanner) + mIconThemeScanner = std::make_shared(*rData.mIconThemeScanner); } void ImplStyleData::SetStandardStyles() diff --git a/vcl/source/gdi/WidgetDefinition.cxx b/vcl/source/gdi/WidgetDefinition.cxx index 3db9214c45ce..3c93f1ac5601 100644 --- a/vcl/source/gdi/WidgetDefinition.cxx +++ b/vcl/source/gdi/WidgetDefinition.cxx @@ -176,7 +176,7 @@ void WidgetDefinitionState::addDrawImage(OUString const& sSource) void WidgetDefinitionState::addDrawExternal(OUString const& sSource) { - auto pCommand(std::make_unique()); + auto pCommand(std::make_shared()); pCommand->msSource = sSource; mpWidgetDrawActions.push_back(std::move(pCommand)); } diff --git a/vcl/source/gdi/region.cxx b/vcl/source/gdi/region.cxx index 42fc0c0b1c4a..460a30d5203a 100644 --- a/vcl/source/gdi/region.cxx +++ b/vcl/source/gdi/region.cxx @@ -84,12 +84,12 @@ namespace A new RegionBand object is returned that contains the bands that represent the given poly-polygon. */ - std::unique_ptr ImplRectilinearPolygonToBands(const tools::PolyPolygon& rPolyPoly) + std::shared_ptr ImplRectilinearPolygonToBands(const tools::PolyPolygon& rPolyPoly) { OSL_ASSERT(ImplIsPolygonRectilinear (rPolyPoly)); // Create a new RegionBand object as container of the bands. - std::unique_ptr pRegionBand( std::make_unique() ); + std::shared_ptr pRegionBand( std::make_shared() ); long nLineId = 0; // Iterate over all polygons. @@ -182,12 +182,12 @@ namespace /** Convert a general polygon (one for which ImplIsPolygonRectilinear() returns ) to bands. */ - std::unique_ptr ImplGeneralPolygonToBands(const tools::PolyPolygon& rPolyPoly, const tools::Rectangle& rPolygonBoundingBox) + std::shared_ptr ImplGeneralPolygonToBands(const tools::PolyPolygon& rPolyPoly, const tools::Rectangle& rPolygonBoundingBox) { long nLineID = 0; // initialisation and creation of Bands - std::unique_ptr pRegionBand( std::make_unique() ); + std::shared_ptr pRegionBand( std::make_shared() ); pRegionBand->CreateBandRange(rPolygonBoundingBox.Top(), rPolygonBoundingBox.Bottom()); // insert polygons @@ -231,9 +231,9 @@ bool vcl::Region::IsEmpty() const } -static std::unique_ptr ImplCreateRegionBandFromPolyPolygon(const tools::PolyPolygon& rPolyPolygon) +static std::shared_ptr ImplCreateRegionBandFromPolyPolygon(const tools::PolyPolygon& rPolyPolygon) { - std::unique_ptr pRetval; + std::shared_ptr pRetval; if(rPolyPolygon.Count()) { @@ -558,7 +558,7 @@ void vcl::Region::Union( const tools::Rectangle& rRect ) return; } - std::unique_ptr pNew( std::make_unique(*pCurrent)); + std::shared_ptr pNew = std::make_shared(*pCurrent); // get justified rectangle const long nLeft(std::min(rRect.Left(), rRect.Right())); @@ -649,7 +649,7 @@ void vcl::Region::Intersect( const tools::Rectangle& rRect ) return; } - std::unique_ptr pNew( std::make_unique(*pCurrent)); + std::shared_ptr pNew( std::make_shared(*pCurrent)); // get justified rectangle const long nLeft(std::min(rRect.Left(), rRect.Right())); @@ -728,7 +728,7 @@ void vcl::Region::Exclude( const tools::Rectangle& rRect ) return; } - std::unique_ptr pNew( std::make_unique(*pCurrent)); + std::shared_ptr pNew( std::make_shared(*pCurrent)); // get justified rectangle const long nLeft(std::min(rRect.Left(), rRect.Right())); @@ -811,7 +811,7 @@ void vcl::Region::XOr( const tools::Rectangle& rRect ) } // only region band mode possibility left here or null/empty - std::unique_ptr pNew( std::make_unique(*getRegionBand())); + std::shared_ptr pNew( std::make_shared(*getRegionBand())); // get justified rectangle const long nLeft(std::min(rRect.Left(), rRect.Right())); @@ -906,7 +906,7 @@ void vcl::Region::Union( const vcl::Region& rRegion ) } // prepare source and target - std::unique_ptr pNew( std::make_unique(*pCurrent)); + std::shared_ptr pNew( std::make_shared(*pCurrent)); // union with source pNew->Union(*pSource); @@ -1024,7 +1024,7 @@ void vcl::Region::Intersect( const vcl::Region& rRegion ) else { // prepare new regionBand - std::unique_ptr pNew( std::make_unique(*pCurrent)); + std::shared_ptr pNew( std::make_shared(*pCurrent)); // intersect with source pNew->Intersect(*pSource); @@ -1108,7 +1108,7 @@ void vcl::Region::Exclude( const vcl::Region& rRegion ) } // prepare source and target - std::unique_ptr pNew( std::make_unique(*pCurrent)); + std::shared_ptr pNew( std::make_shared(*pCurrent)); // union with source const bool bSuccess(pNew->Exclude(*pSource)); @@ -1195,7 +1195,7 @@ bool vcl::Region::XOr( const vcl::Region& rRegion ) } // prepare source and target - std::unique_ptr pNew( std::make_unique(*pCurrent)); + std::shared_ptr pNew( std::make_shared(*pCurrent)); // union with source pNew->XOr(*pSource); -- cgit tion> LibreOffice 界面翻译代码仓库文档基金会
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndras Timar <atimar@suse.com>2013-06-03 20:51:16 +0200
committerAndras Timar <atimar@suse.com>2013-06-05 10:16:45 +0200
commit47af5d9707cf34a8f7f9507a62c2dd03e56dbfa9 (patch)
tree098208ba8efa0d691342fc7056da2060e8d3f464 /source/bn/helpcontent2
parent499065e9cda8911ef6193d32ab39aa9249325ca6 (diff)
update translations for LibreOffice 4.1 beta2
Change-Id: I5dafc5dcce605da8d6831a775ff1d416180b22d0
Diffstat (limited to 'source/bn/helpcontent2')