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

Caolán McNamara caolanm at redhat.com
Tue Mar 6 23:49:02 UTC 2018


 sc/source/ui/drawfunc/drtxtob.cxx    |    2 +-
 sc/source/ui/inc/viewutil.hxx        |    4 +---
 sc/source/ui/view/cellsh1.cxx        |   18 +-----------------
 sc/source/ui/view/editsh.cxx         |    2 +-
 sc/source/ui/view/viewutil.cxx       |   15 ++-------------
 sd/source/ui/func/fubullet.cxx       |   18 ++----------------
 sw/source/uibase/shells/annotsh.cxx  |   26 ++------------------------
 sw/source/uibase/shells/drwtxtsh.cxx |   22 ++--------------------
 sw/source/uibase/shells/textsh.cxx   |   21 ++-------------------
 9 files changed, 14 insertions(+), 114 deletions(-)

New commits:
commit 2523f32dc68d35b69a7b0ee9764e61f7d8efb3ce
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Mar 6 17:02:30 2018 +0000

    if the arg is true, the dialog dispatchs InsertSpecialChar itself
    
    and GetOutputItemSet is unused and the args won't be there. While
    they are there if the arg is false
    
    Change-Id: I934e99479f8fdf4d5102e47f6082fbbda8ececcd
    Reviewed-on: https://gerrit.libreoffice.org/50838
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx
index 6d718002f33f..dfdd03576e77 100644
--- a/sc/source/ui/drawfunc/drtxtob.cxx
+++ b/sc/source/ui/drawfunc/drtxtob.cxx
@@ -238,7 +238,7 @@ void ScDrawTextObjectBar::Execute( SfxRequest &rReq )
                         aNewItem = rItem;
                 }
                 else
-                    ScViewUtil::ExecuteCharMap( rItem, *pViewData->GetViewShell()->GetViewFrame(), aNewItem, aString );
+                    ScViewUtil::ExecuteCharMap( rItem, *pViewData->GetViewShell()->GetViewFrame() );
 
                 if ( !aString.isEmpty() )
                 {
diff --git a/sc/source/ui/inc/viewutil.hxx b/sc/source/ui/inc/viewutil.hxx
index 5ea8308220b3..5678033c969a 100644
--- a/sc/source/ui/inc/viewutil.hxx
+++ b/sc/source/ui/inc/viewutil.hxx
@@ -44,9 +44,7 @@ class SC_DLLPUBLIC ScViewUtil
 {
 public:
     static bool ExecuteCharMap( const SvxFontItem&  rOldFont,
-                                SfxViewFrame&       rFrame,
-                                SvxFontItem&        rNewFont,
-                                OUString&           rString );
+                                SfxViewFrame&       rFrame );
 
     static bool IsActionShown( const ScChangeAction& rAction,
                                 const ScChangeViewSettings& rSettings,
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index d54d7d51ce5a..e92e560d99d2 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -2470,23 +2470,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
                 aSet.Put( SvxFontItem( aCurFont.GetFamilyType(), aCurFont.GetFamilyName(), aCurFont.GetStyleName(), aCurFont.GetPitch(), aCurFont.GetCharSet(), GetPool().GetWhich(SID_ATTR_CHAR_FONT) ) );
 
                 ScopedVclPtr<SfxAbstractDialog> pDlg(pFact->CreateCharMapDialog( pTabViewShell->GetDialogParent(), aSet, true ));
-
-                if ( pDlg->Execute() == RET_OK )
-                {
-                    const SfxStringItem* pItem = SfxItemSet::GetItem<SfxStringItem>(pDlg->GetOutputItemSet(), SID_CHARMAP, false);
-                    const SvxFontItem* pFontItem = SfxItemSet::GetItem<SvxFontItem>(pDlg->GetOutputItemSet(), SID_ATTR_CHAR_FONT, false);
-
-                    if ( pItem && pFontItem )
-                    {
-                        vcl::Font aNewFont( pFontItem->GetFamilyName(), pFontItem->GetStyleName(), Size(1,1) );
-                        aNewFont.SetCharSet( pFontItem->GetCharSet() );
-                        aNewFont.SetPitch( pFontItem->GetPitch() );
-                        pTabViewShell->InsertSpecialChar( pItem->GetValue(), aNewFont );
-                        rReq.AppendItem( *pFontItem );
-                        rReq.AppendItem( *pItem );
-                        rReq.Done();
-                    }
-                }
+                pDlg->Execute();
             }
             break;
 
diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx
index 1876f088d2b3..762dfb4757ce 100644
--- a/sc/source/ui/view/editsh.cxx
+++ b/sc/source/ui/view/editsh.cxx
@@ -412,7 +412,7 @@ void ScEditShell::Execute( SfxRequest& rReq )
                 }
                 else
                 {
-                    ScViewUtil::ExecuteCharMap( rItem, *pViewData->GetViewShell()->GetViewFrame(), aNewItem, aString );
+                    ScViewUtil::ExecuteCharMap( rItem, *pViewData->GetViewShell()->GetViewFrame() );
 
                     // while the dialog was open, edit mode may have been stopped
                     if (!SC_MOD()->IsInputMode())
diff --git a/sc/source/ui/view/viewutil.cxx b/sc/source/ui/view/viewutil.cxx
index f303f7d7a85f..cb8ef91e37b3 100644
--- a/sc/source/ui/view/viewutil.cxx
+++ b/sc/source/ui/view/viewutil.cxx
@@ -327,9 +327,7 @@ void ScViewUtil::HideDisabledSlot( SfxItemSet& rSet, SfxBindings& rBindings, sal
 }
 
 bool ScViewUtil::ExecuteCharMap( const SvxFontItem& rOldFont,
-                                 SfxViewFrame& rFrame,
-                                 SvxFontItem&       rNewFont,
-                                 OUString&          rString )
+                                 SfxViewFrame& rFrame )
 {
     bool bRet = false;
     SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
@@ -339,16 +337,7 @@ bool ScViewUtil::ExecuteCharMap( const SvxFontItem& rOldFont,
         aSet.Put( SfxBoolItem( FN_PARAM_1, false ) );
         aSet.Put( SvxFontItem( rOldFont.GetFamily(), rOldFont.GetFamilyName(), rOldFont.GetStyleName(), rOldFont.GetPitch(), rOldFont.GetCharSet(), aSet.GetPool()->GetWhich( SID_ATTR_CHAR_FONT ) ) );
         ScopedVclPtr<SfxAbstractDialog> pDlg(pFact->CreateCharMapDialog( &rFrame.GetWindow(), aSet, true ));
-        if ( pDlg->Execute() == RET_OK )
-        {
-            const SfxStringItem* pItem = SfxItemSet::GetItem<SfxStringItem>(pDlg->GetOutputItemSet(), SID_CHARMAP, false);
-            const SvxFontItem* pFontItem = SfxItemSet::GetItem<SvxFontItem>(pDlg->GetOutputItemSet(), SID_ATTR_CHAR_FONT, false);
-            if ( pItem )
-                rString  = pItem->GetValue();
-            if ( pFontItem )
-                rNewFont = SvxFontItem( pFontItem->GetFamily(), pFontItem->GetFamilyName(), pFontItem->GetStyleName(), pFontItem->GetPitch(), pFontItem->GetCharSet(), rNewFont.Which() );
-            bRet = true;
-        }
+        pDlg->Execute();
     }
     return bRet;
 }
