[Libreoffice-commits] core.git: sc/source

Fakabbir Amin fakabbir at gmail.com
Wed Feb 15 14:47:23 UTC 2017


 sc/source/filter/xml/xmlstyle.cxx  |   14 +++++++-------
 sc/source/ui/app/inputhdl.cxx      |    8 ++------
 sc/source/ui/formdlg/formula.cxx   |    5 +----
 sc/source/ui/miscdlgs/acredlin.cxx |   27 ++++++++++-----------------
 sc/source/ui/view/cellsh3.cxx      |    5 +----
 sc/source/ui/view/colrowba.cxx     |    9 +++------
 sc/source/ui/view/dbfunc3.cxx      |    4 +---
 sc/source/ui/view/gridwin5.cxx     |   15 +++++++--------
 8 files changed, 32 insertions(+), 55 deletions(-)

New commits:
commit 445a3d0a8d891b872b7fb0611e98de508d4fa1ae
Author: Fakabbir Amin <fakabbir at gmail.com>
Date:   Wed Feb 15 12:09:13 2017 +0530

    tdf#100726 Improved readability in sc directory
    
    cleaning concatenation in sc directory.
    
    Change-Id: I137eb0eaf161edece272b084980e622831200803
    Reviewed-on: https://gerrit.libreoffice.org/34288
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
    Tested-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/sc/source/filter/xml/xmlstyle.cxx b/sc/source/filter/xml/xmlstyle.cxx
