[Libreoffice-commits] core.git: Branch 'libreoffice-5-1' - framework/source
framework/source/services/autorecovery.cxx | 13 + 1 file changed, 13 insertions(+) New commits: commit e3759a3154de534a5edfd69f7face5b5c29c1ea9 Author: anwilli5Date: Sun Jun 5 23:06:05 2016 -0400 tdf#96607 'Save as' doesn't update global auto-recovery state The auto-recovery service maintains a list of structures (one for each open document) containing information needed to carry out the auto-save functionality. One such piece of information is the location of the backup file, stored in a struct member named 'OldTempURL'. At every auto-save interval, this list is iterated through and a function (implts_saveOneDoc) is called during each iteration to save the current state of the associated document. The algorithm works as follows: 1. A new backup file URL is chosen so as not to conflict with any already existing backup files in the backup directory. This URL is based on the file name and incorporates a number (starting at 0) that is incremented until a name is chosen that doesn't conflict. 2. The document is saved to this new backup file URL 3. The previous backup file (indicated by its structure's 'OldTempURL') is deleted 4. The new backup file URL is stored (in its structure's 'OldTempURL') for the next time the file needs to be saved. Assuming you start with a new Writer doc and then make some changes, when it is time to auto-save, the backup file name 'untitled_0.odt' (excluding path) will be selected, the latest state of the open file will be written to that backup file, and the full URL for the backup file will be saved into the struct 'OldTempURL' member. The next time changes are made and an auto-save occurs, this algorithm will result in the name 'untitled_1.odt' being selected, the file contents saved into this new file, 'untitled_0.odt' being deleted, and the full URL for the new backup file being saved in 'OldTempURL'. The third time through results in 'untitled_0.odt' being selected (since this file doesn't exist on disk), and subsequent iterations of auto-saving cause the backup file name to alternate between the two aforementioned. The problem occurs during a 'Save as' operation. When this happens, the backup file is deleted (which is fine - it was just saved, and the next auto-save will back it up) but 'OldTempURL' is not properly reset (see below for more info.) During the next auto-save, 'untitled_0.odt' will be selected for the new backup file name (since no file exists by this name), and one of two things will happen (based on how many auto-saves have occurred): 1. 'OldTempURL' points to 'untitled_1.odt', and the algorithm above continues to work correctly (at least in that it continues to backup file contents.) 2. 'OldTempURL' points to 'untitled_0.odt', the name chosen for the new backup file. In this case, the document contents will be saved to this file (step 2) but then the file will be deleted (step 3). 'OldTempURL' will maintain this URL from then on out, causing this case to be hit for all future auto-save intervals. So, 50% of the time (30 minutes out of every hour) auto-save will stop backing up file contents on a 'Save as'. The function that handles the 'Save as' case (implts_markDocumentAsSaved) clears 'OldTempURL' and sets other relavent struct members for a local variable copy of the global struct, but doesn't copy them back. :( These changes are effectively lost when the function returns. There are several other cases where this appears to be happening as well, but more work is needed to determine whether this is actually the case: - implts_prepareSessionShutdown - implts_saveDocs, handling the 'dangerousDocs' and in a few other places - implts_openDocs - implts_resetHandleStates Also, there is some JUnitTest code for auto-save, but it is currently disabled (and fails to run successfully.) It'd be great to get these working again, or to just write python equivalents. Implementing this would like take me a while, though, so for now I just tested manually to ensure that this fixes the issue. When I have some more time I'd like to work more on this, but I wanted to send this patch in for now to address bug #96607. This may also address bug #99890, since some of the struct members that don't make it into the global state relate to the file name. I haven't explicitly tested this case, though. Change-Id: Ic702d6f78e60c7cf828a1564ccca118dd45d152b Reviewed-on: https://gerrit.libreoffice.org/25948 Tested-by: Jenkins Reviewed-by: jan iversen Reviewed-on:
[Libreoffice-commits] core.git: Branch 'libreoffice-5-1' - framework/source
framework/source/dispatch/interceptionhelper.cxx | 21 ++--- 1 file changed, 14 insertions(+), 7 deletions(-) New commits: commit e2cc303ee8bbb0029dd095833ae93d84ec9d73c0 Author: Thorsten BehrensDate: Wed Mar 2 15:28:36 2016 +0100 framework: avoid excessive queryDispatch calls Make better use of the css::frame::XInterceptorInfo interface, to avoid calling queryDispatch() pointlessly on interfaces that have explicitely opted out. Since that already broadcasts which urls we're interested in - so just don't bother calling entries who are not matching. Change-Id: Id5e780568fd60c38f4cee4ee800d747d65a31dae Reviewed-on: https://gerrit.libreoffice.org/25214 Tested-by: Jenkins Reviewed-by: Thorsten Behrens (cherry picked from commit 27b6cdb5ab5af33dbba561923c8db81e144c88b9) Reviewed-on: https://gerrit.libreoffice.org/26358 Reviewed-by: Katarina Behrens diff --git a/framework/source/dispatch/interceptionhelper.cxx b/framework/source/dispatch/interceptionhelper.cxx index ad707f3..fc3db65 100644 --- a/framework/source/dispatch/interceptionhelper.cxx +++ b/framework/source/dispatch/interceptionhelper.cxx @@ -54,16 +54,23 @@ css::uno::Reference< css::frame::XDispatch > SAL_CALL InterceptionHelper::queryD xInterceptor = pIt->xInterceptor; // b) No match by registration - but a valid interceptor list. -//Use first interceptor everytimes. -//Note: it doesn't matter, which direction this helper implementation use to ask interceptor objects. -//Using of member m_aInterceptorList will starts at the beginning everytimes. -//It depends from the filling operation, in which direction it works really! +//Find first interceptor w/o pattern, so we need to query it if (!xInterceptor.is() && m_lInterceptionRegs.size()>0) { -pIt = m_lInterceptionRegs.begin(); -xInterceptor = pIt->xInterceptor; +InterceptorList::const_iterator pIt2; +for (pIt2=m_lInterceptionRegs.begin(); pIt2!=m_lInterceptionRegs.end(); ++pIt2) +{ +if (!pIt2->lURLPattern.getLength()) +{ +// no pattern -> need to ask this guy! +xInterceptor = pIt2->xInterceptor; +break; +} +} +// if we didn't find any non-pattern interceptor, there's no-one +// registered for this command url (we already searched for matching +// patterns above) } - // c) No registered interceptor => use our direct slave. //This helper exist by design and must be valid everytimes ... //But to be more feature proof - we should check that .-) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-1' - framework/source
framework/source/uielement/toolbarmanager.cxx | 29 +++--- 1 file changed, 22 insertions(+), 7 deletions(-) New commits: commit 80d01c991d8c9a4f4cf6dfd4370238edbfd870f6 Author: Samuel MehrbrodtDate: Wed May 25 09:49:08 2016 +0200 tdf#98753 Find Toolbar does not display "Search key not found" Revert "Toolbar: Refactor insert toolitem code" This reverts commit 27bdc70d83d4a4f1ebb89429f61b39084e739aaa. Change-Id: I1d46cddfd656ab8c809b6cd6308725a8e67fe538 Reviewed-on: https://gerrit.libreoffice.org/25433 Reviewed-by: Samuel Mehrbrodt Tested-by: Samuel Mehrbrodt (cherry picked from commit 3349594bffc1eda4ee1d258be207b40f2f6f9b12) Reviewed-on: https://gerrit.libreoffice.org/25434 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/framework/source/uielement/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx index f10e042..77849d5 100644 --- a/framework/source/uielement/toolbarmanager.cxx +++ b/framework/source/uielement/toolbarmanager.cxx @@ -913,6 +913,8 @@ void ToolBarManager::FillToolbar( const Reference< XIndexAccess >& rItemContaine if ( m_bDisposed ) return; +sal_uInt16nId( 1 ); + Reference< XModuleManager2 > xModuleManager = ModuleManager::create( m_xContext ); if ( !m_xDocImageManager.is() ) { @@ -1028,22 +1030,30 @@ void ToolBarManager::FillToolbar( const Reference< XIndexAccess >& rItemContaine if (( nType == css::ui::ItemType::DEFAULT ) && !aCommandURL.isEmpty() ) { -ToolBoxItemBits nItemBits = ConvertStyleToToolboxItemBits( nStyle ); - -m_pToolBar->InsertItem(aCommandURL, m_xFrame, nItemBits); -sal_Int16 nId = m_pToolBar->GetItemId(aCommandURL); +OUString aString(vcl::CommandInfoProvider::Instance().GetLabelForCommand(aCommandURL, m_xFrame)); +ToolBoxItemBits nItemBits = ConvertStyleToToolboxItemBits( nStyle ); if ( aMenuDesc.is() ) { m_aMenuMap[ nId ] = aMenuDesc; nItemBits |= ToolBoxItemBits::DROPDOWNONLY; } - +m_pToolBar->InsertItem( nId, aString, nItemBits ); +m_pToolBar->SetItemCommand( nId, aCommandURL ); +OUString sTooltip = vcl::CommandInfoProvider::Instance().GetTooltipForCommand(aCommandURL, m_xFrame); +if (!sTooltip.isEmpty()) +m_pToolBar->SetQuickHelpText( nId, sTooltip ); if ( !aLabel.isEmpty() ) +{ m_pToolBar->SetItemText( nId, aLabel ); -if ( !bIsVisible ) -m_pToolBar->HideItem( nId ); +} +else +{ +m_pToolBar->SetItemText( nId, aString ); +} +m_pToolBar->EnableItem( nId ); +m_pToolBar->SetItemState( nId, TRISTATE_FALSE ); // Fill command map. It stores all our commands and from what // image manager we got our image. So we can decide if we have to use an @@ -1059,6 +1069,11 @@ void ToolBarManager::FillToolbar( const Reference< XIndexAccess >& rItemContaine { pIter->second.aIds.push_back( nId ); } + +if ( !bIsVisible ) +m_pToolBar->HideItem( nId ); + +++nId; } else if ( nType == css::ui::ItemType::SEPARATOR_LINE ) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-1' - framework/source
framework/source/uielement/subtoolbarcontroller.cxx | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) New commits: commit 7327ea0bd7a2c3876626e6b9671cbf5aa3a1ec68 Author: Maxim MonastirskyDate: Mon Apr 25 10:30:16 2016 +0300 SubToolBarController: Use initialize to change tb bits update is called so late that the dropdown addition is noticeable by the user. Change-Id: I36d76770125f927a851caef010e81f12f40d4405 (cherry picked from commit e4ae5e2d4049765f65f8b5560216f3ffded19903) Reviewed-on: https://gerrit.libreoffice.org/24797 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/framework/source/uielement/subtoolbarcontroller.cxx b/framework/source/uielement/subtoolbarcontroller.cxx index c548afa..4ef0229 100644 --- a/framework/source/uielement/subtoolbarcontroller.cxx +++ b/framework/source/uielement/subtoolbarcontroller.cxx @@ -50,6 +50,9 @@ public: explicit SubToolBarController( const css::uno::Sequence< css::uno::Any >& rxArgs ); virtual ~SubToolBarController(); +// XInitialization +virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& rxArgs ) throw ( css::uno::Exception, css::uno::RuntimeException, std::exception ) override; + // XStatusListener virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& Event ) throw ( css::uno::RuntimeException, std::exception ) override; @@ -75,9 +78,6 @@ public: // XEventListener virtual void SAL_CALL disposing( const css::lang::EventObject& e ) throw ( css::uno::RuntimeException, std::exception ) override; -// XUpdatable -virtual void SAL_CALL update() throw ( css::uno::RuntimeException, std::exception ) override; - // XComponent virtual void SAL_CALL dispose() throw ( css::uno::RuntimeException, std::exception ) override; @@ -407,10 +407,10 @@ void SubToolBarController::disposing( const css::lang::EventObject& e ) svt::ToolboxController::disposing( e ); } -void SubToolBarController::update() -throw ( css::uno::RuntimeException, std::exception ) +void SubToolBarController::initialize( const css::uno::Sequence< css::uno::Any >& rxArgs ) +throw ( css::uno::Exception, css::uno::RuntimeException, std::exception ) { -svt::ToolboxController::update(); +svt::ToolboxController::initialize( rxArgs ); ToolBox* pToolBox = nullptr; sal_uInt16 nId = 0; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-1' - framework/source
framework/source/uielement/menubarmanager.cxx |5 - 1 file changed, 4 insertions(+), 1 deletion(-) New commits: commit 79226e41fc4fa71b1f94bba0c6feaa318852d954 Author: Oliver SpechtDate: Wed Apr 27 12:56:47 2016 +0200 tdf#99527: show all accelerators in menus of extensions XCUBasedAcceleratorConfiguration::getPreferredKeyEventsForCommandList() throws if the command string of a menu entry is empty. Parent entries of sub menus of extensions are empty. As the method doesn't know about the source of the command a dummy entry is supplied. Change-Id: I1d12bbf41c22b66e9ee29f1f05ea216134168795 Reviewed-on: https://gerrit.libreoffice.org/24423 Tested-by: Jenkins Reviewed-by: Oliver Specht (cherry picked from commit a4da4cc6602263dc2c14e885ec3a1d72d099253a) Reviewed-on: https://gerrit.libreoffice.org/24425 Reviewed-by: Samuel Mehrbrodt diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx index dd307cc..1c0535f 100644 --- a/framework/source/uielement/menubarmanager.cxx +++ b/framework/source/uielement/menubarmanager.cxx @@ -1504,7 +1504,10 @@ void MenuBarManager::RetrieveShortcuts( std::vector< MenuItemHandler* >& aMenuSh const sal_uInt32 nCount = aMenuShortCuts.size(); for ( sal_uInt32 i = 0; i < nCount; ++i ) { -aSeq[i] = aMenuShortCuts[i]->aMenuItemURL; +rtl::OUString aItemURL = aMenuShortCuts[i]->aMenuItemURL; +if( aItemURL.isEmpty() && aMenuShortCuts[i]->xSubMenuManager.is()) +aItemURL = "-"; // tdf#99527 prevent throw in case of empty commands +aSeq[i] = aItemURL; aMenuShortCuts[i]->aKeyCode = aEmptyKeyCode; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-1' - framework/source
framework/source/services/tabwindowservice.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 7317b1414e3b610513e3a50bd7bcdd419325961e Author: Stephan BergmannDate: Wed Jan 13 17:24:26 2016 +0100 -Werror=attributes (GCC 6) Change-Id: I4450caf9411fcfbe979a41a67a38e7238ece0be6 (cherry picked from commit facfb35417da684eefe0b51e8f7c6824478a8717) Signed-off-by: David Tardon Reviewed-on: https://gerrit.libreoffice.org/24408 Tested-by: Jenkins diff --git a/framework/source/services/tabwindowservice.cxx b/framework/source/services/tabwindowservice.cxx index dde0162..666bdfc 100644 --- a/framework/source/services/tabwindowservice.cxx +++ b/framework/source/services/tabwindowservice.cxx @@ -145,7 +145,7 @@ private: virtual css::uno::Any SAL_CALL impl_getPropertyValue(const OUString& sProperty, sal_Int32 nHandle ) override; -DECL_DLLPRIVATE_LINK_TYPED( EventListener, VclWindowEvent&, void ); +DECL_LINK_TYPED( EventListener, VclWindowEvent&, void ); void impl_checkTabIndex (::sal_Int32 nID) throw (css::lang::IndexOutOfBoundsException); TTabPageInfoHash::iterator impl_getTabPageInfo(::sal_Int32 nID) throw (css::lang::IndexOutOfBoundsException); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-1' - framework/source
framework/source/uielement/popuptoolbarcontroller.cxx |3 +++ 1 file changed, 3 insertions(+) New commits: commit ec5e521c6ec77aff5acddce8f53c848948fcef48 Author: Maxim MonastirskyDate: Fri Apr 1 00:20:25 2016 +0300 tdf#98849 SaveToolbarController: Correct initial modified state Regression of 69882b0ef861099fd6bfa802d6f7ba5d1391c269 Change-Id: I3698efff2f1e62e513d779400eff7f1c4a4145e4 (cherry picked from commit 30b10b1a589945b570445518163feb6eac8e95e1) Reviewed-on: https://gerrit.libreoffice.org/23715 Tested-by: Jenkins Reviewed-by: Eike Rathke Tested-by: Eike Rathke diff --git a/framework/source/uielement/popuptoolbarcontroller.cxx b/framework/source/uielement/popuptoolbarcontroller.cxx index ace6884..35a5432 100644 --- a/framework/source/uielement/popuptoolbarcontroller.cxx +++ b/framework/source/uielement/popuptoolbarcontroller.cxx @@ -379,7 +379,10 @@ void SaveToolbarController::initialize( const css::uno::Sequence< css::uno::Any m_xModifiable.set( xController, css::uno::UNO_QUERY ); if ( m_xModifiable.is() ) +{ m_xModifiable->addModifyListener( this ); +m_bModified = m_xModifiable->isModified(); +} } sal_Bool SaveToolbarController::opensSubToolbar() ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-1' - framework/source
framework/source/fwe/helper/titlehelper.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 0dbd5b7195669225bbe2aafb53aeed577394170e Author: akashDate: Fri Mar 25 10:09:07 2016 +0530 tdf#96896-Fix infinite recursion to prevent Writer crash To prevent infinite recursion set m_xOwner to null. Removed impl_sendTitleChangedEvent from disposing method ensuring that title is never constructed for a component that is disposing. Change-Id: I9bc20a9a582d5d911509d2aa30fb0d0122eb588e Reviewed-on: https://gerrit.libreoffice.org/23509 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit f80de31099be1ba7c6f753187f6703a915151c27) Reviewed-on: https://gerrit.libreoffice.org/24138 Reviewed-by: Miklos Vajna diff --git a/framework/source/fwe/helper/titlehelper.cxx b/framework/source/fwe/helper/titlehelper.cxx index c9aba3e..c7b5bf4 100644 --- a/framework/source/fwe/helper/titlehelper.cxx +++ b/framework/source/fwe/helper/titlehelper.cxx @@ -249,13 +249,13 @@ void SAL_CALL TitleHelper::disposing(const css::lang::EventObject& aEvent) // SYNCHRONIZED -> aLock.reset (); + m_xOwner= nullptr; m_sTitle= OUString (); m_nLeasedNumber = css::frame::UntitledNumbersConst::INVALID_NUMBER; aLock.clear (); // <- SYNCHRONIZED -impl_sendTitleChangedEvent (); } void TitleHelper::impl_sendTitleChangedEvent () ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-1' - framework/source
framework/source/uielement/menubarmanager.cxx |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) New commits: commit 3bef546c29257ccabdca30baebbd69254c859f16 Author: Oliver SpechtDate: Mon Apr 11 11:32:52 2016 +0200 allow disabling recent files menu entry patch 85071c6c7b120935b03926228916393a94aa5ef0 fixed the problem of submenus in tools/language but broke the disabling of the recent files menu entry This patch makes it possible to disable and the recent files entry without breaking other menu entries Change-Id: Ia1ba7c0a75cdf82faacead4f92902f65f05186ba Reviewed-on: https://gerrit.libreoffice.org/23988 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara (cherry picked from commit daf209b64d36ee5261ee18e91548d02ce374fbe3) Reviewed-on: https://gerrit.libreoffice.org/23992 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx index 6bb58db..dd307cc 100644 --- a/framework/source/uielement/menubarmanager.cxx +++ b/framework/source/uielement/menubarmanager.cxx @@ -872,7 +872,8 @@ IMPL_LINK_TYPED( MenuBarManager, Activate, Menu *, pMenu, bool ) if ( !pMenuItemHandler->xPopupMenuController.is() && m_xPopupMenuControllerFactory->hasController( aItemCommand, m_aModuleIdentifier ) ) { -bPopupMenu = CreatePopupMenuController( pMenuItemHandler ); +if( xMenuItemDispatch.is() || !pMenuItemHandler->aMenuItemURL.equalsAscii( ".uno:RecentFileList") ) +bPopupMenu = CreatePopupMenuController( pMenuItemHandler ); } else if ( pMenuItemHandler->xPopupMenuController.is() ) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-1' - framework/source
framework/source/uielement/addonstoolbarmanager.cxx |5 + 1 file changed, 5 insertions(+) New commits: commit 499a34658e3a78d7b7c7c917eb739f8a1924c633 Author: Samuel MehrbrodtDate: Mon Feb 29 17:46:30 2016 +0100 tdf#98277 Extensions: Display shortcut in toolbar tooltip (cherry picked from commits 3ff17bda5ba3e627e9b996506dc72b68cf67483b and 398fadca9a82917ed865e328ba454d8015803b66) Change-Id: Icc16860d8b47a3724838fdb3dcb72dfb4398167d Reviewed-on: https://gerrit.libreoffice.org/22805 Tested-by: Jenkins Reviewed-by: Katarina Behrens diff --git a/framework/source/uielement/addonstoolbarmanager.cxx b/framework/source/uielement/addonstoolbarmanager.cxx index 7804108..5e57cd2 100644 --- a/framework/source/uielement/addonstoolbarmanager.cxx +++ b/framework/source/uielement/addonstoolbarmanager.cxx @@ -56,6 +56,7 @@ #include #include #include +#include // namespaces @@ -257,6 +258,10 @@ void AddonsToolBarManager::FillToolbar( const Sequence< Sequence< PropertyValue m_pToolBar->InsertItem( nId, aTitle ); +OUString aShortcut(vcl::CommandInfoProvider::Instance().GetCommandShortcut(aURL, m_xFrame)); +if (!aShortcut.isEmpty()) +m_pToolBar->SetQuickHelpText(nId, aTitle + " (" + aShortcut + ")"); + // don't setup images yet, AddonsToolbarWrapper::populateImages does that. // Create TbRuntimeItemData to hold additional information we will need in the future ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-1' - framework/source
framework/source/uielement/menubarmanager.cxx | 26 -- 1 file changed, 12 insertions(+), 14 deletions(-) New commits: commit d7955212492009976764d701bf789e76f5fdfa4a Author: Caolán McNamaraDate: Sun Feb 28 20:27:43 2016 + language submenu from tools->language->for selection->"languages"... is always disabled/empty since... commit a6e8910a3c5d33e671a13559438b7228596b8bca Date: Wed Feb 17 12:07:59 2016 +0100 allow disabling file/new, wizards, recent documents menu entries disabling the dispatches '.uno:AutoPilotMenu' and '.uno:AddDirect' and .uno:RecentFileList via UNO API now results in disabled menu entries as expected Change-Id: Id99be9374306ff8c0cea919ea94ed96f715a8058 Reviewed-on: https://gerrit.libreoffice.org/22422 reverting this hunk restores them again Change-Id: I029c9c3f25fb593127ee8371b278cee102c65882 Reviewed-on: https://gerrit.libreoffice.org/22750 Reviewed-by: Oliver Specht Tested-by: Oliver Specht Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx index 6a368a9..6bb58db 100644 --- a/framework/source/uielement/menubarmanager.cxx +++ b/framework/source/uielement/menubarmanager.cxx @@ -869,22 +869,20 @@ IMPL_LINK_TYPED( MenuBarManager, Activate, Menu *, pMenu, bool ) xMenuItemDispatch = xDispatchProvider->queryDispatch( aTargetURL, OUString(), 0 ); bool bPopupMenu( false ); -if(xMenuItemDispatch != nullptr) +if ( !pMenuItemHandler->xPopupMenuController.is() && + m_xPopupMenuControllerFactory->hasController( aItemCommand, m_aModuleIdentifier ) ) { -if ( !pMenuItemHandler->xPopupMenuController.is() && - m_xPopupMenuControllerFactory->hasController( aItemCommand, m_aModuleIdentifier ) ) -{ -bPopupMenu = CreatePopupMenuController( pMenuItemHandler ); -} -else if ( pMenuItemHandler->xPopupMenuController.is() ) -{ -// Force update of popup menu - pMenuItemHandler->xPopupMenuController->updatePopupMenu(); -bPopupMenu = true; -if (PopupMenu* pThisPopup = pMenu->GetPopupMenu( pMenuItemHandler->nItemId )) -pMenu->EnableItem( pMenuItemHandler->nItemId, pThisPopup->GetItemCount() != 0 ); -} +bPopupMenu = CreatePopupMenuController( pMenuItemHandler ); } +else if ( pMenuItemHandler->xPopupMenuController.is() ) +{ +// Force update of popup menu + pMenuItemHandler->xPopupMenuController->updatePopupMenu(); +bPopupMenu = true; +if (PopupMenu* pThisPopup = pMenu->GetPopupMenu( pMenuItemHandler->nItemId )) +pMenu->EnableItem( pMenuItemHandler->nItemId, pThisPopup->GetItemCount() != 0 ); +} + lcl_CheckForChildren(pMenu, pMenuItemHandler->nItemId); if ( xMenuItemDispatch.is() ) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-1' - framework/source
framework/source/classes/menumanager.cxx | 46 +++ framework/source/uielement/menubarmanager.cxx| 26 +++-- framework/source/uielement/newmenucontroller.cxx | 11 + 3 files changed, 47 insertions(+), 36 deletions(-) New commits: commit b9ef5a4b129bf5c7ce566ba1da74a2e21595b8fa Author: Oliver SpechtDate: Wed Feb 17 12:07:59 2016 +0100 allow disabling file/new, wizards, recent documents menu entries disabling the dispatches '.uno:AutoPilotMenu' and '.uno:AddDirect' and .uno:RecentFileList via UNO API now results in disabled menu entries as expected Change-Id: Id99be9374306ff8c0cea919ea94ed96f715a8058 Reviewed-on: https://gerrit.libreoffice.org/22422 Reviewed-by: Oliver Specht Tested-by: Oliver Specht Reviewed-on: https://gerrit.libreoffice.org/22471 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/framework/source/classes/menumanager.cxx b/framework/source/classes/menumanager.cxx index 56ae8e4..6fd7f3b 100644 --- a/framework/source/classes/menumanager.cxx +++ b/framework/source/classes/menumanager.cxx @@ -177,33 +177,33 @@ MenuManager::MenuManager( } else { -if ( nItemId == SID_NEWDOCDIRECT || aItemCommand == aSlotNewDocDirect ) +bool isNewDoc = nItemId == SID_NEWDOCDIRECT || aItemCommand == aSlotNewDocDirect; +bool isAutoPilot = nItemId == SID_AUTOPILOTMENU || aItemCommand == aSlotAutoPilot; +if(isNewDoc || isAutoPilot) { -MenuConfiguration aMenuCfg( m_xContext ); -BmkMenu* pSubMenu = static_cast (aMenuCfg.CreateBookmarkMenu( rFrame, BOOKMARK_NEWMENU )); -pMenu->SetPopupMenu( nItemId, pSubMenu ); - -AddMenu(pSubMenu,OUString(),nItemId,true,false); -if ( bShowMenuImages && !pMenu->GetItemImage( nItemId )) +Reference< XDispatchProvider > xDispatchProvider( m_xFrame, UNO_QUERY ); +URL aTargetURL; +aTargetURL.Complete = OUString::createFromAscii(isNewDoc ? aSlotNewDocDirect : aSlotAutoPilot); +m_xURLTransformer->parseStrict( aTargetURL ); +Reference< XDispatch > xMenuItemDispatch = xDispatchProvider->queryDispatch( +aTargetURL, OUString(), 0 ); +if(xMenuItemDispatch == nullptr) { -Image aImage = GetImageFromURL( rFrame, aItemCommand, false ); -if ( !!aImage ) - pMenu->SetItemImage( nItemId, aImage ); +m_pVCLMenu->EnableItem( nItemId, false ); } -} -else if ( nItemId == SID_AUTOPILOTMENU || aItemCommand == aSlotAutoPilot ) -{ -MenuConfiguration aMenuCfg( m_xContext ); -BmkMenu* pSubMenu = static_cast (aMenuCfg.CreateBookmarkMenu( rFrame, BOOKMARK_WIZARDMENU )); -pMenu->SetPopupMenu( nItemId, pSubMenu ); - -AddMenu(pSubMenu,OUString(),nItemId,true,false); - -if ( bShowMenuImages && !pMenu->GetItemImage( nItemId )) +else { -Image aImage = GetImageFromURL( rFrame, aItemCommand, false ); -if ( !!aImage ) - pMenu->SetItemImage( nItemId, aImage ); +MenuConfiguration aMenuCfg( m_xContext ); +BmkMenu* pSubMenu = static_cast (aMenuCfg.CreateBookmarkMenu( rFrame, +OUString::createFromAscii(isNewDoc ? BOOKMARK_NEWMENU : BOOKMARK_WIZARDMENU))); +pMenu->SetPopupMenu( nItemId, pSubMenu ); +AddMenu(pSubMenu,OUString(),nItemId,true,false); +if ( bShowMenuImages && !pMenu->GetItemImage( nItemId )) +{ +Image aImage = GetImageFromURL( rFrame, aItemCommand, false ); +if ( !!aImage ) +pMenu->SetItemImage( nItemId, aImage ); +} } } else if ( pMenu->GetItemType( i ) != MenuItemType::SEPARATOR ) diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx index 5f2b85a..6a368a9 100644 --- a/framework/source/uielement/menubarmanager.cxx +++ b/framework/source/uielement/menubarmanager.cxx @@ -869,20 +869,22 @@ IMPL_LINK_TYPED( MenuBarManager, Activate, Menu *, pMenu, bool ) xMenuItemDispatch = xDispatchProvider->queryDispatch( aTargetURL, OUString(), 0 ); bool
[Libreoffice-commits] core.git: Branch 'libreoffice-5-1' - framework/source
framework/source/uielement/popuptoolbarcontroller.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit d6c4c28f75c755df1e1fa7df67eeadba78d66785 Author: Maxim MonastirskyDate: Thu Jan 28 21:30:06 2016 +0200 tdf#97419 Need to take SolarMutex here Change-Id: I97886c8dbd7b56d155ad9598ca127df0c7420d2c (cherry picked from commit 49e1a1a4f5591faaca61559e6492909faf1bc94d) Reviewed-on: https://gerrit.libreoffice.org/22034 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/framework/source/uielement/popuptoolbarcontroller.cxx b/framework/source/uielement/popuptoolbarcontroller.cxx index 6b9c552..ace6884 100644 --- a/framework/source/uielement/popuptoolbarcontroller.cxx +++ b/framework/source/uielement/popuptoolbarcontroller.cxx @@ -402,6 +402,7 @@ void SaveToolbarController::functionSelected( const OUString& /*aCommand*/ ) void SaveToolbarController::updateImage() throw ( css::uno::RuntimeException, std::exception ) { +SolarMutexGuard aGuard; ToolBox* pToolBox = nullptr; sal_uInt16 nId = 0; if ( !getToolboxId( nId, ) ) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-1' - framework/source
framework/source/fwe/xml/menudocumenthandler.cxx |8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) New commits: commit 2a74b694dbbca2083ffa4b20ec89c8574f00c34a Author: Maxim MonastirskyDate: Fri Jan 22 01:51:46 2016 +0200 Fix wrong use of OUString::copy Code like: if( aCommandURL.copy(5) != ".uno:" ) is obviously wrong, as OUString::copy(sal_Int32) takes the _beginning_ index, so for this condition to be false the command URL must have ".uno:" in the _middle_ of the string. This created some weird things like an empty label attribute added to any submenu item. Moreover, the command URL can be easily shorter than 5 (like when a custom submenu added by the user). Using copy(5) in such case officially considered as "undefined behavior" and will trigger an assert in debug build (that's how I discovered this code actually). Most likely the original intent was to check whether the command URL doesn't start with ".uno:", and so should be changed to use OUString::startsWith. But doing that will create a regression, as it won't be possible anymore to change labels of commands that start with ".uno:". Simply dropping this check seems to be better solution here. Change-Id: I2f88807eceae1006066a14750f2003e235f49ad4 (cherry picked from commit 0dbe3d40579d20f4cbce3ce155996ff4b5c32c99) Reviewed-on: https://gerrit.libreoffice.org/21704 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/framework/source/fwe/xml/menudocumenthandler.cxx b/framework/source/fwe/xml/menudocumenthandler.cxx index 1d7122e..5f59258 100644 --- a/framework/source/fwe/xml/menudocumenthandler.cxx +++ b/framework/source/fwe/xml/menudocumenthandler.cxx @@ -80,8 +80,6 @@ static const char ITEM_DESCRIPTOR_TYPE[]= "Type"; static const char ITEM_DESCRIPTOR_STYLE[] = "Style"; // special popup menus (filled during runtime) must be saved as an empty popup menu or menuitem!!! -static const sal_Int32 CMD_PROTOCOL_SIZE= 5; -static const char CMD_PROTOCOL[]= ".uno:"; static const char ADDDIRECT_CMD[] = ".uno:AddDirect"; static const char AUTOPILOTMENU_CMD[] = ".uno:AutoPilotMenu"; @@ -839,7 +837,7 @@ throw ( SAXException, RuntimeException ) m_aAttributeType, aCommandURL ); -if ( aCommandURL.copy( CMD_PROTOCOL_SIZE ) != CMD_PROTOCOL ) +if ( !aLabel.isEmpty() ) pListMenu->AddAttribute( ATTRIBUTE_NS_LABEL, m_aAttributeType, aLabel ); @@ -897,13 +895,13 @@ void OWriteMenuDocumentHandler::WriteMenuItem( const OUString& aCommandURL, cons aHelpURL ); } -if ( !aLabel.isEmpty() && aCommandURL.copy( CMD_PROTOCOL_SIZE ) != CMD_PROTOCOL ) +if ( !aLabel.isEmpty() ) { pList->AddAttribute( ATTRIBUTE_NS_LABEL, m_aAttributeType, aLabel ); } -if (( nStyle > 0 ) && aCommandURL.copy( CMD_PROTOCOL_SIZE ) != CMD_PROTOCOL ) +if ( nStyle > 0 ) { OUString aValue; MenuStyleItem* pStyle = MenuItemStyles; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-1' - framework/source
framework/source/uielement/popuptoolbarcontroller.cxx | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) New commits: commit 70e08ce45ae06abdd978430263c8ef5d6a8826e2 Author: Maxim MonastirskyDate: Mon Jan 18 01:10:21 2016 +0200 Don't update the save icon on every keystroke Change-Id: Iad6195ea8b082ca5e6c1a7e9fa48742ff2b495a6 (cherry picked from commit 69882b0ef861099fd6bfa802d6f7ba5d1391c269) Reviewed-on: https://gerrit.libreoffice.org/21701 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt diff --git a/framework/source/uielement/popuptoolbarcontroller.cxx b/framework/source/uielement/popuptoolbarcontroller.cxx index 0464368..6b9c552 100644 --- a/framework/source/uielement/popuptoolbarcontroller.cxx +++ b/framework/source/uielement/popuptoolbarcontroller.cxx @@ -345,11 +345,13 @@ public: virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw ( css::uno::RuntimeException ) override; private: +bool m_bModified; css::uno::Reference< css::util::XModifiable > m_xModifiable; }; SaveToolbarController::SaveToolbarController( const css::uno::Reference< css::uno::XComponentContext >& rxContext ) : ImplInheritanceHelper( rxContext, ".uno:SaveAsMenu" ) +, m_bModified( false ) { } @@ -413,7 +415,7 @@ void SaveToolbarController::updateImage() { aImage = vcl::CommandInfoProvider::Instance().GetImageForCommand( ".uno:SaveAs", bLargeIcons, m_xFrame ); } -else if ( m_xModifiable.is() && m_xModifiable->isModified() ) +else if ( m_bModified ) { Image aResImage( bLargeIcons ? FwkResId( IMG_SAVEMODIFIED_LARGE ) : FwkResId( IMG_SAVEMODIFIED_SMALL ) ); aImage = aResImage; @@ -455,7 +457,12 @@ void SaveToolbarController::statusChanged( const css::frame::FeatureStateEvent& void SaveToolbarController::modified( const css::lang::EventObject& /*rEvent*/ ) throw ( css::uno::RuntimeException, std::exception ) { -updateImage(); +bool bModified = m_xModifiable->isModified(); +if ( bModified != m_bModified ) +{ +m_bModified = bModified; +updateImage(); +} } void SaveToolbarController::disposing( const css::lang::EventObject& rEvent ) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-1' - framework/source
framework/source/services/frame.cxx | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) New commits: commit 013beaceb8c6daf2bf7f804631a3385e35144152 Author: Matúš KukanDate: Mon Nov 23 22:07:12 2015 +0100 Make this static WeakReference local to Frame::impl_checkMenuCloser() ..to avoid problem shown with comphelper added to libmerged. More info in http://lists.freedesktop.org/archives/libreoffice/2015-November/071189.html (cherry picked from commit c6122fe6143ff1efa9f449d46a848cf3071ac67e) Apparently it was problem also without merged comphelper. Seen in CppunitTest_libreofficekit_tiledrendering in libreoffice-5-1. Change-Id: I2017d87f64f1ae3a1a1cf2e50bce24c05cff6321 Reviewed-on: https://gerrit.libreoffice.org/21243 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/framework/source/services/frame.cxx b/framework/source/services/frame.cxx index 754768e..bcd12d4 100644 --- a/framework/source/services/frame.cxx +++ b/framework/source/services/frame.cxx @@ -402,7 +402,6 @@ private: SvtCommandOptions m_aCommandOptions; /// ref counted class to support disabling commands defined by configuration file bool m_bSelfClose;/// in case of CloseVetoException on method close() was thrown by ourself - we must close ourself later if no internal processes are running bool m_bIsHidden; /// indicates, if this frame is used in hidden mode or not -static css::uno::WeakReference< css::frame::XFrame2 > m_xCloserFrame; /// holds the only frame, which must show the special closer menu item (can be NULL!) css::uno::Reference< css::frame::XLayoutManager2 > m_xLayoutManager;/// is used to layout the child windows of the frame. css::uno::Reference< css::frame::XDispatchInformationProvider > m_xDispatchInfoHelper; css::uno::Reference< css::frame::XTitle > m_xTitleHelper; @@ -414,8 +413,6 @@ protected: FrameContainer m_aChildFrameContainer; /// array of child frames }; -css::uno::WeakReference< css::frame::XFrame2 > Frame::m_xCloserFrame; - // XInterface, XTypeProvider, XServiceInfo DEFINE_XINTERFACE_22( Frame , @@ -3206,15 +3203,16 @@ void Frame::impl_checkMenuCloser() // Only if the closer state must be moved from one frame to another one // or must be enabled/disabled at all. SolarMutexGuard aGuard; - -css::uno::Reference< css::frame::XFrame2 > xCloserFrame (m_xCloserFrame.get(), css::uno::UNO_QUERY); +// Holds the only frame, which must show the special closer menu item (can be NULL!) +static css::uno::WeakReference< css::frame::XFrame2 > s_xCloserFrame; +css::uno::Reference< css::frame::XFrame2 > xCloserFrame (s_xCloserFrame.get(), css::uno::UNO_QUERY); if (xCloserFrame!=xNewCloserFrame) { if (xCloserFrame.is()) impl_setCloser(xCloserFrame, false); if (xNewCloserFrame.is()) impl_setCloser(xNewCloserFrame, true); -m_xCloserFrame = xNewCloserFrame; +s_xCloserFrame = xNewCloserFrame; } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-1' - framework/source
framework/source/services/autorecovery.cxx |2 ++ 1 file changed, 2 insertions(+) New commits: commit 57e0c5452af102a5a58f92a6d20e88b9b1def862 Author: Stephan BergmannDate: Mon Nov 30 11:38:21 2015 +0100 rhbz#1286416: Be more resilient during auto-recovery attempts ...called from within the signal handler, so any bets are off Change-Id: Iedb5c7bc8d08350e5f3e3118c6713f5c25b238b6 (cherry picked from commit 9b3ca276dae6f8d4f337c78e64ed6b7f7e7662ef) diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx index 9194db4..26e174a 100644 --- a/framework/source/services/autorecovery.cxx +++ b/framework/source/services/autorecovery.cxx @@ -2475,6 +2475,8 @@ void AutoRecovery::implts_registerDocument(const css::uno::Reference< css::frame return; css::uno::Reference< css::frame::XFrame > xFrame = xController->getFrame(); +if (!xFrame.is()) +return; css::uno::Reference< css::frame::XDesktop > xDesktop (xFrame->getCreator(), css::uno::UNO_QUERY); if (!xDesktop.is()) return; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits