diff --git a/.configurations/admin_java_and_deps.dsc.yaml b/.configurations/admin_java_and_deps.dsc.yaml index 2d1f0b7eac77..2a417623989a 100644 --- a/.configurations/admin_java_and_deps.dsc.yaml +++ b/.configurations/admin_java_and_deps.dsc.yaml @@ -61,15 +61,6 @@ properties: Uri: https://repo1.maven.org/maven2/junit/junit/4.10/junit-4.10.jar ChecksumType: SHA256 Checksum: 36a747ca1e0b86f6ea88055b8723bb87030d627766da6288bf077afdeeb0f75a - - resource: xPSDesiredStateConfiguration/xRemoteFile - id: ucrt - directives: - description: download ucrts - settings: - DestinationPath: C:/Users/Public/Downloads - Uri: https://download.microsoft.com/download/C/5/D/C5D68AA1-F62E-422A-9084-4AD85CEB8D4D/WindowsUCRT.zip - ChecksumType: SHA256 - Checksum: 3c9fff1e102adbab55e588ce58b4291db885a530b2ae3bcca851c2721c8be3e1 - resource: xPSDesiredStateConfiguration/xMsiPackage id: JDK_x64 directives: diff --git a/.configurations/user_steps.dsc.yaml b/.configurations/user_steps.dsc.yaml index 21646c12cc74..741ffcbbc050 100644 --- a/.configurations/user_steps.dsc.yaml +++ b/.configurations/user_steps.dsc.yaml @@ -18,7 +18,6 @@ properties: # the empty string element is so that each file can be specified with trailing comma TestScript: | $files = @( - "WindowsUCRT.zip", "apache-ant-1.10.15-bin.zip", "clang-format-5.0.0-win.exe", "jom_1_1_4.zip", @@ -93,16 +92,6 @@ properties: TestScript: Test-Path -Path "$env:USERPROFILE/lo/apache-ant-1.10.15/bin/ant" GetScript: Test-Path -Path "$env:USERPROFILE/lo/apache-ant-1.10.15/bin/ant" SetScript: Expand-Archive -LiteralPath "$env:PUBLIC/Downloads/apache-ant-1.10.15-bin.zip" -Destination "$env:USERPROFILE/lo/" - - resource: xPSDesiredStateConfiguration/xScript - id: ucrt-extract - dependsOn: - - lodir - directives: - description: extract ucrts to the ~/lo directory - settings: - TestScript: Test-Path -Path "$env:USERPROFILE/lo/ucrt/Windows8.1-KB2999226-x64.msu" - GetScript: Test-Path -Path "$env:USERPROFILE/lo/ucrt/Windows8.1-KB2999226-x64.msu" - SetScript: Expand-Archive -LiteralPath "$env:PUBLIC/Downloads/WindowsUCRT.zip" -Destination "$env:USERPROFILE/lo/ucrt" - resource: xPSDesiredStateConfiguration/xScript id: spp-extract dependsOn: @@ -172,7 +161,6 @@ properties: --with-ant-home=$env:USERPROFILE\lo\apache-ant-1.10.15 --with-junit=$env:USERPROFILE\lo\junit-4.10.jar --with-doxygen=$env:USERPROFILE\lo\spp\c\bin\doxygen.exe - --with-ucrt-dir=$env:USERPROFILE\lo\ucrt #--enable-odk #--disable-dependency-tracking #--enable-dbgutil diff --git a/README.md b/README.md index 8e39324cbd95..4aaea53e5df2 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ These are the current minimal operating system and compiler versions to run and compile LibreOffice, also used by the TDF builds: * Windows: - * Runtime: Windows 7 + * Runtime: Windows 10 * Build: Cygwin + Visual Studio 2019 version 16.10 * macOS: * Runtime: 10.15 diff --git a/Repository.mk b/Repository.mk index a6642835e75d..236252a15044 100644 --- a/Repository.mk +++ b/Repository.mk @@ -745,7 +745,6 @@ $(eval $(call gb_Helper_register_libraries_for_install,PLAINLIBS_OOO,spsuppfiles $(eval $(call gb_Helper_register_libraries_for_install,PLAINLIBS_OOO,ooobinarytable, \ $(if $(WINDOWS_SDK_HOME),\ instooofiltmsi \ - inst_msu_msi \ qslnkmsi \ reg_dlls \ reg4allmsdoc \ diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk index 23e397263254..fd5c02d29287 100644 --- a/RepositoryExternal.mk +++ b/RepositoryExternal.mk @@ -4310,10 +4310,6 @@ $(call gb_ExternalProject_use_static_libraries,$(1),dtoa) endef -$(eval $(call gb_Helper_register_packages_for_install,ucrt_binarytable,\ - $(if $(UCRT_REDISTDIR),ucrt) \ -)) - ifneq ($(SYSTEM_BOX2D),) define gb_LinkTarget__use_box2d diff --git a/UnoControls/inc/basecontainercontrol.hxx b/UnoControls/inc/basecontainercontrol.hxx index 18e027cc43d5..bdc63b481b7a 100644 --- a/UnoControls/inc/basecontainercontrol.hxx +++ b/UnoControls/inc/basecontainercontrol.hxx @@ -33,9 +33,11 @@ struct IMPL_ControlInfo OUString sName; }; -class BaseContainerControl : public css::awt::XControlModel - , public css::awt::XControlContainer - , public BaseControl +using BaseContainerControl_BASE = cppu::ImplInheritanceHelper; + +class BaseContainerControl : public BaseContainerControl_BASE { public: @@ -43,37 +45,6 @@ public: virtual ~BaseContainerControl() override; - // XInterface - - /** - @short give answer, if interface is supported - @descr The interfaces are searched by type. - - @seealso XInterface - - @param "rType" is the type of searched interface. - - @return Any information about found interface - - @onerror A RuntimeException is thrown. - */ - - virtual css::uno::Any SAL_CALL queryInterface( - const css::uno::Type& aType - ) override; - - // XTypeProvider - - /** - @short get information about supported interfaces - @seealso XTypeProvider - @return Sequence of types of all supported interfaces - - @onerror A RuntimeException is thrown. - */ - - virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override; - // XControl virtual void SAL_CALL createPeer( @@ -121,7 +92,7 @@ public: virtual void SAL_CALL setVisible( sal_Bool bVisible ) override; protected: - using WeakComponentImplHelper::disposing; + using WeakComponentImplHelperBase::disposing; virtual css::awt::WindowDescriptor impl_getWindowDescriptor( const css::uno::Reference< css::awt::XWindowPeer >& xParentPeer diff --git a/UnoControls/inc/basecontrol.hxx b/UnoControls/inc/basecontrol.hxx index 9f60537bb7cb..90cdf51f7c7a 100644 --- a/UnoControls/inc/basecontrol.hxx +++ b/UnoControls/inc/basecontrol.hxx @@ -39,82 +39,19 @@ namespace unocontrols { class OMRCListenerMultiplexerHelper; } namespace unocontrols { -class BaseControl : public css::lang::XServiceInfo - , public css::awt::XPaintListener - , public css::awt::XWindowListener - , public css::awt::XView - , public css::awt::XWindow - , public css::awt::XControl - , public cppu::BaseMutex - , public ::cppu::WeakComponentImplHelper<> +class BaseControl : public cppu::BaseMutex, + public cppu::WeakComponentImplHelper { public: BaseControl( const css::uno::Reference< css::uno::XComponentContext >& rxContext ); virtual ~BaseControl() override; - // XInterface - - /** - @short give answer, if interface is supported - @descr The interfaces are searched by type. - - @seealso XInterface - - @param "rType" is the type of searched interface. - - @return Any information about found interface - - @onerror A RuntimeException is thrown. - */ - - virtual css::uno::Any SAL_CALL queryInterface( - const css::uno::Type& aType - ) override; - - /** - @short increment refcount - @seealso XInterface - @seealso release() - @onerror A RuntimeException is thrown. - */ - - virtual void SAL_CALL acquire() noexcept override; - - /** - @short decrement refcount - @seealso XInterface - @seealso acquire() - @onerror A RuntimeException is thrown. - */ - - virtual void SAL_CALL release() noexcept override; - - // XTypeProvider - - /** - @short get information about supported interfaces - @seealso XTypeProvider - @return Sequence of types of all supported interfaces - - @onerror A RuntimeException is thrown. - */ - - virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override; - - /** - @short get implementation id - @descr This ID is necessary for UNO-caching. If there no ID, cache is disabled. - Another way, cache is enabled. - - @seealso XTypeProvider - @return ID as Sequence of byte - - @onerror A RuntimeException is thrown. - */ - - virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override; - // XServiceInfo virtual sal_Bool SAL_CALL supportsService( @@ -265,7 +202,7 @@ public: virtual void SAL_CALL windowHidden( const css::lang::EventObject& aEvent ) override; protected: - using WeakComponentImplHelper::disposing; + using WeakComponentImplHelperBase::disposing; const css::uno::Reference< css::uno::XComponentContext >& impl_getComponentContext() const { return m_xComponentContext;} diff --git a/UnoControls/source/base/basecontainercontrol.cxx b/UnoControls/source/base/basecontainercontrol.cxx index bf638a9c56a4..f78ed4552eac 100644 --- a/UnoControls/source/base/basecontainercontrol.cxx +++ b/UnoControls/source/base/basecontainercontrol.cxx @@ -40,7 +40,7 @@ namespace unocontrols { // construct/destruct BaseContainerControl::BaseContainerControl( const Reference< XComponentContext >& rxContext ) - : BaseControl ( rxContext ) + : BaseContainerControl_BASE(rxContext) , m_aListeners ( m_aMutex ) { } @@ -49,43 +49,6 @@ BaseContainerControl::~BaseContainerControl() { } -// XInterface - -Any SAL_CALL BaseContainerControl::queryInterface( const Type& rType ) -{ - // Ask for my own supported interfaces ... - // Attention: XTypeProvider and XInterface are supported by WeakComponentImplHelper! - Any aReturn ( ::cppu::queryInterface( rType , - static_cast< XControlModel* > ( this ) , - static_cast< XControlContainer* > ( this ) - ) - ); - - // If searched interface supported by this class ... - if ( aReturn.hasValue() ) - { - // ... return this information. - return aReturn; - } - else - { - // Else; ... ask baseclass for interfaces! - return BaseControl::queryInterface( rType ); - } -} - -// XTypeProvider - -Sequence< Type > SAL_CALL BaseContainerControl::getTypes() -{ - static OTypeCollection ourTypeCollection( - cppu::UnoType::get(), - cppu::UnoType::get(), - BaseControl::getTypes() ); - - return ourTypeCollection.getTypes(); -} - // XControl void SAL_CALL BaseContainerControl::createPeer( const Reference< XToolkit >& xToolkit , diff --git a/UnoControls/source/base/basecontrol.cxx b/UnoControls/source/base/basecontrol.cxx index 247142e5c151..59c5888d4c3f 100644 --- a/UnoControls/source/base/basecontrol.cxx +++ b/UnoControls/source/base/basecontrol.cxx @@ -65,80 +65,6 @@ BaseControl::~BaseControl() { } -// XInterface - -Any SAL_CALL BaseControl::queryInterface( const Type& rType ) -{ - // Ask for my own supported interfaces ... - // Attention: XTypeProvider and XInterface are supported by WeakComponentImplHelper! - Any aReturn ( ::cppu::queryInterface( rType , - static_cast< XPaintListener*> ( this ) , - static_cast< XWindowListener*> ( this ) , - static_cast< XView* > ( this ) , - static_cast< XWindow* > ( this ) , - static_cast< XServiceInfo* > ( this ) , - static_cast< XControl* > ( this ) - ) - ); - - // If searched interface supported by this class ... - if ( aReturn.hasValue() ) - { - // ... return this information. - return aReturn; - } - else - { - // Else; ... ask baseclass for interfaces! - return WeakComponentImplHelper::queryInterface( rType ); - } -} - -// XInterface - -void SAL_CALL BaseControl::acquire() noexcept -{ - // Attention: - // Don't use mutex or guard in this method!!! Is a method of XInterface. - - // Forward to baseclass - WeakComponentImplHelper::acquire(); -} - -// XInterface - -void SAL_CALL BaseControl::release() noexcept -{ - // Attention: - // Don't use mutex or guard in this method!!! Is a method of XInterface. - - // Forward to baseclass - WeakComponentImplHelper::release(); -} - -// XTypeProvider - -Sequence< Type > SAL_CALL BaseControl::getTypes() -{ - static OTypeCollection ourTypeCollection( - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - WeakComponentImplHelper::getTypes() ); - - return ourTypeCollection.getTypes(); -} - -// XTypeProvider - -Sequence< sal_Int8 > SAL_CALL BaseControl::getImplementationId() -{ - return css::uno::Sequence(); -} - // XServiceInfo OUString SAL_CALL BaseControl::getImplementationName() diff --git a/UnoControls/source/controls/framecontrol.cxx b/UnoControls/source/controls/framecontrol.cxx index 6b12862d734b..e6eefda2124c 100644 --- a/UnoControls/source/controls/framecontrol.cxx +++ b/UnoControls/source/controls/framecontrol.cxx @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -58,7 +59,7 @@ enum PropertyHandle // values represent index in PropertyArray // construct/destruct FrameControl::FrameControl( const Reference< XComponentContext >& rxContext) - : BaseControl ( rxContext ) + : FrameControl_BASE ( rxContext ) , OBroadcastHelper ( m_aMutex ) , OPropertySetHelper ( *static_cast< OBroadcastHelper * >(this) ) , m_aConnectionPointContainer ( new OConnectionPointContainerHelper(m_aMutex) ) @@ -72,23 +73,10 @@ FrameControl::~FrameControl() // XInterface Any SAL_CALL FrameControl::queryInterface( const Type& rType ) { - // Ask for my own supported interfaces ... - // Attention: XTypeProvider and XInterface are supported by WeakComponentImplHelper! - Any aReturn ( ::cppu::queryInterface( rType , - static_cast< XControlModel* > ( this ) , - static_cast< XConnectionPointContainer* > ( this ) - ) - ); - + Any aReturn = OPropertySetHelper::queryInterface(rType); if (aReturn.hasValue()) return aReturn; - - // If searched interface not supported by this class ... - // ... ask baseclasses. - aReturn = OPropertySetHelper::queryInterface(rType); - if (aReturn.hasValue()) - return aReturn; - return BaseControl::queryInterface(rType); + return FrameControl_BASE::queryInterface(rType); } // XInterface @@ -98,7 +86,7 @@ void SAL_CALL FrameControl::acquire() noexcept // Don't use mutex or guard in this method!!! Is a method of XInterface. // Forward to baseclass - BaseControl::acquire(); + FrameControl_BASE::acquire(); } // XInterface @@ -108,20 +96,16 @@ void SAL_CALL FrameControl::release() noexcept // Don't use mutex or guard in this method!!! Is a method of XInterface. // Forward to baseclass - BaseControl::release(); + FrameControl_BASE::release(); } // XTypeProvider Sequence< Type > SAL_CALL FrameControl::getTypes() { - static OTypeCollection ourTypeCollection( - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - BaseControl::getTypes() ); - - return ourTypeCollection.getTypes(); + static Sequence myTypes = comphelper::concatSequences(FrameControl_BASE::getTypes(), + OPropertySetHelper::getTypes()); + return myTypes; } OUString FrameControl::getImplementationName() diff --git a/UnoControls/source/controls/progressbar.cxx b/UnoControls/source/controls/progressbar.cxx index 85653c1cc1a3..e2425916bbcc 100644 --- a/UnoControls/source/controls/progressbar.cxx +++ b/UnoControls/source/controls/progressbar.cxx @@ -34,7 +34,7 @@ namespace unocontrols { // construct/destruct ProgressBar::ProgressBar( const Reference< XComponentContext >& rxContext ) - : BaseControl ( rxContext ) + : ProgressBar_BASE ( rxContext ) , m_bHorizontal ( PROGRESSBAR_DEFAULT_HORIZONTAL ) , m_aBlockSize ( PROGRESSBAR_DEFAULT_BLOCKDIMENSION ) , m_nForegroundColor ( PROGRESSBAR_DEFAULT_FOREGROUNDCOLOR ) @@ -50,57 +50,6 @@ ProgressBar::~ProgressBar() { } -// XInterface -Any SAL_CALL ProgressBar::queryInterface( const Type& rType ) -{ - // Ask for my own supported interfaces ... - // Attention: XTypeProvider and XInterface are supported by WeakComponentImplHelper! - Any aReturn ( ::cppu::queryInterface( rType , - static_cast< XControlModel* > ( this ) , - static_cast< XProgressBar* > ( this ) - ) - ); - - if (aReturn.hasValue()) - return aReturn; - - // If searched interface not supported by this class ... - // ... ask baseclasses. - return BaseControl::queryInterface(rType); -} - -// XInterface -void SAL_CALL ProgressBar::acquire() noexcept -{ - // Attention: - // Don't use mutex or guard in this method!!! Is a method of XInterface. - - // Forward to baseclass - BaseControl::acquire(); -} - -// XInterface -void SAL_CALL ProgressBar::release() noexcept -{ - // Attention: - // Don't use mutex or guard in this method!!! Is a method of XInterface. - - // Forward to baseclass - BaseControl::release(); -} - -// XTypeProvider - -Sequence< Type > SAL_CALL ProgressBar::getTypes() -{ - static OTypeCollection ourTypeCollection( - cppu::UnoType::get(), - cppu::UnoType::get(), - BaseControl::getTypes() ); - - return ourTypeCollection.getTypes(); -} - // XProgressBar void SAL_CALL ProgressBar::setForegroundColor( sal_Int32 nColor ) diff --git a/UnoControls/source/controls/progressmonitor.cxx b/UnoControls/source/controls/progressmonitor.cxx index d58518e0e8ff..fbe84e34f7e7 100644 --- a/UnoControls/source/controls/progressmonitor.cxx +++ b/UnoControls/source/controls/progressmonitor.cxx @@ -51,7 +51,7 @@ constexpr OUStringLiteral DEFAULT_BUTTONLABEL = u"Abbrechen"; namespace unocontrols { ProgressMonitor::ProgressMonitor( const css::uno::Reference< XComponentContext >& rxContext ) - : BaseContainerControl ( rxContext ) + : ProgressMonitor_BASE(rxContext) { // It's not allowed to work with member in this method (refcounter !!!) // But with a HACK (++refcount) its "OK" :-( @@ -109,58 +109,6 @@ ProgressMonitor::~ProgressMonitor() impl_cleanMemory (); } -// XInterface -Any SAL_CALL ProgressMonitor::queryInterface( const Type& rType ) -{ - // Ask for my own supported interfaces ... - // Attention: XTypeProvider and XInterface are supported by WeakComponentImplHelper! - Any aReturn ( ::cppu::queryInterface( rType , - static_cast< XLayoutConstrains* > ( this ) , - static_cast< XButton* > ( this ) , - static_cast< XProgressMonitor* > ( this ) - ) - ); - - if (aReturn.hasValue()) - return aReturn; - - // If searched interface not supported by this class ... - // ... ask baseclasses. - return BaseControl::queryInterface(rType); -} - -// XInterface -void SAL_CALL ProgressMonitor::acquire() noexcept -{ - // Attention: - // Don't use mutex or guard in this method!!! Is a method of XInterface. - - // Forward to baseclass - BaseControl::acquire(); -} - -// XInterface -void SAL_CALL ProgressMonitor::release() noexcept -{ - // Attention: - // Don't use mutex or guard in this method!!! Is a method of XInterface. - - // Forward to baseclass - BaseControl::release(); -} - -// XTypeProvider -Sequence< Type > SAL_CALL ProgressMonitor::getTypes() -{ - static OTypeCollection ourTypeCollection( - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - BaseContainerControl::getTypes() ); - - return ourTypeCollection.getTypes(); -} - // XProgressMonitor void SAL_CALL ProgressMonitor::addText( const OUString& rTopic, diff --git a/UnoControls/source/controls/statusindicator.cxx b/UnoControls/source/controls/statusindicator.cxx index 9301c2494106..c6135000754d 100644 --- a/UnoControls/source/controls/statusindicator.cxx +++ b/UnoControls/source/controls/statusindicator.cxx @@ -44,7 +44,7 @@ namespace unocontrols { // construct/destruct StatusIndicator::StatusIndicator( const css::uno::Reference< XComponentContext >& rxContext ) - : BaseContainerControl ( rxContext ) + : StatusIndicator_BASE(rxContext) { // It's not allowed to work with member in this method (refcounter !!!) // But with a HACK (++refcount) its "OK" :-( @@ -72,62 +72,6 @@ StatusIndicator::StatusIndicator( const css::uno::Reference< XComponentContext > StatusIndicator::~StatusIndicator() {} -// XInterface - -Any SAL_CALL StatusIndicator::queryInterface( const Type& rType ) -{ - // Ask for my own supported interfaces ... - // Attention: XTypeProvider and XInterface are supported by WeakComponentImplHelper! - Any aReturn ( ::cppu::queryInterface( rType , - static_cast< XLayoutConstrains* > ( this ) , - static_cast< XStatusIndicator* > ( this ) - ) - ); - - // If searched interface not supported by this class ... - if ( !aReturn.hasValue() ) - { - // ... ask baseclasses. - aReturn = BaseControl::queryInterface( rType ); - } - - return aReturn; -} - -// XInterface - -void SAL_CALL StatusIndicator::acquire() noexcept -{ - // Attention: - // Don't use mutex or guard in this method!!! Is a method of XInterface. - - // Forward to baseclass - BaseControl::acquire(); -} - -// XInterface - -void SAL_CALL StatusIndicator::release() noexcept -{ - // Attention: - // Don't use mutex or guard in this method!!! Is a method of XInterface. - - // Forward to baseclass - BaseControl::release(); -} - -// XTypeProvider - -Sequence< Type > SAL_CALL StatusIndicator::getTypes() -{ - static OTypeCollection ourTypeCollection( - cppu::UnoType::get(), - cppu::UnoType::get(), - BaseContainerControl::getTypes() ); - - return ourTypeCollection.getTypes(); -} - // XStatusIndicator void SAL_CALL StatusIndicator::start( const OUString& sText, sal_Int32 nRange ) diff --git a/UnoControls/source/inc/framecontrol.hxx b/UnoControls/source/inc/framecontrol.hxx index 514e7cd79994..f8b5cd423582 100644 --- a/UnoControls/source/inc/framecontrol.hxx +++ b/UnoControls/source/inc/framecontrol.hxx @@ -31,9 +31,10 @@ namespace unocontrols { class OConnectionPointContainerHelper; } namespace unocontrols { -class FrameControl final : public css::awt::XControlModel - , public css::lang::XConnectionPointContainer - , public BaseControl // This order is necessary for right initialization of m_aMutex! +using FrameControl_BASE = cppu::ImplInheritanceHelper; + +class FrameControl final : public FrameControl_BASE // This order is necessary for right initialization of m_aMutex! , public ::cppu::OBroadcastHelper , public ::cppu::OPropertySetHelper { diff --git a/UnoControls/source/inc/progressbar.hxx b/UnoControls/source/inc/progressbar.hxx index 3c9f5c8bebf1..78104ca3b924 100644 --- a/UnoControls/source/inc/progressbar.hxx +++ b/UnoControls/source/inc/progressbar.hxx @@ -41,9 +41,11 @@ constexpr auto PROGRESSBAR_DEFAULT_BLOCKVALUE = 1; constexpr sal_Int32 PROGRESSBAR_LINECOLOR_BRIGHT = sal_Int32(COL_WHITE); constexpr sal_Int32 PROGRESSBAR_LINECOLOR_SHADOW = sal_Int32(COL_BLACK); -class ProgressBar final : public css::awt::XControlModel - , public css::awt::XProgressBar - , public BaseControl +using ProgressBar_BASE = cppu::ImplInheritanceHelper; + +class ProgressBar final : public ProgressBar_BASE { public: @@ -51,32 +53,6 @@ public: virtual ~ProgressBar() override; - // XInterface - - virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override; - - /** - @short increment refcount - @seealso XInterface - @seealso release() - @onerror A RuntimeException is thrown. - */ - - virtual void SAL_CALL acquire() noexcept override; - - /** - @short decrement refcount - @seealso XInterface - @seealso acquire() - @onerror A RuntimeException is thrown. - */ - - virtual void SAL_CALL release() noexcept override; - - // XTypeProvider - - virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override; - // XProgressBar virtual void SAL_CALL setForegroundColor( sal_Int32 nColor ) override; diff --git a/UnoControls/source/inc/progressmonitor.hxx b/UnoControls/source/inc/progressmonitor.hxx index 46a4dc735484..cd7786a2d69b 100644 --- a/UnoControls/source/inc/progressmonitor.hxx +++ b/UnoControls/source/inc/progressmonitor.hxx @@ -50,63 +50,17 @@ struct IMPL_TextlistItem OUString sText; /// Right site of textline in dialog }; -class ProgressMonitor final : public css::awt::XLayoutConstrains - , public css::awt::XButton - , public css::awt::XProgressMonitor - , public BaseContainerControl +using ProgressMonitor_BASE = cppu::ImplInheritanceHelper; +class ProgressMonitor final : public ProgressMonitor_BASE { public: ProgressMonitor( const css::uno::Reference< css::uno::XComponentContext >& rxContext ); virtual ~ProgressMonitor() override; - // XInterface - - /** - @short give answer, if interface is supported - @descr The interfaces are searched by type. - - @seealso XInterface - - @param "rType" is the type of searched interface. - - @return Any information about found interface - - @onerror A RuntimeException is thrown. - */ - - virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override; - - /** - @short increment refcount - @seealso XInterface - @seealso release() - @onerror A RuntimeException is thrown. - */ - - virtual void SAL_CALL acquire() noexcept override; - - /** - @short decrement refcount - @seealso XInterface - @seealso acquire() - @onerror A RuntimeException is thrown. - */ - - virtual void SAL_CALL release() noexcept override; - - // XTypeProvider - - /** - @short get information about supported interfaces - @seealso XTypeProvider - @return Sequence of types of all supported interfaces - - @onerror A RuntimeException is thrown. - */ - - virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override; - // XProgressMonitor /** diff --git a/UnoControls/source/inc/statusindicator.hxx b/UnoControls/source/inc/statusindicator.hxx index 5f18f135d2ef..8d3f024d03cf 100644 --- a/UnoControls/source/inc/statusindicator.hxx +++ b/UnoControls/source/inc/statusindicator.hxx @@ -42,62 +42,16 @@ constexpr sal_Int32 STATUSINDICATOR_BACKGROUNDCOLOR = sal_Int32(COL_LIGHTGRAY); constexpr sal_Int32 STATUSINDICATOR_LINECOLOR_BRIGHT = sal_Int32(COL_WHITE); constexpr sal_Int32 STATUSINDICATOR_LINECOLOR_SHADOW = sal_Int32(COL_BLACK); -class StatusIndicator final : public css::awt::XLayoutConstrains - , public css::task::XStatusIndicator - , public BaseContainerControl +using StatusIndicator_BASE = cppu::ImplInheritanceHelper; +class StatusIndicator final : public StatusIndicator_BASE { public: StatusIndicator( const css::uno::Reference< css::uno::XComponentContext >& rxContext ); virtual ~StatusIndicator() override; - // XInterface - - /** - @short give answer, if interface is supported - @descr The interfaces are searched by type. - - @seealso XInterface - - @param "rType" is the type of searched interface. - - @return Any information about found interface - - @onerror A RuntimeException is thrown. - */ - - virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override; - - /** - @short increment refcount - @seealso XInterface - @seealso release() - @onerror A RuntimeException is thrown. - */ - - virtual void SAL_CALL acquire() noexcept override; - - /** - @short decrement refcount - @seealso XInterface - @seealso acquire() - @onerror A RuntimeException is thrown. - */ - - virtual void SAL_CALL release() noexcept override; - - // XTypeProvider - - /** - @short get information about supported interfaces - @seealso XTypeProvider - @return Sequence of types of all supported interfaces - - @onerror A RuntimeException is thrown. - */ - - virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override; - // XStatusIndicator virtual void SAL_CALL start( diff --git a/accessibility/inc/extended/AccessibleBrowseBoxBase.hxx b/accessibility/inc/extended/AccessibleBrowseBoxBase.hxx index d4ea1aabc07f..362ff829a6ac 100644 --- a/accessibility/inc/extended/AccessibleBrowseBoxBase.hxx +++ b/accessibility/inc/extended/AccessibleBrowseBoxBase.hxx @@ -309,12 +309,10 @@ private: // a version of AccessibleBrowseBoxBase which implements not only the XAccessibleContext, // but also the XAccessible -typedef ::cppu::ImplHelper1 < css::accessibility::XAccessible - > BrowseBoxAccessibleElement_Base; +typedef cppu::ImplInheritanceHelper + BrowseBoxAccessibleElement_Base; -class BrowseBoxAccessibleElement - :public AccessibleBrowseBoxBase - ,public BrowseBoxAccessibleElement_Base +class BrowseBoxAccessibleElement : public BrowseBoxAccessibleElement_Base { protected: /** Constructor sets specified name and description. If the constant of a @@ -355,10 +353,6 @@ public: // noncopyable BrowseBoxAccessibleElement(const BrowseBoxAccessibleElement&) = delete; const BrowseBoxAccessibleElement& operator=(const BrowseBoxAccessibleElement&) = delete; - // XInterface - DECLARE_XINTERFACE( ) - // XTypeProvider - DECLARE_XTYPEPROVIDER( ) protected: virtual ~BrowseBoxAccessibleElement() override; diff --git a/accessibility/inc/extended/AccessibleBrowseBoxTableBase.hxx b/accessibility/inc/extended/AccessibleBrowseBoxTableBase.hxx index 422aa177ad48..da7643dd6d7c 100644 --- a/accessibility/inc/extended/AccessibleBrowseBoxTableBase.hxx +++ b/accessibility/inc/extended/AccessibleBrowseBoxTableBase.hxx @@ -27,16 +27,14 @@ namespace accessibility { -typedef ::cppu::ImplHelper1< css::accessibility::XAccessibleTable > +typedef cppu::ImplInheritanceHelper AccessibleBrowseBoxTableImplHelper; /** The BrowseBox accessible table objects inherit from this base class. It implements basic functionality for the XAccessibleTable interface. BrowseBox table objects are: the data table, the column header bar and the row header bar. */ -class AccessibleBrowseBoxTableBase : - public BrowseBoxAccessibleElement, - public AccessibleBrowseBoxTableImplHelper +class AccessibleBrowseBoxTableBase : public AccessibleBrowseBoxTableImplHelper { public: /** Constructor sets specified name and description. If the constant of a @@ -121,25 +119,6 @@ public: - getAccessibleCellAt, - isAccessibleSelected. */ - // XInterface - - /** Queries for a new interface. */ - css::uno::Any SAL_CALL queryInterface( const css::uno::Type& rType ) override; - - /** Acquires the object (calls acquire() on base class). */ - virtual void SAL_CALL acquire() noexcept override; - - /** Releases the object (calls release() on base class). */ - virtual void SAL_CALL release() noexcept override; - - // XTypeProvider - - /** @return a sequence of possible types (received from base classes). */ - virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override; - - /** @return a unique implementation ID. */ - virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override; - // XServiceInfo /* Derived classes have to implement: diff --git a/accessibility/inc/extended/AccessibleGridControlBase.hxx b/accessibility/inc/extended/AccessibleGridControlBase.hxx index 186edc83797c..4e30bddda541 100644 --- a/accessibility/inc/extended/AccessibleGridControlBase.hxx +++ b/accessibility/inc/extended/AccessibleGridControlBase.hxx @@ -252,12 +252,10 @@ private: // a version of AccessibleGridControlBase which implements not only the XAccessibleContext, // but also the XAccessible -typedef ::cppu::ImplHelper1 < css::accessibility::XAccessible - > GridControlAccessibleElement_Base; +typedef cppu::ImplInheritanceHelper + GridControlAccessibleElement_Base; -class GridControlAccessibleElement - :public AccessibleGridControlBase - ,public GridControlAccessibleElement_Base +class GridControlAccessibleElement : public GridControlAccessibleElement_Base { protected: /** Constructor sets specified name and description. @@ -271,12 +269,6 @@ protected: ::vcl::table::IAccessibleTable& rTable, ::vcl::table::AccessibleTableControlObjType eObjType ); -public: - // XInterface - DECLARE_XINTERFACE( ) - // XTypeProvider - DECLARE_XTYPEPROVIDER( ) - protected: virtual ~GridControlAccessibleElement() override; diff --git a/accessibility/inc/extended/AccessibleGridControlTableBase.hxx b/accessibility/inc/extended/AccessibleGridControlTableBase.hxx index 39de903ec855..a7032553c82d 100644 --- a/accessibility/inc/extended/AccessibleGridControlTableBase.hxx +++ b/accessibility/inc/extended/AccessibleGridControlTableBase.hxx @@ -27,7 +27,7 @@ namespace accessibility { -typedef ::cppu::ImplHelper1 < css::accessibility::XAccessibleTable > +typedef cppu::ImplInheritanceHelper AccessibleGridControlTableImplHelper; /** The Grid Control accessible table objects inherit from this base class. It @@ -35,7 +35,6 @@ typedef ::cppu::ImplHelper1 < css::accessibility::XAccessibleTable > Grid COntrol table objects are: the data table, the column header bar and the row header bar. */ class AccessibleGridControlTableBase : - public GridControlAccessibleElement, public AccessibleGridControlTableImplHelper { public: @@ -115,25 +114,6 @@ public: - getAccessibleCellAt, - isAccessibleSelected. */ - // XInterface - - /** Queries for a new interface. */ - css::uno::Any SAL_CALL queryInterface( const css::uno::Type& rType ) override; - - /** Acquires the object (calls acquire() on base class). */ - virtual void SAL_CALL acquire() noexcept override; - - /** Releases the object (calls release() on base class). */ - virtual void SAL_CALL release() noexcept override; - - // XTypeProvider - - /** @return a sequence of possible types (received from base classes). */ - virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override; - - /** @return a unique implementation ID. */ - virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override; - protected: // internal helper methods diff --git a/accessibility/source/extended/AccessibleBrowseBoxBase.cxx b/accessibility/source/extended/AccessibleBrowseBoxBase.cxx index 6108fa0a1801..466963ca3bda 100644 --- a/accessibility/source/extended/AccessibleBrowseBoxBase.cxx +++ b/accessibility/source/extended/AccessibleBrowseBoxBase.cxx @@ -515,12 +515,6 @@ sal_Int32 SAL_CALL AccessibleBrowseBoxBase::getBackground( ) } -// XInterface -IMPLEMENT_FORWARD_XINTERFACE2( BrowseBoxAccessibleElement, AccessibleBrowseBoxBase, BrowseBoxAccessibleElement_Base ) - -// XTypeProvider -IMPLEMENT_FORWARD_XTYPEPROVIDER2( BrowseBoxAccessibleElement, AccessibleBrowseBoxBase, BrowseBoxAccessibleElement_Base ) - // css::accessibility::XAccessible Reference< css::accessibility::XAccessibleContext > SAL_CALL BrowseBoxAccessibleElement::getAccessibleContext() @@ -533,7 +527,7 @@ Reference< css::accessibility::XAccessibleContext > SAL_CALL BrowseBoxAccessible BrowseBoxAccessibleElement::BrowseBoxAccessibleElement( const css::uno::Reference< css::accessibility::XAccessible >& rxParent, ::vcl::IAccessibleTableProvider& rBrowseBox, const css::uno::Reference< css::awt::XWindow >& _xFocusWindow, AccessibleBrowseBoxObjType eObjType ) - :AccessibleBrowseBoxBase( rxParent, rBrowseBox, _xFocusWindow, eObjType ) + : BrowseBoxAccessibleElement_Base(rxParent, rBrowseBox, _xFocusWindow, eObjType) { } @@ -541,7 +535,7 @@ BrowseBoxAccessibleElement::BrowseBoxAccessibleElement( const css::uno::Referenc BrowseBoxAccessibleElement::BrowseBoxAccessibleElement( const css::uno::Reference< css::accessibility::XAccessible >& rxParent, ::vcl::IAccessibleTableProvider& rBrowseBox, const css::uno::Reference< css::awt::XWindow >& _xFocusWindow, AccessibleBrowseBoxObjType eObjType, const OUString& rName, const OUString& rDescription ) - :AccessibleBrowseBoxBase( rxParent, rBrowseBox, _xFocusWindow, eObjType, rName, rDescription ) + : BrowseBoxAccessibleElement_Base(rxParent, rBrowseBox, _xFocusWindow, eObjType, rName, rDescription) { } diff --git a/accessibility/source/extended/AccessibleBrowseBoxTableBase.cxx b/accessibility/source/extended/AccessibleBrowseBoxTableBase.cxx index 044a85958e98..bb213c348f3d 100644 --- a/accessibility/source/extended/AccessibleBrowseBoxTableBase.cxx +++ b/accessibility/source/extended/AccessibleBrowseBoxTableBase.cxx @@ -41,7 +41,7 @@ AccessibleBrowseBoxTableBase::AccessibleBrowseBoxTableBase( const Reference< XAccessible >& rxParent, vcl::IAccessibleTableProvider& rBrowseBox, AccessibleBrowseBoxObjType eObjType ) : - BrowseBoxAccessibleElement( rxParent, rBrowseBox,nullptr, eObjType ) + AccessibleBrowseBoxTableImplHelper( rxParent, rBrowseBox, nullptr, eObjType ) { } @@ -132,39 +132,6 @@ sal_Int32 SAL_CALL AccessibleBrowseBoxTableBase::getAccessibleColumn( sal_Int64 return implGetColumn( nChildIndex ); } -// XInterface ----------------------------------------------------------------- - -Any SAL_CALL AccessibleBrowseBoxTableBase::queryInterface( const uno::Type& rType ) -{ - Any aAny( BrowseBoxAccessibleElement::queryInterface( rType ) ); - return aAny.hasValue() ? - aAny : AccessibleBrowseBoxTableImplHelper::queryInterface( rType ); -} - -void SAL_CALL AccessibleBrowseBoxTableBase::acquire() noexcept -{ - BrowseBoxAccessibleElement::acquire(); -} - -void SAL_CALL AccessibleBrowseBoxTableBase::release() noexcept -{ - BrowseBoxAccessibleElement::release(); -} - -// XTypeProvider -------------------------------------------------------------- - -Sequence< uno::Type > SAL_CALL AccessibleBrowseBoxTableBase::getTypes() -{ - return ::comphelper::concatSequences( - BrowseBoxAccessibleElement::getTypes(), - AccessibleBrowseBoxTableImplHelper::getTypes() ); -} - -Sequence< sal_Int8 > SAL_CALL AccessibleBrowseBoxTableBase::getImplementationId() -{ - return css::uno::Sequence(); -} - // internal virtual methods --------------------------------------------------- sal_Int32 AccessibleBrowseBoxTableBase::implGetRowCount() const diff --git a/accessibility/source/extended/AccessibleGridControlBase.cxx b/accessibility/source/extended/AccessibleGridControlBase.cxx index aff3dc66a247..3f8609d020f1 100644 --- a/accessibility/source/extended/AccessibleGridControlBase.cxx +++ b/accessibility/source/extended/AccessibleGridControlBase.cxx @@ -430,16 +430,10 @@ sal_Int32 SAL_CALL AccessibleGridControlBase::getBackground( ) GridControlAccessibleElement::GridControlAccessibleElement( const css::uno::Reference< css::accessibility::XAccessible >& rxParent, ::vcl::table::IAccessibleTable& rTable, ::vcl::table::AccessibleTableControlObjType eObjType ) - :AccessibleGridControlBase( rxParent, rTable, eObjType ) + : GridControlAccessibleElement_Base(rxParent, rTable, eObjType) { } -// XInterface -IMPLEMENT_FORWARD_XINTERFACE2( GridControlAccessibleElement, AccessibleGridControlBase, GridControlAccessibleElement_Base) - -// XTypeProvider -IMPLEMENT_FORWARD_XTYPEPROVIDER2( GridControlAccessibleElement, AccessibleGridControlBase, GridControlAccessibleElement_Base ) - // css::accessibility::XAccessible css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL GridControlAccessibleElement::getAccessibleContext() diff --git a/accessibility/source/extended/AccessibleGridControlTableBase.cxx b/accessibility/source/extended/AccessibleGridControlTableBase.cxx index 08fae3d0c3f3..cec5382fcf28 100644 --- a/accessibility/source/extended/AccessibleGridControlTableBase.cxx +++ b/accessibility/source/extended/AccessibleGridControlTableBase.cxx @@ -41,7 +41,7 @@ AccessibleGridControlTableBase::AccessibleGridControlTableBase( const Reference< XAccessible >& rxParent, IAccessibleTable& rTable, AccessibleTableControlObjType eObjType ) : - GridControlAccessibleElement( rxParent, rTable, eObjType ) + AccessibleGridControlTableImplHelper( rxParent, rTable, eObjType ) { } @@ -158,39 +158,6 @@ sal_Int32 SAL_CALL AccessibleGridControlTableBase::getAccessibleColumn( sal_Int6 return implGetColumn( nChildIndex ); } -// XInterface ----------------------------------------------------------------- - -Any SAL_CALL AccessibleGridControlTableBase::queryInterface( const uno::Type& rType ) -{ - Any aAny( GridControlAccessibleElement::queryInterface( rType ) ); - return aAny.hasValue() ? - aAny : AccessibleGridControlTableImplHelper::queryInterface( rType ); -} - -void SAL_CALL AccessibleGridControlTableBase::acquire() noexcept -{ - GridControlAccessibleElement::acquire(); -} - -void SAL_CALL AccessibleGridControlTableBase::release() noexcept -{ - GridControlAccessibleElement::release(); -} - -// XTypeProvider -------------------------------------------------------------- - -Sequence< uno::Type > SAL_CALL AccessibleGridControlTableBase::getTypes() -{ - return ::comphelper::concatSequences( - GridControlAccessibleElement::getTypes(), - AccessibleGridControlTableImplHelper::getTypes() ); -} - -Sequence< sal_Int8 > SAL_CALL AccessibleGridControlTableBase::getImplementationId() -{ - return css::uno::Sequence(); -} - // internal helper methods ---------------------------------------------------- sal_Int32 AccessibleGridControlTableBase::implGetRow( sal_Int64 nChildIndex ) diff --git a/accessibility/source/standard/vclxaccessiblecombobox.cxx b/accessibility/source/standard/vclxaccessiblecombobox.cxx index 5e0c77304ad8..1673048cf771 100644 --- a/accessibility/source/standard/vclxaccessiblecombobox.cxx +++ b/accessibility/source/standard/vclxaccessiblecombobox.cxx @@ -41,7 +41,7 @@ OUString VCLXAccessibleComboBox::getImplementationName() Sequence< OUString > VCLXAccessibleComboBox::getSupportedServiceNames() { return comphelper::concatSequences(VCLXAccessibleBox::getSupportedServiceNames(), - Sequence{u"com.sun.star.accessibility.AccessibleComboBox"_ustr}); + std::initializer_list{u"com.sun.star.accessibility.AccessibleComboBox"_ustr}); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/source/standard/vclxaccessibledropdowncombobox.cxx b/accessibility/source/standard/vclxaccessibledropdowncombobox.cxx index 5dc7073e7f0b..91b51606d9e0 100644 --- a/accessibility/source/standard/vclxaccessibledropdowncombobox.cxx +++ b/accessibility/source/standard/vclxaccessibledropdowncombobox.cxx @@ -60,7 +60,7 @@ OUString VCLXAccessibleDropDownComboBox::getImplementationName() Sequence< OUString > VCLXAccessibleDropDownComboBox::getSupportedServiceNames() { return comphelper::concatSequences(VCLXAccessibleBox::getSupportedServiceNames(), - Sequence{u"com.sun.star.accessibility.AccessibleDropDownComboBox"_ustr}); + std::initializer_list{u"com.sun.star.accessibility.AccessibleDropDownComboBox"_ustr}); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/source/standard/vclxaccessibledropdownlistbox.cxx b/accessibility/source/standard/vclxaccessibledropdownlistbox.cxx index 360eab0dc26c..0445e39b2d29 100644 --- a/accessibility/source/standard/vclxaccessibledropdownlistbox.cxx +++ b/accessibility/source/standard/vclxaccessibledropdownlistbox.cxx @@ -39,7 +39,7 @@ OUString VCLXAccessibleDropDownListBox::getImplementationName() Sequence< OUString > VCLXAccessibleDropDownListBox::getSupportedServiceNames() { return comphelper::concatSequences(VCLXAccessibleBox::getSupportedServiceNames(), - Sequence{u"com.sun.star.accessibility.AccessibleDropDownListBox"_ustr}); + std::initializer_list{u"com.sun.star.accessibility.AccessibleDropDownListBox"_ustr}); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/source/standard/vclxaccessiblelist.cxx b/accessibility/source/standard/vclxaccessiblelist.cxx index d84a631687fc..79cb5241d567 100644 --- a/accessibility/source/standard/vclxaccessiblelist.cxx +++ b/accessibility/source/standard/vclxaccessiblelist.cxx @@ -602,7 +602,7 @@ OUString VCLXAccessibleList::getImplementationName() Sequence< OUString > VCLXAccessibleList::getSupportedServiceNames() { return comphelper::concatSequences(VCLXAccessibleComponent::getSupportedServiceNames(), - Sequence{u"com.sun.star.accessibility.AccessibleList"_ustr}); + std::initializer_list{u"com.sun.star.accessibility.AccessibleList"_ustr}); } void VCLXAccessibleList::UpdateVisibleLineCount() diff --git a/accessibility/source/standard/vclxaccessiblelistbox.cxx b/accessibility/source/standard/vclxaccessiblelistbox.cxx index 2f9392ab0341..de282aba1a64 100644 --- a/accessibility/source/standard/vclxaccessiblelistbox.cxx +++ b/accessibility/source/standard/vclxaccessiblelistbox.cxx @@ -40,7 +40,7 @@ OUString VCLXAccessibleListBox::getImplementationName() Sequence< OUString > VCLXAccessibleListBox::getSupportedServiceNames() { return comphelper::concatSequences(VCLXAccessibleBox::getSupportedServiceNames(), - Sequence{u"com.sun.star.accessibility.AccessibleListBox"_ustr}); + std::initializer_list{u"com.sun.star.accessibility.AccessibleListBox"_ustr}); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/source/standard/vclxaccessibletextfield.cxx b/accessibility/source/standard/vclxaccessibletextfield.cxx index 4f43656419b0..238a7f1a670f 100644 --- a/accessibility/source/standard/vclxaccessibletextfield.cxx +++ b/accessibility/source/standard/vclxaccessibletextfield.cxx @@ -96,7 +96,7 @@ OUString VCLXAccessibleTextField::getImplementationName() Sequence< OUString > VCLXAccessibleTextField::getSupportedServiceNames() { return comphelper::concatSequences(VCLXAccessibleTextComponent::getSupportedServiceNames(), - Sequence{u"com.sun.star.accessibility.AccessibleTextField"_ustr}); + std::initializer_list{u"com.sun.star.accessibility.AccessibleTextField"_ustr}); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/source/standard/vclxaccessibletoolbox.cxx b/accessibility/source/standard/vclxaccessibletoolbox.cxx index d2a1e8d23e27..c8601d707ad3 100644 --- a/accessibility/source/standard/vclxaccessibletoolbox.cxx +++ b/accessibility/source/standard/vclxaccessibletoolbox.cxx @@ -589,7 +589,7 @@ OUString VCLXAccessibleToolBox::getImplementationName() Sequence< OUString > VCLXAccessibleToolBox::getSupportedServiceNames() { return comphelper::concatSequences(VCLXAccessibleComponent::getSupportedServiceNames(), - Sequence{u"com.sun.star.accessibility.AccessibleToolBox"_ustr}); + std::initializer_list{u"com.sun.star.accessibility.AccessibleToolBox"_ustr}); } // XAccessibleContext diff --git a/avmedia/source/framework/soundhandler.cxx b/avmedia/source/framework/soundhandler.cxx index d3cc8b724d39..5af9aca90594 100644 --- a/avmedia/source/framework/soundhandler.cxx +++ b/avmedia/source/framework/soundhandler.cxx @@ -33,61 +33,7 @@ namespace avmedia{ -// XInterface, XTypeProvider, XServiceInfo - - -void SAL_CALL SoundHandler::acquire() noexcept -{ - /* Don't use mutex in methods of XInterface! */ - OWeakObject::acquire(); -} - -void SAL_CALL SoundHandler::release() noexcept -{ - /* Don't use mutex in methods of XInterface! */ - OWeakObject::release(); -} - -css::uno::Any SAL_CALL SoundHandler::queryInterface( const css::uno::Type& aType ) -{ - /* Attention: Don't use mutex or guard in this method!!! Is a method of XInterface. */ - /* Ask for my own supported interfaces ...*/ - css::uno::Any aReturn( ::cppu::queryInterface( aType, - static_cast< css::lang::XTypeProvider* >(this), - static_cast< css::lang::XServiceInfo* >(this), - static_cast< css::frame::XNotifyingDispatch* >(this), - static_cast< css::frame::XDispatch* >(this), - static_cast< css::document::XExtendedFilterDetection* >(this))); - /* If searched interface not supported by this class ... */ - if ( !aReturn.hasValue() ) - { - /* ... ask baseclass for interfaces! */ - aReturn = OWeakObject::queryInterface( aType ); - } - /* Return result of this search. */ - return aReturn; -} - -css::uno::Sequence< sal_Int8 > SAL_CALL SoundHandler::getImplementationId() -{ - return css::uno::Sequence(); -} - -css::uno::Sequence< css::uno::Type > SAL_CALL SoundHandler::getTypes() -{ - static ::cppu::OTypeCollection aTypeCollection( - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get()); - - return aTypeCollection.getTypes(); -} - -/*===========================================================================================================*/ -/* XServiceInfo */ -/*===========================================================================================================*/ +// XServiceInfo OUString SAL_CALL SoundHandler::getImplementationName() { return u"com.sun.star.comp.framework.SoundHandler"_ustr; @@ -162,7 +108,7 @@ void SAL_CALL SoundHandler::dispatchWithNotification(const css::util::URL& const css::uno::Reference< css::frame::XDispatchResultListener >& xListener ) { // SAFE { - const ::osl::MutexGuard aLock( m_aMutex ); + const std::unique_lock aLock(m_aMutex); utl::MediaDescriptor aDescriptor(lDescriptor); @@ -274,7 +220,7 @@ OUString SAL_CALL SoundHandler::detect( css::uno::Sequence< css::beans::Property IMPL_LINK_NOARG(SoundHandler, implts_PlayerNotify, Timer *, void) { // SAFE { - ::osl::ClearableMutexGuard aLock( m_aMutex ); + std::unique_lock aLock(m_aMutex); if (m_xPlayer.is() && m_xPlayer->isPlaying() && m_xPlayer->getMediaTime() < m_xPlayer->getDuration()) { @@ -304,7 +250,7 @@ IMPL_LINK_NOARG(SoundHandler, implts_PlayerNotify, Timer *, void) // } SAFE //release aLock before end of method at which point xOperationHold goes out of scope and pThis dies - aLock.clear(); + aLock.unlock(); } } // namespace framework diff --git a/avmedia/source/framework/soundhandler.hxx b/avmedia/source/framework/soundhandler.hxx index 648cbe59dd4b..a143fcb87eaa 100644 --- a/avmedia/source/framework/soundhandler.hxx +++ b/avmedia/source/framework/soundhandler.hxx @@ -29,6 +29,7 @@ #include +#include #include #include @@ -49,15 +50,9 @@ namespace avmedia{ @devstatus ready @threadsafe yes *//*-*************************************************************************************************************/ -class SoundHandler : // interfaces - public css::lang::XTypeProvider - , public css::lang::XServiceInfo - , public css::frame::XNotifyingDispatch // => XDispatch - , public css::document::XExtendedFilterDetection - // baseclasses - // Order is necessary for right initialization! - , private cppu::BaseMutex - , public ::cppu::OWeakObject +class SoundHandler : public comphelper::WeakImplHelper XDispatch + css::document::XExtendedFilterDetection> { // public methods public: @@ -66,14 +61,7 @@ class SoundHandler : // interfaces SoundHandler(); virtual ~SoundHandler( ) override; - // XInterface, XTypeProvider, XServiceInfo - virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override; - virtual void SAL_CALL acquire() noexcept override; - virtual void SAL_CALL release() noexcept override; - virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes () override; - virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override; - - /* interface XServiceInfo */ + // XServiceInfo virtual OUString SAL_CALL getImplementationName ( ) override; virtual sal_Bool SAL_CALL supportsService ( const OUString& sServiceName ) override; virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames ( ) override; diff --git a/basctl/source/basicide/ColorSchemeDialog.cxx b/basctl/source/basicide/ColorSchemeDialog.cxx index ca3eeca9cbef..c61f2071ae1e 100644 --- a/basctl/source/basicide/ColorSchemeDialog.cxx +++ b/basctl/source/basicide/ColorSchemeDialog.cxx @@ -58,7 +58,7 @@ void ColorSchemeDialog::Init() m_xOk->connect_clicked(LINK(this, ColorSchemeDialog, BtnOkHdl)); m_xUseAppCollors->connect_toggled(LINK(this, ColorSchemeDialog, OptionHdl)); m_xUseScheme->connect_toggled(LINK(this, ColorSchemeDialog, OptionHdl)); - m_xSchemeList->connect_changed(LINK(this, ColorSchemeDialog, SelectHdl)); + m_xSchemeList->connect_selection_changed(LINK(this, ColorSchemeDialog, SelectHdl)); // Populate the list with available color schemes for (auto const& rName : m_pColorConfig->GetColorSchemeNames()) diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx index b7b75b958183..93e36ab34061 100644 --- a/basctl/source/basicide/baside2b.cxx +++ b/basctl/source/basicide/baside2b.cxx @@ -1740,7 +1740,7 @@ WatchWindow::WatchWindow(Layout* pParent) m_xTreeListBox->set_help_id(HID_BASICIDE_WATCHWINDOW_LIST); m_xTreeListBox->connect_editing(LINK(this, WatchWindow, EditingEntryHdl), LINK(this, WatchWindow, EditedEntryHdl)); - m_xTreeListBox->connect_changed( LINK( this, WatchWindow, TreeListHdl ) ); + m_xTreeListBox->connect_selection_changed(LINK(this, WatchWindow, TreeListHdl)); m_xTreeListBox->connect_expanding(LINK(this, WatchWindow, RequestingChildrenHdl)); // VarTabWidth, ValueTabWidth, TypeTabWidth @@ -2864,7 +2864,7 @@ CodeCompleteWindow::CodeCompleteWindow(EditorWindow* pPar) , m_xListBox(m_xBuilder->weld_tree_view(u"treeview"_ustr)) { m_xListBox->connect_row_activated(LINK(this, CodeCompleteWindow, ImplDoubleClickHdl)); - m_xListBox->connect_changed(LINK(this, CodeCompleteWindow, ImplSelectHdl)); + m_xListBox->connect_selection_changed(LINK(this, CodeCompleteWindow, ImplSelectHdl)); m_xListBox->connect_key_press(LINK(this, CodeCompleteWindow, KeyInputHdl)); m_xListBox->make_sorted(); m_xListBox->set_direction(false); diff --git a/basctl/source/basicide/breakpoint.cxx b/basctl/source/basicide/breakpoint.cxx index 0d0347ace228..7506d16609db 100644 --- a/basctl/source/basicide/breakpoint.cxx +++ b/basctl/source/basicide/breakpoint.cxx @@ -31,8 +31,7 @@ BreakPointList::BreakPointList() BreakPointList::BreakPointList(BreakPointList const & rList) { - for (size_t i = 0; i < rList.size(); ++i) - maBreakPoints.push_back( rList.at( i ) ); + maBreakPoints.insert(maBreakPoints.end(), rList.maBreakPoints.begin(), rList.maBreakPoints.end()); } BreakPointList::~BreakPointList() diff --git a/basctl/source/basicide/macrodlg.cxx b/basctl/source/basicide/macrodlg.cxx index 18ab8e2290f9..89becb241d45 100644 --- a/basctl/source/basicide/macrodlg.cxx +++ b/basctl/source/basicide/macrodlg.cxx @@ -100,7 +100,7 @@ MacroChooser::MacroChooser(weld::Window* pParnt, const Reference< frame::XFrame m_xBasicBox->connect_changed( LINK( this, MacroChooser, BasicSelectHdl ) ); m_xMacroBox->connect_row_activated( LINK( this, MacroChooser, MacroDoubleClickHdl ) ); - m_xMacroBox->connect_changed( LINK( this, MacroChooser, MacroSelectHdl ) ); + m_xMacroBox->connect_selection_changed(LINK(this, MacroChooser, MacroSelectHdl)); m_xMacroBox->connect_popup_menu( LINK( this, MacroChooser, ContextMenuHdl ) ); m_xBasicBox->SetMode( BrowseMode::Modules ); diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx index 49cf87a2d0d8..b61a39f7e185 100644 --- a/basctl/source/basicide/moduldl2.cxx +++ b/basctl/source/basicide/moduldl2.cxx @@ -246,7 +246,7 @@ LibPage::LibPage(weld::Container* pParent, OrganizeDialog* pDialog) m_xExportButton->connect_clicked( LINK( this, LibPage, ButtonHdl ) ); m_xInsertLibButton->connect_clicked( LINK( this, LibPage, ButtonHdl ) ); m_xDelButton->connect_clicked( LINK( this, LibPage, ButtonHdl ) ); - m_xLibBox->connect_changed( LINK( this, LibPage, TreeListHighlightHdl ) ); + m_xLibBox->connect_selection_changed(LINK(this, LibPage, TreeListHighlightHdl)); m_xBasicsBox->connect_changed( LINK( this, LibPage, BasicSelectHdl ) ); @@ -817,7 +817,8 @@ void ImportLib(const ScriptDocument& rDocument, weld::Dialog* pDialog, // remove existing libraries if ( bRemove ) { - func_remove_entry(aLibName); // LibPage::InsertLib + if (func_remove_entry) + func_remove_entry(aLibName); // LibPage::InsertLib // remove module library if ( xModLibContainer.is() && xModLibContainer->hasByName( aLibName ) ) @@ -939,15 +940,16 @@ void ImportLib(const ScriptDocument& rDocument, weld::Dialog* pDialog, } } } - - func_insert_entry(aLibName); // LibPage::InsertLib + if (func_insert_entry) + func_insert_entry(aLibName); // LibPage::InsertLib bChanges = true; } } if (bChanges) { - func_insert_entries(); // MacroManager + if (func_insert_entries) + func_insert_entries(); // MacroManager MarkDocumentModified(rDocument); } }); diff --git a/basctl/source/dlged/managelang.cxx b/basctl/source/dlged/managelang.cxx index c014ca05f1de..3222733ebc10 100644 --- a/basctl/source/dlged/managelang.cxx +++ b/basctl/source/dlged/managelang.cxx @@ -88,7 +88,7 @@ void ManageLanguageDialog::Init() m_xAddPB->connect_clicked( LINK( this, ManageLanguageDialog, AddHdl ) ); m_xDeletePB->connect_clicked( LINK( this, ManageLanguageDialog, DeleteHdl ) ); m_xMakeDefPB->connect_clicked( LINK( this, ManageLanguageDialog, MakeDefHdl ) ); - m_xLanguageLB->connect_changed( LINK( this, ManageLanguageDialog, SelectHdl ) ); + m_xLanguageLB->connect_selection_changed(LINK(this, ManageLanguageDialog, SelectHdl)); m_xLanguageLB->set_selection_mode(SelectionMode::Multiple); } diff --git a/basctl/source/inc/bastype2.hxx b/basctl/source/inc/bastype2.hxx index 292d59b3ea8a..49731333680f 100644 --- a/basctl/source/inc/bastype2.hxx +++ b/basctl/source/inc/bastype2.hxx @@ -227,7 +227,10 @@ public: std::unique_ptr&& rUserData, weld::TreeIter* pRet = nullptr); - void connect_changed(const Link& rLink) { m_xControl->connect_changed(rLink); } + void connect_changed(const Link& rLink) + { + m_xControl->connect_selection_changed(rLink); + } std::unique_ptr make_iterator(const weld::TreeIter* pIter = nullptr) const { return m_xControl->make_iterator(pIter); } void copy_iterator(const weld::TreeIter& rSource, weld::TreeIter& rDest) const { m_xControl->copy_iterator(rSource, rDest); } bool get_selected(weld::TreeIter* pIter) const { return m_xControl->get_selected(pIter); } diff --git a/basegfx/source/polygon/b2dpolypolygoncutter.cxx b/basegfx/source/polygon/b2dpolypolygoncutter.cxx index 1cf414c1cc56..6feeb1685bfc 100644 --- a/basegfx/source/polygon/b2dpolypolygoncutter.cxx +++ b/basegfx/source/polygon/b2dpolypolygoncutter.cxx @@ -17,7 +17,6 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include #include #include #include @@ -32,6 +31,7 @@ #include #include #include +#include namespace basegfx { @@ -72,23 +72,12 @@ namespace basegfx public: PN* mpPN; + // For this to be a strict weak ordering, the assumption is that none of the involved + // maPoint coordinates are NaN: bool operator<(const SN& rComp) const { - if(fTools::equal(mpPN->maPoint.getX(), rComp.mpPN->maPoint.getX())) - { - if(fTools::equal(mpPN->maPoint.getY(), rComp.mpPN->maPoint.getY())) - { - return (mpPN->mnI < rComp.mpPN->mnI); - } - else - { - return fTools::less(mpPN->maPoint.getY(), rComp.mpPN->maPoint.getY()); - } - } - else - { - return fTools::less(mpPN->maPoint.getX(), rComp.mpPN->maPoint.getX()); - } + return std::tie(mpPN->maPoint, mpPN->mnI) + < std::tie(rComp.mpPN->maPoint, rComp.mpPN->mnI); } }; diff --git a/basic/source/inc/namecont.hxx b/basic/source/inc/namecont.hxx index 0f89538896b1..45246c8447f3 100644 --- a/basic/source/inc/namecont.hxx +++ b/basic/source/inc/namecont.hxx @@ -60,7 +60,6 @@ namespace basic { class NameContainer final { - std::mutex m_aMutex; cppu::OWeakObject& rOwner; std::unordered_map maMap; @@ -84,7 +83,8 @@ public: /// @throws css::lang::IllegalArgumentException /// @throws css::lang::WrappedTargetException /// @throws css::uno::RuntimeException - void insertNoCheck(const OUString& aName, const css::uno::Any& aElement); + void insertNoCheck(const OUString& aName, const css::uno::Any& aElement, + std::unique_lock& guard); // Methods XElementAccess css::uno::Type getElementType(); @@ -96,58 +96,65 @@ public: sal_Bool hasByName(const OUString& aName); // Methods XNameReplace - void replaceByName(const OUString& aName, const css::uno::Any& aElement); + void replaceByName(const OUString& aName, const css::uno::Any& aElement, + std::unique_lock& guard); // Methods XNameContainer - void insertByName(const OUString& aName, const css::uno::Any& aElement); - void removeByName(const OUString& Name); + void insertByName(const OUString& aName, const css::uno::Any& aElement, + std::unique_lock& guard); + void removeByName(const OUString& Name, std::unique_lock& guard); // Methods XContainer - void addContainerListener(const css::uno::Reference& xListener); - void removeContainerListener(const css::uno::Reference& xListener); + void addContainerListener( + const css::uno::Reference& xListener, + std::unique_lock& guard); + void removeContainerListener( + const css::uno::Reference& xListener, + std::unique_lock& guard); // Methods XChangesNotifier - void addChangesListener(const css::uno::Reference& xListener); - void removeChangesListener(const css::uno::Reference& xListener); + void addChangesListener(const css::uno::Reference& xListener, + std::unique_lock& guard); + void removeChangesListener(const css::uno::Reference& xListener, + std::unique_lock& guard); }; class ModifiableHelper { private: - ::comphelper::OInterfaceContainerHelper3 m_aModifyListeners; + comphelper::OInterfaceContainerHelper4 m_aModifyListeners; ::cppu::OWeakObject& m_rEventSource; bool mbModified; public: - ModifiableHelper( ::cppu::OWeakObject& _rEventSource, ::osl::Mutex& _rMutex ) - :m_aModifyListeners( _rMutex ) - ,m_rEventSource( _rEventSource ) + ModifiableHelper( ::cppu::OWeakObject& _rEventSource ) + :m_rEventSource( _rEventSource ) ,mbModified( false ) { } bool isModified() const { return mbModified; } - void setModified( bool _bModified ); + void setModified( bool _bModified, std::unique_lock& guard ); - void addModifyListener( const css::uno::Reference< css::util::XModifyListener >& _rxListener ) + void addModifyListener( const css::uno::Reference< css::util::XModifyListener >& _rxListener, std::unique_lock& guard ) { - m_aModifyListeners.addInterface( _rxListener ); + m_aModifyListeners.addInterface(guard, _rxListener); } - void removeModifyListener( const css::uno::Reference< css::util::XModifyListener >& _rxListener ) + void removeModifyListener( const css::uno::Reference< css::util::XModifyListener >& _rxListener, std::unique_lock& guard ) { - m_aModifyListeners.removeInterface( _rxListener ); + m_aModifyListeners.removeInterface(guard, _rxListener); } }; -typedef ::comphelper::OInterfaceContainerHelper3< +typedef comphelper::OInterfaceContainerHelper4< css::script::vba::XVBAScriptListener > VBAScriptListenerContainer; class SfxLibrary; -typedef ::cppu::WeakComponentImplHelper< +typedef comphelper::WeakComponentImplHelper< css::lang::XInitialization, css::script::XStorageBasedLibraryContainer, css::script::XLibraryContainerPassword, @@ -160,8 +167,7 @@ typedef ::cppu::WeakComponentImplHelper< css::beans::XPropertySet> SfxLibraryContainer_BASE; class SfxLibraryContainer - : public ::cppu::BaseMutex - , public SfxLibraryContainer_BASE + : public SfxLibraryContainer_BASE , public ::utl::OEventListenerAdapter { VBAScriptListenerContainer maVBAScriptListeners; @@ -226,9 +232,11 @@ protected: bool implLoadLibraryIndexFile( SfxLibrary* pLib, ::xmlscript::LibDescriptor& rLib, const css::uno::Reference< css::embed::XStorage >& xStorage, - const OUString& aIndexFileName ); + const OUString& aIndexFileName, + std::unique_lock& guard ); - void implImportLibDescriptor( SfxLibrary* pLib, ::xmlscript::LibDescriptor const & rLib ); + void implImportLibDescriptor(SfxLibrary* pLib, ::xmlscript::LibDescriptor const& rLib, + std::unique_lock& guard); // Methods to distinguish between different library types virtual rtl::Reference implCreateLibrary( const OUString& aName ) = 0; @@ -266,7 +274,8 @@ protected: /// @throws css::lang::WrappedTargetException /// @throws css::uno::RuntimeException virtual bool implLoadPasswordLibrary( SfxLibrary* pLib, const OUString& Name, - bool bVerifyPasswordOnly=false ); + bool bVerifyPasswordOnly, + std::unique_lock& guard ); virtual void onNewRootStorage() = 0; @@ -281,7 +290,8 @@ protected: OUString createAppLibraryFolder( SfxLibrary* pLib, std::u16string_view aName ); void init( const OUString& rInitialDocumentURL, - const css::uno::Reference< css::embed::XStorage >& _rxInitialStorage ); + const css::uno::Reference< css::embed::XStorage >& _rxInitialStorage, + std::unique_lock& guard ); virtual OUString getInfoFileName() const = 0; virtual OUString getOldInfoFileName() const = 0; @@ -303,20 +313,31 @@ protected: void storeLibraries_Impl( const css::uno::Reference< css::embed::XStorage >& xStorage, - bool bComplete ); + bool bComplete, + std::unique_lock& guard ); + + void initializeFromDocument( const css::uno::Reference< css::document::XStorageBasedDocument >& _rxDocument, + std::unique_lock& guard ); + + css::uno::Reference + createLibrary_Impl(const OUString& Name, std::unique_lock& guard); + css::uno::Reference + createLibraryLink_Impl(const OUString& Name, const OUString& StorageURL, sal_Bool ReadOnly, + std::unique_lock& guard); + void loadLibrary_Impl(const OUString& Name, std::unique_lock& guard); - void initializeFromDocument( const css::uno::Reference< css::document::XStorageBasedDocument >& _rxDocument ); // OEventListenerAdapter virtual void _disposing( const css::lang::EventObject& _rSource ) override; - // OComponentHelper - virtual void SAL_CALL disposing() override; + // WeakComponentImplHelperBase + virtual void disposing(std::unique_lock& guard) override; private: void init_Impl( const OUString& rInitialDocumentURL, - const css::uno::Reference< css::embed::XStorage >& _rxInitialStorage ); - void implScanExtensions(); + const css::uno::Reference< css::embed::XStorage >& _rxInitialStorage, + std::unique_lock& guard ); + void implScanExtensions(std::unique_lock& guard); static constexpr OUString sVBATextEncodingPropName = u"VBATextEncoding"_ustr; public: @@ -497,7 +518,7 @@ private: protected: bool implIsModified() const { return mbIsModified; } - void implSetModified( bool _bIsModified ); + void implSetModified(bool _bIsModified, std::unique_lock& guard); bool isPasswordProtected() const { return mbPasswordProtected; } private: @@ -510,7 +531,8 @@ private: void impl_checkLoaded(); private: - void impl_removeWithoutChecks( const OUString& _rElementName ); + void impl_removeWithoutChecks(const OUString& _rElementName, + std::unique_lock& guard); public: SfxLibrary( diff --git a/basic/source/inc/scriptcont.hxx b/basic/source/inc/scriptcont.hxx index 6d733876fdf4..38e62b3bfedc 100644 --- a/basic/source/inc/scriptcont.hxx +++ b/basic/source/inc/scriptcont.hxx @@ -70,7 +70,8 @@ class SfxScriptLibraryContainer final : public SfxLibraryContainer const css::uno::Reference< css::ucb::XSimpleFileAccess3 >& rToUseSFI, const css::uno::Reference< css::task::XInteractionHandler >& Handler ) override; virtual bool implLoadPasswordLibrary( SfxLibrary* pLib, const OUString& Name, - bool bVerifyPasswordOnly=false ) override; + bool bVerifyPasswordOnly, + std::unique_lock& guard ) override; virtual void onNewRootStorage() override; diff --git a/basic/source/uno/dlgcont.cxx b/basic/source/uno/dlgcont.cxx index 464645ff0c26..0402e9188ed0 100644 --- a/basic/source/uno/dlgcont.cxx +++ b/basic/source/uno/dlgcont.cxx @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -92,7 +93,7 @@ SfxDialogLibraryContainer::SfxDialogLibraryContainer() SfxDialogLibraryContainer::SfxDialogLibraryContainer( const uno::Reference< embed::XStorage >& xStorage ) { - init( OUString(), xStorage ); + init(OUString(), xStorage, o3tl::temporary(std::unique_lock(m_aMutex))); } // Methods to get library instances of the correct type diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx index 337963ef97c1..45b95b654538 100644 --- a/basic/source/uno/namecont.cxx +++ b/basic/source/uno/namecont.cxx @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -133,7 +134,8 @@ sal_Bool NameContainer::hasByName( const OUString& aName ) // Methods XNameReplace -void NameContainer::replaceByName( const OUString& aName, const Any& aElement ) +void NameContainer::replaceByName(const OUString& aName, const Any& aElement, + std::unique_lock& guard) { const Type& aAnyType = aElement.getValueType(); if( mType != aAnyType ) @@ -148,33 +150,32 @@ void NameContainer::replaceByName( const OUString& aName, const Any& aElement ) Any aOldElement = aIt->second; aIt->second = aElement; - std::unique_lock aGuard(m_aMutex); - // Fire event - if( maContainerListeners.getLength(aGuard) > 0 ) + if (maContainerListeners.getLength(guard) > 0) { ContainerEvent aEvent; aEvent.Source = mpxEventSource; aEvent.Accessor <<= aName; aEvent.Element = aElement; aEvent.ReplacedElement = aOldElement; - maContainerListeners.notifyEach( aGuard, &XContainerListener::elementReplaced, aEvent ); + maContainerListeners.notifyEach(guard, &XContainerListener::elementReplaced, aEvent); } /* After the container event has been fired (one listener will update the core Basic manager), fire change event. Listeners can rely on that the Basic source code of the core Basic manager is up-to-date. */ - if( maChangesListeners.getLength(aGuard) > 0 ) + if (maChangesListeners.getLength(guard) > 0) { ChangesEvent aEvent; aEvent.Source = mpxEventSource; aEvent.Base <<= aEvent.Source; aEvent.Changes = { { Any(aName), aElement, aOldElement } }; - maChangesListeners.notifyEach( aGuard, &XChangesListener::changesOccurred, aEvent ); + maChangesListeners.notifyEach(guard, &XChangesListener::changesOccurred, aEvent); } } -void NameContainer::insertNoCheck(const OUString& aName, const Any& aElement) +void NameContainer::insertNoCheck(const OUString& aName, const Any& aElement, + std::unique_lock& guard) { const Type& aAnyType = aElement.getValueType(); if( mType != aAnyType ) @@ -184,40 +185,39 @@ void NameContainer::insertNoCheck(const OUString& aName, const Any& aElement) maMap[aName] = aElement; - std::unique_lock aGuard(m_aMutex); - // Fire event - if( maContainerListeners.getLength(aGuard) > 0 ) + if (maContainerListeners.getLength(guard) > 0) { ContainerEvent aEvent; aEvent.Source = mpxEventSource; aEvent.Accessor <<= aName; aEvent.Element = aElement; - maContainerListeners.notifyEach( aGuard, &XContainerListener::elementInserted, aEvent ); + maContainerListeners.notifyEach(guard, &XContainerListener::elementInserted, aEvent); } /* After the container event has been fired (one listener will update the core Basic manager), fire change event. Listeners can rely on that the Basic source code of the core Basic manager is up-to-date. */ - if( maChangesListeners.getLength(aGuard) > 0 ) + if (maChangesListeners.getLength(guard) > 0) { ChangesEvent aEvent; aEvent.Source = mpxEventSource; aEvent.Base <<= aEvent.Source; aEvent.Changes = { { Any(aName), aElement, {} } }; - maChangesListeners.notifyEach( aGuard, &XChangesListener::changesOccurred, aEvent ); + maChangesListeners.notifyEach(guard, &XChangesListener::changesOccurred, aEvent); } } // Methods XNameContainer -void NameContainer::insertByName( const OUString& aName, const Any& aElement ) +void NameContainer::insertByName(const OUString& aName, const Any& aElement, + std::unique_lock& guard) { if (hasByName(aName)) throw ElementExistException(aName); - insertNoCheck(aName, aElement); + insertNoCheck(aName, aElement, guard); } -void NameContainer::removeByName( const OUString& aName ) +void NameContainer::removeByName(const OUString& aName, std::unique_lock& guard) { auto aIt = maMap.find(aName); if (aIt == maMap.end()) @@ -228,22 +228,20 @@ void NameContainer::removeByName( const OUString& aName ) Any aOldElement = aIt->second; maMap.erase(aIt); - std::unique_lock aGuard(m_aMutex); - // Fire event - if( maContainerListeners.getLength(aGuard) > 0 ) + if (maContainerListeners.getLength(guard) > 0) { ContainerEvent aEvent; aEvent.Source = mpxEventSource; aEvent.Accessor <<= aName; aEvent.Element = aOldElement; - maContainerListeners.notifyEach( aGuard, &XContainerListener::elementRemoved, aEvent ); + maContainerListeners.notifyEach(guard, &XContainerListener::elementRemoved, aEvent); } /* After the container event has been fired (one listener will update the core Basic manager), fire change event. Listeners can rely on that the Basic source code of the core Basic manager is up-to-date. */ - if( maChangesListeners.getLength(aGuard) > 0 ) + if (maChangesListeners.getLength(guard) > 0) { ChangesEvent aEvent; aEvent.Source = mpxEventSource; @@ -251,57 +249,57 @@ void NameContainer::removeByName( const OUString& aName ) aEvent.Changes = { { Any(aName), {}, // Element remains empty (meaning "replaced with nothing") aOldElement } }; - maChangesListeners.notifyEach( aGuard, &XChangesListener::changesOccurred, aEvent ); + maChangesListeners.notifyEach(guard, &XChangesListener::changesOccurred, aEvent); } } // Methods XContainer -void NameContainer::addContainerListener(const Reference& xListener) +void NameContainer::addContainerListener(const Reference& xListener, + std::unique_lock& guard) { if( !xListener.is() ) { throw RuntimeException(u"addContainerListener called with null xListener"_ustr,rOwner); } - std::unique_lock aGuard(m_aMutex); - maContainerListeners.addInterface( aGuard, xListener ); + maContainerListeners.addInterface(guard, xListener); } -void NameContainer::removeContainerListener(const Reference& xListener) +void NameContainer::removeContainerListener(const Reference& xListener, + std::unique_lock& guard) { if( !xListener.is() ) { throw RuntimeException(u"removeContainerListener called with null xListener"_ustr,rOwner); } - std::unique_lock aGuard(m_aMutex); - maContainerListeners.removeInterface( aGuard, xListener ); + maContainerListeners.removeInterface(guard, xListener); } // Methods XChangesNotifier -void NameContainer::addChangesListener(const Reference& xListener) +void NameContainer::addChangesListener(const Reference& xListener, + std::unique_lock& guard) { if( !xListener.is() ) { throw RuntimeException(u"addChangesListener called with null xListener"_ustr,rOwner); } - std::unique_lock aGuard(m_aMutex); - maChangesListeners.addInterface( aGuard, xListener ); + maChangesListeners.addInterface(guard, xListener); } -void NameContainer::removeChangesListener(const Reference& xListener) +void NameContainer::removeChangesListener(const Reference& xListener, + std::unique_lock& guard) { if( !xListener.is() ) { throw RuntimeException(u"removeChangesListener called with null xListener"_ustr,rOwner); } - std::unique_lock aGuard(m_aMutex); - maChangesListeners.removeInterface( aGuard, xListener ); + maChangesListeners.removeInterface(guard, xListener); } // ModifiableHelper -void ModifiableHelper::setModified( bool _bModified ) +void ModifiableHelper::setModified(bool _bModified, std::unique_lock& guard) { if ( _bModified == mbModified ) { @@ -309,23 +307,21 @@ void ModifiableHelper::setModified( bool _bModified ) } mbModified = _bModified; - if ( m_aModifyListeners.getLength() == 0 ) + if (m_aModifyListeners.getLength(guard) == 0) { return; } EventObject aModifyEvent( m_rEventSource ); - m_aModifyListeners.notifyEach( &XModifyListener::modified, aModifyEvent ); + m_aModifyListeners.notifyEach(guard, &XModifyListener::modified, aModifyEvent); } // Ctor SfxLibraryContainer::SfxLibraryContainer() - : SfxLibraryContainer_BASE( m_aMutex ) - , maVBAScriptListeners( m_aMutex ) - , mnRunningVBAScripts( 0 ) + : mnRunningVBAScripts( 0 ) , mbVBACompat( false ) , meVBATextEncoding( RTL_TEXTENCODING_DONTKNOW ) - , maModifiable( *this, m_aMutex ) + , maModifiable( *this ) , maNameContainer( cppu::UnoType::get(), *this ) , mpBasMgr( nullptr ) , mbOwnBasMgr( false ) @@ -351,7 +347,7 @@ SfxLibraryContainer::~SfxLibraryContainer() void SfxLibraryContainer::enterMethod() { Application::GetSolarMutex().acquire(); - if ( rBHelper.bInDispose || rBHelper.bDisposed ) + if (m_bDisposed) { throw DisposedException( OUString(), *this ); } @@ -414,7 +410,7 @@ void SAL_CALL SfxLibraryContainer::storeLibrariesToStorage( const Reference< XSt } try { - storeLibraries_Impl( _rxRootStorage, true ); + storeLibraries_Impl(_rxRootStorage, true, o3tl::temporary(std::unique_lock(m_aMutex))); } catch( const Exception& ) { @@ -465,19 +461,19 @@ sal_Bool SfxLibraryContainer::isModified() void SAL_CALL SfxLibraryContainer::setModified( sal_Bool _bModified ) { LibraryContainerMethodGuard aGuard( *this ); - maModifiable.setModified( _bModified ); + maModifiable.setModified(_bModified, o3tl::temporary(std::unique_lock(m_aMutex))); } void SAL_CALL SfxLibraryContainer::addModifyListener( const Reference< XModifyListener >& _rxListener ) { LibraryContainerMethodGuard aGuard( *this ); - maModifiable.addModifyListener( _rxListener ); + maModifiable.addModifyListener(_rxListener, o3tl::temporary(std::unique_lock(m_aMutex))); } void SAL_CALL SfxLibraryContainer::removeModifyListener( const Reference< XModifyListener >& _rxListener ) { LibraryContainerMethodGuard aGuard( *this ); - maModifiable.removeModifyListener( _rxListener ); + maModifiable.removeModifyListener(_rxListener, o3tl::temporary(std::unique_lock(m_aMutex))); } // Methods XPersistentLibraryContainer @@ -498,7 +494,7 @@ void SAL_CALL SfxLibraryContainer::storeLibraries( ) LibraryContainerMethodGuard aGuard( *this ); try { - storeLibraries_Impl( mxStorage, mxStorage.is() ); + storeLibraries_Impl(mxStorage, mxStorage.is(), o3tl::temporary(std::unique_lock(m_aMutex))); // we need to store *all* libraries if and only if we are based on a storage: // in this case, storeLibraries_Impl will remove the source storage, after loading // all libraries, so we need to force them to be stored, again @@ -551,18 +547,21 @@ void createVariableURL( OUString& rStr, std::u16string_view rLibName, } } -void SfxLibraryContainer::init( const OUString& rInitialDocumentURL, const uno::Reference< embed::XStorage >& rxInitialStorage ) +void SfxLibraryContainer::init(const OUString& rInitialDocumentURL, + const uno::Reference& rxInitialStorage, + std::unique_lock& guard) { // this might be called from within the ctor, and the impl_init might (indirectly) create // a UNO reference to ourself. // Ensure that we're not destroyed while we're in here osl_atomic_increment( &m_refCount ); - init_Impl( rInitialDocumentURL, rxInitialStorage ); + init_Impl(rInitialDocumentURL, rxInitialStorage, guard); osl_atomic_decrement( &m_refCount ); } void SfxLibraryContainer::init_Impl( const OUString& rInitialDocumentURL, - const uno::Reference< embed::XStorage >& rxInitialStorage ) + const uno::Reference< embed::XStorage >& rxInitialStorage, + std::unique_lock& guard ) { uno::Reference< embed::XStorage > xStorage = rxInitialStorage; @@ -595,7 +594,7 @@ void SfxLibraryContainer::init_Impl( const OUString& rInitialDocumentURL, meInitMode = LIBRARY_INIT_FILE; uno::Reference< embed::XStorage > xDummyStor; ::xmlscript::LibDescriptor aLibDesc; - implLoadLibraryIndexFile( nullptr, aLibDesc, xDummyStor, aInitFileName ); + implLoadLibraryIndexFile(nullptr, aLibDesc, xDummyStor, aInitFileName, guard); return; } else @@ -804,7 +803,7 @@ void SfxLibraryContainer::init_Impl( const OUString& rInitialDocumentURL, if( mxSFI->isFolder( aLibDirPath ) ) { createVariableURL( rLib.aStorageURL, rLib.aName, maInfoFileName, true ); - maModifiable.setModified( true ); + maModifiable.setModified(true, guard); } else if( rLib.bLink ) { @@ -816,7 +815,7 @@ void SfxLibraryContainer::init_Impl( const OUString& rInitialDocumentURL, if( mxSFI->isFolder( aShareLibDirPath ) ) { createVariableURL( rLib.aStorageURL, rLib.aName, maInfoFileName, false ); - maModifiable.setModified( true ); + maModifiable.setModified(true, guard); } else { @@ -838,12 +837,12 @@ void SfxLibraryContainer::init_Impl( const OUString& rInitialDocumentURL, if( rLib.bLink ) { Reference< XNameAccess > xLib = - createLibraryLink( aLibName, rLib.aStorageURL, rLib.bReadOnly ); + createLibraryLink_Impl(aLibName, rLib.aStorageURL, rLib.bReadOnly, guard); pImplLib = static_cast< SfxLibrary* >( xLib.get() ); } else { - Reference< XNameContainer > xLib = createLibrary( aLibName ); + Reference xLib = createLibrary_Impl(aLibName, guard); pImplLib = static_cast< SfxLibrary* >( xLib.get() ); pImplLib->mbLoaded = false; pImplLib->mbReadOnly = rLib.bReadOnly; @@ -853,7 +852,7 @@ void SfxLibraryContainer::init_Impl( const OUString& rInitialDocumentURL, pImplLib->maStorageURL, pImplLib->maUnexpandedStorageURL ); } } - maModifiable.setModified( false ); + maModifiable.setModified(false, guard); // Read library info files if( !mbOldInfoFormat ) @@ -876,10 +875,10 @@ void SfxLibraryContainer::init_Impl( const OUString& rInitialDocumentURL, } } - // Link is already initialised in createLibraryLink() + // Link is already initialised in createLibraryLink_Impl() if( !pImplLib->mbInitialised && (!bStorage || xLibraryStor.is()) ) { - bool bLoaded = implLoadLibraryIndexFile( pImplLib, rLib, xLibraryStor, OUString() ); + bool bLoaded = implLoadLibraryIndexFile( pImplLib, rLib, xLibraryStor, OUString(), guard ); SAL_WARN_IF( bLoaded && aLibName != rLib.aName, "basic", ("Different library names in library container and" @@ -899,7 +898,7 @@ void SfxLibraryContainer::init_Impl( const OUString& rInitialDocumentURL, implStoreLibraryIndexFile( pImplLib, rLib, xTmpStorage ); } - implImportLibDescriptor( pImplLib, rLib ); + implImportLibDescriptor(pImplLib, rLib, guard); if( nPass == 1 ) { @@ -923,7 +922,7 @@ void SfxLibraryContainer::init_Impl( const OUString& rInitialDocumentURL, { try { - implScanExtensions(); + implScanExtensions(guard); } catch(const uno::Exception& ) { @@ -939,7 +938,7 @@ void SfxLibraryContainer::init_Impl( const OUString& rInitialDocumentURL, SfxLibrary* pImplLib = getImplLib( aName ); if( pImplLib->mbPreload ) { - loadLibrary( aName ); + loadLibrary_Impl(aName, guard); } } } @@ -1087,7 +1086,7 @@ void SfxLibraryContainer::init_Impl( const OUString& rInitialDocumentURL, } if( bCreateLink ) { - createLibraryLink( aLibName, pImplLib->maStorageURL, pImplLib->mbReadOnly ); + createLibraryLink_Impl( aLibName, pImplLib->maStorageURL, pImplLib->mbReadOnly, guard ); } } else @@ -1108,21 +1107,21 @@ void SfxLibraryContainer::init_Impl( const OUString& rInitialDocumentURL, if( aLibName == aStandardStr ) { - maNameContainer.removeByName( aLibName ); + maNameContainer.removeByName(aLibName, guard); } // Create library - Reference< XNameContainer > xLib = createLibrary( aLibName ); + Reference xLib = createLibrary_Impl(aLibName, guard); SfxLibrary* pNewLib = static_cast< SfxLibrary* >( xLib.get() ); pNewLib->mbLoaded = false; - pNewLib->implSetModified( false ); + pNewLib->implSetModified(false, guard); checkStorageURL( aLibFolder, pNewLib->maLibInfoFileURL, pNewLib->maStorageURL, pNewLib->maUnexpandedStorageURL ); uno::Reference< embed::XStorage > xDummyStor; ::xmlscript::LibDescriptor aLibDesc; - implLoadLibraryIndexFile( pNewLib, aLibDesc, xDummyStor, pNewLib->maLibInfoFileURL ); - implImportLibDescriptor( pNewLib, aLibDesc ); + implLoadLibraryIndexFile( pNewLib, aLibDesc, xDummyStor, pNewLib->maLibInfoFileURL, guard ); + implImportLibDescriptor(pNewLib, aLibDesc, guard); } } mxSFI->kill( aPrevFolder ); @@ -1171,7 +1170,7 @@ void SfxLibraryContainer::init_Impl( const OUString& rInitialDocumentURL, {} } -void SfxLibraryContainer::implScanExtensions() +void SfxLibraryContainer::implScanExtensions(std::unique_lock& guard) { #if HAVE_FEATURE_EXTENSIONS ScriptExtensionIterator aScriptIt; @@ -1213,10 +1212,10 @@ void SfxLibraryContainer::implScanExtensions() // Create link const bool bReadOnly = false; - createLibraryLink( aLibName, aIndexFileURL, bReadOnly ); + createLibraryLink_Impl(aLibName, aIndexFileURL, bReadOnly, guard); } #else - (void) this; + (void)guard; #endif } @@ -1292,7 +1291,8 @@ bool SfxLibraryContainer::implStorePasswordLibrary( bool SfxLibraryContainer::implLoadPasswordLibrary( SfxLibrary* /*pLib*/, const OUString& /*Name*/, - bool /*bVerifyPasswordOnly*/ ) + bool /*bVerifyPasswordOnly*/, + std::unique_lock& /*guard*/ ) { return true; } @@ -1580,7 +1580,8 @@ void SfxLibraryContainer::implStoreLibraryIndexFile( SfxLibrary* pLib, bool SfxLibraryContainer::implLoadLibraryIndexFile( SfxLibrary* pLib, ::xmlscript::LibDescriptor& rLib, const uno::Reference< embed::XStorage >& xStorage, - const OUString& aIndexFileName ) + const OUString& aIndexFileName, + std::unique_lock& guard ) { Reference< XParser > xParser = xml::sax::Parser::create(mxContext); @@ -1660,41 +1661,41 @@ bool SfxLibraryContainer::implLoadLibraryIndexFile( SfxLibrary* pLib, if( !pLib ) { - Reference< XNameContainer > xLib = createLibrary( rLib.aName ); + Reference xLib = createLibrary_Impl(rLib.aName, guard); pLib = static_cast< SfxLibrary* >( xLib.get() ); pLib->mbLoaded = false; rLib.aStorageURL = aIndexFileName; checkStorageURL( rLib.aStorageURL, pLib->maLibInfoFileURL, pLib->maStorageURL, pLib->maUnexpandedStorageURL ); - implImportLibDescriptor( pLib, rLib ); + implImportLibDescriptor(pLib, rLib, guard); } return true; } void SfxLibraryContainer::implImportLibDescriptor( SfxLibrary* pLib, - ::xmlscript::LibDescriptor const & rLib ) + ::xmlscript::LibDescriptor const& rLib, + std::unique_lock& guard) { if( pLib->mbInitialised ) return; - Any aDummyElement = createEmptyLibraryElement(); for (auto& name : rLib.aElementNames) { - pLib->maNameContainer.insertByName(name, aDummyElement); + pLib->maNameContainer.insertByName(name, aDummyElement, guard); } pLib->mbPasswordProtected = rLib.bPasswordProtected; pLib->mbReadOnly = rLib.bReadOnly; pLib->mbPreload = rLib.bPreload; - pLib->implSetModified( false ); + pLib->implSetModified(false, guard); pLib->mbInitialised = true; } // Methods of new XLibraryStorage interface? void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XStorage >& i_rStorage, - bool bComplete ) + bool bComplete, std::unique_lock& guard ) { const Sequence< OUString > aNames = maNameContainer.getElementNames(); @@ -1890,7 +1891,7 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto // Maybe lib is not loaded?! if( bComplete ) { - loadLibrary( rLib.aName ); + loadLibrary_Impl(rLib.aName, guard); } if( pImplLib->mbPasswordProtected ) { @@ -1917,8 +1918,8 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto } } } - maModifiable.setModified( true ); - pImplLib->implSetModified( false ); + maModifiable.setModified(true, guard); + pImplLib->implSetModified(false, guard); } // For container info ReadOnly refers to mbReadOnlyLink @@ -1980,7 +1981,7 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto { return; } - maModifiable.setModified( false ); + maModifiable.setModified(false, guard); mbOldInfoFormat = false; // Write library container info @@ -2095,6 +2096,12 @@ sal_Bool SfxLibraryContainer::hasByName( const OUString& aName ) Reference< XNameContainer > SAL_CALL SfxLibraryContainer::createLibrary( const OUString& Name ) { LibraryContainerMethodGuard aGuard( *this ); + return createLibrary_Impl(Name, o3tl::temporary(std::unique_lock(m_aMutex))); +} + +css::uno::Reference +SfxLibraryContainer::createLibrary_Impl(const OUString& Name, std::unique_lock& guard) +{ rtl::Reference pNewLib = implCreateLibrary( Name ); pNewLib->maLibElementFileExtension = maLibElementFileExtension; @@ -2106,8 +2113,8 @@ Reference< XNameContainer > SAL_CALL SfxLibraryContainer::createLibrary( const O Reference< XNameAccess > xNameAccess( pNewLib ); Any aElement; aElement <<= xNameAccess; - maNameContainer.insertByName( Name, aElement ); - maModifiable.setModified( true ); + maNameContainer.insertByName(Name, aElement, guard); + maModifiable.setModified(true, guard); return pNewLib; } @@ -2115,6 +2122,13 @@ Reference< XNameAccess > SAL_CALL SfxLibraryContainer::createLibraryLink ( const OUString& Name, const OUString& StorageURL, sal_Bool ReadOnly ) { LibraryContainerMethodGuard aGuard( *this ); + return createLibraryLink_Impl(Name, StorageURL, ReadOnly, o3tl::temporary(std::unique_lock(m_aMutex))); +} + +css::uno::Reference +SfxLibraryContainer::createLibraryLink_Impl(const OUString& Name, const OUString& StorageURL, + sal_Bool ReadOnly, std::unique_lock& guard) +{ // TODO: Check other reasons to force ReadOnly status //if( !ReadOnly ) //{ @@ -2133,14 +2147,14 @@ Reference< XNameAccess > SAL_CALL SfxLibraryContainer::createLibraryLink uno::Reference< embed::XStorage > xDummyStor; ::xmlscript::LibDescriptor aLibDesc; - implLoadLibraryIndexFile( pNewLib.get(), aLibDesc, xDummyStor, OUString() ); - implImportLibDescriptor( pNewLib.get(), aLibDesc ); + implLoadLibraryIndexFile(pNewLib.get(), aLibDesc, xDummyStor, OUString(), guard); + implImportLibDescriptor(pNewLib.get(), aLibDesc, guard); Reference< XNameAccess > xRet( pNewLib ); Any aElement; aElement <<= xRet; - maNameContainer.insertByName( Name, aElement ); - maModifiable.setModified( true ); + maNameContainer.insertByName(Name, aElement, guard); + maModifiable.setModified(true, guard); if( StorageURL.indexOf( "vnd.sun.star.expand:$UNO_USER_PACKAGES_CACHE" ) != -1 ) { @@ -2159,6 +2173,7 @@ Reference< XNameAccess > SAL_CALL SfxLibraryContainer::createLibraryLink void SAL_CALL SfxLibraryContainer::removeLibrary( const OUString& Name ) { LibraryContainerMethodGuard aGuard( *this ); + std::unique_lock guard(m_aMutex); // Get and hold library before removing rtl::Reference pImplLib(getImplLib(Name)); if( pImplLib->mbReadOnly && !pImplLib->mbLink ) @@ -2166,8 +2181,8 @@ void SAL_CALL SfxLibraryContainer::removeLibrary( const OUString& Name ) throw IllegalArgumentException(u"readonly && !link"_ustr, getXWeak(), 1); } // Remove from container - maNameContainer.removeByName( Name ); - maModifiable.setModified( true ); + maNameContainer.removeByName(Name, guard); + maModifiable.setModified(true, guard); // Delete library files, but not for linked libraries if( pImplLib->mbLink ) @@ -2180,7 +2195,7 @@ void SAL_CALL SfxLibraryContainer::removeLibrary( const OUString& Name ) if (pImplLib->hasElements()) { for (auto& name : pImplLib->getElementNames()) - pImplLib->impl_removeWithoutChecks(name); + pImplLib->impl_removeWithoutChecks(name, guard); } // Delete index file @@ -2230,6 +2245,12 @@ sal_Bool SAL_CALL SfxLibraryContainer::isLibraryLoaded( const OUString& Name ) void SAL_CALL SfxLibraryContainer::loadLibrary( const OUString& Name ) { LibraryContainerMethodGuard aGuard( *this ); + return loadLibrary_Impl(Name, o3tl::temporary(std::unique_lock(m_aMutex))); +} + +void SfxLibraryContainer::loadLibrary_Impl(const OUString& Name, + std::unique_lock& guard) +{ SfxLibrary* pImplLib = getImplLib(Name); bool bLoaded = pImplLib->mbLoaded; @@ -2239,7 +2260,7 @@ void SAL_CALL SfxLibraryContainer::loadLibrary( const OUString& Name ) if( pImplLib->mbPasswordProtected ) { - implLoadPasswordLibrary( pImplLib, Name ); + implLoadPasswordLibrary(pImplLib, Name, false, guard); return; } @@ -2346,15 +2367,15 @@ void SAL_CALL SfxLibraryContainer::loadLibrary( const OUString& Name ) { if( aAny.hasValue() ) { - pImplLib->maNameContainer.replaceByName( aElementName, aAny ); + pImplLib->maNameContainer.replaceByName(aElementName, aAny, guard); } } else { - pImplLib->maNameContainer.insertNoCheck(aElementName, aAny); + pImplLib->maNameContainer.insertNoCheck(aElementName, aAny, guard); } } - pImplLib->implSetModified( false ); + pImplLib->implSetModified(false, guard); } // Methods XLibraryContainer2 @@ -2390,14 +2411,15 @@ sal_Bool SAL_CALL SfxLibraryContainer::isLibraryReadOnly( const OUString& Name ) void SAL_CALL SfxLibraryContainer::setLibraryReadOnly( const OUString& Name, sal_Bool bReadOnly ) { LibraryContainerMethodGuard aGuard( *this ); + std::unique_lock guard(m_aMutex); SfxLibrary* pImplLib = getImplLib( Name ); if( pImplLib->mbLink ) { if( pImplLib->mbReadOnlyLink != bool(bReadOnly) ) { pImplLib->mbReadOnlyLink = bReadOnly; - pImplLib->implSetModified( true ); - maModifiable.setModified( true ); + pImplLib->implSetModified(true, guard); + maModifiable.setModified(true, guard); } } else @@ -2405,7 +2427,7 @@ void SAL_CALL SfxLibraryContainer::setLibraryReadOnly( const OUString& Name, sal if( pImplLib->mbReadOnly != bool(bReadOnly) ) { pImplLib->mbReadOnly = bReadOnly; - pImplLib->implSetModified( true ); + pImplLib->implSetModified(true, guard); } } } @@ -2413,6 +2435,7 @@ void SAL_CALL SfxLibraryContainer::setLibraryReadOnly( const OUString& Name, sal void SAL_CALL SfxLibraryContainer::renameLibrary( const OUString& Name, const OUString& NewName ) { LibraryContainerMethodGuard aGuard( *this ); + std::unique_lock guard(m_aMutex); if( maNameContainer.hasByName( NewName ) ) { throw ElementExistException(); @@ -2425,7 +2448,7 @@ void SAL_CALL SfxLibraryContainer::renameLibrary( const OUString& Name, const OU { return; // Lib with unverified password cannot be renamed } - loadLibrary( Name ); + loadLibrary_Impl(Name, guard); // Rename library folder, but not for linked libraries bool bMovedSuccessful = true; @@ -2439,7 +2462,7 @@ void SAL_CALL SfxLibraryContainer::renameLibrary( const OUString& Name, const OU OUString aLibDirPath = pImplLib->maStorageURL; // tdf#151741 - fill various storage URLs for the library // These URLs should not be empty for newly created libraries after - // the change in SfxLibraryContainer::createLibrary. + // the change in SfxLibraryContainer::createLibrary_Impl. if (aLibDirPath.isEmpty()) { checkStorageURL(pImplLib->maUnexpandedStorageURL, pImplLib->maLibInfoFileURL, @@ -2515,7 +2538,7 @@ void SAL_CALL SfxLibraryContainer::renameLibrary( const OUString& Name, const OU } bMovedSuccessful = true; - pImplLib->implSetModified( true ); + pImplLib->implSetModified(true, guard); } } catch(const Exception& ) @@ -2525,14 +2548,14 @@ void SAL_CALL SfxLibraryContainer::renameLibrary( const OUString& Name, const OU if( bStorage && !pImplLib->mbLink ) { - pImplLib->implSetModified( true ); + pImplLib->implSetModified(true, guard); } if( bMovedSuccessful ) { // Remove the old library from the container and insert it back with the new name - maNameContainer.removeByName(Name); - maNameContainer.insertByName(NewName, Any(Reference(pImplLib))); - maModifiable.setModified(true); + maNameContainer.removeByName(Name, guard); + maNameContainer.insertByName(NewName, Any(Reference(pImplLib)), guard); + maModifiable.setModified(true, guard); } } @@ -2541,6 +2564,7 @@ void SAL_CALL SfxLibraryContainer::renameLibrary( const OUString& Name, const OU void SAL_CALL SfxLibraryContainer::initialize( const Sequence< Any >& _rArguments ) { LibraryContainerMethodGuard aGuard( *this ); + std::unique_lock guard(m_aMutex); sal_Int32 nArgCount = _rArguments.getLength(); if ( nArgCount != 1 ) throw IllegalArgumentException(u"too many args"_ustr, getXWeak(), -1); @@ -2549,20 +2573,21 @@ void SAL_CALL SfxLibraryContainer::initialize( const Sequence< Any >& _rArgument Reference< XStorageBasedDocument > xDocument; if ( _rArguments[0] >>= sInitialDocumentURL ) { - init( sInitialDocumentURL, nullptr ); + init(sInitialDocumentURL, nullptr, guard); return; } if ( _rArguments[0] >>= xDocument ) { - initializeFromDocument( xDocument ); + initializeFromDocument(xDocument, guard); return; } throw IllegalArgumentException(u"arg1 unknown type"_ustr, getXWeak(), 1); } -void SfxLibraryContainer::initializeFromDocument( const Reference< XStorageBasedDocument >& _rxDocument ) +void SfxLibraryContainer::initializeFromDocument( const Reference< XStorageBasedDocument >& _rxDocument, + std::unique_lock& guard ) { // check whether this is a valid OfficeDocument, and obtain the document's root storage Reference< XStorage > xDocStorage; @@ -2585,7 +2610,7 @@ void SfxLibraryContainer::initializeFromDocument( const Reference< XStorageBased { throw IllegalArgumentException(u"no doc storage"_ustr, getXWeak(), 1); } - init( OUString(), xDocStorage ); + init(OUString(), xDocStorage, guard); } // OEventListenerAdapter @@ -2603,11 +2628,11 @@ void SfxLibraryContainer::_disposing( const EventObject& _rSource ) } // OComponentHelper -void SAL_CALL SfxLibraryContainer::disposing() +void SfxLibraryContainer::disposing(std::unique_lock& guard) { Reference< XModel > xModel = mxOwnerDocument; EventObject aEvent( xModel ); - maVBAScriptListeners.disposeAndClear( aEvent ); + maVBAScriptListeners.disposeAndClear(guard, aEvent); stopAllComponentListening(); mxOwnerDocument.clear(); } @@ -2637,14 +2662,16 @@ void SAL_CALL SfxLibraryContainer::changeLibraryPassword(const OUString&, const void SAL_CALL SfxLibraryContainer::addContainerListener( const Reference< XContainerListener >& xListener ) { LibraryContainerMethodGuard aGuard( *this ); + std::unique_lock guard(m_aMutex); maNameContainer.setEventSource( getXWeak() ); - maNameContainer.addContainerListener( xListener ); + maNameContainer.addContainerListener(xListener, guard); } void SAL_CALL SfxLibraryContainer::removeContainerListener( const Reference< XContainerListener >& xListener ) { LibraryContainerMethodGuard aGuard( *this ); - maNameContainer.removeContainerListener( xListener ); + std::unique_lock guard(m_aMutex); + maNameContainer.removeContainerListener(xListener, guard); } // Methods XLibraryContainerExport @@ -2652,6 +2679,7 @@ void SAL_CALL SfxLibraryContainer::exportLibrary( const OUString& Name, const OU const Reference< XInteractionHandler >& Handler ) { LibraryContainerMethodGuard aGuard( *this ); + std::unique_lock guard(m_aMutex); SfxLibrary* pImplLib = getImplLib( Name ); Reference< XSimpleFileAccess3 > xToUseSFI; @@ -2662,7 +2690,7 @@ void SAL_CALL SfxLibraryContainer::exportLibrary( const OUString& Name, const OU } // Maybe lib is not loaded?! - loadLibrary( Name ); + loadLibrary_Impl(Name, guard); uno::Reference< css::embed::XStorage > xDummyStor; if( pImplLib->mbPasswordProtected ) @@ -2782,12 +2810,12 @@ sal_Int32 SAL_CALL SfxLibraryContainer::getRunningVBAScripts() void SAL_CALL SfxLibraryContainer::addVBAScriptListener( const Reference< vba::XVBAScriptListener >& rxListener ) { - maVBAScriptListeners.addInterface( rxListener ); + maVBAScriptListeners.addInterface(o3tl::temporary(std::unique_lock(m_aMutex)), rxListener); } void SAL_CALL SfxLibraryContainer::removeVBAScriptListener( const Reference< vba::XVBAScriptListener >& rxListener ) { - maVBAScriptListeners.removeInterface( rxListener ); + maVBAScriptListeners.removeInterface(o3tl::temporary(std::unique_lock(m_aMutex)), rxListener); } void SAL_CALL SfxLibraryContainer::broadcastVBAScriptEvent( sal_Int32 nIdentifier, const OUString& rModuleName ) @@ -2807,7 +2835,9 @@ void SAL_CALL SfxLibraryContainer::broadcastVBAScriptEvent( sal_Int32 nIdentifie Reference< XModel > xModel = mxOwnerDocument; // weak-ref -> ref vba::VBAScriptEvent aEvent( Reference(xModel, UNO_QUERY), nIdentifier, rModuleName ); - maVBAScriptListeners.notifyEach( &css::script::vba::XVBAScriptListener::notifyVBAScriptEvent, aEvent ); + maVBAScriptListeners.notifyEach(o3tl::temporary(std::unique_lock(m_aMutex)), + &css::script::vba::XVBAScriptListener::notifyVBAScriptEvent, + aEvent); } // Methods XPropertySet @@ -2912,7 +2942,7 @@ bool SfxLibrary::isLoadedStorable() return mbLoaded && (!mbPasswordProtected || mbPasswordVerified); } -void SfxLibrary::implSetModified( bool _bIsModified ) +void SfxLibrary::implSetModified(bool _bIsModified, std::unique_lock& guard) { if ( mbIsModified == _bIsModified ) { @@ -2921,7 +2951,7 @@ void SfxLibrary::implSetModified( bool _bIsModified ) mbIsModified = _bIsModified; if ( mbIsModified ) { - mrModifiable.setModified( true ); + mrModifiable.setModified(true, guard); } } @@ -2992,8 +3022,9 @@ void SfxLibrary::replaceByName( const OUString& aName, const Any& aElement ) !isLibraryElementValid(aElement), "basic", "SfxLibrary::replaceByName: replacing element is invalid!"); - maNameContainer.replaceByName( aName, aElement ); - implSetModified( true ); + std::unique_lock guard(m_aMutex); + maNameContainer.replaceByName(aName, aElement, guard); + implSetModified(true, guard); } @@ -3007,14 +3038,16 @@ void SfxLibrary::insertByName( const OUString& aName, const Any& aElement ) !isLibraryElementValid(aElement), "basic", "SfxLibrary::insertByName: to-be-inserted element is invalid!"); - maNameContainer.insertByName( aName, aElement ); - implSetModified( true ); + std::unique_lock guard(m_aMutex); + maNameContainer.insertByName(aName, aElement, guard); + implSetModified(true, guard); } -void SfxLibrary::impl_removeWithoutChecks( const OUString& _rElementName ) +void SfxLibrary::impl_removeWithoutChecks(const OUString& _rElementName, + std::unique_lock& guard) { - maNameContainer.removeByName( _rElementName ); - implSetModified( true ); + maNameContainer.removeByName(_rElementName, guard); + implSetModified(true, guard); // Remove element file if( maStorageURL.isEmpty() ) @@ -3044,31 +3077,31 @@ void SfxLibrary::removeByName( const OUString& Name ) { impl_checkReadOnly(); impl_checkLoaded(); - impl_removeWithoutChecks( Name ); + impl_removeWithoutChecks(Name, o3tl::temporary(std::unique_lock(m_aMutex))); } // Methods XContainer void SAL_CALL SfxLibrary::addContainerListener( const Reference< XContainerListener >& xListener ) { maNameContainer.setEventSource( getXWeak() ); - maNameContainer.addContainerListener( xListener ); + maNameContainer.addContainerListener(xListener, o3tl::temporary(std::unique_lock(m_aMutex))); } void SAL_CALL SfxLibrary::removeContainerListener( const Reference< XContainerListener >& xListener ) { - maNameContainer.removeContainerListener( xListener ); + maNameContainer.removeContainerListener(xListener, o3tl::temporary(std::unique_lock(m_aMutex))); } // Methods XChangesNotifier void SAL_CALL SfxLibrary::addChangesListener( const Reference< XChangesListener >& xListener ) { maNameContainer.setEventSource( getXWeak() ); - maNameContainer.addChangesListener( xListener ); + maNameContainer.addChangesListener(xListener, o3tl::temporary(std::unique_lock(m_aMutex))); } void SAL_CALL SfxLibrary::removeChangesListener( const Reference< XChangesListener >& xListener ) { - maNameContainer.removeChangesListener( xListener ); + maNameContainer.removeChangesListener(xListener, o3tl::temporary(std::unique_lock(m_aMutex))); } diff --git a/basic/source/uno/scriptcont.cxx b/basic/source/uno/scriptcont.cxx index 1fa596222e04..2fbed6ae9253 100644 --- a/basic/source/uno/scriptcont.cxx +++ b/basic/source/uno/scriptcont.cxx @@ -38,7 +38,7 @@ // For password functionality #include - +#include #include #include #include @@ -114,7 +114,7 @@ SfxScriptLibraryContainer::SfxScriptLibraryContainer() SfxScriptLibraryContainer::SfxScriptLibraryContainer( const uno::Reference< embed::XStorage >& xStorage ) { - init( OUString(), xStorage ); + init(OUString(), xStorage, o3tl::temporary(std::unique_lock(m_aMutex))); } // Methods to get library instances of the correct type @@ -371,6 +371,7 @@ sal_Bool SAL_CALL SfxScriptLibraryContainer::verifyLibraryPassword ( const OUString& Name, const OUString& Password ) { LibraryContainerMethodGuard aGuard( *this ); + std::unique_lock guard(m_aMutex); SfxLibrary* pImplLib = getImplLib( Name ); if( !pImplLib->mbPasswordProtected || pImplLib->mbPasswordVerified ) { @@ -389,19 +390,19 @@ sal_Bool SAL_CALL SfxScriptLibraryContainer::verifyLibraryPassword else { pImplLib->maPassword = Password; - bSuccess = implLoadPasswordLibrary( pImplLib, Name, true ); + bSuccess = implLoadPasswordLibrary( pImplLib, Name, true, guard); if( bSuccess ) { // The library gets modified by verifying the password, because other- // wise for saving the storage would be copied and that doesn't work // with mtg's storages when the password is verified - pImplLib->implSetModified( true ); + pImplLib->implSetModified(true, guard); pImplLib->mbPasswordVerified = true; // Reload library to get source if( pImplLib->mbLoaded ) { - implLoadPasswordLibrary( pImplLib, Name ); + implLoadPasswordLibrary( pImplLib, Name, false, guard); } } } @@ -458,14 +459,15 @@ void SAL_CALL SfxScriptLibraryContainer::changeLibraryPassword( const OUString& pImplLib->mbPasswordVerified = false; pImplLib->maPassword.clear(); - maModifiable.setModified( true ); - pImplLib->implSetModified( true ); + std::unique_lock guard(m_aMutex); + maModifiable.setModified(true, guard); + pImplLib->implSetModified(true, guard); if( !bStorage && !pImplLib->mbDoc50Password ) { // Store application basic unencrypted uno::Reference< embed::XStorage > xStorage; - storeLibraries_Impl( xStorage, false ); + storeLibraries_Impl(xStorage, false, guard); bKillCryptedFiles = true; } } @@ -483,14 +485,15 @@ void SAL_CALL SfxScriptLibraryContainer::changeLibraryPassword( const OUString& pSL->mbLoadedSource = true; // must store source code now! } - maModifiable.setModified( true ); - pImplLib->implSetModified( true ); + std::unique_lock guard(m_aMutex); + maModifiable.setModified(true, guard); + pImplLib->implSetModified(true, guard); if( !bStorage && !pImplLib->mbDoc50Password ) { // Store application basic crypted uno::Reference< embed::XStorage > xStorage; - storeLibraries_Impl( xStorage, false ); + storeLibraries_Impl(xStorage, false, guard); bKillUnencryptedFiles = true; } } @@ -806,7 +809,7 @@ bool SfxScriptLibraryContainer::implStorePasswordLibrary( SfxLibrary* pLib, cons } bool SfxScriptLibraryContainer::implLoadPasswordLibrary - ( SfxLibrary* pLib, const OUString& Name, bool bVerifyPasswordOnly ) + ( SfxLibrary* pLib, const OUString& Name, bool bVerifyPasswordOnly, std::unique_lock& guard ) { bool bRet = true; @@ -950,12 +953,12 @@ bool SfxScriptLibraryContainer::implLoadPasswordLibrary { if( aAny.hasValue() ) { - pLib->maNameContainer.replaceByName( aElementName, aAny ); + pLib->maNameContainer.replaceByName(aElementName, aAny, guard); } } else { - pLib->maNameContainer.insertByName( aElementName, aAny ); + pLib->maNameContainer.insertByName(aElementName, aAny, guard); } } } @@ -1063,12 +1066,13 @@ bool SfxScriptLibraryContainer::implLoadPasswordLibrary { if( aAny.hasValue() ) { - pLib->maNameContainer.replaceByName( aElementName, aAny ); + pLib->maNameContainer.replaceByName(aElementName, aAny, + guard); } } else { - pLib->maNameContainer.insertByName( aElementName, aAny ); + pLib->maNameContainer.insertByName(aElementName, aAny, guard); } } } diff --git a/chart2/source/controller/dialogs/res_BarGeometry.cxx b/chart2/source/controller/dialogs/res_BarGeometry.cxx index cf25d970e99d..927906b06915 100644 --- a/chart2/source/controller/dialogs/res_BarGeometry.cxx +++ b/chart2/source/controller/dialogs/res_BarGeometry.cxx @@ -34,7 +34,7 @@ BarGeometryResources::BarGeometryResources(weld::Builder* pBuilder) void BarGeometryResources::connect_changed(const Link& rLink) { - m_xLB_Geometry->connect_changed(rLink); + m_xLB_Geometry->connect_selection_changed(rLink); } void BarGeometryResources::set_visible(bool bShow) diff --git a/chart2/source/controller/dialogs/tp_ChartType.cxx b/chart2/source/controller/dialogs/tp_ChartType.cxx index 12fa0325cef4..45f5b277ef7e 100644 --- a/chart2/source/controller/dialogs/tp_ChartType.cxx +++ b/chart2/source/controller/dialogs/tp_ChartType.cxx @@ -71,7 +71,7 @@ ChartTypeTabPage::ChartTypeTabPage(weld::Container* pPage, weld::DialogControlle SetPageTitle(SchResId(STR_PAGE_CHARTTYPE)); - m_xMainTypeList->connect_changed(LINK(this, ChartTypeTabPage, SelectMainTypeHdl)); + m_xMainTypeList->connect_selection_changed(LINK(this, ChartTypeTabPage, SelectMainTypeHdl)); m_xSubTypeList->SetSelectHdl( LINK( this, ChartTypeTabPage, SelectSubTypeHdl ) ); m_xSubTypeList->SetStyle(m_xSubTypeList->GetStyle() | diff --git a/chart2/source/controller/dialogs/tp_DataSource.cxx b/chart2/source/controller/dialogs/tp_DataSource.cxx index 577ef29c6b63..4cc12689ebc9 100644 --- a/chart2/source/controller/dialogs/tp_DataSource.cxx +++ b/chart2/source/controller/dialogs/tp_DataSource.cxx @@ -184,8 +184,9 @@ DataSourceTabPage::DataSourceTabPage(weld::Container* pPage, weld::DialogControl SetPageTitle(SchResId(STR_OBJECT_DATASERIES_PLURAL)); // set handlers - m_xLB_SERIES->connect_changed(LINK(this, DataSourceTabPage, SeriesSelectionChangedHdl)); - m_xLB_ROLE->connect_changed(LINK(this, DataSourceTabPage, RoleSelectionChangedHdl)); + m_xLB_SERIES->connect_selection_changed( + LINK(this, DataSourceTabPage, SeriesSelectionChangedHdl)); + m_xLB_ROLE->connect_selection_changed(LINK(this, DataSourceTabPage, RoleSelectionChangedHdl)); m_xIMB_RANGE_MAIN->connect_clicked(LINK(this, DataSourceTabPage, MainRangeButtonClickedHdl)); m_xIMB_RANGE_CAT->connect_clicked(LINK(this, DataSourceTabPage, CategoriesRangeButtonClickedHdl)); diff --git a/comphelper/source/misc/proxyaggregation.cxx b/comphelper/source/misc/proxyaggregation.cxx index db580bea496c..b24629d5614a 100644 --- a/comphelper/source/misc/proxyaggregation.cxx +++ b/comphelper/source/misc/proxyaggregation.cxx @@ -208,7 +208,7 @@ namespace comphelper return comphelper::concatSequences( OComponentProxyAggregationHelper::getTypes(), // append XComponent, coming from WeakComponentImplHelperBase - Sequence { cppu::UnoType::get() }); + std::initializer_list{ cppu::UnoType::get() }); } diff --git a/comphelper/source/property/propertycontainer.cxx b/comphelper/source/property/propertycontainer.cxx index ad24c5f30aa7..0c17feb50234 100644 --- a/comphelper/source/property/propertycontainer.cxx +++ b/comphelper/source/property/propertycontainer.cxx @@ -42,12 +42,7 @@ OPropertyContainer::~OPropertyContainer() Sequence< Type > OPropertyContainer::getBaseTypes() { // just the types from our one and only base class - ::cppu::OTypeCollection aTypes( - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get() - ); - return aTypes.getTypes(); + return cppu::OPropertySetHelper::getTypes(); } sal_Bool OPropertyContainer::convertFastPropertyValue( diff --git a/comphelper/source/property/propertycontainer2.cxx b/comphelper/source/property/propertycontainer2.cxx index 5a3bfa4be285..7a57ed57c03b 100644 --- a/comphelper/source/property/propertycontainer2.cxx +++ b/comphelper/source/property/propertycontainer2.cxx @@ -33,10 +33,7 @@ OPropertyContainer2::~OPropertyContainer2() {} Sequence OPropertyContainer2::getBaseTypes() { // just the types from our one and only base class - ::cppu::OTypeCollection aTypes(cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get()); - return aTypes.getTypes(); + return comphelper::OPropertySetHelper::getTypes(); } bool OPropertyContainer2::convertFastPropertyValue(std::unique_lock& /*rGuard*/, diff --git a/config_host.mk.in b/config_host.mk.in index 7ce742cf3987..8baece8fb531 100644 --- a/config_host.mk.in +++ b/config_host.mk.in @@ -744,7 +744,6 @@ export TMPDIR=@TEMP_DIRECTORY@ export TOUCH=@TOUCH@ export UCRTSDKDIR=@UCRTSDKDIR@ export UCRTVERSION=@UCRTVERSION@ -export UCRT_REDISTDIR=@UCRT_REDISTDIR@ export UNIQ=@UNIQ@ export UNIX_DLAPI_LIBS=@UNIX_DLAPI_LIBS@ export USE_HEADLESS_CODE=@USE_HEADLESS_CODE@ diff --git a/configure.ac b/configure.ac index 370cedc91c29..db7a8e901626 100644 --- a/configure.ac +++ b/configure.ac @@ -4158,7 +4158,6 @@ cygwin*|wsl*) SCPDEFS="$SCPDEFS -DWINDOWS_AARCH64" WIN_HOST_ARCH="arm64" WIN_HOST_BITS=64 - with_ucrt_dir=no ;; *) AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os]) @@ -8945,23 +8944,6 @@ if test "$_os" = "Linux" -a "$host_cpu" = "powerpc"; then fi AC_SUBST([JITC_PROCESSOR_TYPE]) -# Misc Windows Stuff -AC_ARG_WITH(ucrt-dir, - AS_HELP_STRING([--with-ucrt-dir], - [path to the directory with the arch-specific MSU packages of the Windows Universal CRT redistributables - (MS KB 2999226) for packaging into the installsets (without those the target system needs to install - the UCRT or Visual C++ Runtimes manually). The directory must contain the following 6 files: - Windows6.1-KB2999226-x64.msu - Windows6.1-KB2999226-x86.msu - Windows8.1-KB2999226-x64.msu - Windows8.1-KB2999226-x86.msu - Windows8-RT-KB2999226-x64.msu - Windows8-RT-KB2999226-x86.msu - A zip archive including those files is available from Microsoft site: - https://www.microsoft.com/en-us/download/details.aspx?id=48234]), -,) - -UCRT_REDISTDIR="$with_ucrt_dir" if test $_os = "WINNT"; then find_msvc_x64_dlls MSVC_DLL_PATH=`win_short_path_for_make "$msvcdllpath"` @@ -8983,36 +8965,8 @@ if test $_os = "WINNT"; then break fi done - - if test "$UCRT_REDISTDIR" = "no"; then - dnl explicitly disabled - UCRT_REDISTDIR="" - else - PathFormat "$UCRT_REDISTDIR" - UCRT_REDISTDIR="$formatted_path" - UCRT_REDISTDIR_unix="$formatted_path_unix" - if ! test -f "$UCRT_REDISTDIR_unix/Windows6.1-KB2999226-x64.msu" -a \ - -f "$UCRT_REDISTDIR_unix/Windows6.1-KB2999226-x86.msu" -a \ - -f "$UCRT_REDISTDIR_unix/Windows8.1-KB2999226-x64.msu" -a \ - -f "$UCRT_REDISTDIR_unix/Windows8.1-KB2999226-x86.msu" -a \ - -f "$UCRT_REDISTDIR_unix/Windows8-RT-KB2999226-x64.msu" -a \ - -f "$UCRT_REDISTDIR_unix/Windows8-RT-KB2999226-x86.msu"; then - UCRT_REDISTDIR="" - if test -n "$PKGFORMAT"; then - for i in $PKGFORMAT; do - case "$i" in - msi) - AC_MSG_WARN([--without-ucrt-dir not specified or MSUs not found - installer will have runtime dependency]) - add_warning "--without-ucrt-dir not specified or MSUs not found - installer will have runtime dependency" - ;; - esac - done - fi - fi - fi fi -AC_SUBST(UCRT_REDISTDIR) AC_SUBST(MSVC_DLL_PATH) AC_SUBST(MSVC_DLLS) AC_SUBST(MSM_PATH) diff --git a/connectivity/Library_ado.mk b/connectivity/Library_ado.mk index 8cfd5485fe15..7a406299083d 100644 --- a/connectivity/Library_ado.mk +++ b/connectivity/Library_ado.mk @@ -31,6 +31,12 @@ $(eval $(call gb_Library_add_cxxflags,ado,\ )) endif +ifeq ($(COM),MSC) +$(eval $(call gb_Library_add_cxxflags,ado,\ + -DADO_SUPPRESS_MESSAGE \ +)) +endif + $(eval $(call gb_Library_use_system_win32_libs,ado,\ ole32 \ oleaut32 \ diff --git a/connectivity/source/drivers/ado/ADatabaseMetaDataResultSet.cxx b/connectivity/source/drivers/ado/ADatabaseMetaDataResultSet.cxx index 0e5c082d7fdf..5c96b394da0f 100644 --- a/connectivity/source/drivers/ado/ADatabaseMetaDataResultSet.cxx +++ b/connectivity/source/drivers/ado/ADatabaseMetaDataResultSet.cxx @@ -99,11 +99,8 @@ Any SAL_CALL ODatabaseMetaDataResultSet::queryInterface( const Type & rType ) css::uno::Sequence< css::uno::Type > SAL_CALL ODatabaseMetaDataResultSet::getTypes( ) { - ::cppu::OTypeCollection aTypes( cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get()); - - return ::comphelper::concatSequences(aTypes.getTypes(),ODatabaseMetaDataResultSet_BASE::getTypes()); + return comphelper::concatSequences(cppu::OPropertySetHelper::getTypes(), + ODatabaseMetaDataResultSet_BASE::getTypes()); } void ODatabaseMetaDataResultSet::checkRecordSet() diff --git a/connectivity/source/drivers/ado/APreparedStatement.cxx b/connectivity/source/drivers/ado/APreparedStatement.cxx index 6be6cfefd993..d7c82d184fdb 100644 --- a/connectivity/source/drivers/ado/APreparedStatement.cxx +++ b/connectivity/source/drivers/ado/APreparedStatement.cxx @@ -55,7 +55,7 @@ using namespace com::sun::star::util; IMPLEMENT_SERVICE_INFO(OPreparedStatement,"com.sun.star.sdbcx.APreparedStatement","com.sun.star.sdbc.PreparedStatement"); OPreparedStatement::OPreparedStatement( OConnection* _pConnection, const OUString& sql) - : OStatement_Base( _pConnection ) + : OPreparedStatement_BASE(_pConnection) { osl_atomic_increment( &m_refCount ); @@ -92,24 +92,6 @@ OPreparedStatement::~OPreparedStatement() } } -Any SAL_CALL OPreparedStatement::queryInterface( const Type & rType ) -{ - Any aRet = OStatement_Base::queryInterface(rType); - return aRet.hasValue() ? aRet : ::cppu::queryInterface( rType, - static_cast< XPreparedStatement*>(this), - static_cast< XParameters*>(this), - static_cast< XResultSetMetaDataSupplier*>(this)); -} - -css::uno::Sequence< css::uno::Type > SAL_CALL OPreparedStatement::getTypes( ) -{ - ::cppu::OTypeCollection aTypes( cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get()); - - return ::comphelper::concatSequences(aTypes.getTypes(),OStatement_Base::getTypes()); -} - Reference< XResultSetMetaData > SAL_CALL OPreparedStatement::getMetaData( ) { if(!m_xMetaData.is() && m_RecordSet.IsValid()) @@ -421,16 +403,6 @@ void SAL_CALL OPreparedStatement::clearParameters( ) } } -void SAL_CALL OPreparedStatement::acquire() noexcept -{ - OStatement_Base::acquire(); -} - -void SAL_CALL OPreparedStatement::release() noexcept -{ - OStatement_Base::release(); -} - void OPreparedStatement::replaceParameterNodeName(OSQLParseNode const * _pNode, const OUString& _sDefaultName, sal_Int32& _rParameterCount) diff --git a/connectivity/source/drivers/ado/AResultSet.cxx b/connectivity/source/drivers/ado/AResultSet.cxx index 3e7c143d839a..ae1013c1c177 100644 --- a/connectivity/source/drivers/ado/AResultSet.cxx +++ b/connectivity/source/drivers/ado/AResultSet.cxx @@ -132,11 +132,8 @@ Any SAL_CALL OResultSet::queryInterface( const Type & rType ) css::uno::Sequence< css::uno::Type > SAL_CALL OResultSet::getTypes( ) { - ::cppu::OTypeCollection aTypes( cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get()); - - return ::comphelper::concatSequences(aTypes.getTypes(),OResultSet_BASE::getTypes()); + return comphelper::concatSequences(cppu::OPropertySetHelper::getTypes(), + OResultSet_BASE::getTypes()); } sal_Int32 SAL_CALL OResultSet::findColumn( const OUString& columnName ) @@ -263,7 +260,7 @@ sal_Int32 SAL_CALL OResultSet::getRow( ) checkDisposed(OResultSet_BASE::rBHelper.bDisposed); - PositionEnum_Param aPos; + PositionEnum aPos; m_pRecordSet->get_AbsolutePosition(&aPos); return (aPos > 0) ? static_cast(aPos) : m_nRowPos; // return the rowcount from driver if the driver doesn't support this return our count diff --git a/connectivity/source/drivers/ado/AStatement.cxx b/connectivity/source/drivers/ado/AStatement.cxx index f5fed2c22027..0764a4b335a5 100644 --- a/connectivity/source/drivers/ado/AStatement.cxx +++ b/connectivity/source/drivers/ado/AStatement.cxx @@ -120,11 +120,8 @@ Any SAL_CALL OStatement_Base::queryInterface( const Type & rType ) css::uno::Sequence< css::uno::Type > SAL_CALL OStatement_Base::getTypes( ) { - ::cppu::OTypeCollection aTypes( cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get()); - - return ::comphelper::concatSequences(aTypes.getTypes(),OStatement_BASE::getTypes()); + return comphelper::concatSequences(cppu::OPropertySetHelper::getTypes(), + OStatement_BASE::getTypes()); } @@ -374,7 +371,7 @@ Sequence< sal_Int32 > SAL_CALL OStatement::executeBatch( ) { assignRecordSet( pSet ); - ADO_LONGPTR nValue; + long nValue; if(m_RecordSet.get_RecordCount(nValue)) pArray[j] = nValue; } @@ -426,7 +423,7 @@ sal_Int32 SAL_CALL OStatement_Base::getUpdateCount( ) checkDisposed(OStatement_BASE::rBHelper.bDisposed); - ADO_LONGPTR nRet; + long nRet; if(m_RecordSet.IsValid() && m_RecordSet.get_RecordCount(nRet)) return nRet; return -1; @@ -489,7 +486,7 @@ sal_Int32 OStatement_Base::getQueryTimeOut() const sal_Int32 OStatement_Base::getMaxRows() const { - ADO_LONGPTR nRet=-1; + long nRet = -1; if(!(m_RecordSet.IsValid() && m_RecordSet.get_MaxRecords(nRet))) ::dbtools::throwFunctionSequenceException(nullptr); return nRet; diff --git a/connectivity/source/drivers/ado/Awrapado.cxx b/connectivity/source/drivers/ado/Awrapado.cxx index e9e016c09330..74abd185353f 100644 --- a/connectivity/source/drivers/ado/Awrapado.cxx +++ b/connectivity/source/drivers/ado/Awrapado.cxx @@ -422,7 +422,7 @@ WpADOProperties WpADOField::get_Properties() sal_Int32 WpADOField::GetActualSize() const { assert(pInterface); - ADO_LONGPTR nActualSize=0; + long nActualSize = 0; pInterface->get_ActualSize(&nActualSize); return nActualSize; } @@ -445,7 +445,7 @@ sal_Int32 WpADOField::GetStatus() const sal_Int32 WpADOField::GetDefinedSize() const { assert(pInterface); - ADO_LONGPTR nDefinedSize=0; + long nDefinedSize = 0; pInterface->get_DefinedSize(&nDefinedSize); return nDefinedSize; } @@ -697,10 +697,10 @@ bool WpADORecordset::Supports( /* [in] */ CursorOptionEnum CursorOptions) return bSupports == VARIANT_TRUE; } -PositionEnum_Param WpADORecordset::get_AbsolutePosition() +PositionEnum WpADORecordset::get_AbsolutePosition() { assert(pInterface); - PositionEnum_Param aTemp=adPosUnknown; + PositionEnum aTemp = adPosUnknown; pInterface->get_AbsolutePosition(&aTemp); return aTemp; } @@ -815,13 +815,13 @@ bool WpADORecordset::NextRecordset(OLEVariant& RecordsAffected,ADORecordset** pp return SUCCEEDED(pInterface->NextRecordset(&RecordsAffected,ppiRset)); } -bool WpADORecordset::get_RecordCount(ADO_LONGPTR &_nRet) const +bool WpADORecordset::get_RecordCount(long& _nRet) const { assert(pInterface); return SUCCEEDED(pInterface->get_RecordCount(&_nRet)); } -bool WpADORecordset::get_MaxRecords(ADO_LONGPTR &_nRet) const +bool WpADORecordset::get_MaxRecords(long& _nRet) const { assert(pInterface); return SUCCEEDED(pInterface->get_MaxRecords(&_nRet)); diff --git a/connectivity/source/drivers/jdbc/CallableStatement.cxx b/connectivity/source/drivers/jdbc/CallableStatement.cxx index f98dbe337888..6c1714e06352 100644 --- a/connectivity/source/drivers/jdbc/CallableStatement.cxx +++ b/connectivity/source/drivers/jdbc/CallableStatement.cxx @@ -61,10 +61,10 @@ Any SAL_CALL java_sql_CallableStatement::queryInterface( const Type & rType ) css::uno::Sequence< css::uno::Type > SAL_CALL java_sql_CallableStatement::getTypes( ) { - ::cppu::OTypeCollection aTypes( cppu::UnoType::get(), - cppu::UnoType::get()); + css::uno::Type aTypes[] { cppu::UnoType::get(), + cppu::UnoType::get() }; - return ::comphelper::concatSequences(aTypes.getTypes(),java_sql_PreparedStatement::getTypes()); + return ::comphelper::concatSequences(java_sql_PreparedStatement::getTypes(), aTypes); } sal_Bool SAL_CALL java_sql_CallableStatement::wasNull( ) diff --git a/connectivity/source/inc/ado/APreparedStatement.hxx b/connectivity/source/inc/ado/APreparedStatement.hxx index 2ce394dbdefb..8227252b685c 100644 --- a/connectivity/source/inc/ado/APreparedStatement.hxx +++ b/connectivity/source/inc/ado/APreparedStatement.hxx @@ -34,13 +34,12 @@ namespace connectivity class OSQLParseNode; namespace ado { + using OPreparedStatement_BASE + = cppu::ImplInheritanceHelper; - class OPreparedStatement : public OStatement_Base, - public css::sdbc::XPreparedStatement, - public css::sdbc::XParameters, - public css::sdbc::XResultSetMetaDataSupplier, - public css::lang::XServiceInfo - + class OPreparedStatement : public OPreparedStatement_BASE { /// @throws css::sdbc::SQLException /// @throws css::uno::RuntimeException @@ -62,12 +61,6 @@ namespace connectivity // a Constructor, that is needed for when Returning the Object is needed: OPreparedStatement( OConnection* _pConnection, const OUString& sql); - virtual void SAL_CALL acquire() noexcept override; - virtual void SAL_CALL release() noexcept override; - virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override; - //XTypeProvider - virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override; - // XPreparedStatement virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL executeQuery( ) override; using OStatement_Base::executeQuery; diff --git a/connectivity/source/inc/ado/AResultSet.hxx b/connectivity/source/inc/ado/AResultSet.hxx index 58de2baeb539..b9f024765b34 100644 --- a/connectivity/source/inc/ado/AResultSet.hxx +++ b/connectivity/source/inc/ado/AResultSet.hxx @@ -66,7 +66,7 @@ namespace connectivity::ado css::uno::Reference< css::sdbc::XResultSetMetaData> m_xMetaData; std::vector m_aBookmarks; OLEVariant m_aValue; - ADO_LONGPTR m_nRowPos; + long m_nRowPos; bool m_bEOF; bool m_bOnFirstAfterOpen; diff --git a/connectivity/source/inc/ado/AStatement.hxx b/connectivity/source/inc/ado/AStatement.hxx index ce4369b347f2..b8e3e1a6ff9c 100644 --- a/connectivity/source/inc/ado/AStatement.hxx +++ b/connectivity/source/inc/ado/AStatement.hxx @@ -71,7 +71,7 @@ namespace connectivity::ado std::vector m_aTypeInfo; // Hashtable containing an entry // for each row returned by // DatabaseMetaData.getTypeInfo. - ADO_LONGPTR m_nMaxRows; + long m_nMaxRows; sal_Int32 m_nFetchSize; LockTypeEnum m_eLockType; CursorTypeEnum m_eCursorType; diff --git a/connectivity/source/inc/ado/Awrapado.hxx b/connectivity/source/inc/ado/Awrapado.hxx index 507b85522674..bcdbe18b0dd9 100644 --- a/connectivity/source/inc/ado/Awrapado.hxx +++ b/connectivity/source/inc/ado/Awrapado.hxx @@ -289,7 +289,7 @@ namespace connectivity::ado bool Cancel() const; sal_Int32 get_State( ); bool Supports( /* [in] */ CursorOptionEnum CursorOptions); - PositionEnum_Param get_AbsolutePosition(); + PositionEnum get_AbsolutePosition(); void GetDataSource(IUnknown** pIUnknown) const ; void PutRefDataSource(IUnknown* pIUnknown); void GetBookmark(VARIANT& var); @@ -311,8 +311,8 @@ namespace connectivity::ado bool CancelUpdate(); WpADOProperties get_Properties() const; bool NextRecordset(OLEVariant& RecordsAffected,ADORecordset** ppiRset); - bool get_RecordCount(ADO_LONGPTR &_nRet) const; - bool get_MaxRecords(ADO_LONGPTR &_nRet) const; + bool get_RecordCount(long& _nRet) const; + bool get_MaxRecords(long& _nRet) const; bool put_MaxRecords(ADO_LONGPTR _nRet); bool get_CursorType(CursorTypeEnum &_nRet) const; bool put_CursorType(CursorTypeEnum _nRet); diff --git a/cppuhelper/source/component.cxx b/cppuhelper/source/component.cxx index 5c7226f93a1a..3861f35f03bd 100644 --- a/cppuhelper/source/component.cxx +++ b/cppuhelper/source/component.cxx @@ -107,13 +107,13 @@ void OComponentHelper::release() noexcept Sequence< Type > OComponentHelper::getTypes() { - static OTypeCollection s_aTypes( + static const Sequence s_aTypes { cppu::UnoType::get(), cppu::UnoType::get(), cppu::UnoType::get(), - cppu::UnoType::get() ); + cppu::UnoType::get() }; - return s_aTypes.getTypes(); + return s_aTypes; } // XComponent diff --git a/cui/source/customize/SvxMenuConfigPage.cxx b/cui/source/customize/SvxMenuConfigPage.cxx index 2a75181ae95a..d8d1d86387d2 100644 --- a/cui/source/customize/SvxMenuConfigPage.cxx +++ b/cui/source/customize/SvxMenuConfigPage.cxx @@ -54,7 +54,7 @@ SvxMenuConfigPage::SvxMenuConfigPage(weld::Container* pPage, weld::DialogControl rTreeView.set_vexpand(true); rTreeView.show(); - rTreeView.connect_changed(LINK(this, SvxMenuConfigPage, SelectMenuEntry)); + rTreeView.connect_selection_changed(LINK(this, SvxMenuConfigPage, SelectMenuEntry)); rTreeView.connect_popup_menu(LINK(this, SvxMenuConfigPage, ContentContextMenuHdl)); m_xFunctions->get_widget().connect_popup_menu( diff --git a/cui/source/customize/SvxToolbarConfigPage.cxx b/cui/source/customize/SvxToolbarConfigPage.cxx index a1ba639f0e27..95afc2e12359 100644 --- a/cui/source/customize/SvxToolbarConfigPage.cxx +++ b/cui/source/customize/SvxToolbarConfigPage.cxx @@ -64,7 +64,7 @@ SvxToolbarConfigPage::SvxToolbarConfigPage(weld::Container* pPage, rTreeView.set_help_id(HID_SVX_CONFIG_TOOLBAR_CONTENTS); rTreeView.show(); - rTreeView.connect_changed(LINK(this, SvxToolbarConfigPage, SelectToolbarEntry)); + rTreeView.connect_selection_changed(LINK(this, SvxToolbarConfigPage, SelectToolbarEntry)); rTreeView.connect_popup_menu(LINK(this, SvxToolbarConfigPage, ContentContextMenuHdl)); m_xFunctions->get_widget().connect_popup_menu( diff --git a/cui/source/customize/acccfg.cxx b/cui/source/customize/acccfg.cxx index a83cc24e520e..49e714146bf5 100644 --- a/cui/source/customize/acccfg.cxx +++ b/cui/source/customize/acccfg.cxx @@ -892,11 +892,11 @@ SfxAcceleratorConfigPage::SfxAcceleratorConfigPage(weld::Container* pPage, // install handler functions m_xChangeButton->connect_clicked(LINK(this, SfxAcceleratorConfigPage, ChangeHdl)); m_xRemoveButton->connect_clicked(LINK(this, SfxAcceleratorConfigPage, RemoveHdl)); - m_xEntriesBox->connect_changed(LINK(this, SfxAcceleratorConfigPage, SelectHdl)); + m_xEntriesBox->connect_selection_changed(LINK(this, SfxAcceleratorConfigPage, SelectHdl)); m_xEntriesBox->connect_key_press(LINK(this, SfxAcceleratorConfigPage, KeyInputHdl)); m_xGroupLBox->connect_changed(LINK(this, SfxAcceleratorConfigPage, SelectHdl)); m_xFunctionBox->connect_changed(LINK(this, SfxAcceleratorConfigPage, SelectHdl)); - m_xKeyBox->connect_changed(LINK(this, SfxAcceleratorConfigPage, SelectHdl)); + m_xKeyBox->connect_selection_changed(LINK(this, SfxAcceleratorConfigPage, SelectHdl)); m_xLoadButton->connect_clicked(LINK(this, SfxAcceleratorConfigPage, Load)); m_xSaveButton->connect_clicked(LINK(this, SfxAcceleratorConfigPage, Save)); m_xResetButton->connect_clicked(LINK(this, SfxAcceleratorConfigPage, Default)); diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx index 3aaa07d6bb15..0bd6b44ede66 100644 --- a/cui/source/customize/cfg.cxx +++ b/cui/source/customize/cfg.cxx @@ -1041,7 +1041,7 @@ SvxConfigPage::SvxConfigPage(weld::Container* pPage, weld::DialogController* pCo m_xSearchEdit->connect_focus_out(LINK(this, SvxConfigPage, FocusOut_Impl)); rTreeView.connect_row_activated(LINK(this, SvxConfigPage, FunctionDoubleClickHdl)); - rTreeView.connect_changed(LINK(this, SvxConfigPage, SelectFunctionHdl)); + rTreeView.connect_selection_changed(LINK(this, SvxConfigPage, SelectFunctionHdl)); } IMPL_LINK_NOARG(SvxConfigPage, SelectElementHdl, weld::ComboBox&, void) @@ -1838,7 +1838,7 @@ SvxMainMenuOrganizerDialog::SvxMainMenuOrganizerDialog( m_xDialog->set_title(CuiResId(RID_CUISTR_MOVE_MENU)); } - m_xMenuListBox->connect_changed(LINK(this, SvxMainMenuOrganizerDialog, SelectHdl)); + m_xMenuListBox->connect_selection_changed(LINK(this, SvxMainMenuOrganizerDialog, SelectHdl)); m_xMoveUpButton->connect_clicked(LINK( this, SvxMainMenuOrganizerDialog, MoveHdl)); m_xMoveDownButton->connect_clicked(LINK( this, SvxMainMenuOrganizerDialog, MoveHdl)); diff --git a/cui/source/customize/macropg.cxx b/cui/source/customize/macropg.cxx index 60824e011f00..a6b13d5ff5c1 100644 --- a/cui/source/customize/macropg.cxx +++ b/cui/source/customize/macropg.cxx @@ -561,7 +561,7 @@ void SvxMacroTabPage_::InitAndSetHandler( const Reference< container::XNameRepla if( mpImpl->xAssignComponentPB ) mpImpl->xAssignComponentPB->connect_clicked( aLnk ); mpImpl->xEventLB->connect_row_activated( LINK(this, SvxMacroTabPage_, DoubleClickHdl_Impl ) ); - mpImpl->xEventLB->connect_changed( LINK( this, SvxMacroTabPage_, SelectEvent_Impl )); + mpImpl->xEventLB->connect_selection_changed(LINK(this, SvxMacroTabPage_, SelectEvent_Impl)); std::vector aWidths { diff --git a/cui/source/dialogs/MacroManagerDialog.cxx b/cui/source/dialogs/MacroManagerDialog.cxx index a017e4da31fb..ebc07902dcb3 100644 --- a/cui/source/dialogs/MacroManagerDialog.cxx +++ b/cui/source/dialogs/MacroManagerDialog.cxx @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -578,6 +579,7 @@ IMPL_LINK(ScriptContainersListBox, QueryTooltip, const weld::TreeIter&, rEntryIt && xModLibContainer->isLibraryLink(aLibName)) { OUString aLinkURL = xModLibContainer->getLibraryLinkURL(aLibName); + osl::File::getSystemPathFromFileURL(aLinkURL, aLinkURL); return aLinkURL; } } @@ -966,7 +968,13 @@ void MacroManagerDialog::UpdateUI() if (xModLibContainer.is() && xModLibContainer->hasByName(aLibName) && xModLibContainer->isLibraryLink(aLibName)) { - sDescriptionText = xModLibContainer->getLibraryLinkURL(aLibName); + OUString aLinkURL = xModLibContainer->getLibraryLinkURL(aLibName); + OUString aSysPath; + if (osl::File::getSystemPathFromFileURL(aLinkURL, aSysPath) + == osl::FileBase::E_None) + sDescriptionText = aSysPath; + else + sDescriptionText = aLinkURL; } } } diff --git a/cui/source/dialogs/cuigaldlg.cxx b/cui/source/dialogs/cuigaldlg.cxx index 1bf026e7d865..026abd399608 100644 --- a/cui/source/dialogs/cuigaldlg.cxx +++ b/cui/source/dialogs/cuigaldlg.cxx @@ -610,7 +610,7 @@ void TPGalleryThemeProperties::SetXChgData( ExchangeData* _pData ) m_xCbxPreview->connect_toggled(LINK(this, TPGalleryThemeProperties, ClickPreviewHdl)); m_xCbbFileType->connect_changed(LINK(this, TPGalleryThemeProperties, SelectFileTypeHdl)); m_xLbxFound->connect_row_activated(LINK(this, TPGalleryThemeProperties, DClickFoundHdl)); - m_xLbxFound->connect_changed(LINK(this, TPGalleryThemeProperties, SelectFoundHdl)); + m_xLbxFound->connect_selection_changed(LINK(this, TPGalleryThemeProperties, SelectFoundHdl)); m_xLbxFound->append_text(CuiResId(RID_CUISTR_GALLERY_NOFILES)); m_xLbxFound->show(); diff --git a/cui/source/dialogs/dlgname.cxx b/cui/source/dialogs/dlgname.cxx index 8067e29bb7c7..5e0cdacbf599 100644 --- a/cui/source/dialogs/dlgname.cxx +++ b/cui/source/dialogs/dlgname.cxx @@ -160,7 +160,7 @@ SvxListDialog::SvxListDialog(weld::Window* pParent) m_xAddBtn->connect_clicked(LINK(this, SvxListDialog, AddHdl_Impl)); m_xRemoveBtn->connect_clicked(LINK(this, SvxListDialog, RemoveHdl_Impl)); m_xEditBtn->connect_clicked(LINK(this, SvxListDialog, EditHdl_Impl)); - m_xList->connect_changed(LINK(this, SvxListDialog, SelectHdl_Impl)); + m_xList->connect_selection_changed(LINK(this, SvxListDialog, SelectHdl_Impl)); m_xList->connect_row_activated(LINK(this, SvxListDialog, DblClickHdl_Impl)); SelectionChanged(); diff --git a/cui/source/dialogs/hangulhanjadlg.cxx b/cui/source/dialogs/hangulhanjadlg.cxx index 576055575751..66a3643e3b01 100644 --- a/cui/source/dialogs/hangulhanjadlg.cxx +++ b/cui/source/dialogs/hangulhanjadlg.cxx @@ -294,7 +294,8 @@ namespace svx , m_xListBox(rBuilder.weld_tree_view(u"listbox"_ustr)) { m_xValueSet->SetSelectHdl( LINK( this, SuggestionDisplay, SelectSuggestionValueSetHdl ) ); - m_xListBox->connect_changed( LINK( this, SuggestionDisplay, SelectSuggestionListBoxHdl ) ); + m_xListBox->connect_selection_changed( + LINK(this, SuggestionDisplay, SelectSuggestionListBoxHdl)); m_xValueSet->SetLineCount( LINE_CNT ); m_xValueSet->SetStyle( m_xValueSet->GetStyle() | WB_ITEMBORDER | WB_VSCROLL ); @@ -894,7 +895,8 @@ namespace svx m_xDictsLB->enable_toggle_buttons(weld::ColumnToggleType::Check); - m_xDictsLB->connect_changed( LINK( this, HangulHanjaOptionsDialog, DictsLB_SelectHdl ) ); + m_xDictsLB->connect_selection_changed( + LINK(this, HangulHanjaOptionsDialog, DictsLB_SelectHdl)); m_xOkPB->connect_clicked( LINK( this, HangulHanjaOptionsDialog, OkHdl ) ); m_xNewPB->connect_clicked( LINK( this, HangulHanjaOptionsDialog, NewDictHdl ) ); diff --git a/cui/source/dialogs/linkdlg.cxx b/cui/source/dialogs/linkdlg.cxx index e0ff180e1235..d78dd2bbc6d6 100644 --- a/cui/source/dialogs/linkdlg.cxx +++ b/cui/source/dialogs/linkdlg.cxx @@ -115,7 +115,7 @@ SvBaseLinksDlg::SvBaseLinksDlg(weld::Window * pParent, LinkManager* pMgr, bool b aUpdateIdle.SetInvokeHandler( LINK( this, SvBaseLinksDlg, UpdateWaitingHdl ) ); aUpdateIdle.SetPriority( TaskPriority::LOWEST ); - m_xTbLinks->connect_changed( LINK( this, SvBaseLinksDlg, LinksSelectHdl ) ); + m_xTbLinks->connect_selection_changed(LINK(this, SvBaseLinksDlg, LinksSelectHdl)); m_xTbLinks->connect_row_activated( LINK( this, SvBaseLinksDlg, LinksDoubleClickHdl ) ); m_xRbAutomatic->connect_toggled( LINK( this, SvBaseLinksDlg, ToggleHdl ) ); m_xRbManual->connect_toggled( LINK( this, SvBaseLinksDlg, ToggleHdl ) ); diff --git a/cui/source/dialogs/multipat.cxx b/cui/source/dialogs/multipat.cxx index abd8d56411fb..03ba230df8f1 100644 --- a/cui/source/dialogs/multipat.cxx +++ b/cui/source/dialogs/multipat.cxx @@ -196,7 +196,7 @@ SvxMultiPathDialog::SvxMultiPathDialog(weld::Window* pParent) m_xRadioLB->get_text_height() * 10); m_xRadioLB->enable_toggle_buttons(weld::ColumnToggleType::Radio); m_xRadioLB->connect_toggled(LINK(this, SvxMultiPathDialog, CheckHdl_Impl)); - m_xRadioLB->connect_changed(LINK(this, SvxMultiPathDialog, SelectHdl_Impl)); + m_xRadioLB->connect_selection_changed(LINK(this, SvxMultiPathDialog, SelectHdl_Impl)); m_xAddBtn->connect_clicked(LINK(this, SvxMultiPathDialog, AddHdl_Impl)); m_xDelBtn->connect_clicked(LINK(this, SvxMultiPathDialog, DelHdl_Impl)); @@ -213,7 +213,7 @@ SvxPathSelectDialog::SvxPathSelectDialog(weld::Window* pParent) m_xPathLB->set_size_request(m_xPathLB->get_approximate_digit_width() * 60, m_xPathLB->get_text_height() * 10); - m_xPathLB->connect_changed(LINK(this, SvxPathSelectDialog, SelectHdl_Impl)); + m_xPathLB->connect_selection_changed(LINK(this, SvxPathSelectDialog, SelectHdl_Impl)); m_xAddBtn->connect_clicked(LINK(this, SvxPathSelectDialog, AddHdl_Impl)); m_xDelBtn->connect_clicked(LINK(this, SvxPathSelectDialog, DelHdl_Impl)); diff --git a/cui/source/dialogs/pastedlg.cxx b/cui/source/dialogs/pastedlg.cxx index 91e91bf0dcec..4c5a010466f8 100644 --- a/cui/source/dialogs/pastedlg.cxx +++ b/cui/source/dialogs/pastedlg.cxx @@ -39,7 +39,7 @@ SvPasteObjectDialog::SvPasteObjectDialog(weld::Window* pParent) m_xLbInsertList->get_height_rows(6)); m_xOKButton->set_sensitive(false); - ObjectLB().connect_changed(LINK(this, SvPasteObjectDialog, SelectHdl)); + ObjectLB().connect_selection_changed(LINK(this, SvPasteObjectDialog, SelectHdl)); ObjectLB().connect_row_activated(LINK( this, SvPasteObjectDialog, DoubleClickHdl)); } diff --git a/cui/source/dialogs/scriptdlg.cxx b/cui/source/dialogs/scriptdlg.cxx index bdde6fbeaef1..c67be62cc6b8 100644 --- a/cui/source/dialogs/scriptdlg.cxx +++ b/cui/source/dialogs/scriptdlg.cxx @@ -399,7 +399,7 @@ SvxScriptOrgDialog::SvxScriptOrgDialog(weld::Window* pParent, OUString language) m_xScriptsBox->set_size_request(m_xScriptsBox->get_approximate_digit_width() * 45, m_xScriptsBox->get_height_rows(12)); - m_xScriptsBox->connect_changed( LINK( this, SvxScriptOrgDialog, ScriptSelectHdl ) ); + m_xScriptsBox->connect_selection_changed(LINK(this, SvxScriptOrgDialog, ScriptSelectHdl)); m_xScriptsBox->connect_expanding(LINK( this, SvxScriptOrgDialog, ExpandingHdl ) ); m_xRunButton->connect_clicked( LINK( this, SvxScriptOrgDialog, ButtonHdl ) ); m_xCloseButton->connect_clicked( LINK( this, SvxScriptOrgDialog, ButtonHdl ) ); diff --git a/cui/source/dialogs/thesdlg.cxx b/cui/source/dialogs/thesdlg.cxx index d1c284b65b82..07eef25be0dd 100644 --- a/cui/source/dialogs/thesdlg.cxx +++ b/cui/source/dialogs/thesdlg.cxx @@ -259,7 +259,8 @@ SvxThesaurusDialog::SvxThesaurusDialog( m_xWordCB->set_entry_completion(false); m_xWordCB->connect_changed( LINK( this, SvxThesaurusDialog, WordSelectHdl_Impl ) ); m_xLangLB->connect_changed( LINK( this, SvxThesaurusDialog, LanguageHdl_Impl ) ); - m_xAlternativesCT->connect_changed( LINK( this, SvxThesaurusDialog, AlternativesSelectHdl_Impl )); + m_xAlternativesCT->connect_selection_changed( + LINK(this, SvxThesaurusDialog, AlternativesSelectHdl_Impl)); m_xAlternativesCT->connect_row_activated( LINK( this, SvxThesaurusDialog, AlternativesDoubleClickHdl_Impl )); m_xAlternativesCT->connect_key_press(LINK(this, SvxThesaurusDialog, KeyInputHdl)); diff --git a/cui/source/inc/MacroManagerDialog.hxx b/cui/source/inc/MacroManagerDialog.hxx index 25b24c1b6c8e..757728386e59 100644 --- a/cui/source/inc/MacroManagerDialog.hxx +++ b/cui/source/inc/MacroManagerDialog.hxx @@ -71,7 +71,7 @@ public: void connect_changed(const Link& rLink) { - m_xTreeView->connect_changed(rLink); + m_xTreeView->connect_selection_changed(rLink); } void connect_popup_menu(const Link& rLink) { @@ -149,7 +149,7 @@ public: void connect_changed(const Link& rLink) { - m_xTreeView->connect_changed(rLink); + m_xTreeView->connect_selection_changed(rLink); } weld::TreeView& get_widget() { return *m_xTreeView; } void ClearAll(); diff --git a/cui/source/inc/cfgutil.hxx b/cui/source/inc/cfgutil.hxx index ce409c98e72d..0dd4e1f86a58 100644 --- a/cui/source/inc/cfgutil.hxx +++ b/cui/source/inc/cfgutil.hxx @@ -116,7 +116,10 @@ class CuiConfigFunctionListBox public: CuiConfigFunctionListBox(std::unique_ptr xTreeView); void set_sensitive(bool bSensitive) { m_xTreeView->set_sensitive(bSensitive); } - void connect_changed(const Link& rLink) { m_xTreeView->connect_changed(rLink); } + void connect_changed(const Link& rLink) + { + m_xTreeView->connect_selection_changed(rLink); + } void connect_popup_menu(const Link& rLink) { m_xTreeView->connect_popup_menu(rLink); } void connect_row_activated(const Link& rLink) { m_xTreeView->connect_row_activated(rLink); } void freeze() { m_xTreeView->freeze(); } @@ -210,7 +213,10 @@ class CuiConfigGroupListBox public: CuiConfigGroupListBox(std::unique_ptr xTreeView); void set_sensitive(bool bSensitive) { m_xTreeView->set_sensitive(bSensitive); } - void connect_changed(const Link& rLink) { m_xTreeView->connect_changed(rLink); } + void connect_changed(const Link& rLink) + { + m_xTreeView->connect_selection_changed(rLink); + } void set_size_request(int nWidth, int nHeight) { m_xTreeView->set_size_request(nWidth, nHeight); } weld::TreeView& get_widget() { return *m_xTreeView; } ~CuiConfigGroupListBox(); diff --git a/cui/source/inc/cuitabarea.hxx b/cui/source/inc/cuitabarea.hxx index 7021a7aa7847..30feba7fe85f 100644 --- a/cui/source/inc/cuitabarea.hxx +++ b/cui/source/inc/cuitabarea.hxx @@ -551,6 +551,8 @@ private: void CalculateBitmapPresetSize(); sal_Int32 SearchBitmapList(std::u16string_view rBitmapName); sal_Int32 SearchBitmapList(const GraphicObject& rGraphicObject); + tools::Long AddBitmap(const GraphicObject& rGraphicObject, const OUString& rName, + bool bOnlyForThisDocument = false); public: SvxBitmapTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rInAttrs); diff --git a/cui/source/options/connpooloptions.cxx b/cui/source/options/connpooloptions.cxx index 557f6cae0fab..2fe1a6982bc5 100644 --- a/cui/source/options/connpooloptions.cxx +++ b/cui/source/options/connpooloptions.cxx @@ -79,7 +79,8 @@ namespace offapp m_xEnablePooling->connect_toggled( LINK(this, ConnectionPoolOptionsPage, OnEnabledDisabled) ); m_xDriverPoolingEnabled->connect_toggled( LINK(this, ConnectionPoolOptionsPage, OnEnabledDisabled) ); - m_xDriverList->connect_changed(LINK(this, ConnectionPoolOptionsPage, OnDriverRowChanged)); + m_xDriverList->connect_selection_changed( + LINK(this, ConnectionPoolOptionsPage, OnDriverRowChanged)); m_xTimeout->connect_value_changed(LINK(this, ConnectionPoolOptionsPage, OnSpinValueChanged)); } diff --git a/cui/source/options/dbregister.cxx b/cui/source/options/dbregister.cxx index b345614fa857..45c8398d23a6 100644 --- a/cui/source/options/dbregister.cxx +++ b/cui/source/options/dbregister.cxx @@ -112,7 +112,7 @@ DbRegistrationOptionsPage::DbRegistrationOptionsPage(weld::Container* pPage, wel m_xPathBox->make_sorted(); m_xPathBox->connect_row_activated( LINK( this, DbRegistrationOptionsPage, PathBoxDoubleClickHdl ) ); - m_xPathBox->connect_changed( LINK( this, DbRegistrationOptionsPage, PathSelect_Impl ) ); + m_xPathBox->connect_selection_changed(LINK(this, DbRegistrationOptionsPage, PathSelect_Impl)); m_xPathBox->set_help_id(HID_DBPATH_CTL_PATH); } diff --git a/cui/source/options/fontsubs.cxx b/cui/source/options/fontsubs.cxx index 2f9d44c0b497..ad7e4e8d8011 100644 --- a/cui/source/options/fontsubs.cxx +++ b/cui/source/options/fontsubs.cxx @@ -72,7 +72,7 @@ SvxFontSubstTabPage::SvxFontSubstTabPage(weld::Container* pPage, weld::DialogCon Link aLink2(LINK(this, SvxFontSubstTabPage, SelectComboBoxHdl)); Link aClickLink(LINK(this, SvxFontSubstTabPage, ClickHdl)); - m_xCheckLB->connect_changed(LINK(this, SvxFontSubstTabPage, TreeListBoxSelectHdl)); + m_xCheckLB->connect_selection_changed(LINK(this, SvxFontSubstTabPage, TreeListBoxSelectHdl)); m_xCheckLB->connect_column_clicked(LINK(this, SvxFontSubstTabPage, HeaderBarClick)); m_xUseTableCB->connect_toggled(LINK(this, SvxFontSubstTabPage, ToggleHdl)); m_xFont1CB->connect_changed(aLink2); diff --git a/cui/source/options/optdict.cxx b/cui/source/options/optdict.cxx index f383280e5bc9..04dbd2ff801b 100644 --- a/cui/source/options/optdict.cxx +++ b/cui/source/options/optdict.cxx @@ -243,8 +243,8 @@ SvxEditDictionaryDialog::SvxEditDictionaryDialog(weld::Window* pParent, std::u16 if (LinguMgr::GetDictionaryList().is()) aDics = LinguMgr::GetDictionaryList()->getDictionaries(); - m_xSingleColumnLB->connect_changed(LINK(this, SvxEditDictionaryDialog, SelectHdl)); - m_xDoubleColumnLB->connect_changed(LINK(this, SvxEditDictionaryDialog, SelectHdl)); + m_xSingleColumnLB->connect_selection_changed(LINK(this, SvxEditDictionaryDialog, SelectHdl)); + m_xDoubleColumnLB->connect_selection_changed(LINK(this, SvxEditDictionaryDialog, SelectHdl)); std::vector aWidths { diff --git a/cui/source/options/optjava.cxx b/cui/source/options/optjava.cxx index e0124974ebfa..4a4ea15ff695 100644 --- a/cui/source/options/optjava.cxx +++ b/cui/source/options/optjava.cxx @@ -89,7 +89,7 @@ SvxJavaOptionsPage::SvxJavaOptionsPage(weld::Container* pPage, weld::DialogContr m_xJavaList->enable_toggle_buttons(weld::ColumnToggleType::Radio); m_xJavaList->connect_toggled( LINK( this, SvxJavaOptionsPage, CheckHdl_Impl ) ); - m_xJavaList->connect_changed( LINK( this, SvxJavaOptionsPage, SelectHdl_Impl ) ); + m_xJavaList->connect_selection_changed(LINK(this, SvxJavaOptionsPage, SelectHdl_Impl)); std::vector aWidths { @@ -653,7 +653,7 @@ SvxJavaParameterDlg::SvxJavaParameterDlg(weld::Window* pParent) m_xAssignBtn->connect_clicked( LINK( this, SvxJavaParameterDlg, AssignHdl_Impl ) ); m_xRemoveBtn->connect_clicked( LINK( this, SvxJavaParameterDlg, RemoveHdl_Impl ) ); m_xEditBtn->connect_clicked( LINK( this, SvxJavaParameterDlg, EditHdl_Impl ) ); - m_xAssignedList->connect_changed( LINK( this, SvxJavaParameterDlg, SelectHdl_Impl ) ); + m_xAssignedList->connect_selection_changed(LINK(this, SvxJavaParameterDlg, SelectHdl_Impl)); m_xAssignedList->connect_row_activated( LINK( this, SvxJavaParameterDlg, DblClickHdl_Impl ) ); ModifyHdl_Impl(*m_xParameterEdit); @@ -814,7 +814,7 @@ SvxJavaClassPathDlg::SvxJavaClassPathDlg(weld::Window* pParent) m_xAddArchiveBtn->connect_clicked( LINK( this, SvxJavaClassPathDlg, AddArchiveHdl_Impl ) ); m_xAddPathBtn->connect_clicked( LINK( this, SvxJavaClassPathDlg, AddPathHdl_Impl ) ); m_xRemoveBtn->connect_clicked( LINK( this, SvxJavaClassPathDlg, RemoveHdl_Impl ) ); - m_xPathList->connect_changed( LINK( this, SvxJavaClassPathDlg, SelectHdl_Impl ) ); + m_xPathList->connect_selection_changed(LINK(this, SvxJavaClassPathDlg, SelectHdl_Impl)); // set initial focus to path list m_xPathList->grab_focus(); diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx index c07ab32a1d85..2d6e77ffed07 100644 --- a/cui/source/options/optlingu.cxx +++ b/cui/source/options/optlingu.cxx @@ -815,21 +815,21 @@ SvxLinguTabPage::SvxLinguTabPage(weld::Container* pPage, weld::DialogController* m_xLinguDicsCLB->enable_toggle_buttons(weld::ColumnToggleType::Check); m_xLinguOptionsCLB->enable_toggle_buttons(weld::ColumnToggleType::Check); - m_xLinguModulesCLB->connect_changed( LINK( this, SvxLinguTabPage, SelectHdl_Impl )); + m_xLinguModulesCLB->connect_selection_changed(LINK(this, SvxLinguTabPage, SelectHdl_Impl)); m_xLinguModulesCLB->connect_row_activated(LINK(this, SvxLinguTabPage, BoxDoubleClickHdl_Impl)); m_xLinguModulesCLB->connect_toggled(LINK(this, SvxLinguTabPage, ModulesBoxCheckButtonHdl_Impl)); m_xLinguModulesEditPB->connect_clicked( LINK( this, SvxLinguTabPage, ClickHdl_Impl )); m_xLinguOptionsEditPB->connect_clicked( LINK( this, SvxLinguTabPage, ClickHdl_Impl )); - m_xLinguDicsCLB->connect_changed( LINK( this, SvxLinguTabPage, SelectHdl_Impl )); + m_xLinguDicsCLB->connect_selection_changed(LINK(this, SvxLinguTabPage, SelectHdl_Impl)); m_xLinguDicsCLB->connect_toggled(LINK(this, SvxLinguTabPage, DicsBoxCheckButtonHdl_Impl)); m_xLinguDicsNewPB->connect_clicked( LINK( this, SvxLinguTabPage, ClickHdl_Impl )); m_xLinguDicsEditPB->connect_clicked( LINK( this, SvxLinguTabPage, ClickHdl_Impl )); m_xLinguDicsDelPB->connect_clicked( LINK( this, SvxLinguTabPage, ClickHdl_Impl )); - m_xLinguOptionsCLB->connect_changed( LINK( this, SvxLinguTabPage, SelectHdl_Impl )); + m_xLinguOptionsCLB->connect_selection_changed(LINK(this, SvxLinguTabPage, SelectHdl_Impl)); m_xLinguOptionsCLB->connect_row_activated(LINK(this, SvxLinguTabPage, BoxDoubleClickHdl_Impl)); m_xMoreDictsLink->connect_activate_link(LINK(this, SvxLinguTabPage, OnLinkClick)); @@ -1579,7 +1579,7 @@ SvxEditModulesDlg::SvxEditModulesDlg(weld::Window* pParent, SvxLinguData_Impl& r pDefaultLinguData.reset( new SvxLinguData_Impl( rLinguData ) ); - m_xModulesCLB->connect_changed( LINK( this, SvxEditModulesDlg, SelectHdl_Impl )); + m_xModulesCLB->connect_selection_changed(LINK(this, SvxEditModulesDlg, SelectHdl_Impl)); m_xModulesCLB->connect_toggled(LINK(this, SvxEditModulesDlg, BoxCheckButtonHdl_Impl)); m_xClosePB->connect_clicked( LINK( this, SvxEditModulesDlg, ClickHdl_Impl )); diff --git a/cui/source/options/optpath.cxx b/cui/source/options/optpath.cxx index 97f9c5535cb8..29c554fe8ffb 100644 --- a/cui/source/options/optpath.cxx +++ b/cui/source/options/optpath.cxx @@ -192,7 +192,7 @@ SvxPathTabPage::SvxPathTabPage(weld::Container* pPage, weld::DialogController* p m_xPathBox->connect_row_activated( LINK( this, SvxPathTabPage, DoubleClickPathHdl_Impl ) ); m_xPathBox->connect_column_clicked(LINK(this, SvxPathTabPage, HeaderBarClick)); - m_xPathBox->connect_changed( LINK( this, SvxPathTabPage, PathSelect_Impl ) ); + m_xPathBox->connect_selection_changed(LINK(this, SvxPathTabPage, PathSelect_Impl)); m_xPathBox->set_selection_mode(SelectionMode::Multiple); xDialogListener->SetDialogClosedLink( LINK( this, SvxPathTabPage, DialogClosedHdl ) ); diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx index f5d6a9eaf040..32dd79d90a5c 100644 --- a/cui/source/options/treeopt.cxx +++ b/cui/source/options/treeopt.cxx @@ -481,7 +481,7 @@ OfaTreeOptionsDialog::OfaTreeOptionsDialog(weld::Window* pParent, bool fromExten // Init tree and handler xTreeLB->set_help_id(HID_OFADLG_TREELISTBOX); - xTreeLB->connect_changed(LINK(this, OfaTreeOptionsDialog, ShowPageHdl_Impl)); + xTreeLB->connect_selection_changed(LINK(this, OfaTreeOptionsDialog, ShowPageHdl_Impl)); xBackPB->connect_clicked(LINK(this, OfaTreeOptionsDialog, BackHdl_Impl)); xApplyPB->connect_clicked(LINK(this, OfaTreeOptionsDialog, ApplyHdl_Impl)); xOkPB->connect_clicked(LINK(this, OfaTreeOptionsDialog, ApplyHdl_Impl)); diff --git a/cui/source/options/tsaurls.cxx b/cui/source/options/tsaurls.cxx index 925dafbccf21..81a3130852cd 100644 --- a/cui/source/options/tsaurls.cxx +++ b/cui/source/options/tsaurls.cxx @@ -31,7 +31,7 @@ TSAURLsDialog::TSAURLsDialog(weld::Window* pParent) m_xAddBtn->connect_clicked(LINK(this, TSAURLsDialog, AddHdl_Impl)); m_xDeleteBtn->connect_clicked(LINK(this, TSAURLsDialog, DeleteHdl_Impl)); m_xOKBtn->connect_clicked(LINK(this, TSAURLsDialog, OKHdl_Impl)); - m_xURLListBox->connect_changed(LINK(this, TSAURLsDialog, SelectHdl)); + m_xURLListBox->connect_selection_changed(LINK(this, TSAURLsDialog, SelectHdl)); try { diff --git a/cui/source/options/webconninfo.cxx b/cui/source/options/webconninfo.cxx index 4ad32400ebe5..bb55e8dcfa49 100644 --- a/cui/source/options/webconninfo.cxx +++ b/cui/source/options/webconninfo.cxx @@ -57,7 +57,8 @@ WebConnectionInfoDialog::WebConnectionInfoDialog(weld::Window* pParent) m_xRemoveBtn->connect_clicked( LINK( this, WebConnectionInfoDialog, RemovePasswordHdl ) ); m_xRemoveAllBtn->connect_clicked( LINK( this, WebConnectionInfoDialog, RemoveAllPasswordsHdl ) ); m_xChangeBtn->connect_clicked( LINK( this, WebConnectionInfoDialog, ChangePasswordHdl ) ); - m_xPasswordsLB->connect_changed( LINK( this, WebConnectionInfoDialog, EntrySelectedHdl ) ); + m_xPasswordsLB->connect_selection_changed( + LINK(this, WebConnectionInfoDialog, EntrySelectedHdl)); m_xRemoveBtn->set_sensitive( false ); m_xChangeBtn->set_sensitive( false ); diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx index ba3998445cf5..31e77373a644 100644 --- a/cui/source/tabpages/autocdlg.cxx +++ b/cui/source/tabpages/autocdlg.cxx @@ -382,7 +382,7 @@ OfaSwAutoFmtOptionsPage::OfaSwAutoFmtOptionsPage(weld::Container* pPage, weld::D , m_xCheckLB(m_xBuilder->weld_tree_view(u"list"_ustr)) , m_xEditPB(m_xBuilder->weld_button(u"edit"_ustr)) { - m_xCheckLB->connect_changed(LINK(this, OfaSwAutoFmtOptionsPage, SelectHdl)); + m_xCheckLB->connect_selection_changed(LINK(this, OfaSwAutoFmtOptionsPage, SelectHdl)); m_xCheckLB->connect_row_activated(LINK(this, OfaSwAutoFmtOptionsPage, DoubleClickEditHdl)); std::vector aWidths @@ -728,7 +728,7 @@ OfaAutocorrReplacePage::OfaAutocorrReplacePage(weld::Container* pPage, weld::Dia m_aReplaceFixedWidths.push_back(nColWidth); m_aReplaceFixedWidths.push_back(nColWidth); - m_xReplaceTLB->connect_changed( LINK(this, OfaAutocorrReplacePage, SelectHdl) ); + m_xReplaceTLB->connect_selection_changed(LINK(this, OfaAutocorrReplacePage, SelectHdl)); m_xNewReplacePB->connect_clicked( LINK(this, OfaAutocorrReplacePage, NewDelButtonHdl) ); m_xDeleteReplacePB->connect_clicked( LINK(this, OfaAutocorrReplacePage, NewDelButtonHdl) ); m_xShortED->connect_changed( LINK(this, OfaAutocorrReplacePage, ModifyHdl) ); @@ -1241,8 +1241,8 @@ OfaAutocorrExceptPage::OfaAutocorrExceptPage(weld::Container* pPage, weld::Dialo m_xNewDoublePB->connect_clicked(LINK(this, OfaAutocorrExceptPage, NewDelButtonHdl)); m_xDelDoublePB->connect_clicked(LINK(this, OfaAutocorrExceptPage, NewDelButtonHdl)); - m_xAbbrevLB->connect_changed(LINK(this, OfaAutocorrExceptPage, SelectHdl)); - m_xDoubleCapsLB->connect_changed(LINK(this, OfaAutocorrExceptPage, SelectHdl)); + m_xAbbrevLB->connect_selection_changed(LINK(this, OfaAutocorrExceptPage, SelectHdl)); + m_xDoubleCapsLB->connect_selection_changed(LINK(this, OfaAutocorrExceptPage, SelectHdl)); m_xAbbrevED->connect_changed(LINK(this, OfaAutocorrExceptPage, ModifyHdl)); m_xDoubleCapsED->connect_changed(LINK(this, OfaAutocorrExceptPage, ModifyHdl)); @@ -2180,7 +2180,7 @@ OfaSmartTagOptionsTabPage::OfaSmartTagOptionsTabPage(weld::Container* pPage, wel // set the handlers: m_xMainCB->connect_toggled(LINK(this, OfaSmartTagOptionsTabPage, CheckHdl)); m_xPropertiesPB->connect_clicked(LINK(this, OfaSmartTagOptionsTabPage, ClickHdl)); - m_xSmartTagTypesLB->connect_changed(LINK(this, OfaSmartTagOptionsTabPage, SelectHdl)); + m_xSmartTagTypesLB->connect_selection_changed(LINK(this, OfaSmartTagOptionsTabPage, SelectHdl)); } OfaSmartTagOptionsTabPage::~OfaSmartTagOptionsTabPage() diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx index a8d4f716ca3b..1a8a6630aae1 100644 --- a/cui/source/tabpages/chardlg.cxx +++ b/cui/source/tabpages/chardlg.cxx @@ -3078,8 +3078,8 @@ void SvxCharTwoLinesPage::Initialize() m_xTwoLinesBtn->connect_toggled(LINK(this, SvxCharTwoLinesPage, TwoLinesHdl_Impl)); Link aLink = LINK(this, SvxCharTwoLinesPage, CharacterMapHdl_Impl); - m_xStartBracketLB->connect_changed(aLink); - m_xEndBracketLB->connect_changed(aLink); + m_xStartBracketLB->connect_selection_changed(aLink); + m_xEndBracketLB->connect_selection_changed(aLink); SvxFont& rFont = GetPreviewFont(); SvxFont& rCJKFont = GetPreviewCJKFont(); diff --git a/cui/source/tabpages/macroass.cxx b/cui/source/tabpages/macroass.cxx index c0442e7fceaa..afbacb30ad54 100644 --- a/cui/source/tabpages/macroass.cxx +++ b/cui/source/tabpages/macroass.cxx @@ -332,7 +332,7 @@ void SfxMacroTabPage::InitAndSetHandler() mpImpl->m_xAssignPB->connect_clicked(LINK(this, SfxMacroTabPage, AssignDeleteClickHdl_Impl)); rListBox.connect_row_activated(aLnk); - rListBox.connect_changed(LINK(this, SfxMacroTabPage, SelectEvent_Impl)); + rListBox.connect_selection_changed(LINK(this, SfxMacroTabPage, SelectEvent_Impl)); mpImpl->m_xGroupLB->connect_changed(LINK(this, SfxMacroTabPage, SelectGroup_Impl)); mpImpl->m_xMacroLB->connect_changed(LINK(this, SfxMacroTabPage, SelectMacro_Impl)); diff --git a/cui/source/tabpages/numfmt.cxx b/cui/source/tabpages/numfmt.cxx index ab05111e7b95..059c148713c4 100644 --- a/cui/source/tabpages/numfmt.cxx +++ b/cui/source/tabpages/numfmt.cxx @@ -275,9 +275,9 @@ void SvxNumberFormatTabPage::Init_Impl() Link aLink2 = LINK(this, SvxNumberFormatTabPage, SelFormatTreeListBoxHdl_Impl); Link aLink3 = LINK(this, SvxNumberFormatTabPage, SelFormatListBoxHdl_Impl); - m_xLbCategory->connect_changed(aLink2); + m_xLbCategory->connect_selection_changed(aLink2); m_xLbCategory->connect_focus_in(LINK(this, SvxNumberFormatTabPage, LostFocusHdl_Impl)); - m_xLbFormat->connect_changed(aLink2); + m_xLbFormat->connect_selection_changed(aLink2); m_xLbFormat->connect_focus_in(LINK(this, SvxNumberFormatTabPage, LostFocusHdl_Impl)); m_xLbLanguage->connect_changed(aLink3); m_xLbLanguage->connect_focus_in(LINK(this, SvxNumberFormatTabPage, LostFocusHdl_Impl)); diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx index c2309176784f..2dccf21d04e2 100644 --- a/cui/source/tabpages/numpages.cxx +++ b/cui/source/tabpages/numpages.cxx @@ -1170,7 +1170,7 @@ SvxNumOptionsTabPage::SvxNumOptionsTabPage(weld::Container* pPage, weld::DialogC m_xBitmapMB->connect_selected(LINK(this, SvxNumOptionsTabPage, GraphicHdl_Impl)); m_xBitmapMB->connect_toggled(LINK(this, SvxNumOptionsTabPage, PopupActivateHdl_Impl)); m_xLevelLB->set_selection_mode(SelectionMode::Multiple); - m_xLevelLB->connect_changed(LINK(this, SvxNumOptionsTabPage, LevelHdl_Impl)); + m_xLevelLB->connect_selection_changed(LINK(this, SvxNumOptionsTabPage, LevelHdl_Impl)); m_xCharFmtLB->connect_changed(LINK(this, SvxNumOptionsTabPage, CharFmtHdl_Impl)); m_xWidthMF->connect_value_changed(LINK(this, SvxNumOptionsTabPage, SizeHdl_Impl)); m_xHeightMF->connect_value_changed(LINK(this, SvxNumOptionsTabPage, SizeHdl_Impl)); @@ -2328,7 +2328,7 @@ SvxNumPositionTabPage::SvxNumPositionTabPage(weld::Container* pPage, weld::Dialo m_xIndentAtMF->connect_value_changed(LINK(this, SvxNumPositionTabPage, IndentAtHdl_Impl)); m_xLevelLB->set_selection_mode(SelectionMode::Multiple); - m_xLevelLB->connect_changed(LINK(this, SvxNumPositionTabPage, LevelHdl_Impl)); + m_xLevelLB->connect_selection_changed(LINK(this, SvxNumPositionTabPage, LevelHdl_Impl)); m_xRelativeCB->connect_toggled(LINK(this, SvxNumPositionTabPage, RelativeHdl_Impl)); m_xStandardPB->connect_clicked(LINK(this, SvxNumPositionTabPage, StandardHdl_Impl)); diff --git a/cui/source/tabpages/tpbitmap.cxx b/cui/source/tabpages/tpbitmap.cxx index 9e016879b4cb..a4154aa344c8 100644 --- a/cui/source/tabpages/tpbitmap.cxx +++ b/cui/source/tabpages/tpbitmap.cxx @@ -37,8 +37,10 @@ #include #include #include +#include #include #include +#include #include #include #include @@ -167,9 +169,13 @@ void SvxBitmapTabPage::ActivatePage( const SfxItemSet& rSet ) sal_Int32 nPos( 0 ); if ( !aItem.isPattern() ) { - nPos = SearchBitmapList( aItem.GetGraphicObject() ); - if (nPos == -1) + const GraphicObject& aGraphicObj = aItem.GetGraphicObject(); + if (aGraphicObj.GetType() != GraphicType::Bitmap) return; + + nPos = SearchBitmapList(aGraphicObj); + if (nPos == -1) + nPos = AddBitmap(aGraphicObj, aItem.GetName(), /*OnlyForThisDocument=*/true); } else { @@ -781,18 +787,7 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickImportHdl, weld::Button&, void) pDlg.disposeAndClear(); if( !nError ) - { - m_pBitmapList->Insert(std::make_unique(aGraphic, aName), nCount); - - sal_Int32 nId = m_xBitmapLB->GetItemId( nCount - 1 ); - BitmapEx aBitmap = m_pBitmapList->GetBitmapForPreview( nCount, m_xBitmapLB->GetIconSize() ); - - m_xBitmapLB->InsertItem( nId + 1, Image(aBitmap), aName ); - m_xBitmapLB->SelectItem( nId + 1 ); - m_nBitmapListState |= ChangeType::MODIFIED; - - ModifyBitmapHdl(m_xBitmapLB.get()); - } + AddBitmap(aGraphic, aName); } else { @@ -836,4 +831,31 @@ sal_Int32 SvxBitmapTabPage::SearchBitmapList(std::u16string_view rBitmapName) return nPos; } +tools::Long SvxBitmapTabPage::AddBitmap(const GraphicObject& rGraphicObject, const OUString& rName, + bool bOnlyForThisDocument) +{ + const tools::Long nLastPos = m_pBitmapList->Count(); + + auto xBitmapEntry = std::make_unique(rGraphicObject, rName); + if (bOnlyForThisDocument) + xBitmapEntry->SetSavingAllowed(false); + m_pBitmapList->Insert(std::move(xBitmapEntry), nLastPos); + + BitmapEx aBitmap = m_pBitmapList->GetBitmapForPreview(nLastPos, m_xBitmapLB->GetIconSize()); + + const sal_uInt16 nHighestId = m_xBitmapLB->GetItemId(nLastPos - 1); + m_xBitmapLB->InsertItem(nHighestId + 1, Image(aBitmap), rName); + m_xBitmapLB->SelectItem(nHighestId + 1); + m_nBitmapListState |= ChangeType::MODIFIED; + + ModifyBitmapHdl(m_xBitmapLB.get()); + + // inform sidebar, etc. that the list of images has changed. + SfxViewFrame* pViewFrame = SfxViewFrame::Current(); + if (pViewFrame) + pViewFrame->GetBindings().Invalidate(SID_ATTR_PAGE_BITMAP, /*ClearCacheStatus=*/true); + + return nLastPos; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/uiconfig/ui/numberingpositionpage.ui b/cui/uiconfig/ui/numberingpositionpage.ui index 8b6cb954bccb..566c4a52f251 100644 --- a/cui/uiconfig/ui/numberingpositionpage.ui +++ b/cui/uiconfig/ui/numberingpositionpage.ui @@ -203,7 +203,7 @@ 2 - Enter the distance from the left page margin to the start of all lines in the numbered paragraph that follow the first line. + Enter the distance from the left page margin at which the numbering symbol will be aligned. @@ -275,7 +275,7 @@ - Enter the distance from the left page margin at which the numbering symbol will be aligned. + Enter the distance from the left page margin to the start of all lines in the numbered paragraph that follow the first line. diff --git a/dbaccess/source/ui/app/AppDetailView.cxx b/dbaccess/source/ui/app/AppDetailView.cxx index a9613e1b4b36..68b47ae89539 100644 --- a/dbaccess/source/ui/app/AppDetailView.cxx +++ b/dbaccess/source/ui/app/AppDetailView.cxx @@ -118,7 +118,7 @@ OTasksWindow::OTasksWindow(weld::Container* pParent, OApplicationDetailView* pDe m_xTreeView->set_help_id(HID_APP_CREATION_LIST); m_xTreeView->connect_row_activated(LINK(this, OTasksWindow, onSelected)); - m_xTreeView->connect_changed(LINK(this, OTasksWindow, OnEntrySelectHdl)); + m_xTreeView->connect_selection_changed(LINK(this, OTasksWindow, OnEntrySelectHdl)); m_xTreeView->connect_focus_in(LINK(this, OTasksWindow, FocusInHdl)); m_xTreeView->connect_focus_out(LINK(this, OTasksWindow, FocusOutHdl)); // an arbitrary small size it's allowed to shrink to diff --git a/dbaccess/source/ui/control/dbtreelistbox.cxx b/dbaccess/source/ui/control/dbtreelistbox.cxx index c0ebd91ef87a..92e6f2e7d659 100644 --- a/dbaccess/source/ui/control/dbtreelistbox.cxx +++ b/dbaccess/source/ui/control/dbtreelistbox.cxx @@ -113,7 +113,7 @@ TreeListBox::TreeListBox(std::unique_ptr xTreeView, bool bSQLTyp , m_aTimer("dbaccess TreeListBox m_aTimer") { m_xTreeView->connect_key_press(LINK(this, TreeListBox, KeyInputHdl)); - m_xTreeView->connect_changed(LINK(this, TreeListBox, SelectHdl)); + m_xTreeView->connect_selection_changed(LINK(this, TreeListBox, SelectHdl)); m_xTreeView->connect_query_tooltip(LINK(this, TreeListBox, QueryTooltipHdl)); m_xTreeView->connect_popup_menu(LINK(this, TreeListBox, CommandHdl)); diff --git a/dbaccess/source/ui/dlg/adtabdlg.cxx b/dbaccess/source/ui/dlg/adtabdlg.cxx index 9c06085cb2e0..ade72252fda1 100644 --- a/dbaccess/source/ui/dlg/adtabdlg.cxx +++ b/dbaccess/source/ui/dlg/adtabdlg.cxx @@ -344,9 +344,9 @@ OAddTableDlg::OAddTableDlg(weld::Window* pParent, IAddTableDialogContext& _rCont m_xAddButton->connect_clicked( LINK( this, OAddTableDlg, AddClickHdl ) ); m_xCloseButton->connect_clicked( LINK( this, OAddTableDlg, CloseClickHdl ) ); rTableList.connect_row_activated( LINK( this, OAddTableDlg, TableListDoubleClickHdl ) ); - rTableList.connect_changed( LINK( this, OAddTableDlg, TableListSelectHdl ) ); + rTableList.connect_selection_changed(LINK(this, OAddTableDlg, TableListSelectHdl)); m_xQueryList->connect_row_activated( LINK( this, OAddTableDlg, TableListDoubleClickHdl ) ); - m_xQueryList->connect_changed( LINK( this, OAddTableDlg, TableListSelectHdl ) ); + m_xQueryList->connect_selection_changed(LINK(this, OAddTableDlg, TableListSelectHdl)); rTableList.set_selection_mode(SelectionMode::Single); m_xTableList->SuppressEmptyFolders(); diff --git a/dbaccess/source/ui/dlg/dbfindex.cxx b/dbaccess/source/ui/dlg/dbfindex.cxx index bb6f685ce0c1..77f974648369 100644 --- a/dbaccess/source/ui/dlg/dbfindex.cxx +++ b/dbaccess/source/ui/dlg/dbfindex.cxx @@ -65,8 +65,10 @@ ODbaseIndexDialog::ODbaseIndexDialog(weld::Window * pParent, OUString aDataSrcNa m_xRemoveAll->connect_clicked( LINK(this, ODbaseIndexDialog, RemoveAllClickHdl) ); m_xPB_OK->connect_clicked( LINK(this, ODbaseIndexDialog, OKClickHdl) ); - m_xLB_FreeIndexes->connect_changed( LINK(this, ODbaseIndexDialog, OnListEntrySelected) ); - m_xLB_TableIndexes->connect_changed( LINK(this, ODbaseIndexDialog, OnListEntrySelected) ); + m_xLB_FreeIndexes->connect_selection_changed( + LINK(this, ODbaseIndexDialog, OnListEntrySelected)); + m_xLB_TableIndexes->connect_selection_changed( + LINK(this, ODbaseIndexDialog, OnListEntrySelected)); Init(); SetCtrls(); diff --git a/dbaccess/source/ui/dlg/indexdialog.cxx b/dbaccess/source/ui/dlg/indexdialog.cxx index 738b9c07df3b..160eafa192ec 100644 --- a/dbaccess/source/ui/dlg/indexdialog.cxx +++ b/dbaccess/source/ui/dlg/indexdialog.cxx @@ -92,7 +92,7 @@ namespace dbaui m_xActions->connect_clicked(LINK(this, DbaIndexDialog, OnIndexAction)); - m_xIndexList->connect_changed(LINK(this, DbaIndexDialog, OnIndexSelected)); + m_xIndexList->connect_selection_changed(LINK(this, DbaIndexDialog, OnIndexSelected)); m_xIndexList->connect_editing(LINK(this, DbaIndexDialog, OnEntryEditing), LINK(this, DbaIndexDialog, OnEntryEdited)); diff --git a/dbaccess/source/ui/dlg/paramdialog.cxx b/dbaccess/source/ui/dlg/paramdialog.cxx index ad1c23baa9f4..299ab8454594 100644 --- a/dbaccess/source/ui/dlg/paramdialog.cxx +++ b/dbaccess/source/ui/dlg/paramdialog.cxx @@ -109,7 +109,8 @@ namespace dbaui void OParameterDialog::Construct() { - m_xAllParams->connect_changed(LINK(this, OParameterDialog, OnEntryListBoxSelected)); + m_xAllParams->connect_selection_changed( + LINK(this, OParameterDialog, OnEntryListBoxSelected)); m_xParam->connect_focus_out(LINK(this, OParameterDialog, OnValueLoseFocusHdl)); m_xParam->connect_changed(LINK(this, OParameterDialog, OnValueModified)); m_xTravelNext->connect_clicked(LINK(this, OParameterDialog, OnButtonClicked)); diff --git a/dbaccess/source/ui/dlg/sqlmessage.cxx b/dbaccess/source/ui/dlg/sqlmessage.cxx index 0e539a34cb38..60b533f90c19 100644 --- a/dbaccess/source/ui/dlg/sqlmessage.cxx +++ b/dbaccess/source/ui/dlg/sqlmessage.cxx @@ -290,7 +290,8 @@ OExceptionChainDialog::OExceptionChainDialog(weld::Window* pParent, ExceptionDis m_sStatusLabel = DBA_RES( STR_EXCEPTION_STATUS ); m_sErrorCodeLabel = DBA_RES( STR_EXCEPTION_ERRORCODE ); - m_xExceptionList->connect_changed(LINK(this, OExceptionChainDialog, OnExceptionSelected)); + m_xExceptionList->connect_selection_changed( + LINK(this, OExceptionChainDialog, OnExceptionSelected)); bool bHave22018 = false; size_t elementPos = 0; diff --git a/dbaccess/source/ui/inc/WTypeSelect.hxx b/dbaccess/source/ui/inc/WTypeSelect.hxx index 56af0e355d1a..dfda5f6937c0 100644 --- a/dbaccess/source/ui/inc/WTypeSelect.hxx +++ b/dbaccess/source/ui/inc/WTypeSelect.hxx @@ -87,7 +87,7 @@ namespace dbaui void connect_changed(const Link& rLink) { m_aChangeHdl = rLink; - m_xControl->connect_changed(rLink); + m_xControl->connect_selection_changed(rLink); } }; diff --git a/dbaccess/source/ui/misc/WNameMatch.cxx b/dbaccess/source/ui/misc/WNameMatch.cxx index 0d6c3c835163..5eba2844b625 100644 --- a/dbaccess/source/ui/misc/WNameMatch.cxx +++ b/dbaccess/source/ui/misc/WNameMatch.cxx @@ -60,8 +60,8 @@ OWizNameMatching::OWizNameMatching(weld::Container* pPage, OCopyTableWizard* pWi m_xCTRL_LEFT->enable_toggle_buttons(weld::ColumnToggleType::Check); - m_xCTRL_LEFT->connect_changed(LINK(this,OWizNameMatching,TableListClickHdl)); - m_xCTRL_RIGHT->connect_changed(LINK(this,OWizNameMatching,TableListRightSelectHdl)); + m_xCTRL_LEFT->connect_selection_changed(LINK(this, OWizNameMatching, TableListClickHdl)); + m_xCTRL_RIGHT->connect_selection_changed(LINK(this, OWizNameMatching, TableListRightSelectHdl)); m_sSourceText = m_xTABLE_LEFT->get_label() + "\n"; m_sDestText = m_xTABLE_RIGHT->get_label() + "\n"; diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index cb4a4de7db9e..789dedf24673 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -2088,7 +2088,7 @@ void Desktop::OpenClients() bool bExistsSessionData = false; bool const bDisableRecovery = getenv("OOO_DISABLE_RECOVERY") != nullptr - || IsOnSystemEventLoop() + || IsUseSystemEventLoop() || !officecfg::Office::Recovery::RecoveryInfo::Enabled::get(); impl_checkRecoveryState(bCrashed, bExistsRecoveryData, bExistsSessionData); diff --git a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx index 9117fdfd1048..da576ee07b52 100644 --- a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx +++ b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx @@ -462,7 +462,7 @@ UpdateDialog::UpdateDialog( m_xExtensionManager = deployment::ExtensionManager::get( context ); - m_xUpdates->connect_changed(LINK(this, UpdateDialog, selectionHandler)); + m_xUpdates->connect_selection_changed(LINK(this, UpdateDialog, selectionHandler)); m_xUpdates->connect_toggled(LINK(this, UpdateDialog, entryToggled)); m_xAll->connect_toggled(LINK(this, UpdateDialog, allHandler)); m_xOk->connect_clicked(LINK(this, UpdateDialog, okHandler)); diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index d5ac74a2d14e..0a1a2a620150 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -1331,6 +1331,7 @@ static char* doc_getPresentationInfo(LibreOfficeKitDocument* pThis); static bool doc_createSlideRenderer( LibreOfficeKitDocument* pThis, + const char* pSlideHash, int nSlideNumber, unsigned* nViewWidth, unsigned* nViewHeight, bool bRenderBackground, bool bRenderMasterPage); @@ -5724,6 +5725,7 @@ static char* doc_getPresentationInfo(LibreOfficeKitDocument* pThis) static bool doc_createSlideRenderer( LibreOfficeKitDocument* pThis, + const char* pSlideHash, int nSlideNumber, unsigned* pViewWidth, unsigned* pViewHeight, bool bRenderBackground, bool bRenderMasterPage) { @@ -5737,9 +5739,11 @@ static bool doc_createSlideRenderer( return false; } + OString sSlideHash(pSlideHash); sal_Int32 nViewWidth = *pViewWidth; sal_Int32 nViewHeight = *pViewHeight; bool bReturn = pDoc->createSlideRenderer( + sSlideHash, nSlideNumber, nViewWidth, nViewHeight, bRenderBackground, bRenderMasterPage); diff --git a/desktop/win32/source/loader.cxx b/desktop/win32/source/loader.cxx index 5374c286aa41..3e306dbdd70c 100644 --- a/desktop/win32/source/loader.cxx +++ b/desktop/win32/source/loader.cxx @@ -34,6 +34,10 @@ #include #include +// For PathCchCanonicalizeEx +#include +#pragma comment(lib, "Pathcch.lib") + namespace { void fail() @@ -249,6 +253,7 @@ int officeloader_impl(bool bAllowConsole) std::vector aEscapedArgs; bool bHeadlessMode = false; + const size_t nPathSize = 32 * 1024; for (std::wstring_view arg : CommandArgs()) { // Check command line arguments for "--headless" parameter. We only set the environment @@ -258,25 +263,38 @@ int officeloader_impl(bool bAllowConsole) if (arg == L"-headless" || arg == L"--headless") bHeadlessMode = true; // check for wildcards in arguments - Windows does not expand automatically - else if (arg.find_first_of(L"*?") != std::wstring_view::npos) + else if (arg.size() < nPathSize && arg.find_first_of(L"*?") != std::wstring_view::npos) { + const wchar_t* path(arg.data()); + // 1. PathCchCanonicalizeEx only works with backslashes, so preprocess to comply + wchar_t buf1[nPathSize], buf2[nPathSize]; + arg.copy(buf1, arg.size()); + buf1[arg.size()] = '\0'; + std::replace(buf1, buf1 + arg.size(), '/', '\\'); + // 2. Canonicalize the path: if needed, drop the .. and . segments; if long, make sure + // that path has \\?\ long path prefix present (required for FindFirstFileW) + if (SUCCEEDED( + PathCchCanonicalizeEx(buf2, std::size(buf1), buf1, PATHCCH_ALLOW_LONG_PATHS))) + path = buf2; + // 3. Expand the wildcards WIN32_FIND_DATAW aFindData; - HANDLE h = FindFirstFileW(arg.data(), &aFindData); + HANDLE h = FindFirstFileW(path, &aFindData); if (h != INVALID_HANDLE_VALUE) { - const int nPathSize = 32 * 1024; wchar_t drive[3]; - wchar_t dir[nPathSize]; - wchar_t path[nPathSize]; - _wsplitpath_s(arg.data(), drive, std::size(drive), dir, std::size(dir), nullptr, 0, - nullptr, 0); - do + bool splitted = _wsplitpath_s(path, drive, std::size(drive), buf1, std::size(buf1), + nullptr, 0, nullptr, 0) == 0; + if (splitted) { - _wmakepath_s(path, std::size(path), drive, dir, aFindData.cFileName, nullptr); - aEscapedArgs.push_back(EscapeArg(path)); - } while (FindNextFileW(h, &aFindData)); + do + { + if (_wmakepath_s(buf2, drive, buf1, aFindData.cFileName, nullptr) == 0) + aEscapedArgs.push_back(EscapeArg(buf2)); + } while (FindNextFileW(h, &aFindData)); + } FindClose(h); - continue; + if (splitted) + continue; } } diff --git a/dictionaries b/dictionaries index 0fdcd7916f2e..31bc2a1104a1 160000 --- a/dictionaries +++ b/dictionaries @@ -1 +1 @@ -Subproject commit 0fdcd7916f2e59da20419d408cad8bcb909c5ae5 +Subproject commit 31bc2a1104a1cd175f900902f994c76dea35c763 diff --git a/editeng/source/accessibility/AccessibleStaticTextBase.cxx b/editeng/source/accessibility/AccessibleStaticTextBase.cxx index e318dc4eecba..9dd2a3483a93 100644 --- a/editeng/source/accessibility/AccessibleStaticTextBase.cxx +++ b/editeng/source/accessibility/AccessibleStaticTextBase.cxx @@ -943,7 +943,7 @@ namespace accessibility } } - return ::comphelper::concatSequences( aRunAttrSeq, comphelper::containerToSequence(aDiffVec) ); + return comphelper::concatSequences(aRunAttrSeq, aDiffVec); } tools::Rectangle AccessibleStaticTextBase::GetParagraphBoundingBox() const diff --git a/editeng/source/editeng/ContentNode.cxx b/editeng/source/editeng/ContentNode.cxx index b7e7f4b0e8ee..3721016db04c 100644 --- a/editeng/source/editeng/ContentNode.cxx +++ b/editeng/source/editeng/ContentNode.cxx @@ -906,9 +906,6 @@ void CharAttribList::Remove(const EditCharAttrib* p) void CharAttribList::Remove(sal_Int32 nPos) { - if (nPos >= static_cast(maAttribs.size())) - return; - maAttribs.erase(maAttribs.begin()+nPos); } diff --git a/editeng/source/outliner/outlin2.cxx b/editeng/source/outliner/outlin2.cxx index a0e384d1388f..18bf47edfe3f 100644 --- a/editeng/source/outliner/outlin2.cxx +++ b/editeng/source/outliner/outlin2.cxx @@ -308,7 +308,7 @@ bool Outliner::IsInUndo() const return pEditEngine->IsInUndo(); } -sal_uInt32 Outliner::GetLineCount( sal_Int32 nParagraph ) const +sal_Int32 Outliner::GetLineCount( sal_Int32 nParagraph ) const { return pEditEngine->GetLineCount( nParagraph ); } diff --git a/editeng/source/uno/unofield.cxx b/editeng/source/uno/unofield.cxx index cc2eb9b6367c..cb5000f5ae92 100644 --- a/editeng/source/uno/unofield.cxx +++ b/editeng/source/uno/unofield.cxx @@ -550,7 +550,7 @@ uno::Sequence< uno::Type > SAL_CALL SvxUnoTextField::getTypes() { maTypeSequence = comphelper::concatSequences( OComponentHelper::getTypes(), - uno::Sequence { + std::initializer_list{ cppu::UnoType::get(), cppu::UnoType::get(), cppu::UnoType::get(), diff --git a/editeng/source/uno/unotext.cxx b/editeng/source/uno/unotext.cxx index 6f149cdc67e1..c80399609572 100644 --- a/editeng/source/uno/unotext.cxx +++ b/editeng/source/uno/unotext.cxx @@ -2219,7 +2219,7 @@ uno::Sequence< OUString > SAL_CALL SvxUnoTextBase::getSupportedServiceNames_Stat { return comphelper::concatSequences( SvxUnoTextRangeBase::getSupportedServiceNames_Static(), - std::initializer_list{ u"com.sun.star.text.Text" }); + std::initializer_list{ u"com.sun.star.text.Text"_ustr }); } const uno::Sequence< sal_Int8 > & SvxUnoTextBase::getUnoTunnelId() noexcept diff --git a/editeng/source/uno/unotext2.cxx b/editeng/source/uno/unotext2.cxx index 520aa65c74bf..5cfea9d63173 100644 --- a/editeng/source/uno/unotext2.cxx +++ b/editeng/source/uno/unotext2.cxx @@ -357,11 +357,11 @@ uno::Sequence< OUString > SAL_CALL SvxUnoTextContent::getSupportedServiceNames() { return comphelper::concatSequences( SvxUnoTextRangeBase::getSupportedServiceNames(), - std::initializer_list{ u"com.sun.star.style.ParagraphProperties", - u"com.sun.star.style.ParagraphPropertiesComplex", - u"com.sun.star.style.ParagraphPropertiesAsian", - u"com.sun.star.text.TextContent", - u"com.sun.star.text.Paragraph" }); + std::initializer_list{ u"com.sun.star.style.ParagraphProperties"_ustr, + u"com.sun.star.style.ParagraphPropertiesComplex"_ustr, + u"com.sun.star.style.ParagraphPropertiesAsian"_ustr, + u"com.sun.star.text.TextContent"_ustr, + u"com.sun.star.text.Paragraph"_ustr }); } @@ -618,10 +618,10 @@ uno::Sequence< OUString > SAL_CALL SvxUnoTextCursor::getSupportedServiceNames() { return comphelper::concatSequences( SvxUnoTextRangeBase::getSupportedServiceNames(), - std::initializer_list{ u"com.sun.star.style.ParagraphProperties", - u"com.sun.star.style.ParagraphPropertiesComplex", - u"com.sun.star.style.ParagraphPropertiesAsian", - u"com.sun.star.text.TextCursor" }); + std::initializer_list{ u"com.sun.star.style.ParagraphProperties"_ustr, + u"com.sun.star.style.ParagraphPropertiesComplex"_ustr, + u"com.sun.star.style.ParagraphPropertiesAsian"_ustr, + u"com.sun.star.text.TextCursor"_ustr }); } diff --git a/extensions/source/abpilot/tableselectionpage.cxx b/extensions/source/abpilot/tableselectionpage.cxx index 1df2ef092e31..31f88d35a446 100644 --- a/extensions/source/abpilot/tableselectionpage.cxx +++ b/extensions/source/abpilot/tableselectionpage.cxx @@ -31,7 +31,7 @@ namespace abp : AddressBookSourcePage(pPage, pController, u"modules/sabpilot/ui/selecttablepage.ui"_ustr, u"SelectTablePage"_ustr) , m_xTableList(m_xBuilder->weld_tree_view(u"table"_ustr)) { - m_xTableList->connect_changed( LINK( this, TableSelectionPage, OnTableSelected ) ); + m_xTableList->connect_selection_changed(LINK(this, TableSelectionPage, OnTableSelected)); m_xTableList->connect_row_activated( LINK( this, TableSelectionPage, OnTableDoubleClicked ) ); } diff --git a/extensions/source/abpilot/unodialogabp.cxx b/extensions/source/abpilot/unodialogabp.cxx index 4baafbf7f705..b8d78e81e888 100644 --- a/extensions/source/abpilot/unodialogabp.cxx +++ b/extensions/source/abpilot/unodialogabp.cxx @@ -35,41 +35,12 @@ namespace abp using namespace ::com::sun::star::ui::dialogs; OABSPilotUno::OABSPilotUno(const Reference< XComponentContext >& _rxORB) - :OGenericUnoDialog(_rxORB) + : OABSPilotUno_JBase(_rxORB) { registerProperty( u"DataSourceName"_ustr, PROPERTY_ID_DATASOURCENAME, PropertyAttribute::READONLY , &m_sDataSourceName, cppu::UnoType::get() ); } - Any SAL_CALL OABSPilotUno::queryInterface( const Type& aType ) - { - Any aReturn = svt::OGenericUnoDialog::queryInterface( aType ); - return aReturn.hasValue() ? aReturn : OABSPilotUno_JBase::queryInterface( aType ); - } - - void SAL_CALL OABSPilotUno::acquire( ) noexcept - { - svt::OGenericUnoDialog::acquire(); - } - - void SAL_CALL OABSPilotUno::release( ) noexcept - { - svt::OGenericUnoDialog::release(); - } - - Sequence< Type > SAL_CALL OABSPilotUno::getTypes( ) - { - return ::comphelper::concatSequences( - svt::OGenericUnoDialog::getTypes(), - OABSPilotUno_JBase::getTypes() - ); - } - - Sequence SAL_CALL OABSPilotUno::getImplementationId( ) - { - return css::uno::Sequence(); - } - OUString SAL_CALL OABSPilotUno::getImplementationName() { return u"org.openoffice.comp.abp.OAddressBookSourcePilot"_ustr; diff --git a/extensions/source/abpilot/unodialogabp.hxx b/extensions/source/abpilot/unodialogabp.hxx index b8bd940afa04..b07f0b2d870b 100644 --- a/extensions/source/abpilot/unodialogabp.hxx +++ b/extensions/source/abpilot/unodialogabp.hxx @@ -28,12 +28,11 @@ namespace abp { class OABSPilotUno; - typedef ::cppu::ImplHelper1< css::task::XJob > OABSPilotUno_JBase; + typedef cppu::ImplInheritanceHelper OABSPilotUno_JBase; typedef ::comphelper::OPropertyArrayUsageHelper< OABSPilotUno > OABSPilotUno_PBase; /// the UNO wrapper for the address book source pilot class OABSPilotUno - : public svt::OGenericUnoDialog - , public OABSPilotUno_JBase + : public OABSPilotUno_JBase , public OABSPilotUno_PBase { OUString m_sDataSourceName; @@ -42,15 +41,6 @@ namespace abp explicit OABSPilotUno(const css::uno::Reference< css::uno::XComponentContext >& _rxORB); private: - // XInterface (disambiguation) - virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override; - virtual void SAL_CALL acquire( ) noexcept override; - virtual void SAL_CALL release( ) noexcept override; - - // XTypeProvider - virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override; - virtual css::uno::Sequence SAL_CALL getImplementationId( ) override; - // XServiceInfo virtual OUString SAL_CALL getImplementationName() override; virtual css::uno::Sequence SAL_CALL getSupportedServiceNames() override; diff --git a/extensions/source/dbpilots/commonpagesdbp.cxx b/extensions/source/dbpilots/commonpagesdbp.cxx index 9aea1855f199..f3007dcea177 100644 --- a/extensions/source/dbpilots/commonpagesdbp.cxx +++ b/extensions/source/dbpilots/commonpagesdbp.cxx @@ -71,8 +71,9 @@ namespace dbp OSL_FAIL("OTableSelectionPage::OTableSelectionPage: could not collect the data source names!"); } - m_xDatasource->connect_changed(LINK(this, OTableSelectionPage, OnListboxSelection)); - m_xTable->connect_changed(LINK(this, OTableSelectionPage, OnListboxSelection)); + m_xDatasource->connect_selection_changed( + LINK(this, OTableSelectionPage, OnListboxSelection)); + m_xTable->connect_selection_changed(LINK(this, OTableSelectionPage, OnListboxSelection)); m_xTable->connect_row_activated(LINK(this, OTableSelectionPage, OnListboxDoubleClicked)); m_xSearchDatabase->connect_clicked(LINK(this, OTableSelectionPage, OnSearchClicked)); } diff --git a/extensions/source/dbpilots/gridwizard.cxx b/extensions/source/dbpilots/gridwizard.cxx index edf5f9090afe..5bb9625773e2 100644 --- a/extensions/source/dbpilots/gridwizard.cxx +++ b/extensions/source/dbpilots/gridwizard.cxx @@ -292,8 +292,9 @@ namespace dbp m_xDeselectOne->connect_clicked(LINK(this, OGridFieldsSelection, OnMoveOneEntry)); m_xDeselectAll->connect_clicked(LINK(this, OGridFieldsSelection, OnMoveAllEntries)); - m_xExistFields->connect_changed(LINK(this, OGridFieldsSelection, OnEntrySelected)); - m_xSelFields->connect_changed(LINK(this, OGridFieldsSelection, OnEntrySelected)); + m_xExistFields->connect_selection_changed( + LINK(this, OGridFieldsSelection, OnEntrySelected)); + m_xSelFields->connect_selection_changed(LINK(this, OGridFieldsSelection, OnEntrySelected)); m_xExistFields->connect_row_activated(LINK(this, OGridFieldsSelection, OnEntryDoubleClicked)); m_xSelFields->connect_row_activated(LINK(this, OGridFieldsSelection, OnEntryDoubleClicked)); } diff --git a/extensions/source/dbpilots/groupboxwiz.cxx b/extensions/source/dbpilots/groupboxwiz.cxx index 46d6ad1db75f..9ad3e234336f 100644 --- a/extensions/source/dbpilots/groupboxwiz.cxx +++ b/extensions/source/dbpilots/groupboxwiz.cxx @@ -180,7 +180,8 @@ namespace dbp m_xMoveLeft->connect_clicked(LINK(this, ORadioSelectionPage, OnMoveEntry)); m_xMoveRight->connect_clicked(LINK(this, ORadioSelectionPage, OnMoveEntry)); m_xRadioName->connect_changed(LINK(this, ORadioSelectionPage, OnNameModified)); - m_xExistingRadios->connect_changed(LINK(this, ORadioSelectionPage, OnEntrySelected)); + m_xExistingRadios->connect_selection_changed( + LINK(this, ORadioSelectionPage, OnEntrySelected)); implCheckMoveButtons(); m_xExistingRadios->set_selection_mode(SelectionMode::Multiple); @@ -341,7 +342,7 @@ namespace dbp , m_xOptions(m_xBuilder->weld_tree_view(u"radiobuttons"_ustr)) , m_nLastSelection(::vcl::WizardTypes::WizardState(-1)) { - m_xOptions->connect_changed(LINK(this, OOptionValuesPage, OnOptionSelected)); + m_xOptions->connect_selection_changed(LINK(this, OOptionValuesPage, OnOptionSelected)); } OOptionValuesPage::~OOptionValuesPage() diff --git a/extensions/source/dbpilots/listcombowizard.cxx b/extensions/source/dbpilots/listcombowizard.cxx index ed8caf2acc71..f1678379dda5 100644 --- a/extensions/source/dbpilots/listcombowizard.cxx +++ b/extensions/source/dbpilots/listcombowizard.cxx @@ -265,7 +265,8 @@ namespace dbp enableFormDatasourceDisplay(); m_xSelectTable->connect_row_activated(LINK(this, OContentTableSelection, OnTableDoubleClicked)); - m_xSelectTable->connect_changed(LINK(this, OContentTableSelection, OnTableSelected)); + m_xSelectTable->connect_selection_changed( + LINK(this, OContentTableSelection, OnTableSelected)); } OContentTableSelection::~OContentTableSelection() @@ -342,7 +343,8 @@ namespace dbp , m_xInfo(m_xBuilder->weld_label(u"info"_ustr)) { m_xInfo->set_label(compmodule::ModuleRes( isListBox() ? RID_STR_FIELDINFO_LISTBOX : RID_STR_FIELDINFO_COMBOBOX)); - m_xSelectTableField->connect_changed(LINK(this, OContentFieldSelection, OnFieldSelected)); + m_xSelectTableField->connect_selection_changed( + LINK(this, OContentFieldSelection, OnFieldSelected)); m_xSelectTableField->connect_row_activated(LINK(this, OContentFieldSelection, OnTableDoubleClicked)); } diff --git a/extensions/source/propctrlr/selectlabeldialog.cxx b/extensions/source/propctrlr/selectlabeldialog.cxx index f0ba29207794..4fe9116d7096 100644 --- a/extensions/source/propctrlr/selectlabeldialog.cxx +++ b/extensions/source/propctrlr/selectlabeldialog.cxx @@ -60,7 +60,7 @@ namespace pcr , m_xScratchIter(m_xControlTree->make_iterator()) , m_xNoAssignment(m_xBuilder->weld_check_button(u"noassignment"_ustr)) { - m_xControlTree->connect_changed(LINK(this, OSelectLabelDialog, OnEntrySelected)); + m_xControlTree->connect_selection_changed(LINK(this, OSelectLabelDialog, OnEntrySelected)); m_xControlTree->set_size_request(-1, m_xControlTree->get_height_rows(8)); // fill the description diff --git a/extensions/source/scanner/sanedlg.cxx b/extensions/source/scanner/sanedlg.cxx index b7c4ff4d051f..7c2af809a6ab 100644 --- a/extensions/source/scanner/sanedlg.cxx +++ b/extensions/source/scanner/sanedlg.cxx @@ -270,7 +270,7 @@ SaneDlg::SaneDlg(weld::Window* pParent, Sane& rSane, bool bScanEnabled) mxScanButton->connect_clicked( LINK( this, SaneDlg, ClickBtnHdl ) ); mxButtonOption->connect_clicked( LINK( this, SaneDlg, ClickBtnHdl ) ); mxDeviceBox->connect_changed( LINK( this, SaneDlg, SelectHdl ) ); - mxOptionBox->connect_changed( LINK( this, SaneDlg, OptionsBoxSelectHdl ) ); + mxOptionBox->connect_selection_changed(LINK(this, SaneDlg, OptionsBoxSelectHdl)); mxCancelButton->connect_clicked( LINK( this, SaneDlg, ClickBtnHdl ) ); mxBoolCheckBox->connect_toggled( LINK( this, SaneDlg, ToggleBtnHdl ) ); mxStringEdit->connect_changed( LINK( this, SaneDlg, ModifyHdl ) ); diff --git a/external/Module_external.mk b/external/Module_external.mk index e60765634ab5..8742fe3b37a4 100644 --- a/external/Module_external.mk +++ b/external/Module_external.mk @@ -9,10 +9,6 @@ $(eval $(call gb_Module_Module,external)) -ifeq ($(COM),MSC) -$(eval $(call gb_Module_add_moduledir,external,msc-externals)) -endif - $(eval $(call gb_Module_add_moduledirs,external,\ $(call gb_Helper_optional,XMLSEC,xmlsec) \ $(call gb_Helper_optional,ABW,libabw) \ diff --git a/external/msc-externals/Makefile b/external/msc-externals/Makefile deleted file mode 100644 index e4968cf85fb6..000000000000 --- a/external/msc-externals/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- - -module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST)))) - -include $(module_directory)/../../solenv/gbuild/partial_build.mk - -# vim: set noet sw=4 ts=4: diff --git a/external/msc-externals/Module_msc-externals.mk b/external/msc-externals/Module_msc-externals.mk deleted file mode 100644 index 07ea3878a106..000000000000 --- a/external/msc-externals/Module_msc-externals.mk +++ /dev/null @@ -1,29 +0,0 @@ -# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- -# -# 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/. -# - -$(eval $(call gb_Module_Module,msc-externals)) - -ifneq ($(BUILD_X64),) - -$(eval $(call gb_Module_add_targets,msc-externals,\ - Package_msvc_dlls \ -)) - -endif - -# Install the universal crts (tdf#108580) -ifneq ($(UCRT_REDISTDIR),) - -$(eval $(call gb_Module_add_targets,msc-externals,\ - Package_ucrt \ -)) - -endif - -# vim: set noet sw=4 ts=4: diff --git a/external/msc-externals/Package_msvc_dlls.mk b/external/msc-externals/Package_msvc_dlls.mk deleted file mode 100644 index d82dd06c3cec..000000000000 --- a/external/msc-externals/Package_msvc_dlls.mk +++ /dev/null @@ -1,16 +0,0 @@ -# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- -# -# 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/. -# - -$(eval $(call gb_Package_Package,msvc_dlls,$(MSVC_DLL_PATH))) - -$(eval $(call gb_Package_add_files,msvc_dlls,program/shlxthdl,\ - $(MSVC_DLLS) \ -)) - -# vim:set shiftwidth=4 tabstop=4 noexpandtab: diff --git a/external/msc-externals/Package_ucrt.mk b/external/msc-externals/Package_ucrt.mk deleted file mode 100644 index 52e6f0cbae97..000000000000 --- a/external/msc-externals/Package_ucrt.mk +++ /dev/null @@ -1,21 +0,0 @@ -# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- -# -# 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/. -# - -$(eval $(call gb_Package_Package,ucrt,$(UCRT_REDISTDIR))) - -$(eval $(call gb_Package_add_files,ucrt,$(LIBO_ETC_FOLDER),\ - Windows6.1-KB2999226-x64.msu \ - Windows6.1-KB2999226-x86.msu \ - Windows8.1-KB2999226-x64.msu \ - Windows8.1-KB2999226-x86.msu \ - Windows8-RT-KB2999226-x64.msu \ - Windows8-RT-KB2999226-x86.msu \ -)) - -# vim:set shiftwidth=4 tabstop=4 noexpandtab: diff --git a/external/msc-externals/README b/external/msc-externals/README deleted file mode 100644 index 9ffb415c36e4..000000000000 --- a/external/msc-externals/README +++ /dev/null @@ -1 +0,0 @@ -module msc-externals copies the bundled MSVC runtime DLLs into instdir diff --git a/external/pdfium/UnpackedTarball_pdfium.mk b/external/pdfium/UnpackedTarball_pdfium.mk index 6c5bce9b2e29..4a47b35bd6f3 100644 --- a/external/pdfium/UnpackedTarball_pdfium.mk +++ b/external/pdfium/UnpackedTarball_pdfium.mk @@ -10,8 +10,6 @@ pdfium_patches := # Fixes build on our baseline. pdfium_patches += build.patch.1 -# Avoids Windows 8 build dependency. -pdfium_patches += windows7.patch.1 pdfium_patches += c++20-comparison.patch pdfium_patches += constexpr-template.patch diff --git a/external/pdfium/windows7.patch.1 b/external/pdfium/windows7.patch.1 deleted file mode 100644 index 9c82a8a34d49..000000000000 --- a/external/pdfium/windows7.patch.1 +++ /dev/null @@ -1,34 +0,0 @@ -diff --git a/core/fxcrt/win/win_util.cc b/core/fxcrt/win/win_util.cc -index 43e9151d1..76657ac0a 100644 ---- a/core/fxcrt/win/win_util.cc -+++ b/core/fxcrt/win/win_util.cc -@@ -10,28 +10,7 @@ - namespace pdfium { - - bool IsUser32AndGdi32Available() { -- static auto is_user32_and_gdi32_available = []() { -- // If win32k syscalls aren't disabled, then user32 and gdi32 are available. -- -- typedef decltype( -- GetProcessMitigationPolicy)* GetProcessMitigationPolicyType; -- GetProcessMitigationPolicyType get_process_mitigation_policy_func = -- reinterpret_cast(GetProcAddress( -- GetModuleHandle(L"kernel32.dll"), "GetProcessMitigationPolicy")); -- -- if (!get_process_mitigation_policy_func) -- return true; -- -- PROCESS_MITIGATION_SYSTEM_CALL_DISABLE_POLICY policy = {}; -- if (get_process_mitigation_policy_func(GetCurrentProcess(), -- ProcessSystemCallDisablePolicy, -- &policy, sizeof(policy))) { -- return policy.DisallowWin32kSystemCalls == 0; -- } -- -- return true; -- }(); -- return is_user32_and_gdi32_available; -+ return true; - } - - } // namespace pdfium diff --git a/external/skia/macosmetal.patch.1 b/external/skia/macosmetal.patch.1 index fbf6962340fc..48f7a2400421 100644 --- a/external/skia/macosmetal.patch.1 +++ b/external/skia/macosmetal.patch.1 @@ -70,7 +70,32 @@ diff -ur skia.org/tools/window/mac/GaneshMetalWindowContext_mac.mm skia/tools/wi #import #import -@@ -65,8 +67,7 @@ +@@ -52,7 +54,23 @@ + + SkASSERT(nil != fMainView); + +- fMetalLayer = [CAMetalLayer layer]; ++ // Related: tdf#152703 Reuse existing CAMetalLayer to stop flicker ++ // When live resizing a window, replacing the CAMetalLayer with each ++ // resize event repaints the window's background which causes a ++ // noticeable flicker. So reuse any existing CAMetalLayer already ++ // assigned to the native view. ++ BOOL reuseMetalLayer = NO; ++ if (fMainView.wantsLayer) ++ { ++ CALayer *pLayer = fMainView.layer; ++ if (pLayer && [pLayer isKindOfClass:[CAMetalLayer class]]) ++ { ++ fMetalLayer = (__bridge CAMetalLayer*)pLayer; ++ reuseMetalLayer = YES; ++ } ++ } ++ if (!reuseMetalLayer) ++ fMetalLayer = [CAMetalLayer layer]; + fMetalLayer.device = fShared->fDevice.get(); + fMetalLayer.pixelFormat = MTLPixelFormatBGRA8Unorm; + +@@ -65,10 +83,10 @@ fMetalLayer.autoresizingMask = kCALayerHeightSizable | kCALayerWidthSizable; fMetalLayer.contentsGravity = kCAGravityTopLeft; fMetalLayer.magnificationFilter = kCAFilterNearest; @@ -78,9 +103,13 @@ diff -ur skia.org/tools/window/mac/GaneshMetalWindowContext_mac.mm skia/tools/wi - fMetalLayer.colorspace = cs.CGColorSpace; + fMetalLayer.colorspace = CGColorSpaceCreateWithName(kCGColorSpaceSRGB); - fMainView.layer = fMetalLayer; +- fMainView.layer = fMetalLayer; ++ if (!reuseMetalLayer) ++ fMainView.layer = fMetalLayer; fMainView.wantsLayer = YES; -@@ -85,6 +86,18 @@ + + return true; +@@ -85,6 +103,18 @@ fMetalLayer.drawableSize = backingSize; fMetalLayer.contentsScale = backingScaleFactor; @@ -114,4 +143,3 @@ diff -ur skia.org/tools/window/mac/MacWindowInfo.h skia/tools/window/mac/MacWind +SK_API void ResetBackingScaleFactor(); } // namespace skwindow - diff --git a/external/xmlsec/BCryptKeyDerivation.patch.1 b/external/xmlsec/BCryptKeyDerivation.patch.1 deleted file mode 100644 index 3747915f87d2..000000000000 --- a/external/xmlsec/BCryptKeyDerivation.patch.1 +++ /dev/null @@ -1,51 +0,0 @@ -tdf#159519 Windows 7 does not have BCryptKeyDerivation - -It just occurred to me that these functions would of course not be called -by LibreOffice so this is untested. - ---- xmlsec/src/mscng/pbkdf2.c.orig 2024-02-21 19:02:56.539534152 +0100 -+++ xmlsec/src/mscng/pbkdf2.c 2024-02-21 19:01:03.282270354 +0100 -@@ -318,7 +318,20 @@ - } - - /* generate the output key */ -+#if 1 // _WIN32_WINNT <= 0x0601 -+ typedef NTSTATUS (WINAPI * BCryptKeyDerivationPtr)( -+ BCRYPT_KEY_HANDLE, BCryptBufferDesc *, PUCHAR, ULONG, ULONG *, ULONG); -+ HMODULE hBCrypt = GetModuleHandle("bcrypt.dll"); -+ BCryptKeyDerivationPtr pBCryptKeyDerivation = -+ (BCryptKeyDerivationPtr) GetProcAddress(hBCrypt, "BCryptKeyDerivation"); -+ if(NULL == pBCryptKeyDerivation) { -+ xmlSecMSCngNtError("BCryptKeyDerivation", NULL, status); -+ goto done; -+ } -+ status = (*pBCryptKeyDerivation)( -+#else - status = BCryptKeyDerivation( -+#endif - hKey, - ¶msPBKDF2, - pbOut, ---- xmlsec/src/mscng/concatkdf.c.orig 2024-02-21 19:02:37.962490885 +0100 -+++ xmlsec/src/mscng/concatkdf.c 2024-02-21 19:01:37.961351134 +0100 -@@ -318,7 +318,20 @@ - } - - /* generate the output key */ -+#if 1 // _WIN32_WINNT <= 0x0601 -+ typedef NTSTATUS (WINAPI * BCryptKeyDerivationPtr)( -+ BCRYPT_KEY_HANDLE, BCryptBufferDesc *, PUCHAR, ULONG, ULONG *, ULONG); -+ HMODULE hBCrypt = GetModuleHandle("bcrypt.dll"); -+ BCryptKeyDerivationPtr pBCryptKeyDerivation = -+ (BCryptKeyDerivationPtr) GetProcAddress(hBCrypt, "BCryptKeyDerivation"); -+ if(NULL == pBCryptKeyDerivation) { -+ xmlSecMSCngNtError("BCryptKeyDerivation", NULL, status); -+ goto done; -+ } -+ status = (*pBCryptKeyDerivation)( -+#else - status = BCryptKeyDerivation( -+#endif - hKey, - ¶msCONCATKDF2, - pbOut, diff --git a/external/xmlsec/UnpackedTarball_xmlsec.mk b/external/xmlsec/UnpackedTarball_xmlsec.mk index 906aece5f7ed..77d3386b27dc 100644 --- a/external/xmlsec/UnpackedTarball_xmlsec.mk +++ b/external/xmlsec/UnpackedTarball_xmlsec.mk @@ -10,8 +10,6 @@ xmlsec_patches := # Remove this when Ubuntu 20.04 is EOL in 2025. xmlsec_patches += old-nss.patch.1 -# Remove this when Windows 7 is no longer supported -xmlsec_patches += BCryptKeyDerivation.patch.1 $(eval $(call gb_UnpackedTarball_UnpackedTarball,xmlsec)) diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx index 482d523bed63..8584dd1a698e 100644 --- a/filter/source/pdf/impdialog.cxx +++ b/filter/source/pdf/impdialog.cxx @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -1418,7 +1419,7 @@ IMPL_LINK_NOARG(ImpPDFTabSecurityPage, ClickmaPbSetPwdHdl, weld::Button&, void) mbHaveUserPassword = !aUserPW.isEmpty(); mbHaveOwnerPassword = !aOwnerPW.isEmpty(); - mxPreparedPasswords = vcl::PDFWriter::InitEncryption( aOwnerPW, aUserPW ); + mxPreparedPasswords = vcl::pdf::initEncryption(aOwnerPW, aUserPW); if (!mxPreparedPasswords.is()) { OUString msg; @@ -1689,7 +1690,7 @@ ImplErrorDialog::ImplErrorDialog(weld::Window* pParent, const std::setset_label(m_xErrors->get_id(0)); } - m_xErrors->connect_changed(LINK(this, ImplErrorDialog, SelectHdl)); + m_xErrors->connect_selection_changed(LINK(this, ImplErrorDialog, SelectHdl)); } IMPL_LINK_NOARG(ImplErrorDialog, SelectHdl, weld::TreeView&, void) diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx index 5956933154c6..cca7703c50c8 100644 --- a/filter/source/pdf/pdfexport.cxx +++ b/filter/source/pdf/pdfexport.cxx @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -931,7 +932,7 @@ bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue >& aContext.Encryption.CanCopyOrExtract = bCanCopyOrExtract; aContext.Encryption.CanExtractForAccessibility = bCanExtractForAccessibility; if( bEncrypt && ! xEnc.is() ) - xEnc = vcl::PDFWriter::InitEncryption( aPermissionPassword, aOpenPassword ); + xEnc = vcl::pdf::initEncryption(aPermissionPassword, aOpenPassword); if( bEncrypt && !aPermissionPassword.isEmpty() && ! aPreparedPermissionPassword.hasElements() ) aPreparedPermissionPassword = comphelper::OStorageHelper::CreatePackageEncryptionData( aPermissionPassword ); } diff --git a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx index 06cb796f28e6..6490d0dcf535 100644 --- a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx +++ b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx @@ -80,7 +80,8 @@ XMLFilterSettingsDialog::XMLFilterSettingsDialog(weld::Window* pParent, m_xFilterListBox->set_size_request(m_xFilterListBox->get_approximate_digit_width() * 65, m_xFilterListBox->get_height_rows(12)); - m_xFilterListBox->connect_changed( LINK( this, XMLFilterSettingsDialog, SelectionChangedHdl_Impl ) ); + m_xFilterListBox->connect_selection_changed( + LINK(this, XMLFilterSettingsDialog, SelectionChangedHdl_Impl)); m_xFilterListBox->connect_row_activated( LINK( this, XMLFilterSettingsDialog, DoubleClickHdl_Impl ) ); m_xFilterListBox->set_accessible_name(FilterResId(STR_XML_FILTER_LISTBOX)); diff --git a/forms/source/component/DatabaseForm.cxx b/forms/source/component/DatabaseForm.cxx index 7cc92ac11c32..999bc986bf07 100644 --- a/forms/source/component/DatabaseForm.cxx +++ b/forms/source/component/DatabaseForm.cxx @@ -3717,11 +3717,11 @@ Sequence< OUString > SAL_CALL ODatabaseForm::getSupportedServiceNames() // concat without own services return ::comphelper::concatSequences( - css::uno::Sequence { + aServices, + std::initializer_list{ FRM_SUN_FORMCOMPONENT, u"com.sun.star.form.FormComponents"_ustr, FRM_SUN_COMPONENT_FORM, FRM_SUN_COMPONENT_HTMLFORM, - FRM_SUN_COMPONENT_DATAFORM, FRM_COMPONENT_FORM }, - aServices + FRM_SUN_COMPONENT_DATAFORM, FRM_COMPONENT_FORM } ); } diff --git a/forms/source/component/Date.cxx b/forms/source/component/Date.cxx index 6958a2b3b40b..16cfa00c139d 100644 --- a/forms/source/component/Date.cxx +++ b/forms/source/component/Date.cxx @@ -119,7 +119,7 @@ css::uno::Reference< css::util::XCloneable > SAL_CALL ODateModel::createClone() css::uno::Sequence SAL_CALL ODateModel::getSupportedServiceNames() { - const css::uno::Sequence vals { + static constexpr OUString vals[] { BINDABLE_CONTROL_MODEL, DATA_AWARE_CONTROL_MODEL, VALIDATABLE_CONTROL_MODEL, diff --git a/forms/source/component/File.cxx b/forms/source/component/File.cxx index a4533403c129..ac7c2816da68 100644 --- a/forms/source/component/File.cxx +++ b/forms/source/component/File.cxx @@ -48,7 +48,7 @@ using namespace ::com::sun::star::util; Sequence OFileControlModel::_getTypes() { static Sequence const aTypes = - concatSequences(OControlModel::_getTypes(), Sequence{ cppu::UnoType::get() }); + concatSequences(OControlModel::_getTypes(), std::initializer_list{ cppu::UnoType::get() }); return aTypes; } diff --git a/forms/source/component/FormComponent.cxx b/forms/source/component/FormComponent.cxx index b36329283262..74d46b8c0a83 100644 --- a/forms/source/component/FormComponent.cxx +++ b/forms/source/component/FormComponent.cxx @@ -1508,7 +1508,7 @@ css::uno::Sequence SAL_CALL OBoundControlModel::getSupportedServiceNam Sequence< OUString > OBoundControlModel::getSupportedServiceNames_Static() { - Sequence aOwnServiceNames { u"com.sun.star.form.DataAwareControlModel"_ustr }; + static constexpr OUString aOwnServiceNames[] { u"com.sun.star.form.DataAwareControlModel"_ustr }; return ::comphelper::concatSequences( OControlModel::getSupportedServiceNames_Static(), aOwnServiceNames diff --git a/forms/source/component/Grid.cxx b/forms/source/component/Grid.cxx index 18e52ff7eb9d..7b41dec828d8 100644 --- a/forms/source/component/Grid.cxx +++ b/forms/source/component/Grid.cxx @@ -231,11 +231,9 @@ void SAL_CALL OGridControlModel::setParent( const css::uno::Reference SAL_CALL OGridControlModel::getTypes( ) { return concatSequences( - concatSequences( OControlModel::getTypes(), OInterfaceContainer::getTypes(), - OErrorBroadcaster::getTypes() - ), + OErrorBroadcaster::getTypes(), OGridControlModel_BASE::getTypes() ); } diff --git a/forms/source/component/scrollbar.cxx b/forms/source/component/scrollbar.cxx index edf44e1a56d9..4eb5786f9fed 100644 --- a/forms/source/component/scrollbar.cxx +++ b/forms/source/component/scrollbar.cxx @@ -120,7 +120,7 @@ namespace frm // to benefit from the functionality for binding to spreadsheet cells Sequence< OUString > SAL_CALL OScrollBarModel::getSupportedServiceNames() { - Sequence< OUString > aOwnNames { FRM_SUN_COMPONENT_SCROLLBAR, BINDABLE_INTEGER_VALUE_RANGE }; + static constexpr OUString aOwnNames[] { FRM_SUN_COMPONENT_SCROLLBAR, BINDABLE_INTEGER_VALUE_RANGE }; return ::comphelper::combineSequences( getAggregateServiceNames(), diff --git a/forms/source/component/spinbutton.cxx b/forms/source/component/spinbutton.cxx index 5d12db677be9..c294983c21cb 100644 --- a/forms/source/component/spinbutton.cxx +++ b/forms/source/component/spinbutton.cxx @@ -73,7 +73,7 @@ namespace frm // to benefit from the functionality for binding to spreadsheet cells Sequence< OUString > SAL_CALL OSpinButtonModel::getSupportedServiceNames() { - Sequence< OUString > aOwnNames { FRM_SUN_COMPONENT_SPINBUTTON, BINDABLE_INTEGER_VALUE_RANGE }; + static constexpr OUString aOwnNames[] { FRM_SUN_COMPONENT_SPINBUTTON, BINDABLE_INTEGER_VALUE_RANGE }; return ::comphelper::combineSequences( getAggregateServiceNames(), diff --git a/forms/source/richtext/richtextmodel.cxx b/forms/source/richtext/richtextmodel.cxx index 8ef6d5973b74..fa2900f11903 100644 --- a/forms/source/richtext/richtextmodel.cxx +++ b/forms/source/richtext/richtextmodel.cxx @@ -263,7 +263,7 @@ namespace frm Sequence< OUString > SAL_CALL ORichTextModel::getSupportedServiceNames() { - Sequence< OUString > aOwnNames { + static constexpr OUString aOwnNames[] { FRM_SUN_COMPONENT_RICHTEXTCONTROL, u"com.sun.star.text.TextRange"_ustr, u"com.sun.star.style.CharacterProperties"_ustr, diff --git a/formula/source/ui/dlg/funcpage.cxx b/formula/source/ui/dlg/funcpage.cxx index 114cce0da52c..60d1e5adf2a0 100644 --- a/formula/source/ui/dlg/funcpage.cxx +++ b/formula/source/ui/dlg/funcpage.cxx @@ -73,7 +73,7 @@ FuncPage::FuncPage(weld::Container* pParent, const IFunctionManager* _pFunctionM m_xLbFunction->set_size_request(m_xLbFunction->get_preferred_size().Width(), m_xLbFunction->get_height_rows(15)); m_xLbCategory->connect_changed(LINK(this, FuncPage, SelComboBoxHdl)); - m_xLbFunction->connect_changed(LINK(this, FuncPage, SelTreeViewHdl)); + m_xLbFunction->connect_selection_changed(LINK(this, FuncPage, SelTreeViewHdl)); m_xLbFunction->connect_row_activated(LINK(this, FuncPage, DblClkHdl)); m_xLbFunction->connect_key_press(LINK(this, FuncPage, KeyInputHdl)); m_xLbFunctionSearchString->connect_changed(LINK(this, FuncPage, ModifyHdl)); diff --git a/formula/source/ui/dlg/structpg.cxx b/formula/source/ui/dlg/structpg.cxx index be73dffd0594..94101f0da986 100644 --- a/formula/source/ui/dlg/structpg.cxx +++ b/formula/source/ui/dlg/structpg.cxx @@ -44,7 +44,7 @@ StructPage::StructPage(weld::Container* pParent) m_xTlbStruct->set_size_request(m_xTlbStruct->get_approximate_digit_width() * 20, m_xTlbStruct->get_height_rows(17)); - m_xTlbStruct->connect_changed(LINK( this, StructPage, SelectHdl ) ); + m_xTlbStruct->connect_selection_changed(LINK(this, StructPage, SelectHdl)); } StructPage::~StructPage() diff --git a/fpicker/source/office/OfficeFilePicker.cxx b/fpicker/source/office/OfficeFilePicker.cxx index cdb28d34364c..6d845f3fd0c3 100644 --- a/fpicker/source/office/OfficeFilePicker.cxx +++ b/fpicker/source/office/OfficeFilePicker.cxx @@ -449,31 +449,6 @@ std::shared_ptr SvtFilePicker::implCreateDialog( weld::Windo } -// disambiguate XInterface - -IMPLEMENT_FORWARD_XINTERFACE2( SvtFilePicker, OCommonPicker, SvtFilePicker_Base ) - - -// disambiguate XTypeProvider - -IMPLEMENT_FORWARD_XTYPEPROVIDER2( SvtFilePicker, OCommonPicker, SvtFilePicker_Base ) - -IMPLEMENT_FORWARD_XINTERFACE3( SvtRemoteFilePicker, SvtFilePicker, OCommonPicker, SvtFilePicker_Base ) - - -// disambiguate XTypeProvider - -css::uno::Sequence< css::uno::Type > SAL_CALL SvtRemoteFilePicker::getTypes( ) -{ - return ::comphelper::concatSequences( - SvtFilePicker::getTypes(), - OCommonPicker::getTypes(), - SvtFilePicker_Base::getTypes() - ); -} -IMPLEMENT_GET_IMPLEMENTATION_ID( SvtRemoteFilePicker ) - - // XExecutableDialog functions diff --git a/fpicker/source/office/OfficeFilePicker.hxx b/fpicker/source/office/OfficeFilePicker.hxx index b75a3f6368db..33e2b6d16e7c 100644 --- a/fpicker/source/office/OfficeFilePicker.hxx +++ b/fpicker/source/office/OfficeFilePicker.hxx @@ -46,7 +46,8 @@ typedef css::uno::Sequence< UnoFilterEntry > UnoFilterList; // can be transpo // class SvtFilePicker --------------------------------------------------- -typedef ::cppu::ImplHelper5 < css::ui::dialogs::XFilePicker3 +typedef cppu::ImplInheritanceHelper SvtFilePicker_Base; class SvtFilePicker :public SvtFilePicker_Base - ,public ::svt::OCommonPicker ,public ::svt::IFilePickerListener { protected: @@ -85,16 +85,6 @@ public: virtual ~SvtFilePicker() override; - // disambiguate XInterface - - DECLARE_XINTERFACE( ) - - - // disambiguate XTypeProvider - - DECLARE_XTYPEPROVIDER( ) - - // XExecutableDialog functions virtual void SAL_CALL setTitle( const OUString& _rTitle ) override; @@ -221,14 +211,6 @@ public: virtual std::shared_ptr implCreateDialog( weld::Window* pParent ) override; - // disambiguate XInterface - - DECLARE_XINTERFACE( ) - - // disambiguate XTypeProvider - - DECLARE_XTYPEPROVIDER( ) - /* XServiceInfo */ virtual OUString SAL_CALL getImplementationName() override; virtual sal_Bool SAL_CALL supportsService( const OUString& sServiceName ) override; diff --git a/fpicker/source/office/PlacesListBox.cxx b/fpicker/source/office/PlacesListBox.cxx index 86bd505179a3..c8e815969879 100644 --- a/fpicker/source/office/PlacesListBox.cxx +++ b/fpicker/source/office/PlacesListBox.cxx @@ -27,7 +27,7 @@ PlacesListBox::PlacesListBox(std::unique_ptr xControl, mxImpl->get_height_rows(9)); mxImpl->set_size_request(aSize.Width(), aSize.Height()); - mxImpl->connect_changed( LINK( this, PlacesListBox, Selection ) ); + mxImpl->connect_selection_changed(LINK(this, PlacesListBox, Selection)); mxImpl->connect_row_activated( LINK( this, PlacesListBox, DoubleClick ) ) ; mxImpl->connect_query_tooltip(LINK(this, PlacesListBox, QueryTooltipHdl)); } diff --git a/fpicker/source/office/fileview.cxx b/fpicker/source/office/fileview.cxx index b7eb966e2b58..a5756f5d28d4 100644 --- a/fpicker/source/office/fileview.cxx +++ b/fpicker/source/office/fileview.cxx @@ -176,7 +176,10 @@ public: OUString get_id(const weld::TreeIter& rIter) { return mxTreeView->get_id(rIter); } void connect_row_activated(const Link& rLink) { mxTreeView->connect_row_activated(rLink); } - void connect_changed(const Link& rLink) { mxTreeView->connect_changed(rLink); } + void connect_changed(const Link& rLink) + { + mxTreeView->connect_selection_changed(rLink); + } int n_children() const { return mxTreeView->n_children(); } diff --git a/fpicker/source/office/foldertree.hxx b/fpicker/source/office/foldertree.hxx index 5ee3f794e4f7..9af03f79ff42 100644 --- a/fpicker/source/office/foldertree.hxx +++ b/fpicker/source/office/foldertree.hxx @@ -37,7 +37,10 @@ public: void clear() { m_xTreeView->clear(); } - void connect_changed(const Link& rLink) { m_xTreeView->connect_changed(rLink); } + void connect_changed(const Link& rLink) + { + m_xTreeView->connect_selection_changed(rLink); + } void InsertRootEntry(const OUString& rId, const OUString& rRootLabel); void FillTreeEntry(const weld::TreeIter& rEntry); diff --git a/framework/inc/helper/persistentwindowstate.hxx b/framework/inc/helper/persistentwindowstate.hxx index 8d062488fe83..3dc70985423f 100644 --- a/framework/inc/helper/persistentwindowstate.hxx +++ b/framework/inc/helper/persistentwindowstate.hxx @@ -84,6 +84,10 @@ class PersistentWindowState final : public ::cppu::WeakImplHelper< // XEventListener virtual void SAL_CALL disposing(const css::lang::EventObject& aEvent) override; + // Helper to explicitly save the state of rFrame's window to the config + static void SaveWindowStateToConfig(const css::uno::Reference& rContext, + const css::uno::Reference& rFrame); + // helper private: diff --git a/framework/source/helper/persistentwindowstate.cxx b/framework/source/helper/persistentwindowstate.cxx index 8e90defb0711..d7967d7457df 100644 --- a/framework/source/helper/persistentwindowstate.cxx +++ b/framework/source/helper/persistentwindowstate.cxx @@ -260,6 +260,31 @@ void PersistentWindowState::implst_setWindowStateOnWindow(const css::uno::Refere // <- SOLAR SAFE ------------------------ } +//static +void PersistentWindowState::SaveWindowStateToConfig(const css::uno::Reference& rContext, + const css::uno::Reference& rFrame) +{ + // We don't want to do this stuff when being used through LibreOfficeKit + if (comphelper::LibreOfficeKit::isActive()) + return; + + if (!rFrame.is()) + return; + + css::uno::Reference xWindow = rFrame->getContainerWindow(); + if (!xWindow.is()) + return; + + // unknown module -> no configuration available! + OUString sModuleName = PersistentWindowState::implst_identifyModule(rContext, rFrame); + if (sModuleName.isEmpty()) + return; + + OUString sWindowState = PersistentWindowState::implst_getWindowStateFromWindow(xWindow); + PersistentWindowState::implst_setWindowStateOnConfig(rContext, sModuleName, sWindowState); +} + + } // namespace framework /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/source/uielement/newmenucontroller.cxx b/framework/source/uielement/newmenucontroller.cxx index 0aa152028a38..9f773ff869d7 100644 --- a/framework/source/uielement/newmenucontroller.cxx +++ b/framework/source/uielement/newmenucontroller.cxx @@ -32,6 +32,7 @@ #include #include +#include #include #include #include @@ -383,6 +384,10 @@ void SAL_CALL NewMenuController::itemSelected( const css::awt::MenuEvent& rEvent aTargetFrame = pAttributes->aTargetFrame; } + // tdf#144407 save the current window state so a new window of the same type will + // open with the same settings + PersistentWindowState::SaveWindowStateToConfig(m_xContext, m_xFrame); + Sequence< PropertyValue > aArgsList{ comphelper::makePropertyValue(u"Referer"_ustr, u"private:user"_ustr) }; diff --git a/framework/source/uielement/popuptoolbarcontroller.cxx b/framework/source/uielement/popuptoolbarcontroller.cxx index 4fbbf6839b07..81424825b2c2 100644 --- a/framework/source/uielement/popuptoolbarcontroller.cxx +++ b/framework/source/uielement/popuptoolbarcontroller.cxx @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -704,6 +705,10 @@ void SAL_CALL NewToolbarController::execute( sal_Int16 /*KeyModifier*/ ) else aURL = m_aCommandURL; + // tdf#144407 save the current window state so a new window of the same type will + // open with the same settings + PersistentWindowState::SaveWindowStateToConfig(m_xContext, m_xFrame); + css::uno::Sequence< css::beans::PropertyValue > aArgs{ comphelper::makePropertyValue( u"Referer"_ustr, u"private:user"_ustr) }; diff --git a/helpcontent2 b/helpcontent2 index 0321da3f2b7f..22c587639a5c 160000 --- a/helpcontent2 +++ b/helpcontent2 @@ -1 +1 @@ -Subproject commit 0321da3f2b7fca3f7bda1655d64206f28231818e +Subproject commit 22c587639a5c06e9a61a390b4ea18da0cb0c0b68 diff --git a/include/LibreOfficeKit/LibreOfficeKit.h b/include/LibreOfficeKit/LibreOfficeKit.h index 757fb75821f7..b06b978db16c 100644 --- a/include/LibreOfficeKit/LibreOfficeKit.h +++ b/include/LibreOfficeKit/LibreOfficeKit.h @@ -541,6 +541,7 @@ struct _LibreOfficeKitDocumentClass /// @see lok::Document::createSlideRenderer bool (*createSlideRenderer) ( LibreOfficeKitDocument* pThis, + const char* pSlideHash, int nSlideNumber, unsigned* nViewWidth, unsigned* nViewHeight, bool bRenderBackground, bool bRenderMasterPage); diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx b/include/LibreOfficeKit/LibreOfficeKit.hxx index edd62dd59aff..b311fa03d1a9 100644 --- a/include/LibreOfficeKit/LibreOfficeKit.hxx +++ b/include/LibreOfficeKit/LibreOfficeKit.hxx @@ -917,11 +917,12 @@ public: /// Create a slide renderer in core for the input slide. bool createSlideRenderer( + const char* pSlideHash, int nSlideNumber, unsigned* nViewWidth, unsigned* nViewHeight, bool bRenderBackground, bool bRenderMasterPage) { return mpDoc->pClass->createSlideRenderer( - mpDoc, nSlideNumber, nViewWidth, nViewHeight, bRenderBackground, bRenderMasterPage); + mpDoc, pSlideHash, nSlideNumber, nViewWidth, nViewHeight, bRenderBackground, bRenderMasterPage); } /// Clean-up the slideshow (slide renderer) diff --git a/include/animations/animationnodehelper.hxx b/include/animations/animationnodehelper.hxx index c23ab25c140f..8c79342c789b 100644 --- a/include/animations/animationnodehelper.hxx +++ b/include/animations/animationnodehelper.hxx @@ -19,12 +19,18 @@ #pragma once +#include +#include +#include +#include + #include #include #include #include #include #include +#include #include @@ -108,6 +114,59 @@ namespace anim return false; } + + inline css::uno::Reference getParagraphTarget( + const css::presentation::ParagraphTarget& pTarget) + { + try + { + css::uno::Reference xParaEnumAccess( + pTarget.Shape, css::uno::UNO_QUERY_THROW); + + css::uno::Reference xEnumeration( + xParaEnumAccess->createEnumeration(), + css::uno::UNO_SET_THROW); + sal_Int32 nParagraph = pTarget.Paragraph; + + while (xEnumeration->hasMoreElements()) + { + css::uno::Reference xRef( + xEnumeration->nextElement(), css::uno::UNO_QUERY); + if (nParagraph-- == 0) + return xRef; + } + } + catch (const css::uno::RuntimeException&) + { + SAL_WARN("animations", "getParagraphTarget"); + } + + css::uno::Reference xRef; + return xRef; + } + + inline void convertTarget(OStringBuffer& sTmp, const css::uno::Any& rTarget) + { + if (!rTarget.hasValue()) + return; + + css::uno::Reference xRef; + if (!(rTarget >>= xRef)) + { + if (auto pt = o3tl::tryAccess(rTarget)) + { + xRef = getParagraphTarget(*pt); + } + } + + SAL_WARN_IF(!xRef.is(), "animations", "convertTarget(), invalid target type!"); + if (xRef.is()) + { + const std::string aIdentifier(GetInterfaceHash(xRef)); + if (!aIdentifier.empty()) + sTmp.append(aIdentifier); + } + } } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/basegfx/point/b2dpoint.hxx b/include/basegfx/point/b2dpoint.hxx index ce16965de042..94140aa6f5e1 100644 --- a/include/basegfx/point/b2dpoint.hxx +++ b/include/basegfx/point/b2dpoint.hxx @@ -19,7 +19,9 @@ #pragma once +#include #include +#include #include #include @@ -122,6 +124,19 @@ namespace basegfx { return static_cast( ::basegfx::B2DTuple::getEmptyTuple() ); } + + friend auto operator <=>(B2DPoint const & a, B2DPoint const & b) + { + // Avoid compilation failure with Android NDK 23.2, where std::tuple operator <=> isn't + // yet implemented (and where __cpp_lib_three_way_comparison happens to not be defined + // in , so discriminate on that): +#if defined __cpp_lib_three_way_comparison + return std::tie(a.mnX, a.mnY) <=> std::tie(b.mnX, b.mnY); +#else + auto const comp = a.mnX <=> b.mnX; + return comp == 0 ? a.mnY <=> b.mnY : comp; +#endif + } }; // external operators diff --git a/include/comphelper/propertycontainer.hxx b/include/comphelper/propertycontainer.hxx index 2c64b2cdfedf..0c663e7bacab 100644 --- a/include/comphelper/propertycontainer.hxx +++ b/include/comphelper/propertycontainer.hxx @@ -53,7 +53,7 @@ protected: /// for scripting : the types of the interfaces supported by this class /// /// @throws css::uno::RuntimeException - static css::uno::Sequence< css::uno::Type > getBaseTypes(); + css::uno::Sequence< css::uno::Type > getBaseTypes(); // OPropertySetHelper overridables virtual sal_Bool SAL_CALL convertFastPropertyValue( diff --git a/include/editeng/outliner.hxx b/include/editeng/outliner.hxx index b18690050037..d1d46dc67326 100644 --- a/include/editeng/outliner.hxx +++ b/include/editeng/outliner.hxx @@ -866,7 +866,7 @@ public: SAL_DLLPRIVATE const Link& GetEndMovingHdl() const {return aEndMovingHdl;} SAL_DLLPRIVATE void SetEndMovingHdl( const Link& rLink){aEndMovingHdl=rLink;} - sal_uInt32 GetLineCount( sal_Int32 nParagraph ) const; + sal_Int32 GetLineCount( sal_Int32 nParagraph ) const; sal_Int32 GetLineLen( sal_Int32 nParagraph, sal_Int32 nLine ) const; sal_uInt32 GetLineHeight( sal_Int32 nParagraph, sal_Int32 nLine = 0 ); diff --git a/include/svx/XPropertyEntry.hxx b/include/svx/XPropertyEntry.hxx index bfb0aa25c702..8ac1734a4196 100644 --- a/include/svx/XPropertyEntry.hxx +++ b/include/svx/XPropertyEntry.hxx @@ -28,6 +28,7 @@ class SVXCORE_DLLPUBLIC XPropertyEntry private: OUString maPropEntryName; BitmapEx maUiBitmap; + bool mbSavingAllowed; protected: XPropertyEntry(OUString aPropEntryName); @@ -40,11 +41,14 @@ public: XPropertyEntry& operator=(XPropertyEntry const&) = default; XPropertyEntry& operator=(XPropertyEntry&&) = default; + virtual std::unique_ptr Clone() const = 0; void SetName(const OUString& rPropEntryName) { maPropEntryName = rPropEntryName; } const OUString& GetName() const { return maPropEntryName; } void SetUiBitmap(const BitmapEx& rUiBitmap) { maUiBitmap = rUiBitmap; } const BitmapEx& GetUiBitmap() const { return maUiBitmap; } + void SetSavingAllowed(bool bSet) { mbSavingAllowed = bSet; } + bool GetSavingAllowed() const { return mbSavingAllowed; } }; #endif // INCLUDED_SVX_XPROPERTYENTRY_HXX diff --git a/include/svx/svddrgmt.hxx b/include/svx/svddrgmt.hxx index 3352f09196b3..291d1c8d6c40 100644 --- a/include/svx/svddrgmt.hxx +++ b/include/svx/svddrgmt.hxx @@ -257,8 +257,8 @@ public: class SVXCORE_DLLPUBLIC SdrDragResize : public SdrDragMethod { protected: - Fraction aXFact; - Fraction aYFact; + Fraction m_aXFact; + Fraction m_aYFact; public: SdrDragResize(SdrDragView& rNewView); diff --git a/include/svx/txencbox.hxx b/include/svx/txencbox.hxx index 7795ea81e764..39a878c3dc49 100644 --- a/include/svx/txencbox.hxx +++ b/include/svx/txencbox.hxx @@ -132,7 +132,10 @@ public: rtl_TextEncoding GetSelectTextEncoding() const; - void connect_changed(const Link& rLink) { m_xControl->connect_changed(rLink); } + void connect_changed(const Link& rLink) + { + m_xControl->connect_selection_changed(rLink); + } void connect_row_activated(const Link& rLink) { m_xControl->connect_row_activated(rLink); } void grab_focus() { m_xControl->grab_focus(); } void show() { m_xControl->show(); } diff --git a/include/svx/xtable.hxx b/include/svx/xtable.hxx index 43ea9820d5a1..5725d02dd76e 100644 --- a/include/svx/xtable.hxx +++ b/include/svx/xtable.hxx @@ -46,6 +46,7 @@ private: public: XColorEntry(const Color& rColor, const OUString& rName); + std::unique_ptr Clone() const override; const Color& GetColor() const { @@ -61,6 +62,7 @@ private: public: XLineEndEntry(basegfx::B2DPolyPolygon aB2DPolyPolygon, const OUString& rName); XLineEndEntry(const XLineEndEntry& rOther); + std::unique_ptr Clone() const override; const basegfx::B2DPolyPolygon& GetLineEnd() const { @@ -76,6 +78,7 @@ private: public: XDashEntry(const XDash& rDash, const OUString& rName); XDashEntry(const XDashEntry& rOther); + std::unique_ptr Clone() const override; const XDash& GetDash() const { @@ -91,6 +94,7 @@ private: public: XHatchEntry(const XHatch& rHatch, const OUString& rName); XHatchEntry(const XHatchEntry& rOther); + std::unique_ptr Clone() const override; const XHatch& GetHatch() const { @@ -106,6 +110,7 @@ private: public: XGradientEntry(const basegfx::BGradient& rGradient, const OUString& rName); XGradientEntry(const XGradientEntry& rOther); + std::unique_ptr Clone() const override; const basegfx::BGradient& GetGradient() const { @@ -121,6 +126,7 @@ private: public: XBitmapEntry(const GraphicObject& rGraphicObject, const OUString& rName); XBitmapEntry(const XBitmapEntry& rOther); + std::unique_ptr Clone() const override; const GraphicObject& GetGraphicObject() const { @@ -167,6 +173,9 @@ protected: bool isValidIdx(tools::Long nIndex) const; virtual BitmapEx CreateBitmapForUI(tools::Long nIndex) = 0; +private: + bool mbNeedsExportableList; // impl: avoid seldom-needed, expensive list cloning + public: XPropertyList(const XPropertyList&) = delete; XPropertyList& operator=(const XPropertyList&) = delete; diff --git a/include/systools/win32/winstoreutil.hxx b/include/systools/win32/winstoreutil.hxx index aa0a70e64423..c3a56c9bbd80 100644 --- a/include/systools/win32/winstoreutil.hxx +++ b/include/systools/win32/winstoreutil.hxx @@ -12,6 +12,7 @@ #include #include +#include #include namespace sal::systools @@ -19,13 +20,8 @@ namespace sal::systools // Returns true if the current process is run as a Windows store app, which has some specifics inline bool IsStorePackagedApp() { - // GetCurrentPackageFullName is only available since Windows 8 - HMODULE hDll = GetModuleHandleW(L"kernel32.dll"); - using Func_t = LONG WINAPI(UINT32*, PWSTR); - if (auto pFunc = reinterpret_cast(GetProcAddress(hDll, "GetCurrentPackageFullName"))) - if (UINT32 size = 0; pFunc(&size, nullptr) == ERROR_INSUFFICIENT_BUFFER) - return true; - return false; + UINT32 size = 0; + return GetCurrentPackageFullName(&size, nullptr) == ERROR_INSUFFICIENT_BUFFER; } } // sal::systools diff --git a/include/ucbhelper/interactionrequest.hxx b/include/ucbhelper/interactionrequest.hxx index 166e7ce137b6..ae8bf4d6dcef 100644 --- a/include/ucbhelper/interactionrequest.hxx +++ b/include/ucbhelper/interactionrequest.hxx @@ -130,7 +130,7 @@ public: * method the way that they simply call recordSelection() which is provided by * this class. */ -class UNLESS_MERGELIBS(UCBHELPER_DLLPUBLIC) InteractionContinuation : public cppu::OWeakObject +class UNLESS_MERGELIBS(UCBHELPER_DLLPUBLIC) InteractionContinuation : public cppu::WeakImplHelper<> { InteractionRequest* m_pRequest; @@ -150,138 +150,84 @@ public: }; +using InteractionAbort_BASE = cppu::ImplInheritanceHelper; /** * This class implements a standard interaction continuation, namely the * interface XInteractionAbort. Instances of this class can be passed * along with an interaction request to indicate the possibility to abort * the operation that caused the request. */ -class UNLESS_MERGELIBS(UCBHELPER_DLLPUBLIC) InteractionAbort final : public InteractionContinuation, - public css::lang::XTypeProvider, - public css::task::XInteractionAbort +class UNLESS_MERGELIBS(UCBHELPER_DLLPUBLIC) InteractionAbort final : public InteractionAbort_BASE { public: InteractionAbort( InteractionRequest * pRequest ) - : InteractionContinuation( pRequest ) {} - - // XInterface - virtual css::uno::Any SAL_CALL - queryInterface( const css::uno::Type & rType ) override; - virtual void SAL_CALL acquire() noexcept override - { OWeakObject::acquire(); } - virtual void SAL_CALL release() noexcept override - { OWeakObject::release(); } - - // XTypeProvider - virtual css::uno::Sequence< css::uno::Type > SAL_CALL - getTypes() override; - virtual css::uno::Sequence< sal_Int8 > SAL_CALL - getImplementationId() override; + : InteractionAbort_BASE( pRequest ) {} // XInteractionContinuation virtual void SAL_CALL select() override; }; +using InteractionRetry_BASE = cppu::ImplInheritanceHelper; /** * This class implements a standard interaction continuation, namely the * interface XInteractionRetry. Instances of this class can be passed * along with an interaction request to indicate the possibility to retry * the operation that caused the request. */ -class UNLESS_MERGELIBS(UCBHELPER_DLLPUBLIC) InteractionRetry final : public InteractionContinuation, - public css::lang::XTypeProvider, - public css::task::XInteractionRetry +class UNLESS_MERGELIBS(UCBHELPER_DLLPUBLIC) InteractionRetry final : public InteractionRetry_BASE { public: InteractionRetry( InteractionRequest * pRequest ) - : InteractionContinuation( pRequest ) {} - - // XInterface - virtual css::uno::Any SAL_CALL - queryInterface( const css::uno::Type & rType ) override; - virtual void SAL_CALL acquire() noexcept override - { OWeakObject::acquire(); } - virtual void SAL_CALL release() noexcept override - { OWeakObject::release(); } - - // XTypeProvider - virtual css::uno::Sequence< css::uno::Type > SAL_CALL - getTypes() override; - virtual css::uno::Sequence< sal_Int8 > SAL_CALL - getImplementationId() override; + : InteractionRetry_BASE( pRequest ) {} // XInteractionContinuation virtual void SAL_CALL select() override; }; +using InteractionApprove_BASE = cppu::ImplInheritanceHelper; /** * This class implements a standard interaction continuation, namely the * interface XInteractionApprove. Instances of this class can be passed * along with an interaction request to indicate the possibility to approve * the request. */ -class UCBHELPER_DLLPUBLIC InteractionApprove final : public InteractionContinuation, - public css::lang::XTypeProvider, - public css::task::XInteractionApprove +class UCBHELPER_DLLPUBLIC InteractionApprove final : public InteractionApprove_BASE { public: InteractionApprove( InteractionRequest * pRequest ) - : InteractionContinuation( pRequest ) {} - - // XInterface - virtual css::uno::Any SAL_CALL - queryInterface( const css::uno::Type & rType ) override; - virtual void SAL_CALL acquire() noexcept override - { OWeakObject::acquire(); } - virtual void SAL_CALL release() noexcept override - { OWeakObject::release(); } - - // XTypeProvider - virtual css::uno::Sequence< css::uno::Type > SAL_CALL - getTypes() override; - virtual css::uno::Sequence< sal_Int8 > SAL_CALL - getImplementationId() override; + : InteractionApprove_BASE( pRequest ) {} // XInteractionContinuation virtual void SAL_CALL select() override; }; +using InteractionDisapprove_BASE = cppu::ImplInheritanceHelper; /** * This class implements a standard interaction continuation, namely the * interface XInteractionDisapprove. Instances of this class can be passed * along with an interaction request to indicate the possibility to disapprove * the request. */ -class UCBHELPER_DLLPUBLIC InteractionDisapprove final : public InteractionContinuation, - public css::lang::XTypeProvider, - public css::task::XInteractionDisapprove +class UCBHELPER_DLLPUBLIC InteractionDisapprove final : public InteractionDisapprove_BASE { public: InteractionDisapprove( InteractionRequest * pRequest ) - : InteractionContinuation( pRequest ) {} - - // XInterface - virtual css::uno::Any SAL_CALL - queryInterface( const css::uno::Type & rType ) override; - virtual void SAL_CALL acquire() noexcept override - { OWeakObject::acquire(); } - virtual void SAL_CALL release() noexcept override - { OWeakObject::release(); } - - // XTypeProvider - virtual css::uno::Sequence< css::uno::Type > SAL_CALL - getTypes() override; - virtual css::uno::Sequence< sal_Int8 > SAL_CALL - getImplementationId() override; + : InteractionDisapprove_BASE( pRequest ) {} // XInteractionContinuation virtual void SAL_CALL select() override; }; +using InteractionSupplyAuthentication_BASE = cppu::ImplInheritanceHelper; /** * This class implements a standard interaction continuation, namely the * interface XInteractionSupplyAuthentication. Instances of this class can be @@ -289,9 +235,7 @@ public: * interaction handler to supply the missing authentication data. */ class UCBHELPER_DLLPUBLIC InteractionSupplyAuthentication final : - public InteractionContinuation, - public css::lang::XTypeProvider, - public css::ucb::XInteractionSupplyAuthentication2 + public InteractionSupplyAuthentication_BASE { css::uno::Sequence< css::ucb::RememberAuthentication > m_aRememberPasswordModes; @@ -355,20 +299,6 @@ public: const css::ucb::RememberAuthentication eDefaultRememberAccountMode, bool bCanUseSystemCredentials ); - // XInterface - virtual css::uno::Any SAL_CALL - queryInterface( const css::uno::Type & rType ) override; - virtual void SAL_CALL acquire() noexcept override - { OWeakObject::acquire(); } - virtual void SAL_CALL release() noexcept override - { OWeakObject::release(); } - - // XTypeProvider - virtual css::uno::Sequence< css::uno::Type > SAL_CALL - getTypes() override; - virtual css::uno::Sequence< sal_Int8 > SAL_CALL - getImplementationId() override; - // XInteractionContinuation virtual void SAL_CALL select() override; @@ -461,7 +391,7 @@ inline InteractionSupplyAuthentication::InteractionSupplyAuthentication( const css::uno::Sequence< css::ucb::RememberAuthentication > & rRememberAccountModes, const css::ucb::RememberAuthentication eDefaultRememberAccountMode, bool bCanUseSystemCredentials ) -: InteractionContinuation( pRequest ), +: InteractionSupplyAuthentication_BASE( pRequest ), m_aRememberPasswordModes( rRememberPasswordModes ), m_aRememberAccountModes( rRememberAccountModes ), m_eRememberPasswordMode( eDefaultRememberPasswordMode ), @@ -477,6 +407,8 @@ inline InteractionSupplyAuthentication::InteractionSupplyAuthentication( } +using InteractionReplaceExistingData_BASE = cppu::ImplInheritanceHelper; /** * This class implements a standard interaction continuation, namely the * interface XInteractionReplaceExistingData. Instances of this class can be @@ -484,49 +416,26 @@ inline InteractionSupplyAuthentication::InteractionSupplyAuthentication( * replace existing data. */ class InteractionReplaceExistingData final : - public InteractionContinuation, - public css::lang::XTypeProvider, - public css::ucb::XInteractionReplaceExistingData + public InteractionReplaceExistingData_BASE { public: InteractionReplaceExistingData( InteractionRequest * pRequest ) - : InteractionContinuation( pRequest ) {} - - // XInterface - virtual css::uno::Any SAL_CALL - queryInterface( const css::uno::Type & rType ) override; - virtual void SAL_CALL acquire() noexcept override - { OWeakObject::acquire(); } - virtual void SAL_CALL release() noexcept override - { OWeakObject::release(); } - - // XTypeProvider - virtual css::uno::Sequence< css::uno::Type > SAL_CALL - getTypes() override; - virtual css::uno::Sequence< sal_Int8 > SAL_CALL - getImplementationId() override; + : InteractionReplaceExistingData_BASE( pRequest ) {} // XInteractionContinuation virtual void SAL_CALL select() override; }; +using InteractionAuthFallback_BASE = cppu::ImplInheritanceHelper; class UCBHELPER_DLLPUBLIC InteractionAuthFallback final : - public InteractionContinuation, - public css::ucb::XInteractionAuthFallback + public InteractionAuthFallback_BASE { OUString m_aCode; public: InteractionAuthFallback( InteractionRequest * pRequest ) - : InteractionContinuation( pRequest ) {} - - // XInterface - virtual css::uno::Any SAL_CALL - queryInterface( const css::uno::Type & rType ) override; - virtual void SAL_CALL acquire() noexcept override - { OWeakObject::acquire(); } - virtual void SAL_CALL release() noexcept override - { OWeakObject::release(); } + : InteractionAuthFallback_BASE( pRequest ) {} // XInteractionContinuation virtual void SAL_CALL select() override; @@ -535,8 +444,6 @@ public: virtual void SAL_CALL setCode( const OUString& code ) override; /// @throws css::uno::RuntimeException const OUString& getCode() const; - - }; diff --git a/include/vcl/ITiledRenderable.hxx b/include/vcl/ITiledRenderable.hxx index 05db0bad6db0..9e57fc53b0a0 100644 --- a/include/vcl/ITiledRenderable.hxx +++ b/include/vcl/ITiledRenderable.hxx @@ -392,6 +392,7 @@ public: } /** Creates a slide show renderer (Impress only function) */ virtual bool createSlideRenderer( + const OString& /*rSlideHash*/, sal_Int32 /*nSlideNumber*/, sal_Int32& /*nViewWidth*/, sal_Int32& /*nViewHeight*/, bool /*bRenderBackground*/, bool /*bRenderMasterPage*/) { diff --git a/include/vcl/bitmapex.hxx b/include/vcl/bitmapex.hxx index ebc56930192e..bfcbaa99e234 100644 --- a/include/vcl/bitmapex.hxx +++ b/include/vcl/bitmapex.hxx @@ -483,8 +483,8 @@ private: BitmapEx VCL_DLLPUBLIC createAlphaBlendFrame( const Size& rSize, sal_uInt8 nAlpha, - Color aColorTopLeft, - Color aColorBottomRight); + const Color& rColorTopLeft, + const Color& rColorBottomRight); /** Create a blend frame as BitmapEx using an alpha value @@ -501,10 +501,10 @@ BitmapEx VCL_DLLPUBLIC createAlphaBlendFrame( BitmapEx createAlphaBlendFrame( const Size& rSize, sal_uInt8 nAlpha, - Color aColorTopLeft, - Color aColorTopRight, - Color aColorBottomRight, - Color aColorBottomLeft); + const Color& rColorTopLeft, + const Color& rColorTopRight, + const Color& rColorBottomRight, + const Color& rColorBottomLeft); #endif // INCLUDED_VCL_BITMAPEX_HXX diff --git a/include/vcl/builderbase.hxx b/include/vcl/builderbase.hxx index 04b534b92a4e..573817315f72 100644 --- a/include/vcl/builderbase.hxx +++ b/include/vcl/builderbase.hxx @@ -88,6 +88,7 @@ protected: static bool extractEntry(stringmap& rMap); static OUString extractIconName(stringmap& rMap); static bool extractShowExpanders(stringmap& rMap); + static OUString extractTitle(stringmap& rMap); static OUString extractTooltipText(stringmap& rMap); static bool extractVisible(stringmap& rMap); void extractClassAndIdAndCustomProperty(xmlreader::XmlReader& reader, OUString& rClass, diff --git a/include/vcl/jsdialog/executor.hxx b/include/vcl/jsdialog/executor.hxx index 260be394d6b8..83515ca65ef1 100644 --- a/include/vcl/jsdialog/executor.hxx +++ b/include/vcl/jsdialog/executor.hxx @@ -23,7 +23,7 @@ public: static void trigger_changed(weld::ComboBox& rComboBox) { rComboBox.signal_changed(); } - static void trigger_changed(weld::TreeView& rTreeView) { rTreeView.signal_changed(); } + static void trigger_changed(weld::TreeView& rTreeView) { rTreeView.signal_selection_changed(); } static void trigger_changed(weld::IconView& rIconView) { rIconView.signal_selection_changed(); } diff --git a/include/vcl/pdf/PDFEncryptionInitialization.hxx b/include/vcl/pdf/PDFEncryptionInitialization.hxx new file mode 100644 index 000000000000..93b57476d7e4 --- /dev/null +++ b/include/vcl/pdf/PDFEncryptionInitialization.hxx @@ -0,0 +1,31 @@ +/* -*- 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/. + * + */ + +#pragma once + +#include +#include + +namespace com::sun::star::beans +{ +class XMaterialHolder; +} +namespace com::sun::star::uno +{ +template class Reference; +} + +namespace vcl::pdf +{ +VCL_DLLPUBLIC css::uno::Reference +initEncryption(const OUString& i_rOwnerPassword, const OUString& i_rUserPassword); +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/vcl/pdfwriter.hxx b/include/vcl/pdfwriter.hxx index a863b17c1879..14c6265f3d88 100644 --- a/include/vcl/pdfwriter.hxx +++ b/include/vcl/pdfwriter.hxx @@ -77,15 +77,16 @@ class VCL_DLLPUBLIC PDFOutputStream struct PDFEncryptionProperties { //for both 40 and 128 bit security, see 3.5.2 PDF v 1.4 table 3.15, v 1.5 and v 1.6 table 3.20. - bool CanPrintTheDocument; - bool CanModifyTheContent; - bool CanCopyOrExtract; - bool CanAddOrModify; + bool CanPrintTheDocument = false; + bool CanModifyTheContent = false; + bool CanCopyOrExtract = false; + bool CanAddOrModify = false; + //for revision 3 (bit 128 security) only - bool CanFillInteractive; - bool CanExtractForAccessibility; - bool CanAssemble; - bool CanPrintFull; + bool CanFillInteractive = false; + bool CanExtractForAccessibility = true; + bool CanAssemble = false; + bool CanPrintFull = false; // encryption will only happen if EncryptionKey is not empty // EncryptionKey is actually a construct out of OValue, UValue and DocumentIdentifier @@ -98,22 +99,16 @@ struct PDFEncryptionProperties std::vector EncryptionKey; std::vector DocumentIdentifier; - //permission default set for 128 bit, accessibility only - PDFEncryptionProperties() : - CanPrintTheDocument ( false ), - CanModifyTheContent ( false ), - CanCopyOrExtract ( false ), - CanAddOrModify ( false ), - CanFillInteractive ( false ), - CanExtractForAccessibility ( true ), - CanAssemble ( false ), - CanPrintFull ( false ) - {} - - - bool Encrypt() const + bool canEncrypt() const { - return ! OValue.empty() && ! UValue.empty() && ! DocumentIdentifier.empty(); + return !OValue.empty() && !UValue.empty() && !DocumentIdentifier.empty(); + } + + void clear() + { + OValue.clear(); + UValue.clear(); + EncryptionKey.clear(); } }; diff --git a/include/vcl/settings.hxx b/include/vcl/settings.hxx index 401da27abf7d..aba70200b324 100644 --- a/include/vcl/settings.hxx +++ b/include/vcl/settings.hxx @@ -31,8 +31,6 @@ #include #include -#include - class BitmapEx; class LanguageTag; class SvtSysLocale; diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx index 719ced7a0e21..979068233d36 100644 --- a/include/vcl/svapp.hxx +++ b/include/vcl/svapp.hxx @@ -1296,11 +1296,11 @@ public: static css::uno::Reference< css::ui::dialogs::XFolderPicker2 > createFolderPicker( const css::uno::Reference< css::uno::XComponentContext >& rServiceManager ); - /** Returns true, if the VCL plugin runs on the system event loop. + /** Returns true, if the VCL plugin should run on the system event loop. * * AKA the VCL plugin can't handle nested event loops, like WASM or mobile. */ - static bool IsOnSystemEventLoop(); + static bool IsUseSystemEventLoop(); ///@} diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index 74290a3c9ec7..ebe2d8a25ef8 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -966,7 +966,7 @@ private: OUString m_sSavedValue; protected: - Link m_aChangeHdl; + Link m_aSelectionChangedHdl; Link m_aRowActivatedHdl; Link m_aColumnClickedHdl; Link m_aRadioToggleHdl; @@ -986,7 +986,7 @@ protected: std::function m_aCustomSort; protected: - void signal_changed() { m_aChangeHdl.Call(*this); } + void signal_selection_changed() { m_aSelectionChangedHdl.Call(*this); } bool signal_row_activated() { return m_aRowActivatedHdl.Call(*this); } void signal_column_clicked(int nColumn) { m_aColumnClickedHdl.Call(nColumn); } bool signal_expanding(const TreeIter& rIter) @@ -1076,7 +1076,10 @@ public: virtual void insert_separator(int pos, const OUString& rId) = 0; void append_separator(const OUString& rId) { insert_separator(-1, rId); } - void connect_changed(const Link& rLink) { m_aChangeHdl = rLink; } + void connect_selection_changed(const Link& rLink) + { + m_aSelectionChangedHdl = rLink; + } /* A row is "activated" when the user double clicks a treeview row. It may also be emitted when a row is selected and Space or Enter is pressed. diff --git a/instsetoo_native/inc_openoffice/windows/msi_languages/LaunchCo.ulf b/instsetoo_native/inc_openoffice/windows/msi_languages/LaunchCo.ulf index 5e57eb1c3c0e..8f4fa841aac6 100644 --- a/instsetoo_native/inc_openoffice/windows/msi_languages/LaunchCo.ulf +++ b/instsetoo_native/inc_openoffice/windows/msi_languages/LaunchCo.ulf @@ -2,5 +2,3 @@ en-US = "The Installation Wizard cannot be run properly because you are logged in as a user without sufficient administrator rights for this system." [OOO_LAUNCH_2] en-US = "[ProductName] cannot be installed on this Windows version. [WindowsMinVersionText] or newer is required." -[OOO_LAUNCH_3] -en-US = "To install [ProductName] on Windows 8.1, at least April 2014 update rollup (MS KB 2919355) must be installed." diff --git a/instsetoo_native/inc_openoffice/windows/msi_templates/AppSearc.idt b/instsetoo_native/inc_openoffice/windows/msi_templates/AppSearc.idt index 0a5b68ed4186..569132a50bae 100644 --- a/instsetoo_native/inc_openoffice/windows/msi_templates/AppSearc.idt +++ b/instsetoo_native/inc_openoffice/windows/msi_templates/AppSearc.idt @@ -1,5 +1,4 @@ Property Signature_ s72 s72 AppSearch Property Signature_ -WIN81S14 win81s14 WINMAJORVER WinMajorVer diff --git a/instsetoo_native/inc_openoffice/windows/msi_templates/DrLocato.idt b/instsetoo_native/inc_openoffice/windows/msi_templates/DrLocato.idt index 589ab7c52806..dfdbe78c60ec 100644 --- a/instsetoo_native/inc_openoffice/windows/msi_templates/DrLocato.idt +++ b/instsetoo_native/inc_openoffice/windows/msi_templates/DrLocato.idt @@ -1,4 +1,3 @@ Signature_ Parent Path Depth s72 S72 S255 I2 DrLocator Signature_ Parent Path -win81s14 [SystemFolder] diff --git a/instsetoo_native/inc_openoffice/windows/msi_templates/LaunchCo.idt b/instsetoo_native/inc_openoffice/windows/msi_templates/LaunchCo.idt index 629c3c5582e1..4d064b92ed0a 100644 --- a/instsetoo_native/inc_openoffice/windows/msi_templates/LaunchCo.idt +++ b/instsetoo_native/inc_openoffice/windows/msi_templates/LaunchCo.idt @@ -2,5 +2,4 @@ Condition Description s255 l255 65001 LaunchCondition Condition Privileged OOO_LAUNCH_1 -Installed Or VersionNT > WindowsMinVersionNumber Or (VersionNT = WindowsMinVersionNumber And ServicePackLevel >= WindowsMinSPNumber) OOO_LAUNCH_2 -Installed Or VersionNT <> 603 Or WIN81S14 OOO_LAUNCH_3 +Installed Or (WINMAJORVER >= WinMajorVerMin) OOO_LAUNCH_2 diff --git a/instsetoo_native/inc_openoffice/windows/msi_templates/Property.idt b/instsetoo_native/inc_openoffice/windows/msi_templates/Property.idt index e528cac384ec..c066aa162c7f 100644 --- a/instsetoo_native/inc_openoffice/windows/msi_templates/Property.idt +++ b/instsetoo_native/inc_openoffice/windows/msi_templates/Property.idt @@ -63,5 +63,4 @@ STR_INSTALLATION_WIZARD OOO_STR_INSTALLATION_WIZARD UpgradeCode UPGRADECODETEMPLATE VC_REDIST 1 WindowsMinVersionText WINDOWSMINVERSIONTEXTTEMPLATE -WindowsMinVersionNumber WINDOWSMINVERSIONNUMBERTEMPLATE -WindowsMinSPNumber WINDOWSMINSPNUMBERTEMPLATE +WinMajorVerMin WINMAJORVERMINTEMPLATE diff --git a/instsetoo_native/inc_openoffice/windows/msi_templates/Signatur.idt b/instsetoo_native/inc_openoffice/windows/msi_templates/Signatur.idt index d5abd9769125..5004a55863ba 100644 --- a/instsetoo_native/inc_openoffice/windows/msi_templates/Signatur.idt +++ b/instsetoo_native/inc_openoffice/windows/msi_templates/Signatur.idt @@ -1,7 +1,3 @@ Signature FileName MinVersion MaxVersion MinSize MaxSize MinDate MaxDate Languages s72 s255 S20 S20 I4 I4 I4 I4 S255 Signature Signature -# Since it's impossible to match minimal version in Signature table independent of -# language, and we need language-independent comparison, we use a value that is at -# least 1 less (see note at https://msdn.microsoft.com/en-us/library/aa371853). -win81s14 kernel32.dll 6.3.9600.17030 diff --git a/io/qa/textinputstream.cxx b/io/qa/textinputstream.cxx index ddfbd3afd134..e53a35ba3801 100644 --- a/io/qa/textinputstream.cxx +++ b/io/qa/textinputstream.cxx @@ -32,7 +32,11 @@ namespace { class Input: public cppu::WeakImplHelper { public: - Input(): open_(true), index_(0) {} + Input(char* inputData, sal_Int32 inputSize): + open_(true), + index_(0), + size(inputSize), + data(inputData) {} private: virtual ~Input() override {} @@ -47,14 +51,14 @@ private: assert(nMaxBytesToRead >= 0); osl::MutexGuard g(mutex_); checkClosed(); - assert(index_ >= 0 && index_ <= SIZE); + assert(index_ >= 0 && index_ <= size); sal_Int32 n = std::min( - std::min(nMaxBytesToRead, 2), SIZE - index_); - assert(n >= 0 && n <= SIZE - index_); + std::min(nMaxBytesToRead, 2), size - index_); + assert(n >= 0 && n <= size - index_); aData.realloc(n); std::memcpy(aData.getArray(), data + index_, n); index_ += n; - assert(index_ >= 0 && index_ <= SIZE); + assert(index_ >= 0 && index_ <= size); return n; } @@ -63,17 +67,17 @@ private: assert(nBytesToSkip >= 0); osl::MutexGuard g(mutex_); checkClosed(); - assert(index_ >= 0 && index_ <= SIZE); - index_ += std::min(nBytesToSkip, SIZE - index_); - assert(index_ >= 0 && index_ <= SIZE); + assert(index_ >= 0 && index_ <= size); + index_ += std::min(nBytesToSkip, size - index_); + assert(index_ >= 0 && index_ <= size); } sal_Int32 SAL_CALL available() override { osl::MutexGuard g(mutex_); checkClosed(); - assert(index_ >= 0 && index_ <= SIZE); - return SIZE - index_; + assert(index_ >= 0 && index_ <= size); + return size - index_; } void SAL_CALL closeInput() override @@ -90,33 +94,73 @@ private: } } - static sal_Int32 const SIZE = 9; - static char const data[SIZE]; - osl::Mutex mutex_; bool open_; sal_Int32 index_; -}; -char const Input::data[] = { '1', '2', '3', '4', '5', '6', '7', '8', '9' }; + sal_Int32 size; + char* data; + +}; class Test: public test::BootstrapFixtureBase { private: CPPUNIT_TEST_SUITE(Test); CPPUNIT_TEST(testReadLine); + CPPUNIT_TEST(testReadLineEndChars); CPPUNIT_TEST_SUITE_END(); void testReadLine(); + void testReadLineEndChars(); + + OUString readFirstLine(char data1[], int size); }; -void Test::testReadLine() { +OUString Test::readFirstLine(char *inputData, int inputSize) { css::uno::Reference s( css::io::TextInputStream::create(getComponentContext())); - s->setInputStream(new Input); - OUString l(s->readLine()); + s->setInputStream(new Input(inputData, inputSize)); + return s->readLine(); +} + +void Test::testReadLine() { + char inputData[] = {'1', '2', '3', '4', '5', '6', '7', '8', '9'}; + OUString l(readFirstLine(inputData, sizeof(inputData))); CPPUNIT_ASSERT_EQUAL(u"123456789"_ustr, l); } +void Test::testReadLineEndChars() { + std::vector inputData = {'a', 'b', 'c', '\r'}; + OUString l(readFirstLine(inputData.data(), inputData.size())); + CPPUNIT_ASSERT_EQUAL(u"abc"_ustr, l); + + inputData = {'a', 'b', 'c', '\n'}; + l = readFirstLine(inputData.data(), inputData.size()); + CPPUNIT_ASSERT_EQUAL(u"abc"_ustr, l); + + inputData = {'a', 'b', 'c', '\r', '\n'}; + l = readFirstLine(inputData.data(), inputData.size()); + CPPUNIT_ASSERT_EQUAL(u"abc"_ustr, l); + + inputData = {'a', 'b', 'c', '\r', 'd', 'e', 'f'}; + l = readFirstLine(inputData.data(), inputData.size()); + CPPUNIT_ASSERT_EQUAL(u"abc"_ustr, l); + + inputData = {'a', 'b', 'c', '\n', 'd', 'e', 'f'}; + l = readFirstLine(inputData.data(), inputData.size()); + CPPUNIT_ASSERT_EQUAL(u"abc"_ustr, l); + + css::uno::Reference s( + css::io::TextInputStream::create(getComponentContext())); + inputData = {'a', 'b', 'c', '\r', '\n', 'd', 'e', 'f'}; + s->setInputStream(new Input(inputData.data(), inputData.size())); + l = s->readLine(); + CPPUNIT_ASSERT_EQUAL(u"abc"_ustr, l); + l = s->readLine(); + CPPUNIT_ASSERT_EQUAL(u"def"_ustr, l); +} + + CPPUNIT_TEST_SUITE_REGISTRATION(Test); } diff --git a/io/source/TextInputStream/TextInputStream.cxx b/io/source/TextInputStream/TextInputStream.cxx index 4dd0bd50dc25..94710fe6c8d5 100644 --- a/io/source/TextInputStream/TextInputStream.cxx +++ b/io/source/TextInputStream/TextInputStream.cxx @@ -169,24 +169,19 @@ OUString OTextInputStream::implReadString( const Sequence< sal_Unicode >& Delimi return aRetStr; // Only for bFindLineEnd - sal_Unicode cLineEndChar1 = 0x0D; - sal_Unicode cLineEndChar2 = 0x0A; + constexpr sal_Unicode cLineEndChar1 = '\r'; + constexpr sal_Unicode cLineEndChar2 = '\n'; sal_Int32 nBufferReadPos = 0; - sal_Int32 nCopyLen = 0; - bool bFound = false; - bool bFoundFirstLineEndChar = false; + sal_Int32 nCopyLen = -1; sal_Unicode cFirstLineEndChar = 0; - while( !bFound ) + while (true) { // Still characters available? if( nBufferReadPos == mnCharsInBuffer ) { // Already reached EOF? Then we can't read any more - if( mbReachedEOF ) - break; - - // No, so read new characters + // Or no, so read new characters if( !implReadNext() ) break; } @@ -197,41 +192,35 @@ OUString OTextInputStream::implReadString( const Sequence< sal_Unicode >& Delimi if( bFindLineEnd ) { - if( bFoundFirstLineEndChar ) + if (cFirstLineEndChar != 0) { - bFound = true; - nCopyLen = nBufferReadPos - 2; - if( c == cLineEndChar1 || c == cLineEndChar2 ) + assert(nCopyLen >= 0); + // This is a check if the next character after a line end char is its second half + // Same line end char -> new line break; non-line-end char -> new line start + if ((c == cFirstLineEndChar) || (c != cLineEndChar1 && c != cLineEndChar2)) { - // Same line end char -> new line break - if( c == cFirstLineEndChar ) - { - nBufferReadPos--; - } - } - else - { - // No second line end char + // Not a two-char line end nBufferReadPos--; } + break; } else if( c == cLineEndChar1 || c == cLineEndChar2 ) { - bFoundFirstLineEndChar = true; - cFirstLineEndChar = c; + nCopyLen = nBufferReadPos - 1; // we know what to copy + cFirstLineEndChar = c; // take one more loop, to check if it's a two-char line end } } else if( comphelper::findValue(Delimiters, c) != -1 ) { - bFound = true; nCopyLen = nBufferReadPos; if( bRemoveDelimiter ) nCopyLen--; + break; } } // Nothing found? Return all - if( !nCopyLen && !bFound && mbReachedEOF ) + if (nCopyLen < 0) nCopyLen = nBufferReadPos; // Create string @@ -249,35 +238,40 @@ OUString OTextInputStream::implReadString( const Sequence< sal_Unicode >& Delimi sal_Int32 OTextInputStream::implReadNext() { - sal_Int32 nFreeBufferSize = mvBuffer.size() - mnCharsInBuffer; - if( nFreeBufferSize < READ_BYTE_COUNT ) - mvBuffer.resize(mvBuffer.size() * 2); - nFreeBufferSize = mvBuffer.size() - mnCharsInBuffer; + // Already reached EOF? Then we can't read any more + if (mbReachedEOF) + return 0; try { - sal_Int32 nRead = mxStream->readSomeBytes( mSeqSource, READ_BYTE_COUNT ); - sal_Int32 nTotalRead = nRead; - if( nRead == 0 ) + if (mxStream->readSomeBytes(mSeqSource, READ_BYTE_COUNT) == 0) + { mbReachedEOF = true; + return 0; + } // Try to convert - sal_uInt32 uiInfo; - sal_Size nSrcCvtBytes = 0; - sal_Size nTargetCount = 0; + sal_uInt32 uiInfo = mvBuffer.size() - mnCharsInBuffer < o3tl::make_unsigned(mSeqSource.getLength()) + ? RTL_TEXTTOUNICODE_INFO_DESTBUFFERTOOSMALL + : 0; + const sal_Int32 nOldCharsInBuffer = mnCharsInBuffer; sal_Size nSourceCount = 0; while( true ) { - const sal_Int8 *pbSource = mSeqSource.getConstArray(); + if (uiInfo & RTL_TEXTTOUNICODE_INFO_DESTBUFFERTOOSMALL) + { + mvBuffer.resize(mvBuffer.size() * 2); + } // All invalid characters are transformed to the unicode undefined char - nTargetCount += rtl_convertTextToUnicode( + sal_Size nSrcCvtBytes = 0; + mnCharsInBuffer += rtl_convertTextToUnicode( mConvText2Unicode, mContextText2Unicode, - reinterpret_cast(&( pbSource[nSourceCount] )), - nTotalRead - nSourceCount, - mvBuffer.data() + mnCharsInBuffer + nTargetCount, - nFreeBufferSize - nTargetCount, + reinterpret_cast(mSeqSource.getConstArray() + nSourceCount), + mSeqSource.getLength() - nSourceCount, + mvBuffer.data() + mnCharsInBuffer, + mvBuffer.size() - mnCharsInBuffer, RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_DEFAULT | RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_DEFAULT | RTL_TEXTTOUNICODE_FLAGS_INVALID_DEFAULT, @@ -285,41 +279,21 @@ sal_Int32 OTextInputStream::implReadNext() &nSrcCvtBytes ); nSourceCount += nSrcCvtBytes; - bool bCont = false; - if( uiInfo & RTL_TEXTTOUNICODE_INFO_DESTBUFFERTOOSMALL ) - { - mvBuffer.resize(mvBuffer.size() * 2); - bCont = true; - } - if( uiInfo & RTL_TEXTTOUNICODE_INFO_SRCBUFFERTOOSMALL ) { // read next byte - static Sequence< sal_Int8 > aOneByteSeq( 1 ); - nRead = mxStream->readSomeBytes( aOneByteSeq, 1 ); - if( nRead == 0 ) + Sequence aOneByteSeq(1); + if (mxStream->readSomeBytes(aOneByteSeq, 1) == 0) { mbReachedEOF = true; - break; + return mnCharsInBuffer - nOldCharsInBuffer; } - sal_Int32 nOldLen = mSeqSource.getLength(); - nTotalRead++; - if( nTotalRead > nOldLen ) - { - mSeqSource.realloc( nTotalRead ); - } - mSeqSource.getArray()[ nOldLen ] = aOneByteSeq.getConstArray()[ 0 ]; - bCont = true; + mSeqSource = comphelper::concatSequences(mSeqSource, aOneByteSeq); } - - if( bCont ) - continue; - break; + else if (!(uiInfo & RTL_TEXTTOUNICODE_INFO_DESTBUFFERTOOSMALL)) + return mnCharsInBuffer - nOldCharsInBuffer; // finished } - - mnCharsInBuffer += nTargetCount; - return nTargetCount; } catch( NotConnectedException& ) { diff --git a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs index 656747e782be..22e14c4421fe 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs @@ -49,19 +49,19 @@ Specifies the year. - + Specifies the month. - + Specifies the day. - + diff --git a/oox/source/drawingml/fillproperties.cxx b/oox/source/drawingml/fillproperties.cxx index ec2a10da02fe..eaeb0029c415 100644 --- a/oox/source/drawingml/fillproperties.cxx +++ b/oox/source/drawingml/fillproperties.cxx @@ -832,7 +832,7 @@ void GraphicProperties::pushToPropMap( PropertyMap& rPropMap, const GraphicHelpe { geometry::IntegerRectangle2D oClipRect( maBlipProps.moClipRect.value() ); awt::Size aOriginalSize( rGraphicHelper.getOriginalSize( xGraphic ) ); - if ( aOriginalSize.Width && aOriginalSize.Height ) + if (aOriginalSize.Width > 0 && aOriginalSize.Height > 0) { text::GraphicCrop aGraphCrop( 0, 0, 0, 0 ); if ( oClipRect.X1 ) diff --git a/oox/source/ppt/pptshapegroupcontext.cxx b/oox/source/ppt/pptshapegroupcontext.cxx index 26caf62ef67e..66b18c056872 100644 --- a/oox/source/ppt/pptshapegroupcontext.cxx +++ b/oox/source/ppt/pptshapegroupcontext.cxx @@ -108,10 +108,10 @@ ContextHandlerRef PPTShapeGroupContext::onCreateContext( sal_Int32 aElementToken { auto pShape = std::make_shared( meShapeLocation, u"com.sun.star.drawing.CustomShape"_ustr ); bool bUseBgFill = rAttribs.getBool(XML_useBgFill, false); + pShape->getFillProperties().moUseBgFill = bUseBgFill; if (bUseBgFill) { pShape->getFillProperties().moFillType = XML_noFill; - pShape->getFillProperties().moUseBgFill = true; } pShape->setModelId(rAttribs.getStringDefaulted( XML_modelId )); return new PPTShapeContext( *this, mpSlidePersistPtr, mpGroupShapePtr, pShape ); diff --git a/opencl/source/openclwrapper.cxx b/opencl/source/openclwrapper.cxx index 9588d7426680..e22a4e38fe23 100644 --- a/opencl/source/openclwrapper.cxx +++ b/opencl/source/openclwrapper.cxx @@ -32,8 +32,6 @@ #include #ifdef _WIN32 -#include -#include #define OPENCL_DLL_NAME "OpenCL.dll" #elif defined(MACOSX) #define OPENCL_DLL_NAME nullptr @@ -41,10 +39,6 @@ #define OPENCL_DLL_NAME "libOpenCL.so.1" #endif -#ifdef _WIN32_WINNT_WINBLUE -#include -#endif - #define DEVICE_NAME_LENGTH 1024 #define DRIVER_VERSION_LENGTH 1024 #define PLATFORM_VERSION_LENGTH 1024 @@ -490,33 +484,10 @@ bool initOpenCLRunEnv( GPUEnv *gpuInfo ) clGetPlatformInfo(gpuInfo->mpPlatformID, CL_PLATFORM_NAME, 64, pName, nullptr); -#if defined (_WIN32) -// the Win32 SDK 8.1 deprecates GetVersionEx() -# ifdef _WIN32_WINNT_WINBLUE - const bool bIsNotWinOrIsWin8OrGreater = IsWindows8OrGreater(); -# else - bool bIsNotWinOrIsWin8OrGreater = true; - OSVERSIONINFOW aVersionInfo = {}; - aVersionInfo.dwOSVersionInfoSize = sizeof( aVersionInfo ); - if (GetVersionExW( &aVersionInfo )) - { - // Windows 7 or lower? - if (aVersionInfo.dwMajorVersion < 6 || - (aVersionInfo.dwMajorVersion == 6 && aVersionInfo.dwMinorVersion < 2)) - bIsNotWinOrIsWin8OrGreater = false; - } -# endif -#else - const bool bIsNotWinOrIsWin8OrGreater = true; -#endif - // Heuristic: Certain old low-end OpenCL implementations don't // work for us with too large group lengths. Looking at the preferred - // float vector width seems to be a way to detect these devices, except - // the non-working NVIDIA cards on Windows older than version 8. - gpuInfo->mbNeedsTDRAvoidance = ( nPreferredVectorWidthFloat == 4 ) || - ( !bIsNotWinOrIsWin8OrGreater && - OUString::createFromAscii(pName).indexOf("NVIDIA") > -1 ); + // float vector width seems to be a way to detect these devices. + gpuInfo->mbNeedsTDRAvoidance = nPreferredVectorWidthFloat == 4; size_t nMaxParameterSize; clGetDeviceInfo(gpuInfo->mpDevID, CL_DEVICE_MAX_PARAMETER_SIZE, sizeof(size_t), diff --git a/package/source/xstor/oseekinstream.cxx b/package/source/xstor/oseekinstream.cxx index f5e3d644d673..c791b96fe5e2 100644 --- a/package/source/xstor/oseekinstream.cxx +++ b/package/source/xstor/oseekinstream.cxx @@ -32,7 +32,7 @@ OInputSeekStream::OInputSeekStream( OWriteStream_Impl& pImpl, uno::Reference < io::XInputStream > const & xStream, const uno::Sequence< beans::PropertyValue >& aProps, sal_Int32 nStorageType ) -: OInputCompStream( pImpl, xStream, aProps, nStorageType ) + : OInputSeekStream_BASE(pImpl, xStream, aProps, nStorageType) { m_xSeekable.set( m_xStream, uno::UNO_QUERY ); OSL_ENSURE( m_xSeekable.is(), "No seeking support!" ); @@ -41,7 +41,7 @@ OInputSeekStream::OInputSeekStream( OWriteStream_Impl& pImpl, OInputSeekStream::OInputSeekStream( uno::Reference < io::XInputStream > const & xStream, const uno::Sequence< beans::PropertyValue >& aProps, sal_Int32 nStorageType ) -: OInputCompStream( xStream, aProps, nStorageType ) + : OInputSeekStream_BASE(xStream, aProps, nStorageType) { m_xSeekable.set( m_xStream, uno::UNO_QUERY ); OSL_ENSURE( m_xSeekable.is(), "No seeking support!" ); @@ -51,42 +51,6 @@ OInputSeekStream::~OInputSeekStream() { } -uno::Sequence< uno::Type > SAL_CALL OInputSeekStream::getTypes() -{ - static cppu::OTypeCollection aTypeCollection(cppu::UnoType::get(), - OInputCompStream::getTypes()); - - return aTypeCollection.getTypes(); -} - -uno::Any SAL_CALL OInputSeekStream::queryInterface( const uno::Type& rType ) -{ - // Attention: - // Don't use mutex or guard in this method!!! Is a method of XInterface. - - uno::Any aReturn( ::cppu::queryInterface( rType, - static_cast< io::XSeekable* >( this ) ) ); - - if ( aReturn.hasValue() ) - { - return aReturn ; - } - - return OInputCompStream::queryInterface( rType ) ; -} - -void SAL_CALL OInputSeekStream::acquire() - noexcept -{ - OInputCompStream::acquire(); -} - -void SAL_CALL OInputSeekStream::release() - noexcept -{ - OInputCompStream::release(); -} - void SAL_CALL OInputSeekStream::seek( sal_Int64 location ) { ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ); diff --git a/package/source/xstor/oseekinstream.hxx b/package/source/xstor/oseekinstream.hxx index a77289e9a3ed..8ecc55964c45 100644 --- a/package/source/xstor/oseekinstream.hxx +++ b/package/source/xstor/oseekinstream.hxx @@ -24,8 +24,8 @@ #include "ocompinstream.hxx" -class OInputSeekStream final : public OInputCompStream - , public css::io::XSeekable +using OInputSeekStream_BASE = cppu::ImplInheritanceHelper; +class OInputSeekStream final : public OInputSeekStream_BASE { css::uno::Reference < css::io::XSeekable > m_xSeekable; @@ -41,18 +41,10 @@ public: virtual ~OInputSeekStream() override; - virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override; - - // XInterface - virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& rType ) override; - virtual void SAL_CALL acquire() noexcept override; - virtual void SAL_CALL release() noexcept override; - //XSeekable virtual void SAL_CALL seek( sal_Int64 location ) override; virtual sal_Int64 SAL_CALL getPosition() override; virtual sal_Int64 SAL_CALL getLength() override; - }; #endif diff --git a/postprocess/signing/no_signing.txt b/postprocess/signing/no_signing.txt index 6de68e2e8cc2..53aaac652c2b 100644 --- a/postprocess/signing/no_signing.txt +++ b/postprocess/signing/no_signing.txt @@ -8,9 +8,3 @@ policy.1.0.cli_oootypes.dll policy.1.0.cli_ure.dll policy.1.0.cli_cppuhelper.dll policy.1.0.cli_basetypes.dll -Windows6.1-KB2999226-x64.msu -Windows6.1-KB2999226-x86.msu -Windows8.1-KB2999226-x64.msu -Windows8.1-KB2999226-x86.msu -Windows8-RT-KB2999226-x64.msu -Windows8-RT-KB2999226-x86.msu diff --git a/readlicense_oo/docs/readme.xrm b/readlicense_oo/docs/readme.xrm index 467fe288b8ab..39547853eb14 100644 --- a/readlicense_oo/docs/readme.xrm +++ b/readlicense_oo/docs/readme.xrm @@ -41,7 +41,7 @@
  • -

    Microsoft Windows 7 SP1, 8, 8.1 Update (S14) or 10

    +

    Microsoft Windows 10 or higher

Please be aware that administrator rights are needed for the installation process.

diff --git a/reportdesign/source/ui/dlg/AddField.cxx b/reportdesign/source/ui/dlg/AddField.cxx index 0289195c0545..059a6ba731e9 100644 --- a/reportdesign/source/ui/dlg/AddField.cxx +++ b/reportdesign/source/ui/dlg/AddField.cxx @@ -86,7 +86,7 @@ OAddFieldWindow::OAddFieldWindow(weld::Window* pParent, uno::Reference< beans::X m_xActions->set_item_sensitive(u"insert"_ustr, false); m_xListBox->connect_row_activated(LINK( this, OAddFieldWindow, OnDoubleClickHdl ) ); - m_xListBox->connect_changed(LINK( this, OAddFieldWindow, OnSelectHdl ) ); + m_xListBox->connect_selection_changed(LINK(this, OAddFieldWindow, OnSelectHdl)); m_xListBox->set_size_request(m_xListBox->get_approximate_digit_width() * 45, m_xListBox->get_height_rows(8)); if (!m_xRowSet.is()) diff --git a/reportdesign/source/ui/dlg/Navigator.cxx b/reportdesign/source/ui/dlg/Navigator.cxx index d1c48ba4382a..31bce2c878dc 100644 --- a/reportdesign/source/ui/dlg/Navigator.cxx +++ b/reportdesign/source/ui/dlg/Navigator.cxx @@ -220,7 +220,7 @@ NavigatorTree::NavigatorTree(std::unique_ptr xTreeView, OReportC m_xTreeView->set_selection_mode(SelectionMode::Multiple); - m_xTreeView->connect_changed(LINK(this, NavigatorTree, OnEntrySelDesel)); + m_xTreeView->connect_selection_changed(LINK(this, NavigatorTree, OnEntrySelDesel)); m_xTreeView->connect_popup_menu(LINK(this, NavigatorTree, CommandHdl)); } diff --git a/sc/inc/cellsuno.hxx b/sc/inc/cellsuno.hxx index 9f7709631778..fdf1c2816e1d 100644 --- a/sc/inc/cellsuno.hxx +++ b/sc/inc/cellsuno.hxx @@ -371,10 +371,11 @@ public: virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; }; -class UNLESS_MERGELIBS(SC_DLLPUBLIC) ScCellRangesObj final : public ScCellRangesBase, - public css::sheet::XSheetCellRangeContainer, - public css::container::XNameContainer, - public css::container::XEnumerationAccess +using ScCellRangesObj_BASE = cppu::ImplInheritanceHelper; +class UNLESS_MERGELIBS(SC_DLLPUBLIC) ScCellRangesObj final : public ScCellRangesObj_BASE { public: struct ScNamedEntry @@ -394,11 +395,6 @@ public: ScCellRangesObj(ScDocShell* pDocSh, const ScRangeList& rR); virtual ~ScCellRangesObj() override; - virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override; - IF_MERGELIBS(SC_DLLPUBLIC) - virtual void SAL_CALL acquire() noexcept override; - virtual void SAL_CALL release() noexcept override; - virtual void RefChanged() override; // XSheetCellRanges @@ -448,30 +444,27 @@ public: virtual OUString SAL_CALL getImplementationName() override; virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; - - // XTypeProvider - virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override; - virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override; }; -class SAL_DLLPUBLIC_RTTI ScCellRangeObj : public ScCellRangesBase, - public css::sheet::XCellRangeAddressable, - public css::sheet::XSheetCellRange, - public css::sheet::XArrayFormulaRange, - public css::sheet::XArrayFormulaTokens, - public css::sheet::XCellRangeData, - public css::sheet::XCellRangeFormula, - public css::sheet::XMultipleOperation, - public css::util::XMergeable, - public css::sheet::XCellSeries, - public css::table::XAutoFormattable, - public css::util::XSortable, - public css::sheet::XSheetFilterableEx, - public css::sheet::XSubTotalCalculatable, - public css::util::XImportable, - public css::sheet::XCellFormatRangesSupplier, - public css::sheet::XUniqueCellFormatRangesSupplier, - public css::table::XColumnRowRange +using ScCellRangeObj_BASE = cppu::ImplInheritanceHelper; +class SAL_DLLPUBLIC_RTTI ScCellRangeObj : public ScCellRangeObj_BASE { private: const SfxItemPropertySet* pRangePropSet; @@ -502,11 +495,6 @@ public: static css::uno::Reference CreateRangeFromDoc( const ScDocument& rDoc, const ScRange& rR ); - virtual css::uno::Any SAL_CALL queryInterface( - const css::uno::Type & rType ) override; - virtual void SAL_CALL acquire() noexcept override; - virtual void SAL_CALL release() noexcept override; - virtual void RefChanged() override; // XCellRangeAddressable @@ -619,23 +607,20 @@ public: virtual OUString SAL_CALL getImplementationName() override; virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; - - // XTypeProvider - virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override; - virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override; }; //! really derive cell from range? -class SAL_DLLPUBLIC_RTTI ScCellObj final : public ScCellRangeObj, - public css::text::XText, - public css::container::XEnumerationAccess, - public css::table::XCell2, - public css::sheet::XFormulaTokens, - public css::sheet::XCellAddressable, - public css::sheet::XSheetAnnotationAnchor, - public css::text::XTextFieldsSupplier, - public css::document::XActionLockable +using ScCellObj_BASE = cppu::ImplInheritanceHelper; +class SAL_DLLPUBLIC_RTTI ScCellObj final : public ScCellObj_BASE { private: rtl::Reference mxUnoText; @@ -665,10 +650,6 @@ public: ScCellObj(ScDocShell* pDocSh, const ScAddress& rP); virtual ~ScCellObj() override; - virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override; - virtual void SAL_CALL acquire() noexcept override; - virtual void SAL_CALL release() noexcept override; - virtual void RefChanged() override; SvxUnoText& GetUnoText(); @@ -749,10 +730,6 @@ public: virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; - // XTypeProvider - virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override; - virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override; - // XActionLockable virtual sal_Bool SAL_CALL isActionLocked() override; virtual void SAL_CALL addActionLock() override; @@ -761,26 +738,27 @@ public: virtual sal_Int16 SAL_CALL resetActionLocks() override; }; -class SAL_DLLPUBLIC_RTTI ScTableSheetObj final : public ScCellRangeObj, - public css::sheet::XSpreadsheet, - public css::container::XNamed, - public css::sheet::XSheetPageBreak, - public css::sheet::XCellRangeMovement, - public css::table::XTableChartsSupplier, - public css::table::XTablePivotChartsSupplier, - public css::sheet::XDataPilotTablesSupplier, - public css::sheet::XScenariosSupplier, - public css::sheet::XSheetAnnotationsSupplier, - public css::drawing::XDrawPageSupplier, - public css::sheet::XPrintAreas, - public css::sheet::XSheetLinkable, - public css::sheet::XSheetAuditing, - public css::sheet::XSheetOutline, - public css::util::XProtectable, - public css::sheet::XScenario, - public css::sheet::XScenarioEnhanced, - public css::sheet::XExternalSheetName, - public css::document::XEventsSupplier +using ScTableSheetObj_BASE = cppu::ImplInheritanceHelper; +class SAL_DLLPUBLIC_RTTI ScTableSheetObj final : public ScTableSheetObj_BASE { friend class ScTableSheetsObj; // for insertByName() @@ -802,10 +780,6 @@ public: void InitInsertSheet(ScDocShell* pDocSh, SCTAB nTab); - virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override; - virtual void SAL_CALL acquire() noexcept override; - virtual void SAL_CALL release() noexcept override; - // XSpreadsheet virtual css::uno::Reference< css::sheet::XSheetCellCursor > SAL_CALL createCursor() override; @@ -952,14 +926,11 @@ public: virtual OUString SAL_CALL getImplementationName() override; virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; - - // XTypeProvider - virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override; - virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override; }; -class ScTableColumnObj final : public ScCellRangeObj, - public css::container::XNamed +using ScTableColumnObj_BASE = cppu::ImplInheritanceHelper; +class ScTableColumnObj final : public ScTableColumnObj_BASE { private: const SfxItemPropertySet* pColPropSet; @@ -974,11 +945,6 @@ public: ScTableColumnObj(ScDocShell* pDocSh, SCCOL nCol, SCTAB nTab); virtual ~ScTableColumnObj() override; - virtual css::uno::Any SAL_CALL queryInterface( - const css::uno::Type & rType ) override; - virtual void SAL_CALL acquire() noexcept override; - virtual void SAL_CALL release() noexcept override; - // XNamed virtual OUString SAL_CALL getName() override; virtual void SAL_CALL setName( const OUString& aName ) override; @@ -991,10 +957,6 @@ public: virtual OUString SAL_CALL getImplementationName() override; virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; - - // XTypeProvider - virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override; - virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override; }; class ScTableRowObj final : public ScCellRangeObj diff --git a/sc/inc/cursuno.hxx b/sc/inc/cursuno.hxx index 5ba9403e8237..848156475fd8 100644 --- a/sc/inc/cursuno.hxx +++ b/sc/inc/cursuno.hxx @@ -24,20 +24,16 @@ #include #include -class ScCellCursorObj final : public ScCellRangeObj, - public css::sheet::XSheetCellCursor, - public css::sheet::XUsedAreaCursor, - public css::table::XCellCursor +using ScCellCursorObj_BASE = cppu::ImplInheritanceHelper; +class ScCellCursorObj final : public ScCellCursorObj_BASE { public: ScCellCursorObj(ScDocShell* pDocSh, const ScRange& rR); virtual ~ScCellCursorObj() override; - virtual css::uno::Any SAL_CALL queryInterface( - const css::uno::Type & rType ) override; - virtual void SAL_CALL acquire() noexcept override; - virtual void SAL_CALL release() noexcept override; - // XSheetCellCursor virtual void SAL_CALL collapseToCurrentRegion() override; virtual void SAL_CALL collapseToCurrentArray() override; @@ -75,10 +71,6 @@ public: virtual OUString SAL_CALL getImplementationName() override; virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; - - // XTypeProvider - virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override; - virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override; }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/inc/strings.hrc b/sc/inc/strings.hrc index 193061581938..50549907ade0 100644 --- a/sc/inc/strings.hrc +++ b/sc/inc/strings.hrc @@ -189,6 +189,7 @@ #define SCSTR_QHELP_BTNEQUAL NC_("SCSTR_QHELP_BTNEQUAL", "Formula") #define SCSTR_QHELP_EXPAND_FORMULA NC_("SCSTR_QHELP_EXPAND_FORMULA", "Expand Formula Bar") #define SCSTR_QHELP_COLLAPSE_FORMULA NC_("SCSTR_QHELP_COLLAPSE_FORMULA", "Collapse Formula Bar") +#define SCSTR_QHELP_SELECT_ALL_CELLS NC_("SCSTR_QHELP_SELECT_ALL_CELLS", "Click here to select all cells") #define STR_UNKNOWN_USER_CONFLICT NC_("STR_UNKNOWN_USER_CONFLICT", "Unknown User") diff --git a/sc/qa/filter/html/data/tdf79298_strikeout_variants.html b/sc/qa/filter/html/data/tdf79298_strikeout_variants.html new file mode 100644 index 000000000000..391ddf095c2b --- /dev/null +++ b/sc/qa/filter/html/data/tdf79298_strikeout_variants.html @@ -0,0 +1,3 @@ +

s

+

strike

+

del

\ No newline at end of file diff --git a/sc/qa/filter/html/html.cxx b/sc/qa/filter/html/html.cxx index c243dea350b0..2f6b9cb249b8 100644 --- a/sc/qa/filter/html/html.cxx +++ b/sc/qa/filter/html/html.cxx @@ -13,6 +13,8 @@ #include #include +#include + #include #include #include @@ -205,6 +207,30 @@ CPPUNIT_TEST_FIXTURE(Test, testPasteSingleCell) CPPUNIT_ASSERT_EQUAL(static_cast(3), pDoc->GetValue(/*col=*/2, /*row=*/0, /*tab=*/0)); } +CPPUNIT_TEST_FIXTURE(Test, testTdf79298_strikeout_variants) +{ + createScDoc(); + + // Paste different strikeout variants into the first cell + ScDocument* pDoc = getScDoc(); + ScAddress aCellPos(/*nColP=*/0, /*nRowP=*/0, /*nTabP=*/0); + ScImportExport aImporter(*pDoc, aCellPos); + SvFileStream aFile(createFileURL(u"tdf79298_strikeout_variants.html"), StreamMode::READ); + SvMemoryStream aMemory; + aMemory.WriteStream(aFile); + aMemory.Seek(0); + CPPUNIT_ASSERT(aImporter.ImportStream(aMemory, OUString(), SotClipboardFormatId::HTML)); + + // Verify HTML strikeout tags (, , and ) + for (size_t nCol = 0; nCol < 3; ++nCol) + { + const ScPatternAttr* pAttr = pDoc->GetPattern(ScAddress(0, nCol, 0)); + CPPUNIT_ASSERT_MESSAGE("Failed to get cell attribute.", pAttr); + const SvxCrossedOutItem& rCrossedOutItem = pAttr->GetItem(ATTR_FONT_CROSSEDOUT); + CPPUNIT_ASSERT_EQUAL(FontStrikeout::STRIKEOUT_SINGLE, rCrossedOutItem.GetStrikeout()); + } +} + CPPUNIT_TEST_FIXTURE(Test, testCopyText) { // Given a document with 01 in A1: diff --git a/sc/qa/unit/data/functions/addin/fods/imcsch.fods b/sc/qa/unit/data/functions/addin/fods/imcsch.fods index 710ef1f4d275..1960d9c2c099 100644 --- a/sc/qa/unit/data/functions/addin/fods/imcsch.fods +++ b/sc/qa/unit/data/functions/addin/fods/imcsch.fods @@ -1,280 +1,436 @@ - + + 0P0DLibreOfficeDev/24.8.0.0.alpha1$Linux_X86_64 LibreOffice_project/681b3840a043dba2c5afad4c7c0b613cec6a9391 + + + 0 + 0 + 22010 + 5214 + + + view1 + + + 0 + 0 + 2 + 0 + 0 + 0 + 0 + 0 + 100 + 60 + true + false + false + false + false + + + 0 + 20 + 2 + 0 + 0 + 0 + 0 + 0 + 100 + 60 + true + false + false + false + false + + + Sheet2 + 1847 + 0 + 100 + 60 + false + true + true + true + false + true + 12632256 + 1 + true + true + true + false + false + false + 1270 + 1270 + 1 + 1 + true + false + false + false + false + + + + + true + false + true + 0 + true + true + false + true + false + 12632256 + true + true + 0 + false + false + true + true + false + 3 + false + Generic Printer + false + tAH+/0dlbmVyaWMgUHJpbnRlcgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAU0dFTlBSVAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWAAMAoAAAAAAAAAAEAAhSAAAEdAAASm9iRGF0YSAxCnByaW50ZXI9R2VuZXJpYyBQcmludGVyCm9yaWVudGF0aW9uPVBvcnRyYWl0CmNvcGllcz0xCmNvbGxhdGU9ZmFsc2UKbWFyZ2luYWRqdXN0bWVudD0wLDAsJzAsMApjb2xvcmRlcHRoPTI0CmNvbG9yZGV2aWNlPTAKUFBEQ29udGV4dERhdGEKUGFnZVNpemU6QTQAABIAQ09NUEFUX0RVUExFWF9NT0RFDwBEdXBsZXhNb2RlOjpPZmYMAFBSSU5URVJfTkFNRQ8AR2VuZXJpYyBQcmludGVyCwBEUklWRVJfTkFNRQcAU0dFTlBSVA== + false + 1270 + 1270 + 1 + 1 + true + false + false + true + true + true + true + true + 7 + true + + + Sheet1 + + + Sheet2 + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - ( - - ) - - - - - - - - - - - - - - - - - - - - - - + + - - + - - + + + - - - + + + + ( + + ) + + + - - + - - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - £ - - - - - - £ - - - + + + + + + + + + + - £ - + + + - - £ - + + + - £ - + + + - - - £ - + + + - £ - + + + - - £ - + + + - £ - + + + - - £ - + + + - - - - - - ( - - ) - - - - - - - - ( - - ) - - - + £ - - + - + - £ - - + + + + + £ + + + + - + £ + + + + + £ + + + + + - + £ + + + + + £ + + + + + - + £ + £ - - + + - £ - - + - - + + + - + ( + + ) + - - + + + - - - - - - - - - - - - - + ( + + ) + + + £ + + + + + - + £ + + + + + + £ + + + + + - + £ + + + + - + - + - + - + - + - + - + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - + - + - + - + - - + - + - + @@ -283,7 +439,7 @@ / - + @@ -292,155 +448,109 @@ / - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - + - + + - - - + + + + + + + + + - + + + + + + + + + + - + + + + - - - + + - - - - - - + + + - + + + - - - - + + + + + - + + + + + + + + + - + + + + + + + + - + + - - - - - - - - - - + - - - - - - + + + - + + - - - - Kč - - - - - - - - - - + + - - - - + - + + - - - - - + + - @@ -450,21 +560,19 @@ - - + + - - - - + - + + - - - - - + + - Kč @@ -473,200 +581,208 @@ - + + + + + + + - + + + + + + + - + + + + + + + + + + + + + + + + + - + + + + + + + - + + + + + + + + + + + : - + : : - + : - - + + - + Yes - + Yes - + No - - + + - + True - + True - + False - - + + - + On - + On - + Off - - + + - + ¥€ - + - + ( - + ) - + - - + + - + - - + - + - + $ - + - + ($ - + ) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - + + - + - - - + + + - - - + + + + + + + - + + + + + + + + + + + + + + - + + + - - - - - - - - - + + - + + - - - + + + - - - € - - - - - - - - - + - - + - - - - + - @@ -676,18 +792,16 @@ - + - - + - - - - + - € @@ -696,109 +810,99 @@ - - - - - $ - - - - - ($ - - ) - - + + + + + - + + + + + - + + + + + + + + + + + + + + + + - + + + + + - + + + + + + + + + + + + + + $ - + - + + ($ + + ) + + + + $ + + + + ($ - + ) - + - - $ - - - - - ($ - - ) - - - - - - - - - - ( - - ) - - - - - - - - - - - - - - $ - - + $ + - - $ - - ( - + + ($ + ) + - - $ - - - - - - - - - - - - $ - - + + - $ - + ( - + ) - $ - - - - - + + - @@ -807,149 +911,128 @@ - + + $ + + + + + + $ + + ( + + ) + + + $ + + - + + + + + + + + + + $ + + + + + + $ + + ( + + ) + + + $ + + - + + + + + + + + + + + - + - + ( - + ) - + - - \ - - - - \- - - - - - \ - - - - - \- - - - - - \ - - - - \- - - - - - \ - - - - - \- - - - - \ - - - + \ + - - \ - - - - - + + \- + + - - \ - - - + + \ + - - - - - - - - - - - + + + \- + + - - - - - - + + \ + - - - - + + \- + + - - - - - - - - - \ - - - + + \ + - - \ - - - - - + + + \- + + - - \ - - - - - - - - - - - - - - - + \ + + - + \ + - - + - - - - - + \ + + - @@ -959,575 +1042,602 @@ - - + + + - + + - - - - + + - - - - - - - - - - - - - - - - - - - - - - + + + - + + + + + + + - - + \ + + + - - + + \ + - - - - + + - - + + \ + + - + + + + + + + + + + + + + + + + + + - + + + + + + - + + + + + + + + + + + + + + + + - + + + + + + + + + - + + + + + + + + + + - + + + + + + + + + + + - + + + + + + + + $ - + - + $( - + ) - + $- - + - - - + + + - - + + - + ( - + ) - + - - + - - - + + + - + $ - + - + $( - + ) - + $- - + - + - - - + + + - - + + - + ( - + ) - + - - + - + - - - + + + - - - % - - - - % - - - - % - - - - % - - - - % - - - - % - - - - % - - - - % - - + % - + + % + + + + % + + + + % + + + + % + + + + % + + + + % + + + + % + + + + % + + + % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - + - + - - + - + - - + - + - - + - + - - + - + - - + - + - - + - + - - + - + - - + - + - - + - + - - + - - - - - - % - - - - % - - - - % - - - - % - - - - % - - - - % - - - - - - $ - + + + + - + - ( - $ - - ) - + - + + + + - - + + + + + + + + - + + + + + + + + + + + + + - + + + + + + + + + + + + + - + + + + + + + + + + % - - + + + % + + + % + + % + + + + % + + + + % + + + + + + $ + + + + + ( + $ + + ) + + + + + % + + + + % + + - - + % - + - - + + - + - - - + + - + - - - + £ - + - + - £ - - - - - £ - - - - - - - £ - - - - - - % - - - - - - - % - - - - - DM - - - - - - DM - - - - - DM - - - - - - - DM - - - - - DM - - - - - - DM + - - - - DM - - + + + £ + + + - - - DM - - + £ + + + + + + % + + + + - + + % + + - - - + + DM - - - - - - + + - + + DM + - - - - + + + DM + + + + - + + DM + + + + + DM + + + - + + DM + - - - - - - - - - - DM + + DM - - - - - - DM + + + - + + DM + - - - - DM - - - - - - - - - - + + - - - - + - + + - - - - - + + - @@ -1537,21 +1647,19 @@ - - + + DM - - - - + - + + DM - - - - - DM + + - DM @@ -1560,260 +1668,308 @@ - + + + + + + + - + + + + + + + - + + + + + + + + + + + + + + DM + + + - + + + DM + + + + - + + DM + + + + + + + + + Ouch! - - Error detected! - + - Result=0 - No Errordetection - + / / - + / / - - - - - - - - - - - £ - - - - - - - - - £ - - - - - - - - - - £ - - - - - - - - - £ - - + + + + + + + + + + £ + + + + + + + + + £ + + + - - + + - - - - + + £ + - - - - - - + + + + - - - - - - - - - - - - - - £ - - - - - - - - - - - - £ - - - - - - - - - - - - - + £ + + + + + + + + + + + - - - - - - - - - + - - + + - + + + - + + - - - + + + - - £ - - + + £ + + - - - - + + + + - - £ - - - - - + + £ + + - - + - - - + + + - - - - - - + + + + + + - - - - - - - + + - DM - - + + + - - + - DM - - - - + + + - DM - - + + + + + + £ + + + + + + + + + + + + £ + - - + - DM - - - - + + + - DM - - - - - - - - DM - - - - - - DM - - - - - - - - DM - - + + + + - - - DM + + - - - - DM + + - + - + DM + - + + + DM + + + + + + DM + + + - + + + DM + + + + + + DM + + + + - + + + DM + + + + + + DM + + + + - + + + DM + + + + + + DM + + + + - + + + DM + + + + + + + + - + - - + - + tan @@ -1821,75 +1977,75 @@ - - + + - - + + - - + + - - + + - + - - + + - - + + - + - - + - + - + - - + + - + - - + + - - + + - - + + - + - - + - + - + : @@ -1898,289 +2054,240 @@ - + : : - + - + - + - - - + + - + - + - + - - - + + - - + + - - + + - - + + - - + + - - + + - - - / - - / - - - - - - - - - - - - - - - - - - - - - - - - - - : - - - - - - - : - - : - - - - - - - : - - - - - : - - : - - / / - - - : - - - - - - - - ( - - ) - - - - - - - - - ( - - ) - - - - - - - - - ( - - - ) - - - - - - - - - - ( - - - ) - - - - - - - - - ( - - - ) - - - - - - - - - - ( - - - ) - - - - + + + - + + - + + + + - - + + + - + + + + + : + + + + + + + : + + : + + + + + + + : + + + : : - + + + / + + / + + + + : + + + + + + + + + ( + + ) + + + + + + + + + ( + + ) + + + + + + + + + ( + + + ) + + + + + + + + + + ( + + + ) + + + + + + + + + ( + + + ) + + + + + + + + + + ( + + + ) + + + + + - + + + + + : + + : + + + : - - + + - + ( - + ) - + - - + + - - + + % - - + + - - - - - - - - ( - - ) - - - - - - - - - - - - - - - - - - - - - - - ( - - ) - - - - - - - - - - - - - - - - + + - + ( - + ) - - - - - + + - @@ -2191,23 +2298,21 @@ - - + + - + ( - + ) - - - - - + + - @@ -2216,85 +2321,136 @@ - - + + + + - - + + + ( + + ) - - + + + - + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + ( + + ) + + + + + - + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + . - + . - + - + : - + : @@ -2303,215 +2459,204 @@ - - - . - - . - - - - : - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - + + - - + + - - - + + - - + + - - - + + - - + + - - - + + - + + + + + + - + + + + + + + + + + + - + + + + + + + + + + - + + + + + + + + + + + - + + + + + : : - + : - - + + - + - + - + - + - - + - + - + - + - + - - + - + - + - + - + - - + - + - + - + - + - - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - : - - - - - - - : - - : - - - - - - - : - - - - - : - - : - - + + - + + - + + + + + - + + + + + - + + + + + : + + + + + + + : + + : + + + + + + + : + + + + + : + + : + + + - @@ -2522,140 +2667,140 @@ : - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - + - - - + + + + - + + + + + + + + + - + + + + + + + + + + - + + + + + + + + + + - - - + + - - + - - - + + + - - - - + + + + - - - - + + + + - - - - + + + - - + - - - + + + - - - + + + - - - + + + - - - + + - - + - + - - - + + + - - - - + + + + - - - - + + + + - - - - + + + - - + - + - - - + + + - + @@ -2664,7 +2809,7 @@ - + @@ -2677,6 +2822,9 @@ + + + @@ -2714,10 +2862,7 @@ - - - - + @@ -2764,18 +2909,18 @@ - - + + - - - + + + - - - + + + @@ -2784,238 +2929,172 @@ - - + + - + - - + + - + - - - + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + - + - + - + - - - - - - - - - - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + - + - - - - - - - - + - + - + - + - + - - - - - - + - - - - - - - - - + + - + - - - - - - - - - - - + @@ -3023,40 +3102,34 @@ - - - - - - - - - + - + - - + + - - + + + - + + - + - + - + @@ -3076,50 +3149,50 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -3129,43 +3202,53 @@ ??? + Page 1 + - ??? (???) + ???(???) - 00/00/0000, 00:00:00 + 00/00/0000, 00:00:00 + - Page 1 / 99 + Page 1/ 99 + + + + + + + @@ -3197,7 +3280,7 @@ - + Sheet @@ -3208,11 +3291,11 @@ Description - + 1 - + TRUE @@ -3229,48 +3312,23 @@ - + - - - - - - - - - - - - - - - - - - - - - + - + - + - - - - - @@ -3284,18 +3342,19 @@ - - + + + - + - + - + Function @@ -3311,82 +3370,95 @@ Comment - - + + Expected Real + + + Expected Imaginary + + + + Result Real + + + Result Imaginary + + + -5+12i - + - - + + - + - - - 0,0113716081825818+0,00723140654863397j + + + 0.0113716081825818+0.00723140654863397i - - -1,17836687482814e-05-3,48576140783804e-06j + + 0.0113716081825818+0.00723140654863397i - + TRUE - - =IMCSCH("5+12j") + + =IMCSCH("5+12i") - 0.011371608182582 + 0.0113716081825818 - 0.007231406548634 + 0.00723140654863397 - 0.011371608182582 + 0.0113716081825818 - - 0.007231406548634 + + 0.00723140654863397 - + TRUE - + TRUE - + -4+12i - + - - + + - + - - - 1,04283521277141i + + + 1.04283521277141i - - -0,0134765058305891i + + 1.04283521277141i - + TRUE - + =IMCSCH(COMPLEX(0,5)) @@ -3400,181 +3472,181 @@ 0 - + 1.04283521277141 - + TRUE - + TRUE - + -3+12i - + - - - + + + - + - - - -0,0113716081825818+0,00723140654863397i + + + -0.0113716081825818+0.00723140654863397i - - 1,17836687482814e-05-3,48576140783804e-06i + + -0.0113716081825818+0.00723140654863397i - + TRUE - + =IMCSCH("-5+12i") - -0.011371608182582 + -0.0113716081825818 - 0.007231406548634 + 0.00723140654863397 - -0.011371608182582 + -0.0113716081825818 - - 0.007231406548634 + + 0.00723140654863397 - + TRUE - + TRUE - + -2+12i - + - - + + - + - - - -0,0113716081825818+0,00723140654863397i + + + -0.0113716081825818+0.00723140654863397i - - 1,17836687482814e-05-3,48576140783804e-06i + + -0.0113716081825818+0.00723140654863397i - + TRUE - + =IMCSCH(N1) - -0.011371608182582 + -0.0113716081825818 - 0.007231406548634 + 0.00723140654863397 - -0.011371608182582 + -0.0113716081825818 - - 0.007231406548634 + + 0.00723140654863397 - + TRUE - + TRUE - + -1+12i - + - - + + - + - - - -0,0113716081825818+0,00723140654863397i + + + -0.0113716081825818+0.00723140654863397i - - 1,17836687482814e-05-3,48576140783804e-06i + + -0.0113716081825818+0.00723140654863397i - + TRUE - - {=IMCSCH (N1:N12)} + + {=IMCSCH(N1:N12)} - -0.011371608182582 + -0.0113716081825818 - 0.007231406548634 + 0.00723140654863397 - -0.011371608182582 + -0.0113716081825818 - - 0.007231406548634 + + 0.00723140654863397 - + TRUE - + TRUE - + 0+12i - + - - + + - + - - - -0,0309098723667019+0,0196675402624156i + + + -0.0309098723667019+0.0196675402624156i - - 9,29991048165009e-06+8,0322504195773e-06i + + -0.0309098723667019+0.0196675402624156i - + TRUE - - {=IMCSCH (N1:N12)} + + {=IMCSCH(N1:N12)} @@ -3585,90 +3657,90 @@ - -0.030909872366702 + -0.0309098723667019 - - 0.019667540262416 + + 0.0196675402624156 - + TRUE - + TRUE - + 1+12i - + - - + + - + - - - -0,0839938618035557+0,0536737609428415i + + + -0.0839938618035557+0.0536737609428415i - - -1,73414259383761e-06+1,21654482550521e-05i + + -0.0839938618035557+0.0536737609428415i - + TRUE - - {=IMCSCH (N1:N12)} + + {=IMCSCH(N1:N12)} - -0.083993861803556 + -0.0839938618035557 5.36737609428415E-002 - -0.083993861803556 + -0.0839938618035557 - - 0.053673760942842 + + 0.0536737609428415 - + TRUE - + TRUE - + 2+12i - + - - + + - + - - - -0,227684450599255+0,15017767282551i + + + -0.227684450599255+0.150177672825509i - - -1,11738329653742e-05+5,11378906737739e-06i + + -0.227684450599255+0.15017767282551i - + TRUE - - {=IMCSCH (N1:N12)} + + {=IMCSCH(N1:N12)} @@ -3681,41 +3753,41 @@ -0.227684450599255 - - 0.15017767282551 + + 0.150177672825509 - + TRUE - + TRUE - + 3+12i - + - - + + - + - - - -0,594184076066616+0,496088160951579i + + + -0.594184076066616+0.496088160951579i - - -1,03403528397133e-05-6,63946420403422e-06i + + -0.594184076066616+0.496088160951579i - + TRUE - - {=IMCSCH (N1:N12)} + + {=IMCSCH(N1:N12)} @@ -3728,339 +3800,339 @@ -0.594184076066616 - + 0.496088160951579 - + TRUE - + TRUE - + 4+12i - + - + - + - - - 1,86367959778244i + + + 1.86367959778244i - - -1,22884247071203e-05i + + 1.86367959778244i - + TRUE - - {=IMCSCH (N1:N12)} + + {=IMCSCH(N1:N12)} 0 - + 1.86367959778244 0 - + 1.86367959778244 - + TRUE - + TRUE - + 5+12i - + - + - - - 0,594184076066616+0,496088160951579i + + + 0.594184076066616+0.496088160951579i - - 1,03403528397133e-05-6,63946420403422e-06i + + 0.594184076066616+0.496088160951579i - + TRUE - - {=IMCSCH (N1:N12)} + + {=IMCSCH(N1:N12)} 0.594184076066616 - + 0.496088160951579 0.594184076066616 - + 0.496088160951579 - + TRUE - + TRUE - + 6+12i - + - + - - - 0,227684450599255+0,15017767282551i + + + 0.227684450599255+0.150177672825509i - - 1,11738329653742e-05+5,11378906737739e-06i + + 0.227684450599255+0.15017767282551i - + TRUE - - {=IMCSCH (N1:N12)} + + {=IMCSCH(N1:N12)} 0.227684450599255 - + 0.15017767282551 0.227684450599255 - - 0.15017767282551 + + 0.150177672825509 - + TRUE - + TRUE - + - + - + - - - 0,0839938618035557+0,0536737609428415i + + + 0.0839938618035557+0.0536737609428415i - - 1,73414259383761e-06+1,21654482550521e-05i + + 0.0839938618035557+0.0536737609428415i - + TRUE - - {=IMCSCH (N1:N12)} + + {=IMCSCH(N1:N12)} - 0.083993861803556 + 0.0839938618035557 - - 0.053673760942842 + + 0.0536737609428415 - 0.083993861803556 + 0.0839938618035557 - - 0.053673760942842 + + 0.0536737609428415 - + TRUE - + TRUE - + - + - + - - - 0,0309098723667019+0,0196675402624156i + + + 0.0309098723667019+0.0196675402624156i - - -9,29991048165009e-06+8,0322504195773e-06i + + 0.0309098723667019+0.0196675402624156i - + TRUE - - {=IMCSCH (N1:N12)} + + {=IMCSCH(N1:N12)} - 0.030909872366702 + 0.0309098723667019 - - 0.019667540262416 + + 0.0196675402624156 - 0.030909872366702 + 0.0309098723667019 - - 0.019667540262416 + + 0.0196675402624156 - + TRUE - + TRUE - + - + - + - - - 0,0113716081825818+0,00723140654863397i + + + 0.0113716081825818+0.00723140654863397i - - -1,17836687482814e-05-3,48576140783804e-06i + + 0.0113716081825818+0.00723140654863397i - + TRUE - - {=IMCSCH (N1:N12)} + + {=IMCSCH(N1:N12)} - 0.011371608182582 + 0.0113716081825818 - 0.007231406548634 + 0.00723140654863397 - 0.011371608182582 + 0.0113716081825818 - - 0.007231406548634 + + 0.00723140654863397 - + TRUE - + TRUE - + - + - + - - - 0,00418340577604633+0,00266009278646834i + + + 0.00418340577604633+0.00266009278646834i - - -3,43357631183878e-06-1,17989802733781e-05i + + 0.00418340577604633+0.00266009278646834i - + TRUE - - {=IMCSCH (N1:N12)} + + {=IMCSCH(N1:N12)} - 0.004183405776046 + 0.00418340577604633 - 0.002660092786468 + 0.00266009278646834 - 0.004183405776046 + 0.00418340577604633 - - 0.002660092786468 + + 0.00266009278646834 - + TRUE - + TRUE - + - + - + - - - 1,18839510577812j + + + 1.18839510577812i - - 0,850918128239322j + + 1.18839510577812i - + TRUE - - =IMCSCH("0-j") + + =IMCSCH("0-i") @@ -4073,1890 +4145,1688 @@ 0 - + 1.18839510577812 - + TRUE - + TRUE - + - + - + - - - 0,0366435703258656 + + + 0.0366435703258656 - - -1,3213487088109 + + 0.0366435703258656 - + TRUE - + =IMCSCH(4) - 0.036643570325866 + 0.0366435703258656 0 - 0.036643570325866 + 0.0366435703258656 - + 0 - + TRUE - + TRUE - + - + - + - - - -0,036275889628626-0,0051744731840194i + + + -0.036275889628626-0.0051744731840194i - - + + -0.036275889628626-0.0051744731840194i + + TRUE - + =IMCSCH("4+3i") - + -0.036275889628626 - - -0.005174473184019 + + -0.0051744731840194 -0.036275889628626 - - -0.005174473184019 + + -0.0051744731840194 - + TRUE - + TRUE - + - + - + - + - - - - + + + - - + + - + - + - - + + - - - - + + + - - + + - + - + - - + + + + - - - + - + - + - + - - + + - - - - + + + - + - + - - + + - - - - + + + - + - + - - + + - - - + + - + - + - + - - + + - - - - + + + - + - + - - + + - - - - + + + - + - + - - + + - - - - + + + - + - + - - + + - - - - + + + - + - + - - + + - - - + + - + - + - + - - + + - - - - + + + - + - + - - + + - - - - + + + - + - + - - + + - - - + + - + - + - - + + - - - + + 58 - + - + - - + + - - - + + 59 - + - + - - + + - - - + + 60 - + - + - - + + - - - + + 61 - + - + - - + + - - - + + 62 - + - + - - + + - - - + + 63 - + - + - - + + - - - + + 64 - + - + - - + + - - - + + 65 - + - + - - + + - - - + + 66 - + - + - - + + - - - + + 67 - + - + - - + + - - - + + 68 - + - + - - + + - - - + + 69 - + - + - - + + - - - + + 70 - + - + - - + + - - - + + 71 - + - + - - + + - - - + + 72 - + - + - - + + - - - + + 73 - + - + - - + + - - - + + 74 - + - + - - + + - - - + + 75 - + - + - - + + - - - + + 76 - + - + - - + + - - - + + 77 - + - + - - + + - - - + + 78 - + - + - - + + - - - + + 79 - + - + - - + + - - - + + 80 - + - + - - + + - - - + + 81 - + - + - - + + - - - + + 82 - + - + - - + + - - - + + 83 - + - + - - + + - - - + + 84 - + - + - - + + - - - + + 85 - + - + - - + + - - - + + 86 - + - + - - + + - - - + + 87 - + - + - - + + - - - + + 88 - + - + - - + + - - - + + 89 - + - + - - + + - - - + + 90 - + - + - - + + - - - + + 91 - + - + - - + + - - - + + 92 - + - + - - + + - - - + + 93 - + - + - - - - - + + + + 94 - + - + - - - - - + + + + 95 - + - + - - + + - - - + + 96 - + - + - - + + - - - + + 97 - + - + - - + + - - - + + 98 - + - + - - + + - - - + + 99 - + - + - - + + - - - + + 100 - + - + - - + + - - - + + - + - + - - + + - - - + + - + - + - - + + - - - + + - + - + - - + + - - - + + - + - + - + - - - + + - + - + - + - - + + - + - + - + - - - + + - + - + - - - + + - - + - + - + - + - + - + - + - + 548 - + - + - + 549 - + - + - + 550 - + - + - + 551 - + - + - + 552 - + - + - + 553 - + - + - + 554 - + - + - + 555 - + - + - + 556 - + - + - + 557 - + - + - + 558 - + - + - + 559 - + - + - + 560 - + - + - + 561 - + - + - + 562 - + - + - + 563 - + - + - + 564 - + - + - + 565 - + - + - + 566 - + - + - + 567 - + - + - + 568 - + - + - + 569 - + - + - + 570 - + - + - + 571 - + - + - + 572 - + - + - + 573 - + - + - + 574 - + - + - + 575 - + - + - + 576 - + - + - + 577 - + - + - + 578 - + - + - + 579 - + - + - + 580 - + - + - + 581 - + - + - + 582 - + - + - + 583 - + - + - + 584 - + - + - + 585 - + - + - + 586 - + - + - + 587 - + - + - + 588 - + - + - + 589 - + - + - + 590 - + - + - + 591 - + - + - + 592 - + - + - + 593 - + - + - + 594 - + - + - + 595 - + - + - + 596 - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sc/qa/unit/data/functions/addin/fods/impower.fods b/sc/qa/unit/data/functions/addin/fods/impower.fods index 2a7822cf804e..9b668d3d0193 100644 --- a/sc/qa/unit/data/functions/addin/fods/impower.fods +++ b/sc/qa/unit/data/functions/addin/fods/impower.fods @@ -1,203 +1,357 @@ - + + 2024-05-28T17:56:23.578001863PT28M48S4LibreOfficeDev/24.8.0.0.alpha0$MacOSX_X86_64 LibreOffice_project/fd2355497467a1af61749cce311bf57d067566c4 + + + 0 + 0 + 77463 + 358034 + + + view1 + + + 0 + 0 + 2 + 0 + 0 + 0 + 0 + 0 + 100 + 60 + true + false + false + false + false + + + 1 + 22 + 2 + 0 + 0 + 0 + 10 + 0 + 100 + 60 + true + false + false + false + false + + + Sheet2 + 1417 + 0 + 100 + 60 + false + true + true + false + true + 12632256 + true + 1 + true + true + false + false + false + 1000 + 1000 + 1 + 1 + true + false + false + false + false + + + + + true + true + true + 0 + true + true + false + true + false + 12632256 + true + true + 0 + false + false + true + true + false + 3 + false + Samsung M2020 Series + false + LgH+/1NhbXN1bmcgTTIwMjAgU2VyaWVzAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAU2Ftc3VuZyBNMjAyMCBTZXJpZXMAAAAAAAAAAAAAAAAWAAQABAAAAAAAAAAEAAhSAAAEdAAAAAAAABIAQ09NUEFUX0RVUExFWF9NT0RFEwBEdXBsZXhNb2RlOjpVbmtub3duDABQUklOVEVSX05BTUUUAFNhbXN1bmcgTTIwMjAgU2VyaWVzCwBEUklWRVJfTkFNRRQAU2Ftc3VuZyBNMjAyMCBTZXJpZXM= + false + 1000 + 1000 + 1 + 1 + true + false + false + true + true + true + true + 7 + true + + + Sheet1 + + + Sheet2 + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - ( - - ) - - - - - - - - - - - - - - - - - - - - - - + + - - + - - + + + - - - + + + + ( + + ) + + + - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + - ( - - ) - + - - + + - - - ( - - ) + + + + - + + + - - - - - - - - - - - - - - - + + + + + + + + - + + + + + + + + + + + + + - + + + + + + + + + + + + + - + + + + + + + + - + ( + + ) + - - + + + - + ( + + ) + - + - + - + - + - + - + - + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - + - + - + - + - - + - + - + @@ -206,7 +360,7 @@ / - + @@ -215,155 +369,109 @@ / - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - + - + + - - - + + + + + + + + + - + + + + + + + + + + - + + + + - - - + + - - - - - - + + + - + + + - - - - + + + + + - + + + + + + + + + - + + + + + + + + - + + - - - - - - - - - - + - - - - - - + + + - + + - - - - Kč - - - - - - - - - - + + - - - - + - + + - - - - - + + - @@ -373,21 +481,19 @@ - - + + - - - - + - + + - - - - - + + - Kč @@ -396,200 +502,208 @@ - + + + + + + + - + + + + + + + - + + + + + + + + + + + + + + + + + - + + + + + + + - + + + + + + + + + + + : - + : : - + : - - + + - + Yes - + Yes - + No - - + + - + True - + True - + False - - + + - + On - + On - + Off - - + + - + ¥€ - + - + ( - + ) - + - - + + - + - - + - + - + $ - + - + ($ - + ) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - + + - + - - - + + + - - - + + + + + + + - + + + + + + + + + + + + + + - + + + - - - - - - - - - + + - + + - - - + + + - - - € - - - - - - - - - + - - + - - - - + - @@ -599,18 +713,16 @@ - + - - + - - - - + - € @@ -619,109 +731,99 @@ - - - - - $ - - - - - ($ - - ) - - + + + + + - + + + + + - + + + + + + + + + + + + + + + + - + + + + + - + + + + + + + + + + + + + + $ - + - + + ($ + + ) + + + + $ + + + + ($ - + ) - + - - $ - - - - - ($ - - ) - - - - - - - - - - ( - - ) - - - - - - - - - - - - - - $ - - + $ + - - $ - - ( - + + ($ + ) + - - $ - - - - - - - - - - - - $ - - + + - $ - + ( - + ) - $ - - - - - + + - @@ -730,149 +832,128 @@ - + + $ + + + + + + $ + + ( + + ) + + + $ + + - + + + + + + + + + + $ + + + + + + $ + + ( + + ) + + + $ + + - + + + + + + + + + + + - + - + ( - + ) - + - - \ - - - - \- - - - - - \ - - - - - \- - - - - - \ - - - - \- - - - - - \ - - - - - \- - - - - \ - - - + \ + - - \ - - - - - + + \- + + - - \ - - - + + \ + - - - - - - - - - - - + + + \- + + - - - - - - + + \ + - - - - + + \- + + - - - - - - - - - \ - - - + + \ + - - \ - - - - - + + + \- + + - - \ - - - - - - - - - - - - - - - + \ + + - + \ + - - + - - - - - + \ + + - @@ -882,575 +963,602 @@ - - + + + - + + - - - - + + - - - - - - - - - - - - - - - - - - - - - - + + + - + + + + + + + - - + \ + + + - - + + \ + - - - - + + - - + + \ + + - + + + + + + + + + + + + + + + + + + - + + + + + + - + + + + + + + + + + + + + + + + - + + + + + + + + + - + + + + + + + + + + - + + + + + + + + + + + - + + + + + + + + $ - + - + $( - + ) - + $- - + - - - + + + - - + + - + ( - + ) - + - - + - - - + + + - + $ - + - + $( - + ) - + $- - + - + - - - + + + - - + + - + ( - + ) - + - - + - + - - - + + + - - - % - - - - % - - - - % - - - - % - - - - % - - - - % - - - - % - - - - % - - + % - + + % + + + + % + + + + % + + + + % + + + + % + + + + % + + + + % + + + + % + + + % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - + - + - - + - + - - + - + - - + - + - - + - + - - + - + - - + - + - - + - + - - + - + - - + - + - - + - - - - - - % - - - - % - - - - % - - - - % - - - - % - - - - % - - - - - - $ - + + + + - + - ( - $ - - ) - + - + + + + - - + + + + + + + + - + + + + + + + + + + + + + - + + + + + + + + + + + + + - + + + + + + + + + + % - - + + + % + + + % + + % + + + + % + + + + % + + + + + + $ + + + + + ( + $ + + ) + + + + + % + + + + % + + - - + % - + - - + + - + - - - + + - + - - - + £ - + - + - £ - - - - - £ - - - - - - - £ - - - - - - % - - - - - - - % - - - - - DM - - - - - - DM - - - - - DM - - - - - - - DM - - - - - DM - - - - - - DM + - - - - DM - - + + + £ + + + - - - DM - - + £ + + + + + + % + + + + - + + % + + - - - + + DM - - - - - - + + - + + DM + - - - - + + + DM + + + + - + + DM + + + + + DM + + + - + + DM + - - - - - - - - - - DM + + DM - - - - - - DM + + + - + + DM + - - - - DM - - - - - - - - - - + + - - - - + - + + - - - - - + + - @@ -1460,21 +1568,19 @@ - - + + DM - - - - + - + + DM - - - - - DM + + - DM @@ -1483,253 +1589,301 @@ - + + + + + + + - + + + + + + + - + + + + + + + + + + + + + + DM + + + - + + + DM + + + + - + + DM + + + + + + + + + Ouch! - - Error detected! - + - Result=0 - No Errordetection - + / / - - - - - - - - - - - £ - - - - - - - - - £ - - - - - - - - - - £ - - - - - - - - - £ - - + + + + + + + + + + £ + + + + + + + + + £ + + + - - + + - - - - + + £ + - - - - - - + + + + - - - - - - - - - - - - - - £ - - - - - - - - - - - - £ - - - - - - - - - - - - - + £ + + + + + + + + + + + - - - - - - - - - + - - + + - + + + - + + - - - + + + - - £ - - + + £ + + - - - - + + + + - - £ - - - - - + + £ + + - - + - - - + + + - - - - - - + + + + + + - - - - - - - + + - DM - - + + + - - + - DM - - - - + + + - DM - - + + + + + + £ + + + + + + + + + + + + £ + - - + - DM - - - - + + + - DM - - - - - - - - DM - - - - - - DM - - - - - - - - DM - - + + + + - - - DM + + - - - - DM + + - + - + DM + - + + + DM + + + + + + DM + + + - + + + DM + + + + + + DM + + + + - + + + DM + + + + + + DM + + + + - + + + DM + + + + + + DM + + + + - + + + DM + + + + + + + + - + - - + - + tan @@ -1737,75 +1891,75 @@ - - + + - - + + - - + + - - + + - + - - + + - - + + - + - - + - + - + - - + + - + - - + + - - + + - - + + - + - - + - + - + : @@ -1814,289 +1968,240 @@ - + : : - + - + - + - - - + + - + - + - + - - - + + - - + + - - + + - - + + - - + + - - + + - - - / - - / - - - - - - - - - - - - - - - - - - - - - - - - - - : - - - - - - - : - - : - - - - - - - : - - - - - : - - : - - / / - - - : - - - - - - - - ( - - ) - - - - - - - - - ( - - ) - - - - - - - - - ( - - - ) - - - - - - - - - - ( - - - ) - - - - - - - - - ( - - - ) - - - - - - - - - - ( - - - ) - - - - + + + - + + - + + + + - - + + + - + + + + + : + + + + + + + : + + : + + + + + + + : + + + : : - + + + / + + / + + + + : + + + + + + + + + ( + + ) + + + + + + + + + ( + + ) + + + + + + + + + ( + + + ) + + + + + + + + + + ( + + + ) + + + + + + + + + ( + + + ) + + + + + + + + + + ( + + + ) + + + + + - + + + + + : + + : + + + : - - + + - + ( - + ) - + - - + + - - + + % - - + + - - - - - - - - ( - - ) - - - - - - - - - - - - - - - - - - - - - - - ( - - ) - - - - - - - - - - - - - - - - + + - + ( - + ) - - - - - + + - @@ -2107,23 +2212,21 @@ - - + + - + ( - + ) - - - - - + + - @@ -2132,85 +2235,136 @@ - - + + + + - - + + + ( + + ) - - + + + - + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + ( + + ) + + + + + - + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + . - + . - + - + : - + : @@ -2219,215 +2373,204 @@ - - - . - - . - - - - : - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - + + - - + + - - - + + - - + + - - - + + - - + + - - - + + - + + + + + + - + + + + + + + + + + + - + + + + + + + + + + - + + + + + + + + + + + - + + + + + : : - + : - - + + - + - + - + - + - - + - + - + - + - + - - + - + - + - + - + - - + - + - + - + - + - - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - : - - - - - - - : - - : - - - - - - - : - - - - - : - - : - - + + - + + - + + + + + - + + + + + - + + + + + : + + + + + + + : + + : + + + + + + + : + + + + + : + + : + + + - @@ -2438,140 +2581,140 @@ : - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - + - - - + + + + - + + + + + + + + + - + + + + + + + + + + - + + + + + + + + + + - - - + + - - + - - - + + + - - - - + + + + - - - - + + + + - - - - + + + - - + - - - + + + - - - + + + - - - + + + - - - + + - - + - + - - - + + + - - - - + + + + - - - - + + + + - - - - + + + - - + - + - - - + + + - + @@ -2580,7 +2723,7 @@ - + @@ -2593,6 +2736,9 @@ + + + @@ -2630,10 +2776,7 @@ - - - - + @@ -2680,17 +2823,17 @@ - - + + - - + + - - + + @@ -2700,273 +2843,215 @@ - - + + - + - - + + - + - - - + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + - + - + - - - - - - - - - - - + + + + - + - + - - + + - + - + + + + + + - - - - + - + - + - - - - - - - - - - - - - - + - - - - - + - + - + - - + + - - - - + + - + - + - + @@ -2986,50 +3071,50 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -3039,43 +3124,53 @@ ??? + Page 1 + - ??? (???) + ???(???) - 00/00/0000, 00:00:00 + 00/00/0000, 00:00:00 + - Page 1 / 99 + Page 1/ 99 + + + + + + + @@ -3107,7 +3202,7 @@ - + Sheet @@ -3118,11 +3213,11 @@ Description - + 1 - + TRUE @@ -3139,44 +3234,19 @@ - + - - - - - - - - - - - - - - - - - - - - - + - + - - - - - - + @@ -3205,7 +3275,7 @@ - + Function @@ -3222,22 +3292,22 @@ Comment - + -5+12i - + + - - + - + -5+12i @@ -3245,7 +3315,7 @@ TRUE - + =IMPOWER("2+3i",2) @@ -3259,7 +3329,7 @@ -5 - + 12 @@ -3268,31 +3338,31 @@ TRUE - + -4+12i - + - - + + - + - - - -46+9,00000000000001i + + + -46+9.00000000000001i TRUE - + =IMPOWER("2+3i", 3) @@ -3306,7 +3376,7 @@ -46 - + 9.00000000000001 @@ -3315,28 +3385,28 @@ TRUE - + -3+12i - + + - - + - + - + -119-120i - + TRUE - + =IMPOWER("-5+12i",2) @@ -3350,7 +3420,7 @@ -119 - + -120 @@ -3359,29 +3429,29 @@ TRUE - + -2+12i - + - - + + - + - + -119-120i - - + + TRUE - + =IMPOWER(N1,2) @@ -3395,7 +3465,7 @@ -119 - + -120 @@ -3404,29 +3474,29 @@ TRUE - + -1+12i - + - - + + - + - + -119-120i - + TRUE - + {=IMPOWER(N1:N12,2)} @@ -3440,7 +3510,7 @@ -119 - + -120 @@ -3449,29 +3519,29 @@ TRUE - + 0+12i - + - - + + - + - + -128-96i - + TRUE - + {=IMPOWER(N1:N12,2)} @@ -3485,7 +3555,7 @@ -128 - + -96 @@ -3494,29 +3564,29 @@ TRUE - + 1+12i - + - - + + - + - + -135-72i - + TRUE - + {=IMPOWER(N1:N12,2)} @@ -3530,7 +3600,7 @@ -135 - + -72 @@ -3539,29 +3609,29 @@ TRUE - + 2+12i - + - - + + - + - + -140-48i - + TRUE - + {=IMPOWER(N1:N12,2)} @@ -3575,7 +3645,7 @@ -140 - + -48 @@ -3584,29 +3654,29 @@ TRUE - + 3+12i - + - - + + - + - + -143-24i - - + + TRUE - + {=IMPOWER(N1:N12,2)} @@ -3620,7 +3690,7 @@ -143 - + -24 @@ -3629,28 +3699,28 @@ TRUE - + 4+12i - + - + - + - - - -144+1,76349139077219e-14i + + + -144+1.76349139077219e-14i - - + + TRUE - + {=IMPOWER(N1:N12,2)} @@ -3664,7 +3734,7 @@ -144 - + 1.76349139077219E-14 @@ -3673,27 +3743,27 @@ TRUE - + 5+12i - + - + - + -143+24i - + TRUE - + {=IMPOWER(N1:N12,2)} @@ -3707,7 +3777,7 @@ -143 - + 24 @@ -3716,26 +3786,26 @@ TRUE - + 6+12i - + - + - + -140+48i - + TRUE - + {=IMPOWER(N1:N12,2)} @@ -3749,7 +3819,7 @@ -140 - + 48 @@ -3758,24 +3828,24 @@ TRUE - + - + - + - + -135+72i - + TRUE - + {=IMPOWER(N1:N12,2)} @@ -3789,7 +3859,7 @@ -135 - + 72 @@ -3798,24 +3868,24 @@ TRUE - + - + - + - + -128+96i - + TRUE - + {=IMPOWER(N1:N12,2)} @@ -3829,7 +3899,7 @@ -128 - + 96 @@ -3838,24 +3908,24 @@ TRUE - + - + - + - + -119+120i - + TRUE - + {=IMPOWER(N1:N12,2)} @@ -3869,7 +3939,7 @@ -119 - + 120 @@ -3878,24 +3948,24 @@ TRUE - + - + - + - + -108+144i - + TRUE - + {=IMPOWER(N1:N12,2)} @@ -3909,7 +3979,7 @@ -108 - + 144 @@ -3918,24 +3988,24 @@ TRUE - + - + - + - - - -1-1,22464679914735e-16j + + + -1-1.22464679914735e-16j - + TRUE - + =IMPOWER("0-j",2) @@ -3949,7 +4019,7 @@ -1 - + -1.22464679914735E-16 @@ -3958,24 +4028,24 @@ TRUE - + - + - + - + 4 - + TRUE - + =IMPOWER(4,1) @@ -3989,7 +4059,7 @@ 4 - + 0 @@ -3998,16 +4068,16 @@ TRUE - + - + - + - + -44+117i @@ -4015,21 +4085,21 @@ TRUE - + =IMPOWER("4+3i",3) -44 - + 117 -44 - + 117 @@ -4038,1833 +4108,1623 @@ TRUE - + - + - + - + 1 1 - + TRUE - + =IMPOWER("4+3i",0) - - - - - + + + + + - + - - + + Err:502 error - + TRUE - - =IMPOWER(F24,2) + + =IMPOWER(F22,2) - - - - - + + + + + - + - - - - - + + + 0.999999867866953-1.20477878982689e-08j + + + 0.999999867866953-1.20477878982689e-08j + + + TRUE + + + =IMPOWER("0.999999933933474-6.02389434711221e-09j",2) + - - - - - + + + + + - + - - - - - - - - - - - - + + + + + + + + - + - - - - - - - - - - - - - - - - - - + + - - - - + + + - + - + - - + + - - - + + - + - + - + - - + + - - - - + + + - + - + - - + + - - - - + + + - + - + - - + + - - - - + + + - + - + - - + + - - - - + + + - + - + - - + + - - - + + - + - + - + - - + + - - - - + + + - + - + - - + + - - - - + + + - + - + - - + + - - - + + - + - + - - + + - - - + + 58 - + - + - - + + - - - + + 59 - + - + - - + + - - - + + 60 - + - + - - + + - - - + + 61 - + - + - - + + - - - + + 62 - + - + - - + + - - - + + 63 - + - + - - + + - - - + + 64 - + - + - - + + - - - + + 65 - + - + - - + + - - - + + 66 - + - + - - + + - - - + + 67 - + - + - - + + - - - + + 68 - + - + - - + + - - - + + 69 - + - + - - + + - - - + + 70 - + - + - - + + - - - + + 71 - + - + - - + + - - - + + 72 - + - + - - + + - - - + + 73 - + - + - - + + - - - + + 74 - + - + - - + + - - - + + 75 - + - + - - + + - - - + + 76 - + - + - - + + - - - + + 77 - + - + - - + + - - - + + 78 - + - + - - + + - - - + + 79 - + - + - - + + - - - + + 80 - + - + - - + + - - - + + 81 - + - + - - + + - - - + + 82 - + - + - - + + - - - + + 83 - + - + - - + + - - - + + 84 - + - + - - + + - - - + + 85 - + - + - - + + - - - + + 86 - + - + - - + + - - - + + 87 - + - + - - + + - - - + + 88 - + - + - - + + - - - + + 89 - + - + - - + + - - - + + 90 - + - + - - + + - - - + + 91 - + - + - - + + - - - + + 92 - + - + - - + + - - - + + 93 - + - + - - - - - + + + + 94 - + - + - - - - - + + + + 95 - + - + - - + + - - - + + 96 - + - + - - + + - - - + + 97 - + - + - - + + - - - + + 98 - + - + - - + + - - - + + 99 - + - + - - + + - - - + + 100 - + - + - - + + - - - + + - + - + - - + + - - - + + - + - + - - + + - - - + + - + - + - - + + - - - + + - + - + - + - - - + + - + - + - + - - + + - + - + - + - - - + + - + - + - - - + + - - + - + - + - + - + - + - + - + 548 - + - + - + 549 - + - + - + 550 - + - + - + 551 - + - + - + 552 - + - + - + 553 - + - + - + 554 - + - + - + 555 - + - + - + 556 - + - + - + 557 - + - + - + 558 - + - + - + 559 - + - + - + 560 - + - + - + 561 - + - + - + 562 - + - + - + 563 - + - + - + 564 - + - + - + 565 - + - + - + 566 - + - + - + 567 - + - + - + 568 - + - + - + 569 - + - + - + 570 - + - + - + 571 - + - + - + 572 - + - + - + 573 - + - + - + 574 - + - + - + 575 - + - + - + 576 - + - + - + 577 - + - + - + 578 - + - + - + 579 - + - + - + 580 - + - + - + 581 - + - + - + 582 - + - + - + 583 - + - + - + 584 - + - + - + 585 - + - + - + 586 - + - + - + 587 - + - + - + 588 - + - + - + 589 - + - + - + 590 - + - + - + 591 - + - + - + 592 - + - + - + 593 - + - + - + 594 - + - + - + 595 - + - + - + 596 - + - + - + - + - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sc/qa/unit/data/functions/addin/fods/imsech.fods b/sc/qa/unit/data/functions/addin/fods/imsech.fods index fea02a7d07d1..10d156385354 100644 --- a/sc/qa/unit/data/functions/addin/fods/imsech.fods +++ b/sc/qa/unit/data/functions/addin/fods/imsech.fods @@ -1,280 +1,357 @@ - + + 2023-12-11T00:08:12.127159275PT26S1LibreOfficeDev/24.2.0.0.alpha1$MacOSX_X86_64 LibreOffice_project/5eeb43041aa0042dfd963d94dd78d173585ef8e2 + + + 0 + 0 + 22010 + 5214 + + + view1 + + + 0 + 0 + 2 + 0 + 0 + 0 + 0 + 0 + 100 + 60 + true + false + false + false + false + + + 5 + 11 + 2 + 0 + 0 + 0 + 7 + 0 + 100 + 60 + true + false + false + false + false + + + Sheet2 + 1417 + 0 + 100 + 60 + false + true + true + false + true + 12632256 + true + 1 + true + true + false + false + false + 1000 + 1000 + 1 + 1 + true + false + false + false + false + + + + + true + true + true + 0 + true + true + false + true + false + 12632256 + true + true + 0 + false + false + true + true + false + 3 + false + Samsung M2020 Series + false + LgH+/1NhbXN1bmcgTTIwMjAgU2VyaWVzAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAU2Ftc3VuZyBNMjAyMCBTZXJpZXMAAAAAAAAAAAAAAAAWAAQABAAAAAAAAAAEAAhSAAAEdAAAAAAAABIAQ09NUEFUX0RVUExFWF9NT0RFEwBEdXBsZXhNb2RlOjpVbmtub3duDABQUklOVEVSX05BTUUUAFNhbXN1bmcgTTIwMjAgU2VyaWVzCwBEUklWRVJfTkFNRRQAU2Ftc3VuZyBNMjAyMCBTZXJpZXM= + false + 1000 + 1000 + 1 + 1 + true + false + false + true + true + true + true + 7 + true + + + Sheet1 + + + Sheet2 + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + - - + + - + - - + - + - - - + + + - - + + ( - + ) - - + + - - + - + - - - + + + - - + + - - + + + + + + + + + - + + + + + + + + + + + + - + + + + + - + + - - + - - - - - - - - - - - - - - + - - + - - + + - - - - - - - + + + ( + + ) + + + + - - - - - £ - - - - - - £ - - - - - £ - - - - - - £ - - - - - £ - - - - - - - £ - + + + ( + + ) - - - £ - - - - - - - £ - - - - - £ - - - - - - - £ - - - - - - + + + + + + - ( - - ) - + - - - + + - ( - - ) - + + + + + + + + + + + + + - - £ - - - - - - - £ - - - - - - £ - - - - - - - £ - - - - - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - + - - + - + - + - + - - + - + - + @@ -283,7 +360,7 @@ / - + @@ -292,402 +369,461 @@ / - + - + - + - - + + + + + + + + + - + + + + + + + + + + + - + + + + + + + + + + - + + + + + + + + + + + - + + + + + + + + + - + + + + + + + + + - + + + + + + + + - + - - - - - - - - - - + + - - - - - + - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - + + - + + - - + + - - + - - - + + + - - - + + + - - - - - + + - + + - - + + - Kč - + - - - + + + - - - + + + - - - - - - - - - + - - + + - - - - - - - - - - - - - - - - - - - - - + + - - - + + - + - - - + + + - + + + + + + + - + + + + + + + - + + + + + + + + + + + : - + : : - + : - - + + - + Yes - + Yes - + No - - + + - + True - + True - + False - - + + - + On - + On - + Off - - + + - + ¥€ - + - + ( - + ) - + - - + + - + - - + - + - + $ - + - + ($ - + ) - + - - + + - + - - + - + - - + + - + - - + - + - - + + - - + + - + - - + - + - - + + - + - - + - + - - + + - + - - + - + - - + - - - + + + - - + + - + - - + - + - € - + - - - + + + - - + + - + - - + - + - - + - + - - - + + + - - + + + + - + + + + + - + + + + + + + + + + + + + + + $ + + + + + ($ + + ) + + + + $ + + + + + + ($ + + ) + + + + $ + + + + + ($ + + ) + + + + + + + - - - - + + ( + + ) - - - - + + - @@ -696,954 +832,962 @@ - - - - - $ - - - - - ($ - - ) - - - $ - - - - - - ($ - - ) - - - - $ - - - - - ($ - - ) - - - - - - - - - - ( - - ) - - - - - - - - - - - - - - - $ - - - - - - $ - - ( - - ) - - - $ - - - - - - - - - - - - - $ - - - - - - $ - - ( - - ) - - - $ - - - - - - - - - - - - - - - - - - - - - - ( - - - - ) - - - - \ - - - - \- - - - - - \ - - - - - \- - - - - - \ - - - - \- - - - - - \ - - - - - \- - - - - - \ - - - - - - \ - - - - - - - - \ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ - - - - - - \ - - - - - - - - \ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $ - + + - - $( - + + $ + + ( + ) - + + $ + + - + + + + + + + + + + $ + + + + + + $ + + ( + + ) + + + $ + + - + + + + + + + + + + + + + + + + + + + ( + + + + ) + + + + \ + + + + \- + + + + + \ + + + + + \- + + + + + \ + + + + \- + + + + + \ + + + + + \- + + + + + \ + + + + + + \ + + - + + + + + \ + + - + + + + + + + + + + + + + + + + - + + + + + + - + + + + + + + + + + \ + + + + + + \ + + - + + + + + \ + + - + + + + + + + + + + + + + + + + + + - + + + + + + - + + + + + + + + + + + + + + + + - + + + + + + + + + + + - + + + + + + + + + + - + + + + + + + + + + + - + + + + + + + + + $ + + + + + $( + + ) + + $- - + - - - + + + - - + + - + ( - + ) - + - - + - - - + + + - + $ - + - + $( - + ) - + $- - + - + - - - + + + - - + + - + ( - + ) - + - - + - + - - - + + + + + + % + + + + % + + + + % + + + + % + + + + % + + + + % + + + + % + + + + % + + + + % + - + % - - - % - - - - % - - - - % - - - - % - - - - % - - - - % - - - - % - - - - % - - - - % - - - + + - + - - + - + - - + + - + - - + - + - - + + - + - - + - + - - + + - + - - + - + - - + + - + - - + - + - - + + - + - - + - + - - + + - + - - + - + - - + + - + - - + - + - - + + - + - - + - + - - + + - + - - + - + - - + + - + - - + - + - - + + - + - - + - + - - + + - + - - + - + - - + + - + - - + - + - - + + - + - - + - + - - + + - - + + % - - + + + % + + + + % + + + + % + + + + % + + + + % + + + + + + $ + + + + + ( + $ + + ) + + + + + % + + + % - - % - - - - % - - - - % - - - - % - - - - - - $ - - - - - ( - $ - - ) - - - - - % - - - - % - - - - + % - + - - + + - + - - - + + - + - - - + £ - + - + - £ - + + + + + £ + + + + + - + £ + + + + + + % + + + + - + + % + + + + + DM + + + - + + DM + + + + + DM + + + + - + + DM + + + + + DM + + + - + + DM + + + + + DM + + + + - + + DM - - - £ - - - - - - - £ - - - - - - % - - - - - - - % - - - - - DM - - - - - DM - - - - - DM - - - - - - - DM - - - - - DM - - - - - - DM - - - - - DM - - - - - - - DM - - - - - + + + - - - - - + + - + + - - + + - - + - - - + + + - - - + + + DM - - - - - + + - + + DM - - + + - DM + + + + + + + + + + + + + + - + + + + + + + - + + + + + + + + + + + + + + DM + + + - + + + DM + + + + - + + DM + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - DM - - - - - - - DM - - - - - - - DM - - - - - - - - - Ouch! - - Error detected! - + - Result=0 - No Errordetection - - - / - - / - - - + / / - - + + - - + + - - + + + + £ + + + + + + + + + £ + + + + + + + + + + £ + + + + + + + + + £ + + + + + + + + + + + + + + + - + + + + + + + - + + + + + + + + - £ - + £ + + + - + - - + + + - - £ - + + £ + + - - - - - - + + + + + + + + + + + - - £ - + + - + + + - - - - - - - £ - - - - - - - + + + - + + + + + + + + + - - + £ + + - - - - + + + - - - + £ + + - + + @@ -1652,168 +1796,94 @@ - - £ - - - - - - - - - - - - £ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - £ - - - - - - - - - - - - £ - - - - - - - - - - - - - - + - + + + + + - + + + + + + + + DM + + + - + + + DM + + + + + + DM + + + - + + + DM + + + + + + DM + + + + - + + + DM + + + + + + DM + + + + - + + + DM + + + + + + DM + + + + - + + + DM + + + + + + + + + - - - - - - - DM - - - - - - - DM - - - - - - DM - - - - - - - DM - - - - - - DM - - - - - - - - DM - - - - - - DM - - - - - - - - DM - - - - - - DM - - - - - - - - DM - - - - - - - - - - - - - - - - - + tan @@ -1821,75 +1891,75 @@ - - + + - - + + - - + + - - + + - + - - + + - - + + - + - - + - + - + - - + + - + - - + + - - + + - - + + - + - - + - + - + : @@ -1898,289 +1968,240 @@ - + : : - + - + - + - - - + + - + - + - + - - - + + - - + + - - + + - - + + - - + + - - + + - - - / - - / - - - - - - - - - - - - - - - - - - - - - - - - - - : - - - - - - - : - - : - - - - - - - : - - - - - : - - : - - / / - - - : - - - - - - - - ( - - ) - - - - - - - - - ( - - ) - - - - - - - - - ( - - - ) - - - - - - - - - - ( - - - ) - - - - - - - - - ( - - - ) - - - - - - - - - - ( - - - ) - - - - + + + - + + - + + + + - - + + + - + + + + + : + + + + + + + : + + : + + + + + + + : + + + : : - + + + / + + / + + + + : + + + + + + + + + ( + + ) + + + + + + + + + ( + + ) + + + + + + + + + ( + + + ) + + + + + + + + + + ( + + + ) + + + + + + + + + ( + + + ) + + + + + + + + + + ( + + + ) + + + + + - + + + + + : + + : + + + : - - + + - + ( - + ) - + - - + + - - + + % - - + + - - - - - - - - ( - - ) - - - - - - - - - - - - - - - - - - - - - - - ( - - ) - - - - - - - - - - - - - - - - + + - + ( - + ) - - - - - + + - @@ -2191,23 +2212,21 @@ - - + + - + ( - + ) - - - - - + + - @@ -2216,85 +2235,136 @@ - - + + + + - - + + + ( + + ) - - + + + - + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + ( + + ) + + + + + - + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + . - + . - + - + : - + : @@ -2303,215 +2373,204 @@ - - - . - - . - - - - : - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - + + - - + + - - - + + - - + + - - - + + - - + + - - - + + - + + + + + + - + + + + + + + + + + + - + + + + + + + + + + - + + + + + + + + + + + - + + + + + : : - + : - - + + - + - + - + - + - - + - + - + - + - + - - + - + - + - + - + - - + - + - + - + - + - - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - : - - - - - - - : - - : - - - - - - - : - - - - - : - - : - - + + - + + - + + + + + - + + + + + - + + + + + : + + + + + + + : + + : + + + + + + + : + + + + + : + + : + + + - @@ -2522,140 +2581,140 @@ : - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - + - - - + + + + - + + + + + + + + + - + + + + + + + + + + - + + + + + + + + + + - - - + + - - + - - - + + + - - - - + + + + - - - - + + + + - - - - + + + - - + - - - + + + - - - + + + - - - + + + - - - + + - - + - + - - - + + + - - - - + + + + - - - - + + + + - - - - + + + - - + - + - - - + + + - + @@ -2664,7 +2723,7 @@ - + @@ -2677,6 +2736,9 @@ + + + @@ -2714,10 +2776,7 @@ - - - - + @@ -2764,18 +2823,18 @@ - - + + - - - + + + - - - + + + @@ -2784,232 +2843,178 @@ - - + + - + - - + + - + - - - + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + - + - - - - - - - - + - + - + - + - - + + - + - + - - - - + - - + + - - - - - - - - + - - - - + @@ -3017,40 +3022,34 @@ - - - - - + - + - + - - + + - - - - + + - + - + - + @@ -3070,50 +3069,50 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -3123,43 +3122,53 @@ ??? + Page 1 + - ??? (???) + ???(???) - 00/00/0000, 00:00:00 + 00/00/0000, 00:00:00 + - Page 1 / 99 + Page 1/ 99 + + + + + + + @@ -3191,7 +3200,7 @@ - + Sheet @@ -3202,11 +3211,11 @@ Description - + 1 - + TRUE @@ -3223,48 +3232,23 @@ - + - - - - - - - - - - - - - - - - - - - - - + - + - + - - - - - @@ -3289,7 +3273,7 @@ - + Function @@ -3306,45 +3290,45 @@ Comment - + -5+12i - + - - + + - + - - - 0,0113717647601419+0,00723019299882505j + + + 0.0113717647601419+0.00723019299882505j - + TRUE - + =IMSECH("5+12j") - 0.011371764760142 + 0.0113717647601419 - 0.007230192998825 + 0.00723019299882505 - 0.011371764760142 + 0.0113717647601419 - - 0.007230192998825 + + 0.00723019299882505 TRUE @@ -3352,31 +3336,31 @@ TRUE - + -4+12i - + - - + + - + - - - 3,52532008581609 + + + 3.52532008581609 - + TRUE - + =IMSECH(COMPLEX(0,5)) @@ -3390,7 +3374,7 @@ 3.52532008581609 - + 0 @@ -3399,43 +3383,43 @@ TRUE - + -3+12i - + - - - + + + - + - - - 0,0113717647601419-0,00723019299882505i + + + 0.0113717647601419-0.00723019299882505i - + TRUE - + =IMSECH("-5+12i") - 0.011371764760142 + 0.0113717647601419 - -0.007230192998825 + -0.00723019299882505 - 0.011371764760142 + 0.0113717647601419 - - -0.007230192998825 + + -0.00723019299882505 TRUE @@ -3443,44 +3427,44 @@ TRUE - + -2+12i - + - - + + - + - - - 0,0113717647601419-0,00723019299882505i + + + 0.0113717647601419-0.00723019299882505i - - + + TRUE - + =IMSECH(N1) - 0.011371764760142 + 0.0113717647601419 - -0.007230192998825 + -0.00723019299882505 - 0.011371764760142 + 0.0113717647601419 - - -0.007230192998825 + + -0.00723019299882505 TRUE @@ -3488,44 +3472,44 @@ TRUE - + -1+12i - + - - + + - + - - - 0,0113717647601419-0,00723019299882505i + + + 0.0113717647601419-0.00723019299882505i - + TRUE - + {=IMSECH(N1:N12)} - 0.011371764760142 + 0.0113717647601419 - -0.007230192998825 + -0.00723019299882505 - 0.011371764760142 + 0.0113717647601419 - - -0.007230192998825 + + -0.00723019299882505 TRUE @@ -3533,29 +3517,29 @@ TRUE - + 0+12i - + - - + + - + - - - 0,0309130173129131-0,019643165464911i + + + 0.0309130173129131-0.019643165464911i - + TRUE - + {=IMSECH(N1:N12)} @@ -3567,9 +3551,9 @@ - 0.030913017312913 + 0.0309130173129131 - + -0.019643165464911 @@ -3578,44 +3562,44 @@ TRUE - + 1+12i - + - - + + - + - - - 0,0840570317615332-0,0531841822306235i + + + 0.0840570317615333-0.0531841822306235i - + TRUE - + {=IMSECH(N1:N12)} - 0.084057031761533 + 0.0840570317615332 -5.31841822306235E-002 - - 0.084057031761533 + + 0.0840570317615333 - - -0.053184182230624 + + -0.0531841822306235 TRUE @@ -3623,29 +3607,29 @@ TRUE - + 2+12i - + - - + + - + - - - 0,228955472418323-0,140346615592695i + + + 0.228955472418323-0.140346615592695i - + TRUE - + {=IMSECH(N1:N12)} @@ -3659,7 +3643,7 @@ 0.228955472418323 - + -0.140346615592695 @@ -3668,29 +3652,29 @@ TRUE - + 3+12i - + - - + + - + - - - 0,622082253088115-0,301254034403057i + + + 0.622082253088115-0.301254034403057i - - + + TRUE - + {=IMSECH(N1:N12)} @@ -3704,7 +3688,7 @@ 0.622082253088115 - + -0.301254034403057 @@ -3713,42 +3697,42 @@ TRUE - + 4+12i - + - + - + - - - 1,18503917609399 + + + 1.18503917609398 - - + + TRUE - + {=IMSECH(N1:N12)} - - 1.18503917609399 + + 1.18503917609398 0 - - 1.18503917609399 + + 1.18503917609398 - + 0 @@ -3757,27 +3741,27 @@ TRUE - + 5+12i - + - + - - - 0,622082253088115+0,301254034403057i + + + 0.622082253088115+0.301254034403057i - + TRUE - + {=IMSECH(N1:N12)} @@ -3791,7 +3775,7 @@ 0.622082253088115 - + 0.301254034403057 @@ -3800,26 +3784,26 @@ TRUE - + 6+12i - + - + - - - 0,228955472418323+0,140346615592695i + + + 0.228955472418323+0.140346615592695i - + TRUE - + {=IMSECH(N1:N12)} @@ -3833,7 +3817,7 @@ 0.228955472418323 - + 0.140346615592695 @@ -3842,39 +3826,39 @@ TRUE - + - + - + - - - 0,0840570317615332+0,0531841822306235i + + + 0.0840570317615333+0.0531841822306235i - + TRUE - + {=IMSECH(N1:N12)} - 0.084057031761533 + 0.0840570317615332 - 0.053184182230624 + 0.0531841822306235 - - 0.084057031761533 + + 0.0840570317615333 - - 0.053184182230624 + + 0.0531841822306235 TRUE @@ -3882,38 +3866,38 @@ TRUE - + - + - + - - - 0,0309130173129131+0,019643165464911i + + + 0.0309130173129131+0.019643165464911i - + TRUE - + {=IMSECH(N1:N12)} - 0.030913017312913 + 0.0309130173129131 0.019643165464911 - 0.030913017312913 + 0.0309130173129131 - + 0.019643165464911 @@ -3922,39 +3906,39 @@ TRUE - + - + - + - - - 0,0113717647601419+0,00723019299882505i + + + 0.0113717647601419+0.00723019299882505i - + TRUE - + {=IMSECH(N1:N12)} - 0.011371764760142 + 0.0113717647601419 - 0.007230192998825 + 0.00723019299882505 - 0.011371764760142 + 0.0113717647601419 - - 0.007230192998825 + + 0.00723019299882505 TRUE @@ -3962,39 +3946,39 @@ TRUE - + - + - + - - - 0,00418341357158393+0,00266003236738094i + + + 0.00418341357158393+0.00266003236738094i - + TRUE - + {=IMSECH(N1:N12)} - 0.004183413571584 + 0.00418341357158393 - 0.002660032367381 + 0.00266003236738094 - 0.004183413571584 + 0.00418341357158393 - - 0.002660032367381 + + 0.00266003236738094 TRUE @@ -4002,24 +3986,24 @@ TRUE - + - + - + - - - 1,85081571768093 + + + 1.85081571768093 - + TRUE - + =IMSECH("0-j") @@ -4033,7 +4017,7 @@ 1.85081571768093 - + 0 @@ -4042,38 +4026,38 @@ TRUE - + - + - + - - - 0,0366189934736865 + + + 0.0366189934736865 - + TRUE - + =IMSECH(4) - 0.036618993473687 + 0.0366189934736865 0 - 0.036618993473687 + 0.0366189934736865 - + 0 @@ -4082,39 +4066,39 @@ TRUE - + - + - + - - - -0,0362534969158689-0,00516434460775318i + + + -0.0362534969158689-0.00516434460775318i - + TRUE - + =IMSECH("4+3i") - -0.036253496915869 + -0.0362534969158689 - - -0.005164344607753 + + -0.00516434460775318 - -0.036253496915869 + -0.0362534969158689 - - -0.005164344607753 + + -0.00516434460775318 TRUE @@ -4122,1795 +4106,1591 @@ TRUE - + - + - + - + - - - - + + + - - + + - + - + - - + + - - - - + + + - - + + - + - + - - + + + + - - - + - + - + - + - - + + - - - - + + + - + - + - - + + - - - - + + + - + - + - - + + - - - + + - + - + - + - - + + - - - - + + + - + - + - - + + - - - - + + + - + - + - - + + - - - - + + + - + - + - - + + - - - - + + + - + - + - - + + - - - + + - + - + - + - - + + - - - - + + + - + - + - - + + - - - - + + + - + - + - - + + - - - + + - + - + - - + + - - - + + 58 - + - + - - + + - - - + + 59 - + - + - - + + - - - + + 60 - + - + - - + + - - - + + 61 - + - + - - + + - - - + + 62 - + - + - - + + - - - + + 63 - + - + - - + + - - - + + 64 - + - + - - + + - - - + + 65 - + - + - - + + - - - + + 66 - + - + - - + + - - - + + 67 - + - + - - + + - - - + + 68 - + - + - - + + - - - + + 69 - + - + - - + + - - - + + 70 - + - + - - + + - - - + + 71 - + - + - - + + - - - + + 72 - + - + - - + + - - - + + 73 - + - + - - + + - - - + + 74 - + - + - - + + - - - + + 75 - + - + - - + + - - - + + 76 - + - + - - + + - - - + + 77 - + - + - - + + - - - + + 78 - + - + - - + + - - - + + 79 - + - + - - + + - - - + + 80 - + - + - - + + - - - + + 81 - + - + - - + + - - - + + 82 - + - + - - + + - - - + + 83 - + - + - - + + - - - + + 84 - + - + - - + + - - - + + 85 - + - + - - + + - - - + + 86 - + - + - - + + - - - + + 87 - + - + - - + + - - - + + 88 - + - + - - + + - - - + + 89 - + - + - - + + - - - + + 90 - + - + - - + + - - - + + 91 - + - + - - + + - - - + + 92 - + - + - - + + - - - + + 93 - + - + - - - - - + + + + 94 - + - + - - - - - + + + + 95 - + - + - - + + - - - + + 96 - + - + - - + + - - - + + 97 - + - + - - + + - - - + + 98 - + - + - - + + - - - + + 99 - + - + - - + + - - - + + 100 - + - + - - + + - - - + + - + - + - - + + - - - + + - + - + - - + + - - - + + - + - + - - + + - - - + + - + - + - + - - - + + - + - + - + - - + + - + - + - + - - - + + - + - + - - - + + - - + - + - + - + - + - + - + - + 548 - + - + - + 549 - + - + - + 550 - + - + - + 551 - + - + - + 552 - + - + - + 553 - + - + - + 554 - + - + - + 555 - + - + - + 556 - + - + - + 557 - + - + - + 558 - + - + - + 559 - + - + - + 560 - + - + - + 561 - + - + - + 562 - + - + - + 563 - + - + - + 564 - + - + - + 565 - + - + - + 566 - + - + - + 567 - + - + - + 568 - + - + - + 569 - + - + - + 570 - + - + - + 571 - + - + - + 572 - + - + - + 573 - + - + - + 574 - + - + - + 575 - + - + - + 576 - + - + - + 577 - + - + - + 578 - + - + - + 579 - + - + - + 580 - + - + - + 581 - + - + - + 582 - + - + - + 583 - + - + - + 584 - + - + - + 585 - + - + - + 586 - + - + - + 587 - + - + - + 588 - + - + - + 589 - + - + - + 590 - + - + - + 591 - + - + - + 592 - + - + - + 593 - + - + - + 594 - + - + - + 595 - + - + - + 596 - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sc/source/filter/html/htmlpars.cxx b/sc/source/filter/html/htmlpars.cxx index 125d6e98ec80..6c225c3020c8 100644 --- a/sc/source/filter/html/htmlpars.cxx +++ b/sc/source/filter/html/htmlpars.cxx @@ -26,6 +26,7 @@ #include #include +#include #include #include #include @@ -1794,6 +1795,14 @@ void ScHTMLLayoutParser::ProcToken( HtmlImportInfo* pInfo ) } } break; + case HtmlTokenId::STRIKE_ON: + case HtmlTokenId::STRIKETHROUGH_ON: + case HtmlTokenId::DELETEDTEXT_ON: + { + if (IsAtBeginningOfText(pInfo)) + mxActEntry->aItemSet.Put(SvxCrossedOutItem(STRIKEOUT_SINGLE, ATTR_FONT_CROSSEDOUT)); + } + break; case HtmlTokenId::UNDERLINE_ON : { if ( IsAtBeginningOfText( pInfo ) ) diff --git a/sc/source/filter/oox/pivottablebuffer.cxx b/sc/source/filter/oox/pivottablebuffer.cxx index f128e27afd0e..b71652baadc2 100644 --- a/sc/source/filter/oox/pivottablebuffer.cxx +++ b/sc/source/filter/oox/pivottablebuffer.cxx @@ -608,7 +608,7 @@ void PivotTableField::convertDataField( const PTDataFieldModel& rDataField ) means 'count all', and 'countNum' means 'count numbers'. On the other hand, for subtotals, 'countA' means 'count all', and 'count' means 'count numbers' (see above). */ - GeneralFunction eAggFunc = GeneralFunction_SUM; + GeneralFunction eAggFunc; switch( rDataField.mnSubtotal ) { case XML_sum: eAggFunc = GeneralFunction_SUM; break; @@ -622,7 +622,10 @@ void PivotTableField::convertDataField( const PTDataFieldModel& rDataField ) case XML_stdDevp: eAggFunc = GeneralFunction_STDEVP; break; case XML_var: eAggFunc = GeneralFunction_VAR; break; case XML_varp: eAggFunc = GeneralFunction_VARP; break; - default: OSL_FAIL( "PivotTableField::convertDataField - unknown aggregation function" ); + default: + OSL_FAIL( "PivotTableField::convertDataField - unknown aggregation function" ); + eAggFunc = GeneralFunction_SUM; + break; } aPropSet.setProperty( PROP_Function, eAggFunc ); diff --git a/sc/source/filter/rtf/eeimpars.cxx b/sc/source/filter/rtf/eeimpars.cxx index 5b6ad74377f9..8b5b5b58dfb9 100644 --- a/sc/source/filter/rtf/eeimpars.cxx +++ b/sc/source/filter/rtf/eeimpars.cxx @@ -246,6 +246,8 @@ void ScEEImport::WriteToDocument( bool bSizeColsRows, double nOutputFactor, SvNu pAttrItemSet->Put( *pItem ); if ( rESet.GetItemState( ATTR_FONT_UNDERLINE, false, &pItem) == SfxItemState::SET ) pAttrItemSet->Put( *pItem ); + if ( rESet.GetItemState( ATTR_FONT_CROSSEDOUT, false, &pItem) == SfxItemState::SET ) + pAttrItemSet->Put( *pItem ); // HTML LATIN/CJK/CTL script type dependent const SfxPoolItem* pFont; if ( rESet.GetItemState( ATTR_FONT, false, &pFont) != SfxItemState::SET ) diff --git a/sc/source/filter/xml/SparklineGroupsExport.cxx b/sc/source/filter/xml/SparklineGroupsExport.cxx index 2048e421cb0d..2aecc4d01fcb 100644 --- a/sc/source/filter/xml/SparklineGroupsExport.cxx +++ b/sc/source/filter/xml/SparklineGroupsExport.cxx @@ -28,8 +28,9 @@ using namespace xmloff::token; namespace sc { -SparklineGroupsExport::SparklineGroupsExport(ScXMLExport& rExport, SCTAB nTable) - : m_rExport(rExport) +SparklineGroupsExport::SparklineGroupsExport(ScDocument& rDoc, ScXMLExport& rExport, SCTAB nTable) + : m_rDoc(rDoc) + , m_rExport(rExport) , m_nTable(nTable) { } @@ -62,12 +63,10 @@ void SparklineGroupsExport::insertBool(bool bValue, XMLTokenEnum eToken) void SparklineGroupsExport::addSparklineAttributes(Sparkline const& rSparkline) { - auto const* pDocument = m_rExport.GetDocument(); - { OUString sAddressString; ScAddress aAddress(rSparkline.getColumn(), rSparkline.getRow(), m_nTable); - ScRangeStringConverter::GetStringFromAddress(sAddressString, aAddress, pDocument, + ScRangeStringConverter::GetStringFromAddress(sAddressString, aAddress, &m_rDoc, formula::FormulaGrammar::CONV_OOO); m_rExport.AddAttribute(XML_NAMESPACE_CALC_EXT, XML_CELL_ADDRESS, sAddressString); } @@ -75,7 +74,7 @@ void SparklineGroupsExport::addSparklineAttributes(Sparkline const& rSparkline) { OUString sDataRangeString; ScRangeList const& rRangeList = rSparkline.getInputRange(); - ScRangeStringConverter::GetStringFromRangeList(sDataRangeString, &rRangeList, pDocument, + ScRangeStringConverter::GetStringFromRangeList(sDataRangeString, &rRangeList, &m_rDoc, formula::FormulaGrammar::CONV_OOO); m_rExport.AddAttribute(XML_NAMESPACE_CALC_EXT, XML_DATA_RANGE, sDataRangeString); } @@ -215,8 +214,7 @@ void SparklineGroupsExport::addSparklineGroup( void SparklineGroupsExport::write() { - auto* pDocument = m_rExport.GetDocument(); - if (sc::SparklineList* pSparklineList = pDocument->GetSparklineList(m_nTable)) + if (sc::SparklineList* pSparklineList = m_rDoc.GetSparklineList(m_nTable)) { auto const aSparklineGroups = pSparklineList->getSparklineGroups(); if (!aSparklineGroups.empty()) diff --git a/sc/source/filter/xml/SparklineGroupsExport.hxx b/sc/source/filter/xml/SparklineGroupsExport.hxx index a2ed4a8ef853..774fe084fa3c 100644 --- a/sc/source/filter/xml/SparklineGroupsExport.hxx +++ b/sc/source/filter/xml/SparklineGroupsExport.hxx @@ -29,6 +29,7 @@ namespace sc /** Handle the export of sparkline groups and sparklines */ class SparklineGroupsExport { + ScDocument& m_rDoc; ScXMLExport& m_rExport; SCTAB m_nTable; @@ -44,7 +45,7 @@ class SparklineGroupsExport void insertBool(bool bValue, xmloff::token::XMLTokenEnum eToken); public: - SparklineGroupsExport(ScXMLExport& rExport, SCTAB nTable); + SparklineGroupsExport(ScDocument& rDoc, ScXMLExport& rExport, SCTAB nTable); void write(); }; diff --git a/sc/source/filter/xml/XMLChangeTrackingExportHelper.cxx b/sc/source/filter/xml/XMLChangeTrackingExportHelper.cxx index cdc9fe2419d5..83001f45aff9 100644 --- a/sc/source/filter/xml/XMLChangeTrackingExportHelper.cxx +++ b/sc/source/filter/xml/XMLChangeTrackingExportHelper.cxx @@ -42,12 +42,12 @@ using namespace ::com::sun::star; using namespace xmloff::token; -ScChangeTrackingExportHelper::ScChangeTrackingExportHelper(ScXMLExport& rTempExport) - : rExport(rTempExport), - pChangeTrack(nullptr) +ScChangeTrackingExportHelper::ScChangeTrackingExportHelper(ScDocument& rDoc, ScXMLExport& rTempExport) + : m_rDoc(rDoc) + , rExport(rTempExport) + , pChangeTrack(nullptr) { - ScDocument* pDoc = rExport.GetDocument(); - pChangeTrack = pDoc ? pDoc->GetChangeTrack() : nullptr; + pChangeTrack = m_rDoc.GetChangeTrack(); } ScChangeTrackingExportHelper::~ScChangeTrackingExportHelper() @@ -139,7 +139,7 @@ void ScChangeTrackingExportHelper::WriteGenerated(const ScChangeAction* pGenerat #endif SvXMLElementExport aElemPrev(rExport, XML_NAMESPACE_TABLE, XML_CELL_CONTENT_DELETION, true, true); WriteBigRange(pGeneratedAction->GetBigRange(), XML_CELL_ADDRESS); - OUString sValue = static_cast(pGeneratedAction)->GetNewString(rExport.GetDocument()); + OUString sValue = static_cast(pGeneratedAction)->GetNewString(&m_rDoc); WriteCell(static_cast(pGeneratedAction)->GetNewCell(), sValue); } @@ -157,7 +157,7 @@ void ScChangeTrackingExportHelper::WriteDeleted(const ScChangeAction* pDeletedAc SvXMLElementExport aElemPrev(rExport, XML_NAMESPACE_TABLE, XML_CELL_CONTENT_DELETION, true, true); if (static_cast(pDeletedAction)->IsTopContent() && pDeletedAction->IsDeletedIn()) { - OUString sValue = pContentAction->GetNewString(rExport.GetDocument()); + OUString sValue = pContentAction->GetNewString(&m_rDoc); WriteCell(pContentAction->GetNewCell(), sValue); } } @@ -217,10 +217,9 @@ void ScChangeTrackingExportHelper::SetValueAttributes(const double& fValue, cons { sal_uInt32 nIndex = 0; double fTempValue = 0.0; - ScDocument* pDoc = rExport.GetDocument(); - if (pDoc && pDoc->GetFormatTable()->IsNumberFormat(sValue, nIndex, fTempValue)) + if (m_rDoc.GetFormatTable()->IsNumberFormat(sValue, nIndex, fTempValue)) { - SvNumFormatType nType = pDoc->GetFormatTable()->GetType(nIndex); + SvNumFormatType nType = m_rDoc.GetFormatTable()->GetType(nIndex); if (nType & SvNumFormatType::DEFINED) nType &= ~SvNumFormatType::DEFINED; switch(nType) @@ -289,7 +288,7 @@ void ScChangeTrackingExportHelper::WriteEditCell(const ScCellValue& rCell) OUString sString; if (rCell.getEditText()) - sString = ScEditUtil::GetString(*rCell.getEditText(), rExport.GetDocument()); + sString = ScEditUtil::GetString(*rCell.getEditText(), &m_rDoc); rExport.AddAttribute(XML_NAMESPACE_OFFICE, XML_VALUE_TYPE, XML_STRING); SvXMLElementExport aElemC(rExport, XML_NAMESPACE_TABLE, XML_CHANGE_TRACK_TABLE_CELL, true, true); @@ -305,15 +304,12 @@ void ScChangeTrackingExportHelper::WriteEditCell(const ScCellValue& rCell) void ScChangeTrackingExportHelper::WriteFormulaCell(const ScCellValue& rCell, const OUString& sValue) { assert(rCell.getType() == CELLTYPE_FORMULA); - const ScDocument* pDoc = rExport.GetDocument(); - if (!pDoc) - return; ScFormulaCell* pFormulaCell = rCell.getFormula(); OUString sAddress; - ScRangeStringConverter::GetStringFromAddress(sAddress, pFormulaCell->aPos, pDoc, ::formula::FormulaGrammar::CONV_OOO); + ScRangeStringConverter::GetStringFromAddress(sAddress, pFormulaCell->aPos, &m_rDoc, ::formula::FormulaGrammar::CONV_OOO); rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_CELL_ADDRESS, sAddress); - const formula::FormulaGrammar::Grammar eGrammar = pDoc->GetStorageGrammar(); + const formula::FormulaGrammar::Grammar eGrammar = m_rDoc.GetStorageGrammar(); sal_uInt16 nNamespacePrefix = (eGrammar == formula::FormulaGrammar::GRAM_ODFF ? XML_NAMESPACE_OF : XML_NAMESPACE_OOOC); OUString sFormula = pFormulaCell->GetFormula(eGrammar); ScMatrixMode nMatrixFlag(pFormulaCell->GetMatrixFlag()); @@ -398,7 +394,7 @@ void ScChangeTrackingExportHelper::WriteContentChange(const ScChangeAction* pAct if (pPrevAction) rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_ID, GetChangeID(pPrevAction->GetActionNumber())); SvXMLElementExport aElemPrev(rExport, XML_NAMESPACE_TABLE, XML_PREVIOUS, true, true); - OUString sValue = static_cast(pAction)->GetOldString(rExport.GetDocument()); + OUString sValue = static_cast(pAction)->GetOldString(&m_rDoc); WriteCell(static_cast(pAction)->GetOldCell(), sValue); } } diff --git a/sc/source/filter/xml/XMLChangeTrackingExportHelper.hxx b/sc/source/filter/xml/XMLChangeTrackingExportHelper.hxx index be721de62c24..e975953517aa 100644 --- a/sc/source/filter/xml/XMLChangeTrackingExportHelper.hxx +++ b/sc/source/filter/xml/XMLChangeTrackingExportHelper.hxx @@ -29,6 +29,7 @@ class XText; class ScChangeAction; class ScChangeTrack; +class ScDocument; class ScXMLExport; struct ScCellValue; class ScChangeActionDel; @@ -37,6 +38,7 @@ class ScEditEngineTextObj; class ScChangeTrackingExportHelper { + ScDocument& m_rDoc; ScXMLExport& rExport; ScChangeTrack* pChangeTrack; @@ -74,7 +76,7 @@ class ScChangeTrackingExportHelper void WorkWithChangeAction(ScChangeAction* pAction); public: - explicit ScChangeTrackingExportHelper(ScXMLExport& rExport); + explicit ScChangeTrackingExportHelper(ScDocument& rDoc, ScXMLExport& rExport); ~ScChangeTrackingExportHelper(); void CollectAutoStyles(); diff --git a/sc/source/filter/xml/XMLExportDDELinks.cxx b/sc/source/filter/xml/XMLExportDDELinks.cxx index 1cb08d41c4b0..ce9bd6f4da4c 100644 --- a/sc/source/filter/xml/XMLExportDDELinks.cxx +++ b/sc/source/filter/xml/XMLExportDDELinks.cxx @@ -33,8 +33,9 @@ using namespace com::sun::star; using namespace xmloff::token; -ScXMLExportDDELinks::ScXMLExportDDELinks(ScXMLExport& rTempExport) - : rExport(rTempExport) +ScXMLExportDDELinks::ScXMLExportDDELinks(ScDocument& rDoc, ScXMLExport& rTempExport) + : m_rDoc(rDoc) + , rExport(rTempExport) { } @@ -68,11 +69,7 @@ void ScXMLExportDDELinks::WriteCell(const ScMatrixValue& aVal, sal_Int32 nRepeat void ScXMLExportDDELinks::WriteTable(const sal_Int32 nPos) { - ScDocument* pDoc = rExport.GetDocument(); - if (!pDoc) - return; - - const ScMatrix* pMatrix = pDoc->GetDdeLinkResultMatrix(static_cast(nPos)); + const ScMatrix* pMatrix = m_rDoc.GetDdeLinkResultMatrix(static_cast(nPos)); if (!pMatrix) return; @@ -136,8 +133,7 @@ void ScXMLExportDDELinks::WriteDDELinks(const uno::ReferencegetItem()); rExport.AddAttribute(XML_NAMESPACE_OFFICE, XML_AUTOMATIC_UPDATE, XML_TRUE); sal_uInt8 nMode; - ScDocument* pDoc = rExport.GetDocument(); - if (pDoc && pDoc->GetDdeLinkMode(nDDELink, nMode)) + if (m_rDoc.GetDdeLinkMode(nDDELink, nMode)) { switch (nMode) { diff --git a/sc/source/filter/xml/XMLExportDDELinks.hxx b/sc/source/filter/xml/XMLExportDDELinks.hxx index 560f495877e0..98ce043bae43 100644 --- a/sc/source/filter/xml/XMLExportDDELinks.hxx +++ b/sc/source/filter/xml/XMLExportDDELinks.hxx @@ -25,16 +25,18 @@ namespace com::sun::star::uno { template class Reference; namespace com::sun::star::sheet { class XSpreadsheetDocument; } class ScXMLExport; +class ScDocument; struct ScMatrixValue; class ScXMLExportDDELinks { + ScDocument& m_rDoc; ScXMLExport& rExport; void WriteCell(const ScMatrixValue& aVal, sal_Int32 nRepeat); void WriteTable(const sal_Int32 nPos); public: - explicit ScXMLExportDDELinks(ScXMLExport& rExport); + explicit ScXMLExportDDELinks(ScDocument& rDoc, ScXMLExport& rExport); void WriteDDELinks(const css::uno::Reference < css::sheet::XSpreadsheetDocument >& xSpreadDoc); }; diff --git a/sc/source/filter/xml/XMLExportDataPilot.cxx b/sc/source/filter/xml/XMLExportDataPilot.cxx index 5161dede5137..b49bad992a42 100644 --- a/sc/source/filter/xml/XMLExportDataPilot.cxx +++ b/sc/source/filter/xml/XMLExportDataPilot.cxx @@ -57,8 +57,7 @@ using namespace com::sun::star; using namespace xmloff::token; ScXMLExportDataPilot::ScXMLExportDataPilot(ScXMLExport& rTempExport) - : rExport(rTempExport), - pDoc( nullptr ) + : rExport(rTempExport) { } @@ -137,7 +136,7 @@ void ScXMLExportDataPilot::WriteDPCondition(const ScQueryEntry& aQueryEntry, boo SvXMLElementExport aElemC(rExport, XML_NAMESPACE_TABLE, XML_FILTER_CONDITION, true, true); } -void ScXMLExportDataPilot::WriteDPFilter(const ScQueryParam& aQueryParam) +void ScXMLExportDataPilot::WriteDPFilter(ScDocument& rDoc, const ScQueryParam& aQueryParam) { SCSIZE nQueryEntryCount = aQueryParam.GetEntryCount(); if (nQueryEntryCount <= 0) @@ -177,7 +176,7 @@ void ScXMLExportDataPilot::WriteDPFilter(const ScQueryParam& aQueryParam) ScRange aConditionRange(aQueryParam.nCol1, aQueryParam.nRow1, aQueryParam.nTab, aQueryParam.nCol2, aQueryParam.nRow2, aQueryParam.nTab); OUString sConditionRange; - ScRangeStringConverter::GetStringFromRange( sConditionRange, aConditionRange, pDoc, ::formula::FormulaGrammar::CONV_OOO ); + ScRangeStringConverter::GetStringFromRange( sConditionRange, aConditionRange, &rDoc, ::formula::FormulaGrammar::CONV_OOO ); if (!sConditionRange.isEmpty()) rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_CONDITION_SOURCE_RANGE_ADDRESS, sConditionRange); } @@ -730,13 +729,9 @@ void ScXMLExportDataPilot::WriteGrandTotal(::xmloff::token::XMLTokenEnum eOrient SvXMLElementExport aElemGrandTotal(rExport, XML_NAMESPACE_TABLE_EXT, XML_DATA_PILOT_GRAND_TOTAL, true, true); } -void ScXMLExportDataPilot::WriteDataPilots() +void ScXMLExportDataPilot::WriteDataPilots(ScDocument& rDoc) { - pDoc = rExport.GetDocument(); - if (!pDoc) - return; - - ScDPCollection* pDPs = pDoc->GetDPCollection(); + ScDPCollection* pDPs = rDoc.GetDPCollection(); if (!pDPs) return; @@ -754,8 +749,8 @@ void ScXMLExportDataPilot::WriteDataPilots() ScRange aOutRange((*pDPs)[i].GetOutRange()); OUString sTargetRangeAddress; - ScRangeStringConverter::GetStringFromRange( sTargetRangeAddress, aOutRange, pDoc, ::formula::FormulaGrammar::CONV_OOO ); - ScDocAttrIterator aAttrItr(*pDoc, aOutRange.aStart.Tab(), + ScRangeStringConverter::GetStringFromRange( sTargetRangeAddress, aOutRange, &rDoc, ::formula::FormulaGrammar::CONV_OOO ); + ScDocAttrIterator aAttrItr(rDoc, aOutRange.aStart.Tab(), aOutRange.aStart.Col(), aOutRange.aStart.Row(), aOutRange.aEnd.Col(), aOutRange.aEnd.Row()); SCCOL nCol; @@ -771,7 +766,7 @@ void ScXMLExportDataPilot::WriteDataPilots() { ScAddress aButtonAddr(nCol, nButtonRow, aOutRange.aStart.Tab()); ScRangeStringConverter::GetStringFromAddress( - sOUButtonList, aButtonAddr, pDoc, ::formula::FormulaGrammar::CONV_OOO, ' ', true ); + sOUButtonList, aButtonAddr, &rDoc, ::formula::FormulaGrammar::CONV_OOO, ' ', true ); } } pAttr = aAttrItr.GetNext(nCol, nRow1, nRow2); @@ -843,13 +838,13 @@ void ScXMLExportDataPilot::WriteDataPilots() OUString sCellRangeAddress; ScRangeStringConverter::GetStringFromRange( - sCellRangeAddress, pSheetSource->GetSourceRange(), pDoc, + sCellRangeAddress, pSheetSource->GetSourceRange(), &rDoc, ::formula::FormulaGrammar::CONV_OOO); rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_CELL_RANGE_ADDRESS, sCellRangeAddress); SvXMLElementExport aElemSCR(rExport, XML_NAMESPACE_TABLE, XML_SOURCE_CELL_RANGE, true, true); rExport.CheckAttrList(); - WriteDPFilter(pSheetSource->GetQueryParam()); + WriteDPFilter(rDoc, pSheetSource->GetQueryParam()); } else if ((*pDPs)[i].IsImportData()) { diff --git a/sc/source/filter/xml/XMLExportDataPilot.hxx b/sc/source/filter/xml/XMLExportDataPilot.hxx index 04717aa10e1a..882ebc9c86c6 100644 --- a/sc/source/filter/xml/XMLExportDataPilot.hxx +++ b/sc/source/filter/xml/XMLExportDataPilot.hxx @@ -42,12 +42,11 @@ struct ScQueryEntry; class ScXMLExportDataPilot { ScXMLExport& rExport; - ScDocument* pDoc; static OUString getDPOperatorXML(const ScQueryOp aFilterOperator, const utl::SearchParam::SearchType eSearchType); void WriteDPCondition(const ScQueryEntry& aQueryEntry, bool bIsCaseSensitive, utl::SearchParam::SearchType eSearchType); - void WriteDPFilter(const ScQueryParam& aQueryParam); + void WriteDPFilter(ScDocument& rDoc, const ScQueryParam& aQueryParam); void WriteFieldReference(const ScDPSaveDimension* pDim); void WriteSortInfo(const ScDPSaveDimension* pDim); @@ -68,7 +67,7 @@ class ScXMLExportDataPilot public: explicit ScXMLExportDataPilot(ScXMLExport& rExport); - void WriteDataPilots(); + void WriteDataPilots(ScDocument& rDoc); }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/xml/XMLExportDatabaseRanges.cxx b/sc/source/filter/xml/XMLExportDatabaseRanges.cxx index 5deb8978da66..5089bea2ca6b 100644 --- a/sc/source/filter/xml/XMLExportDatabaseRanges.cxx +++ b/sc/source/filter/xml/XMLExportDatabaseRanges.cxx @@ -55,7 +55,7 @@ constexpr OUString SC_USERLIST = u"UserList"_ustr; using namespace com::sun::star; using namespace xmloff::token; -void writeSort(ScXMLExport& mrExport, const ScSortParam& aParam, const ScRange& aRange, const ScDocument* mpDoc) +void writeSort(ScXMLExport& mrExport, const ScSortParam& aParam, const ScRange& aRange, const ScDocument& rDoc) { // Count sort items first. size_t nSortCount = 0; @@ -78,7 +78,7 @@ void writeSort(ScXMLExport& mrExport, const ScSortParam& aParam, const ScRange& { OUString aStr; ScRangeStringConverter::GetStringFromAddress( - aStr, aOutPos, mpDoc, ::formula::FormulaGrammar::CONV_OOO); + aStr, aOutPos, &rDoc, ::formula::FormulaGrammar::CONV_OOO); mrExport.AddAttribute(XML_NAMESPACE_TABLE, XML_TARGET_RANGE_ADDRESS, aStr); } @@ -119,8 +119,7 @@ void writeSort(ScXMLExport& mrExport, const ScSortParam& aParam, const ScRange& } ScXMLExportDatabaseRanges::ScXMLExportDatabaseRanges(ScXMLExport& rTempExport) - : rExport(rTempExport), - pDoc( nullptr ) + : rExport(rTempExport) { } @@ -174,13 +173,13 @@ namespace { class WriteDatabaseRange { ScXMLExport& mrExport; - ScDocument* mpDoc; + ScDocument& mrDoc; sal_Int32 mnCounter; ScDBCollection::RangeType meRangeType; public: - WriteDatabaseRange(ScXMLExport& rExport, ScDocument* pDoc) : - mrExport(rExport), mpDoc(pDoc), mnCounter(0), meRangeType(ScDBCollection::GlobalNamed) {} + WriteDatabaseRange(ScXMLExport& rExport, ScDocument& rDoc) : + mrExport(rExport), mrDoc(rDoc), mnCounter(0), meRangeType(ScDBCollection::GlobalNamed) {} void setRangeType(ScDBCollection::RangeType eNew) { @@ -227,7 +226,7 @@ private: rData.GetArea(aRange); OUString aRangeStr; ScRangeStringConverter::GetStringFromRange( - aRangeStr, aRange, mpDoc, ::formula::FormulaGrammar::CONV_OOO); + aRangeStr, aRange, &mrDoc, ::formula::FormulaGrammar::CONV_OOO); mrExport.AddAttribute(XML_NAMESPACE_TABLE, XML_TARGET_RANGE_ADDRESS, aRangeStr); // various boolean flags. @@ -271,7 +270,7 @@ private: writeImport(rData); writeFilter(rData); - writeSort(mrExport, aParam, aRange, mpDoc); + writeSort(mrExport, aParam, aRange, mrDoc); writeSubtotals(rData); } @@ -521,7 +520,7 @@ private: { OUString aAddrStr; ScRangeStringConverter::GetStringFromAddress( - aAddrStr, ScAddress(aParam.nDestCol, aParam.nDestRow, aParam.nDestTab), mpDoc, ::formula::FormulaGrammar::CONV_OOO); + aAddrStr, ScAddress(aParam.nDestCol, aParam.nDestRow, aParam.nDestTab), &mrDoc, ::formula::FormulaGrammar::CONV_OOO); mrExport.AddAttribute(XML_NAMESPACE_TABLE, XML_TARGET_RANGE_ADDRESS, aAddrStr); } @@ -530,7 +529,7 @@ private: { OUString aAddrStr; ScRangeStringConverter::GetStringFromRange( - aAddrStr, aAdvSource, mpDoc, ::formula::FormulaGrammar::CONV_OOO); + aAddrStr, aAdvSource, &mrDoc, ::formula::FormulaGrammar::CONV_OOO); if (!aAddrStr.isEmpty()) mrExport.AddAttribute(XML_NAMESPACE_TABLE, XML_CONDITION_SOURCE_RANGE_ADDRESS, aAddrStr); } @@ -703,18 +702,14 @@ private: } -void ScXMLExportDatabaseRanges::WriteDatabaseRanges() +void ScXMLExportDatabaseRanges::WriteDatabaseRanges(ScDocument& rDoc) { - pDoc = rExport.GetDocument(); - if (!pDoc) - return; - // Get sheet-local anonymous ranges. - SCTAB nTabCount = pDoc->GetTableCount(); + SCTAB nTabCount = rDoc.GetTableCount(); std::map aSheetDBs; for (SCTAB i = 0; i < nTabCount; ++i) { - const ScDBData* p = pDoc->GetAnonymousDBData(i); + const ScDBData* p = rDoc.GetAnonymousDBData(i); if (p) aSheetDBs.emplace(i, p); } @@ -722,7 +717,7 @@ void ScXMLExportDatabaseRanges::WriteDatabaseRanges() bool bHasRanges = !aSheetDBs.empty(); // See if we have global ranges. - ScDBCollection* pDBCollection = pDoc->GetDBCollection(); + ScDBCollection* pDBCollection = rDoc.GetDBCollection(); if (pDBCollection) { if (!pDBCollection->getNamedDBs().empty() || !pDBCollection->getAnonDBs().empty()) @@ -735,7 +730,7 @@ void ScXMLExportDatabaseRanges::WriteDatabaseRanges() SvXMLElementExport aElemDRs(rExport, XML_NAMESPACE_TABLE, XML_DATABASE_RANGES, true, true); - WriteDatabaseRange func(rExport, pDoc); + WriteDatabaseRange func(rExport, rDoc); if (pDBCollection) { diff --git a/sc/source/filter/xml/XMLExportDatabaseRanges.hxx b/sc/source/filter/xml/XMLExportDatabaseRanges.hxx index ed8f79497526..bc83cc6f182e 100644 --- a/sc/source/filter/xml/XMLExportDatabaseRanges.hxx +++ b/sc/source/filter/xml/XMLExportDatabaseRanges.hxx @@ -26,18 +26,17 @@ class ScXMLExport; class ScDocument; class ScMyEmptyDatabaseRangesContainer; -void writeSort(ScXMLExport& mrExport, const ScSortParam& aParam, const ScRange& aRange, - const ScDocument* mpDoc); +void writeSort(ScXMLExport& rExport, const ScSortParam& rParam, const ScRange& rRange, + const ScDocument& rDoc); class ScXMLExportDatabaseRanges { ScXMLExport& rExport; - ScDocument* pDoc; public: explicit ScXMLExportDatabaseRanges(ScXMLExport& rExport); ScMyEmptyDatabaseRangesContainer GetEmptyDatabaseRanges(); - void WriteDatabaseRanges(); + void WriteDatabaseRanges(ScDocument& rDoc); }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/xml/XMLExportIterator.cxx b/sc/source/filter/xml/XMLExportIterator.cxx index 3283a743adcc..cb8934456ede 100644 --- a/sc/source/filter/xml/XMLExportIterator.cxx +++ b/sc/source/filter/xml/XMLExportIterator.cxx @@ -568,7 +568,7 @@ void ScMyNotEmptyCellsIterator::UpdateAddress( ScAddress& rAddress ) } } -void ScMyNotEmptyCellsIterator::SetCellData( ScMyCell& rMyCell, const ScAddress& rAddress ) +void ScMyNotEmptyCellsIterator::SetCellData(ScDocument& rDoc, ScMyCell& rMyCell, const ScAddress& rAddress) { rMyCell.maBaseCell.clear(); rMyCell.aCellAddress = rAddress; @@ -603,7 +603,7 @@ void ScMyNotEmptyCellsIterator::SetCellData( ScMyCell& rMyCell, const ScAddress& if (rMyCell.maBaseCell.getType() == CELLTYPE_FORMULA) { bool bIsMatrixBase = false; - if (rExport.IsMatrix(rMyCell.maCellAddress, rMyCell.aMatrixRange, bIsMatrixBase)) + if (ScXMLExport::IsMatrix(rDoc, rMyCell.maCellAddress, rMyCell.aMatrixRange, bIsMatrixBase)) { rMyCell.bIsMatrixBase = bIsMatrixBase; rMyCell.bIsMatrixCovered = !bIsMatrixBase; @@ -611,10 +611,11 @@ void ScMyNotEmptyCellsIterator::SetCellData( ScMyCell& rMyCell, const ScAddress& } } -void ScMyNotEmptyCellsIterator::HasAnnotation(ScMyCell& aCell) +//static +void ScMyNotEmptyCellsIterator::HasAnnotation(ScDocument& rDoc, ScMyCell& aCell) { aCell.bHasAnnotation = false; - ScPostIt* pNote = rExport.GetDocument()->GetNote(aCell.maCellAddress); + ScPostIt* pNote = rDoc.GetNote(aCell.maCellAddress); if(pNote) { @@ -623,7 +624,8 @@ void ScMyNotEmptyCellsIterator::HasAnnotation(ScMyCell& aCell) } } -void ScMyNotEmptyCellsIterator::SetCurrentTable(const SCTAB nTable, +void ScMyNotEmptyCellsIterator::SetCurrentTable(ScDocument& rDoc, + const SCTAB nTable, const uno::Reference& rxTable) { aLastAddress.SetRow( 0 ); @@ -636,7 +638,7 @@ void ScMyNotEmptyCellsIterator::SetCurrentTable(const SCTAB nTable, mpCellItr.reset( new ScHorizontalCellIterator( - *rExport.GetDocument(), nCurrentTable, 0, 0, + rDoc, nCurrentTable, 0, 0, static_cast(rExport.GetSharedData()->GetLastColumn(nCurrentTable)), static_cast(rExport.GetSharedData()->GetLastRow(nCurrentTable)))); @@ -665,10 +667,9 @@ void ScMyNotEmptyCellsIterator::SkipTable(SCTAB nSkip) pDetectiveOp->SkipTable(nSkip); } -bool ScMyNotEmptyCellsIterator::GetNext(ScMyCell& aCell, ScFormatRangeStyles* pCellStyles) +bool ScMyNotEmptyCellsIterator::GetNext(ScDocument& rDoc, ScMyCell& aCell, ScFormatRangeStyles* pCellStyles) { - ScDocument* pDoc = rExport.GetDocument(); - ScAddress aAddress( pDoc->MaxCol() + 1, pDoc->MaxRow() + 1, nCurrentTable ); + ScAddress aAddress( rDoc.MaxCol() + 1, rDoc.MaxRow() + 1, nCurrentTable ); UpdateAddress( aAddress ); @@ -687,10 +688,10 @@ bool ScMyNotEmptyCellsIterator::GetNext(ScMyCell& aCell, ScFormatRangeStyles* pC if( pDetectiveOp ) pDetectiveOp->UpdateAddress( aAddress ); - bool bFoundCell( ( aAddress.Col() <= pDoc->MaxCol() ) && ( aAddress.Row() <= pDoc->MaxRow() + 1 ) ); + bool bFoundCell( ( aAddress.Col() <= rDoc.MaxCol() ) && ( aAddress.Row() <= rDoc.MaxRow() + 1 ) ); if( bFoundCell ) { - SetCellData( aCell, aAddress ); + SetCellData(rDoc, aCell, aAddress); if( pShapes ) pShapes->SetCellData( aCell ); if( pNoteShapes ) @@ -706,7 +707,7 @@ bool ScMyNotEmptyCellsIterator::GetNext(ScMyCell& aCell, ScFormatRangeStyles* pC if( pDetectiveOp ) pDetectiveOp->SetCellData( aCell ); - HasAnnotation( aCell ); + HasAnnotation(rDoc, aCell); bool bIsAutoStyle(false); // Ranges before the previous cell are not needed by ExportFormatRanges anymore and can be removed SCROW nRemoveBeforeRow = aLastAddress.Row(); diff --git a/sc/source/filter/xml/XMLExportIterator.hxx b/sc/source/filter/xml/XMLExportIterator.hxx index f05e487b8d19..356429037eac 100644 --- a/sc/source/filter/xml/XMLExportIterator.hxx +++ b/sc/source/filter/xml/XMLExportIterator.hxx @@ -335,9 +335,9 @@ class ScMyNotEmptyCellsIterator SCTAB nCurrentTable; void UpdateAddress( ScAddress& rAddress ); - void SetCellData( ScMyCell& rMyCell, const ScAddress& rAddress ); + void SetCellData(ScDocument& rDoc, ScMyCell& rMyCell, const ScAddress& rAddress); - void HasAnnotation( ScMyCell& aCell ); + static void HasAnnotation(ScDocument& rDoc, ScMyCell& aCell); public: explicit ScMyNotEmptyCellsIterator(ScXMLExport& rExport); ~ScMyNotEmptyCellsIterator(); @@ -359,11 +359,11 @@ public: void SetDetectiveOp(ScMyDetectiveOpContainer* pNewDetectiveOp) { pDetectiveOp = pNewDetectiveOp; } - void SetCurrentTable(const SCTAB nTable, + void SetCurrentTable(ScDocument& rDoc, const SCTAB nTable, const css::uno::Reference& rxTable); void SkipTable(SCTAB nSkip); - bool GetNext(ScMyCell& aCell, ScFormatRangeStyles* pCellStyles); + bool GetNext(ScDocument& rDoc, ScMyCell& aCell, ScFormatRangeStyles* pCellStyles); }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/xml/XMLStylesExportHelper.cxx b/sc/source/filter/xml/XMLStylesExportHelper.cxx index 57caeaf83665..9d81eb609436 100644 --- a/sc/source/filter/xml/XMLStylesExportHelper.cxx +++ b/sc/source/filter/xml/XMLStylesExportHelper.cxx @@ -146,7 +146,7 @@ void ScMyValidationsContainer::AddValidation(const uno::Any& aTempAny, } } -OUString ScMyValidationsContainer::GetCondition(ScXMLExport& rExport, const ScMyValidation& aValidation) +OUString ScMyValidationsContainer::GetCondition(ScDocument& rDoc, ScXMLExport& rExport, const ScMyValidation& aValidation) { /* ATTENTION! Should the condition to not write sheet::ValidationType_ANY * ever be changed, adapt the conditional call of @@ -252,12 +252,9 @@ OUString ScMyValidationsContainer::GetCondition(ScXMLExport& rExport, const ScMy } if (!sCondition.isEmpty()) { - if (ScDocument* pDoc = rExport.GetDocument()) - { - const formula::FormulaGrammar::Grammar eGrammar = pDoc->GetStorageGrammar(); - sal_uInt16 nNamespacePrefix = (eGrammar == formula::FormulaGrammar::GRAM_ODFF ? XML_NAMESPACE_OF : XML_NAMESPACE_OOOC); - sCondition = rExport.GetNamespaceMap().GetQNameByKey( nNamespacePrefix, sCondition, false ); - } + const formula::FormulaGrammar::Grammar eGrammar = rDoc.GetStorageGrammar(); + sal_uInt16 nNamespacePrefix = (eGrammar == formula::FormulaGrammar::GRAM_ODFF ? XML_NAMESPACE_OF : XML_NAMESPACE_OOOC); + sCondition = rExport.GetNamespaceMap().GetQNameByKey( nNamespacePrefix, sCondition, false ); } return sCondition; @@ -311,7 +308,7 @@ void ScMyValidationsContainer::WriteMessage(ScXMLExport& rExport, } } -void ScMyValidationsContainer::WriteValidations(ScXMLExport& rExport) +void ScMyValidationsContainer::WriteValidations(ScDocument& rDoc, ScXMLExport& rExport) { if (aValidationVec.empty()) return; @@ -320,7 +317,7 @@ void ScMyValidationsContainer::WriteValidations(ScXMLExport& rExport) for (const auto& rValidation : aValidationVec) { rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_NAME, rValidation.sName); - OUString sCondition(GetCondition(rExport, rValidation)); + OUString sCondition(GetCondition(rDoc, rExport, rValidation)); if (!sCondition.isEmpty()) { rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_CONDITION, sCondition); @@ -350,7 +347,7 @@ void ScMyValidationsContainer::WriteValidations(ScXMLExport& rExport) } } } - rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_BASE_CELL_ADDRESS, GetBaseCellAddress(rExport.GetDocument(), rValidation.aBaseCell)); + rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_BASE_CELL_ADDRESS, GetBaseCellAddress(&rDoc, rValidation.aBaseCell)); SvXMLElementExport aElemV(rExport, XML_NAMESPACE_TABLE, XML_CONTENT_VALIDATION, true, true); if (rValidation.bShowInputMessage || !rValidation.sInputMessage.isEmpty() || !rValidation.sInputTitle.isEmpty()) { diff --git a/sc/source/filter/xml/XMLStylesExportHelper.hxx b/sc/source/filter/xml/XMLStylesExportHelper.hxx index dbfc12be1e70..a23c6b393ac5 100644 --- a/sc/source/filter/xml/XMLStylesExportHelper.hxx +++ b/sc/source/filter/xml/XMLStylesExportHelper.hxx @@ -68,12 +68,12 @@ public: ~ScMyValidationsContainer(); void AddValidation(const css::uno::Any& aAny, sal_Int32& nValidationIndex); - static OUString GetCondition(ScXMLExport& rExport, const ScMyValidation& aValidation); + static OUString GetCondition(ScDocument& rDoc, ScXMLExport& rExport, const ScMyValidation& aValidation); static OUString GetBaseCellAddress(const ScDocument* pDoc, const ScAddress& aCell); static void WriteMessage(ScXMLExport& rExport, const OUString& sTitle, const OUString& sMessage, const bool bShowMessage, const bool bIsHelpMessage); - void WriteValidations(ScXMLExport& rExport); + void WriteValidations(ScDocument& rDoc, ScXMLExport& rExport); const OUString& GetValidationName(const sal_Int32 nIndex); }; diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index e13a3880a637..e41e3ece60c4 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -210,20 +210,17 @@ OUString lcl_RangeSequenceToString( return aResult.makeStringAndClear(); } -OUString lcl_GetFormattedString(ScDocument* pDoc, const ScRefCellValue& rCell, const ScAddress& rAddr) +OUString lcl_GetFormattedString(ScDocument& rDoc, const ScRefCellValue& rCell, const ScAddress& rAddr) { // return text/edit cell string content, with line feeds in edit cells - if (!pDoc) - return OUString(); - switch (rCell.getType()) { case CELLTYPE_STRING: { const Color* pColor; - sal_uInt32 nFormat = pDoc->GetNumberFormat(ScRange(rAddr)); - return ScCellFormat::GetString(rCell, nFormat, &pColor, nullptr, *pDoc); + sal_uInt32 nFormat = rDoc.GetNumberFormat(ScRange(rAddr)); + return ScCellFormat::GetString(rCell, nFormat, &pColor, nullptr, rDoc); } case CELLTYPE_EDIT: { @@ -231,7 +228,7 @@ OUString lcl_GetFormattedString(ScDocument* pDoc, const ScRefCellValue& rCell, c if (!pData) return OUString(); - EditEngine& rEngine = pDoc->GetEditEngine(); + EditEngine& rEngine = rDoc.GetEditEngine(); rEngine.SetText(*pData); return rEngine.GetText(); } @@ -347,7 +344,6 @@ ScXMLExport::ScXMLExport( OUString const & implementationName, SvXMLExportFlags nExportFlag) : SvXMLExport( rContext, implementationName, GetMeasureUnit(), XML_SPREADSHEET, nExportFlag ), - mpDoc(nullptr), nSourceStreamPos(0), pCurrentCell(nullptr), nOpenRow(-1), @@ -480,6 +476,11 @@ sal_Int32 ScXMLExport::GetNumberFormatStyleIndex(sal_Int32 nNumFmt) const return itr->second; } +ScDocument* ScXMLExport::GetDocument() +{ + return ScXMLConverter::GetScDocument(GetModel()); +} + void ScXMLExport::CollectSharedData(SCTAB& nTableCount, sal_Int32& nShapesCount) { if (!GetModel().is()) @@ -497,6 +498,8 @@ void ScXMLExport::CollectSharedData(SCTAB& nTableCount, sal_Int32& nShapesCount) if (!pSharedData) pSharedData.reset(new ScMySharedData(nTableCount)); + ScDocument* pDoc = GetDocument(); + for (SCTAB nTable = 0; nTable < nTableCount; ++nTable) { nCurrentTable = sal::static_int_cast(nTable); @@ -530,7 +533,8 @@ void ScXMLExport::CollectSharedData(SCTAB& nTableCount, sal_Int32& nShapesCount) if ((SdrLayerID(nLayerID) == SC_LAYER_INTERN) || (SdrLayerID(nLayerID) == SC_LAYER_HIDDEN)) { - CollectInternalShape(xShape); + if (pDoc) + CollectInternalShape(*pDoc, xShape); continue; } @@ -629,7 +633,8 @@ void ScXMLExport::CollectShapesAutoStyles(SCTAB nTableCount) void ScXMLExport::ExportMeta_() { - sal_Int32 nCellCount(mpDoc ? mpDoc->GetCellCount() : 0); + ScDocument* pDoc = GetDocument(); + sal_Int32 nCellCount(pDoc ? pDoc->GetCellCount() : 0); SCTAB nTableCount(0); sal_Int32 nShapesCount(0); GetAutoStylePool()->ClearEntries(); @@ -675,11 +680,10 @@ table::CellRangeAddress ScXMLExport::GetEndAddress(const uno::ReferenceGetLinkManager(); + sfx2::LinkManager* pManager = rDoc.GetLinkManager(); if (!pManager) return {}; @@ -702,12 +706,9 @@ ScMyAreaLinksContainer ScXMLExport::GetAreaLinks() } // core implementation -ScMyDetectiveOpContainer ScXMLExport::GetDetectiveOpList() +ScMyDetectiveOpContainer ScXMLExport::GetDetectiveOpList(ScDocument& rDoc) { - if (!mpDoc) - return {}; - - ScDetOpList* pOpList(mpDoc->GetDetOpList()); + ScDetOpList* pOpList(rDoc.GetDetOpList()); if( !pOpList ) return {}; @@ -718,7 +719,7 @@ ScMyDetectiveOpContainer ScXMLExport::GetDetectiveOpList() const ScDetOpData& rDetData = pOpList->GetObject( nIndex); const ScAddress& rDetPos = rDetData.GetPos(); SCTAB nTab = rDetPos.Tab(); - if ( nTab < mpDoc->GetTableCount() ) + if ( nTab < rDoc.GetTableCount() ) { aDetOp.push_back({ rDetPos, rDetData.GetOperation(), static_cast(nIndex) }); @@ -876,7 +877,7 @@ void ScXMLExport::ExportColumns(const sal_Int32 nTable, const ScRange& aColumnHe pGroupColumns->CloseGroups(nColumn - 1); } -void ScXMLExport::ExportExternalRefCacheStyles() +void ScXMLExport::ExportExternalRefCacheStyles(ScDocument& rDoc) { sal_Int32 nEntryIndex = GetCellStylesPropertySetMapper()->FindEntryIndex( "NumberFormat", XML_NAMESPACE_STYLE, u"data-style-name"); @@ -885,10 +886,7 @@ void ScXMLExport::ExportExternalRefCacheStyles() // No entry index for the number format is found. return; - if (!mpDoc) - return; - - ScExternalRefManager* pRefMgr = mpDoc->GetExternalRefManager(); + ScExternalRefManager* pRefMgr = rDoc.GetExternalRefManager(); if (!pRefMgr->hasExternalData()) // No external reference data cached. return; @@ -1253,19 +1251,16 @@ const SvxFieldData* toXMLPropertyStates( } -void ScXMLExport::ExportCellTextAutoStyles(sal_Int32 nTable) +void ScXMLExport::ExportCellTextAutoStyles(ScDocument& rDoc, sal_Int32 nTable) { if (!ValidTab(nTable)) return; - if (!mpDoc) - return; - rtl::Reference xMapper = GetTextParagraphExport()->GetTextPropMapper()->getPropertySetMapper(); rtl::Reference xStylePool = GetAutoStylePool(); const ScXMLEditAttributeMap& rAttrMap = GetEditAttributeMap(); - sc::EditTextIterator aIter(*mpDoc, nTable); + sc::EditTextIterator aIter(rDoc, nTable); sal_Int32 nCellCount = 0; for (const EditTextObject* pEdit = aIter.first(); pEdit; pEdit = aIter.next(), ++nCellCount) { @@ -1533,11 +1528,11 @@ void ScXMLExport::CloseRow(const sal_Int32 nRow) nOpenRow = -1; } -void ScXMLExport::ExportFormatRanges(const sal_Int32 nStartCol, const sal_Int32 nStartRow, +void ScXMLExport::ExportFormatRanges(ScDocument& rDoc, const sal_Int32 nStartCol, const sal_Int32 nStartRow, const sal_Int32 nEndCol, const sal_Int32 nEndRow, const sal_Int32 nSheet) { pRowFormatRanges->Clear(); - ScXMLCachedRowAttrAccess aRowAttr(mpDoc); + ScXMLCachedRowAttrAccess aRowAttr(&rDoc); if (nStartRow == nEndRow) { pCellStyles->GetFormatRanges(nStartCol, nEndCol, nStartRow, nSheet, pRowFormatRanges.get()); @@ -1621,7 +1616,7 @@ void ScXMLExport::ExportFormatRanges(const sal_Int32 nStartCol, const sal_Int32 } } -void ScXMLExport::GetColumnRowHeader(bool& rHasColumnHeader, ScRange& rColumnHeaderRange, +void ScXMLExport::GetColumnRowHeader(ScDocument& rDoc, bool& rHasColumnHeader, ScRange& rColumnHeaderRange, bool& rHasRowHeader, ScRange& rRowHeaderRange, OUString& rPrintRanges) const { @@ -1646,7 +1641,7 @@ void ScXMLExport::GetColumnRowHeader(bool& rHasColumnHeader, ScRange& rColumnHea rTempColumnHeaderRange.EndRow, rTempColumnHeaderRange.Sheet); uno::Sequence< table::CellRangeAddress > aRangeList( xPrintAreas->getPrintAreas() ); - ScRangeStringConverter::GetStringFromRangeList( rPrintRanges, aRangeList, mpDoc, FormulaGrammar::CONV_OOO ); + ScRangeStringConverter::GetStringFromRangeList( rPrintRanges, aRangeList, &rDoc, FormulaGrammar::CONV_OOO ); } void ScXMLExport::FillFieldGroup(ScOutlineArray* pFields, ScMyOpenCloseColumnRowGroup* pGroups) @@ -1669,12 +1664,9 @@ void ScXMLExport::FillFieldGroup(ScOutlineArray* pFields, ScMyOpenCloseColumnRow pGroups->Sort(); } -void ScXMLExport::FillColumnRowGroups() +void ScXMLExport::FillColumnRowGroups(ScDocument& rDoc) { - if (!mpDoc) - return; - - ScOutlineTable* pOutlineTable = mpDoc->GetOutlineTable( static_cast(nCurrentTable) ); + ScOutlineTable* pOutlineTable = rDoc.GetOutlineTable( static_cast(nCurrentTable) ); if(pOutlineTable) { ScOutlineArray& rCols(pOutlineTable->GetColArray()); @@ -1688,14 +1680,15 @@ void ScXMLExport::FillColumnRowGroups() void ScXMLExport::SetBodyAttributes() { - if (!(mpDoc && mpDoc->IsDocProtected())) + ScDocument* pDoc = GetDocument(); + if (!(pDoc && pDoc->IsDocProtected())) return; AddAttribute(XML_NAMESPACE_TABLE, XML_STRUCTURE_PROTECTED, XML_TRUE); OUStringBuffer aBuffer; uno::Sequence aPassHash; ScPasswordHash eHashUsed = PASSHASH_UNSPECIFIED; - const ScDocProtection* p = mpDoc->GetDocProtection(); + const ScDocProtection* p = pDoc->GetDocProtection(); if (p) { if (p->hasPasswordHash(PASSHASH_SHA1)) @@ -1888,7 +1881,16 @@ void ScXMLExport::ExportContent_() if ( !xSpreadDoc.is() ) return; - ScSheetSaveData* pSheetData = comphelper::getFromUnoTunnel(xSpreadDoc)->GetSheetSaveData(); + ScModelObj* pModel = comphelper::getFromUnoTunnel(xSpreadDoc); + + ScDocument* pDoc = pModel->GetDocument(); + if (!pDoc) + { + SAL_WARN("sc", "no ScDocument!"); + return; + } + + ScSheetSaveData* pSheetData = pModel->GetSheetSaveData(); if (pSheetData) pSheetData->ResetSaveEntries(); @@ -1897,11 +1899,11 @@ void ScXMLExport::ExportContent_() { //_GetNamespaceMap().ClearQNamesCache(); pChangeTrackingExportHelper->CollectAndWriteChanges(); - WriteCalculationSettings(xSpreadDoc); + WriteCalculationSettings(*pDoc, xSpreadDoc); sal_Int32 nTableCount(xIndex->getCount()); - ScMyAreaLinksContainer aAreaLinks = GetAreaLinks(); + ScMyAreaLinksContainer aAreaLinks = GetAreaLinks(*pDoc); ScMyEmptyDatabaseRangesContainer aEmptyRanges(aExportDatabaseRanges.GetEmptyDatabaseRanges()); - ScMyDetectiveOpContainer aDetectiveOpContainer = GetDetectiveOpList(); + ScMyDetectiveOpContainer aDetectiveOpContainer = GetDetectiveOpList(*pDoc); pMergedRangesContainer->Sort(); pSharedData->GetDetectiveObjContainer()->Sort(); @@ -1916,13 +1918,13 @@ void ScXMLExport::ExportContent_() mpCellsItr->SetDetectiveOp( &aDetectiveOpContainer ); if (nTableCount > 0) - pValidationsContainer->WriteValidations(*this); - WriteTheLabelRanges( xSpreadDoc ); + pValidationsContainer->WriteValidations(*pDoc, *this); + WriteTheLabelRanges(*pDoc, xSpreadDoc); for (sal_Int32 nTable = 0; nTable < nTableCount; ++nTable) { sal_Int64 nStartOffset = -1; sal_Int64 nEndOffset = -1; - if (pSheetData && mpDoc && mpDoc->IsStreamValid(static_cast(nTable)) && !mpDoc->GetChangeTrack()) + if (pSheetData && pDoc->IsStreamValid(static_cast(nTable)) && !pDoc->GetChangeTrack()) pSheetData->GetStreamPos( nTable, nStartOffset, nEndOffset ); if ( nStartOffset >= 0 && nEndOffset >= 0 && xSourceStream.is() ) @@ -1940,20 +1942,20 @@ void ScXMLExport::ExportContent_() else { uno::Reference xTable(xIndex->getByIndex(nTable), uno::UNO_QUERY); - WriteTable(nTable, xTable); + WriteTable(*pDoc, nTable, xTable); } IncrementProgressBar(false); } } - WriteExternalRefCaches(); - WriteNamedExpressions(); - WriteDataStream(); - aExportDatabaseRanges.WriteDatabaseRanges(); - WriteExternalDataMapping(); + WriteExternalRefCaches(*pDoc); + WriteNamedExpressions(*pDoc); + WriteDataStream(*pDoc); + aExportDatabaseRanges.WriteDatabaseRanges(*pDoc); + WriteExternalDataMapping(*pDoc); ScXMLExportDataPilot aExportDataPilot(*this); - aExportDataPilot.WriteDataPilots(); - WriteConsolidation(); - ScXMLExportDDELinks aExportDDELinks(*this); + aExportDataPilot.WriteDataPilots(*pDoc); + WriteConsolidation(*pDoc); + ScXMLExportDDELinks aExportDDELinks(*pDoc, *this); aExportDDELinks.WriteDDELinks(xSpreadDoc); IncrementProgressBar(true, 0); GetProgressBarHelper()->SetValue(GetProgressBarHelper()->GetReference()); @@ -1999,7 +2001,11 @@ void ScXMLExport::exportTheme() if ((getSaneDefaultVersion() & SvtSaveOptions::ODFSVER_EXTENDED) == 0) return; - SdrModel* pModel = mpDoc ? mpDoc->GetDrawLayer() : nullptr; + ScDocument* pDoc = GetDocument(); + if (!pDoc) + return; + + SdrModel* pModel = pDoc->GetDrawLayer(); if (!pModel) return; @@ -2265,242 +2271,247 @@ void ScXMLExport::collectAutoStyles() // Reserve the loaded cell style names. RegisterDefinedStyleNames( xSpreadDoc); - // re-create automatic styles with old names from stored data - ScSheetSaveData* pSheetData = comphelper::getFromUnoTunnel(xSpreadDoc)->GetSheetSaveData(); - if (pSheetData && mpDoc) + ScModelObj* pModel = comphelper::getFromUnoTunnel(xSpreadDoc); + ScDocument* pDoc = pModel->GetDocument(); + if (pDoc) { - // formulas have to be calculated now, to detect changed results - // (during normal save, they will be calculated anyway) - SCTAB nTabCount = mpDoc->GetTableCount(); - for (SCTAB nTab=0; nTabIsStreamValid(nTab)) - mpDoc->InterpretDirtyCells(ScRange(0, 0, nTab, mpDoc->MaxCol(), mpDoc->MaxRow(), nTab)); - - // stored cell styles - const std::vector& rCellEntries = pSheetData->GetCellStyles(); - for (const auto& rCellEntry : rCellEntries) + // re-create automatic styles with old names from stored data + ScSheetSaveData* pSheetData = pModel->GetSheetSaveData(); + if (pSheetData) { - ScAddress aPos = rCellEntry.maCellPos; - sal_Int32 nTable = aPos.Tab(); - bool bCopySheet = mpDoc->IsStreamValid( static_cast(nTable) ); - if (bCopySheet) + // formulas have to be calculated now, to detect changed results + // (during normal save, they will be calculated anyway) + SCTAB nTabCount = pDoc->GetTableCount(); + for (SCTAB nTab=0; nTabIsStreamValid(nTab)) + pDoc->InterpretDirtyCells(ScRange(0, 0, nTab, pDoc->MaxCol(), pDoc->MaxRow(), nTab)); + + // stored cell styles + const std::vector& rCellEntries = pSheetData->GetCellStyles(); + for (const auto& rCellEntry : rCellEntries) { - uno::Reference xTable(xIndex->getByIndex(nTable), uno::UNO_QUERY); - uno::Reference xProperties( - xTable->getCellByPosition( aPos.Col(), aPos.Row() ), uno::UNO_QUERY ); - - AddStyleFromCells(xProperties, xTable, nTable, &rCellEntry.maName); - } - } - - // stored column styles - const std::vector& rColumnEntries = pSheetData->GetColumnStyles(); - for (const auto& rColumnEntry : rColumnEntries) - { - ScAddress aPos = rColumnEntry.maCellPos; - sal_Int32 nTable = aPos.Tab(); - bool bCopySheet = mpDoc->IsStreamValid( static_cast(nTable) ); - if (bCopySheet) - { - uno::Reference xColumnRowRange(xIndex->getByIndex(nTable), uno::UNO_QUERY); - uno::Reference xTableColumns(xColumnRowRange->getColumns()); - uno::Reference xColumnProperties(xTableColumns->getByIndex( aPos.Col() ), uno::UNO_QUERY); - - sal_Int32 nIndex(-1); - bool bIsVisible(true); - AddStyleFromColumn( xColumnProperties, &rColumnEntry.maName, nIndex, bIsVisible ); - } - } - - // stored row styles - const std::vector& rRowEntries = pSheetData->GetRowStyles(); - for (const auto& rRowEntry : rRowEntries) - { - ScAddress aPos = rRowEntry.maCellPos; - sal_Int32 nTable = aPos.Tab(); - bool bCopySheet = mpDoc->IsStreamValid( static_cast(nTable) ); - if (bCopySheet) - { - uno::Reference xColumnRowRange(xIndex->getByIndex(nTable), uno::UNO_QUERY); - uno::Reference xTableRows(xColumnRowRange->getRows()); - uno::Reference xRowProperties(xTableRows->getByIndex( aPos.Row() ), uno::UNO_QUERY); - - sal_Int32 nIndex(-1); - AddStyleFromRow( xRowProperties, &rRowEntry.maName, nIndex ); - } - } - - // stored table styles - const std::vector& rTableEntries = pSheetData->GetTableStyles(); - for (const auto& rTableEntry : rTableEntries) - { - ScAddress aPos = rTableEntry.maCellPos; - sal_Int32 nTable = aPos.Tab(); - bool bCopySheet = mpDoc->IsStreamValid( static_cast(nTable) ); - if (bCopySheet) - { - //! separate method AddStyleFromTable needed? - uno::Reference xTableProperties(xIndex->getByIndex(nTable), uno::UNO_QUERY); - if (xTableProperties.is()) + ScAddress aPos = rCellEntry.maCellPos; + sal_Int32 nTable = aPos.Tab(); + bool bCopySheet = pDoc->IsStreamValid( static_cast(nTable) ); + if (bCopySheet) { - std::vector aPropStates(xTableStylesExportPropertySetMapper->Filter(*this, xTableProperties)); - OUString sName( rTableEntry.maName ); - GetAutoStylePool()->AddNamed(sName, XmlStyleFamily::TABLE_TABLE, OUString(), std::move(aPropStates)); - GetAutoStylePool()->RegisterName(XmlStyleFamily::TABLE_TABLE, sName); + uno::Reference xTable(xIndex->getByIndex(nTable), uno::UNO_QUERY); + uno::Reference xProperties( + xTable->getCellByPosition( aPos.Col(), aPos.Row() ), uno::UNO_QUERY ); + + AddStyleFromCells(xProperties, xTable, nTable, &rCellEntry.maName); } } - } - // stored styles for notes - - rtl::Reference xShapeMapper = XMLShapeExport::CreateShapePropMapper( *this ); - - const std::vector& rNoteEntries = pSheetData->GetNoteStyles(); - for (const auto& rNoteEntry : rNoteEntries) - { - ScAddress aPos = rNoteEntry.maCellPos; - SCTAB nTable = aPos.Tab(); - bool bCopySheet = mpDoc->IsStreamValid( nTable ); - if (bCopySheet) + // stored column styles + const std::vector& rColumnEntries = pSheetData->GetColumnStyles(); + for (const auto& rColumnEntry : rColumnEntries) { - //! separate method AddStyleFromNote needed? - - ScPostIt* pNote = mpDoc->GetNote(aPos); - OSL_ENSURE( pNote, "note not found" ); - if (pNote) + ScAddress aPos = rColumnEntry.maCellPos; + sal_Int32 nTable = aPos.Tab(); + bool bCopySheet = pDoc->IsStreamValid( static_cast(nTable) ); + if (bCopySheet) { - SdrCaptionObj* pDrawObj = pNote->GetOrCreateCaption( aPos ); - // all uno shapes are created anyway in CollectSharedData - uno::Reference xShapeProperties( pDrawObj->getUnoShape(), uno::UNO_QUERY ); - if (xShapeProperties.is()) + uno::Reference xColumnRowRange(xIndex->getByIndex(nTable), uno::UNO_QUERY); + uno::Reference xTableColumns(xColumnRowRange->getColumns()); + uno::Reference xColumnProperties(xTableColumns->getByIndex( aPos.Col() ), uno::UNO_QUERY); + + sal_Int32 nIndex(-1); + bool bIsVisible(true); + AddStyleFromColumn( xColumnProperties, &rColumnEntry.maName, nIndex, bIsVisible ); + } + } + + // stored row styles + const std::vector& rRowEntries = pSheetData->GetRowStyles(); + for (const auto& rRowEntry : rRowEntries) + { + ScAddress aPos = rRowEntry.maCellPos; + sal_Int32 nTable = aPos.Tab(); + bool bCopySheet = pDoc->IsStreamValid( static_cast(nTable) ); + if (bCopySheet) + { + uno::Reference xColumnRowRange(xIndex->getByIndex(nTable), uno::UNO_QUERY); + uno::Reference xTableRows(xColumnRowRange->getRows()); + uno::Reference xRowProperties(xTableRows->getByIndex( aPos.Row() ), uno::UNO_QUERY); + + sal_Int32 nIndex(-1); + AddStyleFromRow( xRowProperties, &rRowEntry.maName, nIndex ); + } + } + + // stored table styles + const std::vector& rTableEntries = pSheetData->GetTableStyles(); + for (const auto& rTableEntry : rTableEntries) + { + ScAddress aPos = rTableEntry.maCellPos; + sal_Int32 nTable = aPos.Tab(); + bool bCopySheet = pDoc->IsStreamValid( static_cast(nTable) ); + if (bCopySheet) + { + //! separate method AddStyleFromTable needed? + uno::Reference xTableProperties(xIndex->getByIndex(nTable), uno::UNO_QUERY); + if (xTableProperties.is()) { - if ( !rNoteEntry.maStyleName.isEmpty() ) + std::vector aPropStates(xTableStylesExportPropertySetMapper->Filter(*this, xTableProperties)); + OUString sName( rTableEntry.maName ); + GetAutoStylePool()->AddNamed(sName, XmlStyleFamily::TABLE_TABLE, OUString(), std::move(aPropStates)); + GetAutoStylePool()->RegisterName(XmlStyleFamily::TABLE_TABLE, sName); + } + } + } + + // stored styles for notes + + rtl::Reference xShapeMapper = XMLShapeExport::CreateShapePropMapper( *this ); + + const std::vector& rNoteEntries = pSheetData->GetNoteStyles(); + for (const auto& rNoteEntry : rNoteEntries) + { + ScAddress aPos = rNoteEntry.maCellPos; + SCTAB nTable = aPos.Tab(); + bool bCopySheet = pDoc->IsStreamValid( nTable ); + if (bCopySheet) + { + //! separate method AddStyleFromNote needed? + + ScPostIt* pNote = pDoc->GetNote(aPos); + OSL_ENSURE( pNote, "note not found" ); + if (pNote) + { + SdrCaptionObj* pDrawObj = pNote->GetOrCreateCaption( aPos ); + // all uno shapes are created anyway in CollectSharedData + uno::Reference xShapeProperties( pDrawObj->getUnoShape(), uno::UNO_QUERY ); + if (xShapeProperties.is()) { - std::vector aPropStates(xShapeMapper->Filter(*this, xShapeProperties)); - OUString sName( rNoteEntry.maStyleName ); - GetAutoStylePool()->AddNamed(sName, XmlStyleFamily::SD_GRAPHICS_ID, OUString(), std::move(aPropStates)); - GetAutoStylePool()->RegisterName(XmlStyleFamily::SD_GRAPHICS_ID, sName); + if ( !rNoteEntry.maStyleName.isEmpty() ) + { + std::vector aPropStates(xShapeMapper->Filter(*this, xShapeProperties)); + OUString sName( rNoteEntry.maStyleName ); + GetAutoStylePool()->AddNamed(sName, XmlStyleFamily::SD_GRAPHICS_ID, OUString(), std::move(aPropStates)); + GetAutoStylePool()->RegisterName(XmlStyleFamily::SD_GRAPHICS_ID, sName); + } + if ( !rNoteEntry.maTextStyle.isEmpty() ) + { + std::vector aPropStates( + GetTextParagraphExport()->GetParagraphPropertyMapper()->Filter(*this, xShapeProperties)); + OUString sName( rNoteEntry.maTextStyle ); + GetAutoStylePool()->AddNamed(sName, XmlStyleFamily::TEXT_PARAGRAPH, OUString(), std::move(aPropStates)); + GetAutoStylePool()->RegisterName(XmlStyleFamily::TEXT_PARAGRAPH, sName); + } } - if ( !rNoteEntry.maTextStyle.isEmpty() ) + } + } + } + + // note paragraph styles + + rtl::Reference xParaPropMapper = GetTextParagraphExport()->GetParagraphPropertyMapper(); + + const std::vector& rNoteParaEntries = pSheetData->GetNoteParaStyles(); + for (const auto& rNoteParaEntry : rNoteParaEntries) + { + ScAddress aPos = rNoteParaEntry.maCellPos; + SCTAB nTable = aPos.Tab(); + bool bCopySheet = pDoc->IsStreamValid( nTable ); + if (bCopySheet) + { + ScPostIt* pNote = pDoc->GetNote( aPos ); + OSL_ENSURE( pNote, "note not found" ); + if (pNote) + { + SdrCaptionObj* pDrawObj = pNote->GetOrCreateCaption( aPos ); + uno::Reference xCellText(pDrawObj->getUnoShape(), uno::UNO_QUERY); + uno::Reference xParaProp( + lcl_GetEnumerated( xCellText, rNoteParaEntry.maSelection.start.nPara ), uno::UNO_QUERY ); + if ( xParaProp.is() ) { - std::vector aPropStates( - GetTextParagraphExport()->GetParagraphPropertyMapper()->Filter(*this, xShapeProperties)); - OUString sName( rNoteEntry.maTextStyle ); + std::vector aPropStates(xParaPropMapper->Filter(*this, xParaProp)); + OUString sName( rNoteParaEntry.maName ); GetAutoStylePool()->AddNamed(sName, XmlStyleFamily::TEXT_PARAGRAPH, OUString(), std::move(aPropStates)); GetAutoStylePool()->RegisterName(XmlStyleFamily::TEXT_PARAGRAPH, sName); } } } } - } - // note paragraph styles + // note text styles - rtl::Reference xParaPropMapper = GetTextParagraphExport()->GetParagraphPropertyMapper(); + rtl::Reference xTextPropMapper = XMLTextParagraphExport::CreateCharExtPropMapper( *this ); - const std::vector& rNoteParaEntries = pSheetData->GetNoteParaStyles(); - for (const auto& rNoteParaEntry : rNoteParaEntries) - { - ScAddress aPos = rNoteParaEntry.maCellPos; - SCTAB nTable = aPos.Tab(); - bool bCopySheet = mpDoc->IsStreamValid( nTable ); - if (bCopySheet) + const std::vector& rNoteTextEntries = pSheetData->GetNoteTextStyles(); + for (const auto& rNoteTextEntry : rNoteTextEntries) { - ScPostIt* pNote = mpDoc->GetNote( aPos ); - OSL_ENSURE( pNote, "note not found" ); - if (pNote) + ScAddress aPos = rNoteTextEntry.maCellPos; + SCTAB nTable = aPos.Tab(); + bool bCopySheet = pDoc->IsStreamValid( nTable ); + if (bCopySheet) { - SdrCaptionObj* pDrawObj = pNote->GetOrCreateCaption( aPos ); - uno::Reference xCellText(pDrawObj->getUnoShape(), uno::UNO_QUERY); - uno::Reference xParaProp( - lcl_GetEnumerated( xCellText, rNoteParaEntry.maSelection.start.nPara ), uno::UNO_QUERY ); - if ( xParaProp.is() ) + ScPostIt* pNote = pDoc->GetNote( aPos ); + OSL_ENSURE( pNote, "note not found" ); + if (pNote) { - std::vector aPropStates(xParaPropMapper->Filter(*this, xParaProp)); - OUString sName( rNoteParaEntry.maName ); - GetAutoStylePool()->AddNamed(sName, XmlStyleFamily::TEXT_PARAGRAPH, OUString(), std::move(aPropStates)); - GetAutoStylePool()->RegisterName(XmlStyleFamily::TEXT_PARAGRAPH, sName); + SdrCaptionObj* pDrawObj = pNote->GetOrCreateCaption( aPos ); + uno::Reference xCellText(pDrawObj->getUnoShape(), uno::UNO_QUERY); + uno::Reference xCursorProp(xCellText->createTextCursor(), uno::UNO_QUERY); + ScDrawTextCursor* pCursor = comphelper::getFromUnoTunnel( xCursorProp ); + if (pCursor) + { + pCursor->SetSelection( rNoteTextEntry.maSelection ); + + std::vector aPropStates(xTextPropMapper->Filter(*this, xCursorProp)); + OUString sName( rNoteTextEntry.maName ); + GetAutoStylePool()->AddNamed(sName, XmlStyleFamily::TEXT_TEXT, OUString(), std::move(aPropStates)); + GetAutoStylePool()->RegisterName(XmlStyleFamily::TEXT_TEXT, sName); + } } } } - } - // note text styles + // stored text styles - rtl::Reference xTextPropMapper = XMLTextParagraphExport::CreateCharExtPropMapper( *this ); - - const std::vector& rNoteTextEntries = pSheetData->GetNoteTextStyles(); - for (const auto& rNoteTextEntry : rNoteTextEntries) - { - ScAddress aPos = rNoteTextEntry.maCellPos; - SCTAB nTable = aPos.Tab(); - bool bCopySheet = mpDoc->IsStreamValid( nTable ); - if (bCopySheet) + // Calling createTextCursor fires up editeng, which is very slow, and often subsequent style entries + // refer to the same cell, so cache it. + ScAddress aPrevPos; + uno::Reference xPrevCursorProp; + const std::vector& rTextEntries = pSheetData->GetTextStyles(); + for (const auto& rTextEntry : rTextEntries) { - ScPostIt* pNote = mpDoc->GetNote( aPos ); - OSL_ENSURE( pNote, "note not found" ); - if (pNote) + ScAddress aPos = rTextEntry.maCellPos; + sal_Int32 nTable = aPos.Tab(); + bool bCopySheet = pDoc->IsStreamValid( static_cast(nTable) ); + if (!bCopySheet) + continue; + + //! separate method AddStyleFromText needed? + //! cache sheet object + + uno::Reference xCursorProp; + if (xPrevCursorProp && aPrevPos == aPos) + xCursorProp = xPrevCursorProp; + else { - SdrCaptionObj* pDrawObj = pNote->GetOrCreateCaption( aPos ); - uno::Reference xCellText(pDrawObj->getUnoShape(), uno::UNO_QUERY); - uno::Reference xCursorProp(xCellText->createTextCursor(), uno::UNO_QUERY); - ScDrawTextCursor* pCursor = comphelper::getFromUnoTunnel( xCursorProp ); - if (pCursor) - { - pCursor->SetSelection( rNoteTextEntry.maSelection ); - - std::vector aPropStates(xTextPropMapper->Filter(*this, xCursorProp)); - OUString sName( rNoteTextEntry.maName ); - GetAutoStylePool()->AddNamed(sName, XmlStyleFamily::TEXT_TEXT, OUString(), std::move(aPropStates)); - GetAutoStylePool()->RegisterName(XmlStyleFamily::TEXT_TEXT, sName); - } + uno::Reference xCellRange(xIndex->getByIndex(nTable), uno::UNO_QUERY); + uno::Reference xCellText(xCellRange->getCellByPosition(aPos.Col(), aPos.Row()), uno::UNO_QUERY); + xCursorProp.set(xCellText->createTextCursor(), uno::UNO_QUERY); } + ScCellTextCursor* pCursor = comphelper::getFromUnoTunnel( xCursorProp ); + if (!pCursor) + continue; + pCursor->SetSelection( rTextEntry.maSelection ); + + std::vector aPropStates(xTextPropMapper->Filter(*this, xCursorProp)); + OUString sName( rTextEntry.maName ); + GetAutoStylePool()->AddNamed(sName, XmlStyleFamily::TEXT_TEXT, OUString(), std::move(aPropStates)); + GetAutoStylePool()->RegisterName(XmlStyleFamily::TEXT_TEXT, sName); + xPrevCursorProp = std::move(xCursorProp); + aPrevPos = aPos; } } - // stored text styles - - // Calling createTextCursor fires up editeng, which is very slow, and often subsequent style entries - // refer to the same cell, so cache it. - ScAddress aPrevPos; - uno::Reference xPrevCursorProp; - const std::vector& rTextEntries = pSheetData->GetTextStyles(); - for (const auto& rTextEntry : rTextEntries) - { - ScAddress aPos = rTextEntry.maCellPos; - sal_Int32 nTable = aPos.Tab(); - bool bCopySheet = mpDoc->IsStreamValid( static_cast(nTable) ); - if (!bCopySheet) - continue; - - //! separate method AddStyleFromText needed? - //! cache sheet object - - uno::Reference xCursorProp; - if (xPrevCursorProp && aPrevPos == aPos) - xCursorProp = xPrevCursorProp; - else - { - uno::Reference xCellRange(xIndex->getByIndex(nTable), uno::UNO_QUERY); - uno::Reference xCellText(xCellRange->getCellByPosition(aPos.Col(), aPos.Row()), uno::UNO_QUERY); - xCursorProp.set(xCellText->createTextCursor(), uno::UNO_QUERY); - } - ScCellTextCursor* pCursor = comphelper::getFromUnoTunnel( xCursorProp ); - if (!pCursor) - continue; - pCursor->SetSelection( rTextEntry.maSelection ); - - std::vector aPropStates(xTextPropMapper->Filter(*this, xCursorProp)); - OUString sName( rTextEntry.maName ); - GetAutoStylePool()->AddNamed(sName, XmlStyleFamily::TEXT_TEXT, OUString(), std::move(aPropStates)); - GetAutoStylePool()->RegisterName(XmlStyleFamily::TEXT_TEXT, sName); - xPrevCursorProp = std::move(xCursorProp); - aPrevPos = aPos; - } + ExportExternalRefCacheStyles(*pDoc); } - ExportExternalRefCacheStyles(); - if (!pSharedData) { SCTAB nTableCount(0); @@ -2552,72 +2563,75 @@ void ScXMLExport::collectAutoStyles() } } } - uno::Reference xColumnRowRange (xTable, uno::UNO_QUERY); - if (xColumnRowRange.is() && mpDoc) + if (pDoc) { - mpDoc->SyncColRowFlags(); - uno::Reference xTableColumns(xColumnRowRange->getColumns()); - if (xTableColumns.is()) + uno::Reference xColumnRowRange (xTable, uno::UNO_QUERY); + if (xColumnRowRange.is()) { - sal_Int32 nColumns(mpDoc->GetLastChangedColFlagsWidth(sal::static_int_cast(nTable))); - pSharedData->SetLastColumn(nTable, nColumns); - table::CellRangeAddress aCellAddress(GetEndAddress(xTable)); - if (aCellAddress.EndColumn > nColumns) + pDoc->SyncColRowFlags(); + uno::Reference xTableColumns(xColumnRowRange->getColumns()); + if (xTableColumns.is()) { - ++nColumns; - pColumnStyles->AddNewTable(nTable, aCellAddress.EndColumn); - } - else - pColumnStyles->AddNewTable(nTable, nColumns); - sal_Int32 nColumn = 0; - while (nColumn <= mpDoc->MaxCol()) - { - sal_Int32 nIndex(-1); - bool bIsVisible(true); - uno::Reference xColumnProperties(xTableColumns->getByIndex(nColumn), uno::UNO_QUERY); - if (xColumnProperties.is()) + sal_Int32 nColumns(pDoc->GetLastChangedColFlagsWidth(sal::static_int_cast(nTable))); + pSharedData->SetLastColumn(nTable, nColumns); + table::CellRangeAddress aCellAddress(GetEndAddress(xTable)); + if (aCellAddress.EndColumn > nColumns) { - AddStyleFromColumn( xColumnProperties, nullptr, nIndex, bIsVisible ); - pColumnStyles->AddFieldStyleName(nTable, nColumn, nIndex, bIsVisible); + ++nColumns; + pColumnStyles->AddNewTable(nTable, aCellAddress.EndColumn); + } + else + pColumnStyles->AddNewTable(nTable, nColumns); + sal_Int32 nColumn = 0; + while (nColumn <= pDoc->MaxCol()) + { + sal_Int32 nIndex(-1); + bool bIsVisible(true); + uno::Reference xColumnProperties(xTableColumns->getByIndex(nColumn), uno::UNO_QUERY); + if (xColumnProperties.is()) + { + AddStyleFromColumn( xColumnProperties, nullptr, nIndex, bIsVisible ); + pColumnStyles->AddFieldStyleName(nTable, nColumn, nIndex, bIsVisible); + } + sal_Int32 nOld(nColumn); + nColumn = pDoc->GetNextDifferentChangedColFlagsWidth(sal::static_int_cast(nTable), static_cast(nColumn)); + for (sal_Int32 i = nOld + 1; i < nColumn; ++i) + pColumnStyles->AddFieldStyleName(nTable, i, nIndex, bIsVisible); + } + if (aCellAddress.EndColumn > nColumns) + { + bool bIsVisible(true); + sal_Int32 nIndex(pColumnStyles->GetStyleNameIndex(nTable, nColumns, bIsVisible)); + for (sal_Int32 i = nColumns + 1; i <= aCellAddress.EndColumn; ++i) + pColumnStyles->AddFieldStyleName(nTable, i, nIndex, bIsVisible); } - sal_Int32 nOld(nColumn); - nColumn = mpDoc->GetNextDifferentChangedColFlagsWidth(sal::static_int_cast(nTable), static_cast(nColumn)); - for (sal_Int32 i = nOld + 1; i < nColumn; ++i) - pColumnStyles->AddFieldStyleName(nTable, i, nIndex, bIsVisible); } - if (aCellAddress.EndColumn > nColumns) + uno::Reference xTableRows(xColumnRowRange->getRows()); + if (xTableRows.is()) { - bool bIsVisible(true); - sal_Int32 nIndex(pColumnStyles->GetStyleNameIndex(nTable, nColumns, bIsVisible)); - for (sal_Int32 i = nColumns + 1; i <= aCellAddress.EndColumn; ++i) - pColumnStyles->AddFieldStyleName(nTable, i, nIndex, bIsVisible); - } - } - uno::Reference xTableRows(xColumnRowRange->getRows()); - if (xTableRows.is()) - { - sal_Int32 nRows(mpDoc->GetLastChangedRowFlagsWidth(sal::static_int_cast(nTable))); - pSharedData->SetLastRow(nTable, nRows); + sal_Int32 nRows(pDoc->GetLastChangedRowFlagsWidth(sal::static_int_cast(nTable))); + pSharedData->SetLastRow(nTable, nRows); - pRowStyles->AddNewTable(nTable, mpDoc->MaxRow()); - sal_Int32 nRow = 0; - while (nRow <= mpDoc->MaxRow()) - { - sal_Int32 nIndex = 0; - uno::Reference xRowProperties(xTableRows->getByIndex(nRow), uno::UNO_QUERY); - if(xRowProperties.is()) + pRowStyles->AddNewTable(nTable, pDoc->MaxRow()); + sal_Int32 nRow = 0; + while (nRow <= pDoc->MaxRow()) { - AddStyleFromRow( xRowProperties, nullptr, nIndex ); - pRowStyles->AddFieldStyleName(nTable, nRow, nIndex); + sal_Int32 nIndex = 0; + uno::Reference xRowProperties(xTableRows->getByIndex(nRow), uno::UNO_QUERY); + if(xRowProperties.is()) + { + AddStyleFromRow( xRowProperties, nullptr, nIndex ); + pRowStyles->AddFieldStyleName(nTable, nRow, nIndex); + } + sal_Int32 nOld(nRow); + nRow = pDoc->GetNextDifferentChangedRowFlagsWidth(sal::static_int_cast(nTable), static_cast(nRow)); + if (nRow > nOld + 1) + pRowStyles->AddFieldStyleName(nTable, nOld + 1, nIndex, nRow - 1); } - sal_Int32 nOld(nRow); - nRow = mpDoc->GetNextDifferentChangedRowFlagsWidth(sal::static_int_cast(nTable), static_cast(nRow)); - if (nRow > nOld + 1) - pRowStyles->AddFieldStyleName(nTable, nOld + 1, nIndex, nRow - 1); } } + ExportCellTextAutoStyles(*pDoc, nTable); } - ExportCellTextAutoStyles(nTable); } pChangeTrackingExportHelper->CollectAutoStyles(); @@ -2656,9 +2670,9 @@ void ScXMLExport::ExportAutoStyles_() GetShapeExport()->exportAutoStyles(); GetFormExport()->exportAutoStyles( ); - if (mpDoc) + if (ScDocument* pDoc = GetDocument()) { - ScExternalRefManager* pRefMgr = mpDoc->GetExternalRefManager(); + ScExternalRefManager* pRefMgr = pDoc->GetExternalRefManager(); // #i100879# write the table style for cached tables only if there are cached tables // (same logic as in ExportExternalRefCacheStyles) if (pRefMgr->hasExternalData()) @@ -2691,20 +2705,17 @@ void ScXMLExport::ExportMasterStyles_() GetPageExport()->exportMasterStyles( false ); } -void ScXMLExport::CollectInternalShape( uno::Reference< drawing::XShape > const & xShape ) +void ScXMLExport::CollectInternalShape(ScDocument& rDoc, uno::Reference< drawing::XShape > const & xShape ) { // detective objects and notes SdrObject* pObject = SdrObject::getSdrObjectFromXShape( xShape ); if( !pObject ) return; - if (!mpDoc) - return; - // collect note caption objects from all layers (internal or hidden) if( ScDrawObjData* pCaptData = ScDrawLayer::GetNoteCaptionData( pObject, static_cast< SCTAB >( nCurrentTable ) ) ) { - if(mpDoc->GetNote(pCaptData->maStart)) + if (rDoc.GetNote(pCaptData->maStart)) { pSharedData->AddNoteObj( xShape, pCaptData->maStart ); @@ -2718,7 +2729,7 @@ void ScXMLExport::CollectInternalShape( uno::Reference< drawing::XShape > const // other objects from internal layer only (detective) else if( pObject->GetLayer() == SC_LAYER_INTERN ) { - ScDetectiveFunc aDetFunc( *mpDoc, static_cast(nCurrentTable) ); + ScDetectiveFunc aDetFunc(rDoc, static_cast(nCurrentTable)); ScAddress aPosition; ScRange aSourceRange; bool bRedLine; @@ -2790,14 +2801,15 @@ bool ScXMLExport::GetMerged (const table::CellRangeAddress* pCellAddress, return !bReady; } -bool ScXMLExport::IsMatrix (const ScAddress& aCell, - ScRange& aCellAddress, bool& bIsFirst) const +//static +bool ScXMLExport::IsMatrix (ScDocument& rDoc, const ScAddress& aCell, + ScRange& aCellAddress, bool& bIsFirst) { bIsFirst = false; ScRange aMatrixRange; - if (mpDoc && mpDoc->GetMatrixFormulaRange(aCell, aMatrixRange)) + if (rDoc.GetMatrixFormulaRange(aCell, aMatrixRange)) { aCellAddress = aMatrixRange; if ((aCellAddress.aStart.Col() == aCell.Col() && aCellAddress.aStart.Row() == aCell.Row()) && @@ -2819,7 +2831,7 @@ bool ScXMLExport::IsMatrix (const ScAddress& aCell, return false; } -void ScXMLExport::WriteTable(sal_Int32 nTable, const uno::Reference& xTable) +void ScXMLExport::WriteTable(ScDocument& rDoc, sal_Int32 nTable, const uno::Reference& xTable) { if (!xTable.is()) return; @@ -2839,55 +2851,52 @@ void ScXMLExport::WriteTable(sal_Int32 nTable, const uno::ReferenceisProtected()) { AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTED, XML_TRUE); - if (mpDoc) + pProtect = rDoc.GetTabProtection(nTable); + if (pProtect) { - pProtect = mpDoc->GetTabProtection(nTable); - if (pProtect) + OUStringBuffer aBuffer; + ScPasswordHash eHashUsed = PASSHASH_UNSPECIFIED; + if (pProtect->hasPasswordHash(PASSHASH_SHA1)) { - OUStringBuffer aBuffer; - ScPasswordHash eHashUsed = PASSHASH_UNSPECIFIED; - if (pProtect->hasPasswordHash(PASSHASH_SHA1)) + ::comphelper::Base64::encode(aBuffer, + pProtect->getPasswordHash(PASSHASH_SHA1)); + eHashUsed = PASSHASH_SHA1; + } + else if (pProtect->hasPasswordHash(PASSHASH_SHA256)) + { + ::comphelper::Base64::encode(aBuffer, + pProtect->getPasswordHash(PASSHASH_SHA256)); + eHashUsed = PASSHASH_SHA256; + } + else if (pProtect->hasPasswordHash(PASSHASH_XL, PASSHASH_SHA1)) + { + // Double-hash this by SHA1 on top of the legacy xls hash. + uno::Sequence aHash = pProtect->getPasswordHash(PASSHASH_XL, PASSHASH_SHA1); + ::comphelper::Base64::encode(aBuffer, aHash); + eHashUsed = PASSHASH_XL; + } + if (!aBuffer.isEmpty()) + { + AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTION_KEY, aBuffer.makeStringAndClear()); + if (getSaneDefaultVersion() >= SvtSaveOptions::ODFSVER_012) { - ::comphelper::Base64::encode(aBuffer, - pProtect->getPasswordHash(PASSHASH_SHA1)); - eHashUsed = PASSHASH_SHA1; - } - else if (pProtect->hasPasswordHash(PASSHASH_SHA256)) - { - ::comphelper::Base64::encode(aBuffer, - pProtect->getPasswordHash(PASSHASH_SHA256)); - eHashUsed = PASSHASH_SHA256; - } - else if (pProtect->hasPasswordHash(PASSHASH_XL, PASSHASH_SHA1)) - { - // Double-hash this by SHA1 on top of the legacy xls hash. - uno::Sequence aHash = pProtect->getPasswordHash(PASSHASH_XL, PASSHASH_SHA1); - ::comphelper::Base64::encode(aBuffer, aHash); - eHashUsed = PASSHASH_XL; - } - if (!aBuffer.isEmpty()) - { - AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTION_KEY, aBuffer.makeStringAndClear()); - if (getSaneDefaultVersion() >= SvtSaveOptions::ODFSVER_012) + if (eHashUsed == PASSHASH_XL) { - if (eHashUsed == PASSHASH_XL) - { - AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTION_KEY_DIGEST_ALGORITHM, - ScPassHashHelper::getHashURI(PASSHASH_XL)); - if (getSaneDefaultVersion() & SvtSaveOptions::ODFSVER_EXTENDED) - AddAttribute(XML_NAMESPACE_LO_EXT, XML_PROTECTION_KEY_DIGEST_ALGORITHM_2, - ScPassHashHelper::getHashURI(PASSHASH_SHA1)); - } - else if (eHashUsed == PASSHASH_SHA1) - { - AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTION_KEY_DIGEST_ALGORITHM, - ScPassHashHelper::getHashURI(PASSHASH_SHA1)); - } - else if (eHashUsed == PASSHASH_SHA256) - { - AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTION_KEY_DIGEST_ALGORITHM, - ScPassHashHelper::getHashURI(PASSHASH_SHA256)); - } + AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTION_KEY_DIGEST_ALGORITHM, + ScPassHashHelper::getHashURI(PASSHASH_XL)); + if (getSaneDefaultVersion() & SvtSaveOptions::ODFSVER_EXTENDED) + AddAttribute(XML_NAMESPACE_LO_EXT, XML_PROTECTION_KEY_DIGEST_ALGORITHM_2, + ScPassHashHelper::getHashURI(PASSHASH_SHA1)); + } + else if (eHashUsed == PASSHASH_SHA1) + { + AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTION_KEY_DIGEST_ALGORITHM, + ScPassHashHelper::getHashURI(PASSHASH_SHA1)); + } + else if (eHashUsed == PASSHASH_SHA256) + { + AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTION_KEY_DIGEST_ALGORITHM, + ScPassHashHelper::getHashURI(PASSHASH_SHA256)); } } } @@ -2896,10 +2905,10 @@ void ScXMLExport::WriteTable(sal_Int32 nTable, const uno::ReferenceIsPrintEntireSheet(static_cast(nTable))) + else if (!rDoc.IsPrintEntireSheet(static_cast(nTable))) AddAttribute( XML_NAMESPACE_TABLE, XML_PRINT, XML_FALSE); SvXMLElementExport aElemT(*this, sElemTab, true, true); @@ -2933,7 +2942,7 @@ void ScXMLExport::WriteTable(sal_Int32 nTable, const uno::ReferenceGetSheetEvents( static_cast(nTable) ) && + if (rDoc.GetSheetEvents( static_cast(nTable) ) && getSaneDefaultVersion() >= SvtSaveOptions::ODFSVER_012) { // store sheet events @@ -2943,7 +2952,7 @@ void ScXMLExport::WriteTable(sal_Int32 nTable, const uno::Reference xDrawPage; if (pSharedData->HasForm(nTable, xDrawPage) && xDrawPage.is()) { @@ -2955,22 +2964,22 @@ void ScXMLExport::WriteTable(sal_Int32 nTable, const uno::ReferenceHasDrawPage()) { GetShapeExport()->seekShapes(pSharedData->GetDrawPage(nTable)); - WriteTableShapes(); + WriteTableShapes(rDoc); } table::CellRangeAddress aRange(GetEndAddress(xTable)); pSharedData->SetLastColumn(nTable, aRange.EndColumn); pSharedData->SetLastRow(nTable, aRange.EndRow); - mpCellsItr->SetCurrentTable(static_cast(nTable), xCurrentTable); + mpCellsItr->SetCurrentTable(rDoc, static_cast(nTable), xCurrentTable); pGroupColumns->NewTable(); pGroupRows->NewTable(); - FillColumnRowGroups(); + FillColumnRowGroups(rDoc); if (bHasColumnHeader) pSharedData->SetLastColumn(nTable, aColumnHeaderRange.aEnd.Col()); bRowHeaderOpen = false; if (bHasRowHeader) pSharedData->SetLastRow(nTable, aRowHeaderRange.aEnd.Row()); pDefaults->FillDefaultStyles(nTable, pSharedData->GetLastRow(nTable), - pSharedData->GetLastColumn(nTable), pCellStyles.get(), mpDoc); + pSharedData->GetLastColumn(nTable), pCellStyles.get(), &rDoc); pRowFormatRanges->SetColDefaults(&pDefaults->GetColDefaults()); pCellStyles->SetColDefaults(&pDefaults->GetColDefaults()); ExportColumns(nTable, aColumnHeaderRange, bHasColumnHeader); @@ -2978,11 +2987,11 @@ void ScXMLExport::WriteTable(sal_Int32 nTable, const uno::ReferenceGetNext(aCell, pCellStyles.get())) + while (mpCellsItr->GetNext(rDoc, aCell, pCellStyles.get())) { if (bIsFirst) { - ExportFormatRanges(0, 0, aCell.maCellAddress.Col()-1, aCell.maCellAddress.Row(), nTable); + ExportFormatRanges(rDoc, 0, 0, aCell.maCellAddress.Col()-1, aCell.maCellAddress.Row(), nTable); aPrevCell = aCell; bIsFirst = false; } @@ -2991,19 +3000,19 @@ void ScXMLExport::WriteTable(sal_Int32 nTable, const uno::ReferenceGetLastColumn(nTable), pSharedData->GetLastRow(nTable), nTable); } else - ExportFormatRanges(0, 0, pSharedData->GetLastColumn(nTable), pSharedData->GetLastRow(nTable), nTable); + ExportFormatRanges(rDoc, 0, 0, pSharedData->GetLastColumn(nTable), pSharedData->GetLastRow(nTable), nTable); CloseRow(pSharedData->GetLastRow(nTable)); - if (!mpDoc) - return; - // Export sheet-local named ranges. - ScRangeName* pRangeName = mpDoc->GetRangeName(nTable); + ScRangeName* pRangeName = rDoc.GetRangeName(nTable); if (pRangeName && !pRangeName->empty()) { - WriteNamedRange(pRangeName); + WriteNamedRange(rDoc, pRangeName); } if (getSaneDefaultVersion() & SvtSaveOptions::ODFSVER_EXTENDED) { //export new conditional format information - ExportConditionalFormat(nTable); - exportSparklineGroups(nTable); + ExportConditionalFormat(rDoc, nTable); + exportSparklineGroups(rDoc, nTable); } } namespace { -void writeContent( - ScXMLExport& rExport, const OUString& rStyleName, const OUString& rContent, const SvxFieldData* pField ) +void writeContent(ScDocument& rDoc, ScXMLExport& rExport, const OUString& rStyleName, + const OUString& rContent, const SvxFieldData* pField) { std::unique_ptr pElem; if (!rStyleName.isEmpty()) @@ -3057,7 +3063,7 @@ void writeContent( if (pField) { // Write a field item. - OUString aFieldVal = ScEditUtil::GetCellFieldValue(*pField, rExport.GetDocument(), nullptr, nullptr); + OUString aFieldVal = ScEditUtil::GetCellFieldValue(*pField, &rDoc, nullptr, nullptr); switch (pField->GetClassId()) { case text::textfield::Type::URL: @@ -3132,6 +3138,7 @@ void writeContent( } void flushParagraph( + ScDocument& rDoc, ScXMLExport& rExport, std::u16string_view rParaText, rtl::Reference const & xMapper, rtl::Reference const & xStylePool, const ScXMLEditAttributeMap& rAttrMap, @@ -3167,13 +3174,13 @@ void flushParagraph( } } else - writeContent(rExport, aStyleName, aContent, pField); + writeContent(rDoc, rExport, aStyleName, aContent, pField); } } } -void ScXMLExport::WriteCell(ScMyCell& aCell, sal_Int32 nEqualCellCount) +void ScXMLExport::WriteCell(ScDocument& rDoc, ScMyCell& aCell, sal_Int32 nEqualCellCount) { // nEqualCellCount is the number of additional cells SetRepeatAttribute(nEqualCellCount, (aCell.nType != table::CellContentType_EMPTY)); @@ -3209,8 +3216,8 @@ void ScXMLExport::WriteCell(ScMyCell& aCell, sal_Int32 nEqualCellCount) break; case table::CellContentType_TEXT : { - OUString sFormattedString(lcl_GetFormattedString(mpDoc, aCell.maBaseCell, aCell.maCellAddress)); - OUString sCellString = aCell.maBaseCell.getString(mpDoc); + OUString sFormattedString(lcl_GetFormattedString(rDoc, aCell.maBaseCell, aCell.maCellAddress)); + OUString sCellString = aCell.maBaseCell.getString(&rDoc); bool bExportValue = sCellString.indexOf('\x001') == -1; GetNumberFormatAttributesExportHelper()->SetNumberFormatAttributes( sCellString, sFormattedString, bExportValue); @@ -3227,10 +3234,10 @@ void ScXMLExport::WriteCell(ScMyCell& aCell, sal_Int32 nEqualCellCount) ScFormulaCell* pFormulaCell = aCell.maBaseCell.getFormula(); if (!bIsMatrix || bIsFirstMatrixCell) { - if (!mpCompileFormulaCxt && mpDoc) + if (!mpCompileFormulaCxt) { - const formula::FormulaGrammar::Grammar eGrammar = mpDoc->GetStorageGrammar(); - mpCompileFormulaCxt.reset(new sc::CompileFormulaContext(*mpDoc, eGrammar)); + const formula::FormulaGrammar::Grammar eGrammar = rDoc.GetStorageGrammar(); + mpCompileFormulaCxt.reset(new sc::CompileFormulaContext(rDoc, eGrammar)); } mpCompileFormulaCxt->setODFSavingVersion(getSaneDefaultVersion()); OUString aFormula = pFormulaCell->GetFormula(*mpCompileFormulaCxt); @@ -3249,7 +3256,7 @@ void ScXMLExport::WriteCell(ScMyCell& aCell, sal_Int32 nEqualCellCount) if (pFormulaCell->GetErrCode() != FormulaError::NONE) { AddAttribute(sAttrValueType, XML_STRING); - AddAttribute(sAttrStringValue, aCell.maBaseCell.getString(mpDoc)); + AddAttribute(sAttrStringValue, aCell.maBaseCell.getString(&rDoc)); if (getSaneDefaultVersion() & SvtSaveOptions::ODFSVER_EXTENDED) { //export calcext:value-type="error" @@ -3261,23 +3268,20 @@ void ScXMLExport::WriteCell(ScMyCell& aCell, sal_Int32 nEqualCellCount) bool bIsStandard; OUString sCurrency; GetNumberFormatAttributesExportHelper()->GetCellType(aCell.nNumberFormat, sCurrency, bIsStandard); - if (mpDoc) + GetNumberFormatAttributesExportHelper()->SetNumberFormatAttributes( + aCell.nNumberFormat, rDoc.GetValue(aCell.maCellAddress)); + if (getSaneDefaultVersion() & SvtSaveOptions::ODFSVER_EXTENDED) { GetNumberFormatAttributesExportHelper()->SetNumberFormatAttributes( - aCell.nNumberFormat, mpDoc->GetValue(aCell.maCellAddress)); - if (getSaneDefaultVersion() & SvtSaveOptions::ODFSVER_EXTENDED) - { - GetNumberFormatAttributesExportHelper()->SetNumberFormatAttributes( - aCell.nNumberFormat, mpDoc->GetValue(aCell.maCellAddress), false, XML_NAMESPACE_CALC_EXT, false ); - } + aCell.nNumberFormat, rDoc.GetValue(aCell.maCellAddress), false, XML_NAMESPACE_CALC_EXT, false ); } } else { - if (!aCell.maBaseCell.getString(mpDoc).isEmpty()) + if (!aCell.maBaseCell.getString(&rDoc).isEmpty()) { AddAttribute(sAttrValueType, XML_STRING); - AddAttribute(sAttrStringValue, aCell.maBaseCell.getString(mpDoc)); + AddAttribute(sAttrStringValue, aCell.maBaseCell.getString(&rDoc)); if (getSaneDefaultVersion() & SvtSaveOptions::ODFSVER_EXTENDED) { AddAttribute(XML_NAMESPACE_CALC_EXT,XML_VALUE_TYPE, XML_STRING); @@ -3308,36 +3312,36 @@ void ScXMLExport::WriteCell(ScMyCell& aCell, sal_Int32 nEqualCellCount) SvXMLElementExport aElemC(*this, *pCellString, true, true); CheckAttrList(); WriteAreaLink(aCell); - WriteAnnotation(aCell); - WriteDetective(aCell); + WriteAnnotation(rDoc, aCell); + WriteDetective(rDoc, aCell); if (!bIsEmpty) { if (aCell.maBaseCell.getType() == CELLTYPE_EDIT) { - WriteEditCell(aCell.maBaseCell.getEditText()); + WriteEditCell(rDoc, aCell.maBaseCell.getEditText()); } else if (aCell.maBaseCell.getType() == CELLTYPE_FORMULA && aCell.maBaseCell.getFormula()->IsMultilineResult()) { WriteMultiLineFormulaResult(aCell.maBaseCell.getFormula()); } - else if (mpDoc) + else { SvXMLElementExport aElemP(*this, sElemP, true, false); OUString aParaStr = - ScCellFormat::GetOutputString(*mpDoc, aCell.maCellAddress, aCell.maBaseCell); + ScCellFormat::GetOutputString(rDoc, aCell.maCellAddress, aCell.maBaseCell); bool bPrevCharWasSpace = true; GetTextParagraphExport()->exportCharacterData(aParaStr, bPrevCharWasSpace); } } - WriteShapes(aCell); + WriteShapes(rDoc, aCell); if (!bIsEmpty) IncrementProgressBar(false); } -void ScXMLExport::WriteEditCell(const EditTextObject* pText) +void ScXMLExport::WriteEditCell(ScDocument& rDoc, const EditTextObject* pText) { rtl::Reference xMapper = GetTextParagraphExport()->GetTextPropMapper()->getPropertySetMapper(); rtl::Reference xStylePool = GetAutoStylePool(); @@ -3364,12 +3368,12 @@ void ScXMLExport::WriteEditCell(const EditTextObject* pText) continue; // Start of a new paragraph. Flush the old paragraph. - flushParagraph(*this, aParaTexts[nCurPara], xMapper, xStylePool, rAttrMap, itPara, itSec); + flushParagraph(rDoc, *this, aParaTexts[nCurPara], xMapper, xStylePool, rAttrMap, itPara, itSec); nCurPara = rSec.mnParagraph; itPara = itSec; } - flushParagraph(*this, aParaTexts[nCurPara], xMapper, xStylePool, rAttrMap, itPara, itSecEnd); + flushParagraph(rDoc, *this, aParaTexts[nCurPara], xMapper, xStylePool, rAttrMap, itPara, itSecEnd); } void ScXMLExport::WriteMultiLineFormulaResult(const ScFormulaCell* pCell) @@ -3408,7 +3412,7 @@ void ScXMLExport::WriteMultiLineFormulaResult(const ScFormulaCell* pCell) Characters(aContent); } -void ScXMLExport::ExportShape(const uno::Reference < drawing::XShape >& xShape, awt::Point* pPoint) +void ScXMLExport::ExportShape(ScDocument& rDoc, const uno::Reference < drawing::XShape >& xShape, awt::Point* pPoint) { uno::Reference < beans::XPropertySet > xShapeProps ( xShape, uno::UNO_QUERY ); bool bIsChart( false ); @@ -3430,28 +3434,25 @@ void ScXMLExport::ExportShape(const uno::Reference < drawing::XShape >& xShape, { // we have a chart OUString sRanges; - if ( mpDoc ) + OUString aChartName; + xShapeProps->getPropertyValue( u"PersistName"_ustr ) >>= aChartName; + ScChartListenerCollection* pCollection = rDoc.GetChartListenerCollection(); + if (pCollection) { - OUString aChartName; - xShapeProps->getPropertyValue( u"PersistName"_ustr ) >>= aChartName; - ScChartListenerCollection* pCollection = mpDoc->GetChartListenerCollection(); - if (pCollection) + ScChartListener* pListener = pCollection->findByName(aChartName); + if (pListener) { - ScChartListener* pListener = pCollection->findByName(aChartName); - if (pListener) + const ScRangeListRef xRangeList = pListener->GetRangeList(); + if ( xRangeList.is() ) { - const ScRangeListRef xRangeList = pListener->GetRangeList(); - if ( xRangeList.is() ) + ScRangeStringConverter::GetStringFromRangeList( sRanges, xRangeList.get(), &rDoc, FormulaGrammar::CONV_OOO ); + if ( !sRanges.isEmpty() ) { - ScRangeStringConverter::GetStringFromRangeList( sRanges, xRangeList.get(), mpDoc, FormulaGrammar::CONV_OOO ); - if ( !sRanges.isEmpty() ) - { - bIsChart = true; - rtl::Reference pAttrList = new comphelper::AttributeList(); - pAttrList->AddAttribute( - GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_DRAW, GetXMLToken( XML_NOTIFY_ON_UPDATE_OF_RANGES ) ), sRanges ); - GetShapeExport()->exportShape( xShape, SEF_DEFAULT, pPoint, pAttrList.get() ); - } + bIsChart = true; + rtl::Reference pAttrList = new comphelper::AttributeList(); + pAttrList->AddAttribute( + GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_DRAW, GetXMLToken( XML_NOTIFY_ON_UPDATE_OF_RANGES ) ), sRanges ); + GetShapeExport()->exportShape( xShape, SEF_DEFAULT, pPoint, pAttrList.get() ); } } } @@ -3505,20 +3506,20 @@ void ScXMLExport::ExportShape(const uno::Reference < drawing::XShape >& xShape, IncrementProgressBar(false); } -void ScXMLExport::WriteShapes(const ScMyCell& rMyCell) +void ScXMLExport::WriteShapes(ScDocument& rDoc, const ScMyCell& rMyCell) { - if( !(rMyCell.bHasShape && !rMyCell.aShapeList.empty() && mpDoc) ) + if( !(rMyCell.bHasShape && !rMyCell.aShapeList.empty()) ) return; // Reference point to turn absolute coordinates in reference point + offset. That happens in most // cases in XMLShapeExport::ImpExportNewTrans_DecomposeAndRefPoint, which gets the absolute // coordinates as translation from matrix in property "Transformation". For cell anchored shapes // the reference point is left-top (in LTR mode) of that cell, which contains the shape. - tools::Rectangle aCellRectFull = mpDoc->GetMMRect( + tools::Rectangle aCellRectFull = rDoc.GetMMRect( rMyCell.maCellAddress.Col(), rMyCell.maCellAddress.Row(), rMyCell.maCellAddress.Col(), rMyCell.maCellAddress.Row(), rMyCell.maCellAddress.Tab(), false /*bHiddenAsZero*/); awt::Point aPoint; - bool bNegativePage = mpDoc->IsNegativePage(rMyCell.maCellAddress.Tab()); + bool bNegativePage = rDoc.IsNegativePage(rMyCell.maCellAddress.Tab()); if (bNegativePage) aPoint.X = aCellRectFull.Right(); else @@ -3558,7 +3559,7 @@ void ScXMLExport::WriteShapes(const ScMyCell& rMyCell) SCCOL aCol(aSnapStartAddress.Col()); SCROW aRow(aSnapStartAddress.Row()); tools::Rectangle aFullStartCellRect - = mpDoc->GetMMRect(aCol, aRow, aCol, aRow, aTab, false /*bHiddenAsZero*/); + = rDoc.GetMMRect(aCol, aRow, aCol, aRow, aTab, false /*bHiddenAsZero*/); // The reference corner for the offset is top-left in case of LTR and top-right for RTL. Point aFullTopPoint; if (bNegativePage) @@ -3590,7 +3591,7 @@ void ScXMLExport::WriteShapes(const ScMyCell& rMyCell) aCol = aSnapEndAddress.Col(); aRow = aSnapEndAddress.Row(); tools::Rectangle aFullEndCellRect - = mpDoc->GetMMRect(aCol, aRow, aCol, aRow, aTab, false /*bHiddenAsZero*/); + = rDoc.GetMMRect(aCol, aRow, aCol, aRow, aTab, false /*bHiddenAsZero*/); Point aFullBottomPoint; if (bNegativePage) aFullBottomPoint.setX(aFullEndCellRect.Right() - aSnapEndOffset.X()); @@ -3623,7 +3624,7 @@ void ScXMLExport::WriteShapes(const ScMyCell& rMyCell) if (pObjData->mbResizeWithCell && !pObj->IsResizeProtect()) { OUString sEndAddress; - ScRangeStringConverter::GetStringFromAddress(sEndAddress, rShape.aEndAddress, mpDoc, + ScRangeStringConverter::GetStringFromAddress(sEndAddress, rShape.aEndAddress, &rDoc, FormulaGrammar::CONV_OOO); AddAttribute(XML_NAMESPACE_TABLE, XML_END_CELL_ADDRESS, sEndAddress); OUStringBuffer sBuffer; @@ -3654,7 +3655,7 @@ void ScXMLExport::WriteShapes(const ScMyCell& rMyCell) } } - ExportShape(rShape.xShape, &aPoint); + ExportShape(rDoc, rShape.xShape, &aPoint); if (bNeedsRestoreSize) { @@ -3673,7 +3674,7 @@ void ScXMLExport::WriteShapes(const ScMyCell& rMyCell) } } -void ScXMLExport::WriteTableShapes() +void ScXMLExport::WriteTableShapes(ScDocument& rDoc) { ScMyTableShapes* pTableShapes(pSharedData->GetTableShapes()); if (!pTableShapes || (*pTableShapes)[nCurrentTable].empty()) @@ -3685,7 +3686,7 @@ void ScXMLExport::WriteTableShapes() { if (rxShape.is()) { - if (mpDoc && mpDoc->IsNegativePage(static_cast(nCurrentTable))) + if (rDoc.IsNegativePage(static_cast(nCurrentTable))) { // RTL-mirroring refers to snap rectangle, not to logic rectangle, therefore cannot use // getPosition() and getSize(), but need property "FrameRect" from rxShape or @@ -3712,12 +3713,12 @@ void ScXMLExport::WriteTableShapes() awt::Point aRefPoint; aRefPoint.X = 2 * aFrameRect.X + aFrameRect.Width - 1; aRefPoint.Y = 0; - ExportShape(rxShape, &aRefPoint); + ExportShape(rDoc, rxShape, &aRefPoint); } // else should not happen } else - ExportShape(rxShape, nullptr); + ExportShape(rDoc, rxShape, nullptr); } } (*pTableShapes)[nCurrentTable].clear(); @@ -3778,9 +3779,9 @@ void ScXMLExport::exportAnnotationMeta( const uno::Reference < drawing::XShape > } const OUString aDate(bRemovePersonalInfo ? u"1970-01-01"_ustr : pNote->GetDate()); // Epoch time - if (mpDoc) + if (ScDocument* pDoc = GetDocument()) { - SvNumberFormatter* pNumForm = mpDoc->GetFormatTable(); + SvNumberFormatter* pNumForm = pDoc->GetFormatTable(); double fDate; sal_uInt32 nfIndex = pNumForm->GetFormatIndex(NF_DATE_SYS_DDMMYYYY, LANGUAGE_SYSTEM); if (pNumForm->IsNumberFormat(aDate, nfIndex, fDate)) @@ -3809,12 +3810,9 @@ void ScXMLExport::exportAnnotationMeta( const uno::Reference < drawing::XShape > } } -void ScXMLExport::WriteAnnotation(const ScMyCell& rMyCell) +void ScXMLExport::WriteAnnotation(ScDocument& rDoc, const ScMyCell& rMyCell) { - if (!mpDoc) - return; - - ScPostIt* pNote = mpDoc->GetNote(rMyCell.maCellAddress); + ScPostIt* pNote = rDoc.GetNote(rMyCell.maCellAddress); if (!pNote) return; @@ -3834,7 +3832,7 @@ void ScXMLExport::WriteAnnotation(const ScMyCell& rMyCell) pCurrentCell = nullptr; } -void ScXMLExport::WriteDetective( const ScMyCell& rMyCell ) +void ScXMLExport::WriteDetective(ScDocument& rDoc, const ScMyCell& rMyCell) { if( !(rMyCell.bHasDetectiveObj || rMyCell.bHasDetectiveOp) ) return; @@ -3854,7 +3852,7 @@ void ScXMLExport::WriteDetective( const ScMyCell& rMyCell ) { if( (rObj.eObjType == SC_DETOBJ_ARROW) || (rObj.eObjType == SC_DETOBJ_TOOTHERTAB)) { - ScRangeStringConverter::GetStringFromRange( sString, rObj.aSourceRange, mpDoc, FormulaGrammar::CONV_OOO ); + ScRangeStringConverter::GetStringFromRange( sString, rObj.aSourceRange, &rDoc, FormulaGrammar::CONV_OOO ); AddAttribute( XML_NAMESPACE_TABLE, XML_CELL_RANGE_ADDRESS, sString ); } sString = ScXMLConverter::GetStringFromDetObjType( rObj.eObjType ); @@ -3888,12 +3886,14 @@ void ScXMLExport::SetRepeatAttribute(sal_Int32 nEqualCellCount, bool bIncProgres } } +//static bool ScXMLExport::IsEditCell(const ScMyCell& rCell) { return rCell.maBaseCell.getType() == CELLTYPE_EDIT; } -bool ScXMLExport::IsCellEqual (const ScMyCell& aCell1, const ScMyCell& aCell2) +//static +bool ScXMLExport::IsCellEqual(ScDocument& rDoc, const ScMyCell& aCell1, const ScMyCell& aCell2) { bool bIsEqual = false; if( !aCell1.bIsMergedBase && !aCell2.bIsMergedBase && @@ -3939,7 +3939,7 @@ bool ScXMLExport::IsCellEqual (const ScMyCell& aCell1, const ScMyCell& aCell2) bIsEqual = false; else { - bIsEqual = (aCell1.maBaseCell.getString(mpDoc) == aCell2.maBaseCell.getString(mpDoc)); + bIsEqual = (aCell1.maBaseCell.getString(&rDoc) == aCell2.maBaseCell.getString(&rDoc)); } } break; @@ -3961,7 +3961,7 @@ bool ScXMLExport::IsCellEqual (const ScMyCell& aCell1, const ScMyCell& aCell2) return bIsEqual; } -void ScXMLExport::WriteCalculationSettings(const uno::Reference & xSpreadDoc) +void ScXMLExport::WriteCalculationSettings(ScDocument& rDoc, const uno::Reference & xSpreadDoc) { uno::Reference xPropertySet(xSpreadDoc, uno::UNO_QUERY); if (!xPropertySet.is()) @@ -3976,7 +3976,7 @@ void ScXMLExport::WriteCalculationSettings(const uno::Reference getPropertyValue(SC_UNO_ITERENABLED) )); - sal_uInt16 nYear2000 (mpDoc ? mpDoc->GetDocOptions().GetYear2000() : 0); + sal_uInt16 nYear2000 (rDoc.GetDocOptions().GetYear2000()); sal_Int32 nIterationCount(100); xPropertySet->getPropertyValue( SC_UNO_ITERCOUNT ) >>= nIterationCount; double fIterationEpsilon = 0; @@ -4103,15 +4103,15 @@ void ScXMLExport::WriteTableSource() } // core implementation -void ScXMLExport::WriteScenario() +void ScXMLExport::WriteScenario(ScDocument& rDoc) { - if (!(mpDoc && mpDoc->IsScenario(static_cast(nCurrentTable)))) + if (!rDoc.IsScenario(static_cast(nCurrentTable))) return; OUString sComment; Color aColor; ScScenarioFlags nFlags; - mpDoc->GetScenarioData(static_cast(nCurrentTable), sComment, aColor, nFlags); + rDoc.GetScenarioData(static_cast(nCurrentTable), sComment, aColor, nFlags); if (!(nFlags & ScScenarioFlags::ShowFrame)) AddAttribute(XML_NAMESPACE_TABLE, XML_DISPLAY_BORDER, XML_FALSE); OUStringBuffer aBuffer; @@ -4126,18 +4126,18 @@ void ScXMLExport::WriteScenario() if (nFlags & ScScenarioFlags::Protected) AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTED, XML_TRUE); ::sax::Converter::convertBool(aBuffer, - mpDoc->IsActiveScenario(static_cast(nCurrentTable))); + rDoc.IsActiveScenario(static_cast(nCurrentTable))); AddAttribute(XML_NAMESPACE_TABLE, XML_IS_ACTIVE, aBuffer.makeStringAndClear()); - const ScRangeList* pRangeList = mpDoc->GetScenarioRanges(static_cast(nCurrentTable)); + const ScRangeList* pRangeList = rDoc.GetScenarioRanges(static_cast(nCurrentTable)); OUString sRangeListStr; - ScRangeStringConverter::GetStringFromRangeList( sRangeListStr, pRangeList, mpDoc, FormulaGrammar::CONV_OOO ); + ScRangeStringConverter::GetStringFromRangeList( sRangeListStr, pRangeList, &rDoc, FormulaGrammar::CONV_OOO ); AddAttribute(XML_NAMESPACE_TABLE, XML_SCENARIO_RANGES, sRangeListStr); if (!sComment.isEmpty()) AddAttribute(XML_NAMESPACE_TABLE, XML_COMMENT, sComment); SvXMLElementExport aElem(*this, XML_NAMESPACE_TABLE, XML_SCENARIO, true, true); } -void ScXMLExport::WriteTheLabelRanges( const uno::Reference< sheet::XSpreadsheetDocument >& xSpreadDoc ) +void ScXMLExport::WriteTheLabelRanges(ScDocument& rDoc, const uno::Reference< sheet::XSpreadsheetDocument >& xSpreadDoc) { uno::Reference< beans::XPropertySet > xDocProp( xSpreadDoc, uno::UNO_QUERY ); if( !xDocProp.is() ) return; @@ -4154,12 +4154,12 @@ void ScXMLExport::WriteTheLabelRanges( const uno::Reference< sheet::XSpreadsheet if( nCount ) { SvXMLElementExport aElem( *this, XML_NAMESPACE_TABLE, XML_LABEL_RANGES, true, true ); - WriteLabelRanges( xColRangesIAccess, true ); - WriteLabelRanges( xRowRangesIAccess, false ); + WriteLabelRanges(rDoc, xColRangesIAccess, true); + WriteLabelRanges(rDoc, xRowRangesIAccess, false); } } -void ScXMLExport::WriteLabelRanges( const uno::Reference< container::XIndexAccess >& xRangesIAccess, bool bColumn ) +void ScXMLExport::WriteLabelRanges(ScDocument& rDoc, const uno::Reference< container::XIndexAccess >& xRangesIAccess, bool bColumn) { if( !xRangesIAccess.is() ) return; @@ -4171,10 +4171,10 @@ void ScXMLExport::WriteLabelRanges( const uno::Reference< container::XIndexAcces { OUString sRangeStr; table::CellRangeAddress aCellRange( xRange->getLabelArea() ); - ScRangeStringConverter::GetStringFromRange( sRangeStr, aCellRange, mpDoc, FormulaGrammar::CONV_OOO ); + ScRangeStringConverter::GetStringFromRange( sRangeStr, aCellRange, &rDoc, FormulaGrammar::CONV_OOO ); AddAttribute( XML_NAMESPACE_TABLE, XML_LABEL_CELL_RANGE_ADDRESS, sRangeStr ); aCellRange = xRange->getDataArea(); - ScRangeStringConverter::GetStringFromRange( sRangeStr, aCellRange, mpDoc, FormulaGrammar::CONV_OOO ); + ScRangeStringConverter::GetStringFromRange( sRangeStr, aCellRange, &rDoc, FormulaGrammar::CONV_OOO ); AddAttribute( XML_NAMESPACE_TABLE, XML_DATA_CELL_RANGE_ADDRESS, sRangeStr ); AddAttribute( XML_NAMESPACE_TABLE, XML_ORIENTATION, bColumn ? XML_COLUMN : XML_ROW ); SvXMLElementExport aElem( *this, XML_NAMESPACE_TABLE, XML_LABEL_RANGE, true, true ); @@ -4182,24 +4182,19 @@ void ScXMLExport::WriteLabelRanges( const uno::Reference< container::XIndexAcces } } -void ScXMLExport::WriteNamedExpressions() +void ScXMLExport::WriteNamedExpressions(ScDocument& rDoc) { - if (!mpDoc) - return; - ScRangeName* pNamedRanges = mpDoc->GetRangeName(); - WriteNamedRange(pNamedRanges); + ScRangeName* pNamedRanges = rDoc.GetRangeName(); + WriteNamedRange(rDoc, pNamedRanges); } -void ScXMLExport::WriteExternalDataMapping() +void ScXMLExport::WriteExternalDataMapping(ScDocument& rDoc) { - if (!mpDoc) - return; - if ((getSaneDefaultVersion() & SvtSaveOptions::ODFSVER_EXTENDED) == 0) // Export this only for 1.2 extended and above. return; - sc::ExternalDataMapper& rDataMapper = mpDoc->GetExternalDataMapper(); + sc::ExternalDataMapper& rDataMapper = rDoc.GetExternalDataMapper(); auto& rDataSources = rDataMapper.getDataSources(); if (rDataSources.empty()) @@ -4216,11 +4211,11 @@ void ScXMLExport::WriteExternalDataMapping() SvXMLElementExport aMapping(*this, XML_NAMESPACE_CALC_EXT, XML_DATA_MAPPING, true, true); // Add the data transformations - WriteExternalDataTransformations(itr.getDataTransformation()); + WriteExternalDataTransformations(rDoc, itr.getDataTransformation()); } } -void ScXMLExport::WriteExternalDataTransformations(const std::vector>& aDataTransformations) +void ScXMLExport::WriteExternalDataTransformations(ScDocument& rDoc, const std::vector>& aDataTransformations) { SvXMLElementExport aTransformations(*this, XML_NAMESPACE_CALC_EXT, XML_DATA_TRANSFORMATIONS, true, true); for (auto& itr : aDataTransformations) @@ -4271,13 +4266,10 @@ void ScXMLExport::WriteExternalDataTransformations(const std::vector aSortTransformation = std::dynamic_pointer_cast(itr); ScSortParam aSortParam = aSortTransformation->getSortParam(); - const sc::DocumentLinkManager& rMgr = mpDoc->GetDocLinkManager(); + const sc::DocumentLinkManager& rMgr = rDoc.GetDocLinkManager(); const sc::DataStream* pStrm = rMgr.getDataStream(); if (!pStrm) // No data stream. @@ -4288,7 +4280,7 @@ void ScXMLExport::WriteExternalDataTransformations(const std::vectorGetDocLinkManager(); + const sc::DocumentLinkManager& rMgr = rDoc.GetDocLinkManager(); const sc::DataStream* pStrm = rMgr.getDataStream(); if (!pStrm) // No data stream. @@ -4547,7 +4536,7 @@ void ScXMLExport::WriteDataStream() ScRange aRange = pStrm->GetRange(); OUString aRangeStr; ScRangeStringConverter::GetStringFromRange( - aRangeStr, aRange, mpDoc, formula::FormulaGrammar::CONV_OOO); + aRangeStr, aRange, &rDoc, formula::FormulaGrammar::CONV_OOO); AddAttribute(XML_NAMESPACE_TABLE, XML_TARGET_RANGE_ADDRESS, aRangeStr); // Empty line refresh option. @@ -4563,11 +4552,8 @@ void ScXMLExport::WriteDataStream() SvXMLElementExport aElem(*this, XML_NAMESPACE_CALC_EXT, XML_DATA_STREAM_SOURCE, true, true); } -void ScXMLExport::WriteNamedRange(ScRangeName* pRangeName) +void ScXMLExport::WriteNamedRange(ScDocument& rDoc, ScRangeName* pRangeName) { - if (!mpDoc) - return; - //write a global or local ScRangeName SvXMLElementExport aElemNEs(*this, XML_NAMESPACE_TABLE, XML_NAMED_EXPRESSIONS, true, true); for (const auto& rxEntry : *pRangeName) @@ -4576,12 +4562,12 @@ void ScXMLExport::WriteNamedRange(ScRangeName* pRangeName) OUString sBaseCellAddress; rxEntry.second->ValidateTabRefs(); - ScRangeStringConverter::GetStringFromAddress( sBaseCellAddress, rxEntry.second->GetPos(), mpDoc, + ScRangeStringConverter::GetStringFromAddress( sBaseCellAddress, rxEntry.second->GetPos(), &rDoc, FormulaGrammar::CONV_OOO, ' ', false, ScRefFlags::ADDR_ABS_3D); assert(!sBaseCellAddress.isEmpty()); AddAttribute(XML_NAMESPACE_TABLE, XML_BASE_CELL_ADDRESS, sBaseCellAddress); - OUString sTempSymbol(rxEntry.second->GetSymbol(mpDoc->GetStorageGrammar())); + OUString sTempSymbol(rxEntry.second->GetSymbol(rDoc.GetStorageGrammar())); ScRange aRange; if (rxEntry.second->IsReference(aRange)) { @@ -4635,9 +4621,9 @@ void ScXMLExport::WriteNamedRange(ScRangeName* pRangeName) } } -void ScXMLExport::exportSparklineGroups(SCTAB nTable) +void ScXMLExport::exportSparklineGroups(ScDocument& rDoc, SCTAB nTable) { - sc::SparklineGroupsExport aSparklineGroupExport(*this, nTable); + sc::SparklineGroupsExport aSparklineGroupExport(rDoc, *this, nTable); aSparklineGroupExport.write(); } @@ -4706,12 +4692,9 @@ OUString getDateStringForType(condformat::ScCondFormatDateType eType) } -void ScXMLExport::ExportConditionalFormat(SCTAB nTab) +void ScXMLExport::ExportConditionalFormat(ScDocument& rDoc, SCTAB nTab) { - if (!mpDoc) - return; - - ScConditionalFormatList* pCondFormatList = mpDoc->GetCondFormList(nTab); + ScConditionalFormatList* pCondFormatList = rDoc.GetCondFormList(nTab); if(!pCondFormatList) return; @@ -4724,7 +4707,7 @@ void ScXMLExport::ExportConditionalFormat(SCTAB nTab) { OUString sRanges; const ScRangeList& rRangeList = rxCondFormat->GetRange(); - ScRangeStringConverter::GetStringFromRangeList( sRanges, &rRangeList, mpDoc, formula::FormulaGrammar::CONV_OOO ); + ScRangeStringConverter::GetStringFromRangeList( sRanges, &rRangeList, &rDoc, formula::FormulaGrammar::CONV_OOO ); AddAttribute(XML_NAMESPACE_CALC_EXT, XML_TARGET_RANGE_ADDRESS, sRanges); SvXMLElementExport aElementCondFormat(*this, XML_NAMESPACE_CALC_EXT, XML_CONDITIONAL_FORMAT, true, true); size_t nEntries = rxCondFormat->size(); @@ -4849,7 +4832,7 @@ void ScXMLExport::ExportConditionalFormat(SCTAB nTab) AddAttribute(XML_NAMESPACE_CALC_EXT, XML_VALUE, aCond.makeStringAndClear()); OUString sBaseAddress; - ScRangeStringConverter::GetStringFromAddress( sBaseAddress, aPos, mpDoc,formula::FormulaGrammar::CONV_ODF ); + ScRangeStringConverter::GetStringFromAddress( sBaseAddress, aPos, &rDoc, formula::FormulaGrammar::CONV_ODF ); AddAttribute(XML_NAMESPACE_CALC_EXT, XML_BASE_CELL_ADDRESS, sBaseAddress); SvXMLElementExport aElementCondEntry(*this, XML_NAMESPACE_CALC_EXT, XML_CONDITION, true, true); } @@ -5002,12 +4985,9 @@ void ScXMLExport::ExportConditionalFormat(SCTAB nTab) } } -void ScXMLExport::WriteExternalRefCaches() +void ScXMLExport::WriteExternalRefCaches(ScDocument& rDoc) { - if (!mpDoc) - return; - - ScExternalRefManager* pRefMgr = mpDoc->GetExternalRefManager(); + ScExternalRefManager* pRefMgr = rDoc.GetExternalRefManager(); pRefMgr->resetSrcFileData(GetOrigFileName()); sal_uInt16 nCount = pRefMgr->getExternalFileCount(); for (sal_uInt16 nFileId = 0; nFileId < nCount; ++nFileId) @@ -5193,12 +5173,9 @@ void ScXMLExport::WriteExternalRefCaches() } // core implementation -void ScXMLExport::WriteConsolidation() +void ScXMLExport::WriteConsolidation(ScDocument& rDoc) { - if (!mpDoc) - return; - - const ScConsolidateParam* pCons(mpDoc->GetConsolidateDlgData()); + const ScConsolidateParam* pCons(rDoc.GetConsolidateDlgData()); if( !pCons ) return; @@ -5207,10 +5184,10 @@ void ScXMLExport::WriteConsolidation() sStrData.clear(); for( sal_Int32 nIndex = 0; nIndex < pCons->nDataAreaCount; ++nIndex ) - ScRangeStringConverter::GetStringFromArea( sStrData, pCons->pDataAreas[ nIndex ], mpDoc, FormulaGrammar::CONV_OOO, ' ', true ); + ScRangeStringConverter::GetStringFromArea( sStrData, pCons->pDataAreas[ nIndex ], &rDoc, FormulaGrammar::CONV_OOO, ' ', true ); AddAttribute( XML_NAMESPACE_TABLE, XML_SOURCE_CELL_RANGE_ADDRESSES, sStrData ); - ScRangeStringConverter::GetStringFromAddress( sStrData, ScAddress( pCons->nCol, pCons->nRow, pCons->nTab ), mpDoc, FormulaGrammar::CONV_OOO ); + ScRangeStringConverter::GetStringFromAddress( sStrData, ScAddress( pCons->nCol, pCons->nRow, pCons->nTab ), &rDoc, FormulaGrammar::CONV_OOO ); AddAttribute( XML_NAMESPACE_TABLE, XML_TARGET_CELL_ADDRESS, sStrData ); if( pCons->bByCol && !pCons->bByRow ) @@ -5236,9 +5213,10 @@ XMLPageExport* ScXMLExport::CreatePageExport() return new XMLTableMasterPageExport( *this ); } -void ScXMLExport::GetChangeTrackViewSettings(uno::Sequence& rProps) +//static +void ScXMLExport::GetChangeTrackViewSettings(ScDocument& rDoc, uno::Sequence& rProps) { - ScChangeViewSettings* pViewSettings(mpDoc ? mpDoc->GetChangeViewSettings() : nullptr); + ScChangeViewSettings* pViewSettings(rDoc.GetChangeViewSettings()); if (!pViewSettings) return; @@ -5273,7 +5251,7 @@ void ScXMLExport::GetChangeTrackViewSettings(uno::Sequence pChangeProps[SC_SHOW_CHANGES_BY_RANGES].Name = "ShowChangesByRanges"; pChangeProps[SC_SHOW_CHANGES_BY_RANGES].Value <<= pViewSettings->HasRange(); OUString sRangeList; - ScRangeStringConverter::GetStringFromRangeList(sRangeList, &(pViewSettings->GetTheRangeList()), mpDoc, FormulaGrammar::CONV_OOO); + ScRangeStringConverter::GetStringFromRangeList(sRangeList, &(pViewSettings->GetTheRangeList()), &rDoc, FormulaGrammar::CONV_OOO); pChangeProps[SC_SHOW_CHANGES_BY_RANGES_LIST].Name = "ShowChangesByRangesList"; pChangeProps[SC_SHOW_CHANGES_BY_RANGES_LIST].Value <<= sRangeList; @@ -5283,30 +5261,38 @@ void ScXMLExport::GetChangeTrackViewSettings(uno::Sequence void ScXMLExport::GetViewSettings(uno::Sequence& rProps) { - if (GetModel().is()) + if (!GetModel().is()) + return; + + ScModelObj* pDocObj(comphelper::getFromUnoTunnel( GetModel() )); + if (!pDocObj) + return; + + SfxObjectShell* pEmbeddedObj = pDocObj->GetEmbeddedObject(); + if (pEmbeddedObj) { rProps.realloc(4); beans::PropertyValue* pProps(rProps.getArray()); - ScModelObj* pDocObj(comphelper::getFromUnoTunnel( GetModel() )); - if (pDocObj) - { - SfxObjectShell* pEmbeddedObj = pDocObj->GetEmbeddedObject(); - if (pEmbeddedObj) - { - tools::Rectangle aRect(pEmbeddedObj->GetVisArea()); - sal_uInt16 i(0); - pProps[i].Name = "VisibleAreaTop"; - pProps[i].Value <<= static_cast(aRect.Top()); - pProps[++i].Name = "VisibleAreaLeft"; - pProps[i].Value <<= static_cast(aRect.Left()); - pProps[++i].Name = "VisibleAreaWidth"; - pProps[i].Value <<= static_cast(aRect.getOpenWidth()); - pProps[++i].Name = "VisibleAreaHeight"; - pProps[i].Value <<= static_cast(aRect.getOpenHeight()); - } - } + + tools::Rectangle aRect(pEmbeddedObj->GetVisArea()); + sal_uInt16 i(0); + pProps[i].Name = "VisibleAreaTop"; + pProps[i].Value <<= static_cast(aRect.Top()); + pProps[++i].Name = "VisibleAreaLeft"; + pProps[i].Value <<= static_cast(aRect.Left()); + pProps[++i].Name = "VisibleAreaWidth"; + pProps[i].Value <<= static_cast(aRect.getOpenWidth()); + pProps[++i].Name = "VisibleAreaHeight"; + pProps[i].Value <<= static_cast(aRect.getOpenHeight()); } - GetChangeTrackViewSettings(rProps); + + ScDocument* pDoc = pDocObj->GetDocument(); + if (!pDoc) + { + SAL_WARN("sc", "no ScDocument!"); + return; + } + GetChangeTrackViewSettings(*pDoc, rProps); } void ScXMLExport::GetConfigurationSettings(uno::Sequence& rProps) @@ -5322,28 +5308,30 @@ void ScXMLExport::GetConfigurationSettings(uno::Sequence& if (xProperties.is()) SvXMLUnitConverter::convertPropertySet(rProps, xProperties); + ScDocument* pDoc = GetDocument(); + sal_Int32 nPropsToAdd = 0; OUStringBuffer aTrackedChangesKey; - if (mpDoc && mpDoc->GetChangeTrack() && mpDoc->GetChangeTrack()->IsProtected()) + if (pDoc && pDoc->GetChangeTrack() && pDoc->GetChangeTrack()->IsProtected()) { ::comphelper::Base64::encode(aTrackedChangesKey, - mpDoc->GetChangeTrack()->GetProtection()); + pDoc->GetChangeTrack()->GetProtection()); if (!aTrackedChangesKey.isEmpty()) ++nPropsToAdd; } bool bVBACompat = false; uno::Reference xCodeNameAccess; - OSL_ENSURE( mpDoc, "ScXMLExport::GetConfigurationSettings - no ScDocument!" ); + OSL_ENSURE( pDoc, "ScXMLExport::GetConfigurationSettings - no ScDocument!" ); // tdf#71271 - add code names regardless of VBA compatibility mode - if (mpDoc) + if (pDoc) { // VBA compatibility mode - if (bVBACompat = mpDoc->IsInVBAMode(); bVBACompat) + if (bVBACompat = pDoc->IsInVBAMode(); bVBACompat) ++nPropsToAdd; // code names - xCodeNameAccess = new XMLCodeNameProvider( mpDoc ); + xCodeNameAccess = new XMLCodeNameProvider( pDoc ); if( xCodeNameAccess->hasElements() ) ++nPropsToAdd; else @@ -5436,25 +5424,23 @@ ErrCode ScXMLExport::exportDoc( enum XMLTokenEnum eClass ) if( getExportFlags() & (SvXMLExportFlags::FONTDECLS|SvXMLExportFlags::STYLES| SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::CONTENT) ) { - if (mpDoc) + uno::Reference< frame::XModel > xModel = GetModel(); + if (ScDocument* pDoc = GetDocument()) { // if source doc was Excel then - uno::Reference< frame::XModel > xModel = GetModel(); - if ( xModel.is() ) + auto pFoundShell = comphelper::getFromUnoTunnel(xModel); + if ( pFoundShell && ooo::vba::isAlienExcelDoc( *pFoundShell ) ) { - auto pFoundShell = comphelper::getFromUnoTunnel(xModel); - if ( pFoundShell && ooo::vba::isAlienExcelDoc( *pFoundShell ) ) - { - xRowStylesPropertySetMapper = new XMLPropertySetMapper(aXMLScFromXLSRowStylesProperties, xScPropHdlFactory, true); - xRowStylesExportPropertySetMapper = new ScXMLRowExportPropertyMapper(xRowStylesPropertySetMapper); - GetAutoStylePool()->SetFamilyPropSetMapper( XmlStyleFamily::TABLE_ROW, - xRowStylesExportPropertySetMapper ); - } + xRowStylesPropertySetMapper = new XMLPropertySetMapper(aXMLScFromXLSRowStylesProperties, xScPropHdlFactory, true); + xRowStylesExportPropertySetMapper = new ScXMLRowExportPropertyMapper(xRowStylesPropertySetMapper); + GetAutoStylePool()->SetFamilyPropSetMapper( XmlStyleFamily::TABLE_ROW, + xRowStylesExportPropertySetMapper ); } - CollectUserDefinedNamespaces(mpDoc->GetPool(), ATTR_USERDEF); - CollectUserDefinedNamespaces(mpDoc->GetEditPool(), EE_PARA_XMLATTRIBS); - CollectUserDefinedNamespaces(mpDoc->GetEditPool(), EE_CHAR_XMLATTRIBS); - ScDrawLayer* pDrawLayer = mpDoc->GetDrawLayer(); + + CollectUserDefinedNamespaces(pDoc->GetPool(), ATTR_USERDEF); + CollectUserDefinedNamespaces(pDoc->GetEditPool(), EE_PARA_XMLATTRIBS); + CollectUserDefinedNamespaces(pDoc->GetEditPool(), EE_CHAR_XMLATTRIBS); + ScDrawLayer* pDrawLayer = pDoc->GetDrawLayer(); if (pDrawLayer) { CollectUserDefinedNamespaces(&pDrawLayer->GetItemPool(), EE_PARA_XMLATTRIBS); @@ -5467,9 +5453,9 @@ ErrCode ScXMLExport::exportDoc( enum XMLTokenEnum eClass ) getSaneDefaultVersion() >= SvtSaveOptions::ODFSVER_012) { bool bAnySheetEvents = false; - SCTAB nTabCount = mpDoc->GetTableCount(); + SCTAB nTabCount = pDoc->GetTableCount(); for (SCTAB nTab=0; nTabGetSheetEvents(nTab)) + if (pDoc->GetSheetEvents(nTab)) bAnySheetEvents = true; if (bAnySheetEvents) GetNamespaceMap_().Add( @@ -5488,13 +5474,13 @@ void SAL_CALL ScXMLExport::setSourceDocument( const uno::ReferenceSetStorageGrammar( formula::FormulaGrammar::GRAM_PODF); + pDoc->SetStorageGrammar( formula::FormulaGrammar::GRAM_PODF); break; default: - mpDoc->SetStorageGrammar( formula::FormulaGrammar::GRAM_ODFF); + pDoc->SetStorageGrammar( formula::FormulaGrammar::GRAM_ODFF); } } @@ -5515,19 +5501,20 @@ void SAL_CALL ScXMLExport::setSourceDocument( const uno::Reference& aDescriptor ) { SolarMutexGuard aGuard; - if (mpDoc) - mpDoc->EnableIdle(false); + ScDocument* pDoc = GetDocument(); + if (pDoc) + pDoc->EnableIdle(true); bool bReturn(SvXMLExport::filter(aDescriptor)); - if (mpDoc) - mpDoc->EnableIdle(true); + if (pDoc) + pDoc->EnableIdle(true); return bReturn; } void SAL_CALL ScXMLExport::cancel() { SolarMutexGuard aGuard; - if (mpDoc) - mpDoc->EnableIdle(true); + if (ScDocument* pDoc = GetDocument()) + pDoc->EnableIdle(true); SvXMLExport::cancel(); } @@ -5541,7 +5528,6 @@ void SAL_CALL ScXMLExport::initialize( const css::uno::Sequence< css::uno::Any > void ScXMLExport::DisposingModel() { SvXMLExport::DisposingModel(); - mpDoc = nullptr; xCurrentTable = nullptr; } diff --git a/sc/source/filter/xml/xmlexprt.hxx b/sc/source/filter/xml/xmlexprt.hxx index cb03a354cb59..d7ad2c726187 100644 --- a/sc/source/filter/xml/xmlexprt.hxx +++ b/sc/source/filter/xml/xmlexprt.hxx @@ -71,7 +71,6 @@ class CompileFormulaContext; class ScXMLExport : public SvXMLExport { - ScDocument* mpDoc; css::uno::Reference xCurrentTable; css::uno::Reference xSourceStream; @@ -138,11 +137,11 @@ class ScXMLExport : public SvXMLExport virtual void ExportContent_() override; virtual void ExportMeta_() override; - void CollectInternalShape( css::uno::Reference< css::drawing::XShape > const & xShape ); + void CollectInternalShape(ScDocument& rDoc, css::uno::Reference< css::drawing::XShape > const & xShape); static css::table::CellRangeAddress GetEndAddress(const css::uno::Reference& xTable); - ScMyAreaLinksContainer GetAreaLinks(); - ScMyDetectiveOpContainer GetDetectiveOpList(); + static ScMyAreaLinksContainer GetAreaLinks(ScDocument& rDoc); + ScMyDetectiveOpContainer GetDetectiveOpList(ScDocument& rDoc); void WriteSingleColumn(const sal_Int32 nRepeatColumns, const sal_Int32 nStyleIndex, const sal_Int32 nIndex, const bool bIsAutoStyle, const bool bIsVisible); void WriteColumn(const sal_Int32 nColumn, const sal_Int32 nRepeatColumns, @@ -150,9 +149,9 @@ class ScXMLExport : public SvXMLExport void OpenHeaderColumn(); void CloseHeaderColumn(); void ExportColumns(const sal_Int32 nTable, const ScRange& aColumnHeaderRange, const bool bHasColumnHeader); - void ExportExternalRefCacheStyles(); - void ExportCellTextAutoStyles(sal_Int32 nTable); - void ExportFormatRanges(const sal_Int32 nStartCol, const sal_Int32 nStartRow, + void ExportExternalRefCacheStyles(ScDocument& rDoc); + void ExportCellTextAutoStyles(ScDocument& rDoc, sal_Int32 nTable); + void ExportFormatRanges(ScDocument& rDoc, const sal_Int32 nStartCol, const sal_Int32 nStartRow, const sal_Int32 nEndCol, const sal_Int32 nEndRow, const sal_Int32 nSheet); void WriteRowContent(); void WriteRowStartTag(const sal_Int32 nIndex, const sal_Int32 nEmptyRows, bool bHidden, bool bFiltered); @@ -164,43 +163,43 @@ class ScXMLExport : public SvXMLExport bool bHidden, bool bFiltered); void OpenRow(const sal_Int32 nTable, const sal_Int32 nStartRow, const sal_Int32 nRepeatRow, ScXMLCachedRowAttrAccess& rRowAttr); void CloseRow(const sal_Int32 nRow); - void GetColumnRowHeader(bool& bHasColumnHeader, ScRange& aColumnHeaderRange, + void GetColumnRowHeader(ScDocument& rDoc, bool& bHasColumnHeader, ScRange& aColumnHeaderRange, bool& bHasRowHeader, ScRange& aRowHeaderRange, OUString& rPrintRanges) const; static void FillFieldGroup(ScOutlineArray* pFields, ScMyOpenCloseColumnRowGroup* pGroups); - void FillColumnRowGroups(); + void FillColumnRowGroups(ScDocument& rDoc); bool GetMerged (const css::table::CellRangeAddress* pCellRange, const css::uno::Reference & xTable); - void WriteTable(sal_Int32 nTable, const css::uno::Reference< css::sheet::XSpreadsheet>& xTable); - void WriteCell(ScMyCell& aCell, sal_Int32 nEqualCellCount); - void WriteEditCell(const EditTextObject* pText); + void WriteTable(ScDocument& rDoc, sal_Int32 nTable, const css::uno::Reference< css::sheet::XSpreadsheet>& xTable); + void WriteCell(ScDocument& rDoc, ScMyCell& aCell, sal_Int32 nEqualCellCount); + void WriteEditCell(ScDocument& rDoc, const EditTextObject* pText); void WriteMultiLineFormulaResult(const ScFormulaCell* pCell); void WriteAreaLink(const ScMyCell& rMyCell); - void WriteAnnotation(const ScMyCell& rMyCell); - void WriteDetective(const ScMyCell& rMyCell); - void ExportShape(const css::uno::Reference < css::drawing::XShape >& xShape, css::awt::Point* pPoint); - void WriteShapes(const ScMyCell& rMyCell); - void WriteTableShapes(); + void WriteAnnotation(ScDocument& rDoc, const ScMyCell& rMyCell); + void WriteDetective(ScDocument& rDoc, const ScMyCell& rMyCell); + void ExportShape(ScDocument& rDoc, const css::uno::Reference < css::drawing::XShape >& xShape, css::awt::Point* pPoint); + void WriteShapes(ScDocument& rDoc, const ScMyCell& rMyCell); + void WriteTableShapes(ScDocument& rDoc); void SetRepeatAttribute(sal_Int32 nEqualCellCount, bool bIncProgress); static bool IsEditCell(const ScMyCell& rCell); - bool IsCellEqual(const ScMyCell& aCell1, const ScMyCell& aCell2); + static bool IsCellEqual(ScDocument& rDoc, const ScMyCell& aCell1, const ScMyCell& aCell2); - void WriteCalculationSettings(const css::uno::Reference & xSpreadDoc); + void WriteCalculationSettings(ScDocument& rDoc, const css::uno::Reference & xSpreadDoc); void WriteTableSource(); - void WriteScenario(); // core implementation - void WriteTheLabelRanges(const css::uno::Reference< css::sheet::XSpreadsheetDocument >& xSpreadDoc); - void WriteLabelRanges( const css::uno::Reference< css::container::XIndexAccess >& xRangesIAccess, bool bColumn ); - void WriteNamedExpressions(); - void WriteExternalDataMapping(); - void WriteExternalDataTransformations(const std::vector>& aDataTransformations); - void WriteDataStream(); - void WriteNamedRange(ScRangeName* pRangeName); - void exportSparklineGroups(SCTAB nTab); - void ExportConditionalFormat(SCTAB nTab); - void WriteExternalRefCaches(); - void WriteConsolidation(); // core implementation + void WriteScenario(ScDocument& rDoc); // core implementation + void WriteTheLabelRanges(ScDocument& rDoc, const css::uno::Reference< css::sheet::XSpreadsheetDocument >& xSpreadDoc); + void WriteLabelRanges(ScDocument& rDoc, const css::uno::Reference< css::container::XIndexAccess >& xRangesIAccess, bool bColumn); + void WriteNamedExpressions(ScDocument& rDoc); + void WriteExternalDataMapping(ScDocument& rDoc); + void WriteExternalDataTransformations(ScDocument& rDoc, const std::vector>& rDataTransformations); + void WriteDataStream(ScDocument& rDoc); + void WriteNamedRange(ScDocument& rDoc, ScRangeName* pRangeName); + void exportSparklineGroups(ScDocument& rDoc, SCTAB nTab); + void ExportConditionalFormat(ScDocument& rDoc, SCTAB nTab); + void WriteExternalRefCaches(ScDocument& rDoc); + void WriteConsolidation(ScDocument& rDoc); // core implementation void CollectUserDefinedNamespaces(const SfxItemPool* pPool, sal_uInt16 nAttrib); @@ -238,17 +237,16 @@ public: void collectAutoStyles() override; static sal_Int16 GetMeasureUnit(); - SAL_RET_MAYBENULL ScDocument* GetDocument() { return mpDoc; } - SAL_RET_MAYBENULL const ScDocument* GetDocument() const { return mpDoc; } - bool IsMatrix (const ScAddress& aCell, - ScRange& aCellAddress, bool& bIsFirst) const; + SAL_RET_MAYBENULL ScDocument* GetDocument(); + static bool IsMatrix (ScDocument& rDoc, const ScAddress& aCell, + ScRange& aCellAddress, bool& bIsFirst); const rtl::Reference < XMLPropertySetMapper >& GetCellStylesPropertySetMapper() const { return xCellStylesPropertySetMapper; } const rtl::Reference < XMLPropertySetMapper >& GetTableStylesPropertySetMapper() const { return xTableStylesPropertySetMapper; } void SetSourceStream( const css::uno::Reference& xNewStream ); - void GetChangeTrackViewSettings(css::uno::Sequence& rProps); + static void GetChangeTrackViewSettings(ScDocument& rDoc, css::uno::Sequence& rProps); virtual void GetViewSettings(css::uno::Sequence& rProps) override; virtual void GetConfigurationSettings(css::uno::Sequence& rProps) override; diff --git a/sc/source/filter/xml/xmlfonte.cxx b/sc/source/filter/xml/xmlfonte.cxx index 48900a8d0807..46bf1f159bdb 100644 --- a/sc/source/filter/xml/xmlfonte.cxx +++ b/sc/source/filter/xml/xmlfonte.cxx @@ -41,7 +41,7 @@ private: void AddFontItems(const sal_uInt16* pWhichIds, sal_uInt8 nIdCount, const SfxItemPool* pItemPool, const bool bExportDefaults); public: - ScXMLFontAutoStylePool_Impl( ScXMLExport& rExport, bool bEmbedFonts); + ScXMLFontAutoStylePool_Impl(ScDocument* pDoc, ScXMLExport& rExport, bool bEmbedFonts); }; } @@ -71,10 +71,9 @@ void ScXMLFontAutoStylePool_Impl::AddFontItems(const sal_uInt16* pWhichIds, sal_ } } -ScXMLFontAutoStylePool_Impl::ScXMLFontAutoStylePool_Impl(ScXMLExport& rExportP, bool bEmbedFonts) +ScXMLFontAutoStylePool_Impl::ScXMLFontAutoStylePool_Impl(ScDocument* pDoc, ScXMLExport& rExportP, bool bEmbedFonts) : XMLFontAutoStylePool(rExportP, bEmbedFonts) { - ScDocument* pDoc = rExportP.GetDocument(); if (!pDoc) return; @@ -156,9 +155,10 @@ XMLFontAutoStylePool* ScXMLExport::CreateFontAutoStylePool() // the embedding only in one of them. if(!( getExportFlags() & SvXMLExportFlags::CONTENT )) blockFontEmbedding = true; - if (mpDoc && !mpDoc->IsEmbedFonts()) + ScDocument* pDoc = GetDocument(); + if (pDoc && !pDoc->IsEmbedFonts()) blockFontEmbedding = true; - return new ScXMLFontAutoStylePool_Impl( *this, !blockFontEmbedding ); + return new ScXMLFontAutoStylePool_Impl(pDoc, *this, !blockFontEmbedding); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/xml/xmlstyle.cxx b/sc/source/filter/xml/xmlstyle.cxx index 7ae12c462367..7f98e13be3f9 100644 --- a/sc/source/filter/xml/xmlstyle.cxx +++ b/sc/source/filter/xml/xmlstyle.cxx @@ -710,6 +710,8 @@ void ScXMLAutoStylePoolP::exportStyleContent( if (nFamily != XmlStyleFamily::TABLE_CELL) return; + ScDocument* pDoc = rScXMLExport.GetDocument(); + for(const auto& rProperty : rProperties) { if (rProperty.mnIndex != -1) @@ -743,7 +745,6 @@ void ScXMLAutoStylePoolP::exportStyleContent( rScXMLExport.AddAttribute(XML_NAMESPACE_STYLE, XML_CONDITION, sCondition); rScXMLExport.AddAttribute(XML_NAMESPACE_STYLE, XML_APPLY_STYLE_NAME, rScXMLExport.EncodeStyleName( sStyleName )); OUString sOUBaseAddress; - ScDocument* pDoc = rScXMLExport.GetDocument(); ScRangeStringConverter::GetStringFromAddress( sOUBaseAddress, xSheetCondition->getSourcePosition(), pDoc, FormulaGrammar::CONV_OOO ); rScXMLExport.AddAttribute(XML_NAMESPACE_STYLE, XML_BASE_CELL_ADDRESS, sOUBaseAddress); @@ -798,7 +799,7 @@ void ScXMLAutoStylePoolP::exportStyleContent( rScXMLExport.AddAttribute(XML_NAMESPACE_STYLE, XML_APPLY_STYLE_NAME, rScXMLExport.EncodeStyleName( sStyleName )); OUString sOUBaseAddress; ScRangeStringConverter::GetStringFromAddress( sOUBaseAddress, - xSheetCondition->getSourcePosition(), rScXMLExport.GetDocument(), FormulaGrammar::CONV_OOO ); + xSheetCondition->getSourcePosition(), pDoc, FormulaGrammar::CONV_OOO ); rScXMLExport.AddAttribute(XML_NAMESPACE_STYLE, XML_BASE_CELL_ADDRESS, sOUBaseAddress); SvXMLElementExport aMElem(rScXMLExport, XML_NAMESPACE_STYLE, XML_MAP, true, true); } diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx index cd66538719b1..23727ebe9677 100644 --- a/sc/source/ui/cctrl/checklistmenu.cxx +++ b/sc/source/ui/cctrl/checklistmenu.cxx @@ -644,7 +644,7 @@ ScCheckListMenuControl::ScCheckListMenuControl(weld::Widget* pParent, ScViewData mxButtonBox->show(); mxMenu->connect_row_activated(LINK(this, ScCheckListMenuControl, RowActivatedHdl)); - mxMenu->connect_changed(LINK(this, ScCheckListMenuControl, SelectHdl)); + mxMenu->connect_selection_changed(LINK(this, ScCheckListMenuControl, SelectHdl)); mxMenu->connect_key_press(LINK(this, ScCheckListMenuControl, MenuKeyInputHdl)); mxBtnOk->connect_clicked(LINK(this, ScCheckListMenuControl, ButtonHdl)); @@ -1743,10 +1743,12 @@ ScListSubMenuControl::ScListSubMenuControl(weld::Widget* pParent, ScCheckListMen { mxBackColorMenu->set_clicks_to_toggle(1); mxBackColorMenu->enable_toggle_buttons(weld::ColumnToggleType::Radio); - mxBackColorMenu->connect_changed(LINK(this, ScListSubMenuControl, ColorSelChangedHdl)); + mxBackColorMenu->connect_selection_changed( + LINK(this, ScListSubMenuControl, ColorSelChangedHdl)); mxTextColorMenu->set_clicks_to_toggle(1); mxTextColorMenu->enable_toggle_buttons(weld::ColumnToggleType::Radio); - mxTextColorMenu->connect_changed(LINK(this, ScListSubMenuControl, ColorSelChangedHdl)); + mxTextColorMenu->connect_selection_changed( + LINK(this, ScListSubMenuControl, ColorSelChangedHdl)); SetupMenu(*mxBackColorMenu); SetupMenu(*mxTextColorMenu); } diff --git a/sc/source/ui/condformat/condformatdlgdata.cxx b/sc/source/ui/condformat/condformatdlgdata.cxx index 89cd51b41abb..024bd8d9bd9a 100644 --- a/sc/source/ui/condformat/condformatdlgdata.cxx +++ b/sc/source/ui/condformat/condformatdlgdata.cxx @@ -14,7 +14,7 @@ #include ScCondFormatDlgData::ScCondFormatDlgData(std::shared_ptr pCondFormats, - sal_Int32 nItem, bool bManaged): + sal_uInt32 nItem, bool bManaged): mpCondFormats(std::move(pCondFormats)), mnItem(nItem), meDialogType(condformat::dialog::CONDITION), @@ -32,7 +32,7 @@ condformat::dialog::ScCondFormatDialogType ScCondFormatDlgData::GetDialogType() return meDialogType; } -sal_Int32 ScCondFormatDlgData::GetIndex() const +sal_uInt32 ScCondFormatDlgData::GetIndex() const { return mnItem; } diff --git a/sc/source/ui/dbgui/consdlg.cxx b/sc/source/ui/dbgui/consdlg.cxx index 22911ed16f6f..09d0dea25ca2 100644 --- a/sc/source/ui/dbgui/consdlg.cxx +++ b/sc/source/ui/dbgui/consdlg.cxx @@ -123,7 +123,7 @@ void ScConsolidateDlg::Init() m_xLbDestArea->connect_focus_in( LINK( this, ScConsolidateDlg, GetFocusHdl ) ); m_xEdDataArea->SetModifyHdl( LINK( this, ScConsolidateDlg, ModifyHdl ) ); m_xEdDestArea->SetModifyHdl( LINK( this, ScConsolidateDlg, ModifyHdl ) ); - m_xLbConsAreas->connect_changed( LINK( this, ScConsolidateDlg, SelectTVHdl ) ); + m_xLbConsAreas->connect_selection_changed(LINK(this, ScConsolidateDlg, SelectTVHdl)); m_xLbDataArea->connect_changed( LINK( this, ScConsolidateDlg, SelectCBHdl ) ); m_xLbDestArea->connect_changed( LINK( this, ScConsolidateDlg, SelectCBHdl ) ); m_xBtnOk->connect_clicked( LINK( this, ScConsolidateDlg, OkHdl ) ); diff --git a/sc/source/ui/dbgui/tpsubt.cxx b/sc/source/ui/dbgui/tpsubt.cxx index f911292c08f7..6acfabef6fa6 100644 --- a/sc/source/ui/dbgui/tpsubt.cxx +++ b/sc/source/ui/dbgui/tpsubt.cxx @@ -82,9 +82,9 @@ void ScTpSubTotalGroup::Init() assert(pDoc && "Document not found :-("); mxLbGroup->connect_changed( LINK( this, ScTpSubTotalGroup, SelectListBoxHdl ) ); - mxLbColumns->connect_changed( LINK( this, ScTpSubTotalGroup, SelectTreeListBoxHdl ) ); + mxLbColumns->connect_selection_changed(LINK(this, ScTpSubTotalGroup, SelectTreeListBoxHdl)); mxLbColumns->connect_toggled( LINK( this, ScTpSubTotalGroup, CheckHdl ) ); - mxLbFunctions->connect_changed( LINK( this, ScTpSubTotalGroup, SelectTreeListBoxHdl) ); + mxLbFunctions->connect_selection_changed(LINK(this, ScTpSubTotalGroup, SelectTreeListBoxHdl)); mxLbSelectAllColumns->connect_toggled( LINK( this, ScTpSubTotalGroup, CheckBoxHdl ) ); mnFieldArr.resize(SC_MAXFIELDS(pDoc->GetSheetLimits())); diff --git a/sc/source/ui/dialogs/searchresults.cxx b/sc/source/ui/dialogs/searchresults.cxx index 4650ce711797..3f37e26458fd 100644 --- a/sc/source/ui/dialogs/searchresults.cxx +++ b/sc/source/ui/dialogs/searchresults.cxx @@ -40,7 +40,7 @@ SearchResultsDlg::SearchResultsDlg(SfxBindings* _pBindings, weld::Window* pParen o3tl::narrowing(mxList->get_approximate_digit_width() * 10) }; mxList->set_column_fixed_widths(aWidths); - mxList->connect_changed(LINK(this, SearchResultsDlg, ListSelectHdl)); + mxList->connect_selection_changed(LINK(this, SearchResultsDlg, ListSelectHdl)); mxList->connect_column_clicked(LINK(this, SearchResultsDlg, HeaderBarClick)); } diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index d94763e9baba..e745b922315e 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -555,9 +555,8 @@ static void lcl_collectAllPredOrSuccRanges( return; ScRange const & rFrontRange = rSrcRanges.front(); ScDetectiveFunc aDetFunc(rDoc, rFrontRange.aStart.Tab()); - for (size_t i = 0, n = rSrcRanges.size(); i < n; ++i) + for (ScRange const & r : rSrcRanges) { - ScRange const & r = rSrcRanges[i]; if (bPred) { aDetFunc.GetAllPreds( diff --git a/sc/source/ui/formdlg/dwfunctr.cxx b/sc/source/ui/formdlg/dwfunctr.cxx index 46baa84adf69..3345e1f83f95 100644 --- a/sc/source/ui/formdlg/dwfunctr.cxx +++ b/sc/source/ui/formdlg/dwfunctr.cxx @@ -76,7 +76,7 @@ ScFunctionWin::ScFunctionWin(weld::Widget* pParent) m_xSearchString->connect_key_press(LINK(this, ScFunctionWin, KeyInputHdl)); xCatBox->connect_changed(LINK( this, ScFunctionWin, SelComboHdl)); - xFuncList->connect_changed(LINK( this, ScFunctionWin, SelTreeHdl)); + xFuncList->connect_selection_changed(LINK(this, ScFunctionWin, SelTreeHdl)); xFuncList->connect_row_activated(LINK( this, ScFunctionWin, SetRowActivatedHdl)); xInsertButton->connect_clicked(LINK( this, ScFunctionWin, SetSelectionClickHdl)); diff --git a/sc/source/ui/inc/condformatdlg.hxx b/sc/source/ui/inc/condformatdlg.hxx index 1946196b5028..19b2322bdcaa 100644 --- a/sc/source/ui/inc/condformatdlg.hxx +++ b/sc/source/ui/inc/condformatdlg.hxx @@ -78,7 +78,7 @@ public: class ScCondFormatDlg : public ScAnyRefDlgController { private: - sal_Int32 mnKey; + sal_uInt32 mnKey; ScAddress maPos; ScViewData* mpViewData; diff --git a/sc/source/ui/inc/condformatdlgdata.hxx b/sc/source/ui/inc/condformatdlgdata.hxx index bbee525b3bdd..31d42265601c 100644 --- a/sc/source/ui/inc/condformatdlgdata.hxx +++ b/sc/source/ui/inc/condformatdlgdata.hxx @@ -30,7 +30,7 @@ class ScConditionalFormatList; class ScCondFormatDlgData { public: - ScCondFormatDlgData(std::shared_ptr pCondFormats, sal_Int32 nItem, + ScCondFormatDlgData(std::shared_ptr pCondFormats, sal_uInt32 nItem, bool bManaged); ScCondFormatDlgData(ScCondFormatDlgData const&) = default; @@ -38,7 +38,7 @@ public: bool IsManaged() const; condformat::dialog::ScCondFormatDialogType GetDialogType() const; - sal_Int32 GetIndex() const; + sal_uInt32 GetIndex() const; void SetDialogType(condformat::dialog::ScCondFormatDialogType eType); @@ -46,7 +46,7 @@ public: private: std::shared_ptr mpCondFormats; - sal_Int32 mnItem; + sal_uInt32 mnItem; condformat::dialog::ScCondFormatDialogType meDialogType; bool mbManaged; }; diff --git a/sc/source/ui/inc/namemgrtable.hxx b/sc/source/ui/inc/namemgrtable.hxx index 347fbac3db69..34f46bbc1a17 100644 --- a/sc/source/ui/inc/namemgrtable.hxx +++ b/sc/source/ui/inc/namemgrtable.hxx @@ -61,7 +61,10 @@ public: void CheckForFormulaString(); int n_children() const { return m_xTreeView->n_children(); } - void connect_changed(const Link& rLink) { m_xTreeView->connect_changed(rLink); } + void connect_changed(const Link& rLink) + { + m_xTreeView->connect_selection_changed(rLink); + } void set_cursor(int nPos) { m_xTreeView->set_cursor(nPos); } void addEntry(const ScRangeNameLine& rLine, bool bSetCurEntry); diff --git a/sc/source/ui/miscdlgs/acredlin.cxx b/sc/source/ui/miscdlgs/acredlin.cxx index 9a14f39a57ca..66f1b4a1a830 100644 --- a/sc/source/ui/miscdlgs/acredlin.cxx +++ b/sc/source/ui/miscdlgs/acredlin.cxx @@ -126,7 +126,7 @@ ScAcceptChgDlg::ScAcceptChgDlg(SfxBindings* pB, SfxChildWindow* pCW, weld::Windo weld::TreeView& rTreeView = pTheView->GetWidget(); rTreeView.connect_expanding(LINK(this, ScAcceptChgDlg, ExpandingHandle)); - rTreeView.connect_changed(LINK(this, ScAcceptChgDlg, SelectHandle)); + rTreeView.connect_selection_changed(LINK(this, ScAcceptChgDlg, SelectHandle)); rTreeView.connect_popup_menu(LINK(this, ScAcceptChgDlg, CommandHdl)); rTreeView.set_sort_func([this](const weld::TreeIter& rLeft, const weld::TreeIter& rRight){ return ColCompareHdl(rLeft, rRight); diff --git a/sc/source/ui/miscdlgs/conflictsdlg.cxx b/sc/source/ui/miscdlgs/conflictsdlg.cxx index 6e20e04e0414..524b887816da 100644 --- a/sc/source/ui/miscdlgs/conflictsdlg.cxx +++ b/sc/source/ui/miscdlgs/conflictsdlg.cxx @@ -361,7 +361,7 @@ ScConflictsDlg::ScConflictsDlg(weld::Window* pParent, ScViewData* pViewData, ScD maSelectionIdle.SetInvokeHandler( LINK( this, ScConflictsDlg, UpdateSelectionHdl ) ); - rTreeView.connect_changed(LINK(this, ScConflictsDlg, SelectHandle)); + rTreeView.connect_selection_changed(LINK(this, ScConflictsDlg, SelectHandle)); m_xBtnKeepMine->connect_clicked( LINK( this, ScConflictsDlg, KeepMineHandle ) ); m_xBtnKeepOther->connect_clicked( LINK( this, ScConflictsDlg, KeepOtherHandle ) ); diff --git a/sc/source/ui/miscdlgs/crnrdlg.cxx b/sc/source/ui/miscdlgs/crnrdlg.cxx index c59c8d50122c..9020962ff419 100644 --- a/sc/source/ui/miscdlgs/crnrdlg.cxx +++ b/sc/source/ui/miscdlgs/crnrdlg.cxx @@ -101,7 +101,7 @@ void ScColRowNameRangesDlg::Init() m_xBtnCancel->connect_clicked ( LINK( this, ScColRowNameRangesDlg, CancelBtnHdl ) ); m_xBtnAdd->connect_clicked ( LINK( this, ScColRowNameRangesDlg, AddBtnHdl ) ); m_xBtnRemove->connect_clicked ( LINK( this, ScColRowNameRangesDlg, RemoveBtnHdl ) ); - m_xLbRange->connect_changed( LINK( this, ScColRowNameRangesDlg, Range1SelectHdl ) ); + m_xLbRange->connect_selection_changed(LINK(this, ScColRowNameRangesDlg, Range1SelectHdl)); m_xEdAssign->SetModifyHdl ( LINK( this, ScColRowNameRangesDlg, Range1DataModifyHdl ) ); m_xBtnColHead->connect_toggled ( LINK( this, ScColRowNameRangesDlg, ColRowToggleHdl ) ); m_xEdAssign2->SetModifyHdl ( LINK( this, ScColRowNameRangesDlg, Range2DataModifyHdl ) ); diff --git a/sc/source/ui/miscdlgs/instbdlg.cxx b/sc/source/ui/miscdlgs/instbdlg.cxx index 8e34c44a4e7f..3dfa986be326 100644 --- a/sc/source/ui/miscdlgs/instbdlg.cxx +++ b/sc/source/ui/miscdlgs/instbdlg.cxx @@ -72,7 +72,7 @@ void ScInsertTableDlg::Init_Impl( bool bFromFile ) m_xBtnBrowse->connect_clicked( LINK( this, ScInsertTableDlg, BrowseHdl_Impl ) ); m_xBtnNew->connect_toggled( LINK( this, ScInsertTableDlg, ChoiceHdl_Impl ) ); m_xBtnFromFile->connect_toggled( LINK( this, ScInsertTableDlg, ChoiceHdl_Impl ) ); - m_xLbTables->connect_changed( LINK( this, ScInsertTableDlg, SelectHdl_Impl ) ); + m_xLbTables->connect_selection_changed(LINK(this, ScInsertTableDlg, SelectHdl_Impl)); m_xNfCount->connect_value_changed( LINK( this, ScInsertTableDlg, CountHdl_Impl)); m_xBtnOk->connect_clicked( LINK( this, ScInsertTableDlg, DoEnterHdl )); m_xBtnBefore->set_active(true); diff --git a/sc/source/ui/miscdlgs/linkarea.cxx b/sc/source/ui/miscdlgs/linkarea.cxx index e265e97007ad..ca559e626aff 100644 --- a/sc/source/ui/miscdlgs/linkarea.cxx +++ b/sc/source/ui/miscdlgs/linkarea.cxx @@ -50,7 +50,7 @@ ScLinkedAreaDlg::ScLinkedAreaDlg(weld::Widget* pParent) m_xCbUrl->connect_entry_activate(LINK(this, ScLinkedAreaDlg, FileHdl)); m_xBtnBrowse->connect_clicked(LINK( this, ScLinkedAreaDlg, BrowseHdl)); - m_xLbRanges->connect_changed(LINK( this, ScLinkedAreaDlg, RangeHdl)); + m_xLbRanges->connect_selection_changed(LINK(this, ScLinkedAreaDlg, RangeHdl)); m_xLbRanges->set_size_request(m_xLbRanges->get_approximate_digit_width() * 54, m_xLbRanges->get_height_rows(5)); m_xBtnReload->connect_toggled(LINK( this, ScLinkedAreaDlg, ReloadHdl)); diff --git a/sc/source/ui/miscdlgs/scuiautofmt.cxx b/sc/source/ui/miscdlgs/scuiautofmt.cxx index c64373b1dcf2..94e38ee77fd1 100644 --- a/sc/source/ui/miscdlgs/scuiautofmt.cxx +++ b/sc/source/ui/miscdlgs/scuiautofmt.cxx @@ -82,7 +82,7 @@ ScAutoFormatDlg::~ScAutoFormatDlg() void ScAutoFormatDlg::Init() { - m_xLbFormat->connect_changed( LINK( this, ScAutoFormatDlg, SelFmtHdl ) ); + m_xLbFormat->connect_selection_changed(LINK(this, ScAutoFormatDlg, SelFmtHdl)); m_xBtnNumFormat->connect_toggled( LINK( this, ScAutoFormatDlg, CheckHdl ) ); m_xBtnBorder->connect_toggled( LINK( this, ScAutoFormatDlg, CheckHdl ) ); m_xBtnFont->connect_toggled( LINK( this, ScAutoFormatDlg, CheckHdl ) ); diff --git a/sc/source/ui/miscdlgs/solveroptions.cxx b/sc/source/ui/miscdlgs/solveroptions.cxx index 014a7632ea49..e0ea86b1a147 100644 --- a/sc/source/ui/miscdlgs/solveroptions.cxx +++ b/sc/source/ui/miscdlgs/solveroptions.cxx @@ -77,7 +77,7 @@ ScSolverOptionsDialog::ScSolverOptionsDialog(weld::Window* pParent, m_xBtnEdit->connect_clicked( LINK( this, ScSolverOptionsDialog, ButtonHdl ) ); - m_xLbSettings->connect_changed( LINK( this, ScSolverOptionsDialog, SettingsSelHdl ) ); + m_xLbSettings->connect_selection_changed(LINK(this, ScSolverOptionsDialog, SettingsSelHdl)); m_xLbSettings->connect_row_activated( LINK( this, ScSolverOptionsDialog, SettingsDoubleClickHdl ) ); sal_Int32 nSelect = -1; diff --git a/sc/source/ui/navipi/scenwnd.cxx b/sc/source/ui/navipi/scenwnd.cxx index 0b6b6b46bf88..eb62a7d5b6bc 100644 --- a/sc/source/ui/navipi/scenwnd.cxx +++ b/sc/source/ui/navipi/scenwnd.cxx @@ -195,7 +195,7 @@ ScScenarioWindow::ScScenarioWindow(weld::Builder& rBuilder, const OUString& aQH_ m_xLbScenario->set_tooltip_text(aQH_List); m_xEdComment->set_tooltip_text(aQH_Comment); - m_xLbScenario->connect_changed(LINK(this, ScScenarioWindow, SelectHdl)); + m_xLbScenario->connect_selection_changed(LINK(this, ScScenarioWindow, SelectHdl)); m_xLbScenario->connect_row_activated(LINK(this, ScScenarioWindow, DoubleClickHdl)); m_xLbScenario->connect_key_press(LINK(this, ScScenarioWindow, KeyInputHdl)); m_xLbScenario->connect_popup_menu(LINK(this, ScScenarioWindow, ContextMenuHdl)); diff --git a/sc/source/ui/optdlg/tpusrlst.cxx b/sc/source/ui/optdlg/tpusrlst.cxx index 3ee897edc2fd..bb7c8a5fe581 100644 --- a/sc/source/ui/optdlg/tpusrlst.cxx +++ b/sc/source/ui/optdlg/tpusrlst.cxx @@ -89,7 +89,7 @@ void ScTpUserLists::Init() SfxViewShell* pSh = SfxViewShell::Current(); ScTabViewShell* pViewSh = dynamic_cast( pSh ); - mxLbLists->connect_changed ( LINK( this, ScTpUserLists, LbSelectHdl ) ); + mxLbLists->connect_selection_changed(LINK(this, ScTpUserLists, LbSelectHdl)); mxBtnNew->connect_clicked ( LINK( this, ScTpUserLists, BtnClickHdl ) ); mxBtnDiscard->connect_clicked ( LINK( this, ScTpUserLists, BtnClickHdl ) ); mxBtnAdd->connect_clicked ( LINK( this, ScTpUserLists, BtnClickHdl ) ); diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx index 29f437e77529..5bacf8a856b8 100644 --- a/sc/source/ui/unoobj/cellsuno.cxx +++ b/sc/source/ui/unoobj/cellsuno.cxx @@ -3927,7 +3927,7 @@ sal_Int32 SAL_CALL ScCellRangesBase::replaceAll( const uno::Reference(this), - static_cast(this), - static_cast(this), - static_cast(static_cast(this)), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this)); - if ( aReturn.hasValue() ) - return aReturn; - - return ScCellRangesBase::queryInterface( rType ); -} - -void SAL_CALL ScCellRangesObj::acquire() noexcept -{ - ScCellRangesBase::acquire(); -} - -void SAL_CALL ScCellRangesObj::release() noexcept -{ - ScCellRangesBase::release(); -} - -uno::Sequence SAL_CALL ScCellRangesObj::getTypes() -{ - static const uno::Sequence aTypes = comphelper::concatSequences( - ScCellRangesBase::getTypes(), - uno::Sequence - { - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get() - } ); - return aTypes; -} - -uno::Sequence SAL_CALL ScCellRangesObj::getImplementationId() -{ - return css::uno::Sequence(); -} - // XCellRanges rtl::Reference ScCellRangesObj::GetObjectByIndex_Impl(sal_Int32 nIndex) const @@ -4490,7 +4445,7 @@ uno::Reference ScCellRangeObj::CreateRangeFromDoc( const ScDo } ScCellRangeObj::ScCellRangeObj(ScDocShell* pDocSh, const ScRange& rR) : - ScCellRangesBase( pDocSh, rR ), + ScCellRangeObj_BASE( pDocSh, rR ), pRangePropSet( lcl_GetRangePropertySet() ), aRange( rR ) { @@ -4515,76 +4470,6 @@ void ScCellRangeObj::RefChanged() } } -uno::Any SAL_CALL ScCellRangeObj::queryInterface( const uno::Type& rType ) -{ - uno::Any aReturn = ::cppu::queryInterface(rType, - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this)); - if ( aReturn.hasValue() ) - return aReturn; - - return ScCellRangesBase::queryInterface( rType ); -} - -void SAL_CALL ScCellRangeObj::acquire() noexcept -{ - ScCellRangesBase::acquire(); -} - -void SAL_CALL ScCellRangeObj::release() noexcept -{ - ScCellRangesBase::release(); -} - -uno::Sequence SAL_CALL ScCellRangeObj::getTypes() -{ - static const uno::Sequence aTypes = comphelper::concatSequences( - ScCellRangesBase::getTypes(), - uno::Sequence - { - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get() - } ); - return aTypes; -} - -uno::Sequence SAL_CALL ScCellRangeObj::getImplementationId() -{ - return css::uno::Sequence(); -} - // XCellRange // ColumnCount / RowCount vanished @@ -5713,7 +5598,7 @@ const SfxItemPropertyMap& ScCellObj::GetCellPropertyMap() } ScCellObj::ScCellObj(ScDocShell* pDocSh, const ScAddress& rP) : - ScCellRangeObj( pDocSh, ScRange(rP,rP) ), + ScCellObj_BASE( pDocSh, ScRange(rP,rP) ), pCellPropSet( lcl_GetCellPropertySet() ), aCellPos( rP ), nActionLockCount( 0 ) @@ -5754,61 +5639,6 @@ void ScCellObj::RefChanged() } } -uno::Any SAL_CALL ScCellObj::queryInterface( const uno::Type& rType ) -{ - uno::Any aReturn = ::cppu::queryInterface(rType, - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this)); - if ( aReturn.hasValue() ) - return aReturn; - - return ScCellRangeObj::queryInterface( rType ); -} - -void SAL_CALL ScCellObj::acquire() noexcept -{ - ScCellRangeObj::acquire(); -} - -void SAL_CALL ScCellObj::release() noexcept -{ - ScCellRangeObj::release(); -} - -uno::Sequence SAL_CALL ScCellObj::getTypes() -{ - static const uno::Sequence aTypes = comphelper::concatSequences( - ScCellRangeObj::getTypes(), - uno::Sequence - { - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get() - } ); - return aTypes; -} - -uno::Sequence SAL_CALL ScCellObj::getImplementationId() -{ - return css::uno::Sequence(); -} - // helper methods OUString ScCellObj::GetInputString_Impl(bool bEnglish) const // for getFormula / FormulaLocal @@ -6496,7 +6326,7 @@ static ScRange MaxDocRange(ScDocShell* pDocSh, SCTAB nTab) } ScTableSheetObj::ScTableSheetObj( ScDocShell* pDocSh, SCTAB nTab ) : - ScCellRangeObj( pDocSh, MaxDocRange(pDocSh, nTab) ), + ScTableSheetObj_BASE( pDocSh, MaxDocRange(pDocSh, nTab) ), pSheetPropSet(lcl_GetSheetPropertySet()) { } @@ -6511,78 +6341,6 @@ void ScTableSheetObj::InitInsertSheet(ScDocShell* pDocSh, SCTAB nTab) InitInsertRange( pDocSh, ScRange(0,0,nTab, rDoc.MaxCol(),rDoc.MaxRow(),nTab) ); } -uno::Any SAL_CALL ScTableSheetObj::queryInterface( const uno::Type& rType ) -{ - uno::Any aReturn = ::cppu::queryInterface(rType, - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this)); - if ( aReturn.hasValue() ) - return aReturn; - - return ScCellRangeObj::queryInterface( rType ); -} - -void SAL_CALL ScTableSheetObj::acquire() noexcept -{ - ScCellRangeObj::acquire(); -} - -void SAL_CALL ScTableSheetObj::release() noexcept -{ - ScCellRangeObj::release(); -} - -uno::Sequence SAL_CALL ScTableSheetObj::getTypes() -{ - static const uno::Sequence aTypes = comphelper::concatSequences( - ScCellRangeObj::getTypes(), - uno::Sequence - { - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get() - } ); - return aTypes; -} - -uno::Sequence SAL_CALL ScTableSheetObj::getImplementationId() -{ - return css::uno::Sequence(); -} - // Helper functions SCTAB ScTableSheetObj::GetTab_Impl() const @@ -8247,7 +8005,7 @@ uno::Sequence SAL_CALL ScTableSheetObj::getSupportedServiceNames() } ScTableColumnObj::ScTableColumnObj( ScDocShell* pDocSh, SCCOL nCol, SCTAB nTab ) : - ScCellRangeObj( pDocSh, ScRange(nCol,0,nTab, nCol, pDocSh->GetDocument().MaxRow(),nTab) ), + ScTableColumnObj_BASE( pDocSh, ScRange(nCol,0,nTab, nCol, pDocSh->GetDocument().MaxRow(),nTab) ), pColPropSet(lcl_GetColumnPropertySet()) { } @@ -8256,38 +8014,6 @@ ScTableColumnObj::~ScTableColumnObj() { } -uno::Any SAL_CALL ScTableColumnObj::queryInterface( const uno::Type& rType ) -{ - uno::Any aReturn = ::cppu::queryInterface(rType, - static_cast(this)); - if ( aReturn.hasValue() ) - return aReturn; - - return ScCellRangeObj::queryInterface( rType ); -} - -void SAL_CALL ScTableColumnObj::acquire() noexcept -{ - ScCellRangeObj::acquire(); -} - -void SAL_CALL ScTableColumnObj::release() noexcept -{ - ScCellRangeObj::release(); -} - -uno::Sequence SAL_CALL ScTableColumnObj::getTypes() -{ - return comphelper::concatSequences( - ScCellRangeObj::getTypes(), - uno::Sequence { cppu::UnoType::get() } ); -} - -uno::Sequence SAL_CALL ScTableColumnObj::getImplementationId() -{ - return css::uno::Sequence(); -} - // XNamed OUString SAL_CALL ScTableColumnObj::getName() diff --git a/sc/source/ui/unoobj/cursuno.cxx b/sc/source/ui/unoobj/cursuno.cxx index 60744f720be6..76e41d024b0e 100644 --- a/sc/source/ui/unoobj/cursuno.cxx +++ b/sc/source/ui/unoobj/cursuno.cxx @@ -32,7 +32,7 @@ constexpr OUString SCSHEETCELLCURSOR_SERVICE = u"com.sun.star.sheet.SheetCellCur constexpr OUString SCCELLCURSOR_SERVICE = u"com.sun.star.table.CellCursor"_ustr; ScCellCursorObj::ScCellCursorObj(ScDocShell* pDocSh, const ScRange& rR) : - ScCellRangeObj( pDocSh, rR ) + ScCellCursorObj_BASE( pDocSh, rR ) { } @@ -40,45 +40,6 @@ ScCellCursorObj::~ScCellCursorObj() { } -uno::Any SAL_CALL ScCellCursorObj::queryInterface( const uno::Type& rType ) -{ - uno::Any aReturn = ::cppu::queryInterface(rType, - static_cast(this), - static_cast(this), - static_cast(this)); - if ( aReturn.hasValue() ) - return aReturn; - - return ScCellRangeObj::queryInterface( rType ); -} - -void SAL_CALL ScCellCursorObj::acquire() noexcept -{ - ScCellRangeObj::acquire(); -} - -void SAL_CALL ScCellCursorObj::release() noexcept -{ - ScCellRangeObj::release(); -} - -uno::Sequence SAL_CALL ScCellCursorObj::getTypes() -{ - return comphelper::concatSequences( - ScCellRangeObj::getTypes(), - uno::Sequence - { - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get() - } ); -} - -uno::Sequence SAL_CALL ScCellCursorObj::getImplementationId() -{ - return css::uno::Sequence(); -} - // XSheetCellCursor void SAL_CALL ScCellCursorObj::collapseToCurrentRegion() diff --git a/sc/source/ui/vba/vbaaxistitle.cxx b/sc/source/ui/vba/vbaaxistitle.cxx index c35166cdc56c..7bf277ff5d5b 100644 --- a/sc/source/ui/vba/vbaaxistitle.cxx +++ b/sc/source/ui/vba/vbaaxistitle.cxx @@ -37,7 +37,7 @@ ScVbaAxisTitle::getServiceNames() { static uno::Sequence< OUString > const aServiceNames = comphelper::concatSequences( AxisTitleBase::getServiceNames(), - uno::Sequence { u"ooo.vba.excel.AxisTitle"_ustr } ); + std::initializer_list{ u"ooo.vba.excel.AxisTitle"_ustr } ); return aServiceNames; } diff --git a/sc/source/ui/vba/vbacharttitle.cxx b/sc/source/ui/vba/vbacharttitle.cxx index 93a9acdca82f..4a4e5e7f1563 100644 --- a/sc/source/ui/vba/vbacharttitle.cxx +++ b/sc/source/ui/vba/vbacharttitle.cxx @@ -37,7 +37,7 @@ ScVbaChartTitle::getServiceNames() { static uno::Sequence< OUString > const aServiceNames = comphelper::concatSequences( ChartTitleBase::getServiceNames(), - uno::Sequence< OUString > { u"ooo.vba.excel.Chart"_ustr } ); + std::initializer_list{ u"ooo.vba.excel.Chart"_ustr } ); return aServiceNames; } diff --git a/sc/source/ui/vba/vbaglobals.cxx b/sc/source/ui/vba/vbaglobals.cxx index 9fec0ccba8fd..366496024295 100644 --- a/sc/source/ui/vba/vbaglobals.cxx +++ b/sc/source/ui/vba/vbaglobals.cxx @@ -225,7 +225,7 @@ ScVbaGlobals::getAvailableServiceNames( ) { static const uno::Sequence< OUString > serviceNames = comphelper::concatSequences( ScVbaGlobals_BASE::getAvailableServiceNames(), - uno::Sequence< OUString > + std::initializer_list { u"ooo.vba.excel.Range"_ustr, u"ooo.vba.excel.Workbook"_ustr, diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index 4b94a67eed1a..99f5075f6b3a 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -2958,7 +2958,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) else if (nRet == DLG_RET_EDIT) { ScConditionalFormat* pFormat = pDlg->GetCondFormatSelected(); - sal_Int32 nIndex = pFormat ? pFormat->GetKey() : -1; + sal_uInt32 nIndex = pFormat ? pFormat->GetKey() : sal_uInt32(-1); // Put the xml string parameter to initialize the // Conditional Format Dialog. ( edit selected conditional format ) pTabViewShell->setScCondFormatDlgItem( diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx index 0761018fd089..03258c9fdaf2 100644 --- a/sc/source/ui/view/tabview.cxx +++ b/sc/source/ui/view/tabview.cxx @@ -41,6 +41,7 @@ #include #include #include +#include #include #include #include @@ -80,6 +81,7 @@ ScCornerButton::ScCornerButton( vcl::Window* pParent, ScViewData* pData ) : pViewData( pData ) { ScCornerButton::EnableRTL( false ); + SetQuickHelpText(ScResId(SCSTR_QHELP_SELECT_ALL_CELLS)); } ScCornerButton::~ScCornerButton() diff --git a/sc/source/ui/xmlsource/xmlsourcedlg.cxx b/sc/source/ui/xmlsource/xmlsourcedlg.cxx index 4740fec17143..17cc4b928baa 100644 --- a/sc/source/ui/xmlsource/xmlsourcedlg.cxx +++ b/sc/source/ui/xmlsource/xmlsourcedlg.cxx @@ -96,7 +96,7 @@ ScXMLSourceDlg::ScXMLSourceDlg( mxBtnOk->connect_clicked(aBtnHdl); mxBtnCancel->connect_clicked(aBtnHdl); - mxLbTree->connect_changed(LINK(this, ScXMLSourceDlg, TreeItemSelectHdl)); + mxLbTree->connect_selection_changed(LINK(this, ScXMLSourceDlg, TreeItemSelectHdl)); Link aLink = LINK(this, ScXMLSourceDlg, RefModifiedHdl); mxRefEdit->SetModifyHdl(aLink); diff --git a/sc/uiconfig/scalc/ui/optcalculatepage.ui b/sc/uiconfig/scalc/ui/optcalculatepage.ui index f7073fbea926..c1f7160be2d6 100644 --- a/sc/uiconfig/scalc/ui/optcalculatepage.ui +++ b/sc/uiconfig/scalc/ui/optcalculatepage.ui @@ -536,17 +536,17 @@ 6 - 12/30/1899 (defa_ult) + 1899-12-30 (defa_ult) True True False - Value 0 corresponds to 12/30/1899 + Value 0 corresponds to 1899-12-30 True True True - Sets 12/30/1899 as day zero. + Sets 1899-12-30 as day zero. @@ -557,17 +557,17 @@ - 01/01/1900 (Star_Calc 1.0) + 1900-01-01 (Star_Calc 1.0) True True False - Value 0 corresponds to 01/01/1900 + Value 0 corresponds to 1900-01-01 True True datestd - Sets 1/1/1900 as day zero. Use this setting for StarCalc 1.0 spreadsheets containing date entries. + Sets 1900-01-01 as day zero. Use this setting for StarCalc 1.0 spreadsheets containing date entries. @@ -578,17 +578,17 @@ - _01/01/1904 + _1904-01-01 True True False - 0 corresponds to 01/01/1904 + 0 corresponds to 1904-01-01 True True datestd - Sets 1/1/1904 as day zero. Use this setting for spreadsheets that are imported in a foreign format. + Sets 1904-01-01 as day zero. Use this setting for spreadsheets that are imported in a foreign format. diff --git a/scaddins/source/analysis/analysishelper.cxx b/scaddins/source/analysis/analysishelper.cxx index 40d5f86b6542..c8c20fd79672 100644 --- a/scaddins/source/analysis/analysishelper.cxx +++ b/scaddins/source/analysis/analysishelper.cxx @@ -27,6 +27,7 @@ #include #include #include +#include #include #include "analysisdefs.hxx" @@ -1591,9 +1592,8 @@ bool Complex::ParseString( const OUString& rStr, Complex& rCompl ) if( IsImagUnit( *pStr ) && rStr.getLength() == 1) { - rCompl.r = 0.0; - rCompl.i = 1.0; rCompl.c = *pStr; + rCompl.num = std::complex(0.0, 1.0); return true; } @@ -1613,8 +1613,7 @@ bool Complex::ParseString( const OUString& rStr, Complex& rCompl ) rCompl.c = pStr[ 1 ]; if( pStr[ 2 ] == 0 ) { - rCompl.r = f; - rCompl.i = ( *pStr == '+' )? 1.0 : -1.0; + rCompl.num = std::complex(f, ( *pStr == '+' )? 1.0 : -1.0); return true; } } @@ -1624,8 +1623,7 @@ bool Complex::ParseString( const OUString& rStr, Complex& rCompl ) pStr++; if( *pStr == 0 ) { - rCompl.r = r; - rCompl.i = f; + rCompl.num = std::complex(r, f); return true; } } @@ -1637,43 +1635,40 @@ bool Complex::ParseString( const OUString& rStr, Complex& rCompl ) pStr++; if( *pStr == 0 ) { - rCompl.i = f; - rCompl.r = 0.0; + rCompl.num = std::complex(0.0, f); return true; } break; case 0: // only real-part - rCompl.r = f; - rCompl.i = 0.0; + rCompl.num = std::complex(f, 0.0); return true; } return false; } - OUString Complex::GetString() const { - finiteOrThrow(r); - finiteOrThrow(i); + finiteOrThrow(num.real()); + finiteOrThrow(num.imag()); OUStringBuffer aRet; - bool bHasImag = i != 0.0; - bool bHasReal = !bHasImag || (r != 0.0); + bool bHasImag = num.imag() != 0.0; + bool bHasReal = !bHasImag || (num.real() != 0.0); if( bHasReal ) - aRet.append(::GetString( r, false )); + aRet.append(::GetString( num.real(), false )); if( bHasImag ) { - if( i == 1.0 ) + if( num.imag() == 1.0 ) { if( bHasReal ) aRet.append('+'); } - else if( i == -1.0 ) + else if( num.imag() == -1.0 ) aRet.append('-'); else - aRet.append(::GetString( i, bHasReal )); + aRet.append(::GetString( num.imag(), bHasReal )); aRet.append((c != 'j') ? 'i' : 'j'); } @@ -1683,139 +1678,65 @@ OUString Complex::GetString() const double Complex::Arg() const { - if( r == 0.0 && i == 0.0 ) + // Note: there are differing opinions on whether arg(0) should be 0 or undefined, we are treating it as undefined + if( num.real() == 0.0 && num.imag() == 0.0 ) throw lang::IllegalArgumentException(); - - double phi = acos( r / Abs() ); - - if( i < 0.0 ) - phi = -phi; - - return phi; + return std::arg(num); } void Complex::Power( double fPower ) { - if( r == 0.0 && i == 0.0 ) - { - if( fPower <= 0 ) - throw lang::IllegalArgumentException(); - r = i = 0.0; - return; - } - - double p, phi; - - p = Abs(); - - phi = acos( r / p ); - if( i < 0.0 ) - phi = -phi; - - p = pow( p, fPower ); - phi *= fPower; - - r = cos( phi ) * p; - i = sin( phi ) * p; + if( num.real() == 0.0 && num.imag() == 0.0 && fPower <= 0 ) + throw lang::IllegalArgumentException(); + num = std::pow(num, fPower); } void Complex::Sqrt() { - static const double fMultConst = M_SQRT1_2; - double p = Abs(); - double i_ = sqrt( p - r ) * fMultConst; - - r = sqrt( p + r ) * fMultConst; - i = ( i < 0.0 )? -i_ : i_; + num = std::sqrt(num); } void Complex::Sin() { - if( !::rtl::math::isValidArcArg( r ) ) + if( !::rtl::math::isValidArcArg( num.real() ) ) throw lang::IllegalArgumentException(); - - if( i ) - { - double r_; - - r_ = sin( r ) * cosh( i ); - i = cos( r ) * sinh( i ); - r = r_; - } - else - r = sin( r ); + num = std::sin(num); } void Complex::Cos() { - if( !::rtl::math::isValidArcArg( r ) ) + if( !::rtl::math::isValidArcArg( num.real() ) ) throw lang::IllegalArgumentException(); - - if( i ) - { - double r_; - - r_ = cos( r ) * cosh( i ); - i = -( sin( r ) * sinh( i ) ); - r = r_; - } - else - r = cos( r ); + num = std::cos(num); } void Complex::Div( const Complex& z ) { - if( z.r == 0 && z.i == 0 ) + if( z.num.real() == 0 && z.num.imag() == 0 ) throw lang::IllegalArgumentException(); - - double a1 = r; - double a2 = z.r; - double b1 = i; - double b2 = z.i; - - double f = 1.0 / ( a2 * a2 + b2 * b2 ); - - r = ( a1 * a2 + b1 * b2 ) * f; - i = ( a2 * b1 - a1 * b2 ) * f; - - if( !c ) c = z.c; + num = num / z.num; } void Complex::Exp() { - double fE = exp( r ); - r = fE * cos( i ); - i = fE * sin( i ); + num = std::exp(num); } - void Complex::Ln() { - if( r == 0.0 && i == 0.0 ) - throw lang::IllegalArgumentException(); - - double fAbs = Abs(); - bool bNegi = i < 0.0; - - i = acos( r / fAbs ); - - if( bNegi ) - i = -i; - - r = log( fAbs ); + num = std::log(num); } void Complex::Log10() { - Ln(); - Mult( M_LOG10E ); + num = std::log10(num); } @@ -1828,157 +1749,64 @@ void Complex::Log2() void Complex::Tan() { - if ( i ) - { - if( !::rtl::math::isValidArcArg( 2.0 * r ) ) - throw lang::IllegalArgumentException(); - double fScale =1.0 / ( cos( 2.0 * r ) + cosh( 2.0 * i )); - r = sin( 2.0 * r ) * fScale; - i = sinh( 2.0 * i ) * fScale; - } - else - { - if( !::rtl::math::isValidArcArg( r ) ) - throw lang::IllegalArgumentException(); - r = tan( r ); - } + // using 2.0 * num.real/imag as a precaution because a) this is what our previous implementation did and + // b) the std::complex implementation may use cos(2x) etc, see the comment in isValidArcArg for details + if ( ( num.imag() && !::rtl::math::isValidArcArg( 2.0 * num.real() ) ) + || ( !num.imag() && !::rtl::math::isValidArcArg( num.real() ) ) ) + throw lang::IllegalArgumentException(); + num = std::tan(num); } void Complex::Sec() { - if( i ) - { - if( !::rtl::math::isValidArcArg( 2 * r ) ) - throw lang::IllegalArgumentException(); - double fScale = 1.0 / (cosh( 2.0 * i) + cos ( 2.0 * r)); - double r_; - r_ = 2.0 * cos( r ) * cosh( i ) * fScale; - i = 2.0 * sin( r ) * sinh( i ) * fScale; - r = r_; - } - else - { - if( !::rtl::math::isValidArcArg( r ) ) - throw lang::IllegalArgumentException(); - r = 1.0 / cos( r ); - } + Cos(); + num = 1.0 / num; } void Complex::Csc() { - if( i ) - { - if( !::rtl::math::isValidArcArg( 2 * r ) ) - throw lang::IllegalArgumentException(); - double fScale = 1.0 / (cosh( 2.0 * i) - cos ( 2.0 * r)); - double r_; - r_ = 2.0 * sin( r ) * cosh( i ) * fScale; - i = -2.0 * cos( r ) * sinh( i ) * fScale; - r = r_; - } - else - { - if( !::rtl::math::isValidArcArg( r ) ) - throw lang::IllegalArgumentException(); - r = 1.0 / sin( r ); - } + Sin(); + num = 1.0 / num; } void Complex::Cot() { - if ( i ) - { - if( !::rtl::math::isValidArcArg( 2.0 * r ) ) - throw lang::IllegalArgumentException(); - double fScale =1.0 / ( cosh( 2.0 * i ) - cos( 2.0 * r ) ); - r = sin( 2.0 * r ) * fScale; - i = - ( sinh( 2.0 * i ) * fScale ); - } - else - { - if( !::rtl::math::isValidArcArg( r ) ) - throw lang::IllegalArgumentException(); - r = 1.0 / tan( r ); - } + + Tan(); + num = 1.0 / num; } void Complex::Sinh() { - if( !::rtl::math::isValidArcArg( r ) ) + if( !::rtl::math::isValidArcArg( num.imag() ) ) throw lang::IllegalArgumentException(); - - if( i ) - { - double r_; - r_ = sinh( r ) * cos( i ); - i = cosh( r ) * sin( i ); - r = r_; - } - else - r = sinh( r ); + num = std::sinh(num); } void Complex::Cosh() { - if( !::rtl::math::isValidArcArg( r ) ) + if( !::rtl::math::isValidArcArg( num.imag() ) ) throw lang::IllegalArgumentException(); - - if( i ) - { - double r_; - r_ = cosh( r ) * cos( i ); - i = sinh( r ) * sin( i ); - r = r_; - } - else - r = cosh( r ); + num = std::cosh(num); } void Complex::Sech() { - if ( i ) - { - if( !::rtl::math::isValidArcArg( 2.0 * r ) ) - throw lang::IllegalArgumentException(); - double fScale =1.0 / ( cosh( 2.0 * r ) + cos( 2.0 * i )); - double r_; - r_ = 2.0 * cosh( r ) * cos( i ) * fScale; - i = - (2.0 * sinh( r ) * sin( i ) * fScale ); - r = r_ ; - } - else - { - if( !::rtl::math::isValidArcArg( r ) ) - throw lang::IllegalArgumentException(); - r = 1.0 / cosh( r ); - } + Cosh(); + num = 1.0 / num; } void Complex::Csch() { - if ( i ) - { - if( !::rtl::math::isValidArcArg( 2.0 * r ) ) - throw lang::IllegalArgumentException(); - double fScale =1.0 / ( cosh( 2.0 * r ) - cos( 2.0 * i )); - double r_; - r_ = 2.0 * sinh( r ) * cos( i ) * fScale; - i = - ( 2.0 * cosh( r ) * sin( i ) * fScale ); - r = r_ ; - } - else - { - if( !::rtl::math::isValidArcArg( r ) ) - throw lang::IllegalArgumentException(); - r = 1.0 / sinh( r ); - } + Sinh(); + num = 1.0 / num; } diff --git a/scaddins/source/analysis/analysishelper.hxx b/scaddins/source/analysis/analysishelper.hxx index e1920046923c..2f3e673a175e 100644 --- a/scaddins/source/analysis/analysishelper.hxx +++ b/scaddins/source/analysis/analysishelper.hxx @@ -23,6 +23,7 @@ #include #include +#include #include #include @@ -380,8 +381,7 @@ public: class Complex { - double r; - double i; + std::complex num; sal_Unicode c; public: @@ -629,66 +629,59 @@ inline FDCategory FuncData::GetCategory() const inline Complex::Complex( double fReal, double fImag, sal_Unicode cC ) : - r( fReal ), i( fImag ), c( cC ) + c( cC ) { + num = std::complex(fReal, fImag); } inline double Complex::Real() const { - return r; + return num.real(); } inline double Complex::Imag() const { - return i; + return num.imag(); } inline double Complex::Abs() const { - return std::hypot(r, i); + return std::abs(num); } void Complex::Conjugate() { - i = -i; + num = std::conj(num); } inline void Complex::Mult( double f ) { - i *= f; - r *= f; + num = num * f; } inline void Complex::Mult( const Complex& rM ) { - double r_ = r; - double i_ = i; - - r = r_ * rM.r - i_ * rM.i; - i = r_ * rM.i + i_ * rM.r; - + num = num * rM.num; if( !c ) c = rM.c; } inline void Complex::Sub( const Complex& rC ) { - r -= rC.r; - i -= rC.i; + num = num - rC.num; if( !c ) c = rC.c; } inline void Complex::Add( const Complex& rAdd ) { - r += rAdd.r; - i += rAdd.i; + num = num + rAdd.num; if( !c ) c = rAdd.c; } diff --git a/scp2/InstallModule_windows.mk b/scp2/InstallModule_windows.mk index bd6e478e7785..296f7fccfa5b 100644 --- a/scp2/InstallModule_windows.mk +++ b/scp2/InstallModule_windows.mk @@ -22,7 +22,6 @@ $(eval $(call gb_InstallModule_add_defs,scp2/windows,\ $(eval $(call gb_InstallModule_add_scpfiles,scp2/windows,\ scp2/source/ooo/folder_ooo \ $(if $(MSM_PATH),scp2/source/ooo/vc_redist) \ - $(if $(UCRT_REDISTDIR),scp2/source/ooo/ucrt) \ scp2/source/ooo/windowscustomaction_ooo \ )) diff --git a/scp2/source/ooo/ucrt.scp b/scp2/source/ooo/ucrt.scp deleted file mode 100644 index 7f4ec8195870..000000000000 --- a/scp2/source/ooo/ucrt.scp +++ /dev/null @@ -1,157 +0,0 @@ -/* - * 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 "macros.inc" - -File gid_File_Windows6_1_KB2999226_x64_msu - Name = "Windows6.1-KB2999226-x64.msu"; - Dir = gid_Brand_Dir_Program; - Styles = (PACKED, BINARYTABLE, BINARYTABLE_ONLY); -End - -File gid_File_Windows8_RT_KB2999226_x64_msu - Name = "Windows8-RT-KB2999226-x64.msu"; - Dir = gid_Brand_Dir_Program; - Styles = (PACKED, BINARYTABLE, BINARYTABLE_ONLY); -End - -File gid_File_Windows8_1_KB2999226_x64_msu - Name = "Windows8.1-KB2999226-x64.msu"; - Dir = gid_Brand_Dir_Program; - Styles = (PACKED, BINARYTABLE, BINARYTABLE_ONLY); -End - -#ifndef WINDOWS_X64 - -File gid_File_Windows6_1_KB2999226_x86_msu - Name = "Windows6.1-KB2999226-x86.msu"; - Dir = gid_Brand_Dir_Program; - Styles = (PACKED, BINARYTABLE, BINARYTABLE_ONLY); -End - -File gid_File_Windows8_RT_KB2999226_x86_msu - Name = "Windows8-RT-KB2999226-x86.msu"; - Dir = gid_Brand_Dir_Program; - Styles = (PACKED, BINARYTABLE, BINARYTABLE_ONLY); -End - -File gid_File_Windows8_1_KB2999226_x86_msu - Name = "Windows8.1-KB2999226-x86.msu"; - Dir = gid_Brand_Dir_Program; - Styles = (PACKED, BINARYTABLE, BINARYTABLE_ONLY); -End - -#endif /* WINDOWS_X64 */ - -/* A deferred not-impersonated action that will call wusa.exe to actually install - msu. Since deferred actions don't have access to current DB, the action depends - on immediate-executed action inst_ucrt (see below) that precedes it, unpacks - the binary to a temp file, and sets this action's CustomActionData property. -*/ -WindowsCustomAction gid_Customaction_inst_msu - Name = "inst_msu"; - Typ = "3073"; - Source = "inst_msu_msi.dll"; - Target = "InstallMSU"; - Inbinarytable = 1; - Assignment1 = ("InstallExecuteSequence", "Not Installed And inst_msu", "InstallFiles"); -End - -/* An immediately-executed action that will unpack a binary, which name in binary table is set - in "InstMSUBinary" property, to a temporary file, and sets "inst_msu" and "cleanup_msu" props. -*/ -WindowsCustomAction gid_Customaction_unpack_msu - Name = "unpack_msu"; - Typ = "1"; - Source = "inst_msu_msi.dll"; - Target = "UnpackMSUForInstall"; - Inbinarytable = 1; - Assignment1 = ("InstallExecuteSequence", "Not Installed And InstMSUBinary", "cleanup_msu"); -End - -/* A rollback action that removes temp file. It must precede inst_msu. -*/ -WindowsCustomAction gid_Customaction_cleanup_msu - Name = "cleanup_msu"; - Typ = "1345"; - Source = "inst_msu_msi.dll"; - Target = "CleanupMSU"; - Inbinarytable = 1; - Assignment1 = ("InstallExecuteSequence", "Not Installed And cleanup_msu", "inst_msu"); -End - -/* The "InstMSUBinary" property contains an error message number and a binary name, separated by "|". - The former is used when installing the MSU fails. -*/ -WindowsCustomAction gid_Customaction_check_win7x64_ucrt - Name = "check_win7x64_ucrt"; - Typ = "51"; - Source = "InstMSUBinary"; - Target = "KB2999226|Windows61_KB2999226_x64msu"; - Inbinarytable = 0; - Assignment1 = ("InstallExecuteSequence", "Not Installed And VersionNT = 601 And VersionNT64", "FileCost"); - Styles = "NO_FILE"; -End - -WindowsCustomAction gid_Customaction_check_win8x64_ucrt - Name = "check_win8x64_ucrt"; - Typ = "51"; - Source = "InstMSUBinary"; - Target = "KB2999226|Windows8_RT_KB2999226_x64msu"; - Inbinarytable = 0; - Assignment1 = ("InstallExecuteSequence", "Not Installed And VersionNT = 602 And VersionNT64", "check_win7x64_ucrt"); - Styles = "NO_FILE"; -End - -WindowsCustomAction gid_Customaction_check_win81x64_ucrt - Name = "check_win81x64_ucrt"; - Typ = "51"; - Source = "InstMSUBinary"; - Target = "KB2999226|Windows81_KB2999226_x64msu"; - Inbinarytable = 0; - Assignment1 = ("InstallExecuteSequence", "Not Installed And VersionNT = 603 And (Not WINMAJORVER Or WINMAJORVER = \"#6\") And VersionNT64", "check_win8x64_ucrt"); - Styles = "NO_FILE"; -End - -#ifndef WINDOWS_X64 - -/* 32-bit installer must be prepared to run on both 32- and 64-bit Windows. So, it might need to - install either 32-bit or 64-bit UCRT package, depending on OS bitness. -*/ - -WindowsCustomAction gid_Customaction_check_win7x32_ucrt - Name = "check_win7x32_ucrt"; - Typ = "51"; - Source = "InstMSUBinary"; - Target = "KB2999226|Windows61_KB2999226_x86msu"; - Inbinarytable = 0; - Assignment1 = ("InstallExecuteSequence", "Not Installed And VersionNT = 601 And Not VersionNT64", "check_win81x64_ucrt"); - Styles = "NO_FILE"; -End - -WindowsCustomAction gid_Customaction_check_win8x32_ucrt - Name = "check_win8x32_ucrt"; - Typ = "51"; - Source = "InstMSUBinary"; - Target = "KB2999226|Windows8_RT_KB2999226_x86msu"; - Inbinarytable = 0; - Assignment1 = ("InstallExecuteSequence", "Not Installed And VersionNT = 602 And Not VersionNT64", "check_win7x32_ucrt"); - Styles = "NO_FILE"; -End - -WindowsCustomAction gid_Customaction_check_win81x32_ucrt - Name = "check_win81x32_ucrt"; - Typ = "51"; - Source = "InstMSUBinary"; - Target = "KB2999226|Windows81_KB2999226_x86msu"; - Inbinarytable = 0; - Assignment1 = ("InstallExecuteSequence", "Not Installed And VersionNT = 603 And (Not WINMAJORVER Or WINMAJORVER = \"#6\") And Not VersionNT64", "check_win8x32_ucrt"); - Styles = "NO_FILE"; -End - -#endif /* WINDOWS_X64 */ diff --git a/sd/qa/unit/data/pptx/tdf158512.pptx b/sd/qa/unit/data/pptx/tdf158512.pptx new file mode 100644 index 000000000000..96494ddf656a Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf158512.pptx differ diff --git a/sd/qa/unit/import-tests2.cxx b/sd/qa/unit/import-tests2.cxx index 2ff83269d682..8e9b7f5f72b9 100644 --- a/sd/qa/unit/import-tests2.cxx +++ b/sd/qa/unit/import-tests2.cxx @@ -2149,6 +2149,19 @@ CPPUNIT_TEST_FIXTURE(SdImportTest2, testTdf161430) CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_NONE, eXFS); } +CPPUNIT_TEST_FIXTURE(SdImportTest2, tdf158512) +{ + // First shape on first slide should have no fill to avoid hiding background + createSdImpressDoc("pptx/tdf158512.pptx"); + + const SdrPage* pPage = GetPage(1); + CPPUNIT_ASSERT_EQUAL(size_t(2), pPage->GetObjCount()); + CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_NONE, + pPage->GetObj(0)->GetMergedItem(XATTR_FILLSTYLE).GetValue()); + CPPUNIT_ASSERT_EQUAL(false, + pPage->GetObj(0)->GetMergedItem(XATTR_FILLUSESLIDEBACKGROUND).GetValue()); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx b/sd/qa/unit/tiledrendering/tiledrendering.cxx index 18b213e99abf..5f0a3b747a64 100644 --- a/sd/qa/unit/tiledrendering/tiledrendering.cxx +++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -41,6 +42,7 @@ #include #include #include + #include #include #include @@ -2791,9 +2793,10 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering) CPPUNIT_ASSERT(pViewShell); SdPage* pPage = pViewShell->GetActualPage(); CPPUNIT_ASSERT(pPage); + std::string sHash = GetInterfaceHash(GetXDrawPageForSdrPage(pPage)); sal_Int32 nViewWidth = 2000; sal_Int32 nViewHeight = 2000; - CPPUNIT_ASSERT(pXImpressDocument->createSlideRenderer(0, nViewWidth, nViewHeight, true, true)); + CPPUNIT_ASSERT(pXImpressDocument->createSlideRenderer(sHash.c_str(), 0, nViewWidth, nViewHeight, true, true)); CPPUNIT_ASSERT_EQUAL(2000, nViewWidth); CPPUNIT_ASSERT_EQUAL(1125, nViewHeight); @@ -2869,10 +2872,12 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_WithFie sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell(); CPPUNIT_ASSERT(pViewShell); SdPage* pPage = pViewShell->GetActualPage(); + CPPUNIT_ASSERT(pPage); + std::string sHash = GetInterfaceHash(GetXDrawPageForSdrPage(pPage)); sal_Int32 nViewWidth = 2000; sal_Int32 nViewHeight = 2000; - CPPUNIT_ASSERT(pXImpressDocument->createSlideRenderer(0, nViewWidth, nViewHeight, true, true)); + CPPUNIT_ASSERT(pXImpressDocument->createSlideRenderer(sHash.c_str(), 0, nViewWidth, nViewHeight, true, true)); CPPUNIT_ASSERT_EQUAL(2000, nViewWidth); CPPUNIT_ASSERT_EQUAL(1125, nViewHeight); @@ -2967,9 +2972,10 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_Animati CPPUNIT_ASSERT(pViewShell); SdPage* pPage = pViewShell->GetActualPage(); CPPUNIT_ASSERT(pPage); + std::string sHash = GetInterfaceHash(GetXDrawPageForSdrPage(pPage)); sal_Int32 nViewWidth = 2000; sal_Int32 nViewHeight = 2000; - CPPUNIT_ASSERT(pXImpressDocument->createSlideRenderer(0, nViewWidth, nViewHeight, true, true)); + CPPUNIT_ASSERT(pXImpressDocument->createSlideRenderer(sHash.c_str(), 0, nViewWidth, nViewHeight, true, true)); CPPUNIT_ASSERT_EQUAL(2000, nViewWidth); CPPUNIT_ASSERT_EQUAL(1125, nViewHeight); @@ -3078,7 +3084,8 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_Animati CPPUNIT_ASSERT(pPage); sal_Int32 nViewWidth = 2000; sal_Int32 nViewHeight = 2000; - CPPUNIT_ASSERT(pXImpressDocument->createSlideRenderer(0, nViewWidth, nViewHeight, true, true)); + std::string sHash = GetInterfaceHash(GetXDrawPageForSdrPage(pPage)); + CPPUNIT_ASSERT(pXImpressDocument->createSlideRenderer(sHash.c_str(), 0, nViewWidth, nViewHeight, true, true)); CPPUNIT_ASSERT_EQUAL(2000, nViewWidth); CPPUNIT_ASSERT_EQUAL(1125, nViewHeight); diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx index 04d0f020ebbc..9de413f77be2 100644 --- a/sd/source/core/sdpage.cxx +++ b/sd/source/core/sdpage.cxx @@ -2013,10 +2013,10 @@ void SdPage::ScaleObjects(const Size& rNewPageSize, const ::tools::Rectangle& rN } } } - else if ( eObjKind != SdrObjKind::TitleText && - eObjKind != SdrObjKind::OutlineText && - DynCastSdrTextObj( pObj.get() ) != nullptr && - pObj->GetOutlinerParaObject() ) + else if (eObjKind != SdrObjKind::TitleText + && eObjKind != SdrObjKind::OutlineText && mePageKind != PageKind::Notes + && DynCastSdrTextObj(pObj.get()) != nullptr + && pObj->GetOutlinerParaObject()) { /****************************************************** * normal text object: adjust text height diff --git a/sd/source/ui/animations/CustomAnimationList.cxx b/sd/source/ui/animations/CustomAnimationList.cxx index 99ce44b5cf50..8df6d31588fd 100644 --- a/sd/source/ui/animations/CustomAnimationList.cxx +++ b/sd/source/ui/animations/CustomAnimationList.cxx @@ -453,7 +453,7 @@ CustomAnimationList::CustomAnimationList(std::unique_ptr xTreeVi mxEmptyLabel->set_stack_background(); mxTreeView->set_selection_mode(SelectionMode::Multiple); - mxTreeView->connect_changed(LINK(this, CustomAnimationList, SelectHdl)); + mxTreeView->connect_selection_changed(LINK(this, CustomAnimationList, SelectHdl)); mxTreeView->connect_key_press(LINK(this, CustomAnimationList, KeyInputHdl)); mxTreeView->connect_popup_menu(LINK(this, CustomAnimationList, CommandHdl)); mxTreeView->connect_row_activated(LINK(this, CustomAnimationList, DoubleClickHdl)); diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx index 77a2e4aa6a7d..aa4161697f8e 100644 --- a/sd/source/ui/animations/CustomAnimationPane.cxx +++ b/sd/source/ui/animations/CustomAnimationPane.cxx @@ -163,7 +163,7 @@ css::ui::LayoutSize CustomAnimationPane::GetHeightForWidth(const sal_Int32 /*nWi void CustomAnimationPane::initialize() { - mxLBAnimation->connect_changed(LINK(this, CustomAnimationPane, AnimationSelectHdl)); + mxLBAnimation->connect_selection_changed(LINK(this, CustomAnimationPane, AnimationSelectHdl)); mxCustomAnimationList->setController( static_cast ( this ) ); mxCustomAnimationList->set_size_request(mxCustomAnimationList->get_approximate_digit_width() * 15, mxCustomAnimationList->get_height_rows(4)); diff --git a/sd/source/ui/animations/motionpathtag.cxx b/sd/source/ui/animations/motionpathtag.cxx index 7a43fe07f54a..bffecd48cd89 100644 --- a/sd/source/ui/animations/motionpathtag.cxx +++ b/sd/source/ui/animations/motionpathtag.cxx @@ -186,7 +186,7 @@ bool PathDragResize::EndSdrDrag(bool /*bCopy*/) { const Point aRef( DragStat().GetRef1() ); basegfx::B2DHomMatrix aTrans(basegfx::utils::createTranslateB2DHomMatrix(-aRef.X(), -aRef.Y())); - aTrans.scale(double(aXFact), double(aYFact)); + aTrans.scale(double(m_aXFact), double(m_aYFact)); aTrans.translate(aRef.X(), aRef.Y()); basegfx::B2DPolyPolygon aDragPoly(pPathObj->GetPathPoly()); aDragPoly.transform(aTrans); diff --git a/sd/source/ui/dlg/BulletAndPositionDlg.cxx b/sd/source/ui/dlg/BulletAndPositionDlg.cxx index abf2563815c7..7479ebb5fc29 100644 --- a/sd/source/ui/dlg/BulletAndPositionDlg.cxx +++ b/sd/source/ui/dlg/BulletAndPositionDlg.cxx @@ -141,7 +141,7 @@ SvxBulletAndPositionDlg::SvxBulletAndPositionDlg(weld::Window* pWindow, const Sf m_xBitmapMB->connect_selected(LINK(this, SvxBulletAndPositionDlg, GraphicHdl_Impl)); m_xBitmapMB->connect_toggled(LINK(this, SvxBulletAndPositionDlg, PopupActivateHdl_Impl)); m_xLevelLB->set_selection_mode(SelectionMode::Multiple); - m_xLevelLB->connect_changed(LINK(this, SvxBulletAndPositionDlg, LevelHdl_Impl)); + m_xLevelLB->connect_selection_changed(LINK(this, SvxBulletAndPositionDlg, LevelHdl_Impl)); m_xWidthMF->connect_value_changed(LINK(this, SvxBulletAndPositionDlg, SizeHdl_Impl)); m_xHeightMF->connect_value_changed(LINK(this, SvxBulletAndPositionDlg, SizeHdl_Impl)); m_xRatioCB->connect_toggled(LINK(this, SvxBulletAndPositionDlg, RatioHdl_Impl)); diff --git a/sd/source/ui/dlg/PhotoAlbumDialog.cxx b/sd/source/ui/dlg/PhotoAlbumDialog.cxx index aeee531d4885..870c6d64f56a 100644 --- a/sd/source/ui/dlg/PhotoAlbumDialog.cxx +++ b/sd/source/ui/dlg/PhotoAlbumDialog.cxx @@ -66,7 +66,7 @@ SdPhotoAlbumDialog::SdPhotoAlbumDialog(weld::Window* pWindow, SdDrawDocument* pA m_xDownBtn->set_sensitive(false); m_xRemoveBtn->connect_clicked(LINK(this, SdPhotoAlbumDialog, RemoveHdl)); m_xRemoveBtn->set_sensitive(false); - m_xImagesLst->connect_changed(LINK(this, SdPhotoAlbumDialog, SelectHdl)); + m_xImagesLst->connect_selection_changed(LINK(this, SdPhotoAlbumDialog, SelectHdl)); m_xInsTypeCombo->connect_changed(LINK(this, SdPhotoAlbumDialog, TypeSelectHdl)); m_pGraphicFilter = std::make_unique(); diff --git a/sd/source/ui/dlg/SelectLayerDlg.cxx b/sd/source/ui/dlg/SelectLayerDlg.cxx index 963d23dc9339..94961f61aac9 100644 --- a/sd/source/ui/dlg/SelectLayerDlg.cxx +++ b/sd/source/ui/dlg/SelectLayerDlg.cxx @@ -29,7 +29,7 @@ SdSelectLayerDlg::SdSelectLayerDlg(weld::Window* pParent) m_xListLB->set_size_request(m_xListLB->get_approximate_digit_width() * 32, m_xListLB->get_height_rows(8)); m_xListLB->connect_row_activated(LINK(this, SdSelectLayerDlg, DoubleClickHdl)); - m_xListLB->connect_changed(LINK(this, SdSelectLayerDlg, SelectHdl)); + m_xListLB->connect_selection_changed(LINK(this, SdSelectLayerDlg, SelectHdl)); } IMPL_LINK_NOARG(SdSelectLayerDlg, DoubleClickHdl, weld::TreeView&, bool) diff --git a/sd/source/ui/dlg/custsdlg.cxx b/sd/source/ui/dlg/custsdlg.cxx index 43535bbc45b9..3cec4c1d738e 100644 --- a/sd/source/ui/dlg/custsdlg.cxx +++ b/sd/source/ui/dlg/custsdlg.cxx @@ -51,7 +51,7 @@ SdCustomShowDlg::SdCustomShowDlg(weld::Window* pWindow, SdDrawDocument& rDrawDoc m_xBtnEdit->connect_clicked( aLink ); m_xBtnRemove->connect_clicked( aLink ); m_xBtnCopy->connect_clicked( aLink ); - m_xLbCustomShows->connect_changed( LINK( this, SdCustomShowDlg, SelectListBoxHdl ) ); + m_xLbCustomShows->connect_selection_changed(LINK(this, SdCustomShowDlg, SelectListBoxHdl)); m_xBtnStartShow->connect_clicked( LINK( this, SdCustomShowDlg, StartShowHdl ) ); // for test @@ -255,8 +255,8 @@ SdDefineCustomShowDlg::SdDefineCustomShowDlg(weld::Window* pWindow, SdDrawDocume m_xBtnAdd->connect_clicked( aLink ); m_xBtnRemove->connect_clicked( aLink ); m_xEdtName->connect_changed( LINK( this, SdDefineCustomShowDlg, ClickButtonEditHdl ) ); - m_xLbPages->connect_changed( LINK( this, SdDefineCustomShowDlg, ClickButtonHdl4 ) ); // because of status - m_xLbCustomPages->connect_changed( LINK( this, SdDefineCustomShowDlg, ClickButtonHdl3 ) ); // because of status + m_xLbPages->connect_selection_changed(LINK(this, SdDefineCustomShowDlg, ClickButtonHdl4)); // because of status + m_xLbCustomPages->connect_selection_changed(LINK(this, SdDefineCustomShowDlg, ClickButtonHdl3)); // because of status m_xBtnOK->connect_clicked( LINK( this, SdDefineCustomShowDlg, OKHdl ) ); diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx index be28cc2fda73..aecdbe4bda5f 100644 --- a/sd/source/ui/dlg/sdtreelb.cxx +++ b/sd/source/ui/dlg/sdtreelb.cxx @@ -752,7 +752,7 @@ SdPageObjsTLV::SdPageObjsTLV(std::unique_ptr xTreeView) , m_nRowActivateEventId(nullptr) { m_xTreeView->connect_expanding(LINK(this, SdPageObjsTLV, RequestingChildrenHdl)); - m_xTreeView->connect_changed(LINK(this, SdPageObjsTLV, SelectHdl)); + m_xTreeView->connect_selection_changed(LINK(this, SdPageObjsTLV, SelectHdl)); m_xTreeView->connect_row_activated(LINK(this, SdPageObjsTLV, RowActivatedHdl)); m_xTreeView->connect_drag_begin(LINK(this, SdPageObjsTLV, DragBeginHdl)); m_xTreeView->connect_key_press(LINK(this, SdPageObjsTLV, KeyInputHdl)); diff --git a/sd/source/ui/func/fudraw.cxx b/sd/source/ui/func/fudraw.cxx index d40f325f2392..28e1bf7e96f3 100644 --- a/sd/source/ui/func/fudraw.cxx +++ b/sd/source/ui/func/fudraw.cxx @@ -640,7 +640,8 @@ void FuDraw::DoubleClick(const MouseEvent& rMEvt) SdrInventor nInv = pObj->GetObjInventor(); SdrObjKind nSdrObjKind = pObj->GetObjIdentifier(); - if (nInv == SdrInventor::Default && nSdrObjKind == SdrObjKind::OLE2) + if (nInv == SdrInventor::Default && nSdrObjKind == SdrObjKind::OLE2 + && !mpDocSh->IsReadOnly()) { // activate OLE-object SfxInt16Item aItem(SID_OBJECT, 0); @@ -649,7 +650,8 @@ void FuDraw::DoubleClick(const MouseEvent& rMEvt) SfxCallMode::ASYNCHRON | SfxCallMode::RECORD, { &aItem }); } - else if (nInv == SdrInventor::Default && nSdrObjKind == SdrObjKind::Graphic && pObj->IsEmptyPresObj() ) + else if (nInv == SdrInventor::Default && nSdrObjKind == SdrObjKind::Graphic + && pObj->IsEmptyPresObj() && !mpDocSh->IsReadOnly()) { mpViewShell->GetViewFrame()-> GetDispatcher()->Execute( SID_INSERT_GRAPHIC, diff --git a/sd/source/ui/func/fupoor.cxx b/sd/source/ui/func/fupoor.cxx index 2a1c9023015b..5d952d1e4a40 100644 --- a/sd/source/ui/func/fupoor.cxx +++ b/sd/source/ui/func/fupoor.cxx @@ -232,7 +232,7 @@ bool FuPoor::KeyInput(const KeyEvent& rKEvt) bReturn = true; } } - else + else if (!mpDocSh->IsReadOnly()) { // activate OLE object on RETURN for selected object // activate text edit on RETURN for selected object diff --git a/sd/source/ui/inc/SlideshowLayerRenderer.hxx b/sd/source/ui/inc/SlideshowLayerRenderer.hxx index b6397ddc9fb8..5cd590e920e7 100644 --- a/sd/source/ui/inc/SlideshowLayerRenderer.hxx +++ b/sd/source/ui/inc/SlideshowLayerRenderer.hxx @@ -48,6 +48,7 @@ struct RenderState std::unordered_set maObjectsDone; std::unordered_set maInAnimation; + std::map maAnimationTargetHash; std::map maInitiallyVisible; sal_Int32 mnIndex[static_cast(RenderStage::Count)] = { 0, 0, 0, 0 }; SdrObject* mpCurrentTarget = nullptr; diff --git a/sd/source/ui/inc/unomodel.hxx b/sd/source/ui/inc/unomodel.hxx index 13a2635c781a..4e4019db3147 100644 --- a/sd/source/ui/inc/unomodel.hxx +++ b/sd/source/ui/inc/unomodel.hxx @@ -302,6 +302,7 @@ public: SD_DLLPUBLIC OString getPresentationInfo() const override; /// @see vcl::ITiledRenderable::createSlideRenderer(). SD_DLLPUBLIC bool createSlideRenderer( + const OString& rSlideHash, sal_Int32 nSlideNumber, sal_Int32& nViewWidth, sal_Int32& nViewHeight, bool bRenderBackground, bool bRenderMasterPage) override; /// @see vcl::ITiledRenderable::postSlideshowCleanup(). diff --git a/sd/source/ui/sidebar/MasterPagesSelector.cxx b/sd/source/ui/sidebar/MasterPagesSelector.cxx index 2ee57bca11c3..33d87e4d919c 100644 --- a/sd/source/ui/sidebar/MasterPagesSelector.cxx +++ b/sd/source/ui/sidebar/MasterPagesSelector.cxx @@ -466,9 +466,9 @@ void MasterPagesSelector::InvalidatePreview (const SdPage* pPage) } } -VclPtr MasterPagesSelector::GetVirtualDevice(Image pImage) +VclPtr MasterPagesSelector::GetVirtualDevice(const Image& rImage) { - BitmapEx aPreviewBitmap = pImage.GetBitmapEx(); + BitmapEx aPreviewBitmap = rImage.GetBitmapEx(); VclPtr pVDev = VclPtr::Create(); const Point aNull(0, 0); if (pVDev->GetDPIScaleFactor() > 1) diff --git a/sd/source/ui/sidebar/MasterPagesSelector.hxx b/sd/source/ui/sidebar/MasterPagesSelector.hxx index 3eaf9851e317..b1c92b5d1c55 100644 --- a/sd/source/ui/sidebar/MasterPagesSelector.hxx +++ b/sd/source/ui/sidebar/MasterPagesSelector.hxx @@ -173,7 +173,7 @@ private: sal_uInt16 nIndex, MasterPageContainer::Token aToken); - static VclPtr GetVirtualDevice(Image pPreview); + static VclPtr GetVirtualDevice(const Image& rPreview); }; } // end of namespace sd::sidebar diff --git a/sd/source/ui/slidesorter/controller/SlideSorterController.cxx b/sd/source/ui/slidesorter/controller/SlideSorterController.cxx index ad1d84bc1564..1589488dd6f8 100644 --- a/sd/source/ui/slidesorter/controller/SlideSorterController.cxx +++ b/sd/source/ui/slidesorter/controller/SlideSorterController.cxx @@ -382,6 +382,9 @@ bool SlideSorterController::Command ( // We do not support zooming with control+mouse wheel. return false; } + // tdf#119745: ScrollLines gives accurate distance scrolled on touchpad. NotchDelta sign + // gives direction. Default is 3 lines at a time, so factor that out. + double scrollDistance = -pData->GetScrollLines() * pData->GetNotchDelta() / 3.0; // Determine whether to scroll horizontally or vertically. This // depends on the orientation of the scroll bar and the // IsHoriz() flag of the event. @@ -390,13 +393,13 @@ bool SlideSorterController::Command ( { GetScrollBarManager().Scroll( ScrollBarManager::Orientation_Vertical, - -pData->GetNotchDelta()); + scrollDistance); } else { GetScrollBarManager().Scroll( ScrollBarManager::Orientation_Horizontal, - -pData->GetNotchDelta()); + scrollDistance); } mrSlideSorter.GetView().UpdatePageUnderMouse(rEvent.GetMousePosPixel()); diff --git a/sd/source/ui/slidesorter/controller/SlsScrollBarManager.cxx b/sd/source/ui/slidesorter/controller/SlsScrollBarManager.cxx index 6ee20c8dd93c..6a0244f41655 100644 --- a/sd/source/ui/slidesorter/controller/SlsScrollBarManager.cxx +++ b/sd/source/ui/slidesorter/controller/SlsScrollBarManager.cxx @@ -516,7 +516,7 @@ IMPL_LINK_NOARG(ScrollBarManager, AutoScrollTimeoutHandler, Timer *, void) void ScrollBarManager::Scroll( const Orientation eOrientation, - const sal_Int32 nDistance) + const double nDistance) { bool bIsVertical (false); switch (eOrientation) @@ -528,51 +528,53 @@ void ScrollBarManager::Scroll( return; } - Point aNewTopLeft ( - mpHorizontalScrollBar ? mpHorizontalScrollBar->GetThumbPos() : 0, - mpVerticalScrollBar ? mpVerticalScrollBar->GetThumbPos() : 0); + // Get current scrolling view position + // Fix bug where 1) scrolling view is partially scrolled, 2) view window is snapped from vertical + // to horizontal or vice-versa, then 3) mouse wheel scrolled. Scrolling broke because we got an + // invalid starting position from the scrollbar that's no longer displayed. Check scrollbars + // visible before getting position from each. + bool bHorizontalScrollShown = mpHorizontalScrollBar && mpHorizontalScrollBar->IsVisible(); + bool bVerticalScrollShown = mpVerticalScrollBar && mpVerticalScrollBar->IsVisible(); + Point aNewTopLeft( + bHorizontalScrollShown ? mpHorizontalScrollBar->GetThumbPos() : 0, + bVerticalScrollShown ? mpVerticalScrollBar->GetThumbPos() : 0); view::Layouter& rLayouter (mrSlideSorter.GetView().GetLayouter()); - // Calculate estimate of new location. + // Calculate new location + Size objectSize( rLayouter.GetPageObjectSize() ); // Size of a page in pane + Size objectAndGapSize = view::Layouter::AddGap(objectSize); // Add gap between pages to size if (bIsVertical) - aNewTopLeft.AdjustY(nDistance * rLayouter.GetPageObjectSize().Height() ); + aNewTopLeft.AdjustY(nDistance * objectAndGapSize.Height() ); // New position else - aNewTopLeft.AdjustX(nDistance * rLayouter.GetPageObjectSize().Width() ); + aNewTopLeft.AdjustX(nDistance * objectAndGapSize.Width() ); // New position - // Adapt location to show whole slides. + // Get displayable area for pages + ::tools::Rectangle scrollArea = rLayouter.GetTotalBoundingBox(); + + // Prevent scrolling out of bounds by limiting scroll destination point. if (bIsVertical) - if (nDistance > 0) - { - const sal_Int32 nIndex (rLayouter.GetIndexAtPoint( - Point(aNewTopLeft.X(), aNewTopLeft.Y()+mpVerticalScrollBar->GetVisibleSize()), - true)); - aNewTopLeft.setY( rLayouter.GetPageObjectBox(nIndex,true).Bottom() - - mpVerticalScrollBar->GetVisibleSize() ); - } - else - { - const sal_Int32 nIndex (rLayouter.GetIndexAtPoint( - Point(aNewTopLeft.X(), aNewTopLeft.Y()), - true)); - aNewTopLeft.setY( rLayouter.GetPageObjectBox(nIndex,true).Top() ); - } + { + // Subtract size of view itself to get scrollable area. + ::tools::Long scrollbarSize = mpVerticalScrollBar->GetVisibleSize(); + // Prevent (-) height. std::max needs type specified explicitly so params match. + ::tools::Long scrollHeight = std::max(static_cast<::tools::Long>(0), scrollArea.GetHeight() - scrollbarSize); + scrollArea.SetHeight(scrollHeight); + // Constrain scroll point to valid area + ::tools::Long constrainedY = std::clamp(aNewTopLeft.getY(), scrollArea.Top(), scrollArea.Bottom()); + aNewTopLeft.setY(constrainedY); + } else - if (nDistance > 0) - { - const sal_Int32 nIndex (rLayouter.GetIndexAtPoint( - Point(aNewTopLeft.X()+mpVerticalScrollBar->GetVisibleSize(), aNewTopLeft.Y()), - true)); - aNewTopLeft.setX( rLayouter.GetPageObjectBox(nIndex,true).Right() - - mpVerticalScrollBar->GetVisibleSize() ); - } - else - { - const sal_Int32 nIndex (rLayouter.GetIndexAtPoint( - Point(aNewTopLeft.X(), aNewTopLeft.Y()), - true)); - aNewTopLeft.setX( rLayouter.GetPageObjectBox(nIndex,true).Left() ); - } + { + // Subtract size of view itself to get scrollable area. + ::tools::Long scrollbarSize = mpHorizontalScrollBar->GetVisibleSize(); + // Prevent (-) width. std::max needs type specified explicitly so params match. + ::tools::Long scrollWidth = std::max(static_cast<::tools::Long>(0), scrollArea.GetWidth() - scrollbarSize); + scrollArea.SetWidth(scrollWidth); + // Constrain scroll point to valid area + ::tools::Long constrainedX = std::clamp(aNewTopLeft.getX(), scrollArea.Left(), scrollArea.Right()); + aNewTopLeft.setX(constrainedX); + } mrSlideSorter.GetController().GetVisibleAreaManager().DeactivateCurrentSlideTracking(); SetTopLeft(aNewTopLeft); diff --git a/sd/source/ui/slidesorter/inc/controller/SlsScrollBarManager.hxx b/sd/source/ui/slidesorter/inc/controller/SlsScrollBarManager.hxx index df04a3b5952f..1ed5b9fead87 100644 --- a/sd/source/ui/slidesorter/inc/controller/SlsScrollBarManager.hxx +++ b/sd/source/ui/slidesorter/inc/controller/SlsScrollBarManager.hxx @@ -155,7 +155,7 @@ public: */ void Scroll( const Orientation eOrientation, - const sal_Int32 nDistance); + const double nDistance); private: SlideSorter& mrSlideSorter; diff --git a/sd/source/ui/slidesorter/inc/view/SlsLayouter.hxx b/sd/source/ui/slidesorter/inc/view/SlsLayouter.hxx index b91ae83c544c..c54dee655503 100644 --- a/sd/source/ui/slidesorter/inc/view/SlsLayouter.hxx +++ b/sd/source/ui/slidesorter/inc/view/SlsLayouter.hxx @@ -111,6 +111,12 @@ public: Size const & GetPageObjectSize() const; + /** Returns the passed Size plus the gap between pages. + @param rObjectSize + Object size to start from. + */ + static Size AddGap(const Size & rObjectSize); + /** Return the bounding box in window coordinates of the nIndex-th page object. */ diff --git a/sd/source/ui/slidesorter/view/SlsLayouter.cxx b/sd/source/ui/slidesorter/view/SlsLayouter.cxx index 8bc0daf3f5e9..371e410d3fee 100644 --- a/sd/source/ui/slidesorter/view/SlsLayouter.cxx +++ b/sd/source/ui/slidesorter/view/SlsLayouter.cxx @@ -183,7 +183,7 @@ public: const sal_Int32 nColumn, const bool bClampToValidRange) const; - ::tools::Rectangle GetPageObjectBox ( + ::tools::Rectangle GetPageObjectBox ( const sal_Int32 nIndex, const bool bIncludeBorderAndGap = false) const; @@ -349,6 +349,14 @@ Size const & Layouter::GetPageObjectSize() const return mpImplementation->maPageObjectSize; } +Size Layouter::AddGap(const Size & rObjectSize) +{ + Size newSize = rObjectSize; + newSize.AdjustWidth(Implementation::gnHorizontalGap); + newSize.AdjustHeight(Implementation::gnVerticalGap); + return newSize; +} + ::tools::Rectangle Layouter::GetPageObjectBox ( const sal_Int32 nIndex, const bool bIncludeBorderAndGap) const diff --git a/sd/source/ui/tools/SlideshowLayerRenderer.cxx b/sd/source/ui/tools/SlideshowLayerRenderer.cxx index 96f9000e69ad..bf5e34a65a6a 100644 --- a/sd/source/ui/tools/SlideshowLayerRenderer.cxx +++ b/sd/source/ui/tools/SlideshowLayerRenderer.cxx @@ -290,6 +290,14 @@ void SlideshowLayerRenderer::setupAnimations() maRenderState.maInitiallyVisible[pObject] = bVisible; } + + if (aAny.hasValue()) + { + OStringBuffer sTmp; + anim::convertTarget(sTmp, aAny); + maRenderState.maAnimationTargetHash[pObject] + = static_cast(sTmp); + } } } } @@ -361,7 +369,7 @@ void SlideshowLayerRenderer::writeJSON(OString& rJsonMsg) aJsonWriter.put("type", "animated"); { auto aContentNode = aJsonWriter.startNode("content"); - aJsonWriter.put("hash", RenderState::getObjectHash(pObject)); + aJsonWriter.put("hash", maRenderState.maAnimationTargetHash.at(pObject)); aJsonWriter.put("initVisible", maRenderState.isObjectInitiallyVisible(pObject)); aJsonWriter.put("type", "bitmap"); writeContentNode(aJsonWriter); diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index 12953834614c..7f099a2b1b30 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -61,6 +61,8 @@ #include +#include + #include #include #include @@ -586,8 +588,6 @@ private: void exportAnimate(const Reference& xAnimate); void convertValue(XMLTokenEnum eAttributeName, OStringBuffer& sTmp, const Any& rValue) const; - static void convertTarget(OStringBuffer& sTmp, const Any& rTarget); - static Reference getParagraphTarget( const ParagraphTarget& pTarget ); void convertTiming(OStringBuffer& sTmp, const Any& rValue) const; private: @@ -965,55 +965,6 @@ void AnimationsExporter::exportNodeImpl(const Reference& xNode) } } -Reference AnimationsExporter::getParagraphTarget(const ParagraphTarget& pTarget) -{ - try - { - Reference xParaEnumAccess(pTarget.Shape, UNO_QUERY_THROW); - - Reference xEnumeration(xParaEnumAccess->createEnumeration(), - css::uno::UNO_SET_THROW); - sal_Int32 nParagraph = pTarget.Paragraph; - - while (xEnumeration->hasMoreElements()) - { - Reference xRef(xEnumeration->nextElement(), UNO_QUERY); - if (nParagraph-- == 0) - return xRef; - } - } - catch (const RuntimeException&) - { - TOOLS_WARN_EXCEPTION("sd", "AnimationsExporter::getParagraphTarget"); - } - - Reference xRef; - return xRef; -} - -void AnimationsExporter::convertTarget(OStringBuffer& sTmp, const Any& rTarget) -{ - if (!rTarget.hasValue()) - return; - - Reference xRef; - if (!(rTarget >>= xRef)) - { - if (auto pt = o3tl::tryAccess(rTarget)) - { - xRef = getParagraphTarget(*pt); - } - } - - SAL_WARN_IF(!xRef.is(), "sd", "AnimationsExporter::convertTarget(), invalid target type!"); - if (xRef.is()) - { - const std::string aIdentifier(GetInterfaceHash(xRef)); - if (!aIdentifier.empty()) - sTmp.append(aIdentifier); - } -} - void AnimationsExporter::convertTiming(OStringBuffer& sTmp, const Any& rValue) const { if (!rValue.hasValue()) @@ -1056,7 +1007,7 @@ void AnimationsExporter::convertTiming(OStringBuffer& sTmp, const Any& rValue) c { if (pEvent->Source.hasValue()) { - convertTarget(sTmp, pEvent->Source); + anim::convertTarget(sTmp, pEvent->Source); sTmp.append('.'); } @@ -1219,7 +1170,7 @@ void AnimationsExporter::exportContainer(const Reference& xConta Any aTemp(xIter->getTarget()); if (aTemp.hasValue()) { - convertTarget(sTmp, aTemp); + anim::convertTarget(sTmp, aTemp); mrWriter.put("targetElement", sTmp.makeStringAndClear()); } sal_Int16 nTemp = xIter->getSubItem(); @@ -1273,7 +1224,7 @@ void AnimationsExporter::exportAnimate(const Reference& xAnimate) Any aTemp(xAnimate->getTarget()); if (aTemp.hasValue()) { - convertTarget(sTmp, aTemp); + anim::convertTarget(sTmp, aTemp); mrWriter.put("targetElement", sTmp.makeStringAndClear()); } nTemp = xAnimate->getSubItem(); @@ -4574,12 +4525,38 @@ namespace { // use VCL slideshow renderer or not - leave the old one in for now, so it is possible to compare output constexpr const bool bVCLSlideShowRenderer = true; + +bool isRequestedSlideValid(SdDrawDocument* mpDoc, sal_Int32 nSlideNumber, const std::string& slideHash) +{ + try + { + uno::Reference xDrawPages(getXWeak(mpDoc->getUnoModel()), + uno::UNO_QUERY_THROW); + uno::Reference xSlides(xDrawPages->getDrawPages(), + uno::UNO_QUERY_THROW); + uno::Reference xSlide(xSlides->getByIndex(nSlideNumber), + uno::UNO_QUERY_THROW); + if (xSlide.is()) { + return slideHash == GetInterfaceHash(xSlide); + } + } + catch (uno::Exception&) + { + TOOLS_WARN_EXCEPTION( "sd", "SdXImpressDocument::createLOKSlideRenderer: failed" ); + } + return false; +} } bool SdXImpressDocument::createSlideRenderer( + const OString& rSlideHash, sal_Int32 nSlideNumber, sal_Int32& nViewWidth, sal_Int32& nViewHeight, bool bRenderBackground, bool bRenderMasterPage) { + std::string sSlideHash(rSlideHash); + if (!isRequestedSlideValid(mpDoc, nSlideNumber, sSlideHash)) + return false; + if (bVCLSlideShowRenderer) { SdPage* pPage = mpDoc->GetSdPage(sal_uInt16(nSlideNumber), PageKind::Standard); diff --git a/sd/source/ui/view/DocumentRenderer.cxx b/sd/source/ui/view/DocumentRenderer.cxx index 467c3fba4bc9..f309f13dfdcb 100644 --- a/sd/source/ui/view/DocumentRenderer.cxx +++ b/sd/source/ui/view/DocumentRenderer.cxx @@ -43,7 +43,9 @@ #include #include #include +#include #include +#include #include #include #include @@ -858,18 +860,10 @@ namespace { if (pNotesObj) { // new page(s) margins - sal_Int32 nLeft = 2000; - sal_Int32 nRight = 2000; - sal_Int32 nTop = 2250; - sal_Int32 nBottom = 2250; - - double nRatioX = aPageSize.Width() / 21000.0; - double nRatioY = aPageSize.Height() / 29700.0; - - nLeft *= nRatioX; - nRight *= nRatioX; - nTop *= nRatioY; - nBottom *= nRatioY; + sal_Int32 nLeft = aPageSize.Width() * 0.1; + sal_Int32 nRight = nLeft; + sal_Int32 nTop = aPageSize.Height() * 0.075; + sal_Int32 nBottom = nTop; Point aNotesPt = pNotesObj->GetRelativePos(); Size aNotesSize = pNotesObj->GetLogicRect().GetSize(); @@ -914,6 +908,7 @@ namespace { sal_Int32 nPrevLineLen = 0; sal_Int32 nPrevParaIdx = 0; sal_uInt16 nActualPageNumb = 1; + sal_uInt16 nPrevParaLowerSpace = 0; ::tools::Long nCurrentPosY = aNotesPt.Y(); sal_Int32 nParaCount = pOut->GetParagraphCount(); std::vector> aPageBreaks; @@ -921,11 +916,27 @@ namespace { for (sal_Int32 i = 0; i < nParaCount && !bExit; ++i) { sal_Int32 nActualLineLen = 0; - sal_uInt32 nLineCount = pOut->GetLineCount(i); - for (sal_uInt32 j = 0; j < nLineCount; ++j) + sal_Int32 nLineCount = pOut->GetLineCount(i); + + sal_uInt16 nLowerSpace = 0; + sal_uInt16 nUpperSpace = nPrevParaLowerSpace; + const SfxItemSet* pItemSet = &pOut->GetParaAttribs(i); + if(pItemSet->HasItem(EE_PARA_ULSPACE)) + { + nLowerSpace = pItemSet->Get(EE_PARA_ULSPACE).GetLower(); + nUpperSpace = (i != 0) ? pItemSet->Get(EE_PARA_ULSPACE).GetUpper() : 0; + if (nPrevParaLowerSpace > nUpperSpace) + nUpperSpace = nPrevParaLowerSpace; + } + + for (sal_Int32 j = 0; j < nLineCount; ++j) { nActualLineLen += pOut->GetLineLen(i, j); sal_Int32 nLineHeight = pOut->GetLineHeight(i, j); + + if (nUpperSpace != 0 && (i > 0) && (j == 0)) + nLineHeight += nUpperSpace; + sal_Int32 nNextPosY = nCurrentPosY + nLineHeight; if (nNextPosY > nNotesPageBottom) @@ -962,6 +973,10 @@ namespace { break; } } + + if (nUpperSpace > 0) + nLineHeight -= nUpperSpace; + nNotesPageBottom = aPageSize.Height() - nBottom; nCurrentPosY = nTop; nActualPageNumb++; @@ -971,6 +986,7 @@ namespace { nPrevLineLen = nActualLineLen; nCurrentPosY += nLineHeight; } + nPrevParaLowerSpace = nLowerSpace; } if (!aPageBreaks.empty()) @@ -993,13 +1009,6 @@ namespace { aE.start.nIndex = 0; aE.end.nPara = aPageBreaks[0].first; aE.end.nIndex = aPageBreaks[0].second; - - if (aPageBreaks[0].second != 0) // Multi-line - { - pOut->QuickInsertLineBreak(ESelection(aE.end.nPara, aE.end.nIndex, - aE.end.nPara, aE.end.nIndex)); - nTop -= pOut->GetLineHeight(0,0); - } pOut->QuickDelete(aE); Paragraph* pFirstPara = pOut->GetParagraph(0); @@ -2454,9 +2463,8 @@ private: rInfo.meOrientation, nPaperBin)); } - else // Notes + else if (SdPage* pPage = GetFilteredPage(nPageIndex, PageKind::Notes))// Notes { - SdPage* pPage = GetFilteredPage(nPageIndex, PageKind::Notes); SdDrawDocument* pDocument = mrBase.GetMainViewShell()->GetDoc(); // Clone the current page to create an independent instance. @@ -2473,10 +2481,8 @@ private: if (pNotesObj && bCutPage) { // default margins - sal_Int32 nTopMargin = 2250, nBottomMargin = 2250; - double nRatioY = aPageSize.Height() / 29700.0; - nTopMargin *= nRatioY; - nBottomMargin *= nRatioY; + sal_Int32 nTopMargin = aPageSize.Height() * 0.075; + sal_Int32 nBottomMargin = nTopMargin; Size nNotesObjSize = pNotesObj->GetLogicRect().GetSize(); diff --git a/sd/uiconfig/simpress/ui/masterpagepanelrecent.ui b/sd/uiconfig/simpress/ui/masterpagepanelrecent.ui index 9be8d5a3ec9e..20063199c4f5 100644 --- a/sd/uiconfig/simpress/ui/masterpagepanelrecent.ui +++ b/sd/uiconfig/simpress/ui/masterpagepanelrecent.ui @@ -38,7 +38,7 @@ True - Select recenty used master slide. + Select recently used master slide. diff --git a/setup_native/Library_inst_msu_msi.mk b/setup_native/Library_inst_msu_msi.mk deleted file mode 100644 index 1a6646f2fa30..000000000000 --- a/setup_native/Library_inst_msu_msi.mk +++ /dev/null @@ -1,41 +0,0 @@ -# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- -# -# 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/. -# - -$(eval $(call gb_Library_Library,inst_msu_msi)) - -$(eval $(call gb_Library_add_defs,inst_msu_msi,\ - -U_DLL \ -)) - -$(eval $(call gb_Library_add_cxxflags,inst_msu_msi,\ - $(if $(MSVC_USE_DEBUG_RUNTIME),/MTd,/MT) \ - $(if $(filter -fsanitize=%,$(CC)),,/fno-sanitize-address-vcasan-lib) \ -)) - -$(eval $(call gb_Library_add_ldflags,inst_msu_msi,\ - /DEF:$(SRCDIR)/setup_native/source/win32/customactions/inst_msu/inst_msu_msi.def \ - /NODEFAULTLIB \ -)) - -$(eval $(call gb_Library_add_exception_objects,inst_msu_msi,\ - setup_native/source/win32/customactions/inst_msu/inst_msu \ -)) - -$(eval $(call gb_Library_use_system_win32_libs,inst_msu_msi,\ - libcmt \ - libcpmt \ - libucrt \ - libvcruntime \ - kernel32 \ - Ole32 \ - Shell32 \ - Msi \ -)) - -# vim: set noet sw=4 ts=4: diff --git a/setup_native/Module_setup_native.mk b/setup_native/Module_setup_native.mk index 42fa1421786d..12a6b7cc837d 100644 --- a/setup_native/Module_setup_native.mk +++ b/setup_native/Module_setup_native.mk @@ -23,7 +23,6 @@ $(eval $(call gb_Module_add_targets,setup_native,\ ifeq ($(OS),WNT) $(eval $(call gb_Module_add_targets,setup_native,\ Library_instooofiltmsi \ - Library_inst_msu_msi \ Library_qslnkmsi \ Library_reg_dlls \ Library_reg4allmsdoc \ diff --git a/setup_native/source/win32/customactions/inst_msu/inst_msu.cxx b/setup_native/source/win32/customactions/inst_msu/inst_msu.cxx deleted file mode 100644 index d890f2628193..000000000000 --- a/setup_native/source/win32/customactions/inst_msu/inst_msu.cxx +++ /dev/null @@ -1,678 +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/. - */ - -#include -#include -#include -#include - -#define WIN32_LEAN_AND_MEAN -#include -#include -#include -#include - -namespace -{ -template std::string Num2Hex(IntType n) -{ - std::stringstream sMsg; - sMsg << "0x" << std::uppercase << std::setfill('0') << std::setw(sizeof(n) * 2) << std::hex - << n; - return sMsg.str(); -} - -template std::string Num2Dec(IntType n) -{ - std::stringstream sMsg; - sMsg << n; - return sMsg.str(); -} - -std::string Win32ErrorMessage(const char* sFunc, DWORD nWin32Error) -{ - std::stringstream sMsg; - sMsg << sFunc << " failed with Win32 error code " << Num2Hex(nWin32Error) << "!"; - - return sMsg.str(); -} - -void ThrowHResult(const char* sFunc, HRESULT hr) -{ - std::stringstream sMsg; - sMsg << sFunc << " failed (HRESULT = " << Num2Hex(hr) << ")!"; - - throw std::exception(sMsg.str().c_str()); -} - -void CheckHResult(const char* sFunc, HRESULT hr) -{ - if (FAILED(hr)) - ThrowHResult(sFunc, hr); -} - -void ThrowWin32Error(const char* sFunc, DWORD nWin32Error) -{ - throw std::exception(Win32ErrorMessage(sFunc, nWin32Error).c_str()); -} - -void ThrowLastError(const char* sFunc) { ThrowWin32Error(sFunc, GetLastError()); } - -void CheckWin32Error(const char* sFunc, DWORD nWin32Error) -{ - if (nWin32Error != ERROR_SUCCESS) - ThrowWin32Error(sFunc, nWin32Error); -} - -std::wstring GetKnownFolder(const KNOWNFOLDERID& rfid) -{ - PWSTR sPath = nullptr; - HRESULT hr = SHGetKnownFolderPath(rfid, KF_FLAG_DEFAULT, nullptr, &sPath); - CheckHResult("SHGetKnownFolderPath", hr); - std::wstring sResult(sPath); - CoTaskMemFree(sPath); - return sResult; -} - -void WriteLogElem(MSIHANDLE hInst, MSIHANDLE hRecord, std::ostringstream& sTmpl, UINT) -{ - MsiRecordSetStringA(hRecord, 0, sTmpl.str().c_str()); - MsiProcessMessage(hInst, INSTALLMESSAGE_INFO, hRecord); -} - -void RecSetString(MSIHANDLE hRec, UINT nField, LPCSTR sVal) -{ - MsiRecordSetStringA(hRec, nField, sVal); -} - -void RecSetString(MSIHANDLE hRec, UINT nField, LPCWSTR sVal) -{ - MsiRecordSetStringW(hRec, nField, sVal); -} - -template -void WriteLogElem(MSIHANDLE hInst, MSIHANDLE hRec, std::ostringstream& sTmpl, UINT nField, - const S1& elem, const SOther&... others); - -template -void WriteLogElem(MSIHANDLE hInst, MSIHANDLE hRec, std::ostringstream& sTmpl, UINT nField, - const Ch* elem, const SOther&... others) -{ - sTmpl << " [" << nField << "]"; - RecSetString(hRec, nField, elem); - WriteLogElem(hInst, hRec, sTmpl, nField + 1, others...); -} - -template -void WriteLogElem(MSIHANDLE hInst, MSIHANDLE hRec, std::ostringstream& sTmpl, UINT nField, - const S1& elem, const SOther&... others) -{ - WriteLogElem(hInst, hRec, sTmpl, nField, elem.c_str(), others...); -} - -std::string sLogPrefix; - -template void WriteLog(MSIHANDLE hInst, const StrType&... elements) -{ - PMSIHANDLE hRec = MsiCreateRecord(sizeof...(elements)); - if (!hRec) - return; - - std::ostringstream sTemplate; - sTemplate << sLogPrefix; - WriteLogElem(hInst, hRec, sTemplate, 1, elements...); -} - -// Show a warning message box. This will be automatically suppressed in unattended installation. -void ShowWarning(MSIHANDLE hInst, const std::wstring& sKBNo, const char* sMessage) -{ - // Error table's message #25000: "Installing a pre-requisite [2] failed. - // You might need to manually install it from Microsoft site to be able to run the product.[3]" - PMSIHANDLE hRec = MsiCreateRecord(3); - // To show a message from Error table, record's Field 0 must be null - MsiRecordSetInteger(hRec, 1, 25000); - MsiRecordSetStringW(hRec, 2, sKBNo.c_str()); - std::string s("\n"); - s += sMessage; - MsiRecordSetStringA(hRec, 3, s.c_str()); - MsiProcessMessage(hInst, INSTALLMESSAGE_WARNING, hRec); -} - -// Set custom action description visible in progress dialog -void SetStatusText(MSIHANDLE hInst, const std::wstring& actName, const std::wstring& actDesc) -{ - PMSIHANDLE hRec = MsiCreateRecord(3); - // For INSTALLMESSAGE_ACTIONSTART, record's Field 0 must be null - // Field 1: Action name - must be non-null - MsiRecordSetStringW(hRec, 1, actName.c_str()); - // Field 2: Action description - displayed in dialog - MsiRecordSetStringW(hRec, 2, actDesc.c_str()); - // Let Field 3 stay null - no action template - MsiProcessMessage(hInst, INSTALLMESSAGE_ACTIONSTART, hRec); -} - -typedef std::unique_ptr CloseHandleGuard; -CloseHandleGuard Guard(HANDLE h) { return CloseHandleGuard(h, CloseHandle); } - -typedef std::unique_ptr DeleteFileGuard; -DeleteFileGuard Guard(const wchar_t* sFileName) { return DeleteFileGuard(sFileName, DeleteFileW); } - -typedef std::unique_ptr CloseServiceHandleGuard; -CloseServiceHandleGuard Guard(SC_HANDLE h) -{ - return CloseServiceHandleGuard(h, CloseServiceHandle); -} - -std::wstring GetTempFile() -{ - wchar_t sPath[MAX_PATH + 1]; - DWORD nResult = GetTempPathW(sizeof(sPath) / sizeof(*sPath), sPath); - if (!nResult) - ThrowLastError("GetTempPathW"); - - wchar_t sFile[MAX_PATH + 1]; - nResult = GetTempFileNameW(sPath, L"TMP", 0, sFile); - if (!nResult) - ThrowLastError("GetTempFileNameW"); - return sFile; -} - -bool IsWow64Process() -{ -#if !defined _WIN64 - BOOL bResult = FALSE; - typedef BOOL(WINAPI * LPFN_ISWOW64PROCESS)(HANDLE, PBOOL); - LPFN_ISWOW64PROCESS fnIsWow64Process = reinterpret_cast( - GetProcAddress(GetModuleHandleW(L"kernel32"), "IsWow64Process")); - - if (fnIsWow64Process) - { - if (!fnIsWow64Process(GetCurrentProcess(), &bResult)) - ThrowLastError("IsWow64Process"); - } - - return bResult; -#else - return false; -#endif -} - -// This class uses MsiProcessMessage to check for user input: it returns IDCANCEL when user cancels -// installation. It throws a special exception, to be intercepted in main action function to return -// corresponding exit code. -class UserInputChecker -{ -public: - class eUserCancelled - { - }; - - UserInputChecker(MSIHANDLE hInstall) - : m_hInstall(hInstall) - , m_hProgressRec(MsiCreateRecord(3)) - { - // Use explicit progress messages - MsiRecordSetInteger(m_hProgressRec, 1, 1); - MsiRecordSetInteger(m_hProgressRec, 2, 1); - MsiRecordSetInteger(m_hProgressRec, 3, 0); - int nResult = MsiProcessMessage(m_hInstall, INSTALLMESSAGE_PROGRESS, m_hProgressRec); - if (nResult == IDCANCEL) - throw eUserCancelled(); - // Prepare the record to following progress update calls - MsiRecordSetInteger(m_hProgressRec, 1, 2); - MsiRecordSetInteger(m_hProgressRec, 2, 0); // step by 0 - don't move progress - MsiRecordSetInteger(m_hProgressRec, 3, 0); - } - - void ThrowIfUserCancelled() - { - // Check if user has cancelled - int nResult = MsiProcessMessage(m_hInstall, INSTALLMESSAGE_PROGRESS, m_hProgressRec); - if (nResult == IDCANCEL) - throw eUserCancelled(); - } - -private: - MSIHANDLE m_hInstall; - PMSIHANDLE m_hProgressRec; -}; - -// Checks if Windows Update service is disabled, and if it is, enables it temporarily. -// Also stops the service if it's currently running, because it seems that wusa.exe -// does not freeze when it starts the service itself. -class WUServiceEnabler -{ -public: - WUServiceEnabler(MSIHANDLE hInstall) - : mhInstall(hInstall) - , mhService(EnableWUService(hInstall)) - { - } - - ~WUServiceEnabler() - { - try - { - if (mhService) - { - EnsureServiceEnabled(mhInstall, mhService.get(), false); - StopService(mhInstall, mhService.get(), false); - } - } - catch (std::exception& e) - { - WriteLog(mhInstall, e.what()); - } - } - -private: - static CloseServiceHandleGuard EnableWUService(MSIHANDLE hInstall) - { - auto hSCM = Guard(OpenSCManagerW(nullptr, nullptr, SC_MANAGER_ALL_ACCESS)); - if (!hSCM) - ThrowLastError("OpenSCManagerW"); - WriteLog(hInstall, "Opened service control manager"); - - auto hService = Guard(OpenServiceW(hSCM.get(), L"wuauserv", - SERVICE_QUERY_CONFIG | SERVICE_CHANGE_CONFIG - | SERVICE_QUERY_STATUS | SERVICE_STOP)); - if (!hService) - ThrowLastError("OpenServiceW"); - WriteLog(hInstall, "Obtained WU service handle"); - - const DWORD nCurrentStatus = ServiceStatus(hInstall, hService.get()); - // Stop currently running service to prevent wusa.exe from hanging trying to detect if the - // update is applicable (sometimes this freezes it ~indefinitely; it seems that it doesn't - // happen if wusa.exe starts the service itself: https://superuser.com/questions/1044528/). - // tdf#124794: Wait for service to stop. - if (nCurrentStatus == SERVICE_RUNNING) - StopService(hInstall, hService.get(), true); - - if (nCurrentStatus == SERVICE_RUNNING - || !EnsureServiceEnabled(hInstall, hService.get(), true)) - { - // No need to restore anything back, since we didn't change config - hService.reset(); - WriteLog(hInstall, "Service configuration is unchanged"); - } - - return hService; - } - - // Returns if the service configuration was actually changed - static bool EnsureServiceEnabled(MSIHANDLE hInstall, SC_HANDLE hService, bool bEnabled) - { - bool bConfigChanged = false; - - DWORD nCbRequired = 0; - if (!QueryServiceConfigW(hService, nullptr, 0, &nCbRequired)) - { - if (DWORD nError = GetLastError(); nError != ERROR_INSUFFICIENT_BUFFER) - ThrowWin32Error("QueryServiceConfigW", nError); - } - std::unique_ptr pBuf(new char[nCbRequired]); - LPQUERY_SERVICE_CONFIGW pConfig = reinterpret_cast(pBuf.get()); - if (!QueryServiceConfigW(hService, pConfig, nCbRequired, &nCbRequired)) - ThrowLastError("QueryServiceConfigW"); - WriteLog(hInstall, "Obtained service config"); - - DWORD eNewStartType = 0; - if (bEnabled && pConfig->dwStartType == SERVICE_DISABLED) - { - bConfigChanged = true; - eNewStartType = SERVICE_DEMAND_START; - WriteLog(hInstall, "Service is disabled, and requested to enable"); - } - else if (!bEnabled && pConfig->dwStartType != SERVICE_DISABLED) - { - bConfigChanged = true; - eNewStartType = SERVICE_DISABLED; - WriteLog(hInstall, "Service is enabled, and requested to disable"); - } - - if (bConfigChanged) - { - if (!ChangeServiceConfigW(hService, SERVICE_NO_CHANGE, eNewStartType, SERVICE_NO_CHANGE, - nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, - nullptr)) - ThrowLastError("ChangeServiceConfigW"); - WriteLog(hInstall, "WU service config successfully changed"); - } - else - WriteLog(hInstall, "No need to modify service config"); - - return bConfigChanged; - } - - static DWORD ServiceStatus(MSIHANDLE hInstall, SC_HANDLE hService) - { - SERVICE_STATUS aServiceStatus{}; - if (!QueryServiceStatus(hService, &aServiceStatus)) - ThrowLastError("QueryServiceStatus"); - - std::string sStatus; - switch (aServiceStatus.dwCurrentState) - { - case SERVICE_STOPPED: - sStatus = "SERVICE_STOPPED"; - break; - case SERVICE_START_PENDING: - sStatus = "SERVICE_START_PENDING"; - break; - case SERVICE_STOP_PENDING: - sStatus = "SERVICE_STOP_PENDING"; - break; - case SERVICE_RUNNING: - sStatus = "SERVICE_RUNNING"; - break; - case SERVICE_CONTINUE_PENDING: - sStatus = "SERVICE_CONTINUE_PENDING"; - break; - case SERVICE_PAUSE_PENDING: - sStatus = "SERVICE_PAUSE_PENDING"; - break; - case SERVICE_PAUSED: - sStatus = "SERVICE_PAUSED"; - break; - default: - sStatus = Num2Hex(aServiceStatus.dwCurrentState); - } - WriteLog(hInstall, "Service status is", sStatus); - - return aServiceStatus.dwCurrentState; - } - - static void StopService(MSIHANDLE hInstall, SC_HANDLE hService, bool bWait) - { - try - { - if (ServiceStatus(hInstall, hService) != SERVICE_STOPPED) - { - SERVICE_STATUS aServiceStatus{}; - if (!ControlService(hService, SERVICE_CONTROL_STOP, &aServiceStatus)) - ThrowLastError("ControlService"); - WriteLog(hInstall, - "Successfully sent SERVICE_CONTROL_STOP code to Windows Update service"); - if (aServiceStatus.dwCurrentState != SERVICE_STOPPED && bWait) - { - // Let user cancel too long wait - UserInputChecker aInputChecker(hInstall); - // aServiceStatus.dwWaitHint is unreasonably high for Windows Update (30000), - // so don't use it, but simply poll service status each second - for (int nWait = 0; nWait < 30; ++nWait) // arbitrary limit of 30 s - { - for (int i = 0; i < 2; ++i) // check user input twice a second - { - Sleep(500); - aInputChecker.ThrowIfUserCancelled(); - } - - if (!QueryServiceStatus(hService, &aServiceStatus)) - ThrowLastError("QueryServiceStatus"); - - if (aServiceStatus.dwCurrentState == SERVICE_STOPPED) - break; - } - } - if (aServiceStatus.dwCurrentState == SERVICE_STOPPED) - WriteLog(hInstall, "Successfully stopped Windows Update service"); - else if (bWait) - WriteLog(hInstall, "Wait for Windows Update stop timed out - proceeding"); - } - else - WriteLog(hInstall, "Windows Update service is not running"); - } - catch (std::exception& e) - { - WriteLog(hInstall, e.what()); - } - } - - MSIHANDLE mhInstall; - CloseServiceHandleGuard mhService; -}; -} - -// Immediate action "unpack_msu" that has access to installation database and properties; checks -// "InstMSUBinary" property and unpacks the binary with that name to a temporary file; sets -// "cleanup_msu" and "inst_msu" properties to the full name of the extracted temporary file. These -// properties will become "CustomActionData" property inside relevant deferred actions. -extern "C" __declspec(dllexport) UINT __stdcall UnpackMSUForInstall(MSIHANDLE hInstall) -{ - try - { - sLogPrefix = "UnpackMSUForInstall:"; - WriteLog(hInstall, "started"); - - WriteLog(hInstall, "Checking value of InstMSUBinary"); - wchar_t sInstMSUBinary[MAX_PATH + 10]; - DWORD nCCh = sizeof(sInstMSUBinary) / sizeof(*sInstMSUBinary); - CheckWin32Error("MsiGetPropertyW", - MsiGetPropertyW(hInstall, L"InstMSUBinary", sInstMSUBinary, &nCCh)); - WriteLog(hInstall, "Got InstMSUBinary value:", - sInstMSUBinary); // KB2999226|Windows61_KB2999226_x64msu - const wchar_t* sBinaryName = wcschr(sInstMSUBinary, L'|'); - if (!sBinaryName) - throw std::exception("No KB number in InstMSUBinary!"); - // "KB2999226" - const std::wstring sKBNo(sInstMSUBinary, sBinaryName - sInstMSUBinary); - ++sBinaryName; - - PMSIHANDLE hDatabase = MsiGetActiveDatabase(hInstall); - if (!hDatabase) - ThrowLastError("MsiGetActiveDatabase"); - WriteLog(hInstall, "MsiGetActiveDatabase succeeded"); - - std::wstringstream sQuery; - sQuery << "SELECT `Data` FROM `Binary` WHERE `Name`='" << sBinaryName << "'"; - - PMSIHANDLE hBinaryView; - CheckWin32Error("MsiDatabaseOpenViewW", - MsiDatabaseOpenViewW(hDatabase, sQuery.str().c_str(), &hBinaryView)); - WriteLog(hInstall, "MsiDatabaseOpenViewW succeeded"); - - CheckWin32Error("MsiViewExecute", MsiViewExecute(hBinaryView, 0)); - WriteLog(hInstall, "MsiViewExecute succeeded"); - - PMSIHANDLE hBinaryRecord; - CheckWin32Error("MsiViewFetch", MsiViewFetch(hBinaryView, &hBinaryRecord)); - WriteLog(hInstall, "MsiViewFetch succeeded"); - - const std::wstring sBinary = GetTempFile(); - auto aDeleteFileGuard(Guard(sBinary.c_str())); - WriteLog(hInstall, "Temp file path:", sBinary.c_str()); - - CheckWin32Error("MsiSetPropertyW", - MsiSetPropertyW(hInstall, L"cleanup_msu", sBinary.c_str())); - - { - HANDLE hFile = CreateFileW(sBinary.c_str(), GENERIC_WRITE, 0, nullptr, CREATE_ALWAYS, - FILE_ATTRIBUTE_NORMAL, nullptr); - if (hFile == INVALID_HANDLE_VALUE) - ThrowLastError("CreateFileW"); - auto aFileHandleGuard(Guard(hFile)); - - const DWORD nBufSize = 1024 * 1024; - std::unique_ptr buf(new char[nBufSize]); - DWORD nTotal = 0; - DWORD nRead; - do - { - nRead = nBufSize; - CheckWin32Error("MsiRecordReadStream", - MsiRecordReadStream(hBinaryRecord, 1, buf.get(), &nRead)); - - if (nRead > 0) - { - DWORD nWritten; - if (!WriteFile(hFile, buf.get(), nRead, &nWritten, nullptr)) - ThrowLastError("WriteFile"); - nTotal += nWritten; - } - } while (nRead == nBufSize); - - WriteLog(hInstall, "Successfully wrote", Num2Dec(nTotal), "bytes"); - } - const std::wstring s_inst_msu = sKBNo + L"|" + sBinary; - CheckWin32Error("MsiSetPropertyW", - MsiSetPropertyW(hInstall, L"inst_msu", s_inst_msu.c_str())); - - // Don't delete the file: it will be done by following actions (inst_msu or cleanup_msu) - (void)aDeleteFileGuard.release(); - return ERROR_SUCCESS; - } - catch (std::exception& e) - { - WriteLog(hInstall, e.what()); - } - return ERROR_INSTALL_FAILURE; -} - -// Deferred action "inst_msu" that must be run from system account. Receives the tempfile name from -// "CustomActionData" property, and runs wusa.exe to install it. Waits for it and checks exit code. -extern "C" __declspec(dllexport) UINT __stdcall InstallMSU(MSIHANDLE hInstall) -{ - std::wstring sKBNo; // "KB2999226" - try - { - sLogPrefix = "InstallMSU:"; - WriteLog(hInstall, "started"); - - WriteLog(hInstall, "Checking value of CustomActionData"); - wchar_t sCustomActionData[MAX_PATH + 10]; // "KB2999226|C:\Temp\binary.tmp" - DWORD nCCh = sizeof(sCustomActionData) / sizeof(*sCustomActionData); - CheckWin32Error("MsiGetPropertyW", - MsiGetPropertyW(hInstall, L"CustomActionData", sCustomActionData, &nCCh)); - WriteLog(hInstall, "Got CustomActionData value:", sCustomActionData); - const wchar_t* sBinaryName = wcschr(sCustomActionData, L'|'); - if (!sBinaryName) - throw std::exception("No KB number in CustomActionData!"); - sKBNo = std::wstring(sCustomActionData, sBinaryName - sCustomActionData); - ++sBinaryName; - auto aDeleteFileGuard(Guard(sBinaryName)); - - SetStatusText(hInstall, L"WU service state check", - L"Checking Windows Update service state"); - - // In case the Windows Update service is disabled, we temporarily enable it here. We also - // stop running WU service, to avoid wusa.exe freeze (see comment in EnableWUService). - WUServiceEnabler aWUServiceEnabler(hInstall); - - SetStatusText(hInstall, sKBNo + L" installation", L"Installing " + sKBNo); - - const bool bWow64Process = IsWow64Process(); - WriteLog(hInstall, "Is Wow64 Process:", bWow64Process ? "YES" : "NO"); - std::wstring sWUSAPath = bWow64Process ? GetKnownFolder(FOLDERID_Windows) + L"\\SysNative" - : GetKnownFolder(FOLDERID_System); - sWUSAPath += L"\\wusa.exe"; - WriteLog(hInstall, "Prepared wusa path:", sWUSAPath); - - std::wstring sWUSACmd - = L"\"" + sWUSAPath + L"\" \"" + sBinaryName + L"\" /quiet /norestart"; - WriteLog(hInstall, "Prepared wusa command:", sWUSACmd); - - STARTUPINFOW si{}; - si.cb = sizeof(si); - PROCESS_INFORMATION pi{}; - if (!CreateProcessW(sWUSAPath.c_str(), const_cast(sWUSACmd.c_str()), nullptr, - nullptr, FALSE, CREATE_NO_WINDOW, nullptr, nullptr, &si, &pi)) - ThrowLastError("CreateProcessW"); - CloseHandle(pi.hThread); - auto aCloseProcHandleGuard(Guard(pi.hProcess)); - WriteLog(hInstall, "CreateProcessW succeeded"); - - { - // This block waits when the started wusa.exe process finishes. Since it's possible - // for wusa.exe in some circumstances to wait really long (indefinitely?), we check - // for user input here. - UserInputChecker aInputChecker(hInstall); - for (;;) - { - DWORD nWaitResult = WaitForSingleObject(pi.hProcess, 500); - if (nWaitResult == WAIT_OBJECT_0) - break; // wusa.exe finished - else if (nWaitResult == WAIT_TIMEOUT) - aInputChecker.ThrowIfUserCancelled(); - else - ThrowWin32Error("WaitForSingleObject", nWaitResult); - } - } - - DWORD nExitCode = 0; - if (!GetExitCodeProcess(pi.hProcess, &nExitCode)) - ThrowLastError("GetExitCodeProcess"); - - HRESULT hr = static_cast(nExitCode); - - // HRESULT_FROM_WIN32 is defined as an inline function in SDK 8.1 without the constexpr - // And it won't work to place it inside the switch statement. - if (HRESULT_FROM_WIN32(ERROR_SUCCESS_REBOOT_REQUIRED) == hr) - { - hr = ERROR_SUCCESS_REBOOT_REQUIRED; - } - - switch (hr) - { - case S_OK: - case WU_S_ALREADY_INSTALLED: - case WU_E_NOT_APPLICABLE: // Windows could lie us about its version, etc. - case ERROR_SUCCESS_REBOOT_REQUIRED: - case WU_S_REBOOT_REQUIRED: - WriteLog(hInstall, "wusa.exe succeeded with exit code", Num2Hex(nExitCode)); - return ERROR_SUCCESS; - - default: - ThrowHResult("Execution of wusa.exe", hr); - } - } - catch (const UserInputChecker::eUserCancelled&) - { - return ERROR_INSTALL_USEREXIT; - } - catch (std::exception& e) - { - WriteLog(hInstall, e.what()); - ShowWarning(hInstall, sKBNo, e.what()); - } - return ERROR_SUCCESS; // Do not break on MSU installation errors -} - -// Rollback deferred action "cleanup_msu" that is executed on error or cancel. -// It removes the temporary file created by UnpackMSUForInstall action. -// MUST be placed IMMEDIATELY AFTER "unpack_msu" in execute sequence. -extern "C" __declspec(dllexport) UINT __stdcall CleanupMSU(MSIHANDLE hInstall) -{ - try - { - sLogPrefix = "CleanupMSU:"; - WriteLog(hInstall, "started"); - - WriteLog(hInstall, "Checking value of CustomActionData"); - wchar_t sBinaryName[MAX_PATH + 1]; - DWORD nCCh = sizeof(sBinaryName) / sizeof(*sBinaryName); - CheckWin32Error("MsiGetPropertyW", - MsiGetPropertyW(hInstall, L"CustomActionData", sBinaryName, &nCCh)); - WriteLog(hInstall, "Got CustomActionData value:", sBinaryName); - - if (!DeleteFileW(sBinaryName)) - { - if (DWORD nError = GetLastError(); nError != ERROR_FILE_NOT_FOUND) - ThrowWin32Error("DeleteFileW", nError); - } - WriteLog(hInstall, "File successfully removed"); - } - catch (std::exception& e) - { - WriteLog(hInstall, e.what()); - } - // Always return success - we don't want rollback to fail. - return ERROR_SUCCESS; -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/setup_native/source/win32/customactions/inst_msu/inst_msu_msi.def b/setup_native/source/win32/customactions/inst_msu/inst_msu_msi.def deleted file mode 100644 index 49ade9c0169e..000000000000 --- a/setup_native/source/win32/customactions/inst_msu/inst_msu_msi.def +++ /dev/null @@ -1,5 +0,0 @@ -LIBRARY "inst_msu_msi.dll" -EXPORTS - UnpackMSUForInstall - InstallMSU - CleanupMSU \ No newline at end of file diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx index bceff30d1edc..82261d007e67 100644 --- a/sfx2/source/appl/newhelp.cxx +++ b/sfx2/source/appl/newhelp.cxx @@ -406,7 +406,7 @@ IndexTabPage_Impl::IndexTabPage_Impl(weld::Widget* pParent, SfxHelpIndexWindow_I aAutoCompleteIdle.SetInvokeHandler( LINK(this, IndexTabPage_Impl, AutoCompleteHdl )); aKeywordTimer.SetInvokeHandler( LINK( this, IndexTabPage_Impl, TimeoutHdl ) ); m_xIndexList->connect_row_activated(LINK(this, IndexTabPage_Impl, DoubleClickHdl)); - m_xIndexList->connect_changed(LINK(this, IndexTabPage_Impl, TreeChangeHdl)); + m_xIndexList->connect_selection_changed(LINK(this, IndexTabPage_Impl, TreeChangeHdl)); m_xIndexList->connect_custom_get_size(LINK(this, IndexTabPage_Impl, CustomGetSizeHdl)); m_xIndexList->connect_custom_render(LINK(this, IndexTabPage_Impl, CustomRenderHdl)); m_xIndexList->set_column_custom_renderer(0, true); diff --git a/sfx2/source/control/templatedlglocalview.cxx b/sfx2/source/control/templatedlglocalview.cxx index f6e18feca816..241166bf027a 100644 --- a/sfx2/source/control/templatedlglocalview.cxx +++ b/sfx2/source/control/templatedlglocalview.cxx @@ -31,7 +31,7 @@ TemplateDlgLocalView::TemplateDlgLocalView(std::unique_ptr { mxTreeView->connect_row_activated(LINK(this, TemplateDlgLocalView, RowActivatedHdl)); mxTreeView->connect_column_clicked(LINK(this, ListView, ColumnClickedHdl)); - mxTreeView->connect_changed(LINK(this, TemplateDlgLocalView, ListViewChangedHdl)); + mxTreeView->connect_selection_changed(LINK(this, TemplateDlgLocalView, ListViewChangedHdl)); mxTreeView->connect_popup_menu(LINK(this, TemplateDlgLocalView, PopupMenuHdl)); mxTreeView->connect_key_press(LINK(this, TemplateDlgLocalView, KeyPressHdl)); } diff --git a/sfx2/source/devtools/DevelopmentToolDockingWindow.cxx b/sfx2/source/devtools/DevelopmentToolDockingWindow.cxx index c3fb090ac752..f3bf2a529236 100644 --- a/sfx2/source/devtools/DevelopmentToolDockingWindow.cxx +++ b/sfx2/source/devtools/DevelopmentToolDockingWindow.cxx @@ -37,7 +37,7 @@ DevelopmentToolDockingWindow::DevelopmentToolDockingWindow(SfxBindings* pInputBi pInputBindings->GetDispatcher()->GetFrame()->GetObjectShell()->GetBaseModel()) , maObjectInspectorTreeHandler(mpObjectInspectorWidgets) { - mpDocumentModelTreeView->connect_changed( + mpDocumentModelTreeView->connect_selection_changed( LINK(this, DevelopmentToolDockingWindow, DocumentModelTreeViewSelectionHandler)); mpDomToolbar->connect_clicked( LINK(this, DevelopmentToolDockingWindow, DomToolbarButtonClicked)); diff --git a/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx b/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx index fd9f879ab446..bd403d84c5a3 100644 --- a/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx +++ b/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx @@ -941,13 +941,13 @@ ObjectInspectorTreeHandler::ObjectInspectorTreeHandler( mpObjectInspectorWidgets->mpPropertiesTreeView->connect_popup_menu( LINK(this, ObjectInspectorTreeHandler, PopupMenuHandler)); - mpObjectInspectorWidgets->mpInterfacesTreeView->connect_changed( + mpObjectInspectorWidgets->mpInterfacesTreeView->connect_selection_changed( LINK(this, ObjectInspectorTreeHandler, SelectionChanged)); - mpObjectInspectorWidgets->mpServicesTreeView->connect_changed( + mpObjectInspectorWidgets->mpServicesTreeView->connect_selection_changed( LINK(this, ObjectInspectorTreeHandler, SelectionChanged)); - mpObjectInspectorWidgets->mpPropertiesTreeView->connect_changed( + mpObjectInspectorWidgets->mpPropertiesTreeView->connect_selection_changed( LINK(this, ObjectInspectorTreeHandler, SelectionChanged)); - mpObjectInspectorWidgets->mpMethodsTreeView->connect_changed( + mpObjectInspectorWidgets->mpMethodsTreeView->connect_selection_changed( LINK(this, ObjectInspectorTreeHandler, SelectionChanged)); mpObjectInspectorWidgets->mpInterfacesTreeView->make_sorted(); diff --git a/sfx2/source/dialog/StyleList.cxx b/sfx2/source/dialog/StyleList.cxx index 60151d2c83ad..8fa08c908715 100644 --- a/sfx2/source/dialog/StyleList.cxx +++ b/sfx2/source/dialog/StyleList.cxx @@ -369,11 +369,11 @@ void StyleList::Initialize() m_xFmtLb->connect_row_activated(LINK(this, StyleList, TreeListApplyHdl)); m_xFmtLb->connect_mouse_press(LINK(this, StyleList, MousePressHdl)); m_xFmtLb->connect_query_tooltip(LINK(this, StyleList, QueryTooltipHdl)); - m_xFmtLb->connect_changed(LINK(this, StyleList, FmtSelectHdl)); + m_xFmtLb->connect_selection_changed(LINK(this, StyleList, FmtSelectHdl)); m_xFmtLb->connect_popup_menu(LINK(this, StyleList, PopupFlatMenuHdl)); m_xFmtLb->connect_key_press(LINK(this, StyleList, KeyInputHdl)); m_xFmtLb->set_selection_mode(SelectionMode::Multiple); - m_xTreeBox->connect_changed(LINK(this, StyleList, FmtSelectHdl)); + m_xTreeBox->connect_selection_changed(LINK(this, StyleList, FmtSelectHdl)); m_xTreeBox->connect_row_activated(LINK(this, StyleList, TreeListApplyHdl)); m_xTreeBox->connect_mouse_press(LINK(this, StyleList, MousePressHdl)); m_xTreeBox->connect_query_tooltip(LINK(this, StyleList, QueryTooltipHdl)); diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx index 9ada2fe6c2a2..07325adf3085 100644 --- a/sfx2/source/dialog/filedlghelper.cxx +++ b/sfx2/source/dialog/filedlghelper.cxx @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -2081,10 +2082,19 @@ void FileDialogHelper_Impl::saveConfig() try { + // tdf#61358 - remember the last "insert as link" state + if (o3tl::IsRunningUITest()) + aValue <<= false; + else + aValue = xDlg->getValue(ExtendedFilePickerElementIds::CHECKBOX_LINK, 0); + bool bLink = false; + aValue >>= bLink; + OUString aUserData(GRF_CONFIG_STR); + SetToken(aUserData, 0, ' ', OUString::number(static_cast(bLink))); + aValue = xDlg->getValue( ExtendedFilePickerElementIds::CHECKBOX_PREVIEW, 0 ); bool bValue = false; aValue >>= bValue; - OUString aUserData(GRF_CONFIG_STR); SetToken( aUserData, 1, ' ', OUString::number( static_cast(bValue) ) ); INetURLObject aObj( getPath() ); diff --git a/sfx2/source/dialog/versdlg.cxx b/sfx2/source/dialog/versdlg.cxx index e63721ffecde..f81bfbc2b4fa 100644 --- a/sfx2/source/dialog/versdlg.cxx +++ b/sfx2/source/dialog/versdlg.cxx @@ -170,7 +170,7 @@ SfxVersionDialog::SfxVersionDialog(weld::Window* pParent, SfxViewFrame* pVwFrame m_xSaveCheckBox->connect_toggled(LINK(this, SfxVersionDialog, ToggleHdl_Impl)); m_xCmisButton->connect_clicked( aClickLink ); - m_xVersionBox->connect_changed( LINK( this, SfxVersionDialog, SelectHdl_Impl ) ); + m_xVersionBox->connect_selection_changed(LINK(this, SfxVersionDialog, SelectHdl_Impl)); m_xVersionBox->connect_row_activated( LINK( this, SfxVersionDialog, DClickHdl_Impl ) ); m_xVersionBox->grab_focus(); diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index 13711a5a31c5..4b637f2405cf 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -589,7 +589,7 @@ void SfxMedium::CheckFileDate( const util::DateTime& aInitDate ) xHandler->handle( xInteractionRequestImpl ); ::rtl::Reference< ::ucbhelper::InteractionContinuation > xSelected = xInteractionRequestImpl->getSelection(); - if ( uno::Reference< task::XInteractionAbort >( xSelected.get(), uno::UNO_QUERY ).is() ) + if ( uno::Reference< task::XInteractionAbort >( cppu::getXWeak(xSelected.get()), uno::UNO_QUERY ).is() ) { SetError(ERRCODE_ABORT); } @@ -1170,11 +1170,11 @@ SfxMedium::ShowLockResult SfxMedium::ShowLockedDocumentDialog(const LockFileEntr bool bOpenReadOnly = false; ::rtl::Reference< ::ucbhelper::InteractionContinuation > xSelected = xInteractionRequestImpl->getSelection(); - if ( uno::Reference< task::XInteractionAbort >( xSelected.get(), uno::UNO_QUERY ).is() ) + if ( uno::Reference< task::XInteractionAbort >( cppu::getXWeak(xSelected.get()), uno::UNO_QUERY ).is() ) { SetError(ERRCODE_ABORT); } - else if ( uno::Reference< task::XInteractionDisapprove >( xSelected.get(), uno::UNO_QUERY ).is() ) + else if ( uno::Reference< task::XInteractionDisapprove >( cppu::getXWeak(xSelected.get()), uno::UNO_QUERY ).is() ) { // own lock on loading, user has selected to ignore the lock // own lock on saving, user has selected to ignore the lock @@ -1188,12 +1188,12 @@ SfxMedium::ShowLockResult SfxMedium::ShowLockedDocumentDialog(const LockFileEntr else nResult = ShowLockResult::Succeeded; } - else if (uno::Reference< task::XInteractionRetry >(xSelected.get(), uno::UNO_QUERY).is()) + else if (uno::Reference< task::XInteractionRetry >(cppu::getXWeak(xSelected.get()), uno::UNO_QUERY).is()) { // User decided to ignore the alien (stale?) lock file without filesystem lock nResult = ShowLockResult::Succeeded; } - else if (uno::Reference< task::XInteractionApprove >( xSelected.get(), uno::UNO_QUERY ).is()) + else if (uno::Reference< task::XInteractionApprove >( cppu::getXWeak(xSelected.get()), uno::UNO_QUERY ).is()) { bOpenReadOnly = true; } @@ -1264,12 +1264,12 @@ bool SfxMedium::ShowLockFileProblemDialog(MessageDlg nWhichDlg) ::rtl::Reference< ::ucbhelper::InteractionContinuation > xSelected = xIgnoreRequestImpl->getSelection(); bool bReadOnly = true; - if (uno::Reference(xSelected.get(), uno::UNO_QUERY).is()) + if (uno::Reference(cppu::getXWeak(xSelected.get()), uno::UNO_QUERY).is()) { SetError(ERRCODE_ABORT); bReadOnly = false; } - else if (!uno::Reference(xSelected.get(), uno::UNO_QUERY).is()) + else if (!uno::Reference(cppu::getXWeak(xSelected.get()), uno::UNO_QUERY).is()) { // user selected "Notify" pImpl->m_bNotifyWhenEditable = true; @@ -4940,7 +4940,7 @@ IMPL_STATIC_LINK(SfxMedium, ShowReloadEditableDialog, void*, p, void) xHandler->handle(xInteractionRequestImpl); ::rtl::Reference<::ucbhelper::InteractionContinuation> xSelected = xInteractionRequestImpl->getSelection(); - if (uno::Reference(xSelected.get(), uno::UNO_QUERY).is()) + if (uno::Reference(cppu::getXWeak(xSelected.get()), uno::UNO_QUERY).is()) { for (SfxViewFrame* pFrame = SfxViewFrame::GetFirst(); pFrame; pFrame = SfxViewFrame::GetNext(*pFrame)) diff --git a/sfx2/source/doc/doctempl.cxx b/sfx2/source/doc/doctempl.cxx index 94ab4c527338..ce2a9e5214e1 100644 --- a/sfx2/source/doc/doctempl.cxx +++ b/sfx2/source/doc/doctempl.cxx @@ -213,7 +213,7 @@ public: bool GetTitleFromURL( const OUString& rURL, OUString& aTitle ); bool InsertRegion( std::unique_ptr pData, size_t nPos ); - const OUString& GetRootURL() const { return maRootURL; } + INetURLObject GetRootURL() const { return INetURLObject(maRootURL); } const uno::Reference< XDocumentTemplates >& getDocTemplates() const { return mxTemplates; } }; diff --git a/sfx2/source/doc/new.cxx b/sfx2/source/doc/new.cxx index 517e222476a4..4b27d131b2c2 100644 --- a/sfx2/source/doc/new.cxx +++ b/sfx2/source/doc/new.cxx @@ -280,7 +280,7 @@ SfxNewFileDialog::SfxNewFileDialog(weld::Window *pParent, SfxNewFileDialogMode n bool bExpand = !sExtraData.isEmpty() && sExtraData[0] == 'Y'; m_xMoreBt->set_expanded(bExpand && (nFlags != SfxNewFileDialogMode::NONE)); - m_xTemplateLb->connect_changed(LINK(this, SfxNewFileDialog, TemplateSelect)); + m_xTemplateLb->connect_selection_changed(LINK(this, SfxNewFileDialog, TemplateSelect)); m_xTemplateLb->connect_row_activated(LINK(this, SfxNewFileDialog, DoubleClick)); // update the template configuration if necessary @@ -294,7 +294,7 @@ SfxNewFileDialog::SfxNewFileDialog(weld::Window *pParent, SfxNewFileDialogMode n { for(sal_uInt16 i = 0; i < nCount; ++i) m_xRegionLb->append_text(m_aTemplates.GetFullRegionName(i)); - m_xRegionLb->connect_changed(LINK(this, SfxNewFileDialog, RegionSelect)); + m_xRegionLb->connect_selection_changed(LINK(this, SfxNewFileDialog, RegionSelect)); } m_aPrevIdle.SetPriority( TaskPriority::LOWEST ); diff --git a/sfx2/source/doc/saveastemplatedlg.cxx b/sfx2/source/doc/saveastemplatedlg.cxx index f967debd6e90..ae2e44cf6915 100644 --- a/sfx2/source/doc/saveastemplatedlg.cxx +++ b/sfx2/source/doc/saveastemplatedlg.cxx @@ -47,7 +47,8 @@ SfxSaveAsTemplateDialog::SfxSaveAsTemplateDialog(weld::Window* pParent, uno::Ref SetCategoryLBEntries(msCategories); m_xTemplateNameEdit->connect_changed(LINK(this, SfxSaveAsTemplateDialog, TemplateNameEditHdl)); - m_xLBCategory->connect_changed(LINK(this, SfxSaveAsTemplateDialog, SelectCategoryHdl)); + m_xLBCategory->connect_selection_changed( + LINK(this, SfxSaveAsTemplateDialog, SelectCategoryHdl)); m_xLBCategory->set_size_request(m_xLBCategory->get_approximate_digit_width() * 32, m_xLBCategory->get_height_rows(8)); m_xOKButton->connect_clicked(LINK(this, SfxSaveAsTemplateDialog, OkClickHdl)); diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index 7ecfd1d9a60c..18dc4e87a1cb 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -1188,6 +1188,19 @@ void SAL_CALL SfxBaseModel::setArgs(const Sequence& aArgs) pMedium->GetItemSet().Put(SfxUnoAnyItem(SID_ENCRYPTIONDATA, rArg.Value)); ok = true; } + else if (rArg.Name == "FilterName") + { + // HACK: Needed a way to tweak the filter after loading has started, + // but changing this must be avoided unless clearly intentional. + if (aArgs.size() == 1) + { + if (rArg.Value >>= sValue) + { + pMedium->GetItemSet().Put(SfxStringItem(SID_FILTER_NAME, sValue)); + ok = true; + } + } + } if (!ok) { throw lang::IllegalArgumentException("Setting property not supported: " + rArg.Name, diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx index aaef1900f4dd..aa155a289bc6 100644 --- a/sfx2/source/doc/templatedlg.cxx +++ b/sfx2/source/doc/templatedlg.cxx @@ -1402,7 +1402,8 @@ SfxTemplateCategoryDialog::SfxTemplateCategoryDialog(weld::Window* pParent) mxNewCategoryEdit->connect_changed(LINK(this, SfxTemplateCategoryDialog, NewCategoryEditHdl)); mxLBCategory->set_size_request(mxLBCategory->get_approximate_digit_width() * 32, mxLBCategory->get_height_rows(8)); - mxLBCategory->connect_changed(LINK(this, SfxTemplateCategoryDialog, SelectCategoryHdl)); + mxLBCategory->connect_selection_changed( + LINK(this, SfxTemplateCategoryDialog, SelectCategoryHdl)); mxOKButton->set_sensitive(false); } diff --git a/solenv/bin/modules/installer/windows/property.pm b/solenv/bin/modules/installer/windows/property.pm index fe8e94d44aae..90d39ff86cb2 100644 --- a/solenv/bin/modules/installer/windows/property.pm +++ b/solenv/bin/modules/installer/windows/property.pm @@ -411,9 +411,8 @@ sub update_property_table my $productname = get_productname_for_property_table($language, $allvariables); my $productversion = get_productversion_for_property_table(); my $quickstarterlinkname = get_quickstarterlinkname_for_property_table($language, $allvariables); - my $windowsminversiontext = "Windows 7 SP1"; - my $windowsminversionnumber = "601"; - my $windowsminspnumber = "1"; + my $windowsminversiontext = "Windows 10"; + my $winmajorvermin = "#10"; # Updating the values @@ -428,8 +427,7 @@ sub update_property_table ${$propertyfile}[$i] =~ s/\bPRODUCTVERSIONTEMPLATE\b/$productversion/; ${$propertyfile}[$i] =~ s/\bQUICKSTARTERLINKNAMETEMPLATE\b/$quickstarterlinkname/; ${$propertyfile}[$i] =~ s/\bWINDOWSMINVERSIONTEXTTEMPLATE\b/$windowsminversiontext/; - ${$propertyfile}[$i] =~ s/\bWINDOWSMINVERSIONNUMBERTEMPLATE\b/$windowsminversionnumber/; - ${$propertyfile}[$i] =~ s/\bWINDOWSMINSPNUMBERTEMPLATE\b/$windowsminspnumber/; + ${$propertyfile}[$i] =~ s/\bWINMAJORVERMINTEMPLATE\b/$winmajorvermin/; if ( ${$propertyfile}[$i] =~ m/\bARPNOMODIFY\b/ ) { $hasarpnomodify = 1; } } diff --git a/solenv/clang-format/excludelist b/solenv/clang-format/excludelist index 74614d7f5a58..9e53e862a91f 100644 --- a/solenv/clang-format/excludelist +++ b/solenv/clang-format/excludelist @@ -15010,7 +15010,6 @@ vcl/win/dtrans/XNotifyingDataObject.hxx vcl/win/dtrans/XTDataObject.cxx vcl/win/dtrans/XTDataObject.hxx vcl/win/gdi/DWriteTextRenderer.cxx -vcl/win/gdi/dw-extra.h vcl/win/gdi/gdiimpl.cxx vcl/win/gdi/gdiimpl.hxx vcl/win/gdi/salbmp.cxx diff --git a/solenv/gbuild/platform/win_compatibility.manifest b/solenv/gbuild/platform/win_compatibility.manifest index 709f6f3c705b..26aaa752358f 100644 --- a/solenv/gbuild/platform/win_compatibility.manifest +++ b/solenv/gbuild/platform/win_compatibility.manifest @@ -4,12 +4,6 @@ - - - - - - diff --git a/solenv/gbuild/platform/windows.mk b/solenv/gbuild/platform/windows.mk index 797680038320..49b256519d9a 100644 --- a/solenv/gbuild/platform/windows.mk +++ b/solenv/gbuild/platform/windows.mk @@ -22,11 +22,11 @@ gb_MKTEMP := mktemp --tmpdir=$(TMPDIR) gbuild.XXXXXX gb_RUN_CONFIGURE := CONFIG_SHELL=$(shell cygpath -ms /bin/sh) # define _WIN32_WINNT and WINVER will be derived from it in sdkddkver.h -# current baseline is Windows 7 (NT 6.1) +# current baseline is Windows 10 (1507) # for _WIN32_IE, if _WIN32_WINNT >= 0x0600 the derived value from # sdkddkver.h is sufficient gb_WIN_VERSION_DEFS := \ - -D_WIN32_WINNT=0x0601 \ + -D_WIN32_WINNT=_WIN32_WINNT_WIN10 \ -DWIN32 \ -DWNT \ diff --git a/svl/qa/unit/svl.cxx b/svl/qa/unit/svl.cxx index 1b90ee5c8b88..80ec80e0d87e 100644 --- a/svl/qa/unit/svl.cxx +++ b/svl/qa/unit/svl.cxx @@ -1170,7 +1170,7 @@ void Test::testIsNumberFormat() { "Sept 1", true }, //tdf#127363 { "5/d", false }, //tdf#143165 { "Jan 1 2000", true }, - { "5-12-14", false }, + { "5-12-14", true }, // tdf#164239 { "005-12-14", true }, { "15-10-30", true }, { "2015-10-30", true }, @@ -1232,26 +1232,28 @@ void checkSpecificNumberFormats( SvNumberFormatter& rFormatter, void Test::testIsNumberFormatSpecific() { { - // en-US uses M/D/Y format, test that a-b-c input with a<=31 and b<=12 - // does not lead to a/b/c date output + // en-US uses M/D/Y format, test that without Y-M-D pattern an a-b-c + // input with a<=12 leads to ISO a-b-c date output. SvNumberFormatter aFormatter(m_xContext, LANGUAGE_ENGLISH_US); std::vector aIO = { - { "5-12-14", false, "", 0 }, - { "32-12-14", true, "1932-12-14", 0 } + { "005-12-14", true, "0005-12-14", 0 }, + { "5-12-14", true, "2005-12-14", 0 }, + { "32-12-14", true, "1932-12-14", 0 } }; checkSpecificNumberFormats( aFormatter, aIO, "[en-US] date"); } { - // de-DE uses D.M.Y format, test that a-b-c input with a<=31 and b<=12 - // does not lead to a.b.c date output + // de-DE uses D.M.Y format, test that without Y-M-D pattern an a-b-c + // input with a<=31 leads to ISO a-b-c date output. SvNumberFormatter aFormatter(m_xContext, LANGUAGE_GERMAN); std::vector aIO = { - { "5-12-14", false, "", 0 }, - { "32-12-14", true, "1932-12-14", 0 } + { "005-12-14", true, "0005-12-14", 0 }, + { "5-12-14", true, "2005-12-14", 0 }, + { "32-12-14", true, "1932-12-14", 0 } }; checkSpecificNumberFormats( aFormatter, aIO, "[de-DE] date"); @@ -1263,6 +1265,7 @@ void Test::testIsNumberFormatSpecific() SvNumberFormatter aFormatter(m_xContext, LANGUAGE_DUTCH); std::vector aIO = { + { "001-2-11", true, "0001-02-11", 0 }, { "22-11-1999", true, "22-11-99", 0 }, // if default YY changes to YYYY adapt this { "1999-11-22", true, "1999-11-22", 0 }, { "1-2-11", true, "01-02-11", 0 }, // if default YY changes to YYYY adapt this diff --git a/svl/source/crypto/cryptosign.cxx b/svl/source/crypto/cryptosign.cxx index 6a5f08077765..daa668c9e0f4 100644 --- a/svl/source/crypto/cryptosign.cxx +++ b/svl/source/crypto/cryptosign.cxx @@ -936,6 +936,7 @@ bool Signing::Sign(OStringBuffer& rCMSHexBuffer) { #if !USE_CRYPTO_ANY (void)rCMSHexBuffer; + (void)m_rSigningContext; return false; #else // Create the PKCS#7 object. diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx index 13cdcb3ca53b..2b91fa662845 100644 --- a/svl/source/numbers/zforfind.cxx +++ b/svl/source/numbers/zforfind.cxx @@ -1172,6 +1172,10 @@ bool ImpSvNumberInputScan::CanForceToIso8601( DateOrder eDateOrder ) eDateOrder = GetDateOrder(); } + // No date pattern matched at all can be forced to ISO 8601 here as is. + if (GetDatePatternNumbers() == 0) + return true; + nCanForceToIso8601 = 1; } diff --git a/svl/source/passwordcontainer/passwordcontainer.cxx b/svl/source/passwordcontainer/passwordcontainer.cxx index 447909ab4944..31e6535c4163 100644 --- a/svl/source/passwordcontainer/passwordcontainer.cxx +++ b/svl/source/passwordcontainer/passwordcontainer.cxx @@ -828,7 +828,7 @@ OUString PasswordContainer::RequestPasswordFromUser( PasswordRequestMode aRMode, if ( xSelection.is() ) { - Reference< XInteractionAbort > xAbort( xSelection.get(), UNO_QUERY ); + Reference< XInteractionAbort > xAbort( xSelection->getXWeak(), UNO_QUERY ); if ( !xAbort.is() ) { const ::rtl::Reference< ucbhelper::InteractionSupplyAuthentication > & xSupp diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx index a3dcb17d9a77..f1437e6aa0be 100644 --- a/svtools/source/control/valueset.cxx +++ b/svtools/source/control/valueset.cxx @@ -524,9 +524,7 @@ void ValueSet::RemoveItem( sal_uInt16 nItemId ) if ( nPos == VALUESET_ITEM_NOTFOUND ) return; - if ( nPos < mItemList.size() ) { - mItemList.erase( mItemList.begin() + nPos ); - } + mItemList.erase( mItemList.begin() + nPos ); // reset variables if (mnHighItemId == nItemId || mnSelItemId == nItemId) diff --git a/svx/source/form/datanavi.cxx b/svx/source/form/datanavi.cxx index 1831f0255dc7..bcbf7d04393b 100644 --- a/svx/source/form/datanavi.cxx +++ b/svx/source/form/datanavi.cxx @@ -235,7 +235,7 @@ namespace svxform m_xToolBox->connect_clicked(LINK(this, XFormsPage, TbxSelectHdl)); - m_xItemList->connect_changed(LINK(this, XFormsPage, ItemSelectHdl)); + m_xItemList->connect_selection_changed(LINK(this, XFormsPage, ItemSelectHdl)); m_xItemList->connect_key_press(LINK(this, XFormsPage, KeyInputHdl)); m_xItemList->connect_popup_menu(LINK(this, XFormsPage, PopupMenuHdl)); ItemSelectHdl(*m_xItemList); @@ -2679,7 +2679,7 @@ namespace svxform }; m_xNamespacesList->set_column_fixed_widths(aWidths); - m_xNamespacesList->connect_changed( LINK( this, NamespaceItemDialog, SelectHdl ) ); + m_xNamespacesList->connect_selection_changed(LINK(this, NamespaceItemDialog, SelectHdl)); Link aLink = LINK( this, NamespaceItemDialog, ClickHdl ); m_xAddNamespaceBtn->connect_clicked( aLink ); m_xEditNamespaceBtn->connect_clicked( aLink ); diff --git a/svx/source/form/filtnav.cxx b/svx/source/form/filtnav.cxx index add4fc49306f..9d673e76ad70 100644 --- a/svx/source/form/filtnav.cxx +++ b/svx/source/form/filtnav.cxx @@ -1063,7 +1063,7 @@ FmFilterNavigator::FmFilterNavigator(vcl::Window* pTopLevel, std::unique_ptrconnect_custom_render(LINK(this, FmFilterNavigator, CustomRenderHdl)); m_xTreeView->set_column_custom_renderer(1, true); - m_xTreeView->connect_changed(LINK(this, FmFilterNavigator, SelectHdl)); + m_xTreeView->connect_selection_changed(LINK(this, FmFilterNavigator, SelectHdl)); m_xTreeView->connect_key_press(LINK(this, FmFilterNavigator, KeyInputHdl)); m_xTreeView->connect_popup_menu(LINK(this, FmFilterNavigator, PopupMenuHdl)); m_xTreeView->connect_editing(LINK(this, FmFilterNavigator, EditingEntryHdl), diff --git a/svx/source/form/fmdmod.cxx b/svx/source/form/fmdmod.cxx index 1c5468f49f3c..ea1c80aeaa18 100644 --- a/svx/source/form/fmdmod.cxx +++ b/svx/source/form/fmdmod.cxx @@ -81,12 +81,8 @@ using namespace ::svxform; FM_SUN_COMPONENT_IMAGECONTROL }; - static const sal_uInt16 nSvxComponentServiceNameListCount = SAL_N_ELEMENTS(aSvxComponentServiceNameList); - - auto aSeq( comphelper::arrayToSequence< OUString >(aSvxComponentServiceNameList, nSvxComponentServiceNameListCount) ); - ::com::sun::star::uno::Sequence< OUString > aParentSeq( SvxUnoDrawMSFactory::getAvailableServiceNames() ); - return comphelper::concatSequences( aParentSeq, aSeq ); + return comphelper::concatSequences(aParentSeq, aSvxComponentServiceNameList); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/form/formcontroller.cxx b/svx/source/form/formcontroller.cxx index 287cb4933eaf..25c368852a87 100644 --- a/svx/source/form/formcontroller.cxx +++ b/svx/source/form/formcontroller.cxx @@ -656,7 +656,7 @@ Sequence< OUString> SAL_CALL FormController::getSupportedServiceNames() { // service names which are supported only, but cannot be used to created an // instance at a service factory - Sequence aNonCreatableServiceNames { u"com.sun.star.form.FormControllerDispatcher"_ustr }; + static constexpr OUString aNonCreatableServiceNames[] { u"com.sun.star.form.FormControllerDispatcher"_ustr }; // services which can be used to created an instance at a service factory Sequence< OUString > aCreatableServiceNames( getSupportedServiceNames_Static() ); diff --git a/svx/source/form/navigatortree.cxx b/svx/source/form/navigatortree.cxx index c5befb5497f6..17571e16838c 100644 --- a/svx/source/form/navigatortree.cxx +++ b/svx/source/form/navigatortree.cxx @@ -156,7 +156,7 @@ namespace svxform StartListening( *m_pNavModel ); m_aSynchronizeTimer.SetInvokeHandler(LINK(this, NavigatorTree, OnSynchronizeTimer)); - m_xTreeView->connect_changed(LINK(this, NavigatorTree, OnEntrySelDesel)); + m_xTreeView->connect_selection_changed(LINK(this, NavigatorTree, OnEntrySelDesel)); m_xTreeView->connect_key_press(LINK(this, NavigatorTree, KeyInputHdl)); m_xTreeView->connect_popup_menu(LINK(this, NavigatorTree, PopupMenuHdl)); m_xTreeView->connect_editing(LINK(this, NavigatorTree, EditingEntryHdl), diff --git a/svx/source/gallery2/galbrws1.cxx b/svx/source/gallery2/galbrws1.cxx index e367101fb759..2346410b3085 100644 --- a/svx/source/gallery2/galbrws1.cxx +++ b/svx/source/gallery2/galbrws1.cxx @@ -150,7 +150,7 @@ GalleryBrowser1::GalleryBrowser1( mxNewTheme->connect_clicked( LINK( this, GalleryBrowser1, ClickNewThemeHdl ) ); mxThemes->make_sorted(); - mxThemes->connect_changed( LINK( this, GalleryBrowser1, SelectThemeHdl ) ); + mxThemes->connect_selection_changed(LINK(this, GalleryBrowser1, SelectThemeHdl)); mxThemes->connect_popup_menu(LINK(this, GalleryBrowser1, PopupMenuHdl1)); mxThemes->connect_key_press(LINK(this, GalleryBrowser1, KeyInputHdl1)); mxThemes->set_size_request(-1, mxThemes->get_height_rows(6)); @@ -183,7 +183,7 @@ GalleryBrowser1::GalleryBrowser1( mxIconView->SetSelectHdl( LINK( this, GalleryBrowser1, SelectObjectValueSetHdl ) ); mxListView->connect_visible_range_changed(LINK(this, GalleryBrowser1, VisRowsScrolledHdl)); mxListView->connect_size_allocate(LINK(this, GalleryBrowser1, SizeAllocHdl)); - mxListView->connect_changed( LINK( this, GalleryBrowser1, SelectObjectHdl ) ); + mxListView->connect_selection_changed(LINK(this, GalleryBrowser1, SelectObjectHdl)); mxListView->connect_popup_menu(LINK(this, GalleryBrowser1, PopupMenuHdl2)); mxListView->connect_key_press(LINK(this, GalleryBrowser1, KeyInputHdl2)); mxListView->connect_row_activated(LINK(this, GalleryBrowser1, RowActivatedHdl)); diff --git a/svx/source/svdraw/sdrhittesthelper.cxx b/svx/source/svdraw/sdrhittesthelper.cxx index 94aad39e9b03..9dc3b9118f07 100644 --- a/svx/source/svdraw/sdrhittesthelper.cxx +++ b/svx/source/svdraw/sdrhittesthelper.cxx @@ -136,7 +136,7 @@ bool ViewObjectContactPrimitiveHit( // get primitive sequence sdr::contact::DisplayInfo aDisplayInfo; // have to make a copy of this container here, because it might be changed underneath us - const drawinglayer::primitive2d::Primitive2DContainer& aSequence(rVOC.getPrimitive2DSequence(aDisplayInfo)); + const drawinglayer::primitive2d::Primitive2DContainer aSequence(rVOC.getPrimitive2DSequence(aDisplayInfo)); if(!aSequence.empty()) { diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx index 7e2a812e430e..80b3b0bf6b3b 100644 --- a/svx/source/svdraw/svddrgmt.cxx +++ b/svx/source/svdraw/svddrgmt.cxx @@ -1723,8 +1723,8 @@ PointerStyle SdrDragMove::GetSdrDragPointer() const SdrDragResize::SdrDragResize(SdrDragView& rNewView) : SdrDragMethod(rNewView), - aXFact(1,1), - aYFact(1,1) + m_aXFact(1,1), + m_aYFact(1,1) { } @@ -1744,20 +1744,20 @@ OUString SdrDragResize::GetSdrDragComment() const if(!nYDiv) nYDiv = 1; - bool bX(aXFact != aFact1 && std::abs(nXDiv) > 1); - bool bY(aYFact != aFact1 && std::abs(nYDiv) > 1); + bool bX(m_aXFact != aFact1 && std::abs(nXDiv) > 1); + bool bY(m_aYFact != aFact1 && std::abs(nYDiv) > 1); if(bX || bY) { aStr += " ("; - bool bEqual(aXFact == aYFact); + bool bEqual(m_aXFact == m_aYFact); if(bX) { if(!bEqual) aStr += "x="; - aStr += SdrModel::GetPercentString(aXFact); + aStr += SdrModel::GetPercentString(m_aXFact); } if(bY && !bEqual) @@ -1765,7 +1765,7 @@ OUString SdrDragResize::GetSdrDragComment() const if(bX) aStr += " "; - aStr += "y=" + SdrModel::GetPercentString(aYFact); + aStr += "y=" + SdrModel::GetPercentString(m_aYFact); } aStr += ")"; @@ -1825,7 +1825,7 @@ basegfx::B2DHomMatrix SdrDragResize::getCurrentTransformation() const { basegfx::B2DHomMatrix aRetval(basegfx::utils::createTranslateB2DHomMatrix( -DragStat().GetRef1().X(), -DragStat().GetRef1().Y())); - aRetval.scale(double(aXFact), double(aYFact)); + aRetval.scale(double(m_aXFact), double(m_aYFact)); aRetval.translate(DragStat().GetRef1().X(), DragStat().GetRef1().Y()); return aRetval; @@ -2005,8 +2005,8 @@ void SdrDragResize::MoveSdrDrag(const Point& rNoSnapPnt) { Hide(); DragStat().NextMove(aPnt); - aXFact=aNewXFact; - aYFact=aNewYFact; + m_aXFact=aNewXFact; + m_aYFact=aNewYFact; aNewXFact = double(aNewXFact) > 0 ? aNewXFact : Fraction(1, 1); aNewYFact = double(aNewYFact) > 0 ? aNewYFact : Fraction(1, 1); @@ -2020,7 +2020,7 @@ void SdrDragResize::MoveSdrDrag(const Point& rNoSnapPnt) void SdrDragResize::applyCurrentTransformationToSdrObject(SdrObject& rTarget) { - rTarget.Resize(DragStat().GetRef1(),aXFact,aYFact); + rTarget.Resize(DragStat().GetRef1(),m_aXFact,m_aYFact); } bool SdrDragResize::EndSdrDrag(bool bCopy) @@ -2029,15 +2029,15 @@ bool SdrDragResize::EndSdrDrag(bool bCopy) if (IsDraggingPoints()) { - getSdrDragView().ResizeMarkedPoints(DragStat().GetRef1(),aXFact,aYFact); + getSdrDragView().ResizeMarkedPoints(DragStat().GetRef1(),m_aXFact,m_aYFact); } else if (IsDraggingGluePoints()) { - getSdrDragView().ResizeMarkedGluePoints(DragStat().GetRef1(),aXFact,aYFact,bCopy); + getSdrDragView().ResizeMarkedGluePoints(DragStat().GetRef1(),m_aXFact,m_aYFact,bCopy); } else { - getSdrDragView().ResizeMarkedObj(DragStat().GetRef1(),aXFact,aYFact,bCopy); + getSdrDragView().ResizeMarkedObj(DragStat().GetRef1(),m_aXFact,m_aYFact,bCopy); } return true; diff --git a/svx/source/svdraw/svdview.cxx b/svx/source/svdraw/svdview.cxx index 33f7fb5913d1..3fac4208e6bc 100644 --- a/svx/source/svdraw/svdview.cxx +++ b/svx/source/svdraw/svdview.cxx @@ -1246,7 +1246,7 @@ OUString SdrView::GetStatusText() // At the end of a line of any multi-line paragraph, we display the // position of the next line of the same paragraph, if there is one. sal_uInt16 nParaLine = 0; - sal_uInt32 nParaLineCount = mpTextEditOutliner->GetLineCount(aSel.end.nPara); + sal_Int32 nParaLineCount = mpTextEditOutliner->GetLineCount(aSel.end.nPara); bool bBrk = false; while (!bBrk) { diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx index 637305c9e6fc..a38b3e46315f 100644 --- a/svx/source/table/cell.cxx +++ b/svx/source/table/cell.cxx @@ -834,7 +834,7 @@ void SAL_CALL Cell::release() noexcept Sequence< Type > SAL_CALL Cell::getTypes( ) { return comphelper::concatSequences( SvxUnoTextBase::getTypes(), - Sequence { + std::initializer_list{ cppu::UnoType::get(), cppu::UnoType::get() }); } diff --git a/svx/source/table/tablelayouter.cxx b/svx/source/table/tablelayouter.cxx index 8756734ff288..e165f5219480 100644 --- a/svx/source/table/tablelayouter.cxx +++ b/svx/source/table/tablelayouter.cxx @@ -1048,10 +1048,10 @@ void TableLayouter::ResizeBorderLayout( BorderLineMap& rMap ) if( sal::static_int_cast(rMap.size()) != nColCount ) rMap.resize( nColCount ); - for( sal_Int32 nCol = 0; nCol < nColCount; nCol++ ) + for( auto& nCol : rMap ) { - if( sal::static_int_cast(rMap[nCol].size()) != nRowCount ) - rMap[nCol].resize( nRowCount ); + if( sal::static_int_cast(nCol.size()) != nRowCount ) + nCol.resize( nRowCount ); } } diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.hxx b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.hxx index fc05f397693d..87aae3dc4543 100644 --- a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.hxx +++ b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.hxx @@ -68,7 +68,10 @@ public: void set_size_request(int nWidth, int nHeight) { m_xControl->set_size_request(nWidth, nHeight); } void hide() { m_xControl->hide(); } void show() { m_xControl->show(); } - void connect_changed(const Link& rLink) { m_xControl->connect_changed(rLink); } + void connect_changed(const Link& rLink) + { + m_xControl->connect_selection_changed(rLink); + } void connect_column_clicked(const Link& rLink) { m_xControl->connect_column_clicked(rLink); } bool get_sort_order() const { return m_xControl->get_sort_order(); } void set_sort_order(bool bAscending) { return m_xControl->set_sort_order(bAscending); } diff --git a/svx/source/unodraw/unomod.cxx b/svx/source/unodraw/unomod.cxx index d6b2dac6b2b7..7cfb7e22227b 100644 --- a/svx/source/unodraw/unomod.cxx +++ b/svx/source/unodraw/unomod.cxx @@ -468,7 +468,7 @@ uno::Sequence< OUString > SAL_CALL SvxUnoDrawingModel::getAvailableServiceNames( { const uno::Sequence< OUString > aSNS_ORG( SvxFmMSFactory::getAvailableServiceNames() ); - uno::Sequence< OUString > aSNS{ + static constexpr OUString aSNS[] { u"com.sun.star.drawing.DashTable"_ustr, u"com.sun.star.drawing.GradientTable"_ustr, u"com.sun.star.drawing.HatchTable"_ustr, diff --git a/svx/source/unodraw/unoshap3.cxx b/svx/source/unodraw/unoshap3.cxx index ea4e90ee46cb..b24c9f6b53df 100644 --- a/svx/source/unodraw/unoshap3.cxx +++ b/svx/source/unodraw/unoshap3.cxx @@ -420,7 +420,7 @@ uno::Sequence< OUString > SAL_CALL Svx3DSceneObject::getSupportedServiceNames() { return comphelper::concatSequences( SvxShape::getSupportedServiceNames(), - std::initializer_list{ u"com.sun.star.drawing.Shape3DScene" }); + std::initializer_list{ u"com.sun.star.drawing.Shape3DScene"_ustr }); } Svx3DCubeObject::Svx3DCubeObject(SdrObject* pObj) @@ -540,8 +540,8 @@ uno::Sequence< OUString > SAL_CALL Svx3DCubeObject::getSupportedServiceNames() { return comphelper::concatSequences( SvxShape::getSupportedServiceNames(), - std::initializer_list{ u"com.sun.star.drawing.Shape3D", - u"com.sun.star.drawing.Shape3DCube" }); + std::initializer_list{ u"com.sun.star.drawing.Shape3D"_ustr, + u"com.sun.star.drawing.Shape3DCube"_ustr }); } Svx3DSphereObject::Svx3DSphereObject(SdrObject* pObj) @@ -645,8 +645,8 @@ uno::Sequence< OUString > SAL_CALL Svx3DSphereObject::getSupportedServiceNames() { return comphelper::concatSequences( SvxShape::getSupportedServiceNames(), - std::initializer_list{ u"com.sun.star.drawing.Shape3D", - u"com.sun.star.drawing.Shape3DSphere" }); + std::initializer_list{ u"com.sun.star.drawing.Shape3D"_ustr, + u"com.sun.star.drawing.Shape3DSphere"_ustr }); } Svx3DLatheObject::Svx3DLatheObject(SdrObject* pObj) @@ -825,8 +825,8 @@ uno::Sequence< OUString > SAL_CALL Svx3DLatheObject::getSupportedServiceNames() { return comphelper::concatSequences( SvxShape::getSupportedServiceNames(), - std::initializer_list{ u"com.sun.star.drawing.Shape3D", - u"com.sun.star.drawing.Shape3DLathe" }); + std::initializer_list{ u"com.sun.star.drawing.Shape3D"_ustr, + u"com.sun.star.drawing.Shape3DLathe"_ustr }); } Svx3DExtrudeObject::Svx3DExtrudeObject(SdrObject* pObj) @@ -908,8 +908,8 @@ uno::Sequence< OUString > SAL_CALL Svx3DExtrudeObject::getSupportedServiceNames( { return comphelper::concatSequences( SvxShape::getSupportedServiceNames(), - std::initializer_list{ u"com.sun.star.drawing.Shape3D", - u"com.sun.star.drawing.Shape3DExtrude" }); + std::initializer_list{ u"com.sun.star.drawing.Shape3D"_ustr, + u"com.sun.star.drawing.Shape3DExtrude"_ustr }); } Svx3DPolygonObject::Svx3DPolygonObject(SdrObject* pObj) @@ -1044,8 +1044,8 @@ uno::Sequence< OUString > SAL_CALL Svx3DPolygonObject::getSupportedServiceNames( { return comphelper::concatSequences( SvxShape::getSupportedServiceNames(), - std::initializer_list{ u"com.sun.star.drawing.Shape3D", - u"com.sun.star.drawing.Shape3DPolygon" }); + std::initializer_list{ u"com.sun.star.drawing.Shape3D"_ustr, + u"com.sun.star.drawing.Shape3DPolygon"_ustr }); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/xoutdev/XPropertyEntry.cxx b/svx/source/xoutdev/XPropertyEntry.cxx index 2791946838c9..14b54cb8c6b3 100644 --- a/svx/source/xoutdev/XPropertyEntry.cxx +++ b/svx/source/xoutdev/XPropertyEntry.cxx @@ -22,6 +22,7 @@ XPropertyEntry::XPropertyEntry(OUString aPropEntryName) : maPropEntryName(std::move(aPropEntryName)) + , mbSavingAllowed(true) { } diff --git a/svx/source/xoutdev/xtable.cxx b/svx/source/xoutdev/xtable.cxx index ea7385063701..ab6cfc60882c 100644 --- a/svx/source/xoutdev/xtable.cxx +++ b/svx/source/xoutdev/xtable.cxx @@ -36,6 +36,11 @@ XColorEntry::XColorEntry(const Color& rColor, const OUString& rName) { } +std::unique_ptr XColorEntry::Clone() const +{ + return std::make_unique(m_aColor, GetName()); +} + XLineEndEntry::XLineEndEntry(basegfx::B2DPolyPolygon _aB2DPolyPolygon, const OUString& rName) : XPropertyEntry(rName), m_aB2DPolyPolygon(std::move(_aB2DPolyPolygon)) @@ -48,6 +53,11 @@ XLineEndEntry::XLineEndEntry(const XLineEndEntry& rOther) { } +std::unique_ptr XLineEndEntry::Clone() const +{ + return std::make_unique(*this); +} + XDashEntry::XDashEntry(const XDash& rDash, const OUString& rName) : XPropertyEntry(rName), m_aDash(rDash) @@ -60,6 +70,11 @@ m_aDash(rOther.m_aDash) { } +std::unique_ptr XDashEntry::Clone() const +{ + return std::make_unique(*this); +} + XHatchEntry::XHatchEntry(const XHatch& rHatch, const OUString& rName) : XPropertyEntry(rName), m_aHatch(rHatch) @@ -72,6 +87,11 @@ XHatchEntry::XHatchEntry(const XHatchEntry& rOther) { } +std::unique_ptr XHatchEntry::Clone() const +{ + return std::make_unique(*this); +} + XGradientEntry::XGradientEntry(const basegfx::BGradient& rGradient, const OUString& rName) : XPropertyEntry(rName), m_aGradient(rGradient) @@ -84,6 +104,11 @@ XGradientEntry::XGradientEntry(const XGradientEntry& rOther) { } +std::unique_ptr XGradientEntry::Clone() const +{ + return std::make_unique(*this); +} + XBitmapEntry::XBitmapEntry(const GraphicObject& rGraphicObject, const OUString& rName) : XPropertyEntry(rName), maGraphicObject(rGraphicObject) @@ -96,6 +121,11 @@ XBitmapEntry::XBitmapEntry(const XBitmapEntry& rOther) { } +std::unique_ptr XBitmapEntry::Clone() const +{ + return std::make_unique(*this); +} + XPropertyList::XPropertyList( XPropertyListType type, OUString aPath, OUString aReferer @@ -105,6 +135,7 @@ XPropertyList::XPropertyList( maReferer (std::move( aReferer )), mbListDirty ( true ), mbEmbedInDocument( false ) + , mbNeedsExportableList(false) { // fprintf (stderr, "Create type %d count %d\n", (int)meType, count++); } @@ -183,6 +214,9 @@ void XPropertyList::Insert(std::unique_ptr pEntry, tools::Long n return; } + if (!pEntry->GetSavingAllowed()) + mbNeedsExportableList = true; + if (isValidIdx(nIndex)) { maList.insert( maList.begin()+nIndex, std::move(pEntry) ); } else { @@ -302,8 +336,27 @@ bool XPropertyList::Save() if( aURL.getExtension().isEmpty() ) aURL.setExtension( GetDefaultExt() ); + XPropertyListRef rExportableList = CreatePropertyList(meType, maPath, ""); + if (mbNeedsExportableList) + { + rExportableList->SetName(maName); + rExportableList->SetDirty(mbListDirty); + bool bHasUnsaveableEntry = false; + for (const std::unique_ptr& rEntry : maList) + { + if (rEntry->GetSavingAllowed()) + rExportableList->Insert(rEntry->Clone()); + else + bHasUnsaveableEntry = true; + } + if (!bHasUnsaveableEntry) + mbNeedsExportableList = false; + } + css::uno::Reference xExportableNameContainer + = mbNeedsExportableList ? rExportableList->createInstance() : createInstance(); + return SvxXMLXTableExportComponent::save( aURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ), - createInstance(), + xExportableNameContainer, uno::Reference< embed::XStorage >(), nullptr ); } diff --git a/sw/inc/pagedesc.hxx b/sw/inc/pagedesc.hxx index a7769da69218..f2da66539b96 100644 --- a/sw/inc/pagedesc.hxx +++ b/sw/inc/pagedesc.hxx @@ -395,7 +395,7 @@ public: OUString const & GetName() const; - operator SwPageDesc() const; // #i7983# + explicit operator SwPageDesc() const; // #i7983# }; namespace sw { diff --git a/sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx b/sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx index 1f820b47ed02..981cf03cd26b 100644 --- a/sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx +++ b/sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx @@ -318,6 +318,37 @@ CPPUNIT_TEST_FIXTURE(AccessibilityCheckTest, testStylesWithHeader) CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::DIRECT_FORMATTING, aIssues[4]->m_eIssueID); } +// Text contrast tests +// see https://www.w3.org/WAI/WCAG22/Understanding/contrast-minimum.html +CPPUNIT_TEST_FIXTURE(AccessibilityCheckTest, testCheckTextContrast) +{ + // first test doc has these issues: + // * normal text with contrast < 4.5 + // * large text with contrast < 3.0 + // * bold text with font size 13 (i.e. not considered large) with contrast < 4.5 + createSwDoc("ContrastTestFail.odt"); + SwDoc* pDoc = getSwDoc(); + sw::AccessibilityCheck aCheck(pDoc); + aCheck.check(); + auto& aIssues = aCheck.getIssueCollection().getIssues(); + CPPUNIT_ASSERT_EQUAL(size_t(3), aIssues.size()); + CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::TEXT_CONTRAST, aIssues[0]->m_eIssueID); + CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::TEXT_CONTRAST, aIssues[1]->m_eIssueID); + CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::TEXT_CONTRAST, aIssues[2]->m_eIssueID); + + // second test doc has large text with contrast between 3.0 and 4.5, + // which is sufficient for large text + // both of these are considered large text according to the spec: + // * non-bold text font with size 18 + // * bold text with font size 14 + createSwDoc("ContrastTestOK.odt"); + SwDoc* pDocOK = getSwDoc(); + sw::AccessibilityCheck aCheckOK(pDocOK); + aCheckOK.check(); + auto& aIssuesOK = aCheckOK.getIssueCollection().getIssues(); + CPPUNIT_ASSERT_EQUAL(size_t(0), aIssuesOK.size()); +} + namespace { std::vector> diff --git a/sw/qa/core/accessibilitycheck/data/ContrastTestFail.odt b/sw/qa/core/accessibilitycheck/data/ContrastTestFail.odt new file mode 100644 index 000000000000..4f898942e37f Binary files /dev/null and b/sw/qa/core/accessibilitycheck/data/ContrastTestFail.odt differ diff --git a/sw/qa/core/accessibilitycheck/data/ContrastTestOK.odt b/sw/qa/core/accessibilitycheck/data/ContrastTestOK.odt new file mode 100644 index 000000000000..2f47148838a2 Binary files /dev/null and b/sw/qa/core/accessibilitycheck/data/ContrastTestOK.odt differ diff --git a/sw/qa/core/layout/calcmove.cxx b/sw/qa/core/layout/calcmove.cxx index 0fca693eca54..893d3fd89915 100644 --- a/sw/qa/core/layout/calcmove.cxx +++ b/sw/qa/core/layout/calcmove.cxx @@ -84,6 +84,24 @@ CPPUNIT_TEST_FIXTURE(Test, testIgnoreTopMarginFly) CPPUNIT_ASSERT_EQUAL(static_cast(4000), nParaTopMargin); } +CPPUNIT_TEST_FIXTURE(Test, testIgnoreTopMarginPageStyleChange) +{ + // Given a DOCX (>= Word 2013), section break (next page) between pages 2 and 3: + createSwDoc("ignore-top-margin-page-style-change.docx"); + + // When laying out that document: + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); + + // Then make sure that the top margin is not ignored on page 3: + sal_Int32 nParaTopMargin + = getXPath(pXmlDoc, "/root/page[3]/body/txt/infos/prtBounds", "top").toInt32(); + // Without the accompanying fix in place, this test would have failed with: + // - Expected: 2000 + // - Actual : 0 + // i.e. the top margin was ignored, which is incorrect. + CPPUNIT_ASSERT_EQUAL(static_cast(2000), nParaTopMargin); +} + CPPUNIT_TEST_FIXTURE(Test, testHideWhitespaceGrowingLastPage) { // Given a document with a full first page, then hiding whitespace: diff --git a/sw/qa/core/layout/data/ignore-top-margin-page-style-change.docx b/sw/qa/core/layout/data/ignore-top-margin-page-style-change.docx new file mode 100644 index 000000000000..ea7d16d8851f Binary files /dev/null and b/sw/qa/core/layout/data/ignore-top-margin-page-style-change.docx differ diff --git a/sw/qa/extras/htmlimport/data/tdf79298-strikeout-variants.html b/sw/qa/extras/htmlimport/data/tdf79298-strikeout-variants.html new file mode 100644 index 000000000000..391ddf095c2b --- /dev/null +++ b/sw/qa/extras/htmlimport/data/tdf79298-strikeout-variants.html @@ -0,0 +1,3 @@ +

s

+

strike

+

del

\ No newline at end of file diff --git a/sw/qa/extras/htmlimport/htmlimport.cxx b/sw/qa/extras/htmlimport/htmlimport.cxx index 43163ce5a39a..746379b6f7b1 100644 --- a/sw/qa/extras/htmlimport/htmlimport.cxx +++ b/sw/qa/extras/htmlimport/htmlimport.cxx @@ -11,6 +11,7 @@ #include #include +#include #include #include #include @@ -376,6 +377,24 @@ CPPUNIT_TEST_FIXTURE(HtmlImportTest, testImageSize) CPPUNIT_ASSERT_EQUAL(static_cast(aExpected.getHeight()), aSize.Height); } +CPPUNIT_TEST_FIXTURE(HtmlImportTest, testTdf79298StrikeoutVariants) +{ + createSwWebDoc("tdf79298-strikeout-variants.html"); + + // Without the accompanying fix in place, this tests would have failed with: + // - Expected: 1 (FontStrikeout::SINGLE) + // - Actual : 0 (FontStrikeout::NONE) + CPPUNIT_ASSERT_EQUAL_MESSAGE( + "Strikeout for missing", sal_Int16(awt::FontStrikeout::SINGLE), + getProperty(getRun(getParagraph(1), 1), u"CharStrikeout"_ustr)); + CPPUNIT_ASSERT_EQUAL_MESSAGE( + "Strikeout for missing", sal_Int16(awt::FontStrikeout::SINGLE), + getProperty(getRun(getParagraph(2), 1), u"CharStrikeout"_ustr)); + CPPUNIT_ASSERT_EQUAL_MESSAGE( + "Strikeout for missing", sal_Int16(awt::FontStrikeout::SINGLE), + getProperty(getRun(getParagraph(3), 1), u"CharStrikeout"_ustr)); +} + CPPUNIT_TEST_FIXTURE(HtmlImportTest, testTdf142781) { // FIXME: the DPI check should be removed when either (1) the test is fixed to work with diff --git a/sw/qa/extras/layout/layout3.cxx b/sw/qa/extras/layout/layout3.cxx index ef5e948d5abf..af6dac583f29 100644 --- a/sw/qa/extras/layout/layout3.cxx +++ b/sw/qa/extras/layout/layout3.cxx @@ -794,7 +794,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf155177) createSwDoc("tdf155177-1-min.odt"); uno::Reference xStyle( - getStyles(u"ParagraphStyles"_ustr)->getByName(u"Body Text"_ustr), uno::UNO_QUERY_THROW); + getStyles(u"ParagraphStyles"_ustr)->getByName(u"Text body"_ustr), uno::UNO_QUERY_THROW); CPPUNIT_ASSERT_EQUAL(sal_Int32(210), getProperty(xStyle, u"ParaTopMargin"_ustr)); { diff --git a/sw/qa/extras/odfimport/data/tdf159549.fodt b/sw/qa/extras/odfimport/data/tdf159549.fodt new file mode 100644 index 000000000000..891b4ed9fc8e --- /dev/null +++ b/sw/qa/extras/odfimport/data/tdf159549.fodt @@ -0,0 +1,121 @@ + + + 2024-12-09T13:36:04.1549200662024-12-09T14:09:04.311392385PT32M56S2CIB_OfficeDev/6.4.0.29$Linux_X86_64 LibreOffice_project/5374b230ff33d77a7f81d56046759f218a160036 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Text Body + DerivedFromTextBody + Body Text + + + \ No newline at end of file diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx index 014c4011cff1..dd22a4937ee2 100644 --- a/sw/qa/extras/odfimport/odfimport.cxx +++ b/sw/qa/extras/odfimport/odfimport.cxx @@ -1203,6 +1203,28 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf133459) CPPUNIT_ASSERT_EQUAL(u"QQ YYYY"_ustr, getProperty(xFormat, u"FormatString"_ustr)); } +CPPUNIT_TEST_FIXTURE(Test, testTdf159549) +{ + createSwDoc("tdf159549.fodt"); + + uno::Reference xParaStyles(getStyles(u"ParagraphStyles"_ustr)); + + uno::Reference xStyleBuiltin(xParaStyles->getByName( + u"Text body"_ustr), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(float(32), getProperty(xStyleBuiltin, "CharHeight")); + CPPUNIT_ASSERT_EQUAL(OUString("Standard"), xStyleBuiltin.queryThrow()->getParentStyle()); + + uno::Reference xStyleDerived(xParaStyles->getByName( + u"DerivedFromTextBody"_ustr), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(float(32), getProperty(xStyleDerived, "CharHeight")); + CPPUNIT_ASSERT_EQUAL(OUString("Text body"), xStyleDerived.queryThrow()->getParentStyle()); + + uno::Reference xStyleCustom(xParaStyles->getByName( + u"Body Text"_ustr), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(float(16), getProperty(xStyleCustom, "CharHeight")); + CPPUNIT_ASSERT_EQUAL(OUString("Standard"), xStyleCustom.queryThrow()->getParentStyle()); +} + CPPUNIT_TEST_FIXTURE(Test, testTdf134971) { createSwDoc("tdf134971a.odt"); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport20.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport20.cxx index c418c1904197..74f020e614f2 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport20.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport20.cxx @@ -15,6 +15,9 @@ #include #include +#include +#include + #include #include #include @@ -1050,15 +1053,28 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf158855) // Check that the import doesn't produce an extra empty paragraph before a page break CPPUNIT_ASSERT_EQUAL(2, getPages()); // was 3 CPPUNIT_ASSERT_EQUAL(2, getParagraphs()); // was 3 - uno::Reference(getParagraphOrTable(1), uno::UNO_QUERY_THROW); + + uno::Reference xTableImport(getParagraphOrTable(1), uno::UNO_QUERY_THROW); getParagraph(2, u"Next page"_ustr); // was empty, with the 3rd being "Next page" - saveAndReload(mpFilter); + // tdf#164201 the table was shifting to left of the page margin because it became compat12 + CPPUNIT_ASSERT_EQUAL(sal_Int32(9), getProperty(xTableImport, u"LeftMargin"_ustr)); + CPPUNIT_ASSERT_EQUAL(OUString("Office Open XML Text"), + getSwDocShell()->GetMedium()->GetFilter()->GetFilterName()); + + saveAndReload(getSwDocShell()->GetMedium()->GetFilter()->GetFilterName()); CPPUNIT_ASSERT_EQUAL(2, getPages()); CPPUNIT_ASSERT_EQUAL(2, getParagraphs()); - uno::Reference(getParagraphOrTable(1), uno::UNO_QUERY_THROW); + uno::Reference xTableExport(getParagraphOrTable(1), uno::UNO_QUERY_THROW); getParagraph(2, u"Next page"_ustr); + + // tdf#164201 instead of "From left: 0" (aka 9), it was "From Left: -0.19cm" (aka -191) + CPPUNIT_ASSERT_EQUAL(sal_Int32(9), getProperty(xTableExport, u"LeftMargin"_ustr)); + + xmlDocUniquePtr pXmlSettings = parseExport(u"word/settings.xml"_ustr); + assertXPath(pXmlSettings, "//w:compat/w:compatSetting[1]", "name", u"compatibilityMode"); + assertXPath(pXmlSettings, "//w:compat/w:compatSetting[1]", "val", u"15"); } CPPUNIT_TEST_FIXTURE(Test, testTdf158971) diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx index bf12d0178b62..c3e18bfbae48 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx @@ -481,7 +481,7 @@ DECLARE_OOXMLEXPORT_TEST(testKern, "kern.docx") // This failed: kerning was also enabled for the second paragraph. CPPUNIT_ASSERT(!getProperty(getRun(getParagraph(2), 1), u"CharAutoKerning"_ustr)); - uno::Reference xStyle(getStyles(u"ParagraphStyles"_ustr)->getByName(u"Default Paragraph Style"_ustr), uno::UNO_QUERY); + uno::Reference xStyle(getStyles(u"ParagraphStyles"_ustr)->getByName(u"Standard"_ustr), uno::UNO_QUERY); //tdf107801: kerning normally isn't enabled by default for .docx CPPUNIT_ASSERT_EQUAL_MESSAGE("AutoKern should be false", false, getProperty(xStyle, u"CharAutoKerning"_ustr)); } @@ -491,7 +491,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf89377, "tdf89377_tableWithBreakBeforeParaStyle.d // the paragraph style should set table's text-flow break-before-page CPPUNIT_ASSERT_EQUAL( 3, getPages() ); - uno::Reference xStyle(getStyles(u"ParagraphStyles"_ustr)->getByName(u"Default Paragraph Style"_ustr), uno::UNO_QUERY); + uno::Reference xStyle(getStyles(u"ParagraphStyles"_ustr)->getByName(u"Standard"_ustr), uno::UNO_QUERY); //tdf107801: kerning info wasn't exported previously. CPPUNIT_ASSERT_EQUAL_MESSAGE("AutoKern should be true", true, getProperty(xStyle, u"CharAutoKerning"_ustr)); } diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index a30a29d397d7..13490dff0ffe 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -734,7 +734,7 @@ CPPUNIT_TEST_FIXTURE(Test, testN820504) uno::Reference xFamiliesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xFamiliesAccess = xFamiliesSupplier->getStyleFamilies(); uno::Reference xStylesAccess(xFamiliesAccess->getByName(u"ParagraphStyles"_ustr), uno::UNO_QUERY); - uno::Reference xStyle(xStylesAccess->getByName(u"Default Paragraph Style"_ustr), uno::UNO_QUERY); + uno::Reference xStyle(xStylesAccess->getByName(u"Standard"_ustr), uno::UNO_QUERY); // The problem was that the CharColor was set to AUTO (-1) even if we have some default char color set CPPUNIT_ASSERT_EQUAL(Color(0x3da7bb), getProperty(xStyle, u"CharColor"_ustr)); diff --git a/sw/qa/extras/rtfexport/rtfexport4.cxx b/sw/qa/extras/rtfexport/rtfexport4.cxx index 29e3d4201860..adc6c8d0aa89 100644 --- a/sw/qa/extras/rtfexport/rtfexport4.cxx +++ b/sw/qa/extras/rtfexport/rtfexport4.cxx @@ -681,8 +681,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf136587_noStyleName) getProperty(xStyleProps, u"ParaAdjust"_ustr)); // The problem was that the default style wasn't imported at all, so the fontsize was only 12. - xStyleProps.set(paragraphStyles->getByName(u"Default Paragraph Style"_ustr), - uno::UNO_QUERY_THROW); + xStyleProps.set(paragraphStyles->getByName(u"Standard"_ustr), uno::UNO_QUERY_THROW); CPPUNIT_ASSERT_EQUAL(32.0f, getProperty(xStyleProps, u"CharHeight"_ustr)); }; createSwDoc("tdf136587_noStyleName.rtf"); diff --git a/sw/qa/extras/uiwriter/uiwriter2.cxx b/sw/qa/extras/uiwriter/uiwriter2.cxx index 59320a62709d..b70fea7ce62a 100644 --- a/sw/qa/extras/uiwriter/uiwriter2.cxx +++ b/sw/qa/extras/uiwriter/uiwriter2.cxx @@ -2578,8 +2578,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testRTLparaStyle_LocaleArabic) saveAndReload(u"Office Open XML Text"_ustr); uno::Reference xPageStyle( - getStyles(u"ParagraphStyles"_ustr)->getByName(u"Default Paragraph Style"_ustr), - uno::UNO_QUERY_THROW); + getStyles(u"ParagraphStyles"_ustr)->getByName(u"Standard"_ustr), uno::UNO_QUERY_THROW); // Test the text Direction value for the -none- based paragraph styles CPPUNIT_ASSERT_EQUAL_MESSAGE("RTL Writing Mode", sal_Int32(1), getProperty(xPageStyle, u"WritingMode"_ustr)); diff --git a/sw/qa/uitest/data/paragraphAreaFill.odt b/sw/qa/uitest/data/paragraphAreaFill.odt new file mode 100644 index 000000000000..01baf1592621 Binary files /dev/null and b/sw/qa/uitest/data/paragraphAreaFill.odt differ diff --git a/sw/qa/uitest/writer_tests8/tdf125969.py b/sw/qa/uitest/writer_tests8/tdf125969.py new file mode 100644 index 000000000000..2334bec06fc4 --- /dev/null +++ b/sw/qa/uitest/writer_tests8/tdf125969.py @@ -0,0 +1,81 @@ +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-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/. +# +from libreoffice.uno.propertyvalue import mkPropertyValues + +from uitest.framework import UITestCase +from uitest.uihelper.common import get_url_for_data_file +from uitest.uihelper.common import select_pos, get_state_as_dict +import time + +# bug 125969: make in-use bitmap-area-fill available for re-use, but ONLY IN THE SAME DOCUMENT +class tdf125969(UITestCase): + + number_of_images = 0 + + def click_button(self, dialog, button): + xButton = dialog.getChild(button) + xButton.executeAction("CLICK", tuple()) + + def test_tdf125969(self): + with self.ui_test.load_file(get_url_for_data_file("paragraphAreaFill.odt")): + xWriterDoc = self.xUITest.getTopFocusWindow() + xWriterEdit = xWriterDoc.getChild("writer_edit") + + self.xUITest.executeCommand(".uno:Sidebar") #turn on sidebar + xWriterEdit.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "PageStylesPanel"})) + + # Get baseline from sidebar: count number of initially available bitmaps by default + backgroundType = xWriterEdit.getChild('bgselect') #type of background: color, gradient, ... + self.ui_test.wait_until_property_is_updated(backgroundType, "SelectEntryText", "Bitmap") + + imageCollection = xWriterEdit.getChild("lbbitmap") #listbox containing image names + number_of_images = get_state_as_dict(imageCollection)["EntryCount"] + # print (get_state_as_dict(imageCollection)) + # time.sleep (10) + + # The paragraph area has a custom background logo - which we want to become available + # for re-use everywhere as a background fill + + # visit the paragraph background property - which now auto-adds it to the collection + with self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog", close_button="cancel") as xDialog: + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "8") # area tab + #time.sleep(1) + + self.ui_test.wait_until_property_is_updated(imageCollection, "SelectEntryText", "Painted White") + # xToolkit = self.xContext.ServiceManager.createInstance('com.sun.star.awt.Toolkit') + # xToolkit.waitUntilAllIdlesDispatched() + time.sleep (1) + # test: the paragraph's wasta-offline logo was added and the list box was refreshed + self.assertEqual(int(number_of_images) + 1, int(get_state_as_dict(imageCollection)["EntryCount"])) + + # A new document must not have access to the collected images from another document + with self.ui_test.create_doc_in_start_center("writer"): + xWriterDoc = self.xUITest.getTopFocusWindow() + xWriterEdit = xWriterDoc.getChild("writer_edit") + + # because I don't know how to change the sidebar to bitmap mode, use the page dialog + with self.ui_test.execute_dialog_through_command(".uno:PageDialog", close_button="ok") as xDialog: + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "2") # area tab + self.click_button(xDialog, 'btnbitmap') + #time.sleep (2) + + backgroundType = xWriterEdit.getChild('bgselect') + imageCollection = xWriterEdit.getChild("lbbitmap") + self.ui_test.wait_until_property_is_updated(backgroundType, "SelectEntryText", "Bitmap") + # This number MUST NOT be higher than the initial state. + # We must not allow document images to leak into the user profile + self.assertEqual(number_of_images, get_state_as_dict(imageCollection)["EntryCount"]) + #time.sleep (10) + + # xWriterEdit.getChild("bogus for debugging") + + self.xUITest.executeCommand(".uno:Sidebar") # good idea to turn off sidebar again +# vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sw/source/core/access/AccessibilityCheck.cxx b/sw/source/core/access/AccessibilityCheck.cxx index 42936d33bc4b..60c5d8c83534 100644 --- a/sw/source/core/access/AccessibilityCheck.cxx +++ b/sw/source/core/access/AccessibilityCheck.cxx @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -716,6 +717,32 @@ double calculateContrastRatio(Color const& rColor1, Color const& rColor2) return (aMinMax.second + 0.05) / (aMinMax.first + 0.05); } +// Determine required minimum contrast ratio for text with the given properties +// according to https://www.w3.org/WAI/WCAG22/Understanding/contrast-minimum.html +// * 3.0 for large text (font size >= 18 or bold and font size >= 14) +// * 4.5 otherwise +double minimumContrastRatio(const uno::Reference& xProperties) +{ + double fMinimumContrastRatio = 4.5; + double fFontSize = 0; + if (xProperties->getPropertyValue(u"CharHeight"_ustr) >>= fFontSize) + { + if (fFontSize >= 18) + fMinimumContrastRatio = 3.0; + else if (fFontSize >= 14) + { + double fCharWeight = 0; + if (xProperties->getPropertyValue(u"CharWeight"_ustr) >>= fCharWeight) + { + if (fCharWeight == css::awt::FontWeight::BOLD + || fCharWeight == css::awt::FontWeight::ULTRABOLD) + fMinimumContrastRatio = 3.0; + } + } + } + return fMinimumContrastRatio; +} + class TextContrastCheck : public NodeCheck { private: @@ -836,7 +863,7 @@ private: aBackgroundColor = COL_WHITE; double fContrastRatio = calculateContrastRatio(aForegroundColor, aBackgroundColor); - if (fContrastRatio < 4.5) + if (fContrastRatio < minimumContrastRatio(xProperties)) { auto pIssue = lclAddIssue(m_rIssueCollection, SwResId(STR_TEXT_CONTRAST), sfx::AccessibilityIssueID::TEXT_CONTRAST, diff --git a/sw/source/core/access/acccell.cxx b/sw/source/core/access/acccell.cxx index fe58dfc07e43..2ce7b0302ea7 100644 --- a/sw/source/core/access/acccell.cxx +++ b/sw/source/core/access/acccell.cxx @@ -98,7 +98,7 @@ void SwAccessibleCell::GetStates( sal_Int64& rStateSet ) SwAccessibleCell::SwAccessibleCell(std::shared_ptr const& pInitMap, const SwCellFrame *pCellFrame ) - : SwAccessibleContext( pInitMap, AccessibleRole::TABLE_CELL, pCellFrame ) + : SwAccessibleCell_BASE(pInitMap, AccessibleRole::TABLE_CELL, pCellFrame) , m_aSelectionHelper( *this ) , m_bIsSelected( false ) { @@ -271,49 +271,6 @@ void SwAccessibleCell::InvalidatePosOrSize( const SwRect& rOldBox ) SwAccessibleContext::InvalidatePosOrSize( rOldBox ); } -// XAccessibleInterface - -uno::Any SwAccessibleCell::queryInterface( const uno::Type& rType ) -{ - if (rType == cppu::UnoType::get()) - { - uno::Any aR; - aR <<= uno::Reference(this); - return aR; - } - - if (rType == cppu::UnoType::get()) - { - uno::Any aR; - aR <<= uno::Reference(this); - return aR; - } - if ( rType == ::cppu::UnoType::get() ) - { - uno::Reference xValue = this; - uno::Any aRet; - aRet <<= xValue; - return aRet; - } - else - { - return SwAccessibleContext::queryInterface( rType ); - } -} - -// XTypeProvider -uno::Sequence< uno::Type > SAL_CALL SwAccessibleCell::getTypes() -{ - return cppu::OTypeCollection( - ::cppu::UnoType::get(), - SwAccessibleContext::getTypes() ).getTypes(); -} - -uno::Sequence< sal_Int8 > SAL_CALL SwAccessibleCell::getImplementationId() -{ - return css::uno::Sequence(); -} - // XAccessibleValue SwFrameFormat* SwAccessibleCell::GetTableBoxFormat() const diff --git a/sw/source/core/access/acccell.hxx b/sw/source/core/access/acccell.hxx index 5d607d4c4531..3b5b503fd029 100644 --- a/sw/source/core/access/acccell.hxx +++ b/sw/source/core/access/acccell.hxx @@ -27,10 +27,11 @@ class SwCellFrame; class SwAccessibleTable; class SwFrameFormat; -class SwAccessibleCell : public SwAccessibleContext, - public css::accessibility::XAccessibleValue, - public css::accessibility::XAccessibleSelection, - public css::accessibility::XAccessibleExtendedAttributes +using SwAccessibleCell_BASE = cppu::ImplInheritanceHelper; +class SwAccessibleCell : public SwAccessibleCell_BASE { // Implementation for XAccessibleSelection interface SwAccessibleSelectionHelper m_aSelectionHelper; @@ -83,24 +84,6 @@ public: virtual void InvalidatePosOrSize( const SwRect& rFrame ) override; - // XInterface - - // (XInterface methods need to be implemented to disambiguate - // between those inherited through SwAccessibleContext and - // XAccessibleValue). - - virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override; - - virtual void SAL_CALL acquire( ) noexcept override - { SwAccessibleContext::acquire(); }; - - virtual void SAL_CALL release( ) noexcept override - { SwAccessibleContext::release(); }; - - // XTypeProvider - virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override; - virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override; - // XAccessibleExtendedAttributes css::uno::Any SAL_CALL getExtendedAttributes() override ; private: diff --git a/sw/source/core/access/accdoc.cxx b/sw/source/core/access/accdoc.cxx index e2d4bea133e0..30c2a500cad9 100644 --- a/sw/source/core/access/accdoc.cxx +++ b/sw/source/core/access/accdoc.cxx @@ -346,7 +346,7 @@ void SwAccessibleDocument::GetStates( sal_Int64& rStateSet ) SwAccessibleDocument::SwAccessibleDocument( std::shared_ptr const& pInitMap) - : SwAccessibleDocumentBase(pInitMap) + : SwAccessibleDocument_BASE(pInitMap) , maSelectionHelper(*this) { SetName(pInitMap->GetDocName()); @@ -433,40 +433,6 @@ uno::Sequence< OUString > SAL_CALL SwAccessibleDocument::getSupportedServiceName return { sServiceName, sAccessibleServiceName }; } -// XInterface - -uno::Any SwAccessibleDocument::queryInterface( - const uno::Type& rType ) -{ - uno::Any aRet; - if ( rType == cppu::UnoType::get() ) - { - uno::Reference aSelect = this; - aRet <<= aSelect; - } - else if ( rType == cppu::UnoType::get()) - { - uno::Reference aAttribute = this; - aRet <<= aAttribute; - } - else - aRet = SwAccessibleContext::queryInterface( rType ); - return aRet; -} - -// XTypeProvider -uno::Sequence< uno::Type > SAL_CALL SwAccessibleDocument::getTypes() -{ - return cppu::OTypeCollection( - cppu::UnoType::get(), - SwAccessibleDocumentBase::getTypes() ).getTypes(); -} - -uno::Sequence< sal_Int8 > SAL_CALL SwAccessibleDocument::getImplementationId() -{ - return css::uno::Sequence(); -} - // XAccessibleSelection void SwAccessibleDocument::selectAccessibleChild( diff --git a/sw/source/core/access/accdoc.hxx b/sw/source/core/access/accdoc.hxx index 735dc822cd81..e2012558382c 100644 --- a/sw/source/core/access/accdoc.hxx +++ b/sw/source/core/access/accdoc.hxx @@ -86,12 +86,13 @@ public: virtual css::awt::Size SAL_CALL getSize() override; }; +using SwAccessibleDocument_BASE = cppu::ImplInheritanceHelper; /** * access to an accessible Writer document */ -class SwAccessibleDocument : public SwAccessibleDocumentBase, - public css::accessibility::XAccessibleSelection, - public css::accessibility::XAccessibleExtendedAttributes +class SwAccessibleDocument : public SwAccessibleDocument_BASE { // Implementation for XAccessibleSelection interface SwAccessibleSelectionHelper maSelectionHelper; @@ -123,25 +124,6 @@ public: virtual css::uno::Sequence< OUString> SAL_CALL getSupportedServiceNames() override; - // XInterface - - // XInterface is inherited through SwAccessibleContext and - // XAccessibleSelection. These methods are needed to avoid - // ambiguities. - - virtual css::uno::Any SAL_CALL queryInterface( - const css::uno::Type& aType ) override; - - virtual void SAL_CALL acquire( ) noexcept override - { SwAccessibleContext::acquire(); }; - - virtual void SAL_CALL release( ) noexcept override - { SwAccessibleContext::release(); }; - - // XTypeProvider - virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override; - virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override; - // XAccessibleSelection virtual void SAL_CALL selectAccessibleChild( diff --git a/sw/source/core/access/accnotextframe.cxx b/sw/source/core/access/accnotextframe.cxx index d3f7c38bae77..0191da39aa18 100644 --- a/sw/source/core/access/accnotextframe.cxx +++ b/sw/source/core/access/accnotextframe.cxx @@ -58,7 +58,7 @@ SwAccessibleNoTextFrame::SwAccessibleNoTextFrame( std::shared_ptr const& pInitMap, sal_Int16 nInitRole, const SwFlyFrame* pFlyFrame ) : - SwAccessibleFrameBase( pInitMap, nInitRole, pFlyFrame ) + SwAccessibleNoTextFrame_BASE( pInitMap, nInitRole, pFlyFrame ) { const SwNoTextNode* pNd = GetNoTextNode(); // #i73249# @@ -157,34 +157,6 @@ OUString SAL_CALL SwAccessibleNoTextFrame::getAccessibleDescription() return msDesc; } -// XInterface - -uno::Any SAL_CALL SwAccessibleNoTextFrame::queryInterface( const uno::Type& aType ) -{ - if( aType == - ::cppu::UnoType::get() ) - { - uno::Reference xImage = this; - return uno::Any(xImage); - } - else if ( aType == cppu::UnoType::get()) - { - uno::Reference aAccHypertext = this; - return uno::Any( aAccHypertext ); - } - else - return SwAccessibleContext::queryInterface( aType ); -} - -// XTypeProvider - -uno::Sequence< uno::Type > SAL_CALL SwAccessibleNoTextFrame::getTypes() -{ - return cppu::OTypeCollection( - ::cppu::UnoType::get(), - SwAccessibleFrameBase::getTypes() ).getTypes(); -} - /// XAccessibleImage /** implementation of the XAccessibleImage methods is a no-brainer, as all relevant information is already accessible through other diff --git a/sw/source/core/access/accnotextframe.hxx b/sw/source/core/access/accnotextframe.hxx index 4383c8df7bfd..4b01d1f5d008 100644 --- a/sw/source/core/access/accnotextframe.hxx +++ b/sw/source/core/access/accnotextframe.hxx @@ -29,9 +29,10 @@ class SwFlyFrame; class SwNoTextNode; class SwAccessibleNoTextHyperlink; -class SwAccessibleNoTextFrame : public SwAccessibleFrameBase, - public css::accessibility::XAccessibleImage, - public css::accessibility::XAccessibleHypertext//Added by yangzhh for HyperLink +using SwAccessibleNoTextFrame_BASE = cppu::ImplInheritanceHelper; +class SwAccessibleNoTextFrame : public SwAccessibleNoTextFrame_BASE { friend class SwAccessibleNoTextHyperlink; rtl::Reference< SwAccessibleNoTextHyperlink > m_xHyperlink; @@ -60,22 +61,6 @@ public: virtual OUString SAL_CALL getAccessibleDescription() override; - // XInterface methods need to be implemented to disambiguate - // between those inherited through SwAccessibleContext and - // XAccessibleImage. - - virtual css::uno::Any SAL_CALL queryInterface( - const css::uno::Type& aType ) override; - - virtual void SAL_CALL acquire( ) noexcept override - { SwAccessibleContext::acquire(); }; - - virtual void SAL_CALL release( ) noexcept override - { SwAccessibleContext::release(); }; - - // XTypeProvider - virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override; - // XAccessibleImage virtual OUString SAL_CALL getAccessibleImageDescription( ) override; diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx index b41583a78a38..b07ba95b6822 100644 --- a/sw/source/core/access/accpara.cxx +++ b/sw/source/core/access/accpara.cxx @@ -403,7 +403,7 @@ void SwAccessibleParagraph::InvalidateFocus_() SwAccessibleParagraph::SwAccessibleParagraph( std::shared_ptr const& pInitMap, const SwTextFrame& rTextFrame ) - : SwAccessibleContext( pInitMap, AccessibleRole::PARAGRAPH, &rTextFrame ) + : SwAccessibleParagraph_BASE(pInitMap, AccessibleRole::PARAGRAPH, &rTextFrame) , m_nOldCaretPos( -1 ) , m_bIsBlockQuote(false) , m_bIsHeading( false ) @@ -931,89 +931,6 @@ static uno::Sequence< OUString > const & getSupplementalAttributeNames() return aNames; } -// XInterface - -uno::Any SwAccessibleParagraph::queryInterface( const uno::Type& rType ) -{ - uno::Any aRet; - if ( rType == cppu::UnoType::get()) - { - uno::Reference aAccText = static_cast(*this); // resolve ambiguity - aRet <<= aAccText; - } - else if ( rType == cppu::UnoType::get()) - { - uno::Reference aAccEditText = this; - aRet <<= aAccEditText; - } - else if ( rType == cppu::UnoType::get()) - { - uno::Reference aAccSel = this; - aRet <<= aAccSel; - } - else if ( rType == cppu::UnoType::get()) - { - uno::Reference aAccHyp = this; - aRet <<= aAccHyp; - } - // #i63870# - // add interface com::sun:star:accessibility::XAccessibleTextAttributes - else if ( rType == cppu::UnoType::get()) - { - uno::Reference aAccTextAttr = this; - aRet <<= aAccTextAttr; - } - // #i89175# - // add interface com::sun:star:accessibility::XAccessibleTextMarkup - else if ( rType == cppu::UnoType::get()) - { - uno::Reference aAccTextMarkup = this; - aRet <<= aAccTextMarkup; - } - // add interface com::sun:star:accessibility::XAccessibleMultiLineText - else if ( rType == cppu::UnoType::get()) - { - uno::Reference aAccMultiLineText = this; - aRet <<= aAccMultiLineText; - } - else if ( rType == cppu::UnoType::get()) - { - uno::Reference< css::accessibility::XAccessibleTextSelection > aTextExtension = this; - aRet <<= aTextExtension; - } - else if ( rType == cppu::UnoType::get()) - { - uno::Reference xAttr = this; - aRet <<= xAttr; - } - else - { - aRet = SwAccessibleContext::queryInterface(rType); - } - - return aRet; -} - -// XTypeProvider -uno::Sequence< uno::Type > SAL_CALL SwAccessibleParagraph::getTypes() -{ - // #i63870# - add type accessibility::XAccessibleTextAttributes - // #i89175# - add type accessibility::XAccessibleTextMarkup and - return cppu::OTypeCollection( - cppu::UnoType::get(), - cppu::UnoType::get(), - ::cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - SwAccessibleContext::getTypes() ).getTypes(); -} - -uno::Sequence< sal_Int8 > SAL_CALL SwAccessibleParagraph::getImplementationId() -{ - return css::uno::Sequence(); -} - // XAccessibleText sal_Int32 SwAccessibleParagraph::getCaretPosition() diff --git a/sw/source/core/access/accpara.hxx b/sw/source/core/access/accpara.hxx index 357c4f17c77d..6cef4039e915 100644 --- a/sw/source/core/access/accpara.hxx +++ b/sw/source/core/access/accpara.hxx @@ -50,17 +50,18 @@ namespace com::sun::star { typedef std::unordered_map< OUString, css::beans::PropertyValue > tAccParaPropValMap; +using SwAccessibleParagraph_BASE = cppu::ImplInheritanceHelper; class SwAccessibleParagraph : public SfxListener, - public SwAccessibleContext, - public css::accessibility::XAccessibleEditableText, - public css::accessibility::XAccessibleSelection, - public css::accessibility::XAccessibleHypertext, - public css::accessibility::XAccessibleTextMarkup, - public css::accessibility::XAccessibleMultiLineText, - public css::accessibility::XAccessibleTextAttributes, - public css::accessibility::XAccessibleTextSelection, - public css::accessibility::XAccessibleExtendedAttributes + public SwAccessibleParagraph_BASE { friend class SwAccessibleHyperlink; @@ -279,25 +280,6 @@ public: virtual css::uno::Sequence< OUString> SAL_CALL getSupportedServiceNames() override; - // XInterface - - // (XInterface methods need to be implemented to disambiguate - // between those inherited through SwAccessibleContext and - // XAccessibleEditableText). - - virtual css::uno::Any SAL_CALL queryInterface( - const css::uno::Type& aType ) override; - - virtual void SAL_CALL acquire( ) noexcept override - { SwAccessibleContext::acquire(); }; - - virtual void SAL_CALL release( ) noexcept override - { SwAccessibleContext::release(); }; - - // XTypeProvider - virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override; - virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override; - // XAccessibleText virtual sal_Int32 SAL_CALL getCaretPosition() override; virtual sal_Bool SAL_CALL setCaretPosition( sal_Int32 nIndex ) override; diff --git a/sw/source/core/access/acctable.cxx b/sw/source/core/access/acctable.cxx index dfd78370847b..360241005559 100644 --- a/sw/source/core/access/acctable.cxx +++ b/sw/source/core/access/acctable.cxx @@ -608,7 +608,7 @@ void SwAccessibleTable::GetStates( sal_Int64& rStateSet ) SwAccessibleTable::SwAccessibleTable( std::shared_ptr const& pInitMap, const SwTabFrame* pTabFrame ) : - SwAccessibleContext( pInitMap, AccessibleRole::TABLE, pTabFrame ) + SwAccessibleTable_BASE( pInitMap, AccessibleRole::TABLE, pTabFrame ) { const SwFrameFormat* pFrameFormat = pTabFrame->GetFormat(); StartListening(const_cast(pFrameFormat)->GetNotifier()); @@ -667,46 +667,6 @@ void SwAccessibleTable::Notify(const SfxHint& rHint) } } -uno::Any SwAccessibleTable::queryInterface( const uno::Type& rType ) -{ - uno::Any aRet; - if ( rType == cppu::UnoType::get() ) - { - uno::Reference xThis( this ); - aRet <<= xThis; - } - else if ( rType == cppu::UnoType::get() ) - { - uno::Reference xSelection( this ); - aRet <<= xSelection; - } - else if ( rType == cppu::UnoType::get() ) - { - uno::Reference xTableExtent( this ); - aRet <<= xTableExtent; - } - else - { - aRet = SwAccessibleContext::queryInterface(rType); - } - - return aRet; -} - -// XTypeProvider -uno::Sequence< uno::Type > SAL_CALL SwAccessibleTable::getTypes() -{ - return cppu::OTypeCollection( - cppu::UnoType::get(), - cppu::UnoType::get(), - SwAccessibleContext::getTypes() ).getTypes(); -} - -uno::Sequence< sal_Int8 > SAL_CALL SwAccessibleTable::getImplementationId() -{ - return css::uno::Sequence(); -} - // #i77106# std::unique_ptr SwAccessibleTable::CreateNewTableData() { @@ -1647,12 +1607,6 @@ void SwAccessibleTableColHeaders::Notify(const SfxHint& ) { } -// XInterface -uno::Any SAL_CALL SwAccessibleTableColHeaders::queryInterface( const uno::Type& aType ) -{ - return SwAccessibleTable::queryInterface( aType ); -} - // XAccessibleContext sal_Int64 SAL_CALL SwAccessibleTableColHeaders::getAccessibleChildCount() { diff --git a/sw/source/core/access/acctable.hxx b/sw/source/core/access/acctable.hxx index 9996ffa33b0d..dd835d85b1c6 100644 --- a/sw/source/core/access/acctable.hxx +++ b/sw/source/core/access/acctable.hxx @@ -38,11 +38,12 @@ namespace sw::access { class SwAccessibleChild; } +using SwAccessibleTable_BASE = cppu::ImplInheritanceHelper; class SwAccessibleTable : - public SwAccessibleContext, - public css::accessibility::XAccessibleTable, - public css::accessibility::XAccessibleSelection, - public css::accessibility::XAccessibleTableSelection, + public SwAccessibleTable_BASE, public SvtListener { std::unique_ptr mpTableData; // the table's data, protected by SolarMutex @@ -95,25 +96,6 @@ public: SwAccessibleTable(std::shared_ptr const& pInitMap, const SwTabFrame* pTableFrame); - // XInterface - - // (XInterface methods need to be implemented to disambiguate - // between those inherited through SwAccessibleContext and - // XAccessibleTable). - - virtual css::uno::Any SAL_CALL queryInterface( - const css::uno::Type& aType ) override; - - virtual void SAL_CALL acquire( ) noexcept override - { SwAccessibleContext::acquire(); }; - - virtual void SAL_CALL release( ) noexcept override - { SwAccessibleContext::release(); }; - - // XTypeProvider - virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override; - virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override; - // XAccessibleContext /// Return this object's description. @@ -244,11 +226,6 @@ public: SwAccessibleTableColHeaders(std::shared_ptr const& pMap, const SwTabFrame *pTabFrame); - // XInterface - - virtual css::uno::Any SAL_CALL queryInterface( - const css::uno::Type& aType ) override; - // XAccessibleContext /// Return the number of currently visible children. diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx index 910a62d05bbc..35ca30cf5bb8 100644 --- a/sw/source/core/crsr/crstrvl.cxx +++ b/sw/source/core/crsr/crstrvl.cxx @@ -1366,7 +1366,6 @@ SwOutlineNodes::size_type SwCursorShell::GetOutlinePos(sal_uInt8 nLevel, SwPaM* void SwCursorShell::MakeOutlineSel(SwOutlineNodes::size_type nSttPos, SwOutlineNodes::size_type nEndPos, bool bWithChildren , bool bKillPams, SwOutlineNodesInline* pOutlNdsInline) { - SwOutlineNodesInline::size_type nEndPosInline = SwOutlineNodesInline::npos; const SwNodes& rNds = GetDoc()->GetNodes(); const SwOutlineNodes& rOutlNds = rNds.GetOutLineNds(); if( rOutlNds.empty() ) @@ -1384,47 +1383,55 @@ void SwCursorShell::MakeOutlineSel(SwOutlineNodes::size_type nSttPos, SwOutlineN SwNode* pSttNd = rOutlNds[ nSttPos ]; SwNode* pEndNd = rOutlNds[ nEndPos ]; - if( pOutlNdsInline ) + if (pOutlNdsInline) { pSttNd = const_cast(SwOutlineNodes::GetRootNode(pSttNd)); + + SwOutlineNodesInline::size_type nEndPosInline; pOutlNdsInline->Seek_Entry( pEndNd, &nEndPosInline ); - } + assert(nEndPosInline != SwOutlineNodesInline::npos && "always sets some number <= pOutlNdsInline->size()"); - if( bWithChildren && !pOutlNdsInline ) - { - const int nLevel = pEndNd->GetTextNode()->GetAttrOutlineLevel()-1; - for( ++nEndPos; nEndPos < rOutlNds.size(); ++nEndPos ) + // headings in flys + if (bWithChildren) { + const int nLevel = pEndNd->GetTextNode()->GetAttrOutlineLevel() - 1; + for( ++nEndPosInline; nEndPosInline < pOutlNdsInline->size(); ++nEndPosInline ) + { + pEndNd = (*pOutlNdsInline)[ nEndPosInline ]; + const int nNxtLevel = pEndNd->GetTextNode()->GetAttrOutlineLevel()-1; + if( nNxtLevel <= nLevel ) + break; // EndPos is now on the next one + } + // set anchor node of the fly node + if ( nEndPosInline < pOutlNdsInline->size() ) + pEndNd = const_cast(SwOutlineNodes::GetRootNode(pEndNd)); + } + else if (++nEndPosInline < pOutlNdsInline->size()) + pEndNd = const_cast(SwOutlineNodes::GetRootNode((*pOutlNdsInline)[nEndPosInline])); + + if (nEndPosInline == pOutlNdsInline->size()) // no end found + pEndNd = &rNds.GetEndOfContent(); + } + else + { + if (bWithChildren) + { + const int nLevel = pEndNd->GetTextNode()->GetAttrOutlineLevel()-1; + for( ++nEndPos; nEndPos < rOutlNds.size(); ++nEndPos ) + { + pEndNd = rOutlNds[ nEndPos ]; + const int nNxtLevel = pEndNd->GetTextNode()->GetAttrOutlineLevel()-1; + if( nNxtLevel <= nLevel ) + break; // EndPos is now on the next one + } + } + // if without children then set onto next one + else if (++nEndPos < rOutlNds.size()) pEndNd = rOutlNds[ nEndPos ]; - const int nNxtLevel = pEndNd->GetTextNode()->GetAttrOutlineLevel()-1; - if( nNxtLevel <= nLevel ) - break; // EndPos is now on the next one - } - } - // headings in flys - else if( bWithChildren && pOutlNdsInline ) - { - const int nLevel = pEndNd->GetTextNode()->GetAttrOutlineLevel() - 1; - for( ++nEndPosInline; nEndPosInline < pOutlNdsInline->size(); ++nEndPosInline ) - { - pEndNd = (*pOutlNdsInline)[ nEndPosInline ]; - const int nNxtLevel = pEndNd->GetTextNode()->GetAttrOutlineLevel()-1; - if( nNxtLevel <= nLevel ) - break; // EndPos is now on the next one - } - // set anchor node of the fly node - if ( nEndPosInline < pOutlNdsInline->size() ) - pEndNd = const_cast(SwOutlineNodes::GetRootNode(pEndNd)); - } - // if without children then set onto next one - else if( !pOutlNdsInline && ++nEndPos < rOutlNds.size() ) - pEndNd = rOutlNds[ nEndPos ]; - else if( pOutlNdsInline && ++nEndPosInline < pOutlNdsInline->size() ) - pEndNd = const_cast(SwOutlineNodes::GetRootNode((*pOutlNdsInline)[nEndPosInline])); - if( ( pOutlNdsInline && nEndPosInline == pOutlNdsInline->size() ) || - ( !pOutlNdsInline && nEndPos == rOutlNds.size() ) ) // no end found - pEndNd = &rNds.GetEndOfContent(); + if (nEndPos == rOutlNds.size()) // no end found + pEndNd = &rNds.GetEndOfContent(); + } if( bKillPams ) KillPams(); diff --git a/sw/source/core/doc/SwStyleNameMapper.cxx b/sw/source/core/doc/SwStyleNameMapper.cxx index b047782a4221..62d9f440e986 100644 --- a/sw/source/core/doc/SwStyleNameMapper.cxx +++ b/sw/source/core/doc/SwStyleNameMapper.cxx @@ -263,10 +263,18 @@ void SwStyleNameMapper::FillProgName( rFillName = rName; if (nId == USHRT_MAX ) { - // It isn't ...make sure the suffix isn't already " (user)"...if it is, - // we need to add another one - if (lcl_SuffixIsUser(rFillName)) - rFillName += " (user)"; + if (eFlags == SwGetPoolIdFromName::TxtColl) + { + // check if it has a " (user)" suffix, if so remove it + lcl_CheckSuffixAndDelete(rFillName); + } + else // FIXME don't do this + { + // It isn't ...make sure the suffix isn't already " (user)"...if it is, + // we need to add another one + if (lcl_SuffixIsUser(rFillName)) + rFillName += " (user)"; + } } else { @@ -297,8 +305,16 @@ void SwStyleNameMapper::FillUIName( if ( nId == USHRT_MAX ) { rFillName = aName; - // aName isn't in our Prog name table...check if it has a " (user)" suffix, if so remove it - lcl_CheckSuffixAndDelete ( rFillName ); + if (eFlags != SwGetPoolIdFromName::TxtColl || // FIXME do it for all ids + GetPoolIdFromUIName(aName, eFlags) == USHRT_MAX) + { + // aName isn't in our Prog name table...check if it has a " (user)" suffix, if so remove it + lcl_CheckSuffixAndDelete(rFillName); + } + else + { + rFillName += " (user)"; + } } else { diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx index e11ee0ce49d8..c74731f48927 100644 --- a/sw/source/core/docnode/nodes.cxx +++ b/sw/source/core/docnode/nodes.cxx @@ -2275,6 +2275,7 @@ SwNode* SwNodes::FindPrvNxtFrameNode( const SwNode& rFrameNd, void SwNodes::ForEach( SwNodeOffset nStart, SwNodeOffset nEnd, FnForEach_SwNodes fn, void* pArgs ) { + assert( nEnd <= SwNodeOffset(m_nSize) ); if( nEnd > SwNodeOffset(m_nSize) ) nEnd = SwNodeOffset(m_nSize); diff --git a/sw/source/core/fields/reffld.cxx b/sw/source/core/fields/reffld.cxx index 99ef95713e1a..56b819c3d8dc 100644 --- a/sw/source/core/fields/reffld.cxx +++ b/sw/source/core/fields/reffld.cxx @@ -1217,16 +1217,17 @@ namespace sal_Int32 *const pStart, sal_Int32 *const pEnd, bool bCaseSensitive = true) { - if (*pCurrent == *pSelf) + if (pCurrent == pSelf) return nullptr; SwTextNode* pTextNode = pCurrent->GetTextNode(); if (!pTextNode) return nullptr; + auto const & rFormatName = pTextNode->GetFormatColl()->GetName(); if (bCaseSensitive - ? pTextNode->GetFormatColl()->GetName() == rStyleName - : pTextNode->GetFormatColl()->GetName().equalsIgnoreAsciiCase(rStyleName)) + ? rFormatName == rStyleName + : rFormatName.equalsIgnoreAsciiCase(rStyleName)) { *pStart = 0; if (pEnd) @@ -1238,7 +1239,7 @@ namespace if (auto const pHints = pTextNode->GetpSwpHints()) { - for (size_t i = 0; i < pHints->Count(); ++i) + for (size_t i = 0, nCnt = pHints->Count(); i < nCnt; ++i) { auto const*const pHint(pHints->Get(i)); if (pHint->Which() == RES_TXTATR_CHARFMT) diff --git a/sw/source/core/inc/flowfrm.hxx b/sw/source/core/inc/flowfrm.hxx index 154fd37febf2..c8ca0b55cd06 100644 --- a/sw/source/core/inc/flowfrm.hxx +++ b/sw/source/core/inc/flowfrm.hxx @@ -184,6 +184,9 @@ public: SvxFormatBreakItem const& rBreak, bool bBreakCheck = false ) const; + SwFrame * FindPrevIgnoreHidden() const; + SwFrame * FindNextIgnoreHidden() const; + bool HasLockedFollow() const; bool HasParaSpaceAtPages( bool bSct ) const; diff --git a/sw/source/core/inc/layouter.hxx b/sw/source/core/inc/layouter.hxx index a3979cf4670a..aa2f91f59f64 100644 --- a/sw/source/core/inc/layouter.hxx +++ b/sw/source/core/inc/layouter.hxx @@ -38,7 +38,6 @@ class SwAnchoredObject; class SwFlowFrame; class SwLayoutFrame; -#define LOOP_PAGE 1 class SwLayouter { diff --git a/sw/source/core/layout/calcmove.cxx b/sw/source/core/layout/calcmove.cxx index a591ec954795..e05024d7f2b6 100644 --- a/sw/source/core/layout/calcmove.cxx +++ b/sw/source/core/layout/calcmove.cxx @@ -304,9 +304,17 @@ void SwFrame::PrepareMake(vcl::RenderContext* pRenderContext) // There is no format of previous frame, if current frame is a table // frame and its previous frame wants to keep with it. - const bool bFormatPrev = !bTab || - !GetPrev() || - !GetPrev()->GetAttrSet()->GetKeep().GetValue(); + bool bFormatPrev{!bTab}; + if (!bFormatPrev) + { + SwFrame const* pPrev{this}; + do + { + pPrev = pPrev->GetPrev(); + } + while (pPrev && pPrev->IsHiddenNow()); + bFormatPrev = pPrev && !pPrev->GetAttrSet()->GetKeep().GetValue(); + } if ( bFormatPrev ) { SwFrame *pFrame = GetUpper()->Lower(); @@ -1131,6 +1139,16 @@ bool SwFrame::IsCollapseUpper() const return false; } + // Avoid the ignore after applying a new page style (but do it after page breaks). + const SwTextNode* pTextNode = pTextFrame->GetTextNodeForParaProps(); + if (pTextNode) + { + if (pTextNode->HasSwAttrSet() && pTextNode->GetSwAttrSet().HasItem(RES_PAGEDESC)) + { + return false; + } + } + return true; } @@ -1354,7 +1372,7 @@ void SwContentFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/) oNotify->SetBordersJoinedWithPrev(); } - const bool bKeep = IsKeep(rAttrs.GetAttrSet().GetKeep(), GetBreakItem()); + const bool bKeep{!isHiddenNow && IsKeep(rAttrs.GetAttrSet().GetKeep(), GetBreakItem())}; std::unique_ptr pSaveFootnote; if ( bFootnote ) @@ -1770,7 +1788,7 @@ void SwContentFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/) if( nBottomDist >= 0 ) { - if ( bKeep && bMoveable ) + if (bKeep && bMoveable && !isHiddenNow) { // We make sure the successor will be formatted the same. // This way, we keep control until (almost) everything is stable, @@ -2097,8 +2115,18 @@ bool SwContentFrame::WouldFit_( SwTwips nSpace, const SwFrame *pTmpPrev = pNewUpper->Lower(); if( pTmpPrev && pTmpPrev->IsFootnoteFrame() ) pTmpPrev = static_cast(pTmpPrev)->Lower(); - while ( pTmpPrev && pTmpPrev->GetNext() ) - pTmpPrev = pTmpPrev->GetNext(); + { + SwFrame const* pTmpNonHidden{pTmpPrev && pTmpPrev->IsHiddenNow() ? nullptr : pTmpPrev}; + while (pTmpPrev && pTmpPrev->GetNext()) + { + pTmpPrev = pTmpPrev->GetNext(); + if (!pTmpPrev->IsHiddenNow()) + { + pTmpNonHidden = pTmpPrev; + } + } + pTmpPrev = pTmpNonHidden; + } // tdf#156727 if the previous one has keep-with-next, ignore it on this one! bool const isIgnoreKeep(pTmpPrev && pTmpPrev->IsFlowFrame() @@ -2107,6 +2135,14 @@ bool SwContentFrame::WouldFit_( SwTwips nSpace, do { + if (pFrame->IsHiddenNow()) + { // shortcut + assert(pFrame == this); + bRet = true; + pFrame = nullptr; + break; + } + // #i46181# SwTwips nSecondCheck = 0; SwTwips nOldSpace = nSpace; @@ -2272,8 +2308,8 @@ bool SwContentFrame::WouldFit_( SwTwips nSpace, return true; } } - SwFrame *pNxt; - if( nullptr != (pNxt = pFrame->FindNext()) && pNxt->IsContentFrame() && + SwFrame *const pNxt{pFrame->FindNextIgnoreHidden()}; + if (nullptr != pNxt && pNxt->IsContentFrame() && ( !pFootnoteFrame || ( pNxt->IsInFootnote() && pNxt->FindFootnoteFrame()->GetAttr() == pFootnoteFrame->GetAttr() ) ) ) { @@ -2299,10 +2335,7 @@ bool SwContentFrame::WouldFit_( SwTwips nSpace, pTmpPrev = nullptr; else { - if (pFrame->IsHiddenNow()) - pTmpPrev = lcl_NotHiddenPrev( pFrame ); - else - pTmpPrev = pFrame; + pTmpPrev = pFrame; } pFrame = static_cast(pNxt); } diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx index 982fede3406b..e8ea2b197496 100644 --- a/sw/source/core/layout/flowfrm.cxx +++ b/sw/source/core/layout/flowfrm.cxx @@ -131,7 +131,9 @@ bool SwFlowFrame::IsKeepFwdMoveAllowed( bool bIgnoreMyOwnKeepValue ) if ( bIgnoreMyOwnKeepValue && pFrame->GetIndPrev() ) pFrame = pFrame->GetIndPrev(); do - { if ( pFrame->GetAttrSet()->GetKeep().GetValue() ) + { + if (pFrame->GetAttrSet()->GetKeep().GetValue() + || pFrame->IsHiddenNow()) pFrame = pFrame->GetIndPrev(); else return true; @@ -150,22 +152,42 @@ void SwFlowFrame::CheckKeep() // it's possible for the whole troop to move back. SwFrame *pPre = m_rThis.GetIndPrev(); assert(pPre); + while (pPre && pPre->IsHiddenNow()) + { + pPre = pPre->GetIndPrev(); + } + if (!pPre) + { + return; + } if( pPre->IsSctFrame() ) { SwFrame *pLast = static_cast(pPre)->FindLastContent(); + while (pLast && pLast->IsHiddenNow()) + { + pLast = pLast->GetIndPrev(); + } if( pLast && pLast->FindSctFrame() == pPre ) pPre = pLast; else return; } - SwFrame* pTmp; + SwFrame* pTmp{pPre}; bool bKeep; while ( (bKeep = pPre->GetAttrSet()->GetKeep().GetValue()) && - nullptr != ( pTmp = pPre->GetIndPrev() ) ) + nullptr != (pTmp = pTmp->GetIndPrev()) ) { + if (pTmp->IsHiddenNow()) + { + continue; + } if( pTmp->IsSctFrame() ) { SwFrame *pLast = static_cast(pTmp)->FindLastContent(); + while (pLast && pLast->IsHiddenNow()) + { + pLast = pLast->GetIndPrev(); + } if( pLast && pLast->FindSctFrame() == pTmp ) pTmp = pLast; else @@ -236,6 +258,7 @@ bool SwFlowFrame::IsKeep(SvxFormatKeepItem const& rKeep, SvxFormatBreakItem const& rBreak, bool const bCheckIfLastRowShouldKeep) const { + assert(!m_rThis.IsHiddenNow()); // check it before? // 1. The keep attribute is ignored inside footnotes // 2. For compatibility reasons, the keep attribute is // ignored for frames inside table cells @@ -338,6 +361,26 @@ bool SwFlowFrame::IsKeep(SvxFormatKeepItem const& rKeep, return bKeep; } +SwFrame * SwFlowFrame::FindPrevIgnoreHidden() const +{ + SwFrame * pRet{m_rThis.FindPrev()}; + while (pRet && pRet->IsHiddenNow()) + { + pRet = pRet->FindPrev(); + } + return pRet; +} + +SwFrame * SwFlowFrame::FindNextIgnoreHidden() const +{ + SwFrame * pRet{m_rThis.FindNext()}; + while (pRet && pRet->IsHiddenNow()) + { + pRet = pRet->FindNext(); + } + return pRet; +} + sal_uInt8 SwFlowFrame::BwdMoveNecessary( const SwPageFrame *pPage, const SwRect &rRect ) { // The return value helps deciding whether we need to flow back (3), @@ -1188,7 +1231,7 @@ bool SwFlowFrame::IsPrevObjMove() const if( pSh && pSh->GetViewOptions()->getBrowseMode() ) return false; - SwFrame *pPre = m_rThis.FindPrev(); + SwFrame *const pPre{FindPrevIgnoreHidden()}; if ( pPre && pPre->GetDrawObjs() ) { @@ -2616,7 +2659,7 @@ bool SwFlowFrame::MoveBwd( bool &rbReformat ) // keep with next frame and next frame is locked. // i#38232 - If next frame is a table, do *not* check, // if it's locked. - if ( pNewUpper && !IsFollow() && + if ( pNewUpper && !IsFollow() && !m_rThis.IsHiddenNow() && m_rThis.GetAttrSet()->GetKeep().GetValue() && m_rThis.GetIndNext() ) { SwFrame* pIndNext = m_rThis.GetIndNext(); diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx index 8178a7e9e71d..a9a3ab1e07ca 100644 --- a/sw/source/core/layout/fly.cxx +++ b/sw/source/core/layout/fly.cxx @@ -1705,9 +1705,10 @@ void CalcContent( SwLayoutFrame *pLay, bool bNoColl ) // frame due to its keep-attribute, if it can't move forward. // #i57765# - do not consider invalid previous // frame, if current frame has a column/page break before attribute. - SwFrame* pTmpPrev = pFrame->FindPrev(); + assert(pFrame->IsFlowFrame()); + SwFlowFrame* pTmpFlowFrame = SwFlowFrame::CastFlowFrame(pFrame); + SwFrame* pTmpPrev = pTmpFlowFrame->FindPrevIgnoreHidden(); SwFlowFrame* pTmpPrevFlowFrame = pTmpPrev && pTmpPrev->IsFlowFrame() ? SwFlowFrame::CastFlowFrame(pTmpPrev) : nullptr; - SwFlowFrame* pTmpFlowFrame = pFrame->IsFlowFrame() ? SwFlowFrame::CastFlowFrame(pFrame) : nullptr; bool bPrevInvalid = pTmpPrevFlowFrame && pTmpFlowFrame && !pTmpFlowFrame->IsFollow() && diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx index 7dadcfaa9cde..2f1963f456fa 100644 --- a/sw/source/core/layout/frmtool.cxx +++ b/sw/source/core/layout/frmtool.cxx @@ -155,7 +155,7 @@ void SwFrameNotify::ImplDestroy() { if ( mbInvaKeep ) { - SwFrame *pPre = mpFrame->FindPrev(); + SwFrame *pPre = pFlow->FindPrevIgnoreHidden(); if ( pPre && pPre->IsFlowFrame() ) { // 1. pPre wants to keep with me: diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx index 1c5d112dec72..ab18682e528d 100644 --- a/sw/source/core/layout/pagechg.cxx +++ b/sw/source/core/layout/pagechg.cxx @@ -410,12 +410,14 @@ static void lcl_FormatLay( SwLayoutFrame *pLay ) static void lcl_MakeObjs(const sw::FrameFormats& rSpzs, SwPageFrame* pPage) { // formats are in the special table of the document + const sal_uInt16 nPhyPageNum = pPage->GetPhyPageNum(); size_t i = 0; - while (i < rSpzs.size()) + const size_t nSpzsCnt = rSpzs.size(); + while (i < nSpzsCnt) { auto pSpz = rSpzs[i]; const SwFormatAnchor &rAnch = pSpz->GetAnchor(); - if ( rAnch.GetPageNum() == pPage->GetPhyPageNum() ) + if ( rAnch.GetPageNum() == nPhyPageNum ) { if( rAnch.GetAnchorNode() ) { diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx index c14ce2127a31..20755efa8d2c 100644 --- a/sw/source/core/layout/tabfrm.cxx +++ b/sw/source/core/layout/tabfrm.cxx @@ -2287,7 +2287,7 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext) && !pAttrs->GetAttrSet().GetKeep().GetValue() && AreAllRowsKeepWithNext(GetFirstNonHeadlineRow(), /*bCheckParents=*/false); // The beloved keep attribute - const bool bKeep = IsKeep(pAttrs->GetAttrSet().GetKeep(), GetBreakItem(), bEmulateTableKeep); + const bool bKeep{!isHiddenNow && IsKeep(pAttrs->GetAttrSet().GetKeep(), GetBreakItem(), bEmulateTableKeep)}; // Join follow table, if this table is not allowed to split: if ( bDontSplit ) @@ -2407,9 +2407,8 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext) } aNotify.SetLowersComplete( false ); } - SwFrame *pPre; - if ( bKeep || (nullptr != (pPre = FindPrev()) && - pPre->GetAttrSet()->GetKeep().GetValue()) ) + SwFrame const*const pPre{bKeep ? nullptr : FindPrevIgnoreHidden()}; + if (bKeep || (nullptr != pPre && pPre->GetAttrSet()->GetKeep().GetValue())) { m_bCalcLowers = true; } @@ -2764,7 +2763,8 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext) oAccess.emplace(SwFrame::GetCache(), this); pAttrs = oAccess->Get(); } - if (IsKeep(pAttrs->GetAttrSet().GetKeep(), GetBreakItem(), true) + if (!isHiddenNow + && IsKeep(pAttrs->GetAttrSet().GetKeep(), GetBreakItem(), true) && pLastRow->ShouldRowKeepWithNext()) { bFormat = true; @@ -5647,7 +5647,7 @@ bool SwRowFrame::ShouldRowKeepWithNext( const bool bCheckParents ) const const SwCellFrame* pCell = static_cast(Lower()); const SwFrame* pText = pCell->Lower(); - return pText && pText->IsTextFrame() && + return pText && pText->IsTextFrame() && !pText->IsHiddenNow() && static_cast(pText)->GetTextNodeForParaProps()->GetSwAttrSet().GetKeep(bCheckParents).GetValue(); } diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx index f2cbbba03376..cbdccecb9ff0 100644 --- a/sw/source/core/text/inftxt.cxx +++ b/sw/source/core/text/inftxt.cxx @@ -1357,12 +1357,14 @@ void SwTextPaintInfo::DrawCSDFHighlighting(const SwLinePortion &rPor) const OUString sCharStyleDisplayName; sCharStyleDisplayName = SwStyleNameMapper::GetUIName(sCurrentCharStyle, SwGetPoolIdFromName::ChrFmt); - if (!sCharStyleDisplayName.isEmpty() - && rCharStylesColorMap.find(sCharStyleDisplayName) - != rCharStylesColorMap.end()) + if (!sCharStyleDisplayName.isEmpty()) { - aFillColor = rCharStylesColorMap[sCharStyleDisplayName].first; - sCSNumberOrDF = OUString::number(rCharStylesColorMap[sCharStyleDisplayName].second); + auto it = rCharStylesColorMap.find(sCharStyleDisplayName); + if (it != rCharStylesColorMap.end()) + { + aFillColor = it->second.first; + sCSNumberOrDF = OUString::number(it->second.second); + } } } } diff --git a/sw/source/core/undo/SwUndoPageDesc.cxx b/sw/source/core/undo/SwUndoPageDesc.cxx index c97318d2030e..51cac584daf4 100644 --- a/sw/source/core/undo/SwUndoPageDesc.cxx +++ b/sw/source/core/undo/SwUndoPageDesc.cxx @@ -231,7 +231,7 @@ void SwUndoPageDesc::UndoImpl(::sw::UndoRedoContext &) // Move (header/footer)content node responsibility from new page descriptor to old one again. if( m_bExchange ) ExchangeContentNodes( m_aNew.m_PageDesc, m_aOld.m_PageDesc ); - m_pDoc->ChgPageDesc(m_aOld.GetName(), m_aOld); + m_pDoc->ChgPageDesc(m_aOld.GetName(), SwPageDesc(m_aOld)); ExitHeaderFooterEdit(); } @@ -240,7 +240,7 @@ void SwUndoPageDesc::RedoImpl(::sw::UndoRedoContext &) // Move (header/footer)content node responsibility from old page descriptor to new one again. if( m_bExchange ) ExchangeContentNodes( m_aOld.m_PageDesc, m_aNew.m_PageDesc ); - m_pDoc->ChgPageDesc(m_aNew.GetName(), m_aNew); + m_pDoc->ChgPageDesc(m_aNew.GetName(), SwPageDesc(m_aNew)); ExitHeaderFooterEdit(); } @@ -280,7 +280,7 @@ void SwUndoPageDescCreate::UndoImpl(::sw::UndoRedoContext &) void SwUndoPageDescCreate::DoImpl() { - SwPageDesc aPageDesc = m_aNew; + SwPageDesc aPageDesc(m_aNew); m_pDoc->MakePageDesc(m_aNew.GetName(), &aPageDesc, false); } @@ -320,7 +320,7 @@ SwUndoPageDescDelete::~SwUndoPageDescDelete() void SwUndoPageDescDelete::UndoImpl(::sw::UndoRedoContext &) { - SwPageDesc aPageDesc = m_aOld; + SwPageDesc aPageDesc(m_aOld); m_pDoc->MakePageDesc(m_aOld.GetName(), &aPageDesc, false); } diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx index d5b0a60f32b2..991f40fdd013 100644 --- a/sw/source/core/unocore/unodraw.cxx +++ b/sw/source/core/unocore/unodraw.cxx @@ -2212,7 +2212,7 @@ uno::Sequence< OUString > SwXShape::getSupportedServiceNames() if (SvxShape* pSvxShape = GetSvxShape()) aSeq = pSvxShape->getSupportedServiceNames(); return comphelper::concatSequences( - aSeq, std::initializer_list{ u"com.sun.star.drawing.Shape" }); + aSeq, std::initializer_list{ u"com.sun.star.drawing.Shape"_ustr }); } SvxShape* SwXShape::GetSvxShape() diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index 2dfb37aa7a12..ae1306b66f0a 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -915,7 +915,7 @@ uno::Any SwXStyleFamily::getByIndex(sal_Int32 nIndex) OUString sStyleName; try { - SwStyleNameMapper::FillUIName(m_rEntry.translateIndex(nIndex), sStyleName); + SwStyleNameMapper::FillProgName(m_rEntry.translateIndex(nIndex), sStyleName); } catch(...) {} if (sStyleName.isEmpty()) GetCountOrName(&sStyleName, nIndex); @@ -956,10 +956,10 @@ rtl::Reference SwXStyleFamily::getParagraphStyleByName(const OUString& rtl::Reference SwXStyleFamily::getStyleByName(const OUString& rName) { SolarMutexGuard aGuard; - OUString sStyleName; - SwStyleNameMapper::FillUIName(rName, sStyleName, m_rEntry.poolId()); if(!m_pBasePool) throw uno::RuntimeException(); + OUString sStyleName; + SwStyleNameMapper::FillUIName(rName, sStyleName, m_rEntry.poolId()); SfxStyleSheetBase* pBase = m_pBasePool->Find(sStyleName, m_rEntry.family()); if(!pBase) throw container::NoSuchElementException(rName); @@ -1433,7 +1433,9 @@ OUString SwXStyle::getParentStyle() { if(!m_bIsDescriptor) throw uno::RuntimeException(); - return m_sParentStyleName; + OUString ret; + SwStyleNameMapper::FillProgName(m_sParentStyleName, ret, lcl_GetSwEnumFromSfxEnum(m_rEntry.family())); + return ret; } SfxStyleSheetBase* pBase = m_pBasePool->Find(m_sStyleName, m_rEntry.family()); OUString aString; @@ -1447,7 +1449,7 @@ void SwXStyle::setParentStyle(const OUString& rParentStyle) { SolarMutexGuard aGuard; OUString sParentStyle; - SwStyleNameMapper::FillUIName(rParentStyle, sParentStyle, lcl_GetSwEnumFromSfxEnum ( m_rEntry.family()) ); + SwStyleNameMapper::FillUIName(rParentStyle, sParentStyle, lcl_GetSwEnumFromSfxEnum(m_rEntry.family())); if(!m_pBasePool) { if(!m_bIsDescriptor) @@ -1455,7 +1457,7 @@ void SwXStyle::setParentStyle(const OUString& rParentStyle) m_sParentStyleName = sParentStyle; try { - const auto aAny = m_xStyleFamily->getByName(sParentStyle); + const auto aAny = m_xStyleFamily->getByName(rParentStyle); m_xStyleData = aAny.get(); } catch(...) diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx index fb0ed452336f..9488fb0dafff 100644 --- a/sw/source/filter/html/swhtml.cxx +++ b/sw/source/filter/html/swhtml.cxx @@ -1889,6 +1889,7 @@ void SwHTMLParser::NextToken( HtmlTokenId nToken ) case HtmlTokenId::STRIKE_ON: case HtmlTokenId::STRIKETHROUGH_ON: + case HtmlTokenId::DELETEDTEXT_ON: { NewStdAttr( HtmlTokenId::STRIKE_ON, &m_xAttrTab->pStrike, SvxCrossedOutItem(STRIKEOUT_SINGLE, RES_CHRATR_CROSSEDOUT) ); @@ -1974,7 +1975,6 @@ void SwHTMLParser::NextToken( HtmlTokenId nToken ) case HtmlTokenId::ACRONYM_ON: case HtmlTokenId::ABBREVIATION_ON: case HtmlTokenId::INSERTEDTEXT_ON: - case HtmlTokenId::DELETEDTEXT_ON: case HtmlTokenId::TELETYPE_ON: NewCharFormat( nToken ); diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index d2484c941825..cbb9fefb9b6f 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -2547,12 +2547,12 @@ void RtfAttributeOutput::OutputFlyFrame_Impl(const ww8::Frame& rFrame, const Poi else SAL_INFO("sw.rtf", __func__ << " unhandled form control: '" << xInfo->getImplementationName() << "'"); - m_aRun->append('}'); } } } m_aRun->append('}'); + m_aRun->append('}'); } break; case ww8::Frame::eOle: diff --git a/sw/source/ui/chrdlg/swuiccoll.cxx b/sw/source/ui/chrdlg/swuiccoll.cxx index 209a468103cb..d111e2dde19c 100644 --- a/sw/source/ui/chrdlg/swuiccoll.cxx +++ b/sw/source/ui/chrdlg/swuiccoll.cxx @@ -67,8 +67,8 @@ SwCondCollPage::SwCondCollPage(weld::Container* pPage, weld::DialogController* p m_xStyleLB->connect_row_activated(LINK(this, SwCondCollPage, AssignRemoveTreeListBoxHdl)); m_xRemovePB->connect_clicked(LINK(this, SwCondCollPage, AssignRemoveClickHdl)); m_xAssignPB->connect_clicked(LINK(this, SwCondCollPage, AssignRemoveClickHdl)); - m_xTbLinks->connect_changed(LINK(this, SwCondCollPage, SelectTreeListBoxHdl)); - m_xStyleLB->connect_changed(LINK(this, SwCondCollPage, SelectTreeListBoxHdl)); + m_xTbLinks->connect_selection_changed(LINK(this, SwCondCollPage, SelectTreeListBoxHdl)); + m_xStyleLB->connect_selection_changed(LINK(this, SwCondCollPage, SelectTreeListBoxHdl)); m_xFilterLB->connect_changed(LINK(this, SwCondCollPage, SelectListBoxHdl)); std::optional xFamilies(SwModule::get()->CreateStyleFamilies()); diff --git a/sw/source/ui/config/optload.cxx b/sw/source/ui/config/optload.cxx index 917f18f7d7d5..7fc48ebe9a0b 100644 --- a/sw/source/ui/config/optload.cxx +++ b/sw/source/ui/config/optload.cxx @@ -1042,7 +1042,7 @@ SwCaptionOptPage::SwCaptionOptPage(weld::Container* pPage, weld::DialogControlle m_xLbCaptionOrder->connect_changed(LINK(this, SwCaptionOptPage, OrderHdl)); - m_xCheckLB->connect_changed(LINK(this, SwCaptionOptPage, ShowEntryHdl)); + m_xCheckLB->connect_selection_changed(LINK(this, SwCaptionOptPage, ShowEntryHdl)); m_xCheckLB->connect_toggled(LINK(this, SwCaptionOptPage, ToggleEntryHdl)); } diff --git a/sw/source/ui/dbui/addresslistdialog.cxx b/sw/source/ui/dbui/addresslistdialog.cxx index 02280ef58135..ab86aa33f0bc 100644 --- a/sw/source/ui/dbui/addresslistdialog.cxx +++ b/sw/source/ui/dbui/addresslistdialog.cxx @@ -218,7 +218,7 @@ SwAddressListDialog::SwAddressListDialog(SwMailMergeAddressBlockPage* pParent) m_xRemovePB->set_sensitive(m_xListLB->n_children() > 0); m_xFilterPB->set_sensitive(m_xListLB->n_children() > 0); m_xTablePB->set_sensitive(m_xListLB->n_children() > 0); - m_xListLB->connect_changed(LINK(this, SwAddressListDialog, ListBoxSelectHdl_Impl)); + m_xListLB->connect_selection_changed(LINK(this, SwAddressListDialog, ListBoxSelectHdl_Impl)); TableSelectHdl(nullptr); } diff --git a/sw/source/ui/dbui/customizeaddresslistdialog.cxx b/sw/source/ui/dbui/customizeaddresslistdialog.cxx index 0d19744c9174..903567e1676e 100644 --- a/sw/source/ui/dbui/customizeaddresslistdialog.cxx +++ b/sw/source/ui/dbui/customizeaddresslistdialog.cxx @@ -34,7 +34,8 @@ SwCustomizeAddressListDialog::SwCustomizeAddressListDialog( { m_xFieldsLB->set_size_request(-1, m_xFieldsLB->get_height_rows(14)); - m_xFieldsLB->connect_changed(LINK(this, SwCustomizeAddressListDialog, ListBoxSelectHdl_Impl)); + m_xFieldsLB->connect_selection_changed( + LINK(this, SwCustomizeAddressListDialog, ListBoxSelectHdl_Impl)); Link aAddRenameLk = LINK(this, SwCustomizeAddressListDialog, AddRenameHdl_Impl ); m_xAddPB->connect_clicked(aAddRenameLk); m_xRenamePB->connect_clicked(aAddRenameLk); diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx index 6ecdd3987211..1139bf27e3a7 100644 --- a/sw/source/ui/dbui/dbinsdlg.cxx +++ b/sw/source/ui/dbui/dbinsdlg.cxx @@ -358,10 +358,10 @@ SwInsertDBColAutoPilot::SwInsertDBColAutoPilot( SwView& rView, m_xCbTableHeadon->connect_toggled( LINK(this, SwInsertDBColAutoPilot, HeaderHdl )); - m_xLbTextDbColumn->connect_changed( LINK( this, SwInsertDBColAutoPilot, TVSelectHdl )); - m_xLbTableDbColumn->connect_changed( LINK( this, SwInsertDBColAutoPilot, TVSelectHdl )); + m_xLbTextDbColumn->connect_selection_changed(LINK(this, SwInsertDBColAutoPilot, TVSelectHdl)); + m_xLbTableDbColumn->connect_selection_changed(LINK(this, SwInsertDBColAutoPilot, TVSelectHdl)); m_xLbDbFormatFromUsr->connect_changed( LINK( this, SwInsertDBColAutoPilot, CBSelectHdl )); - m_xLbTableCol->connect_changed( LINK( this, SwInsertDBColAutoPilot, TVSelectHdl )); + m_xLbTableCol->connect_selection_changed(LINK(this, SwInsertDBColAutoPilot, TVSelectHdl)); m_xLbTextDbColumn->connect_row_activated( LINK( this, SwInsertDBColAutoPilot, DblClickHdl )); m_xLbTableDbColumn->connect_row_activated( LINK( this, SwInsertDBColAutoPilot, DblClickHdl )); diff --git a/sw/source/ui/dbui/mmaddressblockpage.cxx b/sw/source/ui/dbui/mmaddressblockpage.cxx index b674c4373f5e..9fc7b57c71eb 100644 --- a/sw/source/ui/dbui/mmaddressblockpage.cxx +++ b/sw/source/ui/dbui/mmaddressblockpage.cxx @@ -526,7 +526,8 @@ SwCustomizeAddressBlockDialog::SwCustomizeAddressBlockDialog( for (size_t i = 0; i < rHeaders.size(); ++i) m_xAddressElementsLB->append(OUString::number(i), rHeaders[i].first); m_xOK->connect_clicked(LINK(this, SwCustomizeAddressBlockDialog, OKHdl_Impl)); - m_xAddressElementsLB->connect_changed(LINK(this, SwCustomizeAddressBlockDialog, ListBoxSelectHdl_Impl)); + m_xAddressElementsLB->connect_selection_changed( + LINK(this, SwCustomizeAddressBlockDialog, ListBoxSelectHdl_Impl)); if (m_xAddressElementsLB->n_children()) m_xAddressElementsLB->select(0); m_xDragED->SetModifyHdl(LINK(this, SwCustomizeAddressBlockDialog, EditModifyHdl_Impl)); diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx index 896144f953b1..16c6cda95b58 100644 --- a/sw/source/ui/dialog/uiregionsw.cxx +++ b/sw/source/ui/dialog/uiregionsw.cxx @@ -369,7 +369,7 @@ SwEditRegionDlg::SwEditRegionDlg(weld::Window* pParent, SwWrtShell& rWrtSh) bool bWeb = dynamic_cast( m_rSh.GetView().GetDocShell() ) != nullptr; - m_xTree->connect_changed(LINK(this, SwEditRegionDlg, GetFirstEntryHdl)); + m_xTree->connect_selection_changed(LINK(this, SwEditRegionDlg, GetFirstEntryHdl)); m_xCurName->connect_changed(LINK(this, SwEditRegionDlg, NameEditHdl)); m_xConditionED->connect_changed( LINK( this, SwEditRegionDlg, ConditionEditHdl)); m_xOK->connect_clicked( LINK( this, SwEditRegionDlg, OkHdl)); diff --git a/sw/source/ui/fldui/DropDownFormFieldDialog.cxx b/sw/source/ui/fldui/DropDownFormFieldDialog.cxx index d1c875d718df..d7340186196e 100644 --- a/sw/source/ui/fldui/DropDownFormFieldDialog.cxx +++ b/sw/source/ui/fldui/DropDownFormFieldDialog.cxx @@ -35,7 +35,8 @@ DropDownFormFieldDialog::DropDownFormFieldDialog(weld::Widget* pParent, m_xListItemsTreeView->set_size_request(m_xListItemEntry->get_preferred_size().Width(), m_xListItemEntry->get_preferred_size().Height() * 5); - m_xListItemsTreeView->connect_changed(LINK(this, DropDownFormFieldDialog, ListChangedHdl)); + m_xListItemsTreeView->connect_selection_changed( + LINK(this, DropDownFormFieldDialog, ListChangedHdl)); Link aPushButtonLink(LINK(this, DropDownFormFieldDialog, ButtonPushedHdl)); m_xListAddButton->connect_clicked(aPushButtonLink); diff --git a/sw/source/ui/fldui/changedb.cxx b/sw/source/ui/fldui/changedb.cxx index b277fc176c5e..a6b748d2e8b5 100644 --- a/sw/source/ui/fldui/changedb.cxx +++ b/sw/source/ui/fldui/changedb.cxx @@ -67,7 +67,7 @@ SwChangeDBDlg::SwChangeDBDlg(SwView const & rVw) Link aLink = LINK(this, SwChangeDBDlg, TreeSelectHdl); - m_xUsedDBTLB->connect_changed(aLink); + m_xUsedDBTLB->connect_selection_changed(aLink); m_xAvailDBTLB->connect_changed(aLink); TreeSelect(); } diff --git a/sw/source/ui/fldui/flddb.cxx b/sw/source/ui/fldui/flddb.cxx index 1a4bfebaca4c..5762de379743 100644 --- a/sw/source/ui/fldui/flddb.cxx +++ b/sw/source/ui/fldui/flddb.cxx @@ -170,7 +170,7 @@ void SwFieldDBPage::Reset(const SfxItemSet*) } TypeHdl(nullptr); - m_xTypeLB->connect_changed(LINK(this, SwFieldDBPage, TypeListBoxHdl)); + m_xTypeLB->connect_selection_changed(LINK(this, SwFieldDBPage, TypeListBoxHdl)); m_xTypeLB->connect_row_activated(LINK(this, SwFieldDBPage, TreeViewInsertHdl)); if (IsFieldEdit()) diff --git a/sw/source/ui/fldui/flddinf.cxx b/sw/source/ui/fldui/flddinf.cxx index 36743339ab56..2f2cff7b5e93 100644 --- a/sw/source/ui/fldui/flddinf.cxx +++ b/sw/source/ui/fldui/flddinf.cxx @@ -233,9 +233,9 @@ void SwFieldDokInfPage::Reset(const SfxItemSet* ) if (m_xSelEntry) TypeHdl(*m_pTypeView); - m_pTypeView->connect_changed(LINK(this, SwFieldDokInfPage, TypeHdl)); + m_pTypeView->connect_selection_changed(LINK(this, SwFieldDokInfPage, TypeHdl)); m_pTypeView->connect_row_activated(LINK(this, SwFieldDokInfPage, TreeViewInsertHdl)); - m_xSelectionLB->connect_changed(LINK(this, SwFieldDokInfPage, SubTypeHdl)); + m_xSelectionLB->connect_selection_changed(LINK(this, SwFieldDokInfPage, SubTypeHdl)); m_xSelectionLB->connect_row_activated(LINK(this, SwFieldDokInfPage, TreeViewInsertHdl)); m_xFormatLB->connect_row_activated(LINK(this, SwFieldDokInfPage, TreeViewInsertHdl)); diff --git a/sw/source/ui/fldui/flddok.cxx b/sw/source/ui/fldui/flddok.cxx index bb1048a94563..fa7e12035a24 100644 --- a/sw/source/ui/fldui/flddok.cxx +++ b/sw/source/ui/fldui/flddok.cxx @@ -150,8 +150,8 @@ void SwFieldDokPage::Reset(const SfxItemSet* ) RestorePos(*m_xTypeLB); m_xTypeLB->connect_row_activated(LINK(this, SwFieldDokPage, TreeViewInsertHdl)); - m_xTypeLB->connect_changed(LINK(this, SwFieldDokPage, TypeHdl)); - m_xFormatLB->connect_changed(LINK(this, SwFieldDokPage, FormatHdl)); + m_xTypeLB->connect_selection_changed(LINK(this, SwFieldDokPage, TypeHdl)); + m_xFormatLB->connect_selection_changed(LINK(this, SwFieldDokPage, FormatHdl)); if( !IsRefresh() ) { @@ -276,7 +276,7 @@ IMPL_LINK_NOARG(SwFieldDokPage, TypeHdl, weld::TreeView&, void) } } } - m_xSelectionLB->connect_changed(Link()); + m_xSelectionLB->connect_selection_changed(Link()); } else { @@ -285,7 +285,7 @@ IMPL_LINK_NOARG(SwFieldDokPage, TypeHdl, weld::TreeView&, void) AddSubType(SwFieldTypesEnum::NextPage); nTypeId = static_cast(m_xSelectionLB->get_id(0).toUInt32()); nCount = 3; - m_xSelectionLB->connect_changed(LINK(this, SwFieldDokPage, SubTypeHdl)); + m_xSelectionLB->connect_selection_changed(LINK(this, SwFieldDokPage, SubTypeHdl)); } bool bEnable = nCount != 0; diff --git a/sw/source/ui/fldui/fldfunc.cxx b/sw/source/ui/fldui/fldfunc.cxx index 98fac8e93515..82a485698a2d 100644 --- a/sw/source/ui/fldui/fldfunc.cxx +++ b/sw/source/ui/fldui/fldfunc.cxx @@ -121,8 +121,8 @@ void SwFieldFuncPage::Reset(const SfxItemSet* ) } m_xTypeLB->connect_row_activated(LINK(this, SwFieldFuncPage, TreeViewInsertHdl)); - m_xTypeLB->connect_changed(LINK(this, SwFieldFuncPage, TypeHdl)); - m_xSelectionLB->connect_changed(LINK(this, SwFieldFuncPage, SelectHdl)); + m_xTypeLB->connect_selection_changed(LINK(this, SwFieldFuncPage, TypeHdl)); + m_xSelectionLB->connect_selection_changed(LINK(this, SwFieldFuncPage, SelectHdl)); m_xSelectionLB->connect_row_activated(LINK(this, SwFieldFuncPage, InsertMacroHdl)); m_xFormatLB->connect_row_activated(LINK(this, SwFieldFuncPage, TreeViewInsertHdl)); m_xMacroBT->connect_clicked(LINK(this, SwFieldFuncPage, MacroHdl)); @@ -134,7 +134,7 @@ void SwFieldFuncPage::Reset(const SfxItemSet* ) m_xListItemED->connect_activate(LINK(this, SwFieldFuncPage, ListModifyReturnActionHdl)); Link aListEnableLk = LINK(this, SwFieldFuncPage, ListEnableHdl); m_xListItemED->connect_changed(aListEnableLk); - m_xListItemsLB->connect_changed(LINK(this, SwFieldFuncPage, ListEnableListBoxHdl)); + m_xListItemsLB->connect_selection_changed(LINK(this, SwFieldFuncPage, ListEnableListBoxHdl)); int nSelect = -1; if( !IsRefresh() ) diff --git a/sw/source/ui/fldui/fldref.cxx b/sw/source/ui/fldui/fldref.cxx index ef88650962f0..4eaa24f48c9f 100644 --- a/sw/source/ui/fldui/fldref.cxx +++ b/sw/source/ui/fldui/fldref.cxx @@ -113,14 +113,15 @@ SwFieldRefPage::SwFieldRefPage(weld::Container* pPage, weld::DialogController* p m_xFilterED->connect_changed( LINK( this, SwFieldRefPage, ModifyHdl_Impl ) ); m_xTypeLB->connect_row_activated(LINK(this, SwFieldRefPage, TreeViewInsertHdl)); - m_xTypeLB->connect_changed(LINK(this, SwFieldRefPage, TypeHdl)); - m_xSelectionLB->connect_changed(LINK(this, SwFieldRefPage, SubTypeListBoxHdl)); + m_xTypeLB->connect_selection_changed(LINK(this, SwFieldRefPage, TypeHdl)); + m_xSelectionLB->connect_selection_changed(LINK(this, SwFieldRefPage, SubTypeListBoxHdl)); m_xSelectionLB->connect_row_activated(LINK(this, SwFieldRefPage, TreeViewInsertHdl)); m_xFormatLB->connect_row_activated(LINK(this, SwFieldRefPage, TreeViewInsertHdl)); - m_xFormatLB->connect_changed(LINK(this, SwFieldRefPage, FormatHdl)); + m_xFormatLB->connect_selection_changed(LINK(this, SwFieldRefPage, FormatHdl)); // #i83479# - m_xSelectionToolTipLB->connect_changed( LINK(this, SwFieldRefPage, SubTypeTreeListBoxHdl) ); + m_xSelectionToolTipLB->connect_selection_changed( + LINK(this, SwFieldRefPage, SubTypeTreeListBoxHdl)); m_xSelectionToolTipLB->connect_row_activated( LINK(this, SwFieldRefPage, TreeViewInsertHdl) ); m_xFilterED->grab_focus(); diff --git a/sw/source/ui/fldui/fldvar.cxx b/sw/source/ui/fldui/fldvar.cxx index eaf1c52503c5..bdd30be7a443 100644 --- a/sw/source/ui/fldui/fldvar.cxx +++ b/sw/source/ui/fldui/fldvar.cxx @@ -127,6 +127,9 @@ void SwFieldVarPage::Reset(const SfxItemSet* ) m_xTypeLB->set_size_request(nWidth, nHeight); m_xSelectionLB->set_size_request(nWidth, nHeight); m_xFormatLB->set_size_request(nWidth, nHeight/2); + auto size = m_xValueED->get_widget().get_size_request(); + m_xValueED->get_widget().set_size_request(size.getWidth(), + m_xValueED->get_widget().get_height_rows(5)); const SwField* pCurField = GetCurField(); assert(pCurField && " - instance missing!"); nTypeId = pCurField->GetTypeId(); @@ -151,8 +154,8 @@ void SwFieldVarPage::Reset(const SfxItemSet* ) RestorePos(*m_xTypeLB); m_xTypeLB->connect_row_activated(LINK(this, SwFieldVarPage, TreeViewInsertHdl)); - m_xTypeLB->connect_changed(LINK(this, SwFieldVarPage, TypeHdl)); - m_xSelectionLB->connect_changed(LINK(this, SwFieldVarPage, SubTypeListBoxHdl)); + m_xTypeLB->connect_selection_changed(LINK(this, SwFieldVarPage, TypeHdl)); + m_xSelectionLB->connect_selection_changed(LINK(this, SwFieldVarPage, SubTypeListBoxHdl)); m_xSelectionLB->connect_row_activated(LINK(this, SwFieldVarPage, SubTypeInsertHdl)); m_xFormatLB->connect_row_activated(LINK(this, SwFieldVarPage, TreeViewInsertHdl)); m_xNumFormatLB->connect_row_activated(LINK(this, SwFieldVarPage, TreeViewInsertHdl)); diff --git a/sw/source/ui/inc/bookmark.hxx b/sw/source/ui/inc/bookmark.hxx index f66fec0d91de..1692e4654ce7 100644 --- a/sw/source/ui/inc/bookmark.hxx +++ b/sw/source/ui/inc/bookmark.hxx @@ -57,7 +57,7 @@ public: void connect_changed(const Link& rLink) { - m_xControl->connect_changed(rLink); + m_xControl->connect_selection_changed(rLink); } void connect_row_activated(const Link& rLink) { diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx index d083d7a59e65..cc7432867163 100644 --- a/sw/source/ui/index/cnttab.cxx +++ b/sw/source/ui/index/cnttab.cxx @@ -1986,7 +1986,7 @@ SwTOXEntryTabPage::SwTOXEntryTabPage(weld::Container* pPage, weld::DialogControl m_xTabPB->connect_clicked(LINK(this, SwTOXEntryTabPage, InsertTokenHdl)); m_xHyperLinkPB->connect_clicked(LINK(this, SwTOXEntryTabPage, InsertTokenHdl)); m_xEditStylePB->connect_clicked(LINK(this, SwTOXEntryTabPage, EditStyleHdl)); - m_xLevelLB->connect_changed(LINK(this, SwTOXEntryTabPage, LevelHdl)); + m_xLevelLB->connect_selection_changed(LINK(this, SwTOXEntryTabPage, LevelHdl)); m_xTokenWIN->SetButtonSelectedHdl(LINK(this, SwTOXEntryTabPage, TokenSelectedHdl)); m_xTokenWIN->SetModifyHdl(LINK(this, SwTOXEntryTabPage, ModifyHdl)); m_xCharStyleLB->connect_changed(LINK(this, SwTOXEntryTabPage, StyleSelectHdl)); @@ -3573,8 +3573,8 @@ SwTOXStylesTabPage::SwTOXStylesTabPage(weld::Container* pPage, weld::DialogContr m_xEditStyleBT->connect_clicked(LINK(this, SwTOXStylesTabPage, EditStyleHdl)); m_xAssignBT->connect_clicked(LINK(this, SwTOXStylesTabPage, AssignHdl)); m_xStdBT->connect_clicked(LINK(this, SwTOXStylesTabPage, StdHdl)); - m_xParaLayLB->connect_changed(LINK(this, SwTOXStylesTabPage, EnableSelectHdl)); - m_xLevelLB->connect_changed(LINK(this, SwTOXStylesTabPage, EnableSelectHdl)); + m_xParaLayLB->connect_selection_changed(LINK(this, SwTOXStylesTabPage, EnableSelectHdl)); + m_xLevelLB->connect_selection_changed(LINK(this, SwTOXStylesTabPage, EnableSelectHdl)); m_xParaLayLB->connect_row_activated(LINK(this, SwTOXStylesTabPage, DoubleClickHdl)); } diff --git a/sw/source/ui/index/multmrk.cxx b/sw/source/ui/index/multmrk.cxx index 3710c18cc798..c6393b7c6cf8 100644 --- a/sw/source/ui/index/multmrk.cxx +++ b/sw/source/ui/index/multmrk.cxx @@ -32,7 +32,7 @@ SwMultiTOXMarkDlg::SwMultiTOXMarkDlg(weld::Window* pParent, SwTOXMgr& rTOXMgr) m_xTOXLB->set_size_request(m_xTOXLB->get_approximate_digit_width() * 32, m_xTOXLB->get_height_rows(8)); - m_xTOXLB->connect_changed(LINK(this, SwMultiTOXMarkDlg, SelectHdl)); + m_xTOXLB->connect_selection_changed(LINK(this, SwMultiTOXMarkDlg, SelectHdl)); sal_uInt16 nSize = m_rMgr.GetTOXMarkCount(); for (sal_uInt16 i = 0; i < nSize; ++i) diff --git a/sw/source/ui/misc/contentcontroldlg.cxx b/sw/source/ui/misc/contentcontroldlg.cxx index f075701a8689..8a3db74823ac 100644 --- a/sw/source/ui/misc/contentcontroldlg.cxx +++ b/sw/source/ui/misc/contentcontroldlg.cxx @@ -62,7 +62,7 @@ SwContentControlDlg::SwContentControlDlg(weld::Window* pParent, SwWrtShell& rWrt { m_xCheckedStateBtn->connect_clicked(LINK(this, SwContentControlDlg, SelectCharHdl)); m_xUncheckedStateBtn->connect_clicked(LINK(this, SwContentControlDlg, SelectCharHdl)); - m_xListItems->connect_changed(LINK(this, SwContentControlDlg, SelectionChangedHdl)); + m_xListItems->connect_selection_changed(LINK(this, SwContentControlDlg, SelectionChangedHdl)); m_xOk->connect_clicked(LINK(this, SwContentControlDlg, OkHdl)); // Only 2 items would be visible by default. diff --git a/sw/source/ui/misc/glosbib.cxx b/sw/source/ui/misc/glosbib.cxx index da9b4b1220b2..bda68dd1ac8a 100644 --- a/sw/source/ui/misc/glosbib.cxx +++ b/sw/source/ui/misc/glosbib.cxx @@ -59,7 +59,7 @@ SwGlossaryGroupDlg::SwGlossaryGroupDlg(weld::Window * pParent, m_xGroupTLB->set_size_request(nWidth, m_xGroupTLB->get_height_rows(10)); m_xGroupTLB->set_column_fixed_widths( { nWidth } ); - m_xGroupTLB->connect_changed(LINK(this, SwGlossaryGroupDlg, SelectHdl)); + m_xGroupTLB->connect_selection_changed(LINK(this, SwGlossaryGroupDlg, SelectHdl)); m_xNewPB->connect_clicked(LINK(this, SwGlossaryGroupDlg, NewHdl)); m_xDelPB->connect_clicked(LINK(this, SwGlossaryGroupDlg, DeleteHdl)); diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx index 476dac604edc..7a12be03473e 100644 --- a/sw/source/ui/misc/glossary.cxx +++ b/sw/source/ui/misc/glossary.cxx @@ -330,7 +330,7 @@ SwGlossaryDlg::SwGlossaryDlg(const SfxViewFrame& rViewFrame, m_xShortNameEdit->connect_changed(LINK(this,SwGlossaryDlg,NameModify)); m_xCategoryBox->connect_row_activated(LINK(this, SwGlossaryDlg, NameDoubleClick)); - m_xCategoryBox->connect_changed(LINK(this, SwGlossaryDlg, GrpSelect)); + m_xCategoryBox->connect_selection_changed(LINK(this, SwGlossaryDlg, GrpSelect)); m_xCategoryBox->connect_key_press(LINK(this, SwGlossaryDlg, KeyInputHdl)); m_xDropTarget.reset(new SwGlossaryDropTarget(*m_xCategoryBox, pGlosHdl)); diff --git a/sw/source/ui/misc/num.cxx b/sw/source/ui/misc/num.cxx index 4905a49eba55..95c406494ef0 100644 --- a/sw/source/ui/misc/num.cxx +++ b/sw/source/ui/misc/num.cxx @@ -112,7 +112,7 @@ SwNumPositionTabPage::SwNumPositionTabPage(weld::Container* pPage, weld::DialogC aLk = LINK(this, SwNumPositionTabPage, IndentAtHdl_Impl); m_xIndentAtMF->connect_value_changed(aLk); - m_xLevelLB->connect_changed(LINK(this, SwNumPositionTabPage, LevelHdl)); + m_xLevelLB->connect_selection_changed(LINK(this, SwNumPositionTabPage, LevelHdl)); m_xRelativeCB->connect_toggled(LINK(this, SwNumPositionTabPage, RelativeHdl)); m_xStandardPB->connect_clicked(LINK(this, SwNumPositionTabPage, StandardHdl)); diff --git a/sw/source/ui/misc/outline.cxx b/sw/source/ui/misc/outline.cxx index c3a92f33131d..eb68def4c6c6 100644 --- a/sw/source/ui/misc/outline.cxx +++ b/sw/source/ui/misc/outline.cxx @@ -122,7 +122,7 @@ SwNumNamesDlg::SwNumNamesDlg(weld::Window *pParent) m_xFormBox->append_text(SwResId(aID)); m_xFormEdit->connect_changed(LINK(this, SwNumNamesDlg, ModifyHdl)); - m_xFormBox->connect_changed(LINK(this, SwNumNamesDlg, SelectHdl)); + m_xFormBox->connect_selection_changed(LINK(this, SwNumNamesDlg, SelectHdl)); m_xFormBox->connect_row_activated(LINK(this, SwNumNamesDlg, DoubleClickHdl)); m_xFormBox->set_size_request(-1, m_xFormBox->get_height_rows(9)); } @@ -411,7 +411,7 @@ SwOutlineSettingsTabPage::SwOutlineSettingsTabPage(weld::Container* pPage, weld: m_xNumberBox->Reload(SwInsertNumTypes::NoNumbering | SwInsertNumTypes::Extended); m_xCollBox->make_sorted(); m_xCollBox->append_text(m_aNoFormatName); - m_xLevelLB->connect_changed(LINK(this, SwOutlineSettingsTabPage, LevelHdl)); + m_xLevelLB->connect_selection_changed(LINK(this, SwOutlineSettingsTabPage, LevelHdl)); m_xAllLevelNF->connect_value_changed(LINK(this, SwOutlineSettingsTabPage, ToggleComplete)); m_xCollBox->connect_changed(LINK(this, SwOutlineSettingsTabPage, CollSelect)); m_xNumberBox->connect_changed(LINK(this, SwOutlineSettingsTabPage, NumberSelect)); diff --git a/sw/source/ui/table/convert.cxx b/sw/source/ui/table/convert.cxx index 32f2d9323acb..88fbe8c8d4a2 100644 --- a/sw/source/ui/table/convert.cxx +++ b/sw/source/ui/table/convert.cxx @@ -214,7 +214,7 @@ void SwConvertTableDlg::Init() m_xBtnAlignment->connect_toggled(aLk); m_xBtnNumFormat->connect_toggled(aLk); - m_xLbFormat->connect_changed(LINK(this, SwConvertTableDlg, SelFormatHdl)); + m_xLbFormat->connect_selection_changed(LINK(this, SwConvertTableDlg, SelFormatHdl)); // Then the list to be expanded by the entry "- none -". m_xLbFormat->append_text(SwViewShell::GetShellRes()->aStrNone); diff --git a/sw/source/ui/table/instable.cxx b/sw/source/ui/table/instable.cxx index 5a38be0efea9..516bec604b6d 100644 --- a/sw/source/ui/table/instable.cxx +++ b/sw/source/ui/table/instable.cxx @@ -129,7 +129,7 @@ void SwInsTableDlg::InitAutoTableFormat() { m_aWndPreview.DetectRTL(m_pShell); - m_xLbFormat->connect_changed(LINK(this, SwInsTableDlg, SelFormatHdl)); + m_xLbFormat->connect_selection_changed(LINK(this, SwInsTableDlg, SelFormatHdl)); m_xTableTable.reset(new SwTableAutoFormatTable); m_xTableTable->Load(); diff --git a/sw/source/ui/table/tautofmt.cxx b/sw/source/ui/table/tautofmt.cxx index ca05712486e2..3d4a9c38abe8 100644 --- a/sw/source/ui/table/tautofmt.cxx +++ b/sw/source/ui/table/tautofmt.cxx @@ -115,7 +115,7 @@ void SwAutoFormatDlg::Init(const SwTableAutoFormat* pSelFormat) m_xBtnAdd->connect_clicked(LINK(this, SwAutoFormatDlg, AddHdl)); m_xBtnRemove->connect_clicked(LINK(this, SwAutoFormatDlg, RemoveHdl)); m_xBtnRename->connect_clicked(LINK(this, SwAutoFormatDlg, RenameHdl)); - m_xLbFormat->connect_changed(LINK(this, SwAutoFormatDlg, SelFormatHdl)); + m_xLbFormat->connect_selection_changed(LINK(this, SwAutoFormatDlg, SelFormatHdl)); m_xBtnAdd->set_sensitive(m_bSetAutoFormat); diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx index 757eba8c24c7..022104934d8c 100644 --- a/sw/source/uibase/dbui/dbmgr.cxx +++ b/sw/source/uibase/dbui/dbmgr.cxx @@ -1129,7 +1129,10 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell, if( bMT_EMAIL ) { // Reset internal mail accounting data - m_pImpl->m_xLastMessage.clear(); + { + std::unique_lock aGuard(m_pImpl->m_aAllEmailSendMutex); + m_pImpl->m_xLastMessage.clear(); + } xMailDispatcher.set( new MailDispatcher(rMergeDescriptor.xSmtpServer) ); xMailListener = new MailDispatcherListener_Impl( *this ); diff --git a/sw/source/uibase/inc/dbtree.hxx b/sw/source/uibase/inc/dbtree.hxx index c6806cdfed8a..2e9524675456 100644 --- a/sw/source/uibase/inc/dbtree.hxx +++ b/sw/source/uibase/inc/dbtree.hxx @@ -54,7 +54,10 @@ public: void AddDataSource(const OUString& rSource); - void connect_changed(const Link& rLink) { m_xTreeView->connect_changed(rLink); } + void connect_changed(const Link& rLink) + { + m_xTreeView->connect_selection_changed(rLink); + } void connect_row_activated(const Link& rLink) { m_xTreeView->connect_row_activated(rLink); } std::unique_ptr make_iterator(const weld::TreeIter* pOrig = nullptr) const { return m_xTreeView->make_iterator(pOrig); } bool get_selected(weld::TreeIter* pIter) const { return m_xTreeView->get_selected(pIter); } diff --git a/sw/source/uibase/misc/redlndlg.cxx b/sw/source/uibase/misc/redlndlg.cxx index d1180be8271a..b2dd7fd8b4db 100644 --- a/sw/source/uibase/misc/redlndlg.cxx +++ b/sw/source/uibase/misc/redlndlg.cxx @@ -248,7 +248,7 @@ SwRedlineAcceptDlg::SwRedlineAcceptDlg(std::shared_ptr xParent, we weld::TreeView& rTreeView = m_pTable->GetWidget(); rTreeView.set_selection_mode(SelectionMode::Multiple); - rTreeView.connect_changed(LINK(this, SwRedlineAcceptDlg, SelectHdl)); + rTreeView.connect_selection_changed(LINK(this, SwRedlineAcceptDlg, SelectHdl)); rTreeView.connect_popup_menu(LINK(this, SwRedlineAcceptDlg, CommandHdl)); // avoid multiple selection of the same texts: @@ -823,7 +823,7 @@ void SwRedlineAcceptDlg::RemoveParents(SwRedlineTable::size_type nStart, SwRedli weld::TreeView& rTreeView = m_pTable->GetWidget(); // because of Bug of TLB that ALWAYS calls the SelectHandler at Remove: - rTreeView.connect_changed(Link()); + rTreeView.connect_selection_changed(Link()); bool bChildrenRemoved = false; rTreeView.thaw(); @@ -881,7 +881,7 @@ void SwRedlineAcceptDlg::RemoveParents(SwRedlineTable::size_type nStart, SwRedli } rTreeView.thaw(); - rTreeView.connect_changed(LINK(this, SwRedlineAcceptDlg, SelectHdl)); + rTreeView.connect_selection_changed(LINK(this, SwRedlineAcceptDlg, SelectHdl)); // unfortunately by Remove it was selected from the TLB always again ... rTreeView.unselect_all(); rTreeView.freeze(); diff --git a/sw/source/uibase/sidebar/QuickFindPanel.cxx b/sw/source/uibase/sidebar/QuickFindPanel.cxx index 6cbaa4fe1f55..a5e633254ab0 100644 --- a/sw/source/uibase/sidebar/QuickFindPanel.cxx +++ b/sw/source/uibase/sidebar/QuickFindPanel.cxx @@ -137,7 +137,7 @@ QuickFindPanel::QuickFindPanel(weld::Widget* pParent, const uno::Referenceconnect_custom_render(LINK(this, QuickFindPanel, SearchFindsListRender)); m_xSearchFindsList->set_column_custom_renderer(1, true); - m_xSearchFindsList->connect_changed( + m_xSearchFindsList->connect_selection_changed( LINK(this, QuickFindPanel, SearchFindsListSelectionChangedHandler)); m_xSearchFindsList->connect_row_activated( LINK(this, QuickFindPanel, SearchFindsListRowActivatedHandler)); diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index c48b519bb276..72cb5c3c0931 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -1165,7 +1165,7 @@ SwContentTree::SwContentTree(std::unique_ptr xTreeView, SwNaviga m_xTreeView->connect_expanding(LINK(this, SwContentTree, ExpandHdl)); m_xTreeView->connect_collapsing(LINK(this, SwContentTree, CollapseHdl)); m_xTreeView->connect_row_activated(LINK(this, SwContentTree, ContentDoubleClickHdl)); - m_xTreeView->connect_changed(LINK(this, SwContentTree, SelectHdl)); + m_xTreeView->connect_selection_changed(LINK(this, SwContentTree, SelectHdl)); m_xTreeView->connect_focus_in(LINK(this, SwContentTree, FocusInHdl)); m_xTreeView->connect_key_press(LINK(this, SwContentTree, KeyInputHdl)); m_xTreeView->connect_popup_menu(LINK(this, SwContentTree, CommandHdl)); diff --git a/sw/source/uibase/utlui/glbltree.cxx b/sw/source/uibase/utlui/glbltree.cxx index 7fef7e0c7520..6d08ca16e36d 100644 --- a/sw/source/uibase/utlui/glbltree.cxx +++ b/sw/source/uibase/utlui/glbltree.cxx @@ -146,7 +146,7 @@ SwGlobalTree::SwGlobalTree(std::unique_ptr xTreeView, SwNavigati m_xTreeView->set_help_id(HID_NAVIGATOR_GLOB_TREELIST); Select(); m_xTreeView->connect_row_activated(LINK(this, SwGlobalTree, DoubleClickHdl)); - m_xTreeView->connect_changed(LINK(this, SwGlobalTree, SelectHdl)); + m_xTreeView->connect_selection_changed(LINK(this, SwGlobalTree, SelectHdl)); m_xTreeView->connect_focus_in(LINK(this, SwGlobalTree, FocusInHdl)); m_xTreeView->connect_key_press(LINK(this, SwGlobalTree, KeyInputHdl)); m_xTreeView->connect_popup_menu(LINK(this, SwGlobalTree, CommandHdl)); diff --git a/sw/source/uibase/utlui/gloslst.cxx b/sw/source/uibase/utlui/gloslst.cxx index 1013300daa83..a9131a6dc6a8 100644 --- a/sw/source/uibase/utlui/gloslst.cxx +++ b/sw/source/uibase/utlui/gloslst.cxx @@ -71,7 +71,7 @@ SwGlossDecideDlg::SwGlossDecideDlg(weld::Window* pParent) m_xListLB->set_size_request(m_xListLB->get_approximate_digit_width() * 32, m_xListLB->get_height_rows(8)); m_xListLB->connect_row_activated(LINK(this, SwGlossDecideDlg, DoubleClickHdl)); - m_xListLB->connect_changed(LINK(this, SwGlossDecideDlg, SelectHdl)); + m_xListLB->connect_selection_changed(LINK(this, SwGlossDecideDlg, SelectHdl)); } IMPL_LINK_NOARG(SwGlossDecideDlg, DoubleClickHdl, weld::TreeView&, bool) diff --git a/sw/source/uibase/utlui/numfmtlb.cxx b/sw/source/uibase/utlui/numfmtlb.cxx index d30afecdce7b..a7251b159953 100644 --- a/sw/source/uibase/utlui/numfmtlb.cxx +++ b/sw/source/uibase/utlui/numfmtlb.cxx @@ -157,7 +157,7 @@ void SwNumFormatTreeView::Init() { SwNumFormatBase::Init(); - mxControl->connect_changed(LINK(this, SwNumFormatTreeView, SelectHdl)); + mxControl->connect_selection_changed(LINK(this, SwNumFormatTreeView, SelectHdl)); } void SwNumFormatBase::SetFormatType(const SvNumFormatType nFormatType) diff --git a/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx b/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx index aab6be1833a6..d095afef0b35 100644 --- a/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx +++ b/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx @@ -9840,6 +9840,22 @@ void DomainMapper_Impl::ApplySettingsTable() // i.e. it typesets the same text with less lines and pages. if (m_pSettingsTable->GetWordCompatibilityMode() >= 15) xSettings->setPropertyValue(u"JustifyLinesWithShrinking"_ustr, uno::Any( true )); + + if (m_pSettingsTable->GetWordCompatibilityMode() > 12) + { + // impossible to be importing as a 2007-only format when compat mode is not equal to 12, + // so change from ECMA_376_1ST_EDITION to ISOIEC_29500_2008 + // so that at export time it will not be forced into compat12 mode. + OUString sFilterName; + comphelper::SequenceAsHashMap aMap(m_xTextDocument->getArgs()); + aMap["FilterName"] >>= sFilterName; + if (sFilterName == "MS Word 2007 XML") + { + m_xTextDocument->setArgs( + { comphelper::makePropertyValue("FilterName", OUString("Office Open XML Text")) }); + } + } + if (m_pSettingsTable->GetUsePrinterMetrics()) xSettings->setPropertyValue(u"PrinterIndependentLayout"_ustr, uno::Any(document::PrinterIndependentLayout::DISABLED)); if( m_pSettingsTable->GetEmbedTrueTypeFonts()) diff --git a/tools/qa/cppunit/test_urlobj.cxx b/tools/qa/cppunit/test_urlobj.cxx index cf4fa5a03cd2..31347cf4b576 100644 --- a/tools/qa/cppunit/test_urlobj.cxx +++ b/tools/qa/cppunit/test_urlobj.cxx @@ -354,6 +354,49 @@ namespace tools_urlobj } } + void testIsExoticProtocol() { + { + INetURLObject url(u"vnd.sun.star.pkg://slot%3A0"); + CPPUNIT_ASSERT_EQUAL(INetProtocol::VndSunStarPkg, url.GetProtocol()); + CPPUNIT_ASSERT(url.IsExoticProtocol()); + } + { + INetURLObject url(u"vnd.sun.star.pkg://vnd.sun.star.pkg%3A%2F%2Fslot%253A0"); + CPPUNIT_ASSERT_EQUAL(INetProtocol::VndSunStarPkg, url.GetProtocol()); + CPPUNIT_ASSERT(url.IsExoticProtocol()); + } + { + INetURLObject url(u"vnd.sun.star.pkg://http%3A%2F%2Fexample.net"); + CPPUNIT_ASSERT_EQUAL(INetProtocol::VndSunStarPkg, url.GetProtocol()); + CPPUNIT_ASSERT(!url.IsExoticProtocol()); + } + { + INetURLObject url(u"vnd.sun.star.zip://slot%3A0"); + CPPUNIT_ASSERT_EQUAL(INetProtocol::Generic, url.GetProtocol()); + CPPUNIT_ASSERT(url.IsExoticProtocol()); + } + { + INetURLObject url(u"vnd.sun.star.zip://slot%3A0/foo"); + CPPUNIT_ASSERT_EQUAL(INetProtocol::Generic, url.GetProtocol()); + CPPUNIT_ASSERT(url.IsExoticProtocol()); + } + { + INetURLObject url(u"vnd.sun.star.zip://slot%3A0?foo"); + CPPUNIT_ASSERT_EQUAL(INetProtocol::Generic, url.GetProtocol()); + CPPUNIT_ASSERT(url.IsExoticProtocol()); + } + { + INetURLObject url(u"vnd.sun.star.zip://slot%3A0#foo"); + CPPUNIT_ASSERT_EQUAL(INetProtocol::Generic, url.GetProtocol()); + CPPUNIT_ASSERT(url.IsExoticProtocol()); + } + { + INetURLObject url(u"vnd.sun.star.zip://http%3A%2F%2Fexample.net"); + CPPUNIT_ASSERT_EQUAL(INetProtocol::Generic, url.GetProtocol()); + CPPUNIT_ASSERT(!url.IsExoticProtocol()); + } + } + // Change the following lines only, if you add, remove or rename // member functions of the current class, // because these macros are need by auto register mechanism. @@ -371,6 +414,7 @@ namespace tools_urlobj CPPUNIT_TEST( testChangeScheme ); CPPUNIT_TEST( testTd146382 ); CPPUNIT_TEST( testParseSmart ); + CPPUNIT_TEST( testIsExoticProtocol ); CPPUNIT_TEST_SUITE_END( ); }; // class createPool diff --git a/tools/source/fsys/urlobj.cxx b/tools/source/fsys/urlobj.cxx index d09b0d547d7e..7f6e43cfc322 100644 --- a/tools/source/fsys/urlobj.cxx +++ b/tools/source/fsys/urlobj.cxx @@ -4889,12 +4889,32 @@ OUString INetURLObject::CutExtension() bool INetURLObject::IsExoticProtocol() const { - return m_eScheme == INetProtocol::Slot || - m_eScheme == INetProtocol::Macro || - m_eScheme == INetProtocol::Uno || - m_eScheme == INetProtocol::VndSunStarExpand || - isSchemeEqualTo(u"vnd.sun.star.script") || - isSchemeEqualTo(u"service"); + if (m_eScheme == INetProtocol::Slot || + m_eScheme == INetProtocol::Macro || + m_eScheme == INetProtocol::Uno || + m_eScheme == INetProtocol::VndSunStarExpand || + isSchemeEqualTo(u"vnd.sun.star.script") || + isSchemeEqualTo(u"service")) + { + return true; + } + if (m_eScheme == INetProtocol::VndSunStarPkg) { + return INetURLObject(GetHost(INetURLObject::DecodeMechanism::WithCharset)) + .IsExoticProtocol(); + } + if (isSchemeEqualTo(u"vnd.sun.star.zip")) + { + OUString sPayloadURL = GetURLPath(INetURLObject::DecodeMechanism::NONE); + if (!sPayloadURL.startsWith(u"//")) { + return false; + } + auto const find = [&sPayloadURL](auto c) { + auto const n = sPayloadURL.indexOf(c, 2); + return n == -1 ? sPayloadURL.getLength() : n; + }; + return INetURLObject(decode(sPayloadURL.subView(2, std::min(find('/'), find('?')) - 2), INetURLObject::DecodeMechanism::WithCharset)).IsExoticProtocol(); + } + return false; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/ucb/source/core/provprox.cxx b/ucb/source/core/provprox.cxx index 54ba56b33165..863e3c1469b1 100644 --- a/ucb/source/core/provprox.cxx +++ b/ucb/source/core/provprox.cxx @@ -108,31 +108,12 @@ UcbContentProviderProxy::~UcbContentProviderProxy() // XInterface methods. -void SAL_CALL UcbContentProviderProxy::acquire() - noexcept -{ - OWeakObject::acquire(); -} - -void SAL_CALL UcbContentProviderProxy::release() - noexcept -{ - OWeakObject::release(); -} // virtual Any SAL_CALL UcbContentProviderProxy::queryInterface( const Type & rType ) { - Any aRet = cppu::queryInterface( rType, - static_cast< XTypeProvider * >( this ), - static_cast< XServiceInfo * >( this ), - static_cast< XContentProvider * >( this ), - static_cast< XParameterizedContentProvider * >( this ), - static_cast< XContentProviderSupplier * >( this ) ); - - if ( !aRet.hasValue() ) - aRet = OWeakObject::queryInterface( rType ); + Any aRet = UcbContentProviderProxy_BASE::queryInterface(rType); if ( !aRet.hasValue() ) { @@ -148,28 +129,13 @@ UcbContentProviderProxy::queryInterface( const Type & rType ) // XTypeProvider methods. - -XTYPEPROVIDER_COMMON_IMPL( UcbContentProviderProxy ); - - Sequence< Type > SAL_CALL UcbContentProviderProxy::getTypes() { // Get original provider and forward the call... - Reference< XTypeProvider > xProvider( getContentProvider(), UNO_QUERY ); - if ( xProvider.is() ) - { + if (Reference xProvider{ getContentProvider(), UNO_QUERY }) return xProvider->getTypes(); - } - else - { - static cppu::OTypeCollection s_aCollection( - CPPU_TYPE_REF( XTypeProvider ), - CPPU_TYPE_REF( XServiceInfo ), - CPPU_TYPE_REF( XContentProvider ), - CPPU_TYPE_REF( XParameterizedContentProvider ), - CPPU_TYPE_REF( XContentProviderSupplier ) ); - return s_aCollection.getTypes(); - } + + return UcbContentProviderProxy_BASE::getTypes(); } diff --git a/ucb/source/core/provprox.hxx b/ucb/source/core/provprox.hxx index 746c9b63d801..a5486a48f81e 100644 --- a/ucb/source/core/provprox.hxx +++ b/ucb/source/core/provprox.hxx @@ -55,16 +55,12 @@ public: - -class UcbContentProviderProxy : - public cppu::OWeakObject, - public css::lang::XTypeProvider, - public css::lang::XServiceInfo, - public css::ucb::XContentProviderSupplier, - public css::ucb::XContentProvider, - public css::ucb::XParameterizedContentProvider +using UcbContentProviderProxy_BASE = comphelper::WeakImplHelper; +class UcbContentProviderProxy : public UcbContentProviderProxy_BASE { - std::mutex m_aMutex; OUString m_aService; OUString m_aTemplate; OUString m_aArguments; @@ -86,13 +82,8 @@ public: // XInterface virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override; - virtual void SAL_CALL acquire() - noexcept override; - virtual void SAL_CALL release() - noexcept override; // XTypeProvider - virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override; virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override; // XServiceInfo diff --git a/ucb/source/core/ucbcmds.cxx b/ucb/source/core/ucbcmds.cxx index e5be74883fa0..7995e6746629 100644 --- a/ucb/source/core/ucbcmds.cxx +++ b/ucb/source/core/ucbcmds.cxx @@ -376,7 +376,7 @@ NameClashContinuation interactiveNameClashResolve( { // Handler handled the request. uno::Reference< task::XInteractionAbort > xAbort( - xSelection.get(), uno::UNO_QUERY ); + xSelection->getXWeak(), uno::UNO_QUERY ); if ( xAbort.is() ) { // Abort. @@ -387,7 +387,7 @@ NameClashContinuation interactiveNameClashResolve( uno::Reference< ucb::XInteractionReplaceExistingData > xReplace( - xSelection.get(), uno::UNO_QUERY ); + xSelection->getXWeak(), uno::UNO_QUERY ); if ( xReplace.is() ) { // Try again: Replace existing data. @@ -398,7 +398,7 @@ NameClashContinuation interactiveNameClashResolve( uno::Reference< ucb::XInteractionSupplyName > xSupplyName( - xSelection.get(), uno::UNO_QUERY ); + xSelection->getXWeak(), uno::UNO_QUERY ); if ( xSupplyName.is() ) { // Try again: Use new name. diff --git a/ucb/source/ucp/cmis/auth_provider.cxx b/ucb/source/ucp/cmis/auth_provider.cxx index 3123ae64d430..6c6a4535e0bc 100644 --- a/ucb/source/ucp/cmis/auth_provider.cxx +++ b/ucb/source/ucp/cmis/auth_provider.cxx @@ -48,7 +48,7 @@ namespace cmis { // Handler handled the request. uno::Reference< task::XInteractionAbort > xAbort( - xSelection.get(), uno::UNO_QUERY ); + xSelection->getXWeak(), uno::UNO_QUERY ); if ( !xAbort.is() ) { const rtl::Reference< @@ -91,7 +91,7 @@ namespace cmis if (xSelection.is()) { // Handler handled the request. - uno::Reference xAbort(xSelection.get(), + uno::Reference xAbort(xSelection->getXWeak(), uno::UNO_QUERY); if (!xAbort.is()) { diff --git a/ucb/source/ucp/gio/gio_mount.cxx b/ucb/source/ucp/gio/gio_mount.cxx index 1d2dbcea8142..11e4117deb82 100644 --- a/ucb/source/ucp/gio/gio_mount.cxx +++ b/ucb/source/ucp/gio/gio_mount.cxx @@ -157,7 +157,7 @@ static void ooo_mount_operation_ask_password (GMountOperation *op, return; } - css::uno::Reference< css::task::XInteractionAbort > xAbort(xSelection.get(), css::uno::UNO_QUERY ); + css::uno::Reference< css::task::XInteractionAbort > xAbort(xSelection->getXWeak(), css::uno::UNO_QUERY ); if ( xAbort.is() ) { g_mount_operation_reply (op, G_MOUNT_OPERATION_ABORTED); diff --git a/ucb/source/ucp/tdoc/tdoc_content.cxx b/ucb/source/ucp/tdoc/tdoc_content.cxx index 6580c8af6b67..dcc2653beade 100644 --- a/ucb/source/ucp/tdoc/tdoc_content.cxx +++ b/ucb/source/ucp/tdoc/tdoc_content.cxx @@ -2627,7 +2627,7 @@ static OUString obtainPassword( { // Handler handled the request. uno::Reference< task::XInteractionAbort > xAbort( - xSelection.get(), uno::UNO_QUERY ); + xSelection->getXWeak(), uno::UNO_QUERY ); if ( xAbort.is() ) { throw ucb::CommandFailedException( @@ -2637,7 +2637,7 @@ static OUString obtainPassword( } uno::Reference< task::XInteractionPassword > xPassword( - xSelection.get(), uno::UNO_QUERY ); + xSelection->getXWeak(), uno::UNO_QUERY ); if ( xPassword.is() ) { return xPassword->getPassword(); diff --git a/ucb/source/ucp/tdoc/tdoc_passwordrequest.cxx b/ucb/source/ucp/tdoc/tdoc_passwordrequest.cxx index 412b39fe8a62..76ceff75f1d0 100644 --- a/ucb/source/ucp/tdoc/tdoc_passwordrequest.cxx +++ b/ucb/source/ucp/tdoc/tdoc_passwordrequest.cxx @@ -37,25 +37,13 @@ namespace tdoc_ucp { namespace { - class InteractionSupplyPassword : - public ucbhelper::InteractionContinuation, - public lang::XTypeProvider, - public task::XInteractionPassword + using InteractionSupplyPassword_BASE = cppu::ImplInheritanceHelper; + class InteractionSupplyPassword : public InteractionSupplyPassword_BASE { public: explicit InteractionSupplyPassword( ucbhelper::InteractionRequest * pRequest ) - : InteractionContinuation( pRequest ) {} - - // XInterface - virtual uno::Any SAL_CALL queryInterface( const uno::Type & rType ) override; - virtual void SAL_CALL acquire() - noexcept override; - virtual void SAL_CALL release() - noexcept override; - - // XTypeProvider - virtual uno::Sequence< uno::Type > SAL_CALL getTypes() override; - virtual uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override; + : InteractionSupplyPassword_BASE( pRequest ) {} // XInteractionContinuation virtual void SAL_CALL select() override; @@ -76,61 +64,6 @@ namespace tdoc_ucp // InteractionSupplyPassword Implementation. -// XInterface methods. - - -// virtual -void SAL_CALL InteractionSupplyPassword::acquire() - noexcept -{ - OWeakObject::acquire(); -} - - -// virtual -void SAL_CALL InteractionSupplyPassword::release() - noexcept -{ - OWeakObject::release(); -} - - -// virtual -uno::Any SAL_CALL -InteractionSupplyPassword::queryInterface( const uno::Type & rType ) -{ - uno::Any aRet = cppu::queryInterface( rType, - static_cast< lang::XTypeProvider * >( this ), - static_cast< task::XInteractionContinuation * >( this ), - static_cast< task::XInteractionPassword * >( this ) ); - - return aRet.hasValue() - ? aRet : InteractionContinuation::queryInterface( rType ); -} - - -// XTypeProvider methods. - - -// virtual -uno::Sequence< sal_Int8 > SAL_CALL -InteractionSupplyPassword::getImplementationId() -{ - return css::uno::Sequence(); -} - - -// virtual -uno::Sequence< uno::Type > SAL_CALL InteractionSupplyPassword::getTypes() -{ - static cppu::OTypeCollection s_aCollection( - cppu::UnoType::get(), - cppu::UnoType::get() ); - - return s_aCollection.getTypes(); -} - - // XInteractionContinuation methods. diff --git a/ucb/source/ucp/webdav-curl/DAVResourceAccess.cxx b/ucb/source/ucp/webdav-curl/DAVResourceAccess.cxx index 5fc9eccc1acd..e24c98fc3e77 100644 --- a/ucb/source/ucp/webdav-curl/DAVResourceAccess.cxx +++ b/ucb/source/ucp/webdav-curl/DAVResourceAccess.cxx @@ -80,7 +80,7 @@ int DAVAuthListener_Impl::authenticate( { // Handler handled the request. uno::Reference< task::XInteractionAbort > xAbort( - xSelection.get(), uno::UNO_QUERY ); + xSelection->getXWeak(), uno::UNO_QUERY ); if ( !xAbort.is() ) { const rtl::Reference< diff --git a/ucbhelper/source/provider/interactionrequest.cxx b/ucbhelper/source/provider/interactionrequest.cxx index 0ac7ec94995c..1e4ca4dab319 100644 --- a/ucbhelper/source/provider/interactionrequest.cxx +++ b/ucbhelper/source/provider/interactionrequest.cxx @@ -143,44 +143,6 @@ void InteractionContinuation::recordSelection() // InteractionAbort Implementation. -// XInterface methods. - - -// virtual -uno::Any SAL_CALL -InteractionAbort::queryInterface( const uno::Type & rType ) -{ - uno::Any aRet = cppu::queryInterface( rType, - static_cast< lang::XTypeProvider * >( this ), - static_cast< task::XInteractionContinuation * >( this ), - static_cast< task::XInteractionAbort * >( this ) ); - - return aRet.hasValue() - ? aRet : InteractionContinuation::queryInterface( rType ); -} - - -// XTypeProvider methods. - - -// virtual -uno::Sequence< sal_Int8 > SAL_CALL InteractionAbort::getImplementationId() -{ - return css::uno::Sequence(); -} - - -// virtual -uno::Sequence< uno::Type > SAL_CALL InteractionAbort::getTypes() -{ - static cppu::OTypeCollection s_aCollection( - cppu::UnoType::get(), - cppu::UnoType::get() ); - - return s_aCollection.getTypes(); -} - - // XInteractionContinuation methods. @@ -194,44 +156,6 @@ void SAL_CALL InteractionAbort::select() // InteractionRetry Implementation. -// XInterface methods. - - -// virtual -uno::Any SAL_CALL -InteractionRetry::queryInterface( const uno::Type & rType ) -{ - uno::Any aRet = cppu::queryInterface( rType, - static_cast< lang::XTypeProvider * >( this ), - static_cast< task::XInteractionContinuation * >( this ), - static_cast< task::XInteractionRetry * >( this ) ); - - return aRet.hasValue() - ? aRet : InteractionContinuation::queryInterface( rType ); -} - - -// XTypeProvider methods. - - -// virtual -uno::Sequence< sal_Int8 > SAL_CALL InteractionRetry::getImplementationId() -{ - return css::uno::Sequence(); -} - - -// virtual -uno::Sequence< uno::Type > SAL_CALL InteractionRetry::getTypes() -{ - static cppu::OTypeCollection s_aCollection( - cppu::UnoType::get(), - cppu::UnoType::get() ); - - return s_aCollection.getTypes(); -} - - // XInteractionContinuation methods. @@ -245,44 +169,6 @@ void SAL_CALL InteractionRetry::select() // InteractionApprove Implementation. -// XInterface methods. - - -// virtual -uno::Any SAL_CALL -InteractionApprove::queryInterface( const uno::Type & rType ) -{ - uno::Any aRet = cppu::queryInterface( rType, - static_cast< lang::XTypeProvider * >( this ), - static_cast< task::XInteractionContinuation * >( this ), - static_cast< task::XInteractionApprove * >( this ) ); - - return aRet.hasValue() - ? aRet : InteractionContinuation::queryInterface( rType ); -} - - -// XTypeProvider methods. - - -// virtual -uno::Sequence< sal_Int8 > SAL_CALL InteractionApprove::getImplementationId() -{ - return css::uno::Sequence(); -} - - -// virtual -uno::Sequence< uno::Type > SAL_CALL InteractionApprove::getTypes() -{ - static cppu::OTypeCollection s_aCollection( - cppu::UnoType::get(), - cppu::UnoType::get() ); - - return s_aCollection.getTypes(); -} - - // XInteractionContinuation methods. @@ -296,44 +182,6 @@ void SAL_CALL InteractionApprove::select() // InteractionDisapprove Implementation. -// XInterface methods. - - -// virtual -uno::Any SAL_CALL -InteractionDisapprove::queryInterface( const uno::Type & rType ) -{ - uno::Any aRet = cppu::queryInterface( rType, - static_cast< lang::XTypeProvider * >( this ), - static_cast< task::XInteractionContinuation * >( this ), - static_cast< task::XInteractionDisapprove * >( this ) ); - - return aRet.hasValue() - ? aRet : InteractionContinuation::queryInterface( rType ); -} - - -// XTypeProvider methods. - - -// virtual -uno::Sequence< sal_Int8 > SAL_CALL InteractionDisapprove::getImplementationId() -{ - return css::uno::Sequence(); -} - - -// virtual -uno::Sequence< uno::Type > SAL_CALL InteractionDisapprove::getTypes() -{ - static cppu::OTypeCollection s_aCollection( - cppu::UnoType::get(), - cppu::UnoType::get() ); - - return s_aCollection.getTypes(); -} - - // XInteractionContinuation methods. @@ -347,46 +195,6 @@ void SAL_CALL InteractionDisapprove::select() // InteractionSupplyAuthentication Implementation. -// XInterface methods. - - -// virtual -uno::Any SAL_CALL -InteractionSupplyAuthentication::queryInterface( const uno::Type & rType ) -{ - uno::Any aRet = cppu::queryInterface( rType, - static_cast< lang::XTypeProvider * >( this ), - static_cast< task::XInteractionContinuation * >( this ), - static_cast< ucb::XInteractionSupplyAuthentication * >( this ), - static_cast< ucb::XInteractionSupplyAuthentication2 * >( this )); - - return aRet.hasValue() - ? aRet : InteractionContinuation::queryInterface( rType ); -} - - -// XTypeProvider methods. - - -// virtual -uno::Sequence< sal_Int8 > SAL_CALL -InteractionSupplyAuthentication::getImplementationId() -{ - return css::uno::Sequence(); -} - - -// virtual -uno::Sequence< uno::Type > SAL_CALL InteractionSupplyAuthentication::getTypes() -{ - static cppu::OTypeCollection s_aCollection( - cppu::UnoType::get(), - cppu::UnoType::get() ); - - return s_aCollection.getTypes(); -} - - // XInteractionContinuation methods. @@ -538,45 +346,6 @@ void SAL_CALL InteractionSupplyAuthentication::setUseSystemCredentials( // InteractionReplaceExistingData Implementation. -// XInterface methods. - - -// virtual -uno::Any SAL_CALL -InteractionReplaceExistingData::queryInterface( const uno::Type & rType ) -{ - uno::Any aRet = cppu::queryInterface( rType, - static_cast< lang::XTypeProvider * >( this ), - static_cast< task::XInteractionContinuation * >( this ), - static_cast< ucb::XInteractionReplaceExistingData * >( this ) ); - - return aRet.hasValue() - ? aRet : InteractionContinuation::queryInterface( rType ); -} - - -// XTypeProvider methods. - - -// virtual -uno::Sequence< sal_Int8 > SAL_CALL -InteractionReplaceExistingData::getImplementationId() -{ - return css::uno::Sequence(); -} - - -// virtual -uno::Sequence< uno::Type > SAL_CALL InteractionReplaceExistingData::getTypes() -{ - static cppu::OTypeCollection s_aCollection( - cppu::UnoType::get(), - cppu::UnoType::get() ); - - return s_aCollection.getTypes(); -} - - // XInteractionContinuation methods. @@ -588,20 +357,6 @@ void SAL_CALL InteractionReplaceExistingData::select() // InteractionAuthFallback Implementation -// XInterface methods. - -// virtual -uno::Any SAL_CALL -InteractionAuthFallback::queryInterface( const uno::Type & rType ) -{ - uno::Any aRet = cppu::queryInterface( rType, - static_cast< task::XInteractionContinuation * >( this ), - static_cast< ucb::XInteractionAuthFallback * >( this )); - - return aRet.hasValue() - ? aRet : InteractionContinuation::queryInterface( rType ); -} - // XInteractionContinuation methods. // virtual diff --git a/ucbhelper/source/provider/simpleinteractionrequest.cxx b/ucbhelper/source/provider/simpleinteractionrequest.cxx index d846be5d352b..ce18d17625b2 100644 --- a/ucbhelper/source/provider/simpleinteractionrequest.cxx +++ b/ucbhelper/source/provider/simpleinteractionrequest.cxx @@ -62,25 +62,23 @@ ContinuationFlags SimpleInteractionRequest::getResponse() const rtl::Reference< InteractionContinuation > xSelection = getSelection(); if ( xSelection.is() ) { - InteractionContinuation * pSelection = xSelection.get(); - uno::Reference< task::XInteractionAbort > xAbort( - pSelection, uno::UNO_QUERY ); + xSelection->getXWeak(), uno::UNO_QUERY ); if ( xAbort.is() ) return ContinuationFlags::Abort; uno::Reference< task::XInteractionRetry > xRetry( - pSelection, uno::UNO_QUERY ); + xSelection->getXWeak(), uno::UNO_QUERY ); if ( xRetry.is() ) return ContinuationFlags::Retry; uno::Reference< task::XInteractionApprove > xApprove( - pSelection, uno::UNO_QUERY ); + xSelection->getXWeak(), uno::UNO_QUERY ); if ( xApprove.is() ) return ContinuationFlags::Approve; uno::Reference< task::XInteractionDisapprove > xDisapprove( - pSelection, uno::UNO_QUERY ); + xSelection->getXWeak(), uno::UNO_QUERY ); if ( xDisapprove.is() ) return ContinuationFlags::Disapprove; diff --git a/ucbhelper/source/provider/simplenameclashresolverequest.cxx b/ucbhelper/source/provider/simplenameclashresolverequest.cxx index 652bdcdbb187..a563983d13cb 100644 --- a/ucbhelper/source/provider/simplenameclashresolverequest.cxx +++ b/ucbhelper/source/provider/simplenameclashresolverequest.cxx @@ -27,35 +27,21 @@ using namespace com::sun::star; namespace ucbhelper { +using InteractionSupplyName_BASE = cppu::ImplInheritanceHelper; /** * This class implements a standard interaction continuation, namely the * interface XInteractionSupplyName. Instances of this class can be passed * along with an interaction request to indicate the possibility to * supply a new name. */ -class InteractionSupplyName : public InteractionContinuation, - public css::lang::XTypeProvider, - public css::ucb::XInteractionSupplyName +class InteractionSupplyName : public InteractionSupplyName_BASE { OUString m_aName; public: explicit InteractionSupplyName( InteractionRequest * pRequest ) - : InteractionContinuation( pRequest ) {} - - // XInterface - virtual css::uno::Any SAL_CALL - queryInterface( const css::uno::Type & rType ) override; - virtual void SAL_CALL acquire() - noexcept override; - virtual void SAL_CALL release() - noexcept override; - - // XTypeProvider - virtual css::uno::Sequence< css::uno::Type > SAL_CALL - getTypes() override; - virtual css::uno::Sequence< sal_Int8 > SAL_CALL - getImplementationId() override; + : InteractionSupplyName_BASE( pRequest ) {} // XInteractionContinuation virtual void SAL_CALL select() override; @@ -74,44 +60,6 @@ public: const OUString & getName() const { return m_aName; } }; -void SAL_CALL InteractionSupplyName::acquire() - noexcept -{ - OWeakObject::acquire(); -} - -void SAL_CALL InteractionSupplyName::release() - noexcept -{ - OWeakObject::release(); -} - -uno::Any SAL_CALL -InteractionSupplyName::queryInterface( const uno::Type & rType ) -{ - uno::Any aRet = cppu::queryInterface( rType, - static_cast< lang::XTypeProvider * >( this ), - static_cast< task::XInteractionContinuation * >( this ), - static_cast< ucb::XInteractionSupplyName * >( this ) ); - - return aRet.hasValue() - ? aRet : InteractionContinuation::queryInterface( rType ); -} - -uno::Sequence< sal_Int8 > SAL_CALL InteractionSupplyName::getImplementationId() -{ - return css::uno::Sequence(); -} - -uno::Sequence< uno::Type > SAL_CALL InteractionSupplyName::getTypes() -{ - static cppu::OTypeCollection s_aCollection( - cppu::UnoType::get(), - cppu::UnoType::get() ); - - return s_aCollection.getTypes(); -} - void SAL_CALL InteractionSupplyName::select() { recordSelection(); diff --git a/unotools/source/ucbhelper/ucblockbytes.cxx b/unotools/source/ucbhelper/ucblockbytes.cxx index f6cc30e0b49f..e56c058c1b69 100644 --- a/unotools/source/ucbhelper/ucblockbytes.cxx +++ b/unotools/source/ucbhelper/ucblockbytes.cxx @@ -750,8 +750,7 @@ static bool UCBOpenContentSync( rtl::Reference< ucbhelper::InteractionContinuation > ref = xIR->getSelection(); if(ref.is()) { - Reference xInt(ref); - xRet.set(xInt,UNO_QUERY); + xRet.set(ref->getXWeak(), UNO_QUERY); } } diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index 420024cc2ab2..c410b94fddd5 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -511,6 +511,7 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\ vcl/source/pdf/EncryptionHashTransporter \ vcl/source/pdf/ExternalPDFStreams \ vcl/source/pdf/PDFiumTools \ + vcl/source/pdf/PDFEncryptionInitialization \ vcl/source/pdf/PDFEncryptor \ vcl/source/pdf/PDFEncryptorR6 \ vcl/source/pdf/PdfConfig \ diff --git a/vcl/headless/svpinst.cxx b/vcl/headless/svpinst.cxx index 0b65626947aa..54ac078f83f0 100644 --- a/vcl/headless/svpinst.cxx +++ b/vcl/headless/svpinst.cxx @@ -288,7 +288,7 @@ static void loop(void * arg) { } bool SvpSalInstance::DoExecute(int &) { - assert(Application::IsOnSystemEventLoop()); + assert(Application::IsUseSystemEventLoop()); // emscripten_set_main_loop will unwind the stack by throwing a JavaScript exception, so we need // to manually undo the call of AcquireYieldMutex() done in InitVCL: ReleaseYieldMutex(false); @@ -299,7 +299,7 @@ bool SvpSalInstance::DoExecute(int &) { } void SvpSalInstance::DoQuit() { - assert(Application::IsOnSystemEventLoop()); + assert(Application::IsUseSystemEventLoop()); } #endif diff --git a/vcl/inc/driverblocklist.hxx b/vcl/inc/driverblocklist.hxx index f3fc81c6642d..4b3bc9cd502e 100644 --- a/vcl/inc/driverblocklist.hxx +++ b/vcl/inc/driverblocklist.hxx @@ -58,10 +58,7 @@ enum OperatingSystem { DRIVER_OS_UNKNOWN = 0, DRIVER_OS_WINDOWS_FIRST, - DRIVER_OS_WINDOWS_7 = DRIVER_OS_WINDOWS_FIRST, - DRIVER_OS_WINDOWS_8, - DRIVER_OS_WINDOWS_8_1, - DRIVER_OS_WINDOWS_10, + DRIVER_OS_WINDOWS_10 = DRIVER_OS_WINDOWS_FIRST, DRIVER_OS_WINDOWS_LAST = DRIVER_OS_WINDOWS_10, DRIVER_OS_WINDOWS_ALL, DRIVER_OS_LINUX, diff --git a/vcl/inc/pdf/PDFEncryptor.hxx b/vcl/inc/pdf/PDFEncryptor.hxx index be4b99f9b7d6..e4134605c194 100644 --- a/vcl/inc/pdf/PDFEncryptor.hxx +++ b/vcl/inc/pdf/PDFEncryptor.hxx @@ -20,10 +20,6 @@ namespace vcl struct PDFEncryptionProperties; } -namespace com::sun::star::beans -{ -class XMaterialHolder; -} namespace com::sun::star::uno { template class Reference; @@ -31,6 +27,8 @@ template class Reference; namespace vcl::pdf { +class EncryptionHashTransporter; + class PDFEncryptor : public IPDFEncryptor { private: @@ -60,10 +58,10 @@ public: sal_Int32 getKeyLength() override { return m_nKeyLength; } sal_Int32 getRC4KeyLength() { return m_nRC4KeyLength; } - static css::uno::Reference - initEncryption(const OUString& i_rOwnerPassword, const OUString& i_rUserPassword); + static void initEncryption(EncryptionHashTransporter& rEncryptionHashTransporter, + const OUString& i_rOwnerPassword, const OUString& i_rUserPassword); - virtual bool prepareEncryption( + bool prepareEncryption( const css::uno::Reference& xEncryptionMaterialHolder, PDFEncryptionProperties& rProperties) override; diff --git a/vcl/inc/pdf/pdfwriter_impl.hxx b/vcl/inc/pdf/pdfwriter_impl.hxx index 3f09038068b8..4b7b72dce4fc 100644 --- a/vcl/inc/pdf/pdfwriter_impl.hxx +++ b/vcl/inc/pdf/pdfwriter_impl.hxx @@ -34,7 +34,6 @@ #include #include #include -#include #include #include @@ -684,6 +683,8 @@ struct PDFDocumentAttachedFile sal_Int32 mnObjectId; }; +class IPDFEncryptor; + } // end pdf namespace class PDFWriterImpl final : public VirtualDevice, public PDFObjectContainer diff --git a/vcl/inc/qt5/QtInstanceTreeView.hxx b/vcl/inc/qt5/QtInstanceTreeView.hxx index dd252c3e2b47..1e8ebbec2d21 100644 --- a/vcl/inc/qt5/QtInstanceTreeView.hxx +++ b/vcl/inc/qt5/QtInstanceTreeView.hxx @@ -42,9 +42,9 @@ public: virtual int get_selected_index() const override; virtual void select(int nPos) override; virtual void unselect(int nPos) override; - virtual void remove(int pos) override; + virtual void remove(int nPos) override; virtual OUString get_text(int nRow, int nCol = -1) const override; - virtual void set_text(int row, const OUString& rText, int col = -1) override; + virtual void set_text(int nRow, const OUString& rText, int nCol = -1) override; virtual void set_sensitive(int row, bool bSensitive, int col = -1) override; virtual bool get_sensitive(int row, int col) const override; virtual void set_id(int row, const OUString& rId) override; @@ -185,11 +185,14 @@ public: using QtInstanceWidget::get_sensitive; private: + QModelIndex modelIndex(int nPos) const; + static QModelIndex modelIndex(const weld::TreeIter& rIter); + OUString get_id(const QModelIndex& rModelIndex) const; static QAbstractItemView::SelectionMode mapSelectionMode(SelectionMode eMode); private Q_SLOTS: void handleActivated(); - void handleCurrentChanged(); + void handleSelectionChanged(); }; /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx index c183b7fdb57c..1f8e6ea02e52 100644 --- a/vcl/inc/salvtables.hxx +++ b/vcl/inc/salvtables.hxx @@ -1161,7 +1161,8 @@ class SalInstanceNotebook : public SalInstanceWidget, public virtual weld::Noteb { private: VclPtr m_xNotebook; - mutable std::vector> m_aPages; + /// Constructed on-demand. + mutable std::map> m_aPages; std::map, VclPtr>> m_aAddedPages; DECL_LINK(DeactivatePageHdl, TabControl*, bool); @@ -2298,7 +2299,8 @@ class SalInstanceVerticalNotebook : public SalInstanceWidget, public virtual wel { private: VclPtr m_xNotebook; - mutable std::vector> m_aPages; + /// Constructed on-demand. + mutable std::map> m_aPages; DECL_LINK(DeactivatePageHdl, VerticalTabControl*, bool); DECL_LINK(ActivatePageHdl, VerticalTabControl*, void); diff --git a/vcl/inc/win/salinst.h b/vcl/inc/win/salinst.h index 8bff74b865d5..cc02c8bad4a2 100644 --- a/vcl/inc/win/salinst.h +++ b/vcl/inc/win/salinst.h @@ -28,13 +28,6 @@ class SalYieldMutex; -struct WinOSVersionInfo -{ - DWORD m_nMajorVersion = 0; - DWORD m_nMinorVersion = 0; - DWORD m_nBuildNumber = 0; -}; - class WinSalInstance : public SalInstance { public: @@ -80,7 +73,7 @@ public: virtual OUString GetConnectionIdentifier() override; virtual void AddToRecentDocumentList(const OUString& rFileUrl, const OUString& rMimeType, const OUString& rDocumentService) override; - static WinOSVersionInfo getWinOSVersionInfo(); + static DWORD getWindowsBuildNumber(); virtual OUString getOSVersion() override; virtual void BeforeAbort(const OUString&, bool) override; diff --git a/vcl/qa/cppunit/blocklistparsertest.cxx b/vcl/qa/cppunit/blocklistparsertest.cxx index 1cef4dfbfbc7..d0592f33c975 100644 --- a/vcl/qa/cppunit/blocklistparsertest.cxx +++ b/vcl/qa/cppunit/blocklistparsertest.cxx @@ -108,10 +108,6 @@ void BlocklistParserTest::testEvaluate() OUString vendorMicrosoft = GetVendorId(VendorMicrosoft); // Check OS - CPPUNIT_ASSERT_EQUAL(false, FindBlocklistedDeviceInList( - aDriveInfos, VersionType::OpenGL, u"10.20.30.40", vendorNVIDIA, u"all"_ustr, DRIVER_OS_WINDOWS_7)); - CPPUNIT_ASSERT_EQUAL(false, FindBlocklistedDeviceInList( - aDriveInfos, VersionType::OpenGL, u"10.20.30.40", vendorNVIDIA, u"all"_ustr, DRIVER_OS_WINDOWS_8)); CPPUNIT_ASSERT_EQUAL(false, FindBlocklistedDeviceInList( aDriveInfos, VersionType::OpenGL, u"10.20.30.40", vendorNVIDIA, u"all"_ustr, DRIVER_OS_WINDOWS_10)); @@ -126,22 +122,20 @@ void BlocklistParserTest::testEvaluate() aDriveInfos, VersionType::OpenGL, u"10.20.30.50", vendorMicrosoft, u"all"_ustr, DRIVER_OS_OSX_10_8)); // Check Vendors - CPPUNIT_ASSERT_EQUAL(true, FindBlocklistedDeviceInList( - aDriveInfos, VersionType::OpenGL, u"10.20.30.40", vendorMicrosoft, u"all"_ustr, DRIVER_OS_WINDOWS_7)); CPPUNIT_ASSERT_EQUAL(true, FindBlocklistedDeviceInList( aDriveInfos, VersionType::OpenGL, u"10.20.30.40", vendorMicrosoft, u"all"_ustr, DRIVER_OS_WINDOWS_10)); // Check Versions CPPUNIT_ASSERT_EQUAL(true, FindBlocklistedDeviceInList( - aDriveInfos, VersionType::OpenGL, u"10.20.30.39", vendorAMD, u"all"_ustr, DRIVER_OS_WINDOWS_7)); + aDriveInfos, VersionType::OpenGL, u"10.20.30.39", vendorAMD, u"all"_ustr, DRIVER_OS_WINDOWS_10)); CPPUNIT_ASSERT_EQUAL(false, FindBlocklistedDeviceInList( - aDriveInfos, VersionType::OpenGL, u"10.20.30.40", vendorAMD, u"all"_ustr, DRIVER_OS_WINDOWS_7)); + aDriveInfos, VersionType::OpenGL, u"10.20.30.40", vendorAMD, u"all"_ustr, DRIVER_OS_WINDOWS_10)); CPPUNIT_ASSERT_EQUAL(false, FindBlocklistedDeviceInList( - aDriveInfos, VersionType::OpenGL, u"10.20.30.41", vendorAMD, u"all"_ustr, DRIVER_OS_WINDOWS_7)); + aDriveInfos, VersionType::OpenGL, u"10.20.30.41", vendorAMD, u"all"_ustr, DRIVER_OS_WINDOWS_10)); // Check CPPUNIT_ASSERT_EQUAL(true, FindBlocklistedDeviceInList( - aDriveInfos, VersionType::OpenGL, u"9.17.10.4229", vendorIntel, u"all"_ustr, DRIVER_OS_WINDOWS_7)); + aDriveInfos, VersionType::OpenGL, u"9.17.10.4229", vendorIntel, u"all"_ustr, DRIVER_OS_WINDOWS_10)); } diff --git a/vcl/qa/cppunit/pdfexport/data/tdf164106.fodt b/vcl/qa/cppunit/pdfexport/data/tdf164106.fodt new file mode 100644 index 000000000000..6d3866b43af0 --- /dev/null +++ b/vcl/qa/cppunit/pdfexport/data/tdf164106.fodt @@ -0,0 +1,133 @@ + + + 2024-11-30T17:13:03your servanten-US2024-12-05T06:45:52.6504006386PT4M37SLibreOfficeDev/25.8.0.0.alpha0$Linux_X86_64 LibreOffice_project/5f4d5a012865d717040012eb0f698a725b82d4cc15.0000 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + वीथीर्भजनमार्गान् + वीथीर्भजनमार्गान् + + + diff --git a/vcl/qa/cppunit/pdfexport/pdfexport2.cxx b/vcl/qa/cppunit/pdfexport/pdfexport2.cxx index 3e36171f4ba0..20acdc856aeb 100644 --- a/vcl/qa/cppunit/pdfexport/pdfexport2.cxx +++ b/vcl/qa/cppunit/pdfexport/pdfexport2.cxx @@ -6077,6 +6077,55 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest2, testTdf162750SmallCapsLigature) CPPUNIT_ASSERT_EQUAL(u"FI"_ustr, aText.at(2).trim()); } +CPPUNIT_TEST_FIXTURE(PdfExportTest2, testTdf164106SplitReorderedClusters) +{ + saveAsPDF(u"tdf164106.fodt"); + + auto pPdfDocument = parsePDFExport(); + CPPUNIT_ASSERT_EQUAL(1, pPdfDocument->getPageCount()); + + auto pPdfPage = pPdfDocument->openPage(/*nIndex*/ 0); + CPPUNIT_ASSERT(pPdfPage); + auto pTextPage = pPdfPage->getTextPage(); + CPPUNIT_ASSERT(pTextPage); + + int nPageObjectCount = pPdfPage->getObjectCount(); + + CPPUNIT_ASSERT_EQUAL(14, nPageObjectCount); + + std::vector aText; + std::vector aRect; + + for (int i = 0; i < nPageObjectCount; ++i) + { + auto pPageObject = pPdfPage->getObject(i); + CPPUNIT_ASSERT_MESSAGE("no object", pPageObject != nullptr); + if (pPageObject->getType() == vcl::pdf::PDFPageObjectType::Text) + { + aText.push_back(pPageObject->getText(pTextPage)); + aRect.push_back(pPageObject->getBounds()); + } + } + + CPPUNIT_ASSERT_EQUAL(size_t(14), aText.size()); + + auto fnCompareIndices = [&](size_t nSplit, size_t nCombined) { + CPPUNIT_ASSERT_EQUAL(aText.at(nSplit).trim(), aText.at(nCombined).trim()); + CPPUNIT_ASSERT_DOUBLES_EQUAL(aRect.at(nSplit).getMinX(), aRect.at(nCombined).getMinX(), + /*delta*/ 0.2); + CPPUNIT_ASSERT_DOUBLES_EQUAL(aRect.at(nSplit).getMaxX(), aRect.at(nCombined).getMaxX(), + /*delta*/ 0.2); + }; + + fnCompareIndices(0, 7); + fnCompareIndices(1, 8); + fnCompareIndices(2, 9); + fnCompareIndices(3, 10); + fnCompareIndices(4, 11); + fnCompareIndices(5, 12); + fnCompareIndices(6, 13); +} + } // end anonymous namespace CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/vcl/qa/cppunit/test_blocklist_parse.xml b/vcl/qa/cppunit/test_blocklist_parse.xml index 9a0f6acc574f..9f0fc496ef4c 100644 --- a/vcl/qa/cppunit/test_blocklist_parse.xml +++ b/vcl/qa/cppunit/test_blocklist_parse.xml @@ -12,16 +12,16 @@ - + - + - + - + @@ -38,16 +38,16 @@ - + - + - + - + diff --git a/vcl/qa/cppunit/test_blocklist_vulkan.xml b/vcl/qa/cppunit/test_blocklist_vulkan.xml index 9542ee5f22a5..4503bfcfb28e 100644 --- a/vcl/qa/cppunit/test_blocklist_vulkan.xml +++ b/vcl/qa/cppunit/test_blocklist_vulkan.xml @@ -9,7 +9,7 @@ In this case we // mention that it is a CJK font - for(size_t i = 0; i < rFontName.size(); i++) + for (const sal_Unicode& ch : rFontName) { - const sal_Unicode ch = rFontName[i]; // japanese if ( ((ch >= 0x3040) && (ch <= 0x30FF)) || ((ch >= 0x3190) && (ch <= 0x319F)) ) diff --git a/vcl/source/gdi/CommonSalLayout.cxx b/vcl/source/gdi/CommonSalLayout.cxx index 732c799e003b..b40851a2f18c 100644 --- a/vcl/source/gdi/CommonSalLayout.cxx +++ b/vcl/source/gdi/CommonSalLayout.cxx @@ -151,6 +151,14 @@ public: return nClusterId; } + void Reset() + { + for (auto& rElement : m_aGlyphs) + { + rElement.second.m_bUsed = false; + } + } + void ShapeSubRun(const sal_Unicode* pStr, const int nLength, const SubRun& aSubRun, hb_font_t* pHbFont, const std::vector& maFeatures, hb_language_t oHbLanguage) @@ -598,6 +606,73 @@ bool GenericSalLayout::LayoutText(vcl::text::ImplLayoutArgs& rArgs, const SalLay hb_glyph_info_t *pHbGlyphInfos = hb_buffer_get_glyph_infos(pHbBuffer, nullptr); hb_glyph_position_t *pHbPositions = hb_buffer_get_glyph_positions(pHbBuffer, nullptr); + // tdf#164106: Grapheme clusters can be split across multiple layouts. To do this, + // the complete string is laid out, and only the necessary glyphs are extracted. + // These sub-layouts are positioned side-by-side to form the complete text. + // This approach is good enough for most diacritic cases, but it cannot handle cases + // where a glyph with an advance is reordered into a different sub-layout. + bool bStartClusterOutOfOrder = false; + bool bEndClusterOutOfOrder = false; + { + double nNormalAdvance = 0.0; + double nStartAdvance = 0.0; + double nEndAdvance = 0.0; + + auto fnHandleGlyph = [&](int i) + { + int32_t nGlyphIndex = pHbGlyphInfos[i].codepoint; + int32_t nCluster = pHbGlyphInfos[i].cluster; + auto nOrigCharPos = stClusterMapper.RemapGlyph(nCluster, nGlyphIndex); + + double nAdvance = 0.0; + if (aSubRun.maDirection == HB_DIRECTION_TTB) + { + nAdvance = -pHbPositions[i].y_advance; + } + else + { + nAdvance = pHbPositions[i].x_advance; + } + + nNormalAdvance += nAdvance; + + if (nOrigCharPos < rArgs.mnDrawMinCharPos) + { + nStartAdvance += nAdvance; + if (nStartAdvance != nNormalAdvance) + { + bStartClusterOutOfOrder = true; + } + } + + if (nOrigCharPos < rArgs.mnDrawEndCharPos) + { + nEndAdvance += nAdvance; + if (nEndAdvance != nNormalAdvance) + { + bEndClusterOutOfOrder = true; + } + } + }; + + if (bRightToLeft) + { + for (int i = nRunGlyphCount - 1; i >= 0; --i) + { + fnHandleGlyph(i); + } + } + else + { + for (int i = 0; i < nRunGlyphCount; ++i) + { + fnHandleGlyph(i); + } + } + + stClusterMapper.Reset(); + } + for (int i = 0; i < nRunGlyphCount; ++i) { int32_t nGlyphIndex = pHbGlyphInfos[i].codepoint; int32_t nCharPos = pHbGlyphInfos[i].cluster; @@ -740,14 +815,15 @@ bool GenericSalLayout::LayoutText(vcl::text::ImplLayoutArgs& rArgs, const SalLay const GlyphItem aGI(nCharPos, nCharCount, nGlyphIndex, aNewPos, nGlyphFlags, nAdvance, nXOffset, nYOffset, nOrigCharPos); - if (aGI.origCharPos() >= rArgs.mnDrawMinCharPos - && aGI.origCharPos() < rArgs.mnDrawEndCharPos) + auto nLowerBound = (bStartClusterOutOfOrder ? aGI.charPos() : aGI.origCharPos()); + auto nUpperBound = (bEndClusterOutOfOrder ? aGI.charPos() : aGI.origCharPos()); + if (nLowerBound >= rArgs.mnDrawMinCharPos && nUpperBound < rArgs.mnDrawEndCharPos) { m_GlyphItems.push_back(aGI); } - if (aGI.origCharPos() >= rArgs.mnDrawOriginCluster - && aGI.origCharPos() < rArgs.mnDrawEndCharPos) + if (nLowerBound >= rArgs.mnDrawOriginCluster + && nUpperBound < rArgs.mnDrawEndCharPos) { nCurrX += nAdvance; } diff --git a/vcl/source/gdi/pdfwriter.cxx b/vcl/source/gdi/pdfwriter.cxx index ee762e2fca47..ca91054c53de 100644 --- a/vcl/source/gdi/pdfwriter.cxx +++ b/vcl/source/gdi/pdfwriter.cxx @@ -20,6 +20,7 @@ #include #include +#include using namespace vcl; @@ -471,7 +472,7 @@ std::set< PDFWriter::ErrorCode > const & PDFWriter::GetErrors() const css::uno::Reference< css::beans::XMaterialHolder > PDFWriter::InitEncryption(const OUString& i_rOwnerPassword, const OUString& i_rUserPassword) { - return PDFEncryptor::initEncryption(i_rOwnerPassword, i_rUserPassword); + return vcl::pdf::initEncryption(i_rOwnerPassword, i_rUserPassword); } void PDFWriter::PlayMetafile( const GDIMetaFile& i_rMTF, const vcl::PDFWriter::PlayMetafileContext& i_rPlayContext, PDFExtOutDevData* i_pData ) diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index f41309685cc1..91eb3a1e078c 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -96,6 +96,8 @@ #include #include #include +#include +#include #include #include #include @@ -1461,7 +1463,7 @@ PDFWriterImpl::PDFWriterImpl( const PDFWriter::PDFWriterContext& rContext, m_pPDFEncryptor->prepareEncryption(xEncryptionMaterialHolder, m_aContext.Encryption); } - if (m_pPDFEncryptor && m_aContext.Encryption.Encrypt()) + if (m_pPDFEncryptor && m_aContext.Encryption.canEncrypt()) { m_pPDFEncryptor->setupKeysAndCheck(m_aContext.Encryption); } @@ -1597,7 +1599,7 @@ append the string as unicode hex, encrypted if needed inline void PDFWriterImpl::appendUnicodeTextStringEncrypt( const OUString& rInString, const sal_Int32 nInObjectNumber, OStringBuffer& rOutBuffer ) { rOutBuffer.append( "<" ); - if (m_aContext.Encryption.Encrypt()) + if (m_aContext.Encryption.canEncrypt()) { const sal_Unicode* pStr = rInString.getStr(); sal_Int32 nLen = rInString.getLength(); @@ -1631,7 +1633,7 @@ inline void PDFWriterImpl::appendLiteralStringEncrypt( std::string_view rInStrin rOutBuffer.append( "(" ); sal_Int32 nChars = rInString.size(); //check for encryption, if ok, encrypt the string, then convert with appndLiteralString - if (m_aContext.Encryption.Encrypt()) + if (m_aContext.Encryption.canEncrypt()) { m_vEncryptionBuffer.resize(nChars); //encrypt the string in a buffer, then append it @@ -6184,7 +6186,7 @@ bool PDFWriterImpl::emitTrailer() sal_Int32 nSecObject = 0; - if( m_aContext.Encryption.Encrypt() ) + if (m_aContext.Encryption.canEncrypt()) { nSecObject = emitEncrypt(); } @@ -9806,7 +9808,7 @@ bool PDFWriterImpl::writeBitmapObject( const BitmapEmit& rObject, bool bMask ) aLine.append( "[ /Indexed/DeviceRGB " ); aLine.append( static_cast(pAccess->GetPaletteEntryCount()-1) ); aLine.append( "\n<" ); - if( m_aContext.Encryption.Encrypt() ) + if (m_aContext.Encryption.canEncrypt()) { enableStringEncryption(rObject.m_nObject); //check encryption buffer size diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx index 3efc67a32b61..2f06a292c936 100644 --- a/vcl/source/gdi/pdfwriter_impl2.cxx +++ b/vcl/source/gdi/pdfwriter_impl2.cxx @@ -25,6 +25,7 @@ #include #include #include +#include #include @@ -1079,7 +1080,7 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa void PDFWriterImpl::checkAndEnableStreamEncryption(sal_Int32 nObject) { - if (!m_aContext.Encryption.Encrypt() || !m_pPDFEncryptor) + if (!m_aContext.Encryption.canEncrypt() || !m_pPDFEncryptor) return; m_pPDFEncryptor->enableStreamEncryption(); @@ -1094,7 +1095,7 @@ void PDFWriterImpl::disableStreamEncryption() void PDFWriterImpl::enableStringEncryption(sal_Int32 nObject) { - if (!m_aContext.Encryption.Encrypt() || !m_pPDFEncryptor) + if (!m_aContext.Encryption.canEncrypt() || !m_pPDFEncryptor) return; m_pPDFEncryptor->setupEncryption(m_aContext.Encryption.EncryptionKey, nObject); diff --git a/vcl/source/helper/driverblocklist.cxx b/vcl/source/helper/driverblocklist.cxx index bb87927c8763..03e3bc52e2af 100644 --- a/vcl/source/helper/driverblocklist.cxx +++ b/vcl/source/helper/driverblocklist.cxx @@ -28,12 +28,6 @@ static OperatingSystem getOperatingSystem(std::string_view rString) { if (rString == "all") return DRIVER_OS_ALL; - else if (rString == "7") - return DRIVER_OS_WINDOWS_7; - else if (rString == "8") - return DRIVER_OS_WINDOWS_8; - else if (rString == "8_1") - return DRIVER_OS_WINDOWS_8_1; else if (rString == "10") return DRIVER_OS_WINDOWS_10; else if (rString == "windows") @@ -537,12 +531,6 @@ static OperatingSystem getOperatingSystem() // based on http://msdn.microsoft.com/en-us/library/ms724834(VS.85).aspx switch (DriverBlocklist::GetWindowsVersion()) { - case 0x00060001: - return DRIVER_OS_WINDOWS_7; - case 0x00060002: - return DRIVER_OS_WINDOWS_8; - case 0x00060003: - return DRIVER_OS_WINDOWS_8_1; case 0x000A0000: // Major 10 Minor 0 return DRIVER_OS_WINDOWS_10; default: diff --git a/vcl/source/pdf/PDFEncryptionInitialization.cxx b/vcl/source/pdf/PDFEncryptionInitialization.cxx new file mode 100644 index 000000000000..df06968fc290 --- /dev/null +++ b/vcl/source/pdf/PDFEncryptionInitialization.cxx @@ -0,0 +1,32 @@ +/* -*- 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 +#include +#include +#include +#include +#include + +using namespace css; + +namespace vcl::pdf +{ +css::uno::Reference initEncryption(const OUString& i_rOwnerPassword, + const OUString& i_rUserPassword) +{ + rtl::Reference pTransporter = new EncryptionHashTransporter; + PDFEncryptor::initEncryption(*pTransporter, i_rOwnerPassword, i_rUserPassword); + return pTransporter; +} + +} // end vcl::pdf + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/pdf/PDFEncryptor.cxx b/vcl/source/pdf/PDFEncryptor.cxx index d97e671247de..63bb49c05425 100644 --- a/vcl/source/pdf/PDFEncryptor.cxx +++ b/vcl/source/pdf/PDFEncryptor.cxx @@ -327,32 +327,26 @@ PDFEncryptor::~PDFEncryptor() { rtl_cipher_destroyARCFOUR(m_aCipher); } 1. init the document id, used both for building the document id and for building the encryption key(s) 2. build the encryption key following algorithms described in the PDF specification */ -uno::Reference -PDFEncryptor::initEncryption(const OUString& i_rOwnerPassword, const OUString& i_rUserPassword) +void PDFEncryptor::initEncryption(EncryptionHashTransporter& rEncryptionHashTransporter, + const OUString& i_rOwnerPassword, const OUString& i_rUserPassword) { - uno::Reference xResult; if (!i_rOwnerPassword.isEmpty() || !i_rUserPassword.isEmpty()) { - rtl::Reference pTransporter = new EncryptionHashTransporter; - xResult = pTransporter; - // get padded passwords sal_uInt8 aPadUPW[ENCRYPTED_PWD_SIZE], aPadOPW[ENCRYPTED_PWD_SIZE]; padPassword(i_rOwnerPassword.isEmpty() ? i_rUserPassword : i_rOwnerPassword, aPadOPW); padPassword(i_rUserPassword, aPadUPW); - if (computeODictionaryValue(aPadOPW, aPadUPW, pTransporter->getOValue(), SECUR_128BIT_KEY)) + if (computeODictionaryValue(aPadOPW, aPadUPW, rEncryptionHashTransporter.getOValue(), + SECUR_128BIT_KEY)) { - pTransporter->getUDigest()->update(aPadUPW, ENCRYPTED_PWD_SIZE); + rEncryptionHashTransporter.getUDigest()->update(aPadUPW, ENCRYPTED_PWD_SIZE); } - else - xResult.clear(); // trash temporary padded cleartext PWDs rtl_secureZeroMemory(aPadOPW, sizeof(aPadOPW)); rtl_secureZeroMemory(aPadUPW, sizeof(aPadUPW)); } - return xResult; } bool PDFEncryptor::prepareEncryption( @@ -375,9 +369,7 @@ bool PDFEncryptor::prepareEncryption( if (!bSuccess) { - rProperties.OValue.clear(); - rProperties.UValue.clear(); - rProperties.EncryptionKey.clear(); + rProperties.clear(); } return bSuccess; } @@ -392,8 +384,7 @@ void PDFEncryptor::setupKeysAndCheck(vcl::PDFEncryptionProperties& rProperties) { // the field lengths are invalid ? This was not setup by initEncryption. // do not encrypt after all - rProperties.OValue.clear(); - rProperties.UValue.clear(); + rProperties.clear(); OSL_ENSURE(false, "encryption data failed sanity check, encryption disabled"); } else // setup key lengths diff --git a/vcl/source/treelist/headbar.cxx b/vcl/source/treelist/headbar.cxx index 2e34f15439b1..e8588b0371c6 100644 --- a/vcl/source/treelist/headbar.cxx +++ b/vcl/source/treelist/headbar.cxx @@ -1069,13 +1069,7 @@ void HeaderBar::RemoveItem( sal_uInt16 nItemId ) { sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != HEADERBAR_ITEM_NOTFOUND ) - { - if ( nPos < mvItemList.size() ) { - auto it = mvItemList.begin(); - it += nPos; - mvItemList.erase( it ); - } - } + mvItemList.erase( mvItemList.begin() + nPos ); } void HeaderBar::MoveItem( sal_uInt16 nItemId, sal_uInt16 nNewPos ) diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index e181acf7ed21..66924872b649 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -384,7 +384,7 @@ namespace weld : m_xEntry(std::move(xEntry)) , m_xTreeView(std::move(xTreeView)) { - m_xTreeView->connect_changed(LINK(this, EntryTreeView, ClickHdl)); + m_xTreeView->connect_selection_changed(LINK(this, EntryTreeView, ClickHdl)); m_xEntry->connect_changed(LINK(this, EntryTreeView, ModifyHdl)); } @@ -1007,11 +1007,6 @@ namespace return f; } - OUString extractTitle(VclBuilder::stringmap &rMap) - { - return extractStringEntry(rMap, u"title"_ustr); - } - bool extractSortIndicator(VclBuilder::stringmap &rMap) { return extractBoolEntry(rMap, u"sort-indicator"_ustr, false); @@ -3411,6 +3406,11 @@ bool BuilderBase::extractShowExpanders(VclBuilder::stringmap& rMap) return extractBoolEntry(rMap, u"show-expanders"_ustr, true); } +OUString BuilderBase::extractTitle(VclBuilder::stringmap &rMap) +{ + return extractStringEntry(rMap, u"title"_ustr); +} + OUString BuilderBase::extractTooltipText(stringmap& rMap) { OUString sTooltipText; diff --git a/vcl/source/window/menuitemlist.cxx b/vcl/source/window/menuitemlist.cxx index d6849e3e71a2..9a196a6723bb 100644 --- a/vcl/source/window/menuitemlist.cxx +++ b/vcl/source/window/menuitemlist.cxx @@ -138,10 +138,7 @@ void MenuItemList::InsertSeparator(const OUString &rIdent, size_t nPos) void MenuItemList::Remove( size_t nPos ) { - if( nPos < maItemList.size() ) - { - maItemList.erase( maItemList.begin() + nPos ); - } + maItemList.erase( maItemList.begin() + nPos ); } void MenuItemList::Clear() diff --git a/vcl/unx/generic/print/prtsetup.cxx b/vcl/unx/generic/print/prtsetup.cxx index 6869dcecd919..630debb88444 100644 --- a/vcl/unx/generic/print/prtsetup.cxx +++ b/vcl/unx/generic/print/prtsetup.cxx @@ -280,8 +280,8 @@ RTSDevicePage::RTSDevicePage(weld::Widget* pPage, RTSDialog* pParent) m_xCustomEdit->connect_changed(LINK(this, RTSDevicePage, ModifyHdl)); - m_xPPDKeyBox->connect_changed( LINK( this, RTSDevicePage, SelectHdl ) ); - m_xPPDValueBox->connect_changed( LINK( this, RTSDevicePage, SelectHdl ) ); + m_xPPDKeyBox->connect_selection_changed(LINK(this, RTSDevicePage, SelectHdl)); + m_xPPDValueBox->connect_selection_changed(LINK(this, RTSDevicePage, SelectHdl)); m_xSpaceBox->connect_changed(LINK(this, RTSDevicePage, ComboChangedHdl)); m_xDepthBox->connect_changed(LINK(this, RTSDevicePage, ComboChangedHdl)); diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx index 13d33a19a30a..729d4dcc93ac 100644 --- a/vcl/unx/gtk3/gtkinst.cxx +++ b/vcl/unx/gtk3/gtkinst.cxx @@ -14205,9 +14205,9 @@ private: GtkAdjustment* m_pVAdjustment; ImplSVEvent* m_pChangeEvent; - DECL_LINK(async_signal_changed, void*, void); + DECL_LINK(async_signal_selection_changed, void*, void); - void launch_signal_changed() + void launch_signal_selection_changed() { //tdf#117991 selection change is sent before the focus change, and focus change //is what will cause a spinbutton that currently has the focus to set its contents @@ -14227,13 +14227,13 @@ private: //TODO maybe iterate over gtk_widget_observe_controllers looking for a motion controller #endif - m_pChangeEvent = Application::PostUserEvent(LINK(this, GtkInstanceTreeView, async_signal_changed)); + m_pChangeEvent = Application::PostUserEvent(LINK(this, GtkInstanceTreeView, async_signal_selection_changed)); } - static void signalChanged(GtkTreeView*, gpointer widget) + static void signalSelectionChanged(GtkTreeView*, gpointer widget) { GtkInstanceTreeView* pThis = static_cast(widget); - pThis->launch_signal_changed(); + pThis->launch_signal_selection_changed(); } void handle_row_activated() @@ -14946,7 +14946,7 @@ public: , m_nExpanderImageCol(-1) , m_nPendingVAdjustment(-1) , m_nChangedSignalId(g_signal_connect(gtk_tree_view_get_selection(pTreeView), "changed", - G_CALLBACK(signalChanged), this)) + G_CALLBACK(signalSelectionChanged), this)) , m_nRowActivatedSignalId(g_signal_connect(pTreeView, "row-activated", G_CALLBACK(signalRowActivated), this)) , m_nTestExpandRowSignalId(g_signal_connect(pTreeView, "test-expand-row", G_CALLBACK(signalTestExpandRow), this)) , m_nTestCollapseRowSignalId(g_signal_connect(pTreeView, "test-collapse-row", G_CALLBACK(signalTestCollapseRow), this)) @@ -16964,10 +16964,10 @@ public: } -IMPL_LINK_NOARG(GtkInstanceTreeView, async_signal_changed, void*, void) +IMPL_LINK_NOARG(GtkInstanceTreeView, async_signal_selection_changed, void*, void) { m_pChangeEvent = nullptr; - signal_changed(); + signal_selection_changed(); m_bChangedByMouse = false; } diff --git a/vcl/win/app/fileregistration.cxx b/vcl/win/app/fileregistration.cxx index ec7ccbcee2aa..9e72e5bf03a0 100644 --- a/vcl/win/app/fileregistration.cxx +++ b/vcl/win/app/fileregistration.cxx @@ -7,10 +7,6 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#if !defined(NTDDI_VERSION) || NTDDI_VERSION < NTDDI_WIN8 -#define NTDDI_VERSION NTDDI_WIN8 // needed for IApplicationActivationManager -#endif - #include #include diff --git a/vcl/win/app/salinst.cxx b/vcl/win/app/salinst.cxx index 8ef06b692457..3dad25b4da62 100644 --- a/vcl/win/app/salinst.cxx +++ b/vcl/win/app/salinst.cxx @@ -311,30 +311,7 @@ SalData::~SalData() bool OSSupportsDarkMode() { - bool bRet = false; - if (HMODULE h_ntdll = GetModuleHandleW(L"ntdll.dll")) - { - typedef LONG(WINAPI* RtlGetVersion_t)(PRTL_OSVERSIONINFOW); - if (auto RtlGetVersion - = reinterpret_cast(GetProcAddress(h_ntdll, "RtlGetVersion"))) - { - RTL_OSVERSIONINFOW vi2{}; - vi2.dwOSVersionInfoSize = sizeof(vi2); - if (RtlGetVersion(&vi2) == 0) - { - if (vi2.dwMajorVersion > 10) - bRet = true; - else if (vi2.dwMajorVersion == 10) - { - if (vi2.dwMinorVersion > 0) - bRet = true; - else if (vi2.dwBuildNumber >= 18362) - bRet = true; - } - } - } - } - return bRet; + return WinSalInstance::getWindowsBuildNumber() >= 18362; } namespace { @@ -1045,84 +1022,30 @@ static OUString getWinArch() } } -static OUString getOSVersionString(DWORD nMajorVersion, DWORD nMinorVersion, DWORD nBuildNumber) +static OUString getOSVersionString(DWORD nBuildNumber) { OUStringBuffer result = u"Windows"; - if (nMajorVersion == 6 && nMinorVersion == 1) - result.append(" 7 Service Pack 1"); - else if (nMajorVersion == 6 && nMinorVersion == 2) - result.append(" 8"); - else if (nMajorVersion == 6 && nMinorVersion == 3) - result.append(" 8.1"); - else if (nMajorVersion == 10 && nMinorVersion == 0) - { - if (nBuildNumber >= 22000) - result.append(" 11"); - else - result.append(" 10"); - } + if (nBuildNumber >= 22000) + result.append(" 11"); + else if (nBuildNumber > 0) + result.append(" 10"); else // We don't know what Windows it is result.append(" unknown"); result.append(getWinArch()); - if (nMajorVersion || nMinorVersion || nBuildNumber) - { - result.append(" ("); - if (nMajorVersion || nMinorVersion) - { - result.append(OUString::number(nMajorVersion) + u"." + OUString::number(nMinorVersion)); - if (nBuildNumber) - result.append(" "); - } - if (nBuildNumber) - result.append("build " + OUString::number(nBuildNumber)); - result.append(")"); - } + if (nBuildNumber) + result.append(" (build " + OUString::number(nBuildNumber) + ")"); return result.makeStringAndClear(); } -WinOSVersionInfo WinSalInstance::getWinOSVersionInfo() +DWORD WinSalInstance::getWindowsBuildNumber() { - static const WinOSVersionInfo aResult = [] + static const DWORD nResult = [] { - WinOSVersionInfo aVersion; - // GetVersion(Ex) and VersionHelpers (based on VerifyVersionInfo) API are - // subject to manifest-based behavior since Windows 8.1, so give wrong results. - // Another approach would be to use NetWkstaGetInfo, but that has some small - // reported delays (some milliseconds), and might get slower in domains with - // poor network connections. - // So go with a solution described at https://msdn.microsoft.com/en-us/library/ms724429 - bool bHaveVerFromKernel32 = false; - if (HMODULE h_kernel32 = GetModuleHandleW(L"kernel32.dll")) - { - wchar_t szPath[MAX_PATH]; - DWORD dwCount = GetModuleFileNameW(h_kernel32, szPath, SAL_N_ELEMENTS(szPath)); - if (dwCount != 0 && dwCount < SAL_N_ELEMENTS(szPath)) - { - dwCount = GetFileVersionInfoSizeW(szPath, nullptr); - if (dwCount != 0) - { - std::unique_ptr ver(new char[dwCount]); - if (GetFileVersionInfoW(szPath, 0, dwCount, ver.get()) != FALSE) - { - void* pBlock = nullptr; - UINT dwBlockSz = 0; - if (VerQueryValueW(ver.get(), L"\\", &pBlock, &dwBlockSz) != FALSE - && dwBlockSz >= sizeof(VS_FIXEDFILEINFO)) - { - VS_FIXEDFILEINFO* vi1 = static_cast(pBlock); - aVersion.m_nMajorVersion = HIWORD(vi1->dwProductVersionMS); - aVersion.m_nMinorVersion = LOWORD(vi1->dwProductVersionMS); - bHaveVerFromKernel32 = true; - } - } - } - } - } - // Now use RtlGetVersion (which is not subject to deprecation for GetVersion(Ex) API) - // to get build number and SP info + DWORD nBuildNumber = 0; + // use RtlGetVersion to get build number if (HMODULE h_ntdll = GetModuleHandleW(L"ntdll.dll")) { if (auto RtlGetVersion @@ -1132,24 +1055,18 @@ WinOSVersionInfo WinSalInstance::getWinOSVersionInfo() vi2.dwOSVersionInfoSize = sizeof(vi2); if (STATUS_SUCCESS == RtlGetVersion(&vi2)) { - if (!bHaveVerFromKernel32) // we failed above; let's hope this would be useful - { - aVersion.m_nMajorVersion = vi2.dwMajorVersion; - aVersion.m_nMinorVersion = vi2.dwMinorVersion; - } - aVersion.m_nBuildNumber = vi2.dwBuildNumber; + nBuildNumber = vi2.dwBuildNumber; } } } - return aVersion; + return nBuildNumber; }(); - return aResult; + return nResult; } OUString WinSalInstance::getOSVersion() { - WinOSVersionInfo aInfo = getWinOSVersionInfo(); - return getOSVersionString(aInfo.m_nMajorVersion, aInfo.m_nMinorVersion, aInfo.m_nBuildNumber); + return getOSVersionString(getWindowsBuildNumber()); } void WinSalInstance::BeforeAbort(const OUString&, bool) diff --git a/vcl/win/gdi/dw-extra.h b/vcl/win/gdi/dw-extra.h deleted file mode 100644 index 4c07d81d2126..000000000000 --- a/vcl/win/gdi/dw-extra.h +++ /dev/null @@ -1,141 +0,0 @@ -// -// copied from: -// https://hg.mozilla.org/mozilla-central/file/704f09a557a4dfc9057f1672b711789f64f74a82/gfx/2d/dw-extra.h -// - -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * 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/. */ - -/* - * New DirectWrite interfaces based on Win10 Fall Creators Update versions - * of dwrite_3.h and dcommon.h (from SDK 10.0.17061.0). This particular - * subset of declarations is intended to be just sufficient to compile the - * Gecko DirectWrite font code; it omits many other new interfaces, etc. - */ - -#ifndef DWRITE_EXTRA_H -#define DWRITE_EXTRA_H - -#pragma once - -interface IDWriteFontResource; -interface IDWriteFontFaceReference1; - -enum DWRITE_GLYPH_IMAGE_FORMATS { - DWRITE_GLYPH_IMAGE_FORMATS_NONE = 0x00000000, - DWRITE_GLYPH_IMAGE_FORMATS_TRUETYPE = 0x00000001, - DWRITE_GLYPH_IMAGE_FORMATS_CFF = 0x00000002, - DWRITE_GLYPH_IMAGE_FORMATS_COLR = 0x00000004, - DWRITE_GLYPH_IMAGE_FORMATS_SVG = 0x00000008, - DWRITE_GLYPH_IMAGE_FORMATS_PNG = 0x00000010, - DWRITE_GLYPH_IMAGE_FORMATS_JPEG = 0x00000020, - DWRITE_GLYPH_IMAGE_FORMATS_TIFF = 0x00000040, - DWRITE_GLYPH_IMAGE_FORMATS_PREMULTIPLIED_B8G8R8A8 = 0x00000080, -}; - -#ifdef DEFINE_ENUM_FLAG_OPERATORS -DEFINE_ENUM_FLAG_OPERATORS(DWRITE_GLYPH_IMAGE_FORMATS); -#endif - -#define DWRITE_MAKE_FONT_AXIS_TAG(a, b, c, d) \ - (static_cast(DWRITE_MAKE_OPENTYPE_TAG(a, b, c, d))) - -enum DWRITE_FONT_AXIS_TAG : UINT32 { - DWRITE_FONT_AXIS_TAG_WEIGHT = DWRITE_MAKE_FONT_AXIS_TAG('w', 'g', 'h', 't'), - DWRITE_FONT_AXIS_TAG_WIDTH = DWRITE_MAKE_FONT_AXIS_TAG('w', 'd', 't', 'h'), - DWRITE_FONT_AXIS_TAG_SLANT = DWRITE_MAKE_FONT_AXIS_TAG('s', 'l', 'n', 't'), - DWRITE_FONT_AXIS_TAG_OPTICAL_SIZE = - DWRITE_MAKE_FONT_AXIS_TAG('o', 'p', 's', 'z'), - DWRITE_FONT_AXIS_TAG_ITALIC = DWRITE_MAKE_FONT_AXIS_TAG('i', 't', 'a', 'l'), -}; - -enum DWRITE_FONT_AXIS_ATTRIBUTES { - DWRITE_FONT_AXIS_ATTRIBUTES_NONE = 0x0000, - DWRITE_FONT_AXIS_ATTRIBUTES_VARIABLE = 0x0001, - DWRITE_FONT_AXIS_ATTRIBUTES_HIDDEN = 0x0002, -}; - -struct DWRITE_FONT_AXIS_VALUE { - DWRITE_FONT_AXIS_TAG axisTag; - FLOAT value; -}; - -struct DWRITE_FONT_AXIS_RANGE { - DWRITE_FONT_AXIS_TAG axisTag; - FLOAT minValue; - FLOAT maxValue; -}; - -struct DWRITE_GLYPH_IMAGE_DATA { - const void* imageData; - UINT32 imageDataSize; - UINT32 uniqueDataId; - UINT32 pixelsPerEm; - D2D1_SIZE_U pixelSize; - D2D1_POINT_2L horizontalLeftOrigin; - D2D1_POINT_2L horizontalRightOrigin; - D2D1_POINT_2L verticalTopOrigin; - D2D1_POINT_2L verticalBottomOrigin; -}; - -interface DWRITE_DECLARE_INTERFACE("27F2A904-4EB8-441D-9678-0563F53E3E2F") - IDWriteFontFace4 : public IDWriteFontFace3 { - STDMETHOD_(DWRITE_GLYPH_IMAGE_FORMATS, GetGlyphImageFormats)() PURE; - STDMETHOD(GetGlyphImageFormats) - (UINT16 glyphId, UINT32 pixelsPerEmFirst, UINT32 pixelsPerEmLast, - _Out_ DWRITE_GLYPH_IMAGE_FORMATS* glyphImageFormats) PURE; - STDMETHOD(GetGlyphImageData) - (_In_ UINT16 glyphId, UINT32 pixelsPerEm, - DWRITE_GLYPH_IMAGE_FORMATS glyphImageFormat, - _Out_ DWRITE_GLYPH_IMAGE_DATA* glyphData, - _Outptr_result_maybenull_ void** glyphDataContext) PURE; - STDMETHOD_(void, ReleaseGlyphImageData)(void* glyphDataContext) PURE; -}; - -interface DWRITE_DECLARE_INTERFACE("98EFF3A5-B667-479A-B145-E2FA5B9FDC29") - IDWriteFontFace5 : public IDWriteFontFace4 { - STDMETHOD_(UINT32, GetFontAxisValueCount)() PURE; - STDMETHOD(GetFontAxisValues) - (_Out_writes_(fontAxisValueCount) DWRITE_FONT_AXIS_VALUE* fontAxisValues, - UINT32 fontAxisValueCount) PURE; - STDMETHOD_(BOOL, HasVariations)() PURE; - STDMETHOD(GetFontResource) - (_COM_Outptr_ IDWriteFontResource** fontResource) PURE; - STDMETHOD_(BOOL, Equals)(IDWriteFontFace* fontFace) PURE; -}; - -interface DWRITE_DECLARE_INTERFACE("1F803A76-6871-48E8-987F-B975551C50F2") - IDWriteFontResource : public IUnknown { - STDMETHOD(GetFontFile)(_COM_Outptr_ IDWriteFontFile** fontFile) PURE; - STDMETHOD_(UINT32, GetFontFaceIndex)() PURE; - STDMETHOD_(UINT32, GetFontAxisCount)() PURE; - STDMETHOD(GetDefaultFontAxisValues) - (_Out_writes_(fontAxisValueCount) DWRITE_FONT_AXIS_VALUE* fontAxisValues, - UINT32 fontAxisValueCount) PURE; - STDMETHOD(GetFontAxisRanges) - (_Out_writes_(fontAxisRangeCount) DWRITE_FONT_AXIS_RANGE* fontAxisRanges, - UINT32 fontAxisRangeCount) PURE; - STDMETHOD_(DWRITE_FONT_AXIS_ATTRIBUTES, GetFontAxisAttributes) - (UINT32 axisIndex) PURE; - STDMETHOD(GetAxisNames) - (UINT32 axisIndex, _COM_Outptr_ IDWriteLocalizedStrings** names) PURE; - STDMETHOD_(UINT32, GetAxisValueNameCount)(UINT32 axisIndex) PURE; - STDMETHOD(GetAxisValueNames) - (UINT32 axisIndex, UINT32 axisValueIndex, - _Out_ DWRITE_FONT_AXIS_RANGE* fontAxisRange, - _COM_Outptr_ IDWriteLocalizedStrings** names) PURE; - STDMETHOD_(BOOL, HasVariations)() PURE; - STDMETHOD(CreateFontFace) - (DWRITE_FONT_SIMULATIONS fontSimulations, - _In_reads_(fontAxisValueCount) DWRITE_FONT_AXIS_VALUE const* fontAxisValues, - UINT32 fontAxisValueCount, _COM_Outptr_ IDWriteFontFace5** fontFace) PURE; - STDMETHOD(CreateFontFaceReference) - (DWRITE_FONT_SIMULATIONS fontSimulations, - _In_reads_(fontAxisValueCount) DWRITE_FONT_AXIS_VALUE const* fontAxisValues, - UINT32 fontAxisValueCount, - _COM_Outptr_ IDWriteFontFaceReference1** fontFaceReference) PURE; -}; - -#endif /* DWRITE_EXTRA_H */ diff --git a/vcl/win/gdi/salfont.cxx b/vcl/win/gdi/salfont.cxx index 4de061d74de7..28a6dcf4dba5 100644 --- a/vcl/win/gdi/salfont.cxx +++ b/vcl/win/gdi/salfont.cxx @@ -33,12 +33,6 @@ #include #include -// Currently, we build with _WIN32_WINNT=0x0601 (Windows 7), which means newer -// declarations in dwrite_3.h will not be visible. -#if WINVER < 0x0A00 -# include "dw-extra.h" -#endif - #include #include #include diff --git a/vcl/win/gdi/salnativewidgets-luna.cxx b/vcl/win/gdi/salnativewidgets-luna.cxx index 02248127ed09..2c1795fd5f9b 100644 --- a/vcl/win/gdi/salnativewidgets-luna.cxx +++ b/vcl/win/gdi/salnativewidgets-luna.cxx @@ -1153,8 +1153,7 @@ static bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, if (bUseDarkMode && (bChecked || (nState & (ControlState::PRESSED) || (nState & ControlState::ROLLOVER)))) { - const WinOSVersionInfo aVersion = WinSalInstance::getWinOSVersionInfo(); - if (aVersion.m_nMajorVersion == 10 && aVersion.m_nBuildNumber >= 22000) + if (WinSalInstance::getWindowsBuildNumber() >= 22000) { // tdf#152534 workaround bug with Windows 11 Dark theme using // light blue as highlight color which gives insufficient diff --git a/vcl/workben/rtf2pdffuzzer.options b/vcl/workben/rtf2pdffuzzer.options index 53a65b1e4d8b..3aef05154c81 100644 --- a/vcl/workben/rtf2pdffuzzer.options +++ b/vcl/workben/rtf2pdffuzzer.options @@ -1,3 +1,3 @@ [libfuzzer] -max_len = 2048 +max_len = 4096 dict = rtf.dict diff --git a/xmlsecurity/source/dialogs/certificatechooser.cxx b/xmlsecurity/source/dialogs/certificatechooser.cxx index 89fef57d032d..0cb00f7a049b 100644 --- a/xmlsecurity/source/dialogs/certificatechooser.cxx +++ b/xmlsecurity/source/dialogs/certificatechooser.cxx @@ -72,7 +72,7 @@ CertificateChooser::CertificateChooser(weld::Window* _pParent, o3tl::narrowing(20*nControlWidth/100) }; m_xCertLB->set_column_fixed_widths(aWidths); - m_xCertLB->connect_changed( LINK( this, CertificateChooser, CertificateHighlightHdl ) ); + m_xCertLB->connect_selection_changed(LINK(this, CertificateChooser, CertificateHighlightHdl)); m_xCertLB->connect_row_activated( LINK( this, CertificateChooser, CertificateSelectHdl ) ); m_xViewBtn->connect_clicked( LINK( this, CertificateChooser, ViewButtonHdl ) ); m_xSearchBox->connect_changed(LINK(this, CertificateChooser, SearchModifyHdl)); diff --git a/xmlsecurity/source/dialogs/certificateviewer.cxx b/xmlsecurity/source/dialogs/certificateviewer.cxx index 2cd3e11e8571..6624048e25a5 100644 --- a/xmlsecurity/source/dialogs/certificateviewer.cxx +++ b/xmlsecurity/source/dialogs/certificateviewer.cxx @@ -235,7 +235,8 @@ CertificateViewerDetailsTP::CertificateViewerDetailsTP(weld::Container* pParent, InsertElement( XsResId( STR_THUMBPRINT_MD5 ), aLBEntry, aDetails, true ); m_xElementsLB->columns_autosize(); - m_xElementsLB->connect_changed(LINK(this, CertificateViewerDetailsTP, ElementSelectHdl)); + m_xElementsLB->connect_selection_changed( + LINK(this, CertificateViewerDetailsTP, ElementSelectHdl)); } IMPL_LINK_NOARG(CertificateViewerDetailsTP, ElementSelectHdl, weld::TreeView&, void) @@ -275,7 +276,7 @@ CertificateViewerCertPathTP::CertificateViewerCertPathTP(weld::Container* pParen mxCertStatusML->set_editable(false); mxCertPathLB->columns_autosize(); - mxCertPathLB->connect_changed( LINK( this, CertificateViewerCertPathTP, CertSelectHdl ) ); + mxCertPathLB->connect_selection_changed(LINK(this, CertificateViewerCertPathTP, CertSelectHdl)); mxViewCertPB->connect_clicked( LINK( this, CertificateViewerCertPathTP, ViewCertHdl ) ); } diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx index aa4bfec4664b..4c865aac9817 100644 --- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx +++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx @@ -234,7 +234,8 @@ DigitalSignaturesDialog::DigitalSignaturesDialog( mbVerifySignatures = true; mbSignaturesChanged = false; - m_xSignaturesLB->connect_changed( LINK( this, DigitalSignaturesDialog, SignatureHighlightHdl ) ); + m_xSignaturesLB->connect_selection_changed( + LINK(this, DigitalSignaturesDialog, SignatureHighlightHdl)); m_xSignaturesLB->connect_row_activated( LINK( this, DigitalSignaturesDialog, SignatureSelectHdl ) ); m_xViewBtn->connect_clicked( LINK( this, DigitalSignaturesDialog, ViewButtonHdl ) ); diff --git a/xmlsecurity/source/dialogs/macrosecurity.cxx b/xmlsecurity/source/dialogs/macrosecurity.cxx index cd21d68e32e8..6e11410afe8b 100644 --- a/xmlsecurity/source/dialogs/macrosecurity.cxx +++ b/xmlsecurity/source/dialogs/macrosecurity.cxx @@ -417,13 +417,15 @@ MacroSecurityTrustedSourcesTP::MacroSecurityTrustedSourcesTP(weld::Container* pP m_xTrustCertLB->set_column_fixed_widths(aWidths); m_xTrustCertLB->set_size_request(nColWidth * 5.5, m_xTrustCertLB->get_height_rows(5)); - m_xTrustCertLB->connect_changed( LINK( this, MacroSecurityTrustedSourcesTP, TrustCertLBSelectHdl ) ); + m_xTrustCertLB->connect_selection_changed( + LINK(this, MacroSecurityTrustedSourcesTP, TrustCertLBSelectHdl)); m_xViewCertPB->connect_clicked( LINK( this, MacroSecurityTrustedSourcesTP, ViewCertPBHdl ) ); m_xViewCertPB->set_sensitive(false); m_xRemoveCertPB->connect_clicked( LINK( this, MacroSecurityTrustedSourcesTP, RemoveCertPBHdl ) ); m_xRemoveCertPB->set_sensitive(false); - m_xTrustFileLocLB->connect_changed( LINK( this, MacroSecurityTrustedSourcesTP, TrustFileLocLBSelectHdl ) ); + m_xTrustFileLocLB->connect_selection_changed( + LINK(this, MacroSecurityTrustedSourcesTP, TrustFileLocLBSelectHdl)); m_xTrustFileLocLB->set_size_request(nColWidth * 5, m_xTrustFileLocLB->get_height_rows(5)); m_xAddLocPB->connect_clicked( LINK( this, MacroSecurityTrustedSourcesTP, AddLocPBHdl ) ); m_xRemoveLocPB->connect_clicked( LINK( this, MacroSecurityTrustedSourcesTP, RemoveLocPBHdl ) );