desktop/qa/desktop_lib/test_desktop_lib.cxx | 5 framework/Library_fwl.mk | 1 framework/inc/services.h | 1 framework/source/dispatch/dispatchdisabler.cxx | 171 +++++++++++++++++++++ framework/source/dispatch/interceptionhelper.cxx | 2 framework/source/inc/dispatch/dispatchdisabler.hxx | 117 ++++++++++++++ framework/source/register/registertemp.cxx | 6 framework/util/fwl.component | 3 include/svx/svxids.hrc | 6 sc/source/ui/view/tabvwsha.cxx | 11 + sd/sdi/tables.sdi | 20 ++ sd/source/ui/table/tableobjectbar.cxx | 44 ++++- sfx2/sdi/sfx.sdi | 2 sfx2/source/appl/appuno.cxx | 1 svx/sdi/svx.sdi | 78 +++++++++ sw/source/uibase/uno/SwXDocumentSettings.cxx | 2 vcl/source/outdev/font.cxx | 10 + 17 files changed, 461 insertions(+), 19 deletions(-)
New commits: commit 9afccca15068e3796b30a5910f2abcd9457789ac Author: Tor Lillqvist <t...@collabora.com> Date: Sun May 8 08:25:31 2016 +0300 -Werror=missing-field-initializers. Add missing initializer for member âcomphelper::PropertyInfo::mnMemberIdâ. (cherry picked from commit bd55be7ec88b1b8af3eb0b3b98be4f73453f9f89) Change-Id: Id8c1adb24c68432ddbf6b491c419f359d228286a diff --git a/sw/source/uibase/uno/SwXDocumentSettings.cxx b/sw/source/uibase/uno/SwXDocumentSettings.cxx index 1dad3e0..f309399 100644 --- a/sw/source/uibase/uno/SwXDocumentSettings.cxx +++ b/sw/source/uibase/uno/SwXDocumentSettings.cxx @@ -206,7 +206,7 @@ static MasterPropertySetInfo * lcl_createSettingsInfo() { OUString("ApplyParagraphMarkFormatToNumbering"), HANDLE_APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING, cppu::UnoType<bool>::get(), 0}, { OUString("PropLineSpacingShrinksFirstLine"), HANDLE_PROP_LINE_SPACING_SHRINKS_FIRST_LINE, cppu::UnoType<bool>::get(), 0}, { OUString("SubtractFlysAnchoredAtFlys"), HANDLE_SUBTRACT_FLYS, cppu::UnoType<bool>::get(), 0}, - { OUString("InBrowseMode"), HANDLE_BROWSE_MODE, cppu::UnoType<bool>::get(), 0}, + { OUString("InBrowseMode"), HANDLE_BROWSE_MODE, cppu::UnoType<bool>::get(), 0, 0}, /* * As OS said, we don't have a view when we need to set this, so I have to * find another solution before adding them to this property set - MTG commit 1ae74a3605a95414cd592226ea5ace863ed113cf Author: Pranav Kant <pran...@collabora.com> Date: Wed May 11 18:32:52 2016 +0530 sc: Add new param, DontTerminateEdit, to .uno:Save ... which determines if current editing mode before save should be terminated with save or not. Change-Id: I49318013f1244eb8681a19ed3da50fbecd336a3d (cherry picked from commit a5a71cea62ac3041006c5e9815ae2317999639ac) Reviewed-on: https://gerrit.libreoffice.org/24895 Reviewed-by: pranavk <pran...@collabora.com> Tested-by: pranavk <pran...@collabora.com> (cherry picked from commit fa4c2244122230e90e8e972950a6ef4a5b0c0dc5) diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx index 7eebef0..6b9ef01 100644 --- a/sc/source/ui/view/tabvwsha.cxx +++ b/sc/source/ui/view/tabvwsha.cxx @@ -695,9 +695,16 @@ void ScTabViewShell::UpdateInputHandlerCellAdjust( SvxCellHorJustify eJust ) void ScTabViewShell::ExecuteSave( SfxRequest& rReq ) { // only SID_SAVEDOC / SID_SAVEASDOC + bool bCommitChanges = true; + const SfxItemSet* pReqArgs = rReq.GetArgs(); + const SfxPoolItem* pItem; + + if (pReqArgs && pReqArgs->HasItem(FN_PARAM_1, &pItem)) + bCommitChanges = !static_cast<const SfxBoolItem*>(pItem)->GetValue(); - // Finish entering in any case, even if a formula is being processed - SC_MOD()->InputEnterHandler(); + // Finish entering unless 'DontTerminateEdit' is specified, even if a formula is being processed + if (bCommitChanges) + SC_MOD()->InputEnterHandler(); if ( GetViewData().GetDocShell()->IsDocShared() ) { diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi index 4f2841c..8c3bad6 100644 --- a/sfx2/sdi/sfx.sdi +++ b/sfx2/sdi/sfx.sdi @@ -4934,7 +4934,7 @@ SfxVoidItem RunBasic SID_BASICRUN SfxBoolItem Save SID_SAVEDOC -(SfxStringItem VersionComment SID_DOCINFO_COMMENTS,SfxStringItem Author SID_DOCINFO_AUTHOR) +(SfxStringItem VersionComment SID_DOCINFO_COMMENTS,SfxStringItem Author SID_DOCINFO_AUTHOR,SfxBoolItem DontTerminateEdit FN_PARAM_1) [ /* flags: */ AutoUpdate = FALSE, diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx index 42f4b54..4a2e6a1 100644 --- a/sfx2/source/appl/appuno.cxx +++ b/sfx2/source/appl/appuno.cxx @@ -84,6 +84,7 @@ SfxFormalArgument aFormalArgs[] = { { reinterpret_cast<SfxType*>(&aSfxStringItem_Impl), "SuggestedSaveAsDir", SID_DEFAULTFILEPATH }, { reinterpret_cast<SfxType*>(&aSfxStringItem_Impl), "VersionAuthor", SID_DOCINFO_AUTHOR }, { reinterpret_cast<SfxType*>(&aSfxStringItem_Impl), "VersionComment", SID_DOCINFO_COMMENTS }, + { reinterpret_cast<SfxType*>(&aSfxBoolItem_Impl), "DontTerminateEdit", FN_PARAM_1 }, { reinterpret_cast<SfxType*>(&aSfxBoolItem_Impl), "VersionMajor", SID_DOCINFO_MAJOR }, { reinterpret_cast<SfxType*>(&aSfxStringItem_Impl), "FilterOptions", SID_FILE_FILTEROPTIONS }, { reinterpret_cast<SfxType*>(&aSfxStringItem_Impl), "FilterName", SID_FILTER_NAME }, commit 88189919e8e7e4c2f611886d792416e175f23990 Author: Miklos Vajna <vmik...@collabora.co.uk> Date: Thu May 12 20:32:34 2016 +0200 framework: register DispatchDisabler service Change-Id: I72d9f8b00ba8b2e4e5dc70d7fd77e13ccf9d3bcc Reviewed-on: https://gerrit.libreoffice.org/24940 Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk> Tested-by: Jenkins <c...@libreoffice.org> (cherry picked from commit 1f041bf31e071611a15ffa1559d2f5df05a685f0) (cherry picked from commit 6f857ead2e530c5d570f035a39cdcd3765ad4660) diff --git a/framework/util/fwl.component b/framework/util/fwl.component index b035083..83e513c 100644 --- a/framework/util/fwl.component +++ b/framework/util/fwl.component @@ -70,4 +70,7 @@ <implementation name="com.sun.star.comp.framework.services.DispatchHelper"> <service name="com.sun.star.frame.DispatchHelper"/> </implementation> + <implementation name="com.sun.star.comp.framework.services.DispatchDisabler"> + <service name="com.sun.star.frame.DispatchDisabler"/> + </implementation> </component> commit 194b54868a0815e5f80f0be44a597a60f375c446 Author: Michael Meeks <michael.me...@collabora.com> Date: Thu Jan 7 19:24:41 2016 +0000 framework: initial implementation of a dispatch disabler. This should allow remote, eg. URE dispatchers to trivially disable lots of the UI without requiring a large volume of round-trip IPC. Change-Id: Ibd0681ac993196f826b4ed411da5ffedb7f85786 Reviewed-on: https://gerrit.libreoffice.org/24938 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk> (cherry picked from commit 02833c03ee856a62d7185829b7c47bc088e086cc) diff --git a/framework/Library_fwl.mk b/framework/Library_fwl.mk index c5e1ad1..ea325e0 100644 --- a/framework/Library_fwl.mk +++ b/framework/Library_fwl.mk @@ -59,6 +59,7 @@ $(eval $(call gb_Library_add_exception_objects,fwl,\ framework/source/recording/dispatchrecorder \ framework/source/recording/dispatchrecordersupplier \ framework/source/register/registertemp \ + framework/source/dispatch/dispatchdisabler \ framework/source/services/dispatchhelper \ framework/source/services/mediatypedetectionhelper \ framework/source/services/uriabbreviation \ diff --git a/framework/inc/services.h b/framework/inc/services.h index 522a966..9264337 100644 --- a/framework/inc/services.h +++ b/framework/inc/services.h @@ -44,6 +44,7 @@ namespace framework{ #define IMPLEMENTATIONNAME_MAILTODISPATCHER "com.sun.star.comp.framework.MailToDispatcher" #define IMPLEMENTATIONNAME_SERVICEHANDLER "com.sun.star.comp.framework.ServiceHandler" #define IMPLEMENTATIONNAME_DISPATCHHELPER "com.sun.star.comp.framework.services.DispatchHelper" +#define IMPLEMENTATIONNAME_DISPATCHDISABLER "com.sun.star.comp.framework.services.DispatchDisabler" #define IMPLEMENTATIONNAME_MACROSMENUCONTROLLER "com.sun.star.comp.framework.MacrosMenuController" #define IMPLEMENTATIONNAME_FONTMENUCONTROLLER "com.sun.star.comp.framework.FontMenuController" #define IMPLEMENTATIONNAME_FONTSIZEMENUCONTROLLER "com.sun.star.comp.framework.FontSizeMenuController" diff --git a/framework/source/dispatch/dispatchdisabler.cxx b/framework/source/dispatch/dispatchdisabler.cxx new file mode 100644 index 0000000..608b18d --- /dev/null +++ b/framework/source/dispatch/dispatchdisabler.cxx @@ -0,0 +1,171 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include <sal/config.h> + +#include "services.h" +#include "dispatch/dispatchdisabler.hxx" + +#include <com/sun/star/frame/XFrame.hpp> +#include <com/sun/star/frame/DispatchDescriptor.hpp> + +using namespace css; +using namespace framework; + +DispatchDisabler::DispatchDisabler(const uno::Reference< uno::XComponentContext >& rxContext) : + mxContext( rxContext ) +{ +} + +// XInitialization +void SAL_CALL DispatchDisabler::initialize( const uno::Sequence< uno::Any >& aArguments ) + throw (uno::Exception, uno::RuntimeException, ::std::exception) +{ + uno::Sequence< OUString > aDisabledURLs; + if( aArguments.getLength() > 0 && + ( aArguments[0] >>= aDisabledURLs ) ) + { + for( sal_Int32 i = 0; i < aDisabledURLs.getLength(); ++i ) + maDisabledURLs.insert(aDisabledURLs[i]); + } +} + +// XDispatchProvider +uno::Reference< frame::XDispatch > SAL_CALL +DispatchDisabler::queryDispatch( const util::URL& rURL, + const OUString& rTargetFrameName, + ::sal_Int32 nSearchFlags ) + throw (uno::RuntimeException, ::std::exception) +{ + // If present - disabled. + if( maDisabledURLs.find(rURL.Complete) != maDisabledURLs.end() || + !mxSlave.is() ) + return uno::Reference< frame::XDispatch >(); + else + return mxSlave->queryDispatch(rURL, rTargetFrameName, nSearchFlags); +} + +uno::Sequence< uno::Reference< frame::XDispatch > > SAL_CALL +DispatchDisabler::queryDispatches( const uno::Sequence< frame::DispatchDescriptor >& rRequests ) + throw (uno::RuntimeException, ::std::exception) +{ + uno::Sequence< uno::Reference< frame::XDispatch > > aResult(rRequests.getLength()); + for( sal_Int32 i = 0; i < rRequests.getLength(); ++i ) + aResult[i] = queryDispatch(rRequests[i].FeatureURL, + rRequests[i].FrameName, + rRequests[i].SearchFlags); + return aResult; +} + +// XDispatchProviderInterceptor +uno::Reference< frame::XDispatchProvider > SAL_CALL +DispatchDisabler::getSlaveDispatchProvider() throw (uno::RuntimeException, ::std::exception) +{ + return mxSlave; +} + +void SAL_CALL DispatchDisabler::setSlaveDispatchProvider( const uno::Reference< frame::XDispatchProvider >& xNewDispatchProvider ) + throw (uno::RuntimeException, ::std::exception) +{ + mxSlave = xNewDispatchProvider; +} + +uno::Reference< frame::XDispatchProvider > SAL_CALL +DispatchDisabler::getMasterDispatchProvider() throw (uno::RuntimeException, ::std::exception) +{ + return mxMaster; +} +void SAL_CALL +DispatchDisabler::setMasterDispatchProvider( const uno::Reference< frame::XDispatchProvider >& xNewSupplier ) + throw (uno::RuntimeException, ::std::exception) +{ + mxMaster = xNewSupplier; +} + +// XInterceptorInfo +uno::Sequence< OUString > SAL_CALL + DispatchDisabler::getInterceptedURLs() + throw (uno::RuntimeException, ::std::exception) +{ + uno::Sequence< OUString > aDisabledURLs(maDisabledURLs.size()); + sal_Int32 n = 0; + for (auto i = aDisabledURLs.begin(); i != aDisabledURLs.end(); ++i) + aDisabledURLs[n++] = *i; + return aDisabledURLs; +} + +// XElementAccess +uno::Type SAL_CALL DispatchDisabler::getElementType() + throw (uno::RuntimeException, ::std::exception) +{ + uno::Type aModuleType = cppu::UnoType<OUString>::get(); + return aModuleType; +} + +::sal_Bool SAL_CALL DispatchDisabler::hasElements() + throw (uno::RuntimeException, ::std::exception) +{ + return maDisabledURLs.size() > 0; +} + +// XNameAccess +uno::Any SAL_CALL DispatchDisabler::getByName( const OUString& ) + throw (container::NoSuchElementException, lang::WrappedTargetException, + uno::RuntimeException, ::std::exception) +{ + return uno::Any(); +} + +uno::Sequence< OUString > SAL_CALL DispatchDisabler::getElementNames() + throw (uno::RuntimeException, ::std::exception) +{ + return getInterceptedURLs(); +} + +sal_Bool SAL_CALL DispatchDisabler::hasByName( const OUString& rName ) + throw (uno::RuntimeException, ::std::exception) +{ + return maDisabledURLs.find(rName) != maDisabledURLs.end(); +} + +// XNameReplace +void SAL_CALL DispatchDisabler::replaceByName( const OUString& rName, const uno::Any& aElement ) + throw (lang::IllegalArgumentException, container::NoSuchElementException, + lang::WrappedTargetException, uno::RuntimeException, ::std::exception) +{ + removeByName( rName ); + insertByName( rName, aElement ); +} + +// XNameContainer +void DispatchDisabler::insertByName( const OUString& rName, const uno::Any& ) + throw (lang::IllegalArgumentException, container::ElementExistException, + lang::WrappedTargetException, uno::RuntimeException, ::std::exception) +{ + maDisabledURLs.insert(rName); +} + +void DispatchDisabler::removeByName( const OUString& rName ) + throw (container::NoSuchElementException, lang::WrappedTargetException, + uno::RuntimeException, ::std::exception) +{ + auto it = maDisabledURLs.find(rName); + if( it != maDisabledURLs.end() ) + maDisabledURLs.erase(it); +} + +DEFINE_INIT_SERVICE(DispatchDisabler, {}) + +// XServiceInfo +DEFINE_XSERVICEINFO_MULTISERVICE_2(DispatchDisabler, + ::cppu::OWeakObject, + "com.sun.star.frame.DispatchDisabler", + IMPLEMENTATIONNAME_DISPATCHDISABLER) + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/source/dispatch/interceptionhelper.cxx b/framework/source/dispatch/interceptionhelper.cxx index affce9a..a2bc6b2 100644 --- a/framework/source/dispatch/interceptionhelper.cxx +++ b/framework/source/dispatch/interceptionhelper.cxx @@ -101,7 +101,7 @@ css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > SAL_CALL Inte void SAL_CALL InterceptionHelper::registerDispatchProviderInterceptor(const css::uno::Reference< css::frame::XDispatchProviderInterceptor >& xInterceptor) throw(css::uno::RuntimeException, std::exception) { - // reject wrong calling of this interface method + // reject incorrect calls of this interface method css::uno::Reference< css::frame::XDispatchProvider > xThis(static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY); if (!xInterceptor.is()) throw css::uno::RuntimeException("NULL references not allowed as in parameter", xThis); diff --git a/framework/source/inc/dispatch/dispatchdisabler.hxx b/framework/source/inc/dispatch/dispatchdisabler.hxx new file mode 100644 index 0000000..3d7a618 --- /dev/null +++ b/framework/source/inc/dispatch/dispatchdisabler.hxx @@ -0,0 +1,117 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +#ifndef INCLUDED_FRAMEWORK_INC_SERVICES_DISPATCH_DISABLER_HXX +#define INCLUDED_FRAMEWORK_INC_SERVICES_DISPATCH_DISABLER_HXX + +#include <set> + +#include <cppuhelper/implbase.hxx> +#include <cppuhelper/weakref.hxx> + +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/lang/XInitialization.hpp> +#include <com/sun/star/container/XNameContainer.hpp> +#include <com/sun/star/frame/XDispatch.hpp> +#include <com/sun/star/frame/XInterceptorInfo.hpp> +#include <com/sun/star/frame/XDispatchProvider.hpp> +#include <com/sun/star/frame/XDispatchProviderInterceptor.hpp> + +#include <macros/xserviceinfo.hxx> + +namespace framework { + +/** + * Implementation of a service to make it easy to disable a whole + * suite of UNO commands in a batch - and have that act in-process. + * + * Often external re-use of LibreOffice wants a very cut-down set + * of functionality included, and disabling elements remotely one + * by one performs poorly. + */ +class DispatchDisabler : public ::cppu::WeakImplHelper< + css::lang::XInitialization, + css::container::XNameContainer, + css::frame::XDispatchProviderInterceptor, + css::frame::XInterceptorInfo, + css::lang::XServiceInfo > +{ + std::set<OUString> maDisabledURLs; + css::uno::Reference< css::frame::XDispatchProvider > mxSlave; + css::uno::Reference< css::frame::XDispatchProvider > mxMaster; + css::uno::Reference< css::uno::XComponentContext > mxContext; +public: + DispatchDisabler(const css::uno::Reference< css::uno::XComponentContext >& rxContext); + virtual ~DispatchDisabler() {} + + // XInitialization + virtual void SAL_CALL initialize( const ::css::uno::Sequence< ::css::uno::Any >& aArguments ) + throw (::css::uno::Exception, ::css::uno::RuntimeException, ::std::exception) override; + + // XDispatchProvider + virtual ::css::uno::Reference< ::css::frame::XDispatch > SAL_CALL + queryDispatch( const ::css::util::URL& URL, + const OUString& TargetFrameName, + ::sal_Int32 SearchFlags ) + throw (::css::uno::RuntimeException, ::std::exception) override; + virtual ::css::uno::Sequence< ::css::uno::Reference< ::css::frame::XDispatch > > SAL_CALL + queryDispatches( const ::css::uno::Sequence< ::css::frame::DispatchDescriptor >& Requests ) + throw (::css::uno::RuntimeException, ::std::exception) override; + + // XDispatchProviderInterceptor + virtual ::css::uno::Reference< ::css::frame::XDispatchProvider > SAL_CALL + getSlaveDispatchProvider() throw (::css::uno::RuntimeException, ::std::exception) override; + virtual void SAL_CALL + setSlaveDispatchProvider( const ::css::uno::Reference< ::css::frame::XDispatchProvider >& NewDispatchProvider ) + throw (::css::uno::RuntimeException, ::std::exception) override; + virtual ::css::uno::Reference< ::css::frame::XDispatchProvider > SAL_CALL + getMasterDispatchProvider() throw (::css::uno::RuntimeException, ::std::exception) override; + virtual void SAL_CALL + setMasterDispatchProvider( const ::css::uno::Reference< ::css::frame::XDispatchProvider >& NewSupplier ) + throw (::css::uno::RuntimeException, ::std::exception) override; + + // XInterceptorInfo + virtual ::css::uno::Sequence< OUString > SAL_CALL + getInterceptedURLs() throw (::css::uno::RuntimeException, ::std::exception) override; + + // XElementAccess + virtual ::css::uno::Type SAL_CALL getElementType() + throw (::css::uno::RuntimeException, ::std::exception) override; + virtual ::sal_Bool SAL_CALL hasElements() + throw (::css::uno::RuntimeException, ::std::exception) override; + + // XNameAccess + virtual ::css::uno::Any SAL_CALL getByName( const OUString& aName ) + throw (::css::container::NoSuchElementException, ::css::lang::WrappedTargetException, + ::css::uno::RuntimeException, ::std::exception) override; + virtual ::css::uno::Sequence< OUString > SAL_CALL getElementNames() + throw (::css::uno::RuntimeException, ::std::exception) override; + virtual sal_Bool SAL_CALL hasByName( const OUString& aName ) + throw (::css::uno::RuntimeException, ::std::exception) override; + + // XNameReplace + virtual void SAL_CALL replaceByName( const OUString& aName, const ::css::uno::Any& aElement ) + throw (::css::lang::IllegalArgumentException, ::css::container::NoSuchElementException, + ::css::lang::WrappedTargetException, ::css::uno::RuntimeException, ::std::exception) override; + + // XNameContainer + virtual void SAL_CALL insertByName( const OUString& aName, const ::css::uno::Any& aElement ) + throw (::css::lang::IllegalArgumentException, ::css::container::ElementExistException, + ::css::lang::WrappedTargetException, ::css::uno::RuntimeException, ::std::exception) override; + virtual void SAL_CALL removeByName( const OUString& Name ) + throw (::css::container::NoSuchElementException, ::css::lang::WrappedTargetException, + ::css::uno::RuntimeException, ::std::exception) override; + + DECLARE_XSERVICEINFO +}; + +} // namespace framework + +#endif // INCLUDED_FRAMEWORK_INC_SERVICES_DISPATCH_DISABLER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/source/register/registertemp.cxx b/framework/source/register/registertemp.cxx index e02195c..393c5bd 100644 --- a/framework/source/register/registertemp.cxx +++ b/framework/source/register/registertemp.cxx @@ -37,6 +37,7 @@ #include <dispatch/oxt_handler.hxx> #include <dispatch/popupmenudispatcher.hxx> #include <dispatch/servicehandler.hxx> +#include <dispatch/dispatchdisabler.hxx> #include <services/dispatchhelper.hxx> #include <recording/dispatchrecorder.hxx> #include <recording/dispatchrecordersupplier.hxx> @@ -51,11 +52,12 @@ #include <uielement/toolbarsmenucontroller.hxx> COMPONENTGETFACTORY ( fwl, - IFFACTORY( ::framework::MediaTypeDetectionHelper ) - IFFACTORY( ::framework::MailToDispatcher ) else + IFFACTORY( ::framework::MediaTypeDetectionHelper ) + IFFACTORY( ::framework::MailToDispatcher ) else IFFACTORY( ::framework::ServiceHandler ) else IFFACTORY( ::framework::PopupMenuDispatcher ) else IFFACTORY( ::framework::DispatchHelper ) else + IFFACTORY( ::framework::DispatchDisabler ) else IFFACTORY( ::framework::DispatchRecorder ) else IFFACTORY( ::framework::DispatchRecorderSupplier ) else IFFACTORY( ::framework::ToolbarsMenuController ) else commit 178a3a7df15882bf21d9a676a8fecae0c068aebd Author: Henry Castro <hcas...@collabora.com> Date: Tue May 24 17:24:16 2016 -0400 lok: reset the font list when there are no items In the pre-init stage the devices were initialized with no font list, but later the font list is updated. So those devices were not updated. Change-Id: I157d4c7079f9b1252916eb92b512aadb8e77329f (cherry picked from commit 260f3ff257d7839119c8221397d18a516afd8799) diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx index 1c48254..e8f6ff4 100644 --- a/desktop/qa/desktop_lib/test_desktop_lib.cxx +++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx @@ -225,7 +225,8 @@ void DesktopLOKTest::testGetStyles() void DesktopLOKTest::testGetFonts() { - LibLODocument_Impl* pDocument = loadDoc("blank_text.odt"); + comphelper::LibreOfficeKit::setActive(); + LibLODocument_Impl* pDocument = loadDoc("blank_presentation.odp"); boost::property_tree::ptree aTree; char* pJSON = pDocument->m_pDocumentClass->getCommandValues(pDocument, ".uno:CharFontName"); std::stringstream aStream(pJSON); @@ -240,6 +241,8 @@ void DesktopLOKTest::testGetFonts() // check that we have font sizes available for each font CPPUNIT_ASSERT( rPair.second.size() > 0); } + free(pJSON); + comphelper::LibreOfficeKit::setActive(false); } void DesktopLOKTest::testCreateView() diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx index f2885f0..e15f2df 100644 --- a/vcl/source/outdev/font.cxx +++ b/vcl/source/outdev/font.cxx @@ -93,9 +93,19 @@ int OutputDevice::GetDevFontCount() const if( !mpGetDevFontList ) { if (!mpFontCollection) + { return 0; + } mpGetDevFontList = mpFontCollection->GetDevFontList(); + + if (!mpGetDevFontList->Count()) + { + delete mpGetDevFontList; + mpGetDevFontList = nullptr; + + return 0; + } } return mpGetDevFontList->Count(); } commit 63582ab268fca7f2fb0f9d88d724f3da825d6dac Author: Jan Holesovsky <ke...@collabora.com> Date: Wed May 25 13:05:42 2016 +0200 sd bccu#1840: .uno: commands for inserting rows / columns in Impress. Change-Id: Ic07722c3e1f75d909ec8f123919a1898dfde05b0 (cherry picked from commit 99b8598495ba76e8fd32af2ace17e0b29b3beffd) diff --git a/include/svx/svxids.hrc b/include/svx/svxids.hrc index 1ec7daa..b77b1b0 100644 --- a/include/svx/svxids.hrc +++ b/include/svx/svxids.hrc @@ -529,6 +529,12 @@ #define SID_RULER_PROTECT ( SID_SVX_START + 415 ) #define SID_COLOR_CONTROL ( SID_SVX_START + 417 ) + +#define SID_TABLE_INSERT_COL_BEFORE ( SID_SVX_START + 418 ) +#define SID_TABLE_INSERT_COL_AFTER ( SID_SVX_START + 419 ) +#define SID_TABLE_INSERT_ROW_BEFORE ( SID_SVX_START + 420 ) +#define SID_TABLE_INSERT_ROW_AFTER ( SID_SVX_START + 421 ) + #define SID_ATTR_3D_INTERN ( SID_SVX_START + 422 ) #define SID_PSZ_FUNCTION ( SID_SVX_START + 423 ) diff --git a/sd/sdi/tables.sdi b/sd/sdi/tables.sdi index 0d3eb62..4e234a7 100644 --- a/sd/sdi/tables.sdi +++ b/sd/sdi/tables.sdi @@ -83,11 +83,31 @@ shell TableObjectBar ExecMethod = Execute; StateMethod = GetState; ] + SID_TABLE_INSERT_ROW_BEFORE + [ + ExecMethod = Execute; + StateMethod = GetState; + ] + SID_TABLE_INSERT_ROW_AFTER + [ + ExecMethod = Execute; + StateMethod = GetState; + ] SID_TABLE_INSERT_COL_DLG [ ExecMethod = Execute; StateMethod = GetState; ] + SID_TABLE_INSERT_COL_BEFORE + [ + ExecMethod = Execute; + StateMethod = GetState; + ] + SID_TABLE_INSERT_COL_AFTER + [ + ExecMethod = Execute; + StateMethod = GetState; + ] SID_TABLE_DELETE_ROW [ ExecMethod = Execute; diff --git a/sd/source/ui/table/tableobjectbar.cxx b/sd/source/ui/table/tableobjectbar.cxx index 75ac910..2f19049 100644 --- a/sd/source/ui/table/tableobjectbar.cxx +++ b/sd/source/ui/table/tableobjectbar.cxx @@ -136,23 +136,45 @@ void TableObjectBar::Execute( SfxRequest& rReq ) switch( nSlotId ) { case SID_TABLE_INSERT_ROW_DLG: + case SID_TABLE_INSERT_ROW_BEFORE: + case SID_TABLE_INSERT_ROW_AFTER: case SID_TABLE_INSERT_COL_DLG: + case SID_TABLE_INSERT_COL_BEFORE: + case SID_TABLE_INSERT_COL_AFTER: { - SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - std::unique_ptr<SvxAbstractInsRowColDlg> pDlg( pFact ? pFact->CreateSvxInsRowColDlg( mpView->GetViewShell()->GetParentWindow(), nSlotId == SID_TABLE_INSERT_COL_DLG, SD_MOD()->GetSlotPool()->GetSlot(nSlotId)->GetCommand()) : nullptr); - - if( pDlg.get() && (pDlg->Execute() == 1) ) + std::unique_ptr<SvxAbstractInsRowColDlg> pDlg; + if (nSlotId == SID_TABLE_INSERT_ROW_DLG || nSlotId == SID_TABLE_INSERT_COL_DLG) { - if( nSlotId == SID_TABLE_INSERT_ROW_DLG ) - nSlotId = SID_TABLE_INSERT_ROW; - else - nSlotId = SID_TABLE_INSERT_COL; + SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); + pDlg.reset(pFact ? pFact->CreateSvxInsRowColDlg(mpView->GetViewShell()->GetParentWindow(), nSlotId == SID_TABLE_INSERT_COL_DLG, SD_MOD()->GetSlotPool()->GetSlot(nSlotId)->GetCommand()) : nullptr); + + if (!pDlg.get() || (pDlg->Execute() != 1)) + break; + } - rReq.AppendItem( SfxInt16Item( (sal_uInt16)nSlotId, (sal_uInt16)pDlg->getInsertCount() ) ); - rReq.AppendItem( SfxBoolItem( SID_TABLE_PARAM_INSERT_AFTER, !pDlg->isInsertBefore() ) ); + sal_uInt16 nCount = 1; + bool bInsertAfter = (nSlotId == SID_TABLE_INSERT_ROW_AFTER) || (nSlotId == SID_TABLE_INSERT_COL_AFTER); - rReq.SetSlot( (sal_uInt16)nSlotId ); + if (nSlotId == SID_TABLE_INSERT_ROW_DLG) + { + nCount = pDlg->getInsertCount(); + bInsertAfter = !pDlg->isInsertBefore(); } + else if (nSlotId == SID_TABLE_INSERT_COL_DLG) + { + nCount = pDlg->getInsertCount(); + bInsertAfter = !pDlg->isInsertBefore(); + } + + if (nSlotId == SID_TABLE_INSERT_ROW_DLG || nSlotId == SID_TABLE_INSERT_ROW_BEFORE || nSlotId == SID_TABLE_INSERT_ROW_AFTER) + nSlotId = SID_TABLE_INSERT_ROW; + else + nSlotId = SID_TABLE_INSERT_COL; + + rReq.AppendItem(SfxInt16Item((sal_uInt16)nSlotId, nCount)); + rReq.AppendItem(SfxBoolItem(SID_TABLE_PARAM_INSERT_AFTER, bInsertAfter)); + + rReq.SetSlot( (sal_uInt16)nSlotId ); } } diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi index 51b6e80..3d6b32f 100644 --- a/svx/sdi/svx.sdi +++ b/svx/sdi/svx.sdi @@ -15734,7 +15734,45 @@ SfxVoidItem InsertColumnDialog SID_TABLE_INSERT_COL_DLG GroupId = GID_TABLE; ] +SfxVoidItem InsertColumnsBefore SID_TABLE_INSERT_COL_BEFORE +() +[ + /* flags: */ + AutoUpdate = FALSE, + FastCall = TRUE, + ReadOnlyDoc = FALSE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + Asynchron; + /* config: */ + AccelConfig = FALSE, + MenuConfig = FALSE, + ToolBoxConfig = TRUE, + GroupId = GID_TABLE; +] + +SfxVoidItem InsertColumnsAfter SID_TABLE_INSERT_COL_AFTER +() +[ + /* flags: */ + AutoUpdate = FALSE, + FastCall = TRUE, + ReadOnlyDoc = FALSE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + Asynchron; + + /* config: */ + AccelConfig = FALSE, + MenuConfig = FALSE, + ToolBoxConfig = TRUE, + GroupId = GID_TABLE; +] SfxVoidItem InsertRowDialog SID_TABLE_INSERT_ROW_DLG () @@ -15760,6 +15798,46 @@ SfxVoidItem InsertRowDialog SID_TABLE_INSERT_ROW_DLG GroupId = GID_TABLE; ] +SfxVoidItem InsertRowsBefore SID_TABLE_INSERT_ROW_BEFORE +() +[ + /* flags: */ + AutoUpdate = FALSE, + FastCall = TRUE, + ReadOnlyDoc = FALSE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + Asynchron; + + /* config: */ + AccelConfig = FALSE, + MenuConfig = FALSE, + ToolBoxConfig = TRUE, + GroupId = GID_TABLE; +] + +SfxVoidItem InsertRowsAfter SID_TABLE_INSERT_ROW_AFTER +() +[ + /* flags: */ + AutoUpdate = FALSE, + FastCall = TRUE, + ReadOnlyDoc = FALSE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + Asynchron; + + /* config: */ + AccelConfig = FALSE, + MenuConfig = FALSE, + ToolBoxConfig = TRUE, + GroupId = GID_TABLE; +] + SfxVoidItem PrepareMailExport SID_MAIL_PREPAREEXPORT () [
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits