[Libreoffice-commits] core.git: cui/source editeng/source include/editeng starmath/source svx/source

Noel Grandin noel at peralex.com
Tue Apr 5 06:26:31 UTC 2016


 cui/source/tabpages/numpages.cxx                       |    2 +-
 editeng/source/editeng/editview.cxx                    |    7 +------
 editeng/source/outliner/outlvw.cxx                     |    8 ++++----
 editeng/source/uno/unoedprx.cxx                        |    2 +-
 editeng/source/uno/unofored.cxx                        |    4 ++--
 editeng/source/uno/unoforou.cxx                        |    4 ++--
 editeng/source/uno/unotext.cxx                         |    4 ++--
 include/editeng/editview.hxx                           |    2 +-
 include/editeng/numitem.hxx                            |    6 +++---
 include/editeng/outliner.hxx                           |    2 +-
 include/editeng/unoedprx.hxx                           |    2 +-
 include/editeng/unoedsrc.hxx                           |    4 ++--
 include/editeng/unofored.hxx                           |    2 +-
 include/editeng/unoforou.hxx                           |    2 +-
 include/editeng/unotext.hxx                            |    2 +-
 starmath/source/accessibility.cxx                      |    4 ++--
 starmath/source/accessibility.hxx                      |    2 +-
 svx/source/accessibility/AccessibleEmptyEditSource.cxx |    2 +-
 18 files changed, 28 insertions(+), 33 deletions(-)

New commits:
commit 50bb5eddaac2b16f387ba610cdcfd934269dc73c
Author: Noel Grandin <noel at peralex.com>
Date:   Mon Apr 4 14:07:10 2016 +0200

    loplugin:constantparam in editeng
    
    Change-Id: If8342112e0657014266133954269b9396085a27d
    Reviewed-on: https://gerrit.libreoffice.org/23807
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx
index 45e51f6..83d2228 100644
--- a/cui/source/tabpages/numpages.cxx
+++ b/cui/source/tabpages/numpages.cxx
@@ -2496,7 +2496,7 @@ void SvxNumberingPreview::Paint(vcl::RenderContext& rRenderContext, const Rectan
             nFontHeight = nYStep * 15 / 10;
         aStdFont.SetFontSize(Size( 0, nFontHeight ));
 
-        SvxNodeNum aNum(sal_uInt8(0));
+        SvxNodeNum aNum;
         sal_uInt16 nPreNum = pActNum->GetLevel(0).GetStart();
 
         if (bPosition)
diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx
index af17294..8c89c96 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -486,7 +486,7 @@ void EditView::Redo()
     pImpEditView->pEditEngine->Redo( this );
 }
 
