[Libreoffice-commits] .: 2 commits - sw/source

Caolán McNamara caolan at kemper.freedesktop.org
Mon Jan 31 13:27:37 PST 2011


 sw/source/core/unocore/unochart.cxx |    5 +----
 sw/source/filter/html/htmlform.cxx  |   28 +++++++++++-----------------
 sw/source/filter/html/swhtml.hxx    |    4 ++--
 sw/source/filter/ww8/wrtww8.cxx     |    2 +-
 sw/source/filter/ww8/wrtww8.hxx     |    6 +++---
 sw/source/ui/fldui/changedb.cxx     |    2 +-
 sw/source/ui/fldui/fldpage.cxx      |    3 ---
 sw/source/ui/fldui/fldref.cxx       |    2 +-
 sw/source/ui/frmdlg/column.cxx      |   12 ++++++------
 sw/source/ui/index/cnttab.cxx       |   21 +++++++--------------
 10 files changed, 33 insertions(+), 52 deletions(-)

New commits:
commit d606ef5c66d229e4686b1d95279925e04447eeb1
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Jan 31 21:23:08 2011 +0000

    WaE: various new gcc 4.6.0 warnings

diff --git a/sw/source/ui/fldui/fldpage.cxx b/sw/source/ui/fldui/fldpage.cxx
index 666a18c..ac77c61 100644
--- a/sw/source/ui/fldui/fldpage.cxx
+++ b/sw/source/ui/fldui/fldpage.cxx
@@ -203,7 +203,6 @@ BOOL SwFldPage::InsertFld(USHORT nTypeId, USHORT nSubType, const String& rPar1,
 
         String sPar1(rPar1);
         String sPar2(rPar2);
-        BOOL bDBChanged = FALSE;
         switch( nTypeId )
         {
         case TYP_DATEFLD:
@@ -226,7 +225,6 @@ BOOL SwFldPage::InsertFld(USHORT nTypeId, USHORT nSubType, const String& rPar1,
                 sPar1 = rPar1.Copy(nPos);
 
                 ((SwDBNameInfField*)pTmpFld)->SetDBData(aData);
-                bDBChanged = TRUE;
             }
             break;
 
@@ -254,7 +252,6 @@ BOOL SwFldPage::InsertFld(USHORT nTypeId, USHORT nSubType, const String& rPar1,
                         break;
                     }
                 }
-                bDBChanged = TRUE;
             }
             break;
 
diff --git a/sw/source/ui/fldui/fldref.cxx b/sw/source/ui/fldui/fldref.cxx
index 125081e..0c93a67 100644
--- a/sw/source/ui/fldui/fldref.cxx
+++ b/sw/source/ui/fldui/fldref.cxx
@@ -226,7 +226,7 @@ void SwFldRefPage::Reset(const SfxItemSet& )
         if ((nsSwGetSetExpType::GSE_SEQ & pType->GetType()) && pType->GetDepends() && pSh->IsUsed(*pType))
         {
             nPos = aTypeLB.InsertEntry(pType->GetName());
-            aTypeLB.SetEntryData(nPos, (void*)(REFFLDFLAG | n));
+            aTypeLB.SetEntryData(nPos, (void*)(sal_uIntPtr)(REFFLDFLAG | n));
         }
     }
 
diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index 3e3e5d1..a1a80c6 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -998,7 +998,7 @@ void SwTOXSelectTabPage::SetWrtShell(SwWrtShell& rSh)
         for(sal_uInt16 nUser = 1; nUser < nUserTypeCount; nUser++)
         {
             nPos = aTypeLB.InsertEntry(rSh.GetTOXType(TOX_USER, nUser)->GetTypeName(), nPos);
-            sal_uInt32 nEntryData = nUser << 8;
+            sal_uIntPtr nEntryData = nUser << 8;
             nEntryData |= TO_USER;
             aTypeLB.SetEntryData(nPos, (void*)nEntryData);
         }
@@ -2130,7 +2130,7 @@ void SwTOXEntryTabPage::ActivatePage( const SfxItemSet& /*rSet*/)
                     {
                         const SwTOXSortKey* pKey = pFType->GetSortKey(0);
                         aFirstKeyLB.SelectEntryPos(
-                            aFirstKeyLB.GetEntryPos((void*)(sal_uInt32)pKey->eField));
+                            aFirstKeyLB.GetEntryPos((void*)(sal_uIntPtr)pKey->eField));
                         aFirstSortUpRB.Check(pKey->bSortAscending);
                         aFirstSortDownRB.Check(!pKey->bSortAscending);
                     }
@@ -2138,7 +2138,7 @@ void SwTOXEntryTabPage::ActivatePage( const SfxItemSet& /*rSet*/)
                     {
                         const SwTOXSortKey* pKey = pFType->GetSortKey(1);
                         aSecondKeyLB.SelectEntryPos(
-                            aSecondKeyLB.GetEntryPos((void*)(sal_uInt32)pKey->eField));
+                            aSecondKeyLB.GetEntryPos((void*)(sal_uIntPtr)pKey->eField));
                         aSecondSortUpRB.Check(pKey->bSortAscending);
                         aSecondSortDownRB.Check(!pKey->bSortAscending);
                     }
@@ -2146,7 +2146,7 @@ void SwTOXEntryTabPage::ActivatePage( const SfxItemSet& /*rSet*/)
                     {
                         const SwTOXSortKey* pKey = pFType->GetSortKey(2);
                         aThirdKeyLB.SelectEntryPos(
-                            aThirdKeyLB.GetEntryPos((void*)(sal_uInt32)pKey->eField));
+                            aThirdKeyLB.GetEntryPos((void*)(sal_uIntPtr)pKey->eField));
                         aThirdSortUpRB.Check(pKey->bSortAscending);
                         aThirdSortDownRB.Check(!pKey->bSortAscending);
                     }
@@ -2374,7 +2374,7 @@ void SwTOXEntryTabPage::PreTokenButtonRemoved(const SwFormToken& rToken)
     sal_uInt32 nData = rToken.nAuthorityField;
     String sTemp(SW_RES(STR_AUTH_FIELD_START + nData));
     sal_uInt16 nPos = aAuthFieldsLB.InsertEntry(sTemp);
