diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-03-05 17:13:12 +0000 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2018-03-07 13:20:20 +0100 |
commit | 80dafc57786b6e342468cea227e25fd17ac6dd10 (patch) | |
tree | 65cbb11a6275ff0075ec15adaf59818c13795415 /cui | |
parent | 4fc637930e5cc7b1cc3139b0f126e3f595be809b (diff) |
Resolves: tdf#113805 insert special character fails in insert footnote...
etc. dialogs
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>
Reviewed-on: https://gerrit.libreoffice.org/50799
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'cui')
-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 1058b70a795d..0bc4db911c28 100644 --- a/cui/source/dialogs/cuicharmap.cxx +++ b/cui/source/dialogs/cuicharmap.cxx @@ -43,6 +43,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> @@ -629,6 +630,20 @@ void SvxCharacterMap::insertCharToDoc(const OUString& sGlyph) aArgs[1].Name = "FontName"; aArgs[1].Value <<= aFont.GetFamilyName(); comphelper::dispatchCommand(".uno:InsertSymbol", aArgs); + + } 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 ) ); + } } updateRecentCharacterList(sGlyph, aFont.GetFamilyName()); diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx index ca9fb47b02b6..c903cc3b4d76 100644 --- a/cui/source/factory/dlgfact.cxx +++ b/cui/source/factory/dlgfact.cxx @@ -1221,8 +1221,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 ) @@ -1231,7 +1230,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 e9d61e3bcf93..39e4b54379bd 100644 --- a/cui/source/factory/dlgfact.hxx +++ b/cui/source/factory/dlgfact.hxx @@ -464,7 +464,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; |