summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2017-05-04 18:23:28 -0400
committerKohei Yoshida <libreoffice@kohei.us>2017-05-05 04:24:24 +0200
commit4633d3d539d32236527a7056c50a04e373f8038d (patch)
tree720f45024b15527bdf1f5242ee976263cd0c57fc /sc
parenta7f1df962c1c6cb0e1d51d8a67f0190c64962544 (diff)
Use std::unique_ptr for these guys.
Change-Id: I36510129f95548db3b156025a1bfe631577ec610 Reviewed-on: https://gerrit.libreoffice.org/37267 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Kohei Yoshida <libreoffice@kohei.us>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/app/inputhdl.cxx13
1 files changed, 5 insertions, 8 deletions
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index e914894145e3..dea393379fb8 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -2603,8 +2603,8 @@ void ScInputHandler::EnterHandler( ScEnterMode nBlockMode )
bool bMatrix = ( nBlockMode == ScEnterMode::MATRIX );
SfxApplication* pSfxApp = SfxGetpApp();
- EditTextObject* pObject = nullptr;
- ScPatternAttr* pCellAttrs = nullptr;
+ std::unique_ptr<EditTextObject> pObject;
+ std::unique_ptr<ScPatternAttr> pCellAttrs;
bool bForget = false; // Remove due to validity?
OUString aString = GetEditText(mpEditEngine.get());
@@ -2742,7 +2742,7 @@ void ScInputHandler::EnterHandler( ScEnterMode nBlockMode )
if ( pCommonAttrs )
{
ScDocument* pDoc = pActiveViewSh->GetViewData().GetDocument();
- pCellAttrs = new ScPatternAttr( pDoc->GetPool() );
+ pCellAttrs = o3tl::make_unique<ScPatternAttr>(pDoc->GetPool());
pCellAttrs->GetFromEditItemSet( pCommonAttrs );
delete pCommonAttrs;
}
@@ -2798,7 +2798,7 @@ void ScInputHandler::EnterHandler( ScEnterMode nBlockMode )
if (bAttrib)
{
mpEditEngine->ClearSpellErrors();
- pObject = mpEditEngine->CreateTextObject();
+ pObject.reset(mpEditEngine->CreateTextObject());
}
else if (bAutoComplete) // Adjust Upper/Lower case
{
@@ -2893,7 +2893,7 @@ void ScInputHandler::EnterHandler( ScEnterMode nBlockMode )
ScInputStatusItem aItem( FID_INPUTLINE_STATUS,
aCursorPos, aCursorPos, aCursorPos,
- aString, pObject );
+ aString, pObject.get() );
if (!aMisspellRanges.empty())
aItem.SetMisspellRanges(&aMisspellRanges);
@@ -2917,9 +2917,6 @@ void ScInputHandler::EnterHandler( ScEnterMode nBlockMode )
pExecuteSh->AdjustBlockHeight();
}
- delete pCellAttrs;
- delete pObject;
-
HideTip();
HideTipBelow();