summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorNiklas Nebel <nn@openoffice.org>2011-03-10 18:04:50 +0100
committerNiklas Nebel <nn@openoffice.org>2011-03-10 18:04:50 +0100
commitde8ad25e0efc05f6ebc083349fc53f99563de6bd (patch)
tree30caeb0ce3eae93de0a7fad458c8424776c4d12c /sc
parent8440baa184e67db9538ca6a18902bbd9a3949050 (diff)
calc66: #o11817313# disable automatic line breaks only for 'General' number format
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/data/column2.cxx10
-rw-r--r--sc/source/ui/view/output2.cxx23
2 files changed, 9 insertions, 24 deletions
diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx
index 0cffd3bef163..1ba47c24581d 100644
--- a/sc/source/core/data/column2.cxx
+++ b/sc/source/core/data/column2.cxx
@@ -244,8 +244,10 @@ long ScColumn::GetNeededSize( SCROW nRow, OutputDevice* pDev,
else
bBreak = ((const SfxBoolItem&)pPattern->GetItem(ATTR_LINEBREAK)).GetValue();
- if (pCell->HasValueData())
- // Cell has a value. Disable line break.
+ SvNumberFormatter* pFormatter = pDocument->GetFormatTable();
+ sal_uLong nFormat = pPattern->GetNumberFormat( pFormatter, pCondSet );
+ // #i111387# #o11817313# disable automatic line breaks only for "General" number format
+ if ( bBreak && pCell->HasValueData() && ( nFormat % SV_COUNTRY_LANGUAGE_OFFSET ) == 0 )
bBreak = false;
// get other attributes from pattern and conditional formatting
@@ -332,8 +334,6 @@ long ScColumn::GetNeededSize( SCROW nRow, OutputDevice* pDev,
{
String aValStr;
Color* pColor;
- SvNumberFormatter* pFormatter = pDocument->GetFormatTable();
- sal_uLong nFormat = pPattern->GetNumberFormat( pFormatter, pCondSet );
ScCellFormat::GetString( pCell, nFormat, aValStr, &pColor,
*pFormatter,
sal_True, rOptions.bFormula, ftCheck );
@@ -493,8 +493,6 @@ long ScColumn::GetNeededSize( SCROW nRow, OutputDevice* pDev,
else
{
Color* pColor;
- SvNumberFormatter* pFormatter = pDocument->GetFormatTable();
- sal_uLong nFormat = pPattern->GetNumberFormat( pFormatter, pCondSet );
String aString;
ScCellFormat::GetString( pCell, nFormat, aString, &pColor,
*pFormatter,
diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index b1d6787d3ce6..8e64690508ea 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -75,8 +75,6 @@
#include "scmod.hxx"
#include "fillinfo.hxx"
-#include <boost/ptr_container/ptr_vector.hpp>
-
#include <math.h>
//! Autofilter-Breite mit column.cxx zusammenfassen
@@ -1361,10 +1359,6 @@ void ScOutputData::DrawStrings( sal_Bool bPixelToLogic )
const SfxItemSet* pOldCondSet = NULL;
sal_uInt8 nOldScript = 0;
- // alternative pattern instances in case we need to modify the pattern
- // before processing the cell value.
- ::boost::ptr_vector<ScPatternAttr> aAltPatterns;
-
long nPosY = nScrY;
for (SCSIZE nArrY=1; nArrY+1<nArrCount; nArrY++)
{
@@ -1501,18 +1495,6 @@ void ScOutputData::DrawStrings( sal_Bool bPixelToLogic )
pCondSet = pDoc->GetCondResult( nCellX, nCellY, nTab );
}
- if (pCell->HasValueData() &&
- static_cast<const SfxBoolItem&>(
- pPattern->GetItem(ATTR_LINEBREAK, pCondSet)).GetValue())
- {
- // Disable line break when the cell content is numeric.
- aAltPatterns.push_back(new ScPatternAttr(*pPattern));
- ScPatternAttr* pAltPattern = &aAltPatterns.back();
- SfxBoolItem aLineBreak(ATTR_LINEBREAK, false);
- pAltPattern->GetItemSet().Put(aLineBreak);
- pPattern = pAltPattern;
- }
-
sal_uInt8 nScript = GetScriptType( pDoc, pCell, pPattern, pCondSet );
if (nScript == 0) nScript = ScGlobal::GetDefaultScriptType();
if ( pPattern != pOldPattern || pCondSet != pOldCondSet ||
@@ -1562,6 +1544,11 @@ void ScOutputData::DrawStrings( sal_Bool bPixelToLogic )
eOutHorJust = SVX_HOR_JUSTIFY_LEFT; // repeat is not yet implemented
sal_Bool bBreak = ( aVars.GetLineBreak() || aVars.GetHorJust() == SVX_HOR_JUSTIFY_BLOCK );
+
+ // #i111387# #o11817313# disable automatic line breaks only for "General" number format
+ if ( bBreak && bCellIsValue && ( aVars.GetValueFormat() % SV_COUNTRY_LANGUAGE_OFFSET ) == 0 )
+ bBreak = sal_False;
+
sal_Bool bRepeat = aVars.IsRepeat() && !bBreak;
sal_Bool bShrink = aVars.IsShrink() && !bBreak && !bRepeat;