mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 06:43:32 +00:00
avoiding confusion between line iterator between layout and navigation.
if you want a line iterator for navigation you must explicitly ask for one.
This commit is contained in:
parent
f7d5b7c077
commit
7ab436fd88
@ -20,7 +20,6 @@
|
||||
* Contributor(s):
|
||||
* Steve Clark <buster@netscape.com>
|
||||
* Robert O'Callahan <roc+moz@cs.cmu.edu>
|
||||
* Pierre Phaneuf <pp@ludusdesign.com>
|
||||
*/
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsBlockFrame.h"
|
||||
@ -1206,7 +1205,8 @@ nsBlockFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
|
||||
*aInstancePtr = (void*) tmp;
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(NS_GET_IID(nsILineIterator))) {
|
||||
if ( aIID.Equals(NS_GET_IID(nsILineIterator)) || aIID.Equals(NS_GET_IID(nsILineIteratorNavigator)) )
|
||||
{
|
||||
nsLineIterator* it = new nsLineIterator;
|
||||
if (!it) {
|
||||
*aInstancePtr = nsnull;
|
||||
@ -1220,7 +1220,8 @@ nsBlockFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
|
||||
delete it;
|
||||
return rv;
|
||||
}
|
||||
return it->QueryInterface(aIID, aInstancePtr);
|
||||
NS_ADDREF((nsILineIterator *) (*aInstancePtr = (void *) it));
|
||||
return NS_OK;
|
||||
}
|
||||
return nsBlockFrameSuper::QueryInterface(aIID, aInstancePtr);
|
||||
}
|
||||
|
@ -20,7 +20,6 @@
|
||||
* Contributor(s):
|
||||
* Steve Clark <buster@netscape.com>
|
||||
* Robert O'Callahan <roc+moz@cs.cmu.edu>
|
||||
* Pierre Phaneuf <pp@ludusdesign.com>
|
||||
*/
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsBlockFrame.h"
|
||||
@ -1206,7 +1205,8 @@ nsBlockFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
|
||||
*aInstancePtr = (void*) tmp;
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(NS_GET_IID(nsILineIterator))) {
|
||||
if ( aIID.Equals(NS_GET_IID(nsILineIterator)) || aIID.Equals(NS_GET_IID(nsILineIteratorNavigator)) )
|
||||
{
|
||||
nsLineIterator* it = new nsLineIterator;
|
||||
if (!it) {
|
||||
*aInstancePtr = nsnull;
|
||||
@ -1220,7 +1220,8 @@ nsBlockFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
|
||||
delete it;
|
||||
return rv;
|
||||
}
|
||||
return it->QueryInterface(aIID, aInstancePtr);
|
||||
NS_ADDREF((nsILineIterator *) (*aInstancePtr = (void *) it));
|
||||
return NS_OK;
|
||||
}
|
||||
return nsBlockFrameSuper::QueryInterface(aIID, aInstancePtr);
|
||||
}
|
||||
|
@ -20,7 +20,6 @@
|
||||
* Contributor(s):
|
||||
* Steve Clark <buster@netscape.com>
|
||||
* Robert O'Callahan <roc+moz@cs.cmu.edu>
|
||||
* Pierre Phaneuf <pp@ludusdesign.com>
|
||||
*/
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsBlockFrame.h"
|
||||
@ -1206,7 +1205,8 @@ nsBlockFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
|
||||
*aInstancePtr = (void*) tmp;
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(NS_GET_IID(nsILineIterator))) {
|
||||
if ( aIID.Equals(NS_GET_IID(nsILineIterator)) || aIID.Equals(NS_GET_IID(nsILineIteratorNavigator)) )
|
||||
{
|
||||
nsLineIterator* it = new nsLineIterator;
|
||||
if (!it) {
|
||||
*aInstancePtr = nsnull;
|
||||
@ -1220,7 +1220,8 @@ nsBlockFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
|
||||
delete it;
|
||||
return rv;
|
||||
}
|
||||
return it->QueryInterface(aIID, aInstancePtr);
|
||||
NS_ADDREF((nsILineIterator *) (*aInstancePtr = (void *) it));
|
||||
return NS_OK;
|
||||
}
|
||||
return nsBlockFrameSuper::QueryInterface(aIID, aInstancePtr);
|
||||
}
|
||||
|
@ -2277,8 +2277,8 @@ nsFrame::GetNextPrevLineFromeBlockFrame(nsIPresContext* aPresContext,
|
||||
aPos->mPreferLeft = (aPos->mDirection == eDirNext);
|
||||
|
||||
nsresult result;
|
||||
nsCOMPtr<nsILineIterator> it;
|
||||
result = aBlockFrame->QueryInterface(NS_GET_IID(nsILineIterator),getter_AddRefs(it));
|
||||
nsCOMPtr<nsILineIteratorNavigator> it;
|
||||
result = aBlockFrame->QueryInterface(NS_GET_IID(nsILineIteratorNavigator),getter_AddRefs(it));
|
||||
if (NS_FAILED(result) || !it)
|
||||
return result;
|
||||
PRInt32 searchingLine = aLineStart;
|
||||
@ -2351,9 +2351,9 @@ nsFrame::GetNextPrevLineFromeBlockFrame(nsIPresContext* aPresContext,
|
||||
|
||||
if (NS_SUCCEEDED(result) && resultFrame)
|
||||
{
|
||||
nsCOMPtr<nsILineIterator> newIt;
|
||||
nsCOMPtr<nsILineIteratorNavigator> newIt;
|
||||
//check to see if this is ANOTHER blockframe inside the other one if so then call into its lines
|
||||
result = resultFrame->QueryInterface(NS_GET_IID(nsILineIterator),getter_AddRefs(newIt));
|
||||
result = resultFrame->QueryInterface(NS_GET_IID(nsILineIteratorNavigator),getter_AddRefs(newIt));
|
||||
if (NS_SUCCEEDED(result) && newIt)
|
||||
{
|
||||
aPos->mResultFrame = resultFrame;
|
||||
@ -2538,7 +2538,7 @@ nsFrame::PeekOffset(nsIPresContext* aPresContext, nsPeekOffsetStruct *aPos)
|
||||
}break;
|
||||
case eSelectLine :
|
||||
{
|
||||
nsCOMPtr<nsILineIterator> it;
|
||||
nsCOMPtr<nsILineIteratorNavigator> it;
|
||||
nsIFrame *blockFrame = this;
|
||||
nsIFrame *thisBlock = this;
|
||||
PRInt32 thisLine;
|
||||
@ -2548,13 +2548,13 @@ nsFrame::PeekOffset(nsIPresContext* aPresContext, nsPeekOffsetStruct *aPos)
|
||||
result = blockFrame->GetParent(&blockFrame);
|
||||
if (NS_FAILED(result) || !blockFrame) //if at line 0 then nothing to do
|
||||
return result;
|
||||
result = blockFrame->QueryInterface(NS_GET_IID(nsILineIterator),getter_AddRefs(it));
|
||||
result = blockFrame->QueryInterface(NS_GET_IID(nsILineIteratorNavigator),getter_AddRefs(it));
|
||||
while (NS_FAILED(result) && blockFrame)
|
||||
{
|
||||
thisBlock = blockFrame;
|
||||
result = blockFrame->GetParent(&blockFrame);
|
||||
if (NS_SUCCEEDED(result) && blockFrame){
|
||||
result = blockFrame->QueryInterface(NS_GET_IID(nsILineIterator),getter_AddRefs(it));
|
||||
result = blockFrame->QueryInterface(NS_GET_IID(nsILineIteratorNavigator),getter_AddRefs(it));
|
||||
}
|
||||
}
|
||||
//this block is now one child down from blockframe
|
||||
@ -2586,7 +2586,7 @@ nsFrame::PeekOffset(nsIPresContext* aPresContext, nsPeekOffsetStruct *aPos)
|
||||
else
|
||||
doneLooping = PR_TRUE; //do not continue with while loop
|
||||
if (NS_SUCCEEDED(result) && aPos->mResultFrame){
|
||||
result = aPos->mResultFrame->QueryInterface(NS_GET_IID(nsILineIterator),getter_AddRefs(it));
|
||||
result = aPos->mResultFrame->QueryInterface(NS_GET_IID(nsILineIteratorNavigator),getter_AddRefs(it));
|
||||
if (NS_SUCCEEDED(result) && it)//we have struck another block element!
|
||||
{
|
||||
doneLooping = PR_FALSE;
|
||||
@ -2610,20 +2610,20 @@ nsFrame::PeekOffset(nsIPresContext* aPresContext, nsPeekOffsetStruct *aPos)
|
||||
case eSelectBeginLine:
|
||||
case eSelectEndLine:
|
||||
{
|
||||
nsCOMPtr<nsILineIterator> it;
|
||||
nsCOMPtr<nsILineIteratorNavigator> it;
|
||||
nsIFrame *blockFrame = this;
|
||||
nsIFrame *thisBlock = this;
|
||||
PRInt32 thisLine;
|
||||
result = blockFrame->GetParent(&blockFrame);
|
||||
if (NS_FAILED(result) || !blockFrame) //if at line 0 then nothing to do
|
||||
return result;
|
||||
result = blockFrame->QueryInterface(NS_GET_IID(nsILineIterator),getter_AddRefs(it));
|
||||
result = blockFrame->QueryInterface(NS_GET_IID(nsILineIteratorNavigator),getter_AddRefs(it));
|
||||
while (NS_FAILED(result) && blockFrame)
|
||||
{
|
||||
thisBlock = blockFrame;
|
||||
result = blockFrame->GetParent(&blockFrame);
|
||||
if (NS_SUCCEEDED(result) && blockFrame){
|
||||
result = blockFrame->QueryInterface(NS_GET_IID(nsILineIterator),getter_AddRefs(it));
|
||||
result = blockFrame->QueryInterface(NS_GET_IID(nsILineIteratorNavigator),getter_AddRefs(it));
|
||||
}
|
||||
}
|
||||
//this block is now one child down from blockframe
|
||||
@ -2710,14 +2710,14 @@ nsFrame::GetLineNumber(nsIFrame *aFrame)
|
||||
nsIFrame *blockFrame = aFrame;
|
||||
nsIFrame *thisBlock;
|
||||
PRInt32 thisLine;
|
||||
nsCOMPtr<nsILineIterator> it;
|
||||
nsCOMPtr<nsILineIteratorNavigator> it;
|
||||
nsresult result = NS_ERROR_FAILURE;
|
||||
while (NS_FAILED(result) && blockFrame)
|
||||
{
|
||||
thisBlock = blockFrame;
|
||||
result = blockFrame->GetParent(&blockFrame);
|
||||
if (NS_SUCCEEDED(result) && blockFrame){
|
||||
result = blockFrame->QueryInterface(NS_GET_IID(nsILineIterator),getter_AddRefs(it));
|
||||
result = blockFrame->QueryInterface(NS_GET_IID(nsILineIteratorNavigator),getter_AddRefs(it));
|
||||
}
|
||||
else
|
||||
blockFrame = nsnull;
|
||||
@ -2740,14 +2740,14 @@ nsFrame::GetFrameFromDirection(nsIPresContext* aPresContext, nsPeekOffsetStruct
|
||||
nsIFrame *blockFrame = this;
|
||||
nsIFrame *thisBlock;
|
||||
PRInt32 thisLine;
|
||||
nsCOMPtr<nsILineIterator> it;
|
||||
nsCOMPtr<nsILineIteratorNavigator> it;
|
||||
nsresult result = NS_ERROR_FAILURE;
|
||||
while (NS_FAILED(result) && blockFrame)
|
||||
{
|
||||
thisBlock = blockFrame;
|
||||
result = blockFrame->GetParent(&blockFrame);
|
||||
if (NS_SUCCEEDED(result) && blockFrame){
|
||||
result = blockFrame->QueryInterface(NS_GET_IID(nsILineIterator),getter_AddRefs(it));
|
||||
result = blockFrame->QueryInterface(NS_GET_IID(nsILineIteratorNavigator),getter_AddRefs(it));
|
||||
}
|
||||
else
|
||||
blockFrame = nsnull;
|
||||
|
@ -28,6 +28,10 @@
|
||||
#define NS_ILINE_ITERATOR_IID \
|
||||
{ 0xa6cf90ff, 0x15b3, 0x11d2,{0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32}}
|
||||
|
||||
/* {80AA3D7A-E0BF-4e18-8A82-2110397D7BC4}*/
|
||||
#define NS_ILINE_ITERATOR_NAV_IID \
|
||||
{ 0x80aa3d7a, 0xe0bf, 0x4e18,{0x8a, 0x82, 0x21, 0x10, 0x39, 0x7d, 0x7b, 0xc4}}
|
||||
|
||||
// Line iterator API.
|
||||
//
|
||||
// Lines are numbered from 0 to N, where 0 is the top line and N is
|
||||
@ -114,4 +118,10 @@ public:
|
||||
NS_IMETHOD GetNextSibling(nsIFrame*& aFrame, PRInt32 aLineNumber) = 0;
|
||||
};
|
||||
|
||||
//special line iterator for keyboard navigation
|
||||
class nsILineIteratorNavigator : public nsILineIterator {
|
||||
public:
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(NS_ILINE_ITERATOR_NAV_IID)
|
||||
|
||||
};
|
||||
#endif /* nsILineIterator_h___ */
|
||||
|
@ -516,7 +516,7 @@ nsLineIterator::~nsLineIterator()
|
||||
}
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS(nsLineIterator, kILineIteratorIID)
|
||||
NS_IMPL_ISUPPORTS2(nsLineIterator, nsILineIterator, nsILineIteratorNavigator)
|
||||
|
||||
nsresult
|
||||
nsLineIterator::Init(nsLineBox* aLines, PRBool aRightToLeft)
|
||||
|
@ -371,7 +371,7 @@ protected:
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
class nsLineIterator : public nsILineIterator {
|
||||
class nsLineIterator : public nsILineIteratorNavigator {
|
||||
public:
|
||||
nsLineIterator();
|
||||
virtual ~nsLineIterator();
|
||||
|
@ -20,7 +20,6 @@
|
||||
* Contributor(s):
|
||||
* Steve Clark <buster@netscape.com>
|
||||
* Robert O'Callahan <roc+moz@cs.cmu.edu>
|
||||
* Pierre Phaneuf <pp@ludusdesign.com>
|
||||
*/
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsBlockFrame.h"
|
||||
@ -1206,7 +1205,8 @@ nsBlockFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
|
||||
*aInstancePtr = (void*) tmp;
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(NS_GET_IID(nsILineIterator))) {
|
||||
if ( aIID.Equals(NS_GET_IID(nsILineIterator)) || aIID.Equals(NS_GET_IID(nsILineIteratorNavigator)) )
|
||||
{
|
||||
nsLineIterator* it = new nsLineIterator;
|
||||
if (!it) {
|
||||
*aInstancePtr = nsnull;
|
||||
@ -1220,7 +1220,8 @@ nsBlockFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
|
||||
delete it;
|
||||
return rv;
|
||||
}
|
||||
return it->QueryInterface(aIID, aInstancePtr);
|
||||
NS_ADDREF((nsILineIterator *) (*aInstancePtr = (void *) it));
|
||||
return NS_OK;
|
||||
}
|
||||
return nsBlockFrameSuper::QueryInterface(aIID, aInstancePtr);
|
||||
}
|
||||
|
@ -20,7 +20,6 @@
|
||||
* Contributor(s):
|
||||
* Steve Clark <buster@netscape.com>
|
||||
* Robert O'Callahan <roc+moz@cs.cmu.edu>
|
||||
* Pierre Phaneuf <pp@ludusdesign.com>
|
||||
*/
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsBlockFrame.h"
|
||||
@ -1206,7 +1205,8 @@ nsBlockFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
|
||||
*aInstancePtr = (void*) tmp;
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(NS_GET_IID(nsILineIterator))) {
|
||||
if ( aIID.Equals(NS_GET_IID(nsILineIterator)) || aIID.Equals(NS_GET_IID(nsILineIteratorNavigator)) )
|
||||
{
|
||||
nsLineIterator* it = new nsLineIterator;
|
||||
if (!it) {
|
||||
*aInstancePtr = nsnull;
|
||||
@ -1220,7 +1220,8 @@ nsBlockFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
|
||||
delete it;
|
||||
return rv;
|
||||
}
|
||||
return it->QueryInterface(aIID, aInstancePtr);
|
||||
NS_ADDREF((nsILineIterator *) (*aInstancePtr = (void *) it));
|
||||
return NS_OK;
|
||||
}
|
||||
return nsBlockFrameSuper::QueryInterface(aIID, aInstancePtr);
|
||||
}
|
||||
|
@ -20,7 +20,6 @@
|
||||
* Contributor(s):
|
||||
* Steve Clark <buster@netscape.com>
|
||||
* Robert O'Callahan <roc+moz@cs.cmu.edu>
|
||||
* Pierre Phaneuf <pp@ludusdesign.com>
|
||||
*/
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsBlockFrame.h"
|
||||
@ -1206,7 +1205,8 @@ nsBlockFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
|
||||
*aInstancePtr = (void*) tmp;
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(NS_GET_IID(nsILineIterator))) {
|
||||
if ( aIID.Equals(NS_GET_IID(nsILineIterator)) || aIID.Equals(NS_GET_IID(nsILineIteratorNavigator)) )
|
||||
{
|
||||
nsLineIterator* it = new nsLineIterator;
|
||||
if (!it) {
|
||||
*aInstancePtr = nsnull;
|
||||
@ -1220,7 +1220,8 @@ nsBlockFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
|
||||
delete it;
|
||||
return rv;
|
||||
}
|
||||
return it->QueryInterface(aIID, aInstancePtr);
|
||||
NS_ADDREF((nsILineIterator *) (*aInstancePtr = (void *) it));
|
||||
return NS_OK;
|
||||
}
|
||||
return nsBlockFrameSuper::QueryInterface(aIID, aInstancePtr);
|
||||
}
|
||||
|
@ -2277,8 +2277,8 @@ nsFrame::GetNextPrevLineFromeBlockFrame(nsIPresContext* aPresContext,
|
||||
aPos->mPreferLeft = (aPos->mDirection == eDirNext);
|
||||
|
||||
nsresult result;
|
||||
nsCOMPtr<nsILineIterator> it;
|
||||
result = aBlockFrame->QueryInterface(NS_GET_IID(nsILineIterator),getter_AddRefs(it));
|
||||
nsCOMPtr<nsILineIteratorNavigator> it;
|
||||
result = aBlockFrame->QueryInterface(NS_GET_IID(nsILineIteratorNavigator),getter_AddRefs(it));
|
||||
if (NS_FAILED(result) || !it)
|
||||
return result;
|
||||
PRInt32 searchingLine = aLineStart;
|
||||
@ -2351,9 +2351,9 @@ nsFrame::GetNextPrevLineFromeBlockFrame(nsIPresContext* aPresContext,
|
||||
|
||||
if (NS_SUCCEEDED(result) && resultFrame)
|
||||
{
|
||||
nsCOMPtr<nsILineIterator> newIt;
|
||||
nsCOMPtr<nsILineIteratorNavigator> newIt;
|
||||
//check to see if this is ANOTHER blockframe inside the other one if so then call into its lines
|
||||
result = resultFrame->QueryInterface(NS_GET_IID(nsILineIterator),getter_AddRefs(newIt));
|
||||
result = resultFrame->QueryInterface(NS_GET_IID(nsILineIteratorNavigator),getter_AddRefs(newIt));
|
||||
if (NS_SUCCEEDED(result) && newIt)
|
||||
{
|
||||
aPos->mResultFrame = resultFrame;
|
||||
@ -2538,7 +2538,7 @@ nsFrame::PeekOffset(nsIPresContext* aPresContext, nsPeekOffsetStruct *aPos)
|
||||
}break;
|
||||
case eSelectLine :
|
||||
{
|
||||
nsCOMPtr<nsILineIterator> it;
|
||||
nsCOMPtr<nsILineIteratorNavigator> it;
|
||||
nsIFrame *blockFrame = this;
|
||||
nsIFrame *thisBlock = this;
|
||||
PRInt32 thisLine;
|
||||
@ -2548,13 +2548,13 @@ nsFrame::PeekOffset(nsIPresContext* aPresContext, nsPeekOffsetStruct *aPos)
|
||||
result = blockFrame->GetParent(&blockFrame);
|
||||
if (NS_FAILED(result) || !blockFrame) //if at line 0 then nothing to do
|
||||
return result;
|
||||
result = blockFrame->QueryInterface(NS_GET_IID(nsILineIterator),getter_AddRefs(it));
|
||||
result = blockFrame->QueryInterface(NS_GET_IID(nsILineIteratorNavigator),getter_AddRefs(it));
|
||||
while (NS_FAILED(result) && blockFrame)
|
||||
{
|
||||
thisBlock = blockFrame;
|
||||
result = blockFrame->GetParent(&blockFrame);
|
||||
if (NS_SUCCEEDED(result) && blockFrame){
|
||||
result = blockFrame->QueryInterface(NS_GET_IID(nsILineIterator),getter_AddRefs(it));
|
||||
result = blockFrame->QueryInterface(NS_GET_IID(nsILineIteratorNavigator),getter_AddRefs(it));
|
||||
}
|
||||
}
|
||||
//this block is now one child down from blockframe
|
||||
@ -2586,7 +2586,7 @@ nsFrame::PeekOffset(nsIPresContext* aPresContext, nsPeekOffsetStruct *aPos)
|
||||
else
|
||||
doneLooping = PR_TRUE; //do not continue with while loop
|
||||
if (NS_SUCCEEDED(result) && aPos->mResultFrame){
|
||||
result = aPos->mResultFrame->QueryInterface(NS_GET_IID(nsILineIterator),getter_AddRefs(it));
|
||||
result = aPos->mResultFrame->QueryInterface(NS_GET_IID(nsILineIteratorNavigator),getter_AddRefs(it));
|
||||
if (NS_SUCCEEDED(result) && it)//we have struck another block element!
|
||||
{
|
||||
doneLooping = PR_FALSE;
|
||||
@ -2610,20 +2610,20 @@ nsFrame::PeekOffset(nsIPresContext* aPresContext, nsPeekOffsetStruct *aPos)
|
||||
case eSelectBeginLine:
|
||||
case eSelectEndLine:
|
||||
{
|
||||
nsCOMPtr<nsILineIterator> it;
|
||||
nsCOMPtr<nsILineIteratorNavigator> it;
|
||||
nsIFrame *blockFrame = this;
|
||||
nsIFrame *thisBlock = this;
|
||||
PRInt32 thisLine;
|
||||
result = blockFrame->GetParent(&blockFrame);
|
||||
if (NS_FAILED(result) || !blockFrame) //if at line 0 then nothing to do
|
||||
return result;
|
||||
result = blockFrame->QueryInterface(NS_GET_IID(nsILineIterator),getter_AddRefs(it));
|
||||
result = blockFrame->QueryInterface(NS_GET_IID(nsILineIteratorNavigator),getter_AddRefs(it));
|
||||
while (NS_FAILED(result) && blockFrame)
|
||||
{
|
||||
thisBlock = blockFrame;
|
||||
result = blockFrame->GetParent(&blockFrame);
|
||||
if (NS_SUCCEEDED(result) && blockFrame){
|
||||
result = blockFrame->QueryInterface(NS_GET_IID(nsILineIterator),getter_AddRefs(it));
|
||||
result = blockFrame->QueryInterface(NS_GET_IID(nsILineIteratorNavigator),getter_AddRefs(it));
|
||||
}
|
||||
}
|
||||
//this block is now one child down from blockframe
|
||||
@ -2710,14 +2710,14 @@ nsFrame::GetLineNumber(nsIFrame *aFrame)
|
||||
nsIFrame *blockFrame = aFrame;
|
||||
nsIFrame *thisBlock;
|
||||
PRInt32 thisLine;
|
||||
nsCOMPtr<nsILineIterator> it;
|
||||
nsCOMPtr<nsILineIteratorNavigator> it;
|
||||
nsresult result = NS_ERROR_FAILURE;
|
||||
while (NS_FAILED(result) && blockFrame)
|
||||
{
|
||||
thisBlock = blockFrame;
|
||||
result = blockFrame->GetParent(&blockFrame);
|
||||
if (NS_SUCCEEDED(result) && blockFrame){
|
||||
result = blockFrame->QueryInterface(NS_GET_IID(nsILineIterator),getter_AddRefs(it));
|
||||
result = blockFrame->QueryInterface(NS_GET_IID(nsILineIteratorNavigator),getter_AddRefs(it));
|
||||
}
|
||||
else
|
||||
blockFrame = nsnull;
|
||||
@ -2740,14 +2740,14 @@ nsFrame::GetFrameFromDirection(nsIPresContext* aPresContext, nsPeekOffsetStruct
|
||||
nsIFrame *blockFrame = this;
|
||||
nsIFrame *thisBlock;
|
||||
PRInt32 thisLine;
|
||||
nsCOMPtr<nsILineIterator> it;
|
||||
nsCOMPtr<nsILineIteratorNavigator> it;
|
||||
nsresult result = NS_ERROR_FAILURE;
|
||||
while (NS_FAILED(result) && blockFrame)
|
||||
{
|
||||
thisBlock = blockFrame;
|
||||
result = blockFrame->GetParent(&blockFrame);
|
||||
if (NS_SUCCEEDED(result) && blockFrame){
|
||||
result = blockFrame->QueryInterface(NS_GET_IID(nsILineIterator),getter_AddRefs(it));
|
||||
result = blockFrame->QueryInterface(NS_GET_IID(nsILineIteratorNavigator),getter_AddRefs(it));
|
||||
}
|
||||
else
|
||||
blockFrame = nsnull;
|
||||
|
@ -28,6 +28,10 @@
|
||||
#define NS_ILINE_ITERATOR_IID \
|
||||
{ 0xa6cf90ff, 0x15b3, 0x11d2,{0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32}}
|
||||
|
||||
/* {80AA3D7A-E0BF-4e18-8A82-2110397D7BC4}*/
|
||||
#define NS_ILINE_ITERATOR_NAV_IID \
|
||||
{ 0x80aa3d7a, 0xe0bf, 0x4e18,{0x8a, 0x82, 0x21, 0x10, 0x39, 0x7d, 0x7b, 0xc4}}
|
||||
|
||||
// Line iterator API.
|
||||
//
|
||||
// Lines are numbered from 0 to N, where 0 is the top line and N is
|
||||
@ -114,4 +118,10 @@ public:
|
||||
NS_IMETHOD GetNextSibling(nsIFrame*& aFrame, PRInt32 aLineNumber) = 0;
|
||||
};
|
||||
|
||||
//special line iterator for keyboard navigation
|
||||
class nsILineIteratorNavigator : public nsILineIterator {
|
||||
public:
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(NS_ILINE_ITERATOR_NAV_IID)
|
||||
|
||||
};
|
||||
#endif /* nsILineIterator_h___ */
|
||||
|
@ -516,7 +516,7 @@ nsLineIterator::~nsLineIterator()
|
||||
}
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS(nsLineIterator, kILineIteratorIID)
|
||||
NS_IMPL_ISUPPORTS2(nsLineIterator, nsILineIterator, nsILineIteratorNavigator)
|
||||
|
||||
nsresult
|
||||
nsLineIterator::Init(nsLineBox* aLines, PRBool aRightToLeft)
|
||||
|
@ -371,7 +371,7 @@ protected:
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
class nsLineIterator : public nsILineIterator {
|
||||
class nsLineIterator : public nsILineIteratorNavigator {
|
||||
public:
|
||||
nsLineIterator();
|
||||
virtual ~nsLineIterator();
|
||||
|
@ -65,9 +65,9 @@ nsTableRowGroupFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
|
||||
*aInstancePtr = (void*)this;
|
||||
return NS_OK;
|
||||
}
|
||||
else if (aIID.Equals(NS_GET_IID(nsILineIterator)))
|
||||
else if (aIID.Equals(NS_GET_IID(nsILineIteratorNavigator)))
|
||||
{ // note there is no addref here, frames are not addref'd
|
||||
*aInstancePtr = (void*)(nsILineIterator*)this;
|
||||
*aInstancePtr = (void*)(nsILineIteratorNavigator*)this;
|
||||
return NS_OK;
|
||||
}
|
||||
else {
|
||||
|
@ -83,7 +83,7 @@ struct RowGroupReflowState {
|
||||
* @see nsTableFrame
|
||||
* @see nsTableRowFrame
|
||||
*/
|
||||
class nsTableRowGroupFrame : public nsHTMLContainerFrame, public nsILineIterator
|
||||
class nsTableRowGroupFrame : public nsHTMLContainerFrame, public nsILineIteratorNavigator
|
||||
{
|
||||
public:
|
||||
// nsISupports
|
||||
|
@ -65,9 +65,9 @@ nsTableRowGroupFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
|
||||
*aInstancePtr = (void*)this;
|
||||
return NS_OK;
|
||||
}
|
||||
else if (aIID.Equals(NS_GET_IID(nsILineIterator)))
|
||||
else if (aIID.Equals(NS_GET_IID(nsILineIteratorNavigator)))
|
||||
{ // note there is no addref here, frames are not addref'd
|
||||
*aInstancePtr = (void*)(nsILineIterator*)this;
|
||||
*aInstancePtr = (void*)(nsILineIteratorNavigator*)this;
|
||||
return NS_OK;
|
||||
}
|
||||
else {
|
||||
|
@ -83,7 +83,7 @@ struct RowGroupReflowState {
|
||||
* @see nsTableFrame
|
||||
* @see nsTableRowFrame
|
||||
*/
|
||||
class nsTableRowGroupFrame : public nsHTMLContainerFrame, public nsILineIterator
|
||||
class nsTableRowGroupFrame : public nsHTMLContainerFrame, public nsILineIteratorNavigator
|
||||
{
|
||||
public:
|
||||
// nsISupports
|
||||
|
Loading…
Reference in New Issue
Block a user