Kaydet (Commit) 132138ee authored tarafından Matteo Casalin's avatar Matteo Casalin

Avoid getTokenCount()

Change-Id: I7c58295c8d0eda927dd670ca9cc5537437ed94e6
üst 5fd03b26
......@@ -26,7 +26,6 @@
#include <HtmlReader.hxx>
#include <stringconstants.hxx>
#include <strings.hxx>
#include <comphelper/string.hxx>
#include <comphelper/types.hxx>
#include <connectivity/dbtools.hxx>
#include <com/sun/star/sdb/DatabaseContext.hpp>
......@@ -357,14 +356,17 @@ bool ORTFImportExport::Write()
}
m_pStream->WriteCharPtr( "{\\fonttbl" );
sal_Int32 nTokenCount = comphelper::string::getTokenCount(aFonts, ';');
for(sal_Int32 j=0; j<nTokenCount; ++j)
if (!aFonts.isEmpty())
{
m_pStream->WriteCharPtr( "\\f" );
m_pStream->WriteInt32AsString(j);
m_pStream->WriteCharPtr( "\\fcharset0\\fnil " );
m_pStream->WriteCharPtr( aFonts.getToken(j, ';').getStr() );
m_pStream->WriteChar( ';' );
sal_Int32 nIdx{0};
sal_Int32 nTok{-1}; // to compensate pre-increment
do {
m_pStream->WriteCharPtr( "\\f" );
m_pStream->WriteInt32AsString(++nTok);
m_pStream->WriteCharPtr( "\\fcharset0\\fnil " );
m_pStream->WriteCharPtr( aFonts.getToken(0, ';', nIdx).getStr() );
m_pStream->WriteChar( ';' );
} while (nIdx>=0);
}
m_pStream->WriteChar( '}' ) ;
m_pStream->WriteCharPtr( SAL_NEWLINE_STRING );
......
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