-    aAuthFieldsLB.SetEntryData(nPos, (void*)(nData));
+    aAuthFieldsLB.SetEntryData(nPos, (void*)(sal_uIntPtr)(nData));
 }
 /*-----------------------------------------------------------------------
 
@@ -2479,7 +2479,7 @@ IMPL_LINK(SwTOXEntryTabPage, LevelHdl, SvTreeListBox*, pBox)
         {
             String sTmp(SW_RES(STR_AUTH_FIELD_START + i));
             sal_uInt16 nPos = aAuthFieldsLB.InsertEntry(sTmp);
-            aAuthFieldsLB.SetEntryData(nPos, (void*)(i));
+            aAuthFieldsLB.SetEntryData(nPos, (void*)(sal_uIntPtr)(i));
         }
 
         // #i21237#
@@ -2492,7 +2492,7 @@ IMPL_LINK(SwTOXEntryTabPage, LevelHdl, SvTreeListBox*, pBox)
             if(TOKEN_AUTHORITY == aToken.eTokenType)
             {
                 sal_uInt32 nSearch = aToken.nAuthorityField;
-                sal_uInt16	nLstBoxPos = aAuthFieldsLB.GetEntryPos( (void*) nSearch );
+                sal_uInt16	nLstBoxPos = aAuthFieldsLB.GetEntryPos( (void*)(sal_uIntPtr)nSearch );
                 OSL_ENSURE(LISTBOX_ENTRY_NOTFOUND != nLstBoxPos, "Entry not found?");
                 aAuthFieldsLB.RemoveEntry(nLstBoxPos);
             }
@@ -2866,8 +2866,6 @@ void	SwTokenWindow::SetForm(SwForm& rForm, sal_uInt16 nL)
     //now the display
     if(nLevel < MAXLEVEL || rForm.GetTOXType() == TOX_AUTHORITIES)
     {
-         Size aToolBoxSize = GetSizePixel();
-
         // #i21237#
         SwFormTokens aPattern = pForm->GetPattern(nLevel + 1);
         SwFormTokens::iterator aIt = aPattern.begin();
@@ -3053,7 +3051,6 @@ void	SwTokenWindow::InsertAtSelection(
             pControl = aControlList.Next();
         }
 
-        sal_Bool bPostLinkEndFound = sal_False;
         sal_Bool bPostLinkStartFound = sal_False;
         if(!bPreStartLinkFound && !bPreEndLinkFound)
             while(pControl)
@@ -3077,10 +3074,6 @@ void	SwTokenWindow::InsertAtSelection(
                             bPostLinkStartFound = sal_False;
                             pExchange = 0;
                         }
-                        else
-                        {
-                            bPostLinkEndFound = sal_True;
-                        }
                         break;
                     }
                 }
commit 752e58015139153d538a4793df700080b676c022
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Jan 31 11:14:06 2011 +0000

    WaE: various new gcc 4.6.0 warnings

diff --git a/sw/source/core/unocore/unochart.cxx b/sw/source/core/unocore/unochart.cxx
index bf7aaa9..dad4d46 100644
--- a/sw/source/core/unocore/unochart.cxx
+++ b/sw/source/core/unocore/unochart.cxx
@@ -1172,6 +1172,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwChartDataProvider::detectArgume
         {
             DBG_ASSERT( nCurLabelSeqLen == 0 && nCurValuesSeqLen == 1,
                     "trying to determine 'DataRowSource': something's fishy... should have been a single cell");
+            (void)nCurValuesSeqLen;
             nDirection = 0;     // default direction for a single cell should be 'columns'
         }
         else    // more than one cell is availabale (in values and label together!)
@@ -1729,16 +1730,12 @@ void SwChartDataProvider::AddRowCols(
         {
             //get range of indices in col/rows for new cells
             sal_Int32 nFirstNewCol = nFirstCol;
-            sal_Int32 nLastNewCol  = nLastCol;
             sal_Int32 nFirstNewRow = bBehind ?  nFirstRow + 1 : nFirstRow - nLines;
-            sal_Int32 nLastNewRow  = nFirstNewRow - 1 + nLines;
             if (bAddCols)
             {
                 DBG_ASSERT( nFirstCol == nLastCol, "column indices seem broken" );
                 nFirstNewCol = bBehind ?  nFirstCol + 1 : nFirstCol - nLines;
-                nLastNewCol  = nFirstNewCol - 1 + nLines;
                 nFirstNewRow = nFirstRow;
-                nLastNewRow  = nLastRow;
             }
 
             // iterate over all data-sequences for the table
diff --git a/sw/source/filter/html/htmlform.cxx b/sw/source/filter/html/htmlform.cxx
index ddfc1aa..3ae51f3 100644
--- a/sw/source/filter/html/htmlform.cxx
+++ b/sw/source/filter/html/htmlform.cxx
@@ -682,7 +682,7 @@ public:
     sal_Bool IsMinHeight() const { return bMinHeight; }
 };
 
-void SwHTMLParser::SetPendingControlSize( int nToken )
+void SwHTMLParser::SetPendingControlSize()
 {
     OSL_ENSURE( pPendStack, "Wo ist der Pending Stack?" );
     SwHTMLFormPendingStackData_Impl *pData =
@@ -694,18 +694,15 @@ void SwHTMLParser::SetPendingControlSize( int nToken )
     OSL_ENSURE( !pPendStack, "Wo kommt der Pending-Stack her?" );
 
     SetControlSize( pData->GetShape(), pData->GetTextSize(),
-                    pData->IsMinWidth(), pData->IsMinHeight(),
-                    nToken );
+                    pData->IsMinWidth(), pData->IsMinHeight() );
     delete pData;
 }
 
 void SwHTMLParser::SetControlSize( const uno::Reference< drawing::XShape >& rShape,
                                    const Size& rTextSz,
                                    sal_Bool bMinWidth,
-                                   sal_Bool bMinHeight,
-                                   int nToken )
+                                   sal_Bool bMinHeight )
 {
-    nToken = 0;
     if( !rTextSz.Width() && !rTextSz.Height() && !bMinWidth  && !bMinHeight )
         return;
 
@@ -1491,7 +1488,7 @@ void SwHTMLParser::InsertInput()
 {
     if( pPendStack )
     {
-        SetPendingControlSize( HTML_INPUT );
+        SetPendingControlSize();
         return;
     }
 
@@ -1950,7 +1947,7 @@ void SwHTMLParser::InsertInput()
     if( aTextSz.Width() || aTextSz.Height() || bMinWidth || bMinHeight )
     {
         OSL_ENSURE( !(bSetGrfWidth || bSetGrfHeight), "Grafikgroesse anpassen???" );
-        SetControlSize( xShape, aTextSz, bMinWidth, bMinHeight, HTML_INPUT );
+        SetControlSize( xShape, aTextSz, bMinWidth, bMinHeight );
     }
 
     if( HTML_IT_RADIO == eType )
@@ -1982,7 +1979,7 @@ void SwHTMLParser::NewTextArea()
 {
     if( pPendStack )
     {
-        SetPendingControlSize( HTML_TEXTAREA_ON );
+        SetPendingControlSize();
         return;
     }
 
@@ -2199,8 +2196,7 @@ void SwHTMLParser::NewTextArea()
                                       aMacroTbl, aUnoMacroTbl,
                                       aUnoMacroParamTbl );
     if( aTextSz.Width() || aTextSz.Height() )
-        SetControlSize( xShape, aTextSz, sal_False, sal_False,
-                        HTML_TEXTAREA_ON );
+        SetControlSize( xShape, aTextSz, sal_False, sal_False );
 
     // einen neuen Kontext anlegen
     _HTMLAttrContext *pCntxt = new _HTMLAttrContext( HTML_TEXTAREA_ON );
@@ -2277,7 +2273,7 @@ void SwHTMLParser::NewSelect()
 {
     if( pPendStack )
     {
-        SetPendingControlSize( HTML_SELECT_ON );
+        SetPendingControlSize();
         return;
     }
 
@@ -2486,8 +2482,7 @@ void SwHTMLParser::NewSelect()
     if( bFixSelectWidth )
         pFormImpl->SetShape( xShape );
     if( aTextSz.Height() || bMinWidth || bMinHeight )
-        SetControlSize( xShape, aTextSz, bMinWidth, bMinHeight,
-                        HTML_SELECT_ON );
+        SetControlSize( xShape, aTextSz, bMinWidth, bMinHeight );
 
     // einen neuen Kontext anlegen
     _HTMLAttrContext *pCntxt = new _HTMLAttrContext( HTML_SELECT_ON );
@@ -2503,7 +2498,7 @@ void SwHTMLParser::EndSelect()
 {
     if( pPendStack )
     {
-        SetPendingControlSize( HTML_SELECT_OFF );
+        SetPendingControlSize();
         return;
     }
 
@@ -2580,8 +2575,7 @@ void SwHTMLParser::EndSelect()
     {
         OSL_ENSURE( pFormImpl->GetShape().is(), "Kein Shape gemerkt" );
         Size aTextSz( -1, 0 );
-        SetControlSize( pFormImpl->GetShape(), aTextSz, sal_False, sal_False,
-                        HTML_SELECT_OFF );
+        SetControlSize( pFormImpl->GetShape(), aTextSz, sal_False, sal_False );
     }
 
     pFormImpl->ReleaseFCompPropSet();
diff --git a/sw/source/filter/html/swhtml.hxx b/sw/source/filter/html/swhtml.hxx
index 3986b9b..a5385da 100644
--- a/sw/source/filter/html/swhtml.hxx
+++ b/sw/source/filter/html/swhtml.hxx
@@ -821,8 +821,8 @@ private:
                         sal_Bool bSetPropSet = sal_True,
                         sal_Bool bHidden = sal_False );
     void SetControlSize( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rShape, const Size& rTextSz,
-                         sal_Bool bMinWidth, sal_Bool bMinHeight, int nToken );
-    void SetPendingControlSize( int nToken );
+                         sal_Bool bMinWidth, sal_Bool bMinHeight );
+    void SetPendingControlSize();
 
 public:
     void ResizeDrawObject( SdrObject* pObj, SwTwips nWidth );
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index c22c912..d1cf62a 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -2793,7 +2793,7 @@ void MSWordExportBase::AddLinkTarget(const String& rURL)
         if( pDoc->GotoOutline( aPos, aOutline ) )
         {
             ULONG nIdx = aPos.nNode.GetIndex();
-            aPair aImplicitBookmark;
+            aBookmarkPair aImplicitBookmark;
             aImplicitBookmark.first = aOutline;
             aImplicitBookmark.second = nIdx;
             maImplicitBookmarks.push_back(aImplicitBookmark);
diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx
index c1c1a7e..8a2235e 100644
--- a/sw/source/filter/ww8/wrtww8.hxx
+++ b/sw/source/filter/ww8/wrtww8.hxx
@@ -404,9 +404,9 @@ private:
     HdFtPlcDrawObj& operator=(const HdFtPlcDrawObj&);
 };
 
-typedef ::std::pair<String, ULONG> aPair;
-typedef std::vector<aPair> SwImplBookmarks;
-typedef std::vector<aPair>::iterator SwImplBookmarksIter;
+typedef ::std::pair<String, ULONG> aBookmarkPair;
+typedef std::vector<aBookmarkPair> SwImplBookmarks;
+typedef std::vector<aBookmarkPair>::iterator SwImplBookmarksIter;
 
 class WW8_WrtRedlineAuthor : public sw::util::WrtRedlineAuthor
 {
diff --git a/sw/source/ui/fldui/changedb.cxx b/sw/source/ui/fldui/changedb.cxx
index f988b39..a6d2bf3 100644
--- a/sw/source/ui/fldui/changedb.cxx
+++ b/sw/source/ui/fldui/changedb.cxx
@@ -170,7 +170,7 @@ SvLBoxEntry* SwChangeDBDlg::Insert(const String& rDBName)
 {
     String sDBName(rDBName.GetToken(0, DB_DELIM));
     String sTableName(rDBName.GetToken(1, DB_DELIM));
-    int nCommandType = rDBName.GetToken(2, DB_DELIM).ToInt32();
+    sal_IntPtr nCommandType = rDBName.GetToken(2, DB_DELIM).ToInt32();
     SvLBoxEntry* pParent;
     SvLBoxEntry* pChild;
 
diff --git a/sw/source/ui/frmdlg/column.cxx b/sw/source/ui/frmdlg/column.cxx
index 224eafc..2a25039 100644
--- a/sw/source/ui/frmdlg/column.cxx
+++ b/sw/source/ui/frmdlg/column.cxx
@@ -140,14 +140,14 @@ SwColumnDlg::SwColumnDlg(Window* pParent, SwWrtShell& rSh) :
         pSectionSet->Put( pCurrSection->GetFmt()->GetAttrSet() );
         pColPgSet = pSectionSet;
         aApplyToLB.RemoveEntry( aApplyToLB.GetEntryPos(
-                                        (void*)( 1 >= nFullSectCnt
+                                        (void*)(sal_IntPtr)( 1 >= nFullSectCnt
                                                     ? LISTBOX_SECTIONS
                                                     : LISTBOX_SECTION )));
     }
     else
     {
-        aApplyToLB.RemoveEntry(aApplyToLB.GetEntryPos( (void*) LISTBOX_SECTION ));
-        aApplyToLB.RemoveEntry(aApplyToLB.GetEntryPos( (void*) LISTBOX_SECTIONS ));
+        aApplyToLB.RemoveEntry(aApplyToLB.GetEntryPos( (void*)(sal_IntPtr)LISTBOX_SECTION ));
+        aApplyToLB.RemoveEntry(aApplyToLB.GetEntryPos( (void*)(sal_IntPtr)LISTBOX_SECTIONS ));
     }
 
     if( rWrtShell.HasSelection() && rWrtShell.IsInsRegionAvailable() &&
@@ -158,7 +158,7 @@ SwColumnDlg::SwColumnDlg(Window* pParent, SwWrtShell& rSh) :
         pColPgSet = pSelectionSet;
     }
     else
-        aApplyToLB.RemoveEntry(aApplyToLB.GetEntryPos( (void*) LISTBOX_SELECTION ));
+        aApplyToLB.RemoveEntry(aApplyToLB.GetEntryPos( (void*)(sal_IntPtr)LISTBOX_SELECTION ));
 
     if( rWrtShell.GetFlyFrmFmt() )
     {
@@ -595,8 +595,8 @@ void SwColumnPage::Reset(const SfxItemSet &rSet)
     if( SFX_ITEM_AVAILABLE <= rSet.GetItemState( RES_FRAMEDIR ) )
     {
         const SvxFrameDirectionItem& rItem = (const SvxFrameDirectionItem&)rSet.Get(RES_FRAMEDIR);
-        sal_uInt32 nVal  = rItem.GetValue();
-        USHORT nPos = aTextDirectionLB.GetEntryPos( (void*) nVal );
+        sal_uIntPtr nVal  = rItem.GetValue();
+        USHORT nPos = aTextDirectionLB.GetEntryPos( (void*)nVal );
         aTextDirectionLB.SelectEntryPos( nPos );
         aTextDirectionLB.SaveValue();
     }


More information about the Libreoffice-commits mailing list