fix some warnings on windows
git-svn-id: svn://10.0.0.236/trunk@45318 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user