compilerplugins/clang/mergeclasses.py | 2 compilerplugins/clang/mergeclasses.results | 7 -- editeng/source/editeng/eertfpar.cxx | 10 +- editeng/source/editeng/eertfpar.hxx | 39 ----------- editeng/source/rtf/svxrtf.cxx | 14 ++-- editeng/source/xml/xmltxtexp.cxx | 2 include/editeng/svxrtf.hxx | 67 +++++++++++-------- include/svx/fmdmod.hxx | 40 ----------- include/svx/unomodel.hxx | 6 - sc/inc/docuno.hxx | 4 - sc/source/ui/unoobj/docuno.cxx | 10 +- sd/source/ui/inc/unomodel.hxx | 6 - sd/source/ui/unoidl/unomodel.cxx | 8 +- svx/Library_svxcore.mk | 1 svx/source/form/fmdmod.cxx | 100 ----------------------------- svx/source/unodraw/unomod.cxx | 61 +++++++++++++++-- sw/inc/unotxdoc.hxx | 4 - sw/source/uibase/uno/unotxdoc.cxx | 8 +- vcl/generic/fontmanager/fontconfig.cxx | 21 ++---- vcl/generic/fontmanager/fontsubst.cxx | 19 ----- vcl/generic/glyphs/gcach_ftyp.cxx | 4 - vcl/inc/PhysicalFontCollection.hxx | 4 - vcl/inc/fontmanager.hxx | 4 - vcl/inc/generic/glyphcache.hxx | 10 +- vcl/inc/impfont.hxx | 25 ++++--- vcl/inc/outdev.h | 10 ++ vcl/inc/outfont.hxx | 2 vcl/source/font/PhysicalFontCollection.cxx | 2 vcl/unx/generic/gdi/cairotextrender.cxx | 8 +- 29 files changed, 188 insertions(+), 310 deletions(-)
New commits: commit bb76b8f10697f3d5ca1f9a2f19902b043bd61cd7 Author: Noel Grandin <[email protected]> Date: Wed Oct 7 12:31:48 2015 +0200 loplugin:mergeclasses Change-Id: I8f5c2ae658f8784233db98f752b6f9fa53110195 diff --git a/compilerplugins/clang/mergeclasses.results b/compilerplugins/clang/mergeclasses.results index 2a09a6a..ece9c54 100644 --- a/compilerplugins/clang/mergeclasses.results +++ b/compilerplugins/clang/mergeclasses.results @@ -76,7 +76,7 @@ merge StarSymbolToMSMultiFont with StarSymbolToMSMultiFontImpl merge StgReader with WW8Reader merge SvListView with SvTreeListBox merge SvxShapeMaster with SdXShape -merge SvxUnoDrawMSFactory with SvxFmMSFactory +merge SvxUnoDrawMSFactory with SvxUnoDrawMSFactory merge SwXParaFrameEnumeration with SwXParaFrameEnumerationImpl merge SwXParagraphEnumeration with SwXParagraphEnumerationImpl merge SwXTextRanges with SwXTextRangesImpl diff --git a/editeng/source/xml/xmltxtexp.cxx b/editeng/source/xml/xmltxtexp.cxx index cdb3d8e..7ca0ffb 100644 --- a/editeng/source/xml/xmltxtexp.cxx +++ b/editeng/source/xml/xmltxtexp.cxx @@ -193,7 +193,7 @@ SvxSimpleUnoModel::~SvxSimpleUnoModel() { } -// XMultiServiceFactory ( SvxFmMSFactory ) +// XMultiServiceFactory ( SvxUnoDrawMSFactory ) uno::Reference< uno::XInterface > SAL_CALL SvxSimpleUnoModel::createInstance( const OUString& aServiceSpecifier ) throw(uno::Exception, uno::RuntimeException, std::exception) { diff --git a/include/svx/fmdmod.hxx b/include/svx/fmdmod.hxx deleted file mode 100644 index 8a5a167..0000000 --- a/include/svx/fmdmod.hxx +++ /dev/null @@ -1,40 +0,0 @@ -/* -*- 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/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_SVX_FMDMOD_HXX -#define INCLUDED_SVX_FMDMOD_HXX - -#include <svx/unomod.hxx> -#include <svx/svxdllapi.h> - -class SVX_DLLPUBLIC SvxFmMSFactory : public SvxUnoDrawMSFactory -{ - -public: - SvxFmMSFactory() {}; - - virtual ~SvxFmMSFactory() {} - - virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstance(const OUString& ServiceSpecifier) throw( ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE; - virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstanceWithArguments(const OUString& ServiceSpecifier, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& Arguments) throw( ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE; - virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getAvailableServiceNames() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE; -}; - -#endif // INCLUDED_SVX_FMDMOD_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/unomodel.hxx b/include/svx/unomodel.hxx index 42defea..236d9aa 100644 --- a/include/svx/unomodel.hxx +++ b/include/svx/unomodel.hxx @@ -26,13 +26,13 @@ #include <com/sun/star/io/XOutputStream.hpp> #include <com/sun/star/io/XInputStream.hpp> #include <sfx2/sfxbasemodel.hxx> -#include <svx/fmdmod.hxx> #include <svx/svxdllapi.h> +#include <svx/unomod.hxx> class SdrModel; class SVX_DLLPUBLIC SvxUnoDrawingModel : public SfxBaseModel, // implements SfxListener, OWEAKOBJECT & other - public SvxFmMSFactory, + public SvxUnoDrawMSFactory, public ::com::sun::star::drawing::XDrawPagesSupplier, public ::com::sun::star::lang::XServiceInfo, public ::com::sun::star::ucb::XAnyCompareFactory @@ -76,7 +76,7 @@ public: // XDrawPagesSupplier virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPages > SAL_CALL getDrawPages( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; - // XMultiServiceFactory ( SvxFmMSFactory ) + // XMultiServiceFactory ( SvxUnoDrawMSFactory ) virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstance( const OUString& aServiceSpecifier ) throw(::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getAvailableServiceNames( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; diff --git a/sc/inc/docuno.hxx b/sc/inc/docuno.hxx index 91358f6..821ef95 100644 --- a/sc/inc/docuno.hxx +++ b/sc/inc/docuno.hxx @@ -23,7 +23,6 @@ #include "address.hxx" #include <sfx2/sfxbasemodel.hxx> #include <svl/lstner.hxx> -#include <svx/fmdmod.hxx> #include <com/sun/star/view/XRenderable.hpp> #include <com/sun/star/style/XStyleFamiliesSupplier.hpp> #include <com/sun/star/document/XActionLockable.hpp> @@ -53,6 +52,7 @@ #include <svl/itemprop.hxx> #include <vcl/event.hxx> #include <vcl/ITiledRenderable.hxx> +#include <svx/unomod.hxx> #include "drwlayer.hxx" class ScDocShell; @@ -81,7 +81,7 @@ class SC_DLLPUBLIC ScModelObj : public SfxBaseModel, public com::sun::star::view::XRenderable, public com::sun::star::document::XLinkTargetSupplier, public com::sun::star::beans::XPropertySet, - public SvxFmMSFactory, ///< derived from XMultiServiceFactory + public SvxUnoDrawMSFactory, ///< derived from XMultiServiceFactory public com::sun::star::lang::XServiceInfo, public ::com::sun::star::util::XChangesNotifier, public com::sun::star::sheet::opencl::XOpenCLSelection diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index 0c7954e..e920c49 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -2384,14 +2384,14 @@ css::uno::Reference<css::uno::XInterface> ScModelObj::create( } else { - // alles was ich nicht kenn, werf ich der SvxFmMSFactory an den Hals, + // alles was ich nicht kenn, werf ich der SvxUnoDrawMSFactory an den Hals, // da wird dann 'ne Exception geworfen, wenn's nicht passt... try { xRet = arguments == 0 - ? SvxFmMSFactory::createInstance(aServiceSpecifier) - : SvxFmMSFactory::createInstanceWithArguments( + ? SvxUnoDrawMSFactory::createInstance(aServiceSpecifier) + : SvxUnoDrawMSFactory::createInstanceWithArguments( aServiceSpecifier, *arguments); // extra block to force deletion of the temporary before ScShapeObj ctor (setDelegator) } @@ -2450,10 +2450,10 @@ uno::Sequence<OUString> SAL_CALL ScModelObj::getAvailableServiceNames() //! warum sind die Parameter bei concatServiceNames nicht const ??? //! return concatServiceNames( ScServiceProvider::GetAllServiceNames(), - //! SvxFmMSFactory::getAvailableServiceNames() ); + //! SvxUnoDrawMSFactory::getAvailableServiceNames() ); uno::Sequence<OUString> aMyServices(ScServiceProvider::GetAllServiceNames()); - uno::Sequence<OUString> aDrawServices(SvxFmMSFactory::getAvailableServiceNames()); + uno::Sequence<OUString> aDrawServices(SvxUnoDrawMSFactory::getAvailableServiceNames()); return concatServiceNames( aMyServices, aDrawServices ); } diff --git a/sd/source/ui/inc/unomodel.hxx b/sd/source/ui/inc/unomodel.hxx index f3debf8..a96ccba 100644 --- a/sd/source/ui/inc/unomodel.hxx +++ b/sd/source/ui/inc/unomodel.hxx @@ -43,7 +43,7 @@ #include <svl/lstner.hxx> #include <sfx2/sfxbasemodel.hxx> -#include <svx/fmdmod.hxx> +#include <svx/unomod.hxx> #include <vcl/event.hxx> #include <vcl/ITiledRenderable.hxx> @@ -69,7 +69,7 @@ extern OUString getPageApiNameFromUiName( const OUString& rUIName ); * * ***********************************************************************/ class SD_DLLPUBLIC SdXImpressDocument : public SfxBaseModel, // implements SfxListener, OWEAKOBJECT & other - public SvxFmMSFactory, + public SvxUnoDrawMSFactory, public ::com::sun::star::drawing::XDrawPageDuplicator, public ::com::sun::star::drawing::XLayerSupplier, public ::com::sun::star::drawing::XMasterPagesSupplier, @@ -191,7 +191,7 @@ public: // XPresentationSupplier virtual ::com::sun::star::uno::Reference< ::com::sun::star::presentation::XPresentation > SAL_CALL getPresentation( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; - // XMultiServiceFactory ( SvxFmMSFactory ) + // XMultiServiceFactory ( SvxUnoDrawMSFactory ) virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstance( const OUString& aServiceSpecifier ) throw(::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; virtual css::uno::Reference<css::uno::XInterface> SAL_CALL createInstanceWithArguments( diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index 6dcf8cb..020d057 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -815,7 +815,7 @@ uno::Reference< drawing::XDrawPage > SAL_CALL SdXImpressDocument::getHandoutMast return xPage; } -// XMultiServiceFactory ( SvxFmMSFactory ) +// XMultiServiceFactory ( SvxUnoDrawMSFactory ) css::uno::Reference<css::uno::XInterface> SdXImpressDocument::create( OUString const & aServiceSpecifier, OUString const & referer) @@ -1075,7 +1075,7 @@ css::uno::Reference<css::uno::XInterface> SdXImpressDocument::create( } else { - xRet = SvxFmMSFactory::createInstance( aServiceSpecifier ); + xRet = SvxUnoDrawMSFactory::createInstance( aServiceSpecifier ); } uno::Reference< drawing::XShape > xShape( xRet, uno::UNO_QUERY ); @@ -1111,7 +1111,7 @@ SdXImpressDocument::createInstanceWithArguments( { return create(ServiceSpecifier, arg); } - return SvxFmMSFactory::createInstanceWithArguments( + return SvxUnoDrawMSFactory::createInstanceWithArguments( ServiceSpecifier, Arguments); } @@ -1123,7 +1123,7 @@ uno::Sequence< OUString > SAL_CALL SdXImpressDocument::getAvailableServiceNames( if( NULL == mpDoc ) throw lang::DisposedException(); - const uno::Sequence< OUString > aSNS_ORG( SvxFmMSFactory::getAvailableServiceNames() ); + const uno::Sequence< OUString > aSNS_ORG( SvxUnoDrawMSFactory::getAvailableServiceNames() ); uno::Sequence< OUString > aSNS( mbImpressDoc ? (36) : (19) ); diff --git a/svx/Library_svxcore.mk b/svx/Library_svxcore.mk index ca9e5c5..837a865 100644 --- a/svx/Library_svxcore.mk +++ b/svx/Library_svxcore.mk @@ -427,7 +427,6 @@ $(eval $(call gb_Library_add_exception_objects,svxcore,\ svx/source/form/delayedevent \ svx/source/form/fmcontrolbordermanager \ svx/source/form/fmcontrollayout \ - svx/source/form/fmdmod \ svx/source/form/fmdocumentclassification \ svx/source/form/fmdpage \ svx/source/form/fmexch \ diff --git a/svx/source/form/fmdmod.cxx b/svx/source/form/fmdmod.cxx deleted file mode 100644 index bb63fed..0000000 --- a/svx/source/form/fmdmod.cxx +++ /dev/null @@ -1,100 +0,0 @@ -/* -*- 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/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#include <sal/macros.h> -#include <svx/fmdmod.hxx> -#include "fmservs.hxx" -#include <fmobj.hxx> -#include <svx/unoshape.hxx> -#include <comphelper/processfactory.hxx> -#include <svx/fmglob.hxx> - -using namespace ::svxform; - - -::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL SvxFmMSFactory::createInstance(const OUString& rServiceSpecifier) throw( ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException, std::exception ) -{ - ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xRet; - if ( rServiceSpecifier.startsWith( "com.sun.star.form.component." ) ) - { - css::uno::Reference<css::uno::XComponentContext> xContext = comphelper::getProcessComponentContext(); - xRet = xContext->getServiceManager()->createInstanceWithContext(rServiceSpecifier, xContext); - } - else if ( rServiceSpecifier == "com.sun.star.drawing.ControlShape" ) - { - SdrObject* pObj = new FmFormObj(); - xRet = static_cast<cppu::OWeakObject*>(static_cast<SvxShape_UnoImplHelper*>(new SvxShapeControl(pObj))); - } - if (!xRet.is()) - xRet = SvxUnoDrawMSFactory::createInstance(rServiceSpecifier); - return xRet; -} - - - -// Encapsulation violation: We *know* that -// SvxUnoDrawMSFactory::createInstanceWithArguments() always throws. - -SAL_WNOUNREACHABLE_CODE_PUSH - -::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL SvxFmMSFactory::createInstanceWithArguments(const OUString& ServiceSpecifier, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& Arguments) throw( ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException, std::exception ) -{ - return SvxUnoDrawMSFactory::createInstanceWithArguments(ServiceSpecifier, Arguments ); -} - -SAL_WNOUNREACHABLE_CODE_POP - - -::com::sun::star::uno::Sequence< OUString > SAL_CALL SvxFmMSFactory::getAvailableServiceNames() throw( ::com::sun::star::uno::RuntimeException, std::exception ) -{ - static const OUString aSvxComponentServiceNameList[] = - { - OUString(FM_SUN_COMPONENT_TEXTFIELD), - OUString(FM_SUN_COMPONENT_FORM), - OUString(FM_SUN_COMPONENT_LISTBOX), - OUString(FM_SUN_COMPONENT_COMBOBOX), - OUString(FM_SUN_COMPONENT_RADIOBUTTON), - OUString(FM_SUN_COMPONENT_GROUPBOX), - OUString(FM_SUN_COMPONENT_FIXEDTEXT), - OUString(FM_SUN_COMPONENT_COMMANDBUTTON), - OUString(FM_SUN_COMPONENT_CHECKBOX), - OUString(FM_SUN_COMPONENT_GRIDCONTROL), - OUString(FM_SUN_COMPONENT_IMAGEBUTTON), - OUString(FM_SUN_COMPONENT_FILECONTROL), - OUString(FM_SUN_COMPONENT_TIMEFIELD), - OUString(FM_SUN_COMPONENT_DATEFIELD), - OUString(FM_SUN_COMPONENT_NUMERICFIELD), - OUString(FM_SUN_COMPONENT_CURRENCYFIELD), - OUString(FM_SUN_COMPONENT_PATTERNFIELD), - OUString(FM_SUN_COMPONENT_HIDDENCONTROL), - OUString(FM_SUN_COMPONENT_IMAGECONTROL) - }; - - static const sal_uInt16 nSvxComponentServiceNameListCount = sizeof(aSvxComponentServiceNameList) / sizeof ( aSvxComponentServiceNameList[0] ); - - ::com::sun::star::uno::Sequence< OUString > aSeq( nSvxComponentServiceNameListCount ); - OUString* pStrings = aSeq.getArray(); - for( sal_uInt16 nIdx = 0; nIdx < nSvxComponentServiceNameListCount; nIdx++ ) - pStrings[nIdx] = aSvxComponentServiceNameList[nIdx]; - - ::com::sun::star::uno::Sequence< OUString > aParentSeq( SvxUnoDrawMSFactory::getAvailableServiceNames() ); - return concatServiceNames( aParentSeq, aSeq ); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/unodraw/unomod.cxx b/svx/source/unodraw/unomod.cxx index 1f1b2e5a..b6fc50a 100644 --- a/svx/source/unodraw/unomod.cxx +++ b/svx/source/unodraw/unomod.cxx @@ -26,6 +26,7 @@ #include <svtools/unoevent.hxx> #include <comphelper/sequence.hxx> #include <comphelper/servicehelper.hxx> +#include <comphelper/processfactory.hxx> #include <cppuhelper/supportsservice.hxx> #include <cppuhelper/implbase.hxx> @@ -50,6 +51,8 @@ #include <svx/svdpage.hxx> #include <svx/unoshape.hxx> #include <svx/xmlgrhlp.hxx> +#include <fmobj.hxx> +#include "fmservs.hxx" #include <com/sun/star/text/textfield/Type.hpp> @@ -196,10 +199,23 @@ css::uno::Reference<css::uno::XInterface> create( } -uno::Reference< uno::XInterface > SAL_CALL SvxUnoDrawMSFactory::createInstance( const OUString& rServiceSpecifier ) +uno::Reference< uno::XInterface > SAL_CALL SvxUnoDrawMSFactory::createInstance(const OUString& rServiceSpecifier) throw( uno::Exception, uno::RuntimeException, std::exception ) { - return create(rServiceSpecifier, ""); + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xRet; + if ( rServiceSpecifier.startsWith( "com.sun.star.form.component." ) ) + { + css::uno::Reference<css::uno::XComponentContext> xContext = comphelper::getProcessComponentContext(); + xRet = xContext->getServiceManager()->createInstanceWithContext(rServiceSpecifier, xContext); + } + else if ( rServiceSpecifier == "com.sun.star.drawing.ControlShape" ) + { + SdrObject* pObj = new FmFormObj(); + xRet = static_cast<cppu::OWeakObject*>(static_cast<SvxShape_UnoImplHelper*>(new SvxShapeControl(pObj))); + } + if (!xRet.is()) + xRet = create(rServiceSpecifier, ""); + return xRet; } uno::Reference< uno::XInterface > SAL_CALL SvxUnoDrawMSFactory::createTextField( const OUString& ServiceSpecifier ) throw(::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException) @@ -220,12 +236,45 @@ uno::Reference< uno::XInterface > SAL_CALL SvxUnoDrawMSFactory::createInstanceWi throw lang::NoSupportException(); } + uno::Sequence< OUString > SAL_CALL SvxUnoDrawMSFactory::getAvailableServiceNames() throw( uno::RuntimeException, std::exception ) { - return UHashMap::getServiceNames(); + static const OUString aSvxComponentServiceNameList[] = + { + OUString(FM_SUN_COMPONENT_TEXTFIELD), + OUString(FM_SUN_COMPONENT_FORM), + OUString(FM_SUN_COMPONENT_LISTBOX), + OUString(FM_SUN_COMPONENT_COMBOBOX), + OUString(FM_SUN_COMPONENT_RADIOBUTTON), + OUString(FM_SUN_COMPONENT_GROUPBOX), + OUString(FM_SUN_COMPONENT_FIXEDTEXT), + OUString(FM_SUN_COMPONENT_COMMANDBUTTON), + OUString(FM_SUN_COMPONENT_CHECKBOX), + OUString(FM_SUN_COMPONENT_GRIDCONTROL), + OUString(FM_SUN_COMPONENT_IMAGEBUTTON), + OUString(FM_SUN_COMPONENT_FILECONTROL), + OUString(FM_SUN_COMPONENT_TIMEFIELD), + OUString(FM_SUN_COMPONENT_DATEFIELD), + OUString(FM_SUN_COMPONENT_NUMERICFIELD), + OUString(FM_SUN_COMPONENT_CURRENCYFIELD), + OUString(FM_SUN_COMPONENT_PATTERNFIELD), + OUString(FM_SUN_COMPONENT_HIDDENCONTROL), + OUString(FM_SUN_COMPONENT_IMAGECONTROL) + }; + + static const sal_uInt16 nSvxComponentServiceNameListCount = SAL_N_ELEMENTS(aSvxComponentServiceNameList); + + uno::Sequence< OUString > aSeq( nSvxComponentServiceNameListCount ); + OUString* pStrings = aSeq.getArray(); + for( sal_uInt16 nIdx = 0; nIdx < nSvxComponentServiceNameListCount; nIdx++ ) + pStrings[nIdx] = aSvxComponentServiceNameList[nIdx]; + + uno::Sequence< OUString > aParentSeq( UHashMap::getServiceNames() ); + return concatServiceNames( aParentSeq, aSeq ); } + uno::Sequence< OUString > SvxUnoDrawMSFactory::concatServiceNames( uno::Sequence< OUString >& rServices1, uno::Sequence< OUString >& rServices2 ) throw() { const sal_Int32 nLen1 = rServices1.getLength(); @@ -349,7 +398,7 @@ uno::Reference< drawing::XDrawPages > SAL_CALL SvxUnoDrawingModel::getDrawPages( return xDrawPages; } -// XMultiServiceFactory ( SvxFmMSFactory ) +// XMultiServiceFactory ( SvxUnoDrawMSFactory ) uno::Reference< uno::XInterface > SAL_CALL SvxUnoDrawingModel::createInstance( const OUString& aServiceSpecifier ) throw(uno::Exception, uno::RuntimeException, std::exception) { @@ -503,7 +552,7 @@ uno::Reference< uno::XInterface > SAL_CALL SvxUnoDrawingModel::createInstance( c } else { - xRet = SvxFmMSFactory::createInstance( aServiceSpecifier ); + xRet = SvxUnoDrawMSFactory::createInstance( aServiceSpecifier ); } return xRet; @@ -512,7 +561,7 @@ uno::Reference< uno::XInterface > SAL_CALL SvxUnoDrawingModel::createInstance( c uno::Sequence< OUString > SAL_CALL SvxUnoDrawingModel::getAvailableServiceNames() throw(uno::RuntimeException, std::exception) { - const uno::Sequence< OUString > aSNS_ORG( SvxFmMSFactory::getAvailableServiceNames() ); + const uno::Sequence< OUString > aSNS_ORG( SvxUnoDrawMSFactory::getAvailableServiceNames() ); uno::Sequence< OUString > aSNS( 21 ); diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx index 7315aab..4670163 100644 --- a/sw/inc/unotxdoc.hxx +++ b/sw/inc/unotxdoc.hxx @@ -62,7 +62,7 @@ #include <com/sun/star/document/XDocumentLanguages.hpp> #include <com/sun/star/util/XCloneable.hpp> #include <svl/itemprop.hxx> -#include <svx/fmdmod.hxx> +#include <svx/unomod.hxx> #include <editeng/UnoForbiddenCharsTable.hxx> #include <cppuhelper/weak.hxx> #include <cppuhelper/implbase.hxx> @@ -126,7 +126,7 @@ typedef cppu::WeakImplHelper SwXTextDocumentBaseClass; class SW_DLLPUBLIC SwXTextDocument : public SwXTextDocumentBaseClass, - public SvxFmMSFactory, + public SvxUnoDrawMSFactory, public SfxBaseModel, public vcl::ITiledRenderable, public ::com::sun::star::tiledrendering::XTiledRenderable diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index 95227e8..c2d1fe6 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -1709,8 +1709,8 @@ css::uno::Reference<css::uno::XInterface> SwXTextDocument::create( } Reference<XInterface> xTmp( arguments == 0 - ? SvxFmMSFactory::createInstance(aTmpServiceName) - : SvxFmMSFactory::createInstanceWithArguments( + ? SvxUnoDrawMSFactory::createInstance(aTmpServiceName) + : SvxUnoDrawMSFactory::createInstanceWithArguments( aTmpServiceName, *arguments)); if (rServiceName == "com.sun.star.drawing.GroupShape" || rServiceName == "com.sun.star.drawing.Shape3DSceneObject") @@ -1744,7 +1744,7 @@ Sequence< OUString > SwXTextDocument::getAvailableServiceNames() static Sequence< OUString > aServices; if ( aServices.getLength() == 0 ) { - Sequence< OUString > aRet = SvxFmMSFactory::getAvailableServiceNames(); + Sequence< OUString > aRet = SvxUnoDrawMSFactory::getAvailableServiceNames(); OUString* pRet = aRet.getArray(); for ( sal_Int32 i = 0; i < aRet.getLength(); ++i ) { @@ -1756,7 +1756,7 @@ Sequence< OUString > SwXTextDocument::getAvailableServiceNames() } } Sequence< OUString > aOwn = SwXServiceProvider::GetAllServiceNames(); - aServices = SvxFmMSFactory::concatServiceNames(aRet, aOwn); + aServices = SvxUnoDrawMSFactory::concatServiceNames(aRet, aOwn); } return aServices; commit 5dbbb498b5e2ae8be9dcd10ddfc65de5266c0d15 Author: Noel Grandin <[email protected]> Date: Wed Oct 7 10:13:05 2015 +0200 loplugin:mergeclasses Change-Id: I0ac98a6fafb48b2be00973ae9fd34f4bc756cd7f diff --git a/compilerplugins/clang/mergeclasses.results b/compilerplugins/clang/mergeclasses.results index 2f84a3d..2a09a6a 100644 --- a/compilerplugins/clang/mergeclasses.results +++ b/compilerplugins/clang/mergeclasses.results @@ -75,7 +75,6 @@ merge SfxUndoListener with framework::UndoManagerHelper_Impl merge StarSymbolToMSMultiFont with StarSymbolToMSMultiFontImpl merge StgReader with WW8Reader merge SvListView with SvTreeListBox -merge SvxPosition with EditPosition merge SvxShapeMaster with SdXShape merge SvxUnoDrawMSFactory with SvxFmMSFactory merge SwXParaFrameEnumeration with SwXParaFrameEnumerationImpl diff --git a/editeng/source/editeng/eertfpar.cxx b/editeng/source/editeng/eertfpar.cxx index 44491ed..3a28f18 100644 --- a/editeng/source/editeng/eertfpar.cxx +++ b/editeng/source/editeng/eertfpar.cxx @@ -615,7 +615,7 @@ EditNodeIdx* EditNodeIdx::Clone() const EditPosition::EditPosition(EditEngine* pEE, EditSelection* pSel) : mpEditEngine(pEE), mpCurSel(pSel) {} -SvxPosition* EditPosition::Clone() const +EditPosition* EditPosition::Clone() const { return new EditPosition(mpEditEngine, mpCurSel); } diff --git a/editeng/source/editeng/eertfpar.hxx b/editeng/source/editeng/eertfpar.hxx index b0a577c..bcbbf5d7 100644 --- a/editeng/source/editeng/eertfpar.hxx +++ b/editeng/source/editeng/eertfpar.hxx @@ -26,26 +26,7 @@ class EditEngine; -class EditPosition : public SvxPosition -{ -private: - EditEngine* mpEditEngine; - EditSelection* mpCurSel; - -public: - EditPosition(EditEngine* pIEE, EditSelection* pSel); - - virtual sal_Int32 GetNodeIdx() const SAL_OVERRIDE; - virtual sal_Int32 GetCntIdx() const SAL_OVERRIDE; - - // clone - virtual SvxPosition* Clone() const SAL_OVERRIDE; - - // clone NodeIndex - virtual EditNodeIdx* MakeNodeIdx() const SAL_OVERRIDE; -}; -#define ACTION_INSERTTEXT 1 #define ACTION_INSERTPARABRK 2 class EditRTFParser : public SvxRTFParser diff --git a/editeng/source/rtf/svxrtf.cxx b/editeng/source/rtf/svxrtf.cxx index 1f8349c..653c44c 100644 --- a/editeng/source/rtf/svxrtf.cxx +++ b/editeng/source/rtf/svxrtf.cxx @@ -99,7 +99,7 @@ SvxRTFParser::~SvxRTFParser() delete pDfltColor; } -void SvxRTFParser::SetInsPos( const SvxPosition& rNew ) +void SvxRTFParser::SetInsPos( const EditPosition& rNew ) { delete pInsPos; pInsPos = rNew.Clone(); @@ -1137,7 +1137,7 @@ SvxRTFStyleType::SvxRTFStyleType( SfxItemPool& rPool, const sal_uInt16* pWhichRa SvxRTFItemStackType::SvxRTFItemStackType( SfxItemPool& rPool, const sal_uInt16* pWhichRange, - const SvxPosition& rPos ) + const EditPosition& rPos ) : aAttrSet( rPool, pWhichRange ) , m_pChildList( nullptr ) , nStyleNo( 0 ) @@ -1150,7 +1150,7 @@ SvxRTFItemStackType::SvxRTFItemStackType( SvxRTFItemStackType::SvxRTFItemStackType( const SvxRTFItemStackType& rCpy, - const SvxPosition& rPos, + const EditPosition& rPos, bool const bCopyAttr ) : aAttrSet( *rCpy.aAttrSet.GetPool(), rCpy.aAttrSet.GetRanges() ) , m_pChildList( nullptr ) @@ -1182,7 +1182,7 @@ void SvxRTFItemStackType::Add(std::unique_ptr<SvxRTFItemStackType> pIns) m_pChildList->push_back(std::move(pIns)); } -void SvxRTFItemStackType::SetStartPos( const SvxPosition& rPos ) +void SvxRTFItemStackType::SetStartPos( const EditPosition& rPos ) { if (pSttNd != pEndNd) delete pEndNd; diff --git a/include/editeng/svxrtf.hxx b/include/editeng/svxrtf.hxx index b0d257b..efd4063 100644 --- a/include/editeng/svxrtf.hxx +++ b/include/editeng/svxrtf.hxx @@ -69,18 +69,27 @@ private: ContentNode* mpNode; }; -class SvxPosition +class EditSelection; +class EditPosition { +private: + EditEngine* mpEditEngine; + EditSelection* mpCurSel; + public: - virtual ~SvxPosition() {} + EditPosition(EditEngine* pIEE, EditSelection* pSel); + + sal_Int32 GetNodeIdx() const; + sal_Int32 GetCntIdx() const; - virtual sal_Int32 GetNodeIdx() const = 0; - virtual sal_Int32 GetCntIdx() const = 0; + // clone + EditPosition* Clone() const; - virtual SvxPosition* Clone() const = 0; // Cloning itself - virtual EditNodeIdx* MakeNodeIdx() const = 0; // Cloning NodeIndex + // clone NodeIndex + EditNodeIdx* MakeNodeIdx() const; }; +#define ACTION_INSERTTEXT 1 typedef std::map<short, std::unique_ptr<vcl::Font>> SvxRTFFontTbl; typedef std::map<sal_uInt16, std::unique_ptr<SvxRTFStyleType>> SvxRTFStyleTbl; @@ -187,7 +196,7 @@ class EDITENG_DLLPUBLIC SvxRTFParser : public SvRTFParser std::vector<sal_uInt16> aWhichMap; OUString sBaseURL; - SvxPosition* pInsPos; + EditPosition* pInsPos; SfxItemPool* pAttrPool; Color* pDfltColor; vcl::Font* pDfltFont; @@ -295,7 +304,7 @@ protected: void SetCalcValue( bool bFlag ) { bCalcValue = bFlag; } // Query/Set the current insert position - void SetInsPos( const SvxPosition& rNew ); + void SetInsPos( const EditPosition& rNew ); SvxRTFStyleTbl& GetStyleTbl() { return m_StyleTable; } public: @@ -340,19 +349,19 @@ class EDITENG_DLLPUBLIC SvxRTFItemStackType void operator=(SvxRTFItemStackType const&) = delete; SvxRTFItemStackType( SfxItemPool&, const sal_uInt16* pWhichRange, - const SvxPosition& ); + const EditPosition& ); void Add(std::unique_ptr<SvxRTFItemStackType>); void Compress( const SvxRTFParser& ); public: - SvxRTFItemStackType( const SvxRTFItemStackType&, const SvxPosition&, + SvxRTFItemStackType( const SvxRTFItemStackType&, const EditPosition&, bool bCopyAttr = false ); ~SvxRTFItemStackType(); //cmc, I'm very suspicios about SetStartPos, it doesn't change //its children's starting position, and the implementation looks //bad, consider this deprecated. - void SetStartPos( const SvxPosition& rPos ); + void SetStartPos( const EditPosition& rPos ); void MoveFullNode(const EditNodeIdx &rOldNode, const EditNodeIdx &rNewNode); commit a3eacae95a5630d9663408b9fbe4ca95b3f99213 Author: Noel Grandin <[email protected]> Date: Wed Oct 7 10:09:23 2015 +0200 loplugin:mergeclasses Change-Id: Icf1731dfbd16d85decd2aaf80be4841ac37007fd diff --git a/compilerplugins/clang/mergeclasses.results b/compilerplugins/clang/mergeclasses.results index e4d910d..2f84a3d 100644 --- a/compilerplugins/clang/mergeclasses.results +++ b/compilerplugins/clang/mergeclasses.results @@ -75,7 +75,6 @@ merge SfxUndoListener with framework::UndoManagerHelper_Impl merge StarSymbolToMSMultiFont with StarSymbolToMSMultiFontImpl merge StgReader with WW8Reader merge SvListView with SvTreeListBox -merge SvxNodeIdx with EditNodeIdx merge SvxPosition with EditPosition merge SvxShapeMaster with SdXShape merge SvxUnoDrawMSFactory with SvxFmMSFactory diff --git a/editeng/source/editeng/eertfpar.cxx b/editeng/source/editeng/eertfpar.cxx index 1125257..44491ed 100644 --- a/editeng/source/editeng/eertfpar.cxx +++ b/editeng/source/editeng/eertfpar.cxx @@ -274,7 +274,7 @@ void EditRTFParser::MovePos( bool const bForward ) aCurSel.Max(), i18n::CharacterIteratorMode::SKIPCHARACTER); } -void EditRTFParser::SetEndPrevPara( SvxNodeIdx*& rpNodePos, +void EditRTFParser::SetEndPrevPara( EditNodeIdx*& rpNodePos, sal_Int32& rCntPos ) { // The Intention is to: determine the current insert position of the @@ -292,7 +292,7 @@ void EditRTFParser::SetEndPrevPara( SvxNodeIdx*& rpNodePos, rCntPos = pPrevNode->Len(); } -bool EditRTFParser::IsEndPara( SvxNodeIdx* pNd, sal_Int32 nCnt ) const +bool EditRTFParser::IsEndPara( EditNodeIdx* pNd, sal_Int32 nCnt ) const { return nCnt == ( static_cast<EditNodeIdx*>(pNd)->GetNode()->Len()); } @@ -607,7 +607,7 @@ sal_Int32 EditNodeIdx::GetIdx() const return mpEditEngine->GetEditDoc().GetPos(mpNode); } -SvxNodeIdx* EditNodeIdx::Clone() const +EditNodeIdx* EditNodeIdx::Clone() const { return new EditNodeIdx(mpEditEngine, mpNode); } @@ -620,7 +620,7 @@ SvxPosition* EditPosition::Clone() const return new EditPosition(mpEditEngine, mpCurSel); } -SvxNodeIdx* EditPosition::MakeNodeIdx() const +EditNodeIdx* EditPosition::MakeNodeIdx() const { return new EditNodeIdx(mpEditEngine, mpCurSel->Max().GetNode()); } diff --git a/editeng/source/editeng/eertfpar.hxx b/editeng/source/editeng/eertfpar.hxx index 90f41e2..b0a577c 100644 --- a/editeng/source/editeng/eertfpar.hxx +++ b/editeng/source/editeng/eertfpar.hxx @@ -26,20 +26,6 @@ class EditEngine; -class EditNodeIdx : public SvxNodeIdx -{ -private: - EditEngine* mpEditEngine; - ContentNode* mpNode; - -public: - EditNodeIdx(EditEngine* pEE, ContentNode* pNd = NULL); - - virtual sal_Int32 GetIdx() const SAL_OVERRIDE; - virtual SvxNodeIdx* Clone() const SAL_OVERRIDE; - ContentNode* GetNode() { return mpNode; } -}; - class EditPosition : public SvxPosition { private: @@ -56,7 +42,7 @@ public: virtual SvxPosition* Clone() const SAL_OVERRIDE; // clone NodeIndex - virtual SvxNodeIdx* MakeNodeIdx() const SAL_OVERRIDE; + virtual EditNodeIdx* MakeNodeIdx() const SAL_OVERRIDE; }; #define ACTION_INSERTTEXT 1 @@ -80,13 +66,13 @@ protected: virtual void InsertPara() SAL_OVERRIDE; virtual void InsertText() SAL_OVERRIDE; virtual void MovePos( bool bForward = true ) SAL_OVERRIDE; - virtual void SetEndPrevPara( SvxNodeIdx*& rpNodePos, - sal_Int32& rCntPos ) SAL_OVERRIDE; + virtual void SetEndPrevPara( EditNodeIdx*& rpNodePos, + sal_Int32& rCntPos ) SAL_OVERRIDE; virtual void UnknownAttrToken( int nToken, SfxItemSet* pSet ) SAL_OVERRIDE; virtual void NextToken( int nToken ) SAL_OVERRIDE; virtual void SetAttrInDoc( SvxRTFItemStackType &rSet ) SAL_OVERRIDE; - virtual bool IsEndPara( SvxNodeIdx* pNd, sal_Int32 nCnt ) const SAL_OVERRIDE; + virtual bool IsEndPara( EditNodeIdx* pNd, sal_Int32 nCnt ) const SAL_OVERRIDE; virtual void CalcValue() SAL_OVERRIDE; void CreateStyleSheets(); SfxStyleSheet* CreateStyleSheet( SvxRTFStyleType* pRTFStyle ); diff --git a/editeng/source/rtf/svxrtf.cxx b/editeng/source/rtf/svxrtf.cxx index 7dbabb8..1f8349c 100644 --- a/editeng/source/rtf/svxrtf.cxx +++ b/editeng/source/rtf/svxrtf.cxx @@ -1192,8 +1192,8 @@ void SvxRTFItemStackType::SetStartPos( const SvxPosition& rPos ) nSttCnt = rPos.GetCntIdx(); } -void SvxRTFItemStackType::MoveFullNode(const SvxNodeIdx &rOldNode, - const SvxNodeIdx &rNewNode) +void SvxRTFItemStackType::MoveFullNode(const EditNodeIdx &rOldNode, + const EditNodeIdx &rNewNode) { bool bSameEndAsStart = (pSttNd == pEndNd); @@ -1232,7 +1232,7 @@ void SvxRTFItemStackType::Compress( const SvxRTFParser& rParser ) nSttCnt != pTmp->nSttCnt ) return; - SvxNodeIdx* pLastNd = pTmp->pEndNd; + EditNodeIdx* pLastNd = pTmp->pEndNd; sal_Int32 nLastCnt = pTmp->nEndCnt; SfxItemSet aMrgSet( pTmp->aAttrSet ); diff --git a/include/editeng/svxrtf.hxx b/include/editeng/svxrtf.hxx index 1b795e2..b0d257b 100644 --- a/include/editeng/svxrtf.hxx +++ b/include/editeng/svxrtf.hxx @@ -54,13 +54,19 @@ namespace com { namespace sun { namespace star { // Swg - NodePosition is a SwIndex, which is used internally // EditEngine - ULONG to list of paragraphs - -class SvxNodeIdx +class EditEngine; +class ContentNode; +class EditNodeIdx { public: - virtual ~SvxNodeIdx() {} - virtual sal_Int32 GetIdx() const = 0; - virtual SvxNodeIdx* Clone() const = 0; // Cloning itself + EditNodeIdx(EditEngine* pEE, ContentNode* pNd = NULL); + ~EditNodeIdx() {} + sal_Int32 GetIdx() const; + EditNodeIdx* Clone() const; // Cloning itself + ContentNode* GetNode() { return mpNode; } +private: + EditEngine* mpEditEngine; + ContentNode* mpNode; }; class SvxPosition @@ -72,7 +78,7 @@ public: virtual sal_Int32 GetCntIdx() const = 0; virtual SvxPosition* Clone() const = 0; // Cloning itself - virtual SvxNodeIdx* MakeNodeIdx() const = 0; // Cloning NodeIndex + virtual EditNodeIdx* MakeNodeIdx() const = 0; // Cloning NodeIndex }; @@ -266,7 +272,7 @@ protected: virtual void InsertText() = 0; virtual void MovePos( bool bForward = true ) = 0; - virtual void SetEndPrevPara( SvxNodeIdx*& rpNodePos, + virtual void SetEndPrevPara( EditNodeIdx*& rpNodePos, sal_Int32& rCntPos )=0; virtual void SetAttrInDoc( SvxRTFItemStackType &rSet ); // for Tokens, which are not evaluated in ReadAttr @@ -299,7 +305,7 @@ public: inline const Color& GetColor( size_t nId ) const; const vcl::Font& GetFont( sal_uInt16 nId ); // Changes the default Font - virtual bool IsEndPara( SvxNodeIdx* pNd, sal_Int32 nCnt ) const = 0; + virtual bool IsEndPara( EditNodeIdx* pNd, sal_Int32 nCnt ) const = 0; // to set a different attribute pool. May only be done prior to CallParser! // The maps are not generated anew! @@ -324,11 +330,11 @@ class EDITENG_DLLPUBLIC SvxRTFItemStackType { friend class SvxRTFParser; - SfxItemSet aAttrSet; - SvxNodeIdx *pSttNd, *pEndNd; - sal_Int32 nSttCnt, nEndCnt; + SfxItemSet aAttrSet; + EditNodeIdx *pSttNd, *pEndNd; + sal_Int32 nSttCnt, nEndCnt; SvxRTFItemStackList* m_pChildList; - sal_uInt16 nStyleNo; + sal_uInt16 nStyleNo; SvxRTFItemStackType(SvxRTFItemStackType const&) = delete; void operator=(SvxRTFItemStackType const&) = delete; @@ -348,14 +354,14 @@ public: //bad, consider this deprecated. void SetStartPos( const SvxPosition& rPos ); - void MoveFullNode(const SvxNodeIdx &rOldNode, - const SvxNodeIdx &rNewNode); + void MoveFullNode(const EditNodeIdx &rOldNode, + const EditNodeIdx &rNewNode); sal_Int32 GetSttNodeIdx() const { return pSttNd->GetIdx(); } sal_Int32 GetEndNodeIdx() const { return pEndNd->GetIdx(); } - const SvxNodeIdx& GetSttNode() const { return *pSttNd; } - const SvxNodeIdx& GetEndNode() const { return *pEndNd; } + const EditNodeIdx& GetSttNode() const { return *pSttNd; } + const EditNodeIdx& GetEndNode() const { return *pEndNd; } sal_Int32 GetSttCnt() const { return nSttCnt; } sal_Int32 GetEndCnt() const { return nEndCnt; } commit 349700228e4449ace956b30bc65208b9196f0a78 Author: Noel Grandin <[email protected]> Date: Wed Oct 7 10:00:59 2015 +0200 loplugin:mergeclasses Change-Id: I9f56beebae1ea02a8914b7b25fe7565f7b0df053 diff --git a/compilerplugins/clang/mergeclasses.py b/compilerplugins/clang/mergeclasses.py index 07b68f3..ebeb17e 100755 --- a/compilerplugins/clang/mergeclasses.py +++ b/compilerplugins/clang/mergeclasses.py @@ -66,7 +66,7 @@ for clazz in sorted(definitionSet - instantiatedSet): if clazz.find("mutex") != -1 or clazz.find("Mutex") != -1: continue otherclazz = next(iter(parentChildDict[clazz])) - # exclude combinations that span modules because we often use those to make cross-module dependencies more manageable. + # exclude combinations that span modules because we often use those to make cross-module dependencies more manageable. if extractModuleName(clazz) != extractModuleName(otherclazz): continue print "merge", clazz, "with", otherclazz diff --git a/compilerplugins/clang/mergeclasses.results b/compilerplugins/clang/mergeclasses.results index a92afb5..e4d910d 100644 --- a/compilerplugins/clang/mergeclasses.results +++ b/compilerplugins/clang/mergeclasses.results @@ -46,8 +46,6 @@ merge ISwFrameControl with SwFrameMenuButtonBase merge IXFAttrList with XFSaxAttrList merge IXFStream with XFSaxStream merge IXFStyle with XFStyle -merge ImplGlyphFallbackFontSubstitution with FcGlyphFallbackSubstititution -merge ImplPreMatchFontSubstitution with FcPreMatchSubstititution merge LwpDLList with LwpParaProperty merge LwpDLVListHead with LwpPropList merge OldBasicPassword with basic::SfxScriptLibraryContainer diff --git a/vcl/generic/fontmanager/fontsubst.cxx b/vcl/generic/fontmanager/fontsubst.cxx index c84b7dd..26e502c 100644 --- a/vcl/generic/fontmanager/fontsubst.cxx +++ b/vcl/generic/fontmanager/fontsubst.cxx @@ -35,19 +35,6 @@ #include <unotools/fontdefs.hxx> #include <list> -// platform specific font substitution hooks - -class FcPreMatchSubstititution -: public ImplPreMatchFontSubstitution -{ -public: - bool FindFontSubstitute( FontSelectPattern& ) const SAL_OVERRIDE; - typedef ::std::pair<FontSelectPatternAttributes, FontSelectPatternAttributes> value_type; -private: - typedef ::std::list<value_type> CachedFontMapType; - mutable CachedFontMapType maCachedFontMap; -}; - class FcGlyphFallbackSubstititution : public ImplGlyphFallbackFontSubstitution { @@ -95,7 +82,7 @@ void SalGenericInstance::RegisterFontSubstitutors( PhysicalFontCollection* pFont // register font fallback substitutions (unless disabled by bit0) if( (nDisableBits & 1) == 0 ) { - static FcPreMatchSubstititution aSubstPreMatch; + static PreMatchFontSubstititution aSubstPreMatch; pFontCollection->SetPreMatchHook( &aSubstPreMatch ); } @@ -138,12 +125,12 @@ namespace : mrAttributes(rAttributes) { } - bool operator()(const FcPreMatchSubstititution::value_type& rOther) const + bool operator()(const PreMatchFontSubstititution::value_type& rOther) const { return rOther.first == mrAttributes; } }; } -bool FcPreMatchSubstititution::FindFontSubstitute( FontSelectPattern &rFontSelData ) const +bool PreMatchFontSubstititution::FindFontSubstitute( FontSelectPattern &rFontSelData ) const { // We don't actually want to talk to Fontconfig at all for symbol fonts if( rFontSelData.IsSymbolFont() ) diff --git a/vcl/inc/PhysicalFontCollection.hxx b/vcl/inc/PhysicalFontCollection.hxx index 1625a35..e2d78d9 100644 --- a/vcl/inc/PhysicalFontCollection.hxx +++ b/vcl/inc/PhysicalFontCollection.hxx @@ -40,7 +40,7 @@ private: typedef std::unordered_map<OUString, PhysicalFontFamily*,OUStringHash> PhysicalFontFamilies; PhysicalFontFamilies maPhysicalFontFamilies; - ImplPreMatchFontSubstitution* mpPreMatchHook; // device specific prematch substitution + PreMatchFontSubstititution* mpPreMatchHook; // device specific prematch substitution ImplGlyphFallbackFontSubstitution* mpFallbackHook; // device specific glyph fallback substitution public: @@ -63,7 +63,7 @@ public: OUString& rMissingCodes, int nFallbackLevel ) const; // prepare platform specific font substitutions - void SetPreMatchHook( ImplPreMatchFontSubstitution* ); + void SetPreMatchHook( PreMatchFontSubstititution* ); void SetFallbackHook( ImplGlyphFallbackFontSubstitution* ); // misc utilities diff --git a/vcl/inc/outdev.h b/vcl/inc/outdev.h index 628329e..7032958 100644 --- a/vcl/inc/outdev.h +++ b/vcl/inc/outdev.h @@ -112,13 +112,17 @@ public: // PreMatchFontSubstitution // abstracts the concept of a configured font substitution // before the availability of the originally selected font has been checked -class ImplPreMatchFontSubstitution -: public ImplFontSubstitution +class PreMatchFontSubstititution { public: - virtual bool FindFontSubstitute( FontSelectPattern& ) const = 0; + bool FindFontSubstitute( FontSelectPattern& ) const; + typedef ::std::pair<FontSelectPatternAttributes, FontSelectPatternAttributes> value_type; +private: + typedef ::std::list<value_type> CachedFontMapType; + mutable CachedFontMapType maCachedFontMap; }; + // ImplGlyphFallbackFontSubstitution // abstracts the concept of finding the best font to support an incomplete font class ImplGlyphFallbackFontSubstitution diff --git a/vcl/inc/outfont.hxx b/vcl/inc/outfont.hxx index 2b56acd..860f767 100644 --- a/vcl/inc/outfont.hxx +++ b/vcl/inc/outfont.hxx @@ -37,7 +37,7 @@ class ImplGetDevFontList; class ImplGetDevSizeList; class ImplFontEntry; class ImplFontCache; -class ImplPreMatchFontSubstitution; +class PreMatchFontSubstititution; class ImplGlyphFallbackFontSubstitution; class FontSelectPattern; namespace vcl { class Font; } diff --git a/vcl/source/font/PhysicalFontCollection.cxx b/vcl/source/font/PhysicalFontCollection.cxx index cd89bdf..9f01fe2 100644 --- a/vcl/source/font/PhysicalFontCollection.cxx +++ b/vcl/source/font/PhysicalFontCollection.cxx @@ -84,7 +84,7 @@ PhysicalFontCollection::~PhysicalFontCollection() Clear(); } -void PhysicalFontCollection::SetPreMatchHook( ImplPreMatchFontSubstitution* pHook ) +void PhysicalFontCollection::SetPreMatchHook( PreMatchFontSubstititution* pHook ) { mpPreMatchHook = pHook; } commit 64d0de92ab06e6550be7dd59ae887750166d15a9 Author: Noel Grandin <[email protected]> Date: Wed Oct 7 09:50:40 2015 +0200 loplugin:mergeclasses Change-Id: If8fabc79f4cbef6fc0d164bbe2f6136f1d1f00af diff --git a/compilerplugins/clang/mergeclasses.results b/compilerplugins/clang/mergeclasses.results index a5461e1..a92afb5 100644 --- a/compilerplugins/clang/mergeclasses.results +++ b/compilerplugins/clang/mergeclasses.results @@ -46,7 +46,6 @@ merge ISwFrameControl with SwFrameMenuButtonBase merge IXFAttrList with XFSaxAttrList merge IXFStream with XFSaxStream merge IXFStyle with XFStyle -merge ImplFontOptions with FontConfigFontOptions merge ImplGlyphFallbackFontSubstitution with FcGlyphFallbackSubstititution merge ImplPreMatchFontSubstitution with FcPreMatchSubstititution merge LwpDLList with LwpParaProperty diff --git a/vcl/generic/fontmanager/fontconfig.cxx b/vcl/generic/fontmanager/fontconfig.cxx index 5d61dcd..2ba7638 100644 --- a/vcl/generic/fontmanager/fontconfig.cxx +++ b/vcl/generic/fontmanager/fontconfig.cxx @@ -1140,15 +1140,12 @@ bool PrintFontManager::Substitute( FontSelectPattern &rPattern, OUString& rMissi return bRet; } -class FontConfigFontOptions : public ImplFontOptions +FontConfigFontOptions::~FontConfigFontOptions() { -public: - FontConfigFontOptions() : mpPattern(0) {} - virtual ~FontConfigFontOptions() - { - FcPatternDestroy(mpPattern); - } - virtual void *GetPattern(void * face, bool bEmbolden, bool /*bVerticalLayout*/) const SAL_OVERRIDE + FcPatternDestroy(mpPattern); +} + + void *FontConfigFontOptions::GetPattern(void * face, bool bEmbolden) const { FcValue value; value.type = FcTypeFTFace; @@ -1163,10 +1160,8 @@ public: #endif return mpPattern; } - FcPattern* mpPattern; -}; -ImplFontOptions* PrintFontManager::getFontOptions( +FontConfigFontOptions* PrintFontManager::getFontOptions( const FastPrintFontInfo& rInfo, int nSize, void (*subcallback)(void*)) { FontCfgWrapper& rWrapper = FontCfgWrapper::get(); @@ -1210,9 +1205,7 @@ ImplFontOptions* PrintFontManager::getFontOptions( (void) FcPatternGetInteger(pResult, FC_HINT_STYLE, 0, &hintstyle); - pOptions = new FontConfigFontOptions; - - pOptions->mpPattern = pResult; + pOptions = new FontConfigFontOptions(pResult); if( eEmbeddedBitmap == FcResultMatch ) pOptions->meEmbeddedBitmap = embitmap ? EMBEDDEDBITMAP_TRUE : EMBEDDEDBITMAP_FALSE; diff --git a/vcl/generic/glyphs/gcach_ftyp.cxx b/vcl/generic/glyphs/gcach_ftyp.cxx index 27ca576..c44a7cd 100644 --- a/vcl/generic/glyphs/gcach_ftyp.cxx +++ b/vcl/generic/glyphs/gcach_ftyp.cxx @@ -555,7 +555,7 @@ ServerFont::ServerFont( const FontSelectPattern& rFSD, FtFontInfo* pFI ) mnLoadFlags |= FT_LOAD_NO_BITMAP; } -void ServerFont::SetFontOptions(std::shared_ptr<ImplFontOptions> xFontOptions) +void ServerFont::SetFontOptions(std::shared_ptr<FontConfigFontOptions> xFontOptions) { mxFontOptions = xFontOptions; @@ -608,7 +608,7 @@ void ServerFont::SetFontOptions(std::shared_ptr<ImplFontOptions> xFontOptions) mnLoadFlags |= FT_LOAD_NO_BITMAP; } -std::shared_ptr<ImplFontOptions> ServerFont::GetFontOptions() const +std::shared_ptr<FontConfigFontOptions> ServerFont::GetFontOptions() const { return mxFontOptions; } diff --git a/vcl/inc/fontmanager.hxx b/vcl/inc/fontmanager.hxx index 8b4f76a..c96e2e7 100644 --- a/vcl/inc/fontmanager.hxx +++ b/vcl/inc/fontmanager.hxx @@ -45,7 +45,7 @@ namespace utl { class MultiAtomProvider; } class FontSubsetInfo; -class ImplFontOptions; +class FontConfigFontOptions; class FontSelectPattern; namespace psp { @@ -498,7 +498,7 @@ public: false else */ bool matchFont( FastPrintFontInfo& rInfo, const com::sun::star::lang::Locale& rLocale ); - static ImplFontOptions* getFontOptions( const FastPrintFontInfo&, int nSize, void (*subcallback)(void*)); + static FontConfigFontOptions* getFontOptions( const FastPrintFontInfo&, int nSize, void (*subcallback)(void*)); bool Substitute( FontSelectPattern &rPattern, OUString& rMissingCodes ); diff --git a/vcl/inc/generic/glyphcache.hxx b/vcl/inc/generic/glyphcache.hxx index 509044d..37568c7 100644 --- a/vcl/inc/generic/glyphcache.hxx +++ b/vcl/inc/generic/glyphcache.hxx @@ -42,7 +42,7 @@ class FtFontInfo; class GlyphCachePeer; class GlyphData; class GraphiteFaceWrapper; -class ImplFontOptions; +class FontConfigFontOptions; class PhysicalFontCollection; class RawBitmap; class ServerFont; @@ -174,8 +174,8 @@ public: bool TestFont() const { return mbFaceOk;} FT_Face GetFtFace() const; int GetLoadFlags() const { return (mnLoadFlags & ~FT_LOAD_IGNORE_TRANSFORM); } - void SetFontOptions(std::shared_ptr<ImplFontOptions>); - std::shared_ptr<ImplFontOptions> GetFontOptions() const; + void SetFontOptions(std::shared_ptr<FontConfigFontOptions>); + std::shared_ptr<FontConfigFontOptions> GetFontOptions() const; bool NeedsArtificialBold() const { return mbArtBold; } bool NeedsArtificialItalic() const { return mbArtItalic; } @@ -253,7 +253,7 @@ private: FT_FaceRec_* maFaceFT; FT_SizeRec_* maSizeFT; - std::shared_ptr<ImplFontOptions> mxFontOptions; + std::shared_ptr<FontConfigFontOptions> mxFontOptions; bool mbFaceOk; bool mbArtItalic; @@ -278,7 +278,7 @@ public: private: ServerFont* mpServerFont; - std::shared_ptr<ImplFontOptions> mxFontOptions; + std::shared_ptr<FontConfigFontOptions> mxFontOptions; bool mbGotFontOptions; }; diff --git a/vcl/inc/impfont.hxx b/vcl/inc/impfont.hxx index 898e47d..5ad974e 100644 --- a/vcl/inc/impfont.hxx +++ b/vcl/inc/impfont.hxx @@ -122,9 +122,8 @@ public: bool operator==( const ImplFontMetric& ) const; }; -// - ImplFontOptions - - -class ImplFontOptions +typedef struct _FcPattern FcPattern; +class FontConfigFontOptions { public: FontEmbeddedBitmap meEmbeddedBitmap; // whether the embedded bitmaps should be used @@ -132,21 +131,31 @@ public: FontAutoHint meAutoHint; // whether the font should be autohinted FontHinting meHinting; // whether the font should be hinted FontHintStyle meHintStyle; // type of font hinting to be used -public: - ImplFontOptions() : + + FontConfigFontOptions() : + meEmbeddedBitmap(EMBEDDEDBITMAP_DONTKNOW), + meAntiAlias(ANTIALIAS_DONTKNOW), + meAutoHint(AUTOHINT_DONTKNOW), + meHinting(HINTING_DONTKNOW), + meHintStyle(HINT_SLIGHT), + mpPattern(0) {} + FontConfigFontOptions(FcPattern* pPattern) : meEmbeddedBitmap(EMBEDDEDBITMAP_DONTKNOW), meAntiAlias(ANTIALIAS_DONTKNOW), meAutoHint(AUTOHINT_DONTKNOW), meHinting(HINTING_DONTKNOW), - meHintStyle(HINT_SLIGHT) {} - virtual ~ImplFontOptions() {} + meHintStyle(HINT_SLIGHT), + mpPattern(pPattern) {} + ~FontConfigFontOptions(); FontAutoHint GetUseAutoHint() const { return meAutoHint; } FontHintStyle GetHintStyle() const { return meHintStyle; } bool DontUseEmbeddedBitmaps() const { return meEmbeddedBitmap == EMBEDDEDBITMAP_FALSE; } bool DontUseAntiAlias() const { return meAntiAlias == ANTIALIAS_FALSE; } bool DontUseHinting() const { return (meHinting == HINTING_FALSE) || (GetHintStyle() == HINT_NONE); } - virtual void* GetPattern(void * /*pFace*/, bool /*bEmbolden*/, bool /*bVerticalMetrics*/) const { return NULL; } + void* GetPattern(void * /*pFace*/, bool /*bEmbolden*/) const; +private: + FcPattern* mpPattern; }; // - ImplFontCharMap - diff --git a/vcl/unx/generic/gdi/cairotextrender.cxx b/vcl/unx/generic/gdi/cairotextrender.cxx index 0f9fafc..10f4f57 100644 --- a/vcl/unx/generic/gdi/cairotextrender.cxx +++ b/vcl/unx/generic/gdi/cairotextrender.cxx @@ -100,7 +100,7 @@ bool CairoTextRender::setFont( const FontSelectPattern *pEntry, int nFallbackLev return false; } -ImplFontOptions* GetFCFontOptions( const ImplFontAttributes& rFontAttributes, int nSize); +FontConfigFontOptions* GetFCFontOptions( const ImplFontAttributes& rFontAttributes, int nSize); void ImplServerFontEntry::HandleFontOptions() { @@ -257,8 +257,8 @@ void CairoTextRender::DrawServerFontLayout( const ServerFontLayout& rLayout ) cairo_font_face_t* font_face = static_cast<cairo_font_face_t*>(CairoFontsCache::FindCachedFont(aId)); if (!font_face) { - const ImplFontOptions *pOptions = rFont.GetFontOptions().get(); - void *pPattern = pOptions ? pOptions->GetPattern(aFace, aId.mbEmbolden, aId.mbVerticalMetrics) : NULL; + const FontConfigFontOptions *pOptions = rFont.GetFontOptions().get(); + void *pPattern = pOptions ? pOptions->GetPattern(aFace, aId.mbEmbolden) : NULL; if (pPattern) font_face = cairo_ft_font_face_create_for_pattern(static_cast<FcPattern*>(pPattern)); if (!font_face) @@ -439,7 +439,7 @@ void cairosubcallback(void* pPattern) static_cast<FcPattern*>(pPattern)); } -ImplFontOptions* GetFCFontOptions( const ImplFontAttributes& rFontAttributes, int nSize) +FontConfigFontOptions* GetFCFontOptions( const ImplFontAttributes& rFontAttributes, int nSize) { psp::FastPrintFontInfo aInfo; _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
