[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - icon-themes/colibre

2022-03-10 Thread Pedro Pinto Silva (via logerrit)
 icon-themes/colibre/sw/res/page-shadow-mask.png |binary
 1 file changed

New commits:
commit c39cd7bce80740ce5ef9df6f31107cbf870f1de1
Author: Pedro Pinto Silva 
AuthorDate: Thu Mar 10 10:47:00 2022 +0100
Commit: Pedro Silva 
CommitDate: Fri Mar 11 08:58:36 2022 +0100

Decrease page outline prominence

Make the page border less prominent so user can focus more in the
page's content and less in the page's surroundings

Signed-off-by: Pedro Pinto Silva 
Change-Id: I54fd21bd9515c9c826ea369fb934dfe9343cf5dc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131308
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/icon-themes/colibre/sw/res/page-shadow-mask.png 
b/icon-themes/colibre/sw/res/page-shadow-mask.png
index 107f37d84982..6b0e64697786 100644
Binary files a/icon-themes/colibre/sw/res/page-shadow-mask.png and 
b/icon-themes/colibre/sw/res/page-shadow-mask.png differ


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

2022-03-10 Thread Andrea Gelmini (via logerrit)
 include/vcl/weld.hxx   |4 ++--
 sc/qa/unit/subsequent_export_test2.cxx |2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit a370e7ff7e8225b8343678401eca5a1721b2b9bb
Author: Andrea Gelmini 
AuthorDate: Fri Mar 11 07:02:54 2022 +0100
Commit: Julien Nabet 
CommitDate: Fri Mar 11 08:27:06 2022 +0100

Fix typos

Change-Id: I76e302e4db6d048e009d1ccd8dd185610f6ccf9b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131334
Tested-by: Julien Nabet 
Reviewed-by: Julien Nabet 

diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index 5d3842a5247a..bdef5b22b9ca 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -209,8 +209,8 @@ public:
 
 virtual OUString get_accessible_description() const = 0;
 
-// After this call this widget is only accessiblity labelled by pLabel and
-// pLabel only accessiblity labels this widget
+// After this call this widget is only accessibility labelled by pLabel and
+// pLabel only accessibility labels this widget
 virtual void set_accessible_relation_labeled_by(weld::Widget* pLabel) = 0;
 
 virtual void set_tooltip_text(const OUString& rTip) = 0;
diff --git a/sc/qa/unit/subsequent_export_test2.cxx 
b/sc/qa/unit/subsequent_export_test2.cxx
index be7469523e67..9db733b8f5d1 100644
--- a/sc/qa/unit/subsequent_export_test2.cxx
+++ b/sc/qa/unit/subsequent_export_test2.cxx
@@ -3074,7 +3074,7 @@ void ScExportTest2::testWholeRowBold()
 CPPUNIT_ASSERT_MESSAGE("Failed to open empty doc", xDocSh1.is());
 ScDocument* pDoc = &xDocSh1->GetDocument();
 
-// Make entire second row row bold.
+// Make entire second row bold.
 ScPatternAttr boldAttr(pDoc->GetPool());
 boldAttr.GetItemSet().Put(SvxWeightItem(WEIGHT_BOLD, ATTR_FONT_WEIGHT));
 pDoc->ApplyPatternAreaTab(0, 1, pDoc->MaxCol(), 1, 0, boldAttr);


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

2022-03-10 Thread Luboš Luňák (via logerrit)
 sc/source/ui/view/output.cxx |   38 ++
 1 file changed, 22 insertions(+), 16 deletions(-)

New commits:
commit cf95c0024ad9312ebdda382aba8f3cc201a0fdb2
Author: Luboš Luňák 
AuthorDate: Thu Mar 10 18:00:28 2022 +0100
Commit: Luboš Luňák 
CommitDate: Fri Mar 11 08:19:37 2022 +0100

don't bother drawing zero-width cells

If a document has most columns hidden, then they'd be "drawn"
anyway, since ScGridWindow::Draw() calls ExtendHidden(), this appears
to be needed in order to drawn properly background after the last
cell. So at least try avoid zero-sized draw operations which
may add up enough to be noticeable with 16k columns

Change-Id: I631e3be7467f8ea2dbfb824e647f900a7573da61
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131326
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx
index 045066e96689..09a1fc041eeb 100644
--- a/sc/source/ui/view/output.cxx
+++ b/sc/source/ui/view/output.cxx
@@ -1099,6 +1099,27 @@ void ScOutputData::DrawBackground(vcl::RenderContext& 
rRenderContext)
 
 nOldMerged = nMergedCols;
 
+tools::Long nNewPosX = nPosX;
+// extend for all merged cells
+nMergedCols = 1;
+if (pInfo->bMerged && pInfo->pPatternAttr)
+{
+const ScMergeAttr* pMerge =
+&pInfo->pPatternAttr->GetItem(ATTR_MERGE);
+nMergedCols = std::max(1, 
pMerge->GetColMerge());
+}
+
+for (SCCOL nMerged = 0; nMerged < nMergedCols; ++nMerged)
+{
+SCCOL nCol = nX+nOldMerged+nMerged;
+if (nCol > nX2+2)
+break;
+nNewPosX += pRowInfo[0].basicCellInfo(nCol-1).nWidth * 
nLayoutSign;
+}
+
+if (nNewPosX == nPosX)
+continue; // Zero width, no need to draw.
+
 if (bCellContrast)
 {
 //  high contrast for cell borders and backgrounds -> 
empty background
@@ -1142,22 +1163,7 @@ void ScOutputData::DrawBackground(vcl::RenderContext& 
rRenderContext)
 
 drawCells(rRenderContext, pColor, pBackground, pOldColor, 
pOldBackground, aRect, nPosXLogic, nLayoutSign, nOneXLogic, nOneYLogic, 
pDataBarInfo, pOldDataBarInfo, pIconSetInfo, pOldIconSetInfo, 
mpDoc->GetIconSetBitmapMap());
 
-// extend for all merged cells
-nMergedCols = 1;
-if (pInfo->bMerged && pInfo->pPatternAttr)
-{
-const ScMergeAttr* pMerge =
-&pInfo->pPatternAttr->GetItem(ATTR_MERGE);
-nMergedCols = std::max(1, 
pMerge->GetColMerge());
-}
-
-for (SCCOL nMerged = 0; nMerged < nMergedCols; ++nMerged)
-{
-SCCOL nCol = nX+nOldMerged+nMerged;
-if (nCol > nX2+2)
-break;
-nPosX += pRowInfo[0].basicCellInfo(nCol-1).nWidth * 
nLayoutSign;
-}
+nPosX = nNewPosX;
 }
 
 tools::Long nPosXLogic = nPosX;


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

2022-03-10 Thread Luboš Luňák (via logerrit)
 sc/source/ui/view/tabview.cxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit eeffa4b2a85751fd0153503520f6fc49b3510d86
Author: Luboš Luňák 
AuthorDate: Thu Mar 10 16:40:26 2022 +0100
Commit: Luboš Luňák 
CommitDate: Fri Mar 11 08:19:13 2022 +0100

optimize searching for last visible row

If all the remaining rows until the end of the sheet are hidden
(which apparently some users do to make the sheet look "nicer"),
don't search all the rows one by one.

Change-Id: I5f7ef61ece62f7858d4d8cfdf53bb514daa5b504
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131323
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
index 5862d87a8fa0..523044c7531a 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -1330,15 +1330,15 @@ namespace
 
 SCROW lcl_LastVisible( const ScViewData& rViewData )
 {
-// If many rows are hidden at end of the document (what kind of idiot does 
that?),
+// If many rows are hidden at end of the document,
 // then there should not be a switch to wide row headers because of this
-//! as a member to the document???
 ScDocument& rDoc = rViewData.GetDocument();
 SCTAB nTab = rViewData.GetTabNo();
 
 SCROW nVis = rDoc.MaxRow();
-while ( nVis > 0 && rDoc.GetRowHeight( nVis, nTab ) == 0 )
---nVis;
+SCROW startRow;
+while ( nVis > 0 && rDoc.GetRowHeight( nVis, nTab, &startRow, nullptr ) == 
0 )
+nVis = std::max( startRow - 1, 0 );
 return nVis;
 }
 


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

2022-03-10 Thread Miklos Vajna (via logerrit)
 sw/source/core/text/porexp.cxx |   13 +
 sw/source/core/text/porexp.hxx |3 +++
 2 files changed, 16 insertions(+)

New commits:
commit e1572ca283cb8aad35a3c81f22aecf18aa86ab90
Author: Miklos Vajna 
AuthorDate: Thu Mar 10 20:17:21 2022 +0100
Commit: Miklos Vajna 
CommitDate: Fri Mar 11 08:09:41 2022 +0100

sw layout xml dump: handle blank portions

Show their character.

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

diff --git a/sw/source/core/text/porexp.cxx b/sw/source/core/text/porexp.cxx
index 29f470c1490c..6739419484f6 100644
--- a/sw/source/core/text/porexp.cxx
+++ b/sw/source/core/text/porexp.cxx
@@ -210,6 +210,19 @@ void SwBlankPortion::HandlePortion( SwPortionHandler& rPH 
) const
 rPH.Special( GetLen(), OUString( m_cChar ), GetWhichPor() );
 }
 
+void SwBlankPortion::dumpAsXml(xmlTextWriterPtr pWriter) const
+{
+(void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwBlankPortion"));
+(void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("char"),
+  
BAD_CAST(OUString(m_cChar).toUtf8().getStr()));
+(void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("multi"),
+  
BAD_CAST(OString::boolean(m_bMulti).getStr()));
+
+SwExpandPortion::dumpAsXml(pWriter);
+
+(void)xmlTextWriterEndElement(pWriter);
+}
+
 SwPostItsPortion::SwPostItsPortion( bool bScrpt )
 : m_bScript( bScrpt )
 {
diff --git a/sw/source/core/text/porexp.hxx b/sw/source/core/text/porexp.hxx
index 9c7be5be5aaf..1ea608c9dfa2 100644
--- a/sw/source/core/text/porexp.hxx
+++ b/sw/source/core/text/porexp.hxx
@@ -35,6 +35,7 @@ public:
 virtual void HandlePortion( SwPortionHandler& rPH ) const override;
 };
 
+/// Non-breaking space or non-breaking hyphen.
 class SwBlankPortion : public SwExpandPortion
 {
 sal_Unicode m_cChar;
@@ -54,6 +55,8 @@ public:
 
 // Accessibility: pass information about this portion to the PortionHandler
 virtual void HandlePortion( SwPortionHandler& rPH ) const override;
+
+void dumpAsXml(xmlTextWriterPtr pWriter) const override;
 };
 
 class SwPostItsPortion : public SwExpandPortion


[Libreoffice-commits] core.git: sal/rtl

2022-03-10 Thread Stephan Bergmann (via logerrit)
 sal/rtl/strtmpl.hxx |7 ---
 1 file changed, 7 deletions(-)

New commits:
commit 52bd453eceea7dfb425e5e58b93244214dad29c2
Author: Stephan Bergmann 
AuthorDate: Fri Mar 11 08:07:05 2022 +0100
Commit: Stephan Bergmann 
CommitDate: Fri Mar 11 08:07:05 2022 +0100

Remove redundant check

The precondition `nIndex >= 0` is already asserted at the top of the 
function.

Change-Id: I7436ce923b19aa81f08d1fb20680308f609d2242

diff --git a/sal/rtl/strtmpl.hxx b/sal/rtl/strtmpl.hxx
index 07ea6d6cbba8..9fa05af4526d 100644
--- a/sal/rtl/strtmpl.hxx
+++ b/sal/rtl/strtmpl.hxx
@@ -1145,13 +1145,6 @@ void newReplaceStrAt( 
IMPL_RTL_STRINGDATA** ppTh
 return;
 }
 
-/* negative index? */
-if (nIndex < 0)
-{
-nCount -= nIndex;
-nIndex = 0;
-}
-
 /* not more than the String length could be deleted */
 if (nCount >= pStr->length-nIndex)
 {


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

2022-03-10 Thread Miklos Vajna (via logerrit)
 vcl/qa/cppunit/pdfexport/data/pdf-image-annots.odg |binary
 vcl/qa/cppunit/pdfexport/pdfexport.cxx |   30 +
 vcl/source/gdi/pdfwriter_impl.cxx  |   16 +--
 3 files changed, 44 insertions(+), 2 deletions(-)

New commits:
commit 6dc55f8af3649a536e2c3c075a0b4b230094a9f5
Author: Miklos Vajna 
AuthorDate: Wed Mar 9 13:36:27 2022 +0100
Commit: Tomaž Vajngerl 
CommitDate: Fri Mar 11 01:56:04 2022 +0100

PDF export of PDF images: don't preserve annotations in general

Regression from 33c9bc0225a92f26770f9ef20b252af47853e7b9 (PDF export of
PDF images: preserve hyperlinks, 2022-01-07), the problem was that we
want to preserve hyperlinks, but annotations are added by the PDF export
explicitly, so it isn't a good idea to "preserve" them as well.

Fix the problem by going back to the old behavior, except when the
annotation sub-type is /Link.

This keeps hyperlinks working but doesn't lead to duplicated comments
when re-exporting an image + adding comments explicitly.

Conflicts:
vcl/qa/cppunit/pdfexport/pdfexport.cxx

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

diff --git a/vcl/qa/cppunit/pdfexport/data/pdf-image-annots.odg 
b/vcl/qa/cppunit/pdfexport/data/pdf-image-annots.odg
new file mode 100644
index ..6dee0145c536
Binary files /dev/null and b/vcl/qa/cppunit/pdfexport/data/pdf-image-annots.odg 
differ
diff --git a/vcl/qa/cppunit/pdfexport/pdfexport.cxx 
b/vcl/qa/cppunit/pdfexport/pdfexport.cxx
index 8c1c81162ace..2206bd25d58a 100644
--- a/vcl/qa/cppunit/pdfexport/pdfexport.cxx
+++ b/vcl/qa/cppunit/pdfexport/pdfexport.cxx
@@ -2645,6 +2645,36 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, 
testPdfImageHyperlink)
 CPPUNIT_ASSERT_EQUAL(0.0012626264, rtl::math::round(aScale.getY(), 10));
 #endif
 }
+
+CPPUNIT_TEST_FIXTURE(PdfExportTest, testPdfImageAnnots)
+{
+// Given a document with a PDF image that has 2 comments (popup, text) and 
a hyperlink:
+OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + 
"pdf-image-annots.odg";
+mxComponent = loadFromDesktop(aURL);
+CPPUNIT_ASSERT(mxComponent.is());
+
+// When saving to PDF:
+uno::Reference xStorable(mxComponent, uno::UNO_QUERY);
+utl::MediaDescriptor aMediaDescriptor;
+aMediaDescriptor["FilterName"] <<= OUString("draw_pdf_Export");
+xStorable->storeToURL(maTempFile.GetURL(), 
aMediaDescriptor.getAsConstPropertyValueList());
+
+// Then make sure only the hyperlink is kept, since Draw itself has its 
own comments:
+SvFileStream aFile(maTempFile.GetURL(), StreamMode::READ);
+maMemory.WriteStream(aFile);
+std::shared_ptr pPDFium = vcl::pdf::PDFiumLibrary::get();
+std::unique_ptr pPdfDocument
+= pPDFium->openDocument(maMemory.GetData(), maMemory.GetSize());
+CPPUNIT_ASSERT(pPdfDocument);
+CPPUNIT_ASSERT_EQUAL(1, pPdfDocument->getPageCount());
+std::unique_ptr pPdfPage = 
pPdfDocument->openPage(/*nIndex=*/0);
+CPPUNIT_ASSERT(pPdfPage);
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: 1
+// - Actual  : 3
+// i.e. not only the hyperlink but also the 2 comments were exported, 
leading to duplication.
+CPPUNIT_ASSERT_EQUAL(1, pPdfPage->getAnnotationCount());
+}
 }
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx 
b/vcl/source/gdi/pdfwriter_impl.cxx
index 6aefaf2edabe..3e934a19825d 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -8511,7 +8511,7 @@ void 
PDFWriterImpl::writeReferenceXObject(ReferenceXObjectEmit& rEmit)
 return;
 }
 
-// Merge page annotations (links, etc) from pPage to our page.
+// Merge link annotations from pPage to our page.
 std::vector aAnnots;
 if (auto pArray = 
dynamic_cast(pPage->Lookup("Annots")))
 {
@@ -8529,7 +8529,19 @@ void 
PDFWriterImpl::writeReferenceXObject(ReferenceXObjectEmit& rEmit)
 continue;
 }
 
-// Annotation refers to an object, remember it.
+auto pType = 
dynamic_cast(pObject->Lookup("Type"));
+if (!pType || pType->GetValue() != "Annot")
+{
+continue;
+}
+
+auto pSubtype = 
dynamic_cast(pObject->Lookup("Subtype"));
+if (!pSubtype || pSubtype->GetValue() != "Link")
+{
+continue;
+}
+
+// Reference to a link annotation object, remember it.
 aAnnots.push_back(pObject);
 }
 }


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

2022-03-10 Thread Mike Kaganski (via logerrit)
 sc/source/core/tool/interpr1.cxx |   10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)

New commits:
commit 3ccc4c123f5e78e0204d11abeab2d1a74278ca3e
Author: Mike Kaganski 
AuthorDate: Thu Mar 10 10:53:12 2022 +0300
Commit: Mike Kaganski 
CommitDate: Thu Mar 10 22:03:06 2022 +0100

Use OUStringBuffer in ScConcat

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

diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index db8b282500ba..d79962324754 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -9752,16 +9752,20 @@ void ScInterpreter::ScRept()
 void ScInterpreter::ScConcat()
 {
 sal_uInt8 nParamCount = GetByte();
-OUString aRes;
+
+//reverse order of parameter stack to simplify processing
+ReverseStack(nParamCount);
+
+OUStringBuffer aRes;
 while( nParamCount-- > 0)
 {
 OUString aStr = GetString().getString();
 if (CheckStringResultLen(aRes, aStr.getLength()))
-aRes = aStr + aRes;
+aRes.append(aStr);
 else
 break;
 }
-PushString( aRes );
+PushString( aRes.makeStringAndClear() );
 }
 
 FormulaError ScInterpreter::GetErrorType()


[Libreoffice-commits] core.git: bin/sanitize-excludelist.txt

2022-03-10 Thread Caolán McNamara (via logerrit)
 bin/sanitize-excludelist.txt |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 05d4126637ad3af256b3048ec9dc7e08c2f1a0d6
Author: Caolán McNamara 
AuthorDate: Thu Mar 10 20:29:26 2022 +
Commit: Caolán McNamara 
CommitDate: Thu Mar 10 21:30:32 2022 +0100

ofz#45344 and ofz#45392 suppress Integer-overflow

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

diff --git a/bin/sanitize-excludelist.txt b/bin/sanitize-excludelist.txt
index 0e26870b2188..528fe51045e9 100644
--- a/bin/sanitize-excludelist.txt
+++ b/bin/sanitize-excludelist.txt
@@ -6,10 +6,10 @@ src:*/scaddins/source/analysis/financial.cxx
 [memory]
 fun:generate_hash_secret_salt
 [signed-integer-overflow]
+fun:_cairo_*
 src:*/boost/boost/rational.hpp
 src:*/include/tools/gen.hxx
 src:*/tools/source/generic/gen.cxx
-src:*/workdir/UnpackedTarball/cairo/src/*
 [vptr]
 fun:_ZN4cppu14throwExceptionERKN3com3sun4star3uno3AnyE
 src:*/include/com/sun/star/uno/Reference.hxx


[Libreoffice-commits] core.git: emfio/inc emfio/qa emfio/source include/tools tools/inc tools/source

2022-03-10 Thread Bartosz Kosiorek (via logerrit)
 emfio/inc/mtftools.hxx|4 +
 emfio/qa/cppunit/emf/EmfImportTest.cxx|   48 ++
 emfio/qa/cppunit/emf/data/TestSetArcDirection.emf |binary
 emfio/source/reader/emfreader.cxx |   16 +--
 emfio/source/reader/mtftools.cxx  |9 
 include/tools/poly.hxx|3 -
 tools/inc/poly.h  |2 
 tools/source/generic/poly.cxx |   41 --
 8 files changed, 104 insertions(+), 19 deletions(-)

