[Libreoffice-commits] core.git: 7 commits - chart2/source external/boost sfx2/source sw/source

Michael Stahl mstahl at redhat.com
Fri May 2 15:59:22 PDT 2014


 chart2/source/controller/main/ChartController.cxx                      |   10 
 external/boost/UnpackedTarball_boost.mk                                |    2 
 external/boost/boost.multi_array.Wshadow.warnings.patch                |  494 ----------
 external/boost/boost.multi_array.Wshadow.warnings.patch.2              |   37 
 external/boost/boost.multi_array.Wunused-local-typedefs.warnings.patch |    8 
 sfx2/source/doc/SfxDocumentMetaData.cxx                                |    6 
 sw/source/core/doc/docglos.cxx                                         |    3 
 sw/source/core/edit/acorrect.cxx                                       |    3 
 sw/source/core/edit/edglss.cxx                                         |   11 
 sw/source/core/uibase/uno/unoatxt.cxx                                  |    2 
 sw/source/core/undo/undel.cxx                                          |   20 
 sw/source/core/undo/untbl.cxx                                          |   33 
 sw/source/filter/ww8/ww8glsy.cxx                                       |    2 
 13 files changed, 103 insertions(+), 528 deletions(-)

New commits:
commit 41062189f78990f7aa42949484b58de64b0dce79
Author: Michael Stahl <mstahl at redhat.com>
Date:   Sat May 3 00:36:33 2014 +0200

    SfxDocumentMetaData: suppress some spurious warnings
    
    These always trigger on a new document.
    
    Change-Id: Ied60f52c4dc348b2b18f6dc8c30204ee3dc56f29

diff --git a/sfx2/source/doc/SfxDocumentMetaData.cxx b/sfx2/source/doc/SfxDocumentMetaData.cxx
index d21a85c..0eb060b 100644
--- a/sfx2/source/doc/SfxDocumentMetaData.cxx
+++ b/sfx2/source/doc/SfxDocumentMetaData.cxx
@@ -525,7 +525,7 @@ textToDateOrDateTime(css::util::Date & io_rd, css::util::DateTime & io_rdt,
                 &io_rd, io_rdt, o_rIsDateTime, &o_rTimeZone, i_text)) {
         return true;
     } else {
-        SAL_WARN("sfx.doc", "Invalid date: " << i_text );
+        SAL_WARN_IF(!i_text.isEmpty(), "sfx.doc", "Invalid date: " << i_text);
         return false;
     }
 }
@@ -537,7 +537,7 @@ textToDateTime(css::util::DateTime & io_rdt, const OUString& i_text) throw ()
     if (::sax::Converter::parseDateTime(io_rdt, 0, i_text)) {
         return true;
     } else {
-        SAL_INFO("sfx.doc", "Invalid date: " << i_text);
+        SAL_WARN_IF(!i_text.isEmpty(), "sfx.doc", "Invalid date: " << i_text);
         return false;
     }
 }
@@ -589,7 +589,7 @@ throw ()
     if (::sax::Converter::convertDuration(io_rDur, i_rText)) {
         return true;
     } else {
-        SAL_WARN("sfx.doc", "Invalid duration: " << i_rText );
+        SAL_WARN_IF(!i_rText.isEmpty(), "sfx.doc", "Invalid duration: " << i_rText);
         return false;
     }
 }
commit 5f982c22ff6d9354975cfd43aacedf7835418df0
Author: Michael Stahl <mstahl at redhat.com>
Date:   Sat May 3 00:32:22 2014 +0200

    SwUndoSplitTbl::UndoImpl(): avoid assert from ~SwIndexReg
    
    Can be triggered by moving view cursor into new paragraph before Undo.
    
    Change-Id: I8386611a8eabd1c3b6edfacd0226358df52cbe66

diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx
index f6377c9..bfdcb55 100644
--- a/sw/source/core/undo/untbl.cxx
+++ b/sw/source/core/undo/untbl.cxx
@@ -2873,12 +2873,23 @@ void SwUndoSplitTbl::UndoImpl(::sw::UndoRedoContext & rContext)
     SwDoc *const pDoc = & rContext.GetDoc();
     SwPaM *const pPam(& rContext.GetCursorSupplier().CreateNewShellCursor());
 
-    pPam->DeleteMark();
     SwNodeIndex& rIdx = pPam->GetPoint()->nNode;
     rIdx = nTblNode + nOffset;
+    pPam->GetPoint()->nContent.Assign(rIdx.GetNode().GetCntntNode(), 0);
+    assert(rIdx.GetNode().GetCntntNode()->Len() == 0); // empty para inserted
+
+    {
+        // avoid asserts from ~SwIndexReg
+        SwNodeIndex const idx(pDoc->GetNodes(), nTblNode + nOffset);
+        {
+            SwPaM pam(idx);
+            pam.Move(fnMoveBackward, fnGoCntnt);
+            ::PaMCorrAbs(*pPam, *pam.GetPoint());
+        }
 
-    // remove implicitly created paragraph again
-    pDoc->GetNodes().Delete( rIdx, 1 );
+        // remove implicitly created paragraph again
+        pDoc->GetNodes().Delete( idx, 1 );
+    }
 
     rIdx = nTblNode + nOffset;
     SwTableNode* pTblNd = rIdx.GetNode().GetTableNode();
commit bc0c939270a45469b8f22008288b5e4a4d9c9861
Author: Michael Stahl <mstahl at redhat.com>
Date:   Fri May 2 15:51:22 2014 +0200

    fdo#57197: sw: fix crash on Undo of table row/column insert
    
    The _SaveTable::CreateNew() will call _FndBox::DelFrms() but at that
    point the SwTableBoxes have already been deleted; so do that earlier.
    
    Change-Id: I868c8fffbddeb1ea6df724fb68cac732eeee2eba

diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx
index 9fd3331..f6377c9 100644
--- a/sw/source/core/undo/untbl.cxx
+++ b/sw/source/core/undo/untbl.cxx
@@ -1689,7 +1689,7 @@ void SwUndoTblNdsChg::UndoImpl(::sw::UndoRedoContext & rContext)
     // ? TL_CHART2: notification or locking of controller required ?
 
     SwChartDataProvider *pPCD = rDoc.GetChartDataProvider();
-    std::vector< SwTableBox* > aDelBoxes;
+    SwSelBoxes aDelBoxes;
     if( IsDelBox() )
     {
         // Trick: add missing boxes in any line, they will be connected
@@ -1712,7 +1712,7 @@ void SwUndoTblNdsChg::UndoImpl(::sw::UndoRedoContext & rContext)
     }
     else if( !pNewSttNds->empty() )
     {
-        // Than the nodes have be moved and not deleted!
+        // Then the nodes have be moved and not deleted!
         // But for that we need a temp array.
         std::vector<_BoxMove> aTmp( pNewSttNds->begin(), pNewSttNds->end() );
 
@@ -1729,6 +1729,10 @@ void SwUndoTblNdsChg::UndoImpl(::sw::UndoRedoContext & rContext)
             if (pPCD)
                 pPCD->DeleteBox( &pTblNd->GetTable(), *pBox );
 
+            // insert _before_ deleting the section - otherwise the box
+            // has no start node so all boxes sort equal in SwSelBoxes
+            aDelBoxes.insert(pBox);
+
             if( aTmp[n].hasMoved )
             {
                 SwNodeRange aRg( *pBox->GetSttNd(), 1,
@@ -1755,7 +1759,6 @@ void SwUndoTblNdsChg::UndoImpl(::sw::UndoRedoContext & rContext)
                 pBox->RemoveFromTable();
                 rDoc.DeleteSection( rDoc.GetNodes()[ nIdx ] );
             }
-            aDelBoxes.insert( aDelBoxes.end(), pBox );
         }
     }
     else
@@ -1770,11 +1773,16 @@ void SwUndoTblNdsChg::UndoImpl(::sw::UndoRedoContext & rContext)
             // TL_CHART2: notify chart about box to be removed
             if (pPCD)
                 pPCD->DeleteBox( &pTblNd->GetTable(), *pBox );
+            aDelBoxes.insert(pBox);
             pBox->RemoveFromTable(); // ~SwTableBox would access pBox->pSttNd
-            aDelBoxes.insert( aDelBoxes.end(), pBox );
             rDoc.DeleteSection( rDoc.GetNodes()[ nIdx ] );
         }
     }
