diff --git a/calendar/modules/ui/canvas/src/nsCalCommandCanvas.cpp b/calendar/modules/ui/canvas/src/nsCalCommandCanvas.cpp index ccff3c3a99b..0641c00cf84 100644 --- a/calendar/modules/ui/canvas/src/nsCalCommandCanvas.cpp +++ b/calendar/modules/ui/canvas/src/nsCalCommandCanvas.cpp @@ -119,11 +119,7 @@ nsresult nsCalCommandCanvas :: Init() fm->GetWidth(text,width); - float f; - - GetWidget()->GetDeviceContext()->GetTwipsToDevUnits(f); - - rect.width = width * f; + rect.width = width ; mStaticTextField->SetReadOnly(PR_TRUE); @@ -206,13 +202,10 @@ nsresult nsCalCommandCanvas :: SetBounds(const nsRect &aBounds) nsXPFCCanvas::SetBounds(aBounds); nsRect rect = aBounds; nscoord width = 0; - float f = 0.0; if (mStaticTextField) { - mStaticTextField->GetDeviceContext()->GetTwipsToDevUnits(f); - nsString text("COMMAND: "); nsFont font("Times", NS_FONT_STYLE_NORMAL, @@ -227,7 +220,7 @@ nsresult nsCalCommandCanvas :: SetBounds(const nsRect &aBounds) fm->GetWidth(text,width); - rect.width = width * f; + rect.width = width ; mStaticTextField->Invalidate(PR_FALSE); @@ -240,8 +233,8 @@ nsresult nsCalCommandCanvas :: SetBounds(const nsRect &aBounds) rect = aBounds; - rect.x += (width*f); - rect.width -= (width*f); + rect.x += (width); + rect.width -= (width); mTextField->Invalidate(PR_FALSE); diff --git a/calendar/modules/ui/canvas/src/nsCalDayViewCanvas.cpp b/calendar/modules/ui/canvas/src/nsCalDayViewCanvas.cpp index fb0d8055a40..37d3a82c5b6 100644 --- a/calendar/modules/ui/canvas/src/nsCalDayViewCanvas.cpp +++ b/calendar/modules/ui/canvas/src/nsCalDayViewCanvas.cpp @@ -289,19 +289,6 @@ nsEventStatus nsCalDayViewCanvas :: PaintForeground(nsIRenderingContext& aRender aRenderingContext.GetFontMetrics()->GetHeight(fm_height); - nsIDeviceContext * dc ; - - float f = 0.0; - - dc = aRenderingContext.GetDeviceContext(); - - dc->GetTwipsToDevUnits(f); - - fm_height *= f; - - NS_RELEASE(dc); - - if (rect.height > fm_height) { // rndctx->SetColor(GetForegroundColor()); diff --git a/calendar/modules/ui/canvas/src/nsCalTimebarTimeHeading.cpp b/calendar/modules/ui/canvas/src/nsCalTimebarTimeHeading.cpp index 420a6067cba..19686ddc242 100644 --- a/calendar/modules/ui/canvas/src/nsCalTimebarTimeHeading.cpp +++ b/calendar/modules/ui/canvas/src/nsCalTimebarTimeHeading.cpp @@ -96,19 +96,6 @@ nsEventStatus nsCalTimebarTimeHeading :: PaintForeground(nsIRenderingContext& aR aRenderingContext.GetFontMetrics()->GetHeight(height); aRenderingContext.GetFontMetrics()->GetWidth(*string,width); - nsIDeviceContext * dc ; - - float f = 0.0; - - dc = aRenderingContext.GetDeviceContext(); - - dc->GetTwipsToDevUnits(f); - - NS_RELEASE(dc); - - height *= f; - width *= f; - /* * XXX: If we are too big, remove the Day of the week. Need a better algorithm * to use string who fits to begin with @@ -119,7 +106,6 @@ nsEventStatus nsCalTimebarTimeHeading :: PaintForeground(nsIRenderingContext& aR pattern = "MMM dd\n"; GetTimeContext()->GetDTFirstVisible()->strftime(pattern, &string); aRenderingContext.GetFontMetrics()->GetWidth(*string,width); - width *= f; } /* diff --git a/calendar/modules/ui/canvas/src/nsCalTimebarUserHeading.cpp b/calendar/modules/ui/canvas/src/nsCalTimebarUserHeading.cpp index 36e323479c5..2747252acec 100644 --- a/calendar/modules/ui/canvas/src/nsCalTimebarUserHeading.cpp +++ b/calendar/modules/ui/canvas/src/nsCalTimebarUserHeading.cpp @@ -91,19 +91,6 @@ nsEventStatus nsCalTimebarUserHeading :: PaintForeground(nsIRenderingContext& aR aRenderingContext.GetFontMetrics()->GetHeight(height); aRenderingContext.GetFontMetrics()->GetWidth(mUserName,width); - nsIDeviceContext * dc ; - - float f = 0.0; - - dc = aRenderingContext.GetDeviceContext(); - - dc->GetTwipsToDevUnits(f); - - NS_RELEASE(dc); - - height *= f; - width *= f; - /* * center the text in our rect and draw it */ diff --git a/calendar/modules/ui/controller/src/nsCalMonthContextController.cpp b/calendar/modules/ui/controller/src/nsCalMonthContextController.cpp index 4801fc958b2..d941c5d8d4e 100644 --- a/calendar/modules/ui/controller/src/nsCalMonthContextController.cpp +++ b/calendar/modules/ui/controller/src/nsCalMonthContextController.cpp @@ -319,16 +319,6 @@ void nsCalMonthContextController::PaintMiniCalElement( mRenderingContext->GetFontMetrics()->GetLeading(leading); - nsIDeviceContext * dc ; - - float f = 0.0; - - dc = mRenderingContext->GetDeviceContext(); - - dc->GetTwipsToDevUnits(f); - - NS_RELEASE(dc); - iY = iYTop + leading; mRenderingContext->DrawString(s, nsCRT::strlen(s), iX, iY, 100); @@ -1688,17 +1678,6 @@ void nsCalMonthContextController::GetTextExtent(char *p, int iChars, int& iWidth fm->GetWidth(p,(nscoord)iWidth); fm->GetHeight((nscoord)iHeight); - nsIDeviceContext * dc ; - - float f = 0.0; - - dc = mRenderingContext->GetDeviceContext(); - - dc->GetTwipsToDevUnits(f); - - NS_RELEASE(dc); - - iWidth *= f; } @@ -1755,18 +1734,6 @@ void nsCalMonthContextController::GetFontInfo( fm->GetWidth("0",m_iDigitWidth); fm->GetHeight(m_iDigitHeight); - nsIDeviceContext * dc ; - - float f = 0.0; - - dc = mRenderingContext->GetDeviceContext(); - - dc->GetTwipsToDevUnits(f); - - NS_RELEASE(dc); - - m_iDigitWidth *= f; - /* * The next few lines need to be replaced with some code that gets the * strings for every day of the week and computes the max width... @@ -1777,8 +1744,6 @@ void nsCalMonthContextController::GetFontInfo( fm->GetWidth(sBuf,m_iMaxDOWColHdrWidth); - m_iMaxDOWColHdrWidth *= f; - } /*