зеркало из https://github.com/mozilla/pjs.git
80834 - [outliner scrollbar] if inbox has less than one page of messages, it will come up with a box where the scroll bar is
80548 - outliner scroll bar "disappears" in 3 stages 111101 - No scrollbox / slider / thumb in thread pane scrollbar 116269 - white scrollbars briefly show up in folder pane 116432 - Sometimes the twisty won't update after a click 116855 - Modify outliner builder syntax to match outliner content model r=waterson, sspitzer, blake sr=hyatt 99715 - convert category tree to use outliner r=hixie sr=blake
This commit is contained in:
Родитель
19993e549d
Коммит
dd8495555b
|
@ -90,8 +90,6 @@
|
|||
#include "nsIObserverService.h"
|
||||
#include "nsIDocShell.h"
|
||||
#include "nsIMarkupDocumentViewer.h"
|
||||
#include "nsITreeFrame.h"
|
||||
#include "nsIOutlinerBoxObject.h"
|
||||
#include "nsIScrollableViewProvider.h"
|
||||
#include "nsIDOMDocumentRange.h"
|
||||
#include "nsIDOMDocumentEvent.h"
|
||||
|
|
|
@ -6385,41 +6385,50 @@ nsXULDocument::CheckTemplateBuilder(nsIContent* aElement)
|
|||
if (xblService)
|
||||
xblService->ResolveTag(aElement, &nameSpaceID, getter_AddRefs(baseTag));
|
||||
|
||||
// By default, we build content for outliner and then we attach
|
||||
// the outliner content view.
|
||||
// Flag "dont-build-content" is used to identify that we shouldn't build
|
||||
// content and just attach the outliner builder view.
|
||||
if ((nameSpaceID == kNameSpaceID_XUL) &&
|
||||
(baseTag.get() == nsXULAtoms::outlinerbody)) {
|
||||
nsCOMPtr<nsIXULTemplateBuilder> builder =
|
||||
do_CreateInstance("@mozilla.org/xul/xul-outliner-builder;1");
|
||||
nsAutoString flags;
|
||||
aElement->GetAttr(kNameSpaceID_None, nsXULAtoms::flags, flags);
|
||||
if (flags.Find(NS_LITERAL_STRING("dont-build-content").get()) >= 0) {
|
||||
nsCOMPtr<nsIXULTemplateBuilder> builder =
|
||||
do_CreateInstance("@mozilla.org/xul/xul-outliner-builder;1");
|
||||
|
||||
if (! builder)
|
||||
return NS_ERROR_FAILURE;
|
||||
if (! builder)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
// Because the outliner box object won't be created until the
|
||||
// frame is available, we need to tuck the template builder
|
||||
// away in the binding manager so there's at least one
|
||||
// reference to it.
|
||||
nsCOMPtr<nsIXULDocument> xuldoc = do_QueryInterface(doc);
|
||||
if (xuldoc)
|
||||
xuldoc->SetTemplateBuilderFor(aElement, builder);
|
||||
// Because the outliner box object won't be created until the
|
||||
// frame is available, we need to tuck the template builder
|
||||
// away in the binding manager so there's at least one
|
||||
// reference to it.
|
||||
nsCOMPtr<nsIXULDocument> xuldoc = do_QueryInterface(doc);
|
||||
if (xuldoc)
|
||||
xuldoc->SetTemplateBuilderFor(aElement, builder);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIRDFContentModelBuilder> builder
|
||||
= do_CreateInstance("@mozilla.org/xul/xul-template-builder;1");
|
||||
|
||||
if (! builder)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
builder->SetRootContent(aElement);
|
||||
|
||||
nsCOMPtr<nsIXULContent> xulcontent = do_QueryInterface(aElement);
|
||||
if (xulcontent) {
|
||||
// Mark the XUL element as being lazy, so the template builder
|
||||
// will run when layout first asks for these nodes.
|
||||
xulcontent->SetLazyState(nsIXULContent::eChildrenMustBeRebuilt);
|
||||
}
|
||||
else {
|
||||
nsCOMPtr<nsIRDFContentModelBuilder> builder
|
||||
= do_CreateInstance("@mozilla.org/xul/xul-template-builder;1");
|
||||
|
||||
if (! builder)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
builder->SetRootContent(aElement);
|
||||
|
||||
nsCOMPtr<nsIXULContent> xulcontent = do_QueryInterface(aElement);
|
||||
if (xulcontent) {
|
||||
// Mark the XUL element as being lazy, so the template builder
|
||||
// will run when layout first asks for these nodes.
|
||||
xulcontent->SetLazyState(nsIXULContent::eChildrenMustBeRebuilt);
|
||||
}
|
||||
else {
|
||||
// Force construction of immediate template sub-content _now_.
|
||||
builder->CreateContents(aElement);
|
||||
}
|
||||
// Force construction of immediate template sub-content _now_.
|
||||
builder->CreateContents(aElement);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
|
|
@ -1514,7 +1514,7 @@ nsXULContentBuilder::IsLazyWidgetItem(nsIContent* aElement)
|
|||
if ((tag.get() == nsXULAtoms::tree) || (tag.get() == nsXULAtoms::treeitem) ||
|
||||
(tag.get() == nsXULAtoms::menu) || (tag.get() == nsXULAtoms::menulist) ||
|
||||
(tag.get() == nsXULAtoms::menubutton) || (tag.get() == nsXULAtoms::toolbarbutton) ||
|
||||
(tag.get() == nsXULAtoms::button))
|
||||
(tag.get() == nsXULAtoms::button) || (tag == nsXULAtoms::outlineritem))
|
||||
return PR_TRUE;
|
||||
|
||||
return PR_FALSE;
|
||||
|
|
|
@ -1295,7 +1295,7 @@ nsXULOutlinerBuilder::CompileCondition(nsIAtom* aTag,
|
|||
{
|
||||
nsresult rv;
|
||||
|
||||
if (aTag == nsXULAtoms::outlinerrow)
|
||||
if (aTag == nsXULAtoms::outlineritem)
|
||||
rv = CompileOutlinerRowCondition(aRule, aCondition, aParentNode, aResult);
|
||||
else
|
||||
rv = nsXULTemplateBuilder::CompileCondition(aTag, aRule, aCondition, aParentNode, aResult);
|
||||
|
@ -1309,9 +1309,9 @@ nsXULOutlinerBuilder::CompileOutlinerRowCondition(nsTemplateRule* aRule,
|
|||
InnerNode* aParentNode,
|
||||
TestNode** aResult)
|
||||
{
|
||||
// Compile a <outlinerrow> condition, which must be of the form:
|
||||
// Compile a <outlineritem> condition, which must be of the form:
|
||||
//
|
||||
// <outlinerrow uri="?uri" />
|
||||
// <outlineritem uri="?uri" />
|
||||
//
|
||||
// Right now, exactly one <row> condition is required per rule. It
|
||||
// creates an nsOutlinerRowTestNode, binding the test's variable
|
||||
|
@ -1367,9 +1367,17 @@ nsXULOutlinerBuilder::GetTemplateActionRowFor(PRInt32 aRow, nsIContent** aResult
|
|||
nsCOMPtr<nsIContent> action;
|
||||
row.mMatch->mRule->GetContent(getter_AddRefs(action));
|
||||
|
||||
return nsXULContentUtils::FindChildByTag(action, kNameSpaceID_XUL,
|
||||
nsXULAtoms::outlinerrow,
|
||||
aResult);
|
||||
nsCOMPtr<nsIContent> children;
|
||||
nsXULContentUtils::FindChildByTag(action, kNameSpaceID_XUL, nsXULAtoms::outlinerchildren, getter_AddRefs(children));
|
||||
if (children) {
|
||||
nsCOMPtr<nsIContent> item;
|
||||
nsXULContentUtils::FindChildByTag(children, kNameSpaceID_XUL, nsXULAtoms::outlineritem, getter_AddRefs(item));
|
||||
if (item)
|
||||
return nsXULContentUtils::FindChildByTag(item, kNameSpaceID_XUL, nsXULAtoms::outlinerrow, aResult);
|
||||
}
|
||||
|
||||
*aResult = nsnull;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
@ -1377,37 +1385,37 @@ nsXULOutlinerBuilder::GetTemplateActionCellFor(PRInt32 aRow,
|
|||
const PRUnichar* aColID,
|
||||
nsIContent** aResult)
|
||||
{
|
||||
*aResult = nsnull;
|
||||
|
||||
nsCOMPtr<nsIContent> row;
|
||||
GetTemplateActionRowFor(aRow, getter_AddRefs(row));
|
||||
if (row) {
|
||||
PRInt32 colIndex;
|
||||
mBoxObject->GetColumnIndex(aColID, &colIndex);
|
||||
|
||||
PRInt32 count;
|
||||
row->ChildCount(count);
|
||||
|
||||
PRInt32 j = 0;
|
||||
for (PRInt32 i = 0; i < count; ++i) {
|
||||
nsCOMPtr<nsIContent> child;
|
||||
row->ChildAt(i, *getter_AddRefs(child));
|
||||
|
||||
if (! child)
|
||||
continue;
|
||||
|
||||
// XXX get base tag here?
|
||||
nsCOMPtr<nsIAtom> tag;
|
||||
child->GetTag(*getter_AddRefs(tag));
|
||||
|
||||
if (tag != nsXULAtoms::outlinercell)
|
||||
continue;
|
||||
|
||||
nsAutoString ref;
|
||||
child->GetAttr(kNameSpaceID_None, nsXULAtoms::ref, ref);
|
||||
|
||||
if (ref.Equals(aColID)) {
|
||||
NS_ADDREF(*aResult = child.get());
|
||||
return NS_OK;
|
||||
if (tag == nsXULAtoms::outlinercell) {
|
||||
nsAutoString ref;
|
||||
child->GetAttr(kNameSpaceID_None, nsXULAtoms::ref, ref);
|
||||
if (!ref.IsEmpty() && ref.Equals(aColID)) {
|
||||
*aResult = child;
|
||||
break;
|
||||
}
|
||||
else if (j == colIndex)
|
||||
*aResult = child;
|
||||
j++;
|
||||
}
|
||||
}
|
||||
}
|
||||
NS_IF_ADDREF(*aResult);
|
||||
|
||||
*aResult = nsnull;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -1295,7 +1295,7 @@ nsXULOutlinerBuilder::CompileCondition(nsIAtom* aTag,
|
|||
{
|
||||
nsresult rv;
|
||||
|
||||
if (aTag == nsXULAtoms::outlinerrow)
|
||||
if (aTag == nsXULAtoms::outlineritem)
|
||||
rv = CompileOutlinerRowCondition(aRule, aCondition, aParentNode, aResult);
|
||||
else
|
||||
rv = nsXULTemplateBuilder::CompileCondition(aTag, aRule, aCondition, aParentNode, aResult);
|
||||
|
@ -1309,9 +1309,9 @@ nsXULOutlinerBuilder::CompileOutlinerRowCondition(nsTemplateRule* aRule,
|
|||
InnerNode* aParentNode,
|
||||
TestNode** aResult)
|
||||
{
|
||||
// Compile a <outlinerrow> condition, which must be of the form:
|
||||
// Compile a <outlineritem> condition, which must be of the form:
|
||||
//
|
||||
// <outlinerrow uri="?uri" />
|
||||
// <outlineritem uri="?uri" />
|
||||
//
|
||||
// Right now, exactly one <row> condition is required per rule. It
|
||||
// creates an nsOutlinerRowTestNode, binding the test's variable
|
||||
|
@ -1367,9 +1367,17 @@ nsXULOutlinerBuilder::GetTemplateActionRowFor(PRInt32 aRow, nsIContent** aResult
|
|||
nsCOMPtr<nsIContent> action;
|
||||
row.mMatch->mRule->GetContent(getter_AddRefs(action));
|
||||
|
||||
return nsXULContentUtils::FindChildByTag(action, kNameSpaceID_XUL,
|
||||
nsXULAtoms::outlinerrow,
|
||||
aResult);
|
||||
nsCOMPtr<nsIContent> children;
|
||||
nsXULContentUtils::FindChildByTag(action, kNameSpaceID_XUL, nsXULAtoms::outlinerchildren, getter_AddRefs(children));
|
||||
if (children) {
|
||||
nsCOMPtr<nsIContent> item;
|
||||
nsXULContentUtils::FindChildByTag(children, kNameSpaceID_XUL, nsXULAtoms::outlineritem, getter_AddRefs(item));
|
||||
if (item)
|
||||
return nsXULContentUtils::FindChildByTag(item, kNameSpaceID_XUL, nsXULAtoms::outlinerrow, aResult);
|
||||
}
|
||||
|
||||
*aResult = nsnull;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
@ -1377,37 +1385,37 @@ nsXULOutlinerBuilder::GetTemplateActionCellFor(PRInt32 aRow,
|
|||
const PRUnichar* aColID,
|
||||
nsIContent** aResult)
|
||||
{
|
||||
*aResult = nsnull;
|
||||
|
||||
nsCOMPtr<nsIContent> row;
|
||||
GetTemplateActionRowFor(aRow, getter_AddRefs(row));
|
||||
if (row) {
|
||||
PRInt32 colIndex;
|
||||
mBoxObject->GetColumnIndex(aColID, &colIndex);
|
||||
|
||||
PRInt32 count;
|
||||
row->ChildCount(count);
|
||||
|
||||
PRInt32 j = 0;
|
||||
for (PRInt32 i = 0; i < count; ++i) {
|
||||
nsCOMPtr<nsIContent> child;
|
||||
row->ChildAt(i, *getter_AddRefs(child));
|
||||
|
||||
if (! child)
|
||||
continue;
|
||||
|
||||
// XXX get base tag here?
|
||||
nsCOMPtr<nsIAtom> tag;
|
||||
child->GetTag(*getter_AddRefs(tag));
|
||||
|
||||
if (tag != nsXULAtoms::outlinercell)
|
||||
continue;
|
||||
|
||||
nsAutoString ref;
|
||||
child->GetAttr(kNameSpaceID_None, nsXULAtoms::ref, ref);
|
||||
|
||||
if (ref.Equals(aColID)) {
|
||||
NS_ADDREF(*aResult = child.get());
|
||||
return NS_OK;
|
||||
if (tag == nsXULAtoms::outlinercell) {
|
||||
nsAutoString ref;
|
||||
child->GetAttr(kNameSpaceID_None, nsXULAtoms::ref, ref);
|
||||
if (!ref.IsEmpty() && ref.Equals(aColID)) {
|
||||
*aResult = child;
|
||||
break;
|
||||
}
|
||||
else if (j == colIndex)
|
||||
*aResult = child;
|
||||
j++;
|
||||
}
|
||||
}
|
||||
}
|
||||
NS_IF_ADDREF(*aResult);
|
||||
|
||||
*aResult = nsnull;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -33,26 +33,26 @@
|
|||
</groupbox>
|
||||
|
||||
<!-- category tree entries for editor -->
|
||||
<treechildren id="panelChildren">
|
||||
<treeitem container="true" open="true" id="editor" position="3">
|
||||
<treerow>
|
||||
<treecell class="treecell-indent" url="chrome://editor/content/pref-composer.xul" label="&compose.label;" />
|
||||
</treerow>
|
||||
<treechildren>
|
||||
<treeitem>
|
||||
<treerow>
|
||||
<treecell class="treecell-indent" url="chrome://editor/content/pref-editing.xul" label="&editing.label;"/>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
<outlinerchildren id="panelChildren">
|
||||
<outlineritem container="true" open="true" id="editor" position="3">
|
||||
<outlinerrow>
|
||||
<outlinercell url="chrome://editor/content/pref-composer.xul" label="&compose.label;" />
|
||||
</outlinerrow>
|
||||
<outlinerchildren>
|
||||
<outlineritem>
|
||||
<outlinerrow>
|
||||
<outlinercell url="chrome://editor/content/pref-editing.xul" label="&editing.label;"/>
|
||||
</outlinerrow>
|
||||
</outlineritem>
|
||||
<!--
|
||||
<treeitem>
|
||||
<treerow>
|
||||
<treecell class="treecell-indent" url="chrome://editor/content/pref-publish.xul" label="&publish.label;"/>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
<outlineritem>
|
||||
<outlinerrow>
|
||||
<outlinercell url="chrome://editor/content/pref-publish.xul" label="&publish.label;"/>
|
||||
</outlinerrow>
|
||||
</outlineritem>
|
||||
-->
|
||||
</treechildren>
|
||||
</treeitem>
|
||||
</treechildren>
|
||||
</outlinerchildren>
|
||||
</outlineritem>
|
||||
</outlinerchildren>
|
||||
|
||||
</overlay>
|
||||
|
|
|
@ -5,13 +5,13 @@
|
|||
<overlay id="contentPackPrefOverlay"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<treechildren id="appearanceChildren">
|
||||
<treeitem id="content-packs-panel" insertafter="themes-panel">
|
||||
<treerow>
|
||||
<treecell class="treecell-indent" url="chrome://content-packs/content/pref-contentpacks.xul" label="&content.label;"/>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
</treechildren>
|
||||
<outlinerchildren id="appearanceChildren">
|
||||
<outlineritem id="content-packs-panel" insertafter="themes-panel">
|
||||
<outlinerrow>
|
||||
<outlinercell url="chrome://content-packs/content/pref-contentpacks.xul" label="&content.label;"/>
|
||||
</outlinerrow>
|
||||
</outlineritem>
|
||||
</outlinerchildren>
|
||||
|
||||
</overlay>
|
||||
|
||||
|
|
|
@ -26,22 +26,20 @@
|
|||
<overlay id="cookiePrefsOverlay"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<treechildren id="securityChildren">
|
||||
<treeitem position="1">
|
||||
<treerow>
|
||||
<treecell class="treecell-indent"
|
||||
url="chrome://cookie/content/pref-cookies.xul"
|
||||
label="&cookies.label;"
|
||||
id="cookiesCell"/>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
<treeitem position="2">
|
||||
<treerow>
|
||||
<treecell class="treecell-indent"
|
||||
url="chrome://cookie/content/pref-images.xul"
|
||||
label="&images.label;"/>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
</treechildren>
|
||||
<outlinerchildren id="securityChildren">
|
||||
<outlineritem position="1">
|
||||
<outlinerrow>
|
||||
<outlinercell url="chrome://cookie/content/pref-cookies.xul"
|
||||
label="&cookies.label;"
|
||||
id="cookiesCell"/>
|
||||
</outlinerrow>
|
||||
</outlineritem>
|
||||
<outlineritem position="2">
|
||||
<outlinerrow>
|
||||
<outlinercell url="chrome://cookie/content/pref-images.xul"
|
||||
label="&images.label;"/>
|
||||
</outlinerrow>
|
||||
</outlineritem>
|
||||
</outlinerchildren>
|
||||
|
||||
</overlay>
|
||||
|
|
|
@ -500,6 +500,9 @@ inDOMView::ToggleOpenState(PRInt32 index)
|
|||
else
|
||||
ExpandNode(index);
|
||||
|
||||
// Update the twisty.
|
||||
mOutliner->InvalidateRow(index);
|
||||
|
||||
mOutliner->RowCountChanged(index+1, GetRowCount() - oldCount);
|
||||
|
||||
return NS_OK;
|
||||
|
|
|
@ -26,21 +26,19 @@
|
|||
<overlay id="walletPrefsOverlay"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<treechildren id="securityChildren">
|
||||
<treeitem position="1">
|
||||
<treerow>
|
||||
<treecell class="treecell-indent"
|
||||
url="chrome://wallet/content/pref-wallet.xul"
|
||||
label="&wallet.label;"/>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
<treeitem position="2">
|
||||
<treerow>
|
||||
<treecell class="treecell-indent"
|
||||
url="chrome://wallet/content/pref-passwords.xul"
|
||||
label="&passwords.label;"/>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
</treechildren>
|
||||
<outlinerchildren id="securityChildren">
|
||||
<outlineritem position="1">
|
||||
<outlinerrow>
|
||||
<outlinercell url="chrome://wallet/content/pref-wallet.xul"
|
||||
label="&wallet.label;"/>
|
||||
</outlinerrow>
|
||||
</outlineritem>
|
||||
<outlineritem position="2">
|
||||
<outlinerrow>
|
||||
<outlinercell url="chrome://wallet/content/pref-passwords.xul"
|
||||
label="&passwords.label;"/>
|
||||
</outlinerrow>
|
||||
</outlineritem>
|
||||
</outlinerchildren>
|
||||
|
||||
</overlay>
|
||||
|
|
|
@ -74,6 +74,11 @@ interface nsIOutlinerBoxObject : nsISupports
|
|||
*/
|
||||
readonly attribute long rowHeight;
|
||||
|
||||
/**
|
||||
* Get the index of the specified column.
|
||||
*/
|
||||
long getColumnIndex(in wstring colID);
|
||||
|
||||
/**
|
||||
* Get the index of the first visible row.
|
||||
*/
|
||||
|
@ -118,6 +123,7 @@ interface nsIOutlinerBoxObject : nsISupports
|
|||
* Invalidation methods for fine-grained painting control.
|
||||
*/
|
||||
void invalidate();
|
||||
void invalidateColumn(in wstring colID);
|
||||
void invalidateRow(in long index);
|
||||
void invalidateCell(in long row, in wstring colID);
|
||||
void invalidateRange(in long startIndex, in long endIndex);
|
||||
|
|
|
@ -56,6 +56,7 @@
|
|||
#include "nsIContent.h"
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsIBoxObject.h"
|
||||
#include "nsGUIEvent.h"
|
||||
#include "nsIDOMMouseEvent.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsIDOMNodeList.h"
|
||||
|
@ -79,6 +80,7 @@
|
|||
#include "nsBoxLayoutState.h"
|
||||
#include "nsIDragService.h"
|
||||
#include "nsOutlinerContentView.h"
|
||||
#include "nsOutlinerUtils.h"
|
||||
|
||||
#ifdef USE_IMG2
|
||||
#include "imgIRequest.h"
|
||||
|
@ -220,6 +222,27 @@ nsOutlinerColumn::nsOutlinerColumn(nsIContent* aColElement, nsIFrame* aFrame)
|
|||
mColElement->GetAttr(kNameSpaceID_None, nsXULAtoms::cycler, cycler);
|
||||
if (cycler.EqualsIgnoreCase("true"))
|
||||
mIsCyclerCol = PR_TRUE;
|
||||
|
||||
// Cache our index.
|
||||
mColIndex = -1;
|
||||
nsCOMPtr<nsIContent> parent;
|
||||
mColElement->GetParent(*getter_AddRefs(parent));
|
||||
PRInt32 count;
|
||||
parent->ChildCount(count);
|
||||
PRInt32 j = 0;
|
||||
for (PRInt32 i = 0; i < count; i++) {
|
||||
nsCOMPtr<nsIContent> child;
|
||||
parent->ChildAt(i, *getter_AddRefs(child));
|
||||
nsCOMPtr<nsIAtom> tag;
|
||||
child->GetTag(*getter_AddRefs(tag));
|
||||
if (tag == nsXULAtoms::outlinercol) {
|
||||
if (child == mColElement) {
|
||||
mColIndex = j;
|
||||
break;
|
||||
}
|
||||
j++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
inline nscoord nsOutlinerColumn::GetWidth()
|
||||
|
@ -269,12 +292,12 @@ NS_INTERFACE_MAP_END_INHERITING(nsLeafFrame)
|
|||
// Constructor
|
||||
nsOutlinerBodyFrame::nsOutlinerBodyFrame(nsIPresShell* aPresShell)
|
||||
:nsLeafBoxFrame(aPresShell), mPresContext(nsnull), mOutlinerBoxObject(nsnull), mFocused(PR_FALSE), mImageCache(nsnull),
|
||||
mColumns(nsnull), mScrollbar(nsnull), mTopRowIndex(0), mRowHeight(0), mIndentation(0),
|
||||
mColumns(nsnull), mScrollbar(nsnull), mTopRowIndex(0), mRowHeight(0), mIndentation(0), mColumnsDirty(PR_TRUE),
|
||||
mDropRow(kIllegalRow), mDropOrient(kNoOrientation), mDropAllowed(PR_FALSE), mIsSortRectDrawn(PR_FALSE),
|
||||
mAlreadyUndrewDueToScroll(PR_FALSE), mOpenTimer(nsnull), mOpenTimerRow(-1)
|
||||
mAlreadyUndrewDueToScroll(PR_FALSE), mOpenTimer(nsnull), mOpenTimerRow(-1),
|
||||
mVerticalOverflow(PR_FALSE)
|
||||
{
|
||||
NS_NewISupportsArray(getter_AddRefs(mScratchArray));
|
||||
mColumnsDirty = PR_TRUE;
|
||||
}
|
||||
|
||||
// Destructor
|
||||
|
@ -326,7 +349,7 @@ nsOutlinerBodyFrame::Init(nsIPresContext* aPresContext, nsIContent* aContent,
|
|||
nsIView* ourView;
|
||||
nsLeafBoxFrame::GetView(aPresContext, &ourView);
|
||||
|
||||
static NS_DEFINE_IID(kWidgetCID, NS_CHILD_CID);
|
||||
static NS_DEFINE_IID(kWidgetCID, NS_CHILD_CID);
|
||||
|
||||
ourView->CreateWidget(kWidgetCID);
|
||||
ourView->GetWidget(*getter_AddRefs(mOutlinerWidget));
|
||||
|
@ -423,8 +446,9 @@ NS_IMETHODIMP nsOutlinerBodyFrame::Reflow(nsIPresContext* aPresContext,
|
|||
xulele->GetBuilder(getter_AddRefs(builder));
|
||||
if (builder)
|
||||
view = do_QueryInterface(builder);
|
||||
else {
|
||||
// No builder, create a outliner content model view.
|
||||
|
||||
if (!view) {
|
||||
// No outliner builder, create a outliner content view.
|
||||
nsCOMPtr<nsIOutlinerContentView> contentView;
|
||||
NS_NewOutlinerContentView(getter_AddRefs(contentView));
|
||||
if (contentView) {
|
||||
|
@ -450,12 +474,13 @@ NS_IMETHODIMP nsOutlinerBodyFrame::Reflow(nsIPresContext* aPresContext,
|
|||
ScrollToRow(lastPageTopRow);
|
||||
|
||||
InvalidateScrollbar();
|
||||
SetVisibleScrollbar((rowCount >= mPageCount));
|
||||
CheckVerticalOverflow();
|
||||
}
|
||||
|
||||
return nsLeafBoxFrame::Reflow(aPresContext, aReflowMetrics, aReflowState, aStatus);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
AdjustForBorderPadding(nsIStyleContext* aContext, nsRect& aRect)
|
||||
{
|
||||
|
@ -522,9 +547,7 @@ NS_IMETHODIMP nsOutlinerBodyFrame::SetView(nsIOutlinerView * aView)
|
|||
// Reset scrollbar position.
|
||||
UpdateScrollbar();
|
||||
|
||||
PRInt32 rowCount;
|
||||
mView->GetRowCount(&rowCount);
|
||||
SetVisibleScrollbar((rowCount >= mPageCount));
|
||||
CheckVerticalOverflow();
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
@ -582,6 +605,19 @@ NS_IMETHODIMP nsOutlinerBodyFrame::GetRowHeight(PRInt32* _retval)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsOutlinerBodyFrame::GetColumnIndex(const PRUnichar *aColID, PRInt32 *_retval)
|
||||
{
|
||||
*_retval = -1;
|
||||
for (nsOutlinerColumn* currCol = mColumns; currCol; currCol = currCol->GetNext()) {
|
||||
if (nsCRT::strcmp(currCol->GetID(), aColID) == 0) {
|
||||
*_retval = currCol->GetColIndex();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsOutlinerBodyFrame::GetFirstVisibleRow(PRInt32 *_retval)
|
||||
{
|
||||
*_retval = mTopRowIndex;
|
||||
|
@ -609,6 +645,22 @@ NS_IMETHODIMP nsOutlinerBodyFrame::Invalidate()
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsOutlinerBodyFrame::InvalidateColumn(const PRUnichar *aColID)
|
||||
{
|
||||
nscoord currX = mInnerBox.x;
|
||||
for (nsOutlinerColumn* currCol = mColumns; currCol && currX < mInnerBox.x+mInnerBox.width;
|
||||
currCol = currCol->GetNext()) {
|
||||
if (nsCRT::strcmp(currCol->GetID(), aColID) == 0) {
|
||||
nsRect columnRect(currX, mInnerBox.y, currCol->GetWidth(), mInnerBox.height);
|
||||
nsLeafBoxFrame::Invalidate(mPresContext, columnRect, PR_FALSE);
|
||||
break;
|
||||
}
|
||||
currX += currCol->GetWidth();
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsOutlinerBodyFrame::InvalidateRow(PRInt32 aIndex)
|
||||
{
|
||||
if (aIndex < mTopRowIndex || aIndex > mTopRowIndex + mPageCount + 1)
|
||||
|
@ -630,9 +682,8 @@ NS_IMETHODIMP nsOutlinerBodyFrame::InvalidateCell(PRInt32 aIndex, const PRUnicha
|
|||
nscoord yPos = mInnerBox.y+mRowHeight*(aIndex-mTopRowIndex);
|
||||
for (nsOutlinerColumn* currCol = mColumns; currCol && currX < mInnerBox.x+mInnerBox.width;
|
||||
currCol = currCol->GetNext()) {
|
||||
nsRect cellRect(currX, yPos, currCol->GetWidth(), mRowHeight);
|
||||
|
||||
if (nsCRT::strcmp(currCol->GetID(), aColID) == 0) {
|
||||
nsRect cellRect(currX, yPos, currCol->GetWidth(), mRowHeight);
|
||||
nsLeafBoxFrame::Invalidate(mPresContext, cellRect, PR_FALSE);
|
||||
break;
|
||||
}
|
||||
|
@ -681,29 +732,33 @@ nsOutlinerBodyFrame::UpdateScrollbar()
|
|||
scrollbarContent->SetAttr(kNameSpaceID_None, nsXULAtoms::curpos, curPos, PR_TRUE);
|
||||
}
|
||||
|
||||
nsresult nsOutlinerBodyFrame::SetVisibleScrollbar(PRBool aSetVisible)
|
||||
nsresult nsOutlinerBodyFrame::CheckVerticalOverflow()
|
||||
{
|
||||
NS_ASSERTION(mScrollbar, "no scroll bar");
|
||||
if (!mScrollbar)
|
||||
return NS_OK;
|
||||
PRBool verticalOverflowChanged = PR_FALSE;
|
||||
|
||||
nsCOMPtr<nsIContent> scrollbarContent;
|
||||
mScrollbar->GetContent(getter_AddRefs(scrollbarContent));
|
||||
PRInt32 rowCount;
|
||||
mView->GetRowCount(&rowCount);
|
||||
if (!mVerticalOverflow && rowCount >= mPageCount) {
|
||||
mVerticalOverflow = PR_TRUE;
|
||||
verticalOverflowChanged = PR_TRUE;
|
||||
}
|
||||
else if (mVerticalOverflow && rowCount < mPageCount) {
|
||||
mVerticalOverflow = PR_FALSE;
|
||||
verticalOverflowChanged = PR_TRUE;
|
||||
}
|
||||
|
||||
if (verticalOverflowChanged) {
|
||||
nsScrollPortEvent* event = new nsScrollPortEvent();
|
||||
event->eventStructType = NS_SCROLLPORT_EVENT;
|
||||
event->widget = nsnull;
|
||||
event->orient = nsScrollPortEvent::vertical;
|
||||
event->nativeMsg = nsnull;
|
||||
event->message = mVerticalOverflow ? NS_SCROLLPORT_OVERFLOW : NS_SCROLLPORT_UNDERFLOW;
|
||||
|
||||
nsAutoString isCollapsed;
|
||||
scrollbarContent->GetAttr(kNameSpaceID_None, nsXULAtoms::collapsed,
|
||||
isCollapsed);
|
||||
|
||||
if (!isCollapsed.IsEmpty() && aSetVisible)
|
||||
scrollbarContent->UnsetAttr(kNameSpaceID_None, nsXULAtoms::collapsed,
|
||||
PR_TRUE);
|
||||
else if (isCollapsed.IsEmpty() && !aSetVisible)
|
||||
scrollbarContent->SetAttr(kNameSpaceID_None, nsXULAtoms::collapsed,
|
||||
NS_LITERAL_STRING("true"), PR_TRUE);
|
||||
else
|
||||
return NS_OK;
|
||||
|
||||
Invalidate();
|
||||
nsCOMPtr<nsIPresShell> shell;
|
||||
mPresContext->GetShell(getter_AddRefs(shell));
|
||||
shell->PostDOMEvent(mContent, event);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -939,10 +994,6 @@ nsOutlinerBodyFrame::GetCoordsForCellItem(PRInt32 aRow, const PRUnichar *aColID,
|
|||
cellX += mIndentation * level;
|
||||
remainWidth -= mIndentation * level;
|
||||
|
||||
// Start the Twisty Rect as the full width of the cell, and gradually decrement its width
|
||||
// as we figure out the size of other elements.
|
||||
nsRect twistyRect(cellX, cellRect.y, remainWidth, cellRect.height);
|
||||
|
||||
PRBool hasTwisty = PR_FALSE;
|
||||
PRBool isContainer = PR_FALSE;
|
||||
mView->IsContainer(aRow, &isContainer);
|
||||
|
@ -1283,7 +1334,7 @@ NS_IMETHODIMP nsOutlinerBodyFrame::RowCountChanged(PRInt32 aIndex, PRInt32 aCoun
|
|||
if (mTopRowIndex == 0) {
|
||||
// Just update the scrollbar and return.
|
||||
InvalidateScrollbar();
|
||||
SetVisibleScrollbar((rowCount >= mPageCount));
|
||||
CheckVerticalOverflow();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -1312,7 +1363,7 @@ NS_IMETHODIMP nsOutlinerBodyFrame::RowCountChanged(PRInt32 aIndex, PRInt32 aCoun
|
|||
}
|
||||
|
||||
InvalidateScrollbar();
|
||||
SetVisibleScrollbar((rowCount >= mPageCount));
|
||||
CheckVerticalOverflow();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -1894,7 +1945,9 @@ NS_IMETHODIMP nsOutlinerBodyFrame::PaintCell(int aRowIndex,
|
|||
style = borderStyle->GetBorderStyle(NS_SIDE_LEFT);
|
||||
aRenderingContext.SetLineStyle(ConvertBorderStyleToLineStyle(style));
|
||||
|
||||
PRInt32 x;
|
||||
nsRect imageSize(0,0,0,0);
|
||||
|
||||
PRInt32 x = currX;
|
||||
PRInt32 y = (aRowIndex - mTopRowIndex) * mRowHeight;
|
||||
|
||||
// Compute the maximal level to paint.
|
||||
|
@ -1912,13 +1965,17 @@ NS_IMETHODIMP nsOutlinerBodyFrame::PaintCell(int aRowIndex,
|
|||
nsCOMPtr<nsIStyleContext> imageContext;
|
||||
GetPseudoStyleContext(nsXULAtoms::mozoutlinerimage, getter_AddRefs(imageContext));
|
||||
|
||||
nsRect imageSize = GetImageSize(currentParent, aColumn->GetID(), imageContext);
|
||||
imageSize = GetImageSize(currentParent, aColumn->GetID(), imageContext);
|
||||
|
||||
const nsStyleMargin* imageMarginData = (const nsStyleMargin*)imageContext->GetStyleData(eStyleStruct_Margin);
|
||||
nsMargin imageMargin;
|
||||
imageMarginData->GetMargin(imageMargin);
|
||||
imageSize.Inflate(imageMargin);
|
||||
|
||||
// Use default indentation if no parent image
|
||||
if (!imageSize.width)
|
||||
imageSize.width = mIndentation;
|
||||
|
||||
// Line up line with the parent image.
|
||||
x = currX + twistySize.width + imageSize.width / 2;
|
||||
|
||||
|
@ -1940,7 +1997,7 @@ NS_IMETHODIMP nsOutlinerBodyFrame::PaintCell(int aRowIndex,
|
|||
|
||||
// Don't paint off our cell.
|
||||
if (level == maxLevel)
|
||||
aRenderingContext.DrawLine(x - mIndentation + 16, y + mRowHeight / 2, x, y + mRowHeight /2);
|
||||
aRenderingContext.DrawLine(x - mIndentation + 16, y + mRowHeight / 2, x - imageSize.width / 2, y + mRowHeight / 2);
|
||||
|
||||
PRBool clipState;
|
||||
aRenderingContext.PopState(clipState);
|
||||
|
@ -2508,66 +2565,38 @@ nsOutlinerBodyFrame::EnsureColumns()
|
|||
|
||||
nsCOMPtr<nsIContent> parent;
|
||||
mContent->GetParent(*getter_AddRefs(parent));
|
||||
nsCOMPtr<nsIDOMElement> elt(do_QueryInterface(parent));
|
||||
|
||||
nsCOMPtr<nsIDOMNodeList> cols;
|
||||
elt->GetElementsByTagNameNS(NS_LITERAL_STRING("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"),
|
||||
NS_LITERAL_STRING("outlinercol"),
|
||||
getter_AddRefs(cols));
|
||||
nsCOMPtr<nsIContent> colsContent;
|
||||
nsOutlinerUtils::GetImmediateChild(parent, nsXULAtoms::outlinercols, getter_AddRefs(colsContent));
|
||||
if (!colsContent)
|
||||
return;
|
||||
|
||||
nsCOMPtr<nsIPresShell> shell;
|
||||
mPresContext->GetShell(getter_AddRefs(shell));
|
||||
|
||||
PRUint32 count;
|
||||
cols->GetLength(&count);
|
||||
|
||||
if (count == 0)
|
||||
return; // Nothing to do.
|
||||
|
||||
nsIFrame* frame = nsnull;
|
||||
nsIFrame* colContainer = nsnull;
|
||||
PRInt32 i = 0;
|
||||
do {
|
||||
// Get a column, and get the parent frame. We need to use its box direction
|
||||
// to find out the order in which we should iterate the columns.
|
||||
nsCOMPtr<nsIDOMNode> node;
|
||||
cols->Item(i++, getter_AddRefs(node));
|
||||
nsCOMPtr<nsIContent> child(do_QueryInterface(node));
|
||||
|
||||
// Get the frame for this column.
|
||||
shell->GetPrimaryFrameFor(child, &frame);
|
||||
if (frame)
|
||||
frame->GetParent(&colContainer);
|
||||
} while (!frame);
|
||||
|
||||
if (!colContainer)
|
||||
nsIFrame* colsFrame = nsnull;
|
||||
shell->GetPrimaryFrameFor(colsContent, &colsFrame);
|
||||
if (!colsFrame)
|
||||
return;
|
||||
|
||||
nsCOMPtr<nsIBox> colContainerBox(do_QueryInterface(colContainer));
|
||||
nsCOMPtr<nsIBox> colsBox(do_QueryInterface(colsFrame));
|
||||
nsIBox* colBox = nsnull;
|
||||
colContainerBox->GetChildBox(&colBox);
|
||||
|
||||
colsBox->GetChildBox(&colBox);
|
||||
nsOutlinerColumn* currCol = nsnull;
|
||||
while (colBox) {
|
||||
nsIFrame* frame = nsnull;
|
||||
colBox->GetFrame(&frame);
|
||||
nsCOMPtr<nsIContent> content;
|
||||
frame->GetContent(getter_AddRefs(content));
|
||||
nsCOMPtr<nsIDOMElement> colElt(do_QueryInterface(content));
|
||||
nsCOMPtr<nsIDOMNode> colParentElt;
|
||||
colElt->GetParentNode(getter_AddRefs(colParentElt));
|
||||
if (colParentElt) {
|
||||
nsCOMPtr<nsIDOMNode> colGrandParentElt;
|
||||
colParentElt->GetParentNode(getter_AddRefs(colGrandParentElt));
|
||||
if (colGrandParentElt == elt) {
|
||||
// Create a new column structure.
|
||||
nsOutlinerColumn* col = new nsOutlinerColumn(content, frame);
|
||||
if (currCol)
|
||||
currCol->SetNext(col);
|
||||
else mColumns = col;
|
||||
currCol = col;
|
||||
}
|
||||
nsCOMPtr<nsIAtom> tag;
|
||||
content->GetTag(*getter_AddRefs(tag));
|
||||
if (tag == nsXULAtoms::outlinercol) {
|
||||
// Create a new column structure.
|
||||
nsOutlinerColumn* col = new nsOutlinerColumn(content, frame);
|
||||
if (currCol)
|
||||
currCol->SetNext(col);
|
||||
else mColumns = col;
|
||||
currCol = col;
|
||||
}
|
||||
|
||||
colBox->GetNextBox(&colBox);
|
||||
}
|
||||
}
|
||||
|
@ -2843,7 +2872,6 @@ nsOutlinerBodyFrame :: ComputeDropPosition ( nsIDOMEvent* inEvent, PRInt32* outR
|
|||
PRInt32 yTwips, xTwips;
|
||||
AdjustEventCoordsToBoxCoordSpace ( x, y, &xTwips, &yTwips );
|
||||
PRInt32 rowTop = mRowHeight * (row - mTopRowIndex);
|
||||
PRInt32 rowBottom = rowTop + mRowHeight;
|
||||
PRInt32 yOffset = yTwips - rowTop;
|
||||
|
||||
PRBool isContainer = PR_FALSE;
|
||||
|
@ -3042,7 +3070,7 @@ nsOutlinerBodyFrame::Notify(nsITimer* aTimer)
|
|||
mOpenTimer = nsnull;
|
||||
if (mOpenTimerRow >= 0) {
|
||||
mView->ToggleOpenState(mOpenTimerRow);
|
||||
mOpenTimerRow = 0;
|
||||
mOpenTimerRow = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -164,6 +164,7 @@ class nsOutlinerColumn {
|
|||
nsIFrame* mColFrame;
|
||||
nsIContent* mColElement;
|
||||
|
||||
PRInt32 mColIndex;
|
||||
public:
|
||||
nsOutlinerColumn(nsIContent* aColElement, nsIFrame* aFrame);
|
||||
virtual ~nsOutlinerColumn() { delete mNext; };
|
||||
|
@ -183,6 +184,8 @@ public:
|
|||
PRBool IsCycler() { return mIsCyclerCol; };
|
||||
|
||||
PRInt32 GetCropStyle() { return mCropStyle; };
|
||||
|
||||
PRInt32 GetColIndex() { return mColIndex; };
|
||||
};
|
||||
|
||||
#ifdef USE_IMG2
|
||||
|
@ -342,10 +345,6 @@ protected:
|
|||
nsresult GetItemWithinCellAt(PRInt32 aX, const nsRect& aCellRect, PRInt32 aRowIndex,
|
||||
nsOutlinerColumn* aColumn, PRUnichar** aChildElt);
|
||||
|
||||
// timer for opening spring-loaded folders
|
||||
nsCOMPtr<nsITimer> mOpenTimer;
|
||||
PRInt32 mOpenTimerRow;
|
||||
|
||||
#ifdef USE_IMG2
|
||||
// Fetch an image from the image cache.
|
||||
nsresult GetImage(PRInt32 aRowIndex, const PRUnichar* aColID,
|
||||
|
@ -375,8 +374,8 @@ protected:
|
|||
// Update the curpos of the scrollbar.
|
||||
void UpdateScrollbar();
|
||||
|
||||
// Update the visibility of the scrollbar.
|
||||
nsresult SetVisibleScrollbar(PRBool aSetVisible);
|
||||
// Check vertical overflow.
|
||||
nsresult CheckVerticalOverflow();
|
||||
|
||||
// Use to auto-fill some of the common properties without the view having to do it.
|
||||
// Examples include container, open, selected, and focus.
|
||||
|
@ -463,5 +462,11 @@ protected: // Data Members
|
|||
|
||||
nsCOMPtr<nsIDragSession> mDragSession;
|
||||
nsCOMPtr<nsIRenderingContext> mRenderingContext;
|
||||
|
||||
// timer for opening spring-loaded folders
|
||||
nsCOMPtr<nsITimer> mOpenTimer;
|
||||
PRInt32 mOpenTimerRow;
|
||||
|
||||
PRPackedBool mVerticalOverflow;
|
||||
|
||||
}; // class nsOutlinerBodyFrame
|
||||
|
|
|
@ -234,6 +234,14 @@ NS_IMETHODIMP nsOutlinerBoxObject::GetRowHeight(PRInt32* _retval)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsOutlinerBoxObject::GetColumnIndex(const PRUnichar *aColID, PRInt32 *_retval)
|
||||
{
|
||||
nsIOutlinerBoxObject* body = GetOutlinerBody();
|
||||
if (body)
|
||||
return body->GetColumnIndex(aColID, _retval);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsOutlinerBoxObject::GetFirstVisibleRow(PRInt32 *_retval)
|
||||
{
|
||||
nsIOutlinerBoxObject* body = GetOutlinerBody();
|
||||
|
@ -303,6 +311,14 @@ NS_IMETHODIMP nsOutlinerBoxObject::Invalidate()
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsOutlinerBoxObject::InvalidateColumn(const PRUnichar *aColID)
|
||||
{
|
||||
nsIOutlinerBoxObject* body = GetOutlinerBody();
|
||||
if (body)
|
||||
return body->InvalidateColumn(aColID);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsOutlinerBoxObject::InvalidateRow(PRInt32 aIndex)
|
||||
{
|
||||
nsIOutlinerBoxObject* body = GetOutlinerBody();
|
||||
|
|
|
@ -234,7 +234,7 @@ nsOutlinerContentView::GetCellProperties(PRInt32 aRow, const PRUnichar* aColID,
|
|||
|
||||
Row* row = (Row*)mRows[aRow];
|
||||
nsCOMPtr<nsIContent> realRow;
|
||||
GetImmediateChild(row->mContent, nsXULAtoms::outlinerrow, getter_AddRefs(realRow));
|
||||
nsOutlinerUtils::GetImmediateChild(row->mContent, nsXULAtoms::outlinerrow, getter_AddRefs(realRow));
|
||||
if (realRow) {
|
||||
nsCOMPtr<nsIContent> cell;
|
||||
GetNamedCell(realRow, aColID, getter_AddRefs(cell));
|
||||
|
@ -417,7 +417,7 @@ nsOutlinerContentView::GetCellText(PRInt32 aRow, const PRUnichar* aColID, nsAStr
|
|||
|
||||
Row* row = (Row*)mRows[aRow];
|
||||
nsCOMPtr<nsIContent> realRow;
|
||||
GetImmediateChild(row->mContent, nsXULAtoms::outlinerrow, getter_AddRefs(realRow));
|
||||
nsOutlinerUtils::GetImmediateChild(row->mContent, nsXULAtoms::outlinerrow, getter_AddRefs(realRow));
|
||||
if (realRow) {
|
||||
nsCOMPtr<nsIContent> cell;
|
||||
GetNamedCell(realRow, aColID, getter_AddRefs(cell));
|
||||
|
@ -444,15 +444,13 @@ nsOutlinerContentView::ToggleOpenState(PRInt32 aIndex)
|
|||
if (aIndex < 0 || aIndex >= mRows.Count())
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
|
||||
// We don't serialize content right here, since content might be generated
|
||||
// lazily.
|
||||
Row* row = (Row*)mRows[aIndex];
|
||||
if (row->IsOpen()) {
|
||||
CloseContainer(aIndex);
|
||||
row->mContent->UnsetAttr(kNameSpaceID_None, nsXULAtoms::open, PR_FALSE);
|
||||
}
|
||||
else {
|
||||
OpenContainer(aIndex);
|
||||
row->mContent->SetAttr(kNameSpaceID_None, nsXULAtoms::open, NS_LITERAL_STRING("true"), PR_FALSE);
|
||||
}
|
||||
if (row->IsOpen())
|
||||
row->mContent->UnsetAttr(kNameSpaceID_None, nsXULAtoms::open, PR_TRUE);
|
||||
else
|
||||
row->mContent->SetAttr(kNameSpaceID_None, nsXULAtoms::open, NS_LITERAL_STRING("true"), PR_TRUE);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -544,8 +542,12 @@ nsOutlinerContentView::SetRoot(nsIDOMElement* aRoot)
|
|||
mDocument = document;
|
||||
}
|
||||
|
||||
PRInt32 index = 0;
|
||||
Serialize(mRoot, -1, &index, mRows);
|
||||
nsCOMPtr<nsIContent> child;
|
||||
nsOutlinerUtils::GetImmediateChild(mRoot, nsXULAtoms::outlinerchildren, getter_AddRefs(child));
|
||||
if (child) {
|
||||
PRInt32 index = 0;
|
||||
Serialize(child, -1, &index, mRows);
|
||||
}
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
@ -926,7 +928,7 @@ nsOutlinerContentView::SerializeItem(nsIContent* aContent, PRInt32 aParentIndex,
|
|||
aRows.AppendElement(row);
|
||||
|
||||
nsCOMPtr<nsIContent> realRow;
|
||||
GetImmediateChild(aContent, nsXULAtoms::outlinerrow, getter_AddRefs(realRow));
|
||||
nsOutlinerUtils::GetImmediateChild(aContent, nsXULAtoms::outlinerrow, getter_AddRefs(realRow));
|
||||
if (realRow)
|
||||
ParseProperties(realRow, &row->mProperty);
|
||||
|
||||
|
@ -939,7 +941,7 @@ nsOutlinerContentView::SerializeItem(nsIContent* aContent, PRInt32 aParentIndex,
|
|||
if (open.Equals(NS_LITERAL_STRING("true"))) {
|
||||
row->SetOpen(PR_TRUE);
|
||||
nsCOMPtr<nsIContent> child;
|
||||
GetImmediateChild(aContent, nsXULAtoms::outlinerchildren, getter_AddRefs(child));
|
||||
nsOutlinerUtils::GetImmediateChild(aContent, nsXULAtoms::outlinerchildren, getter_AddRefs(child));
|
||||
if (child) {
|
||||
// Now, recursively serialize our child.
|
||||
PRInt32 count = aRows.Count();
|
||||
|
@ -985,7 +987,7 @@ nsOutlinerContentView::GetIndexInSubtree(nsIContent* aContainer, nsIContent* aCo
|
|||
content->GetAttr(kNameSpaceID_None, nsXULAtoms::open, open);
|
||||
if (open.Equals(NS_LITERAL_STRING("true"))) {
|
||||
nsCOMPtr<nsIContent> child;
|
||||
GetImmediateChild(content, nsXULAtoms::outlinerchildren, getter_AddRefs(child));
|
||||
nsOutlinerUtils::GetImmediateChild(content, nsXULAtoms::outlinerchildren, getter_AddRefs(child));
|
||||
if (child)
|
||||
GetIndexInSubtree(child, aContent, aIndex);
|
||||
}
|
||||
|
@ -1001,7 +1003,7 @@ nsOutlinerContentView::EnsureSubtree(PRInt32 aIndex, PRInt32* aCount)
|
|||
{
|
||||
Row* row = (Row*)mRows[aIndex];
|
||||
nsCOMPtr<nsIContent> child;
|
||||
GetImmediateChild(row->mContent, nsXULAtoms::outlinerchildren, getter_AddRefs(child));
|
||||
nsOutlinerUtils::GetImmediateChild(row->mContent, nsXULAtoms::outlinerchildren, getter_AddRefs(child));
|
||||
if (! child) {
|
||||
*aCount = 0;
|
||||
return;
|
||||
|
@ -1018,7 +1020,7 @@ nsOutlinerContentView::EnsureSubtree(PRInt32 aIndex, PRInt32* aCount)
|
|||
|
||||
// Update parent indexes, but skip newly added rows.
|
||||
// They already have correct values.
|
||||
UpdateParentIndexes(aIndex, count, count);
|
||||
UpdateParentIndexes(aIndex, count + 1, count);
|
||||
|
||||
*aCount = count;
|
||||
}
|
||||
|
@ -1103,6 +1105,7 @@ nsOutlinerContentView::OpenContainer(PRInt32 aIndex)
|
|||
|
||||
PRInt32 count;
|
||||
EnsureSubtree(aIndex, &count);
|
||||
mBoxObject->InvalidateRow(aIndex);
|
||||
mBoxObject->RowCountChanged(aIndex + 1, count);
|
||||
}
|
||||
|
||||
|
@ -1115,6 +1118,7 @@ nsOutlinerContentView::CloseContainer(PRInt32 aIndex)
|
|||
|
||||
PRInt32 count;
|
||||
RemoveSubtree(aIndex, &count);
|
||||
mBoxObject->InvalidateRow(aIndex);
|
||||
mBoxObject->RowCountChanged(aIndex + 1, -count);
|
||||
}
|
||||
|
||||
|
@ -1149,88 +1153,11 @@ nsOutlinerContentView::UpdateParentIndexes(PRInt32 aIndex, PRInt32 aSkip, PRInt3
|
|||
}
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsOutlinerContentView::GetImmediateChild(nsIContent* aContainer, nsIAtom* aTag, nsIContent** aResult)
|
||||
{
|
||||
PRInt32 childCount;
|
||||
aContainer->ChildCount(childCount);
|
||||
for (PRInt32 i = 0; i < childCount; i++) {
|
||||
nsCOMPtr<nsIContent> child;
|
||||
aContainer->ChildAt(i, *getter_AddRefs(child));
|
||||
nsCOMPtr<nsIAtom> tag;
|
||||
child->GetTag(*getter_AddRefs(tag));
|
||||
if (tag == aTag) {
|
||||
NS_ADDREF(*aResult = child);
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
|
||||
*aResult = nsnull;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsOutlinerContentView::GetColIndex(const PRUnichar* aColID, PRInt32* aResult)
|
||||
{
|
||||
*aResult = -1;
|
||||
|
||||
// First, try to find col index by already set "colIndex" attribute.
|
||||
nsCOMPtr<nsIDOMDocument> domDocument = do_QueryInterface(mDocument);
|
||||
nsCOMPtr<nsIDOMElement> domElement;
|
||||
domDocument->GetElementById(nsDependentString(aColID), getter_AddRefs(domElement));
|
||||
if (domElement) {
|
||||
nsAutoString colIndexValue;
|
||||
domElement->GetAttribute(NS_LITERAL_STRING("colIndex"), colIndexValue);
|
||||
if (colIndexValue.Length()) {
|
||||
PRInt32 rv;
|
||||
*aResult = colIndexValue.ToInteger(&rv);
|
||||
}
|
||||
}
|
||||
|
||||
if (*aResult == -1) {
|
||||
// No "colIndex" attribute, traverse through cols
|
||||
nsCOMPtr<nsIContent> parent;
|
||||
mRoot->GetParent(*getter_AddRefs(parent));
|
||||
if (parent) {
|
||||
nsCOMPtr<nsIContent> cols;
|
||||
GetImmediateChild(parent, nsXULAtoms::outlinercols, getter_AddRefs(cols));
|
||||
if (cols) {
|
||||
PRInt32 childCount;
|
||||
cols->ChildCount(childCount);
|
||||
PRInt32 index = 0;
|
||||
for (PRInt32 i = 0; i < childCount; i++) {
|
||||
nsCOMPtr<nsIContent> child;
|
||||
cols->ChildAt(i, *getter_AddRefs(child));
|
||||
nsCOMPtr<nsIAtom> tag;
|
||||
child->GetTag(*getter_AddRefs(tag));
|
||||
if (tag == nsXULAtoms::outlinercol) {
|
||||
nsAutoString id;
|
||||
child->GetAttr(kNameSpaceID_None, nsHTMLAtoms::id, id);
|
||||
if (id.Equals(aColID)) {
|
||||
// Found it, set "colIndex" attribute to speed up next call.
|
||||
nsCOMPtr<nsIAtom> colIndexAtom;
|
||||
colIndexAtom = dont_AddRef(NS_NewAtom(NS_LITERAL_STRING("colIndex")));
|
||||
nsAutoString colIndexValue;
|
||||
colIndexValue.AppendInt(index);
|
||||
child->SetAttr(kNameSpaceID_None, colIndexAtom, colIndexValue, PR_FALSE);
|
||||
*aResult = index;
|
||||
break;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsOutlinerContentView::GetNamedCell(nsIContent* aContainer, const PRUnichar* aColID, nsIContent** aResult)
|
||||
{
|
||||
PRInt32 colIndex;
|
||||
GetColIndex(aColID, &colIndex);
|
||||
mBoxObject->GetColumnIndex(aColID, &colIndex);
|
||||
|
||||
// Traverse through cells, try to find the cell by "ref" attribute or by cell
|
||||
// index in a row. "ref" attribute has higher priority.
|
||||
|
@ -1246,7 +1173,7 @@ nsOutlinerContentView::GetNamedCell(nsIContent* aContainer, const PRUnichar* aCo
|
|||
if (tag == nsXULAtoms::outlinercell) {
|
||||
nsAutoString ref;
|
||||
cell->GetAttr(kNameSpaceID_None, nsXULAtoms::ref, ref);
|
||||
if (ref.Equals(aColID)) {
|
||||
if (!ref.IsEmpty() && ref.Equals(aColID)) {
|
||||
*aResult = cell;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -174,10 +174,6 @@ class nsOutlinerContentView : public nsIOutlinerView,
|
|||
void UpdateParentIndexes(PRInt32 aIndex, PRInt32 aSkip, PRInt32 aCount);
|
||||
|
||||
// Content helpers.
|
||||
nsresult GetImmediateChild(nsIContent* aContainer, nsIAtom* aTag, nsIContent** aResult);
|
||||
|
||||
nsresult GetColIndex(const PRUnichar* aColID, PRInt32* aResult);
|
||||
|
||||
nsresult GetNamedCell(nsIContent* aContainer, const PRUnichar* aColID, nsIContent** aResult);
|
||||
|
||||
nsresult ParseProperties(nsIContent* aContent, Property** aProperty);
|
||||
|
|
|
@ -78,3 +78,23 @@ nsOutlinerUtils::TokenizeProperties(const nsAString& aProperties, nsISupportsArr
|
|||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsOutlinerUtils::GetImmediateChild(nsIContent* aContainer, nsIAtom* aTag, nsIContent** aResult)
|
||||
{
|
||||
PRInt32 childCount;
|
||||
aContainer->ChildCount(childCount);
|
||||
for (PRInt32 i = 0; i < childCount; i++) {
|
||||
nsCOMPtr<nsIContent> child;
|
||||
aContainer->ChildAt(i, *getter_AddRefs(child));
|
||||
nsCOMPtr<nsIAtom> tag;
|
||||
child->GetTag(*getter_AddRefs(tag));
|
||||
if (tag == aTag) {
|
||||
NS_ADDREF(*aResult = child);
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
|
||||
*aResult = nsnull;
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -1,56 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 3; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Chris Waterson <waterson@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the NPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifndef nsOutlinerUtils_h__
|
||||
#define nsOutlinerUtils_h__
|
||||
|
||||
#include "nsString.h"
|
||||
#include "nsISupportsArray.h"
|
||||
|
||||
class nsOutlinerUtils
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Parse a whitespace separated list of properties into an array
|
||||
* of atoms.
|
||||
*/
|
||||
static nsresult
|
||||
TokenizeProperties(const nsAString& aProperties, nsISupportsArray* aPropertiesArray);
|
||||
};
|
||||
|
||||
#endif // nsOutlinerUtils_h__
|
|
@ -74,6 +74,11 @@ interface nsIOutlinerBoxObject : nsISupports
|
|||
*/
|
||||
readonly attribute long rowHeight;
|
||||
|
||||
/**
|
||||
* Get the index of the specified column.
|
||||
*/
|
||||
long getColumnIndex(in wstring colID);
|
||||
|
||||
/**
|
||||
* Get the index of the first visible row.
|
||||
*/
|
||||
|
@ -118,6 +123,7 @@ interface nsIOutlinerBoxObject : nsISupports
|
|||
* Invalidation methods for fine-grained painting control.
|
||||
*/
|
||||
void invalidate();
|
||||
void invalidateColumn(in wstring colID);
|
||||
void invalidateRow(in long index);
|
||||
void invalidateCell(in long row, in wstring colID);
|
||||
void invalidateRange(in long startIndex, in long endIndex);
|
||||
|
|
|
@ -56,6 +56,7 @@
|
|||
#include "nsIContent.h"
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsIBoxObject.h"
|
||||
#include "nsGUIEvent.h"
|
||||
#include "nsIDOMMouseEvent.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsIDOMNodeList.h"
|
||||
|
@ -79,6 +80,7 @@
|
|||
#include "nsBoxLayoutState.h"
|
||||
#include "nsIDragService.h"
|
||||
#include "nsOutlinerContentView.h"
|
||||
#include "nsOutlinerUtils.h"
|
||||
|
||||
#ifdef USE_IMG2
|
||||
#include "imgIRequest.h"
|
||||
|
@ -220,6 +222,27 @@ nsOutlinerColumn::nsOutlinerColumn(nsIContent* aColElement, nsIFrame* aFrame)
|
|||
mColElement->GetAttr(kNameSpaceID_None, nsXULAtoms::cycler, cycler);
|
||||
if (cycler.EqualsIgnoreCase("true"))
|
||||
mIsCyclerCol = PR_TRUE;
|
||||
|
||||
// Cache our index.
|
||||
mColIndex = -1;
|
||||
nsCOMPtr<nsIContent> parent;
|
||||
mColElement->GetParent(*getter_AddRefs(parent));
|
||||
PRInt32 count;
|
||||
parent->ChildCount(count);
|
||||
PRInt32 j = 0;
|
||||
for (PRInt32 i = 0; i < count; i++) {
|
||||
nsCOMPtr<nsIContent> child;
|
||||
parent->ChildAt(i, *getter_AddRefs(child));
|
||||
nsCOMPtr<nsIAtom> tag;
|
||||
child->GetTag(*getter_AddRefs(tag));
|
||||
if (tag == nsXULAtoms::outlinercol) {
|
||||
if (child == mColElement) {
|
||||
mColIndex = j;
|
||||
break;
|
||||
}
|
||||
j++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
inline nscoord nsOutlinerColumn::GetWidth()
|
||||
|
@ -269,12 +292,12 @@ NS_INTERFACE_MAP_END_INHERITING(nsLeafFrame)
|
|||
// Constructor
|
||||
nsOutlinerBodyFrame::nsOutlinerBodyFrame(nsIPresShell* aPresShell)
|
||||
:nsLeafBoxFrame(aPresShell), mPresContext(nsnull), mOutlinerBoxObject(nsnull), mFocused(PR_FALSE), mImageCache(nsnull),
|
||||
mColumns(nsnull), mScrollbar(nsnull), mTopRowIndex(0), mRowHeight(0), mIndentation(0),
|
||||
mColumns(nsnull), mScrollbar(nsnull), mTopRowIndex(0), mRowHeight(0), mIndentation(0), mColumnsDirty(PR_TRUE),
|
||||
mDropRow(kIllegalRow), mDropOrient(kNoOrientation), mDropAllowed(PR_FALSE), mIsSortRectDrawn(PR_FALSE),
|
||||
mAlreadyUndrewDueToScroll(PR_FALSE), mOpenTimer(nsnull), mOpenTimerRow(-1)
|
||||
mAlreadyUndrewDueToScroll(PR_FALSE), mOpenTimer(nsnull), mOpenTimerRow(-1),
|
||||
mVerticalOverflow(PR_FALSE)
|
||||
{
|
||||
NS_NewISupportsArray(getter_AddRefs(mScratchArray));
|
||||
mColumnsDirty = PR_TRUE;
|
||||
}
|
||||
|
||||
// Destructor
|
||||
|
@ -326,7 +349,7 @@ nsOutlinerBodyFrame::Init(nsIPresContext* aPresContext, nsIContent* aContent,
|
|||
nsIView* ourView;
|
||||
nsLeafBoxFrame::GetView(aPresContext, &ourView);
|
||||
|
||||
static NS_DEFINE_IID(kWidgetCID, NS_CHILD_CID);
|
||||
static NS_DEFINE_IID(kWidgetCID, NS_CHILD_CID);
|
||||
|
||||
ourView->CreateWidget(kWidgetCID);
|
||||
ourView->GetWidget(*getter_AddRefs(mOutlinerWidget));
|
||||
|
@ -423,8 +446,9 @@ NS_IMETHODIMP nsOutlinerBodyFrame::Reflow(nsIPresContext* aPresContext,
|
|||
xulele->GetBuilder(getter_AddRefs(builder));
|
||||
if (builder)
|
||||
view = do_QueryInterface(builder);
|
||||
else {
|
||||
// No builder, create a outliner content model view.
|
||||
|
||||
if (!view) {
|
||||
// No outliner builder, create a outliner content view.
|
||||
nsCOMPtr<nsIOutlinerContentView> contentView;
|
||||
NS_NewOutlinerContentView(getter_AddRefs(contentView));
|
||||
if (contentView) {
|
||||
|
@ -450,12 +474,13 @@ NS_IMETHODIMP nsOutlinerBodyFrame::Reflow(nsIPresContext* aPresContext,
|
|||
ScrollToRow(lastPageTopRow);
|
||||
|
||||
InvalidateScrollbar();
|
||||
SetVisibleScrollbar((rowCount >= mPageCount));
|
||||
CheckVerticalOverflow();
|
||||
}
|
||||
|
||||
return nsLeafBoxFrame::Reflow(aPresContext, aReflowMetrics, aReflowState, aStatus);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
AdjustForBorderPadding(nsIStyleContext* aContext, nsRect& aRect)
|
||||
{
|
||||
|
@ -522,9 +547,7 @@ NS_IMETHODIMP nsOutlinerBodyFrame::SetView(nsIOutlinerView * aView)
|
|||
// Reset scrollbar position.
|
||||
UpdateScrollbar();
|
||||
|
||||
PRInt32 rowCount;
|
||||
mView->GetRowCount(&rowCount);
|
||||
SetVisibleScrollbar((rowCount >= mPageCount));
|
||||
CheckVerticalOverflow();
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
@ -582,6 +605,19 @@ NS_IMETHODIMP nsOutlinerBodyFrame::GetRowHeight(PRInt32* _retval)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsOutlinerBodyFrame::GetColumnIndex(const PRUnichar *aColID, PRInt32 *_retval)
|
||||
{
|
||||
*_retval = -1;
|
||||
for (nsOutlinerColumn* currCol = mColumns; currCol; currCol = currCol->GetNext()) {
|
||||
if (nsCRT::strcmp(currCol->GetID(), aColID) == 0) {
|
||||
*_retval = currCol->GetColIndex();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsOutlinerBodyFrame::GetFirstVisibleRow(PRInt32 *_retval)
|
||||
{
|
||||
*_retval = mTopRowIndex;
|
||||
|
@ -609,6 +645,22 @@ NS_IMETHODIMP nsOutlinerBodyFrame::Invalidate()
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsOutlinerBodyFrame::InvalidateColumn(const PRUnichar *aColID)
|
||||
{
|
||||
nscoord currX = mInnerBox.x;
|
||||
for (nsOutlinerColumn* currCol = mColumns; currCol && currX < mInnerBox.x+mInnerBox.width;
|
||||
currCol = currCol->GetNext()) {
|
||||
if (nsCRT::strcmp(currCol->GetID(), aColID) == 0) {
|
||||
nsRect columnRect(currX, mInnerBox.y, currCol->GetWidth(), mInnerBox.height);
|
||||
nsLeafBoxFrame::Invalidate(mPresContext, columnRect, PR_FALSE);
|
||||
break;
|
||||
}
|
||||
currX += currCol->GetWidth();
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsOutlinerBodyFrame::InvalidateRow(PRInt32 aIndex)
|
||||
{
|
||||
if (aIndex < mTopRowIndex || aIndex > mTopRowIndex + mPageCount + 1)
|
||||
|
@ -630,9 +682,8 @@ NS_IMETHODIMP nsOutlinerBodyFrame::InvalidateCell(PRInt32 aIndex, const PRUnicha
|
|||
nscoord yPos = mInnerBox.y+mRowHeight*(aIndex-mTopRowIndex);
|
||||
for (nsOutlinerColumn* currCol = mColumns; currCol && currX < mInnerBox.x+mInnerBox.width;
|
||||
currCol = currCol->GetNext()) {
|
||||
nsRect cellRect(currX, yPos, currCol->GetWidth(), mRowHeight);
|
||||
|
||||
if (nsCRT::strcmp(currCol->GetID(), aColID) == 0) {
|
||||
nsRect cellRect(currX, yPos, currCol->GetWidth(), mRowHeight);
|
||||
nsLeafBoxFrame::Invalidate(mPresContext, cellRect, PR_FALSE);
|
||||
break;
|
||||
}
|
||||
|
@ -681,29 +732,33 @@ nsOutlinerBodyFrame::UpdateScrollbar()
|
|||
scrollbarContent->SetAttr(kNameSpaceID_None, nsXULAtoms::curpos, curPos, PR_TRUE);
|
||||
}
|
||||
|
||||
nsresult nsOutlinerBodyFrame::SetVisibleScrollbar(PRBool aSetVisible)
|
||||
nsresult nsOutlinerBodyFrame::CheckVerticalOverflow()
|
||||
{
|
||||
NS_ASSERTION(mScrollbar, "no scroll bar");
|
||||
if (!mScrollbar)
|
||||
return NS_OK;
|
||||
PRBool verticalOverflowChanged = PR_FALSE;
|
||||
|
||||
nsCOMPtr<nsIContent> scrollbarContent;
|
||||
mScrollbar->GetContent(getter_AddRefs(scrollbarContent));
|
||||
PRInt32 rowCount;
|
||||
mView->GetRowCount(&rowCount);
|
||||
if (!mVerticalOverflow && rowCount >= mPageCount) {
|
||||
mVerticalOverflow = PR_TRUE;
|
||||
verticalOverflowChanged = PR_TRUE;
|
||||
}
|
||||
else if (mVerticalOverflow && rowCount < mPageCount) {
|
||||
mVerticalOverflow = PR_FALSE;
|
||||
verticalOverflowChanged = PR_TRUE;
|
||||
}
|
||||
|
||||
if (verticalOverflowChanged) {
|
||||
nsScrollPortEvent* event = new nsScrollPortEvent();
|
||||
event->eventStructType = NS_SCROLLPORT_EVENT;
|
||||
event->widget = nsnull;
|
||||
event->orient = nsScrollPortEvent::vertical;
|
||||
event->nativeMsg = nsnull;
|
||||
event->message = mVerticalOverflow ? NS_SCROLLPORT_OVERFLOW : NS_SCROLLPORT_UNDERFLOW;
|
||||
|
||||
nsAutoString isCollapsed;
|
||||
scrollbarContent->GetAttr(kNameSpaceID_None, nsXULAtoms::collapsed,
|
||||
isCollapsed);
|
||||
|
||||
if (!isCollapsed.IsEmpty() && aSetVisible)
|
||||
scrollbarContent->UnsetAttr(kNameSpaceID_None, nsXULAtoms::collapsed,
|
||||
PR_TRUE);
|
||||
else if (isCollapsed.IsEmpty() && !aSetVisible)
|
||||
scrollbarContent->SetAttr(kNameSpaceID_None, nsXULAtoms::collapsed,
|
||||
NS_LITERAL_STRING("true"), PR_TRUE);
|
||||
else
|
||||
return NS_OK;
|
||||
|
||||
Invalidate();
|
||||
nsCOMPtr<nsIPresShell> shell;
|
||||
mPresContext->GetShell(getter_AddRefs(shell));
|
||||
shell->PostDOMEvent(mContent, event);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -939,10 +994,6 @@ nsOutlinerBodyFrame::GetCoordsForCellItem(PRInt32 aRow, const PRUnichar *aColID,
|
|||
cellX += mIndentation * level;
|
||||
remainWidth -= mIndentation * level;
|
||||
|
||||
// Start the Twisty Rect as the full width of the cell, and gradually decrement its width
|
||||
// as we figure out the size of other elements.
|
||||
nsRect twistyRect(cellX, cellRect.y, remainWidth, cellRect.height);
|
||||
|
||||
PRBool hasTwisty = PR_FALSE;
|
||||
PRBool isContainer = PR_FALSE;
|
||||
mView->IsContainer(aRow, &isContainer);
|
||||
|
@ -1283,7 +1334,7 @@ NS_IMETHODIMP nsOutlinerBodyFrame::RowCountChanged(PRInt32 aIndex, PRInt32 aCoun
|
|||
if (mTopRowIndex == 0) {
|
||||
// Just update the scrollbar and return.
|
||||
InvalidateScrollbar();
|
||||
SetVisibleScrollbar((rowCount >= mPageCount));
|
||||
CheckVerticalOverflow();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -1312,7 +1363,7 @@ NS_IMETHODIMP nsOutlinerBodyFrame::RowCountChanged(PRInt32 aIndex, PRInt32 aCoun
|
|||
}
|
||||
|
||||
InvalidateScrollbar();
|
||||
SetVisibleScrollbar((rowCount >= mPageCount));
|
||||
CheckVerticalOverflow();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -1894,7 +1945,9 @@ NS_IMETHODIMP nsOutlinerBodyFrame::PaintCell(int aRowIndex,
|
|||
style = borderStyle->GetBorderStyle(NS_SIDE_LEFT);
|
||||
aRenderingContext.SetLineStyle(ConvertBorderStyleToLineStyle(style));
|
||||
|
||||
PRInt32 x;
|
||||
nsRect imageSize(0,0,0,0);
|
||||
|
||||
PRInt32 x = currX;
|
||||
PRInt32 y = (aRowIndex - mTopRowIndex) * mRowHeight;
|
||||
|
||||
// Compute the maximal level to paint.
|
||||
|
@ -1912,13 +1965,17 @@ NS_IMETHODIMP nsOutlinerBodyFrame::PaintCell(int aRowIndex,
|
|||
nsCOMPtr<nsIStyleContext> imageContext;
|
||||
GetPseudoStyleContext(nsXULAtoms::mozoutlinerimage, getter_AddRefs(imageContext));
|
||||
|
||||
nsRect imageSize = GetImageSize(currentParent, aColumn->GetID(), imageContext);
|
||||
imageSize = GetImageSize(currentParent, aColumn->GetID(), imageContext);
|
||||
|
||||
const nsStyleMargin* imageMarginData = (const nsStyleMargin*)imageContext->GetStyleData(eStyleStruct_Margin);
|
||||
nsMargin imageMargin;
|
||||
imageMarginData->GetMargin(imageMargin);
|
||||
imageSize.Inflate(imageMargin);
|
||||
|
||||
// Use default indentation if no parent image
|
||||
if (!imageSize.width)
|
||||
imageSize.width = mIndentation;
|
||||
|
||||
// Line up line with the parent image.
|
||||
x = currX + twistySize.width + imageSize.width / 2;
|
||||
|
||||
|
@ -1940,7 +1997,7 @@ NS_IMETHODIMP nsOutlinerBodyFrame::PaintCell(int aRowIndex,
|
|||
|
||||
// Don't paint off our cell.
|
||||
if (level == maxLevel)
|
||||
aRenderingContext.DrawLine(x - mIndentation + 16, y + mRowHeight / 2, x, y + mRowHeight /2);
|
||||
aRenderingContext.DrawLine(x - mIndentation + 16, y + mRowHeight / 2, x - imageSize.width / 2, y + mRowHeight / 2);
|
||||
|
||||
PRBool clipState;
|
||||
aRenderingContext.PopState(clipState);
|
||||
|
@ -2508,66 +2565,38 @@ nsOutlinerBodyFrame::EnsureColumns()
|
|||
|
||||
nsCOMPtr<nsIContent> parent;
|
||||
mContent->GetParent(*getter_AddRefs(parent));
|
||||
nsCOMPtr<nsIDOMElement> elt(do_QueryInterface(parent));
|
||||
|
||||
nsCOMPtr<nsIDOMNodeList> cols;
|
||||
elt->GetElementsByTagNameNS(NS_LITERAL_STRING("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"),
|
||||
NS_LITERAL_STRING("outlinercol"),
|
||||
getter_AddRefs(cols));
|
||||
nsCOMPtr<nsIContent> colsContent;
|
||||
nsOutlinerUtils::GetImmediateChild(parent, nsXULAtoms::outlinercols, getter_AddRefs(colsContent));
|
||||
if (!colsContent)
|
||||
return;
|
||||
|
||||
nsCOMPtr<nsIPresShell> shell;
|
||||
mPresContext->GetShell(getter_AddRefs(shell));
|
||||
|
||||
PRUint32 count;
|
||||
cols->GetLength(&count);
|
||||
|
||||
if (count == 0)
|
||||
return; // Nothing to do.
|
||||
|
||||
nsIFrame* frame = nsnull;
|
||||
nsIFrame* colContainer = nsnull;
|
||||
PRInt32 i = 0;
|
||||
do {
|
||||
// Get a column, and get the parent frame. We need to use its box direction
|
||||
// to find out the order in which we should iterate the columns.
|
||||
nsCOMPtr<nsIDOMNode> node;
|
||||
cols->Item(i++, getter_AddRefs(node));
|
||||
nsCOMPtr<nsIContent> child(do_QueryInterface(node));
|
||||
|
||||
// Get the frame for this column.
|
||||
shell->GetPrimaryFrameFor(child, &frame);
|
||||
if (frame)
|
||||
frame->GetParent(&colContainer);
|
||||
} while (!frame);
|
||||
|
||||
if (!colContainer)
|
||||
nsIFrame* colsFrame = nsnull;
|
||||
shell->GetPrimaryFrameFor(colsContent, &colsFrame);
|
||||
if (!colsFrame)
|
||||
return;
|
||||
|
||||
nsCOMPtr<nsIBox> colContainerBox(do_QueryInterface(colContainer));
|
||||
nsCOMPtr<nsIBox> colsBox(do_QueryInterface(colsFrame));
|
||||
nsIBox* colBox = nsnull;
|
||||
colContainerBox->GetChildBox(&colBox);
|
||||
|
||||
colsBox->GetChildBox(&colBox);
|
||||
nsOutlinerColumn* currCol = nsnull;
|
||||
while (colBox) {
|
||||
nsIFrame* frame = nsnull;
|
||||
colBox->GetFrame(&frame);
|
||||
nsCOMPtr<nsIContent> content;
|
||||
frame->GetContent(getter_AddRefs(content));
|
||||
nsCOMPtr<nsIDOMElement> colElt(do_QueryInterface(content));
|
||||
nsCOMPtr<nsIDOMNode> colParentElt;
|
||||
colElt->GetParentNode(getter_AddRefs(colParentElt));
|
||||
if (colParentElt) {
|
||||
nsCOMPtr<nsIDOMNode> colGrandParentElt;
|
||||
colParentElt->GetParentNode(getter_AddRefs(colGrandParentElt));
|
||||
if (colGrandParentElt == elt) {
|
||||
// Create a new column structure.
|
||||
nsOutlinerColumn* col = new nsOutlinerColumn(content, frame);
|
||||
if (currCol)
|
||||
currCol->SetNext(col);
|
||||
else mColumns = col;
|
||||
currCol = col;
|
||||
}
|
||||
nsCOMPtr<nsIAtom> tag;
|
||||
content->GetTag(*getter_AddRefs(tag));
|
||||
if (tag == nsXULAtoms::outlinercol) {
|
||||
// Create a new column structure.
|
||||
nsOutlinerColumn* col = new nsOutlinerColumn(content, frame);
|
||||
if (currCol)
|
||||
currCol->SetNext(col);
|
||||
else mColumns = col;
|
||||
currCol = col;
|
||||
}
|
||||
|
||||
colBox->GetNextBox(&colBox);
|
||||
}
|
||||
}
|
||||
|
@ -2843,7 +2872,6 @@ nsOutlinerBodyFrame :: ComputeDropPosition ( nsIDOMEvent* inEvent, PRInt32* outR
|
|||
PRInt32 yTwips, xTwips;
|
||||
AdjustEventCoordsToBoxCoordSpace ( x, y, &xTwips, &yTwips );
|
||||
PRInt32 rowTop = mRowHeight * (row - mTopRowIndex);
|
||||
PRInt32 rowBottom = rowTop + mRowHeight;
|
||||
PRInt32 yOffset = yTwips - rowTop;
|
||||
|
||||
PRBool isContainer = PR_FALSE;
|
||||
|
@ -3042,7 +3070,7 @@ nsOutlinerBodyFrame::Notify(nsITimer* aTimer)
|
|||
mOpenTimer = nsnull;
|
||||
if (mOpenTimerRow >= 0) {
|
||||
mView->ToggleOpenState(mOpenTimerRow);
|
||||
mOpenTimerRow = 0;
|
||||
mOpenTimerRow = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -164,6 +164,7 @@ class nsOutlinerColumn {
|
|||
nsIFrame* mColFrame;
|
||||
nsIContent* mColElement;
|
||||
|
||||
PRInt32 mColIndex;
|
||||
public:
|
||||
nsOutlinerColumn(nsIContent* aColElement, nsIFrame* aFrame);
|
||||
virtual ~nsOutlinerColumn() { delete mNext; };
|
||||
|
@ -183,6 +184,8 @@ public:
|
|||
PRBool IsCycler() { return mIsCyclerCol; };
|
||||
|
||||
PRInt32 GetCropStyle() { return mCropStyle; };
|
||||
|
||||
PRInt32 GetColIndex() { return mColIndex; };
|
||||
};
|
||||
|
||||
#ifdef USE_IMG2
|
||||
|
@ -342,10 +345,6 @@ protected:
|
|||
nsresult GetItemWithinCellAt(PRInt32 aX, const nsRect& aCellRect, PRInt32 aRowIndex,
|
||||
nsOutlinerColumn* aColumn, PRUnichar** aChildElt);
|
||||
|
||||
// timer for opening spring-loaded folders
|
||||
nsCOMPtr<nsITimer> mOpenTimer;
|
||||
PRInt32 mOpenTimerRow;
|
||||
|
||||
#ifdef USE_IMG2
|
||||
// Fetch an image from the image cache.
|
||||
nsresult GetImage(PRInt32 aRowIndex, const PRUnichar* aColID,
|
||||
|
@ -375,8 +374,8 @@ protected:
|
|||
// Update the curpos of the scrollbar.
|
||||
void UpdateScrollbar();
|
||||
|
||||
// Update the visibility of the scrollbar.
|
||||
nsresult SetVisibleScrollbar(PRBool aSetVisible);
|
||||
// Check vertical overflow.
|
||||
nsresult CheckVerticalOverflow();
|
||||
|
||||
// Use to auto-fill some of the common properties without the view having to do it.
|
||||
// Examples include container, open, selected, and focus.
|
||||
|
@ -463,5 +462,11 @@ protected: // Data Members
|
|||
|
||||
nsCOMPtr<nsIDragSession> mDragSession;
|
||||
nsCOMPtr<nsIRenderingContext> mRenderingContext;
|
||||
|
||||
// timer for opening spring-loaded folders
|
||||
nsCOMPtr<nsITimer> mOpenTimer;
|
||||
PRInt32 mOpenTimerRow;
|
||||
|
||||
PRPackedBool mVerticalOverflow;
|
||||
|
||||
}; // class nsOutlinerBodyFrame
|
||||
|
|
|
@ -234,6 +234,14 @@ NS_IMETHODIMP nsOutlinerBoxObject::GetRowHeight(PRInt32* _retval)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsOutlinerBoxObject::GetColumnIndex(const PRUnichar *aColID, PRInt32 *_retval)
|
||||
{
|
||||
nsIOutlinerBoxObject* body = GetOutlinerBody();
|
||||
if (body)
|
||||
return body->GetColumnIndex(aColID, _retval);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsOutlinerBoxObject::GetFirstVisibleRow(PRInt32 *_retval)
|
||||
{
|
||||
nsIOutlinerBoxObject* body = GetOutlinerBody();
|
||||
|
@ -303,6 +311,14 @@ NS_IMETHODIMP nsOutlinerBoxObject::Invalidate()
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsOutlinerBoxObject::InvalidateColumn(const PRUnichar *aColID)
|
||||
{
|
||||
nsIOutlinerBoxObject* body = GetOutlinerBody();
|
||||
if (body)
|
||||
return body->InvalidateColumn(aColID);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsOutlinerBoxObject::InvalidateRow(PRInt32 aIndex)
|
||||
{
|
||||
nsIOutlinerBoxObject* body = GetOutlinerBody();
|
||||
|
|
|
@ -234,7 +234,7 @@ nsOutlinerContentView::GetCellProperties(PRInt32 aRow, const PRUnichar* aColID,
|
|||
|
||||
Row* row = (Row*)mRows[aRow];
|
||||
nsCOMPtr<nsIContent> realRow;
|
||||
GetImmediateChild(row->mContent, nsXULAtoms::outlinerrow, getter_AddRefs(realRow));
|
||||
nsOutlinerUtils::GetImmediateChild(row->mContent, nsXULAtoms::outlinerrow, getter_AddRefs(realRow));
|
||||
if (realRow) {
|
||||
nsCOMPtr<nsIContent> cell;
|
||||
GetNamedCell(realRow, aColID, getter_AddRefs(cell));
|
||||
|
@ -417,7 +417,7 @@ nsOutlinerContentView::GetCellText(PRInt32 aRow, const PRUnichar* aColID, nsAStr
|
|||
|
||||
Row* row = (Row*)mRows[aRow];
|
||||
nsCOMPtr<nsIContent> realRow;
|
||||
GetImmediateChild(row->mContent, nsXULAtoms::outlinerrow, getter_AddRefs(realRow));
|
||||
nsOutlinerUtils::GetImmediateChild(row->mContent, nsXULAtoms::outlinerrow, getter_AddRefs(realRow));
|
||||
if (realRow) {
|
||||
nsCOMPtr<nsIContent> cell;
|
||||
GetNamedCell(realRow, aColID, getter_AddRefs(cell));
|
||||
|
@ -444,15 +444,13 @@ nsOutlinerContentView::ToggleOpenState(PRInt32 aIndex)
|
|||
if (aIndex < 0 || aIndex >= mRows.Count())
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
|
||||
// We don't serialize content right here, since content might be generated
|
||||
// lazily.
|
||||
Row* row = (Row*)mRows[aIndex];
|
||||
if (row->IsOpen()) {
|
||||
CloseContainer(aIndex);
|
||||
row->mContent->UnsetAttr(kNameSpaceID_None, nsXULAtoms::open, PR_FALSE);
|
||||
}
|
||||
else {
|
||||
OpenContainer(aIndex);
|
||||
row->mContent->SetAttr(kNameSpaceID_None, nsXULAtoms::open, NS_LITERAL_STRING("true"), PR_FALSE);
|
||||
}
|
||||
if (row->IsOpen())
|
||||
row->mContent->UnsetAttr(kNameSpaceID_None, nsXULAtoms::open, PR_TRUE);
|
||||
else
|
||||
row->mContent->SetAttr(kNameSpaceID_None, nsXULAtoms::open, NS_LITERAL_STRING("true"), PR_TRUE);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -544,8 +542,12 @@ nsOutlinerContentView::SetRoot(nsIDOMElement* aRoot)
|
|||
mDocument = document;
|
||||
}
|
||||
|
||||
PRInt32 index = 0;
|
||||
Serialize(mRoot, -1, &index, mRows);
|
||||
nsCOMPtr<nsIContent> child;
|
||||
nsOutlinerUtils::GetImmediateChild(mRoot, nsXULAtoms::outlinerchildren, getter_AddRefs(child));
|
||||
if (child) {
|
||||
PRInt32 index = 0;
|
||||
Serialize(child, -1, &index, mRows);
|
||||
}
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
@ -926,7 +928,7 @@ nsOutlinerContentView::SerializeItem(nsIContent* aContent, PRInt32 aParentIndex,
|
|||
aRows.AppendElement(row);
|
||||
|
||||
nsCOMPtr<nsIContent> realRow;
|
||||
GetImmediateChild(aContent, nsXULAtoms::outlinerrow, getter_AddRefs(realRow));
|
||||
nsOutlinerUtils::GetImmediateChild(aContent, nsXULAtoms::outlinerrow, getter_AddRefs(realRow));
|
||||
if (realRow)
|
||||
ParseProperties(realRow, &row->mProperty);
|
||||
|
||||
|
@ -939,7 +941,7 @@ nsOutlinerContentView::SerializeItem(nsIContent* aContent, PRInt32 aParentIndex,
|
|||
if (open.Equals(NS_LITERAL_STRING("true"))) {
|
||||
row->SetOpen(PR_TRUE);
|
||||
nsCOMPtr<nsIContent> child;
|
||||
GetImmediateChild(aContent, nsXULAtoms::outlinerchildren, getter_AddRefs(child));
|
||||
nsOutlinerUtils::GetImmediateChild(aContent, nsXULAtoms::outlinerchildren, getter_AddRefs(child));
|
||||
if (child) {
|
||||
// Now, recursively serialize our child.
|
||||
PRInt32 count = aRows.Count();
|
||||
|
@ -985,7 +987,7 @@ nsOutlinerContentView::GetIndexInSubtree(nsIContent* aContainer, nsIContent* aCo
|
|||
content->GetAttr(kNameSpaceID_None, nsXULAtoms::open, open);
|
||||
if (open.Equals(NS_LITERAL_STRING("true"))) {
|
||||
nsCOMPtr<nsIContent> child;
|
||||
GetImmediateChild(content, nsXULAtoms::outlinerchildren, getter_AddRefs(child));
|
||||
nsOutlinerUtils::GetImmediateChild(content, nsXULAtoms::outlinerchildren, getter_AddRefs(child));
|
||||
if (child)
|
||||
GetIndexInSubtree(child, aContent, aIndex);
|
||||
}
|
||||
|
@ -1001,7 +1003,7 @@ nsOutlinerContentView::EnsureSubtree(PRInt32 aIndex, PRInt32* aCount)
|
|||
{
|
||||
Row* row = (Row*)mRows[aIndex];
|
||||
nsCOMPtr<nsIContent> child;
|
||||
GetImmediateChild(row->mContent, nsXULAtoms::outlinerchildren, getter_AddRefs(child));
|
||||
nsOutlinerUtils::GetImmediateChild(row->mContent, nsXULAtoms::outlinerchildren, getter_AddRefs(child));
|
||||
if (! child) {
|
||||
*aCount = 0;
|
||||
return;
|
||||
|
@ -1018,7 +1020,7 @@ nsOutlinerContentView::EnsureSubtree(PRInt32 aIndex, PRInt32* aCount)
|
|||
|
||||
// Update parent indexes, but skip newly added rows.
|
||||
// They already have correct values.
|
||||
UpdateParentIndexes(aIndex, count, count);
|
||||
UpdateParentIndexes(aIndex, count + 1, count);
|
||||
|
||||
*aCount = count;
|
||||
}
|
||||
|
@ -1103,6 +1105,7 @@ nsOutlinerContentView::OpenContainer(PRInt32 aIndex)
|
|||
|
||||
PRInt32 count;
|
||||
EnsureSubtree(aIndex, &count);
|
||||
mBoxObject->InvalidateRow(aIndex);
|
||||
mBoxObject->RowCountChanged(aIndex + 1, count);
|
||||
}
|
||||
|
||||
|
@ -1115,6 +1118,7 @@ nsOutlinerContentView::CloseContainer(PRInt32 aIndex)
|
|||
|
||||
PRInt32 count;
|
||||
RemoveSubtree(aIndex, &count);
|
||||
mBoxObject->InvalidateRow(aIndex);
|
||||
mBoxObject->RowCountChanged(aIndex + 1, -count);
|
||||
}
|
||||
|
||||
|
@ -1149,88 +1153,11 @@ nsOutlinerContentView::UpdateParentIndexes(PRInt32 aIndex, PRInt32 aSkip, PRInt3
|
|||
}
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsOutlinerContentView::GetImmediateChild(nsIContent* aContainer, nsIAtom* aTag, nsIContent** aResult)
|
||||
{
|
||||
PRInt32 childCount;
|
||||
aContainer->ChildCount(childCount);
|
||||
for (PRInt32 i = 0; i < childCount; i++) {
|
||||
nsCOMPtr<nsIContent> child;
|
||||
aContainer->ChildAt(i, *getter_AddRefs(child));
|
||||
nsCOMPtr<nsIAtom> tag;
|
||||
child->GetTag(*getter_AddRefs(tag));
|
||||
if (tag == aTag) {
|
||||
NS_ADDREF(*aResult = child);
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
|
||||
*aResult = nsnull;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsOutlinerContentView::GetColIndex(const PRUnichar* aColID, PRInt32* aResult)
|
||||
{
|
||||
*aResult = -1;
|
||||
|
||||
// First, try to find col index by already set "colIndex" attribute.
|
||||
nsCOMPtr<nsIDOMDocument> domDocument = do_QueryInterface(mDocument);
|
||||
nsCOMPtr<nsIDOMElement> domElement;
|
||||
domDocument->GetElementById(nsDependentString(aColID), getter_AddRefs(domElement));
|
||||
if (domElement) {
|
||||
nsAutoString colIndexValue;
|
||||
domElement->GetAttribute(NS_LITERAL_STRING("colIndex"), colIndexValue);
|
||||
if (colIndexValue.Length()) {
|
||||
PRInt32 rv;
|
||||
*aResult = colIndexValue.ToInteger(&rv);
|
||||
}
|
||||
}
|
||||
|
||||
if (*aResult == -1) {
|
||||
// No "colIndex" attribute, traverse through cols
|
||||
nsCOMPtr<nsIContent> parent;
|
||||
mRoot->GetParent(*getter_AddRefs(parent));
|
||||
if (parent) {
|
||||
nsCOMPtr<nsIContent> cols;
|
||||
GetImmediateChild(parent, nsXULAtoms::outlinercols, getter_AddRefs(cols));
|
||||
if (cols) {
|
||||
PRInt32 childCount;
|
||||
cols->ChildCount(childCount);
|
||||
PRInt32 index = 0;
|
||||
for (PRInt32 i = 0; i < childCount; i++) {
|
||||
nsCOMPtr<nsIContent> child;
|
||||
cols->ChildAt(i, *getter_AddRefs(child));
|
||||
nsCOMPtr<nsIAtom> tag;
|
||||
child->GetTag(*getter_AddRefs(tag));
|
||||
if (tag == nsXULAtoms::outlinercol) {
|
||||
nsAutoString id;
|
||||
child->GetAttr(kNameSpaceID_None, nsHTMLAtoms::id, id);
|
||||
if (id.Equals(aColID)) {
|
||||
// Found it, set "colIndex" attribute to speed up next call.
|
||||
nsCOMPtr<nsIAtom> colIndexAtom;
|
||||
colIndexAtom = dont_AddRef(NS_NewAtom(NS_LITERAL_STRING("colIndex")));
|
||||
nsAutoString colIndexValue;
|
||||
colIndexValue.AppendInt(index);
|
||||
child->SetAttr(kNameSpaceID_None, colIndexAtom, colIndexValue, PR_FALSE);
|
||||
*aResult = index;
|
||||
break;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsOutlinerContentView::GetNamedCell(nsIContent* aContainer, const PRUnichar* aColID, nsIContent** aResult)
|
||||
{
|
||||
PRInt32 colIndex;
|
||||
GetColIndex(aColID, &colIndex);
|
||||
mBoxObject->GetColumnIndex(aColID, &colIndex);
|
||||
|
||||
// Traverse through cells, try to find the cell by "ref" attribute or by cell
|
||||
// index in a row. "ref" attribute has higher priority.
|
||||
|
@ -1246,7 +1173,7 @@ nsOutlinerContentView::GetNamedCell(nsIContent* aContainer, const PRUnichar* aCo
|
|||
if (tag == nsXULAtoms::outlinercell) {
|
||||
nsAutoString ref;
|
||||
cell->GetAttr(kNameSpaceID_None, nsXULAtoms::ref, ref);
|
||||
if (ref.Equals(aColID)) {
|
||||
if (!ref.IsEmpty() && ref.Equals(aColID)) {
|
||||
*aResult = cell;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -174,10 +174,6 @@ class nsOutlinerContentView : public nsIOutlinerView,
|
|||
void UpdateParentIndexes(PRInt32 aIndex, PRInt32 aSkip, PRInt32 aCount);
|
||||
|
||||
// Content helpers.
|
||||
nsresult GetImmediateChild(nsIContent* aContainer, nsIAtom* aTag, nsIContent** aResult);
|
||||
|
||||
nsresult GetColIndex(const PRUnichar* aColID, PRInt32* aResult);
|
||||
|
||||
nsresult GetNamedCell(nsIContent* aContainer, const PRUnichar* aColID, nsIContent** aResult);
|
||||
|
||||
nsresult ParseProperties(nsIContent* aContent, Property** aProperty);
|
||||
|
|
|
@ -78,3 +78,23 @@ nsOutlinerUtils::TokenizeProperties(const nsAString& aProperties, nsISupportsArr
|
|||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsOutlinerUtils::GetImmediateChild(nsIContent* aContainer, nsIAtom* aTag, nsIContent** aResult)
|
||||
{
|
||||
PRInt32 childCount;
|
||||
aContainer->ChildCount(childCount);
|
||||
for (PRInt32 i = 0; i < childCount; i++) {
|
||||
nsCOMPtr<nsIContent> child;
|
||||
aContainer->ChildAt(i, *getter_AddRefs(child));
|
||||
nsCOMPtr<nsIAtom> tag;
|
||||
child->GetTag(*getter_AddRefs(tag));
|
||||
if (tag == aTag) {
|
||||
NS_ADDREF(*aResult = child);
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
|
||||
*aResult = nsnull;
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -41,6 +41,7 @@
|
|||
|
||||
#include "nsString.h"
|
||||
#include "nsISupportsArray.h"
|
||||
#include "nsIContent.h"
|
||||
|
||||
class nsOutlinerUtils
|
||||
{
|
||||
|
@ -51,6 +52,9 @@ class nsOutlinerUtils
|
|||
*/
|
||||
static nsresult
|
||||
TokenizeProperties(const nsAString& aProperties, nsISupportsArray* aPropertiesArray);
|
||||
|
||||
static nsresult
|
||||
GetImmediateChild(nsIContent* aContainer, nsIAtom* aTag, nsIContent** aResult);
|
||||
};
|
||||
|
||||
#endif // nsOutlinerUtils_h__
|
||||
|
|
|
@ -44,39 +44,39 @@
|
|||
</groupbox>
|
||||
|
||||
<!-- category tree entries for mail/news -->
|
||||
<treechildren id="panelChildren">
|
||||
<treeitem container="true" open="true" id="mailnews" position="3">
|
||||
<treerow>
|
||||
<treecell class="treecell-indent" url="chrome://messenger/content/pref-mailnews.xul" label="&mail.label;"/>
|
||||
</treerow>
|
||||
<treechildren id="messengerChildren">
|
||||
<treeitem>
|
||||
<treerow>
|
||||
<treecell class="treecell-indent" url="chrome://messenger/content/pref-viewing_messages.xul" label="&viewingMessages.label;"/>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
<treeitem>
|
||||
<treerow>
|
||||
<treecell class="treecell-indent" url="chrome://messenger/content/messengercompose/pref-composing_messages.xul" label="&composingMessages.label;"/>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
<treeitem>
|
||||
<treerow>
|
||||
<treecell class="treecell-indent" url="chrome://messenger/content/messengercompose/pref-formatting.xul" label="&format.label;"/>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
<treeitem>
|
||||
<treerow>
|
||||
<treecell class="treecell-indent" url="chrome://messenger/content/addressbook/pref-addressing.xul" label="&address.label;"/>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
<treeitem>
|
||||
<treerow>
|
||||
<treecell class="treecell-indent" url="chrome://messenger/content/pref-labels.xul" label="&labels.label;"/>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
</treechildren>
|
||||
</treeitem>
|
||||
</treechildren>
|
||||
<outlinerchildren id="panelChildren">
|
||||
<outlineritem container="true" open="true" id="mailnews" position="3">
|
||||
<outlinerrow>
|
||||
<outlinercell url="chrome://messenger/content/pref-mailnews.xul" label="&mail.label;"/>
|
||||
</outlinerrow>
|
||||
<outlinerchildren id="messengerChildren">
|
||||
<outlineritem>
|
||||
<outlinerrow>
|
||||
<outlinercell url="chrome://messenger/content/pref-viewing_messages.xul" label="&viewingMessages.label;"/>
|
||||
</outlinerrow>
|
||||
</outlineritem>
|
||||
<outlineritem>
|
||||
<outlinerrow>
|
||||
<outlinercell url="chrome://messenger/content/messengercompose/pref-composing_messages.xul" label="&composingMessages.label;"/>
|
||||
</outlinerrow>
|
||||
</outlineritem>
|
||||
<outlineritem>
|
||||
<outlinerrow>
|
||||
<outlinercell url="chrome://messenger/content/messengercompose/pref-formatting.xul" label="&format.label;"/>
|
||||
</outlinerrow>
|
||||
</outlineritem>
|
||||
<outlineritem>
|
||||
<outlinerrow>
|
||||
<outlinercell url="chrome://messenger/content/addressbook/pref-addressing.xul" label="&address.label;"/>
|
||||
</outlinerrow>
|
||||
</outlineritem>
|
||||
<outlineritem>
|
||||
<outlinerrow>
|
||||
<outlinercell url="chrome://messenger/content/pref-labels.xul" label="&labels.label;"/>
|
||||
</outlinerrow>
|
||||
</outlineritem>
|
||||
</outlinerchildren>
|
||||
</outlineritem>
|
||||
</outlinerchildren>
|
||||
|
||||
</overlay>
|
||||
|
|
|
@ -35,12 +35,13 @@
|
|||
<outlinerbody flex="1"
|
||||
datasources="rdf:null"
|
||||
statedatasource="rdf:mailnewsfolders"
|
||||
flags="dont-build-content"
|
||||
ondraggesture="BeginDragFolderOutliner(event);"
|
||||
onselect="FolderPaneSelectionChange();">
|
||||
<template>
|
||||
<rule>
|
||||
<conditions>
|
||||
<outlinerrow uri="?container"/>
|
||||
<outlineritem uri="?container"/>
|
||||
<member container="?container" child="?member" />
|
||||
</conditions>
|
||||
|
||||
|
@ -90,28 +91,19 @@
|
|||
</bindings>
|
||||
|
||||
<action>
|
||||
<outlinerrow uri="?member">
|
||||
<outlinercell id="folderNameCell"
|
||||
ref="folderNameCol"
|
||||
label="?folderTreeName"
|
||||
properties="specialFolder-?specialFolder
|
||||
biffState-?biffState
|
||||
isServer-?isServer
|
||||
newMessages-?newMessages
|
||||
hasUnreadMessages-?hasUnreadMessages
|
||||
subfoldersHaveUnreadMessages-?subfoldersHaveUnreadMessages
|
||||
isSecure-?isSecure
|
||||
serverType-?serverType
|
||||
noSelect-?noSelect"/>
|
||||
<outlinercell ref="folderUnreadCol"
|
||||
label="?unreadCount"
|
||||
properties="hasUnreadMessages-?hasUnreadMessages
|
||||
subfoldersHaveUnreadMessages-?subfoldersHaveUnreadMessages"/>
|
||||
<outlinercell ref="folderTotalCol"
|
||||
label="?totalCount"
|
||||
properties="hasUnreadMessages-?hasUnreadMessages
|
||||
subfoldersHaveUnreadMessages-?subfoldersHaveUnreadMessages"/>
|
||||
</outlinerrow>
|
||||
<outlinerchildren>
|
||||
<outlineritem uri="?member">
|
||||
<outlinerrow>
|
||||
<outlinercell id="folderNameCell"
|
||||
label="?folderTreeName"
|
||||
properties="specialFolder-?specialFolder biffState-?biffState isServer-?isServer newMessages-?newMessages hasUnreadMessages-?hasUnreadMessages subfoldersHaveUnreadMessages-?subfoldersHaveUnreadMessages isSecure-?isSecure serverType-?serverType noSelect-?noSelect"/>
|
||||
<outlinercell label="?unreadCount"
|
||||
properties="hasUnreadMessages-?hasUnreadMessages subfoldersHaveUnreadMessages-?subfoldersHaveUnreadMessages"/>
|
||||
<outlinercell label="?totalCount"
|
||||
properties="hasUnreadMessages-?hasUnreadMessages subfoldersHaveUnreadMessages-?subfoldersHaveUnreadMessages"/>
|
||||
</outlinerrow>
|
||||
</outlineritem>
|
||||
</outlinerchildren>
|
||||
</action>
|
||||
</rule>
|
||||
</template>
|
||||
|
|
|
@ -52,11 +52,11 @@ Contributors:
|
|||
<description class="desc">&MsgSelectDesc.label;</description>
|
||||
|
||||
<outliner flex="1" id="synchronizeOutliner">
|
||||
<outlinerbody flex="1" datasources="rdf:msgaccountmanager rdf:mailnewsfolders" ref="msgaccounts:/" onclick="onSynchronizeClick(event);">
|
||||
<outlinerbody flex="1" datasources="rdf:msgaccountmanager rdf:mailnewsfolders" ref="msgaccounts:/" flags="dont-build-content" onclick="onSynchronizeClick(event);">
|
||||
<template>
|
||||
<rule>
|
||||
<conditions>
|
||||
<outlinerrow uri="?container"/>
|
||||
<outlineritem uri="?container"/>
|
||||
<member container="?container" child="?member"/>
|
||||
<triple subject="?member" predicate="http://home.netscape.com/NC-rdf#SupportsOffline" object="true"/>
|
||||
</conditions>
|
||||
|
@ -86,17 +86,15 @@ Contributors:
|
|||
</bindings>
|
||||
|
||||
<action>
|
||||
<outlinerrow uri="?member">
|
||||
<outlinercell ref="folderNameCol"
|
||||
label="?folderTreeName"
|
||||
properties="specialFolder-?specialFolder
|
||||
isServer-?isServer
|
||||
isSecure-?isSecure
|
||||
serverType-?serverType"/>
|
||||
<outlinercell ref="syncCol"
|
||||
properties="synchronize-?synchronize
|
||||
isServer-?isServer"/>
|
||||
</outlinerrow>
|
||||
<outlinerchildren>
|
||||
<outlineritem uri="?member">
|
||||
<outlinerrow>
|
||||
<outlinercell label="?folderTreeName"
|
||||
properties="specialFolder-?specialFolder isServer-?isServer isSecure-?isSecure serverType-?serverType"/>
|
||||
<outlinercell properties="synchronize-?synchronize isServer-?isServer"/>
|
||||
</outlinerrow>
|
||||
</outlineritem>
|
||||
</outlinerchildren>
|
||||
</action>
|
||||
</rule>
|
||||
</template>
|
||||
|
|
|
@ -107,12 +107,13 @@ NS_IMETHODIMP nsMsgThreadedDBView::ReloadFolderAfterQuickSearch()
|
|||
{
|
||||
// restore saved id array and flags array
|
||||
// first, remove all the search hits
|
||||
if (mOutliner)
|
||||
mOutliner->RowCountChanged(0, m_keys.GetSize() * -1);
|
||||
|
||||
PRInt32 oldSize = m_keys.GetSize();
|
||||
m_keys.RemoveAll();
|
||||
m_flags.RemoveAll();
|
||||
m_levels.RemoveAll();
|
||||
if (mOutliner)
|
||||
mOutliner->RowCountChanged(0, -oldSize);
|
||||
|
||||
m_keys.InsertAt(0, &m_preSearchKeys);
|
||||
m_flags.InsertAt(0, &m_preSearchFlags);
|
||||
m_levels.InsertAt(0, &m_preSearchLevels);
|
||||
|
@ -801,18 +802,18 @@ NS_IMETHODIMP
|
|||
nsMsgThreadedDBView::OnNewSearch()
|
||||
{
|
||||
if (!mIsSearchView)
|
||||
{
|
||||
SavePreSearchInfo(); //save the folder view to reload it later.
|
||||
}
|
||||
|
||||
if (mOutliner)
|
||||
mOutliner->RowCountChanged(0, m_keys.GetSize() * -1); // all rows gone.
|
||||
|
||||
PRInt32 oldSize = m_keys.GetSize();
|
||||
m_keys.RemoveAll();
|
||||
m_levels.RemoveAll();
|
||||
m_flags.RemoveAll();
|
||||
if (mOutliner)
|
||||
mOutliner->RowCountChanged(0, -oldSize); // all rows gone.
|
||||
|
||||
ClearPrevIdArray(); // previous cached info about non threaded display is not useful
|
||||
mIsSearchView = PR_TRUE;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -28,30 +28,30 @@
|
|||
<overlay id="pipPrefOverlayID"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<treechildren id="securityChildren">
|
||||
<treeitem id="masterpassItem">
|
||||
<treerow>
|
||||
<treecell class="treecell-indent" url="chrome://pippki/content/pref-masterpass.xul"
|
||||
label="&masterpass.label;"/>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
<treeitem id="sslItem">
|
||||
<treerow>
|
||||
<treecell class="treecell-indent" url="chrome://pippki/content/pref-ssl.xul"
|
||||
label="&ssl.label;"/>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
<treeitem id="certItem">
|
||||
<treerow>
|
||||
<treecell class="treecell-indent" url="chrome://pippki/content/pref-certs.xul"
|
||||
label="&certs.label;"/>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
<treeitem id="validationItem">
|
||||
<treerow>
|
||||
<treecell class="treecell-indent" url="chrome://pippki/content/pref-validation.xul"
|
||||
label="&validation.label;"/>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
</treechildren>
|
||||
<outlinerchildren id="securityChildren">
|
||||
<outlineritem id="masterpassItem">
|
||||
<outlinerrow>
|
||||
<outlinercell url="chrome://pippki/content/pref-masterpass.xul"
|
||||
label="&masterpass.label;"/>
|
||||
</outlinerrow>
|
||||
</outlineritem>
|
||||
<outlineritem id="sslItem">
|
||||
<outlinerrow>
|
||||
<outlinercell url="chrome://pippki/content/pref-ssl.xul"
|
||||
label="&ssl.label;"/>
|
||||
</outlinerrow>
|
||||
</outlineritem>
|
||||
<outlineritem id="certItem">
|
||||
<outlinerrow>
|
||||
<outlinercell url="chrome://pippki/content/pref-certs.xul"
|
||||
label="&certs.label;"/>
|
||||
</outlinerrow>
|
||||
</outlineritem>
|
||||
<outlineritem id="validationItem">
|
||||
<outlinerrow>
|
||||
<outlinercell url="chrome://pippki/content/pref-validation.xul"
|
||||
label="&validation.label;"/>
|
||||
</outlinerrow>
|
||||
</outlineritem>
|
||||
</outlinerchildren>
|
||||
</overlay>
|
||||
|
|
|
@ -1658,24 +1658,32 @@
|
|||
<outliner flex="1" flags="dont-test-empty" anonid="bookmarks-outliner"
|
||||
class="plain" enableColumnDrag="true"
|
||||
onkeypress="if (event.keyCode == 13) this.parentNode.parentNode.openItem(event, true);">
|
||||
<outlinerbody anonid="bookmarks-outlinerbody" datasources="rdf:bookmarks rdf:internetsearch rdf:files rdf:localsearch" flex="1" ref="NC:BookmarksRoot"
|
||||
<outlinerbody anonid="bookmarks-outlinerbody" datasources="rdf:bookmarks rdf:internetsearch rdf:files rdf:localsearch" flex="1" ref="NC:BookmarksRoot" flags="dont-build-content"
|
||||
ondblclick="this.parentNode.parentNode.parentNode.openItem(event, false);"
|
||||
ondraggesture="nsDragAndDrop.startDrag(event, this.parentNode.parentNode.parentNode.DNDObserver);"
|
||||
onselect="this.parentNode.parentNode.parentNode.outlinerBoxObject.view.selectionChanged();">
|
||||
<template>
|
||||
<rule rdf:type="http://home.netscape.com/NC-rdf#BookmarkSeparator">
|
||||
<outlinerrow uri="rdf:*" properties="rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#type separator" />
|
||||
<outlinerchildren>
|
||||
<outlineritem uri="rdf:*">
|
||||
<outlinerrow properties="rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#type separator"/>
|
||||
</outlineritem>
|
||||
</outlinerchildren>
|
||||
</rule>
|
||||
<rule>
|
||||
<outlinerrow uri="rdf:*" properties="rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#type rdf:http://home.netscape.com/NC-rdf#loading rdf:http://home.netscape.com/WEB-rdf#status">
|
||||
<outlinercell ref="Name" label="rdf:http://home.netscape.com/NC-rdf#Name" />
|
||||
<outlinercell ref="URL" label="rdf:http://home.netscape.com/NC-rdf#URL" />
|
||||
<outlinercell ref="ShortcutURL" label="rdf:http://home.netscape.com/NC-rdf#ShortcutURL" />
|
||||
<outlinercell ref="Description" label="rdf:http://home.netscape.com/NC-rdf#Description" />
|
||||
<outlinercell ref="LastVisitDate" label="rdf:http://home.netscape.com/WEB-rdf#LastVisitDate"/>
|
||||
<outlinercell ref="AddDate" label="rdf:http://home.netscape.com/NC-rdf#BookmarkAddDate" />
|
||||
<outlinercell ref="LastModDate" label="rdf:http://home.netscape.com/NC-rdf#LastModifiedDate" />
|
||||
</outlinerrow>
|
||||
<outlinerchildren>
|
||||
<outlineritem uri="rdf:*">
|
||||
<outlinerrow properties="rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#type rdf:http://home.netscape.com/NC-rdf#loading rdf:http://home.netscape.com/WEB-rdf#status">
|
||||
<outlinercell label="rdf:http://home.netscape.com/NC-rdf#Name" />
|
||||
<outlinercell label="rdf:http://home.netscape.com/NC-rdf#URL" />
|
||||
<outlinercell label="rdf:http://home.netscape.com/NC-rdf#ShortcutURL" />
|
||||
<outlinercell label="rdf:http://home.netscape.com/NC-rdf#Description" />
|
||||
<outlinercell label="rdf:http://home.netscape.com/WEB-rdf#LastVisitDate"/>
|
||||
<outlinercell label="rdf:http://home.netscape.com/NC-rdf#BookmarkAddDate" />
|
||||
<outlinercell label="rdf:http://home.netscape.com/NC-rdf#LastModifiedDate" />
|
||||
</outlinerrow>
|
||||
</outlineritem>
|
||||
</outlinerchildren>
|
||||
</rule>
|
||||
</template>
|
||||
</outlinerbody>
|
||||
|
@ -1710,18 +1718,26 @@
|
|||
onpopupshowing="this.parentNode.createContextMenu(event);"/>
|
||||
<outliner flex="1" flags="dont-test-empty" anonid="bookmarks-outliner" enableColumnDrag="true"
|
||||
onkeypress="if (event.keyCode == 13) this.parentNode.openItem(event, false);">
|
||||
<outlinerbody anonid="bookmarks-outlinerbody" datasources="rdf:bookmarks rdf:internetsearch rdf:files rdf:localsearch" flex="1" ref="NC:BookmarksRoot"
|
||||
<outlinerbody anonid="bookmarks-outlinerbody" datasources="rdf:bookmarks rdf:internetsearch rdf:files rdf:localsearch" flex="1" ref="NC:BookmarksRoot" flags="dont-build-content"
|
||||
ondraggesture="nsDragAndDrop.startDrag(event, this.parentNode.parentNode.DNDObserver);"
|
||||
onclick="if (this.parentNode.parentNode.validOpenClickConditions(event)) this.parentNode.parentNode.openItem(event, false);"
|
||||
onselect="this.parentNode.parentNode.outlinerBoxObject.view.selectionChanged();">
|
||||
<template>
|
||||
<rule rdf:type="http://home.netscape.com/NC-rdf#BookmarkSeparator">
|
||||
<outlinerrow uri="rdf:*" properties="rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#type separator" />
|
||||
<outlinerchildren>
|
||||
<outlineritem uri="rdf:*">
|
||||
<outlinerrow properties="rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#type separator" />
|
||||
</outlineritem>
|
||||
</outlinerchildren>
|
||||
</rule>
|
||||
<rule>
|
||||
<outlinerrow uri="rdf:*" properties="rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#type rdf:http://home.netscape.com/NC-rdf#loading rdf:http://home.netscape.com/WEB-rdf#status">
|
||||
<outlinercell ref="Name" label="rdf:http://home.netscape.com/NC-rdf#Name" />
|
||||
</outlinerrow>
|
||||
<outlinerchildren>
|
||||
<outlineritem uri="rdf:*">
|
||||
<outlinerrow properties="rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#type rdf:http://home.netscape.com/NC-rdf#loading rdf:http://home.netscape.com/WEB-rdf#status">
|
||||
<outlinercell label="rdf:http://home.netscape.com/NC-rdf#Name" />
|
||||
</outlinerrow>
|
||||
</outlineritem>
|
||||
</outlinerchildren>
|
||||
</rule>
|
||||
</template>
|
||||
</outlinerbody>
|
||||
|
@ -1736,13 +1752,17 @@
|
|||
<binding id="bookmarks-outliner-folders" extends="chrome://communicator/content/bookmarks/bookmarks.xml#bookmarks-outliner">
|
||||
<xbl:content xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:xbl="http://www.mozilla.org/xbl">
|
||||
<outliner flex="1" flags="dont-test-empty" anonid="bookmarks-outliner">
|
||||
<outlinerbody anonid="bookmarks-outlinerbody" datasources="rdf:bookmarks rdf:internetsearch rdf:files rdf:localsearch" flex="1" ref="NC:BookmarksRoot"
|
||||
<outlinerbody anonid="bookmarks-outlinerbody" datasources="rdf:bookmarks rdf:internetsearch rdf:files rdf:localsearch" flex="1" ref="NC:BookmarksRoot" flags="dont-build-content"
|
||||
onselect="this.parentNode.parentNode.outlinerBoxObject.view.selectionChanged();">
|
||||
<template>
|
||||
<rule iscontainer="true">
|
||||
<outlinerrow uri="rdf:*" properties="rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#type rdf:http://home.netscape.com/NC-rdf#loading rdf:http://home.netscape.com/WEB-rdf#status">
|
||||
<outlinercell ref="Name" label="rdf:http://home.netscape.com/NC-rdf#Name" />
|
||||
</outlinerrow>
|
||||
<outlinerchildren>
|
||||
<outlineritem uri="rdf:*">
|
||||
<outlinerrow properties="rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#type rdf:http://home.netscape.com/NC-rdf#loading rdf:http://home.netscape.com/WEB-rdf#status">
|
||||
<outlinercell label="rdf:http://home.netscape.com/NC-rdf#Name" />
|
||||
</outlinerrow>
|
||||
</outlineritem>
|
||||
</outlinerchildren>
|
||||
</rule>
|
||||
</template>
|
||||
</outlinerbody>
|
||||
|
|
|
@ -75,29 +75,26 @@
|
|||
onkeypress="if (event.keyCode == 13) OpenURL(event.ctrlKey || event.metaKey);">
|
||||
|
||||
<outlinerbody id="historyOutlinerBody" flex="1" datasources="rdf:history"
|
||||
ref="NC:HistoryByDate" context="historyMenu"
|
||||
ref="NC:HistoryByDate" flags="dont-build-content" context="historyMenu"
|
||||
onselect="this.parentNode.outlinerBoxObject.view.selectionChanged();
|
||||
historyOnSelect();"
|
||||
ondraggesture="nsDragAndDrop.startDrag(event, historyDNDObserver);"
|
||||
ondblclick="if (event.button == 0) OpenURL(event.ctrlKey || event.metaKey);">
|
||||
<template>
|
||||
<rule>
|
||||
<outlinerrow uri="rdf:*" rdf:type="rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#type">
|
||||
<outlinercell label="rdf:http://home.netscape.com/NC-rdf#Name"
|
||||
ref="Name"/>
|
||||
<outlinercell label="rdf:http://home.netscape.com/NC-rdf#URL"
|
||||
ref="URL"/>
|
||||
<outlinercell label="rdf:http://home.netscape.com/NC-rdf#Date"
|
||||
ref="Date"/>
|
||||
<outlinercell label="rdf:http://home.netscape.com/NC-rdf#FirstVisitDate"
|
||||
ref="FirstVisitDate"/>
|
||||
<outlinercell label="rdf:http://home.netscape.com/NC-rdf#Hostname"
|
||||
ref="Hostname"/>
|
||||
<outlinercell label="rdf:http://home.netscape.com/NC-rdf#Referrer"
|
||||
ref="Referrer"/>
|
||||
<outlinercell label="rdf:http://home.netscape.com/NC-rdf#VisitCount"
|
||||
ref="VisitCount"/>
|
||||
</outlinerrow>
|
||||
<outlinerchildren>
|
||||
<outlineritem uri="rdf:*" rdf:type="rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#type">
|
||||
<outlinerrow>
|
||||
<outlinercell label="rdf:http://home.netscape.com/NC-rdf#Name"/>
|
||||
<outlinercell label="rdf:http://home.netscape.com/NC-rdf#URL"/>
|
||||
<outlinercell label="rdf:http://home.netscape.com/NC-rdf#Date"/>
|
||||
<outlinercell label="rdf:http://home.netscape.com/NC-rdf#FirstVisitDate"/>
|
||||
<outlinercell label="rdf:http://home.netscape.com/NC-rdf#Hostname" />
|
||||
<outlinercell label="rdf:http://home.netscape.com/NC-rdf#Referrer"/>
|
||||
<outlinercell label="rdf:http://home.netscape.com/NC-rdf#VisitCount"/>
|
||||
</outlinerrow>
|
||||
</outlineritem>
|
||||
</outlinerchildren>
|
||||
</rule>
|
||||
</template>
|
||||
</outlinerbody>
|
||||
|
|
|
@ -26,22 +26,20 @@
|
|||
<overlay id="cookiePrefsOverlay"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<treechildren id="securityChildren">
|
||||
<treeitem position="1">
|
||||
<treerow>
|
||||
<treecell class="treecell-indent"
|
||||
url="chrome://cookie/content/pref-cookies.xul"
|
||||
label="&cookies.label;"
|
||||
id="cookiesCell"/>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
<treeitem position="2">
|
||||
<treerow>
|
||||
<treecell class="treecell-indent"
|
||||
url="chrome://cookie/content/pref-images.xul"
|
||||
label="&images.label;"/>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
</treechildren>
|
||||
<outlinerchildren id="securityChildren">
|
||||
<outlineritem position="1">
|
||||
<outlinerrow>
|
||||
<outlinercell url="chrome://cookie/content/pref-cookies.xul"
|
||||
label="&cookies.label;"
|
||||
id="cookiesCell"/>
|
||||
</outlinerrow>
|
||||
</outlineritem>
|
||||
<outlineritem position="2">
|
||||
<outlinerrow>
|
||||
<outlinercell url="chrome://cookie/content/pref-images.xul"
|
||||
label="&images.label;"/>
|
||||
</outlinerrow>
|
||||
</outlineritem>
|
||||
</outlinerchildren>
|
||||
|
||||
</overlay>
|
||||
|
|
|
@ -261,7 +261,7 @@ nsPrefWindow.prototype =
|
|||
function ()
|
||||
{
|
||||
var prefPanelTree = document.getElementById( "prefsTree" );
|
||||
var selectedItem = prefPanelTree.selectedItems[0];
|
||||
var selectedItem = prefPanelTree.contentView.getItemAtIndex(prefPanelTree.currentIndex);
|
||||
|
||||
var oldURL = document.getElementById( this.contentFrame ).getAttribute("tag");
|
||||
if( !oldURL )
|
||||
|
@ -364,7 +364,8 @@ nsPrefWindow.prototype =
|
|||
currentItem.removeAttribute( "open" );
|
||||
}
|
||||
var openItem = document.getElementById( aSelectItem );
|
||||
panelTree.selectItem( openItem );
|
||||
var index = panelTree.contentView.getIndexOfItem( openItem );
|
||||
panelTree.outlinerBoxObject.selection.select( index );
|
||||
}
|
||||
|
||||
};
|
||||
|
|
|
@ -26,22 +26,20 @@
|
|||
<overlay id="cookiePrefsOverlay"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<treechildren id="securityChildren">
|
||||
<treeitem position="1">
|
||||
<treerow>
|
||||
<treecell class="treecell-indent"
|
||||
url="chrome://cookie/content/pref-cookies.xul"
|
||||
label="&cookies.label;"
|
||||
id="cookiesCell"/>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
<treeitem position="2">
|
||||
<treerow>
|
||||
<treecell class="treecell-indent"
|
||||
url="chrome://cookie/content/pref-images.xul"
|
||||
label="&images.label;"/>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
</treechildren>
|
||||
<outlinerchildren id="securityChildren">
|
||||
<outlineritem position="1">
|
||||
<outlinerrow>
|
||||
<outlinercell url="chrome://cookie/content/pref-cookies.xul"
|
||||
label="&cookies.label;"
|
||||
id="cookiesCell"/>
|
||||
</outlinerrow>
|
||||
</outlineritem>
|
||||
<outlineritem position="2">
|
||||
<outlinerrow>
|
||||
<outlinercell url="chrome://cookie/content/pref-images.xul"
|
||||
label="&images.label;"/>
|
||||
</outlinerrow>
|
||||
</outlineritem>
|
||||
</outlinerchildren>
|
||||
|
||||
</overlay>
|
||||
|
|
|
@ -53,11 +53,8 @@
|
|||
<script type="application/x-javascript" src="chrome://help/content/help.js"/>
|
||||
|
||||
<hbox flex="1">
|
||||
<vbox>
|
||||
<label value="&categoryHeader;"/>
|
||||
<!-- tree sidebar -->
|
||||
<tree id="prefsTree" style="width: 13em;" flex="1"/>
|
||||
</vbox>
|
||||
<!-- tree sidebar -->
|
||||
<outliner id="prefsTree" style="width: 13em;"/>
|
||||
<vbox flex="1">
|
||||
<dialogheader id="header"/>
|
||||
<iframe id="panelFrame" name="panelFrame" style="width: 0px" flex="1"/>
|
||||
|
|
|
@ -37,156 +37,145 @@
|
|||
]]>
|
||||
</script>
|
||||
|
||||
<tree id="prefsTree" onselect="if( hPrefWindow ) hPrefWindow.switchPage();">
|
||||
|
||||
<treecolgroup>
|
||||
<treecol flex="1"/>
|
||||
</treecolgroup>
|
||||
<outliner id="prefsTree" seltype="single">
|
||||
<outlinercols>
|
||||
<outlinercol id="categoryCol" label="&category.label;" flex="1" primary="true"/>
|
||||
</outlinercols>
|
||||
<outlinerbody flex="1" onselect="if( hPrefWindow ) hPrefWindow.switchPage();">
|
||||
<outlinerchildren id="panelChildren">
|
||||
<outlineritem container="true" open="true" id="appearance">
|
||||
<outlinerrow>
|
||||
<outlinercell url="chrome://communicator/content/pref/pref-appearance.xul" label="&appear.label;"/>
|
||||
</outlinerrow>
|
||||
<outlinerchildren id="appearanceChildren">
|
||||
<outlineritem>
|
||||
<outlinerrow>
|
||||
<outlinercell url="chrome://communicator/content/pref/pref-fonts.xul" label="&fonts.label;"/>
|
||||
</outlinerrow>
|
||||
</outlineritem>
|
||||
<outlineritem>
|
||||
<outlinerrow>
|
||||
<outlinercell url="chrome://communicator/content/pref/pref-colors.xul" label="&colors.label;"/>
|
||||
</outlinerrow>
|
||||
</outlineritem>
|
||||
<outlineritem id="themes-panel">
|
||||
<outlinerrow>
|
||||
<outlinercell url="chrome://communicator/content/pref/pref-themes.xul" label="&themes.label;"/>
|
||||
</outlinerrow>
|
||||
</outlineritem>
|
||||
</outlinerchildren>
|
||||
</outlineritem>
|
||||
|
||||
<!-- XXX remove this when overlays.rdf works for navigator -->
|
||||
<outlineritem container="true" open="true" id="navigator">
|
||||
<outlinerrow>
|
||||
<outlinercell url="chrome://communicator/content/pref/pref-navigator.xul" label="&navigator.label;"/>
|
||||
</outlinerrow>
|
||||
<outlinerchildren>
|
||||
<outlineritem>
|
||||
<outlinerrow>
|
||||
<outlinercell url="chrome://communicator/content/pref/pref-history.xul" label="&history.label;"/>
|
||||
</outlinerrow>
|
||||
</outlineritem>
|
||||
<outlineritem>
|
||||
<outlinerrow>
|
||||
<outlinercell url="chrome://communicator/content/pref/pref-languages.xul" label="&languages.label;"/>
|
||||
</outlinerrow>
|
||||
</outlineritem>
|
||||
<outlineritem>
|
||||
<outlinerrow>
|
||||
<outlinercell url="chrome://communicator/content/pref/pref-applications.xul" label="&applications.label;"/>
|
||||
</outlinerrow>
|
||||
</outlineritem>
|
||||
<outlineritem>
|
||||
<outlinerrow>
|
||||
<outlinercell url="chrome://communicator/content/pref/pref-smart_browsing.xul" label="&smartBrowse.label;"/>
|
||||
</outlinerrow>
|
||||
</outlineritem>
|
||||
<outlineritem>
|
||||
<outlinerrow>
|
||||
<outlinercell url="chrome://communicator/content/pref/pref-search.xul" label="&search.label;"/>
|
||||
</outlinerrow>
|
||||
</outlineritem>
|
||||
<outlineritem>
|
||||
<outlinerrow>
|
||||
<outlinercell url="chrome://communicator/content/pref/pref-tabs.xul" label="&tabWindows.label;"/>
|
||||
</outlinerrow>
|
||||
</outlineritem>
|
||||
<outlineritem>
|
||||
<outlinerrow>
|
||||
<outlinercell url="chrome://communicator/content/pref/pref-policies.xul" label="&policies.label;"/>
|
||||
</outlinerrow>
|
||||
</outlineritem> -->
|
||||
</outlinerchildren>
|
||||
</outlineritem>
|
||||
|
||||
<treechildren id="panelChildren" flex="1">
|
||||
<treeitem container="true" open="true" id="appearance">
|
||||
<treerow>
|
||||
<treecell class="treecell-indent" url="chrome://communicator/content/pref/pref-appearance.xul" label="&appear.label;"/>
|
||||
</treerow>
|
||||
<treechildren id="appearanceChildren">
|
||||
<treeitem>
|
||||
<treerow>
|
||||
<treecell class="treecell-indent" url="chrome://communicator/content/pref/pref-fonts.xul" label="&fonts.label;"/>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
<treeitem>
|
||||
<treerow>
|
||||
<treecell class="treecell-indent" url="chrome://communicator/content/pref/pref-colors.xul" label="&colors.label;"/>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
<treeitem id="themes-panel">
|
||||
<treerow>
|
||||
<treecell class="treecell-indent" url="chrome://communicator/content/pref/pref-themes.xul" label="&themes.label;"/>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
</treechildren>
|
||||
</treeitem>
|
||||
<!-- Security and Privacy items -->
|
||||
<outlineritem container="true" open="true" id="securityItem">
|
||||
<outlinerrow>
|
||||
<outlinercell url="chrome://communicator/content/pref/pref-security.xul" label="&security.label;" />
|
||||
</outlinerrow>
|
||||
<outlinerchildren id="securityChildren"/>
|
||||
</outlineritem>
|
||||
|
||||
<!-- XXX remove this when overlays.rdf works for navigator -->
|
||||
<treeitem container="true" open="true" id="navigator">
|
||||
<treerow>
|
||||
<treecell class="treecell-indent" url="chrome://communicator/content/pref/pref-navigator.xul" label="&navigator.label;"/>
|
||||
</treerow>
|
||||
<treechildren>
|
||||
<treeitem>
|
||||
<treerow>
|
||||
<treecell class="treecell-indent" url="chrome://communicator/content/pref/pref-history.xul" label="&history.label;"/>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
<treeitem>
|
||||
<treerow>
|
||||
<treecell class="treecell-indent" url="chrome://communicator/content/pref/pref-languages.xul" label="&languages.label;"/>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
<treeitem>
|
||||
<treerow>
|
||||
<treecell class="treecell-indent" url="chrome://communicator/content/pref/pref-applications.xul" label="&applications.label;"/>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
<treeitem>
|
||||
<treerow>
|
||||
<treecell class="treecell-indent" url="chrome://communicator/content/pref/pref-smart_browsing.xul" label="&smartBrowse.label;"/>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
|
||||
<treeitem>
|
||||
<treerow>
|
||||
<treecell class="treecell-indent" url="chrome://communicator/content/pref/pref-search.xul" label="&search.label;"/>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
<outlineritem container="true" open="true" id="advancedItem">
|
||||
<outlinerrow>
|
||||
<outlinercell url="chrome://communicator/content/pref/pref-advanced.xul" label="&advance.label;"/>
|
||||
</outlinerrow>
|
||||
<outlinerchildren id="advancedChildren">
|
||||
<outlineritem>
|
||||
<outlinerrow>
|
||||
<outlinercell url="chrome://communicator/content/pref/pref-scripts.xul" label="&scriptsAndWindows.label;"/>
|
||||
</outlinerrow>
|
||||
</outlineritem>
|
||||
<outlineritem>
|
||||
<outlinerrow>
|
||||
<outlinercell url="chrome://communicator/content/pref/pref-cache.xul" label="&cache.label;"/>
|
||||
</outlinerrow>
|
||||
</outlineritem>
|
||||
<outlineritem>
|
||||
<outlinerrow>
|
||||
<outlinercell url="chrome://communicator/content/pref/pref-proxies.xul" label="&proxies.label;"/>
|
||||
</outlinerrow>
|
||||
</outlineritem>
|
||||
<outlineritem>
|
||||
<outlinerrow>
|
||||
<outlinercell url="chrome://communicator/content/pref/pref-smartupdate.xul" label="&smart.label;"/>
|
||||
</outlinerrow>
|
||||
</outlineritem>
|
||||
<outlineritem id="mousewheelItem">
|
||||
<outlinerrow>
|
||||
<outlinercell url="chrome://communicator/content/pref/pref-mousewheel.xul" label="&mousewheel.label;"/>
|
||||
</outlinerrow>
|
||||
</outlineritem>
|
||||
</outlinerchildren>
|
||||
</outlineritem>
|
||||
|
||||
<treeitem>
|
||||
<treerow>
|
||||
<treecell class="treecell-indent" url="chrome://communicator/content/pref/pref-tabs.xul" label="&tabWindows.label;"/>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
<outlineritem container="true" open="true" id="debugItem">
|
||||
<outlinerrow>
|
||||
<outlinercell url="chrome://communicator/content/pref/pref-debug.xul" label="&debug.label;"/>
|
||||
</outlinerrow>
|
||||
<outlinerchildren id="debugChildren">
|
||||
<outlineritem>
|
||||
<outlinerrow>
|
||||
<outlinercell url="chrome://communicator/content/pref/pref-debug1.xul" label="&debug1.label;"/>
|
||||
</outlinerrow>
|
||||
</outlineritem>
|
||||
<outlineritem>
|
||||
<outlinerrow>
|
||||
<outlinercell url="chrome://communicator/content/pref/pref-debug2.xul" label="&debug2.label;"/>
|
||||
</outlinerrow>
|
||||
</outlineritem>
|
||||
</outlinerchildren>
|
||||
</outlineritem>
|
||||
|
||||
<!-- Taking out Policies panel b/c bug 44121
|
||||
<treeitem>
|
||||
<treerow>
|
||||
<treecell class="treecell-indent" url="chrome://communicator/content/pref/pref-policies.xul" label="&policies.label;"/>
|
||||
</treerow>
|
||||
</treeitem> -->
|
||||
</treechildren>
|
||||
</treeitem>
|
||||
<!-- XXX -->
|
||||
|
||||
<!-- Security and Privacy items -->
|
||||
<treeitem container="true" open="true" id="securityItem">
|
||||
<treerow>
|
||||
<treecell class="treecell-indent" url="chrome://communicator/content/pref/pref-security.xul"
|
||||
label="&security.label;" />
|
||||
</treerow>
|
||||
<treechildren id="securityChildren"/>
|
||||
</treeitem>
|
||||
|
||||
<treeitem container="true" open="true" id="advancedItem">
|
||||
<treerow>
|
||||
<treecell class="treecell-indent" url="chrome://communicator/content/pref/pref-advanced.xul" label="&advance.label;"/>
|
||||
</treerow>
|
||||
<treechildren id="advancedChildren">
|
||||
<treeitem>
|
||||
<treerow>
|
||||
<treecell class="treecell-indent" url="chrome://communicator/content/pref/pref-scripts.xul" label="&scriptsAndWindows.label;"/>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
<treeitem>
|
||||
<treerow>
|
||||
<treecell class="treecell-indent" url="chrome://communicator/content/pref/pref-cache.xul" label="&cache.label;"/>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
<treeitem>
|
||||
<treerow>
|
||||
<treecell class="treecell-indent" url="chrome://communicator/content/pref/pref-proxies.xul" label="&proxies.label;"/>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
<treeitem>
|
||||
<treerow>
|
||||
<treecell class="treecell-indent" url="chrome://communicator/content/pref/pref-smartupdate.xul" label="&smart.label;"/>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
<treeitem id="mousewheelItem">
|
||||
<treerow>
|
||||
<treecell class="treecell-indent" url="chrome://communicator/content/pref/pref-mousewheel.xul" label="&mousewheel.label;"/>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
</treechildren>
|
||||
</treeitem>
|
||||
|
||||
<treeitem container="true" open="true" id="debugItem">
|
||||
<treerow>
|
||||
<treecell class="treecell-indent" url="chrome://communicator/content/pref/pref-debug.xul" label="&debug.label;"/>
|
||||
</treerow>
|
||||
<treechildren id="debugChildren">
|
||||
|
||||
<treeitem>
|
||||
<treerow>
|
||||
<treecell class="treecell-indent" url="chrome://communicator/content/pref/pref-debug1.xul" label="&debug1.label;"/>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
|
||||
<treeitem>
|
||||
<treerow>
|
||||
<treecell class="treecell-indent" url="chrome://communicator/content/pref/pref-debug2.xul" label="&debug2.label;"/>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
|
||||
</treechildren>
|
||||
</treeitem>
|
||||
|
||||
<treeitem container="false" id="offlineItem">
|
||||
<treerow>
|
||||
<treecell class="treecell-indent" url="chrome://communicator/content/pref/pref-offline.xul" label="&offline.label;"/>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
|
||||
</treechildren>
|
||||
|
||||
</tree>
|
||||
<outlineritem id="offlineItem">
|
||||
<outlinerrow>
|
||||
<outlinercell url="chrome://communicator/content/pref/pref-offline.xul" label="&offline.label;"/>
|
||||
</outlinerrow>
|
||||
</outlineritem>
|
||||
</outlinerchildren>
|
||||
</outlinerbody>
|
||||
</outliner>
|
||||
|
||||
</overlay>
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
<!-- LOCALIZATION NOTE : FILE UI for the outer parts of the Prefs dialog -->
|
||||
<!ENTITY prefWindow.title "Preferences">
|
||||
<!ENTITY categoryHeader "Category">
|
||||
|
||||
<!-- LOCALIZATION NOTE : this is part of an inline-style attribute on the
|
||||
preference dialog's <window> node, which specifies the width and height
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
<!-- extracted from content/preftree.xul -->
|
||||
|
||||
<!ENTITY category.label "Category">
|
||||
|
||||
<!--LOCALIZATION NOTE : FILE Lists preferences categories that appear on the left of the preferences dialog -->
|
||||
<!ENTITY appear.label "Appearance">
|
||||
<!ENTITY fonts.label "Fonts">
|
||||
|
|
|
@ -578,6 +578,20 @@
|
|||
</xul:hbox>
|
||||
<xul:scrollbar orient="vertical" class="outliner-scrollbar"/>
|
||||
</content>
|
||||
<handlers>
|
||||
<handler event="underflow">
|
||||
<![CDATA[
|
||||
document.getAnonymousNodes(this)[1].collapsed = true;
|
||||
event.preventBubble();
|
||||
]]>
|
||||
</handler>
|
||||
<handler event="overflow">
|
||||
<![CDATA[
|
||||
document.getAnonymousNodes(this)[1].collapsed = false;
|
||||
event.preventBubble();
|
||||
]]>
|
||||
</handler>
|
||||
</handlers>
|
||||
</binding>
|
||||
|
||||
<binding id="outlinerbody" extends="chrome://global/content/bindings/outliner.xml#outliner-base">
|
||||
|
@ -746,14 +760,18 @@
|
|||
if (col.mTargetCol == targetCol && col.mTargetDir == pos.value)
|
||||
return;
|
||||
|
||||
var outliner = col.parentNode.parentNode;
|
||||
var sib;
|
||||
if (col.mTargetCol) {
|
||||
// remove previous insertbefore/after attributes
|
||||
col.mTargetCol.removeAttribute("insertbefore");
|
||||
col.mTargetCol.removeAttribute("insertafter");
|
||||
outliner.outlinerBoxObject.invalidateColumn(col.mTargetCol.id);
|
||||
sib = col.mTargetCol._previousVisibleColumn;
|
||||
if (sib)
|
||||
if (sib) {
|
||||
sib.removeAttribute("insertafter");
|
||||
outliner.outlinerBoxObject.invalidateColumn(sib.id);
|
||||
}
|
||||
col.mTargetCol = null;
|
||||
col.mTargetDir = null;
|
||||
}
|
||||
|
@ -765,16 +783,15 @@
|
|||
} else {
|
||||
targetCol.setAttribute("insertbefore", "true");
|
||||
sib = targetCol._previousVisibleColumn;
|
||||
if (sib)
|
||||
if (sib) {
|
||||
sib.setAttribute("insertafter", "true");
|
||||
outliner.outlinerBoxObject.invalidateColumn(sib.id);
|
||||
}
|
||||
}
|
||||
outliner.outlinerBoxObject.invalidateColumn(targetCol.id);
|
||||
col.mTargetCol = targetCol;
|
||||
col.mTargetDir = pos.value;
|
||||
}
|
||||
|
||||
// XXX should really just invalidate columns
|
||||
// XXX need to implement nsIOutlinerBoxObject::invalidateColumn(in long column)
|
||||
col.parentNode.parentNode.outlinerBoxObject.invalidate();
|
||||
]]></body>
|
||||
</method>
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче