void nsCSSExpandedDataBlock::Expand(nsCSSCompressedDataBlock *aNormalBlock, nsCSSCompressedDataBlock *aImportantBlock) { NS_ABORT_IF_FALSE(aNormalBlock, "unexpected null block"); AssertInitialState(); DoExpand(aNormalBlock, false); if (aImportantBlock) { DoExpand(aImportantBlock, true); } }
// 返回值TRUE表示操作执行,否则表示已展开或已合上 BOOL WLTreeItemAL::Expand(UINT uCode) { switch (uCode) { case TE_COLLAPSE : { return DoCollapse() ; //return TRUE ; } break ; case TE_EXPAND : { return DoExpand() ; //return TRUE ; } break ; case TE_TOGGLE : { if (m_dwStatus & TIS_EXPAND) { return DoCollapse() ; } else { return DoExpand() ; } //return TRUE ; } break ; } return FALSE ; }
bool READ_TCPIP_REQUEST(CTCPIPSystemSrvr* pnode) { HEADER* hdr; char* buffer; short length; unsigned long total_length; RESET_ERRORS((long)pnode); length = pnode->m_rlength; if (pnode->do_read(true, hdr, buffer, length, READ_TIMEOUT)== false) { pnode->send_error(SRVR_ERR_READ_OPERATION,0, NULL); return false; } if (hdr->signature != SIGNATURE) return false; memcpy(&pnode->m_rhdr,hdr,sizeof(HEADER)); if (pnode->m_rhdr.compress_ind == COMP_YES && pnode->m_rhdr.compress_type != 0) total_length = hdr->cmp_length; else total_length = hdr->total_length; if(pnode->r_allocate(total_length) == NULL) { pnode->send_error(SRVR_ERR_MEMORY_ALLOCATE,0, NULL); return false; } memcpy(pnode->m_rbuffer, buffer, length); pnode->m_curptr = pnode->m_rbuffer + length; total_length -= length; while(total_length > 0) { if (pnode->do_read(false, hdr, buffer, length, READ_TIMEOUT)== false) { pnode->send_error(SRVR_ERR_READ_OPERATION,0, NULL); return false; } memcpy(pnode->m_curptr, buffer, length); pnode->m_curptr += length; total_length -= length; } if (pnode->m_rhdr.compress_ind == COMP_YES && pnode->m_rhdr.compress_type != 0) return DoExpand(pnode, pnode->m_rhdr, pnode->m_rbuffer, total_length); return true; }
LRESULT FolderTree::OnItemExpanding(int /*idCtrl*/, LPNMHDR pnmh, BOOL &bHandled) { NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pnmh; if (pNMTreeView->action == TVE_EXPAND) { bool bHasPlus = HasPlusButton(pNMTreeView->itemNew.hItem); bool bHasChildren = (GetChildItem(pNMTreeView->itemNew.hItem) != NULL); if (bHasPlus && !bHasChildren) DoExpand(pNMTreeView->itemNew.hItem); } else if(pNMTreeView->action == TVE_COLLAPSE) { FolderTreeItemInfo* pItem = (FolderTreeItemInfo*) GetItemData(pNMTreeView->itemNew.hItem); //ASSERT(pItem); //Display an hour glass as this may take some time //CWaitCursor wait; //tstring sPath = ItemToPath(pNMTreeView->itemNew.hItem); //Collapse the node and remove all the child items from it Expand(pNMTreeView->itemNew.hItem, TVE_COLLAPSE); //Never uppdate the child indicator for a network node which is not a share bool bUpdateChildIndicator = true; if (pItem->m_bNetworkNode) { if (pItem->m_pNetResource) bUpdateChildIndicator = (pItem->m_pNetResource->dwDisplayType == RESOURCEDISPLAYTYPE_SHARE); else bUpdateChildIndicator = false; } DeleteChildren(pNMTreeView->itemNew.hItem, bUpdateChildIndicator); } bHandled = FALSE; //Allow the message to be reflected again return 0; }
bool READ_TCPIP_REQUEST(CTCPIPSystemSrvr* pnode) { SRVRTRACE_ENTER(FILE_TSS+15); HEADER* hdr; HEADER swappedHdr; char* buffer; int length; unsigned long total_length; if(GTransport.m_error_list.m_list_length) RESET_ERRORS((long)pnode); length = pnode->m_rlength; if (pnode->do_read(true, hdr, buffer, length, READ_TIMEOUT)== false) { // if there is error writing to a socket, makes no sense trying to write an error response to the socket // (if there is a send error, we'll actually cleanup the tcp/ip session, so there is no pnode either) SRVRTRACE_EXIT(FILE_TSS+15); return false; } if (hdr->signature != SIGNATURE) { memcpy(&swappedHdr,hdr,sizeof(HEADER)); HEADER_swap(&swappedHdr); if(swappedHdr.signature != SIGNATURE) { pnode->send_error(SRVR_ERR_WRONG_MESSAGE_FORMAT, 0, NULL); SRVRTRACE_EXIT(FILE_TSS+15); return false; } else memcpy(&pnode->m_rhdr,&swappedHdr,sizeof(HEADER)); } else memcpy(&pnode->m_rhdr,hdr,sizeof(HEADER)); if(pnode->m_rhdr.operation_id == AS_API_GETOBJREF) { if(pnode->m_rhdr.version == CLIENT_HEADER_VERSION_LE) pnode->m_rhdr.swap = SWAP_NO; else if (pnode->m_rhdr.version == CLIENT_HEADER_VERSION_BE) pnode->m_rhdr.swap = SWAP_YES; else { // reject older clients pnode->send_error(SRVR_ERR_WRONG_MESSAGE_FORMAT, 0, NULL); SRVRTRACE_EXIT(FILE_TSS+15); return false; } pnode->m_rhdr.version = SERVER_HEADER_VERSION_LE; } hdr = &pnode->m_rhdr; if (pnode->m_rhdr.compress_ind == COMP_YES && pnode->m_rhdr.compress_type != COMP_NO_COMPRESSION) total_length = hdr->cmp_length; else total_length = hdr->total_length; if(pnode->r_allocate(total_length) == NULL) { pnode->send_error(SRVR_ERR_MEMORY_ALLOCATE,0, NULL); SRVRTRACE_EXIT(FILE_TSS+15); return false; } if (length < 0 || length > total_length) { pnode->send_error(SRVR_ERR_WRONG_MESSAGE_FORMAT,0, NULL); SRVRTRACE_EXIT(FILE_TSS+15); return false; } memcpy(pnode->m_rbuffer, buffer, length); pnode->m_curptr = pnode->m_rbuffer + length; total_length -= length; while(total_length > 0) { if (pnode->do_read(false, hdr, buffer, length, READ_TIMEOUT)== false) { // if there is error writing to a socket, makes no sense trying to write an error response to the socket // (if there is a send error, we'll actually cleanup the tcp/ip session, so there is no pnode either) SRVRTRACE_EXIT(FILE_TSS+15); return false; } if (length < 0 || length > total_length) { pnode->send_error(SRVR_ERR_WRONG_MESSAGE_FORMAT,0, NULL); SRVRTRACE_EXIT(FILE_TSS+15); return false; } memcpy(pnode->m_curptr, buffer, length); pnode->m_curptr += length; total_length -= length; } if (pnode->m_rhdr.compress_ind == COMP_YES && pnode->m_rhdr.compress_type != COMP_NO_COMPRESSION) { SRVRTRACE_EXIT(FILE_TSS+15); return DoExpand(pnode, pnode->m_rhdr, (unsigned char *)pnode->m_rbuffer, total_length); } SRVRTRACE_EXIT(FILE_TSS+15); return true; }
HTREEITEM FolderTree::SetSelectedPath(const tstring &sPath, bool bExpanded /* = false */) { tstring sSearch = sPath; sSearch = Text::toLower(sSearch); int nSearchLength = sSearch.size(); if(nSearchLength == 0) { //TRACE(_T("Cannot select a empty path\n")); return NULL; } //Remove initial part of path if the root folder is setup tstring sRootFolder = m_sRootFolder; sRootFolder = Text::toLower(sRootFolder); int nRootLength = sRootFolder.size(); if (nRootLength) { if(sSearch.find(sRootFolder) != 0) { //TRACE(_T("Could not select the path %s as the root has been configued as %s\n"), sPath, m_sRootFolder); return NULL; } sSearch = sSearch.substr(nRootLength); } //Remove trailing "\" from the path nSearchLength = sSearch.size(); if (nSearchLength > 3 && sSearch[nSearchLength-1] == _T('\\')) sSearch = sSearch.substr(0, nSearchLength-1); if (sSearch.empty()) return NULL; SetRedraw(FALSE); HTREEITEM hItemFound = TVI_ROOT; if (nRootLength && m_hRootedFolder) hItemFound = m_hRootedFolder; bool bDriveMatch = sRootFolder.empty(); bool bNetworkMatch = m_bDisplayNetwork && ((sSearch.size() > 2) && sSearch.find(_T("\\\\")) == 0); if (bNetworkMatch) { bDriveMatch = false; //Working here bool bHasPlus = HasPlusButton(m_hNetworkRoot); bool bHasChildren = (GetChildItem(m_hNetworkRoot) != NULL); if (bHasPlus && !bHasChildren) DoExpand(m_hNetworkRoot); else Expand(m_hNetworkRoot, TVE_EXPAND); hItemFound = FindServersNode(m_hNetworkRoot); sSearch = sSearch.substr(2); } if (bDriveMatch) { if (m_hMyComputerRoot) { //Working here bool bHasPlus = HasPlusButton(m_hMyComputerRoot); bool bHasChildren = (GetChildItem(m_hMyComputerRoot) != NULL); if (bHasPlus && !bHasChildren) DoExpand(m_hMyComputerRoot); else Expand(m_hMyComputerRoot, TVE_EXPAND); hItemFound = m_hMyComputerRoot; } } int nFound = sSearch.find(_T('\\')); while(nFound != tstring::npos) { tstring sMatch; if (bDriveMatch) { sMatch = sSearch.substr(0, nFound + 1); bDriveMatch = false; } else sMatch = sSearch.substr(0, nFound); hItemFound = FindSibling(hItemFound, sMatch); if (hItemFound == NULL) break; else if (!IsDrive(sPath)) { SelectItem(hItemFound); //Working here bool bHasPlus = HasPlusButton(hItemFound); bool bHasChildren = (GetChildItem(hItemFound) != NULL); if (bHasPlus && !bHasChildren) DoExpand(hItemFound); else Expand(hItemFound, TVE_EXPAND); } sSearch = sSearch.substr(nFound - 1); nFound = sSearch.find(_T('\\')); }; //The last item if (hItemFound) { if (sSearch.size()) hItemFound = FindSibling(hItemFound, sSearch); if (hItemFound) SelectItem(hItemFound); if (bExpanded) { //Working here bool bHasPlus = HasPlusButton(hItemFound); bool bHasChildren = (GetChildItem(hItemFound) != NULL); if (bHasPlus && !bHasChildren) DoExpand(hItemFound); else Expand(hItemFound, TVE_EXPAND); } } //Turn back on the redraw flag SetRedraw(TRUE); return hItemFound; }
wxString MacroManager::Expand( const wxString& expression, IManager* manager, const wxString& project, const wxString& confToBuild) { return DoExpand(expression, manager, project, true, confToBuild); }
wxString MacroManager::ExpandNoEnv(const wxString& expression, const wxString& project, const wxString& confToBuild) { return DoExpand(expression, NULL, project, false, confToBuild); }