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

2022-03-16 Thread Justin Luth (via logerrit)
 sw/source/core/table/swtable.cxx |   11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)

New commits:
commit 6ba3c85aad33ad3eded935185686dfcaaa7fcaa8
Author: Justin Luth 
AuthorDate: Tue Mar 15 21:13:01 2022 +0200
Commit: Justin Luth 
CommitDate: Thu Mar 17 06:36:18 2022 +0100

tdf#119298 sw: keep automatic position on trivial width change

The issue here was that simply moving the border around
(which shouldn't change the table size at all)
triggered a miniscule difference in reported table width.

Well, that is not enough reason to change away from automatic
positioning now is it?

Change-Id: Ib40c50a1069d88fa22f4791366eb0a50b4e9b11d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131633
Tested-by: Jenkins
Reviewed-by: Justin Luth 

diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx
index ec6487028790..7f2b5aef976c 100644
--- a/sw/source/core/table/swtable.cxx
+++ b/sw/source/core/table/swtable.cxx
@@ -872,7 +872,16 @@ void SwTable::SetTabCols( const SwTabCols , const 
SwTabCols ,
 else if(!bLeftDist && rNew.GetRight() + nShRight < 
rNew.GetRightMax())
 aOri.SetHoriOrient( text::HoriOrientation::LEFT );
 else
-aOri.SetHoriOrient( text::HoriOrientation::LEFT_AND_WIDTH 
);
+{
+// if an automatic table hasn't (really) changed size, 
then leave it as auto.
+const tools::Long nOldWidth = rOld.GetRight() - 
rOld.GetLeft();
+const tools::Long nNewWidth = rNew.GetRight() - 
rNew.GetLeft();
+if (aOri.GetHoriOrient() != text::HoriOrientation::FULL
+|| std::abs(nOldWidth - nNewWidth) > COLFUZZY)
+{
+
aOri.SetHoriOrient(text::HoriOrientation::LEFT_AND_WIDTH);
+}
+}
 }
 pFormat->SetFormatAttr( aOri );
 }


[Libreoffice-commits] core.git: Branch 'distro/lhm/libreoffice-6-4+backports' - sw/qa sw/source

2022-03-16 Thread Justin Luth (via logerrit)
 sw/qa/extras/ooxmlexport/data/tdf98000_changePageStyle.odt |binary
 sw/qa/extras/ooxmlexport/ooxmlexport15.cxx |   13 +
 sw/source/filter/ww8/docxattributeoutput.cxx   |4 ++--
 sw/source/filter/ww8/wrtww8.cxx|1 -
 sw/source/filter/ww8/wrtww8.hxx|3 +--
 sw/source/filter/ww8/ww8atr.cxx|   11 ++-
 6 files changed, 18 insertions(+), 14 deletions(-)

New commits:
commit 1433ed1347407d07ff0410d1749eeed465c5ad28
Author: Justin Luth 
AuthorDate: Tue Jul 21 21:02:44 2020 +0300
Commit: Thorsten Behrens 
CommitDate: Wed Mar 16 13:36:55 2022 +0100

tdf#98000 docx export: blank paragraphs don't affect page breaks

Umm, how could that ever have possibly made sense? And why wasn't
it found and fixed earlier?

This goes way back to when first/follow page styles were
first being handled in tdf#66145, where a blank line skipped
calling OutputSectionBreak.

Then in LO 4.3, tdf#74566 adjusted that a bit more, and tdf#77890
decided to do the same thing for a previous blank line.
These all have unit tests to "prove" it too.

But none of that makes any sense, and by reverting all of that
garbage, all the unit tests still pass.  I also looked at the
original bug documents, and they also look fine after the
revert. So I think it is safe to kill this nonsense,
but I don't plan to backport it, just in case...

Change-Id: I4aaca0435fbf030fe9c3113b068ea3370eccd889
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99171
Tested-by: Jenkins
Reviewed-by: Justin Luth 
Reviewed-by: Miklos Vajna 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131653
Tested-by: Thorsten Behrens 
Reviewed-by: Thorsten Behrens 

diff --git a/sw/qa/extras/ooxmlexport/data/tdf98000_changePageStyle.odt 
b/sw/qa/extras/ooxmlexport/data/tdf98000_changePageStyle.odt
new file mode 100644
index ..95f65e919fb6
Binary files /dev/null and 
b/sw/qa/extras/ooxmlexport/data/tdf98000_changePageStyle.odt differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
index 5aff15ca6f5d..95359aebf820 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
@@ -35,6 +35,19 @@ DECLARE_OOXMLEXPORT_TEST(testTdf14_followPgStyle, 
"tdf14_followPgStyle.o
 CPPUNIT_ASSERT_EQUAL(2, getPages());
 }
 
+DECLARE_OOXMLEXPORT_TEST(testTdf98000_changePageStyle, 
"tdf98000_changePageStyle.odt")
+{
+uno::Reference xModel(mxComponent, uno::UNO_QUERY);
+uno::Reference 
xTextViewCursorSupplier(xModel->getCurrentController(), uno::UNO_QUERY);
+
+uno::Reference 
xCursor(xTextViewCursorSupplier->getViewCursor(), uno::UNO_QUERY_THROW);
+OUString sPageOneStyle = getProperty( xCursor, "PageStyleName" );
+
+xCursor->jumpToNextPage();
+OUString sPageTwoStyle = getProperty( xCursor, "PageStyleName" );
+CPPUNIT_ASSERT_MESSAGE("Different page1/page2 styles", sPageOneStyle != 
sPageTwoStyle);
+}
+
 DECLARE_OOXMLIMPORT_TEST(testTdf131801, "tdf131801.docx")
 {
 CPPUNIT_ASSERT_EQUAL(1, getPages());
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 40256891d509..912feef0816a 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -1175,7 +1175,7 @@ void DocxAttributeOutput::SectionBreaks(const SwNode& 
rNode)
 if (aNextIndex.GetNode().IsTextNode())
 {
 const SwTextNode* pTextNode = 
static_cast(());
-m_rExport.OutputSectionBreaks(pTextNode->GetpSwAttrSet(), 
*pTextNode, m_tableReference->m_bTableCellOpen, pTextNode->GetText().isEmpty());
+m_rExport.OutputSectionBreaks(pTextNode->GetpSwAttrSet(), 
*pTextNode, m_tableReference->m_bTableCellOpen);
 }
 else if (aNextIndex.GetNode().IsTableNode())
 {
@@ -1192,7 +1192,7 @@ void DocxAttributeOutput::SectionBreaks(const SwNode& 
rNode)
 // Also handle section endings
 const SwTextNode* pTextNode = aNextIndex.GetNode().GetTextNode();
 if (rNode.StartOfSectionNode()->IsTableNode() || 
rNode.StartOfSectionNode()->IsSectionNode())
-m_rExport.OutputSectionBreaks(pTextNode->GetpSwAttrSet(), 
*pTextNode, m_tableReference->m_bTableCellOpen, pTextNode->GetText().isEmpty());
+m_rExport.OutputSectionBreaks(pTextNode->GetpSwAttrSet(), 
*pTextNode, m_tableReference->m_bTableCellOpen);
 }
 }
 }
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index 8d4add7b34bf..86899e1dba88 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -3673,7 +3673,6 @@ MSWordExportBase::MSWordExportBase( SwDoc *pDocument, 
std::shared_ptr m_aImplicitBookmarks;
 

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

2022-03-16 Thread Justin Luth (via logerrit)
 chart2/qa/extras/chart2export.cxx|   18 ++
 chart2/qa/extras/data/docx/TableOnPage3.docx |binary
 chart2/source/tools/InternalDataProvider.cxx |8 ++--
 3 files changed, 24 insertions(+), 2 deletions(-)

New commits:
commit cfd82e7a2cc2b45b738eb0efa0827196d2de61a4
Author: Justin Luth 
AuthorDate: Fri Mar 4 07:57:31 2022 +0200
Commit: Justin Luth 
CommitDate: Wed Mar 16 10:28:42 2022 +0100

tdf#128747 chart2: don't overwrite labels

In almost every case, the values of a labeledDataSequence
create a new column, and therefore the label is attached
to the last column.

However, in the case where there are no values at all,
then this function is not called (for the value portion),
resulting in no new column being created,
and thus the label overwrote the previous series label.

Empty-value columns are excluded in later code,
so perhaps we shouldn't addDataSequenceToMap either,
but I don't know the implications of that.

Change-Id: Iad4ab54552b3c6b144feb2bc223ddae538316fa7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130946
Tested-by: Jenkins
Reviewed-by: Justin Luth 

diff --git a/chart2/qa/extras/chart2export.cxx 
b/chart2/qa/extras/chart2export.cxx
index bca7897025a0..c333ab9d651e 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -119,6 +119,7 @@ public:
 void testPlotVisOnlyXLSX();
 void testBarChartVaryColorsXLSX();
 void testTdf96161();
+void testTableOnPage3();
 void testMultipleAxisXLSX();
 void testSecondaryAxisXLSX();
 void testBarChartSecondaryAxisXLSX();
@@ -213,6 +214,7 @@ public:
 CPPUNIT_TEST(testPlotVisOnlyXLSX);
 CPPUNIT_TEST(testBarChartVaryColorsXLSX);
 CPPUNIT_TEST(testTdf96161);
+CPPUNIT_TEST(testTableOnPage3);
 CPPUNIT_TEST(testMultipleAxisXLSX);
 CPPUNIT_TEST(testSecondaryAxisXLSX);
 CPPUNIT_TEST(testBarChartSecondaryAxisXLSX);
@@ -1900,6 +1902,22 @@ void Chart2ExportTest::testTdf96161()
 assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:varyColors", "val", "0");
 }
 
+void Chart2ExportTest::testTableOnPage3()
+{
+load(u"/chart2/qa/extras/data/docx/", "TableOnPage3.docx");
+reload("Office Open XML Text");
+
+Reference xChartDoc(getChartDocFromWriter(0), 
uno::UNO_QUERY);
+CPPUNIT_ASSERT(xChartDoc.is());
+uno::Reference< chart::XChartDataArray > 
xDataArray(xChartDoc->getDataProvider(), UNO_QUERY_THROW);
+Sequence aColumnDesc = xDataArray->getColumnDescriptions();
+CPPUNIT_ASSERT_EQUAL_MESSAGE("There must be 4 columns and descriptions", 
static_cast(4), aColumnDesc.getLength());
+CPPUNIT_ASSERT_EQUAL(OUString("If oversubscription relative to allowance 
increases at the same average rate B15-B17"), aColumnDesc[0]);
+CPPUNIT_ASSERT_EQUAL(OUString("Known requirements"), aColumnDesc[1]);
+CPPUNIT_ASSERT_EQUAL(OUString("Allowance"), aColumnDesc[2]);
+CPPUNIT_ASSERT_EQUAL(OUString("If oversubscription relative to allowance 
holds steady at average oversubscription level B15-B17"), aColumnDesc[3]);
+}
+
 void Chart2ExportTest::testMultipleAxisXLSX()
 {
 load(u"/chart2/qa/extras/data/ods/", "multiple_axis.ods");
diff --git a/chart2/qa/extras/data/docx/TableOnPage3.docx 
b/chart2/qa/extras/data/docx/TableOnPage3.docx
new file mode 100644
index ..79763bd35290
Binary files /dev/null and b/chart2/qa/extras/data/docx/TableOnPage3.docx differ
diff --git a/chart2/source/tools/InternalDataProvider.cxx 
b/chart2/source/tools/InternalDataProvider.cxx
index e1bf32b7ff10..6fe4ec94a8db 100644
--- a/chart2/source/tools/InternalDataProvider.cxx
+++ b/chart2/source/tools/InternalDataProvider.cxx
@@ -647,8 +647,12 @@ InternalDataProvider::createDataSequenceFromArray( const 
OUString& rArrayStr, st
 sal_Int32 nColSize = m_aInternalData.getColumnCount();
 if (!aRawElems.empty() && nColSize)
 {
-std::vector aLabels(1, uno::Any(aRawElems[0]));
-m_aInternalData.setComplexColumnLabel(nColSize-1, 
std::move(aLabels));
+// Do not overwrite an existing label (attempted by series with no 
data values)
+if 
(!m_aInternalData.getComplexColumnLabel(nColSize-1)[0].hasValue())
+{
+std::vector aLabels(1, uno::Any(aRawElems[0]));
+m_aInternalData.setComplexColumnLabel(nColSize-1, 
std::move(aLabels));
+}
 
 OUString aRangeRep = lcl_aLabelRangePrefix + 
OUString::number(nColSize-1);
 xSeq.set(new UncachedDataSequence(this, aRangeRep));


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

2022-03-06 Thread Justin Luth (via logerrit)
 oox/source/ppt/pptshape.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 05502f78ed0d406ff50d43a39c05f7bb990001e9
Author: Justin Luth 
AuthorDate: Fri Feb 11 18:47:11 2022 +0200
Commit: Adolfo Jayme Barrientos 
CommitDate: Sun Mar 6 08:59:49 2022 +0100

link bug report to "likely wrong" comment

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

diff --git a/oox/source/ppt/pptshape.cxx b/oox/source/ppt/pptshape.cxx
index 6c12e1f3dd64..92b61176d0c1 100644
--- a/oox/source/ppt/pptshape.cxx
+++ b/oox/source/ppt/pptshape.cxx
@@ -686,7 +686,8 @@ namespace
 }
 
 // Function to find placeholder (ph) for a shape. No idea how MSO implements 
this, but
-// this order seems to work quite well (probably it's unnecessary complicated 
/ wrong):
+// this order seems to work quite well
+// (probably it's unnecessary complicated / wrong. i.e. tdf#104202):
 // 1. ph with nFirstSubType and the same oSubTypeIndex
 // 2. ph with nFirstSubType
 // 3. ph with nSecondSubType and the same oSubTypeIndex


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

2022-03-03 Thread Justin Luth (via logerrit)
 svx/source/table/tablelayouter.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit c1b2ed31cbde0a81853ba4fe59841cded6c52105
Author: Justin Luth 
AuthorDate: Tue Feb 8 09:04:47 2022 +0200
Commit: Justin Luth 
CommitDate: Fri Mar 4 06:16:05 2022 +0100

related tdf#144092 svx: warn about wrong "empty cell" idea

An empty cell is not irrelevant in making height decisions,
at least in MS file formats, and yet all of this code that
is being based on that wrong assumption is being done to
import ppt(x) files, and causing one regression after another.
[Worst of all, this isn't even a filter import codebase.]

Unfortunately the regressions have been dealt with
or discovered slowly, so some of this has been in place
for years. Otherwise I would revert this in a heartbeat.

At least throw in a warning, so that this seemingly
logical conclusion will at least be challenged by
the next bug-fixer - instead of building another
layer on this house of cards.

Change-Id: I0e984a7ecce5061224a4165c0ee61818348a9659
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129659
Tested-by: Jenkins
Reviewed-by: Justin Luth 

diff --git a/svx/source/table/tablelayouter.cxx 
b/svx/source/table/tablelayouter.cxx
index 0c517707f4f8..87bd4436e7f3 100644
--- a/svx/source/table/tablelayouter.cxx
+++ b/svx/source/table/tablelayouter.cxx
@@ -766,6 +766,11 @@ void TableLayouter::LayoutTableHeight( tools::Rectangle& 
rArea, bool bFit )
 }
 else
 {
+// WARNING: tdf#144092 / tdf#139511 suggest this entire 
section is invalid.
+// Empty cells should not be ignored in regards to row 
height,
+// especially MS formats, despite this code being added to 
import MS files...
+// The problem is getMinimumHeight can give wrong values 
for empty cells.
+
 bool bCellHasText = xCell->hasText();
 bool bCellInEditMode = xCell->IsTextEditActive();
 


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

2022-03-03 Thread Justin Luth (via logerrit)
 sc/source/core/data/dpcache.cxx |7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 268bddd26cc006a7b4a1f9142245aecbff51c173
Author: Justin Luth 
AuthorDate: Tue Mar 1 08:54:25 2022 +0200
Commit: Xisco Fauli 
CommitDate: Thu Mar 3 17:16:24 2022 +0100

tdf#118117 sc pivottable: STR_PIVOT_DATA is an existing name too

This fixes a LO 6.0 regression from
commit a078328e91ab9cbd78a92608c1abdc2c57ff9ac5

I looked for existing unit test examples using
assert (rLabel != ScResId(STR_PIVOT_DATA));
but found nothing.

I don't see the need for a unit test here.
The whole pivot table is messed up if you duplicate
a label, so why bother testing. It just is not
as bad now as it was before.

Change-Id: I59cc73becf91f766a29d2007c2d67685ffa2a65c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130751
Tested-by: Jenkins
Reviewed-by: Justin Luth 
(cherry picked from commit b7f654a406b704f469d1df424d83a3d98ae46432)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130784
Reviewed-by: Xisco Fauli 

diff --git a/sc/source/core/data/dpcache.cxx b/sc/source/core/data/dpcache.cxx
index d544fb884d9c..dba2b7a7ac36 100644
--- a/sc/source/core/data/dpcache.cxx
+++ b/sc/source/core/data/dpcache.cxx
@@ -356,9 +356,11 @@ void normalizeAddLabel(const OUString& rLabel, 
std::vector& rLabels, L
 
 std::vector normalizeLabels(const std::vector& 
rColData)
 {
-std::vector aLabels(1u, ScResId(STR_PIVOT_DATA));
+std::vector aLabels;
+aLabels.reserve(rColData.size() + 1);
 
 LabelSet aExistingNames;
+normalizeAddLabel(ScResId(STR_PIVOT_DATA), aLabels, aExistingNames);
 
 for (const InitColumnData& rCol : rColData)
 normalizeAddLabel(rCol.maLabel, aLabels, aExistingNames);
@@ -368,10 +370,11 @@ std::vector normalizeLabels(const 
std::vector& rColDat
 
 std::vector normalizeLabels(const ScDPCache::DBConnector& rDB, const 
sal_Int32 nLabelCount)
 {
-std::vector aLabels(1u, ScResId(STR_PIVOT_DATA));
+std::vector aLabels;
 aLabels.reserve(nLabelCount + 1);
 
 LabelSet aExistingNames;
+normalizeAddLabel(ScResId(STR_PIVOT_DATA), aLabels, aExistingNames);
 
 for (sal_Int32 nCol = 0; nCol < nLabelCount; ++nCol)
 {


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

2022-03-02 Thread Justin Luth (via logerrit)
 sc/qa/unit/data/xlsb/pivottable_error_item_filter.xlsb |binary
 sc/qa/unit/data/xlsx/tdf122471.xlsx|binary
 sc/qa/unit/pivottable_filters_test.cxx |   56 +
 sc/source/filter/inc/pivotcachebuffer.hxx  |2 
 sc/source/filter/oox/pivotcachebuffer.cxx  |   10 +--
 sc/source/filter/oox/pivotcachefragment.cxx|2 
 6 files changed, 63 insertions(+), 7 deletions(-)

New commits:
commit 789fbf732ad6db002fd83b307385940c392cc457
Author: Justin Luth 
AuthorDate: Mon Feb 28 15:36:08 2022 +0200
Commit: Eike Rathke 
CommitDate: Wed Mar 2 18:58:17 2022 +0100

tdf#122471 xlsx import: pivottable error OUString, not uInt8

This fixes a LO 6.0 regression from
commit 9fa34e9f2cebe2cfc551668f2a67ddcb799d3fb8
which only half-way changed to OUString from uInt8.

An exception was raised because in XLSX, an INT was written
while the corresponding read function was expecting an OUString.

However, doing this runs into problems with binary files (xlsb),
which were still setting the value to an int.
Unit test shows the need to use OUString for xlsb too,
which now matches what I see in Excel 2003.

make CppunitTest_sc_pivottable_filters_test \
  CPPUNIT_TEST_NAME=testPivotTableErrorItem2FilterXLSX

Change-Id: I399c9e34984bb1ff71695a87aa56f53063d37b3d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130714
Tested-by: Jenkins
Reviewed-by: Justin Luth 
(cherry picked from commit 6961f6732954742415413fa53bdeebd1b03d9ec5)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130678
Reviewed-by: Eike Rathke 

diff --git a/sc/qa/unit/data/xlsb/pivottable_error_item_filter.xlsb 
b/sc/qa/unit/data/xlsb/pivottable_error_item_filter.xlsb
new file mode 100644
index ..c32b8f3743e6
Binary files /dev/null and 
b/sc/qa/unit/data/xlsb/pivottable_error_item_filter.xlsb differ
diff --git a/sc/qa/unit/data/xlsx/tdf122471.xlsx 
b/sc/qa/unit/data/xlsx/tdf122471.xlsx
new file mode 100644
index ..febac5c73506
Binary files /dev/null and b/sc/qa/unit/data/xlsx/tdf122471.xlsx differ
diff --git a/sc/qa/unit/pivottable_filters_test.cxx 
b/sc/qa/unit/pivottable_filters_test.cxx
index 80557c5b12aa..f6507d6cfccf 100644
--- a/sc/qa/unit/pivottable_filters_test.cxx
+++ b/sc/qa/unit/pivottable_filters_test.cxx
@@ -79,6 +79,8 @@ public:
 void testPivotTableBoolFieldFilterXLSX();
 void testPivotTableRowColPageFieldFilterXLSX();
 void testPivotTableErrorItemFilterXLSX();
+void testPivotTableErrorItemFilterXLSB();
+void testPivotTableErrorItem2FilterXLSX();
 void testPivotTableOutlineModeXLSX();
 void testPivotTableDuplicatedMemberFilterXLSX();
 void testPivotTableTabularModeXLSX();
@@ -130,6 +132,8 @@ public:
 CPPUNIT_TEST(testPivotTableBoolFieldFilterXLSX);
 CPPUNIT_TEST(testPivotTableRowColPageFieldFilterXLSX);
 CPPUNIT_TEST(testPivotTableErrorItemFilterXLSX);
+CPPUNIT_TEST(testPivotTableErrorItemFilterXLSB);
+CPPUNIT_TEST(testPivotTableErrorItem2FilterXLSX);
 CPPUNIT_TEST(testPivotTableOutlineModeXLSX);
 CPPUNIT_TEST(testPivotTableDuplicatedMemberFilterXLSX);
 CPPUNIT_TEST(testPivotTableTabularModeXLSX);
@@ -2370,6 +2374,58 @@ void 
ScPivotTableFiltersTest::testPivotTableErrorItemFilterXLSX()
 xDocSh->DoClose();
 }
 
+void ScPivotTableFiltersTest::testPivotTableErrorItemFilterXLSB()
+{
+ScDocShellRef xDocSh = loadDoc(u"pivottable_error_item_filter.", 
FORMAT_XLSB);
+CPPUNIT_ASSERT_MESSAGE("Failed to load file", xDocSh.is());
+ScDocument& rDoc = xDocSh->GetDocument();
+ScDPCollection* pDPs = rDoc.GetDPCollection();
+CPPUNIT_ASSERT_EQUAL(static_cast(1), pDPs->GetCount());
+const ScDPObject* pDPObj = &(*pDPs)[0];
+CPPUNIT_ASSERT(pDPObj);
+ScDPSaveData* pSaveData = pDPObj->GetSaveData();
+CPPUNIT_ASSERT(pSaveData);
+
+ScDPSaveDimension* pSaveDim = pSaveData->GetExistingDimensionByName(u"b");
+CPPUNIT_ASSERT(pSaveDim);
+const ScDPSaveDimension::MemberList& rMembers = pSaveDim->GetMembers();
+CPPUNIT_ASSERT_EQUAL(size_t(4), rMembers.size());
+ScDPSaveMember* pMember = pSaveDim->GetExistingMemberByName("#DIV/0!");
+CPPUNIT_ASSERT(pMember);
+CPPUNIT_ASSERT(pMember->HasIsVisible());
+CPPUNIT_ASSERT(!pMember->GetIsVisible());
+
+xDocSh->DoClose();
+}
+
+void ScPivotTableFiltersTest::testPivotTableErrorItem2FilterXLSX()
+{
+ScDocShellRef xDocSh = loadDoc(u"tdf122471.", FORMAT_XLSX);
+CPPUNIT_ASSERT_MESSAGE("Failed to load file", xDocSh.is());
+ScDocument& rDoc = xDocSh->GetDocument();
+ScDPCollection* pDPs = rDoc.GetDPCollection();
+CPPUNIT_ASSERT_EQUAL(static_cast(1), pDPs->GetCount());
+
+// Reload and check whether filtering is preserved
+xDocSh = saveAndReload(&(*xDocSh), FORMAT_XLSX);
+CPPUNIT_ASSERT_MESSAGE("Failed to load file", xDocSh.is());
+ScDocument& rLoadedDoc = 

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

2022-03-02 Thread Justin Luth (via logerrit)
 sc/qa/unit/pivottable_filters_test.cxx |5 +++--
 sc/source/filter/excel/xestream.cxx|5 -
 sc/source/filter/oox/formulabuffer.cxx |7 +++
 3 files changed, 14 insertions(+), 3 deletions(-)

New commits:
commit e4f76cd9a4814ce6cc4795e5e1a5c74d54cb7513
Author: Justin Luth 
AuthorDate: Wed Feb 23 10:34:29 2022 +0200
Commit: Eike Rathke 
CommitDate: Wed Mar 2 13:05:22 2022 +0100

tdf#122098 xlsx im/export: let formulas guess their number format

SQUASHED backport: includes followup
  commit 5a64b618d84edb65465950d54e3b4afc952a301c

This fixes the import side of a LO 4.2 regression
from commit 07b66cd3ac1a9f6c7b61a1d7da6e9d266e6de92d
and the export side of a LO 4.3 regression
from commit 69ecdad805281b2cb6ec2437da18daa19576deae

make CppunitTest_sc_pivottable_filters_test \
  CPPUNIT_TEST_NAME=testPivotTableBoolFieldFilterXLSX

Change-Id: I4c680dbff844cf1eca52de641856daafa032eeb4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130406
Tested-by: Justin Luth 
Reviewed-by: Justin Luth 
(cherry picked from commit 8f5d8669ca74fed8608e438a8436c173e35d43a6)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130386
Tested-by: Jenkins
Reviewed-by: Eike Rathke 

diff --git a/sc/qa/unit/pivottable_filters_test.cxx 
b/sc/qa/unit/pivottable_filters_test.cxx
index 8ad8fbffee81..80557c5b12aa 100644
--- a/sc/qa/unit/pivottable_filters_test.cxx
+++ b/sc/qa/unit/pivottable_filters_test.cxx
@@ -2201,6 +2201,7 @@ void 
ScPivotTableFiltersTest::testPivotTableBoolFieldFilterXLSX()
 ScDocument& rDoc = xDocSh->GetDocument();
 ScDPCollection* pDPs = rDoc.GetDPCollection();
 CPPUNIT_ASSERT_EQUAL(static_cast(1), pDPs->GetCount());
+CPPUNIT_ASSERT_EQUAL(OUString("TRUE"), rDoc.GetString(ScAddress(0, 1, 
0))); //A2
 
 // Reload and check filtering of row dimensions
 xDocSh = saveAndReload(&(*xDocSh), FORMAT_XLSX);
@@ -2218,11 +2219,11 @@ void 
ScPivotTableFiltersTest::testPivotTableBoolFieldFilterXLSX()
 
 const ScDPSaveDimension::MemberList& rMembers = pSaveDim->GetMembers();
 CPPUNIT_ASSERT_EQUAL(size_t(2), rMembers.size());
-ScDPSaveMember* pMember = pSaveDim->GetExistingMemberByName("0");
+ScDPSaveMember* pMember = pSaveDim->GetExistingMemberByName("FALSE");
 CPPUNIT_ASSERT(pMember);
 CPPUNIT_ASSERT(pMember->HasIsVisible());
 CPPUNIT_ASSERT(!pMember->GetIsVisible());
-pMember = pSaveDim->GetExistingMemberByName("1");
+pMember = pSaveDim->GetExistingMemberByName("TRUE");
 CPPUNIT_ASSERT(pMember);
 CPPUNIT_ASSERT(pMember->HasIsVisible());
 CPPUNIT_ASSERT(pMember->GetIsVisible());
diff --git a/sc/source/filter/excel/xestream.cxx 
b/sc/source/filter/excel/xestream.cxx
index 17395145bbab..3b49c5d6b9e2 100644
--- a/sc/source/filter/excel/xestream.cxx
+++ b/sc/source/filter/excel/xestream.cxx
@@ -670,7 +670,10 @@ void XclXmlUtils::GetFormulaTypeAndValue( ScFormulaCell& 
rCell, const char*& rsT
 rsValue = ToOUString(lcl_GetErrorString(aResValue.mnError));
 break;
 case sc::FormulaResultValue::Value:
-rsType = "n";
+rsType = rCell.GetFormatType() == SvNumFormatType::LOGICAL
+ && (aResValue.mfValue == 0.0 || aResValue.mfValue 
== 1.0)
+ ? "b"
+ : "n";
 rsValue = OUString::number(aResValue.mfValue);
 break;
 case sc::FormulaResultValue::String:
diff --git a/sc/source/filter/oox/formulabuffer.cxx 
b/sc/source/filter/oox/formulabuffer.cxx
index 2aeccb1b37b7..7fcc4f5e259f 100644
--- a/sc/source/filter/oox/formulabuffer.cxx
+++ b/sc/source/filter/oox/formulabuffer.cxx
@@ -153,6 +153,9 @@ void applySharedFormulas(
 pCell = new ScFormulaCell(rDoc.getDoc(), aPos, *pArray);
 
 rDoc.setFormulaCell(aPos, pCell);
+if (rDoc.getDoc().GetNumberFormat(aPos.Col(), aPos.Row(), 
aPos.Tab()) % SV_COUNTRY_LANGUAGE_OFFSET == 0)
+pCell->SetNeedNumberFormat(true);
+
 if (rDesc.maCellValue.isEmpty())
 {
 // No cached cell value. Mark it for re-calculation.
@@ -227,6 +230,8 @@ void applyCellFormulas(
 pCell = new ScFormulaCell(rDoc.getDoc(), aPos, 
p->mpCell->GetCode()->Clone());
 
 rDoc.setFormulaCell(aPos, pCell);
+if (rDoc.getDoc().GetNumberFormat(aPos.Col(), aPos.Row(), 
aPos.Tab()) % SV_COUNTRY_LANGUAGE_OFFSET == 0)
+pCell->SetNeedNumberFormat(true);
 
 // Update the cache.
 p->mnRow = aPos.Row();
@@ -245,6 +250,8 @@ void applyCellFormulas(
 
 ScFormulaCell* pCell = new ScFormulaCell(rDoc.getDoc(), aPos, 
std::move(pCode));
 rDoc.setFormulaCell(aPos, pCell);
+if (rDoc.getDoc().GetNumberFormat(aPos.Col(), aPos.Row(), aPos.Tab()) 
% SV_COUNTRY_LANGUAGE_OFFSET == 0)
+pCell->SetNeedNumberFormat(true);
 

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

2022-03-01 Thread Justin Luth (via logerrit)
 sc/source/core/data/dpcache.cxx |7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit b7f654a406b704f469d1df424d83a3d98ae46432
Author: Justin Luth 
AuthorDate: Tue Mar 1 08:54:25 2022 +0200
Commit: Justin Luth 
CommitDate: Wed Mar 2 06:12:02 2022 +0100

tdf#118117 sc pivottable: STR_PIVOT_DATA is an existing name too

This fixes a LO 6.0 regression from
commit a078328e91ab9cbd78a92608c1abdc2c57ff9ac5

I looked for existing unit test examples using
assert (rLabel != ScResId(STR_PIVOT_DATA));
but found nothing.

I don't see the need for a unit test here.
The whole pivot table is messed up if you duplicate
a label, so why bother testing. It just is not
as bad now as it was before.

Change-Id: I59cc73becf91f766a29d2007c2d67685ffa2a65c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130751
Tested-by: Jenkins
Reviewed-by: Justin Luth 

diff --git a/sc/source/core/data/dpcache.cxx b/sc/source/core/data/dpcache.cxx
index 0f3778eb40a6..52109c673bd3 100644
--- a/sc/source/core/data/dpcache.cxx
+++ b/sc/source/core/data/dpcache.cxx
@@ -356,9 +356,11 @@ void normalizeAddLabel(const OUString& rLabel, 
std::vector& rLabels, L
 
 std::vector normalizeLabels(const std::vector& 
rColData)
 {
-std::vector aLabels(1u, ScResId(STR_PIVOT_DATA));
+std::vector aLabels;
+aLabels.reserve(rColData.size() + 1);
 
 LabelSet aExistingNames;
+normalizeAddLabel(ScResId(STR_PIVOT_DATA), aLabels, aExistingNames);
 
 for (const InitColumnData& rCol : rColData)
 normalizeAddLabel(rCol.maLabel, aLabels, aExistingNames);
@@ -368,10 +370,11 @@ std::vector normalizeLabels(const 
std::vector& rColDat
 
 std::vector normalizeLabels(const ScDPCache::DBConnector& rDB, const 
sal_Int32 nLabelCount)
 {
-std::vector aLabels(1u, ScResId(STR_PIVOT_DATA));
+std::vector aLabels;
 aLabels.reserve(nLabelCount + 1);
 
 LabelSet aExistingNames;
+normalizeAddLabel(ScResId(STR_PIVOT_DATA), aLabels, aExistingNames);
 
 for (sal_Int32 nCol = 0; nCol < nLabelCount; ++nCol)
 {


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

2022-02-28 Thread Justin Luth (via logerrit)
 sc/source/filter/excel/xestream.cxx |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 5a64b618d84edb65465950d54e3b4afc952a301c
Author: Justin Luth 
AuthorDate: Tue Mar 1 06:54:49 2022 +0200
Commit: Justin Luth 
CommitDate: Tue Mar 1 07:19:51 2022 +0100

followup tdf#122098 xlsx export: avoid corrupt format if not bool value

Although I can't find any documents that cause a "b"
when the value is not 1 or 0, if such should ever happen,
then Excel complains about an invalid format and fails to load.

(The formatting looks a bit weird, but that is what clang-format
produces. How nice.)

Change-Id: I090a27829596260cdd6379b6a6daa75ce250b7e0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130734
Tested-by: Jenkins
Reviewed-by: Justin Luth 

diff --git a/sc/source/filter/excel/xestream.cxx 
b/sc/source/filter/excel/xestream.cxx
index 2178b0b3abc7..08048e922111 100644
--- a/sc/source/filter/excel/xestream.cxx
+++ b/sc/source/filter/excel/xestream.cxx
@@ -673,7 +673,10 @@ void XclXmlUtils::GetFormulaTypeAndValue( ScFormulaCell& 
rCell, const char*& rsT
 rsValue = ToOUString(lcl_GetErrorString(aResValue.mnError));
 break;
 case sc::FormulaResultValue::Value:
-rsType = rCell.GetFormatType() == SvNumFormatType::LOGICAL ? "b" : 
"n";
+rsType = rCell.GetFormatType() == SvNumFormatType::LOGICAL
+ && (aResValue.mfValue == 0.0 || aResValue.mfValue 
== 1.0)
+ ? "b"
+ : "n";
 rsValue = OUString::number(aResValue.mfValue);
 break;
 case sc::FormulaResultValue::String:


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

2022-02-28 Thread Justin Luth (via logerrit)
 sc/qa/unit/data/xlsb/pivottable_error_item_filter.xlsb |binary
 sc/qa/unit/data/xlsx/tdf122471.xlsx|binary
 sc/qa/unit/pivottable_filters_test.cxx |   56 +
 sc/source/filter/inc/pivotcachebuffer.hxx  |2 
 sc/source/filter/oox/pivotcachebuffer.cxx  |   10 +--
 sc/source/filter/oox/pivotcachefragment.cxx|2 
 6 files changed, 63 insertions(+), 7 deletions(-)

New commits:
commit 6961f6732954742415413fa53bdeebd1b03d9ec5
Author: Justin Luth 
AuthorDate: Mon Feb 28 15:36:08 2022 +0200
Commit: Justin Luth 
CommitDate: Mon Feb 28 19:17:53 2022 +0100

tdf#122471 xlsx import: pivottable error OUString, not uInt8

This fixes a LO 6.0 regression from
commit 9fa34e9f2cebe2cfc551668f2a67ddcb799d3fb8
which only half-way changed to OUString from uInt8.

An exception was raised because in XLSX, an INT was written
while the corresponding read function was expecting an OUString.

However, doing this runs into problems with binary files (xlsb),
which were still setting the value to an int.
Unit test shows the need to use OUString for xlsb too,
which now matches what I see in Excel 2003.

make CppunitTest_sc_pivottable_filters_test \
  CPPUNIT_TEST_NAME=testPivotTableErrorItem2FilterXLSX

Change-Id: I399c9e34984bb1ff71695a87aa56f53063d37b3d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130714
Tested-by: Jenkins
Reviewed-by: Justin Luth 

diff --git a/sc/qa/unit/data/xlsb/pivottable_error_item_filter.xlsb 
b/sc/qa/unit/data/xlsb/pivottable_error_item_filter.xlsb
new file mode 100644
index ..c32b8f3743e6
Binary files /dev/null and 
b/sc/qa/unit/data/xlsb/pivottable_error_item_filter.xlsb differ
diff --git a/sc/qa/unit/data/xlsx/tdf122471.xlsx 
b/sc/qa/unit/data/xlsx/tdf122471.xlsx
new file mode 100644
index ..febac5c73506
Binary files /dev/null and b/sc/qa/unit/data/xlsx/tdf122471.xlsx differ
diff --git a/sc/qa/unit/pivottable_filters_test.cxx 
b/sc/qa/unit/pivottable_filters_test.cxx
index 36aa697b5071..14f790e89b68 100644
--- a/sc/qa/unit/pivottable_filters_test.cxx
+++ b/sc/qa/unit/pivottable_filters_test.cxx
@@ -79,6 +79,8 @@ public:
 void testPivotTableBoolFieldFilterXLSX();
 void testPivotTableRowColPageFieldFilterXLSX();
 void testPivotTableErrorItemFilterXLSX();
+void testPivotTableErrorItemFilterXLSB();
+void testPivotTableErrorItem2FilterXLSX();
 void testPivotTableOutlineModeXLSX();
 void testPivotTableDuplicatedMemberFilterXLSX();
 void testPivotTableTabularModeXLSX();
@@ -130,6 +132,8 @@ public:
 CPPUNIT_TEST(testPivotTableBoolFieldFilterXLSX);
 CPPUNIT_TEST(testPivotTableRowColPageFieldFilterXLSX);
 CPPUNIT_TEST(testPivotTableErrorItemFilterXLSX);
+CPPUNIT_TEST(testPivotTableErrorItemFilterXLSB);
+CPPUNIT_TEST(testPivotTableErrorItem2FilterXLSX);
 CPPUNIT_TEST(testPivotTableOutlineModeXLSX);
 CPPUNIT_TEST(testPivotTableDuplicatedMemberFilterXLSX);
 CPPUNIT_TEST(testPivotTableTabularModeXLSX);
@@ -2365,6 +2369,58 @@ void 
ScPivotTableFiltersTest::testPivotTableErrorItemFilterXLSX()
 xDocSh->DoClose();
 }
 
+void ScPivotTableFiltersTest::testPivotTableErrorItemFilterXLSB()
+{
+ScDocShellRef xDocSh = loadDoc(u"pivottable_error_item_filter.", 
FORMAT_XLSB);
+CPPUNIT_ASSERT_MESSAGE("Failed to load file", xDocSh.is());
+ScDocument& rDoc = xDocSh->GetDocument();
+ScDPCollection* pDPs = rDoc.GetDPCollection();
+CPPUNIT_ASSERT_EQUAL(static_cast(1), pDPs->GetCount());
+const ScDPObject* pDPObj = &(*pDPs)[0];
+CPPUNIT_ASSERT(pDPObj);
+ScDPSaveData* pSaveData = pDPObj->GetSaveData();
+CPPUNIT_ASSERT(pSaveData);
+
+ScDPSaveDimension* pSaveDim = pSaveData->GetExistingDimensionByName(u"b");
+CPPUNIT_ASSERT(pSaveDim);
+const ScDPSaveDimension::MemberList& rMembers = pSaveDim->GetMembers();
+CPPUNIT_ASSERT_EQUAL(size_t(4), rMembers.size());
+ScDPSaveMember* pMember = pSaveDim->GetExistingMemberByName("#DIV/0!");
+CPPUNIT_ASSERT(pMember);
+CPPUNIT_ASSERT(pMember->HasIsVisible());
+CPPUNIT_ASSERT(!pMember->GetIsVisible());
+
+xDocSh->DoClose();
+}
+
+void ScPivotTableFiltersTest::testPivotTableErrorItem2FilterXLSX()
+{
+ScDocShellRef xDocSh = loadDoc(u"tdf122471.", FORMAT_XLSX);
+CPPUNIT_ASSERT_MESSAGE("Failed to load file", xDocSh.is());
+ScDocument& rDoc = xDocSh->GetDocument();
+ScDPCollection* pDPs = rDoc.GetDPCollection();
+CPPUNIT_ASSERT_EQUAL(static_cast(1), pDPs->GetCount());
+
+// Reload and check whether filtering is preserved
+xDocSh = saveAndReload(*xDocSh, FORMAT_XLSX);
+CPPUNIT_ASSERT_MESSAGE("Failed to load file", xDocSh.is());
+ScDocument& rLoadedDoc = xDocSh->GetDocument();
+pDPs = rLoadedDoc.GetDPCollection();
+CPPUNIT_ASSERT_EQUAL(static_cast(1), pDPs->GetCount());
+const ScDPObject* pDPObj = &(*pDPs)[0];
+

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

2022-02-25 Thread Justin Luth (via logerrit)
 sc/inc/table.hxx   |2 +
 sc/source/core/data/table4.cxx |   67 ++---
 sc/source/core/data/table5.cxx |   22 +
 3 files changed, 67 insertions(+), 24 deletions(-)

New commits:
commit 9cd4da63b6ed19b71a2475fccb4ab135f0a87873
Author: Justin Luth 
AuthorDate: Mon Feb 14 14:40:06 2022 +0200
Commit: Eike Rathke 
CommitDate: Fri Feb 25 18:46:54 2022 +0100

tdf#147404 sc AutoFillPreview: consider hidden cells

Back in the days before LO 3.6, only filtered cells
were skipped by autoFill. But when hidden cells were
also skipped, the preview function wasn't updated to look
for hidden cells instead of filtered cells.
(I said "instead" because filtered cells are also
considered to be hidden, so it encompasses both cases.)

Change-Id: I38b230361f0f0f1722873bbdd2c870d55b77bd06
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129912
Tested-by: Jenkins
Reviewed-by: Justin Luth 

diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx
index 30c92cd87520..08624a937172 100644
--- a/sc/inc/table.hxx
+++ b/sc/inc/table.hxx
@@ -928,6 +928,8 @@ public:
 SCROW   CountVisibleRows(SCROW nStartRow, SCROW nEndRow) const;
 tools::Long GetTotalRowHeight(SCROW nStartRow, SCROW nEndRow, bool 
bHiddenAsZero = true) const;
 
+SCCOL   CountVisibleCols(SCCOL nStartCol, SCCOL nEndCol) const;
+
 SCCOLROWLastHiddenColRow(SCCOLROW nPos, bool bCol) const;
 
 boolRowFiltered(SCROW nRow, SCROW* pFirstRow = nullptr, SCROW* 
pLastRow = nullptr) const;
diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx
index a4b232ea44d9..a3d49aa1c190 100644
--- a/sc/source/core/data/table4.cxx
+++ b/sc/source/core/data/table4.cxx
@@ -1247,6 +1247,49 @@ OUString ScTable::GetAutoFillPreview( const ScRange& 
rSource, SCCOL nEndX, SCROW
 
 if ( bOk )
 {
+tools::Long nBegin = 0;
+tools::Long nEnd = 0;
+tools::Long nHidden = 0;
+if (eFillDir == FILL_TO_BOTTOM || eFillDir == FILL_TO_TOP)
+{
+if (nEndY > nRow1)
+{
+nBegin = nRow2+1;
+nEnd = nEndY;
+}
+else
+{
+nBegin = nEndY;
+nEnd = nRow1 -1;
+}
+
+tools::Long nVisible = CountVisibleRows(nBegin, nEnd);
+nHidden = nEnd + 1 - nBegin - nVisible;
+}
+else
+{
+if (nEndX > nCol1)
+{
+nBegin = nCol2+1;
+nEnd = nEndX;
+}
+else
+{
+nBegin = nEndX;
+nEnd = nCol1 -1;
+}
+
+tools::Long nVisible = CountVisibleCols(nBegin, nEnd);
+nHidden = nEnd + 1 - nBegin - nVisible;
+}
+if (nHidden)
+{
+if (nIndex > 0)
+nIndex = nIndex - nHidden;
+else
+nIndex = nIndex + nHidden;
+}
+
 FillCmd eFillCmd;
 FillDateCmd eDateCmd;
 double nInc;
@@ -1277,30 +1320,6 @@ OUString ScTable::GetAutoFillPreview( const ScRange& 
rSource, SCCOL nEndX, SCROW
 }
 else if ( eFillCmd == FILL_SIMPLE ) // fill with pattern/sample
 {
-if ((eFillDir == FILL_TO_BOTTOM)||(eFillDir == FILL_TO_TOP))
-{
-tools::Long nBegin = 0;
-tools::Long nEnd = 0;
-if (nEndY > nRow1)
-{
-nBegin = nRow2+1;
-nEnd = nEndY;
-}
-else
-{
-nBegin = nEndY;
-nEnd = nRow1 -1;
-}
-
-tools::Long nNonFiltered = CountNonFilteredRows(nBegin, nEnd);
-tools::Long nFiltered = nEnd + 1 - nBegin - nNonFiltered;
-
-if (nIndex > 0)
-nIndex = nIndex - nFiltered;
-else
-nIndex = nIndex + nFiltered;
-}
-
 tools::Long nPosIndex = nIndex;
 while ( nPosIndex < 0 )
 nPosIndex += nSrcCount;
diff --git a/sc/source/core/data/table5.cxx b/sc/source/core/data/table5.cxx
index d62b94e40f28..4c510213edd9 100644
--- a/sc/source/core/data/table5.cxx
+++ b/sc/source/core/data/table5.cxx
@@ -796,6 +796,28 @@ tools::Long ScTable::GetTotalRowHeight(SCROW nStartRow, 
SCROW nEndRow, bool bHid
 return nHeight;
 }
 
+SCCOL ScTable::CountVisibleCols(SCCOL nStartCol, SCCOL nEndCol) const
+{
+assert(nStartCol <= nEndCol);
+SCCOL nCount = 0;
+SCCOL nCol = nStartCol;
+ScFlatBoolColSegments::RangeData aData;
+while (nCol <= nEndCol)
+{
+if (!mpHiddenCols->getRangeData(nCol, aData))
+break;
+
+if (aData.mnCol2 > nEndCol)
+aData.mnCol2 = nEndCol;
+
+if (!aData.mbValue)
+ 

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

2022-02-25 Thread Justin Luth (via logerrit)
 sc/source/ui/view/gridwin.cxx |8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit a24eac37fbf8a325b09c3b575c568621a696a560
Author: Justin Luth 
AuthorDate: Mon Feb 21 11:48:48 2022 +0200
Commit: Eike Rathke 
CommitDate: Fri Feb 25 15:24:54 2022 +0100

tdf#81894 sc spelling: re-close EditView if not spelling error

In order to check if there is a spelling error,
the code had to open an EditView. If there was no spelling error
at the mouse pointer, then stop edit mode again before showing
the context menu so the full popup is shown, not just the edit one.

1.) Open LOv4304.ods from bug 81894 comment 6.
2.) right click on "The" in B3

Since we haven't been in edit mode, it should show the full
format popup. Before this patch series, that is what happened,
so this follow-up patch is critical to preventing a regression.

This patch makes use of a variable created in earlier patches
to fix other issues related to right-click spelling.

Change-Id: Ia9713e9654c1f74bc926d51fe8bc5180a8265c79
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130300
Tested-by: Jenkins
Reviewed-by: Eike Rathke 

diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index f99eb0b350c4..d92d2109cdd1 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -3325,8 +3325,14 @@ void ScGridWindow::Command( const CommandEvent& rCEvt )
 Link aLink = LINK( this, ScGridWindow, 
PopupSpellingHdl );
 bDone = pEditView->ExecuteSpellPopup(aMenuPos, aLink);
 
-if (pHdl && pHdl->GetEditString() != sOldText)
+// If the spelling is corrected, stop editing to flush any cached 
spelling info.
+// Or, if no misspelled word at this position, and it wasn't 
initially in edit mode,
+// then exit the edit mode in order to get the full context popup 
(not edit popup).
+if (pHdl && (pHdl->GetEditString() != sOldText
+ || (!bDone && !bPosIsInEditView)))
+{
 pHdl->EnterHandler();
+}
 
 if (!bDone && nColSpellError != nCellX)
 {


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

2022-02-25 Thread Justin Luth (via logerrit)
 sc/source/ui/view/gridwin.cxx |9 +
 1 file changed, 9 insertions(+)

New commits:
commit bdea5805c0344cbddb5c68d1fd19d3cd3b6e3afd
Author: Justin Luth 
AuthorDate: Mon Feb 21 11:05:41 2022 +0200
Commit: Eike Rathke 
CommitDate: Fri Feb 25 15:23:00 2022 +0100

tdf#81894 sc spelling: close EditView when moving outside cell

In a previous patch, we noted that instead of a spelling suggestion,
a popup was displayed. This patch handles that unfinished business.

1.) Open LOv4304.ods from bug 81894 comment 6.
2.) double-click on cell B4 (to enter edit mode)
3.) right click on "spellng" which appears to be in D4

Before any of the patches, this did nothing.
After the first base patch, it was showing the format popup.
Now it offers a spelling suggestion.

[By running EnterHandler, we are accepting any changes made
 so far in editing mode. That is consistent with what happens
 if a left-click selects a different cell.]

Change-Id: I23876a26861b695dc46efa42f6c3fed6fdb8da6a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130299
Tested-by: Jenkins
Reviewed-by: Eike Rathke 

diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 0f01233d64a9..f99eb0b350c4 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -3199,6 +3199,15 @@ void ScGridWindow::Command( const CommandEvent& rCEvt )
 nCellY = mrViewData.GetEditViewRow();
 else
 bPosIsInEditView = false;
+
+if (!bPosIsInEditView)
+{
+// Close the edit view when moving outside of the edited cell
+// to avoid showing the edit popup, or providing the wrong 
EditView to spellcheck.
+ScInputHandler* pHdl = pScMod->GetInputHdl();
+if (pHdl)
+pHdl->EnterHandler();
+}
 }
 
 bool bSpellError = false;


[Libreoffice-commits] core.git: 2 commits - editeng/source include/editeng sc/source

2022-02-25 Thread Justin Luth (via logerrit)
 editeng/source/editeng/editview.cxx |7 +-
 include/editeng/editview.hxx|2 
 sc/source/ui/inc/gridwin.hxx|2 
 sc/source/ui/view/gridwin.cxx   |   89 ++--
 4 files changed, 31 insertions(+), 69 deletions(-)

New commits:
commit 8238b887ccecb425f17166d2380afb208bbfdfbb
Author: Justin Luth 
AuthorDate: Mon Feb 21 10:17:36 2022 +0200
Commit: Eike Rathke 
CommitDate: Fri Feb 25 15:22:46 2022 +0100

tdf#81894 sc spelling: choose correct cell when in edit mode

In edit mode, text that is too large to fit inside the cell
will expand to cover other columns (or rows if cell wraps).
GetPosFromPixel doesn't account for this, so it needs to
be done separately. (SHOULD the function itself take this
into account? Probably, but it is used a LOT,
so I'm afraid to mess with it.)

This patch fixes two situations in bug 81894 comment 25's example.
1.) Open Francewhoa---2017-May-29---speadsheet.ods
2.) Double click on A1 to enter edit mode.
Notice that the cell expands to cover A1:A3.
3.) Right click on "productivityy".

Before the patch, the spell check was inspecting empty cell A2,
and thus showed the edit popup.
With the patch, the spell check is using cell A1,
and thus provides spelling suggestions, as expected.
[This patch depends on this bug report's prior comit.]

4.) Look at B3 and notice misspelled words spilling over from A3.
Double click on B3 to enter edit mode.
5.) Right click on the position where the misspelled word had been.

Before the patch, a spelling suggestion was provided,
even though we right-clicked on an empty place in a different col.
After the patch, we get the normal edit popup.

Change-Id: I58fbf60711a5c010263b525a96383a805be1b3ca
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130298
Tested-by: Jenkins
Reviewed-by: Eike Rathke 

diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 5a8c9625c332..0f01233d64a9 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -3182,9 +3182,24 @@ void ScGridWindow::Command( const CommandEvent& rCEvt )
 Point aPosPixel = rCEvt.GetMousePosPixel();
 Point aMenuPos = aPosPixel;
 
+bool bPosIsInEditView = mrViewData.HasEditView(eWhich);
 SCCOL nCellX = -1;
 SCROW nCellY = -1;
 mrViewData.GetPosFromPixel(aPosPixel.X(), aPosPixel.Y(), eWhich, nCellX, 
nCellY);
+// GetPosFromPixel ignores the fact that when editing a cell, the cell 
might grow to cover
+// other rows/columns. In addition, the mouse might now be outside the 
edited cell.
+if (bPosIsInEditView)
+{
+if (nCellX >= mrViewData.GetEditViewCol() && nCellX <= 
mrViewData.GetEditEndCol())
+nCellX = mrViewData.GetEditViewCol();
+else
+bPosIsInEditView = false;
+
+if (nCellY >= mrViewData.GetEditViewRow() && nCellY <= 
mrViewData.GetEditEndRow())
+nCellY = mrViewData.GetEditViewRow();
+else
+bPosIsInEditView = false;
+}
 
 bool bSpellError = false;
 SCCOL nColSpellError = nCellX;
@@ -3216,7 +3231,7 @@ void ScGridWindow::Command( const CommandEvent& rCEvt )
 // Find the first string to the left for spell checking in case 
the current cell is empty.
 ScAddress aPos(nCellX, nCellY, nTab);
 ScRefCellValue aSpellCheckCell(rDoc, aPos);
-while (aSpellCheckCell.meType == CELLTYPE_NONE)
+while (!bPosIsInEditView && aSpellCheckCell.meType == 
CELLTYPE_NONE)
 {
 // Loop until we get the first non-empty cell in the row.
 aPos.IncCol(-1);
commit cf18038c66075f7a18d89e47f3a2ab1a5bf7c4fd
Author: Justin Luth 
AuthorDate: Sat Feb 19 20:22:23 2022 +0200
Commit: Eike Rathke 
CommitDate: Fri Feb 25 15:22:32 2022 +0100

tdf#81894 sc spelling: eliminate separate(inaccurate) check

ExecuteSpellPopup is quite accurate at identifying whether
the spelling at PosPixel is a spelling error or not.
If it is not a misspelled word, then it just silently returns.

If we make this a bDone flag, then it will just move
on to the normal right-click dialog.

There are a few additional scenarios that need to be
handled (mainly in terms of showing the edit-mode menu
instead of the full format menu, and also not
always returning the correct row/col when in edit mode).
I will do them in separate patches so that
each edge case can be clearly seen and handled.
They all rely on this patch being applied first.

This is the base patch. Too many things simply don't
work with the interim check, so I removed it.
(Part of the problem is that EditView kicks on and off,
and then a new CompleteOnlineSpelling needs to be run before
IsWrongSpelledWordAtPos can return a meaningful 

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

2022-02-24 Thread Justin Luth (via logerrit)
 chart2/qa/extras/chart2import.cxx|   15 +++
 chart2/qa/extras/data/pptx/tdf127720.pptx|binary
 chart2/source/tools/InternalDataProvider.cxx |3 ++-
 3 files changed, 17 insertions(+), 1 deletion(-)

New commits:
commit 446c491c2f0d2643f83c0f7981b04bced785894c
Author: Justin Luth 
AuthorDate: Wed Feb 23 20:45:04 2022 +0200
Commit: Xisco Fauli 
CommitDate: Thu Feb 24 10:26:22 2022 +0100

tdf#127720 chart2: create new columns for error bars

This is basically a copy/paste of the bubble chart fix
for tdf#103984 against the same LO 4.4 regression.

No exist unit tests had error bars. Very interesting.

make CppunitTest_chart2_import CPPUNIT_TEST_NAME=testPPTXChartErrorBars

Change-Id: I81ff91ee2ba75277502a8e261106bf5837a8903b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130444
Tested-by: Jenkins
Reviewed-by: Justin Luth 
(cherry picked from commit dfd0717b3f55eeb15a5634e52d7d0ed544d17578)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130447
Reviewed-by: Xisco Fauli 

diff --git a/chart2/qa/extras/chart2import.cxx 
b/chart2/qa/extras/chart2import.cxx
index e908cfc57a71..564d6b0815b9 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -53,6 +53,7 @@ public:
 void testDOCXChartSeries();
 void testDOCXChartEmptySeries();
 void testTdf81396();
+void testPPTXChartErrorBars();
 void testDOCXChartValuesSize();
 void testPPTXChartSeries();
 void testPPTXSparseChartSeries();
@@ -154,6 +155,7 @@ public:
 CPPUNIT_TEST(testDOCXChartSeries);
 CPPUNIT_TEST(testDOCXChartEmptySeries);
 CPPUNIT_TEST(testTdf81396);
+CPPUNIT_TEST(testPPTXChartErrorBars);
 CPPUNIT_TEST(testDOCXChartValuesSize);
 CPPUNIT_TEST(testPPTChartSeries);
 CPPUNIT_TEST(testPPTXChartSeries);
@@ -491,6 +493,19 @@ void Chart2ImportTest::testTdf81396()
 CPPUNIT_ASSERT_EQUAL(105.210801910481, aDataSeriesYValues[0][0]);
 }
 
+void Chart2ImportTest::testPPTXChartErrorBars()
+{
+load(u"/chart2/qa/extras/data/pptx/", "tdf127720.pptx");
+Reference xChartDoc(getChartDocFromDrawImpress(0, 
0), uno::UNO_QUERY);
+CPPUNIT_ASSERT(xChartDoc.is());
+
+uno::Reference< chart::XChartDataArray > 
xDataArray(xChartDoc->getDataProvider(), UNO_QUERY_THROW);
+Sequence aColumnDesc = xDataArray->getColumnDescriptions();
+// Number of columns = 4 (Y-values, X-values and positive/negative error 
bars).
+// Without the fix there would only be 2 columns (no error range).
+CPPUNIT_ASSERT_EQUAL_MESSAGE("There must be 4 columns and descriptions", 
static_cast(4), aColumnDesc.getLength());
+}
+
 void Chart2ImportTest::testDOCXChartValuesSize()
 {
 load( u"/chart2/qa/extras/data/docx/", "bubblechart.docx" );
diff --git a/chart2/qa/extras/data/pptx/tdf127720.pptx 
b/chart2/qa/extras/data/pptx/tdf127720.pptx
new file mode 100644
index ..b10a4c5ab4ed
Binary files /dev/null and b/chart2/qa/extras/data/pptx/tdf127720.pptx differ
diff --git a/chart2/source/tools/InternalDataProvider.cxx 
b/chart2/source/tools/InternalDataProvider.cxx
index 794a780d5a86..3b2fe6e5a021 100644
--- a/chart2/source/tools/InternalDataProvider.cxx
+++ b/chart2/source/tools/InternalDataProvider.cxx
@@ -569,7 +569,8 @@ InternalDataProvider::createDataSequenceFromArray( const 
OUString& rArrayStr, st
 }
 
 if (rRole == u"values-y" || rRole == u"values-first" || rRole == 
u"values-last" ||
-rRole == u"values-min" || rRole == u"values-max" || rRole == 
u"values-size")
+rRole == u"values-min" || rRole == u"values-max" || rRole == 
u"values-size" ||
+rRole == u"error-bars-y-positive" || rRole == u"error-bars-y-negative")
 {
 // Column values.  Append a new data column and populate it.
 


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

2022-02-24 Thread Justin Luth (via logerrit)
 sc/source/filter/excel/xestream.cxx |   12 ++--
 1 file changed, 2 insertions(+), 10 deletions(-)

New commits:
commit 8f2b1b1cb84e1ae3139eb90b8efdf61e608adbad
Author: Justin Luth 
AuthorDate: Wed Feb 23 22:11:18 2022 +0200
Commit: Justin Luth 
CommitDate: Thu Feb 24 09:00:04 2022 +0100

followup tdf#122098 xlsx export: avoid dataloss if not bool value

Change-Id: I54b2f44a1ab0b7681667e811be72d1504928fab9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130469
Tested-by: Jenkins
Reviewed-by: Justin Luth 

diff --git a/sc/source/filter/excel/xestream.cxx 
b/sc/source/filter/excel/xestream.cxx
index a3c1b92fe86d..2178b0b3abc7 100644
--- a/sc/source/filter/excel/xestream.cxx
+++ b/sc/source/filter/excel/xestream.cxx
@@ -673,16 +673,8 @@ void XclXmlUtils::GetFormulaTypeAndValue( ScFormulaCell& 
rCell, const char*& rsT
 rsValue = ToOUString(lcl_GetErrorString(aResValue.mnError));
 break;
 case sc::FormulaResultValue::Value:
-if (rCell.GetFormatType() == SvNumFormatType::LOGICAL)
-{
-rsType = "b";
-rsValue = rCell.GetValue() == 0.0 ? "0" : "1";
-}
-else
-{
-rsType = "n";
-rsValue = OUString::number(aResValue.mfValue);
-}
+rsType = rCell.GetFormatType() == SvNumFormatType::LOGICAL ? "b" : 
"n";
+rsValue = OUString::number(aResValue.mfValue);
 break;
 case sc::FormulaResultValue::String:
 rsType = "str";


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

2022-02-23 Thread Justin Luth (via logerrit)
 include/svx/ruler.hxx   |3 ++-
 svx/source/dialog/rlrcitem.cxx  |2 +-
 svx/source/dialog/svxruler.cxx  |   13 -
 sw/source/uibase/uiview/viewtab.cxx |   22 +++---
 4 files changed, 26 insertions(+), 14 deletions(-)

New commits:
commit e87f9b4fa158b917bb38fc00513bae7f94024e58
Author: Justin Luth 
AuthorDate: Tue Feb 15 14:26:35 2022 +0200
Commit: Justin Luth 
CommitDate: Thu Feb 24 07:36:57 2022 +0100

tdf#95882 svxruler: restore adjustment for borders

This restores the clause removed from
LO 3.6's commit 47a77d7dbc427e51421e2df8d59695834cb74980
Ruler: disable snapping, tooltips

[Because that removal left behind dead code,
 which was later cleared out, of course this patch
 restores that as well.
commit 8303e7ed668fbcbd0ba75bd9dd259f03073ffd46
Author: Noel Grandin on Fri Jun 14 10:41:11 2019 +0200
]

Basic borders on the paragraph itself
do not affect where LO ends the tabstop,
and thus the removal of that clause was partially justified.
But the table/frame/page/headers definitely need to be adjusted
in order for the tabstops to show in the correct position.

RightFrameMargin needed this as well,
especially now that RTL is supported by the ruler since LO 3.6,
although the Left/Right functions are very different.

[Frames never worked because the aCoreSet wasn't accepting
 RES_BOX items. Interesting error considering all of the
 other sections of code created a new CoreSet.]

Change-Id: Ic24839dbbd730e66d8b0d588bfbd73bc7cb260bf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130125
Tested-by: Justin Luth 
Reviewed-by: Justin Luth 

diff --git a/include/svx/ruler.hxx b/include/svx/ruler.hxx
index 374209a73f69..010af4b17936 100644
--- a/include/svx/ruler.hxx
+++ b/include/svx/ruler.hxx
@@ -91,6 +91,7 @@ class SVX_DLLPUBLIC SvxRuler: public Ruler, public SfxListener
 std::unique_ptr mxULSpaceItem;// upper and lower 
edge
 std::unique_ptr mxTabStopItem;// tab stops
 std::unique_ptr mxParaItem;   // paragraphs
+std::unique_ptr mxBorderItem; // border distance
 std::unique_ptr mxPagePosItem;// page distance to 
the rule
 std::unique_ptr  mxColumnItem; // columns
 std::unique_ptr  mxObjectItem; // object
@@ -140,7 +141,7 @@ class SVX_DLLPUBLIC SvxRuler: public Ruler, public 
SfxListener
 // paragraph indentations
 void UpdatePara(const SvxLRSpaceItem* pItem);
 // Border distance
-void UpdateParaBorder();
+void UpdateBorder(const SvxLRSpaceItem* pItem);
 // Tabs
 void Update(const SvxTabStopItem* pItem);
 // page position and width
diff --git a/svx/source/dialog/rlrcitem.cxx b/svx/source/dialog/rlrcitem.cxx
index 873663b27e30..a73cd00bdac5 100644
--- a/svx/source/dialog/rlrcitem.cxx
+++ b/svx/source/dialog/rlrcitem.cxx
@@ -131,7 +131,7 @@ void SvxRulerItem::StateChangedAtToolBoxControl( sal_uInt16 
nSID, SfxItemState e
 {
 const SvxLRSpaceItem *pItem = dynamic_cast( 
pState );
 SAL_WARN_IF(pState != nullptr && pItem == nullptr, "svx.dialog", 
"SvxLRSpaceItem expected");
-rRuler.UpdateParaBorder();
+rRuler.UpdateBorder(pItem);
 }
 break;
 case SID_RULER_TEXT_RIGHT_TO_LEFT :
diff --git a/svx/source/dialog/svxruler.cxx b/svx/source/dialog/svxruler.cxx
index 6e960a18433d..d676c3c1208f 100644
--- a/svx/source/dialog/svxruler.cxx
+++ b/svx/source/dialog/svxruler.cxx
@@ -881,11 +881,16 @@ void SvxRuler::UpdatePara(const SvxLRSpaceItem *pItem) // 
new value of paragraph
 }
 }
 
-void SvxRuler::UpdateParaBorder()
+void SvxRuler::UpdateBorder(const SvxLRSpaceItem * pItem)
 {
 /* Border distance */
 if(bActive)
 {
+if (pItem)
+mxBorderItem.reset(new SvxLRSpaceItem(*pItem));
+else
+mxBorderItem.reset();
+
 StartListening_Impl();
 }
 }
@@ -1206,6 +1211,9 @@ tools::Long SvxRuler::GetLeftFrameMargin() const
 nLeft = mxColumnItem->GetActiveColumnDescription().nStart;
 }
 
+if (mxBorderItem && (!mxColumnItem || mxColumnItem->IsTable()))
+nLeft += mxBorderItem->GetLeft();
+
 return nLeft;
 }
 
@@ -1257,6 +1265,9 @@ tools::Long SvxRuler::GetRightFrameMargin() const
 else if(!bHorz && mxULSpaceItem)
 lResult += mxULSpaceItem->GetLower();
 
+if (bHorz && mxBorderItem && (!mxColumnItem || mxColumnItem->IsTable()))
+lResult += mxBorderItem->GetRight();
+
 if(bHorz)
 lResult = mxPagePosItem->GetWidth() - lResult;
 else
diff --git a/sw/source/uibase/uiview/viewtab.cxx 
b/sw/source/uibase/uiview/viewtab.cxx
index 6bf269219d9a..c911971fd314 100644
--- a/sw/source/uibase/uiview/viewtab.cxx
+++ b/sw/source/uibase/uiview/viewtab.cxx
@@ -1699,6 +1699,8 @@ void SwView::StateTabWin(SfxItemSet& rSet)
 {
 

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

2022-02-23 Thread Justin Luth (via logerrit)
 chart2/qa/extras/chart2import.cxx|   15 +++
 chart2/qa/extras/data/pptx/tdf127720.pptx|binary
 chart2/source/tools/InternalDataProvider.cxx |3 ++-
 3 files changed, 17 insertions(+), 1 deletion(-)

New commits:
commit dfd0717b3f55eeb15a5634e52d7d0ed544d17578
Author: Justin Luth 
AuthorDate: Wed Feb 23 20:45:04 2022 +0200
Commit: Justin Luth 
CommitDate: Wed Feb 23 20:52:31 2022 +0100

tdf#127720 chart2: create new columns for error bars

This is basically a copy/paste of the bubble chart fix
for tdf#103984 against the same LO 4.4 regression.

No exist unit tests had error bars. Very interesting.

make CppunitTest_chart2_import CPPUNIT_TEST_NAME=testPPTXChartErrorBars

Change-Id: I81ff91ee2ba75277502a8e261106bf5837a8903b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130444
Tested-by: Jenkins
Reviewed-by: Justin Luth 

diff --git a/chart2/qa/extras/chart2import.cxx 
b/chart2/qa/extras/chart2import.cxx
index 0c129d26978b..70cb393ba7b6 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -50,6 +50,7 @@ public:
 void testDOCXChartSeries();
 void testDOCXChartEmptySeries();
 void testTdf81396();
+void testPPTXChartErrorBars();
 void testDOCXChartValuesSize();
 void testPPTXChartSeries();
 void testPPTXSparseChartSeries();
@@ -147,6 +148,7 @@ public:
 CPPUNIT_TEST(testDOCXChartSeries);
 CPPUNIT_TEST(testDOCXChartEmptySeries);
 CPPUNIT_TEST(testTdf81396);
+CPPUNIT_TEST(testPPTXChartErrorBars);
 CPPUNIT_TEST(testDOCXChartValuesSize);
 CPPUNIT_TEST(testPPTChartSeries);
 CPPUNIT_TEST(testPPTXChartSeries);
@@ -481,6 +483,19 @@ void Chart2ImportTest::testTdf81396()
 CPPUNIT_ASSERT_EQUAL(105.210801910481, aDataSeriesYValues[0][0]);
 }
 
+void Chart2ImportTest::testPPTXChartErrorBars()
+{
+load(u"/chart2/qa/extras/data/pptx/", "tdf127720.pptx");
+Reference xChartDoc(getChartDocFromDrawImpress(0, 
0), uno::UNO_QUERY);
+CPPUNIT_ASSERT(xChartDoc.is());
+
+uno::Reference< chart::XChartDataArray > 
xDataArray(xChartDoc->getDataProvider(), UNO_QUERY_THROW);
+Sequence aColumnDesc = xDataArray->getColumnDescriptions();
+// Number of columns = 4 (Y-values, X-values and positive/negative error 
bars).
+// Without the fix there would only be 2 columns (no error range).
+CPPUNIT_ASSERT_EQUAL_MESSAGE("There must be 4 columns and descriptions", 
static_cast(4), aColumnDesc.getLength());
+}
+
 void Chart2ImportTest::testDOCXChartValuesSize()
 {
 load( u"/chart2/qa/extras/data/docx/", "bubblechart.docx" );
diff --git a/chart2/qa/extras/data/pptx/tdf127720.pptx 
b/chart2/qa/extras/data/pptx/tdf127720.pptx
new file mode 100644
index ..b10a4c5ab4ed
Binary files /dev/null and b/chart2/qa/extras/data/pptx/tdf127720.pptx differ
diff --git a/chart2/source/tools/InternalDataProvider.cxx 
b/chart2/source/tools/InternalDataProvider.cxx
index ffbfebe10522..e1bf32b7ff10 100644
--- a/chart2/source/tools/InternalDataProvider.cxx
+++ b/chart2/source/tools/InternalDataProvider.cxx
@@ -568,7 +568,8 @@ InternalDataProvider::createDataSequenceFromArray( const 
OUString& rArrayStr, st
 }
 
 if (rRole == u"values-y" || rRole == u"values-first" || rRole == 
u"values-last" ||
-rRole == u"values-min" || rRole == u"values-max" || rRole == 
u"values-size")
+rRole == u"values-min" || rRole == u"values-max" || rRole == 
u"values-size" ||
+rRole == u"error-bars-y-positive" || rRole == u"error-bars-y-negative")
 {
 // Column values.  Append a new data column and populate it.
 


[Libreoffice-commits] core.git: Branch 'distro/cib/libreoffice-6-1' - sw/qa sw/source

2022-02-23 Thread Justin Luth (via logerrit)
 sw/qa/extras/odfexport/data/tdf131025_noZerosInTable.odt |binary
 sw/qa/extras/odfexport/odfexport.cxx |   10 ++
 sw/source/filter/xml/xmltbli.cxx |2 +-
 3 files changed, 11 insertions(+), 1 deletion(-)

New commits:
commit e0b1f46149acfe989b8c89f3fddc04e7c22bf568
Author: Justin Luth 
AuthorDate: Fri Oct 22 21:11:59 2021 +0200
Commit: Michael Stahl 
CommitDate: Wed Feb 23 18:39:41 2022 +0100

tdf#131025 ODF import: recognize SV_COUNTRY_LANGUAGE_OFFSET

File import was making an exception for "float value 0"
if the accompanying text had no resemblance to the value 0,
but that only applied to GENERAL number format.

It should apply to any language's default number format.

REGRESSION warning: as we can see, this has been handled
inconsistently in the past. But from the coding exception to overcome
losing text to a zero (and the huge number of duplicate bugs)
the best choice seems to be ignore the spec that says that
a number value overrides the text value - at least in
the case where the number value is zero.

Change-Id: I701e72c6a5dad42c7799ab501255a4859adf61d4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124080
Tested-by: Jenkins
Reviewed-by: Justin Luth 
Reviewed-by: Eike Rathke 
(cherry picked from commit 3e1d316734354c6b49696c8904e0fc431cfb5143)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124014
Reviewed-by: Xisco Fauli 
(cherry picked from commit d3b4ef0f7726ef1619717d9e3327963ceb4c065a)
(cherry picked from commit d9d7b17adf91c90a21a59250934e2e52e1133d81)

diff --git a/sw/qa/extras/odfexport/data/tdf131025_noZerosInTable.odt 
b/sw/qa/extras/odfexport/data/tdf131025_noZerosInTable.odt
new file mode 100644
index ..f2bffb050ac4
Binary files /dev/null and 
b/sw/qa/extras/odfexport/data/tdf131025_noZerosInTable.odt differ
diff --git a/sw/qa/extras/odfexport/odfexport.cxx 
b/sw/qa/extras/odfexport/odfexport.cxx
index fa43734d8f7d..63f1ba7055b1 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -225,6 +225,16 @@ DECLARE_ODFEXPORT_TEST(testTdf43569, 
"tdf43569_conditionalfield.doc")
 CPPUNIT_ASSERT(xFields->hasMoreElements());
 }
 
+DECLARE_ODFEXPORT_TEST(testTdf131025_noZerosInTable, 
"tdf131025_noZerosInTable.odt")
+{
+uno::Reference xSupplier(mxComponent, 
uno::UNO_QUERY);
+uno::Reference xTables = 
xSupplier->getTextTables();
+uno::Reference xTable(xTables->getByName("Table1"), 
uno::UNO_QUERY);
+
+uno::Reference xCell(xTable->getCellByName("C3"), 
uno::UNO_QUERY);
+CPPUNIT_ASSERT_EQUAL(OUString("5 gp"), xCell->getString());
+}
+
 DECLARE_ODFEXPORT_TEST(testTdf103567, "tdf103567.odt")
 {
 uno::Reference const xShape(getShape(1));
diff --git a/sw/source/filter/xml/xmltbli.cxx b/sw/source/filter/xml/xmltbli.cxx
index 98ddb181baf1..13b0063e02da 100644
--- a/sw/source/filter/xml/xmltbli.cxx
+++ b/sw/source/filter/xml/xmltbli.cxx
@@ -2053,7 +2053,7 @@ SwTableBox *SwXMLTableContext::MakeTableBox(
 {
 const SwTableBoxNumFormat* pNumFormat =
 static_cast( pItem );
-if( ( pNumFormat != nullptr ) && ( pNumFormat->GetValue() == 0 
) )
+if (pNumFormat && (pNumFormat->GetValue() % 
SV_COUNTRY_LANGUAGE_OFFSET) == 0)
 {
 // only one text node?
 SwNodeIndex aNodeIndex( *(pCell->GetStartNode()), 1 );


[Libreoffice-commits] core.git: Branch 'distro/cib/libreoffice-6-4' - sw/qa sw/source

2022-02-23 Thread Justin Luth (via logerrit)
 sw/qa/extras/odfexport/data/tdf131025_noZerosInTable.odt |binary
 sw/qa/extras/odfexport/odfexport.cxx |   10 ++
 sw/source/filter/xml/xmltbli.cxx |2 +-
 3 files changed, 11 insertions(+), 1 deletion(-)

New commits:
commit d9d7b17adf91c90a21a59250934e2e52e1133d81
Author: Justin Luth 
AuthorDate: Fri Oct 22 21:11:59 2021 +0200
Commit: Michael Stahl 
CommitDate: Wed Feb 23 18:20:20 2022 +0100

tdf#131025 ODF import: recognize SV_COUNTRY_LANGUAGE_OFFSET

File import was making an exception for "float value 0"
if the accompanying text had no resemblance to the value 0,
but that only applied to GENERAL number format.

It should apply to any language's default number format.

REGRESSION warning: as we can see, this has been handled
inconsistently in the past. But from the coding exception to overcome
losing text to a zero (and the huge number of duplicate bugs)
the best choice seems to be ignore the spec that says that
a number value overrides the text value - at least in
the case where the number value is zero.

Change-Id: I701e72c6a5dad42c7799ab501255a4859adf61d4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124080
Tested-by: Jenkins
Reviewed-by: Justin Luth 
Reviewed-by: Eike Rathke 
(cherry picked from commit 3e1d316734354c6b49696c8904e0fc431cfb5143)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124014
Reviewed-by: Xisco Fauli 
(cherry picked from commit d3b4ef0f7726ef1619717d9e3327963ceb4c065a)

diff --git a/sw/qa/extras/odfexport/data/tdf131025_noZerosInTable.odt 
b/sw/qa/extras/odfexport/data/tdf131025_noZerosInTable.odt
new file mode 100644
index ..f2bffb050ac4
Binary files /dev/null and 
b/sw/qa/extras/odfexport/data/tdf131025_noZerosInTable.odt differ
diff --git a/sw/qa/extras/odfexport/odfexport.cxx 
b/sw/qa/extras/odfexport/odfexport.cxx
index 321ce301fb9c..6a216a1b5e92 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -219,6 +219,16 @@ DECLARE_ODFEXPORT_TEST(testTdf43569, 
"tdf43569_conditionalfield.doc")
 CPPUNIT_ASSERT(xFields->hasMoreElements());
 }
 
+DECLARE_ODFEXPORT_TEST(testTdf131025_noZerosInTable, 
"tdf131025_noZerosInTable.odt")
+{
+uno::Reference xSupplier(mxComponent, 
uno::UNO_QUERY);
+uno::Reference xTables = 
xSupplier->getTextTables();
+uno::Reference xTable(xTables->getByName("Table1"), 
uno::UNO_QUERY);
+
+uno::Reference xCell(xTable->getCellByName("C3"), 
uno::UNO_QUERY);
+CPPUNIT_ASSERT_EQUAL(OUString("5 gp"), xCell->getString());
+}
+
 DECLARE_ODFEXPORT_TEST(testTdf103567, "tdf103567.odt")
 {
 uno::Reference const xShape(getShape(1));
diff --git a/sw/source/filter/xml/xmltbli.cxx b/sw/source/filter/xml/xmltbli.cxx
index 0fde4d3c509d..07ea1355b8fb 100644
--- a/sw/source/filter/xml/xmltbli.cxx
+++ b/sw/source/filter/xml/xmltbli.cxx
@@ -2021,7 +2021,7 @@ SwTableBox *SwXMLTableContext::MakeTableBox(
 {
 const SwTableBoxNumFormat* pNumFormat =
 static_cast( pItem );
-if( ( pNumFormat != nullptr ) && ( pNumFormat->GetValue() == 0 
) )
+if (pNumFormat && (pNumFormat->GetValue() % 
SV_COUNTRY_LANGUAGE_OFFSET) == 0)
 {
 // only one text node?
 SwNodeIndex aNodeIndex( *(pCell->GetStartNode()), 1 );


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

2022-02-23 Thread Justin Luth (via logerrit)
 sc/qa/unit/pivottable_filters_test.cxx |5 +++--
 sc/source/filter/excel/xestream.cxx|   12 ++--
 sc/source/filter/oox/formulabuffer.cxx |7 +++
 3 files changed, 20 insertions(+), 4 deletions(-)

New commits:
commit 8f5d8669ca74fed8608e438a8436c173e35d43a6
Author: Justin Luth 
AuthorDate: Wed Feb 23 10:34:29 2022 +0200
Commit: Justin Luth 
CommitDate: Wed Feb 23 16:48:56 2022 +0100

tdf#122098 xlsx im/export: let formulas guess their number format

This fixes the import side of a LO 4.2 regression
from commit 07b66cd3ac1a9f6c7b61a1d7da6e9d266e6de92d
and the export side of a LO 4.3 regression
from commit 69ecdad805281b2cb6ec2437da18daa19576deae

make CppunitTest_sc_pivottable_filters_test \
  CPPUNIT_TEST_NAME=testPivotTableBoolFieldFilterXLSX

Change-Id: I4c680dbff844cf1eca52de641856daafa032eeb4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130406
Tested-by: Justin Luth 
Reviewed-by: Justin Luth 

diff --git a/sc/qa/unit/pivottable_filters_test.cxx 
b/sc/qa/unit/pivottable_filters_test.cxx
index ef31fcf81282..36aa697b5071 100644
--- a/sc/qa/unit/pivottable_filters_test.cxx
+++ b/sc/qa/unit/pivottable_filters_test.cxx
@@ -2196,6 +2196,7 @@ void 
ScPivotTableFiltersTest::testPivotTableBoolFieldFilterXLSX()
 ScDocument& rDoc = xDocSh->GetDocument();
 ScDPCollection* pDPs = rDoc.GetDPCollection();
 CPPUNIT_ASSERT_EQUAL(static_cast(1), pDPs->GetCount());
+CPPUNIT_ASSERT_EQUAL(OUString("TRUE"), rDoc.GetString(ScAddress(0, 1, 
0))); //A2
 
 // Reload and check filtering of row dimensions
 xDocSh = saveAndReload(*xDocSh, FORMAT_XLSX);
@@ -2213,11 +2214,11 @@ void 
ScPivotTableFiltersTest::testPivotTableBoolFieldFilterXLSX()
 
 const ScDPSaveDimension::MemberList& rMembers = pSaveDim->GetMembers();
 CPPUNIT_ASSERT_EQUAL(size_t(2), rMembers.size());
-ScDPSaveMember* pMember = pSaveDim->GetExistingMemberByName("0");
+ScDPSaveMember* pMember = pSaveDim->GetExistingMemberByName("FALSE");
 CPPUNIT_ASSERT(pMember);
 CPPUNIT_ASSERT(pMember->HasIsVisible());
 CPPUNIT_ASSERT(!pMember->GetIsVisible());
-pMember = pSaveDim->GetExistingMemberByName("1");
+pMember = pSaveDim->GetExistingMemberByName("TRUE");
 CPPUNIT_ASSERT(pMember);
 CPPUNIT_ASSERT(pMember->HasIsVisible());
 CPPUNIT_ASSERT(pMember->GetIsVisible());
diff --git a/sc/source/filter/excel/xestream.cxx 
b/sc/source/filter/excel/xestream.cxx
index 74c0f9514831..a3c1b92fe86d 100644
--- a/sc/source/filter/excel/xestream.cxx
+++ b/sc/source/filter/excel/xestream.cxx
@@ -673,8 +673,16 @@ void XclXmlUtils::GetFormulaTypeAndValue( ScFormulaCell& 
rCell, const char*& rsT
 rsValue = ToOUString(lcl_GetErrorString(aResValue.mnError));
 break;
 case sc::FormulaResultValue::Value:
-rsType = "n";
-rsValue = OUString::number(aResValue.mfValue);
+if (rCell.GetFormatType() == SvNumFormatType::LOGICAL)
+{
+rsType = "b";
+rsValue = rCell.GetValue() == 0.0 ? "0" : "1";
+}
+else
+{
+rsType = "n";
+rsValue = OUString::number(aResValue.mfValue);
+}
 break;
 case sc::FormulaResultValue::String:
 rsType = "str";
diff --git a/sc/source/filter/oox/formulabuffer.cxx 
b/sc/source/filter/oox/formulabuffer.cxx
index 2aeccb1b37b7..7fcc4f5e259f 100644
--- a/sc/source/filter/oox/formulabuffer.cxx
+++ b/sc/source/filter/oox/formulabuffer.cxx
@@ -153,6 +153,9 @@ void applySharedFormulas(
 pCell = new ScFormulaCell(rDoc.getDoc(), aPos, *pArray);
 
 rDoc.setFormulaCell(aPos, pCell);
+if (rDoc.getDoc().GetNumberFormat(aPos.Col(), aPos.Row(), 
aPos.Tab()) % SV_COUNTRY_LANGUAGE_OFFSET == 0)
+pCell->SetNeedNumberFormat(true);
+
 if (rDesc.maCellValue.isEmpty())
 {
 // No cached cell value. Mark it for re-calculation.
@@ -227,6 +230,8 @@ void applyCellFormulas(
 pCell = new ScFormulaCell(rDoc.getDoc(), aPos, 
p->mpCell->GetCode()->Clone());
 
 rDoc.setFormulaCell(aPos, pCell);
+if (rDoc.getDoc().GetNumberFormat(aPos.Col(), aPos.Row(), 
aPos.Tab()) % SV_COUNTRY_LANGUAGE_OFFSET == 0)
+pCell->SetNeedNumberFormat(true);
 
 // Update the cache.
 p->mnRow = aPos.Row();
@@ -245,6 +250,8 @@ void applyCellFormulas(
 
 ScFormulaCell* pCell = new ScFormulaCell(rDoc.getDoc(), aPos, 
std::move(pCode));
 rDoc.setFormulaCell(aPos, pCell);
+if (rDoc.getDoc().GetNumberFormat(aPos.Col(), aPos.Row(), aPos.Tab()) 
% SV_COUNTRY_LANGUAGE_OFFSET == 0)
+pCell->SetNeedNumberFormat(true);
 rCache.store(aPos, pCell);
 }
 }


[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - sc/source

2022-02-16 Thread Justin Luth (via logerrit)
 sc/source/core/data/table2.cxx |7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 0b59601e415d186565278289e4d3613f727ef75c
Author: Justin Luth 
AuthorDate: Wed Feb 9 20:17:53 2022 +0200
Commit: Christian Lohmaier 
CommitDate: Wed Feb 16 21:21:44 2022 +0100

tdf#113785 sc: IsDataFiltered must be normalized

I can't believe this hasn't caused major issues
and has survived as a bug for so long.

Due to the way IsDataFiltered is coded,
it is required that the range is normalized
in order to get any kind of meaningful result,
so lets ensure that.

Change-Id: I2ede77f738fbaeb05a0f1425a2e88e59fca08e9e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129735
Tested-by: Jenkins
Reviewed-by: Justin Luth 
(cherry picked from commit bda200a5e9c4592bd61b7924fa171ec3265bfd24)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129761
Reviewed-by: Eike Rathke 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130049
Reviewed-by: Christian Lohmaier 

diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index 95bef419c9a8..7ed03187b4b4 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -3665,6 +3665,8 @@ void ScTable::ShowRows(SCROW nRow1, SCROW nRow2, bool 
bShow)
 
 bool ScTable::IsDataFiltered(SCCOL nColStart, SCROW nRowStart, SCCOL nColEnd, 
SCROW nRowEnd) const
 {
+assert(nColStart <= nColEnd && nRowStart <= nRowEnd
+   && "range must be normalized to obtain a valid result");
 for (SCROW i = nRowStart; i <= nRowEnd; ++i)
 {
 if (RowHidden(i))
@@ -3680,8 +3682,9 @@ bool ScTable::IsDataFiltered(SCCOL nColStart, SCROW 
nRowStart, SCCOL nColEnd, SC
 
 bool ScTable::IsDataFiltered(const ScRange& rRange) const
 {
-return IsDataFiltered(rRange.aStart.Col(), rRange.aStart.Row(),
-rRange.aEnd.Col(), rRange.aEnd.Row());
+ScRange aNormalized(rRange.aStart, rRange.aEnd);
+return IsDataFiltered(aNormalized.aStart.Col(), aNormalized.aStart.Row(),
+  aNormalized.aEnd.Col(), aNormalized.aEnd.Row());
 }
 
 void ScTable::SetRowFlags( SCROW nRow, CRFlags nNewFlags )


[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - sc/source

2022-02-16 Thread Justin Luth (via logerrit)
 sc/source/core/data/table4.cxx |   20 
 1 file changed, 16 insertions(+), 4 deletions(-)

New commits:
commit 99191703b528d8d7b0b9c5d84d76a6fdebbf5191
Author: Justin Luth 
AuthorDate: Wed Feb 9 14:33:05 2022 +0200
Commit: Eike Rathke 
CommitDate: Wed Feb 16 12:03:02 2022 +0100

tdf#113785 sc FillAutoSimple: also optimize in negative direction

By only coding the optimization for the downward autofill,
it totally broke an upward autofill.
So this patch simply fixes the LO 4.3ish regression
from commit a995462e6855061816c6529c366f20ace2b45868.

This fix means that the non-hidden cells get the auto-value
instead of being erased.

However, the hidden cells are still erased
(which is the topic of tdf#119957).

I'm not going to bother with a unit test for this
portion. If I can solve bug 119957 as well,
then the unit test for that can cover both situations.

Change-Id: If6320ccf87fa8893ca6766c265b7760cc46ed7d8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129723
Tested-by: Jenkins
Reviewed-by: Justin Luth 
(cherry picked from commit 618084819babc839510860b74b36631749093c4c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129753
Reviewed-by: Xisco Fauli 
(cherry picked from commit f3035cdb6a8d3ef56180640ef9d04031012250b9)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129760
Reviewed-by: Eike Rathke 

diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx
index 0f1f7193fe59..73ad750d35c1 100644
--- a/sc/source/core/data/table4.cxx
+++ b/sc/source/core/data/table4.cxx
@@ -1782,16 +1782,28 @@ void ScTable::FillAutoSimple(
 bool bIsOrdinalSuffix = false;
 
 bool bColHidden = false, bRowHidden = false;
+SCCOL nColHiddenFirst = rDocument.MaxCol();
 SCCOL nColHiddenLast = -1;
+SCROW nRowHiddenFirst = rDocument.MaxRow();
 SCROW nRowHiddenLast = -1;
 
 rInner = nIStart;
 while (true)// #i53728# with "for (;;)" old solaris/x86 compiler 
mis-optimizes
 {
-if (rCol > nColHiddenLast)
-bColHidden = ColHidden(rCol, nullptr, );
-if (rRow > nRowHiddenLast)
-bRowHidden = RowHidden(rRow, nullptr, );
+if (bPositive)
+{
+if (rCol > nColHiddenLast)
+bColHidden = ColHidden(rCol, nullptr, );
+if (rRow > nRowHiddenLast)
+bRowHidden = RowHidden(rRow, nullptr, );
+}
+else
+{
+if (rCol < nColHiddenFirst)
+bColHidden = ColHidden(rCol, );
+if (rRow < nRowHiddenFirst)
+bRowHidden = RowHidden(rRow, );
+}
 
 if (!bColHidden && !bRowHidden)
 {


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

2022-02-10 Thread Justin Luth (via logerrit)
 sc/qa/uitest/calc_tests/autofill.py |   30 ++
 sc/qa/uitest/data/autofill.ods  |binary
 sc/source/core/data/table2.cxx  |7 +--
 3 files changed, 35 insertions(+), 2 deletions(-)

New commits:
commit 35302c773ab352f2a9681839c6c11c67d765fbe8
Author: Justin Luth 
AuthorDate: Wed Feb 9 20:17:53 2022 +0200
Commit: Eike Rathke 
CommitDate: Thu Feb 10 16:02:11 2022 +0100

tdf#113785 sc: IsDataFiltered must be normalized

I can't believe this hasn't caused major issues
and has survived as a bug for so long.

Due to the way IsDataFiltered is coded,
it is required that the range is normalized
in order to get any kind of meaningful result,
so lets ensure that.

Change-Id: I2ede77f738fbaeb05a0f1425a2e88e59fca08e9e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129735
Tested-by: Jenkins
Reviewed-by: Justin Luth 
(cherry picked from commit bda200a5e9c4592bd61b7924fa171ec3265bfd24)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129761
Reviewed-by: Eike Rathke 

diff --git a/sc/qa/uitest/calc_tests/autofill.py 
b/sc/qa/uitest/calc_tests/autofill.py
index cdd92ea30947..594d29872a47 100644
--- a/sc/qa/uitest/calc_tests/autofill.py
+++ b/sc/qa/uitest/calc_tests/autofill.py
@@ -47,6 +47,36 @@ class CalcAutofill(UITestCase):
 self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 
10).getValue(), 17.34)
 self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 
11).getValue(), 18.34)
 
+#Test that hidden cells are not affected / skipped in the 
increment process.
+#Simulate selecting cell A26 and dragging the fill handle in the 
bottom right corner of the cell down to A32
+gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": 
"A26:A32"}))
+with 
self.ui_test.execute_dialog_through_command(".uno:FillSeries"):
+pass
+self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 
25).getValue(), 18.34)
+self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 
26).getValue(), 19.34)
+self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 
27).getValue(), 5.0) #hidden
+self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 
28).getValue(), 5.0) #hidden
+self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 
29).getString(), "hiddenA30")
+self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 
30).getValue(), 20.34) #overwrite "rows"
+self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 
31).getValue(), 21.34)
+#Simulate selecting cell A26 and dragging the fill handle in the 
bottom right corner of the cell up to A19
+#   Note: start at empty cell A19 so Sheet - Fill Cells - Fill 
Series has good defaults
+gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": 
"A19:A26"}))
+with 
self.ui_test.execute_dialog_through_command(".uno:FillSeries") as xDialog:
+xup = xDialog.getChild("up")
+xincrement = xDialog.getChild("increment")
+xup.executeAction("CLICK", tuple())
+xincrement.executeAction("TYPE", 
mkPropertyValues({"KEYCODE":"CTRL+A"}))
+xincrement.executeAction("TYPE", 
mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+xincrement.executeAction("TYPE", 
mkPropertyValues({"TEXT":"-1"}))
+self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 
19).getString(), "hiddenA20")
+self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 
20).getValue(), 15.34)
+self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 
21).getValue(), 5.0) #hidden
+self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 
22).getValue(), 16.34) #overwrite "testing"
+self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 
23).getValue(), 5.0) #hidden
+self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 
24).getValue(), 17.34) #overwrite "hidden"
+self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 
25).getValue(), 18.34)
+
 #Continue with the next cells with grey background
 gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": 
"M12:M18"}))
 with 
self.ui_test.execute_dialog_through_command(".uno:FillSeries"):
diff --git a/sc/qa/uitest/data/autofill.ods b/sc/qa/uitest/data/autofill.ods
index 4456e8c8..90bf933c0c26 100644
Binary files a/sc/qa/uitest/data/autofill.ods and 
b/sc/qa/uitest/data/autofill.ods differ
diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index 40c515b9b10b..f78a17fe3eed 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -3671,6 +3671,8 @@ void ScTable::ShowRows(SCROW nRow1, SCROW nRow2, bool 
bShow)
 
 bool ScTable::IsDataFiltered(SCCOL nColStart, SCROW nRowStart, SCCOL nColEnd, 
SCROW nRowEnd) const
 {
+assert(nColStart <= 

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

2022-02-10 Thread Justin Luth (via logerrit)
 sc/source/core/data/table4.cxx |   20 
 1 file changed, 16 insertions(+), 4 deletions(-)

New commits:
commit f3035cdb6a8d3ef56180640ef9d04031012250b9
Author: Justin Luth 
AuthorDate: Wed Feb 9 14:33:05 2022 +0200
Commit: Xisco Fauli 
CommitDate: Thu Feb 10 10:53:08 2022 +0100

tdf#113785 sc FillAutoSimple: also optimize in negative direction

By only coding the optimization for the downward autofill,
it totally broke an upward autofill.
So this patch simply fixes the LO 4.3ish regression
from commit a995462e6855061816c6529c366f20ace2b45868.

This fix means that the non-hidden cells get the auto-value
instead of being erased.

However, the hidden cells are still erased
(which is the topic of tdf#119957).

I'm not going to bother with a unit test for this
portion. If I can solve bug 119957 as well,
then the unit test for that can cover both situations.

Change-Id: If6320ccf87fa8893ca6766c265b7760cc46ed7d8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129723
Tested-by: Jenkins
Reviewed-by: Justin Luth 
(cherry picked from commit 618084819babc839510860b74b36631749093c4c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129753
Reviewed-by: Xisco Fauli 

diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx
index 6ef2c3b439b2..d2fdde2718b8 100644
--- a/sc/source/core/data/table4.cxx
+++ b/sc/source/core/data/table4.cxx
@@ -1782,16 +1782,28 @@ void ScTable::FillAutoSimple(
 bool bIsOrdinalSuffix = false;
 
 bool bColHidden = false, bRowHidden = false;
+SCCOL nColHiddenFirst = rDocument.MaxCol();
 SCCOL nColHiddenLast = -1;
+SCROW nRowHiddenFirst = rDocument.MaxRow();
 SCROW nRowHiddenLast = -1;
 
 rInner = nIStart;
 while (true)// #i53728# with "for (;;)" old solaris/x86 compiler 
mis-optimizes
 {
-if (rCol > nColHiddenLast)
-bColHidden = ColHidden(rCol, nullptr, );
-if (rRow > nRowHiddenLast)
-bRowHidden = RowHidden(rRow, nullptr, );
+if (bPositive)
+{
+if (rCol > nColHiddenLast)
+bColHidden = ColHidden(rCol, nullptr, );
+if (rRow > nRowHiddenLast)
+bRowHidden = RowHidden(rRow, nullptr, );
+}
+else
+{
+if (rCol < nColHiddenFirst)
+bColHidden = ColHidden(rCol, );
+if (rRow < nRowHiddenFirst)
+bRowHidden = RowHidden(rRow, );
+}
 
 if (!bColHidden && !bRowHidden)
 {


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

2022-02-10 Thread Justin Luth (via logerrit)
 sc/qa/uitest/calc_tests/autofill.py |   30 ++
 sc/qa/uitest/data/autofill.ods  |binary
 sc/source/core/data/table2.cxx  |7 +--
 3 files changed, 35 insertions(+), 2 deletions(-)

New commits:
commit bda200a5e9c4592bd61b7924fa171ec3265bfd24
Author: Justin Luth 
AuthorDate: Wed Feb 9 20:17:53 2022 +0200
Commit: Justin Luth 
CommitDate: Thu Feb 10 10:04:18 2022 +0100

tdf#113785 sc: IsDataFiltered must be normalized

I can't believe this hasn't caused major issues
and has survived as a bug for so long.

Due to the way IsDataFiltered is coded,
it is required that the range is normalized
in order to get any kind of meaningful result,
so lets ensure that.

Change-Id: I2ede77f738fbaeb05a0f1425a2e88e59fca08e9e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129735
Tested-by: Jenkins
Reviewed-by: Justin Luth 

diff --git a/sc/qa/uitest/calc_tests/autofill.py 
b/sc/qa/uitest/calc_tests/autofill.py
index bdb45d00c9c9..294d60fd7102 100644
--- a/sc/qa/uitest/calc_tests/autofill.py
+++ b/sc/qa/uitest/calc_tests/autofill.py
@@ -49,6 +49,36 @@ class CalcAutofill(UITestCase):
 self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 
10).getValue(), 17.34)
 self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 
11).getValue(), 18.34)
 
+#Test that hidden cells are not affected / skipped in the 
increment process.
+#Simulate selecting cell A26 and dragging the fill handle in the 
bottom right corner of the cell down to A32
+gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": 
"A26:A32"}))
+with 
self.ui_test.execute_dialog_through_command(".uno:FillSeries"):
+pass
+self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 
25).getValue(), 18.34)
+self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 
26).getValue(), 19.34)
+self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 
27).getValue(), 5.0) #hidden
+self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 
28).getValue(), 5.0) #hidden
+self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 
29).getString(), "hiddenA30")
+self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 
30).getValue(), 20.34) #overwrite "rows"
+self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 
31).getValue(), 21.34)
+#Simulate selecting cell A26 and dragging the fill handle in the 
bottom right corner of the cell up to A19
+#   Note: start at empty cell A19 so Sheet - Fill Cells - Fill 
Series has good defaults
+gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": 
"A19:A26"}))
+with 
self.ui_test.execute_dialog_through_command(".uno:FillSeries") as xDialog:
+xup = xDialog.getChild("up")
+xincrement = xDialog.getChild("increment")
+xup.executeAction("CLICK", tuple())
+xincrement.executeAction("TYPE", 
mkPropertyValues({"KEYCODE":"CTRL+A"}))
+xincrement.executeAction("TYPE", 
mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+xincrement.executeAction("TYPE", 
mkPropertyValues({"TEXT":"-1"}))
+self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 
19).getString(), "hiddenA20")
+self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 
20).getValue(), 15.34)
+self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 
21).getValue(), 5.0) #hidden
+self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 
22).getValue(), 16.34) #overwrite "testing"
+self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 
23).getValue(), 5.0) #hidden
+self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 
24).getValue(), 17.34) #overwrite "hidden"
+self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 
25).getValue(), 18.34)
+
 #Continue with the next cells with grey background
 gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": 
"M12:M18"}))
 with 
self.ui_test.execute_dialog_through_command(".uno:FillSeries"):
diff --git a/sc/qa/uitest/data/autofill.ods b/sc/qa/uitest/data/autofill.ods
index 4456e8c8..90bf933c0c26 100644
Binary files a/sc/qa/uitest/data/autofill.ods and 
b/sc/qa/uitest/data/autofill.ods differ
diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index fa322f333821..a19549e89f9d 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -3666,6 +3666,8 @@ void ScTable::ShowRows(SCROW nRow1, SCROW nRow2, bool 
bShow)
 
 bool ScTable::IsDataFiltered(SCCOL nColStart, SCROW nRowStart, SCCOL nColEnd, 
SCROW nRowEnd) const
 {
+assert(nColStart <= nColEnd && nRowStart <= nRowEnd
+   && "range must be normalized to obtain a valid result");
 for (SCROW i = nRowStart; i <= nRowEnd; ++i)
 {
 

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

2022-02-10 Thread Justin Luth (via logerrit)
 sw/qa/extras/ww8export/data/tdf79186_noLayoutInCell.odt |binary
 sw/qa/extras/ww8export/ww8export3.cxx   |8 
 sw/source/filter/ww8/escher.hxx |1 +
 sw/source/filter/ww8/wrtw8esh.cxx   |   16 ++--
 4 files changed, 23 insertions(+), 2 deletions(-)

New commits:
commit 98ecef56d0f87cd922ca560fead4e2533b30d57c
Author: Justin Luth 
AuthorDate: Mon Feb 7 20:41:19 2022 +0200
Commit: Justin Luth 
CommitDate: Thu Feb 10 09:11:49 2022 +0100

tdf#79186 ww8export: save LayoutInCell property

This property was saved in DOCX, but not in DOC format.
The field can hold 16 values, even though we only handle
this one on import.

This patch depends on the previous patch which re-worked
the import side to default to "true".

Since the default is to LayoutInCell, I don't see
any reason to add this property when true.
The only reason would be if this property can be
inherited from somewhere else, and a true needs
to override the inheritance, but I'm not aware
that such an inheritance exists in this case.

Change-Id: If42f7b1dc49c69a69552e841b93576f638b6d1d8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129658
Tested-by: Jenkins
Reviewed-by: Justin Luth 

diff --git a/sw/qa/extras/ww8export/data/tdf79186_noLayoutInCell.odt 
b/sw/qa/extras/ww8export/data/tdf79186_noLayoutInCell.odt
new file mode 100644
index ..e512f09072ce
Binary files /dev/null and 
b/sw/qa/extras/ww8export/data/tdf79186_noLayoutInCell.odt differ
diff --git a/sw/qa/extras/ww8export/ww8export3.cxx 
b/sw/qa/extras/ww8export/ww8export3.cxx
index 8e894c711457..feb759312d15 100644
--- a/sw/qa/extras/ww8export/ww8export3.cxx
+++ b/sw/qa/extras/ww8export/ww8export3.cxx
@@ -987,6 +987,14 @@ DECLARE_WW8EXPORT_TEST(testTdf136814, "tdf136814.odt")
 CPPUNIT_ASSERT_EQUAL(nBorderDistance, getProperty(xStyle, 
"LeftBorderDistance"));
 }
 
+DECLARE_WW8EXPORT_TEST(testTdf79186_noLayoutInCell, 
"tdf79186_noLayoutInCell.odt")
+{
+CPPUNIT_ASSERT_EQUAL(1, getShapes());
+CPPUNIT_ASSERT_EQUAL(1, getPages());
+
+CPPUNIT_ASSERT(!getProperty(getShape(1), "IsFollowingTextFlow"));
+}
+
 
 CPPUNIT_PLUGIN_IMPLEMENT();
 
diff --git a/sw/source/filter/ww8/escher.hxx b/sw/source/filter/ww8/escher.hxx
index 91f90685a18e..c11fda1ebf16 100644
--- a/sw/source/filter/ww8/escher.hxx
+++ b/sw/source/filter/ww8/escher.hxx
@@ -68,6 +68,7 @@ public:
 
 private:
 bool mbInline;
+sal_uInt32 mnGroupShapeBooleanProperties;
 sal_uInt32 mnXAlign;
 sal_uInt32 mnYAlign;
 sal_uInt32 mnXRelTo;
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx 
b/sw/source/filter/ww8/wrtw8esh.cxx
index 60c8e9f4c352..6325e691c2ec 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -1431,9 +1431,11 @@ void WinwordAnchoring::WriteData( EscherEx& rEx ) const
 
 SvStream& rSt = rEx.GetStream();
 //The last argument denotes the number of sub properties in this atom
+int nSubProps = mnGroupShapeBooleanProperties ? 1 : 0;
 if (mbInline)
 {
-rEx.AddAtom(18, DFF_msofbtUDefProp, 3, 3); //Prop id is 0xF122
+nSubProps += 3;
+rEx.AddAtom(6 * nSubProps, DFF_msofbtUDefProp, 3, nSubProps); // Prop 
id is 0xF122
 rSt.WriteUInt16( 0x0390 ).WriteUInt32( 3 );
 rSt.WriteUInt16( 0x0392 ).WriteUInt32( 3 );
 //This sub property is required to be in the dummy inline frame as
@@ -1442,12 +1444,15 @@ void WinwordAnchoring::WriteData( EscherEx& rEx ) const
 }
 else
 {
-rEx.AddAtom(24, DFF_msofbtUDefProp, 3, 4 ); //Prop id is 0xF122
+nSubProps += 4;
+rEx.AddAtom(6 * nSubProps, DFF_msofbtUDefProp, 3, nSubProps); // Prop 
id is 0xF122
 rSt.WriteUInt16( 0x038F ).WriteUInt32( mnXAlign );
 rSt.WriteUInt16( 0x0390 ).WriteUInt32( mnXRelTo );
 rSt.WriteUInt16( 0x0391 ).WriteUInt32( mnYAlign );
 rSt.WriteUInt16( 0x0392 ).WriteUInt32( mnYRelTo );
 }
+if (mnGroupShapeBooleanProperties)
+rSt.WriteUInt16(0x03BF).WriteUInt32(mnGroupShapeBooleanProperties);
 }
 
 void WW8Export::CreateEscher()
@@ -2595,6 +2600,13 @@ void WinwordAnchoring::SetAnchoring(const SwFrameFormat& 
rFormat)
 const RndStdIds eAnchor = rFormat.GetAnchor().GetAnchorId();
 mbInline = (eAnchor == RndStdIds::FLY_AS_CHAR);
 
+mnGroupShapeBooleanProperties = 0;
+if (!rFormat.GetFollowTextFlow().GetValue())
+{
+// bit32: fUseLayoutInCell, bit16: fLayoutInCell
+mnGroupShapeBooleanProperties |= 0x8000;
+}
+
 SwFormatHoriOrient rHoriOri = rFormat.GetHoriOrient();
 SwFormatVertOrient rVertOri = rFormat.GetVertOrient();
 


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

2022-02-09 Thread Justin Luth (via logerrit)
 sc/source/core/data/table4.cxx |   20 
 1 file changed, 16 insertions(+), 4 deletions(-)

New commits:
commit 618084819babc839510860b74b36631749093c4c
Author: Justin Luth 
AuthorDate: Wed Feb 9 14:33:05 2022 +0200
Commit: Justin Luth 
CommitDate: Wed Feb 9 19:10:15 2022 +0100

tdf#113785 sc FillAutoSimple: also optimize in negative direction

By only coding the optimization for the downward autofill,
it totally broke an upward autofill.
So this patch simply fixes the LO 4.3ish regression
from commit a995462e6855061816c6529c366f20ace2b45868.

This fix means that the non-hidden cells get the auto-value
instead of being erased.

However, the hidden cells are still erased
(which is the topic of tdf#119957).

I'm not going to bother with a unit test for this
portion. If I can solve bug 119957 as well,
then the unit test for that can cover both situations.

Change-Id: If6320ccf87fa8893ca6766c265b7760cc46ed7d8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129723
Tested-by: Jenkins
Reviewed-by: Justin Luth 

diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx
index 88d4395eaced..5c7c00dc1ff0 100644
--- a/sc/source/core/data/table4.cxx
+++ b/sc/source/core/data/table4.cxx
@@ -1782,16 +1782,28 @@ void ScTable::FillAutoSimple(
 bool bIsOrdinalSuffix = false;
 
 bool bColHidden = false, bRowHidden = false;
+SCCOL nColHiddenFirst = rDocument.MaxCol();
 SCCOL nColHiddenLast = -1;
+SCROW nRowHiddenFirst = rDocument.MaxRow();
 SCROW nRowHiddenLast = -1;
 
 rInner = nIStart;
 while (true)// #i53728# with "for (;;)" old solaris/x86 compiler 
mis-optimizes
 {
-if (rCol > nColHiddenLast)
-bColHidden = ColHidden(rCol, nullptr, );
-if (rRow > nRowHiddenLast)
-bRowHidden = RowHidden(rRow, nullptr, );
+if (bPositive)
+{
+if (rCol > nColHiddenLast)
+bColHidden = ColHidden(rCol, nullptr, );
+if (rRow > nRowHiddenLast)
+bRowHidden = RowHidden(rRow, nullptr, );
+}
+else
+{
+if (rCol < nColHiddenFirst)
+bColHidden = ColHidden(rCol, );
+if (rRow < nRowHiddenFirst)
+bRowHidden = RowHidden(rRow, );
+}
 
 if (!bColHidden && !bRowHidden)
 {


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

2022-02-08 Thread Justin Luth (via logerrit)
 filter/source/msfilter/msdffimp.cxx  |6 +++---
 include/filter/msfilter/msdffimp.hxx |2 +-
 sw/source/filter/ww8/ww8graf.cxx |   30 +-
 sw/source/filter/ww8/ww8par.cxx  |6 ++
 sw/source/filter/ww8/ww8par.hxx  |2 +-
 5 files changed, 16 insertions(+), 30 deletions(-)

New commits:
commit 19a5e50955ecc8da7ff5dbdfb9f47352d851ee1d
Author: Justin Luth 
AuthorDate: Tue Feb 8 08:06:52 2022 +0200
Commit: Justin Luth 
CommitDate: Wed Feb 9 08:19:24 2022 +0100

related tdf#79186 filter: value is more than just LayoutInCell

nGroupShapeBooleanProperties contains 16 shape properties
and 16 flags to indicate whether they are to be used or not.
Up till now, only fLayoutInCell has been used by LO,
but it handles far more than that, so lets change the code
(now that we have the documentation for it)
to make it clear that this could be useful for further
compatibility fixes.

There is no need to determine whether the setting
has been provided or not - since a zero default indicates
everything in this bit-set should be ignored.

The naming and the if clause in ww8graf.cxx suggests that
reverse engineering didn't really grasp how this worked,
so I took the liberty of removing all of that awkwardness,
and verified that at least several associated document
from the OOo Apache bugtracker still worked.

===
https://docs.microsoft.com/en-us/openspecs/office_file_formats
/ms-odraw/a0ae6aa5-16e4-4550-87a2-b8ca180c7fd7

fLayoutInCell (1 bit): A bit that specifies whether this shape
is displayed inside a table cell. If fUsefLayoutInCell equals 0x0,
this value MUST be ignored.
The default value for this property is 0x1.

Change-Id: I82f80123a7419a83737b796f253406576732b6c7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129657
Tested-by: Jenkins
Reviewed-by: Justin Luth 

diff --git a/filter/source/msfilter/msdffimp.cxx 
b/filter/source/msfilter/msdffimp.cxx
index 8832617a4e58..a0ecad074ac6 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -5158,7 +5158,7 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt,
 case 0x0392:
 pImpRec->nYRelTo = nUDData;
 break;
-case 0x03BF: pImpRec->nLayoutInTableCell = nUDData; break;
+case 0x03BF: pImpRec->nGroupShapeBooleanProperties = 
nUDData; break;
 case 0x0393:
 // This seems to correspond to o:hrpct from .docx (even 
including
 // the difference that it's in 0.1% even though the .docx 
spec
@@ -7413,7 +7413,7 @@ SvxMSDffImportRec::SvxMSDffImportRec()
   nClientDataLen(0 ),
   nXAlign( 0 ), // position n cm from left
   nYAlign( 0 ), // position n cm below
-  nLayoutInTableCell( 0 ), // element is laid out in table cell
+  nGroupShapeBooleanProperties(0), // 16 settings: 
LayoutInCell/AllowOverlap/BehindDocument...
   nFlags( ShapeFlag::NONE ),
   nDxTextLeft( 144 ),
   nDyTextTop( 72 ),
@@ -7450,7 +7450,7 @@ SvxMSDffImportRec::SvxMSDffImportRec(const 
SvxMSDffImportRec& rCopy)
   nXRelTo( rCopy.nXRelTo ),
   nYAlign( rCopy.nYAlign ),
   nYRelTo( rCopy.nYRelTo ),
-  nLayoutInTableCell( rCopy.nLayoutInTableCell ),
+  nGroupShapeBooleanProperties(rCopy.nGroupShapeBooleanProperties),
   nFlags( rCopy.nFlags ),
   nDxTextLeft( rCopy.nDxTextLeft),
   nDyTextTop( rCopy.nDyTextTop ),
diff --git a/include/filter/msfilter/msdffimp.hxx 
b/include/filter/msfilter/msdffimp.hxx
index 581d5586a78b..f56738e0050a 100644
--- a/include/filter/msfilter/msdffimp.hxx
+++ b/include/filter/msfilter/msdffimp.hxx
@@ -228,7 +228,7 @@ struct MSFILTER_DLLPUBLIC SvxMSDffImportRec
 std::optional nXRelTo;
 sal_uInt32  nYAlign;
 std::optional nYRelTo;
-sal_uInt32  nLayoutInTableCell;
+sal_uInt32  nGroupShapeBooleanProperties;
 ShapeFlag   nFlags;
 sal_Int32   nDxTextLeft;///< distance of text box from surrounding 
shape
 sal_Int32   nDyTextTop;
diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx
index 113016dc036b..3cb0aebf6bc8 100644
--- a/sw/source/filter/ww8/ww8graf.cxx
+++ b/sw/source/filter/ww8/ww8graf.cxx
@@ -2402,7 +2402,7 @@ RndStdIds 
SwWW8ImplReader::ProcessEscherAlign(SvxMSDffImportRec& rRecord, WW8_FS
 if (m_nInTable &&
 (eHoriRel == text::RelOrientation::FRAME || eHoriRel == 
text::RelOrientation::CHAR) &&
 rFSPA.nwr == 3 &&
-!IsObjectLayoutInTableCell(rRecord.nLayoutInTableCell))
+!IsObjectLayoutInTableCell(rRecord.nGroupShapeBooleanProperties))
 {
 eHoriRel = text::RelOrientation::PAGE_PRINT_AREA;
 }
@@ -2452,7 

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

2022-02-08 Thread Justin Luth (via logerrit)
 include/svl/srchitem.hxx|3 +++
 sd/qa/uitest/findReplace/findReplace.py |7 +++
 sd/source/ui/view/Outliner.cxx  |   12 
 svl/source/items/srchitem.cxx   |   21 -
 4 files changed, 34 insertions(+), 9 deletions(-)

New commits:
commit 0e1d4fec1b701c334c1e320f4d58c939aaa82910
Author: Justin Luth 
AuthorDate: Wed Feb 2 10:44:23 2022 +0200
Commit: Xisco Fauli 
CommitDate: Tue Feb 8 09:35:26 2022 +0100

tdf#145868 sd replace: if search changes, restart find/replace

REPLACE is really a replaceAndFind instead of a findAndReplace.
Thus, when you changed your search parameter and did a replace,
it replaced the previously searched for item, and then found the
first instance of the new search parameter.
That of course is just wrong.

So make sure to verify that the previous search
matches the current search competely.
However, that doesn't mean that the entire searchItem matches,
since we don't want to restart the search just
because the replace parameter changed.

In my testing, this wasn't an issue for REPLACE_ALL.
So the only time we need to worry about the last search
result is in a replace once situation.

P.S. This commit exposed that mpSearchItem can point
to a destructed SvxSearchItem, so this patches unit test
will crash if the other 7.4 commit is missing.

Change-Id: I7be14d64534018718145c6ac5f8629ff5f2e5611
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129385
Tested-by: Jenkins
Reviewed-by: Justin Luth 
Reviewed-by: Tomaž Vajngerl 
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129630

diff --git a/include/svl/srchitem.hxx b/include/svl/srchitem.hxx
index c7f7381f77c6..7aa403211ed6 100644
--- a/include/svl/srchitem.hxx
+++ b/include/svl/srchitem.hxx
@@ -108,6 +108,9 @@ public:
 // ConfigItem
 virtual voidNotify( const css::uno::Sequence< OUString > 
 ) override;
 
+bool equalsIgnoring(const SvxSearchItem& rSItem, bool bIgnoreReplace,
+bool bIgnoreCommand) const;
+
 SvxSearchCmdGetCommand() const { return m_nCommand; }
 voidSetCommand(SvxSearchCmd nNewCommand) { m_nCommand 
= nNewCommand; }
 
diff --git a/sd/qa/uitest/findReplace/findReplace.py 
b/sd/qa/uitest/findReplace/findReplace.py
index 35afe95d43ee..82e1a4990872 100644
--- a/sd/qa/uitest/findReplace/findReplace.py
+++ b/sd/qa/uitest/findReplace/findReplace.py
@@ -83,8 +83,8 @@ class findReplace(UITestCase):
 
 self.assertEqual("Replace first first", 
impress_doc.DrawPages[0].getByIndex(1).String)
 self.assertEqual("second", 
impress_doc.DrawPages[1].getByIndex(1).String)
-# FIXME: tdf#145868
-self.assertEqual("Replace", 
impress_doc.DrawPages[2].getByIndex(1).String)
+# tdf#145868 - Third was search for earlier, but never should 
have been replaced
+self.assertEqual("Third", 
impress_doc.DrawPages[2].getByIndex(1).String)
 self.assertEqual("Text size 16", 
impress_doc.DrawPages[3].getByIndex(1).String)
 
 replaceterm = xDialog.getChild("replaceterm")
@@ -100,8 +100,7 @@ class findReplace(UITestCase):
 # AssertionError: 'Replace aaa aaa' != 'Replace first first'
 self.assertEqual("Replace aaa aaa", 
impress_doc.DrawPages[0].getByIndex(1).String)
 self.assertEqual("second", 
impress_doc.DrawPages[1].getByIndex(1).String)
-# FIXME: tdf#145868
-self.assertEqual("Replace", 
impress_doc.DrawPages[2].getByIndex(1).String)
+self.assertEqual("Third", 
impress_doc.DrawPages[2].getByIndex(1).String)
 self.assertEqual("Text size 16", 
impress_doc.DrawPages[3].getByIndex(1).String)
 
 # vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx
index 23353ba87c82..26c8347d5bf5 100644
--- a/sd/source/ui/view/Outliner.cxx
+++ b/sd/source/ui/view/Outliner.cxx
@@ -425,6 +425,18 @@ bool SdOutliner::StartSearchAndReplace (const 
SvxSearchItem* pSearchItem)
 SvxSearchDialogWrapper::SetSearchLabel(SearchLabel::Empty);
 
 mpDrawDocument->GetDocSh()->SetWaitCursor( true );
+
+// Since REPLACE is really a replaceAndSearchNext instead of a 
searchAndReplace,
+// make sure that the search portion has not changed since the last FIND.
+if (!mbPrepareSpellingPending && mpSearchItem
+&& pSearchItem->GetCommand() == SvxSearchCmd::REPLACE
+&& !mpSearchItem->equalsIgnoring(*pSearchItem, /*bIgnoreReplace=*/true,
+/*bIgnoreCommand=*/true))
+{
+EndSpelling();
+mbPrepareSpellingPending = true;
+}
+
 if (mbPrepareSpellingPending)
 PrepareSpelling();
 sd::ViewShellBase* pBase = getViewShellBase();
diff 

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

2022-02-08 Thread Justin Luth (via logerrit)
 sd/inc/Outliner.hxx|2 +-
 sd/source/ui/view/Outliner.cxx |3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

New commits:
commit dc3f27c910f455fce7a3afe3115ba51effd5e63f
Author: Justin Luth 
AuthorDate: Wed Feb 2 11:00:07 2022 +0200
Commit: Xisco Fauli 
CommitDate: Tue Feb 8 09:32:43 2022 +0100

related tdf#145868 sd: Clone SvxSearchItem to avoid use after free

I tested "if (mpSearchItem)" which passed, but then it
crashed when trying to access (*mpSearchItem) == (*pSearchItem)
because the mpSearchItem's DTOR had already been called
prior to the if(mpSearchItem).

Since mpSearchItem is never compared to another
memory pointer, it is safe to assign it to a Clone.

Steps to reproduce:
1.) open Impress and search for something
2.) change the search string to something else
3.) search again.

Note that there isn't currently any code that hits this.
I discovered it trying to craft a fix for bug 145868.

Change-Id: Idc5f5a3e812ed3e49631347c35c3f4b2d8bb4127
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129347
Tested-by: Jenkins
Tested-by: Caolán McNamara 
Reviewed-by: Justin Luth 
Reviewed-by: Caolán McNamara 
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129629

diff --git a/sd/inc/Outliner.hxx b/sd/inc/Outliner.hxx
index 772040f7a610..4a7100db3bb1 100644
--- a/sd/inc/Outliner.hxx
+++ b/sd/inc/Outliner.hxx
@@ -316,7 +316,7 @@ private:
 search.  It is set every time the
 SearchAndReplaceAll method is called.
 */
-const SvxSearchItem* mpSearchItem;
+std::unique_ptr mpSearchItem;
 
 /// The actual object iterator.
 ::sd::outliner::Iterator maObjectIterator;
diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx
index 0f77f2070219..23353ba87c82 100644
--- a/sd/source/ui/view/Outliner.cxx
+++ b/sd/source/ui/view/Outliner.cxx
@@ -154,7 +154,6 @@ SdOutliner::SdOutliner( SdDrawDocument* pDoc, OutlinerMode 
nMode )
   meStartEditMode(EditMode::Page),
   mnStartPageIndex(sal_uInt16(-1)),
   mpStartEditedObject(nullptr),
-  mpSearchItem(nullptr),
   mbPrepareSpellingPending(true)
 {
 SetStyleSheetPool(static_cast( 
mpDrawDocument->GetStyleSheetPool() ));
@@ -464,7 +463,7 @@ bool SdOutliner::StartSearchAndReplace (const 
SvxSearchItem* pSearchItem)
 if ( ! bAbort)
 {
 meMode = SEARCH;
-mpSearchItem = pSearchItem;
+mpSearchItem = std::unique_ptr(pSearchItem->Clone());
 
 mbFoundObject = false;
 


[Libreoffice-commits] core.git: include/svl sd/qa sd/source svl/source

2022-02-07 Thread Justin Luth (via logerrit)
 include/svl/srchitem.hxx|3 +++
 sd/qa/uitest/findReplace/findReplace.py |7 +++
 sd/source/ui/view/Outliner.cxx  |   12 
 svl/source/items/srchitem.cxx   |   21 -
 4 files changed, 34 insertions(+), 9 deletions(-)

New commits:
commit 32c946c064cc2889bda2f46c1862e5100f0a257a
Author: Justin Luth 
AuthorDate: Wed Feb 2 10:44:23 2022 +0200
Commit: Tomaž Vajngerl 
CommitDate: Mon Feb 7 10:04:17 2022 +0100

tdf#145868 sd replace: if search changes, restart find/replace

REPLACE is really a replaceAndFind instead of a findAndReplace.
Thus, when you changed your search parameter and did a replace,
it replaced the previously searched for item, and then found the
first instance of the new search parameter.
That of course is just wrong.

So make sure to verify that the previous search
matches the current search competely.
However, that doesn't mean that the entire searchItem matches,
since we don't want to restart the search just
because the replace parameter changed.

In my testing, this wasn't an issue for REPLACE_ALL.
So the only time we need to worry about the last search
result is in a replace once situation.

P.S. This commit exposed that mpSearchItem can point
to a destructed SvxSearchItem, so this patches unit test
will crash if the other 7.4 commit is missing.

Change-Id: I7be14d64534018718145c6ac5f8629ff5f2e5611
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129385
Tested-by: Jenkins
Reviewed-by: Justin Luth 
Reviewed-by: Tomaž Vajngerl 

diff --git a/include/svl/srchitem.hxx b/include/svl/srchitem.hxx
index c7f7381f77c6..7aa403211ed6 100644
--- a/include/svl/srchitem.hxx
+++ b/include/svl/srchitem.hxx
@@ -108,6 +108,9 @@ public:
 // ConfigItem
 virtual voidNotify( const css::uno::Sequence< OUString > 
 ) override;
 
+bool equalsIgnoring(const SvxSearchItem& rSItem, bool bIgnoreReplace,
+bool bIgnoreCommand) const;
+
 SvxSearchCmdGetCommand() const { return m_nCommand; }
 voidSetCommand(SvxSearchCmd nNewCommand) { m_nCommand 
= nNewCommand; }
 
diff --git a/sd/qa/uitest/findReplace/findReplace.py 
b/sd/qa/uitest/findReplace/findReplace.py
index f33dd44d40ce..0e4bd4c12f73 100644
--- a/sd/qa/uitest/findReplace/findReplace.py
+++ b/sd/qa/uitest/findReplace/findReplace.py
@@ -85,8 +85,8 @@ class findReplace(UITestCase):
 
 self.assertEqual("Replace first first", 
impress_doc.DrawPages[0].getByIndex(1).String)
 self.assertEqual("second", 
impress_doc.DrawPages[1].getByIndex(1).String)
-# FIXME: tdf#145868
-self.assertEqual("Replace", 
impress_doc.DrawPages[2].getByIndex(1).String)
+# tdf#145868 - Third was search for earlier, but never should 
have been replaced
+self.assertEqual("Third", 
impress_doc.DrawPages[2].getByIndex(1).String)
 self.assertEqual("Text size 16", 
impress_doc.DrawPages[3].getByIndex(1).String)
 
 replaceterm = xDialog.getChild("replaceterm")
@@ -102,8 +102,7 @@ class findReplace(UITestCase):
 # AssertionError: 'Replace aaa aaa' != 'Replace first first'
 self.assertEqual("Replace aaa aaa", 
impress_doc.DrawPages[0].getByIndex(1).String)
 self.assertEqual("second", 
impress_doc.DrawPages[1].getByIndex(1).String)
-# FIXME: tdf#145868
-self.assertEqual("Replace", 
impress_doc.DrawPages[2].getByIndex(1).String)
+self.assertEqual("Third", 
impress_doc.DrawPages[2].getByIndex(1).String)
 self.assertEqual("Text size 16", 
impress_doc.DrawPages[3].getByIndex(1).String)
 
 # vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx
index e03b56bf1a3d..342b01b050dc 100644
--- a/sd/source/ui/view/Outliner.cxx
+++ b/sd/source/ui/view/Outliner.cxx
@@ -425,6 +425,18 @@ bool SdOutliner::StartSearchAndReplace (const 
SvxSearchItem* pSearchItem)
 SvxSearchDialogWrapper::SetSearchLabel(SearchLabel::Empty);
 
 mpDrawDocument->GetDocSh()->SetWaitCursor( true );
+
+// Since REPLACE is really a replaceAndSearchNext instead of a 
searchAndReplace,
+// make sure that the search portion has not changed since the last FIND.
+if (!mbPrepareSpellingPending && mpSearchItem
+&& pSearchItem->GetCommand() == SvxSearchCmd::REPLACE
+&& !mpSearchItem->equalsIgnoring(*pSearchItem, /*bIgnoreReplace=*/true,
+/*bIgnoreCommand=*/true))
+{
+EndSpelling();
+mbPrepareSpellingPending = true;
+}
+
 if (mbPrepareSpellingPending)
 PrepareSpelling();
 sd::ViewShellBase* pBase = getViewShellBase();
diff --git a/svl/source/items/srchitem.cxx b/svl/source/items/srchitem.cxx
index 

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

2022-02-05 Thread Justin Luth (via logerrit)
 sd/qa/unit/uiimpress.cxx   |2 +-
 sd/source/ui/view/Outliner.cxx |8 
 2 files changed, 9 insertions(+), 1 deletion(-)

New commits:
commit 5f4ebedcd010f8248d9eea93bd36142a64820fe5
Author: Justin Luth 
AuthorDate: Fri Jan 21 11:08:46 2022 +0200
Commit: Justin Luth 
CommitDate: Sat Feb 5 20:02:39 2022 +0100

tdf#123658 sd search: restart search start on slide change

When the user switches between slides and then re-starts a search,
they expect that the search will begin on the current slide.

This fixes a somewhat 5.2 regression. Before that time, the first
search attempt failed, but the second attempt started
at the current slide. After 5.2 fixed the first-attempt-failure,
the starting position was "the slide after the last find".

This patch resets the starting position to the current slide,
which I saw was done in every case by DetectChange().
I thought about moving all this logic into DetectChange,
but it doesn't make much sense to affect a spell-checking
dialog run by moving around in the slides,
so just keep the logic here.

I submitted the unit test in a PRIOR patch.
The basic search was failing on WIN/MAC platforms
and so I wanted to confirm that this was NOT my fault.
Indeed, on those OSes the testing fails,
so I just run it under Linux where it works fine.

Change-Id: I4d1af3049bb2c0a59ec46f005c4b1773aefffb6d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129204
Tested-by: Jenkins
Reviewed-by: Justin Luth 

diff --git a/sd/qa/unit/uiimpress.cxx b/sd/qa/unit/uiimpress.cxx
index fcaa970cc929..0c3930457776 100644
--- a/sd/qa/unit/uiimpress.cxx
+++ b/sd/qa/unit/uiimpress.cxx
@@ -869,7 +869,7 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, 
testTdf123658_SearchAfterSlideChange)
 lcl_search("of");
 // Instead of finding this on the 1st page (or on the 2nd page would be 
acceptable too)
 // it was going to the third page.
-//checkCurrentPageNumber(1);
+checkCurrentPageNumber(1);
 }
 #endif
 
diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx
index 0e9b2fba833f..e03b56bf1a3d 100644
--- a/sd/source/ui/view/Outliner.cxx
+++ b/sd/source/ui/view/Outliner.cxx
@@ -809,6 +809,14 @@ bool 
SdOutliner::SearchAndReplaceOnce(std::vector* pSelecti
 
 if (!getOutlinerView() || 
!GetEditEngine().HasView(()->GetEditView()))
 {
+std::shared_ptr pDrawViewShell (
+std::dynamic_pointer_cast(pViewShell));
+
+// Perhaps the user switched to a different page/slide between 
searches.
+// If so, reset the starting search position to the current slide like 
DetectChange does
+if (pDrawViewShell && pDrawViewShell->GetCurPagePos() != 
maCurrentPosition.mnPageIndex)
+maObjectIterator = sd::outliner::OutlinerContainer(this).current();
+
 mpImpl->ProvideOutlinerView(*this, pViewShell, mpWindow);
 }
 


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

2022-02-04 Thread Justin Luth (via logerrit)
 sd/inc/Outliner.hxx|2 +-
 sd/source/ui/view/Outliner.cxx |3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

New commits:
commit 583185235389b55d6cfffac3067c0e1ccb2852b1
Author: Justin Luth 
AuthorDate: Wed Feb 2 11:00:07 2022 +0200
Commit: Caolán McNamara 
CommitDate: Fri Feb 4 21:40:10 2022 +0100

related tdf#145868 sd: Clone SvxSearchItem to avoid use after free

I tested "if (mpSearchItem)" which passed, but then it
crashed when trying to access (*mpSearchItem) == (*pSearchItem)
because the mpSearchItem's DTOR had already been called
prior to the if(mpSearchItem).

Since mpSearchItem is never compared to another
memory pointer, it is safe to assign it to a Clone.

Steps to reproduce:
1.) open Impress and search for something
2.) change the search string to something else
3.) search again.

Note that there isn't currently any code that hits this.
I discovered it trying to craft a fix for bug 145868.

Change-Id: Idc5f5a3e812ed3e49631347c35c3f4b2d8bb4127
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129347
Tested-by: Jenkins
Tested-by: Caolán McNamara 
Reviewed-by: Justin Luth 
Reviewed-by: Caolán McNamara 

diff --git a/sd/inc/Outliner.hxx b/sd/inc/Outliner.hxx
index 772040f7a610..4a7100db3bb1 100644
--- a/sd/inc/Outliner.hxx
+++ b/sd/inc/Outliner.hxx
@@ -316,7 +316,7 @@ private:
 search.  It is set every time the
 SearchAndReplaceAll method is called.
 */
-const SvxSearchItem* mpSearchItem;
+std::unique_ptr mpSearchItem;
 
 /// The actual object iterator.
 ::sd::outliner::Iterator maObjectIterator;
diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx
index 0f77f2070219..23353ba87c82 100644
--- a/sd/source/ui/view/Outliner.cxx
+++ b/sd/source/ui/view/Outliner.cxx
@@ -154,7 +154,6 @@ SdOutliner::SdOutliner( SdDrawDocument* pDoc, OutlinerMode 
nMode )
   meStartEditMode(EditMode::Page),
   mnStartPageIndex(sal_uInt16(-1)),
   mpStartEditedObject(nullptr),
-  mpSearchItem(nullptr),
   mbPrepareSpellingPending(true)
 {
 SetStyleSheetPool(static_cast( 
mpDrawDocument->GetStyleSheetPool() ));
@@ -464,7 +463,7 @@ bool SdOutliner::StartSearchAndReplace (const 
SvxSearchItem* pSearchItem)
 if ( ! bAbort)
 {
 meMode = SEARCH;
-mpSearchItem = pSearchItem;
+mpSearchItem = std::unique_ptr(pSearchItem->Clone());
 
 mbFoundObject = false;
 


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

2022-02-03 Thread Justin Luth (via logerrit)
 sw/qa/extras/ooxmlexport/data/tdf147115_defaultStyle.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport11.cxx|5 +
 writerfilter/source/dmapper/StyleSheetTable.cxx   |6 +-
 3 files changed, 10 insertions(+), 1 deletion(-)

New commits:
commit d5e470882c7538716a9810d757e7481304e9724e
Author: Justin Luth 
AuthorDate: Wed Feb 2 13:56:22 2022 +0200
Commit: Xisco Fauli 
CommitDate: Thu Feb 3 10:44:16 2022 +0100

tdf#147115 writerfilter: style is only default if default=true

This was a dumb mistake in LO 2018 (so perhaps LO 6.2).
Regression from commit 6b7f12f6108f136d60bd77e3787ef6a2632038cd

Change-Id: I2adc642ffe9c2af1037fcc0a5d2b83c993511258
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129386
Tested-by: Jenkins
Reviewed-by: Justin Luth 
(cherry picked from commit 71303d77febfd51a493ce797933143cc318818cf)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129339
Reviewed-by: Xisco Fauli 
(cherry picked from commit 8e9830755c17c3351f074b251f30f3216b481214)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129340

diff --git a/sw/qa/extras/ooxmlexport/data/tdf147115_defaultStyle.docx 
b/sw/qa/extras/ooxmlexport/data/tdf147115_defaultStyle.docx
new file mode 100644
index ..e75099c6aa9e
Binary files /dev/null and 
b/sw/qa/extras/ooxmlexport/data/tdf147115_defaultStyle.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
index 17f05d1dcd16..a32862ac7b9a 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
@@ -361,6 +361,11 @@ DECLARE_OOXMLEXPORT_TEST(testDefaultStyle, 
"defaultStyle.docx")
 CPPUNIT_ASSERT_EQUAL(2, getPages());
 }
 
+DECLARE_OOXMLEXPORT_TEST(testTdf147115_defaultStyle, 
"tdf147115_defaultStyle.docx")
+{
+CPPUNIT_ASSERT_EQUAL_MESSAGE( "Default Style", OUString("Standard"), 
getProperty(getParagraph(1), "ParaStyleName") );
+}
+
 DECLARE_OOXMLEXPORT_TEST(testTdf117988, "tdf117988.docx")
 {
 CPPUNIT_ASSERT_EQUAL(1, getPages());
diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx 
b/writerfilter/source/dmapper/StyleSheetTable.cxx
index ba3b0d97550e..70f36fac78d4 100644
--- a/writerfilter/source/dmapper/StyleSheetTable.cxx
+++ b/writerfilter/source/dmapper/StyleSheetTable.cxx
@@ -467,8 +467,12 @@ void StyleSheetTable::lcl_attribute(Id Name, Value & val)
 if (m_pImpl->m_pCurrentEntry->nStyleTypeCode != STYLE_TYPE_UNKNOWN)
 {
 // "If this attribute is specified by multiple styles, then 
the last instance shall be used."
-if ( m_pImpl->m_pCurrentEntry->nStyleTypeCode == 
STYLE_TYPE_PARA && !m_pImpl->m_pCurrentEntry->sStyleIdentifierD.isEmpty() )
+if (m_pImpl->m_pCurrentEntry->bIsDefaultStyle
+&& m_pImpl->m_pCurrentEntry->nStyleTypeCode == 
STYLE_TYPE_PARA
+&& !m_pImpl->m_pCurrentEntry->sStyleIdentifierD.isEmpty())
+{
 m_pImpl->m_sDefaultParaStyleName = 
m_pImpl->m_pCurrentEntry->sStyleIdentifierD;
+}
 
 beans::PropertyValue aValue;
 aValue.Name = "default";


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

2022-02-03 Thread Justin Luth (via logerrit)
 sw/qa/extras/ooxmlexport/data/tdf147115_defaultStyle.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport11.cxx|5 +
 writerfilter/source/dmapper/StyleSheetTable.cxx   |6 +-
 3 files changed, 10 insertions(+), 1 deletion(-)

New commits:
commit 8e9830755c17c3351f074b251f30f3216b481214
Author: Justin Luth 
AuthorDate: Wed Feb 2 13:56:22 2022 +0200
Commit: Xisco Fauli 
CommitDate: Thu Feb 3 09:23:43 2022 +0100

tdf#147115 writerfilter: style is only default if default=true

This was a dumb mistake in LO 2018 (so perhaps LO 6.2).
Regression from commit 6b7f12f6108f136d60bd77e3787ef6a2632038cd

Change-Id: I2adc642ffe9c2af1037fcc0a5d2b83c993511258
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129386
Tested-by: Jenkins
Reviewed-by: Justin Luth 
(cherry picked from commit 71303d77febfd51a493ce797933143cc318818cf)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129339
Reviewed-by: Xisco Fauli 

diff --git a/sw/qa/extras/ooxmlexport/data/tdf147115_defaultStyle.docx 
b/sw/qa/extras/ooxmlexport/data/tdf147115_defaultStyle.docx
new file mode 100644
index ..e75099c6aa9e
Binary files /dev/null and 
b/sw/qa/extras/ooxmlexport/data/tdf147115_defaultStyle.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
index a0960ae35c7f..d2922e940bf8 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
@@ -365,6 +365,11 @@ DECLARE_OOXMLEXPORT_TEST(testDefaultStyle, 
"defaultStyle.docx")
 CPPUNIT_ASSERT_EQUAL(2, getPages());
 }
 
+DECLARE_OOXMLEXPORT_TEST(testTdf147115_defaultStyle, 
"tdf147115_defaultStyle.docx")
+{
+CPPUNIT_ASSERT_EQUAL_MESSAGE( "Default Style", OUString("Standard"), 
getProperty(getParagraph(1), "ParaStyleName") );
+}
+
 DECLARE_OOXMLEXPORT_TEST(testTdf117988, "tdf117988.docx")
 {
 CPPUNIT_ASSERT_EQUAL(1, getPages());
diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx 
b/writerfilter/source/dmapper/StyleSheetTable.cxx
index 5f45672fe915..fe5d718827f0 100644
--- a/writerfilter/source/dmapper/StyleSheetTable.cxx
+++ b/writerfilter/source/dmapper/StyleSheetTable.cxx
@@ -464,8 +464,12 @@ void StyleSheetTable::lcl_attribute(Id Name, Value & val)
 if (m_pImpl->m_pCurrentEntry->nStyleTypeCode != STYLE_TYPE_UNKNOWN)
 {
 // "If this attribute is specified by multiple styles, then 
the last instance shall be used."
-if ( m_pImpl->m_pCurrentEntry->nStyleTypeCode == 
STYLE_TYPE_PARA && !m_pImpl->m_pCurrentEntry->sStyleIdentifierD.isEmpty() )
+if (m_pImpl->m_pCurrentEntry->bIsDefaultStyle
+&& m_pImpl->m_pCurrentEntry->nStyleTypeCode == 
STYLE_TYPE_PARA
+&& !m_pImpl->m_pCurrentEntry->sStyleIdentifierD.isEmpty())
+{
 m_pImpl->m_sDefaultParaStyleName = 
m_pImpl->m_pCurrentEntry->sStyleIdentifierD;
+}
 
 beans::PropertyValue aValue;
 aValue.Name = "default";


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

2022-02-02 Thread Justin Luth (via logerrit)
 sw/source/core/docnode/ndtbl1.cxx |7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 1f13e12700af83734eb830e4aed04f701a2caabc
Author: Justin Luth 
AuthorDate: Mon Dec 20 15:42:46 2021 +0200
Commit: Samuel Mehrbrodt 
CommitDate: Thu Feb 3 08:04:13 2022 +0100

related tdf#90805 sw table: ensure border when setting border style

When using uno:LineStyle to set a table's border style,
add all borders if there are none at all.

The thickness of this line is set in svx/source/tbxctrls/tbcontrl.cxx
to ::Thin (which is different from ::VeryThin set by color and borders).

Change-Id: I8af1e6a2447a3bb99f00b9c19708bd2a1208109d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127166
Tested-by: Jenkins
Reviewed-by: Justin Luth 
Reviewed-by: Samuel Mehrbrodt 

diff --git a/sw/source/core/docnode/ndtbl1.cxx 
b/sw/source/core/docnode/ndtbl1.cxx
index 1cb5fc651b6c..e6a68e76a521 100644
--- a/sw/source/core/docnode/ndtbl1.cxx
+++ b/sw/source/core/docnode/ndtbl1.cxx
@@ -930,7 +930,10 @@ void SwDoc::SetTabLineStyle( const SwCursor& rCursor,
 
GetIDocumentUndoRedo().AppendUndo(std::make_unique(*pTableNd));
 }
 
-const SvxBorderLine aDefaultBorder(pColor, SvxBorderLineWidth::VeryThin);
+SvxBorderLine aDefaultBorder(pBorderLine ? *pBorderLine
+ : SvxBorderLine(pColor, 
SvxBorderLineWidth::VeryThin));
+if (pColor && pBorderLine)
+aDefaultBorder.SetColor(*pColor);
 
 for( auto  : aUnions )
 {
@@ -959,7 +962,7 @@ void SwDoc::SetTabLineStyle( const SwCursor& rCursor,
 {
 aBox.reset(::GetDfltAttr(RES_BOX)->Clone());
 }
-else if (pColor && !pBorderLine && !pTop && !pBot && !pLeft && 
!pRight)
+else if ((pColor || pBorderLine) && !pTop && !pBot && !pLeft && 
!pRight)
 {
 aBox->SetLine(, SvxBoxItemLine::TOP);
 aBox->SetLine(, SvxBoxItemLine::BOTTOM);


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

2022-02-02 Thread Justin Luth (via logerrit)
 sw/qa/extras/ooxmlexport/data/tdf147115_defaultStyle.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport11.cxx|5 +
 writerfilter/source/dmapper/StyleSheetTable.cxx   |6 +-
 3 files changed, 10 insertions(+), 1 deletion(-)

New commits:
commit 71303d77febfd51a493ce797933143cc318818cf
Author: Justin Luth 
AuthorDate: Wed Feb 2 13:56:22 2022 +0200
Commit: Justin Luth 
CommitDate: Thu Feb 3 07:20:26 2022 +0100

tdf#147115 writerfilter: style is only default if default=true

This was a dumb mistake in LO 2018 (so perhaps LO 6.2).
Regression from commit 6b7f12f6108f136d60bd77e3787ef6a2632038cd

Change-Id: I2adc642ffe9c2af1037fcc0a5d2b83c993511258
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129386
Tested-by: Jenkins
Reviewed-by: Justin Luth 

diff --git a/sw/qa/extras/ooxmlexport/data/tdf147115_defaultStyle.docx 
b/sw/qa/extras/ooxmlexport/data/tdf147115_defaultStyle.docx
new file mode 100644
index ..e75099c6aa9e
Binary files /dev/null and 
b/sw/qa/extras/ooxmlexport/data/tdf147115_defaultStyle.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
index 6c465f4ead00..6e5de25b3169 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
@@ -359,6 +359,11 @@ DECLARE_OOXMLEXPORT_TEST(testDefaultStyle, 
"defaultStyle.docx")
 CPPUNIT_ASSERT_EQUAL(2, getPages());
 }
 
+DECLARE_OOXMLEXPORT_TEST(testTdf147115_defaultStyle, 
"tdf147115_defaultStyle.docx")
+{
+CPPUNIT_ASSERT_EQUAL_MESSAGE( "Default Style", OUString("Standard"), 
getProperty(getParagraph(1), "ParaStyleName") );
+}
+
 DECLARE_OOXMLEXPORT_TEST(testTdf117988, "tdf117988.docx")
 {
 CPPUNIT_ASSERT_EQUAL(1, getPages());
diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx 
b/writerfilter/source/dmapper/StyleSheetTable.cxx
index 5f45672fe915..fe5d718827f0 100644
--- a/writerfilter/source/dmapper/StyleSheetTable.cxx
+++ b/writerfilter/source/dmapper/StyleSheetTable.cxx
@@ -464,8 +464,12 @@ void StyleSheetTable::lcl_attribute(Id Name, Value & val)
 if (m_pImpl->m_pCurrentEntry->nStyleTypeCode != STYLE_TYPE_UNKNOWN)
 {
 // "If this attribute is specified by multiple styles, then 
the last instance shall be used."
-if ( m_pImpl->m_pCurrentEntry->nStyleTypeCode == 
STYLE_TYPE_PARA && !m_pImpl->m_pCurrentEntry->sStyleIdentifierD.isEmpty() )
+if (m_pImpl->m_pCurrentEntry->bIsDefaultStyle
+&& m_pImpl->m_pCurrentEntry->nStyleTypeCode == 
STYLE_TYPE_PARA
+&& !m_pImpl->m_pCurrentEntry->sStyleIdentifierD.isEmpty())
+{
 m_pImpl->m_sDefaultParaStyleName = 
m_pImpl->m_pCurrentEntry->sStyleIdentifierD;
+}
 
 beans::PropertyValue aValue;
 aValue.Name = "default";


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

2022-02-02 Thread Justin Luth (via logerrit)
 sw/qa/extras/rtfexport/data/tdf129578_lostBI.rtf |   31 +++
 sw/qa/extras/rtfexport/rtfexport4.cxx|9 ++
 writerfilter/source/rtftok/rtfdocumentimpl.cxx   |4 +-
 3 files changed, 42 insertions(+), 2 deletions(-)

New commits:
commit 0d3d6e1eba9b10bc334a769c275312a828b82a00
Author: Justin Luth 
AuthorDate: Fri Jan 7 14:08:52 2022 +0200
Commit: Xisco Fauli 
CommitDate: Wed Feb 2 15:07:47 2022 +0100

tdf#129578 rtfimport: CJK char properties are not CS

This fixes a LO 6.4/6.3.0.1 regression caused by
commit fd95fb975b754d71d3750e85431a4e596a40e659
which was focused on export, and not import.

The code originally didn't have any
mention of DBCH, so it used the default.
However, in the 6.4 change, it was wrongly tied together
with the Complex Script indicator.

So revert that part of the change.
Mark fixed the same problem in 7.1 for font size.

Change-Id: I1c87ae856de93ebc693135585574f2eb144b214b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128113
Tested-by: Jenkins
Reviewed-by: Justin Luth 
(cherry picked from commit 9d50307b2e1fd26d415539d3ed8624c7a449e45b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129327
Reviewed-by: Xisco Fauli 

diff --git a/sw/qa/extras/rtfexport/data/tdf129578_lostBI.rtf 
b/sw/qa/extras/rtfexport/data/tdf129578_lostBI.rtf
new file mode 100644
index ..8a0e96218bca
--- /dev/null
+++ b/sw/qa/extras/rtfexport/data/tdf129578_lostBI.rtf
@@ -0,0 +1,31 @@
+{\rtf1\ansi\deff4\adeflang1025
+{\fonttbl{\f0\froman\fprq2\fcharset0 Times New 
Roman;}{\f1\froman\fprq2\fcharset2 Symbol;}{\f2\fswiss\fprq2\fcharset0 
Arial;}{\f3\froman\fprq2\fcharset0 Liberation Serif{\*\falt Times New 
Roman};}{\f4\froman\fprq0\fcharset128 Calibri;}{\f5\froman\fprq0\fcharset128 
Times New Roman;}{\f6\froman\fprq0\fcharset128 
Cambria;}{\f7\froman\fprq0\fcharset128 Tahoma;}{\f8\fnil\fprq2\fcharset0 MS 
Mincho;}{\f9\fnil\fprq2\fcharset128 
\'91\'76\'91\'cc;}{\f10\fnil\fprq2\fcharset0 DejaVu 
Sans;}{\f11\froman\fprq0\fcharset128 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\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;\red82\green125\blue85;}
+{\stylesheet{\s0\snext0\rtlch\af11\afs22\alang1037 
\ltrch\lang1033\langfe2052\hich\af4\loch\sl276\slmult1\ql\widctlpar\hyphpar0\sb0\sa200\ltrpar\cf0\f4\fs22\lang1033\kerning0\dbch\af9\langfe2052
 Normal;}
+{\s1\sbasedon0\snext0\rtlch\af5\afs28\alang1037\ab 
\ltrch\lang1033\langfe2052\hich\af6\loch\sl276\slmult1\ql\keep\widctlpar\hyphpar0\sb480\sa0\keepn\ltrpar\cf17\f6\fs28\lang1033\b\kerning0\dbch\af9\langfe2052
 Heading 1;}
+{\*\cs15\snext15 Default Paragraph Font;}
+{\*\cs16\sbasedon15\snext16 Header Char;}
+{\*\cs17\sbasedon15\snext17 Footer Char;}
+{\*\cs18\sbasedon15\snext18\rtlch\af5\afs28\ab 
\ltrch\hich\af6\loch\cf17\f6\fs28\b\dbch\af9 Heading 1 Char;}
+{\*\cs19\sbasedon15\snext19\rtlch\af7\afs16 \ltrch\hich\af7\loch\f7\fs16 
Balloon Text Char;}
+{\s20\sbasedon0\snext21\rtlch\af5\afs28\alang1037 
\ltrch\lang1033\langfe2052\hich\af5\loch\sl276\slmult1\ql\widctlpar\hyphpar0\sb240\sa120\keepn\ltrpar\cf0\f5\fs28\lang1033\kerning0\dbch\af10\langfe2052
 Heading;}
+{\s21\sbasedon0\snext21\rtlch\af11\afs22\alang1037 
\ltrch\lang1033\langfe2052\hich\af4\loch\sl276\slmult1\ql\widctlpar\hyphpar0\sb0\sa140\ltrpar\cf0\f4\fs22\lang1033\kerning0\dbch\af9\langfe2052
 Text Body;}
+{\s22\sbasedon21\snext22\rtlch\af5\afs22\alang1037 
\ltrch\lang1033\langfe2052\hich\af5\loch\sl276\slmult1\ql\widctlpar\hyphpar0\sb0\sa140\ltrpar\cf0\f5\fs22\lang1033\kerning0\dbch\af9\langfe2052
 List;}
+{\s23\sbasedon0\snext23\rtlch\af5\afs24\alang1037\ai 
\ltrch\lang1033\langfe2052\hich\af5\loch\sl276\slmult1\ql\widctlpar\hyphpar0\sb120\sa120\noline\ltrpar\cf0\f5\fs24\lang1033\i\kerning0\dbch\af9\langfe2052
 Caption;}
+{\s24\sbasedon0\snext24\rtlch\af5\afs22\alang1037 
\ltrch\lang1033\langfe2052\hich\af5\loch\sl276\slmult1\ql\widctlpar\hyphpar0\sb0\sa200\noline\ltrpar\cf0\f5\fs22\lang1033\kerning0\dbch\af9\langfe2052
 Index;}
+{\s25\sbasedon0\snext25\rtlch\af11\afs22\alang1037 
\ltrch\lang1033\langfe2052\hich\af4\loch\sl276\slmult1\ql\widctlpar\hyphpar0\sb0\sa200\ltrpar\cf0\f4\fs22\lang1033\kerning0\dbch\af9\langfe2052
 Header and Footer;}
+{\s26\sbasedon0\snext26\rtlch\af11\afs22\alang1037 
\ltrch\lang1033\langfe2052\hich\af4\loch\sl240\slmult1\ql\widctlpar\tqc\tx4680\tqr\tx9360\hyphpar0\sb0\sa0\ltrpar\cf0\f4\fs22\lang1033\kerning0\dbch\af9\langfe2052
 Header;}
+{\s27\sbasedon0\snext27\rtlch\af11\afs22\alang1037 

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

2022-02-01 Thread Justin Luth (via logerrit)
 sw/qa/extras/rtfexport/data/tdf129578_lostBI.rtf |   31 +++
 sw/qa/extras/rtfexport/rtfexport4.cxx|9 ++
 writerfilter/source/rtftok/rtfdocumentimpl.cxx   |4 +-
 3 files changed, 42 insertions(+), 2 deletions(-)

New commits:
commit 9d50307b2e1fd26d415539d3ed8624c7a449e45b
Author: Justin Luth 
AuthorDate: Fri Jan 7 14:08:52 2022 +0200
Commit: Justin Luth 
CommitDate: Wed Feb 2 05:03:05 2022 +0100

tdf#129578 rtfimport: CJK char properties are not CS

This fixes a LO 6.4/6.3.0.1 regression caused by
commit fd95fb975b754d71d3750e85431a4e596a40e659
which was focused on export, and not import.

The code originally didn't have any
mention of DBCH, so it used the default.
However, in the 6.4 change, it was wrongly tied together
with the Complex Script indicator.

So revert that part of the change.
Mark fixed the same problem in 7.1 for font size.

Change-Id: I1c87ae856de93ebc693135585574f2eb144b214b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128113
Tested-by: Jenkins
Reviewed-by: Justin Luth 

diff --git a/sw/qa/extras/rtfexport/data/tdf129578_lostBI.rtf 
b/sw/qa/extras/rtfexport/data/tdf129578_lostBI.rtf
new file mode 100644
index ..8a0e96218bca
--- /dev/null
+++ b/sw/qa/extras/rtfexport/data/tdf129578_lostBI.rtf
@@ -0,0 +1,31 @@
+{\rtf1\ansi\deff4\adeflang1025
+{\fonttbl{\f0\froman\fprq2\fcharset0 Times New 
Roman;}{\f1\froman\fprq2\fcharset2 Symbol;}{\f2\fswiss\fprq2\fcharset0 
Arial;}{\f3\froman\fprq2\fcharset0 Liberation Serif{\*\falt Times New 
Roman};}{\f4\froman\fprq0\fcharset128 Calibri;}{\f5\froman\fprq0\fcharset128 
Times New Roman;}{\f6\froman\fprq0\fcharset128 
Cambria;}{\f7\froman\fprq0\fcharset128 Tahoma;}{\f8\fnil\fprq2\fcharset0 MS 
Mincho;}{\f9\fnil\fprq2\fcharset128 
\'91\'76\'91\'cc;}{\f10\fnil\fprq2\fcharset0 DejaVu 
Sans;}{\f11\froman\fprq0\fcharset128 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\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;\red82\green125\blue85;}
+{\stylesheet{\s0\snext0\rtlch\af11\afs22\alang1037 
\ltrch\lang1033\langfe2052\hich\af4\loch\sl276\slmult1\ql\widctlpar\hyphpar0\sb0\sa200\ltrpar\cf0\f4\fs22\lang1033\kerning0\dbch\af9\langfe2052
 Normal;}
+{\s1\sbasedon0\snext0\rtlch\af5\afs28\alang1037\ab 
\ltrch\lang1033\langfe2052\hich\af6\loch\sl276\slmult1\ql\keep\widctlpar\hyphpar0\sb480\sa0\keepn\ltrpar\cf17\f6\fs28\lang1033\b\kerning0\dbch\af9\langfe2052
 Heading 1;}
+{\*\cs15\snext15 Default Paragraph Font;}
+{\*\cs16\sbasedon15\snext16 Header Char;}
+{\*\cs17\sbasedon15\snext17 Footer Char;}
+{\*\cs18\sbasedon15\snext18\rtlch\af5\afs28\ab 
\ltrch\hich\af6\loch\cf17\f6\fs28\b\dbch\af9 Heading 1 Char;}
+{\*\cs19\sbasedon15\snext19\rtlch\af7\afs16 \ltrch\hich\af7\loch\f7\fs16 
Balloon Text Char;}
+{\s20\sbasedon0\snext21\rtlch\af5\afs28\alang1037 
\ltrch\lang1033\langfe2052\hich\af5\loch\sl276\slmult1\ql\widctlpar\hyphpar0\sb240\sa120\keepn\ltrpar\cf0\f5\fs28\lang1033\kerning0\dbch\af10\langfe2052
 Heading;}
+{\s21\sbasedon0\snext21\rtlch\af11\afs22\alang1037 
\ltrch\lang1033\langfe2052\hich\af4\loch\sl276\slmult1\ql\widctlpar\hyphpar0\sb0\sa140\ltrpar\cf0\f4\fs22\lang1033\kerning0\dbch\af9\langfe2052
 Text Body;}
+{\s22\sbasedon21\snext22\rtlch\af5\afs22\alang1037 
\ltrch\lang1033\langfe2052\hich\af5\loch\sl276\slmult1\ql\widctlpar\hyphpar0\sb0\sa140\ltrpar\cf0\f5\fs22\lang1033\kerning0\dbch\af9\langfe2052
 List;}
+{\s23\sbasedon0\snext23\rtlch\af5\afs24\alang1037\ai 
\ltrch\lang1033\langfe2052\hich\af5\loch\sl276\slmult1\ql\widctlpar\hyphpar0\sb120\sa120\noline\ltrpar\cf0\f5\fs24\lang1033\i\kerning0\dbch\af9\langfe2052
 Caption;}
+{\s24\sbasedon0\snext24\rtlch\af5\afs22\alang1037 
\ltrch\lang1033\langfe2052\hich\af5\loch\sl276\slmult1\ql\widctlpar\hyphpar0\sb0\sa200\noline\ltrpar\cf0\f5\fs22\lang1033\kerning0\dbch\af9\langfe2052
 Index;}
+{\s25\sbasedon0\snext25\rtlch\af11\afs22\alang1037 
\ltrch\lang1033\langfe2052\hich\af4\loch\sl276\slmult1\ql\widctlpar\hyphpar0\sb0\sa200\ltrpar\cf0\f4\fs22\lang1033\kerning0\dbch\af9\langfe2052
 Header and Footer;}
+{\s26\sbasedon0\snext26\rtlch\af11\afs22\alang1037 
\ltrch\lang1033\langfe2052\hich\af4\loch\sl240\slmult1\ql\widctlpar\tqc\tx4680\tqr\tx9360\hyphpar0\sb0\sa0\ltrpar\cf0\f4\fs22\lang1033\kerning0\dbch\af9\langfe2052
 Header;}
+{\s27\sbasedon0\snext27\rtlch\af11\afs22\alang1037 
\ltrch\lang1033\langfe2052\hich\af4\loch\sl240\slmult1\ql\widctlpar\tqc\tx4680\tqr\tx9360\hyphpar0\sb0\sa0\ltrpar\cf0\f4\fs22\lang1033\kerning0\dbch\af9\langfe2052
 Footer;}
+{\s28\sbasedon1\snext0\rtlch\af5\afs28\alang1025\ab 

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

2022-02-01 Thread Justin Luth (via logerrit)
 oox/source/drawingml/fillproperties.cxx |5 +
 sw/qa/extras/ooxmlexport/data/tdf141652_fillBitmapName.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport6.cxx   |   10 ++
 3 files changed, 11 insertions(+), 4 deletions(-)

New commits:
commit 1f0699415a7fc531a3ef4d1c80649606b6d06ece
Author: Justin Luth 
AuthorDate: Mon Jan 10 20:42:17 2022 +0200
Commit: Xisco Fauli 
CommitDate: Tue Feb 1 16:13:02 2022 +0100

tdf#141652 partial revert "Reset ShapeProperty priority...

... and handle only crop case."

This reverts a portion of a tdf#134210 related, LO 7.2/7.1.2ish
commit b90a67838e189f3aee6a50724c78c0a50d416970
that was introduced for no apparent reason.

I have no understanding about shapes, and so
I have no idea why setting FillBitmap to an xGraphic
is different from setting it to a name, but it makes
a huge difference on the image size,
and the crop values aren't scaled to the reduced size.

Since this section of code looks like a cut/paste
relic of early stages of developing the fix,
lets just revert this portion since the original
author has made no response at all to the regression report.

Change-Id: I9488c419ceb41bd4ebd7b10494a52fb816654832
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128260
Tested-by: Jenkins
Reviewed-by: Justin Luth 
(cherry picked from commit 18cc1240565e697859dd7d17058f91d5e01df929)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129254
Reviewed-by: Xisco Fauli 

diff --git a/oox/source/drawingml/fillproperties.cxx 
b/oox/source/drawingml/fillproperties.cxx
index 6a60a685c84f..480bbe641737 100644
--- a/oox/source/drawingml/fillproperties.cxx
+++ b/oox/source/drawingml/fillproperties.cxx
@@ -789,10 +789,7 @@ void FillProperties::pushToPropMap( ShapePropertyMap& 
rPropMap,
 if(bIsCustomShape && bHasCropValues && bNeedCrop)
 {
 xGraphic = lclCropGraphic(xGraphic, aFillRect);
-if 
(rPropMap.supportsProperty(ShapeProperty::FillBitmapName))
-
rPropMap.setProperty(ShapeProperty::FillBitmapName, xGraphic);
-else
-
rPropMap.setProperty(ShapeProperty::FillBitmap, xGraphic);
+
rPropMap.setProperty(ShapeProperty::FillBitmap, xGraphic);
 }
 }
 }
diff --git a/sw/qa/extras/ooxmlexport/data/tdf141652_fillBitmapName.docx 
b/sw/qa/extras/ooxmlexport/data/tdf141652_fillBitmapName.docx
new file mode 100644
index ..4a47a544d6bb
Binary files /dev/null and 
b/sw/qa/extras/ooxmlexport/data/tdf141652_fillBitmapName.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx
index 61372e9e803e..4429aa58a70d 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx
@@ -282,6 +282,16 @@ DECLARE_OOXMLEXPORT_TEST(testDMLShapeFillBitmapCrop, 
"dml-shape-fillbitmapcrop.d
 
 }
 
+DECLARE_OOXMLEXPORT_TEST(test141652_fillBitmapName, 
"tdf141652_fillBitmapName.docx")
+{
+text::GraphicCrop aGraphicCropStruct = 
getProperty(getShape(1), "GraphicCrop");
+CPPUNIT_ASSERT_DOUBLES_EQUAL( sal_Int32(-769), aGraphicCropStruct.Right, 
10);
+
+CPPUNIT_ASSERT_EQUAL( sal_Int32( 0 ), aGraphicCropStruct.Left );
+CPPUNIT_ASSERT_EQUAL( sal_Int32( 0 ), aGraphicCropStruct.Top );
+CPPUNIT_ASSERT_EQUAL( sal_Int32( 0 ), aGraphicCropStruct.Bottom );
+}
+
 DECLARE_OOXMLEXPORT_TEST(testDMLShapeFillPattern, "dml-shape-fillpattern.docx")
 {
 // Hatching was ignored by the export.


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

2022-02-01 Thread Justin Luth (via logerrit)
 oox/source/drawingml/fillproperties.cxx |5 +
 sw/qa/extras/ooxmlexport/data/tdf141652_fillBitmapName.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport6.cxx   |   10 ++
 3 files changed, 11 insertions(+), 4 deletions(-)

New commits:
commit 18cc1240565e697859dd7d17058f91d5e01df929
Author: Justin Luth 
AuthorDate: Mon Jan 10 20:42:17 2022 +0200
Commit: Miklos Vajna 
CommitDate: Tue Feb 1 13:31:33 2022 +0100

tdf#141652 partial revert "Reset ShapeProperty priority...

... and handle only crop case."

This reverts a portion of a tdf#134210 related, LO 7.2/7.1.2ish
commit b90a67838e189f3aee6a50724c78c0a50d416970
that was introduced for no apparent reason.

I have no understanding about shapes, and so
I have no idea why setting FillBitmap to an xGraphic
is different from setting it to a name, but it makes
a huge difference on the image size,
and the crop values aren't scaled to the reduced size.

Since this section of code looks like a cut/paste
relic of early stages of developing the fix,
lets just revert this portion since the original
author has made no response at all to the regression report.

Change-Id: I9488c419ceb41bd4ebd7b10494a52fb816654832
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128260
Tested-by: Jenkins
Reviewed-by: Justin Luth 

diff --git a/oox/source/drawingml/fillproperties.cxx 
b/oox/source/drawingml/fillproperties.cxx
index 6a60a685c84f..480bbe641737 100644
--- a/oox/source/drawingml/fillproperties.cxx
+++ b/oox/source/drawingml/fillproperties.cxx
@@ -789,10 +789,7 @@ void FillProperties::pushToPropMap( ShapePropertyMap& 
rPropMap,
 if(bIsCustomShape && bHasCropValues && bNeedCrop)
 {
 xGraphic = lclCropGraphic(xGraphic, aFillRect);
-if 
(rPropMap.supportsProperty(ShapeProperty::FillBitmapName))
-
rPropMap.setProperty(ShapeProperty::FillBitmapName, xGraphic);
-else
-
rPropMap.setProperty(ShapeProperty::FillBitmap, xGraphic);
+
rPropMap.setProperty(ShapeProperty::FillBitmap, xGraphic);
 }
 }
 }
diff --git a/sw/qa/extras/ooxmlexport/data/tdf141652_fillBitmapName.docx 
b/sw/qa/extras/ooxmlexport/data/tdf141652_fillBitmapName.docx
new file mode 100644
index ..4a47a544d6bb
Binary files /dev/null and 
b/sw/qa/extras/ooxmlexport/data/tdf141652_fillBitmapName.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx
index cb8d8b4cb4c7..e79b531b39ac 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx
@@ -282,6 +282,16 @@ DECLARE_OOXMLEXPORT_TEST(testDMLShapeFillBitmapCrop, 
"dml-shape-fillbitmapcrop.d
 
 }
 
+DECLARE_OOXMLEXPORT_TEST(test141652_fillBitmapName, 
"tdf141652_fillBitmapName.docx")
+{
+text::GraphicCrop aGraphicCropStruct = 
getProperty(getShape(1), "GraphicCrop");
+CPPUNIT_ASSERT_DOUBLES_EQUAL( sal_Int32(-769), aGraphicCropStruct.Right, 
10);
+
+CPPUNIT_ASSERT_EQUAL( sal_Int32( 0 ), aGraphicCropStruct.Left );
+CPPUNIT_ASSERT_EQUAL( sal_Int32( 0 ), aGraphicCropStruct.Top );
+CPPUNIT_ASSERT_EQUAL( sal_Int32( 0 ), aGraphicCropStruct.Bottom );
+}
+
 DECLARE_OOXMLEXPORT_TEST(testDMLShapeFillPattern, "dml-shape-fillpattern.docx")
 {
 // Hatching was ignored by the export.


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

2022-02-01 Thread Justin Luth (via logerrit)
 svx/source/sidebar/text/TextCharacterSpacingControl.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit bace2e0a80b939f7b1c666cf669ae99bc8758f05
Author: Justin Luth 
AuthorDate: Tue Feb 1 10:26:42 2022 +0200
Commit: Justin Luth 
CommitDate: Tue Feb 1 11:15:19 2022 +0100

related tdf#111733 svx: SfxVoidItem != SvxKerningItem

When selecting text containing several different
kerning values, the pItem returned is a VoidItem.

This was showing up as random numbers in the
TextCharacterSpacingControl spinbutton.

Change-Id: I94cfc566daa42e0d8c3d403eb08af659f01e6d5b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129270
Tested-by: Jenkins
Reviewed-by: Justin Luth 

diff --git a/svx/source/sidebar/text/TextCharacterSpacingControl.cxx 
b/svx/source/sidebar/text/TextCharacterSpacingControl.cxx
index 3da72391476a..ba528d702282 100644
--- a/svx/source/sidebar/text/TextCharacterSpacingControl.cxx
+++ b/svx/source/sidebar/text/TextCharacterSpacingControl.cxx
@@ -109,7 +109,7 @@ void TextCharacterSpacingControl::Initialize()
 const SfxPoolItem* pItem;
 SfxItemState eState = 
SfxViewFrame::Current()->GetBindings().GetDispatcher()->QueryState(SID_ATTR_CHAR_KERNING,
 pItem);
 
-const SvxKerningItem* pKerningItem = static_cast(pItem);
+const SvxKerningItem* pKerningItem = dynamic_cast(pItem);
 tools::Long nKerning = 0;
 
 if(pKerningItem)


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - vcl/source

2022-01-31 Thread Justin Luth (via logerrit)
 vcl/source/window/printdlg.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit a67b4e473100605252a44c87bcdc162b6515f038
Author: Justin Luth 
AuthorDate: Tue Nov 23 09:18:20 2021 +0200
Commit: Miklos Vajna 
CommitDate: Tue Feb 1 08:30:00 2022 +0100

tdf#129638 print preview: use new paper size after switching page

This is a partial revert of LO 6.3
commit 2c23a96f7b6888c0e05fdc2aba57f03cd797b647.

Change-Id: I17525d06d96779671caaa84e1e48629289453ad2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125685
Tested-by: Jenkins
Reviewed-by: Justin Luth 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129240
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index 60b9d200e7bf..26629168afb6 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -980,6 +980,7 @@ void PrintDialog::preparePreview( bool i_bMayUseCache )
 {
 PrinterController::PageSize aPageSize =
 maPController->getFilteredPageFile( mnCurPage, aMtf, 
i_bMayUseCache );
+aCurPageSize = aPrt->PixelToLogic(aPrt->GetPaperSizePixel(), 
MapMode(MapUnit::Map100thMM));
 if( ! aPageSize.bFullPaper )
 {
 Point aOff( aPrt->PixelToLogic( aPrt->GetPageOffsetPixel(), 
aMapMode ) );


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

2022-01-31 Thread Justin Luth (via logerrit)
 svx/source/sidebar/text/TextCharacterSpacingControl.cxx |   25 +++-
 1 file changed, 24 insertions(+), 1 deletion(-)

New commits:
commit c0f914ad912796ef521ea151abf8ea7e9bc2f771
Author: Justin Luth 
AuthorDate: Tue Jan 25 10:40:21 2022 +0200
Commit: Justin Luth 
CommitDate: Tue Feb 1 07:07:37 2022 +0100

tdf#111733 TextCharacterSpacingControl::GrabFocus kerning spinbutton

When the kerning menu opens, it defaulted to very tight,
regardless of what the current setting was.
However, the current value can easily be connected to the
menu options, so lets do that.

This depends on increasing the spinbutton range beyond -2.0,
done via LO 7.4 commit 2334561bf15ec9b061636919efbd0e2a7b89e29b

Change-Id: I0be0956bf1cc3604faecc691aeac70a5bbba807b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128909
Tested-by: Jenkins
Reviewed-by: Justin Luth 
Reviewed-by: Heiko Tietze 

diff --git a/svx/source/sidebar/text/TextCharacterSpacingControl.cxx 
b/svx/source/sidebar/text/TextCharacterSpacingControl.cxx
index e3685146b6f5..3da72391476a 100644
--- a/svx/source/sidebar/text/TextCharacterSpacingControl.cxx
+++ b/svx/source/sidebar/text/TextCharacterSpacingControl.cxx
@@ -67,7 +67,30 @@ 
TextCharacterSpacingControl::TextCharacterSpacingControl(TextCharacterSpacingPop
 
 void TextCharacterSpacingControl::GrabFocus()
 {
-mxVeryTight->grab_focus();
+tools::Long nKerning = mxEditKerning->get_value(FieldUnit::NONE);
+switch (nKerning)
+{
+case SPACING_VERY_TIGHT:
+mxVeryTight->grab_focus();
+break;
+case SPACING_TIGHT:
+mxTight->grab_focus();
+break;
+case SPACING_NORMAL:
+mxNormal->grab_focus();
+break;
+case SPACING_LOOSE:
+mxLoose->grab_focus();
+break;
+case SPACING_VERY_LOOSE:
+mxVeryLoose->grab_focus();
+break;
+default:
+if (nKerning == mnCustomKern)
+mxLastCustom->grab_focus();
+else
+mxEditKerning->grab_focus();
+}
 }
 
 TextCharacterSpacingControl::~TextCharacterSpacingControl()


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

2022-01-31 Thread Justin Luth (via logerrit)
 sc/source/ui/view/gridwin.cxx |   12 
 1 file changed, 12 insertions(+)

New commits:
commit d098e027cb9899e31ae3ff7ba245b78a009681fb
Author: Justin Luth 
AuthorDate: Tue Dec 14 11:52:17 2021 +0200
Commit: Eike Rathke 
CommitDate: Tue Feb 1 00:03:14 2022 +0100

tdf#120896 sc: commit change after PopupSpelling

Although PopupSpelling visually has changed the screen,
the underlying document still contained the
old cached string or spelling status.
Thus spell-check still thought it was spelled wrong,
and right-clicking got very confused.

Steps to reproduce:
1.) type aaa and hit enter.  (spelling error noted)
2.) right-click on "aaa" and chose various options.
2a.) --- replace with a suggestion
2b.) --- ignore word
2c.) --- add to dictionary
2d.) --- change language
2d.) --- autocorrect
(note we are still in editing mode)
3.) right-click again on the new or approved word
(no pop-up at all.)

The fix is to stop editing, so the changes are
applied to the various caches.

Steps that should NOT stop editing the cell
2e.) --- press ESC (or anything that cancels the pop-up)
2f.) --- choose Autocorrect Options

Change-Id: I9965ede6f6a5c31a811ff89abb687497306d6d1e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126802
Reviewed-by: Eike Rathke 
Tested-by: Jenkins

diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 1bc40626c81a..80cbf4e3728a 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -489,6 +489,13 @@ IMPL_LINK( ScGridWindow, PopupSpellingHdl, 
SpellCallbackInfo&, rInfo, void )
 mrViewData.GetDispatcher().Execute( SID_SPELL_DIALOG, 
SfxCallMode::ASYNCHRON );
 else if (rInfo.nCommand == SpellCallbackCommand::AUTOCORRECT_OPTIONS)
 mrViewData.GetDispatcher().Execute( SID_AUTO_CORRECT_DLG, 
SfxCallMode::ASYNCHRON );
+else //IGNOREWORD, ADDTODICTIONARY, WORDLANGUAGE, PARALANGUAGE
+{
+// The spelling status of the word has changed. Close the cell to 
reset the caches
+ScInputHandler* pHdl = 
SC_MOD()->GetInputHdl(mrViewData.GetViewShell());
+if (pHdl)
+pHdl->EnterHandler();
+}
 }
 
 namespace {
@@ -3294,9 +3301,14 @@ void ScGridWindow::Command( const CommandEvent& rCEvt )
 if (pHdl)
 pHdl->SetModified();
 
+const OUString sOldText = pHdl ? pHdl->GetEditString() : "";
+
 Link aLink = LINK( this, ScGridWindow, 
PopupSpellingHdl );
 pEditView->ExecuteSpellPopup(aMenuPos, aLink);
 
+if (pHdl && pHdl->GetEditString() != sOldText)
+pHdl->EnterHandler();
+
 bDone = true;
 }
 }


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

2022-01-31 Thread Justin Luth (via logerrit)
 svtools/source/control/ruler.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit 2174b56ffb5817e42c8b4f6891214fcb67c55b30
Author: Justin Luth 
AuthorDate: Fri Jan 21 15:43:47 2022 +0200
Commit: Miklos Vajna 
CommitDate: Mon Jan 31 12:27:48 2022 +0100

tdf#83523 ruler: Invalidate full ruler rect on app bg change

Instead of waiting for the application to restart,
hack out an immediate invalidation of the ruler.

Perhaps there is a better place to do this
because the ruler background apparently IS
changing, but it seems to require a hack
to invalidate everything.

Change-Id: I4a27cbaf484e96c19c71c04017c649e95bf80d96
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128733
Tested-by: Jenkins
Reviewed-by: Justin Luth 
Reviewed-by: Miklos Vajna 

diff --git a/svtools/source/control/ruler.cxx b/svtools/source/control/ruler.cxx
index d3d5af0e00de..07e030aac109 100644
--- a/svtools/source/control/ruler.cxx
+++ b/svtools/source/control/ruler.cxx
@@ -994,6 +994,12 @@ void Ruler::ApplySettings(vcl::RenderContext& 
rRenderContext)
 svtools::ColorConfig aColorConfig;
 aColor = aColorConfig.GetColorValue(svtools::APPBACKGROUND).nColor;
 ApplyControlBackground(rRenderContext, aColor);
+// A hack to get it to change the non-ruler application background to 
change immediately
+if (aColor != maVirDev->GetBackground().GetColor())
+{
+maVirDev->SetBackground(aColor);
+Resize();
+}
 }
 
 void Ruler::ImplInitSettings(bool bFont, bool bForeground, bool bBackground)


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

2022-01-31 Thread Justin Luth (via logerrit)
 sd/qa/unit/data/odp/tdf123658_SearchAfterSlideChange.odp |binary
 sd/qa/unit/uiimpress.cxx |   43 ---
 2 files changed, 36 insertions(+), 7 deletions(-)

New commits:
commit b7d5ff4bbf41094b6579ae26023fbd686b060ce9
Author: Justin Luth 
AuthorDate: Fri Jan 21 11:08:46 2022 +0200
Commit: Justin Luth 
CommitDate: Mon Jan 31 10:43:12 2022 +0100

tdf#123658 sd search: partial UI unit test

Windows and Mac OS are failing this unit test
at an early stage, before the code change should
even hit. So I am decoupling the unit test and
running it prior to my patch to ensure that it
really is some pre-existing issue and not
related to my code.

[Because lcl_search() was is not used in MAC/WIN,
I was getting errors about an unused function,
so I also used it in another test (where I
got the code from in the first place).
I verified that test still failed when
the associated commit was reverted.
I also made it bBackwards just to make sure
the variable is used, even though irrelevant here.]

Change-Id: I2413fa54b881d8e8eb8c6c8907fbc0d13c352e10
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128729
Tested-by: Jenkins
Reviewed-by: Justin Luth 

diff --git a/sd/qa/unit/data/odp/tdf123658_SearchAfterSlideChange.odp 
b/sd/qa/unit/data/odp/tdf123658_SearchAfterSlideChange.odp
new file mode 100644
index ..cfd296700a1a
Binary files /dev/null and 
b/sd/qa/unit/data/odp/tdf123658_SearchAfterSlideChange.odp differ
diff --git a/sd/qa/unit/uiimpress.cxx b/sd/qa/unit/uiimpress.cxx
index 5a773aa8ced6..fcaa970cc929 100644
--- a/sd/qa/unit/uiimpress.cxx
+++ b/sd/qa/unit/uiimpress.cxx
@@ -20,6 +20,7 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -189,6 +190,21 @@ void SdUiImpressTest::save(sd::DrawDocShell* pShell, 
FileFormat const* pFormat,
 pShell->DoClose();
 }
 
+static void lcl_search(const OUString& rKey, bool bFindAll = false, bool 
bBackwards = false)
+{
+Scheduler::ProcessEventsToIdle();
+SvxSearchCmd eSearch = bFindAll ? SvxSearchCmd::FIND_ALL : 
SvxSearchCmd::FIND;
+
+uno::Sequence 
aPropertyValues(comphelper::InitPropertySequence({
+{ "SearchItem.SearchString", uno::makeAny(rKey) },
+{ "SearchItem.Backward", uno::makeAny(bBackwards) },
+{ "SearchItem.Command", uno::makeAny(sal_uInt16(eSearch)) },
+}));
+
+comphelper::dispatchCommand(".uno:ExecuteSearch", aPropertyValues);
+Scheduler::ProcessEventsToIdle();
+}
+
 CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf111522)
 {
 // Load the document and create two new windows.
@@ -833,16 +849,29 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, 
testSearchAllInDocumentAndNotes)
 sd::ViewShell* pViewShell = 
pXImpressDocument->GetDocShell()->GetViewShell();
 CPPUNIT_ASSERT(pViewShell);
 
-uno::Sequence 
aPropertyValues(comphelper::InitPropertySequence({
-{ "SearchItem.SearchString", uno::makeAny(OUString("Crash")) },
-{ "SearchItem.Backward", uno::makeAny(false) },
-{ "SearchItem.Command", 
uno::makeAny(sal_uInt16(SvxSearchCmd::FIND_ALL)) },
-}));
+lcl_search("Crash", /*bFindAll=*/true, /*bBackwards=*/true);
+}
 
-dispatchCommand(mxComponent, ".uno:ExecuteSearch", aPropertyValues);
+#if !defined(_WIN32) && !defined(MACOSX)
+// for some reason, the search for "second" (or "Second") didn't return page 2 
in WIN and MACOS
+CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf123658_SearchAfterSlideChange)
+{
+mxComponent = loadFromDesktop(
+
m_directories.getURLFromSrc(u"/sd/qa/unit/data/odp/tdf123658_SearchAfterSlideChange.odp"));
 
-Scheduler::ProcessEventsToIdle();
+auto pXImpressDocument = 
dynamic_cast(mxComponent.get());
+
+lcl_search("second");
+checkCurrentPageNumber(2);
+
+pXImpressDocument->setPart(0); // Switch to 1st page
+
+lcl_search("of");
+// Instead of finding this on the 1st page (or on the 2nd page would be 
acceptable too)
+// it was going to the third page.
+//checkCurrentPageNumber(1);
 }
+#endif
 
 CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf142589)
 {


[Libreoffice-commits] core.git: svx/uiconfig

2022-01-29 Thread Justin Luth (via logerrit)
 svx/uiconfig/ui/textcharacterspacingcontrol.ui |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 2334561bf15ec9b061636919efbd0e2a7b89e29b
Author: Justin Luth 
AuthorDate: Wed Jan 26 13:32:15 2022 +0200
Commit: Justin Luth 
CommitDate: Sat Jan 29 10:42:45 2022 +0100

svx textcharacterspacingcontrol: allow smaller kerning

On of the options in the kerning list is "very tight"
which sets a -3 pt kerning. However, the custom spin
button only allows down to -2 pt. Certainly we need to allow
the user to adjust as much as the other options allow,
and it only makes sense to allow as much negative
kerning as positive kerning.
Additionally, this field is supposed to show the
REAL current value - which it can't do if the range
of values is too limited.
Finally, we can't pre-focus "very tight" very easily
if that spin button cannot match the "very tight" value.

[Based on testing, a too-small kerning gets treated
as the smallest-possible-kerning and doesn't cause
real problems.]

In terms of positive kerning, the real maximum pt value seems
to be 1638 before the denormalized version of it hits the sal_Int16
maximum and then starts wrapping over into minimum values.

Change-Id: I465fcd0bbf3ca310b203004b46632a9a1ee01a6f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128984
Tested-by: Jenkins
Reviewed-by: Justin Luth 

diff --git a/svx/uiconfig/ui/textcharacterspacingcontrol.ui 
b/svx/uiconfig/ui/textcharacterspacingcontrol.ui
index ae6a9271366e..8f2bde9502ce 100644
--- a/svx/uiconfig/ui/textcharacterspacingcontrol.ui
+++ b/svx/uiconfig/ui/textcharacterspacingcontrol.ui
@@ -3,8 +3,8 @@
 
   
   
--2
-1
+-1638
+1638
 0.10
 1
   


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

2022-01-28 Thread Justin Luth (via logerrit)
 sw/source/filter/ww8/wrtw8nds.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 9167d0aa28d1326d6a0074efbc13dfad0c5605ce
Author: Justin Luth 
AuthorDate: Fri Jan 21 15:34:59 2022 +0200
Commit: Justin Luth 
CommitDate: Fri Jan 28 10:39:51 2022 +0100

v2 tdf#134951 docxexport GUI: don't lose postponed comment

A previous patch handled ooxmlexport's unit test failure.
But saving interactively writes the nodes in a different
order, and thus the flys process differently.
The comment was still lost/moving into the textbox
when manually testing.

So, just make sure that comments are written out before
a call to OutFlys().

There is one other place where OutFlys is called that
I didn't cover here. As a !bTextAtr, it doesn't seem
likely to need it, plus I don't want to modify ANYTHING
here without a proof document.

Change-Id: Iaf3d19bd8d8f6744b9fea1c8686e59612c0a7ff8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128732
Tested-by: Justin Luth 
Reviewed-by: Justin Luth 

diff --git a/sw/source/filter/ww8/wrtw8nds.cxx 
b/sw/source/filter/ww8/wrtw8nds.cxx
index 6a84f77c5f5e..a1409a695e0f 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -2720,6 +2720,8 @@ void MSWordExportBase::OutputTextNode( SwTextNode& rNode )
 
 if (bTextAtr || bAttrWithRange || 
bIncludeEndOfParaCRInRedlineProperties)
 {
+AttrOutput().WritePostitFieldReference();
+
 // insert final graphic anchors if any before CR
 nStateOfFlyFrame = aAttrIter.OutFlys( nEnd );
 // insert final bookmarks if any before CR and after flys


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

2022-01-27 Thread Justin Luth (via logerrit)
 sw/sdi/drwtxtsh.sdi  |5 +
 sw/source/uibase/shells/drwtxtex.cxx |9 +
 2 files changed, 14 insertions(+)

New commits:
commit bb183ef3734cc3ccad81bd1ca1309f726c279870
Author: Justin Luth 
AuthorDate: Thu Jan 27 15:08:21 2022 +0200
Commit: Justin Luth 
CommitDate: Fri Jan 28 07:16:50 2022 +0100

related tdf#111733 TextCharacterSpacingControl sw draw: goto position tab

The kerning button on the sidebar very unhelpfully
did nothing at all in draw text (like textboxes).
It should have brought the user directly to the "position" tab
where the kerning property can be found.

Change-Id: I89d4a180ac19e1e096b9157f3f32a254ff138940
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129045
Tested-by: Jenkins
Reviewed-by: Justin Luth 

diff --git a/sw/sdi/drwtxtsh.sdi b/sw/sdi/drwtxtsh.sdi
index c9e76ab9fbfb..3acf703d75e8 100644
--- a/sw/sdi/drwtxtsh.sdi
+++ b/sw/sdi/drwtxtsh.sdi
@@ -393,6 +393,11 @@ interface TextDrawText
 StateMethod = GetState ;
 DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
 ]
+SID_CHAR_DLG_POSITION
+[
+ExecMethod = Execute ;
+DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
+]
 SID_CHAR_DLG_FOR_PARAGRAPH
 [
 ExecMethod = Execute ;
diff --git a/sw/source/uibase/shells/drwtxtex.cxx 
b/sw/source/uibase/shells/drwtxtex.cxx
index 068a9be9feca..502fd7a6fa09 100644
--- a/sw/source/uibase/shells/drwtxtex.cxx
+++ b/sw/source/uibase/shells/drwtxtex.cxx
@@ -353,6 +353,7 @@ void SwDrawTextShell::Execute( SfxRequest  )
 break;
 
 case SID_CHAR_DLG_EFFECT:
+case SID_CHAR_DLG_POSITION:
 case SID_CHAR_DLG:
 case SID_CHAR_DLG_FOR_PARAGRAPH:
 {
@@ -386,6 +387,10 @@ void SwDrawTextShell::Execute( SfxRequest  )
 {
 pDlg->SetCurPageId("fonteffects");
 }
+else if (nSlot == SID_CHAR_DLG_POSITION)
+{
+pDlg->SetCurPageId("position");
+}
 else if (nSlot == SID_CHAR_DLG_FOR_PARAGRAPH)
 {
 pDlg->SetCurPageId("font");
@@ -640,6 +645,10 @@ void SwDrawTextShell::Execute( SfxRequest  )
 {
 
GetView().GetViewFrame()->GetDispatcher()->Execute(SID_CHAR_DLG_EFFECT);
 }
+else if (nEEWhich == EE_CHAR_KERNING)
+{
+
GetView().GetViewFrame()->GetDispatcher()->Execute(SID_CHAR_DLG_POSITION);
+}
 
 
 SetAttrToMarked(aNewAttr);


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

2022-01-27 Thread Justin Luth (via logerrit)
 sw/sdi/_annotsh.sdi |7 +++
 sw/source/uibase/shells/annotsh.cxx |   10 ++
 2 files changed, 17 insertions(+)

New commits:
commit e1f82fec6262db708f7911d20b62b74a4b4feab2
Author: Justin Luth 
AuthorDate: Thu Jan 27 15:21:37 2022 +0200
Commit: Justin Luth 
CommitDate: Fri Jan 28 05:58:09 2022 +0100

related tdf#11173 TextCharacterSpacingControl sw annot: goto position tab

The kerning button on the sidebar very unhelpfully
did nothing at all in draw text (like textboxes).
It should have brought the user directly to the "position" tab
where the kerning property can be found.

Change-Id: I83687c732cc45bb28a835e878d0c91f10fb713ca
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129046
Tested-by: Justin Luth 
Reviewed-by: Justin Luth 

diff --git a/sw/sdi/_annotsh.sdi b/sw/sdi/_annotsh.sdi
index b335fb9e0676..ff720d238226 100644
--- a/sw/sdi/_annotsh.sdi
+++ b/sw/sdi/_annotsh.sdi
@@ -326,6 +326,13 @@ interface _Annotation
 DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
 ]
 
+SID_CHAR_DLG_POSITION
+[
+ExecMethod = Exec ;
+StateMethod = GetState ;
+DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
+]
+
 SID_ATTR_CHAR_WEIGHT // api:
 [
 ExecMethod = Exec ;
diff --git a/sw/source/uibase/shells/annotsh.cxx 
b/sw/source/uibase/shells/annotsh.cxx
index 61b665058381..95880f303579 100644
--- a/sw/source/uibase/shells/annotsh.cxx
+++ b/sw/source/uibase/shells/annotsh.cxx
@@ -449,6 +449,7 @@ void SwAnnotationShell::Exec( SfxRequest  )
 break;
 }
 case SID_CHAR_DLG_EFFECT:
+case SID_CHAR_DLG_POSITION:
 case SID_CHAR_DLG:
 {
 const SfxItemSet* pArgs = rReq.GetArgs();
@@ -474,6 +475,10 @@ void SwAnnotationShell::Exec( SfxRequest  )
 {
 pDlg->SetCurPageId("fonteffects");
 }
+if (nSlot == SID_CHAR_DLG_POSITION)
+{
+pDlg->SetCurPageId("position");
+}
 else if (pItem)
 {
 pDlg->SetCurPageId(OUStringToOString(pItem->GetValue(), 
RTL_TEXTENCODING_UTF8));
@@ -582,6 +587,11 @@ void SwAnnotationShell::Exec( SfxRequest  )
 {
 m_rView.GetViewFrame()->GetDispatcher()->Execute(SID_CHAR_DLG_EFFECT);
 }
+else if (nEEWhich == EE_CHAR_KERNING)
+{
+
m_rView.GetViewFrame()->GetDispatcher()->Execute(SID_CHAR_DLG_POSITION);
+}
+
 
 tools::Rectangle aOutRect = pOLV->GetOutputArea();
 if (tools::Rectangle() != aOutRect && aNewAttr.Count())


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

2022-01-27 Thread Justin Luth (via logerrit)
 sw/source/uibase/shells/annotsh.cxx  |5 +
 sw/source/uibase/shells/basesh.cxx   |2 ++
 sw/source/uibase/shells/drwtxtex.cxx |5 +
 3 files changed, 12 insertions(+)

New commits:
commit 7bd5f80185a349e3660d19b4b4a5d4dd1e2208e3
Author: Justin Luth 
AuthorDate: Thu Jan 27 14:33:56 2022 +0200
Commit: Justin Luth 
CommitDate: Thu Jan 27 19:39:31 2022 +0100

sw uno:Color: directly goto CHAR_DLG fonteffects tab

.uno:Color started the character properties dialog,
but opened whatever tab was last opened,
and not the font-effects tab where color settings are found.

This is related to tdf#111733.

In terms of draw text (like textboxes) and comments
it did nothing at all, so I fixed that too.

I found this looking for other possible uses
for CHAR_DLG_POSITION or CHAR_DLG_EFFECTS.

I didn't find any pre-defined menu where this could
be seen, but a customized menu adding the right
"Font Color" (uno:Color) demonstrates the difference.
There might be more EFFECTS, but this was the only one I found.

Change-Id: If80f14e00d1a2ebae850a885df06fc556f77903a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129044
Tested-by: Justin Luth 
Reviewed-by: Justin Luth 

diff --git a/sw/source/uibase/shells/annotsh.cxx 
b/sw/source/uibase/shells/annotsh.cxx
index b05fedf7c5ae..dd5a01adb62f 100644
--- a/sw/source/uibase/shells/annotsh.cxx
+++ b/sw/source/uibase/shells/annotsh.cxx
@@ -31,6 +31,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -577,6 +578,10 @@ void SwAnnotationShell::Exec( SfxRequest  )
 {
 aNewAttr.Put(pNewAttrs->Get(nWhich).CloneSetWhich(nEEWhich));
 }
+else if (nEEWhich == EE_CHAR_COLOR)
+{
+m_rView.GetViewFrame()->GetDispatcher()->Execute(SID_CHAR_DLG_EFFECT);
+}
 
 tools::Rectangle aOutRect = pOLV->GetOutputArea();
 if (tools::Rectangle() != aOutRect && aNewAttr.Count())
diff --git a/sw/source/uibase/shells/basesh.cxx 
b/sw/source/uibase/shells/basesh.cxx
index b2f8abd694fb..15780ee57c6e 100644
--- a/sw/source/uibase/shells/basesh.cxx
+++ b/sw/source/uibase/shells/basesh.cxx
@@ -2295,6 +2295,8 @@ void SwBaseShell::ExecTextCtrl( SfxRequest& rReq )
 {
 if (nSlot == SID_ATTR_CHAR_KERNING)
 
GetView().GetViewFrame()->GetDispatcher()->Execute(SID_CHAR_DLG_POSITION);
+else if (nSlot == SID_ATTR_CHAR_COLOR)
+
GetView().GetViewFrame()->GetDispatcher()->Execute(SID_CHAR_DLG_EFFECT);
 else
 GetView().GetViewFrame()->GetDispatcher()->Execute(SID_CHAR_DLG);
 }
diff --git a/sw/source/uibase/shells/drwtxtex.cxx 
b/sw/source/uibase/shells/drwtxtex.cxx
index e94dbae0b0b8..068a9be9feca 100644
--- a/sw/source/uibase/shells/drwtxtex.cxx
+++ b/sw/source/uibase/shells/drwtxtex.cxx
@@ -636,6 +636,11 @@ void SwDrawTextShell::Execute( SfxRequest  )
 
 aNewAttr.Put(pNewAttrs->Get(nWhich).CloneSetWhich(nEEWhich));
 }
+else if (nEEWhich == EE_CHAR_COLOR)
+{
+
GetView().GetViewFrame()->GetDispatcher()->Execute(SID_CHAR_DLG_EFFECT);
+}
+
 
 SetAttrToMarked(aNewAttr);
 


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

2022-01-27 Thread Justin Luth (via logerrit)
 sw/qa/extras/ooxmlexport/ooxmlexport5.cxx |5 ---
 sw/source/filter/ww8/wrtw8nds.cxx |   40 --
 sw/source/filter/ww8/wrtww8.hxx   |2 -
 3 files changed, 19 insertions(+), 28 deletions(-)

New commits:
commit 46b62fc6acdc2c94dc4b2ab79d38a10c49f9
Author: Justin Luth 
AuthorDate: Thu Jan 20 13:33:15 2022 +0200
Commit: Justin Luth 
CommitDate: Thu Jan 27 19:13:45 2022 +0100

v2 tdf#134951 docxexport: don't lose postponed comment

This patch basically reverts and re-writes the original fix.

Prior to mstahl's 7.4 commit f261fae4af72b1328bc3e93fc52a9a24ce0975b3
   tdf#143039 tdf#143106 sw: DOCX export: don't export duplicate flys
ooxmlexport5's comment would only last for one or two round-trips,
and then be lost after that. It kept moving around into things
like the fly itself, or the footnote.
With mstahl's commit, it was lost immediately (same as Word 2016),
and so the ooxmlexport5 unit test that broke was commented out.

Change-Id: Ia7e881143f1243a3ab81bb94c02b57189f3730f0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128703
Tested-by: Jenkins
Reviewed-by: Michael Stahl 
Reviewed-by: Justin Luth 

diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
index 327e7e88569e..8decd30c3781 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
@@ -130,18 +130,15 @@ CPPUNIT_TEST_FIXTURE(Test, testNoDuplicateAttributeExport)
 
 CPPUNIT_TEST_FIXTURE(Test, testfdo79008)
 {
-loadAndSave("fdo79008.docx");
+loadAndReload("fdo79008.docx");
 /* File crashing while saving in LO.
  * Check if document.xml file is created after fix
  */
 parseExport("word/document.xml");
 
-#if 0
-// TODO: jluth says this test case needs more work
 // tdf#134951: there is only one comment
 xmlDocUniquePtr pXmlSettings = parseExport("word/comments.xml");
 assertXPath(pXmlSettings, "/w:comments/w:comment", 1);
-#endif
 
 // Read-only is set, but it is not enforced, so it should be off...
 SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get());
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx 
b/sw/source/filter/ww8/wrtw8nds.cxx
index f092b8f6f1d0..6a84f77c5f5e 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -394,7 +394,7 @@ sal_Int32 SwWW8AttrIter::SearchNext( sal_Int32 nStartPos )
 return nMinPos;
 }
 
-void SwWW8AttrIter::OutAttr(sal_Int32 nSwPos, bool bWriteCombChars, bool 
bPostponeSingleUse)
+void SwWW8AttrIter::OutAttr(sal_Int32 nSwPos, bool bWriteCombChars)
 {
 m_rExport.AttrOutput().RTLAndCJKState( mbCharIsRTL, GetScript() );
 
@@ -458,13 +458,6 @@ void SwWW8AttrIter::OutAttr(sal_Int32 nSwPos, bool 
bWriteCombChars, bool bPostpo
 nWhichId = aIter.NextWhich();
 }
 }
-else if (bPostponeSingleUse &&
- (nWhich == RES_TXTATR_FTN || nWhich == 
RES_TXTATR_ANNOTATION || nWhich == RES_TXTATR_FIELD))
-{
-// Do not duplicate these multiple times when the 
character run is split.
-// Skip this time - it will be attempted later.
-// ?? also RES_TXTATR_REFMARK: RES_TXTATR_TOXMARK: 
RES_TXTATR_META: RES_TXTATR_METAFIELD: ??
-}
 else
 aRangeItems[nWhich] = (&(pHt->GetAttr()));
 }
@@ -2388,6 +2381,7 @@ void MSWordExportBase::OutputTextNode( SwTextNode& rNode )
 
 const SwRedlineData* pRedlineData = aAttrIter.GetRunLevelRedline( 
nCurrentPos );
 bool bPostponeWritingText= false ;
+bool bStartedPostponedRunProperties = false;
 OUString aSavedSnippet ;
 
 sal_Int32 nNextAttr = GetNextPos( , rNode, nCurrentPos );
@@ -2655,8 +2649,9 @@ void MSWordExportBase::OutputTextNode( SwTextNode& rNode )
 {
 // Output the character attributes
 // #i51277# do this before writing flys at end of paragraph
+bStartedPostponedRunProperties = true;
 AttrOutput().StartRunProperties();
-aAttrIter.OutAttr(nCurrentPos, false, bPostponeWritingText);
+aAttrIter.OutAttr(nCurrentPos, false);
 AttrOutput().EndRunProperties( pRedlineData );
 }
 
@@ -2758,29 +2753,28 @@ void MSWordExportBase::OutputTextNode( SwTextNode& 
rNode )
 
 AttrOutput().WritePostitFieldReference();
 
-if (bPostponeWritingText
-&& (FLY_PROCESSED == nStateOfFlyFrame || FLY_NONE == 
nStateOfFlyFrame))
+if (bPostponeWritingText)
 {
-AttrOutput().EndRun(, nCurrentPos, nNextAttr == nEnd);
-//write the postponed text run
-AttrOutput().StartRun( 

[Libreoffice-commits] core.git: include/svx officecfg/registry svx/sdi sw/sdi sw/source

2022-01-27 Thread Justin Luth (via logerrit)
 include/svx/svxids.hrc   |1 
 officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu |5 ++
 svx/sdi/svx.sdi  |   19 
++
 sw/sdi/_textsh.sdi   |5 ++
 sw/source/uibase/shells/basesh.cxx   |9 
+++-
 sw/source/uibase/shells/textsh1.cxx  |3 +
 6 files changed, 40 insertions(+), 2 deletions(-)

New commits:
commit c73670326ce5b571c31d43721729a05a11563b01
Author: Justin Luth 
AuthorDate: Thu Jan 27 13:15:15 2022 +0200
Commit: Justin Luth 
CommitDate: Thu Jan 27 18:34:37 2022 +0100

related tdf#111733 TextCharacterSpacingControl sw: goto position tab

The kerning button on the sidebar very unhelpfully launches
the character properties dialog at the last-used tab,
instead of bringing the user directly to the "position" tab
where the kerning (.uno:Spacing) property can be found.

Notes:
-sw draw text (eg. textbox) does nothing - no dialog at all
-sw comments also do nothing
-sc does nothing
-sd does nothing

Somehow the sidebar is calling SID_ATTR_CHAR_KERNING,
but I can't find out where. In any case, I have to change
this SID_ATTR_CHAR_KERNING into SID_CHAR_DLG_POSITION
for these "do nothing" situations. That can happen in
separate commits for each situation.

I basically copied SID_CHAR_DLG_EFFECTS which is
explicitly called in underline's "more options",
so it is used a bit differently.

Change-Id: I833d54da3664b9c01325130a2c36bbbe90b2b878
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129043
Tested-by: Justin Luth 
Reviewed-by: Justin Luth 

diff --git a/include/svx/svxids.hrc b/include/svx/svxids.hrc
index 467a96ef421a..f4623b6e0e77 100644
--- a/include/svx/svxids.hrc
+++ b/include/svx/svxids.hrc
@@ -958,6 +958,7 @@ class SvxViewLayoutItem;
 
 #define SID_CELL_FORMAT_BORDER  ( SID_SVX_START + 1132 
)
 #define SID_CHAR_DLG_EFFECT ( SID_SVX_START + 1133 
)
+#define SID_CHAR_DLG_POSITION   ( SID_SVX_START + 1134 
)
 
 #define FN_SVX_SET_NUMBER   ( SID_SVX_START + 1136 
)
 #define FN_SVX_SET_BULLET   ( SID_SVX_START + 1137 
)
diff --git 
a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu 
b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
index d97996d34f44..9cea6ad4deef 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
@@ -6676,6 +6676,11 @@ bit 3 (0x8): #define 
UICOMMANDDESCRIPTION_PROPERTIES_TOGGLEBUTTON 8
   Character Font Effects...
 
   
+  
+
+  Character Font Position...
+
+  
   
 
   F~ormat
diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi
index 84f959fc4e1b..2ea903df9edf 100644
--- a/svx/sdi/svx.sdi
+++ b/svx/sdi/svx.sdi
@@ -3008,6 +3008,25 @@ SfxVoidItem FontEffectsDialog SID_CHAR_DLG_EFFECT
 ]
 
 
+SfxVoidItem FontPositionDialog SID_CHAR_DLG_POSITION
+()
+[
+AutoUpdate = FALSE,
+FastCall = FALSE,
+ReadOnlyDoc = FALSE,
+Toggle = FALSE,
+Container = FALSE,
+RecordAbsolute = FALSE,
+RecordPerItem;
+Asynchron;
+
+AccelConfig = TRUE,
+MenuConfig = TRUE,
+ToolBoxConfig = TRUE,
+GroupId = SfxGroupId::Format;
+]
+
+
 SvxFontHeightItem  FontHeight SID_ATTR_CHAR_FONTHEIGHT
 
 [
diff --git a/sw/sdi/_textsh.sdi b/sw/sdi/_textsh.sdi
index 38359c593471..c30d3b2057ea 100644
--- a/sw/sdi/_textsh.sdi
+++ b/sw/sdi/_textsh.sdi
@@ -1531,6 +1531,11 @@ interface BaseText
 ExecMethod = Execute ;
 DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
 ]
+SID_CHAR_DLG_POSITION
+[
+ExecMethod = Execute ;
+DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
+]
 SID_CHAR_DLG_FOR_PARAGRAPH
 [
 ExecMethod = Execute ;
diff --git a/sw/source/uibase/shells/basesh.cxx 
b/sw/source/uibase/shells/basesh.cxx
index 3e13df5ec568..b2f8abd694fb 100644
--- a/sw/source/uibase/shells/basesh.cxx
+++ b/sw/source/uibase/shells/basesh.cxx
@@ -2173,12 +2173,12 @@ SwBaseShell::~SwBaseShell()
 void SwBaseShell::ExecTextCtrl( SfxRequest& rReq )
 {
 const SfxItemSet *pArgs = rReq.GetArgs();
+const sal_uInt16 nSlot = rReq.GetSlot();
 
 if( pArgs)
 {
 SwWrtShell  = GetShell();
 std::unique_ptr pSSetItem;
-sal_uInt16 nSlot = rReq.GetSlot();
 SfxItemPool& rPool = rSh.GetAttrPool();
 sal_uInt16 nWhich = rPool.GetWhich( nSlot );
 SvtScriptType nScripts = SvtScriptType::LATIN | SvtScriptType::ASIAN | 
SvtScriptType::COMPLEX;
@@ -2292,7 +2292,12 @@ void SwBaseShell::ExecTextCtrl( 

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

2022-01-06 Thread Justin Luth (via logerrit)
 sw/qa/extras/ooxmlexport/data/tdf146491.odt |binary
 sw/qa/extras/ooxmlexport/ooxmlexport5.cxx   |   11 ++-
 sw/source/filter/ww8/wrtw8sty.cxx   |7 ++-
 3 files changed, 12 insertions(+), 6 deletions(-)

New commits:
commit 42e7dc75363ee7f326f7f9e2b4476e55300f1f7a
Author: Justin Luth 
AuthorDate: Thu Jan 6 13:05:34 2022 +0200
Commit: Justin Luth 
CommitDate: Thu Jan 6 15:14:35 2022 +0100

tdf146491 Revert "tdf121374 ooxmlexport: export H/F to def...

...default section"

This reverts LO 6.3 commit e6f5dec3250b4d26bc4bb485fad2100ee29a3528.
Something else must have changed because it doesn't seem to
be needed anymore.

It wouldn't be terrible to duplicate headers/footers
unnecessarily,

One side effect is that page styles could be
duplicated multiple times if there were many
non-overlapping sections. If the H/F contained images,
that could bloat the filesize,
or in this specific bug, it was duplicating fields.

Since it doesn't appear to be necessary anymore,
let's just revert it.

Change-Id: Id95a4f162fb2ecbf6ce0f97db056071db9ebad3d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128041
Tested-by: Jenkins
Reviewed-by: Justin Luth 

diff --git a/sw/qa/extras/ooxmlexport/data/tdf146491.odt 
b/sw/qa/extras/ooxmlexport/data/tdf146491.odt
new file mode 100644
index ..2ee08f1d3e9b
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf146491.odt differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
index d46344fe53cf..ef128fb59eef 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
@@ -1289,7 +1289,16 @@ DECLARE_OOXMLEXPORT_TEST(testSectionHeader, 
"sectionprot.odt")
 if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"))
 {
 // this test must not be zero
-assertXPath(pXmlDoc, "//w:headerReference", 2);
+assertXPath(pXmlDoc, "//w:headerReference", 1);
+}
+}
+
+DECLARE_OOXMLEXPORT_TEST(testTdf146491, "tdf146491.odt")
+{
+if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"))
+{
+// This was 12 - a page style was unnecessarily created for every 
section.
+assertXPath(pXmlDoc, "//w:footerReference", 1);
 }
 }
 
diff --git a/sw/source/filter/ww8/wrtw8sty.cxx 
b/sw/source/filter/ww8/wrtw8sty.cxx
index 4f121ccd7cd9..e64f16f0ea97 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -1639,7 +1639,6 @@ void MSWordExportBase::SectionProperties( const 
WW8_SepInfo& rSepInfo, WW8_PdAtt
 */
 sal_uInt8 nBreakCode = 2;// default start new page
 bool bOutPgDscSet = true, bLeftRightPgChain = false, bOutputStyleItemSet = 
false;
-bool bEnsureHeaderFooterWritten = rSepInfo.pSectionFormat && 
rSepInfo.bIsFirstParagraph;
 const SwFrameFormat* pPdFormat = >GetMaster();
 bool bUsePrevSectionNextStyle = false;
 if ( rSepInfo.pSectionFormat )
@@ -1657,9 +1656,7 @@ void MSWordExportBase::SectionProperties( const 
WW8_SepInfo& rSepInfo, WW8_PdAtt
 }
 }
 
-if ( reinterpret_cast(sal_IntPtr(-1)) == 
rSepInfo.pSectionFormat )
-bEnsureHeaderFooterWritten |= !rSepInfo.pPDNd && GetExportFormat() 
!= ExportFormat::RTF;
-else
+if (reinterpret_cast(sal_IntPtr(-1)) != 
rSepInfo.pSectionFormat)
 {
 if ( nBreakCode == 0 )
 bOutPgDscSet = false;
@@ -1893,7 +1890,7 @@ void MSWordExportBase::SectionProperties( const 
WW8_SepInfo& rSepInfo, WW8_PdAtt
 }
 
 // Ensure that headers are written if section is first paragraph
-if ( nBreakCode != 0 || bEnsureHeaderFooterWritten )
+if (nBreakCode != 0 || (rSepInfo.pSectionFormat && 
rSepInfo.bIsFirstParagraph))
 {
 if ( titlePage )
 {


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

2022-01-05 Thread Justin Luth (via logerrit)
 sw/qa/extras/rtfexport/data/tdf146489.rtf |   56 ++
 sw/qa/extras/rtfexport/rtfexport4.cxx |6 ++
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |4 +
 3 files changed, 65 insertions(+), 1 deletion(-)

New commits:
commit 411cc8af8490ba307245c689ed5714f612bb9d6f
Author: Justin Luth 
AuthorDate: Tue Jan 4 15:36:35 2022 +0200
Commit: Justin Luth 
CommitDate: Wed Jan 5 11:35:55 2022 +0100

tdf#146489 writerfilter: ensure only character properties

This is another RTF regression found against LO 6.0's
commit fdfdea4d5af51a68f2d497cc5c3359d74c385fd5
   tdf#82173 writerfilter: apply char properties to footnote

The original commit in LO 6.0 intended that only character properties
were used. A follow-up commit for RTF tried to ensure that
these would be on the top of the stack.

However, in this case, it seems like somehow the table is
getting involved in putting the paragraph context
on the top. (Actually, there is no
GetTopContextOfType(CONTEXT_CHARACTER) at all.)

In any case, aFontProperties should only contain
character properties, so ensure that.

The unit test shows that there is still some kind
of import problem, because the footnote marker
should be a large, red character, but it is just
normal text. See tdf#108949.

Change-Id: I1ea7256891b198046f79f0d3a36e43d6c2ae3383
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127943
Tested-by: Jenkins
Reviewed-by: Justin Luth 
(cherry picked from commit 44c37c4af2d23d1469cdeeb56f2f5a2bef493986)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127954

diff --git a/sw/qa/extras/rtfexport/data/tdf146489.rtf 
b/sw/qa/extras/rtfexport/data/tdf146489.rtf
new file mode 100644
index ..d8e198114052
--- /dev/null
+++ b/sw/qa/extras/rtfexport/data/tdf146489.rtf
@@ -0,0 +1,56 @@
+{\rtf1\ansi\deff3\adeflang1025
+{\fonttbl{\f0\froman\fprq2\fcharset0 Times New 
Roman;}{\f1\froman\fprq2\fcharset2 Symbol;}{\f2\fswiss\fprq2\fcharset0 
Arial;}{\f3\froman\fprq2\fcharset0 Liberation Serif{\*\falt Times New 
Roman};}{\f4\fswiss\fprq2\fcharset0 Liberation Sans{\*\falt 
Arial};}{\f5\fnil\fprq2\fcharset0 DejaVu Sans;}{\f6\fswiss\fprq0\fcharset0 
FreeSans;}{\f7\fnil\fprq2\fcharset0 FreeSans;}}
+{\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\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;\red201\green33\blue30;\red255\green233\blue148;}
+{\stylesheet{\s0\snext0\rtlch\af7\afs24\alang1081 
\ltrch\lang1033\langfe2052\hich\af3\loch\widctlpar\hyphpar0\aspalpha\ltrpar\cf0\f3\fs24\lang1033\kerning1\dbch\af5\langfe2052
 Normal;}
+{\*\cs15\snext15 Numbering Symbols;}
+{\*\cs16\snext16\loch\super Footnote Anchor;}
+{\*\cs17\snext17 Footnote Characters;}
+{\*\cs18\snext18\loch\super Endnote Anchor;}
+{\*\cs19\snext19 Endnote Characters;}
+{\s20\sbasedon0\snext21\rtlch\af7\afs28 
\ltrch\hich\af4\loch\sb240\sa120\keepn\f4\fs28\dbch\af5 Heading;}
+{\s21\sbasedon0\snext21\loch\sl276\slmult1\sb0\sa140 Text Body;}
+{\s22\sbasedon21\snext22\rtlch\af6 \ltrch\loch\sl276\slmult1\sb0\sa140 List;}
+{\s23\sbasedon0\snext23\rtlch\af6\afs24\ai 
\ltrch\loch\sb120\sa120\noline\fs24\i Caption;}
+{\s24\sbasedon0\snext24\rtlch\af6\alang255 
\ltrch\lang255\langfe255\loch\noline\lang255\dbch\langfe255 Index;}
+{\s25\sbasedon0\snext25\loch\nowidctlpar\noline Table Contents;}
+{\s26\sbasedon0\snext26\rtlch\afs20 
\ltrch\loch\li340\ri0\lin340\rin0\fi-340\noline\fs20 Footnote;}
+}{\*\listtable{\list\listtemplateid1
+{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext 
\'02\'00.;}{\levelnumbers\'01;}\fi-360\li720}
+{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext 
\'02\'01.;}{\levelnumbers\'01;}\fi-360\li1080}
+{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext 
\'02\'02.;}{\levelnumbers\'01;}\fi-360\li1440}
+{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext 
\'02\'03.;}{\levelnumbers\'01;}\fi-360\li1800}
+{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext 
\'02\'04.;}{\levelnumbers\'01;}\fi-360\li2160}
+{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext 
\'02\'05.;}{\levelnumbers\'01;}\fi-360\li2520}
+{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext 
\'02\'06.;}{\levelnumbers\'01;}\fi-360\li2880}
+{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext 
\'02\'07.;}{\levelnumbers\'01;}\fi-360\li3240}
+{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext 
\'02\'08.;}{\levelnumbers\'01;}\fi-360\li3600}\listid1}
+{\list\listtemplateid2
+{\listlevel\levelnfc255\leveljc0\levelstartat1\levelfollow2{\leveltext 

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

2022-01-05 Thread Justin Luth (via logerrit)
 sw/qa/extras/rtfexport/data/tdf146489.rtf |   56 ++
 sw/qa/extras/rtfexport/rtfexport4.cxx |6 ++
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |4 +
 3 files changed, 65 insertions(+), 1 deletion(-)

New commits:
commit 44c37c4af2d23d1469cdeeb56f2f5a2bef493986
Author: Justin Luth 
AuthorDate: Tue Jan 4 15:36:35 2022 +0200
Commit: Justin Luth 
CommitDate: Wed Jan 5 09:44:30 2022 +0100

tdf#146489 writerfilter: ensure only character properties

This is another RTF regression found against LO 6.0's
commit fdfdea4d5af51a68f2d497cc5c3359d74c385fd5
   tdf#82173 writerfilter: apply char properties to footnote

The original commit in LO 6.0 intended that only character properties
were used. A follow-up commit for RTF tried to ensure that
these would be on the top of the stack.

However, in this case, it seems like somehow the table is
getting involved in putting the paragraph context
on the top. (Actually, there is no
GetTopContextOfType(CONTEXT_CHARACTER) at all.)

In any case, aFontProperties should only contain
character properties, so ensure that.

The unit test shows that there is still some kind
of import problem, because the footnote marker
should be a large, red character, but it is just
normal text. See tdf#108949.

Change-Id: I1ea7256891b198046f79f0d3a36e43d6c2ae3383
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127943
Tested-by: Jenkins
Reviewed-by: Justin Luth 

diff --git a/sw/qa/extras/rtfexport/data/tdf146489.rtf 
b/sw/qa/extras/rtfexport/data/tdf146489.rtf
new file mode 100644
index ..d8e198114052
--- /dev/null
+++ b/sw/qa/extras/rtfexport/data/tdf146489.rtf
@@ -0,0 +1,56 @@
+{\rtf1\ansi\deff3\adeflang1025
+{\fonttbl{\f0\froman\fprq2\fcharset0 Times New 
Roman;}{\f1\froman\fprq2\fcharset2 Symbol;}{\f2\fswiss\fprq2\fcharset0 
Arial;}{\f3\froman\fprq2\fcharset0 Liberation Serif{\*\falt Times New 
Roman};}{\f4\fswiss\fprq2\fcharset0 Liberation Sans{\*\falt 
Arial};}{\f5\fnil\fprq2\fcharset0 DejaVu Sans;}{\f6\fswiss\fprq0\fcharset0 
FreeSans;}{\f7\fnil\fprq2\fcharset0 FreeSans;}}
+{\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\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;\red201\green33\blue30;\red255\green233\blue148;}
+{\stylesheet{\s0\snext0\rtlch\af7\afs24\alang1081 
\ltrch\lang1033\langfe2052\hich\af3\loch\widctlpar\hyphpar0\aspalpha\ltrpar\cf0\f3\fs24\lang1033\kerning1\dbch\af5\langfe2052
 Normal;}
+{\*\cs15\snext15 Numbering Symbols;}
+{\*\cs16\snext16\loch\super Footnote Anchor;}
+{\*\cs17\snext17 Footnote Characters;}
+{\*\cs18\snext18\loch\super Endnote Anchor;}
+{\*\cs19\snext19 Endnote Characters;}
+{\s20\sbasedon0\snext21\rtlch\af7\afs28 
\ltrch\hich\af4\loch\sb240\sa120\keepn\f4\fs28\dbch\af5 Heading;}
+{\s21\sbasedon0\snext21\loch\sl276\slmult1\sb0\sa140 Text Body;}
+{\s22\sbasedon21\snext22\rtlch\af6 \ltrch\loch\sl276\slmult1\sb0\sa140 List;}
+{\s23\sbasedon0\snext23\rtlch\af6\afs24\ai 
\ltrch\loch\sb120\sa120\noline\fs24\i Caption;}
+{\s24\sbasedon0\snext24\rtlch\af6\alang255 
\ltrch\lang255\langfe255\loch\noline\lang255\dbch\langfe255 Index;}
+{\s25\sbasedon0\snext25\loch\nowidctlpar\noline Table Contents;}
+{\s26\sbasedon0\snext26\rtlch\afs20 
\ltrch\loch\li340\ri0\lin340\rin0\fi-340\noline\fs20 Footnote;}
+}{\*\listtable{\list\listtemplateid1
+{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext 
\'02\'00.;}{\levelnumbers\'01;}\fi-360\li720}
+{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext 
\'02\'01.;}{\levelnumbers\'01;}\fi-360\li1080}
+{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext 
\'02\'02.;}{\levelnumbers\'01;}\fi-360\li1440}
+{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext 
\'02\'03.;}{\levelnumbers\'01;}\fi-360\li1800}
+{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext 
\'02\'04.;}{\levelnumbers\'01;}\fi-360\li2160}
+{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext 
\'02\'05.;}{\levelnumbers\'01;}\fi-360\li2520}
+{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext 
\'02\'06.;}{\levelnumbers\'01;}\fi-360\li2880}
+{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext 
\'02\'07.;}{\levelnumbers\'01;}\fi-360\li3240}
+{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext 
\'02\'08.;}{\levelnumbers\'01;}\fi-360\li3600}\listid1}
+{\list\listtemplateid2
+{\listlevel\levelnfc255\leveljc0\levelstartat1\levelfollow2{\leveltext 
\'00;}{\levelnumbers;}\fi0\li0}
+{\listlevel\levelnfc255\leveljc0\levelstartat1\levelfollow2{\leveltext 
\'00;}{\levelnumbers;}\fi0\li0}

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

2021-12-22 Thread Justin Luth (via logerrit)
 sw/qa/extras/uiwriter/uiwriter3.cxx |   19 +++
 sw/source/core/swg/SwXMLTextBlocks1.cxx |   16 +---
 2 files changed, 32 insertions(+), 3 deletions(-)

New commits:
commit 156f2e3bac9ba2cfe517ea14e7cce961bd0e7ceb
Author: Justin Luth 
AuthorDate: Fri Dec 17 18:45:42 2021 +0200
Commit: Michael Stahl 
CommitDate: Wed Dec 22 10:15:27 2021 +0100

tdf#144364 sw: Revert "Use FastParser in SwXMLTextBlocks"

This reverts 7.0 commit fd6feb4f538b0c5c9061529ff002be9f62a7239a.
Noel said this was just a performance fix, so just go ahead
and revert it.

It caused the regression documented in bug 144364.

Change-Id: I044c49e42873db120a94d93a00e9b35105778b9c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127012
Tested-by: Jenkins
Reviewed-by: Justin Luth 
(cherry picked from commit 1addd8c104f6ad390bdd0ca61cd5ce97b55ce218)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126982
Reviewed-by: Noel Grandin 
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127147
(cherry picked from commit d8cf8482ae5ed72dc969d9adb47c113c442452be)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127168
Reviewed-by: Michael Stahl 
Tested-by: Michael Stahl 

diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx 
b/sw/qa/extras/uiwriter/uiwriter3.cxx
index 514a13e88ff1..b536692fc5a6 100644
--- a/sw/qa/extras/uiwriter/uiwriter3.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter3.cxx
@@ -1689,6 +1689,25 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf130629)
 CPPUNIT_ASSERT_EQUAL(1, getShapes());
 }
 
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf144364)
+{
+SwDoc* const pDoc = createSwDoc();
+SwWrtShell* const pWrtSh = pDoc->GetDocShell()->GetWrtShell();
+CPPUNIT_ASSERT(pWrtSh);
+
+// expands autotext (via F3)
+pWrtSh->Insert("AR");
+
+SwXTextDocument* pTextDoc = 
dynamic_cast(mxComponent.get());
+pTextDoc->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_F3);
+Scheduler::ProcessEventsToIdle();
+
+// was ...'letter of '
+CPPUNIT_ASSERT_EQUAL(
+OUString("We hereby acknowledge the receipt of your letter of 
."),
+getParagraph(1)->getString());
+}
+
 CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf141613)
 {
 SwDoc* const pDoc = createSwDoc();
diff --git a/sw/source/core/swg/SwXMLTextBlocks1.cxx 
b/sw/source/core/swg/SwXMLTextBlocks1.cxx
index 0297d68fa442..589d4e192097 100644
--- a/sw/source/core/swg/SwXMLTextBlocks1.cxx
+++ b/sw/source/core/swg/SwXMLTextBlocks1.cxx
@@ -31,6 +31,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -194,6 +195,9 @@ ErrCode SwXMLTextBlocks::GetMacroTable( sal_uInt16 nIdx,
 uno::Reference< uno::XComponentContext > xContext =
 comphelper::getProcessComponentContext();
 
+// get parser
+uno::Reference< xml::sax::XParser > xParser = 
xml::sax::Parser::create( xContext );
+
 // create descriptor and reference to it. Either
 // both or neither must be kept because of the
 // reference counting!
@@ -206,15 +210,21 @@ ErrCode SwXMLTextBlocks::GetMacroTable( sal_uInt16 nIdx,
 OUString sFilterComponent = bOasis
 ? 
OUString("com.sun.star.comp.Writer.XMLOasisAutotextEventsImporter")
 : OUString("com.sun.star.comp.Writer.XMLAutotextEventsImporter");
-uno::Reference< xml::sax::XFastParser > xFilter(
+uno::Reference< xml::sax::XDocumentHandler > xFilter(
 
xContext->getServiceManager()->createInstanceWithArgumentsAndContext(
 sFilterComponent, aFilterArguments, xContext),
-UNO_QUERY_THROW );
+UNO_QUERY );
+OSL_ENSURE( xFilter.is(), "can't instantiate autotext-events filter");
+if ( !xFilter.is() )
+return ERR_SWG_READ_ERROR;
+
+// connect parser and filter
+xParser->setDocumentHandler( xFilter );
 
 // parse the stream
 try
 {
-xFilter->parseStream( aParserInput );
+xParser->parseStream( aParserInput );
 }
 catch( xml::sax::SAXParseException& )
 {


[Libreoffice-commits] core.git: Branch 'distro/lhm/libreoffice-6-4+backports' - sw/source

2021-12-21 Thread Justin Luth (via logerrit)
 sw/source/core/edit/acorrect.cxx |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 55a7fde6bbe62eb9be2f48f1e97ac86192d932c8
Author: Justin Luth 
AuthorDate: Thu Nov 11 12:28:21 2021 +0200
Commit: Thorsten Behrens 
CommitDate: Tue Dec 21 23:51:46 2021 +0100

tdf#139922 sw autocorr: don't return GetPrevPara if isEmpty

This fixes a LO 6.2 regression caused by
commit 4cf5a46f16dec8ce16c6662ce5c17903e28b8fa3.

Change-Id: I4aee8f4e79a40a8b8f82faa3e62dead80a952510
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125037
Tested-by: Jenkins
Reviewed-by: Justin Luth 
Reviewed-by: Michael Stahl 
(cherry picked from commit 59dc5d00b04927d07df2dcc3c17acfdc760d8765)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125144
(cherry picked from commit 133fe29d06445daadc556cff013d5194a883ea9b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127156
Tested-by: Thorsten Behrens 
Reviewed-by: Thorsten Behrens 

diff --git a/sw/source/core/edit/acorrect.cxx b/sw/source/core/edit/acorrect.cxx
index 7304e6e7b702..286d4d078de5 100644
--- a/sw/source/core/edit/acorrect.cxx
+++ b/sw/source/core/edit/acorrect.cxx
@@ -346,8 +346,11 @@ OUString const* SwAutoCorrDoc::GetPrevPara(bool const 
bAtNormalPos)
 }
 sw::GotoPrevLayoutTextFrame(*pIdx, rEditSh.GetLayout());
 }
-if (pFrame && 0 == 
pFrame->GetTextNodeForParaProps()->GetAttrOutlineLevel())
+if (pFrame && !pFrame->GetText().isEmpty() &&
+0 == pFrame->GetTextNodeForParaProps()->GetAttrOutlineLevel())
+{
 pStr = & pFrame->GetText();
+}
 
 if( bUndoIdInitialized )
 bUndoIdInitialized = true;


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

2021-12-21 Thread Justin Luth (via logerrit)
 sw/source/core/docnode/ndtbl1.cxx |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 40b84167a58901d50d98730260d968046283376c
Author: Justin Luth 
AuthorDate: Mon Dec 20 14:43:09 2021 +0200
Commit: Xisco Fauli 
CommitDate: Tue Dec 21 12:36:29 2021 +0100

tdf#90805 sw tables: use veryThin instead of hairline borders

This keeps it consitent with tdf#99027 which was fixed on the
same day.

Change-Id: I03d8a9c2ab1e7f6cf8a7c95d7600d549138e414e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127165
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt 
Reviewed-by: Justin Luth 
(cherry picked from commit 3807e43b3b1a05eb7d9c88988b41448cfc05015a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127183
Reviewed-by: Xisco Fauli 

diff --git a/sw/source/core/docnode/ndtbl1.cxx 
b/sw/source/core/docnode/ndtbl1.cxx
index f300cec48c5d..1cb5fc651b6c 100644
--- a/sw/source/core/docnode/ndtbl1.cxx
+++ b/sw/source/core/docnode/ndtbl1.cxx
@@ -930,7 +930,7 @@ void SwDoc::SetTabLineStyle( const SwCursor& rCursor,
 
GetIDocumentUndoRedo().AppendUndo(std::make_unique(*pTableNd));
 }
 
-const SvxBorderLine aHairlineBorder(pColor, SvxBorderLineWidth::Hairline);
+const SvxBorderLine aDefaultBorder(pColor, SvxBorderLineWidth::VeryThin);
 
 for( auto  : aUnions )
 {
@@ -961,10 +961,10 @@ void SwDoc::SetTabLineStyle( const SwCursor& rCursor,
 }
 else if (pColor && !pBorderLine && !pTop && !pBot && !pLeft && 
!pRight)
 {
-aBox->SetLine(, SvxBoxItemLine::TOP);
-aBox->SetLine(, SvxBoxItemLine::BOTTOM);
-aBox->SetLine(, SvxBoxItemLine::LEFT);
-aBox->SetLine(, SvxBoxItemLine::RIGHT);
+aBox->SetLine(, SvxBoxItemLine::TOP);
+aBox->SetLine(, SvxBoxItemLine::BOTTOM);
+aBox->SetLine(, SvxBoxItemLine::LEFT);
+aBox->SetLine(, SvxBoxItemLine::RIGHT);
 }
 else
 {


[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - editeng/source include/editeng sd/source

2021-12-21 Thread Justin Luth (via logerrit)
 editeng/source/outliner/outlvw.cxx |   29 +
 include/editeng/outliner.hxx   |5 +
 sd/source/ui/func/fuolbull.cxx |   13 +
 3 files changed, 47 insertions(+)

New commits:
commit d181d828d9a3490cefc3a9b41fbda2d5b07b08c3
Author: Justin Luth 
AuthorDate: Thu Dec 16 08:51:55 2021 +0200
Commit: Justin Luth 
CommitDate: Tue Dec 21 09:54:57 2021 +0100

tdf#133713 sd: bullets and numbering should enable it

This fixes a LO 6.3 regression caused by re-working
the numbering dialog (switching from FuOutlineBullet
to the new FuBulletAndPosition).

When running uno:OutlineBullet, one expects to have
numbering applied to the selection. However, that part
was completely omitted from the new implementation.
I can't imagine why, since most everything else in the
nearby code was just a copy/paste from the old methods.

This patch restores some of the logic from the old function.
[Deleted in commit 5ff162bede44b77cb19e5ff6571b6e34f228d9fb
Author: Gül?ah Köse on Mon May 27 23:49:41 2019 +0300
tdf#120905 Remove old FuOutlineBullet dialog code.]

Partially revert loplugin:unusedmethods to recover EnableBullets()
from commit cae829e9c1394851fc88829d5197460929c2792a

This fixes Format -> Bullets and Numbering,
right-click pop-up Bullets and Numbering,
and sidebar's Toggle * List's "More Numbering".

Change-Id: Iee3b66bd715e92167c9423242627a996191dcb72
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126904
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 
(cherry picked from commit 12832284318125b8649f6a67e3aa12aa953afdfb)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127176
Reviewed-by: Justin Luth 

diff --git a/editeng/source/outliner/outlvw.cxx 
b/editeng/source/outliner/outlvw.cxx
index e607698d5efe..bf11c742dfea 100644
--- a/editeng/source/outliner/outlvw.cxx
+++ b/editeng/source/outliner/outlvw.cxx
@@ -930,6 +930,35 @@ void OutlinerView::ToggleBulletsNumbering(
 }
 }
 
+void OutlinerView::EnsureNumberingIsOn()
+{
+pOwner->UndoActionStart(OLUNDO_DEPTH);
+
+ESelection aSel(pEditView->GetSelection());
+aSel.Adjust();
+
+const bool bUpdate = pOwner->pEditEngine->IsUpdateLayout();
+pOwner->pEditEngine->SetUpdateLayout(false);
+
+for (sal_Int32 nPara = aSel.nStartPara; nPara <= aSel.nEndPara; nPara++)
+{
+Paragraph* pPara = pOwner->pParaList->GetParagraph(nPara);
+DBG_ASSERT(pPara, "OutlinerView::EnableBullets(), illegal selection?");
+
+if (pPara && pOwner->GetDepth(nPara) == -1)
+pOwner->SetDepth(pPara, 0);
+}
+
+sal_Int32 nParaCount = pOwner->pParaList->GetParagraphCount();
+pOwner->ImplCheckParagraphs(aSel.nStartPara, nParaCount);
+
+const sal_Int32 nEndPara = (nParaCount > 0) ? nParaCount-1 : nParaCount;
+pOwner->pEditEngine->QuickMarkInvalid(ESelection(aSel.nStartPara, 0, 
nEndPara, 0));
+
+pOwner->pEditEngine->SetUpdateLayout(bUpdate);
+
+pOwner->UndoActionEnd();
+}
 
 void OutlinerView::ApplyBulletsNumbering(
 const bool bHandleBullets,
diff --git a/include/editeng/outliner.hxx b/include/editeng/outliner.hxx
index f34028496941..87fabb4ee45e 100644
--- a/include/editeng/outliner.hxx
+++ b/include/editeng/outliner.hxx
@@ -345,6 +345,11 @@ public:
 void SwitchOffBulletsNumbering(
 const bool bAtSelection = false );
 
+/** enables numbering for the selected paragraphs that are not enabled and 
ignore all selected
+paragraphs that already have numbering enabled.
+*/
+voidEnsureNumberingIsOn();
+
 boolIsCursorAtWrongSpelledWord();
 boolIsWrongSpelledWordAtPos( const Point& rPosPixel );
 voidExecuteSpellPopup(const Point& rPosPixel, const 
Link& rCallBack);
diff --git a/sd/source/ui/func/fuolbull.cxx b/sd/source/ui/func/fuolbull.cxx
index 6c6b9aef5b0f..054a44e9b8a3 100644
--- a/sd/source/ui/func/fuolbull.cxx
+++ b/sd/source/ui/func/fuolbull.cxx
@@ -91,6 +91,19 @@ void FuBulletAndPosition::DoExecute( SfxRequest& rReq )
 
 if( nResult == RET_OK )
 {
+OutlinerView* pOLV = pView->GetTextEditOutlinerView();
+
+std::unique_ptr> aGuard;
+
+if (OutlineView* pOutlineView = dynamic_cast(pView))
+{
+pOLV = 
pOutlineView->GetViewByWindow(mpViewShell->GetActiveWindow());
+aGuard.reset(new OutlineViewModelChangeGuard(*pOutlineView));
+}
+
+if( pOLV )
+pOLV->EnsureNumberingIsOn();
+
 const SfxItemSet pOutputSet( *pDlg->GetOutputItemSet(  ) );
 pView->SetAttributes(pOutputSet, /*bReplaceAll=*/false, /*bSlide*/ 
pDlg->IsSlideScope(), /*bMaster=*/pDlg->IsApplyToMaster());
 }


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

2021-12-21 Thread Justin Luth (via logerrit)
 sw/source/core/docnode/ndtbl1.cxx |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 3807e43b3b1a05eb7d9c88988b41448cfc05015a
Author: Justin Luth 
AuthorDate: Mon Dec 20 14:43:09 2021 +0200
Commit: Justin Luth 
CommitDate: Tue Dec 21 09:29:39 2021 +0100

tdf#90805 sw tables: use veryThin instead of hairline borders

This keeps it consitent with tdf#99027 which was fixed on the
same day.

Change-Id: I03d8a9c2ab1e7f6cf8a7c95d7600d549138e414e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127165
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt 
Reviewed-by: Justin Luth 

diff --git a/sw/source/core/docnode/ndtbl1.cxx 
b/sw/source/core/docnode/ndtbl1.cxx
index f300cec48c5d..1cb5fc651b6c 100644
--- a/sw/source/core/docnode/ndtbl1.cxx
+++ b/sw/source/core/docnode/ndtbl1.cxx
@@ -930,7 +930,7 @@ void SwDoc::SetTabLineStyle( const SwCursor& rCursor,
 
GetIDocumentUndoRedo().AppendUndo(std::make_unique(*pTableNd));
 }
 
-const SvxBorderLine aHairlineBorder(pColor, SvxBorderLineWidth::Hairline);
+const SvxBorderLine aDefaultBorder(pColor, SvxBorderLineWidth::VeryThin);
 
 for( auto  : aUnions )
 {
@@ -961,10 +961,10 @@ void SwDoc::SetTabLineStyle( const SwCursor& rCursor,
 }
 else if (pColor && !pBorderLine && !pTop && !pBot && !pLeft && 
!pRight)
 {
-aBox->SetLine(, SvxBoxItemLine::TOP);
-aBox->SetLine(, SvxBoxItemLine::BOTTOM);
-aBox->SetLine(, SvxBoxItemLine::LEFT);
-aBox->SetLine(, SvxBoxItemLine::RIGHT);
+aBox->SetLine(, SvxBoxItemLine::TOP);
+aBox->SetLine(, SvxBoxItemLine::BOTTOM);
+aBox->SetLine(, SvxBoxItemLine::LEFT);
+aBox->SetLine(, SvxBoxItemLine::RIGHT);
 }
 else
 {


[Libreoffice-commits] core.git: editeng/source include/editeng sd/source

2021-12-20 Thread Justin Luth (via logerrit)
 editeng/source/outliner/outlvw.cxx |   29 +
 include/editeng/outliner.hxx   |5 +
 sd/source/ui/func/fuolbull.cxx |   13 +
 3 files changed, 47 insertions(+)

New commits:
commit 12832284318125b8649f6a67e3aa12aa953afdfb
Author: Justin Luth 
AuthorDate: Thu Dec 16 08:51:55 2021 +0200
Commit: Miklos Vajna 
CommitDate: Tue Dec 21 08:30:40 2021 +0100

tdf#133713 sd: bullets and numbering should enable it

This fixes a LO 6.3 regression caused by re-working
the numbering dialog (switching from FuOutlineBullet
to the new FuBulletAndPosition).

When running uno:OutlineBullet, one expects to have
numbering applied to the selection. However, that part
was completely omitted from the new implementation.
I can't imagine why, since most everything else in the
nearby code was just a copy/paste from the old methods.

This patch restores some of the logic from the old function.
[Deleted in commit 5ff162bede44b77cb19e5ff6571b6e34f228d9fb
Author: Gül?ah Köse on Mon May 27 23:49:41 2019 +0300
tdf#120905 Remove old FuOutlineBullet dialog code.]

Partially revert loplugin:unusedmethods to recover EnableBullets()
from commit cae829e9c1394851fc88829d5197460929c2792a

This fixes Format -> Bullets and Numbering,
right-click pop-up Bullets and Numbering,
and sidebar's Toggle * List's "More Numbering".

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

diff --git a/editeng/source/outliner/outlvw.cxx 
b/editeng/source/outliner/outlvw.cxx
index e607698d5efe..bf11c742dfea 100644
--- a/editeng/source/outliner/outlvw.cxx
+++ b/editeng/source/outliner/outlvw.cxx
@@ -930,6 +930,35 @@ void OutlinerView::ToggleBulletsNumbering(
 }
 }
 
+void OutlinerView::EnsureNumberingIsOn()
+{
+pOwner->UndoActionStart(OLUNDO_DEPTH);
+
+ESelection aSel(pEditView->GetSelection());
+aSel.Adjust();
+
+const bool bUpdate = pOwner->pEditEngine->IsUpdateLayout();
+pOwner->pEditEngine->SetUpdateLayout(false);
+
+for (sal_Int32 nPara = aSel.nStartPara; nPara <= aSel.nEndPara; nPara++)
+{
+Paragraph* pPara = pOwner->pParaList->GetParagraph(nPara);
+DBG_ASSERT(pPara, "OutlinerView::EnableBullets(), illegal selection?");
+
+if (pPara && pOwner->GetDepth(nPara) == -1)
+pOwner->SetDepth(pPara, 0);
+}
+
+sal_Int32 nParaCount = pOwner->pParaList->GetParagraphCount();
+pOwner->ImplCheckParagraphs(aSel.nStartPara, nParaCount);
+
+const sal_Int32 nEndPara = (nParaCount > 0) ? nParaCount-1 : nParaCount;
+pOwner->pEditEngine->QuickMarkInvalid(ESelection(aSel.nStartPara, 0, 
nEndPara, 0));
+
+pOwner->pEditEngine->SetUpdateLayout(bUpdate);
+
+pOwner->UndoActionEnd();
+}
 
 void OutlinerView::ApplyBulletsNumbering(
 const bool bHandleBullets,
diff --git a/include/editeng/outliner.hxx b/include/editeng/outliner.hxx
index f34028496941..87fabb4ee45e 100644
--- a/include/editeng/outliner.hxx
+++ b/include/editeng/outliner.hxx
@@ -345,6 +345,11 @@ public:
 void SwitchOffBulletsNumbering(
 const bool bAtSelection = false );
 
+/** enables numbering for the selected paragraphs that are not enabled and 
ignore all selected
+paragraphs that already have numbering enabled.
+*/
+voidEnsureNumberingIsOn();
+
 boolIsCursorAtWrongSpelledWord();
 boolIsWrongSpelledWordAtPos( const Point& rPosPixel );
 voidExecuteSpellPopup(const Point& rPosPixel, const 
Link& rCallBack);
diff --git a/sd/source/ui/func/fuolbull.cxx b/sd/source/ui/func/fuolbull.cxx
index c661666f198c..0116b4b0e80f 100644
--- a/sd/source/ui/func/fuolbull.cxx
+++ b/sd/source/ui/func/fuolbull.cxx
@@ -91,6 +91,19 @@ void FuBulletAndPosition::DoExecute( SfxRequest& rReq )
 
 if( nResult == RET_OK )
 {
+OutlinerView* pOLV = pView->GetTextEditOutlinerView();
+
+std::unique_ptr> aGuard;
+
+if (OutlineView* pOutlineView = dynamic_cast(pView))
+{
+pOLV = 
pOutlineView->GetViewByWindow(mpViewShell->GetActiveWindow());
+aGuard.reset(new OutlineViewModelChangeGuard(*pOutlineView));
+}
+
+if( pOLV )
+pOLV->EnsureNumberingIsOn();
+
 const SfxItemSet pOutputSet( *pDlg->GetOutputItemSet(  ) );
 pView->SetAttributes(pOutputSet, /*bReplaceAll=*/false, /*bSlide*/ 
pDlg->IsSlideScope(), /*bMaster=*/pDlg->IsApplyToMaster());
 }


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

2021-12-20 Thread Justin Luth (via logerrit)
 sw/source/core/docnode/ndtbl1.cxx |   34 ++
 1 file changed, 22 insertions(+), 12 deletions(-)

New commits:
commit f314a882c96cc0e951fecb83be73a03ef3f33da1
Author: Justin Luth 
AuthorDate: Thu Dec 16 15:36:59 2021 +0200
Commit: Xisco Fauli 
CommitDate: Mon Dec 20 14:13:53 2021 +0100

related tdf#90805 sw table: ensure border when setting border color

When using uno:FrameLineColor to set a table's border color,
add hairline borders if there are none at all.

Change-Id: Ib2b2f8aff0052dc32b38486c98670ebff3bd6a4d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126923
Tested-by: Jenkins
Reviewed-by: Justin Luth 
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127000

diff --git a/sw/source/core/docnode/ndtbl1.cxx 
b/sw/source/core/docnode/ndtbl1.cxx
index 964b2cb610f2..d7f3c5419590 100644
--- a/sw/source/core/docnode/ndtbl1.cxx
+++ b/sw/source/core/docnode/ndtbl1.cxx
@@ -928,6 +928,8 @@ void SwDoc::SetTabLineStyle( const SwCursor& rCursor,
 
GetIDocumentUndoRedo().AppendUndo(std::make_unique(*pTableNd));
 }
 
+const SvxBorderLine aHairlineBorder(pColor, SvxBorderLineWidth::Hairline);
+
 for( auto  : aUnions )
 {
 SwSelUnion *pUnion = 
@@ -946,24 +948,32 @@ void SwDoc::SetTabLineStyle( const SwCursor& rCursor,
 SwFrameFormat *pFormat = pCell->GetFormat();
 std::unique_ptr aBox(pFormat->GetBox().Clone());
 
+SvxBorderLine* pTop = const_cast(aBox->GetTop());
+SvxBorderLine* pBot = 
const_cast(aBox->GetBottom());
+SvxBorderLine* pLeft = const_cast(aBox->GetLeft());
+SvxBorderLine* pRight = 
const_cast(aBox->GetRight());
+
 if ( !pBorderLine && bSetLine )
 {
 aBox.reset(::GetDfltAttr(RES_BOX)->Clone());
 }
+else if (pColor && !pBorderLine && !pTop && !pBot && !pLeft && 
!pRight)
+{
+aBox->SetLine(, SvxBoxItemLine::TOP);
+aBox->SetLine(, SvxBoxItemLine::BOTTOM);
+aBox->SetLine(, SvxBoxItemLine::LEFT);
+aBox->SetLine(, SvxBoxItemLine::RIGHT);
+}
 else
 {
-if ( aBox->GetTop() )
-::lcl_SetLineStyle( 
const_cast(aBox->GetTop()),
-pColor, pBorderLine );
-if ( aBox->GetBottom() )
-::lcl_SetLineStyle( 
const_cast(aBox->GetBottom()),
-pColor, pBorderLine );
-if ( aBox->GetLeft() )
-::lcl_SetLineStyle( 
const_cast(aBox->GetLeft()),
-pColor, pBorderLine );
-if ( aBox->GetRight() )
-::lcl_SetLineStyle( 
const_cast(aBox->GetRight()),
-pColor, pBorderLine );
+if (pTop)
+::lcl_SetLineStyle(pTop, pColor, pBorderLine);
+if (pBot)
+::lcl_SetLineStyle(pBot, pColor, pBorderLine);
+if (pLeft)
+::lcl_SetLineStyle(pLeft, pColor, pBorderLine);
+if (pRight)
+::lcl_SetLineStyle(pRight, pColor, pBorderLine);
 }
 pFormat->SetFormatAttr( *aBox );
 }


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

2021-12-20 Thread Justin Luth (via logerrit)
 sw/source/uibase/shells/frmsh.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 68fdfc6013126526f5ba3908c5ad762f18f463cf
Author: Justin Luth 
AuthorDate: Thu Dec 16 11:45:15 2021 +0200
Commit: Xisco Fauli 
CommitDate: Mon Dec 20 14:13:06 2021 +0100

tdf#90805 sw: if no border when adding border color, add hairline

Due to things like tdf#90070 (since LO scales down an image when
adding a border), only make this a hairline border.
Otherwise, a larger default would seem reasonable...

From what I can tell, SID_FRAME_LINECOLOR
in SwFrameShell::ExecFrameStyle affects frames and images
and OLE objects.

Change-Id: Icd72cecb7ebd7fc8b236fb5b8ebd14771399f94d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126910
Tested-by: Justin Luth 
Reviewed-by: Justin Luth 
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126999
Tested-by: Jenkins

diff --git a/sw/source/uibase/shells/frmsh.cxx 
b/sw/source/uibase/shells/frmsh.cxx
index 4463908f4b22..997e40a07da5 100644
--- a/sw/source/uibase/shells/frmsh.cxx
+++ b/sw/source/uibase/shells/frmsh.cxx
@@ -1219,6 +1219,9 @@ void SwFrameShell::ExecFrameStyle(SfxRequest const & rReq)
 !aBoxItem->GetLeft() && !aBoxItem->GetRight())
 {
 aBorderLine.SetColor( rNewColor );
+
aBorderLine.SetBorderLineStyle(SvxBorderLineStyle::SOLID);
+aBorderLine.SetWidth(SvxBorderLineWidth::Hairline);
+
 aBoxItem->SetLine(, SvxBoxItemLine::TOP);
 aBoxItem->SetLine(, 
SvxBoxItemLine::BOTTOM);
 aBoxItem->SetLine(, SvxBoxItemLine::LEFT);


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

2021-12-20 Thread Justin Luth (via logerrit)
 sw/qa/extras/uiwriter/uiwriter3.cxx |   19 +++
 sw/source/core/swg/SwXMLTextBlocks1.cxx |   16 +---
 2 files changed, 32 insertions(+), 3 deletions(-)

New commits:
commit d8cf8482ae5ed72dc969d9adb47c113c442452be
Author: Justin Luth 
AuthorDate: Fri Dec 17 18:45:42 2021 +0200
Commit: Xisco Fauli 
CommitDate: Mon Dec 20 13:54:05 2021 +0100

tdf#144364 sw: Revert "Use FastParser in SwXMLTextBlocks"

This reverts 7.0 commit fd6feb4f538b0c5c9061529ff002be9f62a7239a.
Noel said this was just a performance fix, so just go ahead
and revert it.

It caused the regression documented in bug 144364.

Change-Id: I044c49e42873db120a94d93a00e9b35105778b9c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127012
Tested-by: Jenkins
Reviewed-by: Justin Luth 
(cherry picked from commit 1addd8c104f6ad390bdd0ca61cd5ce97b55ce218)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126982
Reviewed-by: Noel Grandin 
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127147

diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx 
b/sw/qa/extras/uiwriter/uiwriter3.cxx
index 514a13e88ff1..b536692fc5a6 100644
--- a/sw/qa/extras/uiwriter/uiwriter3.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter3.cxx
@@ -1689,6 +1689,25 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf130629)
 CPPUNIT_ASSERT_EQUAL(1, getShapes());
 }
 
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf144364)
+{
+SwDoc* const pDoc = createSwDoc();
+SwWrtShell* const pWrtSh = pDoc->GetDocShell()->GetWrtShell();
+CPPUNIT_ASSERT(pWrtSh);
+
+// expands autotext (via F3)
+pWrtSh->Insert("AR");
+
+SwXTextDocument* pTextDoc = 
dynamic_cast(mxComponent.get());
+pTextDoc->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_F3);
+Scheduler::ProcessEventsToIdle();
+
+// was ...'letter of '
+CPPUNIT_ASSERT_EQUAL(
+OUString("We hereby acknowledge the receipt of your letter of 
."),
+getParagraph(1)->getString());
+}
+
 CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf141613)
 {
 SwDoc* const pDoc = createSwDoc();
diff --git a/sw/source/core/swg/SwXMLTextBlocks1.cxx 
b/sw/source/core/swg/SwXMLTextBlocks1.cxx
index 0297d68fa442..589d4e192097 100644
--- a/sw/source/core/swg/SwXMLTextBlocks1.cxx
+++ b/sw/source/core/swg/SwXMLTextBlocks1.cxx
@@ -31,6 +31,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -194,6 +195,9 @@ ErrCode SwXMLTextBlocks::GetMacroTable( sal_uInt16 nIdx,
 uno::Reference< uno::XComponentContext > xContext =
 comphelper::getProcessComponentContext();
 
+// get parser
+uno::Reference< xml::sax::XParser > xParser = 
xml::sax::Parser::create( xContext );
+
 // create descriptor and reference to it. Either
 // both or neither must be kept because of the
 // reference counting!
@@ -206,15 +210,21 @@ ErrCode SwXMLTextBlocks::GetMacroTable( sal_uInt16 nIdx,
 OUString sFilterComponent = bOasis
 ? 
OUString("com.sun.star.comp.Writer.XMLOasisAutotextEventsImporter")
 : OUString("com.sun.star.comp.Writer.XMLAutotextEventsImporter");
-uno::Reference< xml::sax::XFastParser > xFilter(
+uno::Reference< xml::sax::XDocumentHandler > xFilter(
 
xContext->getServiceManager()->createInstanceWithArgumentsAndContext(
 sFilterComponent, aFilterArguments, xContext),
-UNO_QUERY_THROW );
+UNO_QUERY );
+OSL_ENSURE( xFilter.is(), "can't instantiate autotext-events filter");
+if ( !xFilter.is() )
+return ERR_SWG_READ_ERROR;
+
+// connect parser and filter
+xParser->setDocumentHandler( xFilter );
 
 // parse the stream
 try
 {
-xFilter->parseStream( aParserInput );
+xParser->parseStream( aParserInput );
 }
 catch( xml::sax::SAXParseException& )
 {


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

2021-12-19 Thread Justin Luth (via logerrit)
 sw/qa/extras/uiwriter/uiwriter3.cxx |   19 +++
 sw/source/core/swg/SwXMLTextBlocks1.cxx |   16 +---
 2 files changed, 32 insertions(+), 3 deletions(-)

New commits:
commit 97783676a85ea49aee856b5bd7193a4911856946
Author: Justin Luth 
AuthorDate: Fri Dec 17 18:45:42 2021 +0200
Commit: Noel Grandin 
CommitDate: Mon Dec 20 08:32:24 2021 +0100

tdf#144364 sw: Revert "Use FastParser in SwXMLTextBlocks"

This reverts 7.0 commit fd6feb4f538b0c5c9061529ff002be9f62a7239a.
Noel said this was just a performance fix, so just go ahead
and revert it.

It caused the regression documented in bug 144364.

Change-Id: I044c49e42873db120a94d93a00e9b35105778b9c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127012
Tested-by: Jenkins
Reviewed-by: Justin Luth 
(cherry picked from commit 1addd8c104f6ad390bdd0ca61cd5ce97b55ce218)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126982
Reviewed-by: Noel Grandin 

diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx 
b/sw/qa/extras/uiwriter/uiwriter3.cxx
index 43ef4250aaba..978c61255354 100644
--- a/sw/qa/extras/uiwriter/uiwriter3.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter3.cxx
@@ -1905,6 +1905,25 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf116315)
 }
 }
 
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf144364)
+{
+SwDoc* const pDoc = createSwDoc();
+SwWrtShell* const pWrtSh = pDoc->GetDocShell()->GetWrtShell();
+CPPUNIT_ASSERT(pWrtSh);
+
+// expands autotext (via F3)
+pWrtSh->Insert("AR");
+
+SwXTextDocument* pTextDoc = 
dynamic_cast(mxComponent.get());
+pTextDoc->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_F3);
+Scheduler::ProcessEventsToIdle();
+
+// was ...'letter of '
+CPPUNIT_ASSERT_EQUAL(
+OUString("We hereby acknowledge the receipt of your letter of 
."),
+getParagraph(1)->getString());
+}
+
 CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf141613)
 {
 SwDoc* const pDoc = createSwDoc();
diff --git a/sw/source/core/swg/SwXMLTextBlocks1.cxx 
b/sw/source/core/swg/SwXMLTextBlocks1.cxx
index 9f0c6cb545af..36ff82236c9e 100644
--- a/sw/source/core/swg/SwXMLTextBlocks1.cxx
+++ b/sw/source/core/swg/SwXMLTextBlocks1.cxx
@@ -31,6 +31,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -194,6 +195,9 @@ ErrCode SwXMLTextBlocks::GetMacroTable( sal_uInt16 nIdx,
 uno::Reference< uno::XComponentContext > xContext =
 comphelper::getProcessComponentContext();
 
+// get parser
+uno::Reference< xml::sax::XParser > xParser = 
xml::sax::Parser::create( xContext );
+
 // create descriptor and reference to it. Either
 // both or neither must be kept because of the
 // reference counting!
@@ -205,15 +209,21 @@ ErrCode SwXMLTextBlocks::GetMacroTable( sal_uInt16 nIdx,
 OUString sFilterComponent = bOasis
 ? 
OUString("com.sun.star.comp.Writer.XMLOasisAutotextEventsImporter")
 : OUString("com.sun.star.comp.Writer.XMLAutotextEventsImporter");
-uno::Reference< xml::sax::XFastParser > xFilter(
+uno::Reference< xml::sax::XDocumentHandler > xFilter(
 
xContext->getServiceManager()->createInstanceWithArgumentsAndContext(
 sFilterComponent, aFilterArguments, xContext),
-UNO_QUERY_THROW );
+UNO_QUERY );
+OSL_ENSURE( xFilter.is(), "can't instantiate autotext-events filter");
+if ( !xFilter.is() )
+return ERR_SWG_READ_ERROR;
+
+// connect parser and filter
+xParser->setDocumentHandler( xFilter );
 
 // parse the stream
 try
 {
-xFilter->parseStream( aParserInput );
+xParser->parseStream( aParserInput );
 }
 catch( xml::sax::SAXParseException& )
 {


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

2021-12-17 Thread Justin Luth (via logerrit)
 sw/qa/extras/uiwriter/uiwriter3.cxx |   19 +++
 sw/source/core/swg/SwXMLTextBlocks1.cxx |   16 +---
 2 files changed, 32 insertions(+), 3 deletions(-)

New commits:
commit 1addd8c104f6ad390bdd0ca61cd5ce97b55ce218
Author: Justin Luth 
AuthorDate: Fri Dec 17 18:45:42 2021 +0200
Commit: Justin Luth 
CommitDate: Sat Dec 18 06:46:19 2021 +0100

tdf#144364 sw: Revert "Use FastParser in SwXMLTextBlocks"

This reverts 7.0 commit fd6feb4f538b0c5c9061529ff002be9f62a7239a.
Noel said this was just a performance fix, so just go ahead
and revert it.

It caused the regression documented in bug 144364.

Change-Id: I044c49e42873db120a94d93a00e9b35105778b9c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127012
Tested-by: Jenkins
Reviewed-by: Justin Luth 

diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx 
b/sw/qa/extras/uiwriter/uiwriter3.cxx
index ca37d6ffa53e..3589d4d9f23c 100644
--- a/sw/qa/extras/uiwriter/uiwriter3.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter3.cxx
@@ -1939,6 +1939,25 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf116315)
 }
 }
 
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf144364)
+{
+SwDoc* const pDoc = createSwDoc();
+SwWrtShell* const pWrtSh = pDoc->GetDocShell()->GetWrtShell();
+CPPUNIT_ASSERT(pWrtSh);
+
+// expands autotext (via F3)
+pWrtSh->Insert("AR");
+
+SwXTextDocument* pTextDoc = 
dynamic_cast(mxComponent.get());
+pTextDoc->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_F3);
+Scheduler::ProcessEventsToIdle();
+
+// was ...'letter of '
+CPPUNIT_ASSERT_EQUAL(
+OUString("We hereby acknowledge the receipt of your letter of 
."),
+getParagraph(1)->getString());
+}
+
 CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf141613)
 {
 SwDoc* const pDoc = createSwDoc();
diff --git a/sw/source/core/swg/SwXMLTextBlocks1.cxx 
b/sw/source/core/swg/SwXMLTextBlocks1.cxx
index 9f0c6cb545af..36ff82236c9e 100644
--- a/sw/source/core/swg/SwXMLTextBlocks1.cxx
+++ b/sw/source/core/swg/SwXMLTextBlocks1.cxx
@@ -31,6 +31,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -194,6 +195,9 @@ ErrCode SwXMLTextBlocks::GetMacroTable( sal_uInt16 nIdx,
 uno::Reference< uno::XComponentContext > xContext =
 comphelper::getProcessComponentContext();
 
+// get parser
+uno::Reference< xml::sax::XParser > xParser = 
xml::sax::Parser::create( xContext );
+
 // create descriptor and reference to it. Either
 // both or neither must be kept because of the
 // reference counting!
@@ -205,15 +209,21 @@ ErrCode SwXMLTextBlocks::GetMacroTable( sal_uInt16 nIdx,
 OUString sFilterComponent = bOasis
 ? 
OUString("com.sun.star.comp.Writer.XMLOasisAutotextEventsImporter")
 : OUString("com.sun.star.comp.Writer.XMLAutotextEventsImporter");
-uno::Reference< xml::sax::XFastParser > xFilter(
+uno::Reference< xml::sax::XDocumentHandler > xFilter(
 
xContext->getServiceManager()->createInstanceWithArgumentsAndContext(
 sFilterComponent, aFilterArguments, xContext),
-UNO_QUERY_THROW );
+UNO_QUERY );
+OSL_ENSURE( xFilter.is(), "can't instantiate autotext-events filter");
+if ( !xFilter.is() )
+return ERR_SWG_READ_ERROR;
+
+// connect parser and filter
+xParser->setDocumentHandler( xFilter );
 
 // parse the stream
 try
 {
-xFilter->parseStream( aParserInput );
+xParser->parseStream( aParserInput );
 }
 catch( xml::sax::SAXParseException& )
 {


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

2021-12-17 Thread Justin Luth (via logerrit)
 sc/source/ui/view/output.cxx |5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

New commits:
commit 13814db571b1d08a7f301cd2de3618a387d9dfe4
Author: Justin Luth 
AuthorDate: Fri Dec 17 11:47:55 2021 +0200
Commit: Xisco Fauli 
CommitDate: Fri Dec 17 23:05:12 2021 +0100

tdf#58125 sc: don't show comment notifier for hidden columns

This fixes a LO 3.6-ish regression.

Things have changed a lot since then. I assume that pCell
was empty when it was hidden. The test for pCell was
removed in commit c06dbbe7594c2a0b5a5b19f8e183d9c421e6e094,
which was in the range that bibisect suggested.

Change-Id: I0af137358335a808de90a71f5c113fabcf24
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127001
Reviewed-by: Justin Luth 
Tested-by: Jenkins
(cherry picked from commit b58dbb862296b63f3f2395c59d30fba40fa5f59f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126975
Reviewed-by: Xisco Fauli 

diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx
index d5e5d24464ae..fe6b3c278884 100644
--- a/sc/source/ui/view/output.cxx
+++ b/sc/source/ui/view/output.cxx
@@ -2327,11 +2327,10 @@ void ScOutputData::DrawNoteMarks(vcl::RenderContext& 
rRenderContext)
 SCCOL nMergeX = nX;
 SCROW nMergeY = nY;
 mpDoc->ExtendOverlapped( nMergeX, nMergeY, nX, nY, nTab );
-// use origin's pCell for NotePtr test below
 }
 
-if ( mpDoc->GetNote(nX, pRowInfo[nArrY].nRowNo, nTab) && ( 
bIsMerged ||
-( !pInfo->bHOverlapped && !pInfo->bVOverlapped ) ) )
+if (!mpDoc->ColHidden(nX, nTab) && mpDoc->GetNote(nX, 
pRowInfo[nArrY].nRowNo, nTab)
+&& (bIsMerged || (!pInfo->bHOverlapped && 
!pInfo->bVOverlapped)))
 {
 if (bFirst)
 {


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

2021-12-17 Thread Justin Luth (via logerrit)
 sc/source/ui/view/output.cxx |5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

New commits:
commit b58dbb862296b63f3f2395c59d30fba40fa5f59f
Author: Justin Luth 
AuthorDate: Fri Dec 17 11:47:55 2021 +0200
Commit: Justin Luth 
CommitDate: Fri Dec 17 12:40:23 2021 +0100

tdf#58125 sc: don't show comment notifier for hidden columns

This fixes a LO 3.6-ish regression.

Things have changed a lot since then. I assume that pCell
was empty when it was hidden. The test for pCell was
removed in commit c06dbbe7594c2a0b5a5b19f8e183d9c421e6e094,
which was in the range that bibisect suggested.

Change-Id: I0af137358335a808de90a71f5c113fabcf24
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127001
Reviewed-by: Justin Luth 
Tested-by: Jenkins

diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx
index d5e5d24464ae..fe6b3c278884 100644
--- a/sc/source/ui/view/output.cxx
+++ b/sc/source/ui/view/output.cxx
@@ -2327,11 +2327,10 @@ void ScOutputData::DrawNoteMarks(vcl::RenderContext& 
rRenderContext)
 SCCOL nMergeX = nX;
 SCROW nMergeY = nY;
 mpDoc->ExtendOverlapped( nMergeX, nMergeY, nX, nY, nTab );
-// use origin's pCell for NotePtr test below
 }
 
-if ( mpDoc->GetNote(nX, pRowInfo[nArrY].nRowNo, nTab) && ( 
bIsMerged ||
-( !pInfo->bHOverlapped && !pInfo->bVOverlapped ) ) )
+if (!mpDoc->ColHidden(nX, nTab) && mpDoc->GetNote(nX, 
pRowInfo[nArrY].nRowNo, nTab)
+&& (bIsMerged || (!pInfo->bHOverlapped && 
!pInfo->bVOverlapped)))
 {
 if (bFirst)
 {


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

2021-12-16 Thread Justin Luth (via logerrit)
 sw/source/core/docnode/ndtbl1.cxx |   34 ++
 1 file changed, 22 insertions(+), 12 deletions(-)

New commits:
commit 6ce377a649c8db7576dbb7a30949d0f89c08439f
Author: Justin Luth 
AuthorDate: Thu Dec 16 15:36:59 2021 +0200
Commit: Justin Luth 
CommitDate: Thu Dec 16 16:26:43 2021 +0100

related tdf#90805 sw table: ensure border when setting border color

When using uno:FrameLineColor to set a table's border color,
add hairline borders if there are none at all.

Change-Id: Ib2b2f8aff0052dc32b38486c98670ebff3bd6a4d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126923
Tested-by: Jenkins
Reviewed-by: Justin Luth 

diff --git a/sw/source/core/docnode/ndtbl1.cxx 
b/sw/source/core/docnode/ndtbl1.cxx
index 964b2cb610f2..d7f3c5419590 100644
--- a/sw/source/core/docnode/ndtbl1.cxx
+++ b/sw/source/core/docnode/ndtbl1.cxx
@@ -928,6 +928,8 @@ void SwDoc::SetTabLineStyle( const SwCursor& rCursor,
 
GetIDocumentUndoRedo().AppendUndo(std::make_unique(*pTableNd));
 }
 
+const SvxBorderLine aHairlineBorder(pColor, SvxBorderLineWidth::Hairline);
+
 for( auto  : aUnions )
 {
 SwSelUnion *pUnion = 
@@ -946,24 +948,32 @@ void SwDoc::SetTabLineStyle( const SwCursor& rCursor,
 SwFrameFormat *pFormat = pCell->GetFormat();
 std::unique_ptr aBox(pFormat->GetBox().Clone());
 
+SvxBorderLine* pTop = const_cast(aBox->GetTop());
+SvxBorderLine* pBot = 
const_cast(aBox->GetBottom());
+SvxBorderLine* pLeft = const_cast(aBox->GetLeft());
+SvxBorderLine* pRight = 
const_cast(aBox->GetRight());
+
 if ( !pBorderLine && bSetLine )
 {
 aBox.reset(::GetDfltAttr(RES_BOX)->Clone());
 }
+else if (pColor && !pBorderLine && !pTop && !pBot && !pLeft && 
!pRight)
+{
+aBox->SetLine(, SvxBoxItemLine::TOP);
+aBox->SetLine(, SvxBoxItemLine::BOTTOM);
+aBox->SetLine(, SvxBoxItemLine::LEFT);
+aBox->SetLine(, SvxBoxItemLine::RIGHT);
+}
 else
 {
-if ( aBox->GetTop() )
-::lcl_SetLineStyle( 
const_cast(aBox->GetTop()),
-pColor, pBorderLine );
-if ( aBox->GetBottom() )
-::lcl_SetLineStyle( 
const_cast(aBox->GetBottom()),
-pColor, pBorderLine );
-if ( aBox->GetLeft() )
-::lcl_SetLineStyle( 
const_cast(aBox->GetLeft()),
-pColor, pBorderLine );
-if ( aBox->GetRight() )
-::lcl_SetLineStyle( 
const_cast(aBox->GetRight()),
-pColor, pBorderLine );
+if (pTop)
+::lcl_SetLineStyle(pTop, pColor, pBorderLine);
+if (pBot)
+::lcl_SetLineStyle(pBot, pColor, pBorderLine);
+if (pLeft)
+::lcl_SetLineStyle(pLeft, pColor, pBorderLine);
+if (pRight)
+::lcl_SetLineStyle(pRight, pColor, pBorderLine);
 }
 pFormat->SetFormatAttr( *aBox );
 }


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

2021-12-16 Thread Justin Luth (via logerrit)
 sw/source/uibase/shells/frmsh.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 9f93a26c23ae21324f2389a18512d71d3d610b99
Author: Justin Luth 
AuthorDate: Thu Dec 16 11:45:15 2021 +0200
Commit: Justin Luth 
CommitDate: Thu Dec 16 15:08:14 2021 +0100

tdf#90805 sw: if no border when adding border color, add hairline

Due to things like tdf#90070 (since LO scales down an image when
adding a border), only make this a hairline border.
Otherwise, a larger default would seem reasonable...

From what I can tell, SID_FRAME_LINECOLOR
in SwFrameShell::ExecFrameStyle affects frames and images
and OLE objects.

Change-Id: Icd72cecb7ebd7fc8b236fb5b8ebd14771399f94d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126910
Tested-by: Justin Luth 
Reviewed-by: Justin Luth 

diff --git a/sw/source/uibase/shells/frmsh.cxx 
b/sw/source/uibase/shells/frmsh.cxx
index 4463908f4b22..997e40a07da5 100644
--- a/sw/source/uibase/shells/frmsh.cxx
+++ b/sw/source/uibase/shells/frmsh.cxx
@@ -1219,6 +1219,9 @@ void SwFrameShell::ExecFrameStyle(SfxRequest const & rReq)
 !aBoxItem->GetLeft() && !aBoxItem->GetRight())
 {
 aBorderLine.SetColor( rNewColor );
+
aBorderLine.SetBorderLineStyle(SvxBorderLineStyle::SOLID);
+aBorderLine.SetWidth(SvxBorderLineWidth::Hairline);
+
 aBoxItem->SetLine(, SvxBoxItemLine::TOP);
 aBoxItem->SetLine(, 
SvxBoxItemLine::BOTTOM);
 aBoxItem->SetLine(, SvxBoxItemLine::LEFT);


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

2021-12-14 Thread Justin Luth (via logerrit)
 xmloff/qa/unit/text.cxx  |2 +-
 xmloff/source/style/styleexp.cxx |3 ++-
 xmloff/source/text/txtstyli.cxx  |5 +++--
 3 files changed, 6 insertions(+), 4 deletions(-)

New commits:
commit fda607397997df511dab3b340ca6f6da42f5c5bd
Author: Justin Luth 
AuthorDate: Mon Dec 13 17:42:00 2021 +0200
Commit: Justin Luth 
CommitDate: Tue Dec 14 11:47:43 2021 +0100

tdf#62032 xmloff: list-level is positiveInteger, impl is 0-based

Thanks for catching this Regina.

Change-Id: Iaf6a0c9161378934818e392126a4437e55f5ddf8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126743
Reviewed-by: Justin Luth 
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins
(cherry picked from commit aed4c2d80c2f11b82631c097ed0b15a5cb52283d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126812

diff --git a/xmloff/qa/unit/text.cxx b/xmloff/qa/unit/text.cxx
index 78ebaf75e1bc..9ac9ac93dbc4 100644
--- a/xmloff/qa/unit/text.cxx
+++ b/xmloff/qa/unit/text.cxx
@@ -191,7 +191,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, 
testParaStyleListLevel)
 uno::Reference 
xStyle(xStyleFamily->getByName("mystyle"), uno::UNO_QUERY);
 sal_Int16 nNumberingLevel{};
 CPPUNIT_ASSERT(xStyle->getPropertyValue("NumberingLevel") >>= 
nNumberingLevel);
-CPPUNIT_ASSERT_EQUAL(static_cast(2), nNumberingLevel);
+CPPUNIT_ASSERT_EQUAL(static_cast(1), nNumberingLevel);
 
 // Test the export as well:
 
diff --git a/xmloff/source/style/styleexp.cxx b/xmloff/source/style/styleexp.cxx
index 1a3a81f10c95..10ae6a22dcfa 100644
--- a/xmloff/source/style/styleexp.cxx
+++ b/xmloff/source/style/styleexp.cxx
@@ -147,7 +147,8 @@ void ExportStyleListlevel(const 
uno::Reference& xPropSe
 return;
 }
 
-rExport.AddAttribute(XML_NAMESPACE_STYLE, XML_LIST_LEVEL, 
OUString::number(nNumberingLevel));
+// The spec is positiveInteger (1-based), but the implementation is 
0-based.
+rExport.AddAttribute(XML_NAMESPACE_STYLE, XML_LIST_LEVEL, 
OUString::number(++nNumberingLevel));
 }
 }
 
diff --git a/xmloff/source/text/txtstyli.cxx b/xmloff/source/text/txtstyli.cxx
index bcd55b140868..85db00df1901 100644
--- a/xmloff/source/text/txtstyli.cxx
+++ b/xmloff/source/text/txtstyli.cxx
@@ -118,9 +118,10 @@ void XMLTextStyleContext::SetAttribute( sal_Int32 nElement,
 case XML_ELEMENT(STYLE, XML_LIST_LEVEL):
 {
 sal_Int32 nTmp;
-if (sax::Converter::convertNumber(nTmp, rValue) && nTmp >= 0 && 
nTmp <= 10)
+// The spec is positiveInteger (1-based), but the implementation 
is 0-based.
+if (sax::Converter::convertNumber(nTmp, rValue) && nTmp > 0 && 
nTmp <= 10)
 {
-m_aListLevel.emplace(nTmp);
+m_aListLevel.emplace(--nTmp);
 }
 break;
 }


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

2021-12-14 Thread Justin Luth (via logerrit)
 xmloff/qa/unit/text.cxx  |2 +-
 xmloff/source/style/styleexp.cxx |3 ++-
 xmloff/source/text/txtstyli.cxx  |5 +++--
 3 files changed, 6 insertions(+), 4 deletions(-)

New commits:
commit aed4c2d80c2f11b82631c097ed0b15a5cb52283d
Author: Justin Luth 
AuthorDate: Mon Dec 13 17:42:00 2021 +0200
Commit: Miklos Vajna 
CommitDate: Tue Dec 14 10:36:48 2021 +0100

tdf#62032 xmloff: list-level is positiveInteger, impl is 0-based

Thanks for catching this Regina.

Change-Id: Iaf6a0c9161378934818e392126a4437e55f5ddf8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126743
Reviewed-by: Justin Luth 
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins

diff --git a/xmloff/qa/unit/text.cxx b/xmloff/qa/unit/text.cxx
index 78ebaf75e1bc..9ac9ac93dbc4 100644
--- a/xmloff/qa/unit/text.cxx
+++ b/xmloff/qa/unit/text.cxx
@@ -191,7 +191,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, 
testParaStyleListLevel)
 uno::Reference 
xStyle(xStyleFamily->getByName("mystyle"), uno::UNO_QUERY);
 sal_Int16 nNumberingLevel{};
 CPPUNIT_ASSERT(xStyle->getPropertyValue("NumberingLevel") >>= 
nNumberingLevel);
-CPPUNIT_ASSERT_EQUAL(static_cast(2), nNumberingLevel);
+CPPUNIT_ASSERT_EQUAL(static_cast(1), nNumberingLevel);
 
 // Test the export as well:
 
diff --git a/xmloff/source/style/styleexp.cxx b/xmloff/source/style/styleexp.cxx
index 1a3a81f10c95..10ae6a22dcfa 100644
--- a/xmloff/source/style/styleexp.cxx
+++ b/xmloff/source/style/styleexp.cxx
@@ -147,7 +147,8 @@ void ExportStyleListlevel(const 
uno::Reference& xPropSe
 return;
 }
 
-rExport.AddAttribute(XML_NAMESPACE_STYLE, XML_LIST_LEVEL, 
OUString::number(nNumberingLevel));
+// The spec is positiveInteger (1-based), but the implementation is 
0-based.
+rExport.AddAttribute(XML_NAMESPACE_STYLE, XML_LIST_LEVEL, 
OUString::number(++nNumberingLevel));
 }
 }
 
diff --git a/xmloff/source/text/txtstyli.cxx b/xmloff/source/text/txtstyli.cxx
index bcd55b140868..85db00df1901 100644
--- a/xmloff/source/text/txtstyli.cxx
+++ b/xmloff/source/text/txtstyli.cxx
@@ -118,9 +118,10 @@ void XMLTextStyleContext::SetAttribute( sal_Int32 nElement,
 case XML_ELEMENT(STYLE, XML_LIST_LEVEL):
 {
 sal_Int32 nTmp;
-if (sax::Converter::convertNumber(nTmp, rValue) && nTmp >= 0 && 
nTmp <= 10)
+// The spec is positiveInteger (1-based), but the implementation 
is 0-based.
+if (sax::Converter::convertNumber(nTmp, rValue) && nTmp > 0 && 
nTmp <= 10)
 {
-m_aListLevel.emplace(nTmp);
+m_aListLevel.emplace(--nTmp);
 }
 break;
 }


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

2021-12-13 Thread Justin Luth (via logerrit)
 sc/source/ui/app/inputhdl.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 42be5b7c75b2d50b93e110b0cd906a48b3bb0e26
Author: Justin Luth 
AuthorDate: Mon Dec 13 11:21:21 2021 +0200
Commit: Eike Rathke 
CommitDate: Mon Dec 13 23:30:18 2021 +0100

related tdf#92010 sc autoformula: ensure proper sorting order

When typing "=a", autoformula was suggesting
ACCRINT,ACCRINTM,ACOS instead of starting with ABS.
[This has been true since these 3 suggestions started in LO 5.2.]

Prior to this patch, the very first item in the sorted list
(ABS) was placed at the end of the suggestion vector.
That is because the loop immediately increments.
Since the given initialization value is end(),
it set begin() as the starting loop value and then
immediately incremented to item 2.
Item 1 was finally evaluated last, putting ABS after ZTEST.

The backwards loop handled this properly,
so do the same thing for the forward loop.

Change-Id: I539c749ea43140a1480d74471787bc886dda671e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126723
Tested-by: Jenkins
Reviewed-by: Justin Luth 
Reviewed-by: Eike Rathke 
(cherry picked from commit b2fb1631ab5b3c1d9d09aefa0d3a81307e7ffa35)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126750

diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 307f0f7a6886..8b4d8bde90b3 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -258,7 +258,7 @@ ScTypedCaseStrSet::const_iterator findTextAll(
 ScTypedCaseStrSet::const_iterator it, itEnd;
 it = itPos;
 if ( it == rDataSet.end() )
-it = rDataSet.begin();
+it = --rDataSet.end();
 itEnd = it;
 bool bFirstTime = true;
 


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

2021-12-13 Thread Justin Luth (via logerrit)
 sc/inc/typedstrdata.hxx   |   11 ++-
 sc/source/ui/app/inputhdl.cxx |   23 +++
 2 files changed, 29 insertions(+), 5 deletions(-)

New commits:
commit a141f91037f9cf29822a369261f9e99db964
Author: Justin Luth 
AuthorDate: Tue Dec 7 07:42:52 2021 +0200
Commit: Eike Rathke 
CommitDate: Mon Dec 13 23:29:58 2021 +0100

tdf#92010 sc autoFormula: prefer MRU formulas

Prior to 4.3, only MRU formulas were auto-completed.
Then it changed to suggest all formulas - alphabetically
for the most part.

That 4.3 commit 5b0b7553241bb5150b12bbf7625b4b0b36970272
completely removed all reference to MRU.
But it makes sense to prefer an MRU over a strictly
alphabetical match.

This patch depends on LO 7.4 patch
"new ScTypedStrData: typically missed argument in CTOR"

Change-Id: Id5d860d1401693f43833719977d1c1e4c386385c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126499
Tested-by: Jenkins
Reviewed-by: Justin Luth 
Reviewed-by: Eike Rathke 
(cherry picked from commit b93a6964e0466c1b67d2c233040357a8f6c75214)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126749

diff --git a/sc/inc/typedstrdata.hxx b/sc/inc/typedstrdata.hxx
index 7c7b1c7e45d4..c1a3738ce7fe 100644
--- a/sc/inc/typedstrdata.hxx
+++ b/sc/inc/typedstrdata.hxx
@@ -17,11 +17,12 @@ class ScTypedStrData
 {
 public:
 enum StringType {
-Value= 0,
-Standard = 1,
-Name = 2,
-DbName   = 3,
-Header   = 4
+Value,
+MRU,
+Standard,
+Name,
+DbName,
+Header
 };
 
 ScTypedStrData( const OUString& rStr, double fVal = 0.0, double fRVal = 
0.0, StringType eType = Standard,
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index b9ee0d62d02b..307f0f7a6886 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -1048,6 +1048,29 @@ void ScInputHandler::GetFormulaData()
 pFormulaDataPara->insert(ScTypedStrData(aEntry, 0.0, 0.0, 
ScTypedStrData::Standard));
 }
 }
+
+// Increase suggestion priority of MRU formulas
+const ScAppOptions& rOpt = SC_MOD()->GetAppOptions();
+const sal_uInt16 nMRUCount = rOpt.GetLRUFuncListCount();
+const sal_uInt16* pMRUList = rOpt.GetLRUFuncList();
+for (sal_uInt16 i = 0; i < nMRUCount; i++)
+{
+const sal_uInt16 nId = pMRUList[i];
+for (sal_uInt32 j = 0; j < nListCount; j++)
+{
+const ScFuncDesc* pDesc = pFuncList->GetFunction(j);
+if (pDesc->nFIndex == nId && pDesc->mxFuncName)
+{
+const OUString aEntry = *pDesc->mxFuncName + 
aParenthesesReplacement;;
+const ScTypedStrData aData(aEntry, 0.0, 0.0, 
ScTypedStrData::Standard);
+auto it = pFormulaData->find(aData);
+if (it != pFormulaData->end())
+pFormulaData->erase(it);
+pFormulaData->insert(ScTypedStrData(aEntry, 0.0, 0.0, 
ScTypedStrData::MRU));
+break; // Stop searching
+}
+}
+}
 miAutoPosFormula = pFormulaData->end();
 rDoc.GetFormulaEntries( *pFormulaData );
 rDoc.GetFormulaEntries( *pFormulaDataPara );


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

2021-12-13 Thread Justin Luth (via logerrit)
 sc/source/ui/app/inputhdl.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit b2fb1631ab5b3c1d9d09aefa0d3a81307e7ffa35
Author: Justin Luth 
AuthorDate: Mon Dec 13 11:21:21 2021 +0200
Commit: Eike Rathke 
CommitDate: Mon Dec 13 22:18:42 2021 +0100

related tdf#92010 sc autoformula: ensure proper sorting order

When typing "=a", autoformula was suggesting
ACCRINT,ACCRINTM,ACOS instead of starting with ABS.
[This has been true since these 3 suggestions started in LO 5.2.]

Prior to this patch, the very first item in the sorted list
(ABS) was placed at the end of the suggestion vector.
That is because the loop immediately increments.
Since the given initialization value is end(),
it set begin() as the starting loop value and then
immediately incremented to item 2.
Item 1 was finally evaluated last, putting ABS after ZTEST.

The backwards loop handled this properly,
so do the same thing for the forward loop.

Change-Id: I539c749ea43140a1480d74471787bc886dda671e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126723
Tested-by: Jenkins
Reviewed-by: Justin Luth 
Reviewed-by: Eike Rathke 

diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index f05f52fa90bd..1abff527b363 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -255,7 +255,7 @@ ScTypedCaseStrSet::const_iterator findTextAll(
 ScTypedCaseStrSet::const_iterator it, itEnd;
 it = itPos;
 if ( it == rDataSet.end() )
-it = rDataSet.begin();
+it = --rDataSet.end();
 itEnd = it;
 bool bFirstTime = true;
 


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

2021-12-13 Thread Justin Luth (via logerrit)
 sc/inc/typedstrdata.hxx   |   11 ++-
 sc/source/ui/app/inputhdl.cxx |   23 +++
 2 files changed, 29 insertions(+), 5 deletions(-)

New commits:
commit b93a6964e0466c1b67d2c233040357a8f6c75214
Author: Justin Luth 
AuthorDate: Tue Dec 7 07:42:52 2021 +0200
Commit: Eike Rathke 
CommitDate: Mon Dec 13 22:18:06 2021 +0100

tdf#92010 sc autoFormula: prefer MRU formulas

Prior to 4.3, only MRU formulas were auto-completed.
Then it changed to suggest all formulas - alphabetically
for the most part.

That 4.3 commit 5b0b7553241bb5150b12bbf7625b4b0b36970272
completely removed all reference to MRU.
But it makes sense to prefer an MRU over a strictly
alphabetical match.

This patch depends on LO 7.4 patch
"new ScTypedStrData: typically missed argument in CTOR"

Change-Id: Id5d860d1401693f43833719977d1c1e4c386385c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126499
Tested-by: Jenkins
Reviewed-by: Justin Luth 
Reviewed-by: Eike Rathke 

diff --git a/sc/inc/typedstrdata.hxx b/sc/inc/typedstrdata.hxx
index 7c7b1c7e45d4..c1a3738ce7fe 100644
--- a/sc/inc/typedstrdata.hxx
+++ b/sc/inc/typedstrdata.hxx
@@ -17,11 +17,12 @@ class ScTypedStrData
 {
 public:
 enum StringType {
-Value= 0,
-Standard = 1,
-Name = 2,
-DbName   = 3,
-Header   = 4
+Value,
+MRU,
+Standard,
+Name,
+DbName,
+Header
 };
 
 ScTypedStrData( const OUString& rStr, double fVal = 0.0, double fRVal = 
0.0, StringType eType = Standard,
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 24d99a658e48..f05f52fa90bd 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -1039,6 +1039,29 @@ void ScInputHandler::GetFormulaData()
 pFormulaDataPara->insert(ScTypedStrData(aEntry, 0.0, 0.0, 
ScTypedStrData::Standard));
 }
 }
+
+// Increase suggestion priority of MRU formulas
+const ScAppOptions& rOpt = SC_MOD()->GetAppOptions();
+const sal_uInt16 nMRUCount = rOpt.GetLRUFuncListCount();
+const sal_uInt16* pMRUList = rOpt.GetLRUFuncList();
+for (sal_uInt16 i = 0; i < nMRUCount; i++)
+{
+const sal_uInt16 nId = pMRUList[i];
+for (sal_uInt32 j = 0; j < nListCount; j++)
+{
+const ScFuncDesc* pDesc = pFuncList->GetFunction(j);
+if (pDesc->nFIndex == nId && pDesc->mxFuncName)
+{
+const OUString aEntry = *pDesc->mxFuncName + 
aParenthesesReplacement;;
+const ScTypedStrData aData(aEntry, 0.0, 0.0, 
ScTypedStrData::Standard);
+auto it = pFormulaData->find(aData);
+if (it != pFormulaData->end())
+pFormulaData->erase(it);
+pFormulaData->insert(ScTypedStrData(aEntry, 0.0, 0.0, 
ScTypedStrData::MRU));
+break; // Stop searching
+}
+}
+}
 miAutoPosFormula = pFormulaData->end();
 rDoc.GetFormulaEntries( *pFormulaData );
 rDoc.GetFormulaEntries( *pFormulaDataPara );


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

2021-12-13 Thread Justin Luth (via logerrit)
 sc/source/ui/view/tabview3.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 6a7daa7ece8442e70351eea071bddbe0d24803de
Author: Justin Luth 
AuthorDate: Mon Dec 13 13:59:11 2021 +0200
Commit: Justin Luth 
CommitDate: Mon Dec 13 17:11:40 2021 +0100

NFC simplify sc: !(!A() const || B)  is  !B && A()

Not new AND Is the same tab
is much easier to wrap your mind around than
Not (Not the same tab OR New)

Plus it allows avoiding a (trivial) const function call.

Change-Id: Ie0d8a1e490fc3dffe6fc87c9b4d9bd1c41d34dc8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126733
Tested-by: Jenkins
Reviewed-by: Justin Luth 

diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index a500d5fe03ab..d1543b22cfe6 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -1803,7 +1803,7 @@ void ScTabView::SetTabNo( SCTAB nTab, bool bNew, bool 
bExtendSelection, bool bSa
 return;
 }
 
-if ( !(nTab != aViewData.GetTabNo() || bNew) )
+if (!bNew && nTab == aViewData.GetTabNo())
 return;
 
 // FormShell would like to be informed before the switch


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

2021-12-13 Thread Justin Luth (via logerrit)
 sc/qa/unit/data/ods/tdf128895_emptyHiddenCols.ods |binary
 sc/qa/unit/subsequent_export-test.cxx |   18 ++
 sc/source/filter/xml/xmlcoli.cxx  |1 +
 3 files changed, 19 insertions(+)

New commits:
commit 5e76c14d20799a2cbecdccc2e8b71961a0696f15
Author: Justin Luth 
AuthorDate: Wed Dec 8 14:22:01 2021 +0200
Commit: Xisco Fauli 
CommitDate: Mon Dec 13 16:00:52 2021 +0100

tdf#128895 sc xmlimport: create enough dynamic cols if props

Since LO 6.3, only 64 columns are created by default,
where previously it was a fixed 1024.

A common user practice is to hide all columns not used,
but this collapsed property was lost because
only part of the columns were actually created and thus exported.

In this example, import specifies 1017 hidden columns (H-AMJ),
but since only 64 columns are created, export only specified 57.

So ensure that on import, any column with defined properties
is created - even if they don't contain any content.

Change-Id: If928880baf5585613715a1f4361a9059584d1ad2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126540
Tested-by: Jenkins
Reviewed-by: Justin Luth 
Reviewed-by: Bartosz Kosiorek 
(cherry picked from commit 297ab561c6754f89326a1e8ce1751233669578d7)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126668
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126728

diff --git a/sc/qa/unit/data/ods/tdf128895_emptyHiddenCols.ods 
b/sc/qa/unit/data/ods/tdf128895_emptyHiddenCols.ods
new file mode 100644
index ..fa016369f206
Binary files /dev/null and b/sc/qa/unit/data/ods/tdf128895_emptyHiddenCols.ods 
differ
diff --git a/sc/qa/unit/subsequent_export-test.cxx 
b/sc/qa/unit/subsequent_export-test.cxx
index 31c0aae3dd71..431a03ebca65 100644
--- a/sc/qa/unit/subsequent_export-test.cxx
+++ b/sc/qa/unit/subsequent_export-test.cxx
@@ -142,6 +142,7 @@ public:
 #endif
 void testOutlineExportXLSX();
 void testHiddenEmptyRowsXLSX();
+void testHiddenEmptyColsODS();
 void testAllRowsHiddenXLSX();
 void testLandscapeOrientationXLSX();
 
@@ -258,6 +259,7 @@ public:
 #endif
 CPPUNIT_TEST(testOutlineExportXLSX);
 CPPUNIT_TEST(testHiddenEmptyRowsXLSX);
+CPPUNIT_TEST(testHiddenEmptyColsODS);
 CPPUNIT_TEST(testAllRowsHiddenXLSX);
 CPPUNIT_TEST(testLandscapeOrientationXLSX);
 CPPUNIT_TEST(testInlineArrayXLS);
@@ -1411,6 +1413,22 @@ void ScExportTest::testHiddenEmptyRowsXLSX()
 xShell->DoClose();
 }
 
+void ScExportTest::testHiddenEmptyColsODS()
+{
+//tdf#98106 FILESAVE: Hidden and empty rows became visible when export to 
.XLSX
+ScDocShellRef xShell = loadDoc(u"tdf128895_emptyHiddenCols.", FORMAT_ODS);
+CPPUNIT_ASSERT(xShell.is());
+
+std::shared_ptr pXPathFile
+= ScBootstrapFixture::exportTo(&(*xShell), FORMAT_ODS);
+xmlDocUniquePtr pSheet = XPathHelper::parseExport(pXPathFile, m_xSFactory, 
"content.xml");
+CPPUNIT_ASSERT(pSheet);
+assertXPath(pSheet, "//table:table/table:table-column[2]");
+assertXPath(pSheet, "//table:table/table:table-column[2]", 
"number-columns-repeated", "1017");
+
+xShell->DoClose();
+}
+
 void ScExportTest::testLandscapeOrientationXLSX()
 {
 //tdf#48767 - Landscape page orientation is not loaded from .xlsx format 
with MS Excel, after export with Libre Office
diff --git a/sc/source/filter/xml/xmlcoli.cxx b/sc/source/filter/xml/xmlcoli.cxx
index 8bec39546541..0e4af7bb9a9a 100644
--- a/sc/source/filter/xml/xmlcoli.cxx
+++ b/sc/source/filter/xml/xmlcoli.cxx
@@ -93,6 +93,7 @@ void SAL_CALL ScXMLTableColContext::endFastElement( sal_Int32 
/*nElement*/ )
 nLastColumn = pDoc->MaxCol();
 if (nCurrentColumn > pDoc->MaxCol())
 nCurrentColumn = pDoc->MaxCol();
+pDoc->CreateColumnIfNotExists(nSheet, nLastColumn);
 uno::Reference xColumnRowRange 
(xSheet->getCellRangeByPosition(nCurrentColumn, 0, nLastColumn, 0), 
uno::UNO_QUERY);
 if (xColumnRowRange.is())
 {


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

2021-12-13 Thread Justin Luth (via logerrit)
 sc/source/ui/miscdlgs/anyrefdg.cxx |   22 ++
 1 file changed, 22 insertions(+)

New commits:
commit 62600f404b5fbecee3958d15722388e5ab49a71e
Author: Justin Luth 
AuthorDate: Tue Dec 7 15:19:45 2021 +0200
Commit: Xisco Fauli 
CommitDate: Mon Dec 13 15:58:14 2021 +0100

tdf#121699 sc: wrap LOKit stuff with isActive

This is a partial revert of LO 6.1
commit 009d2756b1678477ec23d5647bd5004c4bff3a62.

It is one thing to change code that you don't really
know why it is setup that way, but it is another thing
to ignore the resulting regression reports for 3 years.
Not impressed.

It look me only 1 hour to work through this,
and this is completely outside of my normal
line of programming.

Change-Id: I8671677f38cc1332c6c5a76847801e2680097048
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126500
Tested-by: Jenkins
Reviewed-by: Henry Castro 
Reviewed-by: Justin Luth 
(cherry picked from commit a99aea61c3199dc8188d4d873a10201082dff2e2)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126686
Reviewed-by: Xisco Fauli 

diff --git a/sc/source/ui/miscdlgs/anyrefdg.cxx 
b/sc/source/ui/miscdlgs/anyrefdg.cxx
index 7e310d12cb45..20b2d7318df4 100644
--- a/sc/source/ui/miscdlgs/anyrefdg.cxx
+++ b/sc/source/ui/miscdlgs/anyrefdg.cxx
@@ -458,6 +458,28 @@ void ScFormulaReferenceHelper::DoClose( sal_uInt16 nId )
 
 void ScFormulaReferenceHelper::SetDispatcherLock( bool bLock )
 {
+if (!comphelper::LibreOfficeKit::isActive())
+{
+// lock / unlock only the dispatchers of Calc documents
+ScDocShell* pDocShell = 
static_cast(SfxObjectShell::GetFirst(checkSfxObjectShell));
+while (pDocShell)
+{
+SfxViewFrame* pFrame = SfxViewFrame::GetFirst(pDocShell);
+while (pFrame)
+{
+SfxDispatcher* pDisp = pFrame->GetDispatcher();
+if (pDisp)
+pDisp->Lock(bLock);
+pFrame = SfxViewFrame::GetNext(*pFrame, pDocShell);
+}
+pDocShell = 
static_cast(SfxObjectShell::GetNext(*pDocShell, 
checkSfxObjectShell));
+}
+return;
+// if a new view is created while the dialog is open,
+// that view's dispatcher is locked when trying to create the dialog
+// for that view (ScTabViewShell::CreateRefDialog)
+}
+
 //  lock / unlock only the dispatcher of Calc document
 SfxDispatcher* pDisp = nullptr;
 if ( m_pBindings )


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

2021-12-11 Thread Justin Luth (via logerrit)
 sc/qa/unit/data/ods/tdf128895_emptyHiddenCols.ods |binary
 sc/qa/unit/subsequent_export_test.cxx |   18 ++
 sc/source/filter/xml/xmlcoli.cxx  |1 +
 3 files changed, 19 insertions(+)

New commits:
commit ea229b09c3de7edb8fcb01a727b656f4d35821d4
Author: Justin Luth 
AuthorDate: Wed Dec 8 14:22:01 2021 +0200
Commit: Justin Luth 
CommitDate: Sat Dec 11 16:56:17 2021 +0100

tdf#128895 sc xmlimport: create enough dynamic cols if props

Since LO 6.3, only 64 columns are created by default,
where previously it was a fixed 1024.

A common user practice is to hide all columns not used,
but this collapsed property was lost because
only part of the columns were actually created and thus exported.

In this example, import specifies 1017 hidden columns (H-AMJ),
but since only 64 columns are created, export only specified 57.

So ensure that on import, any column with defined properties
is created - even if they don't contain any content.

Change-Id: If928880baf5585613715a1f4361a9059584d1ad2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126540
Tested-by: Jenkins
Reviewed-by: Justin Luth 
Reviewed-by: Bartosz Kosiorek 
(cherry picked from commit 297ab561c6754f89326a1e8ce1751233669578d7)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126668

diff --git a/sc/qa/unit/data/ods/tdf128895_emptyHiddenCols.ods 
b/sc/qa/unit/data/ods/tdf128895_emptyHiddenCols.ods
new file mode 100644
index ..fa016369f206
Binary files /dev/null and b/sc/qa/unit/data/ods/tdf128895_emptyHiddenCols.ods 
differ
diff --git a/sc/qa/unit/subsequent_export_test.cxx 
b/sc/qa/unit/subsequent_export_test.cxx
index 8fbe40a10ac9..32f94549325b 100644
--- a/sc/qa/unit/subsequent_export_test.cxx
+++ b/sc/qa/unit/subsequent_export_test.cxx
@@ -143,6 +143,7 @@ public:
 #endif
 void testOutlineExportXLSX();
 void testHiddenEmptyRowsXLSX();
+void testHiddenEmptyColsODS();
 void testAllRowsHiddenXLSX();
 void testLandscapeOrientationXLSX();
 
@@ -259,6 +260,7 @@ public:
 #endif
 CPPUNIT_TEST(testOutlineExportXLSX);
 CPPUNIT_TEST(testHiddenEmptyRowsXLSX);
+CPPUNIT_TEST(testHiddenEmptyColsODS);
 CPPUNIT_TEST(testAllRowsHiddenXLSX);
 CPPUNIT_TEST(testLandscapeOrientationXLSX);
 CPPUNIT_TEST(testInlineArrayXLS);
@@ -1525,6 +1527,22 @@ void ScExportTest::testHiddenEmptyRowsXLSX()
 xShell->DoClose();
 }
 
+void ScExportTest::testHiddenEmptyColsODS()
+{
+//tdf#98106 FILESAVE: Hidden and empty rows became visible when export to 
.XLSX
+ScDocShellRef xShell = loadDoc(u"tdf128895_emptyHiddenCols.", FORMAT_ODS);
+CPPUNIT_ASSERT(xShell.is());
+
+std::shared_ptr pXPathFile
+= ScBootstrapFixture::exportTo(&(*xShell), FORMAT_ODS);
+xmlDocUniquePtr pSheet = XPathHelper::parseExport(pXPathFile, m_xSFactory, 
"content.xml");
+CPPUNIT_ASSERT(pSheet);
+assertXPath(pSheet, "//table:table/table:table-column[2]");
+assertXPath(pSheet, "//table:table/table:table-column[2]", 
"number-columns-repeated", "1017");
+
+xShell->DoClose();
+}
+
 void ScExportTest::testLandscapeOrientationXLSX()
 {
 //tdf#48767 - Landscape page orientation is not loaded from .xlsx format 
with MS Excel, after export with Libre Office
diff --git a/sc/source/filter/xml/xmlcoli.cxx b/sc/source/filter/xml/xmlcoli.cxx
index 09224bb757a3..fc40a6f63c6b 100644
--- a/sc/source/filter/xml/xmlcoli.cxx
+++ b/sc/source/filter/xml/xmlcoli.cxx
@@ -93,6 +93,7 @@ void SAL_CALL ScXMLTableColContext::endFastElement( sal_Int32 
/*nElement*/ )
 nLastColumn = pDoc->MaxCol();
 if (nCurrentColumn > pDoc->MaxCol())
 nCurrentColumn = pDoc->MaxCol();
+pDoc->CreateColumnIfNotExists(nSheet, nLastColumn);
 uno::Reference xColumnRowRange 
(xSheet->getCellRangeByPosition(nCurrentColumn, 0, nLastColumn, 0), 
uno::UNO_QUERY);
 if (xColumnRowRange.is())
 {


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

2021-12-10 Thread Justin Luth (via logerrit)
 sc/qa/unit/data/ods/tdf128895_emptyHiddenCols.ods |binary
 sc/qa/unit/subsequent_export_test.cxx |   18 ++
 sc/source/filter/xml/xmlcoli.cxx  |1 +
 3 files changed, 19 insertions(+)

New commits:
commit 297ab561c6754f89326a1e8ce1751233669578d7
Author: Justin Luth 
AuthorDate: Wed Dec 8 14:22:01 2021 +0200
Commit: Justin Luth 
CommitDate: Sat Dec 11 07:20:35 2021 +0100

tdf#128895 sc xmlimport: create enough dynamic cols if props

Since LO 6.3, only 64 columns are created by default,
where previously it was a fixed 1024.

A common user practice is to hide all columns not used,
but this collapsed property was lost because
only part of the columns were actually created and thus exported.

In this example, import specifies 1017 hidden columns (H-AMJ),
but since only 64 columns are created, export only specified 57.

So ensure that on import, any column with defined properties
is created - even if they don't contain any content.

Change-Id: If928880baf5585613715a1f4361a9059584d1ad2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126540
Tested-by: Jenkins
Reviewed-by: Justin Luth 
Reviewed-by: Bartosz Kosiorek 

diff --git a/sc/qa/unit/data/ods/tdf128895_emptyHiddenCols.ods 
b/sc/qa/unit/data/ods/tdf128895_emptyHiddenCols.ods
new file mode 100644
index ..fa016369f206
Binary files /dev/null and b/sc/qa/unit/data/ods/tdf128895_emptyHiddenCols.ods 
differ
diff --git a/sc/qa/unit/subsequent_export_test.cxx 
b/sc/qa/unit/subsequent_export_test.cxx
index 355fdf4202ad..158323215660 100644
--- a/sc/qa/unit/subsequent_export_test.cxx
+++ b/sc/qa/unit/subsequent_export_test.cxx
@@ -143,6 +143,7 @@ public:
 #endif
 void testOutlineExportXLSX();
 void testHiddenEmptyRowsXLSX();
+void testHiddenEmptyColsODS();
 void testAllRowsHiddenXLSX();
 void testLandscapeOrientationXLSX();
 
@@ -259,6 +260,7 @@ public:
 #endif
 CPPUNIT_TEST(testOutlineExportXLSX);
 CPPUNIT_TEST(testHiddenEmptyRowsXLSX);
+CPPUNIT_TEST(testHiddenEmptyColsODS);
 CPPUNIT_TEST(testAllRowsHiddenXLSX);
 CPPUNIT_TEST(testLandscapeOrientationXLSX);
 CPPUNIT_TEST(testInlineArrayXLS);
@@ -1525,6 +1527,22 @@ void ScExportTest::testHiddenEmptyRowsXLSX()
 xShell->DoClose();
 }
 
+void ScExportTest::testHiddenEmptyColsODS()
+{
+//tdf#98106 FILESAVE: Hidden and empty rows became visible when export to 
.XLSX
+ScDocShellRef xShell = loadDoc(u"tdf128895_emptyHiddenCols.", FORMAT_ODS);
+CPPUNIT_ASSERT(xShell.is());
+
+std::shared_ptr pXPathFile
+= ScBootstrapFixture::exportTo(&(*xShell), FORMAT_ODS);
+xmlDocUniquePtr pSheet = XPathHelper::parseExport(pXPathFile, m_xSFactory, 
"content.xml");
+CPPUNIT_ASSERT(pSheet);
+assertXPath(pSheet, "//table:table/table:table-column[2]");
+assertXPath(pSheet, "//table:table/table:table-column[2]", 
"number-columns-repeated", "1017");
+
+xShell->DoClose();
+}
+
 void ScExportTest::testLandscapeOrientationXLSX()
 {
 //tdf#48767 - Landscape page orientation is not loaded from .xlsx format 
with MS Excel, after export with Libre Office
diff --git a/sc/source/filter/xml/xmlcoli.cxx b/sc/source/filter/xml/xmlcoli.cxx
index 09224bb757a3..fc40a6f63c6b 100644
--- a/sc/source/filter/xml/xmlcoli.cxx
+++ b/sc/source/filter/xml/xmlcoli.cxx
@@ -93,6 +93,7 @@ void SAL_CALL ScXMLTableColContext::endFastElement( sal_Int32 
/*nElement*/ )
 nLastColumn = pDoc->MaxCol();
 if (nCurrentColumn > pDoc->MaxCol())
 nCurrentColumn = pDoc->MaxCol();
+pDoc->CreateColumnIfNotExists(nSheet, nLastColumn);
 uno::Reference xColumnRowRange 
(xSheet->getCellRangeByPosition(nCurrentColumn, 0, nLastColumn, 0), 
uno::UNO_QUERY);
 if (xColumnRowRange.is())
 {


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

2021-12-10 Thread Justin Luth (via logerrit)
 sw/source/uibase/app/apphdl.cxx |   54 +++-
 1 file changed, 37 insertions(+), 17 deletions(-)

New commits:
commit b1ab885437bfb08468601db9453cd036d6526de3
Author: Justin Luth 
AuthorDate: Thu Dec 9 19:48:46 2021 +0200
Commit: Mike Kaganski 
CommitDate: Sat Dec 11 06:07:02 2021 +0100

tdf#144680 mailmerge toolbar: enable icons unless no resultset

which backports 7.4 commit 9a115a254171d702a56a93c5c7e320de755dc8e8
plus tdf#144680 mailmerge toolbar: disable all icons if no resultset
(7.4 commit 16376cae68f4406ef9440bdcb7b9617de6a6f998)
plus a backport-only paranoid check to ensure that xConfigItem exists.

This fixes a problem introduced in LO 6.3 (backported to 6.1.5)
via commit 60714a814847f6d10f00aa6809a3896a48741e0b
tdf#121606: displaying Mail Merge toolbar shouldn't activate connection

Before 6.1, a user needed to run the mailmerge wizard
(or start the toolbar manually) in order to have
the mailmerge toolbar become available. In either of those cases,
the connection to the database was attempted and thus enabled
or disabled the various buttons based on the status. All good.

In 6.1, the toolbar was started on document load,
as soon as database fields were detected.
Sounds reasonable - good context sensitive UI.

The problem is that databases can often be password protected,
or on slow, remote sites. Thus the 6.3 commit mentioned above,
which disabled most buttons until the connection was established.

Well, having disabled buttons isn't too helpful,
and basically put us back to needing the extra step of
running the mail-merge wizard anyway.
The only problem with leaving them enabled is that we need to
ensure that we don't run the functions with bad results.

So sure - this means that a user thinks they can use the
mail-merge, attempt it, and then may find the buttons disable
when it won't work. That is the same as the forward/backwards
buttons though, so no big deal. Plus it is good feedback that
something isn't right (which will rarely ever be true).

The only time the buttons disable is for non-existant resultsets.
[Note that buttons do NOT disable for a wrong password,
or for a remote connection that can't be established.
And that is what we want anyway, so that further attempts
can be made after fixing the underlying problem.]

Change-Id: I3e82d2d3b35d04632650933c768cb0b5c006cb6f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126625
Tested-by: Jenkins
Reviewed-by: Justin Luth 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126633
Reviewed-by: Mike Kaganski 

diff --git a/sw/source/uibase/app/apphdl.cxx b/sw/source/uibase/app/apphdl.cxx
index dd2b943f476a..6532ff0c4907 100644
--- a/sw/source/uibase/app/apphdl.cxx
+++ b/sw/source/uibase/app/apphdl.cxx
@@ -210,12 +210,12 @@ void SwModule::StateOther(SfxItemSet )
 
 // #i51949# hide e-Mail option if e-Mail is not supported
 // #i63267# printing might be disabled
+// Without attempting to open the database, (in case it is 
remote or passworded),
+// hide everything after determining there are no valid 
results. tdf#121606
 if (!xConfigItem ||
-!xConfigItem->GetConnection().is() ||
-xConfigItem->GetConnection()->isClosed() ||
-!xConfigItem->GetResultSet().is() ||
 xConfigItem->GetCurrentDBData().sDataSource.isEmpty() ||
 xConfigItem->GetCurrentDBData().sCommand.isEmpty() ||
+(xConfigItem->GetConnection().is() && 
!xConfigItem->GetConnection()->isClosed() && !xConfigItem->GetResultSet().is()) 
||
 (nWhich == FN_MAILMERGE_PRINT_DOCUMENTS && 
Application::GetSettings().GetMiscSettings().GetDisablePrinting()) ||
 (nWhich == FN_MAILMERGE_EMAIL_DOCUMENTS && 
!xConfigItem->IsMailAvailable()))
 {
@@ -806,27 +806,47 @@ void SwModule::ExecOther(SfxRequest& rReq)
 }
 break;
 case FN_MAILMERGE_CREATE_DOCUMENTS:
-{
-std::shared_ptr xConfigItem = 
SwDBManager::PerformMailMerge(GetActiveView());
-
-if (xConfigItem && xConfigItem->GetTargetView())
-
xConfigItem->GetTargetView()->GetViewFrame()->GetFrame().Appear();
-}
-break;
 case FN_MAILMERGE_SAVE_DOCUMENTS:
 case FN_MAILMERGE_PRINT_DOCUMENTS:
 case FN_MAILMERGE_EMAIL_DOCUMENTS:
 {
 std::shared_ptr xConfigItem = 
GetActiveView()->GetMailMergeConfigItem();
-if(!xConfigItem)
+assert(xConfigItem);
+if (!xConfigItem || !xConfigItem->GetResultSet().is())
+{
+// The connection has been attempted, but failed or no results 
found,

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

2021-12-10 Thread Justin Luth (via logerrit)
 sw/source/uibase/app/apphdl.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 16376cae68f4406ef9440bdcb7b9617de6a6f998
Author: Justin Luth 
AuthorDate: Fri Dec 10 08:58:41 2021 +0200
Commit: Justin Luth 
CommitDate: Fri Dec 10 12:27:05 2021 +0100

tdf#144680 mailmerge toolbar: disable all icons if no resultset

followup to my previous patch. I had played with this,
and do to poor testing or some residual effect,
I thought this wasn't necessary to disable the
movement buttons specifically. But in renewed
testing it is clear that it isn't magic that
causes the disabling at the proper time.

Change-Id: Ic57dba42d649e79bd1db2b95f8f4316e772ccaeb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126628
Tested-by: Jenkins
Reviewed-by: Justin Luth 

diff --git a/sw/source/uibase/app/apphdl.cxx b/sw/source/uibase/app/apphdl.cxx
index 4e68665ead51..f5d537b8974a 100644
--- a/sw/source/uibase/app/apphdl.cxx
+++ b/sw/source/uibase/app/apphdl.cxx
@@ -822,6 +822,10 @@ void SwModule::ExecOther(SfxRequest& rReq)
 rBindings.Invalidate(FN_MAILMERGE_SAVE_DOCUMENTS);
 rBindings.Invalidate(FN_MAILMERGE_PRINT_DOCUMENTS);
 rBindings.Invalidate(FN_MAILMERGE_EMAIL_DOCUMENTS);
+rBindings.Invalidate(FN_MAILMERGE_FIRST_ENTRY);
+rBindings.Invalidate(FN_MAILMERGE_PREV_ENTRY);
+rBindings.Invalidate(FN_MAILMERGE_NEXT_ENTRY);
+rBindings.Invalidate(FN_MAILMERGE_LAST_ENTRY);
 rBindings.Update();
 return;
 }


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

2021-12-09 Thread Justin Luth (via logerrit)
 sw/source/uibase/app/apphdl.cxx |   50 ++--
 1 file changed, 33 insertions(+), 17 deletions(-)

New commits:
commit 9a115a254171d702a56a93c5c7e320de755dc8e8
Author: Justin Luth 
AuthorDate: Thu Dec 9 19:48:46 2021 +0200
Commit: Justin Luth 
CommitDate: Fri Dec 10 07:14:41 2021 +0100

tdf#144680 mailmerge toolbar: enable icons unless no resultset

This fixes a problem introduced in LO 6.3 (backported to 6.1.5)
via commit 60714a814847f6d10f00aa6809a3896a48741e0b
tdf#121606: displaying Mail Merge toolbar shouldn't activate connection

Before 6.1, a user needed to run the mailmerge wizard
(or start the toolbar manually) in order to have
the mailmerge toolbar become available. In either of those cases,
the connection to the database was attempted and thus enabled
or disabled the various buttons based on the status. All good.

In 6.1, the toolbar was started on document load,
as soon as database fields were detected.
Sounds reasonable - good context sensitive UI.

The problem is that databases can often be password protected,
or on slow, remote sites. Thus the 6.3 commit mentioned above,
which disabled most buttons until the connection was established.

Well, having disabled buttons isn't too helpful,
and basically put us back to needing the extra step of
running the mail-merge wizard anyway.
The only problem with leaving them enabled is that we need to
ensure that we don't run the functions with bad results.

So sure - this means that a user thinks they can use the
mail-merge, attempt it, and then may find the buttons disable
when it won't work. That is the same as the forward/backwards
buttons though, so no big deal. Plus it is good feedback that
something isn't right (which will rarely ever be true).

The only time the buttons disable is for non-existant resultsets.
[Note that buttons do NOT disable for a wrong password,
or for a remote connection that can't be established.
And that is what we want anyway, so that further attempts
can be made after fixing the underlying problem.]

Change-Id: I3e82d2d3b35d04632650933c768cb0b5c006cb6f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126625
Tested-by: Jenkins
Reviewed-by: Justin Luth 

diff --git a/sw/source/uibase/app/apphdl.cxx b/sw/source/uibase/app/apphdl.cxx
index dd2b943f476a..4e68665ead51 100644
--- a/sw/source/uibase/app/apphdl.cxx
+++ b/sw/source/uibase/app/apphdl.cxx
@@ -210,12 +210,12 @@ void SwModule::StateOther(SfxItemSet )
 
 // #i51949# hide e-Mail option if e-Mail is not supported
 // #i63267# printing might be disabled
+// Without attempting to open the database, (in case it is 
remote or passworded),
+// hide everything after determining there are no valid 
results. tdf#121606
 if (!xConfigItem ||
-!xConfigItem->GetConnection().is() ||
-xConfigItem->GetConnection()->isClosed() ||
-!xConfigItem->GetResultSet().is() ||
 xConfigItem->GetCurrentDBData().sDataSource.isEmpty() ||
 xConfigItem->GetCurrentDBData().sCommand.isEmpty() ||
+(xConfigItem->GetConnection().is() && 
!xConfigItem->GetConnection()->isClosed() && !xConfigItem->GetResultSet().is()) 
||
 (nWhich == FN_MAILMERGE_PRINT_DOCUMENTS && 
Application::GetSettings().GetMiscSettings().GetDisablePrinting()) ||
 (nWhich == FN_MAILMERGE_EMAIL_DOCUMENTS && 
!xConfigItem->IsMailAvailable()))
 {
@@ -806,27 +806,43 @@ void SwModule::ExecOther(SfxRequest& rReq)
 }
 break;
 case FN_MAILMERGE_CREATE_DOCUMENTS:
-{
-std::shared_ptr xConfigItem = 
SwDBManager::PerformMailMerge(GetActiveView());
-
-if (xConfigItem && xConfigItem->GetTargetView())
-
xConfigItem->GetTargetView()->GetViewFrame()->GetFrame().Appear();
-}
-break;
 case FN_MAILMERGE_SAVE_DOCUMENTS:
 case FN_MAILMERGE_PRINT_DOCUMENTS:
 case FN_MAILMERGE_EMAIL_DOCUMENTS:
 {
 std::shared_ptr xConfigItem = 
GetActiveView()->GetMailMergeConfigItem();
-if(!xConfigItem)
+assert(xConfigItem);
+if (!xConfigItem->GetResultSet().is())
+{
+// The connection has been attempted, but failed or no results 
found,
+// so invalidate the toolbar buttons in case they need to be 
disabled.
+SfxBindings& rBindings
+= 
GetActiveView()->GetWrtShell().GetView().GetViewFrame()->GetBindings();
+rBindings.Invalidate(FN_MAILMERGE_CREATE_DOCUMENTS);
+rBindings.Invalidate(FN_MAILMERGE_SAVE_DOCUMENTS);
+

[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - sc/source

2021-12-09 Thread Justin Luth (via logerrit)
 sc/source/core/data/documen3.cxx |6 +++---
 sc/source/core/data/validat.cxx  |6 +++---
 sc/source/ui/app/inputhdl.cxx|4 ++--
 sc/source/ui/view/gridwin.cxx|4 ++--
 4 files changed, 10 insertions(+), 10 deletions(-)

New commits:
commit 20c1ab5d85e3f24d4cdf6ab167ea6ce98e2586b4
Author: Justin Luth 
AuthorDate: Mon Dec 6 14:53:14 2021 +0200
Commit: Eike Rathke 
CommitDate: Fri Dec 10 02:57:53 2021 +0100

new ScTypedStrData: typically missed argument in CTOR, tdf#142910 follow-up

Pretty much any attempted use of eType was completely wrong and lost.

Regression from

commit f6b143a57d9bd8f5d7b29febcb4e01ee1eb2ff1d
CommitDate: Wed Jul 7 17:44:46 2021 +0200

tdf#142910 sc filter: fix "greater than" or "smaller than" etc

Most calls to this are missing the "rounded number" argument,
so the enumator is actually accepted as the double fRVal,
and the StringValue eType was left as the default value (Standard),
instead of the intended enumerator.

0.0 looks too much like 0, 0 to even notice in
casual code reading.

This had rendered the type mostly irrelevant.

Change-Id: If4fa69d4b3077981244a2c3a785f80b77f9f9501
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126453
Tested-by: Eike Rathke 
Reviewed-by: Eike Rathke 
(cherry picked from commit ac1ea5944a236efef75af7c85d0ffe10d374e7fa)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126591
Tested-by: Jenkins

diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx
index 92c721fa48ca..a1e7a2d9e73b 100644
--- a/sc/source/core/data/documen3.cxx
+++ b/sc/source/core/data/documen3.cxx
@@ -1669,7 +1669,7 @@ void ScDocument::GetFormulaEntries( ScTypedCaseStrSet& 
rStrings )
 if ( pRangeName )
 {
 for (const auto& rEntry : *pRangeName)
-rStrings.insert(ScTypedStrData(rEntry.second->GetName(), 0.0, 
ScTypedStrData::Name));
+rStrings.insert(ScTypedStrData(rEntry.second->GetName(), 0.0, 0.0, 
ScTypedStrData::Name));
 }
 
 // Database collection
@@ -1677,7 +1677,7 @@ void ScDocument::GetFormulaEntries( ScTypedCaseStrSet& 
rStrings )
 {
 const ScDBCollection::NamedDBs& rDBs = pDBCollection->getNamedDBs();
 for (const auto& rxDB : rDBs)
-rStrings.insert(ScTypedStrData(rxDB->GetName(), 0.0, 
ScTypedStrData::DbName));
+rStrings.insert(ScTypedStrData(rxDB->GetName(), 0.0, 0.0, 
ScTypedStrData::DbName));
 }
 
 // Content of name ranges
@@ -1700,7 +1700,7 @@ void ScDocument::GetFormulaEntries( ScTypedCaseStrSet& 
rStrings )
 continue;
 
 OUString aStr = aIter.getString();
-rStrings.insert(ScTypedStrData(aStr, 0.0, 
ScTypedStrData::Header));
+rStrings.insert(ScTypedStrData(aStr, 0.0, 0.0, 
ScTypedStrData::Header));
 }
 }
 }
diff --git a/sc/source/core/data/validat.cxx b/sc/source/core/data/validat.cxx
index d467db7ccf0f..6f578402309d 100644
--- a/sc/source/core/data/validat.cxx
+++ b/sc/source/core/data/validat.cxx
@@ -843,7 +843,7 @@ bool ScValidationData::GetSelectionFromFormula(
 }
 
 if( nullptr != pStrings )
-pEntry.reset(new ScTypedStrData( aValStr, 0.0, 
ScTypedStrData::Standard));
+pEntry.reset(new ScTypedStrData(aValStr, 0.0, 0.0, 
ScTypedStrData::Standard));
 
 if (!rCell.isEmpty() && rMatch < 0)
 aCondTokArr.AddString(rSPool.intern(aValStr));
@@ -880,7 +880,7 @@ bool ScValidationData::GetSelectionFromFormula(
 aCondTokArr.AddDouble( nMatVal.fVal );
 }
 if( nullptr != pStrings )
-pEntry.reset(new ScTypedStrData( aValStr, nMatVal.fVal, 
ScTypedStrData::Value));
+pEntry.reset(new ScTypedStrData(aValStr, nMatVal.fVal, 
nMatVal.fVal, ScTypedStrData::Value));
 }
 
 if (rMatch < 0 && !rCell.isEmpty() && IsEqualToTokenArray(rCell, 
rPos, aCondTokArr))
@@ -923,7 +923,7 @@ bool 
ScValidationData::FillSelectionList(std::vector& rStrColl,
 OUString aStr(pString);
 bool bIsValue = 
GetDocument()->GetFormatTable()->IsNumberFormat(aStr, nFormat, fValue);
 rStrColl.emplace_back(
-aStr, fValue, bIsValue ? ScTypedStrData::Value : 
ScTypedStrData::Standard);
+aStr, fValue, fValue, bIsValue ? ScTypedStrData::Value : 
ScTypedStrData::Standard);
 }
 bOk = aIt.Ok();
 
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index f3f672d23d42..7d16794db8b1 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -993,10 +993,10 @@ void ScInputHandler::GetFormulaData()
 maFormulaChar.insert( c );
 }
 OUString aFuncName = 

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

2021-12-09 Thread Justin Luth (via logerrit)
 sc/source/core/data/documen3.cxx |6 +++---
 sc/source/core/data/validat.cxx  |6 +++---
 sc/source/ui/app/inputhdl.cxx|4 ++--
 sc/source/ui/view/gridwin.cxx|4 ++--
 4 files changed, 10 insertions(+), 10 deletions(-)

New commits:
commit 77727e6dbcf1a42113ed442d840e941b5ce08bcd
Author: Justin Luth 
AuthorDate: Mon Dec 6 14:53:14 2021 +0200
Commit: Eike Rathke 
CommitDate: Fri Dec 10 02:57:38 2021 +0100

new ScTypedStrData: typically missed argument in CTOR, tdf#142910 follow-up

Pretty much any attempted use of eType was completely wrong and lost.

Regression from

commit f6b143a57d9bd8f5d7b29febcb4e01ee1eb2ff1d
CommitDate: Wed Jul 7 17:44:46 2021 +0200

tdf#142910 sc filter: fix "greater than" or "smaller than" etc

Most calls to this are missing the "rounded number" argument,
so the enumator is actually accepted as the double fRVal,
and the StringValue eType was left as the default value (Standard),
instead of the intended enumerator.

0.0 looks too much like 0, 0 to even notice in
casual code reading.

This had rendered the type mostly irrelevant.

Change-Id: If4fa69d4b3077981244a2c3a785f80b77f9f9501
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126453
Tested-by: Eike Rathke 
Reviewed-by: Eike Rathke 
(cherry picked from commit ac1ea5944a236efef75af7c85d0ffe10d374e7fa)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126592
Tested-by: Jenkins

diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx
index 5d5583628985..420befae37d2 100644
--- a/sc/source/core/data/documen3.cxx
+++ b/sc/source/core/data/documen3.cxx
@@ -1668,7 +1668,7 @@ void ScDocument::GetFormulaEntries( ScTypedCaseStrSet& 
rStrings )
 if ( pRangeName )
 {
 for (const auto& rEntry : *pRangeName)
-rStrings.insert(ScTypedStrData(rEntry.second->GetName(), 0.0, 
ScTypedStrData::Name));
+rStrings.insert(ScTypedStrData(rEntry.second->GetName(), 0.0, 0.0, 
ScTypedStrData::Name));
 }
 
 // Database collection
@@ -1676,7 +1676,7 @@ void ScDocument::GetFormulaEntries( ScTypedCaseStrSet& 
rStrings )
 {
 const ScDBCollection::NamedDBs& rDBs = pDBCollection->getNamedDBs();
 for (const auto& rxDB : rDBs)
-rStrings.insert(ScTypedStrData(rxDB->GetName(), 0.0, 
ScTypedStrData::DbName));
+rStrings.insert(ScTypedStrData(rxDB->GetName(), 0.0, 0.0, 
ScTypedStrData::DbName));
 }
 
 // Content of name ranges
@@ -1699,7 +1699,7 @@ void ScDocument::GetFormulaEntries( ScTypedCaseStrSet& 
rStrings )
 continue;
 
 OUString aStr = aIter.getString();
-rStrings.insert(ScTypedStrData(aStr, 0.0, 
ScTypedStrData::Header));
+rStrings.insert(ScTypedStrData(aStr, 0.0, 0.0, 
ScTypedStrData::Header));
 }
 }
 }
diff --git a/sc/source/core/data/validat.cxx b/sc/source/core/data/validat.cxx
index ade4908df44a..78541960a11c 100644
--- a/sc/source/core/data/validat.cxx
+++ b/sc/source/core/data/validat.cxx
@@ -836,7 +836,7 @@ bool ScValidationData::GetSelectionFromFormula(
 }
 
 if( nullptr != pStrings )
-pEntry.reset(new ScTypedStrData( aValStr, 0.0, 
ScTypedStrData::Standard));
+pEntry.reset(new ScTypedStrData(aValStr, 0.0, 0.0, 
ScTypedStrData::Standard));
 
 if (!rCell.isEmpty() && rMatch < 0)
 aCondTokArr.AddString(rSPool.intern(aValStr));
@@ -873,7 +873,7 @@ bool ScValidationData::GetSelectionFromFormula(
 aCondTokArr.AddDouble( nMatVal.fVal );
 }
 if( nullptr != pStrings )
-pEntry.reset(new ScTypedStrData( aValStr, nMatVal.fVal, 
ScTypedStrData::Value));
+pEntry.reset(new ScTypedStrData(aValStr, nMatVal.fVal, 
nMatVal.fVal, ScTypedStrData::Value));
 }
 
 if (rMatch < 0 && !rCell.isEmpty() && IsEqualToTokenArray(rCell, 
rPos, aCondTokArr))
@@ -916,7 +916,7 @@ bool 
ScValidationData::FillSelectionList(std::vector& rStrColl,
 OUString aStr(pString);
 bool bIsValue = 
GetDocument()->GetFormatTable()->IsNumberFormat(aStr, nFormat, fValue);
 rStrColl.emplace_back(
-aStr, fValue, bIsValue ? ScTypedStrData::Value : 
ScTypedStrData::Standard);
+aStr, fValue, fValue, bIsValue ? ScTypedStrData::Value : 
ScTypedStrData::Standard);
 }
 bOk = aIt.Ok();
 
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 6466c30576f0..b9ee0d62d02b 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -1042,10 +1042,10 @@ void ScInputHandler::GetFormulaData()
 maFormulaChar.insert( c );
 }
 OUString aFuncName = 

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

2021-12-09 Thread Justin Luth (via logerrit)
 sc/source/core/data/documen3.cxx |6 +++---
 sc/source/core/data/validat.cxx  |6 +++---
 sc/source/ui/app/inputhdl.cxx|4 ++--
 sc/source/ui/view/gridwin.cxx|4 ++--
 4 files changed, 10 insertions(+), 10 deletions(-)

New commits:
commit ac1ea5944a236efef75af7c85d0ffe10d374e7fa
Author: Justin Luth 
AuthorDate: Mon Dec 6 14:53:14 2021 +0200
Commit: Eike Rathke 
CommitDate: Fri Dec 10 01:46:41 2021 +0100

new ScTypedStrData: typically missed argument in CTOR, tdf#142910 follow-up

Pretty much any attempted use of eType was completely wrong and lost.

Regression from

commit f6b143a57d9bd8f5d7b29febcb4e01ee1eb2ff1d
CommitDate: Wed Jul 7 17:44:46 2021 +0200

tdf#142910 sc filter: fix "greater than" or "smaller than" etc

Most calls to this are missing the "rounded number" argument,
so the enumator is actually accepted as the double fRVal,
and the StringValue eType was left as the default value (Standard),
instead of the intended enumerator.

0.0 looks too much like 0, 0 to even notice in
casual code reading.

This had rendered the type mostly irrelevant.

Change-Id: If4fa69d4b3077981244a2c3a785f80b77f9f9501
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126453
Tested-by: Eike Rathke 
Reviewed-by: Eike Rathke 

diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx
index cd10db483ae5..163c374b6406 100644
--- a/sc/source/core/data/documen3.cxx
+++ b/sc/source/core/data/documen3.cxx
@@ -1668,7 +1668,7 @@ void ScDocument::GetFormulaEntries( ScTypedCaseStrSet& 
rStrings )
 if ( pRangeName )
 {
 for (const auto& rEntry : *pRangeName)
-rStrings.insert(ScTypedStrData(rEntry.second->GetName(), 0.0, 
ScTypedStrData::Name));
+rStrings.insert(ScTypedStrData(rEntry.second->GetName(), 0.0, 0.0, 
ScTypedStrData::Name));
 }
 
 // Database collection
@@ -1676,7 +1676,7 @@ void ScDocument::GetFormulaEntries( ScTypedCaseStrSet& 
rStrings )
 {
 const ScDBCollection::NamedDBs& rDBs = pDBCollection->getNamedDBs();
 for (const auto& rxDB : rDBs)
-rStrings.insert(ScTypedStrData(rxDB->GetName(), 0.0, 
ScTypedStrData::DbName));
+rStrings.insert(ScTypedStrData(rxDB->GetName(), 0.0, 0.0, 
ScTypedStrData::DbName));
 }
 
 // Content of name ranges
@@ -1699,7 +1699,7 @@ void ScDocument::GetFormulaEntries( ScTypedCaseStrSet& 
rStrings )
 continue;
 
 OUString aStr = aIter.getString();
-rStrings.insert(ScTypedStrData(aStr, 0.0, 
ScTypedStrData::Header));
+rStrings.insert(ScTypedStrData(aStr, 0.0, 0.0, 
ScTypedStrData::Header));
 }
 }
 }
diff --git a/sc/source/core/data/validat.cxx b/sc/source/core/data/validat.cxx
index ade4908df44a..78541960a11c 100644
--- a/sc/source/core/data/validat.cxx
+++ b/sc/source/core/data/validat.cxx
@@ -836,7 +836,7 @@ bool ScValidationData::GetSelectionFromFormula(
 }
 
 if( nullptr != pStrings )
-pEntry.reset(new ScTypedStrData( aValStr, 0.0, 
ScTypedStrData::Standard));
+pEntry.reset(new ScTypedStrData(aValStr, 0.0, 0.0, 
ScTypedStrData::Standard));
 
 if (!rCell.isEmpty() && rMatch < 0)
 aCondTokArr.AddString(rSPool.intern(aValStr));
@@ -873,7 +873,7 @@ bool ScValidationData::GetSelectionFromFormula(
 aCondTokArr.AddDouble( nMatVal.fVal );
 }
 if( nullptr != pStrings )
-pEntry.reset(new ScTypedStrData( aValStr, nMatVal.fVal, 
ScTypedStrData::Value));
+pEntry.reset(new ScTypedStrData(aValStr, nMatVal.fVal, 
nMatVal.fVal, ScTypedStrData::Value));
 }
 
 if (rMatch < 0 && !rCell.isEmpty() && IsEqualToTokenArray(rCell, 
rPos, aCondTokArr))
@@ -916,7 +916,7 @@ bool 
ScValidationData::FillSelectionList(std::vector& rStrColl,
 OUString aStr(pString);
 bool bIsValue = 
GetDocument()->GetFormatTable()->IsNumberFormat(aStr, nFormat, fValue);
 rStrColl.emplace_back(
-aStr, fValue, bIsValue ? ScTypedStrData::Value : 
ScTypedStrData::Standard);
+aStr, fValue, fValue, bIsValue ? ScTypedStrData::Value : 
ScTypedStrData::Standard);
 }
 bOk = aIt.Ok();
 
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index f4540b11ddee..24d99a658e48 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -1033,10 +1033,10 @@ void ScInputHandler::GetFormulaData()
 maFormulaChar.insert( c );
 }
 OUString aFuncName = *pDesc->mxFuncName + aParenthesesReplacement;
-pFormulaData->insert(ScTypedStrData(aFuncName, 0.0, 
ScTypedStrData::Standard));
+

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

2021-12-09 Thread Justin Luth (via logerrit)
 sc/source/ui/miscdlgs/anyrefdg.cxx |   22 ++
 1 file changed, 22 insertions(+)

New commits:
commit a99aea61c3199dc8188d4d873a10201082dff2e2
Author: Justin Luth 
AuthorDate: Tue Dec 7 15:19:45 2021 +0200
Commit: Justin Luth 
CommitDate: Thu Dec 9 15:12:03 2021 +0100

tdf#121699 sc: wrap LOKit stuff with isActive

This is a partial revert of LO 6.1
commit 009d2756b1678477ec23d5647bd5004c4bff3a62.

It is one thing to change code that you don't really
know why it is setup that way, but it is another thing
to ignore the resulting regression reports for 3 years.
Not impressed.

It look me only 1 hour to work through this,
and this is completely outside of my normal
line of programming.

Change-Id: I8671677f38cc1332c6c5a76847801e2680097048
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126500
Tested-by: Jenkins
Reviewed-by: Henry Castro 
Reviewed-by: Justin Luth 

diff --git a/sc/source/ui/miscdlgs/anyrefdg.cxx 
b/sc/source/ui/miscdlgs/anyrefdg.cxx
index 7e310d12cb45..20b2d7318df4 100644
--- a/sc/source/ui/miscdlgs/anyrefdg.cxx
+++ b/sc/source/ui/miscdlgs/anyrefdg.cxx
@@ -458,6 +458,28 @@ void ScFormulaReferenceHelper::DoClose( sal_uInt16 nId )
 
 void ScFormulaReferenceHelper::SetDispatcherLock( bool bLock )
 {
+if (!comphelper::LibreOfficeKit::isActive())
+{
+// lock / unlock only the dispatchers of Calc documents
+ScDocShell* pDocShell = 
static_cast(SfxObjectShell::GetFirst(checkSfxObjectShell));
+while (pDocShell)
+{
+SfxViewFrame* pFrame = SfxViewFrame::GetFirst(pDocShell);
+while (pFrame)
+{
+SfxDispatcher* pDisp = pFrame->GetDispatcher();
+if (pDisp)
+pDisp->Lock(bLock);
+pFrame = SfxViewFrame::GetNext(*pFrame, pDocShell);
+}
+pDocShell = 
static_cast(SfxObjectShell::GetNext(*pDocShell, 
checkSfxObjectShell));
+}
+return;
+// if a new view is created while the dialog is open,
+// that view's dispatcher is locked when trying to create the dialog
+// for that view (ScTabViewShell::CreateRefDialog)
+}
+
 //  lock / unlock only the dispatcher of Calc document
 SfxDispatcher* pDisp = nullptr;
 if ( m_pBindings )


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

2021-12-08 Thread Justin Luth (via logerrit)
 sc/qa/unit/data/xlsx/tdf123139_applyAlignment.xlsx |binary
 sc/qa/unit/subsequent_export_test2.cxx |   61 +
 sc/source/filter/oox/stylesbuffer.cxx  |4 -
 3 files changed, 63 insertions(+), 2 deletions(-)

New commits:
commit ab99d16e21e56596803b7d9a28af0895b435ef3e
Author: Justin Luth 
AuthorDate: Tue Nov 30 15:15:24 2021 +0200
Commit: Justin Luth 
CommitDate: Wed Dec 8 18:32:28 2021 +0100

tdf#123139 sc oox: CellXf should default to applyAlignment

Since the same logic applied to applyProtection
I tested and changed that one too.

No documentation was found to support the comment
(which was probably taken from binary import)
that applyAlignment had a context-dependent default value.

Testing on the other hand suggests that applyAlignment
is always considered true in the case of CellXf
and only matters for CellStyleXf.
The unit test tests for this - confirmed on Excel 2003/2016.

No existing unit tests where found with an
assert(rXf1.maModel.mbAlignUsed ||
(rXf1.maAlignment.getApiData() == rXf2.maAlignment.getApiData()));

Change-Id: I47d8dded93335092c93e75b4c18b798569da77f2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126177
Tested-by: Jenkins
Reviewed-by: Justin Luth 

diff --git a/sc/qa/unit/data/xlsx/tdf123139_applyAlignment.xlsx 
b/sc/qa/unit/data/xlsx/tdf123139_applyAlignment.xlsx
new file mode 100644
index ..e8ffc4861f45
Binary files /dev/null and b/sc/qa/unit/data/xlsx/tdf123139_applyAlignment.xlsx 
differ
diff --git a/sc/qa/unit/subsequent_export_test2.cxx 
b/sc/qa/unit/subsequent_export_test2.cxx
index a74fff7e04af..1dc763f96631 100644
--- a/sc/qa/unit/subsequent_export_test2.cxx
+++ b/sc/qa/unit/subsequent_export_test2.cxx
@@ -63,6 +63,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -185,6 +186,7 @@ public:
 void testTdf121718_UseFirstPageNumberXLSX();
 void testHeaderFontStyleXLSX();
 void testTdf135828_Shape_Rect();
+void testTdf123139XLSX();
 void testTdf123353();
 void testTdf140098();
 void testTdf133688_precedents();
@@ -298,6 +300,7 @@ public:
 CPPUNIT_TEST(testTdf121718_UseFirstPageNumberXLSX);
 CPPUNIT_TEST(testHeaderFontStyleXLSX);
 CPPUNIT_TEST(testTdf135828_Shape_Rect);
+CPPUNIT_TEST(testTdf123139XLSX);
 CPPUNIT_TEST(testTdf123353);
 CPPUNIT_TEST(testTdf140098);
 CPPUNIT_TEST(testTdf133688_precedents);
@@ -2169,6 +2172,64 @@ void ScExportTest2::testTdf135828_Shape_Rect()
 CPPUNIT_ASSERT_DOUBLES_EQUAL(1988280, nHeight, 1);
 }
 
+void ScExportTest2::testTdf123139XLSX()
+{
+ScDocShellRef xDocSh = loadDoc(u"tdf123139_applyAlignment.", FORMAT_XLSX);
+CPPUNIT_ASSERT_MESSAGE("Failed to open doc", xDocSh.is());
+
+ScDocument& rDoc = xDocSh->GetDocument();
+const ScPatternAttr* pAttr = rDoc.GetPattern(0, 0, 0); //A1
+
+{
+const SvxHorJustifyItem& rJustify = pAttr->GetItem(ATTR_HOR_JUSTIFY);
+CPPUNIT_ASSERT_EQUAL(SvxCellHorJustify::Repeat, rJustify.GetValue());
+}
+
+pAttr = rDoc.GetPattern(0, 1, 0); //A2
+
+{
+const SfxPoolItem& rItem = pAttr->GetItem(ATTR_HOR_JUSTIFY);
+const SvxHorJustifyItem& rJustify = static_cast(rItem);
+CPPUNIT_ASSERT_EQUAL(SvxCellHorJustify::Center, rJustify.GetValue());
+}
+
+{
+const ScProtectionAttr& rItem = pAttr->GetItem(ATTR_PROTECTION);
+CPPUNIT_ASSERT(rItem.GetProtection());
+CPPUNIT_ASSERT(!rItem.GetHideFormula());
+}
+
+pAttr = rDoc.GetPattern(2, 0, 0); //C1
+
+{
+const SfxPoolItem& rItem = pAttr->GetItem(ATTR_HOR_JUSTIFY);
+const SvxHorJustifyItem& rJustify = static_cast(rItem);
+CPPUNIT_ASSERT_EQUAL(SvxCellHorJustify::Standard, rJustify.GetValue());
+}
+
+{
+const ScProtectionAttr& rItem = pAttr->GetItem(ATTR_PROTECTION);
+CPPUNIT_ASSERT(rItem.GetProtection());
+CPPUNIT_ASSERT(rItem.GetHideFormula());
+}
+
+pAttr = rDoc.GetPattern(2, 1, 0); //C2
+
+{
+const SfxPoolItem& rItem = pAttr->GetItem(ATTR_HOR_JUSTIFY);
+const SvxHorJustifyItem& rJustify = static_cast(rItem);
+CPPUNIT_ASSERT_EQUAL(SvxCellHorJustify::Block, rJustify.GetValue());
+}
+
+{
+const ScProtectionAttr& rItem = pAttr->GetItem(ATTR_PROTECTION);
+CPPUNIT_ASSERT(!rItem.GetProtection());
+CPPUNIT_ASSERT(!rItem.GetHideFormula());
+}
+
+xDocSh->DoClose();
+}
+
 void ScExportTest2::testTdf123353()
 {
 ScDocShellRef xShell = loadDoc(u"tdf123353.", FORMAT_XLSX);
diff --git a/sc/source/filter/oox/stylesbuffer.cxx 
b/sc/source/filter/oox/stylesbuffer.cxx
index d40fcdc3d395..ad17e1db9f4e 100644
--- a/sc/source/filter/oox/stylesbuffer.cxx
+++ b/sc/source/filter/oox/stylesbuffer.cxx
@@ -1976,10 +1976,10 @@ void Xf::importXf( const AttributeList& rAttribs, bool 
bCellXf )
 maModel.mnFillId = 

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

2021-12-03 Thread Justin Luth (via logerrit)
 svx/source/dialog/srchdlg.cxx |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 3c10bb151e5864c0ff532910b9f81185aa49c21f
Author: Justin Luth 
AuthorDate: Thu Dec 2 14:38:53 2021 +0200
Commit: Justin Luth 
CommitDate: Fri Dec 3 16:29:40 2021 +0100

tdf#129629 sw UI: Find/replace - stop popping open MORE section

This was a regression from LO 6.1, where it would always
show the "more" options if one of them was enabled.

That might be fine for the dialog initialization
(and that is how I implemented it)
but even that is a bit much. Perhaps it should be a
search option that is remembered while the application
is running. Is that what pSearchOptions holds?

Anyway, this much I can easily figure out.
Someone who knows more about these things
can enhance it further if they want.

Change-Id: I8288bea514840f4ea06deb00a3603aa9568a75b7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126226
Tested-by: Jenkins
Reviewed-by: Justin Luth 

diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx
index ba5def14777e..f2c506c62ba3 100644
--- a/svx/source/dialog/srchdlg.cxx
+++ b/svx/source/dialog/srchdlg.cxx
@@ -800,8 +800,6 @@ void SvxSearchDialog::Init_Impl( bool bSearchPattern )
 m_xIncludeDiacritics->set_active( !aOpt.IsIgnoreDiacritics_CTL() );
 if ( m_xIncludeKashida->get_visible() )
 m_xIncludeKashida->set_active( !aOpt.IsIgnoreKashida_CTL() );
-if ( SvxSearchDialog::IsOtherOptionsExpanded() )
-m_xOtherOptionsExpander->set_expanded( true );
 ApplyTransliterationFlags_Impl( pSearchItem->GetTransliterationFlags() );
 
 ShowOptionalControls_Impl();
@@ -1754,8 +1752,12 @@ void SvxSearchDialog::EnableControls_Impl( const 
SearchOptionFlags nFlags )
 }
 
 if ( pSearchItem )
+{
 Init_Impl( pSearchItem->GetPattern() &&
( !pSearchList || !pSearchList->Count() ) );
+if (SvxSearchDialog::IsOtherOptionsExpanded())
+m_xOtherOptionsExpander->set_expanded(true);
+}
 }
 
 void SvxSearchDialog::EnableControl_Impl(const weld::Widget& rCtrl)


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

2021-11-29 Thread Justin Luth (via logerrit)
 sc/source/ui/cctrl/dpcontrol.cxx |7 +++
 1 file changed, 7 insertions(+)

New commits:
commit 5d331f3c92623fe6cba089bf2c49e8b518d225dd
Author: Justin Luth 
AuthorDate: Fri Nov 26 13:53:42 2021 +0200
Commit: Xisco Fauli 
CommitDate: Mon Nov 29 09:59:36 2021 +0100

tdf#126356 partial Revert "sc tiled editing: Mapping has to be

turned off after drawing the buttons."

This partially reverts LO 5.0
commit 342d84218c17da40d0a4f96bc3b07b536d64517a which comments:
   Also - we are actually never call with something else than MAP_PIXEL,
   so let's kill the resetting of the mapmode;
   let's see if some obscure corner case bites us here.

Several bug reports have indicated artifacts on screen,
all coming from the use of autofilter,
and in these cases the map mode is 0 (Map100thMM),
so I restored the whimsically removed logic.

Change-Id: I9bb5d7418fc4083ed71139a64329b11fa1e4cc13
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125879
Tested-by: Jenkins
Reviewed-by: Justin Luth 
(cherry picked from commit bed6b7356e4bba1604ee5f760c80acc16ae54bae)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125894
Reviewed-by: Xisco Fauli 

diff --git a/sc/source/ui/cctrl/dpcontrol.cxx b/sc/source/ui/cctrl/dpcontrol.cxx
index 4b0bcc449f5b..f504b6c75089 100644
--- a/sc/source/ui/cctrl/dpcontrol.cxx
+++ b/sc/source/ui/cctrl/dpcontrol.cxx
@@ -89,6 +89,11 @@ void ScDPFieldButton::setPopupLeft(bool b)
 
 void ScDPFieldButton::draw()
 {
+bool bOldMapEnabled = mpOutDev->IsMapModeEnabled();
+
+if (mpOutDev->GetMapMode().GetMapUnit() != MapUnit::MapPixel)
+mpOutDev->EnableMapMode(false);
+
 if (mbBaseButton)
 {
 // Background
@@ -135,6 +140,8 @@ void ScDPFieldButton::draw()
 
 if (mbPopupButton)
 drawPopupButton();
+
+mpOutDev->EnableMapMode(bOldMapEnabled);
 }
 
 void ScDPFieldButton::getPopupBoundingBox(Point& rPos, Size& rSize) const


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

2021-11-26 Thread Justin Luth (via logerrit)
 sc/source/ui/cctrl/dpcontrol.cxx |7 +++
 1 file changed, 7 insertions(+)

New commits:
commit bed6b7356e4bba1604ee5f760c80acc16ae54bae
Author: Justin Luth 
AuthorDate: Fri Nov 26 13:53:42 2021 +0200
Commit: Justin Luth 
CommitDate: Fri Nov 26 18:13:06 2021 +0100

tdf#126356 partial Revert "sc tiled editing: Mapping has to be

turned off after drawing the buttons."

This partially reverts LO 5.0
commit 342d84218c17da40d0a4f96bc3b07b536d64517a which comments:
   Also - we are actually never call with something else than MAP_PIXEL,
   so let's kill the resetting of the mapmode;
   let's see if some obscure corner case bites us here.

Several bug reports have indicated artifacts on screen,
all coming from the use of autofilter,
and in these cases the map mode is 0 (Map100thMM),
so I restored the whimsically removed logic.

Change-Id: I9bb5d7418fc4083ed71139a64329b11fa1e4cc13
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125879
Tested-by: Jenkins
Reviewed-by: Justin Luth 

diff --git a/sc/source/ui/cctrl/dpcontrol.cxx b/sc/source/ui/cctrl/dpcontrol.cxx
index 4b0bcc449f5b..f504b6c75089 100644
--- a/sc/source/ui/cctrl/dpcontrol.cxx
+++ b/sc/source/ui/cctrl/dpcontrol.cxx
@@ -89,6 +89,11 @@ void ScDPFieldButton::setPopupLeft(bool b)
 
 void ScDPFieldButton::draw()
 {
+bool bOldMapEnabled = mpOutDev->IsMapModeEnabled();
+
+if (mpOutDev->GetMapMode().GetMapUnit() != MapUnit::MapPixel)
+mpOutDev->EnableMapMode(false);
+
 if (mbBaseButton)
 {
 // Background
@@ -135,6 +140,8 @@ void ScDPFieldButton::draw()
 
 if (mbPopupButton)
 drawPopupButton();
+
+mpOutDev->EnableMapMode(bOldMapEnabled);
 }
 
 void ScDPFieldButton::getPopupBoundingBox(Point& rPos, Size& rSize) const


[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - sd/uiconfig

2021-11-25 Thread Justin Luth (via logerrit)
 sd/uiconfig/sdraw/popupmenu/draw.xml|1 +
 sd/uiconfig/simpress/popupmenu/draw.xml |1 +
 2 files changed, 2 insertions(+)

New commits:
commit 8b5783266357b600e58bd757fef1f34f942b2d58
Author: Justin Luth 
AuthorDate: Tue Nov 23 07:55:21 2021 +0200
Commit: Caolán McNamara 
CommitDate: Thu Nov 25 15:06:08 2021 +0100

tdf#130131 UI: add back "Split" to draw/impress popup

This is a partial revert of LO 6.2
commit cf8b3a74e8c093dd0ffc7e2f431a26864958f6fb

I have no idea why uno:Dismantle would have been
removed in this commit, since it wasn't
added back anywhere else, and seems to be
unrelated to anything else in that patch.

Change-Id: I1fbed2b3a58aee733c41c7a4817b215e4bec6061
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125681
Tested-by: Jenkins
Reviewed-by: Justin Luth 
Reviewed-by: Adolfo Jayme Barrientos 
(cherry picked from commit b7a46259eba35257291fe00851252c18ffb4fc90)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125713
Reviewed-by: Caolán McNamara 

diff --git a/sd/uiconfig/sdraw/popupmenu/draw.xml 
b/sd/uiconfig/sdraw/popupmenu/draw.xml
index 68655c28f41b..d29bb5046456 100644
--- a/sd/uiconfig/sdraw/popupmenu/draw.xml
+++ b/sd/uiconfig/sdraw/popupmenu/draw.xml
@@ -61,6 +61,7 @@
 
   
   
+  
   
   
   
diff --git a/sd/uiconfig/simpress/popupmenu/draw.xml 
b/sd/uiconfig/simpress/popupmenu/draw.xml
index a607562c4147..722250f0d2e3 100644
--- a/sd/uiconfig/simpress/popupmenu/draw.xml
+++ b/sd/uiconfig/simpress/popupmenu/draw.xml
@@ -61,6 +61,7 @@
 
   
   
+  
   
   
   


[Libreoffice-commits] core.git: sd/uiconfig

2021-11-23 Thread Justin Luth (via logerrit)
 sd/uiconfig/sdraw/popupmenu/draw.xml|1 +
 sd/uiconfig/simpress/popupmenu/draw.xml |1 +
 2 files changed, 2 insertions(+)

New commits:
commit b7a46259eba35257291fe00851252c18ffb4fc90
Author: Justin Luth 
AuthorDate: Tue Nov 23 07:55:21 2021 +0200
Commit: Adolfo Jayme Barrientos 
CommitDate: Wed Nov 24 06:36:02 2021 +0100

tdf#130131 UI: add back "Split" to draw/impress popup

This is a partial revert of LO 6.2
commit cf8b3a74e8c093dd0ffc7e2f431a26864958f6fb

I have no idea why uno:Dismantle would have been
removed in this commit, since it wasn't
added back anywhere else, and seems to be
unrelated to anything else in that patch.

Change-Id: I1fbed2b3a58aee733c41c7a4817b215e4bec6061
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125681
Tested-by: Jenkins
Reviewed-by: Justin Luth 
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/sd/uiconfig/sdraw/popupmenu/draw.xml 
b/sd/uiconfig/sdraw/popupmenu/draw.xml
index 68655c28f41b..d29bb5046456 100644
--- a/sd/uiconfig/sdraw/popupmenu/draw.xml
+++ b/sd/uiconfig/sdraw/popupmenu/draw.xml
@@ -61,6 +61,7 @@
 
   
   
+  
   
   
   
diff --git a/sd/uiconfig/simpress/popupmenu/draw.xml 
b/sd/uiconfig/simpress/popupmenu/draw.xml
index a607562c4147..722250f0d2e3 100644
--- a/sd/uiconfig/simpress/popupmenu/draw.xml
+++ b/sd/uiconfig/simpress/popupmenu/draw.xml
@@ -61,6 +61,7 @@
 
   
   
+  
   
   
   


[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - vcl/source

2021-11-23 Thread Justin Luth (via logerrit)
 vcl/source/window/printdlg.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 6809461add683eaa49a11530445c1f4c4b3d8fe8
Author: Justin Luth 
AuthorDate: Tue Nov 23 09:18:20 2021 +0200
Commit: Adolfo Jayme Barrientos 
CommitDate: Wed Nov 24 03:04:03 2021 +0100

tdf#129638 print preview: use new paper size after switching page

This is a partial revert of LO 6.3
commit 2c23a96f7b6888c0e05fdc2aba57f03cd797b647.

Change-Id: I17525d06d96779671caaa84e1e48629289453ad2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125685
Tested-by: Jenkins
Reviewed-by: Justin Luth 
(cherry picked from commit 324daa38a823477e1d1b650b5d91f3dc91c6a9af)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125466
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index c69799ed1c4e..251ce6002535 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -975,6 +975,7 @@ void PrintDialog::preparePreview( bool i_bMayUseCache )
 {
 PrinterController::PageSize aPageSize =
 maPController->getFilteredPageFile( mnCurPage, aMtf, 
i_bMayUseCache );
+aCurPageSize = aPrt->PixelToLogic(aPrt->GetPaperSizePixel(), 
MapMode(MapUnit::Map100thMM));
 if( ! aPageSize.bFullPaper )
 {
 Point aOff( aPrt->PixelToLogic( aPrt->GetPageOffsetPixel(), 
aMapMode ) );


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

2021-11-23 Thread Justin Luth (via logerrit)
 sw/source/uibase/shells/drwtxtex.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit cad293c26215855578eb218d7154ec8300960969
Author: Justin Luth 
AuthorDate: Tue Nov 23 10:23:37 2021 +0200
Commit: Adolfo Jayme Barrientos 
CommitDate: Wed Nov 24 03:03:09 2021 +0100

tdf#131150 sw menu: use nSlotId=0 to avoid adding to set

This fixes a regression in LO 6.4 caused by
commit 86cb2a1f98c0585d2121e6ae34fe62f072ef9a63

Not surprisingly, adding a new condition that multiple
other items match on caused a regression.

bFlag is always set to false at the top of the loop.
In the above commit, bFlag was not set to true,
and so thus it would always be false.
So just set the SlotId to 0
to avoid rSet.Put - like so many other cases already do.

Change-Id: I02e9ca9d8dd75db519e801ad0e86fc8d541ae20a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125688
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt 
Reviewed-by: Justin Luth 
(cherry picked from commit 87fafdb9dc045735e235cbba2ef37198043422c7)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125707
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/sw/source/uibase/shells/drwtxtex.cxx 
b/sw/source/uibase/shells/drwtxtex.cxx
index 770b46d7e7ba..8ac84122ff41 100644
--- a/sw/source/uibase/shells/drwtxtex.cxx
+++ b/sw/source/uibase/shells/drwtxtex.cxx
@@ -953,6 +953,7 @@ void SwDrawTextShell::GetState(SfxItemSet& rSet)
 {
 if (!URLFieldHelper::IsCursorAtURLField(pOLV))
 rSet.DisableItem(nWhich);
+nSlotId = 0;
 }
 break;
 default:
@@ -960,7 +961,7 @@ void SwDrawTextShell::GetState(SfxItemSet& rSet)
 break;
 }
 
-if (nSlotId && bFlag)
+if (nSlotId)
 rSet.Put(SfxBoolItem(nWhich, bFlag));
 
 nWhich = aIter.NextWhich();


<    4   5   6   7   8   9   10   11   12   13   >