summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorBrad Sowden <code@sowden.org>2012-06-18 20:01:20 +1200
committerFridrich Štrba <fridrich.strba@bluewin.ch>2012-06-18 12:39:39 +0200
commitdc019876d8eb42b56e259d6a6f6d7ea5f904d870 (patch)
treeb645a9d560b3637989a126d4c0add0fb65ff99e8 /sw
parentd246b853035714d20c7689f54e507640981aeb9b (diff)
Member variables can be made local
Change-Id: I571eaa936f8d1afb421da3137aa090e916e633ba
Diffstat (limited to 'sw')
-rw-r--r--sw/source/ui/docvw/edtwin.cxx32
1 files changed, 6 insertions, 26 deletions
diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx
index 532bc16fd1c3..82be70664290 100644
--- a/sw/source/ui/docvw/edtwin.cxx
+++ b/sw/source/ui/docvw/edtwin.cxx
@@ -292,10 +292,7 @@ struct QuickHelpData
/// Help string is currently displayed.
bool m_bIsDisplayed;
- sal_uInt16* pAttrs;
- CommandExtTextInputData* pCETID;
-
- QuickHelpData() : pAttrs( 0 ), pCETID( 0 ) { ClearCntnt(); }
+ QuickHelpData() { ClearCntnt(); }
void Move( QuickHelpData& rCpy );
void ClearCntnt();
@@ -5485,14 +5482,6 @@ void QuickHelpData::Move( QuickHelpData& rCpy )
m_bAppendSpace = rCpy.m_bAppendSpace;
m_bIsTip = rCpy.m_bIsTip;
m_bIsAutoText = rCpy.m_bIsAutoText;
-
- delete pCETID;
- pCETID = rCpy.pCETID;
- rCpy.pCETID = 0;
-
- delete[] pAttrs;
- pAttrs = rCpy.pAttrs;
- rCpy.pAttrs = 0;
}
void QuickHelpData::ClearCntnt()
@@ -5503,18 +5492,10 @@ void QuickHelpData::ClearCntnt()
m_aHelpStrings.clear();
m_bIsTip = true;
m_bIsAutoText = true;
- delete pCETID, pCETID = 0;
- delete[] pAttrs, pAttrs = 0;
}
void QuickHelpData::Start( SwWrtShell& rSh, sal_uInt16 nWrdLen )
{
- delete pCETID;
- pCETID = 0;
-
- delete[] pAttrs;
- pAttrs = 0;
-
if( USHRT_MAX != nWrdLen )
{
nLen = nWrdLen;
@@ -5537,12 +5518,11 @@ void QuickHelpData::Start( SwWrtShell& rSh, sal_uInt16 nWrdLen )
String sStr( m_aHelpStrings[ nCurArrPos ] );
sStr.Erase( 0, nLen );
sal_uInt16 nL = sStr.Len();
- pAttrs = new sal_uInt16[ nL ];
- for( sal_uInt16 n = nL; n; )
- *(pAttrs + --n ) = EXTTEXTINPUT_ATTR_DOTTEDUNDERLINE |
+ const sal_uInt16 nVal = EXTTEXTINPUT_ATTR_DOTTEDUNDERLINE |
EXTTEXTINPUT_ATTR_HIGHLIGHT;
- pCETID = new CommandExtTextInputData( sStr, pAttrs, nL,
- 0, 0, 0, sal_False );
+ const std::vector<sal_uInt16> aAttrs( nL, nVal );
+ CommandExtTextInputData aCETID( sStr, &aAttrs[0], nL,
+ 0, 0, 0, sal_False );
//fdo#33092. If the current input language is the default
//language that text would appear in if typed, then don't
@@ -5555,7 +5535,7 @@ void QuickHelpData::Start( SwWrtShell& rSh, sal_uInt16 nWrdLen )
}
rSh.CreateExtTextInput(eInputLanguage);
- rSh.SetExtTextInputData( *pCETID );
+ rSh.SetExtTextInputData( aCETID );
}
}