From 80c98c069b37bd2f8f67d2f6b59edc3b4c6abea5 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 5 Mar 2018 17:13:12 +0000 Subject: Resolves: tdf#113805 insert special character fails in insert footnote, etc dialog MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit i.e. since commit 710a39414569995bd5a8631a948c939dc73bcef9 Date: Thu May 11 13:27:38 2017 +0530 GSoC: Glyph View and Recent Characters Control in Special Characters dialog Change-Id: Ia55f3fefe7c14327cff2e996ab0038dc52f9b017 it inserts into the document, extend the fix of commit 4020945651b4f3c636980e2103db440b5c55459c Author: Daniel Date: Sun Sep 24 17:55:19 2017 -0300 tdf#111739 fix Selecting a custom character as a bullet symbol insertion to do the old thing that existing code depends on if this is not an "insert" dialog, and bubble that setting around from the callers Change-Id: Id8acf16955d0167beffae43e3b201e500ee7a929 Reviewed-on: https://gerrit.libreoffice.org/50781 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- cui/source/dialogs/cuicharmap.cxx | 15 +++++++++++++++ cui/source/factory/dlgfact.cxx | 5 ++--- cui/source/factory/dlgfact.hxx | 2 +- 3 files changed, 18 insertions(+), 4 deletions(-) (limited to 'cui/source') diff --git a/cui/source/dialogs/cuicharmap.cxx b/cui/source/dialogs/cuicharmap.cxx index 49aba8503618..2aa6c6cb060e 100644 --- a/cui/source/dialogs/cuicharmap.cxx +++ b/cui/source/dialogs/cuicharmap.cxx @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include @@ -632,6 +633,20 @@ void SvxCharacterMap::insertCharToDoc(const OUString& sGlyph) comphelper::dispatchCommand(".uno:InsertSymbol", aArgs); updateRecentCharacterList(sGlyph, aFont.GetFamilyName()); + + } else { + SfxItemSet* pSet = GetOutputSetImpl(); + if ( pSet ) + { + sal_Int32 tmp = 0; + sal_UCS4 cChar = sGlyph.iterateCodePoints(&tmp); + const SfxItemPool* pPool = pSet->GetPool(); + pSet->Put( SfxStringItem( pPool->GetWhich(SID_CHARMAP), sGlyph ) ); + pSet->Put( SvxFontItem( aFont.GetFamilyType(), aFont.GetFamilyName(), + aFont.GetStyleName(), aFont.GetPitch(), aFont.GetCharSet(), pPool->GetWhich(SID_ATTR_CHAR_FONT) ) ); + pSet->Put( SfxStringItem( pPool->GetWhich(SID_FONT_NAME), aFont.GetFamilyName() ) ); + pSet->Put( SfxInt32Item( pPool->GetWhich(SID_ATTR_CHAR), cChar ) ); + } } } diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx index b1f5a97dc2e3..b441edfdf85f 100644 --- a/cui/source/factory/dlgfact.cxx +++ b/cui/source/factory/dlgfact.cxx @@ -1207,8 +1207,7 @@ VclPtr AbstractDialogFactory_Impl::CreateSvxLineTabDialog( VclPtr AbstractDialogFactory_Impl::CreateSfxDialog( vcl::Window* pParent, const SfxItemSet& rAttr, const Reference< XFrame >& _rxDocumentFrame, - sal_uInt32 nResId - ) + sal_uInt32 nResId, bool bInsert ) { SfxModalDialog* pDlg=nullptr; switch ( nResId ) @@ -1217,7 +1216,7 @@ VclPtr AbstractDialogFactory_Impl::CreateSfxDialog( vcl::Wind pDlg = VclPtr::Create( pParent, _rxDocumentFrame, rAttr ); break; case RID_SVXDLG_CHARMAP : - pDlg = VclPtr::Create( pParent, &rAttr ); + pDlg = VclPtr::Create( pParent, &rAttr, bInsert ); break; default: break; diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx index 988553a38e9b..c5b69f6aec31 100644 --- a/cui/source/factory/dlgfact.hxx +++ b/cui/source/factory/dlgfact.hxx @@ -471,7 +471,7 @@ public: virtual VclPtr CreateSfxDialog( vcl::Window* pParent, const SfxItemSet& rAttr, const css::uno::Reference< css::frame::XFrame >& _rxFrame, - sal_uInt32 nResId ) override; + sal_uInt32 nResId, bool bInsert ) override; virtual VclPtr CreateFrameDialog( const css::uno::Reference< css::frame::XFrame >& rxFrame, sal_uInt32 nResId, const OUString& rParameter ) override; -- cgit