Fix to make radio buttons and checkbox show their values on Print (bug 109914). r=rods@netscape.com,sr=jst@netscape.com

This commit is contained in:
jkeiser@iname.com
2001-11-16 02:43:23 +00:00
parent dcae8da104
commit fe26ae09fc
4 changed files with 80 additions and 4 deletions

View File

@@ -46,6 +46,8 @@
#include "nsHTMLAtoms.h"
#include "nsINameSpaceManager.h"
#include "nsIPresState.h"
#include "nsIPresShell.h"
#include "nsIDocument.h"
#include "nsCSSRendering.h"
#ifdef ACCESSIBILITY
#include "nsIAccessibilityService.h"
@@ -284,7 +286,24 @@ void
nsGfxCheckboxControlFrame::InitializeControl(nsIPresContext* aPresContext)
{
nsFormControlFrame::InitializeControl(aPresContext);
nsFormControlHelper::Reset(this, aPresContext);
// Only reset on init if this is the primary shell
// Temporary workaround until checkbox state is in content
nsCOMPtr<nsIPresShell> presShell;
aPresContext->GetShell(getter_AddRefs(presShell));
if (!presShell) return;
nsCOMPtr<nsIDocument> doc;
presShell->GetDocument(getter_AddRefs(doc));
if (!doc) return;
nsCOMPtr<nsIPresShell> primaryPresShell;
doc->GetShellAt(0, getter_AddRefs(primaryPresShell));
if (!primaryPresShell) return;
if (presShell.get() == primaryPresShell.get()) {
nsFormControlHelper::Reset(this, aPresContext);
}
}
//------------------------------------------------------------