From e0a46e24bb74c1e386c01ab1b20a9c95b11dfe85 Mon Sep 17 00:00:00 2001 From: "Daniel Rentz [dr]" Date: Tue, 2 Nov 2010 17:28:24 +0100 Subject: [PATCH 1/5] calc33stopper2: #i115313# revert calculation of scaling factor for drawing layer to behaviour of OOo 3.2 --- sc/source/ui/view/drawvie4.cxx | 2 +- sc/source/ui/view/drawview.cxx | 2 +- sc/source/ui/view/gridwin3.cxx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sc/source/ui/view/drawvie4.cxx b/sc/source/ui/view/drawvie4.cxx index 3a28096d2853..d4c5d714b2ee 100644 --- a/sc/source/ui/view/drawvie4.cxx +++ b/sc/source/ui/view/drawvie4.cxx @@ -282,7 +282,7 @@ void ScDrawView::CalcNormScale( Fraction& rFractX, Fraction& rFractY ) const pDoc->GetTableArea( nTab, nEndCol, nEndRow ); if (nEndCol<20) nEndCol = 20; - if (nEndRow<1000) + if (nEndRow<20) nEndRow = 1000; Fraction aZoom(1,1); diff --git a/sc/source/ui/view/drawview.cxx b/sc/source/ui/view/drawview.cxx index 1d2b797b3a9b..489da0cc4899 100644 --- a/sc/source/ui/view/drawview.cxx +++ b/sc/source/ui/view/drawview.cxx @@ -376,7 +376,7 @@ void ScDrawView::RecalcScale() pDoc->GetTableArea( nTab, nEndCol, nEndRow ); if (nEndCol<20) nEndCol = 20; - if (nEndRow<1000) + if (nEndRow<20) nEndRow = 1000; ScDrawUtil::CalcScale( pDoc, nTab, 0,0, nEndCol,nEndRow, pDev,aZoomX,aZoomY,nPPTX,nPPTY, diff --git a/sc/source/ui/view/gridwin3.cxx b/sc/source/ui/view/gridwin3.cxx index f16c2fe1ada7..cdb7e8acfba7 100644 --- a/sc/source/ui/view/gridwin3.cxx +++ b/sc/source/ui/view/gridwin3.cxx @@ -265,7 +265,7 @@ MapMode ScGridWindow::GetDrawMapMode( BOOL bForce ) SCROW nEndRow = 0; pDoc->GetTableArea( nTab, nEndCol, nEndRow ); if (nEndCol<20) nEndCol = 20; - if (nEndRow<1000) nEndRow = 1000; + if (nEndRow<20) nEndRow = 1000; ScDrawUtil::CalcScale( pDoc, nTab, 0,0, nEndCol,nEndRow, this, pViewData->GetZoomX(),pViewData->GetZoomY(), pViewData->GetPPTX(),pViewData->GetPPTY(), From 0bccd9c15c550ae5af588fd29b948de815af376f Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Wed, 3 Nov 2010 14:41:59 -0400 Subject: [PATCH 2/5] Set correct default formula syntax value in case it's not explicitly set. When starting from a fresh config, Calc failed to assign default 'Calc A1' syntax unless the user specifically goes to the Options page and sets the formula syntax in the Calc - Formula options page. This caused e.g. print range editing to fail miserably. (fdo#31041) --- sc/source/core/tool/docoptio.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sc/source/core/tool/docoptio.cxx b/sc/source/core/tool/docoptio.cxx index e905cbe7f24d..6c89ba675049 100644 --- a/sc/source/core/tool/docoptio.cxx +++ b/sc/source/core/tool/docoptio.cxx @@ -452,7 +452,8 @@ ScDocCfg::ScDocCfg() : { case SCFORMULAOPT_GRAMMAR: { - ::formula::FormulaGrammar::Grammar eGram = ::formula::FormulaGrammar::GRAM_DEFAULT; + // Get default value in case this option is not set. + ::formula::FormulaGrammar::Grammar eGram = GetFormulaSyntax(); do { @@ -471,6 +472,8 @@ ScDocCfg::ScDocCfg() : case 2: // Excel R1C1 eGram = ::formula::FormulaGrammar::GRAM_NATIVE_XL_R1C1; break; + default: + ; } } while (false); From f993674c110a0357efde3cbe350128c183551211 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Mon, 8 Nov 2010 16:27:37 -0500 Subject: [PATCH 3/5] Fixed a crash on importing named ranges on higher sheets. When importing xls document containing named ranges on sheets higher than 256 (max number of sheets Calc supports currently), Calc would crash. We need to check for the upper boundary condition before accessing the array by index to prevent crash. (n#649941) --- sc/source/filter/excel/frmbase.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sc/source/filter/excel/frmbase.cxx b/sc/source/filter/excel/frmbase.cxx index 721ebb72f1b4..89d7c7423b68 100644 --- a/sc/source/filter/excel/frmbase.cxx +++ b/sc/source/filter/excel/frmbase.cxx @@ -104,7 +104,7 @@ void _ScRangeListTabs::Append( ScSingleRefData a, SCsTAB nTab, const BOOL b ) if( nTab < 0) nTab = a.nTab; - if( nTab >= 0 ) + if( nTab >= 0 && nTab <= MAXTAB) { _ScRangeList* p = ppTabLists[ nTab ]; @@ -169,7 +169,7 @@ void _ScRangeListTabs::Append( ScComplexRefData a, SCsTAB nTab, const BOOL b ) if( nTab < -1) nTab = a.Ref1.nTab; - if( nTab >= 0 ) + if( nTab >= 0 && nTab <= MAXTAB) { _ScRangeList* p = ppTabLists[ nTab ]; From 448f3b3c14e76eda64e53d5a5d209d59326c2e92 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Fri, 5 Nov 2010 11:10:11 +0200 Subject: [PATCH 4/5] Fix Windows build error Include explicitly, surrounded by the prewin.h and postwin.h headers. Also #undef ERROR to avoid a clash. Approved by caolan. --- sc/qa/unit/ucalc.cxx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index 307b9745be2b..7d42a218f854 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -16,6 +16,13 @@ // the need for manually calling regcomp and knowing what // services we need, and in what .so they are implemented +#ifdef WNT +# include +# include +# include +# undef ERROR +#endif + #include "sal/config.h" #include