[Libreoffice-commits] core.git: Branch 'feature/sparklines' - sc/inc sc/qa sc/source

2022-04-03 Thread Tomaž Vajngerl (via logerrit)
 sc/inc/SparklineList.hxx  |1 
 sc/qa/unit/SparklineTest.cxx  |  114 +++---
 sc/source/core/data/column2.cxx   |   39 ++
 sc/source/core/data/table2.cxx|2 
 sc/source/ui/sparklines/SparklineList.cxx |   24 ++
 5 files changed, 152 insertions(+), 28 deletions(-)

New commits:
commit 495b614d54e577b59a53919ba67a15a3a7ea570f
Author: Tomaž Vajngerl 
AuthorDate: Sun Apr 3 15:53:55 2022 +0900
Commit: Tomaž Vajngerl 
CommitDate: Sun Apr 3 15:53:55 2022 +0900

sc: improve keeping track of sparklines in SParklineList

Issues can happen when saving a document with sparklines where a
sparkline is deleted and then undo-ed. The reason for this is
because the SparlineList wasn't correctly updated when deleting,
copying or adding sparklines. This change adds hooks when new
sparklines are created or when sparklines are deleted to report
this into SparlineList.

SparklineList garbage-collects itself but this is not enough when
we rely that the non-deleted weak pointers to the sparkline groups
contain the correct non-deleted weak pointers to the correct
sparklines.

Change-Id: I976cbe7e6168813d3dd5089c036cc7fe4e357fb2

diff --git a/sc/inc/SparklineList.hxx b/sc/inc/SparklineList.hxx
index ae9b95ffaaef..6f83b4f9b055 100644
--- a/sc/inc/SparklineList.hxx
+++ b/sc/inc/SparklineList.hxx
@@ -36,6 +36,7 @@ public:
 SparklineList();
 
 void addSparkline(std::shared_ptr const& pSparkline);
+void removeSparkline(std::shared_ptr const& pSparkline);
 
 std::vector> getSparklineGroups();
 
diff --git a/sc/qa/unit/SparklineTest.cxx b/sc/qa/unit/SparklineTest.cxx
index 33f3641243c5..2ee2995f927f 100644
--- a/sc/qa/unit/SparklineTest.cxx
+++ b/sc/qa/unit/SparklineTest.cxx
@@ -458,47 +458,109 @@ void 
SparklineTest::testUndoRedoClearContentForSparkline()
 insertTestData(rDocument);
 
 // Sparkline range
-ScRange aRange(0, 6, 0, 0, 6, 0);
+ScRange aDataRange(0, 0, 0, 3, 5, 0); //A1:D6
+ScRange aRange(0, 6, 0, 3, 6, 0); // A7:D7
 
-// Check Sparkline at cell A7 doesn't exists
-auto pSparkline = rDocument.GetSparkline(aRange.aStart);
-CPPUNIT_ASSERT(!pSparkline);
+// Check Sparklines - none should exist
+{
+CPPUNIT_ASSERT(!rDocument.HasSparkline(ScAddress(0, 6, 0)));
+CPPUNIT_ASSERT(!rDocument.HasSparkline(ScAddress(1, 6, 0)));
+CPPUNIT_ASSERT(!rDocument.HasSparkline(ScAddress(2, 6, 0)));
+CPPUNIT_ASSERT(!rDocument.HasSparkline(ScAddress(3, 6, 0)));
+}
 
 auto pSparklineGroup = std::make_shared();
-CPPUNIT_ASSERT(rDocFunc.InsertSparklines(ScRange(0, 0, 0, 0, 5, 0), 
aRange, pSparklineGroup));
+CPPUNIT_ASSERT(rDocFunc.InsertSparklines(aDataRange, aRange, 
pSparklineGroup));
 
-// Check Sparkline at cell A7 exists
-pSparkline = rDocument.GetSparkline(aRange.aStart);
-CPPUNIT_ASSERT(pSparkline);
-CPPUNIT_ASSERT_EQUAL(SCCOL(0), pSparkline->getColumn());
-CPPUNIT_ASSERT_EQUAL(SCROW(6), pSparkline->getRow());
+// Check Sparklines
+{
+CPPUNIT_ASSERT(rDocument.HasSparkline(ScAddress(0, 6, 0)));
+CPPUNIT_ASSERT(rDocument.HasSparkline(ScAddress(1, 6, 0)));
+CPPUNIT_ASSERT(rDocument.HasSparkline(ScAddress(2, 6, 0)));
+// D7 exists
+CPPUNIT_ASSERT(rDocument.HasSparkline(ScAddress(3, 6, 0)));
+
+// Check D7
+auto pSparkline = rDocument.GetSparkline(ScAddress(3, 6, 0));
+CPPUNIT_ASSERT_EQUAL(SCCOL(3), pSparkline->getColumn());
+CPPUNIT_ASSERT_EQUAL(SCROW(6), pSparkline->getRow());
+
+// Check collections
+auto* pSparklineList = rDocument.GetSparklineList(SCTAB(0));
+auto pSparklineGroups = pSparklineList->getSparklineGroups();
+CPPUNIT_ASSERT_EQUAL(size_t(1), pSparklineGroups.size());
 
-// Clear content - including sparkline
-ScMarkData aMark(rDocument.GetSheetLimits());
-aMark.SetMarkArea(aRange.aStart);
-rDocFunc.DeleteContents(aMark, InsertDeleteFlags::CONTENTS, true, true);
+auto pSparklines = 
pSparklineList->getSparklinesFor(pSparklineGroups[0]);
+CPPUNIT_ASSERT_EQUAL(size_t(4), pSparklines.size());
+}
 
-// Check Sparkline at cell A7 doesn't exists
-pSparkline = rDocument.GetSparkline(aRange.aStart);
-CPPUNIT_ASSERT(!pSparkline);
+// Clear content of cell D7 - including sparkline
+{
+ScMarkData aMark(rDocument.GetSheetLimits());
+aMark.SetMarkArea(ScAddress(3, 6, 0));
+rDocFunc.DeleteContents(aMark, InsertDeleteFlags::CONTENTS, true, 
true);
+}
+
+// Check Sparklines
+{
+CPPUNIT_ASSERT(rDocument.HasSparkline(ScAddress(1, 6, 0)));
+CPPUNIT_ASSERT(rDocument.HasSparkline(ScAddress(1, 6, 0)));
+CPPUNIT_ASSERT(rDocument.HasSparkline(ScAddress(2, 6, 0)));
+// D7 is gone
+CPPUNIT_ASSERT(!rDocument.HasSparkline(ScAddress(3, 6, 0)));
+
+  

[Libreoffice-commits] core.git: officecfg/registry sc/inc sc/Library_sc.mk sc/sdi sc/source sc/uiconfig sc/UIConfig_scalc.mk

2022-04-03 Thread Tomaž Vajngerl (via logerrit)
 officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu |8 
 sc/Library_sc.mk  |1 
 sc/UIConfig_scalc.mk  |1 
 sc/inc/sc.hrc |5 
 sc/sdi/cellsh.sdi |1 
 sc/sdi/scalc.sdi  |   17 
 sc/source/ui/app/scdll.cxx|1 
 sc/source/ui/dialogs/SparklineDialog.cxx  |  324 
++
 sc/source/ui/inc/SparklineDialog.hxx  |   64 +
 sc/source/ui/inc/reffact.hxx  |   12 
 sc/source/ui/view/cellsh.cxx  |1 
 sc/source/ui/view/cellsh1.cxx |9 
 sc/source/ui/view/tabvwsh.cxx |1 
 sc/source/ui/view/tabvwshc.cxx|6 
 sc/uiconfig/scalc/popupmenu/cell.xml  |2 
 sc/uiconfig/scalc/ui/sparklinedialog.ui   |  218 ++
 16 files changed, 670 insertions(+), 1 deletion(-)

New commits:
commit c61aa2dea120cc083f3cd51f0347284f47a9d566
Author: Tomaž Vajngerl 
AuthorDate: Fri Mar 11 20:49:09 2022 +0900
Commit: Tomaž Vajngerl 
CommitDate: Sun Apr 3 09:06:44 2022 +0200

sc: SparklineDialog and "Insert Sparkline" to context menu

This adds a SparklineDialog, which is used to add/edit the
Sparkline input/output ranges. The command for the context menu
"Insert Sparkline" calls the SparklineDialog for inserting a new
sparkline into cells. Currently the SparklineDialog include the
properties for the SparklineGroup, which will be added in a later
commit.

Change-Id: I9036d788fdf2a035f1ce10fc7413327a92144137
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132465
Tested-by: Tomaž Vajngerl 
Reviewed-by: Tomaž Vajngerl 

diff --git a/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu 
b/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu
index 9d9abf01a239..e64af0f86161 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu
@@ -1074,6 +1074,14 @@
   1
 
   
+  
+
+  Insert Sparkline...
+
+
+  1
+
+  
   
 
   ~Headers and Footers...
diff --git a/sc/Library_sc.mk b/sc/Library_sc.mk
index 62ab22a797c4..f145d3a7fbf2 100644
--- a/sc/Library_sc.mk
+++ b/sc/Library_sc.mk
@@ -418,6 +418,7 @@ $(eval $(call gb_Library_add_exception_objects,sc,\
 sc/source/ui/dbgui/sfiltdlg \
 sc/source/ui/dbgui/validate \
 sc/source/ui/dialogs/searchresults \
+sc/source/ui/dialogs/SparklineDialog \
 sc/source/ui/docshell/arealink \
 sc/source/ui/docshell/autostyl \
 sc/source/ui/docshell/datastream \
diff --git a/sc/UIConfig_scalc.mk b/sc/UIConfig_scalc.mk
index bc320cc44fd7..302f08ff3fb3 100644
--- a/sc/UIConfig_scalc.mk
+++ b/sc/UIConfig_scalc.mk
@@ -244,6 +244,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/scalc,\
sc/uiconfig/scalc/ui/sortkey \
sc/uiconfig/scalc/ui/sortoptionspage \
sc/uiconfig/scalc/ui/sortwarning \
+   sc/uiconfig/scalc/ui/sparklinedialog \
sc/uiconfig/scalc/ui/splitcolumnentry \
sc/uiconfig/scalc/ui/subtotaldialog \
sc/uiconfig/scalc/ui/subtotaloptionspage \
diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc
index f391e618357b..b9dc48169235 100644
--- a/sc/inc/sc.hrc
+++ b/sc/inc/sc.hrc
@@ -238,6 +238,8 @@ class SvxZoomSliderItem;
 #define SID_COLUMN_OPERATIONS   (SC_MESSAGE_START + 86)
 #define SID_ROW_OPERATIONS  (SC_MESSAGE_START + 87)
 #define SID_FOURIER_ANALYSIS_DIALOG (SC_MESSAGE_START + 88)
+#define SID_SPARKLINE_DIALOG(SC_MESSAGE_START + 89)
+
 
 // functions
 
@@ -306,7 +308,8 @@ class SvxZoomSliderItem;
 #define FID_INS_ROWS_BEFORE (INSERT_MENU_START + 22)
 #define FID_INS_COLUMNS_BEFORE  (INSERT_MENU_START + 23)
 #define FID_DEFINE_CURRENT_NAME (INSERT_MENU_START + 24)
-#define INSERT_MENU_END (INSERT_MENU_START + 25)
+#define SID_INSERT_SPARKLINE(INSERT_MENU_START + 25)
+#define INSERT_MENU_END (INSERT_MENU_START + 26)
 
 #define FORMAT_MENU_START   (INSERT_MENU_END)
 #define FID_CELL_FORMAT (FORMAT_MENU_START)
diff --git a/sc/sdi/cellsh.sdi b/sc/sdi/cellsh.sdi
index c9eed43d665b..8feaf0c590e0 100644
--- a/sc/sdi/cellsh.sdi
+++ b/sc/sdi/cellsh.sdi
@@ -235,6 +235,7 @@ interface CellSelection
 SID_SELECT_VISIBLE_ROWS [ ExecMethod = ExecuteEdit;]
 SID_SELECT_VISIBLE_COLUMNS  [ ExecMethod = ExecuteEdit;]
 SID_CURRENT_FORMULA_RANGE   [ ExecMethod = ExecuteEdi

[Libreoffice-commits] core.git: 2 commits - sc/inc sc/source sc/uiconfig

2022-04-03 Thread Tomaž Vajngerl (via logerrit)
 sc/inc/SparklineGroup.hxx|   14 
 sc/inc/column.hxx|2 
 sc/inc/document.hxx  |1 
 sc/inc/global.hxx|7 
 sc/inc/mtvelements.hxx   |2 
 sc/inc/table.hxx |1 
 sc/source/core/data/column2.cxx  |   18 +
 sc/source/core/data/column3.cxx  |6 
 sc/source/core/data/document.cxx |   14 
 sc/source/core/data/table2.cxx   |   10 
 sc/source/ui/dialogs/SparklineDialog.cxx |  113 ++
 sc/source/ui/inc/SparklineDialog.hxx |   28 +
 sc/uiconfig/scalc/ui/sparklinedialog.ui  |  501 ++-
 13 files changed, 696 insertions(+), 21 deletions(-)

New commits:
commit 744722123a8ce3d3c30583ba1285a21e129b471f
Author: Tomaž Vajngerl 
AuthorDate: Tue Mar 15 15:18:16 2022 +0900
Commit: Tomaž Vajngerl 
CommitDate: Sun Apr 3 09:07:19 2022 +0200

sc: support deleting a Sparkline with 'Clear Content' function

Change-Id: Ida61b402170238fb0505c777e49954c15d376cf0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132467
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx
index 372aef84c24e..36ea217a481a 100644
--- a/sc/inc/column.hxx
+++ b/sc/inc/column.hxx
@@ -666,6 +666,8 @@ public:
 // Spaklines
 sc::SparklineCell* GetSparklineCell(SCROW nRow);
 void CreateSparklineCell(SCROW nRow, std::shared_ptr const& 
pSparkline);
+void DeleteSparklineCells(sc::ColumnBlockPosition& rBlockPos, SCROW nRow1, 
SCROW nRow2);
+bool DeleteSparkline(SCROW nRow);
 
 // cell notes
 ScPostIt* GetCellNote( SCROW nRow );
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 84199c00de4c..420c0eb06e35 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -1252,6 +1252,7 @@ public:
 SC_DLLPUBLIC sc::Sparkline* GetSparkline(ScAddress const & rPosition);
 SC_DLLPUBLIC sc::Sparkline* CreateSparkline(ScAddress const & rPosition, 
std::shared_ptr const& pSparklineGroup);
 SC_DLLPUBLIC sc::SparklineList* GetSparklineList(SCTAB nTab);
+SC_DLLPUBLIC bool DeleteSparkline(ScAddress const& rPosition);
 
 /** Notes **/
 SC_DLLPUBLIC ScPostIt*   GetNote(const ScAddress& rPos);
diff --git a/sc/inc/global.hxx b/sc/inc/global.hxx
index 5c6293432b67..decf343154ae 100644
--- a/sc/inc/global.hxx
+++ b/sc/inc/global.hxx
@@ -157,19 +157,20 @@ enum class InsertDeleteFlags : sal_uInt16
 OBJECTS  = 0x0080,   /// Drawing objects.
 EDITATTR = 0x0100,   /// Rich-text attributes.
 OUTLINE  = 0x0800,   /// Sheet / outlining (grouping) information
+SPARKLINES   = 0x4000,   /// Sparklines in a cell.
 NOCAPTIONS   = 0x0200,   /// Internal use only (undo etc.): do not 
copy/delete caption objects of cell notes.
 ADDNOTES = 0x0400,   /// Internal use only (copy from clip): do 
not delete existing cell contents when pasting notes.
 SPECIAL_BOOLEAN  = 0x1000,
 FORGETCAPTIONS   = 0x2000,   /// Internal use only (d&d undo): do not 
delete caption objects of cell notes.
 ATTRIB   = HARDATTR | STYLES,
-CONTENTS = VALUE | DATETIME | STRING | NOTE | FORMULA | OUTLINE,
-ALL  = CONTENTS | ATTRIB | OBJECTS,
+CONTENTS = VALUE | DATETIME | STRING | NOTE | FORMULA | OUTLINE | 
SPARKLINES,
+ALL  = CONTENTS | ATTRIB | OBJECTS | SPARKLINES,
 /// Copy flags for auto/series fill functions: do not touch notes and 
drawing objects.
 AUTOFILL = ALL & ~(NOTE | OBJECTS)
 };
 namespace o3tl
 {
-template<> struct typed_flags : 
is_typed_flags {};
+template<> struct typed_flags : 
is_typed_flags {};
 }
 // This doesn't work at the moment, perhaps when we have constexpr we can 
modify InsertDeleteFlags to make it work.
 //static_assert((InsertDeleteFlags::ATTRIB & InsertDeleteFlags::CONTENTS) == 
InsertDeleteFlags::NONE, "these must match");
diff --git a/sc/inc/mtvelements.hxx b/sc/inc/mtvelements.hxx
index ee669c0a6e6b..72f65d2b72ff 100644
--- a/sc/inc/mtvelements.hxx
+++ b/sc/inc/mtvelements.hxx
@@ -142,6 +142,7 @@ typedef mdds::mtv::soa::multi_type_vector CellStoreTyp
 struct ColumnBlockPosition
 {
 CellNoteStoreType::iterator miCellNotePos;
+SparklineStoreType::iterator miSparklinePos;
 BroadcasterStoreType::iterator miBroadcasterPos;
 CellTextAttrStoreType::iterator miCellTextAttrPos;
 CellStoreType::iterator miCellPos;
@@ -152,6 +153,7 @@ struct ColumnBlockPosition
 struct ColumnBlockConstPosition
 {
 CellNoteStoreType::const_iterator miCellNotePos;
+SparklineStoreType::const_iterator miSparklinePos;
 CellTextAttrStoreType::const_iterator miCellTextAttrPos;
 CellStoreType::const_iterator miCellPos;
 
diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx
index 996f9a579d70..00ae196f88ab 100644
--- a/sc/inc/table.hxx
+++ b/sc/inc/table.hxx
@@ -474,6 +474,7 @@ public:
 

[Libreoffice-commits] core.git: chart2/source compilerplugins/clang filter/source include/oox oox/source sfx2/inc sfx2/source sw/source

2022-04-03 Thread Noel Grandin (via logerrit)
 chart2/source/controller/inc/SelectionHelper.hxx |2 
 chart2/source/controller/main/ChartController_Window.cxx |2 
 chart2/source/controller/main/SelectionHelper.cxx|2 
 chart2/source/inc/ObjectIdentifier.hxx   |   16 +-
 chart2/source/tools/ObjectIdentifier.cxx |   96 +++
 chart2/source/tools/PropertyHelper.cxx   |5 
 compilerplugins/clang/stringviewparam.cxx|2 
 filter/source/xmlfilterdetect/filterdetect.cxx   |7 -
 include/oox/export/vmlexport.hxx |2 
 oox/source/export/vmlexport.cxx  |7 -
 sfx2/inc/emojiview.hxx   |2 
 sfx2/source/control/emojiview.cxx|   21 +--
 sw/source/core/crsr/crossrefbookmark.cxx |9 -
 sw/source/core/inc/crossrefbookmark.hxx  |4 
 14 files changed, 92 insertions(+), 85 deletions(-)

New commits:
commit 3e1e0af376d45f44dab975cea943de7fb676f967
Author: Noel Grandin 
AuthorDate: Sat Apr 2 19:02:40 2022 +0200
Commit: Noel Grandin 
CommitDate: Sun Apr 3 10:01:48 2022 +0200

loplugin:stringviewparam convert methods using match

which converts to a combination of substr and o3tl::starts_with

Change-Id: I5b01a181b9e6bee3483e4f49f1a9426abcc682d0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132458
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/chart2/source/controller/inc/SelectionHelper.hxx 
b/chart2/source/controller/inc/SelectionHelper.hxx
index ae241d61ab42..ff0e95eee27a 100644
--- a/chart2/source/controller/inc/SelectionHelper.hxx
+++ b/chart2/source/controller/inc/SelectionHelper.hxx
@@ -92,7 +92,7 @@ public:
 DrawViewWrapper const & rDrawViewWrapper,
 bool bGetDiagramInsteadOf_Wall=false );
 
-static bool isRotateableObject( const OUString& rCID
+static bool isRotateableObject( std::u16string_view rCID
 , const rtl::Reference<::chart::ChartModel>& xChartModel );
 
 explicit SelectionHelper( SdrObject* pSelectedObj );
diff --git a/chart2/source/controller/main/ChartController_Window.cxx 
b/chart2/source/controller/main/ChartController_Window.cxx
index 0e33cabfccbb..a6bae9b002a7 100644
--- a/chart2/source/controller/main/ChartController_Window.cxx
+++ b/chart2/source/controller/main/ChartController_Window.cxx
@@ -154,7 +154,7 @@ void lcl_insertMenuCommand(
 xMenu->setCommand( nId, rCommand );
 }
 
-OUString lcl_getFormatCommandForObjectCID( const OUString& rCID )
+OUString lcl_getFormatCommandForObjectCID( std::u16string_view rCID )
 {
 OUString aDispatchCommand( ".uno:FormatSelection" );
 
diff --git a/chart2/source/controller/main/SelectionHelper.cxx 
b/chart2/source/controller/main/SelectionHelper.cxx
index 433a157ba828..cc01e09eff0a 100644
--- a/chart2/source/controller/main/SelectionHelper.cxx
+++ b/chart2/source/controller/main/SelectionHelper.cxx
@@ -443,7 +443,7 @@ OUString SelectionHelper::getHitObjectCID(
 // \\- solar mutex
 }
 
-bool SelectionHelper::isRotateableObject( const OUString& rCID
+bool SelectionHelper::isRotateableObject( std::u16string_view rCID
 , const rtl::Reference<::chart::ChartModel>& xChartModel )
 {
 if( !ObjectIdentifier::isRotateableObject( rCID ) )
diff --git a/chart2/source/inc/ObjectIdentifier.hxx 
b/chart2/source/inc/ObjectIdentifier.hxx
index f4ce48011419..5be9d9cf3a97 100644
--- a/chart2/source/inc/ObjectIdentifier.hxx
+++ b/chart2/source/inc/ObjectIdentifier.hxx
@@ -118,11 +118,11 @@ public:
 , const rtl::Reference<::chart::ChartModel>& xChartModel );
 
 static OUString createClassifiedIdentifierForParticle(
-const OUString& rParticle );
+std::u16string_view rParticle );
 
 static OUString createClassifiedIdentifierForParticles(
-const OUString& rParentParticle
-  , const OUString& rChildParticle
+std::u16string_view rParentParticle
+  , std::u16string_view rChildParticle
   , std::u16string_view rDragMethodServiceName = std::u16string_view()
   , std::u16string_view rDragParameterString = std::u16string_view() );
 
@@ -165,22 +165,22 @@ public:
 , std::u16string_view rDragParameterString = std::u16string_view()
 );
 
-static bool isCID( const OUString& rName );
+static bool isCID( std::u16string_view rName );
 static OUString getDragMethodServiceName( const OUString& 
rClassifiedIdentifier );
 static OUString getDragParameterString( const OUString& rCID );
 static bool isDragableObject( const OUString& rClassifiedIdentifier );
 bool isDragableObject() const;
-static bool isRotateableObject( const OUString& rClassifiedIdentifier );
-static bool isMultiClickObject( const OUString& rClassifiedIdentifier );
+static bool isRotateableObject( std::u16string_view rClassifiedIdentifier 
);
+

[Libreoffice-commits] core.git: officecfg/registry sc/inc sc/sdi sc/source sc/uiconfig

2022-04-03 Thread Tomaž Vajngerl (via logerrit)
 officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu |8 +
 sc/inc/sc.hrc |3 
 sc/sdi/cellsh.sdi |1 
 sc/sdi/scalc.sdi  |   19 
 sc/source/ui/view/cellsh.cxx  |   41 
++
 sc/source/ui/view/cellsh1.cxx |8 +
 sc/uiconfig/scalc/popupmenu/cell.xml  |1 
 7 files changed, 79 insertions(+), 2 deletions(-)

New commits:
commit 84dfdac1f7139337e61288af0e75aef66c19b29a
Author: Tomaž Vajngerl 
AuthorDate: Tue Mar 15 15:47:08 2022 +0900
Commit: Tomaž Vajngerl 
CommitDate: Sun Apr 3 12:13:17 2022 +0200

sc: add "Delete Sparkline" context menu command

Change-Id: I0e2bf2172da3cbba391ca64c93fad6bccd82f3ac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132468
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu 
b/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu
index e64af0f86161..51cd21e0d33a 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu
@@ -1082,6 +1082,14 @@
   1
 
   
+  
+
+  Delete Sparkline
+
+
+  1
+
+  
   
 
   ~Headers and Footers...
diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc
index b9dc48169235..a0acd3f9c94a 100644
--- a/sc/inc/sc.hrc
+++ b/sc/inc/sc.hrc
@@ -309,7 +309,8 @@ class SvxZoomSliderItem;
 #define FID_INS_COLUMNS_BEFORE  (INSERT_MENU_START + 23)
 #define FID_DEFINE_CURRENT_NAME (INSERT_MENU_START + 24)
 #define SID_INSERT_SPARKLINE(INSERT_MENU_START + 25)
-#define INSERT_MENU_END (INSERT_MENU_START + 26)
+#define SID_DELETE_SPARKLINE(INSERT_MENU_START + 26)
+#define INSERT_MENU_END (INSERT_MENU_START + 27)
 
 #define FORMAT_MENU_START   (INSERT_MENU_END)
 #define FID_CELL_FORMAT (FORMAT_MENU_START)
diff --git a/sc/sdi/cellsh.sdi b/sc/sdi/cellsh.sdi
index 8feaf0c590e0..5ad7926b24c6 100644
--- a/sc/sdi/cellsh.sdi
+++ b/sc/sdi/cellsh.sdi
@@ -236,6 +236,7 @@ interface CellSelection
 SID_SELECT_VISIBLE_COLUMNS  [ ExecMethod = ExecuteEdit;]
 SID_CURRENT_FORMULA_RANGE   [ ExecMethod = ExecuteEdit;]
 SID_INSERT_SPARKLINE[ ExecMethod = ExecuteEdit; 
StateMethod = GetBlockState; ]
+SID_DELETE_SPARKLINE[ ExecMethod = ExecuteEdit; 
StateMethod = GetBlockState; ]
 
 SID_THESAURUS   [ ExecMethod = ExecuteEdit; StateMethod = GetCellState; ]
 SID_SPELL_DIALOG [ ExecMethod = ExecuteEdit; StateMethod = GetState; ]
diff --git a/sc/sdi/scalc.sdi b/sc/sdi/scalc.sdi
index 4a8d8747cc14..c95aa01a7e2c 100644
--- a/sc/sdi/scalc.sdi
+++ b/sc/sdi/scalc.sdi
@@ -2301,7 +2301,24 @@ SfxVoidItem InsertSparkline SID_INSERT_SPARKLINE
 AccelConfig = TRUE,
 MenuConfig = TRUE,
 ToolBoxConfig = TRUE,
-GroupId = SfxGroupId::Insert;
+GroupId = SfxGroupId::Edit;
+]
+
+SfxVoidItem DeleteSparkline SID_DELETE_SPARKLINE
+()
+[
+AutoUpdate = FALSE,
+FastCall = FALSE,
+ReadOnlyDoc = TRUE,
+Toggle = FALSE,
+Container = FALSE,
+RecordAbsolute = FALSE,
+RecordPerSet;
+
+AccelConfig = TRUE,
+MenuConfig = TRUE,
+ToolBoxConfig = TRUE,
+GroupId = SfxGroupId::Edit;
 ]
 
 SfxVoidItem SearchResultsDialog SID_SEARCH_RESULTS_DIALOG
diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx
index 13d4430a956a..72e4b3c74e1d 100644
--- a/sc/source/ui/view/cellsh.cxx
+++ b/sc/source/ui/view/cellsh.cxx
@@ -52,6 +52,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 #define ShellClass_ScCellShell
 #define ShellClass_CellMovement
@@ -96,6 +98,38 @@ ScCellShell::~ScCellShell()
 delete pImpl->m_pRequest;
 }
 
+namespace
+{
+
+bool canShowDeleteSparkline(ScDocument& rDocument, ScRange const& rRange)
+{
+sc::SparklineGroup* pGroup = nullptr;
+SCTAB nTab = rRange.aStart.Tab();
+
+for (SCCOL nX = rRange.aStart.Col(); nX <= rRange.aEnd.Col(); nX++)
+{
+for (SCROW nY = rRange.aStart.Row(); nY <= rRange.aEnd.Row(); nY++)
+{
+auto* pSparkline = rDocument.GetSparkline(ScAddress(nX, nY, nTab));
+if (pSparkline == nullptr)
+{
+return false;
+}
+else if (!pGroup)
+{
+   pGroup = pSparkline->getSparklineGroup().get();
+}
+else if (pGroup != pSparkline->getSparklineGroup().get())
+{
+return false;
+}
+}
+}
+return true;
+}
+
+} // end anonymous namespace
+
 void ScCellShell::GetBlockState( SfxItemSet& rSet )
 {
 ScTabViewShell* pTabViewShell   = GetViewData().

[Libreoffice-commits] core.git: basic/source

2022-04-03 Thread offtkp (via logerrit)
 basic/source/runtime/methods.cxx |   54 ++-
 1 file changed, 20 insertions(+), 34 deletions(-)

New commits:
commit 6bc187b2eb6b9520c942f232b1abcb4fb29bfa04
Author: offtkp 
AuthorDate: Fri Apr 1 21:10:20 2022 +0300
Commit: Mike Kaganski 
CommitDate: Sun Apr 3 12:32:27 2022 +0200

tdf#147132 Flatten Basic function implementations

Change-Id: I21b0ec23de99aaf9b4398d59a5cc56d7d386ad58
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132444
Tested-by: Jenkins
Reviewed-by: Arkadiy Illarionov 
Reviewed-by: Mike Kaganski 

diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index 897f49d3144b..2bc1fb64f07c 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -3971,56 +3971,42 @@ void SbRtl_LBound(StarBASIC *, SbxArray & rPar, bool)
 {
 const sal_uInt32 nParCount = rPar.Count();
 if ( nParCount != 3 && nParCount != 2 )
-{
-StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT );
-return;
-}
+return StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT );
+
 SbxBase* pParObj = rPar.Get(1)->GetObject();
 SbxDimArray* pArr = dynamic_cast( pParObj );
-if( pArr )
-{
-sal_Int32 nLower, nUpper;
-short nDim = (nParCount == 3) ? 
static_cast(rPar.Get(2)->GetInteger()) : 1;
-if (!pArr->GetDim(nDim, nLower, nUpper))
-StarBASIC::Error( ERRCODE_BASIC_OUT_OF_RANGE );
-else
-rPar.Get(0)->PutLong(nLower);
-}
-else
-StarBASIC::Error( ERRCODE_BASIC_MUST_HAVE_DIMS );
+if( !pArr )
+return StarBASIC::Error( ERRCODE_BASIC_MUST_HAVE_DIMS );
+
+sal_Int32 nLower, nUpper;
+short nDim = (nParCount == 3) ? 
static_cast(rPar.Get(2)->GetInteger()) : 1;
+if (!pArr->GetDim(nDim, nLower, nUpper))
+return StarBASIC::Error( ERRCODE_BASIC_OUT_OF_RANGE );
+rPar.Get(0)->PutLong(nLower);
 }
 
 void SbRtl_UBound(StarBASIC *, SbxArray & rPar, bool)
 {
 const sal_uInt32 nParCount = rPar.Count();
 if ( nParCount != 3 && nParCount != 2 )
-{
-StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT );
-return;
-}
+return StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT );
 
 SbxBase* pParObj = rPar.Get(1)->GetObject();
 SbxDimArray* pArr = dynamic_cast( pParObj );
-if( pArr )
-{
-sal_Int32 nLower, nUpper;
-short nDim = (nParCount == 3) ? 
static_cast(rPar.Get(2)->GetInteger()) : 1;
-if (!pArr->GetDim(nDim, nLower, nUpper))
-StarBASIC::Error( ERRCODE_BASIC_OUT_OF_RANGE );
-else
-rPar.Get(0)->PutLong(nUpper);
-}
-else
-StarBASIC::Error( ERRCODE_BASIC_MUST_HAVE_DIMS );
+if( !pArr )
+return StarBASIC::Error( ERRCODE_BASIC_MUST_HAVE_DIMS );
+
+sal_Int32 nLower, nUpper;
+short nDim = (nParCount == 3) ? 
static_cast(rPar.Get(2)->GetInteger()) : 1;
+if (!pArr->GetDim(nDim, nLower, nUpper))
+return StarBASIC::Error( ERRCODE_BASIC_OUT_OF_RANGE );
+rPar.Get(0)->PutLong(nUpper);
 }
 
 void SbRtl_RGB(StarBASIC *, SbxArray & rPar, bool)
 {
 if (rPar.Count() != 4)
-{
-StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT );
-return;
-}
+return StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT );
 
 sal_Int32 nRed = rPar.Get(1)->GetInteger() & 0xFF;
 sal_Int32 nGreen = rPar.Get(2)->GetInteger() & 0xFF;


[Libreoffice-commits] core.git: sw/source

2022-04-03 Thread Caolán McNamara (via logerrit)
 sw/source/core/layout/tabfrm.cxx |   40 +--
 1 file changed, 22 insertions(+), 18 deletions(-)

New commits:
commit 1015359b5f4d01e2a423cbed7b155412d3f6db66
Author: Caolán McNamara 
AuthorDate: Sat Apr 2 20:59:15 2022 +0100
Commit: Caolán McNamara 
CommitDate: Sun Apr 3 13:10:28 2022 +0200

Related: forcepoint#100 don't reacquire after every release

instead release when we have to, and only reacquire if necessary
before use of pAttrs

Change-Id: I9c413fc479cf73c771e8349fe5e853a4eac72110
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132463
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index 8825280cd628..f9f655392521 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -2061,8 +2061,6 @@ void SwTabFrame::MakeAll(vcl::RenderContext* 
pRenderContext)
 oAccess.reset();
 m_bCalcLowers |= pLayout->Resize(
 pLayout->GetBrowseWidthByTabFrame( *this ) );
-oAccess.emplace(SwFrame::GetCache(), this);
-pAttrs = oAccess->Get();
 }
 
 setFramePrintAreaValid(false);
@@ -2097,6 +2095,12 @@ void SwTabFrame::MakeAll(vcl::RenderContext* 
pRenderContext)
 const tools::Long nOldPrtWidth = 
aRectFnSet.GetWidth(getFramePrintArea());
 const tools::Long nOldFrameWidth = 
aRectFnSet.GetWidth(getFrameArea());
 const Point aOldPrtPos  = aRectFnSet.GetPos(getFramePrintArea());
+
+if (!oAccess)
+{
+oAccess.emplace(SwFrame::GetCache(), this);
+pAttrs = oAccess->Get();
+}
 Format( getRootFrame()->GetCurrShell()->GetOut(), pAttrs );
 
 SwHTMLTableLayout *pLayout = GetTable()->GetHTMLTableLayout();
@@ -2107,8 +2111,6 @@ void SwTabFrame::MakeAll(vcl::RenderContext* 
pRenderContext)
 oAccess.reset();
 m_bCalcLowers |= pLayout->Resize(
 pLayout->GetBrowseWidthByTabFrame( *this ) );
-oAccess.emplace(SwFrame::GetCache(), this);
-pAttrs = oAccess->Get();
 }
 if ( aOldPrtPos != aRectFnSet.GetPos(getFramePrintArea()) )
 aNotify.SetLowersComplete( false );
@@ -2162,12 +2164,15 @@ void SwTabFrame::MakeAll(vcl::RenderContext* 
pRenderContext)
 oAccess.reset();
 m_bCalcLowers |= pHTMLLayout->Resize(
 pHTMLLayout->GetBrowseWidthByTabFrame( *this ) 
);
+}
+
+setFramePrintAreaValid(false);
 
+if (!oAccess)
+{
 oAccess.emplace(SwFrame::GetCache(), this);
 pAttrs = oAccess->Get();
 }
-
-setFramePrintAreaValid(false);
 Format( getRootFrame()->GetCurrShell()->GetOut(), 
pAttrs );
 }
 
@@ -2175,9 +2180,6 @@ void SwTabFrame::MakeAll(vcl::RenderContext* 
pRenderContext)
 
 lcl_RecalcTable( *this, nullptr, aNotify );
 
-oAccess.emplace(SwFrame::GetCache(), this);
-pAttrs = oAccess->Get();
-
 m_bLowersFormatted = true;
 if ( bKeep && KEEPTAB )
 {
@@ -2341,11 +2343,18 @@ void SwTabFrame::MakeAll(vcl::RenderContext* 
pRenderContext)
 // 6. There is no section change behind the table (see 
IsKeep)
 // 7. The last table row wants to keep with its next.
 const SwRowFrame* pLastRow = static_cast(GetLastLower());
-if (pLastRow
-&& IsKeep(pAttrs->GetAttrSet().GetKeep(), 
GetBreakItem(), true)
-&& pLastRow->ShouldRowKeepWithNext())
+if (pLastRow)
 {
-bFormat = true;
+if (!oAccess)
+{
+oAccess.emplace(SwFrame::GetCache(), this);
+pAttrs = oAccess->Get();
+}
+if (IsKeep(pAttrs->GetAttrSet().GetKeep(), 
GetBreakItem(), true)
+&& pLastRow->ShouldRowKeepWithNext())
+{
+bFormat = true;
+}
 }
 }
 
@@ -2359,9 +2368,6 @@ void SwTabFrame::MakeAll(vcl::RenderContext* 
pRenderContext)
 // is found, get its first content.
 const SwFrame* pTmpNxt = sw_FormatNextContentForKeep( this 
);
 
