mirror of
https://github.com/JakubMelka/PDF4QT.git
synced 2025-06-05 21:59:17 +02:00
Minor bugfixes
This commit is contained in:
@ -839,7 +839,8 @@ QString PDFTextFlow::getContext(size_t index, size_t length) const
|
|||||||
{
|
{
|
||||||
Q_ASSERT(length > 0);
|
Q_ASSERT(length > 0);
|
||||||
|
|
||||||
while (index > 0 && m_characterPointers[index - 1].hasSameLine(m_characterPointers[index]))
|
const PDFCharacterPointer& frontComparatorItem = m_characterPointers[index];
|
||||||
|
while (index > 0 && (m_characterPointers[index - 1].hasSameLine(frontComparatorItem) || !m_characterPointers[index - 1].isValid()))
|
||||||
{
|
{
|
||||||
--index;
|
--index;
|
||||||
++length;
|
++length;
|
||||||
@ -847,13 +848,14 @@ QString PDFTextFlow::getContext(size_t index, size_t length) const
|
|||||||
|
|
||||||
size_t currentEnd = index + length - 1;
|
size_t currentEnd = index + length - 1;
|
||||||
size_t last = m_characterPointers.size() - 1;
|
size_t last = m_characterPointers.size() - 1;
|
||||||
while (currentEnd < last && m_characterPointers[currentEnd].hasSameLine(m_characterPointers[currentEnd + 1]))
|
const PDFCharacterPointer& backComparatorItem = m_characterPointers[currentEnd];
|
||||||
|
while (currentEnd < last && (m_characterPointers[currentEnd + 1].hasSameLine(backComparatorItem) || !m_characterPointers[currentEnd + 1].isValid()))
|
||||||
{
|
{
|
||||||
++currentEnd;
|
++currentEnd;
|
||||||
++length;
|
++length;
|
||||||
}
|
}
|
||||||
|
|
||||||
return m_text.mid(int(index), int(length));
|
return m_text.mid(int(index), int(length)).trimmed();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PDFCharacterPointer::hasSameBlock(const PDFCharacterPointer& other) const
|
bool PDFCharacterPointer::hasSameBlock(const PDFCharacterPointer& other) const
|
||||||
|
@ -135,9 +135,6 @@
|
|||||||
<property name="selectionBehavior">
|
<property name="selectionBehavior">
|
||||||
<enum>QAbstractItemView::SelectRows</enum>
|
<enum>QAbstractItemView::SelectRows</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="sortingEnabled">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="columnCount">
|
<property name="columnCount">
|
||||||
<number>3</number>
|
<number>3</number>
|
||||||
</property>
|
</property>
|
||||||
|
Reference in New Issue
Block a user