diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-12-15 16:10:33 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-12-16 10:44:03 +0100 |
commit | 882cadaac40226ea9b5dbbceb7e82328d5a935ee (patch) | |
tree | 8739f3398b596ede283f8891bb8a5c7e4f0b941d /editeng | |
parent | 67d245adca298134fc8ab4364acbe880b4e0911a (diff) |
convert EETextFormat to scoped enum
and drop unused BIN constant
Change-Id: I4ecda96f39147f7e9bceb11ecdb4f0ffe42d2053
Reviewed-on: https://gerrit.libreoffice.org/46589
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/editeng/impedit2.cxx | 4 | ||||
-rw-r--r-- | editeng/source/editeng/impedit4.cxx | 16 | ||||
-rw-r--r-- | editeng/source/outliner/outliner.cxx | 17 | ||||
-rw-r--r-- | editeng/source/outliner/outlvw.cxx | 13 |
4 files changed, 14 insertions, 36 deletions
diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index acd94199875e..1597764a4927 100644 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -3528,7 +3528,7 @@ EditSelection ImpEditEngine::PasteText( uno::Reference< datatransfer::XTransfera aData >>= aSeq; { SvMemoryStream aODFStream( aSeq.getArray(), aSeq.getLength(), StreamMode::READ ); - aNewSelection = Read( aODFStream, rBaseURL, EE_FORMAT_XML, rPaM ); + aNewSelection = Read( aODFStream, rBaseURL, EETextFormat::Xml, rPaM ); } bDone = true; } @@ -3560,7 +3560,7 @@ EditSelection ImpEditEngine::PasteText( uno::Reference< datatransfer::XTransfera aData >>= aSeq; { SvMemoryStream aRTFStream( aSeq.getArray(), aSeq.getLength(), StreamMode::READ ); - aNewSelection = Read( aRTFStream, rBaseURL, EE_FORMAT_RTF, rPaM ); + aNewSelection = Read( aRTFStream, rBaseURL, EETextFormat::Rtf, rPaM ); } bDone = true; } diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx index 684cb969b04b..8a1e7a67d520 100644 --- a/editeng/source/editeng/impedit4.cxx +++ b/editeng/source/editeng/impedit4.cxx @@ -88,13 +88,13 @@ EditPaM ImpEditEngine::Read(SvStream& rInput, const OUString& rBaseURL, EETextFo bool _bUpdate = GetUpdateMode(); SetUpdateMode( false ); EditPaM aPaM; - if ( eFormat == EE_FORMAT_TEXT ) + if ( eFormat == EETextFormat::Text ) aPaM = ReadText( rInput, rSel ); - else if ( eFormat == EE_FORMAT_RTF ) + else if ( eFormat == EETextFormat::Rtf ) aPaM = ReadRTF( rInput, rSel ); - else if ( eFormat == EE_FORMAT_XML ) + else if ( eFormat == EETextFormat::Xml ) aPaM = ReadXML( rInput, rSel ); - else if ( eFormat == EE_FORMAT_HTML ) + else if ( eFormat == EETextFormat::Html ) aPaM = ReadHTML( rInput, rBaseURL, rSel, pHTTPHeaderAttrs ); else { @@ -189,13 +189,13 @@ void ImpEditEngine::Write(SvStream& rOutput, EETextFormat eFormat, const EditSel if ( !rOutput.GetError() ) { - if ( eFormat == EE_FORMAT_TEXT ) + if ( eFormat == EETextFormat::Text ) WriteText( rOutput, rSel ); - else if ( eFormat == EE_FORMAT_RTF ) + else if ( eFormat == EETextFormat::Rtf ) WriteRTF( rOutput, rSel ); - else if ( eFormat == EE_FORMAT_XML ) + else if ( eFormat == EETextFormat::Xml ) WriteXML( rOutput, rSel ); - else if ( eFormat == EE_FORMAT_HTML ) + else if ( eFormat == EETextFormat::Html ) ; else { diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx index d9985a5479ab..2e8d4aa9d7b3 100644 --- a/editeng/source/outliner/outliner.cxx +++ b/editeng/source/outliner/outliner.cxx @@ -1081,7 +1081,7 @@ void Outliner::InvalidateBullet(sal_Int32 nPara) } } -ErrCode Outliner::Read( SvStream& rInput, const OUString& rBaseURL, sal_uInt16 eFormat, SvKeyValueIterator* pHTTPHeaderAttrs ) +ErrCode Outliner::Read( SvStream& rInput, const OUString& rBaseURL, EETextFormat eFormat, SvKeyValueIterator* pHTTPHeaderAttrs ) { bool bOldUndo = pEditEngine->IsUndoEnabled(); @@ -1093,7 +1093,7 @@ ErrCode Outliner::Read( SvStream& rInput, const OUString& rBaseURL, sal_uInt16 e Clear(); ImplBlockInsertionCallbacks( true ); - ErrCode nRet = pEditEngine->Read( rInput, rBaseURL, (EETextFormat)eFormat, pHTTPHeaderAttrs ); + ErrCode nRet = pEditEngine->Read( rInput, rBaseURL, eFormat, pHTTPHeaderAttrs ); bFirstParaIsEmpty = false; @@ -1103,20 +1103,9 @@ ErrCode Outliner::Read( SvStream& rInput, const OUString& rBaseURL, sal_uInt16 e { Paragraph* pPara = new Paragraph( 0 ); pParaList->Append(pPara); - - if ( eFormat == EE_FORMAT_BIN ) - { - const SfxItemSet& rAttrs = pEditEngine->GetParaAttribs( n ); - const SfxInt16Item& rLevel = rAttrs.Get( EE_PARA_OUTLLEVEL ); - sal_Int16 nDepth = rLevel.GetValue(); - ImplInitDepth( n, nDepth, false ); - } } - if ( eFormat != EE_FORMAT_BIN ) - { - ImpFilterIndents( 0, nParas-1 ); - } + ImpFilterIndents( 0, nParas-1 ); ImplBlockInsertionCallbacks( false ); pEditEngine->SetUpdateMode( bUpdate ); diff --git a/editeng/source/outliner/outlvw.cxx b/editeng/source/outliner/outlvw.cxx index 22299ee40f42..d10a0c6db0ee 100644 --- a/editeng/source/outliner/outlvw.cxx +++ b/editeng/source/outliner/outlvw.cxx @@ -1388,22 +1388,11 @@ void OutlinerView::Read( SvStream& rInput, EETextFormat eFormat, SvKeyValueItera for ( sal_Int32 n = nChangesStart; n <= nChangesEnd; n++ ) { - if ( eFormat == EE_FORMAT_BIN ) - { - const SfxItemSet& rAttrs = pOwner->GetParaAttribs( n ); - const SfxInt16Item& rLevel = rAttrs.Get( EE_PARA_OUTLLEVEL ); - sal_uInt16 nDepth = rLevel.GetValue(); - pOwner->ImplInitDepth( n, nDepth, false ); - } - if ( pOwner->ImplGetOutlinerMode() == OutlinerMode::OutlineObject ) pOwner->ImplSetLevelDependentStyleSheet( n ); } - if ( eFormat != EE_FORMAT_BIN ) - { - pOwner->ImpFilterIndents( nChangesStart, nChangesEnd ); - } + pOwner->ImpFilterIndents( nChangesStart, nChangesEnd ); } void OutlinerView::SetBackgroundColor( const Color& rColor ) |