[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sfx2/source
sfx2/source/sidebar/Tools.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 617b902fed3cb65f66bafd6868befd08067e1feb Author: Caolán McNamara AuthorDate: Thu Oct 6 15:27:30 2022 +0100 Commit: Xisco Fauli CommitDate: Fri Oct 7 12:24:12 2022 +0200 tdf#150622 sidebar icons empty in High Contrast mode Change-Id: Icfa78f0f655ee467c62cbc309b8e57ac310a73e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140970 Reviewed-by: Michael Stahl Tested-by: Jenkins diff --git a/sfx2/source/sidebar/Tools.cxx b/sfx2/source/sidebar/Tools.cxx index 3c6886630439..727e85a4fac0 100644 --- a/sfx2/source/sidebar/Tools.cxx +++ b/sfx2/source/sidebar/Tools.cxx @@ -41,7 +41,7 @@ css::uno::Reference Tools::GetImage( const OUString& rsHighContrastImageURL, const Reference& rxFrame) { -if (Theme::IsHighContrastMode()) +if (Theme::IsHighContrastMode() && !rsHighContrastImageURL.isEmpty()) return GetImage(rsHighContrastImageURL, rxFrame); else return GetImage(rsImageURL, rxFrame);
[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sfx2/source
sfx2/source/doc/doctempl.cxx |8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) New commits: commit ddd45141f5d20dcba22a379797be62eab7b93d73 Author: Kevin Suo AuthorDate: Fri Sep 30 14:21:10 2022 +0800 Commit: Adolfo Jayme Barrientos CommitDate: Wed Oct 5 05:33:44 2022 +0200 Templates: Make localized names for "Simple" and "BPMN" show on the UI Currently there are 32 localized template name strings defined in: include/sfx2/strings.hrc. However, in sfx2/source/doc/doctempl.cxx only 30 were used. This makes STR_TEMPLATE_NAME31 ("Simple") and STR_TEMPLATE_NAME32 ("BPMN"), although already localized, not show up on the Template Manager UI. This patch adds these two strings in the sfx2/source/doc/doctempl.cxx, so that they properly show as localized strings on the UI. Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140785 Tested-by: Jenkins Reviewed-by: Rafael Lima Reviewed-by: Laurent Balland (cherry picked from commit 244063d03117119d048376c84e22cf47c4abd250) Conflicts: sfx2/source/doc/doctempl.cxx Change-Id: I64bb28cfe0a4d3b4b41c9114de7223014f6a3cfe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140945 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos diff --git a/sfx2/source/doc/doctempl.cxx b/sfx2/source/doc/doctempl.cxx index a7fcb4c8b3fd..edb401aa7363 100644 --- a/sfx2/source/doc/doctempl.cxx +++ b/sfx2/source/doc/doctempl.cxx @@ -492,7 +492,9 @@ OUString SfxDocumentTemplates::ConvertResourceString(const OUString& rString) u"" STR_TEMPLATE_NAME27_DEF, u"" STR_TEMPLATE_NAME28_DEF, u"" STR_TEMPLATE_NAME29_DEF, -u"" STR_TEMPLATE_NAME30_DEF +u"" STR_TEMPLATE_NAME30_DEF, +u"" STR_TEMPLATE_NAME31_DEF, +u"" STR_TEMPLATE_NAME32_DEF, }; TranslateId STR_TEMPLATE_NAME[] = @@ -526,7 +528,9 @@ OUString SfxDocumentTemplates::ConvertResourceString(const OUString& rString) STR_TEMPLATE_NAME27, STR_TEMPLATE_NAME28, STR_TEMPLATE_NAME29, -STR_TEMPLATE_NAME30 +STR_TEMPLATE_NAME30, +STR_TEMPLATE_NAME31, +STR_TEMPLATE_NAME32, }; static_assert(SAL_N_ELEMENTS(aTemplateNames) == SAL_N_ELEMENTS(STR_TEMPLATE_NAME));
[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sfx2/source sw/source
sfx2/source/appl/macroloader.cxx |9 +++-- sfx2/source/doc/iframe.cxx | 20 +++- sfx2/source/inc/macroloader.hxx|2 ++ sw/source/filter/html/htmlplug.cxx |7 ++- sw/source/filter/xml/xmltexti.cxx |9 +++-- 5 files changed, 37 insertions(+), 10 deletions(-) New commits: commit f5e3b0a7966d7d28817292adbb58fb43f28b7c6d Author: Caolán McNamara AuthorDate: Tue Aug 30 17:01:08 2022 +0100 Commit: Christian Lohmaier CommitDate: Wed Aug 31 20:26:42 2022 +0200 check IFrame "FrameURL" target similiar to commit b3edf85e0fe6ca03dc26e1bf531be82193bc9627 Date: Wed Aug 7 17:37:11 2019 +0100 warn on load when a document binds an event to a macro Change-Id: Iea888b1c083d2dc69ec322309ac9ae8c5e5eb315 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139059 Tested-by: Jenkins Reviewed-by: Stephan Bergmann (cherry picked from commit c7450d0b9d02c64ae3da467d329040787039767e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139117 Reviewed-by: Christian Lohmaier diff --git a/sfx2/source/appl/macroloader.cxx b/sfx2/source/appl/macroloader.cxx index 3f8fb33636ad..d0281c5a4085 100644 --- a/sfx2/source/appl/macroloader.cxx +++ b/sfx2/source/appl/macroloader.cxx @@ -68,10 +68,10 @@ css::uno::Sequence SAL_CALL SfxMacroLoader::getSupportedServiceNames() return { "com.sun.star.frame.ProtocolHandler" }; } -SfxObjectShell* SfxMacroLoader::GetObjectShell_Impl() +SfxObjectShell* SfxMacroLoader::GetObjectShell(const Reference & xFrame) { SfxObjectShell* pDocShell = nullptr; -Reference < XFrame > xFrame( m_xFrame.get(), UNO_QUERY ); + if ( xFrame.is() ) { SfxFrame* pFrame=nullptr; @@ -88,6 +88,11 @@ SfxObjectShell* SfxMacroLoader::GetObjectShell_Impl() return pDocShell; } +SfxObjectShell* SfxMacroLoader::GetObjectShell_Impl() +{ +Reference < XFrame > xFrame( m_xFrame.get(), UNO_QUERY ); +return SfxMacroLoader::GetObjectShell(xFrame); +} uno::Reference SAL_CALL SfxMacroLoader::queryDispatch( const util::URL& aURL, diff --git a/sfx2/source/doc/iframe.cxx b/sfx2/source/doc/iframe.cxx index 58a387527e4a..80e0c4e68457 100644 --- a/sfx2/source/doc/iframe.cxx +++ b/sfx2/source/doc/iframe.cxx @@ -39,10 +39,12 @@ #include #include #include +#include #include #include #include #include +#include using namespace ::com::sun::star; @@ -158,6 +160,19 @@ sal_Bool SAL_CALL IFrameObject::load( { if ( officecfg::Office::Common::Misc::PluginsEnabled::get() ) { +util::URL aTargetURL; +aTargetURL.Complete = maFrmDescr.GetURL().GetMainURL( INetURLObject::DecodeMechanism::NONE ); +uno::Reference < util::XURLTransformer > xTrans( util::URLTransformer::create( mxContext ) ); +xTrans->parseStrict( aTargetURL ); + +if (INetURLObject(aTargetURL.Complete).GetProtocol() == INetProtocol::Macro) +{ +uno::Reference xParentFrame = xFrame->getCreator(); +SfxObjectShell* pDoc = SfxMacroLoader::GetObjectShell(xParentFrame); +if (pDoc && !pDoc->AdjustMacroMode()) +return false; +} + DBG_ASSERT( !mxFrame.is(), "Frame already existing!" ); VclPtr pParent = VCLUnoHelper::GetWindow( xFrame->getContainerWindow() ); VclPtr pWin = VclPtr::Create( pParent, maFrmDescr.IsFrameBorderOn() ); @@ -180,11 +195,6 @@ sal_Bool SAL_CALL IFrameObject::load( if ( xFramesSupplier.is() ) mxFrame->setCreator( xFramesSupplier ); -util::URL aTargetURL; -aTargetURL.Complete = maFrmDescr.GetURL().GetMainURL( INetURLObject::DecodeMechanism::NONE ); -uno::Reference < util::XURLTransformer > xTrans( util::URLTransformer::create( mxContext ) ); -xTrans->parseStrict( aTargetURL ); - uno::Sequence < beans::PropertyValue > aProps{ comphelper::makePropertyValue("PluginMode", sal_Int16(2)), comphelper::makePropertyValue("ReadOnly", true) diff --git a/sfx2/source/inc/macroloader.hxx b/sfx2/source/inc/macroloader.hxx index b51cae3d93cf..250a07cd8ca1 100644 --- a/sfx2/source/inc/macroloader.hxx +++ b/sfx2/source/inc/macroloader.hxx @@ -79,6 +79,8 @@ public: virtual void SAL_CALL addStatusListener( const css::uno::Reference< css::frame::XStatusListener >& xControl, const css::util::URL& aURL ) override; virtual void SAL_CALL removeStatusListener( const css::uno::Reference< css::frame::XStatusListener >& xControl, const css::util::URL& aURL ) override; + +static SfxObjectShell* GetObjectShell(const css::uno::Reference& xFrame); }; #endif diff --git a/sw/source/filter/html/htmlplug.cxx b/sw/source/filter/html/htmlplug.cxx index fdd7bd675954..76e07d63073d 100644 --- a/sw/source/filter/html/htmlplug.cxx +++ b/sw/source/filter/html/htmlplug.cxx @@ -1100,7 +1100,12 @@ void SwHTMLParser::InsertFloatingFrame()
[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sfx2/source
sfx2/source/view/viewfrm.cxx | 44 --- 1 file changed, 29 insertions(+), 15 deletions(-) New commits: commit 8067c5a66538b2fc31bbed9d5ae7dbfcaa6821f6 Author: László Németh AuthorDate: Tue Jul 19 14:53:52 2022 +0200 Commit: Christian Lohmaier CommitDate: Thu Aug 18 19:17:16 2022 +0200 tdf#148913 sw: fix crash with pending infobars on Windows Usage of VclPtr wasn't thread-safe on Windows, resulting random crashing during loading big documents. Regression from commit d89786054715b44aa983d0752484216825c74ae2 "tdf#125909 tdf#141298 sw: show (Hidden) Track Changes infobar". Change-Id: Ic6a6ad43a8cf7ea650ef6d1c0aa5c76c48763ea8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137230 Tested-by: László Németh Reviewed-by: László Németh (cherry picked from commit 85a044abdf08bafa93e1caddf38f86e35d7e17f2) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137184 Tested-by: Jenkins Reviewed-by: Christian Lohmaier diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 7f3bf1a6bcc2..dfc0792ae9b2 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -1537,27 +1537,41 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint ) } } -VclPtr pInfoBar = -AppendInfoBar(aInfobarData.msId, aInfobarData.msPrimaryMessage, +// Track Changes infobar: add a button to show/hide Track Changes functions +// Hyphenation infobar: add a button to get more information +// tdf#148913 limit VclPtr usage for these +bool bTrackChanges = aInfobarData.msId == "hiddentrackchanges"; +if ( bTrackChanges || aInfobarData.msId == "hyphenationmissing" ) +{ +VclPtr pInfoBar = +AppendInfoBar(aInfobarData.msId, aInfobarData.msPrimaryMessage, aInfobarData.msSecondaryMessage, aInfobarData.maInfobarType, aInfobarData.mbShowCloseButton); -// Track Changes infobar: add a button to show/hide Track Changes functions -if ( pInfoBar && aInfobarData.msId == "hiddentrackchanges" ) -{ -weld::Button& rTrackChangesButton = pInfoBar->addButton(); - rTrackChangesButton.set_label(SfxResId(STR_TRACK_CHANGES_BUTTON)); -rTrackChangesButton.connect_clicked(LINK(this, +// tdf#148913 don't extend this condition to keep it thread-safe +if (pInfoBar) +{ +weld::Button& rButton = pInfoBar->addButton(); +rButton.set_label(SfxResId(bTrackChanges +? STR_TRACK_CHANGES_BUTTON +: STR_HYPHENATION_BUTTON)); +if (bTrackChanges) +{ +rButton.connect_clicked(LINK(this, SfxViewFrame, HiddenTrackChangesHandler)); +} +else +{ +rButton.connect_clicked(LINK(this, +SfxViewFrame, HyphenationMissingHandler)); +} +} } - -// Hyphenation infobar: add a button to get more information -if ( pInfoBar && aInfobarData.msId == "hyphenationmissing" ) +else { -weld::Button& rHyphenationButton = pInfoBar->addButton(); - rHyphenationButton.set_label(SfxResId(STR_HYPHENATION_BUTTON)); -rHyphenationButton.connect_clicked(LINK(this, - SfxViewFrame, HyphenationMissingHandler)); +AppendInfoBar(aInfobarData.msId, aInfobarData.msPrimaryMessage, + aInfobarData.msSecondaryMessage, aInfobarData.maInfobarType, + aInfobarData.mbShowCloseButton); } aPendingInfobars.pop_back();
[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sfx2/source
sfx2/source/appl/newhelp.cxx |6 +- 1 file changed, 5 insertions(+), 1 deletion(-) New commits: commit 6e770a30cea55142892b8ef0ddb515ef1c77d2ea Author: Caolán McNamara AuthorDate: Mon Aug 8 17:01:31 2022 +0200 Commit: Xisco Fauli CommitDate: Tue Aug 9 12:06:24 2022 +0200 sfx2: check saved last tab page name exists before restoring it since GetPage might return nullptr on a nonexisting page See https://crashreport.libreoffice.org/stats/signature/SfxHelpIndexWindow_Impl::ActivatePageHdl(rtl::OString%20const%20&) Change-Id: I26e21f783645e8a87d56cbe76c0126de8947bf3e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138015 Reviewed-by: Xisco Fauli Reviewed-by: Michael Stahl Tested-by: Jenkins diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx index b3b7483bb29a..850a2b207962 100644 --- a/sfx2/source/appl/newhelp.cxx +++ b/sfx2/source/appl/newhelp.cxx @@ -1305,7 +1305,11 @@ SfxHelpIndexWindow_Impl::SfxHelpIndexWindow_Impl(SfxHelpWindow_Impl* _pParent, w OString sPageId("index"); SvtViewOptions aViewOpt( EViewType::TabDialog, CONFIGNAME_INDEXWIN ); if ( aViewOpt.Exists() ) -sPageId = aViewOpt.GetPageID(); +{ +OString sSavedPageId = aViewOpt.GetPageID(); +if (m_xTabCtrl->get_page_index(sSavedPageId) != -1) +sPageId = sSavedPageId; +} m_xTabCtrl->set_current_page(sPageId); ActivatePageHdl(sPageId); m_xActiveLB->connect_changed(LINK(this, SfxHelpIndexWindow_Impl, SelectHdl));
[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sfx2/source
sfx2/source/dialog/recfloat.cxx | 15 --- sfx2/source/inc/recfloat.hxx|4 2 files changed, 16 insertions(+), 3 deletions(-) New commits: commit 4285d6f64a01b26b446f387db0a309340c3a49e4 Author: Caolán McNamara AuthorDate: Thu Jul 28 15:49:32 2022 +0100 Commit: Caolán McNamara CommitDate: Thu Aug 4 15:40:28 2022 +0200 Resolves: tdf#147782 restore focus to launching frame asynchronously Change-Id: I7ebde70e4e1aae861f6ac7d70a91741596cb2cc5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137526 Reviewed-by: Michael Stahl Tested-by: Jenkins diff --git a/sfx2/source/dialog/recfloat.cxx b/sfx2/source/dialog/recfloat.cxx index 6a6fc17dbd9a..1dcbb2f7c416 100644 --- a/sfx2/source/dialog/recfloat.cxx +++ b/sfx2/source/dialog/recfloat.cxx @@ -102,6 +102,7 @@ SfxRecordingFloat_Impl::SfxRecordingFloat_Impl(SfxBindings* pBind, SfxChildWindo "FloatingRecord") , m_xToolbar(m_xBuilder->weld_toolbar("toolbar")) , m_xDispatcher(new ToolbarUnoDispatcher(*m_xToolbar, *m_xBuilder, pBind->GetActiveFrame())) +, mnPostUserEventId(nullptr) , m_bFirstActivate(true) { // start recording @@ -110,6 +111,14 @@ SfxRecordingFloat_Impl::SfxRecordingFloat_Impl(SfxBindings* pBind, SfxChildWindo SfxCallMode::SYNCHRON, { }); } +IMPL_LINK_NOARG(SfxRecordingFloat_Impl, PresentParentFrame, void*, void) +{ +mnPostUserEventId = nullptr; +css::uno::Reference xTopWindow(m_xDispatcher->GetFrame()->getContainerWindow(), css::uno::UNO_QUERY); +if (xTopWindow.is()) +xTopWindow->toFront(); +} + void SfxRecordingFloat_Impl::Activate() { SfxModelessDialogController::Activate(); @@ -117,13 +126,13 @@ void SfxRecordingFloat_Impl::Activate() return; // tdf#147782 retain focus in launching frame on the first activate on automatically gaining focus on getting launched m_bFirstActivate = false; -css::uno::Reference xTopWindow(m_xDispatcher->GetFrame()->getContainerWindow(), css::uno::UNO_QUERY); -if (xTopWindow.is()) -xTopWindow->toFront(); +mnPostUserEventId = Application::PostUserEvent(LINK(this, SfxRecordingFloat_Impl, PresentParentFrame)); } SfxRecordingFloat_Impl::~SfxRecordingFloat_Impl() { +if (mnPostUserEventId) +Application::RemoveUserEvent(mnPostUserEventId); m_xDispatcher->dispose(); } diff --git a/sfx2/source/inc/recfloat.hxx b/sfx2/source/inc/recfloat.hxx index b7a4882cd72e..e5720e155cd6 100644 --- a/sfx2/source/inc/recfloat.hxx +++ b/sfx2/source/inc/recfloat.hxx @@ -42,7 +42,11 @@ class SfxRecordingFloat_Impl final : public SfxModelessDialogController { std::unique_ptr m_xToolbar; std::unique_ptr m_xDispatcher; +ImplSVEvent *mnPostUserEventId; bool m_bFirstActivate; + +DECL_LINK(PresentParentFrame, void*, void); + public: SfxRecordingFloat_Impl(SfxBindings* pBindings, SfxChildWindow* pChildWin,
[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sfx2/source
sfx2/source/sidebar/SidebarController.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit cb2acc2ae1a45e45e5e3dd5907df63aecce0823e Author: Aron Budea AuthorDate: Wed Jul 20 17:16:12 2022 +0200 Commit: Adolfo Jayme Barrientos CommitDate: Sun Jul 24 21:33:17 2022 +0200 tdf#141294 Use DPI scale factor for sidebar width limit in config And don't lock up if the calculated minimum exceeds the maximum (sidebar remains unresizable in that case, however). Change-Id: Ibe96a43ad5d6a3fe4132a9fb64fe244ab022668d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137267 Tested-by: Jenkins Reviewed-by: Szymon Kłos Reviewed-by: Aron Budea (cherry picked from commit f319363b0e07010eea806c723254f17dacdf1b06) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137189 Reviewed-by: Adolfo Jayme Barrientos diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx index 279b602cb2a6..12e1f1ae252e 100644 --- a/sfx2/source/sidebar/SidebarController.cxx +++ b/sfx2/source/sidebar/SidebarController.cxx @@ -123,7 +123,6 @@ SidebarController::SidebarController ( this)), maCurrentContext(OUString(), OUString()), mnRequestedForceFlags(SwitchFlag_NoForce), - mnMaximumSidebarWidth(officecfg::Office::UI::Sidebar::General::MaximumWidth::get()), mbMinimumSidebarWidth(officecfg::Office::UI::Sidebar::General::MinimumWidth::get()), msCurrentDeckId(gsDefaultDeckId), maPropertyChangeForwarder([this](){ return this->BroadcastPropertyChange(); }), @@ -135,6 +134,7 @@ SidebarController::SidebarController ( mpSplitWindow(nullptr), mnWidthOnSplitterButtonDown(0) { +mnMaximumSidebarWidth = officecfg::Office::UI::Sidebar::General::MaximumWidth::get() * mpTabBar->GetDPIScaleFactor(); // Decks and panel collections for this sidebar mpResourceManager = std::make_unique(); } @@ -1434,7 +1434,7 @@ void SidebarController::RestrictWidth (sal_Int32 nWidth) pSplitWindow->SetItemSizeRange( nSetId, -Range(nRequestedWidth, getMaximumWidth())); +Range(nRequestedWidth, std::max(nRequestedWidth, getMaximumWidth(; } }
[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sfx2/source
sfx2/source/view/viewfrm.cxx | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) New commits: commit c3afc3ba94500f726475adc895de6c92814ae8bb Author: Stephan Bergmann AuthorDate: Fri Jul 8 16:47:01 2022 +0200 Commit: Michael Stahl CommitDate: Mon Jul 11 13:31:09 2022 +0200 rhbz#2104545: Only call utl::IsYounger when its result is actually used ...as it may be expensive, or even throw (uncaught) exceptions (as apparently happened at rhbz#2104545, throwing some css::uno::RuntimeException while aMedObj was an sftp URL). The two branches in the if statement's condition that will now potentially call physObjIsOlder are disjoint (one for aMedObj being a file URL, the other for aMedObj being any WebDAV-related URL), so there is no chance that this change accidentally causes utl::IsYounger to be called more often than it used to be called. Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136904 Tested-by: Jenkins Reviewed-by: Stephan Bergmann (cherry picked from commit 27ffdcf096a7e9863489599dd80528b088d1e9b8) Conflicts: sfx2/source/view/viewfrm.cxx Change-Id: I29a5f18a12a8b83ec603366db26451175b5622c9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136909 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index ecae96b5d945..7f3bf1a6bcc2 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -270,6 +270,11 @@ bool AskPasswordToModify_Impl( const uno::Reference< task::XInteractionHandler > return bResult; } + +bool physObjIsOlder(INetURLObject const & aMedObj, INetURLObject const & aPhysObj) { +return ::utl::UCBContentHelper::IsYounger(aMedObj.GetMainURL( INetURLObject::DecodeMechanism::NONE), + aPhysObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ) ); +} } void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) @@ -438,8 +443,6 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) // etag tells that the cache representation (e.g. in LO) is different from the one on the server, // but tells nothing about the age // Details at this link: http://tools.ietf.org/html/rfc4918#section-15, section 15.7 -bool bPhysObjIsYounger = ::utl::UCBContentHelper::IsYounger( aMedObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ), - aPhysObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ) ); bool bIsWebDAV = aMedObj.isAnyKnownWebDAVScheme(); // tdf#118938 Reload the document when the user enters the editing password, @@ -447,8 +450,8 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) if ( ( !bNeedsReload && ( ( aMedObj.GetProtocol() == INetProtocol::File && ( aMedObj.getFSysPath( FSysStyle::Detect ) != aPhysObj.getFSysPath( FSysStyle::Detect ) || bPasswordEntered ) && -!bPhysObjIsYounger ) - || ( bIsWebDAV && !bPhysObjIsYounger ) +!physObjIsOlder(aMedObj, aPhysObj) ) + || ( bIsWebDAV && !physObjIsOlder(aMedObj, aPhysObj) ) || ( pMed->IsRemote() && !bIsWebDAV ) ) ) || pVersionItem ) // <- tdf#82744
[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sfx2/source
sfx2/source/appl/appserv.cxx |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) New commits: commit 54d40fef93f1194bf29440cf66a567c9fc612158 Author: Xisco Fauli AuthorDate: Tue Jul 5 15:51:21 2022 +0200 Commit: Michael Stahl CommitDate: Thu Jul 7 12:33:16 2022 +0200 sfx2: fix null derefs of SfxViewFrame::Current() See https://crashreport.libreoffice.org/stats/signature/%60anonymous%20namespace'::lcl_tryLoadBibliography Change-Id: I80d764c4bbcf0c5affa3386fbb11f5a79e98b699 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136767 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index 107b8c1f749a..741d3f2cbafd 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -186,8 +186,10 @@ namespace SfxStringItem aURL(SID_FILE_NAME, ".component:Bibliography/View1"); SfxStringItem aRef(SID_REFERER, "private:user"); SfxStringItem aTarget(SID_TARGETNAME, "_blank"); -SfxViewFrame::Current()->GetDispatcher()->ExecuteList(SID_OPENDOC, -SfxCallMode::ASYNCHRON, { , , }); +const SfxViewFrame* pViewFrame = SfxViewFrame::Current(); +if ( pViewFrame ) +pViewFrame->GetDispatcher()->ExecuteList(SID_OPENDOC, +SfxCallMode::ASYNCHRON, { , , }); } catch (const Exception &) {
[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sfx2/source
sfx2/source/dialog/backingwindow.cxx | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) New commits: commit f3b93f48ee65273cfee63e54f831c199110a20b7 Author: Heiko Tietze AuthorDate: Tue May 24 13:46:19 2022 +0200 Commit: Heiko Tietze CommitDate: Fri May 27 08:08:26 2022 +0200 Resolves tdf#119447 - Improve sidebar height in start center Reduced the font size multiplier from 1.4 to 1.2 to fit the window into 768px height and added the branding image to the height calculation Change-Id: I05473155f0068880298a461fe8491468b07079b6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134867 Tested-by: Jenkins Reviewed-by: Heiko Tietze (cherry picked from commit ed45b67db66ef0f6c69887c75013a178c4412f74) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135006 diff --git a/sfx2/source/dialog/backingwindow.cxx b/sfx2/source/dialog/backingwindow.cxx index e6727c6b..63c3a0f54f27 100644 --- a/sfx2/source/dialog/backingwindow.cxx +++ b/sfx2/source/dialog/backingwindow.cxx @@ -66,8 +66,11 @@ class BrandImage final : public weld::CustomWidgetController private: BitmapEx maBrandImage; bool mbIsDark = false; +Size m_BmpSize; public: +Size getSize() { return m_BmpSize; } + virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override { weld::CustomWidgetController::SetDrawingArea(pDrawingArea); @@ -94,8 +97,8 @@ public: if (maBrandImage.GetSizePixel().Width() == nWidth) return; LoadImageForWidth(nWidth); -const Size aBmpSize(maBrandImage.GetSizePixel()); -set_size_request(aBmpSize.Width(), aBmpSize.Height()); +m_BmpSize = maBrandImage.GetSizePixel(); +set_size_request(m_BmpSize.Width(), m_BmpSize.Height()); } virtual void StyleUpdated() override @@ -135,7 +138,7 @@ public: }; // increase size of the text in the buttons on the left fMultiplier-times -float const g_fMultiplier = 1.4f; +float const g_fMultiplier = 1.2f; BackingWindow::BackingWindow(vcl::Window* i_pParent) : InterimItemWindow(i_pParent, "sfx/ui/startcenter.ui", "StartCenter", false) @@ -371,7 +374,7 @@ void BackingWindow::ApplyStyleSettings() // Refetch because the brand image height to match this width is now set aPrefSize = mxAllButtonsBox->get_preferred_size(); -set_height_request(nMenuHeight + aPrefSize.Height()); +set_height_request(nMenuHeight + aPrefSize.Height() + mxBrandImage->getSize().getHeight()); } void BackingWindow::initializeLocalView()
[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sfx2/source
sfx2/source/appl/newhelp.cxx | 17 - sfx2/source/appl/newhelp.hxx |1 + 2 files changed, 17 insertions(+), 1 deletion(-) New commits: commit a2b1c7c071cc2bf847a603733b972df23e904ff6 Author: Caolán McNamara AuthorDate: Tue Apr 5 16:44:39 2022 +0100 Commit: Michael Stahl CommitDate: Wed Apr 6 10:53:03 2022 +0200 Resolves: rhbz#2069486 classic help index entry autocompletes on del/backspace when it shouldn't Change-Id: I90fa338479e0d5612d7b09f94c45e356ea71f89e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132596 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx index ee4e2c32b955..9312a83ccd04 100644 --- a/sfx2/source/appl/newhelp.cxx +++ b/sfx2/source/appl/newhelp.cxx @@ -397,6 +397,7 @@ IndexTabPage_Impl::IndexTabPage_Impl(weld::Widget* pParent, SfxHelpIndexWindow_I , bIsActivated(false) , nRowHeight(m_xIndexList->get_height_rows(1)) , nAllHeight(0) +, nLastCharCode(0) { m_xIndexList->set_size_request(m_xIndexList->get_approximate_digit_width() * 30, -1); @@ -466,7 +467,19 @@ IMPL_LINK_NOARG(IndexTabPage_Impl, TreeChangeHdl, weld::TreeView&, void) IMPL_LINK_NOARG(IndexTabPage_Impl, EntryChangeHdl, weld::Entry&, void) { -aAutoCompleteIdle.Start(); +switch (nLastCharCode) +{ +case css::awt::Key::DELETE_WORD_BACKWARD: +case css::awt::Key::DELETE_WORD_FORWARD: +case css::awt::Key::DELETE_TO_BEGIN_OF_LINE: +case css::awt::Key::DELETE_TO_END_OF_LINE: +case KEY_BACKSPACE: +case KEY_DELETE: +break; +default: +aAutoCompleteIdle.Start(); +break; +} } IMPL_LINK(IndexTabPage_Impl, KeyInputHdl, const KeyEvent&, rKEvt, bool) @@ -531,6 +544,8 @@ IMPL_LINK(IndexTabPage_Impl, KeyInputHdl, const KeyEvent&, rKEvt, bool) //m_bTreeChange = false; return true; } + +nLastCharCode = nCode; return false; } diff --git a/sfx2/source/appl/newhelp.hxx b/sfx2/source/appl/newhelp.hxx index 7d22336ecf83..f26bf93379a9 100644 --- a/sfx2/source/appl/newhelp.hxx +++ b/sfx2/source/appl/newhelp.hxx @@ -102,6 +102,7 @@ private: boolbIsActivated; int nRowHeight; int nAllHeight; +sal_uInt16 nLastCharCode; voidInitializeIndex(); voidClearIndex();
[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sfx2/source vcl/source
sfx2/source/view/lokhelper.cxx | 11 +++ vcl/source/window/window2.cxx |2 +- 2 files changed, 8 insertions(+), 5 deletions(-) New commits: commit e1e62ba8bb09c532db576abcca451238bc86ffef Author: Michael Meeks AuthorDate: Mon Jan 3 14:15:49 2022 + Commit: Caolán McNamara CommitDate: Sun Feb 27 22:25:44 2022 +0100 lokit: double check for disposed windows & fix leak. it seems we can get windows disposed before we get to the emission. vcl::Window::IsTracking() const vcl/source/window/window2.cxx:341 (anonymous namespace)::LOKPostAsyncEvent(void*, void*) sfx2/source/view/lokhelper.cxx:725 LokChartHelper::postMouseEvent(int, int, int, int, int, int, double, double) include/rtl/ref.hxx:112 SwXTextDocument::postMouseEvent(int, int, int, int, int, int) sw/source/uibase/uno/unotxdoc.cxx:3561 Change-Id: I93aea931dad1e7f43d3d610568424c53d2b22fbc Signed-off-by: Michael Meeks Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127907 (cherry picked from commit 7ba99b8d6da07c2133c644de4d1a3613a9fa5a68) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129839 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx index cd93f9b4dd55..cb8194c1cabf 100644 --- a/sfx2/source/view/lokhelper.cxx +++ b/sfx2/source/view/lokhelper.cxx @@ -679,9 +679,7 @@ namespace { std::unique_ptr pLOKEv(static_cast(pEv)); if (pLOKEv->mpWindow->isDisposed()) -{ return; -} int nView = SfxLokHelper::getView(nullptr); if (nView != pLOKEv->mnView) @@ -700,6 +698,9 @@ namespace if (!pFocusWindow) pFocusWindow = pLOKEv->mpWindow; +if (pLOKEv->mpWindow->isDisposed()) +return; + switch (pLOKEv->mnEvent) { case VclEventId::WindowKeyInput: @@ -708,11 +709,13 @@ namespace KeyEvent singlePress(pLOKEv->maKeyEvent.GetCharCode(), pLOKEv->maKeyEvent.GetKeyCode()); for (sal_uInt16 i = 0; i <= nRepeat; ++i) -pFocusWindow->KeyInput(singlePress); +if (!pFocusWindow->isDisposed()) +pFocusWindow->KeyInput(singlePress); break; } case VclEventId::WindowKeyUp: -pFocusWindow->KeyUp(pLOKEv->maKeyEvent); +if (!pFocusWindow->isDisposed()) +pFocusWindow->KeyUp(pLOKEv->maKeyEvent); break; case VclEventId::WindowMouseButtonDown: pLOKEv->mpWindow->LogicMouseButtonDown(pLOKEv->maMouseEvent); diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx index af4aeb10a564..1383bad0888f 100644 --- a/vcl/source/window/window2.cxx +++ b/vcl/source/window/window2.cxx @@ -311,7 +311,7 @@ void Window::EndTracking( TrackingEventFlags nFlags ) bool Window::IsTracking() const { -return (ImplGetSVData()->mpWinData->mpTrackWin == this); +return mpWindowImpl && (ImplGetSVData()->mpWinData->mpTrackWin == this); } void Window::StartAutoScroll( StartAutoScrollFlags nFlags )
[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sfx2/source
sfx2/source/commandpopup/CommandPopup.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit 4886374fca8f17de78ae558033aa677bcefc0a4e Author: Rafael Lima AuthorDate: Fri Feb 18 02:27:11 2022 +0100 Commit: Tomaž Vajngerl CommitDate: Fri Feb 18 09:01:15 2022 +0100 tdf#143817 Fix HUD deleting text contents in Writer Change-Id: Ie28388016c475907c5d8fbe51906bc4a01d6b0d5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130091 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl (cherry picked from commit 3c94a0f7729f1638ab3b273a186c48de859cfb49) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130092 diff --git a/sfx2/source/commandpopup/CommandPopup.cxx b/sfx2/source/commandpopup/CommandPopup.cxx index 473155f89a00..7575a5794b32 100644 --- a/sfx2/source/commandpopup/CommandPopup.cxx +++ b/sfx2/source/commandpopup/CommandPopup.cxx @@ -246,6 +246,7 @@ IMPL_LINK(CommandListBox, TreeViewKeyPress, const KeyEvent&, rKeyEvent, bool) else if (rKeyEvent.GetKeyCode().GetCode() == KEY_RETURN) { RowActivated(*mpCommandTreeView); +return true; } return false;
[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sfx2/source
sfx2/source/control/thumbnailview.cxx |9 - 1 file changed, 8 insertions(+), 1 deletion(-) New commits: commit 3b79c7347d14756e072265b39081bc3866e1196d Author: Katarina Behrens AuthorDate: Fri Jan 28 18:03:58 2022 +0100 Commit: Caolán McNamara CommitDate: Tue Feb 1 20:39:05 2022 +0100 tdf#122708: on GetFocus, select something also when items are filtered Previously if nothing was selected, we picked item with ID 1 to select/highlight. But if a filter is active, such item may not match the active filter (case in point: document template no. 1 matches 'Writer templates' filter, but not 'Impress templates' one) Try harder to find an item to select by looking at the list of filtered items too Change-Id: I9cb053b884dc724c7a6199ec002d83024ed83976 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129117 Tested-by: Jenkins Reviewed-by: Katarina Behrens (cherry picked from commit 4bb0ffa4684dada708ecdf727f4fc9f500a9bced) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129081 Reviewed-by: Caolán McNamara diff --git a/sfx2/source/control/thumbnailview.cxx b/sfx2/source/control/thumbnailview.cxx index 04de9a437550..217694520427 100644 --- a/sfx2/source/control/thumbnailview.cxx +++ b/sfx2/source/control/thumbnailview.cxx @@ -923,7 +923,14 @@ void ThumbnailView::GetFocus() if (nSelected == -1 && !mItemList.empty()) { -SelectItem(1); +ThumbnailViewItem* pFirst = nullptr; +if (!mFilteredItemList.empty()) { +pFirst = mFilteredItemList[0]; +} else { +pFirst = mItemList[0].get(); +} + +SelectItem(pFirst->mnId); } }
[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sfx2/source
sfx2/source/appl/appserv.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit d8ad1d634db888026ef973442775775051066458 Author: Vasily Melenchuk AuthorDate: Thu Jan 20 14:16:40 2022 +0300 Commit: Vasily Melenchuk CommitDate: Fri Jan 21 14:09:25 2022 +0100 tdf#140020: Disable also menu File->SaveAll for docs with LockSave If LockSave attribute is applied, docs with it are not affecting File->Save All menu item: these documents are not enabling this menu and also not saved during this process. Change-Id: I00bcd251fccfab3f13cb42c20ccb61b54ab49346 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128650 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt Reviewed-by: Vasily Melenchuk (cherry picked from commit 87fe449c4c1ed46003e9d5fdaf1919f11a53b959) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128676 diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index b8c80823daf3..107b8c1f749a 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -461,7 +461,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) pObjSh = SfxObjectShell::GetNext( *pObjSh ) ) { SfxRequest aReq( SID_SAVEDOC, SfxCallMode::SLOT, pObjSh->GetPool() ); -if ( pObjSh->IsModified() ) +if ( pObjSh->IsModified() && !pObjSh->isSaveLocked()) { pObjSh->ExecuteSlot( aReq ); const SfxBoolItem *pItem = dynamic_cast( aReq.GetReturnValue() ); @@ -1149,7 +1149,7 @@ void SfxApplication::MiscState_Impl(SfxItemSet ) pObjSh; pObjSh = SfxObjectShell::GetNext( *pObjSh ) ) { -if ( pObjSh->IsModified() ) +if ( pObjSh->IsModified() && !pObjSh->isSaveLocked() ) { bModified = true; break;
[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sfx2/source
sfx2/source/view/viewsh.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 35a468ebe12d46a4092d9b70399736ae4ad2f476 Author: Vasily Melenchuk AuthorDate: Tue Jan 18 12:50:01 2022 +0300 Commit: Vasily Melenchuk CommitDate: Thu Jan 20 13:44:50 2022 +0100 tdf#140019: Revert "Don't disable "Send doc via email" ..." Locked export should also disable ability to send document. This reverts commit b9930d0d05db39a8466b18dccf626bc3d8ae5c4e. Change-Id: I3b7b423c0e17a59872065ec7ceadbaf1cda45ccc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128550 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt Reviewed-by: Vasily Melenchuk (cherry picked from commit f4559274154324e132f82ba9c21676326f6db7e5) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128546 diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index 75826a28d128..f4ec9b29b0a1 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -673,7 +673,7 @@ void SfxViewShell::GetState_Impl( SfxItemSet ) #if HAVE_FEATURE_MACOSX_SANDBOX rSet.DisableItem(nSID); #endif -if (pSh && pSh->isExportLocked() && nSID != SID_MAIL_SENDDOC) +if (pSh && pSh->isExportLocked()) rSet.DisableItem(nSID); break; }
[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sfx2/source unotools/source
sfx2/source/doc/doctemplates.cxx| 27 ++- unotools/source/ucbhelper/xtempfile.cxx |6 ++ 2 files changed, 16 insertions(+), 17 deletions(-) New commits: commit d1068539a1eb305ebcbb301f2f8f6fda0ab2d6ee Author: Noel Grandin AuthorDate: Mon Jan 10 19:37:05 2022 +0200 Commit: Xisco Fauli CommitDate: Wed Jan 12 19:11:56 2022 +0100 tdf#146375 Cannot rename user-defined categories in template manager Regression from commit 3624a703361b108d22448bd60a97733f05e37820 tdf#135316 remove OTempFileService pessimisation So fix two things here (1) make it so the tempfile service flushes the SvStream buffer and resets the file position, so we can read the data after writing it. (2) Simplify the UCB usage to just write the contents of the tempfile via the tempfile InputStream, which is simpler and safer Change-Id: I15ed3b02c2d6415d10a9579f66374e6268188d5c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128195 Tested-by: Noel Grandin Reviewed-by: Noel Grandin Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128274 Tested-by: Jenkins diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx index f2e13da357e2..cbdbe676f6f1 100644 --- a/sfx2/source/doc/doctemplates.cxx +++ b/sfx2/source/doc/doctemplates.cxx @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include @@ -231,7 +232,7 @@ class SfxDocTplService_Impl const OUString& aNewGroupName ); voidRemoveUINamesForTemplateDir_Impl( const OUString& aUserPath, std::u16string_view aGroupName ); -boolWriteUINamesForTemplateDir_Impl( const OUString& aUserPath, +boolWriteUINamesForTemplateDir_Impl( std::u16string_view aUserPath, const std::vector< beans::StringPair >& aUINames ); OUStringCreateNewGroupFsys( const OUString& rGroupName, Content& aGroup ); @@ -1264,21 +1265,16 @@ void SfxDocTplService_Impl::RemoveUINamesForTemplateDir_Impl( const OUString& aU } -bool SfxDocTplService_Impl::WriteUINamesForTemplateDir_Impl( const OUString& aUserPath, +bool SfxDocTplService_Impl::WriteUINamesForTemplateDir_Impl( std::u16string_view aUserPath, const std::vector< beans::StringPair >& aUINames ) { bool bResult = false; try { -uno::Reference< beans::XPropertySet > xTempFile( +uno::Reference< io::XTempFile > xTempFile( io::TempFile::create(mxContext), -uno::UNO_QUERY_THROW ); +uno::UNO_SET_THROW ); -OUString aTempURL; -uno::Any aUrl = xTempFile->getPropertyValue("Uri"); -aUrl >>= aTempURL; - -uno::Reference< io::XStream > xStream( xTempFile, uno::UNO_QUERY_THROW ); -uno::Reference< io::XOutputStream > xOutStream = xStream->getOutputStream(); +uno::Reference< io::XOutputStream > xOutStream = xTempFile->getOutputStream(); if ( !xOutStream.is() ) throw uno::RuntimeException(); @@ -1289,17 +1285,14 @@ bool SfxDocTplService_Impl::WriteUINamesForTemplateDir_Impl( const OUString& aUs } catch( uno::Exception& ) {} -Content aTargetContent( aUserPath, maCmdEnv, comphelper::getProcessComponentContext() ); -Content aSourceContent( aTempURL, maCmdEnv, comphelper::getProcessComponentContext() ); -aTargetContent.transferContent( aSourceContent, -InsertOperation::Copy, -"groupuinames.xml", -ucb::NameClash::OVERWRITE, -"text/xml" ); +uno::Reference < ucb::XSimpleFileAccess3 > xAccess(ucb::SimpleFileAccess::create(mxContext)); +xAccess->writeFile(OUString::Concat(aUserPath) + "groupuinames.xml", xTempFile->getInputStream()); + bResult = true; } catch ( uno::Exception& ) { +TOOLS_WARN_EXCEPTION("sfx.doc", ""); } return bResult; diff --git a/unotools/source/ucbhelper/xtempfile.cxx b/unotools/source/ucbhelper/xtempfile.cxx index d0f566c9e26c..55c10c7751fd 100644 --- a/unotools/source/ucbhelper/xtempfile.cxx +++ b/unotools/source/ucbhelper/xtempfile.cxx @@ -217,6 +217,12 @@ void SAL_CALL OTempFileService::closeOutput( ) throw css::io::NotConnectedException ( OUString(), static_cast < css::uno::XWeak * > (this ) ); mbOutClosed = true; +if (mpStream) +{ +// so that if you then open the InputStream, you can read the content +mpStream->Flush();
[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sfx2/source
sfx2/source/inc/eventsupplier.hxx| 14 +++--- sfx2/source/notify/eventsupplier.cxx | 10 +- 2 files changed, 12 insertions(+), 12 deletions(-) New commits: commit 7f34ac5201ffec31bd336cf9fb1f8d2554bc6f72 Author: Mike Kaganski AuthorDate: Tue Nov 30 00:08:57 2021 +0200 Commit: Xisco Fauli CommitDate: Thu Dec 9 09:51:17 2021 +0100 tdf#117280: derive SfxEvents_Impl from css::document::XDocumentEventListener It abused XEventListener, and created a DocumentEvent object from the incomplete data passed to notifyEvent in EventObject. That way, the data initially created for the document event (in Supplement) was lost on the way. Change-Id: I409611482ce2323a3192c68f3525f450a9395815 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126090 Tested-by: Jenkins Reviewed-by: Mike Kaganski (cherry picked from commit 28eef82cb16faef0b8ddc9912560efb779baa9f9) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126093 Reviewed-by: Xisco Fauli diff --git a/sfx2/source/inc/eventsupplier.hxx b/sfx2/source/inc/eventsupplier.hxx index af3d5bf357d5..0bbd11ef1773 100644 --- a/sfx2/source/inc/eventsupplier.hxx +++ b/sfx2/source/inc/eventsupplier.hxx @@ -24,8 +24,8 @@ #include #include -#include -#include +#include +#include #include #include #include @@ -40,17 +40,17 @@ class SfxObjectShell; class SvxMacro; -class SfxEvents_Impl final : public ::cppu::WeakImplHelper< css::container::XNameReplace, css::document::XEventListener > +class SfxEvents_Impl final : public ::cppu::WeakImplHelper< css::container::XNameReplace, css::document::XDocumentEventListener > { css::uno::Sequence< OUString > maEventNames; std::vector< css::uno::Any > maEventData; -css::uno::Reference< css::document::XEventBroadcaster > mxBroadcaster; +css::uno::Reference< css::document::XDocumentEventBroadcaster > mxBroadcaster; ::osl::MutexmaMutex; SfxObjectShell *mpObjShell; public: SfxEvents_Impl( SfxObjectShell* pShell, -css::uno::Reference< css::document::XEventBroadcaster > const & xBroadcaster ); +css::uno::Reference< css::document::XDocumentEventBroadcaster > const & xBroadcaster ); virtual ~SfxEvents_Impl() override; // --- XNameReplace --- @@ -65,8 +65,8 @@ public: virtual css::uno::Type SAL_CALLgetElementType() override; virtual sal_Bool SAL_CALL hasElements() override; -// --- ::document::XEventListener --- -virtual void SAL_CALL notifyEvent( const css::document::EventObject& aEvent ) override; +// --- ::document::XDocumentEventListener --- +virtual void SAL_CALL documentEventOccured(const css::document::DocumentEvent& aEvent) override; // --- ::lang::XEventListener --- virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override; diff --git a/sfx2/source/notify/eventsupplier.cxx b/sfx2/source/notify/eventsupplier.cxx index 00135b2a0654..08699ca70185 100644 --- a/sfx2/source/notify/eventsupplier.cxx +++ b/sfx2/source/notify/eventsupplier.cxx @@ -280,7 +280,7 @@ void SfxEvents_Impl::Execute( uno::Any const & aEventData, const document::Docum // --- ::document::XEventListener --- -void SAL_CALL SfxEvents_Impl::notifyEvent( const document::EventObject& aEvent ) +void SAL_CALL SfxEvents_Impl::documentEventOccured( const document::DocumentEvent& aEvent ) { ::osl::ClearableMutexGuard aGuard( maMutex ); @@ -292,7 +292,7 @@ void SAL_CALL SfxEvents_Impl::notifyEvent( const document::EventObject& aEvent ) uno::Any aEventData = maEventData[ nIndex ]; aGuard.clear(); -Execute( aEventData, document::DocumentEvent(aEvent.Source, aEvent.EventName, nullptr, uno::Any()), mpObjShell ); +Execute( aEventData, aEvent, mpObjShell ); } @@ -304,14 +304,14 @@ void SAL_CALL SfxEvents_Impl::disposing( const lang::EventObject& /*Source*/ ) if ( mxBroadcaster.is() ) { -mxBroadcaster->removeEventListener( this ); +mxBroadcaster->removeDocumentEventListener( this ); mxBroadcaster = nullptr; } } SfxEvents_Impl::SfxEvents_Impl( SfxObjectShell* pShell, -uno::Reference< document::XEventBroadcaster > const & xBroadcaster ) +uno::Reference< document::XDocumentEventBroadcaster > const & xBroadcaster ) { // get the list of supported events and store it if ( pShell ) @@ -325,7 +325,7 @@ SfxEvents_Impl::SfxEvents_Impl( SfxObjectShell* pShell, mxBroadcaster = xBroadcaster; if ( mxBroadcaster.is() ) -mxBroadcaster->addEventListener( this ); +mxBroadcaster->addDocumentEventListener( this ); }
[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sfx2/source vcl/source
sfx2/source/doc/objcont.cxx |2 +- vcl/source/gdi/gdimtf.cxx |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) New commits: commit c09f3fa3fc1a18aa1effdf13120896cf1a9a4829 Author: Luboš Luňák AuthorDate: Sun Dec 5 11:55:58 2021 +0100 Commit: Adolfo Jayme Barrientos CommitDate: Mon Dec 6 04:19:06 2021 +0100 increase maximum document thumbnail size from 256 to 512 It's 2021. Something's telling me people now care more about document previews not being blurry than an insignificant size increase of documents. See e.g. comments #21,#25 in the HiDPI bugreport tdf#144214. It also doesn't make much sense for the thumbnail creation to try hard to make the image smooth and then downscale it too much. Change-Id: I8df778dda05cf42cd27adf8f7757097fc7650acb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126376 Tested-by: Jenkins Reviewed-by: Luboš Luňák (cherry picked from commit 374e261ad1ea8b41f5ecdd850c27fdc961c4868b) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126301 Reviewed-by: Adolfo Jayme Barrientos diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx index b2c97ac5cd0a..fa1d444bb6be 100644 --- a/sfx2/source/doc/objcont.cxx +++ b/sfx2/source/doc/objcont.cxx @@ -158,7 +158,7 @@ bool SfxObjectShell::CreatePreview_Impl( bool bFullContent, VirtualDevice* pDevi // despite the metafile case (needlessly?) setting mapmode. Size aSizePix = pDevice->LogicToPixel( aTmpSize, aMode ); // Code based on GDIMetaFile::CreateThumbnail(). -sal_uInt32 nMaximumExtent = 256; +sal_uInt32 nMaximumExtent = 512; // determine size that has the same aspect ratio as image size and // fits into the rectangle determined by nMaximumExtent if ( aSizePix.Width() && aSizePix.Height() diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx index 3607a81ec2e8..105798f51446 100644 --- a/vcl/source/gdi/gdimtf.cxx +++ b/vcl/source/gdi/gdimtf.cxx @@ -2281,7 +2281,7 @@ bool GDIMetaFile::CreateThumbnail(BitmapEx& rBitmapEx, BmpConversion eColorConve const Point aBRPix( aVDev->LogicToPixel( Point( GetPrefSize().Width() - 1, GetPrefSize().Height() - 1 ), GetPrefMapMode() ) ); SizeaDrawSize( aVDev->LogicToPixel( GetPrefSize(), GetPrefMapMode() ) ); SizeaSizePix( std::abs( aBRPix.X() - aTLPix.X() ) + 1, std::abs( aBRPix.Y() - aTLPix.Y() ) + 1 ); -sal_uInt32 nMaximumExtent = 256; +sal_uInt32 nMaximumExtent = 512; if (!rBitmapEx.IsEmpty()) rBitmapEx.SetEmpty();
[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sfx2/source
sfx2/source/view/ipclient.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 965e6308522a21e77a4b19cafd018973b4097224 Author: Miklos Vajna AuthorDate: Mon Nov 29 08:42:37 2021 +0100 Commit: Miklos Vajna CommitDate: Mon Nov 29 11:15:35 2021 +0100 cid#1494452 sfx2: fix null ptr deref in SfxInPlaceClient_Impl::saveObject() Null-checking "this->m_pClient" suggests that it may be null, but it has already been dereferenced on all paths leading to the check. Add the missing check at a previous usage. (cherry picked from commit d9105d434ac6127f151843c7a7dbcd16257fcc0b) Change-Id: I8ebb4f41b9c83d59e65563c26729e899d45881b4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126014 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/sfx2/source/view/ipclient.cxx b/sfx2/source/view/ipclient.cxx index 08898ba1573f..ce9d2fdfb6c7 100644 --- a/sfx2/source/view/ipclient.cxx +++ b/sfx2/source/view/ipclient.cxx @@ -212,7 +212,7 @@ uno::Reference < frame::XFrame > const & SfxInPlaceClient_Impl::GetFrame() const void SAL_CALL SfxInPlaceClient_Impl::saveObject() { -if (!m_bStoreObject || m_pClient->IsProtected()) +if (!m_bStoreObject || (m_pClient && m_pClient->IsProtected())) // client wants to discard the object (usually it means the container document is closed while an object is active // and the user didn't request saving the changes return;
[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sfx2/source
sfx2/source/dialog/StyleList.cxx |3 --- sfx2/source/dialog/templdlg.cxx |7 ++- 2 files changed, 2 insertions(+), 8 deletions(-) New commits: commit e980aad43ff4f5a3aa07b66ccae200bfb95eabf6 Author: Caolán McNamara AuthorDate: Thu Nov 25 20:27:49 2021 + Commit: Caolán McNamara CommitDate: Fri Nov 26 20:19:35 2021 +0100 tdf#145814 fill format mode is mostly disabled when it shouldn't Change-Id: Ic282c313a6986d7d08f54b475c5d2ce32098ada1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125889 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/sfx2/source/dialog/StyleList.cxx b/sfx2/source/dialog/StyleList.cxx index 776d355b217e..5b86a1033c49 100644 --- a/sfx2/source/dialog/StyleList.cxx +++ b/sfx2/source/dialog/StyleList.cxx @@ -1613,9 +1613,6 @@ IMPL_LINK(StyleList, FmtSelectHdl, weld::TreeView&, rListBox, void) if (!rListBox.get_cursor(xHdlEntry.get())) return; -if (rListBox.is_selected(*xHdlEntry)) -m_aUpdateStyleDependents.Call(nullptr); - m_pParentDialog->SelectStyle(rListBox.get_text(*xHdlEntry), true, *this); } diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx index 12a8f9ff3a51..0cccf5a5d989 100644 --- a/sfx2/source/dialog/templdlg.cxx +++ b/sfx2/source/dialog/templdlg.cxx @@ -367,11 +367,8 @@ void SfxCommonTemplateDialog_Impl::SelectStyle(const OUString , bool bIsCal bWaterDisabled = !IsSafeForWaterCan(); -if (!bIsCallback) -{ -// tdf#134598 call UpdateStyleDependents to update watercan -UpdateStyleDependents_Hdl(nullptr); -} +// tdf#134598 call UpdateStyleDependents to update watercan +UpdateStyleDependents_Hdl(nullptr); } void SfxCommonTemplateDialog_Impl::EnableTreeDrag(bool bEnable)
[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sfx2/source
sfx2/source/dialog/StyleList.cxx |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) New commits: commit 9dcbee50b46ec389276fd0f0a71681a2638c0e1e Author: Caolán McNamara AuthorDate: Thu Nov 25 20:16:14 2021 + Commit: Caolán McNamara CommitDate: Fri Nov 26 11:55:14 2021 +0100 m_xTreeBox is always true this has evolved from an optional m_pTreeBox widget to an always present widget that's optionally visible and this case wasn't updated somewhere along the line. Use "IsSafeForWaterCan" which the other cases of this pattern were merged to Change-Id: Ia20327ade5378bbdfa9fbfecbfa9705a33555f17 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125835 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/sfx2/source/dialog/StyleList.cxx b/sfx2/source/dialog/StyleList.cxx index a76a0dd094fb..776d355b217e 100644 --- a/sfx2/source/dialog/StyleList.cxx +++ b/sfx2/source/dialog/StyleList.cxx @@ -1051,8 +1051,7 @@ IMPL_LINK_NOARG(StyleList, UpdateStyleDependents, void*, void) // Trigger Help PI. Only when the watercan is on if (m_nActFamily != 0x && m_pParentDialog->IsCheckedItem("watercan") && // only if that region is allowed -nullptr != m_pFamilyState[m_nActFamily - 1] -&& (m_xTreeBox || m_xFmtLb->count_selected_rows() <= 1)) +nullptr != m_pFamilyState[m_nActFamily - 1] && IsSafeForWaterCan(nullptr)) { m_pParentDialog->Execute_Impl(SID_STYLE_WATERCAN, "", "", 0, *this); m_pParentDialog->Execute_Impl(SID_STYLE_WATERCAN, GetSelectedEntry(), "",