@@ -280,45 +280,6 @@ void PAGCollector::drawTable()
280280 openGroup ();
281281}
282282
283- void PAGCollector::drawShape (const IWORKShapePtr_t &shape)
284- {
285- if (!m_inAttachment)
286- return IWORKCollector::drawShape (shape);
287-
288- if (!bool (shape) || !bool (shape->m_path ))
289- {
290- ETONYEK_DEBUG_MSG ((" PAGCollector::drawShape: can not find the shape\n " ));
291- return ;
292- }
293-
294- librevenge::RVNGPropertyList styleProps;
295- if (bool (shape->m_style ))
296- fillGraphicProps (shape->m_style , styleProps, true , false );
297- if (shape->m_locked ) // CHECKME: maybe also content
298- styleProps.insert (" style:protect" , " position size" );
299-
300- librevenge::RVNGPropertyList shapeProps;
301- librevenge::RVNGPropertyListVector vec;
302- auto const trafo = m_levelStack.top ().m_trafo ;
303- auto const path = *shape->m_path * trafo;
304- path.write (vec);
305- shapeProps.insert (" svg:d" , vec);
306- shapeProps.insert (" text:anchor-type" , " as-char" );
307- shapeProps.insert (" style:vertical-pos" , " bottom" );
308- shapeProps.insert (" style:vertical-rel" , " text" );
309- shapeProps.insert (" style:run-through" , " foreground" );
310- shapeProps.insert (" style:wrap" ," run-through" );
311-
312- auto &elements = m_outputManager.getCurrent ();
313- elements.addSetStyle (styleProps);
314- elements.addDrawPath (shapeProps);
315-
316- if (bool (shape->m_text ) && !shape->m_text ->empty ())
317- {
318- ETONYEK_DEBUG_MSG ((" PAGCollector::drawShape: sorry sending text in a attachment is not implemented\n " ));
319- }
320- }
321-
322283void PAGCollector::drawMedia (const double x, const double y, const librevenge::RVNGPropertyList &data)
323284{
324285 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
359320
360321void PAGCollector::fillShapeProperties (librevenge::RVNGPropertyList &props)
361322{
362- props.insert (" text:anchor-type" , " page" );
363- props.insert (" text:anchor-page-number" , m_page);
364- props.insert (" style:vertical-pos" , " from-top" );
365- props.insert (" style:vertical-rel" , " page" );
323+ if (m_inAttachments)
324+ {
325+ props.insert (" text:anchor-type" , " as-char" );
326+ props.insert (" style:vertical-pos" , " bottom" );
327+ props.insert (" style:vertical-rel" , " text" );
328+ }
329+ else
330+ {
331+ props.insert (" text:anchor-type" , " page" );
332+ props.insert (" text:anchor-page-number" , m_page);
333+ props.insert (" style:vertical-pos" , " from-top" );
334+ props.insert (" style:vertical-rel" , " page" );
335+ }
366336}
367337
368338void PAGCollector::drawTextBox (const IWORKTextPtr_t &text, const glm::dmat3 &trafo, const IWORKGeometryPtr_t &boundingBox, const librevenge::RVNGPropertyList &style)
0 commit comments