[Libreoffice-commits] core.git: Branch 'feature/cib_contract57d' - Repository.mk
Repository.mk |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 196e3400c6ea3246af89032ac6fef026ec4e45db Author: Thorsten Behrens AuthorDate: Sun Mar 27 12:48:46 2022 +0200 Commit: Thorsten Behrens CommitDate: Sun Mar 27 12:48:46 2022 +0200 Jumplist is windows-only Fix packaging breakage on Linux - Repository.mk also implicitely adds lib to packaging. Change-Id: I7912128afbcc177b4d66b4be975bc90331b6d67a diff --git a/Repository.mk b/Repository.mk index 49a46b454409..6a6b8bd12e06 100644 --- a/Repository.mk +++ b/Repository.mk @@ -391,7 +391,7 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \ hyphen \ icg \ $(if $(ENABLE_JAVA),jdbc) \ - jumplist \ + $(if $(filter $(OS),WNT),jumplist) \ $(if $(ENABLE_LDAP),ldapbe2) \ $(if $(filter WNT,$(OS)),WinUserInfoBe) \ localebe1 \
[Libreoffice-commits] core.git: sw/inc sw/source
sw/inc/deletelistener.hxx| 92 +++ sw/source/filter/ww8/ww8par2.cxx | 66 --- 2 files changed, 94 insertions(+), 64 deletions(-) New commits: commit c19c582913c678cb88d97f908bb749072e6bd340 Author: Caolán McNamara AuthorDate: Sat Mar 26 21:50:49 2022 + Commit: Caolán McNamara CommitDate: Sun Mar 27 13:57:05 2022 +0200 move DeleteListener contraptions to toplevel writer includes Change-Id: Ifa1e75b62da4174f27fca52eb86559cd6a381513 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132141 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/sw/inc/deletelistener.hxx b/sw/inc/deletelistener.hxx new file mode 100644 index ..2b212e418fef --- /dev/null +++ b/sw/inc/deletelistener.hxx @@ -0,0 +1,92 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#pragma once + +#include +#include +#include "calbck.hxx" + +class SwDeleteListener final : public SwClient +{ +private: +SwModify* m_pModify; + +virtual void SwClientNotify(const SwModify&, const SfxHint& rHint) override +{ +if (rHint.GetId() != SfxHintId::SwLegacyModify) +return; +auto pLegacy = static_cast(&rHint); +if (pLegacy->GetWhich() == RES_OBJECTDYING) +{ +m_pModify->Remove(this); +m_pModify = nullptr; +} +} + +public: +SwDeleteListener(SwModify& rModify) +: m_pModify(&rModify) +{ +m_pModify->Add(this); +} + +bool WasDeleted() const { return !m_pModify; } + +virtual ~SwDeleteListener() override +{ +if (!m_pModify) +return; +m_pModify->Remove(this); +} +}; + +class SvtDeleteListener final : public SvtListener +{ +private: +bool bObjectDeleted; + +public: +explicit SvtDeleteListener(SvtBroadcaster& rNotifier) +: bObjectDeleted(false) +{ +StartListening(rNotifier); +} + +virtual void Notify(const SfxHint& rHint) override +{ +if (rHint.GetId() == SfxHintId::Dying) +bObjectDeleted = true; +} + +bool WasDeleted() const { return bObjectDeleted; } +}; + +class SfxDeleteListener final : public SfxListener +{ +private: +bool bObjectDeleted; + +public: +explicit SfxDeleteListener(SfxBroadcaster& rNotifier) +: bObjectDeleted(false) +{ +StartListening(rNotifier); +} + +virtual void Notify(SfxBroadcaster& /*rBC*/, const SfxHint& rHint) override +{ +if (rHint.GetId() == SfxHintId::Dying) +bObjectDeleted = true; +} + +bool WasDeleted() const { return bObjectDeleted; } +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx index e500e254da40..f74d8946e84f 100644 --- a/sw/source/filter/ww8/ww8par2.cxx +++ b/sw/source/filter/ww8/ww8par2.cxx @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include @@ -167,69 +168,6 @@ sal_uInt32 wwSectionManager::GetWWPageTopMargin() const return !maSegments.empty() ? maSegments.back().maSep.dyaTop : 0; } -namespace -{ -class SvtDeleteListener final : public SvtListener -{ -private: -bool bObjectDeleted; -public: -explicit SvtDeleteListener(SvtBroadcaster& rNotifier) -: bObjectDeleted(false) -{ -StartListening(rNotifier); -} - -virtual void Notify(const SfxHint& rHint) override -{ -if (rHint.GetId() == SfxHintId::Dying) -bObjectDeleted = true; -} - -bool WasDeleted() const -{ -return bObjectDeleted; -} -}; - -class SwDeleteListener final : public SwClient -{ -private: -SwModify* m_pModify; - -virtual void SwClientNotify(const SwModify&, const SfxHint& rHint) override -{ -if (rHint.GetId() != SfxHintId::SwLegacyModify) -return; -auto pLegacy = static_cast(&rHint); -if (pLegacy->GetWhich() == RES_OBJECTDYING) -{ -m_pModify->Remove(this); -m_pModify = nullptr; -} -} - -public: -SwDeleteListener(SwModify* pModify) -: m_pModify(pModify) -{ -m_pModify->Add(this); -} - -bool WasDeleted() const -{ -return !m_pModify; -} - -virtual ~SwDeleteListener() override -{ -if (!m_pModify) -return; -
[Libreoffice-commits] core.git: sw/qa sw/source
sw/qa/extras/layout/data/forcepoint92.doc |binary sw/qa/extras/layout/layout.cxx|6 ++ sw/source/core/layout/tabfrm.cxx |8 +++- 3 files changed, 13 insertions(+), 1 deletion(-) New commits: commit 258ef8776637519c84365b8a58446d64716b2b43 Author: Caolán McNamara AuthorDate: Sun Mar 27 12:03:06 2022 +0100 Commit: Caolán McNamara CommitDate: Sun Mar 27 14:49:33 2022 +0200 forcepoint#92 fix crash on layout of specific doc Change-Id: Id40d25d05d10d641d071cddd2e1c84594ac777a6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132142 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/sw/qa/extras/layout/data/forcepoint92.doc b/sw/qa/extras/layout/data/forcepoint92.doc new file mode 100644 index ..49c4a7f11dfe Binary files /dev/null and b/sw/qa/extras/layout/data/forcepoint92.doc differ diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx index a77d11877e5b..85fd9cbcae06 100644 --- a/sw/qa/extras/layout/layout.cxx +++ b/sw/qa/extras/layout/layout.cxx @@ -2515,6 +2515,12 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testForcepoint91) createSwWebDoc(DATA_DIRECTORY, "forcepoint91.html"); } +//just care it doesn't crash/assert +CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testForcepoint92) +{ +createSwDoc(DATA_DIRECTORY, "forcepoint92.doc"); +} + CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf118058) { SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf118058.fodt"); diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx index 010767ccafb5..e9f552da300a 100644 --- a/sw/source/core/layout/tabfrm.cxx +++ b/sw/source/core/layout/tabfrm.cxx @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -2135,13 +2136,18 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext) } SwFootnoteBossFrame *pOldBoss = bFootnotesInDoc ? FindFootnoteBossFrame( true ) : nullptr; bool bReformat; +std::optional oDeleteListener; +if (pOldBoss) +oDeleteListener.emplace(*pOldBoss); SwFrameDeleteGuard g(this); if ( MoveBwd( bReformat ) ) { +SAL_WARN_IF(oDeleteListener && oDeleteListener->WasDeleted(), "sw.layout", "SwFootnoteBossFrame unexpectedly deleted"); + aRectFnSet.Refresh(this); bMovedBwd = true; aNotify.SetLowersComplete( false ); -if ( bFootnotesInDoc ) +if (bFootnotesInDoc && !oDeleteListener->WasDeleted()) MoveLowerFootnotes( nullptr, pOldBoss, nullptr, true ); if ( bReformat || bKeep ) {
[Libreoffice-commits] core.git: oox/source sw/qa
oox/source/drawingml/diagram/datamodel.hxx |2 +- oox/source/export/drawingml.cxx|4 ++-- sw/qa/extras/ooxmlexport/ooxmlexport17.cxx |2 +- 3 files changed, 4 insertions(+), 4 deletions(-) New commits: commit f46068f963ab546f2f125e130ccd88bd119aa794 Author: Andrea Gelmini AuthorDate: Sun Mar 27 14:27:00 2022 +0200 Commit: Julien Nabet CommitDate: Sun Mar 27 15:17:01 2022 +0200 Fix typos Change-Id: I003bd994be4a6a089dfacca1558e84324bf7fc1f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132145 Reviewed-by: Julien Nabet Tested-by: Jenkins diff --git a/oox/source/drawingml/diagram/datamodel.hxx b/oox/source/drawingml/diagram/datamodel.hxx index 292b31c6dabd..8c8a9e8e165d 100644 --- a/oox/source/drawingml/diagram/datamodel.hxx +++ b/oox/source/drawingml/diagram/datamodel.hxx @@ -204,7 +204,7 @@ private: // the model definition, // - FillStyle // - Texts for oox::drawingml::Points/dgm::Points, associated by ModelId -// - logic connections/assoziations +// - logic connections/associations // - data point entries FillPropertiesPtr mpFillProperties; PointTextMap maPointTextMap; diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index d2f8f3be3c63..912f3921d406 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -3897,7 +3897,7 @@ bool DrawingML::WriteCustomGeometry( return false; } -// A EnhancedCustomShape2d caches the equation results. Therefor we use only one of it for the +// A EnhancedCustomShape2d caches the equation results. Therefore we use only one of it for the // entire method. const EnhancedCustomShape2d aCustomShape2d(const_cast(rSdrObjCustomShape)); @@ -4279,7 +4279,7 @@ bool DrawingML::WriteCustomGeometry( double fHR = std::abs(fCurrentY - fY); double fStartAngle(0.0); double fSwingAngle(0.0); -// The starting direction of the arc toggles beween X and Y +// The starting direction of the arc toggles between X and Y if ((rSegment.Command == ELLIPTICALQUADRANTX && !(k % 2)) || (rSegment.Command == ELLIPTICALQUADRANTY && (k % 2))) { diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx index 8162b8fbb414..6d62d866f4b2 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx @@ -53,7 +53,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf147861_customField, "tdf147861_customField.docx" { // These should each be specific values, not a shared DocProperty getParagraph(1, "CustomEditedTitle"); // edited -// A couple of nulls at the end of the string thwarted all attemps at an "equals" comparison. +// A couple of nulls at the end of the string thwarted all attempts at an "equals" comparison. CPPUNIT_ASSERT(getParagraph(2)->getString().startsWith(" INSERT Custom Title here")); getParagraph(3, "My Title"); // edited
[Libreoffice-commits] core.git: filter/source
filter/source/msfilter/escherex.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 2816f498505bab01bc0f17ef0962ece663c607c9 Author: Andrea Gelmini AuthorDate: Sun Mar 27 14:25:43 2022 +0200 Commit: Julien Nabet CommitDate: Sun Mar 27 19:32:54 2022 +0200 Fix typo in code Change-Id: I9a67be63e92864d2e8c8578cf8759d73f5042ab8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132144 Reviewed-by: Julien Nabet Tested-by: Jenkins diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx index 3e79fe28a8b1..dc145c1b5ff1 100644 --- a/filter/source/msfilter/escherex.cxx +++ b/filter/source/msfilter/escherex.cxx @@ -2451,13 +2451,13 @@ static void ConvertEnhancedCustomShapeEquation( sal_Int32 i; for ( i = 0; i < nEquationSourceCount; i++ ) { -EnhancedCustomShape2d aCustoShape2d( +EnhancedCustomShape2d aCustomShape2d( const_cast< SdrObjCustomShape& >(rSdrObjCustomShape)); try { std::shared_ptr< EnhancedCustomShape::ExpressionNode > aExpressNode( EnhancedCustomShape::FunctionParser::parseFunction( -sEquationSource[ i ], aCustoShape2d)); +sEquationSource[ i ], aCustomShape2d)); drawing::EnhancedCustomShapeParameter aPara( aExpressNode->fillNode( rEquations, nullptr, 0 ) ); if ( aPara.Type != drawing::EnhancedCustomShapeParameterType::EQUATION ) {
New Defects reported by Coverity Scan for LibreOffice
Hi, Please find the latest report on new defect(s) introduced to LibreOffice found with Coverity Scan. 2 new defect(s) introduced to LibreOffice found with Coverity Scan. New defect(s) Reported-by: Coverity Scan Showing 2 of 2 defect(s) ** CID 1503287: Null pointer dereferences (FORWARD_NULL) *** CID 1503287: Null pointer dereferences (FORWARD_NULL) /sw/source/uibase/utlui/navipi.cxx: 546 in SwNavigationPI::SwNavigationPI(weld::Widget *, const com::sun::star::uno::Reference &, SfxBindings *, SfxNavigator *)() 540 m_xContainer->connect_container_focus_changed(LINK(this, SwNavigationPI, SetFocusChildHdl)); 541 542 Reference xController = 543 m_xContent2Dispatch->GetControllerForCommand(".uno:NavElement"); 544 NavElementToolBoxControl* pToolBoxControl = 545 dynamic_cast(xController.get()); >>> CID 1503287: Null pointer dereferences (FORWARD_NULL) >>> Passing null pointer "pToolBoxControl" to "GetComboBox", which >>> dereferences it. 546 m_pNavigateByComboBox = pToolBoxControl->GetComboBox(); 547 548 // Restore content tree settings before calling UpdateInitShow. UpdateInitShow calls Fillbox, 549 // which calls Display and UpdateTracking. Incorrect outline levels could be displayed and 550 // unexpected content tracking could occur if these content tree settings are not done before. 551 m_xContentTree->SetOutlineLevel(static_cast(m_pConfig->GetOutlineLevel())); ** CID 1503286: Error handling issues (CHECKED_RETURN) /sw/source/uibase/utlui/content.cxx: 4544 in SwContentTree::SelectHdl(weld::TreeView &)() *** CID 1503286: Error handling issues (CHECKED_RETURN) /sw/source/uibase/utlui/content.cxx: 4544 in SwContentTree::SelectHdl(weld::TreeView &)() 4538 } 4539 Select(); 4540 if (m_bIsRoot) 4541 return; 4542 // Select the content type in the Navigate By control 4543 std::unique_ptr xEntry(m_xTreeView->make_iterator()); >>> CID 1503286: Error handling issues (CHECKED_RETURN) >>> Calling "get_selected" without checking return value (as is done >>> elsewhere 94 out of 109 times). 4544 m_xTreeView->get_selected(xEntry.get()); 4545 while (m_xTreeView->get_iter_depth(*xEntry)) 4546 m_xTreeView->iter_parent(*xEntry); 4547 m_pDialog->SelectNavigateByContentType(m_xTreeView->get_text(*xEntry)); 4548 } 4549 To view the defects in Coverity Scan visit, https://u15810271.ct.sendgrid.net/ls/click?upn=HRESupC-2F2Czv4BOaCWWCy7my0P0qcxCbhZ31OYv50ypSs1kiFPuCn2xFdlMIFBirii0zZ9j2-2F9F2XPBcBm2BNgi9duPy3v-2FzgFDd2LJ-2BDKI-3DtwdG_OTq2XUZbbipYjyLSo6GRo-2FpVxQ9OzkDINu9UTS-2FQhSdO0F0jQniitrGlNxDIzPJiErDtnzz1BKXmMf91ERL0XB1OmR4FeH39llIJ7HtcI7VHMFv92gd-2BIACYzHwuZ83uK4wh37TI8ZCbYTY9Qxp7WNSyW9tE8dzQm1y5ZVlT5xJAhUpMLl9biQLhGfHtPvcIlD6-2BlQDoJScJn3UzV8OwvT3tMPDW44A4vlrkDLRm5E0-3D
Yomna Salama license statement
All of my past & future contributions to LibreOffice may be licensed under the MPLv2/LGPLv3+ dual license.
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/awt/vclxmenu.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit 7f6263c14bc062e858a3da3dd8c60ac8ddb1254e Author: Stephan Bergmann AuthorDate: Fri Mar 25 15:07:39 2022 +0100 Commit: Stephan Bergmann CommitDate: Mon Mar 28 08:38:02 2022 +0200 Operate on VCL Menu with SolarMutex locked ...as such VCL code presumably expects to only be called when SolarMutex is locked, but which is not necessarily the case here for the ~VCLXMenu UNO object destructor. (I ran into this with a tentative commit for tdf#147668 "Writer crashes shortly after loading document with LanguageTool extension active", which would have added DBG_TESTSOLARMUTEX() to some GtkSalMenu code indirectly called from within mpMenu.disposeAndClear() here, and where this VCLXMenu object was held by Java extension code, so the destructor call happened on some JVM asynchronous finalizer thread, outside any SolarMutex lock.) Change-Id: Ia2c3ebec837275cfdf1548f22cfa33f0752e8ef4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132125 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/toolkit/source/awt/vclxmenu.cxx b/toolkit/source/awt/vclxmenu.cxx index cbeb1ef7f810..3eda26c81236 100644 --- a/toolkit/source/awt/vclxmenu.cxx +++ b/toolkit/source/awt/vclxmenu.cxx @@ -57,6 +57,7 @@ VCLXMenu::~VCLXMenu() maPopupMenuRefs.clear(); if ( mpMenu ) { +SolarMutexGuard g; mpMenu->RemoveEventListener( LINK( this, VCLXMenu, MenuEventListener ) ); mpMenu.disposeAndClear(); }
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - sw/inc sw/qa sw/source
sw/inc/cmdid.h |1 + sw/inc/formatlinebreak.hxx |1 - sw/inc/textlinebreak.hxx|2 -- sw/inc/unoprnms.hxx |1 + sw/qa/core/unocore/unocore.cxx | 31 +++ sw/source/core/inc/unolinebreak.hxx |3 ++- sw/source/core/inc/unoport.hxx |9 - sw/source/core/unocore/unocoll.cxx |4 ++-- sw/source/core/unocore/unolinebreak.cxx | 26 ++ sw/source/core/unocore/unomap1.cxx |1 + sw/source/core/unocore/unoport.cxx |6 ++ sw/source/core/unocore/unoportenum.cxx | 16 12 files changed, 86 insertions(+), 15 deletions(-) New commits: commit a9975bf6bbeccc69c812135285669ebfe2eea821 Author: Miklos Vajna AuthorDate: Thu Mar 3 12:24:33 2022 +0100 Commit: Miklos Vajna CommitDate: Mon Mar 28 08:45:01 2022 +0200 sw clearing breaks: include this in the UNO API text portion enum Which is how UNO API clients (e.g. ODT export) will be able to read RES_TXTATR_LINEBREAK. (cherry picked from commit a0f86d94e23e8ae0129780745deb2d3526b4fbfa) Conflicts: sw/inc/cmdid.h Change-Id: I44d2058fd8b4a4fefce3dacc49d3bb3da6060756 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132108 Tested-by: Jenkins CollaboraOffice Reviewed-by: Miklos Vajna diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h index 687f5980d81d..324fa46142ef 100644 --- a/sw/inc/cmdid.h +++ b/sw/inc/cmdid.h @@ -634,6 +634,7 @@ #define FN_UNO_TRANSFORMED_GRAPHIC (FN_EXTRA2 + 127) #define FN_UNO_GRAPHIC_PREVIEW (FN_EXTRA2 + 128) +#define FN_UNO_LINEBREAK (FN_EXTRA2 + 129) // Area: Help // Region: Traveling & Selection diff --git a/sw/inc/formatlinebreak.hxx b/sw/inc/formatlinebreak.hxx index c3a2b0164f86..f20fa46f78c7 100644 --- a/sw/inc/formatlinebreak.hxx +++ b/sw/inc/formatlinebreak.hxx @@ -23,7 +23,6 @@ #include #include "calbck.hxx" -#include #include #include diff --git a/sw/inc/textlinebreak.hxx b/sw/inc/textlinebreak.hxx index 33401972f60b..5b5e8c6854c3 100644 --- a/sw/inc/textlinebreak.hxx +++ b/sw/inc/textlinebreak.hxx @@ -21,8 +21,6 @@ #include "txatbase.hxx" -#include "ndindex.hxx" - class SwFormatLineBreak; /** diff --git a/sw/inc/unoprnms.hxx b/sw/inc/unoprnms.hxx index c291742a1641..bd1c6e957ac5 100644 --- a/sw/inc/unoprnms.hxx +++ b/sw/inc/unoprnms.hxx @@ -867,6 +867,7 @@ #define UNO_NAME_RESOLVED "Resolved" #define UNO_NAME_ALLOW_OVERLAP "AllowOverlap" #define UNO_NAME_CLEAR "Clear" +#define UNO_NAME_LINEBREAK "LineBreak" #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/core/unocore/unocore.cxx b/sw/qa/core/unocore/unocore.cxx index d8c9f9559bd9..d971e57d77e3 100644 --- a/sw/qa/core/unocore/unocore.cxx +++ b/sw/qa/core/unocore/unocore.cxx @@ -250,6 +250,37 @@ CPPUNIT_TEST_FIXTURE(SwCoreUnocoreTest, testLineBreakInsert) CPPUNIT_ASSERT_EQUAL(SwLineBreakClear::ALL, rFormatLineBreak.GetValue()); } +CPPUNIT_TEST_FIXTURE(SwCoreUnocoreTest, testLineBreakTextPortionEnum) +{ +// Given a document with a clearing break: +createSwDoc(); +uno::Reference xMSF(mxComponent, uno::UNO_QUERY); +uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); +uno::Reference xLineBreak( +xMSF->createInstance("com.sun.star.text.LineBreak"), uno::UNO_QUERY); +uno::Reference xLineBreakProps(xLineBreak, uno::UNO_QUERY); +auto eClear = static_cast(SwLineBreakClear::ALL); +xLineBreakProps->setPropertyValue("Clear", uno::makeAny(eClear)); +uno::Reference xText = xTextDocument->getText(); +uno::Reference xCursor = xText->createTextCursor(); +xText->insertTextContent(xCursor, xLineBreak, /*bAbsorb=*/false); + +// When enumerating the text portions of the only paragraph in the document: +uno::Reference xTextPortion = getRun(getParagraph(1), 1); + +// Then make sure that the text portion type is correct + the clear type can be read: +auto aPortionType = getProperty(xTextPortion, "TextPortionType"); +// Without the accompanying fix in place, this test would have failed with: +// - Expected: LineBreak +// - Actual : Text +// i.e. a line break with properties was part of the normal Text portion, making it impossible +// to get those properties. +CPPUNIT_ASSERT_EQUAL(OUString("LineBreak"), aPortionType); +xLineBreak = getProperty>(xTextPortion, "LineBreak"); +eClear = getProperty(xLineBreak, "Clear"); +CPPUNIT_ASSERT_EQUAL(static_cast(SwLineBreakClear::ALL), eClear); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/inc/unolinebreak.hxx b/sw/source/core/inc/unolinebreak.hxx index 1eb939e24b68..0a87753c5e34 100644 --- a/sw/source/core/inc/unolinebreak.hxx +++ b/sw/source/core/inc/unolinebreak.hxx @@ -44,7 +44,8 @@ class SwXLineB
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - sc/source
sc/source/ui/view/gridwin4.cxx |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) New commits: commit c8bfb498ca93b990069d7bcd09cb1240d8c8faee Author: Aron Budea AuthorDate: Thu Mar 24 22:02:17 2022 +0100 Commit: Miklos Vajna CommitDate: Mon Mar 28 08:59:13 2022 +0200 sc: fix crash in SdrPageView::GetPageWindow() From crashreport: SIG Fatal signal received: SIGSEGV SdrPageView::GetPageWindow(unsigned int) const svx/source/svdraw/svdpagv.cxx:84 (anonymous namespace)::ScLOKProxyObjectContact::calculateGridOffsetForViewOjectContact(basegfx::B2DVector&, sdr::contact::ViewObjectContact const&) const sc/source/ui/view/gridwin4.cxx:1397 sdr::contact::ViewObjectContact::getGridOffset() const svx/source/sdr/contact/viewobjectcontact.cxx:463 sdr::contact::ViewObjectContact::getPrimitive2DSequence(sdr::contact::DisplayInfo const&) const include/basegfx/tuple/b2dtuple.hxx:81 sdr::contact::ViewObjectContact::getObjectRange() const svx/source/sdr/contact/viewobjectcontact.cxx:198 ScLOKProxyObjectContact::calculateGridOffsetForViewOjectContact() didn't check if PageWindowCount() was non-zero. Change-Id: I4a00b5b13a277d0805af3076150a952306908e53 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132091 Tested-by: Jenkins CollaboraOffice Reviewed-by: Miklos Vajna diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index 087f08271a5a..3baf4d0c96a3 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -1394,7 +1394,9 @@ namespace if (!pPageView) return; -SdrPageWindow* pSdrPageWindow = pPageView->GetPageWindow(0); +SdrPageWindow* pSdrPageWindow = nullptr; +if (pPageView->PageWindowCount() > 0) +pSdrPageWindow = pPageView->GetPageWindow(0); if (!pSdrPageWindow) return;