summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/source/ui/inc/viewdata.hxx1
-rw-r--r--sc/source/ui/view/viewdata.cxx40
2 files changed, 8 insertions, 33 deletions
diff --git a/sc/source/ui/inc/viewdata.hxx b/sc/source/ui/inc/viewdata.hxx
index 683e985edc2f..4623b24439e8 100644
--- a/sc/source/ui/inc/viewdata.hxx
+++ b/sc/source/ui/inc/viewdata.hxx
@@ -156,6 +156,7 @@ class SC_DLLPUBLIC ScViewData
{
private:
double nPPTX, nPPTY; // Scaling factors
+ MapMode maPaintMapMode;
::std::vector<ScViewDataTable*> maTabData;
boost::scoped_ptr<ScMarkData> mpMarkData;
diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index d7c25b2c146a..6db5e5657be3 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -2151,42 +2151,16 @@ void ScViewData::UpdateScreenZoom( const Fraction& rNewX, const Fraction& rNewY
void ScViewData::CalcPPT()
{
- nPPTX = ScGlobal::nScreenPPTX * (double) GetZoomX();
- if (pDocShell)
- nPPTX = nPPTX / pDocShell->GetOutputFactor(); // Faktor ist Drucker zu Bildschirm
- nPPTY = ScGlobal::nScreenPPTY * (double) GetZoomY();
-
- // if detective objects are present,
- // try to adjust horizontal scale so the most common column width has minimal rounding errors,
- // to avoid differences between cell and drawing layer output
+ maPaintMapMode.SetMapUnit( MAP_TWIP );
- if ( pDoc && pDoc->HasDetectiveObjects(nTabNo) )
+ Fraction aScaleX = GetZoomX() * Fraction(0.96);
+ if ( pDocShell )
{
- SCCOL nEndCol = 0;
- SCROW nDummy = 0;
- pDoc->GetTableArea( nTabNo, nEndCol, nDummy );
- if (nEndCol<20)
- nEndCol = 20; // same end position as when determining draw scale
-
- sal_uInt16 nTwips = pDoc->GetCommonWidth( nEndCol, nTabNo );
- if ( nTwips )
- {
- double fOriginal = nTwips * nPPTX;
- if ( fOriginal < static_cast<double>(nEndCol) )
- {
- // if one column is smaller than the column count,
- // rounding errors are likely to add up to a whole column.
-
- double fRounded = ::rtl::math::approxFloor( fOriginal + 0.5 );
- if ( fRounded > 0.0 )
- {
- double fScale = fRounded / fOriginal + 1E-6;
- if ( fScale >= 0.9 && fScale <= 1.1 )
- nPPTX *= fScale;
- }
- }
- }
+ aScaleX /= pDocShell->GetOutputFactor();
}
+
+ maPaintMapMode.SetScaleX( aScaleX );
+ maPaintMapMode.SetScaleY( GetZoomY() * Fraction(0.96) );
}
#define SC_OLD_TABSEP '/'