void WP5FootnoteEndnoteGroup::_readContents(librevenge::RVNGInputStream *input, WPXEncryption *encryption)
{
	int tmpSizeOfNote = getSize() - 8;
	unsigned char tmpFlags = readU8(input, encryption);
	tmpSizeOfNote -= 1;
	int tmpNumOfNote = readU16(input, encryption);
	tmpSizeOfNote -= 2;
	if (getSubGroup() == WP5_FOOTNOTE_ENDNOTE_GROUP_FOOTNOTE)
	{
		int tmpNumOfAdditionalPages = readU8(input, encryption);
		tmpSizeOfNote -= 1;
		input->seek(2*(tmpNumOfAdditionalPages+1) + 9, librevenge::RVNG_SEEK_CUR);
		tmpSizeOfNote -= 2*(tmpNumOfAdditionalPages+1) + 9;
	}
	else /* WP5_FOOTNOTE_ENDNOTE_GROUP_ENDNOTE */
	{
		input->seek(4, librevenge::RVNG_SEEK_CUR);
		tmpSizeOfNote -= 4;
	}

	m_subDocument = new WP5SubDocument(input, encryption, (unsigned)tmpSizeOfNote);
	if (tmpFlags & 0x80)
		m_noteReference.sprintf("%c", tmpNumOfNote);
	else
		m_noteReference.sprintf("%i", tmpNumOfNote);
}
void WP6NumberingMethodGroup::parse(WP6Listener *listener)
{
	switch (getSubGroup())
	{
	case WP6_NUMBERING_METHOD_GROUP_SET_PAGE_NUMBERING_MODE:
		switch (m_numberingMethod)
		{
		case WP6_NUMBERING_METHOD_GROUP_PAGE_NUMBERING_LOWERCASE:
			listener->setPageNumberingType(LOWERCASE);
			break;
		case WP6_NUMBERING_METHOD_GROUP_PAGE_NUMBERING_UPPERCASE:
			listener->setPageNumberingType(UPPERCASE);
			break;
		case WP6_NUMBERING_METHOD_GROUP_PAGE_NUMBERING_LOWERCASE_ROMAN:
			listener->setPageNumberingType(LOWERCASE_ROMAN);
			break;
		case WP6_NUMBERING_METHOD_GROUP_PAGE_NUMBERING_UPPERCASE_ROMAN:
			listener->setPageNumberingType(UPPERCASE_ROMAN);
			break;
		case WP6_NUMBERING_METHOD_GROUP_PAGE_NUMBERING_ARABIC:
		default:
			listener->setPageNumberingType(ARABIC);
			break;
		}
		break;
	default:
		break;
	}
}
Esempio n. 3
0
void WP3DefinitionGroup::parse(WP3Listener *listener)
{
	WPD_DEBUG_MSG(("WordPerfect: handling a Definition group\n"));

	switch (getSubGroup())
	{
	case WP3_DEFINITION_GROUP_SET_COLUMNS:
		// number of columns = {0,1} means columns off
		if ((m_numColumns <= 1))
		{
			listener->columnChange(NEWSPAPER, 1, m_columnWidth, m_isFixedWidth); // the value "1" is bugus, the false bool gives you all the information you need here
		}
		else
		{
			switch (m_colType)
			{
			case WP3_COLUMN_TYPE_NEWSPAPER:
				listener->columnChange(NEWSPAPER, m_numColumns, m_columnWidth, m_isFixedWidth);
				break;
			case WP3_COLUMN_TYPE_PARALLEL:
				listener->columnChange(PARALLEL, m_numColumns, m_columnWidth, m_isFixedWidth);
				break;
			case WP3_COLUMN_TYPE_EXTENDED:
				listener->columnChange(PARALLEL_PROTECT, m_numColumns, m_columnWidth, m_isFixedWidth);
				break;
			default: // something else we don't support, since it isn't in the docs
				break;
			}
		}
		break;
	default: // something else we don't support, since it isn't in the docs
		break;
	}
}
Esempio n. 4
0
void WP6HeaderFooterGroup::parse(WP6Listener *listener)
{
	WPD_DEBUG_MSG(("WordPerfect: handling a HeaderFooter group\n"));

	if (getNumPrefixIDs() > 0) // FIXME: perhaps we should throw an exception if this isn't true..
	{
		listener->headerFooterGroup(getSubGroup(), m_occurrenceBits, getPrefixIDs()[0]);
	}
}
Esempio n. 5
0
void WP5DefinitionGroup::_readContents(librevenge::RVNGInputStream *input, WPXEncryption *encryption)
{
	switch (getSubGroup())
	{
	case WP5_TOP_DEFINITION_GROUP_DEFINE_TABLES:
		m_subGroupData = new WP5DefinitionGroup_DefineTablesSubGroup(input, encryption, getSize());
		break;
	default:
		break;
	}
}
void WP6NumberingMethodGroup::_readContents(librevenge::RVNGInputStream *input, WPXEncryption *encryption)
{
	switch (getSubGroup())
	{
	case WP6_NUMBERING_METHOD_GROUP_SET_PAGE_NUMBERING_MODE:
		m_levelNumber = readU8(input, encryption);;
		m_numberingMethod = readU8(input, encryption);
		break;
	default:
		break;
	}
}
Esempio n. 7
0
void Group::BroadcastPacket(WorldPacket const& packet, bool ignorePlayersInBGRaid, int group, ObjectGuid ignore) const
{
    for (auto itr = GetFirstMember(); itr != nullptr; itr = itr->next())
    {
        Player* pl = itr->getSource();
        if (!pl || (ignore && pl->GetObjectGuid() == ignore) || (ignorePlayersInBGRaid && pl->GetGroup() != this))
            continue;

        if (pl->GetSession() && (group == -1 || itr->getSubGroup() == group))
            pl->GetSession()->SendPacket(packet);
    }
}
Esempio n. 8
0
void WP6SetNumberGroup::parse(WP6Listener *listener)
{
	WPD_DEBUG_MSG(("WordPerfect: handling a set number group\n"));

	switch (getSubGroup())
	{
	case WP6_SET_NUMBER_GROUP_SET_PAGE_NUMBER:
		listener->setPageNumber(m_countNumbers);
		break;
	default:
		break;
	}
}
Esempio n. 9
0
void WP5DefinitionGroup::parse(WP5Listener *listener)
{
	WPD_DEBUG_MSG(("WordPerfect: handling a Definition group\n"));

	switch (getSubGroup())
	{
	case WP5_TOP_DEFINITION_GROUP_DEFINE_TABLES:
		m_subGroupData->parse(listener);
		break;
	default:
		break;
	}
}
Esempio n. 10
0
void WP3DefinitionGroup::_readContents(librevenge::RVNGInputStream *input, WPXEncryption *encryption)
{
	// this group can contain different kinds of data, thus we need to read
	// the contents accordingly
	switch (getSubGroup())
	{
	case WP3_DEFINITION_GROUP_SET_COLUMNS:
	{
		unsigned char tmpColType = readU8(input, encryption);
		if (tmpColType)
		{
			unsigned char tmpNumColumns = readU8(input, encryption);
			if (tmpNumColumns)
				input->seek(((2*tmpNumColumns) - 1), librevenge::RVNG_SEEK_CUR);
		}

		m_colType = readU8(input, encryption);
		if (!m_colType)
		{
			m_numColumns = 1;
			m_isFixedWidth.clear();
			m_columnWidth.clear();
		}
		else
		{
			m_numColumns = readU8(input, encryption);
			if (m_numColumns > 1)
			{
				for (int i=0; i<((2*m_numColumns)-1); i++)
				{
					if (i%2)
					{
						unsigned tmpSpaceBetweenColumns = readU32(input, encryption, true);
						m_isFixedWidth.push_back(true);
						m_columnWidth.push_back((double)((double)fixedPointToWPUs(tmpSpaceBetweenColumns)/(double)WPX_NUM_WPUS_PER_INCH));
					}
					else
					{
						unsigned short tmpSizeOfColumn = readU16(input, encryption, true);
						m_isFixedWidth.push_back(false);
						m_columnWidth.push_back((double)((double)tmpSizeOfColumn/(double)0x10000));
					}
				}
			}
		}
	}
	break;
	default: /* something else we don't support, since it isn't in the docs */
		break;
	}
}
Esempio n. 11
0
void WP6SetNumberGroup::_readContents(librevenge::RVNGInputStream *input, WPXEncryption *encryption)
{
	switch (getSubGroup())
	{
	case WP6_SET_NUMBER_GROUP_SET_PAGE_NUMBER:
		m_countOfLevelNumbersSetting = readU8(input, encryption);
		m_startingLevelNumber = readU8(input, encryption);
		m_countNumbers = readU16(input, encryption);
		WPD_DEBUG_MSG(("WordPerfect: Set number page number (%d, %d, %d)\n", m_countOfLevelNumbersSetting, m_startingLevelNumber, m_countNumbers));
		break;
	default:
		break;
	}
}
void WP3FootnoteEndnoteGroup::parse(WP3Listener *listener)
{
	WPD_DEBUG_MSG(("WordPerfect: handling a Footnote/Endnote group\n"));
	switch (getSubGroup())
	{
	case WP3_FOOTNOTE_ENDNOTE_GROUP_FOOTNOTE_FUNCTION:
		listener->insertNote(FOOTNOTE, m_subDocument);
		break;
	case WP3_FOOTNOTE_ENDNOTE_GROUP_ENDNOTE_FUNCTION:
		listener->insertNote(ENDNOTE, m_subDocument);
		break;
	default: // something else we don't support, since it isn't in the docs
		break;
	}
}
Esempio n. 13
0
void WP3EndOfLinePageGroup::parse(WP3Listener *listener)
{
	WPD_DEBUG_MSG(("WordPerfect: handling an End of Line/Page group\n"));

	// NOTE: the mappings like Soft End of Line -> Space come from the actual
	// file format documentation. Don't change them unless you have a very
	// good reason.

	// TODO: handle the values > 0x02
	switch (getSubGroup())
	{
	case 0x00: // Soft End of Line
		listener->insertCharacter((unsigned) ' ');
		break;
	case 0x01: // Soft End of Page/Column
		listener->insertCharacter((unsigned) ' ');
		break;
	case 0x02: // Hard End of Line
		listener->insertEOL();
		break;
	case 0x03: // Hard End of Line/Soft End of Page/Column
		listener->insertEOL();
		listener->insertBreak(WPX_SOFT_PAGE_BREAK);
		break;
	case 0x04: // Temporary End of Line
		listener->insertEOL();
		break;
	case 0x05: // Temporary End of Page/Column
		listener->insertBreak(WPX_PAGE_BREAK);
		break;
	case 0x06: // Dormant Hard Return
		listener->insertEOL();
		break;
	case 0x07: // Hard End of Page
		listener->insertBreak(WPX_PAGE_BREAK);
		break;
	case 0x08: // Hard End of Column
		listener->insertBreak(WPX_COLUMN_BREAK);
		break;
	case 0x09: // Hard End of Column/Soft End of Page
		listener->insertBreak(WPX_COLUMN_BREAK);
		listener->insertBreak(WPX_SOFT_PAGE_BREAK);
		break;
	case 0x0A: // Hard End of Line (Hard EOC not in columns)
		listener->insertEOL();
		break;
	case 0x0B: // Hard EOL/Soft EOP (Hard EOC/soft EOP not columns)
		listener->insertEOL();
		listener->insertBreak(WPX_SOFT_PAGE_BREAK);
		break;
	case 0x0C: // Hard Hyphen at End of Line
		listener->insertCharacter((unsigned) '-');
		break;
	case 0x0D: // Hard Hyphen at End of Page/Column
		listener->insertCharacter((unsigned) '-');
		listener->insertBreak(WPX_SOFT_PAGE_BREAK);
		break;
	case 0x0E: // Soft Hyphen at End of Line
		listener->insertCharacter((unsigned) 0xad);
		break;
	case 0x0F: // Soft Hyphen at End of Page/Column
		listener->insertCharacter((unsigned) 0xad);
		break;
	case 0x10: // Auto Hyphen at End of Line
		break;
	case 0x11: // Auto Hyphen at End of Page/Column
		listener->insertBreak(WPX_SOFT_PAGE_BREAK);
		break;
	case 0x12: // (reserved)
		break;
	case 0x13: // Hard Beginning of File
		break;
	case 0x14: // Temporary Hard End of Column
		listener->insertBreak(WPX_COLUMN_BREAK);
		break;
	case 0x15: // Temporary Hard End of Column/Soft EOP
		listener->insertBreak(WPX_COLUMN_BREAK);
		listener->insertBreak(WPX_SOFT_PAGE_BREAK);
		break;
	case 0x16: // Hard End of Table Cell
		listener->closeCell();
		break;
	case 0x17: // (reserved)
		break;
	case 0x18: // Hard End of Table Row/Cell
		listener->closeRow();
		break;
	case 0x19: // Hard End of Table Row/Cell/Soft EOP
		listener->closeRow();
		listener->insertBreak(WPX_SOFT_PAGE_BREAK);
		break;
	case 0x1A: // Hard End of Table Row/End of Table
		listener->closeRow();
		listener->endTable();
		break;
	case 0x1B: // Hard End of Table Row/End of Table/Soft EOP
		listener->closeRow();
		listener->endTable();
		listener->insertBreak(WPX_SOFT_PAGE_BREAK);
		break;
	case 0x1C: // Hard End of Table Row/Cell/End of Header
		listener->closeRow();
		break;
	case 0x1D: // Hard End of Table Row/Cell/Soft EOP/Start of Header
		listener->closeRow();
		listener->insertBreak(WPX_SOFT_PAGE_BREAK);
		break;
	case 0x1E: // (reserved)
		break;
	case 0x1F: // (reserved)
		break;
	default: // unhandled or undocumented subgroup value
		break;
	}
}