/************************************************************************ SetZoomDefPos sets the default starting position of the zoom window. ************************************************************************/ void SetZoomDefPos(int xPos, int yPos) { HWND hOwner; int borderH, borderW; RECT rArea, rWindow; POINT pt; hOwner = GetZoomOwner(hZoomWindow); if (!IsDoc(hOwner)) return; //if (!IsWindowVisible(hOwner)) // return; GetWindowRect(hZoomWindow, &rWindow); GetClientRect(hZoomWindow, &rArea); pt.x = rArea.left; pt.y = rArea.top; ClientToScreen(hZoomWindow, &pt); borderW = pt.x - rWindow.left; // just left border borderH = pt.y - rWindow.top; // just top border xPos -= borderW; yPos -= borderH; View.rZoomRect.right += xPos - View.rZoomRect.left; View.rZoomRect.bottom += yPos - View.rZoomRect.top; View.rZoomRect.left = xPos; View.rZoomRect.top = yPos; }
void ProxyAccessible::Shutdown() { MOZ_DIAGNOSTIC_ASSERT(!IsDoc()); NS_ASSERTION(!mOuterDoc, "Why do we still have a child doc?"); xpcAccessibleDocument* xpcDoc = GetAccService()->GetCachedXPCDocument(Document()); if (xpcDoc) { xpcDoc->NotifyOfShutdown(this); } // XXX Ideally this wouldn't be necessary, but it seems OuterDoc accessibles // can be destroyed before the doc they own. if (!mOuterDoc) { uint32_t childCount = mChildren.Length(); for (uint32_t idx = 0; idx < childCount; idx++) mChildren[idx]->Shutdown(); } else { if (mChildren.Length() != 1) MOZ_CRASH("outer doc doesn't own adoc!"); mChildren[0]->AsDoc()->Unbind(); } mChildren.Clear(); ProxyDestroyed(this); mDoc->RemoveAccessible(this); }
int TNmObjBs::AddDoc(const TStr& DocNm, const TStr& DateStr, const TIntV& NmObjIdV){ // create named-object-id to frequency table TIntIntH NmObjIdToFqH(NmObjIdV.Len()); for (int NmObjN=0; NmObjN<NmObjIdV.Len(); NmObjN++){ int NmObjId=NmObjIdV[NmObjN]; NmObjIdToFqH.AddDat(NmObjId)++; } // create document IAssert(!IsDoc(DocNm)); int DocId=DocNmToNmObjDocH.AddKey(DocNm); DocNmToNmObjDocH[DocId]=TNmObjDoc::New(); DocNmToNmObjDocH[DocId]->DateStr=DateStr; TIntPrV& NmObjIdFqPrV=GetDoc_NmObjIdFqPrV(DocId); for (int NmObjP=0; NmObjP<NmObjIdToFqH.Len(); NmObjP++){ int NmObjId=NmObjIdToFqH.GetKey(NmObjP); int Fq=NmObjIdToFqH[NmObjP]; NmObjIdFqPrV.Add(TIntPr(NmObjId, Fq)); NmObjWordStrVToDocIdVH[NmObjId].AddSorted(DocId); } NmObjIdFqPrV.Sort(); // return doc-id return DocId; }