Kaydet (Commit) 54cd6a05 authored tarafından Noel Grandin's avatar Noel Grandin

return unique_ptr from CreateOutputEditEngine

Change-Id: I403f0da5ea1ccdf508d156a9fa828e9f91813385
Reviewed-on: https://gerrit.libreoffice.org/69804
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 28eab5de
...@@ -241,7 +241,7 @@ private: ...@@ -241,7 +241,7 @@ private:
void DrawEditStacked(DrawEditParam& rParam); void DrawEditStacked(DrawEditParam& rParam);
void DrawEditAsianVertical(DrawEditParam& rParam); void DrawEditAsianVertical(DrawEditParam& rParam);
ScFieldEditEngine* CreateOutputEditEngine(); std::unique_ptr<ScFieldEditEngine> CreateOutputEditEngine();
void ShowClipMarks( DrawEditParam& rParam, long nEngineHeight, const Size& aCellSize, void ShowClipMarks( DrawEditParam& rParam, long nEngineHeight, const Size& aCellSize,
bool bMerged, OutputAreaParam& aAreaParam ); bool bMerged, OutputAreaParam& aAreaParam );
......
...@@ -2119,9 +2119,9 @@ tools::Rectangle ScOutputData::LayoutStrings(bool bPixelToLogic, bool bPaint, co ...@@ -2119,9 +2119,9 @@ tools::Rectangle ScOutputData::LayoutStrings(bool bPixelToLogic, bool bPaint, co
return tools::Rectangle(); return tools::Rectangle();
} }
ScFieldEditEngine* ScOutputData::CreateOutputEditEngine() std::unique_ptr<ScFieldEditEngine> ScOutputData::CreateOutputEditEngine()
{ {
ScFieldEditEngine* pEngine = new ScFieldEditEngine(mpDoc, mpDoc->GetEnginePool()); std::unique_ptr<ScFieldEditEngine> pEngine(new ScFieldEditEngine(mpDoc, mpDoc->GetEnginePool()));
pEngine->SetUpdateMode( false ); pEngine->SetUpdateMode( false );
// a RefDevice always has to be set, otherwise EditEngine would create a VirtualDevice // a RefDevice always has to be set, otherwise EditEngine would create a VirtualDevice
pEngine->SetRefDevice( pFmtDevice ); pEngine->SetRefDevice( pFmtDevice );
...@@ -4367,7 +4367,7 @@ void ScOutputData::DrawEdit(bool bPixelToLogic) ...@@ -4367,7 +4367,7 @@ void ScOutputData::DrawEdit(bool bPixelToLogic)
} }
SfxItemSet* pPreviewFontSet = mpDoc->GetPreviewFont( nCellX, nCellY, nTab ); SfxItemSet* pPreviewFontSet = mpDoc->GetPreviewFont( nCellX, nCellY, nTab );
if (!pEngine) if (!pEngine)
pEngine.reset(CreateOutputEditEngine()); pEngine = CreateOutputEditEngine();
else else
lcl_ClearEdit( *pEngine ); // also calls SetUpdateMode(sal_False) lcl_ClearEdit( *pEngine ); // also calls SetUpdateMode(sal_False)
...@@ -4496,7 +4496,7 @@ void ScOutputData::DrawRotated(bool bPixelToLogic) ...@@ -4496,7 +4496,7 @@ void ScOutputData::DrawRotated(bool bPixelToLogic)
if (!bHidden) if (!bHidden)
{ {
if (!pEngine) if (!pEngine)
pEngine.reset(CreateOutputEditEngine()); pEngine = CreateOutputEditEngine();
else else
lcl_ClearEdit( *pEngine ); // also calls SetUpdateMode(sal_False) lcl_ClearEdit( *pEngine ); // also calls SetUpdateMode(sal_False)
......
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