New commits:
commit 7b28920382d3820344bfc4075bac98f85e838dba
Author: Bartosz Kosiorek 
AuthorDate: Mon Mar 7 12:26:03 2022 +0100
Commit: Bartosz Kosiorek 
CommitDate: Thu Mar 10 21:19:59 2022 +0100

tdf#113066 tdf#142204 EMF Implement SETARCDIRECTION

Change-Id: I30206c68ecf1829ba0094e6259b8ed7dc05f2e9a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131103
Tested-by: Jenkins
Reviewed-by: Bartosz Kosiorek 

diff --git a/emfio/inc/mtftools.hxx b/emfio/inc/mtftools.hxx
index 84a012f183d6..d258a9250b91 100644
--- a/emfio/inc/mtftools.hxx
+++ b/emfio/inc/mtftools.hxx
@@ -454,6 +454,7 @@ namespace emfio
 WinMtfClipPath  maClipPath;
 XForm   aXForm;
 
+boolbClockWiseArcDirection;
 boolbFillStyleSelected;
 };
 
@@ -565,6 +566,7 @@ namespace emfio
 ScaledFontDetectCorrectHelper maScaledFontHelper;
 
 boolmbNopMode : 1;
+boolmbClockWiseArcDirection : 1;
 boolmbFillStyleSelected : 1;
 boolmbClipNeedsUpdate : 1;
 boolmbComplexClip : 1;
@@ -618,6 +620,8 @@ namespace emfio
 
 voidSetGfxMode(sal_Int32 nGfxMode) { mnGfxMode = 
nGfxMode; };
 sal_Int32   GetGfxMode() const { return mnGfxMode; };
+voidSetArcDirection(bool bCounterClockWise);
+boolIsArcDirectionClockWise() { return 
mbClockWiseArcDirection; };
 voidSetBkMode(BkMode nMode);
 voidSetBkColor(const Color& rColor);
 voidSetTextColor(const Color& rColor);
diff --git a/emfio/qa/cppunit/emf/EmfImportTest.cxx 
b/emfio/qa/cppunit/emf/EmfImportTest.cxx
index c9c2bcb94219..fce8961a849a 100644
--- a/emfio/qa/cppunit/emf/EmfImportTest.cxx
+++ b/emfio/qa/cppunit/emf/EmfImportTest.cxx
@@ -60,6 +60,7 @@ class Test : public test::BootstrapFixture, public 
XmlTestTools, public unotest:
 void TestChordWithModifyWorldTransform();
 void TestEllipseWithSelectClipPath();
 void TestEllipseXformIntersectClipRect();
+void TestSetArcDirection();
 void TestDrawPolyLine16WithClip();
 void TestFillRegion();
 void TestExtTextOutOpaqueAndClipTransform();
@@ -102,6 +103,7 @@ public:
 CPPUNIT_TEST(TestChordWithModifyWorldTransform);
 CPPUNIT_TEST(TestEllipseWithSelectClipPath);
 CPPUNIT_TEST(TestEllipseXformIntersectClipRect);
+CPPUNIT_TEST(TestSetArcDirection);
 CPPUNIT_TEST(TestDrawPolyLine16WithClip);
 CPPUNIT_TEST(TestFillRegion);
 CPPUNIT_TEST(TestExtTextOutOpaqueAndClipTransform);
@@ -700,6 +702,52 @@ void Test::TestEllipseXformIntersectClipRect()
 "3625,320 3625,320");
 }
 
+void Test::TestSetArcDirection()
+{
+// EMF import test with records: SETARCDIRECTION, ARC, PIE
+Primitive2DSequence aSequence = 
parseEmf(u"/emfio/qa/cppunit/emf/data/TestSetArcDirection.emf");
+CPPUNIT_ASSERT_EQUAL(1, static_cast(aSequence.getLength()));
+drawinglayer::Primitive2dXmlDump dumper;
+xmlDocUniquePtr pDocument = 
dumper.dumpAndParse(Primitive2DContainer(aSequence));
+CPPUNIT_ASSERT(pDocument);
+
+assertXPath(pDocument, aXPathPrefix + "polypolygoncolor", "color", 
"#ff");
+assertXPath(
+pDocument, aXPathPrefix + "polypolygoncolor/polypolygon", "path",
+"m1640 1570-1000-950 50-50 50-50 50-50 50-40 60-40 50-40 60-30 60-40 
60-20 60-30 70-20 "
+"60-20 70-10 60-20h70l70-10h60 70l70 10 60 10 70 10 70 20 60 20 60 20 
70 30 60 30 60 30 50 "
+"40 60 40 50 40 50 40 50 50 50 50 50 50 40 60 40 60 40 60 30 60 30 60 
30 60 20 70 30 70 10 "
+"60 20 70 10 70 10 70 10 70v80 70l-10 70v70l-10 70-20 70-20 70z");
+assertXPath(pDocument, aXPathPrefix + "polygonhairline", 2);
+assertXPath(pDocument, aXPathPrefix + "polygonhairline[1]", "color", 
"#00");
+assertXPath(pDocument, aXPathPrefix + "polygonhairline[2]", "color", 
"#00");
+assertXPath(pDocument, aXPathPrefix + "polygonhairline", 2);
+assertXPathContent(
+pDocument, aXPathPrefix + "polygonhairline[1]/polygon",
+"1070,1570 1110,1560 1160,1540 1200,1530 1250,1520 1300,1510 1350,1510 
1400,1500 1440,1500 "
+"1490,1500 1540,1500 1590,1500 1640,1510 1690,1510 1740,1520 1780,1530 
1830,1540 1880,1560 "
+"19

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

2022-03-10 Thread Miklos Vajna (via logerrit)
 sw/inc/numrule.hxx|3 +++
 sw/source/core/doc/number.cxx |   23 +++
 sw/source/core/unocore/unoparagraph.cxx   |   16 
 xmloff/qa/unit/data/list-id.fodt  |   23 +++
 xmloff/qa/unit/text.cxx   |   24 
 xmloff/source/text/XMLTextNumRuleInfo.cxx |   11 ++-
 xmloff/source/text/XMLTextNumRuleInfo.hxx |4 
 xmloff/source/text/txtparae.cxx   |4 ++--
 8 files changed, 105 insertions(+), 3 deletions(-)

New commits:
commit 8f48f91009caa86d896f247059874242ed18bf39
Author: Miklos Vajna 
AuthorDate: Thu Mar 10 16:29:48 2022 +0100
Commit: Miklos Vajna 
CommitDate: Thu Mar 10 20:10:16 2022 +0100

ODT export: omit unreferenced 

This attribute is needed when a numbering is built using multiple,
independent  elements. In that case the markup to connect
these are either:



...



In case there is no other list in-between, or:



...



In case there are other lists in-between.

This means that at least in case all the text nodes of the numbering are
after each other, then the random value in xml:id="..." is never
referenced, so it can be omitted.

This helps deterministic ODF output when the input is HTML, where there
are never text:continue-list="..." attributes that would refer to these
xml:id="..." attributes.

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

diff --git a/sw/inc/numrule.hxx b/sw/inc/numrule.hxx
index 1e23a8818163..e10603a7e3dc 100644
--- a/sw/inc/numrule.hxx
+++ b/sw/inc/numrule.hxx
@@ -273,6 +273,9 @@ public:
 void dumpAsXml(xmlTextWriterPtr w) const;
 void GetGrabBagItem(css::uno::Any& rVal) const;
 void SetGrabBagItem(const css::uno::Any& rVal);
+
+/// Is it possible that this numbering has multiple lists?
+bool HasContinueList() const;
 };
 
 /// namespace for static functions and methods for numbering and bullets
diff --git a/sw/source/core/doc/number.cxx b/sw/source/core/doc/number.cxx
index 93a5c149f15c..40fec8c7d8d1 100644
--- a/sw/source/core/doc/number.cxx
+++ b/sw/source/core/doc/number.cxx
@@ -1154,6 +1154,29 @@ void SwNumRule::SetGrabBagItem(const uno::Any& rVal)
 mpGrabBagItem->PutValue(rVal, 0);
 }
 
+bool SwNumRule::HasContinueList() const
+{
+// In case all text nodes are after each other, then we won't have a later 
list that wants to
+// continue us.
+SwNodeOffset nIndex(0);
+for (size_t i = 0; i < maTextNodeList.size(); ++i)
+{
+SwTextNode* pNode = maTextNodeList[i];
+if (i > 0)
+{
+if (pNode->GetIndex() != nIndex + 1)
+{
+// May have a continue list.
+return true;
+}
+}
+nIndex = pNode->GetIndex();
+}
+
+// Definitely won't have a continue list.
+return false;
+}
+
 namespace numfunc
 {
 namespace {
diff --git a/sw/source/core/unocore/unoparagraph.cxx 
b/sw/source/core/unocore/unoparagraph.cxx
index f39bc2cc234f..428f64a53503 100644
--- a/sw/source/core/unocore/unoparagraph.cxx
+++ b/sw/source/core/unocore/unoparagraph.cxx
@@ -921,6 +921,22 @@ static beans::PropertyState 
lcl_SwXParagraph_getPropertyState(
 bDone = true;
 break;
 }
+case FN_UNO_LIST_ID:
+{
+if (*ppSet)
+{
+if ((*ppSet)->GetItemState(RES_PARATR_LIST_ID, false) == 
SfxItemState::SET)
+{
+SwNumRule* pNumRule = rTextNode.GetNumRule();
+if (!pNumRule || pNumRule->HasContinueList())
+{
+eRet = beans::PropertyState_DIRECT_VALUE;
+}
+}
+bDone = true;
+}
+break;
+}
 case FN_UNO_ANCHOR_TYPES:
 {
 bDone = true;
diff --git a/xmloff/qa/unit/data/list-id.fodt b/xmloff/qa/unit/data/list-id.fodt
new file mode 100644
index ..377dbcbd6473
--- /dev/null
+++ b/xmloff/qa/unit/data/list-id.fodt
@@ -0,0 +1,23 @@
+
+
+  
+
+  
+
+  
+  
+
+  
+
+  First
+
+
+  Second
+
+
+  Third
+
+  
+
+  
+
diff --git a/xmloff/qa/unit/text.cxx b/xmloff/qa/unit/text.cxx
index 1d239e2e0c09..71772edb3585 100644
--- a/xmloff/qa/unit/text.cxx
+++ b/xmloff/qa/unit/text.cxx
@@ -245,6 +245,30 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, 
testContinueNumberingWord)
 CPPUNIT_ASSERT_EQUAL(OUString("2."), aActual);
 }
 
+CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testListId)
+{
+// Given a document w

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

2022-03-10 Thread Attila Bakos (NISZ) (via logerrit)
 sw/qa/extras/layout/data/tdf116256.docx |binary
 sw/qa/extras/layout/layout2.cxx |   44 +++
 sw/source/core/doc/textboxhelper.cxx|   90 
 xmloff/qa/unit/draw.cxx |2 
 4 files changed, 125 insertions(+), 11 deletions(-)

New commits:
commit 6e8ae79176be1c34cadc833c8e521be19455fade
Author: Attila Bakos (NISZ) 
AuthorDate: Thu Feb 17 16:00:01 2022 +0100
Commit: László Németh 
CommitDate: Thu Mar 10 19:50:36 2022 +0100

tdf#116256 sw: fix textbox position in floating table

in case of it has to follow the text flow.

Change-Id: Ic4f195c2efcc465276faa9a95362933dafa65bee
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130077
Tested-by: László Németh 
Reviewed-by: László Németh 

diff --git a/sw/qa/extras/layout/data/tdf116256.docx 
b/sw/qa/extras/layout/data/tdf116256.docx
new file mode 100644
index ..f067e04f0614
Binary files /dev/null and b/sw/qa/extras/layout/data/tdf116256.docx differ
diff --git a/sw/qa/extras/layout/layout2.cxx b/sw/qa/extras/layout/layout2.cxx
index 38451465bab0..7c8914b814d7 100644
--- a/sw/qa/extras/layout/layout2.cxx
+++ b/sw/qa/extras/layout/layout2.cxx
@@ -11,6 +11,7 @@
 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -988,6 +989,49 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf69648)
 }
 }
 
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf116256)
+{
+// Open bugdoc
+createSwDoc(DATA_DIRECTORY, "tdf116256.docx");
+CPPUNIT_ASSERT(mxComponent);
+
+// Get the textbox
+uno::Reference xTextBox(getShape(2), 
uno::UNO_QUERY_THROW);
+
+// Ensure that is a real textbox, and follows the text flow
+CPPUNIT_ASSERT(xTextBox->getPropertyValue("TextBox").get());
+
CPPUNIT_ASSERT(xTextBox->getPropertyValue("IsFollowingTextFlow").get());
+
+// Parse the layout
+auto pLayout = parseLayoutDump();
+// Get the position of the shape
+const auto nTextBoxShapeLeft = getXPath(pLayout,
+
"/root/page/body/txt/anchored/fly/tab/row[1]/cell/txt/"
+
"anchored/SwAnchoredDrawObject/bounds",
+"left")
+   .toInt64();
+const auto nTextBoxShapeTop = getXPath(pLayout,
+   
"/root/page/body/txt/anchored/fly/tab/row[1]/cell/txt/"
+   
"anchored/SwAnchoredDrawObject/bounds",
+   "top")
+  .toInt64();
+// Get the position of the textframe too.
+const auto nTextBoxFrameLeft
+= getXPath(pLayout,
+   
"/root/page/body/txt/anchored/fly/tab/row[1]/cell/txt/anchored/fly/infos/bounds",
+   "left")
+  .toInt64();
+const auto nTextBoxFrameTop
+= getXPath(pLayout,
+   
"/root/page/body/txt/anchored/fly/tab/row[1]/cell/txt/anchored/fly/infos/bounds",
+   "top")
+  .toInt64();
+
+// Without the fix in place these were less than they supposed to.
+CPPUNIT_ASSERT_GREATEREQUAL(nTextBoxShapeLeft, nTextBoxFrameLeft);
+CPPUNIT_ASSERT_GREATEREQUAL(nTextBoxShapeTop, nTextBoxFrameTop);
+}
+
 CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf138194)
 {
 SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "xaxis-labelbreak.docx");
diff --git a/sw/source/core/doc/textboxhelper.cxx 
b/sw/source/core/doc/textboxhelper.cxx
index 6657a5244305..21da16f5f2d8 100644
--- a/sw/source/core/doc/textboxhelper.cxx
+++ b/sw/source/core/doc/textboxhelper.cxx
@@ -26,9 +26,11 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -1069,6 +1071,9 @@ void SwTextBoxHelper::syncFlyFrameAttr(SwFrameFormat& 
rShape, SfxItemSet const&
 return;
 
 const bool bInlineAnchored = rShape.GetAnchor().GetAnchorId() == 
RndStdIds::FLY_AS_CHAR;
+const bool bLayoutInCell
+= rShape.GetFollowTextFlow().GetValue() && 
rShape.GetAnchor().GetContentAnchor()
+  && 
rShape.GetAnchor().GetContentAnchor()->nNode.GetNode().FindTableNode();
 SfxItemSet aTextBoxSet(pFormat->GetDoc()->GetAttrPool(), 
aFrameFormatSetRange);
 
 SfxItemIter aIter(rSet);
@@ -1085,7 +1090,7 @@ void SwTextBoxHelper::syncFlyFrameAttr(SwFrameFormat& 
rShape, SfxItemSet const&
 = mapAnchorType(rShape.GetAnchor().GetAnchorId());
 syncProperty(&rShape, RES_ANCHOR, MID_ANCHOR_ANCHORTYPE, 
uno::Any(aNewAnchorType),
  pObj);
-if (bInlineAnchored)
+if (bInlineAnchored || bLayoutInCell)
 return;
 SwFormatVertOrient 
aOrient(pItem->StaticWhichCast(RES_VERT_ORIENT));
 
@@ -1115,7 +1120,7 @@ void SwTextBoxHelper::syncFlyFrameAttr(SwFrameFormat& 
rShape, SfxItemSet const

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

2022-03-10 Thread László Németh (via logerrit)
 sw/qa/extras/ooxmlexport/ooxmlexport12.cxx   |   10 +
 sw/qa/extras/ooxmlexport/ooxmlexport16.cxx   |6 -
 sw/source/filter/ww8/docxattributeoutput.cxx |  147 ++-
 3 files changed, 108 insertions(+), 55 deletions(-)

New commits:
commit 64dcedcf7c073d1819794d68a33651b14877e1b5
Author: László Németh 
AuthorDate: Thu Mar 10 11:00:36 2022 +0100
Commit: László Németh 
CommitDate: Thu Mar 10 19:14:04 2022 +0100

tdf#147760 tdf#142902 DOCX export: anonymize date and moveFromRangeStart

Anonymization exported a zeroed w:date in change tracking
and commenting elements w:ins, w:del, w:moveFrom, w:moveTo,
w:cellIns, w:cellDel, w:comment, w:moveFromRangeStart and
w:moveToRangeStart instead of simply skipping it, according
to OOXML.

Also don't export w:date, if the imported DOCX was anonymized
by Word's Document Inspector, i.e. it doesn't contain w:date.

Fix also missing anonymization of author and date of
moveFromRangeStart and moveToRangeStart elements.

Follow-up to commit 2c51746997478ad5d0e7cc64aa6489769c473d43
"tdf#146171 DOCX: fix loss of change tracking, if no date",
commit 9e1e88ad5cf2dc0e9b188c60930445652a6c7519
"tdf#145720 DOCX export: fix loss of tracked moving" and
commit ded2452a52d21131347a0dc2e25c8161f20fcfad
"tdf#142902 DOCX export: remove personal info of comments and changes".

Change-Id: If79402e4723886ceab3b4b9c24e83793f87cd513
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131317
Tested-by: Jenkins
Reviewed-by: László Németh 

diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx
index c568f7228a7b..5d1af7159fcf 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx
@@ -1222,10 +1222,12 @@ DECLARE_OOXMLEXPORT_TEST(testTdf145720, 
"tdf104797.docx")
 u"Tekijä");
 assertXPath(pXmlDoc, 
"/w:document/w:body/w:p[2]/w:moveTo/w:moveToRangeStart", "author",
 u"Tekijä");
-assertXPath(pXmlDoc, 
"/w:document/w:body/w:p[1]/w:moveFrom/w:moveFromRangeStart", "date",
-"1970-01-01T00:00:00Z");
-assertXPath(pXmlDoc, 
"/w:document/w:body/w:p[2]/w:moveTo/w:moveToRangeStart", "date",
-"1970-01-01T00:00:00Z");
+// no date (anonymized change)
+// This failed, date was exported as w:date="0-00-00T00:00:00Z", and 
later "1970-01-01T00:00:00Z"
+assertXPathNoAttribute(pXmlDoc, 
"/w:document/w:body/w:p[1]/w:moveFrom/w:moveFromRangeStart",
+   "date");
+assertXPathNoAttribute(pXmlDoc, 
"/w:document/w:body/w:p[2]/w:moveTo/w:moveToRangeStart",
+   "date");
 }
 }
 
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx
index 543a7580bd79..b1637cfa3ad1 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx
@@ -651,6 +651,7 @@ CPPUNIT_TEST_FIXTURE(Test, 
testTdf146171_invalid_change_date)
 // false alarm? during ODF roundtrip:
 // 'Error: "1970-01-01" does not satisfy the "dateTime" type'
 // disable and check only the conversion of the invalid (zeroed) change 
date
+// -00-00T00:00:00Z, resulting loss of change tracking during ODF 
roundtrip
 // reload("writer8", "tdf146171.odt");
 reload("Office Open XML Text", "tdf146171.docx");
 
@@ -659,8 +660,9 @@ CPPUNIT_TEST_FIXTURE(Test, 
testTdf146171_invalid_change_date)
 assertXPath(pXmlDoc, "//w:ins", 4);
 // This was 0
 assertXPath(pXmlDoc, "//w:del", 1);
-// This was -00-00T00:00:00Z, resulting loss of change tracking during 
ODF roundtrip
-assertXPath(pXmlDoc, "//w:del", "date", "1970-01-01T00:00:00Z");
+// no date (anonymized change)
+// This failed, date was exported as w:date="1970-01-01T00:00:00Z" before 
fixing tdf#147760
+assertXPathNoAttribute(pXmlDoc, "//w:del", "date");
 }
 
 DECLARE_OOXMLEXPORT_TEST(testTdf139580, "tdf139580.odt")
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index a0fd9fd0f995..11e890706e7a 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -1914,16 +1914,32 @@ void 
DocxAttributeOutput::DoWriteBookmarkTagEnd(sal_Int32 const nId)
 void DocxAttributeOutput::DoWriteMoveRangeTagStart(const OString & 
bookmarkName,
 bool bFrom, const SwRedlineData* pRedlineData)
 {
-const OUString &rAuthor( SW_MOD()->GetRedlineAuthor( 
pRedlineData->GetAuthor() ) );
-OString aDate( DateTimeToOString( pRedlineData->GetTimeStamp() ) );
+bool bRemovePersonalInfo = SvtSecurityOptions::IsOptionSet(
+SvtSecurityOptions::EOption::DocWarnRemovePersonalInfo );
 
-m_pSerializer->singleElementNS(XML_w, bFrom
+const OUString &rAuthor( SW_MOD()->Get

[Libreoffice-commits] core.git: Branch 'distro/cib/libreoffice-6-4' - 10 commits - compilerplugins/clang config_host/config_global.h.in desktop/scripts include/o3tl include/sal o3tl/CppunitTest_o3tl_t

2022-03-10 Thread Michael Stahl (via logerrit)
 compilerplugins/clang/stringconcatliterals.cxx  |3 
 config_host/config_global.h.in  |1 
 desktop/scripts/soffice.sh  |4 
 include/o3tl/string_view.hxx|  867 
 include/sal/log.hxx |   41 
 o3tl/CppunitTest_o3tl_tests.mk  |2 
 o3tl/qa/test-string_view.cxx|  212 
 officecfg/registry/schema/org/openoffice/Inet.xcs   |6 
 postprocess/Rdb_services.mk |3 
 sal/osl/all/log.cxx |   42 
 solenv/clang-format/blacklist   |2 
 solenv/gdb/boost/util/printing.py   |2 
 solenv/gdb/libreoffice/util/printing.py |2 
 ucb/CppunitTest_ucb_webdav_core.mk  |1 
 ucb/Library_ucpdav1.mk  |   25 
 ucb/Module_ucb.mk   |2 
 ucb/source/ucp/webdav-curl/CurlSession.cxx  |   31 
 ucb/source/ucp/webdav-curl/DAVProperties.cxx|   36 
 ucb/source/ucp/webdav-curl/DAVProperties.hxx|   26 
 ucb/source/ucp/webdav-curl/DAVResourceAccess.cxx|2 
 ucb/source/ucp/webdav-curl/UCBDeadPropertyValue.cxx |   18 
 ucb/source/ucp/webdav-curl/webdavcontent.cxx|   49 -
 ucb/source/ucp/webdav-curl/webdavcontentcaps.cxx|3 
 ucb/source/ucp/webdav-curl/webdavprovider.cxx   |2 
 ucb/source/ucp/webdav-curl/webdavresponseparser.cxx |2 
 ucb/source/ucp/webdav-neon/ucpdav1.component|5 
 ucb/source/ucp/webdav-neon/webdavprovider.cxx   |   42 
 ucb/source/ucp/webdav-neon/webdavprovider.hxx   |7 
 ucb/source/ucp/webdav-neon/webdavservices.cxx   |   67 -
 ucb/source/ucp/webdav/webdavprovider.cxx|   10 
 30 files changed, 1312 insertions(+), 203 deletions(-)

New commits:
commit 66a15ffedf2e41b25d06a61542434da2948dd4d8
Author: Michael Stahl 
AuthorDate: Thu Mar 10 16:47:16 2022 +0100
Commit: Michael Stahl 
CommitDate: Thu Mar 10 18:09:57 2022 +0100

ucb: add webdav configuration setting

Change-Id: Ifc98baec69e32d231e44b389a870e90debd5a389

diff --git a/officecfg/registry/schema/org/openoffice/Inet.xcs 
b/officecfg/registry/schema/org/openoffice/Inet.xcs
index 76d5d2ed0912..95d38403d19d 100644
--- a/officecfg/registry/schema/org/openoffice/Inet.xcs
+++ b/officecfg/registry/schema/org/openoffice/Inet.xcs
@@ -26,6 +26,12 @@
   
 Contains Internet-related configurations (servers, proxies, 
etc.).
   
+  
+
+  Use curl HTTP/WebDAV UCP instead of neon one.
+
+false
+  
   
 
 
diff --git a/ucb/CppunitTest_ucb_webdav_core.mk 
b/ucb/CppunitTest_ucb_webdav_core.mk
index fbd3f59f55f6..aeea8033fa95 100644
--- a/ucb/CppunitTest_ucb_webdav_core.mk
+++ b/ucb/CppunitTest_ucb_webdav_core.mk
@@ -31,6 +31,7 @@ $(eval $(call 
gb_CppunitTest_use_library_objects,ucb_webdav_core, \
 $(eval $(call gb_CppunitTest_use_externals,ucb_webdav_core,\
boost_headers \
libxml2 \
+   neon \
curl \
 ))
 
diff --git a/ucb/Module_ucb.mk b/ucb/Module_ucb.mk
index 19c1aec96591..cea03c49ec4a 100644
--- a/ucb/Module_ucb.mk
+++ b/ucb/Module_ucb.mk
@@ -31,7 +31,7 @@ $(eval $(call gb_Module_add_targets,ucb,\
 ))
 endif
 
-ifeq ($(WITH_WEBDAV),curl)
+ifeq ($(WITH_WEBDAV),neon)
 
 $(eval $(call gb_Module_add_check_targets,ucb,\
 CppunitTest_ucb_webdav_core \
diff --git a/ucb/source/ucp/webdav-neon/webdavprovider.cxx 
b/ucb/source/ucp/webdav-neon/webdavprovider.cxx
index 40534e80a614..bbe18ecbac61 100644
--- a/ucb/source/ucp/webdav-neon/webdavprovider.cxx
+++ b/ucb/source/ucp/webdav-neon/webdavprovider.cxx
@@ -180,11 +180,21 @@ ContentProvider::queryContent(
 return xContent;
 }
 
+#include 
+
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+ucb_webdav_ContentProvider_get_implementation(
+css::uno::XComponentContext* context, css::uno::Sequence 
const&);
+
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
 ucb_webdav_neon_ContentProvider_get_implementation(
 css::uno::XComponentContext* context, css::uno::Sequence 
const&)
 {
-return cppu::acquire(new ContentProvider(context));
+auto const useCurl(officecfg::Inet::Settings::WebDAVCurl::get(context));
+if (useCurl)
+return ucb_webdav_ContentProvider_get_implementation(context, {});
+else
+return cppu::acquire(new ContentProvider(context));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 0611bf69cde2a22094d9ac190f972777537d8225
Author: Stephan Bergmann 
AuthorDate: Thu Sep 24 09:53:24 2020 +0200
Commit: Michael Stahl 
CommitDate: Thu Mar 10 17:51:42 2022 +0100

Fix Python deprecation warnings

I noticed these "DeprecationWarning: Using or importing the ABCs from
'collections' instead of from 'collections.abc' is deprecated since Python 
3.3,
and in 3.9 it wi

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

2022-03-10 Thread Caolán McNamara (via logerrit)
 sc/source/core/data/documen4.cxx |8 
 1 file changed, 8 insertions(+)

New commits:
commit f79ebdeaaacd08328142eedf048f77e11b035801
Author: Caolán McNamara 
AuthorDate: Thu Mar 10 11:21:02 2022 +
Commit: Caolán McNamara 
CommitDate: Thu Mar 10 17:55:48 2022 +0100

ofz#44982 limit matrices for fuzzing, but allow importing a little

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

diff --git a/sc/source/core/data/documen4.cxx b/sc/source/core/data/documen4.cxx
index b7eecde0edb1..9ec96b77b243 100644
--- a/sc/source/core/data/documen4.cxx
+++ b/sc/source/core/data/documen4.cxx
@@ -271,6 +271,14 @@ void ScDocument::InsertMatrixFormula(SCCOL nCol1, SCROW 
nRow1,
 SAL_WARN("sc", "ScDocument::InsertMatrixFormula: No table marked");
 return;
 }
+if (utl::ConfigManager::IsFuzzing())
+{
+// just too slow
+if (nCol2 - nCol1 > 1024)
+return;
+if (nRow2 - nRow1 > 1024)
+return;
+}
 assert( ValidColRow( nCol1, nRow1) && ValidColRow( nCol2, nRow2));
 
 SCTAB nTab1 = *rMark.begin();


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

2022-03-10 Thread Noel Grandin (via logerrit)
 sw/source/ui/dialog/ascfldlg.cxx   |7 +-
 sw/source/ui/dialog/macassgn.cxx   |5 -
 sw/source/ui/dialog/uiregionsw.cxx |   93 +
 3 files changed, 49 insertions(+), 56 deletions(-)

New commits:
commit 5b218d2c85859209267844398b254b8db6fb9a7e
Author: Noel Grandin 
AuthorDate: Thu Mar 10 10:43:24 2022 +0200
Commit: Noel Grandin 
CommitDate: Thu Mar 10 17:45:30 2022 +0100

use SfxItemSet::GetItemIfSet in sw/.../ui/dialog

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

diff --git a/sw/source/ui/dialog/ascfldlg.cxx b/sw/source/ui/dialog/ascfldlg.cxx
index 20f76efc4f12..1de09d99824b 100644
--- a/sw/source/ui/dialog/ascfldlg.cxx
+++ b/sw/source/ui/dialog/ascfldlg.cxx
@@ -78,14 +78,13 @@ SwAsciiFilterDlg::SwAsciiFilterDlg( weld::Window* pParent, 
SwDocShell& rDocSh,
 aUserItem >>= m_sExtraData;
 }
 
-const SfxPoolItem* pItem;
+const SfxStringItem* pItem;
 OUString sAsciiOptions;
 if( rDocSh.GetMedium() != nullptr &&
 rDocSh.GetMedium()->GetItemSet() != nullptr &&
-SfxItemState::SET == 
rDocSh.GetMedium()->GetItemSet()->GetItemState(
-SID_FILE_FILTEROPTIONS, true, &pItem ))
+(pItem = rDocSh.GetMedium()->GetItemSet()->GetItemIfSet( 
SID_FILE_FILTEROPTIONS )))
 {
-sAsciiOptions = static_cast(pItem)->GetValue();
+sAsciiOptions = pItem->GetValue();
 }
 
 const OUString sFindNm = OUString::createFromAscii(
diff --git a/sw/source/ui/dialog/macassgn.cxx b/sw/source/ui/dialog/macassgn.cxx
index 4e68c8ab8e8e..e4591970a0d1 100644
--- a/sw/source/ui/dialog/macassgn.cxx
+++ b/sw/source/ui/dialog/macassgn.cxx
@@ -120,10 +120,9 @@ bool SwMacroAssignDlg::INetFormatDlg(weld::Window* 
pParent, SwWrtShell& rSh,
 if ( pMacroDlg && pMacroDlg->Execute() == RET_OK )
 {
 const SfxItemSet* pOutSet = pMacroDlg->GetOutputItemSet();
-const SfxPoolItem* pItem;
-if( SfxItemState::SET == pOutSet->GetItemState( RES_FRMMACRO, false, 
&pItem ))
+if( const SvxMacroItem* pItem = pOutSet->GetItemIfSet( RES_FRMMACRO, 
false ))
 {
-*rpINetItem = static_cast(pItem)->GetMacroTable();
+rpINetItem.emplace(pItem->GetMacroTable());
 bRet = true;
 }
 }
diff --git a/sw/source/ui/dialog/uiregionsw.cxx 
b/sw/source/ui/dialog/uiregionsw.cxx
index 6e45abc1c697..68182fa018d5 100644
--- a/sw/source/ui/dialog/uiregionsw.cxx
+++ b/sw/source/ui/dialog/uiregionsw.cxx
@@ -1028,49 +1028,47 @@ IMPL_LINK_NOARG(SwEditRegionDlg, OptionsHdl, 
weld::Button&, void)
 if( !(pOutSet && pOutSet->Count()) )
 return;
 
-const SfxPoolItem *pColItem, *pBrushItem,
-  *pFootnoteItem, *pEndItem, *pBalanceItem,
-  *pFrameDirItem, *pLRSpaceItem;
-SfxItemState eColState = pOutSet->GetItemState(
-RES_COL, false, &pColItem );
-SfxItemState eBrushState = pOutSet->GetItemState(
-RES_BACKGROUND, false, &pBrushItem );
-SfxItemState eFootnoteState = pOutSet->GetItemState(
-RES_FTN_AT_TXTEND, false, &pFootnoteItem );
-SfxItemState eEndState = pOutSet->GetItemState(
-RES_END_AT_TXTEND, false, &pEndItem );
-SfxItemState eBalanceState = pOutSet->GetItemState(
-RES_COLUMNBALANCE, false, &pBalanceItem );
-SfxItemState eFrameDirState = pOutSet->GetItemState(
-RES_FRAMEDIR, false, &pFrameDirItem );
-SfxItemState eLRState = pOutSet->GetItemState(
-RES_LR_SPACE, false, &pLRSpaceItem);
-
-if( !(SfxItemState::SET == eColState ||
-SfxItemState::SET == eBrushState ||
-SfxItemState::SET == eFootnoteState ||
-SfxItemState::SET == eEndState ||
-SfxItemState::SET == eBalanceState||
-SfxItemState::SET == eFrameDirState||
-SfxItemState::SET == eLRState))
+const SwFormatCol* pColItem = pOutSet->GetItemIfSet(
+RES_COL, false );
+const SvxBrushItem* pBrushItem = pOutSet->GetItemIfSet(
+RES_BACKGROUND, false );
+const SwFormatFootnoteAtTextEnd* pFootnoteItem = pOutSet->GetItemIfSet(
+RES_FTN_AT_TXTEND, false );
+const SwFormatEndAtTextEnd* pEndItem = pOutSet->GetItemIfSet(
+RES_END_AT_TXTEND, false );
+const SwFormatNoBalancedColumns* pBalanceItem = pOutSet->GetItemIfSet(
+RES_COLUMNBALANCE, false );
+const SvxFrameDirectionItem* pFrameDirItem = pOutSet->GetItemIfSet(
+RES_FRAMEDIR, false );
+const SvxLRSpaceItem* pLRSpaceItem = pOutSet->GetItemIfSet(
+

ESC meeting minutes: 2022-03-10

2022-03-10 Thread Miklos Vajna

* Present:
+ Stephan, Olivier, Michael W, Hossein, Cloph, Caolan, Michael S, Sophie, 
Miklos, Heiko, Xisco, Eike

* Completed Action Items:
+ update api.libreoffice.org to 7.3 (Cloph)

* Pending Action Items:
+ None

* Release Engineering update (Cloph)
+ 7.3 status: 7.3.2 rc1 is tagged, builds are in progress
+ 7.2 status: 7.2.6 is announced as final today, 7.2.7 rc1 in 6 weeks
+ Remotes: Android, iOS
+ Android viewer

* Documentation (Olivier)
+ New Help
   + internal updte of tools used
+ Helpcontents2
   + Updates in ScriptForge Help (R. Lima)
   + Typos and fixes (J Nabet. ohallot)
+ Guides
   + Progress in Guides (Doc team)

+ Bugzilla Documentation statistics
240(240) bugs open
+ Updates:
BZ changes   1 week   1 month   3 months   12 months
   created 8(3) 34(-6)122(0)  325(-7)
 commented 7(-14)   82(-29)   405(-12)   1601(-52)
  resolved 4(2) 13(0)  56(-1) 201(-2)
+ top 10 contributors:
  Olivier Hallot made 21 changes in 1 month, and 505 changes in 1 year
  Kaganski, Mike made 15 changes in 1 month, and 96 changes in 1 year
  Heiko Tietze made 14 changes in 1 month, and 87 changes in 1 year
  Xisco Fauli made 12 changes in 1 month, and 92 changes in 1 year
  Rafael Lima made 10 changes in 1 month, and 375 changes in 1 year
  Michael Warner made 9 changes in 1 month, and 10 changes in 1 year
  Timur made 6 changes in 1 month, and 80 changes in 1 year
  Ilmari Lauhakangas made 5 changes in 1 month, and 106 changes in 1 
year
  Raal made 5 changes in 1 month, and 7 changes in 1 year
  Nabet, Julien made 4 changes in 1 month, and 66 changes in 1 year

* UX Update (Heiko)
+ Bugzilla (topicUI) statistics
263(263) (topicUI) bugs open, 86(86) (needsUXEval) needs to be 
evaluated by the UXteam
+ Updates:
BZ changes   1 week   1 month3 months   12 months
 added  9(9) 10(4)  18(5)   54(7)
 commented 95(62)   245(28)632(8) 2803(33)
   removed  2(1)  8(2)  14(0)   38(2)
  resolved  7(-3)41(-12)   104(-4) 410(4)
+ top 10 contributors:
  Heiko Tietze made 207 changes in 1 month, and 1951 changes in 1 year
  Eyal Rozenberg made 39 changes in 1 month, and 159 changes in 1 year
  Dieter made 35 changes in 1 month, and 252 changes in 1 year
  Seth Chaiklin made 24 changes in 1 month, and 107 changes in 1 year
  Telesto made 18 changes in 1 month, and 274 changes in 1 year
  Ilmari Lauhakangas made 17 changes in 1 month, and 288 changes in 1 
year
  Albrecht Müller made 14 changes in 1 month, and 20 changes in 1 year
  Foote, V Stuart made 14 changes in 1 month, and 483 changes in 1 year
  Cor Nouws made 12 changes in 1 month, and 30 changes in 1 year
  kabilo made 12 changes in 1 month, and 21 changes in 1 year
+ New tickets with needsUXEval Mar/04-10
  [Bug 43928] EDITING Forms - tabstops in tablecontrols could not be changed
  [Bug 147574] Resolve state isn't tracked by track changes
  [Bug 147858] CSV import: "String delimiter" drop-down needs indication 
that
   it's editable
  [Bug 132309] UI: List Level in dialog Tools > Chapter Numbering is hard
   to reach with keyboard: TAB-order forces many extra tabbing
   in common use case (GTK3)
  [Bug 147834] When 'next' style is different, clear numbering and bulleting
  [Bug 147841] Make "Click to add Title" box the focus on Slide layout
  [Bug 147566] Search slot does not warn that formatting has been applied
  [Bug 35030] Customize Keyboard Reset button doesn't work
  [Bug 82195] Support split-pane view
  [Bug 147814] Tabs dialog shows Left, Right but they're really Start, End
  ->  [Bug 147812] When an Undo only affects out-of-view content, scroll there 
instead
  + current behavior is consistent with what editors / MSO does (Miklos)
  + agreed (Cloph)
  [Bug 147807] Limiting to selected category limits to the category of
selected item in tree
  [Bug 147784] Poor choice of hyperlink categories: "Internet" and "email"
  [Bug 147779] Ability to select or to delete unused styles
  [Bug 147769] No ability to select all content with a specific style



* Crash Testing (Caolan)
+ 10(-3) import failure, 3(-2) export failures
+ 1 coverity issues
  - reverted back to previous coverity instance after fixing the legitimate 
looking wheat in the current release from the heap of noise
+ 18 ossfuzz issues
  - three newly extended fuzzers working hard

* Crash Reporting (Xisco)
   + https://crashreport.libreoffice.org/stats/version/7.2.5.2
 + (-6) 1852 1858 2096 1778 1776 1707 1860 1608 1246 691 0
   + https://crashreport.libre

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

2022-03-10 Thread Jean-Pierre Ledure (via logerrit)
 wizards/source/scriptforge/SF_Exception.xba |   13 ++---
 wizards/source/scriptforge/SF_Root.xba  |   28 +---
 wizards/source/scriptforge/SF_Utils.xba |6 ++
 3 files changed, 29 insertions(+), 18 deletions(-)

New commits:
commit 511cc0cd621ebdc67fdfbd440d098b2d1c23dc58
Author: Jean-Pierre Ledure 
AuthorDate: Thu Mar 10 12:10:51 2022 +0100
Commit: Jean-Pierre Ledure 
CommitDate: Thu Mar 10 16:26:11 2022 +0100

ScriptForge - (SF_Root) differ loading of the localized interface

So far, the loading of the user interface in the user's
own language was done at the first invocation of
ScriptForge, usually via
- a CreateScriptService() method
- a direct call to any method, f.i. SF_Array.Append()

Now the same loading of the user interface in memory
is done at the first request of a localized text or message.

Due to the fact that since last commit
   https://gerrit.libreoffice.org/c/core/+/131255
only error messages contain localized texts,
the benefit is that correct scripts will not load any
unnecessary texts anymore.

The "Interface" variable has be renamed "LocalizedInterface"
for clarity in the SF_Root class module

No impact on documentation or Python scripts.

Change-Id: Ie654625540c0c8f8442e9ba36d38ecaab00c0eb1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131313
Tested-by: Jean-Pierre Ledure 
Tested-by: Jenkins
Reviewed-by: Jean-Pierre Ledure 

diff --git a/wizards/source/scriptforge/SF_Exception.xba 
b/wizards/source/scriptforge/SF_Exception.xba
index 2af37d9534f2..aeac2fb91aab 100644
--- a/wizards/source/scriptforge/SF_Exception.xba
+++ b/wizards/source/scriptforge/SF_Exception.xba
@@ -612,7 +612,7 @@ Public Sub Raise(Optional ByVal Number As Variant _
 ''' SF_Exception.Raise(,, "To divide 
by zero is not a good idea !")
 
 Dim sMessage As String '  Error message to log and to 
display
-Dim L10N As Object '  Alias to Interface
+Dim L10N As Object '  Alias to 
LocalizedInterface
 Const cstThisSub = "Exception.Raise"
 Const cstSubArgs = "[Number=Err], [Source=Erl], [Description]"
 
@@ -641,7 +641,7 @@ Try:
If Len(Description) > 0 Then .Description = Description
 
'  Log and display
-   Set L10N = _SF_.Interface
+   Set L10N = _SF_._GetLocalizedInterface()
sMessage = L10N.GetText("LONGERRORDESC", .Number, 
.Source, .Description)
.DebugPrint(sMessage)
If _SF_.DisplayEnabled Then MsgBox 
L10N.GetText("ERRORNUMBER", .Number) _
@@ -675,7 +675,7 @@ Public Sub RaiseAbort(Optional ByVal Source As Variant)
 Dim sLocation As String'  Common header in error 
messages: location of error
 Dim vLocation As Variant   '  Split array (library, module, method)
 Dim sMessage As String '  Error message to log and to display
-Dim L10N As Object '  Alias to Interface
+Dim L10N As Object '  Alias to LocalizedInterface
 Const cstTabSize = 4
 Const cstThisSub = "Exception.RaiseAbort"
 Const cstSubArgs = "[Source=Erl]"
@@ -691,7 +691,7 @@ Try:
With SF_Exception
 
'  Prepare message header
-   Set L10N = _SF_.Interface
+   Set L10N = _SF_._GetLocalizedInterface()
If Len(_SF_.MainFunction) > 0 Then   '  MainFunction = 
[Library.]Module.Method
vLocation = Split(_SF_.MainFunction, ".")
If UBound(vLocation) < 2 Then vLocation = 
SF_Array.Prepend(vLocation, "ScriptForge")
@@ -701,7 +701,6 @@ Try:
End If
 
'  Log and display
-   Set L10N = _SF_.Interface
sMessage = L10N.GetText("LONGERRORDESC", .Number, 
.Source, .Description)
.DebugPrint(sMessage)
If _SF_.DisplayEnabled Then
@@ -741,7 +740,7 @@ Dim sService As String  '  Service name 
having detected the error
 Dim sMethod As String  '  Method name having detected the error
 Dim vLocation As Variant   '  Split array (library, module, method)
 Dim sMessage As String '  Message to log and display
-Dim L10N As Object '  Alias of Interface
+Dim L10N As Object '  Alias of LocalizedInterface
 Dim sAlt As String '  Alternative error messages
 Dim iButtons As Integer'  MB_OK or MB_YESNO
 Dim iMsgBox As Integer '  Return value of the message box
@@ -760,7 +759,7 @@ Check:
End If
 
 Try:
-   Set L10N = _SF_.Interface
+   Set L10N = _SF_._GetLocalizedInterface()
'  Location header common to all error messages
If Len(_SF_.MainFunction) > 0 Then   '  MainFunction = 
[Library.]Module.Method
vLocation = Split(_S

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

2022-03-10 Thread Caolán McNamara (via logerrit)
 hwpfilter/source/hwpreader.cxx |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 3edb855e7c0e2ac0d49fa38654efd92c3618ed8f
Author: Caolán McNamara 
AuthorDate: Thu Mar 10 09:12:29 2022 +
Commit: Caolán McNamara 
CommitDate: Thu Mar 10 15:36:41 2022 +0100

ofz#45385 Integer-overflow

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

diff --git a/hwpfilter/source/hwpreader.cxx b/hwpfilter/source/hwpreader.cxx
index 89609e65fd5f..60af8216f97b 100644
--- a/hwpfilter/source/hwpreader.cxx
+++ b/hwpfilter/source/hwpreader.cxx
@@ -3858,8 +3858,6 @@ void HwpReader::makePicture(Picture * hbox)
 
 void HwpReader::makePictureDRAW(HWPDrawingObject *drawobj, const Picture* hbox)
 {
-int x = hbox->pgx;
-int y = hbox->pgy;
 bool bIsRotate = false;
 
 while (drawobj)
@@ -3897,6 +3895,9 @@ void HwpReader::makePictureDRAW(HWPDrawingObject 
*drawobj, const Picture* hbox)
 }
 else
 {
+double x = hbox->pgx;
+double y = hbox->pgy;
+
 bIsRotate = false;
 if( (drawobj->property.flag & HWPDO_FLAG_ROTATION) &&
 (drawobj->property.parall.pt[0].y != 
drawobj->property.parall.pt[1].y) &&


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

2022-03-10 Thread Caolán McNamara (via logerrit)
 vcl/source/gdi/TypeSerializer.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 9929849f2d95fa83cbbd322169f8cf8756b30c75
Author: Caolán McNamara 
AuthorDate: Thu Mar 10 10:33:05 2022 +
Commit: Caolán McNamara 
CommitDate: Thu Mar 10 15:36:08 2022 +0100

ofz#45424 Integer-overflow

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

diff --git a/vcl/source/gdi/TypeSerializer.cxx 
b/vcl/source/gdi/TypeSerializer.cxx
index 1d28b597a15d..3a7eb6859e22 100644
--- a/vcl/source/gdi/TypeSerializer.cxx
+++ b/vcl/source/gdi/TypeSerializer.cxx
@@ -441,7 +441,9 @@ void TypeSerializer::readMapMode(MapMode& rMapMode)
 readFraction(aScaleY);
 mrStream.ReadCharAsBool(bSimple);
 
-const bool bBogus = !aScaleX.IsValid() || !aScaleY.IsValid();
+const bool bBogus = !aScaleX.IsValid() || !aScaleY.IsValid()
+|| aScaleX.GetNumerator() == 
std::numeric_limits::min()
+|| aScaleY.GetNumerator() == 
std::numeric_limits::min();
 SAL_WARN_IF(bBogus, "vcl", "invalid scale");
 
 if (bSimple || bBogus)


Minutes from the UX/design meeting 2022-Mar-10

2022-03-10 Thread Heiko Tietze

Present: LibreOffice Enthusiast, Alexandr, Rizal, Heiko
Comments: Regina, Miklos, Telesto, Ilmari, Mike, Dieter, Eyal, Jan

Tickets/Topics

 * wrong term for gutter position in mirrored page layout
   + https://bugs.documentfoundation.org/show_bug.cgi?id=140561
   + rename to "Left" to "Inner" (Regina)
 + "left" is easier to understand (for LTR users) so we ideally
   use "Inner (Left)" for LTR and "Inner (Right)" for RTL
   + explanation of feature in c10 (Miklos)
   + suggest to use radio buttons with clear alternatives (Heiko)
   => let's do it / easyhackable

 * Deleting first paragraph of a document deletes anchored to object
   + https://bugs.documentfoundation.org/show_bug.cgi?id=132279
   + unclear situation with wfm (Telesto in c6) and
 never worked (Ilmari, c7)
   + bug 124338 requests the opposite (Mike, c9)
   + "As Character" just delete, "To Character" mark/highlight the object
 first and require a second backspace to actually delete (similar to
 "To Paragraph") and "To Page" don't deleted at all (unless explicitly
 selected) (Heiko)
   + some other, more complex issue (Dieter, c13ff)
   => no further input, remove UX

 * Limiting to selected category limits to the category of selected
   item in tree
   + https://bugs.documentfoundation.org/show_bug.cgi?id=147807
   + add label before the "Navigate By" dropdown and
 auto select the category when clicking at the tree (Eyal, c9)
 + adding a label before the dropdown occupies a lot of space
 + might be solved by the request to move the page number into another row
   + picking an entry in the Navigator list should select the appropriate
 item in the "Navigate By" dropdown and vice versa, if possible
   => go for it

 * When an Undo only affects out-of-view content, scroll there instead
   + https://bugs.documentfoundation.org/show_bug.cgi?id=147812
   + leads to inconsistency and is unexpected for long-term users
   + not applying Undo not always makes clear what exactly has been changed
 (eg. delete a word on a page)
   + we give feedback by highlighting the undone part
   => NAB/WF

 * No ability to select all content with a specific style
   + https://bugs.documentfoundation.org/show_bug.cgi?id=147769
   + supposed workflow with Find & Replace is inconvenient (Jan)
   + to select paragraphs in order to modify the formatting is
 not straight-forward
   + multi-selection makes is error-prone due to overwriting
   => recommend to not do it


OpenPGP_signature
Description: OpenPGP digital signature


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

2022-03-10 Thread Michael Stahl (via logerrit)
 sw/inc/swrect.hxx  |2 -
 sw/source/core/text/widorp.cxx |   42 +
 2 files changed, 43 insertions(+), 1 deletion(-)

New commits:
commit 5099c72ea8bfd469bf6e6ab9f8f47f447ab717f3
Author: Michael Stahl 
AuthorDate: Thu Mar 10 12:49:56 2022 +0100
Commit: Michael Stahl 
CommitDate: Thu Mar 10 14:31:29 2022 +0100

sw: downgrade "SVRect() without Width or Height" to SAL_INFO

This occurs 2500 times in CppunitTest logs.

Change-Id: I946ed240d978f1588ca3bc51c82407cba85e8e1a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131316
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/sw/inc/swrect.hxx b/sw/inc/swrect.hxx
index b4db7384f456..eeb02df23c95 100644
--- a/sw/inc/swrect.hxx
+++ b/sw/inc/swrect.hxx
@@ -291,7 +291,7 @@ inline SwRect &SwRect::operator-=( const Point &rPt )
 // other
 inline tools::Rectangle SwRect::SVRect() const
 {
-SAL_WARN_IF( IsEmpty(), "sw", "SVRect() without Width or Height" );
+SAL_INFO_IF( IsEmpty(), "sw.core", "SVRect() without Width or Height" );
 return tools::Rectangle( m_Point.getX(), m_Point.getY(),
 m_Point.getX() + m_Size.getWidth() - 1, //Right()
 m_Point.getY() + m_Size.getHeight() - 1 );  //Bottom()
commit c79bf7865bff4e88cc201357370d8faeef8e6ad9
Author: Michael Stahl 
AuthorDate: Wed Mar 9 15:24:50 2022 +0100
Commit: Michael Stahl 
CommitDate: Thu Mar 10 14:31:17 2022 +0100

(related: tdf#139687) sw: ignore following footnotes in SwTextFrameBreak

With the fix it now happens that after SwUndoDelete there is a gap at
the bottom of page 21 and the paragraph at the bottom of it is split
with 2 lines ("(here, wisdom), " etc.) on page 22.

This is because when this SwTextFrame 1927 is formatted, there are next
frames also on the page and those have footnotes on the page.

These footnotes take up space and so SwTextFrameBreak::IsInside()
breaks off the last 2 lines (1 may still fit but it has 2 widorp).

A similar problem was fixed in commit 
391613785ae6fbb735cf7a86ea2f6a93161a8769
for footnotes anchored in follow of the current frame, but here
RemoveFootnotes() cannot be used as it requires the next frame to
already have moved to a different footnote boss, which clearly hasn't
happened yet.

So try something similar to commit e37ffdd118da2d21c5e78e8c7b67252d0d1adc8c
and count the space taken by such footnotes as available for the text
frame.

Change-Id: I8f4c1332dc471a68539306a8788a0f59d0b12b1d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131256
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/sw/source/core/text/widorp.cxx b/sw/source/core/text/widorp.cxx
index 526f4ea1b794..f6b9ba20184f 100644
--- a/sw/source/core/text/widorp.cxx
+++ b/sw/source/core/text/widorp.cxx
@@ -135,6 +135,48 @@ bool SwTextFrameBreak::IsInside( SwTextMargin const &rLine 
) const
 // If everything is inside the existing frame the result is true;
 bFit = nDiff >= 0;
 
+// If it didn't fit, try to add the space of footnotes that are 
anchored
+// in frames below (in next-chain of) this one as they will need to 
move
+// forward anyway if this frame is split.
+// - except if in tables (need to check if row is splittable?
+//   also, multiple columns looks difficult)
+if (!bFit && !m_pFrame->IsInTab())
+{
+if (SwFootnoteBossFrame const*const pBoss = 
m_pFrame->FindFootnoteBossFrame())
+{
+if (SwFootnoteContFrame const*const pCont = 
pBoss->FindFootnoteCont())
+{
+SwContentFrame const* pContent(m_pFrame);
+while (pContent->HasFollow())
+{
+pContent = pContent->GetFollow();
+}
+// start with first text frame that isn't a follow
+// (ignoring Keep attribute for now, MakeAll should handle 
it?)
+pContent = pContent->GetNextContentFrame();
+::std::set nextFrames;
+while (pBoss->IsAnLower(pContent))
+{
+nextFrames.insert(pContent);
+pContent = pContent->GetNextContentFrame();
+}
+SwTwips nNextFootnotes(0);
+for (SwFootnoteFrame const* pFootnote = 
static_cast(pCont->Lower());
+ pFootnote != nullptr;
+ pFootnote = static_cast(pFootnote->GetNext()))
+{
+SwContentFrame const*const pAnchor = 
pFootnote->GetRef();
+if (nextFrames.find(pAnchor) != nextFrames.end())
+{
+nNextFootnotes += 
aRectFnSet.GetHeight(pFootnote->getFrame

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

2022-03-10 Thread Xisco Fauli (via logerrit)
 starmath/qa/extras/data/tdf137008.mml |1 +
 starmath/qa/extras/mmlimport-test.cxx |8 
 2 files changed, 9 insertions(+)

New commits:
commit 84590ee3a9b681408d174449bf0cd3f9bd92e4e6
Author: Xisco Fauli 
AuthorDate: Thu Mar 10 11:59:07 2022 +0100
Commit: Xisco Fauli 
CommitDate: Thu Mar 10 14:09:48 2022 +0100

tdf#137008: starmath_import: Add unittest

Change-Id: I4daadf45124331a2fb3b2ba28858c2cfe7c6950e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131312
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 

diff --git a/starmath/qa/extras/data/tdf137008.mml 
b/starmath/qa/extras/data/tdf137008.mml
new file mode 100644
index ..bc6ee25db3e6
--- /dev/null
+++ b/starmath/qa/extras/data/tdf137008.mml
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/starmath/qa/extras/mmlimport-test.cxx 
b/starmath/qa/extras/mmlimport-test.cxx
index d953e518430c..323b0e0fb2d4 100644
--- a/starmath/qa/extras/mmlimport-test.cxx
+++ b/starmath/qa/extras/mmlimport-test.cxx
@@ -39,6 +39,7 @@ public:
 void testtdf99556();
 void testTdf103430();
 void testTdf103500();
+void testTdf137008();
 void testMathmlEntities();
 
 CPPUNIT_TEST_SUITE(Test);
@@ -50,6 +51,7 @@ public:
 CPPUNIT_TEST(testtdf99556);
 CPPUNIT_TEST(testTdf103430);
 CPPUNIT_TEST(testTdf103500);
+CPPUNIT_TEST(testTdf137008);
 CPPUNIT_TEST(testMathmlEntities);
 CPPUNIT_TEST_SUITE_END();
 
@@ -169,6 +171,12 @@ void Test::testTdf103500()
  mxDocShell->GetText());
 }
 
+void Test::testTdf137008()
+{
+// Without the fix in place, this test would have crashed
+
loadURL(m_directories.getURLFromSrc(u"starmath/qa/extras/data/tdf137008.mml"));
+CPPUNIT_ASSERT_EQUAL(OUString("matrix{ { } # ## # }"), 
mxDocShell->GetText());
+}
 void Test::testMathmlEntities()
 {
 
loadURL(m_directories.getURLFromSrc(u"starmath/qa/extras/data/mthmlentities.mml"));


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

2022-03-10 Thread Attila Bakos (NISZ) (via logerrit)
 sw/qa/extras/odfimport/data/tdf146597.odt |binary
 sw/qa/extras/odfimport/odfimport.cxx  |6 ++
 sw/source/core/draw/dcontact.cxx  |5 -
 3 files changed, 10 insertions(+), 1 deletion(-)

New commits:
commit d691e9ef4d77cf5e46aec288d5efcf9291534352
Author: Attila Bakos (NISZ) 
AuthorDate: Thu Feb 24 09:51:15 2022 +0100
Commit: László Németh 
CommitDate: Thu Mar 10 13:34:41 2022 +0100

tdf#146597 sw: fix freezing with GroupShape

in case it is anchored to character and wrap is none.

Regression from 8da3586cff9cc11cf5db985d19851f21f0d42eb8
"tdf#141220 sw: fix textbox popped out of off-page shape".

Note: This is a backport-compatible fix made also for the
7.3 backport. There will be a less urgent 7.4-only fix
for its unresolved group case soon.

Change-Id: I421c85e2dd16ad2649bc299fc4733d462be8d7b7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130478
Tested-by: László Németh 
Reviewed-by: László Németh 
(cherry picked from commit e835c2c0d3aff4f1ee5d29c9eaf36400b1aca6a7)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130456
Tested-by: Jenkins
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130715
Reviewed-by: Attila Bakos 

diff --git a/sw/qa/extras/odfimport/data/tdf146597.odt 
b/sw/qa/extras/odfimport/data/tdf146597.odt
new file mode 100644
index ..6dcc379cef4d
Binary files /dev/null and b/sw/qa/extras/odfimport/data/tdf146597.odt differ
diff --git a/sw/qa/extras/odfimport/odfimport.cxx 
b/sw/qa/extras/odfimport/odfimport.cxx
index bd936937475d..c1ec472f405d 100644
--- a/sw/qa/extras/odfimport/odfimport.cxx
+++ b/sw/qa/extras/odfimport/odfimport.cxx
@@ -1322,5 +1322,11 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf146257)
 }
 }
 
+CPPUNIT_TEST_FIXTURE(Test, testTdf146597)
+{
+load(mpTestDocumentPath, "tdf146597.odt");
+// This was creashed before.
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx
index ad377073a58e..e4d2450629c8 100644
--- a/sw/source/core/draw/dcontact.cxx
+++ b/sw/source/core/draw/dcontact.cxx
@@ -1338,7 +1338,10 @@ void SwDrawContact::Changed_( const SdrObject& rObj,
 
 // tdf#135198: keep text box together with its shape
 const SwPageFrame* rPageFrame = pAnchoredDrawObj->GetPageFrame();
-if (rPageFrame && rPageFrame->isFrameAreaPositionValid())
+auto pFormat = GetFormat();
+if (rPageFrame && rPageFrame->isFrameAreaPositionValid() && pFormat
+&& (SwTextBoxHelper::isTextBox(pFormat, RES_FLYFRMFMT) ||
+SwTextBoxHelper::isTextBox(pFormat, RES_DRAWFRMFMT)))
 {
 SwDoc* const pDoc = GetFormat()->GetDoc();
 


[Libreoffice-commits] core.git: uitest/math_tests

2022-03-10 Thread Xisco Fauli (via logerrit)
 uitest/math_tests/start.py |   12 
 1 file changed, 12 insertions(+)

New commits:
commit 9b52e7ab543406783a1535d03856a8b13b554a70
Author: Xisco Fauli 
AuthorDate: Thu Mar 10 11:48:37 2022 +0100
Commit: Xisco Fauli 
CommitDate: Thu Mar 10 13:10:39 2022 +0100

tdf#140386: math: Add UItest

Change-Id: I7347619ce190778ca12e5bb56c23600efad3af95
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131311
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 

diff --git a/uitest/math_tests/start.py b/uitest/math_tests/start.py
index 08914f9954eb..a7e5ac6fdccd 100644
--- a/uitest/math_tests/start.py
+++ b/uitest/math_tests/start.py
@@ -19,6 +19,18 @@ import platform
 
 class SimpleMathTest(UITestCase):
 
+def test_math_unoCommand(self):
+with self.ui_test.create_doc_in_start_center("math"):
+
+xMathDoc = self.xUITest.getTopFocusWindow()
+
+# tdf#140386
+
self.xUITest.executeCommand(".uno:InsertCommandText?Text:string=backepsilon")
+
+xEditView = xMathDoc.getChild("editview")
+
+self.assertEqual("backepsilon", 
get_state_as_dict(xEditView)["Text"])
+
 def test_math_edit(self):
 with self.ui_test.create_doc_in_start_center("math"):
 


[Libreoffice-commits] core.git: uitest/math_tests

2022-03-10 Thread Xisco Fauli (via logerrit)
 uitest/math_tests/start.py |   55 ++---
 1 file changed, 13 insertions(+), 42 deletions(-)

New commits:
commit 5a348c9881c1574604d0e6dcb9ea4fbfebcc7e21
Author: Xisco Fauli 
AuthorDate: Thu Mar 10 11:41:25 2022 +0100
Commit: Xisco Fauli 
CommitDate: Thu Mar 10 13:10:04 2022 +0100

uitest: math: at least execute the test on linux

besides, fix it and remove duplicated tests

Change-Id: I15c6696c6cdd1c7e03647e105d8caf268555018a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131310
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 

diff --git a/uitest/math_tests/start.py b/uitest/math_tests/start.py
index 13d26641b0a6..08914f9954eb 100644
--- a/uitest/math_tests/start.py
+++ b/uitest/math_tests/start.py
@@ -15,52 +15,23 @@ from uitest.framework import UITestCase
 from uitest.uihelper.common import type_text, select_pos
 
 import unittest
+import platform
 
 class SimpleMathTest(UITestCase):
 
-def test_start_math(self):
-
-with self.ui_test.create_doc_in_start_center("math"):
-
-xMathDoc = self.xUITest.getTopFocusWindow()
-
-
-def test_docking_window_listbox(self):
-
-with self.ui_test.create_doc_in_start_center("math"):
-
-xMathDoc = self.xUITest.getTopFocusWindow()
-
-xList = xMathDoc.getChild("listbox")
-state = get_state_as_dict(xList)
-self.assertEqual(state["SelectEntryText"], "Unary/Binary 
Operators")
-select_pos(xList, "1")
-state = get_state_as_dict(xList)
-self.assertEqual(state["SelectEntryText"], "Relations")
-
-
 def test_math_edit(self):
 with self.ui_test.create_doc_in_start_center("math"):
 
 xMathDoc = self.xUITest.getTopFocusWindow()
 
-xMathEdit = xMathDoc.getChild("math_edit")
-
-type_text(xMathEdit, "E=mc^2")
-
-
-def test_math_selector(self):
-with self.ui_test.create_doc_in_start_center("math"):
-
-xMathDoc = self.xUITest.getTopFocusWindow()
-
-xMathSelector = xMathDoc.getChild("element_selector")
+xEditView = xMathDoc.getChild("editview")
 
-xElement = xMathSelector.getChild("1")
-xElement.executeAction("SELECT", tuple())
+type_text(xEditView, "E=mc^2")
+xMathEdit = xMathDoc.getChild("editview")
 
+self.assertEqual("E=mc^2", get_state_as_dict(xEditView)["Text"])
 
-@unittest.skip("on windows the f4 does not always work")
+@unittest.skipIf(platform.system() == "Windows", "on windows the f4 does 
not always work")
 def test_complete_math(self):
 with self.ui_test.create_doc_in_start_center("math"):
 
@@ -70,19 +41,19 @@ class SimpleMathTest(UITestCase):
 state = get_state_as_dict(xList)
 self.assertEqual(state["SelectEntryText"], "Unary/Binary 
Operators")
 select_pos(xList, "1")
+state = get_state_as_dict(xList)
+self.assertEqual(state["SelectEntryText"], "Relations")
 
 xMathSelector = xMathDoc.getChild("element_selector")
 
 xElement = xMathSelector.getChild("1")
 xElement.executeAction("SELECT", tuple())
 
-xMathEdit = xMathDoc.getChild("math_edit")
-type_text(xMathEdit, "1")
-xMathEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"F4"}))
-type_text(xMathEdit, "2")
-
-edit_state = get_state_as_dict(xMathEdit)
-self.assertEqual("1 <> 2 ", edit_state["Text"])
+xEditView = xMathDoc.getChild("editview")
+type_text(xEditView, "1")
+xEditView.executeAction("TYPE", mkPropertyValues({"KEYCODE":"F4"}))
+type_text(xEditView, "2")
 
+self.assertEqual("1 <> 2 ", get_state_as_dict(xEditView)["Text"])
 
 # vim: set shiftwidth=4 softtabstop=4 expandtab:


[Libreoffice-commits] core.git: 2 commits - hwpfilter/source vcl/source

2022-03-10 Thread Caolán McNamara (via logerrit)
 hwpfilter/source/hwpreader.cxx  |4 +---
 hwpfilter/source/hwpreader.hxx  |2 +-
 vcl/source/filter/svm/SvmReader.cxx |   12 
 3 files changed, 14 insertions(+), 4 deletions(-)

New commits:
commit b8e3c05261b0658fcb27c3cc12c7c0646e5aa983
Author: Caolán McNamara 
AuthorDate: Thu Mar 10 09:10:29 2022 +
Commit: Caolán McNamara 
CommitDate: Thu Mar 10 12:14:41 2022 +0100

can be const

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

diff --git a/hwpfilter/source/hwpreader.cxx b/hwpfilter/source/hwpreader.cxx
index 0db70d2aa685..89609e65fd5f 100644
--- a/hwpfilter/source/hwpreader.cxx
+++ b/hwpfilter/source/hwpreader.cxx
@@ -3856,7 +3856,7 @@ void HwpReader::makePicture(Picture * hbox)
 }
 }
 
-void HwpReader::makePictureDRAW(HWPDrawingObject *drawobj, Picture * hbox)
+void HwpReader::makePictureDRAW(HWPDrawingObject *drawobj, const Picture* hbox)
 {
 int x = hbox->pgx;
 int y = hbox->pgy;
@@ -4413,7 +4413,6 @@ void HwpReader::makePictureDRAW(HWPDrawingObject 
*drawobj, Picture * hbox)
 }
 }
 
-
 void HwpReader::makeLine()
 {
 mxList->addAttribute("text:style-name", sXML_CDATA, "Horizontal Line");
@@ -4421,7 +4420,6 @@ void HwpReader::makeLine()
 mxList->clear();
 }
 
-
 /**
  * Input-comment-hidden description: shows a hidden explanation to the users.
  * Parse out only strings, but it may contain paragraphs.
diff --git a/hwpfilter/source/hwpreader.hxx b/hwpfilter/source/hwpreader.hxx
index 699ea331c1a7..0cb9e62c0c19 100644
--- a/hwpfilter/source/hwpreader.hxx
+++ b/hwpfilter/source/hwpreader.hxx
@@ -130,7 +130,7 @@ private:
 void makeFormula(TxtBox *hbox);
 void makeHyperText(TxtBox *hbox);
 void makePicture(Picture *hbox);
-void makePictureDRAW(HWPDrawingObject *drawobj, Picture *hbox);
+void makePictureDRAW(HWPDrawingObject *drawobj, const Picture *hbox);
 void makeLine();
 void makeHidden(Hidden *hbox);
 void makeFootnote(Footnote *hbox);
commit 317779e86a8cc4d1e2e3c7e227b732407bbadf26
Author: Caolán McNamara 
AuthorDate: Thu Mar 10 09:07:08 2022 +
Commit: Caolán McNamara 
CommitDate: Thu Mar 10 12:14:26 2022 +0100

ofz#45375 Timeout on negative width/height for MetaBmpExScaleAction

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

diff --git a/vcl/source/filter/svm/SvmReader.cxx 
b/vcl/source/filter/svm/SvmReader.cxx
index cdc731528ffb..550e9e59bcfd 100644
--- a/vcl/source/filter/svm/SvmReader.cxx
+++ b/vcl/source/filter/svm/SvmReader.cxx
@@ -899,8 +899,20 @@ rtl::Reference SvmReader::BmpExScaleHandler()
 TypeSerializer aSerializer(mrStream);
 Point aPoint;
 aSerializer.readPoint(aPoint);
+
 Size aSize;
 aSerializer.readSize(aSize);
+if (aSize.Width() < 0)
+{
+SAL_WARN("vcl.gdi", "MetaBmpExScaleAction: negative width");
+aSize.setWidth(0);
+}
+
+if (aSize.Height() < 0)
+{
+SAL_WARN("vcl.gdi", "MetaBmpExScaleAction: negative height");
+aSize.setHeight(0);
+}
 
 pAction->SetBitmapEx(aBmpEx);
 pAction->SetPoint(aPoint);


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

2022-03-10 Thread Gabor Kelemen (via logerrit)
 sw/IwyuFilter_sw.yaml   |   22 ++--
 sw/inc/BorderCacheOwner.hxx |1 
 sw/inc/IDocumentFieldsAccess.hxx|1 
 sw/inc/app.hrc  |2 +
 sw/inc/bparr.hxx|1 
 sw/inc/calbck.hxx   |1 
 sw/inc/ddefld.hxx   |1 
 sw/inc/doc.hxx  |1 
 sw/inc/docary.hxx   |1 
 sw/inc/docstyle.hxx |1 
 sw/inc/edglbldc.hxx |3 +-
 sw/inc/edimp.hxx|3 +-
 sw/inc/expfld.hxx   |2 -
 sw/inc/fldbas.hxx   |1 
 sw/inc/flddinf.hrc  |2 +
 sw/inc/fldref.hrc   |2 +
 sw/inc/list.hxx |3 --
 sw/inc/mdiexp.hxx   |3 +-
 sw/inc/mmaddressblockpage.hrc   |2 +
 sw/inc/ndindex.hxx  |2 -
 sw/inc/optload.hrc  |1 
 sw/inc/outline.hrc  |2 +
 sw/inc/pageformatpanel.hrc  |2 +
 sw/inc/postithelper.hxx |1 
 sw/inc/sortopt.hxx  |1 
 sw/inc/swbaslnk.hxx |3 +-
 sw/inc/swmodule.hxx |1 
 sw/inc/swtable.hxx  |1 
 sw/inc/swtblfmt.hxx |2 +
 sw/inc/swtypes.hxx  |1 
 sw/inc/tblafmt.hxx  |2 -
 sw/inc/tblenum.hxx  |1 
 sw/inc/textboxhelper.hxx|3 --
 sw/inc/undobj.hxx   |1 
 sw/inc/unobaseclass.hxx |2 -
 sw/inc/unosett.hxx  |3 --
 sw/inc/utlui.hrc|2 +
 sw/source/core/crsr/callnk.hxx  |1 
 sw/source/core/doc/tblafmt.cxx  |1 
 sw/source/core/docnode/ndsect.hxx   |1 
 sw/source/core/draw/dflyobj.cxx |1 
 sw/source/core/inc/DocumentChartDataProviderManager.hxx |1 
 sw/source/core/inc/DocumentRedlineManager.hxx   |1 
 sw/source/core/inc/GraphicSizeCheck.hxx |1 
 sw/source/core/inc/SwXMLBlockImport.hxx |2 -
 sw/source/core/inc/UndoCore.hxx |1 
 sw/source/core/inc/UndoRedline.hxx  |1 
 sw/source/core/inc/UndoSort.hxx |1 
 sw/source/core/inc/UndoTable.hxx|1 
 sw/source/core/inc/acorrect.hxx |1 
 sw/source/core/inc/drawfont.hxx |1 
 sw/source/core/inc/fntcache.hxx |2 -
 sw/source/core/inc/layact.hxx   |3 ++
 sw/source/core/inc/node2lay.hxx |3 +-
 sw/source/core/inc/rolbck.hxx   |1 
 sw/source/core/inc/rootfrm.hxx  |1 
 sw/source/core/inc/tblrwcl.hxx  |1 
 sw/source/core/inc/txmsrt.hxx   |1 
 sw/source/core/inc/txtfly.hxx   |1 
 sw/source/core/inc/unoflatpara.hxx  |1 
 sw/source/core/inc/unolinebreak.hxx |1 
 sw/source/core/inc/wrong.hxx|1 
 sw/source/core/layout/atrfrm.cxx|2 +
 sw/source/core/layout/dumpfilter.cxx|1 
 sw/source/core/layout/flyincnt.cxx  |1 
 sw/source/core/layout/layhelp.hxx   |1 
 sw/source/core/text/atrhndl.hxx |3 --
 sw/source/core/text/porlay.hxx  |2 -
 sw/source/core/text/possiz.hxx  |1 
 sw/source/core/undo/untbl.cxx   |2 +
 sw/source/core/unocore/unochart.cxx |1 
 sw/source/core/unocore/unodraw.cxx  |1 
 sw/source/core/unocore/unolinebreak.cxx |1 
 sw/source/core/unocore/unotbl.cxx   |1 
 sw/source/core/unocore/unotextmarkup.cxx|1 
 sw/source/core/view/vprint.cxx  |1 
 sw/so

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

2022-03-10 Thread Caolán McNamara (via logerrit)
 xmlsecurity/source/component/documentdigitalsignatures.cxx |9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit bae5503ac47ac2faa4c4365f86a00543e43a149a
Author: Caolán McNamara 
AuthorDate: Fri Mar 4 10:31:46 2022 +
Commit: Michael Stahl 
CommitDate: Thu Mar 10 11:39:34 2022 +0100

use internal SHA256Thumbprint api

Change-Id: I6a51359af58dbb79b6a0399944030dbcbe97152b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130963
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 
(cherry picked from commit f30bc3ccdfb48356910d64ee4a3dda685b11de93)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131203
Reviewed-by: Michael Stahl 

diff --git a/xmlsecurity/source/component/documentdigitalsignatures.cxx 
b/xmlsecurity/source/component/documentdigitalsignatures.cxx
index f02a93077a8d..2ee04691ba68 100644
--- a/xmlsecurity/source/component/documentdigitalsignatures.cxx
+++ b/xmlsecurity/source/component/documentdigitalsignatures.cxx
@@ -19,9 +19,10 @@
 
 #include 
 
-#include 
+#include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -676,6 +677,12 @@ sal_Bool DocumentDigitalSignatures::isAuthorTrusted(
 if (!aSignatureManager.init())
 return false;
 uno::Reference xCert = 
aSignatureManager.getSecurityEnvironment()->createCertificateFromAscii(rAuthor.RawData);
+
+auto pAuthor = 
dynamic_cast(xAuthor.get());
+auto pCert = dynamic_cast(xCert.get());
+if (pAuthor && pCert)
+return pCert->getSHA256Thumbprint() == 
pAuthor->getSHA256Thumbprint();
+
 return xCert->getSHA1Thumbprint() == xAuthor->getSHA1Thumbprint();
 });
 }


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

2022-03-10 Thread Caolán McNamara (via logerrit)
 xmlsecurity/source/component/documentdigitalsignatures.cxx |9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 08a9d2d250e041c3a6e7f7570cd2d6964dd96182
Author: Caolán McNamara 
AuthorDate: Fri Mar 4 10:31:46 2022 +
Commit: Michael Stahl 
CommitDate: Thu Mar 10 11:39:25 2022 +0100

use internal SHA256Thumbprint api

Change-Id: I6a51359af58dbb79b6a0399944030dbcbe97152b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130963
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 
(cherry picked from commit f30bc3ccdfb48356910d64ee4a3dda685b11de93)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131202
Reviewed-by: Michael Stahl 

diff --git a/xmlsecurity/source/component/documentdigitalsignatures.cxx 
b/xmlsecurity/source/component/documentdigitalsignatures.cxx
index 8b365a1c5934..4e714014d5f8 100644
--- a/xmlsecurity/source/component/documentdigitalsignatures.cxx
+++ b/xmlsecurity/source/component/documentdigitalsignatures.cxx
@@ -19,9 +19,10 @@
 
 #include 
 
-#include 
+#include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -676,6 +677,12 @@ sal_Bool DocumentDigitalSignatures::isAuthorTrusted(
 if (!aSignatureManager.init())
 return false;
 uno::Reference xCert = 
aSignatureManager.getSecurityEnvironment()->createCertificateFromAscii(rAuthor.RawData);
+
+auto pAuthor = 
dynamic_cast(xAuthor.get());
+auto pCert = dynamic_cast(xCert.get());
+if (pAuthor && pCert)
+return pCert->getSHA256Thumbprint() == 
pAuthor->getSHA256Thumbprint();
+
 return xCert->getSHA1Thumbprint() == xAuthor->getSHA1Thumbprint();
 });
 }


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

2022-03-10 Thread Mike Kaganski (via logerrit)
 sc/source/core/tool/interpr1.cxx |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 1bbcac7d172f9b0b97d54b07160ac6b5e736e651
Author: Mike Kaganski 
AuthorDate: Thu Mar 10 11:05:02 2022 +0300
Commit: Mike Kaganski 
CommitDate: Thu Mar 10 11:02:18 2022 +0100

Use readonly-aliasing icu::UnicodeString ctor to avoid extra copy

See also commit 4ac48ae4b02b8e0e3ae7e4833893f9ad40d4d14d
  Date   Fri Feb 28 14:20:24 2020 +0300
Use icu::UnicodeString's readonly-aliasing char16_t* constructor

Change-Id: I40243543ae9b4bf97f015f657538e4b1a0eafae6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131299
Tested-by: Mike Kaganski 
Reviewed-by: Mike Kaganski 

diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index f57dd83c282b..db8b282500ba 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -9448,8 +9448,8 @@ void ScInterpreter::ScRegex()
 // If bGlobalReplacement==true and bReplacement==false then
 // bGlobalReplacement is silently ignored.
 
-OUString aExpression = GetString().getString();
-OUString aText = GetString().getString();
+const OUString aExpression = GetString().getString();
+const OUString aText = GetString().getString();
 
 if (nGlobalError != FormulaError::NONE)
 {
@@ -9465,7 +9465,7 @@ void ScInterpreter::ScRegex()
 }
 
 const icu::UnicodeString aIcuExpression(
-reinterpret_cast(aExpression.getStr()), 
aExpression.getLength());
+false, reinterpret_cast(aExpression.getStr()), 
aExpression.getLength());
 UErrorCode status = U_ZERO_ERROR;
 icu::RegexMatcher aRegexMatcher( aIcuExpression, 0, status);
 if (U_FAILURE(status))
@@ -9478,7 +9478,7 @@ void ScInterpreter::ScRegex()
 // 
https://unicode-org.github.io/icu-docs/apidoc/released/icu4c/classicu_1_1RegexMatcher.html#a6ebcfcab4fe6a38678c0291643a03a00
 aRegexMatcher.setTimeLimit( 23*1000, status);
 
-const icu::UnicodeString aIcuText( reinterpret_cast(aText.getStr()), aText.getLength());
+const icu::UnicodeString aIcuText(false, reinterpret_cast(aText.getStr()), aText.getLength());
 aRegexMatcher.reset( aIcuText);
 
 if (!bReplacement)
@@ -9518,7 +9518,7 @@ void ScInterpreter::ScRegex()
 }
 
 const icu::UnicodeString aIcuReplacement(
-reinterpret_cast(aReplacement.getStr()), 
aReplacement.getLength());
+false, reinterpret_cast(aReplacement.getStr()), 
aReplacement.getLength());
 icu::UnicodeString aReplaced;
 if (bGlobalReplacement)
 // Replace all occurrences of match with replacement.


[Libreoffice-commits] core.git: vcl/unx

2022-03-10 Thread Tor Lillqvist (via logerrit)
 vcl/unx/generic/print/genpspgraphics.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 376588d3c6c8b83c663f350a7b2db499682e6a80
Author: Tor Lillqvist 
AuthorDate: Tue Mar 8 14:29:54 2022 +0200
Commit: Tor Lillqvist 
CommitDate: Thu Mar 10 11:00:43 2022 +0100

Trust the family name in the font file if necessary in 
AddTempDevFontHelper()

If the passed in font name is empty, use the one that has been read
from the font file.

Seems like a reasonable thing to do, and I have a use for this small
improvement coming.

Change-Id: I3598179bf85ba3acdaca6058982ba5bf81e68288
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131300
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist 

diff --git a/vcl/unx/generic/print/genpspgraphics.cxx 
b/vcl/unx/generic/print/genpspgraphics.cxx
index da0a406dea0b..f903b30c6204 100644
--- a/vcl/unx/generic/print/genpspgraphics.cxx
+++ b/vcl/unx/generic/print/genpspgraphics.cxx
@@ -253,7 +253,8 @@ bool GenPspGraphics::AddTempDevFontHelper( 
vcl::font::PhysicalFontCollection* pF
 // prepare font data
 psp::FastPrintFontInfo aInfo;
 rMgr.getFontFastInfo( elem, aInfo );
-aInfo.m_aFamilyName = rFontName;
+if (!rFontName.isEmpty())
+aInfo.m_aFamilyName = rFontName;
 
 // inform glyph cache of new font
 FontAttributes aDFA = GenPspGraphics::Info2FontAttributes( aInfo );


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

2022-03-10 Thread Jean-Pierre Ledure (via logerrit)
 wizards/source/scriptforge/SF_Exception.xba   |3 ---
 wizards/source/scriptforge/SF_Root.xba|4 
 wizards/source/scriptforge/SF_UI.xba  |1 -
 wizards/source/scriptforge/dlgConsole.xdl |4 ++--
 wizards/source/scriptforge/dlgProgress.xdl|2 +-
 wizards/source/scriptforge/po/ScriptForge.pot |7 +--
 wizards/source/scriptforge/po/en.po   |7 +--
 7 files changed, 5 insertions(+), 23 deletions(-)

New commits:
commit 14e550c5963dcd0d0a75666c659b4b91de4b98bd
Author: Jean-Pierre Ledure 
AuthorDate: Wed Mar 9 15:19:25 2022 +0100
Commit: Jean-Pierre Ledure 
CommitDate: Thu Mar 10 10:56:10 2022 +0100

ScriptForge - Console + progress bar receive a Close icon

Next dialogs:
- dlgConsole (modal or non-modal)
- dlgProgress (non-modal)
had a Close button with label "Close" or a translation.

The "Close" text is replaced with a "Cancel" icon.

Objective: make console and progress bar user-language independent.

No impact either on user documentation or on Python part.

Change-Id: Ib1c2370986d47ccab49c6d42500231fd73b9ff3f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131255
Tested-by: Jean-Pierre Ledure 
Tested-by: Jenkins
Reviewed-by: Jean-Pierre Ledure 

diff --git a/wizards/source/scriptforge/SF_Exception.xba 
b/wizards/source/scriptforge/SF_Exception.xba
index 3d28153a5a40..2af37d9534f2 100644
--- a/wizards/source/scriptforge/SF_Exception.xba
+++ b/wizards/source/scriptforge/SF_Exception.xba
@@ -266,7 +266,6 @@ Public Sub Console(Optional ByVal Modal As Variant, _
 ''' SF_Exception.Console()
 
 Dim bConsoleActive As Boolean  '  When True, dialog is active
-Dim sClose As String   '  Caption of the close 
buttons
 Dim oModalBtn As Object'  Modal close 
button
 Dim oNonModalBtn As Object '  Non modal close button
 Const cstThisSub = "Exception.Console"
@@ -295,10 +294,8 @@ Try:
'  - a Default button triggering the Close 
action
Set .ConsoleDialog = 
CreateScriptService("SFDialogs.Dialog", "GlobalScope", 
"ScriptForge", "dlgConsole", _Context)
'  Setup labels and visibility
-   sClose = .Interface.GetText("CLOSEBUTTON")
Set oModalBtn = 
.ConsoleDialog.Controls("CloseModalButton")
Set oNonModalBtn = 
.ConsoleDialog.Controls("CloseNonModalButton")
-   If Modal Then oModalBtn.Caption = sClose Else 
oNonModalBtn.Caption = sClose
oModalBtn.Visible = Modal
oNonModalBtn.Visible = CBool(Not Modal)
'  Load console lines
diff --git a/wizards/source/scriptforge/SF_Root.xba 
b/wizards/source/scriptforge/SF_Root.xba
index d7c4cc639737..0ed77373d773 100644
--- a/wizards/source/scriptforge/SF_Root.xba
+++ b/wizards/source/scriptforge/SF_Root.xba
@@ -308,10 +308,6 @@ Try:
Set Interface = CreateScriptService("L10N")
With Interface
'  SF_Exception.Raise
-   .AddText(   Context := "CLOSEBUTTON" _
-   , MsgId := "Close" _
-   , Comment :="Text in 
close buttons of progress and console dialog boxes" _
-   )
.AddText(   Context := "ERRORNUMBER" _
, MsgId := "Error %1" 
_
, Comment :="Title in 
error message box\n" _
diff --git a/wizards/source/scriptforge/SF_UI.xba 
b/wizards/source/scriptforge/SF_UI.xba
index 1caa90039264..8c511a35cc8d 100644
--- a/wizards/source/scriptforge/SF_UI.xba
+++ b/wizards/source/scriptforge/SF_UI.xba
@@ -1115,7 +1115,6 @@ Try:
If bFirstCall Then
Set oFixedText = 
.Controls("ProgressText")
Set oProgressBar = 
.Controls("ProgressBar")
-   
.Controls("CloseButton").Caption = 
_SF_.Interface.GetText("CLOSEBUTTON")
.Execute(Modal := False)
End If
If Len(Text) > 0 Then oFixedText.Caption = 
Text
diff --git a/wizards/source/scriptforge/dlgConsole.xdl 
b/wizards/source/scriptforge/dlgConsole.xdl
index 626be565d8b7..64009f571c2f 100644
--- a/wizards/source/scriptforge/dlgConsole.xdl
+++ b/wizards/source/scriptforge/dlgConsole.xdl
@@ -6,9 +6,9 @@
  
  
   
-  
+  

   
-  
+  
  
 
\ No newline at end of file
diff --git a/wizards/source/scriptforge/dlgProgress.xdl 
b/wizards/source/scriptforge/dlgProgress.xdl
index cdb8f313214b..9d5f2776d44d 100644
--- a/wizards/source/scriptfor

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

2022-03-10 Thread Michael Stahl (via logerrit)
 sw/qa/extras/uiwriter/uiwriter2.cxx |   30 ++
 sw/source/core/edit/edws.cxx|6 ++
 2 files changed, 36 insertions(+)

New commits:
commit 8e63eb272ca0a75b2e800a63c47cf491715587a9
Author: Michael Stahl 
AuthorDate: Mon Mar 7 19:37:02 2022 +0100
Commit: Xisco Fauli 
CommitDate: Thu Mar 10 10:34:57 2022 +0100

tdf#147414 sw_redlinehide: fix cursor position after AutoCorrect

Change-Id: Ia06cd4e1a74a21788e4d0ddb5f0481e8a144d863
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131147
Tested-by: Jenkins
Reviewed-by: Michael Stahl 
(cherry picked from commit e2076b31a91d3882f3deeaa5d3d4659da0e4b17c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131135
Reviewed-by: Xisco Fauli 

diff --git a/sw/qa/extras/uiwriter/uiwriter2.cxx 
b/sw/qa/extras/uiwriter/uiwriter2.cxx
index 7e77a4eced99..3818ee546eed 100644
--- a/sw/qa/extras/uiwriter/uiwriter2.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter2.cxx
@@ -1549,6 +1549,36 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf109376)
 CPPUNIT_ASSERT_EQUAL(size_t(1), pWrtShell->GetFlyCount(FLYCNTTYPE_FRM));
 }
 
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf147414)
+{
+SwDoc* const pDoc(createSwDoc());
+SwWrtShell* const pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+SwAutoCorrect corr(*SvxAutoCorrCfg::Get().GetAutoCorrect());
+
+pWrtShell->Insert("Abc");
+
+// hide and enable
+dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
+dispatchCommand(mxComponent, ".uno:TrackChanges", {});
+
+CPPUNIT_ASSERT(pDoc->getIDocumentRedlineAccess().IsRedlineOn());
+CPPUNIT_ASSERT(
+
IDocumentRedlineAccess::IsShowChanges(pDoc->getIDocumentRedlineAccess().GetRedlineFlags()));
+CPPUNIT_ASSERT(pWrtShell->GetLayout()->IsHideRedlines());
+
+pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, 
/*bBasicCall=*/false);
+// backspace
+pWrtShell->DelLeft();
+pWrtShell->AutoCorrect(corr, u' ');
+
+// problem was this was 1 i.e. before the deleted "b" while " " was 
inserted after
+CPPUNIT_ASSERT_EQUAL(sal_Int32(3),
+ 
pWrtShell->getShellCursor(false)->GetPoint()->nContent.GetIndex());
+CPPUNIT_ASSERT_EQUAL(
+OUString("Ab c"),
+
pWrtShell->getShellCursor(false)->GetPoint()->nNode.GetNode().GetTextNode()->GetText());
+}
+
 CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf147310)
 {
 SwDoc* pDoc = createSwDoc();
diff --git a/sw/source/core/edit/edws.cxx b/sw/source/core/edit/edws.cxx
index e21469f6408b..eeec52f0eba1 100644
--- a/sw/source/core/edit/edws.cxx
+++ b/sw/source/core/edit/edws.cxx
@@ -266,6 +266,12 @@ void SwEditShell::AutoCorrect( SvxAutoCorrect& rACorr, 
bool bInsert,
 // FIXME: this _must_ be called with reference to the actual node text!
 SwTextFrame const*const pFrame(static_cast(pTNd->getLayoutFrame(GetLayout(;
 TextFrameIndex const nPos(pFrame->MapModelToViewPos(*pCursor->GetPoint()));
+// tdf#147414 sw_redlinehide: if cursor moved backward, it may be at the
+// start of a delete redline - but MapViewToModelPos() always returns end
+// of redline and it will be called when AutoCorrect actually inserts
+// something - so first normalize cursor point to end of redline so that
+// point will then be moved forward when something is inserted.
+*pCursor->GetPoint() = pFrame->MapViewToModelPos(nPos);
 OUString const& rMergedText(pFrame->GetText());
 rACorr.DoAutoCorrect( aSwAutoCorrDoc,
 rMergedText, sal_Int32(nPos),


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

2022-03-10 Thread Michael Stahl (via logerrit)
 sw/qa/extras/uiwriter/uiwriter2.cxx |   46 
 sw/source/core/undo/undel.cxx   |5 +++
 2 files changed, 50 insertions(+), 1 deletion(-)

New commits:
commit 6a1024962f7b286df0535b39e3b79202314245e0
Author: Michael Stahl 
AuthorDate: Mon Mar 7 15:57:09 2022 +0100
Commit: Xisco Fauli 
CommitDate: Thu Mar 10 10:34:23 2022 +0100

tdf#147310 sw_redlinehide: recreate frames for whole table deleted

SwUndoDelete calls MakeFrames with end being end node of the table, but
it needs to be the following node (with a frame).

(regression from commit 723728cd358693b8f4bc9d913541aa4479f2bd48)

Change-Id: Id0974c8349be5aef9630822738eae9462bbcb4f0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131112
Tested-by: Jenkins
Reviewed-by: Michael Stahl 
(cherry picked from commit 6f20bcb152948a24dbe40ca2e6c4ecef2bebf853)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131132
Reviewed-by: Xisco Fauli 

diff --git a/sw/qa/extras/uiwriter/uiwriter2.cxx 
b/sw/qa/extras/uiwriter/uiwriter2.cxx
index 699264592bba..7e77a4eced99 100644
--- a/sw/qa/extras/uiwriter/uiwriter2.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter2.cxx
@@ -1549,6 +1549,52 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf109376)
 CPPUNIT_ASSERT_EQUAL(size_t(1), pWrtShell->GetFlyCount(FLYCNTTYPE_FRM));
 }
 
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf147310)
+{
+SwDoc* pDoc = createSwDoc();
+SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+CPPUNIT_ASSERT(pWrtShell);
+
+// somehow bug happens only with 2 tables
+SwInsertTableOptions tableOpt(SwInsertTableFlags::DefaultBorder, 0);
+pWrtShell->InsertTable(tableOpt, 1, 1);
+pWrtShell->InsertTable(tableOpt, 1, 1);
+
+pWrtShell->SttEndDoc(/*bStart=*/true);
+
+pWrtShell->DeleteRow(false);
+pWrtShell->DeleteRow(false);
+
+{
+xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+assertXPath(pXmlDoc, "/root/page/body/tab", 0);
+discardDumpedLayout();
+}
+pWrtShell->Undo();
+// this did not create frames for the table
+pWrtShell->Undo();
+{
+xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+// there are 2 tables
+assertXPath(pXmlDoc, "/root/page/body/tab", 2);
+discardDumpedLayout();
+}
+pWrtShell->Redo();
+pWrtShell->Redo();
+{
+xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+assertXPath(pXmlDoc, "/root/page/body/tab", 0);
+discardDumpedLayout();
+}
+pWrtShell->Undo();
+pWrtShell->Undo();
+{
+xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+// there are 2 tables
+assertXPath(pXmlDoc, "/root/page/body/tab", 2);
+}
+}
+
 CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf64242_optimizeTable)
 {
 SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf64242_optimizeTable.odt");
diff --git a/sw/source/core/undo/undel.cxx b/sw/source/core/undo/undel.cxx
index f3fbf5eac553..0de31cd9adb2 100644
--- a/sw/source/core/undo/undel.cxx
+++ b/sw/source/core/undo/undel.cxx
@@ -1137,7 +1137,10 @@ void SwUndoDelete::UndoImpl(::sw::UndoRedoContext & 
rContext)
 // don't include end node in the range: it may have been merged already
 // by the start node, or it may be merged by one of the moved nodes,
 // but if it isn't merged, its current frame(s) should be good...
-SwNodeIndex const end(rDoc.GetNodes(), m_bDelFullPara ? 
delFullParaEndNode : m_nEndNode);
+SwNodeIndex const end(rDoc.GetNodes(), m_bDelFullPara
+? delFullParaEndNode
+// tdf#147310 SwDoc::DeleteRowCol() may delete whole table - end 
must be node following table!
+: (m_nEndNode + (rDoc.GetNodes()[m_nSttNode]->IsTableNode() && 
rDoc.GetNodes()[m_nEndNode]->IsEndNode() ? 1 : 0)));
 ::MakeFrames(&rDoc, start, end);
 }
 


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

2022-03-10 Thread Julien Nabet (via logerrit)
 vcl/source/filter/png/pngwrite.cxx |   10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

New commits:
commit 61c5101a95308fe20e684fa72457c867bd115216
Author: Julien Nabet 
AuthorDate: Sat Mar 5 12:37:40 2022 +0100
Commit: Xisco Fauli 
CommitDate: Thu Mar 10 10:33:46 2022 +0100

tdf#136632: Use 'Save transparency' when exporting selected objects for PNG

To avoid some regression, consider that transparency should be enabled by 
default.
So only remove transparency if it's required explicitely.

+ change QA test since "Translucent" property isn't a bool but a sal_Int32
In officecfg/registry/schema/org/openoffice/Office/Common.xcs:


Change-Id: I9bfb6aae8e2e8a31dee82f73a9165989129f222a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131057
Tested-by: Jenkins
Reviewed-by: Julien Nabet 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131061
Reviewed-by: Xisco Fauli 
(cherry picked from commit 43356e4d9fe022f24265747cb4b0ae2fc3cd3236)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131133

diff --git a/vcl/source/filter/png/pngwrite.cxx 
b/vcl/source/filter/png/pngwrite.cxx
index 0554a314e83c..e89cbba69a85 100644
--- a/vcl/source/filter/png/pngwrite.cxx
+++ b/vcl/source/filter/png/pngwrite.cxx
@@ -123,6 +123,7 @@ PNGWriterImpl::PNGWriterImpl(const BitmapEx& rBitmapEx,
 Bitmap aBmp(aBitmapEx.GetBitmap());
 
 mnMaxChunkSize = std::numeric_limits::max();
+bool bTranslucent = true;
 
 if (pFilterData)
 {
@@ -132,6 +133,13 @@ PNGWriterImpl::PNGWriterImpl(const BitmapEx& rBitmapEx,
 rPropVal.Value >>= mnCompLevel;
 else if (rPropVal.Name == "Interlaced")
 rPropVal.Value >>= mnInterlaced;
+else if (rPropVal.Name == "Translucent")
+{
+tools::Long nTmp = 0;
+rPropVal.Value >>= nTmp;
+if (!nTmp)
+bTranslucent = false;
+}
 else if (rPropVal.Name == "MaxChunkSize")
 {
 sal_Int32 nVal = 0;
@@ -142,7 +150,7 @@ PNGWriterImpl::PNGWriterImpl(const BitmapEx& rBitmapEx,
 }
 mnBitsPerPixel = 
sal_uInt8(vcl::pixelFormatBitCount(aBmp.getPixelFormat()));
 
-if (aBitmapEx.IsAlpha())
+if (aBitmapEx.IsAlpha() && bTranslucent)
 {
 if (mnBitsPerPixel <= 8)
 {


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

2022-03-10 Thread Caolán McNamara (via logerrit)
 chart2/source/controller/dialogs/res_LegendPosition.cxx |7 ++-
 chart2/source/controller/inc/res_LegendPosition.hxx |1 +
 2 files changed, 7 insertions(+), 1 deletion(-)

New commits:
commit 57041f8214e77d707cf6a13825aed584d9b1e877
Author: Caolán McNamara 
AuthorDate: Mon Feb 21 11:54:04 2022 +
Commit: Xisco Fauli 
CommitDate: Thu Mar 10 10:33:10 2022 +0100

cid#1500515 Dereference after null check

Change-Id: I6483c3a036c5c56c8c6515b5b8f08720c8bd1a6b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130258
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 

diff --git a/chart2/source/controller/dialogs/res_LegendPosition.cxx 
b/chart2/source/controller/dialogs/res_LegendPosition.cxx
index 5ad9fe1ac63d..97318f59aeb3 100644
--- a/chart2/source/controller/dialogs/res_LegendPosition.cxx
+++ b/chart2/source/controller/dialogs/res_LegendPosition.cxx
@@ -85,7 +85,7 @@ void LegendPositionResources::writeToResources( const 
uno::Reference< frame::XMo
 xProp->getPropertyValue( "Show" ) >>= bShowLegend;
 if (m_xCbxShow)
 m_xCbxShow->set_active( bShowLegend );
-PositionEnableHdl(*m_xCbxShow);
+PositionEnable();
 
 //position
 chart2::LegendPosition ePos;
@@ -159,6 +159,11 @@ void LegendPositionResources::writeToModel( const 
css::uno::Reference< frame::XM
 }
 
 IMPL_LINK_NOARG(LegendPositionResources, PositionEnableHdl, weld::Toggleable&, 
void)
+{
+PositionEnable();
+}
+
+void LegendPositionResources::PositionEnable()
 {
 bool bEnable = !m_xCbxShow || m_xCbxShow->get_active();
 
diff --git a/chart2/source/controller/inc/res_LegendPosition.hxx 
b/chart2/source/controller/inc/res_LegendPosition.hxx
index 87b96ab558fc..d1de5010e20a 100644
--- a/chart2/source/controller/inc/res_LegendPosition.hxx
+++ b/chart2/source/controller/inc/res_LegendPosition.hxx
@@ -55,6 +55,7 @@ public:
 
 private:
 void impl_setRadioButtonToggleHdl();
+void PositionEnable();
 
 private:
 css::uno::Reference< css::uno::XComponentContext>m_xCC;


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

2022-03-10 Thread Mike Kaganski (via logerrit)
 sw/qa/extras/layout/data/tdf143239-1-min.odt |binary
 sw/qa/extras/layout/layout.cxx   |   58 +++
 sw/source/core/layout/layact.cxx |3 +
 3 files changed, 61 insertions(+)

New commits:
commit bfb19a4ec7c43680358fe81e33bdfcb0ca47c91c
Author: Mike Kaganski 
AuthorDate: Tue Mar 1 10:12:15 2022 +0300
Commit: Xisco Fauli 
CommitDate: Thu Mar 10 10:32:19 2022 +0100

Fix flaky test on Win64

Obviously the left values are unstable; they were excluded on macOS,
and they fail exactly on the same lines for me locally on Win64 build.
So just test that the values are restored after delete and undo.

Change-Id: I63dc50d223edb052a0ada200189cef94c2e0f8e5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130738
Tested-by: Mike Kaganski 
Reviewed-by: Mike Kaganski 
(cherry picked from commit da77aec27e3121c895a6c6c287225216489cc8bc)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131024
Reviewed-by: Michael Stahl 
Tested-by: Jenkins

diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index 5fbecf5be3c1..f48117661d9c 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -1280,29 +1280,27 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf143239)
 SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf143239-1-min.odt");
 SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
 
+// These are unstable on macOS and Win64 builds,
+// so only test that they restore original values for now
+OUString p2txt1Left, p2txt2Left, p3txt1Left;
+
 {
 xmlDocUniquePtr pXmlDoc = parseLayoutDump();
 assertXPath(pXmlDoc, "/root/page[2]/body/txt[1]/anchored/fly", 1);
 assertXPath(pXmlDoc, 
"/root/page[2]/body/txt[1]/anchored/fly[1]/infos/bounds", "top",
 "18540");
-#ifndef MACOSX
-assertXPath(pXmlDoc, 
"/root/page[2]/body/txt[1]/anchored/fly[1]/infos/bounds", "left",
-"3559");
-#endif
+p2txt1Left
+= getXPath(pXmlDoc, 
"/root/page[2]/body/txt[1]/anchored/fly[1]/infos/bounds", "left");
 assertXPath(pXmlDoc, "/root/page[2]/body/txt[2]/anchored/fly", 1);
 assertXPath(pXmlDoc, 
"/root/page[2]/body/txt[2]/anchored/fly[1]/infos/bounds", "top",
 "23894");
-#ifndef MACOSX
-assertXPath(pXmlDoc, 
"/root/page[2]/body/txt[2]/anchored/fly[1]/infos/bounds", "left",
-"1964");
-#endif
+p2txt2Left
+= getXPath(pXmlDoc, 
"/root/page[2]/body/txt[2]/anchored/fly[1]/infos/bounds", "left");
 assertXPath(pXmlDoc, "/root/page[3]/body/txt[1]/anchored/fly", 1);
 assertXPath(pXmlDoc, 
"/root/page[3]/body/txt[1]/anchored/fly[1]/infos/bounds", "top",
 "35662");
-#ifndef MACOSX
-assertXPath(pXmlDoc, 
"/root/page[3]/body/txt[1]/anchored/fly[1]/infos/bounds", "left",
-"3129");
-#endif
+p3txt1Left
+= getXPath(pXmlDoc, 
"/root/page[3]/body/txt[1]/anchored/fly[1]/infos/bounds", "left");
 assertXPath(pXmlDoc, "/root/page", 3);
 discardDumpedLayout();
 }
@@ -1318,24 +1316,18 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf143239)
 assertXPath(pXmlDoc, "/root/page[2]/body/txt[1]/anchored/fly", 1);
 assertXPath(pXmlDoc, 
"/root/page[2]/body/txt[1]/anchored/fly[1]/infos/bounds", "top",
 "18540");
-#ifndef MACOSX
 assertXPath(pXmlDoc, 
"/root/page[2]/body/txt[1]/anchored/fly[1]/infos/bounds", "left",
-"3559");
-#endif
+p2txt1Left);
 assertXPath(pXmlDoc, "/root/page[2]/body/txt[2]/anchored/fly", 1);
 assertXPath(pXmlDoc, 
"/root/page[2]/body/txt[2]/anchored/fly[1]/infos/bounds", "top",
 "23894");
-#ifndef MACOSX
 assertXPath(pXmlDoc, 
"/root/page[2]/body/txt[2]/anchored/fly[1]/infos/bounds", "left",
-"1964");
-#endif
+p2txt2Left);
 assertXPath(pXmlDoc, "/root/page[3]/body/txt[1]/anchored/fly", 1);
 assertXPath(pXmlDoc, 
"/root/page[3]/body/txt[1]/anchored/fly[1]/infos/bounds", "top",
 "35662");
-#ifndef MACOSX
 assertXPath(pXmlDoc, 
"/root/page[3]/body/txt[1]/anchored/fly[1]/infos/bounds", "left",
-"3129");
-#endif
+p3txt1Left);
 assertXPath(pXmlDoc, "/root/page", 3);
 discardDumpedLayout();
 }
commit cd60a2d31737f491088cfb0789bc014b1e0aad5f
Author: Michael Stahl 
AuthorDate: Fri Feb 25 13:43:56 2022 +0100
Commit: Xisco Fauli 
CommitDate: Thu Mar 10 10:32:02 2022 +0100

tdf#143239 sw: layout: invalidate fly position when moving off page

It's possible that flags on the fly are all valid when it is moved off page
when SwLayAction::FormatContent() returns and then it may not be positioned
again, keeping its (wrong) position on th

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

2022-03-10 Thread Michael Stahl (via logerrit)
 sw/qa/extras/uiwriter/uiwriter2.cxx |   30 ++
 sw/source/core/edit/edws.cxx|6 ++
 2 files changed, 36 insertions(+)

New commits:
commit ab0756c1b7509a034d0bb74251c519a090dedc7c
Author: Michael Stahl 
AuthorDate: Mon Mar 7 19:37:02 2022 +0100
Commit: Xisco Fauli 
CommitDate: Thu Mar 10 10:31:31 2022 +0100

tdf#147414 sw_redlinehide: fix cursor position after AutoCorrect

Change-Id: Ia06cd4e1a74a21788e4d0ddb5f0481e8a144d863
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131147
Tested-by: Jenkins
Reviewed-by: Michael Stahl 
(cherry picked from commit e2076b31a91d3882f3deeaa5d3d4659da0e4b17c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131134
Reviewed-by: Xisco Fauli 

diff --git a/sw/qa/extras/uiwriter/uiwriter2.cxx 
b/sw/qa/extras/uiwriter/uiwriter2.cxx
index d5f6f045da70..992c10290429 100644
--- a/sw/qa/extras/uiwriter/uiwriter2.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter2.cxx
@@ -1545,6 +1545,36 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf109376)
 CPPUNIT_ASSERT_EQUAL(size_t(1), pWrtShell->GetFlyCount(FLYCNTTYPE_FRM));
 }
 
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf147414)
+{
+SwDoc* const pDoc(createSwDoc());
+SwWrtShell* const pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+SwAutoCorrect corr(*SvxAutoCorrCfg::Get().GetAutoCorrect());
+
+pWrtShell->Insert("Abc");
+
+// hide and enable
+dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
+dispatchCommand(mxComponent, ".uno:TrackChanges", {});
+
+CPPUNIT_ASSERT(pDoc->getIDocumentRedlineAccess().IsRedlineOn());
+CPPUNIT_ASSERT(
+
IDocumentRedlineAccess::IsShowChanges(pDoc->getIDocumentRedlineAccess().GetRedlineFlags()));
+CPPUNIT_ASSERT(pWrtShell->GetLayout()->IsHideRedlines());
+
+pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, 
/*bBasicCall=*/false);
+// backspace
+pWrtShell->DelLeft();
+pWrtShell->AutoCorrect(corr, u' ');
+
+// problem was this was 1 i.e. before the deleted "b" while " " was 
inserted after
+CPPUNIT_ASSERT_EQUAL(sal_Int32(3),
+ 
pWrtShell->getShellCursor(false)->GetPoint()->nContent.GetIndex());
+CPPUNIT_ASSERT_EQUAL(
+OUString("Ab c"),
+
pWrtShell->getShellCursor(false)->GetPoint()->nNode.GetNode().GetTextNode()->GetText());
+}
+
 CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf147310)
 {
 SwDoc* pDoc = createSwDoc();
diff --git a/sw/source/core/edit/edws.cxx b/sw/source/core/edit/edws.cxx
index 293a5f9f7960..647e59e11b5b 100644
--- a/sw/source/core/edit/edws.cxx
+++ b/sw/source/core/edit/edws.cxx
@@ -266,6 +266,12 @@ void SwEditShell::AutoCorrect( SvxAutoCorrect& rACorr, 
bool bInsert,
 // FIXME: this _must_ be called with reference to the actual node text!
 SwTextFrame const*const pFrame(static_cast(pTNd->getLayoutFrame(GetLayout(;
 TextFrameIndex const nPos(pFrame->MapModelToViewPos(*pCursor->GetPoint()));
+// tdf#147414 sw_redlinehide: if cursor moved backward, it may be at the
+// start of a delete redline - but MapViewToModelPos() always returns end
+// of redline and it will be called when AutoCorrect actually inserts
+// something - so first normalize cursor point to end of redline so that
+// point will then be moved forward when something is inserted.
+*pCursor->GetPoint() = pFrame->MapViewToModelPos(nPos);
 OUString const& rMergedText(pFrame->GetText());
 rACorr.DoAutoCorrect( aSwAutoCorrDoc,
 rMergedText, sal_Int32(nPos),


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

2022-03-10 Thread Michael Stahl (via logerrit)
 sw/qa/extras/uiwriter/uiwriter2.cxx |   46 
 sw/source/core/undo/undel.cxx   |5 +++
 2 files changed, 50 insertions(+), 1 deletion(-)

New commits:
commit d65b07c42206476ab471320c8261a96adad4d515
Author: Michael Stahl 
AuthorDate: Mon Mar 7 15:57:09 2022 +0100
Commit: Xisco Fauli 
CommitDate: Thu Mar 10 10:31:02 2022 +0100

tdf#147310 sw_redlinehide: recreate frames for whole table deleted

SwUndoDelete calls MakeFrames with end being end node of the table, but
it needs to be the following node (with a frame).

(regression from commit 723728cd358693b8f4bc9d913541aa4479f2bd48)

Change-Id: Id0974c8349be5aef9630822738eae9462bbcb4f0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131112
Tested-by: Jenkins
Reviewed-by: Michael Stahl 
(cherry picked from commit 6f20bcb152948a24dbe40ca2e6c4ecef2bebf853)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131131
Reviewed-by: Xisco Fauli 

diff --git a/sw/qa/extras/uiwriter/uiwriter2.cxx 
b/sw/qa/extras/uiwriter/uiwriter2.cxx
index 4e9080bdc951..d5f6f045da70 100644
--- a/sw/qa/extras/uiwriter/uiwriter2.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter2.cxx
@@ -1545,6 +1545,52 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf109376)
 CPPUNIT_ASSERT_EQUAL(size_t(1), pWrtShell->GetFlyCount(FLYCNTTYPE_FRM));
 }
 
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf147310)
+{
+SwDoc* pDoc = createSwDoc();
+SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+CPPUNIT_ASSERT(pWrtShell);
+
+// somehow bug happens only with 2 tables
+SwInsertTableOptions tableOpt(SwInsertTableFlags::DefaultBorder, 0);
+pWrtShell->InsertTable(tableOpt, 1, 1);
+pWrtShell->InsertTable(tableOpt, 1, 1);
+
+pWrtShell->SttEndDoc(/*bStart=*/true);
+
+pWrtShell->DeleteRow(false);
+pWrtShell->DeleteRow(false);
+
+{
+xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+assertXPath(pXmlDoc, "/root/page/body/tab", 0);
+discardDumpedLayout();
+}
+pWrtShell->Undo();
+// this did not create frames for the table
+pWrtShell->Undo();
+{
+xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+// there are 2 tables
+assertXPath(pXmlDoc, "/root/page/body/tab", 2);
+discardDumpedLayout();
+}
+pWrtShell->Redo();
+pWrtShell->Redo();
+{
+xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+assertXPath(pXmlDoc, "/root/page/body/tab", 0);
+discardDumpedLayout();
+}
+pWrtShell->Undo();
+pWrtShell->Undo();
+{
+xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+// there are 2 tables
+assertXPath(pXmlDoc, "/root/page/body/tab", 2);
+}
+}
+
 CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf64242_optimizeTable)
 {
 SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf64242_optimizeTable.odt");
diff --git a/sw/source/core/undo/undel.cxx b/sw/source/core/undo/undel.cxx
index ed1cdf38794d..2d35811a9b86 100644
--- a/sw/source/core/undo/undel.cxx
+++ b/sw/source/core/undo/undel.cxx
@@ -1136,7 +1136,10 @@ void SwUndoDelete::UndoImpl(::sw::UndoRedoContext & 
rContext)
 // don't include end node in the range: it may have been merged already
 // by the start node, or it may be merged by one of the moved nodes,
 // but if it isn't merged, its current frame(s) should be good...
-SwNodeIndex const end(rDoc.GetNodes(), m_bDelFullPara ? 
delFullParaEndNode : m_nEndNode);
+SwNodeIndex const end(rDoc.GetNodes(), m_bDelFullPara
+? delFullParaEndNode
+// tdf#147310 SwDoc::DeleteRowCol() may delete whole table - end 
must be node following table!
+: (m_nEndNode + (rDoc.GetNodes()[m_nSttNode]->IsTableNode() && 
rDoc.GetNodes()[m_nEndNode]->IsEndNode() ? 1 : 0)));
 ::MakeFrames(&rDoc, start, end);
 }
 


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

2022-03-10 Thread Caolán McNamara (via logerrit)
 include/sfx2/weldutils.hxx  |2 ++
 sfx2/source/dialog/recfloat.cxx |   14 ++
 sfx2/source/inc/recfloat.hxx|2 ++
 3 files changed, 18 insertions(+)

New commits:
commit 57ec3c4a40847b28390e1c208d5c771409ff1cab
Author: Caolán McNamara 
AuthorDate: Sun Mar 6 21:20:46 2022 +
Commit: Xisco Fauli 
CommitDate: Thu Mar 10 10:28:28 2022 +0100

tdf#147782 retain focus in launching frame on first activate

Change-Id: I813c675ecf7c4a364f9d770af12e99275f510e7b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131017
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 

diff --git a/include/sfx2/weldutils.hxx b/include/sfx2/weldutils.hxx
index 81c4cb85dcab..aaa2fe08a2e3 100644
--- a/include/sfx2/weldutils.hxx
+++ b/include/sfx2/weldutils.hxx
@@ -56,6 +56,8 @@ public:
 css::uno::Reference
 GetControllerForCommand(const OUString& rCommand) const;
 
+css::uno::Reference GetFrame() const { return 
m_xFrame; }
+
 void dispose();
 ~ToolbarUnoDispatcher();
 };
diff --git a/sfx2/source/dialog/recfloat.cxx b/sfx2/source/dialog/recfloat.cxx
index 18833ea5edfa..6a6fc17dbd9a 100644
--- a/sfx2/source/dialog/recfloat.cxx
+++ b/sfx2/source/dialog/recfloat.cxx
@@ -17,6 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include 
 #include 
 
 #include 
@@ -101,6 +102,7 @@ SfxRecordingFloat_Impl::SfxRecordingFloat_Impl(SfxBindings* 
pBind, SfxChildWindo
   "FloatingRecord")
 , m_xToolbar(m_xBuilder->weld_toolbar("toolbar"))
 , m_xDispatcher(new ToolbarUnoDispatcher(*m_xToolbar, *m_xBuilder, 
pBind->GetActiveFrame()))
+, m_bFirstActivate(true)
 {
 // start recording
 SfxBoolItem aItem( SID_RECORDMACRO, true );
@@ -108,6 +110,18 @@ 
SfxRecordingFloat_Impl::SfxRecordingFloat_Impl(SfxBindings* pBind, SfxChildWindo
 SfxCallMode::SYNCHRON, { &aItem });
 }
 
+void SfxRecordingFloat_Impl::Activate()
+{
+SfxModelessDialogController::Activate();
+if (!m_bFirstActivate)
+return;
+// tdf#147782 retain focus in launching frame on the first activate on 
automatically gaining focus on getting launched
+m_bFirstActivate = false;
+css::uno::Reference 
xTopWindow(m_xDispatcher->GetFrame()->getContainerWindow(), 
css::uno::UNO_QUERY);
+if (xTopWindow.is())
+xTopWindow->toFront();
+}
+
 SfxRecordingFloat_Impl::~SfxRecordingFloat_Impl()
 {
 m_xDispatcher->dispose();
diff --git a/sfx2/source/inc/recfloat.hxx b/sfx2/source/inc/recfloat.hxx
index e25ad7f08fda..b7a4882cd72e 100644
--- a/sfx2/source/inc/recfloat.hxx
+++ b/sfx2/source/inc/recfloat.hxx
@@ -42,12 +42,14 @@ class SfxRecordingFloat_Impl final : public 
SfxModelessDialogController
 {
 std::unique_ptr m_xToolbar;
 std::unique_ptr m_xDispatcher;
+bool m_bFirstActivate;
 public:
 SfxRecordingFloat_Impl(SfxBindings* pBindings,
SfxChildWindow* pChildWin,
weld::Window* pParent);
 virtual ~SfxRecordingFloat_Impl() override;
 virtual void FillInfo(SfxChildWinInfo& rInfo) const override;
+virtual void Activate() override;
 };
 
 #endif


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

2022-03-10 Thread Dr. David Alan Gilbert (via logerrit)
 vcl/qa/cppunit/pdfexport/pdfexport.cxx |6 ++
 vcl/source/gdi/pdfwriter_impl.cxx  |   16 ++--
 2 files changed, 16 insertions(+), 6 deletions(-)

New commits:
commit da7b06425155938fb0d02c6c178d63fd95ad0cd4
Author: Dr. David Alan Gilbert 
AuthorDate: Sat Nov 13 01:33:06 2021 +
Commit: Xisco Fauli 
CommitDate: Thu Mar 10 10:26:23 2022 +0100

tdf#143216: pdfwriter: Don't treat semi-valid URIs as local paths

Currently the PDF writer treats URIs that are rejected by INetURIObject,
as local files, and prepends a path to them.  For URIs that are valid
according to the basic URI syntax, but unhandled by INetURIObject
(such as http://user:password@domain) this produces a confusing result
with a ./uri in the PDF.

Avoid the prefixing where the URI follows the basic URI syntax, even
if INetURIObject didn't like it.

Change-Id: I87c599885a40fd7101c678ae79f83f594d0f23ee
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125202
Reviewed-by: Stephan Bergmann 
Tested-by: Jenkins
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131259

diff --git a/vcl/qa/cppunit/pdfexport/pdfexport.cxx 
b/vcl/qa/cppunit/pdfexport/pdfexport.cxx
index b6e251509d06..8934e11c0e9f 100644
--- a/vcl/qa/cppunit/pdfexport/pdfexport.cxx
+++ b/vcl/qa/cppunit/pdfexport/pdfexport.cxx
@@ -2962,6 +2962,12 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testURIs)
 "file://localfile.odt/",
 true,
 },
+{
+// tdf 143216
+"http://username:passw...@example.com";,
+"http://username:passw...@example.com";,
+true,
+},
 {
 "git://git.example.org/project/example",
 "git://git.example.org/project/example",
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx 
b/vcl/source/gdi/pdfwriter_impl.cxx
index b5e94882a0fb..141c4f823fc1 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -47,6 +47,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -3280,6 +3281,7 @@ we check in the following sequence:
 boolbTargetHasPDFExtension = false;
 INetProtocol eTargetProtocol = aTargetURL.GetProtocol();
 boolbIsUNCPath = false;
+boolbUnparsedURI = false;
 
 // check if the protocol is a known one, or if there is no 
protocol at all (on target only)
 // if there is no protocol, make the target relative to the 
current document directory
@@ -3292,14 +3294,14 @@ we check in the following sequence:
 }
 else
 {
-INetURLObject aNewBase( aDocumentURL );//duplicate 
document URL
-aNewBase.removeSegment(); //remove last segment from it, 
obtaining the base URL of the
-  //target document
-aNewBase.insertName( url );
-aTargetURL = aNewBase;//reassign the new target URL
+INetURLObject 
aNewURL(rtl::Uri::convertRelToAbs(m_aContext.BaseURL, url));
+aTargetURL = aNewURL; //reassign the new target URL
+
 //recompute the target protocol, with the new URL
 //normal URL processing resumes
 eTargetProtocol = aTargetURL.GetProtocol();
+
+bUnparsedURI = eTargetProtocol == INetProtocol::NotValid;
 }
 }
 
@@ -3415,7 +3417,9 @@ we check in the following sequence:
 //substitute the fragment
 aTargetURL.SetMark( 
OStringToOUString(aLineLoc.makeStringAndClear(), RTL_TEXTENCODING_ASCII_US) );
 }
-OUString aURL = aTargetURL.GetMainURL( bFileSpec ? 
INetURLObject::DecodeMechanism::WithCharset : 
INetURLObject::DecodeMechanism::NONE );
+OUString aURL = bUnparsedURI ? url :
+   aTargetURL.GetMainURL( 
bFileSpec ? INetURLObject::DecodeMechanism::WithCharset :
+   
   INetURLObject::DecodeMechanism::NONE );
 appendLiteralStringEncrypt(bSetRelative ? 
INetURLObject::GetRelURL( m_aContext.BaseURL, aURL,

 INetURLObject::EncodeMechanism::WasEncoded,

 bFileSpec ? INetURLObject::DecodeMechanism::WithCharset : 
INetURLObject::DecodeMechanism::NONE


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

2022-03-10 Thread Dr. David Alan Gilbert (via logerrit)
 vcl/qa/cppunit/pdfexport/pdfexport.cxx |   73 +++--
 1 file changed, 44 insertions(+), 29 deletions(-)

New commits:
commit cc86bc599c8b3ce786e05246e8255917ab12
Author: Dr. David Alan Gilbert 
AuthorDate: Sat Feb 19 15:13:01 2022 +
Commit: Xisco Fauli 
CommitDate: Thu Mar 10 10:25:56 2022 +0100

pdfwriter: Add check without relativeFsys

Set relativeFsys on a per-test basis and add a test with
relativeFsys off.

Change-Id: I43b1d82200aca37b2cf8ac71d77a4aa61df543ba
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130197
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131258

diff --git a/vcl/qa/cppunit/pdfexport/pdfexport.cxx 
b/vcl/qa/cppunit/pdfexport/pdfexport.cxx
index 62f4c56efcb9..b6e251509d06 100644
--- a/vcl/qa/cppunit/pdfexport/pdfexport.cxx
+++ b/vcl/qa/cppunit/pdfexport/pdfexport.cxx
@@ -2950,28 +2950,43 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testURIs)
 {
 OUString in;
 OString out;
-} URIs[] = { {
- "http://example.com/";,
- "http://example.com/";,
- },
- {
- "file://localfile.odt/",
- "file://localfile.odt/",
- },
- {
- "git://git.example.org/project/example",
- "git://git.example.org/project/example",
- },
- {
- // The odt/pdf gets substituted due to 
'ConvertOOoTargetToPDFTarget'
- "filebypath.odt",
- "filebypath.pdf",
- },
- {
- // This also gets made relative due to 
'ExportLinksRelativeFsys'
- utl::TempFile::GetTempNameBaseDirectory() + 
"fileintempdir.odt",
- "fileintempdir.pdf",
- } };
+bool relativeFsys;
+} URIs[]
+= { {
+"http://example.com/";,
+"http://example.com/";,
+true,
+},
+{
+"file://localfile.odt/",
+"file://localfile.odt/",
+true,
+},
+{
+"git://git.example.org/project/example",
+"git://git.example.org/project/example",
+true,
+},
+{
+// The odt/pdf gets substituted due to 
'ConvertOOoTargetToPDFTarget'
+"filebypath.odt",
+"filebypath.pdf",
+true,
+},
+{
+// The odt/pdf gets substituted due to 
'ConvertOOoTargetToPDFTarget'
+// but this time with ExportLinksRelativeFsys off the path is 
added
+"filebypath.odt",
+OUStringToOString(utl::TempFile::GetTempNameBaseDirectory(), 
RTL_TEXTENCODING_UTF8)
++ "filebypath.pdf",
+false,
+},
+{
+// This also gets made relative due to 
'ExportLinksRelativeFsys'
+utl::TempFile::GetTempNameBaseDirectory() + 
"fileintempdir.odt",
+"fileintempdir.pdf",
+true,
+} };
 
 // Create an empty document.
 // Note: The test harness gets very upset if we try and create multiple
@@ -2986,15 +3001,15 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testURIs)
 uno::Reference xModel(mxComponent, uno::UNO_QUERY);
 xModel->attachResource(maTempFile.GetURL(), xModel->getArgs());
 
-// Test the filename rewriting
-uno::Sequence 
aFilterData(comphelper::InitPropertySequence({
-{ "ExportLinksRelativeFsys", uno::makeAny(true) },
-{ "ConvertOOoTargetToPDFTarget", uno::makeAny(true) },
-}));
-aMediaDescriptor["FilterData"] <<= aFilterData;
-
 for (unsigned int i = 0; i < (sizeof(URIs) / sizeof(URIs[0])); i++)
 {
+// Test the filename rewriting
+uno::Sequence 
aFilterData(comphelper::InitPropertySequence({
+{ "ExportLinksRelativeFsys", uno::makeAny(URIs[i].relativeFsys) },
+{ "ConvertOOoTargetToPDFTarget", uno::makeAny(true) },
+}));
+aMediaDescriptor["FilterData"] <<= aFilterData;
+
 // Add a link (based on testNestedHyperlink in rtfexport3)
 xCursor->gotoStart(/*bExpand=*/false);
 xCursor->gotoEnd(/*bExpand=*/true);


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

2022-03-10 Thread Dr. David Alan Gilbert (via logerrit)
 vcl/qa/cppunit/pdfexport/pdfexport.cxx |   96 +
 1 file changed, 96 insertions(+)

New commits:
commit 0e6e1f37ee1d9fb6de41f6f18759b12d17344310
Author: Dr. David Alan Gilbert 
AuthorDate: Sun Nov 14 15:26:51 2021 +
Commit: Xisco Fauli 
CommitDate: Thu Mar 10 10:25:40 2022 +0100

pdfwriter: Check URIs exported

Check the URIs that are exported.

Change-Id: I2d8b00f767a61c5abdb9163701fe497bb258c790
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125203
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131257

diff --git a/vcl/qa/cppunit/pdfexport/pdfexport.cxx 
b/vcl/qa/cppunit/pdfexport/pdfexport.cxx
index 4050c8a5d7e9..62f4c56efcb9 100644
--- a/vcl/qa/cppunit/pdfexport/pdfexport.cxx
+++ b/vcl/qa/cppunit/pdfexport/pdfexport.cxx
@@ -2944,6 +2944,102 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, 
testPdfImageHyperlink)
 #endif
 }
 
+CPPUNIT_TEST_FIXTURE(PdfExportTest, testURIs)
+{
+struct
+{
+OUString in;
+OString out;
+} URIs[] = { {
+ "http://example.com/";,
+ "http://example.com/";,
+ },
+ {
+ "file://localfile.odt/",
+ "file://localfile.odt/",
+ },
+ {
+ "git://git.example.org/project/example",
+ "git://git.example.org/project/example",
+ },
+ {
+ // The odt/pdf gets substituted due to 
'ConvertOOoTargetToPDFTarget'
+ "filebypath.odt",
+ "filebypath.pdf",
+ },
+ {
+ // This also gets made relative due to 
'ExportLinksRelativeFsys'
+ utl::TempFile::GetTempNameBaseDirectory() + 
"fileintempdir.odt",
+ "fileintempdir.pdf",
+ } };
+
+// Create an empty document.
+// Note: The test harness gets very upset if we try and create multiple
+// documents, or recreate it; so reuse one instance for all the links
+mxComponent = loadFromDesktop("private:factory/swriter");
+uno::Reference xTextDocument(mxComponent, 
uno::UNO_QUERY);
+uno::Reference xText = xTextDocument->getText();
+uno::Reference xCursor = xText->createTextCursor();
+xText->insertString(xCursor, "Test pdf", /*bAbsorb=*/false);
+
+// Set the name so it can do relative name replacement
+uno::Reference xModel(mxComponent, uno::UNO_QUERY);
+xModel->attachResource(maTempFile.GetURL(), xModel->getArgs());
+
+// Test the filename rewriting
+uno::Sequence 
aFilterData(comphelper::InitPropertySequence({
+{ "ExportLinksRelativeFsys", uno::makeAny(true) },
+{ "ConvertOOoTargetToPDFTarget", uno::makeAny(true) },
+}));
+aMediaDescriptor["FilterData"] <<= aFilterData;
+
+for (unsigned int i = 0; i < (sizeof(URIs) / sizeof(URIs[0])); i++)
+{
+// Add a link (based on testNestedHyperlink in rtfexport3)
+xCursor->gotoStart(/*bExpand=*/false);
+xCursor->gotoEnd(/*bExpand=*/true);
+uno::Reference xCursorProps(xCursor, 
uno::UNO_QUERY);
+xCursorProps->setPropertyValue("HyperLinkURL", 
uno::makeAny(URIs[i].in));
+
+// Save as PDF.
+uno::Reference xStorable(mxComponent, 
uno::UNO_QUERY);
+aMediaDescriptor["FilterName"] <<= OUString("writer_pdf_Export");
+xStorable->storeToURL(maTempFile.GetURL(), 
aMediaDescriptor.getAsConstPropertyValueList());
+
+// Use the filter rather than the pdfium route, as per the tdf105093 
test, it's
+// easier to parse the annotations
+vcl::filter::PDFDocument aDocument;
+
+// Parse the export result.
+SvFileStream aStream(maTempFile.GetURL(), StreamMode::READ);
+CPPUNIT_ASSERT(aDocument.Read(aStream));
+
+// The document has one page.
+std::vector aPages = 
aDocument.GetPages();
+CPPUNIT_ASSERT_EQUAL(static_cast(1), aPages.size());
+auto pAnnots = 
dynamic_cast(aPages[0]->Lookup("Annots"));
+CPPUNIT_ASSERT(pAnnots);
+
+// There should be one annotation
+CPPUNIT_ASSERT_EQUAL(static_cast(1), 
pAnnots->GetElements().size());
+auto pAnnotReference
+= 
dynamic_cast(pAnnots->GetElements()[0]);
+CPPUNIT_ASSERT(pAnnotReference);
+vcl::filter::PDFObjectElement* pAnnot = 
pAnnotReference->LookupObject();
+CPPUNIT_ASSERT(pAnnot);
+// We're expecting something like /Type /Annot /A << /Type /Action /S 
/URI /URI (path)
+CPPUNIT_ASSERT_EQUAL(
+OString("Annot"),
+
static_cast(pAnnot->Lookup("Type"))->GetValue());
+auto pAction = 
dynamic_cast(pAnnot->Lookup("A"));
+CPPUNIT_ASSERT(pAction);
+auto pURIElem
+= 
dynamic_cast(pA

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

2022-03-10 Thread Caolán McNamara (via logerrit)
 sc/source/core/tool/rangenam.cxx |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 24babdb2bca7c57f09535a867d1ff0b5e0fc1671
Author: Caolán McNamara 
AuthorDate: Wed Mar 9 20:40:00 2022 +
Commit: Caolán McNamara 
CommitDate: Thu Mar 10 09:47:10 2022 +0100

ofz: Use-of-uninitialized-value

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

diff --git a/sc/source/core/tool/rangenam.cxx b/sc/source/core/tool/rangenam.cxx
index 89d3f9e75055..e5eb52c2b181 100644
--- a/sc/source/core/tool/rangenam.cxx
+++ b/sc/source/core/tool/rangenam.cxx
@@ -666,7 +666,11 @@ public:
 
 }
 
-ScRangeName::ScRangeName() {}
+ScRangeName::ScRangeName()
+: mHasPossibleAddressConflict(false)
+, mHasPossibleAddressConflictDirty(false)
+{
+}
 
 ScRangeName::ScRangeName(const ScRangeName& r)
 : mHasPossibleAddressConflict( r.mHasPossibleAddressConflict )


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

2022-03-10 Thread Miklos Vajna (via logerrit)
 sw/qa/core/text/data/clearing-break-start.fodt |   28 +++
 sw/qa/core/text/text.cxx   |   30 +
 sw/source/core/text/porlay.cxx |   19 +++
 3 files changed, 76 insertions(+), 1 deletion(-)

New commits:
commit cee9b476d51f770fba03cb20b58370762d387e63
Author: Miklos Vajna 
AuthorDate: Thu Mar 10 08:18:55 2022 +0100
Commit: Miklos Vajna 
CommitDate: Thu Mar 10 09:20:28 2022 +0100

sw clearing breaks: fix layout when the line is empty

The break portion's height was not taken into account when the line had
no text portion ("had no content"). Fix that codepath to also take the
break portion's height into account, in case that's a clearing break.

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

diff --git a/sw/qa/core/text/data/clearing-break-start.fodt 
b/sw/qa/core/text/data/clearing-break-start.fodt
new file mode 100644
index ..f2df00fadd4f
--- /dev/null
+++ b/sw/qa/core/text/data/clearing-break-start.fodt
@@ -0,0 +1,28 @@
+
+
+  
+
+  
+
+  
+  
+
+  iVBORw0KGgoNSUhEUgAAAEBACAQAYLlVBGdBTUEAALGPC/xhBQFz
+   UkdCAK7OHOkgY0hSTQAAeiYAAICEAAD6gOgAAHUwAADqYAAAOpgAABdwnLpRPAAA
+   AAJiS0dEAACqjSMyCW9GRnMGAAAMc1XTCXBIWXMAAA3XAAAN1wFCKJt4
+   CXZwQWcAAABMQACdMTgbAAABzUlEQVRo3u3ZPU/CQBjA8X+Jxs3ESUDj4iK+LA5+
+   BBfjqBE1cXB2MlFAEqMgxvhNNL4sLsK3UPQL6ObkoAETz+FKW2mxCPRYnucWUu76/OC59C49
+   cGOCKqrD9kHRc6ddPv7oW2WCwMh0nF63Myz7Tm8hPTNu0pgHMER3scepTbgK6enJNND83RLn
+   /878yRaPmgBZFDuMsNLeWB9gmFQHP77MIg9gsYciR50NFKvtjIy10yk84pSZA7DYpwR8scmF
+   QQCMuoQMpzbh0iAARrlnVn90CWHTsZcAiHPPdINQAuqsc2MQAAnKDUKWEhZ10twaBEDSJWQo
+   YlFj7S9CzwEegkXWIbQsRAQASFJhpplwbRAACS+hANRJBxMiAkDcJeQ4sQkBhYgMoJ+Ozlwo
+   2YQ7AJ6CRxyiUGnVy3hVKb0Af9v7hUG2Wy9TEQCUelFTDULB2S+YKYGOMcpM6UIccOQnRA6A
+   cSp6ibfI+wkGADBGpTEd8xz1AaAfTQ7huA8AvUw5hVjuA0D/C5OaMN8XACRZ8F0zCggKAQhA
+   AAIQgAAEIAABCEAAAhCAAAQgAAH4zg3feY4w3Xs44M5+oW0qvCWoGcvaIlM3x/f/ab+O738A
+   hOCNQr34oD4ldEVYdGNyZWF0ZS1kYXRlADIwMTAtMTItMjBUMTc6MDg6MzYrMDE6MDB6
+   5RscJXRFWHRtb2RpZnktZGF0ZQAyMDEwLTEyLTIwVDE3OjA4OjM3KzAxOjAwgyNmnAAA
+   AABJRU5ErkJggg==
+  X
+
+  
+
diff --git a/sw/qa/core/text/text.cxx b/sw/qa/core/text/text.cxx
index 39e33e01a580..317139c5ec37 100644
--- a/sw/qa/core/text/text.cxx
+++ b/sw/qa/core/text/text.cxx
@@ -290,6 +290,36 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testClearingLineBreak)
 assertXPath(pXmlDoc, "//SwParaPortion/SwLineLayout[1]", "height", "1024");
 }
 
+CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testClearingLineBreakAtStart)
+{
+// Given a document with a fly frame and a character wrapped around it:
+createSwDoc(DATA_DIRECTORY, "clearing-break-start.fodt");
+// Insert a clearing break before "X":
+uno::Reference xDocument(mxComponent, uno::UNO_QUERY);
+uno::Reference xText = xDocument->getText();
+uno::Reference xCursor = xText->createTextCursor();
+xCursor->gotoEnd(/*bSelect=*/false);
+xCursor->goLeft(/*nCount=*/1, /*bSelect=*/false);
+uno::Reference xFactory(mxComponent, 
uno::UNO_QUERY);
+uno::Reference xLineBreak(
+xFactory->createInstance("com.sun.star.text.LineBreak"), 
uno::UNO_QUERY);
+uno::Reference xLineBreakProps(xLineBreak, 
uno::UNO_QUERY);
+auto eClear = static_cast(SwLineBreakClear::ALL);
+xLineBreakProps->setPropertyValue("Clear", uno::makeAny(eClear));
+xText->insertTextContent(xCursor, xLineBreak, /*bAbsorb=*/false);
+
+// When laying out that document:
+xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+
+// Then make sure that the second line "jumps down", below the fly frame:
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: 1024
+// - Actual  : 276
+// i.e. the line height was too small, but only in case the full line was 
a fly and a break
+// portion, without any real content.
+assertXPath(pXmlDoc, "//SwParaPortion/SwLineLayout[1]", "height", "1024");
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index dcab6f1db4e9..84c6837d56c1 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -339,6 +339,10 @@ void SwLineLayout::CalcLine( SwTextFormatter &rLine, 
SwTextFormatInfo &rInf )
 sal_uInt16 nFlyAscent = 0;
 sal_uInt16 nFlyHeight = 0;
 sal_uInt16 nFlyDescent = 0;
+
+// If this line has a clearing break, then this is the portion's height.
+sal_uInt16 nBreakHeight = 0;
+
 bool bOnlyPostIts = true;
 SetHanging( false );
 
@@ -455,6 +459,7 @@ void SwLineLayout::CalcLine( SwTextFormatter &rLine, 
SwTextFormatInfo &rInf )
  

Re: Store properties of OOXML 3D-shapes in ODF

2022-03-10 Thread Miklos Vajna
Hi Regina,

On Wed, Mar 09, 2022 at 04:17:57PM +0100, Regina Henschel 
 wrote:
> I have started a discussion in the ODF TC how ODF could be enhanced to be
> able to store properties which are needed to render OOXML 3D-shapes (I mean
> the normal shapes in 3D-mode, not the new "3D Model" of MS Office). I have
> collected all the problems I see in the attached document.
> 
> If you have ideas how to solve the problems or if you see further problems,
> please tell me.
> 
> Currently we put most of the information in an InteropGrabBag. I started the
> discussion in the ODF TC because I think we need to know the target before
> we start an actual import.

Thanks. Yes, we should get rid of the InteropGrabBag for 3D properties
in the long run and implement them natively, including rendering.

I think your document makes sense. Perhaps thinking about the markup for
3D rotation of custom shapes (2.4 in your document) would be good,
that's a quite frequent feature, and it's no clear how to represent that
in ODF. I mean OOXML markup like:

  

  

  

In any case, once somebody will have time to implement these, it'll be
useful to have a proposal how to represent the feature in ODF.

Regards,

Miklos