-sal_uInt32 EditView::Read( SvStream& rInput, const OUString& rBaseURL, EETextFormat eFormat, bool bSelect, SvKeyValueIterator* pHTTPHeaderAttrs )
+sal_uInt32 EditView::Read( SvStream& rInput, const OUString& rBaseURL, EETextFormat eFormat, SvKeyValueIterator* pHTTPHeaderAttrs )
 {
     EditSelection aOldSel( pImpEditView->GetEditSelection() );
     pImpEditView->DrawSelection();
@@ -494,11 +494,6 @@ sal_uInt32 EditView::Read( SvStream& rInput, const OUString& rBaseURL, EETextFor
     EditPaM aEndPaM = pImpEditView->pEditEngine->pImpEditEngine->Read( rInput, rBaseURL, eFormat, aOldSel, pHTTPHeaderAttrs );
     pImpEditView->pEditEngine->pImpEditEngine->UndoActionEnd( EDITUNDO_READ );
     EditSelection aNewSel( aEndPaM, aEndPaM );
-    if ( bSelect )
-    {
-        aOldSel.Adjust( pImpEditView->pEditEngine->GetEditDoc() );
-        aNewSel.Min() = aOldSel.Min();
-    }
 
     pImpEditView->SetEditSelection( aNewSel );
     bool bGotoCursor = pImpEditView->DoAutoScroll();
diff --git a/editeng/source/outliner/outlvw.cxx b/editeng/source/outliner/outlvw.cxx
index cd855b7..c4891e2 100644
--- a/editeng/source/outliner/outlvw.cxx
+++ b/editeng/source/outliner/outlvw.cxx
@@ -1160,10 +1160,10 @@ void OutlinerView::SwitchOffBulletsNumbering(
 
 void OutlinerView::RemoveAttribsKeepLanguages( bool bRemoveParaAttribs )
 {
-    RemoveAttribs( bRemoveParaAttribs, 0, true /*keep language attribs*/ );
+    RemoveAttribs( bRemoveParaAttribs, true /*keep language attribs*/ );
 }
 
-void OutlinerView::RemoveAttribs( bool bRemoveParaAttribs, sal_uInt16 nWhich, bool bKeepLanguages )
+void OutlinerView::RemoveAttribs( bool bRemoveParaAttribs, bool bKeepLanguages )
 {
     bool bUpdate = pOwner->GetUpdateMode();
     pOwner->SetUpdateMode( false );
@@ -1171,7 +1171,7 @@ void OutlinerView::RemoveAttribs( bool bRemoveParaAttribs, sal_uInt16 nWhich, bo
     if (bKeepLanguages)
         pEditView->RemoveAttribsKeepLanguages( bRemoveParaAttribs );
     else
-        pEditView->RemoveAttribs( bRemoveParaAttribs, nWhich );
+        pEditView->RemoveAttribs( bRemoveParaAttribs );
     if ( bRemoveParaAttribs )
     {
         // Loop through all paragraphs and set indentation and level
@@ -1388,7 +1388,7 @@ sal_uLong OutlinerView::Read( SvStream& rInput, const OUString& rBaseURL, EEText
     ESelection aOldSel = pEditView->GetSelection();
     aOldSel.Adjust();
 
-    sal_uLong nRet = pEditView->Read( rInput, rBaseURL, eFormat, false/*bSelect*/, pHTTPHeaderAttrs );
+    sal_uLong nRet = pEditView->Read( rInput, rBaseURL, eFormat, pHTTPHeaderAttrs );
 
     long nParaDiff = pEditView->GetEditEngine()->GetParagraphCount() - nOldParaCount;
     sal_Int32 nChangesStart = aOldSel.nStartPara;
diff --git a/editeng/source/uno/unoedprx.cxx b/editeng/source/uno/unoedprx.cxx
index 1cb0e01..d5d6b18 100644
--- a/editeng/source/uno/unoedprx.cxx
+++ b/editeng/source/uno/unoedprx.cxx
@@ -527,7 +527,7 @@ void SvxAccessibleTextAdapter::SetParaAttribs( sal_Int32 nPara, const SfxItemSet
     mpTextForwarder->SetParaAttribs( nPara, rSet );
 }
 
-void SvxAccessibleTextAdapter::RemoveAttribs( const ESelection& , sal_uInt16 )
+void SvxAccessibleTextAdapter::RemoveAttribs( const ESelection& )
 {
 }
 
diff --git a/editeng/source/uno/unofored.cxx b/editeng/source/uno/unofored.cxx
index 03b290c..47f7afd 100644
--- a/editeng/source/uno/unofored.cxx
+++ b/editeng/source/uno/unofored.cxx
@@ -112,9 +112,9 @@ void SvxEditEngineForwarder::SetParaAttribs( sal_Int32 nPara, const SfxItemSet&
     rEditEngine.SetParaAttribs( nPara, rSet );
 }
 
-void SvxEditEngineForwarder::RemoveAttribs( const ESelection& rSelection, sal_uInt16 nWhich )
+void SvxEditEngineForwarder::RemoveAttribs( const ESelection& rSelection )
 {
-    rEditEngine.RemoveAttribs( rSelection, false/*bRemoveParaAttribs*/, nWhich );
+    rEditEngine.RemoveAttribs( rSelection, false/*bRemoveParaAttribs*/, 0 );
 }
 
 SfxItemPool* SvxEditEngineForwarder::GetPool() const
diff --git a/editeng/source/uno/unoforou.cxx b/editeng/source/uno/unoforou.cxx
index 9646a98..dfa76ff 100644
--- a/editeng/source/uno/unoforou.cxx
+++ b/editeng/source/uno/unoforou.cxx
@@ -180,9 +180,9 @@ void SvxOutlinerForwarder::SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rS
         const_cast<SfxItemSet*>(&rSet)->SetParent( pOldParent );
 }
 
-void SvxOutlinerForwarder::RemoveAttribs( const ESelection& rSelection, sal_uInt16 nWhich )
+void SvxOutlinerForwarder::RemoveAttribs( const ESelection& rSelection )
 {
-    rOutliner.RemoveAttribs( rSelection, false/*bRemoveParaAttribs*/, nWhich );
+    rOutliner.RemoveAttribs( rSelection, false/*bRemoveParaAttribs*/, 0 );
 }
 
 SfxItemPool* SvxOutlinerForwarder::GetPool() const
diff --git a/editeng/source/uno/unotext.cxx b/editeng/source/uno/unotext.cxx
index 9b253bc..2c5a1a1 100644
--- a/editeng/source/uno/unotext.cxx
+++ b/editeng/source/uno/unotext.cxx
@@ -2185,7 +2185,7 @@ uno::Reference< text::XTextRange > SAL_CALL SvxUnoTextBase::appendTextPortion(
 
         // set properties for the new text portion
         ESelection aSel( nPara, nStart, nPara, nEnd );
-        pTextForwarder->RemoveAttribs( aSel, 0 );
+        pTextForwarder->RemoveAttribs( aSel );
         pEditSource->UpdateData();
 
         SfxItemSet aItemSet( *pTextForwarder->GetEmptyItemSetPtr() );
@@ -2415,7 +2415,7 @@ void SvxDummyTextSource::SetParaAttribs( sal_Int32, const SfxItemSet& )
 {
 }
 
-void SvxDummyTextSource::RemoveAttribs( const ESelection& , sal_uInt16 )
+void SvxDummyTextSource::RemoveAttribs( const ESelection& )
 {
 }
 
diff --git a/include/editeng/editview.hxx b/include/editeng/editview.hxx
index 22fb58c..73ceaac 100644
--- a/include/editeng/editview.hxx
+++ b/include/editeng/editview.hxx
@@ -177,7 +177,7 @@ public:
     void                RemoveCharAttribs( sal_Int32 nPara, sal_uInt16 nWhich = 0 );
     void                RemoveAttribsKeepLanguages( bool bRemoveParaAttribs = false );
 
-    sal_uInt32          Read( SvStream& rInput, const OUString& rBaseURL, EETextFormat eFormat, bool bSelect = false, SvKeyValueIterator* pHTTPHeaderAttrs = nullptr );
+    sal_uInt32          Read( SvStream& rInput, const OUString& rBaseURL, EETextFormat eFormat, SvKeyValueIterator* pHTTPHeaderAttrs = nullptr );
 
     void            SetBackgroundColor( const Color& rColor );
     Color           GetBackgroundColor() const;
diff --git a/include/editeng/numitem.hxx b/include/editeng/numitem.hxx
index 31f7569..c33cfef 100644
--- a/include/editeng/numitem.hxx
+++ b/include/editeng/numitem.hxx
@@ -320,7 +320,7 @@ class SvxNodeNum
     bool       bStartNum;                     // Restart numbering
 
 public:
-    explicit inline SvxNodeNum( sal_uInt8 nLevel = SVX_NO_NUM, sal_uInt16 nSetVal = USHRT_MAX );
+    explicit inline SvxNodeNum( sal_uInt16 nSetVal = USHRT_MAX );
     inline SvxNodeNum& operator=( const SvxNodeNum& rCpy );
 
     sal_uInt8 GetLevel() const                  { return nMyLevel; }
@@ -330,8 +330,8 @@ public:
           sal_uInt16* GetLevelVal()             { return nLevelVal; }
 };
 
-SvxNodeNum::SvxNodeNum( sal_uInt8 nLevel, sal_uInt16 nSetVal )
-    : nSetValue( nSetVal ), nMyLevel( nLevel ), bStartNum( false )
+SvxNodeNum::SvxNodeNum( sal_uInt16 nSetVal )
+    : nSetValue( nSetVal ), nMyLevel( 0 ), bStartNum( false )
 {
     memset( nLevelVal, 0, sizeof( nLevelVal ) );
 }
diff --git a/include/editeng/outliner.hxx b/include/editeng/outliner.hxx
index 7060ca4..d8c990a 100644
--- a/include/editeng/outliner.hxx
+++ b/include/editeng/outliner.hxx
@@ -308,7 +308,7 @@ public:
     void        SetSelection( const ESelection& );
     void GetSelectionRectangles(std::vector<Rectangle>& rLogicRects) const;
 
-    void        RemoveAttribs( bool bRemoveParaAttribs = false, sal_uInt16 nWhich = 0, bool bKeepLanguages = false );
+    void        RemoveAttribs( bool bRemoveParaAttribs = false, bool bKeepLanguages = false );
     void        RemoveAttribsKeepLanguages( bool bRemoveParaAttribs );
     bool        HasSelection() const;
 
diff --git a/include/editeng/unoedprx.hxx b/include/editeng/unoedprx.hxx
index 2737f4d..8ec9c61 100644
--- a/include/editeng/unoedprx.hxx
+++ b/include/editeng/unoedprx.hxx
@@ -39,7 +39,7 @@ public:
     virtual SfxItemSet      GetAttribs( const ESelection& rSel, EditEngineAttribs nOnlyHardAttrib = EditEngineAttribs_All ) const override;
     virtual SfxItemSet      GetParaAttribs( sal_Int32 nPara ) const override;
     virtual void            SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rSet ) override;
-    virtual void            RemoveAttribs( const ESelection& rSelection, sal_uInt16 nWhich ) override;
+    virtual void            RemoveAttribs( const ESelection& rSelection ) override;
     virtual void            GetPortions( sal_Int32 nPara, std::vector<sal_Int32>& rList ) const override;
 
     sal_uInt16              CalcEditEngineIndex( sal_Int32 nPara, sal_Int32 nLogicalIndex );
diff --git a/include/editeng/unoedsrc.hxx b/include/editeng/unoedsrc.hxx
index d558be6..7c84c7c 100644
--- a/include/editeng/unoedsrc.hxx
+++ b/include/editeng/unoedsrc.hxx
@@ -140,12 +140,12 @@ public:
     virtual             ~SvxTextForwarder();
 
     virtual sal_Int32   GetParagraphCount() const = 0;
-    virtual sal_Int32  GetTextLen( sal_Int32 nParagraph ) const = 0;
+    virtual sal_Int32   GetTextLen( sal_Int32 nParagraph ) const = 0;
     virtual OUString    GetText( const ESelection& rSel ) const = 0;
     virtual SfxItemSet  GetAttribs( const ESelection& rSel, EditEngineAttribs nOnlyHardAttrib = EditEngineAttribs_All ) const = 0;
     virtual SfxItemSet  GetParaAttribs( sal_Int32 nPara ) const = 0;
     virtual void        SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rSet ) = 0;
-    virtual void        RemoveAttribs( const ESelection& rSelection, sal_uInt16 nWhich ) = 0;
+    virtual void        RemoveAttribs( const ESelection& rSelection ) = 0;
     virtual void        GetPortions( sal_Int32 nPara, std::vector<sal_Int32>& rList ) const = 0;
 
     virtual SfxItemState    GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const = 0;
diff --git a/include/editeng/unofored.hxx b/include/editeng/unofored.hxx
index 7108d5e..83e617f 100644
--- a/include/editeng/unofored.hxx
+++ b/include/editeng/unofored.hxx
@@ -41,7 +41,7 @@ public:
     virtual SfxItemSet  GetAttribs( const ESelection& rSel, EditEngineAttribs nOnlyHardAttrib = EditEngineAttribs_All ) const override;
     virtual SfxItemSet  GetParaAttribs( sal_Int32 nPara ) const override;
     virtual void        SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rSet ) override;
-    virtual void        RemoveAttribs( const ESelection& rSelection, sal_uInt16 nWhich ) override;
+    virtual void        RemoveAttribs( const ESelection& rSelection ) override;
     virtual void        GetPortions( sal_Int32 nPara, std::vector<sal_Int32>& rList ) const override;
 
     virtual SfxItemState    GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const override;
diff --git a/include/editeng/unoforou.hxx b/include/editeng/unoforou.hxx
index f129586..27de11c 100644
--- a/include/editeng/unoforou.hxx
+++ b/include/editeng/unoforou.hxx
@@ -59,7 +59,7 @@ public:
     virtual SfxItemSet  GetAttribs( const ESelection& rSel, EditEngineAttribs nOnlyHardAttrib = EditEngineAttribs_All ) const override;
     virtual SfxItemSet  GetParaAttribs( sal_Int32 nPara ) const override;
     virtual void        SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rSet ) override;
-    virtual void        RemoveAttribs( const ESelection& rSelection, sal_uInt16 nWhich ) override;
+    virtual void        RemoveAttribs( const ESelection& rSelection ) override;
     virtual void        GetPortions( sal_Int32 nPara, std::vector<sal_Int32>& rList ) const override;
 
     virtual SfxItemState    GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const override;
diff --git a/include/editeng/unotext.hxx b/include/editeng/unotext.hxx
index 73d2851..b3336d0 100644
--- a/include/editeng/unotext.hxx
+++ b/include/editeng/unotext.hxx
@@ -182,7 +182,7 @@ public:
     virtual SfxItemSet      GetAttribs( const ESelection& rSel, EditEngineAttribs nOnlyHardAttrib = EditEngineAttribs_All ) const override;
     virtual SfxItemSet      GetParaAttribs( sal_Int32 nPara ) const override;
     virtual void            SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rSet ) override;
-    virtual void            RemoveAttribs( const ESelection& rSelection, sal_uInt16 nWhich ) override;
+    virtual void            RemoveAttribs( const ESelection& rSelection ) override;
     virtual void            GetPortions( sal_Int32 nPara, std::vector<sal_Int32>& rList ) const override;
 
     SfxItemState            GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const override;
diff --git a/starmath/source/accessibility.cxx b/starmath/source/accessibility.cxx
index 93656c7..b7daa9e 100644
--- a/starmath/source/accessibility.cxx
+++ b/starmath/source/accessibility.cxx
@@ -1029,11 +1029,11 @@ SfxItemPool* SmTextForwarder::GetPool() const
     return pEditEngine ? pEditEngine->GetEmptyItemSet().GetPool() : nullptr;
 }
 