-oAccess.emplace(SwFrame::GetCache()

[Libreoffice-commits] core.git: sw/qa sw/source

2022-04-03 Thread Caolán McNamara (via logerrit)
 sw/qa/extras/layout/data/forcepoint98.html |binary
 sw/qa/extras/layout/layout.cxx |6 ++
 sw/source/core/layout/sectfrm.cxx  |3 ++-
 3 files changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 3644508aceee6019842bea1fee6c177eabd61681
Author: Caolán McNamara 
AuthorDate: Fri Apr 1 15:49:13 2022 +0100
Commit: Caolán McNamara 
CommitDate: Sun Apr 3 13:11:56 2022 +0200

forcepoint#98 don't delete SwFrame flagged as IsDeleteForbidden

Change-Id: I1ac2db4bf96afc4bdc8e0646576f5fa0bcd9e410
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132435
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/sw/qa/extras/layout/data/forcepoint98.html 
b/sw/qa/extras/layout/data/forcepoint98.html
new file mode 100644
index ..9d4b76c53e76
Binary files /dev/null and b/sw/qa/extras/layout/data/forcepoint98.html differ
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index 02185383cc32..33be08fd0d3c 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -2549,6 +2549,12 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf118058)
 pDoc->getIDocumentLayoutAccess().GetCurrentViewShell()->CalcLayout();
 }
 
+//just care it doesn't crash/assert
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testForcepoint98)
+{
+createSwWebDoc(DATA_DIRECTORY, "forcepoint98.html");
+}
+
 CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf128611)
 {
 createSwDoc(DATA_DIRECTORY, "tdf128611.fodt");
diff --git a/sw/source/core/layout/sectfrm.cxx 
b/sw/source/core/layout/sectfrm.cxx
index ce0c7a813f51..eb667dd51fc5 100644
--- a/sw/source/core/layout/sectfrm.cxx
+++ b/sw/source/core/layout/sectfrm.cxx
@@ -2891,7 +2891,8 @@ void SwRootFrame::DeleteEmptySct_()
 mpDestroy->erase( mpDestroy->begin() );
 OSL_ENSURE( !pSect->IsColLocked() && !pSect->IsJoinLocked(),
 "DeleteEmptySct: Locked SectionFrame" );
-if( !pSect->getFrameArea().HasArea() && !pSect->ContainsContent() )
+SAL_WARN_IF(pSect->IsDeleteForbidden(), "sw.layout", "not allowed 
delete SwFrame");
+if( !pSect->getFrameArea().HasArea() && !pSect->ContainsContent() && 
!pSect->IsDeleteForbidden() )
 {
 SwLayoutFrame* pUp = pSect->GetUpper();
 pSect->RemoveFromLayout();


[Libreoffice-commits] core.git: sw/source

2022-04-03 Thread Julien Nabet (via logerrit)
 sw/source/core/unocore/unocontentcontrol.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit c6b15cdf99a84808f0747ac11127c4f3997f2600
Author: Julien Nabet 
AuthorDate: Sun Apr 3 09:40:07 2022 +0200
Commit: Miklos Vajna 
CommitDate: Sun Apr 3 13:30:26 2022 +0200

cid#1503361: Incorrect expression  (USELESS_CALL)

Since 5da08b21cd23f2e70f5003733b03a7aee7915225
sw content controls: add UNO API to insert this with custom props

Change-Id: Id1ebcbe99df9a4d3a06b6714a471a686602f15ef
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132470
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 

diff --git a/sw/source/core/unocore/unocontentcontrol.cxx 
b/sw/source/core/unocore/unocontentcontrol.cxx
index 2b431a20de96..bcd3be6de895 100644
--- a/sw/source/core/unocore/unocontentcontrol.cxx
+++ b/sw/source/core/unocore/unocontentcontrol.cxx
@@ -691,7 +691,7 @@ uno::Any SAL_CALL SwXContentControl::getPropertyValue(const 
OUString& rPropertyN
 }
 else
 {
-m_pImpl->m_pContentControl->GetShowingPlaceHolder();
+aRet <<= m_pImpl->m_pContentControl->GetShowingPlaceHolder();
 }
 }
 else


[Libreoffice-commits] core.git: sc/qa

2022-04-03 Thread Tomaž Vajngerl (via logerrit)
 sc/qa/unit/SparklineTest.cxx |   61 +--
 1 file changed, 59 insertions(+), 2 deletions(-)

New commits:
commit cbd4e2852545b5f67896dc9062ddda4d5744f751
Author: Tomaž Vajngerl 
AuthorDate: Tue Mar 15 15:50:10 2022 +0900
Commit: Tomaž Vajngerl 
CommitDate: Sun Apr 3 16:08:46 2022 +0200

sc: add unit test to delete Sparkline, update add Sparkline test

Change-Id: Ib0e60ea5aa246b29a06ae90be2cb4b905722b1a0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132469
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/sc/qa/unit/SparklineTest.cxx b/sc/qa/unit/SparklineTest.cxx
index d4a8d2d119a8..74f40579d99f 100644
--- a/sc/qa/unit/SparklineTest.cxx
+++ b/sc/qa/unit/SparklineTest.cxx
@@ -19,6 +19,8 @@ class SparklineTest : public ScBootstrapFixture
 private:
 uno::Reference m_xCalcComponent;
 
+sc::Sparkline* createTestSparkline(ScDocument& rDocument);
+
 public:
 SparklineTest()
 : ScBootstrapFixture("sc/qa/unit/data")
@@ -43,22 +45,77 @@ public:
 }
 
 void testAddSparkline();
+void testDeleteSprkline();
 
 CPPUNIT_TEST_SUITE(SparklineTest);
 CPPUNIT_TEST(testAddSparkline);
+CPPUNIT_TEST(testDeleteSprkline);
 CPPUNIT_TEST_SUITE_END();
 };
 
+sc::Sparkline* SparklineTest::createTestSparkline(ScDocument& rDocument)
+{
+auto pSparklineGroup = std::make_shared();
+
+sc::Sparkline* pSparkline = rDocument.CreateSparkline(ScAddress(0, 6, 0), 
pSparklineGroup);
+if (!pSparkline)
+return nullptr;
+
+rDocument.SetValue(0, 0, 0, 4);
+rDocument.SetValue(0, 1, 0, -2);
+rDocument.SetValue(0, 2, 0, 1);
+rDocument.SetValue(0, 3, 0, -3);
+rDocument.SetValue(0, 4, 0, 5);
+rDocument.SetValue(0, 5, 0, 3);
+
+ScRangeList aList;
+aList.push_back(ScRange(0, 0, 0, 0, 5, 0));
+pSparkline->setInputRange(aList);
+
+return pSparkline;
+}
+
 void SparklineTest::testAddSparkline()
 {
 ScDocShellRef xDocSh = loadEmptyDocument();
 CPPUNIT_ASSERT(xDocSh);
 
 ScDocument& rDocument = xDocSh->GetDocument();
-auto pSparklineGroup = std::make_shared();
 
-sc::Sparkline* pSparkline = rDocument.CreateSparkline(ScAddress(0, 0, 0), 
pSparklineGroup);
+sc::Sparkline* pSparkline = createTestSparkline(rDocument);
 CPPUNIT_ASSERT(pSparkline);
+
+sc::Sparkline* pGetSparkline = rDocument.GetSparkline(ScAddress(0, 6, 0));
+CPPUNIT_ASSERT(pGetSparkline);
+
+CPPUNIT_ASSERT_EQUAL(pGetSparkline, pSparkline);
+
+sc::SparklineList* pList = rDocument.GetSparklineList(0);
+CPPUNIT_ASSERT(pList);
+
+std::vector> aSparklineVector = 
pList->getSparklines();
+CPPUNIT_ASSERT_EQUAL(size_t(1), aSparklineVector.size());
+CPPUNIT_ASSERT_EQUAL(aSparklineVector[0].get(), pSparkline);
+
+xDocSh->DoClose();
+}
+
+void SparklineTest::testDeleteSprkline()
+{
+ScDocShellRef xDocSh = loadEmptyDocument();
+CPPUNIT_ASSERT(xDocSh);
+
+ScDocument& rDocument = xDocSh->GetDocument();
+
+sc::Sparkline* pSparkline = createTestSparkline(rDocument);
+CPPUNIT_ASSERT(pSparkline);
+
+clearRange(&rDocument, ScRange(0, 6, 0, 0, 6, 0));
+
+sc::Sparkline* pGetSparkline = rDocument.GetSparkline(ScAddress(0, 6, 0));
+CPPUNIT_ASSERT(!pGetSparkline);
+
+xDocSh->DoClose();
 }
 
 CPPUNIT_TEST_SUITE_REGISTRATION(SparklineTest);


[Libreoffice-commits] core.git: sc/inc

2022-04-03 Thread Tomaž Vajngerl (via logerrit)
 sc/inc/Sparkline.hxx |8 
 sc/inc/SparklineCell.hxx |4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 05032132786b8dfc5cfda6b782acf85cb4d39be9
Author: Tomaž Vajngerl 
AuthorDate: Sat Mar 19 10:39:20 2022 +0900
Commit: Tomaž Vajngerl 
CommitDate: Sun Apr 3 16:08:58 2022 +0200

sc: make getters const in SparklineCell and Sparkline classes

Change-Id: Ia0bc1d4bd7da834da3640f34bfdb744dd2ddeba2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132471
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/sc/inc/Sparkline.hxx b/sc/inc/Sparkline.hxx
index 9a6109e96e79..e0fbbe125bc7 100644
--- a/sc/inc/Sparkline.hxx
+++ b/sc/inc/Sparkline.hxx
@@ -45,13 +45,13 @@ public:
 
 void setInputRange(ScRangeList const& rInputRange) { m_aInputRange = 
rInputRange; }
 
-ScRangeList const& getInputRange() { return m_aInputRange; }
+ScRangeList const& getInputRange() const { return m_aInputRange; }
 
-std::shared_ptr const& getSparklineGroup() { return 
m_pSparklineGroup; }
+std::shared_ptr const& getSparklineGroup() const { return 
m_pSparklineGroup; }
 
-SCCOL getColumn() { return m_nColumn; }
+SCCOL getColumn() const { return m_nColumn; }
 
-SCROW getRow() { return m_nRow; }
+SCROW getRow() const { return m_nRow; }
 };
 
 /** Contains a list of all created sparklines */
diff --git a/sc/inc/SparklineCell.hxx b/sc/inc/SparklineCell.hxx
index 0aca857170c9..0588646866c4 100644
--- a/sc/inc/SparklineCell.hxx
+++ b/sc/inc/SparklineCell.hxx
@@ -34,12 +34,12 @@ public:
 
 ScRangeList const& getInputRange() { return m_pSparkline->getInputRange(); 
}
 
-std::shared_ptr const& getSparklineGroup()
+std::shared_ptr const& getSparklineGroup() const
 {
 return m_pSparkline->getSparklineGroup();
 }
 
-std::shared_ptr const& getSparkline() { return m_pSparkline; }
+std::shared_ptr const& getSparkline() const { return 
m_pSparkline; }
 };
 
 } // end sc


[Libreoffice-commits] core.git: filter/source

2022-04-03 Thread Caolán McNamara (via logerrit)
 filter/source/xsltdialog/xmlfiltertestdialog.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 88f81a8df7483169592d106e4007d8810cb6ccfc
Author: Caolán McNamara 
AuthorDate: Sun Apr 3 12:15:37 2022 +0100
Commit: Caolán McNamara 
CommitDate: Sun Apr 3 16:19:55 2022 +0200

cid#1503358 silence Unchecked return value

and

cid#1503359 Unchecked return value

Change-Id: I12e1a3501674c8d99a705e3a84aa9afe7b8b0754
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132477
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 

diff --git a/filter/source/xsltdialog/xmlfiltertestdialog.cxx 
b/filter/source/xsltdialog/xmlfiltertestdialog.cxx
index e130f6b552fc..c9b30c005fd4 100644
--- a/filter/source/xsltdialog/xmlfiltertestdialog.cxx
+++ b/filter/source/xsltdialog/xmlfiltertestdialog.cxx
@@ -426,7 +426,7 @@ void XMLFilterTestDialog::doExport( const Reference< 
XComponent >& xComp )
 if( pAppInfo )
 {
 File aOutputFile( aTempFileURL );
-/* File::RC rc = */ aOutputFile.open( osl_File_OpenFlag_Write 
);
+(void)aOutputFile.open( osl_File_OpenFlag_Write );
 
 // create xslt exporter
 Reference< XOutputStream > xIS( new 
comphelper::OSLOutputStreamWrapper( aOutputFile ) );
@@ -586,7 +586,7 @@ void XMLFilterTestDialog::import( const OUString& rURL )
 if( xImporter.is() )
 {
 osl::File aInputFile( rURL );
-aInputFile.open( osl_File_OpenFlag_Read );
+(void)aInputFile.open( osl_File_OpenFlag_Read );
 
 Reference< XInputStream > xIS( new 
comphelper::OSLInputStreamWrapper( aInputFile ) );
 
@@ -599,7 +599,7 @@ void XMLFilterTestDialog::import( const OUString& rURL )
 Reference< XWriter > xWriter = Writer::create( mxContext );
 
 File aOutputFile( aTempFileURL );
-aOutputFile.open( osl_File_OpenFlag_Write );
+(void)aOutputFile.open( osl_File_OpenFlag_Write );
 
 Reference< XOutputStream > xOS( new OSLOutputStreamWrapper( 
aOutputFile ) );
 xWriter->setOutputStream( xOS );


[Libreoffice-commits] core.git: sw/source

2022-04-03 Thread Caolán McNamara (via logerrit)
 sw/source/core/doc/doctxm.cxx |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 24eb8731513e5a8b0b761cbd0dabd71ea7038c2d
Author: Caolán McNamara 
AuthorDate: Sun Apr 3 12:20:42 2022 +0100
Commit: Caolán McNamara 
CommitDate: Sun Apr 3 16:20:14 2022 +0200

cid#1503360 Dereference null return value

Change-Id: I5c25149a9c2ec2938754de7f79991c93c741e914
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132478
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx
index 828742c0e37c..df997eb34a43 100644
--- a/sw/source/core/doc/doctxm.cxx
+++ b/sw/source/core/doc/doctxm.cxx
@@ -935,8 +935,9 @@ void SwTOXBaseSection::Update(const SfxItemSet* pAttr,
 
 // find the first layout node for this TOX, if it only find the content
 // in his own chapter
-const SwTextNode* pOwnChapterNode = IsFromChapter()
-? ::lcl_FindChapterNode( *pSectNd, pLayout, 
pSectNd->FindSectionNode()->GetSectionLevel() + 1 )
+const SwSectionNode* pChapterSectNd = IsFromChapter() ? 
pSectNd->FindSectionNode() : nullptr;
+const SwTextNode* pOwnChapterNode = pChapterSectNd
+? ::lcl_FindChapterNode( *pSectNd, pLayout, 
pChapterSectNd->GetSectionLevel() + 1 )
 : nullptr;
 
 SwNode2LayoutSaveUpperFrames aN2L(*pSectNd);


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - instsetoo_native/inc_openoffice

2022-04-03 Thread Andras Timar (via logerrit)
 instsetoo_native/inc_openoffice/unix/find-requires-x11.sh |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 805affb386c1c3e0b7ea6fe9672a514aca667a17
Author: Andras Timar 
AuthorDate: Wed Mar 2 09:49:51 2022 +0100
Commit: Andras Timar 
CommitDate: Sun Apr 3 16:47:36 2022 +0200

Do not pull in X11 dependencies when the build is configured for LOKit

Change-Id: I44a1782cf523bbf0e0d564f36c7ed495
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130780
Tested-by: Andras Timar 
Reviewed-by: Andras Timar 

diff --git a/instsetoo_native/inc_openoffice/unix/find-requires-x11.sh 
b/instsetoo_native/inc_openoffice/unix/find-requires-x11.sh
index 0fe0b1d27dde..6808b3631d73 100644
--- a/instsetoo_native/inc_openoffice/unix/find-requires-x11.sh
+++ b/instsetoo_native/inc_openoffice/unix/find-requires-x11.sh
@@ -23,5 +23,7 @@ if [[ "${OS}" == "AIX" ]]; then
   echo "libfreetype.a(libfreetype.so.6${mark64})"
 else
   echo "libfreetype.so.6${mark64}"
-  echo "libXinerama.so.1${mark64}"
+  if [[ "${XINERAMA_LINK}" == "dynamic" ]]; then
+echo "libXinerama.so.1${mark64}"
+  fi
 fi


[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sw/inc sw/qa sw/source writerfilter/source

2022-04-03 Thread Sarper Akdemir (via logerrit)
 sw/inc/unoprnms.hxx  |1 
 sw/qa/extras/ooxmlexport/data/tdf148273_sectionBulletFormatLeak.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport17.cxx   |   17 
++
 sw/source/core/unocore/unoobj.cxx|9 
+
 writerfilter/source/dmapper/DomainMapper.cxx |2 -
 writerfilter/source/dmapper/DomainMapper_Impl.cxx|8 

 6 files changed, 36 insertions(+), 1 deletion(-)

New commits:
commit 87c1615c1f6525c3f0e0d16dd98269744d21d183
Author: Sarper Akdemir 
AuthorDate: Wed Mar 30 17:02:30 2022 +0300
Commit: Andras Timar 
CommitDate: Sun Apr 3 17:33:46 2022 +0200

tdf#148273 docx import: fix section break format leak to bullets

Fixes RES_PARATR_LIST_AUTOFMT leaking into the next section.

Achieves this by resetting list related attributes on the cursor's
text node in DomainMapper_Impl::RemoveLastParagraph() after the
deletion of the paragraph.

Change-Id: Ib4d09c5f190b8b8fd3bdc119ddd57d91f353de2f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132324
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132440
Reviewed-by: Andras Timar 

diff --git a/sw/inc/unoprnms.hxx b/sw/inc/unoprnms.hxx
index 7ef5d0a58cd7..b9dbdc40e9fa 100644
--- a/sw/inc/unoprnms.hxx
+++ b/sw/inc/unoprnms.hxx
@@ -500,6 +500,7 @@
 #define UNO_NAME_SEPARATOR_LINE_IS_ON "SeparatorLineIsOn"
 #define UNO_NAME_IS_SKIP_HIDDEN_TEXT "IsSkipHiddenText"
 #define UNO_NAME_IS_SKIP_PROTECTED_TEXT "IsSkipProtectedText"
+#define UNO_NAME_RESET_PARAGRAPH_LIST_ATTRIBUTES "ResetParagraphListAttributes"
 #define UNO_NAME_DOCUMENT_INDEX_MARKS "DocumentIndexMarks"
 #define UNO_NAME_FOOTNOTE_IS_COLLECT_AT_TEXT_END "FootnoteIsCollectAtTextEnd"
 #define UNO_NAME_FOOTNOTE_IS_RESTART_NUMBERING "FootnoteIsRestartNumbering"
diff --git 
a/sw/qa/extras/ooxmlexport/data/tdf148273_sectionBulletFormatLeak.docx 
b/sw/qa/extras/ooxmlexport/data/tdf148273_sectionBulletFormatLeak.docx
new file mode 100644
index ..1ebb1e8b419c
Binary files /dev/null and 
b/sw/qa/extras/ooxmlexport/data/tdf148273_sectionBulletFormatLeak.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx
index f23721767fc9..370989a9d6b7 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx
@@ -11,6 +11,7 @@
 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -282,6 +283,22 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf147978enhancedPathABVW)
 }
 }
 
+DECLARE_OOXMLEXPORT_TEST(testTdf148273_sectionBulletFormatLeak, 
"tdf148273_sectionBulletFormatLeak.docx")
+{
+// get a paragraph with bullet point after section break
+uno::Reference xParagraph = getParagraph(4);
+uno::Reference xProps(xParagraph, uno::UNO_QUERY);
+
+// Make sure that the bullet has no ListAutoFormat inherited from
+// the empty paragraph before the section break
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: 0
+// - Actual  : 1
+// i.e. empty paragraph formats from the first section leaked to the 
bullet's formatting
+uno::Any aValue = xProps->getPropertyValue("ListAutoFormat");
+CPPUNIT_ASSERT_EQUAL(false, aValue.hasValue());
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/unocore/unoobj.cxx 
b/sw/source/core/unocore/unoobj.cxx
index b26acac97282..09136cf44c8c 100644
--- a/sw/source/core/unocore/unoobj.cxx
+++ b/sw/source/core/unocore/unoobj.cxx
@@ -2087,6 +2087,15 @@ SwXTextCursor::setPropertyValue(
 }
 rUnoCursor.SetSkipOverProtectSections(bSet);
 }
+else if (rPropertyName == UNO_NAME_RESET_PARAGRAPH_LIST_ATTRIBUTES)
+{
+SwTextNode* pTextNode= GetPaM()->GetNode().GetTextNode();
+
+if(pTextNode)
+{
+pTextNode->ResetAttr(RES_PARATR_LIST_BEGIN, RES_PARATR_LIST_END);
+}
+}
 else
 {
 SwUnoCursorHelper::SetPropertyValue(rUnoCursor,
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx 
b/writerfilter/source/dmapper/DomainMapper.cxx
index ffa829351baa..691e876d4859 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -3768,10 +3768,10 @@ void DomainMapper::lcl_utext(const sal_uInt8 * data_, 
size_t len)
 
static_cast(xContext.get())->SetListId(-1);;
 xContext->Erase(PROP_NUMBERING_LEVEL);
 }
-m_pImpl->SetParaSectpr(false);
 finishParagraph(bRemove, bNoNumbering);
 if (bRemove)
 m_pImpl->RemoveLastParagraph();
+m_pImpl->SetParaSectpr(false);
 }
 else
 {
diff --git a/writerfilter/source/dmapper/DomainMapper_I

[Libreoffice-commits] core.git: Branch 'feature/sparklines' - sc/inc sc/source

2022-04-03 Thread Tomaž Vajngerl (via logerrit)
 sc/inc/table.hxx   |1 
 sc/source/core/data/table4.cxx |   56 +
 2 files changed, 57 insertions(+)

New commits:
commit 7a278d9326775cbb1e0dce1c9cf7c6c335d9ba00
Author: Tomaž Vajngerl 
AuthorDate: Mon Apr 4 00:56:47 2022 +0900
Commit: Tomaž Vajngerl 
CommitDate: Mon Apr 4 00:56:47 2022 +0900

sc: take sparklines into account with auto fill

Change-Id: I6bdb5f4291aece7ec02d8de0731b8f983b4f2bb2

diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx
index 7b3c01e67989..c811dd6b4bde 100644
--- a/sc/inc/table.hxx
+++ b/sc/inc/table.hxx
@@ -482,6 +482,7 @@ public:
 
 sc::SparklineList& GetSparklineList();
 void CopySparklinesToTable(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW 
nRow2, ScTable* pDestTab);
+void FillSparkline(bool bVertical, SCCOLROW nFixed, SCCOLROW 
nIteratingStart, SCCOLROW nIteratingEnd, SCCOLROW nFillStart, SCCOLROW 
nFillEnd);
 
 // Notes / Comments
 std::unique_ptr ReleaseNote( SCCOL nCol, SCROW nRow );
diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx
index a3d49aa1c190..5865b2245767 100644
--- a/sc/source/core/data/table4.cxx
+++ b/sc/source/core/data/table4.cxx
@@ -1204,10 +1204,66 @@ void ScTable::FillAuto( SCCOL nCol1, SCROW nRow1, SCCOL 
nCol2, SCROW nRow2,
 nProgress = pProgress->GetState();
 }
 
+if (bVertical)
+FillSparkline(bVertical, nCol, nRow1, nRow2, nIStart, nIEnd);
+else
+FillSparkline(bVertical, nRow, nCol1, nCol2, nIStart, nIEnd);
+
 nActFormCnt += nMaxFormCnt;
 }
 }
 
