[Libreoffice-commits] core.git: toolkit/source
toolkit/source/awt/vclxwindow.cxx |7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) New commits: commit e87937d1fab87fa3225f5bcc0d2f5182d5fcef39 Author: Noel Grandin AuthorDate: Tue Nov 7 15:25:30 2023 +0200 Commit: Noel Grandin CommitDate: Wed Nov 8 19:55:16 2023 +0100 loplugin:fieldcast in VCLXWindowImpl Change-Id: I9a0181e87653e1bf62245e8ddf381518a59f841b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159116 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/toolkit/source/awt/vclxwindow.cxx b/toolkit/source/awt/vclxwindow.cxx index 5f061e6bd5a9..2448eaf64667 100644 --- a/toolkit/source/awt/vclxwindow.cxx +++ b/toolkit/source/awt/vclxwindow.cxx @@ -129,7 +129,7 @@ public: mxAccessibleContext; css::uno::Reference< css::awt::XGraphics > mxViewGraphics; -css::uno::Reference< css::awt::XStyleSettings > +rtl::Reference< toolkit::WindowStyleSettings > mxWindowStyleSettings; public: @@ -249,9 +249,8 @@ void VCLXWindowImpl::disposing() maTopWindowListeners.disposeAndClear( aEvent ); maWindow2Listeners.disposeAndClear( aEvent ); -::toolkit::WindowStyleSettings* pStyleSettings = static_cast< ::toolkit::WindowStyleSettings* >( mxWindowStyleSettings.get() ); -if ( pStyleSettings != nullptr ) -pStyleSettings->dispose(); +if ( mxWindowStyleSettings ) +mxWindowStyleSettings->dispose(); mxWindowStyleSettings.clear(); }
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/controls/tree/treedatamodel.cxx | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) New commits: commit 1914124c6a343f58edbc52dab5238d03a7110ced Author: Noel Grandin AuthorDate: Tue Nov 7 15:24:02 2023 +0200 Commit: Noel Grandin CommitDate: Wed Nov 8 09:22:40 2023 +0100 loplugin:fieldcast in MutableTreeDataModel Change-Id: I713db74dac43a61fe98ab18834e0dd6e24117caa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159097 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/toolkit/source/controls/tree/treedatamodel.cxx b/toolkit/source/controls/tree/treedatamodel.cxx index eca39d94f86b..4471697fb687 100644 --- a/toolkit/source/controls/tree/treedatamodel.cxx +++ b/toolkit/source/controls/tree/treedatamodel.cxx @@ -78,7 +78,7 @@ private: comphelper::OInterfaceContainerHelper4 maTreeDataModelListeners; comphelper::OInterfaceContainerHelper4 maEventListeners; bool mbDisposed; -Reference< XTreeNode > mxRootNode; +rtl::Reference< MutableTreeNode > mxRootNode; }; class MutableTreeNode: public ::cppu::WeakImplHelper< XMutableTreeNode, XServiceInfo > @@ -182,15 +182,11 @@ void SAL_CALL MutableTreeDataModel::setRoot( const Reference< XMutableTreeNode > throw IllegalArgumentException(); std::unique_lock aGuard( m_aMutex ); -if( xNode == mxRootNode ) +if( xNode.get() == mxRootNode.get() ) return; if( mxRootNode.is() ) -{ -rtl::Reference< MutableTreeNode > xOldImpl( dynamic_cast< MutableTreeNode* >( mxRootNode.get() ) ); -if( xOldImpl.is() ) -xOldImpl->mbIsInserted = false; -} +mxRootNode->mbIsInserted = false; rtl::Reference< MutableTreeNode > xImpl( dynamic_cast< MutableTreeNode* >( xNode.get() ) ); if( !xImpl.is() || xImpl->mbIsInserted )
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/controls/controlmodelcontainerbase.cxx |2 +- toolkit/source/controls/stdtabcontroller.cxx |2 +- toolkit/source/controls/tabpagemodel.cxx |2 +- 3 files changed, 3 insertions(+), 3 deletions(-) New commits: commit 711e01c7878ef0c319fd40c95484cb9be5105e00 Author: Stephan Bergmann AuthorDate: Thu Oct 19 10:30:35 2023 +0200 Commit: Stephan Bergmann CommitDate: Fri Oct 20 19:54:29 2023 +0200 Extended loplugin:ostr: Automatic rewrite O[U]StringLiteral: toolkit Change-Id: I67ba7b0f4d99f080b343a9b26a242cf4008b820c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158244 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/toolkit/source/controls/controlmodelcontainerbase.cxx b/toolkit/source/controls/controlmodelcontainerbase.cxx index c6292cd1e21b..8c9bba0890de 100644 --- a/toolkit/source/controls/controlmodelcontainerbase.cxx +++ b/toolkit/source/controls/controlmodelcontainerbase.cxx @@ -65,7 +65,7 @@ using namespace ::com::sun::star::beans; using namespace ::com::sun::star::util; using namespace toolkit; -constexpr OUStringLiteral PROPERTY_RESOURCERESOLVER = u"ResourceResolver"; +constexpr OUString PROPERTY_RESOURCERESOLVER = u"ResourceResolver"_ustr; namespace diff --git a/toolkit/source/controls/stdtabcontroller.cxx b/toolkit/source/controls/stdtabcontroller.cxx index 554fcfb3c76b..bac4aea58547 100644 --- a/toolkit/source/controls/stdtabcontroller.cxx +++ b/toolkit/source/controls/stdtabcontroller.cxx @@ -111,7 +111,7 @@ bool StdTabController::ImplCreateComponentSequence( if ( pTabs ) { // opt: Constant String for TabStop name -static constexpr OUStringLiteral aTabStopName = u"Tabstop"; +static constexpr OUString aTabStopName = u"Tabstop"_ustr; Reference< XPropertySet > xPSet( xCtrl->getModel(), UNO_QUERY ); Reference< XPropertySetInfo > xInfo = xPSet->getPropertySetInfo(); diff --git a/toolkit/source/controls/tabpagemodel.cxx b/toolkit/source/controls/tabpagemodel.cxx index 53a2c7335b27..7185f8241947 100644 --- a/toolkit/source/controls/tabpagemodel.cxx +++ b/toolkit/source/controls/tabpagemodel.cxx @@ -142,7 +142,7 @@ void SAL_CALL UnoControlTabPageModel::initialize (const Sequence& rArgument Reference xDialogProp(xDialogModel,UNO_QUERY); if ( xDialogProp.is() ) { -static constexpr OUStringLiteral s_sResourceResolver = u"ResourceResolver"; +static constexpr OUString s_sResourceResolver = u"ResourceResolver"_ustr; setPropertyValue(s_sResourceResolver,xDialogProp->getPropertyValue(s_sResourceResolver)); setPropertyValue(GetPropertyName(BASEPROPERTY_TITLE),xDialogProp->getPropertyValue(GetPropertyName(BASEPROPERTY_TITLE))); setPropertyValue(GetPropertyName(BASEPROPERTY_HELPTEXT),xDialogProp->getPropertyValue(GetPropertyName(BASEPROPERTY_HELPTEXT)));
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/awt/vclxmenu.cxx |8 +- toolkit/source/awt/vclxtoolkit.cxx|8 +- toolkit/source/awt/vclxwindow.cxx | 44 +++--- toolkit/source/awt/vclxwindows.cxx| 54 +- toolkit/source/controls/controlmodelcontainerbase.cxx |5 - toolkit/source/controls/dialogcontrol.cxx |4 - toolkit/source/controls/geometrycontrolmodel.cxx |4 - toolkit/source/controls/grid/gridcolumn.cxx |2 toolkit/source/controls/grid/gridcolumn.hxx |2 toolkit/source/controls/grid/gridcontrol.cxx |2 toolkit/source/controls/roadmapcontrol.cxx| 10 +-- toolkit/source/controls/svtxgridcontrol.cxx |4 - toolkit/source/controls/tabpagecontainer.cxx |6 +- toolkit/source/controls/tkscrollbar.cxx |2 toolkit/source/controls/tree/treecontrol.cxx |2 toolkit/source/controls/tree/treecontrolpeer.cxx |8 +- toolkit/source/controls/tree/treedatamodel.cxx|4 - toolkit/source/controls/unocontrolmodel.cxx |2 toolkit/source/controls/unocontrols.cxx | 14 ++-- toolkit/source/hatchwindow/documentcloser.cxx |2 20 files changed, 91 insertions(+), 96 deletions(-) New commits: commit 367891c40ec683767d91ddeaf566c396f22b9035 Author: Mike Kaganski AuthorDate: Sun Apr 23 20:15:14 2023 +0300 Commit: Mike Kaganski CommitDate: Fri Oct 20 12:22:18 2023 +0200 Use getXWeak in toolkit Change-Id: I44a0ddd386ea6d262d6102b40f3e9837655068ed Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150877 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/toolkit/source/awt/vclxmenu.cxx b/toolkit/source/awt/vclxmenu.cxx index 86c3e87c5b6a..37785849c551 100644 --- a/toolkit/source/awt/vclxmenu.cxx +++ b/toolkit/source/awt/vclxmenu.cxx @@ -98,7 +98,7 @@ IMPL_LINK( VCLXMenu, MenuEventListener, VclMenuEvent&, rMenuEvent, void ) if ( maMenuListeners.getLength() ) { css::awt::MenuEvent aEvent; -aEvent.Source = static_cast(this); +aEvent.Source = getXWeak(); aEvent.MenuId = mpMenu->GetCurItemId(); maMenuListeners.itemSelected( aEvent ); } @@ -114,7 +114,7 @@ IMPL_LINK( VCLXMenu, MenuEventListener, VclMenuEvent&, rMenuEvent, void ) if ( maMenuListeners.getLength() ) { css::awt::MenuEvent aEvent; -aEvent.Source = static_cast(this); +aEvent.Source = getXWeak(); aEvent.MenuId = mpMenu->GetCurItemId(); maMenuListeners.itemHighlighted( aEvent ); } @@ -125,7 +125,7 @@ IMPL_LINK( VCLXMenu, MenuEventListener, VclMenuEvent&, rMenuEvent, void ) if ( maMenuListeners.getLength() ) { css::awt::MenuEvent aEvent; -aEvent.Source = static_cast(this); +aEvent.Source = getXWeak(); aEvent.MenuId = mpMenu->GetCurItemId(); maMenuListeners.itemActivated( aEvent ); } @@ -136,7 +136,7 @@ IMPL_LINK( VCLXMenu, MenuEventListener, VclMenuEvent&, rMenuEvent, void ) if ( maMenuListeners.getLength() ) { css::awt::MenuEvent aEvent; -aEvent.Source = static_cast(this); +aEvent.Source = getXWeak(); aEvent.MenuId = mpMenu->GetCurItemId(); maMenuListeners.itemDeactivated( aEvent ); } diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx index a5e3f71386b1..7ae9cda1b6ff 100644 --- a/toolkit/source/awt/vclxtoolkit.cxx +++ b/toolkit/source/awt/vclxtoolkit.cxx @@ -972,7 +972,7 @@ void SAL_CALL VCLXToolkit::disposing() m_bKeyListener = false; } css::lang::EventObject aEvent( -static_cast< ::cppu::OWeakObject * >(this)); +getXWeak()); m_aTopWindowListeners.disposeAndClear(aEvent); m_aKeyHandlers.disposeAndClear(aEvent); m_aFocusListeners.disposeAndClear(aEvent); @@ -2189,7 +2189,7 @@ void SAL_CALL VCLXToolkit::addTopWindowListener( aGuard.clear(); rListener->disposing( css::lang::EventObject( -static_cast< ::cppu::OWeakObject * >(this))); +getXWeak())); } else if (m_aTopWindowListeners.addInterface(rListener) == 1 && !m_bEventListener) @@ -2224,7 +2224,7 @@ void SAL_CALL VCLXToolkit::addKeyHandler( aGuard.clear(); rHandler->disposing( css::lang::EventObject( -static_cast< ::cppu::OWeakObject * >(this))); +getXWeak())); } else if (m_aKeyHandlers.addInterface(rHandler) == 1 && !m_bKeyListener) { @@ -2257,7 +2257,7 @@ void
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/controls/controlmodelcontainerbase.cxx | 32 +- 1 file changed, 10 insertions(+), 22 deletions(-) New commits: commit b20d44d301258ea99d7c20366d35f8fab8682e3b Author: Julien Nabet AuthorDate: Thu Oct 5 13:19:58 2023 +0200 Commit: Stephan Bergmann CommitDate: Thu Oct 5 16:09:32 2023 +0200 Replace getTabIndexPropertyName and getStepPropertyName (toolkit) by constrexp or by using the string directly since used once. Change-Id: I0d232d5856551bd5dde22ed5075807d20f6f6624 Change-Id: I07d50845ec21998813f3fecb7fb183eaf234f7ca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157591 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/toolkit/source/controls/controlmodelcontainerbase.cxx b/toolkit/source/controls/controlmodelcontainerbase.cxx index c82f1052eee3..8714b5ad64d4 100644 --- a/toolkit/source/controls/controlmodelcontainerbase.cxx +++ b/toolkit/source/controls/controlmodelcontainerbase.cxx @@ -133,19 +133,7 @@ public: } }; - -static OUString getTabIndexPropertyName( ) -{ -return "TabIndex"; -} - - -static OUString getStepPropertyName( ) -{ -return "Step"; -} - - +constexpr OUString aTabIndexPropertyNameStr( u"TabIndex"_ustr ); ControlModelContainerBase::ControlModelContainerBase( const Reference< XComponentContext >& rxContext ) :ControlModelContainer_IBase( rxContext ) @@ -628,8 +616,8 @@ void SAL_CALL ControlModelContainerBase::setControlModels( const Sequence< Refer Reference< XPropertySetInfo > xPSI; if ( xProps.is() ) xPSI = xProps->getPropertySetInfo(); -if ( xPSI.is() && xPSI->hasPropertyByName( getTabIndexPropertyName() ) ) -xProps->setPropertyValue( getTabIndexPropertyName(), Any( nTabIndex++ ) ); +if ( xPSI.is() && xPSI->hasPropertyByName( aTabIndexPropertyNameStr ) ) +xProps->setPropertyValue( aTabIndexPropertyNameStr, Any( nTabIndex++ ) ); } mbGroupsUpToDate = false; } @@ -660,10 +648,10 @@ Sequence< Reference< XControlModel > > SAL_CALL ControlModelContainerBase::getCo DBG_ASSERT( xPSI.is(), "ControlModelContainerBase::getControlModels: invalid child model!" ); // has it? -if ( xPSI.is() && xPSI->hasPropertyByName( getTabIndexPropertyName() ) ) +if ( xPSI.is() && xPSI->hasPropertyByName( aTabIndexPropertyNameStr ) ) { // yes sal_Int32 nTabIndex = -1; -xControlProps->getPropertyValue( getTabIndexPropertyName() ) >>= nTabIndex; +xControlProps->getPropertyValue( aTabIndexPropertyNameStr ) >>= nTabIndex; aSortedModels.emplace( nTabIndex, xModel ); } @@ -772,7 +760,7 @@ namespace try { Reference< XPropertySet > xModelProps( _rxModel, UNO_QUERY ); -xModelProps->getPropertyValue( getStepPropertyName() ) >>= nStep; +xModelProps->getPropertyValue( u"Step"_ustr ) >>= nStep; } catch (const Exception&) { @@ -1001,8 +989,8 @@ void ControlModelContainerBase::startControlListening( const Reference< XControl if ( xModelProps.is() ) xPSI = xModelProps->getPropertySetInfo(); -if ( xPSI.is() && xPSI->hasPropertyByName( getTabIndexPropertyName() ) ) -xModelProps->addPropertyChangeListener( getTabIndexPropertyName(), this ); +if ( xPSI.is() && xPSI->hasPropertyByName( aTabIndexPropertyNameStr ) ) +xModelProps->addPropertyChangeListener( aTabIndexPropertyNameStr, this ); } @@ -1015,8 +1003,8 @@ void ControlModelContainerBase::stopControlListening( const Reference< XControlM if ( xModelProps.is() ) xPSI = xModelProps->getPropertySetInfo(); -if ( xPSI.is() && xPSI->hasPropertyByName( getTabIndexPropertyName() ) ) -xModelProps->removePropertyChangeListener( getTabIndexPropertyName(), this ); +if ( xPSI.is() && xPSI->hasPropertyByName( aTabIndexPropertyNameStr ) ) +xModelProps->removePropertyChangeListener( aTabIndexPropertyNameStr, this ); }
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/controls/roadmapcontrol.cxx | 24 ++-- 1 file changed, 6 insertions(+), 18 deletions(-) New commits: commit 3c162a7a312022716e0648f95662b33577b5993d Author: Julien Nabet AuthorDate: Thu Oct 5 12:21:51 2023 +0200 Commit: Julien Nabet CommitDate: Thu Oct 5 13:57:11 2023 +0200 Replace 2 other lcl_throw* by throwing the right exception directly (toolkit) Change-Id: Ib0347db6ad5690e0cba9326d7ec3fd85c2f93984 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157588 Reviewed-by: Julien Nabet Tested-by: Jenkins diff --git a/toolkit/source/controls/roadmapcontrol.cxx b/toolkit/source/controls/roadmapcontrol.cxx index 1fdef79f28b7..6d73514e7bc4 100644 --- a/toolkit/source/controls/roadmapcontrol.cxx +++ b/toolkit/source/controls/roadmapcontrol.cxx @@ -39,18 +39,6 @@ namespace toolkit // helper - -static void lcl_throwIllegalArgumentException( ) -{ // throwing is expensive (in terms of code size), thus we hope the compiler does not inline this... -throw IllegalArgumentException(); -} - -static void lcl_throwIndexOutOfBoundsException( ) -{ // throwing is expensive (in terms of code size), thus we hope the compiler does not inline this... -throw IndexOutOfBoundsException(); -} - - // = UnoControlRoadmapModel @@ -179,7 +167,7 @@ static void lcl_throwIndexOutOfBoundsException( ) Any SAL_CALL UnoControlRoadmapModel::getByIndex( sal_Int32 Index ) { if ((Index < 0) || ( o3tl::make_unsigned(Index) >= maRoadmapItems.size())) -lcl_throwIndexOutOfBoundsException( ); +throw IndexOutOfBoundsException(); Any aAny( maRoadmapItems.at( Index ) ); return aAny; } @@ -188,13 +176,13 @@ static void lcl_throwIndexOutOfBoundsException( ) void UnoControlRoadmapModel::MakeRMItemValidation( sal_Int32 Index, const Reference< XInterface >& xRoadmapItem ) { if (( Index < 0 ) || (o3tl::make_unsigned(Index) > maRoadmapItems.size()) ) -lcl_throwIndexOutOfBoundsException( ); +throw IndexOutOfBoundsException(); if ( !xRoadmapItem.is() ) -lcl_throwIllegalArgumentException(); +throw IllegalArgumentException(); Reference< XServiceInfo > xServiceInfo( xRoadmapItem, UNO_QUERY ); bool bIsRoadmapItem = xServiceInfo->supportsService("com.sun.star.awt.RoadmapItem"); if ( !bIsRoadmapItem ) -lcl_throwIllegalArgumentException(); +throw IllegalArgumentException(); } @@ -268,7 +256,7 @@ static void lcl_throwIndexOutOfBoundsException( ) void SAL_CALL UnoControlRoadmapModel::insertByIndex( const sal_Int32 Index, const Any& Element) { if ( ( Index >= ( static_cast(maRoadmapItems.size()) + 1 ) ) || (Index < 0)) -lcl_throwIndexOutOfBoundsException( ); +throw IndexOutOfBoundsException(); Reference< XInterface > xRoadmapItem; Element >>= xRoadmapItem; MakeRMItemValidation( Index, xRoadmapItem); @@ -289,7 +277,7 @@ static void lcl_throwIndexOutOfBoundsException( ) void SAL_CALL UnoControlRoadmapModel::removeByIndex( sal_Int32 Index) { if ((Index < 0) || ( o3tl::make_unsigned(Index) > maRoadmapItems.size())) -lcl_throwIndexOutOfBoundsException( ); +throw IndexOutOfBoundsException(); Reference< XInterface > xRoadmapItem; maRoadmapItems.erase( maRoadmapItems.begin() + Index ); ContainerEvent aEvent = GetContainerEvent(Index, xRoadmapItem);
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/controls/controlmodelcontainerbase.cxx | 30 +++--- 1 file changed, 6 insertions(+), 24 deletions(-) New commits: commit c47038d1248340a4e0347a06707ab317da787b3b Author: Julien Nabet AuthorDate: Thu Oct 5 10:53:54 2023 +0200 Commit: Julien Nabet CommitDate: Thu Oct 5 12:16:52 2023 +0200 Replace 3 lcl_throw* by throwing the right exception directly (toolkit) Change-Id: Ia351741e46faa6463fac2124262da0153ebe19dc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157585 Reviewed-by: Noel Grandin Reviewed-by: Julien Nabet Reviewed-by: Mike Kaganski Tested-by: Jenkins diff --git a/toolkit/source/controls/controlmodelcontainerbase.cxx b/toolkit/source/controls/controlmodelcontainerbase.cxx index 14933e96affc..c82f1052eee3 100644 --- a/toolkit/source/controls/controlmodelcontainerbase.cxx +++ b/toolkit/source/controls/controlmodelcontainerbase.cxx @@ -134,24 +134,6 @@ public: }; -static void lcl_throwIllegalArgumentException( ) -{ // throwing is expensive (in terms of code size), thus we hope the compiler does not inline this... -throw IllegalArgumentException(); -} - - -static void lcl_throwNoSuchElementException( ) -{ // throwing is expensive (in terms of code size), thus we hope the compiler does not inline this... -throw NoSuchElementException(); -} - - -static void lcl_throwElementExistException( ) -{ // throwing is expensive (in terms of code size), thus we hope the compiler does not inline this... -throw ElementExistException(); -} - - static OUString getTabIndexPropertyName( ) { return "TabIndex"; @@ -435,11 +417,11 @@ void ControlModelContainerBase::replaceByName( const OUString& aName, const Any& Reference< XControlModel > xNewModel; aElement >>= xNewModel; if ( !xNewModel.is() ) -lcl_throwIllegalArgumentException(); +throw IllegalArgumentException(); UnoControlModelHolderVector::iterator aElementPos = ImplFindElement( aName ); if ( maModels.end() == aElementPos ) -lcl_throwNoSuchElementException(); +throw NoSuchElementException(); // Dialog behaviour is to have all containee names unique (MSO Userform is the same) // With container controls you could have constructed an existing hierarchy and are now // add this to an existing container, in this case a name nested in the containment @@ -478,7 +460,7 @@ Any ControlModelContainerBase::getByName( const OUString& aName ) { UnoControlModelHolderVector::iterator aElementPos = ImplFindElement( aName ); if ( maModels.end() == aElementPos ) -lcl_throwNoSuchElementException(); +throw NoSuchElementException(); return Any( aElementPos->first ); } @@ -534,11 +516,11 @@ void ControlModelContainerBase::insertByName( const OUString& aName, const Any& if ( aName.isEmpty() || !xM.is() ) -lcl_throwIllegalArgumentException(); +throw IllegalArgumentException(); UnoControlModelHolderVector::iterator aElementPos = ImplFindElement( aName ); if ( maModels.end() != aElementPos ) -lcl_throwElementExistException(); +throw ElementExistException(); // Dialog behaviour is to have all containee names unique (MSO Userform is the same) // With container controls you could have constructed an existing hierarchy and are now @@ -571,7 +553,7 @@ void ControlModelContainerBase::removeByName( const OUString& aName ) UnoControlModelHolderVector::iterator aElementPos = ImplFindElement( aName ); if ( maModels.end() == aElementPos ) -lcl_throwNoSuchElementException(); +throw NoSuchElementException(); // Dialog behaviour is to have all containee names unique (MSO Userform is the same) // With container controls you could have constructed an existing hierarchy and are now
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/controls/tree/treedatamodel.cxx |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) New commits: commit d9ecb98b3060dfc7f6291391792d1a3d73a282ba Author: Noel Grandin AuthorDate: Fri Sep 8 15:02:15 2023 +0200 Commit: Noel Grandin CommitDate: Sun Sep 10 16:11:09 2023 +0200 MutableTreeDataModel does not need to implement XAggreggation Checked on jenkins using 'make check' and +void SAL_CALL setDelegator(css::uno::Reference const &) final { assert(false); } Change-Id: I81b0c46be19bfafb220f0ae908eedfd9c5b20b71 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156726 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/toolkit/source/controls/tree/treedatamodel.cxx b/toolkit/source/controls/tree/treedatamodel.cxx index d2590a361ef7..970f59416f3a 100644 --- a/toolkit/source/controls/tree/treedatamodel.cxx +++ b/toolkit/source/controls/tree/treedatamodel.cxx @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include #include @@ -45,7 +45,7 @@ class MutableTreeDataModel; typedef std::vector< rtl::Reference< MutableTreeNode > > TreeNodeVector; -class MutableTreeDataModel : public ::cppu::WeakAggImplHelper2< XMutableTreeDataModel, XServiceInfo > +class MutableTreeDataModel : public ::cppu::WeakImplHelper< XMutableTreeDataModel, XServiceInfo > { public: MutableTreeDataModel(); @@ -81,7 +81,7 @@ private: Reference< XTreeNode > mxRootNode; }; -class MutableTreeNode: public ::cppu::WeakAggImplHelper2< XMutableTreeNode, XServiceInfo > +class MutableTreeNode: public ::cppu::WeakImplHelper< XMutableTreeNode, XServiceInfo > { friend class MutableTreeDataModel;
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/controls/unocontrol.cxx | 37 - 1 file changed, 19 insertions(+), 18 deletions(-) New commits: commit 96a403b9b12fbea4cd1d72c55597dd64023de465 Author: Caolán McNamara AuthorDate: Thu May 4 10:24:53 2023 +0100 Commit: Caolán McNamara CommitDate: Thu May 4 16:43:34 2023 +0200 Resolves: tdf#155029 set StandardStyles before updateFromModel otherwise it overrides custom settings set by the model properties Change-Id: If5898aba3f2701b6d6bdaed99f9cb01174e53613 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151356 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/toolkit/source/controls/unocontrol.cxx b/toolkit/source/controls/unocontrol.cxx index 217d8f94185d..5401cf86d7b7 100644 --- a/toolkit/source/controls/unocontrol.cxx +++ b/toolkit/source/controls/unocontrol.cxx @@ -1299,6 +1299,25 @@ void UnoControl::createPeer( const Reference< XToolkit >& rxToolkit, const Refer aGuard.clear(); +// tdf#150886 if false use the same settings for widgets regardless of theme +// for consistency of document across platforms and in pdf/print output +// note: tdf#155029 do this before updateFromModel +if (xInfo->hasPropertyByName("StandardTheme")) +{ +aVal = xPSet->getPropertyValue("StandardTheme"); +bool bUseStandardTheme = false; +aVal >>= bUseStandardTheme; +if (bUseStandardTheme) +{ +VclPtr pVclPeer = VCLUnoHelper::GetWindow(getPeer()); +AllSettings aAllSettings = pVclPeer->GetSettings(); +StyleSettings aStyleSettings = aAllSettings.GetStyleSettings(); +aStyleSettings.SetStandardStyles(); +aAllSettings.SetStyleSettings(aStyleSettings); +pVclPeer->SetSettings(aAllSettings); +} +} + // the updateFromModel is done without a locked mutex, too. // The reason is that the only thing this method does is firing property changes, and this in general has // to be done without locked mutexes (as every notification to external listeners). @@ -1318,24 +1337,6 @@ void UnoControl::createPeer( const Reference< XToolkit >& rxToolkit, const Refer xView->setGraphics( xGraphics ); -// tdf#150886 if false use the same settings for widgets regardless of theme -// for consistency of document across platforms and in pdf/print output -if (xInfo->hasPropertyByName("StandardTheme")) -{ -aVal = xPSet->getPropertyValue("StandardTheme"); -bool bUseStandardTheme = false; -aVal >>= bUseStandardTheme; -if (bUseStandardTheme) -{ -VclPtr pVclPeer = VCLUnoHelper::GetWindow(getPeer()); -AllSettings aAllSettings = pVclPeer->GetSettings(); -StyleSettings aStyleSettings = aAllSettings.GetStyleSettings(); -aStyleSettings.SetStandardStyles(); -aAllSettings.SetStyleSettings(aStyleSettings); -pVclPeer->SetSettings(aAllSettings); -} -} - peerCreated(); mbCreatingPeer = false;
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/controls/tree/treedatamodel.cxx | 48 - 1 file changed, 32 insertions(+), 16 deletions(-) New commits: commit b8ef33f1a2037bae927461dc2becdcecdea4d9b0 Author: Noel Grandin AuthorDate: Wed Mar 8 09:01:33 2023 +0200 Commit: Noel Grandin CommitDate: Wed Mar 8 14:56:11 2023 + BaseMutex->std::mutex in MutableTreeDataModel Change-Id: I9028c0ac35b2f375ef0d72201ca4b9f8eb99c7b1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148477 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/toolkit/source/controls/tree/treedatamodel.cxx b/toolkit/source/controls/tree/treedatamodel.cxx index 69552431ff09..efccdd689692 100644 --- a/toolkit/source/controls/tree/treedatamodel.cxx +++ b/toolkit/source/controls/tree/treedatamodel.cxx @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include @@ -45,8 +45,7 @@ class MutableTreeDataModel; typedef std::vector< rtl::Reference< MutableTreeNode > > TreeNodeVector; -class MutableTreeDataModel : public ::cppu::WeakAggImplHelper2< XMutableTreeDataModel, XServiceInfo >, - public comphelper::OMutexAndBroadcastHelper +class MutableTreeDataModel : public ::cppu::WeakAggImplHelper2< XMutableTreeDataModel, XServiceInfo > { public: MutableTreeDataModel(); @@ -73,6 +72,11 @@ public: virtual Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override; private: +void broadcastImpl( std::unique_lock& rGuard, broadcast_type eType, const Reference< XTreeNode >& xParentNode, const Reference< XTreeNode >& rNode ); + +std::mutex m_aMutex; +comphelper::OInterfaceContainerHelper4 maTreeDataModelListeners; +comphelper::OInterfaceContainerHelper4 maEventListeners; bool mbDisposed; Reference< XTreeNode > mxRootNode; }; @@ -139,18 +143,24 @@ MutableTreeDataModel::MutableTreeDataModel() void MutableTreeDataModel::broadcast( broadcast_type eType, const Reference< XTreeNode >& xParentNode, const Reference< XTreeNode >& rNode ) { -::cppu::OInterfaceContainerHelper* pIter = m_aBHelper.getContainer( cppu::UnoType::get() ); -if( !pIter ) +std::unique_lock aGuard(m_aMutex); +broadcastImpl(aGuard, eType, xParentNode, rNode); +} + +void MutableTreeDataModel::broadcastImpl( std::unique_lock& rGuard, broadcast_type eType, const Reference< XTreeNode >& xParentNode, const Reference< XTreeNode >& rNode ) +{ +if( !maTreeDataModelListeners.getLength(rGuard) ) return; Reference< XInterface > xSource( static_cast< ::cppu::OWeakObject* >( this ) ); const Sequence< Reference< XTreeNode > > aNodes { rNode }; TreeDataModelEvent aEvent( xSource, aNodes, xParentNode ); -::cppu::OInterfaceIteratorHelper aListIter(*pIter); +comphelper::OInterfaceIteratorHelper4 aListIter(rGuard, maTreeDataModelListeners); while(aListIter.hasMoreElements()) { -XTreeDataModelListener* pListener = static_cast(aListIter.next()); +rGuard.unlock(); +XTreeDataModelListener* pListener = aListIter.next().get(); switch( eType ) { case nodes_changed: pListener->treeNodesChanged(aEvent); break; @@ -158,6 +168,7 @@ void MutableTreeDataModel::broadcast( broadcast_type eType, const Reference< XTr case nodes_removed: pListener->treeNodesRemoved(aEvent); break; case structure_changed: pListener->treeStructureChanged(aEvent); break; } +rGuard.lock(); } } @@ -171,7 +182,7 @@ void SAL_CALL MutableTreeDataModel::setRoot( const Reference< XMutableTreeNode > if( !xNode.is() ) throw IllegalArgumentException(); -::osl::Guard< ::osl::Mutex > aGuard( GetMutex() ); +std::unique_lock aGuard( m_aMutex ); if( xNode == mxRootNode ) return; @@ -190,46 +201,51 @@ void SAL_CALL MutableTreeDataModel::setRoot( const Reference< XMutableTreeNode > mxRootNode = xImpl; Reference< XTreeNode > xParentNode; -broadcast( structure_changed, xParentNode, mxRootNode ); +broadcastImpl( aGuard, structure_changed, xParentNode, mxRootNode ); } Reference< XTreeNode > SAL_CALL MutableTreeDataModel::getRoot( ) { -::osl::Guard< ::osl::Mutex > aGuard( GetMutex() ); +std::unique_lock aGuard( m_aMutex ); return mxRootNode; } void SAL_CALL MutableTreeDataModel::addTreeDataModelListener( const Reference< XTreeDataModelListener >& xListener ) { -m_aBHelper.addListener( cppu::UnoType::get(), xListener ); +std::unique_lock aGuard( m_aMutex ); +maTreeDataModelListeners.addInterface( aGuard, xListener ); } void SAL_CALL MutableTreeDataModel::removeTreeDataModelListener( const Reference< XTreeDataModelListener >& xListener ) { -m_aBHelper.removeListener( cppu::UnoType::get(), xListener ); +std::unique_lock aGuard( m_aMutex ); +maTreeDataModelListeners.removeInterface( aGuard, xListener ); } void
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/controls/grid/defaultgriddatamodel.cxx | 129 +- 1 file changed, 68 insertions(+), 61 deletions(-) New commits: commit 23d46176d6f206e62126e0b7c2afdc46456e50ad Author: Noel Grandin AuthorDate: Fri Feb 17 14:35:41 2023 +0200 Commit: Noel Grandin CommitDate: Sun Feb 19 10:46:39 2023 + osl::Mutex->std::mutex in DefaultGridDataModel Change-Id: Ib62f9e7040c8d7171a50ccfe937e35f060f94f95 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147265 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/toolkit/source/controls/grid/defaultgriddatamodel.cxx b/toolkit/source/controls/grid/defaultgriddatamodel.cxx index 2e5f4e305d29..3b803d4a2e39 100644 --- a/toolkit/source/controls/grid/defaultgriddatamodel.cxx +++ b/toolkit/source/controls/grid/defaultgriddatamodel.cxx @@ -23,11 +23,10 @@ #include #include -#include -#include -#include +#include #include #include +#include #include #include @@ -40,12 +39,11 @@ using namespace ::com::sun::star::lang; namespace { -typedef ::cppu::WeakComponentImplHelper< XMutableGridDataModel +typedef ::comphelper::WeakComponentImplHelper< XMutableGridDataModel , XServiceInfo > DefaultGridDataModel_Base; -class DefaultGridDataModel :public ::cppu::BaseMutex -,public DefaultGridDataModel_Base +class DefaultGridDataModel: public DefaultGridDataModel_Base { public: DefaultGridDataModel(); @@ -75,7 +73,7 @@ public: virtual css::uno::Sequence< css::uno::Any > SAL_CALL getRowData( ::sal_Int32 RowIndex ) override; // OComponentHelper -virtual void SAL_CALL disposing() override; +virtual void disposing( std::unique_lock& ) override; // XCloneable virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone( ) override; @@ -93,65 +91,60 @@ private: void broadcast( GridDataEvent const & i_event, void ( SAL_CALL css::awt::grid::XGridDataListener::*i_listenerMethod )( css::awt::grid::GridDataEvent const & ), -::comphelper::ComponentGuard & i_instanceLock +std::unique_lock& i_instanceLock ); -voidimpl_insertRow( sal_Int32 const i_position, Any const & i_heading, Sequence< Any > const & i_rowData, sal_Int32 const i_assumedColCount = -1 ); +voidimpl_insertRow( std::unique_lock& rGuard, sal_Int32 const i_position, Any const & i_heading, Sequence< Any > const & i_rowData, sal_Int32 const i_assumedColCount = -1 ); -::sal_Int32 impl_getRowCount_nolck() const { return sal_Int32( m_aData.size() ); } +::sal_Int32 impl_getRowCount(std::unique_lock&) const { return sal_Int32( m_aData.size() ); } -CellData const &impl_getCellData_throw( sal_Int32 const i_columnIndex, sal_Int32 const i_rowIndex ) const; -CellData& impl_getCellDataAccess_throw( sal_Int32 const i_columnIndex, sal_Int32 const i_rowIndex ); -RowData&impl_getRowDataAccess_throw( sal_Int32 const i_rowIndex, size_t const i_requiredColumnCount ); +CellData const &impl_getCellData_throw( std::unique_lock& rGuard, sal_Int32 const i_columnIndex, sal_Int32 const i_rowIndex ) const; +CellData& impl_getCellDataAccess_throw( std::unique_lock& rGuard, sal_Int32 const i_columnIndex, sal_Int32 const i_rowIndex ); +RowData&impl_getRowDataAccess_throw( std::unique_lock& rGuard, sal_Int32 const i_rowIndex, size_t const i_requiredColumnCount ); GridData m_aData; ::std::vector< css::uno::Any > m_aRowHeaders; sal_Int32 m_nColumnCount; +comphelper::OInterfaceContainerHelper4 maGridDataListeners; }; DefaultGridDataModel::DefaultGridDataModel() -:DefaultGridDataModel_Base( m_aMutex ) -,m_nColumnCount(0) +:m_nColumnCount(0) { } DefaultGridDataModel::DefaultGridDataModel( DefaultGridDataModel const & i_copySource ) -:cppu::BaseMutex() -,DefaultGridDataModel_Base( m_aMutex ) -,m_aData( i_copySource.m_aData ) +:m_aData( i_copySource.m_aData ) ,m_aRowHeaders( i_copySource.m_aRowHeaders ) ,m_nColumnCount( i_copySource.m_nColumnCount ) { } void DefaultGridDataModel::broadcast( GridDataEvent const & i_event, -void ( SAL_CALL XGridDataListener::*i_listenerMethod )( GridDataEvent const & ), ::comphelper::ComponentGuard & i_instanceLock ) +void ( SAL_CALL XGridDataListener::*i_listenerMethod )( GridDataEvent const & ), std::unique_lock& i_instanceLock ) { -::cppu::OInterfaceContainerHelper* pListeners = rBHelper.getContainer( cppu::UnoType::get() ); -if ( !pListeners ) -return; - -i_instanceLock.clear(); -pListeners->notifyEach( i_listenerMethod, i_event ); +maGridDataListeners.notifyEach( i_instanceLock,
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/controls/grid/defaultgridcolumnmodel.cxx | 37 toolkit/source/controls/grid/gridcolumn.cxx | 13 - toolkit/source/controls/grid/gridcolumn.hxx |6 -- 3 files changed, 11 insertions(+), 45 deletions(-) New commits: commit 0160109aae49189f5cc9bed60db3c7084003e471 Author: Noel Grandin AuthorDate: Fri Jan 13 15:20:34 2023 +0200 Commit: Noel Grandin CommitDate: Mon Jan 16 06:42:12 2023 + XUnoTunnel->dynamic_cast in GridColumn And use the concrete type in DefaultGridColumnModel, which already makes such an assumption Change-Id: I4c91d46f1889ebe22b6c031a8aabe4e8957addec Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145531 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/toolkit/source/controls/grid/defaultgridcolumnmodel.cxx b/toolkit/source/controls/grid/defaultgridcolumnmodel.cxx index 87b55be96ee2..64cf2a61b3e2 100644 --- a/toolkit/source/controls/grid/defaultgridcolumnmodel.cxx +++ b/toolkit/source/controls/grid/defaultgridcolumnmodel.cxx @@ -85,7 +85,7 @@ public: virtual void SAL_CALL disposing() override; private: -typedef ::std::vector< css::uno::Reference< css::awt::grid::XGridColumn > > Columns; +typedef ::std::vector< rtl::Reference< GridColumn > > Columns; ::comphelper::OInterfaceContainerHelper3 m_aContainerListeners; Columns m_aColumns; @@ -111,16 +111,9 @@ private: ++col ) { -Reference< css::util::XCloneable > const xCloneable( *col, UNO_QUERY_THROW ); -Reference< XGridColumn > const xClone( xCloneable->createClone(), UNO_QUERY_THROW ); +rtl::Reference< GridColumn > const xClone( new GridColumn(**col) ); -GridColumn* const pGridColumn = comphelper::getFromUnoTunnel( xClone ); -if ( pGridColumn == nullptr ) -throw RuntimeException( "invalid clone source implementation", *this ); -// that's indeed a RuntimeException, not an IllegalArgumentException or some such: -// a DefaultGridColumnModel implementation whose columns are not GridColumn implementations -// is borked. -pGridColumn->setIndex( col - i_copySource.m_aColumns.begin() ); +xClone->setIndex( col - i_copySource.m_aColumns.begin() ); aColumns.push_back( xClone ); } @@ -150,11 +143,11 @@ private: { ::comphelper::ComponentGuard aGuard( *this, rBHelper ); -GridColumn* const pGridColumn = comphelper::getFromUnoTunnel( i_column ); +GridColumn* const pGridColumn = dynamic_cast( i_column.get() ); if ( pGridColumn == nullptr ) throw css::lang::IllegalArgumentException( "invalid column implementation", *this, 1 ); -m_aColumns.push_back( i_column ); +m_aColumns.push_back( pGridColumn ); sal_Int32 index = m_aColumns.size() - 1; pGridColumn->setIndex( index ); @@ -189,13 +182,7 @@ private: ++updatePos, ++columnIndex ) { -GridColumn* pColumnImpl = comphelper::getFromUnoTunnel( *updatePos ); -if ( !pColumnImpl ) -{ -SAL_WARN( "toolkit.controls", "DefaultGridColumnModel::removeColumn: invalid column implementation!" ); -continue; -} - +GridColumn* pColumnImpl = updatePos->get(); pColumnImpl->setIndex( columnIndex ); } @@ -223,7 +210,7 @@ private: Sequence< Reference< XGridColumn > > SAL_CALL DefaultGridColumnModel::getColumns() { ::comphelper::ComponentGuard aGuard( *this, rBHelper ); -return ::comphelper::containerToSequence( m_aColumns ); +return ::comphelper::containerToSequence>( m_aColumns ); } @@ -254,7 +241,7 @@ private: ContainerEvent aEvent; aEvent.Source = *this; aEvent.Accessor <<= sal_Int32( lastColIndex ); -aEvent.Element <<= m_aColumns[ lastColIndex ]; +aEvent.Element <<= Reference(m_aColumns[ lastColIndex ]); aRemovedColumns.push_back( aEvent ); m_aColumns.erase( m_aColumns.begin() + lastColIndex ); @@ -264,7 +251,6 @@ private: for ( sal_Int32 i=0; i const pGridColumn = new GridColumn(); -Reference< XGridColumn > const xColumn( pGridColumn ); OUString colTitle = "Column " + OUString::number( i + 1 ); pGridColumn->setTitle( colTitle ); pGridColumn->setColumnWidth( 80 /* APPFONT */ ); @@ -275,10 +261,10 @@ private: ContainerEvent aEvent; aEvent.Source = *this; aEvent.Accessor <<= i; -aEvent.Element <<= xColumn;
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/controls/tree/treedatamodel.cxx | 31 - 1 file changed, 25 insertions(+), 6 deletions(-) New commits: commit 9abe8ee067e6c00f19d8a13346d53c4641c27166 Author: Stephan Bergmann AuthorDate: Thu Dec 1 15:16:32 2022 +0100 Commit: Stephan Bergmann CommitDate: Thu Dec 22 13:07:49 2022 + loplugin:unocast (MutableTreeNode) (See the upcoming commit introducing that loplugin:unocast on why such dynamic_casts from UNO types are dangerous.) Change-Id: I33fc079e2128c678ecc36567c2c5ed75481694c6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144752 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/toolkit/source/controls/tree/treedatamodel.cxx b/toolkit/source/controls/tree/treedatamodel.cxx index 090a6738f517..bf09ff269564 100644 --- a/toolkit/source/controls/tree/treedatamodel.cxx +++ b/toolkit/source/controls/tree/treedatamodel.cxx @@ -22,7 +22,9 @@ #include #include #include +#include #include +#include #include #include #include @@ -77,7 +79,8 @@ private: Reference< XTreeNode > mxRootNode; }; -class MutableTreeNode: public ::cppu::WeakAggImplHelper2< XMutableTreeNode, XServiceInfo > +class MutableTreeNode: +public ::cppu::WeakAggImplHelper3< XMutableTreeNode, XServiceInfo, css::lang::XUnoTunnel > { friend class MutableTreeDataModel; @@ -118,6 +121,9 @@ public: virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; virtual Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override; +sal_Int64 SAL_CALL getSomething(css::uno::Sequence const & aIdentifier) override; +static css::uno::Sequence const & getUnoTunnelId(); + private: TreeNodeVector maChildren; Any maDisplayValue; @@ -177,12 +183,13 @@ void SAL_CALL MutableTreeDataModel::setRoot( const Reference< XMutableTreeNode > if( mxRootNode.is() ) { -rtl::Reference< MutableTreeNode > xOldImpl( dynamic_cast< MutableTreeNode* >( mxRootNode.get() ) ); +rtl::Reference< MutableTreeNode > xOldImpl( comphelper::getFromUnoTunnel< MutableTreeNode >( mxRootNode ) ); if( xOldImpl.is() ) xOldImpl->mbIsInserted = false; } -rtl::Reference< MutableTreeNode > xImpl( dynamic_cast< MutableTreeNode* >( xNode.get() ) ); +rtl::Reference< MutableTreeNode > xImpl( +comphelper::getFromUnoTunnel< MutableTreeNode >( xNode ) ); if( !xImpl.is() || xImpl->mbIsInserted ) throw IllegalArgumentException(); @@ -302,7 +309,8 @@ void SAL_CALL MutableTreeNode::setDataValue( const Any& _datavalue ) void SAL_CALL MutableTreeNode::appendChild( const Reference< XMutableTreeNode >& xChildNode ) { std::unique_lock aGuard( maMutex ); -rtl::Reference< MutableTreeNode > xImpl( dynamic_cast< MutableTreeNode* >( xChildNode.get() ) ); +rtl::Reference< MutableTreeNode > xImpl( +comphelper::getFromUnoTunnel< MutableTreeNode >( xChildNode ) ); if( !xImpl.is() || xImpl->mbIsInserted || (this == xImpl.get()) ) throw IllegalArgumentException(); @@ -321,7 +329,8 @@ void SAL_CALL MutableTreeNode::insertChildByIndex( sal_Int32 nChildIndex, const if( (nChildIndex < 0) || (o3tl::make_unsigned(nChildIndex) > maChildren.size()) ) throw IndexOutOfBoundsException(); -rtl::Reference< MutableTreeNode > xImpl( dynamic_cast< MutableTreeNode* >( xChildNode.get() ) ); +rtl::Reference< MutableTreeNode > xImpl( +comphelper::getFromUnoTunnel< MutableTreeNode >( xChildNode ) ); if( !xImpl.is() || xImpl->mbIsInserted || (this == xImpl.get()) ) throw IllegalArgumentException(); @@ -451,7 +460,8 @@ sal_Int32 SAL_CALL MutableTreeNode::getIndex( const Reference< XTreeNode >& xNod { std::scoped_lock aGuard( maMutex ); -rtl::Reference< MutableTreeNode > xImpl( dynamic_cast< MutableTreeNode* >( xNode.get() ) ); +rtl::Reference< MutableTreeNode > xImpl( +comphelper::getFromUnoTunnel< MutableTreeNode >( xNode ) ); if( xImpl.is() ) { sal_Int32 nChildCount = maChildren.size(); @@ -511,6 +521,15 @@ Sequence< OUString > SAL_CALL MutableTreeNode::getSupportedServiceNames( ) return aSeq; } +sal_Int64 MutableTreeNode::getSomething(css::uno::Sequence const & aIdentifier) { +return comphelper::getSomethingImpl(aIdentifier, this); +} + +css::uno::Sequence const & MutableTreeNode::getUnoTunnelId() { +static comphelper::UnoIdInit const id; +return id.getSeq(); +} + } extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/awt/vclxaccessiblecomponent.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 55219f771cd4e255a079cb4272f640807c805e0f Author: Andrea Gelmini AuthorDate: Mon Sep 26 18:58:20 2022 +0200 Commit: Julien Nabet CommitDate: Mon Sep 26 20:16:04 2022 +0200 Fix typo Change-Id: I0a2bab10b739a5e2462f53826cc77dd25abd9959 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140625 Tested-by: Julien Nabet Reviewed-by: Julien Nabet diff --git a/toolkit/source/awt/vclxaccessiblecomponent.cxx b/toolkit/source/awt/vclxaccessiblecomponent.cxx index 5d3b15653ba3..7fbb1ea1ccd6 100644 --- a/toolkit/source/awt/vclxaccessiblecomponent.cxx +++ b/toolkit/source/awt/vclxaccessiblecomponent.cxx @@ -185,7 +185,7 @@ void VCLXAccessibleComponent::ProcessWindowChildEvent( const VclWindowEvent& rVc xAcc = GetChildAccessible( rVclWindowEvent ); if( xAcc.is() ) { -// send send state change event for SHOWING before sending the CHILD event below, +// send state change event for SHOWING before sending the CHILD event below, // since that one results in a11y event listeners getting removed uno::Reference xChildContext = xAcc->getAccessibleContext(); if (xChildContext.is())
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/controls/unocontrols.cxx | 26 ++ 1 file changed, 26 insertions(+) New commits: commit a3bbdfab809609bec3475613a918eda699fbdc29 Author: Noel Grandin AuthorDate: Fri Sep 16 16:05:30 2022 +0200 Commit: Caolán McNamara CommitDate: Fri Sep 16 22:14:07 2022 +0200 tdf#150974 Writer crashes when starting with WollMux installed regression from commit b2aa646ef09dc8434d3ca8a5bba53a8d8ff3f910 Author: Caolán McNamara Date: Wed Dec 15 11:43:32 2021 + use more OInterfaceContainerHelper3 in toolkit Change-Id: I26532ea79b7c5f750b4bf693881cbf41aeb82266 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140077 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/toolkit/source/controls/unocontrols.cxx b/toolkit/source/controls/unocontrols.cxx index 3bc095cf3f03..84fe8ce50774 100644 --- a/toolkit/source/controls/unocontrols.cxx +++ b/toolkit/source/controls/unocontrols.cxx @@ -270,11 +270,23 @@ void UnoEditControl::textChanged(const awt::TextEvent& e) void UnoEditControl::addTextListener(const uno::Reference< awt::XTextListener > & l) { +// tdf#150974 some extensions pass null +if (!l) +{ +SAL_WARN("toolkit", "null XTextListener"); +return; +} maTextListeners.addInterface( l ); } void UnoEditControl::removeTextListener(const uno::Reference< awt::XTextListener > & l) { +// tdf#150974 some extensions pass null +if (!l) +{ +SAL_WARN("toolkit", "null XTextListener"); +return; +} maTextListeners.removeInterface( l ); } @@ -767,6 +779,13 @@ void UnoButtonControl::createPeer( const uno::Reference< awt::XToolkit > & rxToo void UnoButtonControl::addActionListener(const uno::Reference< awt::XActionListener > & l) { +// tdf#150974 some extensions pass null +if (!l) +{ +SAL_WARN("toolkit", "null XActionListener"); +return; +} + maActionListeners.addInterface( l ); if( getPeer().is() && maActionListeners.getLength() == 1 ) { @@ -777,6 +796,13 @@ void UnoButtonControl::addActionListener(const uno::Reference< awt::XActionListe void UnoButtonControl::removeActionListener(const uno::Reference< awt::XActionListener > & l) { +// tdf#150974 some extensions pass null +if (!l) +{ +SAL_WARN("toolkit", "null XActionListener"); +return; +} + if( getPeer().is() && maActionListeners.getLength() == 1 ) { uno::Reference < awt::XButton > xButton( getPeer(), uno::UNO_QUERY );
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/awt/vclxwindows.cxx |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) New commits: commit 5d54cfab9e0eb3d98dfa1a39a60068b2d02c50da Author: Caolán McNamara AuthorDate: Thu Aug 11 17:16:42 2022 +0100 Commit: Caolán McNamara CommitDate: Fri Aug 12 10:15:24 2022 +0200 crashtesting: assert on export forum-fr-40415.ods to ods 0 is an invalid year Change-Id: I2c638e2e2c1db628b4014a04a1c26231c236075b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138152 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx index 15b7b3c146cf..24006671bb04 100644 --- a/toolkit/source/awt/vclxwindows.cxx +++ b/toolkit/source/awt/vclxwindows.cxx @@ -4809,7 +4809,7 @@ void VCLXDateField::setProperty( const OUString& PropertyName, const css::uno::A else { util::Date d; -if ( Value >>= d ) +if ((Value >>= d) && d.Year != 0) setDate( d ); } } @@ -4817,14 +4817,14 @@ void VCLXDateField::setProperty( const OUString& PropertyName, const css::uno::A case BASEPROPERTY_DATEMIN: { util::Date d; -if ( Value >>= d ) +if ((Value >>= d) && d.Year != 0) setMin( d ); } break; case BASEPROPERTY_DATEMAX: { util::Date d; -if ( Value >>= d ) +if ((Value >>= d) && d.Year != 0) setMax( d ); } break;
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/awt/vclxtabpagecontainer.cxx |2 ++ toolkit/source/controls/controlmodelcontainerbase.cxx |4 toolkit/source/controls/tabpagemodel.cxx |1 + 3 files changed, 7 insertions(+) New commits: commit 0f1837306ae5c2c2e10f256b872c46b0bfba00dd Author: Ilhan Yesil AuthorDate: Wed Jun 15 12:52:34 2022 +0200 Commit: Michael Weghorn CommitDate: Fri Jun 17 08:15:14 2022 +0200 tdf#149575 UnoControlTabPageContainer: Handle tab image Setting a tab page's image in the tab button is done via method 'XTabPageModel.setImageURL'. Change-Id: Ideb096f88037dac26abe90fccae2251dcce84659 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135900 Tested-by: Jenkins Reviewed-by: Michael Weghorn diff --git a/toolkit/source/awt/vclxtabpagecontainer.cxx b/toolkit/source/awt/vclxtabpagecontainer.cxx index 80124c9de868..18e12cdab488 100644 --- a/toolkit/source/awt/vclxtabpagecontainer.cxx +++ b/toolkit/source/awt/vclxtabpagecontainer.cxx @@ -224,6 +224,8 @@ void VCLXTabPageContainer::propertiesChange(const::css::uno::SequenceSetPageEnabled(nId, xTabPageModel->getEnabled()); } else if (rEvent.PropertyName == GetPropertyName(BASEPROPERTY_TITLE)) { pTabCtrl->SetPageText(nId, xTabPageModel->getTitle()); +} else if (rEvent.PropertyName == GetPropertyName(BASEPROPERTY_IMAGEURL)) { +pTabCtrl->SetPageImage(nId, TkResMgr::getImageFromURL(xTabPageModel->getImageURL())); } } } diff --git a/toolkit/source/controls/controlmodelcontainerbase.cxx b/toolkit/source/controls/controlmodelcontainerbase.cxx index 677d000f9e50..9099c65cc553 100644 --- a/toolkit/source/controls/controlmodelcontainerbase.cxx +++ b/toolkit/source/controls/controlmodelcontainerbase.cxx @@ -768,6 +768,10 @@ OUString SAL_CALL ControlModelContainerBase::getImageURL() void SAL_CALL ControlModelContainerBase::setImageURL( const OUString& _imageurl ) { m_sImageURL = _imageurl; +SolarMutexGuard aGuard; +Reference xThis(*this, UNO_QUERY); +xThis->setPropertyValue(GetPropertyName(BASEPROPERTY_IMAGEURL), Any(_imageurl)); + } OUString SAL_CALL ControlModelContainerBase::getToolTip() { diff --git a/toolkit/source/controls/tabpagemodel.cxx b/toolkit/source/controls/tabpagemodel.cxx index c82e54e417c6..cbfbebd78c51 100644 --- a/toolkit/source/controls/tabpagemodel.cxx +++ b/toolkit/source/controls/tabpagemodel.cxx @@ -52,6 +52,7 @@ UnoControlTabPageModel::UnoControlTabPageModel( Reference< XComponentContext > c ImplRegisterProperty( BASEPROPERTY_SCROLLHEIGHT ); ImplRegisterProperty( BASEPROPERTY_SCROLLTOP ); ImplRegisterProperty( BASEPROPERTY_SCROLLLEFT ); +ImplRegisterProperty( BASEPROPERTY_IMAGEURL ); } OUString SAL_CALL UnoControlTabPageModel::getImplementationName()
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/helper/unowrapper.cxx |6 ++ 1 file changed, 6 insertions(+) New commits: commit 4879f99b824036b3d409ed52f74dc3eb3b4949e4 Author: Samuel Mehrbrodt AuthorDate: Thu Jun 2 15:51:47 2022 +0200 Commit: Samuel Mehrbrodt CommitDate: Tue Jun 14 10:20:08 2022 +0200 Fix leak with stock widgets in a dialog from an extension When loading a dialog from XDL, buttons can have dlg:button-type="cancel" or dlg:button-type="help". These buttons might not have a peer when they are not referenced from the extension. In this case, they also weren't disposed when the dialog was disposed, leading to an abort on exit. Change-Id: I799d7535b766984fde47cafbe41ee6e89e476205 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135266 Tested-by: Jenkins Reviewed-by: Caolán McNamara Reviewed-by: Samuel Mehrbrodt diff --git a/toolkit/source/helper/unowrapper.cxx b/toolkit/source/helper/unowrapper.cxx index 6a12b915b4aa..080847154cb2 100644 --- a/toolkit/source/helper/unowrapper.cxx +++ b/toolkit/source/helper/unowrapper.cxx @@ -238,6 +238,12 @@ void UnoWrapper::WindowDestroyed( vcl::Window* pWindow ) css::uno::Reference< css::lang::XComponent > xComp = pClient->GetComponentInterface( false ); xComp->dispose(); } +else +{ +// We need it to dispose the child windows properly (even without window peer), +// otherwise the vcl::Window will be leaked. +pClient.disposeAndClear(); +} pChild = pNextChild; }
[Libreoffice-commits] core.git: toolkit/source vcl/qa
toolkit/source/helper/formpdfexport.cxx |8 ++ vcl/qa/cppunit/pdfexport/data/tdf148706.odt |binary vcl/qa/cppunit/pdfexport/pdfexport.cxx | 35 3 files changed, 43 insertions(+) New commits: commit 3bd7111fe29ce19a007915af87f1f9269d27d9ff Author: Xisco Fauli AuthorDate: Thu May 12 16:37:19 2022 +0200 Commit: Xisco Fauli CommitDate: Fri May 13 10:40:19 2022 +0200 tdf#148706: map value prop in numericfield to text Change-Id: Ifc37b0aa8dc657d7a7f05199c8132896d03eb437 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134240 Tested-by: Jenkins Reviewed-by: Xisco Fauli diff --git a/toolkit/source/helper/formpdfexport.cxx b/toolkit/source/helper/formpdfexport.cxx index 80008f03ca3b..1c7757553676 100644 --- a/toolkit/source/helper/formpdfexport.cxx +++ b/toolkit/source/helper/formpdfexport.cxx @@ -313,10 +313,18 @@ namespace toolkitform Any aText; static constexpr OUStringLiteral FM_PROP_TEXT = u"Text"; static constexpr OUStringLiteral FM_PROP_LABEL = u"Label"; +static constexpr OUStringLiteral FM_PROP_VALUE = u"Value"; if ( xPSI->hasPropertyByName( FM_PROP_TEXT ) ) aText = xModelProps->getPropertyValue( FM_PROP_TEXT ); else if ( xPSI->hasPropertyByName( FM_PROP_LABEL ) ) aText = xModelProps->getPropertyValue( FM_PROP_LABEL ); +else if ( xPSI->hasPropertyByName( FM_PROP_VALUE ) ) +{ +double aValue; +if (xModelProps->getPropertyValue( FM_PROP_VALUE ) >>= aValue) +aText <<= OUString::number(aValue); +} + if ( aText.hasValue() ) { if( ! (aText >>= Descriptor->Text) ) { SAL_WARN("toolkit.helper", "describePDFControl: unable to assign aText to Descriptor->Text"); diff --git a/vcl/qa/cppunit/pdfexport/data/tdf148706.odt b/vcl/qa/cppunit/pdfexport/data/tdf148706.odt new file mode 100644 index ..974bb97433f0 Binary files /dev/null and b/vcl/qa/cppunit/pdfexport/data/tdf148706.odt differ diff --git a/vcl/qa/cppunit/pdfexport/pdfexport.cxx b/vcl/qa/cppunit/pdfexport/pdfexport.cxx index 7aaa6c19631b..057b20ee2da8 100644 --- a/vcl/qa/cppunit/pdfexport/pdfexport.cxx +++ b/vcl/qa/cppunit/pdfexport/pdfexport.cxx @@ -610,6 +610,41 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf107018) CPPUNIT_ASSERT_EQUAL(OString("Pages"), pName->GetValue()); } +CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf148706) +{ +// Import the bugdoc and export as PDF. +aMediaDescriptor["FilterName"] <<= OUString("writer_pdf_Export"); +saveAsPDF(u"tdf148706.odt"); + +// Parse the export result with pdfium. +std::unique_ptr pPdfDocument = parseExport(); +CPPUNIT_ASSERT(pPdfDocument); + +// The document has one page. +CPPUNIT_ASSERT_EQUAL(1, pPdfDocument->getPageCount()); +std::unique_ptr pPdfPage = pPdfDocument->openPage(/*nIndex=*/0); +CPPUNIT_ASSERT(pPdfPage); + +// The page has one annotation. +CPPUNIT_ASSERT_EQUAL(1, pPdfPage->getAnnotationCount()); +std::unique_ptr pAnnot = pPdfPage->getAnnotation(0); + +CPPUNIT_ASSERT(pAnnot->hasKey("V")); +CPPUNIT_ASSERT_EQUAL(vcl::pdf::PDFObjectType::String, pAnnot->getValueType("V")); +OUString aV = pAnnot->getString("V"); + +// Without the fix in place, this test would have failed with +// - Expected: 1821.84 +// - Actual : +CPPUNIT_ASSERT_EQUAL(OUString("1821.84"), aV); + +CPPUNIT_ASSERT(pAnnot->hasKey("DV")); +CPPUNIT_ASSERT_EQUAL(vcl::pdf::PDFObjectType::String, pAnnot->getValueType("DV")); +OUString aDV = pAnnot->getString("DV"); + +CPPUNIT_ASSERT_EQUAL(OUString("1821.84"), aDV); +} + CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf107089) { vcl::filter::PDFDocument aDocument;
[Libreoffice-commits] core.git: toolkit/source vcl/qa vcl/source
toolkit/source/helper/formpdfexport.cxx |2 - vcl/qa/cppunit/pdfexport/pdfexport.cxx |3 + vcl/source/gdi/pdfwriter_impl.cxx | 50 +--- 3 files changed, 31 insertions(+), 24 deletions(-) New commits: commit f6d2f218ad0dd1f3817411c4eb42dffc5bea9bf5 Author: Xisco Fauli AuthorDate: Thu May 12 10:48:00 2022 +0200 Commit: Xisco Fauli CommitDate: Thu May 12 12:19:10 2022 +0200 related: tdf#148442: do not replace 'Yes' if onValue is empty Change-Id: I748422dfbe7a385f4206c5d129eb3091289a180d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134220 Tested-by: Jenkins Reviewed-by: Xisco Fauli diff --git a/toolkit/source/helper/formpdfexport.cxx b/toolkit/source/helper/formpdfexport.cxx index 7a88bcbbe171..bd9bd536840f 100644 --- a/toolkit/source/helper/formpdfexport.cxx +++ b/toolkit/source/helper/formpdfexport.cxx @@ -570,7 +570,6 @@ namespace toolkitform } catch(...) { -pCheckBoxWidget->OnValue = "On"; } } @@ -590,7 +589,6 @@ namespace toolkitform } catch(...) { -pRadioWidget->OnValue = "On"; } } diff --git a/vcl/qa/cppunit/pdfexport/pdfexport.cxx b/vcl/qa/cppunit/pdfexport/pdfexport.cxx index d2a39b31..329e294a4640 100644 --- a/vcl/qa/cppunit/pdfexport/pdfexport.cxx +++ b/vcl/qa/cppunit/pdfexport/pdfexport.cxx @@ -859,6 +859,7 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf148442) CPPUNIT_ASSERT_EQUAL(OString("Checkbox1"), pT->GetValue()); CPPUNIT_ASSERT_EQUAL(OString("Yes"), pAS->GetValue()); CPPUNIT_ASSERT(!pN->GetItems().count("ref")); +CPPUNIT_ASSERT(pN->GetItems().count("Yes")); } else if (nBtnCount == 2) { @@ -867,12 +868,14 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf148442) // Without the fix in place, this test would have failed here CPPUNIT_ASSERT(pN->GetItems().count("ref")); +CPPUNIT_ASSERT(!pN->GetItems().count("Yes")); } else { CPPUNIT_ASSERT_EQUAL(OString("Checkbox3"), pT->GetValue()); CPPUNIT_ASSERT_EQUAL(OString("Off"), pAS->GetValue()); CPPUNIT_ASSERT(pN->GetItems().count("ref")); +CPPUNIT_ASSERT(!pN->GetItems().count("Yes")); } } } diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index b7a2f381bd08..f017a93c7a35 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -4170,20 +4170,23 @@ bool PDFWriterImpl::emitWidgetAnnotations() if( rWidget.m_eType == PDFWriter::CheckBox ) { -auto app_it = rWidget.m_aAppearances.find( "N" ); -if( app_it != rWidget.m_aAppearances.end() ) +if ( !rWidget.m_aOnValue.isEmpty() ) { -auto stream_it = app_it->second.find( "Yes" ); -if( stream_it != app_it->second.end() ) +auto app_it = rWidget.m_aAppearances.find( "N" ); +if( app_it != rWidget.m_aAppearances.end() ) { -SvMemoryStream* pStream = stream_it->second; -app_it->second.erase( stream_it ); -OStringBuffer aBuf( rWidget.m_aOnValue.getLength()*2 ); -appendName( rWidget.m_aOnValue, aBuf ); -(app_it->second)[ aBuf.makeStringAndClear() ] = pStream; +auto stream_it = app_it->second.find( "Yes" ); +if( stream_it != app_it->second.end() ) +{ +SvMemoryStream* pStream = stream_it->second; +app_it->second.erase( stream_it ); +OStringBuffer aBuf( rWidget.m_aOnValue.getLength()*2 ); +appendName( rWidget.m_aOnValue, aBuf ); +(app_it->second)[ aBuf.makeStringAndClear() ] = pStream; +} +else +SAL_INFO("vcl.pdfwriter", "error: CheckBox without \"Yes\" stream" ); } -else -SAL_INFO("vcl.pdfwriter", "error: CheckBox without \"Yes\" stream" ); } } @@ -10715,20 +10718,23 @@ void PDFWriterImpl::ensureUniqueRadioOnValues() for (auto const& nKidIndex : rGroupWidget.m_aKidsIndex) { PDFWidget& rKid = m_aWidgets[nKidIndex]; -auto app_it = rKid.m_aAppearances.find( "N" ); -if( app_it != rKid.m_aAppearances.end() ) +if ( !rKid.m_aOnValue.isEmpty() ) { -auto stream_it = app_it->second.find( "Yes" ); -if( stream_it !=
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/awt/vclxtabpagecontainer.cxx |3 ++- toolkit/source/awt/vclxtoolkit.cxx |3 ++- toolkit/source/awt/vclxtopwindow.cxx|3 ++- toolkit/source/controls/controlmodelcontainerbase.cxx |3 ++- toolkit/source/controls/grid/defaultgridcolumnmodel.cxx |2 +- toolkit/source/controls/roadmapcontrol.cxx |6 +++--- toolkit/source/controls/tabpagecontainer.cxx|3 ++- toolkit/source/controls/tree/treedatamodel.cxx |7 --- toolkit/source/controls/unocontrols.cxx |6 +++--- 9 files changed, 21 insertions(+), 15 deletions(-) New commits: commit ab387593b9a9f5b23df55c12679118dddc8e181a Author: Stephan Bergmann AuthorDate: Tue May 3 14:39:50 2022 +0200 Commit: Stephan Bergmann CommitDate: Tue May 3 18:56:13 2022 +0200 Use o3tl::make_unsigned in some places ...where a signed and an unsigned value are compared, and the signed value has just been proven to be non-negative here Change-Id: I1a9832b5b8b5304fa011a3ed57996a8e3751388b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133760 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/toolkit/source/awt/vclxtabpagecontainer.cxx b/toolkit/source/awt/vclxtabpagecontainer.cxx index e5b74a7f5443..80124c9de868 100644 --- a/toolkit/source/awt/vclxtabpagecontainer.cxx +++ b/toolkit/source/awt/vclxtabpagecontainer.cxx @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -106,7 +107,7 @@ sal_Bool SAL_CALL VCLXTabPageContainer::isTabPageActive( ::sal_Int16 tabPageInde Reference< css::awt::tab::XTabPage > SAL_CALL VCLXTabPageContainer::getTabPage( ::sal_Int16 tabPageIndex ) { -return (tabPageIndex >= 0 && tabPageIndex < static_cast(m_aTabPages.size())) ? m_aTabPages[tabPageIndex] : nullptr; +return (tabPageIndex >= 0 && o3tl::make_unsigned(tabPageIndex) < m_aTabPages.size()) ? m_aTabPages[tabPageIndex] : nullptr; } Reference< css::awt::tab::XTabPage > SAL_CALL VCLXTabPageContainer::getTabPageByID( ::sal_Int16 tabPageID ) diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx index fde41f8a30d2..e73511960dea 100644 --- a/toolkit/source/awt/vclxtoolkit.cxx +++ b/toolkit/source/awt/vclxtoolkit.cxx @@ -52,6 +52,7 @@ #include #include #include +#include #include #include #include @@ -1971,7 +1972,7 @@ css::uno::Sequence< css::uno::Reference< css::awt::XWindowPeer > > VCLXToolkit:: if ( aDescr.ParentIndex == -1 ) aDescr.Parent = nullptr; -else if ( ( aDescr.ParentIndex >= 0 ) && ( aDescr.ParentIndex < static_cast(n) ) ) +else if ( ( aDescr.ParentIndex >= 0 ) && ( o3tl::make_unsigned(aDescr.ParentIndex) < n ) ) aDescr.Parent = aSeq.getConstArray()[aDescr.ParentIndex]; aSeq.getArray()[n] = createWindow( aDescr ); } diff --git a/toolkit/source/awt/vclxtopwindow.cxx b/toolkit/source/awt/vclxtopwindow.cxx index 7550ddca083e..db42fa80277f 100644 --- a/toolkit/source/awt/vclxtopwindow.cxx +++ b/toolkit/source/awt/vclxtopwindow.cxx @@ -31,6 +31,7 @@ #include #include +#include #include #include @@ -200,7 +201,7 @@ void SAL_CALL VCLXTopWindow::setDisplay( ::sal_Int32 _display ) { SolarMutexGuard aGuard; -if ( ( _display < 0 ) || ( _display >= static_cast(Application::GetScreenCount()) ) ) +if ( ( _display < 0 ) || ( o3tl::make_unsigned(_display) >= Application::GetScreenCount() ) ) throw IndexOutOfBoundsException(); SystemWindow* pWindow = VCLXContainer::GetAsDynamic(); diff --git a/toolkit/source/controls/controlmodelcontainerbase.cxx b/toolkit/source/controls/controlmodelcontainerbase.cxx index 8cf401c1752b..677d000f9e50 100644 --- a/toolkit/source/controls/controlmodelcontainerbase.cxx +++ b/toolkit/source/controls/controlmodelcontainerbase.cxx @@ -20,6 +20,7 @@ #include #include +#include #include #include #include @@ -820,7 +821,7 @@ void SAL_CALL ControlModelContainerBase::getGroup( sal_Int32 _nGroup, Sequence< implUpdateGroupStructure(); -if ( ( _nGroup < 0 ) || ( _nGroup >= static_cast(maGroups.size()) ) ) +if ( ( _nGroup < 0 ) || ( o3tl::make_unsigned(_nGroup) >= maGroups.size() ) ) { SAL_WARN("toolkit", "invalid argument and I am not allowed to throw exception!" ); _rGroup.realloc( 0 ); diff --git a/toolkit/source/controls/grid/defaultgridcolumnmodel.cxx b/toolkit/source/controls/grid/defaultgridcolumnmodel.cxx index 24eb0cb58bb0..ad17d15ea76d 100644 --- a/toolkit/source/controls/grid/defaultgridcolumnmodel.cxx +++ b/toolkit/source/controls/grid/defaultgridcolumnmodel.cxx @@ -231,7 +231,7 @@ private: { ::comphelper::ComponentGuard aGuard( *this, rBHelper ); -if ( index >=0 && index < static_cast(m_aColumns.size())) +if ( index >=0 &&
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/awt/vclxwindows.cxx|9 ++-- toolkit/source/controls/animatedimages.cxx| 16 toolkit/source/controls/controlmodelcontainerbase.cxx | 16 toolkit/source/controls/dialogcontrol.cxx | 34 - toolkit/source/controls/formattedcontrol.cxx |2 - toolkit/source/controls/grid/gridcolumn.hxx |2 - toolkit/source/controls/grid/gridcontrol.cxx | 18 - toolkit/source/controls/tabpagecontainer.cxx |6 +-- toolkit/source/controls/tkscrollbar.cxx | 16 toolkit/source/controls/tkspinbutton.cxx | 24 ++-- toolkit/source/controls/tree/treecontrol.cxx |2 - toolkit/source/controls/unocontrolcontainer.cxx |2 - toolkit/source/controls/unocontrols.cxx | 36 +- toolkit/source/hatchwindow/documentcloser.cxx |2 - 14 files changed, 92 insertions(+), 93 deletions(-) New commits: commit 87d368642c536880bd313a5993c30bfb9c250e9d Author: Stephan Bergmann AuthorDate: Tue May 3 13:37:34 2022 +0200 Commit: Stephan Bergmann CommitDate: Tue May 3 17:00:25 2022 +0200 Just use Any ctor instead of makeAny in toolkit Change-Id: I55115f115e98b00e199007da5c6d9ea44cf2bab0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133756 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx index 761cd10c2674..03de455a3feb 100644 --- a/toolkit/source/awt/vclxwindows.cxx +++ b/toolkit/source/awt/vclxwindows.cxx @@ -68,7 +68,6 @@ using ::com::sun::star::uno::Any; using ::com::sun::star::uno::Reference; -using ::com::sun::star::uno::makeAny; using ::com::sun::star::uno::RuntimeException; using ::com::sun::star::lang::EventObject; using ::com::sun::star::awt::ItemListEvent; @@ -157,7 +156,7 @@ namespace toolkit Any getButtonLikeFaceColor( const vcl::Window* _pWindow ) { Color nBackgroundColor = _pWindow->GetSettings().GetStyleSettings().GetFaceColor(); -return makeAny( sal_Int32(nBackgroundColor) ); +return Any( sal_Int32(nBackgroundColor) ); } static void adjustBooleanWindowStyle( const Any& _rValue, vcl::Window* _pWindow, WinBits _nBits, bool _bInverseSemantics ) @@ -2679,8 +2678,8 @@ uno::Sequence< beans::NamedValue > SAL_CALL VCLXMultiPage::getTabProps( sal_Int3 uno::Sequence< beans::NamedValue > props { -{ "Title",css::uno::makeAny(pTabControl->GetPageText( sal::static_int_cast< sal_uInt16 >( ID ) )) }, -{ "Position", css::uno::makeAny(pTabControl->GetPagePos( sal::static_int_cast< sal_uInt16 >( ID ) )) } +{ "Title",css::uno::Any(pTabControl->GetPageText( sal::static_int_cast< sal_uInt16 >( ID ) )) }, +{ "Position", css::uno::Any(pTabControl->GetPagePos( sal::static_int_cast< sal_uInt16 >( ID ) )) } }; return props; } @@ -6888,7 +6887,7 @@ void SVTXFormattedField::setProperty( const OUString& PropertyName, const css::u sal_Int32 nValue = 0; if (!(Value >>= nValue)) throw css::lang::IllegalArgumentException(); - SetValue(css::uno::makeAny(static_cast(nValue))); + SetValue(css::uno::Any(static_cast(nValue))); break; } diff --git a/toolkit/source/controls/animatedimages.cxx b/toolkit/source/controls/animatedimages.cxx index 8626bdd45156..99fd5df859ae 100644 --- a/toolkit/source/controls/animatedimages.cxx +++ b/toolkit/source/controls/animatedimages.cxx @@ -315,19 +315,19 @@ namespace toolkit { switch ( i_propertyId ) { case BASEPROPERTY_DEFAULTCONTROL: -return makeAny( OUString("com.sun.star.awt.AnimatedImagesControl") ); +return Any( OUString("com.sun.star.awt.AnimatedImagesControl") ); case BASEPROPERTY_BORDER: -return makeAny( css::awt::VisualEffect::NONE ); +return Any( css::awt::VisualEffect::NONE ); case BASEPROPERTY_STEP_TIME: -return makeAny( sal_Int32(100) ); +return Any( sal_Int32(100) ); case BASEPROPERTY_AUTO_REPEAT: -return makeAny( true ); +return Any( true ); case BASEPROPERTY_IMAGE_SCALE_MODE: -return makeAny( ImageScaleMode::NONE ); +return Any( ImageScaleMode::NONE ); default: return UnoControlModel::ImplGetDefaultValue( i_propertyId ); @@ -352,7 +352,7 @@ namespace toolkit { void SAL_CALL AnimatedImagesControlModel::setStepTime( ::sal_Int32 i_stepTime ) { -setPropertyValue( GetPropertyName( BASEPROPERTY_STEP_TIME ), makeAny( i_stepTime ) ); +setPropertyValue( GetPropertyName(
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/awt/vclxmenu.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit 7f6263c14bc062e858a3da3dd8c60ac8ddb1254e Author: Stephan Bergmann AuthorDate: Fri Mar 25 15:07:39 2022 +0100 Commit: Stephan Bergmann CommitDate: Mon Mar 28 08:38:02 2022 +0200 Operate on VCL Menu with SolarMutex locked ...as such VCL code presumably expects to only be called when SolarMutex is locked, but which is not necessarily the case here for the ~VCLXMenu UNO object destructor. (I ran into this with a tentative commit for tdf#147668 "Writer crashes shortly after loading document with LanguageTool extension active", which would have added DBG_TESTSOLARMUTEX() to some GtkSalMenu code indirectly called from within mpMenu.disposeAndClear() here, and where this VCLXMenu object was held by Java extension code, so the destructor call happened on some JVM asynchronous finalizer thread, outside any SolarMutex lock.) Change-Id: Ia2c3ebec837275cfdf1548f22cfa33f0752e8ef4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132125 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/toolkit/source/awt/vclxmenu.cxx b/toolkit/source/awt/vclxmenu.cxx index cbeb1ef7f810..3eda26c81236 100644 --- a/toolkit/source/awt/vclxmenu.cxx +++ b/toolkit/source/awt/vclxmenu.cxx @@ -57,6 +57,7 @@ VCLXMenu::~VCLXMenu() maPopupMenuRefs.clear(); if ( mpMenu ) { +SolarMutexGuard g; mpMenu->RemoveEventListener( LINK( this, VCLXMenu, MenuEventListener ) ); mpMenu.disposeAndClear(); }
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/awt/vclxmenu.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit e44b54a847672836253f56feab9d9ed2c11c0bc7 Author: Mike Kaganski AuthorDate: Sat Jan 8 19:31:51 2022 +0300 Commit: Mike Kaganski CommitDate: Sat Jan 8 18:52:16 2022 +0100 Fix build Commit 326351e2b342eae5ca0154b2ba303b937a696577 crossed with commit b37f9fbf05e16eb58eae40c6d900a4b9da2972db. Change-Id: I1a10641aa0324e6af25698bb52d82157898c45d1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128142 Tested-by: Julien Nabet Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/toolkit/source/awt/vclxmenu.cxx b/toolkit/source/awt/vclxmenu.cxx index 2e7e80636bf6..cbeb1ef7f810 100644 --- a/toolkit/source/awt/vclxmenu.cxx +++ b/toolkit/source/awt/vclxmenu.cxx @@ -822,7 +822,7 @@ VCLXMenu::getItemImage( void VCLXMenu::setUserValue(sal_uInt16 nItemId, void* nUserValue, MenuUserDataReleaseFunction aFunc) { SolarMutexGuard aSolarGuard; -::osl::Guard< ::osl::Mutex > aGuard( GetMutex() ); +std::unique_lock aGuard(maMutex); mpMenu->SetUserValue(nItemId, nUserValue, aFunc); } @@ -830,7 +830,7 @@ void VCLXMenu::setUserValue(sal_uInt16 nItemId, void* nUserValue, MenuUserDataRe void* VCLXMenu::getUserValue(sal_uInt16 nItemId) { SolarMutexGuard aSolarGuard; -::osl::Guard< ::osl::Mutex > aGuard( GetMutex() ); +std::unique_lock aGuard(maMutex); return mpMenu->GetUserValue(nItemId); }
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/hatchwindow/documentcloser.cxx | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) New commits: commit 6fa21fba91610723a5895f8375937f4183a42ec9 Author: Noel Grandin AuthorDate: Wed Dec 22 20:52:32 2021 +0200 Commit: Noel Grandin CommitDate: Mon Dec 27 20:22:00 2021 +0100 osl::Mutex->std::mutex in ODocumentCloser Change-Id: If4f4b144842cc3d37a200b9529b0a29b6d90a5e4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127595 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/toolkit/source/hatchwindow/documentcloser.cxx b/toolkit/source/hatchwindow/documentcloser.cxx index d33f8b147ea4..10cb6b37ecd6 100644 --- a/toolkit/source/hatchwindow/documentcloser.cxx +++ b/toolkit/source/hatchwindow/documentcloser.cxx @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include #include @@ -44,9 +44,9 @@ namespace { class ODocumentCloser : public ::cppu::WeakImplHelper< css::lang::XComponent, css::lang::XServiceInfo > { -::osl::Mutex m_aMutex; +std::mutex m_aMutex; css::uno::Reference< css::frame::XFrame > m_xFrame; - std::unique_ptr<::comphelper::OInterfaceContainerHelper3> m_pListenersContainer; // list of listeners + std::unique_ptr<::comphelper::OInterfaceContainerHelper4> m_pListenersContainer; // list of listeners bool m_bDisposed; @@ -141,7 +141,7 @@ IMPL_STATIC_LINK( MainThreadFrameCloserRequest, worker, void*, p, void ) ODocumentCloser::ODocumentCloser(const css::uno::Sequence< css::uno::Any >& aArguments) : m_bDisposed( false ) { -::osl::MutexGuard aGuard( m_aMutex ); +std::unique_lock aGuard( m_aMutex ); if ( !m_refCount ) throw uno::RuntimeException(); // the object must be refcounted already! @@ -164,14 +164,14 @@ ODocumentCloser::ODocumentCloser(const css::uno::Sequence< css::uno::Any >& aArg void SAL_CALL ODocumentCloser::dispose() { -::osl::MutexGuard aGuard( m_aMutex ); +std::unique_lock aGuard( m_aMutex ); if ( m_bDisposed ) throw lang::DisposedException(); lang::EventObject aSource( static_cast< ::cppu::OWeakObject* >(this) ); if ( m_pListenersContainer ) -m_pListenersContainer->disposeAndClear( aSource ); +m_pListenersContainer->disposeAndClear( aGuard, aSource ); // TODO: trigger a main thread execution to close the frame if ( m_xFrame.is() ) @@ -187,12 +187,12 @@ void SAL_CALL ODocumentCloser::dispose() void SAL_CALL ODocumentCloser::addEventListener( const uno::Reference< lang::XEventListener >& xListener ) { -::osl::MutexGuard aGuard( m_aMutex ); +std::unique_lock aGuard( m_aMutex ); if ( m_bDisposed ) throw lang::DisposedException(); // TODO if ( !m_pListenersContainer ) -m_pListenersContainer.reset( new ::comphelper::OInterfaceContainerHelper3( m_aMutex ) ); +m_pListenersContainer.reset( new ::comphelper::OInterfaceContainerHelper4() ); m_pListenersContainer->addInterface( xListener ); } @@ -200,7 +200,7 @@ void SAL_CALL ODocumentCloser::addEventListener( const uno::Reference< lang::XEv void SAL_CALL ODocumentCloser::removeEventListener( const uno::Reference< lang::XEventListener >& xListener ) { -::osl::MutexGuard aGuard( m_aMutex ); +std::unique_lock aGuard( m_aMutex ); if ( m_pListenersContainer ) m_pListenersContainer->removeInterface( xListener ); }
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/awt/vclxmenu.cxx | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) New commits: commit 54b80473f4a4b8ac3dfc1936b2214733474a3485 Author: Noel Grandin AuthorDate: Sat Dec 18 16:16:53 2021 +0200 Commit: Noel Grandin CommitDate: Sat Dec 18 16:28:15 2021 +0100 tdf#146286 Crash/hang calling context menu regression from commit b37f9fbf05e16eb58eae40c6d900a4b9da2972db osl::Mutex->std::mutex in VCLXMenu Change-Id: I60caa02f9d8bb40b7fcf8a1009aeeac6ff3a094c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127044 Tested-by: Julien Nabet Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/toolkit/source/awt/vclxmenu.cxx b/toolkit/source/awt/vclxmenu.cxx index 01e275aacf82..eca9de23fa12 100644 --- a/toolkit/source/awt/vclxmenu.cxx +++ b/toolkit/source/awt/vclxmenu.cxx @@ -479,16 +479,17 @@ sal_Int16 VCLXMenu::execute( sal_Int16 nFlags ) { SolarMutexGuard aSolarGuard; -std::unique_lock aGuard( maMutex ); - -sal_Int16 nRet = 0; -if ( mpMenu && IsPopupMenu() ) +auto pMenu = mpMenu; { -nRet = static_cast(mpMenu.get())->Execute( VCLUnoHelper::GetWindow( rxWindowPeer ), - VCLRectangle( rPos ), - static_cast(nFlags) | PopupMenuFlags::NoMouseUpClose ); +std::unique_lock aGuard( maMutex ); +if ( !mpMenu || !IsPopupMenu() ) +return 0; } -return nRet; +// cannot call this with mutex locked because it will call back into us +return static_cast(pMenu.get())->Execute( +VCLUnoHelper::GetWindow( rxWindowPeer ), +VCLRectangle( rPos ), +static_cast(nFlags) | PopupMenuFlags::NoMouseUpClose ); }
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/awt/vclxtoolkit.cxx |7 --- 1 file changed, 4 insertions(+), 3 deletions(-) New commits: commit 7a65f43709b2945cca935158c72c28dc77ba65b2 Author: Luboš Luňák AuthorDate: Fri Nov 12 13:14:23 2021 +0100 Commit: Luboš Luňák CommitDate: Fri Nov 12 13:18:36 2021 +0100 adapt to Sequence::operator[] non-const removal 5054202e71605cb4f10c798be76679 passed Gerrit before the changes and I submitted it only later after the changes. Change-Id: I251f50f417964f23e5e91aae6696df609fee9e14 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125098 Tested-by: Luboš Luňák Reviewed-by: Luboš Luňák diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx index 5991df78fddb..6c21a5b474f1 100644 --- a/toolkit/source/awt/vclxtoolkit.cxx +++ b/toolkit/source/awt/vclxtoolkit.cxx @@ -2550,12 +2550,13 @@ SAL_CALL VCLXToolkit::finishTrackingFontMappingUse() SolarMutexGuard aSolarGuard; OutputDevice::FontMappingUseData data = OutputDevice::FinishTrackingFontMappingUse(); css::uno::Sequence ret( data.size()); +css::awt::XFontMappingUseItem* retData = ret.getArray(); for( size_t i = 0; i < data.size(); ++i ) { -ret[ i ].originalFont = data[ i ].mOriginalFont; -ret[ i ].usedFonts = comphelper::arrayToSequence +retData[ i ].originalFont = data[ i ].mOriginalFont; +retData[ i ].usedFonts = comphelper::arrayToSequence (data[ i ].mUsedFonts.data(), data[ i ].mUsedFonts.size()); -ret[ i ].count = data[ i ].mCount; +retData[ i ].count = data[ i ].mCount; } return ret; }
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/awt/vclxfont.cxx |9 ++-- toolkit/source/controls/animatedimages.cxx|2 - toolkit/source/controls/controlmodelcontainerbase.cxx |2 - toolkit/source/controls/dialogcontrol.cxx | 35 -- toolkit/source/controls/formattedcontrol.cxx | 20 +- toolkit/source/controls/grid/gridcontrol.hxx |4 +- toolkit/source/controls/roadmapcontrol.cxx| 10 +++-- toolkit/source/controls/stdtabcontroller.cxx |3 + toolkit/source/controls/tabpagecontainer.cxx |7 +-- toolkit/source/controls/tabpagemodel.cxx | 18 ++--- toolkit/source/controls/tkscrollbar.cxx | 10 +++-- toolkit/source/controls/tree/treecontrol.hxx |2 - toolkit/source/controls/tree/treecontrolpeer.cxx |6 +-- toolkit/source/controls/unocontrolcontainer.cxx |7 ++- toolkit/source/controls/unocontrolcontainermodel.cxx |5 +- toolkit/source/controls/unocontrols.cxx |6 +-- 16 files changed, 68 insertions(+), 78 deletions(-) New commits: commit a8bf972230545cd0c0e5dcacb73f5fff804d22de Author: Mike Kaganski AuthorDate: Fri Oct 29 10:18:33 2021 +0300 Commit: Mike Kaganski CommitDate: Sun Oct 31 18:42:08 2021 +0100 Prepare for removal of non-const operator[] from Sequence in toolkit Change-Id: I10b3f696fdb0bff1781fb22ec560e1c6dfc10b9e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124401 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/toolkit/source/awt/vclxfont.cxx b/toolkit/source/awt/vclxfont.cxx index 2ae914cca2a7..66e5ba2bdc40 100644 --- a/toolkit/source/awt/vclxfont.cxx +++ b/toolkit/source/awt/vclxfont.cxx @@ -20,6 +20,8 @@ #include #include + +#include #include #include #include @@ -158,11 +160,8 @@ sal_Int32 VCLXFont::getStringWidthArray( const OUString& str, css::uno::Sequence pOutDev->SetFont( maFont ); std::vector aDXA; nRet = pOutDev->GetTextArray( str, ); -rDXArray = css::uno::Sequence( str.getLength() ); -for(int i = 0; i < str.getLength(); i++) -{ -rDXArray[i] = aDXA[i]; -} +// I don't know if size of aDXA is guaranteed same as length of str, so use arrayToSequence +rDXArray = comphelper::arrayToSequence(aDXA.data(), str.getLength()); pOutDev->SetFont( aOldFont ); } return nRet; diff --git a/toolkit/source/controls/animatedimages.cxx b/toolkit/source/controls/animatedimages.cxx index e70fd1ec0cc8..3e335a1a661f 100644 --- a/toolkit/source/controls/animatedimages.cxx +++ b/toolkit/source/controls/animatedimages.cxx @@ -126,7 +126,7 @@ public: { Sequence< OUString > aServices( AnimatedImagesControl_Base::getSupportedServiceNames() ); aServices.realloc( aServices.getLength() + 1 ); -aServices[ aServices.getLength() - 1 ] = "com.sun.star.awt.AnimatedImagesControl"; +aServices.getArray()[ aServices.getLength() - 1 ] = "com.sun.star.awt.AnimatedImagesControl"; return aServices; } diff --git a/toolkit/source/controls/controlmodelcontainerbase.cxx b/toolkit/source/controls/controlmodelcontainerbase.cxx index 96599f3089bb..1172ac5c99a8 100644 --- a/toolkit/source/controls/controlmodelcontainerbase.cxx +++ b/toolkit/source/controls/controlmodelcontainerbase.cxx @@ -867,7 +867,7 @@ void ControlModelContainerBase::implNotifyTabModelChange( const OUString& _rAcce aEvent.Source = *this; aEvent.Base <<= aEvent.Source; // the "base of the changes root" is also ourself aEvent.Changes.realloc( 1 );// exactly one change -aEvent.Changes[ 0 ].Accessor <<= _rAccessor; +aEvent.Changes.getArray()[ 0 ].Accessor <<= _rAccessor; std::vector< Reference< XInterface > > aChangeListeners( maChangeListeners.getElements() ); diff --git a/toolkit/source/controls/dialogcontrol.cxx b/toolkit/source/controls/dialogcontrol.cxx index 5c5df64850f8..cb5446e7a8ce 100644 --- a/toolkit/source/controls/dialogcontrol.cxx +++ b/toolkit/source/controls/dialogcontrol.cxx @@ -160,8 +160,9 @@ public: { auto s(ControlModelContainerBase::getSupportedServiceNames()); s.realloc(s.getLength() + 2); -s[s.getLength() - 2] = "com.sun.star.awt.UnoControlDialogModel"; -s[s.getLength() - 1] = "stardiv.vcl.controlmodel.Dialog"; +auto ps = s.getArray(); +ps[s.getLength() - 2] = "com.sun.star.awt.UnoControlDialogModel"; +ps[s.getLength() - 1] = "stardiv.vcl.controlmodel.Dialog"; return s; } }; @@ -509,15 +510,14 @@ void SAL_CALL UnoDialogControl::windowResized( const css::awt::WindowEvent& e ) // Remember that changes have been done by listener. No need to // update the position because of property change event. mbSizeModified = true; -Sequence< OUString > aProps( 2 ); -Sequence< Any >
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/awt/vclxtoolkit.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 9c289cfde6891eebac46270774ac5c16af093622 Author: Andrea Gelmini AuthorDate: Fri Sep 17 16:10:17 2021 +0200 Commit: Julien Nabet CommitDate: Sat Sep 18 10:12:07 2021 +0200 Fix typo Change-Id: I7ea6c37c264a90ec6dffa62aceebae9d353f7b46 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122265 Tested-by: Jenkins Reviewed-by: Julien Nabet diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx index f617c9bf8dee..6914d7125c9b 100644 --- a/toolkit/source/awt/vclxtoolkit.cxx +++ b/toolkit/source/awt/vclxtoolkit.cxx @@ -1701,7 +1701,7 @@ vcl::Window* VCLXToolkit::ImplCreateWindow( rtl::Reference* ppNewCom css::uno::Any anyHandle = xSystemDepParent->getWindowHandle(processIdSeq, SYSTEM_DEPENDENT_TYPE); // use sal_Int64 here to accommodate all int types -// uno::Any shift operator whill upcast if necessary +// uno::Any shift operator will upcast if necessary sal_Int64 nWindowHandle = 0; bool bXEmbed = false; @@ -1984,7 +1984,7 @@ css::uno::Reference< css::awt::XWindowPeer > VCLXToolkit::createSystemChild( con if ( nSystemType == SYSTEM_DEPENDENT_TYPE ) { // use sal_Int64 here to accommodate all int types -// uno::Any shift operator whill upcast if necessary +// uno::Any shift operator will upcast if necessary sal_Int64 nWindowHandle = 0; bool bXEmbed = false;
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/awt/vclxwindow1.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 4092e253318b19b12157c1d8298b1912d81b9143 Author: Andrea Gelmini AuthorDate: Fri Sep 17 16:10:18 2021 +0200 Commit: Julien Nabet CommitDate: Sat Sep 18 10:11:43 2021 +0200 Fix typo Change-Id: I49c7165ecde8f652ed68ba8f8dbd9ccbf44b3756 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122266 Tested-by: Jenkins Reviewed-by: Julien Nabet diff --git a/toolkit/source/awt/vclxwindow1.cxx b/toolkit/source/awt/vclxwindow1.cxx index 7c91d2234c72..7b7b7192f9db 100644 --- a/toolkit/source/awt/vclxwindow1.cxx +++ b/toolkit/source/awt/vclxwindow1.cxx @@ -45,7 +45,7 @@ void VCLXWindow::SetSystemParent_Impl(const css::uno::Any& rHandle) } // use sal_Int64 here to accommodate all int types -// uno::Any shift operator whill upcast if necessary +// uno::Any shift operator will upcast if necessary sal_Int64 nHandle = 0; bool bXEmbed = false; bool bThrow = false;
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/awt/stylesettings.cxx | 539 --- toolkit/source/awt/stylesettings.hxx | 19 - 2 files changed, 273 insertions(+), 285 deletions(-) New commits: commit 60e81b7ac33272a12e54c3d12dab8960ca8b071e Author: Noel Grandin AuthorDate: Mon Aug 23 20:02:14 2021 +0200 Commit: Noel Grandin CommitDate: Tue Aug 24 20:22:53 2021 +0200 remove pimpl from WindowStyleSettings Change-Id: If230f9f166365c83d478cab6149f95efad7b15f2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120954 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/toolkit/source/awt/stylesettings.cxx b/toolkit/source/awt/stylesettings.cxx index 6d6419090c38..359e59077049 100644 --- a/toolkit/source/awt/stylesettings.cxx +++ b/toolkit/source/awt/stylesettings.cxx @@ -24,7 +24,6 @@ #include -#include #include #include #include @@ -35,8 +34,6 @@ namespace toolkit { - - using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::RuntimeException; using ::com::sun::star::lang::DisposedException; @@ -45,24 +42,7 @@ namespace toolkit using ::com::sun::star::awt::XStyleChangeListener; -//= WindowStyleSettings_Data - -struct WindowStyleSettings_Data -{ -VCLXWindow* pOwningWindow; -::comphelper::OInterfaceContainerHelper2 aStyleChangeListeners; - -WindowStyleSettings_Data( ::osl::Mutex& i_rListenerMutex, VCLXWindow& i_rOwningWindow ) -: pOwningWindow( _rOwningWindow ) -,aStyleChangeListeners( i_rListenerMutex ) -{ -} - -DECL_LINK( OnWindowEvent, VclWindowEvent&, void ); -}; - - -IMPL_LINK( WindowStyleSettings_Data, OnWindowEvent, VclWindowEvent&, rEvent, void ) +IMPL_LINK( WindowStyleSettings, OnWindowEvent, VclWindowEvent&, rEvent, void ) { if ( rEvent.GetId() != VclEventId::WindowDataChanged ) return; @@ -84,9 +64,9 @@ namespace toolkit class StyleMethodGuard { public: -explicit StyleMethodGuard( WindowStyleSettings_Data const & i_rData ) +explicit StyleMethodGuard( VCLXWindow* pOwningWindow ) { -if ( i_rData.pOwningWindow == nullptr ) +if ( pOwningWindow == nullptr ) throw DisposedException(); } @@ -100,12 +80,13 @@ namespace toolkit WindowStyleSettings::WindowStyleSettings(::osl::Mutex& i_rListenerMutex, VCLXWindow& i_rOwningWindow ) -:m_pData( new WindowStyleSettings_Data(i_rListenerMutex, i_rOwningWindow ) ) +: pOwningWindow( _rOwningWindow ) +,aStyleChangeListeners( i_rListenerMutex ) { VclPtr pWindow = i_rOwningWindow.GetWindow(); if ( !pWindow ) throw RuntimeException(); -pWindow->AddEventListener( LINK( m_pData.get(), WindowStyleSettings_Data, OnWindowEvent ) ); +pWindow->AddEventListener( LINK( this, WindowStyleSettings, OnWindowEvent ) ); } @@ -116,289 +97,285 @@ namespace toolkit void WindowStyleSettings::dispose() { -StyleMethodGuard aGuard( *m_pData ); +StyleMethodGuard aGuard( pOwningWindow ); -VclPtr pWindow = m_pData->pOwningWindow->GetWindow(); +VclPtr pWindow = pOwningWindow->GetWindow(); OSL_ENSURE( pWindow, "WindowStyleSettings::dispose: window has been reset before we could revoke the listener!" ); if ( pWindow ) -pWindow->RemoveEventListener( LINK( m_pData.get(), WindowStyleSettings_Data, OnWindowEvent ) ); +pWindow->RemoveEventListener( LINK( this, WindowStyleSettings, OnWindowEvent ) ); EventObject aEvent( *this ); -m_pData->aStyleChangeListeners.disposeAndClear( aEvent ); +aStyleChangeListeners.disposeAndClear( aEvent ); -m_pData->pOwningWindow = nullptr; +pOwningWindow = nullptr; } -namespace +sal_Int32 WindowStyleSettings::ImplGetStyleColor( Color const & (StyleSettings::*i_pGetter)() const ) { -sal_Int32 lcl_getStyleColor( WindowStyleSettings_Data const & i_rData, Color const & (StyleSettings::*i_pGetter)() const ) -{ -const VclPtr& pWindow = i_rData.pOwningWindow->GetWindow(); -const AllSettings aAllSettings = pWindow->GetSettings(); -const StyleSettings& aStyleSettings = aAllSettings.GetStyleSettings(); -return sal_Int32((aStyleSettings.*i_pGetter)()); -} - -void lcl_setStyleColor( WindowStyleSettings_Data const & i_rData, void (StyleSettings::*i_pSetter)( Color const & ), sal_Int32 i_nColor ) -{ -VclPtr pWindow = i_rData.pOwningWindow->GetWindow(); -AllSettings aAllSettings = pWindow->GetSettings(); -StyleSettings aStyleSettings = aAllSettings.GetStyleSettings(); -(aStyleSettings.*i_pSetter)( Color(ColorTransparency, i_nColor) ); -
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/controls/tree/treedatamodel.cxx | 18 +- 1 file changed, 5 insertions(+), 13 deletions(-) New commits: commit 854ba4bf47f713f5c82525a9000439c5c44e66b2 Author: Noel Grandin AuthorDate: Tue Aug 3 20:32:52 2021 +0200 Commit: Noel Grandin CommitDate: Wed Aug 4 08:42:52 2021 +0200 getReference is unnecessary Change-Id: I156c2e6dc714468f6af42f5c0f7cae923aec175c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119948 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/toolkit/source/controls/tree/treedatamodel.cxx b/toolkit/source/controls/tree/treedatamodel.cxx index 444f2ff1dc1a..7ccfc949d034 100644 --- a/toolkit/source/controls/tree/treedatamodel.cxx +++ b/toolkit/source/controls/tree/treedatamodel.cxx @@ -117,11 +117,6 @@ public: virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; virtual Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override; -static Reference< XTreeNode > getReference( MutableTreeNode* pNode ) -{ -return Reference< XTreeNode >( pNode ); -} - private: TreeNodeVector maChildren; Any maDisplayValue; @@ -276,9 +271,7 @@ void MutableTreeNode::broadcast_changes() { if( mxModel.is() ) { -Reference< XTreeNode > xParent( getReference( mpParent ) ); -Reference< XTreeNode > xNode( getReference( this ) ); -mxModel->broadcast( nodes_changed, xParent, xNode ); +mxModel->broadcast( nodes_changed, mpParent, this ); } } @@ -286,8 +279,7 @@ void MutableTreeNode::broadcast_changes(const Reference< XTreeNode >& xNode, boo { if( mxModel.is() ) { -Reference< XTreeNode > xParent( getReference( this ) ); -mxModel->broadcast( bNew ? nodes_inserted : nodes_removed, xParent, xNode ); +mxModel->broadcast( bNew ? nodes_inserted : nodes_removed, this, xNode ); } } @@ -361,7 +353,7 @@ void SAL_CALL MutableTreeNode::removeChildByIndex( sal_Int32 nChildIndex ) xImpl->setParent(nullptr); xImpl->mbIsInserted = false; -broadcast_changes( getReference( xImpl.get() ), false ); +broadcast_changes( xImpl, false ); } void SAL_CALL MutableTreeNode::setHasChildrenOnDemand( sal_Bool bChildrenOnDemand ) @@ -436,7 +428,7 @@ Reference< XTreeNode > SAL_CALL MutableTreeNode::getChildAt( sal_Int32 nChildInd if( (nChildIndex < 0) || (nChildIndex >= static_cast(maChildren.size())) ) throw IndexOutOfBoundsException(); -return getReference( maChildren[nChildIndex].get() ); +return maChildren[nChildIndex]; } sal_Int32 SAL_CALL MutableTreeNode::getChildCount( ) @@ -448,7 +440,7 @@ sal_Int32 SAL_CALL MutableTreeNode::getChildCount( ) Reference< XTreeNode > SAL_CALL MutableTreeNode::getParent( ) { std::scoped_lock aGuard( maMutex ); -return getReference( mpParent ); +return mpParent; } sal_Int32 SAL_CALL MutableTreeNode::getIndex( const Reference< XTreeNode >& xNode )
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/controls/tree/treedatamodel.cxx | 41 - 1 file changed, 21 insertions(+), 20 deletions(-) New commits: commit f7ee6baa1b14410fa79aac5dd9d6877df44a823a Author: Noel Grandin AuthorDate: Tue Aug 3 20:30:52 2021 +0200 Commit: Noel Grandin CommitDate: Wed Aug 4 08:42:35 2021 +0200 osl::Mutex->std::mutex in MutableTreeNode Change-Id: Iee3a1cfb70b99132810324177ab8e77b478e0c50 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119947 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/toolkit/source/controls/tree/treedatamodel.cxx b/toolkit/source/controls/tree/treedatamodel.cxx index 73aea80a53ea..444f2ff1dc1a 100644 --- a/toolkit/source/controls/tree/treedatamodel.cxx +++ b/toolkit/source/controls/tree/treedatamodel.cxx @@ -26,6 +26,7 @@ #include #include #include +#include using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -126,7 +127,7 @@ private: Any maDisplayValue; Any maDataValue; bool mbHasChildrenOnDemand; -::osl::Mutex maMutex; +std::mutex maMutex; MutableTreeNode* mpParent; MutableTreeDataModelRef mxModel; OUString maNodeGraphicURL; @@ -292,19 +293,19 @@ void MutableTreeNode::broadcast_changes(const Reference< XTreeNode >& xNode, boo Any SAL_CALL MutableTreeNode::getDataValue() { -::osl::Guard< ::osl::Mutex > aGuard( maMutex ); +std::scoped_lock aGuard( maMutex ); return maDataValue; } void SAL_CALL MutableTreeNode::setDataValue( const Any& _datavalue ) { -::osl::Guard< ::osl::Mutex > aGuard( maMutex ); +std::scoped_lock aGuard( maMutex ); maDataValue = _datavalue; } void SAL_CALL MutableTreeNode::appendChild( const Reference< XMutableTreeNode >& xChildNode ) { -::osl::Guard< ::osl::Mutex > aGuard( maMutex ); +std::scoped_lock aGuard( maMutex ); MutableTreeNodeRef xImpl( dynamic_cast< MutableTreeNode* >( xChildNode.get() ) ); if( !xImpl.is() || xImpl->mbIsInserted || (this == xImpl.get()) ) @@ -319,7 +320,7 @@ void SAL_CALL MutableTreeNode::appendChild( const Reference< XMutableTreeNode >& void SAL_CALL MutableTreeNode::insertChildByIndex( sal_Int32 nChildIndex, const Reference< XMutableTreeNode >& xChildNode ) { -::osl::Guard< ::osl::Mutex > aGuard( maMutex ); +std::scoped_lock aGuard( maMutex ); if( (nChildIndex < 0) || (nChildIndex > static_cast(maChildren.size())) ) throw IndexOutOfBoundsException(); @@ -341,7 +342,7 @@ void SAL_CALL MutableTreeNode::insertChildByIndex( sal_Int32 nChildIndex, const void SAL_CALL MutableTreeNode::removeChildByIndex( sal_Int32 nChildIndex ) { -::osl::Guard< ::osl::Mutex > aGuard( maMutex ); +std::scoped_lock aGuard( maMutex ); if( (nChildIndex < 0) || (nChildIndex >= static_cast(maChildren.size())) ) throw IndexOutOfBoundsException(); @@ -368,7 +369,7 @@ void SAL_CALL MutableTreeNode::setHasChildrenOnDemand( sal_Bool bChildrenOnDeman bool bChanged; { -::osl::Guard< ::osl::Mutex > aGuard( maMutex ); +std::scoped_lock aGuard( maMutex ); bChanged = mbHasChildrenOnDemand != bool(bChildrenOnDemand); mbHasChildrenOnDemand = bChildrenOnDemand; } @@ -380,7 +381,7 @@ void SAL_CALL MutableTreeNode::setHasChildrenOnDemand( sal_Bool bChildrenOnDeman void SAL_CALL MutableTreeNode::setDisplayValue( const Any& aValue ) { { -::osl::Guard< ::osl::Mutex > aGuard( maMutex ); +std::scoped_lock aGuard( maMutex ); maDisplayValue = aValue; } @@ -392,7 +393,7 @@ void SAL_CALL MutableTreeNode::setNodeGraphicURL( const OUString& rURL ) bool bChanged; { -::osl::Guard< ::osl::Mutex > aGuard( maMutex ); +std::scoped_lock aGuard( maMutex ); bChanged = maNodeGraphicURL != rURL; maNodeGraphicURL = rURL; } @@ -406,7 +407,7 @@ void SAL_CALL MutableTreeNode::setExpandedGraphicURL( const OUString& rURL ) bool bChanged; { -::osl::Guard< ::osl::Mutex > aGuard( maMutex ); +std::scoped_lock aGuard( maMutex ); bChanged = maExpandedGraphicURL != rURL; maExpandedGraphicURL = rURL; } @@ -420,7 +421,7 @@ void SAL_CALL MutableTreeNode::setCollapsedGraphicURL( const OUString& rURL ) bool bChanged; { -::osl::Guard< ::osl::Mutex > aGuard( maMutex ); +std::scoped_lock aGuard( maMutex ); bChanged = maCollapsedGraphicURL != rURL; maCollapsedGraphicURL = rURL; } @@ -431,7 +432,7 @@ void SAL_CALL MutableTreeNode::setCollapsedGraphicURL( const OUString& rURL ) Reference< XTreeNode > SAL_CALL MutableTreeNode::getChildAt( sal_Int32 nChildIndex ) { -::osl::Guard< ::osl::Mutex > aGuard( maMutex ); +std::scoped_lock aGuard( maMutex ); if( (nChildIndex < 0) || (nChildIndex >= static_cast(maChildren.size())) ) throw IndexOutOfBoundsException(); @@ -440,19 +441,19 @@
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/controls/dialogcontrol.cxx | 33 -- 1 file changed, 18 insertions(+), 15 deletions(-) New commits: commit e8d4f0df075a7033dffa9f6a255d99cf595d1ad3 Author: Noel Grandin AuthorDate: Tue Aug 3 20:44:51 2021 +0200 Commit: Noel Grandin CommitDate: Wed Aug 4 08:41:26 2021 +0200 osl::Mutex->std::mutex in SimpleNamedThingContainer Change-Id: I051cd746cc44cc0929ccd0d43934ae3f16bdafc4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119951 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/toolkit/source/controls/dialogcontrol.cxx b/toolkit/source/controls/dialogcontrol.cxx index 3b5b66b74126..fcfa50b4e4ea 100644 --- a/toolkit/source/controls/dialogcontrol.cxx +++ b/toolkit/source/controls/dialogcontrol.cxx @@ -23,7 +23,6 @@ #include #include -#include #include #include #include @@ -50,6 +49,7 @@ #include #include #include "controlmodelcontainerbase_internal.hxx" +#include using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -73,40 +73,43 @@ template< typename T > class SimpleNamedThingContainer : public ::cppu::WeakImplHelper< container::XNameContainer > { std::unordered_map< OUString, Reference< T > > things; -::osl::Mutex m_aMutex; +std::mutex m_aMutex; public: // css::container::XNameContainer, XNameReplace, XNameAccess virtual void SAL_CALL replaceByName( const OUString& aName, const Any& aElement ) override { -::osl::MutexGuard aGuard( m_aMutex ); -if ( !hasByName( aName ) ) +std::scoped_lock aGuard( m_aMutex ); +auto it = things.find( aName ); +if ( it == things.end() ) throw NoSuchElementException(); Reference< T > xElement; if ( ! ( aElement >>= xElement ) ) throw IllegalArgumentException(); -things[ aName ] = xElement; +it->second = xElement; } virtual Any SAL_CALL getByName( const OUString& aName ) override { -::osl::MutexGuard aGuard( m_aMutex ); -if ( !hasByName( aName ) ) +std::scoped_lock aGuard( m_aMutex ); +auto it = things.find( aName ); +if ( it == things.end() ) throw NoSuchElementException(); -return uno::makeAny( things[ aName ] ); +return uno::makeAny( it->second ); } virtual Sequence< OUString > SAL_CALL getElementNames( ) override { -::osl::MutexGuard aGuard( m_aMutex ); +std::scoped_lock aGuard( m_aMutex ); return comphelper::mapKeysToSequence( things ); } virtual sal_Bool SAL_CALL hasByName( const OUString& aName ) override { -::osl::MutexGuard aGuard( m_aMutex ); +std::scoped_lock aGuard( m_aMutex ); return ( things.find( aName ) != things.end() ); } virtual void SAL_CALL insertByName( const OUString& aName, const Any& aElement ) override { -::osl::MutexGuard aGuard( m_aMutex ); -if ( hasByName( aName ) ) +std::scoped_lock aGuard( m_aMutex ); +auto it = things.find( aName ); +if ( it != things.end() ) throw ElementExistException(); Reference< T > xElement; if ( ! ( aElement >>= xElement ) ) @@ -115,7 +118,7 @@ public: } virtual void SAL_CALL removeByName( const OUString& aName ) override { -::osl::MutexGuard aGuard( m_aMutex ); +std::scoped_lock aGuard( m_aMutex ); if ( things.erase( aName ) == 0 ) throw NoSuchElementException(); } @@ -125,8 +128,8 @@ public: } virtual sal_Bool SAL_CALL hasElements( ) override { -::osl::MutexGuard aGuard( m_aMutex ); -return ( !things.empty() ); +std::scoped_lock aGuard( m_aMutex ); +return !things.empty(); } };
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/controls/formattedcontrol.cxx | 46 +-- 1 file changed, 17 insertions(+), 29 deletions(-) New commits: commit 1082943bd8ab8174f0256f41b0d417950060e240 Author: Noel Grandin AuthorDate: Tue Aug 3 20:40:26 2021 +0200 Commit: Noel Grandin CommitDate: Wed Aug 4 08:40:47 2021 +0200 osl::Mutex->std::mutex in getDefaultFormats Change-Id: I884416cae7d968f1869fb949eb81ab378573a4dd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119950 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/toolkit/source/controls/formattedcontrol.cxx b/toolkit/source/controls/formattedcontrol.cxx index d2acd9c2e17d..2a24c23c53b7 100644 --- a/toolkit/source/controls/formattedcontrol.cxx +++ b/toolkit/source/controls/formattedcontrol.cxx @@ -31,6 +31,7 @@ #include #include +#include namespace toolkit { @@ -46,61 +47,48 @@ namespace toolkit namespace { -::osl::Mutex& getDefaultFormatsMutex() +std::mutex& getDefaultFormatsMutex() { -static ::osl::Mutex s_aDefaultFormatsMutex; +static std::mutex s_aDefaultFormatsMutex; return s_aDefaultFormatsMutex; } - -Reference< XNumberFormatsSupplier >& lcl_getDefaultFormatsAccess_nothrow() -{ -static Reference< XNumberFormatsSupplier > s_xDefaultFormats; -return s_xDefaultFormats; -} - - +Reference< XNumberFormatsSupplier > s_xDefaultFormats; bool s_bTriedCreation = false; +oslInterlockedCount s_refCount(0); const Reference< XNumberFormatsSupplier >& lcl_getDefaultFormats_throw() { -::osl::MutexGuard aGuard( getDefaultFormatsMutex() ); +std::scoped_lock aGuard( getDefaultFormatsMutex() ); -Reference< XNumberFormatsSupplier >& rDefaultFormats( lcl_getDefaultFormatsAccess_nothrow() ); -if ( !rDefaultFormats.is() && !s_bTriedCreation ) +if ( !s_xDefaultFormats.is() && !s_bTriedCreation ) { s_bTriedCreation = true; -rDefaultFormats = NumberFormatsSupplier::createWithDefaultLocale( ::comphelper::getProcessComponentContext() ); +s_xDefaultFormats = NumberFormatsSupplier::createWithDefaultLocale( ::comphelper::getProcessComponentContext() ); } -if ( !rDefaultFormats.is() ) +if ( !s_xDefaultFormats.is() ) throw RuntimeException(); -return rDefaultFormats; +return s_xDefaultFormats; } - -oslInterlockedCount s_refCount(0); - - voidlcl_registerDefaultFormatsClient() { osl_atomic_increment( _refCount ); } - voidlcl_revokeDefaultFormatsClient() { -::osl::ClearableMutexGuard aGuard( getDefaultFormatsMutex() ); -if ( 0 == osl_atomic_decrement( _refCount ) ) +Reference< XNumberFormatsSupplier > xReleasePotentialLastReference; { -Reference< XNumberFormatsSupplier >& rDefaultFormats( lcl_getDefaultFormatsAccess_nothrow() ); -Reference< XNumberFormatsSupplier > xReleasePotentialLastReference( rDefaultFormats ); -rDefaultFormats.clear(); -s_bTriedCreation = false; +std::scoped_lock aGuard( getDefaultFormatsMutex() ); +if ( 0 != osl_atomic_decrement( _refCount ) ) +return; -aGuard.clear(); -xReleasePotentialLastReference.clear(); +xReleasePotentialLastReference = std::move(s_xDefaultFormats); +s_bTriedCreation = false; } +xReleasePotentialLastReference.clear(); } }
[Libreoffice-commits] core.git: toolkit/source tools/source unotools/source vcl/source vcl/unx writerfilter/source xmlsecurity/source
toolkit/source/controls/geometrycontrolmodel.cxx | 31 +++- tools/source/stream/strmunx.cxx | 10 ++--- unotools/source/config/useroptions.cxx|9 +--- unotools/source/i18n/localedatawrapper.cxx| 20 ++ unotools/source/ucbhelper/tempfile.cxx|7 +-- vcl/source/control/imp_listbox.cxx| 18 +++-- vcl/source/filter/graphicfilter.cxx |6 +-- vcl/source/font/font.cxx | 10 +++-- vcl/source/gdi/graph.cxx |9 +--- vcl/source/gdi/jobset.cxx | 12 +++--- vcl/source/gdi/mapmod.cxx | 12 +++--- vcl/source/helper/canvasbitmap.cxx| 17 + vcl/source/window/errinf.cxx | 33 +- vcl/unx/generic/printer/ppdparser.cxx | 13 --- writerfilter/source/dmapper/TagLogger.cxx | 11 +- xmlsecurity/source/component/certificatecontainer.cxx | 22 +--- 16 files changed, 91 insertions(+), 149 deletions(-) New commits: commit 6c7d6924511f3006f64fb9d3eadd289778098571 Author: Noel Grandin AuthorDate: Thu Jul 29 11:22:28 2021 +0200 Commit: Noel Grandin CommitDate: Thu Jul 29 14:35:44 2021 +0200 rtl::Static -> static local in a handful cases, like a map or a vector, we don't need init on demand at all, the default constructor can be laid out at compile time Change-Id: I2d404584b5aa23db7b1f779e160e04e72dd2aa74 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119656 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/toolkit/source/controls/geometrycontrolmodel.cxx b/toolkit/source/controls/geometrycontrolmodel.cxx index 53a7f02d45ef..ee6dfb6d2a07 100644 --- a/toolkit/source/controls/geometrycontrolmodel.cxx +++ b/toolkit/source/controls/geometrycontrolmodel.cxx @@ -21,7 +21,6 @@ #include #include #include -#include #include #include #include @@ -438,15 +437,15 @@ typedef std::vector< ::std::vector< sal_Int32 > > IntArrayArray; // for creating class-unique PropertySetInfo's, we need some info: -namespace { struct ServiceSpecifierMap : public rtl::Static< HashMapString2Int, ServiceSpecifierMap > {}; } +namespace { HashMapString2Int gServiceSpecifierMap; } // this one maps from a String, which is the service specifier for our // aggregate, to a unique id -namespace { struct AggregateProperties : public rtl::Static< PropSeqArray, AggregateProperties > {}; } +namespace { PropSeqArray gAggregateProperties; } // this one contains the properties which belong to all the unique ids // in ServiceSpecifierMap -namespace { struct AmbiguousPropertyIds : public rtl::Static< IntArrayArray, AmbiguousPropertyIds > {}; } +namespace { IntArrayArray gAmbiguousPropertyIds; } // the ids of the properties which we as well as our aggregate supply // For such props, we let our base class handle them, and whenever such // a prop is set, we forward this to our aggregate. @@ -470,16 +469,14 @@ throw IllegalArgumentException(); } -HashMapString2Int = ServiceSpecifierMap::get(); -HashMapString2Int::iterator aPropMapIdPos = rMap.find( m_sServiceSpecifier ); -if ( rMap.end() == aPropMapIdPos ) +HashMapString2Int::iterator aPropMapIdPos = gServiceSpecifierMap.find( m_sServiceSpecifier ); +if ( gServiceSpecifierMap.end() == aPropMapIdPos ) { -PropSeqArray = AggregateProperties::get(); -m_nPropertyMapId = rAggProperties.size(); -rAggProperties.push_back( xPI->getProperties() ); -AmbiguousPropertyIds::get().emplace_back( ); +m_nPropertyMapId = gAggregateProperties.size(); +gAggregateProperties.push_back( xPI->getProperties() ); +gAmbiguousPropertyIds.emplace_back( ); -rMap[ m_sServiceSpecifier ] = m_nPropertyMapId; +gServiceSpecifierMap[ m_sServiceSpecifier ] = m_nPropertyMapId; } else m_nPropertyMapId = aPropMapIdPos->second; @@ -512,18 +509,18 @@ ::cppu::IPropertyArrayHelper* OCommonGeometryControlModel::createArrayHelper( sal_Int32 _nId ) const { OSL_ENSURE( _nId == m_nPropertyMapId, "OCommonGeometryControlModel::createArrayHelper: invalid argument!" ); -OSL_ENSURE( _nId < static_cast(AggregateProperties::get().size()), "OCommonGeometryControlModel::createArrayHelper: invalid status info (1)!" ); -OSL_ENSURE( _nId < static_cast(AmbiguousPropertyIds::get().size()), "OCommonGeometryControlModel::createArrayHelper: invalid status info (2)!" ); +OSL_ENSURE( _nId < static_cast(gAggregateProperties.size()), "OCommonGeometryControlModel::createArrayHelper: invalid status info
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/controls/dialogcontrol.cxx | 16 1 file changed, 12 insertions(+), 4 deletions(-) New commits: commit 0ea2f9a1b33b446069935913c2b3c846d79b52de Author: Stephan Bergmann AuthorDate: Mon Jul 26 21:45:51 2021 +0200 Commit: Stephan Bergmann CommitDate: Tue Jul 27 07:33:39 2021 +0200 Avoid potential tools::Long vs. UNOIDL LONG mismatch As found when debugging tdf#143534 "Crash in Calc NLP Solver when saving a document in Write" on Linux x86-64 (where tools::Long is 64-bit long; while UNOIDL LONG is 32-bit): These ImplSetPropertyValues cause comphelper::OPropertyContainerHelper::convertFastPropertyValue to throw via lcl_throwIllegalPropertyValueTypeException due to the mismatch---which were then silently caught in UnoDialogControl::windowResized resp. UnoDialogControl::windowMoved. Change-Id: I9793204ad49737165e69de7d5e15445ba0e82c85 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119535 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/toolkit/source/controls/dialogcontrol.cxx b/toolkit/source/controls/dialogcontrol.cxx index 25e8061e5e1b..c53b6c808751 100644 --- a/toolkit/source/controls/dialogcontrol.cxx +++ b/toolkit/source/controls/dialogcontrol.cxx @@ -17,7 +17,11 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include +#include + +#include #include #include #include @@ -507,8 +511,10 @@ void SAL_CALL UnoDialogControl::windowResized( const css::awt::WindowEvent& e ) // Properties in a sequence must be sorted! aProps[0] = "Height"; aProps[1] = "Width"; -aValues[0] <<= aAppFontSize.Height(); -aValues[1] <<= aAppFontSize.Width(); +aValues[0] <<= sal_Int32( +std::clamp(aAppFontSize.Height(), tools::Long(SAL_MIN_INT32), tools::Long(SAL_MAX_INT32))); +aValues[1] <<= sal_Int32( +std::clamp(aAppFontSize.Width(), tools::Long(SAL_MIN_INT32), tools::Long(SAL_MAX_INT32))); ImplSetPropertyValues( aProps, aValues, true ); mbSizeModified = false; @@ -533,8 +539,10 @@ void SAL_CALL UnoDialogControl::windowMoved( const css::awt::WindowEvent& e ) Sequence< Any > aValues( 2 ); aProps[0] = "PositionX"; aProps[1] = "PositionY"; -aValues[0] <<= aTmp.Width(); -aValues[1] <<= aTmp.Height(); +aValues[0] <<= sal_Int32( +std::clamp(aTmp.Width(), tools::Long(SAL_MIN_INT32), tools::Long(SAL_MAX_INT32))); +aValues[1] <<= sal_Int32( +std::clamp(aTmp.Height(), tools::Long(SAL_MIN_INT32), tools::Long(SAL_MAX_INT32))); ImplSetPropertyValues( aProps, aValues, true ); mbPosModified = false; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/awt/vclxtoolkit.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit addd7e7835097043efda52594f3a34219dbd1063 Author: Michael Stahl AuthorDate: Fri Jul 9 14:25:28 2021 +0200 Commit: Michael Stahl CommitDate: Fri Jul 9 16:39:27 2021 +0200 toolkit: initialise new VCLXTopWindow properly VCLXToolkit::createSystemChild() doesn't init WindowImpl::mpVCLXWindow and so it can happen that another VCLXTopWindow instance is created later for the same Window. Change-Id: I9ac654dceb15ea619597f2b8d9d1f9282aa1dfc1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118684 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx index 10eb7f8019e2..070d579d92bb 100644 --- a/toolkit/source/awt/vclxtoolkit.cxx +++ b/toolkit/source/awt/vclxtoolkit.cxx @@ -2048,6 +2048,7 @@ css::uno::Reference< css::awt::XWindowPeer > VCLXToolkit::createSystemChild( con SolarMutexGuard aGuard; pPeer->SetWindow( pChildWindow ); xPeer = pPeer; +pChildWindow->SetWindowPeer(xPeer, pPeer.get()); } return xPeer; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/awt/vclxwindows.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 583291d2d8d0cc9815b144c1b02847eb29421ccb Author: Caolán McNamara AuthorDate: Thu Jul 8 10:03:22 2021 +0100 Commit: Caolán McNamara CommitDate: Thu Jul 8 16:04:09 2021 +0200 pGetFormatter was already fetched via GetFormatter() so don't need to refetch it here Change-Id: I0a881c1232c5749c4558088a58111908a8c8cb17 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118605 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx index 0277ec36a780..caf63ba3b5d0 100644 --- a/toolkit/source/awt/vclxwindows.cxx +++ b/toolkit/source/awt/vclxwindows.cxx @@ -5725,7 +5725,7 @@ css::uno::Any VCLXNumericField::getProperty( const OUString& PropertyName ) break; case BASEPROPERTY_NUMSHOWTHOUSANDSEP: { -NumericFormatter* pNumericFormatter = static_cast(GetFormatter()); +NumericFormatter* pNumericFormatter = static_cast(pFormatter); aProp <<= pNumericFormatter->IsUseThousandSep(); } break; @@ -5981,7 +5981,7 @@ css::uno::Any VCLXMetricField::getProperty( const OUString& PropertyName ) { case BASEPROPERTY_NUMSHOWTHOUSANDSEP: { -NumericFormatter* pNumericFormatter = static_cast(GetFormatter()); +NumericFormatter* pNumericFormatter = static_cast(pFormatter); aProp <<= pNumericFormatter->IsUseThousandSep(); break; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/helper/unowrapper.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit cdc752fd5e5b3bf97043b9542867d84827614f2c Author: Michael Weghorn AuthorDate: Wed Jul 7 13:24:37 2021 +0100 Commit: Michael Weghorn CommitDate: Wed Jul 7 15:56:50 2021 +0200 tdf#140594 Create proper window peer for FORMATTEDFIELD commit 2a694f9e0e7789b4b3b792a9eedd29366fa10c1c Date: Wed May 6 14:08:07 2020 -0400 lok: fix the window type of the formatted field control had introduced the new 'WindowType::FORMATTEDFIELD' and set it for the 'FormattedField' control (instead of using the previous default value set in the 'SpinField' ctor, which is 'WindowType::SPINFIELD'). So far, this type was not explicitly handled when creating the XWindow peer. Handle it just the same as 'WindowType::SPINFIELD' and return a new 'VCLXNumericField', which e.g. makes sure that a "proper" accessible is created and thus alues of a spin field are announced by the NVDA screen reader (again). (See also commit 33cac418db78f64f7fa84b8e65c01c2b02cf17a7 Date: Fri May 29 16:53:59 2020 +0200 tdf#133498 Make native drawing of FormattedField work (again) which had fixed a similar regression elsewhere.) Change-Id: Ie8a4d279a12a1b83a9cf97f1304d84214b3a2a2f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118568 Tested-by: Jenkins Reviewed-by: Michael Weghorn diff --git a/toolkit/source/helper/unowrapper.cxx b/toolkit/source/helper/unowrapper.cxx index a83cd540ba5e..aa32d1b86aa6 100644 --- a/toolkit/source/helper/unowrapper.cxx +++ b/toolkit/source/helper/unowrapper.cxx @@ -56,6 +56,7 @@ static rtl::Reference CreateXWindow( vcl::Window const * pWindow ) case WindowType::METRICBOX: case WindowType::COMBOBOX: return new VCLXComboBox; case WindowType::SPINFIELD: +case WindowType::FORMATTEDFIELD: case WindowType::CURRENCYFIELD: return new VCLXNumericField; case WindowType::DATEFIELD: return new VCLXDateField; case WindowType::MULTILINEEDIT: ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/controls/filectrl.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 473337a03f8261eee454d84d252fcf85193dc137 Author: Noel Grandin AuthorDate: Fri May 28 16:00:11 2021 +0200 Commit: Noel Grandin CommitDate: Fri May 28 20:37:18 2021 +0200 IsDisposed->isDisposed in toolkit Change-Id: Iad56b2b265f83f73f75086aafeb1696c8a8ab5fd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116346 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/toolkit/source/controls/filectrl.cxx b/toolkit/source/controls/filectrl.cxx index e3b2fd8abcb5..e2bc14ed0311 100644 --- a/toolkit/source/controls/filectrl.cxx +++ b/toolkit/source/controls/filectrl.cxx @@ -176,14 +176,14 @@ void FileControl::Resize() void FileControl::GetFocus() { -if (!maEdit || maEdit->IsDisposed()) +if (!maEdit || maEdit->isDisposed()) return; maEdit->GrabFocus(); } void FileControl::SetEditModifyHdl( const Link& rLink ) { -if (!maEdit || maEdit->IsDisposed()) +if (!maEdit || maEdit->isDisposed()) return; maEdit->SetModifyHdl(rLink); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/awt/vclxwindow.cxx | 15 +-- 1 file changed, 13 insertions(+), 2 deletions(-) New commits: commit dbd45a00db54af7d960654932ef17eba4ef457ca Author: Noel Grandin AuthorDate: Thu May 20 13:23:52 2021 +0200 Commit: Noel Grandin CommitDate: Thu May 20 16:47:10 2021 +0200 fix VCLXWindow related leaks Change-Id: If2c0a599bdfed4c5390c4d3628157c7d942d5cf8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115870 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/toolkit/source/awt/vclxwindow.cxx b/toolkit/source/awt/vclxwindow.cxx index 215fdbaf2d88..80e9db718500 100644 --- a/toolkit/source/awt/vclxwindow.cxx +++ b/toolkit/source/awt/vclxwindow.cxx @@ -220,6 +220,11 @@ VCLXWindowImpl::VCLXWindowImpl( VCLXWindow& _rAntiImpl, bool _bWithDefaultProps void VCLXWindowImpl::disposing() { SolarMutexGuard aGuard; + +assert(!mbDisposed); + +mbDisposed = true; + if ( mnCallbackEventId ) { Application::RemoveUserEvent( mnCallbackEventId ); @@ -227,8 +232,7 @@ void VCLXWindowImpl::disposing() // we acquired our VCLXWindow once before posting the event, release this one ref now mrAntiImpl.release(); } - -mbDisposed = true; +maCallbackEvents.clear(); css::lang::EventObject aEvent; aEvent.Source = mrAntiImpl; @@ -243,6 +247,7 @@ void VCLXWindowImpl::disposing() maPaintListeners.disposeAndClear( aEvent ); maContainerListeners.disposeAndClear( aEvent ); maTopWindowListeners.disposeAndClear( aEvent ); +maWindow2Listeners.disposeAndClear( aEvent ); ::toolkit::WindowStyleSettings* pStyleSettings = static_cast< ::toolkit::WindowStyleSettings* >( mxWindowStyleSettings.get() ); if ( pStyleSettings != nullptr ) @@ -334,6 +339,8 @@ VCLXWindow::~VCLXWindow() void VCLXWindow::ImplExecuteAsyncWithoutSolarLock( const Callback& i_callback ) { +if (mpImpl->mbDisposing) +return; mpImpl->callBackAsync( i_callback ); } @@ -345,6 +352,8 @@ void VCLXWindow::ImplExecuteAsyncWithoutSolarLock( const Callback& i_callback ) void VCLXWindow::SetWindow( const VclPtr ) { +assert(!mpImpl->mbDisposing || !pWindow); + if ( GetWindow() ) { GetWindow()->RemoveEventListener( LINK( this, VCLXWindow, WindowEventListener ) ); @@ -416,6 +425,8 @@ namespace void VCLXWindow::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) { +if (mpImpl->mbDisposing) +return; css::uno::Reference< css::uno::XInterface > xThis( static_cast(this) ); switch ( rVclWindowEvent.GetId() ) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: toolkit/source vcl/source
toolkit/source/helper/unowrapper.cxx | 24 vcl/source/window/window.cxx |5 + 2 files changed, 21 insertions(+), 8 deletions(-) New commits: commit 6989c3df0facf3a5cb373942c337cbc7879fc0db Author: Noel Grandin AuthorDate: Wed May 19 15:24:42 2021 +0200 Commit: Noel Grandin CommitDate: Wed May 19 19:20:32 2021 +0200 fix crash in X-Ray extension caused by commit 883b7a34d288410ac6f820e91d9eaa65ba2b9cb1 DBG_ASSERT->assert in UnoWrapper No idea why X-ray is triggering this, but it seems to work when I dial it back to a SAL_WARN again And also caused by commit 5aa60be574ece81b27c8f63e6e809871c694dba0 fix leak in VCLXWindow So disconnect the toolkit-window-peer from the vcl::Window before disposing the peer. Change-Id: I3310b76c1affc13c53c1e23810e383a8d2152ec7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115806 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/toolkit/source/helper/unowrapper.cxx b/toolkit/source/helper/unowrapper.cxx index 8474b45399c4..a83cd540ba5e 100644 --- a/toolkit/source/helper/unowrapper.cxx +++ b/toolkit/source/helper/unowrapper.cxx @@ -170,16 +170,24 @@ void UnoWrapper::SetWindowInterface( vcl::Window* pWindow, const css::uno::Refer if ( !pVCLXWindow ) return; -css::uno::Reference< css::awt::XWindowPeer> xPeer = pWindow->GetWindowPeer(); -if( xPeer.is() ) +if (!pWindow) +{ +// we are disconnecting a peer from a window +pVCLXWindow->SetWindow( nullptr ); +} +else { -bool bSameInstance( pVCLXWindow == dynamic_cast< VCLXWindow* >( xPeer.get() )); -assert( bSameInstance && "UnoWrapper::SetWindowInterface: there is already a WindowPeer/ComponentInterface for this VCL window" ); -if ( bSameInstance ) -return; +css::uno::Reference< css::awt::XWindowPeer> xPeer = pWindow->GetWindowPeer(); +if( xPeer.is() ) +{ +bool bSameInstance( pVCLXWindow == dynamic_cast< VCLXWindow* >( xPeer.get() )); +SAL_WARN_IF( !bSameInstance, "toolkit.helper", "UnoWrapper::SetWindowInterface: there is already a WindowPeer/ComponentInterface for this VCL window" ); +if ( bSameInstance ) +return; +} +pVCLXWindow->SetWindow( pWindow ); +pWindow->SetWindowPeer( xIFace, pVCLXWindow ); } -pVCLXWindow->SetWindow( pWindow ); -pWindow->SetWindowPeer( xIFace, pVCLXWindow ); } css::uno::Reference UnoWrapper::CreateMenuInterface( PopupMenu* pPopupMenu ) diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 0a279983d02d..fa3cb12133d5 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -3129,6 +3129,11 @@ void Window::SetWindowPeer( Reference< css::awt::XWindowPeer > const & xPeer, VC // be safe against re-entrance: first clear the old ref, then assign the new one if (mpWindowImpl->mxWindowPeer) { +// first, disconnect the peer from ourself, otherwise disposing it, will dispose us +UnoWrapperBase* pWrapper = UnoWrapperBase::GetUnoWrapper(); +SAL_WARN_IF( !pWrapper, "vcl.window", "SetComponentInterface: No Wrapper!" ); +if ( pWrapper ) +pWrapper->SetWindowInterface( nullptr, mpWindowImpl->mxWindowPeer ); mpWindowImpl->mxWindowPeer->dispose(); mpWindowImpl->mxWindowPeer.clear(); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/helper/unowrapper.cxx | 19 ++- 1 file changed, 10 insertions(+), 9 deletions(-) New commits: commit 883b7a34d288410ac6f820e91d9eaa65ba2b9cb1 Author: Noel Grandin AuthorDate: Thu May 13 18:12:22 2021 +0200 Commit: Noel Grandin CommitDate: Thu May 13 20:52:05 2021 +0200 DBG_ASSERT->assert in UnoWrapper Change-Id: Ibc6b489f12c2734869bd45f93f946a53e3015226 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115564 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/toolkit/source/helper/unowrapper.cxx b/toolkit/source/helper/unowrapper.cxx index d4f0b3501ca9..8474b45399c4 100644 --- a/toolkit/source/helper/unowrapper.cxx +++ b/toolkit/source/helper/unowrapper.cxx @@ -35,7 +35,7 @@ using namespace ::com::sun::star; -static css::uno::Reference< css::awt::XWindowPeer > CreateXWindow( vcl::Window const * pWindow ) +static rtl::Reference CreateXWindow( vcl::Window const * pWindow ) { switch ( pWindow->GetType() ) { @@ -148,12 +148,13 @@ css::uno::Reference< css::awt::XToolkit> UnoWrapper::GetVCLToolkit() css::uno::Reference< css::awt::XWindowPeer> UnoWrapper::GetWindowInterface( vcl::Window* pWindow ) { css::uno::Reference< css::awt::XWindowPeer> xPeer = pWindow->GetWindowPeer(); -if ( !xPeer.is() ) -{ -xPeer = CreateXWindow( pWindow ); -SetWindowInterface( pWindow, xPeer ); -} -return xPeer; +if ( xPeer ) +return xPeer; + +rtl::Reference xVCLXWindow = CreateXWindow( pWindow ); +xVCLXWindow->SetWindow( pWindow ); +pWindow->SetWindowPeer( xVCLXWindow, xVCLXWindow.get() ); +return xVCLXWindow; } VclPtr UnoWrapper::GetWindow(const css::uno::Reference& rWindow) @@ -165,7 +166,7 @@ void UnoWrapper::SetWindowInterface( vcl::Window* pWindow, const css::uno::Refer { VCLXWindow* pVCLXWindow = comphelper::getUnoTunnelImplementation( xIFace ); -DBG_ASSERT( pVCLXWindow, "SetComponentInterface - unsupported type" ); +assert( pVCLXWindow && "must be a VCLXWindow subclass" ); if ( !pVCLXWindow ) return; @@ -173,7 +174,7 @@ void UnoWrapper::SetWindowInterface( vcl::Window* pWindow, const css::uno::Refer if( xPeer.is() ) { bool bSameInstance( pVCLXWindow == dynamic_cast< VCLXWindow* >( xPeer.get() )); -DBG_ASSERT( bSameInstance, "UnoWrapper::SetWindowInterface: there already *is* a WindowInterface for this window!" ); +assert( bSameInstance && "UnoWrapper::SetWindowInterface: there is already a WindowPeer/ComponentInterface for this VCL window" ); if ( bSameInstance ) return; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/awt/vclxwindow.cxx | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) New commits: commit f23bc008aefe7d5ab2da8a283fe899798d15a2fa Author: Noel Grandin AuthorDate: Thu May 13 18:45:18 2021 +0200 Commit: Noel Grandin CommitDate: Thu May 13 20:22:25 2021 +0200 fix leak in VCLXWindowImpl where the manual acquire() was not matched by a release() if we disposed while an event was in progress Change-Id: I307997772ccdfc912a16f0fb233f4e933f95cfbf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115566 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/toolkit/source/awt/vclxwindow.cxx b/toolkit/source/awt/vclxwindow.cxx index dfc6ba8f7c00..616d93fe834d 100644 --- a/toolkit/source/awt/vclxwindow.cxx +++ b/toolkit/source/awt/vclxwindow.cxx @@ -221,10 +221,14 @@ void VCLXWindowImpl::disposing() { SolarMutexGuard aGuard; if ( mnCallbackEventId ) +{ Application::RemoveUserEvent( mnCallbackEventId ); -mnCallbackEventId = nullptr; +mnCallbackEventId = nullptr; +// we acquired our VCLXWindow once before posting the event, release this one ref now +mrAntiImpl.release(); +} -mbDisposed= true; +mbDisposed = true; css::lang::EventObject aEvent; aEvent.Source = mrAntiImpl; @@ -275,9 +279,7 @@ IMPL_LINK_NOARG(VCLXWindowImpl, OnProcessCallbacks, void*, void) // we acquired our VCLXWindow once before posting the event, release this one ref now mrAntiImpl.release(); -if ( !mnCallbackEventId ) -// we were disposed while waiting for the mutex to lock -return; +assert( mnCallbackEventId && "should not be possible to call us if the event was removed"); mnCallbackEventId = nullptr; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: toolkit/source vcl/source vcl/unx
toolkit/source/awt/vclxwindow.cxx | 48 +- vcl/source/window/window.cxx | 11 +++- vcl/unx/gtk3/gtkframe.cxx | 10 +-- 3 files changed, 48 insertions(+), 21 deletions(-) New commits: commit 5aa60be574ece81b27c8f63e6e809871c694dba0 Author: Noel Grandin AuthorDate: Wed May 12 11:33:06 2021 +0200 Commit: Noel Grandin CommitDate: Wed May 12 13:37:18 2021 +0200 fix leak in VCLXWindow which is a little tricky because dispose() can be called from either side (vcl::Window or VCLXWindow) Change-Id: Ifc380feec6bec84b2cf7d903d42db00755d4cd97 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115441 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/toolkit/source/awt/vclxwindow.cxx b/toolkit/source/awt/vclxwindow.cxx index 4649a146d6e7..dfc6ba8f7c00 100644 --- a/toolkit/source/awt/vclxwindow.cxx +++ b/toolkit/source/awt/vclxwindow.cxx @@ -326,14 +326,7 @@ VCLXWindow::VCLXWindow( bool _bWithDefaultProps ) VCLXWindow::~VCLXWindow() { -mpImpl.reset(); - -if ( GetWindow() ) -{ -GetWindow()->RemoveEventListener( LINK( this, VCLXWindow, WindowEventListener ) ); -GetWindow()->SetWindowPeer( nullptr, nullptr ); -GetWindow()->SetAccessible( nullptr ); -} +assert(!mpImpl && "forgot to call dispose()"); } @@ -379,7 +372,7 @@ void VCLXWindow::resumeVclEventListening( ) void VCLXWindow::notifyWindowRemoved( vcl::Window const & _rWindow ) { -if ( mpImpl->getContainerListeners().getLength() ) +if ( mpImpl && mpImpl->getContainerListeners().getLength() ) { awt::VclContainerEvent aEvent; aEvent.Source = *this; @@ -904,19 +897,25 @@ void VCLXWindow::dispose( ) { SolarMutexGuard aGuard; -mpImpl->mxViewGraphics = nullptr; +if (!mpImpl) +return; if ( mpImpl->mbDisposing ) return; +mpImpl->mxViewGraphics = nullptr; + mpImpl->mbDisposing = true; mpImpl->disposing(); -if ( GetWindow() ) +if ( auto pWindow = GetWindow() ) { +pWindow->RemoveEventListener( LINK( this, VCLXWindow, WindowEventListener ) ); +pWindow->SetWindowPeer( nullptr, nullptr ); +pWindow->SetAccessible( nullptr ); + VclPtr pOutDev = GetOutputDevice(); -SetWindow( nullptr ); // so that handlers are logged off, if necessary (virtual) SetOutputDevice( nullptr ); pOutDev.disposeAndClear(); } @@ -934,22 +933,23 @@ void VCLXWindow::dispose( ) { OSL_FAIL( "VCLXWindow::dispose: could not dispose the accessible context!" ); } -mpImpl->mxAccessibleContext.clear(); -mpImpl->mbDisposing = false; +mpImpl.reset(); } void VCLXWindow::addEventListener( const css::uno::Reference< css::lang::XEventListener >& rxListener ) { SolarMutexGuard aGuard; - +if (!mpImpl) // called during dispose by accessibility stuff +return; mpImpl->getEventListeners().addInterface( rxListener ); } void VCLXWindow::removeEventListener( const css::uno::Reference< css::lang::XEventListener >& rxListener ) { SolarMutexGuard aGuard; - +if (!mpImpl) +return; mpImpl->getEventListeners().removeInterface( rxListener ); } @@ -1036,6 +1036,9 @@ void VCLXWindow::removeWindowListener( const css::uno::Reference< css::awt::XWin { SolarMutexGuard aGuard; +if (!mpImpl) +return; + Reference< XWindowListener2 > xListener2( rxListener, UNO_QUERY ); if ( xListener2.is() ) mpImpl->getWindow2Listeners().removeInterface( xListener2 ); @@ -1052,6 +1055,8 @@ void VCLXWindow::addFocusListener( const css::uno::Reference< css::awt::XFocusLi void VCLXWindow::removeFocusListener( const css::uno::Reference< css::awt::XFocusListener >& rxListener ) { SolarMutexGuard aGuard; +if (!mpImpl) +return; mpImpl->getFocusListeners().removeInterface( rxListener ); } @@ -1064,6 +1069,8 @@ void VCLXWindow::addKeyListener( const css::uno::Reference< css::awt::XKeyListen void VCLXWindow::removeKeyListener( const css::uno::Reference< css::awt::XKeyListener >& rxListener ) { SolarMutexGuard aGuard; +if (!mpImpl) +return; mpImpl->getKeyListeners().removeInterface( rxListener ); } @@ -1076,6 +1083,8 @@ void VCLXWindow::addMouseListener( const css::uno::Reference< css::awt::XMouseLi void VCLXWindow::removeMouseListener( const css::uno::Reference< css::awt::XMouseListener >& rxListener ) { SolarMutexGuard aGuard; +if (!mpImpl) +return; mpImpl->getMouseListeners().removeInterface( rxListener ); } @@ -1088,6 +1097,8 @@ void VCLXWindow::addMouseMotionListener( const css::uno::Reference< css::awt::XM void VCLXWindow::removeMouseMotionListener( const css::uno::Reference< css::awt::XMouseMotionListener >& rxListener ) { SolarMutexGuard aGuard; +if (!mpImpl) +return;
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/awt/vclxtopwindow.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit a05622de4a97215260a9275e6117d9f0e1e8e87f Author: Caolán McNamara AuthorDate: Wed Mar 10 21:01:52 2021 + Commit: Caolán McNamara CommitDate: Thu Mar 11 14:36:52 2021 +0100 no need to cast to WorkWindow* to use ToTop Change-Id: I47041924394b4652ed0bb69714197535784d0af1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112322 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara diff --git a/toolkit/source/awt/vclxtopwindow.cxx b/toolkit/source/awt/vclxtopwindow.cxx index 965312e6954b..a500029eed0d 100644 --- a/toolkit/source/awt/vclxtopwindow.cxx +++ b/toolkit/source/awt/vclxtopwindow.cxx @@ -107,8 +107,8 @@ void VCLXTopWindow::toFront( ) SolarMutexGuard aGuard; vcl::Window* pWindow = VCLXContainer::GetWindow(); -if ( pWindow ) -static_cast(pWindow)->ToTop( ToTopFlags::RestoreWhenMin ); +if (pWindow) +pWindow->ToTop( ToTopFlags::RestoreWhenMin ); } void VCLXTopWindow::toBack( ) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/awt/vclxtoolkit.cxx | 19 ++- 1 file changed, 10 insertions(+), 9 deletions(-) New commits: commit 0e9af8b2a6f8b740f5680201f35c128732ed357c Author: Stephan Bergmann AuthorDate: Mon Feb 22 10:41:23 2021 +0100 Commit: Stephan Bergmann CommitDate: Mon Feb 22 11:34:40 2021 +0100 Adapt to changed CreateWindow signature ...in 197bcde5c4d771ace11962213c11c9763be11039 "loplugin:refcounting in svtools", see UBSan > toolkit/source/awt/vclxtoolkit.cxx:1912:22: runtime error: call to function CreateWindow through pointer to incorrect function type 'vcl::Window *(*)(VCLXWindow **, const com::sun::star::awt::WindowDescriptor *, vcl::Window *, long)' > svtools/source/uno/unoiface.cxx:29: note: CreateWindow defined here > #0 in (anonymous namespace)::VCLXToolkit::ImplCreateWindow(com::sun::star::awt::WindowDescriptor const&, MessBoxStyle) at toolkit/source/awt/vclxtoolkit.cxx:1912:22 during CppunitTest_toolkit Change-Id: I1fdf977ed8f0ae67c09ba1e1565499db3f9f1af3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111305 Reviewed-by: Noel Grandin Reviewed-by: Stephan Bergmann Tested-by: Jenkins diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx index 31991a09fa17..11f04d9dc0cd 100644 --- a/toolkit/source/awt/vclxtoolkit.cxx +++ b/toolkit/source/awt/vclxtoolkit.cxx @@ -55,6 +55,7 @@ #include #include #include +#include #include #include #include @@ -397,7 +398,7 @@ Size MessBox::GetOptimalSize() const namespace { extern "C" typedef vcl::Window* (*FN_SvtCreateWindow)( -VCLXWindow** ppNewComp, +rtl::Reference* ppNewComp, const css::awt::WindowDescriptor* pDescriptor, vcl::Window* pParent, WinBits nWinBits ); @@ -468,7 +469,7 @@ protected: virtual void SAL_CALL disposing() override; -static vcl::Window* ImplCreateWindow( VCLXWindow** ppNewComp, const css::awt::WindowDescriptor& rDescriptor, vcl::Window* pParent, +static vcl::Window* ImplCreateWindow( rtl::Reference* ppNewComp, const css::awt::WindowDescriptor& rDescriptor, vcl::Window* pParent, WinBits nWinBits, MessBoxStyle nMessBoxStyle ); css::uno::Reference< css::awt::XWindowPeer > ImplCreateWindow( const css::awt::WindowDescriptor& Descriptor, MessBoxStyle nForceMessBoxStyle ); @@ -1393,7 +1394,7 @@ void SVTXRoadmap::ImplGetPropertyIds( std::vector< sal_uInt16 > ) VCLXGraphicControl::ImplGetPropertyIds( rIds ); } -vcl::Window* VCLXToolkit::ImplCreateWindow( VCLXWindow** ppNewComp, +vcl::Window* VCLXToolkit::ImplCreateWindow( rtl::Reference* ppNewComp, const css::awt::WindowDescriptor& rDescriptor, vcl::Window* pParent, WinBits nWinBits, MessBoxStyle nMessBoxStyle ) { @@ -1463,7 +1464,7 @@ vcl::Window* VCLXToolkit::ImplCreateWindow( VCLXWindow** ppNewComp, pNewWindow = VclPtr::Create( pParent, nWinBits ); static_cast(pNewWindow.get())->EnableEmptyFieldValue( true ); *ppNewComp = new VCLXNumericField; - static_cast(*ppNewComp)->SetFormatter( static_cast(static_cast(pNewWindow.get())) ); + static_cast((*ppNewComp).get())->SetFormatter( static_cast(static_cast(pNewWindow.get())) ); break; case WindowType::DATEBOX: pNewWindow = VclPtr::Create( pParent, nWinBits ); @@ -1546,7 +1547,7 @@ vcl::Window* VCLXToolkit::ImplCreateWindow( VCLXWindow** ppNewComp, case WindowType::METRICFIELD: pNewWindow = VclPtr::Create( pParent, nWinBits ); *ppNewComp = new VCLXMetricField; - static_cast(*ppNewComp)->SetFormatter( static_cast(static_cast(pNewWindow.get())) ); + static_cast((*ppNewComp).get())->SetFormatter( static_cast(static_cast(pNewWindow.get())) ); break; case WindowType::DIALOG: case WindowType::MODELESSDIALOG: @@ -1587,7 +1588,7 @@ vcl::Window* VCLXToolkit::ImplCreateWindow( VCLXWindow** ppNewComp, case WindowType::PATTERNFIELD: pNewWindow = VclPtr::Create( pParent, nWinBits ); *ppNewComp = new VCLXPatternField; - static_cast(*ppNewComp)->SetFormatter( static_cast(static_cast(pNewWindow.get())) ); + static_cast((*ppNewComp).get())->SetFormatter( static_cast(static_cast(pNewWindow.get())) ); break; case WindowType::PUSHBUTTON: pNewWindow = VclPtr::Create( pParent, nWinBits ); @@ -1660,7 +1661,7 @@ vcl::Window* VCLXToolkit::ImplCreateWindow( VCLXWindow** ppNewComp, pNewWindow = VclPtr::Create( pParent, nWinBits ); static_cast(pNewWindow.get())->EnableEmptyFieldValue( true ); *ppNewComp = new VCLXTimeField; -
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/awt/vclxwindows.cxx | 22 -- 1 file changed, 22 deletions(-) New commits: commit 42a691933429dbb315de2bd7ba2724993c60411f Author: Michael Weghorn AuthorDate: Fri Nov 13 15:14:17 2020 +0100 Commit: Michael Weghorn CommitDate: Sat Nov 14 23:36:53 2020 +0100 tdf#138187 Don't open UNO hyperlink control's URL twice It looks like handling the click by opening the URL was added directly to 'FixedHyperlink' in commit f0006e79c4112b06b65c098722729b9a3f3301c7 Date: Thu Oct 20 10:49:24 2016 +0200 Handle link click directly in FixedHyperlink to deduplicate the handling done explicitly in various dialogs by themselves. The handling in 'VCLXFixedHyperlink::ProcessWindowEvent', which did the same for the case where no action listeners exist, there since commit ea665e6fe7af34fcdcefd73bc05c68eb88e42073 Date: Tue Jan 29 14:05:57 2008 + INTEGRATION: CWS fwk80_SRC680 (1.64.12); FILE MERGED 2008/01/24 12:27:38 pb 1.64.12.6: fix: #i83756# VCLXFixedHyperlink::ImplGetPropertyIds() added 2008/01/24 07:50:51 pb 1.64.12.5: RESYNC: (1.64-1.64.18.1); FILE MERGED 2008/01/15 09:14:01 mav 1.64.12.4: adopt for gcc 2008/01/15 08:13:04 pb 1.64.12.3: fix: #i83756# open the hyperlink if there are no action listeners 2008/01/14 09:48:30 pb 1.64.12.2: fix: #i83756# VCLXFixedHyperlink::get/setProperty() added 2008/01/11 15:04:28 pb 1.64.12.1: fix: #i83756# class VCLXFixedHyperlink remained, though, so clicking a UNO hyperlink control resulted in the corresponding URL being opened twice. Drop the extra handling from there so this only happens once. (I couldn't quickly double-check that the URL is only opened once before f0006e79c4112b06b65c098722729b9a3f3301c7 since opening the dialog from the sample file fails in such old versions in the bibisect repo.) Change-Id: I32eace51bf8f14e968a939398c2bf2fd6f83de28 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105793 Tested-by: Jenkins Reviewed-by: Michael Weghorn diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx index 554b5fc7f212..d7404132d545 100644 --- a/toolkit/source/awt/vclxwindows.cxx +++ b/toolkit/source/awt/vclxwindows.cxx @@ -2877,28 +2877,6 @@ void VCLXFixedHyperlink::ProcessWindowEvent( const VclWindowEvent& rVclWindowEve aEvent.Source = static_cast(this); maActionListeners.actionPerformed( aEvent ); } -else -{ -// open the URL -OUString sURL; -VclPtr< FixedHyperlink > pBase = GetAs< FixedHyperlink >(); -if ( pBase ) -sURL = pBase->GetURL(); -Reference< css::system::XSystemShellExecute > xSystemShellExecute( css::system::SystemShellExecute::create( -::comphelper::getProcessComponentContext() ) ); -if ( !sURL.isEmpty() ) -{ -try -{ -// start browser -xSystemShellExecute->execute( -sURL, OUString(), css::system::SystemShellExecuteFlags::URIS_ONLY ); -} -catch( uno::Exception& ) -{ -} -} -} [[fallthrough]]; } default: ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/helper/vclunohelper.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 6eefea359fe1e51adfd4a2002614013a7c060a33 Author: Noel Grandin AuthorDate: Mon Oct 19 21:32:49 2020 +0200 Commit: Noel Grandin CommitDate: Tue Oct 20 08:04:20 2020 +0200 fix font orientation conversion in VCLUnoHelper css::awt::FontDescriptor uses degrees, while vcl::Font uses deci-degrees Change-Id: I72265ea6385bc61db99ee9a6bb392dab2cb1ab3f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104543 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/toolkit/source/helper/vclunohelper.cxx b/toolkit/source/helper/vclunohelper.cxx index e1f0bf38d1ec..238f148af910 100644 --- a/toolkit/source/helper/vclunohelper.cxx +++ b/toolkit/source/helper/vclunohelper.cxx @@ -211,7 +211,7 @@ css::awt::FontDescriptor VCLUnoHelper::CreateFontDescriptor( const vcl::Font& rF aFD.Slant = vcl::unohelper::ConvertFontSlant(rFont.GetItalic()); aFD.Underline = sal::static_int_cast< sal_Int16 >(rFont.GetUnderline()); aFD.Strikeout = sal::static_int_cast< sal_Int16 >(rFont.GetStrikeout()); -aFD.Orientation = rFont.GetOrientation(); +aFD.Orientation = rFont.GetOrientation() / 10.0; aFD.Kerning = rFont.IsKerning(); aFD.WordLineMode = rFont.IsWordLineMode(); aFD.Type = 0; // ??? => Only in Metric... @@ -245,7 +245,7 @@ vcl::Font VCLUnoHelper::CreateFont( const css::awt::FontDescriptor& rDescr, cons aFont.SetStrikeout( static_cast(rDescr.Strikeout) ); // Not DONTKNOW -aFont.SetOrientation( static_cast(rDescr.Orientation) ); +aFont.SetOrientation( static_cast(rDescr.Orientation * 10) ); aFont.SetKerning( static_cast(rDescr.Kerning) ); aFont.SetWordLineMode( rDescr.WordLineMode ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: toolkit/source tools/source ucb/source unotools/source
toolkit/source/awt/vclxmenu.cxx |2 +- toolkit/source/controls/formattedcontrol.cxx |2 +- tools/source/datetime/ttime.cxx |8 +++- tools/source/zcodec/zcodec.cxx |3 ++- ucb/source/cacher/cachedcontentresultsetstub.cxx |2 +- ucb/source/core/ucbstore.cxx |7 ++- ucb/source/ucp/file/filtask.cxx | 11 ++- ucb/source/ucp/webdav-neon/webdavcontent.cxx |2 +- unotools/source/config/eventcfg.cxx |2 +- unotools/source/config/pathoptions.cxx |2 +- 10 files changed, 19 insertions(+), 22 deletions(-) New commits: commit 27f1827afa11ba9c5d912614dc84dd308ecf8b5f Author: Noel AuthorDate: Fri Oct 2 13:38:33 2020 +0200 Commit: Noel Grandin CommitDate: Sun Oct 4 14:06:14 2020 +0200 loplugin:reducevarscope in toolkit..unotools Change-Id: I439b9f456ac0bfaa3eb9bf17472053bd4787e828 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103840 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/toolkit/source/awt/vclxmenu.cxx b/toolkit/source/awt/vclxmenu.cxx index 93d154a92ed2..c6ebef12d18b 100644 --- a/toolkit/source/awt/vclxmenu.cxx +++ b/toolkit/source/awt/vclxmenu.cxx @@ -552,7 +552,7 @@ namespace const ::Size aCurSize = aImage.GetSizePixel(); const sal_Int32 nCurWidth = aCurSize.Width(); const sal_Int32 nCurHeight = aCurSize.Height(); -const sal_Int32 nIdeal( 16 ); +constexpr sal_Int32 nIdeal( 16 ); if ( nCurWidth > 0 && nCurHeight > 0 ) { diff --git a/toolkit/source/controls/formattedcontrol.cxx b/toolkit/source/controls/formattedcontrol.cxx index b438833557ad..d2acd9c2e17d 100644 --- a/toolkit/source/controls/formattedcontrol.cxx +++ b/toolkit/source/controls/formattedcontrol.cxx @@ -324,7 +324,6 @@ namespace toolkit if ( BASEPROPERTY_EFFECTIVE_DEFAULT == nPropId && rValue.hasValue() ) { double dVal = 0; -OUString sVal; bool bStreamed = (rValue >>= dVal); if ( bStreamed ) { @@ -340,6 +339,7 @@ namespace toolkit } else { +OUString sVal; bStreamed = (rValue >>= sVal); if ( bStreamed ) { diff --git a/tools/source/datetime/ttime.cxx b/tools/source/datetime/ttime.cxx index 7fbd361573de..356f1994ee4c 100644 --- a/tools/source/datetime/ttime.cxx +++ b/tools/source/datetime/ttime.cxx @@ -401,8 +401,6 @@ Time tools::Time::GetUTCOffset() sal_uInt64 nTicks = tools::Time::GetSystemTicks(); time_t nTime; tm aTM; -sal_Int32 nLocalTime; -sal_Int32 nUTC; short nTempTime; // determine value again if needed @@ -413,17 +411,17 @@ Time tools::Time::GetUTCOffset() { nTime = time( nullptr ); localtime_r( , ); -nLocalTime = mktime( ); +sal_Int32 nLocalTime = mktime( ); #if defined(__sun) // Solaris gmtime_r() seems not to handle daylight saving time // flags correctly nUTC = nLocalTime + ( aTM.tm_isdst == 0 ? timezone : altzone ); #elif defined( LINUX ) // Linux mktime() seems not to handle tm_isdst correctly -nUTC = nLocalTime - aTM.tm_gmtoff; +sal_Int32 nUTC = nLocalTime - aTM.tm_gmtoff; #else gmtime_r( , ); -nUTC = mktime( ); +sal_Int32 nUTC = mktime( ); #endif nCacheTicks = nTicks; nCacheSecOffset = (nLocalTime-nUTC) / 60; diff --git a/tools/source/zcodec/zcodec.cxx b/tools/source/zcodec/zcodec.cxx index 525834681ef8..36386b9bb498 100644 --- a/tools/source/zcodec/zcodec.cxx +++ b/tools/source/zcodec/zcodec.cxx @@ -331,7 +331,7 @@ void ZCodec::InitDecompress(SvStream & inStream) auto pStream = static_cast(mpsC_Stream); if ( mbStatus && mbGzLib ) { -sal_uInt8 n1, n2, j, nMethod, nFlags; +sal_uInt8 j, nMethod, nFlags; for (int i : gz_magic) // gz - magic number { inStream.ReadUChar( j ); @@ -349,6 +349,7 @@ void ZCodec::InitDecompress(SvStream & inStream) /* skip the extra field */ if ( nFlags & GZ_EXTRA_FIELD ) { +sal_uInt8 n1, n2; inStream.ReadUChar( n1 ).ReadUChar( n2 ); inStream.SeekRel( n1 + ( n2 << 8 ) ); } diff --git a/ucb/source/cacher/cachedcontentresultsetstub.cxx b/ucb/source/cacher/cachedcontentresultsetstub.cxx index cedd3d588dac..f570929e1ebf 100644 --- a/ucb/source/cacher/cachedcontentresultsetstub.cxx +++ b/ucb/source/cacher/cachedcontentresultsetstub.cxx @@ -226,9 +226,9 @@ FetchResult CachedContentResultSetStub::impl_fetchHelper( if( !nOldOriginal_Pos ) bOldOriginal_AfterLast = m_xResultSetOrigin->isAfterLast(); sal_Int32 nN = 1; -bool
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/awt/vclxwindows.cxx |6 ++ 1 file changed, 6 insertions(+) New commits: commit 0e1ea352a0b9063aa0b467c6ae279d0b9da51ab4 Author: Caolán McNamara AuthorDate: Sat Jul 25 11:47:52 2020 +0100 Commit: Caolán McNamara CommitDate: Sat Jul 25 15:01:41 2020 +0200 cid#1465510 Dereference null return value and cid#1465511 Dereference null return value Change-Id: Ie297ef070ecf712e989704b8c07907e2f6453cd9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99428 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx index 0986a3a77cce..f3a29af6465b 100644 --- a/toolkit/source/awt/vclxwindows.cxx +++ b/toolkit/source/awt/vclxwindows.cxx @@ -5650,6 +5650,8 @@ void VCLXNumericField::setProperty( const OUString& PropertyName, const css::uno if ( bVoid ) { NumericFormatter* pNumericFormatter = static_cast(GetFormatter()); +if (!pNumericFormatter) +return; pNumericFormatter->EnableEmptyFieldValue( true ); pNumericFormatter->SetEmptyFieldValue(); } @@ -5695,6 +5697,8 @@ void VCLXNumericField::setProperty( const OUString& PropertyName, const css::uno if ( Value >>= b ) { NumericFormatter* pNumericFormatter = static_cast(GetFormatter()); +if (!pNumericFormatter) +return; pNumericFormatter->SetUseThousandSep( b ); } } @@ -5954,6 +5958,8 @@ void VCLXMetricField::setProperty( const OUString& PropertyName, const css::uno: if ( Value >>= b ) { NumericFormatter* pNumericFormatter = static_cast(GetFormatter()); +if (!pNumericFormatter) +return; pNumericFormatter->SetUseThousandSep( b ); } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/awt/vclxwindows.cxx | 66 + 1 file changed, 38 insertions(+), 28 deletions(-) New commits: commit 7cfd8b201beeb356ee4cc58385664d5b37dd4e35 Author: Caolán McNamara AuthorDate: Thu Jul 23 14:54:06 2020 +0100 Commit: Caolán McNamara CommitDate: Thu Jul 23 22:09:21 2020 +0200 access via NumericFormatter instead of NumericField Change-Id: I4f3c2e9f7249b77fbc509031f4eb5f170eac5b90 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99318 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx index 8baa6433e29a..0986a3a77cce 100644 --- a/toolkit/source/awt/vclxwindows.cxx +++ b/toolkit/source/awt/vclxwindows.cxx @@ -5547,19 +5547,19 @@ void VCLXNumericField::setFirst( double Value ) { SolarMutexGuard aGuard; -VclPtr< NumericField > pNumericField = GetAs< NumericField >(); -if ( pNumericField ) -pNumericField->SetFirst( -static_cast(ImplCalcLongValue( Value, pNumericField->GetDecimalDigits() )) ); +NumericFormatter* pNumericFormatter = static_cast(GetFormatter()); +if ( pNumericFormatter ) +pNumericFormatter->SetFirst( +static_cast(ImplCalcLongValue( Value, pNumericFormatter->GetDecimalDigits() )) ); } double VCLXNumericField::getFirst() { SolarMutexGuard aGuard; -VclPtr< NumericField > pNumericField = GetAs< NumericField >(); -return pNumericField -? ImplCalcDoubleValue( static_cast(pNumericField->GetFirst()), pNumericField->GetDecimalDigits() ) +NumericFormatter* pNumericFormatter = static_cast(GetFormatter()); +return pNumericFormatter +? ImplCalcDoubleValue( static_cast(pNumericFormatter->GetFirst()), pNumericFormatter->GetDecimalDigits() ) : 0; } @@ -5567,19 +5567,19 @@ void VCLXNumericField::setLast( double Value ) { SolarMutexGuard aGuard; -VclPtr< NumericField > pNumericField = GetAs< NumericField >(); -if ( pNumericField ) -pNumericField->SetLast( -static_cast(ImplCalcLongValue( Value, pNumericField->GetDecimalDigits() )) ); +NumericFormatter* pNumericFormatter = static_cast(GetFormatter()); +if ( pNumericFormatter ) +pNumericFormatter->SetLast( +static_cast(ImplCalcLongValue( Value, pNumericFormatter->GetDecimalDigits() )) ); } double VCLXNumericField::getLast() { SolarMutexGuard aGuard; -VclPtr< NumericField > pNumericField = GetAs< NumericField >(); -return pNumericField -? ImplCalcDoubleValue( static_cast(pNumericField->GetLast()), pNumericField->GetDecimalDigits() ) +NumericFormatter* pNumericFormatter = static_cast(GetFormatter()); +return pNumericFormatter +? ImplCalcDoubleValue( static_cast(pNumericFormatter->GetLast()), pNumericFormatter->GetDecimalDigits() ) : 0; } @@ -5593,24 +5593,23 @@ sal_Bool VCLXNumericField::isStrictFormat() return VCLXFormattedSpinField::isStrictFormat(); } - void VCLXNumericField::setSpinSize( double Value ) { SolarMutexGuard aGuard; -VclPtr< NumericField > pNumericField = GetAs< NumericField >(); -if ( pNumericField ) -pNumericField->SetSpinSize( -static_cast(ImplCalcLongValue( Value, pNumericField->GetDecimalDigits() )) ); +NumericFormatter* pNumericFormatter = static_cast(GetFormatter()); +if ( pNumericFormatter ) +pNumericFormatter->SetSpinSize( +static_cast(ImplCalcLongValue( Value, pNumericFormatter->GetDecimalDigits() )) ); } double VCLXNumericField::getSpinSize() { SolarMutexGuard aGuard; -VclPtr< NumericField > pNumericField = GetAs< NumericField >(); -return pNumericField -? ImplCalcDoubleValue( static_cast(pNumericField->GetSpinSize()), pNumericField->GetDecimalDigits() ) +NumericFormatter* pNumericFormatter = static_cast(GetFormatter()); +return pNumericFormatter +? ImplCalcDoubleValue( static_cast(pNumericFormatter->GetSpinSize()), pNumericFormatter->GetDecimalDigits() ) : 0; } @@ -5650,8 +5649,9 @@ void VCLXNumericField::setProperty( const OUString& PropertyName, const css::uno { if ( bVoid ) { -GetAs< NumericField >()->EnableEmptyFieldValue( true ); -GetAs< NumericField >()->SetEmptyFieldValue(); +NumericFormatter* pNumericFormatter = static_cast(GetFormatter()); +pNumericFormatter->EnableEmptyFieldValue( true ); +pNumericFormatter->SetEmptyFieldValue(); } else { @@ -5693,7 +5693,10 @@ void VCLXNumericField::setProperty( const OUString& PropertyName, const css::uno { bool b = bool(); if ( Value >>= b ) - GetAs< NumericField
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/awt/vclxtoolkit.cxx |8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) New commits: commit 4d41b22135904e81f847c1cbf00abc82a414095f Author: Caolán McNamara AuthorDate: Mon Jul 20 15:29:29 2020 +0100 Commit: Caolán McNamara CommitDate: Mon Jul 20 20:38:55 2020 +0200 SVTXDateField is preferred ahead of VCLXDateField SVTXDateField is supposed to intercept and get used before VCLXDateField Change-Id: Ia1ff2cd362e86a6a1118bc24dff8b6bce50e8bf2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99083 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx index eb5273cde27d..267a9fced788 100644 --- a/toolkit/source/awt/vclxtoolkit.cxx +++ b/toolkit/source/awt/vclxtoolkit.cxx @@ -701,7 +701,7 @@ ComponentInfo const aComponentInfos [] = { OUStringLiteral("currencybox"),WindowType::CURRENCYBOX }, { OUStringLiteral("currencyfield"), WindowType::CURRENCYFIELD }, { OUStringLiteral("datebox"),WindowType::DATEBOX }, -{ OUStringLiteral("datefield"), WindowType::DATEFIELD }, +{ OUStringLiteral("datefield"), WindowType::CONTROL }, { OUStringLiteral("dialog"), WindowType::DIALOG }, { OUStringLiteral("dockingarea"),WindowType::DOCKINGAREA }, { OUStringLiteral("dockingwindow"), WindowType::DOCKINGWINDOW }, @@ -1460,12 +1460,6 @@ vcl::Window* VCLXToolkit::ImplCreateWindow( VCLXWindow** ppNewComp, case WindowType::DATEBOX: pNewWindow = VclPtr::Create( pParent, nWinBits ); break; -case WindowType::DATEFIELD: -pNewWindow = VclPtr::Create( pParent, nWinBits ); - static_cast(pNewWindow.get())->EnableEmptyFieldValue( true ); -*ppNewComp = new VCLXDateField; - static_cast(*ppNewComp)->SetFormatter( static_cast(static_cast(pNewWindow.get())) ); -break; case WindowType::DOCKINGAREA: pNewWindow = VclPtr::Create( pParent ); break; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/awt/vclxwindows.cxx | 35 +++- toolkit/source/controls/unocontrols.cxx |4 --- 2 files changed, 31 insertions(+), 8 deletions(-) New commits: commit d2b3d162f627341690d489f50600de1d74c39219 Author: Caolán McNamara AuthorDate: Thu Jul 16 11:40:44 2020 +0100 Commit: Caolán McNamara CommitDate: Mon Jul 20 11:36:20 2020 +0200 UnoControlCurrencyFieldModel ends up using a SVTXCurrencyField so sync SVTXCurrencyField::ImplGetPropertyIds with VCLXCurrencyField::ImplGetPropertyIds and use that instead Change-Id: Ib1f2357cb4ad6b098bcd37f34d3fd680ac9f83f3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98895 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx index 396fa5dade35..40c897b9db60 100644 --- a/toolkit/source/awt/vclxwindows.cxx +++ b/toolkit/source/awt/vclxwindows.cxx @@ -7743,10 +7743,6 @@ void SVTXFormattedField::ImplGetPropertyIds( std::vector< sal_uInt16 > ) VCLXSpinField::ImplGetPropertyIds( rIds ); } - - - - SVTXCurrencyField::SVTXCurrencyField() { } @@ -7977,10 +7973,39 @@ css::uno::Any SVTXCurrencyField::getProperty( const OUString& PropertyName ) void SVTXCurrencyField::ImplGetPropertyIds( std::vector< sal_uInt16 > ) { PushPropertyIds( rIds, + BASEPROPERTY_ALIGN, + BASEPROPERTY_BACKGROUNDCOLOR, + BASEPROPERTY_BORDER, + BASEPROPERTY_BORDERCOLOR, BASEPROPERTY_CURRENCYSYMBOL, BASEPROPERTY_CURSYM_POSITION, + BASEPROPERTY_DECIMALACCURACY, + BASEPROPERTY_DEFAULTCONTROL, + BASEPROPERTY_ENABLED, + BASEPROPERTY_ENABLEVISIBLE, + BASEPROPERTY_FONTDESCRIPTOR, + BASEPROPERTY_HELPTEXT, + BASEPROPERTY_HELPURL, + BASEPROPERTY_NUMSHOWTHOUSANDSEP, + BASEPROPERTY_PRINTABLE, + BASEPROPERTY_READONLY, + BASEPROPERTY_REPEAT, + BASEPROPERTY_REPEAT_DELAY, + BASEPROPERTY_SPIN, + BASEPROPERTY_STRICTFORMAT, + BASEPROPERTY_TABSTOP, + BASEPROPERTY_VALUEMAX_DOUBLE, + BASEPROPERTY_VALUEMIN_DOUBLE, + BASEPROPERTY_VALUESTEP_DOUBLE, + BASEPROPERTY_VALUE_DOUBLE, + BASEPROPERTY_ENFORCE_FORMAT, + BASEPROPERTY_HIDEINACTIVESELECTION, + BASEPROPERTY_VERTICALALIGN, + BASEPROPERTY_WRITING_MODE, + BASEPROPERTY_CONTEXT_WRITING_MODE, + BASEPROPERTY_MOUSE_WHEEL_BEHAVIOUR, 0); -SVTXFormattedField::ImplGetPropertyIds( rIds ); +VCLXWindow::ImplGetPropertyIds( rIds ); } SVTXNumericField::SVTXNumericField() diff --git a/toolkit/source/controls/unocontrols.cxx b/toolkit/source/controls/unocontrols.cxx index 6ad3af40c4a0..8a9988f386f2 100644 --- a/toolkit/source/controls/unocontrols.cxx +++ b/toolkit/source/controls/unocontrols.cxx @@ -4110,12 +4110,10 @@ stardiv_Toolkit_UnoNumericFieldControl_get_implementation( return cppu::acquire(new UnoNumericFieldControl()); } - - UnoControlCurrencyFieldModel::UnoControlCurrencyFieldModel( const Reference< XComponentContext >& rxContext ) :UnoControlModel( rxContext ) { -UNO_CONTROL_MODEL_REGISTER_PROPERTIES(); +UNO_CONTROL_MODEL_REGISTER_PROPERTIES(); } OUString UnoControlCurrencyFieldModel::getServiceName() ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/awt/vclxtoolkit.cxx |6 +- 1 file changed, 1 insertion(+), 5 deletions(-) New commits: commit db9d871b2dc89ac1a09e17ec08a1570dae546025 Author: Caolán McNamara AuthorDate: Wed Jul 15 11:41:38 2020 +0100 Commit: Caolán McNamara CommitDate: Wed Jul 15 15:02:02 2020 +0200 aServiceName is lowercase rDescriptor.WindowServiceName already Change-Id: I5e6ae62b7a1d5eeed641519a1e1c0375d805d7e9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98817 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx index 8d067c05cf4c..3671963c4234 100644 --- a/toolkit/source/awt/vclxtoolkit.cxx +++ b/toolkit/source/awt/vclxtoolkit.cxx @@ -1384,9 +1384,6 @@ void SVTXRoadmap::ImplGetPropertyIds( std::vector< sal_uInt16 > ) VCLXGraphicControl::ImplGetPropertyIds( rIds ); } - - - vcl::Window* VCLXToolkit::ImplCreateWindow( VCLXWindow** ppNewComp, const css::awt::WindowDescriptor& rDescriptor, vcl::Window* pParent, WinBits nWinBits, MessBoxStyle nMessBoxStyle ) @@ -1764,8 +1761,7 @@ vcl::Window* VCLXToolkit::ImplCreateWindow( VCLXWindow** ppNewComp, } break; case WindowType::CONTROL: -if ( rDescriptor.WindowServiceName.equalsIgnoreAsciiCase( -"tabpagecontainer" ) ) +if ( aServiceName == "tabpagecontainer" ) { // TabControl has a special case for tabs without border: they are displayed // in a different way, so we need to ensure that this style is not set, so ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/awt/vclxtoolkit.cxx|8 toolkit/source/controls/formattedcontrol.cxx |4 ++-- toolkit/source/controls/unocontrol.cxx|2 +- toolkit/source/helper/accessibilityclient.cxx |6 +++--- toolkit/source/helper/formpdfexport.cxx |2 +- 5 files changed, 11 insertions(+), 11 deletions(-) New commits: commit b772fca5b5fc24df8150541a08ac1bfd979b3ac9 Author: Stephan Bergmann AuthorDate: Thu Jul 2 09:24:18 2020 +0200 Commit: Stephan Bergmann CommitDate: Thu Jul 2 10:45:17 2020 +0200 Upcoming improved loplugin:staticanonymous -> redundantstatic: toolkit Change-Id: I40eb6de30065fe00d5214e0a00b38d02b0deea52 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97708 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx index 4b4efaece266..eee471e9894e 100644 --- a/toolkit/source/awt/vclxtoolkit.cxx +++ b/toolkit/source/awt/vclxtoolkit.cxx @@ -691,7 +691,7 @@ struct ComponentInfo WindowType nWinType; }; -static ComponentInfo const aComponentInfos [] = +ComponentInfo const aComponentInfos [] = { { OUStringLiteral("animatedimages"), WindowType::CONTROL }, { OUStringLiteral("buttondialog"), WindowType::BUTTONDIALOG }, @@ -809,7 +809,7 @@ struct MessageBoxTypeInfo sal_Int32nLen; }; -static const MessageBoxTypeInfo aMessageBoxTypeInfo[] = +const MessageBoxTypeInfo aMessageBoxTypeInfo[] = { { css::awt::MessageBoxType_MESSAGEBOX, RTL_CONSTASCII_STRINGPARAM("messbox") }, { css::awt::MessageBoxType_INFOBOX, RTL_CONSTASCII_STRINGPARAM("infobox") }, @@ -842,8 +842,8 @@ bool lcl_convertMessageBoxType( #ifndef IOS -static sal_Int32nVCLToolkitInstanceCount = 0; -static bool bInitedByVCLToolkit = false; +sal_Int32nVCLToolkitInstanceCount = 0; +bool bInitedByVCLToolkit = false; osl::Mutex & getInitMutex() { diff --git a/toolkit/source/controls/formattedcontrol.cxx b/toolkit/source/controls/formattedcontrol.cxx index 015b38e1f7b6..b438833557ad 100644 --- a/toolkit/source/controls/formattedcontrol.cxx +++ b/toolkit/source/controls/formattedcontrol.cxx @@ -60,7 +60,7 @@ namespace toolkit } -static bool s_bTriedCreation = false; +bool s_bTriedCreation = false; const Reference< XNumberFormatsSupplier >& lcl_getDefaultFormats_throw() { @@ -79,7 +79,7 @@ namespace toolkit } -static oslInterlockedCount s_refCount(0); +oslInterlockedCount s_refCount(0); voidlcl_registerDefaultFormatsClient() diff --git a/toolkit/source/controls/unocontrol.cxx b/toolkit/source/controls/unocontrol.cxx index 71132338cfbb..aeb84bd8139a 100644 --- a/toolkit/source/controls/unocontrol.cxx +++ b/toolkit/source/controls/unocontrol.cxx @@ -63,7 +63,7 @@ struct LanguageDependentProp } -static const LanguageDependentProp aLanguageDependentProp[] = +const LanguageDependentProp aLanguageDependentProp[] = { { "Text",4 }, { "Label", 5 }, diff --git a/toolkit/source/helper/accessibilityclient.cxx b/toolkit/source/helper/accessibilityclient.cxx index 682354607111..9d795ac620e4 100644 --- a/toolkit/source/helper/accessibilityclient.cxx +++ b/toolkit/source/helper/accessibilityclient.cxx @@ -38,12 +38,12 @@ namespace toolkit namespace { #ifndef DISABLE_DYNLOADING -static oslModule s_hAccessibleImplementationModule = nullptr; +oslModule s_hAccessibleImplementationModule = nullptr; #endif #if HAVE_FEATURE_DESKTOP -static GetStandardAccComponentFactory s_pAccessibleFactoryFunc = nullptr; +GetStandardAccComponentFactory s_pAccessibleFactoryFunc = nullptr; #endif -static ::rtl::Reference< IAccessibleFactory > s_pFactory; +::rtl::Reference< IAccessibleFactory > s_pFactory; } diff --git a/toolkit/source/helper/formpdfexport.cxx b/toolkit/source/helper/formpdfexport.cxx index a3c74dd1b39e..a265d18dfdf0 100644 --- a/toolkit/source/helper/formpdfexport.cxx +++ b/toolkit/source/helper/formpdfexport.cxx @@ -58,7 +58,7 @@ namespace toolkitform using namespace ::com::sun::star::lang; using namespace ::com::sun::star::container; -static const char FM_PROP_NAME[] = "Name"; +const char FM_PROP_NAME[] = "Name"; namespace { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/controls/stdtabcontroller.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 024173fb5448102e00bfec1dd8df152e1e10d5ab Author: Andrea Gelmini AuthorDate: Tue Jun 2 14:54:01 2020 +0200 Commit: Julien Nabet CommitDate: Tue Jun 2 17:44:14 2020 +0200 Fix typo Change-Id: I6b6cf2a8c6faa461515e8548d3db67e453351085 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95361 Tested-by: Julien Nabet Reviewed-by: Julien Nabet diff --git a/toolkit/source/controls/stdtabcontroller.cxx b/toolkit/source/controls/stdtabcontroller.cxx index 0fa0f96f965c..c0173e822c75 100644 --- a/toolkit/source/controls/stdtabcontroller.cxx +++ b/toolkit/source/controls/stdtabcontroller.cxx @@ -307,7 +307,7 @@ void StdTabController::activateTabOrder( ) return; // This may return a TabController, which returns desired list of controls faster -// (the dreaded UNO aggregration, retrieve the thing that we are part of) +// (the dreaded UNO aggregation, retrieve the thing that we are part of) Reference xTabController( static_cast(this), UNO_QUERY ); // Get a flattened list of controls sequences ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/controls/controlmodelcontainerbase.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 7daab7859f3b5b4297c45ac1631c68387192a962 Author: Noel Grandin AuthorDate: Wed May 20 14:17:36 2020 +0200 Commit: Noel Grandin CommitDate: Wed May 20 15:00:41 2020 +0200 fix -Werror=maybe-uninitialized Change-Id: I718016b5f9120c18868ed798785af1f8108be25b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94569 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/toolkit/source/controls/controlmodelcontainerbase.cxx b/toolkit/source/controls/controlmodelcontainerbase.cxx index fc5b0e374c1f..05b9edb18643 100644 --- a/toolkit/source/controls/controlmodelcontainerbase.cxx +++ b/toolkit/source/controls/controlmodelcontainerbase.cxx @@ -736,7 +736,7 @@ sal_Bool SAL_CALL ControlModelContainerBase::getEnabled() { SolarMutexGuard aGuard; Reference xThis(*this, UNO_QUERY); -bool bEnabled; +bool bEnabled = false; xThis->getPropertyValue(GetPropertyName(BASEPROPERTY_ENABLED)) >>= bEnabled; return bEnabled; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/controls/tabpagecontainer.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 8d4dee8ee96c27454968d19518153ca892194a77 Author: Michael Weghorn AuthorDate: Fri May 15 10:00:21 2020 +0200 Commit: Michael Weghorn CommitDate: Fri May 15 13:03:24 2020 +0200 Forward 'removeTabPageContainerListener' as such Calling 'addTabPageContainerListener' for the peer instead looks like it was probably a copy paste mistake when adding this forwarding in both, 'UnoControlTabPageContainer::addTabPageContainerListener', and 'UnoControlTabPageContainer::removeTabPageContainerListener' in commit 559f957fc3e4295b049866efe3582b2aaa17c414 ("tabcontrol: notify tab listener", 2010-09-06). Change-Id: I98f20b9cb3e658143b362118189adfbed85f3b43 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94262 Tested-by: Jenkins Reviewed-by: Michael Weghorn diff --git a/toolkit/source/controls/tabpagecontainer.cxx b/toolkit/source/controls/tabpagecontainer.cxx index b733ef56064e..25c50c387abe 100644 --- a/toolkit/source/controls/tabpagecontainer.cxx +++ b/toolkit/source/controls/tabpagecontainer.cxx @@ -289,7 +289,7 @@ void SAL_CALL UnoControlTabPageContainer::removeTabPageContainerListener( const if( getPeer().is() && m_aTabPageListeners.getLength() == 1 ) { uno::Reference < awt::tab::XTabPageContainer > xTabPageContainer( getPeer(), uno::UNO_QUERY ); -xTabPageContainer->addTabPageContainerListener( _aTabPageListeners ); +xTabPageContainer->removeTabPageContainerListener( _aTabPageListeners ); } m_aTabPageListeners.removeInterface( listener ); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/controls/unocontrols.cxx |2 -- 1 file changed, 2 deletions(-) New commits: commit 68af4f050c5768ce30357cbc5f40e7bc031518c4 Author: Michael Weghorn AuthorDate: Thu May 14 08:53:11 2020 +0200 Commit: Michael Weghorn CommitDate: Thu May 14 09:57:42 2020 +0200 UnoEditControl: Don't initialize members twice 'mnMaxTextLen' and 'mbSetMaxTextLenInPeer' are already assigned the same values in the member initializer list. Change-Id: I498ff981c25f6b5395400c75ad8c7e0f20ff3a89 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94180 Tested-by: Jenkins Reviewed-by: Michael Weghorn diff --git a/toolkit/source/controls/unocontrols.cxx b/toolkit/source/controls/unocontrols.cxx index 9d8cc4d0b960..945b1f7d7214 100644 --- a/toolkit/source/controls/unocontrols.cxx +++ b/toolkit/source/controls/unocontrols.cxx @@ -165,8 +165,6 @@ UnoEditControl::UnoEditControl() { maComponentInfos.nWidth = 100; maComponentInfos.nHeight = 12; -mnMaxTextLen = 0; -mbSetMaxTextLenInPeer = false; } uno::Any SAL_CALL UnoEditControl::queryAggregation( const uno::Type & rType ) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/controls/controlmodelcontainerbase.cxx | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) New commits: commit 2f4172fc48aab38c64851ba3a384bd6c7c180634 Author: Michael Weghorn AuthorDate: Fri May 8 16:23:37 2020 +0200 Commit: Michael Weghorn CommitDate: Sat May 9 01:42:20 2020 +0200 Just use initializer list for Sequence Change-Id: I4732e238053b8c9e6813f1bbecd6f613922cb521 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93748 Tested-by: Jenkins Reviewed-by: Michael Weghorn diff --git a/toolkit/source/controls/controlmodelcontainerbase.cxx b/toolkit/source/controls/controlmodelcontainerbase.cxx index cc92f9fb7345..ebf5cfdf63b6 100644 --- a/toolkit/source/controls/controlmodelcontainerbase.cxx +++ b/toolkit/source/controls/controlmodelcontainerbase.cxx @@ -1610,12 +1610,12 @@ void ControlContainerBase::addingControl( const Reference< XControl >& _rxContro Reference< XMultiPropertySet > xProps( _rxControl->getModel(), UNO_QUERY ); if ( xProps.is() ) { -Sequence< OUString > aNames( 4 ); -OUString* pNames = aNames.getArray(); -*pNames++ = "PositionX"; -*pNames++ = "PositionY"; -*pNames++ = "Width"; -*pNames++ = "Height"; +const Sequence< OUString > aNames { + "PositionX", + "PositionY", + "Width", + "Height" +}; xProps->addPropertiesChangeListener( aNames, this ); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/awt/vclxwindow.cxx | 22 -- 1 file changed, 4 insertions(+), 18 deletions(-) New commits: commit 8cea43730177a89c7686cda64f87a2e9e63fd7fd Author: Noel Grandin AuthorDate: Fri Mar 20 15:51:37 2020 +0200 Commit: Noel Grandin CommitDate: Sat Mar 21 08:07:34 2020 +0100 simplify code These methods are virtual, so the check does nothing useful. Possibly back when this code was introduced, the methods were not. This was introduced in commit 411f66186e228 Date: Mon Jan 31 07:58:15 2005 + INTEGRATION: CWS vcl34 (1.49.26); FILE MERGED 2005/01/06 14:13:03 ssa 1.49.26.1: #i37461# get/setOutputsize has to check for DockingWindow to call proper method to solve https://bz.apache.org/ooo/show_bug.cgi?id=37461 I have checked, and the bug does not come back. Change-Id: I540b85eccbf7107ee640f09b41340dc906995557 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90795 Tested-by: Noel Grandin Reviewed-by: Noel Grandin diff --git a/toolkit/source/awt/vclxwindow.cxx b/toolkit/source/awt/vclxwindow.cxx index 0a789dc376e3..01ec82878f79 100644 --- a/toolkit/source/awt/vclxwindow.cxx +++ b/toolkit/source/awt/vclxwindow.cxx @@ -2441,29 +2441,15 @@ sal_Bool SAL_CALL VCLXWindow::isInPopupMode( ) void SAL_CALL VCLXWindow::setOutputSize( const css::awt::Size& aSize ) { SolarMutexGuard aGuard; -VclPtr pWindow; -if( (pWindow = GetWindow()) != nullptr ) -{ -DockingWindow *pDockingWindow = dynamic_cast< DockingWindow* >(pWindow.get()); -if( pDockingWindow ) -pDockingWindow->SetOutputSizePixel( VCLSize( aSize ) ); -else -pWindow->SetOutputSizePixel( VCLSize( aSize ) ); -} +if( VclPtr pWindow = GetWindow() ) +pWindow->SetOutputSizePixel( VCLSize( aSize ) ); } css::awt::Size SAL_CALL VCLXWindow::getOutputSize( ) { SolarMutexGuard aGuard; -VclPtr pWindow; -if( (pWindow = GetWindow()) != nullptr ) -{ -DockingWindow *pDockingWindow = dynamic_cast< DockingWindow* >(pWindow.get()); -if( pDockingWindow ) -return AWTSize( pDockingWindow->GetOutputSizePixel() ); -else -return AWTSize( pWindow->GetOutputSizePixel() ); -} +if( VclPtr pWindow = GetWindow() ) +return AWTSize( pWindow->GetOutputSizePixel() ); else return css::awt::Size(); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/awt/asynccallback.cxx |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) New commits: commit c6f5e12ee3f91234b06472d756670f3bb207 Author: Eda Nur Var AuthorDate: Mon Jan 27 15:38:48 2020 +0300 Commit: Michael Stahl CommitDate: Thu Feb 20 11:13:51 2020 +0100 tdf#88205 Adapt uses of css::uno::Sequence to use initializer_list ctor Change-Id: I9c9a9af78bab721f112c33e485c431aac11bece6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87523 Tested-by: Michael Stahl Reviewed-by: Michael Stahl diff --git a/toolkit/source/awt/asynccallback.cxx b/toolkit/source/awt/asynccallback.cxx index 93eff62f1fe5..6934fbcae19f 100644 --- a/toolkit/source/awt/asynccallback.cxx +++ b/toolkit/source/awt/asynccallback.cxx @@ -76,8 +76,7 @@ sal_Bool SAL_CALL AsyncCallback::supportsService(OUString const & serviceName) css::uno::Sequence< OUString > SAL_CALL AsyncCallback::getSupportedServiceNames() { -css::uno::Sequence< OUString > s { "com.sun.star.awt.AsyncCallback" }; -return s; +return css::uno::Sequence< OUString >{ "com.sun.star.awt.AsyncCallback" }; } // css::awt::XRequestCallback: ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/controls/tabpagemodel.cxx |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) New commits: commit 7e19348d7e54cf22864f6e14022e28091a576387 Author: Hakan Bakacak AuthorDate: Mon Jan 27 15:41:40 2020 +0300 Commit: Muhammet Kara CommitDate: Tue Jan 28 21:22:59 2020 +0100 tdf#88205: Adapt uses of css::uno::Sequence to use initializer_list ctor Change-Id: Ifda9d3a4f05ffa9f611512d5d203e40d67d1c542 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87522 Tested-by: Jenkins Reviewed-by: Muhammet Kara diff --git a/toolkit/source/controls/tabpagemodel.cxx b/toolkit/source/controls/tabpagemodel.cxx index 34849170bd14..8b9ebbc1036b 100644 --- a/toolkit/source/controls/tabpagemodel.cxx +++ b/toolkit/source/controls/tabpagemodel.cxx @@ -177,8 +177,7 @@ sal_Bool SAL_CALL UnoControlTabPage::supportsService(OUString const & ServiceNam css::uno::Sequence SAL_CALL UnoControlTabPage::getSupportedServiceNames() { -css::uno::Sequence< OUString > aSeq { "com.sun.star.awt.tab.UnoControlTabPage" }; -return aSeq; +return { "com.sun.star.awt.tab.UnoControlTabPage" }; } void UnoControlTabPage::dispose() ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/controls/unocontrolmodel.cxx |5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) New commits: commit 8762cc5f41e00e6f15e67b4f691e40751588ce17 Author: Stephan Bergmann AuthorDate: Mon Jan 27 08:43:10 2020 +0100 Commit: Stephan Bergmann CommitDate: Mon Jan 27 10:36:50 2020 +0100 Split independent loop vars, giving them appropriate types ...and thus avoiding an unnecessary explicit cast from sal_Int32 to sal_uInt32 Change-Id: I536fc52960259509a3b722fed9268dc6ec9e76a6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87482 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/toolkit/source/controls/unocontrolmodel.cxx b/toolkit/source/controls/unocontrolmodel.cxx index aa4d55237de0..a735178bdca1 100644 --- a/toolkit/source/controls/unocontrolmodel.cxx +++ b/toolkit/source/controls/unocontrolmodel.cxx @@ -785,8 +785,7 @@ void UnoControlModel::read( const css::uno::Reference< css::io::XObjectInputStre // Used for import of old parts in css::awt::FontDescriptor std::unique_ptr pFD; -sal_uInt32 i; -for ( i = 0; i < nProps; i++ ) +for ( sal_uInt32 i = 0; i < nProps; i++ ) { sal_Int32 nPropDataBeginMark = xMark->createMark(); sal_Int32 nPropDataLen = InStream->readLong(); @@ -999,7 +998,7 @@ void UnoControlModel::read( const css::uno::Reference< css::io::XObjectInputStre } if ( bInvalidEntries ) { -for ( i = 0; i < static_cast(aProps.getLength()); i++ ) +for ( sal_Int32 i = 0; i < aProps.getLength(); i++ ) { if ( aProps.getConstArray()[i].isEmpty() ) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/awt/vclxwindows.cxx |5 + 1 file changed, 5 insertions(+) New commits: commit 85578a6f9ca9dfb1e384d8d1f6edd8219a2ac493 Author: Caolán McNamara AuthorDate: Tue Nov 26 14:08:46 2019 + Commit: Caolán McNamara CommitDate: Wed Nov 27 09:59:09 2019 +0100 tdf#129037 disable updates during multiselection Change-Id: Ie20f73f3b2c5ba975a61a43edb593dffa0a01ddb Reviewed-on: https://gerrit.libreoffice.org/83774 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx index 50071403d6e5..56133e58b034 100644 --- a/toolkit/source/awt/vclxwindows.cxx +++ b/toolkit/source/awt/vclxwindows.cxx @@ -1732,8 +1732,13 @@ void VCLXListBox::selectItemsPos( const css::uno::Sequence& aPosition if ( bChanged ) { +bool bOrigUpdateMode = pBox->IsUpdateMode(); +pBox->SetUpdateMode(false); + pBox->SelectEntriesPos(aPositionVec, bSelect); +pBox->SetUpdateMode(bOrigUpdateMode); + // VCL doesn't call select handler after API call. // ImplCallItemListeners(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/awt/vclxtoolkit.cxx |7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) New commits: commit 9a083905cf9e72bf22fc727677d052b8d1a0652b Author: Caolán McNamara AuthorDate: Thu Nov 14 09:40:48 2019 + Commit: Caolán McNamara CommitDate: Thu Nov 14 12:06:16 2019 +0100 Resolves: tdf#128792 progressbar control not created Change-Id: I81ff4e56d5ea2a4f5b7c034c2a99df881969b119 Reviewed-on: https://gerrit.libreoffice.org/82655 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx index dced58ba0b53..2121e14c3e15 100644 --- a/toolkit/source/awt/vclxtoolkit.cxx +++ b/toolkit/source/awt/vclxtoolkit.cxx @@ -707,6 +707,7 @@ static ComponentInfo const aComponentInfos [] = { OUStringLiteral("edit"), WindowType::EDIT }, { OUStringLiteral("errorbox"), WindowType::ERRORBOX }, { OUStringLiteral("fixedbitmap"),WindowType::FIXEDBITMAP }, +{ OUStringLiteral("fixedhyperlink"), WindowType::CONTROL }, { OUStringLiteral("fixedimage"), WindowType::FIXEDIMAGE }, { OUStringLiteral("fixedline"), WindowType::FIXEDLINE }, { OUStringLiteral("fixedtext"), WindowType::FIXEDTEXT }, @@ -734,9 +735,11 @@ static ComponentInfo const aComponentInfos [] = { OUStringLiteral("okbutton"), WindowType::OKBUTTON }, { OUStringLiteral("patternbox"), WindowType::PATTERNBOX }, { OUStringLiteral("patternfield"), WindowType::PATTERNFIELD }, +{ OUStringLiteral("progressbar"),WindowType::CONTROL }, { OUStringLiteral("pushbutton"), WindowType::PUSHBUTTON }, { OUStringLiteral("querybox"), WindowType::QUERYBOX }, { OUStringLiteral("radiobutton"),WindowType::RADIOBUTTON }, +{ OUStringLiteral("roadmap"),WindowType::CONTROL }, { OUStringLiteral("scrollbar"), WindowType::SCROLLBAR }, { OUStringLiteral("scrollbarbox"), WindowType::SCROLLBARBOX }, { OUStringLiteral("spinbutton"), WindowType::SPINBUTTON }, @@ -1792,12 +1795,12 @@ vcl::Window* VCLXToolkit::ImplCreateWindow( VCLXWindow** ppNewComp, pNewWindow = VclPtr<::vcl::ORoadmap>::Create( pParent, WB_TABSTOP ); *ppNewComp = new SVTXRoadmap; } -else if (aServiceName == "FixedHyperlink") +else if (aServiceName == "fixedhyperlink") { pNewWindow = VclPtr::Create( pParent, nWinBits ); *ppNewComp = new VCLXFixedHyperlink; } -else if (aServiceName == "ProgressBar") +else if (aServiceName == "progressbar") { pNewWindow = VclPtr::Create( pParent, nWinBits ); *ppNewComp = new VCLXProgressBar; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/controls/unocontrols.cxx |7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) New commits: commit 087a6b0cf34ab64801dba5aa7ff3d7ea53c2272b Author: Michael Stahl AuthorDate: Mon Nov 11 18:23:15 2019 +0100 Commit: Michael Stahl CommitDate: Tue Nov 12 13:04:04 2019 +0100 toolkit: UnoEditControl::insertText() assert on invalid index ... in replaceAt(): if the selection that is passed in is invalid, throw an exception. This obviously isn't thread-safe but naively adding a GetMutex() guard quickly deadlocks against SolarMutex; why does it use its own mutex? Reproduces when installing APSO 1.2.5 and starting the Python REPL. Change-Id: I4fb16ab820641f1a031537b0c4d6f8664d67dc0c Reviewed-on: https://gerrit.libreoffice.org/82460 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/toolkit/source/controls/unocontrols.cxx b/toolkit/source/controls/unocontrols.cxx index e2ebbf77ed41..cbb04926bd95 100644 --- a/toolkit/source/controls/unocontrols.cxx +++ b/toolkit/source/controls/unocontrols.cxx @@ -327,6 +327,12 @@ void UnoEditControl::insertText( const awt::Selection& rSel, const OUString& rNe awt::Selection aSelection( rSel ); lcl_normalize( aSelection ); +OUString aOldText = getText(); +if (aSelection.Min < 0 || aOldText.getLength() < aSelection.Max) +{ +throw lang::IllegalArgumentException(); +} + // preserve the selection resp. cursor position awt::Selection aNewSelection( getSelection() ); #ifdef ALSO_PRESERVE_COMPLETE_SELECTION @@ -341,7 +347,6 @@ void UnoEditControl::insertText( const awt::Selection& rSel, const OUString& rNe aNewSelection.Min = aNewSelection.Max; #endif -OUString aOldText = getText(); OUString aNewText = aOldText.replaceAt( aSelection.Min, aSelection.Max - aSelection.Min, rNewText ); setText( aNewText ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: toolkit/source toolkit/test tools/source
toolkit/source/controls/geometrycontrolmodel.cxx |2 +- toolkit/source/controls/unocontrol.cxx |6 +++--- toolkit/source/controls/unocontrols.cxx|2 +- toolkit/test/accessibility/AccessibilityTreeModel.java |2 +- toolkit/test/accessibility/OfficeConnection.java |2 +- toolkit/test/accessibility/news.html |2 +- tools/source/datetime/tdate.cxx|2 +- tools/source/fsys/wldcrd.cxx |2 +- tools/source/inet/inetmime.cxx |2 +- 9 files changed, 11 insertions(+), 11 deletions(-) New commits: commit 263e04b66d11eaf5d05c1e745df69e5f5010f7fb Author: Andrea Gelmini AuthorDate: Sun Aug 11 18:22:26 2019 +0200 Commit: Julien Nabet CommitDate: Mon Aug 12 10:50:55 2019 +0200 Fix typos Change-Id: Ic472270afa13d2c96a4c7ccc185d183c3b7ade2c Reviewed-on: https://gerrit.libreoffice.org/77277 Reviewed-by: Julien Nabet Tested-by: Julien Nabet diff --git a/toolkit/source/controls/geometrycontrolmodel.cxx b/toolkit/source/controls/geometrycontrolmodel.cxx index 53a12342d8de..38827556bb0b 100644 --- a/toolkit/source/controls/geometrycontrolmodel.cxx +++ b/toolkit/source/controls/geometrycontrolmodel.cxx @@ -87,7 +87,7 @@ { m_xAggregate = _pAggregateInstance; -{ // check if the aggregate is cloneable +{ // check if the aggregate is clonable Reference< XCloneable > xCloneAccess(m_xAggregate, UNO_QUERY); m_bCloneable = xCloneAccess.is(); } diff --git a/toolkit/source/controls/unocontrol.cxx b/toolkit/source/controls/unocontrol.cxx index 2359ed44981b..1881fa374bd3 100644 --- a/toolkit/source/controls/unocontrol.cxx +++ b/toolkit/source/controls/unocontrol.cxx @@ -157,7 +157,7 @@ OUString UnoControl::GetComponentServiceName() Reference< XWindowPeer >UnoControl::ImplGetCompatiblePeer() { -DBG_ASSERT( !mbCreatingCompatiblePeer, "ImplGetCompatiblePeer - rekursive?" ); +DBG_ASSERT( !mbCreatingCompatiblePeer, "ImplGetCompatiblePeer - recursive?" ); mbCreatingCompatiblePeer = true; @@ -244,7 +244,7 @@ bool UnoControl::ImplCheckLocalize( OUString& _rPossiblyLocalizable ) void UnoControl::ImplSetPeerProperty( const OUString& rPropName, const Any& rVal ) { -// since a change made in propertiesChange, we can't be sure that this is called with an valid getPeer(), +// since a change made in propertiesChange, we can't be sure that this is called with a valid getPeer(), // this assumption may be false in some (seldom) multi-threading scenarios (cause propertiesChange // releases our mutex before calling here in) // That's why this additional check @@ -565,7 +565,7 @@ void UnoControl::ImplModelPropertiesChanged( const Sequence< PropertyChangeEvent Reference< XWindow >xParent = getParentPeer(); Reference< XControl > xThis( static_cast(static_cast(this)), UNO_QUERY ); -// call createPeer via a interface got from queryInterface, so the aggregating class can intercept it +// call createPeer via an interface got from queryInterface, so the aggregating class can intercept it DBG_ASSERT( !bNeedNewPeer || xParent.is(), "Need new peer, but don't have a parent!" ); diff --git a/toolkit/source/controls/unocontrols.cxx b/toolkit/source/controls/unocontrols.cxx index 97b304699154..6145b6564b7a 100644 --- a/toolkit/source/controls/unocontrols.cxx +++ b/toolkit/source/controls/unocontrols.cxx @@ -1268,7 +1268,7 @@ void UnoRadioButtonControl::itemStateChanged( const awt::ItemEvent& rEvent ) if ( maItemListeners.getLength() ) maItemListeners.itemStateChanged( rEvent ); } -// note that speaking stricly, this is wrong: When in 1.0.x, the user would have de-selected +// note that speaking strictly, this is wrong: When in 1.0.x, the user would have de-selected // a radio button _without_ selecting another one, this would have caused a notification. // With the change done here, this today won't cause a notification anymore. diff --git a/toolkit/test/accessibility/AccessibilityTreeModel.java b/toolkit/test/accessibility/AccessibilityTreeModel.java index 49f3b4ea3c78..b021746bc2e1 100644 --- a/toolkit/test/accessibility/AccessibilityTreeModel.java +++ b/toolkit/test/accessibility/AccessibilityTreeModel.java @@ -175,7 +175,7 @@ public class AccessibilityTreeModel } -/** Add add a new child to a parent. +/** Add a new child to a parent. @return Returns the new or existing representation of the specified accessible object. diff --git a/toolkit/test/accessibility/OfficeConnection.java b/toolkit/test/accessibility/OfficeConnection.java index 4ecb98ba0b47..357c7c6d183b 100644 --- a/toolkit/test/accessibility/OfficeConnection.java +++
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/awt/vclxtoolkit.cxx |3 +++ 1 file changed, 3 insertions(+) New commits: commit 2f9d71b571fa8cb66b3af0b1b8e1ad6c032cb538 Author: Caolán McNamara AuthorDate: Wed Aug 7 09:19:34 2019 +0100 Commit: Caolán McNamara CommitDate: Wed Aug 7 11:18:11 2019 +0200 Resolves: tdf#126717 default that formcontrols show accelerators Change-Id: I755cb19d08ae2a2036a86422d2e455c1033a54df Reviewed-on: https://gerrit.libreoffice.org/77085 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx index 1f97511e0f27..9505a6e907db 100644 --- a/toolkit/source/awt/vclxtoolkit.cxx +++ b/toolkit/source/awt/vclxtoolkit.cxx @@ -1492,6 +1492,9 @@ vcl::Window* VCLXToolkit::ImplCreateWindow( VCLXWindow** ppNewComp, } } +// tdf#126717 default that formcontrols show accelerators +if (Control* pControl = dynamic_cast(pNewWindow.get())) +pControl->SetShowAccelerator(true); return pNewWindow; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/controls/stdtabcontroller.cxx | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) New commits: commit 5cf057c3365a0feafc8f2e4f4a9e24d69a581999 Author: Justin Luth AuthorDate: Sat Jul 6 13:42:12 2019 +0300 Commit: Justin Luth CommitDate: Fri Jul 19 06:14:12 2019 +0200 tdf#125609 toolkit: don't use XTabController::getControls Calling XTabController::getControls was supposed to give performance improvements (coded in OOo), but it pulls cached information which is not up to date if this listener for elementInserted events is handled before the formController's listener. It is missing the most recently created control - and thus it never sees the last control in the form, and fails to create the radio group. Additionally, when all of the controls are not yet created, this function seems to be designed to catch that and immediately return. With the "optimization" the missing controls were never noticed, and so unnecessary processing continued - a performance detriment while the form is being built. My impresssion is that the local getControl() function is not terribly inefficient, so the performance impact seems minimal, especially since it now only makes the call once and caches the result itself. Since not-yet-peered controls cause the function to again terminate early (as it was designed to do), this may have unintended side effects, in case anything was designed in the past 10+ years expecting the old behaviour, so I have no intention of back-porting this. Change-Id: Ica8ddab69043a30b23d008cd8db5df1c13b94ad2 Reviewed-on: https://gerrit.libreoffice.org/75163 Tested-by: Jenkins Reviewed-by: Justin Luth diff --git a/toolkit/source/controls/stdtabcontroller.cxx b/toolkit/source/controls/stdtabcontroller.cxx index 7f89093a8dde..61900b4d76ce 100644 --- a/toolkit/source/controls/stdtabcontroller.cxx +++ b/toolkit/source/controls/stdtabcontroller.cxx @@ -308,18 +308,17 @@ void StdTabController::activateTabOrder( ) if ( !xC.is() || !xVclContainerPeer.is() ) return; -// This may return a TabController, which returns desired list of controls faster -Reference< XTabController > xTabController(static_cast< ::cppu::OWeakObject* >(this), UNO_QUERY); - // Get a flattened list of controls sequences Sequence< Reference< XControlModel > > aModels = mxModel->getControlModels(); Sequence< Reference< XWindow > > aCompSeq; Sequence< Any> aTabSeq; -// DG: For the sake of optimization, retrieve Controls from getControls(), -// this may sound counterproductive, but leads to performance improvements -// in practical scenarios (Forms) -Sequence< Reference< XControl > > aControls = xTabController->getControls(); +// Previously used aControls = xTabController->getControls() "for the sake of optimization", +// but that list isn't valid during the creation phase (missing last created control) because +// listenermultiplexer.cxx handles fmvwimp::elementinserted before formcontroller::elementInserted +// Perhaps other places using the same optimization need to be reviewed? (tdf#125609) +Sequence< Reference< XControl > > aCachedControls = getControls(); +Sequence< Reference< XControl > > aControls = aCachedControls; // #58317# Some Models may be missing from the Container. Plus there is a // autoTabOrder call later on. @@ -337,7 +336,7 @@ void StdTabController::activateTabOrder( ) { mxModel->getGroup( nG, aThisGroupModels, aName ); -aControls = xTabController->getControls(); +aControls = aCachedControls; // ImplCreateComponentSequence has a really strange semantics regarding it's first parameter: // upon method entry, it expects a super set of the controls which it returns // this means we need to completely fill this sequence with all available controls before ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/awt/animatedimagespeer.cxx |4 toolkit/source/awt/vclxtoolkit.cxx| 24 +--- toolkit/source/awt/vclxwindow1.cxx| 12 -- toolkit/source/awt/vclxwindows.cxx| 22 +-- toolkit/source/controls/controlmodelcontainerbase.cxx | 91 ++- toolkit/source/controls/dialogcontrol.cxx | 11 - toolkit/source/controls/geometrycontrolmodel.cxx | 24 +--- toolkit/source/controls/grid/defaultgriddatamodel.cxx | 18 +-- toolkit/source/controls/stdtabcontroller.cxx | 108 -- toolkit/source/controls/stdtabcontrollermodel.cxx | 10 - toolkit/source/controls/tabpagecontainer.cxx |6 - toolkit/source/controls/tabpagemodel.cxx | 10 - toolkit/source/controls/unocontrol.cxx| 32 ++--- toolkit/source/controls/unocontrolcontainer.cxx | 32 ++--- toolkit/source/controls/unocontrolmodel.cxx | 44 +++ toolkit/source/controls/unocontrols.cxx | 53 ++-- toolkit/source/helper/formpdfexport.cxx |9 - toolkit/source/helper/unopropertyarrayhelper.cxx |6 - toolkit/source/helper/vclunohelper.cxx|5 19 files changed, 214 insertions(+), 307 deletions(-) New commits: commit 172a5e3306edbef3d40d9850c446dba00b7ada06 Author: Arkadiy Illarionov AuthorDate: Sun Jun 30 13:39:03 2019 +0300 Commit: Arkadiy Illarionov CommitDate: Sun Jun 30 17:17:49 2019 +0200 Simplify Sequence iterations in toolkit Use range-based loops or replace with STL functions Change-Id: I8129ca201dd7017fc4064b04834f41d69cc01274 Reviewed-on: https://gerrit.libreoffice.org/74926 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov diff --git a/toolkit/source/awt/animatedimagespeer.cxx b/toolkit/source/awt/animatedimagespeer.cxx index 4d1be4be96e7..5277841af3e6 100644 --- a/toolkit/source/awt/animatedimagespeer.cxx +++ b/toolkit/source/awt/animatedimagespeer.cxx @@ -169,9 +169,9 @@ namespace toolkit o_images.resize(0); size_t count = size_t( i_imageURLs.getLength() ); o_images.reserve( count ); -for ( size_t i = 0; i < count; ++i ) +for ( const auto& rImageURL : i_imageURLs ) { -o_images.emplace_back( i_imageURLs[i] ); +o_images.emplace_back( rImageURL ); } } diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx index 904f95fd5e38..42c135c7b889 100644 --- a/toolkit/source/awt/vclxtoolkit.cxx +++ b/toolkit/source/awt/vclxtoolkit.cxx @@ -1413,14 +1413,12 @@ vcl::Window* VCLXToolkit::ImplCreateWindow( VCLXWindow** ppNewComp, css::uno::Sequence< css::beans::NamedValue > aProps; if( anyHandle >>= aProps ) { -const int nProps = aProps.getLength(); -const css::beans::NamedValue* pProps = aProps.getConstArray(); -for( int i = 0; i < nProps; i++ ) +for( const css::beans::NamedValue& rProp : aProps ) { -if ( pProps[i].Name == "WINDOW" ) -pProps[i].Value >>= nWindowHandle; -else if ( pProps[i].Name == "XEMBED" ) -pProps[i].Value >>= bXEmbed; +if ( rProp.Name == "WINDOW" ) +rProp.Value >>= nWindowHandle; +else if ( rProp.Name == "XEMBED" ) +rProp.Value >>= bXEmbed; } } else @@ -1645,14 +1643,12 @@ css::uno::Reference< css::awt::XWindowPeer > VCLXToolkit::createSystemChild( con css::uno::Sequence< css::beans::NamedValue > aProps; if( Parent >>= aProps ) { -const int nProps = aProps.getLength(); -const css::beans::NamedValue* pProps = aProps.getConstArray(); -for( int i = 0; i < nProps; i++ ) +for( const css::beans::NamedValue& rProp : aProps ) { -if ( pProps[i].Name == "WINDOW" ) -pProps[i].Value >>= nWindowHandle; -else if ( pProps[i].Name == "XEMBED" ) -pProps[i].Value >>= bXEmbed; +if ( rProp.Name == "WINDOW" ) +rProp.Value >>= nWindowHandle; +
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/controls/grid/defaultgridcolumnmodel.cxx |7 --- toolkit/source/controls/grid/gridcolumn.cxx |9 - toolkit/source/controls/grid/gridcolumn.hxx |1 - 3 files changed, 4 insertions(+), 13 deletions(-) New commits: commit b0efb1be8ed02f34ab4a2bc0c933c4378b2715e3 Author: Arkadiy Illarionov AuthorDate: Tue Jun 18 00:22:09 2019 +0300 Commit: Stephan Bergmann CommitDate: Tue Jun 18 13:26:45 2019 +0200 tdf#39593 Remove toolkit::GridColumn::getImplementation Replace with comphelper::getUnoTunnelImplementation. Change-Id: I6b32cf388f32e7aa8f073daea0423fcbf169386d Reviewed-on: https://gerrit.libreoffice.org/74235 Reviewed-by: Stephan Bergmann Tested-by: Stephan Bergmann diff --git a/toolkit/source/controls/grid/defaultgridcolumnmodel.cxx b/toolkit/source/controls/grid/defaultgridcolumnmodel.cxx index 00a34fc696c2..3883f662a48b 100644 --- a/toolkit/source/controls/grid/defaultgridcolumnmodel.cxx +++ b/toolkit/source/controls/grid/defaultgridcolumnmodel.cxx @@ -28,6 +28,7 @@ #include #include +#include #include #include #include @@ -115,7 +116,7 @@ private: Reference< css::util::XCloneable > const xCloneable( *col, UNO_QUERY_THROW ); Reference< XGridColumn > const xClone( xCloneable->createClone(), UNO_QUERY_THROW ); -GridColumn* const pGridColumn = GridColumn::getImplementation( xClone ); +GridColumn* const pGridColumn = comphelper::getUnoTunnelImplementation( xClone ); if ( pGridColumn == nullptr ) throw RuntimeException( "invalid clone source implementation", *this ); // that's indeed a RuntimeException, not an IllegalArgumentException or some such: @@ -151,7 +152,7 @@ private: { ::comphelper::ComponentGuard aGuard( *this, rBHelper ); -GridColumn* const pGridColumn = GridColumn::getImplementation( i_column ); +GridColumn* const pGridColumn = comphelper::getUnoTunnelImplementation( i_column ); if ( pGridColumn == nullptr ) throw css::lang::IllegalArgumentException( "invalid column implementation", *this, 1 ); @@ -190,7 +191,7 @@ private: ++updatePos, ++columnIndex ) { -GridColumn* pColumnImpl = GridColumn::getImplementation( *updatePos ); +GridColumn* pColumnImpl = comphelper::getUnoTunnelImplementation( *updatePos ); if ( !pColumnImpl ) { SAL_WARN( "toolkit.controls", "DefaultGridColumnModel::removeColumn: invalid column implementation!" ); diff --git a/toolkit/source/controls/grid/gridcolumn.cxx b/toolkit/source/controls/grid/gridcolumn.cxx index 6cf9b0639fdf..acb64eccf76c 100644 --- a/toolkit/source/controls/grid/gridcolumn.cxx +++ b/toolkit/source/controls/grid/gridcolumn.cxx @@ -298,15 +298,6 @@ namespace toolkit static ::cppu::OImplementationId const aId; return aId.getImplementationId(); } - - -GridColumn* GridColumn::getImplementation( const Reference< XInterface >& i_component ) -{ -Reference< XUnoTunnel > const xTunnel( i_component, UNO_QUERY ); -if ( xTunnel.is() ) -return reinterpret_cast< GridColumn* >( ::sal::static_int_cast< sal_IntPtr >( xTunnel->getSomething( getUnoTunnelId() ) ) ); -return nullptr; -} } extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * diff --git a/toolkit/source/controls/grid/gridcolumn.hxx b/toolkit/source/controls/grid/gridcolumn.hxx index 65a61363d7e6..4986fb164b8c 100644 --- a/toolkit/source/controls/grid/gridcolumn.hxx +++ b/toolkit/source/controls/grid/gridcolumn.hxx @@ -88,7 +88,6 @@ public: // XUnoTunnel and friends virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& i_identifier ) override; static css::uno::Sequence< sal_Int8 > getUnoTunnelId() throw(); -static GridColumn* getImplementation( const css::uno::Reference< css::uno::XInterface >& i_component ); // attribute access void setIndex( sal_Int32 const i_index ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: toolkit/source tools/source ucb/source unotools/source unoxml/Library_unoxml.mk unoxml/source
toolkit/source/controls/unocontrols.cxx |8 +- tools/source/debug/debug.cxx|9 ++ ucb/source/core/provprox.cxx|5 - unotools/source/config/configitem.cxx | 96 unotools/source/config/pathoptions.cxx |5 - unotools/source/i18n/calendarwrapper.cxx| 87 +++-- unotools/source/i18n/charclass.cxx |9 +- unotools/source/i18n/localedatawrapper.cxx | 41 +- unotools/source/i18n/transliterationwrapper.cxx | 17 ++-- unotools/source/misc/mediadescriptor.cxx| 22 ++--- unotools/source/ucbhelper/ucbhelper.cxx | 12 +-- unoxml/Library_unoxml.mk|1 unoxml/source/dom/documentbuilder.cxx | 17 ++-- unoxml/source/dom/elementlist.cxx |5 - 14 files changed, 159 insertions(+), 175 deletions(-) New commits: commit 70accc2904edb5c4aa9b5acb7ff2889a77717b75 Author: Noel Grandin AuthorDate: Tue Jun 18 09:33:18 2019 +0200 Commit: Noel Grandin CommitDate: Tue Jun 18 10:31:43 2019 +0200 loplugin:logexceptionnicely in toolkit..unoxml Change-Id: I0a3126545f9ef98640f6dd166290e9b9e91b8355 Reviewed-on: https://gerrit.libreoffice.org/74244 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/toolkit/source/controls/unocontrols.cxx b/toolkit/source/controls/unocontrols.cxx index 937b05745273..e6ec3492bb74 100644 --- a/toolkit/source/controls/unocontrols.cxx +++ b/toolkit/source/controls/unocontrols.cxx @@ -2884,9 +2884,9 @@ void UnoListBoxControl::itemStateChanged( const awt::ItemEvent& rEvent ) { maItemListeners.itemStateChanged( rEvent ); } -catch( const Exception& e ) +catch( const Exception& ) { -SAL_WARN( "toolkit", "UnoListBoxControl::itemStateChanged: caught " << e); +TOOLS_WARN_EXCEPTION( "toolkit", "UnoListBoxControl::itemStateChanged"); } } } @@ -3222,9 +3222,9 @@ void UnoComboBoxControl::itemStateChanged( const awt::ItemEvent& rEvent ) { maItemListeners.itemStateChanged( rEvent ); } -catch( const Exception& e ) +catch( const Exception& ) { -SAL_WARN( "toolkit", "UnoComboBoxControl::itemStateChanged: caught " << e); +TOOLS_WARN_EXCEPTION( "toolkit", "UnoComboBoxControl::itemStateChanged"); } } } diff --git a/tools/source/debug/debug.cxx b/tools/source/debug/debug.cxx index fdfd7259d3cf..9b9419599b7d 100644 --- a/tools/source/debug/debug.cxx +++ b/tools/source/debug/debug.cxx @@ -41,6 +41,7 @@ #include #include #include +#include #include #include #include @@ -384,6 +385,14 @@ OString exceptionToString(const css::uno::Any & caught) sMessage += OString::number( specialized.ColumnNumber ); } } +{ +css::ucb::InteractiveIOException specialized; +if ( caught >>= specialized ) +{ +sMessage += " Code: "; +sMessage += OString::number( static_cast(specialized.Code) ); +} +} return sMessage; } diff --git a/ucb/source/core/provprox.cxx b/ucb/source/core/provprox.cxx index 25e1a1d1ff74..fbf44c7eb091 100644 --- a/ucb/source/core/provprox.cxx +++ b/ucb/source/core/provprox.cxx @@ -21,6 +21,7 @@ #include #include #include +#include #include "provprox.hxx" #include #include @@ -311,9 +312,9 @@ UcbContentProviderProxy::getContentProvider() { throw; } -catch ( Exception const & e) +catch ( Exception const & ) { -SAL_INFO( "ucb.core", "Exception when getting content provider: " << e ); +TOOLS_INFO_EXCEPTION( "ucb.core", "Exception getting content provider"); } // registerInstance called at proxy, but not yet at original? diff --git a/unotools/source/config/configitem.cxx b/unotools/source/config/configitem.cxx index 803413259d11..6f5e99940703 100644 --- a/unotools/source/config/configitem.cxx +++ b/unotools/source/config/configitem.cxx @@ -412,13 +412,12 @@ Sequence< Any > ConfigItem::GetProperties(const Sequence< OUString >& rNames) { pRet[i] = xHierarchyAccess->getByHierarchicalName(pNames[i]); } -catch (const Exception& rEx) +catch (const Exception&) { -SAL_WARN( +TOOLS_WARN_EXCEPTION( "unotools.config", "ignoring XHierarchicalNameAccess to /org.openoffice." -<< sSubTree << "/" << pNames[i] << " Exception: " -<< rEx); +<< sSubTree << "/" << pNames[i]); } } @@ -494,11 +493,9 @@ bool ConfigItem::PutProperties( const Sequence< OUString >& rNames,
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/awt/vclxwindows.cxx |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) New commits: commit 9e1d1e2cab4933e586910604d2044c085666de93 Author: Ashod Nakashian AuthorDate: Wed Mar 27 21:26:21 2019 -0400 Commit: Jan Holesovsky CommitDate: Wed Jun 12 11:49:23 2019 +0200 toolkit: initialize primitive types explicitly Change-Id: I1e09d458d1c6c4842750368fbd45ef326fa1bedb Reviewed-on: https://gerrit.libreoffice.org/70160 Reviewed-by: Ashod Nakashian Tested-by: Ashod Nakashian Reviewed-on: https://gerrit.libreoffice.org/73491 Tested-by: Jenkins Reviewed-by: Jan Holesovsky diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx index 8c1c69d2f792..f7281ced9c1d 100644 --- a/toolkit/source/awt/vclxwindows.cxx +++ b/toolkit/source/awt/vclxwindows.cxx @@ -1872,14 +1872,14 @@ void VCLXListBox::setProperty( const OUString& PropertyName, const css::uno::Any break; case BASEPROPERTY_READONLY: { -bool b = bool(); +bool b = false; if ( Value >>= b ) pListBox->SetReadOnly( b); } break; case BASEPROPERTY_MULTISELECTION: { -bool b = bool(); +bool b = false; if ( Value >>= b ) pListBox->EnableMultiSelection( b ); } @@ -1889,7 +1889,7 @@ void VCLXListBox::setProperty( const OUString& PropertyName, const css::uno::Any break; case BASEPROPERTY_LINECOUNT: { -sal_Int16 n = sal_Int16(); +sal_Int16 n = 0; if ( Value >>= n ) pListBox->SetDropDownLineCount( n ); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/awt/vclxwindow.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 6567a7542b6a6f47221501fac4e515c16b280f75 Author: Samuel Mehrbrodt AuthorDate: Mon May 6 10:12:00 2019 +0200 Commit: Samuel Mehrbrodt CommitDate: Mon May 6 13:35:07 2019 +0200 Fix indentation Change-Id: Icc3c1c601dcd2f950f5af4e2dbf2455a59636154 Reviewed-on: https://gerrit.libreoffice.org/71849 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt diff --git a/toolkit/source/awt/vclxwindow.cxx b/toolkit/source/awt/vclxwindow.cxx index 0f37e710e0b2..bacb184fded0 100644 --- a/toolkit/source/awt/vclxwindow.cxx +++ b/toolkit/source/awt/vclxwindow.cxx @@ -864,7 +864,7 @@ void VCLXWindow::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) aEvent.Source = static_cast(this); mpImpl->getDockableWindowListeners().notifyEach( ::toggleFloatingMode, aEvent ); } - } +} break; case VclEventId::WindowEndPopupMode: { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/awt/vclxtabpagecontainer.cxx |2 ++ toolkit/source/controls/tabpagecontainer.cxx |4 2 files changed, 6 insertions(+) New commits: commit 0e86f0c79e29bde4a29ef77046621398b6bede63 Author: Samuel Mehrbrodt AuthorDate: Fri May 3 16:16:33 2019 +0200 Commit: Samuel Mehrbrodt CommitDate: Mon May 6 07:30:57 2019 +0200 Throw exception when peer for tabpage container is missing To give extension developers a clue what is missing Change-Id: I4a4727bdbf0522f8dd398c7aa877e49235efeb86 Reviewed-on: https://gerrit.libreoffice.org/71751 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt diff --git a/toolkit/source/awt/vclxtabpagecontainer.cxx b/toolkit/source/awt/vclxtabpagecontainer.cxx index da6ed54f8941..56e492ea8069 100644 --- a/toolkit/source/awt/vclxtabpagecontainer.cxx +++ b/toolkit/source/awt/vclxtabpagecontainer.cxx @@ -179,6 +179,8 @@ void SAL_CALL VCLXTabPageContainer::elementInserted( const css::container::Conta Reference< awt::tab::XTabPageModel > xP( xControl->getModel(), UNO_QUERY ); sal_Int16 nPageID = xP->getTabPageID(); +if (!xControl->getPeer().is()) +throw RuntimeException("No peer for tabpage container!"); VclPtr pWindow = VCLUnoHelper::GetWindow(xControl->getPeer()); TabPage* pPage = static_cast(pWindow.get()); pTabCtrl->InsertPage(nPageID,pPage->GetText()); diff --git a/toolkit/source/controls/tabpagecontainer.cxx b/toolkit/source/controls/tabpagecontainer.cxx index f7084896db19..18bda42e9e11 100644 --- a/toolkit/source/controls/tabpagecontainer.cxx +++ b/toolkit/source/controls/tabpagecontainer.cxx @@ -301,6 +301,8 @@ void SAL_CALL UnoControlTabPageContainer::removeTabPageContainerListener( const void UnoControlTabPageContainer::updateFromModel() { UnoControlTabPageContainer_Base::updateFromModel(); +if (!getPeer().is()) +throw RuntimeException("No peer for tabpage container!"); Reference< XContainerListener > xContainerListener( getPeer(), UNO_QUERY ); ENSURE_OR_RETURN_VOID( xContainerListener.is(), "UnoListBoxControl::updateFromModel: a peer which is no ItemListListener?!" ); @@ -320,6 +322,8 @@ void SAL_CALL UnoControlTabPageContainer::addControl( const OUString& Name, cons { SolarMutexGuard aSolarGuard; ControlContainerBase::addControl(Name,Control); +if (!getPeer().is()) +throw RuntimeException("No peer for tabpage container!"); Reference< XContainerListener > xContainerListener( getPeer(), UNO_QUERY ); ContainerEvent aEvent; aEvent.Source = getModel(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/controls/stdtabcontroller.cxx |5 - 1 file changed, 4 insertions(+), 1 deletion(-) New commits: commit c211646a236fed7fb0bff62cf42ed79f83f1f336 Author: Samuel Mehrbrodt AuthorDate: Fri Apr 26 07:41:34 2019 +0200 Commit: Samuel Mehrbrodt CommitDate: Fri Apr 26 09:24:33 2019 +0200 Convert DBG_ASSERT to exception Change-Id: I661de626d21df3ad2ec962a37e4bb33d53a958bc Reviewed-on: https://gerrit.libreoffice.org/71342 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt diff --git a/toolkit/source/controls/stdtabcontroller.cxx b/toolkit/source/controls/stdtabcontroller.cxx index c9fb9f99a1e1..d94ffd006c81 100644 --- a/toolkit/source/controls/stdtabcontroller.cxx +++ b/toolkit/source/controls/stdtabcontroller.cxx @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -395,7 +396,9 @@ css::uno::Sequence StdTabController::getSupportedServiceNames() Reference< XControl > StdTabController::FindControl( Sequence< Reference< XControl > >& rCtrls, const Reference< XControlModel > & rxCtrlModel ) { -DBG_ASSERT( rxCtrlModel.is(), "ImplFindControl - which one ?!" ); +if (!rxCtrlModel.is()) +throw lang::IllegalArgumentException("No valid XControlModel", + uno::Reference(), 0); const Reference< XControl > * pCtrls = rCtrls.getConstArray(); sal_Int32 nCtrls = rCtrls.getLength(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/controls/stdtabcontroller.cxx |6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) New commits: commit f14fd17e2dd66fa1c70358a3bdf2ec72e68714ac Author: Samuel Mehrbrodt AuthorDate: Fri Apr 26 07:34:54 2019 +0200 Commit: Samuel Mehrbrodt CommitDate: Fri Apr 26 09:14:00 2019 +0200 Convert DBG_ASSERT to assert Change-Id: Ia28bf8fa53fa81c73a422c2af280e0418bd2aaf0 Reviewed-on: https://gerrit.libreoffice.org/71341 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt diff --git a/toolkit/source/controls/stdtabcontroller.cxx b/toolkit/source/controls/stdtabcontroller.cxx index 42d614702856..c9fb9f99a1e1 100644 --- a/toolkit/source/controls/stdtabcontroller.cxx +++ b/toolkit/source/controls/stdtabcontroller.cxx @@ -81,11 +81,9 @@ bool StdTabController::ImplCreateComponentSequence( aSeq.realloc(nRealControls); rControls = aSeq; } -#ifdef DBG_UTIL -DBG_ASSERT( rControls.getLength() <= rModels.getLength(), "StdTabController:ImplCreateComponentSequence: inconsistence!" ); -// there may be less controls than models, but never more controls than models -#endif +// there may be less controls than models, but never more controls than models +assert(rControls.getLength() <= rModels.getLength()); const Reference< XControl > * pControls = rControls.getConstArray(); sal_uInt32 nCtrls = rControls.getLength(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/controls/dialogcontrol.cxx |2 +- toolkit/source/controls/tabpagemodel.cxx |4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) New commits: commit df2fc7c3e58758fc87de70d462be5d2eb26eea4a Author: Samuel Mehrbrodt AuthorDate: Fri Apr 26 07:27:10 2019 +0200 Commit: Samuel Mehrbrodt CommitDate: Fri Apr 26 07:35:42 2019 +0200 Fix typos Change-Id: I155673b9b1b2ba1f275877ce7885cf3f99fcb2e3 Reviewed-on: https://gerrit.libreoffice.org/71340 Reviewed-by: Samuel Mehrbrodt Tested-by: Samuel Mehrbrodt diff --git a/toolkit/source/controls/dialogcontrol.cxx b/toolkit/source/controls/dialogcontrol.cxx index a2fc60f9c8e0..ef23735bdc25 100644 --- a/toolkit/source/controls/dialogcontrol.cxx +++ b/toolkit/source/controls/dialogcontrol.cxx @@ -523,7 +523,7 @@ void SAL_CALL UnoDialogControl::windowMoved( const css::awt::WindowEvent& e ) if ( !pOutDev || mbPosModified ) return; -// Currentley we are simply using MapUnit::MapAppFont +// Currently we are simply using MapUnit::MapAppFont ::Size aTmp( e.X, e.Y ); aTmp = ImplMapPixelToAppFont( pOutDev, aTmp ); diff --git a/toolkit/source/controls/tabpagemodel.cxx b/toolkit/source/controls/tabpagemodel.cxx index f3538c5ddda5..afbd535692ce 100644 --- a/toolkit/source/controls/tabpagemodel.cxx +++ b/toolkit/source/controls/tabpagemodel.cxx @@ -238,7 +238,7 @@ void SAL_CALL UnoControlTabPage::windowResized( const css::awt::WindowEvent& e ) if ( !pOutDev || mbSizeModified ) return; -// Currentley we are simply using MapUnit::MapAppFont +// Currently we are simply using MapUnit::MapAppFont ::Size aAppFontSize( e.Width, e.Height ); Reference< XControl > xDialogControl( *this, UNO_QUERY_THROW ); @@ -276,7 +276,7 @@ void SAL_CALL UnoControlTabPage::windowMoved( const css::awt::WindowEvent& e ) if ( !pOutDev || mbPosModified ) return; -// Currentley we are simply using MapUnit::MapAppFont +// Currently we are simply using MapUnit::MapAppFont ::Size aTmp( e.X, e.Y ); aTmp = ImplMapPixelToAppFont( pOutDev, aTmp ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/controls/controlmodelcontainerbase.cxx |9 - 1 file changed, 8 insertions(+), 1 deletion(-) New commits: commit 4abb7335529a66346a2a68a089b9c8438faa2e39 Author: Vasily Melenchuk AuthorDate: Tue Mar 26 15:23:28 2019 +0300 Commit: Thorsten Behrens CommitDate: Thu Mar 28 11:52:16 2019 +0100 tdf#124385: toolkit: do not fail if ResourceListener is not defined If current control (for example TabPageContainer) is missing resource listener property we should not fail script with exception. Just behave as with empty ResourceListener. Change-Id: I260feec775a5d197bebc9414b652dd6f89e35035 Reviewed-on: https://gerrit.libreoffice.org/69740 Tested-by: Jenkins Reviewed-by: Thorsten Behrens diff --git a/toolkit/source/controls/controlmodelcontainerbase.cxx b/toolkit/source/controls/controlmodelcontainerbase.cxx index a7721a72146a..10da911540e2 100644 --- a/toolkit/source/controls/controlmodelcontainerbase.cxx +++ b/toolkit/source/controls/controlmodelcontainerbase.cxx @@ -1741,6 +1741,9 @@ void ControlContainerBase::ImplStartListingForResourceEvents() { Reference< resource::XStringResourceResolver > xStringResourceResolver; +if ( !ImplHasProperty(PROPERTY_RESOURCERESOLVER) ) +return; + ImplGetPropertyValue( PROPERTY_RESOURCERESOLVER ) >>= xStringResourceResolver; // Add our helper as listener to retrieve notifications about changes @@ -1757,7 +1760,11 @@ void ControlContainerBase::ImplUpdateResourceResolver() { Reference< resource::XStringResourceResolver > xStringResourceResolver; -ImplGetPropertyValue( PROPERTY_RESOURCERESOLVER ) >>= xStringResourceResolver; +if ( !ImplHasProperty(PROPERTY_RESOURCERESOLVER) ) +return; + +ImplGetPropertyValue(PROPERTY_RESOURCERESOLVER) >>= xStringResourceResolver; + if ( !xStringResourceResolver.is() ) return; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/helper/formpdfexport.cxx | 16 1 file changed, 8 insertions(+), 8 deletions(-) New commits: commit c95b13c1ad9e01462180feb996ef4efb764eb879 Author: Noel Grandin AuthorDate: Wed Mar 27 09:46:39 2019 +0200 Commit: Noel Grandin CommitDate: Thu Mar 28 07:39:03 2019 +0100 return by unique_ptr from createDefaultWidget Change-Id: I2b2c944ed090173aba36395457a84985f0cf6665 Reviewed-on: https://gerrit.libreoffice.org/69794 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/toolkit/source/helper/formpdfexport.cxx b/toolkit/source/helper/formpdfexport.cxx index 3c8d7343a136..8b4a69b93861 100644 --- a/toolkit/source/helper/formpdfexport.cxx +++ b/toolkit/source/helper/formpdfexport.cxx @@ -86,20 +86,20 @@ namespace toolkitform /** (default-)creates a PDF widget according to a given FormComponentType */ -vcl::PDFWriter::AnyWidget* createDefaultWidget( sal_Int16 _nFormComponentType ) +std::unique_ptr createDefaultWidget( sal_Int16 _nFormComponentType ) { switch ( _nFormComponentType ) { case FormComponentType::COMMANDBUTTON: -return new vcl::PDFWriter::PushButtonWidget; +return std::make_unique(); case FormComponentType::CHECKBOX: -return new vcl::PDFWriter::CheckBoxWidget; +return std::make_unique(); case FormComponentType::RADIOBUTTON: -return new vcl::PDFWriter::RadioButtonWidget; +return std::make_unique(); case FormComponentType::LISTBOX: -return new vcl::PDFWriter::ListBoxWidget; +return std::make_unique(); case FormComponentType::COMBOBOX: -return new vcl::PDFWriter::ComboBoxWidget; +return std::make_unique(); case FormComponentType::TEXTFIELD: case FormComponentType::FILECONTROL: @@ -108,7 +108,7 @@ namespace toolkitform case FormComponentType::NUMERICFIELD: case FormComponentType::CURRENCYFIELD: case FormComponentType::PATTERNFIELD: -return new vcl::PDFWriter::EditWidget; +return std::make_unique(); } return nullptr; } @@ -288,7 +288,7 @@ namespace toolkitform { Reference< XPropertySet > xModelProps( _rxControl->getModel(), UNO_QUERY ); sal_Int16 nControlType = classifyFormControl( xModelProps ); -Descriptor.reset( createDefaultWidget( nControlType ) ); +Descriptor = createDefaultWidget( nControlType ); if (!Descriptor) // no PDF widget available for this return Descriptor; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/controls/dialogcontrol.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit bea51529e98c34791f4705c632939184b20bf2a4 Author: Samuel Mehrbrodt AuthorDate: Fri Mar 1 08:19:59 2019 +0100 Commit: Julien Nabet CommitDate: Fri Mar 1 08:48:35 2019 +0100 Fix typo Change-Id: I9af60e867813e4222183517dfebbfef11d256b83 Reviewed-on: https://gerrit.libreoffice.org/68530 Reviewed-by: Julien Nabet Tested-by: Julien Nabet diff --git a/toolkit/source/controls/dialogcontrol.cxx b/toolkit/source/controls/dialogcontrol.cxx index 1d4b9fe735df..67c2afb54ee6 100644 --- a/toolkit/source/controls/dialogcontrol.cxx +++ b/toolkit/source/controls/dialogcontrol.cxx @@ -482,7 +482,7 @@ void SAL_CALL UnoDialogControl::windowResized( const css::awt::WindowEvent& e ) if ( !pOutDev || mbSizeModified ) return; -// Currentley we are simply using MapUnit::MapAppFont +// Currently we are simply using MapUnit::MapAppFont ::Size aAppFontSize( e.Width, e.Height ); Reference< XControl > xDialogControl( *this, UNO_QUERY_THROW ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/controls/unocontrol.cxx | 10 ++ 1 file changed, 10 insertions(+) New commits: commit e55c7ff6df82c597763d2eb551f7ccdaa95cd0a9 Author: Samuel Mehrbrodt AuthorDate: Thu Feb 28 21:24:54 2019 +0100 Commit: Samuel Mehrbrodt CommitDate: Fri Mar 1 07:59:43 2019 +0100 tdf#123772 UnoControlDialogModel: Don't ignore property "Sizeable" which is supposed to make the dialog resizable, but was silently ignored. Change-Id: Ifa2d2ea70c769f7785ac044ab2b681802c54bc17 Reviewed-on: https://gerrit.libreoffice.org/68515 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt diff --git a/toolkit/source/controls/unocontrol.cxx b/toolkit/source/controls/unocontrol.cxx index 302327c4575d..f7612736efc6 100644 --- a/toolkit/source/controls/unocontrol.cxx +++ b/toolkit/source/controls/unocontrol.cxx @@ -1165,6 +1165,16 @@ void UnoControl::createPeer( const Reference< XToolkit >& rxToolkit, const Refer aDescr.WindowAttributes |= WindowAttribute::MOVEABLE; } +// Sizeable +aPropName = GetPropertyName( BASEPROPERTY_SIZEABLE ); +if ( xInfo->hasPropertyByName( aPropName ) ) +{ +aVal = xPSet->getPropertyValue( aPropName ); +bool b = bool(); +if ( ( aVal >>= b ) && b) +aDescr.WindowAttributes |= WindowAttribute::SIZEABLE; +} + // Closeable aPropName = GetPropertyName( BASEPROPERTY_CLOSEABLE ); if ( xInfo->hasPropertyByName( aPropName ) ) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/awt/vclxprinter.cxx |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) New commits: commit 88895d7451ad095510d5dbe6c760b6fbccd95b05 Author: Matteo Casalin AuthorDate: Sat Jan 26 00:51:57 2019 +0100 Commit: Matteo Casalin CommitDate: Fri Feb 8 19:36:18 2019 +0100 Avoid index for single getToken call Change-Id: I4b7dfd024369258efb84ec8d1c1cd16f4a7aa730 Reviewed-on: https://gerrit.libreoffice.org/66944 Tested-by: Jenkins Reviewed-by: Matteo Casalin diff --git a/toolkit/source/awt/vclxprinter.cxx b/toolkit/source/awt/vclxprinter.cxx index aa24f31d939f..912e721b6eda 100644 --- a/toolkit/source/awt/vclxprinter.cxx +++ b/toolkit/source/awt/vclxprinter.cxx @@ -206,9 +206,8 @@ void VCLXPrinterPropertySet::selectForm( const OUString& rFormDescription ) { ::osl::MutexGuard aGuard( Mutex ); -sal_Int32 nIndex = 0; sal_uInt16 nPaperBin = sal::static_int_cast< sal_uInt16 >( -rFormDescription.getToken( 3, ';', nIndex ).toInt32()); +rFormDescription.getToken( 3, ';' ).toInt32()); GetPrinter()->SetPaperBin( nPaperBin ); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/controls/tabpagemodel.cxx |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) New commits: commit 24e7d98219191ccdab3673ac96fa866c449cac5f Author: Vasily Melenchuk AuthorDate: Wed Feb 6 00:41:25 2019 +0300 Commit: Michael Stahl CommitDate: Wed Feb 6 11:23:34 2019 +0100 basic: fix for UnoControlTabPageModel get/set properties The userformscontainers is required property to pass checks in getter/setter, but returning true instead of actual type is not a best idea. So let's return actually expected dummy empty container. Change-Id: I5cc3e5462ed82f6f2f8e5a45d9fc2d9f9ce1c76f Reviewed-on: https://gerrit.libreoffice.org/67431 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/toolkit/source/controls/tabpagemodel.cxx b/toolkit/source/controls/tabpagemodel.cxx index 85f7347c4038..738b526568b3 100644 --- a/toolkit/source/controls/tabpagemodel.cxx +++ b/toolkit/source/controls/tabpagemodel.cxx @@ -86,9 +86,10 @@ Any UnoControlTabPageModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const break; case BASEPROPERTY_USERFORMCONTAINEES: { -// We do not have here any usercontainers (yet?), but let's return something back +// We do not have here any usercontainers (yet?), but let's return empty container back // so normal properties could be set without triggering UnknownPropertyException -return makeAny(true); +aAny <<= uno::Reference< XNameContainer >(); +break; } default: aAny = UnoControlModel::ImplGetDefaultValue( nPropId ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/awt/vclxtoolkit.cxx |5 - 1 file changed, 4 insertions(+), 1 deletion(-) New commits: commit 18f2e73f51c0f09c94f1a2b701d8e064adb39bf5 Author: Vasily Melenchuk AuthorDate: Thu Jan 31 06:57:50 2019 +0300 Commit: Thorsten Behrens CommitDate: Mon Feb 4 11:39:30 2019 +0100 tdf#87884: UnoControlTabPageModel is using tabs w/o WB_NOBORDER No border attribute is a special case for vcl/TabControl, so by defualt created with corresponding UNO interface tabs were invisible. To create invisible tabs there is already "tabcontrolnotabs"(?) Change-Id: I3cc9baef9106f6c3fb5688daadbb5844d2b2a008 Reviewed-on: https://gerrit.libreoffice.org/67188 Tested-by: Jenkins Reviewed-by: Thorsten Behrens diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx index fcfa51958ca9..14727b21d7e9 100644 --- a/toolkit/source/awt/vclxtoolkit.cxx +++ b/toolkit/source/awt/vclxtoolkit.cxx @@ -1468,7 +1468,10 @@ vcl::Window* VCLXToolkit::ImplCreateWindow( VCLXWindow** ppNewComp, if ( rDescriptor.WindowServiceName.equalsIgnoreAsciiCase( "tabpagecontainer" ) ) { -pNewWindow = VclPtr::Create( pParent, nWinBits ); +// TabControl has a special case for tabs without border: they are displayed +// in a different way, so we need to ensure that this style is not set, so +// we can guarantee normal tab behavior +pNewWindow = VclPtr::Create( pParent, nWinBits & (~WB_NOBORDER)); *ppNewComp = new VCLXTabPageContainer; } else if ( aServiceName == "animatedimages" ) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/controls/tabpagemodel.cxx |7 +++ 1 file changed, 7 insertions(+) New commits: commit 3deab788199395712b7d4641be5b11623b2ed964 Author: Vasily Melenchuk AuthorDate: Wed Jan 23 15:11:38 2019 +0300 Commit: Thorsten Behrens CommitDate: Mon Feb 4 11:39:05 2019 +0100 tdf#87884: basic: fix for UnknownPropertyException UnoControlTabPageModel had no USERFOMRCONTAINERS property and this was causing an exception during any attempt to set its properties. Change-Id: Icc432d7a431ecd861ac4f00a96ec75165bec168c Reviewed-on: https://gerrit.libreoffice.org/66801 Reviewed-by: Thorsten Behrens Tested-by: Thorsten Behrens diff --git a/toolkit/source/controls/tabpagemodel.cxx b/toolkit/source/controls/tabpagemodel.cxx index b0731ec3b9e3..85f7347c4038 100644 --- a/toolkit/source/controls/tabpagemodel.cxx +++ b/toolkit/source/controls/tabpagemodel.cxx @@ -54,6 +54,7 @@ UnoControlTabPageModel::UnoControlTabPageModel( Reference< XComponentContext > c ImplRegisterProperty( BASEPROPERTY_TITLE ); ImplRegisterProperty( BASEPROPERTY_HELPTEXT ); ImplRegisterProperty( BASEPROPERTY_HELPURL ); +ImplRegisterProperty( BASEPROPERTY_USERFORMCONTAINEES ); } OUString SAL_CALL UnoControlTabPageModel::getImplementationName() @@ -83,6 +84,12 @@ Any UnoControlTabPageModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const case BASEPROPERTY_DEFAULTCONTROL: aAny <<= OUString("com.sun.star.awt.tab.UnoControlTabPage"); break; +case BASEPROPERTY_USERFORMCONTAINEES: +{ +// We do not have here any usercontainers (yet?), but let's return something back +// so normal properties could be set without triggering UnknownPropertyException +return makeAny(true); +} default: aAny = UnoControlModel::ImplGetDefaultValue( nPropId ); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/controls/formattedcontrol.cxx | 14 -- 1 file changed, 4 insertions(+), 10 deletions(-) New commits: commit 9f0a4ae5dec545fe5d90c10ed4ddc2395e617e8e Author: Noel Grandin AuthorDate: Tue Nov 20 11:21:23 2018 +0200 Commit: Noel Grandin CommitDate: Tue Nov 20 14:47:49 2018 +0100 clean up s_bTriedCreation static bool very weird code, no need for hiding this bool inside a method Change-Id: I75ee67af32ab012fe5ab5ae766abc56212bb08e6 Reviewed-on: https://gerrit.libreoffice.org/63643 Reviewed-by: Noel Grandin Tested-by: Noel Grandin diff --git a/toolkit/source/controls/formattedcontrol.cxx b/toolkit/source/controls/formattedcontrol.cxx index 7c763703a2b2..1bc3178305f8 100644 --- a/toolkit/source/controls/formattedcontrol.cxx +++ b/toolkit/source/controls/formattedcontrol.cxx @@ -59,22 +59,16 @@ namespace toolkit } -bool& lcl_getTriedCreation() -{ -static bool s_bTriedCreation = false; -return s_bTriedCreation; -} - +static bool s_bTriedCreation = false; const Reference< XNumberFormatsSupplier >& lcl_getDefaultFormats_throw() { ::osl::MutexGuard aGuard( getDefaultFormatsMutex() ); -bool& rbTriedCreation = lcl_getTriedCreation(); Reference< XNumberFormatsSupplier >& rDefaultFormats( lcl_getDefaultFormatsAccess_nothrow() ); -if ( !rDefaultFormats.is() && !rbTriedCreation ) +if ( !rDefaultFormats.is() && !s_bTriedCreation ) { -rbTriedCreation = true; +s_bTriedCreation = true; rDefaultFormats = NumberFormatsSupplier::createWithDefaultLocale( ::comphelper::getProcessComponentContext() ); } if ( !rDefaultFormats.is() ) @@ -101,7 +95,7 @@ namespace toolkit Reference< XNumberFormatsSupplier >& rDefaultFormats( lcl_getDefaultFormatsAccess_nothrow() ); Reference< XNumberFormatsSupplier > xReleasePotentialLastReference( rDefaultFormats ); rDefaultFormats.clear(); -lcl_getTriedCreation() = false; +s_bTriedCreation = false; aGuard.clear(); xReleasePotentialLastReference.clear(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: toolkit/source vcl/qa
toolkit/source/helper/formpdfexport.cxx | 26 -- vcl/qa/cppunit/pdfexport/pdfexport.cxx |6 +++--- 2 files changed, 23 insertions(+), 9 deletions(-) New commits: commit 655154e45abfe6c69b97ad5c615f231be4b3827a Author: Justin Luth AuthorDate: Sat Nov 3 18:01:42 2018 +0300 Commit: Justin Luth CommitDate: Mon Nov 5 06:53:25 2018 +0100 tdf#118244 pdfexport: radio buttons can group with same name The old implementation grouped radio buttons if their object name was the same, and didn't have a groupname property. The old implementation still works - so that still needs to be supported, which this patch ensures. Change-Id: Ied6ddc52d1c4ab5bca56b14da51258460ca2120c Reviewed-on: https://gerrit.libreoffice.org/62812 Tested-by: Jenkins Reviewed-by: Justin Luth diff --git a/toolkit/source/helper/formpdfexport.cxx b/toolkit/source/helper/formpdfexport.cxx index dd225934a790..4277a72c83ba 100644 --- a/toolkit/source/helper/formpdfexport.cxx +++ b/toolkit/source/helper/formpdfexport.cxx @@ -132,7 +132,7 @@ namespace toolkitform // host document makes it somewhat difficult ... // Problem is that two form radio buttons belong to the same group if // - they have the same parent -// - AND they have the same group name +// - AND they have the same name or group name // This implies that we need some knowledge about (potentially) *all* radio button // groups in the document. @@ -164,6 +164,7 @@ namespace toolkitform do { std::unordered_map GroupNameMap; +std::unordered_map SharedNameMap; sal_Int32 nCount = xCurrentContainer->getCount(); sal_Int32 i; for ( i = nStartWithChild; i < nCount; ++i ) @@ -203,12 +204,25 @@ namespace toolkitform OUString sGroupName; aProps->getPropertyValue("GroupName") >>= sGroupName; -// map: unique key is the group name, so attempts to add a different ID value -// for an existing group are ignored - keeping the first ID - perfect for this scenario. -GroupNameMap.emplace( sGroupName, nGroupsEncountered + i ); +if ( !sGroupName.isEmpty() ) +{ +// map: unique key is the group name, so attempts to add a different ID value +// for an existing group are ignored - keeping the first ID - perfect for this scenario. +GroupNameMap.emplace( sGroupName, nGroupsEncountered + i ); + +if ( xElement.get() == xNormalizedLookup.get() ) +return GroupNameMap[sGroupName]; +} +else +{ +// Old implementation didn't have a GroupName, just identical Control names. +aProps->getPropertyValue( FM_PROP_NAME ) >>= sGroupName; +SharedNameMap.emplace( sGroupName, nGroupsEncountered + i ); + +if ( xElement.get() == xNormalizedLookup.get() ) +return SharedNameMap[sGroupName]; +} -if ( xElement.get() == xNormalizedLookup.get() ) -return GroupNameMap[sGroupName]; } } catch( uno::Exception& ) diff --git a/vcl/qa/cppunit/pdfexport/pdfexport.cxx b/vcl/qa/cppunit/pdfexport/pdfexport.cxx index 71fd198a0e35..80cb72fc1dff 100644 --- a/vcl/qa/cppunit/pdfexport/pdfexport.cxx +++ b/vcl/qa/cppunit/pdfexport/pdfexport.cxx @@ -902,13 +902,13 @@ void PdfExportTest::testTdf118244_radioButtonGroup() { size_t expectedSize = 2; ++nRadioGroups; -if ( nRadioGroups == 2 ) -expectedSize = 5; +if ( nRadioGroups == 3 ) +expectedSize = 3; CPPUNIT_ASSERT_EQUAL(expectedSize, pKids->GetElements().size()); } } } -CPPUNIT_ASSERT_EQUAL_MESSAGE("# of radio groups", sal_uInt32(2), nRadioGroups); +CPPUNIT_ASSERT_EQUAL_MESSAGE("# of radio groups", sal_uInt32(3), nRadioGroups); } #if HAVE_MORE_FONTS ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org
[Libreoffice-commits] core.git: toolkit/source vcl/qa
toolkit/source/helper/formpdfexport.cxx | 71 +-- vcl/qa/cppunit/pdfexport/data/tdf118244_radioButtonGroup.odt |binary vcl/qa/cppunit/pdfexport/pdfexport.cxx | 39 ++ 3 files changed, 77 insertions(+), 33 deletions(-) New commits: commit 80400973e06e08f0c1ab0b9a86418c1bcc4bbd5c Author: Justin Luth AuthorDate: Thu Nov 1 15:38:58 2018 +0300 Commit: Justin Luth CommitDate: Mon Nov 5 06:02:23 2018 +0100 tdf#118244 pdfexport: radio buttons use groupname now The previous implementation grouped radio buttons if their object name was the same. Likely this is a very old implementation, because the current radio buttons have a groupname property which links them together (although that too needed fixing in doc/docx), and their object names are unique. The old implementation still works - so that still needs to be supported, but I think I'll do that in a separate patch, so that it can be easily reverted if the old implementation is deprecated. Edge cases tested: -groupID of 0 works fine - doesn't have to be 1-based. -empty group name works fine (but breaks the old impl). -writer, calc, Change-Id: I84aebdac18b9edfa5ffcbfb23c15d0f37fcd47d1 Reviewed-on: https://gerrit.libreoffice.org/62742 Tested-by: Jenkins Reviewed-by: Justin Luth diff --git a/toolkit/source/helper/formpdfexport.cxx b/toolkit/source/helper/formpdfexport.cxx index d0399e6f7a39..dd225934a790 100644 --- a/toolkit/source/helper/formpdfexport.cxx +++ b/toolkit/source/helper/formpdfexport.cxx @@ -20,6 +20,8 @@ #include #include +#include +#include #include #include @@ -130,7 +132,7 @@ namespace toolkitform // host document makes it somewhat difficult ... // Problem is that two form radio buttons belong to the same group if // - they have the same parent -// - AND they have the same name +// - AND they have the same group name // This implies that we need some knowledge about (potentially) *all* radio button // groups in the document. @@ -156,29 +158,12 @@ namespace toolkitform ::std::vector< sal_Int32 > aPath; Reference< XInterface > xNormalizedLookup( _rxRadioModel, UNO_QUERY ); -OUString sRadioGroupName; -OSL_VERIFY( _rxRadioModel->getPropertyValue( FM_PROP_NAME ) >>= sRadioGroupName ); - Reference< XIndexAccess > xCurrentContainer( xRoot ); sal_Int32 nStartWithChild = 0; sal_Int32 nGroupsEncountered = 0; do { -Reference< XNameAccess > xElementNameAccess( xCurrentContainer, UNO_QUERY ); -OSL_ENSURE( xElementNameAccess.is(), "determineRadioGroupId: no name container?" ); -if ( !xElementNameAccess.is() ) -return -1; - -if ( nStartWithChild == 0 ) -{ // we encounter this container the first time. In particular, we did not -// just step up -nGroupsEncountered += xElementNameAccess->getElementNames().getLength(); -// this is way too much: Not all of the elements in the current container -// may form groups, especially if they're forms. But anyway, this number is -// sufficient for our purpose. Finally, the container contains *at most* -// that much groups -} - +std::unordered_map GroupNameMap; sal_Int32 nCount = xCurrentContainer->getCount(); sal_Int32 i; for ( i = nStartWithChild; i < nCount; ++i ) @@ -204,27 +189,47 @@ namespace toolkitform if ( xElement.get() == xNormalizedLookup.get() ) { -// look up the name of the radio group in the list of all element names -Sequence< OUString > aElementNames( xElementNameAccess->getElementNames() ); -const OUString* pElementNames = aElementNames.getConstArray(); -const OUString* pElementNamesEnd = pElementNames + aElementNames.getLength(); -while ( pElementNames != pElementNamesEnd ) +// Our radio button is in this container. +// Now take the time to ID this container's groups and return the button's groupId +for ( i = 0; i < nCount; ++i ) { -if ( *pElementNames == sRadioGroupName ) +try { -sal_Int32 nLocalGroupIndex = pElementNames - aElementNames.getConstArray(); -OSL_ENSURE(
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/awt/vclxtoolkit.cxx | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) New commits: commit 5929d8ea469a971aa77371ed4b841c90a36e7da5 Author: Stephan Bergmann AuthorDate: Fri Nov 2 14:50:18 2018 +0100 Commit: Stephan Bergmann CommitDate: Fri Nov 2 16:55:52 2018 +0100 Replace function only used in an assert with a lambda Change-Id: Id1809b6f14690dff2edbc806a33297fda4373c6f Reviewed-on: https://gerrit.libreoffice.org/62782 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx index a22f9308095b..6ecb5cebbded 100644 --- a/toolkit/source/awt/vclxtoolkit.cxx +++ b/toolkit/source/awt/vclxtoolkit.cxx @@ -761,13 +761,6 @@ static ComponentInfo const aComponentInfos [] = { OUStringLiteral("workwindow"), WindowType::WORKWINDOW } }; -#if !defined NDEBUG -bool ComponentInfoCompare( const ComponentInfo & lhs, const ComponentInfo & rhs) -{ -return rtl_str_compare_WithLength(lhs.sName.data, lhs.sName.size, rhs.sName.data, rhs.sName.size) < 0; -} -#endif - bool ComponentInfoFindCompare( const ComponentInfo & lhs, const OUString & s) { return rtl_ustr_ascii_compareIgnoreAsciiCase_WithLengths(s.pData->buffer, s.pData->length, @@ -780,7 +773,12 @@ WindowType ImplGetComponentType( const OUString& rServiceName ) if( !bSorted ) { assert( std::is_sorted( std::begin(aComponentInfos), std::end(aComponentInfos), -ComponentInfoCompare ) ); +[](const ComponentInfo & lhs, const ComponentInfo & rhs) { +return +rtl_str_compare_WithLength( +lhs.sName.data, lhs.sName.size, rhs.sName.data, rhs.sName.size) +< 0; +} ) ); bSorted = true; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/awt/vclxtoolkit.cxx |2 ++ 1 file changed, 2 insertions(+) New commits: commit 98aa81bcb7782600cba17e67908d976188cdce42 Author: Stephan Bergmann AuthorDate: Mon Oct 22 20:50:27 2018 +0200 Commit: Stephan Bergmann CommitDate: Mon Oct 22 20:50:27 2018 +0200 -Werror,-Wunused-function (--disable-assert-always-abort) Change-Id: I5bdecf34dea5baf6c5ef1c48e5995c2ae8ec78df diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx index 622a2981e73a..682d4365e217 100644 --- a/toolkit/source/awt/vclxtoolkit.cxx +++ b/toolkit/source/awt/vclxtoolkit.cxx @@ -761,10 +761,12 @@ static ComponentInfo const aComponentInfos [] = { OUStringLiteral("workwindow"), WindowType::WORKWINDOW } }; +#if !defined NDEBUG bool ComponentInfoCompare( const ComponentInfo & lhs, const ComponentInfo & rhs) { return rtl_str_compare_WithLength(lhs.sName.data, lhs.sName.size, rhs.sName.data, rhs.sName.size) < 0; } +#endif bool ComponentInfoFindCompare( const ComponentInfo & lhs, const OUString & s) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/helper/unowrapper.cxx |6 +- 1 file changed, 1 insertion(+), 5 deletions(-) New commits: commit 5d5e0da5c314773129d8153363e2892fc359a744 Author: Caolán McNamara AuthorDate: Fri Oct 12 14:35:59 2018 +0100 Commit: Caolán McNamara CommitDate: Fri Oct 12 17:47:08 2018 +0200 tdf#118572 dispose instead of LazyDeletor Change-Id: Ib52a1d6ffee0354cc7749f2535a05821d73149c5 Reviewed-on: https://gerrit.libreoffice.org/61716 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/toolkit/source/helper/unowrapper.cxx b/toolkit/source/helper/unowrapper.cxx index f0e2c2dc0e66..f838fa57694b 100644 --- a/toolkit/source/helper/unowrapper.cxx +++ b/toolkit/source/helper/unowrapper.cxx @@ -288,11 +288,7 @@ void UnoWrapper::WindowDestroyed( vcl::Window* pWindow ) VclPtr< vcl::Window > pNextTopChild = pTopWindowChild->GetWindow( GetWindowType::NextTopWindowSibling ); -//the window still could be on the stack, so we have to -// use lazy delete ( it will automatically -// disconnect from the currently destroyed parent window ) -pTopWindowChild->doLazyDelete(); - +pTopWindowChild.disposeAndClear(); pTopWindowChild = pNextTopChild; } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: toolkit/source tools/source ucb/source
toolkit/source/awt/vclxgraphics.cxx |1 - toolkit/source/awt/vclxwindow.cxx|2 -- tools/source/inet/inetstrm.cxx |4 +--- tools/source/stream/stream.cxx |1 - ucb/source/cacher/cachedcontentresultset.cxx | 10 ++ ucb/source/cacher/contentresultsetwrapper.cxx|8 ucb/source/cacher/dynamicresultsetwrapper.cxx| 22 -- ucb/source/core/ucb.cxx |1 - ucb/source/core/ucbstore.cxx |5 ++--- ucb/source/ucp/file/bc.cxx | 15 +++ ucb/source/ucp/file/filrow.cxx |3 +-- ucb/source/ucp/file/filrset.cxx |3 --- ucb/source/ucp/file/filtask.hxx |1 - ucb/source/ucp/file/prov.cxx |1 - ucb/source/ucp/ftp/ftpcontentprovider.cxx|2 -- ucb/source/ucp/ftp/ftpresultsetbase.cxx |8 ++-- ucb/source/ucp/hierarchy/hierarchydata.cxx |2 +- ucb/source/ucp/hierarchy/hierarchydatasource.cxx |3 +-- ucb/source/ucp/package/pkgprovider.cxx |3 +-- ucb/source/ucp/webdav-neon/LinkSequence.cxx |2 +- ucb/source/ucp/webdav-neon/LockEntrySequence.cxx |2 +- ucb/source/ucp/webdav-neon/LockSequence.cxx |2 +- ucb/source/ucp/webdav-neon/NeonSession.cxx |8 ucb/source/ucp/webdav-neon/webdavprovider.cxx|3 +-- 24 files changed, 30 insertions(+), 82 deletions(-) New commits: commit feca66c513a681769c4b66ed1f1e0c70dada246c Author: Noel Grandin AuthorDate: Wed Sep 12 09:38:24 2018 +0200 Commit: Noel Grandin CommitDate: Wed Sep 12 12:48:22 2018 +0200 loplugin:simplifyconstruct in toolkit..ucb Change-Id: Ica3efbdbf05a8161861b8be1ccdc62ab4aec1d69 Reviewed-on: https://gerrit.libreoffice.org/60371 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/toolkit/source/awt/vclxgraphics.cxx b/toolkit/source/awt/vclxgraphics.cxx index 45d2aaf8e348..533e03449e0c 100644 --- a/toolkit/source/awt/vclxgraphics.cxx +++ b/toolkit/source/awt/vclxgraphics.cxx @@ -61,7 +61,6 @@ IMPL_XTYPEPROVIDER_END VCLXGraphics::VCLXGraphics() : mpOutputDevice(nullptr) , meRasterOp(RasterOp::OverPaint) -, mpClipRegion(nullptr) { } diff --git a/toolkit/source/awt/vclxwindow.cxx b/toolkit/source/awt/vclxwindow.cxx index f4d2815197ac..65b14459e8bd 100644 --- a/toolkit/source/awt/vclxwindow.cxx +++ b/toolkit/source/awt/vclxwindow.cxx @@ -219,7 +219,6 @@ VCLXWindowImpl::VCLXWindowImpl( VCLXWindow& _rAntiImpl, bool _bWithDefaultProps ,mnListenerLockLevel( 0 ) ,mnWritingMode( WritingMode2::CONTEXT ) ,mnContextWritingMode( WritingMode2::CONTEXT ) -,mpPropHelper( nullptr ) { } @@ -330,7 +329,6 @@ void ImplInitWindowEvent( css::awt::WindowEvent& rEvent, vcl::Window const * pWi } VCLXWindow::VCLXWindow( bool _bWithDefaultProps ) -:mpImpl( nullptr ) { mpImpl.reset( new VCLXWindowImpl( *this, _bWithDefaultProps ) ); } diff --git a/tools/source/inet/inetstrm.cxx b/tools/source/inet/inetstrm.cxx index fe14902a6a4a..34cb3736bd07 100644 --- a/tools/source/inet/inetstrm.cxx +++ b/tools/source/inet/inetstrm.cxx @@ -232,12 +232,10 @@ INetMIMEMessageStream::INetMIMEMessageStream( pSourceMsg(pMsg), bHeaderGenerated(headerGenerated), mvBuffer(BUFFER_SIZE), -pMsgStrm(nullptr), pMsgRead(nullptr), pMsgWrite(nullptr), done(false), -nChildIndex(0), -pChildStrm(nullptr) +nChildIndex(0) { assert(pMsg != nullptr); maMsgBuffer.SetStreamCharSet(RTL_TEXTENCODING_ASCII_US); diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx index e5a36ac893c5..5526f8a509df 100644 --- a/tools/source/stream/stream.cxx +++ b/tools/source/stream/stream.cxx @@ -318,7 +318,6 @@ void SvStream::SetSize(sal_uInt64 const nSize) SvStream::SvStream() : m_nActPos(0) - , m_pRWBuf(nullptr) , m_pBufPos(nullptr) , m_nBufSize(0) , m_nBufActualLen(0) diff --git a/ucb/source/cacher/cachedcontentresultset.cxx b/ucb/source/cacher/cachedcontentresultset.cxx index 77d897007076..5bd39fde2637 100644 --- a/ucb/source/cacher/cachedcontentresultset.cxx +++ b/ucb/source/cacher/cachedcontentresultset.cxx @@ -122,9 +122,7 @@ template T CachedContentResultSet::rowOriginGet( CachedContentResultSet::CCRS_Cache::CCRS_Cache( const Reference< XContentIdentifierMapping > & xMapping ) -: m_pResult( nullptr ) -, m_xContentIdentifierMapping( xMapping ) -, m_pMappedReminder( nullptr ) +: m_xContentIdentifierMapping( xMapping ) { } @@ -425,8 +423,7 @@ static const char g_sPropertyNameForFetchDirection[] = "FetchDirection"; CCRS_PropertySetInfo::CCRS_PropertySetInfo( Reference< XPropertySetInfo > const & xInfo ) -: m_pProperties( nullptr ) -, m_nFetchSizePropertyHandle( -1 ) +:
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/controls/grid/defaultgriddatamodel.cxx |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) New commits: commit e020cc88161ca5f3b35b629da627a530cb618532 Author: Takeshi Abe AuthorDate: Fri Jul 13 14:40:07 2018 +0900 Commit: Noel Grandin CommitDate: Sun Aug 19 14:48:27 2018 +0200 toolkit: a micro-optimization taking min and max simulnateously Change-Id: I161dd318b1e5729ef0b8c55a41c0eddc681b153f Reviewed-on: https://gerrit.libreoffice.org/57612 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/toolkit/source/controls/grid/defaultgriddatamodel.cxx b/toolkit/source/controls/grid/defaultgriddatamodel.cxx index 4a25f01237e0..e613878a3166 100644 --- a/toolkit/source/controls/grid/defaultgriddatamodel.cxx +++ b/toolkit/source/controls/grid/defaultgriddatamodel.cxx @@ -404,8 +404,9 @@ private: rDataRow[ columnIndex ].first = i_values[ col ]; } -sal_Int32 const firstAffectedColumn = *::std::min_element( i_columnIndexes.begin(), i_columnIndexes.end() ); -sal_Int32 const lastAffectedColumn = *::std::max_element( i_columnIndexes.begin(), i_columnIndexes.end() ); +auto aPair = ::std::minmax_element( i_columnIndexes.begin(), i_columnIndexes.end() ); +sal_Int32 const firstAffectedColumn = *aPair.first; +sal_Int32 const lastAffectedColumn = *aPair.second; broadcast( GridDataEvent( *this, firstAffectedColumn, lastAffectedColumn, i_rowIndex, i_rowIndex ), ::dataChanged, ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: toolkit/source vcl/inc vcl/README.lifecycle
toolkit/source/helper/unowrapper.cxx |2 +- vcl/README.lifecycle | 11 +-- vcl/inc/win/winlayout.hxx|2 +- 3 files changed, 7 insertions(+), 8 deletions(-) New commits: commit c9e31a8de05b5ba4b21849a22d7809ab0768aefb Author: Andrea Gelmini AuthorDate: Tue Jul 17 23:18:10 2018 +0200 Commit: Julien Nabet CommitDate: Thu Jul 19 13:54:05 2018 +0200 Fix typos Change-Id: I2aa5448869bf60e9c8d9b1ebabd0d0932d28f3a1 Reviewed-on: https://gerrit.libreoffice.org/57606 Reviewed-by: Christian Lohmaier Tested-by: Christian Lohmaier diff --git a/toolkit/source/helper/unowrapper.cxx b/toolkit/source/helper/unowrapper.cxx index c389d04ed8fa..b38ceeded3ab 100644 --- a/toolkit/source/helper/unowrapper.cxx +++ b/toolkit/source/helper/unowrapper.cxx @@ -275,7 +275,7 @@ void UnoWrapper::WindowDestroyed( vcl::Window* pWindow ) xWindowPeerComp->dispose(); // #102132# Iterate over frames after setting Window peer to NULL, -// because while destroying other frames, we get get into the method again and try +// because while destroying other frames, we get into the method again and try // to destroy this window again... // #i42462#/#116855# no, don't loop: Instead, just ensure that all our top-window-children // are disposed, too (which should also be a valid fix for #102132#, but doesn't have the extreme diff --git a/vcl/README.lifecycle b/vcl/README.lifecycle index 6ef91ccfce51..732b1908d077 100644 --- a/vcl/README.lifecycle +++ b/vcl/README.lifecycle @@ -296,12 +296,12 @@ ways and often both. the inheritance chain from children to parent, during dispose. The easiest way to fix these is to just ensure that these - cleanup methods, especially LoseFocus continue to work even + cleanup methods, especially LoseFocus, continue to work even on disposed Window sub-class instances. -** It crashes with some invalid memory ... +** It crashes with some invalid memory... -Assuming that the invalid memory is a Window sub-class itself, +Assuming that the invalid memory is a Window sub-class itself, then almost certainly there is some cockup in the reference-counting; eg. if you hit an OutputDevice::release assert on mnRefCount - then almost certainly you have a @@ -309,13 +309,12 @@ ways and often both. happen via this sort of pattern: ModelessDialog *pDlg = VclPtr(nullptr /* parent */); - // by here the pDlg quite probably points to free'd memory - ... + // by here the pDlg quite probably points to free'd memory... It is necessary in these cases to ensure that the *pDlg is a VclPtr instead. -** It crashes with some invalid memory #2 ... +** It crashes with some invalid memory #2... Often a ::dispose method will free some pImpl member, but not NULL it; and (cf. above) we can now get various virtual diff --git a/vcl/inc/win/winlayout.hxx b/vcl/inc/win/winlayout.hxx index 0ef5cc03b846..598d90c60588 100644 --- a/vcl/inc/win/winlayout.hxx +++ b/vcl/inc/win/winlayout.hxx @@ -157,7 +157,7 @@ public: void SetHFONT(const HFONT); HFONT GetHFONT() const { return m_hFont; } -// Prevend deletion of the HFONT in the WinFontInstance destructor +// Prevent deletion of the HFONT in the WinFontInstance destructor // Used for the ScopedFont handling void UnsetHFONT() { m_hFont = nullptr; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/awt/vclxprinter.cxx | 41 ++--- 1 file changed, 7 insertions(+), 34 deletions(-) New commits: commit 3a4d2468a62363dd228b1e2fad683baf81817674 Author: Jochen NitschkeDate: Sun Apr 15 21:49:35 2018 +0200 toolkit: use thread safe static initializer instead of two double-checked locking patterns Change-Id: Ic232ff44abcba6beda3edf385c2fc6029c04d936 Reviewed-on: https://gerrit.libreoffice.org/52922 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/toolkit/source/awt/vclxprinter.cxx b/toolkit/source/awt/vclxprinter.cxx index 7afe226f98de..9f982059e362 100644 --- a/toolkit/source/awt/vclxprinter.cxx +++ b/toolkit/source/awt/vclxprinter.cxx @@ -41,28 +41,6 @@ #define PROPERTY_Orientation0 #define PROPERTY_Horizontal 1 -css::beans::Property* ImplGetProperties( sal_uInt16& rElementCount ) -{ -static css::beans::Property* pProperties = nullptr; -static sal_uInt16 nElements = 0; -if( !pProperties ) -{ -::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); -if( !pProperties ) -{ -static css::beans::Property aPropTable[] = -{ -css::beans::Property( "Orientation", PROPERTY_Orientation, cppu::UnoType::get(), 0 ), -css::beans::Property( "Horizontal", PROPERTY_Horizontal, cppu::UnoType::get(), 0 ) -}; -pProperties = aPropTable; -nElements = SAL_N_ELEMENTS( aPropTable ); -} -} -rElementCount = nElements; -return pProperties; -} - // //class VCLXPrinterPropertySet // @@ -105,18 +83,13 @@ css::uno::Reference< css::beans::XPropertySetInfo > VCLXPrinterPropertySet::getP ::cppu::IPropertyArrayHelper& VCLXPrinterPropertySet::getInfoHelper() { -static ::cppu::OPropertyArrayHelper* pPropertyArrayHelper = nullptr; -if ( !pPropertyArrayHelper ) -{ -::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); -if( !pPropertyArrayHelper ) -{ -sal_uInt16 nElements; -css::beans::Property* pProps = ImplGetProperties( nElements ); -pPropertyArrayHelper = new ::cppu::OPropertyArrayHelper( pProps, nElements, false ); -} -} -return *pPropertyArrayHelper ; +static ::cppu::OPropertyArrayHelper s_PropertyArrayHelper( +css::uno::Sequence{ +css::beans::Property( "Orientation", PROPERTY_Orientation, cppu::UnoType::get(), 0 ), +css::beans::Property( "Horizontal", PROPERTY_Horizontal, cppu::UnoType::get(), 0 )}, +false); + +return s_PropertyArrayHelper; } sal_Bool VCLXPrinterPropertySet::convertFastPropertyValue( css::uno::Any & rConvertedValue, css::uno::Any & rOldValue, sal_Int32 nHandle, const css::uno::Any& rValue ) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/controls/controlmodelcontainerbase.cxx | 56 -- 1 file changed, 27 insertions(+), 29 deletions(-) New commits: commit 5823ecd54b16974ffe8821a5ae061cd0ecc4cf84 Author: Takeshi AbeDate: Tue Apr 10 22:12:06 2018 +0900 toolkit: Recover missing service names for ControlModelContainerBase namely: com.sun.star.awt.UnoControlProgressBarModel com.sun.star.awt.UnoControlScrollBarModel com.sun.star.awt.UnoControlFixedLineModel com.sun.star.awt.UnoControlRoadmapModel They seems accidentally dropped at 45fe77164c90cf15b78cd8b99adc043e2dd26be1. Change-Id: Iebd72cadc9eb9bdcb80f9b8c11f6e5e40bdb50a2 Reviewed-on: https://gerrit.libreoffice.org/52673 Reviewed-by: Noel Grandin Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/toolkit/source/controls/controlmodelcontainerbase.cxx b/toolkit/source/controls/controlmodelcontainerbase.cxx index 8f6cf1783f29..767501c91b4d 100644 --- a/toolkit/source/controls/controlmodelcontainerbase.cxx +++ b/toolkit/source/controls/controlmodelcontainerbase.cxx @@ -413,35 +413,33 @@ Reference< XInterface > ControlModelContainerBase::createInstanceWithArguments( Sequence< OUString > ControlModelContainerBase::getAvailableServiceNames() { -static Sequence< OUString >* pNamesSeq = nullptr; -if ( !pNamesSeq ) -{ -pNamesSeq = new Sequence< OUString >( 26 ); -OUString* pNames = pNamesSeq->getArray(); -pNames[0] = "com.sun.star.awt.UnoControlEditModel"; -pNames[1] = "com.sun.star.awt.UnoControlFormattedFieldModel"; -pNames[2] = "com.sun.star.awt.UnoControlFileControlModel"; -pNames[3] = "com.sun.star.awt.UnoControlButtonModel"; -pNames[4] = "com.sun.star.awt.UnoControlImageControlModel"; -pNames[5] = "com.sun.star.awt.UnoControlRadioButtonModel"; -pNames[6] = "com.sun.star.awt.UnoControlCheckBoxModel"; -pNames[7] = "com.sun.star.awt.UnoControlFixedTextModel"; -pNames[8] = "com.sun.star.awt.UnoControlGroupBoxModel"; -pNames[9] = "com.sun.star.awt.UnoControlListBoxModel"; -pNames[10] = "com.sun.star.awt.UnoControlComboBoxModel"; -pNames[11] = "com.sun.star.awt.UnoControlDateFieldModel"; -pNames[12] = "com.sun.star.awt.UnoControlTimeFieldModel"; -pNames[13] = "com.sun.star.awt.UnoControlNumericFieldModel"; -pNames[14] = "com.sun.star.awt.UnoControlCurrencyFieldModel"; -pNames[15] = "com.sun.star.awt.UnoControlPatternFieldModel"; -pNames[16] = "com.sun.star.awt.tree.TreeControlModel"; -pNames[21] = "com.sun.star.awt.grid.UnoControlGridModel"; -pNames[22] = "com.sun.star.awt.tab.UnoControlTabPageContainerModel"; -pNames[23] = "com.sun.star.awt.tab.UnoControlTabPageModel"; -pNames[24] = "com.sun.star.awt.UnoMultiPageModel"; -pNames[25] = "com.sun.star.awt.UnoFrameModel"; -} -return *pNamesSeq; +return { "com.sun.star.awt.UnoControlEditModel", +"com.sun.star.awt.UnoControlFormattedFieldModel", +"com.sun.star.awt.UnoControlFileControlModel", +"com.sun.star.awt.UnoControlButtonModel", +"com.sun.star.awt.UnoControlImageControlModel", +"com.sun.star.awt.UnoControlRadioButtonModel", +"com.sun.star.awt.UnoControlCheckBoxModel", +"com.sun.star.awt.UnoControlFixedTextModel", +"com.sun.star.awt.UnoControlGroupBoxModel", +"com.sun.star.awt.UnoControlListBoxModel", +"com.sun.star.awt.UnoControlComboBoxModel", +"com.sun.star.awt.UnoControlDateFieldModel", +"com.sun.star.awt.UnoControlTimeFieldModel", +"com.sun.star.awt.UnoControlNumericFieldModel", +"com.sun.star.awt.UnoControlCurrencyFieldModel", +"com.sun.star.awt.UnoControlPatternFieldModel", +"com.sun.star.awt.UnoControlProgressBarModel", +"com.sun.star.awt.UnoControlScrollBarModel", +"com.sun.star.awt.UnoControlFixedLineModel", +"com.sun.star.awt.UnoControlRoadmapModel", +"com.sun.star.awt.tree.TreeControlModel", +"com.sun.star.awt.grid.UnoControlGridModel", +"com.sun.star.awt.tab.UnoControlTabPageContainerModel", +"com.sun.star.awt.tab.UnoControlTabPageModel", +"com.sun.star.awt.UnoMultiPageModel", +"com.sun.star.awt.UnoFrameModel" +}; } // XContainer ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits