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

2021-08-09 Thread Vasily Melenchuk (via logerrit)
 sw/inc/editsh.hxx |3 +--
 sw/inc/swtypes.hxx|2 --
 sw/source/core/doc/docnum.cxx |1 -
 sw/source/filter/ww8/wrtw8nds.cxx |6 +++---
 sw/source/filter/ww8/ww8atr.cxx   |5 ++---
 5 files changed, 6 insertions(+), 11 deletions(-)

New commits:
commit 29e5fad7ed64459d04df61b57ecd8eaba6d8bfae
Author: Vasily Melenchuk 
AuthorDate: Fri Aug 6 13:39:46 2021 +0300
Commit: Thorsten Behrens 
CommitDate: Tue Aug 10 08:56:00 2021 +0200

sw: removed unused NO_NUMLEVEL

NO_NUMLEVEL is not used in code for a while.

Change-Id: Ia39879723455dbe5cc13b20042e930088618588d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120113
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git a/sw/inc/editsh.hxx b/sw/inc/editsh.hxx
index ca2c2efcb0ab..cea1eab10691 100644
--- a/sw/inc/editsh.hxx
+++ b/sw/inc/editsh.hxx
@@ -539,8 +539,7 @@ public:
 bool IsNoNum( bool bChkStart = true ) const;
 
 /** @return Num-Level of the node in which point of cursor is.
- @return values can be: NO_NUMBERING,
- 0..MAXLEVEL-1, NO_NUMLEVEL .. NO_NUMLEVEL|MAXLEVEL-1 */
+ @return values can be: NO_NUMBERING, 0..MAXLEVEL-1 */
 sal_uInt8 GetNumLevel() const;
 
 /// Detect highest and lowest level to check moving of outline levels.
diff --git a/sw/inc/swtypes.hxx b/sw/inc/swtypes.hxx
index ff79edb47d02..a091a538d9a9 100644
--- a/sw/inc/swtypes.hxx
+++ b/sw/inc/swtypes.hxx
@@ -91,8 +91,6 @@ enum class SwLabelType
 
 constexpr sal_uInt8 MAXLEVEL = 10;
 
-constexpr sal_uInt8 NO_NUMLEVEL = 0x20;// "or" with the levels.
-
 //  Values for indents at numbering and bullet lists.
 //  (For more levels the values have to be multiplied with the levels+1;
 //  levels 0 ..4!)
diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx
index 430d19220329..b931646aaa2c 100644
--- a/sw/source/core/doc/docnum.cxx
+++ b/sw/source/core/doc/docnum.cxx
@@ -1515,7 +1515,6 @@ static bool lcl_GotoNextPrevNum( SwPosition& rPos, bool 
bNext,
 SwNodeIndex aIdx( rPos.nNode );
 if( ! pNd->IsCountedInList() )
 {
-// If NO_NUMLEVEL is switched on, we search the preceding Node with 
Numbering
 bool bError = false;
 do {
 sw::GotoPrevLayoutTextFrame(aIdx, pLayout);
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx 
b/sw/source/filter/ww8/wrtw8nds.cxx
index 5eeb9f6001f5..979300ff5ff2 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -2969,12 +2969,12 @@ void MSWordExportBase::OutputTextNode( SwTextNode& 
rNode )
 // isn't exported as numbered, but not counted, if no other 
attribute
 // is found in 
 // #i44815# adjust numbering/indents for numbered paragraphs
-//  without number (NO_NUMLEVEL)
+//  without number
 // #i47013# need to check rNode.GetNumRule()!=NULL as well.
 if ( ! rNode.IsCountedInList() && rNode.GetNumRule()!=nullptr )
 {
 // WW8 does not know numbered paragraphs without number
-// (NO_NUMLEVEL). In WW8AttributeOutput::ParaNumRule(), we 
will export
+// In WW8AttributeOutput::ParaNumRule(), we will export
 // the RES_PARATR_NUMRULE as list-id 0, which in WW8 means
 // no numbering. Here, we will adjust the indents to match
 // visually.
@@ -3014,7 +3014,7 @@ void MSWordExportBase::OutputTextNode( SwTextNode& rNode )
 }
 
 // new first line indent = 0
-// (first line indent is ignored for NO_NUMLEVEL)
+// (first line indent is ignored)
 if (!bParaRTL)
 aLRSpace.SetTextFirstLineOffset( 0 );
 
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 7fe5a330a37b..825e70cd4356 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -3735,9 +3735,8 @@ void AttributeOutputBase::ParaNumRule( const 
SwNumRuleItem& rNumRule )
 else
 {
 // #i44815# adjust numbering for numbered paragraphs
-// without number (NO_NUMLEVEL). These paragraphs
-// will receive a list id 0, which WW interprets as
-// 'no number'.
+// without number. These paragraphs will receive a
+// list id 0, which WW interprets as 'no number'.
 nNumId = 0;
 }
 }


GSoC - Weekly Report - #9 - Table styles

2021-08-09 Thread Balázs Sántha
Dear Community!

This week I was still working with my ongoing optimization.
Unfortuantely, it turned out, that some of the unit tests were failing with
the new patch. As I wasn't able to get much detail out from the Jenkins
log, I must have started to debug the problematic unit tests on my own.
After 2-3 days, I finally resolved all of the problems with the tests. One
of the problems was an index out of bound problem, which was causing some
of the crashes in the unit test. Interesting, that I wasn't able to get the
crash, when I tried to trigger it manually with a test document. After all
the test were finally fine, I still wanted to give a full support of the
import of direct character formatting.This was important, as they are lost
now, if they are applied on an empty cell (in a normal situation, these
direct char props are stored in SwpHints, but in empty cells, this isn't
solved). Recently this problem was solved by copying these paras into the
paragraph properties, so in this way, they support the copying of the new
rows. Originally my patch aimed to remove this functionality, as this
operation (copying direct char props into paragraphs) was done for every
cell and was very slow, but for these rare cases, when direct character
formattings are applied on empty cells, I still needed to keep this code in
the writerfilter. Nice thing, that with the modification I made in the
core, we only need to do this, when the cell is empty, which is quite
simple to test.
Furthermore I was trying to cherry-pick and rebase Alex Ivan's table-style
branch from 2013, on top of the recent master, without much success. This
week, I will continue this work, but with a different approach. As I have
already managed to build that branch (on a VirtualMachine), I will be able
to power off his commits, one-by-one, to test and understand his work.

If you have any questions, ideas, thoughts or suggestions, please share
with me!

Regards,
Balázs Sántha, santhab


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

2021-08-09 Thread Tünde Tóth (via logerrit)
 sc/qa/unit/data/ods/tdf143220.ods  |binary
 sc/qa/unit/subsequent_export-test2.cxx |   15 +++
 sc/source/filter/excel/xecontent.cxx   |8 +---
 3 files changed, 20 insertions(+), 3 deletions(-)

New commits:
commit a5812749820d5118c3bb4297e5f785635c75f07a
Author: Tünde Tóth 
AuthorDate: Wed Jul 14 14:57:00 2021 +0200
Commit: Xisco Fauli 
CommitDate: Tue Aug 10 08:37:49 2021 +0200

tdf#143220 XLSX export: fix hyperlink to sheet target

Hyperlink to another sheet didn't work in Excel.

Change-Id: Ic63e581d5de8f7ff1eac50a5e56a51d7ba2e72ce
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118935
Tested-by: Jenkins
Tested-by: László Németh 
Reviewed-by: László Németh 
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120221

diff --git a/sc/qa/unit/data/ods/tdf143220.ods 
b/sc/qa/unit/data/ods/tdf143220.ods
new file mode 100644
index ..6aa1536eae8e
Binary files /dev/null and b/sc/qa/unit/data/ods/tdf143220.ods differ
diff --git a/sc/qa/unit/subsequent_export-test2.cxx 
b/sc/qa/unit/subsequent_export-test2.cxx
index 6cc0ece437d6..8a1dc168fe26 100644
--- a/sc/qa/unit/subsequent_export-test2.cxx
+++ b/sc/qa/unit/subsequent_export-test2.cxx
@@ -190,6 +190,7 @@ public:
 void testTdf142854_GridVisibilityImportXlsxInHeadlessMode();
 void testTdf140431();
 void testTdf142929_filterLessThanXLSX();
+void testTdf143220XLSX();
 
 CPPUNIT_TEST_SUITE(ScExportTest2);
 
@@ -288,6 +289,7 @@ public:
 CPPUNIT_TEST(testTdf142854_GridVisibilityImportXlsxInHeadlessMode);
 CPPUNIT_TEST(testTdf140431);
 CPPUNIT_TEST(testTdf142929_filterLessThanXLSX);
+CPPUNIT_TEST(testTdf143220XLSX);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -2355,6 +2357,19 @@ void ScExportTest2::testTdf142929_filterLessThanXLSX()
 xDocSh->DoClose();
 }
 
+void ScExportTest2::testTdf143220XLSX()
+{
+ScDocShellRef xDocSh = loadDoc(u"tdf143220.", FORMAT_ODS);
+CPPUNIT_ASSERT(xDocSh.is());
+
+xmlDocUniquePtr pDoc = XPathHelper::parseExport2(*this, *xDocSh, 
m_xSFactory,
+ 
"xl/worksheets/sheet1.xml", FORMAT_XLSX);
+CPPUNIT_ASSERT(pDoc);
+assertXPath(pDoc, "/x:worksheet/x:hyperlinks/x:hyperlink", "location", 
"Sheet2!A1");
+
+xDocSh->DoClose();
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(ScExportTest2);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sc/source/filter/excel/xecontent.cxx 
b/sc/source/filter/excel/xecontent.cxx
index 0848745b8d4a..0a7a3baeb953 100644
--- a/sc/source/filter/excel/xecontent.cxx
+++ b/sc/source/filter/excel/xecontent.cxx
@@ -428,15 +428,17 @@ XclExpHyperlink::XclExpHyperlink( const XclExpRoot& 
rRoot, const SvxURLField& rU
aTextMark = aTextMark.replaceAt( nSepPos, 1, "!" );
 }
 
-if(nSepPos != -1)
+if (nSepPos != -1)
 {
-OUString aSheetName( aTextMark.copy(0, nSepPos));
+OUString aSheetName(aTextMark.copy(0, nSepPos));
 
-if ( aSheetName.indexOf(' ') != -1 && aSheetName[0] != '\'')
+if (aSheetName.indexOf(' ') != -1 && aSheetName[0] != '\'')
 {
 aTextMark = "'" + aTextMark.replaceAt(nSepPos, 0, "'");
 }
 }
+else
+aTextMark += "!A1";// tdf#143220 link to sheet not valid 
without cell reference
 
 mxTextMark.reset( new XclExpString( aTextMark, 
XclStrFlags::ForceUnicode, 255 ) );
 }


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

2021-08-09 Thread Tomaž Vajngerl (via logerrit)
 desktop/qa/desktop_lib/test_desktop_lib.cxx |7 ++--
 sw/source/uibase/uno/unotxdoc.cxx   |   49 
 2 files changed, 40 insertions(+), 16 deletions(-)

New commits:
commit 7da5537f6a43c1b82afc5e0c8d18b8d847293fda
Author: Tomaž Vajngerl 
AuthorDate: Mon Aug 2 22:27:28 2021 +0900
Commit: Tomaž Vajngerl 
CommitDate: Tue Aug 10 08:32:57 2021 +0200

indexing: use XML as input that is identical to indexing XML

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

diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx 
b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index f23f9709416e..dc8b4caf1de4 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -3117,13 +3117,16 @@ void DesktopLOKTest::testRenderSearchResult()
 Scheduler::ProcessEventsToIdle();
 
 unsigned char* pBuffer = nullptr;
-OString aJSON = "{ \"type\" : 1, \"node_index\" : 19 }";
+OString aPayload =
+""
+"ABC"
+"";
 
 int nWidth = 0;
 int nHeight = 0;
 size_t nByteSize = 0;
 
-bool bResult = pDocument->m_pDocumentClass->renderSearchResult(pDocument, 
aJSON.getStr(), &pBuffer, &nWidth, &nHeight, &nByteSize);
+bool bResult = pDocument->m_pDocumentClass->renderSearchResult(pDocument, 
aPayload.getStr(), &pBuffer, &nWidth, &nHeight, &nByteSize);
 
 CPPUNIT_ASSERT(bResult);
 CPPUNIT_ASSERT(pBuffer);
diff --git a/sw/source/uibase/uno/unotxdoc.cxx 
b/sw/source/uibase/uno/unotxdoc.cxx
index 2940c52b8256..51dfac84254c 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -122,7 +122,6 @@
 #include 
 #include 
 
-
 #include 
 #include 
 
@@ -164,7 +163,7 @@
 
 #include 
 #include 
-#include 
+#include 
 
 #define TWIPS_PER_PIXEL 15
 
@@ -3397,23 +3396,45 @@ SwXTextDocument::getSearchResultRectangles(const char* 
pPayload)
 {
 std::vector aRectangles;
 
-boost::property_tree::ptree aTree;
-std::stringstream aStream(pPayload);
-boost::property_tree::read_json(aStream, aTree);
+const OString aPayloadString(pPayload);
 
-sw::search::SearchIndexData aData;
+SvMemoryStream aStream(const_cast(aPayloadString.getStr()), 
aPayloadString.getLength(), StreamMode::READ);
+tools::XmlWalker aWalker;
+if (!aWalker.open(&aStream))
+return aRectangles;
 
-int nType = aTree.get("type");
+if (aWalker.name() == "indexing")
+{
+SwDoc* pDoc = m_pDocShell->GetDoc();
 
-aData.nNodeIndex = sal_uInt32(aTree.get("node_index"));
-aData.eType = sw::search::NodeType(nType);
+sw::search::SearchIndexData aData;
 
-SwDoc* pDoc = m_pDocShell->GetDoc();
+aWalker.children();
+while (aWalker.isValid())
+{
+if (aWalker.name() == "paragraph")
+{
+OString sType = aWalker.attribute("type");
+OString sIndex = aWalker.attribute("index");
+
+if (!sType.isEmpty() && !sIndex.isEmpty())
+{
+aData.nNodeIndex = sIndex.toInt32();
+aData.eType = sw::search::NodeType(sType.toInt32());
 
-sw::search::SearchResultLocator aLocator(pDoc);
-sw::search::LocationResult aResult = aLocator.find(aData);
-if (aResult.mbFound)
-aRectangles = aResult.maRectangles;
+sw::search::SearchResultLocator aLocator(pDoc);
+sw::search::LocationResult aResult = aLocator.find(aData);
+if (aResult.mbFound)
+{
+for (auto const & rRect : aResult.maRectangles)
+aRectangles.push_back(rRect);
+}
+}
+}
+aWalker.next();
+}
+aWalker.parent();
+}
 
 return aRectangles;
 }


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

2021-08-09 Thread Bjoern Michaelsen (via logerrit)
 sw/inc/swtblfmt.hxx  |7 
 sw/source/core/table/swtable.cxx |  312 ++-
 2 files changed, 155 insertions(+), 164 deletions(-)

New commits:
commit fa5202f746b25ea444d120d746a0dc35b8f8cca5
Author: Bjoern Michaelsen 
AuthorDate: Sat Aug 7 11:38:03 2021 +0200
Commit: Bjoern Michaelsen 
CommitDate: Tue Aug 10 08:29:55 2021 +0200

give SwTableBoxFormat::TableBoxAttributeChanged its own function

- ... because at somewhere around growing past 100 LOC it deserved that.
- also make the box a reference there as it should never be a nullptr

Change-Id: Ia14cfb7a88e14fdd02f6011a745c2b008d94bc10
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120159
Tested-by: Jenkins
Reviewed-by: Bjoern Michaelsen 

diff --git a/sw/inc/swtblfmt.hxx b/sw/inc/swtblfmt.hxx
index 14b200164b5d..e61049919df1 100644
--- a/sw/inc/swtblfmt.hxx
+++ b/sw/inc/swtblfmt.hxx
@@ -46,16 +46,17 @@ public:
 virtual bool supportsFullDrawingLayerFillAttributeSet() const override;
 };
 
-class SAL_DLLPUBLIC_RTTI SwTableBoxFormat final : public SwFrameFormat
+class SAL_DLLPUBLIC_RTTI SwTableBoxFormat final: public SwFrameFormat
 {
 friend class SwDoc;
 
-SwTableBoxFormat( SwAttrPool& rPool, SwFrameFormat *pDrvdFrame )
-: SwFrameFormat( rPool, OUString(), pDrvdFrame, RES_FRMFMT, 
aTableBoxSetRange )
+SwTableBoxFormat(SwAttrPool& rPool, SwFrameFormat* pDrvdFrame)
+: SwFrameFormat(rPool, OUString(), pDrvdFrame, RES_FRMFMT, 
aTableBoxSetRange)
 {}
 
 // For recognition of changes (especially TableBoxAttribute).
 virtual void SwClientNotify(const SwModify&, const SfxHint&) override;
+void BoxAttributeChanged(SwTableBox& rBox, const SwTableBoxNumFormat* 
pNewFormat, const SwTableBoxFormula* pNewFormula, const SwTableBoxValue* 
pNewValue, const sal_uLong nOldFormat);
 
 public:
 virtual bool supportsFullDrawingLayerFillAttributeSet() const override;
diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx
index c750aa3d75f9..c17d6882b019 100644
--- a/sw/source/core/table/swtable.cxx
+++ b/sw/source/core/table/swtable.cxx
@@ -2116,11 +2116,153 @@ static void ChgNumToText( SwTableBox& rBox, sal_uLong 
nFormat )
 }
 
 }
