From fb754a0df859e30255c25af8fa19bfaa75f257e7 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 14 Nov 2011 12:19:09 +0000 Subject: original would unconditionally truncate to nLen --- sc/source/ui/docshell/docsh.cxx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'sc') diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index 4a0981d43658..65fccaafd7d8 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -1612,10 +1612,17 @@ void lcl_ScDocShell_GetFixedWidthString( rtl::OUString& rStr, const ScDocument& rtl::OUString aString = rStr; sal_Int32 nLen = lcl_ScDocShell_GetColWidthInChars( rDoc.GetColWidth( nCol, nTab ) ); + //If the text won't fit in the column if ( nLen < aString.getLength() ) { - if ( bValue ) - aString = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "###" )); + rtl::OUStringBuffer aReplacement; + 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() ) { -- cgit option> LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
path: root/writerperfect/AllLangResTarget_writerperfect.mk
AgeCommit message (Expand)Author
2016-02-15make charset sel. dlg translatableDavid Tardon