diff options
author | Jochen Nitschke <j.nitschke+logerrit@ok.de> | 2016-08-25 20:30:31 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-08-26 07:53:28 +0000 |
commit | aa67fed597bb375d1180d85db7ac90999f86e1a4 (patch) | |
tree | 3eefc64f4cfb7f1a383d05867acb1b8250193ad1 /editeng | |
parent | 532c2bba7d9985a10b112c880f21691f6b66c19c (diff) |
reduce defines to bool
nLastAction could be 0, ACTION_INSERTTEXT or ACTION_INSERTPARABRK
only later was checked so make this a bool
Change-Id: I49287d48ebd12f2fcb4fe71756fe39cf116f588b
Reviewed-on: https://gerrit.libreoffice.org/28396
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/editeng/eertfpar.cxx | 19 | ||||
-rw-r--r-- | editeng/source/editeng/eertfpar.hxx | 5 |
2 files changed, 10 insertions, 14 deletions
diff --git a/editeng/source/editeng/eertfpar.cxx b/editeng/source/editeng/eertfpar.cxx index cb97fcc3bacc..4e6e18d019d5 100644 --- a/editeng/source/editeng/eertfpar.cxx +++ b/editeng/source/editeng/eertfpar.cxx @@ -53,14 +53,13 @@ ImportInfo::~ImportInfo() EditRTFParser::EditRTFParser( SvStream& rIn, EditSelection aSel, SfxItemPool& rAttrPool, EditEngine* pEditEngine) : SvxRTFParser(rAttrPool, rIn, nullptr), + aCurSel(aSel), mpEditEngine(pEditEngine), - aRTFMapMode(MAP_TWIP) + aRTFMapMode(MAP_TWIP), + nDefFont(0), + nDefTab(0), + bLastActionInsertParaBreak(false) { - aCurSel = aSel; - nDefFont = 0; - nDefTab = 0; - nLastAction = 0; - SetInsPos(EditPosition(mpEditEngine, &aCurSel)); // Convert the twips values ... @@ -106,7 +105,7 @@ SvParserState EditRTFParser::CallParser() mpEditEngine->CallImportHandler(aImportInfo); } - if ( nLastAction == ACTION_INSERTPARABRK ) + if (bLastActionInsertParaBreak) { ContentNode* pCurNode = aCurSel.Max().GetNode(); sal_Int32 nPara = mpEditEngine->GetEditDoc().GetPos(pCurNode); @@ -247,7 +246,7 @@ void EditRTFParser::InsertText() mpEditEngine->CallImportHandler(aImportInfo); } aCurSel = mpEditEngine->InsertText(aCurSel, aText); - nLastAction = ACTION_INSERTTEXT; + bLastActionInsertParaBreak = false; } void EditRTFParser::InsertPara() @@ -258,7 +257,7 @@ void EditRTFParser::InsertPara() mpEditEngine->CallImportHandler(aImportInfo); } aCurSel = mpEditEngine->InsertParaBreak(aCurSel); - nLastAction = ACTION_INSERTPARABRK; + bLastActionInsertParaBreak = true; } void EditRTFParser::MovePos( bool const bForward ) @@ -564,7 +563,7 @@ void EditRTFParser::ReadField() SvxFieldItem aField( SvxURLField( aFldInst, aFldRslt, SVXURLFORMAT_REPR ), EE_FEATURE_FIELD ); aCurSel = mpEditEngine->InsertField(aCurSel, aField); mpEditEngine->UpdateFieldsOnly(); - nLastAction = ACTION_INSERTTEXT; + bLastActionInsertParaBreak = false; } } diff --git a/editeng/source/editeng/eertfpar.hxx b/editeng/source/editeng/eertfpar.hxx index d58ccb672808..86194a097c5d 100644 --- a/editeng/source/editeng/eertfpar.hxx +++ b/editeng/source/editeng/eertfpar.hxx @@ -26,9 +26,6 @@ class EditEngine; - -#define ACTION_INSERTPARABRK 2 - class EditRTFParser : public SvxRTFParser { private: @@ -39,7 +36,7 @@ private: sal_uInt16 nDefFont; sal_uInt16 nDefTab; - sal_uInt8 nLastAction; + bool bLastActionInsertParaBreak; protected: virtual void InsertPara() override; |