本文整理汇总了C++中UT_GenericVector类的典型用法代码示例。如果您正苦于以下问题:C++ UT_GenericVector类的具体用法?C++ UT_GenericVector怎么用?C++ UT_GenericVector使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了UT_GenericVector类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: clearScreen
void fp_FrameContainer::setPage(fp_Page * pPage)
{
if(pPage && (m_pPage != NULL) && m_pPage != pPage)
{
clearScreen();
m_pPage->removeFrameContainer(this);
getSectionLayout()->markAllRunsDirty();
UT_GenericVector<fl_ContainerLayout *> AllLayouts;
AllLayouts.clear();
m_pPage->getAllLayouts(AllLayouts);
UT_sint32 i = 0;
for(i=0; i<AllLayouts.getItemCount(); i++)
{
fl_ContainerLayout * pCL = AllLayouts.getNthItem(i);
pCL->collapse();
pCL->format();
}
m_pPage->getOwningSection()->setNeedsSectionBreak(true,m_pPage);
}
m_pPage = pPage;
if(pPage)
{
getFillType()->setParent(pPage->getFillType());
}
else
{
getFillType()->setParent(NULL);
}
}
示例2: UT_DEBUGMSG
void TCPAccountHandler::addBuddy(BuddyPtr pBuddy)
{
UT_DEBUGMSG(("TCPAccountHandler::addBuddy()\n"));
UT_return_if_fail(pBuddy);
AbiCollabSessionManager* pManager = AbiCollabSessionManager::getManager();
UT_return_if_fail(pManager);
if (getProperty("allow-all") == "true")
{
const UT_GenericVector<AbiCollab *> pSessions = pManager->getSessions();
for (UT_sint32 i = 0; i < pSessions.size(); i++)
{
AbiCollab* pSession = pSessions.getNthItem(i);
UT_continue_if_fail(pSession);
if (pSession->getAclAccount() != this)
continue;
pSession->appendAcl(pBuddy->getDescriptor(false).utf8_str());
}
}
AccountHandler::addBuddy(pBuddy);
}
示例3: _enableUpdates
void ABI_Collab_Import::_enableUpdates(UT_GenericVector<AV_View *> vecViews, bool bIsGlob)
{
if (bIsGlob)
{
// allow updates again
m_pDoc->enableListUpdates();
m_pDoc->updateDirtyLists();
m_pDoc->setDontImmediatelyLayout(false);
m_pDoc->endUserAtomicGlob();
}
m_pDoc->notifyPieceTableChangeEnd();
bool bDone = false;
for (UT_sint32 i = 0; i<vecViews.getItemCount(); i++)
{
FV_View * pView = static_cast<FV_View *>( vecViews.getNthItem(i));
if(pView && !bDone && pView->shouldScreenUpdateOnGeneralUpdate())
{
m_pDoc->signalListeners(PD_SIGNAL_UPDATE_LAYOUT);
bDone = true;
}
if(pView)
{
pView->fixInsertionPointCoords();
pView->setActivityMask(true);
}
}
}
示例4: repopulate
bool AP_CocoaToolbar_StyleCombo::repopulate(void)
{
// repopulate the vector from the current document
// If ithere is one present
AD_Document * pAD_Doc = m_pFrame->getCurrentDoc();
if(!pAD_Doc)
{
return false;
}
// clear anything that's already there
m_vecContents.clear();
m_pDocument = static_cast<PD_Document *>(pAD_Doc);
UT_GenericVector<PD_Style*>* pStyles = NULL;
m_pDocument->enumStyles(pStyles);
UT_uint32 nStyles = pStyles->getItemCount();
for (UT_uint32 k = 0; k < nStyles; k++)
{
const PD_Style * pStyle;
pStyle = pStyles->getNthItem(k);
if(pStyle) {
m_vecContents.addItem(pStyle->getName());
}
}
DELETEP(pStyles);
return true;
}
示例5: UT_return_val_if_fail
bool XAP_App::updateClones(XAP_Frame * pFrame)
{
UT_return_val_if_fail(pFrame,false);
UT_ASSERT(pFrame->getViewNumber() > 0);
// locate vector of this frame's clones
UT_GenericVector<XAP_Frame*>* pEntry = m_hashClones.pick(pFrame->getViewKey());
UT_ASSERT_HARMLESS(pEntry);
if (pEntry)
{
UT_GenericVector<XAP_Frame*>* pvClones = pEntry;
UT_return_val_if_fail(pvClones,false);
UT_uint32 count = pvClones->getItemCount();
UT_ASSERT(count > 0);
XAP_Frame * f = NULL;
for (UT_uint32 j=0; j<count; j++)
{
f = pvClones->getNthItem(j);
UT_continue_if_fail(f);
f->updateTitle();
}
}
return true;
}
示例6: write
/**
* Write the <text:list-style> element.
*/
bool ODe_Style_List::write(GsfOutput* pODT,
const UT_UTF8String& rSpacesOffset) const {
UT_uint32 i, count;
UT_UTF8String subElementSpacesOffset;
UT_UTF8String output;
UT_GenericVector<ODe_ListLevelStyle*>* pVector;
bool ok;
UT_UTF8String_sprintf(output, "%s<text:list-style style:name=\"%s\">\n",
rSpacesOffset.utf8_str(), m_name.utf8_str());
ODe_writeUTF8String(pODT, output);
subElementSpacesOffset = rSpacesOffset;
subElementSpacesOffset += " ";
pVector = m_levelStyles.enumerate();
count = pVector->getItemCount();
for (i=0; i<count; i++) {
ok = (*pVector)[i]->write(pODT, subElementSpacesOffset);
if (!ok) {
return false;
}
}
UT_UTF8String_sprintf(output, "%s</text:list-style>\n",
rSpacesOffset.utf8_str());
ODe_writeUTF8String(pODT, output);
return true;
}
示例7: _storeStyle
/**
* Store the style in this automatic styles holder. As the specified
* style get's stored here, this class takes care of freeing its memory later, so
* you don't have to worry about freeing the memory of the stored style.
*
* The style also get's it's unique name on this method.
*
* After calling this method you may end up with your style pointer pointing to
* a different style. It happens when there is already a stored style equivalent
* to the one that you sent to be stored. The one that was passed is deleted.
*/
void ODe_AutomaticStyles::_storeStyle(ODe_Style_Style*& rpStyle,
UT_GenericStringMap<ODe_Style_Style*>& rStyles,
const char* pNamingPrefix) {
UT_GenericVector<ODe_Style_Style*>* pStyleVector;
ODe_Style_Style* pStyle;
bool isDuplicated;
UT_uint32 i, count;
pStyleVector = rStyles.enumerate();
count = pStyleVector->getItemCount();
for (i=0, isDuplicated=false; i<count && isDuplicated==false; i++) {
pStyle = pStyleVector->getNthItem(i);
if ( pStyle->isEquivalentTo(*rpStyle) ) {
isDuplicated = true; // exit the loop
delete rpStyle; // We don't want a duplicated style.
rpStyle = pStyle;
}
}
if (!isDuplicated) {
// Let's name and store this style.
UT_UTF8String styleName;
UT_UTF8String_sprintf(styleName, "%s%d", pNamingPrefix, count+1);
rpStyle->setStyleName(styleName);
rStyles.insert(styleName.utf8_str(), rpStyle);
}
}
示例8:
void
AP_UnixToolbar_StyleCombo::freeStyles() {
UT_GenericVector<PangoFontDescription*> *pVec = m_mapStyles.enumerate();
for (UT_sint32 i = 0; i < pVec->size(); i++) {
pango_font_description_free(pVec->getNthItem(i));
}
delete pVec;
}
示例9: delete
/**
* Destructor
*/
ODe_DocumentData::~ODe_DocumentData() {
UT_GenericVector<ODe_Style_MasterPage*>* pMasterPageVector;
UT_uint32 count, i;
pMasterPageVector = m_masterStyles.enumerate();
count = pMasterPageVector->getItemCount();
for (i=0; i<count; i++) {
delete (*pMasterPageVector)[i];
}
DELETEP(pMasterPageVector);
if (m_pOfficeTextTemp != NULL) {
ODe_gsf_output_close(m_pOfficeTextTemp);
}
}
示例10: _disableUpdates
void ABI_Collab_Import::_disableUpdates(UT_GenericVector<AV_View *>& vecViews, bool bIsGlob)
{
m_pDoc->getAllViews(&vecViews);
for (UT_sint32 i=0; i < vecViews.getItemCount(); i++)
{
vecViews.getNthItem(i)->setActivityMask(false);
}
m_pDoc->notifyPieceTableChangeStart();
if (bIsGlob)
{
// lock out all updates while processing the glob
m_pDoc->disableListUpdates();
m_pDoc->setDontImmediatelyLayout(true);
m_pDoc->beginUserAtomicGlob();
}
}
示例11: write
/**
* Writes <office:automatic-styles> element.
*/
void ODe_AutomaticStyles::write(GsfOutput* pContentStream) const {
UT_GenericVector<ODe_Style_Style*>* pStyleVector;
UT_GenericVector<ODe_Style_PageLayout*>* pPageLayoutVector;
UT_GenericVector<ODe_Style_List*>* pListStyleVector;
UT_uint32 i, count;
UT_UTF8String spacesOffset = " ";
ODe_writeUTF8String(pContentStream, " <office:automatic-styles>\n");
#define ODE_WRITE_STYLES(styleMap) \
pStyleVector = styleMap.enumerate(); \
count = pStyleVector->getItemCount(); \
for (i=0; i<count; i++) { \
(*pStyleVector)[i]->write(pContentStream, spacesOffset); \
} \
DELETEP(pStyleVector);
ODE_WRITE_STYLES (m_textStyles);
ODE_WRITE_STYLES (m_paragraphStyles);
ODE_WRITE_STYLES (m_sectionStyles);
ODE_WRITE_STYLES (m_tableStyles);
ODE_WRITE_STYLES (m_tableColumnStyles);
ODE_WRITE_STYLES (m_tableRowStyles);
ODE_WRITE_STYLES (m_tableCellStyles);
ODE_WRITE_STYLES (m_graphicStyles);
#undef ODE_WRITE_STYLES
pPageLayoutVector = m_pageLayouts.enumerate();
count = pPageLayoutVector->getItemCount();
for (i=0; i<count; i++) {
(*pPageLayoutVector)[i]->write(pContentStream, spacesOffset);
}
pListStyleVector = m_listStyles.enumerate();
count = pListStyleVector->getItemCount();
for (i=0; i<count; i++) {
(*pListStyleVector)[i]->write(pContentStream, spacesOffset);
}
ODe_writeUTF8String(pContentStream, " </office:automatic-styles>\n");
}
示例12: signal
/*!
* Implements the signal() method of the Document listener class.
*/
bool AbiCollabService_Export::signal(UT_uint32 iSignal)
{
if((iSignal == PD_SIGNAL_SAVEDOC) && m_pDoc->isDirty())
{
bool bSavedRemotely = ServiceAccountHandler::m_saveInterceptor.save(m_pDoc);
if(bSavedRemotely)
{
UT_GenericVector<AV_View *> vecViews;
m_pDoc->getAllViews(&vecViews);
AV_View * pView = vecViews.getNthItem(0);
XAP_Frame * pFrame = static_cast<XAP_Frame *> (pView->getParentData());
if (pFrame->getViewNumber() > 0)
XAP_App::getApp()->updateClones(pFrame);
}
return bSavedRemotely;
}
return true;
}
示例13: XAP_populateComboBoxWithIndex
void XAP_populateComboBoxWithIndex(GtkComboBox * combo,
const UT_GenericVector<const char*> & vec)
{
GtkListStore *store = GTK_LIST_STORE(gtk_combo_box_get_model(combo));
GtkTreeIter iter;
for(UT_sint32 i = 0; i < vec.getItemCount(); i++) {
gtk_list_store_append(store, &iter);
gtk_list_store_set(store, &iter, 0, vec[i], 1, i, -1);
}
}
示例14: UT_ASSERT
bool fl_FrameLayout::doclistener_changeStrux(const PX_ChangeRecord_StruxChange * pcrxc)
{
UT_ASSERT(pcrxc->getType()==PX_ChangeRecord::PXT_ChangeStrux);
fp_FrameContainer * pFrameC = static_cast<fp_FrameContainer *>(getFirstContainer());
UT_GenericVector<fl_ContainerLayout *> AllLayouts;
AllLayouts.clear();
fp_Page * pPage = NULL;
UT_sint32 i = 0;
if(pFrameC)
{
pPage = pFrameC->getPage();
UT_return_val_if_fail(pPage, false);
pPage->getAllLayouts(AllLayouts);
for(i=0; i< AllLayouts.getItemCount();i++)
{
fl_ContainerLayout * pCL = AllLayouts.getNthItem(i);
pCL->collapse();
}
}
setAttrPropIndex(pcrxc->getIndexAP());
collapse();
lookupProperties();
format();
for(i=0; i< AllLayouts.getItemCount();i++)
{
fl_ContainerLayout * pCL = AllLayouts.getNthItem(i);
pCL->format();
xxx_UT_DEBUGMSG(("Format block %x \n",pBL));
pCL->markAllRunsDirty();
}
getDocSectionLayout()->markAllRunsDirty();
return true;
}
示例15: populate
bool AP_CocoaToolbar_StyleCombo::populate(void)
{
// clear anything that's already there
m_vecContents.clear();
// populate the vector
#if 1
// HACK: for now, just hardwire it
// NB if you change the case of the labels, it will stop working
// unless you also change all the places where the style appears!
m_vecContents.addItem("Normal");
m_vecContents.addItem("Heading 1");
m_vecContents.addItem("Heading 2");
m_vecContents.addItem("Heading 3");
m_vecContents.addItem("Plain Text");
m_vecContents.addItem("Block Text");
#else
// TODO: need a view/doc pointer to get this right
// ALSO: will need to repopulate as new styles added
// HYP: only call this method from shared code?
UT_GenericVector<const PD_Styles*> pStyles = NULL;
pDoc->enumStyles(pStyles);
UT_uint32 nStyles = pStyles->getItemCount();
for (UT_uint32 k = 0; k < nStyles; k++)
{
const PD_Style * pStyle;
pStyle = pStyles->getNthItem(k);
if(pStyle) {
m_vecContents.addItem(pStyle->getName());
}
}
DELETEP(pStyles);
#endif
return true;
}