+void SwTableBoxFormat::BoxAttributeChanged(SwTableBox& rBox, const 
SwTableBoxNumFormat* pNewFormat, const SwTableBoxFormula* pNewFormula, const 
SwTableBoxValue* pNewValue, sal_uLong nOldFormat)
+{
+sal_uLong nNewFormat;
+if(pNewFormat)
+{
+nNewFormat = pNewFormat->GetValue();
+// new formatting
+// is it newer or has the current been removed?
+if( SfxItemState::SET != GetItemState(RES_BOXATR_VALUE, false))
+pNewFormat = nullptr;
+}
+else
+{
+// fetch the current Item
+(void)GetItemState(RES_BOXATR_FORMAT, false, reinterpret_cast(&pNewFormat));
+nOldFormat = GetTableBoxNumFormat().GetValue();
+nNewFormat = pNewFormat ? pNewFormat->GetValue() : nOldFormat;
+}
+
+// is it newer or has the current been removed?
+if(pNewValue)
+{
+if(GetDoc()->GetNumberFormatter()->IsTextFormat(nNewFormat))
+nOldFormat = 0;
+else
+{
+if(SfxItemState::SET == GetItemState(RES_BOXATR_VALUE, false))
+nOldFormat = getSwDefaultTextFormat();
+else
+nNewFormat = getSwDefaultTextFormat();
+}
+}
+
+// Logic:
+// Value change: -> "simulate" a format change!
+// Format change:
+// Text -> !Text or format change:
+//  - align right for horizontal alignment, if LEFT or JUSTIFIED
+//  - align bottom for vertical alignment, if TOP is set, or 
default
+//  - replace text (color? negative numbers RED?)
+// !Text -> Text:
+//  - align left for horizontal alignment, if RIGHT
+//  - align top for vertical alignment, if BOTTOM is set
+SvNumberFormatter* pNumFormatr = GetDoc()->GetNumberFormatter();
+bool bNewIsTextFormat = pNumFormatr->IsTextFormat(nNewFormat);
+
+if((!bNewIsTextFormat && nOldFormat != nNewFormat) || pNewFormula)
+{
+bool bIsNumFormat = false;
+OUString aOrigText;
+bool bChgText = true;
+double fVal = 0;
+if(!pNewValue && SfxItemState::SET != GetItemState(RES_BOXATR_VALUE, 
false, reinterpret_cast(&pNewValue)))
+{
+// so far, no value has been set, so try to evaluate the content
+sal_uLong nNdPos = rBox.IsValidNumTextNd();
+if(ULONG_MAX != nNdPos)
+{
+sal_uInt32 nTmpFormatIdx = nNewFormat;
+OUString aText(GetDoc()->GetNodes()[nNdPos] 
->GetTextNode()->GetRedlineText());
+aOrigText = aText;
+if(aText.isEmpty())
+bChgText = false;
+else
+{
+// Keep Tabs
+   

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

2021-08-09 Thread Tomaž Vajngerl (via logerrit)
 sw/qa/extras/indexing/IndexingExportTest.cxx |1 +
 sw/source/filter/indexing/IndexingExport.cxx |4 
 2 files changed, 5 insertions(+)

New commits:
commit df3d733724de84a2b54398434b621049a326c4d8
Author: Tomaž Vajngerl 
AuthorDate: Mon Aug 2 15:18:35 2021 +0900
Commit: Tomaž Vajngerl 
CommitDate: Tue Aug 10 08:09:05 2021 +0200

indexing: add "type" to the xml for paragraph nodes

The type is either WriterNode (1) or SdrObect (2) as we need to
know for which one the index is refering to.

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

diff --git a/sw/qa/extras/indexing/IndexingExportTest.cxx 
b/sw/qa/extras/indexing/IndexingExportTest.cxx
index 41cbfa1c9d79..346ff783d2c4 100644
--- a/sw/qa/extras/indexing/IndexingExportTest.cxx
+++ b/sw/qa/extras/indexing/IndexingExportTest.cxx
@@ -74,6 +74,7 @@ void IndexingExportTest::testIndexingExport_Paragraphs()
 
 assertXPath(pXmlDoc, "/indexing");
 assertXPathContent(pXmlDoc, "/indexing/paragraph[1]", "Title");
+assertXPath(pXmlDoc, "/indexing/paragraph[1]", "type", "1");
 assertXPathContent(pXmlDoc, "/indexing/paragraph[2]", "Heading 1");
 assertXPathContent(pXmlDoc, "/indexing/paragraph[3]", "Heading 2");
 assertXPathContent(pXmlDoc, "/indexing/paragraph[4]", "Paragraph 1");
diff --git a/sw/source/filter/indexing/IndexingExport.cxx 
b/sw/source/filter/indexing/IndexingExport.cxx
index 17a1670bd73c..c7bf032ba83e 100644
--- a/sw/source/filter/indexing/IndexingExport.cxx
+++ b/sw/source/filter/indexing/IndexingExport.cxx
@@ -95,6 +95,7 @@ public:
 = 
pTextNode->GetText().replaceAll(OUStringChar(CH_TXTATR_BREAKWORD), "");
 m_rXmlWriter.startElement("paragraph");
 m_rXmlWriter.attribute("index", pTextNode->GetIndex());
+m_rXmlWriter.attribute("type", "1");
 if (nParentIndex >= 0)
 m_rXmlWriter.attribute("parent", nParentIndex);
 m_rXmlWriter.content(rString);
@@ -121,6 +122,7 @@ public:
 
 m_rXmlWriter.startElement("paragraph");
 m_rXmlWriter.attribute("index", nParagraph);
+m_rXmlWriter.attribute("type", "2");
 m_rXmlWriter.content(sText);
 m_rXmlWriter.endElement();
 }
@@ -136,6 +138,7 @@ public:
 
 m_rXmlWriter.startElement("table");
 m_rXmlWriter.attribute("index", pTableNode->GetIndex());
+m_rXmlWriter.attribute("type", "1");
 m_rXmlWriter.attribute("name", sName);
 
 maNodeStack.push_back(pTableNode);
@@ -145,6 +148,7 @@ public:
 {
 m_rXmlWriter.startElement("section");
 m_rXmlWriter.attribute("index", pSectionNode->GetIndex());
+m_rXmlWriter.attribute("type", "1");
 m_rXmlWriter.attribute("name", 
pSectionNode->GetSection().GetSectionName());
 
 maNodeStack.push_back(pSectionNode);


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

2021-08-09 Thread Tomaž Vajngerl (via logerrit)
 desktop/qa/desktop_lib/test_desktop_lib.cxx   |2 
 sw/qa/extras/indexing/SearchResultLocatorTest.cxx |   50 +
 sw/source/core/inc/SearchResultLocator.hxx|   13 +++-
 sw/source/core/model/SearchResultLocator.cxx  |   62 +-
 sw/source/uibase/uno/unotxdoc.cxx |9 ++-
 5 files changed, 105 insertions(+), 31 deletions(-)

New commits:
commit ea1818b8ba34378b777b8706069d28fade2cc924
Author: Tomaž Vajngerl 
AuthorDate: Fri Jul 9 19:36:58 2021 +0900
Commit: Tomaž Vajngerl 
CommitDate: Tue Aug 10 07:54:06 2021 +0200

indexing: add support for SdrObjects in SearchResultLocator

Also add (node) "type" parameter because we need to differentiate
between Writer nodes and SdrObject nodes.

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

diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx 
b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index 927f24fa26ca..f23f9709416e 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -3117,7 +3117,7 @@ void DesktopLOKTest::testRenderSearchResult()
 Scheduler::ProcessEventsToIdle();
 
 unsigned char* pBuffer = nullptr;
-OString aJSON = "{ \"node_index\" : 19 }";
+OString aJSON = "{ \"type\" : 1, \"node_index\" : 19 }";
 
 int nWidth = 0;
 int nHeight = 0;
diff --git a/sw/qa/extras/indexing/SearchResultLocatorTest.cxx 
b/sw/qa/extras/indexing/SearchResultLocatorTest.cxx
index 9b8474911fbd..99f33422a065 100644
--- a/sw/qa/extras/indexing/SearchResultLocatorTest.cxx
+++ b/sw/qa/extras/indexing/SearchResultLocatorTest.cxx
@@ -17,27 +17,24 @@
 
 namespace
 {
-#if !defined MACOSX
 constexpr OUStringLiteral DATA_DIRECTORY = u"sw/qa/extras/indexing/data/";
-#endif
 }
 
 class SearchResultLocatorTest : public SwModelTestBase
 {
 private:
-#if !defined MACOSX
 SwDoc* createDoc(const char* pName = nullptr);
-#endif
 
 public:
 void testSearchResultLocator();
+void testSearchResultLocatorForSdrObjects();
 
 CPPUNIT_TEST_SUITE(SearchResultLocatorTest);
 CPPUNIT_TEST(testSearchResultLocator);
+CPPUNIT_TEST(testSearchResultLocatorForSdrObjects);
 CPPUNIT_TEST_SUITE_END();
 };
 
-#if !defined MACOSX
 SwDoc* SearchResultLocatorTest::createDoc(const char* pName)
 {
 if (!pName)
@@ -49,25 +46,27 @@ SwDoc* SearchResultLocatorTest::createDoc(const char* pName)
 CPPUNIT_ASSERT(pTextDoc);
 return pTextDoc->GetDocShell()->GetDoc();
 }
-#endif
 
 void SearchResultLocatorTest::testSearchResultLocator()
 {
-#if !defined(_WIN32) && !defined(MACOSX)
 if (!IsDefaultDPI())
 return;
 
 SwDoc* pDoc = createDoc("IndexingExport_VariousParagraphs.odt");
 CPPUNIT_ASSERT(pDoc);
 
-sw::SearchResultLocator aLocator(pDoc);
-sw::SearchIndexData aData;
+sw::search::SearchResultLocator aLocator(pDoc);
+sw::search::SearchIndexData aData;
+aData.eType = sw::search::NodeType::WriterNode;
 aData.nNodeIndex = 14;
 
-sw::LocationResult aResult = aLocator.find(aData);
+sw::search::LocationResult aResult = aLocator.find(aData);
 CPPUNIT_ASSERT_EQUAL(size_t(1), aResult.maRectangles.size());
-auto aRectangle = aResult.maRectangles[0];
 
+// skip asserting exact values for macOS and Windows because of
+// inconsistent results
+#if !defined(_WIN32) && !defined(MACOSX)
+auto aRectangle = aResult.maRectangles[0];
 CPPUNIT_ASSERT_DOUBLES_EQUAL(1418.0, aRectangle.getMinX(), 1e-4);
 CPPUNIT_ASSERT_DOUBLES_EQUAL(.0, aRectangle.getMinY(), 1e-4);
 
@@ -76,6 +75,35 @@ void SearchResultLocatorTest::testSearchResultLocator()
 #endif
 }
 
+void SearchResultLocatorTest::testSearchResultLocatorForSdrObjects()
+{
+if (!IsDefaultDPI())
+return;
+
+SwDoc* pDoc = createDoc("IndexingExport_Shapes.odt");
+CPPUNIT_ASSERT(pDoc);
+
+sw::search::SearchResultLocator aLocator(pDoc);
+sw::search::SearchIndexData aData;
+aData.eType = sw::search::NodeType::SdrObject;
+aData.aObjectName = u"Circle";
+aData.nNodeIndex = 1;
+
+sw::search::LocationResult aResult = aLocator.find(aData);
+CPPUNIT_ASSERT_EQUAL(size_t(1), aResult.maRectangles.size());
+
+// skip asserting exact values for macOS and Windows because of
+// inconsistent results
+#if !defined(_WIN32) && !defined(MACOSX)
+auto aRectangle = aResult.maRectangles[0];
+CPPUNIT_ASSERT_DOUBLES_EQUAL(1478.0, aRectangle.getMinX(), 1e-4);
+CPPUNIT_ASSERT_DOUBLES_EQUAL(3223.0, aRectangle.getMinY(), 1e-4);
+
+CPPUNIT_ASSERT_DOUBLES_EQUAL(2059.0, aRectangle.getWidth(), 1e-4);
+CPPUNIT_ASSERT_DOUBLES_EQUAL(2059.0, aRectangle.getHeight(), 1e-4);
+#endif
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SearchResultLocatorTest);
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/SearchResultLocato

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

2021-08-09 Thread Miklos Vajna (via logerrit)
 editeng/source/editeng/editeng.cxx |4 +-
 editeng/source/editeng/editundo.cxx|   11 +-
 editeng/source/editeng/editundo.hxx|3 +
 editeng/source/editeng/impedit.hxx |2 -
 editeng/source/editeng/impedit5.cxx|3 +
 sd/qa/unit/tiledrendering/data/paste-undo.fodp |   34 
 sd/qa/unit/tiledrendering/tiledrendering.cxx   |   41 +
 7 files changed, 93 insertions(+), 5 deletions(-)

New commits:
commit fc4c0747e97bb997cc37263b3e86b07dab21fe25
Author: Miklos Vajna 
AuthorDate: Mon Aug 9 19:20:53 2021 +0200
Commit: Miklos Vajna 
CommitDate: Tue Aug 10 07:43:46 2021 +0200

tdf#142845 editeng: don't update selection when formatting before sd paste

Regression from commit f0c25c751cf8e166a84b289746bce6202a40391d
(tdf#115783 sd: fix lost char attributes during in-table copy&paste,
2018-02-16), the problem was that the formatting before paste also
created an undo action, and executing it alters the selection, which was
not intended.

So in case the textbox contains "world" and we paste "hello", then the
undo will set the cursor at the end of "world", while the expected
result is to just undo the paste and the formatting of "world".

Fix the problem by not altering the selection in the undo of
Outliner::SetCharAttribs(), which is only called by sd/ in the
before-paste case, not anywhere else.

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

diff --git a/editeng/source/editeng/editeng.cxx 
b/editeng/source/editeng/editeng.cxx
index abc9f64a9b04..c9aec527b222 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -1768,7 +1768,9 @@ const SfxPoolItem& EditEngine::GetParaAttrib( sal_Int32 
nPara, sal_uInt16 nWhich
 void EditEngine::SetCharAttribs(sal_Int32 nPara, const SfxItemSet& rSet)
 {
 EditSelection aSel(pImpEditEngine->ConvertSelection(nPara, 0, nPara, 
GetTextLen(nPara)));
-pImpEditEngine->SetAttribs(aSel, rSet);
+// This is called by sd::View::OnBeginPasteOrDrop(), updating the cursor 
position on undo is not
+// wanted.
+pImpEditEngine->SetAttribs(aSel, rSet, /*nSpecial=*/SetAttribsMode::NONE, 
/*bSetSelection=*/false);
 pImpEditEngine->FormatAndUpdate();
 }
 
diff --git a/editeng/source/editeng/editundo.cxx 
b/editeng/source/editeng/editundo.cxx
index 714dd1b682ed..892183f754af 100644
--- a/editeng/source/editeng/editundo.cxx
+++ b/editeng/source/editeng/editundo.cxx
@@ -501,6 +501,7 @@ EditUndoSetAttribs::EditUndoSetAttribs(EditEngine* pEE, 
const ESelection& rESel,
 aESel(rESel),
 aNewAttribs(rNewItems),
 nSpecial(SetAttribsMode::NONE),
+m_bSetSelection(true),
 // When EditUndoSetAttribs actually is a RemoveAttribs this could be
 // recognize by the empty itemset, but then it would have to be caught in
 // its own place, which possible a setAttribs does with an empty itemset.
@@ -560,7 +561,10 @@ void EditUndoSetAttribs::Undo()
 }
 if ( bFields )
 pEE->UpdateFieldsOnly();
-ImpSetSelection();
+if (m_bSetSelection)
+{
+ImpSetSelection();
+}
 }
 
 void EditUndoSetAttribs::Redo()
@@ -574,7 +578,10 @@ void EditUndoSetAttribs::Redo()
 else
 pEE->RemoveCharAttribs( aSel, bRemoveParaAttribs, nRemoveWhich );
 
-ImpSetSelection();
+if (m_bSetSelection)
+{
+ImpSetSelection();
+}
 }
 
 void EditUndoSetAttribs::AppendContentInfo(ContentAttribsInfo* pNew)
diff --git a/editeng/source/editeng/editundo.hxx 
b/editeng/source/editeng/editundo.hxx
index 43d2a0d3b911..f87180ba7dd7 100644
--- a/editeng/source/editeng/editundo.hxx
+++ b/editeng/source/editeng/editundo.hxx
@@ -218,6 +218,8 @@ private:
 InfoArrayType   aPrevAttribs;
 
 SetAttribsMode  nSpecial;
+/// Once the attributes are set / unset, set the selection to the end of 
the formatted range?
+bool m_bSetSelection;
 boolbSetIsRemove;
 boolbRemoveParaAttribs;
 sal_uInt16  nRemoveWhich;
@@ -232,6 +234,7 @@ public:
 SfxItemSet& GetNewAttribs() { return aNewAttribs; }
 
 voidSetSpecial( SetAttribsMode n )  { nSpecial = n; }
+voidSetUpdateSelection( bool bSetSelection )  { 
m_bSetSelection = bSetSelection; }
 voidSetRemoveAttribs( bool b )  { bSetIsRemove = b; }
 voidSetRemoveParaAttribs( bool b )  { bRemoveParaAttribs = 
b; }
 voidSetRemoveWhich( sal_uInt16 n )  { nRemoveWhich = n; }
diff --git a/editeng/source/editeng/impedit.hxx 
b/editeng/source/editeng/impedit.hxx
index 78b2f85f9cc7..e138fa532f32 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -910,7 +910,7 @@ pu

[Libreoffice-commits] core.git: external/harfbuzz

2021-08-09 Thread Stephan Bergmann (via logerrit)
 external/harfbuzz/UnpackedTarball_harfbuzz.mk |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 34574d2094650673fb2f29e342eb259494088d1c
Author: Stephan Bergmann 
AuthorDate: Mon Aug 9 17:28:06 2021 +0200
Commit: Stephan Bergmann 
CommitDate: Tue Aug 10 07:39:24 2021 +0200

Mark external/harfbuzz/negativeadvance.patch as sent upstream

Change-Id: Ia12ea1fce7a994b519e743edbc18cbd27ccb78bd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120210
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/external/harfbuzz/UnpackedTarball_harfbuzz.mk 
b/external/harfbuzz/UnpackedTarball_harfbuzz.mk
index 13400700606a..83df909aaf99 100644
--- a/external/harfbuzz/UnpackedTarball_harfbuzz.mk
+++ b/external/harfbuzz/UnpackedTarball_harfbuzz.mk
@@ -15,6 +15,9 @@ $(eval $(call 
gb_UnpackedTarball_update_autoconf_configs,harfbuzz))
 
 $(eval $(call gb_UnpackedTarball_set_patchlevel,harfbuzz,0))
 
+# * external/harfbuzz/negativeadvance.patch sent upstram as
+#    
"hb_graphite2_cluster_t::advance can apparently
+#   be negative":
 $(eval $(call gb_UnpackedTarball_add_patches,harfbuzz, \
 external/harfbuzz/negativeadvance.patch \
 ))


[Libreoffice-commits] core.git: chart2/source compilerplugins/clang connectivity/source filter/source forms/source fpicker/source include/oox include/sfx2 include/svtools include/vcl shell/source sot/

2021-08-09 Thread Stephan Bergmann (via logerrit)
 chart2/source/view/inc/PlottingPositionHelper.hxx  |   
 4 
 compilerplugins/clang/test/unusedfields.cxx|   
 1 +
 connectivity/source/inc/java/tools.hxx |   
 4 
 filter/source/xsltdialog/xmlfilterjar.hxx  |   
 1 +
 forms/source/component/EventThread.hxx |   
 1 +
 forms/source/xforms/propertysetbase.hxx|   
 1 +
 fpicker/source/office/contentenumeration.hxx   |   
 4 
 include/oox/crypto/StrongEncryptionDataSpace.hxx   |   
 4 
 include/sfx2/sidebar/SidebarPanelBase.hxx  |   
 4 
 include/svtools/imageresourceaccess.hxx|   
 4 
 include/vcl/BitmapBuffer.hxx   |   
 4 
 include/vcl/filter/PngImageReader.hxx  |   
 4 
 shell/source/backends/kf5be/kf5backend.cxx |   
 2 ++
 sot/source/unoolestorage/xolesimplestorage.hxx |   
 2 ++
 starmath/inc/token.hxx |   
 1 +
 svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.hxx |   
 4 
 sw/source/uibase/docvw/OverlayRanges.hxx   |   
 1 +
 sw/source/uibase/docvw/ShadowOverlayObject.hxx |   
 4 
 xmlsecurity/source/gpg/SecurityEnvironment.hxx |   
 3 +++
 xmlsecurity/source/helper/ooxmlsecparser.hxx   |   
 1 +
 xmlsecurity/source/helper/xsecparser.hxx   |   
 1 +
 21 files changed, 55 insertions(+)

New commits:
commit 43542cc07ee110abe25a1e176238fd6d921d593b
Author: Stephan Bergmann 
AuthorDate: Mon Aug 9 23:07:12 2021 +0200
Commit: Stephan Bergmann 
CommitDate: Tue Aug 10 07:39:00 2021 +0200

Missing include

(for std::unique_ptr, with recent libstdc++ 12 trunk)

Change-Id: I61b7823dd740ea7cdfe0d7403a50ac73b24d1c4e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120229
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/chart2/source/view/inc/PlottingPositionHelper.hxx 
b/chart2/source/view/inc/PlottingPositionHelper.hxx
index 0962868b0f31..d687cb902453 100644
--- a/chart2/source/view/inc/PlottingPositionHelper.hxx
+++ b/chart2/source/view/inc/PlottingPositionHelper.hxx
@@ -18,6 +18,10 @@
  */
 #pragma once
 
+#include 
+
+#include 
+
 #include 
 
 #include 
diff --git a/compilerplugins/clang/test/unusedfields.cxx 
b/compilerplugins/clang/test/unusedfields.cxx
index 5305b4aec964..6ff9189eab27 100644
--- a/compilerplugins/clang/test/unusedfields.cxx
+++ b/compilerplugins/clang/test/unusedfields.cxx
@@ -14,6 +14,7 @@
 // expected-no-diagnostics
 #else
 
+#include 
 #include 
 #include 
 #include 
diff --git a/connectivity/source/inc/java/tools.hxx 
b/connectivity/source/inc/java/tools.hxx
index bc9759fa9a88..44a35ecee3f9 100644
--- a/connectivity/source/inc/java/tools.hxx
+++ b/connectivity/source/inc/java/tools.hxx
@@ -19,6 +19,10 @@
 
 #pragma once
 
+#include 
+
+#include 
+
 #include 
 #include 
 
diff --git a/filter/source/xsltdialog/xmlfilterjar.hxx 
b/filter/source/xsltdialog/xmlfilterjar.hxx
index 6f02e5f99de0..1d8e52fc3e18 100644
--- a/filter/source/xsltdialog/xmlfilterjar.hxx
+++ b/filter/source/xsltdialog/xmlfilterjar.hxx
@@ -22,6 +22,7 @@
 #include 
 #include 
 
+#include 
 #include 
 
 class filter_info_impl;
diff --git a/forms/source/component/EventThread.hxx 
b/forms/source/component/EventThread.hxx
index be9e9696734e..20aff73113db 100644
--- a/forms/source/component/EventThread.hxx
+++ b/forms/source/component/EventThread.hxx
@@ -21,6 +21,7 @@
 
 #include 
 
+#include 
 #include 
 
 #include 
diff --git a/forms/source/xforms/propertysetbase.hxx 
b/forms/source/xforms/propertysetbase.hxx
index bb27f8460fea..969253a04d62 100644
--- a/forms/source/xforms/propertysetbase.hxx
+++ b/forms/source/xforms/propertysetbase.hxx
@@ -26,6 +26,7 @@
 #include 
 
 #include 
+#include 
 
 namespace com::sun::star::uno {
 class Any;
diff --git a/fpicker/source/office/contentenumeration.hxx 
b/fpicker/source/office/contentenumeration.hxx
index 9dcfae687883..bc2180c53c47 100644
--- a/fpicker/source/office/contentenumeration.hxx
+++ b/fpicker/source/office/contentenumeration.hxx
@@ -19,6 +19,10 @@
 
 #pragma once
 
+#include 
+
+#include 
+
 #include 
 #include 
 #include 
diff --git a/include/oox/crypto/StrongEncryptionDataSpace.hxx 
b/include/oox/crypto/StrongEncryptionDataSpace.hxx
index 59be5c9832a0..cd7156515ab3 100644
--- a/include/oox/crypto/StrongEncryptionDataSpace.hxx
+++ b/include/oox/crypto/StrongEncryptionDataSpace.hxx
@@ -11,6 +11,10 @@
 #ifndef INCLUDED_OOX_CRYPTO_STRONGENCRYPTINDATASPACE

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

2021-08-09 Thread Tomaž Vajngerl (via logerrit)
 include/o3tl/unit_conversion.hxx|6 ++
 o3tl/qa/test-unit_conversion.cxx|7 +++
 sw/inc/swtypes.hxx  |   19 ++-
 sw/qa/extras/tiledrendering/tiledrendering.cxx  |3 ++-
 sw/source/core/doc/DocumentStylePoolManager.cxx |6 +++---
 sw/source/core/doc/lineinfo.cxx |2 +-
 sw/source/core/edit/edattr.cxx  |9 +++--
 sw/source/core/frmedt/feshview.cxx  |   10 ++
 sw/source/core/layout/calcmove.cxx  |4 +++-
 sw/source/core/unocore/unoframe.cxx |5 +++--
 sw/source/core/unocore/unostyle.cxx |3 ++-
 sw/source/filter/html/htmlnum.hxx   |4 ++--
 sw/source/filter/html/htmlplug.cxx  |9 +
 sw/source/filter/html/htmltab.cxx   |4 +++-
 sw/source/filter/html/svxcss1.hxx   |3 ++-
 sw/source/filter/html/swhtml.hxx|8 
 sw/source/filter/html/wrthtml.hxx   |2 +-
 sw/source/ui/chrdlg/pardlg.cxx  |3 ++-
 sw/source/ui/dbui/mmlayoutpage.cxx  |   10 +-
 sw/source/ui/fmtui/tmpdlg.cxx   |3 ++-
 sw/source/ui/misc/pggrid.cxx|4 +++-
 sw/source/uibase/dochdl/swdtflvr.cxx|5 -
 sw/source/uibase/inc/frmmgr.hxx |4 ++--
 sw/source/uibase/ribbar/conform.cxx |   11 +++
 sw/source/uibase/ribbar/drawbase.cxx|   10 ++
 sw/source/uibase/shells/textsh.cxx  |8 +---
 sw/source/uibase/wrtsh/wrtsh1.cxx   |3 ++-
 27 files changed, 105 insertions(+), 60 deletions(-)

New commits:
commit 9da7b1592e010928c26c43ee93b91cdd66403985
Author: Tomaž Vajngerl 
AuthorDate: Fri Jul 23 08:44:14 2021 +0900
Commit: Tomaž Vajngerl 
CommitDate: Tue Aug 10 03:02:52 2021 +0200

sw: remove all uses of MM50 with (added) o3tl::toTwip

MM50 constant is the number of twips for 5mm. This is (ab)used as
a "shortcut" to set or compare various variables through the code
and also to set a multiplied value (like 1cm, 2cm, 4cm) or divided
value (2.5mm, 1.25mm). The problem with this is that converting the
5mm to twip doesn't round up exactly and multiplied and divided
values increase the error even more.

Instead of basing it from MM50 constant, it is just better to use
our o3tl::convert (or the added variant o3tl::toTwip), which can
actually calculate the conversion at compile time, so there is no
added complexity at runtime and we get a more readable code with
more exact result.

i.e.
o3tl::toTwip(4, o3tl::Length::cm)
instead of the more cryptic
MM50 * 8

In addition also sanitize and comment the values of the constants
in sw/inc/swtypes.hxx.

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

diff --git a/include/o3tl/unit_conversion.hxx b/include/o3tl/unit_conversion.hxx
index 4c76375737a2..cf293662e7b2 100644
--- a/include/o3tl/unit_conversion.hxx
+++ b/include/o3tl/unit_conversion.hxx
@@ -199,6 +199,12 @@ template  constexpr auto convert(N 
n, U from, U to)
 return convert(n, detail::md(from, to), detail::md(to, from));
 }
 
+// Convert to twips - for convenience as we do this a lot
+template  constexpr auto toTwips(N number, Length from)
+{
+return convert(number, from, Length::twip);
+}
+
 // Returns nDefault if intermediate multiplication overflows sal_Int64 (only 
for integral types).
 // On return, bOverflow indicates if overflow happened. nDefault is returned 
when overflow occurs.
 template 
diff --git a/o3tl/qa/test-unit_conversion.cxx b/o3tl/qa/test-unit_conversion.cxx
index 983c0845a4cd..80b01ea2bf2b 100644
--- a/o3tl/qa/test-unit_conversion.cxx
+++ b/o3tl/qa/test-unit_conversion.cxx
@@ -869,4 +869,11 @@ static_assert(o3tl::convert(100, o3tl::Length::line, 
o3tl::Length::line) == 100)
 static_assert(o3tl::convert(49, o3tl::Length::mm100, o3tl::Length::mm) == 0);
 static_assert(o3tl::convert(50, o3tl::Length::mm100, o3tl::Length::mm) == 1);
 
+// Conversions used in the code - to make sure they produce the expected and 
unchanged result
+
+static_assert(o3tl::toTwips(25, o3tl::Length::in100) == 1440 / 4);
+static_assert(o3tl::toTwips(15, o3tl::Length::in100) == 216);
+// the following twip value used to the constant for 20mm
+static_assert(o3tl::toTwips(20, o3tl::Length::mm) == 1134);
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/sw/inc/swtypes.hxx b/sw/inc/swtypes.hxx
index 81ad502b82be..ff79edb47d02 100644
--- a/sw/inc/swtypes.hxx
+++ b/sw/inc/swtypes.hxx
@@ -25,6 +25,7 @@
 #include 
 #include "swdllapi.h"
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -56,

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

2021-08-09 Thread Tibor Nagy (via logerrit)
 include/oox/ppt/presPropsfragmenthandler.hxx |1 +
 oox/source/ppt/presPropsfragmenthandler.cxx  |2 ++
 sd/qa/unit/data/pptx/tdf142915.pptx  |binary
 sd/qa/unit/import-tests.cxx  |   19 +++
 4 files changed, 22 insertions(+)

New commits:
commit e1b7a17daf0fc969a50cadeb811289ae9dc51de6
Author: Tibor Nagy 
AuthorDate: Wed Jul 21 12:48:46 2021 +0200
Commit: Xisco Fauli 
CommitDate: Mon Aug 9 22:51:53 2021 +0200

tdf#142915 PPTX import: support for presentation's timing attribute

See Slide Show->Slide Show Settings...->Change slides manually,
which is disabled by default. Now 
is imported correctly, i.e. with enabled "Change slides manually".

Note: it seems, com::sun::star::presentation::IsAutomatic
UNO attribute has got a bad name and documentation: if it's
value is TRUE, "Change slides manually" is enabled, and vice versa.
Check with the following Basic code:

' show presentation-level automatic transition (IsAutomatic = False)
print ThisComponent.getPresentation().IsAutomatic
' show slide-level automatic transition (Change = 1)
Dim oDrawPages as Object, oDrawPage as Object
oDrawPages = ThisComponent.getDrawPages()
oDrawPage = oDrawPages.getByIndex(0)
print oDrawPage.Change

Change-Id: Ie4a687a29077cad89f11e77b856c28a1fe09376b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119321
Tested-by: László Németh 
Reviewed-by: László Németh 
(cherry picked from commit f8ddaaf0f5e1fb61e0d4404ea28757bc652ae4be)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120237
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 

diff --git a/include/oox/ppt/presPropsfragmenthandler.hxx 
b/include/oox/ppt/presPropsfragmenthandler.hxx
index 5125ee3357c7..18a2a97aa9cd 100644
--- a/include/oox/ppt/presPropsfragmenthandler.hxx
+++ b/include/oox/ppt/presPropsfragmenthandler.hxx
@@ -32,6 +32,7 @@ public:
 
 private:
 bool m_bLoop = false;
+bool m_bTiming = true;
 OUString m_sId;
 OUString m_sSt;
 };
diff --git a/oox/source/ppt/presPropsfragmenthandler.cxx 
b/oox/source/ppt/presPropsfragmenthandler.cxx
index ca466177e944..708f194853fb 100644
--- a/oox/source/ppt/presPropsfragmenthandler.cxx
+++ b/oox/source/ppt/presPropsfragmenthandler.cxx
@@ -41,6 +41,7 @@ void PresPropsFragmentHandler::finalizeImport()
 css::uno::Reference xPresentationProps(
 xPresentationSupplier->getPresentation(), css::uno::UNO_QUERY_THROW);
 xPresentationProps->setPropertyValue("IsEndless", css::uno::Any(m_bLoop));
+xPresentationProps->setPropertyValue("IsAutomatic", 
css::uno::Any(!m_bTiming));
 
 if (!m_sId.isEmpty())
 {
@@ -73,6 +74,7 @@ core::ContextHandlerRef 
PresPropsFragmentHandler::onCreateContext(sal_Int32 aEle
 return this;
 case PPT_TOKEN(showPr):
 m_bLoop = rAttribs.getBool(XML_loop, false);
+m_bTiming = rAttribs.getBool(XML_useTimings, true);
 return this;
 case PPT_TOKEN(custShow):
 m_sId = rAttribs.getString(XML_id).get();
diff --git a/sd/qa/unit/data/pptx/tdf142915.pptx 
b/sd/qa/unit/data/pptx/tdf142915.pptx
new file mode 100644
index ..889a08fd50a1
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf142915.pptx differ
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index 5978bf42aa01..742fb7712750 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -122,6 +122,7 @@ public:
 virtual void setUp() override;
 
 void testDocumentLayout();
+void testTdf142915();
 void testTdf142913();
 void testTdf142590();
 void testCustomSlideShow();
@@ -243,6 +244,7 @@ public:
 CPPUNIT_TEST_SUITE(SdImportTest);
 
 CPPUNIT_TEST(testDocumentLayout);
+CPPUNIT_TEST(testTdf142915);
 CPPUNIT_TEST(testTdf142913);
 CPPUNIT_TEST(testTdf142590);
 CPPUNIT_TEST(testCustomSlideShow);
@@ -440,6 +442,23 @@ void SdImportTest::testDocumentLayout()
 }
 }
 
+void SdImportTest::testTdf142915()
+{
+::sd::DrawDocShellRef xDocShRef
+= 
loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf142915.pptx"), 
PPTX);
+
+uno::Reference xPresentationSupplier(
+xDocShRef->GetDoc()->getUnoModel(), uno::UNO_QUERY_THROW);
+uno::Reference 
xPresentationProps(xPresentationSupplier->getPresentation(),
+   
uno::UNO_QUERY_THROW);
+
+bool bChangeManually = 
xPresentationProps->getPropertyValue("IsAutomatic").get();
+
+CPPUNIT_ASSERT_EQUAL(true, bChangeManually);
+
+xDocShRef->DoClose();
+}
+
 void SdImportTest::testTdf142913()
 {
 ::sd::DrawDocShellRef xDocShRef


Re: ESC meeting minutes: 2021-07-01

2021-08-09 Thread Xisco Fauli
Hello Noel,

On 1/7/21 21:15, Noel Grandin wrote:
> On Thu, 1 Jul 2021 at 16:46, Miklos Vajna  > wrote:
>
> * Crash Reporting (Xisco)
>
>    + Top 5
> -
> 
> https://crashreport.libreoffice.org/stats/signature/weld::CustomWidgetController::SetPointer(PointerStyle)
> 
> 
>
>
> The following will probably fix this one:
>
>     commit 2176084192dc46a1ef5d6dd79effa5cd5d1dcca2
>     Author: Noel Grandin  >
>     Date:   Thu Jun 17 13:38:07 2021 +0200
>     fix potential write-after-free in RecentDocsView
>
>
Unfortunately, this is still the most reported crash in 7.1.5.2 ->
https://crashreport.libreoffice.org/stats/version/7.1.5.2

-- 
Xisco Faulí
LibreOffice QA Team
IRC: x1sc0



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

2021-08-09 Thread Katarina Behrens (via logerrit)
 sd/source/core/CustomAnimationEffect.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit e793eb0acc8f95941eaf6bf82f39a3a6185d7142
Author: Katarina Behrens 
AuthorDate: Mon Jul 26 08:34:38 2021 +0200
Commit: Xisco Fauli 
CommitDate: Mon Aug 9 22:02:57 2021 +0200

tdf#142817: Correctly replace animation effect that comes with a command

As effect1 with command (e.g. the one from misc/MEDIACALL category)
is created, 'mnCommand' member var is set.

But when it is replaced by command-less effect2 via
CustomAnnimationEffect::replaceNode, this var is never reset (simply
because the relevant if-else branch is never hit) so it looks as if
the command was still there. This causes UI glitch in sidebar:
setting incorrect category of the next selected effect

To fix that, we reset 'mnCommand' in ::setNode function, just as
it is done with resetting audio associated w/ the effect

Change-Id: I86016dd1acadfb31f460bde749bbe15164f1eb81
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119492
Tested-by: Jenkins
Reviewed-by: Katarina Behrens 
(cherry picked from commit 6146b185ab2a335de39d0562a8d34e53d3e742e0)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120236
Reviewed-by: Xisco Fauli 

diff --git a/sd/source/core/CustomAnimationEffect.cxx 
b/sd/source/core/CustomAnimationEffect.cxx
index b28b9c512fa3..ed61bed5cb72 100644
--- a/sd/source/core/CustomAnimationEffect.cxx
+++ b/sd/source/core/CustomAnimationEffect.cxx
@@ -156,6 +156,7 @@ void CustomAnimationEffect::setNode( const 
css::uno::Reference< css::animations:
 {
 mxNode = xNode;
 mxAudio.clear();
+mnCommand = 0;
 
 const Sequence< NamedValue > aUserData( mxNode->getUserData() );
 


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

2021-08-09 Thread Tünde Tóth (via logerrit)
 sc/source/ui/dbgui/dbnamdlg.cxx |8 ++--
 sc/source/ui/inc/dbnamdlg.hxx   |1 +
 2 files changed, 7 insertions(+), 2 deletions(-)

New commits:
commit d366fc7861a4226d053beb4b21ba665d7c7660f5
Author: Tünde Tóth 
AuthorDate: Thu Jul 29 10:00:06 2021 +0200
Commit: Xisco Fauli 
CommitDate: Mon Aug 9 21:56:54 2021 +0200

tdf#115520 sc UI: Define Database Range dialog disappeared

if the name of the database range was invalid.

Change-Id: If0eb08d35b2187f04ef93136acd6f7eafa3b588a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119652
Tested-by: Jenkins
Reviewed-by: Eike Rathke 
(cherry picked from commit a07351e8181353c0c0b6df5d2ccbad4615c6706b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120234
Reviewed-by: Xisco Fauli 

diff --git a/sc/source/ui/dbgui/dbnamdlg.cxx b/sc/source/ui/dbgui/dbnamdlg.cxx
index 4939663f29b4..1043e899af6d 100644
--- a/sc/source/ui/dbgui/dbnamdlg.cxx
+++ b/sc/source/ui/dbgui/dbnamdlg.cxx
@@ -249,6 +249,7 @@ void ScDbNameDlg::Init()
 bSaved = true;
 xSaveObj->Save();
 NameModifyHdl( *m_xEdName );
+bInvalid = false;
 }
 
 void ScDbNameDlg::SetInfoStrings( const ScDBData* pDBData )
@@ -376,17 +377,18 @@ bool ScDbNameDlg::IsRefInputMode() const
 
 IMPL_LINK_NOARG(ScDbNameDlg, OkBtnHdl, weld::Button&, void)
 {
+bInvalid = false;
 AddBtnHdl(*m_xBtnAdd);
 
 // Pass the changes and the remove list to the view: both are
 // transferred as a reference only, so that no dead memory can
 // be created at this point:
+if (!bInvalid)
 {
 ScDBDocFunc aFunc(*m_rViewData.GetDocShell());
 aFunc.ModifyAllDBData(aLocalDbCol, aRemoveList);
+response(RET_OK);
 }
-
-response(RET_OK);
 }
 
 IMPL_LINK_NOARG(ScDbNameDlg, CancelBtnHdl, weld::Button&, void)
@@ -469,6 +471,7 @@ IMPL_LINK_NOARG(ScDbNameDlg, AddBtnHdl, weld::Button&, void)
 ERRORBOX(m_xDialog.get(), aStrInvalid);
 m_xEdAssign->SelectAll();
 m_xEdAssign->GrabFocus();
+bInvalid = true;
 }
 }
 else
@@ -476,6 +479,7 @@ IMPL_LINK_NOARG(ScDbNameDlg, AddBtnHdl, weld::Button&, void)
 ERRORBOX(m_xDialog.get(), ScResId(STR_INVALIDNAME));
 m_xEdName->select_entry_region(0, -1);
 m_xEdName->grab_focus();
+bInvalid = true;
 }
 }
 
