summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvo Hinkelmann <ihi@openoffice.org>2009-02-16 14:17:05 +0000
committerIvo Hinkelmann <ihi@openoffice.org>2009-02-16 14:17:05 +0000
commitcbe03baeca4bf6d9f6a70b5434369195f0a4574e (patch)
treee7cf19158a1709a8389e0177a37d52653f69ab9f
parentcc9e9eca7de843a0d5ee40ce54a682748b2cfd4f (diff)
CWS-TOOLING: integrate CWS hb14_OOO310
2009-01-23 10:08:45 +0100 os r266775 : #i90699# import text columns at start correctly 2009-01-21 16:36:51 +0100 hbrinkm r266686 : #i92625# new attribute StartToken 2009-01-21 16:29:07 +0100 hbrinkm r266684 : #i92625# XFastShapeContextHandler: new attribute StartToken 2009-01-21 16:26:19 +0100 hbrinkm r266683 : #i92625# compile error in debug code 2009-01-21 16:22:27 +0100 hbrinkm r266682 : #i92625# OOXMLFastContextHandlerShape::setToken 2009-01-21 16:18:17 +0100 hbrinkm r266680 : #i92625# OOXMLDocumentImpl::getSubStream: forward mxShapes to substream document 2009-01-05 12:34:38 +0100 hbrinkm r265864 : CWS-TOOLING: rebase CWS hb14 to trunk@265758 (milestone: DEV300:m38)
-rw-r--r--oox/source/shape/ShapeContextHandler.cxx71
-rw-r--r--oox/source/shape/ShapeContextHandler.hxx8
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.cxx15
-rw-r--r--writerfilter/source/ooxml/OOXMLDocumentImpl.cxx1
-rw-r--r--writerfilter/source/ooxml/OOXMLFastContextHandler.cxx8
-rw-r--r--writerfilter/source/ooxml/OOXMLFastContextHandler.hxx2
-rw-r--r--writerfilter/source/ooxml/OOXMLFastHelper.hxx2
7 files changed, 70 insertions, 37 deletions
diff --git a/oox/source/shape/ShapeContextHandler.cxx b/oox/source/shape/ShapeContextHandler.cxx
index fefaa5617..d10a7c93a 100644
--- a/oox/source/shape/ShapeContextHandler.cxx
+++ b/oox/source/shape/ShapeContextHandler.cxx
@@ -39,7 +39,7 @@ using namespace drawingml;
ShapeContextHandler::ShapeContextHandler
(uno::Reference< uno::XComponentContext > const & context) :
-m_xContext(context)
+mnStartToken(0), m_xContext(context)
{
try
{
@@ -57,16 +57,29 @@ ShapeContextHandler::~ShapeContextHandler()
}
uno::Reference<xml::sax::XFastContextHandler>
-ShapeContextHandler::getGraphicShapeContext()
+ShapeContextHandler::getGraphicShapeContext(::sal_Int32 Element )
{
if (! mxGraphicShapeContext.is())
{
FragmentHandlerRef rFragmentHandler
(new ShapeFragmentHandler(*mxFilterBase, msRelationFragmentPath));
ShapePtr pMasterShape;
- mpShape.reset(new Shape("com.sun.star.drawing.GraphicObjectShape" ));
- mxGraphicShapeContext.set
- (new GraphicShapeContext(*rFragmentHandler, pMasterShape, mpShape));
+
+ switch (Element & 0xffff)
+ {
+ case XML_graphic:
+ mpShape.reset(new Shape("com.sun.star.drawing.OLE2Shape" ));
+ mxGraphicShapeContext.set
+ (new GraphicalObjectFrameContext(*rFragmentHandler, pMasterShape, mpShape));
+ break;
+ case XML_pic:
+ mpShape.reset(new Shape("com.sun.star.drawing.GraphicObjectShape" ));
+ mxGraphicShapeContext.set
+ (new GraphicShapeContext(*rFragmentHandler, pMasterShape, mpShape));
+ break;
+ default:
+ break;
+ }
}
return mxGraphicShapeContext;
@@ -79,22 +92,28 @@ ShapeContextHandler::getDrawingShapeContext()
{
mpDrawing.reset( new oox::vml::Drawing() );
mxDrawingFragmentHandler.set
- (dynamic_cast<ContextHandler *>
- (new oox::vml::DrawingFragmentHandler
- ( *mxFilterBase, msRelationFragmentPath, mpDrawing->getShapes(), mpDrawing->getShapeTypes() )));
+ (dynamic_cast<ContextHandler *>
+ (new oox::vml::DrawingFragmentHandler
+ ( *mxFilterBase, msRelationFragmentPath, mpDrawing->getShapes(), mpDrawing->getShapeTypes() )));
}
-
+
return mxDrawingFragmentHandler;
}
-
+
uno::Reference<xml::sax::XFastContextHandler>
ShapeContextHandler::getContextHandler()
{
uno::Reference<xml::sax::XFastContextHandler> xResult;
- if (mxDrawingFragmentHandler.is())
- xResult.set(mxDrawingFragmentHandler);
- else if (mxGraphicShapeContext.is())
- xResult.set(mxGraphicShapeContext);
+
+ switch (mnStartToken & NMSP_MASK)
+ {
+ case NMSP_VML:
+ xResult.set(getDrawingShapeContext());
+ break;
+ default:
+ xResult.set(getGraphicShapeContext(mnStartToken));
+ break;
+ }
return xResult;
}
@@ -159,17 +178,7 @@ ShapeContextHandler::createFastChildContext
throw (uno::RuntimeException, xml::sax::SAXException)
{
uno::Reference< xml::sax::XFastContextHandler > xResult;
- uno::Reference< xml::sax::XFastContextHandler > xContextHandler;
-
- switch (Element & NMSP_MASK)
- {
- case NMSP_VML:
- xContextHandler.set(getDrawingShapeContext());
- break;
- default:
- xContextHandler.set(getGraphicShapeContext());
- break;
- }
+ uno::Reference< xml::sax::XFastContextHandler > xContextHandler(getContextHandler());
if (xContextHandler.is())
xResult.set(xContextHandler->createFastChildContext
@@ -287,6 +296,18 @@ void SAL_CALL ShapeContextHandler::setRelationFragmentPath
msRelationFragmentPath = the_value;
}
+::sal_Int32 SAL_CALL ShapeContextHandler::getStartToken() throw (::com::sun::star::uno::RuntimeException)
+{
+ return mnStartToken;
+}
+
+void SAL_CALL ShapeContextHandler::setStartToken( ::sal_Int32 _starttoken ) throw (::com::sun::star::uno::RuntimeException)
+{
+ mnStartToken = _starttoken;
+
+
+}
+
::rtl::OUString ShapeContextHandler::getImplementationName()
throw (css::uno::RuntimeException)
{
diff --git a/oox/source/shape/ShapeContextHandler.hxx b/oox/source/shape/ShapeContextHandler.hxx
index 9425f1b5b..386b438b0 100644
--- a/oox/source/shape/ShapeContextHandler.hxx
+++ b/oox/source/shape/ShapeContextHandler.hxx
@@ -160,11 +160,15 @@ public:
virtual void SAL_CALL setRelationFragmentPath
(const ::rtl::OUString & the_value)
throw (css::uno::RuntimeException);
-
+
+ virtual ::sal_Int32 SAL_CALL getStartToken() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setStartToken( ::sal_Int32 _starttoken ) throw (::com::sun::star::uno::RuntimeException);
private:
ShapeContextHandler(ShapeContextHandler &); // not defined
void operator =(ShapeContextHandler &); // not defined
+
+ ::sal_uInt32 mnStartToken;
css::uno::Reference< css::uno::XComponentContext > m_xContext;
drawingml::ShapePtr mpShape;
@@ -181,7 +185,7 @@ private:
css::uno::Reference<css::io::XInputStream> mxInputStream;
::rtl::OUString msRelationFragmentPath;
- css::uno::Reference<XFastContextHandler> getGraphicShapeContext();
+ css::uno::Reference<XFastContextHandler> getGraphicShapeContext(::sal_Int32 Element);
css::uno::Reference<XFastContextHandler> getDrawingShapeContext();
css::uno::Reference<XFastContextHandler> getContextHandler();
};
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 4c0d5c756..2d8acbcdb 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -487,15 +487,12 @@ void DomainMapper_Impl::PushProperties(ContextType eId)
{
if( m_bIsFirstSection )
m_bIsFirstSection = false;
- else
- {
- // beginning with the second section group a section has to be inserted
- // into the document
- SectionPropertyMap* pSectionContext_ = dynamic_cast< SectionPropertyMap* >( pInsert.get() );
- uno::Reference< text::XTextAppend > xTextAppend = m_aTextAppendStack.top().xTextAppend;
- if(xTextAppend.is())
- pSectionContext_->SetStart( xTextAppend->getEnd() );
- }
+ // beginning with the second section group a section has to be inserted
+ // into the document
+ SectionPropertyMap* pSectionContext_ = dynamic_cast< SectionPropertyMap* >( pInsert.get() );
+ uno::Reference< text::XTextAppend > xTextAppend = m_aTextAppendStack.top().xTextAppend;
+ if(xTextAppend.is())
+ pSectionContext_->SetStart( xTextAppend->getEnd() );
}
m_aPropertyStacks[eId].push( pInsert );
m_aContextStack.push(eId);
diff --git a/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx b/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx
index b032d7f5b..b22b25721 100644
--- a/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx
+++ b/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx
@@ -137,6 +137,7 @@ OOXMLDocumentImpl::getSubStream(const rtl::OUString & rId)
OOXMLDocumentImpl * pTemp;
writerfilter::Reference<Stream>::Pointer_t pRet( pTemp = new OOXMLDocumentImpl(pStream) );
pTemp->setModel(mxModel);
+ pTemp->setShapes(mxShapes);
return pRet;
}
diff --git a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
index 222978d6c..9895265e0 100644
--- a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
+++ b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
@@ -2023,6 +2023,14 @@ void SAL_CALL OOXMLFastContextHandlerShape::startUnknownElement
mrShapeContext->startUnknownElement(Namespace, Name, Attribs);
}
+void OOXMLFastContextHandlerShape::setToken(Token_t nToken)
+{
+ OOXMLFastContextHandler::setToken(nToken);
+
+ if (mrShapeContext.is())
+ mrShapeContext->setStartToken(nToken);
+}
+
void OOXMLFastContextHandlerShape::lcl_endFastElement
(Token_t Element)
throw (uno::RuntimeException, xml::sax::SAXException)
diff --git a/writerfilter/source/ooxml/OOXMLFastContextHandler.hxx b/writerfilter/source/ooxml/OOXMLFastContextHandler.hxx
index dc45603a8..33ad4b474 100644
--- a/writerfilter/source/ooxml/OOXMLFastContextHandler.hxx
+++ b/writerfilter/source/ooxml/OOXMLFastContextHandler.hxx
@@ -581,6 +581,8 @@ public:
const ::rtl::OUString & Name,
const uno::Reference< xml::sax::XFastAttributeList > & Attribs)
throw (uno::RuntimeException, xml::sax::SAXException);
+
+ virtual void setToken(Token_t nToken);
virtual ResourceEnum_t getResource() const { return SHAPE; }
protected:
diff --git a/writerfilter/source/ooxml/OOXMLFastHelper.hxx b/writerfilter/source/ooxml/OOXMLFastHelper.hxx
index b11d91dbf..f6920a989 100644
--- a/writerfilter/source/ooxml/OOXMLFastHelper.hxx
+++ b/writerfilter/source/ooxml/OOXMLFastHelper.hxx
@@ -83,7 +83,7 @@ OOXMLFastHelper<T>::createAndSetParent
#ifdef DEBUG_CREATE
debug_logger->startElement("createAndSetParent");
debug_logger->attribute("context", pHandler->getType());
- debug_logger->attribtue("token", fastTokenToId(pTmp->getToken()));
+ debug_logger->attribute("token", fastTokenToId(pTmp->getToken()));
debug_logger->attribute("id", (*QNameToString::Instance())(nId));
if (pTmp->isFallback())
debug_logger->attribute("fallback", "yes");