|
a/src/query/docseq.cpp |
|
b/src/query/docseq.cpp |
|
... |
|
... |
54 |
}
|
54 |
}
|
55 |
|
55 |
|
56 |
// Remove stacked modifying sources (sort, filter) until we get to a real one
|
56 |
// Remove stacked modifying sources (sort, filter) until we get to a real one
|
57 |
void DocSource::stripStack()
|
57 |
void DocSource::stripStack()
|
58 |
{
|
58 |
{
|
59 |
if (m_seq.isNull())
|
59 |
if (!m_seq)
|
60 |
return;
|
60 |
return;
|
61 |
while (m_seq->getSourceSeq().isNotNull()) {
|
61 |
while (m_seq->getSourceSeq()) {
|
62 |
m_seq = m_seq->getSourceSeq();
|
62 |
m_seq = m_seq->getSourceSeq();
|
63 |
}
|
63 |
}
|
64 |
}
|
64 |
}
|
65 |
|
65 |
|
66 |
bool DocSource::buildStack()
|
66 |
bool DocSource::buildStack()
|
67 |
{
|
67 |
{
|
68 |
LOGDEB2(("DocSource::buildStack()\n"));
|
68 |
LOGDEB2(("DocSource::buildStack()\n"));
|
69 |
stripStack();
|
69 |
stripStack();
|
70 |
|
70 |
|
71 |
if (m_seq.isNull())
|
71 |
if (!m_seq)
|
72 |
return false;
|
72 |
return false;
|
73 |
|
73 |
|
74 |
// Filtering must be done before sorting, (which may
|
74 |
// Filtering must be done before sorting, (which may
|
75 |
// truncates the original list)
|
75 |
// truncates the original list)
|
76 |
if (m_seq->canFilter()) {
|
76 |
if (m_seq->canFilter()) {
|
|
... |
|
... |
78 |
LOGERR(("DocSource::buildStack: setfiltspec failed\n"));
|
78 |
LOGERR(("DocSource::buildStack: setfiltspec failed\n"));
|
79 |
}
|
79 |
}
|
80 |
} else {
|
80 |
} else {
|
81 |
if (m_fspec.isNotNull()) {
|
81 |
if (m_fspec.isNotNull()) {
|
82 |
m_seq =
|
82 |
m_seq =
|
83 |
RefCntr<DocSequence>(new DocSeqFiltered(m_config, m_seq, m_fspec));
|
83 |
STD_SHARED_PTR<DocSequence>(new DocSeqFiltered(m_config, m_seq, m_fspec));
|
84 |
}
|
84 |
}
|
85 |
}
|
85 |
}
|
86 |
|
86 |
|
87 |
if (m_seq->canSort()) {
|
87 |
if (m_seq->canSort()) {
|
88 |
if (!m_seq->setSortSpec(m_sspec)) {
|
88 |
if (!m_seq->setSortSpec(m_sspec)) {
|
89 |
LOGERR(("DocSource::buildStack: setsortspec failed\n"));
|
89 |
LOGERR(("DocSource::buildStack: setsortspec failed\n"));
|
90 |
}
|
90 |
}
|
91 |
} else {
|
91 |
} else {
|
92 |
if (m_sspec.isNotNull()) {
|
92 |
if (m_sspec.isNotNull()) {
|
93 |
m_seq = RefCntr<DocSequence>(new DocSeqSorted(m_seq, m_sspec));
|
93 |
m_seq = STD_SHARED_PTR<DocSequence>(new DocSeqSorted(m_seq, m_sspec));
|
94 |
}
|
94 |
}
|
95 |
}
|
95 |
}
|
96 |
return true;
|
96 |
return true;
|
97 |
}
|
97 |
}
|
98 |
|
98 |
|
99 |
string DocSource::title()
|
99 |
string DocSource::title()
|
100 |
{
|
100 |
{
|
101 |
if (m_seq.isNull())
|
101 |
if (!m_seq)
|
102 |
return string();
|
102 |
return string();
|
103 |
string qual;
|
103 |
string qual;
|
104 |
if (m_fspec.isNotNull() && !m_sspec.isNotNull())
|
104 |
if (m_fspec.isNotNull() && !m_sspec.isNotNull())
|
105 |
qual = string(" (") + o_filt_trans + string(")");
|
105 |
qual = string(" (") + o_filt_trans + string(")");
|
106 |
else if (!m_fspec.isNotNull() && m_sspec.isNotNull())
|
106 |
else if (!m_fspec.isNotNull() && m_sspec.isNotNull())
|