From 7ace3321e68d057d85507e231b52620801d07633 Mon Sep 17 00:00:00 2001 From: "bryner%brianryner.com" Date: Wed, 11 Feb 2004 04:57:07 +0000 Subject: [PATCH] Inline TwipsToPixels and PixelsToTwips on nsIPresContext. Bug 229371, r+sr=dbaron. git-svn-id: svn://10.0.0.236/trunk@152647 18797224-902f-48f8-a5cc-f745e15eee43 --- .../accessible/src/atk/nsAccessibleText.cpp | 5 +-- mozilla/accessible/src/base/nsAccessible.cpp | 6 ++-- .../accessible/src/base/nsCaretAccessible.cpp | 2 +- .../src/html/nsHTMLAreaAccessible.cpp | 2 +- .../src/msaa/nsTextAccessibleWrap.cpp | 5 +-- mozilla/content/base/src/nsDocumentViewer.cpp | 8 ++--- mozilla/content/events/src/nsDOMEvent.cpp | 8 ++--- .../events/src/nsEventListenerManager.cpp | 2 +- .../html/content/src/nsGenericHTMLElement.cpp | 6 ++-- .../html/content/src/nsHTMLImageElement.cpp | 4 +-- .../html/document/src/nsHTMLDocument.cpp | 2 +- .../html/document/src/nsImageDocument.cpp | 2 +- .../html/style/src/nsComputedDOMStyle.cpp | 2 +- .../content/html/style/src/nsStyleUtil.cpp | 8 ++--- mozilla/content/shared/src/nsStyleStruct.cpp | 4 +-- .../svg/content/src/nsSVGSVGElement.cpp | 4 +-- .../xul/document/src/nsXULDocument.cpp | 2 +- mozilla/dom/src/base/nsGlobalWindow.cpp | 4 +-- .../editor/libeditor/html/nsHTMLEditor.cpp | 2 +- .../webBrowser/nsDocShellTreeOwner.cpp | 2 +- .../inspector/base/src/inFlasher.cpp | 2 +- .../inspector/base/src/inLayoutUtils.cpp | 2 +- .../typeaheadfind/src/nsTypeAheadFind.cpp | 2 +- .../xmlterm/base/mozXMLTermStream.cpp | 2 +- .../xmlterm/base/mozXMLTerminal.cpp | 2 +- mozilla/gfx/src/shared/nsNativeTheme.cpp | 2 +- mozilla/gfx/src/windows/nsNativeThemeWin.cpp | 2 +- mozilla/layout/base/nsCSSRendering.cpp | 10 +++--- mozilla/layout/base/nsDocumentViewer.cpp | 8 ++--- mozilla/layout/base/nsImageLoader.cpp | 2 +- mozilla/layout/base/nsPresContext.cpp | 20 ----------- mozilla/layout/base/nsPresContext.h | 5 +-- mozilla/layout/base/public/nsIPresContext.h | 5 +-- mozilla/layout/base/public/nsPresContext.h | 5 +-- mozilla/layout/base/src/nsImageLoader.cpp | 2 +- mozilla/layout/base/src/nsPresContext.cpp | 20 ----------- mozilla/layout/base/src/nsPresContext.h | 2 -- .../layout/forms/nsComboboxControlFrame.cpp | 4 +-- mozilla/layout/forms/nsFieldSetFrame.cpp | 2 +- mozilla/layout/forms/nsFormControlFrame.cpp | 4 +-- mozilla/layout/forms/nsFormControlFrame.h | 2 +- mozilla/layout/forms/nsImageControlFrame.cpp | 2 +- mozilla/layout/forms/nsListControlFrame.cpp | 2 +- mozilla/layout/forms/nsTextControlFrame.cpp | 4 +-- mozilla/layout/generic/nsBRFrame.cpp | 2 +- mozilla/layout/generic/nsBulletFrame.cpp | 10 +++--- mozilla/layout/generic/nsFrameFrame.cpp | 2 +- mozilla/layout/generic/nsFrameSetFrame.cpp | 10 +++--- mozilla/layout/generic/nsHTMLFrame.cpp | 2 +- mozilla/layout/generic/nsImageFrame.cpp | 10 +++--- mozilla/layout/generic/nsImageMap.cpp | 12 +++---- mozilla/layout/generic/nsObjectFrame.cpp | 14 ++++---- mozilla/layout/generic/nsPlaceholderFrame.cpp | 2 +- .../layout/generic/nsSimplePageSequence.cpp | 2 +- mozilla/layout/html/base/src/nsBRFrame.cpp | 2 +- .../layout/html/base/src/nsBulletFrame.cpp | 10 +++--- mozilla/layout/html/base/src/nsHTMLFrame.cpp | 2 +- mozilla/layout/html/base/src/nsImageFrame.cpp | 10 +++--- mozilla/layout/html/base/src/nsImageMap.cpp | 12 +++---- .../layout/html/base/src/nsObjectFrame.cpp | 14 ++++---- .../html/base/src/nsPlaceholderFrame.cpp | 2 +- .../html/base/src/nsSimplePageSequence.cpp | 2 +- .../layout/html/document/src/nsFrameFrame.cpp | 2 +- .../html/document/src/nsFrameSetFrame.cpp | 10 +++--- .../html/forms/src/nsComboboxControlFrame.cpp | 4 +-- .../layout/html/forms/src/nsFieldSetFrame.cpp | 2 +- .../html/forms/src/nsFormControlFrame.cpp | 4 +-- .../html/forms/src/nsFormControlFrame.h | 2 +- .../html/forms/src/nsImageControlFrame.cpp | 2 +- .../html/forms/src/nsListControlFrame.cpp | 2 +- .../html/forms/src/nsTextControlFrame.cpp | 4 +-- .../layout/html/style/src/nsCSSRendering.cpp | 10 +++--- .../html/table/src/nsTableCellFrame.cpp | 34 ++++++++----------- .../layout/html/table/src/nsTableFrame.cpp | 4 +-- .../html/table/src/nsTableRowGroupFrame.cpp | 2 +- mozilla/layout/style/nsComputedDOMStyle.cpp | 2 +- mozilla/layout/style/nsStyleStruct.cpp | 4 +-- mozilla/layout/style/nsStyleUtil.cpp | 8 ++--- .../svg/base/src/nsSVGOuterSVGFrame.cpp | 4 +-- .../src/gdiplus/nsSVGGDIPlusGlyphMetrics.cpp | 2 +- .../src/libart/nsSVGLibartBitmapDefault.cpp | 2 +- .../src/libart/nsSVGLibartBitmapMac.cpp | 2 +- .../src/libart/nsSVGLibartGlyphMetricsFT.cpp | 2 +- mozilla/layout/tables/nsTableCellFrame.cpp | 34 ++++++++----------- mozilla/layout/tables/nsTableFrame.cpp | 4 +-- .../layout/tables/nsTableRowGroupFrame.cpp | 2 +- mozilla/layout/xul/base/src/nsBoxObject.cpp | 4 +-- .../layout/xul/base/src/nsImageBoxFrame.cpp | 2 +- .../xul/base/src/nsListBoxBodyFrame.cpp | 4 +-- .../layout/xul/base/src/nsMenuPopupFrame.cpp | 2 +- .../xul/base/src/nsNativeScrollbarFrame.cpp | 2 +- .../layout/xul/base/src/nsScrollBoxObject.cpp | 4 +-- .../xul/base/src/tree/src/nsTreeBodyFrame.cpp | 32 ++++++++--------- .../satchel/src/nsFormFillController.cpp | 2 +- mozilla/widget/src/mac/nsDragService.cpp | 2 +- 95 files changed, 231 insertions(+), 284 deletions(-) diff --git a/mozilla/accessible/src/atk/nsAccessibleText.cpp b/mozilla/accessible/src/atk/nsAccessibleText.cpp index b950bf383e4..592bf022eb4 100644 --- a/mozilla/accessible/src/atk/nsAccessibleText.cpp +++ b/mozilla/accessible/src/atk/nsAccessibleText.cpp @@ -684,10 +684,7 @@ NS_IMETHODIMP nsAccessibleText::GetCharacterExtents(PRInt32 aOffset, return NS_ERROR_FAILURE; } - float t2p; - if (NS_FAILED(context->GetTwipsToPixels(&t2p))) { - return NS_ERROR_FAILURE; - } + float t2p = context->TwipsToPixels(); //Getting width nscoord tmpWidth; diff --git a/mozilla/accessible/src/base/nsAccessible.cpp b/mozilla/accessible/src/base/nsAccessible.cpp index c7d475d082a..de9fd1bcc74 100644 --- a/mozilla/accessible/src/base/nsAccessible.cpp +++ b/mozilla/accessible/src/base/nsAccessible.cpp @@ -484,7 +484,7 @@ PRBool nsAccessible::IsPartiallyVisible(PRBool *aIsOffscreen) } float p2t; - presContext->GetPixelsToTwips(&p2t); + p2t = presContext->PixelsToTwips(); nsRectVisibility rectVisibility; viewManager->GetRectVisibility(containingView, relFrameRect, NS_STATIC_CAST(PRUint16, (kMinPixels * p2t)), @@ -682,7 +682,7 @@ void nsAccessible::GetScreenOrigin(nsIPresContext *aPresContext, nsIFrame *aFram if (widget) { // Get the scale from that Presentation Context float t2p; - aPresContext->GetTwipsToPixels(&t2p); + t2p = aPresContext->TwipsToPixels(); // Convert to pixels using that scale offsetX = NSTwipsToIntPixels(offsetX, t2p); @@ -829,7 +829,7 @@ NS_IMETHODIMP nsAccessible::GetBounds(PRInt32 *x, PRInt32 *y, PRInt32 *width, PR } float t2p; - presContext->GetTwipsToPixels(&t2p); // Get pixels to twips conversion factor + t2p = presContext->TwipsToPixels(); // Get pixels to twips conversion factor nsRect unionRectTwips; nsIFrame* aBoundingFrame = nsnull; diff --git a/mozilla/accessible/src/base/nsCaretAccessible.cpp b/mozilla/accessible/src/base/nsCaretAccessible.cpp index c575733e63e..f4b931716cb 100644 --- a/mozilla/accessible/src/base/nsCaretAccessible.cpp +++ b/mozilla/accessible/src/base/nsCaretAccessible.cpp @@ -174,7 +174,7 @@ NS_IMETHODIMP nsCaretAccessible::NotifySelectionChanged(nsIDOMDocument *aDoc, ns return NS_OK; float t2p; - presContext->GetTwipsToPixels(&t2p); + t2p = presContext->TwipsToPixels(); // Convert to pixels using that scale caretRect.x = NSTwipsToIntPixels(caretRect.x, t2p); caretRect.y = NSTwipsToIntPixels(caretRect.y, t2p); diff --git a/mozilla/accessible/src/html/nsHTMLAreaAccessible.cpp b/mozilla/accessible/src/html/nsHTMLAreaAccessible.cpp index 203b5a97513..3329e180076 100644 --- a/mozilla/accessible/src/html/nsHTMLAreaAccessible.cpp +++ b/mozilla/accessible/src/html/nsHTMLAreaAccessible.cpp @@ -186,7 +186,7 @@ NS_IMETHODIMP nsHTMLAreaAccessible::GetBounds(PRInt32 *x, PRInt32 *y, PRInt32 *w // Convert from twips to pixels float t2p; - presContext->GetTwipsToPixels(&t2p); // Get pixels conversion factor + t2p = presContext->TwipsToPixels(); // Get pixels conversion factor *x = NSTwipsToIntPixels(rect.x, t2p); *y = NSTwipsToIntPixels(rect.y, t2p); diff --git a/mozilla/accessible/src/msaa/nsTextAccessibleWrap.cpp b/mozilla/accessible/src/msaa/nsTextAccessibleWrap.cpp index d9bf6577ce5..269cccdd244 100755 --- a/mozilla/accessible/src/msaa/nsTextAccessibleWrap.cpp +++ b/mozilla/accessible/src/msaa/nsTextAccessibleWrap.cpp @@ -229,10 +229,7 @@ nsresult nsTextAccessibleWrap::GetCharacterExtents(PRInt32 aStartOffset, PRInt32 nsCOMPtr presContext; presShell->GetPresContext(getter_AddRefs(presContext)); NS_ENSURE_TRUE(presContext, NS_ERROR_FAILURE); - float t2p; - if (NS_FAILED(presContext->GetTwipsToPixels(&t2p))) { - return NS_ERROR_FAILURE; - } + float t2p = presContext->TwipsToPixels(); nsIFrame *frame = nsnull; nsCOMPtr content(do_QueryInterface(mDOMNode)); diff --git a/mozilla/content/base/src/nsDocumentViewer.cpp b/mozilla/content/base/src/nsDocumentViewer.cpp index 1b7ff58898d..0dd9f615f9c 100644 --- a/mozilla/content/base/src/nsDocumentViewer.cpp +++ b/mozilla/content/base/src/nsDocumentViewer.cpp @@ -672,7 +672,7 @@ DocumentViewerImpl::InitPresentationStuff(PRBool aDoInitialReflow) float p2t; - mPresContext->GetPixelsToTwips(&p2t); + p2t = mPresContext->PixelsToTwips(); nscoord width = NSIntPixelsToTwips(bounds.width, p2t); nscoord height = NSIntPixelsToTwips(bounds.height, p2t); @@ -1701,7 +1701,7 @@ DocumentViewerImpl::MakeWindow(nsIWidget* aParentWidget, nsRect tbounds = aBounds; float p2t; - mPresContext->GetPixelsToTwips(&p2t); + p2t = mPresContext->PixelsToTwips(); tbounds *= p2t; // Initialize the view manager with an offset. This allows the viewmanager @@ -2601,7 +2601,7 @@ NS_IMETHODIMP DocumentViewerImpl::SizeToContent() // so how big is it? nsRect shellArea = presContext->GetVisibleArea(); - presContext->GetTwipsToPixels(&pixelScale); + pixelScale = presContext->TwipsToPixels(); width = PRInt32((float)shellArea.width*pixelScale); height = PRInt32((float)shellArea.height*pixelScale); @@ -3677,7 +3677,7 @@ DocumentViewerImpl::InstallNewPresentation() nscoord width = bounds.width; nscoord height = bounds.height; float p2t; - mPresContext->GetPixelsToTwips(&p2t); + p2t = mPresContext->PixelsToTwips(); width = NSIntPixelsToTwips(width, p2t); height = NSIntPixelsToTwips(height, p2t); mViewManager->DisableRefresh(); diff --git a/mozilla/content/events/src/nsDOMEvent.cpp b/mozilla/content/events/src/nsDOMEvent.cpp index c4dca04e708..67463d41584 100644 --- a/mozilla/content/events/src/nsDOMEvent.cpp +++ b/mozilla/content/events/src/nsDOMEvent.cpp @@ -932,7 +932,7 @@ NS_METHOD nsDOMEvent::GetLayerX(PRInt32* aLayerX) } float t2p; - mPresContext->GetTwipsToPixels(&t2p); + t2p = mPresContext->TwipsToPixels(); *aLayerX = NSTwipsToIntPixels(mEvent->point.x, t2p); return NS_OK; } @@ -947,7 +947,7 @@ NS_METHOD nsDOMEvent::GetLayerY(PRInt32* aLayerY) } float t2p; - mPresContext->GetTwipsToPixels(&t2p); + t2p = mPresContext->TwipsToPixels(); *aLayerY = NSTwipsToIntPixels(mEvent->point.y, t2p); return NS_OK; } @@ -963,8 +963,8 @@ nsresult nsDOMEvent::GetScrollInfo(nsIScrollableView** aScrollableView, return NS_ERROR_FAILURE; } - mPresContext->GetPixelsToTwips(aP2T); - mPresContext->GetTwipsToPixels(aT2P); + *aP2T = mPresContext->PixelsToTwips(); + *aT2P = mPresContext->TwipsToPixels(); nsIPresShell *presShell = mPresContext->GetPresShell(); if (presShell) { diff --git a/mozilla/content/events/src/nsEventListenerManager.cpp b/mozilla/content/events/src/nsEventListenerManager.cpp index 62e2da8f911..787f3321e22 100644 --- a/mozilla/content/events/src/nsEventListenerManager.cpp +++ b/mozilla/content/events/src/nsEventListenerManager.cpp @@ -2062,7 +2062,7 @@ void nsEventListenerManager::GetCoordinatesFor(nsIDOMElement *aCurrentEl, nsIView *view; frame->GetOffsetFromView(aPresContext, aTargetPt, &view); float t2p; - aPresContext->GetTwipsToPixels(&t2p); + t2p = aPresContext->TwipsToPixels(); // Start context menu down and to the right from top left of frame // use the lineheight. This is a good distance to move the context diff --git a/mozilla/content/html/content/src/nsGenericHTMLElement.cpp b/mozilla/content/html/content/src/nsGenericHTMLElement.cpp index 56f677eecd7..066816c9f2e 100644 --- a/mozilla/content/html/content/src/nsGenericHTMLElement.cpp +++ b/mozilla/content/html/content/src/nsGenericHTMLElement.cpp @@ -757,7 +757,7 @@ nsGenericHTMLElement::GetOffsetRect(nsRect& aRect, nsIContent** aOffsetParent) // Get the scale from that Presentation Context float scale; - context->GetTwipsToPixels(&scale); + scale = context->TwipsToPixels(); // Convert to pixels using that scale aRect.x = NSTwipsToIntPixels(origin.x, scale); @@ -965,8 +965,8 @@ nsGenericHTMLElement::GetScrollInfo(nsIScrollableView **aScrollableView, *aFrame = frame; } - presContext->GetPixelsToTwips(aP2T); - presContext->GetTwipsToPixels(aT2P); + *aP2T = presContext->PixelsToTwips(); + *aT2P = presContext->TwipsToPixels(); // Get the scrollable frame nsIScrollableFrame *scrollFrame = nsnull; diff --git a/mozilla/content/html/content/src/nsHTMLImageElement.cpp b/mozilla/content/html/content/src/nsHTMLImageElement.cpp index b1e47c474d7..fec2eb16eec 100644 --- a/mozilla/content/html/content/src/nsHTMLImageElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLImageElement.cpp @@ -346,7 +346,7 @@ nsHTMLImageElement::GetXY() // Get the scale from that Presentation Context float scale; - context->GetTwipsToPixels(&scale); + scale = context->TwipsToPixels(); // Convert to pixels using that scale point.x = NSTwipsToIntPixels(origin.x, scale); @@ -409,7 +409,7 @@ nsHTMLImageElement::GetWidthHeight() if (context) { float t2p; - context->GetTwipsToPixels(&t2p); + t2p = context->TwipsToPixels(); size.width = NSTwipsToIntPixels(size.width, t2p); size.height = NSTwipsToIntPixels(size.height, t2p); diff --git a/mozilla/content/html/document/src/nsHTMLDocument.cpp b/mozilla/content/html/document/src/nsHTMLDocument.cpp index 70133ccc1ed..19fb759372a 100644 --- a/mozilla/content/html/document/src/nsHTMLDocument.cpp +++ b/mozilla/content/html/document/src/nsHTMLDocument.cpp @@ -2584,7 +2584,7 @@ nsHTMLDocument::GetPixelDimensions(nsIPresShell* aShell, if (NS_SUCCEEDED(rv)) { float scale; - context->GetTwipsToPixels(&scale); + scale = context->TwipsToPixels(); *aWidth = NSTwipsToIntPixels(size.width, scale); *aHeight = NSTwipsToIntPixels(size.height, scale); diff --git a/mozilla/content/html/document/src/nsImageDocument.cpp b/mozilla/content/html/document/src/nsImageDocument.cpp index e60467b8219..cec82b523e9 100644 --- a/mozilla/content/html/document/src/nsImageDocument.cpp +++ b/mozilla/content/html/document/src/nsImageDocument.cpp @@ -547,7 +547,7 @@ nsImageDocument::CheckOverflowing() visibleArea.Deflate(margin); float t2p; - context->GetTwipsToPixels(&t2p); + t2p = context->TwipsToPixels(); mVisibleWidth = NSTwipsToIntPixels(visibleArea.width, t2p); mVisibleHeight = NSTwipsToIntPixels(visibleArea.height, t2p); diff --git a/mozilla/content/html/style/src/nsComputedDOMStyle.cpp b/mozilla/content/html/style/src/nsComputedDOMStyle.cpp index 2fda5ddd6e9..0e1fbddccdd 100644 --- a/mozilla/content/html/style/src/nsComputedDOMStyle.cpp +++ b/mozilla/content/html/style/src/nsComputedDOMStyle.cpp @@ -197,7 +197,7 @@ nsComputedDOMStyle::Init(nsIDOMElement *aElement, NS_ENSURE_TRUE(presCtx, NS_ERROR_FAILURE); - presCtx->GetTwipsToPixels(&mT2P); + mT2P = presCtx->TwipsToPixels(); return NS_OK; } diff --git a/mozilla/content/html/style/src/nsStyleUtil.cpp b/mozilla/content/html/style/src/nsStyleUtil.cpp index 7560ef1a700..0dda3e7d1c0 100644 --- a/mozilla/content/html/style/src/nsStyleUtil.cpp +++ b/mozilla/content/html/style/src/nsStyleUtil.cpp @@ -226,7 +226,7 @@ nsStyleUtil::CalcFontPointSize(PRInt32 aHTMLSize, PRInt32 aBasePointSize, if ((fontSize >= sFontSizeTableMin) && (fontSize <= sFontSizeTableMax)) { float p2t; - aPresContext->GetPixelsToTwips(&p2t); + p2t = aPresContext->PixelsToTwips(); PRInt32 row = fontSize - sFontSizeTableMin; @@ -272,7 +272,7 @@ nscoord nsStyleUtil::FindNextSmallerFontSize(nscoord aFontSize, PRInt32 aBasePoi float p2t; nscoord onePx; - aPresContext->GetPixelsToTwips(&p2t); + p2t = aPresContext->PixelsToTwips(); onePx = NSToCoordRound(p2t); if (aFontSizeType == eFontSize_HTML) { @@ -340,7 +340,7 @@ nscoord nsStyleUtil::FindNextLargerFontSize(nscoord aFontSize, PRInt32 aBasePoin float p2t; nscoord onePx; - aPresContext->GetPixelsToTwips(&p2t); + p2t = aPresContext->PixelsToTwips(); onePx = NSToCoordRound(p2t); if (aFontSizeType == eFontSize_HTML) { @@ -383,7 +383,7 @@ nscoord nsStyleUtil::FindNextLargerFontSize(nscoord aFontSize, PRInt32 aBasePoin } else { // smaller than HTML table, increase by 1px float p2t; - aPresContext->GetPixelsToTwips(&p2t); + p2t = aPresContext->PixelsToTwips(); largerSize = aFontSize + NSToCoordRound(p2t); } return largerSize; diff --git a/mozilla/content/shared/src/nsStyleStruct.cpp b/mozilla/content/shared/src/nsStyleStruct.cpp index 045b0bfb2db..9d5b5610bff 100644 --- a/mozilla/content/shared/src/nsStyleStruct.cpp +++ b/mozilla/content/shared/src/nsStyleStruct.cpp @@ -411,7 +411,7 @@ nsStyleBorder::nsStyleBorder(nsIPresContext* aPresContext) // XXX support mBorderWidths until deprecated methods are removed float pixelsToTwips = 20.0f; if (aPresContext) { - aPresContext->GetPixelsToTwips(&pixelsToTwips); + pixelsToTwips = aPresContext->PixelsToTwips(); } mBorderWidths[NS_STYLE_BORDER_WIDTH_THIN] = NSIntPixelsToTwips(1, pixelsToTwips); mBorderWidths[NS_STYLE_BORDER_WIDTH_MEDIUM] = NSIntPixelsToTwips(3, pixelsToTwips); @@ -617,7 +617,7 @@ nsStyleOutline::nsStyleOutline(nsIPresContext* aPresContext) // XXX support mBorderWidths until deprecated methods are removed float pixelsToTwips = 20.0f; if (aPresContext) - aPresContext->GetPixelsToTwips(&pixelsToTwips); + pixelsToTwips = aPresContext->PixelsToTwips(); mBorderWidths[NS_STYLE_BORDER_WIDTH_THIN] = NSIntPixelsToTwips(1, pixelsToTwips); mBorderWidths[NS_STYLE_BORDER_WIDTH_MEDIUM] = NSIntPixelsToTwips(3, pixelsToTwips); mBorderWidths[NS_STYLE_BORDER_WIDTH_THICK] = NSIntPixelsToTwips(5, pixelsToTwips); diff --git a/mozilla/content/svg/content/src/nsSVGSVGElement.cpp b/mozilla/content/svg/content/src/nsSVGSVGElement.cpp index e8553e8f1f1..aa8a36563f0 100644 --- a/mozilla/content/svg/content/src/nsSVGSVGElement.cpp +++ b/mozilla/content/svg/content/src/nsSVGSVGElement.cpp @@ -498,7 +498,7 @@ nsSVGSVGElement::GetScreenPixelToMillimeterX(float *aScreenPixelToMillimeterX) if (!context) return NS_OK; float TwipsPerPx; - context->GetPixelsToTwips(&TwipsPerPx); + TwipsPerPx = context->PixelsToTwips(); *aScreenPixelToMillimeterX = TwipsPerPx / TWIPS_PER_POINT_FLOAT / (72.0f * 0.03937f); return NS_OK; } @@ -1172,7 +1172,7 @@ void nsSVGSVGElement::GetScreenPosition(PRInt32 &x, PRInt32 &y) presShell->GetPrimaryFrameFor(this, &frame); float t2p; - context->GetTwipsToPixels(&t2p); + t2p = context->TwipsToPixels(); nsIWidget* widget = nsnull; diff --git a/mozilla/content/xul/document/src/nsXULDocument.cpp b/mozilla/content/xul/document/src/nsXULDocument.cpp index 0b92cb9c0a5..0482e4249f2 100644 --- a/mozilla/content/xul/document/src/nsXULDocument.cpp +++ b/mozilla/content/xul/document/src/nsXULDocument.cpp @@ -1616,7 +1616,7 @@ nsXULDocument::GetPixelDimensions(nsIPresShell* aShell, PRInt32* aWidth, if (NS_SUCCEEDED(result)) { float scale; - context->GetTwipsToPixels(&scale); + scale = context->TwipsToPixels(); *aWidth = NSTwipsToIntPixels(size.width, scale); *aHeight = NSTwipsToIntPixels(size.height, scale); diff --git a/mozilla/dom/src/base/nsGlobalWindow.cpp b/mozilla/dom/src/base/nsGlobalWindow.cpp index 51f20b4735a..139a67b3176 100644 --- a/mozilla/dom/src/base/nsGlobalWindow.cpp +++ b/mozilla/dom/src/base/nsGlobalWindow.cpp @@ -5575,8 +5575,8 @@ GlobalWindowImpl::GetScrollInfo(nsIScrollableView **aScrollableView, nsCOMPtr presContext; mDocShell->GetPresContext(getter_AddRefs(presContext)); if (presContext) { - presContext->GetPixelsToTwips(aP2T); - presContext->GetTwipsToPixels(aT2P); + *aP2T = presContext->PixelsToTwips(); + *aT2P = presContext->TwipsToPixels(); nsIViewManager* vm = presContext->GetViewManager(); if (vm) diff --git a/mozilla/editor/libeditor/html/nsHTMLEditor.cpp b/mozilla/editor/libeditor/html/nsHTMLEditor.cpp index bf29d2f0a64..0d9608577f9 100644 --- a/mozilla/editor/libeditor/html/nsHTMLEditor.cpp +++ b/mozilla/editor/libeditor/html/nsHTMLEditor.cpp @@ -5933,7 +5933,7 @@ nsHTMLEditor::GetElementOrigin(nsIDOMElement * aElement, PRInt32 & aX, PRInt32 & float t2p; nsCOMPtr pcontext; ps->GetPresContext(getter_AddRefs(pcontext)); - pcontext->GetTwipsToPixels(&t2p); + t2p = pcontext->TwipsToPixels(); if (nsHTMLEditUtils::IsHR(aElement)) { diff --git a/mozilla/embedding/browser/webBrowser/nsDocShellTreeOwner.cpp b/mozilla/embedding/browser/webBrowser/nsDocShellTreeOwner.cpp index 18f04fb3a09..877f85169f5 100644 --- a/mozilla/embedding/browser/webBrowser/nsDocShellTreeOwner.cpp +++ b/mozilla/embedding/browser/webBrowser/nsDocShellTreeOwner.cpp @@ -465,7 +465,7 @@ nsDocShellTreeOwner::SizeShellTo(nsIDocShellTreeItem* aShellItem, nsRect shellArea = presContext->GetVisibleArea(); float pixelScale; - presContext->GetTwipsToPixels(&pixelScale); + pixelScale = presContext->TwipsToPixels(); PRInt32 browserCX = PRInt32((float)shellArea.width*pixelScale); PRInt32 browserCY = PRInt32((float)shellArea.height*pixelScale); diff --git a/mozilla/extensions/inspector/base/src/inFlasher.cpp b/mozilla/extensions/inspector/base/src/inFlasher.cpp index 297eeca9a6f..6babbeb8cc7 100644 --- a/mozilla/extensions/inspector/base/src/inFlasher.cpp +++ b/mozilla/extensions/inspector/base/src/inFlasher.cpp @@ -183,7 +183,7 @@ inFlasher::DrawElementOutline(nsIDOMElement* aElement) mCSSUtils->AdjustRectForMargins(frame, rect); float p2t; - presContext->GetPixelsToTwips(&p2t); + p2t = presContext->PixelsToTwips(); if (mInvert) { rcontext->InvertRect(rect.x, rect.y, rect.width, rect.height); diff --git a/mozilla/extensions/inspector/base/src/inLayoutUtils.cpp b/mozilla/extensions/inspector/base/src/inLayoutUtils.cpp index 9010352ce10..71ba3466a36 100644 --- a/mozilla/extensions/inspector/base/src/inLayoutUtils.cpp +++ b/mozilla/extensions/inspector/base/src/inLayoutUtils.cpp @@ -210,7 +210,7 @@ inLayoutUtils::GetScreenOrigin(nsIDOMElement* aElement) // Get the scale from that Presentation Context float p2t; - presContext->GetPixelsToTwips(&p2t); + p2t = presContext->PixelsToTwips(); // Convert screen rect to twips rect->x = NSIntPixelsToTwips(rect->x, p2t); diff --git a/mozilla/extensions/typeaheadfind/src/nsTypeAheadFind.cpp b/mozilla/extensions/typeaheadfind/src/nsTypeAheadFind.cpp index d2cfdff6f23..9ab53d5f25c 100644 --- a/mozilla/extensions/typeaheadfind/src/nsTypeAheadFind.cpp +++ b/mozilla/extensions/typeaheadfind/src/nsTypeAheadFind.cpp @@ -2626,7 +2626,7 @@ nsTypeAheadFind::IsRangeVisible(nsIPresShell *aPresShell, nsIView *containingView = nsnull; nsPoint frameOffset; float p2t; - aPresContext->GetPixelsToTwips(&p2t); + p2t = aPresContext->PixelsToTwips(); nsRectVisibility rectVisibility = nsRectVisibility_kAboveViewport; if (!aGetTopVisibleLeaf) { diff --git a/mozilla/extensions/xmlterm/base/mozXMLTermStream.cpp b/mozilla/extensions/xmlterm/base/mozXMLTermStream.cpp index 5348854c6eb..4765765d434 100644 --- a/mozilla/extensions/xmlterm/base/mozXMLTermStream.cpp +++ b/mozilla/extensions/xmlterm/base/mozXMLTermStream.cpp @@ -377,7 +377,7 @@ NS_IMETHODIMP mozXMLTermStream::SizeToContentHeight(PRInt32 maxHeight) // Determine twips to pixels conversion factor float pixelScale; - presContext->GetTwipsToPixels(&pixelScale); + pixelScale = presContext->TwipsToPixels(); // Get scrollbar dimensions in pixels float sbWidth, sbHeight; diff --git a/mozilla/extensions/xmlterm/base/mozXMLTerminal.cpp b/mozilla/extensions/xmlterm/base/mozXMLTerminal.cpp index 3d5f18f523a..e6dca065573 100644 --- a/mozilla/extensions/xmlterm/base/mozXMLTerminal.cpp +++ b/mozilla/extensions/xmlterm/base/mozXMLTerminal.cpp @@ -609,7 +609,7 @@ NS_IMETHODIMP mozXMLTerminal::ScreenSize(PRInt32* rows, PRInt32* cols, // Determine twips to pixels conversion factor float pixelScale; - presContext->GetTwipsToPixels(&pixelScale); + pixelScale = presContext->TwipsToPixels(); // Convert dimensions to pixels float xdel, ydel; diff --git a/mozilla/gfx/src/shared/nsNativeTheme.cpp b/mozilla/gfx/src/shared/nsNativeTheme.cpp index cf7cf371f8f..352dad60744 100644 --- a/mozilla/gfx/src/shared/nsNativeTheme.cpp +++ b/mozilla/gfx/src/shared/nsNativeTheme.cpp @@ -217,7 +217,7 @@ nsNativeTheme::IsWidgetStyled(nsIPresContext* aPresContext, nsIFrame* aFrame, PRBool defaultBGTransparent = PR_FALSE; float p2t; - aPresContext->GetPixelsToTwips(&p2t); + p2t = aPresContext->PixelsToTwips(); nsILookAndFeel *lookAndFeel = aPresContext->LookAndFeel(); diff --git a/mozilla/gfx/src/windows/nsNativeThemeWin.cpp b/mozilla/gfx/src/windows/nsNativeThemeWin.cpp index 201a19a4af1..646aed2cfeb 100644 --- a/mozilla/gfx/src/windows/nsNativeThemeWin.cpp +++ b/mozilla/gfx/src/windows/nsNativeThemeWin.cpp @@ -1065,7 +1065,7 @@ PRBool nsNativeThemeWin::IsWidgetStyled(nsIPresContext* aPresContext, nsIFrame* nscoord defaultBorderSize; float p2t; - aPresContext->GetPixelsToTwips(&p2t); + p2t = aPresContext->PixelsToTwips(); nsILookAndFeel *lookAndFeel = aPresContext->LookAndFeel(); diff --git a/mozilla/layout/base/nsCSSRendering.cpp b/mozilla/layout/base/nsCSSRendering.cpp index 63c0bc75c97..68963287691 100644 --- a/mozilla/layout/base/nsCSSRendering.cpp +++ b/mozilla/layout/base/nsCSSRendering.cpp @@ -2189,7 +2189,7 @@ nscoord width; /* XXX something is misnamed here!!!! */ nscoord twipsPerPixel;/* XXX */ float p2t;/* XXX */ - aPresContext->GetPixelsToTwips(&p2t);/* XXX */ + p2t = aPresContext->PixelsToTwips();/* XXX */ twipsPerPixel = (nscoord) p2t;/* XXX */ nscolor outlineColor(NS_RGB(0,0,0)); // default to black in case it is invert color and the platform does not support that @@ -2281,7 +2281,7 @@ void nsCSSRendering::PaintBorderEdges(nsIPresContext* aPresContext, // Draw all the other sides nscoord twipsPerPixel; float p2t; - aPresContext->GetPixelsToTwips(&p2t); + p2t = aPresContext->PixelsToTwips(); twipsPerPixel = (nscoord) p2t;/* XXX huh!*/ if (0 == (aSkipSides & (1<GetHeight(&imageSize.height); float p2t; - aPresContext->GetPixelsToTwips(&p2t); + p2t = aPresContext->PixelsToTwips(); imageSize.width = NSIntPixelsToTwips(imageSize.width, p2t); imageSize.height = NSIntPixelsToTwips(imageSize.height, p2t); @@ -3417,7 +3417,7 @@ nsCSSRendering::PaintRoundedBackground(nsIPresContext* aPresContext, float p2t; // needed for our border thickness - aPresContext->GetPixelsToTwips(&p2t); + p2t = aPresContext->PixelsToTwips(); twipsPerPixel = NSToCoordRound(p2t); nscolor color = aColor.mBackgroundColor; @@ -3550,7 +3550,7 @@ nsCSSRendering::PaintRoundedBorder(nsIPresContext* aPresContext, } // needed for our border thickness - aPresContext->GetPixelsToTwips(&p2t); + p2t = aPresContext->PixelsToTwips(); twipsPerPixel = NSToCoordRound(p2t); // Base our thickness check on the segment being less than a pixel and 1/2 diff --git a/mozilla/layout/base/nsDocumentViewer.cpp b/mozilla/layout/base/nsDocumentViewer.cpp index 1b7ff58898d..0dd9f615f9c 100644 --- a/mozilla/layout/base/nsDocumentViewer.cpp +++ b/mozilla/layout/base/nsDocumentViewer.cpp @@ -672,7 +672,7 @@ DocumentViewerImpl::InitPresentationStuff(PRBool aDoInitialReflow) float p2t; - mPresContext->GetPixelsToTwips(&p2t); + p2t = mPresContext->PixelsToTwips(); nscoord width = NSIntPixelsToTwips(bounds.width, p2t); nscoord height = NSIntPixelsToTwips(bounds.height, p2t); @@ -1701,7 +1701,7 @@ DocumentViewerImpl::MakeWindow(nsIWidget* aParentWidget, nsRect tbounds = aBounds; float p2t; - mPresContext->GetPixelsToTwips(&p2t); + p2t = mPresContext->PixelsToTwips(); tbounds *= p2t; // Initialize the view manager with an offset. This allows the viewmanager @@ -2601,7 +2601,7 @@ NS_IMETHODIMP DocumentViewerImpl::SizeToContent() // so how big is it? nsRect shellArea = presContext->GetVisibleArea(); - presContext->GetTwipsToPixels(&pixelScale); + pixelScale = presContext->TwipsToPixels(); width = PRInt32((float)shellArea.width*pixelScale); height = PRInt32((float)shellArea.height*pixelScale); @@ -3677,7 +3677,7 @@ DocumentViewerImpl::InstallNewPresentation() nscoord width = bounds.width; nscoord height = bounds.height; float p2t; - mPresContext->GetPixelsToTwips(&p2t); + p2t = mPresContext->PixelsToTwips(); width = NSIntPixelsToTwips(width, p2t); height = NSIntPixelsToTwips(height, p2t); mViewManager->DisableRefresh(); diff --git a/mozilla/layout/base/nsImageLoader.cpp b/mozilla/layout/base/nsImageLoader.cpp index ed0633bc503..3d7a5d563df 100644 --- a/mozilla/layout/base/nsImageLoader.cpp +++ b/mozilla/layout/base/nsImageLoader.cpp @@ -207,7 +207,7 @@ NS_IMETHODIMP nsImageLoader::FrameChanged(imgIContainer *aContainer, nsRect r(*dirtyRect); float p2t; - mPresContext->GetPixelsToTwips(&p2t); + p2t = mPresContext->PixelsToTwips(); r.x = NSIntPixelsToTwips(r.x, p2t); r.y = NSIntPixelsToTwips(r.y, p2t); r.width = NSIntPixelsToTwips(r.width, p2t); diff --git a/mozilla/layout/base/nsPresContext.cpp b/mozilla/layout/base/nsPresContext.cpp index 52954f171b5..a40cde0768c 100644 --- a/mozilla/layout/base/nsPresContext.cpp +++ b/mozilla/layout/base/nsPresContext.cpp @@ -931,26 +931,6 @@ nsPresContext::GetUseFocusColors(PRBool& aUseFocusColors) } -NS_IMETHODIMP -nsPresContext::GetPixelsToTwips(float* aResult) const -{ - NS_PRECONDITION(aResult, "null out param"); - - float p2t; - p2t = mDeviceContext->DevUnitsToAppUnits(); - *aResult = p2t; - return NS_OK; -} - -NS_IMETHODIMP -nsPresContext::GetTwipsToPixels(float* aResult) const -{ - NS_PRECONDITION(aResult, "null out param"); - - *aResult = mDeviceContext->AppUnitsToDevUnits(); - return NS_OK; -} - NS_IMETHODIMP nsPresContext::GetTwipsToPixelsForFonts(float* aResult) const { diff --git a/mozilla/layout/base/nsPresContext.h b/mozilla/layout/base/nsPresContext.h index fd6bfa36a62..59e3359735e 100644 --- a/mozilla/layout/base/nsPresContext.h +++ b/mozilla/layout/base/nsPresContext.h @@ -46,6 +46,7 @@ #include "nsCOMPtr.h" #include "nsIPresShell.h" #include "nsRect.h" +#include "nsIDeviceContext.h" #ifdef IBMBIDI class nsBidiPresUtils; #endif // IBMBIDI @@ -312,9 +313,9 @@ public: */ virtual void SetPageDim(nsRect* aRect) = 0; - NS_IMETHOD GetPixelsToTwips(float* aResult) const = 0; + float PixelsToTwips() const { return mDeviceContext->DevUnitsToAppUnits(); } - NS_IMETHOD GetTwipsToPixels(float* aResult) const = 0; + float TwipsToPixels() const { return mDeviceContext->AppUnitsToDevUnits(); } NS_IMETHOD GetTwipsToPixelsForFonts(float* aResult) const = 0; diff --git a/mozilla/layout/base/public/nsIPresContext.h b/mozilla/layout/base/public/nsIPresContext.h index fd6bfa36a62..59e3359735e 100644 --- a/mozilla/layout/base/public/nsIPresContext.h +++ b/mozilla/layout/base/public/nsIPresContext.h @@ -46,6 +46,7 @@ #include "nsCOMPtr.h" #include "nsIPresShell.h" #include "nsRect.h" +#include "nsIDeviceContext.h" #ifdef IBMBIDI class nsBidiPresUtils; #endif // IBMBIDI @@ -312,9 +313,9 @@ public: */ virtual void SetPageDim(nsRect* aRect) = 0; - NS_IMETHOD GetPixelsToTwips(float* aResult) const = 0; + float PixelsToTwips() const { return mDeviceContext->DevUnitsToAppUnits(); } - NS_IMETHOD GetTwipsToPixels(float* aResult) const = 0; + float TwipsToPixels() const { return mDeviceContext->AppUnitsToDevUnits(); } NS_IMETHOD GetTwipsToPixelsForFonts(float* aResult) const = 0; diff --git a/mozilla/layout/base/public/nsPresContext.h b/mozilla/layout/base/public/nsPresContext.h index fd6bfa36a62..59e3359735e 100644 --- a/mozilla/layout/base/public/nsPresContext.h +++ b/mozilla/layout/base/public/nsPresContext.h @@ -46,6 +46,7 @@ #include "nsCOMPtr.h" #include "nsIPresShell.h" #include "nsRect.h" +#include "nsIDeviceContext.h" #ifdef IBMBIDI class nsBidiPresUtils; #endif // IBMBIDI @@ -312,9 +313,9 @@ public: */ virtual void SetPageDim(nsRect* aRect) = 0; - NS_IMETHOD GetPixelsToTwips(float* aResult) const = 0; + float PixelsToTwips() const { return mDeviceContext->DevUnitsToAppUnits(); } - NS_IMETHOD GetTwipsToPixels(float* aResult) const = 0; + float TwipsToPixels() const { return mDeviceContext->AppUnitsToDevUnits(); } NS_IMETHOD GetTwipsToPixelsForFonts(float* aResult) const = 0; diff --git a/mozilla/layout/base/src/nsImageLoader.cpp b/mozilla/layout/base/src/nsImageLoader.cpp index ed0633bc503..3d7a5d563df 100644 --- a/mozilla/layout/base/src/nsImageLoader.cpp +++ b/mozilla/layout/base/src/nsImageLoader.cpp @@ -207,7 +207,7 @@ NS_IMETHODIMP nsImageLoader::FrameChanged(imgIContainer *aContainer, nsRect r(*dirtyRect); float p2t; - mPresContext->GetPixelsToTwips(&p2t); + p2t = mPresContext->PixelsToTwips(); r.x = NSIntPixelsToTwips(r.x, p2t); r.y = NSIntPixelsToTwips(r.y, p2t); r.width = NSIntPixelsToTwips(r.width, p2t); diff --git a/mozilla/layout/base/src/nsPresContext.cpp b/mozilla/layout/base/src/nsPresContext.cpp index 52954f171b5..a40cde0768c 100644 --- a/mozilla/layout/base/src/nsPresContext.cpp +++ b/mozilla/layout/base/src/nsPresContext.cpp @@ -931,26 +931,6 @@ nsPresContext::GetUseFocusColors(PRBool& aUseFocusColors) } -NS_IMETHODIMP -nsPresContext::GetPixelsToTwips(float* aResult) const -{ - NS_PRECONDITION(aResult, "null out param"); - - float p2t; - p2t = mDeviceContext->DevUnitsToAppUnits(); - *aResult = p2t; - return NS_OK; -} - -NS_IMETHODIMP -nsPresContext::GetTwipsToPixels(float* aResult) const -{ - NS_PRECONDITION(aResult, "null out param"); - - *aResult = mDeviceContext->AppUnitsToDevUnits(); - return NS_OK; -} - NS_IMETHODIMP nsPresContext::GetTwipsToPixelsForFonts(float* aResult) const { diff --git a/mozilla/layout/base/src/nsPresContext.h b/mozilla/layout/base/src/nsPresContext.h index 2fb007c7b83..fb2210692bc 100644 --- a/mozilla/layout/base/src/nsPresContext.h +++ b/mozilla/layout/base/src/nsPresContext.h @@ -96,8 +96,6 @@ public: NS_IMETHOD GetPaginatedScrolling(PRBool* aResult) = 0; virtual void GetPageDim(nsRect* aActualRect, nsRect* aAdjRect) = 0; virtual void SetPageDim(nsRect* aRect) = 0; - NS_IMETHOD GetPixelsToTwips(float* aResult) const; - NS_IMETHOD GetTwipsToPixels(float* aResult) const; NS_IMETHOD GetTwipsToPixelsForFonts(float* aResult) const; NS_IMETHOD GetScaledPixelsToTwips(float* aScale) const; NS_IMETHOD GetEventStateManager(nsIEventStateManager** aManager); diff --git a/mozilla/layout/forms/nsComboboxControlFrame.cpp b/mozilla/layout/forms/nsComboboxControlFrame.cpp index 25db795bc0e..6196d3a6851 100644 --- a/mozilla/layout/forms/nsComboboxControlFrame.cpp +++ b/mozilla/layout/forms/nsComboboxControlFrame.cpp @@ -721,7 +721,7 @@ nsComboboxControlFrame::PositionDropdown(nsIPresContext* aPresContext, if (NS_SUCCEEDED(nsFormControlFrame::GetScreenHeight(aPresContext, screenHeightInPixels))) { // Get the height of the dropdown list in pixels. float t2p; - aPresContext->GetTwipsToPixels(&t2p); + t2p = aPresContext->TwipsToPixels(); nscoord absoluteDropDownHeight = NSTwipsToIntPixels(dropdownRect.height, t2p); // Check to see if the drop-down list will go offscreen @@ -2394,7 +2394,7 @@ nsComboboxControlFrame::Paint(nsIPresContext* aPresContext, } //aRenderingContext.DrawRect(clipRect); float p2t; - aPresContext->GetPixelsToTwips(&p2t); + p2t = aPresContext->PixelsToTwips(); nscoord onePixel = NSIntPixelsToTwips(1, p2t); clipRect.width -= onePixel; clipRect.height -= onePixel; diff --git a/mozilla/layout/forms/nsFieldSetFrame.cpp b/mozilla/layout/forms/nsFieldSetFrame.cpp index b81aa66070b..25ebaa8b59b 100644 --- a/mozilla/layout/forms/nsFieldSetFrame.cpp +++ b/mozilla/layout/forms/nsFieldSetFrame.cpp @@ -548,7 +548,7 @@ nsFieldSetFrame::Reflow(nsIPresContext* aPresContext, break; case NS_STYLE_TEXT_ALIGN_CENTER: float p2t; - aPresContext->GetPixelsToTwips(&p2t); + p2t = aPresContext->PixelsToTwips(); mLegendRect.x = NSIntPixelsToTwips((nscoord) NSToIntRound((float)(contentRect.width/2 - mLegendRect.width/2 + borderPadding.left) / p2t),p2t); } diff --git a/mozilla/layout/forms/nsFormControlFrame.cpp b/mozilla/layout/forms/nsFormControlFrame.cpp index e0dfb4f5eac..7913ec9f131 100644 --- a/mozilla/layout/forms/nsFormControlFrame.cpp +++ b/mozilla/layout/forms/nsFormControlFrame.cpp @@ -903,8 +903,8 @@ nsFormControlFrame::GetAbsoluteFramePosition(nsIPresContext* aPresContext, // Get conversions between twips and pixels float t2p; float p2t; - aPresContext->GetTwipsToPixels(&t2p); - aPresContext->GetPixelsToTwips(&p2t); + t2p = aPresContext->TwipsToPixels(); + p2t = aPresContext->PixelsToTwips(); // Start with frame's offset from it it's containing view nsIView *view = nsnull; diff --git a/mozilla/layout/forms/nsFormControlFrame.h b/mozilla/layout/forms/nsFormControlFrame.h index c846df7aed9..b1c4479dca0 100644 --- a/mozilla/layout/forms/nsFormControlFrame.h +++ b/mozilla/layout/forms/nsFormControlFrame.h @@ -61,7 +61,7 @@ class nsStyleCoord; #define COMPARE_QUIRK_SIZE(__class, __navWidth, __navHeight) \ { \ float t2p; \ - aPresContext->GetTwipsToPixels(&t2p); \ + t2p = aPresContext->TwipsToPixels(); \ printf ("%-25s::Size=%4d,%4d %3d,%3d Nav:%3d,%3d Diffs: %3d,%3d\n", \ (__class), \ aDesiredSize.width, aDesiredSize.height, \ diff --git a/mozilla/layout/forms/nsImageControlFrame.cpp b/mozilla/layout/forms/nsImageControlFrame.cpp index d83f6fedc63..a9869ff4024 100644 --- a/mozilla/layout/forms/nsImageControlFrame.cpp +++ b/mozilla/layout/forms/nsImageControlFrame.cpp @@ -332,7 +332,7 @@ nsImageControlFrame::HandleEvent(nsIPresContext* aPresContext, // Store click point for GetNamesValues // Do this on MouseUp because the specs don't say and that's what IE does. float t2p; - aPresContext->GetTwipsToPixels(&t2p); + t2p = aPresContext->TwipsToPixels(); mLastClickPoint.x = NSTwipsToIntPixels(aEvent->point.x, t2p); mLastClickPoint.y = NSTwipsToIntPixels(aEvent->point.y, t2p); diff --git a/mozilla/layout/forms/nsListControlFrame.cpp b/mozilla/layout/forms/nsListControlFrame.cpp index 8f2b403016a..e483fc96475 100644 --- a/mozilla/layout/forms/nsListControlFrame.cpp +++ b/mozilla/layout/forms/nsListControlFrame.cpp @@ -1228,7 +1228,7 @@ nsListControlFrame::Reflow(nsIPresContext* aPresContext, nscoord screenHeightInPixels = 0; if (NS_SUCCEEDED(nsFormControlFrame::GetScreenHeight(aPresContext, screenHeightInPixels))) { float p2t; - aPresContext->GetPixelsToTwips(&p2t); + p2t = aPresContext->PixelsToTwips(); nscoord screenHeight = NSIntPixelsToTwips(screenHeightInPixels, p2t); nscoord availDropHgt = (screenHeight / 2) - (heightOfARow*2); // approx half screen minus combo size diff --git a/mozilla/layout/forms/nsTextControlFrame.cpp b/mozilla/layout/forms/nsTextControlFrame.cpp index f3547a74c92..9ba62dde012 100644 --- a/mozilla/layout/forms/nsTextControlFrame.cpp +++ b/mozilla/layout/forms/nsTextControlFrame.cpp @@ -1407,7 +1407,7 @@ nsTextControlFrame::ReflowStandard(nsIPresContext* aPresContext, // Add in the size of the scrollbars for textarea if (IsTextArea()) { float p2t; - aPresContext->GetPixelsToTwips(&p2t); + p2t = aPresContext->PixelsToTwips(); nsIDeviceContext *dx = aPresContext->DeviceContext(); @@ -1468,7 +1468,7 @@ nsTextControlFrame::CalculateSizeStandard(nsIPresContext* aPresContext, // certainly a fixed-width font. if (charWidth != charMaxAdvance) { float p2t; - aPresContext->GetPixelsToTwips(&p2t); + p2t = aPresContext->PixelsToTwips(); nscoord internalPadding = PR_MAX(charMaxAdvance - NSToCoordRound(4 * p2t), 0); // round to a multiple of p2t nscoord t = NSToCoordRound(p2t); diff --git a/mozilla/layout/generic/nsBRFrame.cpp b/mozilla/layout/generic/nsBRFrame.cpp index 4be7091b312..686756520c4 100644 --- a/mozilla/layout/generic/nsBRFrame.cpp +++ b/mozilla/layout/generic/nsBRFrame.cpp @@ -108,7 +108,7 @@ BRFrame::Paint(nsIPresContext* aPresContext, { if ((NS_FRAME_PAINT_LAYER_DEBUG == aWhichLayer) && GetShowFrameBorders()) { float p2t; - aPresContext->GetPixelsToTwips(&p2t); + p2t = aPresContext->PixelsToTwips(); nscoord five = NSIntPixelsToTwips(5, p2t); aRenderingContext.SetColor(NS_RGB(0, 255, 255)); aRenderingContext.FillRect(0, 0, five, five*2); diff --git a/mozilla/layout/generic/nsBulletFrame.cpp b/mozilla/layout/generic/nsBulletFrame.cpp index 5a063a3128f..72f2583e6f1 100644 --- a/mozilla/layout/generic/nsBulletFrame.cpp +++ b/mozilla/layout/generic/nsBulletFrame.cpp @@ -1481,14 +1481,14 @@ nsBulletFrame::GetDesiredSize(nsIPresContext* aCX, case NS_STYLE_LIST_STYLE_DISC: case NS_STYLE_LIST_STYLE_CIRCLE: case NS_STYLE_LIST_STYLE_SQUARE: - aCX->GetTwipsToPixels(&t2p); + t2p = aCX->TwipsToPixels(); fm->GetMaxAscent(ascent); bulletSize = NSTwipsToIntPixels( (nscoord)NSToIntRound(0.8f * (float(ascent) / 2.0f)), t2p); if (bulletSize < 1) { bulletSize = MIN_BULLET_SIZE; } - aCX->GetPixelsToTwips(&p2t); + p2t = aCX->PixelsToTwips(); bulletSize = NSIntPixelsToTwips(bulletSize, p2t); mPadding.bottom = NSIntPixelsToTwips((nscoord) NSToIntRound((float)ascent / (8.0f * p2t)),p2t); aMetrics.width = mPadding.right + bulletSize; @@ -1681,7 +1681,7 @@ NS_IMETHODIMP nsBulletFrame::OnStartContainer(imgIRequest *aRequest, aImage->GetHeight(&h); float p2t; - mPresContext->GetPixelsToTwips(&p2t); + p2t = mPresContext->PixelsToTwips(); nsSize newsize(NSIntPixelsToTwips(w, p2t), NSIntPixelsToTwips(h, p2t)); @@ -1732,7 +1732,7 @@ NS_IMETHODIMP nsBulletFrame::OnDataAvailable(imgIRequest *aRequest, // XXX what if this frame ever has a padding or border? float p2t; - mPresContext->GetPixelsToTwips(&p2t); + p2t = mPresContext->PixelsToTwips(); r.x = NSIntPixelsToTwips(r.x, p2t); r.y = NSIntPixelsToTwips(r.y, p2t); r.width = NSIntPixelsToTwips(r.width, p2t); @@ -1773,7 +1773,7 @@ NS_IMETHODIMP nsBulletFrame::FrameChanged(imgIContainer *aContainer, nsRect r(*aDirtyRect); float p2t; - mPresContext->GetPixelsToTwips(&p2t); + p2t = mPresContext->PixelsToTwips(); r.x = NSIntPixelsToTwips(r.x, p2t); r.y = NSIntPixelsToTwips(r.y, p2t); r.width = NSIntPixelsToTwips(r.width, p2t); diff --git a/mozilla/layout/generic/nsFrameFrame.cpp b/mozilla/layout/generic/nsFrameFrame.cpp index ee0e2c8b52f..44ceb0e9fb7 100644 --- a/mozilla/layout/generic/nsFrameFrame.cpp +++ b/mozilla/layout/generic/nsFrameFrame.cpp @@ -422,7 +422,7 @@ nsSubDocumentFrame::Reflow(nsIPresContext* aPresContext, // resize the sub document if (baseWindow) { float t2p; - aPresContext->GetTwipsToPixels(&t2p); + t2p = aPresContext->TwipsToPixels(); PRInt32 x = 0; PRInt32 y = 0; diff --git a/mozilla/layout/generic/nsFrameSetFrame.cpp b/mozilla/layout/generic/nsFrameSetFrame.cpp index 4e56ae8349f..ca1c7e92c0d 100644 --- a/mozilla/layout/generic/nsFrameSetFrame.cpp +++ b/mozilla/layout/generic/nsFrameSetFrame.cpp @@ -615,7 +615,7 @@ void nsHTMLFramesetFrame::GenerateRowCol(nsIPresContext* aPresContext, nsString& aNewAttr) { float t2p; - aPresContext->GetTwipsToPixels(&t2p); + t2p = aPresContext->TwipsToPixels(); PRInt32 i; for (i = 0; i < aNumSpecs; i++) { @@ -1422,7 +1422,7 @@ nsHTMLFramesetFrame::StartMouseDrag(nsIPresContext* aPresContext, { if (mMinDrag == 0) { float p2t; - aPresContext->GetPixelsToTwips(&p2t); + p2t = aPresContext->PixelsToTwips(); mMinDrag = NSIntPixelsToTwips(2, p2t); // set min drag and min frame size to 2 pixels } @@ -1645,10 +1645,10 @@ nsHTMLFramesetBorderFrame::Paint(nsIPresContext* aPresContext, } float t2p; - aPresContext->GetTwipsToPixels(&t2p); + t2p = aPresContext->TwipsToPixels(); nscoord widthInPixels = NSTwipsToIntPixels(mWidth, t2p); float p2t; - aPresContext->GetPixelsToTwips(&p2t); + p2t = aPresContext->PixelsToTwips(); nscoord pixelWidth = NSIntPixelsToTwips(1, p2t); if (widthInPixels <= 0) { @@ -1820,7 +1820,7 @@ nsHTMLFramesetBlankFrame::Paint(nsIPresContext* aPresContext, //aRenderingContext.FillRect (mRect); float p2t; - aPresContext->GetPixelsToTwips(&p2t); + p2t = aPresContext->PixelsToTwips(); nscoord x0 = 0; nscoord y0 = 0; nscoord x1 = x0; diff --git a/mozilla/layout/generic/nsHTMLFrame.cpp b/mozilla/layout/generic/nsHTMLFrame.cpp index 153cfa896d8..0c1a4cfea44 100644 --- a/mozilla/layout/generic/nsHTMLFrame.cpp +++ b/mozilla/layout/generic/nsHTMLFrame.cpp @@ -450,7 +450,7 @@ CanvasFrame::Paint(nsIPresContext* aPresContext, outlineStyle.SetOutlineInvert(); float p2t; - aPresContext->GetPixelsToTwips(&p2t); + p2t = aPresContext->PixelsToTwips(); // XXX the CSS border for links is specified as 2px, but it // is only drawn as 1px. Match this here. nscoord onePixel = NSIntPixelsToTwips(1, p2t); diff --git a/mozilla/layout/generic/nsImageFrame.cpp b/mozilla/layout/generic/nsImageFrame.cpp index 5ddbdd12a70..4bad8c270a9 100644 --- a/mozilla/layout/generic/nsImageFrame.cpp +++ b/mozilla/layout/generic/nsImageFrame.cpp @@ -331,7 +331,7 @@ nsImageFrame::RecalculateTransform(imgIContainer* aImage) if (aImage) { float p2t; - GetPresContext()->GetPixelsToTwips(&p2t); + p2t = GetPresContext()->PixelsToTwips(); nsSize imageSizeInPx; aImage->GetWidth(&imageSizeInPx.width); @@ -415,7 +415,7 @@ nsRect nsImageFrame::ConvertPxRectToTwips(const nsRect& aRect) const { float p2t; - GetPresContext()->GetPixelsToTwips(&p2t); + p2t = GetPresContext()->PixelsToTwips(); return nsRect(NSIntPixelsToTwips(aRect.x, p2t), // x NSIntPixelsToTwips(aRect.y, p2t), // y NSIntPixelsToTwips(aRect.width, p2t), // width @@ -717,7 +717,7 @@ nsImageFrame::GetDesiredSize(nsIPresContext* aPresContext, } float p2t; - aPresContext->GetPixelsToTwips(&p2t); + p2t = aPresContext->PixelsToTwips(); if (currentContainer) { RecalculateTransform(currentContainer); @@ -737,7 +737,7 @@ nsImageFrame::GetDesiredSize(nsIPresContext* aPresContext, } float t2p, sp2t; - aPresContext->GetTwipsToPixels(&t2p); + t2p = aPresContext->TwipsToPixels(); aPresContext->GetScaledPixelsToTwips(&sp2t); // convert from normal twips to scaled twips (printing...) @@ -1536,7 +1536,7 @@ nsImageFrame::TranslateEventCoords(nsIPresContext* aPresContext, // Translate the coordinates from twips to pixels float t2p; - aPresContext->GetTwipsToPixels(&t2p); + t2p = aPresContext->TwipsToPixels(); aResult.x = NSTwipsToIntPixels(x, t2p); aResult.y = NSTwipsToIntPixels(y, t2p); } diff --git a/mozilla/layout/generic/nsImageMap.cpp b/mozilla/layout/generic/nsImageMap.cpp index 33aa852041e..d671aa319cb 100644 --- a/mozilla/layout/generic/nsImageMap.cpp +++ b/mozilla/layout/generic/nsImageMap.cpp @@ -494,7 +494,7 @@ void RectArea::Draw(nsIPresContext* aCX, nsIRenderingContext& aRC) if (mHasFocus) { if (mNumCoords >= 4) { float p2t; - aCX->GetPixelsToTwips(&p2t); + p2t = aCX->PixelsToTwips(); nscoord x1 = NSIntPixelsToTwips(mCoords[0], p2t); nscoord y1 = NSIntPixelsToTwips(mCoords[1], p2t); nscoord x2 = NSIntPixelsToTwips(mCoords[2], p2t); @@ -513,7 +513,7 @@ void RectArea::GetRect(nsIPresContext* aCX, nsRect& aRect) { if (mNumCoords >= 4) { float p2t; - aCX->GetPixelsToTwips(&p2t); + p2t = aCX->PixelsToTwips(); nscoord x1 = NSIntPixelsToTwips(mCoords[0], p2t); nscoord y1 = NSIntPixelsToTwips(mCoords[1], p2t); nscoord x2 = NSIntPixelsToTwips(mCoords[2], p2t); @@ -614,7 +614,7 @@ void PolyArea::Draw(nsIPresContext* aCX, nsIRenderingContext& aRC) if (mHasFocus) { if (mNumCoords >= 6) { float p2t; - aCX->GetPixelsToTwips(&p2t); + p2t = aCX->PixelsToTwips(); nscoord x0 = NSIntPixelsToTwips(mCoords[0], p2t); nscoord y0 = NSIntPixelsToTwips(mCoords[1], p2t); nscoord x1, y1; @@ -636,7 +636,7 @@ void PolyArea::GetRect(nsIPresContext* aCX, nsRect& aRect) { if (mNumCoords >= 6) { float p2t; - aCX->GetPixelsToTwips(&p2t); + p2t = aCX->PixelsToTwips(); nscoord x1, x2, y1, y2, xtmp, ytmp; x1 = x2 = NSIntPixelsToTwips(mCoords[0], p2t); y1 = y2 = NSIntPixelsToTwips(mCoords[1], p2t); @@ -700,7 +700,7 @@ void CircleArea::Draw(nsIPresContext* aCX, nsIRenderingContext& aRC) if (mHasFocus) { if (mNumCoords >= 3) { float p2t; - aCX->GetPixelsToTwips(&p2t); + p2t = aCX->PixelsToTwips(); nscoord x1 = NSIntPixelsToTwips(mCoords[0], p2t); nscoord y1 = NSIntPixelsToTwips(mCoords[1], p2t); nscoord radius = NSIntPixelsToTwips(mCoords[2], p2t); @@ -719,7 +719,7 @@ void CircleArea::GetRect(nsIPresContext* aCX, nsRect& aRect) { if (mNumCoords >= 3) { float p2t; - aCX->GetPixelsToTwips(&p2t); + p2t = aCX->PixelsToTwips(); nscoord x1 = NSIntPixelsToTwips(mCoords[0], p2t); nscoord y1 = NSIntPixelsToTwips(mCoords[1], p2t); nscoord radius = NSIntPixelsToTwips(mCoords[2], p2t); diff --git a/mozilla/layout/generic/nsObjectFrame.cpp b/mozilla/layout/generic/nsObjectFrame.cpp index e9b6404da08..129a1045150 100644 --- a/mozilla/layout/generic/nsObjectFrame.cpp +++ b/mozilla/layout/generic/nsObjectFrame.cpp @@ -1198,7 +1198,7 @@ nsObjectFrame::InstantiateWidget(nsIPresContext* aPresContext, // Just make the frigging widget float t2p; - aPresContext->GetTwipsToPixels(&t2p); + t2p = aPresContext->TwipsToPixels(); PRInt32 x = NSTwipsToIntPixels(origin.x, t2p); PRInt32 y = NSTwipsToIntPixels(origin.y, t2p); PRInt32 width = NSTwipsToIntPixels(aMetrics.width, t2p); @@ -1228,7 +1228,7 @@ nsObjectFrame::InstantiatePlugin(nsIPresContext* aPresContext, nsPluginWindow *window; float t2p; - aPresContext->GetTwipsToPixels(&t2p); + t2p = aPresContext->TwipsToPixels(); mFullURL = aURI; @@ -1321,7 +1321,7 @@ nsObjectFrame::ReinstantiatePlugin(nsIPresContext* aPresContext, nsHTMLReflowMet nsPoint origin; nsPluginWindow *window; float t2p; - aPresContext->GetTwipsToPixels(&t2p); + t2p = aPresContext->TwipsToPixels(); // we need to recalculate this now that we have access to the nsPluginInstanceOwner // and its size info (as set in the tag) @@ -1452,7 +1452,7 @@ nsPoint nsObjectFrame::GetWindowOriginInPixels(PRBool aWindowless) } float t2p; - presContext->GetTwipsToPixels(&t2p); + t2p = presContext->TwipsToPixels(); origin.x = NSTwipsToIntPixels(origin.x, t2p); origin.y = NSTwipsToIntPixels(origin.y, t2p); @@ -1608,7 +1608,7 @@ nsObjectFrame::Paint(nsIPresContext* aPresContext, rcTransform->GetTranslationCoord(&origin.x, &origin.y); // Get the conversion factor between pixels and twips - aPresContext->GetTwipsToPixels(&t2p); + t2p = aPresContext->TwipsToPixels(); // set it all up // XXX is windowless different? @@ -2392,7 +2392,7 @@ NS_IMETHODIMP nsPluginInstanceOwner::InvalidateRect(nsPluginRect *invalidRect) if (view) { float ptot; - mContext->GetPixelsToTwips(&ptot); + ptot = mContext->PixelsToTwips(); nsRect rect((int)(ptot * invalidRect->left), (int)(ptot * invalidRect->top), @@ -3988,7 +3988,7 @@ void nsPluginInstanceOwner::SetPluginHost(nsIPluginHost* aHost) static void ConvertTwipsToPixels(nsIPresContext& aPresContext, nsRect& aTwipsRect, nsRect& aPixelRect) { float t2p; - aPresContext.GetTwipsToPixels(&t2p); + t2p = aPresContext.TwipsToPixels(); aPixelRect.x = NSTwipsToIntPixels(aTwipsRect.x, t2p); aPixelRect.y = NSTwipsToIntPixels(aTwipsRect.y, t2p); aPixelRect.width = NSTwipsToIntPixels(aTwipsRect.width, t2p); diff --git a/mozilla/layout/generic/nsPlaceholderFrame.cpp b/mozilla/layout/generic/nsPlaceholderFrame.cpp index b9e1175f8c0..0bf6b4731ed 100644 --- a/mozilla/layout/generic/nsPlaceholderFrame.cpp +++ b/mozilla/layout/generic/nsPlaceholderFrame.cpp @@ -108,7 +108,7 @@ nsPlaceholderFrame::Paint(nsIPresContext* aPresContext, { if ((NS_FRAME_PAINT_LAYER_DEBUG == aWhichLayer) && GetShowFrameBorders()) { float p2t; - aPresContext->GetPixelsToTwips(&p2t); + p2t = aPresContext->PixelsToTwips(); aRenderingContext.SetColor(NS_RGB(0, 255, 255)); nscoord x = NSIntPixelsToTwips(-5, p2t); aRenderingContext.FillRect(x, 0, NSIntPixelsToTwips(13, p2t), diff --git a/mozilla/layout/generic/nsSimplePageSequence.cpp b/mozilla/layout/generic/nsSimplePageSequence.cpp index f5818708eef..c10075ab283 100644 --- a/mozilla/layout/generic/nsSimplePageSequence.cpp +++ b/mozilla/layout/generic/nsSimplePageSequence.cpp @@ -442,7 +442,7 @@ nsSimplePageSequenceFrame::Reflow(nsIPresContext* aPresContext, // once we reach the 32k boundary for positioning if (nsPageFrame::GetCreateWidget()) { float t2p; - aPresContext->GetTwipsToPixels(&t2p); + t2p = aPresContext->TwipsToPixels(); nscoord xp = NSTwipsToIntPixels(x, t2p); nscoord yp = NSTwipsToIntPixels(y, t2p); nsPageFrame::SetCreateWidget(xp < 0x8000 && yp < 0x8000); diff --git a/mozilla/layout/html/base/src/nsBRFrame.cpp b/mozilla/layout/html/base/src/nsBRFrame.cpp index 4be7091b312..686756520c4 100644 --- a/mozilla/layout/html/base/src/nsBRFrame.cpp +++ b/mozilla/layout/html/base/src/nsBRFrame.cpp @@ -108,7 +108,7 @@ BRFrame::Paint(nsIPresContext* aPresContext, { if ((NS_FRAME_PAINT_LAYER_DEBUG == aWhichLayer) && GetShowFrameBorders()) { float p2t; - aPresContext->GetPixelsToTwips(&p2t); + p2t = aPresContext->PixelsToTwips(); nscoord five = NSIntPixelsToTwips(5, p2t); aRenderingContext.SetColor(NS_RGB(0, 255, 255)); aRenderingContext.FillRect(0, 0, five, five*2); diff --git a/mozilla/layout/html/base/src/nsBulletFrame.cpp b/mozilla/layout/html/base/src/nsBulletFrame.cpp index 5a063a3128f..72f2583e6f1 100644 --- a/mozilla/layout/html/base/src/nsBulletFrame.cpp +++ b/mozilla/layout/html/base/src/nsBulletFrame.cpp @@ -1481,14 +1481,14 @@ nsBulletFrame::GetDesiredSize(nsIPresContext* aCX, case NS_STYLE_LIST_STYLE_DISC: case NS_STYLE_LIST_STYLE_CIRCLE: case NS_STYLE_LIST_STYLE_SQUARE: - aCX->GetTwipsToPixels(&t2p); + t2p = aCX->TwipsToPixels(); fm->GetMaxAscent(ascent); bulletSize = NSTwipsToIntPixels( (nscoord)NSToIntRound(0.8f * (float(ascent) / 2.0f)), t2p); if (bulletSize < 1) { bulletSize = MIN_BULLET_SIZE; } - aCX->GetPixelsToTwips(&p2t); + p2t = aCX->PixelsToTwips(); bulletSize = NSIntPixelsToTwips(bulletSize, p2t); mPadding.bottom = NSIntPixelsToTwips((nscoord) NSToIntRound((float)ascent / (8.0f * p2t)),p2t); aMetrics.width = mPadding.right + bulletSize; @@ -1681,7 +1681,7 @@ NS_IMETHODIMP nsBulletFrame::OnStartContainer(imgIRequest *aRequest, aImage->GetHeight(&h); float p2t; - mPresContext->GetPixelsToTwips(&p2t); + p2t = mPresContext->PixelsToTwips(); nsSize newsize(NSIntPixelsToTwips(w, p2t), NSIntPixelsToTwips(h, p2t)); @@ -1732,7 +1732,7 @@ NS_IMETHODIMP nsBulletFrame::OnDataAvailable(imgIRequest *aRequest, // XXX what if this frame ever has a padding or border? float p2t; - mPresContext->GetPixelsToTwips(&p2t); + p2t = mPresContext->PixelsToTwips(); r.x = NSIntPixelsToTwips(r.x, p2t); r.y = NSIntPixelsToTwips(r.y, p2t); r.width = NSIntPixelsToTwips(r.width, p2t); @@ -1773,7 +1773,7 @@ NS_IMETHODIMP nsBulletFrame::FrameChanged(imgIContainer *aContainer, nsRect r(*aDirtyRect); float p2t; - mPresContext->GetPixelsToTwips(&p2t); + p2t = mPresContext->PixelsToTwips(); r.x = NSIntPixelsToTwips(r.x, p2t); r.y = NSIntPixelsToTwips(r.y, p2t); r.width = NSIntPixelsToTwips(r.width, p2t); diff --git a/mozilla/layout/html/base/src/nsHTMLFrame.cpp b/mozilla/layout/html/base/src/nsHTMLFrame.cpp index 153cfa896d8..0c1a4cfea44 100644 --- a/mozilla/layout/html/base/src/nsHTMLFrame.cpp +++ b/mozilla/layout/html/base/src/nsHTMLFrame.cpp @@ -450,7 +450,7 @@ CanvasFrame::Paint(nsIPresContext* aPresContext, outlineStyle.SetOutlineInvert(); float p2t; - aPresContext->GetPixelsToTwips(&p2t); + p2t = aPresContext->PixelsToTwips(); // XXX the CSS border for links is specified as 2px, but it // is only drawn as 1px. Match this here. nscoord onePixel = NSIntPixelsToTwips(1, p2t); diff --git a/mozilla/layout/html/base/src/nsImageFrame.cpp b/mozilla/layout/html/base/src/nsImageFrame.cpp index 5ddbdd12a70..4bad8c270a9 100644 --- a/mozilla/layout/html/base/src/nsImageFrame.cpp +++ b/mozilla/layout/html/base/src/nsImageFrame.cpp @@ -331,7 +331,7 @@ nsImageFrame::RecalculateTransform(imgIContainer* aImage) if (aImage) { float p2t; - GetPresContext()->GetPixelsToTwips(&p2t); + p2t = GetPresContext()->PixelsToTwips(); nsSize imageSizeInPx; aImage->GetWidth(&imageSizeInPx.width); @@ -415,7 +415,7 @@ nsRect nsImageFrame::ConvertPxRectToTwips(const nsRect& aRect) const { float p2t; - GetPresContext()->GetPixelsToTwips(&p2t); + p2t = GetPresContext()->PixelsToTwips(); return nsRect(NSIntPixelsToTwips(aRect.x, p2t), // x NSIntPixelsToTwips(aRect.y, p2t), // y NSIntPixelsToTwips(aRect.width, p2t), // width @@ -717,7 +717,7 @@ nsImageFrame::GetDesiredSize(nsIPresContext* aPresContext, } float p2t; - aPresContext->GetPixelsToTwips(&p2t); + p2t = aPresContext->PixelsToTwips(); if (currentContainer) { RecalculateTransform(currentContainer); @@ -737,7 +737,7 @@ nsImageFrame::GetDesiredSize(nsIPresContext* aPresContext, } float t2p, sp2t; - aPresContext->GetTwipsToPixels(&t2p); + t2p = aPresContext->TwipsToPixels(); aPresContext->GetScaledPixelsToTwips(&sp2t); // convert from normal twips to scaled twips (printing...) @@ -1536,7 +1536,7 @@ nsImageFrame::TranslateEventCoords(nsIPresContext* aPresContext, // Translate the coordinates from twips to pixels float t2p; - aPresContext->GetTwipsToPixels(&t2p); + t2p = aPresContext->TwipsToPixels(); aResult.x = NSTwipsToIntPixels(x, t2p); aResult.y = NSTwipsToIntPixels(y, t2p); } diff --git a/mozilla/layout/html/base/src/nsImageMap.cpp b/mozilla/layout/html/base/src/nsImageMap.cpp index 33aa852041e..d671aa319cb 100644 --- a/mozilla/layout/html/base/src/nsImageMap.cpp +++ b/mozilla/layout/html/base/src/nsImageMap.cpp @@ -494,7 +494,7 @@ void RectArea::Draw(nsIPresContext* aCX, nsIRenderingContext& aRC) if (mHasFocus) { if (mNumCoords >= 4) { float p2t; - aCX->GetPixelsToTwips(&p2t); + p2t = aCX->PixelsToTwips(); nscoord x1 = NSIntPixelsToTwips(mCoords[0], p2t); nscoord y1 = NSIntPixelsToTwips(mCoords[1], p2t); nscoord x2 = NSIntPixelsToTwips(mCoords[2], p2t); @@ -513,7 +513,7 @@ void RectArea::GetRect(nsIPresContext* aCX, nsRect& aRect) { if (mNumCoords >= 4) { float p2t; - aCX->GetPixelsToTwips(&p2t); + p2t = aCX->PixelsToTwips(); nscoord x1 = NSIntPixelsToTwips(mCoords[0], p2t); nscoord y1 = NSIntPixelsToTwips(mCoords[1], p2t); nscoord x2 = NSIntPixelsToTwips(mCoords[2], p2t); @@ -614,7 +614,7 @@ void PolyArea::Draw(nsIPresContext* aCX, nsIRenderingContext& aRC) if (mHasFocus) { if (mNumCoords >= 6) { float p2t; - aCX->GetPixelsToTwips(&p2t); + p2t = aCX->PixelsToTwips(); nscoord x0 = NSIntPixelsToTwips(mCoords[0], p2t); nscoord y0 = NSIntPixelsToTwips(mCoords[1], p2t); nscoord x1, y1; @@ -636,7 +636,7 @@ void PolyArea::GetRect(nsIPresContext* aCX, nsRect& aRect) { if (mNumCoords >= 6) { float p2t; - aCX->GetPixelsToTwips(&p2t); + p2t = aCX->PixelsToTwips(); nscoord x1, x2, y1, y2, xtmp, ytmp; x1 = x2 = NSIntPixelsToTwips(mCoords[0], p2t); y1 = y2 = NSIntPixelsToTwips(mCoords[1], p2t); @@ -700,7 +700,7 @@ void CircleArea::Draw(nsIPresContext* aCX, nsIRenderingContext& aRC) if (mHasFocus) { if (mNumCoords >= 3) { float p2t; - aCX->GetPixelsToTwips(&p2t); + p2t = aCX->PixelsToTwips(); nscoord x1 = NSIntPixelsToTwips(mCoords[0], p2t); nscoord y1 = NSIntPixelsToTwips(mCoords[1], p2t); nscoord radius = NSIntPixelsToTwips(mCoords[2], p2t); @@ -719,7 +719,7 @@ void CircleArea::GetRect(nsIPresContext* aCX, nsRect& aRect) { if (mNumCoords >= 3) { float p2t; - aCX->GetPixelsToTwips(&p2t); + p2t = aCX->PixelsToTwips(); nscoord x1 = NSIntPixelsToTwips(mCoords[0], p2t); nscoord y1 = NSIntPixelsToTwips(mCoords[1], p2t); nscoord radius = NSIntPixelsToTwips(mCoords[2], p2t); diff --git a/mozilla/layout/html/base/src/nsObjectFrame.cpp b/mozilla/layout/html/base/src/nsObjectFrame.cpp index e9b6404da08..129a1045150 100644 --- a/mozilla/layout/html/base/src/nsObjectFrame.cpp +++ b/mozilla/layout/html/base/src/nsObjectFrame.cpp @@ -1198,7 +1198,7 @@ nsObjectFrame::InstantiateWidget(nsIPresContext* aPresContext, // Just make the frigging widget float t2p; - aPresContext->GetTwipsToPixels(&t2p); + t2p = aPresContext->TwipsToPixels(); PRInt32 x = NSTwipsToIntPixels(origin.x, t2p); PRInt32 y = NSTwipsToIntPixels(origin.y, t2p); PRInt32 width = NSTwipsToIntPixels(aMetrics.width, t2p); @@ -1228,7 +1228,7 @@ nsObjectFrame::InstantiatePlugin(nsIPresContext* aPresContext, nsPluginWindow *window; float t2p; - aPresContext->GetTwipsToPixels(&t2p); + t2p = aPresContext->TwipsToPixels(); mFullURL = aURI; @@ -1321,7 +1321,7 @@ nsObjectFrame::ReinstantiatePlugin(nsIPresContext* aPresContext, nsHTMLReflowMet nsPoint origin; nsPluginWindow *window; float t2p; - aPresContext->GetTwipsToPixels(&t2p); + t2p = aPresContext->TwipsToPixels(); // we need to recalculate this now that we have access to the nsPluginInstanceOwner // and its size info (as set in the tag) @@ -1452,7 +1452,7 @@ nsPoint nsObjectFrame::GetWindowOriginInPixels(PRBool aWindowless) } float t2p; - presContext->GetTwipsToPixels(&t2p); + t2p = presContext->TwipsToPixels(); origin.x = NSTwipsToIntPixels(origin.x, t2p); origin.y = NSTwipsToIntPixels(origin.y, t2p); @@ -1608,7 +1608,7 @@ nsObjectFrame::Paint(nsIPresContext* aPresContext, rcTransform->GetTranslationCoord(&origin.x, &origin.y); // Get the conversion factor between pixels and twips - aPresContext->GetTwipsToPixels(&t2p); + t2p = aPresContext->TwipsToPixels(); // set it all up // XXX is windowless different? @@ -2392,7 +2392,7 @@ NS_IMETHODIMP nsPluginInstanceOwner::InvalidateRect(nsPluginRect *invalidRect) if (view) { float ptot; - mContext->GetPixelsToTwips(&ptot); + ptot = mContext->PixelsToTwips(); nsRect rect((int)(ptot * invalidRect->left), (int)(ptot * invalidRect->top), @@ -3988,7 +3988,7 @@ void nsPluginInstanceOwner::SetPluginHost(nsIPluginHost* aHost) static void ConvertTwipsToPixels(nsIPresContext& aPresContext, nsRect& aTwipsRect, nsRect& aPixelRect) { float t2p; - aPresContext.GetTwipsToPixels(&t2p); + t2p = aPresContext.TwipsToPixels(); aPixelRect.x = NSTwipsToIntPixels(aTwipsRect.x, t2p); aPixelRect.y = NSTwipsToIntPixels(aTwipsRect.y, t2p); aPixelRect.width = NSTwipsToIntPixels(aTwipsRect.width, t2p); diff --git a/mozilla/layout/html/base/src/nsPlaceholderFrame.cpp b/mozilla/layout/html/base/src/nsPlaceholderFrame.cpp index b9e1175f8c0..0bf6b4731ed 100644 --- a/mozilla/layout/html/base/src/nsPlaceholderFrame.cpp +++ b/mozilla/layout/html/base/src/nsPlaceholderFrame.cpp @@ -108,7 +108,7 @@ nsPlaceholderFrame::Paint(nsIPresContext* aPresContext, { if ((NS_FRAME_PAINT_LAYER_DEBUG == aWhichLayer) && GetShowFrameBorders()) { float p2t; - aPresContext->GetPixelsToTwips(&p2t); + p2t = aPresContext->PixelsToTwips(); aRenderingContext.SetColor(NS_RGB(0, 255, 255)); nscoord x = NSIntPixelsToTwips(-5, p2t); aRenderingContext.FillRect(x, 0, NSIntPixelsToTwips(13, p2t), diff --git a/mozilla/layout/html/base/src/nsSimplePageSequence.cpp b/mozilla/layout/html/base/src/nsSimplePageSequence.cpp index f5818708eef..c10075ab283 100644 --- a/mozilla/layout/html/base/src/nsSimplePageSequence.cpp +++ b/mozilla/layout/html/base/src/nsSimplePageSequence.cpp @@ -442,7 +442,7 @@ nsSimplePageSequenceFrame::Reflow(nsIPresContext* aPresContext, // once we reach the 32k boundary for positioning if (nsPageFrame::GetCreateWidget()) { float t2p; - aPresContext->GetTwipsToPixels(&t2p); + t2p = aPresContext->TwipsToPixels(); nscoord xp = NSTwipsToIntPixels(x, t2p); nscoord yp = NSTwipsToIntPixels(y, t2p); nsPageFrame::SetCreateWidget(xp < 0x8000 && yp < 0x8000); diff --git a/mozilla/layout/html/document/src/nsFrameFrame.cpp b/mozilla/layout/html/document/src/nsFrameFrame.cpp index ee0e2c8b52f..44ceb0e9fb7 100644 --- a/mozilla/layout/html/document/src/nsFrameFrame.cpp +++ b/mozilla/layout/html/document/src/nsFrameFrame.cpp @@ -422,7 +422,7 @@ nsSubDocumentFrame::Reflow(nsIPresContext* aPresContext, // resize the sub document if (baseWindow) { float t2p; - aPresContext->GetTwipsToPixels(&t2p); + t2p = aPresContext->TwipsToPixels(); PRInt32 x = 0; PRInt32 y = 0; diff --git a/mozilla/layout/html/document/src/nsFrameSetFrame.cpp b/mozilla/layout/html/document/src/nsFrameSetFrame.cpp index 4e56ae8349f..ca1c7e92c0d 100644 --- a/mozilla/layout/html/document/src/nsFrameSetFrame.cpp +++ b/mozilla/layout/html/document/src/nsFrameSetFrame.cpp @@ -615,7 +615,7 @@ void nsHTMLFramesetFrame::GenerateRowCol(nsIPresContext* aPresContext, nsString& aNewAttr) { float t2p; - aPresContext->GetTwipsToPixels(&t2p); + t2p = aPresContext->TwipsToPixels(); PRInt32 i; for (i = 0; i < aNumSpecs; i++) { @@ -1422,7 +1422,7 @@ nsHTMLFramesetFrame::StartMouseDrag(nsIPresContext* aPresContext, { if (mMinDrag == 0) { float p2t; - aPresContext->GetPixelsToTwips(&p2t); + p2t = aPresContext->PixelsToTwips(); mMinDrag = NSIntPixelsToTwips(2, p2t); // set min drag and min frame size to 2 pixels } @@ -1645,10 +1645,10 @@ nsHTMLFramesetBorderFrame::Paint(nsIPresContext* aPresContext, } float t2p; - aPresContext->GetTwipsToPixels(&t2p); + t2p = aPresContext->TwipsToPixels(); nscoord widthInPixels = NSTwipsToIntPixels(mWidth, t2p); float p2t; - aPresContext->GetPixelsToTwips(&p2t); + p2t = aPresContext->PixelsToTwips(); nscoord pixelWidth = NSIntPixelsToTwips(1, p2t); if (widthInPixels <= 0) { @@ -1820,7 +1820,7 @@ nsHTMLFramesetBlankFrame::Paint(nsIPresContext* aPresContext, //aRenderingContext.FillRect (mRect); float p2t; - aPresContext->GetPixelsToTwips(&p2t); + p2t = aPresContext->PixelsToTwips(); nscoord x0 = 0; nscoord y0 = 0; nscoord x1 = x0; diff --git a/mozilla/layout/html/forms/src/nsComboboxControlFrame.cpp b/mozilla/layout/html/forms/src/nsComboboxControlFrame.cpp index 25db795bc0e..6196d3a6851 100644 --- a/mozilla/layout/html/forms/src/nsComboboxControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsComboboxControlFrame.cpp @@ -721,7 +721,7 @@ nsComboboxControlFrame::PositionDropdown(nsIPresContext* aPresContext, if (NS_SUCCEEDED(nsFormControlFrame::GetScreenHeight(aPresContext, screenHeightInPixels))) { // Get the height of the dropdown list in pixels. float t2p; - aPresContext->GetTwipsToPixels(&t2p); + t2p = aPresContext->TwipsToPixels(); nscoord absoluteDropDownHeight = NSTwipsToIntPixels(dropdownRect.height, t2p); // Check to see if the drop-down list will go offscreen @@ -2394,7 +2394,7 @@ nsComboboxControlFrame::Paint(nsIPresContext* aPresContext, } //aRenderingContext.DrawRect(clipRect); float p2t; - aPresContext->GetPixelsToTwips(&p2t); + p2t = aPresContext->PixelsToTwips(); nscoord onePixel = NSIntPixelsToTwips(1, p2t); clipRect.width -= onePixel; clipRect.height -= onePixel; diff --git a/mozilla/layout/html/forms/src/nsFieldSetFrame.cpp b/mozilla/layout/html/forms/src/nsFieldSetFrame.cpp index b81aa66070b..25ebaa8b59b 100644 --- a/mozilla/layout/html/forms/src/nsFieldSetFrame.cpp +++ b/mozilla/layout/html/forms/src/nsFieldSetFrame.cpp @@ -548,7 +548,7 @@ nsFieldSetFrame::Reflow(nsIPresContext* aPresContext, break; case NS_STYLE_TEXT_ALIGN_CENTER: float p2t; - aPresContext->GetPixelsToTwips(&p2t); + p2t = aPresContext->PixelsToTwips(); mLegendRect.x = NSIntPixelsToTwips((nscoord) NSToIntRound((float)(contentRect.width/2 - mLegendRect.width/2 + borderPadding.left) / p2t),p2t); } diff --git a/mozilla/layout/html/forms/src/nsFormControlFrame.cpp b/mozilla/layout/html/forms/src/nsFormControlFrame.cpp index e0dfb4f5eac..7913ec9f131 100644 --- a/mozilla/layout/html/forms/src/nsFormControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsFormControlFrame.cpp @@ -903,8 +903,8 @@ nsFormControlFrame::GetAbsoluteFramePosition(nsIPresContext* aPresContext, // Get conversions between twips and pixels float t2p; float p2t; - aPresContext->GetTwipsToPixels(&t2p); - aPresContext->GetPixelsToTwips(&p2t); + t2p = aPresContext->TwipsToPixels(); + p2t = aPresContext->PixelsToTwips(); // Start with frame's offset from it it's containing view nsIView *view = nsnull; diff --git a/mozilla/layout/html/forms/src/nsFormControlFrame.h b/mozilla/layout/html/forms/src/nsFormControlFrame.h index c846df7aed9..b1c4479dca0 100644 --- a/mozilla/layout/html/forms/src/nsFormControlFrame.h +++ b/mozilla/layout/html/forms/src/nsFormControlFrame.h @@ -61,7 +61,7 @@ class nsStyleCoord; #define COMPARE_QUIRK_SIZE(__class, __navWidth, __navHeight) \ { \ float t2p; \ - aPresContext->GetTwipsToPixels(&t2p); \ + t2p = aPresContext->TwipsToPixels(); \ printf ("%-25s::Size=%4d,%4d %3d,%3d Nav:%3d,%3d Diffs: %3d,%3d\n", \ (__class), \ aDesiredSize.width, aDesiredSize.height, \ diff --git a/mozilla/layout/html/forms/src/nsImageControlFrame.cpp b/mozilla/layout/html/forms/src/nsImageControlFrame.cpp index d83f6fedc63..a9869ff4024 100644 --- a/mozilla/layout/html/forms/src/nsImageControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsImageControlFrame.cpp @@ -332,7 +332,7 @@ nsImageControlFrame::HandleEvent(nsIPresContext* aPresContext, // Store click point for GetNamesValues // Do this on MouseUp because the specs don't say and that's what IE does. float t2p; - aPresContext->GetTwipsToPixels(&t2p); + t2p = aPresContext->TwipsToPixels(); mLastClickPoint.x = NSTwipsToIntPixels(aEvent->point.x, t2p); mLastClickPoint.y = NSTwipsToIntPixels(aEvent->point.y, t2p); diff --git a/mozilla/layout/html/forms/src/nsListControlFrame.cpp b/mozilla/layout/html/forms/src/nsListControlFrame.cpp index 8f2b403016a..e483fc96475 100644 --- a/mozilla/layout/html/forms/src/nsListControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsListControlFrame.cpp @@ -1228,7 +1228,7 @@ nsListControlFrame::Reflow(nsIPresContext* aPresContext, nscoord screenHeightInPixels = 0; if (NS_SUCCEEDED(nsFormControlFrame::GetScreenHeight(aPresContext, screenHeightInPixels))) { float p2t; - aPresContext->GetPixelsToTwips(&p2t); + p2t = aPresContext->PixelsToTwips(); nscoord screenHeight = NSIntPixelsToTwips(screenHeightInPixels, p2t); nscoord availDropHgt = (screenHeight / 2) - (heightOfARow*2); // approx half screen minus combo size diff --git a/mozilla/layout/html/forms/src/nsTextControlFrame.cpp b/mozilla/layout/html/forms/src/nsTextControlFrame.cpp index f3547a74c92..9ba62dde012 100644 --- a/mozilla/layout/html/forms/src/nsTextControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsTextControlFrame.cpp @@ -1407,7 +1407,7 @@ nsTextControlFrame::ReflowStandard(nsIPresContext* aPresContext, // Add in the size of the scrollbars for textarea if (IsTextArea()) { float p2t; - aPresContext->GetPixelsToTwips(&p2t); + p2t = aPresContext->PixelsToTwips(); nsIDeviceContext *dx = aPresContext->DeviceContext(); @@ -1468,7 +1468,7 @@ nsTextControlFrame::CalculateSizeStandard(nsIPresContext* aPresContext, // certainly a fixed-width font. if (charWidth != charMaxAdvance) { float p2t; - aPresContext->GetPixelsToTwips(&p2t); + p2t = aPresContext->PixelsToTwips(); nscoord internalPadding = PR_MAX(charMaxAdvance - NSToCoordRound(4 * p2t), 0); // round to a multiple of p2t nscoord t = NSToCoordRound(p2t); diff --git a/mozilla/layout/html/style/src/nsCSSRendering.cpp b/mozilla/layout/html/style/src/nsCSSRendering.cpp index 63c0bc75c97..68963287691 100644 --- a/mozilla/layout/html/style/src/nsCSSRendering.cpp +++ b/mozilla/layout/html/style/src/nsCSSRendering.cpp @@ -2189,7 +2189,7 @@ nscoord width; /* XXX something is misnamed here!!!! */ nscoord twipsPerPixel;/* XXX */ float p2t;/* XXX */ - aPresContext->GetPixelsToTwips(&p2t);/* XXX */ + p2t = aPresContext->PixelsToTwips();/* XXX */ twipsPerPixel = (nscoord) p2t;/* XXX */ nscolor outlineColor(NS_RGB(0,0,0)); // default to black in case it is invert color and the platform does not support that @@ -2281,7 +2281,7 @@ void nsCSSRendering::PaintBorderEdges(nsIPresContext* aPresContext, // Draw all the other sides nscoord twipsPerPixel; float p2t; - aPresContext->GetPixelsToTwips(&p2t); + p2t = aPresContext->PixelsToTwips(); twipsPerPixel = (nscoord) p2t;/* XXX huh!*/ if (0 == (aSkipSides & (1<GetHeight(&imageSize.height); float p2t; - aPresContext->GetPixelsToTwips(&p2t); + p2t = aPresContext->PixelsToTwips(); imageSize.width = NSIntPixelsToTwips(imageSize.width, p2t); imageSize.height = NSIntPixelsToTwips(imageSize.height, p2t); @@ -3417,7 +3417,7 @@ nsCSSRendering::PaintRoundedBackground(nsIPresContext* aPresContext, float p2t; // needed for our border thickness - aPresContext->GetPixelsToTwips(&p2t); + p2t = aPresContext->PixelsToTwips(); twipsPerPixel = NSToCoordRound(p2t); nscolor color = aColor.mBackgroundColor; @@ -3550,7 +3550,7 @@ nsCSSRendering::PaintRoundedBorder(nsIPresContext* aPresContext, } // needed for our border thickness - aPresContext->GetPixelsToTwips(&p2t); + p2t = aPresContext->PixelsToTwips(); twipsPerPixel = NSToCoordRound(p2t); // Base our thickness check on the segment being less than a pixel and 1/2 diff --git a/mozilla/layout/html/table/src/nsTableCellFrame.cpp b/mozilla/layout/html/table/src/nsTableCellFrame.cpp index 2062c27ac80..a3e8376228f 100644 --- a/mozilla/layout/html/table/src/nsTableCellFrame.cpp +++ b/mozilla/layout/html/table/src/nsTableCellFrame.cpp @@ -348,26 +348,22 @@ nsTableCellFrame::DecorateForSelection(nsIPresContext* aPresContext, GetColor(nsILookAndFeel::eColor_TextSelectBackground, bordercolor); } - float t2pfloat; - if (NS_SUCCEEDED(aPresContext->GetPixelsToTwips(&t2pfloat))) + PRInt16 t2p = (PRInt16) aPresContext->PixelsToTwips(); + if ((mRect.width >(3*t2p)) && (mRect.height > (3*t2p))) { - PRInt16 t2p = (PRInt16)t2pfloat; - if ((mRect.width >(3*t2p)) && (mRect.height > (3*t2p))) - { - //compare bordercolor to ((nsStyleColor *)myColor)->mBackgroundColor) - bordercolor = EnsureDifferentColors(bordercolor, aStyleColor->mBackgroundColor); - //outerrounded - aRenderingContext.SetColor(bordercolor); - aRenderingContext.DrawLine(t2p, 0, mRect.width, 0); - aRenderingContext.DrawLine(0, t2p, 0, mRect.height); - aRenderingContext.DrawLine(t2p, mRect.height, mRect.width, mRect.height); - aRenderingContext.DrawLine(mRect.width, t2p, mRect.width, mRect.height); - //middle - aRenderingContext.DrawRect(t2p, t2p, mRect.width-t2p, mRect.height-t2p); - //shading - aRenderingContext.DrawLine(2*t2p, mRect.height-2*t2p, mRect.width-t2p, mRect.height- (2*t2p)); - aRenderingContext.DrawLine(mRect.width - (2*t2p), 2*t2p, mRect.width - (2*t2p), mRect.height-t2p); - } + //compare bordercolor to ((nsStyleColor *)myColor)->mBackgroundColor) + bordercolor = EnsureDifferentColors(bordercolor, aStyleColor->mBackgroundColor); + //outerrounded + aRenderingContext.SetColor(bordercolor); + aRenderingContext.DrawLine(t2p, 0, mRect.width, 0); + aRenderingContext.DrawLine(0, t2p, 0, mRect.height); + aRenderingContext.DrawLine(t2p, mRect.height, mRect.width, mRect.height); + aRenderingContext.DrawLine(mRect.width, t2p, mRect.width, mRect.height); + //middle + aRenderingContext.DrawRect(t2p, t2p, mRect.width-t2p, mRect.height-t2p); + //shading + aRenderingContext.DrawLine(2*t2p, mRect.height-2*t2p, mRect.width-t2p, mRect.height- (2*t2p)); + aRenderingContext.DrawLine(mRect.width - (2*t2p), 2*t2p, mRect.width - (2*t2p), mRect.height-t2p); } } } diff --git a/mozilla/layout/html/table/src/nsTableFrame.cpp b/mozilla/layout/html/table/src/nsTableFrame.cpp index 9a9d485c804..099f9bcb459 100644 --- a/mozilla/layout/html/table/src/nsTableFrame.cpp +++ b/mozilla/layout/html/table/src/nsTableFrame.cpp @@ -3495,7 +3495,7 @@ nsTableFrame::DistributeHeightToRows(const nsHTMLReflowState& aReflowState, { nsIPresContext *presContext = GetPresContext(); float p2t; - presContext->GetPixelsToTwips(&p2t); + p2t = presContext->PixelsToTwips(); nscoord cellSpacingY = GetCellSpacingY(); @@ -4114,7 +4114,7 @@ nsTableFrame::CalcBorderBoxWidth(const nsHTMLReflowState& aState) if (NS_UNCONSTRAINEDSIZE != width) { float p2t; - GetPresContext()->GetPixelsToTwips(&p2t); + p2t = GetPresContext()->PixelsToTwips(); width = RoundToPixel(width, p2t); } diff --git a/mozilla/layout/html/table/src/nsTableRowGroupFrame.cpp b/mozilla/layout/html/table/src/nsTableRowGroupFrame.cpp index 54bcc613999..2fa9aa59b04 100644 --- a/mozilla/layout/html/table/src/nsTableRowGroupFrame.cpp +++ b/mozilla/layout/html/table/src/nsTableRowGroupFrame.cpp @@ -570,7 +570,7 @@ nsTableRowGroupFrame::CalculateRowHeights(nsIPresContext* aPresContext, // all table cells have the same top and bottom margins, namely cellSpacingY nscoord cellSpacingY = tableFrame->GetCellSpacingY(); float p2t; - aPresContext->GetPixelsToTwips(&p2t); + p2t = aPresContext->PixelsToTwips(); // find the nearest row index at or before aStartRowFrameIn that isn't spanned into. // If we have a computed height, then we can't compute the heights diff --git a/mozilla/layout/style/nsComputedDOMStyle.cpp b/mozilla/layout/style/nsComputedDOMStyle.cpp index 2fda5ddd6e9..0e1fbddccdd 100644 --- a/mozilla/layout/style/nsComputedDOMStyle.cpp +++ b/mozilla/layout/style/nsComputedDOMStyle.cpp @@ -197,7 +197,7 @@ nsComputedDOMStyle::Init(nsIDOMElement *aElement, NS_ENSURE_TRUE(presCtx, NS_ERROR_FAILURE); - presCtx->GetTwipsToPixels(&mT2P); + mT2P = presCtx->TwipsToPixels(); return NS_OK; } diff --git a/mozilla/layout/style/nsStyleStruct.cpp b/mozilla/layout/style/nsStyleStruct.cpp index 045b0bfb2db..9d5b5610bff 100644 --- a/mozilla/layout/style/nsStyleStruct.cpp +++ b/mozilla/layout/style/nsStyleStruct.cpp @@ -411,7 +411,7 @@ nsStyleBorder::nsStyleBorder(nsIPresContext* aPresContext) // XXX support mBorderWidths until deprecated methods are removed float pixelsToTwips = 20.0f; if (aPresContext) { - aPresContext->GetPixelsToTwips(&pixelsToTwips); + pixelsToTwips = aPresContext->PixelsToTwips(); } mBorderWidths[NS_STYLE_BORDER_WIDTH_THIN] = NSIntPixelsToTwips(1, pixelsToTwips); mBorderWidths[NS_STYLE_BORDER_WIDTH_MEDIUM] = NSIntPixelsToTwips(3, pixelsToTwips); @@ -617,7 +617,7 @@ nsStyleOutline::nsStyleOutline(nsIPresContext* aPresContext) // XXX support mBorderWidths until deprecated methods are removed float pixelsToTwips = 20.0f; if (aPresContext) - aPresContext->GetPixelsToTwips(&pixelsToTwips); + pixelsToTwips = aPresContext->PixelsToTwips(); mBorderWidths[NS_STYLE_BORDER_WIDTH_THIN] = NSIntPixelsToTwips(1, pixelsToTwips); mBorderWidths[NS_STYLE_BORDER_WIDTH_MEDIUM] = NSIntPixelsToTwips(3, pixelsToTwips); mBorderWidths[NS_STYLE_BORDER_WIDTH_THICK] = NSIntPixelsToTwips(5, pixelsToTwips); diff --git a/mozilla/layout/style/nsStyleUtil.cpp b/mozilla/layout/style/nsStyleUtil.cpp index 7560ef1a700..0dda3e7d1c0 100644 --- a/mozilla/layout/style/nsStyleUtil.cpp +++ b/mozilla/layout/style/nsStyleUtil.cpp @@ -226,7 +226,7 @@ nsStyleUtil::CalcFontPointSize(PRInt32 aHTMLSize, PRInt32 aBasePointSize, if ((fontSize >= sFontSizeTableMin) && (fontSize <= sFontSizeTableMax)) { float p2t; - aPresContext->GetPixelsToTwips(&p2t); + p2t = aPresContext->PixelsToTwips(); PRInt32 row = fontSize - sFontSizeTableMin; @@ -272,7 +272,7 @@ nscoord nsStyleUtil::FindNextSmallerFontSize(nscoord aFontSize, PRInt32 aBasePoi float p2t; nscoord onePx; - aPresContext->GetPixelsToTwips(&p2t); + p2t = aPresContext->PixelsToTwips(); onePx = NSToCoordRound(p2t); if (aFontSizeType == eFontSize_HTML) { @@ -340,7 +340,7 @@ nscoord nsStyleUtil::FindNextLargerFontSize(nscoord aFontSize, PRInt32 aBasePoin float p2t; nscoord onePx; - aPresContext->GetPixelsToTwips(&p2t); + p2t = aPresContext->PixelsToTwips(); onePx = NSToCoordRound(p2t); if (aFontSizeType == eFontSize_HTML) { @@ -383,7 +383,7 @@ nscoord nsStyleUtil::FindNextLargerFontSize(nscoord aFontSize, PRInt32 aBasePoin } else { // smaller than HTML table, increase by 1px float p2t; - aPresContext->GetPixelsToTwips(&p2t); + p2t = aPresContext->PixelsToTwips(); largerSize = aFontSize + NSToCoordRound(p2t); } return largerSize; diff --git a/mozilla/layout/svg/base/src/nsSVGOuterSVGFrame.cpp b/mozilla/layout/svg/base/src/nsSVGOuterSVGFrame.cpp index 59fdd78f5a1..aa40244e858 100644 --- a/mozilla/layout/svg/base/src/nsSVGOuterSVGFrame.cpp +++ b/mozilla/layout/svg/base/src/nsSVGOuterSVGFrame.cpp @@ -365,7 +365,7 @@ nsSVGOuterSVGFrame::Reflow(nsIPresContext* aPresContext, printf("nsSVGOuterSVGFrame(%p)::Reflow()[\n",this); float twipsPerScPx,twipsPerPx; aPresContext->GetScaledPixelsToTwips(&twipsPerScPx); - aPresContext->GetPixelsToTwips(&twipsPerPx); + twipsPerPx = aPresContext->PixelsToTwips(); printf("tw/sc(px)=%f tw/px=%f\n", twipsPerScPx, twipsPerPx); printf("]\n"); } @@ -787,7 +787,7 @@ nsSVGOuterSVGFrame::Paint(nsIPresContext* aPresContext, printf("scale=(%f,%f)\n", sx, sy); float twipsPerScPx,twipsPerPx; aPresContext->GetScaledPixelsToTwips(&twipsPerScPx); - aPresContext->GetPixelsToTwips(&twipsPerPx); + twipsPerPx = aPresContext->PixelsToTwips(); printf("tw/sc(px)=%f tw/px=%f\n", twipsPerScPx, twipsPerPx); int fontsc; aPresContext->GetFontScaler(&fontsc); diff --git a/mozilla/layout/svg/renderer/src/gdiplus/nsSVGGDIPlusGlyphMetrics.cpp b/mozilla/layout/svg/renderer/src/gdiplus/nsSVGGDIPlusGlyphMetrics.cpp index f24558528e4..547487d36f4 100644 --- a/mozilla/layout/svg/renderer/src/gdiplus/nsSVGGDIPlusGlyphMetrics.cpp +++ b/mozilla/layout/svg/renderer/src/gdiplus/nsSVGGDIPlusGlyphMetrics.cpp @@ -531,7 +531,7 @@ nsSVGGDIPlusGlyphMetrics::InitializeFontInfo() } float pxPerTwips; - presContext->GetTwipsToPixels(&pxPerTwips); + pxPerTwips = presContext->TwipsToPixels(); pxPerTwips/=GetPixelScale(); nsFont font; diff --git a/mozilla/layout/svg/renderer/src/libart/nsSVGLibartBitmapDefault.cpp b/mozilla/layout/svg/renderer/src/libart/nsSVGLibartBitmapDefault.cpp index 0c56c36f3dc..b6a30f34e49 100644 --- a/mozilla/layout/svg/renderer/src/libart/nsSVGLibartBitmapDefault.cpp +++ b/mozilla/layout/svg/renderer/src/libart/nsSVGLibartBitmapDefault.cpp @@ -118,7 +118,7 @@ nsSVGLibartBitmapDefault::Init(nsIRenderingContext* ctx, mRenderingContext = ctx; float twipsPerPx; - presContext->GetPixelsToTwips(&twipsPerPx); + twipsPerPx = presContext->PixelsToTwips(); mRectTwips.x = (nscoord)(rect.x*twipsPerPx); mRectTwips.y = (nscoord)(rect.y*twipsPerPx); mRectTwips.width = (nscoord)(rect.width*twipsPerPx); diff --git a/mozilla/layout/svg/renderer/src/libart/nsSVGLibartBitmapMac.cpp b/mozilla/layout/svg/renderer/src/libart/nsSVGLibartBitmapMac.cpp index dee51e3ccd7..d5822855722 100644 --- a/mozilla/layout/svg/renderer/src/libart/nsSVGLibartBitmapMac.cpp +++ b/mozilla/layout/svg/renderer/src/libart/nsSVGLibartBitmapMac.cpp @@ -117,7 +117,7 @@ nsSVGLibartBitmapMac::Init(nsIRenderingContext* ctx, mRenderingContext = ctx; float twipsPerPx; - presContext->GetPixelsToTwips(&twipsPerPx); + twipxPerPx = presContext->PixelsToTwips(); mRectTwips.x = (nscoord)(rect.x*twipsPerPx); mRectTwips.y = (nscoord)(rect.y*twipsPerPx); mRectTwips.width = (nscoord)(rect.width*twipsPerPx); diff --git a/mozilla/layout/svg/renderer/src/libart/nsSVGLibartGlyphMetricsFT.cpp b/mozilla/layout/svg/renderer/src/libart/nsSVGLibartGlyphMetricsFT.cpp index 7346f0b18d8..daca1326e3c 100644 --- a/mozilla/layout/svg/renderer/src/libart/nsSVGLibartGlyphMetricsFT.cpp +++ b/mozilla/layout/svg/renderer/src/libart/nsSVGLibartGlyphMetricsFT.cpp @@ -311,7 +311,7 @@ nsSVGLibartGlyphMetricsFT::GetTwipsToPixels() return 1.0f; } float twipstopixel; - presContext->GetTwipsToPixels(&twipstopixel); + twipstopixel = presContext->TwipsToPixels(); return twipstopixel; } diff --git a/mozilla/layout/tables/nsTableCellFrame.cpp b/mozilla/layout/tables/nsTableCellFrame.cpp index 2062c27ac80..a3e8376228f 100644 --- a/mozilla/layout/tables/nsTableCellFrame.cpp +++ b/mozilla/layout/tables/nsTableCellFrame.cpp @@ -348,26 +348,22 @@ nsTableCellFrame::DecorateForSelection(nsIPresContext* aPresContext, GetColor(nsILookAndFeel::eColor_TextSelectBackground, bordercolor); } - float t2pfloat; - if (NS_SUCCEEDED(aPresContext->GetPixelsToTwips(&t2pfloat))) + PRInt16 t2p = (PRInt16) aPresContext->PixelsToTwips(); + if ((mRect.width >(3*t2p)) && (mRect.height > (3*t2p))) { - PRInt16 t2p = (PRInt16)t2pfloat; - if ((mRect.width >(3*t2p)) && (mRect.height > (3*t2p))) - { - //compare bordercolor to ((nsStyleColor *)myColor)->mBackgroundColor) - bordercolor = EnsureDifferentColors(bordercolor, aStyleColor->mBackgroundColor); - //outerrounded - aRenderingContext.SetColor(bordercolor); - aRenderingContext.DrawLine(t2p, 0, mRect.width, 0); - aRenderingContext.DrawLine(0, t2p, 0, mRect.height); - aRenderingContext.DrawLine(t2p, mRect.height, mRect.width, mRect.height); - aRenderingContext.DrawLine(mRect.width, t2p, mRect.width, mRect.height); - //middle - aRenderingContext.DrawRect(t2p, t2p, mRect.width-t2p, mRect.height-t2p); - //shading - aRenderingContext.DrawLine(2*t2p, mRect.height-2*t2p, mRect.width-t2p, mRect.height- (2*t2p)); - aRenderingContext.DrawLine(mRect.width - (2*t2p), 2*t2p, mRect.width - (2*t2p), mRect.height-t2p); - } + //compare bordercolor to ((nsStyleColor *)myColor)->mBackgroundColor) + bordercolor = EnsureDifferentColors(bordercolor, aStyleColor->mBackgroundColor); + //outerrounded + aRenderingContext.SetColor(bordercolor); + aRenderingContext.DrawLine(t2p, 0, mRect.width, 0); + aRenderingContext.DrawLine(0, t2p, 0, mRect.height); + aRenderingContext.DrawLine(t2p, mRect.height, mRect.width, mRect.height); + aRenderingContext.DrawLine(mRect.width, t2p, mRect.width, mRect.height); + //middle + aRenderingContext.DrawRect(t2p, t2p, mRect.width-t2p, mRect.height-t2p); + //shading + aRenderingContext.DrawLine(2*t2p, mRect.height-2*t2p, mRect.width-t2p, mRect.height- (2*t2p)); + aRenderingContext.DrawLine(mRect.width - (2*t2p), 2*t2p, mRect.width - (2*t2p), mRect.height-t2p); } } } diff --git a/mozilla/layout/tables/nsTableFrame.cpp b/mozilla/layout/tables/nsTableFrame.cpp index 9a9d485c804..099f9bcb459 100644 --- a/mozilla/layout/tables/nsTableFrame.cpp +++ b/mozilla/layout/tables/nsTableFrame.cpp @@ -3495,7 +3495,7 @@ nsTableFrame::DistributeHeightToRows(const nsHTMLReflowState& aReflowState, { nsIPresContext *presContext = GetPresContext(); float p2t; - presContext->GetPixelsToTwips(&p2t); + p2t = presContext->PixelsToTwips(); nscoord cellSpacingY = GetCellSpacingY(); @@ -4114,7 +4114,7 @@ nsTableFrame::CalcBorderBoxWidth(const nsHTMLReflowState& aState) if (NS_UNCONSTRAINEDSIZE != width) { float p2t; - GetPresContext()->GetPixelsToTwips(&p2t); + p2t = GetPresContext()->PixelsToTwips(); width = RoundToPixel(width, p2t); } diff --git a/mozilla/layout/tables/nsTableRowGroupFrame.cpp b/mozilla/layout/tables/nsTableRowGroupFrame.cpp index 54bcc613999..2fa9aa59b04 100644 --- a/mozilla/layout/tables/nsTableRowGroupFrame.cpp +++ b/mozilla/layout/tables/nsTableRowGroupFrame.cpp @@ -570,7 +570,7 @@ nsTableRowGroupFrame::CalculateRowHeights(nsIPresContext* aPresContext, // all table cells have the same top and bottom margins, namely cellSpacingY nscoord cellSpacingY = tableFrame->GetCellSpacingY(); float p2t; - aPresContext->GetPixelsToTwips(&p2t); + p2t = aPresContext->PixelsToTwips(); // find the nearest row index at or before aStartRowFrameIn that isn't spanned into. // If we have a computed height, then we can't compute the heights diff --git a/mozilla/layout/xul/base/src/nsBoxObject.cpp b/mozilla/layout/xul/base/src/nsBoxObject.cpp index 46a2f9aff45..f421a9d9410 100644 --- a/mozilla/layout/xul/base/src/nsBoxObject.cpp +++ b/mozilla/layout/xul/base/src/nsBoxObject.cpp @@ -250,7 +250,7 @@ nsBoxObject::GetOffsetRect(nsRect& aRect) if(context) { // Get the scale from that Presentation Context float scale; - context->GetTwipsToPixels(&scale); + scale = context->TwipsToPixels(); // Convert to pixels using that scale aRect.x = NSTwipsToIntPixels(origin.x, scale); @@ -314,7 +314,7 @@ nsBoxObject::GetScreenRect(nsRect& aRect) if (widget) { // Get the scale from that Presentation Context float scale; - presContext->GetTwipsToPixels(&scale); + scale = presContext->TwipsToPixels(); // Convert to pixels using that scale offsetX = NSTwipsToIntPixels(offsetX, scale); diff --git a/mozilla/layout/xul/base/src/nsImageBoxFrame.cpp b/mozilla/layout/xul/base/src/nsImageBoxFrame.cpp index fc30b00f0e9..3e45927c738 100644 --- a/mozilla/layout/xul/base/src/nsImageBoxFrame.cpp +++ b/mozilla/layout/xul/base/src/nsImageBoxFrame.cpp @@ -732,7 +732,7 @@ NS_IMETHODIMP nsImageBoxFrame::OnStartContainer(imgIRequest *request, image->GetHeight(&h); float p2t; - mPresContext->GetPixelsToTwips(&p2t); + p2t = mPresContext->PixelsToTwips(); mIntrinsicSize.SizeTo(NSIntPixelsToTwips(w, p2t), NSIntPixelsToTwips(h, p2t)); diff --git a/mozilla/layout/xul/base/src/nsListBoxBodyFrame.cpp b/mozilla/layout/xul/base/src/nsListBoxBodyFrame.cpp index 4fc7acb941e..d009cf452c5 100644 --- a/mozilla/layout/xul/base/src/nsListBoxBodyFrame.cpp +++ b/mozilla/layout/xul/base/src/nsListBoxBodyFrame.cpp @@ -295,7 +295,7 @@ nsListBoxBodyFrame::AttributeChanged(nsIPresContext* aPresContext, PRInt32 dummy; PRInt32 count = rows.ToInteger(&dummy); float t2p; - aPresContext->GetTwipsToPixels(&t2p); + t2p = aPresContext->TwipsToPixels(); PRInt32 rowHeight = GetRowHeightTwips(); rowHeight = NSTwipsToIntPixels(rowHeight, t2p); nsAutoString value; @@ -661,7 +661,7 @@ nsListBoxBodyFrame::SetRowHeight(nscoord aRowHeight) PRInt32 dummy; PRInt32 count = rows.ToInteger(&dummy); float t2p; - mPresContext->GetTwipsToPixels(&t2p); + t2p = mPresContext->TwipsToPixels(); PRInt32 rowHeight = NSTwipsToIntPixels(aRowHeight, t2p); nsAutoString value; value.AppendInt(rowHeight*count); diff --git a/mozilla/layout/xul/base/src/nsMenuPopupFrame.cpp b/mozilla/layout/xul/base/src/nsMenuPopupFrame.cpp index 71a513f0a3c..ac26665949e 100644 --- a/mozilla/layout/xul/base/src/nsMenuPopupFrame.cpp +++ b/mozilla/layout/xul/base/src/nsMenuPopupFrame.cpp @@ -2263,7 +2263,7 @@ nsMenuPopupFrame::GetScreenPosition(nsIView* aView, nsPoint& aScreenPosition) rootWidget->WidgetToScreen(bounds, screenBounds); float t2p; - mPresContext->GetTwipsToPixels(&t2p); + t2p = mPresContext->TwipsToPixels(); aScreenPosition.x = NSTwipsToIntPixels(screenPos.x, t2p) + screenBounds.x; aScreenPosition.y = NSTwipsToIntPixels(screenPos.y, t2p) + screenBounds.y; diff --git a/mozilla/layout/xul/base/src/nsNativeScrollbarFrame.cpp b/mozilla/layout/xul/base/src/nsNativeScrollbarFrame.cpp index e8945129ce0..4c20355bab6 100644 --- a/mozilla/layout/xul/base/src/nsNativeScrollbarFrame.cpp +++ b/mozilla/layout/xul/base/src/nsNativeScrollbarFrame.cpp @@ -274,7 +274,7 @@ NS_IMETHODIMP nsNativeScrollbarFrame::GetPrefSize(nsBoxLayoutState& aState, nsSize& aSize) { float p2t = 0.0; - aState.GetPresContext()->GetPixelsToTwips(&p2t); + p2t = aState.GetPresContext()->PixelsToTwips(); PRInt32 narrowDimension = 0; nsCOMPtr native ( do_QueryInterface(mScrollbar) ); diff --git a/mozilla/layout/xul/base/src/nsScrollBoxObject.cpp b/mozilla/layout/xul/base/src/nsScrollBoxObject.cpp index f1d9ee0e608..852a74bc9b3 100644 --- a/mozilla/layout/xul/base/src/nsScrollBoxObject.cpp +++ b/mozilla/layout/xul/base/src/nsScrollBoxObject.cpp @@ -215,7 +215,7 @@ NS_IMETHODIMP nsScrollBoxObject::ScrollToElement(nsIDOMElement *child) nsCOMPtr context; mPresShell->GetPresContext(getter_AddRefs(context)); float pixelsToTwips = 0.0; - context->GetPixelsToTwips(&pixelsToTwips); + pixelsToTwips = context->PixelsToTwips(); // get our box nsIFrame* frame = GetFrame(); @@ -295,7 +295,7 @@ NS_IMETHODIMP nsScrollBoxObject::EnsureElementIsVisible(nsIDOMElement *child) nsCOMPtr context; mPresShell->GetPresContext(getter_AddRefs(context)); float pixelsToTwips = 0.0; - context->GetPixelsToTwips(&pixelsToTwips); + pixelsToTwips = context->PixelsToTwips(); // get our box nsIFrame* frame = GetFrame(); diff --git a/mozilla/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp b/mozilla/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp index 21e706d19f5..e7b87c2bcc1 100644 --- a/mozilla/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp +++ b/mozilla/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp @@ -794,7 +794,7 @@ NS_IMETHODIMP nsTreeBodyFrame::GetSelection(nsITreeSelection** aSelection) NS_IMETHODIMP nsTreeBodyFrame::GetRowHeight(PRInt32* _retval) { float t2p; - mPresContext->GetTwipsToPixels(&t2p); + t2p = mPresContext->TwipsToPixels(); *_retval = NSToCoordRound((float) mRowHeight * t2p); return NS_OK; @@ -1028,7 +1028,7 @@ nsTreeBodyFrame::UpdateScrollbar() if (!EnsureScrollbar()) return; float t2p; - mPresContext->GetTwipsToPixels(&t2p); + t2p = mPresContext->TwipsToPixels(); nscoord rowHeightAsPixels = NSToCoordRound((float)mRowHeight*t2p); nsAutoString curPos; @@ -1071,7 +1071,7 @@ void nsTreeBodyFrame::InvalidateScrollbar() nsAutoString maxposStr; float t2p; - mPresContext->GetTwipsToPixels(&t2p); + t2p = mPresContext->TwipsToPixels(); nscoord rowHeightAsPixels = NSToCoordRound((float)mRowHeight*t2p); PRInt32 size = rowHeightAsPixels*(mRowCount-mPageCount); @@ -1093,7 +1093,7 @@ nsTreeBodyFrame::AdjustEventCoordsToBoxCoordSpace (PRInt32 aX, PRInt32 aY, PRInt { // Convert our x and y coords to twips. float pixelsToTwips = 0.0; - mPresContext->GetPixelsToTwips(&pixelsToTwips); + pixelsToTwips = mPresContext->PixelsToTwips(); aX = NSToIntRound(aX * pixelsToTwips); aY = NSToIntRound(aY * pixelsToTwips); @@ -1412,7 +1412,7 @@ nsTreeBodyFrame::GetCoordsForCellItem(PRInt32 aRow, const PRUnichar *aColID, con } float t2p = 0.0; - mPresContext->GetTwipsToPixels(&t2p); + t2p = mPresContext->TwipsToPixels(); *aX = NSToIntRound(theRect.x * t2p); *aY = NSToIntRound(theRect.y * t2p); @@ -2019,7 +2019,7 @@ nsRect nsTreeBodyFrame::GetImageSize(PRInt32 aRowIndex, const PRUnichar* aColID, if (needWidth || needHeight) { // Get the natural image size. float p2t; - mPresContext->GetPixelsToTwips(&p2t); + p2t = mPresContext->PixelsToTwips(); if (needWidth) { // Get the size from the image. @@ -2061,11 +2061,11 @@ PRInt32 nsTreeBodyFrame::GetRowHeight() if (height > 0) { float t2p; - mPresContext->GetTwipsToPixels(&t2p); + t2p = mPresContext->TwipsToPixels(); height = NSTwipsToIntPixels(height, t2p); height += height % 2; float p2t; - mPresContext->GetPixelsToTwips(&p2t); + p2t = mPresContext->PixelsToTwips(); height = NSIntPixelsToTwips(height, p2t); // XXX Check box-sizing to determine if border/padding should augment the height @@ -2080,7 +2080,7 @@ PRInt32 nsTreeBodyFrame::GetRowHeight() } float p2t; - mPresContext->GetPixelsToTwips(&p2t); + p2t = mPresContext->PixelsToTwips(); return NSIntPixelsToTwips(18, p2t); // As good a default as any. } @@ -2097,7 +2097,7 @@ PRInt32 nsTreeBodyFrame::GetIndentation() } } float p2t; - mPresContext->GetPixelsToTwips(&p2t); + p2t = mPresContext->PixelsToTwips(); return NSIntPixelsToTwips(16, p2t); // As good a default as any. } @@ -2774,8 +2774,8 @@ nsTreeBodyFrame::PaintImage(PRInt32 aRowIndex, // Center the image. XXX Obey vertical-align style prop? float t2p, p2t; - mPresContext->GetTwipsToPixels(&t2p); - mPresContext->GetPixelsToTwips(&p2t); + t2p = mPresContext->TwipsToPixels(); + p2t = mPresContext->PixelsToTwips(); if (imageSize.height < imageRect.height) { p.y += (imageRect.height - imageSize.height)/2; @@ -3154,7 +3154,7 @@ nsTreeBodyFrame::PaintDropFeedback(const nsRect& aDropFeedbackRect, else { // Use default width 50px. float p2t; - mPresContext->GetPixelsToTwips(&p2t); + p2t = mPresContext->PixelsToTwips(); width = NSIntPixelsToTwips(50, p2t); } @@ -3165,7 +3165,7 @@ nsTreeBodyFrame::PaintDropFeedback(const nsRect& aDropFeedbackRect, else { // Use default height 2px. float p2t; - mPresContext->GetPixelsToTwips(&p2t); + p2t = mPresContext->PixelsToTwips(); height = NSIntPixelsToTwips(2, p2t); } @@ -3305,7 +3305,7 @@ nsTreeBodyFrame::ScrollInternal(PRInt32 aRow) mTopRowIndex += delta; float t2p; - mPresContext->GetTwipsToPixels(&t2p); + t2p = mPresContext->TwipsToPixels(); nscoord rowHeightAsPixels = NSToCoordRound((float)mRowHeight*t2p); // See if we have a background image. If we do, then we cannot blit. @@ -3337,7 +3337,7 @@ nsTreeBodyFrame::PositionChanged(PRInt32 aOldIndex, PRInt32& aNewIndex) return NS_ERROR_UNEXPECTED; float t2p; - mPresContext->GetTwipsToPixels(&t2p); + t2p = mPresContext->TwipsToPixels(); nscoord rh = NSToCoordRound((float)mRowHeight*t2p); nscoord oldrow = aOldIndex/rh; diff --git a/mozilla/toolkit/components/satchel/src/nsFormFillController.cpp b/mozilla/toolkit/components/satchel/src/nsFormFillController.cpp index dc20679bcc9..97f622aefeb 100644 --- a/mozilla/toolkit/components/satchel/src/nsFormFillController.cpp +++ b/mozilla/toolkit/components/satchel/src/nsFormFillController.cpp @@ -131,7 +131,7 @@ GetScreenOrigin(nsIDOMElement* aElement) if (presContext) { // Get the scale from that Presentation Context float scale; - presContext->GetTwipsToPixels(&scale); + scale = presContext->TwipsToPixels(); nsIFrame* frame; nsresult rv = presShell->GetPrimaryFrameFor(content, &frame); diff --git a/mozilla/widget/src/mac/nsDragService.cpp b/mozilla/widget/src/mac/nsDragService.cpp index feb1994c6cd..12771f7c43b 100644 --- a/mozilla/widget/src/mac/nsDragService.cpp +++ b/mozilla/widget/src/mac/nsDragService.cpp @@ -186,7 +186,7 @@ nsDragService::ComputeGlobalRectFromFrame ( nsIDOMNode* aDOMNode, Rect & outScre nsIWidget* aWidget = containingView->GetNearestWidget ( &widgetOffset ); float t2p = 1.0; - presContext->GetTwipsToPixels(&t2p); + t2p = presContext->TwipsToPixels(); // Shift our offset rect by offset into our view, and // the view's offset to the closest widget. Then convert that to global coordinates.