View | Details | Raw Unified | Return to issue 83735
Collapse All | Expand All

(-)sc/source/core/data/drwlayer.cxx (-14 / +28 lines)
Lines 118-123 Link Here
118
#include "scmod.hxx"
118
#include "scmod.hxx"
119
#include "chartarr.hxx"
119
#include "chartarr.hxx"
120
120
121
#ifndef _SV_FIELD_HXX //autogen
122
#include <vcl/field.hxx>
123
#endif
124
121
#define DET_ARROW_OFFSET	1000
125
#define DET_ARROW_OFFSET	1000
122
126
123
//	Abstand zur naechsten Zelle beim Loeschen (bShrink), damit der Anker
127
//	Abstand zur naechsten Zelle beim Loeschen (bShrink), damit der Anker
Lines 230-245 __EXPORT ScTabSizeChangedHint::~ScTabSiz Link Here
230
234
231
#define MAXMM	10000000
235
#define MAXMM	10000000
232
236
237
inline long TwipsToHmm (long nVal)
238
{
239
	return (long) MetricField::ConvertDoubleValue (nVal, 0, 0, 
240
			FUNIT_TWIP, FUNIT_100TH_MM);
241
}
242
243
inline long HmmToTwips (long nVal)
244
{
245
	return (long) MetricField::ConvertDoubleValue (nVal, 0, 0, 
246
			FUNIT_100TH_MM, FUNIT_TWIP);
247
}
248
233
inline void TwipsToMM( long& nVal )
249
inline void TwipsToMM( long& nVal )
234
{
250
{
235
	nVal = (long) ( nVal * HMM_PER_TWIPS );
251
	nVal = TwipsToHmm (nVal);
236
}
252
}
237
253
238
inline void ReverseTwipsToMM( long& nVal )
254
inline void ReverseTwipsToMM( long& nVal )
239
{
255
{
240
	//	reverse the effect of TwipsToMM - round up here (add 1)
256
	nVal = HmmToTwips (nVal);
241
242
	nVal = ((long) ( nVal / HMM_PER_TWIPS )) + 1;
243
}
257
}
244
258
245
void lcl_TwipsToMM( Point& rPoint )
259
void lcl_TwipsToMM( Point& rPoint )
Lines 670-677 void ScDrawLayer::RecalcPos( SdrObject* Link Here
670
684
671
		//	Berechnung und Werte wie in detfunc.cxx
685
		//	Berechnung und Werte wie in detfunc.cxx
672
686
673
		Size aSize( (long) ( pDoc->GetColWidth(nCol, nTab) * HMM_PER_TWIPS ),
687
		Size aSize( (long) ( TwipsToHmm( pDoc->GetColWidth(nCol, nTab) ) ),
674
					(long) ( pDoc->GetRowHeight(nRow, nTab) * HMM_PER_TWIPS ) );
688
					(long) ( TwipsToHmm( pDoc->GetRowHeight(nRow, nTab) ) ) );
675
		Rectangle aRect( aPos, aSize );
689
		Rectangle aRect( aPos, aSize );
676
		aRect.Left()	-= 250;
690
		aRect.Left()	-= 250;
677
		aRect.Right()	+= 250;
691
		aRect.Right()	+= 250;
Lines 842-857 BOOL ScDrawLayer::GetPrintArea( ScRange& Link Here
842
		SCCOL nEndCol = rRange.aEnd.Col();
856
		SCCOL nEndCol = rRange.aEnd.Col();
843
		for (i=nStartCol; i<=nEndCol; i++)
857
		for (i=nStartCol; i<=nEndCol; i++)
844
			nEndX += pDoc->GetColWidth(i,nTab);
858
			nEndX += pDoc->GetColWidth(i,nTab);
845
		nStartX = (long)(nStartX * HMM_PER_TWIPS);
859
		nStartX = TwipsToHmm( nStartX );
846
		nEndX   = (long)(nEndX   * HMM_PER_TWIPS);
860
		nEndX   = TwipsToHmm( nEndX );
847
	}
861
	}
848
	if (!bSetVer)
862
	if (!bSetVer)
849
	{
863
	{
850
		nStartY = pDoc->FastGetRowHeight( 0, rRange.aStart.Row()-1, nTab);
864
		nStartY = pDoc->FastGetRowHeight( 0, rRange.aStart.Row()-1, nTab);
851
        nEndY = nStartY + pDoc->FastGetRowHeight( rRange.aStart.Row(),
865
        nEndY = nStartY + pDoc->FastGetRowHeight( rRange.aStart.Row(),
852
                rRange.aEnd.Row(), nTab);
866
                rRange.aEnd.Row(), nTab);
853
		nStartY = (long)(nStartY * HMM_PER_TWIPS);
867
		nStartY = TwipsToHmm( nStartY );
854
		nEndY   = (long)(nEndY   * HMM_PER_TWIPS);
868
		nEndY   = TwipsToHmm( nEndY );
855
	}
869
	}
856
870
857
	if ( bNegativePage )
871
	if ( bNegativePage )
Lines 909-916 BOOL ScDrawLayer::GetPrintArea( ScRange& Link Here
909
923
910
		if (bSetHor)
924
		if (bSetHor)
911
		{
925
		{
912
			nStartX = (long) (nStartX / HMM_PER_TWIPS);
926
			nStartX = HmmToTwips( nStartX );
913
			nEndX = (long) (nEndX / HMM_PER_TWIPS);
927
			nEndX = HmmToTwips( nEndX );
914
			long nWidth;
928
			long nWidth;
915
	        SCCOL i;
929
	        SCCOL i;
916
930
Lines 927-934 BOOL ScDrawLayer::GetPrintArea( ScRange& Link Here
927
941
928
		if (bSetVer)
942
		if (bSetVer)
929
		{
943
		{
930
			nStartY = (long) (nStartY / HMM_PER_TWIPS);
944
			nStartY = HmmToTwips( nStartY );
931
			nEndY = (long) (nEndY / HMM_PER_TWIPS);
945
			nEndY = HmmToTwips( nEndY );
932
            SCROW nRow = pDoc->FastGetRowForHeight( nTab, nStartY);
946
            SCROW nRow = pDoc->FastGetRowForHeight( nTab, nStartY);
933
			rRange.aStart.SetRow( nRow>0 ? (nRow-1) : 0);
947
			rRange.aStart.SetRow( nRow>0 ? (nRow-1) : 0);
934
            nRow = pDoc->FastGetRowForHeight( nTab, nEndY);
948
            nRow = pDoc->FastGetRowForHeight( nTab, nEndY);

Return to issue 83735