[Libreoffice-commits] .: Branch 'libreoffice-3-3' - 2 commits - sc/source
Kohei Yoshida
kohei at kemper.freedesktop.org
Fri Jan 21 06:20:36 PST 2011
sc/source/filter/excel/xistyle.cxx | 9 +++++++++
sc/source/ui/view/gridwin4.cxx | 12 +++++++-----
2 files changed, 16 insertions(+), 5 deletions(-)
New commits:
commit 96bee1507119ca0525845022019d90f0694996aa
Author: Kohei Yoshida <kyoshida at novell.com>
Date: Thu Jan 20 23:44:52 2011 -0500
Fixed incorrect page number in page preview mode. (fdo#33155)
When the window is large enough to show several 'Page X' strings,
the page number was not properly incremented. This commit fixes
it.
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index fb5158a..6a58561 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -1082,7 +1082,9 @@ void ScGridWindow::DrawPagePreview( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2,
nPageNo += ((long)nColPos)*nRowBreaks+nRowPos;
else
nPageNo += ((long)nRowPos)*nColBreaks+nColPos;
- aPageStr.SearchAndReplaceAscii("%1", String::CreateFromInt32(nPageNo));
+
+ String aThisPageStr = aPageStr; // Don't modify the original string.
+ aThisPageStr.SearchAndReplaceAscii("%1", String::CreateFromInt32(nPageNo));
if ( pEditEng )
{
@@ -1091,7 +1093,7 @@ void ScGridWindow::DrawPagePreview( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2,
pEditEng->SetDefaultItem( SvxFontHeightItem( nHeight, 100, EE_CHAR_FONTHEIGHT ) );
pEditEng->SetDefaultItem( SvxFontHeightItem( nHeight, 100, EE_CHAR_FONTHEIGHT_CJK ) );
pEditEng->SetDefaultItem( SvxFontHeightItem( nHeight, 100, EE_CHAR_FONTHEIGHT_CTL ) );
- pEditEng->SetText( aPageStr );
+ pEditEng->SetText( aThisPageStr );
Size aSize100( pEditEng->CalcTextWidth(), pEditEng->GetTextHeight() );
// 40% of width or 60% of height
@@ -1113,7 +1115,7 @@ void ScGridWindow::DrawPagePreview( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2,
// find right font size for DrawText
aFont.SetSize( Size( 0,100 ) );
pContentDev->SetFont( aFont );
- Size aSize100( pContentDev->GetTextWidth( aPageStr ), pContentDev->GetTextHeight() );
+ Size aSize100( pContentDev->GetTextWidth( aThisPageStr ), pContentDev->GetTextHeight() );
// 40% of width or 60% of height
long nSizeX = 40 * ( aPageEnd.X() - aPageStart.X() ) / aSize100.Width();
@@ -1122,10 +1124,10 @@ void ScGridWindow::DrawPagePreview( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2,
pContentDev->SetFont( aFont );
// centered output with DrawText
- Size aTextSize( pContentDev->GetTextWidth( aPageStr ), pContentDev->GetTextHeight() );
+ Size aTextSize( pContentDev->GetTextWidth( aThisPageStr ), pContentDev->GetTextHeight() );
Point aPos( (aPageStart.X()+aPageEnd.X()-aTextSize.Width())/2,
(aPageStart.Y()+aPageEnd.Y()-aTextSize.Height())/2 );
- pContentDev->DrawText( aPos, aPageStr );
+ pContentDev->DrawText( aPos, aThisPageStr );
}
}
nPrStartX = nPrEndX + 1;
commit ed46df1fcb5869818f5f74e0c7a5b19c65102e83
Author: Kohei Yoshida <kyoshida at novell.com>
Date: Wed Jan 19 00:24:24 2011 -0500
Fixed incorrect import of cell attributes from Excel documents.
When a cell with non-default formatting attribute starts with non-first
row in a column, the filter would incorrectly apply the same format to
all the cells above it if they didn't have any formats. This commit
fixes it.
diff --git a/sc/source/filter/excel/xistyle.cxx b/sc/source/filter/excel/xistyle.cxx
index 6693d6f..d9d3940 100644
--- a/sc/source/filter/excel/xistyle.cxx
+++ b/sc/source/filter/excel/xistyle.cxx
@@ -1294,7 +1294,16 @@ void XclImpXF::ApplyPatternToAttrList(
if (pPat)
{
+ // Check for a gap between the last entry and this one.
+ bool bHasGap = false;
+ if (rAttrs.empty() && nRow1 > 0)
+ // First attribute range doesn't start at row 0.
+ bHasGap = true;
+
if (!rAttrs.empty() && rAttrs.back().nRow + 1 < nRow1)
+ bHasGap = true;
+
+ if (bHasGap)
{
// Fill this gap with the default pattern.
ScAttrEntry aEntry;
More information about the Libreoffice-commits
mailing list