[Libreoffice-commits] .: Branch 'libreoffice-3-6' - 2 commits - shell/source sw/source

Fridrich Strba fridrich at kemper.freedesktop.org
Mon Jun 18 02:02:40 PDT 2012


 shell/source/backends/wininetbe/wininetbackend.cxx |    2 -
 sw/source/core/undo/untbl.cxx                      |   24 ++++++++++++---------
 2 files changed, 15 insertions(+), 11 deletions(-)

New commits:
commit 561605f7b9383a5349b288580a565a6064b42dad
Author: David Tardon <dtardon at redhat.com>
Date:   Tue Jun 12 09:30:12 2012 +0200

    fix typo: = -> ==
    
    Change-Id: Iba320b00bdef3704bdfe1abe2a60b8c767a571ec
    Signed-off-by: Fridrich Å trba <fridrich.strba at bluewin.ch>

diff --git a/shell/source/backends/wininetbe/wininetbackend.cxx b/shell/source/backends/wininetbe/wininetbackend.cxx
index ac6829e..06855b5 100755
--- a/shell/source/backends/wininetbe/wininetbackend.cxx
+++ b/shell/source/backends/wininetbe/wininetbackend.cxx
@@ -140,7 +140,7 @@ WinInetBackend::WinInetBackend()
             if (!ok)
             {
                 DWORD err = GetLastError();
-                if (err = ERROR_INSUFFICIENT_BUFFER)
+                if (err == ERROR_INSUFFICIENT_BUFFER)
                 {
                     // allocate sufficient space on the heap
                     // insufficient space on the heap results
commit 9334a18fdffeb2a2255b1cf82c2ebc511421f24c
Author: David Tardon <dtardon at redhat.com>
Date:   Mon Jun 11 15:17:12 2012 +0200

    fdo#50896 SfxItemSets can contain emtpy element
    
    Use vector<shared_ptr> instead of ptr_vector.
    
    Change-Id: I4e7d0735cbb036c608f697f7418109a2c497982f
    Signed-off-by: Fridrich Å trba <fridrich.strba at bluewin.ch>

diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx
index ee16941..11dbb4b 100644
--- a/sw/source/core/undo/untbl.cxx
+++ b/sw/source/core/undo/untbl.cxx
@@ -26,6 +26,10 @@
  *
  ************************************************************************/
 
+#include <vector>
+
+#include <boost/shared_ptr.hpp>
+
 #include <UndoTable.hxx>
 #include <UndoRedline.hxx>
 #include <UndoDelete.hxx>
@@ -82,7 +86,7 @@
 
 extern void ClearFEShellTabCols();
 
-typedef boost::ptr_vector<SfxItemSet> SfxItemSets;
+typedef std::vector<boost::shared_ptr<SfxItemSet> > SfxItemSets;
 
 class SwUndoSaveSections : public boost::ptr_vector<SwUndoSaveSection> {
 public:
@@ -900,8 +904,8 @@ sal_uInt16 _SaveTable::AddFmt( SwFrmFmt* pFmt, bool bIsLine )
     if( USHRT_MAX == nRet )
     {
         // Create copy of ItemSet
-        SfxItemSet* pSet = new SfxItemSet( *pFmt->GetAttrSet().GetPool(),
-            bIsLine ? aTableLineSetRange : aTableBoxSetRange );
+        boost::shared_ptr<SfxItemSet> pSet( new SfxItemSet( *pFmt->GetAttrSet().GetPool(),
+            bIsLine ? aTableLineSetRange : aTableBoxSetRange ) );
         pSet->Put( pFmt->GetAttrSet() );
         // When a formula is set, never save the value. It possibly must be
         // recalculated.
@@ -1088,7 +1092,7 @@ void _SaveTable::NewFrmFmt( const SwTableLine* pTblLn, const SwTableBox* pTblBx,
             pFmt = pDoc->MakeTableLineFmt();
         else
             pFmt = pDoc->MakeTableBoxFmt();
-        pFmt->SetFmtAttr( aSets[ nFmtPos ] );
+        pFmt->SetFmtAttr( *aSets[ nFmtPos ] );
         aFrmFmts.Replace( pFmt, nFmtPos );
     }
 
@@ -1178,7 +1182,7 @@ void _SaveLine::CreateNew( SwTable& rTbl, SwTableBox& rParent, _SaveTable& rSTbl
     {
         SwDoc* pDoc = rTbl.GetFrmFmt()->GetDoc();
         pFmt = pDoc->MakeTableLineFmt();
-        pFmt->SetFmtAttr( rSTbl.aSets[ nItemSet ] );
+        pFmt->SetFmtAttr( *rSTbl.aSets[ nItemSet ] );
         rSTbl.aFrmFmts.Replace( pFmt, nItemSet );
     }
     SwTableLine* pNew = new SwTableLine( pFmt, 1, &rParent );
@@ -1270,7 +1274,7 @@ void _SaveBox::RestoreAttr( SwTableBox& rBox, _SaveTable& rSTbl )
                 SwCntntNode* pCNd = rNds[ n ]->GetCntntNode();
                 if( pCNd )
                 {
-                    SfxItemSet* pSet = &(*Ptrs.pCntntAttrs)[ nSet++ ];
+                    boost::shared_ptr<SfxItemSet> pSet( (*Ptrs.pCntntAttrs)[ nSet++ ] );
                     if( pSet )
                     {
                         sal_uInt16 *pRstAttr = aSave_BoxCntntSet;
@@ -1309,11 +1313,11 @@ void _SaveBox::SaveCntntAttrs( SwDoc* pDoc )
             SwCntntNode* pCNd = pDoc->GetNodes()[ n ]->GetCntntNode();
             if( pCNd )
             {
-                SfxItemSet* pSet = 0;
+                boost::shared_ptr<SfxItemSet> pSet;
                 if( pCNd->HasSwAttrSet() )
                 {
-                    pSet = new SfxItemSet( pDoc->GetAttrPool(),
-                                            aSave_BoxCntntSet );
+                    pSet.reset( new SfxItemSet( pDoc->GetAttrPool(),
+                                            aSave_BoxCntntSet ) );
                     pSet->Put( *pCNd->GetpSwAttrSet() );
                 }
 
@@ -1332,7 +1336,7 @@ void _SaveBox::CreateNew( SwTable& rTbl, SwTableLine& rParent, _SaveTable& rSTbl
     {
         SwDoc* pDoc = rTbl.GetFrmFmt()->GetDoc();
         pFmt = pDoc->MakeTableBoxFmt();
-        pFmt->SetFmtAttr( rSTbl.aSets[ nItemSet ] );
+        pFmt->SetFmtAttr( *rSTbl.aSets[ nItemSet ] );
         rSTbl.aFrmFmts.Replace( pFmt, nItemSet );
     }
 


More information about the Libreoffice-commits mailing list