+void  ScTable::FillSparkline(bool bVertical, SCCOLROW nFixed,
+ SCCOLROW nStart, SCCOLROW nEnd,
+ SCCOLROW nFillStart, SCCOLROW nFillEnd)
+{
+bool bHasSparklines = false;
+std::vector> aSparklineSeries;
+
+for (SCROW nCurrent = nStart; nCurrent <= nEnd; nCurrent++)
+{
+auto pSparkline = bVertical ? GetSparkline(nFixed, nCurrent) : 
GetSparkline(nCurrent, nFixed);
+bHasSparklines = bHasSparklines || bool(pSparkline);
+aSparklineSeries.push_back(pSparkline);
+}
+
+if (bHasSparklines)
+{
+for (SCCOLROW nCurrent = nFillStart; nCurrent <= nFillEnd; nCurrent++)
+{
+size_t nIndex = size_t(nFillStart - nCurrent) % 
aSparklineSeries.size();
+if (auto& rpSparkline = aSparklineSeries[nIndex])
+{
+auto pGroup = rpSparkline->getSparklineGroup();
+
+auto* pNewSparkline = bVertical ? CreateSparkline(nFixed, 
nCurrent, pGroup)
+: CreateSparkline(nCurrent, 
nFixed, pGroup);
+if (pNewSparkline)
+{
+SCCOLROW nPosition = bVertical ? rpSparkline->getRow()
+   : rpSparkline->getColumn();
+SCCOLROW nDelta = nCurrent - nPosition;
+ScRangeList aRangeList(rpSparkline->getInputRange());
+for (ScRange& rRange : aRangeList)
+{
+if (bVertical)
+{
+rRange.aStart.IncRow(nDelta);
+rRange.aEnd.IncRow(nDelta);
+}
+else
+{
+rRange.aStart.IncCol(nDelta);
+rRange.aEnd.IncCol(nDelta);
+}
+}
+pNewSparkline->setInputRange(aRangeList);
+}
+}
+}
+}
+}
+
 OUString ScTable::GetAutoFillPreview( const ScRange& rSource, SCCOL nEndX, 
SCROW nEndY )
 {
 OUString aValue;


[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sw/qa sw/source

2022-04-03 Thread Michael Stahl (via logerrit)
 sw/qa/core/data/rtf/pass/forcepoint-96.rtf  |8 
 sw/source/core/doc/DocumentContentOperationsManager.cxx |   31 
 2 files changed, 39 insertions(+)

New commits:
commit 542673c0d4c6a992113999101f2c1bf21e0c5c22
Author: Michael Stahl 
AuthorDate: Fri Apr 1 17:16:20 2022 +0200
Commit: Caolán McNamara 
CommitDate: Sun Apr 3 18:12:39 2022 +0200

forcepoint#96 sw: delete fieldmarks in DelFullPara()

The problem is that CorrAbs() will move any position of a fieldmark
that's in the deleted SwTextNodes to a different node that doesn't have
the CH_TXT_ATR_FIELD*.

Then it will inevitably crash later when it can't find its chars.

The other problem is that if there's only a CH_TXT_ATR_FIELDSEP in the
deleted nodes, that fieldmark would then be missing it.

Just delete fieldmarks with positions in deleted nodes, that should work
fine for the usual cases where DelFullPara() is called.

Change-Id: I8dfac9a315d74025dbe1ed5ccb95b7c9121fb569
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132379
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/sw/qa/core/data/rtf/pass/forcepoint-96.rtf 
b/sw/qa/core/data/rtf/pass/forcepoint-96.rtf
new file mode 100644
index ..1e5a05d4801f
--- /dev/null
+++ b/sw/qa/core/data/rtf/pass/forcepoint-96.rtf
@@ -0,0 +1,8 @@
+{\rtf1
+\clvertalt
+\chpgn
+\clvertalb
+\cell
+\pard\intbl
+\cellx279
+}
diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx 
b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index c9f15ad54226..11f91cfe38b5 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -2255,6 +2255,37 @@ bool DocumentContentOperationsManager::DelFullPara( 
SwPaM& rPam )
 return false;
 }
 }
+
+// must delete all fieldmarks before CorrAbs(), or they'll remain
+// moved to wrong node without their CH_TXT_ATR_FIELD*
+// (note: deleteMarks() doesn't help here, in case of partially
+// selected fieldmarks; let's delete these as re-inserting their chars
+// elsewhere looks difficult)
+::std::set<::sw::mark::IFieldmark*> fieldmarks;
+for (SwNodeIndex i = aRg.aStart; i <= aRg.aEnd; ++i)
+{
+if (SwTextNode *const pTextNode = i.GetNode().GetTextNode())
+{
+for (sal_Int32 j = 0; j < pTextNode->GetText().getLength(); 
++j)
+{
+switch (pTextNode->GetText()[j])
+{
+case CH_TXT_ATR_FIELDSTART:
+case CH_TXT_ATR_FIELDEND:
+
fieldmarks.insert(m_rDoc.getIDocumentMarkAccess()->getFieldmarkAt(SwPosition(*pTextNode,
 j)));
+break;
+case CH_TXT_ATR_FIELDSEP:
+
fieldmarks.insert(m_rDoc.getIDocumentMarkAccess()->getFieldmarkFor(SwPosition(*pTextNode,
 j)));
+break;
+}
+}
+}
+}
+for (auto const pFieldMark : fieldmarks)
+{
+m_rDoc.getIDocumentMarkAccess()->deleteMark(pFieldMark);
+}
+
 // move bookmarks, redlines etc.
 if (aRg.aStart == aRg.aEnd) // only first CorrAbs variant handles this
 {


[Libreoffice-commits] core.git: sw/qa sw/source

2022-04-03 Thread Caolán McNamara (via logerrit)
 sw/qa/extras/layout/data/forcepoint102.rtf |  178 +
 sw/qa/extras/layout/layout.cxx |   22 ++-
 sw/source/core/text/txtfrm.cxx |8 +
 3 files changed, 199 insertions(+), 9 deletions(-)

New commits:
commit f49d218a671df5f7a956ccb219dc46a5c8d0a53c
Author: Caolán McNamara 
AuthorDate: Sun Apr 3 17:07:45 2022 +0100
Commit: Caolán McNamara 
CommitDate: Sun Apr 3 20:26:05 2022 +0200

forcepoint#102 refetch pPara if it might have been destroyed

by SwTextFly::Relax

READ of size 8 at 0x616006d9ab08 thread T0
#0 0x7f5c56a0fbe5 in Size::Height() const include/tools/gen.hxx:213:52
#1 0x7f5c56a0fb98 in Size::getHeight() const 
include/tools/gen.hxx:219:55
#2 0x7f5c56a040f0 in SwRect::IsEmpty() const sw/inc/swrect.hxx:306:21
#3 0x7f5c56dbb018 in SwRect::HasArea() const sw/inc/swrect.hxx:302:13
#4 0x7f5c58571d04 in SwTextFrame::Prepare(PrepareHint, void const*, 
bool) sw/source/core/text/txtfrm.cxx:2986:45

0x616006d9ab08 is located 136 bytes inside of 608-byte region 
[0x616006d9aa80,0x616006d9ace0)
freed by thread T0 here:
#0 0x4fe1f7 in operator delete(void*) 
(instdir/program/soffice.bin+0x4fe1f7)
#1 0x7f5c584602c5 in SwParaPortion::~SwParaPortion() 
sw/source/core/text/porlay.cxx:2557:1
#2 0x7f5c5850b997 in 
std::default_delete::operator()(SwParaPortion*) const 
/usr/bin/../lib/gcc/x86_64-redhat-linux/11/../../../../include/c++/11/bits/unique_ptr.h:85:2
#3 0x7f5c5850b826 in std::__uniq_ptr_impl >::reset(SwParaPortion*) 
/usr/bin/../lib/gcc/x86_64-redhat-linux/11/../../../../include/c++/11/bits/unique_ptr.h:182:4
#4 0x7f5c5850b630 in std::unique_ptr >::reset(SwParaPortion*) 
/usr/bin/../lib/gcc/x86_64-redhat-linux/11/../../../../include/c++/11/bits/unique_ptr.h:456:7
#5 0x7f5c5850960d in SwTextLine::SetPara(SwParaPortion*, bool) 
sw/source/core/text/txtcache.hxx:45:17
#6 0x7f5c58509e7d in SwTextFrame::ClearPara() 
sw/source/core/text/txtcache.cxx:113:24
#7 0x7f5c5855606e in SwTextFrame::Init() 
sw/source/core/text/txtfrm.cxx:758:9
#8 0x7f5c585735c4 in SwTextFrame::Prepare(PrepareHint, void const*, 
bool) sw/source/core/text/txtfrm.cxx:3090:17
#9 0x7f5c57ecafb4 in lcl_NotifyContent(SdrObject const*, 
SwContentFrame*, SwRect const&, PrepareHint) 
sw/source/core/layout/frmtool.cxx:3367:15
#10 0x7f5c57ec968b in Notify_Background(SdrObject const*, SwPageFrame*, 
SwRect const&, PrepareHint, bool) sw/source/core/layout/frmtool.cxx:3443:9
#11 0x7f5c57958669 in lcl_NotifyBackgroundOfObj(SwDrawContact const&, 
SdrObject const&, tools::Rectangle const*) 
sw/source/core/draw/dcontact.cxx:951:13
#12 0x7f5c579556bc in SwDrawContact::Changed_(SdrObject const&, 
SdrUserCallType, tools::Rectangle const*) 
sw/source/core/draw/dcontact.cxx:1233:21
#13 0x7f5c57953b8d in SwDrawContact::Changed(SdrObject const&, 
SdrUserCallType, tools::Rectangle const&) 
sw/source/core/draw/dcontact.cxx:1009:5
#14 0x7f5c96008baf in SdrObject::SendUserCall(SdrUserCallType, 
tools::Rectangle const&) const svx/source/svdraw/svdobj.cxx:2767:22
#15 0x7f5c9601befa in SdrObject::Resize(Point const&, Fraction const&, 
Fraction const&, bool) svx/source/svdraw/svdobj.cxx:1561:5
#16 0x7f5c57da650c in SwAnchoredDrawObject::GetObjBoundRect() const 
sw/source/core/layout/anchoreddrawobject.cxx:733:22
#17 0x7f5c57dae236 in SwAnchoredObject::GetObjRectWithSpaces() const 
sw/source/core/layout/anchoredobject.cxx:569:31
#18 0x7f5c5853c39e in SwTextFly::InitAnchoredObjList() 
sw/source/core/text/txtfly.cxx:900:48
#19 0x7f5c58537b0c in SwTextFly::GetAnchoredObjList() const 
sw/source/core/inc/txtfly.hxx:311:44
#20 0x7f5c58532a5d in SwTextFly::ForEach(SwRect const&, SwRect*, bool) 
const sw/source/core/text/txtfly.cxx:1067:56
#21 0x7f5c58533eec in SwTextFly::IsAnyFrame() const 
sw/source/core/text/txtfly.cxx:405:12
#22 0x7f5c5832ccbe in SwTextFly::Relax() 
sw/source/core/inc/txtfly.hxx:337:17
#23 0x7f5c58571af5 in SwTextFrame::Prepare(PrepareHint, void const*, 
bool) sw/source/core/text/txtfrm.cxx:2976:48

Change-Id: Ibd0d4af69d2a8d74ad538afba7da53c864fa27b6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132480
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/sw/qa/extras/layout/data/forcepoint102.rtf 
b/sw/qa/extras/layout/data/forcepoint102.rtf
new file mode 100644
index ..2a830ff73c10
--- /dev/null
+++ b/sw/qa/extras/layout/data/forcepoint102.rtf
@@ -0,0 +1,178 @@
+{\rtf1\ansh\ansicpg1252\uc1 \deff0\deflang1033\deflangfe1033{\fonttbl{\f0 
Times New Roman;}{\f1 Courier New;}{\f2 
ARIAL;}}{�colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0

[Libreoffice-commits] core.git: sw/source

2022-04-03 Thread Mike Kaganski (via logerrit)
 sw/source/uibase/dbui/mailmergehelper.cxx |7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 1ea95f05ee8ec496c628bd11750d23cc012c7fe4
Author: Mike Kaganski 
AuthorDate: Sat Apr 2 11:10:22 2022 +0300
Commit: Mike Kaganski 
CommitDate: Sun Apr 3 20:48:47 2022 +0200

tdf#148338: allow single-letter lowest-level domain

The check that required lowest-level domain name to be at least
two characters long, was introduced for #i25107# in 2004 in the
commit dfcb4aa47b81ebd9affddefda88bf9b451508221
  Author Rüdiger Timm 
  Date   Mon Sep 20 12:13:22 2004 +
INTEGRATION: CWS swmailmerge (1.1.2); FILE ADDED

(See also related #i20057# for feature specification.)
It didn't mention a rationale behind that check; but obviously,
it's unjustified. There are single-letter second-level domain
names [1], like 'x.com', and also under many other TLDs. Also
the check prevented single-character third-level names like
"a.foo.bar", etc. Plus, RFC 5322 (and its predecessors) do not
restrict these lengths in 'Addr-Spec Specification' (and RFCs
referenced from there).

This does not enable dotless domains [2]; if justified, they
should be enabled separately.

[1] https://en.wikipedia.org/wiki/Single-letter_second-level_domain
[2] https://en.wikipedia.org/wiki/Top-level_domain#Dotless_domains

Change-Id: I03cc26a90c08b94b9c1f70e0a0f1746192cb7afe
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132482
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/sw/source/uibase/dbui/mailmergehelper.cxx 
b/sw/source/uibase/dbui/mailmergehelper.cxx
index 03df98e9a192..edd125cb04a3 100644
--- a/sw/source/uibase/dbui/mailmergehelper.cxx
+++ b/sw/source/uibase/dbui/mailmergehelper.cxx
@@ -72,8 +72,9 @@ OUString CallSaveAsDialog(weld::Window* pParent, OUString& 
rFilter)
 
 /*
 simple address check: check for '@'
-for at least one '.' after the '@'
-and for at least two characters before and after 
the dot
+for at least one '.' after the '@',
+for at least one character before the dot
+and for at least two characters after the dot
 */
 bool CheckMailAddress( const OUString& rMailAddress )
 {
@@ -81,7 +82,7 @@ bool CheckMailAddress( const OUString& rMailAddress )
 if (nPosAt<0 || rMailAddress.lastIndexOf('@')!=nPosAt)
 return false;
 const sal_Int32 nPosDot = rMailAddress.indexOf('.', nPosAt);
-return !(nPosDot<0 || nPosDot-nPosAt<3 || 
rMailAddress.getLength()-nPosDot<3);
+return !(nPosDot<0 || nPosDot-nPosAt<2 || 
rMailAddress.getLength()-nPosDot<3);
 }
 
 uno::Reference< mail::XSmtpService > ConnectToSmtpServer(


Behrad Khorram license statement

2022-04-03 Thread behrad khorram
All of my past & future contributions to LibreOffice may be licensed under
the MPLv2/LGPLv3+ dual license.


[Libreoffice-commits] core.git: sw/source

2022-04-03 Thread Jim Raykowski (via logerrit)
 sw/source/uibase/shells/annotsh.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 2d6af46a82c6b9f1565933e8a1175e7a184256ca
Author: Jim Raykowski 
AuthorDate: Fri Apr 1 22:08:42 2022 -0800
Commit: Jim Raykowski 
CommitDate: Sun Apr 3 21:17:38 2022 +0200

tdf#147925 fix view scrolling back to comment

fixes regression caused by fix done for commit
85057da7f19e8e5d6023c16fa07d138e2b519a66

Change-Id: I427513bd920f4e0047c64210feecfeac22ecfd10
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132451
Tested-by: Jenkins
Reviewed-by: Jim Raykowski 

diff --git a/sw/source/uibase/shells/annotsh.cxx 
b/sw/source/uibase/shells/annotsh.cxx
index e99ee1eb2a24..3801f0489da7 100644
--- a/sw/source/uibase/shells/annotsh.cxx
+++ b/sw/source/uibase/shells/annotsh.cxx
@@ -135,7 +135,8 @@ SwAnnotationShell::SwAnnotationShell( SwView& r )
 
 SwAnnotationShell::~SwAnnotationShell()
 {
-m_rView.GetWrtShell().Edit();
+if (m_rView.GetWrtShell().CanInsert())
+m_rView.ShowCursor(true);
 }
 
 SfxUndoManager* SwAnnotationShell::GetUndoManager()


autogen.sh error

2022-04-03 Thread 徐恩华
Hello everyone,
there is some error, when I try build on macos 12.3 with apple M1 pro.  I have installed autoconf、automake and libtool, but some errors occours when run autogen.sh.
Would you help me,thank you very much!

Best wishes!

% ./autogen.sh          
: command not found1: :
configure.ac:9785: warning: macro 'AM_PATH_PYTHON' not found in library
configure.ac:9827: warning: macro 'AM_PATH_PYTHON' not found in library
configure.ac:9874: warning: macro 'AM_PATH_PYTHON' not found in library
 --srcdir=/Volumes/Untitled/Libreoffice/core --enable-option-checking=fatal'
./configure: line 1: syntax error near unexpected token `('
./configure: line 1: `m4trace:configure.ac:12: -1- AC_INIT([LibreOffice], [7.4.0.0.alpha0+], [], [], [http://documentfoundation.org/])'
Error running configure at ./autogen.sh line 322.
 
% ./configure           
./configure: line 1: syntax error near unexpected token `('
./configure: line 1: `m4trace:configure.ac:12: -1- AC_INIT([LibreOffice], [7.4.0.0.alpha0+], [], [], [http://documentfoundation.org/])’
configure file like this:
m4trace:configure.ac:12: -1- AC_INIT([LibreOffice], [7.4.0.0.alpha0+], [], [], [http://documentfoundation.org/])
m4trace:configure.ac:12: -1- m4_pattern_forbid([^_?A[CHUM]_])
m4trace:configure.ac:12: -1- m4_pattern_forbid([_AC_])
m4trace:configure.ac:12: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS'])
m4trace:configure.ac:12: -1- m4_pattern_allow([^AS_FLAGS$])
m4trace:configure.ac:12: -1- m4_pattern_forbid([^_?m4_])
m4trace:configure.ac:12: -1- m4_pattern_forbid([^dnl$])
m4trace:configure.ac:12: -1- m4_pattern_forbid([^_?AS_])
#! /bin/sh
m4trace:configure.ac:12: -1- AC_SUBST([SHELL])
m4trace:configure.ac:12: -1- AC_SUBST_TRACE([SHELL])
m4trace:configure.ac:12: -1- m4_pattern_allow([^SHELL$])
m4trace:configure.ac:12: -1- AC_SUBST([PATH_SEPARATOR])










[Libreoffice-commits] core.git: download.lst sw/qa

2022-04-03 Thread László Németh (via logerrit)
 download.lst|4 ++--
 sw/qa/extras/uiwriter/uiwriter6.cxx |   35 +++
 2 files changed, 37 insertions(+), 2 deletions(-)

New commits:
commit d925d1ca9e03863650dd3e450331598624f21724
Author: László Németh 
AuthorDate: Fri Apr 1 08:47:38 2022 +0200
Commit: Adolfo Jayme Barrientos 
CommitDate: Mon Apr 4 03:02:57 2022 +0200

tdf#147546 bump libnumbertext to 1.0.10

fixing only regression of hu_Hung
transliteration of punctuation marks.
Add unit test for the fix.

Regression from commit 98fd4fcdc61202846e0957cb6aaed9e4a2d2c520
"tdf#136368 bump to libnumbertext 1.0.8".

Change-Id: I7b49467943c97582dba0e5aca20c02a92c43deff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132395
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/download.lst b/download.lst
index 2dc6f7af7b0b..1a7fb47063a5 100644
--- a/download.lst
+++ b/download.lst
@@ -158,8 +158,8 @@ export LIBGPGERROR_SHA256SUM := 
a9ab83ca7acc442a5bd846a75b920285ff79bdb4e3d34aa3
 export LIBGPGERROR_TARBALL := libgpg-error-1.43.tar.bz2
 export LIBLANGTAG_SHA256SUM := 
1f12a20a02ec3a8d22e54dedb8b683a43c9c160bda1ba337bf1060607ae733bd
 export LIBLANGTAG_TARBALL := liblangtag-0.6.3.tar.bz2
-export LIBNUMBERTEXT_SHA256SUM := 
db9060d208501bd7bc06300a55d8489d29dd560ee0fbbd0f41b78af56816680c
-export LIBNUMBERTEXT_TARBALL := libnumbertext-1.0.8.tar.xz
+export LIBNUMBERTEXT_SHA256SUM := 
a285573864eaac8d36a0f66d946e9b1d3cf01c5d93d31fda00264a76f2633beb
+export LIBNUMBERTEXT_TARBALL := libnumbertext-1.0.10.tar.xz
 export LIBTOMMATH_SHA256SUM := 
083daa92d8ee6f4af96a6143b12d7fc8fe1a547e14f862304f7281f8f7347483
 export LIBTOMMATH_TARBALL := ltm-1.0.zip
 export LIBWEBP_SHA256SUM := 
808b98d2f5b84e9b27fdef6c5372dac769c3bda4502febbfa5031bd3c4d7d018
diff --git a/sw/qa/extras/uiwriter/uiwriter6.cxx 
b/sw/qa/extras/uiwriter/uiwriter6.cxx
index a9fa0858548a..68c67d31f67f 100644
--- a/sw/qa/extras/uiwriter/uiwriter6.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter6.cxx
@@ -1732,6 +1732,41 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf133589)
 pWrtShell->AutoCorrect(corr, ' ');
 sReplaced += u"𐳺𐳺𐳿𐳼𐳼 ";
 CPPUNIT_ASSERT_EQUAL(sReplaced, 
static_cast(pDoc->GetNodes()[nIndex])->GetText());
+
+// tdf#147546 transliterate punctuation marks
+
+// question mark
+pWrtShell->Insert(u"Kérdőjel");
+pWrtShell->AutoCorrect(corr, '?');
+sReplaced += u"𐲓𐳋𐳢𐳇𐳟𐳒𐳉𐳖";
+OUString sReplaced2(sReplaced + "?");
+CPPUNIT_ASSERT_EQUAL(sReplaced2, 
static_cast(pDoc->GetNodes()[nIndex])->GetText());
+pWrtShell->AutoCorrect(corr, ' ');
+sReplaced += u"⸮ ";
+CPPUNIT_ASSERT_EQUAL(sReplaced, 
static_cast(pDoc->GetNodes()[nIndex])->GetText());
+// comma
+pWrtShell->Insert(u"Vessző");
+pWrtShell->AutoCorrect(corr, ',');
+sReplaced += u"𐲮𐳉𐳥𐳥𐳟";
+sReplaced2 = sReplaced + ",";
+CPPUNIT_ASSERT_EQUAL(sReplaced2, 
static_cast(pDoc->GetNodes()[nIndex])->GetText());
+pWrtShell->AutoCorrect(corr, ' ');
+sReplaced += u"⹁ ";
+CPPUNIT_ASSERT_EQUAL(sReplaced, 
static_cast(pDoc->GetNodes()[nIndex])->GetText());
+// semicolon
+pWrtShell->Insert(u"pontosvessző");
+pWrtShell->AutoCorrect(corr, ';');
+sReplaced += u"𐳠𐳛𐳙𐳦𐳛𐳤𐳮𐳉𐳥𐳥𐳟";
+sReplaced2 = sReplaced + ";";
+CPPUNIT_ASSERT_EQUAL(sReplaced2, 
static_cast(pDoc->GetNodes()[nIndex])->GetText());
+pWrtShell->AutoCorrect(corr, ' ');
+sReplaced += u"⁏ ";
+CPPUNIT_ASSERT_EQUAL(sReplaced, 
static_cast(pDoc->GetNodes()[nIndex])->GetText());
+// quotation marks
+pWrtShell->Insert(u"„idézőjel”");
+pWrtShell->AutoCorrect(corr, ' ');
+sReplaced += u"⹂𐳐𐳇𐳋𐳯𐳟𐳒𐳉𐳖‟ ";
+CPPUNIT_ASSERT_EQUAL(sReplaced, 
static_cast(pDoc->GetNodes()[nIndex])->GetText());
 }
 
 CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf143176)


[Libreoffice-commits] core.git: sc/inc sc/qa sc/source

2022-04-03 Thread Tomaž Vajngerl (via logerrit)
 sc/inc/document.hxx  |2 +-
 sc/inc/table.hxx |2 +-
 sc/qa/unit/SparklineImportExportTest.cxx |   12 ++--
 sc/qa/unit/SparklineTest.cxx |   10 +-
 sc/source/core/data/document.cxx |4 ++--
 sc/source/core/data/table2.cxx   |   11 ---
 sc/source/ui/view/cellsh.cxx |4 ++--
 sc/source/ui/view/output.cxx |4 ++--
 8 files changed, 23 insertions(+), 26 deletions(-)

New commits:
commit 413f144e84629fe8f3bae5d984b40228fdeec5c1
Author: Tomaž Vajngerl 
AuthorDate: Sat Mar 19 10:56:27 2022 +0900
Commit: Tomaž Vajngerl 
CommitDate: Mon Apr 4 04:20:21 2022 +0200

sc: change GetSparkline to return a shared_ptr instead of raw ptr

Change-Id: If3d7b3ad4b96eb7d3b126ee8b130f8d5e684cd3c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132472
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 420c0eb06e35..979f6d6985f1 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -1249,7 +1249,7 @@ public:
 sc::MultiDataCellState HasMultipleDataCells( const ScRange& rRange ) const;
 
 /** Spaklines */
-SC_DLLPUBLIC sc::Sparkline* GetSparkline(ScAddress const & rPosition);
+SC_DLLPUBLIC std::shared_ptr GetSparkline(ScAddress const & 
rPosition);
 SC_DLLPUBLIC sc::Sparkline* CreateSparkline(ScAddress const & rPosition, 
std::shared_ptr const& pSparklineGroup);
 SC_DLLPUBLIC sc::SparklineList* GetSparklineList(SCTAB nTab);
 SC_DLLPUBLIC bool DeleteSparkline(ScAddress const& rPosition);
diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx
index 00ae196f88ab..14eb33fa50f7 100644
--- a/sc/inc/table.hxx
+++ b/sc/inc/table.hxx
@@ -472,7 +472,7 @@ public:
 
 // Sparklines
 
-sc::Sparkline* GetSparkline(SCCOL nCol, SCROW nRow);
+std::shared_ptr GetSparkline(SCCOL nCol, SCROW nRow);
 sc::Sparkline* CreateSparkline(SCCOL nCol, SCROW nRow, 
std::shared_ptr const& pSparklineGroup);
 bool DeleteSparkline(SCCOL nCol, SCROW nRow);
 
diff --git a/sc/qa/unit/SparklineImportExportTest.cxx 
b/sc/qa/unit/SparklineImportExportTest.cxx
index fe15d783b58e..25af95c8770e 100644
--- a/sc/qa/unit/SparklineImportExportTest.cxx
+++ b/sc/qa/unit/SparklineImportExportTest.cxx
@@ -57,7 +57,7 @@ void checkSparklines(ScDocument& rDocument)
 {
 // Sparkline at Sheet1:A2
 {
-sc::Sparkline* pSparkline = rDocument.GetSparkline(ScAddress(0, 1, 
0)); // A2
+auto pSparkline = rDocument.GetSparkline(ScAddress(0, 1, 0)); // A2
 CPPUNIT_ASSERT(pSparkline);
 auto pSparklineGroup = pSparkline->getSparklineGroup();
 CPPUNIT_ASSERT_EQUAL(sc::SparklineType::Line, 
pSparklineGroup->m_eType);
@@ -90,7 +90,7 @@ void checkSparklines(ScDocument& rDocument)
 }
 // Sparkline at Sheet1:A3
 {
-sc::Sparkline* pSparkline = rDocument.GetSparkline(ScAddress(0, 2, 
0)); // A3
+auto pSparkline = rDocument.GetSparkline(ScAddress(0, 2, 0)); // A3
 CPPUNIT_ASSERT(pSparkline);
 auto pSparklineGroup = pSparkline->getSparklineGroup();
 CPPUNIT_ASSERT_EQUAL(sc::SparklineType::Column, 
pSparklineGroup->m_eType);
@@ -123,28 +123,28 @@ void checkSparklines(ScDocument& rDocument)
 }
 // Sparkline at Sheet2:B1
 {
-sc::Sparkline* pSparkline = rDocument.GetSparkline(ScAddress(1, 0, 
1)); //B1
+auto pSparkline = rDocument.GetSparkline(ScAddress(1, 0, 1)); //B1
 CPPUNIT_ASSERT(pSparkline);
 auto pSparklineGroup = pSparkline->getSparklineGroup();
 CPPUNIT_ASSERT_EQUAL(sc::SparklineType::Column, 
pSparklineGroup->m_eType);
 }
 // Sparkline at Sheet2:B2
 {
-sc::Sparkline* pSparkline = rDocument.GetSparkline(ScAddress(1, 1, 
1)); //B2
+auto pSparkline = rDocument.GetSparkline(ScAddress(1, 1, 1)); //B2
 CPPUNIT_ASSERT(pSparkline);
 auto pSparklineGroup = pSparkline->getSparklineGroup();
 CPPUNIT_ASSERT_EQUAL(sc::SparklineType::Line, 
pSparklineGroup->m_eType);
 }
 // Sparkline at Sheet2:B2
 {
-sc::Sparkline* pSparkline = rDocument.GetSparkline(ScAddress(1, 1, 
1)); //B2
+auto pSparkline = rDocument.GetSparkline(ScAddress(1, 1, 1)); //B2
 CPPUNIT_ASSERT(pSparkline);
 auto pSparklineGroup = pSparkline->getSparklineGroup();
 CPPUNIT_ASSERT_EQUAL(sc::SparklineType::Line, 
pSparklineGroup->m_eType);
 }
 // Sparkline doesn't exists at A4
 {
-sc::Sparkline* pSparkline = rDocument.GetSparkline(ScAddress(0, 3, 
0)); //A4
+auto pSparkline = rDocument.GetSparkline(ScAddress(0, 3, 0)); //A4
 CPPUNIT_ASSERT(!pSparkline);
 }
 }
diff --git a/sc/qa/unit/SparklineTest.cxx b/sc/qa/unit/SparklineTest.cxx
index 74f40579d99f..2a2dfde71b5b 100644
--- a/sc/qa/unit/SparklineTest.cxx
+++ b/sc/qa/unit/SparklineTest.cxx
@@ -82,13 +82,13 @@ void SparklineTest::testAddSparkli

Re: autogen.sh error

2022-04-03 Thread Ilmari Lauhakangas

On 3.4.2022 19.23, 徐恩华 wrote:

Hello everyone,
there is some error, when I try build on macos 12.3 with apple M1 pro.  
I have installed autoconf、automake and libtool, but some errors occours 
when run autogen.sh .


It sounds like you did not follow the lode method: 
https://wiki.documentfoundation.org/Development/lode


Maybe you should try it. Be sure to do the changes in ~/.zprofile

Ilmari


[Libreoffice-commits] core.git: sw/qa sw/source

2022-04-03 Thread Caolán McNamara (via logerrit)
 sw/qa/extras/layout/data/forcepoint99.html |binary
 sw/qa/extras/layout/layout.cxx |6 ++
 sw/source/core/text/itrform2.cxx   |   15 +++
 sw/source/core/text/itrform2.hxx   |2 ++
 sw/source/core/text/porlay.cxx |4 +++-
 5 files changed, 22 insertions(+), 5 deletions(-)

New commits:
commit b46baea4d1cce81c56ee0d82fbdc352921445fa7
Author: Caolán McNamara 
AuthorDate: Fri Apr 1 16:52:06 2022 +0100
Commit: Miklos Vajna 
CommitDate: Mon Apr 4 08:25:50 2022 +0200

forcepoint#99 SwTextFormatter unaware that FirstOfBorderMerge was deleted

READ of size 8 at 0x606000a49e50 thread T0
#0 0x7f7ab6214bf5 in SwPosSize::Height() const 
/home/caolan/LibreOffice/core-asan/sw/source/core/text/possiz.hxx:49:37
#1 0x7f7ab636c311 in 
SwTextFormatter::MergeCharacterBorder(SwLinePortion&, SwLinePortion const*, 
SwTextFormatInfo&) 
/home/caolan/LibreOffice/core-asan/sw/source/core/text/itrform2.cxx:2807:43
#2 0x7f7ab636ae08 in SwTextFormatter::InsertPortion(SwTextFormatInfo&, 
SwLinePortion*) 
/home/caolan/LibreOffice/core-asan/sw/source/core/text/itrform2.cxx:354:13
#3 0x7f7ab6371db1 in SwTextFormatter::BuildPortions(SwTextFormatInfo&) 
/home/caolan/LibreOffice/core-asan/sw/source/core/text/itrform2.cxx:709:9
#4 0x7f7ab638b2ac in SwTextFormatter::FormatLine(o3tl::strong_int) 
/home/caolan/LibreOffice/core-asan/sw/source/core/text/itrform2.cxx:1701:9
#5 0x7f7ab62a8ad1 in SwTextFrame::FormatLine(SwTextFormatter&, bool) 
/home/caolan/LibreOffice/core-asan/sw/source/core/text/frmform.cxx:1212:44
#6 0x7f7ab62af1cc in SwTextFrame::Format_(SwTextFormatter&, 
SwTextFormatInfo&, bool) 
/home/caolan/LibreOffice/core-asan/sw/source/core/text/frmform.cxx:1571:23
#7 0x7f7ab62b1f17 in SwTextFrame::Format_(OutputDevice*, 
SwParaPortion*) 
/home/caolan/LibreOffice/core-asan/sw/source/core/text/frmform.cxx:1743:5
#8 0x7f7ab62b5260 in SwTextFrame::Format(OutputDevice*, SwBorderAttrs 
const*) 
/home/caolan/LibreOffice/core-asan/sw/source/core/text/frmform.cxx:1932:17
#9 0x7f7ab5dbdabd in SwContentFrame::MakeAll(OutputDevice*) 
/home/caolan/LibreOffice/core-asan/sw/source/core/layout/calcmove.cxx:1514:17

0x606000a49e50 is located 16 bytes inside of 56-byte region 
[0x606000a49e40,0x606000a49e78)
freed by thread T0 here:
#0 0x4fe1f7 in operator delete(void*) 
(/home/caolan/LibreOffice/core-asan/instdir/program/soffice.bin+0x4fe1f7)
#1 0x7f7ab6486d35 in SwTextPortion::~SwTextPortion() 
/home/caolan/LibreOffice/core-asan/sw/source/core/text/portxt.hxx:26:7
#2 0x7f7ab63da0c9 in SwLineLayout::CalcLine(SwTextFormatter&, 
SwTextFormatInfo&) 
/home/caolan/LibreOffice/core-asan/sw/source/core/text/porlay.cxx:430:21
#3 0x7f7ab6435413 in SwMultiPortion::CalcSize(SwTextFormatter&, 
SwTextFormatInfo&) 
/home/caolan/LibreOffice/core-asan/sw/source/core/text/pormulti.cxx:75:15
#4 0x7f7ab6457749 in 
SwTextFormatter::BuildMultiPortion(SwTextFormatInfo&, SwMultiPortion&) 
/home/caolan/LibreOffice/core-asan/sw/source/core/text/pormulti.cxx:2090:16
#5 0x7f7ab636f12c in SwTextFormatter::BuildPortions(SwTextFormatInfo&) 
/home/caolan/LibreOffice/core-asan/sw/source/core/text/itrform2.cxx:550:21
#6 0x7f7ab638b2ac in SwTextFormatter::FormatLine(o3tl::strong_int) 
/home/caolan/LibreOffice/core-asan/sw/source/core/text/itrform2.cxx:1701:9
#7 0x7f7ab62a8ad1 in SwTextFrame::FormatLine(SwTextFormatter&, bool) 
/home/caolan/LibreOffice/core-asan/sw/source/core/text/frmform.cxx:1212:44
#8 0x7f7ab62af1cc in SwTextFrame::Format_(SwTextFormatter&, 
SwTextFormatInfo&, bool) 
/home/caolan/LibreOffice/core-asan/sw/source/core/text/frmform.cxx:1571:23
#9 0x7f7ab62b1f17 in SwTextFrame::Format_(OutputDevice*, 
SwParaPortion*) 
/home/caolan/LibreOffice/core-asan/sw/source/core/text/frmform.cxx:1743:5
#10 0x7f7ab62b5260 in SwTextFrame::Format(OutputDevice*, SwBorderAttrs 
const*) 
/home/caolan/LibreOffice/core-asan/sw/source/core/text/frmform.cxx:1932:17
#11 0x7f7ab5dbdabd in SwContentFrame::MakeAll(OutputDevice*) 
/home/caolan/LibreOffice/core-asan/sw/source/core/layout/calcmove.cxx:1514:17

similar seen in the past as:

commit 96acebb72211b4718eb3038c427df37b55b17b0b
Date:   Tue May 14 01:49:03 2019 +0800

tdf#124937 reset m_pFirstOfBorderMerge before truncate.

commit ecd855794b22c0f7e6fb2f362b566c4d9c5f624a
Date:   Mon Jan 15 22:29:31 2018 +0100

tdf#114536 sw: fix use-after-free in 
SwTextFormatter::MergeCharacterBorder()

Change-Id: Iad855f382a0daf50dac2537d4a91bfeaa9ff3799
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132439
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 

diff --git a/sw/qa/extras/layout/data/forcepoint99.html 
b/sw/qa/extras/layout/data/forcepoint99.html
new file mode 100644
index ..6eb36a616e26
Bina

New Defects reported by Coverity Scan for LibreOffice

2022-04-03 Thread scan-admin
Hi,

Please find the latest report on new defect(s) introduced to LibreOffice found 
with Coverity Scan.

1 new defect(s) introduced to LibreOffice found with Coverity Scan.
4 defect(s), reported by Coverity Scan earlier, were marked fixed in the recent 
build analyzed by Coverity Scan.

New defect(s) Reported-by: Coverity Scan
Showing 1 of 1 defect(s)


** CID 1503776:  Null pointer dereferences  (FORWARD_NULL)



*** CID 1503776:  Null pointer dereferences  (FORWARD_NULL)
/sw/source/core/doc/doctxm.cxx: 950 in SwTOXBaseSection::Update(const 
SfxItemSet *, const SwRootFrame *, bool)()
944 const_cast(pSectNd)->DelFrames();
945 
946 // This would be a good time to update the Numbering
947 rDoc.UpdateNumRule();
948 
949 if( GetCreateType() & SwTOXElement::Mark )
>>> CID 1503776:  Null pointer dereferences  (FORWARD_NULL)
>>> Passing null pointer "pOwnChapterNode" to "UpdateMarks", which 
>>> dereferences it.
950 UpdateMarks( aIntl, pOwnChapterNode, pLayout );
951 
952 if( GetCreateType() & SwTOXElement::OutlineLevel )
953 UpdateOutline( pOwnChapterNode, pLayout );
954 
955 if( GetCreateType() & SwTOXElement::Template )



To view the defects in Coverity Scan visit, 
https://u15810271.ct.sendgrid.net/ls/click?upn=HRESupC-2F2Czv4BOaCWWCy7my0P0qcxCbhZ31OYv50ypSs1kiFPuCn2xFdlMIFBirii0zZ9j2-2F9F2XPBcBm2BNgi9duPy3v-2FzgFDd2LJ-2BDKI-3DdMpA_OTq2XUZbbipYjyLSo6GRo-2FpVxQ9OzkDINu9UTS-2FQhSdO0F0jQniitrGlNxDIzPJi0ZQgbs0gB9SLdoJTGYbzKUhXkVBARAt2g81Sgh5yeqTwdcqyLp7nb43tn0o-2Fsa31GnkDTMyXYY3mObPIKaLJw7YuDvVwUMNHlXbTIKof7izda6ouN3duLZcuFOl11Lbo3HZx-2Fpwu2cjEw6yarnqkqLanY27Po-2BHia8iKmipHRqk-3D