From cfebaf8914562155a71df66438da38ceafd297db Mon Sep 17 00:00:00 2001 From: "pavlov%netscape.com" Date: Tue, 31 Aug 1999 07:26:53 +0000 Subject: [PATCH] fix some warnings on windows git-svn-id: svn://10.0.0.236/trunk@45318 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/xul/base/src/nsColorPickerFrame.cpp | 8 ++++---- mozilla/layout/xul/base/src/nsStdColorPicker.cpp | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/mozilla/layout/xul/base/src/nsColorPickerFrame.cpp b/mozilla/layout/xul/base/src/nsColorPickerFrame.cpp index adcd6d8bc47..4532eba6b61 100644 --- a/mozilla/layout/xul/base/src/nsColorPickerFrame.cpp +++ b/mozilla/layout/xul/base/src/nsColorPickerFrame.cpp @@ -51,7 +51,7 @@ NS_NewColorPickerFrame(nsIFrame** aNewFrame) return NS_OK; } -static NS_DEFINE_IID(kDefColorPickerCID, NS_DEFCOLORPICKER_CID); +// static NS_DEFINE_IID(kDefColorPickerCID, NS_DEFCOLORPICKER_CID); // // nsColorPickerFrame cntr @@ -171,7 +171,7 @@ nsColorPickerFrame::Paint(nsIPresContext& aPresContext, // set the clip region PRInt32 width, height; mColorPicker->GetSize(&width, &height); - nsRect rect(0, 0, width*p2t, height*p2t); + nsRect rect(0, 0, PRInt32(width*p2t), PRInt32(height*p2t)); PRBool clipState; @@ -215,8 +215,8 @@ nsColorPickerFrame::GetDesiredSize(nsIPresContext* aPresContext, else aDesiredSize.height = -1; - mColorPicker->SetSize((aDesiredSize.width == -1) ? -1 : aDesiredSize.width /p2t, - (aDesiredSize.height == -1) ? -1 : aDesiredSize.height/p2t); + mColorPicker->SetSize((aDesiredSize.width == -1) ? -1 : PRInt32(aDesiredSize.width/p2t), + (aDesiredSize.height == -1) ? -1 : PRInt32(aDesiredSize.height/p2t)); int width, height; diff --git a/mozilla/layout/xul/base/src/nsStdColorPicker.cpp b/mozilla/layout/xul/base/src/nsStdColorPicker.cpp index 97241f34d4d..8ad1e65955a 100644 --- a/mozilla/layout/xul/base/src/nsStdColorPicker.cpp +++ b/mozilla/layout/xul/base/src/nsStdColorPicker.cpp @@ -119,7 +119,7 @@ NS_IMETHODIMP nsStdColorPicker::Init(nsIContent *aContent) { printf("web picked\n"); mPalette = WebPalette; - mNumCols = 15; + mNumCols = 12; mColors = sizeof(WebPalette) / sizeof(char *); } else if (palette.EqualsIgnoreCase("nose")) @@ -130,7 +130,7 @@ NS_IMETHODIMP nsStdColorPicker::Init(nsIContent *aContent) mColors = sizeof(NosePalette) / sizeof(char *); } - mNumRows = NSToIntCeil(mColors/mNumCols); + mNumRows = NSToIntCeil(nscoord(mColors/mNumCols)); return NS_OK; } @@ -195,19 +195,19 @@ NS_IMETHODIMP nsStdColorPicker::SetSize(PRInt32 aWidth, PRInt32 aHeight) mFrameHeight = aHeight; if (aWidth != -1) - mBlockWidth = NSToIntRound(mFrameWidth / mNumCols); + mBlockWidth = NSToIntRound(nscoord(aWidth / mNumCols)); if (aWidth != -1) - mBlockHeight = NSToIntRound(mFrameHeight / mNumRows); + mBlockHeight = NSToIntRound(nscoord(aHeight / mNumRows)); + + mFrameWidth = NSToIntRound(nscoord((mNumCols) * mBlockWidth)); + mFrameHeight = NSToIntRound(nscoord((mNumRows) * mBlockHeight)); return NS_OK; } NS_IMETHODIMP nsStdColorPicker::GetSize(PRInt32 *aWidth, PRInt32 *aHeight) { - mFrameWidth = NSToIntRound((mNumCols) * mBlockWidth); - mFrameHeight = NSToIntRound((mNumRows) * mBlockHeight); - *aWidth = mFrameWidth; *aHeight = mFrameHeight;