parentNode->addAttribute(L"acrobat::stdname", stdName);\r
if (wcscmp(stdName, L"Span") == 0 || wcscmp(stdName, L"Link") == 0 || wcscmp(stdName, L"Quote") == 0) {\r
// This is an inline element.\r
- parentNode->setIsBlock(false);\r
+ parentNode->isBlock=false;\r
}\r
}\r
\r
// No children, so this is a leaf node.\r
if (!this->isXFA && !stdName) {\r
// Non-XFA leaf nodes with no stdName are inline.\r
- parentNode->setIsBlock(false);\r
+ parentNode->isBlock=false;\r
}\r
\r
// Get the name.\r
// Always render a space for empty table cells.\r
previousNode=buffer->addTextFieldNode(parentNode,previousNode,L" ");\r
addAttrsToTextNode(previousNode);\r
- parentNode->setIsBlock(false);\r
+ parentNode->isBlock=false;\r
} else if (role == ROLE_SYSTEM_TABLE) {\r
nhAssert(tableInfo);\r
for (list<pair<AdobeAcrobatVBufStorage_controlFieldNode_t*, wstring>>::iterator it = tableInfo->nodesWithExplicitHeaders.begin(); it != tableInfo->nodesWithExplicitHeaders.end(); ++it)\r
} else {\r
isBlockElement=FALSE;\r
}\r
- parentNode->setIsBlock(isBlockElement);\r
+ parentNode->isBlock=isBlockElement;\r
\r
BSTR name=NULL;\r
if(pacc->get_accName(varChild,&name)!=S_OK)\r
// Always render a space for empty table cells and unknowns.\r
previousNode=buffer->addTextFieldNode(parentNode,previousNode,L" ");\r
if(previousNode&&!locale.empty()) previousNode->addAttribute(L"language",locale);\r
- parentNode->setIsBlock(false);\r
+ parentNode->isBlock=false;\r
}\r
\r
if ((isInteractive || role == ROLE_SYSTEM_SEPARATOR) && parentNode->getLength() == 0) {\r
tempStringStream<<ID;\r
attribsMap[L"table-id"]=tempStringStream.str();\r
} else if(tableInfo&&(nodeName.compare(L"THEAD")==0||nodeName.compare(L"TBODY")==0||nodeName.compare(L"TFOOT")==0)) {\r
- parentNode->setUpdateAncestor(tableInfo->tableNode);\r
+ parentNode->updateAncestor=tableInfo->tableNode;\r
} else if(tableInfo&&nodeName.compare(L"TR")==0) {\r
++tableInfo->curRowNumber;\r
tableInfo->curColumnNumber = 0;\r
- parentNode->setUpdateAncestor(tableInfo->tableNode);\r
+ parentNode->updateAncestor=tableInfo->tableNode;\r
} if(tableInfo&&(nodeName.compare(L"TD")==0||nodeName.compare(L"TH")==0)) {\r
++tableInfo->curColumnNumber;\r
- parentNode->setUpdateAncestor(tableInfo->tableNode);\r
+ parentNode->updateAncestor=tableInfo->tableNode;\r
handleColsSpannedByPrevRows(*tableInfo);\r
tempStringStream.str(L"");\r
tempStringStream<<tableInfo->tableID;\r
\r
//Handle text nodes\r
if(!shouldSkipText) { \r
- wstring s=getTextFromHTMLDOMNode(pHTMLDOMNode,allowPreformattedText,(parentNode&&parentNode->getIsBlock()&&!previousNode));\r
+ wstring s=getTextFromHTMLDOMNode(pHTMLDOMNode,allowPreformattedText,(parentNode&&parentNode->isBlock&&!previousNode));\r
if(!s.empty()) {\r
LOG_DEBUG(L"Got text from node");\r
VBufStorage_textFieldNode_t* textNode=buffer->addTextFieldNode(parentNode,previousNode,s);\r
nhAssert(parentNode);\r
previousNode=NULL;\r
\r
- parentNode->setIsHidden(hidden||dontRender);\r
+ parentNode->isHidden=(hidden||dontRender);\r
//We do not want to render any content for dontRender nodes\r
if(dontRender) {\r
return parentNode;\r
}\r
\r
//Update block setting on node\r
- parentNode->setIsBlock(isBlock);\r
+ parentNode->isBlock=isBlock;\r
\r
//Add all the collected attributes to the node\r
for(tempIter=attribsMap.begin();tempIter!=attribsMap.end();++tempIter) {\r
}\r
\r
bool VBufBackend_t::invalidateSubtree(VBufStorage_controlFieldNode_t* node) {\r
- VBufStorage_controlFieldNode_t* updateAncestor=node->getUpdateAncestor();\r
- if(updateAncestor) node=updateAncestor;\r
+ if(node->updateAncestor) node=node->updateAncestor;\r
if(!isNodeInBuffer(node)) {\r
LOG_DEBUGWARNING(L"Node at "<<node<<L" not in buffer at "<<this);\r
return false;\r
LOG_DEBUG(L"fieldNode being destroied");\r
}\r
\r
-VBufStorage_controlFieldNode_t* VBufStorage_fieldNode_t::getParent() {\r
- LOG_DEBUG(L"parent at "<<parent);\r
- return parent;\r
-}\r
-\r
-VBufStorage_controlFieldNode_t* VBufStorage_fieldNode_t::getUpdateAncestor() {\r
- LOG_DEBUG(L"updateAncestor at "<<updateAncestor);\r
- return updateAncestor;\r
-}\r
-\r
-VBufStorage_fieldNode_t* VBufStorage_fieldNode_t::getPrevious() {\r
- LOG_DEBUG(L"previous at "<<previous);\r
- return previous;\r
-}\r
-\r
-VBufStorage_fieldNode_t* VBufStorage_fieldNode_t::getNext() {\r
- LOG_DEBUG(L"next at "<<next);\r
- return next;\r
-}\r
-\r
-VBufStorage_fieldNode_t* VBufStorage_fieldNode_t::getFirstChild() {\r
- LOG_DEBUG(L"first child at "<<firstChild);\r
- return firstChild;\r
-}\r
-\r
-VBufStorage_fieldNode_t* VBufStorage_fieldNode_t::getLastChild() {\r
- LOG_DEBUG(L"last child at "<<lastChild);\r
- return lastChild;\r
-}\r
-\r
bool VBufStorage_fieldNode_t::addAttribute(const std::wstring& name, const std::wstring& value) {\r
LOG_DEBUG(L"Adding attribute "<<name<<L" with value "<<value);\r
this->attributes[name]=value;\r
return s.str();\r
}\r
\r
-void VBufStorage_fieldNode_t::setIsBlock(bool isBlock) {\r
- this->isBlock=isBlock;\r
-}\r
-\r
-void VBufStorage_fieldNode_t::setIsHidden(bool isHidden) {\r
- this->isHidden=isHidden;\r
-}\r
-\r
-void VBufStorage_fieldNode_t::setUpdateAncestor(VBufStorage_controlFieldNode_t* node) {\r
- this->updateAncestor=node;\r
-}\r
-\r
-int VBufStorage_fieldNode_t::getLength() {\r
- return this->length;\r
- }\r
-\r
//controlFieldNode implementation\r
\r
void VBufStorage_controlFieldNode_t::generateMarkupTagName(std::wstring& text) {\r
int length;\r
\r
/**\r
- * true if this field should cause a line break at its start and end when a buffer is calculating lines.\r
- */\r
- bool isBlock;\r
-\r
- /**\r
- * True if this node his hidden - searches will not locate this node.\r
- */\r
- bool isHidden;\r
-\r
-/**\r
- * points to an optional ancestor node which should be re-rendered instead of this node, if this node changes.\r
- */\r
- VBufStorage_controlFieldNode_t* updateAncestor;\r
-\r
- /**\r
* a map to hold attributes for this field.\r
*/\r
VBufStorage_attributeMap_t attributes;\r
public:\r
\r
/**\r
+ * true if this field should cause a line break at its start and end when a buffer is calculating lines.\r
+ */\r
+ bool isBlock;\r
+\r
+ /**\r
+ * True if this node his hidden - searches will not locate this node.\r
+ */\r
+ bool isHidden;\r
+\r
+/**\r
+ * points to an optional ancestor node which should be re-rendered instead of this node, if this node changes.\r
+ */\r
+ VBufStorage_controlFieldNode_t* updateAncestor;\r
+\r
+/**\r
* points to this node's parent control field node.\r
* it is garenteed that this node will be one of the parent's children (firstChild [next next...] or lastChild [previous previous...]).\r
*/\r
- VBufStorage_controlFieldNode_t* getParent();\r
+ inline VBufStorage_controlFieldNode_t* getParent() { return this->parent; }\r
\r
/**\r
* points to the node directly before this node that shares the same parent as this node. \r
*/\r
- VBufStorage_fieldNode_t* getPrevious();\r
+ inline VBufStorage_fieldNode_t* getPrevious() { return this->previous; }\r
\r
/**\r
* points to the node directly after this node that shares the same parent as this node.\r
*/\r
- VBufStorage_fieldNode_t* getNext();\r
+ inline VBufStorage_fieldNode_t* getNext() { return this->next; }\r
+\r
\r
/**\r
* points to this node's first child. \r
* The child will have no previous node, and it will have this node as its parent.\r
*/\r
- VBufStorage_fieldNode_t* getFirstChild();\r
+ inline VBufStorage_fieldNode_t* getFirstChild() { return this->firstChild; }\r
\r
/**\r
* points to this node's last child.\r
* the child will have no next node, and it will have this node as its parent.\r
*/\r
- VBufStorage_fieldNode_t* getLastChild();\r
+ inline VBufStorage_fieldNode_t* getLastChild() { return this->lastChild; }\r
\r
/**\r
* Adds an attribute to this field.\r
virtual std::wstring getDebugInfo() const;\r
\r
/**\r
- * Set whether this field is a block element.\r
- * If this is true, this field should cause a line break at its start and end when a buffer is calculating lines.\r
- * @param isBlock true if this field is a block element, false otherwise.\r
- */\r
- void setIsBlock(bool isBlock);\r
-\r
-/**\r
- * Set whether this field is a hidden node.\r
- * If this is true, this field should not be found when searching by attributes.\r
- * @param isBlock true if this field is a hidden element, false otherwise.\r
- */\r
- void setIsHidden(bool isHidden);\r
-\r
-/**\r
- * points to an optional ancestor node which should be re-rendered instead of this node, if this node changes.\r
- */\r
- VBufStorage_controlFieldNode_t* getUpdateAncestor();\r
-\r
-/**\r
- * points to an optional ancestor node which should be re-rendered instead of this node, if this node changes.\r
- */\r
- void setUpdateAncestor(VBufStorage_controlFieldNode_t* updateAncestor);\r
-\r
-/**\r
- * Getter for isBlock\r
- */\r
- bool getIsBlock() {\r
- return isBlock;\r
- }\r
-\r
-/**\r
* Retreave the length of this node.\r
*/\r
- int getLength();\r
+ inline int getLength() { return this->length; }\r
\r
};\r
\r