/*---------------------------------------------------------------------------------------------- Construct the view constructor. Pass the RecordSpec of the view it is for, which allows it to find its block specs. ENHANCE JohnT: This is a rather low level object to know about the application and its list of views. Should we just pass in the list of block specs? ----------------------------------------------------------------------------------------------*/ CleCustDocVc::CleCustDocVc(UserViewSpec * puvs, AfLpInfo * plpi, CleMainWnd * pcmw) : VwCustDocVc(puvs, plpi, 0, kflidCmPossibilityList_Possibilities) { ITsStrFactoryPtr qtsf; qtsf.CreateInstance(CLSID_TsStrFactory); StrUni stu; stu.Load(kstidSpaces0); CheckHr(qtsf->MakeStringRgch(stu.Chars(), stu.Length(), m_qlpi->GetDbInfo()->UserWs(), &m_qtssMissing)); ITsPropsBldrPtr qtpb; qtpb.CreateInstance(CLSID_TsPropsBldr); // Border thickness below about 1/96 inch, a single pixel on a typical display. CheckHr(qtpb->SetIntPropValues(ktptBorderTop, ktpvMilliPoint, kdzmpInch / 96)); // About a line (say 12 point) of white space above and below the border. CheckHr(qtpb->SetIntPropValues(ktptPadTop, ktpvMilliPoint, 12000)); CheckHr(qtpb->SetIntPropValues(ktptMarginTop, ktpvMilliPoint, 12000)); CheckHr(qtpb->GetTextProps(&m_qttpMain)); CheckHr(qtpb->SetIntPropValues(ktptBorderBottom, ktpvMilliPoint, kdzmpInch / 96)); CheckHr(qtpb->SetIntPropValues(ktptPadBottom, ktpvMilliPoint, 12000)); CheckHr(qtpb->GetTextProps(&m_qttpMainLast)); qtpb.CreateInstance(CLSID_TsPropsBldr); CheckHr(qtpb->SetIntPropValues(ktptMarginTop, ktpvMilliPoint, 12000)); CheckHr(qtpb->GetTextProps(&m_qttpMainFirst)); qtpb.CreateInstance(CLSID_TsPropsBldr); // Border thickness below about 1/96 inch, a single pixel on a typical display. CheckHr(qtpb->SetIntPropValues(ktptBorderBottom, ktpvMilliPoint, kdzmpInch / 96)); CheckHr(qtpb->SetIntPropValues(ktptPadBottom, ktpvMilliPoint, 12000)); CheckHr(qtpb->SetIntPropValues(ktptMarginBottom, ktpvMilliPoint, 12000)); CheckHr(qtpb->GetTextProps(&m_qttpMainFlat)); // And make the one for subentries. qtpb.CreateInstance(CLSID_TsPropsBldr); CheckHr(qtpb->SetIntPropValues(ktptPadTop, ktpvMilliPoint, 12000)); CheckHr(qtpb->SetIntPropValues(ktptBorderTop, ktpvMilliPoint, 0)); CheckHr(qtpb->SetIntPropValues(ktptMarginBottom, ktpvMilliPoint, 0)); // The value below is sort of a default for one level of indentation; it will be // adjusted for lower levels. CheckHr(qtpb->SetIntPropValues(ktptPadLeading, ktpvMilliPoint, kdzmpInch * 3 / 10)); CheckHr(qtpb->GetTextProps(&m_qttpSub)); CheckHr(qtpb->SetIntPropValues(ktptBorderBottom, ktpvMilliPoint, kdzmpInch / 96)); CheckHr(qtpb->SetIntPropValues(ktptPadBottom, ktpvMilliPoint, 12000)); CheckHr(qtpb->GetTextProps(&m_qttpSubLast)); m_qRecVc.Attach(NewObj CleRecVc); m_qcmw.Attach(pcmw); AddRefObj(pcmw); PossListInfoPtr qpli; m_qlpi->LoadPossList(pcmw->GetHvoPssl(), pcmw->AnalysisEnc(), &qpli); m_hvoPssl = qpli->GetPsslId(); }
/*---------------------------------------------------------------------------------------------- This will return the current UndoGrouper for the AH - if one exists, otherwise returns null. ----------------------------------------------------------------------------------------------*/ STDMETHODIMP ActionHandler::get_UndoGrouper(IUndoGrouper ** ppundg) { BEGIN_COM_METHOD; ChkComOutPtr(ppundg); *ppundg = m_qundg; AddRefObj(*ppundg); END_COM_METHOD(g_factActh, IID_IActionHandler); }
/*---------------------------------------------------------------------------------------------- Get the empty string for this thread. ----------------------------------------------------------------------------------------------*/ void TextServGlobals::GetEmptyString(ITsString ** pptss) { AssertPtr(pptss); Assert(!*pptss); TextServGlobals * ptsg = GetTsGlobals(); if (!ptsg->m_qtssEmpty) { if (ptsg->m_cactActive <= 0) { Warn("Empty string requested with no active clients"); TsStrSingle::Create((OLECHAR *)NULL, 0, NULL, pptss); } TsStrSingle::Create((OLECHAR *)NULL, 0, NULL, &ptsg->m_qtssEmpty); } *pptss = ptsg->m_qtssEmpty; AddRefObj(*pptss); }