diff --git a/sd/source/ui/func/fubullet.cxx b/sd/source/ui/func/fubullet.cxx
index f4b2be0e45fa..e90da72220f5 100644
--- a/sd/source/ui/func/fubullet.cxx
+++ b/sd/source/ui/func/fubullet.cxx
@@ -198,22 +198,8 @@ void FuBullet::InsertSpecialCharacter( SfxRequest const & rReq )
         // If a character is selected, it can be shown
         // pDLg->SetFont( );
         // pDlg->SetChar( );
-        sal_uInt16 nResult = pDlg->Execute();
-        if( nResult == RET_OK )
-        {
-            const SfxStringItem* pCItem = SfxItemSet::GetItem<SfxStringItem>(pDlg->GetOutputItemSet(), SID_CHARMAP, false);
-            const SvxFontItem* pFItem = SfxItemSet::GetItem<SvxFontItem>(pDlg->GetOutputItemSet(), SID_ATTR_CHAR_FONT, false);
-            if ( pFItem )
-            {
-                aFont.SetFamilyName( pFItem->GetFamilyName() );
-                aFont.SetStyleName( pFItem->GetStyleName() );
-                aFont.SetCharSet( pFItem->GetCharSet() );
-                aFont.SetPitch( pFItem->GetPitch() );
-            }
-
-            if ( pCItem )
-                aChars  = pCItem->GetValue();
-        }
+        pDlg->Execute();
+        return;
     }
 
     if (!aChars.isEmpty())
diff --git a/sw/source/uibase/shells/annotsh.cxx b/sw/source/uibase/shells/annotsh.cxx
index 214f9086b448..fbe9f2273269 100644
--- a/sw/source/uibase/shells/annotsh.cxx
+++ b/sw/source/uibase/shells/annotsh.cxx
@@ -1751,31 +1751,9 @@ void SwAnnotationShell::InsertSymbol(SfxRequest& rReq)
 
         // If character is selected then it can be shown.
         ScopedVclPtr<SfxAbstractDialog> pDlg(pFact->CreateCharMapDialog(rView.GetWindow(), aAllSet, true));
