Kaydet (Commit) d5415561 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:stringloop in various

Change-Id: Ia400e67108e622ae63a8d59667eae96c858f22dc
Reviewed-on: https://gerrit.libreoffice.org/58463
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst d3e7bbec
...@@ -39,6 +39,8 @@ private: ...@@ -39,6 +39,8 @@ private:
void StringLoop::run() void StringLoop::run()
{ {
// Various places are not worth changing, the code becomes too awkward
// Just exclude stuff as I go
StringRef fn(handler.getMainFileName()); StringRef fn(handler.getMainFileName());
if (loplugin::hasPathnamePrefix(fn, SRCDIR "/bridges/")) if (loplugin::hasPathnamePrefix(fn, SRCDIR "/bridges/"))
return; return;
...@@ -60,6 +62,120 @@ void StringLoop::run() ...@@ -60,6 +62,120 @@ void StringLoop::run()
return; return;
if (loplugin::isSamePathname(fn, SRCDIR "/vcl/source/control/combobox.cxx")) if (loplugin::isSamePathname(fn, SRCDIR "/vcl/source/control/combobox.cxx"))
return; return;
if (loplugin::isSamePathname(fn, SRCDIR "/vcl/source/gdi/pdfwriter_impl.cxx"))
return;
if (loplugin::hasPathnamePrefix(fn, SRCDIR "/svtools/"))
return;
if (loplugin::hasPathnamePrefix(fn, SRCDIR "/idl/"))
return;
if (loplugin::hasPathnamePrefix(fn, SRCDIR "/framework/"))
return;
if (loplugin::hasPathnamePrefix(fn, SRCDIR "/basic/"))
return;
if (loplugin::hasPathnamePrefix(fn, SRCDIR "/sfx2/"))
return;
if (loplugin::hasPathnamePrefix(fn, SRCDIR "/avmedia/"))
return;
if (loplugin::hasPathnamePrefix(fn, SRCDIR "/connectivity/"))
return;
if (loplugin::hasPathnamePrefix(fn, SRCDIR "/editeng/"))
return;
if (loplugin::hasPathnamePrefix(fn, SRCDIR "/svx/"))
return;
if (loplugin::hasPathnamePrefix(fn, SRCDIR "/basctl/"))
return;
if (loplugin::hasPathnamePrefix(fn, SRCDIR "/filter/"))
return;
if (loplugin::hasPathnamePrefix(fn, SRCDIR "/chart2/"))
return;
if (loplugin::hasPathnamePrefix(fn, SRCDIR "/cui/"))
return;
if (loplugin::hasPathnamePrefix(fn, SRCDIR "/dbaccess/"))
return;
if (loplugin::hasPathnamePrefix(fn, SRCDIR "/oox/"))
return;
if (loplugin::hasPathnamePrefix(fn, SRCDIR "/writerfilter/"))
return;
if (loplugin::hasPathnamePrefix(fn, SRCDIR "/desktop/"))
return;
if (loplugin::hasPathnamePrefix(fn, SRCDIR "/extensions/"))
return;
if (loplugin::hasPathnamePrefix(fn, SRCDIR "/dtrans/"))
return;
if (loplugin::hasPathnamePrefix(fn, SRCDIR "/i18npool/"))
return;
if (loplugin::hasPathnamePrefix(fn, SRCDIR "/embeddedobj/"))
return;
if (loplugin::hasPathnamePrefix(fn, SRCDIR "/sd/"))
return;
if (loplugin::hasPathnamePrefix(fn, SRCDIR "/xmloff/"))
return;
if (loplugin::hasPathnamePrefix(fn, SRCDIR "/xmlhelp/"))
return;
if (loplugin::hasPathnamePrefix(fn, SRCDIR "/forms/"))
return;
if (loplugin::hasPathnamePrefix(fn, SRCDIR "/sc/source/core/tool/address.cxx"))
return;
if (loplugin::hasPathnamePrefix(fn, SRCDIR "/sc/source/core/tool/compiler.cxx"))
return;
if (loplugin::hasPathnamePrefix(fn, SRCDIR "/sc/source/ui/docshell/impex.cxx"))
return;
if (loplugin::hasPathnamePrefix(fn, SRCDIR "/sc/source/ui/miscdlgs/acredlin.cxx"))
return;
if (loplugin::hasPathnamePrefix(fn, SRCDIR "/sc/source/ui/pagedlg/areasdlg.cxx"))
return;
if (loplugin::hasPathnamePrefix(fn, SRCDIR "/sc/source/ui/view/gridwin2.cxx"))
return;
if (loplugin::hasPathnamePrefix(fn, SRCDIR "/sc/source/filter/html/htmlpars.cxx"))
return;
if (loplugin::hasPathnamePrefix(fn, SRCDIR "/sw/source/core/doc/doctxm.cxx"))
return;
if (loplugin::hasPathnamePrefix(fn, SRCDIR "/sw/source/core/edit/edattr.cxx"))
return;
if (loplugin::hasPathnamePrefix(fn, SRCDIR "/sw/source/core/layout/dbg_lay.cxx"))
return;
if (loplugin::hasPathnamePrefix(fn, SRCDIR "/sw/source/filter/ascii/ascatr.cxx"))
return;
if (loplugin::hasPathnamePrefix(fn, SRCDIR "/sw/source/filter/html/htmlforw.cxx"))
return;
if (loplugin::hasPathnamePrefix(fn, SRCDIR "/sw/source/core/unocore/unosect.cxx"))
return;
if (loplugin::hasPathnamePrefix(fn, SRCDIR "/sw/source/core/unocore/unochart.cxx"))
return;
if (loplugin::hasPathnamePrefix(fn, SRCDIR "/sw/source/core/unocore/unoobj.cxx"))
return;
if (loplugin::hasPathnamePrefix(fn, SRCDIR "/sw/source/filter/html/parcss1.cxx"))
return;
if (loplugin::hasPathnamePrefix(fn, SRCDIR "/sw/source/filter/html/svxcss1.cxx"))
return;
if (loplugin::hasPathnamePrefix(fn, SRCDIR "/sw/source/filter/html/swhtml.cxx"))
return;
if (loplugin::hasPathnamePrefix(fn, SRCDIR "/sw/source/uibase/utlui/gloslst.cxx"))
return;
if (loplugin::hasPathnamePrefix(fn, SRCDIR "/sw/source/uibase/utlui/content.cxx"))
return;
if (loplugin::hasPathnamePrefix(fn, SRCDIR "/sw/source/uibase/docvw/edtwin.cxx"))
return;
if (loplugin::hasPathnamePrefix(fn, SRCDIR "/sw/source/filter/ww8/ww8atr.cxx"))
return;
if (loplugin::hasPathnamePrefix(fn, SRCDIR "/sw/source/filter/ww8/ww8scan.cxx"))
return;
if (loplugin::hasPathnamePrefix(fn, SRCDIR "/sw/source/filter/ww8/ww8par5.cxx"))
return;
if (loplugin::hasPathnamePrefix(fn, SRCDIR "/sw/source/ui/fldui/fldfunc.cxx"))
return;
if (loplugin::hasPathnamePrefix(fn, SRCDIR "/sw/source/ui/misc/bookmark.cxx"))
return;
if (loplugin::hasPathnamePrefix(fn, SRCDIR "/sw/source/ui/dbui/mmlayoutpage.cxx"))
return;
if (loplugin::hasPathnamePrefix(fn, SRCDIR "/sw/source/ui/dbui/dbinsdlg.cxx"))
return;
if (loplugin::hasPathnamePrefix(fn, SRCDIR "/sw/source/ui/dbui/mmresultdialogs.cxx"))
return;
if (loplugin::hasPathnamePrefix(fn, SRCDIR "/sw/source/ui/index/cnttab.cxx"))
return;
if (loplugin::hasPathnamePrefix(fn, SRCDIR "/ucb/source/ucp/file/bc.cxx"))
return;
TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); TraverseDecl(compiler.getASTContext().getTranslationUnitDecl());
} }
...@@ -132,11 +248,16 @@ bool StringLoop::VisitCallExpr(CallExpr const* callExpr) ...@@ -132,11 +248,16 @@ bool StringLoop::VisitCallExpr(CallExpr const* callExpr)
if (!tc.Class("OUString").Namespace("rtl").GlobalNamespace() if (!tc.Class("OUString").Namespace("rtl").GlobalNamespace()
&& !tc.Class("OString").Namespace("rtl").GlobalNamespace()) && !tc.Class("OString").Namespace("rtl").GlobalNamespace())
return true; return true;
auto fieldDecl = dyn_cast<FieldDecl>(memberExpr->getMemberDecl());
if (isInUnoIncludeFile(
compiler.getSourceManager().getSpellingLoc(fieldDecl->getLocation())))
return true;
if (ignoreLocation(compiler.getSourceManager().getSpellingLoc(fieldDecl->getLocation())))
return true;
report(DiagnosticsEngine::Warning, report(DiagnosticsEngine::Warning,
"appending to OUString in loop, rather use OUStringBuffer", "appending to OUString in loop, rather use OUStringBuffer",
operatorCallExpr->getLocStart()) operatorCallExpr->getLocStart())
<< operatorCallExpr->getSourceRange(); << operatorCallExpr->getSourceRange();
auto fieldDecl = dyn_cast<FieldDecl>(memberExpr->getMemberDecl());
report(DiagnosticsEngine::Note, "field here", fieldDecl->getLocStart()) report(DiagnosticsEngine::Note, "field here", fieldDecl->getLocStart())
<< fieldDecl->getSourceRange(); << fieldDecl->getSourceRange();
} }
......
...@@ -743,7 +743,7 @@ static OUString lcl_serializeForDisplay( const Reference< XAttr >& _rxAttrNode ) ...@@ -743,7 +743,7 @@ static OUString lcl_serializeForDisplay( const Reference< XAttr >& _rxAttrNode )
static OUString lcl_serializeForDisplay( const Reference<XNodeList>& xNodes ) static OUString lcl_serializeForDisplay( const Reference<XNodeList>& xNodes )
{ {
OUString sResult; OUStringBuffer sResult;
// create document fragment // create document fragment
Reference<XDocument> xDocument( getDocumentBuilder()->newDocument() ); Reference<XDocument> xDocument( getDocumentBuilder()->newDocument() );
...@@ -770,7 +770,7 @@ static OUString lcl_serializeForDisplay( const Reference<XNodeList>& xNodes ) ...@@ -770,7 +770,7 @@ static OUString lcl_serializeForDisplay( const Reference<XNodeList>& xNodes )
Reference< XAttr > xAttr( xCurrent, UNO_QUERY ); Reference< XAttr > xAttr( xCurrent, UNO_QUERY );
if ( xAttr.is() ) if ( xAttr.is() )
{ {
sResult += lcl_serializeForDisplay( xAttr ); sResult.append(lcl_serializeForDisplay( xAttr ));
++nAttributeNodes; ++nAttributeNodes;
} }
} }
...@@ -787,7 +787,7 @@ static OUString lcl_serializeForDisplay( const Reference<XNodeList>& xNodes ) ...@@ -787,7 +787,7 @@ static OUString lcl_serializeForDisplay( const Reference<XNodeList>& xNodes )
"lcl_serializeForDisplay: mixed attribute and non-attribute nodes?" ); "lcl_serializeForDisplay: mixed attribute and non-attribute nodes?" );
if ( nAttributeNodes ) if ( nAttributeNodes )
// had only attribute nodes // had only attribute nodes
return sResult; return sResult.makeStringAndClear();
// serialize fragment // serialize fragment
CSerializationAppXML aSerialization; CSerializationAppXML aSerialization;
...@@ -808,20 +808,19 @@ static OUString lcl_serializeForDisplay( const Reference<XNodeList>& xNodes ) ...@@ -808,20 +808,19 @@ static OUString lcl_serializeForDisplay( const Reference<XNodeList>& xNodes )
// well, the serialization prepends XML header(s) that we need to // well, the serialization prepends XML header(s) that we need to
// remove first. // remove first.
OUStringBuffer aBuffer; sResult.setLength(0);
while( ! xTextInputStream->isEOF() ) while( ! xTextInputStream->isEOF() )
{ {
OUString sLine = xTextInputStream->readLine(); OUString sLine = xTextInputStream->readLine();
if( !sLine.isEmpty() if( !sLine.isEmpty()
&& !sLine.startsWith( "<?xml" ) ) && !sLine.startsWith( "<?xml" ) )
{ {
aBuffer.append( sLine ); sResult.append( sLine );
aBuffer.append( '\n' ); sResult.append( '\n' );
} }
} }
sResult = aBuffer.makeStringAndClear();
return sResult; return sResult.makeStringAndClear();
} }
static OUString lcl_serializeForDisplay( const Reference<XXPathObject>& xResult ) static OUString lcl_serializeForDisplay( const Reference<XXPathObject>& xResult )
......
...@@ -47,7 +47,7 @@ OUString SmOoxmlImport::ConvertToStarMath() ...@@ -47,7 +47,7 @@ OUString SmOoxmlImport::ConvertToStarMath()
OUString SmOoxmlImport::handleStream() OUString SmOoxmlImport::handleStream()
{ {
m_rStream.ensureOpeningTag( M_TOKEN( oMath )); m_rStream.ensureOpeningTag( M_TOKEN( oMath ));
OUString ret; OUStringBuffer ret;
while( !m_rStream.atEnd() && m_rStream.currentToken() != CLOSING( M_TOKEN( oMath ))) while( !m_rStream.atEnd() && m_rStream.currentToken() != CLOSING( M_TOKEN( oMath )))
{ {
// strictly speaking, it is not OMathArg here, but currently supported // strictly speaking, it is not OMathArg here, but currently supported
...@@ -56,92 +56,92 @@ OUString SmOoxmlImport::handleStream() ...@@ -56,92 +56,92 @@ OUString SmOoxmlImport::handleStream()
if( item.isEmpty()) if( item.isEmpty())
continue; continue;
if( !ret.isEmpty()) if( !ret.isEmpty())
ret += " "; ret.append(" ");
ret += item; ret.append(item);
} }
m_rStream.ensureClosingTag( M_TOKEN( oMath )); m_rStream.ensureClosingTag( M_TOKEN( oMath ));
// Placeholders are written out as nothing (i.e. nothing inside e.g. the <e> element), // Placeholders are written out as nothing (i.e. nothing inside e.g. the <e> element),
// which will result in "{}" in the formula text. Fix this up. // which will result in "{}" in the formula text. Fix this up.
ret = ret.replaceAll( "{}", "<?>" ); OUString ret2 = ret.makeStringAndClear().replaceAll( "{}", "<?>" );
// And as a result, empty parts of the formula that are not placeholders are written out // And as a result, empty parts of the formula that are not placeholders are written out
// as a single space, so fix that up too. // as a single space, so fix that up too.
ret = ret.replaceAll( "{ }", "{}" ); ret2 = ret2.replaceAll( "{ }", "{}" );
SAL_INFO( "starmath.ooxml", "Formula: " << ret ); SAL_INFO( "starmath.ooxml", "Formula: " << ret2 );
return ret; return ret2;
} }
OUString SmOoxmlImport::readOMathArg( int stoptoken ) OUString SmOoxmlImport::readOMathArg( int stoptoken )
{ {
OUString ret; OUStringBuffer ret;
while( !m_rStream.atEnd() && m_rStream.currentToken() != CLOSING( stoptoken )) while( !m_rStream.atEnd() && m_rStream.currentToken() != CLOSING( stoptoken ))
{ {
if( !ret.isEmpty()) if( !ret.isEmpty())
ret += " "; ret.append(" ");
switch( m_rStream.currentToken()) switch( m_rStream.currentToken())
{ {
case OPENING( M_TOKEN( acc )): case OPENING( M_TOKEN( acc )):
ret += handleAcc(); ret.append(handleAcc());
break; break;
case OPENING( M_TOKEN( bar )): case OPENING( M_TOKEN( bar )):
ret += handleBar(); ret.append(handleBar());
break; break;
case OPENING( M_TOKEN( box )): case OPENING( M_TOKEN( box )):
ret += handleBox(); ret.append(handleBox());
break; break;
case OPENING( M_TOKEN( borderBox )): case OPENING( M_TOKEN( borderBox )):
ret += handleBorderBox(); ret.append(handleBorderBox());
break; break;
case OPENING( M_TOKEN( d )): case OPENING( M_TOKEN( d )):
ret += handleD(); ret.append(handleD());
break; break;
case OPENING( M_TOKEN( eqArr )): case OPENING( M_TOKEN( eqArr )):
ret += handleEqArr(); ret.append(handleEqArr());
break; break;
case OPENING( M_TOKEN( f )): case OPENING( M_TOKEN( f )):
ret += handleF(); ret.append(handleF());
break; break;
case OPENING( M_TOKEN( func )): case OPENING( M_TOKEN( func )):
ret += handleFunc(); ret.append(handleFunc());
break; break;
case OPENING( M_TOKEN( limLow )): case OPENING( M_TOKEN( limLow )):
ret += handleLimLowUpp( LimLow ); ret.append(handleLimLowUpp( LimLow ));
break; break;
case OPENING( M_TOKEN( limUpp )): case OPENING( M_TOKEN( limUpp )):
ret += handleLimLowUpp( LimUpp ); ret.append(handleLimLowUpp( LimUpp ));
break; break;
case OPENING( M_TOKEN( groupChr )): case OPENING( M_TOKEN( groupChr )):
ret += handleGroupChr(); ret.append(handleGroupChr());
break; break;
case OPENING( M_TOKEN( m )): case OPENING( M_TOKEN( m )):
ret += handleM(); ret.append(handleM());
break; break;
case OPENING( M_TOKEN( nary )): case OPENING( M_TOKEN( nary )):
ret += handleNary(); ret.append(handleNary());
break; break;
case OPENING( M_TOKEN( r )): case OPENING( M_TOKEN( r )):
ret += handleR(); ret.append(handleR());
break; break;
case OPENING( M_TOKEN( rad )): case OPENING( M_TOKEN( rad )):
ret += handleRad(); ret.append(handleRad());
break; break;
case OPENING( M_TOKEN( sPre )): case OPENING( M_TOKEN( sPre )):
ret += handleSpre(); ret.append(handleSpre());
break; break;
case OPENING( M_TOKEN( sSub )): case OPENING( M_TOKEN( sSub )):
ret += handleSsub(); ret.append(handleSsub());
break; break;
case OPENING( M_TOKEN( sSubSup )): case OPENING( M_TOKEN( sSubSup )):
ret += handleSsubsup(); ret.append(handleSsubsup());
break; break;
case OPENING( M_TOKEN( sSup )): case OPENING( M_TOKEN( sSup )):
ret += handleSsup(); ret.append(handleSsup());
break; break;
default: default:
m_rStream.handleUnexpectedTag(); m_rStream.handleUnexpectedTag();
break; break;
} }
} }
return ret; return ret.makeStringAndClear();
} }
OUString SmOoxmlImport::readOMathArgInElement( int token ) OUString SmOoxmlImport::readOMathArgInElement( int token )
...@@ -364,17 +364,17 @@ OUString SmOoxmlImport::handleD() ...@@ -364,17 +364,17 @@ OUString SmOoxmlImport::handleD()
OUString SmOoxmlImport::handleEqArr() OUString SmOoxmlImport::handleEqArr()
{ {
m_rStream.ensureOpeningTag( M_TOKEN( eqArr )); m_rStream.ensureOpeningTag( M_TOKEN( eqArr ));
OUString ret; OUStringBuffer ret;
do do
{ // there must be at least one m:e { // there must be at least one m:e
if( !ret.isEmpty()) if( !ret.isEmpty())
ret += "#"; ret.append("#");
ret += " "; ret.append(" ");
ret += readOMathArgInElement( M_TOKEN( e )); ret.append(readOMathArgInElement( M_TOKEN( e )));
ret += " "; ret.append(" ");
} while( !m_rStream.atEnd() && m_rStream.findTag( OPENING( M_TOKEN( e )))); } while( !m_rStream.atEnd() && m_rStream.findTag( OPENING( M_TOKEN( e ))));
m_rStream.ensureClosingTag( M_TOKEN( eqArr )); m_rStream.ensureClosingTag( M_TOKEN( eqArr ));
return "stack {" + ret + "}"; return "stack {" + ret.makeStringAndClear() + "}";
} }
OUString SmOoxmlImport::handleF() OUString SmOoxmlImport::handleF()
...@@ -473,24 +473,24 @@ OUString SmOoxmlImport::handleGroupChr() ...@@ -473,24 +473,24 @@ OUString SmOoxmlImport::handleGroupChr()
OUString SmOoxmlImport::handleM() OUString SmOoxmlImport::handleM()
{ {
m_rStream.ensureOpeningTag( M_TOKEN( m )); m_rStream.ensureOpeningTag( M_TOKEN( m ));
OUString allrows; OUStringBuffer allrows;
do // there must be at least one m:mr do // there must be at least one m:mr
{ {
m_rStream.ensureOpeningTag( M_TOKEN( mr )); m_rStream.ensureOpeningTag( M_TOKEN( mr ));
OUString row; OUStringBuffer row;
do // there must be at least one m:e do // there must be at least one m:e
{ {
if( !row.isEmpty()) if( !row.isEmpty())
row += " # "; row.append(" # ");
row += readOMathArgInElement( M_TOKEN( e )); row.append(readOMathArgInElement( M_TOKEN( e )));
} while( !m_rStream.atEnd() && m_rStream.findTag( OPENING( M_TOKEN( e )))); } while( !m_rStream.atEnd() && m_rStream.findTag( OPENING( M_TOKEN( e ))));
if( !allrows.isEmpty()) if( !allrows.isEmpty())
allrows += " ## "; allrows.append(" ## ");
allrows += row; allrows.append(row);
m_rStream.ensureClosingTag( M_TOKEN( mr )); m_rStream.ensureClosingTag( M_TOKEN( mr ));
} while( !m_rStream.atEnd() && m_rStream.findTag( OPENING( M_TOKEN( mr )))); } while( !m_rStream.atEnd() && m_rStream.findTag( OPENING( M_TOKEN( mr ))));
m_rStream.ensureClosingTag( M_TOKEN( m )); m_rStream.ensureClosingTag( M_TOKEN( m ));
return "matrix {" + allrows + "}"; return "matrix {" + allrows.makeStringAndClear() + "}";
} }
OUString SmOoxmlImport::handleNary() OUString SmOoxmlImport::handleNary()
...@@ -584,7 +584,7 @@ OUString SmOoxmlImport::handleR() ...@@ -584,7 +584,7 @@ OUString SmOoxmlImport::handleR()
} }
m_rStream.ensureClosingTag( M_TOKEN( rPr )); m_rStream.ensureClosingTag( M_TOKEN( rPr ));
} }
OUString text; OUStringBuffer text;
while( !m_rStream.atEnd() && m_rStream.currentToken() != CLOSING( m_rStream.currentToken())) while( !m_rStream.atEnd() && m_rStream.currentToken() != CLOSING( m_rStream.currentToken()))
{ {
switch( m_rStream.currentToken()) switch( m_rStream.currentToken())
...@@ -593,9 +593,9 @@ OUString SmOoxmlImport::handleR() ...@@ -593,9 +593,9 @@ OUString SmOoxmlImport::handleR()
{ {
XmlStream::Tag rtag = m_rStream.ensureOpeningTag( M_TOKEN( t )); XmlStream::Tag rtag = m_rStream.ensureOpeningTag( M_TOKEN( t ));
if( rtag.attribute( OOX_TOKEN( xml, space )) != "preserve" ) if( rtag.attribute( OOX_TOKEN( xml, space )) != "preserve" )
text += rtag.text.trim(); text.append(rtag.text.trim());
else else
text += rtag.text; text.append(rtag.text);
m_rStream.ensureClosingTag( M_TOKEN( t )); m_rStream.ensureClosingTag( M_TOKEN( t ));
break; break;
} }
...@@ -606,8 +606,11 @@ OUString SmOoxmlImport::handleR() ...@@ -606,8 +606,11 @@ OUString SmOoxmlImport::handleR()
} }
m_rStream.ensureClosingTag( M_TOKEN( r )); m_rStream.ensureClosingTag( M_TOKEN( r ));
if( normal || literal ) if( normal || literal )
text = "\"" + text + "\""; {
return text.replaceAll("{", "\\{").replaceAll("}", "\\}"); text.insert(0, "\"");
text.append("\"");
}
return text.makeStringAndClear().replaceAll("{", "\\{").replaceAll("}", "\\}");
} }
OUString SmOoxmlImport::handleRad() OUString SmOoxmlImport::handleRad()
......
...@@ -361,10 +361,10 @@ StaticModuleInformation* Databases::getStaticInformationForModule( const OUStrin ...@@ -361,10 +361,10 @@ StaticModuleInformation* Databases::getStaticInformationForModule( const OUStrin
sal_uInt64 nRead; sal_uInt64 nRead;
sal_Char buffer[2048]; sal_Char buffer[2048];
sal_Unicode lineBuffer[1028]; sal_Unicode lineBuffer[1028];
OUString fileContent; OUStringBuffer fileContent;
while( osl::FileBase::E_None == cfgFile.read( &buffer,2048,nRead ) && nRead ) while( osl::FileBase::E_None == cfgFile.read( &buffer,2048,nRead ) && nRead )
fileContent += OUString( buffer,sal_Int32( nRead ),RTL_TEXTENCODING_UTF8 ); fileContent.append(OUString( buffer,sal_Int32( nRead ),RTL_TEXTENCODING_UTF8 ));
cfgFile.close(); cfgFile.close();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment