[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - framework/source
framework/source/services/frame.cxx | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) New commits: commit afeeed5235bb796ce3d0a74166957d3799f59b39 Author: Caolán McNamaraDate: Thu Feb 9 15:10:53 2017 + Resolves: tdf#66237 set layout manager the way it used to model Frame::setLayoutManager after the Frame::impl_setPropertyValue handler for FRAME_PROPHANDLE_LAYOUTMANAGER which used to be used before commit b248624126c271c88381d3dad6e04fc954f65779 Date: Fri Mar 22 09:24:15 2013 +0200 fdo#46808, Convert frame::Frame to new style i.e. - Reference< XPropertySet > xFrameProps( m_xFrame, UNO_QUERY_THROW ); - xFrameProps->setPropertyValue( OUString( "LayoutManager" ), makeAny(Reference< XLayoutManager >()) ); + m_xFrame->setLayoutManager( Reference< XLayoutManager >() ); Change-Id: I00f1a2cb8e4fafc6d484634619cbeaf58c603d87 (cherry picked from commit 6851074c8a515ec5a7856d4b744e3425c8829a29) Reviewed-on: https://gerrit.libreoffice.org/34095 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/framework/source/services/frame.cxx b/framework/source/services/frame.cxx index 279e261..38f740d 100644 --- a/framework/source/services/frame.cxx +++ b/framework/source/services/frame.cxx @@ -1828,7 +1828,18 @@ void SAL_CALL Frame::setLayoutManager(const css::uno::Reference xOldLayoutManager = m_xLayoutManager; +css::uno::Reference xNewLayoutManager(p1, css::uno::UNO_QUERY); + +if (xOldLayoutManager != xNewLayoutManager) +{ +m_xLayoutManager = xNewLayoutManager; +if (xOldLayoutManager.is()) +disableLayoutManager(xOldLayoutManager); +if (xNewLayoutManager.is()) +lcl_enableLayoutManager(xNewLayoutManager, this); +} } css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL Frame::getPropertySetInfo() ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - framework/source
framework/source/services/desktop.cxx |5 + 1 file changed, 5 insertions(+) New commits: commit f9c3998c2260995e060d1226b47ac2dc8c2d Author: Markus MohrhardDate: Thu Dec 29 00:52:09 2016 +0100 process all outstanding events before shutdown, tdf#104969, tdf#104286, tdf#104399 Change-Id: Id09c3dfdc94c430d5dcb2aebb017f17db80f17e6 Reviewed-on: https://gerrit.libreoffice.org/32486 Tested-by: Jenkins Reviewed-by: Markus Mohrhard Reviewed-on: https://gerrit.libreoffice.org/32668 Reviewed-by: Michael Meeks diff --git a/framework/source/services/desktop.cxx b/framework/source/services/desktop.cxx index e464fe9..3e5f3a0 100644 --- a/framework/source/services/desktop.cxx +++ b/framework/source/services/desktop.cxx @@ -63,6 +63,7 @@ #include #include #include +#include #include #include @@ -315,6 +316,10 @@ sal_Bool SAL_CALL Desktop::terminate() /* UNSAFE AREA - */ impl_sendNotifyTerminationEvent(); +{ +SolarMutexGuard aGuard; +Scheduler::ProcessEventsToIdle(); +} if( ( bAskQuickStart ) && ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - framework/source
framework/source/uielement/menubarmanager.cxx | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) New commits: commit 0690b64efac12eba37af78e66f8fff5e24c91c96 Author: Maxim MonastirskyDate: Thu Dec 22 01:03:31 2016 +0200 tdf#104818 Show the right label when a11y enabled Change-Id: If4da5b9435e96e3830bac3d01e06f7ddc87754eb (cherry picked from commit c9303b98ad69213fe346d0657a8bca5ac8fa3bd7) Reviewed-on: https://gerrit.libreoffice.org/32377 Tested-by: Jenkins 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 daa0a45..0c2be0a 100644 --- a/framework/source/uielement/menubarmanager.cxx +++ b/framework/source/uielement/menubarmanager.cxx @@ -1176,11 +1176,6 @@ void MenuBarManager::FillMenuManager( Menu* pMenu, const Reference< XFrame >& rF { sal_uInt16 nItemId = FillItemCommand(aItemCommand,pMenu, i ); -// Command can be just an alias to another command. -OUString aRealCommand = vcl::CommandInfoProvider::Instance().GetRealCommandForCommand( aItemCommand, m_xFrame ); -if ( !aRealCommand.isEmpty() ) -aItemCommand = aRealCommand; - // Set module identifier when provided from outside if ( !rModuleIdentifier.isEmpty() ) { @@ -1195,6 +1190,11 @@ void MenuBarManager::FillMenuManager( Menu* pMenu, const Reference< XFrame >& rF pMenu->SetItemText( nItemId, RetrieveLabelFromCommand( aItemCommand )); } +// Command can be just an alias to another command. +OUString aRealCommand = vcl::CommandInfoProvider::Instance().GetRealCommandForCommand( aItemCommand, m_xFrame ); +if ( !aRealCommand.isEmpty() ) +aItemCommand = aRealCommand; + Reference< XDispatch > xDispatch; Reference< XStatusListener > xStatusListener; PopupMenu* pPopup = pMenu->GetPopupMenu( nItemId ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - framework/source sd/uiconfig sd/UIConfig_sdraw.mk
framework/source/uielement/resourcemenucontroller.cxx |6 ++--- sd/UIConfig_sdraw.mk |2 + sd/uiconfig/sdraw/popupmenu/pagepanemaster.xml| 20 ++ sd/uiconfig/sdraw/popupmenu/pagepanenoselmaster.xml | 16 ++ 4 files changed, 41 insertions(+), 3 deletions(-) New commits: commit 2bb209eeb9db2243d4a0e9d460adb210c8bfd0c8 Author: Maxim MonastirskyDate: Fri Nov 11 01:27:49 2016 +0200 tdf#103826 Missing master page pane context menus in Draw (cherry picked from commit 749fe62b32acc3159cf2756aae16df36f091a862) changes from master: Removed officecfg part to avoid breaking string freeze, added nullptr check to be on the safe side. Change-Id: I355e9507692e770063a91d05efd3ebc3e2671d57 Reviewed-on: https://gerrit.libreoffice.org/30766 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/framework/source/uielement/resourcemenucontroller.cxx b/framework/source/uielement/resourcemenucontroller.cxx index 57674a1..2358f1b 100644 --- a/framework/source/uielement/resourcemenucontroller.cxx +++ b/framework/source/uielement/resourcemenucontroller.cxx @@ -181,6 +181,9 @@ void ResourceMenuController::updatePopupMenu() } } +if ( !m_xMenuContainer.is() ) +return; + // Clear previous content. if ( m_xMenuBarManager.is() ) { @@ -246,9 +249,6 @@ void ResourceMenuController::addVerbs( const css::uno::Sequence< css::embed::Ver void ResourceMenuController::fillToolbarData() { -if ( !m_xMenuContainer.is() ) -return; - VCLXMenu* pAwtMenu = VCLXMenu::GetImplementation( m_xPopupMenu ); Menu* pVCLMenu = pAwtMenu->GetMenu(); diff --git a/sd/UIConfig_sdraw.mk b/sd/UIConfig_sdraw.mk index b166919..089814d 100644 --- a/sd/UIConfig_sdraw.mk +++ b/sd/UIConfig_sdraw.mk @@ -34,6 +34,8 @@ $(eval $(call gb_UIConfig_add_popupmenufiles,modules/sdraw,\ sd/uiconfig/sdraw/popupmenu/multiselect \ sd/uiconfig/sdraw/popupmenu/oleobject \ sd/uiconfig/sdraw/popupmenu/outlinetext \ + sd/uiconfig/sdraw/popupmenu/pagepanemaster \ + sd/uiconfig/sdraw/popupmenu/pagepanenoselmaster \ sd/uiconfig/sdraw/popupmenu/pagepanenosel \ sd/uiconfig/sdraw/popupmenu/pagepane \ sd/uiconfig/sdraw/popupmenu/pagetab \ diff --git a/sd/uiconfig/sdraw/popupmenu/pagepanemaster.xml b/sd/uiconfig/sdraw/popupmenu/pagepanemaster.xml new file mode 100644 index 000..bf160df --- /dev/null +++ b/sd/uiconfig/sdraw/popupmenu/pagepanemaster.xml @@ -0,0 +1,20 @@ + + +http://openoffice.org/2001/menu;> + + + + + + + + + + diff --git a/sd/uiconfig/sdraw/popupmenu/pagepanenoselmaster.xml b/sd/uiconfig/sdraw/popupmenu/pagepanenoselmaster.xml new file mode 100644 index 000..919e3c5 --- /dev/null +++ b/sd/uiconfig/sdraw/popupmenu/pagepanenoselmaster.xml @@ -0,0 +1,16 @@ + + +http://openoffice.org/2001/menu;> + + + + + + ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - framework/source
framework/source/services/autorecovery.cxx | 13 + 1 file changed, 13 insertions(+) New commits: commit 1647335fddabb1e31d6c9a41b3dc2aca31d86a9d 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-2' - framework/source
framework/source/accelerators/acceleratorconfiguration.cxx |9 +++- framework/source/accelerators/presethandler.cxx| 24 ++--- framework/source/inc/accelerators/presethandler.hxx|3 + 3 files changed, 12 insertions(+), 24 deletions(-) New commits: commit 0c1ee03bf138f2af97e915ed0557bb334881223b Author: Michael StahlDate: Fri Jul 29 22:58:21 2016 +0200 framework: stop adding silly empty accelerator/current.xml files ... to ODF packages. Somehow this is even skipped sometimes, but it's much easier to just turn off the silliness than find out why. Change-Id: Iff509dfd8325fd517e6434bcb56edbd06a3c27f1 (cherry picked from commit d76e3abe130007086099c62c5b425aaef82dc944) Reviewed-on: https://gerrit.libreoffice.org/27900 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/framework/source/accelerators/acceleratorconfiguration.cxx b/framework/source/accelerators/acceleratorconfiguration.cxx index ae62a7a..3e27f5c 100644 --- a/framework/source/accelerators/acceleratorconfiguration.cxx +++ b/framework/source/accelerators/acceleratorconfiguration.cxx @@ -232,7 +232,8 @@ void SAL_CALL XMLBasedAcceleratorConfiguration::reload() css::uno::Reference< css::io::XStream > xStreamNoLang; { SolarMutexGuard g; -xStream = m_aPresetHandler.openTarget(TARGET_CURRENT); // open or create! +xStream = m_aPresetHandler.openTarget(TARGET_CURRENT, +css::embed::ElementModes::READ); try { xStreamNoLang = m_aPresetHandler.openPreset(PRESET_DEFAULT); @@ -273,7 +274,8 @@ void SAL_CALL XMLBasedAcceleratorConfiguration::store() css::uno::Reference< css::io::XStream > xStream; { SolarMutexGuard g; -xStream = m_aPresetHandler.openTarget(TARGET_CURRENT); // open or create! +xStream = m_aPresetHandler.openTarget(TARGET_CURRENT, + css::embed::ElementModes::READWRITE); // open or create! } css::uno::Reference< css::io::XOutputStream > xOut; @@ -329,7 +331,8 @@ sal_Bool SAL_CALL XMLBasedAcceleratorConfiguration::isReadOnly() css::uno::Reference< css::io::XStream > xStream; { SolarMutexGuard g; -xStream = m_aPresetHandler.openTarget(TARGET_CURRENT); // open or create! +xStream = m_aPresetHandler.openTarget(TARGET_CURRENT, +css::embed::ElementModes::READWRITE); // open or create! } css::uno::Reference< css::io::XOutputStream > xOut; diff --git a/framework/source/accelerators/presethandler.cxx b/framework/source/accelerators/presethandler.cxx index 1845677..628cfa2 100644 --- a/framework/source/accelerators/presethandler.cxx +++ b/framework/source/accelerators/presethandler.cxx @@ -586,7 +586,8 @@ css::uno::Reference< css::io::XStream > PresetHandler::openPreset(const OUString return xStream; } -css::uno::Reference< css::io::XStream > PresetHandler::openTarget(const OUString& sTarget) +css::uno::Reference< css::io::XStream > PresetHandler::openTarget( +const OUString& sTarget, sal_Int32 const nMode) { css::uno::Reference< css::embed::XStorage > xFolder; { @@ -598,26 +599,9 @@ css::uno::Reference< css::io::XStream > PresetHandler::openTarget(const OUString if (!xFolder.is()) return css::uno::Reference< css::io::XStream >(); -OUString sFile(sTarget); -sFile += ".xml"; +OUString const sFile(sTarget + ".xml"); -// try it in read/write mode first and ignore errors. -css::uno::Reference< css::io::XStream > xStream; -try -{ -xStream = xFolder->openStreamElement(sFile, css::embed::ElementModes::READWRITE); -return xStream; -} -catch(const css::uno::RuntimeException&) -{ throw; } -catch(const css::uno::Exception&) -{ xStream.clear(); } - -// try it readonly if it failed before. -// inform user about errors (use original exceptions!) -xStream= xFolder->openStreamElement(sFile, css::embed::ElementModes::READ); - -return xStream; +return xFolder->openStreamElement(sFile, nMode); } void PresetHandler::commitUserChanges() diff --git a/framework/source/inc/accelerators/presethandler.hxx b/framework/source/inc/accelerators/presethandler.hxx index 3451ef7..be781c2 100644 --- a/framework/source/inc/accelerators/presethandler.hxx +++ b/framework/source/inc/accelerators/presethandler.hxx @@ -297,7 +297,8 @@ class PresetHandler @return The opened target stream ... or NULL if the target does not exists or couldnt be created as new one. */ -css::uno::Reference< css::io::XStream > openTarget(const OUString& sTarget); +css::uno::Reference< css::io::XStream > openTarget( +const OUString& sTarget, sal_Int32 nMode); /** @short do anything which is necessary to flush all changes
[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - framework/source
framework/source/uielement/menubarmanager.cxx | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) New commits: commit 849b2dcf38893608b3bce0c86668a0b9db802f55 Author: Eike RathkeDate: Thu Jul 28 19:01:39 2016 +0200 do not force the Paste command to enabled for Calc, tdf#60021 related ... so it actually gets disabled in menu or removed from context menu if we say so. Used with disallowing Paste for Ctrl+A selection or protected cells. Change-Id: I7d5f8bdc7b7adee65d08b93ddee015aef953d95d (cherry picked from commit fe46041a6b2fd29715389cc5eb2dfbaf65f7f1f9) Reviewed-on: https://gerrit.libreoffice.org/27648 Tested-by: Jenkins Reviewed-by: Markus Mohrhard diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx index 6d47924..daa0a45 100644 --- a/framework/source/uielement/menubarmanager.cxx +++ b/framework/source/uielement/menubarmanager.cxx @@ -403,8 +403,14 @@ throw ( RuntimeException, std::exception ) //enable some slots hardly, because UNIX clipboard does not notify all changes // Can be removed if follow up task will be fixed directly within applications. // Note: PasteSpecial is handled specifically by calc -if ( pMenuItemHandler->aMenuItemURL == ".uno:Paste" -|| pMenuItemHandler->aMenuItemURL == ".uno:PasteClipboard" ) // special for draw/impress +// Calc also disables Paste under some circumstances, do not override. +/* TODO: is this workaround even needed anymore? Was introduced + * in 2009 with commit 426ab2c0e8f6e3fe2b766f74f6b8da873d860260 + * as some "metropatch" and the other places it touched seem to + * be gone. */ +if ( (pMenuItemHandler->aMenuItemURL == ".uno:Paste" && +m_aModuleIdentifier != "com.sun.star.sheet.SpreadsheetDocument") +|| pMenuItemHandler->aMenuItemURL == ".uno:PasteClipboard" )// special for draw/impress bEnabledItem = true; #endif ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - framework/source
framework/source/dispatch/closedispatcher.cxx |9 + 1 file changed, 9 insertions(+) New commits: commit 1bb21a08054d6909725ac46be8a4d6d7e5141d7c Author: Caolán McNamaraDate: Sat Jul 9 21:28:44 2016 +0100 Resolves: tdf#100732 hang closing Print Preview with X-icon on menubar triggered by change... commit f9bb13419549d621ffd55d9d81e0732a89560e2e Author: Juergen Funk Date: Fri May 13 10:42:17 2016 +0200 tdf#99815 use XNotifyingDispatch in sfx2 which allowed the problem introduced by... commit d0c3c24da2506bff1719a276f2eff34589fa7663 Author: Kohei Yoshida Date: Wed Jun 6 01:28:55 2012 -0400 Check if the system window has a close handler, and if yes, call it. This allows the close event in the preview window to be handled in a custom fashion, instead of having it call the normal "close window" command. to show up Change-Id: I5c46fb7a49ae44fd748b5b7192aeb951c7d65191 (cherry picked from commit 903e60753f4cf8fb03e27ed312a699f72ac1649a) Reviewed-on: https://gerrit.libreoffice.org/27077 Tested-by: Jenkins Reviewed-by: Markus Mohrhard diff --git a/framework/source/dispatch/closedispatcher.cxx b/framework/source/dispatch/closedispatcher.cxx index a09018f..aa15c28 100644 --- a/framework/source/dispatch/closedispatcher.cxx +++ b/framework/source/dispatch/closedispatcher.cxx @@ -186,6 +186,15 @@ void SAL_CALL CloseDispatcher::dispatchWithNotification(const css::util::URL& { // The closing frame has its own close handler. Call it instead. m_pSysWindow->GetCloseHdl().Call(*m_pSysWindow); + +aWriteLock.clear(); +// <- SAFE -- + +implts_notifyResultListener( +xListener, +css::frame::DispatchResultState::SUCCESS, +css::uno::Any()); + return; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - framework/source
framework/source/uielement/popuptoolbarcontroller.cxx |9 - 1 file changed, 9 deletions(-) New commits: commit c5cc05f29020b9e0a77743112d1ab9f8b70cfcf6 Author: Maxim MonastirskyDate: Sun Jun 19 23:58:53 2016 +0300 Try to fix the crashreport with SaveToolbarController::modified No idea how one managed to trigger this. The only way I see is to add the save button to one of the custom shapes dropdowns. The ToolBox there has mpData->mbWillUsePopupMode set to true, which causes ToolBarManager to call the update method of the controller twice. update registers additional modify listener each time, but there is only one "remove listener" call in dispose. Change-Id: I2a1d6e02f6d8b6bc847fb7694fffa6e85b1f5604 (cherry picked from commit 1771e2b2753af2c078b575c44e788ee70500bbca) Reviewed-on: https://gerrit.libreoffice.org/26487 Tested-by: Jenkins Reviewed-by: Maxim Monastirsky diff --git a/framework/source/uielement/popuptoolbarcontroller.cxx b/framework/source/uielement/popuptoolbarcontroller.cxx index 5d7b6d8..fa088a2 100644 --- a/framework/source/uielement/popuptoolbarcontroller.cxx +++ b/framework/source/uielement/popuptoolbarcontroller.cxx @@ -329,9 +329,6 @@ public: // XInitialization virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) throw ( css::uno::Exception, css::uno::RuntimeException, std::exception ) override; -// XUpdatable -virtual void SAL_CALL update() throw ( css::uno::RuntimeException, std::exception ) override; - // XSubToolbarController // Ugly HACK to cause ToolBarManager ask our controller for updated image, in case of icon theme change. virtual sal_Bool SAL_CALL opensSubToolbar() throw ( css::uno::RuntimeException, std::exception ) override; @@ -393,12 +390,6 @@ void SaveToolbarController::initialize( const css::uno::Sequence< css::uno::Any else // Simple save button, without the dropdown. pToolBox->SetItemBits( nId, pToolBox->GetItemBits( nId ) & ~ ToolBoxItemBits::DROPDOWN ); -} - -void SaveToolbarController::update() -throw ( css::uno::RuntimeException, std::exception ) -{ -PopupMenuToolbarController::update(); if ( m_xModifiable.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-2' - framework/source
framework/source/uielement/popuptoolbarcontroller.cxx | 48 ++ 1 file changed, 27 insertions(+), 21 deletions(-) New commits: commit 003431294d7c02d1acc24a822f7550e45db2dbb1 Author: Maxim MonastirskyDate: Thu Jun 16 20:11:14 2016 +0300 SaveToolbarController: back to using XStorable See 747a0fdda2a7723c2f8a8a022b468bcf29c700e3 ("SaveToolbarController: Better support of readonly docs") for the background. However this doesn't work, because the save slot is disabled in other cases too, not just for r/o docs (e.g. locked UI during file save, or when cond. formatting window open in Calc). Until a better solution is found, at least make sure that the button is disabled, instead of going into the normal save mode, which doesn't work. Change-Id: If6e1b91b7c780fffac22cdb25c82bbd0a8520dc4 (cherry picked from commit 011128aa9493a680c3e9da6d074f125a90ec455c) Reviewed-on: https://gerrit.libreoffice.org/26417 Reviewed-by: Maxim Monastirsky Tested-by: Maxim Monastirsky diff --git a/framework/source/uielement/popuptoolbarcontroller.cxx b/framework/source/uielement/popuptoolbarcontroller.cxx index 2bdce6a..5d7b6d8 100644 --- a/framework/source/uielement/popuptoolbarcontroller.cxx +++ b/framework/source/uielement/popuptoolbarcontroller.cxx @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include @@ -356,16 +357,15 @@ public: virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw ( css::uno::RuntimeException ) override; private: -bool m_bSaveAsModeAllowed; -bool m_bSaveAsModeActive; +bool m_bReadOnly; bool m_bModified; +css::uno::Reference< css::frame::XStorable > m_xStorable; css::uno::Reference< css::util::XModifiable > m_xModifiable; }; SaveToolbarController::SaveToolbarController( const css::uno::Reference< css::uno::XComponentContext >& rxContext ) : ImplInheritanceHelper( rxContext, ".uno:SaveAsMenu" ) -, m_bSaveAsModeAllowed( true ) -, m_bSaveAsModeActive( false ) +, m_bReadOnly( false ) , m_bModified( false ) { } @@ -377,22 +377,22 @@ void SaveToolbarController::initialize( const css::uno::Sequence< css::uno::Any ToolBox* pToolBox = nullptr; sal_uInt16 nId = 0; -if ( getToolboxId( nId, ) && pToolBox->GetItemCommand( nId ) != m_aCommandURL ) -{ -m_bSaveAsModeAllowed = false; -pToolBox->SetItemBits( nId, pToolBox->GetItemBits( nId ) & ~ ToolBoxItemBits::DROPDOWN ); -} +if ( !getToolboxId( nId, ) ) +return; css::uno::Reference< css::frame::XController > xController( m_xFrame->getController(), css::uno::UNO_QUERY ); if ( xController.is() ) m_xModifiable.set( xController->getModel(), css::uno::UNO_QUERY ); -if ( !m_xModifiable.is() ) -{ +if ( m_xModifiable.is() && pToolBox->GetItemCommand( nId ) == m_aCommandURL ) +// Will also enable the save as only mode. +m_xStorable.set( m_xModifiable, css::uno::UNO_QUERY ); +else if ( !m_xModifiable.is() ) // Can be in table/query design. -m_bSaveAsModeAllowed = false; m_xModifiable.set( xController, css::uno::UNO_QUERY ); -} +else +// Simple save button, without the dropdown. +pToolBox->SetItemBits( nId, pToolBox->GetItemBits( nId ) & ~ ToolBoxItemBits::DROPDOWN ); } void SaveToolbarController::update() @@ -436,7 +436,7 @@ void SaveToolbarController::updateImage() bool bLargeIcons = pToolBox->GetToolboxButtonSize() == TOOLBOX_BUTTONSIZE_LARGE; Image aImage; -if ( m_bSaveAsModeActive ) +if ( m_bReadOnly ) { aImage = vcl::CommandInfoProvider::Instance().GetImageForCommand( ".uno:SaveAs", bLargeIcons, m_xFrame ); } @@ -461,17 +461,19 @@ void SaveToolbarController::statusChanged( const css::frame::FeatureStateEvent& if ( !getToolboxId( nId, ) ) return; -if ( !m_bSaveAsModeAllowed ) -pToolBox->EnableItem( nId, rEvent.IsEnabled ); -else if ( m_bSaveAsModeActive == bool( rEvent.IsEnabled ) ) +bool bLastReadOnly = m_bReadOnly; +m_bReadOnly = m_xStorable.is() && m_xStorable->isReadonly(); +if ( bLastReadOnly != m_bReadOnly ) { -m_bSaveAsModeActive = !m_bSaveAsModeActive; pToolBox->SetQuickHelpText( nId, -vcl::CommandInfoProvider::Instance().GetTooltipForCommand( rEvent.IsEnabled ? m_aCommandURL : OUString( ".uno:SaveAs" ), m_xFrame ) ); -pToolBox->SetItemBits( nId, pToolBox->GetItemBits( nId ) & ~( rEvent.IsEnabled ? ToolBoxItemBits::DROPDOWNONLY : ToolBoxItemBits::DROPDOWN ) ); -pToolBox->SetItemBits( nId, pToolBox->GetItemBits( nId ) | ( rEvent.IsEnabled ? ToolBoxItemBits::DROPDOWN : ToolBoxItemBits::DROPDOWNONLY ) ); +vcl::CommandInfoProvider::Instance().GetTooltipForCommand(
[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - framework/source vcl/unx
framework/source/uielement/menubarmanager.cxx |2 -- vcl/unx/gtk/gtksalmenu.cxx|1 + 2 files changed, 1 insertion(+), 2 deletions(-) New commits: commit 10ee6a954671407d25d35d01c62657a367278e69 Author: Caolán McNamaraDate: Tue Jun 7 13:31:12 2016 +0100 gtk3: move the updating of native menu to right after its activated try fix that view->toolbars isn't in sync Change-Id: I095be3003f076193878f2c3ce2a2be5acbe0e33f (cherry picked from commit 15436c009e756dd4c94046f9849ad5a186454af8) diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx index 2317852..6d47924 100644 --- a/framework/source/uielement/menubarmanager.cxx +++ b/framework/source/uielement/menubarmanager.cxx @@ -480,8 +480,6 @@ throw ( RuntimeException, std::exception ) pMenuItemHandler->xMenuItemDispatch.clear(); } } -if ( m_bHasMenuBar && !m_bActive ) -m_pVCLMenu->UpdateNativeMenu(); } } diff --git a/vcl/unx/gtk/gtksalmenu.cxx b/vcl/unx/gtk/gtksalmenu.cxx index 24ab303..40b6052 100644 --- a/vcl/unx/gtk/gtksalmenu.cxx +++ b/vcl/unx/gtk/gtksalmenu.cxx @@ -1025,6 +1025,7 @@ void GtkSalMenu::Activate(const gchar* pCommand) Menu* pVclMenu = pSalMenu->GetMenu(); Menu* pVclSubMenu = pVclMenu->GetPopupMenu(aMenuAndId.second); pTopLevel->GetMenu()->HandleMenuActivateEvent(pVclSubMenu); +pVclSubMenu->UpdateNativeMenu(); } void GtkSalMenu::Deactivate(const gchar* pCommand) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits