summaryrefslogtreecommitdiff
path: root/sdext
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-01-24 12:04:55 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-01-24 12:54:18 +0100
commit3e4cad1f4b4a6a07b516a0d205d642a985e17484 (patch)
tree8b25c97118c6743498c95379b12feba986f6e668 /sdext
parent387200f2ddccaa8cd0b0d61943c6d7f480a0931a (diff)
loplugin:makeshared in sdext
Change-Id: Ia4148faff7e99baa2f29c86feab5a7ce3d9d0ff6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87330 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sdext')
-rw-r--r--sdext/source/pdfimport/odf/odfemitter.cxx2
-rw-r--r--sdext/source/pdfimport/sax/emitcontext.cxx2
-rw-r--r--sdext/source/pdfimport/tree/treevisitorfactory.cxx6
-rw-r--r--sdext/source/presenter/PresenterBitmapContainer.cxx2
-rw-r--r--sdext/source/presenter/PresenterController.cxx6
-rw-r--r--sdext/source/presenter/PresenterHelpView.cxx2
-rw-r--r--sdext/source/presenter/PresenterNotesView.cxx8
-rw-r--r--sdext/source/presenter/PresenterPaneBorderPainter.cxx4
-rw-r--r--sdext/source/presenter/PresenterPaneContainer.cxx2
-rw-r--r--sdext/source/presenter/PresenterScrollBar.cxx6
-rw-r--r--sdext/source/presenter/PresenterSlidePreview.cxx4
-rw-r--r--sdext/source/presenter/PresenterSlideSorter.cxx6
-rw-r--r--sdext/source/presenter/PresenterSpritePane.cxx2
-rw-r--r--sdext/source/presenter/PresenterTextView.cxx6
-rw-r--r--sdext/source/presenter/PresenterTheme.cxx10
-rw-r--r--sdext/source/presenter/PresenterToolBar.cxx14
16 files changed, 41 insertions, 41 deletions
diff --git a/sdext/source/pdfimport/odf/odfemitter.cxx b/sdext/source/pdfimport/odf/odfemitter.cxx
index 95d083ab9439..817b9ca933a6 100644
--- a/sdext/source/pdfimport/odf/odfemitter.cxx
+++ b/sdext/source/pdfimport/odf/odfemitter.cxx
@@ -116,7 +116,7 @@ void OdfEmitter::endTag( const char* pTag )
XmlEmitterSharedPtr createOdfEmitter( const uno::Reference<io::XOutputStream>& xOut )
{
- return XmlEmitterSharedPtr(new OdfEmitter(xOut));
+ return std::make_shared<OdfEmitter>(xOut);
}
}
diff --git a/sdext/source/pdfimport/sax/emitcontext.cxx b/sdext/source/pdfimport/sax/emitcontext.cxx
index c880bed6c33f..80c459c7d82e 100644
--- a/sdext/source/pdfimport/sax/emitcontext.cxx
+++ b/sdext/source/pdfimport/sax/emitcontext.cxx
@@ -171,7 +171,7 @@ void SaxEmitter::endTag( const char* pTag )
XmlEmitterSharedPtr createSaxEmitter( const uno::Reference< xml::sax::XDocumentHandler >& xDocHdl )
{
- return XmlEmitterSharedPtr(new SaxEmitter(xDocHdl));
+ return std::make_shared<SaxEmitter>(xDocHdl);
}
}
diff --git a/sdext/source/pdfimport/tree/treevisitorfactory.cxx b/sdext/source/pdfimport/tree/treevisitorfactory.cxx
index 6131014e92bd..495bf0bcb4c6 100644
--- a/sdext/source/pdfimport/tree/treevisitorfactory.cxx
+++ b/sdext/source/pdfimport/tree/treevisitorfactory.cxx
@@ -96,15 +96,15 @@ namespace pdfi
TreeVisitorFactorySharedPtr createWriterTreeVisitorFactory()
{
- return TreeVisitorFactorySharedPtr(new WriterTreeVisitorFactory());
+ return std::make_shared<WriterTreeVisitorFactory>();
}
TreeVisitorFactorySharedPtr createImpressTreeVisitorFactory()
{
- return TreeVisitorFactorySharedPtr(new ImpressTreeVisitorFactory());
+ return std::make_shared<ImpressTreeVisitorFactory>();
}
TreeVisitorFactorySharedPtr createDrawTreeVisitorFactory()
{
- return TreeVisitorFactorySharedPtr(new DrawTreeVisitorFactory());
+ return std::make_shared<DrawTreeVisitorFactory>();
}
}
diff --git a/sdext/source/presenter/PresenterBitmapContainer.cxx b/sdext/source/presenter/PresenterBitmapContainer.cxx
index ea2ff23a8759..5fecfe01ca1b 100644
--- a/sdext/source/presenter/PresenterBitmapContainer.cxx
+++ b/sdext/source/presenter/PresenterBitmapContainer.cxx
@@ -193,7 +193,7 @@ std::shared_ptr<PresenterBitmapContainer::BitmapDescriptor> PresenterBitmapConta
OSL_ASSERT(rxCanvas.is());
OSL_ASSERT(rxPresenterHelper.is());
- SharedBitmapDescriptor pBitmap (new BitmapDescriptor(rpDefault));
+ SharedBitmapDescriptor pBitmap = std::make_shared<BitmapDescriptor>(rpDefault);
if ( ! rxProperties.is())
return pBitmap;
diff --git a/sdext/source/presenter/PresenterController.cxx b/sdext/source/presenter/PresenterController.cxx
index b26dfc2fb3af..d2aad85c86cf 100644
--- a/sdext/source/presenter/PresenterController.cxx
+++ b/sdext/source/presenter/PresenterController.cxx
@@ -105,7 +105,7 @@ PresenterController::PresenterController (
mpTheme(),
mxMainWindow(),
mpPaneBorderPainter(),
- mpCanvasHelper(new PresenterCanvasHelper()),
+ mpCanvasHelper(std::make_shared<PresenterCanvasHelper>()),
mxPresenterHelper(),
mpPaintManager(),
mnPendingSlideNumber(-1),
@@ -1068,7 +1068,7 @@ void PresenterController::InitializeMainPane (const Reference<XPane>& rxPane)
if (xPane2.is())
xPane2->setVisible(true);
- mpPaintManager.reset(new PresenterPaintManager(mxMainWindow, mxPresenterHelper, mpPaneContainer));
+ mpPaintManager = std::make_shared<PresenterPaintManager>(mxMainWindow, mxPresenterHelper, mpPaneContainer);
mxCanvas.set(rxPane->getCanvas(), UNO_QUERY);
@@ -1082,7 +1082,7 @@ void PresenterController::LoadTheme (const Reference<XPane>& rxPane)
{
// Create (load) the current theme.
if (rxPane.is())
- mpTheme.reset(new PresenterTheme(mxComponentContext, rxPane->getCanvas()));
+ mpTheme = std::make_shared<PresenterTheme>(mxComponentContext, rxPane->getCanvas());
}
double PresenterController::GetSlideAspectRatio() const
diff --git a/sdext/source/presenter/PresenterHelpView.cxx b/sdext/source/presenter/PresenterHelpView.cxx
index 346e2847f3a7..b9e2c45f8651 100644
--- a/sdext/source/presenter/PresenterHelpView.cxx
+++ b/sdext/source/presenter/PresenterHelpView.cxx
@@ -651,7 +651,7 @@ void LineDescriptorList::FormatText (
{
LineDescriptor aLineDescriptor;
- mpLineDescriptors.reset(new vector<LineDescriptor>);
+ mpLineDescriptors = std::make_shared<vector<LineDescriptor>>();
vector<OUString>::const_iterator iPart (rTextParts.begin());
vector<OUString>::const_iterator iEnd (rTextParts.end());
diff --git a/sdext/source/presenter/PresenterNotesView.cxx b/sdext/source/presenter/PresenterNotesView.cxx
index b33cc11fec60..73c987158b47 100644
--- a/sdext/source/presenter/PresenterNotesView.cxx
+++ b/sdext/source/presenter/PresenterNotesView.cxx
@@ -81,14 +81,14 @@ PresenterNotesView::PresenterNotesView (
mxParentWindow = xPane->getWindow();
mxCanvas = xPane->getCanvas();
- mpTextView.reset(new PresenterTextView(
+ mpTextView = std::make_shared<PresenterTextView>(
rxComponentContext,
mxCanvas,
- mpPresenterController->GetPaintManager()->GetInvalidator(mxParentWindow)));
+ mpPresenterController->GetPaintManager()->GetInvalidator(mxParentWindow));
const OUString sResourceURL (mxViewId->getResourceURL());
- mpFont.reset(new PresenterTheme::FontDescriptor(
- rpPresenterController->GetViewFont(sResourceURL)));
+ mpFont = std::make_shared<PresenterTheme::FontDescriptor>(
+ rpPresenterController->GetViewFont(sResourceURL));
maSeparatorColor = mpFont->mnColor;
mpTextView->SetFont(mpFont);
diff --git a/sdext/source/presenter/PresenterPaneBorderPainter.cxx b/sdext/source/presenter/PresenterPaneBorderPainter.cxx
index d729ee06bae5..34565b7343ea 100644
--- a/sdext/source/presenter/PresenterPaneBorderPainter.cxx
+++ b/sdext/source/presenter/PresenterPaneBorderPainter.cxx
@@ -291,7 +291,7 @@ bool PresenterPaneBorderPainter::ProvideTheme (const Reference<rendering::XCanva
}
else
{
- mpTheme.reset(new PresenterTheme(mxContext, rxCanvas));
+ mpTheme = std::make_shared<PresenterTheme>(mxContext, rxCanvas);
bModified = true;
}
@@ -745,7 +745,7 @@ RendererPaneStyle::RendererPaneStyle (
mpBottom(),
mpBottomRight(),
mpBottomCallout(),
- mpEmpty(new PresenterBitmapDescriptor()),
+ mpEmpty(std::make_shared<PresenterBitmapDescriptor>()),
mpFont(),
mnFontXOffset(0),
mnFontYOffset(0),
diff --git a/sdext/source/presenter/PresenterPaneContainer.cxx b/sdext/source/presenter/PresenterPaneContainer.cxx
index 6477d75cb1f3..e7f91f879a6a 100644
--- a/sdext/source/presenter/PresenterPaneContainer.cxx
+++ b/sdext/source/presenter/PresenterPaneContainer.cxx
@@ -63,7 +63,7 @@ void PresenterPaneContainer::PreparePane (
return;
// No entry found for the given pane id. Create a new one.
- SharedPaneDescriptor pDescriptor (new PaneDescriptor);
+ SharedPaneDescriptor pDescriptor = std::make_shared<PaneDescriptor>();
pDescriptor->mxPaneId = rxPaneId;
pDescriptor->msViewURL = rsViewURL;
pDescriptor->mxPane = nullptr;
diff --git a/sdext/source/presenter/PresenterScrollBar.cxx b/sdext/source/presenter/PresenterScrollBar.cxx
index ba171aa6152c..cf54dee57562 100644
--- a/sdext/source/presenter/PresenterScrollBar.cxx
+++ b/sdext/source/presenter/PresenterScrollBar.cxx
@@ -94,7 +94,7 @@ PresenterScrollBar::PresenterScrollBar (
mpThumbStartDescriptor(),
mpThumbCenterDescriptor(),
mpThumbEndDescriptor(),
- mpMousePressRepeater(new MousePressRepeater(this)),
+ mpMousePressRepeater(std::make_shared<MousePressRepeater>(this)),
mpBackgroundBitmap(),
mpCanvasHelper(new PresenterCanvasHelper())
{
@@ -245,11 +245,11 @@ void PresenterScrollBar::SetCanvas (const Reference<css::rendering::XCanvas>& rx
{
try
{
- mpBitmaps.reset(new PresenterBitmapContainer(
+ mpBitmaps = std::make_shared<PresenterBitmapContainer>(
"PresenterScreenSettings/ScrollBar/Bitmaps",
std::shared_ptr<PresenterBitmapContainer>(),
mxComponentContext,
- mxCanvas));
+ mxCanvas);
mpSharedBitmaps = mpBitmaps;
}
catch(Exception&)
diff --git a/sdext/source/presenter/PresenterSlidePreview.cxx b/sdext/source/presenter/PresenterSlidePreview.cxx
index 0cf39bfcbeee..106b2ac265df 100644
--- a/sdext/source/presenter/PresenterSlidePreview.cxx
+++ b/sdext/source/presenter/PresenterSlidePreview.cxx
@@ -90,11 +90,11 @@ PresenterSlidePreview::PresenterSlidePreview (
"com.sun.star.drawing.SlideRenderer",
rxContext),
UNO_QUERY);
- mpBitmaps.reset(new PresenterBitmapContainer(
+ mpBitmaps = std::make_shared<PresenterBitmapContainer>(
"PresenterScreenSettings/ScrollBar/Bitmaps",
std::shared_ptr<PresenterBitmapContainer>(),
rxContext,
- mxCanvas));
+ mxCanvas);
Resize();
}
diff --git a/sdext/source/presenter/PresenterSlideSorter.cxx b/sdext/source/presenter/PresenterSlideSorter.cxx
index 82c9bf8dbf81..41ad2304c4f0 100644
--- a/sdext/source/presenter/PresenterSlideSorter.cxx
+++ b/sdext/source/presenter/PresenterSlideSorter.cxx
@@ -309,7 +309,7 @@ PresenterSlideSorter::PresenterSlideSorter (
}
// Create the layout.
- mpLayout.reset(new Layout(mpVerticalScrollBar));
+ mpLayout = std::make_shared<Layout>(mpVerticalScrollBar);
// Create the preview cache.
mxPreviewCache.set(
@@ -1045,8 +1045,8 @@ bool PresenterSlideSorter::ProvideCanvas()
if (xComponent.is())
xComponent->addEventListener(static_cast<awt::XWindowListener*>(this));
- mpCurrentSlideFrameRenderer.reset(
- new CurrentSlideFrameRenderer(mxComponentContext, mxCanvas));
+ mpCurrentSlideFrameRenderer =
+ std::make_shared<CurrentSlideFrameRenderer>(mxComponentContext, mxCanvas);
}
return mxCanvas.is();
}
diff --git a/sdext/source/presenter/PresenterSpritePane.cxx b/sdext/source/presenter/PresenterSpritePane.cxx
index b1e09018265e..719224997b90 100644
--- a/sdext/source/presenter/PresenterSpritePane.cxx
+++ b/sdext/source/presenter/PresenterSpritePane.cxx
@@ -32,7 +32,7 @@ PresenterSpritePane::PresenterSpritePane (const Reference<XComponentContext>& rx
const ::rtl::Reference<PresenterController>& rpPresenterController)
: PresenterPaneBase(rxContext, rpPresenterController),
mxParentCanvas(),
- mpSprite(new PresenterSprite())
+ mpSprite(std::make_shared<PresenterSprite>())
{
Reference<lang::XMultiComponentFactory> xFactory (
mxComponentContext->getServiceManager(), UNO_SET_THROW);
diff --git a/sdext/source/presenter/PresenterTextView.cxx b/sdext/source/presenter/PresenterTextView.cxx
index 583e11d7fbe5..e4f9351f01e1 100644
--- a/sdext/source/presenter/PresenterTextView.cxx
+++ b/sdext/source/presenter/PresenterTextView.cxx
@@ -72,7 +72,7 @@ PresenterTextView::PresenterTextView (
maSize(0,0),
mpFont(),
maParagraphs(),
- mpCaret(new PresenterTextCaret(
+ mpCaret(std::make_shared<PresenterTextCaret>(
rxContext,
[this] (sal_Int32 const nParagraphIndex, sal_Int32 const nCharacterIndex)
{ return this->GetCaretBounds(nParagraphIndex, nCharacterIndex); },
@@ -118,12 +118,12 @@ void PresenterTextView::SetText (const Reference<text::XText>& rxText)
sal_Int32 nCharacterCount (0);
while (xParagraphs->hasMoreElements())
{
- SharedPresenterTextParagraph pParagraph (new PresenterTextParagraph(
+ SharedPresenterTextParagraph pParagraph = std::make_shared<PresenterTextParagraph>(
maParagraphs.size(),
mxBreakIterator,
mxScriptTypeDetector,
Reference<text::XTextRange>(xParagraphs->nextElement(), UNO_QUERY),
- mpCaret));
+ mpCaret);
pParagraph->SetupCellArray(mpFont);
pParagraph->SetCharacterOffset(nCharacterCount);
nCharacterCount += pParagraph->GetCharacterCount();
diff --git a/sdext/source/presenter/PresenterTheme.cxx b/sdext/source/presenter/PresenterTheme.cxx
index 6c512fce61a8..23cf19e515b7 100644
--- a/sdext/source/presenter/PresenterTheme.cxx
+++ b/sdext/source/presenter/PresenterTheme.cxx
@@ -598,12 +598,12 @@ void PresenterTheme::Theme::Read (
maViewStyles.Read(rReadContext, mxThemeRoot);
// Read bitmaps.
- mpIconContainer.reset(new PresenterBitmapContainer(
+ mpIconContainer = std::make_shared<PresenterBitmapContainer>(
Reference<container::XNameAccess>(
PresenterConfigurationAccess::GetConfigurationNode(mxThemeRoot, "Bitmaps"), UNO_QUERY),
mpParentTheme != nullptr ? mpParentTheme->mpIconContainer
: std::shared_ptr<PresenterBitmapContainer>(),
- rReadContext.mxComponentContext, rReadContext.mxCanvas));
+ rReadContext.mxComponentContext, rReadContext.mxCanvas);
// Read fonts.
Reference<container::XNameAccess> xFontNode(
@@ -761,7 +761,7 @@ std::shared_ptr<PresenterTheme::Theme> ReadContext::ReadTheme (
>>= sThemeName;
if (sThemeName == sCurrentThemeName)
{
- pTheme.reset(new PresenterTheme::Theme(xTheme,rsKey));
+ pTheme = std::make_shared<PresenterTheme::Theme>(xTheme,rsKey);
break;
}
}
@@ -861,12 +861,12 @@ void PaneStyleContainer::ProcessPaneStyle(
if (rReadContext.mxCanvas.is())
{
Reference<container::XNameAccess> xBitmapsNode (rValues[5], UNO_QUERY);
- pStyle->mpBitmaps.reset(new PresenterBitmapContainer(
+ pStyle->mpBitmaps = std::make_shared<PresenterBitmapContainer>(
xBitmapsNode,
pStyle->mpParentStyle != nullptr ? pStyle->mpParentStyle->mpBitmaps
: std::shared_ptr<PresenterBitmapContainer>(),
rReadContext.mxComponentContext, rReadContext.mxCanvas,
- rReadContext.mxPresenterHelper));
+ rReadContext.mxPresenterHelper);
}
mStyles.push_back(pStyle);
diff --git a/sdext/source/presenter/PresenterToolBar.cxx b/sdext/source/presenter/PresenterToolBar.cxx
index c62448e0521a..ac3e972b0f98 100644
--- a/sdext/source/presenter/PresenterToolBar.cxx
+++ b/sdext/source/presenter/PresenterToolBar.cxx
@@ -582,7 +582,7 @@ void PresenterToolBar::CreateControls (
"/org.openoffice.Office.PresenterScreen/",
PresenterConfigurationAccess::READ_ONLY);
- mpCurrentContainerPart.reset(new ElementContainerPart);
+ mpCurrentContainerPart = std::make_shared<ElementContainerPart>();
maElementContainer.clear();
maElementContainer.push_back(mpCurrentContainerPart);
@@ -624,10 +624,10 @@ void PresenterToolBar::ProcessEntry (
return;
// Read mode specific values.
- SharedElementMode pNormalMode (new ElementMode());
- SharedElementMode pMouseOverMode (new ElementMode());
- SharedElementMode pSelectedMode (new ElementMode());
- SharedElementMode pDisabledMode (new ElementMode());
+ SharedElementMode pNormalMode = std::make_shared<ElementMode>();
+ SharedElementMode pMouseOverMode = std::make_shared<ElementMode>();
+ SharedElementMode pSelectedMode = std::make_shared<ElementMode>();
+ SharedElementMode pDisabledMode = std::make_shared<ElementMode>();
pNormalMode->ReadElementMode(rxProperties, "Normal", pNormalMode, rContext);
pMouseOverMode->ReadElementMode(rxProperties, "MouseOver", pNormalMode, rContext);
pSelectedMode->ReadElementMode(rxProperties, "Selected", pNormalMode, rContext);
@@ -649,7 +649,7 @@ void PresenterToolBar::ProcessEntry (
pElement.set(new Label(this));
else if ( sType == "ChangeOrientation" )
{
- mpCurrentContainerPart.reset(new ElementContainerPart);
+ mpCurrentContainerPart = std::make_shared<ElementContainerPart>();
maElementContainer.push_back(mpCurrentContainerPart);
return;
}
@@ -1719,7 +1719,7 @@ void SAL_CALL TimeLabel::disposing()
void TimeLabel::ConnectToTimer()
{
- mpListener.reset(new Listener(this));
+ mpListener = std::make_shared<Listener>(this);
PresenterClockTimer::Instance(mpToolBar->GetComponentContext())->AddListener(mpListener);
}