diff --git a/sc/source/ui/inc/dbnamdlg.hxx b/sc/source/ui/inc/dbnamdlg.hxx
index 01dc0aab66a9..4958f121d821 100644
--- a/sc/source/ui/inc/dbnamdlg.hxx
+++ b/sc/source/ui/inc/dbnamdlg.hxx
@@ -41,6 +41,7 @@ public:
 
 private:
 boolbSaved;
+boolbInvalid;
 
 OUStringaStrAdd;
 OUStringaStrModify;


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

2021-08-09 Thread Caolán McNamara (via logerrit)
 vcl/source/app/weldutils.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit f98796df322d89912070c8e431c5f6d1283f
Author: Caolán McNamara 
AuthorDate: Mon Aug 9 12:47:58 2021 +0100
Commit: Caolán McNamara 
CommitDate: Mon Aug 9 20:40:44 2021 +0200

return true to indicate event was consumed

noticable as a problem in gtk4 with repeat button in calc tabbar
not seeing the release

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

diff --git a/vcl/source/app/weldutils.cxx b/vcl/source/app/weldutils.cxx
index 6927297ad9da..a4dbf93688d3 100644
--- a/vcl/source/app/weldutils.cxx
+++ b/vcl/source/app/weldutils.cxx
@@ -584,14 +584,14 @@ IMPL_LINK(ButtonPressRepeater, MousePressHdl, const 
MouseEvent&, rMouseEvent, bo
 return false;
 m_aRepeat.SetTimeout(MouseSettings::GetButtonStartRepeat());
 m_aRepeat.Start();
-return false;
+return true;
 }
 
 IMPL_LINK_NOARG(ButtonPressRepeater, MouseReleaseHdl, const MouseEvent&, bool)
 {
 m_bModKey = false;
 m_aRepeat.Stop();
-return false;
+return true;
 }
 
 IMPL_LINK_NOARG(ButtonPressRepeater, RepeatTimerHdl, Timer*, void)


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

2021-08-09 Thread Miklos Vajna (via logerrit)
 oox/qa/unit/data/smartart-groupshape.pptx |binary
 oox/qa/unit/drawingml.cxx |   19 +++
 oox/source/drawingml/shape.cxx|   17 -
 3 files changed, 35 insertions(+), 1 deletion(-)

New commits:
commit 42132ec0c47b8439425fe8ad9925af097719a395
Author: Miklos Vajna 
AuthorDate: Fri Aug 6 16:56:30 2021 +0200
Commit: Xisco Fauli 
CommitDate: Mon Aug 9 20:28:02 2021 +0200

tdf#132696 PPTX import: fix missing SmartArt when it's part of a group shape

Regression from commit e9986153e44d7ec6ca9c5f1373971de74dcbacda (PPTX
import: import SmartArt drawing into single GroupShape, 2019-03-14), the
problem was that oox::ppt::PPTShape::addShape() and
oox::drawingml::Shape::addShape() were not in sync.

PPTShape unconditionally maps SmartArt to shapes, while the shared Shape
class defaults to converting it to a non-editable metafile. The above
commit changed the handling of in-groupshape SmartArts to go via
Shape::addShape() instead of PPTShape::addShape(), which exposed the
underlying problem that the convert-to-metafile mechanism is currently
only working in the DOCX case.

Fix the problem by again ignoring the convert-to-metafile flag for the
PPTX import case.

This also exposed a previously hidden problem:

make -C oox -sr CppunitTest_oox_drawingml 
CPPUNIT_TEST_NAME="testGroupShapeSmartArt testTdf131082"

started to make testTdf131082 fail. The tweak in
Shape::createAndInsert() fixes the testcase failure, but likely there is
a deeper problem there, unrelated to the regression.

Change-Id: I4e1e9645eaa266d0d7560767c3c59ba9549ccdb4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120122
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins
(cherry picked from commit 030cdbc7f8782eb196f09661bc2f116d790de9be)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120145
Reviewed-by: Xisco Fauli 
(cherry picked from commit 84033de1bfe3e6951a1f563d85e40fb6d29ff3be)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120149

diff --git a/oox/qa/unit/data/smartart-groupshape.pptx 
b/oox/qa/unit/data/smartart-groupshape.pptx
new file mode 100644
index ..81dcee1e52a3
Binary files /dev/null and b/oox/qa/unit/data/smartart-groupshape.pptx differ
diff --git a/oox/qa/unit/drawingml.cxx b/oox/qa/unit/drawingml.cxx
index c7e72d458194..e1c665e22e86 100644
--- a/oox/qa/unit/drawingml.cxx
+++ b/oox/qa/unit/drawingml.cxx
@@ -326,6 +326,25 @@ CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testTableShadow)
 verify(getComponent());
 }
 
+CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testGroupShapeSmartArt)
+{
+// Given a file with a smartart inside a group shape:
+OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + 
"smartart-groupshape.pptx";
+
+// When loading that file:
+load(aURL);
+
+// Then make sure that the smartart is not just an empty group shape:
+uno::Reference 
xDrawPagesSupplier(getComponent(), uno::UNO_QUERY);
+uno::Reference 
xDrawPage(xDrawPagesSupplier->getDrawPages()->getByIndex(0),
+ uno::UNO_QUERY);
+uno::Reference xGroup(xDrawPage->getByIndex(0), 
uno::UNO_QUERY);
+uno::Reference xSmartArt(xGroup->getByIndex(0), 
uno::UNO_QUERY);
+// Without the accompanying fix in place, this test would have failed, 
because we lost all
+// children of the group shape representing the smartart.
+CPPUNIT_ASSERT_GREATER(static_cast(0), xSmartArt->getCount());
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index a9388e8a4a70..6e8ae072af56 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -295,7 +295,12 @@ void Shape::addShape(
 if( meFrameType == FRAMETYPE_DIAGRAM )
 {
 keepDiagramCompatibilityInfo();
-if( !SvtFilterOptions::Get().IsSmartArt2Shape() )
+
+// Check if this is the PPTX import, so far converting 
SmartArt to a non-editable
+// metafile is only imlemented for DOCX.
+bool bPowerPoint = 
dynamic_cast(&rFilterBase) != nullptr;
+
+if (!SvtFilterOptions::Get().IsSmartArt2Shape() && 
!bPowerPoint)
 convertSmartArtToMetafile( rFilterBase );
 }
 
@@ -964,7 +969,17 @@ Reference< XShape > const & Shape::createAndInsert(
 
 Reference< lang::XMultiServiceFactory > xServiceFact( 
rFilterBase.getModel(), UNO_QUERY_THROW );
 if ( !mxShape.is() )
+{
 mxShape.set( xServiceFact->createInstance( aServiceName ), 
UNO_QUERY_THROW );
+if (aServiceName == "com.sun.star.drawing.GroupShape")
+{
+// TODO why is this necessary? A newly created group shape should 
have an empty
+// grab-b

[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - bin/find-unneeded-includes

2021-08-09 Thread Miklos Vajna (via logerrit)
 bin/find-unneeded-includes |1 -
 1 file changed, 1 deletion(-)

New commits:
commit 345ac54c86bd01ae29f2ed891d622d123dce205a
Author: Miklos Vajna 
AuthorDate: Thu Aug 5 14:54:45 2021 +0200
Commit: Xisco Fauli 
CommitDate: Mon Aug 9 20:26:37 2021 +0200

find-unneeded-includes: remove leftover debug print()

Change-Id: I738d191415db130d875d5b7139ff768ad389dd93
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120070
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins
(cherry picked from commit 746d95bb4067943679f0fe3b8bf91269debf519b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120146
Reviewed-by: Xisco Fauli 

diff --git a/bin/find-unneeded-includes b/bin/find-unneeded-includes
index 3f8c38bdb158..4f90ab55e9f5 100755
--- a/bin/find-unneeded-includes
+++ b/bin/find-unneeded-includes
@@ -286,7 +286,6 @@ def tidy(compileCommands, paths):
 args = args.replace(assumeAbs, "-x c++ " + pathAbs)
 
 invocation = "include-what-you-use -Xiwyu --no_fwd_decls -Xiwyu 
--max_line_length=200 " + args
-print(invocation)
 task_queue.put((invocation, moduleRules))
 
 task_queue.join()


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

2021-08-09 Thread Miklos Vajna (via logerrit)
 svx/source/xoutdev/_xoutbmp.cxx|3 ++-
 sw/qa/extras/htmlexport/data/ole2.odt  |binary
 sw/qa/extras/htmlexport/htmlexport.cxx |   21 +
 3 files changed, 23 insertions(+), 1 deletion(-)

New commits:
commit 82a444eabc38b74d762debb6f1af50e93e5b74f1
Author: Miklos Vajna 
AuthorDate: Mon Aug 9 16:16:35 2021 +0200
Commit: Miklos Vajna 
CommitDate: Mon Aug 9 20:10:41 2021 +0200

sw HTML export: avoid writing EMF data with JPG extension

Regression from commit f3b2fc2276ee8a7f64e73d9975d0143d1696362c (sw
XHTML import, improved  handling for images: support more
formats, 2021-07-20), the problem was that now an EMF image was written
with the JPG extension in the HTML export.

Solve the problem by making the "use emf as-is" check more strict in
XOutBitmap::WriteGraphic(): that will be still true in the XHTML case
when the source image is EMF, but the filter name will be JPG in the
HTML case, so that will avoid the unwanted EMF data in the HTML case.

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

diff --git a/svx/source/xoutdev/_xoutbmp.cxx b/svx/source/xoutdev/_xoutbmp.cxx
index a2a672ede2b5..8eaec8e5a5fc 100644
--- a/svx/source/xoutdev/_xoutbmp.cxx
+++ b/svx/source/xoutdev/_xoutbmp.cxx
@@ -132,12 +132,13 @@ ErrCode XOutBitmap::WriteGraphic( const Graphic& 
rGraphic, OUString& rFileName,
 
 if (rVectorGraphicDataPtr && 
rVectorGraphicDataPtr->getBinaryDataContainer().getSize())
 {
+// Does the filter name match the original format?
 const bool bIsSvg(rFilterName.equalsIgnoreAsciiCase("svg") && 
VectorGraphicDataType::Svg == rVectorGraphicDataPtr->getType());
 const bool bIsWmf(rFilterName.equalsIgnoreAsciiCase("wmf") && 
VectorGraphicDataType::Wmf == rVectorGraphicDataPtr->getType());
 bool bIsEmf(rFilterName.equalsIgnoreAsciiCase("emf") && 
VectorGraphicDataType::Emf == rVectorGraphicDataPtr->getType());
 if (!bIsEmf)
 {
-bIsEmf = rGraphic.GetGfxLink().IsEMF();
+bIsEmf = rFilterName.equalsIgnoreAsciiCase("emf") && 
rGraphic.GetGfxLink().IsEMF();
 }
 const bool bIsPdf(rFilterName.equalsIgnoreAsciiCase("pdf") && 
VectorGraphicDataType::Pdf == rVectorGraphicDataPtr->getType());
 
diff --git a/sw/qa/extras/htmlexport/data/ole2.odt 
b/sw/qa/extras/htmlexport/data/ole2.odt
new file mode 100644
index ..a10cfbb5b542
Binary files /dev/null and b/sw/qa/extras/htmlexport/data/ole2.odt differ
diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx 
b/sw/qa/extras/htmlexport/htmlexport.cxx
index 76f27831ec10..e58641ac6f8a 100644
--- a/sw/qa/extras/htmlexport/htmlexport.cxx
+++ b/sw/qa/extras/htmlexport/htmlexport.cxx
@@ -1960,6 +1960,27 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, 
testListsHeading)
"list 1, header 1");
 }
 
+CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testOleEmfPreviewToHtml)
+{
+// Given a document containing an embedded object, with EMF preview:
+OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "ole2.odt";
+mxComponent = loadFromDesktop(aURL, "com.sun.star.text.TextDocument", {});
+
+// When exporting to HTML:
+uno::Reference xStorable(mxComponent, uno::UNO_QUERY);
+uno::Sequence aStoreProperties = {
+comphelper::makePropertyValue("FilterName", OUString("HTML 
(StarWriter)")),
+};
+xStorable->storeToURL(maTempFile.GetURL(), aStoreProperties);
+
+// Then make sure the  tag has matching file extension and data:
+htmlDocUniquePtr pDoc = parseHtml(maTempFile);
+OUString aPath = getXPath(pDoc, "/html/body/p/img", "src");
+// Without the accompanying fix in place, this test would have failed, as 
aPath was
+// ole_html_3978e5f373402b43.JPG, with EMF data.
+CPPUNIT_ASSERT(aPath.endsWith("gif"));
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


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

2021-08-09 Thread Regina Henschel (via logerrit)
 sc/qa/unit/data/ods/tdf143619_validationCirclePos.ods |binary
 sc/qa/unit/scshapetest.cxx|   34 ++
 sc/source/core/data/drwlayer.cxx  |7 +++
 3 files changed, 41 insertions(+)

New commits:
commit a1791f7e2503ca1d0868a0a607ff4717cd1fddeb
Author: Regina Henschel 
AuthorDate: Fri Jul 30 23:18:39 2021 +0200
Commit: Xisco Fauli 
CommitDate: Mon Aug 9 19:42:44 2021 +0200

tdf#143619 validation circle anchor is special

For usual drawing objects, maStart in its Calc user data means the
cell address of left/top of snapRect/logicRect. For validation circle
it means 'address of cell to be validated'. Thus corrections might be
needed, if a general method is used for validation circle.

Here the method SetLogicRect() calls via broadcast
ScDrawLayer::SetCellAnchoredFromPosition(), which calculates maStart
from snapRect/logicRect. Because the circle is extended to cover a
larger area than the to be validated cell, maStart got the cell address
of the cell one left and one above of the to be validated cell.

Now the old, correct address is backuped and restored.

Change-Id: I9646da3f22fef45a6e47e59ef55a70307e2f9cc6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119715
Tested-by: Jenkins
Reviewed-by: Regina Henschel 
(cherry picked from commit 0cff1aa48453ee0c05bafcac5360329fb6bf9557)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120147
Reviewed-by: Xisco Fauli 

diff --git a/sc/qa/unit/data/ods/tdf143619_validationCirclePos.ods 
b/sc/qa/unit/data/ods/tdf143619_validationCirclePos.ods
new file mode 100644
index ..6470d6a1f430
Binary files /dev/null and 
b/sc/qa/unit/data/ods/tdf143619_validationCirclePos.ods differ
diff --git a/sc/qa/unit/scshapetest.cxx b/sc/qa/unit/scshapetest.cxx
index fad81ddd0e6b..c178c28578a6 100644
--- a/sc/qa/unit/scshapetest.cxx
+++ b/sc/qa/unit/scshapetest.cxx
@@ -46,6 +46,7 @@ public:
 ScShapeTest();
 void saveAndReload(css::uno::Reference& xComponent,
const OUString& rFilter);
+void testTdf143619_validation_circle_pos();
 void testTdf140252_DragCreateFormControl();
 void testTdf134355_DragCreateCustomShape();
 void testTdf140252_LayerOfControl();
@@ -72,6 +73,7 @@ public:
 void testCustomShapeCellAnchoredRotatedShape();
 
 CPPUNIT_TEST_SUITE(ScShapeTest);
+CPPUNIT_TEST(testTdf143619_validation_circle_pos);
 CPPUNIT_TEST(testTdf140252_DragCreateFormControl);
 CPPUNIT_TEST(testTdf134355_DragCreateCustomShape);
 CPPUNIT_TEST(testTdf140252_LayerOfControl);
@@ -204,6 +206,38 @@ static SdrObject* lcl_getSdrObjectWithAssert(ScDocument& 
rDoc, sal_uInt16 nObjNu
 return pObj;
 }
 
+void ScShapeTest::testTdf143619_validation_circle_pos()
+{
+// Load a document, which has validation circle around cell E6.
+
+OUString aFileURL;
+createFileURL(u"tdf143619_validationCirclePos.ods", aFileURL);
+uno::Reference xComponent = 
loadFromDesktop(aFileURL);
+
+// Get document
+ScDocShell* pDocSh = lcl_getScDocShellWithAssert(xComponent);
+ScDocument& rDoc = pDocSh->GetDocument();
+
+// Get shape. That is the validation circle.
+SdrObject* pObj = lcl_getSdrObjectWithAssert(rDoc, 0);
+
+// Error was, that deleting row and col before E6 does not move circle to 
D5, but to B3.
+// Delete first row and first column.
+uno::Sequence aPropertyValues = {
+comphelper::makePropertyValue("ToPoint", OUString("$A$1")),
+};
+dispatchCommand(xComponent, ".uno:GoToCell", aPropertyValues);
+dispatchCommand(xComponent, ".uno:DeleteRows", {});
+dispatchCommand(xComponent, ".uno:GoToCell", aPropertyValues);
+dispatchCommand(xComponent, ".uno:DeleteColumns", {});
+
+// Without fix in place the position was (2007, 833)
+Point aPos = pObj->GetSnapRect().TopLeft();
+lcl_AssertPointEqualWithTolerance("after row and col delete", Point(6523, 
1736), aPos, 1);
+
+pDocSh->DoClose();
+}
+
 void ScShapeTest::testTdf140252_DragCreateFormControl()
 {
 // Error was, that drag-created form controls were initially not on layer 
'controls' and thus
diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx
index 551b3c7db899..27d00144a52d 100644
--- a/sc/source/core/data/drwlayer.cxx
+++ b/sc/source/core/data/drwlayer.cxx
@@ -1049,6 +1049,7 @@ void ScDrawLayer::RecalcPos( SdrObject* pObj, 
ScDrawObjData& rData, bool bNegati
 // Validation circle for detective.
 rData.setShapeRect(GetDocument(), pObj->GetLogicRect());
 
+// rData.maStart should contain the address of the be validated cell.
 tools::Rectangle aRect = GetCellRect(*GetDocument(), rData.maStart, 
true);
 aRect.AdjustLeft( -250 );
 aRect.AdjustRight(250 );
@@ -1062,7 +1063,13 @@ void ScDrawLayer::RecalcPos( SdrObject* pObj, 
ScDrawObjData& rData, bool bNegati
  

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

2021-08-09 Thread Andreas Heinisch (via logerrit)
 sc/qa/extras/macros-test.cxx |   30 ++
 sc/qa/extras/testdocuments/tdf143582.ods |binary
 scripting/source/basprov/basscript.cxx   |2 ++
 3 files changed, 32 insertions(+)

New commits:
commit c2697c468c1441df61b2d590a7cb259d21b3ba60
Author: Andreas Heinisch 
AuthorDate: Mon Aug 2 19:48:35 2021 +0200
Commit: Xisco Fauli 
CommitDate: Mon Aug 9 19:41:46 2021 +0200

tdf#143582 - Clear return value of the method before calling it

Otherwise the function keeps a copy of its return value, which may be
used in an upcoming call.

Change-Id: I4977c39e1ce48cfd5ab067a4df4783f10505a9ae
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119905
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120197
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120211

diff --git a/sc/qa/extras/macros-test.cxx b/sc/qa/extras/macros-test.cxx
index 9322a3eab7cd..557fdf5dd3d1 100644
--- a/sc/qa/extras/macros-test.cxx
+++ b/sc/qa/extras/macros-test.cxx
@@ -55,6 +55,7 @@ public:
 void testTdf43003();
 void testTdf138646();
 void testTdf90278();
+void testTdf143582();
 
 CPPUNIT_TEST_SUITE(ScMacrosTest);
 CPPUNIT_TEST(testStarBasic);
@@ -75,6 +76,7 @@ public:
 CPPUNIT_TEST(testTdf43003);
 CPPUNIT_TEST(testTdf138646);
 CPPUNIT_TEST(testTdf90278);
+CPPUNIT_TEST(testTdf143582);
 
 CPPUNIT_TEST_SUITE_END();
 };
@@ -869,6 +871,34 @@ void ScMacrosTest::testTdf43003()
 xCloseable->close(true);
 }
 
+void ScMacrosTest::testTdf143582()
+{
+OUString aFileName;
+createFileURL(u"tdf143582.ods", aFileName);
+auto xComponent = loadFromDesktop(aFileName, 
"com.sun.star.sheet.SpreadsheetDocument");
+
+css::uno::Any aRet;
+css::uno::Sequence aParams;
+css::uno::Sequence aOutParam;
+css::uno::Sequence aOutParamIndex;
+
+SfxObjectShell::CallXScript(
+xComponent,
+
"vnd.sun.Star.script:Standard.Module1.TestScriptInvoke?language=Basic&location=document",
+aParams, aRet, aOutParamIndex, aOutParam);
+
+OUString aReturnValue;
+aRet >>= aReturnValue;
+
+// Without the fix in place, this test would have failed with
+// - Expected: Test
+// - Actual  : TeTest
+CPPUNIT_ASSERT_EQUAL(OUString("Test"), aReturnValue);
+
+css::uno::Reference xCloseable(xComponent, 
css::uno::UNO_QUERY_THROW);
+xCloseable->close(true);
+}
+
 void ScMacrosTest::testTdf138646()
 {
 OUString aFileName;
diff --git a/sc/qa/extras/testdocuments/tdf143582.ods 
b/sc/qa/extras/testdocuments/tdf143582.ods
new file mode 100644
index ..05f4f07cea2c
Binary files /dev/null and b/sc/qa/extras/testdocuments/tdf143582.ods differ
diff --git a/scripting/source/basprov/basscript.cxx 
b/scripting/source/basprov/basscript.cxx
index 216e2fa99bd6..08da36cda5b0 100644
--- a/scripting/source/basprov/basscript.cxx
+++ b/scripting/source/basprov/basscript.cxx
@@ -222,6 +222,8 @@ namespace basprov
 if ( m_documentBasicManager && m_xDocumentScriptContext.is() )
 aOldThisComponent = 
m_documentBasicManager->SetGlobalUNOConstant( "ThisComponent", makeAny( 
m_xDocumentScriptContext ) );
 
+// tdf#143582 - clear return value of the method before calling it
+m_xMethod->Clear();
 if ( m_caller.hasElements() && m_caller[ 0 ].hasValue()  )
 {
 SbxVariableRef xCallerVar = new SbxVariable( SbxVARIANT );


[Libreoffice-commits] core.git: chart2/qa offapi/com oox/source sc/inc sc/qa sc/source

2021-08-09 Thread Balazs Varga (via logerrit)
 chart2/qa/extras/chart2export2.cxx|   17 +++
 chart2/qa/extras/data/xlsx/chart_with_name_range.xlsx |binary
 offapi/com/sun/star/sheet/FormulaParser.idl   |   10 ++
 oox/source/export/chartexport.cxx |2 
 oox/source/token/properties.txt   |1 
 sc/inc/compiler.hxx   |3 
 sc/inc/tokenuno.hxx   |1 
 sc/inc/unonames.hxx   |1 
 sc/qa/uitest/chart/tdf64086.py|   31 +++
 sc/qa/uitest/data/tdf64086.xlsx   |binary
 sc/source/core/tool/compiler.cxx  |   27 +-
 sc/source/core/tool/reftokenhelper.cxx|   20 
 sc/source/ui/unoobj/chart2uno.cxx |   79 +++---
 sc/source/ui/unoobj/tokenuno.cxx  |   15 ++-
 14 files changed, 192 insertions(+), 15 deletions(-)

New commits:
commit 233286df08aeedb4e228fd523365b94543b16fca
Author: Balazs Varga 
AuthorDate: Tue Jul 13 18:03:28 2021 +0200
Commit: László Németh 
CommitDate: Mon Aug 9 19:32:36 2021 +0200

tdf#64086 tdf#143623 tdf#66250 XLSX: fix named ranges in charts

tdf#64086: fix broken XLSX import of named ranges in charts

Do not create inner data table in Calc for charts, if the
data source contains named ranges. Use the named ranges
(local sheet names and global names) to find the data
source of charts, so it will be updated correctly if we
modify the values in cells.

Second part:

tdf#143623: chart OOXML, offapi: export the named ranges in charts

with the proper special (non-ooxml-standard) Excel syntax.
We need to add "[0]" characters before a global named range
for proper refreshing of chart data. Also we have to add the
sheet name to the local named ranges even if it's on the same
sheet, but only in case of charts. Because of this, add property
RefConventionChartOOXML to com::sun::star::sheet::FormulaParser,
which specifies that use special OOXML chart syntax in case of
OOXML reference convention, when parsing a formula string.

Third part:

tdf#66250 ODF chart: export the reference of named ranges

in case of charts, if the named range contains a valid reference.

Note: maybe export the name of named ranges would be a nicer
solution in the future.

Follow-up of commit 3c766512984feff739377d0f0af46558ee7139fd
"Related: tdf#64086 Add FormulaGrammar::isRefConventionOOXML()".

Thanks to Eike Rathke for his help.

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

diff --git a/chart2/qa/extras/chart2export2.cxx 
b/chart2/qa/extras/chart2export2.cxx
index e05d984f75cf..adde208d620c 100644
--- a/chart2/qa/extras/chart2export2.cxx
+++ b/chart2/qa/extras/chart2export2.cxx
@@ -97,6 +97,7 @@ public:
 void testTdf138181();
 void testCustomShapeText();
 void testuserShapesXLSX();
+void testNameRangeXLSX();
 
 CPPUNIT_TEST_SUITE(Chart2ExportTest2);
 CPPUNIT_TEST(testSetSeriesToSecondaryAxisXLSX);
@@ -157,6 +158,7 @@ public:
 CPPUNIT_TEST(testTdf138181);
 CPPUNIT_TEST(testCustomShapeText);
 CPPUNIT_TEST(testuserShapesXLSX);
+CPPUNIT_TEST(testNameRangeXLSX);
 CPPUNIT_TEST_SUITE_END();
 };
 
@@ -1420,6 +1422,21 @@ void Chart2ExportTest2::testuserShapesXLSX()
 CPPUNIT_ASSERT(!xRange->getString().isEmpty());
 }
 
+void Chart2ExportTest2::testNameRangeXLSX()
+{
+load(u"/chart2/qa/extras/data/xlsx/", "chart_with_name_range.xlsx");
+xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open 
XML");
+CPPUNIT_ASSERT(pXmlDoc);
+// test the syntax of local range name on the the local sheet.
+assertXPathContent(pXmlDoc,
+   
"/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:cat/c:strRef/c:f",
+   "Sheet1!local_name_range");
+// test the syntax of a global range name.
+assertXPathContent(pXmlDoc,
+   
"/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:val/c:numRef/c:f",
+   "[0]!series1");
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ExportTest2);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/chart2/qa/extras/data/xlsx/chart_with_name_range.xlsx 
b/chart2/qa/extras/data/xlsx/chart_with_name_range.xlsx
new file mode 100644
index ..2f2b814011ff
Binary files /dev/null and 
b/chart2/qa/extras/data/xlsx/chart_with_name_range.xlsx differ
diff --git a/offapi/com/sun/star/sheet/FormulaParser.idl 
b/offapi/com/sun/star/sheet/FormulaParser.idl
index 2c1145ec1369..fb9085130341 100644
--- a/offapi/com/sun/star/sheet/FormulaParser.idl
+++ b/offapi/com/sun/star/sheet/FormulaParser.idl
@@ -81,6 +81,16 @@ service Formula

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

2021-08-09 Thread Justin Luth (via logerrit)
 sw/source/core/txtnode/txtedt.cxx |   19 +--
 1 file changed, 17 insertions(+), 2 deletions(-)

New commits:
commit ae63df06b49c0439f8a7532656dbf6063dccdc4f
Author: Justin Luth 
AuthorDate: Thu Jul 15 09:07:23 2021 +0200
Commit: László Németh 
CommitDate: Mon Aug 9 19:30:01 2021 +0200

tdf#65535 sw spell: ignore comment marker when checking spelling

A comment in the middle of the word should not render it as
a misspelling. So strip it out when checking - like hidden or redlines.

One existing problem is that if the word is STILL misspelled,
then replacing it will remove the in-word comment.
That was true before this patch, so it is just another
deirable enhancement to try to avoid that.

Change-Id: Ic69385d5bbeca2d17b1969211c118d4d38e6a22f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118972
Tested-by: Jenkins
Tested-by: László Németh 
Reviewed-by: Justin Luth 
Reviewed-by: László Németh 
(cherry picked from commit a6555eb809e2580562cd431085e35a23b7d47f9a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119856

diff --git a/sw/source/core/txtnode/txtedt.cxx 
b/sw/source/core/txtnode/txtedt.cxx
index 8913fbd94810..7caa528b0dde 100644
--- a/sw/source/core/txtnode/txtedt.cxx
+++ b/sw/source/core/txtnode/txtedt.cxx
@@ -124,6 +124,19 @@ struct SwParaIdleData_Impl
 bAutoComplDirty ( true ) {};
 };
 
+static bool lcl_HasComments(const SwTextNode& rNode)
+{
+sal_Int32 nPosition = rNode.GetText().indexOf(CH_TXTATR_INWORD);
+while (nPosition != -1)
+{
+const SwTextAttr* pAttr = rNode.GetTextAttrForCharAt(nPosition);
+if (pAttr && pAttr->Which() == RES_TXTATR_ANNOTATION)
+return true;
+nPosition = rNode.GetText().indexOf(CH_TXTATR_INWORD, nPosition + 1);
+}
+return false;
+}
+
 /*
  * This has basically the same function as SwScriptInfo::MaskHiddenRanges,
  * only for deleted redlines
@@ -939,6 +952,7 @@ bool SwTextNode::Spell(SwSpellArgs* pArgs)
 // modify string according to redline information and hidden text
 const OUString aOldText( m_Text );
 OUStringBuffer buf(m_Text);
+const bool bContainsComments = lcl_HasComments(*this);
 const bool bRestoreString =
 lcl_MaskRedlinesAndHiddenText(*this, buf, 0, m_Text.getLength());
 if (bRestoreString)
@@ -1024,7 +1038,7 @@ bool SwTextNode::Spell(SwSpellArgs* pArgs)
 // redlines can leave "in word" character within word,
 // we must remove them before spell checking
 // to avoid false alarm
-( bRestoreString && pArgs->xSpeller->isValid( 
rWord.replaceAll(OUStringChar(CH_TXTATR_INWORD), ""),
+( (bRestoreString || bContainsComments) && 
pArgs->xSpeller->isValid( rWord.replaceAll(OUStringChar(CH_TXTATR_INWORD), ""),
 static_cast(eActLang), Sequence< 
PropertyValue >() ) ) )
 {
 pArgs->xSpellAlt = nullptr;
@@ -1243,6 +1257,7 @@ SwRect SwTextFrame::AutoSpell_(SwTextNode & rNode, 
sal_Int32 nActPos)
 // modify string according to redline information and hidden text
 const OUString aOldText( pNode->GetText() );
 OUStringBuffer buf(pNode->m_Text);
+const bool bContainsComments = lcl_HasComments(rNode);
 const bool bRestoreString =
 lcl_MaskRedlinesAndHiddenText(*pNode, buf, 0, 
pNode->GetText().getLength());
 if (bRestoreString)
@@ -1326,7 +1341,7 @@ SwRect SwTextFrame::AutoSpell_(SwTextNode & rNode, 
sal_Int32 nActPos)
 // redlines can leave "in word" character within word,
 // we must remove them before spell checking
 // to avoid false alarm
-(!bRestoreString || !xSpell->isValid( 
rWord.replaceAll(OUStringChar(CH_TXTATR_INWORD), ""),
+((!bRestoreString && !bContainsComments) || 
!xSpell->isValid( rWord.replaceAll(OUStringChar(CH_TXTATR_INWORD), ""),
 static_cast(eActLang), Sequence< 
PropertyValue >() ) ) )
 {
 sal_Int32 nSmartTagStt = nBegin;


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

2021-08-09 Thread Vasily Melenchuk (via logerrit)
 sw/qa/extras/odfexport/data/tdf143605.odt |binary
 sw/qa/extras/odfexport/odfexport2.cxx |6 +
 sw/source/core/doc/number.cxx |  168 +++---
 3 files changed, 90 insertions(+), 84 deletions(-)

New commits:
commit 214a649d7d4a2bab8c4d8829bacb16e72c24e026
Author: Vasily Melenchuk 
AuthorDate: Thu Aug 5 20:40:13 2021 +0300
Commit: Xisco Fauli 
CommitDate: Mon Aug 9 19:26:36 2021 +0200

tdf#143605: sw: numbering rule is not constructed for numbering type "None"

Previously during refactoring this condition was lost. And it
is possible practically that we have all format for numbering
(prefix, suffix, format string, etc) but numbering is disabled.

Change-Id: I0c8ab446753308ad80b8d133824a936dacf6cc82
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120082
Tested-by: Thorsten Behrens 
Reviewed-by: Thorsten Behrens 
(cherry picked from commit d1f1f546b212ecd651146addeb328806bb270d5f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120137
Tested-by: Xisco Fauli 
Reviewed-by: Xisco Fauli 

diff --git a/sw/qa/extras/odfexport/data/tdf143605.odt 
b/sw/qa/extras/odfexport/data/tdf143605.odt
new file mode 100644
index ..7fb597e6d71c
Binary files /dev/null and b/sw/qa/extras/odfexport/data/tdf143605.odt differ
diff --git a/sw/qa/extras/odfexport/odfexport2.cxx 
b/sw/qa/extras/odfexport/odfexport2.cxx
index 68571cd8b863..8ed38f7eb85a 100644
--- a/sw/qa/extras/odfexport/odfexport2.cxx
+++ b/sw/qa/extras/odfexport/odfexport2.cxx
@@ -60,6 +60,12 @@ DECLARE_ODFEXPORT_TEST(testTdf137199, "tdf137199.docx")
 CPPUNIT_ASSERT_EQUAL(OUString("HELLO2WORLD!"), 
getProperty(getParagraph(4), "ListLabelString"));
 }
 
+DECLARE_ODFEXPORT_TEST(testTdf143605, "tdf143605.odt")
+{
+// With numering type "none" there should be nothing
+CPPUNIT_ASSERT_EQUAL(OUString(""), getProperty(getParagraph(1), 
"ListLabelString"));
+}
+
 DECLARE_ODFEXPORT_TEST(testListFormatDocx, "listformat.docx")
 {
 // Ensure in resulting ODT we also have not just prefix/suffux, but custom 
delimiters
diff --git a/sw/source/core/doc/number.cxx b/sw/source/core/doc/number.cxx
index 7d82a12623b6..a86668fa1936 100644
--- a/sw/source/core/doc/number.cxx
+++ b/sw/source/core/doc/number.cxx
@@ -657,102 +657,102 @@ OUString SwNumRule::MakeNumString( const 
SwNumberTree::tNumberVector & rNumVecto
 nLevel = _nRestrictToThisLevel;
 }
 
-if (nLevel < MAXLEVEL)
-{
-const SwNumFormat& rMyNFormat = Get( 
o3tl::narrowing(nLevel) );
+assert(nLevel < MAXLEVEL);
 
-{
-css::lang::Locale aLocale( LanguageTag::convertToLocale(nLang));
+const SwNumFormat& rMyNFormat = Get( o3tl::narrowing(nLevel) );
 
-if (rMyNFormat.HasListFormat())
-{
-OUString sLevelFormat = rMyNFormat.GetListFormat(bInclStrings);
+if (rMyNFormat.GetNumberingType() == SVX_NUM_NUMBER_NONE)
+return OUString();
 
-// In this case we are ignoring GetIncludeUpperLevels: we put 
all
-// level numbers requested by level format
-for (SwNumberTree::tNumberVector::size_type i=0; i <= nLevel; 
++i)
-{
-OUString sReplacement;
-if (rNumVector[i])
-{
-if (bOnlyArabic)
-sReplacement = OUString::number(rNumVector[i]);
-else
-sReplacement = Get(i).GetNumStr(rNumVector[i], 
aLocale);
-}
-else
-sReplacement = "0";// all 0 level are a 0
+css::lang::Locale aLocale( LanguageTag::convertToLocale(nLang));
 
-OUString sFind("%" + OUString::number(i + 1) + "%");
-sal_Int32 nPosition = sLevelFormat.indexOf(sFind);
-if (nPosition >= 0)
-sLevelFormat = sLevelFormat.replaceAt(nPosition, 
sFind.getLength(), sReplacement);
-}
+if (rMyNFormat.HasListFormat())
+{
+OUString sLevelFormat = rMyNFormat.GetListFormat(bInclStrings);
 
-aStr = sLevelFormat;
+// In this case we are ignoring GetIncludeUpperLevels: we put all
+// level numbers requested by level format
+for (SwNumberTree::tNumberVector::size_type i=0; i <= nLevel; ++i)
+{
+OUString sReplacement;
+if (rNumVector[i])
+{
+if (bOnlyArabic)
+sReplacement = OUString::number(rNumVector[i]);
+else
+sReplacement = Get(i).GetNumStr(rNumVector[i], aLocale);
 }
 else
+sReplacement = "0";// all 0 level are a 0
+
+OUString sFind("%" + OUString::number(i + 1) + "%");
+sal_Int32 nPosition = sLevelFormat.indexOf(sFind);
+

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

2021-08-09 Thread Attila Szűcs (via logerrit)
 sc/qa/extras/scpdfexport.cxx|   19 
 sc/qa/extras/testdocuments/tdf64703_hiddenPageBreak.ods |binary
 sc/source/ui/view/printfun.cxx  |7 -
 3 files changed, 24 insertions(+), 2 deletions(-)

New commits:
commit 81f4d72a827942ce482e381e55302a1e6700049e
Author: Attila Szűcs 
AuthorDate: Thu Jul 15 15:50:09 2021 +0200
Commit: Xisco Fauli 
CommitDate: Mon Aug 9 19:24:05 2021 +0200

tdf#64703 sc: fix regression of printing page breaks

After hidden rows or rows hidden by Autofilter,
printing removed the page breaks between the visible
rows, too. Now Calc supports WYSWYG: it prints all the
visible page breaks, which includes the page breaks
between the visible rows, and page breaks between the
hidden rows (multiple page breaks of a hidden row
sequence converted to a single page break).

This was a regression since LO 3.6, introducing
Autofilter with multichoice.

Co-authored-by: Tibor Nagy (NISZ)

Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118984
Tested-by: László Németh 
Reviewed-by: László Németh 
(cherry picked from commit 8b2a2de2481843502f0566e773ed11532520bc70)

Check nNextPageBreak for ScRowBreakIterator::NOT_FOUND, tdf#64703 follow-up

Ifa0fd1b53da70018d8d14abd4f8ba347908d5ea9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119732
Reviewed-by: Eike Rathke 
Tested-by: Jenkins

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

diff --git a/sc/qa/extras/scpdfexport.cxx b/sc/qa/extras/scpdfexport.cxx
index b98ee774b7ee..e06620827e4f 100644
--- a/sc/qa/extras/scpdfexport.cxx
+++ b/sc/qa/extras/scpdfexport.cxx
@@ -65,11 +65,13 @@ public:
 void testExportRange_Tdf120161();
 void testExportFitToPage_Tdf103516();
 void testUnoCommands_Tdf120161();
+void testTdf64703_hiddenPageBreak();
 
 CPPUNIT_TEST_SUITE(ScPDFExportTest);
 CPPUNIT_TEST(testExportRange_Tdf120161);
 CPPUNIT_TEST(testExportFitToPage_Tdf103516);
 CPPUNIT_TEST(testUnoCommands_Tdf120161);
+CPPUNIT_TEST(testTdf64703_hiddenPageBreak);
 CPPUNIT_TEST_SUITE_END();
 };
 
@@ -438,6 +440,23 @@ void ScPDFExportTest::testUnoCommands_Tdf120161()
 }
 }
 
+void ScPDFExportTest::testTdf64703_hiddenPageBreak()
+{
+mxComponent = loadFromDesktop(m_directories.getURLFromSrc(DATA_DIRECTORY)
+  + "tdf64703_hiddenPageBreak.ods",
+  "com.sun.star.sheet.SpreadsheetDocument");
+uno::Reference xModel(mxComponent, uno::UNO_QUERY);
+
+// A1:A11: 4-page export
+{
+ScRange range1(0, 0, 0, 0, 10, 0);
+std::shared_ptr pPDFFile = exportToPDF(xModel, range1);
+bool bFound = false;
+CPPUNIT_ASSERT(hasTextInPdf(pPDFFile, "/Count 4>>", bFound));
+CPPUNIT_ASSERT_EQUAL(true, bFound);
+}
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(ScPDFExportTest);
 CPPUNIT_PLUGIN_IMPLEMENT();
 
diff --git a/sc/qa/extras/testdocuments/tdf64703_hiddenPageBreak.ods 
b/sc/qa/extras/testdocuments/tdf64703_hiddenPageBreak.ods
new file mode 100644
index ..87f110915d69
Binary files /dev/null and 
b/sc/qa/extras/testdocuments/tdf64703_hiddenPageBreak.ods differ
diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx
index 950fa944a183..782af0a440bf 100644
--- a/sc/source/ui/view/printfun.cxx
+++ b/sc/source/ui/view/printfun.cxx
@@ -3197,8 +3197,11 @@ void PrintPageRanges::calculate(ScDocument& rDoc,
 nLastVisibleRow = nLastRow;
 }
 else
-// skip all hidden rows.
-nRow = nLastRow;
+{
+// Skip all hidden rows until next pagebreak.
+nRow = ((nNextPageBreak == ScRowBreakIterator::NOT_FOUND) ? 
nLastRow :
+std::min(nLastRow, nNextPageBreak - 1));
+}
 }
 
 if (!bVisRow)


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

2021-08-09 Thread Miklos Vajna (via logerrit)
 oox/qa/unit/data/smartart-groupshape.pptx |binary
 oox/qa/unit/drawingml.cxx |   19 +++
 oox/source/drawingml/shape.cxx|   17 -
 3 files changed, 35 insertions(+), 1 deletion(-)

New commits:
commit 84033de1bfe3e6951a1f563d85e40fb6d29ff3be
Author: Miklos Vajna 
AuthorDate: Fri Aug 6 16:56:30 2021 +0200
Commit: Xisco Fauli 
CommitDate: Mon Aug 9 17:58:27 2021 +0200

tdf#132696 PPTX import: fix missing SmartArt when it's part of a group shape

Regression from commit e9986153e44d7ec6ca9c5f1373971de74dcbacda (PPTX
import: import SmartArt drawing into single GroupShape, 2019-03-14), the
problem was that oox::ppt::PPTShape::addShape() and
oox::drawingml::Shape::addShape() were not in sync.

PPTShape unconditionally maps SmartArt to shapes, while the shared Shape
class defaults to converting it to a non-editable metafile. The above
commit changed the handling of in-groupshape SmartArts to go via
Shape::addShape() instead of PPTShape::addShape(), which exposed the
underlying problem that the convert-to-metafile mechanism is currently
only working in the DOCX case.

Fix the problem by again ignoring the convert-to-metafile flag for the
PPTX import case.

This also exposed a previously hidden problem:

make -C oox -sr CppunitTest_oox_drawingml 
CPPUNIT_TEST_NAME="testGroupShapeSmartArt testTdf131082"

started to make testTdf131082 fail. The tweak in
Shape::createAndInsert() fixes the testcase failure, but likely there is
a deeper problem there, unrelated to the regression.

Change-Id: I4e1e9645eaa266d0d7560767c3c59ba9549ccdb4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120122
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins
(cherry picked from commit 030cdbc7f8782eb196f09661bc2f116d790de9be)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120145
Reviewed-by: Xisco Fauli 

diff --git a/oox/qa/unit/data/smartart-groupshape.pptx 
b/oox/qa/unit/data/smartart-groupshape.pptx
new file mode 100644
index ..81dcee1e52a3
Binary files /dev/null and b/oox/qa/unit/data/smartart-groupshape.pptx differ
diff --git a/oox/qa/unit/drawingml.cxx b/oox/qa/unit/drawingml.cxx
index 92d08b5f0c8a..c8dc0d9cc1fb 100644
--- a/oox/qa/unit/drawingml.cxx
+++ b/oox/qa/unit/drawingml.cxx
@@ -326,6 +326,25 @@ CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testTableShadow)
 verify(getComponent());
 }
 
+CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testGroupShapeSmartArt)
+{
+// Given a file with a smartart inside a group shape:
+OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + 
"smartart-groupshape.pptx";
+
+// When loading that file:
+load(aURL);
+
+// Then make sure that the smartart is not just an empty group shape:
+uno::Reference 
xDrawPagesSupplier(getComponent(), uno::UNO_QUERY);
+uno::Reference 
xDrawPage(xDrawPagesSupplier->getDrawPages()->getByIndex(0),
+ uno::UNO_QUERY);
+uno::Reference xGroup(xDrawPage->getByIndex(0), 
uno::UNO_QUERY);
+uno::Reference xSmartArt(xGroup->getByIndex(0), 
uno::UNO_QUERY);
+// Without the accompanying fix in place, this test would have failed, 
because we lost all
+// children of the group shape representing the smartart.
+CPPUNIT_ASSERT_GREATER(static_cast(0), xSmartArt->getCount());
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index b0e2ddef30e7..b6900b8d1aeb 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -296,7 +296,12 @@ void Shape::addShape(
 if( meFrameType == FRAMETYPE_DIAGRAM )
 {
 keepDiagramCompatibilityInfo();
-if( !SvtFilterOptions::Get().IsSmartArt2Shape() )
+
+// Check if this is the PPTX import, so far converting 
SmartArt to a non-editable
+// metafile is only imlemented for DOCX.
+bool bPowerPoint = 
dynamic_cast(&rFilterBase) != nullptr;
+
+if (!SvtFilterOptions::Get().IsSmartArt2Shape() && 
!bPowerPoint)
 convertSmartArtToMetafile( rFilterBase );
 }
 
@@ -973,7 +978,17 @@ Reference< XShape > const & Shape::createAndInsert(
 
 Reference< lang::XMultiServiceFactory > xServiceFact( 
rFilterBase.getModel(), UNO_QUERY_THROW );
 if ( !mxShape.is() )
+{
 mxShape.set( xServiceFact->createInstance( aServiceName ), 
UNO_QUERY_THROW );
+if (aServiceName == "com.sun.star.drawing.GroupShape")
+{
+// TODO why is this necessary? A newly created group shape should 
have an empty
+// grab-bag.
+uno::Reference xPropertySet(mxShape, 
uno::UNO_QUERY);
+beans::PropertyValues aVals;
+xPropertyS

[Libreoffice-commits] core.git: starmath/inc starmath/Library_sm.mk starmath/source

2021-08-09 Thread dante (via logerrit)
 starmath/Library_sm.mk  |1 
 starmath/inc/mathml/element.hxx |   62 +
 starmath/inc/mathml/iterator.hxx|  125 
 starmath/source/mathml/element.cxx  |1 
 starmath/source/mathml/iterator.cxx |   71 
 5 files changed, 260 insertions(+)

New commits:
commit e8d8dad6bba2bd0a4307ee3c1fc40f117680c1f3
Author: dante 
AuthorDate: Sun Aug 8 23:27:56 2021 +0200
Commit: Noel Grandin 
CommitDate: Mon Aug 9 17:49:22 2021 +0200

Add an iterator for the new starmath matml elements

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

diff --git a/starmath/Library_sm.mk b/starmath/Library_sm.mk
index 297cca650684..e9bb53676b91 100644
--- a/starmath/Library_sm.mk
+++ b/starmath/Library_sm.mk
@@ -104,6 +104,7 @@ $(eval $(call gb_Library_add_exception_objects,sm,\
 starmath/source/mathml/mathmlexport \
 starmath/source/mathml/mathmlimport \
 starmath/source/mathml/mathmlMo \
+starmath/source/mathml/iterator \
 starmath/source/mathml/attribute \
 starmath/source/mathml/element \
 starmath/source/mathml/def \
diff --git a/starmath/inc/mathml/element.hxx b/starmath/inc/mathml/element.hxx
index 8843d5e8767d..2c5ec40ab019 100644
--- a/starmath/inc/mathml/element.hxx
+++ b/starmath/inc/mathml/element.hxx
@@ -10,6 +10,7 @@
 #pragma once
 
 #include "attribute.hxx"
+#include "starmathdatabase.hxx"
 #include 
 
 #include 
@@ -27,6 +28,7 @@ public:
 , m_aAttributePosList(0)
 , m_aSubElements(0)
 , m_aParentElement(nullptr)
+, m_nSubElementId(0)
 {
 SmImplAttributeType();
 };
@@ -39,10 +41,26 @@ protected:
 , m_aESelection(0, 0, 0, 0)
 , m_aSubElements(0)
 , m_aParentElement(nullptr)
+, m_nSubElementId(0)
 {
 SmImplAttributeType();
 };
 
+public:
+SmMlElement(const SmMlElement& aElement)
+: SmRect(static_cast(aElement))
+, m_aElementType(aElement.getMlElementType())
+, m_aText(aElement.getText())
+, m_aESelection(aElement.getESelectionReference())
+, m_aSubElements(0)
+, m_aParentElement(nullptr)
+, m_nSubElementId(aElement.getSubElementId())
+{
+m_aAttributePosList = 
std::vector(aElement.getAttributeCount());
+for (size_t i = 0; i < aElement.getAttributeCount(); ++i)
+setAttributeForce(i, aElement.getAttributePointer(i));
+};
+
 private:
 // Type of element
 SmMlElementType m_aElementType;
@@ -65,6 +83,9 @@ private:
 // Parent element
 SmMlElement* m_aParentElement;
 
+// Child id, so it is possible to iterata
+size_t m_nSubElementId;
+
 private:
 void SmImplAttributeType();
 
@@ -92,6 +113,12 @@ public: // location in the source
   */
 ESelection getESelection() const { return m_aESelection; };
 
+/**
+  * Returns the location in the source code of the node type
+  * @return selection
+  */
+const ESelection& getESelectionReference() const { return m_aESelection; };
+
 /**
   * Sets the location in the source code of the node type
   * @param aESelection
@@ -147,6 +174,30 @@ public: // attributes
   */
 void setAttribute(const SmMlAttribute* aAttribute);
 
+protected: // attributes
+/**
+  * Get's a given attribute.
+  * If no available returns empty attribute.
+  * @param nAttributePos
+  * @return given attribute.
+  */
+const SmMlAttribute* getAttributePointer(size_t nAttributePos) const
+{
+return nAttributePos < m_aAttributeList.size() ? 
&m_aAttributeList[nAttributePos] : nullptr;
+}
+
+/**
+  * Set's a given attribute.
+  * If no available undefined behaviour.
+  * @param nAttributePos
+  * @param aAttribute
+  * @return given attribute.
+  */
+void setAttributeForce(size_t nAttributePos, const SmMlAttribute* 
aAttribute)
+{
+m_aAttributeList[nAttributePos].setMlAttributeValue(aAttribute);
+}
+
 public: // sub elements
 /**
   * Returns the sub elements count
@@ -181,6 +232,17 @@ public: // sub elements
   */
 void setSubElement(size_t nPos, SmMlElement* aElement);
 
+/**
+  * Get's subelement id
+  */
+size_t getSubElementId() const { return m_nSubElementId; }
+
+/**
+  * Set's subelement id
+  * @param nSubElementId
+  */
+void setSubElementId(size_t nSubElementId) { m_nSubElementId = 
nSubElementId; }
+
 public: // parent elements
 /**
   * Returns the parent element
diff --git a/starmath/inc/mathml/iterator.hxx b/starmath/inc/mathml/iterator.hxx
new file mode 100644
index ..559829ce82f1
--- /dev/null
+++ b/starmath/inc/mathml/iterator.hxx
@@ -0,0 +1,125 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil

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

2021-08-09 Thread Eike Rathke (via logerrit)
 svl/source/numbers/zformat.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 1db5e59aa2fcccb070388c2b817737caa17ed4f0
Author: Eike Rathke 
AuthorDate: Sun Aug 8 15:42:19 2021 +0200
Commit: Xisco Fauli 
CommitDate: Mon Aug 9 17:48:58 2021 +0200

Year without leading 0 if era code is also used

 GG or GG 
shall display 1 BC not 0001 BC, or AD 1 not AD 0001

Change-Id: I1955f55d37a4af5075c9cfc20c3ea200ba340765
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120174
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 5e69c5fbdb44cd782080e7f4d9ad89dc48b2d1b1)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120133
Reviewed-by: Mike Kaganski 
Reviewed-by: Xisco Fauli 

diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index d14bf73841ee..255bfb09b5f7 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -3834,7 +3834,7 @@ bool SvNumberformat::ImpGetDateOutput(double fNumber,
 sBuff.append('-');
 }
 aStr = rCal.getDisplayString( CalendarDisplayCode::LONG_YEAR, 
nNatNum );
-if (aStr.getLength() < 4)
+if (aStr.getLength() < 4 && !lcl_hasEra(NumFor[nIx]))
 {
 using namespace comphelper::string;
 // Ensure that year consists of at least 4 digits, so it
@@ -4199,7 +4199,7 @@ bool SvNumberformat::ImpGetDateTimeOutput(double fNumber,
 sBuff.append('-');
 }
 aYear = rCal.getDisplayString( CalendarDisplayCode::LONG_YEAR, 
nNatNum );
-if (aYear.getLength() < 4)
+if (aYear.getLength() < 4 && !lcl_hasEra(NumFor[nIx]))
 {
 using namespace comphelper::string;
 // Ensure that year consists of at least 4 digits, so it


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

2021-08-09 Thread Andreas Heinisch (via logerrit)
 sc/qa/extras/macros-test.cxx |   30 ++
 sc/qa/extras/testdocuments/tdf143582.ods |binary
 scripting/source/basprov/basscript.cxx   |2 ++
 3 files changed, 32 insertions(+)

New commits:
commit cb97358ab845f13f1c57b410e59126f20652d552
Author: Andreas Heinisch 
AuthorDate: Mon Aug 2 19:48:35 2021 +0200
Commit: Xisco Fauli 
CommitDate: Mon Aug 9 17:36:57 2021 +0200

tdf#143582 - Clear return value of the method before calling it

Otherwise the function keeps a copy of its return value, which may be
used in an upcoming call.

Change-Id: I4977c39e1ce48cfd5ab067a4df4783f10505a9ae
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119905
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120197

diff --git a/sc/qa/extras/macros-test.cxx b/sc/qa/extras/macros-test.cxx
index fae1e4f71027..68d43e1ce19d 100644
--- a/sc/qa/extras/macros-test.cxx
+++ b/sc/qa/extras/macros-test.cxx
@@ -59,6 +59,7 @@ public:
 void testTdf138646();
 void testTdf105558();
 void testTdf90278();
+void testTdf143582();
 
 CPPUNIT_TEST_SUITE(ScMacrosTest);
 CPPUNIT_TEST(testStarBasic);
@@ -84,6 +85,7 @@ public:
 CPPUNIT_TEST(testTdf138646);
 CPPUNIT_TEST(testTdf105558);
 CPPUNIT_TEST(testTdf90278);
+CPPUNIT_TEST(testTdf143582);
 
 CPPUNIT_TEST_SUITE_END();
 };
@@ -950,6 +952,34 @@ void ScMacrosTest::testTdf133889()
 xCloseable->close(true);
 }
 
+void ScMacrosTest::testTdf143582()
+{
+OUString aFileName;
+createFileURL(u"tdf143582.ods", aFileName);
+auto xComponent = loadFromDesktop(aFileName, 
"com.sun.star.sheet.SpreadsheetDocument");
+
+css::uno::Any aRet;
+css::uno::Sequence aParams;
+css::uno::Sequence aOutParam;
+css::uno::Sequence aOutParamIndex;
+
+SfxObjectShell::CallXScript(
+xComponent,
+
"vnd.sun.Star.script:Standard.Module1.TestScriptInvoke?language=Basic&location=document",
+aParams, aRet, aOutParamIndex, aOutParam);
+
+OUString aReturnValue;
+aRet >>= aReturnValue;
+
+// Without the fix in place, this test would have failed with
+// - Expected: Test
+// - Actual  : TeTest
+CPPUNIT_ASSERT_EQUAL(OUString("Test"), aReturnValue);
+
+css::uno::Reference xCloseable(xComponent, 
css::uno::UNO_QUERY_THROW);
+xCloseable->close(true);
+}
+
 void ScMacrosTest::testTdf138646()
 {
 OUString aFileName;
diff --git a/sc/qa/extras/testdocuments/tdf143582.ods 
b/sc/qa/extras/testdocuments/tdf143582.ods
new file mode 100644
index ..05f4f07cea2c
Binary files /dev/null and b/sc/qa/extras/testdocuments/tdf143582.ods differ
diff --git a/scripting/source/basprov/basscript.cxx 
b/scripting/source/basprov/basscript.cxx
index a22cd82f343e..6a9a8d1d8b7b 100644
--- a/scripting/source/basprov/basscript.cxx
+++ b/scripting/source/basprov/basscript.cxx
@@ -244,6 +244,8 @@ namespace basprov
 if ( m_documentBasicManager && m_xDocumentScriptContext.is() )
 aOldThisComponent = 
m_documentBasicManager->SetGlobalUNOConstant( "ThisComponent", makeAny( 
m_xDocumentScriptContext ) );
 
+// tdf#143582 - clear return value of the method before calling it
+m_xMethod->Clear();
 if ( m_caller.hasElements() && m_caller[ 0 ].hasValue()  )
 {
 SbxVariableRef xCallerVar = new SbxVariable( SbxVARIANT );


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sw/source

2021-08-09 Thread Miklos Vajna (via logerrit)
 sw/source/core/view/viewsh.cxx |   10 --
 1 file changed, 8 insertions(+), 2 deletions(-)

New commits:
commit d0b5ff42431d8d18ab9b70fd54206f21bbe4316a
Author: Miklos Vajna 
AuthorDate: Wed Aug 4 13:44:24 2021 +0200
Commit: Mike Kaganski 
CommitDate: Mon Aug 9 17:15:48 2021 +0200

sw lok: avoid expensive DLPre/PostPaint2() around InvalidateWindows()

This shows up on profiles and it's not needed. It was only there,
because Online always needs an invalidation to have updated tiles, so
there the paint was replaced with an invalidate. And then the
drawinglayer setup/teardown was not made conditional by accident.

The PaintTile() case goes via Paint() -> PaintSwFrame(), which still
calls these functions; this commit only speeds up
SwViewShell::ImplEndAction(), which is called synchronously e.g. on
every keypress.

(cherry picked from commit aff28c59816d046d9b74460c1b17101b99b9514e)

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

diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index bf160861ee3c..0a87c1672f97 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -418,7 +418,10 @@ void SwViewShell::ImplEndAction( const bool bIdleEnd )
 // seems to work (and does technically) but fails 
with transparent objects. Since the
 // region given to BeginDarwLayers() defines the 
clip region for DrawingLayer paint,
 // transparent objects in the single rectangles 
will indeed be painted multiple times.
-DLPrePaint2(vcl::Region(aRect.SVRect()));
+if (!comphelper::LibreOfficeKit::isActive())
+{
+DLPrePaint2(vcl::Region(aRect.SVRect()));
+}
 
 if ( bPaintsFromSystem )
 PaintDesktop(*GetOut(), aRect);
@@ -428,7 +431,10 @@ void SwViewShell::ImplEndAction( const bool bIdleEnd )
 
pCurrentLayout->GetCurrShell()->InvalidateWindows(aRect.SVRect());
 
 // #i75172# end DrawingLayer paint
-DLPostPaint2(true);
+if (!comphelper::LibreOfficeKit::isActive())
+{
+DLPostPaint2(true);
+}
 }
 }
 


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

2021-08-09 Thread Xisco Fauli (via logerrit)
 svl/qa/unit/svl.cxx |   14 ++
 1 file changed, 14 insertions(+)

New commits:
commit ccb1d71fe4c0585a42721f09d984fb699ff8f081
Author: Xisco Fauli 
AuthorDate: Mon Aug 9 10:57:32 2021 +0200
Commit: Xisco Fauli 
CommitDate: Mon Aug 9 16:44:02 2021 +0200

tdf#143664: svl_qa_cppunit: Add unittest

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

diff --git a/svl/qa/unit/svl.cxx b/svl/qa/unit/svl.cxx
index 49e1dc7f1b4b..878631e7142e 100644
--- a/svl/qa/unit/svl.cxx
+++ b/svl/qa/unit/svl.cxx
@@ -1309,6 +1309,20 @@ void Test::testIsNumberFormatSpecific()
 checkSpecificNumberFormats( aFormatter, aIO, "[de-DE] date January 
month names");
 }
 
+{
+// tdf#143664
+SvNumberFormatter aFormatter(m_xContext, LANGUAGE_GERMAN);
+
+const sal_uInt32 n = aFormatter.GetFormatIndex( NF_DATE_SYS_DDMM, 
LANGUAGE_GERMAN);
+std::vector aIO = {
+{ "23. M\u00C4R 1999", true, "23.03.1999", n },
+{ "23. M\u00C4RZ 1999", true, "23.03.1999", n },
+{ "23. MRZ 1999", true, "23.03.1999", n },
+};
+
+checkSpecificNumberFormats( aFormatter, aIO, "[de-DE] date March month 
names");
+}
+
 {
 // Test that de-AT accepts Januar and Jänner.
 SvNumberFormatter aFormatter(m_xContext, LANGUAGE_GERMAN_AUSTRIAN);


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

2021-08-09 Thread Stephan Bergmann (via logerrit)
 comphelper/source/container/interfacecontainer2.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 73b492255e4268aa4003bc3e68be4cd2a27a6ce2
Author: Stephan Bergmann 
AuthorDate: Mon Aug 9 13:29:06 2021 +0200
Commit: Stephan Bergmann 
CommitDate: Mon Aug 9 16:19:32 2021 +0200

Guard read of rCont_.bIsList with rCont_.rMutex

...as had been the case prior to 12dce07aec980562fa449fa1884e0e8379d680fb
"loplugin:unusedfields - look for fields that can be const, in comphelper"
(which this commit partly reverts; the const'ness of
OInterfaceIteratorHelper2::bIsList had already been reverted, but for no
apparent reason, in 31b0be0f21479323408e128f2e8a1a795e037e74 "improve pahole
script and pack a few classes").

That may or may not have been the cause of the apparently-sporadic
UITest_sw_table failure at ,

> /comphelper/source/container/interfacecontainer2.cxx:54:29: runtime 
error: member call on address 0x606000ed5d20 which does not point to an object 
of type 'com::sun::star::uno::XInterface'
> 0x606000ed5d20: note: object has invalid vptr
>  22 04 00 14  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  01 00 00 
00 be be be be  b0 11 46 00
>   ^~~
>   invalid vptr
> #0 0x2ab564a71e15 in 
comphelper::OInterfaceIteratorHelper2::OInterfaceIteratorHelper2(comphelper::OInterfaceContainerHelper2&)
 /comphelper/source/container/interfacecontainer2.cxx:54:29
> #1 0x2ab57614588f in void 
comphelper::OInterfaceContainerHelper2::forEach 
>(comphelper::OInterfaceContainerHelper2::NotifySingleListener const&) 
/include/comphelper/interfacecontainer2.hxx:261:31
> #2 0x2ab576144a95 in void 
comphelper::OInterfaceContainerHelper2::notifyEach(void 
(com::sun::star::document::XDocumentEventListener::*)(com::sun::star::document::DocumentEvent
 const&), com::sun::star::document::DocumentEvent const&) 
/include/comphelper/interfacecontainer2.hxx:279:5
> #3 0x2ab57613b277 in (anonymous 
namespace)::SfxGlobalEvents_Impl::implts_notifyListener(com::sun::star::document::DocumentEvent
 const&) /sfx2/source/notify/globalevents.cxx:505:26
> #4 0x2ab576131faa in (anonymous 
namespace)::SfxGlobalEvents_Impl::documentEventOccured(com::sun::star::document::DocumentEvent
 const&) /sfx2/source/notify/globalevents.cxx:256:5
> #5 0x2ab575f4abfc in (anonymous 
namespace)::NotifySingleListenerIgnoreRE::operator()(com::sun::star::uno::Reference
 const&) const /sfx2/source/doc/sfxbasemodel.cxx:3200:13
> #6 0x2ab575f002ec in void 
cppu::OInterfaceContainerHelper::forEach >((anonymous 
namespace)::NotifySingleListenerIgnoreRE const&) 
/include/cppuhelper/interfacecontainer.h:292:17
> #7 0x2ab575efdd37 in SfxBaseModel::postEvent_Impl(rtl::OUString 
const&, com::sun::star::uno::Reference 
const&) /sfx2/source/doc/sfxbasemodel.cxx:3234:14
> #8 0x2ab575efa257 in SfxBaseModel::Notify(SfxBroadcaster&, SfxHint 
const&) /sfx2/source/doc/sfxbasemodel.cxx:2883:9
> #9 0x2ab57a796d83 in SfxBroadcaster::Broadcast(SfxHint const&) 
/svl/source/notify/SfxBroadcaster.cxx:39:24
> #10 0x2ab6010f0e1f in SwLayIdle::SwLayIdle(SwRootFrame*, 
SwViewShellImp*) /sw/source/core/layout/layact.cxx:2375:24
> #11 0x2ab60385d4e2 in SwViewShell::LayoutIdle() 
/sw/source/core/view/viewsh.cxx:723:19
> #12 0x2ab5ff549ffa in sw::DocumentTimerManager::DoIdleJobs(Timer*) 
/sw/source/core/doc/DocumentTimerManager.cxx:177:42
> #13 0x2ab5ff54552a in 
sw::DocumentTimerManager::LinkStubDoIdleJobs(void*, Timer*) 
/sw/source/core/doc/DocumentTimerManager.cxx:157:1
> #14 0x2ab599cf5f41 in Link::Call(Timer*) const 
/include/tools/link.hxx:111:45
> #15 0x2ab599cf5498 in Timer::Invoke() /vcl/source/app/timer.cxx:75:21
> #16 0x2ab599b388ea in Scheduler::CallbackTaskScheduling() 
/vcl/source/app/scheduler.cxx:471:20
> #17 0x2ab59ad34490 in SalTimer::CallCallback() 
/vcl/inc/saltimer.hxx:54:13
> #18 0x2ab59ad2785c in SvpSalInstance::CheckTimeout(bool) 
/vcl/headless/svpinst.cxx:215:53
> #19 0x2ab59ad2e67c in SvpSalInstance::DoYield(bool, bool) 
/vcl/headless/svpinst.cxx:460:21
> #20 0x2ab599c35aa9 in ImplYield(bool, bool) 
/vcl/source/app/svapp.cxx:465:48
> #21 0x2ab599c34c67 in Application::Yield() 
/vcl/source/app/svapp.cxx:532:5
> #22 0x2ab599c348ae in Application::Execute() 
/vcl/source/app/svapp.cxx:444:9
> #23 0x2ab55d699b4b in desktop::Desktop::Main() 
/desktop/source/app/app.cxx:1603:13
> #24 0x2ab599cde4e9 in ImplSVMain() /vcl/source/app/svmain.cxx:199:35
> #25 0x2ab599ce7510 in SVMain() /vcl/source/app/svmain.cxx:231:12
> #26 0x2ab55d890775 in soffice_main 
/desktop/source/app/sofficemain.cxx:98:12
> #27 0x4efc6c in sal_main /desktop/source/app/main.c:49:15
> #28 0x

[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - bin/find-unneeded-includes sw/CppunitTest_sw_core_edit.mk sw/Module_sw.mk sw/qa sw/source

2021-08-09 Thread Miklos Vajna (via logerrit)
 bin/find-unneeded-includes   |1 
 sw/CppunitTest_sw_core_edit.mk   |   75 +++
 sw/Module_sw.mk  |1 
 sw/qa/core/edit/data/redline-hidden.fodt |   32 +
 sw/qa/core/edit/edit.cxx |   43 +
 sw/source/core/edit/edatmisc.cxx |2 
 6 files changed, 153 insertions(+), 1 deletion(-)

New commits:
commit 6b393b6cc65992ba6af4476024bb2f26518c388b
Author: Miklos Vajna 
AuthorDate: Thu Aug 5 13:43:50 2021 +0200
Commit: Xisco Fauli 
CommitDate: Mon Aug 9 15:43:09 2021 +0200

sw: fix assert fail with ShowRedlineChanges=false and para format

It fails like this:

loolforkit: sw/source/core/layout/wsfrm.cxx:4551: void 
UnHide(SwRootFrame&): Assertion `rLayout.GetCurrShell()->ActionPend()' failed.
#4  0x7f98e9f8c198 in UnHide(SwRootFrame&) (rLayout=...) at 
sw/source/core/layout/wsfrm.cxx:4551
#5  0x7f98e9f8c839 in SwRootFrame::SetHideRedlines(bool) 
(this=0x7f98c40f7bd0, bHideRedlines=false) at 
sw/source/core/layout/wsfrm.cxx:4664
#6  0x7f98e9b18afd in 
sw::DocumentRedlineManager::SetRedlineFlags(RedlineFlags) (this=0x80a4120, 
eMode=49) at sw/source/core/doc/DocumentRedlineManager.cxx:1097
#7  0x7f98e9cfa503 in SwEditShell::SetAttrSet(SfxItemSet 
const&, SetAttrMode, SwPaM*, bool) (this=0x8885840, rSet=
SfxItemSet of pool 0x808fd10 with parent 0x0 and Which ranges: 
[(63, 64), (120, 120)] = {...}, nFlags=SetAttrMode::DEFAULT, pPaM=0x0, 
bParagraphSetting=true)
at sw/source/core/edit/edatmisc.cxx:187
#8  0x7f98ea995f07 in SwTextShell::ExecParaAttr(SfxRequest&) 
(this=0x8bd0820, rReq=...) at sw/source/uibase/shells/txtattr.cxx:451

Fix it the same way commit dd489bc01adc22fc5015ea56b61d66104af184a8
(tdf#125754 sw_redlinehide: avoid recursive layout in SetHideRedlines(),
2019-06-19) did: make sure that SetHideRedlines() is called before
EndAllAction().

(cherry picked from commit 39392ee94c78692a9179f7face15af0c9e74e492)

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

diff --git a/bin/find-unneeded-includes b/bin/find-unneeded-includes
index 4f90ab55e9f5..3f8c38bdb158 100755
--- a/bin/find-unneeded-includes
+++ b/bin/find-unneeded-includes
@@ -286,6 +286,7 @@ def tidy(compileCommands, paths):
 args = args.replace(assumeAbs, "-x c++ " + pathAbs)
 
 invocation = "include-what-you-use -Xiwyu --no_fwd_decls -Xiwyu 
--max_line_length=200 " + args
+print(invocation)
 task_queue.put((invocation, moduleRules))
 
 task_queue.join()
diff --git a/sw/CppunitTest_sw_core_edit.mk b/sw/CppunitTest_sw_core_edit.mk
new file mode 100644
index ..21afd9ec538f
--- /dev/null
+++ b/sw/CppunitTest_sw_core_edit.mk
@@ -0,0 +1,75 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#*
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+#*
+
+$(eval $(call gb_CppunitTest_CppunitTest,sw_core_edit))
+
+$(eval $(call gb_CppunitTest_use_common_precompiled_header,sw_core_edit))
+
+$(eval $(call gb_CppunitTest_add_exception_objects,sw_core_edit, \
+sw/qa/core/edit/edit \
+))
+
+$(eval $(call gb_CppunitTest_use_libraries,sw_core_edit, \
+editeng \
+comphelper \
+cppu \
+cppuhelper \
+sal \
+sfx \
+svxcore \
+sw \
+   swqahelper \
+test \
+unotest \
+utl \
+vcl \
+svt \
+tl \
+svl \
+))
+
+$(eval $(call gb_CppunitTest_use_externals,sw_core_edit,\
+boost_headers \
+libxml2 \
+))
+
+$(eval $(call gb_CppunitTest_set_include,sw_core_edit,\
+-I$(SRCDIR)/sw/inc \
+-I$(SRCDIR)/sw/source/core/inc \
+-I$(SRCDIR)/sw/source/uibase/inc \
+-I$(SRCDIR)/sw/qa/inc \
+$$(INCLUDE) \
+))
+
+$(eval $(call gb_CppunitTest_use_api,sw_core_edit,\
+   udkapi \
+   offapi \
+   oovbaapi \
+))
+
+$(eval $(call gb_CppunitTest_use_ure,sw_core_edit))
+$(eval $(call gb_CppunitTest_use_vcl,sw_core_edit))
+
+$(eval $(call gb_CppunitTest_use_rdb,sw_core_edit,services))
+
+$(eval $(call gb_CppunitTest_use_custom_headers,sw_core_edit,\
+officecfg/registry \
+))
+
+$(eval $(call gb_CppunitTest_use_configuration,sw_core_edit))
+
+$(eval $(call gb_CppunitTest_use_uiconfigs,sw_core_edit, \
+modules/swriter \
+))
+
+$(eval $(call gb_CppunitTest_use_more_fonts,sw_core_edit))
+
+# vim: set noet sw=4 ts=4:
diff --git a

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

2021-08-09 Thread Justin Luth (via logerrit)
 dev/null   |binary
 sw/qa/extras/layout/layout.cxx |   18 -
 sw/qa/extras/odfexport/data/tdf104254_noHeaderWrapping.odt |binary
 sw/qa/extras/odfexport/odfexport2.cxx  |   10 +++
 sw/qa/extras/ww8export/ww8export3.cxx  |   14 --
 sw/source/core/text/txtfly.cxx |8 ++---
 6 files changed, 13 insertions(+), 37 deletions(-)

New commits:
commit ff91ddf0a3992b58112f3ffc3e76735b9d66e514
Author: Justin Luth 
AuthorDate: Mon Aug 2 14:39:27 2021 +0200
Commit: Xisco Fauli 
CommitDate: Mon Aug 9 15:36:53 2021 +0200

Revert "tdf#104254 sw DOCX import: fix text wrapping in headers"

This reverts 7.2 commit 798b69087119c01a3b51e0bb3240ef35cfededeb.
The change affected not only DOCX compatibilityMode 15,
but also DOC and ODT and older versions of DOCX
and everything else which should not have been affected.

This reverted change of course affected layout.
Some bug documents didn't loop after this layout breakage.
That doesn't mean that those bugs were fixed.
So just revert the tests:

Revert "tdf#96840: sw_ww8export3: Add unittest"
This reverts commit 975488594fc88aaba7298448e0ff727ebca7fe85.

Revert "tdf#64997: sw_ww8export3: Add unittest"
This reverts commit 02af9b8ef1f87bb6bc5fee22ad184681b20f201a.

Change-Id: I54f7b801199bba45d8ca6f82f77e7060c7b3fcf7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119887
Tested-by: Jenkins
Tested-by: László Németh 
Reviewed-by: Justin Luth 
Reviewed-by: László Németh 
(cherry picked from commit d03aaef3dcb5d142955457ae9b8ca4469cfafa38)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119973
Tested-by: Justin Luth 
Reviewed-by: Xisco Fauli 

diff --git a/sw/qa/extras/layout/data/tdf104254.docx 
b/sw/qa/extras/layout/data/tdf104254.docx
deleted file mode 100644
index a074db337024..
Binary files a/sw/qa/extras/layout/data/tdf104254.docx and /dev/null differ
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index 4940a37e41c4..12fb7c421967 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -3253,24 +3253,6 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf124770)
 assertXPath(pXmlDoc, "/root/page/body/txt[1]/LineBreak", 1);
 }
 
-CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTextWrappingInHeader)
-{
-SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf104254.docx");
-
-std::shared_ptr xMetaFile = 
pDoc->GetDocShell()->GetPreviewMetaFile();
-MetafileXmlDump dumper;
-xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile);
-CPPUNIT_ASSERT(pXmlDoc);
-assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/push[1]/textarray", 2);
-
-// Make sure the header image does not block any of the header text.
-// Without the accompanying fix in place, this test would have failed with:
-// - Expected: > 3000
-// - Actual  : 2009
-OUString sTextArrayX = getXPath(pXmlDoc, 
"/metafile/push[1]/push[1]/push[1]/textarray[1]", "x");
-CPPUNIT_ASSERT(sTextArrayX.toUInt32() > 3000);
-}
-
 CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testContinuousEndnotesInsertPageAtStart)
 {
 // Create a new document with CONTINUOUS_ENDNOTES enabled.
diff --git a/sw/qa/extras/odfexport/data/tdf104254_noHeaderWrapping.odt 
b/sw/qa/extras/odfexport/data/tdf104254_noHeaderWrapping.odt
new file mode 100644
index ..06dde4802b43
Binary files /dev/null and 
b/sw/qa/extras/odfexport/data/tdf104254_noHeaderWrapping.odt differ
diff --git a/sw/qa/extras/odfexport/odfexport2.cxx 
b/sw/qa/extras/odfexport/odfexport2.cxx
index bbe5d7f193e7..68571cd8b863 100644
--- a/sw/qa/extras/odfexport/odfexport2.cxx
+++ b/sw/qa/extras/odfexport/odfexport2.cxx
@@ -39,6 +39,16 @@ DECLARE_ODFEXPORT_TEST(testTdf52065_centerTabs, 
"testTdf52065_centerTabs.odt")
 CPPUNIT_ASSERT_EQUAL(OUString(u"Pečiatka zamestnávateľa"), 
parseDump("//body/txt[4]/Text[4]", "Portion"));
 }
 
+DECLARE_ODFEXPORT_TEST(testTdf104254_noHeaderWrapping, 
"tdf104254_noHeaderWrapping.odt")
+{
+xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+
+sal_Int32 nParaHeight = getXPath(pXmlDoc, "//header/txt[1]/infos/bounds", 
"height").toInt32();
+// The wrapping on header images is supposed to be ignored (since OOo for 
MS compat reasons),
+// thus making the text run underneath the image. Before, height was 1104. 
Now it is 552.
+CPPUNIT_ASSERT_MESSAGE("Paragraph should fit on a single line", 
nParaHeight < 600);
+}
+
 DECLARE_ODFEXPORT_TEST(testTdf137199, "tdf137199.docx")
 {
 CPPUNIT_ASSERT_EQUAL(OUString(">1<"), 
getProperty(getParagraph(1), "ListLabelString"));
diff --git a/sw/qa/extras/ww8export/data/tdf64997.doc 
b/sw/qa/extras/ww8export/data/tdf64997.doc
deleted file mode 100644
index d17ef5b84e26..
Binary files a/sw/qa/extras/ww8export/data/

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

2021-08-09 Thread Jim Raykowski (via logerrit)
 sd/source/ui/dlg/sdtreelb.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 64919f64f5da1ac149b5a0e1079ea8fd2299c574
Author: Jim Raykowski 
AuthorDate: Sat Aug 7 19:45:04 2021 -0800
Commit: Xisco Fauli 
CommitDate: Mon Aug 9 15:28:35 2021 +0200

tdf#143572 Restore enable undo setting immediatly after object name

is set each time here

This prevents a crash when an object is in text edit mode and a
different object is selected in the navigator to jump to.

Change-Id: I7c0eaa7770f0e3f23e6a62780f18e0a973019c62
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120170
Tested-by: Jenkins
Reviewed-by: Jim Raykowski 
(cherry picked from commit 18004b707d2cb92ab88923138d72c5ca1b03301c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120141
Reviewed-by: Xisco Fauli 

diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx
index 9d4d00eb07b1..6768fc2fe30b 100644
--- a/sd/source/ui/dlg/sdtreelb.cxx
+++ b/sd/source/ui/dlg/sdtreelb.cxx
@@ -711,7 +711,9 @@ void SdPageObjsTLV::Select()
 const bool bUndo = 
pObject->getSdrModelFromSdrObject().IsUndoEnabled();
 pObject->getSdrModelFromSdrObject().EnableUndo(false);
 pObject->SetName(m_xTreeView->get_selected_text(), false);
+pObject->getSdrModelFromSdrObject().EnableUndo(bUndo);
 m_aRowActivatedHdl.Call(*m_xTreeView);
+pObject->getSdrModelFromSdrObject().EnableUndo(false);
 pObject->SetName(OUString(), false);
 pObject->getSdrModelFromSdrObject().EnableUndo(bUndo);
 }


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

2021-08-09 Thread Jim Raykowski (via logerrit)
 sd/source/ui/dlg/sdtreelb.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit ef5bbe7a52baded54e8e6351431f2e04ef2b6828
Author: Jim Raykowski 
AuthorDate: Fri Aug 6 20:22:20 2021 -0800
Commit: Xisco Fauli 
CommitDate: Mon Aug 9 15:25:52 2021 +0200

tdf#138960 Check if tree entry has children before attempting to expand

or collapse

Change-Id: Icbfc50dda35bb6027c12a42b5e8f79da165888e0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120129
Tested-by: Jenkins
Reviewed-by: Jim Raykowski 
(cherry picked from commit 12dd1ce1dddc4ebad6be94ddec167cc7f6c45fe3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120142
Reviewed-by: Xisco Fauli 

diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx
index 4494cf35419a..9d4d00eb07b1 100644
--- a/sd/source/ui/dlg/sdtreelb.cxx
+++ b/sd/source/ui/dlg/sdtreelb.cxx
@@ -307,7 +307,7 @@ IMPL_LINK(SdPageObjsTLV, KeyInputHdl, const KeyEvent&, 
rKEvt, bool)
 if (rKeyCode.GetCode() == KEY_RETURN)
 {
 std::unique_ptr xCursor(m_xTreeView->make_iterator());
-if (m_xTreeView->get_cursor(xCursor.get()))
+if (m_xTreeView->get_cursor(xCursor.get()) && 
m_xTreeView->iter_has_child(*xCursor))
 {
 if (m_xTreeView->get_row_expanded(*xCursor))
 m_xTreeView->collapse_row(*xCursor);


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - drawinglayer/source svx/qa svx/source

2021-08-09 Thread Miklos Vajna (via logerrit)
 drawinglayer/source/tools/primitive2dxmldump.cxx   |   36 -
 svx/qa/unit/data/slide-background.odp  |binary
 svx/qa/unit/data/slide-background.png  |binary
 svx/qa/unit/sdr.cxx|   24 ++
 svx/source/sdr/primitive2d/sdrattributecreator.cxx |8 
 5 files changed, 67 insertions(+), 1 deletion(-)

New commits:
commit 7a5f12ea03e72749b2d3ccc99ed72edc3ff22d4b
Author: Miklos Vajna 
AuthorDate: Tue Aug 3 13:39:20 2021 +0200
Commit: Xisco Fauli 
CommitDate: Mon Aug 9 15:19:20 2021 +0200

tdf#142436 svx: fix handling of linked background images

Regression from commit 9fb7aaf570c03c8a26d763f1205fb8c890e8211a (Make
linked graphic register into LinkedManager again, 2018-04-13), the
problem was that now SvXMLImport::loadGraphicByURL() produces a Graphic
that has its type set to GraphicType::Default, but when
drawinglayer::primitive2d::createNewSdrFillGraphicAttribute() consumes
this graphic, it expects that the type is either a bitmap or a metafile.

Fix the problem by explicitly loading the image when the default-type,
origin-url-set case happens: this is rendering, so no problem to load
the URL and that will give us the expected graphic type.

This is also meant to keep the original problem fixed, since the Graphic
that is part of the doc model is unchanged.

(cherry picked from commit c88ff9298b25132fc34102230cef0263f045a523)

Conflicts:
drawinglayer/source/tools/primitive2dxmldump.cxx

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

diff --git a/drawinglayer/source/tools/primitive2dxmldump.cxx 
b/drawinglayer/source/tools/primitive2dxmldump.cxx
index ade8cfaed89b..203f6d008d15 100644
--- a/drawinglayer/source/tools/primitive2dxmldump.cxx
+++ b/drawinglayer/source/tools/primitive2dxmldump.cxx
@@ -12,6 +12,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 #include 
 #include 
@@ -30,6 +32,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -164,6 +167,35 @@ void Primitive2dXmlDump::decomposeAndWrite(
 
 switch (nId)
 {
+case PRIMITIVE2D_ID_BITMAPPRIMITIVE2D:
+{
+const BitmapPrimitive2D& rBitmapPrimitive2D
+= dynamic_cast(*pBasePrimitive);
+rWriter.startElement("bitmap");
+
+const BitmapEx 
aBitmapEx(VCLUnoHelper::GetBitmap(rBitmapPrimitive2D.getXBitmap()));
+const Size& rSizePixel(aBitmapEx.GetSizePixel());
+
+rWriter.attribute("height", rSizePixel.getHeight());
+rWriter.attribute("width", rSizePixel.getWidth());
+rWriter.attribute("checksum", 
OString(std::to_string(aBitmapEx.GetChecksum(;
+
+for (tools::Long y = 0; y < rSizePixel.getHeight(); y++)
+{
+rWriter.startElement("data");
+OUString aBitmapData = "";
+for (tools::Long x = 0; x < rSizePixel.getHeight(); x++)
+{
+if (x != 0)
+aBitmapData = aBitmapData + ",";
+aBitmapData = aBitmapData + aBitmapEx.GetPixelColor(x, 
y).AsRGBHexString();
+}
+rWriter.attribute("row", aBitmapData);
+rWriter.endElement();
+}
+rWriter.endElement();
+}
+break;
 case PRIMITIVE2D_ID_HIDDENGEOMETRYPRIMITIVE2D:
 {
 const HiddenGeometryPrimitive2D& rHiddenGeometryPrimitive2D = 
dynamic_cast(*pBasePrimitive);
@@ -302,7 +334,9 @@ void Primitive2dXmlDump::decomposeAndWrite(
 }
 rWriter.attribute("x", aTranslate.getX());
 rWriter.attribute("y", aTranslate.getY());
-rWriter.attribute("text", 
rTextSimplePortionPrimitive2D.getText());
+OUString aText = rTextSimplePortionPrimitive2D.getText();
+// TODO share code with 
sax_fastparser::FastSaxSerializer::write().
+rWriter.attribute("text", aText.replaceAll("", "	"));
 rWriter.attribute("fontcolor", 
convertColorToString(rTextSimplePortionPrimitive2D.getFontColor()));
 
 const drawinglayer::attribute::FontAttribute& aFontAttribute = 
rTextSimplePortionPrimitive2D.getFontAttribute();
diff --git a/svx/qa/unit/data/slide-background.odp 
b/svx/qa/unit/data/slide-background.odp
new file mode 100644
index ..ea62bd63903b
Binary files /dev/null and b/svx/qa/unit/data/slide-background.odp differ
diff --git a/svx/qa/unit/data/slide-background.png 
b/svx/qa/unit/data/slide-background.png
new file mode 100644
index ..3a8c5

[Libreoffice-commits] core.git: bin/ui-rules-enforcer.py

2021-08-09 Thread Caolán McNamara (via logerrit)
 bin/ui-rules-enforcer.py |   17 +
 1 file changed, 17 insertions(+)

New commits:
commit 5ba46ce92810f0cf868e50fa4440500c91acbea5
Author: Caolán McNamara 
AuthorDate: Mon Aug 9 12:04:39 2021 +0100
Commit: Caolán McNamara 
CommitDate: Mon Aug 9 15:12:01 2021 +0200

enforce no image-position in GtkCheckButton/GtkRadioButton

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

diff --git a/bin/ui-rules-enforcer.py b/bin/ui-rules-enforcer.py
index 359f9c1231fb..ef73541958c8 100755
--- a/bin/ui-rules-enforcer.py
+++ b/bin/ui-rules-enforcer.py
@@ -208,6 +208,22 @@ def remove_check_button_relief(current):
 if relief != None:
   current.remove(relief)
 
+def remove_check_button_image_position(current):
+  image_position = None
+  ischeckorradiobutton = current.get('class') == "GtkCheckButton" or 
current.get('class') == "GtkRadioButton"
+  for child in current:
+remove_check_button_image_position(child)
+if not ischeckorradiobutton:
+continue
+if child.tag == "property":
+  attributes = child.attrib
+  if attributes.get("name") == "image_position" or attributes.get("name") 
== "image-position":
+image_position = child
+
+  if ischeckorradiobutton:
+if image_position != None:
+  current.remove(image_position)
+
 def remove_spin_button_input_purpose(current):
   input_purpose = None
   isspinbutton = current.get('class') == "GtkSpinButton"
@@ -393,6 +409,7 @@ replace_button_use_stock(root)
 replace_image_stock(root)
 remove_check_button_align(root)
 remove_check_button_relief(root)
+remove_check_button_image_position(root)
 remove_spin_button_input_purpose(root)
 remove_spin_button_max_length(root)
 remove_track_visited_links(root)


[Libreoffice-commits] core.git: extensions/uiconfig sc/uiconfig sd/uiconfig

2021-08-09 Thread Caolán McNamara (via logerrit)
 extensions/uiconfig/spropctrlr/ui/labelselectiondialog.ui |1 -
 sc/uiconfig/scalc/ui/createnamesdialog.ui |1 -
 sd/uiconfig/simpress/ui/optimpressgeneralpage.ui  |1 -
 3 files changed, 3 deletions(-)

New commits:
commit b2130ad3fda841c68a0436fbddf29bcedede0af5
Author: Caolán McNamara 
AuthorDate: Mon Aug 9 12:05:11 2021 +0100
Commit: Caolán McNamara 
CommitDate: Mon Aug 9 14:40:42 2021 +0200

stray unwanted and unneeded image-position properties

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

diff --git a/extensions/uiconfig/spropctrlr/ui/labelselectiondialog.ui 
b/extensions/uiconfig/spropctrlr/ui/labelselectiondialog.ui
index 00c5c8fd160c..cf4073db11a5 100644
--- a/extensions/uiconfig/spropctrlr/ui/labelselectiondialog.ui
+++ b/extensions/uiconfig/spropctrlr/ui/labelselectiondialog.ui
@@ -168,7 +168,6 @@
 True
 False
 True
-right
 True
   
   
diff --git a/sc/uiconfig/scalc/ui/createnamesdialog.ui 
b/sc/uiconfig/scalc/ui/createnamesdialog.ui
index 86e17df692e3..70b7b51c3cde 100644
--- a/sc/uiconfig/scalc/ui/createnamesdialog.ui
+++ b/sc/uiconfig/scalc/ui/createnamesdialog.ui
@@ -137,7 +137,6 @@
 True
 False
 True
-right
 True
 
   
diff --git a/sd/uiconfig/simpress/ui/optimpressgeneralpage.ui 
b/sd/uiconfig/simpress/ui/optimpressgeneralpage.ui
index 51448f5eda2d..6353cb4eba27 100644
--- a/sd/uiconfig/simpress/ui/optimpressgeneralpage.ui
+++ b/sd/uiconfig/simpress/ui/optimpressgeneralpage.ui
@@ -474,7 +474,6 @@
 True
 False
 True
-right
 True
 
   


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

2021-08-09 Thread Caolán McNamara (via logerrit)
 sc/source/ui/sidebar/AlignmentPropertyPanel.cxx |   49 +---
 sc/source/ui/sidebar/AlignmentPropertyPanel.hxx |9 +---
 sc/uiconfig/scalc/ui/sidebaralignment.ui|   12 +
 3 files changed, 26 insertions(+), 44 deletions(-)

New commits:
commit 9834978391309818ffe28eb6efa3f7de04f426c9
Author: Caolán McNamara 
AuthorDate: Mon Aug 9 11:55:26 2021 +0100
Commit: Caolán McNamara 
CommitDate: Mon Aug 9 14:32:33 2021 +0200

change image-using RadioButtons to ToggleButtons instead

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

diff --git a/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx 
b/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx
index eb4dfd98ebd4..51beb4201402 100644
--- a/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx
+++ b/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx
@@ -47,9 +47,9 @@ AlignmentPropertyPanel::AlignmentPropertyPanel(
 , mxCBXMergeCell(m_xBuilder->weld_check_button("mergecells"))
 , mxFtRotate(m_xBuilder->weld_label("orientationlabel"))
 , mxMtrAngle(m_xBuilder->weld_metric_spin_button("orientationdegrees", 
FieldUnit::DEGREE))
-, mxRefEdgeBottom(m_xBuilder->weld_radio_button("bottom"))
-, mxRefEdgeTop(m_xBuilder->weld_radio_button("top"))
-, mxRefEdgeStd(m_xBuilder->weld_radio_button("standard"))
+, mxRefEdgeBottom(m_xBuilder->weld_toggle_button("bottom"))
+, mxRefEdgeTop(m_xBuilder->weld_toggle_button("top"))
+, mxRefEdgeStd(m_xBuilder->weld_toggle_button("standard"))
 , mxCBStacked(m_xBuilder->weld_check_button("stacked"))
 , mxTextOrientBox(m_xBuilder->weld_widget("textorientbox"))
 , mxHorizontalAlign(m_xBuilder->weld_toolbar("horizontalalignment"))
@@ -68,7 +68,6 @@ AlignmentPropertyPanel::AlignmentPropertyPanel(
 , maVrtStackControl(SID_ATTR_ALIGN_STACKED, *pBindings, *this)
 , maRefEdgeControl(SID_ATTR_ALIGN_LOCKPOS, *pBindings, *this)
 , mbMultiDisable(false)
-, mbSettingToggles(false)
 , maContext()
 , mpBindings(pBindings)
 {
@@ -122,25 +121,26 @@ void AlignmentPropertyPanel::Initialize()
 mxMtrAngle->connect_value_changed(LINK( this, AlignmentPropertyPanel, 
AngleModifiedHdl));
 mxCBStacked->connect_toggled(LINK(this, AlignmentPropertyPanel, 
ClickStackHdl));
 
-Link aLink2 = LINK(this, AlignmentPropertyPanel, 
ReferenceEdgeHdl);
-mxRefEdgeBottom->connect_toggled(aLink2);
-mxRefEdgeTop->connect_toggled(aLink2);
-mxRefEdgeStd->connect_toggled(aLink2);
+Link aLink2 = LINK(this, AlignmentPropertyPanel, 
ReferenceEdgeHdl);
+mxRefEdgeBottom->connect_clicked(aLink2);
+mxRefEdgeTop->connect_clicked(aLink2);
+mxRefEdgeStd->connect_clicked(aLink2);
 }
 
-IMPL_LINK(AlignmentPropertyPanel, ReferenceEdgeHdl, weld::Toggleable&, 
rToggle, void)
+IMPL_LINK(AlignmentPropertyPanel, ReferenceEdgeHdl, weld::Button&, rToggle, 
void)
 {
-if (mbSettingToggles)
-return;
 SvxRotateMode eMode;
-if (&rToggle == mxRefEdgeBottom.get() && mxRefEdgeBottom->get_active())
+if (&rToggle == mxRefEdgeBottom.get())
 eMode = SVX_ROTATE_MODE_BOTTOM;
-else if (&rToggle == mxRefEdgeTop.get() && mxRefEdgeTop->get_active())
+else if (&rToggle == mxRefEdgeTop.get())
 eMode = SVX_ROTATE_MODE_TOP;
-else if (&rToggle == mxRefEdgeStd.get() && mxRefEdgeStd->get_active())
+else /*if (&rToggle == mxRefEdgeStd.get())*/
 eMode = SVX_ROTATE_MODE_STANDARD;
-else
-return;
+
+mxRefEdgeBottom->set_active(eMode == SVX_ROTATE_MODE_BOTTOM);
+mxRefEdgeTop->set_active(eMode == SVX_ROTATE_MODE_TOP);
+mxRefEdgeStd->set_active(eMode == SVX_ROTATE_MODE_STANDARD);
+
 SvxRotateModeItem aItem(eMode, ATTR_ROTATE_MODE);
 GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_ALIGN_LOCKPOS,
 SfxCallMode::RECORD, { &aItem });
@@ -312,22 +312,11 @@ void AlignmentPropertyPanel::NotifyItemUpdate(
 case SID_ATTR_ALIGN_LOCKPOS:
 if( eState >= SfxItemState::DEFAULT)
 {
-mbSettingToggles = true;
 const SvxRotateModeItem* pItem = static_cast(pState);
 SvxRotateMode eMode = pItem->GetValue();
-if(eMode == SVX_ROTATE_MODE_BOTTOM)
-{
-mxRefEdgeBottom->set_state(TRISTATE_TRUE);
-}
-else if(eMode == SVX_ROTATE_MODE_TOP)
-{
-mxRefEdgeTop->set_state(TRISTATE_TRUE);
-}
-else if(eMode == SVX_ROTATE_MODE_STANDARD)
-{
-mxRefEdgeStd->set_state(TRISTATE_TRUE);
-}
-mbSettingToggles = false;
+mxRefEdgeBottom->set_active(eMode == SVX_ROTATE_MODE_BOTTOM);
+mxRefEdgeTop->set_active(eMode == SVX_ROTATE_MODE_TOP);
+mxRefEdgeStd->set_active(eMode == SVX_ROTATE_MODE_STANDARD);
 }
 break;
 case SID_ATTR_ALIGN_

[Libreoffice-commits] core.git: Branch 'libreoffice-7-2-0' - config_host.mk.in configure.ac solenv/gbuild

2021-08-09 Thread Thorsten Behrens (via logerrit)
 config_host.mk.in   |1 -
 configure.ac|1 -
 solenv/gbuild/platform/com_MSC_class.mk |4 
 solenv/gbuild/platform/com_MSC_defs.mk  |   12 +++-
 4 files changed, 3 insertions(+), 15 deletions(-)

New commits:
commit 21ebaf567c80207625063ec7eb69d84d2f6c3c23
Author: Thorsten Behrens 
AuthorDate: Tue Aug 3 18:32:16 2021 +0200
Commit: Christian Lohmaier 
CommitDate: Mon Aug 9 13:23:59 2021 +0200

Always provision PATH the cygwin way under Windows

With PATH essentially serving the role of LD_LIBRARY_PATH under
Windows, there was the notion that this needs to be provided in
Windows notation, for win32 gnumake.

That was perhaps once true; currently we're always evaluating PATH
inside a shell, not the Makefile. So this since a while only worked
accidentally, due to cygwin transparently converting between DOS and
UNIX PATH vars. It did break though for corner-cases, e.g.
SRCDIR!=BUILDDIR, and BUILDDIR e.g. D:\FOO.

With that simplification, also GNUMAKE_WIN_NATIVE can go.

Change-Id: Ied5a0443dc70e7dc629c0c0620e6ce911d9a73d0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119941
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 
(cherry picked from commit da36d655608c3da39fd79d95974e1f7404a27aa0)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119976
Reviewed-by: Samuel Mehrbrodt 
(cherry picked from commit 71e7457cddda30a52cbf91d400e682bf11b67fa5)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119981
Reviewed-by: Mike Kaganski 
Reviewed-by: Christian Lohmaier 
Tested-by: Mike Kaganski 

diff --git a/config_host.mk.in b/config_host.mk.in
index f2117f306615..8bce24cb480d 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -243,7 +243,6 @@ export GNUTLS_CFLAGS=$(gb_SPACE)@GNUTLS_CFLAGS@
 export GNUTLS_LIBS=$(gb_SPACE)@GNUTLS_LIBS@
 export PARALLELISM?=@PARALLELISM@
 @x_GNUCP@ export GNUCOPY=@GNUCP@
-export GNUMAKE_WIN_NATIVE=@GNUMAKE_WIN_NATIVE@
 export GNUPATCH=@GNUPATCH@
 export GNUTAR=@GNUTAR@
 export GOBJECT_CFLAGS=$(gb_SPACE)@GOBJECT_CFLAGS@
diff --git a/configure.ac b/configure.ac
index 10b685438d03..59761742e0fa 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6044,7 +6044,6 @@ else
 fi
 rm -rf $TESTGMAKEFILEFUNC
 AC_SUBST(HAVE_GNUMAKE_FILE_FUNC)
-AC_SUBST(GNUMAKE_WIN_NATIVE)
 
 _make_ver_check=`$GNUMAKE --version | grep "Built for Windows"`
 STALE_MAKE=
diff --git a/solenv/gbuild/platform/com_MSC_class.mk 
b/solenv/gbuild/platform/com_MSC_class.mk
index 76dea12e1ec6..0d35b7915999 100644
--- a/solenv/gbuild/platform/com_MSC_class.mk
+++ b/solenv/gbuild/platform/com_MSC_class.mk
@@ -470,11 +470,7 @@ endef
 gb_CppunitTest_UNITTESTFAILED := $(GBUILDDIR)/platform/unittest-failed-WNT.sh
 gb_CppunitTest_PYTHONDEPS := $(call gb_Package_get_target,python3)
 gb_CppunitTest_DEFS := -D_DLL
-ifeq ($(GNUMAKE_WIN_NATIVE),TRUE)
-gb_CppunitTest_CPPTESTPRECOMMAND := $(call gb_Helper_prepend_ld_path,$(shell 
cygpath -w $(gb_Library_DLLDIR));$(shell cygpath -w 
$(WORKDIR)/UnpackedTarball/cppunit/src/cppunit/$(if 
$(MSVC_USE_DEBUG_RUNTIME),DebugDll,ReleaseDll)))
-else
 gb_CppunitTest_CPPTESTPRECOMMAND := $(call gb_Helper_prepend_ld_path,$(shell 
cygpath -u $(gb_Library_DLLDIR)):$(shell cygpath -u 
$(WORKDIR)/UnpackedTarball/cppunit/src/cppunit/$(if 
$(MSVC_USE_DEBUG_RUNTIME),DebugDll,ReleaseDll)))
-endif
 gb_CppunitTest_get_filename = test_$(1).dll
 gb_CppunitTest_get_ilibfilename = itest_$(1).lib
 
diff --git a/solenv/gbuild/platform/com_MSC_defs.mk 
b/solenv/gbuild/platform/com_MSC_defs.mk
index 1fa6d87bdd29..07720dc2e2f1 100644
--- a/solenv/gbuild/platform/com_MSC_defs.mk
+++ b/solenv/gbuild/platform/com_MSC_defs.mk
@@ -297,21 +297,15 @@ endif
 
 # Helper class
 
-ifeq ($(GNUMAKE_WIN_NATIVE),TRUE)
-gb_MAKE_CYGPATH := -w
-else
-gb_MAKE_CYGPATH := -u
-endif
-
-gb_Helper_set_ld_path := PATH="$(shell cygpath $(gb_MAKE_CYGPATH) 
$(INSTDIR_FOR_BUILD)/$(LIBO_URE_LIB_FOLDER));$(shell cygpath $(gb_MAKE_CYGPATH) 
$(INSTDIR_FOR_BUILD)/$(LIBO_BIN_FOLDER));$$PATH"
+gb_Helper_set_ld_path := PATH="$(shell cygpath -u 
$(INSTDIR_FOR_BUILD)/$(LIBO_URE_LIB_FOLDER)):$(shell cygpath -u 
$(INSTDIR_FOR_BUILD)/$(LIBO_BIN_FOLDER)):$$PATH"
 
 define gb_Helper_prepend_ld_path
-PATH="$(shell cygpath $(gb_MAKE_CYGPATH) 
$(INSTDIR_FOR_BUILD)/$(LIBO_URE_LIB_FOLDER));$(shell cygpath $(gb_MAKE_CYGPATH) 
$(INSTDIR_FOR_BUILD)/$(LIBO_BIN_FOLDER));$(1);$$PATH"
+PATH="$(shell cygpath -u $(INSTDIR_FOR_BUILD)/$(LIBO_URE_LIB_FOLDER)):$(shell 
cygpath -u $(INSTDIR_FOR_BUILD)/$(LIBO_BIN_FOLDER)):$(1):$$PATH"
 endef
 
 # $(1): one directory pathname to append to the ld path
 define gb_Helper_extend_ld_path
-$(gb_Helper_set_ld_path)';$(shell cygpath $(gb_MAKE_CYGPATH) $(1))'
+$(gb_Helper_set_ld_path)':$(shell cygpath -u $(1))'
 endef
 
 # common macros to build GPG related libraries


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

2021-08-09 Thread Noel Grandin (via logerrit)
 ucb/source/ucp/file/bc.cxx  |   85 
 ucb/source/ucp/file/bc.hxx  |   10 ++--
 ucb/source/ucp/file/filnot.cxx  |   48 +++---
 ucb/source/ucp/file/filnot.hxx  |   27 ++--
 ucb/source/ucp/file/filtask.cxx |   68 
 ucb/source/ucp/file/filtask.hxx |   24 +--
 6 files changed, 124 insertions(+), 138 deletions(-)

New commits:
commit 2c9ead762dce6f75350f71e6418a81afe0d89092
Author: Noel Grandin 
AuthorDate: Mon Aug 9 09:11:43 2021 +0200
Commit: Noel Grandin 
CommitDate: Mon Aug 9 12:37:55 2021 +0200

can pass PropertyChangeNotifier around by value

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

diff --git a/ucb/source/ucp/file/bc.cxx b/ucb/source/ucp/file/bc.cxx
index b21ba9f40175..7460fbbd23f1 100644
--- a/ucb/source/ucp/file/bc.cxx
+++ b/ucb/source/ucp/file/bc.cxx
@@ -1079,27 +1079,24 @@ void BaseContent::endTask( sal_Int32 CommandId )
 }
 
 
-std::unique_ptr
+std::optional
 BaseContent::cDEL()
 {
 osl::MutexGuard aGuard( m_aMutex );
 
 m_nState |= Deleted;
 
-std::unique_ptr p;
-if( m_pContentEventListeners )
-{
-p.reset( new ContentEventNotifier( m_pMyShell,
-  this,
-  m_xContentIdentifier,
-  m_pContentEventListeners->getElements() 
) );
-}
+if( !m_pContentEventListeners )
+return {};
 
-return p;
+return ContentEventNotifier( m_pMyShell,
+  this,
+  m_xContentIdentifier,
+  m_pContentEventListeners->getElements() );
 }
 
 
-std::unique_ptr
+std::optional
 BaseContent::cEXC( const OUString& aNewName )
 {
 osl::MutexGuard aGuard( m_aMutex );
@@ -1108,72 +1105,60 @@ BaseContent::cEXC( const OUString& aNewName )
 m_aUncPath = aNewName;
 m_xContentIdentifier = new FileContentIdentifier( aNewName );
 
-std::unique_ptr p;
-if( m_pContentEventListeners )
-p.reset( new ContentEventNotifier( m_pMyShell,
-  this,
-  m_xContentIdentifier,
-  xOldRef,
-  m_pContentEventListeners->getElements() 
) );
-
-return p;
+if( !m_pContentEventListeners )
+return {};
+return ContentEventNotifier( m_pMyShell,
+  this,
+  m_xContentIdentifier,
+  xOldRef,
+  m_pContentEventListeners->getElements() );
 }
 
 
-std::unique_ptr
+std::optional
 BaseContent::cCEL()
 {
 osl::MutexGuard aGuard( m_aMutex );
-std::unique_ptr p;
-if( m_pContentEventListeners )
-p.reset( new ContentEventNotifier( m_pMyShell,
+if( !m_pContentEventListeners )
+return {};
+return ContentEventNotifier( m_pMyShell,
   this,
   m_xContentIdentifier,
-  m_pContentEventListeners->getElements() 
) );
-
-return p;
+  m_pContentEventListeners->getElements() 
);
 }
 
-std::unique_ptr
+std::optional
 BaseContent::cPSL()
 {
 osl::MutexGuard aGuard( m_aMutex );
-std::unique_ptr p;
-if( m_pPropertySetInfoChangeListeners  )
-p.reset( new PropertySetInfoChangeNotifier( this,
-   
m_pPropertySetInfoChangeListeners->getElements() ) );
-
-return p;
+if( !m_pPropertySetInfoChangeListeners  )
+return {};
+return PropertySetInfoChangeNotifier( this, 
m_pPropertySetInfoChangeListeners->getElements() );
 }
 
 
-std::unique_ptr
+std::optional
 BaseContent::cPCL()
 {
 osl::MutexGuard aGuard( m_aMutex );
 
 if (!m_pPropertyListener)
-return nullptr;
+return {};
 
 const std::vector< OUString > seqNames = 
m_pPropertyListener->getContainedTypes();
+if( seqNames.empty() )
+return {};
 
-std::unique_ptr p;
-
-if( !seqNames.empty() )
+ListenerMap listener;
+for( const auto& rName : seqNames )
 {
-ListenerMap listener;
-for( const auto& rName : seqNames )
-{
-comphelper::OInterfaceContainerHelper2* pContainer = 
m_pPropertyListener->getContainer(rName);
-if (!pContainer)
-continue;
-listener[rName] = pContainer->getElements();
-}
-
-p.reset( new PropertyChangeNotifier( this, std::move(listener) ) );
+comphelper::OInterfaceContainerHelper2* pContainer = 
m_pPropertyListener->getContainer(rName);
+if (!pContainer)
+continue;
+list

[Libreoffice-commits] core.git: solenv/gbuild

2021-08-09 Thread Caolán McNamara (via logerrit)
 solenv/gbuild/platform/linux.mk |4 
 1 file changed, 4 deletions(-)

New commits:
commit 5470cc97d84a51dd4e541a8647ffe093bc4aa221
Author: Caolán McNamara 
AuthorDate: Sun Aug 8 21:50:37 2021 +0100
Commit: Caolán McNamara 
CommitDate: Mon Aug 9 12:34:50 2021 +0200

remove unneeded -ldl for DISABLE_DYNLOADING

I think we only had -ldl in here for -lpthread which is gone now

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

diff --git a/solenv/gbuild/platform/linux.mk b/solenv/gbuild/platform/linux.mk
index ece7a88bd71f..8fc7d38e3f23 100644
--- a/solenv/gbuild/platform/linux.mk
+++ b/solenv/gbuild/platform/linux.mk
@@ -17,10 +17,6 @@ gb_LinkTarget_LDFLAGS += $(gb__LinkTarget_LDFLAGS_zdefs)
 
 include $(GBUILDDIR)/platform/unxgcc.mk
 
-ifeq ($(DISABLE_DYNLOADING),TRUE)
-gb_STDLIBS := -ldl
-endif
-
 ifneq ($(ATOMIC_LIB),)
 gb_STDLIBS_CXX := $(ATOMIC_LIB)
 endif


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sw/CppunitTest_sw_core_edit.mk sw/Module_sw.mk sw/qa sw/source

2021-08-09 Thread Miklos Vajna (via logerrit)
 sw/CppunitTest_sw_core_edit.mk   |   74 +++
 sw/Module_sw.mk  |1 
 sw/qa/core/edit/data/redline-hidden.fodt |   32 +
 sw/qa/core/edit/edit.cxx |   56 +++
 sw/source/core/edit/edatmisc.cxx |2 
 5 files changed, 164 insertions(+), 1 deletion(-)

New commits:
commit a452e6fc7cd6b44efcbc5ea5343f9bcaa01b584b
Author: Miklos Vajna 
AuthorDate: Thu Aug 5 13:43:50 2021 +0200
Commit: Mike Kaganski 
CommitDate: Mon Aug 9 11:56:23 2021 +0200

sw: fix assert fail with ShowRedlineChanges=false and para format

It fails like this:

loolforkit: sw/source/core/layout/wsfrm.cxx:4551: void 
UnHide(SwRootFrame&): Assertion `rLayout.GetCurrShell()->ActionPend()' failed.
#4  0x7f98e9f8c198 in UnHide(SwRootFrame&) (rLayout=...) at 
sw/source/core/layout/wsfrm.cxx:4551
#5  0x7f98e9f8c839 in SwRootFrame::SetHideRedlines(bool) 
(this=0x7f98c40f7bd0, bHideRedlines=false) at 
sw/source/core/layout/wsfrm.cxx:4664
#6  0x7f98e9b18afd in 
sw::DocumentRedlineManager::SetRedlineFlags(RedlineFlags) (this=0x80a4120, 
eMode=49) at sw/source/core/doc/DocumentRedlineManager.cxx:1097
#7  0x7f98e9cfa503 in SwEditShell::SetAttrSet(SfxItemSet 
const&, SetAttrMode, SwPaM*, bool) (this=0x8885840, rSet=
SfxItemSet of pool 0x808fd10 with parent 0x0 and Which ranges: 
[(63, 64), (120, 120)] = {...}, nFlags=SetAttrMode::DEFAULT, pPaM=0x0, 
bParagraphSetting=true)
at sw/source/core/edit/edatmisc.cxx:187
#8  0x7f98ea995f07 in SwTextShell::ExecParaAttr(SfxRequest&) 
(this=0x8bd0820, rReq=...) at sw/source/uibase/shells/txtattr.cxx:451

Fix it the same way commit dd489bc01adc22fc5015ea56b61d66104af184a8
(tdf#125754 sw_redlinehide: avoid recursive layout in SetHideRedlines(),
2019-06-19) did: make sure that SetHideRedlines() is called before
EndAllAction().

(cherry picked from commit 39392ee94c78692a9179f7face15af0c9e74e492)

Conflicts:
sw/Module_sw.mk

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

diff --git a/sw/CppunitTest_sw_core_edit.mk b/sw/CppunitTest_sw_core_edit.mk
new file mode 100644
index ..2c04606a75f9
--- /dev/null
+++ b/sw/CppunitTest_sw_core_edit.mk
@@ -0,0 +1,74 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#*
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+#*
+
+$(eval $(call gb_CppunitTest_CppunitTest,sw_core_edit))
+
+$(eval $(call gb_CppunitTest_use_common_precompiled_header,sw_core_edit))
+
+$(eval $(call gb_CppunitTest_add_exception_objects,sw_core_edit, \
+sw/qa/core/edit/edit \
+))
+
+$(eval $(call gb_CppunitTest_use_libraries,sw_core_edit, \
+editeng \
+comphelper \
+cppu \
+cppuhelper \
+sal \
+sfx \
+svxcore \
+sw \
+test \
+unotest \
+utl \
+vcl \
+svt \
+tl \
+svl \
+))
+
+$(eval $(call gb_CppunitTest_use_externals,sw_core_edit,\
+boost_headers \
+libxml2 \
+))
+
+$(eval $(call gb_CppunitTest_set_include,sw_core_edit,\
+-I$(SRCDIR)/sw/inc \
+-I$(SRCDIR)/sw/source/core/inc \
+-I$(SRCDIR)/sw/source/uibase/inc \
+-I$(SRCDIR)/sw/qa/inc \
+$$(INCLUDE) \
+))
+
+$(eval $(call gb_CppunitTest_use_api,sw_core_edit,\
+   udkapi \
+   offapi \
+   oovbaapi \
+))
+
+$(eval $(call gb_CppunitTest_use_ure,sw_core_edit))
+$(eval $(call gb_CppunitTest_use_vcl,sw_core_edit))
+
+$(eval $(call gb_CppunitTest_use_rdb,sw_core_edit,services))
+
+$(eval $(call gb_CppunitTest_use_custom_headers,sw_core_edit,\
+officecfg/registry \
+))
+
+$(eval $(call gb_CppunitTest_use_configuration,sw_core_edit))
+
+$(eval $(call gb_CppunitTest_use_uiconfigs,sw_core_edit, \
+modules/swriter \
+))
+
+$(eval $(call gb_CppunitTest_use_more_fonts,sw_core_edit))
+
+# vim: set noet sw=4 ts=4:
diff --git a/sw/Module_sw.mk b/sw/Module_sw.mk
index e6fb99d5f88c..6cb964c3848c 100644
--- a/sw/Module_sw.mk
+++ b/sw/Module_sw.mk
@@ -117,6 +117,7 @@ $(eval $(call gb_Module_add_slowcheck_targets,sw,\
 CppunitTest_sw_core_unocore \
 CppunitTest_sw_core_crsr \
 CppunitTest_sw_uibase_uno \
+CppunitTest_sw_core_edit \
 ))
 
 ifneq ($(DISABLE_GUI),TRUE)
diff --git a/sw/qa/core/edit/data/redline-hidden.fodt 
b/sw/qa/core/edit/data/redline-hidden.fodt
new file mode 100644
index ..10355e3ac485
--- /dev/nu

[Libreoffice-commits] core.git: external/harfbuzz

2021-08-09 Thread Stephan Bergmann (via logerrit)
 external/harfbuzz/UnpackedTarball_harfbuzz.mk |4 
 external/harfbuzz/negativeadvance.patch   |   11 +++
 2 files changed, 15 insertions(+)

New commits:
commit 6e53e03f752c2f85283c4d47efaaf0683299783c
Author: Stephan Bergmann 
AuthorDate: Mon Aug 9 08:11:40 2021 +0200
Commit: Stephan Bergmann 
CommitDate: Mon Aug 9 11:39:05 2021 +0200

external/harfbuzz: hb_graphite2_cluster_t::advance can apparently be 
negative

...as seen with `instdir/program/soffice --headless --convert-to pdf` of
doc/abi6073-2.doc from the crash-testing corpus when run under UBSan,

> hb-graphite2.cc:361:15: runtime error: -1024 is outside the range of 
representable values of type 'unsigned int'
>  #0 in _hb_graphite2_shape at 
workdir/UnpackedTarball/harfbuzz/src/hb-graphite2.cc:361:15
>  #1 in _hb_shape_plan_execute_internal(hb_shape_plan_t*, hb_font_t*, 
hb_buffer_t*, hb_feature_t const*, unsigned int) at 
workdir/UnpackedTarball/harfbuzz/src/./hb-shaper-list.hh:38:1
>  #2 in hb_shape_plan_execute at 
workdir/UnpackedTarball/harfbuzz/src/hb-shape-plan.cc:453:14
>  #3 in hb_shape_full at 
workdir/UnpackedTarball/harfbuzz/src/hb-shape.cc:139:19
>  #4 in GenericSalLayout::LayoutText(ImplLayoutArgs&, SalLayoutGlyphsImpl 
const*) at vcl/source/gdi/CommonSalLayout.cxx:495:23
>  #5 in OutputDevice::getFallbackLayout(LogicalFontInstance*, int, 
ImplLayoutArgs&, SalLayoutGlyphs const*) const at 
vcl/source/outdev/font.cxx:1232:21
>  #6 in OutputDevice::ImplGlyphFallbackLayout(std::unique_ptr >, ImplLayoutArgs&, SalLayoutGlyphs const*) 
const at vcl/source/outdev/font.cxx:1300:48
>  #7 in OutputDevice::ImplLayout(rtl::OUString const&, int, int, Point 
const&, long, long const*, SalLayoutFlags, vcl::TextLayoutCache const*, 
SalLayoutGlyphs const*) const at vcl/source/outdev/text.cxx:1332:22
>  #8 in lcl_CreateLayout(SwTextGlyphsKey const&, 
__gnu_debug::_Safe_iterator >, std::__debug::map, 
std::allocator > >, 
std::bidirectional_iterator_tag>) at sw/source/core/txtnode/fntcache.cxx:233:33
>  #9 in SwFntObj::GetCachedSalLayoutGlyphs(SwTextGlyphsKey const&) at 
sw/source/core/txtnode/fntcache.cxx:257:12
>  #10 in SwFont::GetTextBreak(SwDrawTextInfo const&, long) at 
sw/source/core/txtnode/fntcache.cxx:2551:58
>  #11 in SwTextSizeInfo::GetTextBreak(long, o3tl::strong_int, unsigned short, vcl::TextLayoutCache const*) const at 
sw/source/core/text/inftxt.cxx:450:20
>  #12 in SwTextGuess::Guess(SwTextPortion const&, SwTextFormatInfo&, 
unsigned short) at sw/source/core/text/guess.cxx:205:26
>  #13 in SwTextPortion::Format_(SwTextFormatInfo&) at 
sw/source/core/text/portxt.cxx:305:32
>  #14 in SwTextPortion::Format(SwTextFormatInfo&) at 
sw/source/core/text/portxt.cxx:456:12
>  #15 in SwLineLayout::Format(SwTextFormatInfo&) at 
sw/source/core/text/porlay.cxx:260:31

(where in frame #4 GenericSalLayout::LayoutText, pHbBuffer->props.direction 
is
HB_DIRECTION_RTL, in case that is relevant).

It is unclear to me whether it is sufficient to only change
hb_graphite2_cluster_t::advance from signed to unsigned int, as there are 
other
unsigned int variables (like curradv in _hb_graphite2_shape) whose value 
depend
on hb_graphite2_cluster_t::advance, and which thus might also become 
negative.
But unlike the float -> unsigned int conversion that UBSan warned about here
(where gr_slot_origin_X() and xscale are float), those are signed int ->
unsigned int conversions that do not cause undefined behavior.  At least, 
with
this change, the above --convert-to pdf and a full `make check screenshot`
succeeded for me under without further UBSan warnings.

Change-Id: Ifa6fa930da162b986d3f536f8b3613790b3f19c8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120192
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/external/harfbuzz/UnpackedTarball_harfbuzz.mk 
b/external/harfbuzz/UnpackedTarball_harfbuzz.mk
index a99f116d80ad..13400700606a 100644
--- a/external/harfbuzz/UnpackedTarball_harfbuzz.mk
+++ b/external/harfbuzz/UnpackedTarball_harfbuzz.mk
@@ -15,4 +15,8 @@ $(eval $(call 
gb_UnpackedTarball_update_autoconf_configs,harfbuzz))
 
 $(eval $(call gb_UnpackedTarball_set_patchlevel,harfbuzz,0))
 
+$(eval $(call gb_UnpackedTarball_add_patches,harfbuzz, \
+external/harfbuzz/negativeadvance.patch \
+))
+
 # vim: set noet sw=4 ts=4:
diff --git a/external/harfbuzz/negativeadvance.patch 
b/external/harfbuzz/negativeadvance.patch
new file mode 100644
index ..ab19aa2631e0
--- /dev/null
+++ b/external/harfbuzz/negativeadvance.patch
@@ -0,0 +1,11 @@
+--- src/hb-graphite2.cc
 src/hb-graphite2.cc
+@@ -223,7 +223,7 @@
+   unsigned int base_glyph;
+   unsigned int num_glyphs;
+   unsigned int cluster;
+-  unsigned int advance;
++  int advance;
+ };
+ 
+ hb_bool_t


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

2021-08-09 Thread Caolán McNamara (via logerrit)
 sfx2/source/doc/templatedlg.cxx |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit c97bdca2d7abf30a99c45192b8f49c5bf76ca035
Author: Caolán McNamara 
AuthorDate: Sun Aug 8 20:29:59 2021 +0100
Commit: Caolán McNamara 
CommitDate: Mon Aug 9 10:15:17 2021 +0200

gtk4: g_menu_item_set_detailed_action aborts with ids with spaces in them

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

diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index 5f5760ca6f43..9bc816dc0eba 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -64,11 +64,11 @@ constexpr OUStringLiteral TM_SETTING_VIEWMODE = u"ViewMode";
 #define MNI_ACTION_DELETE_FOLDER "delete"
 #define MNI_ACTION_REFRESH   "refresh"
 #define MNI_ACTION_DEFAULT   "default"
-#define MNI_ACTION_DEFAULT_WRITER   "default writer"
-#define MNI_ACTION_DEFAULT_CALC   "default calc"
-#define MNI_ACTION_DEFAULT_IMPRESS   "default impress"
-#define MNI_ACTION_DEFAULT_DRAW   "default draw"
-#define MNI_ACTION_IMPORT   "import template"
+#define MNI_ACTION_DEFAULT_WRITER   "default_writer"
+#define MNI_ACTION_DEFAULT_CALC   "default_calc"
+#define MNI_ACTION_DEFAULT_IMPRESS   "default_impress"
+#define MNI_ACTION_DEFAULT_DRAW   "default_draw"
+#define MNI_ACTION_IMPORT   "import_template"
 #define MNI_ACTION_EXTENSIONS   "extensions"
 #define MNI_ALL_APPLICATIONS 0
 #define MNI_WRITER   1


[Libreoffice-commits] core.git: Branch 'libreoffice-7-2-0' - instsetoo_native/inc_openoffice

2021-08-09 Thread Roman Kuznetsov (via logerrit)
 instsetoo_native/inc_openoffice/windows/msi_templates/RadioBut.idt |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 07f3b01f84e2540a7e40244b8efff969d9f6107c
Author: Roman Kuznetsov 
AuthorDate: Tue Aug 3 19:29:01 2021 +0200
Commit: Xisco Fauli 
CommitDate: Mon Aug 9 09:41:49 2021 +0200

tdf#143686 Increase a width of the label

Change-Id: I71d7994ad7ed4506c1514cf417a535caff20b05f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119869
Tested-by: Jenkins
Reviewed-by: Roman Kuznetsov 
(cherry picked from commit af0437d7b1d9cc5a00b7d01a6510e5ba40ca1a12)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119985
Reviewed-by: Eike Rathke 
(cherry picked from commit df389c813637f7681fccf025a624554b3627468e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119986
Reviewed-by: Adolfo Jayme Barrientos 
Reviewed-by: Xisco Fauli 
Tested-by: Xisco Fauli 

diff --git a/instsetoo_native/inc_openoffice/windows/msi_templates/RadioBut.idt 
b/instsetoo_native/inc_openoffice/windows/msi_templates/RadioBut.idt
index 680c97605409..9061f160e1cd 100644
--- a/instsetoo_native/inc_openoffice/windows/msi_templates/RadioBut.idt
+++ b/instsetoo_native/inc_openoffice/windows/msi_templates/RadioBut.idt
@@ -10,5 +10,5 @@ AgreeToLicense1   No  0   15  295 
15  OOO_RADIOBUTTON_6
 AgreeToLicense 2   Yes 0   0   295 15  
OOO_RADIOBUTTON_7   
 ApplicationUsers   1   AllUsers1   7   290 14  
OOO_RADIOBUTTON_8   
 ApplicationUsers   2   OnlyCurrentUser 1   23  290 14  
OOO_RADIOBUTTON_9   
-MsiUIRMOption  1   UseRM   0   0   420 16  
OOO_RADIOBUTTON_10  
-MsiUIRMOption  2   DontUseRM   0   20  420 16  
OOO_RADIOBUTTON_11  
+MsiUIRMOption  1   UseRM   0   0   460 16  
OOO_RADIOBUTTON_10  
+MsiUIRMOption  2   DontUseRM   0   20  460 16  
OOO_RADIOBUTTON_11  


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

2021-08-09 Thread Caolán McNamara (via logerrit)
 dbaccess/source/ui/control/sqledit.cxx |   12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 508d9f5d9c33855735820ce272c6eee9f8dda09e
Author: Caolán McNamara 
AuthorDate: Tue Aug 3 12:28:23 2021 +0100
Commit: Xisco Fauli 
CommitDate: Mon Aug 9 09:40:40 2021 +0200

tdf#143657 'execute' button doesn't get enabled when contents changed

since...

commit 73c9ef661d9ef6237d3fd3c259fd040a545b44cf
Date:   Tue Jul 6 18:51:38 2021 +0200

tdf#132740 don't broadcast if modified status has not changed

now we only get a notification on transition from unmodified to
modified. So continue to launch a timer on transition but clear
modification on firing so we will get notified on the next change
and move the modify callback to the timer.

modifications are no deferred until the timer fires, so reduce
the timer to make it smoother

Change-Id: I27980be54de20bb516b1f106c3ed1b303e2a4014
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119864
Reviewed-by: Julien Nabet 
Reviewed-by: Adolfo Jayme Barrientos 
Reviewed-by: Xisco Fauli 
Tested-by: Xisco Fauli 

diff --git a/dbaccess/source/ui/control/sqledit.cxx 
b/dbaccess/source/ui/control/sqledit.cxx
index c53f684dab4a..18eac53dee60 100644
--- a/dbaccess/source/ui/control/sqledit.cxx
+++ b/dbaccess/source/ui/control/sqledit.cxx
@@ -126,7 +126,7 @@ void SQLEditView::SetDrawingArea(weld::DrawingArea* 
pDrawingArea)
 
rEditEngine.SetDefaultHorizontalTextDirection(EEHorizontalTextDirection::L2R);
 rEditEngine.SetModifyHdl(LINK(this, SQLEditView, ModifyHdl));
 
-m_aUpdateDataTimer.SetTimeout(300);
+m_aUpdateDataTimer.SetTimeout(150);
 m_aUpdateDataTimer.SetInvokeHandler(LINK(this, SQLEditView, 
ImplUpdateDataHdl));
 
 ImplSetFont();
@@ -170,8 +170,6 @@ IMPL_LINK_NOARG(SQLEditView, ModifyHdl, LinkParamNone*, 
void)
 {
 if (m_bInUpdate)
 return;
-
-m_aModifyLink.Call(nullptr);
 m_aUpdateDataTimer.Start();
 }
 
@@ -194,7 +192,6 @@ void SQLEditView::UpdateData()
 rEditEngine.EnableUndo(false);
 
 // syntax highlighting
-bool bOrigModified = rEditEngine.IsModified();
 for (sal_Int32 nLine=0; nLine < rEditEngine.GetParagraphCount(); ++nLine)
 {
 OUString aLine( rEditEngine.GetText( nLine ) );
@@ -214,12 +211,15 @@ void SQLEditView::UpdateData()
 rEditEngine.QuickSetAttribs(aSet, ESelection(nLine, 
portion.nBegin, nLine, portion.nEnd));
 }
 }
-if (!bOrigModified)
-rEditEngine.ClearModifyFlag();
+
+rEditEngine.ClearModifyFlag();
+
 m_bInUpdate = false;
 
 rEditEngine.EnableUndo(bUndoEnabled);
 
+m_aModifyLink.Call(nullptr);
+
 Invalidate();
 }
 


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

2021-08-09 Thread dante (via logerrit)
 starmath/inc/mathml/def.hxx  |   16 +---
 starmath/source/mathml/attribute.cxx |2 --
 2 files changed, 5 insertions(+), 13 deletions(-)

New commits:
commit 6daf48b50e1ff3bdd6a9f948c3e267e76b8a89d3
Author: dante 
AuthorDate: Sun Aug 8 22:48:50 2021 +0200
Commit: Noel Grandin 
CommitDate: Mon Aug 9 09:28:47 2021 +0200

Corrections to starmath mathml definitions

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

diff --git a/starmath/inc/mathml/def.hxx b/starmath/inc/mathml/def.hxx
index 2db1612b4f0d..52cf70206b2f 100644
--- a/starmath/inc/mathml/def.hxx
+++ b/starmath/inc/mathml/def.hxx
@@ -30,10 +30,11 @@ enum class SmLengthUnit : uint_fast8_t
 MlPx,
 MlIn,
 MlCm,
-MlMM,
+MlMm,
 MlPt,
 MlPc,
-MlP // Percent
+MlP, // Percent
+MlM // Multiplier
 };
 
 struct SmLengthValue
@@ -125,7 +126,7 @@ enum class SmMlAttributeValueFence : uint_fast8_t
 enum class SmMlAttributeValueHref : uint_fast8_t
 {
 NMlEmpty = 0x00,
-NMlValie = 0x01
+NMlValid = 0x01
 };
 
 enum class SmMlAttributeValueLspace : uint_fast8_t
@@ -164,7 +165,7 @@ enum class SmMlAttributeValueMathvariant : uint_fast16_t
 bold_fraktur = 0x001 | 0x010,
 bold_script = 0x001 | 0x008,
 bold_sans_serif = 0x001 | 0x020,
-sans_serif_italic = 0x001 | 0x002 | 0x20,
+sans_serif_italic = 0x002 | 0x20,
 sans_serif_bold_italic = 0x001 | 0x002 | 0x020,
 // Non english
 initial = 0x080,
@@ -179,12 +180,6 @@ enum class SmMlAttributeValueMaxsize : uint_fast8_t
 MlFinite = 0x01
 };
 
-enum class SmMlAttributeValueMinsize : uint_fast8_t
-{
-MlInfinity = 0x00,
-MlFinite = 0x01
-};
-
 /*
  * Specifies whether attached under- and overscripts move to sub- and 
superscript positions when displaystyle is false.
  * Source: https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mo
@@ -282,7 +277,6 @@ struct SmMlMaxsize
 
 struct SmMlMinsize
 {
-SmMlAttributeValueMinsize m_aMinsize;
 SmLengthValue m_aLengthValue;
 };
 
diff --git a/starmath/source/mathml/attribute.cxx 
b/starmath/source/mathml/attribute.cxx
index 754f3604a7a3..da7668417327 100644
--- a/starmath/source/mathml/attribute.cxx
+++ b/starmath/source/mathml/attribute.cxx
@@ -94,7 +94,6 @@ void SmMlAttribute::setDefaultAttributeValue()
 m_aAttributeValue.m_aMaxsize.m_aLengthValue.m_aOriginalText = new 
OUString(u"1%");
 break;
 case SmMlAttributeValueType::MlMinsize:
-m_aAttributeValue.m_aMinsize.m_aMinsize = 
SmMlAttributeValueMinsize::MlInfinity;
 m_aAttributeValue.m_aMinsize.m_aLengthValue.m_aLengthUnit = 
SmLengthUnit::MlP;
 m_aAttributeValue.m_aMinsize.m_aLengthValue.m_aLengthValue = 1;
 m_aAttributeValue.m_aMinsize.m_aLengthValue.m_aOriginalText = new 
OUString(u"1%");
@@ -393,7 +392,6 @@ void SmMlAttribute::setMlMaxsize(const SmMlMaxsize* 
aMaxsize)
 void SmMlAttribute::setMlMinsize(const SmMlMinsize* aMinsize)
 {
 clearPreviousAttributeValue();
-m_aAttributeValue.m_aMinsize.m_aMinsize = aMinsize->m_aMinsize;
 m_aAttributeValue.m_aMinsize.m_aLengthValue.m_aLengthUnit
 = aMinsize->m_aLengthValue.m_aLengthUnit;
 m_aAttributeValue.m_aMinsize.m_aLengthValue.m_aLengthValue