Kaydet (Commit) f3b00810 authored tarafından Andras Timar's avatar Andras Timar

trim leading (and trailing) spaces when extracting help string

and put leading spaces back on merge. It will result in cleaner
strings in .po files, and indentation of Basic code examples
will be kept more easily.

Change-Id: Icdd5cb94069f506ed0b7edf7483ccfd139f296aa
üst fa81ac50
......@@ -155,7 +155,7 @@ bool HelpParser::CreateSDF(
rtl::OUString()).
replaceAll(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\t")),
rtl::OUString()));
rtl::OUString()).trim());
sBuffer.append( sOUPrj );
sBuffer.append('\t');
if ( !rRoot_in.isEmpty())
......@@ -374,8 +374,23 @@ void HelpParser::ProcessHelp( LangHashMap* aLangHM , const rtl::OString& sCur ,
if( pEntrys != NULL)
{
rtl::OString sNewText;
rtl::OUString sSourceText(
pXMLElement->ToOUString().
replaceAll(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\n")),
rtl::OUString()).
replaceAll(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\t")),
rtl::OUString()));
// re-add spaces to the beginning of translated string,
// important for indentation of Basic code examples
sal_Int32 nPreSpaces = 0;
sal_Int32 nLen = sSourceText.getLength();
while ( (nPreSpaces < nLen) && (*(sSourceText.getStr()+nPreSpaces) == ' ') )
nPreSpaces++;
pEntrys->GetText( sNewText, STRING_TYP_TEXT, sCur , true );
rtl::OUString sNewdata(
sSourceText.copy(0,nPreSpaces) +
rtl::OStringToOUString(sNewText, RTL_TEXTENCODING_UTF8));
if (!sNewdata.isEmpty())
{
......
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