Kaydet (Commit) 8cfa3f4b authored tarafından Stephan Bergmann's avatar Stephan Bergmann

'make screenshot' use-after-free fixes

Change-Id: I4302d0d767a1bf50fd34a78e9aa0ad6d6b0c7a22
üst d543b4df
...@@ -26,7 +26,7 @@ private: ...@@ -26,7 +26,7 @@ private:
/// dialog creation for known dialogs by ID. Has to be implemented for /// dialog creation for known dialogs by ID. Has to be implemented for
/// each registered known dialog /// each registered known dialog
virtual VclAbstractDialog* createDialogByID(sal_uInt32 nID) override; virtual VclPtr<VclAbstractDialog> createDialogByID(sal_uInt32 nID) override;
public: public:
BasctlDialogsTest(); BasctlDialogsTest();
...@@ -53,7 +53,7 @@ void BasctlDialogsTest::registerKnownDialogsByID(mapType& /*rKnownDialogs*/) ...@@ -53,7 +53,7 @@ void BasctlDialogsTest::registerKnownDialogsByID(mapType& /*rKnownDialogs*/)
// fill map of known dilogs // fill map of known dilogs
} }
VclAbstractDialog* BasctlDialogsTest::createDialogByID(sal_uInt32 /*nID*/) VclPtr<VclAbstractDialog> BasctlDialogsTest::createDialogByID(sal_uInt32 /*nID*/)
{ {
return nullptr; return nullptr;
} }
......
...@@ -26,7 +26,7 @@ private: ...@@ -26,7 +26,7 @@ private:
/// dialog creation for known dialogs by ID. Has to be implemented for /// dialog creation for known dialogs by ID. Has to be implemented for
/// each registered known dialog /// each registered known dialog
virtual VclAbstractDialog* createDialogByID(sal_uInt32 nID) override; virtual VclPtr<VclAbstractDialog> createDialogByID(sal_uInt32 nID) override;
public: public:
Chart2DialogsTest(); Chart2DialogsTest();
...@@ -53,7 +53,7 @@ void Chart2DialogsTest::registerKnownDialogsByID(mapType& /*rKnownDialogs*/) ...@@ -53,7 +53,7 @@ void Chart2DialogsTest::registerKnownDialogsByID(mapType& /*rKnownDialogs*/)
// fill map of known dilogs // fill map of known dilogs
} }
VclAbstractDialog* Chart2DialogsTest::createDialogByID(sal_uInt32 /*nID*/) VclPtr<VclAbstractDialog> Chart2DialogsTest::createDialogByID(sal_uInt32 /*nID*/)
{ {
return nullptr; return nullptr;
} }
......
...@@ -26,7 +26,7 @@ private: ...@@ -26,7 +26,7 @@ private:
/// dialog creation for known dialogs by ID. Has to be implemented for /// dialog creation for known dialogs by ID. Has to be implemented for
/// each registered known dialog /// each registered known dialog
virtual VclAbstractDialog* createDialogByID(sal_uInt32 nID) override; virtual VclPtr<VclAbstractDialog> createDialogByID(sal_uInt32 nID) override;
public: public:
CuiDialogsTest(); CuiDialogsTest();
...@@ -53,7 +53,7 @@ void CuiDialogsTest::registerKnownDialogsByID(mapType& /*rKnownDialogs*/) ...@@ -53,7 +53,7 @@ void CuiDialogsTest::registerKnownDialogsByID(mapType& /*rKnownDialogs*/)
// fill map of known dilogs // fill map of known dilogs
} }
VclAbstractDialog* CuiDialogsTest::createDialogByID(sal_uInt32 /*nID*/) VclPtr<VclAbstractDialog> CuiDialogsTest::createDialogByID(sal_uInt32 /*nID*/)
{ {
return nullptr; return nullptr;
} }
......
...@@ -26,7 +26,7 @@ private: ...@@ -26,7 +26,7 @@ private:
/// dialog creation for known dialogs by ID. Has to be implemented for /// dialog creation for known dialogs by ID. Has to be implemented for
/// each registered known dialog /// each registered known dialog
virtual VclAbstractDialog* createDialogByID(sal_uInt32 nID) override; virtual VclPtr<VclAbstractDialog> createDialogByID(sal_uInt32 nID) override;
public: public:
DbaccessDialogsTest(); DbaccessDialogsTest();
...@@ -53,7 +53,7 @@ void DbaccessDialogsTest::registerKnownDialogsByID(mapType& /*rKnownDialogs*/) ...@@ -53,7 +53,7 @@ void DbaccessDialogsTest::registerKnownDialogsByID(mapType& /*rKnownDialogs*/)
// fill map of known dilogs // fill map of known dilogs
} }
VclAbstractDialog* DbaccessDialogsTest::createDialogByID(sal_uInt32 /*nID*/) VclPtr<VclAbstractDialog> DbaccessDialogsTest::createDialogByID(sal_uInt32 /*nID*/)
{ {
return nullptr; return nullptr;
} }
......
...@@ -26,7 +26,7 @@ private: ...@@ -26,7 +26,7 @@ private:
/// dialog creation for known dialogs by ID. Has to be implemented for /// dialog creation for known dialogs by ID. Has to be implemented for
/// each registered known dialog /// each registered known dialog
virtual VclAbstractDialog* createDialogByID(sal_uInt32 nID) override; virtual VclPtr<VclAbstractDialog> createDialogByID(sal_uInt32 nID) override;
public: public:
DesktopDialogsTest(); DesktopDialogsTest();
...@@ -53,7 +53,7 @@ void DesktopDialogsTest::registerKnownDialogsByID(mapType& /*rKnownDialogs*/) ...@@ -53,7 +53,7 @@ void DesktopDialogsTest::registerKnownDialogsByID(mapType& /*rKnownDialogs*/)
// fill map of known dilogs // fill map of known dilogs
} }
VclAbstractDialog* DesktopDialogsTest::createDialogByID(sal_uInt32 /*nID*/) VclPtr<VclAbstractDialog> DesktopDialogsTest::createDialogByID(sal_uInt32 /*nID*/)
{ {
return nullptr; return nullptr;
} }
......
...@@ -26,7 +26,7 @@ private: ...@@ -26,7 +26,7 @@ private:
/// dialog creation for known dialogs by ID. Has to be implemented for /// dialog creation for known dialogs by ID. Has to be implemented for
/// each registered known dialog /// each registered known dialog
virtual VclAbstractDialog* createDialogByID(sal_uInt32 nID) override; virtual VclPtr<VclAbstractDialog> createDialogByID(sal_uInt32 nID) override;
public: public:
FilterDialogsTest(); FilterDialogsTest();
...@@ -53,7 +53,7 @@ void FilterDialogsTest::registerKnownDialogsByID(mapType& /*rKnownDialogs*/) ...@@ -53,7 +53,7 @@ void FilterDialogsTest::registerKnownDialogsByID(mapType& /*rKnownDialogs*/)
// fill map of known dilogs // fill map of known dilogs
} }
VclAbstractDialog* FilterDialogsTest::createDialogByID(sal_uInt32 /*nID*/) VclPtr<VclAbstractDialog> FilterDialogsTest::createDialogByID(sal_uInt32 /*nID*/)
{ {
return nullptr; return nullptr;
} }
......
...@@ -42,7 +42,7 @@ private: ...@@ -42,7 +42,7 @@ private:
/// dialog creation for known dialogs by ID. Has to be implemented for /// dialog creation for known dialogs by ID. Has to be implemented for
/// each registered known dialog /// each registered known dialog
virtual VclAbstractDialog* createDialogByID(sal_uInt32 nID) = 0; virtual VclPtr<VclAbstractDialog> createDialogByID(sal_uInt32 nID) = 0;
public: public:
ScreenshotTest(); ScreenshotTest();
...@@ -53,7 +53,7 @@ public: ...@@ -53,7 +53,7 @@ public:
/// Dialog creation for known dialogs by Name (path and UIXMLDescription, *.ui file). /// Dialog creation for known dialogs by Name (path and UIXMLDescription, *.ui file).
/// This uses maKnownDialogs to check if known, and if so, calls createDialogByID /// This uses maKnownDialogs to check if known, and if so, calls createDialogByID
/// with the ID from the map /// with the ID from the map
VclAbstractDialog* createDialogByName(const OString& rName); VclPtr<VclAbstractDialog> createDialogByName(const OString& rName);
/// version for AbstractDialogs, the ones created in AbstractDialogFactories /// version for AbstractDialogs, the ones created in AbstractDialogFactories
void dumpDialogToPath(VclAbstractDialog& rDialog); void dumpDialogToPath(VclAbstractDialog& rDialog);
......
...@@ -26,7 +26,7 @@ private: ...@@ -26,7 +26,7 @@ private:
/// dialog creation for known dialogs by ID. Has to be implemented for /// dialog creation for known dialogs by ID. Has to be implemented for
/// each registered known dialog /// each registered known dialog
virtual VclAbstractDialog* createDialogByID(sal_uInt32 nID) override; virtual VclPtr<VclAbstractDialog> createDialogByID(sal_uInt32 nID) override;
public: public:
ReportdesignDialogsTest(); ReportdesignDialogsTest();
...@@ -53,7 +53,7 @@ void ReportdesignDialogsTest::registerKnownDialogsByID(mapType& /*rKnownDialogs* ...@@ -53,7 +53,7 @@ void ReportdesignDialogsTest::registerKnownDialogsByID(mapType& /*rKnownDialogs*
// fill map of known dilogs // fill map of known dilogs
} }
VclAbstractDialog* ReportdesignDialogsTest::createDialogByID(sal_uInt32 /*nID*/) VclPtr<VclAbstractDialog> ReportdesignDialogsTest::createDialogByID(sal_uInt32 /*nID*/)
{ {
return nullptr; return nullptr;
} }
......
...@@ -64,7 +64,7 @@ private: ...@@ -64,7 +64,7 @@ private:
/// dialog creation for known dialogs by ID. Has to be implemented for /// dialog creation for known dialogs by ID. Has to be implemented for
/// each registered known dialog /// each registered known dialog
virtual VclAbstractDialog* createDialogByID(sal_uInt32 nID) override; virtual VclPtr<VclAbstractDialog> createDialogByID(sal_uInt32 nID) override;
public: public:
ScScreenshotTest(); ScScreenshotTest();
...@@ -142,9 +142,9 @@ void ScScreenshotTest::registerKnownDialogsByID(mapType& rKnownDialogs) ...@@ -142,9 +142,9 @@ void ScScreenshotTest::registerKnownDialogsByID(mapType& rKnownDialogs)
rKnownDialogs["modules/scalc/ui/formatcellsdialog.ui"] = 14; rKnownDialogs["modules/scalc/ui/formatcellsdialog.ui"] = 14;
} }
VclAbstractDialog* ScScreenshotTest::createDialogByID(sal_uInt32 nID) VclPtr<VclAbstractDialog> ScScreenshotTest::createDialogByID(sal_uInt32 nID)
{ {
VclAbstractDialog *pReturnDialog = nullptr; VclPtr<VclAbstractDialog> pReturnDialog;
////FIXME: translatable string here ////FIXME: translatable string here
const OUString aDefaultSheetName("Sheet1"); const OUString aDefaultSheetName("Sheet1");
......
...@@ -93,7 +93,7 @@ private: ...@@ -93,7 +93,7 @@ private:
/// dialog creation for known dialogs by ID. Has to be implemented for /// dialog creation for known dialogs by ID. Has to be implemented for
/// each registered known dialog /// each registered known dialog
virtual VclAbstractDialog* createDialogByID(sal_uInt32 nID) override; virtual VclPtr<VclAbstractDialog> createDialogByID(sal_uInt32 nID) override;
public: public:
SdDialogsTest(); SdDialogsTest();
...@@ -255,9 +255,9 @@ void SdDialogsTest::registerKnownDialogsByID(mapType& rKnownDialogs) ...@@ -255,9 +255,9 @@ void SdDialogsTest::registerKnownDialogsByID(mapType& rKnownDialogs)
rKnownDialogs["modules/simpress/ui/headerfooterdialog.ui"] = 22; rKnownDialogs["modules/simpress/ui/headerfooterdialog.ui"] = 22;
} }
VclAbstractDialog* SdDialogsTest::createDialogByID(sal_uInt32 nID) VclPtr<VclAbstractDialog> SdDialogsTest::createDialogByID(sal_uInt32 nID)
{ {
VclAbstractDialog* pRetval = nullptr; VclPtr<VclAbstractDialog> pRetval;
if (getSdAbstractDialogFactory()) if (getSdAbstractDialogFactory())
{ {
......
...@@ -26,7 +26,7 @@ private: ...@@ -26,7 +26,7 @@ private:
/// dialog creation for known dialogs by ID. Has to be implemented for /// dialog creation for known dialogs by ID. Has to be implemented for
/// each registered known dialog /// each registered known dialog
virtual VclAbstractDialog* createDialogByID(sal_uInt32 nID) override; virtual VclPtr<VclAbstractDialog> createDialogByID(sal_uInt32 nID) override;
public: public:
Sfx2DialogsTest(); Sfx2DialogsTest();
...@@ -53,7 +53,7 @@ void Sfx2DialogsTest::registerKnownDialogsByID(mapType& /*rKnownDialogs*/) ...@@ -53,7 +53,7 @@ void Sfx2DialogsTest::registerKnownDialogsByID(mapType& /*rKnownDialogs*/)
// fill map of known dilogs // fill map of known dilogs
} }
VclAbstractDialog* Sfx2DialogsTest::createDialogByID(sal_uInt32 /*nID*/) VclPtr<VclAbstractDialog> Sfx2DialogsTest::createDialogByID(sal_uInt32 /*nID*/)
{ {
return nullptr; return nullptr;
} }
......
...@@ -26,7 +26,7 @@ private: ...@@ -26,7 +26,7 @@ private:
/// dialog creation for known dialogs by ID. Has to be implemented for /// dialog creation for known dialogs by ID. Has to be implemented for
/// each registered known dialog /// each registered known dialog
virtual VclAbstractDialog* createDialogByID(sal_uInt32 nID) override; virtual VclPtr<VclAbstractDialog> createDialogByID(sal_uInt32 nID) override;
public: public:
StarmathDialogsTest(); StarmathDialogsTest();
...@@ -53,7 +53,7 @@ void StarmathDialogsTest::registerKnownDialogsByID(mapType& /*rKnownDialogs*/) ...@@ -53,7 +53,7 @@ void StarmathDialogsTest::registerKnownDialogsByID(mapType& /*rKnownDialogs*/)
// fill map of known dilogs // fill map of known dilogs
} }
VclAbstractDialog* StarmathDialogsTest::createDialogByID(sal_uInt32 /*nID*/) VclPtr<VclAbstractDialog> StarmathDialogsTest::createDialogByID(sal_uInt32 /*nID*/)
{ {
return nullptr; return nullptr;
} }
......
...@@ -26,7 +26,7 @@ private: ...@@ -26,7 +26,7 @@ private:
/// dialog creation for known dialogs by ID. Has to be implemented for /// dialog creation for known dialogs by ID. Has to be implemented for
/// each registered known dialog /// each registered known dialog
virtual VclAbstractDialog* createDialogByID(sal_uInt32 nID) override; virtual VclPtr<VclAbstractDialog> createDialogByID(sal_uInt32 nID) override;
public: public:
SvtoolsDialogsTest(); SvtoolsDialogsTest();
...@@ -53,7 +53,7 @@ void SvtoolsDialogsTest::registerKnownDialogsByID(mapType& /*rKnownDialogs*/) ...@@ -53,7 +53,7 @@ void SvtoolsDialogsTest::registerKnownDialogsByID(mapType& /*rKnownDialogs*/)
// fill map of known dilogs // fill map of known dilogs
} }
VclAbstractDialog* SvtoolsDialogsTest::createDialogByID(sal_uInt32 /*nID*/) VclPtr<VclAbstractDialog> SvtoolsDialogsTest::createDialogByID(sal_uInt32 /*nID*/)
{ {
return nullptr; return nullptr;
} }
......
...@@ -26,7 +26,7 @@ private: ...@@ -26,7 +26,7 @@ private:
/// dialog creation for known dialogs by ID. Has to be implemented for /// dialog creation for known dialogs by ID. Has to be implemented for
/// each registered known dialog /// each registered known dialog
virtual VclAbstractDialog* createDialogByID(sal_uInt32 nID) override; virtual VclPtr<VclAbstractDialog> createDialogByID(sal_uInt32 nID) override;
public: public:
SvxDialogsTest(); SvxDialogsTest();
...@@ -53,7 +53,7 @@ void SvxDialogsTest::registerKnownDialogsByID(mapType& /*rKnownDialogs*/) ...@@ -53,7 +53,7 @@ void SvxDialogsTest::registerKnownDialogsByID(mapType& /*rKnownDialogs*/)
// fill map of known dilogs // fill map of known dilogs
} }
VclAbstractDialog* SvxDialogsTest::createDialogByID(sal_uInt32 /*nID*/) VclPtr<VclAbstractDialog> SvxDialogsTest::createDialogByID(sal_uInt32 /*nID*/)
{ {
return nullptr; return nullptr;
} }
......
...@@ -26,7 +26,7 @@ private: ...@@ -26,7 +26,7 @@ private:
/// dialog creation for known dialogs by ID. Has to be implemented for /// dialog creation for known dialogs by ID. Has to be implemented for
/// each registered known dialog /// each registered known dialog
virtual VclAbstractDialog* createDialogByID(sal_uInt32 nID) override; virtual VclPtr<VclAbstractDialog> createDialogByID(sal_uInt32 nID) override;
public: public:
SwDialogsTest(); SwDialogsTest();
...@@ -53,7 +53,7 @@ void SwDialogsTest::registerKnownDialogsByID(mapType& /*rKnownDialogs*/) ...@@ -53,7 +53,7 @@ void SwDialogsTest::registerKnownDialogsByID(mapType& /*rKnownDialogs*/)
// fill map of known dilogs // fill map of known dilogs
} }
VclAbstractDialog* SwDialogsTest::createDialogByID(sal_uInt32 /*nID*/) VclPtr<VclAbstractDialog> SwDialogsTest::createDialogByID(sal_uInt32 /*nID*/)
{ {
return nullptr; return nullptr;
} }
......
...@@ -107,9 +107,8 @@ void ScreenshotTest::saveScreenshot(Dialog& rDialog) ...@@ -107,9 +107,8 @@ void ScreenshotTest::saveScreenshot(Dialog& rDialog)
} }
} }
VclAbstractDialog* ScreenshotTest::createDialogByName(const OString& rName) VclPtr<VclAbstractDialog> ScreenshotTest::createDialogByName(const OString& rName)
{ {
VclAbstractDialog* pRetval = nullptr;
const mapType::const_iterator aHit = maKnownDialogs.find(rName); const mapType::const_iterator aHit = maKnownDialogs.find(rName);
if (aHit != maKnownDialogs.end()) if (aHit != maKnownDialogs.end())
...@@ -117,7 +116,7 @@ VclAbstractDialog* ScreenshotTest::createDialogByName(const OString& rName) ...@@ -117,7 +116,7 @@ VclAbstractDialog* ScreenshotTest::createDialogByName(const OString& rName)
return createDialogByID((*aHit).second); return createDialogByID((*aHit).second);
} }
return pRetval; return VclPtr<VclAbstractDialog>();
} }
void ScreenshotTest::dumpDialogToPath(VclAbstractDialog& rDialog) void ScreenshotTest::dumpDialogToPath(VclAbstractDialog& rDialog)
......
...@@ -26,7 +26,7 @@ private: ...@@ -26,7 +26,7 @@ private:
/// dialog creation for known dialogs by ID. Has to be implemented for /// dialog creation for known dialogs by ID. Has to be implemented for
/// each registered known dialog /// each registered known dialog
virtual VclAbstractDialog* createDialogByID(sal_uInt32 nID) override; virtual VclPtr<VclAbstractDialog> createDialogByID(sal_uInt32 nID) override;
public: public:
UuiDialogsTest(); UuiDialogsTest();
...@@ -53,7 +53,7 @@ void UuiDialogsTest::registerKnownDialogsByID(mapType& /*rKnownDialogs*/) ...@@ -53,7 +53,7 @@ void UuiDialogsTest::registerKnownDialogsByID(mapType& /*rKnownDialogs*/)
// fill map of known dilogs // fill map of known dilogs
} }
VclAbstractDialog* UuiDialogsTest::createDialogByID(sal_uInt32 /*nID*/) VclPtr<VclAbstractDialog> UuiDialogsTest::createDialogByID(sal_uInt32 /*nID*/)
{ {
return nullptr; return nullptr;
} }
......
...@@ -26,7 +26,7 @@ private: ...@@ -26,7 +26,7 @@ private:
/// dialog creation for known dialogs by ID. Has to be implemented for /// dialog creation for known dialogs by ID. Has to be implemented for
/// each registered known dialog /// each registered known dialog
virtual VclAbstractDialog* createDialogByID(sal_uInt32 nID) override; virtual VclPtr<VclAbstractDialog> createDialogByID(sal_uInt32 nID) override;
public: public:
VclDialogsTest(); VclDialogsTest();
...@@ -53,7 +53,7 @@ void VclDialogsTest::registerKnownDialogsByID(mapType& /*rKnownDialogs*/) ...@@ -53,7 +53,7 @@ void VclDialogsTest::registerKnownDialogsByID(mapType& /*rKnownDialogs*/)
// fill map of known dilogs // fill map of known dilogs
} }
VclAbstractDialog* VclDialogsTest::createDialogByID(sal_uInt32 /*nID*/) VclPtr<VclAbstractDialog> VclDialogsTest::createDialogByID(sal_uInt32 /*nID*/)
{ {
return nullptr; return nullptr;
} }
......
...@@ -26,7 +26,7 @@ private: ...@@ -26,7 +26,7 @@ private:
/// dialog creation for known dialogs by ID. Has to be implemented for /// dialog creation for known dialogs by ID. Has to be implemented for
/// each registered known dialog /// each registered known dialog
virtual VclAbstractDialog* createDialogByID(sal_uInt32 nID) override; virtual VclPtr<VclAbstractDialog> createDialogByID(sal_uInt32 nID) override;
public: public:
XmlsecurityDialogsTest(); XmlsecurityDialogsTest();
...@@ -53,7 +53,7 @@ void XmlsecurityDialogsTest::registerKnownDialogsByID(mapType& /*rKnownDialogs*/ ...@@ -53,7 +53,7 @@ void XmlsecurityDialogsTest::registerKnownDialogsByID(mapType& /*rKnownDialogs*/
// fill map of known dilogs // fill map of known dilogs
} }
VclAbstractDialog* XmlsecurityDialogsTest::createDialogByID(sal_uInt32 /*nID*/) VclPtr<VclAbstractDialog> XmlsecurityDialogsTest::createDialogByID(sal_uInt32 /*nID*/)
{ {
return nullptr; return nullptr;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment