Kaydet (Commit) fb754a0d authored tarafından Caolán McNamara's avatar Caolán McNamara

original would unconditionally truncate to nLen

üst fff1cec8
...@@ -1612,10 +1612,17 @@ void lcl_ScDocShell_GetFixedWidthString( rtl::OUString& rStr, const ScDocument& ...@@ -1612,10 +1612,17 @@ void lcl_ScDocShell_GetFixedWidthString( rtl::OUString& rStr, const ScDocument&
rtl::OUString aString = rStr; rtl::OUString aString = rStr;
sal_Int32 nLen = lcl_ScDocShell_GetColWidthInChars( sal_Int32 nLen = lcl_ScDocShell_GetColWidthInChars(
rDoc.GetColWidth( nCol, nTab ) ); rDoc.GetColWidth( nCol, nTab ) );
//If the text won't fit in the column
if ( nLen < aString.getLength() ) if ( nLen < aString.getLength() )
{ {
if ( bValue ) rtl::OUStringBuffer aReplacement;
aString = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "###" )); if (bValue)
aReplacement.appendAscii(RTL_CONSTASCII_STRINGPARAM("###"));
else
aReplacement.append(aString);
//truncate to the number of characters that should fit, even in the
//bValue case nLen might be < len ###
aString = comphelper::string::truncateToLength(aReplacement, nLen).makeStringAndClear();
} }
if ( nLen > aString.getLength() ) if ( nLen > aString.getLength() )
{ {
......
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