Kaydet (Commit) 91efe26d authored tarafından Miklos Vajna's avatar Miklos Vajna

DOCX drawingML shape import: initial wps:txbx handling

A proper textframe is created, but the text on the shape is still
outside the frame.

Change-Id: I042295cfdd61ce9c0ee52cdf5e8700d8d2b1b1c5
üst bb4cbfc1
...@@ -49,6 +49,9 @@ oox::core::ContextHandlerRef WpsContext::onCreateContext(sal_Int32 nElementToken ...@@ -49,6 +49,9 @@ oox::core::ContextHandlerRef WpsContext::onCreateContext(sal_Int32 nElementToken
break; break;
case XML_bodyPr: case XML_bodyPr:
break; break;
case XML_txbx:
mpShape->setServiceName("com.sun.star.text.TextFrame");
break;
default: default:
SAL_WARN("oox", "WpsContext::createFastChildContext: unhandled element:" << getBaseToken(nElementToken)); SAL_WARN("oox", "WpsContext::createFastChildContext: unhandled element:" << getBaseToken(nElementToken));
break; break;
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include <com/sun/star/graphic/XGraphicProvider.hpp> #include <com/sun/star/graphic/XGraphicProvider.hpp>
#include <com/sun/star/io/XInputStream.hpp> #include <com/sun/star/io/XInputStream.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/table/BorderLine2.hpp> #include <com/sun/star/table/BorderLine2.hpp>
#include <com/sun/star/text/GraphicCrop.hpp> #include <com/sun/star/text/GraphicCrop.hpp>
#include <com/sun/star/text/HoriOrientation.hpp> #include <com/sun/star/text/HoriOrientation.hpp>
...@@ -975,10 +976,13 @@ void GraphicImport::lcl_attribute(Id nName, Value & val) ...@@ -975,10 +976,13 @@ void GraphicImport::lcl_attribute(Id nName, Value & val)
(rPropNameSupplier.GetName(PROP_ANCHOR_TYPE), (rPropNameSupplier.GetName(PROP_ANCHOR_TYPE),
uno::makeAny uno::makeAny
(text::TextContentAnchorType_AS_CHARACTER)); (text::TextContentAnchorType_AS_CHARACTER));
xShapeProps->setPropertyValue
(rPropNameSupplier.GetName(PROP_TEXT_RANGE), uno::Reference<lang::XServiceInfo> xServiceInfo(m_xShape, uno::UNO_QUERY_THROW);
uno::makeAny if (!xServiceInfo->supportsService("com.sun.star.text.TextFrame"))
(m_pImpl->rDomainMapper.GetCurrentTextRange())); xShapeProps->setPropertyValue
(rPropNameSupplier.GetName(PROP_TEXT_RANGE),
uno::makeAny
(m_pImpl->rDomainMapper.GetCurrentTextRange()));
awt::Size aSize(m_xShape->getSize()); awt::Size aSize(m_xShape->getSize());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment