filter/source/msfilter/eschesdo.cxx | 4 - include/svx/fmdpage.hxx | 58 ---------------- include/svx/unopage.hxx | 10 ++ reportdesign/source/core/inc/Section.hxx | 3 sc/inc/pageuno.hxx | 6 - sc/source/ui/unoobj/pageuno.cxx | 4 - sd/source/ui/inc/unopage.hxx | 5 - sd/source/ui/unoidl/unopage.cxx | 112 +++++++++++++++---------------- solenv/clang-format/excludelist | 2 svx/Library_svxcore.mk | 1 svx/source/form/fmdpage.cxx | 97 -------------------------- svx/source/svdraw/svdpage.cxx | 4 - svx/source/unodraw/unomod.cxx | 7 - svx/source/unodraw/unopage.cxx | 42 +++++++++++ sw/inc/unodraw.hxx | 4 - sw/source/core/unocore/unodraw.cxx | 6 - 16 files changed, 125 insertions(+), 240 deletions(-)
New commits: commit 46b8c7a83f2cae57966ac55591e6f512ceaa114f Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Thu Sep 7 12:38:51 2023 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Thu Sep 7 18:41:23 2023 +0200 merge SvxFmDrawPage into SvxDrawPage it adds hardly any functionality. Change-Id: I82f5c52148222596d52f1fb41d726733ca1cf40d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156654 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/filter/source/msfilter/eschesdo.cxx b/filter/source/msfilter/eschesdo.cxx index efe6cdfaa495..480b3dfe42f5 100644 --- a/filter/source/msfilter/eschesdo.cxx +++ b/filter/source/msfilter/eschesdo.cxx @@ -24,7 +24,7 @@ #include <tools/poly.hxx> #include <tools/debug.hxx> #include <comphelper/diagnose_ex.hxx> -#include <svx/fmdpage.hxx> +#include <svx/unopage.hxx> #include <com/sun/star/awt/Rectangle.hpp> #include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/beans/XPropertySet.hpp> @@ -872,7 +872,7 @@ bool ImplEESdrWriter::ImplInitPage( const SdrPage& rPage ) Reference<css::lang::XComponent> xOldDrawPage(mXDrawPage, UNO_QUERY); if (xOldDrawPage.is()) xOldDrawPage->dispose(); - mXDrawPage = pSvxDrawPage = new SvxFmDrawPage( const_cast<SdrPage*>(&rPage) ); + mXDrawPage = pSvxDrawPage = new SvxDrawPage( const_cast<SdrPage*>(&rPage) ); mXShapes = mXDrawPage; if ( !mXShapes.is() ) return false; diff --git a/include/svx/fmdpage.hxx b/include/svx/fmdpage.hxx deleted file mode 100644 index e7f3732cad1c..000000000000 --- a/include/svx/fmdpage.hxx +++ /dev/null @@ -1,58 +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_FMDPAGE_HXX -#define INCLUDED_SVX_FMDPAGE_HXX - -#include <com/sun/star/form/XFormsSupplier2.hpp> -#include <svx/unopage.hxx> -#include <svx/svxdllapi.h> - - -// SvxFmDrawPage - -typedef cppu::ImplInheritanceHelper<SvxDrawPage, css::form::XFormsSupplier2> SvxFmDrawPage_Base; - -class SVXCORE_DLLPUBLIC SvxFmDrawPage : public SvxFmDrawPage_Base -{ -protected: - - // Creating a SdrObject based on a Description. Can be used by derived classes to - // support own css::drawing::Shapes (for example Controls) - virtual rtl::Reference<SdrObject> CreateSdrObject_( const css::uno::Reference< css::drawing::XShape > & xShape ) override; - - // The following method is called when a SvxShape object should be created. - // Derived classes can create a derivation or an object aggregating SvxShape. - virtual css::uno::Reference< css::drawing::XShape > CreateShape( SdrObject *pObj ) const override; - -public: - SvxFmDrawPage( SdrPage* pPage ); - virtual ~SvxFmDrawPage() noexcept override; - - virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override; - - // XFormsSupplier - virtual css::uno::Reference< css::container::XNameContainer > SAL_CALL getForms() override; - - // XFormsSupplier2 - virtual sal_Bool SAL_CALL hasForms() override; -}; - -#endif // INCLUDED_SVX_FMDPAGE_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/unopage.hxx b/include/svx/unopage.hxx index fc6860aa9274..82f643e29471 100644 --- a/include/svx/unopage.hxx +++ b/include/svx/unopage.hxx @@ -27,6 +27,7 @@ #include <com/sun/star/drawing/XShapes3.hpp> #include <com/sun/star/drawing/XShapeGrouper.hpp> #include <com/sun/star/lang/XUnoTunnel.hpp> +#include <com/sun/star/form/XFormsSupplier2.hpp> #include <cppuhelper/basemutex.hxx> #include <svx/svxdllapi.h> #include <svx/svdobjkind.hxx> @@ -54,7 +55,8 @@ class SVXCORE_DLLPUBLIC SvxDrawPage : protected cppu::BaseMutex, css::drawing::XShapes3, css::lang::XServiceInfo, css::lang::XUnoTunnel, - css::lang::XComponent> + css::lang::XComponent, + css::form::XFormsSupplier2> { protected: @@ -129,6 +131,12 @@ class SVXCORE_DLLPUBLIC SvxDrawPage : protected cppu::BaseMutex, virtual void SAL_CALL dispose() override; virtual void SAL_CALL addEventListener( const css::uno::Reference< css::lang::XEventListener >& aListener ) override; virtual void SAL_CALL removeEventListener( const css::uno::Reference< css::lang::XEventListener >& aListener ) override; + + // XFormsSupplier + virtual css::uno::Reference< css::container::XNameContainer > SAL_CALL getForms() override; + + // XFormsSupplier2 + virtual sal_Bool SAL_CALL hasForms() override; }; #endif diff --git a/reportdesign/source/core/inc/Section.hxx b/reportdesign/source/core/inc/Section.hxx index 5417af2a9a1e..7fd9ccffd9f5 100644 --- a/reportdesign/source/core/inc/Section.hxx +++ b/reportdesign/source/core/inc/Section.hxx @@ -39,10 +39,9 @@ namespace reportdesign < css::report::XSection , css::lang::XServiceInfo , css::lang::XUnoTunnel - // SvxDrawPage forward + // SvxDrawPage forwards , css::drawing::XDrawPage , css::drawing::XShapeGrouper - // SvxFmDrawPage forward , css::form::XFormsSupplier2 > SectionBase; typedef ::cppu::PropertySetMixin<css::report::XSection> SectionPropertySet; diff --git a/sc/inc/pageuno.hxx b/sc/inc/pageuno.hxx index 742b2aaa583a..1956ba246270 100644 --- a/sc/inc/pageuno.hxx +++ b/sc/inc/pageuno.hxx @@ -19,11 +19,11 @@ #pragma once -#include <svx/fmdpage.hxx> +#include <svx/unopage.hxx> -// SvxFmDrawPage subclass to create ScShapeObj for shapes +// SvxDrawPage subclass to create ScShapeObj for shapes -class ScPageObj final : public SvxFmDrawPage +class ScPageObj final : public SvxDrawPage { public: ScPageObj(SdrPage* pPage); diff --git a/sc/source/ui/unoobj/pageuno.cxx b/sc/source/ui/unoobj/pageuno.cxx index 796d16e12e06..3ca903e63eb6 100644 --- a/sc/source/ui/unoobj/pageuno.cxx +++ b/sc/source/ui/unoobj/pageuno.cxx @@ -25,7 +25,7 @@ using namespace ::com::sun::star; ScPageObj::ScPageObj( SdrPage* pPage ) : - SvxFmDrawPage( pPage ) + SvxDrawPage( pPage ) { } @@ -35,7 +35,7 @@ ScPageObj::~ScPageObj() noexcept uno::Reference<drawing::XShape > ScPageObj::CreateShape( SdrObject *pObj ) const { - uno::Reference<drawing::XShape> xShape(SvxFmDrawPage::CreateShape( pObj )); + uno::Reference<drawing::XShape> xShape(SvxDrawPage::CreateShape( pObj )); new ScShapeObj( xShape ); // aggregates object and modifies xShape diff --git a/sd/source/ui/inc/unopage.hxx b/sd/source/ui/inc/unopage.hxx index b62ce21cc579..cc7b48f8b0de 100644 --- a/sd/source/ui/inc/unopage.hxx +++ b/sd/source/ui/inc/unopage.hxx @@ -29,7 +29,6 @@ #include <com/sun/star/office/XAnnotationAccess.hpp> #include <svx/unopage.hxx> -#include <svx/fmdpage.hxx> #include <comphelper/servicehelper.hxx> #include <cppuhelper/implbase.hxx> @@ -40,7 +39,7 @@ class SdrObject; class SdXImpressDocument; -class SdGenericDrawPage : public SvxFmDrawPage, +class SdGenericDrawPage : public SvxDrawPage, public SdUnoSearchReplaceShape, public css::drawing::XShapeCombiner, public css::drawing::XShapeBinder, @@ -105,7 +104,7 @@ public: // this is called whenever a SdrObject must be created for an empty api shape wrapper virtual rtl::Reference<SdrObject> CreateSdrObject_( const css::uno::Reference< css::drawing::XShape >& xShape ) override; - // SvxFmDrawPage + // SvxDrawPage virtual css::uno::Reference<css::drawing::XShape> CreateShape(SdrObject *pObj) const override; // XInterface diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx index c7f35d08f1f1..a92e381bd154 100644 --- a/sd/source/ui/unoidl/unopage.cxx +++ b/sd/source/ui/unoidl/unopage.cxx @@ -334,11 +334,11 @@ const css::uno::Sequence< sal_Int8 > & SdGenericDrawPage::getUnoTunnelId() noexc sal_Int64 SAL_CALL SdGenericDrawPage::getSomething( const css::uno::Sequence< sal_Int8 >& rId ) { return comphelper::getSomethingImpl(rId, this, - comphelper::FallbackToGetSomethingOf<SvxFmDrawPage>{}); + comphelper::FallbackToGetSomethingOf<SvxDrawPage>{}); } SdGenericDrawPage::SdGenericDrawPage(SdXImpressDocument* _pModel, SdPage* pInPage, const SvxItemPropertySet* _pSet) -: SvxFmDrawPage( static_cast<SdrPage*>(pInPage) ), +: SvxDrawPage( static_cast<SdrPage*>(pInPage) ), SdUnoSearchReplaceShape(this), mpDocModel( _pModel ), mpSdrModel(nullptr), @@ -346,7 +346,7 @@ SdGenericDrawPage::SdGenericDrawPage(SdXImpressDocument* _pModel, SdPage* pInPag mnTempPageNumber(0), mpPropSet ( _pSet ) { - mpSdrModel = SvxFmDrawPage::mpModel; + mpSdrModel = SvxDrawPage::mpModel; if( mpDocModel ) mbIsImpressDocument = mpDocModel->IsImpressDocument(); @@ -358,20 +358,20 @@ SdGenericDrawPage::~SdGenericDrawPage() noexcept void SdGenericDrawPage::throwIfDisposed() const { - if( (SvxFmDrawPage::mpModel == nullptr) || (mpDocModel == nullptr) || (SvxFmDrawPage::mpPage == nullptr) ) + if( (SvxDrawPage::mpModel == nullptr) || (mpDocModel == nullptr) || (SvxDrawPage::mpPage == nullptr) ) throw lang::DisposedException(); } SdXImpressDocument* SdGenericDrawPage::GetModel() const { - if( mpSdrModel != SvxFmDrawPage::mpModel ) + if( mpSdrModel != SvxDrawPage::mpModel ) const_cast<SdGenericDrawPage*>(this)->UpdateModel(); return mpDocModel; } bool SdGenericDrawPage::IsImpressDocument() const { - if( mpSdrModel != SvxFmDrawPage::mpModel ) + if( mpSdrModel != SvxDrawPage::mpModel ) const_cast<SdGenericDrawPage*>(this)->UpdateModel(); return mbIsImpressDocument; } @@ -379,10 +379,10 @@ bool SdGenericDrawPage::IsImpressDocument() const void SdGenericDrawPage::UpdateModel() { - mpSdrModel = SvxFmDrawPage::mpModel; + mpSdrModel = SvxDrawPage::mpModel; if( mpSdrModel ) { - uno::Reference< uno::XInterface > xModel( SvxFmDrawPage::mpModel->getUnoModel() ); + uno::Reference< uno::XInterface > xModel( SvxDrawPage::mpModel->getUnoModel() ); mpDocModel = comphelper::getFromUnoTunnel<SdXImpressDocument>( xModel ); } else @@ -395,14 +395,14 @@ void SdGenericDrawPage::UpdateModel() // this is called whenever a SdrObject must be created for an empty api shape wrapper rtl::Reference<SdrObject> SdGenericDrawPage::CreateSdrObject_( const Reference< drawing::XShape >& xShape ) { - if( nullptr == SvxFmDrawPage::mpPage || !xShape.is() ) + if( nullptr == SvxDrawPage::mpPage || !xShape.is() ) return nullptr; OUString aType( xShape->getShapeType() ); static constexpr OUStringLiteral aPrefix( u"com.sun.star.presentation." ); if( !aType.startsWith( aPrefix ) ) { - return SvxFmDrawPage::CreateSdrObject_( xShape ); + return SvxDrawPage::CreateSdrObject_( xShape ); } aType = aType.copy( aPrefix.getLength() ); @@ -492,7 +492,7 @@ rtl::Reference<SdrObject> SdGenericDrawPage::CreateSdrObject_( const Reference< rtl::Reference<SdrObject> pPresObj; if( (eObjKind == PresObjKind::Table) || (eObjKind == PresObjKind::Media) ) { - pPresObj = SvxFmDrawPage::CreateSdrObject_( xShape ); + pPresObj = SvxDrawPage::CreateSdrObject_( xShape ); if( pPresObj ) { SdDrawDocument& rDoc(static_cast< SdDrawDocument& >(GetPage()->getSdrModelFromSdrPage())); @@ -560,7 +560,7 @@ Any SdGenericDrawPage::queryInterface(const uno::Type & rType) return Any( Reference< XAnimationNodeSupplier >( this ) ); } else - return SvxFmDrawPage::queryInterface( rType ); + return SvxDrawPage::queryInterface( rType ); return aAny; } @@ -1444,7 +1444,7 @@ Reference< drawing::XShape > SdGenericDrawPage::CreateShape(SdrObject *pObj) co Reference< drawing::XShape > xShape( pShape ); if(!xShape.is()) - xShape = SvxFmDrawPage::CreateShape( pObj ); + xShape = SvxDrawPage::CreateShape( pObj ); if( eKind != PresObjKind::NONE ) { @@ -1525,7 +1525,7 @@ Reference< drawing::XShape > SdGenericDrawPage::CreateShape(SdrObject *pObj) co } else { - return SvxFmDrawPage::CreateShape( pObj ); + return SvxDrawPage::CreateShape( pObj ); } } @@ -1534,7 +1534,7 @@ Reference< drawing::XShape > SdGenericDrawPage::CreateShape(SdrObject *pObj) co Sequence< OUString > SAL_CALL SdGenericDrawPage::getSupportedServiceNames() { return comphelper::concatSequences( - SvxFmDrawPage::getSupportedServiceNames(), + SvxDrawPage::getSupportedServiceNames(), std::initializer_list<std::u16string_view>{ u"com.sun.star.drawing.GenericDrawPage", u"com.sun.star.document.LinkTarget", u"com.sun.star.document.LinkTargetSupplier" }); @@ -1559,12 +1559,12 @@ void SdGenericDrawPage::getBackground( Any& ) OUString SdGenericDrawPage::getBookmarkURL() const { OUString aRet; - if( SvxFmDrawPage::mpPage ) + if( SvxDrawPage::mpPage ) { - OUString aFileName( static_cast<SdPage*>(SvxFmDrawPage::mpPage)->GetFileName() ); + OUString aFileName( static_cast<SdPage*>(SvxDrawPage::mpPage)->GetFileName() ); if( !aFileName.isEmpty() ) { - const OUString aBookmarkName( SdDrawPage::getPageApiNameFromUiName( static_cast<SdPage*>(SvxFmDrawPage::mpPage)->GetBookmarkName() ) ); + const OUString aBookmarkName( SdDrawPage::getPageApiNameFromUiName( static_cast<SdPage*>(SvxDrawPage::mpPage)->GetBookmarkName() ) ); aRet = aFileName + "#" + aBookmarkName; } } @@ -1574,7 +1574,7 @@ OUString SdGenericDrawPage::getBookmarkURL() const void SdGenericDrawPage::setBookmarkURL( std::u16string_view rURL ) { - if( !SvxFmDrawPage::mpPage ) + if( !SvxDrawPage::mpPage ) return; size_t nIndex = rURL.find( '#' ); @@ -1586,10 +1586,10 @@ void SdGenericDrawPage::setBookmarkURL( std::u16string_view rURL ) if( !aFileName.isEmpty() && !aBookmarkName.isEmpty() ) { - static_cast<SdPage*>(SvxFmDrawPage::mpPage)->DisconnectLink(); - static_cast<SdPage*>(SvxFmDrawPage::mpPage)->SetFileName( aFileName ); - static_cast<SdPage*>(SvxFmDrawPage::mpPage)->SetBookmarkName( aBookmarkName ); - static_cast<SdPage*>(SvxFmDrawPage::mpPage)->ConnectLink(); + static_cast<SdPage*>(SvxDrawPage::mpPage)->DisconnectLink(); + static_cast<SdPage*>(SvxDrawPage::mpPage)->SetFileName( aFileName ); + static_cast<SdPage*>(SvxDrawPage::mpPage)->SetBookmarkName( aBookmarkName ); + static_cast<SdPage*>(SvxDrawPage::mpPage)->ConnectLink(); } } @@ -1599,7 +1599,7 @@ Reference< drawing::XShape > SAL_CALL SdGenericDrawPage::combine( const Referenc throwIfDisposed(); - DBG_ASSERT(SvxFmDrawPage::mpPage,"SdrPage is NULL! [CL]"); + DBG_ASSERT(SvxDrawPage::mpPage,"SdrPage is NULL! [CL]"); DBG_ASSERT(mpView, "SdrView is NULL! [CL]"); Reference< drawing::XShape > xShape; @@ -1880,7 +1880,7 @@ void SdGenericDrawPage::SetHeight( sal_Int32 nHeight ) void SdGenericDrawPage::disposing() noexcept { mpDocModel = nullptr; - SvxFmDrawPage::disposing(); + SvxDrawPage::disposing(); } // XAnimationNodeSupplier @@ -1890,7 +1890,7 @@ Reference< XAnimationNode > SAL_CALL SdGenericDrawPage::getAnimationNode() throwIfDisposed(); - SdPage *pSdPage = static_cast<SdPage*>(SvxFmDrawPage::mpPage); + SdPage *pSdPage = static_cast<SdPage*>(SvxDrawPage::mpPage); return pSdPage->getAnimationNode(); } @@ -2338,9 +2338,9 @@ Reference< drawing::XDrawPage > SAL_CALL SdDrawPage::getMasterPage( ) { Reference< drawing::XDrawPage > xPage; - if(SvxFmDrawPage::mpPage->TRG_HasMasterPage()) + if(SvxDrawPage::mpPage->TRG_HasMasterPage()) { - SdrPage& rMasterPage = SvxFmDrawPage::mpPage->TRG_GetMasterPage(); + SdrPage& rMasterPage = SvxDrawPage::mpPage->TRG_GetMasterPage(); xPage.set( rMasterPage.getUnoPage(), uno::UNO_QUERY ); } @@ -2356,31 +2356,31 @@ void SAL_CALL SdDrawPage::setMasterPage( const Reference< drawing::XDrawPage >& throwIfDisposed(); - if(!SvxFmDrawPage::mpPage) + if(!SvxDrawPage::mpPage) return; SdMasterPage* pMasterPage = comphelper::getFromUnoTunnel<SdMasterPage>( xMasterPage ); if( !(pMasterPage && pMasterPage->isValid()) ) return; - SvxFmDrawPage::mpPage->TRG_ClearMasterPage(); + SvxDrawPage::mpPage->TRG_ClearMasterPage(); SdPage* pSdPage = static_cast<SdPage*>(pMasterPage->GetSdrPage()); - SvxFmDrawPage::mpPage->TRG_SetMasterPage(*pSdPage); + SvxDrawPage::mpPage->TRG_SetMasterPage(*pSdPage); - SvxFmDrawPage::mpPage->SetBorder(pSdPage->GetLeftBorder(),pSdPage->GetUpperBorder(), + SvxDrawPage::mpPage->SetBorder(pSdPage->GetLeftBorder(),pSdPage->GetUpperBorder(), pSdPage->GetRightBorder(),pSdPage->GetLowerBorder() ); - SvxFmDrawPage::mpPage->SetSize( pSdPage->GetSize() ); - SvxFmDrawPage::mpPage->SetOrientation( pSdPage->GetOrientation() ); - static_cast<SdPage*>(SvxFmDrawPage::mpPage)->SetLayoutName( pSdPage->GetLayoutName() ); + SvxDrawPage::mpPage->SetSize( pSdPage->GetSize() ); + SvxDrawPage::mpPage->SetOrientation( pSdPage->GetOrientation() ); + static_cast<SdPage*>(SvxDrawPage::mpPage)->SetLayoutName( pSdPage->GetLayoutName() ); // set notes master also - SdPage* pNotesPage = GetModel()->GetDoc()->GetSdPage( (SvxFmDrawPage::mpPage->GetPageNum()-1)>>1, PageKind::Notes ); + SdPage* pNotesPage = GetModel()->GetDoc()->GetSdPage( (SvxDrawPage::mpPage->GetPageNum()-1)>>1, PageKind::Notes ); pNotesPage->TRG_ClearMasterPage(); - sal_uInt16 nNum = SvxFmDrawPage::mpPage->TRG_GetMasterPage().GetPageNum() + 1; - pNotesPage->TRG_SetMasterPage(*SvxFmDrawPage::mpPage->getSdrModelFromSdrPage().GetMasterPage(nNum)); + sal_uInt16 nNum = SvxDrawPage::mpPage->TRG_GetMasterPage().GetPageNum() + 1; + pNotesPage->TRG_SetMasterPage(*SvxDrawPage::mpPage->getSdrModelFromSdrPage().GetMasterPage(nNum)); pNotesPage->SetLayoutName( pSdPage->GetLayoutName() ); GetModel()->SetModified(); @@ -2393,9 +2393,9 @@ Reference< drawing::XDrawPage > SAL_CALL SdDrawPage::getNotesPage() throwIfDisposed(); - if(SvxFmDrawPage::mpPage && GetModel()->GetDoc() && SvxFmDrawPage::mpPage->GetPageNum() ) + if(SvxDrawPage::mpPage && GetModel()->GetDoc() && SvxDrawPage::mpPage->GetPageNum() ) { - SdPage* pNotesPage = GetModel()->GetDoc()->GetSdPage( (SvxFmDrawPage::mpPage->GetPageNum()-1)>>1, PageKind::Notes ); + SdPage* pNotesPage = GetModel()->GetDoc()->GetSdPage( (SvxDrawPage::mpPage->GetPageNum()-1)>>1, PageKind::Notes ); if( pNotesPage ) { Reference< drawing::XDrawPage > xPage( pNotesPage->getUnoPage(), uno::UNO_QUERY ); @@ -2505,7 +2505,7 @@ void SdDrawPage::setBackground( const Any& rValue ) } // repaint only - SvxFmDrawPage::mpPage->ActionChanged(); + SvxDrawPage::mpPage->ActionChanged(); } // XAnnotationAccess: @@ -2699,7 +2699,7 @@ Sequence< uno::Type > SAL_CALL SdMasterPage::getTypes() if( !maTypeSequence.hasElements() ) { const PageKind ePageKind = GetPage() ? GetPage()->GetPageKind() : PageKind::Standard; - bool bPresPage = IsImpressDocument() && SvxFmDrawPage::mpPage && ePageKind != PageKind::Handout; + bool bPresPage = IsImpressDocument() && SvxDrawPage::mpPage && ePageKind != PageKind::Handout; // Collect the types of this class. ::std::vector<uno::Type> aTypes; @@ -2748,7 +2748,7 @@ Sequence< OUString > SAL_CALL SdMasterPage::getSupportedServiceNames() std::vector<std::u16string_view> aAdd{ u"com.sun.star.drawing.MasterPage" }; - if( SvxFmDrawPage::mpPage && static_cast<SdPage*>(SvxFmDrawPage::mpPage)->GetPageKind() == PageKind::Handout ) + if( SvxDrawPage::mpPage && static_cast<SdPage*>(SvxDrawPage::mpPage)->GetPageKind() == PageKind::Handout ) aAdd.emplace_back(u"com.sun.star.presentation.HandoutMasterPage"); return comphelper::concatSequences(SdGenericDrawPage::getSupportedServiceNames(), aAdd); @@ -2766,10 +2766,10 @@ sal_Bool SAL_CALL SdMasterPage::hasElements() throwIfDisposed(); - if( SvxFmDrawPage::mpPage == nullptr ) + if( SvxDrawPage::mpPage == nullptr ) return false; - return SvxFmDrawPage::mpPage->GetObjCount() > 0; + return SvxDrawPage::mpPage->GetObjCount() > 0; } uno::Type SAL_CALL SdMasterPage::getElementType() @@ -2856,15 +2856,15 @@ void SdMasterPage::setBackground( const Any& rValue ) pBackground->setPropertyValue( aPropName, xInputSet->getPropertyValue( aPropName ) ); } - pBackground->fillItemSet( static_cast<SdDrawDocument*>(&SvxFmDrawPage::mpPage->getSdrModelFromSdrPage()), aSet ); + pBackground->fillItemSet( static_cast<SdDrawDocument*>(&SvxDrawPage::mpPage->getSdrModelFromSdrPage()), aSet ); } // if we find the background style, copy the set to the background - SdDrawDocument* pDoc = static_cast<SdDrawDocument*>(&SvxFmDrawPage::mpPage->getSdrModelFromSdrPage()); + SdDrawDocument* pDoc = static_cast<SdDrawDocument*>(&SvxDrawPage::mpPage->getSdrModelFromSdrPage()); SfxStyleSheetBasePool* pSSPool = pDoc->GetStyleSheetPool(); if(pSSPool) { - OUString aLayoutName( static_cast< SdPage* >( SvxFmDrawPage::mpPage )->GetLayoutName() ); + OUString aLayoutName( static_cast< SdPage* >( SvxDrawPage::mpPage )->GetLayoutName() ); aLayoutName = OUString::Concat(aLayoutName.subView(0, aLayoutName.indexOf(SD_LT_SEPARATOR)+4)) + STR_LAYOUT_BACKGROUND; SfxStyleSheetBase* pStyleSheet = pSSPool->Find( aLayoutName, SfxStyleFamily::Page ); @@ -2874,7 +2874,7 @@ void SdMasterPage::setBackground( const Any& rValue ) pStyleSheet->GetItemSet().Put( aSet ); // repaint only - SvxFmDrawPage::mpPage->ActionChanged(); + SvxDrawPage::mpPage->ActionChanged(); return; } } @@ -2906,11 +2906,11 @@ void SdMasterPage::getBackground( Any& rValue ) } else { - SdDrawDocument* pDoc = static_cast<SdDrawDocument*>(&SvxFmDrawPage::mpPage->getSdrModelFromSdrPage()); + SdDrawDocument* pDoc = static_cast<SdDrawDocument*>(&SvxDrawPage::mpPage->getSdrModelFromSdrPage()); SfxStyleSheetBasePool* pSSPool = pDoc->GetStyleSheetPool(); if(pSSPool) { - OUString aLayoutName( static_cast< SdPage* >(SvxFmDrawPage::mpPage)->GetLayoutName() ); + OUString aLayoutName( static_cast< SdPage* >(SvxDrawPage::mpPage)->GetLayoutName() ); aLayoutName = OUString::Concat(aLayoutName.subView(0, aLayoutName.indexOf(SD_LT_SEPARATOR)+4)) + STR_LAYOUT_BACKGROUND; SfxStyleSheetBase* pStyleSheet = pSSPool->Find( aLayoutName, SfxStyleFamily::Page ); @@ -2928,7 +2928,7 @@ void SdMasterPage::getBackground( Any& rValue ) // No style found, use fill attributes from page background. This // should NOT happen and is an error - const SfxItemSet& rFallbackItemSet(SvxFmDrawPage::mpPage->getSdrPageProperties().GetItemSet()); + const SfxItemSet& rFallbackItemSet(SvxDrawPage::mpPage->getSdrPageProperties().GetItemSet()); if(drawing::FillStyle_NONE == rFallbackItemSet.Get(XATTR_FILLSTYLE).GetValue()) { @@ -2955,7 +2955,7 @@ void SAL_CALL SdMasterPage::setName( const OUString& rName ) throwIfDisposed(); - if(!(SvxFmDrawPage::mpPage && GetPage()->GetPageKind() != PageKind::Notes)) + if(!(SvxDrawPage::mpPage && GetPage()->GetPageKind() != PageKind::Notes)) return; SdDrawDocument* pDoc = GetModel()->GetDoc(); @@ -2994,7 +2994,7 @@ OUString SAL_CALL SdMasterPage::getName( ) throwIfDisposed(); - if(SvxFmDrawPage::mpPage) + if(SvxDrawPage::mpPage) { OUString aLayoutName( GetPage()->GetLayoutName() ); return aLayoutName.copy(0, aLayoutName.indexOf(SD_LT_SEPARATOR)); @@ -3010,9 +3010,9 @@ Reference< drawing::XDrawPage > SAL_CALL SdMasterPage::getNotesPage() throwIfDisposed(); - if(SvxFmDrawPage::mpPage && GetModel()->GetDoc() ) + if(SvxDrawPage::mpPage && GetModel()->GetDoc() ) { - SdPage* pNotesPage = GetModel()->GetDoc()->GetMasterSdPage( (SvxFmDrawPage::mpPage->GetPageNum()-1)>>1, PageKind::Notes ); + SdPage* pNotesPage = GetModel()->GetDoc()->GetMasterSdPage( (SvxDrawPage::mpPage->GetPageNum()-1)>>1, PageKind::Notes ); if( pNotesPage ) { Reference< drawing::XDrawPage > xPage( pNotesPage->getUnoPage(), uno::UNO_QUERY ); diff --git a/solenv/clang-format/excludelist b/solenv/clang-format/excludelist index ce890e04fb61..14ff7c544643 100644 --- a/solenv/clang-format/excludelist +++ b/solenv/clang-format/excludelist @@ -5797,7 +5797,6 @@ include/svx/extedit.hxx include/svx/fillctrl.hxx include/svx/flagsdef.hxx include/svx/float3d.hxx -include/svx/fmdpage.hxx include/svx/fmgridcl.hxx include/svx/fmgridif.hxx include/svx/fmmodel.hxx @@ -11458,7 +11457,6 @@ svx/source/form/fmcontrolbordermanager.cxx svx/source/form/fmcontrollayout.cxx svx/source/form/fmdmod.cxx svx/source/form/fmdocumentclassification.cxx -svx/source/form/fmdpage.cxx svx/source/form/fmexch.cxx svx/source/form/fmexpl.cxx svx/source/form/fmmodel.cxx diff --git a/svx/Library_svxcore.mk b/svx/Library_svxcore.mk index c4ba58048f4b..51121441959a 100644 --- a/svx/Library_svxcore.mk +++ b/svx/Library_svxcore.mk @@ -161,7 +161,6 @@ $(eval $(call gb_Library_add_exception_objects,svxcore,\ svx/source/form/fmcontrollayout \ svx/source/form/fmdmod \ svx/source/form/fmdocumentclassification \ - svx/source/form/fmdpage \ svx/source/form/fmexch \ svx/source/form/fmexpl \ svx/source/form/fmmodel \ diff --git a/svx/source/form/fmdpage.cxx b/svx/source/form/fmdpage.cxx deleted file mode 100644 index 7f5c8a9c303e..000000000000 --- a/svx/source/form/fmdpage.cxx +++ /dev/null @@ -1,97 +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 <svx/fmpage.hxx> -#include <fmobj.hxx> -#include <svx/fmdpage.hxx> -#include <svx/unoshape.hxx> -#include <vcl/svapp.hxx> -#include <cppuhelper/queryinterface.hxx> - -using ::com::sun::star::uno::Any; -using ::com::sun::star::form::XFormsSupplier2; - -SvxFmDrawPage::SvxFmDrawPage( SdrPage* pInPage ) : - SvxFmDrawPage_Base( pInPage ) -{ -} - -SvxFmDrawPage::~SvxFmDrawPage() noexcept -{ -} - -css::uno::Sequence< sal_Int8 > SAL_CALL SvxFmDrawPage::getImplementationId() -{ - return css::uno::Sequence<sal_Int8>(); -} - -rtl::Reference<SdrObject> SvxFmDrawPage::CreateSdrObject_( const css::uno::Reference< css::drawing::XShape > & xDescr ) -{ - OUString aShapeType( xDescr->getShapeType() ); - - if ( aShapeType == "com.sun.star.drawing.ShapeControl" // compatibility - || aShapeType == "com.sun.star.drawing.ControlShape" - ) - { - return new FmFormObj(GetSdrPage()->getSdrModelFromSdrPage()); - } - else - { - return SvxDrawPage::CreateSdrObject_( xDescr ); - } -} - -css::uno::Reference< css::drawing::XShape > SvxFmDrawPage::CreateShape( SdrObject *pObj ) const -{ - if( SdrInventor::FmForm == pObj->GetObjInventor() ) - { - css::uno::Reference< css::drawing::XShape > xShape = static_cast<SvxShape*>(new SvxShapeControl( pObj )); - return xShape; - } - else - return SvxDrawPage::CreateShape( pObj ); -} - -// XFormsSupplier -css::uno::Reference< css::container::XNameContainer > SAL_CALL SvxFmDrawPage::getForms() -{ - SolarMutexGuard g; - - css::uno::Reference< css::container::XNameContainer > xForms; - - FmFormPage *pFmPage = dynamic_cast<FmFormPage*>( GetSdrPage() ); - if( pFmPage ) - xForms.set( pFmPage->GetForms(), css::uno::UNO_QUERY_THROW ); - - return xForms; -} - -// XFormsSupplier2 -sal_Bool SAL_CALL SvxFmDrawPage::hasForms() -{ - SolarMutexGuard g; - - bool bHas = false; - FmFormPage* pFormPage = dynamic_cast<FmFormPage*>( GetSdrPage() ); - if ( pFormPage ) - bHas = pFormPage->GetForms( false ).is(); - return bHas; -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx index 6e17a91d5a4d..840d9d6cc0e7 100644 --- a/svx/source/svdraw/svdpage.cxx +++ b/svx/source/svdraw/svdpage.cxx @@ -24,6 +24,7 @@ #include <svx/svdpage.hxx> #include <svx/unoshape.hxx> +#include <svx/unopage.hxx> #include <o3tl/safeint.hxx> #include <string.h> @@ -44,7 +45,6 @@ #include <svx/svdpagv.hxx> #include <svx/svdundo.hxx> #include <svx/xfillit0.hxx> -#include <svx/fmdpage.hxx> #include <svx/ColorSets.hxx> #include <sdr/contact/viewcontactofsdrpage.hxx> @@ -1767,7 +1767,7 @@ uno::Reference< uno::XInterface > const & SdrPage::getUnoPage() uno::Reference< uno::XInterface > SdrPage::createUnoPage() { - return cppu::getXWeak(new SvxFmDrawPage(this)); + return cppu::getXWeak(new SvxDrawPage(this)); } SfxStyleSheet* SdrPage::GetTextStyleSheetForObject( SdrObject* pObj ) const diff --git a/svx/source/unodraw/unomod.cxx b/svx/source/unodraw/unomod.cxx index 79f98e36042f..28f9558ac320 100644 --- a/svx/source/unodraw/unomod.cxx +++ b/svx/source/unodraw/unomod.cxx @@ -35,7 +35,6 @@ #include <editeng/unonrule.hxx> #include <svtools/unoimap.hxx> #include <sfx2/event.hxx> -#include <svx/fmdpage.hxx> #include <svx/fmmodel.hxx> #include <svx/fmpage.hxx> #include <svx/unoapi.hxx> @@ -556,11 +555,7 @@ uno::Any SAL_CALL SvxUnoDrawPagesAccess::getByIndex( sal_Int32 Index ) if( !xPage.is() ) { - if( dynamic_cast<FmFormModel*>( mrModel.mpDoc ) ) - xPage = static_cast<drawing::XDrawPage*>(new SvxFmDrawPage( pPage )); - else - xPage = static_cast<drawing::XDrawPage*>(new SvxDrawPage( pPage )); - + xPage = static_cast<drawing::XDrawPage*>(new SvxDrawPage( pPage )); pPage->mxUnoPage = xPage; } diff --git a/svx/source/unodraw/unopage.cxx b/svx/source/unodraw/unopage.cxx index 63c3bb422c0a..960212ef6cdc 100644 --- a/svx/source/unodraw/unopage.cxx +++ b/svx/source/unodraw/unopage.cxx @@ -23,6 +23,7 @@ #include <com/sun/star/embed/XEmbeddedObject.hpp> #include <com/sun/star/lang/DisposedException.hpp> #include <com/sun/star/lang/IndexOutOfBoundsException.hpp> +#include <com/sun/star/form/XForms.hpp> #include <o3tl/safeint.hxx> #include <osl/mutex.hxx> #include <comphelper/classids.hxx> @@ -30,6 +31,7 @@ #include <comphelper/sequence.hxx> #include <cppuhelper/supportsservice.hxx> +#include <svx/fmpage.hxx> #include <svx/svdpool.hxx> #include <svx/svdobj.hxx> #include <svx/svdoole2.hxx> @@ -53,6 +55,7 @@ #include <comphelper/diagnose_ex.hxx> #include <tools/globname.hxx> #include <sal/log.hxx> +#include <fmobj.hxx> using namespace ::cppu; using namespace ::com::sun::star; @@ -490,6 +493,15 @@ void SAL_CALL SvxDrawPage::ungroup( const Reference< drawing::XShapeGroup >& aGr rtl::Reference<SdrObject> SvxDrawPage::CreateSdrObject_(const Reference< drawing::XShape > & xShape) { + OUString aShapeType( xShape->getShapeType() ); + + if ( aShapeType == "com.sun.star.drawing.ShapeControl" // compatibility + || aShapeType == "com.sun.star.drawing.ControlShape" + ) + { + return new FmFormObj(GetSdrPage()->getSdrModelFromSdrPage()); + } + SdrObjKind nType = SdrObjKind::NONE; SdrInventor nInventor; @@ -610,6 +622,10 @@ rtl::Reference<SvxShape> SvxDrawPage::CreateShapeByTypeAndInventor( SdrObjKind n switch( nInventor ) { + case SdrInventor::FmForm: + { + return new SvxShapeControl( pObj ); + } case SdrInventor::E3d: { switch( nType ) @@ -893,4 +909,30 @@ SdrPage* GetSdrPageFromXDrawPage( const uno::Reference< drawing::XDrawPage >& xD return nullptr; } +// XFormsSupplier +css::uno::Reference< css::container::XNameContainer > SAL_CALL SvxDrawPage::getForms() +{ + SolarMutexGuard g; + + css::uno::Reference< css::container::XNameContainer > xForms; + + FmFormPage *pFmPage = dynamic_cast<FmFormPage*>( GetSdrPage() ); + if( pFmPage ) + xForms.set( pFmPage->GetForms(), css::uno::UNO_QUERY_THROW ); + + return xForms; +} + +// XFormsSupplier2 +sal_Bool SAL_CALL SvxDrawPage::hasForms() +{ + SolarMutexGuard g; + + bool bHas = false; + FmFormPage* pFormPage = dynamic_cast<FmFormPage*>( GetSdrPage() ); + if ( pFormPage ) + bHas = pFormPage->GetForms( false ).is(); + return bHas; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/inc/unodraw.hxx b/sw/inc/unodraw.hxx index 5d31bbb9bb48..1d78e1fc6d7f 100644 --- a/sw/inc/unodraw.hxx +++ b/sw/inc/unodraw.hxx @@ -21,7 +21,7 @@ #include <svl/itemprop.hxx> #include <svl/listener.hxx> -#include <svx/fmdpage.hxx> +#include <svx/unopage.hxx> #include "frmfmt.hxx" #include <com/sun/star/text/XTextContent.hpp> #include <com/sun/star/drawing/PolyPolygonBezierCoords.hpp> @@ -42,7 +42,7 @@ class SwXShape; typedef cppu::ImplInheritanceHelper < - SvxFmDrawPage, + SvxDrawPage, css::container::XEnumerationAccess, css::beans::XPropertySet> SwFmDrawPage_Base; diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx index 145de10a9674..02266c6992fd 100644 --- a/sw/source/core/unocore/unodraw.cxx +++ b/sw/source/core/unocore/unodraw.cxx @@ -359,7 +359,7 @@ uno::Reference< drawing::XShape > SwFmDrawPage::CreateShape( SdrObject *pObj ) c // own block - temporary object has to be destroyed before // the delegator is set #81670# { - xRet = SvxFmDrawPage::CreateShape( pObj ); + xRet = SvxDrawPage::CreateShape( pObj ); } uno::Reference< XUnoTunnel > xShapeTunnel(xRet, uno::UNO_QUERY); //don't create an SwXShape if it already exists @@ -616,7 +616,7 @@ sal_Bool SwFmDrawPage::hasElements() throw uno::RuntimeException(); if(!m_pDoc->getIDocumentDrawModelAccess().GetDrawModel()) return false; - return SvxFmDrawPage::hasElements(); + return SvxDrawPage::hasElements(); } void SwFmDrawPage::add(const uno::Reference< drawing::XShape > & xShape) @@ -645,7 +645,7 @@ void SwFmDrawPage::add(const uno::Reference< drawing::XShape > & xShape) return; } } - SvxFmDrawPage::add(xShape); + SvxDrawPage::add(xShape); OSL_ENSURE(pSvxShape, "Why is here no SvxShape?"); // this position is definitely in 1/100 mm