summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorPhilipp Lohmann [pl] <Philipp.Lohmann@Oracle.COM>2010-11-24 18:50:17 +0100
committerPhilipp Lohmann [pl] <Philipp.Lohmann@Oracle.COM>2010-11-24 18:50:17 +0100
commit66c01160a736c575f47816819b15d4388dfa5f4e (patch)
tree2e505d54404c7d9f3a5bdd599a6e72225953e9f7 /sc
parent2d0f40ce04bdcc067793bed89395c4e1c3ebf348 (diff)
parented82e3fdceba985d06ace98120a8b8bb1f13045a (diff)
merge with DEV300_m94
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/data/documen4.cxx7
-rw-r--r--[-rwxr-xr-x]sc/source/core/data/dptablecache.cxx14
-rw-r--r--sc/source/ui/miscdlgs/acredlin.cxx2
-rw-r--r--sc/source/ui/miscdlgs/conflictsdlg.cxx2
-rw-r--r--sc/source/ui/miscdlgs/solveroptions.cxx2
-rw-r--r--sc/source/ui/navipi/content.cxx6
-rw-r--r--sc/source/ui/unoobj/docuno.cxx2
-rw-r--r--sc/source/ui/view/drawvie4.cxx2
-rw-r--r--sc/source/ui/view/drawview.cxx2
-rw-r--r--[-rwxr-xr-x]sc/source/ui/view/gridwin3.cxx2
-rw-r--r--sc/source/ui/view/output2.cxx13
11 files changed, 41 insertions, 13 deletions
diff --git a/sc/source/core/data/documen4.cxx b/sc/source/core/data/documen4.cxx
index 148cc367534c..e8b58b0f71d3 100644
--- a/sc/source/core/data/documen4.cxx
+++ b/sc/source/core/data/documen4.cxx
@@ -505,7 +505,7 @@ double ScDocument::RoundValueAsShown( double fVal, ULONG nFormat )
&& nType != NUMBERFORMAT_TIME && nType != NUMBERFORMAT_DATETIME )
{
short nPrecision;
- if ( nFormat )
+ if ((nFormat % SV_COUNTRY_LANGUAGE_OFFSET) != 0)
{
nPrecision = (short)GetFormatTable()->GetFormatPrecision( nFormat );
switch ( nType )
@@ -524,7 +524,12 @@ double ScDocument::RoundValueAsShown( double fVal, ULONG nFormat )
}
}
else
+ {
nPrecision = (short)GetDocOptions().GetStdPrecision();
+ // #i115512# no rounding for automatic decimals
+ if (nPrecision == static_cast<short>(SvNumberFormatter::UNLIMITED_PRECISION))
+ return fVal;
+ }
double fRound = ::rtl::math::round( fVal, nPrecision );
if ( ::rtl::math::approxEqual( fVal, fRound ) )
return fVal; // durch Rundung hoechstens Fehler
diff --git a/sc/source/core/data/dptablecache.cxx b/sc/source/core/data/dptablecache.cxx
index 8f25b70e41b6..8d2a5ec070f5 100755..100644
--- a/sc/source/core/data/dptablecache.cxx
+++ b/sc/source/core/data/dptablecache.cxx
@@ -201,8 +201,11 @@ ScDPItemData::ScDPItemData( ScDocument* pDoc, SCROW nRow, USHORT nCol, USHORT nD
ScBaseCell* pCell = pDoc->GetCell( aPos );
if ( pCell && pCell->GetCellType() == CELLTYPE_FORMULA && ((ScFormulaCell*)pCell)->GetErrCode() )
+ {
SetString ( aDocStr ); //[SODC_19347] add liyi
//bErr = TRUE; //[SODC_19347] del liyi
+ mbFlag |= MK_ERR;
+ }
else if ( pDoc->HasValueData( nCol, nRow, nDocTab ) )
{
double fVal = pDoc->GetValue(ScAddress(nCol, nRow, nDocTab));
@@ -672,8 +675,15 @@ bool ScDPTableDataCache::ValidQuery( SCROW nRow, const ScQueryParam &rParam, BOO
{
ScQueryEntry& rEntry = rParam.GetEntry(i);
// we can only handle one single direct query
- SCROW nId = GetItemDataId( (SCCOL)rEntry.nField, nRow, FALSE );
- const ScDPItemData* pCellData = GetItemDataById( (SCCOL)rEntry.nField, nId);
+ // #i115431# nField in QueryParam is the sheet column, not the field within the source range
+ SCCOL nQueryCol = (SCCOL)rEntry.nField;
+ if ( nQueryCol < rParam.nCol1 )
+ nQueryCol = rParam.nCol1;
+ if ( nQueryCol > rParam.nCol2 )
+ nQueryCol = rParam.nCol2;
+ SCCOL nSourceField = nQueryCol - rParam.nCol1;
+ SCROW nId = GetItemDataId( nSourceField, nRow, FALSE );
+ const ScDPItemData* pCellData = GetItemDataById( nSourceField, nId );
BOOL bOk = FALSE;
BOOL bTestEqual = FALSE;
diff --git a/sc/source/ui/miscdlgs/acredlin.cxx b/sc/source/ui/miscdlgs/acredlin.cxx
index 6f59b64c52fc..d2cc5a7390cf 100644
--- a/sc/source/ui/miscdlgs/acredlin.cxx
+++ b/sc/source/ui/miscdlgs/acredlin.cxx
@@ -179,7 +179,7 @@ ScAcceptChgDlg::ScAcceptChgDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pP
pTPView->SetRejectAllClickHdl( LINK( this, ScAcceptChgDlg,RejectAllHandle));
pTPView->SetAcceptAllClickHdl( LINK(this, ScAcceptChgDlg, AcceptAllHandle));
pTheView->SetCalcView();
- pTheView->SetWindowBits(WB_HASLINES|WB_CLIPCHILDREN|WB_HASBUTTONS|WB_HASBUTTONSATROOT|WB_HSCROLL);
+ pTheView->SetStyle(pTheView->GetStyle()|WB_HASLINES|WB_CLIPCHILDREN|WB_HASBUTTONS|WB_HASBUTTONSATROOT|WB_HSCROLL);
pTheView->SetExpandingHdl( LINK(this, ScAcceptChgDlg, ExpandingHandle));
pTheView->SetSelectHdl( LINK(this, ScAcceptChgDlg, SelectHandle));
pTheView->SetDeselectHdl( LINK(this, ScAcceptChgDlg, SelectHandle));
diff --git a/sc/source/ui/miscdlgs/conflictsdlg.cxx b/sc/source/ui/miscdlgs/conflictsdlg.cxx
index 89f818e21928..5ff5ca570ee4 100644
--- a/sc/source/ui/miscdlgs/conflictsdlg.cxx
+++ b/sc/source/ui/miscdlgs/conflictsdlg.cxx
@@ -514,7 +514,7 @@ ScConflictsDlg::ScConflictsDlg( Window* pParent, ScViewData* pViewData, ScDocume
aHeader += maStrTitleDate;
maLbConflicts.InsertHeaderEntry( aHeader, HEADERBAR_APPEND, HIB_LEFT | HIB_LEFTIMAGE | HIB_VCENTER );
- maLbConflicts.SetWindowBits( WB_HASLINES | WB_CLIPCHILDREN | WB_HASBUTTONS | WB_HASBUTTONSATROOT | WB_HSCROLL );
+ maLbConflicts.SetStyle( maLbConflicts.GetStyle() | WB_HASLINES | WB_CLIPCHILDREN | WB_HASBUTTONS | WB_HASBUTTONSATROOT | WB_HSCROLL );
maLbConflicts.SetSelectionMode( MULTIPLE_SELECTION );
maLbConflicts.SetHighlightRange();
diff --git a/sc/source/ui/miscdlgs/solveroptions.cxx b/sc/source/ui/miscdlgs/solveroptions.cxx
index 418a88b3cbea..d165c2362d7e 100644
--- a/sc/source/ui/miscdlgs/solveroptions.cxx
+++ b/sc/source/ui/miscdlgs/solveroptions.cxx
@@ -145,7 +145,7 @@ ScSolverOptionsDialog::ScSolverOptionsDialog( Window* pParent,
maBtnEdit.SetClickHdl( LINK( this, ScSolverOptionsDialog, ButtonHdl ) );
- maLbSettings.SetWindowBits( WB_CLIPCHILDREN|WB_FORCE_MAKEVISIBLE );
+ maLbSettings.SetStyle( maLbSettings.GetStyle()|WB_CLIPCHILDREN|WB_FORCE_MAKEVISIBLE );
maLbSettings.SetHelpId( HID_SC_SOLVEROPTIONS_LB );
maLbSettings.SetHighlightRange();
diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx
index a417621bb303..0b991bb83220 100644
--- a/sc/source/ui/navipi/content.cxx
+++ b/sc/source/ui/navipi/content.cxx
@@ -145,6 +145,8 @@ ScContentTree::ScContentTree( Window* pParent, const ResId& rResId ) :
SetNodeDefaultImages();
SetDoubleClickHdl( LINK( this, ScContentTree, ContentDoubleClickHdl ) );
+
+ SetStyle( GetStyle() | WB_QUICK_SEARCH );
}
ScContentTree::~ScContentTree()
@@ -1327,11 +1329,11 @@ BOOL ScContentTree::LoadFile( const String& rUrl )
void ScContentTree::InitWindowBits( BOOL bButtons )
{
- WinBits nFlags = WB_CLIPCHILDREN|WB_HSCROLL;
+ WinBits nFlags = GetStyle()|WB_CLIPCHILDREN|WB_HSCROLL;
if (bButtons)
nFlags |= WB_HASBUTTONS|WB_HASBUTTONSATROOT;
- SetWindowBits( nFlags );
+ SetStyle( nFlags );
}
void ScContentTree::SetRootType( USHORT nNew )
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 6f1d44b4d516..1805daa9b5ef 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -1262,6 +1262,8 @@ void SAL_CALL ScModelObj::render( sal_Int32 nSelRenderer, const uno::Any& aSelec
rBookmarks.clear();
}
+ if ( pDrawView )
+ pDrawView->HideSdrPage();
delete pDrawView;
}
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 100755..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(),
diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index 61289cc7f931..b0df298315bf 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -529,9 +529,18 @@ void ScDrawStringsVars::SetTextToWidthOrHash( ScBaseCell* pCell, long nWidth )
// must be a value or formula cell.
return;
- if (eType == CELLTYPE_FORMULA && !static_cast<ScFormulaCell*>(pCell)->IsValue())
+ if (eType == CELLTYPE_FORMULA)
+ {
+ ScFormulaCell* pFCell = static_cast<ScFormulaCell*>(pCell);
+ if (pFCell->GetErrCode() != 0)
+ {
+ SetHashText(); // If the error string doesn't fit, always use "###"
+ return;
+ }
// If it's formula, the result must be a value.
- return;
+ if (!pFCell->IsValue())
+ return;
+ }
ULONG nFormat = GetValueFormat();
if ((nFormat % SV_COUNTRY_LANGUAGE_OFFSET) != 0)