+
+    // fdo#57197: before deleting the SwTableBoxes, delete the SwTabFrms
+    aTmpBox.SetTableLines(aDelBoxes, pTblNd->GetTable());
+    aTmpBox.DelFrms(pTblNd->GetTable());
+
     // Remove boxes from table structure
     for( sal_uInt16 n = 0; n < aDelBoxes.size(); ++n )
     {
commit 45cb8e3d1eb8a5eb20f8fd9c61ba78e5546bd15e
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Apr 30 21:45:06 2014 +0200

    sw: hypothetical crashes if last node is not SwTxtNode
    
    Change-Id: I16c476ae83d01ea23891af36fd4bcca4e8992228

diff --git a/sw/source/core/doc/docglos.cxx b/sw/source/core/doc/docglos.cxx
index 4b2538e..c706208 100644
--- a/sw/source/core/doc/docglos.cxx
+++ b/sw/source/core/doc/docglos.cxx
@@ -140,7 +140,8 @@ bool SwDoc::InsertGlossary( SwTextBlocks& rBlock, const OUString& rEntry,
             // till the nodes array's end
             aCpyPam.GetPoint()->nNode = pGDoc->GetNodes().GetEndOfContent().GetIndex()-1;
             pCntntNd = aCpyPam.GetCntntNode();
-            aCpyPam.GetPoint()->nContent.Assign( pCntntNd, pCntntNd->Len() );
+            aCpyPam.GetPoint()->nContent.Assign(
+                    pCntntNd, (pCntntNd) ? pCntntNd->Len() : 0 );
 
             GetIDocumentUndoRedo().StartUndo( UNDO_INSGLOSSARY, NULL );
             SwPaM *_pStartCrsr = &rPaM, *__pStartCrsr = _pStartCrsr;
diff --git a/sw/source/core/edit/acorrect.cxx b/sw/source/core/edit/acorrect.cxx
index d21ba64..20ee723 100644
--- a/sw/source/core/edit/acorrect.cxx
+++ b/sw/source/core/edit/acorrect.cxx
@@ -369,7 +369,8 @@ bool SwAutoCorrDoc::ChgAutoCorrWord( sal_Int32& rSttPos, sal_Int32 nEndPos,
                 // then until the end of the Nodes Array
                 aCpyPam.GetPoint()->nNode.Assign( pAutoDoc->GetNodes().GetEndOfContent(), -1 );
                 pCntntNd = aCpyPam.GetCntntNode();
-                aCpyPam.GetPoint()->nContent.Assign( pCntntNd, pCntntNd->Len() );
+                aCpyPam.GetPoint()->nContent.Assign(
+                       pCntntNd, (pCntntNd) ? pCntntNd->Len() : 0);
 
                 SwDontExpandItem aExpItem;
                 aExpItem.SaveDontExpandItems( *aPam.GetPoint() );
diff --git a/sw/source/core/edit/edglss.cxx b/sw/source/core/edit/edglss.cxx
index 6e23c62..7a17737 100644
--- a/sw/source/core/edit/edglss.cxx
+++ b/sw/source/core/edit/edglss.cxx
@@ -138,7 +138,8 @@ sal_uInt16 SwEditShell::SaveGlossaryDoc( SwTextBlocks& rBlock,
             // then until the end of the nodes array
             aCpyPam.GetPoint()->nNode = pMyDoc->GetNodes().GetEndOfContent().GetIndex()-1;
             pCntntNd = aCpyPam.GetCntntNode();
-            aCpyPam.GetPoint()->nContent.Assign( pCntntNd, pCntntNd->Len() );
+            aCpyPam.GetPoint()->nContent.Assign(
+                   pCntntNd, (pCntntNd) ? pCntntNd->Len() : 0);
 
             aStt = pGDoc->GetNodes().GetEndOfExtras();
             pCntntNd = pGDoc->GetNodes().GoNext( &aStt );
@@ -160,8 +161,9 @@ bool SwEditShell::_CopySelToDoc( SwDoc* pInsDoc, SwNodeIndex* pSttNd )
     SwNodes& rNds = pInsDoc->GetNodes();
 
     SwNodeIndex aIdx( rNds.GetEndOfContent(), -1 );
-    SwCntntNode * pNd = aIdx.GetNode().GetCntntNode();
-    SwPosition aPos( aIdx, SwIndex( pNd, pNd->Len() ));
+    SwCntntNode *const pContentNode = aIdx.GetNode().GetCntntNode();
+    SwPosition aPos( aIdx,
+        SwIndex(pContentNode, (pContentNode) ? pContentNode->Len() : 0));
 
     // Should the index be reset to start?
     if( pSttNd )
@@ -216,7 +218,8 @@ bool SwEditShell::_CopySelToDoc( SwDoc* pInsDoc, SwNodeIndex* pSttNd )
 
             if( !PCURCRSR->HasMark() )
             {
-                if( 0 != (pNd = PCURCRSR->GetCntntNode()) &&
+                SwCntntNode *const pNd = PCURCRSR->GetCntntNode();
+                if (0 != pNd &&
                     ( bColSel || !pNd->GetTxtNode() ) )
                 {
                     PCURCRSR->SetMark();
diff --git a/sw/source/core/uibase/uno/unoatxt.cxx b/sw/source/core/uibase/uno/unoatxt.cxx
index 438e250..4c31e13 100644
--- a/sw/source/core/uibase/uno/unoatxt.cxx
+++ b/sw/source/core/uibase/uno/unoatxt.cxx
@@ -325,7 +325,7 @@ static bool lcl_CopySelToDoc( SwDoc* pInsDoc, OTextCursorHelper* pxCursor, SwXTe
 
     SwNodeIndex aIdx( rNds.GetEndOfContent(), -1 );
     SwCntntNode * pNd = aIdx.GetNode().GetCntntNode();
-    SwPosition aPos( aIdx, SwIndex( pNd, pNd->Len() ));
+    SwPosition aPos(aIdx, SwIndex(pNd, (pNd) ? pNd->Len() : 0));
 
     bool bRet = false;
     pInsDoc->LockExpFlds();
diff --git a/sw/source/filter/ww8/ww8glsy.cxx b/sw/source/filter/ww8/ww8glsy.cxx
index 64a4e3c..1ed667c 100644
--- a/sw/source/filter/ww8/ww8glsy.cxx
+++ b/sw/source/filter/ww8/ww8glsy.cxx
@@ -167,7 +167,7 @@ bool WW8Glossary::MakeEntries(SwDoc *pD, SwTextBlocks &rBlocks,
                     SwNodeIndex aIdx( pGlDoc->GetNodes().GetEndOfContent(),
                         -1 );
                     pCNd = aIdx.GetNode().GetCntntNode();
-                    SwPosition aPos( aIdx, SwIndex( pCNd, pCNd->Len() ));
+                    SwPosition aPos(aIdx, SwIndex(pCNd, (pCNd) ? pCNd->Len() : 0));
                     pD->CopyRange( aPam, aPos, false );
                     rBlocks.PutDoc();
                 }
commit e06131e96629eee4e94eba1da7242380716e8e88
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Apr 30 15:11:02 2014 +0200

    SwUndoDelete::RedoImpl(): avoid assert from ~SwIndexReg
    
    1. insert header
    2. insert table in header
    3. put cursor in bottom right cell
    4. Ctrl+Shift+Delete
    5. Undo
    6. Redo
    
    Problem is that the shell cursors never get corrected in step 6.
    Replace the previous hacky after-the-fact fixup of rPam only with call
    to PaMCorrAbs.  [there does not appear to be any other case than
    bDelFullPara where this branch is taken, which make the next one look
    kind of weird?]
    
    Change-Id: If3583f83e66fff4d3367a1532e443aed780a5e6c

diff --git a/sw/source/core/undo/undel.cxx b/sw/source/core/undo/undel.cxx
index bd2a559..839550e 100644
--- a/sw/source/core/undo/undel.cxx
+++ b/sw/source/core/undo/undel.cxx
@@ -113,13 +113,12 @@ SwUndoDelete::SwUndoDelete(
     bBackSp( false ),
     bJoinNext( false ),
     bTblDelLastNd( false ),
+    // bFullPara is set e.g. if an empty paragraph before a table is deleted
     bDelFullPara( bFullPara ),
     bResetPgDesc( false ),
     bResetPgBrk( false ),
     bFromTableCopy( bCalledByTblCpy )
 {
-    // bFullPara is set e.g. if an empty paragraph before a table is deleted
-    bDelFullPara = bFullPara;
 
     bCacheComment = false;
 
@@ -1043,15 +1042,20 @@ void SwUndoDelete::RedoImpl(::sw::UndoRedoContext & rContext)
             pTblNd->DelFrms();
         }
 
-        rPam.SetMark();
+        // avoid asserts from ~SwIndexReg for deleted nodes
+        SwPaM aTmp(*rPam.End());
+        if (!aTmp.Move(fnMoveForward, fnGoNode))
+        {
+            *aTmp.GetPoint() = *rPam.Start();
+            aTmp.Move(fnMoveBackward, fnGoNode);
+        }
+        assert(aTmp.GetPoint()->nNode != rPam.GetPoint()->nNode
+            && aTmp.GetPoint()->nNode != rPam.GetMark()->nNode);
+        ::PaMCorrAbs(rPam, *aTmp.GetPoint());
+
         rPam.DeleteMark();
 
         rDoc.GetNodes().Delete( aSttIdx, nEndNode - nSttNode );
-
-        // always set the cursor into a ContentNode!
-        if( !rPam.Move( fnMoveBackward, fnGoCntnt ) &&
-            !rPam.Move( fnMoveForward, fnGoCntnt ) )
-            rPam.GetPoint()->nContent.Assign( rPam.GetCntntNode(), 0 );
     }
     else if( bDelFullPara )
     {
commit ba54eca1817e84a1f1d1beec312ca87b8b059649
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Apr 30 15:09:57 2014 +0200

    boost: replace multi_array Wshadow patch with different one
    
    ... based on upstream feedback.
    
    Change-Id: I846287d62d3b53f4a3d3013c9f82fd77d22a9523

diff --git a/external/boost/UnpackedTarball_boost.mk b/external/boost/UnpackedTarball_boost.mk
index 8af8c36..ffaf0b6 100644
--- a/external/boost/UnpackedTarball_boost.mk
+++ b/external/boost/UnpackedTarball_boost.mk
@@ -40,7 +40,7 @@ boost_patches += boost.math.Wunused-local-typedefs.warnings.patch
 # https://svn.boost.org/trac/boost/ticket/9885
 boost_patches += boost.multi_array.C4510.warnings.patch
 # https://svn.boost.org/trac/boost/ticket/9886
-boost_patches += boost.multi_array.Wshadow.warnings.patch
+boost_patches += boost.multi_array.Wshadow.warnings.patch.2
 # https://svn.boost.org/trac/boost/ticket/9887
 boost_patches += boost.multi_array.Wundef.warnings.patch
 # https://svn.boost.org/trac/boost/ticket/9888
diff --git a/external/boost/boost.multi_array.Wshadow.warnings.patch b/external/boost/boost.multi_array.Wshadow.warnings.patch
deleted file mode 100644
index 6617786..0000000
--- a/external/boost/boost.multi_array.Wshadow.warnings.patch
+++ /dev/null
@@ -1,494 +0,0 @@
---- misc/boost_1_44_0/boost/multi_array/concept_checks.hpp	2012-01-12 20:21:29.790009198 +0000
-+++ misc/build/boost_1_44_0/boost/multi_array/concept_checks.hpp	2012-01-12 20:29:56.482879277 +0000
-@@ -39,8 +39,8 @@
- 
-     template <typename Array, typename IdxGen, typename Call_Type>
-     static void call(Array& a, const IdxGen& idgen, Call_Type c) {
--      typedef typename Array::index_range index_range;
--      typedef typename Array::index index;
-+      typedef typename Array::index_range index_range_;
-+      typedef typename Array::index index_;
-       idgen_helper<N-1>::call(a,idgen[c],c);
-     }
-   };
-@@ -50,8 +50,8 @@
- 
-     template <typename Array, typename IdxGen, typename Call_Type>
-     static void call(Array& a, const IdxGen& idgen, Call_Type) {
--      typedef typename Array::index_range index_range;
--      typedef typename Array::index index;
-+      typedef typename Array::index_range index_range_;
-+      typedef typename Array::index index_;
-       a[ idgen ];
-     }
-   };
-@@ -153,27 +153,27 @@
-       const_constraints(a);
-     }
- 
--    void const_constraints(const Array& a) {
-+    void const_constraints(const Array& a_) {
- 
-       //      value_type vt = a[ id ];
- 
-       // Test slicing, keeping only the first dimension, losing the rest
--      detail::idgen_helper<NumDims-1>::call(a,idgen[range],id);
-+      detail::idgen_helper<NumDims-1>::call(a_,idgen[range],id);
- 
-       // Test slicing, keeping all dimensions.
--      detail::idgen_helper<NumDims-1>::call(a,idgen[range],range);
-+      detail::idgen_helper<NumDims-1>::call(a_,idgen[range],range);
- 
--      st = a.size();
--      st = a.num_dimensions();
--      st = a.num_elements();
--      stp = a.shape();
--      idp = a.strides();
--      idp = a.index_bases();
--      cit = a.begin();
--      cit = a.end();
--      crit = a.rbegin();
--      crit = a.rend();
--      eltp = a.origin();
-+      st = a_.size();
-+      st = a_.num_dimensions();
-+      st = a_.num_elements();
-+      stp = a_.shape();
-+      idp = a_.strides();
-+      idp = a_.index_bases();
-+      cit = a_.begin();
-+      cit = a_.end();
-+      crit = a_.rbegin();
-+      crit = a_.rend();
-+      eltp = a_.origin();
-     }
- 
-     typedef typename Array::value_type value_type;
---- misc/boost_1_44_0/boost/multi_array/extent_range.hpp	2012-01-12 20:21:29.790009198 +0000
-+++ misc/build/boost_1_44_0/boost/multi_array/extent_range.hpp	2012-01-12 20:32:16.696241748 +0000
-@@ -26,11 +26,11 @@
-   typedef Extent index;
-   typedef SizeType size_type;
- 
--  extent_range(index start, index finish) :
--    super_type(start,finish) { }
-+  extent_range(index start_, index finish_) :
-+    super_type(start_,finish_) { }
- 
--  extent_range(index finish) :
--    super_type(0,finish) { }
-+  extent_range(index finish_) :
-+    super_type(0,finish_) { }
- 
-   extent_range() : super_type(0,0) { }
- 
---- misc/boost_1_44_0/boost/multi_array/index_range.hpp	2012-01-12 20:21:29.790009198 +0000
-+++ misc/build/boost_1_44_0/boost/multi_array/index_range.hpp	2012-01-12 20:31:29.405781105 +0000
-@@ -60,8 +60,8 @@
-       degenerate_ = true;
-     }
- 
--    explicit index_range(index start, index finish, index stride=1)
--      : start_(start), finish_(finish), stride_(stride),
-+    explicit index_range(index i_start, index i_finish, index i_stride=1)
-+      : start_(i_start), finish_(i_finish), stride_(i_stride),
-         degenerate_(false)
-     { }
- 
-@@ -107,11 +107,11 @@
- 
-     index stride() const { return stride_; }
- 
--    void set_index_range(index start, index finish, index stride=1)
-+    void set_index_range(index i_start, index i_finish, index i_stride=1)
-     {
--      start_ = start;
--      finish_ = finish;
--      stride_ = stride;
-+      start_ = i_start;
-+      finish_ = i_finish;
-+      stride_ = i_stride;
-     }
- 
-     static index_range all() 
---- misc/boost_1_44_0/boost/multi_array/multi_array_ref.hpp	2012-01-12 20:21:29.790009198 +0000
-+++ misc/build/boost_1_44_0/boost/multi_array/multi_array_ref.hpp	2012-01-12 20:25:49.280492556 +0000
-@@ -86,24 +86,24 @@
-       num_elements_(other.num_elements_)  {  }
- 
-   template <typename ExtentList>
--  explicit const_multi_array_ref(TPtr base, const ExtentList& extents) :
-+  explicit const_multi_array_ref(TPtr base, const ExtentList& extents_) :
-     base_(base), storage_(c_storage_order()) {
-     boost::function_requires<
-       CollectionConcept<ExtentList> >();
- 
-     index_base_list_.assign(0);
--    init_multi_array_ref(extents.begin());
-+    init_multi_array_ref(extents_.begin());
-   }
-   
-   template <typename ExtentList>
--  explicit const_multi_array_ref(TPtr base, const ExtentList& extents,
-+  explicit const_multi_array_ref(TPtr base, const ExtentList& extents_,
-                        const general_storage_order<NumDims>& so) : 
-     base_(base), storage_(so) {
-     boost::function_requires<
-       CollectionConcept<ExtentList> >();
- 
-     index_base_list_.assign(0);
--    init_multi_array_ref(extents.begin());
-+    init_multi_array_ref(extents_.begin());
-   }
-   
-   explicit const_multi_array_ref(TPtr base,
-@@ -124,13 +124,13 @@
-   }
-   
-   template <class InputIterator>
--  void assign(InputIterator begin, InputIterator end) {
-+  void assign(InputIterator begin_, InputIterator end_) {
-     boost::function_requires<InputIteratorConcept<InputIterator> >();
- 
--    InputIterator in_iter = begin;
-+    InputIterator in_iter = begin_;
-     T* out_iter = base_;
-     std::size_t copy_count=0;
--    while (in_iter != end && copy_count < num_elements_) {
-+    while (in_iter != end_ && copy_count < num_elements_) {
-       *out_iter++ = *in_iter++;
-       copy_count++;      
-     }
-@@ -161,14 +161,14 @@
-   }
- 
-   template <typename SizeList>
--  void reshape(const SizeList& extents) {
-+  void reshape(const SizeList& extents_) {
-     boost::function_requires<
-       CollectionConcept<SizeList> >();
-     BOOST_ASSERT(num_elements_ ==
--                 std::accumulate(extents.begin(),extents.end(),
-+                 std::accumulate(extents_.begin(),extents_.end(),
-                                  size_type(1),std::multiplies<size_type>()));
- 
--    std::copy(extents.begin(),extents.end(),extent_list_.begin());
-+    std::copy(extents_.begin(),extents_.end(),extent_list_.begin());
-     this->compute_strides(stride_list_,extent_list_,storage_);
- 
-     origin_offset_ =
-@@ -208,11 +208,11 @@
-   }
- 
-   template <typename IndexList>
--  const element& operator()(IndexList indices) const {
-+  const element& operator()(IndexList indices_) const {
-     boost::function_requires<
-       CollectionConcept<IndexList> >();
-     return super_type::access_element(boost::type<const element&>(),
--                                      indices,origin(),
-+                                      indices_,origin(),
-                                       shape(),strides(),index_bases());
-   }
- 
-@@ -231,12 +231,12 @@
- #endif // BOOST_MSVC
-   typename const_array_view<NDims>::type 
-   operator[](const detail::multi_array::
--             index_gen<NumDims,NDims>& indices)
-+             index_gen<NumDims,NDims>& indices_)
-     const {
-     typedef typename const_array_view<NDims>::type return_type;
-     return
-       super_type::generate_array_view(boost::type<return_type>(),
--                                      indices,
-+                                      indices_,
-                                       shape(),
-                                       strides(),
-                                       index_bases(),
-@@ -327,20 +327,20 @@
-   explicit
-   const_multi_array_ref(TPtr base,
-                         const storage_order_type& so,
--                        const index * index_bases,
-+                        const index * index_bases_,
--                        const size_type* extents) :
-+                        const size_type* extents_) :
-     base_(base), storage_(so), origin_offset_(0), directional_offset_(0)
-  {
--   // If index_bases or extents is null, then initialize the corresponding
-+   // If index_bases_ or extents_ is null, then initialize the corresponding
-    // private data to zeroed lists.
--   if(index_bases) {
-+   if(index_bases_) {
-      boost::detail::multi_array::
--       copy_n(index_bases,NumDims,index_base_list_.begin());
-+       copy_n(index_bases_,NumDims,index_base_list_.begin());
-    } else {
-      std::fill_n(index_base_list_.begin(),NumDims,0);
-    }
--   if(extents) {
--     init_multi_array_ref(extents);
-+   if(extents_) {
-+     init_multi_array_ref(extents_);
-    } else {
-      boost::array<index,NumDims> extent_list;
-      extent_list.assign(0);
-@@ -374,12 +374,12 @@
-               boost::mem_fun_ref(&extent_range::start));
- 
-     // calculate the extents
--    extent_list extents;
-+    extent_list extents_;
-     std::transform(ranges.ranges_.begin(),ranges.ranges_.end(),
--              extents.begin(),
-+              extents_.begin(),
-               boost::mem_fun_ref(&extent_range::size));
- 
--    init_multi_array_ref(extents.begin());
-+    init_multi_array_ref(extents_.begin());
-   }
- 
- 
-@@ -445,16 +445,16 @@
-   };
- 
-   template <class ExtentList>
--  explicit multi_array_ref(T* base, const ExtentList& extents) :
--    super_type(base,extents) {
-+  explicit multi_array_ref(T* base, const ExtentList& extents_) :
-+    super_type(base,extents_) {
-     boost::function_requires<
-       CollectionConcept<ExtentList> >();
-   }
- 
-   template <class ExtentList>
--  explicit multi_array_ref(T* base, const ExtentList& extents,
-+  explicit multi_array_ref(T* base, const ExtentList& extents_,
-                            const general_storage_order<NumDims>& so) :
--    super_type(base,extents,so) {
-+    super_type(base,extents_,so) {
-     boost::function_requires<
-       CollectionConcept<ExtentList> >();
-   }
-@@ -509,11 +509,11 @@
-   element* data() { return super_type::base_; }
- 
-   template <class IndexList>
--  element& operator()(const IndexList& indices) {
-+  element& operator()(const IndexList& indices_) {
-     boost::function_requires<
-       CollectionConcept<IndexList> >();
-     return super_type::access_element(boost::type<element&>(),
--                                      indices,origin(),
-+                                      indices_,origin(),
-                                       this->shape(),this->strides(),
-                                       this->index_bases());
-   }
-@@ -535,11 +535,11 @@
- #endif // BOOST_MSVC
-   typename array_view<NDims>::type 
-   operator[](const detail::multi_array::
--             index_gen<NumDims,NDims>& indices) {
-+             index_gen<NumDims,NDims>& indices_) {
-     typedef typename array_view<NDims>::type return_type;
-     return
-       super_type::generate_array_view(boost::type<return_type>(),
--                                      indices,
-+                                      indices_,
-                                       this->shape(),
-                                       this->strides(),
-                                       this->index_bases(),
-@@ -576,10 +576,10 @@
-   const element* data() const { return super_type::data(); }
- 
-   template <class IndexList>
--  const element& operator()(const IndexList& indices) const {
-+  const element& operator()(const IndexList& indices_) const {
-     boost::function_requires<
-       CollectionConcept<IndexList> >();
--    return super_type::operator()(indices);
-+    return super_type::operator()(indices_);
-   }
- 
-   const_reference operator[](index idx) const {
-@@ -597,9 +597,9 @@
- #endif // BOOST_MSVC
-   typename const_array_view<NDims>::type 
-   operator[](const detail::multi_array::
--             index_gen<NumDims,NDims>& indices)
-+             index_gen<NumDims,NDims>& indices_)
-     const {
--    return super_type::operator[](indices);
-+    return super_type::operator[](indices_);
-   }
-   
-   const_iterator begin() const {
-@@ -622,9 +622,9 @@
-   // This is only supplied to support multi_array's default constructor
-   explicit multi_array_ref(T* base,
-                            const storage_order_type& so,
--                           const index* index_bases,
--                           const size_type* extents) :
--    super_type(base,so,index_bases,extents) { }
-+                           const index* index_bases_,
-+                           const size_type* extents_) :
-+    super_type(base,so,index_bases_,extents_) { }
- 
- };
- 
---- misc/boost_1_44_0/boost/multi_array/storage_order.hpp	2012-01-12 20:21:29.790009198 +0000
-+++ misc/build/boost_1_44_0/boost/multi_array/storage_order.hpp	2012-01-12 20:30:57.667472937 +0000
-@@ -34,10 +34,10 @@
-   public:
-     typedef detail::multi_array::size_type size_type;
-     template <typename OrderingIter, typename AscendingIter>
--    general_storage_order(OrderingIter ordering,
--                          AscendingIter ascending) {
--      boost::detail::multi_array::copy_n(ordering,NumDims,ordering_.begin());
--      boost::detail::multi_array::copy_n(ascending,NumDims,ascending_.begin());
-+    general_storage_order(OrderingIter i_ordering,
-+                          AscendingIter i_ascending) {
-+      boost::detail::multi_array::copy_n(i_ordering,NumDims,ordering_.begin());
-+      boost::detail::multi_array::copy_n(i_ascending,NumDims,ascending_.begin());
-     }
- 
-     // RG - ideally these would not be necessary, but some compilers
---- misc/boost_1_44_0/boost/multi_array/subarray.hpp	2012-01-12 20:21:29.790009198 +0000
-+++ misc/build/boost_1_44_0/boost/multi_array/subarray.hpp	2012-01-12 20:27:12.346292228 +0000
-@@ -181,9 +181,9 @@
- 
-   const_sub_array (TPtr base,
-                  const size_type* extents,
--                 const index* strides,
-+                 const index* i_strides,
-                  const index* index_base) :
--    base_(base), extents_(extents), strides_(strides),
-+    base_(base), extents_(extents), strides_(i_strides),
-     index_base_(index_base) {
-   }
-
-@@ -369,9 +369,9 @@
- 
-   sub_array (T* base,
-             const size_type* extents,
--            const index* strides,
-+            const index* _strides,
-             const index* index_base) :
--    super_type(base,extents,strides,index_base) {
-+    super_type(base,extents,_strides,index_base) {
-   }
- 
- };
---- misc/boost_1_44_0/boost/multi_array/view.hpp	2012-01-12 20:21:29.790009198 +0000
-+++ misc/build/boost_1_44_0/boost/multi_array/view.hpp	2012-01-12 20:26:36.350945110 +0000
-@@ -231,7 +231,7 @@
-   template <typename ExtentList, typename Index>
-   explicit const_multi_array_view(TPtr base,
-                            const ExtentList& extents,
--                           const boost::array<Index,NumDims>& strides): 
-+                           const boost::array<Index,NumDims>& strides_):
-     base_(base), origin_offset_(0) {
- 
-     index_base_list_.assign(0);
-@@ -240,7 +240,7 @@
-     boost::detail::multi_array::
-       copy_n(extents.begin(),NumDims,extent_list_.begin());
-     boost::detail::multi_array::
--      copy_n(strides.begin(),NumDims,stride_list_.begin());
-+      copy_n(strides_.begin(),NumDims,stride_list_.begin());
- 
-     // Calculate the array size
-     num_elements_ = std::accumulate(extent_list_.begin(),extent_list_.end(),
-@@ -441,8 +441,8 @@
-   template <typename ExtentList, typename Index>
-   explicit multi_array_view(T* base,
-                             const ExtentList& extents,
--                            const boost::array<Index,NumDims>& strides) :
--    super_type(base,extents,strides) { }
-+                            const boost::array<Index,NumDims>& _strides) :
-+    super_type(base,extents,_strides) { }
- 
- };
- 
---- misc/boost_1_44_0/boost/multi_array.hpp	2012-09-28 13:06:44.796521371 +0100
-+++ misc/build/boost_1_44_0/boost/multi_array.hpp	2012-09-28 13:07:25.119002500 +0100
-@@ -139,20 +139,20 @@
- 
-   explicit multi_array() :
-     super_type((T*)initial_base_,c_storage_order(),
--               /*index_bases=*/0, /*extents=*/0) {
-+               /*index_bases=*/0, /*extents_=*/0) {
-     allocate_space(); 
-   }
- 
-   template <class ExtentList>
-   explicit multi_array(
--      ExtentList const& extents
-+      ExtentList const& extents_
- #ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
-       , typename mpl::if_<
-       detail::multi_array::is_multi_array_impl<ExtentList>,
-       int&,int>::type* = 0
- #endif
-       ) :
--    super_type((T*)initial_base_,extents) {
-+    super_type((T*)initial_base_,extents_) {
-     boost::function_requires<
-       detail::multi_array::CollectionConcept<ExtentList> >();
-     allocate_space();
-@@ -160,19 +160,19 @@
- 
-     
-   template <class ExtentList>
--  explicit multi_array(ExtentList const& extents,
-+  explicit multi_array(ExtentList const& extents_,
-                        const general_storage_order<NumDims>& so) :
--    super_type((T*)initial_base_,extents,so) {
-+    super_type((T*)initial_base_,extents_,so) {
-     boost::function_requires<
-       detail::multi_array::CollectionConcept<ExtentList> >();
-     allocate_space();
-   }
- 
-   template <class ExtentList>
--  explicit multi_array(ExtentList const& extents,
-+  explicit multi_array(ExtentList const& extents_,
-                        const general_storage_order<NumDims>& so,
-                        Allocator const& alloc) :
--    super_type((T*)initial_base_,extents,so), allocator_(alloc) {
-+    super_type((T*)initial_base_,extents_,so), allocator_(alloc) {
-     boost::function_requires<
-       detail::multi_array::CollectionConcept<ExtentList> >();
-     allocate_space();
-@@ -381,7 +381,7 @@
- 
- 
-   template <typename ExtentList>
--  multi_array& resize(const ExtentList& extents) {
-+  multi_array& resize(const ExtentList& extents_) {
-     boost::function_requires<
-       detail::multi_array::CollectionConcept<ExtentList> >();
- 
-@@ -390,7 +390,7 @@
- 
-     for (int i=0; i != NumDims; ++i) {
-       typedef typename gen_type::range range_type;
--      ranges.ranges_[i] = range_type(0,extents[i]);
-+      ranges.ranges_[i] = range_type(0,extents_[i]);
-     }
-     
-     return this->resize(ranges);
-@@ -423,9 +423,9 @@
-     // Build index_gen objects to create views with the same shape
- 
-     // these need to be separate to handle non-zero index bases
--    typedef detail::multi_array::index_gen<NumDims,NumDims> index_gen;
--    index_gen old_idxes;
--    index_gen new_idxes;
-+    typedef detail::multi_array::index_gen<NumDims,NumDims> lcl_index_gen;
-+    lcl_index_gen old_idxes;
-+    lcl_index_gen new_idxes;
- 
-     std::transform(new_array.index_base_list_.begin(),
-                    new_array.index_base_list_.end(),
diff --git a/external/boost/boost.multi_array.Wshadow.warnings.patch.2 b/external/boost/boost.multi_array.Wshadow.warnings.patch.2
new file mode 100644
index 0000000..c73a3d1
--- /dev/null
+++ b/external/boost/boost.multi_array.Wshadow.warnings.patch.2
@@ -0,0 +1,37 @@
+From d28b2bc733d85b0bb194f395375f2a460b9be00d Mon Sep 17 00:00:00 2001
+From: Michael Stahl <mstahl at redhat.com>
+Date: Wed, 30 Apr 2014 12:27:55 +0200
+Subject: [PATCH] multi_array: suppress GCC -Wshadow warnings (fixes: #9886)
+
+---
+ include/boost/multi_array.hpp | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/include/boost/multi_array.hpp b/include/boost/multi_array.hpp
+index 8193699..72b2294 100644
+--- a/include/boost/multi_array.hpp
++++ b/include/boost/multi_array.hpp
+@@ -18,6 +18,11 @@
+ // declaration and definition
+ //
+ 
++#if defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) >= 406)
++#  pragma GCC diagnostic push
++#  pragma GCC diagnostic ignored "-Wshadow"
++#endif
++
+ #include "boost/multi_array/base.hpp"
+ #include "boost/multi_array/collection_concept.hpp"
+ #include "boost/multi_array/copy_array.hpp"
+@@ -496,4 +501,8 @@ private:
+ 
+ } // namespace boost
+ 
++#if defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) >= 406)
++#  pragma GCC diagnostic pop
++#endif
++
+ #endif // BOOST_MULTI_ARRAY_RG071801_HPP
+-- 
+1.8.3.1
+
diff --git a/external/boost/boost.multi_array.Wunused-local-typedefs.warnings.patch b/external/boost/boost.multi_array.Wunused-local-typedefs.warnings.patch
index 22645cc..b0be548 100644
--- a/external/boost/boost.multi_array.Wunused-local-typedefs.warnings.patch
+++ b/external/boost/boost.multi_array.Wunused-local-typedefs.warnings.patch
@@ -4,8 +4,8 @@
  
      template <typename Array, typename IdxGen, typename Call_Type>
      static void call(Array& a, const IdxGen& idgen, Call_Type c) {
--      typedef typename Array::index_range index_range_;
--      typedef typename Array::index index_;
+-      typedef typename Array::index_range index_range;
+-      typedef typename Array::index index;
        idgen_helper<N-1>::call(a,idgen[c],c);
      }
    };
@@ -13,8 +13,8 @@
  
      template <typename Array, typename IdxGen, typename Call_Type>
      static void call(Array& a, const IdxGen& idgen, Call_Type) {
--      typedef typename Array::index_range index_range_;
--      typedef typename Array::index index_;
+-      typedef typename Array::index_range index_range;
+-      typedef typename Array::index index;
        a[ idgen ];
      }
    };
commit 45e7b4c18d8061692f753a05283b00f746010916
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Apr 30 14:04:14 2014 +0200

    chart::ChartController::queryGL3DChart(): crash on concurrent model close
    
    As seen in JunitTest_chart2_unoapi
    [sch.ChXChartDocument::com::sun::star::beans::XPropertySet]
    it is possible that one thread closes the model while the main thread
    tries to paint the chart via timeout.
    In  chart::ChartController::modeChanged() It's not obviously possible
    to lock m_aModelMutex since that might deadlock with SolarMutex.
    
    6  in SolarMutexGuard::SolarMutexGuard (this=0x2b742f846cc0) at /include/vcl/svapp.hxx:1579
    7  in (anonymous namespace)::Frame::isActionLocked (this=0x1dbe1b0) at /framework/source/services/frame.cxx:2597
    8  in (anonymous namespace)::Frame::close (this=0x1dbe1b0, bDeliverOwnership=0 '\000') at /framework/source/services/frame.cxx:1773
    9  in chart::ChartController::notifyClosing (this=0x1e4ec00, rSource=...) at /chart2/source/controller/main/ChartController.cxx:877
    10 in apphelper::CloseableLifeTimeManager::impl_doClose (this=0x1e03b98) at /chart2/source/tools/LifeTime.cxx:368
    11 in apphelper::CloseableLifeTimeManager::g_close_endTryClose_doClose (this=0x1e03b98) at /chart2/source/tools/LifeTime.cxx:311
    12 in chart::ChartModel::close (this=0x1e03ac0, bDeliverOwnership=1 '\001') at /chart2/source/model/main/ChartModel.cxx:654
    
    main thread:
    
    21 in chart::ChartController::TheModel::getModel (this=0x0) at /chart2/source/controller/main/ChartController.hxx:470
    22 in chart::ChartController::queryGL3DChart (this=0x1e4ec00) at /chart2/source/controller/main/ChartController.cxx:1398
    23 in chart::ChartController::modeChanged (this=0x1e4ec00, rEvent=...) at /chart2/source/controller/main/ChartController.cxx:486
    24 in chart::ChartView::impl_notifyModeChangeListener (this=0x1e149f0, rNewMode="valid") at /chart2/source/view/main/ChartView.cxx:2823
    25 in chart::ChartView::impl_updateView (this=0x1e149f0) at /chart2/source/view/main/ChartView.cxx:2730
    26 in chart::ChartView::update (this=0x1e149f0) at /chart2/source/view/main/ChartView.cxx:2861
    27 in chart::ChartController::execute_Paint (this=0x1e4ec00, rRect=Rectangle = {...}) at /chart2/source/controller/main/ChartController_Window.cxx:493
    28 in chart::ChartWindow::Paint (this=0x201c970, rRect=Rectangle = {...}) at /chart2/source/controller/main/ChartWindow.cxx:83
    
    Change-Id: Ib99edbb9862bc9dab76ed3e0c21eca5589fe7fdb

diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx
index db433bc..9a2e97b 100644
--- a/chart2/source/controller/main/ChartController.cxx
+++ b/chart2/source/controller/main/ChartController.cxx
@@ -1395,9 +1395,13 @@ void ChartController::queryGL3DChart()
 {
     m_bGL3DChart = false;
 
-    uno::Reference<frame::XModel> xModel = m_aModel->getModel();
-    if (!xModel.is())
-        return;
+    uno::Reference<frame::XModel> xModel;
+    {   // it's possible that model was cleared by a different thread!
+        osl::MutexGuard g(m_aModelMutex);
+        if (!m_aModel.is())
+            return;
+        xModel = m_aModel->getModel();
+    }
 
     uno::Reference<XChartDocument> xChartDoc(xModel, uno::UNO_QUERY);
     if (!xChartDoc.is())


More information about the Libreoffice-commits mailing list