-void SmTextForwarder::RemoveAttribs( const ESelection& rSelection, sal_uInt16 nWhich )
+void SmTextForwarder::RemoveAttribs( const ESelection& rSelection )
 {
     EditEngine *pEditEngine = rEditAcc.GetEditEngine();
     if (pEditEngine)
-        pEditEngine->RemoveAttribs( rSelection, false/*bRemoveParaAttribs*/, nWhich );
+        pEditEngine->RemoveAttribs( rSelection, false/*bRemoveParaAttribs*/, 0 );
 }
 
 void SmTextForwarder::GetPortions( sal_Int32 nPara, std::vector<sal_Int32>& rList ) const
diff --git a/starmath/source/accessibility.hxx b/starmath/source/accessibility.hxx
index eafb18a..85c8aef 100644
--- a/starmath/source/accessibility.hxx
+++ b/starmath/source/accessibility.hxx
@@ -196,7 +196,7 @@ public:
     virtual SfxItemSet  GetAttribs( const ESelection& rSel, EditEngineAttribs nOnlyHardAttrib = EditEngineAttribs_All ) const override;
     virtual SfxItemSet  GetParaAttribs( sal_Int32 nPara ) const override;
     virtual void        SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rSet ) override;
-    virtual void        RemoveAttribs( const ESelection& rSelection, sal_uInt16 nWhich ) override;
+    virtual void        RemoveAttribs( const ESelection& rSelection ) override;
     virtual void        GetPortions( sal_Int32 nPara, std::vector<sal_Int32>& rList ) const override;
 
     virtual SfxItemState  GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const override;
diff --git a/svx/source/accessibility/AccessibleEmptyEditSource.cxx b/svx/source/accessibility/AccessibleEmptyEditSource.cxx
index ef531ff..c18da6d 100644
--- a/svx/source/accessibility/AccessibleEmptyEditSource.cxx
+++ b/svx/source/accessibility/AccessibleEmptyEditSource.cxx
@@ -100,7 +100,7 @@ namespace accessibility
         }
         SfxItemSet      GetParaAttribs( sal_Int32 /*nPara*/ ) const override { return GetAttribs(ESelection()); }
         void            SetParaAttribs( sal_Int32 /*nPara*/, const SfxItemSet& /*rSet*/ ) override {}
-        void            RemoveAttribs( const ESelection& /*rSelection*/, sal_uInt16 /*nWhich*/ ) override {}
+        void            RemoveAttribs( const ESelection& /*rSelection*/ ) override {}
         void            GetPortions( sal_Int32 /*nPara*/, std::vector<sal_Int32>& /*rList*/ ) const override {}
 
         SfxItemState    GetItemState( const ESelection& /*rSel*/, sal_uInt16 /*nWhich*/ ) const override { return SfxItemState::UNKNOWN; }


More information about the Libreoffice-commits mailing list