summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorALONSO Laurent <laurent.alonso@inria.fr>2019-04-05 14:57:34 +0200
committerALONSO Laurent <laurent.alonso@inria.fr>2019-04-05 14:57:34 +0200
commit697313f5bb3b8d619d9bb1f8b0ee0fc844e2058e (patch)
tree286297ac9d50160ac567c8e8c8ffba16fb33514c
parent9c097a20c7a1a28593339b0d437ab5e813e04c33 (diff)
pages[all]: try to retrieve text boxes attached as char...
Change-Id: Ic015bdaf8bda94547b3a752c8c28ae90bd9b2c10
-rw-r--r--src/lib/IWORKCollector.h2
-rw-r--r--src/lib/PAGCollector.cpp56
-rw-r--r--src/lib/PAGCollector.h1
3 files changed, 14 insertions, 45 deletions
diff --git a/src/lib/IWORKCollector.h b/src/lib/IWORKCollector.h
index 3b6eb8a..d7a3a79 100644
--- a/src/lib/IWORKCollector.h
+++ b/src/lib/IWORKCollector.h
@@ -143,7 +143,7 @@ protected:
static void fillWrapProps(const IWORKStylePtr_t style, librevenge::RVNGPropertyList &props,
const boost::optional<int> &order);
static void writeFill(const IWORKFill &fill, librevenge::RVNGPropertyList &props);
- virtual void drawShape(const IWORKShapePtr_t &shape);
+ void drawShape(const IWORKShapePtr_t &shape);
private:
void pushStyle(const IWORKStylePtr_t &style);
diff --git a/src/lib/PAGCollector.cpp b/src/lib/PAGCollector.cpp
index a3ac5e2..4cbea2b 100644
--- a/src/lib/PAGCollector.cpp
+++ b/src/lib/PAGCollector.cpp
@@ -280,45 +280,6 @@ void PAGCollector::drawTable()
openGroup();
}
-void PAGCollector::drawShape(const IWORKShapePtr_t &shape)
-{
- if (!m_inAttachment)
- return IWORKCollector::drawShape(shape);
-
- if (!bool(shape) || !bool(shape->m_path))
- {
- ETONYEK_DEBUG_MSG(("PAGCollector::drawShape: can not find the shape\n"));
- return;
- }
-
- librevenge::RVNGPropertyList styleProps;
- if (bool(shape->m_style))
- fillGraphicProps(shape->m_style, styleProps, true, false);
- if (shape->m_locked) // CHECKME: maybe also content
- styleProps.insert("style:protect", "position size");
-
- librevenge::RVNGPropertyList shapeProps;
- librevenge::RVNGPropertyListVector vec;
- auto const trafo = m_levelStack.top().m_trafo;
- auto const path = *shape->m_path * trafo;
- path.write(vec);
- shapeProps.insert("svg:d", vec);
- shapeProps.insert("text:anchor-type", "as-char");
- shapeProps.insert("style:vertical-pos", "bottom");
- shapeProps.insert("style:vertical-rel", "text");
- shapeProps.insert("style:run-through", "foreground");
- shapeProps.insert("style:wrap","run-through");
-
- auto &elements = m_outputManager.getCurrent();
- elements.addSetStyle(styleProps);
- elements.addDrawPath(shapeProps);
-
- if (bool(shape->m_text) && !shape->m_text->empty())
- {
- ETONYEK_DEBUG_MSG(("PAGCollector::drawShape: sorry sending text in a attachment is not implemented\n"));
- }
-}
-
void PAGCollector::drawMedia(const double x, const double y, const librevenge::RVNGPropertyList &data)
{
if (!data["office:binary-data"] || !data["librevenge:mime-type"])
@@ -359,10 +320,19 @@ void PAGCollector::drawMedia(const double x, const double y, const librevenge::R
void PAGCollector::fillShapeProperties(librevenge::RVNGPropertyList &props)
{
- props.insert("text:anchor-type", "page");
- props.insert("text:anchor-page-number", m_page);
- props.insert("style:vertical-pos", "from-top");
- props.insert("style:vertical-rel", "page");
+ if (m_inAttachments)
+ {
+ props.insert("text:anchor-type", "as-char");
+ props.insert("style:vertical-pos", "bottom");
+ props.insert("style:vertical-rel", "text");
+ }
+ else
+ {
+ props.insert("text:anchor-type", "page");
+ props.insert("text:anchor-page-number", m_page);
+ props.insert("style:vertical-pos", "from-top");
+ props.insert("style:vertical-rel", "page");
+ }
}
void PAGCollector::drawTextBox(const IWORKTextPtr_t &text, const glm::dmat3 &trafo, const IWORKGeometryPtr_t &boundingBox, const librevenge::RVNGPropertyList &style)
diff --git a/src/lib/PAGCollector.h b/src/lib/PAGCollector.h
index dddba3f..2cd5879 100644
--- a/src/lib/PAGCollector.h
+++ b/src/lib/PAGCollector.h
@@ -54,7 +54,6 @@ public:
PAGFootnoteKind getFootnoteKind() const;
private:
- void drawShape(const IWORKShapePtr_t &shape) override;
void drawTable() override;
void drawMedia(double x, double y, const librevenge::RVNGPropertyList &data) override;
void fillShapeProperties(librevenge::RVNGPropertyList &props) override;