This commit is contained in:
scc%netscape.com 1999-10-20 18:59:00 +00:00
Родитель a20e5bc21b
Коммит fcc6a10651
10 изменённых файлов: 31 добавлений и 20 удалений

Просмотреть файл

@ -85,6 +85,10 @@ nsGfxCheckboxControlFrame::PaintCheckBox(nsIPresContext& aPresContext,
case eMixed:
PaintMixedMark(aRenderingContext, p2t, checkRect);
break;
// no special drawing otherwise
default:
break;
} // case of value of checkbox
} else {
// Get current checked state through content model.

Просмотреть файл

@ -213,7 +213,7 @@ nsCheckboxControlFrame::MouseUp(nsIPresContext* aPresContext)
// attribute changed event since we just set the state of the checkbox ourselves.
nsAutoString value;
CheckStateToString ( newState, value );
nsresult res = mContent->SetAttribute ( kNameSpaceID_None, GetTristateValueAtom(), value, PR_FALSE );
mContent->SetAttribute ( kNameSpaceID_None, GetTristateValueAtom(), value, PR_FALSE );
}
else {
CheckState newState = GetCheckboxState() == eOn ? eOff : eOn;
@ -384,7 +384,7 @@ nsCheckboxControlFrame :: SwitchModesWithEmergencyBrake ( PRBool inIsNowTristate
// our parallel attribute.
nsAutoString value;
CheckStateToString ( GetCheckboxState(), value );
nsresult res = mContent->SetAttribute ( kNameSpaceID_None, GetTristateValueAtom(), value, PR_FALSE );
mContent->SetAttribute ( kNameSpaceID_None, GetTristateValueAtom(), value, PR_FALSE );
}
else {
// we were a tri-state checkbox, and now we're a normal checkbox. The current

Просмотреть файл

@ -85,6 +85,10 @@ nsGfxCheckboxControlFrame::PaintCheckBox(nsIPresContext& aPresContext,
case eMixed:
PaintMixedMark(aRenderingContext, p2t, checkRect);
break;
// no special drawing otherwise
default:
break;
} // case of value of checkbox
} else {
// Get current checked state through content model.

Просмотреть файл

@ -83,7 +83,6 @@ nsFontPickerFrame :: GetDesiredSize(nsIPresContext* aPresContext,
nsHTMLReflowMetrics& aDesiredLayoutSize)
{
const int CSS_NOTSET = -1;
const int ATTR_NOTSET = -1;
nsSize styleSize;
if (NS_UNCONSTRAINEDSIZE != aReflowState.mComputedWidth) {

Просмотреть файл

@ -83,7 +83,6 @@ nsSpinnerFrame :: GetDesiredSize(nsIPresContext* aPresContext,
nsHTMLReflowMetrics& aDesiredLayoutSize)
{
const int CSS_NOTSET = -1;
const int ATTR_NOTSET = -1;
nsSize styleSize;
if (NS_UNCONSTRAINEDSIZE != aReflowState.mComputedWidth) {

Просмотреть файл

@ -290,9 +290,11 @@ printf ( "DRAGOVER:: toolbar content is %ld, as DOMNode %ld, target is %ld\n", c
mToolbar->GetContent ( getter_AddRefs(content) );
if ( content ) {
char buffer[10];
sprintf(buffer, "%ld", xLoc);
// need the cast, because on some platforms, PR[U]int32 != long, but we're using "%ld"
sprintf(buffer, "%ld", NS_STATIC_CAST(long, xLoc));
content->SetAttribute ( kNameSpaceID_None, nsXULAtoms::tbDropLocationCoord, buffer, PR_TRUE );
sprintf(buffer, "%ld", beforeIndex);
sprintf(buffer, "%ld", NS_STATIC_CAST(long, beforeIndex));
content->SetAttribute ( kNameSpaceID_None, nsXULAtoms::tbDropLocation, "1", PR_FALSE );
content->SetAttribute ( kNameSpaceID_None, nsXULAtoms::tbDropOn, onChild ? "true" : "false", PR_FALSE );
}

Просмотреть файл

@ -245,7 +245,7 @@ nsToolbarFrame::Init ( nsIPresContext& aPresContext, nsIContent* aContent,
for ( PRUint32 i = 0; i < length; ++i ) {
nsCOMPtr<nsIDOMNode> node;
inputList->Item(i, getter_AddRefs(node));
nsCOMPtr<nsIDOMEventReceiver> receiver(do_QueryInterface(node));
receiver = do_QueryInterface(node);
if ( receiver )
receiver->AddEventListenerByIID(new nsTEMPDragGestureEater, nsIDOMDragListener::GetIID());
// yes, i know this will leak. That's ok, i don't care because this code will go away

Просмотреть файл

@ -424,19 +424,22 @@ nsToolboxFrame::CalculateGrippies(nsIPresContext& aPresContext)
float p2t;
aPresContext.GetScaledPixelsToTwips(&p2t);
nscoord onePixel = NSIntPixelsToTwips(1, p2t);
nscoord grippyWidth = kGrippyWidthInPixels * onePixel; // remember to leave room for the grippy on the right
nscoord collapsedGrippyHeight = kCollapsedGrippyHeightInPixels * onePixel;
nscoord collapsedGrippyWidth = kCollapsedGrippyWidthInPixels * onePixel;
const PRBool isHorz = IsHorizontal();
// Leave room at the side for the grippies of visible toolbars. Make a margin
// of the appropriate dimensions.
mInset = nsMargin(0,0,0,0);
if ( isHorz ) // Set margins so we have a place for uncollapsed grippies
mInset.top = grippyWidth;
else
mInset.left = grippyWidth;
{
nscoord grippyWidth = kGrippyWidthInPixels * onePixel; // remember to leave room for the grippy on the right
// Leave room at the side for the grippies of visible toolbars. Make a margin
// of the appropriate dimensions.
mInset = nsMargin(0,0,0,0);
if ( isHorz ) // Set margins so we have a place for uncollapsed grippies
mInset.top = grippyWidth;
else
mInset.left = grippyWidth;
}
// Save old tabs so we can make newly collapsed bars as wide as they WERE tall. We will
// release the grippies in mGrippies at the very end when we dispose of |oldGrippies|

Просмотреть файл

@ -44,8 +44,8 @@ nsPrimitiveHelpers :: CreatePrimitiveForData ( const char* aFlavor, void* aDataB
if ( strcmp(aFlavor,kTextMime) == 0 ) {
nsCOMPtr<nsISupportsString> primitive;
nsresult rv = nsComponentManager::CreateInstance(NS_SUPPORTS_STRING_PROGID, nsnull,
NS_GET_IID(nsISupportsString), getter_AddRefs(primitive));
nsComponentManager::CreateInstance(NS_SUPPORTS_STRING_PROGID, nsnull,
NS_GET_IID(nsISupportsString), getter_AddRefs(primitive));
if ( primitive ) {
primitive->SetData ( (char*)aDataBuff );
nsCOMPtr<nsISupports> genericPrimitive ( do_QueryInterface(primitive) );

Просмотреть файл

@ -219,10 +219,10 @@ nsXIFFormatConverter::Convert(const char *aFromDataFlavor, nsISupports *aFromDat
// XIF on clipboard is going to always be double byte so it will be in a primitive
// class of nsISupportsWString. Also, since the data is in two byte chunks the
// length represents the length in 1-byte chars, so we need to divide by two.
nsCOMPtr<nsISupportsWString> dataWrapper ( do_QueryInterface(aFromData) );
if ( dataWrapper ) {
nsCOMPtr<nsISupportsWString> dataWrapper0 ( do_QueryInterface(aFromData) );
if ( dataWrapper0 ) {
nsXPIDLString data;
dataWrapper->ToString ( getter_Copies(data) ); //¥¥¥ COPY #1
dataWrapper0->ToString ( getter_Copies(data) ); //¥¥¥ COPY #1
if ( data ) {
PRUnichar* castedData = NS_CONST_CAST(PRUnichar*, NS_STATIC_CAST(const PRUnichar*, data));
nsAutoString dataStr ( CBufDescriptor(castedData, PR_TRUE, aDataLen) ); //¥¥¥ try not to copy the data