[Libreoffice-commits] core.git: sw/source

Noel Grandin noelgrandin at gmail.com
Wed Sep 23 06:11:32 PDT 2015


 sw/source/ui/index/cnttab.cxx       |   48 +++++++++++++++++-------------------
 sw/source/uibase/inc/swuicnttab.hxx |    8 +++---
 2 files changed, 27 insertions(+), 29 deletions(-)

New commits:
commit a5eaa6be75db0a9e84442fdbee69cf830b17ee85
Author: Noel Grandin <noelgrandin at gmail.com>
Date:   Wed Sep 23 14:28:14 2015 +0200

    convert Link<> to typed
    
    Change-Id: If48dd5fd9ea87ca5c770424ce824998d842aacef
    Reviewed-on: https://gerrit.libreoffice.org/18811
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>
    Tested-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index d1347b8..7c32c52 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -2416,20 +2416,20 @@ IMPL_LINK_TYPED(SwTOXEntryTabPage, SortKeyHdl, Button*, pButton, void)
     m_pSortKeyFrame->Enable(bEnable);
 }
 
-IMPL_LINK(SwTOXEntryTabPage, TokenSelectedHdl, SwFormToken*, pToken)
+IMPL_LINK_TYPED(SwTOXEntryTabPage, TokenSelectedHdl, SwFormToken&, rToken, void)
 {
-    if (!pToken->sCharStyleName.isEmpty())
-        m_pCharStyleLB->SelectEntry(pToken->sCharStyleName);
+    if (!rToken.sCharStyleName.isEmpty())
+        m_pCharStyleLB->SelectEntry(rToken.sCharStyleName);
     else
         m_pCharStyleLB->SelectEntry(sNoCharStyle);
 
     const OUString sEntry = m_pCharStyleLB->GetSelectEntry();
     m_pEditStylePB->Enable(sEntry != sNoCharStyle);
 
-    if(pToken->eTokenType == TOKEN_CHAPTER_INFO)
+    if(rToken.eTokenType == TOKEN_CHAPTER_INFO)
     {
 //---> i89791
-        switch(pToken->nChapterFormat)
+        switch(rToken.nChapterFormat)
         {
         default:
             m_pChapterEntryLB->SetNoSelection();//to alert the user
@@ -2446,19 +2446,19 @@ IMPL_LINK(SwTOXEntryTabPage, TokenSelectedHdl, SwFormToken*, pToken)
         }
 //i53420
 
-        m_pEntryOutlineLevelNF->SetValue(pToken->nOutlineLevel);
+        m_pEntryOutlineLevelNF->SetValue(rToken.nOutlineLevel);
     }
 
 //i53420
-    if(pToken->eTokenType == TOKEN_ENTRY_NO)
+    if(rToken.eTokenType == TOKEN_ENTRY_NO)
     {
-        m_pEntryOutlineLevelNF->SetValue(pToken->nOutlineLevel);
+        m_pEntryOutlineLevelNF->SetValue(rToken.nOutlineLevel);
         const sal_uInt16 nFormat =
-            pToken->nChapterFormat == CF_NUM_NOPREPST_TITLE ? 1 : 0;
+            rToken.nChapterFormat == CF_NUM_NOPREPST_TITLE ? 1 : 0;
         m_pNumberFormatLB->SelectEntryPos(nFormat);
     }
 
-    bool bTabStop = TOKEN_TAB_STOP == pToken->eTokenType;
+    bool bTabStop = TOKEN_TAB_STOP == rToken.eTokenType;
     m_pFillCharFT->Show(bTabStop);
     m_pFillCharCB->Show(bTabStop);
     m_pTabPosFT->Show(bTabStop);
@@ -2467,9 +2467,9 @@ IMPL_LINK(SwTOXEntryTabPage, TokenSelectedHdl, SwFormToken*, pToken)
     m_pAutoRightCB->Enable(bTabStop);
     if(bTabStop)
     {
-        m_pTabPosMF->SetValue(m_pTabPosMF->Normalize(pToken->nTabStopPosition), FUNIT_TWIP);
-        m_pAutoRightCB->Check(SVX_TAB_ADJUST_END == pToken->eTabAlign);
-        m_pFillCharCB->SetText(OUString(pToken->cTabFillChar));
+        m_pTabPosMF->SetValue(m_pTabPosMF->Normalize(rToken.nTabStopPosition), FUNIT_TWIP);
+        m_pAutoRightCB->Check(SVX_TAB_ADJUST_END == rToken.eTabAlign);
+        m_pFillCharCB->SetText(OUString(rToken.cTabFillChar));
         m_pTabPosFT->Enable(!m_pAutoRightCB->IsChecked());
         m_pTabPosMF->Enable(!m_pAutoRightCB->IsChecked());
     }
@@ -2478,8 +2478,8 @@ IMPL_LINK(SwTOXEntryTabPage, TokenSelectedHdl, SwFormToken*, pToken)
         m_pTabPosMF->Enable(false);
     }
 
-    bool bIsChapterInfo = pToken->eTokenType == TOKEN_CHAPTER_INFO;
-    bool bIsEntryNumber = pToken->eTokenType == TOKEN_ENTRY_NO;
+    bool bIsChapterInfo = rToken.eTokenType == TOKEN_CHAPTER_INFO;
+    bool bIsEntryNumber = rToken.eTokenType == TOKEN_ENTRY_NO;
     m_pChapterEntryFT->Show( bIsChapterInfo );
     m_pChapterEntryLB->Show( bIsChapterInfo );
     m_pEntryOutlineLevelFT->Show( bIsChapterInfo || bIsEntryNumber );