-
-        sal_uInt16 nResult = pDlg->Execute();
-        if( nResult == RET_OK )
-        {
-            const SfxStringItem* pCItem = SfxItemSet::GetItem<SfxStringItem>(pDlg->GetOutputItemSet(), SID_CHARMAP, false);
-            const SvxFontItem* pFontItem = SfxItemSet::GetItem<SvxFontItem>(pDlg->GetOutputItemSet(), SID_ATTR_CHAR_FONT, false);
-            if ( pFontItem )
-            {
-                aFont.SetFamilyName( pFontItem->GetFamilyName() );
-                aFont.SetStyleName( pFontItem->GetStyleName() );
-                aFont.SetCharSet( pFontItem->GetCharSet() );
-                aFont.SetPitch( pFontItem->GetPitch() );
-            }
-
-            if ( pCItem )
-            {
-                sSym  = pCItem->GetValue();
-                aOpt.SetSymbolFont(aFont.GetFamilyName());
-                SW_MOD()->ApplyUsrPref(aOpt, &rView);
-            }
-        }
-    }
-
-    if( sSym.isEmpty() )
+        pDlg->Execute();
         return;
+    }
 
     // do not flicker
     pOLV->HideCursor();
diff --git a/sw/source/uibase/shells/drwtxtsh.cxx b/sw/source/uibase/shells/drwtxtsh.cxx
index 424b1e6984de..a8763fc819ad 100644
--- a/sw/source/uibase/shells/drwtxtsh.cxx
+++ b/sw/source/uibase/shells/drwtxtsh.cxx
@@ -728,26 +728,8 @@ void SwDrawTextShell::InsertSymbol(SfxRequest& rReq)
         // If character is selected, it can be shown
         SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
         ScopedVclPtr<SfxAbstractDialog> pDlg(pFact->CreateCharMapDialog( rView.GetWindow(), aAllSet, true ));
-        sal_uInt16 nResult = pDlg->Execute();
-        if( nResult == RET_OK )
-        {
-            const SfxStringItem* pCItem = SfxItemSet::GetItem<SfxStringItem>(pDlg->GetOutputItemSet(), SID_CHARMAP, false);
-            const SvxFontItem* pFontItem = SfxItemSet::GetItem<SvxFontItem>(pDlg->GetOutputItemSet(), SID_ATTR_CHAR_FONT, false);
-            if ( pFontItem )
-            {
-                aFont.SetFamilyName( pFontItem->GetFamilyName() );
-                aFont.SetStyleName( pFontItem->GetStyleName() );
-                aFont.SetCharSet( pFontItem->GetCharSet() );
-                aFont.SetPitch( pFontItem->GetPitch() );
-            }
-
-            if ( pCItem )
-            {
-                sSym  = pCItem->GetValue();
-                aOpt.SetSymbolFont(aFont.GetFamilyName());
-                SW_MOD()->ApplyUsrPref(aOpt, &rView);
-            }
-        }
+        pDlg->Execute();
+        return;
     }
 
     if( sSym.isEmpty() )
diff --git a/sw/source/uibase/shells/textsh.cxx b/sw/source/uibase/shells/textsh.cxx
index 26c6864461e0..fc3a0799d15d 100644
--- a/sw/source/uibase/shells/textsh.cxx
+++ b/sw/source/uibase/shells/textsh.cxx
@@ -934,25 +934,8 @@ void SwTextShell::InsertSymbol( SfxRequest& rReq )
 
         SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
         ScopedVclPtr<SfxAbstractDialog> pDlg(pFact->CreateCharMapDialog( GetView().GetWindow(), aAllSet, true ));
-        if( RET_OK == pDlg->Execute() )
-        {
-            const SfxStringItem* pCItem = SfxItemSet::GetItem<SfxStringItem>(pDlg->GetOutputItemSet(), SID_CHARMAP, false);
-            const SvxFontItem* pFontItem = SfxItemSet::GetItem<SvxFontItem>(pDlg->GetOutputItemSet(), SID_ATTR_CHAR_FONT, false);
-            if ( pFontItem )
-            {
-                aNewFont.SetFamilyName( pFontItem->GetFamilyName() );
-                aNewFont.SetStyleName( pFontItem->GetStyleName() );
-                aNewFont.SetCharSet( pFontItem->GetCharSet() );
-                aNewFont.SetPitch( pFontItem->GetPitch() );
-            }
-
-            if ( pCItem )
-            {
-                aChars  = pCItem->GetValue();
-                aOpt.SetSymbolFont(aNewFont.GetFamilyName());
-                SW_MOD()->ApplyUsrPref(aOpt, &GetView());
-            }
-        }
+        pDlg->Execute();
+        return;
     }
 
     if( !aChars.isEmpty() )


More information about the Libreoffice-commits mailing list