diff options
author | Noel Grandin <noel@peralex.com> | 2013-11-20 10:05:20 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-11-20 10:07:32 +0200 |
commit | 1730df0127ff230cf6c89f4815f5b59c8603fa2b (patch) | |
tree | 4d5b32ea155c173fe3cfd905bb148e0998286d9a /sc/source | |
parent | 52bbd9cc00b5a1e15e4f96b5c5fa5e75855692c1 (diff) |
remove unnecessary RTL_CONSTASCII_STRINGPARAM in OString::append
Convert code like:
aOStringBuf.append( RTL_CONSTASCII_STRINGPARAM( " is missing )") );
to:
aOStringBuf.append( " is missing )" );
which compiles down to the same code.
Change-Id: I3d8ed0cbf96a881686524a167412d5f303c06b71
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/core/data/attarray.cxx | 3 | ||||
-rw-r--r-- | sc/source/core/data/formulacell.cxx | 15 | ||||
-rw-r--r-- | sc/source/core/tool/interpr2.cxx | 48 | ||||
-rw-r--r-- | sc/source/filter/html/htmlexp.cxx | 47 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh3.cxx | 2 |
5 files changed, 55 insertions, 60 deletions
diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx index e9bfa5969a41..cee38bb8823d 100644 --- a/sc/source/core/data/attarray.cxx +++ b/sc/source/core/data/attarray.cxx @@ -100,8 +100,7 @@ void ScAttrArray::TestData() const { OStringBuffer aMsg; aMsg.append(static_cast<sal_Int32>(nErr)); - aMsg.append(RTL_CONSTASCII_STRINGPARAM( - " errors in attribute array, column ")); + aMsg.append(" errors in attribute array, column "); aMsg.append(static_cast<sal_Int32>(nCol)); OSL_FAIL(aMsg.getStr()); } diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx index c067976a7418..ab6dda9799ff 100644 --- a/sc/source/core/data/formulacell.cxx +++ b/sc/source/core/data/formulacell.cxx @@ -2063,11 +2063,10 @@ sal_uInt16 ScFormulaCell::GetMatrixEdge( ScAddress& rOrgPos ) const else { #if OSL_DEBUG_LEVEL > 0 - OStringBuffer aMsg(RTL_CONSTASCII_STRINGPARAM( - "broken Matrix, no MatFormula at origin, Pos: ")); + OStringBuffer aMsg("broken Matrix, no MatFormula at origin, Pos: "); OUString aTmp(aPos.Format(SCA_VALID_COL | SCA_VALID_ROW, pDocument)); aMsg.append(OUStringToOString(aTmp, RTL_TEXTENCODING_ASCII_US)); - aMsg.append(RTL_CONSTASCII_STRINGPARAM(", MatOrg: ")); + aMsg.append(", MatOrg: "); aTmp = aOrg.Format(SCA_VALID_COL | SCA_VALID_ROW, pDocument); aMsg.append(OUStringToOString(aTmp, RTL_TEXTENCODING_ASCII_US)); OSL_FAIL(aMsg.getStr()); @@ -2098,16 +2097,16 @@ sal_uInt16 ScFormulaCell::GetMatrixEdge( ScAddress& rOrgPos ) const OStringBuffer aMsg( "broken Matrix, Pos: " ); OUString aTmp(aPos.Format(SCA_VALID_COL | SCA_VALID_ROW, pDocument)); aMsg.append(OUStringToOString(aTmp, RTL_TEXTENCODING_UTF8 )); - aMsg.append(RTL_CONSTASCII_STRINGPARAM(", MatOrg: ")); + aMsg.append(", MatOrg: "); aTmp = aOrg.Format(SCA_VALID_COL | SCA_VALID_ROW, pDocument); aMsg.append(OUStringToOString(aTmp, RTL_TEXTENCODING_UTF8 )); - aMsg.append(RTL_CONSTASCII_STRINGPARAM(", MatCols: ")); + aMsg.append(", MatCols: "); aMsg.append(static_cast<sal_Int32>( nC )); - aMsg.append(RTL_CONSTASCII_STRINGPARAM(", MatRows: ")); + aMsg.append(", MatRows: "); aMsg.append(static_cast<sal_Int32>( nR )); - aMsg.append(RTL_CONSTASCII_STRINGPARAM(", DiffCols: ")); + aMsg.append(", DiffCols: "); aMsg.append(static_cast<sal_Int32>( dC )); - aMsg.append(RTL_CONSTASCII_STRINGPARAM(", DiffRows: ")); + aMsg.append(", DiffRows: "); aMsg.append(static_cast<sal_Int32>( dR )); OSL_FAIL( aMsg.makeStringAndClear().getStr()); } diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx index e7198c4e09b2..27b0af9fc370 100644 --- a/sc/source/core/tool/interpr2.cxx +++ b/sc/source/core/tool/interpr2.cxx @@ -2667,16 +2667,16 @@ void lclAppendDigit( OStringBuffer& rText, sal_Int32 nDigit ) { switch( nDigit ) { - case 0: rText.append( RTL_CONSTASCII_STRINGPARAM(UTF8_TH_0) ); break; - case 1: rText.append( RTL_CONSTASCII_STRINGPARAM(UTF8_TH_1) ); break; - case 2: rText.append( RTL_CONSTASCII_STRINGPARAM(UTF8_TH_2) ); break; - case 3: rText.append( RTL_CONSTASCII_STRINGPARAM(UTF8_TH_3) ); break; - case 4: rText.append( RTL_CONSTASCII_STRINGPARAM(UTF8_TH_4) ); break; - case 5: rText.append( RTL_CONSTASCII_STRINGPARAM(UTF8_TH_5) ); break; - case 6: rText.append( RTL_CONSTASCII_STRINGPARAM(UTF8_TH_6) ); break; - case 7: rText.append( RTL_CONSTASCII_STRINGPARAM(UTF8_TH_7) ); break; - case 8: rText.append( RTL_CONSTASCII_STRINGPARAM(UTF8_TH_8) ); break; - case 9: rText.append( RTL_CONSTASCII_STRINGPARAM(UTF8_TH_9) ); break; + case 0: rText.append( UTF8_TH_0 ); break; + case 1: rText.append( UTF8_TH_1 ); break; + case 2: rText.append( UTF8_TH_2 ); break; + case 3: rText.append( UTF8_TH_3 ); break; + case 4: rText.append( UTF8_TH_4 ); break; + case 5: rText.append( UTF8_TH_5 ); break; + case 6: rText.append( UTF8_TH_6 ); break; + case 7: rText.append( UTF8_TH_7 ); break; + case 8: rText.append( UTF8_TH_8 ); break; + case 9: rText.append( UTF8_TH_9 ); break; default: OSL_FAIL( "lclAppendDigit - illegal digit" ); } } @@ -2691,10 +2691,10 @@ void lclAppendPow10( OStringBuffer& rText, sal_Int32 nDigit, sal_Int32 nPow10 ) lclAppendDigit( rText, nDigit ); switch( nPow10 ) { - case 2: rText.append( RTL_CONSTASCII_STRINGPARAM(UTF8_TH_1E2) ); break; - case 3: rText.append( RTL_CONSTASCII_STRINGPARAM(UTF8_TH_1E3) ); break; - case 4: rText.append( RTL_CONSTASCII_STRINGPARAM(UTF8_TH_1E4) ); break; - case 5: rText.append( RTL_CONSTASCII_STRINGPARAM(UTF8_TH_1E5) ); break; + case 2: rText.append( UTF8_TH_1E2 ); break; + case 3: rText.append( UTF8_TH_1E3 ); break; + case 4: rText.append( UTF8_TH_1E4 ); break; + case 5: rText.append( UTF8_TH_1E5 ); break; default: OSL_FAIL( "lclAppendPow10 - illegal power" ); } } @@ -2732,11 +2732,11 @@ void lclAppendBlock( OStringBuffer& rText, sal_Int32 nValue ) if( nTen >= 3 ) lclAppendDigit( rText, nTen ); else if( nTen == 2 ) - rText.append( RTL_CONSTASCII_STRINGPARAM(UTF8_TH_20) ); - rText.append( RTL_CONSTASCII_STRINGPARAM(UTF8_TH_10) ); + rText.append( UTF8_TH_20 ); + rText.append( UTF8_TH_10 ); } if( (nTen > 0) && (nOne == 1) ) - rText.append( RTL_CONSTASCII_STRINGPARAM(UTF8_TH_11) ); + rText.append( UTF8_TH_11 ); else if( nOne > 0 ) lclAppendDigit( rText, nOne ); } @@ -2774,7 +2774,7 @@ void ScInterpreter::ScBahtText() if( fBaht == 0.0 ) { if( nSatang == 0 ) - aText.append( RTL_CONSTASCII_STRINGPARAM(UTF8_TH_0) ); + aText.append( UTF8_TH_0 ); } else while( fBaht > 0.0 ) { @@ -2785,29 +2785,27 @@ void ScInterpreter::ScBahtText() lclAppendBlock( aBlock, nBlock ); // add leading "million", if there will come more blocks if( fBaht > 0.0 ) - aBlock.insert( - 0, OString(RTL_CONSTASCII_STRINGPARAM(UTF8_TH_1E6))); + aBlock.insert( 0, OString(UTF8_TH_1E6 ) ); aText.insert(0, aBlock.makeStringAndClear()); } if (!aText.isEmpty()) - aText.append( RTL_CONSTASCII_STRINGPARAM(UTF8_TH_BAHT) ); + aText.append( UTF8_TH_BAHT ); // generate text for Satang value if( nSatang == 0 ) { - aText.append( RTL_CONSTASCII_STRINGPARAM(UTF8_TH_DOT0) ); + aText.append( UTF8_TH_DOT0 ); } else { lclAppendBlock( aText, nSatang ); - aText.append( RTL_CONSTASCII_STRINGPARAM(UTF8_TH_SATANG) ); + aText.append( UTF8_TH_SATANG ); } // add the minus sign if( bMinus ) - aText.insert( - 0, OString(RTL_CONSTASCII_STRINGPARAM(UTF8_TH_MINUS))); + aText.insert( 0, OString( UTF8_TH_MINUS ) ); PushString( OStringToOUString(aText.makeStringAndClear(), RTL_TEXTENCODING_UTF8) ); } diff --git a/sc/source/filter/html/htmlexp.cxx b/sc/source/filter/html/htmlexp.cxx index 19910d8c5b2a..a6450cdabec2 100644 --- a/sc/source/filter/html/htmlexp.cxx +++ b/sc/source/filter/html/htmlexp.cxx @@ -150,12 +150,12 @@ static OString lcl_getColGroupString(sal_Int32 nSpan, sal_Int32 nWidth) if( nSpan > 1 ) { aByteStr.append(OOO_STRING_SVTOOLS_HTML_O_span); - aByteStr.append(RTL_CONSTASCII_STRINGPARAM("=\"")); + aByteStr.append("=\""); aByteStr.append(nSpan); - aByteStr.append(RTL_CONSTASCII_STRINGPARAM("\" ")); + aByteStr.append("\" "); } aByteStr.append(OOO_STRING_SVTOOLS_HTML_O_width); - aByteStr.append(RTL_CONSTASCII_STRINGPARAM("=\"")); + aByteStr.append("=\""); aByteStr.append(nWidth); aByteStr.append('"'); return aByteStr.makeStringAndClear(); @@ -492,28 +492,27 @@ OString ScHTMLExport::BorderToStyle(const char* pBorderName, if ( pLine ) { if ( bInsertSemicolon ) - aOut.append(RTL_CONSTASCII_STRINGPARAM("; ")); + aOut.append("; "); // which border - aOut.append(RTL_CONSTASCII_STRINGPARAM("border-")). - append(pBorderName).append(RTL_CONSTASCII_STRINGPARAM(": ")); + aOut.append("border-").append(pBorderName).append(": "); // thickness int nWidth = pLine->GetWidth(); int nPxWidth = (nWidth > 0) ? std::max(int(nWidth / TWIPS_PER_PIXEL), 1) : 0; aOut.append(static_cast<sal_Int32>(nPxWidth)). - append(RTL_CONSTASCII_STRINGPARAM("px ")); + append("px "); switch (pLine->GetBorderLineStyle()) { case table::BorderLineStyle::SOLID: - aOut.append(RTL_CONSTASCII_STRINGPARAM("solid")); + aOut.append("solid"); break; case table::BorderLineStyle::DOTTED: - aOut.append(RTL_CONSTASCII_STRINGPARAM("dotted")); + aOut.append("dotted"); break; case table::BorderLineStyle::DASHED: - aOut.append(RTL_CONSTASCII_STRINGPARAM("dashed")); + aOut.append("dashed"); break; case table::BorderLineStyle::DOUBLE: case table::BorderLineStyle::THINTHICK_SMALLGAP: @@ -522,24 +521,24 @@ OString ScHTMLExport::BorderToStyle(const char* pBorderName, case table::BorderLineStyle::THICKTHIN_SMALLGAP: case table::BorderLineStyle::THICKTHIN_MEDIUMGAP: case table::BorderLineStyle::THICKTHIN_LARGEGAP: - aOut.append(RTL_CONSTASCII_STRINGPARAM("double")); + aOut.append("double"); break; case table::BorderLineStyle::EMBOSSED: - aOut.append(RTL_CONSTASCII_STRINGPARAM("ridge")); + aOut.append("ridge"); break; case table::BorderLineStyle::ENGRAVED: - aOut.append(RTL_CONSTASCII_STRINGPARAM("groove")); + aOut.append("groove"); break; case table::BorderLineStyle::OUTSET: - aOut.append(RTL_CONSTASCII_STRINGPARAM("outset")); + aOut.append("outset"); break; case table::BorderLineStyle::INSET: - aOut.append(RTL_CONSTASCII_STRINGPARAM("inset")); + aOut.append("inset"); break; default: - aOut.append(RTL_CONSTASCII_STRINGPARAM("hidden")); + aOut.append("hidden"); } - aOut.append(RTL_CONSTASCII_STRINGPARAM(" #")); + aOut.append(" #"); // color char hex[7]; @@ -717,18 +716,18 @@ void ScHTMLExport::WriteTables() if ( bTabAlignedLeft ) { aByteStrOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_align). - append(RTL_CONSTASCII_STRINGPARAM("=\"")). + append("=\""). append(OOO_STRING_SVTOOLS_HTML_AL_left).append('"'); } // ALIGN=LEFT allow text and graphics to flow around // CELLSPACING aByteStrOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_cellspacing). - append(RTL_CONSTASCII_STRINGPARAM("=\"")). + append("=\""). append(static_cast<sal_Int32>(nCellSpacing)).append('"'); // BORDER=0, we do the styling of the cells in <TD> aByteStrOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_border). - append(RTL_CONSTASCII_STRINGPARAM("=\"0\"")); + append("=\"0\""); IncIndent(1); TAG_ON_LF( aByteStrOut.makeStringAndClear().getStr() ); // --- <COLGROUP> ---- @@ -882,7 +881,7 @@ void ScHTMLExport::WriteCell( SCCOL nCol, SCROW nRow, SCTAB nTab ) if ( pBorder && (pBorder->GetTop() || pBorder->GetBottom() || pBorder->GetLeft() || pBorder->GetRight()) ) { aStrTD.append(' ').append(OOO_STRING_SVTOOLS_HTML_style). - append(RTL_CONSTASCII_STRINGPARAM("=\"")); + append("=\""); bool bInsertSemicolon = false; aStrTD.append(BorderToStyle("top", pBorder->GetTop(), @@ -942,7 +941,7 @@ void ScHTMLExport::WriteCell( SCCOL nCol, SCROW nRow, SCTAB nTab ) if ( bTableDataHeight ) { aStrTD.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_height). - append(RTL_CONSTASCII_STRINGPARAM("=\"")). + append("=\""). append(static_cast<sal_Int32>(nHeightPixel)).append('"'); } @@ -1017,7 +1016,7 @@ void ScHTMLExport::WriteCell( SCCOL nCol, SCROW nRow, SCTAB nTab ) } aStrTD.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_align). - append(RTL_CONSTASCII_STRINGPARAM("=\"")).append(pChar).append('"'); + append("=\"").append(pChar).append('"'); switch( rVerJustifyItem.GetValue() ) { @@ -1074,7 +1073,7 @@ void ScHTMLExport::WriteCell( SCCOL nCol, SCROW nRow, SCTAB nTab ) if ( bSetFontName ) { aStr.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_face). - append(RTL_CONSTASCII_STRINGPARAM("=\"")); + append("=\""); sal_Int32 nFonts = comphelper::string::getTokenCount(rFontItem.GetFamilyName(), ';'); if ( nFonts == 1 ) { diff --git a/sc/source/ui/docshell/docsh3.cxx b/sc/source/ui/docshell/docsh3.cxx index 3d785c612a22..1251a2b89a86 100644 --- a/sc/source/ui/docshell/docsh3.cxx +++ b/sc/source/ui/docshell/docsh3.cxx @@ -943,7 +943,7 @@ void ScDocShell::MergeDocument( ScDocument& rOtherDoc, bool bShared, bool bCheck ((const ScChangeActionContent*)pSourceAction)->GetNewString( aValue, &aDocument ); OStringBuffer aError(OUStringToOString(aValue, osl_getThreadTextEncoding())); - aError.append(RTL_CONSTASCII_STRINGPARAM(" weggelassen")); + aError.append(" weggelassen"); OSL_FAIL( aError.getStr() ); #endif } |