Kaydet (Commit) 45c7ae2b authored tarafından Eike Rathke's avatar Eike Rathke

sensible variable naming

Change-Id: I2ae662b65fe9ffd4f6aaf6441f506fb8a943bce2
üst 815b6162
...@@ -120,8 +120,8 @@ class ScDrawStringsVars ...@@ -120,8 +120,8 @@ class ScDrawStringsVars
Color aBackConfigColor; // used for ScPatternAttr::GetFont calls Color aBackConfigColor; // used for ScPatternAttr::GetFont calls
Color aTextConfigColor; Color aTextConfigColor;
sal_Int32 nPos; sal_Int32 nRepeatPos;
sal_Unicode nChar; sal_Unicode nRepeatChar;
public: public:
ScDrawStringsVars(ScOutputData* pData, bool bPTL); ScDrawStringsVars(ScOutputData* pData, bool bPTL);
...@@ -162,7 +162,7 @@ public: ...@@ -162,7 +162,7 @@ public:
bool GetLineBreak() const { return bLineBreak; } bool GetLineBreak() const { return bLineBreak; }
bool IsRepeat() const { return bRepeat; } bool IsRepeat() const { return bRepeat; }
bool IsShrink() const { return bShrink; } bool IsShrink() const { return bShrink; }
void RepeatToFill( long colWidth ); void RepeatToFill( long nColWidth );
long GetAscent() const { return nAscentPixel; } long GetAscent() const { return nAscentPixel; }
bool IsRotated() const { return bRotated; } bool IsRotated() const { return bRotated; }
...@@ -205,8 +205,8 @@ ScDrawStringsVars::ScDrawStringsVars(ScOutputData* pData, bool bPTL) : ...@@ -205,8 +205,8 @@ ScDrawStringsVars::ScDrawStringsVars(ScOutputData* pData, bool bPTL) :
bRepeat ( false ), bRepeat ( false ),
bShrink ( false ), bShrink ( false ),
bPixelToLogic( bPTL ), bPixelToLogic( bPTL ),
nPos( -1 ), nRepeatPos( -1 ),
nChar( 0x0 ) nRepeatChar( 0x0 )
{ {
ScModule* pScMod = SC_MOD(); ScModule* pScMod = SC_MOD();
bCellContrast = pOutput->mbUseStyleColor && bCellContrast = pOutput->mbUseStyleColor &&
...@@ -501,16 +501,16 @@ bool ScDrawStringsVars::SetText( ScRefCellValue& rCell ) ...@@ -501,16 +501,16 @@ bool ScDrawStringsVars::SetText( ScRefCellValue& rCell )
ftCheck, true ); ftCheck, true );
if ( nFormat ) if ( nFormat )
{ {
nPos = aString.indexOf( 0x1B ); nRepeatPos = aString.indexOf( 0x1B );
if ( nPos != -1 ) if ( nRepeatPos != -1 )
{ {
if (nPos + 1 == aString.getLength()) if (nRepeatPos + 1 == aString.getLength())
nPos = -1; nRepeatPos = -1;
else else
{ {
nChar = aString[ nPos + 1 ]; nRepeatChar = aString[ nRepeatPos + 1 ];
// delete placeholder and char to repeat // delete placeholder and char to repeat
aString = aString.replaceAt( nPos, 2, "" ); aString = aString.replaceAt( nRepeatPos, 2, "" );
// Do not cache/reuse a repeat-filled string, column // Do not cache/reuse a repeat-filled string, column
// widths or fonts or sizes may differ. // widths or fonts or sizes may differ.
maLastCell.clear(); maLastCell.clear();
...@@ -519,8 +519,8 @@ bool ScDrawStringsVars::SetText( ScRefCellValue& rCell ) ...@@ -519,8 +519,8 @@ bool ScDrawStringsVars::SetText( ScRefCellValue& rCell )
} }
else else
{ {
nPos = -1; nRepeatPos = -1;
nChar = 0x0; nRepeatChar = 0x0;
} }
if (aString.getLength() > DRAWTEXT_MAX) if (aString.getLength() > DRAWTEXT_MAX)
aString = aString.copy(0, DRAWTEXT_MAX); aString = aString.copy(0, DRAWTEXT_MAX);
...@@ -554,25 +554,25 @@ void ScDrawStringsVars::SetHashText() ...@@ -554,25 +554,25 @@ void ScDrawStringsVars::SetHashText()
SetAutoText(OUString("###")); SetAutoText(OUString("###"));
} }
void ScDrawStringsVars::RepeatToFill( long colWidth ) void ScDrawStringsVars::RepeatToFill( long nColWidth )
{ {
if ( nPos == -1 || nPos > aString.getLength() ) if ( nRepeatPos == -1 || nRepeatPos > aString.getLength() )
return; return;
long charWidth = pOutput->pFmtDevice->GetTextWidth(OUString(nChar)); long nCharWidth = pOutput->pFmtDevice->GetTextWidth(OUString(nRepeatChar));
if ( charWidth < 1) return; if ( nCharWidth < 1) return;
if (bPixelToLogic) if (bPixelToLogic)
colWidth = pOutput->mpRefDevice->PixelToLogic(Size(colWidth,0)).Width(); nColWidth = pOutput->mpRefDevice->PixelToLogic(Size(nColWidth,0)).Width();
// Are there restrictions on the cell type we should filter out here ? // Are there restrictions on the cell type we should filter out here ?
long aSpaceToFill = ( colWidth - aTextSize.Width() ); long nSpaceToFill = ( nColWidth - aTextSize.Width() );
if ( aSpaceToFill <= charWidth ) if ( nSpaceToFill <= nCharWidth )
return; return;
long nCharsToInsert = aSpaceToFill / charWidth; long nCharsToInsert = nSpaceToFill / nCharWidth;
OUStringBuffer aFill; OUStringBuffer aFill;
comphelper::string::padToLength(aFill, nCharsToInsert, nChar); comphelper::string::padToLength(aFill, nCharsToInsert, nRepeatChar);
aString = aString.replaceAt( nPos, 0, aFill.makeStringAndClear() ); aString = aString.replaceAt( nRepeatPos, 0, aFill.makeStringAndClear() );
TextChanged(); TextChanged();
} }
......
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