@@ -2493,22 +2493,22 @@ IMPL_LINK(SwTOXEntryTabPage, TokenSelectedHdl, SwFormToken*, pToken)
 
     if(m_pEntryNoPB->IsVisible())
     {
-        m_pEntryNoPB->Enable(TOKEN_ENTRY_NO != pToken->eTokenType );
+        m_pEntryNoPB->Enable(TOKEN_ENTRY_NO != rToken.eTokenType );
     }
     if(m_pEntryPB->IsVisible())
     {
-        m_pEntryPB->Enable(TOKEN_ENTRY_TEXT != pToken->eTokenType &&
+        m_pEntryPB->Enable(TOKEN_ENTRY_TEXT != rToken.eTokenType &&
                                 !m_pTokenWIN->Contains(TOKEN_ENTRY_TEXT)
                                 && !m_pTokenWIN->Contains(TOKEN_ENTRY));
     }
 
     if(m_pChapterInfoPB->IsVisible())
     {
-        m_pChapterInfoPB->Enable(TOKEN_CHAPTER_INFO != pToken->eTokenType);
+        m_pChapterInfoPB->Enable(TOKEN_CHAPTER_INFO != rToken.eTokenType);
     }
     if(m_pPageNoPB->IsVisible())
     {
-        m_pPageNoPB->Enable(TOKEN_PAGE_NUMS != pToken->eTokenType &&
+        m_pPageNoPB->Enable(TOKEN_PAGE_NUMS != rToken.eTokenType &&
                                 !m_pTokenWIN->Contains(TOKEN_PAGE_NUMS));
     }
     if(m_pTabPB->IsVisible())
@@ -2517,18 +2517,16 @@ IMPL_LINK(SwTOXEntryTabPage, TokenSelectedHdl, SwFormToken*, pToken)
     }
     if(m_pHyperLinkPB->IsVisible())
     {
-        m_pHyperLinkPB->Enable(TOKEN_LINK_START != pToken->eTokenType &&
-                            TOKEN_LINK_END != pToken->eTokenType);
+        m_pHyperLinkPB->Enable(TOKEN_LINK_START != rToken.eTokenType &&
+                            TOKEN_LINK_END != rToken.eTokenType);
     }
     //table of authorities
     if(m_pAuthInsertPB->IsVisible())
     {
-        bool bText = TOKEN_TEXT == pToken->eTokenType;
+        bool bText = TOKEN_TEXT == rToken.eTokenType;
         m_pAuthInsertPB->Enable(bText && !m_pAuthFieldsLB->GetSelectEntry().isEmpty());
         m_pAuthRemovePB->Enable(!bText);
     }
-
-    return 0;
 }
 
 IMPL_LINK(SwTOXEntryTabPage, StyleSelectHdl, ListBox*, pBox)
@@ -2864,7 +2862,7 @@ void SwTokenWindow::SetActiveControl(Control* pSet)
                 pFToken = &static_cast<SwTOXButton*>(pActiveCtrl.get())->GetFormToken();
 
             SwFormToken aTemp( *pFToken );
-            aButtonSelectedHdl.Call( &aTemp );
+            aButtonSelectedHdl.Call( aTemp );
         }
     }
 }
diff --git a/sw/source/uibase/inc/swuicnttab.hxx b/sw/source/uibase/inc/swuicnttab.hxx
index 6e225fd..4dfb1b0 100644
--- a/sw/source/uibase/inc/swuicnttab.hxx
+++ b/sw/source/uibase/inc/swuicnttab.hxx
@@ -257,8 +257,8 @@ class SwTokenWindow : public VclHBox, public VclBuilderContainer
     OUString        aButtonTexts[TOKEN_END]; // Text of the buttons
     OUString        aButtonHelpTexts[TOKEN_END]; // QuickHelpText of the buttons
     OUString        sCharStyle;
-    Link<>          aButtonSelectedHdl;
-    VclPtr<Control>        pActiveCtrl;
+    Link<SwFormToken&,void> aButtonSelectedHdl;
+    VclPtr<Control>         pActiveCtrl;
     Link<>          aModifyHdl;
     OUString        accessibleName;
     OUString        sAdditionalAccnameString1;
@@ -297,7 +297,7 @@ public:
 
     OUString    GetPattern() const;
 
-    void        SetButtonSelectedHdl(const Link<>& rLink)
+    void        SetButtonSelectedHdl(const Link<SwFormToken&,void>& rLink)
                 { aButtonSelectedHdl = rLink;}
 
     void        SetModifyHdl(const Link<>& rLink){aModifyHdl = rLink;}
@@ -415,7 +415,7 @@ class SwTOXEntryTabPage : public SfxTabPage
     DECL_LINK_TYPED(InsertTokenHdl, Button*, void);
     DECL_LINK_TYPED(LevelHdl, SvTreeListBox*, void);
     DECL_LINK_TYPED(AutoRightHdl, Button*, void);
-    DECL_LINK(TokenSelectedHdl, SwFormToken*);
+    DECL_LINK_TYPED(TokenSelectedHdl, SwFormToken&, void);
     DECL_LINK(TabPosHdl, MetricField*);
     DECL_LINK(FillCharHdl, ComboBox*);
     DECL_LINK_TYPED(RemoveInsertAuthHdl, Button*, void);


More information about the Libreoffice-commits mailing list