1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-26 00:35:23 +00:00

Merge remote-tracking branch 'cc9cii/Bug-No-1710'

This commit is contained in:
Marc Zinnschlag 2014-09-08 16:38:25 +02:00
commit 77e9ac8975
3 changed files with 15 additions and 9 deletions

View File

@ -91,7 +91,7 @@ return ( type == CSMWorld::ColumnBase::Display_Activator
|| type == CSMWorld::ColumnBase::Display_Static
|| type == CSMWorld::ColumnBase::Display_Weapon);
}
bool CSMWorld::TableMimeData::isReferencable(CSMWorld::UniversalId::Type type) const
bool CSMWorld::TableMimeData::isReferencable(CSMWorld::UniversalId::Type type)
{
return ( type == CSMWorld::UniversalId::Type_Activator
|| type == CSMWorld::UniversalId::Type_Potion
@ -222,7 +222,6 @@ namespace
{ CSMWorld::UniversalId::Type_Race, CSMWorld::ColumnBase::Display_Race },
{ CSMWorld::UniversalId::Type_Skill, CSMWorld::ColumnBase::Display_Skill },
{ CSMWorld::UniversalId::Type_Class, CSMWorld::ColumnBase::Display_Class },
{ CSMWorld::UniversalId::Type_Class, CSMWorld::ColumnBase::Display_Class },
{ CSMWorld::UniversalId::Type_Faction, CSMWorld::ColumnBase::Display_Faction },
{ CSMWorld::UniversalId::Type_Sound, CSMWorld::ColumnBase::Display_Sound },
{ CSMWorld::UniversalId::Type_Region, CSMWorld::ColumnBase::Display_Region },

View File

@ -59,10 +59,10 @@ namespace CSMWorld
static CSMWorld::ColumnBase::Display convertEnums(CSMWorld::UniversalId::Type type);
static bool isReferencable(CSMWorld::UniversalId::Type type);
private:
bool isReferencable(CSMWorld::UniversalId::Type type) const;
bool isReferencable(CSMWorld::ColumnBase::Display type) const;
};
}
#endif // TABLEMIMEDATA_H
#endif // TABLEMIMEDATA_H

View File

@ -111,14 +111,21 @@ void CSVWorld::TableSubView::createFilterRequest (std::vector< CSMWorld::Univers
{
std::vector<std::pair<std::string, std::vector<std::string> > > filterSource;
std::vector<std::string> refIdColumns = mTable->getColumnsWithDisplay(CSMWorld::TableMimeData::convertEnums(CSMWorld::UniversalId::Type_Referenceable));
bool hasRefIdDisplay = !refIdColumns.empty();
for (std::vector<CSMWorld::UniversalId>::iterator it(types.begin()); it != types.end(); ++it)
{
std::pair<std::string, std::vector<std::string> > pair( //splited long line
std::make_pair(it->getId(), mTable->getColumnsWithDisplay(CSMWorld::TableMimeData::convertEnums(it->getType()))));
if(!pair.second.empty())
CSMWorld::UniversalId::Type type = it->getType();
std::vector<std::string> col = mTable->getColumnsWithDisplay(CSMWorld::TableMimeData::convertEnums(type));
if(!col.empty())
{
filterSource.push_back(pair);
filterSource.push_back(std::make_pair(it->getId(), col));
}
if(hasRefIdDisplay && CSMWorld::TableMimeData::isReferencable(type))
{
filterSource.push_back(std::make_pair(it->getId(), refIdColumns));
}
}