[Libreoffice-commits] core.git: 5 commits - include/store shell/source sot/source starmath/inc starmath/source store/source svgio/inc svgio/source

Noel Grandin noel at peralex.com
Tue Mar 1 10:49:15 UTC 2016


 include/store/store.hxx                           |    5 +-
 shell/source/unix/sysshell/recently_used_file.cxx |    4 +-
 shell/source/unix/sysshell/recently_used_file.hxx |    2 -
 sot/source/sdstor/stgdir.cxx                      |    4 +-
 sot/source/sdstor/stgdir.hxx                      |    2 -
 starmath/inc/cursor.hxx                           |   12 +++---
 starmath/inc/dialog.hxx                           |    6 +--
 starmath/source/cursor.cxx                        |   39 +++++++++-------------
 starmath/source/dialog.cxx                        |   15 +++-----
 store/source/storbios.cxx                         |   35 +++++++++----------
 store/source/storbios.hxx                         |   12 ------
 svgio/inc/svgio/svgreader/svgmarkernode.hxx       |    2 -
 svgio/inc/svgio/svgreader/svgtools.hxx            |    2 -
 svgio/source/svgreader/svgtools.cxx               |    4 +-
 14 files changed, 61 insertions(+), 83 deletions(-)

New commits:
commit 16067d4f903bebc506daa8149f9b15f1f1b4e629
Author: Noel Grandin <noel at peralex.com>
Date:   Tue Mar 1 11:35:26 2016 +0200

    loplugin:unuseddefaultparam in shell
    
    Change-Id: Ib14fd4f7f0a23f83801f448aa2c22e550057ec71

diff --git a/shell/source/unix/sysshell/recently_used_file.cxx b/shell/source/unix/sysshell/recently_used_file.cxx
index 2bf7d7e..5a9b464 100644
--- a/shell/source/unix/sysshell/recently_used_file.cxx
+++ b/shell/source/unix/sysshell/recently_used_file.cxx
@@ -99,9 +99,9 @@ void recently_used_file::reset() const
 }
 
 
-void recently_used_file::truncate(off_t length)
+void recently_used_file::truncate()
 {
-    if (ftruncate(fileno(file_), length) == -1)
+    if (ftruncate(fileno(file_), 0) == -1)
         throw "I/O error: ftruncate failed";
 }
 
diff --git a/shell/source/unix/sysshell/recently_used_file.hxx b/shell/source/unix/sysshell/recently_used_file.hxx
index 335361b..88ba5d8 100644
--- a/shell/source/unix/sysshell/recently_used_file.hxx
+++ b/shell/source/unix/sysshell/recently_used_file.hxx
@@ -39,7 +39,7 @@ public:
     void reset() const;
 
 
