[Libreoffice-commits] libmspub.git: src/lib
Franz Schmid
franz at linux-hp-i7.site
Sun Apr 28 07:19:55 PDT 2013
src/lib/MSPUBBlockID.h | 1 +
src/lib/MSPUBCollector.cpp | 6 ++++++
src/lib/MSPUBParser.cpp | 3 +++
src/lib/MSPUBTypes.h | 3 ++-
4 files changed, 12 insertions(+), 1 deletion(-)
New commits:
commit 8b3c9c61a8d1d83e4be8f2bfcd45d6f4c4487550
Author: Franz Schmid <franz at linux-hp-i7.site>
Date: Thu Apr 25 23:09:47 2013 +0200
Added Drop Caps to the Paragraph Styles.
diff --git a/src/lib/MSPUBBlockID.h b/src/lib/MSPUBBlockID.h
index 5a42d72..a44c5a8 100644
--- a/src/lib/MSPUBBlockID.h
+++ b/src/lib/MSPUBBlockID.h
@@ -68,6 +68,7 @@ enum MSPUBBlockID // Don't be alarmed by multiple elements with the same value;
PARAGRAPH_FIRST_LINE_INDENT = 0xC,
PARAGRAPH_LEFT_INDENT = 0xD,
PARAGRAPH_RIGHT_INDENT = 0xE,
+ PARAGRAPH_DROP_CAP_LINES = 0x8,
THIS_MASTER_NAME = 0xE,
APPLIED_MASTER_NAME = 0xD,
BA_ARRAY = 0x02,
diff --git a/src/lib/MSPUBCollector.cpp b/src/lib/MSPUBCollector.cpp
index a8d55ca..f16ae79 100644
--- a/src/lib/MSPUBCollector.cpp
+++ b/src/lib/MSPUBCollector.cpp
@@ -1193,6 +1193,12 @@ WPXPropertyList libmspub::MSPUBCollector::getParaStyleProps(const ParagraphStyle
{
ret.insert("fo:margin-right", (double)rightIndentEmu / EMUS_IN_INCH);
}
+ unsigned dropCapLines = style.m_dropCapLines.get_value_or(
+ defaultStyle.m_dropCapLines.get_value_or(0));
+ if (dropCapLines != 0)
+ {
+ ret.insert("style:drop-cap", (int)dropCapLines);
+ }
return ret;
}
diff --git a/src/lib/MSPUBParser.cpp b/src/lib/MSPUBParser.cpp
index 9851ec6..418ea1b 100644
--- a/src/lib/MSPUBParser.cpp
+++ b/src/lib/MSPUBParser.cpp
@@ -1260,6 +1260,9 @@ libmspub::ParagraphStyle libmspub::MSPUBParser::getParagraphStyle(WPXInputStream
case PARAGRAPH_LIST_NUMBER_RESTART:
numberIfRestarted = info.data;
break;
+ case PARAGRAPH_DROP_CAP_LINES:
+ ret.m_dropCapLines = info.data;
+ break;
default:
break;
}
diff --git a/src/lib/MSPUBTypes.h b/src/lib/MSPUBTypes.h
index 7884725..946f9c4 100644
--- a/src/lib/MSPUBTypes.h
+++ b/src/lib/MSPUBTypes.h
@@ -158,10 +158,11 @@ struct ParagraphStyle
boost::optional<unsigned> m_rightIndentEmu;
boost::optional<ListInfo> m_listInfo;
std::vector<unsigned> m_tabStopsInEmu;
+ boost::optional<unsigned> m_dropCapLines;
ParagraphStyle() :
m_align(), m_defaultCharStyleIndex(), m_lineSpacing(), m_spaceBeforeEmu(),
m_spaceAfterEmu(), m_firstLineIndentEmu(), m_leftIndentEmu(),
- m_rightIndentEmu(), m_listInfo(), m_tabStopsInEmu()
+ m_rightIndentEmu(), m_listInfo(), m_tabStopsInEmu(), m_dropCapLines()
{
}
};
More information about the Libreoffice-commits
mailing list