[Libreoffice-commits] core.git: 2 commits - include/oox oox/source

Jan Holesovsky kendy at collabora.com
Mon Sep 16 08:05:16 PDT 2013


 include/oox/drawingml/shape.hxx              |    1 -
 oox/source/drawingml/shape.cxx               |    7 -------
 oox/source/ppt/extdrawingfragmenthandler.cxx |   13 ++++---------
 oox/source/ppt/extdrawingfragmenthandler.hxx |    1 -
 4 files changed, 4 insertions(+), 18 deletions(-)

New commits:
commit ba511f8002a2da521f06c3a6a0c60aa6de79d170
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Mon Sep 16 16:46:46 2013 +0200

    Related bnc#819614: Set the position and name immediately.
    
    Change-Id: I4c1046040f52e261004df95125b53e42dc8fca4b

diff --git a/oox/source/ppt/extdrawingfragmenthandler.cxx b/oox/source/ppt/extdrawingfragmenthandler.cxx
index 9fbf0a5..d2b892f 100644
--- a/oox/source/ppt/extdrawingfragmenthandler.cxx
+++ b/oox/source/ppt/extdrawingfragmenthandler.cxx
@@ -47,6 +47,9 @@ ExtDrawingFragmentHandler::onCreateContext( ::sal_Int32 aElement,
         break;
     case DSP_TOKEN( spTree ):
         mpShapePtr = oox::drawingml::ShapePtr( new PPTShape( meShapeLocation, "com.sun.star.drawing.GroupShape" ) );
+        mpShapePtr->setPosition( mpOrgShapePtr->getPosition() );
+        mpShapePtr->setName( mpOrgShapePtr->getName() );
+
         return new PPTShapeGroupContext(
                 *this, mpSlidePersistPtr, meShapeLocation, mpGroupShapePtr,
                 mpShapePtr );
@@ -56,14 +59,6 @@ ExtDrawingFragmentHandler::onCreateContext( ::sal_Int32 aElement,
 
     return this;
 }
-void SAL_CALL ExtDrawingFragmentHandler::endDocument() throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException)
-{
-    if( mpShapePtr )
-    {
-        mpShapePtr->setPosition( mpOrgShapePtr->getPosition() );
-        mpShapePtr->setName( mpOrgShapePtr->getName() );
-    }
-}
 
 } }
 
diff --git a/oox/source/ppt/extdrawingfragmenthandler.hxx b/oox/source/ppt/extdrawingfragmenthandler.hxx
index 0b186eb..8de27ef 100644
--- a/oox/source/ppt/extdrawingfragmenthandler.hxx
+++ b/oox/source/ppt/extdrawingfragmenthandler.hxx
@@ -30,7 +30,6 @@ public:
         oox::drawingml::ShapePtr pShapePtr ) throw();
     virtual ~ExtDrawingFragmentHandler() throw();
 
-    virtual void SAL_CALL endDocument() throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException) SAL_OVERRIDE;
     virtual ::oox::core::ContextHandlerRef onCreateContext( ::sal_Int32 Element, const AttributeList& rAttribs ) SAL_OVERRIDE;
 
 private:
commit 59373b753902f69cd44d183568b084429322e7ab
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Mon Sep 16 16:30:45 2013 +0200

    Related bnc#819614: The diagram is a group.
    
    It is not really desired to import diagrams broken into individual objects;
    makes trouble with the hieararchy, and also the user wants to see it as a
    group - can be ungrouped for modifications easily.
    
    Change-Id: I0533a69af9e377804bf0e06b2ce873fd0c9bde02

diff --git a/include/oox/drawingml/shape.hxx b/include/oox/drawingml/shape.hxx
index dbe17c1..95108e7 100644
--- a/include/oox/drawingml/shape.hxx
+++ b/include/oox/drawingml/shape.hxx
@@ -101,7 +101,6 @@ public:
 
     void                              setChildPosition( com::sun::star::awt::Point nPosition ){ maChPosition = nPosition; }
     void                              setChildSize( com::sun::star::awt::Size aSize ){ maChSize = aSize; }
-    void                              moveAllToPosition( const com::sun::star::awt::Point &rPoint );
 
     void                              setPosition( com::sun::star::awt::Point nPosition ){ maPosition = nPosition; }
     const com::sun::star::awt::Point& getPosition() const { return maPosition; }
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index d8d127a..44a43ff 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -665,13 +665,6 @@ TextBodyPtr Shape::getTextBody()
     return mpTextBody;
 }
 
-void Shape::moveAllToPosition( const awt::Point &rPoint )
-{
-    setPosition( awt::Point( rPoint.X + maPosition.X, rPoint.Y + maPosition.Y ) );
-    for( ::std::vector<ShapePtr>::const_iterator aIt = maChildren.begin(), aEnd = maChildren.end();aIt != aEnd; ++aIt )
-        (*aIt)->moveAllToPosition( rPoint );
-}
-
 void Shape::setMasterTextListStyle( const TextListStylePtr& pMasterTextListStyle )
 {
     SAL_INFO("oox.drawingml", OSL_THIS_FUNC << "set master text list style to shape id: " << msId);
diff --git a/oox/source/ppt/extdrawingfragmenthandler.cxx b/oox/source/ppt/extdrawingfragmenthandler.cxx
index e6d4b2f..9fbf0a5 100644
--- a/oox/source/ppt/extdrawingfragmenthandler.cxx
+++ b/oox/source/ppt/extdrawingfragmenthandler.cxx
@@ -48,7 +48,7 @@ ExtDrawingFragmentHandler::onCreateContext( ::sal_Int32 aElement,
     case DSP_TOKEN( spTree ):
         mpShapePtr = oox::drawingml::ShapePtr( new PPTShape( meShapeLocation, "com.sun.star.drawing.GroupShape" ) );
         return new PPTShapeGroupContext(
-                *this, mpSlidePersistPtr, meShapeLocation, mpSlidePersistPtr->getShapes(),
+                *this, mpSlidePersistPtr, meShapeLocation, mpGroupShapePtr,
                 mpShapePtr );
     default:
         break;
@@ -60,7 +60,7 @@ void SAL_CALL ExtDrawingFragmentHandler::endDocument() throw (::com::sun::star::
 {
     if( mpShapePtr )
     {
-        mpShapePtr->moveAllToPosition( mpOrgShapePtr->getPosition() );
+        mpShapePtr->setPosition( mpOrgShapePtr->getPosition() );
         mpShapePtr->setName( mpOrgShapePtr->getName() );
     }
 }


More information about the Libreoffice-commits mailing list