[Libreoffice-commits] .: sc/source

Markus Mohrhard mmohrhard at kemper.freedesktop.org
Wed Aug 3 17:24:44 PDT 2011


 sc/source/ui/inc/datafdlg.hxx      |    4 ++--
 sc/source/ui/inc/viewfunc.hxx      |    3 ++-
 sc/source/ui/miscdlgs/datafdlg.cxx |    3 +--
 sc/source/ui/view/viewfun3.cxx     |    6 +++---
 4 files changed, 8 insertions(+), 8 deletions(-)

New commits:
commit e19909eaec928386690d5c9c6bed92e86a721b01
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Thu Aug 4 02:17:59 2011 +0200

    some clean-up
    
    you need boost::nullable if you want to insert a null pointer in a
    boost::ptr_vector and it seems that ptr_vector::c_array isn't supported
    then

diff --git a/sc/source/ui/inc/datafdlg.hxx b/sc/source/ui/inc/datafdlg.hxx
index 3511261..6fda321 100644
--- a/sc/source/ui/inc/datafdlg.hxx
+++ b/sc/source/ui/inc/datafdlg.hxx
@@ -75,8 +75,8 @@ private:
     SCTAB           nTab;
     bool            bNoSelection;
 
-    boost::ptr_vector<FixedText> maFixedTexts;
-    boost::ptr_vector<Edit> maEdits;
+    boost::ptr_vector<boost::nullable<FixedText> > maFixedTexts;
+    boost::ptr_vector<boost::nullable<Edit> > maEdits;
 
 public:
     ScDataFormDlg( Window* pParent, ScTabViewShell* pTabViewShell);
diff --git a/sc/source/ui/inc/viewfunc.hxx b/sc/source/ui/inc/viewfunc.hxx
index 40147db..50c9fd9 100644
--- a/sc/source/ui/inc/viewfunc.hxx
+++ b/sc/source/ui/inc/viewfunc.hxx
@@ -41,6 +41,7 @@
 #include <com/sun/star/embed/XEmbeddedObject.hpp>
 #include <com/sun/star/embed/Aspects.hpp>
 #include <vector>
+#include <boost/ptr_container/ptr_vector.hpp>
 
 class ScPatternAttr;
 class ScAutoFormatData;
@@ -342,7 +343,7 @@ public:
         SC_DLLPUBLIC void                   DataFormPutData( SCROW nCurrentRow ,
                                                              SCROW nStartRow , SCCOL nStartCol ,
                                                              SCROW nEndRow , SCCOL nEndCol ,
-                                                             Edit** pEdits ,
+                                                             boost::ptr_vector<boost::nullable<Edit> >& aEdits,
                                                              sal_uInt16 aColLength );
 
                                                 // interne Hilfsfunktionen
diff --git a/sc/source/ui/miscdlgs/datafdlg.cxx b/sc/source/ui/miscdlgs/datafdlg.cxx
index ed8f7c3..6e4f288 100644
--- a/sc/source/ui/miscdlgs/datafdlg.cxx
+++ b/sc/source/ui/miscdlgs/datafdlg.cxx
@@ -119,7 +119,6 @@ ScDataFormDlg::ScDataFormDlg( Window* pParent, ScTabViewShell*  pTabViewShellOri
             //skip leading hide column
             for (int i=1;i<=MAX_DATAFORM_COLS;i++)
             {
-                String  aColName;
                 int nColWidth = pDoc->GetColWidth( nStartCol, nTab );
                 if (nColWidth)
                     break;
@@ -298,7 +297,7 @@ IMPL_LINK( ScDataFormDlg, Impl_NewHdl, PushButton*, EMPTYARG )
 
         if ( bHasData )
         {
-            pTabViewShell->DataFormPutData( aCurrentRow , nStartRow , nStartCol , nEndRow , nEndCol , maEdits.c_array() , aColLength );
+            pTabViewShell->DataFormPutData( aCurrentRow , nStartRow , nStartCol , nEndRow , nEndCol , maEdits , aColLength );
             aCurrentRow++;
             if (aCurrentRow >= nEndRow + 2)
             {
diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx
index d96ba11..c0fdb2d 100644
--- a/sc/source/ui/view/viewfun3.cxx
+++ b/sc/source/ui/view/viewfun3.cxx
@@ -1839,7 +1839,7 @@ sal_Bool ScViewFunc::LinkBlock( const ScRange& rSource, const ScAddress& rDestPo
 void ScViewFunc::DataFormPutData( SCROW nCurrentRow ,
                                   SCROW nStartRow , SCCOL nStartCol ,
                                   SCROW nEndRow , SCCOL nEndCol ,
-                                  Edit** pEdits ,
+                                  boost::ptr_vector<boost::nullable<Edit> >& aEdits,
                                   sal_uInt16 aColLength )
 {
     ScDocument* pDoc = GetViewData()->GetDocument();
@@ -1881,9 +1881,9 @@ void ScViewFunc::DataFormPutData( SCROW nCurrentRow ,
 
         for(sal_uInt16 i = 0; i < aColLength; i++)
         {
-            if (pEdits[i])
+            if (!aEdits.is_null(i))
             {
-                String  aFieldName=pEdits[i]->GetText();
+                String  aFieldName=aEdits[i].GetText();
                 pDoc->SetString( nStartCol + i, nCurrentRow, nTab, aFieldName );
             }
         }


More information about the Libreoffice-commits mailing list