CreateDocumentInfoDialog should return shared_ptr

which is what it's only call site wants

Change-Id: I1c2c2ed3a91a3376af142ac9a5d6993a2186d660
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92590
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin 2020-04-20 18:14:20 +02:00
parent cb24c9279e
commit b613896e3b
8 changed files with 12 additions and 12 deletions

View file

@ -362,7 +362,7 @@ public:
void SignScriptingContent(weld::Window* pDialogParent);
DECL_LINK(SignDocumentHandler, Button*, void);
virtual std::unique_ptr<SfxDocumentInfoDialog> CreateDocumentInfoDialog(weld::Window* pParent, const SfxItemSet& rItemSet);
virtual std::shared_ptr<SfxDocumentInfoDialog> CreateDocumentInfoDialog(weld::Window* pParent, const SfxItemSet& rItemSet);
ErrCode CallBasic( const OUString& rMacro, const OUString& rBasicName,
SbxArray* pArgs, SbxValue* pRet = nullptr );

View file

@ -2929,9 +2929,9 @@ void ScDocShell::GetDocStat( ScDocStat& rDocStat )
static_cast<sal_uInt16>(ScPrintFunc( this, pPrinter, i ).GetTotalPages()) );
}
std::unique_ptr<SfxDocumentInfoDialog> ScDocShell::CreateDocumentInfoDialog(weld::Window* pParent, const SfxItemSet &rSet)
std::shared_ptr<SfxDocumentInfoDialog> ScDocShell::CreateDocumentInfoDialog(weld::Window* pParent, const SfxItemSet &rSet)
{
std::unique_ptr<SfxDocumentInfoDialog> xDlg = std::make_unique<SfxDocumentInfoDialog>(pParent, rSet);
std::shared_ptr<SfxDocumentInfoDialog> xDlg = std::make_shared<SfxDocumentInfoDialog>(pParent, rSet);
ScDocShell* pDocSh = dynamic_cast< ScDocShell *>( SfxObjectShell::Current() );
// Only for statistics, if this Doc is shown; not from the Doc Manager

View file

@ -215,7 +215,7 @@ public:
void SetVisAreaOrSize( const tools::Rectangle& rVisArea );
virtual std::unique_ptr<SfxDocumentInfoDialog> CreateDocumentInfoDialog(weld::Window* pParent, const SfxItemSet &rSet) override;
virtual std::shared_ptr<SfxDocumentInfoDialog> CreateDocumentInfoDialog(weld::Window* pParent, const SfxItemSet &rSet) override;
void GetDocStat( ScDocStat& rDocStat );

View file

@ -954,9 +954,9 @@ void DrawDocShell::OpenBookmark( const OUString& rBookmarkURL )
( mpViewShell ? mpViewShell->GetViewFrame() : SfxViewFrame::Current() )->GetBindings().Execute( SID_OPENHYPERLINK, ppArgs );
}
std::unique_ptr<SfxDocumentInfoDialog> DrawDocShell::CreateDocumentInfoDialog(weld::Window* pParent, const SfxItemSet &rSet)
std::shared_ptr<SfxDocumentInfoDialog> DrawDocShell::CreateDocumentInfoDialog(weld::Window* pParent, const SfxItemSet &rSet)
{
std::unique_ptr<SfxDocumentInfoDialog> xDlg = std::make_unique<SfxDocumentInfoDialog>(pParent, rSet);
std::shared_ptr<SfxDocumentInfoDialog> xDlg = std::make_shared<SfxDocumentInfoDialog>(pParent, rSet);
DrawDocShell* pDocSh = dynamic_cast<DrawDocShell*>(SfxObjectShell::Current());
if( pDocSh == this )
{

View file

@ -98,7 +98,7 @@ public:
virtual SfxStyleSheetBasePool* GetStyleSheetPool() override;
virtual void FillClass(SvGlobalName* pClassName, SotClipboardFormatId* pFormat, OUString* pFullTypeName, sal_Int32 nFileFormat, bool bTemplate = false ) const override;
virtual void SetModified( bool = true ) override;
virtual std::unique_ptr<SfxDocumentInfoDialog> CreateDocumentInfoDialog(weld::Window* pParent,
virtual std::shared_ptr<SfxDocumentInfoDialog> CreateDocumentInfoDialog(weld::Window* pParent,
const SfxItemSet &rSet) override;
using SfxObjectShell::GetVisArea;

View file

@ -261,10 +261,10 @@ void SfxObjectShell::UpdateTime_Impl(
}
}
std::unique_ptr<SfxDocumentInfoDialog> SfxObjectShell::CreateDocumentInfoDialog(weld::Window* pParent,
std::shared_ptr<SfxDocumentInfoDialog> SfxObjectShell::CreateDocumentInfoDialog(weld::Window* pParent,
const SfxItemSet& rSet)
{
return std::make_unique<SfxDocumentInfoDialog>(pParent, rSet);
return std::make_shared<SfxDocumentInfoDialog>(pParent, rSet);
}
std::set<Color> SfxObjectShell::GetDocColors()

View file

@ -117,7 +117,7 @@ class SW_DLLPUBLIC SwDocShell
override;
/// Make DocInfo known to the Doc.
SAL_DLLPRIVATE virtual std::unique_ptr<SfxDocumentInfoDialog> CreateDocumentInfoDialog(weld::Window* pParent,
SAL_DLLPRIVATE virtual std::shared_ptr<SfxDocumentInfoDialog> CreateDocumentInfoDialog(weld::Window* pParent,
const SfxItemSet &rSet) override;
/// OLE-stuff
SAL_DLLPRIVATE virtual void Draw( OutputDevice*, const JobSetup&, sal_uInt16 nAspect) override;

View file

@ -126,9 +126,9 @@ using namespace ::com::sun::star;
using namespace ::sfx2;
// create DocInfo (virtual)
std::unique_ptr<SfxDocumentInfoDialog> SwDocShell::CreateDocumentInfoDialog(weld::Window* pParent, const SfxItemSet &rSet)
std::shared_ptr<SfxDocumentInfoDialog> SwDocShell::CreateDocumentInfoDialog(weld::Window* pParent, const SfxItemSet &rSet)
{
std::unique_ptr<SfxDocumentInfoDialog> xDlg = std::make_unique<SfxDocumentInfoDialog>(pParent, rSet);
std::shared_ptr<SfxDocumentInfoDialog> xDlg = std::make_shared<SfxDocumentInfoDialog>(pParent, rSet);
//only with statistics, when this document is being shown, not
//from within the Doc-Manager
SwDocShell* pDocSh = static_cast<SwDocShell*>( SfxObjectShell::Current());