diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-03-05 17:13:12 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-03-06 00:23:36 +0100 |
commit | 80c98c069b37bd2f8f67d2f6b59edc3b4c6abea5 (patch) | |
tree | 0d15e5ade886d93f7b15d3935ca806dc22b29940 /cui/source | |
parent | cbc58ebf14bd77a5f9297b7f2948952ed22460e7 (diff) |
Resolves: tdf#113805 insert special character fails in insert footnote, etc dialog
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 <danielfaleirosilva@gmail.com>
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 <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'cui/source')
-rw-r--r-- | cui/source/dialogs/cuicharmap.cxx | 15 | ||||
-rw-r--r-- | cui/source/factory/dlgfact.cxx | 5 | ||||
-rw-r--r-- | cui/source/factory/dlgfact.hxx | 2 |
3 files changed, 18 insertions, 4 deletions
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 <sfx2/request.hxx> #include <sfx2/sfxsids.hrc> #include <sfx2/app.hxx> +#include <svx/svxids.hrc> #include <editeng/editids.hrc> #include <editeng/fontitem.hxx> #include <strings.hrc> @@ -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<SfxAbstractTabDialog> AbstractDialogFactory_Impl::CreateSvxLineTabDialog( VclPtr<SfxAbstractDialog> 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<SfxAbstractDialog> AbstractDialogFactory_Impl::CreateSfxDialog( vcl::Wind pDlg = VclPtr<SfxMacroAssignDlg>::Create( pParent, _rxDocumentFrame, rAttr ); break; case RID_SVXDLG_CHARMAP : - pDlg = VclPtr<SvxCharacterMap>::Create( pParent, &rAttr ); + pDlg = VclPtr<SvxCharacterMap>::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<SfxAbstractDialog> 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<VclAbstractDialog> CreateFrameDialog( const css::uno::Reference< css::frame::XFrame >& rxFrame, sal_uInt32 nResId, const OUString& rParameter ) override; |