[Libreoffice-commits] core.git: starmath/inc starmath/source

Takeshi Abe tabe at fixedpoint.jp
Fri Apr 14 04:20:38 UTC 2017


 starmath/inc/cursor.hxx     |    2 +-
 starmath/source/cursor.cxx  |   10 +++++-----
 starmath/source/dialog.cxx  |    2 +-
 starmath/source/utility.cxx |    2 +-
 4 files changed, 8 insertions(+), 8 deletions(-)

New commits:
commit 222cf76001d835961537214eba38037ef40a8aa0
Author: Takeshi Abe <tabe at fixedpoint.jp>
Date:   Fri Apr 14 12:19:04 2017 +0900

    starmath: size() > 0 -> !empty()
    
    Change-Id: Id7c73870f58ebf04c2703cdf8b3d0ffe258b2c0d
    Reviewed-on: https://gerrit.libreoffice.org/36545
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Takeshi Abe <tabe at fixedpoint.jp>

diff --git a/starmath/inc/cursor.hxx b/starmath/inc/cursor.hxx
index 39502ff9dfc5..c499b2a1de7d 100644
--- a/starmath/inc/cursor.hxx
+++ b/starmath/inc/cursor.hxx
@@ -410,7 +410,7 @@ private:
     SmNodeList* pList;
     /** Get the current terminal */
     SmNode* Terminal(){
-        if(pList->size() > 0)
+        if (!pList->empty())
             return pList->front();
         return nullptr;
     }
diff --git a/starmath/source/cursor.cxx b/starmath/source/cursor.cxx
index 86c345d28935..b077f5980133 100644
--- a/starmath/source/cursor.cxx
+++ b/starmath/source/cursor.cxx
@@ -517,7 +517,7 @@ void SmCursor::InsertSubSup(SmSubSup eSubSup) {
 
     //Find node that this should be applied to
     SmNode* pSubject;
-    bool bPatchLine = pSelectedNodesList->size() > 0; //If the line should be patched later
+    bool bPatchLine = !pSelectedNodesList->empty(); //If the line should be patched later
     if(it != pLineList->begin()) {
         --it;
         pSubject = *it;
@@ -569,7 +569,7 @@ void SmCursor::InsertSubSup(SmSubSup eSubSup) {
 
     //Find caret pos, that should be used after sub-/superscription.
     SmCaretPos PosAfterScript; //Leave invalid for first position
-    if(pScriptLineList->size() > 0)
+    if (!pScriptLineList->empty())
         PosAfterScript = SmCaretPos::GetPosAfter(pScriptLineList->back());
 
     //Parse pScriptLineList
@@ -629,7 +629,7 @@ bool SmCursor::InsertLimit(SmSubSup eSubSup) {
     } else {
         pLine = pSubSup->GetSubSup(eSubSup);
         SmNodeList* pLineList = NodeToList(pLine);
-        if(pLineList->size() > 0)
+        if (!pLineList->empty())
             PosAfterLimit = SmCaretPos::GetPosAfter(pLineList->back());
         pLine = SmNodeListParser().Parse(pLineList);
         delete pLineList;
@@ -1147,7 +1147,7 @@ void SmCursor::Copy(){
     }
 
     //Set clipboard
-    if (aClipboard.size() > 0)
+    if (!aClipboard.empty())
         maClipboard = std::move(aClipboard);
 }
 
@@ -1155,7 +1155,7 @@ void SmCursor::Paste() {
     BeginEdit();
     Delete();
 
-    if(maClipboard.size() > 0)
+    if (!maClipboard.empty())
         InsertNodes(CloneList(maClipboard));
 
     EndEdit();
diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx
index 4d7634c83703..43141395ddc6 100644
--- a/starmath/source/dialog.cxx
+++ b/starmath/source/dialog.cxx
@@ -1590,7 +1590,7 @@ bool SmSymbolDialog::SelectSymbolSet(const OUString &rSymbolSetName)
                    } );
 
         m_pSymbolSetDisplay->SetSymbolSet( aSymbolSet );
-        if (aSymbolSet.size() > 0)
+        if (!aSymbolSet.empty())
             SelectSymbol(0);
 
         bRet = true;
diff --git a/starmath/source/utility.cxx b/starmath/source/utility.cxx
index 6ef71fb55326..0d1df8ba7058 100644
--- a/starmath/source/utility.cxx
+++ b/starmath/source/utility.cxx
@@ -153,7 +153,7 @@ SmFontPickListBox& SmFontPickListBox::operator=(const SmFontPickList& rList)
     for (decltype(aFontVec)::size_type nPos = 0; nPos < aFontVec.size(); nPos++)
         InsertEntry(lcl_GetStringItem(aFontVec[nPos]), nPos);
 
-    if (aFontVec.size() > 0)
+    if (!aFontVec.empty())
         SelectEntry(lcl_GetStringItem(aFontVec.front()));
 
     return *this;


More information about the Libreoffice-commits mailing list