[Libreoffice-commits] libmspub.git: 2 commits - configure.ac src/lib
Fridrich Å trba
fridrich.strba at bluewin.ch
Wed May 1 14:41:11 PDT 2013
configure.ac | 11 ++++++++---
src/lib/ListInfo.h | 1 -
src/lib/MSPUBBlockID.h | 2 ++
src/lib/MSPUBCollector.cpp | 18 ++++++++++++++++++
src/lib/MSPUBCollector.h | 1 -
src/lib/MSPUBParser.cpp | 28 +++++++++++++++-------------
src/lib/MSPUBTypes.h | 3 ++-
src/lib/libmspub_utils.h | 1 -
8 files changed, 45 insertions(+), 20 deletions(-)
New commits:
commit ad0f36d02bf8bc1cfabb4d615bb27f216ef81cec
Author: Fridrich Å trba <fridrich.strba at bluewin.ch>
Date: Wed May 1 23:40:46 2013 +0200
Some boost header sanitizing
diff --git a/configure.ac b/configure.ac
index 394e89a..6d8bf60 100644
--- a/configure.ac
+++ b/configure.ac
@@ -66,10 +66,15 @@ AC_SUBST(ZLIB_LIBS)
# ===========================
# Find required boost headers
# ===========================
-AC_CHECK_HEADER(
- boost/ptr_container/ptr_map.hpp,
+AC_CHECK_HEADERS(
+ boost/bind.hpp \
+ boost/function.hpp \
+ boost/optional.hpp \
+ boost/ptr_container/ptr_vector.hpp \
+ boost/scoped_ptr.hpp \
+ boost/shared_ptr.hpp,
[],
- [AC_MSG_ERROR(boost/ptr_container/ptr_map.hpp not found. install boost)],
+ [AC_MSG_ERROR(Required boost headers not found. Install boost)],
[]
)
diff --git a/src/lib/ListInfo.h b/src/lib/ListInfo.h
index b6691c9..93b56d2 100644
--- a/src/lib/ListInfo.h
+++ b/src/lib/ListInfo.h
@@ -30,7 +30,6 @@
#define __LISTINFO_H__
#include <boost/optional.hpp>
-#include <boost/cstdint.hpp>
#include "NumberingType.h"
#include "NumberingDelimiter.h"
diff --git a/src/lib/MSPUBCollector.h b/src/lib/MSPUBCollector.h
index 5755043..fd8fd3e 100644
--- a/src/lib/MSPUBCollector.h
+++ b/src/lib/MSPUBCollector.h
@@ -37,7 +37,6 @@
#include <string>
#include <algorithm>
-#include <boost/ptr_container/ptr_map.hpp>
#include <boost/ptr_container/ptr_vector.hpp>
#include <boost/bind.hpp>
#include <boost/function.hpp>
diff --git a/src/lib/MSPUBParser.cpp b/src/lib/MSPUBParser.cpp
index 993b706..9b150a7 100644
--- a/src/lib/MSPUBParser.cpp
+++ b/src/lib/MSPUBParser.cpp
@@ -32,7 +32,6 @@
#include <algorithm>
#include <string.h>
#include <libwpd-stream/libwpd-stream.h>
-#include <boost/cstdint.hpp>
#include <zlib.h>
#include "MSPUBParser.h"
#include "MSPUBCollector.h"
diff --git a/src/lib/libmspub_utils.h b/src/lib/libmspub_utils.h
index c1ff6f8..c0ba308 100644
--- a/src/lib/libmspub_utils.h
+++ b/src/lib/libmspub_utils.h
@@ -33,7 +33,6 @@
#include <stdio.h>
#include <vector>
#include <map>
-#include <boost/ptr_container/ptr_map.hpp>
#include <libwpd/libwpd.h>
#include <libwpd-stream/libwpd-stream.h>
commit 546bf85c66d90e14beec96d51018fdc38b0d95c2
Author: Franz Schmid <franz at linux-hp-i7.site>
Date: Wed May 1 20:35:07 2013 +0200
Added support for DropCaps letter setting and fixed column and column-gap output.
diff --git a/src/lib/MSPUBBlockID.h b/src/lib/MSPUBBlockID.h
index a44c5a8..4cd7c2b 100644
--- a/src/lib/MSPUBBlockID.h
+++ b/src/lib/MSPUBBlockID.h
@@ -69,6 +69,8 @@ enum MSPUBBlockID // Don't be alarmed by multiple elements with the same value;
PARAGRAPH_LEFT_INDENT = 0xD,
PARAGRAPH_RIGHT_INDENT = 0xE,
PARAGRAPH_DROP_CAP_LINES = 0x8,
+ PARAGRAPH_DROP_CAP_UP = 0x2C,
+ PARAGRAPH_DROP_CAP_LETTERS = 0x2D,
THIS_MASTER_NAME = 0xE,
APPLIED_MASTER_NAME = 0xD,
BA_ARRAY = 0x02,
diff --git a/src/lib/MSPUBCollector.cpp b/src/lib/MSPUBCollector.cpp
index f16ae79..a23c713 100644
--- a/src/lib/MSPUBCollector.cpp
+++ b/src/lib/MSPUBCollector.cpp
@@ -809,6 +809,18 @@ boost::function<void(void)> libmspub::MSPUBCollector::paintShape(const ShapeInfo
break;
}
}
+ if (info.m_numColumns)
+ {
+ unsigned ncols = info.m_numColumns.get_value_or(0);
+ if (ncols > 0)
+ props.insert("fo:column-count", (int)ncols);
+ }
+ if (info.m_columnSpacing)
+ {
+ unsigned ngap = info.m_columnSpacing;
+ if (ngap > 0)
+ props.insert("fo:column-gap", (double)ngap / EMUS_IN_INCH);
+ }
m_painter->startTextObject(props, WPXPropertyListVector());
for (unsigned i_lines = 0; i_lines < text.size(); ++i_lines)
{
@@ -1199,6 +1211,12 @@ WPXPropertyList libmspub::MSPUBCollector::getParaStyleProps(const ParagraphStyle
{
ret.insert("style:drop-cap", (int)dropCapLines);
}
+ unsigned dropCapLetters = style.m_dropCapLetters.get_value_or(
+ defaultStyle.m_dropCapLetters.get_value_or(0));
+ if (dropCapLetters != 0)
+ {
+ ret.insert("style:length", (int)dropCapLetters);
+ }
return ret;
}
diff --git a/src/lib/MSPUBParser.cpp b/src/lib/MSPUBParser.cpp
index 418ea1b..993b706 100644
--- a/src/lib/MSPUBParser.cpp
+++ b/src/lib/MSPUBParser.cpp
@@ -1263,6 +1263,9 @@ libmspub::ParagraphStyle libmspub::MSPUBParser::getParagraphStyle(WPXInputStream
case PARAGRAPH_DROP_CAP_LINES:
ret.m_dropCapLines = info.data;
break;
+ case PARAGRAPH_DROP_CAP_LETTERS:
+ ret.m_dropCapLetters = info.data;
+ break;
default:
break;
}
@@ -1686,17 +1689,19 @@ void libmspub::MSPUBParser::parseEscherShape(WPXInputStream *input, const Escher
dotStyle));
}
- unsigned *ptr_numColumns = getIfExists(foptValues.m_scalarValues,
- FIELDID_NUM_COLUMNS);
- if (ptr_numColumns)
- {
- m_collector->setShapeNumColumns(*shapeSeqNum, *ptr_numColumns);
- }
- unsigned *ptr_columnSpacing = getIfExists(foptValues.m_scalarValues,
- FIELDID_COLUMN_SPACING);
- if (ptr_columnSpacing)
+ if (!!maybe_tertiaryFoptValues)
{
- m_collector->setShapeColumnSpacing(*shapeSeqNum, *ptr_columnSpacing);
+ std::map<unsigned short, unsigned> &tertiaryFoptValues = maybe_tertiaryFoptValues.get();
+ unsigned *ptr_numColumns = getIfExists(tertiaryFoptValues, FIELDID_NUM_COLUMNS);
+ if (ptr_numColumns)
+ {
+ m_collector->setShapeNumColumns(*shapeSeqNum, *ptr_numColumns);
+ }
+ unsigned *ptr_columnSpacing = getIfExists(tertiaryFoptValues, FIELDID_COLUMN_SPACING);
+ if (ptr_columnSpacing)
+ {
+ m_collector->setShapeColumnSpacing(*shapeSeqNum, *ptr_columnSpacing);
+ }
}
unsigned *ptr_beginArrowStyle = getIfExists(foptValues.m_scalarValues,
FIELDID_BEGIN_ARROW_STYLE);
@@ -1774,7 +1779,6 @@ void libmspub::MSPUBParser::parseEscherShape(WPXInputStream *input, const Escher
{
std::vector<libmspub::Vertex> ret = parseVertices(wrapVertexData);
m_collector->setShapeClipPath(*shapeSeqNum, ret);
- MSPUB_DEBUG_MSG(("Current Escher shape has wrap Path\n"));
}
}
if (foundAnchor)
@@ -2171,7 +2175,6 @@ libmspub::FOPTValues libmspub::MSPUBParser::extractFOPTValues(WPXInputStream *in
unsigned short id = readU16(input);
unsigned value = readU32(input);
ret.m_scalarValues[id] = value;
- MSPUB_DEBUG_MSG(("EscherFopt ID %u Value %u\n", id, value));
bool complex = id & 0x8000;
if (complex)
{
diff --git a/src/lib/MSPUBTypes.h b/src/lib/MSPUBTypes.h
index 946f9c4..984ce5c 100644
--- a/src/lib/MSPUBTypes.h
+++ b/src/lib/MSPUBTypes.h
@@ -159,10 +159,11 @@ struct ParagraphStyle
boost::optional<ListInfo> m_listInfo;
std::vector<unsigned> m_tabStopsInEmu;
boost::optional<unsigned> m_dropCapLines;
+ boost::optional<unsigned> m_dropCapLetters;
ParagraphStyle() :
m_align(), m_defaultCharStyleIndex(), m_lineSpacing(), m_spaceBeforeEmu(),
m_spaceAfterEmu(), m_firstLineIndentEmu(), m_leftIndentEmu(),
- m_rightIndentEmu(), m_listInfo(), m_tabStopsInEmu(), m_dropCapLines()
+ m_rightIndentEmu(), m_listInfo(), m_tabStopsInEmu(), m_dropCapLines(), m_dropCapLetters()
{
}
};
More information about the Libreoffice-commits
mailing list