[Libreoffice-commits] core.git: Branch 'libreoffice-4-4' - sd/source

Caolán McNamara caolanm at redhat.com
Wed Apr 22 08:55:02 PDT 2015


 sd/source/filter/eppt/epptso.cxx |  348 ++++++++++++++++++++-------------------
 1 file changed, 181 insertions(+), 167 deletions(-)

New commits:
commit 7ceeb2fbab10701f3802eb26e6a30cbd743459fe
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Apr 22 12:07:27 2015 +0100

    fix re-export of novell590442-1.ppt to ppt
    
    we always open a container, so always close it
    
    the close container is inside the nRowCount != 0
    condition, so remove that and always write the close
    
    (cherry picked from commit 7aa166da24c81b7c22a0ec5daf7e09640ffb009b)
    
    Conflicts:
    	sd/source/filter/eppt/epptso.cxx
    
    fix re-export of novell590442-1.ppt to ppt
    
    we always close this container, even if we didn't open it
    
    original commit always opened the SpgrContainer, and always
    closed the SpgrContainer. (but seems to have a loophole, presumably
    never hit where the SpContainer could be opened and not closed)
    
    make a container guard which opens in ctor and closes in dtor.
    
    should make ppt export crash stats hit 0
    
    (cherry picked from commit deaed8aff6de824a76d939a02edb0d2ff4a4ccec)
    
    squash patch here is unreadable, but component parts are fairly
    trivial, remove nRowCount guard and unindent block, and then
    add in helper and use that to push/pop containers
    
    Change-Id: If05677ae46e8873b8780794bdd84f29505ea4112
    2aead7397448b674e433a4097c97285067a6dc6e
    Reviewed-on: https://gerrit.libreoffice.org/15478
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    Tested-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/sd/source/filter/eppt/epptso.cxx b/sd/source/filter/eppt/epptso.cxx
index 1082b6b..3c74ce6 100644
--- a/sd/source/filter/eppt/epptso.cxx
+++ b/sd/source/filter/eppt/epptso.cxx
@@ -3570,6 +3570,22 @@ void PPTWriter::WriteCString( SvStream& rSt, const OUString& rString, sal_uInt32
     }
 }
 