index 3d38967..1777058 100644
--- a/sc/source/filter/xml/xmlstyle.cxx
+++ b/sc/source/filter/xml/xmlstyle.cxx
@@ -715,9 +715,9 @@ void ScXMLAutoStylePoolP::exportStyleContent(
                                         {
                                             if (aOperator == sheet::ConditionOperator_FORMULA)
                                             {
-                                                OUString sCondition("is-true-formula(");
-                                                sCondition += xSheetCondition->getFormula1();
-                                                sCondition += ")";
+                                                OUString sCondition = "is-true-formula("
+                                                                    + xSheetCondition->getFormula1()
+                                                                    + ")";
                                                 rScXMLExport.AddAttribute(XML_NAMESPACE_STYLE, XML_CONDITION, sCondition);
                                                 rScXMLExport.AddAttribute(XML_NAMESPACE_STYLE, XML_APPLY_STYLE_NAME, rScXMLExport.EncodeStyleName( sStyleName ));
                                                 OUString sOUBaseAddress;
@@ -737,10 +737,10 @@ void ScXMLAutoStylePoolP::exportStyleContent(
                                                         sCondition = "cell-content-is-between(";
                                                     else
                                                         sCondition = "cell-content-is-not-between(";
-                                                    sCondition += xSheetCondition->getFormula1();
-                                                    sCondition += ",";
-                                                    sCondition += xSheetCondition->getFormula2();
-                                                    sCondition += ")";
+                                                    sCondition += xSheetCondition->getFormula1()
+                                                                + ","
+                                                                + xSheetCondition->getFormula2()
+                                                                + ")";
                                                 }
                                                 else
                                                 {
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 7e3c8a7..7d6e6ed 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -3082,15 +3082,11 @@ void ScInputHandler::SetReference( const ScRange& rRef, ScDocument* pDoc )
              case formula::FormulaGrammar::CONV_XL_A1 :
              case formula::FormulaGrammar::CONV_XL_OOX :
              case formula::FormulaGrammar::CONV_XL_R1C1 :
-                         aRefStr = "[\'";
-                         aRefStr += aFileName;
-                         aRefStr += "']";
+                         aRefStr = "[\'" + aFileName + "']";
                          break;
              case formula::FormulaGrammar::CONV_OOO :
              default:
-                         aRefStr = "\'";
-                         aRefStr += aFileName;
-                         aRefStr += "'#";
+                         aRefStr = "\'" + aFileName + "'#";
                          break;
         }
         aRefStr += aTmp;
diff --git a/sc/source/ui/formdlg/formula.cxx b/sc/source/ui/formdlg/formula.cxx
index 22faa17..36d9a0e 100644
--- a/sc/source/ui/formdlg/formula.cxx
+++ b/sc/source/ui/formdlg/formula.cxx
@@ -408,10 +408,7 @@ void ScFormulaDlg::SetReference( const ScRange& rRef, ScDocument* pRefDoc )
 //           OUString aFileName = pObjSh->GetMedium()->GetName();
             OUString aFileName = pObjSh->GetMedium()->GetURLObject().GetMainURL( INetURLObject::DecodeMechanism::Unambiguous );
 
-            aRefStr = "'";
-            aRefStr += aFileName;
-            aRefStr += "'#";
-            aRefStr += aTmp;
+            aRefStr = "'" + aFileName + "'#" + aTmp;
         }
         else
         {
diff --git a/sc/source/ui/miscdlgs/acredlin.cxx b/sc/source/ui/miscdlgs/acredlin.cxx
index 04e8a80..a0568a5 100644
--- a/sc/source/ui/miscdlgs/acredlin.cxx
+++ b/sc/source/ui/miscdlgs/acredlin.cxx
@@ -336,9 +336,7 @@ bool ScAcceptChgDlg::IsValidAction(const ScChangeAction* pScChangeAction)
 
     if (!aDesc.isEmpty())
     {
-        aComment += " (";
-        aComment += aDesc;
-        aComment += ")";
+        aComment += " (" + aDesc + ")";
     }
 
     if (pTheView->IsValidEntry(aUser, aDateTime, aComment))
@@ -453,9 +451,7 @@ SvTreeListEntry* ScAcceptChgDlg::InsertChangeAction(
 
     if (!aDesc.isEmpty())
     {
-        aComment +=  " (";
-        aComment += aDesc;
-        aComment += ")";
+        aComment +=  " (" + aDesc + ")";
     }
 
     aBuf.append(aComment);
@@ -602,17 +598,16 @@ SvTreeListEntry* ScAcceptChgDlg::InsertFilteredAction(
 
         aString += "\t";
         pScChangeAction->GetRefString(aRefStr, pDoc, true);
-        aString += aRefStr;
-        aString += "\t";
+        aString += aRefStr + "\t";
 
         if(!bIsGenerated)
         {
-            aString += aUser;
-            aString += "\t";
-            aString += ScGlobal::pLocaleData->getDate(aDateTime);
-            aString += " ";
-            aString += ScGlobal::pLocaleData->getTime(aDateTime);
-            aString += "\t";
+            aString += aUser
+                    + "\t"
+                    + ScGlobal::pLocaleData->getDate(aDateTime)
+                    + " "
+                    + ScGlobal::pLocaleData->getTime(aDateTime)
+                    + "\t";
         }
         else
         {
@@ -624,9 +619,7 @@ SvTreeListEntry* ScAcceptChgDlg::InsertFilteredAction(
 
         if (!aDesc.isEmpty())
         {
-            aComment += " (" ;
-            aComment += aDesc;
-            aComment += ")";
+            aComment += " (" + aDesc + ")";
         }
         if (pTheView->IsValidComment(aComment))
         {
diff --git a/sc/source/ui/view/cellsh3.cxx b/sc/source/ui/view/cellsh3.cxx
index a9f4c2a..8d46afa 100644
--- a/sc/source/ui/view/cellsh3.cxx
+++ b/sc/source/ui/view/cellsh3.cxx
@@ -460,10 +460,7 @@ void ScCellShell::Execute( SfxRequest& rReq )
 
                         OUString aTmp;
                         pDoc->GetName(nTab, aTmp);
-                        aBaseName = aTmp;
-                        aBaseName += "_";
-                        aBaseName += ScGlobal::GetRscString(STR_SCENARIO);
-                        aBaseName += "_";
+                        aBaseName = aTmp + "_" + ScGlobal::GetRscString(STR_SCENARIO) + "_";
 
                         //  first test, if the prefix is recognised as valid,
                         //  else avoid only doubles
diff --git a/sc/source/ui/view/colrowba.cxx b/sc/source/ui/view/colrowba.cxx
index 8ab6a41..70c40c4 100644
--- a/sc/source/ui/view/colrowba.cxx
+++ b/sc/source/ui/view/colrowba.cxx
@@ -40,12 +40,9 @@ static OUString lcl_MetricString( long nTwips, const OUString& rText )
 
         sal_Int64 nUserVal = MetricField::ConvertValue( nTwips*100, 1, 2, FUNIT_TWIP, eUserMet );
 
-        OUString aStr = rText;
-        aStr += " ";
-        aStr += ScGlobal::pLocaleData->getNum( nUserVal, 2 );
-        aStr += " ";
-        aStr += SdrFormatter::GetUnitStr(eUserMet);
-
+        OUString aStr = rText + " "
+                        + ScGlobal::pLocaleData->getNum( nUserVal, 2 )
+                        + " " + SdrFormatter::GetUnitStr(eUserMet);
         return aStr;
     }
 }
diff --git a/sc/source/ui/view/dbfunc3.cxx b/sc/source/ui/view/dbfunc3.cxx
index d298d39..ff4d34f 100644
--- a/sc/source/ui/view/dbfunc3.cxx
+++ b/sc/source/ui/view/dbfunc3.cxx
@@ -570,9 +570,7 @@ bool ScDBFunc::MakePivotTable(
         OUString aStr;
 
         pDoc->GetName( nSrcTab, aStr );
-        aName += "_";
-        aName += aStr;
-        aName += "_";
+        aName += "_" + aStr + "_";
 
         SCTAB nNewTab = nSrcTab+1;
 
diff --git a/sc/source/ui/view/gridwin5.cxx b/sc/source/ui/view/gridwin5.cxx
index 928c98d..c6d0af8 100644
--- a/sc/source/ui/view/gridwin5.cxx
+++ b/sc/source/ui/view/gridwin5.cxx
@@ -140,17 +140,16 @@ bool ScGridWindow::ShowNoteMarker( SCsCOL nPosX, SCsROW nPosY, bool bKeyboard )
                 bLeftEdge = true;
 
             DateTime aDT = pFound->GetDateTime();
-            aTrackText  = pFound->GetUser();
-            aTrackText += ", ";
-            aTrackText += ScGlobal::pLocaleData->getDate(aDT);
-            aTrackText += " ";
-            aTrackText += ScGlobal::pLocaleData->getTime(aDT);
-            aTrackText += ":\n";
+            aTrackText  = pFound->GetUser()
+                        + ", "
+                        + ScGlobal::pLocaleData->getDate(aDT)
+                        + " "
+                        + ScGlobal::pLocaleData->getTime(aDT)
+                        + ":\n";
             OUString aComStr=pFound->GetComment();
             if(!aComStr.isEmpty())
             {
-                aTrackText += aComStr;
-                aTrackText += "\n( ";
+                aTrackText += aComStr + "\n( ";
             }
             OUString aTmp;
             pFound->GetDescription(aTmp, pDoc);


More information about the Libreoffice-commits mailing list