-    void truncate(off_t length = 0);
+    void truncate();
 
 
     size_t read(
commit def71473d25e88729c644e35523d267c8cd04e57
Author: Noel Grandin <noel at peralex.com>
Date:   Tue Mar 1 11:31:10 2016 +0200

    loplugin:unuseddefaultparam in sot
    
    Change-Id: I36f88f060377fa754d4a47956932d73c47d14ece

diff --git a/sot/source/sdstor/stgdir.cxx b/sot/source/sdstor/stgdir.cxx
index 8e8eaa0..e093936 100644
--- a/sot/source/sdstor/stgdir.cxx
+++ b/sot/source/sdstor/stgdir.cxx
@@ -261,11 +261,11 @@ bool StgDirEntry::IsDirty()
 
 // Set up a stream.
 
-void StgDirEntry::OpenStream( StgIo& rIo, bool bForceBig )
+void StgDirEntry::OpenStream( StgIo& rIo )
 {
     sal_Int32 nThreshold = (sal_uInt16) rIo.m_aHdr.GetThreshold();
     delete m_pStgStrm;
-    if( !bForceBig && m_aEntry.GetSize() < nThreshold )
+    if( m_aEntry.GetSize() < nThreshold )
         m_pStgStrm = new StgSmallStrm( rIo, *this );
     else
         m_pStgStrm = new StgDataStrm( rIo, *this );
diff --git a/sot/source/sdstor/stgdir.hxx b/sot/source/sdstor/stgdir.hxx
index 7878de3..cecbba4 100644
--- a/sot/source/sdstor/stgdir.hxx
+++ b/sot/source/sdstor/stgdir.hxx
@@ -78,7 +78,7 @@ public:
 
     bool Commit();
 
-    void  OpenStream( StgIo&, bool=false );     // set up an appropriate stream
+    void  OpenStream( StgIo& );     // set up an appropriate stream
     void  Close();
     sal_Int32 GetSize();
     bool  SetSize( sal_Int32 );
commit 08e14eb270ef446c68ac27a3bca49494aa02da2d
Author: Noel Grandin <noel at peralex.com>
Date:   Tue Mar 1 11:29:12 2016 +0200

    loplugin:unuseddefaultparam in starmath
    
    Change-Id: I740d931c0236c1a4d40013b458f249692695d6e5

diff --git a/starmath/inc/cursor.hxx b/starmath/inc/cursor.hxx
index 761415f..1194967 100644
--- a/starmath/inc/cursor.hxx
+++ b/starmath/inc/cursor.hxx
@@ -164,11 +164,11 @@ public:
      * This method only work if the caret is inside an SmOperNode, or to the right of one.
      * Notice also that this method ignores any selection made.
      *
-     * @param bMoveCaret If true that caret will be moved into the limit.
+     * The caret will be moved into the limit.
      *
      * @returns True, if the caret was in a context where this operation was possible.
      */
-    bool InsertLimit(SmSubSup eSubSup, bool bMoveCaret = true);
+    bool InsertLimit(SmSubSup eSubSup);
 
     /** Insert a new row or newline
      *
@@ -217,7 +217,7 @@ public:
     void Draw(OutputDevice& pDev, Point Offset, bool isCaretVisible);
 
     bool IsAtTailOfBracket(SmBracketType eBracketType, SmBraceNode** ppBraceNode = nullptr) const;
-    void MoveAfterBracket(SmBraceNode* pBraceNode, bool bMoveAnchor = true);
+    void MoveAfterBracket(SmBraceNode* pBraceNode);
 
 private:
     friend class SmDocShell;
@@ -414,11 +414,11 @@ public:
     SmNodeListParser(){
         pList = nullptr;
     }
-    /** Parse a list of nodes to an expression
+    /** Parse a list of nodes to an expression.
      *
-     * If bDeleteErrorNodes is true, old error nodes will be deleted.
+     * Old error nodes will be deleted.
      */
-    SmNode* Parse(SmNodeList* list, bool bDeleteErrorNodes = true);
+    SmNode* Parse(SmNodeList* list);
     /** True, if the token is an operator */
     static bool IsOperator(const SmToken &token);
     /** True, if the token is a relation operator */
diff --git a/starmath/inc/dialog.hxx b/starmath/inc/dialog.hxx
index fe5ed2a..dd1acc8 100644
--- a/starmath/inc/dialog.hxx
+++ b/starmath/inc/dialog.hxx
@@ -371,7 +371,7 @@ class SmSymbolDialog : public ModalDialog
     DECL_LINK_TYPED(GetClickHdl, Button*, void);
     void SymbolDblClickHdl();
 
-    void            FillSymbolSets(bool bDeleteText = true);
+    void            FillSymbolSets();
     const SmSym    *GetSymbol() const;
 
     virtual void    DataChanged( const DataChangedEvent& rDCEvt ) override;
@@ -444,8 +444,8 @@ class SmSymDefineDialog : public ModalDialog
 
     void    FillSymbols(ComboBox &rComboBox, bool bDeleteText = true);
     void    FillSymbolSets(ComboBox &rComboBox, bool bDeleteText = true);
-    void    FillFonts(bool bDeleteText = true);
-    void    FillStyles(bool bDeleteText = true);
+    void    FillFonts();
+    void    FillStyles();
 
     void    SetSymbolSetManager(const SmSymbolManager &rMgr);
     void    SetFont(const OUString &rFontName, const OUString &rStyleName);
diff --git a/starmath/source/cursor.cxx b/starmath/source/cursor.cxx
index 355336c..4694254 100644
--- a/starmath/source/cursor.cxx
+++ b/starmath/source/cursor.cxx
@@ -587,7 +587,7 @@ void SmCursor::InsertSubSup(SmSubSup eSubSup) {
     FinishEdit(pLineList, pLineParent, nParentIndex, PosAfterScript, pScriptLine);
 }
 
-bool SmCursor::InsertLimit(SmSubSup eSubSup, bool bMoveCaret) {
+bool SmCursor::InsertLimit(SmSubSup eSubSup) {
     //Find a subject to set limits on
     SmOperNode *pSubject = nullptr;
     //Check if pSelectedNode might be a subject
@@ -629,7 +629,7 @@ bool SmCursor::InsertLimit(SmSubSup eSubSup, bool bMoveCaret) {
         pSubSup->SetSubSup(eSubSup, pLine);
         PosAfterLimit = SmCaretPos(pLine, 1);
     //If it's already there... let's move the caret
-    } else if(bMoveCaret){
+    } else {
         pLine = pSubSup->GetSubSup(eSubSup);
         SmNodeList* pLineList = NodeToList(pLine);
         if(pLineList->size() > 0)
@@ -644,9 +644,8 @@ bool SmCursor::InsertLimit(SmSubSup eSubSup, bool bMoveCaret) {
     AnnotateSelection();
 
     //Set caret position
-    if(bMoveCaret)
-        if(!SetCaretPosition(PosAfterLimit, true))
-            SetCaretPosition(SmCaretPos(pLine, 0), true);
+    if(!SetCaretPosition(PosAfterLimit, true))
+        SetCaretPosition(SmCaretPos(pLine, 0), true);
 
     EndEdit();
 
@@ -1539,33 +1538,29 @@ bool SmCursor::IsAtTailOfBracket(SmBracketType eBracketType, SmBraceNode** ppBra
     return true;
 }
 
-void SmCursor::MoveAfterBracket(SmBraceNode* pBraceNode, bool bMoveAnchor)
+void SmCursor::MoveAfterBracket(SmBraceNode* pBraceNode)
 {
     mpPosition->CaretPos.pSelectedNode = pBraceNode;
     mpPosition->CaretPos.Index = 1;
-    if (bMoveAnchor) {
-        mpAnchor->CaretPos.pSelectedNode = pBraceNode;
-        mpAnchor->CaretPos.Index = 1;
-    }
+    mpAnchor->CaretPos.pSelectedNode = pBraceNode;
+    mpAnchor->CaretPos.Index = 1;
     RequestRepaint();
 }
 
 
 /////////////////////////////////////// SmNodeListParser
 
-SmNode* SmNodeListParser::Parse(SmNodeList* list, bool bDeleteErrorNodes){
+SmNode* SmNodeListParser::Parse(SmNodeList* list){
     pList = list;
-    if(bDeleteErrorNodes){
-        //Delete error nodes
-        SmNodeList::iterator it = pList->begin();
-        while(it != pList->end()) {
-            if((*it)->GetType() == NERROR){
-                //Delete and erase
-                delete *it;
-                it = pList->erase(it);
-            }else
-                ++it;
-        }
+    //Delete error nodes
+    SmNodeList::iterator it = pList->begin();
+    while(it != pList->end()) {
+        if((*it)->GetType() == NERROR){
+            //Delete and erase
+            delete *it;
+            it = pList->erase(it);
+        }else
+            ++it;
     }
     SmNode* retval = Expression();
     pList = nullptr;
diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx
index 19b8d0d..9a55ef7 100644
--- a/starmath/source/dialog.cxx
+++ b/starmath/source/dialog.cxx
@@ -1437,13 +1437,12 @@ void SmShowSymbol::SetSymbol(const SmSym *pSymbol)
 }
 
 
-void SmSymbolDialog::FillSymbolSets(bool bDeleteText)
+void SmSymbolDialog::FillSymbolSets()
     // populate the entries of possible SymbolsSets in the dialog with
     // current values of the SymbolSet manager but selects none of those
 {
     m_pSymbolSets->Clear();
-    if (bDeleteText)
-        m_pSymbolSets->SetNoSelection();
+    m_pSymbolSets->SetNoSelection();
 
     std::set< OUString >  aSybolSetNames( rSymbolMgr.GetSymbolSetNames() );
     std::set< OUString >::const_iterator aIt( aSybolSetNames.begin() );
@@ -1743,11 +1742,10 @@ void SmSymDefineDialog::FillSymbolSets(ComboBox &rComboBox, bool bDeleteText)
 }
 
 
-void SmSymDefineDialog::FillFonts(bool bDelete)
+void SmSymDefineDialog::FillFonts()
 {
     pFonts->Clear();
-    if (bDelete)
-        pFonts->SetNoSelection();
+    pFonts->SetNoSelection();
 
     // Include all fonts of FontList into the font list.
     // If there are duplicates, only include one entry of each font since the style will be
@@ -1761,11 +1759,10 @@ void SmSymDefineDialog::FillFonts(bool bDelete)
 }
 
 
-void SmSymDefineDialog::FillStyles(bool bDeleteText)
+void SmSymDefineDialog::FillStyles()
 {
     pStyles->Clear();
-    if (bDeleteText)
-        pStyles->SetText(OUString());
+    pStyles->SetText(OUString());
 
     OUString aText (pFonts->GetSelectEntry());
     if (!aText.isEmpty())
commit 1685ff1478b6ded2d9d23120cbd2e3dc3fe97ea7
Author: Noel Grandin <noel at peralex.com>
Date:   Tue Mar 1 11:24:49 2016 +0200

    loplugin:unuseddefaultparam in svgio
    
    Change-Id: I47fe88cd8c943acb9162cdfca53fb5fdbaacec04

diff --git a/svgio/inc/svgio/svgreader/svgmarkernode.hxx b/svgio/inc/svgio/svgreader/svgmarkernode.hxx
index ee4698d..f0cca96 100644
--- a/svgio/inc/svgio/svgreader/svgmarkernode.hxx
+++ b/svgio/inc/svgio/svgreader/svgmarkernode.hxx
@@ -105,7 +105,7 @@ namespace svgio
 
             /// OrientAuto content, set if found in current context
             bool getOrientAuto() const { return mbOrientAuto; }
-            void setOrientAuto(bool bOrientAuto = true) { mbOrientAuto = bOrientAuto; }
+            void setOrientAuto() { mbOrientAuto = true; }
 
         };
     } // end of namespace svgreader
diff --git a/svgio/inc/svgio/svgreader/svgtools.hxx b/svgio/inc/svgio/svgreader/svgtools.hxx
index 82f6d00..4c940ee 100644
--- a/svgio/inc/svgio/svgreader/svgtools.hxx
+++ b/svgio/inc/svgio/svgreader/svgtools.hxx
@@ -206,7 +206,7 @@ namespace svgio
         bool readSvgPaint(const OUString& rCandidate, SvgPaint& rSvgPaint, OUString& rURL, bool bCaseIndependent, SvgNumber& rOpacity);
 
         bool readSvgNumberVector(const OUString& rCandidate, SvgNumberVector& rSvgNumberVector);
-        ::std::vector< double > solveSvgNumberVector(const SvgNumberVector& rInput, const InfoProvider& rInfoProvider, NumberType aNumberType = length);
+        ::std::vector< double > solveSvgNumberVector(const SvgNumberVector& rInput, const InfoProvider& rInfoProvider);
 
         SvgAspectRatio readSvgAspectRatio(const OUString& rCandidate);
 
diff --git a/svgio/source/svgreader/svgtools.cxx b/svgio/source/svgreader/svgtools.cxx
index db5e163..3783d40 100644
--- a/svgio/source/svgreader/svgtools.cxx
+++ b/svgio/source/svgreader/svgtools.cxx
@@ -1682,7 +1682,7 @@ namespace svgio
             return rCandidate;
         }
 
-        ::std::vector< double > solveSvgNumberVector(const SvgNumberVector& rInput, const InfoProvider& rInfoProvider, NumberType aNumberType)
+        ::std::vector< double > solveSvgNumberVector(const SvgNumberVector& rInput, const InfoProvider& rInfoProvider)
         {
             ::std::vector< double > aRetval;
 
@@ -1693,7 +1693,7 @@ namespace svgio
 
                 for(sal_uInt32 a(0); a < nCount; a++)
                 {
-                    aRetval.push_back(rInput[a].solve(rInfoProvider, aNumberType));
+                    aRetval.push_back(rInput[a].solve(rInfoProvider));
                 }
             }
 
commit b3483a07bc49d6726480a4ac76473bbee5a535d5
Author: Noel Grandin <noel at peralex.com>
Date:   Tue Mar 1 09:20:17 2016 +0200

    loplugin:unuseddefaultparam in store
    
    Change-Id: I825eb075b73daa5bf52e1d41c32cf2100abebe47

diff --git a/include/store/store.hxx b/include/store/store.hxx
index e463a36..5800169 100644
--- a/include/store/store.hxx
+++ b/include/store/store.hxx
@@ -323,15 +323,14 @@ public:
     /** Open the temporary file in memory.
         @see store_createMemoryFile()
      */
-    inline storeError createInMemory (
-        sal_uInt16 nPageSize = STORE_DEFAULT_PAGESIZE)
+    inline storeError createInMemory ()
     {
         if (m_hImpl)
         {
             (void) store_releaseHandle (m_hImpl);
             m_hImpl = nullptr;
         }
-        return store_createMemoryFile (nPageSize, &m_hImpl);
+        return store_createMemoryFile (STORE_DEFAULT_PAGESIZE, &m_hImpl);
     }
 
     /** Close the file.
diff --git a/store/source/storbios.cxx b/store/source/storbios.cxx
index 564fe41..ae6c0ae 100644
--- a/store/source/storbios.cxx
+++ b/store/source/storbios.cxx
@@ -443,7 +443,7 @@ public:
   static AceCache & get();
 
   OStorePageBIOS::Ace *
-  create (sal_uInt32 addr, sal_uInt32 used = 1);
+  create (sal_uInt32 addr);
 
   void
   destroy (OStorePageBIOS::Ace * ace);
@@ -491,7 +491,7 @@ OStorePageBIOS::AceCache::~AceCache()
 }
 
 OStorePageBIOS::Ace *
-OStorePageBIOS::AceCache::create (sal_uInt32 addr, sal_uInt32 used)
+OStorePageBIOS::AceCache::create (sal_uInt32 addr)
 {
   Ace * ace = static_cast<Ace*>(rtl_cache_alloc (m_ace_cache));
   if (ace != nullptr)
@@ -501,7 +501,7 @@ OStorePageBIOS::AceCache::create (sal_uInt32 addr, sal_uInt32 used)
 
     // initialize.
     ace->m_addr = addr;
-    ace->m_used = used;
+    ace->m_used = 1;
   }
   return ace;
 }
@@ -791,7 +791,7 @@ storeError OStorePageBIOS::releasePage (const OStorePageDescriptor& rDescr)
  * Precond: initialized, writeable.
  */
 storeError OStorePageBIOS::allocate (
-    OStorePageObject& rPage, Allocation eAlloc)
+    OStorePageObject& rPage)
 {
     // Acquire exclusive access.
     osl::MutexGuard aGuard (m_aMutex);
@@ -804,25 +804,22 @@ storeError OStorePageBIOS::allocate (
 
     // Check allocation type.
     storeError eErrCode = store_E_None;
-    if (eAlloc != ALLOCATE_EOF)
+    // Try freelist head.
+    PageData aPageHead;
+    eErrCode = m_pSuper->unusedHead (*this, aPageHead);
+    if (eErrCode != store_E_None)
+        return eErrCode;
+
+    sal_uInt32 const nAddr = aPageHead.location();
+    if (nAddr != STORE_PAGE_NULL)
     {
-        // Try freelist head.
-        PageData aPageHead;
-        eErrCode = m_pSuper->unusedHead (*this, aPageHead);
+        // Save page.
+        eErrCode = saveObjectAt_Impl (rPage, nAddr);
         if (eErrCode != store_E_None)
             return eErrCode;
 
-        sal_uInt32 const nAddr = aPageHead.location();
-        if (nAddr != STORE_PAGE_NULL)
-        {
-            // Save page.
-            eErrCode = saveObjectAt_Impl (rPage, nAddr);
-            if (eErrCode != store_E_None)
-                return eErrCode;
-
-            // Pop freelist head and finish.
-            return m_pSuper->unusedPop (*this, aPageHead);
-        }
+        // Pop freelist head and finish.
+        return m_pSuper->unusedPop (*this, aPageHead);
     }
 
     // Allocate from EOF. Determine current size.
diff --git a/store/source/storbios.hxx b/store/source/storbios.hxx
index 36b2b65..ebb9ef6 100644
--- a/store/source/storbios.hxx
+++ b/store/source/storbios.hxx
@@ -92,17 +92,7 @@ public:
 
     storeError releasePage (const OStorePageDescriptor& rDescr);
 
-    /** Page Allocation.
-     */
-    enum Allocation
-    {
-        ALLOCATE_FIRST = 0,
-        ALLOCATE_BEST  = 1,
-        ALLOCATE_EOF   = 2
-    };
-
-    storeError allocate (
-        OStorePageObject& rPage, Allocation eAllocation = ALLOCATE_FIRST);
+    storeError allocate (OStorePageObject& rPage);
 
     storeError free (sal_uInt32 nAddr);
 


More information about the Libreoffice-commits mailing list