+class ContainerGuard
+{
+private:
+    PptEscherEx* m_pPptEscherEx;
+public:
+    ContainerGuard(PptEscherEx* pPptEscherEx, sal_uInt16 nRecord)
+        : m_pPptEscherEx(pPptEscherEx)
+    {
+        m_pPptEscherEx->OpenContainer(nRecord);
+    }
+    ~ContainerGuard()
+    {
+        m_pPptEscherEx->CloseContainer();
+    }
+};
+
 void PPTWriter::ImplCreateTable( uno::Reference< drawing::XShape >& rXShape, EscherSolverContainer& aSolverContainer,
                                 EscherPropertyContainer& aPropOpt )
 {
@@ -3617,8 +3633,8 @@ void PPTWriter::ImplCreateTable( uno::Reference< drawing::XShape >& rXShape, Esc
                 if ( y == nRowCount - 1 && nPosition != maRect.Bottom())
                     maRect.Bottom() = nPosition;
             }
-            mpPptEscherEx->OpenContainer( ESCHER_SpgrContainer );
-            mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
+            std::unique_ptr<ContainerGuard> xSpgrContainer(new ContainerGuard(mpPptEscherEx, ESCHER_SpgrContainer));
+            std::unique_ptr<ContainerGuard> xSpContainer(new ContainerGuard(mpPptEscherEx, ESCHER_SpContainer));
             mpPptEscherEx->AddAtom( 16, ESCHER_Spgr, 1 );
             mpStrm    ->WriteInt32( maRect.Left() ) // Bounding box for the grouped shapes to which they are attached
                        .WriteInt32( maRect.Top() )
@@ -3630,214 +3646,212 @@ void PPTWriter::ImplCreateTable( uno::Reference< drawing::XShape >& rXShape, Esc
             aSolverContainer.AddShape( rXShape, nShapeId );
             EscherPropertyContainer aPropOpt2;
 
-            if ( nRowCount )
-            {
-                SvMemoryStream aMemStrm;
-                aMemStrm.ObjectOwnsMemory( false );
-                aMemStrm.WriteUInt16( nRowCount )
-                        .WriteUInt16( nRowCount )
-                        .WriteUInt16( 4 );
-
-                std::vector< std::pair< sal_Int32, sal_Int32 > >::const_iterator aIter( aRows.begin() );
-                while( aIter != aRows.end() )
-                    aMemStrm.WriteInt32( (*aIter++).second );
-
-                aPropOpt.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x1000100 );
-                aPropOpt2.AddOpt( ESCHER_Prop_tableProperties, 1 );
-                aPropOpt2.AddOpt( ESCHER_Prop_tableRowProperties, true, aMemStrm.Tell(), static_cast< sal_uInt8* >( const_cast< void* >( aMemStrm.GetData() ) ), aMemStrm.Tell() );
-                aPropOpt.CreateShapeProperties( rXShape );
-                aPropOpt.Commit( *mpStrm );
-                aPropOpt2.Commit( *mpStrm, 3, ESCHER_UDefProp );
-                if ( GetCurrentGroupLevel() > 0 )
-                    mpPptEscherEx->AddChildAnchor( maRect );
-                else
-                    mpPptEscherEx->AddClientAnchor( maRect );
-                mpPptEscherEx->CloseContainer();
+            SvMemoryStream aMemStrm;
+            aMemStrm.ObjectOwnsMemory( false );
+            aMemStrm.WriteUInt16( nRowCount )
+                    .WriteUInt16( nRowCount )
+                    .WriteUInt16( 4 );
 
-                uno::Reference< table::XCellRange > xCellRange( xTable, uno::UNO_QUERY_THROW );
-                for( sal_Int32 nRow = 0; nRow < xRows->getCount(); nRow++ )
+            std::vector< std::pair< sal_Int32, sal_Int32 > >::const_iterator aIter( aRows.begin() );
+            while( aIter != aRows.end() )
+                aMemStrm.WriteInt32( (*aIter++).second );
+
+            aPropOpt.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x1000100 );
+            aPropOpt2.AddOpt( ESCHER_Prop_tableProperties, 1 );
+            aPropOpt2.AddOpt( ESCHER_Prop_tableRowProperties, true, aMemStrm.Tell(), static_cast< sal_uInt8* >( const_cast< void* >( aMemStrm.GetData() ) ), aMemStrm.Tell() );
+            aPropOpt.CreateShapeProperties( rXShape );
+            aPropOpt.Commit( *mpStrm );
+            aPropOpt2.Commit( *mpStrm, 3, ESCHER_UDefProp );
+            if ( GetCurrentGroupLevel() > 0 )
+                mpPptEscherEx->AddChildAnchor( maRect );
+            else
+                mpPptEscherEx->AddClientAnchor( maRect );
+            xSpContainer.reset(); //ESCHER_SpContainer
+
+            uno::Reference< table::XCellRange > xCellRange( xTable, uno::UNO_QUERY_THROW );
+            for( sal_Int32 nRow = 0; nRow < xRows->getCount(); nRow++ )
+            {
+                for( sal_Int32 nColumn = 0; nColumn < xColumns->getCount(); nColumn++ )
                 {
-                    for( sal_Int32 nColumn = 0; nColumn < xColumns->getCount(); nColumn++ )
+                    uno::Reference< table::XMergeableCell > xCell( xCellRange->getCellByPosition( nColumn, nRow ), uno::UNO_QUERY_THROW );
+                    if ( !xCell->isMerged() )
                     {
-                        uno::Reference< table::XMergeableCell > xCell( xCellRange->getCellByPosition( nColumn, nRow ), uno::UNO_QUERY_THROW );
-                        if ( !xCell->isMerged() )
-                        {
-                            sal_Int32 nLeft   = aColumns[ nColumn ].first;
-                            sal_Int32 nTop    = aRows[ nRow ].first;
-                            sal_Int32 nRight  = GetCellRight( nColumn, maRect,aColumns,xCell );
-                            sal_Int32 nBottom = GetCellBottom( nRow,  maRect,aRows,xCell );
-
-                            mbFontIndependentLineSpacing = false;
-                            mXPropSet = uno::Reference< beans::XPropertySet >( xCell, uno::UNO_QUERY_THROW );
-                            mXText = uno::Reference< text::XSimpleText >( xCell, uno::UNO_QUERY_THROW );
-                            mnTextSize = mXText->getString().getLength();
+                        sal_Int32 nLeft   = aColumns[ nColumn ].first;
+                        sal_Int32 nTop    = aRows[ nRow ].first;
+                        sal_Int32 nRight  = GetCellRight( nColumn, maRect,aColumns,xCell );
+                        sal_Int32 nBottom = GetCellBottom( nRow,  maRect,aRows,xCell );
+
+                        mbFontIndependentLineSpacing = false;
+                        mXPropSet = uno::Reference< beans::XPropertySet >( xCell, uno::UNO_QUERY_THROW );
+                        mXText = uno::Reference< text::XSimpleText >( xCell, uno::UNO_QUERY_THROW );
+                        mnTextSize = mXText->getString().getLength();
 
-                            ::com::sun::star::uno::Any aAny;
-                            if ( GetPropertyValue( aAny, mXPropSet, OUString( "FontIndependentLineSpacing" ) ), sal_True )
-                                aAny >>= mbFontIndependentLineSpacing;
+                        ::com::sun::star::uno::Any aAny;
+                        if ( GetPropertyValue( aAny, mXPropSet, OUString( "FontIndependentLineSpacing" ) ), sal_True )
+                            aAny >>= mbFontIndependentLineSpacing;
 
-                            EscherPropertyContainer aPropOptSp;
-                            mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
-                            ImplCreateShape( ESCHER_ShpInst_Rectangle, 0xa02, aSolverContainer );          // Flags: Connector | HasSpt | Child
-                            aPropOptSp.CreateFillProperties( mXPropSet, true );
-                            aPropOptSp.AddOpt( ESCHER_Prop_fNoLineDrawDash, 0x90000 );
-                            aPropOptSp.CreateTextProperties( mXPropSet, mnTxId += 0x60, false, true );
-                            aPropOptSp.AddOpt( ESCHER_Prop_WrapText, ESCHER_WrapSquare );
+                        EscherPropertyContainer aPropOptSp;
+                        std::unique_ptr<ContainerGuard> xCellContainer(new ContainerGuard(mpPptEscherEx, ESCHER_SpContainer));
+                        ImplCreateShape( ESCHER_ShpInst_Rectangle, 0xa02, aSolverContainer );          // Flags: Connector | HasSpt | Child
+                        aPropOptSp.CreateFillProperties( mXPropSet, true );
+                        aPropOptSp.AddOpt( ESCHER_Prop_fNoLineDrawDash, 0x90000 );
+                        aPropOptSp.CreateTextProperties( mXPropSet, mnTxId += 0x60, false, true );
+                        aPropOptSp.AddOpt( ESCHER_Prop_WrapText, ESCHER_WrapSquare );
 
-                            SvMemoryStream aClientTextBox( 0x200, 0x200 );
-                            SvMemoryStream  aExtBu( 0x200, 0x200 );
+                        SvMemoryStream aClientTextBox( 0x200, 0x200 );
+                        SvMemoryStream  aExtBu( 0x200, 0x200 );
 
-                            ImplWriteTextStyleAtom( aClientTextBox, EPP_TEXTTYPE_Other, 0, NULL, aExtBu, &aPropOptSp );
+                        ImplWriteTextStyleAtom( aClientTextBox, EPP_TEXTTYPE_Other, 0, NULL, aExtBu, &aPropOptSp );
 
-                            // need write client data for extend bullet
-                            if ( aExtBu.Tell() )
-                            {
-                                SvMemoryStream* pClientData = new SvMemoryStream( 0x200, 0x200 );
-                                ImplProgTagContainer( pClientData, &aExtBu );
-                                mpStrm->WriteUInt32( ( ( ESCHER_ClientData << 16 ) | 0xf ) )
-                                   .WriteUInt32( pClientData->Tell() );
+                        // need write client data for extend bullet
+                        if ( aExtBu.Tell() )
+                        {
+                            SvMemoryStream* pClientData = new SvMemoryStream( 0x200, 0x200 );
+                            ImplProgTagContainer( pClientData, &aExtBu );
+                            mpStrm->WriteUInt32( ( ( ESCHER_ClientData << 16 ) | 0xf ) )
+                               .WriteUInt32( pClientData->Tell() );
 
-                                mpStrm->Write( pClientData->GetData(), pClientData->Tell() );
-                                delete pClientData, pClientData = NULL;
-                            }
+                            mpStrm->Write( pClientData->GetData(), pClientData->Tell() );
+                            delete pClientData, pClientData = NULL;
+                        }
 
-                            aPropOptSp.Commit( *mpStrm );
-                            mpPptEscherEx->AddAtom( 16, ESCHER_ChildAnchor );
-                            mpStrm    ->WriteInt32( nLeft )
-                               .WriteInt32( nTop )
-                               .WriteInt32( nRight )
-                               .WriteInt32( nBottom );
+                        aPropOptSp.Commit( *mpStrm );
+                        mpPptEscherEx->AddAtom( 16, ESCHER_ChildAnchor );
+                        mpStrm    ->WriteInt32( nLeft )
+                           .WriteInt32( nTop )
+                           .WriteInt32( nRight )
+                           .WriteInt32( nBottom );
 
-                            mpStrm->WriteUInt32( ( ( ESCHER_ClientTextbox << 16 ) | 0xf ) )
-                               .WriteUInt32( aClientTextBox.Tell() );
+                        mpStrm->WriteUInt32( ( ( ESCHER_ClientTextbox << 16 ) | 0xf ) )
+                           .WriteUInt32( aClientTextBox.Tell() );
 
-                            mpStrm->Write( aClientTextBox.GetData(), aClientTextBox.Tell() );
-                            mpPptEscherEx->CloseContainer();
-                        }
+                        mpStrm->Write( aClientTextBox.GetData(), aClientTextBox.Tell() );
+                        xCellContainer.reset();
                     }
                 }
+            }
 
-                static const char sTopBorder[] = "TopBorder";
-                static const char sBottomBorder[] = "BottomBorder";
-                static const char sLeftBorder[] = "LeftBorder";
-                static const char sRightBorder[] = "RightBorder";
+            static const char sTopBorder[] = "TopBorder";
+            static const char sBottomBorder[] = "BottomBorder";
+            static const char sLeftBorder[] = "LeftBorder";
+            static const char sRightBorder[] = "RightBorder";
 
-                // creating horz lines
-                for( sal_Int32 nLine = 0; nLine < ( xRows->getCount() + 1 ); nLine++ )
+            // creating horz lines
+            for( sal_Int32 nLine = 0; nLine < ( xRows->getCount() + 1 ); nLine++ )
+            {
+                for( sal_Int32 nColumn = 0; nColumn < xColumns->getCount(); nColumn++ )
                 {
-                    for( sal_Int32 nColumn = 0; nColumn < xColumns->getCount(); nColumn++ )
-                    {
-                        CellBorder aCellBorder;
-                        aCellBorder.mnPos = aColumns[ nColumn ].first;
-                        aCellBorder.mnLength = aColumns[ nColumn ].second;
-                        bool bTop = false;
-                        //write nLine*nColumn cell's top border
-                        if ( nLine < xRows->getCount() )
-                        {   // top border
-                            uno::Reference< table::XMergeableCell > xCell( xCellRange->getCellByPosition( nColumn, nLine ), uno::UNO_QUERY_THROW );
-                            if ( !xCell->isMerged()  )
-                            {
-                                uno::Reference< beans::XPropertySet > xPropSet2( xCell, uno::UNO_QUERY_THROW );
-                                table::BorderLine aBorderLine;
-                                if ( xPropSet2->getPropertyValue( sTopBorder ) >>= aBorderLine )
-                                    aCellBorder.maCellBorder = aBorderLine;
-                                sal_Int32 nRight  = GetCellRight( nColumn, maRect,aColumns,xCell );
-                                bTop = ImplCreateCellBorder( &aCellBorder, aCellBorder.mnPos,
-                                    aRows[ nLine ].first, nRight,  aRows[ nLine ].first );
-                            }
+                    CellBorder aCellBorder;
+                    aCellBorder.mnPos = aColumns[ nColumn ].first;
+                    aCellBorder.mnLength = aColumns[ nColumn ].second;
+                    bool bTop = false;
+                    //write nLine*nColumn cell's top border
+                    if ( nLine < xRows->getCount() )
+                    {   // top border
+                        uno::Reference< table::XMergeableCell > xCell( xCellRange->getCellByPosition( nColumn, nLine ), uno::UNO_QUERY_THROW );
+                        if ( !xCell->isMerged()  )
+                        {
+                            uno::Reference< beans::XPropertySet > xPropSet2( xCell, uno::UNO_QUERY_THROW );
+                            table::BorderLine aBorderLine;
+                            if ( xPropSet2->getPropertyValue( sTopBorder ) >>= aBorderLine )
+                                aCellBorder.maCellBorder = aBorderLine;
+                            sal_Int32 nRight  = GetCellRight( nColumn, maRect,aColumns,xCell );
+                            bTop = ImplCreateCellBorder( &aCellBorder, aCellBorder.mnPos,
+                                aRows[ nLine ].first, nRight,  aRows[ nLine ].first );
                         }
+                    }
 
-                        //if nLine*nColumn cell's top border is empty, check (nLine-1)*nColumn cell's bottom border
-                        //and write the last row's bottom border
-                        if (( nLine && !bTop ) || (nLine == xRows->getCount()))
-                        {   // bottom border
-                            sal_Int32 nRow =  nLine;
+                    //if nLine*nColumn cell's top border is empty, check (nLine-1)*nColumn cell's bottom border
+                    //and write the last row's bottom border
+                    if (( nLine && !bTop ) || (nLine == xRows->getCount()))
+                    {   // bottom border
+                        sal_Int32 nRow =  nLine;
 
-                            while( nRow )
-                            {   //find last no merged cell
-                                uno::Reference< table::XMergeableCell > xCell( xCellRange->getCellByPosition( nColumn, nRow - 1 ), uno::UNO_QUERY_THROW );
-                                if ( !xCell->isMerged()  )
+                        while( nRow )
+                        {   //find last no merged cell
+                            uno::Reference< table::XMergeableCell > xCell( xCellRange->getCellByPosition( nColumn, nRow - 1 ), uno::UNO_QUERY_THROW );
+                            if ( !xCell->isMerged()  )
+                            {
+                                sal_Int32 nRight  = GetCellRight( nColumn,  maRect,aColumns,xCell );
+                                sal_Int32 nBottom = GetCellBottom( nRow - 1, maRect,aRows,xCell );
+                                if ( nBottom == ( aRows[ nLine-1 ].first + aRows[ nLine-1 ].second ) )
                                 {
-                                    sal_Int32 nRight  = GetCellRight( nColumn,  maRect,aColumns,xCell );
-                                    sal_Int32 nBottom = GetCellBottom( nRow - 1, maRect,aRows,xCell );
-                                    if ( nBottom == ( aRows[ nLine-1 ].first + aRows[ nLine-1 ].second ) )
-                                    {
-                                        uno::Reference< table::XMergeableCell > xCellOwn( xCellRange->getCellByPosition( nColumn, nRow - 1 ), uno::UNO_QUERY_THROW );
-                                        uno::Reference< beans::XPropertySet > xPropSet2( xCellOwn, uno::UNO_QUERY_THROW );
-                                        table::BorderLine aBorderLine;
-                                        if ( xPropSet2->getPropertyValue( sBottomBorder ) >>= aBorderLine )
-                                            aCellBorder.maCellBorder = aBorderLine;
-                                        ImplCreateCellBorder( &aCellBorder, aCellBorder.mnPos,
-                                            nBottom, nRight, nBottom);
-                                    }
-                                    nRow=0;
+                                    uno::Reference< table::XMergeableCell > xCellOwn( xCellRange->getCellByPosition( nColumn, nRow - 1 ), uno::UNO_QUERY_THROW );
+                                    uno::Reference< beans::XPropertySet > xPropSet2( xCellOwn, uno::UNO_QUERY_THROW );
+                                    table::BorderLine aBorderLine;
+                                    if ( xPropSet2->getPropertyValue( sBottomBorder ) >>= aBorderLine )
+                                        aCellBorder.maCellBorder = aBorderLine;
+                                    ImplCreateCellBorder( &aCellBorder, aCellBorder.mnPos,
+                                        nBottom, nRight, nBottom);
                                 }
-                                else
-                                    nRow--;
+                                nRow=0;
                             }
+                            else
+                                nRow--;
                         }
                     }
                 }
+            }
 
-                // creating vertical lines
-                for( sal_Int32 nLine = 0; nLine < ( xColumns->getCount() + 1 ); nLine++ )
+            // creating vertical lines
+            for( sal_Int32 nLine = 0; nLine < ( xColumns->getCount() + 1 ); nLine++ )
+            {
+                for( sal_Int32 nRow = 0; nRow < xRows->getCount(); nRow++ )
                 {
-                    for( sal_Int32 nRow = 0; nRow < xRows->getCount(); nRow++ )
-                    {
 
-                        CellBorder aCellBorder;
-                        aCellBorder.mnPos = aRows[ nRow].first;
-                        aCellBorder.mnLength = aRows[ nRow].second;
-                        bool bLeft = false;
-                        if ( nLine < xColumns->getCount() )
-                        {   // left border
-                            uno::Reference< table::XMergeableCell > xCell( xCellRange->getCellByPosition( nLine, nRow ), uno::UNO_QUERY_THROW );
-                            if (!xCell->isMerged() )
-                            {
-                                uno::Reference< beans::XPropertySet > xCellSet( xCell, uno::UNO_QUERY_THROW );
-                                table::BorderLine aBorderLine;
-                                if ( xCellSet->getPropertyValue( sLeftBorder ) >>= aBorderLine )
-                                    aCellBorder.maCellBorder = aBorderLine;
-                                sal_Int32 nBottom = GetCellBottom( nRow, maRect, aRows,xCell );
-                                bLeft = ImplCreateCellBorder( &aCellBorder, aColumns[nLine].first, aCellBorder.mnPos,
-                                    aColumns[nLine].first, nBottom );
-                            }
+                    CellBorder aCellBorder;
+                    aCellBorder.mnPos = aRows[ nRow].first;
+                    aCellBorder.mnLength = aRows[ nRow].second;
+                    bool bLeft = false;
+                    if ( nLine < xColumns->getCount() )
+                    {   // left border
+                        uno::Reference< table::XMergeableCell > xCell( xCellRange->getCellByPosition( nLine, nRow ), uno::UNO_QUERY_THROW );
+                        if (!xCell->isMerged() )
+                        {
+                            uno::Reference< beans::XPropertySet > xCellSet( xCell, uno::UNO_QUERY_THROW );
+                            table::BorderLine aBorderLine;
+                            if ( xCellSet->getPropertyValue( sLeftBorder ) >>= aBorderLine )
+                                aCellBorder.maCellBorder = aBorderLine;
+                            sal_Int32 nBottom = GetCellBottom( nRow, maRect, aRows,xCell );
+                            bLeft = ImplCreateCellBorder( &aCellBorder, aColumns[nLine].first, aCellBorder.mnPos,
+                                aColumns[nLine].first, nBottom );
                         }
-                        if ( ( nLine && !bLeft )||(nLine == xColumns->getCount()))
-                        {   // right border
-                            sal_Int32 nColumn = nLine;
-                            while ( nColumn )
+                    }
+                    if ( ( nLine && !bLeft )||(nLine == xColumns->getCount()))
+                    {   // right border
+                        sal_Int32 nColumn = nLine;
+                        while ( nColumn )
+                        {
+                            uno::Reference< table::XMergeableCell > xCell( xCellRange->getCellByPosition( nColumn - 1, nRow ), uno::UNO_QUERY_THROW );
+                            if (!xCell->isMerged() )
                             {
-                                uno::Reference< table::XMergeableCell > xCell( xCellRange->getCellByPosition( nColumn - 1, nRow ), uno::UNO_QUERY_THROW );
-                                if (!xCell->isMerged() )
+                                sal_Int32 nRight  = GetCellRight( nColumn-1, maRect, aColumns,xCell );
+                                sal_Int32 nBottom = GetCellBottom( nRow,   maRect, aRows, xCell );
+                                if ( nRight == (aColumns[nLine-1].first + aColumns[nLine-1].second) )
                                 {
-                                    sal_Int32 nRight  = GetCellRight( nColumn-1, maRect, aColumns,xCell );
-                                    sal_Int32 nBottom = GetCellBottom( nRow,   maRect, aRows, xCell );
-                                    if ( nRight == (aColumns[nLine-1].first + aColumns[nLine-1].second) )
-                                    {
-                                        uno::Reference< table::XMergeableCell > xCellOwn( xCellRange->getCellByPosition( nColumn - 1, nRow ), uno::UNO_QUERY_THROW );
-                                        uno::Reference< beans::XPropertySet > xCellSet( xCellOwn, uno::UNO_QUERY_THROW );
-                                        table::BorderLine aBorderLine;
-                                        if ( xCellSet->getPropertyValue( sRightBorder ) >>= aBorderLine )
-                                            aCellBorder.maCellBorder = aBorderLine;
-                                        ImplCreateCellBorder( &aCellBorder, nRight, aCellBorder.mnPos,
-                                            nRight,  nBottom );
-                                    }
-                                    nColumn = 0;
+                                    uno::Reference< table::XMergeableCell > xCellOwn( xCellRange->getCellByPosition( nColumn - 1, nRow ), uno::UNO_QUERY_THROW );
+                                    uno::Reference< beans::XPropertySet > xCellSet( xCellOwn, uno::UNO_QUERY_THROW );
+                                    table::BorderLine aBorderLine;
+                                    if ( xCellSet->getPropertyValue( sRightBorder ) >>= aBorderLine )
+                                        aCellBorder.maCellBorder = aBorderLine;
+                                    ImplCreateCellBorder( &aCellBorder, nRight, aCellBorder.mnPos,
+                                        nRight,  nBottom );
                                 }
-                                else
-                                    nColumn --;
+                                nColumn = 0;
                             }
+                            else
+                                nColumn --;
                         }
                     }
                 }
             }
+
+            xSpgrContainer.reset(); //ESCHER_SpgrContainer
         }
     }
     catch( uno::Exception& )
     {
     }
-    mpPptEscherEx->CloseContainer();
 }
 
 void TextObjBinary::Write( SvStream* pStrm )


More information about the Libreoffice-commits mailing list