summaryrefslogtreecommitdiff
path: root/sfx2/source/dialog
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-01-13 09:14:39 +0000
committerCaolán McNamara <caolanm@redhat.com>2020-01-14 11:51:06 +0100
commit94c1f5cfb96a826220b64608cf0ada76d3bdde31 (patch)
tree15c3db39b12440bb5079a28dfe1001983ab9f8f5 /sfx2/source/dialog
parent9bb9fb43a69dd7c0afe864caadb8bb9d45207479 (diff)
rework SfxCharmapCtrl to be a PopupWindowController
With MSVC, the changes to include/sfx2/charmappopup.hxx would cause spurious > isvt.lib(svtlo.dll) : error LNK2005: "public: virtual class com::sun::star::uno::Any __cdecl cppu::ImplInheritanceHelper<class svt::ToolboxController,class com::sun::star::lang::XServiceInfo>::queryInterface(class com::sun::star::uno::Type const &)" (?queryInterface@?$ImplInheritanceHelper@VToolboxController@svt@@VXServiceInfo@lang@star@sun@com@@@cppu@@UAA?AVAny@uno@star@sun@com@@ABVType@4567@@Z) already defined in classificationcontroller.o > isvt.lib(svtlo.dll) : error LNK2005: "public: virtual void __cdecl cppu::ImplInheritanceHelper<class svt::ToolboxController,class com::sun::star::lang::XServiceInfo>::acquire(void)" (?acquire@?$ImplInheritanceHelper@VToolboxController@svt@@VXServiceInfo@lang@star@sun@com@@@cppu@@UAAXXZ) already defined in classificationcontroller.o > isvt.lib(svtlo.dll) : error LNK2005: "public: virtual void __cdecl cppu::ImplInheritanceHelper<class svt::ToolboxController,class com::sun::star::lang::XServiceInfo>::release(void)" (?release@?$ImplInheritanceHelper@VToolboxController@svt@@VXServiceInfo@lang@star@sun@com@@@cppu@@UAAXXZ) already defined in classificationcontroller.o when linking Library_sfx (and which appears to be unrelated to the (implicit) /INCREMENTAL since 9739c37d8ad7c6fca269709674a6975fa7ebd191 "enable incremental linking on windows"), which requires the HACK in include/svtools/popupwindowcontroller.hxx. Change-Id: I74c4318e6216001f18d0cf5ed63e78ba2ab13cd3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86664 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sfx2/source/dialog')
-rw-r--r--sfx2/source/dialog/charmappopup.cxx39
1 files changed, 26 insertions, 13 deletions
diff --git a/sfx2/source/dialog/charmappopup.cxx b/sfx2/source/dialog/charmappopup.cxx
index bbe3ae77b413..330012c176b9 100644
--- a/sfx2/source/dialog/charmappopup.cxx
+++ b/sfx2/source/dialog/charmappopup.cxx
@@ -20,33 +20,46 @@
#include <sfx2/charmapcontrol.hxx>
#include <vcl/toolbox.hxx>
-SFX_IMPL_TOOLBOX_CONTROL(CharmapPopup, SfxVoidItem);
-
-CharmapPopup::CharmapPopup(sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx)
- : SfxToolBoxControl(nSlotId, nId, rTbx)
+CharmapPopup::CharmapPopup(const css::uno::Reference<css::uno::XComponentContext>& rContext)
+ : PopupWindowController(rContext, nullptr, OUString())
{
- rTbx.SetItemBits(nId, ToolBoxItemBits::DROPDOWNONLY | rTbx.GetItemBits(nId));
}
CharmapPopup::~CharmapPopup()
{
}
-VclPtr<SfxPopupWindow> CharmapPopup::CreatePopupWindow()
+void CharmapPopup::initialize( const css::uno::Sequence< css::uno::Any >& rArguments )
{
- VclPtr<SfxCharmapCtrl> pControl = VclPtr<SfxCharmapCtrl>::Create(GetSlotId(), &GetToolBox(), m_xFrame);
+ PopupWindowController::initialize(rArguments);
+
+ ToolBox* pToolBox = nullptr;
+ sal_uInt16 nId = 0;
+ if (getToolboxId(nId, &pToolBox) && pToolBox->GetItemCommand(nId) == m_aCommandURL)
+ pToolBox->SetItemBits(nId, ToolBoxItemBits::DROPDOWNONLY | pToolBox->GetItemBits(nId));
+}
- pControl->StartPopupMode(&GetToolBox(), FloatWinPopupFlags::GrabFocus);
+VclPtr<vcl::Window> CharmapPopup::createPopupWindow(vcl::Window* pParent)
+{
+ return VclPtr<SfxCharmapCtrl>::Create(this, pParent);
+}
- SetPopupWindow(pControl);
+OUString CharmapPopup::getImplementationName()
+{
+ return "com.sun.star.comp.sfx2.InsertSymbolToolBoxControl";
+}
- return pControl;
+css::uno::Sequence<OUString> CharmapPopup::getSupportedServiceNames()
+{
+ return { "com.sun.star.frame.ToolbarController" };
}
-void SAL_CALL CharmapPopup::execute( sal_Int16 /*KeyModifier*/ )
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
+com_sun_star_comp_sfx2_InsertSymbolToolBoxControl_get_implementation(
+ css::uno::XComponentContext* rContext,
+ css::uno::Sequence<css::uno::Any> const & )
{
- com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > aArgs;
- Dispatch(".uno:InsertSymbol", aArgs);
+ return cppu::acquire( new CharmapPopup( rContext ) );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */