[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - sw/qa writerfilter/source

2022-09-22 Thread Miklos Vajna (via logerrit)
 sw/qa/extras/ooxmlexport/data/content-control-grab-bag.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx   |   12 
 writerfilter/source/dmapper/DomainMapper.cxx|3 ++-
 3 files changed, 14 insertions(+), 1 deletion(-)

New commits:
commit 5e73cdf0dd64c1d627377354575c86be90d910fb
Author: Miklos Vajna 
AuthorDate: Tue Aug 16 11:37:27 2022 +0200
Commit: Miklos Vajna 
CommitDate: Fri Sep 23 08:54:19 2022 +0200

crashtesting: fix DOCX export of forum-mso-de-99522.docx

Export of this document to DOCX wrote not-well-formed XML output,
resulting in an assertion failure in debug builds.

writerfilter/ maps a selection of  tags to Writer content
controls (a safe subset), and leaves the rest unchanged, which means we
continue to map those to grab-bags. The trouble is that a combination of
content controls and grab-bags leads to bad output on export, as we
start the  element twice, but only close it once.

Fix the problem by extending writerfilter/ code to not do any grab-bags
for the richText type, we already did that in the past for dropDowns.

In the long run, we should never do grab-bagging for any 
elements that we map to Writer content controls.

(cherry picked from commit 7ad44f3dd271a591529b048212c4391d8b38ed9d)

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

diff --git a/sw/qa/extras/ooxmlexport/data/content-control-grab-bag.docx 
b/sw/qa/extras/ooxmlexport/data/content-control-grab-bag.docx
new file mode 100644
index ..33c01f08fd25
Binary files /dev/null and 
b/sw/qa/extras/ooxmlexport/data/content-control-grab-bag.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
index 9cf424f8aa07..3747aa399a27 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
@@ -818,6 +818,18 @@ DECLARE_OOXMLEXPORT_TEST( testSdtDatePicker, 
"test_sdt_datepicker.docx" )
 CPPUNIT_ASSERT_EQUAL(OUString("008000"), sColor);
 }
 
+CPPUNIT_TEST_FIXTURE(Test, testContentControlGrabBag)
+{
+// Given a document with a  tag:
+OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + 
"content-control-grab-bag.docx";
+loadURL(aURL, nullptr);
+
+// When exporting that document back to DOCX:
+// Then make sure that completes without an assertion failure, which would 
mean not-well-formed
+// output was produced:
+save("Office Open XML Text", maTempFile);
+}
+
 CPPUNIT_TEST_FIXTURE(Test, testTdf104823)
 {
 // Test how we can roundtrip sdt plain text with databindings support
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx 
b/writerfilter/source/dmapper/DomainMapper.cxx
index 26f564acbe4c..e79a46784dab 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -3792,7 +3792,8 @@ void DomainMapper::lcl_utext(const sal_uInt8 * data_, 
size_t len)
 else
 {
 uno::Sequence aGrabBag = 
m_pImpl->m_pSdtHelper->getInteropGrabBagAndClear();
-if (m_pImpl->GetSdtStarts().empty() || 
m_pImpl->m_pSdtHelper->getControlType() != SdtControlType::dropDown)
+if (m_pImpl->GetSdtStarts().empty()
+|| (m_pImpl->m_pSdtHelper->getControlType() != 
SdtControlType::dropDown && m_pImpl->m_pSdtHelper->getControlType() != 
SdtControlType::richText))
 {
 
m_pImpl->GetTopContextOfType(CONTEXT_PARAGRAPH)->Insert(PROP_SDTPR,
 uno::makeAny(aGrabBag), true, PARA_GRAB_BAG);


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - schema/libreoffice xmloff/qa xmloff/source

2022-09-22 Thread Miklos Vajna (via logerrit)
 schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng |6 +
 xmloff/qa/unit/data/content-control-combo-box.fodt  |8 +
 xmloff/qa/unit/text.cxx |   66 
 xmloff/source/text/txtparae.cxx |9 +
 xmloff/source/text/xmlcontentcontrolcontext.cxx |   13 ++
 xmloff/source/text/xmlcontentcontrolcontext.hxx |1 
 6 files changed, 103 insertions(+)

New commits:
commit ae40ecb0a78c8a77afce27cd2036ef780acc6e58
Author: Miklos Vajna 
AuthorDate: Thu Sep 22 08:36:51 2022 +0200
Commit: Miklos Vajna 
CommitDate: Fri Sep 23 08:53:50 2022 +0200

sw content controls, combo box: add ODT filter

Map the ComboBox UNO property to:



on export, and do the opposite on import.

(cherry picked from commit 21d93d8d2ffd9c5d5cfe9064590b35e0727295c9)

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

diff --git a/schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng 
b/schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng
index ec496da3e194..039750e5d5a8 100644
--- a/schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng
+++ b/schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng
@@ -2922,6 +2922,12 @@ 
xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.
   
 
   
+  
+
+
+  
+
+  
   
 
   
diff --git a/xmloff/qa/unit/data/content-control-combo-box.fodt 
b/xmloff/qa/unit/data/content-control-combo-box.fodt
new file mode 100644
index ..03f6911fb7dd
--- /dev/null
+++ b/xmloff/qa/unit/data/content-control-combo-box.fodt
@@ -0,0 +1,8 @@
+
+
+  
+
+  choose a 
color
+
+  
+
diff --git a/xmloff/qa/unit/text.cxx b/xmloff/qa/unit/text.cxx
index 94d7da5e30a9..388106702217 100644
--- a/xmloff/qa/unit/text.cxx
+++ b/xmloff/qa/unit/text.cxx
@@ -795,6 +795,72 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, 
testPlainTextContentControlImport)
 CPPUNIT_ASSERT(bPlainText);
 }
 
+CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testComboBoxContentControlExport)
+{
+// Given a document with a combo box content control around a text portion:
+getComponent() = loadFromDesktop("private:factory/swriter");
+uno::Reference xMSF(getComponent(), 
uno::UNO_QUERY);
+uno::Reference xTextDocument(getComponent(), 
uno::UNO_QUERY);
+uno::Reference xText = xTextDocument->getText();
+uno::Reference xCursor = xText->createTextCursor();
+xText->insertString(xCursor, "test", /*bAbsorb=*/false);
+xCursor->gotoStart(/*bExpand=*/false);
+xCursor->gotoEnd(/*bExpand=*/true);
+uno::Reference xContentControl(
+xMSF->createInstance("com.sun.star.text.ContentControl"), 
uno::UNO_QUERY);
+uno::Reference xContentControlProps(xContentControl, 
uno::UNO_QUERY);
+xContentControlProps->setPropertyValue("ComboBox", uno::Any(true));
+xText->insertTextContent(xCursor, xContentControl, /*bAbsorb=*/true);
+
+// When exporting to ODT:
+uno::Reference xStorable(getComponent(), uno::UNO_QUERY);
+uno::Sequence aStoreProps = 
comphelper::InitPropertySequence({
+{ "FilterName", uno::Any(OUString("writer8")) },
+});
+utl::TempFile aTempFile;
+aTempFile.EnableKillingFile();
+xStorable->storeToURL(aTempFile.GetURL(), aStoreProps);
+validate(aTempFile.GetFileName(), test::ODF);
+
+// Then make sure the expected markup is used:
+std::unique_ptr pStream = parseExportStream(aTempFile, 
"content.xml");
+xmlDocUniquePtr pXmlDoc = parseXmlStream(pStream.get());
+// Without the accompanying fix in place, this test would have failed with:
+// - XPath '//loext:content-control' no attribute 'combobox' exist
+// i.e. the combo box content control was turned into a drop-down one on 
export.
+assertXPath(pXmlDoc, "//loext:content-control", "combobox", "true");
+}
+
+CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testComboBoxContentControlImport)
+{
+// Given an ODF document with a plain-text content control:
+OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + 
"content-control-combo-box.fodt";
+
+// When loading that document:
+getComponent() = loadFromDesktop(aURL);
+
+// Then make sure that the content control is not lost on import:
+uno::Reference xTextDocument(getComponent(), 
uno::UNO_QUERY);
+uno::Reference 
xParagraphsAccess(xTextDocument->getText(),
+
uno::UNO_QUERY);
+uno::Reference xParagraphs = 
xParagraphsAccess->createEnumeration();
+uno::Reference 
xParagraph(xParagraphs->nextElement(),
+ uno::UNO_QUERY);
+uno::Reference xPortions = 
xParagraph->cre

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

2022-09-22 Thread Miklos Vajna (via logerrit)
 sw/qa/extras/ww8export/ww8export.cxx |   18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

New commits:
commit c097ff3fb2c6a58b0217213d12e69ea7833bf06f
Author: Miklos Vajna 
AuthorDate: Thu Sep 22 20:20:15 2022 +0200
Commit: Miklos Vajna 
CommitDate: Fri Sep 23 08:49:48 2022 +0200

CppunitTest_sw_ww8export: use more SwParaPortion::dumpAsXml()

See commit feeed3e762cf077fbd9cf48f82e949365108ccc1
(CppunitTest_sw_layoutwriter: avoid some a11y-based layout testing,
2022-04-07) for motivation.

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

diff --git a/sw/qa/extras/ww8export/ww8export.cxx 
b/sw/qa/extras/ww8export/ww8export.cxx
index a92d4899194b..2ccd11c4cd65 100644
--- a/sw/qa/extras/ww8export/ww8export.cxx
+++ b/sw/qa/extras/ww8export/ww8export.cxx
@@ -253,10 +253,10 @@ DECLARE_WW8EXPORT_TEST(testTdf75539_relativeWidth, 
"tdf75539_relativeWidth.doc")
 //divide everything by 10 to give a margin of error for rounding etc.
 sal_Int32 pageWidth = parseDump("/root/page[1]/body/infos/bounds", 
"width").toInt32()/10;
 CPPUNIT_ASSERT_EQUAL_MESSAGE("Page width", sal_Int32(9354/10), pageWidth);
-CPPUNIT_ASSERT_EQUAL_MESSAGE("100% width line", pageWidth,   
parseDump("/root/page[1]/body/txt[2]/Special", "nWidth").toInt32()/10);
-CPPUNIT_ASSERT_EQUAL_MESSAGE("50% width line", pageWidth/2,  
parseDump("/root/page[1]/body/txt[4]/Special", "nWidth").toInt32()/10);
-CPPUNIT_ASSERT_EQUAL_MESSAGE("25% width line", pageWidth/4,  
parseDump("/root/page[1]/body/txt[6]/Special", "nWidth").toInt32()/10);
-CPPUNIT_ASSERT_EQUAL_MESSAGE("10% width line", pageWidth/10, 
parseDump("/root/page[1]/body/txt[8]/Special", "nWidth").toInt32()/10);
+CPPUNIT_ASSERT_EQUAL_MESSAGE("100% width line", pageWidth,   
parseDump("/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion", 
"width").toInt32()/10);
+CPPUNIT_ASSERT_EQUAL_MESSAGE("50% width line", pageWidth/2,  
parseDump("/root/page[1]/body/txt[4]/SwParaPortion/SwLineLayout/SwLinePortion", 
"width").toInt32()/10);
+CPPUNIT_ASSERT_EQUAL_MESSAGE("25% width line", pageWidth/4,  
parseDump("/root/page[1]/body/txt[6]/SwParaPortion/SwLineLayout/SwLinePortion", 
"width").toInt32()/10);
+CPPUNIT_ASSERT_EQUAL_MESSAGE("10% width line", pageWidth/10, 
parseDump("/root/page[1]/body/txt[8]/SwParaPortion/SwLineLayout/SwLinePortion", 
"width").toInt32()/10);
 }
 
 DECLARE_WW8EXPORT_TEST(testN757905, "n757905.doc")
@@ -315,7 +315,7 @@ DECLARE_WW8EXPORT_TEST(testN823651, "n823651.doc")
 
 DECLARE_WW8EXPORT_TEST(testFdo36868, "fdo36868.doc")
 {
-OUString aText = 
parseDump("/root/page/body/txt[3]/Special[@nType='PortionType::Number']", 
"rText");
+OUString aText = 
parseDump("/root/page/body/txt[3]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Number']",
 "expand");
 // This was 1.1.
 CPPUNIT_ASSERT_EQUAL(OUString("2.1"), aText);
 }
@@ -323,7 +323,7 @@ DECLARE_WW8EXPORT_TEST(testFdo36868, "fdo36868.doc")
 DECLARE_WW8EXPORT_TEST(testListNolevel, "list-nolevel.doc")
 {
 // Similar to fdo#36868, numbering portions had wrong values.
-OUString aText = 
parseDump("/root/page/body/txt[1]/Special[@nType='PortionType::Number']", 
"rText");
+OUString aText = 
parseDump("/root/page/body/txt[1]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Number']",
 "expand");
 // PortionType::Number was completely missing.
 CPPUNIT_ASSERT_EQUAL(OUString("1."), aText);
 }
@@ -612,10 +612,10 @@ DECLARE_WW8EXPORT_TEST(testLayoutHanging, "fdo68967.doc")
 DECLARE_WW8EXPORT_TEST(testfdo68963, "fdo68963.doc")
 {
 // The problem was that the text was not displayed.
-CPPUNIT_ASSERT ( 
!parseDump("/root/page/body/tab/row[2]/cell[1]/txt/Special", "rText").isEmpty() 
);
-CPPUNIT_ASSERT_EQUAL( OUString("Topic 1"), 
parseDump("/root/page/body/tab/row[2]/cell[1]/txt/Special", "rText") );
+CPPUNIT_ASSERT ( 
!parseDump("/root/page/body/tab/row[2]/cell[1]/txt/SwParaPortion/SwLineLayout/SwFieldPortion",
 "expand").isEmpty() );
+CPPUNIT_ASSERT_EQUAL( OUString("Topic 1"), 
parseDump("/root/page/body/tab/row[2]/cell[1]/txt/SwParaPortion/SwLineLayout/SwFieldPortion",
 "expand") );
 // all crossreference bookmarks should have a target.  Shouldn't be any 
"Reference source not found" in the xml
-CPPUNIT_ASSERT_EQUAL(static_cast(-1), 
parseDump("/root/page/body/txt[24]/Special[2]","rText").indexOf("Reference 
source not found"));
+CPPUNIT_ASSERT_EQUAL(static_cast(-1), 
parseDump("/root/page/body/txt[24]/SwParaPortion/SwLineLayout/SwFieldPortion[2]","expand").indexOf("Reference
 source not found"));
 }
 #endif
 


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

2022-09-22 Thread Noel Grandin (via logerrit)
 sw/inc/node.hxx |1 +
 sw/source/core/doc/docruby.cxx  |2 +-
 sw/source/core/docnode/node.cxx |9 +
 3 files changed, 11 insertions(+), 1 deletion(-)

New commits:
commit 0c6c95b545b6d4bced699e6f7d9e1d9c679b893e
Author: Noel Grandin 
AuthorDate: Thu Sep 22 15:44:01 2022 +0200
Commit: Noel Grandin 
CommitDate: Fri Sep 23 08:02:39 2022 +0200

add a new SwContentNode::GoNext variant

that takes a SwPosition and keeps the nNode and nContent fields there in
sync.
this is part of the process of hiding the internals of SwPosition.

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

diff --git a/sw/inc/node.hxx b/sw/inc/node.hxx
index 68a33263124f..e6176ce5b91b 100644
--- a/sw/inc/node.hxx
+++ b/sw/inc/node.hxx
@@ -415,6 +415,7 @@ public:
 void MakeEndIndex( SwContentIndex * pIdx ) { pIdx->Assign( this, Len() 
); }
 
 bool GoNext(SwContentIndex *, SwCursorSkipMode nMode ) const;
+bool GoNext(SwPosition*, SwCursorSkipMode nMode ) const;
 bool GoPrevious(SwContentIndex *, SwCursorSkipMode nMode ) const;
 
 /// @see GetFrameOfModify
diff --git a/sw/source/core/doc/docruby.cxx b/sw/source/core/doc/docruby.cxx
index 07c11097f81c..1a1b84ffd7f4 100644
--- a/sw/source/core/doc/docruby.cxx
+++ b/sw/source/core/doc/docruby.cxx
@@ -303,7 +303,7 @@ bool SwDoc::SelectNextRubyChars( SwPaM& rPam, 
SwRubyListEntry& rEntry )
 nWordEnd = nEnd;
 }
 }
-pTNd->GoNext( &pPos->nContent, SwCursorSkipMode::Chars );
+pTNd->GoNext( pPos, SwCursorSkipMode::Chars );
 nStart = pPos->GetContentIndex();
 }
 
diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx
index 04d9e3f354bd..34586965475a 100644
--- a/sw/source/core/docnode/node.cxx
+++ b/sw/source/core/docnode/node.cxx
@@ -1284,6 +1284,15 @@ SwFormatColl *SwContentNode::ChgFormatColl( SwFormatColl 
*pNewColl )
 return pOldColl;
 }
 
+bool SwContentNode::GoNext(SwPosition* pPos, SwCursorSkipMode nMode ) const
+{
+if (!GoNext(&pPos->nContent, nMode))
+return false;
+if (pPos->nContent.GetContentNode() != &pPos->GetNode())
+pPos->nNode.Assign(*pPos->nContent.GetContentNode());
+return true;
+}
+
 bool SwContentNode::GoNext(SwContentIndex * pIdx, SwCursorSkipMode nMode ) 
const
 {
 bool bRet = true;


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

2022-09-22 Thread Michael Weghorn (via logerrit)
 sw/inc/crsrsh.hxx |7 +++
 sw/source/core/crsr/crsrsh.cxx|6 --
 sw/source/uibase/docvw/edtwin.cxx |   16 
 3 files changed, 27 insertions(+), 2 deletions(-)

New commits:
commit 782e4502898924eb94c4ff7f6c33d9ef36959f02
Author: Michael Weghorn 
AuthorDate: Thu Sep 22 23:50:07 2022 +0200
Commit: Michael Weghorn 
CommitDate: Fri Sep 23 07:49:33 2022 +0200

tdf#149952 sw a11y: Don't send a11y events for internal-only cursor

The fact that `SwEditWin::GetSurroundingText` etc.
use an internal-only helper cursor is an implementation
detail and should not result in a11y events getting sent
from LibreOffice to the platform a11y layer.

Therefore, introduce a flag to `SwCursorShell`
that indicates whether or not sending of
accessible cursor events is enabled and set that
to false during the use of the helper cursors.

As described in Sebastian Keller's very
helpful analysis on what was happening on the
gnome-shell magnifier side (s. tdf#149952 comment 11),
sending those a11y events resulted in the
gnome-shell magnifier jumping to the right
when typing empty paragraphs:

> Regarding the issue of jumping to the right, it looks
> like there is a 'object:state-changed:selected' for the
> paragraph when pressing enter multiple times. This causes the
> magnifier to center the entire paragraph, which has the width
> of the entire page according to the extents, so this will be
> further to the right compared to caret.

Change-Id: I514aa2dad5cfffbe5e8d4b7e9d7d383e70470b18
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137104
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx
index d552cba2b503..2c1001b44c50 100644
--- a/sw/inc/crsrsh.hxx
+++ b/sw/inc/crsrsh.hxx
@@ -235,6 +235,10 @@ private:
 bool m_bSetCursorInReadOnly : 1;// true -> Cursor is allowed in 
ReadOnly-Areas
 bool m_bOverwriteCursor : 1;// true -> show Overwrite Cursor
 
+// true -> send accessible events when cursor changes
+// (set to false when using internal-only helper cursor)
+bool m_bSendAccessibleCursorEvents : 1;
+
 bool m_bMacroExecAllowed : 1;
 
 SwFrame* m_oldColFrame;
@@ -468,6 +472,9 @@ public:
 bool IsOverwriteCursor() const { return m_bOverwriteCursor; }
 void SetOverwriteCursor( bool bFlag ) { m_bOverwriteCursor = bFlag; }
 
+bool IsSendAccessibleCursorEvents() const { return 
m_bSendAccessibleCursorEvents; };
+void SetSendAccessibleCursorEvents(bool bEnable) { 
m_bSendAccessibleCursorEvents = bEnable; };
+
 // Return current frame in which the cursor is placed.
 SwContentFrame *GetCurrFrame( const bool bCalcFrame = true ) const;
 
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 0ec692f47e7d..8f3840f22fcc 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -1751,7 +1751,7 @@ void SwCursorShell::UpdateCursor( sal_uInt16 eFlags, bool 
bIdleEnd )
 }
 m_eMvState = CursorMoveState::NONE;  // state for cursor 
travelling - GetModelPositionForViewPoint
 #if !ENABLE_WASM_STRIP_ACCESSIBILITY
-if (Imp()->IsAccessible())
+if (Imp()->IsAccessible() && m_bSendAccessibleCursorEvents)
 Imp()->InvalidateAccessibleCursorPosition( pTableFrame );
 #endif
 return;
@@ -2025,7 +2025,7 @@ void SwCursorShell::UpdateCursor( sal_uInt16 eFlags, bool 
bIdleEnd )
 m_eMvState = CursorMoveState::NONE; // state for cursor travelling - 
GetModelPositionForViewPoint
 
 #if !ENABLE_WASM_STRIP_ACCESSIBILITY
-if (Imp()->IsAccessible())
+if (Imp()->IsAccessible() && m_bSendAccessibleCursorEvents)
 Imp()->InvalidateAccessibleCursorPosition( pFrame );
 #endif
 
@@ -2966,6 +2966,7 @@ SwCursorShell::SwCursorShell( SwCursorShell& rShell, 
vcl::Window *pInitWin )
 m_bAllProtect = m_bVisPortChgd = m_bChgCallFlag = m_bInCMvVisportChgd =
 m_bGCAttr = m_bIgnoreReadonly = m_bSelTableCells = m_bBasicHideCursor =
 m_bOverwriteCursor = false;
+m_bSendAccessibleCursorEvents = true;
 m_bCallChgLnk = m_bHasFocus = m_bAutoUpdateCells = true;
 m_bSVCursorVis = true;
 m_bSetCursorInReadOnly = true;
@@ -3010,6 +3011,7 @@ SwCursorShell::SwCursorShell( SwDoc& rDoc, vcl::Window 
*pInitWin,
 m_bAllProtect = m_bVisPortChgd = m_bChgCallFlag = m_bInCMvVisportChgd =
 m_bGCAttr = m_bIgnoreReadonly = m_bSelTableCells = m_bBasicHideCursor =
 m_bOverwriteCursor = false;
+m_bSendAccessibleCursorEvents = true;
 m_bCallChgLnk = m_bHasFocus = m_bAutoUpdateCells = true;
 m_bSVCursorVis = true;
 m_bSetCursorInReadOnly = true;
diff --git a/sw/source/uibase/docvw/edtwin.cxx 
b/sw/source/uibase/docvw/edtwin.cxx
index d6d828db846e..66145652c6d7 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwi

Master build failure on macOS Arm M1 in liblangtag

2022-09-22 Thread Alexander Thurgood

Hi all,

After a long hiatus, I've decided to try my hand again at building LO 
for Mac aarch64 on a MacMini (from config.log, 
host='aarch-apple-darwin21.6.0').


I've set up the lode build environment, and am using the default 
autogen.sh configuration values (whatever they might be), i.e. no 
tweaking with the switches as yet.


Per the build instructions at:
https://wiki.documentfoundation.org/Development/BuildingOnMac

and

https://wiki.documentfoundation.org/Development/lode

this is supposed to work.


The build progresses until it gets to liblangtag, where it fails with:

clang:erro: no such file or directory: '/usr/local/lib/libiconv.dylib'
Makefile:745: recipe for target 'liblangtag.la' failed

and the usual recursive make errors are shown until

/Users/alex/LODEV/lode/dev/core/external/liblangtag/ExternalProject_liblangtag.mk:24: 
recipe for target 
'/Users/alex/LDOEV/lode/core/workdir/ExternalProject/liblangtag/build' 
failed



Of course, libiconv.dylib is not in /usr/local/lib.

Not sure where to go from here, there's definitely no libiconv.dylib in 
'/usr/local/lib/' (or anywhere else on the system that I can see).




Alex




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

2022-09-22 Thread Noel Grandin (via logerrit)
 sw/source/core/doc/docruby.cxx |   12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 9940a5dce79fe9dc3e6ff0302c9be8c7d1648f67
Author: Noel Grandin 
AuthorDate: Thu Sep 22 15:31:06 2022 +0200
Commit: Noel Grandin 
CommitDate: Thu Sep 22 21:00:37 2022 +0200

use more SwPosition::AdjustContent

part of the process of hiding the internals of SwPosition

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

diff --git a/sw/source/core/doc/docruby.cxx b/sw/source/core/doc/docruby.cxx
index c269d5a6290b..07c11097f81c 100644
--- a/sw/source/core/doc/docruby.cxx
+++ b/sw/source/core/doc/docruby.cxx
@@ -153,7 +153,7 @@ void SwDoc::SetRubyList( const SwPaM& rPam, const 
SwRubyList& rList )
 {
 getIDocumentContentOperations().InsertString( 
aPam, pEntry->GetText() );
 aPam.SetMark();
-aPam.GetMark()->nContent -= 
pEntry->GetText().getLength();
+aPam.GetMark()->AdjustContent( 
-pEntry->GetText().getLength() );
 getIDocumentContentOperations().InsertPoolItem(
 aPam, pEntry->GetRubyAttr(), 
SetAttrMode::DONTEXPAND );
 }
@@ -213,7 +213,7 @@ bool SwDoc::SelectNextRubyChars( SwPaM& rPam, 
SwRubyListEntry& rEntry )
 if( !bHasMark && nStart > pAttr->GetStart() )
 {
 nStart = pAttr->GetStart();
-pPos->nContent = nStart;
+pPos->SetContent(nStart);
 }
 }
 break;
@@ -232,7 +232,7 @@ bool SwDoc::SelectNextRubyChars( SwPaM& rPam, 
SwRubyListEntry& rEntry )
 if (nWordStt < nStart && nWordStt >= 0)
 {
 nStart = nWordStt;
-pPos->nContent = nStart;
+pPos->SetContent(nStart);
 }
 }
 
@@ -243,13 +243,13 @@ bool SwDoc::SelectNextRubyChars( SwPaM& rPam, 
SwRubyListEntry& rEntry )
 {
 if( pAttr && nStart == pAttr->GetStart() )
 {
-pPos->nContent = nStart;
+pPos->SetContent(nStart);
 if( !rPam.HasMark() )
 {
 rPam.SetMark();
-pPos->nContent = pAttr->GetAnyEnd();
+pPos->SetContent(pAttr->GetAnyEnd());
 if( pPos->GetContentIndex() > nEnd )
-pPos->nContent = nEnd;
+pPos->SetContent(nEnd);
 rEntry.SetRubyAttr( pAttr->GetRuby() );
 }
 break;


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

2022-09-22 Thread Noel Grandin (via logerrit)
 chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx |   21 
 sc/inc/chart2uno.hxx|4 --
 sc/source/ui/unoobj/chart2uno.cxx   |   21 ++--
 3 files changed, 13 insertions(+), 33 deletions(-)

New commits:
commit c3bc67bffd1e0b9bdd60ef274a6d5e59101d322d
Author: Noel Grandin 
AuthorDate: Thu Sep 22 14:02:47 2022 +0200
Commit: Noel Grandin 
CommitDate: Thu Sep 22 21:00:00 2022 +0200

tdf#151091 Revert "tdf#148635 cache some chart stuff"

This reverts commit fd2ca9607431fc6ca49e37ab6fef228aa72da5f9,
since it causes a regression when copying a chart.

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

diff --git a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx 
b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
index a9479cd6fc62..d5ede5c7b5a0 100644
--- a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
@@ -1098,8 +1098,7 @@ public:
 
 private: //member
 std::shared_ptr< Chart2ModelContact >   m_spChart2ModelContact;
-mutable Any m_aOuterValue;
-mutable boolm_bDetectedRangeSegmentation { 
false };
+mutable Any m_aOuterValue;
 };
 
 }
@@ -1153,19 +1152,15 @@ Any WrappedDataRowSourceProperty::getPropertyValue( 
const Reference< beans::XPro
 bool bHasCategories = true;
 uno::Sequence< sal_Int32 > aSequenceMapping;
 
-if (!m_bDetectedRangeSegmentation)
+if( DataSourceHelper::detectRangeSegmentation(
+m_spChart2ModelContact->getDocumentModel(), aRangeString, 
aSequenceMapping, bUseColumns
+, bFirstCellAsLabel, bHasCategories ) )
 {
-if( DataSourceHelper::detectRangeSegmentation(
-m_spChart2ModelContact->getDocumentModel(), aRangeString, 
aSequenceMapping, bUseColumns
-, bFirstCellAsLabel, bHasCategories ) )
-{
-css::chart::ChartDataRowSource eChartDataRowSource = 
css::chart::ChartDataRowSource_ROWS;
-if(bUseColumns)
-eChartDataRowSource = css::chart::ChartDataRowSource_COLUMNS;
+css::chart::ChartDataRowSource eChartDataRowSource = 
css::chart::ChartDataRowSource_ROWS;
+if(bUseColumns)
+eChartDataRowSource = css::chart::ChartDataRowSource_COLUMNS;
 
-m_aOuterValue <<= eChartDataRowSource;
-}
-m_bDetectedRangeSegmentation = true;
+m_aOuterValue <<= eChartDataRowSource;
 }
 
 return m_aOuterValue;
diff --git a/sc/inc/chart2uno.hxx b/sc/inc/chart2uno.hxx
index 72a6374be739..a5e4f53b032f 100644
--- a/sc/inc/chart2uno.hxx
+++ b/sc/inc/chart2uno.hxx
@@ -147,10 +147,6 @@ private:
 ScDocument* m_pDocument;
 SfxItemPropertySet  m_aPropSet;
 boolm_bIncludeHiddenCells;
-css::uno::Reference< css::chart2::data::XDataSource > mxCachedDataSource;
-css::uno::Sequence< css::beans::PropertyValue > maCachedArguments;
-css::uno::Sequence< css::beans::PropertyValue > 
maCreateDataSourceArguments;
-css::uno::Reference< css::chart2::data::XDataSource > mxCreatedDataSource;
 };
 
 // DataSource
diff --git a/sc/source/ui/unoobj/chart2uno.cxx 
b/sc/source/ui/unoobj/chart2uno.cxx
index 99476e18f56b..729249790a9d 100644
--- a/sc/source/ui/unoobj/chart2uno.cxx
+++ b/sc/source/ui/unoobj/chart2uno.cxx
@@ -1401,11 +1401,7 @@ ScChart2DataProvider::createDataSource(
 if ( ! m_pDocument )
 throw uno::RuntimeException();
 
-// This is expensive to compute and we get called more than once, so cache
-if (maCreateDataSourceArguments == aArguments)
-return mxCreatedDataSource;
-maCreateDataSourceArguments = aArguments;
-
+uno::Reference< chart2::data::XDataSource> xResult;
 bool bLabel = true;
 bool bCategories = false;
 bool bOrientCol = true;
@@ -1492,7 +1488,7 @@ ScChart2DataProvider::createDataSource(
 const Chart2PositionMap* pChartMap = aChPositioner.getPositionMap();
 if (!pChartMap)
 // No chart position map instance.  Bail out.
-return mxCreatedDataSource;
+return xResult;
 
 rtl::Reference pDS;
 ::std::vector< uno::Reference< chart2::data::XLabeledDataSequence > > 
aSeqs;
@@ -1570,8 +1566,8 @@ ScChart2DataProvider::createDataSource(
 }
 }
 
-mxCreatedDataSource.set(pDS);
-return mxCreatedDataSource;
+xResult.set( pDS );
+return xResult;
 }
 
 namespace
@@ -1763,10 +1759,6 @@ std::pair constructKey(const 
uno::Reference< chart2::data::X
 uno::Sequence< beans::PropertyValue > SAL_CALL 
ScChart2DataProvider::detectArguments(
 const uno::Reference< chart2::data::XDataSource >& xDataSource )
 {
-// Cache these

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

2022-09-22 Thread Caolán McNamara (via logerrit)
 i18nutil/source/utility/paper.cxx  |6 +-
 sw/qa/extras/ooxmlexport/ooxmlexport15.cxx |4 ++--
 sw/qa/extras/ooxmlexport/ooxmlexport3.cxx  |2 +-
 3 files changed, 8 insertions(+), 4 deletions(-)

New commits:
commit 40a428fde0a33e7127dfa30845d65c698e408053
Author: Caolán McNamara 
AuthorDate: Thu Sep 22 16:05:44 2022 +0100
Commit: Caolán McNamara 
CommitDate: Thu Sep 22 20:41:57 2022 +0200

Related: tdf#151107 make "sloppy" paper fit up to 1.25pt

This reverts commit 0b6d45056ab6e1c47b4ed62eedaad02249439444.

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

diff --git a/i18nutil/source/utility/paper.cxx 
b/i18nutil/source/utility/paper.cxx
index 1976880a060d..f6871e655f58 100644
--- a/i18nutil/source/utility/paper.cxx
+++ b/i18nutil/source/utility/paper.cxx
@@ -165,7 +165,11 @@ const PageDesc aDinTab[] =
 
 const size_t nTabSize = SAL_N_ELEMENTS(aDinTab);
 
-#define MAXSLOPPY 21
+// tdf#151107 make this not just large enough for rounding errors on our side
+// but also large enough to match where the ppd side rounded up to the next
+// point. Seen with C5/C6/C65 envelopes which can be found over 1 point away
+// from the values in aDinTab
+#define MAXSLOPPY PT2MM100(1.25)
 
 void PaperInfo::doSloppyFit(bool bAlsoTryRotated)
 {
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
index 0878ce515e2e..d7c0c5404677 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
@@ -676,9 +676,9 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf132149_pgBreak)
 assertXPath(pDump, "//page[2]/infos/prtBounds", "left", "2268");  //Left 
page style
 
 assertXPath(pDump, "//page[1]/infos/bounds", "width", "8391");  //landscape
-assertXPath(pDump, "//page[2]/infos/bounds", "width", "5953");  //portrait
+assertXPath(pDump, "//page[2]/infos/bounds", "width", "5940");  //portrait
 // This two-line 3rd page ought not to exist. DID YOU FIX ME? The real 
page 3 should be "8391" landscape.
-assertXPath(pDump, "//page[3]/infos/bounds", "width", "5953");
+assertXPath(pDump, "//page[3]/infos/bounds", "width", "5940");
 // This really ought to be on odd page 3, but now it is on odd page 5.
 assertXPath(pDump, "//page[5]/infos/bounds", "width", "8391");
 assertXPath(pDump, "//page[5]/infos/prtBounds", "right", "6122");  //Left 
page style
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
index b6d4af1fe739..f15b2c1f3ca9 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
@@ -322,7 +322,7 @@ DECLARE_OOXMLEXPORT_TEST(testCalendar3, "calendar3.docx")
 // Both Word and LO display it as landscape, so ensure that it round-trips 
with landscape dimensions.
 uno::Reference 
xPageStyle(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY);
 CPPUNIT_ASSERT_EQUAL_MESSAGE("Page Width (mm) ", sal_Int32(148), 
getProperty(xPageStyle, "Width") / 100);
-CPPUNIT_ASSERT_EQUAL_MESSAGE("Page Height (mm)", sal_Int32(105), 
getProperty(xPageStyle, "Height") / 100);
+CPPUNIT_ASSERT_EQUAL_MESSAGE("Page Height (mm)", sal_Int32(104), 
getProperty(xPageStyle, "Height") / 100);
 }
 
 DECLARE_OOXMLEXPORT_TEST(testCalendar4, "calendar4.docx")


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

2022-09-22 Thread Eike Rathke (via logerrit)
 sc/source/ui/app/inputhdl.cxx |7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 10d1e6ff6b3a10b673696524ad59297f4e5a1c2c
Author: Eike Rathke 
AuthorDate: Thu Sep 22 18:32:13 2022 +0200
Commit: Eike Rathke 
CommitDate: Thu Sep 22 20:16:59 2022 +0200

Fix string length assertion and handle parentheses in multi-line formula

soffice.bin: include/rtl/ustring.hxx:842: sal_Unicode 
rtl::OUString::operator[](sal_Int32) const: Assert ion `index >= 0 && 
static_cast(index) < static_cast(getLength())' failed.

when editing a paragraph (line) longer than the first, because the
string was always obtained from the first paragraph but the
position from the current selection.

Also match parentheses in the current paragraph, not somewhere
else in the first paragraph.. still we're matching only within one
paragraph.

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

diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index a8dc8a5d7a76..ecca9785185c 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -2173,10 +2173,11 @@ void ScInputHandler::UpdateParenthesis()
 {
 // Examine character left to the cursor
 sal_Int32 nPos = aSel.nStartPos - 1;
-OUString aFormula = mpEditEngine->GetText(0);
+OUString aFormula = mpEditEngine->GetText(aSel.nStartPara);
 sal_Unicode c = aFormula[nPos];
 if ( c == '(' || c == ')' )
 {
+// Note this matches only within one paragraph.
 sal_Int32 nOther = lcl_MatchParenthesis( aFormula, nPos );
 if ( nOther != -1 )
 {
@@ -2192,9 +2193,9 @@ void ScInputHandler::UpdateParenthesis()
 mpEditEngine->RemoveCharAttribs( i, 
EE_CHAR_WEIGHT );
 }
 
-ESelection aSelThis( 0,nPos, 0,nPos+1 );
+ESelection aSelThis( aSel.nStartPara, nPos, 
aSel.nStartPara, nPos+1);
 mpEditEngine->QuickSetAttribs( aSet, aSelThis );
-ESelection aSelOther( 0,nOther, 0,nOther+1 );
+ESelection aSelOther( aSel.nStartPara, nOther, 
aSel.nStartPara, nOther+1);
 mpEditEngine->QuickSetAttribs( aSet, aSelOther );
 
 // Dummy InsertText for Update and Paint (selection is 
empty)


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

2022-09-22 Thread Justin Luth (via logerrit)
 sc/source/filter/xml/celltextparacontext.cxx |2 --
 1 file changed, 2 deletions(-)

New commits:
commit f24841da29adb8c0b4a8ec1b29367ee63998d440
Author: Justin Luth 
AuthorDate: Thu Sep 22 12:47:28 2022 -0400
Commit: Justin Luth 
CommitDate: Thu Sep 22 19:49:36 2022 +0200

crashtesting: "unknown cell text: element" assert on broken xml

Three invalid files are hitting this assert.
They had invalid XML, so I couldn't even
xmllint --format --recover content.xml

Removing the assert - it has outlived its usefulness.

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

diff --git a/sc/source/filter/xml/celltextparacontext.cxx 
b/sc/source/filter/xml/celltextparacontext.cxx
index 5274a36f0599..b8c204dbe2d4 100644
--- a/sc/source/filter/xml/celltextparacontext.cxx
+++ b/sc/source/filter/xml/celltextparacontext.cxx
@@ -77,8 +77,6 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL 
ScXMLCellTextParaContex
 break;
 default:
 SAL_WARN("sc","unknown text 
element["<

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

2022-09-22 Thread Michael Stahl (via logerrit)
 sw/qa/extras/layout/data/in_056132_mod.odt |binary
 sw/qa/extras/layout/layout.cxx |   49 +
 sw/source/core/layout/calcmove.cxx |7 
 3 files changed, 49 insertions(+), 7 deletions(-)

New commits:
commit 3acd80a030707b3c4795c0f828f953ac0ae24d97
Author: Michael Stahl 
AuthorDate: Wed Sep 21 18:33:43 2022 +0200
Commit: Michael Stahl 
CommitDate: Thu Sep 22 19:42:46 2022 +0200

tdf#150616 sw: fix bad 0 height of SwTextFrame in table cell

The bugdoc has a text frame 42 immediately following a section which
contains a nested table, both inside a table cell 29.

The problem is that with soffice --convert-to pdf, the height of frame
42 ends up as 0, after a single layout action; this does not happen when
loading it from UI.

When the frame 42 is formatted, it calculates the needed height, and
grows, but in SwTextFrame::AdjustFrame() it doesn't fit into its upper
cell frame with a negative nRstHeight at this point, and the text frame
is reduced to height 0.

The odd code in SwContentFrame::MakeAll() exists unchanged since CVS
initial import and is poorly motivated. It is highly suspicious that it
simply grows the upper frame, without invalidating the size of the
current one (which was already shrunk), and/or clearing the
m_bUndersized flag.

If this code is removed, on formatting the next frame 43, it goes up and
formats the cell frame, which grows and at the same time importantly
invalidates the text frame 42, so it will be formatted again and full
height.

At the point when the frame 42 was formatted, its upper cell frame was
size-invalid, so it looks like that will be formatted eventually in any
case and then invalidate 42.

(regression from commit e7874c936dd1ff9b3423eb7477cbee2494535176
 but unclear why)

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

diff --git a/sw/qa/extras/layout/data/in_056132_mod.odt 
b/sw/qa/extras/layout/data/in_056132_mod.odt
new file mode 100644
index ..548401063bdd
Binary files /dev/null and b/sw/qa/extras/layout/data/in_056132_mod.odt differ
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index 438321555e89..0536a54d8b7e 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -3807,6 +3807,55 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, 
testTdf122607_regression)
 aTempFile.EnableKillingFile();
 }
 
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter, TestTdf150616)
+{
+discardDumpedLayout();
+if (mxComponent.is())
+mxComponent->dispose();
+
+OUString const pName("in_056132_mod.odt");
+
+OUString const url(m_directories.getURLFromSrc(DATA_DIRECTORY) + pName);
+
+// note: must set Hidden property, so that 
SfxFrameViewWindow_Impl::Resize()
+// does *not* forward initial VCL Window Resize and thereby triggers a
+// layout which does not happen on soffice --convert-to pdf.
+std::vector aFilterOptions = {
+{ beans::PropertyValue("Hidden", -1, uno::Any(true), 
beans::PropertyState_DIRECT_VALUE) },
+};
+
+std::cout << pName << ":\n";
+
+// inline the loading because currently properties can't be passed...
+mxComponent = loadFromDesktop(url, "com.sun.star.text.TextDocument",
+  
comphelper::containerToSequence(aFilterOptions));
+uno::Sequence 
props(comphelper::InitPropertySequence({
+{ "FilterName", uno::Any(OUString("writer_pdf_Export")) },
+}));
+utl::TempFile aTempFile;
+uno::Reference xStorable(mxComponent, uno::UNO_QUERY);
+xStorable->storeToURL(aTempFile.GetURL(), props);
+
+xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+CPPUNIT_ASSERT(pXmlDoc);
+
+// this one was 0 height
+assertXPath(pXmlDoc, 
"/root/page[1]/body/tab[3]/row[2]/cell[2]/txt[2]/LineBreak", "Line",
+"Important information here!");
+assertXPath(pXmlDoc, 
"/root/page[1]/body/tab[3]/row[2]/cell[2]/txt[2]/infos/bounds", "height",
+"253");
+assertXPath(pXmlDoc, 
"/root/page[1]/body/tab[3]/row[2]/cell[2]/txt[2]/infos/bounds", "top",
+"7925");
+assertXPath(pXmlDoc, 
"/root/page[1]/body/tab[3]/row[2]/cell[2]/txt[3]/LineBreak", "Line",
+"xxx 111 ");
+assertXPath(pXmlDoc, 
"/root/page[1]/body/tab[3]/row[2]/cell[2]/txt[3]/infos/bounds", "height",
+"697");
+assertXPath(pXmlDoc, 
"/root/page[1]/body/tab[3]/row[2]/cell[2]/txt[3]/infos/bounds", "top",
+"8178");
+
+aTempFile.EnableKillingFile();
+}
+
 CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testBtlrCell)
 {
 SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "btlr-cell.odt");
diff --git a/sw/source/core/layout/calcmove.cxx 
b/sw/source/core/layout/calcmove.cxx
index

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

2022-09-22 Thread Caolán McNamara (via logerrit)
 vcl/inc/ppdparser.hxx |8 ++--
 vcl/source/gdi/print.cxx  |1 +
 vcl/unx/generic/print/genprnpsp.cxx   |   14 --
 vcl/unx/generic/printer/ppdparser.cxx |   29 +
 4 files changed, 40 insertions(+), 12 deletions(-)

New commits:
commit 6005aeca4416eb0d583fd12ab837afa91d9d18ec
Author: Caolán McNamara 
AuthorDate: Wed Sep 21 22:22:38 2022 +0200
Commit: Caolán McNamara 
CommitDate: Thu Sep 22 19:40:02 2022 +0200

tdf#151107 swap job orientation if paper matching swapped width/height

if we eventually are forced to pick a final paper size which has the
orthogonal orientation than that requested, then swap the orientation of
the jobdata too

and re-init the orientation to defaults in Printer::SetPaperSizeUser
when we set a new user paper size rather than keeping the orig

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

diff --git a/vcl/inc/ppdparser.hxx b/vcl/inc/ppdparser.hxx
index 5d4195783a68..7ef864bc9cfc 100644
--- a/vcl/inc/ppdparser.hxx
+++ b/vcl/inc/ppdparser.hxx
@@ -36,6 +36,8 @@
 
 namespace psp {
 
+enum class orientation;
+
 class PPDCache;
 class PPDTranslator;
 
@@ -110,7 +112,6 @@ struct PPDKeyhash
 { return reinterpret_cast(pKey); }
 };
 
-
 /*
  * PPDParser - parses a PPD file and contains all available keys from it
  */
@@ -177,6 +178,9 @@ private:
 static void scanPPDDir( const OUString& rDir );
 static void initPPDFiles(PPDCache &rPPDCache);
 static OUString getPPDFile( const OUString& rFile );
+
+OUStringmatchPaperImpl(int nWidth, int nHeight, bool bDontSwap = 
false, psp::orientation* pOrientation = nullptr) const;
+
 public:
 ~PPDParser();
 static const PPDParser* getParser( const OUString& rFile );
@@ -201,7 +205,7 @@ public:
 // returns false if paper not found
 
 // match the best paper for width and height
-OUStringmatchPaper( int nWidth, int nHeight, bool bDontSwap = 
false ) const;
+OUStringmatchPaper( int nWidth, int nHeight, psp::orientation* 
pOrientation = nullptr ) const;
 
 bool getMargins( std::u16string_view rPaperName,
  int &rLeft, int& rRight,
diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx
index 5300de9a881d..6225db3a6b35 100644
--- a/vcl/source/gdi/print.cxx
+++ b/vcl/source/gdi/print.cxx
@@ -1347,6 +1347,7 @@ bool Printer::SetPaperSizeUser( const Size& rSize )
 rData.SetPaperFormat( PAPER_USER );
 rData.SetPaperWidth( aPageSize.Width() );
 rData.SetPaperHeight( aPageSize.Height() );
+rData.SetOrientation( Orientation::Portrait );
 
 if ( IsDisplayPrinter() )
 {
diff --git a/vcl/unx/generic/print/genprnpsp.cxx 
b/vcl/unx/generic/print/genprnpsp.cxx
index 5c17874c4dfb..30c4f884a041 100644
--- a/vcl/unx/generic/print/genprnpsp.cxx
+++ b/vcl/unx/generic/print/genprnpsp.cxx
@@ -569,6 +569,10 @@ bool PspSalInfoPrinter::SetData(
 const PPDKey* pKey;
 const PPDValue* pValue;
 
+// merge orientation if necessary
+if( nSetDataFlags & JobSetFlags::ORIENTATION )
+aData.m_eOrientation = pJobSetup->GetOrientation() == 
Orientation::Landscape ? orientation::Landscape : orientation::Portrait;
+
 // merge papersize if necessary
 if( nSetDataFlags & JobSetFlags::PAPERSIZE )
 {
@@ -577,7 +581,8 @@ bool PspSalInfoPrinter::SetData(
 if( pJobSetup->GetPaperFormat() == PAPER_USER )
 aPaper = aData.m_pParser->matchPaper(
 TenMuToPt( pJobSetup->GetPaperWidth() ),
-TenMuToPt( pJobSetup->GetPaperHeight() ) );
+TenMuToPt( pJobSetup->GetPaperHeight() ),
+&aData.m_eOrientation );
 else
 aPaper = 
OStringToOUString(PaperInfo::toPSName(pJobSetup->GetPaperFormat()), 
RTL_TEXTENCODING_ISO_8859_1);
 
@@ -591,7 +596,8 @@ bool PspSalInfoPrinter::SetData(
 PaperInfo aInfo( pJobSetup->GetPaperFormat() );
 aPaper = aData.m_pParser->matchPaper(
 TenMuToPt( aInfo.getWidth() ),
-TenMuToPt( aInfo.getHeight() ) );
+TenMuToPt( aInfo.getHeight() ),
+&aData.m_eOrientation );
 pValue = pKey->getValueCaseInsensitive( aPaper );
 }
 
@@ -619,10 +625,6 @@ bool PspSalInfoPrinter::SetData(
 // (e.g. SGENPRT has no InputSlot)
 }
 
-// merge orientation if necessary
-if( nSetDataFlags & JobSetFlags::ORIENTATION )
-aData.m_eOrientation = pJobSetup->GetOrientation() == 
Orientation::Landscape ? orientation::Landscape : orientation::Portrait;
-
 // merge duplex if necessary
 if( nSetDataFlags & JobSetFlags::DUPLEXMODE )
  

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

2022-09-22 Thread Caolán McNamara (via logerrit)
 vcl/inc/ppdparser.hxx |2 +-
 vcl/unx/generic/printer/ppdparser.cxx |8 ++--
 2 files changed, 3 insertions(+), 7 deletions(-)

New commits:
commit 3805a4090dbbffa54bb1a9d7fe63e723fc6d029b
Author: Caolán McNamara 
AuthorDate: Thu Sep 22 14:08:44 2022 +0100
Commit: Caolán McNamara 
CommitDate: Thu Sep 22 19:39:44 2022 +0200

pass in bDontSwap rather than use a local static

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

diff --git a/vcl/inc/ppdparser.hxx b/vcl/inc/ppdparser.hxx
index 757b7e68..5d4195783a68 100644
--- a/vcl/inc/ppdparser.hxx
+++ b/vcl/inc/ppdparser.hxx
@@ -201,7 +201,7 @@ public:
 // returns false if paper not found
 
 // match the best paper for width and height
-OUStringmatchPaper( int nWidth, int nHeight ) const;
+OUStringmatchPaper( int nWidth, int nHeight, bool bDontSwap = 
false ) const;
 
 bool getMargins( std::u16string_view rPaperName,
  int &rLeft, int& rRight,
diff --git a/vcl/unx/generic/printer/ppdparser.cxx 
b/vcl/unx/generic/printer/ppdparser.cxx
index 061cd5bc727d..6e980776e73e 100644
--- a/vcl/unx/generic/printer/ppdparser.cxx
+++ b/vcl/unx/generic/printer/ppdparser.cxx
@@ -1466,7 +1466,7 @@ bool PPDParser::getPaperDimension(
 return true;
 }
 
-OUString PPDParser::matchPaper( int nWidth, int nHeight ) const
+OUString PPDParser::matchPaper(int nWidth, int nHeight, bool bDontSwap) const
 {
 if( ! m_pPaperDimensions )
 return OUString();
@@ -1497,14 +1497,10 @@ OUString PPDParser::matchPaper( int nWidth, int nHeight 
) const
 }
 }
 
-static bool bDontSwap = false;
 if( nPDim == -1 && ! bDontSwap )
 {
 // swap portrait/landscape and try again
-bDontSwap = true;
-OUString rRet = matchPaper( nHeight, nWidth );
-bDontSwap = false;
-return rRet;
+return matchPaper( nHeight, nWidth, true );
 }
 
 return nPDim != -1 ? m_pPaperDimensions->getValue( nPDim )->m_aOption : 
OUString();


[Libreoffice-commits] core.git: helpcontent2

2022-09-22 Thread Mike Kaganski (via logerrit)
 helpcontent2 |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 74410f8a8cb05b6313c5235ba1036ec9ee160899
Author: Mike Kaganski 
AuthorDate: Thu Sep 22 19:22:08 2022 +0200
Commit: Gerrit Code Review 
CommitDate: Thu Sep 22 19:22:08 2022 +0200

Update git submodules

* Update helpcontent2 from branch 'master'
  to a9fed471fe915e0ad8053cf21227c5a4d8a31108
  - TRUE/FALSE are functions

Samples using them as constants simply don't work

Change-Id: I1cc6199fa418363b3176dd3c2f18d9cc6620957a
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/140385
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/helpcontent2 b/helpcontent2
index 3b0d630cec01..a9fed471fe91 16
--- a/helpcontent2
+++ b/helpcontent2
@@ -1 +1 @@
-Subproject commit 3b0d630cec012f7aa10cad2029468f5ea6f25b6c
+Subproject commit a9fed471fe915e0ad8053cf21227c5a4d8a31108


[Libreoffice-commits] help.git: source/text

2022-09-22 Thread Mike Kaganski (via logerrit)
 source/text/scalc/01/04060105.xhp |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit a9fed471fe915e0ad8053cf21227c5a4d8a31108
Author: Mike Kaganski 
AuthorDate: Thu Sep 22 19:09:34 2022 +0200
Commit: Mike Kaganski 
CommitDate: Thu Sep 22 19:22:07 2022 +0200

TRUE/FALSE are functions

Samples using them as constants simply don't work

Change-Id: I1cc6199fa418363b3176dd3c2f18d9cc6620957a
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/140385
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/source/text/scalc/01/04060105.xhp 
b/source/text/scalc/01/04060105.xhp
index 24f8d9729..5b64c4a65 100644
--- a/source/text/scalc/01/04060105.xhp
+++ b/source/text/scalc/01/04060105.xhp
@@ -86,7 +86,7 @@
  
 =AND(12<13;14>12;7<6) returns 
FALSE.
  
-=AND (FALSE;TRUE) returns 
FALSE.
+=AND(FALSE();TRUE()) returns 
FALSE.
   
   
 FALSE function
@@ -156,7 +156,7 @@
  
 =OR(12<11;13>22;45=45) returns 
TRUE.
  
-=OR(FALSE;TRUE) returns TRUE.
+=OR(FALSE();TRUE()) returns 
TRUE.
   
   
 TRUE function
@@ -188,11 +188,11 @@
 
  
  
-=XOR(TRUE;TRUE) returns FALSE
+=XOR(TRUE();TRUE()) returns 
FALSE
  
-=XOR(TRUE;TRUE;TRUE) returns 
TRUE
+=XOR(TRUE();TRUE();TRUE()) returns 
TRUE
  
-=XOR(FALSE;TRUE) returns TRUE
+=XOR(FALSE();TRUE()) returns 
TRUE
   
 
 


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

2022-09-22 Thread Luboš Luňák (via logerrit)
 sc/source/core/opencl/formulagroupcl.cxx | 1046 ++-
 1 file changed, 225 insertions(+), 821 deletions(-)

New commits:
commit e301b61fd4c5005418c5aef255c3cad424f4f72b
Author: Luboš Luňák 
AuthorDate: Thu Sep 22 09:55:45 2022 +0200
Commit: Luboš Luňák 
CommitDate: Thu Sep 22 18:07:31 2022 +0200

reduce excessive code repetition when matching opcode in opencl

I.e. use "ugly" macros to make code more nice.

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

diff --git a/sc/source/core/opencl/formulagroupcl.cxx 
b/sc/source/core/opencl/formulagroupcl.cxx
index 5920b50ca402..9c36b701cfa8 100644
--- a/sc/source/core/opencl/formulagroupcl.cxx
+++ b/sc/source/core/opencl/formulagroupcl.cxx
@@ -2184,491 +2184,6 @@ 
DynamicKernelSoPArguments::DynamicKernelSoPArguments(const ScCalcConfig& config,
 throw UnhandledToken(("unhandled operand " + 
StackVarEnumToString(pChild->GetType()) + " for ocPush").c_str(), __FILE__, 
__LINE__);
 }
 break;
-case ocDiv:
-mvSubArguments.push_back(SoPHelper(mCalcConfig, ts, 
ft->Children[i], std::make_shared(nResultSize), nResultSize));
-break;
-case ocMul:
-mvSubArguments.push_back(SoPHelper(mCalcConfig, ts, 
ft->Children[i], std::make_shared(nResultSize), nResultSize));
-break;
-case ocSub:
-mvSubArguments.push_back(SoPHelper(mCalcConfig, ts, 
ft->Children[i], std::make_shared(nResultSize), nResultSize));
-break;
-case ocAdd:
-case ocSum:
-mvSubArguments.push_back(SoPHelper(mCalcConfig, ts, 
ft->Children[i], std::make_shared(nResultSize), nResultSize));
-break;
-case ocAverage:
-mvSubArguments.push_back(SoPHelper(mCalcConfig, ts, 
ft->Children[i], std::make_shared(nResultSize), nResultSize));
-break;
-case ocAverageA:
-mvSubArguments.push_back(SoPHelper(mCalcConfig, ts, 
ft->Children[i], std::make_shared(nResultSize), nResultSize));
-break;
-case ocMin:
-mvSubArguments.push_back(SoPHelper(mCalcConfig, ts, 
ft->Children[i], std::make_shared(nResultSize), nResultSize));
-break;
-case ocMinA:
-mvSubArguments.push_back(SoPHelper(mCalcConfig, ts, 
ft->Children[i], std::make_shared(nResultSize), nResultSize));
-break;
-case ocMax:
-mvSubArguments.push_back(SoPHelper(mCalcConfig, ts, 
ft->Children[i], std::make_shared(nResultSize), nResultSize));
-break;
-case ocMaxA:
-mvSubArguments.push_back(SoPHelper(mCalcConfig, ts, 
ft->Children[i], std::make_shared(nResultSize), nResultSize));
-break;
-case ocCount:
-mvSubArguments.push_back(SoPHelper(mCalcConfig, ts, 
ft->Children[i], std::make_shared(nResultSize), nResultSize));
-break;
-case ocCount2:
-mvSubArguments.push_back(SoPHelper(mCalcConfig, ts, 
ft->Children[i], std::make_shared(nResultSize), nResultSize));
-break;
-case ocSumProduct:
-mvSubArguments.push_back(SoPHelper(mCalcConfig, ts, 
ft->Children[i], std::make_shared(), nResultSize));
-break;
-case ocIRR:
-mvSubArguments.push_back(SoPHelper(mCalcConfig, ts, 
ft->Children[i], std::make_shared(), nResultSize));
-break;
-case ocMIRR:
-mvSubArguments.push_back(SoPHelper(mCalcConfig, ts, 
ft->Children[i], std::make_shared(), nResultSize));
-break;
-case ocPMT:
-mvSubArguments.push_back(SoPHelper(mCalcConfig, ts, 
ft->Children[i], std::make_shared(), nResultSize));
-break;
-case ocRate:
-mvSubArguments.push_back(SoPHelper(mCalcConfig, ts, 
ft->Children[i], std::make_shared(), nResultSize));
-break;
-case ocRRI:
-mvSubArguments.push_back(SoPHelper(mCalcConfig, ts, 
ft->Children[i], std::make_shared(), nResultSize));
-break;
-case ocPpmt:
-mvSubArguments.push_back(SoPHelper(mCalcConfig, ts, 
ft->Children[i], std::make_shared(), nResultSize));
-break;
-case ocFisher:
-mvSubArguments.push_back(SoPHelper(mCalcConfig, ts, 
ft->Children[i], std::make_shared(), nResultSize));
-break;
-case ocFisherInv:
-mvSubArguments.push_back(SoPHelper(mCalcConfig, ts, 
ft->Children[i], std::make_shared(), nResultSize));
-break;
-case ocGamma:
-   

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

2022-09-22 Thread Luboš Luňák (via logerrit)
 sc/source/core/opencl/formulagroupcl.cxx |4 --
 sc/source/core/opencl/op_statistical.cxx |   59 ---
 sc/source/core/opencl/op_statistical.hxx |6 ---
 3 files changed, 69 deletions(-)

New commits:
commit 1af18947bfd0d6a9c318bfafd5c5d73c23266d45
Author: Luboš Luňák 
AuthorDate: Thu Sep 22 09:55:36 2022 +0200
Commit: Luboš Luňák 
CommitDate: Thu Sep 22 18:06:57 2022 +0200

drop opencl implementation of MEDIAN()

Input data to this function is not required to be sorted, so implementing
this would mean sorting it in opencl, which is not exactly trivial and
not worth the effort. There also exist algorithms that find the median
without sorting an array, but they work by guessing it and looping until
their guess is right, so again, not worth the trouble. I'd say there's
nothing to be gained here from using opencl.

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

diff --git a/sc/source/core/opencl/formulagroupcl.cxx 
b/sc/source/core/opencl/formulagroupcl.cxx
index 967f52c4ce43..5920b50ca402 100644
--- a/sc/source/core/opencl/formulagroupcl.cxx
+++ b/sc/source/core/opencl/formulagroupcl.cxx
@@ -2344,10 +2344,6 @@ 
DynamicKernelSoPArguments::DynamicKernelSoPArguments(const ScCalcConfig& config,
 mvSubArguments.push_back(SoPHelper(mCalcConfig, ts,
 ft->Children[i], std::make_shared(), 
nResultSize));
 break;
-/*case ocMedian:
-mvSubArguments.push_back(SoPHelper(mCalcConfig, ts,
- ft->Children[i],std::make_sharedChildren[i], std::make_shared(), 
nResultSize));
diff --git a/sc/source/core/opencl/op_statistical.cxx 
b/sc/source/core/opencl/op_statistical.cxx
index fd28dc2fcf94..4c79d162e62c 100644
--- a/sc/source/core/opencl/op_statistical.cxx
+++ b/sc/source/core/opencl/op_statistical.cxx
@@ -804,65 +804,6 @@ void OpNormsinv:: GenSlidingWindowFunction
 ss << "}\n";
 }
 
-void OpMedian::GenSlidingWindowFunction(
-outputstream &ss, const std::string &sSymName,
-SubArguments &vSubArguments)
-{
-GenerateFunctionDeclaration( sSymName, vSubArguments, ss );
-ss << "{\n";
-ss << "int gid0 = get_global_id(0);\n";
-ss << "double tmp = 0;\n";
-ss << "int i;\n";
-ss << "unsigned int startFlag = 0;\n";
-ss << "unsigned int endFlag = 0;\n";
-ss << "double dataIna;\n";
-for (const DynamicKernelArgumentRef & rArg : vSubArguments)
-{
-FormulaToken *pCur = rArg->GetFormulaToken();
-assert(pCur);
-if (const formula::DoubleVectorRefToken* pCurDVR =
-dynamic_cast(pCur))
-{
-size_t nCurWindowSize = pCurDVR->GetRefRowSize();
-ss << "startFlag = ";
-if (!pCurDVR->IsStartFixed() && pCurDVR->IsEndFixed())
-{
-ss << "gid0; endFlag = "<< nCurWindowSize <<"-gid0;\n";
-}
-ss << "gid0; endFlag = gid0+"<< nCurWindowSize <<";\n";
-}
-else
-{
-ss<<"startFlag=gid0;endFlag=gid0;\n";
-}
-}
-FormulaToken *tmpCur0 = vSubArguments[0]->GetFormulaToken();
-const formula::DoubleVectorRefToken*tmpCurDVR0= static_cast(tmpCur0);
-ss << "int buffer_fIna_len = ";
-ss << tmpCurDVR0->GetArrayLength();
-ss << ";\n";
-ss<<"if((i+gid0)>=buffer_fIna_len || isnan(";
-ss << vSubArguments[0]->GenSlidingWindowDeclRef();
-ss<<"))\n";
-ss<<"dataIna = 0;\n";
-ss << "int nSize =endFlag- startFlag ;\n";
-ss << "if (nSize & 1)\n";
-ss << "{\n";
-ss << "tmp = "GetName();
-ss << "[startFlag+nSize/2-1])/2;\n";
-ss << "}\n";
-ss <<" return tmp;\n";
-ss << "}\n";
-}
-
 void OpLogInv::BinInlineFun(std::set& decls,
 std::set& funs)
 {
diff --git a/sc/source/core/opencl/op_statistical.hxx 
b/sc/source/core/opencl/op_statistical.hxx
index 2741efe49656..827c6a0456af 100644
--- a/sc/source/core/opencl/op_statistical.hxx
+++ b/sc/source/core/opencl/op_statistical.hxx
@@ -149,12 +149,6 @@ class OpNormdist:public Normal{
 const std::string &sSymName, SubArguments &vSubArguments) override;
 virtual std::string BinFuncName() const override { return "OpNormdist"; }
 };
-class OpMedian:public Normal{
-public:
-virtual void GenSlidingWindowFunction(outputstream &ss,
-const std::string &sSymName, SubArguments &vSubArguments) override;
-virtual std::string BinFuncName() const override { return "OpMedian"; }
-};
 class OpNormsdist:public Normal{
 

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

2022-09-22 Thread Luboš Luňák (via logerrit)
 sc/source/core/opencl/op_financial.cxx |  158 +++---
 sc/source/core/opencl/op_financial_helpers.hxx |  650 ++---
 2 files changed, 132 insertions(+), 676 deletions(-)

New commits:
commit e0061a955ee2efed28c1632e06e44f1318c7878d
Author: Luboš Luňák 
AuthorDate: Thu Sep 22 09:55:32 2022 +0200
Commit: Luboš Luňák 
CommitDate: Thu Sep 22 18:06:39 2022 +0200

remove unused or duplicated opencl helper functions

These mostly exist in "old" and _new variants which are more or less
the same, sometimes there are minor differences. Keep just the _new
ones, everything still seems to work, all tests pass.

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

diff --git a/sc/source/core/opencl/op_financial.cxx 
b/sc/source/core/opencl/op_financial.cxx
index c3b5861a5fcf..6ab2874dc78b 100644
--- a/sc/source/core/opencl/op_financial.cxx
+++ b/sc/source/core/opencl/op_financial.cxx
@@ -99,9 +99,9 @@ void OpDollarfr::GenSlidingWindowFunction(outputstream &ss,
 void OpDISC::BinInlineFun(std::set& decls,
 std::set& funs)
 {
-decls.insert(GetYearFrac_newDecl);decls.insert(DaysToDate_newDecl);
+decls.insert(GetYearFracDecl);decls.insert(DaysToDateDecl);
 decls.insert(DaysInMonthDecl);decls.insert(IsLeapYearDecl);
-funs.insert(GetYearFrac_new);funs.insert(DaysToDate_new);
+funs.insert(GetYearFrac);funs.insert(DaysToDate);
 funs.insert(DaysInMonth);funs.insert(IsLeapYear);
 }
 
@@ -121,7 +121,7 @@ void OpDISC::GenSlidingWindowFunction(outputstream& ss,
 ss << "int nNullDate = 693594;\n";
 ss << "tmp = 1.0 - arg2 / arg3;\n";
 ss << "tmp /=";
-ss << " GetYearFrac_new(nNullDate, (int)arg0, (int)arg1, (int)arg4);\n";
+ss << " GetYearFrac(nNullDate, (int)arg0, (int)arg1, (int)arg4);\n";
 ss << "return tmp;\n";
 ss << "}";
 }
@@ -129,12 +129,12 @@ void OpDISC::GenSlidingWindowFunction(outputstream& ss,
 void OpINTRATE::BinInlineFun(std::set& decls,
 std::set& funs)
 {
-decls.insert(GetYearDiff_newDecl);decls.insert(GetDiffDate_newDecl);
-decls.insert(DaysToDate_newDecl);decls.insert(GetNullDateDecl);
+decls.insert(GetYearDiffDecl);decls.insert(GetDiffDateDecl);
+decls.insert(DaysToDateDecl);decls.insert(GetNullDateDecl);
 decls.insert(DateToDaysDecl);decls.insert(DaysInMonthDecl);
 decls.insert(IsLeapYearDecl);
-funs.insert(GetYearDiff_new);funs.insert(GetDiffDate_new);
-funs.insert(DaysToDate_new);funs.insert(GetNullDate);
+funs.insert(GetYearDiff);funs.insert(GetDiffDate);
+funs.insert(DaysToDate);funs.insert(GetNullDate);
 funs.insert(DateToDays);funs.insert(DaysInMonth);
 funs.insert(IsLeapYear);
 }
@@ -153,7 +153,7 @@ void OpINTRATE::GenSlidingWindowFunction(outputstream& ss,
 GenerateArg( 3, vSubArguments, ss );
 GenerateArg( 4, vSubArguments, ss );
 ss << "int nNullDate = GetNullDate();\n";
-ss << "tmp = ((arg3 / arg2) - 1) / GetYearDiff_new(nNullDate, 
(int)arg0,";
+ss << "tmp = ((arg3 / arg2) - 1) / GetYearDiff(nNullDate, (int)arg0,";
 ss << " (int)arg1,(int)arg4);\n";
 ss << "return tmp;\n";
 ss << "}";
@@ -289,12 +289,12 @@ void 
OpDuration_ADD::GenSlidingWindowFunction(outputstream& ss,
 void OpMDuration::BinInlineFun(std::set& decls,
 std::set& funs)
 {
-decls.insert(GetDuration_newDecl);decls.insert(lcl_Getcoupnum_newDecl);
+decls.insert(GetDurationDecl);decls.insert(lcl_GetcoupnumDecl);
 decls.insert(addMonthsDecl);decls.insert(checklessthanDecl);
 decls.insert(setDayDecl);decls.insert(ScaDateDecl);
 decls.insert(GetYearFracDecl);decls.insert(DaysToDateDecl);
 decls.insert(DaysInMonthDecl);decls.insert(IsLeapYearDecl);
-funs.insert(GetDuration_new);funs.insert(lcl_Getcoupnum_new);
+funs.insert(GetDuration);funs.insert(lcl_Getcoupnum);
 funs.insert(addMonths);funs.insert(checklessthan);
 funs.insert(setDay);funs.insert(ScaDate);
 funs.insert(GetYearFrac);funs.insert(DaysToDate);
@@ -316,7 +316,7 @@ void OpMDuration::GenSlidingWindowFunction(outputstream& ss,
 GenerateArg( 4, vSubArguments, ss );
 GenerateArg( 5, vSubArguments, ss );
 ss << "int nNullDate = 693594;\n";
-ss << "tmp = GetDuration_new( nNullDate, (int)arg0, (int)arg1, arg2,";
+ss << "tmp = GetDuration( nNullDate, (int)arg0, (int)arg1, arg2,";
 ss << " arg3, (int)arg4, (int)arg5);\n";
 ss << "tmp = tmp * pow(1.0 + arg3 * pow((int)arg4, -1.0), -1);\n";
 ss << "return tmp;\n";
@@ -712,10 +712,10 @@ void OpAccrintm::GenSlidingWindowFunction(
 ss << "}";
 }
 
- void OpYield::BinInlineFun(std::set& decls,
+void OpYield::BinInlineFun(std::set& decls,
 std::set& funs)
 {
-decls.insert(getYield_Decl);decls.insert(getPrice_Decl);
+decls.insert(getYield_Decl);decls.insert(getPriceDecl);
 d

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

2022-09-22 Thread Luboš Luňák (via logerrit)
 sc/source/core/opencl/formulagroupcl.cxx  |  213 +++---
 sc/source/core/opencl/op_math.cxx |   30 +++-
 sc/source/core/opencl/op_math.hxx |   12 +
 sc/source/core/opencl/op_math_helpers.hxx |   16 ++
 sc/source/core/opencl/opbase.cxx  |   78 ++
 sc/source/core/opencl/opbase.hxx  |   26 ++-
 6 files changed, 256 insertions(+), 119 deletions(-)

New commits:
commit 78c6e9efa8572fb8a681f562d057db8bef35c571
Author: Luboš Luňák 
AuthorDate: Thu Sep 22 09:55:27 2022 +0200
Commit: Luboš Luňák 
CommitDate: Thu Sep 22 18:06:13 2022 +0200

fix handling of string arguments in opencl

As one of the code comments said the code used string hashes to represent
strings and this was a broken idea. But the basic idea of that is actually
valid, so just implement that properly and use it only for comparing
strings. See the code comment in opbase.cxx for technical details.

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

diff --git a/sc/source/core/opencl/formulagroupcl.cxx 
b/sc/source/core/opencl/formulagroupcl.cxx
index 4f274749484b..967f52c4ce43 100644
--- a/sc/source/core/opencl/formulagroupcl.cxx
+++ b/sc/source/core/opencl/formulagroupcl.cxx
@@ -299,73 +299,8 @@ size_t VectorRef::Marshal( cl_kernel k, int argno, int, 
cl_program )
 return 1;
 }
 
-/// Arguments that are actually compile-time constant string
-/// Currently, only the hash is passed.
-/// TBD(IJSUNG): pass also length and the actual string if there is a
-/// hash function collision
-
-/// FIXME: This idea of passing of hashes of uppercased strings into OpenCL 
code is fairly potent
-/// crack. It is hopefully not used at all any more, but noticing that there 
are string arguments
-/// automatically disables use of OpenCL for a formula group. If at some point 
there are resources
-/// to drain the OpenCL swamp, this should go away.
-
 namespace {
 
-class ConstStringArgument : public DynamicKernelArgument
-{
-public:
-ConstStringArgument( const ScCalcConfig& config, const std::string& s,
-const FormulaTreeNodeRef& ft ) :
-DynamicKernelArgument(config, s, ft) { }
-/// Generate declaration
-virtual void GenDecl( outputstream& ss ) const override
-{
-ss << "unsigned " << mSymName;
-}
-virtual void GenDeclRef( outputstream& ss ) const override
-{
-ss << GenSlidingWindowDeclRef();
-}
-virtual void GenSlidingWindowDecl( outputstream& ss ) const override
-{
-GenDecl(ss);
-}
-virtual std::string GenSlidingWindowDeclRef( bool = false ) const override
-{
-outputstream ss;
-if (GetFormulaToken()->GetType() != formula::svString)
-throw Unhandled(__FILE__, __LINE__);
-FormulaToken* Tok = GetFormulaToken();
-ss << Tok->GetString().getString().toAsciiUpperCase().hashCode() << 
"U";
-return ss.str();
-}
-virtual size_t GetWindowSize() const override
-{
-return 1;
-}
-/// Pass the 32-bit hash of the string to the kernel
-virtual size_t Marshal( cl_kernel k, int argno, int, cl_program ) override
-{
-OpenCLZone zone;
-FormulaToken* ref = mFormulaTree->GetFormulaToken();
-cl_uint hashCode = 0;
-if (ref->GetType() != formula::svString)
-{
-throw Unhandled(__FILE__, __LINE__);
-}
-
-const OUString s = ref->GetString().getString().toAsciiUpperCase();
-hashCode = s.hashCode();
-
-// Pass the scalar result back to the rest of the formula kernel
-SAL_INFO("sc.opencl", "Kernel " << k << " arg " << argno << ": 
cl_uint: " << hashCode << "(" << DebugPeekData(ref) << ")" );
-cl_int err = clSetKernelArg(k, argno, sizeof(cl_uint), 
static_cast(&hashCode));
-if (CL_SUCCESS != err)
-throw OpenCLError("clSetKernelArg", err, __FILE__, __LINE__);
-return 1;
-}
-};
-
 class DynamicKernelPiArgument : public DynamicKernelArgument
 {
 public:
@@ -773,9 +708,65 @@ threefry2x32 (threefry2x32_ctr_t in, threefry2x32_key_t 
k)\n\
 }
 };
 
-}
+// Arguments that are actually compile-time constant string
+class ConstStringArgument : public DynamicKernelArgument
+{
+public:
+ConstStringArgument( const ScCalcConfig& config, const std::string& s,
+const FormulaTreeNodeRef& ft ) :
+DynamicKernelArgument(config, s, ft) { }
+/// Generate declaration
+virtual void GenDecl( outputstream& ss ) const override
+{
+ss << "double " << mSymName;
+}
+virtual void GenDeclRef( outputstream& ss ) const override
+{
+ss << GenSlidingWindowDeclRef();
+}
+virtual void GenSlidingWindowDecl( outputstream& ss ) const override
+{
+GenDecl(ss);
+}
+virtual std::string GenSlidingWindowDeclRef( bool = false ) 

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

2022-09-22 Thread Luboš Luňák (via logerrit)
 sc/source/core/opencl/op_math.cxx |   13 +++--
 1 file changed, 3 insertions(+), 10 deletions(-)

New commits:
commit 87e4520fdb661309da732c25a7ad58c7efd52a90
Author: Luboš Luňák 
AuthorDate: Thu Sep 22 09:55:22 2022 +0200
Commit: Luboš Luňák 
CommitDate: Thu Sep 22 18:01:17 2022 +0200

fix and simplify ocInt in opencl

This is what core does, it also extends the range (the casting to int
variant limited to the range of the int, which the core variant doesn't).

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

diff --git a/sc/source/core/opencl/op_math.cxx 
b/sc/source/core/opencl/op_math.cxx
index 481e5d14c6a4..1bf3e231b4a2 100644
--- a/sc/source/core/opencl/op_math.cxx
+++ b/sc/source/core/opencl/op_math.cxx
@@ -222,20 +222,13 @@ void OpInt::BinInlineFun(std::set& decls,
 {
 decls.insert(is_representable_integerDecl);
 funs.insert(is_representable_integer);
-decls.insert(approx_equalDecl);
-funs.insert(approx_equal);
+decls.insert(value_approxDecl);
+funs.insert(value_approx);
 }
 
 void OpInt::GenerateCode( outputstream& ss ) const
 {
-ss << "int intTmp = (int)arg0;\n";
-// check whether rounding error caused the float to be just less than the 
int value
-ss << "if( arg0 >=0 && approx_equal( intTmp + 1, arg0 ))\n";
-ss << "++intTmp;\n";
-// negative values are rounded down
-ss << "if( arg0 < 0 && !approx_equal( intTmp, arg0 ))\n";
-ss << "--intTmp;\n";
-ss << "return intTmp;\n";
+ss << "return floor( value_approx( arg0 ));\n";
 }
 
 void OpNegSub::GenerateCode( outputstream& ss ) const


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

2022-09-22 Thread Luboš Luňák (via logerrit)
 sc/source/core/opencl/op_math.cxx |   27 ---
 sc/source/core/opencl/op_math.hxx |   14 +-
 2 files changed, 5 insertions(+), 36 deletions(-)

New commits:
commit 799bde0490f2bcd0562e2c9a8d08709b472417b2
Author: Luboš Luňák 
AuthorDate: Thu Sep 22 09:55:18 2022 +0200
Commit: Luboš Luňák 
CommitDate: Thu Sep 22 18:00:51 2022 +0200

make ocTrunc and ocRoundDown the same in opencl

It's that way in core too.

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

diff --git a/sc/source/core/opencl/op_math.cxx 
b/sc/source/core/opencl/op_math.cxx
index 5e88f8f67a8e..481e5d14c6a4 100644
--- a/sc/source/core/opencl/op_math.cxx
+++ b/sc/source/core/opencl/op_math.cxx
@@ -1169,33 +1169,6 @@ void OpSumIf::GenSlidingWindowFunction(outputstream &ss,
 ss << "}";
 }
 
-void OpTrunc::GenSlidingWindowFunction(outputstream &ss,
-const std::string &sSymName, SubArguments &vSubArguments)
-{
-CHECK_PARAMETER_COUNT( 1, 2 );
-GenerateFunctionDeclaration( sSymName, vSubArguments, ss );
-ss << "{\n";
-ss << "int gid0=get_global_id(0);\n";
-GenerateArg( "arg0", 0, vSubArguments, ss );
-GenerateArgWithDefault( "arg1", 1, 0, vSubArguments, ss );
-ss << "double argm = arg0;\n";
-ss << "int n = (int)arg1;\n";
-ss << "double nn = 1.0f;\n";
-ss << "for(int i = 0; i < n; ++i)\n";
-ss << "{\n";
-ss << "argm = argm * 10;\n";
-ss << "nn = nn * 10;\n";
-ss << "}\n";
-ss << "for(int i = 0; i > n; --i)\n";
-ss << "{\n";
-ss << "argm = argm / 10;\n";
-ss << "nn = nn / 10;\n";
-ss << "}\n";
-ss << "modf(argm, &argm);\n";
-ss << "return argm / nn;\n";
-ss << "}\n";
-}
-
 void OpFloor::GenSlidingWindowFunction(
 outputstream &ss, const std::string &sSymName,
 SubArguments &vSubArguments)
diff --git a/sc/source/core/opencl/op_math.hxx 
b/sc/source/core/opencl/op_math.hxx
index a5adec2cb8aa..8ffe1ee779e5 100644
--- a/sc/source/core/opencl/op_math.hxx
+++ b/sc/source/core/opencl/op_math.hxx
@@ -177,15 +177,6 @@ public:
 virtual void GenerateCode( outputstream& ss ) const override;
 };
 
-class OpTrunc: public Normal
-{
-public:
-virtual void GenSlidingWindowFunction(outputstream &ss,
-const std::string &sSymName, SubArguments &vSubArguments) override;
-
-virtual std::string BinFuncName() const override { return "Trunc"; }
-};
-
 class OpArcTan2 : public OpMathTwoArguments
 {
 public:
@@ -272,6 +263,11 @@ public:
 const std::string &sSymName, SubArguments &vSubArguments) override;
 virtual std::string BinFuncName() const override { return "RoundDown"; }
 };
+class OpTrunc: public OpRoundDown
+{
+public:
+virtual std::string BinFuncName() const override { return "Trunc"; }
+};
 class OpInt: public OpMathOneArgument
 {
 public:


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

2022-09-22 Thread Luboš Luňák (via logerrit)
 sc/source/core/tool/compiler.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 1c1195a09e62d37ad5cd93709d7e2b72466c22b3
Author: Luboš Luňák 
AuthorDate: Thu Sep 22 09:55:12 2022 +0200
Commit: Luboš Luňák 
CommitDate: Thu Sep 22 18:00:35 2022 +0200

ocAnd/ocOr are not actually binary operators

They are listed in the SC_OPCODE_START_BIN_OP group, but AND(A1:A30)
is fine.

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

diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index fc97ae0a6bf7..e310794d1297 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -6185,7 +6185,8 @@ bool ScCompiler::HandleIIOpCodeInternal(FormulaToken* 
token, FormulaToken*** ppp
 mPendingImplicitIntersectionOptimizations.emplace_back( pppToken[0], 
token );
 return true;
 }
-else if ((nOpCode >= SC_OPCODE_START_BIN_OP && nOpCode < 
SC_OPCODE_STOP_BIN_OP)
+else if ((nOpCode >= SC_OPCODE_START_BIN_OP && nOpCode < 
SC_OPCODE_STOP_BIN_OP
+&& nOpCode != ocAnd && nOpCode != ocOr)
   || nOpCode == ocRound || nOpCode == ocRoundUp || nOpCode == 
ocRoundDown)
 {
 if (nNumParams != 2)


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

2022-09-22 Thread Luboš Luňák (via logerrit)
 sc/source/core/opencl/formulagroupcl.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 9f884bc933be1bffd25ba9c7b3a3343f942ff5dc
Author: Luboš Luňák 
AuthorDate: Thu Sep 22 09:55:09 2022 +0200
Commit: Luboš Luňák 
CommitDate: Thu Sep 22 18:00:16 2022 +0200

add SAL_INFO about which formula group will be interpreter by opencl

It's actually not said anywhere in the otherwise extensive opencl
debug output.

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

diff --git a/sc/source/core/opencl/formulagroupcl.cxx 
b/sc/source/core/opencl/formulagroupcl.cxx
index 90066abb3ff3..4f274749484b 100644
--- a/sc/source/core/opencl/formulagroupcl.cxx
+++ b/sc/source/core/opencl/formulagroupcl.cxx
@@ -3605,6 +3605,7 @@ bool FormulaGroupInterpreterOpenCL::interpret( 
ScDocument& rDoc,
 const ScAddress& rTopPos, ScFormulaCellGroupRef& xGroup,
 ScTokenArray& rCode )
 {
+SAL_INFO("sc.opencl", "Interpret cell group " << rTopPos);
 MergeCalcConfig(rDoc);
 
 genRPNTokens(rDoc, rTopPos, rCode);


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

2022-09-22 Thread Luboš Luňák (via logerrit)
 sc/source/core/opencl/op_math.cxx |   34 +-
 sc/source/core/opencl/op_math.hxx |1 
 sc/source/core/opencl/op_math_helpers.hxx |   26 ++
 3 files changed, 47 insertions(+), 14 deletions(-)

New commits:
commit af5aaddee5e752fcb38cf1550d8152089443196e
Author: Luboš Luňák 
AuthorDate: Thu Sep 22 09:55:05 2022 +0200
Commit: Luboš Luňák 
CommitDate: Thu Sep 22 17:59:53 2022 +0200

fix opencl ocMod

Basically copied from core.

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

diff --git a/sc/source/core/opencl/op_math.cxx 
b/sc/source/core/opencl/op_math.cxx
index cd2f2f8b5396..5e88f8f67a8e 100644
--- a/sc/source/core/opencl/op_math.cxx
+++ b/sc/source/core/opencl/op_math.cxx
@@ -391,23 +391,29 @@ void OpCombin::GenerateCode( outputstream& ss ) const
 ss << "return result;\n";
 }
 
+void OpMod::BinInlineFun(std::set& decls,std::set& 
funs)
+{
+decls.insert(is_representable_integerDecl);
+funs.insert(is_representable_integer);
+decls.insert(approx_equalDecl);
+funs.insert(approx_equal);
+decls.insert(fsub_approxDecl);
+funs.insert(fsub_approx);
+decls.insert(value_approxDecl);
+funs.insert(value_approx);
+}
+
 void OpMod::GenerateCode( outputstream& ss ) const
 {
-ss << "if(isnan(arg0)||arg0 == 0)\n";
-ss << "return 0;\n";
-ss << "if(isnan(arg1) || arg1 ==0)\n";
+ss << "double fNum = arg0;\n";
+ss << "double fDenom = arg1;\n";
+ss << "if(fDenom == 0)\n";
 ss << "return CreateDoubleError(DivisionByZero);\n";
-ss << "double tem;\n";
-ss << "if(arg0 < 0 && arg1 > 0)\n";
-ss << "while(arg0 < 0)\n";
-ss << "arg0 += arg1;\n";
-ss << "else if (arg0 > 0 && arg1 < 0)\n";
-ss << "while(arg0 > 0)\n";
-ss << "arg0 += arg1;\n";
-ss << "tem = fmod(arg0,arg1);\n";
-ss << "if(arg1 < 0 && tem > 0)\n";
-ss << "tem = -tem;\n";
-ss << "return tem;\n";
+ss << "double fRes = fsub_approx( fNum, floor( value_approx( fNum / 
fDenom )) * fDenom );\n";
+ss << "if ( ( fDenom > 0 && fRes >= 0 && fRes < fDenom ) ||\n";
+ss << " ( fDenom < 0 && fRes <= 0 && fRes > fDenom ) )\n";
+ss << "return fRes;\n";
+ss << "return CreateDoubleError(NoValue);\n";
 }
 
 void OpPower::GenerateCode( outputstream& ss ) const
diff --git a/sc/source/core/opencl/op_math.hxx 
b/sc/source/core/opencl/op_math.hxx
index 9ff5253d0ad5..a5adec2cb8aa 100644
--- a/sc/source/core/opencl/op_math.hxx
+++ b/sc/source/core/opencl/op_math.hxx
@@ -405,6 +405,7 @@ class OpMod: public OpMathTwoArguments
 public:
 virtual std::string BinFuncName() const override { return "Mod"; }
 virtual void GenerateCode( outputstream& ss ) const override;
+virtual void BinInlineFun(std::set& ,std::set& ) 
override;
 };
 
 class OpProduct: public Normal
diff --git a/sc/source/core/opencl/op_math_helpers.hxx 
b/sc/source/core/opencl/op_math_helpers.hxx
index 015afcf547fb..6a751dd9c35b 100644
--- a/sc/source/core/opencl/op_math_helpers.hxx
+++ b/sc/source/core/opencl/op_math_helpers.hxx
@@ -163,4 +163,30 @@ const char fsub_approx[] =
 "return a - b;\n"
 "}\n";
 
+const char value_approxDecl[] = "double value_approx( double fValue );\n";
+const char value_approx[] =
+"double value_approx( double fValue )\n"
+"{\n"
+"const double fBigInt = 219902322.0;\n"
+"if (fValue == 0.0 || fValue == HUGE_VAL || !isfinite(fValue))\n"
+"return fValue;\n"
+"double fOrigValue = fValue;\n"
+"fValue = fabs(fValue);\n"
+"if (fValue > fBigInt)\n"
+"return fOrigValue;\n"
+"if (is_representable_integer(fValue))\n" // TODO? || 
getBitsInFracPart(fValue) <= 11)\n"
+"return fOrigValue;\n"
+"int nExp = (int)(floor(log10(fValue)));\n"
+"nExp = 14 - nExp;\n"
+"double fExpValue = pow(10.0,nExp);\n"
+"fValue *= fExpValue;\n"
+"if (!isfinite(fValue))\n"
+"return fOrigValue;\n"
+"fValue = round(fValue);\n"
+"fValue /= fExpValue;\n"
+"if (!isfinite(fValue))\n"
+"return fOrigValue;\n"
+"return copysign(fValue, fOrigValue);\n"
+"}\n";
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


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

2022-09-22 Thread Luboš Luňák (via logerrit)
 sc/source/core/opencl/op_math_helpers.hxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 43f2cdb3b41ff4f5e99500f0c0082d4bfa4bc97c
Author: Luboš Luňák 
AuthorDate: Thu Sep 22 09:55:00 2022 +0200
Commit: Luboš Luňák 
CommitDate: Thu Sep 22 17:59:36 2022 +0200

fix incorrect as_double usage in opencl

as_double interprets the binary representation, it is not a cast.

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

diff --git a/sc/source/core/opencl/op_math_helpers.hxx 
b/sc/source/core/opencl/op_math_helpers.hxx
index 81fb8f5a8541..015afcf547fb 100644
--- a/sc/source/core/opencl/op_math_helpers.hxx
+++ b/sc/source/core/opencl/op_math_helpers.hxx
@@ -117,12 +117,12 @@ const char is_representable_integerDecl[] =  "int 
is_representable_integer(doubl
 const char is_representable_integer[] =
 "int is_representable_integer(double a) {\n"
 "long kMaxInt = (1L << 53) - 1;\n"
-"if (a <= as_double(kMaxInt))\n"
+"if (a <= (double)kMaxInt)\n"
 "{\n"
-"long nInt = as_long(a);\n"
+"long nInt = (long)a;\n"
 "double fInt;\n"
 "return (nInt <= kMaxInt &&\n"
-"(!((fInt = as_double(nInt)) < a) && !(fInt > a)));\n"
+"(!((fInt = (double)nInt) < a) && !(fInt > a)));\n"
 "}\n"
 "return 0;\n"
 "}\n";


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

2022-09-22 Thread Luboš Luňák (via logerrit)
 sc/source/core/opencl/formulagroupcl.cxx   |6 -
 sc/source/core/opencl/op_financial_helpers.hxx |   27 -
 sc/source/core/opencl/op_math.cxx  |  125 +++--
 sc/source/core/opencl/op_math.hxx  |7 -
 sc/source/core/opencl/op_math_helpers.hxx  |   27 +
 sc/source/core/opencl/op_statistical.cxx   |   72 +++---
 6 files changed, 132 insertions(+), 132 deletions(-)

New commits:
commit 64426b95bd6c9f1fe7a40c2f2bfabb43b1ce658c
Author: Luboš Luňák 
AuthorDate: Thu Sep 22 09:54:56 2022 +0200
Commit: Luboš Luňák 
CommitDate: Thu Sep 22 17:58:57 2022 +0200

fix opencl round(), roundup() and rounddown()

These are quite tricky due to rounding errors, the pown() used
to "shift" the decimal point left-right increases the rounding error,
so this must be compensated for. The round adjustment is based
on rtl_math_round(), the up/down variants check for valid 12 places.

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

diff --git a/sc/source/core/opencl/op_financial_helpers.hxx 
b/sc/source/core/opencl/op_financial_helpers.hxx
index 060ed6813566..da2314ecc20f 100644
--- a/sc/source/core/opencl/op_financial_helpers.hxx
+++ b/sc/source/core/opencl/op_financial_helpers.hxx
@@ -9,36 +9,9 @@
 
 #pragma once
 
-const char nCorrValDecl[] ="double constant nCorrVal[]"
-"= {0, 9e-1, 9e-2, 9e-3, 9e-4, 9e-5, 9e-6, 9e-7, "
-"9e-8,9e-9, 9e-10, 9e-11, 9e-12, 9e-13, 9e-14, 9e-15};\n";
-
 const char SCdEpsilonDecl[] =
 "constant double SCdEpsilon = 1.0E-7;\n";
 
-const char RoundDecl[] = "double  Round(double fValue);\n";
-
-const char Round[] =
-"double  Round(double fValue)\n"
-"{\n"
-"if ( fValue == 0.0  )\n"
-"return fValue;\n"
-"\n"
-"double fFac = 0;\n"
-"int nExp;\n"
-"if ( fValue > 0.0 )\n"
-"nExp = ( floor( log10( fValue ) ) );\n"
-"else\n"
-"nExp = 0;\n"
-"int nIndex = 15 - nExp;\n"
-"if ( nIndex > 15 )\n"
-"nIndex = 15;\n"
-"else if ( nIndex <= 1 )\n"
-"nIndex = 0;\n"
-"fValue = floor( fValue + 0.5 + nCorrVal[nIndex] );\n"
-"return fValue;\n"
-"}\n";
-
 const char GetPMTDecl[] =
 "double GetPMT( double fRate, double fNper, double fPv, double fFv, bool 
bPayInAdvance);\n";
 
diff --git a/sc/source/core/opencl/op_math.cxx 
b/sc/source/core/opencl/op_math.cxx
index 430f8734f5f0..cd2f2f8b5396 100644
--- a/sc/source/core/opencl/op_math.cxx
+++ b/sc/source/core/opencl/op_math.cxx
@@ -861,6 +861,13 @@ void OpAverageIfs::GenSlidingWindowFunction(outputstream 
&ss,
 ss << "}";
 }
 
+void OpRound::BinInlineFun(std::set& decls,std::set& 
funs)
+{
+decls.insert(nCorrValDecl);
+decls.insert(RoundDecl);
+funs.insert(Round);
+}
+
 void OpRound::GenSlidingWindowFunction(outputstream &ss,
  const std::string &sSymName, SubArguments &vSubArguments)
 {
@@ -868,25 +875,24 @@ void OpRound::GenSlidingWindowFunction(outputstream &ss,
 GenerateFunctionDeclaration( sSymName, vSubArguments, ss );
 ss << "{\n";
 ss << "int gid0=get_global_id(0);\n";
-ss << "int singleIndex =  gid0;\n";
-GenTmpVariables(ss,vSubArguments);
-CheckAllSubArgumentIsNan(ss,vSubArguments);
-if(vSubArguments.size() ==2)
-{
-ss << "for(int i=0;itmp1;i--)\n";
-ss << "tmp0 = tmp0 / 10;\n";
-}
-ss << "double tmp=round(tmp0);\n";
-if(vSubArguments.size() ==2)
+GenerateArg( "value", 0, vSubArguments, ss );
+if(vSubArguments.size() ==1)
+ss << "return round(value);\n";
+else
 {
-ss << "for(int i=0;itmp1;i--)\n";
-ss << "tmp = tmp * 10;\n";
+GenerateArg( "fDec", 1, vSubArguments, ss );
+ss << "int dec = floor( fDec );\n";
+ss << "if( dec < -20 || dec > 20 )\n";
+ss << "return CreateDoubleError( IllegalArgument );\n";
+ss << "if( dec == 0 )\n";
+ss << "return round(value);\n";
+ss << "double orig_value = value;\n";
+ss << "value = fabs(value);\n";
+ss << "double multiply = pown(10.0, dec);\n";
+ss << "double tmp = value*multiply;\n";
+ss << "tmp = Round( tmp );\n";
+ss << "return copysign(tmp/multiply, orig_value);\n";
 }
-ss << "return tmp;\n";
 ss << "}";
 }
 
@@ -897,32 +903,24 @@ void OpRoundUp::GenSlidingWindowFunction(outputstream &ss,
 GenerateFunctionDeclaration( sSymName, vSubArguments, ss );
 ss << "{\n";
 ss << "int gid0=get_global_id(0);\n";
-ss << "int singleIndex =  gid0;\n";
-ss << "int intTmp;\n";
-ss << "double tmp;\n";
-GenTmpVariables(ss,vSubArguments);
-CheckAllSubArgumentIsNan(ss,vSubArguments);
-if( vSubArguments.size() == 1 )
-ss << "double tmp1 = 0;\n";
-ss <

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

2022-09-22 Thread Luboš Luňák (via logerrit)
 sc/source/core/opencl/formulagroupcl.cxx   |2 
 sc/source/core/opencl/op_financial.cxx |  132 +++--
 sc/source/core/opencl/op_financial.hxx |6 -
 sc/source/core/opencl/op_financial_helpers.hxx |   91 +
 4 files changed, 133 insertions(+), 98 deletions(-)

New commits:
commit be36394708abf11a70be2be7591811b4fa6e81a6
Author: Luboš Luňák 
AuthorDate: Thu Sep 22 09:54:43 2022 +0200
Commit: Luboš Luňák 
CommitDate: Thu Sep 22 17:58:12 2022 +0200

fix opencl RATE()

Simply copy&paste&adjust the core implementation.

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

diff --git a/sc/source/core/opencl/formulagroupcl.cxx 
b/sc/source/core/opencl/formulagroupcl.cxx
index a8dc885d1aa0..067262cbd09b 100644
--- a/sc/source/core/opencl/formulagroupcl.cxx
+++ b/sc/source/core/opencl/formulagroupcl.cxx
@@ -2217,7 +2217,7 @@ 
DynamicKernelSoPArguments::DynamicKernelSoPArguments(const ScCalcConfig& config,
 mvSubArguments.push_back(SoPHelper(mCalcConfig, ts, 
ft->Children[i], std::make_shared(), nResultSize));
 break;
 case ocRate:
-mvSubArguments.push_back(SoPHelper(mCalcConfig, ts, 
ft->Children[i], std::make_shared(), nResultSize));
+mvSubArguments.push_back(SoPHelper(mCalcConfig, ts, 
ft->Children[i], std::make_shared(), nResultSize));
 break;
 case ocRRI:
 mvSubArguments.push_back(SoPHelper(mCalcConfig, ts, 
ft->Children[i], std::make_shared(), nResultSize));
diff --git a/sc/source/core/opencl/op_financial.cxx 
b/sc/source/core/opencl/op_financial.cxx
index 67326251f9d0..c3b5861a5fcf 100644
--- a/sc/source/core/opencl/op_financial.cxx
+++ b/sc/source/core/opencl/op_financial.cxx
@@ -1555,113 +1555,61 @@ void OpTbillprice::GenSlidingWindowFunction(
 ss << "}\n";
 }
 
-void RATE::BinInlineFun(std::set& decls,
+void OpRate::BinInlineFun(std::set& decls,
 std::set& funs)
 {
-decls.insert(nCorrValDecl);
-decls.insert(SCdEpsilonDecl);decls.insert(RoundDecl);
-funs.insert(Round);
+decls.insert(RateIterationDecl);
+funs.insert(RateIteration);
 }
 
-void RATE::GenSlidingWindowFunction(
+void OpRate::GenSlidingWindowFunction(
 outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments)
 {
-CHECK_PARAMETER_COUNT( 6, 6 );
+CHECK_PARAMETER_COUNT( 3, 6 );
 GenerateFunctionDeclaration( sSymName, vSubArguments, ss );
 ss << "{\n";
 ss << "int gid0 = get_global_id(0);\n";
-GenerateArg( "arg0", 0, vSubArguments, ss );
-GenerateArg( "arg1", 1, vSubArguments, ss );
-GenerateArg( "arg2", 2, vSubArguments, ss );
-GenerateArgWithDefault( "arg3", 3, 0, vSubArguments, ss );
-GenerateArgWithDefault( "arg4", 4, 0, vSubArguments, ss );
-GenerateArgWithDefault( "arg5", 5, 0.1, vSubArguments, ss );
-ss << "double result;\n";
-ss << "bool bValid = true, bFound = false;\n";
-ss << "double fX, fXnew, fTerm, fTermDerivation;\n";
-ss << "double fGeoSeries, fGeoSeriesDerivation;\n";
-ss << "int nIterationsMax = 150;\n";
-ss << "int nCount = 0;\n";
-ss << "double fEpsilonSmall = 1.0E-14;\n";
-ss << "if( arg0 <= 0 )\n";
+GenerateArg( "fNper", 0, vSubArguments, ss );
+GenerateArg( "fPayment", 1, vSubArguments, ss );
+GenerateArg( "fPv", 2, vSubArguments, ss );
+GenerateArgWithDefault( "fFv", 3, 0, vSubArguments, ss );
+GenerateArgWithDefault( "fPayType", 4, 0, vSubArguments, ss );
+ss << "bool bPayType = fPayType != 0;\n";
+if( vSubArguments.size() == 6 )
+{
+GenerateArgWithDefault( "fGuess", 5, 0.1, vSubArguments, ss );
+ss << "double fOrigGuess = fGuess;\n";
+ss << "bool bDefaultGuess = false;\n";
+}
+else
+{
+ss << "double fGuess = 0.1, fOrigGuess = 0.1;\n";
+ss << "bool bDefaultGuess = true;\n";
+}
+ss << "if( fNper <= 0 )\n";
 ss << "return CreateDoubleError(IllegalArgument);\n";
-ss << "arg3 = arg3 - arg1 * arg4;\n";
-ss << "arg2 = arg2 + arg1 * arg4;\n";
-ss << "if (arg0 == Round(arg0)){\n";
-ss << "fX = arg5;\n";
-ss << "double fPowN, fPowNminus1;\n";
-ss << "while (!bFound && nCount < nIterationsMax)\n";
+ss << "bool bValid = RateIteration(fNper, fPayment, fPv, fFv, 
bPayType, &fGuess);\n";
+ss << "if (!bValid)\n";
+ss << "{\n";
+ss << "if (bDefaultGuess)\n";
 ss << "{\n";
-ss << "fPowNminus1 = pow( 1.0+fX, arg0-1.0);\n";
-ss << "fPowN = fPowNminus1 * (1.0+fX);\n";
-ss << "if (fX == 0.0)\n";
+ss << "double fX = fOrigGuess;\n";
+ss << "for (int nStep = 2;

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

2022-09-22 Thread Caolán McNamara (via logerrit)
 i18nutil/source/utility/paper.cxx |6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

New commits:
commit 7d95a22245e3a031016e403aafddc00a73008b74
Author: Caolán McNamara 
AuthorDate: Thu Sep 22 15:28:46 2022 +0100
Commit: Caolán McNamara 
CommitDate: Thu Sep 22 16:30:38 2022 +0200

Revert "Related: tdf#151107 make "sloppy" paper fit up to 1.25pt"

mistook user verified +1 for jenkins +1

This reverts commit b15f7297a7f2bb3cb54f2a787d1c460adc2ac6fe.

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

diff --git a/i18nutil/source/utility/paper.cxx 
b/i18nutil/source/utility/paper.cxx
index f6871e655f58..1976880a060d 100644
--- a/i18nutil/source/utility/paper.cxx
+++ b/i18nutil/source/utility/paper.cxx
@@ -165,11 +165,7 @@ const PageDesc aDinTab[] =
 
 const size_t nTabSize = SAL_N_ELEMENTS(aDinTab);
 
-// tdf#151107 make this not just large enough for rounding errors on our side
-// but also large enough to match where the ppd side rounded up to the next
-// point. Seen with C5/C6/C65 envelopes which can be found over 1 point away
-// from the values in aDinTab
-#define MAXSLOPPY PT2MM100(1.25)
+#define MAXSLOPPY 21
 
 void PaperInfo::doSloppyFit(bool bAlsoTryRotated)
 {


ESC meeting minutes: 2022-09-22

2022-09-22 Thread Miklos Vajna

* Present:
+ Kendy, Michael W, Caolan, Cloph, Heiko, Tomaz, Ilmari, Michael S, 
Hossein, Gabriel, Miklos, Eike, Xisco, Lubos

* Completed Action Items:
+ None

* Pending Action Items:
+ None

* Release Engineering update (Cloph)
+ 7.4 status: 7.4.2 rc2 in 2 weeks
+ 7.3 status: 7.3.7 rc1 in 3 weeks
+ Appstores
  + live on the Mac App Store, first reviews were positive
+ one upset, had to re-pay
+ vouchers? (Caolan)
  + not clear how to do it, but some limited possibility (Cloph)
  + MS Store is still waiting

* Documentation (Olivier)
+ Bugzilla Documentation statistics
240(240) bugs open
+ Updates:
BZ changes   1 week   1 month   3 months   12 months
   created  6(-4)   30(3)  80(-9) 310(-5)
 commented 24(8)66(21)174(-13)   1338(-18)
  resolved  1(-1)   12(1)  39(-5) 195(-3)
+ top 10 contributors:
  Olivier Hallot made 29 changes in 1 month, and 492 changes in 1 year
  Rafael Lima made 20 changes in 1 month, and 241 changes in 1 year
  Roman Kuznetsov made 13 changes in 1 month, and 31 changes in 1 year
  Heiko Tietze made 11 changes in 1 month, and 103 changes in 1 year
  Tuomas Hietala made 8 changes in 1 month, and 9 changes in 1 year
  Foote, V Stuart made 8 changes in 1 month, and 30 changes in 1 year
  Ilmari Lauhakangas made 7 changes in 1 month, and 113 changes in 1 
year
  Stéphane Guillou made 7 changes in 1 month, and 14 changes in 1 year
  Alain Romedenne made 5 changes in 1 month, and 36 changes in 1 year
  Kaganski, Mike made 4 changes in 1 month, and 116 changes in 1 year

* UX Update (Heiko)
+ Bugzilla (topicUI) statistics
272(272) (topicUI) bugs open, 49(49) (needsUXEval) needs to be 
evaluated by the UXteam
+ Updates:
BZ changes   1 week   1 month3 months   12 months
 added  6(4) 10(-2) 16(1)   39(1)
 commented 58(3)199(-12)   444(-2)2165(1)
   removed  0(-1) 4(-2)  8(0)   32(-1)
  resolved  9(2) 33(4)  74(5)  312(0)
+ top 10 contributors:
  Heiko Tietze made 156 changes in 1 month, and 1504 changes in 1 year
  Roman Kuznetsov made 39 changes in 1 month, and 181 changes in 1 year
  Rafael Lima made 37 changes in 1 month, and 136 changes in 1 year
  Foote, V Stuart made 25 changes in 1 month, and 243 changes in 1 year
  Kaganski, Mike made 21 changes in 1 month, and 151 changes in 1 year
  Timur made 17 changes in 1 month, and 90 changes in 1 year
  Rathke, Eike made 14 changes in 1 month, and 20 changes in 1 year
  Hossein made 11 changes in 1 month, and 50 changes in 1 year
  Eyal Rozenberg made 9 changes in 1 month, and 90 changes in 1 year
  Stéphane Guillou made 9 changes in 1 month, and 40 changes in 1 year

+ [Bug 151121] Need ability to determine which fallback font is used
+ [Bug 151119] Font (family) selection UI elements should allow searching
   by substring
+ [Bug 151106] Unify localized shortcuts
+ [Bug 151108] In Draw the Ctrl+M shortcut should create a New Page as in 
Impress
+ [Bug 151099] Add "Insert > Field >Custom Properties" in DRAW
 -> + [Bug 140760] (PIVOTTABLE) selection of invalid constraint values possible
   and probably this irreversibly results in an empty pivot table
   + brings back bug 117276? [ was fixed by Balazs V, Samuel, Eike, etc]
+ [Bug 151088] Rename "Invoice Paper" to "Kraft Paper"
+ [Bug 151063] Rename "Index marks" to "Index entries" (if the latter is 
correct)
+ [Bug 115645] Should be able to permanently delete comments with track
   changes enabled.
+ [Bug 151044] [gtk4] unable to reach some menu items in long menus on small
   screens
 -> + [Bug 151041] Changing right page margin changes horizontal scrolling 
position
   + keep the view port when changing attributes?
+ [Bug 151017] Start Center: Thumbnail filter: description text "Filter:" 
font
   color does not adapt dark mode, unreadable
+ [Bug 151002] Confusing radio button placement in Text flow tab of Table
   Properties dialog
+ [Bug 150994] Rename the "Quotations" paragraph style
+ [Bug 150977] Create option to position sidebar to the left/right side for 
all
   LO applications
+ [Bug 136928] Wrong tabs icons in dark theme with KDE

* Crash Testing (Caolan)
+ 41(-41) import failure, 12(-30) export failures
  - two fixes gone in since run was started
+ 1 coverity issue
  - fix submitted
  - usable again after coverity (software) update
+ 5 ossfuzz issues, 1 crash, 2 timeouts, 1 leak, 1 OOM

* Crash Reporting (Xisco)
   + https://crashreport.libreoffice.org/stats/version/7.3.5.2
 + (+73) 1372 1299 1129 1355 1196 86

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

2022-09-22 Thread Szymon Kłos (via logerrit)
 sw/source/uibase/uiview/formatclipboard.cxx |   14 ++
 1 file changed, 6 insertions(+), 8 deletions(-)

New commits:
commit d818fbc65db108ee74d695b4a6cd1bce190a0cfe
Author: Szymon Kłos 
AuthorDate: Thu Sep 1 16:37:30 2022 +0200
Commit: Szymon Kłos 
CommitDate: Thu Sep 22 16:06:19 2022 +0200

sw: fix format brush to override old format

It should not only add attributes but replace old direct
formatting with new one (character format).

Change-Id: Ieac5c3d8c00b93ee08c74a36ea2ce4938915a2b9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139216
Tested-by: Jenkins
Reviewed-by: Szymon Kłos 
(cherry picked from commit 2515ada695e9dbb92c3a228d0466d76b23a6185d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140380
Tested-by: Jenkins CollaboraOffice 

diff --git a/sw/source/uibase/uiview/formatclipboard.cxx 
b/sw/source/uibase/uiview/formatclipboard.cxx
index 881a3f0109b5..c9c2a01b995c 100644
--- a/sw/source/uibase/uiview/formatclipboard.cxx
+++ b/sw/source/uibase/uiview/formatclipboard.cxx
@@ -542,6 +542,12 @@ void SwFormatClipboard::Paste( SwWrtShell& rWrtShell, 
SfxStyleSheetBasePool* pPo
 // copy the stored automatic text attributes in a temporary 
SfxItemSet
 pTemplateItemSet->Put( *m_pItemSet_TextAttr );
 
+// reset all direct formatting
+o3tl::sorted_vector aAttrs;
+for( sal_uInt16 nWhich = RES_CHRATR_BEGIN; nWhich < 
RES_CHRATR_END; nWhich++ )
+aAttrs.insert( nWhich );
+rWrtShell.ResetAttr( { aAttrs } );
+
 // only attributes that were not apply by named style 
attributes and automatic
 // paragraph attributes should be applied
 lcl_RemoveEqualItems( *pTemplateItemSet, aItemVector );
@@ -551,14 +557,6 @@ void SwFormatClipboard::Paste( SwWrtShell& rWrtShell, 
SfxStyleSheetBasePool* pPo
 rWrtShell.SetFlyFrameAttr(*pTemplateItemSet);
 else if ( !bNoCharacterFormats )
 {
-const SfxPoolItem* pItem;
-SfxItemSetFixed aSet(rWrtShell.GetAttrPool());
-rWrtShell.GetCurAttr(aSet);
-if (!pTemplateItemSet->HasItem(RES_CHRATR_CROSSEDOUT, 
&pItem))
-{
-rWrtShell.ResetAttr({ RES_CHRATR_CROSSEDOUT });
-}
-
 rWrtShell.SetAttrSet(*pTemplateItemSet);
 }
 }


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

2022-09-22 Thread Laurent BP (via logerrit)
 sc/qa/uitest/calc_tests/goToSheet.py |   64 +++
 1 file changed, 64 insertions(+)

New commits:
commit 7251b2ecd728bb6bd1af4cc4199da3f06e2e1ca3
Author: Laurent BP 
AuthorDate: Sat Jun 11 10:08:58 2022 +0200
Commit: Xisco Fauli 
CommitDate: Thu Sep 22 15:53:27 2022 +0200

tdf#129674 "Go to Sheet" UITest

Add UITest to new dialog
   Sheet > Navigate > Go to Sheet
Check search entry behavior

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

diff --git a/sc/qa/uitest/calc_tests/goToSheet.py 
b/sc/qa/uitest/calc_tests/goToSheet.py
new file mode 100644
index ..ab2311374b71
--- /dev/null
+++ b/sc/qa/uitest/calc_tests/goToSheet.py
@@ -0,0 +1,64 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# 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/.
+#
+from uitest.framework import UITestCase
+from uitest.uihelper.common import get_state_as_dict
+from libreoffice.uno.propertyvalue import mkPropertyValues
+
+class goToSheet(UITestCase):
+def test_go_to_sheet(self):
+with self.ui_test.create_doc_in_start_center("calc") as document:
+
+xCalcDoc = self.xUITest.getTopFocusWindow()
+xGridWindow = xCalcDoc.getChild("grid_window")
+
+for i in range(3):
+with 
self.ui_test.execute_dialog_through_command(".uno:Insert"):
+pass
+
+with 
self.ui_test.execute_dialog_through_command(".uno:RenameTable") as 
xDialogRename:
+xname_entry = xDialogRename.getChild("name_entry")
+xname_entry.executeAction("TYPE", 
mkPropertyValues({"TEXT":"NewName"}))
+
+with 
self.ui_test.execute_dialog_through_command(".uno:JumpToTable") as 
xDialogGoToSheet:
+xentry_mask = xDialogGoToSheet.getChild("entry-mask")
+xtree_view = xDialogGoToSheet.getChild("treeview")
+
+# Empty mask lists all sheets
+self.assertEqual(get_state_as_dict(xtree_view)["Children"], 
"4")
+
+# None sheet contains 'E': Search entry is case sensitive
+xentry_mask.executeAction("TYPE", 
mkPropertyValues({"TEXT":"E"}))
+self.assertEqual(get_state_as_dict(xtree_view)["Children"], 
"0")
+
+xentry_mask.executeAction("TYPE", 
mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+self.assertEqual(get_state_as_dict(xtree_view)["Children"], 
"4")
+
+# All sheets contains 'e'
+xentry_mask.executeAction("TYPE", 
mkPropertyValues({"TEXT":"e"}))
+self.assertEqual(get_state_as_dict(xtree_view)["Children"], 
"4")
+
+# List Sheet3, Sheet2 and Sheet1
+xentry_mask.executeAction("TYPE", 
mkPropertyValues({"TEXT":"e"}))
+self.assertEqual(get_state_as_dict(xtree_view)["Children"], 
"3")
+
+#if no name selected, active sheet remains unchanged
+self.assertEqual(get_state_as_dict(xGridWindow)["SelectedTable"], 
"0")
+
+with 
self.ui_test.execute_dialog_through_command(".uno:JumpToTable") as 
xDialogGoToSheet:
+xentry_mask = xDialogGoToSheet.getChild("entry-mask")
+xtree_view = xDialogGoToSheet.getChild("treeview")
+# List Sheet3, Sheet2 and Sheet1
+xentry_mask.executeAction("TYPE", 
mkPropertyValues({"TEXT":"ee"}))
+self.assertEqual(get_state_as_dict(xtree_view)["Children"], 
"3")
+# Select Sheet2
+xtree_view.getChild('1').executeAction("SELECT", tuple())
+
+self.assertEqual(get_state_as_dict(xGridWindow)["SelectedTable"], 
"2")
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:


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

2022-09-22 Thread Noel Grandin (via logerrit)
 chart2/source/controller/inc/ChartController.hxx|2 +-
 chart2/source/controller/main/ChartController.cxx   |2 +-
 chart2/source/controller/main/ChartController_Tools.cxx |2 +-
 include/svx/SvxColorValueSet.hxx|2 +-
 include/svx/svdotext.hxx|2 +-
 include/svx/xgrad.hxx   |2 +-
 include/svx/xmlgrhlp.hxx|2 +-
 svx/source/svdraw/svdotxat.cxx  |4 ++--
 svx/source/tbxctrls/PaletteManager.cxx  |2 +-
 svx/source/tbxctrls/SvxColorValueSet.cxx|4 ++--
 svx/source/xml/xmlgrhlp.cxx |6 +++---
 svx/source/xoutdev/xattr.cxx|6 +++---
 12 files changed, 18 insertions(+), 18 deletions(-)

New commits:
commit eaedd8f968aa200f49a15000f41ee1126004b5e7
Author: Noel Grandin 
AuthorDate: Thu Sep 22 11:42:13 2022 +0200
Commit: Noel Grandin 
CommitDate: Thu Sep 22 15:41:08 2022 +0200

use more string_view in svx

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

diff --git a/chart2/source/controller/inc/ChartController.hxx 
b/chart2/source/controller/inc/ChartController.hxx
index 0e913961f2c8..f777de00ece7 100644
--- a/chart2/source/controller/inc/ChartController.hxx
+++ b/chart2/source/controller/inc/ChartController.hxx
@@ -504,7 +504,7 @@ private:
 void executeDispatch_LOKSetTextSelection(int nType, int nX, int nY);
 void executeDispatch_LOKPieSegmentDragging(int nOffset);
 void executeDispatch_FillColor(sal_uInt32 nColor);
-void executeDispatch_FillGradient(OUString sJSONGradient);
+void executeDispatch_FillGradient(std::u16string_view sJSONGradient);
 void executeDispatch_LineColor(sal_uInt32 nColor);
 void executeDispatch_LineWidth(sal_uInt32 nWidth);
 
diff --git a/chart2/source/controller/main/ChartController.cxx 
b/chart2/source/controller/main/ChartController.cxx
index 85c7c41439a3..bac40f686d51 100644
--- a/chart2/source/controller/main/ChartController.cxx
+++ b/chart2/source/controller/main/ChartController.cxx
@@ -1124,7 +1124,7 @@ void SAL_CALL ChartController::dispatch(
 }
 else if(aCommand.startsWith("FillGradient"))
 {
-this->executeDispatch_FillGradient(aCommand.copy(aCommand.indexOf('=') 
+ 1));
+
this->executeDispatch_FillGradient(aCommand.subView(aCommand.indexOf('=') + 1));
 }
 else if(aCommand == "Paste")
 this->executeDispatch_Paste();
diff --git a/chart2/source/controller/main/ChartController_Tools.cxx 
b/chart2/source/controller/main/ChartController_Tools.cxx
index ee036e9cff01..e2f11c7eb655 100644
--- a/chart2/source/controller/main/ChartController_Tools.cxx
+++ b/chart2/source/controller/main/ChartController_Tools.cxx
@@ -955,7 +955,7 @@ void ChartController::executeDispatch_FillColor(sal_uInt32 
nColor)
 }
 }
 
-void ChartController::executeDispatch_FillGradient(OUString sJSONGradient)
+void ChartController::executeDispatch_FillGradient(std::u16string_view 
sJSONGradient)
 {
 XGradient aXGradient = XGradient::fromJSON(sJSONGradient);
 css::awt::Gradient aGradient = aXGradient.toGradientUNO();
diff --git a/include/svx/SvxColorValueSet.hxx b/include/svx/SvxColorValueSet.hxx
index 1872b58fdf04..1037734a2121 100644
--- a/include/svx/SvxColorValueSet.hxx
+++ b/include/svx/SvxColorValueSet.hxx
@@ -39,7 +39,7 @@ public:
 static sal_uInt32 getColumnCount();
 
 void addEntriesForXColorList(const XColorList& rXColorList, sal_uInt32 
nStartIndex = 1);
-void addEntriesForColorSet(const std::set& rColorSet, const 
OUString& rNamePrefix);
+void addEntriesForColorSet(const std::set& rColorSet, 
std::u16string_view rNamePrefix);
 Size layoutAllVisible(sal_uInt32 nEntryCount);
 void layoutToGivenHeight(sal_uInt32 nHeight, sal_uInt32 nEntryCount);
 
diff --git a/include/svx/svdotext.hxx b/include/svx/svdotext.hxx
index 6b1a61e08a69..6041a74fe0aa 100644
--- a/include/svx/svdotext.hxx
+++ b/include/svx/svdotext.hxx
@@ -259,7 +259,7 @@ private:
 static void AppendFamilyToStyleName(OUString& styleName, SfxStyleFamily 
family);
 
 /** Reads the style family from a style name to which the family has been 
appended. */
-static SfxStyleFamily ReadFamilyFromStyleName(const OUString& styleName);
+static SfxStyleFamily ReadFamilyFromStyleName(std::u16string_view 
styleName);
 
 protected:
 bool ImpCanConvTextToCurve() const;
diff --git a/include/svx/xgrad.hxx b/include/svx/xgrad.hxx
index 93a2f00655f4..553dfe23b93b 100644
--- a/include/svx/xgrad.hxx
+++ b/include/svx/xgrad.hxx
@@ -77,7 +77,7 @@ public:
 sal_uInt16 GetSteps() const { return nStepCount; }
 
 boost::property_tree::ptree dumpAsJSON() const;
-static XGradient fromJSON(const OUString& r

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

2022-09-22 Thread Noel Grandin (via logerrit)
 sw/source/core/crsr/findattr.cxx |8 
 sw/source/core/crsr/findfmt.cxx  |4 ++--
 sw/source/core/crsr/pam.cxx  |   34 --
 sw/source/core/crsr/paminit.cxx  |2 ++
 sw/source/core/inc/pamtyp.hxx|4 
 5 files changed, 44 insertions(+), 8 deletions(-)

New commits:
commit d6a1408ca7ac16994467d1ec6ea9a3d86abae854
Author: Noel Grandin 
AuthorDate: Thu Sep 22 11:20:03 2022 +0200
Commit: Noel Grandin 
CommitDate: Thu Sep 22 15:17:51 2022 +0200

add a function to SwMoveFnCollection to move a SwPosition

part of the process of hiding the internals of SwPosition

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

diff --git a/sw/source/core/crsr/findattr.cxx b/sw/source/core/crsr/findattr.cxx
index fbbea5cb7846..20d52b2a95c7 100644
--- a/sw/source/core/crsr/findattr.cxx
+++ b/sw/source/core/crsr/findattr.cxx
@@ -931,12 +931,12 @@ bool FindAttrImpl(SwPaM & rSearchPam,
 ? oPam->GetPoint()->GetContentIndex() == 
oPam->GetPointContentNode()->Len()
 : !oPam->GetPoint()->GetContentIndex() )
 {
-if( !(*fnMove.fnNds)( &oPam->GetPoint()->nNode, false ))
+if( !(*fnMove.fnPos)( oPam->GetPoint(), false ))
 {
 return false;
 }
 SwContentNode *pNd = oPam->GetPointContentNode();
-oPam->GetPoint()->nContent.Assign( pNd, bSrchForward ? 0 : pNd->Len() 
);
+oPam->GetPoint()->SetContent( bSrchForward ? 0 : pNd->Len() );
 }
 
 while (nullptr != (pNode = ::GetNode(*oPam, bFirst, fnMove, bInReadOnly, 
pLayout)))
@@ -1069,12 +1069,12 @@ static bool FindAttrsImpl(SwPaM & rSearchPam,
 ? oPam->GetPoint()->GetContentIndex() == 
oPam->GetPointContentNode()->Len()
 : !oPam->GetPoint()->GetContentIndex() ) )
 {
-if( !(*fnMove.fnNds)( &oPam->GetPoint()->nNode, false ))
+if( !(*fnMove.fnPos)( oPam->GetPoint(), false ))
 {
 return false;
 }
 SwContentNode *pNd = oPam->GetPointContentNode();
-oPam->GetPoint()->nContent.Assign( pNd, bSrchForward ? 0 : pNd->Len() 
);
+oPam->GetPoint()->SetContent( bSrchForward ? 0 : pNd->Len() );
 }
 
 while (nullptr != (pNode = ::GetNode(*oPam, bFirst, fnMove, bInReadOnly, 
pLayout)))
diff --git a/sw/source/core/crsr/findfmt.cxx b/sw/source/core/crsr/findfmt.cxx
index d5b0eb4656b5..aa6d9b48468c 100644
--- a/sw/source/core/crsr/findfmt.cxx
+++ b/sw/source/core/crsr/findfmt.cxx
@@ -40,12 +40,12 @@ bool FindFormatImpl(SwPaM & rSearchPam,
 ? oPam->GetPoint()->GetContentIndex() == 
oPam->GetPointContentNode()->Len()
 : !oPam->GetPoint()->GetContentIndex() )
 {
-if( !(*fnMove.fnNds)( &oPam->GetPoint()->nNode, false ))
+if( !(*fnMove.fnPos)( oPam->GetPoint(), false ))
 {
 return false;
 }
 SwContentNode *pNd = oPam->GetPoint()->GetNode().GetContentNode();
-oPam->GetPoint()->nContent.Assign( pNd, bSrchForward ? 0 : pNd->Len() 
);
+oPam->GetPoint()->SetContent( bSrchForward ? 0 : pNd->Len() );
 }
 
 bool bFirst = true;
diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx
index 2b4e8cc0bf9c..a00ccc8224ef 100644
--- a/sw/source/core/crsr/pam.cxx
+++ b/sw/source/core/crsr/pam.cxx
@@ -421,6 +421,36 @@ SwContentNode* GoPreviousNds( SwNodeIndex * pIdx, bool 
bChk )
 return pNd;
 }
 
+SwContentNode* GoNextPos( SwPosition* pIdx, bool bChk )
+{
+SwNodeIndex aIdx( pIdx->GetNode() );
+SwContentNode* pNd = aIdx.GetNodes().GoNext( &aIdx );
+if( pNd )
+{
+if( bChk && SwNodeOffset(1) != aIdx.GetIndex() - pIdx->GetNodeIndex() 
&&
+!CheckNodesRange( pIdx->GetNode(), aIdx.GetNode(), true ) )
+pNd = nullptr;
+else
+pIdx->Assign(aIdx);
+}
+return pNd;
+}
+
+SwContentNode* GoPreviousPos( SwPosition * pIdx, bool bChk )
+{
+SwNodeIndex aIdx( pIdx->GetNode() );
+SwContentNode* pNd = SwNodes::GoPrevious( &aIdx );
+if( pNd )
+{
+if( bChk && SwNodeOffset(1) != pIdx->GetNodeIndex() - aIdx.GetIndex() 
&&
+!CheckNodesRange( pIdx->GetNode(), aIdx.GetNode(), true ) )
+pNd = nullptr;
+else
+pIdx->Assign(aIdx);
+}
+return pNd;
+}
+
 SwPaM::SwPaM( const SwPosition& rPos, SwPaM* pRing )
 : Ring( pRing )
 , m_Bound1( rPos )
@@ -1132,9 +1162,9 @@ bool GoInSection( SwPaM & rPam, SwMoveFnCollection const 
& fnMove )
 
 bool GoInNode( SwPaM & rPam, SwMoveFnCollection const & fnMove )
 {
-SwContentNode *pNd = (*fnMove.fnNds)( &rPam.GetPoint()->nNode, true );
+SwContentNode *pNd = (*fnMove.fnPos)( rPam.GetPoint(), true );
 if( pNd )
-rPam.GetPoint()->nContent.Assign( pNd,
+rPam.GetPoint()->SetContent(
 ::GetSttOrEnd( &fnMove == &fnMoveForwa

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

2022-09-22 Thread Noel Grandin (via logerrit)
 vcl/inc/sft.hxx |   26 
 vcl/inc/unx/fontmanager.hxx |3 
 vcl/source/fontsubset/sft.cxx   |  190 ++---
 vcl/source/fontsubset/ttcr.cxx  |  930 +---
 vcl/source/fontsubset/ttcr.hxx  |  242 ---
 vcl/unx/generic/fontmanager/fontmanager.cxx |   63 -
 6 files changed, 598 insertions(+), 856 deletions(-)

New commits:
commit 590796ca0866168e3129d2abd0a0197114cddcdc
Author: Noel Grandin 
AuthorDate: Wed Sep 21 20:44:42 2022 +0200
Commit: Noel Grandin 
CommitDate: Thu Sep 22 14:48:27 2022 +0200

convert TrueTypeTable to C++ class

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

diff --git a/vcl/inc/sft.hxx b/vcl/inc/sft.hxx
index a870baf57033..05f62de655ec 100644
--- a/vcl/inc/sft.hxx
+++ b/vcl/inc/sft.hxx
@@ -124,7 +124,7 @@ namespace vcl
 typedef struct {
 sal_uInt32 glyphID; /**< glyph ID  
 */
 sal_uInt16 nbytes;  /**< number of bytes in glyph 
data  */
-sal_uInt8  *ptr; /**< pointer to glyph data
  */
+std::unique_ptr ptr;   /**< pointer to glyph data 
 */
 sal_uInt16 aw;  /**< advance width 
 */
 sal_Int16  lsb; /**< left sidebearing  
 */
 bool compflag;  /**< false- if non-composite */
@@ -135,14 +135,13 @@ namespace vcl
 } GlyphData;
 
 /** Structure used by the TrueType Creator and CreateTTFromTTGlyphs() */
-typedef struct {
+struct NameRecord {
 sal_uInt16 platformID;  /**< Platform ID   
 */
 sal_uInt16 encodingID;  /**< Platform-specific 
encoding ID  */
 LanguageType languageID;/**< Language ID   
 */
 sal_uInt16 nameID;  /**< Name ID   
 */
-sal_uInt16 slen;/**< String length in bytes
 */
-sal_uInt8  *sptr;/**< Pointer to string data 
(not zero-terminated!)  */
-} NameRecord;
+std::vector sptr;/**< string data (not 
zero-terminated!)  */
+};
 
 /** Return value of GetTTGlobalFontInfo() */
 
@@ -535,7 +534,7 @@ class TrueTypeFace;
  * @ingroup sft
  *
  */
-GlyphData *GetTTRawGlyphData(AbstractTrueTypeFont *ttf, sal_uInt32 
glyphID);
+std::unique_ptr GetTTRawGlyphData(AbstractTrueTypeFont *ttf, 
sal_uInt32 glyphID);
 
 /**
  * For a specified glyph adds all component glyphs IDs to the list and
@@ -559,23 +558,12 @@ class TrueTypeFace;
  * array of NameRecord structs
  *
  * @param ttf   pointer to the TrueTypeFont struct
- * @param nrpointer to the array of NameRecord structs
+ * @param nrreference to the vector of NameRecord structs
  *
- * @return  number of NameRecord structs
  * @ingroup sft
  */
 
-int GetTTNameRecords(AbstractTrueTypeFont const *ttf, NameRecord **nr);
-
-/**
- * Deallocates previously allocated array of NameRecords.
- *
- * @param nrarray of NameRecord structs
- * @param n number of elements in the array
- *
- * @ingroup sft
- */
-void DisposeNameRecords(NameRecord* nr, int n);
+void GetTTNameRecords(AbstractTrueTypeFont const *ttf, 
std::vector& nr);
 
 /**
  * Generates a new PostScript Type 3 font and dumps it to outf file.
diff --git a/vcl/inc/unx/fontmanager.hxx b/vcl/inc/unx/fontmanager.hxx
index 059ffe1a7e58..2ec06afcb435 100644
--- a/vcl/inc/unx/fontmanager.hxx
+++ b/vcl/inc/unx/fontmanager.hxx
@@ -50,6 +50,7 @@ namespace vcl::font
 {
 class FontSelectPattern;
 }
+namespace vcl { struct NameRecord; }
 class GenericUnixSalData;
 
 namespace psp {
@@ -154,7 +155,7 @@ class VCL_PLUGIN_PUBLIC PrintFontManager
 OString getFontFile(const PrintFont& rFont) const;
 
 std::vector analyzeFontFile(int nDirID, const OString& 
rFileName, const char *pFormat=nullptr) const;
-static OUString convertSfntName( void* pNameRecord ); // actually a 
NameRecord* format font subsetting code
+static OUString convertSfntName( const vcl::NameRecord& rNameRecord ); // 
format font subsetting code
 static void analyzeSfntFamilyName( void const * pTTFont, std::vector< 
OUString >& rnames ); // actually a TrueTypeFont* from font subsetting code
 bool analyzeSfntFile(PrintFont& rFont) const;
 // finds the font id for the nFaceIndex face in this font file
diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx
index 4058caef2faf..4c2bb4b3e062 100644
--- a/vcl/source

[Libreoffice-commits] dev-tools.git: test-bugzilla-files/test-bugzilla-files.py

2022-09-22 Thread Caolán McNamara (via logerrit)
 test-bugzilla-files/test-bugzilla-files.py |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit acf14295f1450f02e06d1bc508b68df99a50ab15
Author: Caolán McNamara 
AuthorDate: Thu Sep 22 13:27:50 2022 +0100
Commit: Caolán McNamara 
CommitDate: Thu Sep 22 14:29:51 2022 +0200

odfundiff_exclude_list.txt path isn't right

Change-Id: I9815f91a0e9edc56be6be8afb00d3f86ec5fc9a4
Reviewed-on: https://gerrit.libreoffice.org/c/dev-tools/+/140428
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 

diff --git a/test-bugzilla-files/test-bugzilla-files.py 
b/test-bugzilla-files/test-bugzilla-files.py
index 50a7508..16d337e 100644
--- a/test-bugzilla-files/test-bugzilla-files.py
+++ b/test-bugzilla-files/test-bugzilla-files.py
@@ -668,7 +668,7 @@ if __name__ == "__main__":
 
 exclude_list = []
 if os.path.exists(os.environ["CRASHTESTDATA"] + 
"/odfundiff_exclude_list.txt"):
-with open('os.environ["CRASHTESTDATA"] + 
/odfundiff_exclude_list.txt') as file:
+with open(os.environ["CRASHTESTDATA"] + 
"/odfundiff_exclude_list.txt") as file:
 exclude_list = file.readlines()
 exclude_list = [line.rstrip() for line in exclude_list]
 


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

2022-09-22 Thread Caolán McNamara (via logerrit)
 i18nutil/source/utility/paper.cxx |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 64e4363527422c913151efab0c0d0c6b8c2256c8
Author: Caolán McNamara 
AuthorDate: Thu Sep 22 11:38:27 2022 +0100
Commit: Caolán McNamara 
CommitDate: Thu Sep 22 14:24:36 2022 +0200

Related: tdf#151107 make "sloppy" paper fit up to 1.25pt

Change-Id: I7fe804732849c09659d8d3da41aa1d0650cefb26
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140410
Tested-by: Julien Nabet 
Reviewed-by: Julien Nabet 
Reviewed-by: Caolán McNamara 

diff --git a/i18nutil/source/utility/paper.cxx 
b/i18nutil/source/utility/paper.cxx
index 1976880a060d..f6871e655f58 100644
--- a/i18nutil/source/utility/paper.cxx
+++ b/i18nutil/source/utility/paper.cxx
@@ -165,7 +165,11 @@ const PageDesc aDinTab[] =
 
 const size_t nTabSize = SAL_N_ELEMENTS(aDinTab);
 
-#define MAXSLOPPY 21
+// tdf#151107 make this not just large enough for rounding errors on our side
+// but also large enough to match where the ppd side rounded up to the next
+// point. Seen with C5/C6/C65 envelopes which can be found over 1 point away
+// from the values in aDinTab
+#define MAXSLOPPY PT2MM100(1.25)
 
 void PaperInfo::doSloppyFit(bool bAlsoTryRotated)
 {


[Libreoffice-commits] core.git: download.lst external/epoxy

2022-09-22 Thread Taichi Haradaguchi (via logerrit)
 download.lst|4 ++--
 external/epoxy/UnpackedTarball_epoxy.mk |1 -
 external/epoxy/clang-cl.patch   |2 +-
 external/epoxy/epoxy.android.patch  |   14 --
 4 files changed, 3 insertions(+), 18 deletions(-)

New commits:
commit 2329128fa16a4e08a5f8fee0a83dd8b4d5c9c279
Author: Taichi Haradaguchi <20001...@ymail.ne.jp>
AuthorDate: Thu Sep 22 01:16:36 2022 +0900
Commit: Caolán McNamara 
CommitDate: Thu Sep 22 14:24:16 2022 +0200

upgrade libepoxy to 1.5.10

removed epoxy.android.patch: fixed upstream

(https://github.com/anholt/libepoxy/pull/263/commits/063c1df27974f58b0f3c0a57417732da068923cf)

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

diff --git a/download.lst b/download.lst
index d81256d3afc0..94277ad5f4ba 100644
--- a/download.lst
+++ b/download.lst
@@ -37,8 +37,8 @@ export CURL_SHA256SUM := 
2cb9c2356e7263a1272fd1435ef7cdebf2cd21400ec287b068396de
 export CURL_TARBALL := curl-7.83.1.tar.xz
 export EBOOK_SHA256SUM := 
7e8d8ff34f27831aca3bc6f9cc532c2f90d2057c778963b884ff3d1e34dfe1f9
 export EBOOK_TARBALL := libe-book-0.1.3.tar.xz
-export EPOXY_SHA256SUM := 
d168a19a6edfdd9977fef1308ccf516079856a4275cf876de688fb7927e365e4
-export EPOXY_TARBALL := libepoxy-1.5.9.tar.xz
+export EPOXY_SHA256SUM := 
a7ced37f4102b745ac86d6a70a9da399cc139ff168ba6b8002b4d8d43c900c15
+export EPOXY_TARBALL := libepoxy-1.5.10.tar.gz
 export EPM_SHA256SUM := 
b3fc4c5445de6c9a801504a3ea3efb2d4ea9d5a622c9427e716736e7713ddb91
 export EPM_TARBALL := 3ade8cfe7e59ca8e65052644fed9fca4-epm-3.7.tar.gz
 export EPUBGEN_SHA256SUM := 
03e084b994cbeffc8c3dd13303b2cb805f44d8f2c3b79f7690d7e3fc7f6215ad
diff --git a/external/epoxy/UnpackedTarball_epoxy.mk 
b/external/epoxy/UnpackedTarball_epoxy.mk
index f0f1c71da227..7dd319988121 100644
--- a/external/epoxy/UnpackedTarball_epoxy.mk
+++ b/external/epoxy/UnpackedTarball_epoxy.mk
@@ -32,7 +32,6 @@ $(eval $(call gb_UnpackedTarball_add_patches,epoxy, \
 external/epoxy/epoxy.windows.api.patch \
 external/epoxy/epoxy.noegl.by.default.patch \
 external/epoxy/clang-cl.patch \
-external/epoxy/epoxy.android.patch \
 external/epoxy/Wint-conversion.patch \
 ))
 
diff --git a/external/epoxy/clang-cl.patch b/external/epoxy/clang-cl.patch
index 80b49127104b..0e0232cea68c 100644
--- a/external/epoxy/clang-cl.patch
+++ b/external/epoxy/clang-cl.patch
@@ -1,6 +1,6 @@
 --- src/dispatch_common.c
 +++ src/dispatch_common.c
-@@ -190,7 +190,11 @@
+@@ -272,7 +272,11 @@
  #endif
  };
  
diff --git a/external/epoxy/epoxy.android.patch 
b/external/epoxy/epoxy.android.patch
deleted file mode 100644
index c8f672a9718d..
--- a/external/epoxy/epoxy.android.patch
+++ /dev/null
@@ -1,14 +0,0 @@
 src/dispatch_common.c  2021-10-20 10:51:59.808554323 +0100
-+++ src/dispatch_common.c  2021-10-20 10:52:41.319645618 +0100
-@@ -687,7 +687,11 @@
- #endif
- 
- if (!api.gl_handle) {
-+#if defined(OPENGL_LIB)
- fprintf(stderr, "Couldn't open %s or %s\n", GLX_LIB, OPENGL_LIB);
-+#else
-+fprintf(stderr, "Couldn't open %s\n", GLX_LIB);
-+#endif
- abort();
- }
- 


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

2022-09-22 Thread Caolán McNamara (via logerrit)
 vcl/unx/generic/printer/configuration/ppds/SGENPRT.PS |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 971804673efa7f461be21589d9e9bf0f982b8b54
Author: Caolán McNamara 
AuthorDate: Thu Sep 22 10:54:15 2022 +0100
Commit: Caolán McNamara 
CommitDate: Thu Sep 22 14:23:44 2022 +0200

Related: tdf#151107 EnvC65 page size is inconsistent with EnvC5 and EnvC6

*PageSize EnvC5/C5 Envelope: "<> 
setpagedevice"
*PageSize EnvC6/C6 Envelope: "<> 
setpagedevice"
but...
*PageSize EnvC65/C65 Envelope: "<> 
setpagedevice"

use the EnvC6/EnvC5 dimensions for EnvC65 instead of

*PageSize EnvC65/C65 Envelope: "<> 
setpagedevice"

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

diff --git a/vcl/unx/generic/printer/configuration/ppds/SGENPRT.PS 
b/vcl/unx/generic/printer/configuration/ppds/SGENPRT.PS
index 177e2c4e07b1..ed5882a593f9 100644
--- a/vcl/unx/generic/printer/configuration/ppds/SGENPRT.PS
+++ b/vcl/unx/generic/printer/configuration/ppds/SGENPRT.PS
@@ -174,7 +174,7 @@
 *PageSize EnvC5/C5 Envelope: "<> 
setpagedevice"
 *PageSize EnvC6/C6 Envelope: "<> 
setpagedevice"
 *PageSize Env10/C10 Envelope: "<> 
setpagedevice"
-*PageSize EnvC65/C65 Envelope: "<> 
setpagedevice"
+*PageSize EnvC65/C65 Envelope: "<> 
setpagedevice"
 *PageSize Folio: "<> setpagedevice"
 *?PageSize: "
  save
@@ -212,7 +212,7 @@
  dup [459 649] (EnvC5) put
  dup [323 459] (EnvC6) put
  dup [297 684] (Env10) put
- dup [324 648] (EnvC65) put
+ dup [323 649] (EnvC65) put
  dup [595 935] (Folio) put
  { exch aload pop 4 index sub abs 5 le exch
5 index sub abs 5 le and
@@ -257,7 +257,7 @@
 *PageRegion EnvC5/C5 Envelope: "<> 
setpagedevice"
 *PageRegion EnvC6/C6 Envelope: "<> 
setpagedevice"
 *PageRegion Env10/C10 Envelope: "<> 
setpagedevice"
-*PageRegion EnvC65/C65 Envelope: "<> 
setpagedevice"
+*PageRegion EnvC65/C65 Envelope: "<> 
setpagedevice"
 *PageRegion Folio: "<> setpagedevice"
 *CloseUI: *PageRegion
 
@@ -292,7 +292,7 @@
 *ImageableArea EnvC5: "0 0 459 649"
 *ImageableArea EnvC6: "0 0 323 459"
 *ImageableArea Env10: "0 0 297 684"
-*ImageableArea EnvC65: "0 0 324 648"
+*ImageableArea EnvC65: "0 0 323 649"
 *ImageableArea Folio: "0 0 595 935"
 
 *DefaultPaperDimension: Letter
@@ -326,7 +326,7 @@
 *PaperDimension EnvC5: "459 649"
 *PaperDimension EnvC6: "323 459"
 *PaperDimension Env10: "297 684"
-*PaperDimension EnvC65: "324 648"
+*PaperDimension EnvC65: "323 649"
 *PaperDimension Folio: "595 935"
 
 *% = Duplex =


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

2022-09-22 Thread Caolán McNamara (via logerrit)
 unotools/source/config/configpaths.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit a64204cc26745e7652cb71ee2ed39a9ae00b09cd
Author: Caolán McNamara 
AuthorDate: Thu Sep 22 09:10:26 2022 +0100
Commit: Caolán McNamara 
CommitDate: Thu Sep 22 14:22:31 2022 +0200

cid#1515531 Out-of-bounds access

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

diff --git a/unotools/source/config/configpaths.cxx 
b/unotools/source/config/configpaths.cxx
index 70043a60fbd9..4e5002238d93 100644
--- a/unotools/source/config/configpaths.cxx
+++ b/unotools/source/config/configpaths.cxx
@@ -97,7 +97,8 @@ bool splitLastFromConfigurationPath(std::u16string_view 
_sInPath,
 nEnd = nPos;
 nPos = _sInPath.find(chQuote,nEnd);
 nStart = nPos + 1;
---nPos; // nPos = rInPath.lastIndexOf('[',nPos);
+if (nPos != std::u16string_view::npos)
+--nPos; // nPos = rInPath.lastIndexOf('[',nPos);
 }
 else // allow [xxx]
 {


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

2022-09-22 Thread Caolán McNamara (via logerrit)
 unotools/source/config/configpaths.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 022289b2f028efba55f679cb2664092f0ffbc20a
Author: Caolán McNamara 
AuthorDate: Thu Sep 22 09:03:22 2022 +0100
Commit: Caolán McNamara 
CommitDate: Thu Sep 22 14:22:18 2022 +0200

this originally checked for > 0

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

diff --git a/unotools/source/config/configpaths.cxx 
b/unotools/source/config/configpaths.cxx
index d3813f31fcf5..70043a60fbd9 100644
--- a/unotools/source/config/configpaths.cxx
+++ b/unotools/source/config/configpaths.cxx
@@ -81,14 +81,14 @@ bool splitLastFromConfigurationPath(std::u16string_view 
_sInPath,
 size_t nPos = _sInPath.size()-1;
 
 // strip trailing slash
-if (nPos != std::u16string_view::npos && _sInPath[ nPos ] == '/')
+if (nPos != std::u16string_view::npos && nPos > 0 && _sInPath[ nPos ] == 
'/')
 {
 OSL_FAIL("Invalid config path: trailing '/' is not allowed");
 --nPos;
 }
 
 // check for predicate ['xxx'] or ["yyy"]
-if (nPos != std::u16string_view::npos && _sInPath[ nPos ] == ']')
+if (nPos != std::u16string_view::npos && nPos > 0 && _sInPath[ nPos ] == 
']')
 {
 sal_Unicode chQuote = _sInPath[--nPos];
 


Minutes from the UX/design meeting 2022-Sep-22

2022-09-22 Thread Heiko Tietze

Present: Heiko
Comments: Timur, Regina, Stuart, Eike, Roman, Tuomas

Tickets/Topics

 * UI: Context Menu does not appear if user clicks on the top-left sheet corner
   + https://bugs.documentfoundation.org/show_bug.cgi?id=145201
   + WF (Timur), alternative ways (Regina)
   + no objection to have some menu there, ideally configured so non-matching
 options for all cells (eg sparklines, merge) are hidden
   + but low priority
   => go for it

 * Changing right page margin changes horizontal scrolling position
   + https://bugs.documentfoundation.org/show_bug.cgi?id=151041
   + it's clear what's happening, WF (Stuart)
   + if we keep the view constant it should be always (Heiko)
   + It would make little sense to hold the vcl canvas view on
 a part of the page that no longer has any importance to
 inputting textual content. (Stuart)
   => needsDevAdvice

 * Protected status only is pasted if the source cells belong to one row
   + https://bugs.documentfoundation.org/show_bug.cgi?id=150910
   + bug 123974 has the opposite expectations (Eike)
   + difference between single/multiple selection
 + pasting single protected cell into an unprotected area makes this
   cell protected
 + pasting at least two cells makes the target unprotected
 + it doesn't matter if one of the cell is unprotected or all
   are protected
   + decision on bug 123974 c10 was to "removing the protected state only
 if a) the sheet is protected, and b) the target cell is unprotected"
   => this should apply to multiple selections too and whether the flag is
 set or not needs to be decided per cell

 * Confusing radio button placement in Text flow tab of Table Properties dialog
   + https://bugs.documentfoundation.org/show_bug.cgi?id=151002
   + appreciate labels (Roman)
   + suggest a flipped layout additionally (Tuomas)
 + don't see the advantage (Heiko)
   => do it


OpenPGP_signature
Description: OpenPGP digital signature


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

2022-09-22 Thread Xisco Fauli (via logerrit)
 svgio/inc/svgtools.hxx  |5 +--
 svgio/qa/cppunit/SvgImportTest.cxx  |   21 
 svgio/qa/cppunit/data/textXmlSpace.svg  |   12 +
 svgio/source/svgreader/svgcharacternode.cxx |4 +--
 svgio/source/svgreader/svgtools.cxx |   36 +++-
 5 files changed, 47 insertions(+), 31 deletions(-)

New commits:
commit ddf695db44bcb23dc2f1459fd439f93c0b6d5f2a
Author: Xisco Fauli 
AuthorDate: Thu Sep 22 10:59:29 2022 +0200
Commit: Xisco Fauli 
CommitDate: Thu Sep 22 13:43:59 2022 +0200

tdf#151118: svg: fix handling of xml:space="preserve"

This allows the code to be simplified a bit

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

diff --git a/svgio/inc/svgtools.hxx b/svgio/inc/svgtools.hxx
index a5a0b3aa418b..0a4e200c746b 100644
--- a/svgio/inc/svgtools.hxx
+++ b/svgio/inc/svgtools.hxx
@@ -125,10 +125,9 @@ namespace svgio::svgreader
 
 void readImageLink(const OUString& rCandidate, OUString& rXLink, 
OUString& rUrl, OUString& rMimeType, OUString& rData);
 
-OUString convert(const OUString& rCandidate, sal_Unicode nPattern, 
sal_Unicode nNew, bool bRemove);
+OUString convert(const OUString& rCandidate, sal_Unicode nPattern, 
sal_Unicode nNew);
 OUString consolidateContiguousSpace(const OUString& rCandidate);
-OUString whiteSpaceHandlingDefault(const OUString& rCandidate);
-OUString whiteSpaceHandlingPreserve(const OUString& rCandidate);
+OUString xmlSpaceHandling(const OUString& rCandidate, bool bIsDefault);
 
 // #125325# removes block comment of the general form '/* ... */', 
returns
 // an adapted string or the original if no comments included
diff --git a/svgio/qa/cppunit/SvgImportTest.cxx 
b/svgio/qa/cppunit/SvgImportTest.cxx
index 07a98f4a5a2f..23734777cf2c 100644
--- a/svgio/qa/cppunit/SvgImportTest.cxx
+++ b/svgio/qa/cppunit/SvgImportTest.cxx
@@ -48,6 +48,7 @@ class Test : public test::BootstrapFixture, public 
XmlTestTools
 void testMarkerOrient();
 void testMarkerInPresentation();
 void testMarkerInCssStyle();
+void testTextXmlSpace();
 void testTdf45771();
 void testTdf97941();
 void testTdf104339();
@@ -97,6 +98,7 @@ public:
 CPPUNIT_TEST(testMarkerOrient);
 CPPUNIT_TEST(testMarkerInPresentation);
 CPPUNIT_TEST(testMarkerInCssStyle);
+CPPUNIT_TEST(testTextXmlSpace);
 CPPUNIT_TEST(testTdf45771);
 CPPUNIT_TEST(testTdf97941);
 CPPUNIT_TEST(testTdf104339);
@@ -420,6 +422,25 @@ void Test::testMarkerInCssStyle()
 assertXPath(pDocument, 
"/primitive2D/transform/transform[1]/polypolygonstroke/line", "linecap", 
"BUTT");
 }
 
+void Test::testTextXmlSpace()
+{
+//Check tspan fontsize when using relative units
+Primitive2DSequence aSequenceTdf97941 = 
parseSvg(u"/svgio/qa/cppunit/data/textXmlSpace.svg");
+CPPUNIT_ASSERT_EQUAL(1, static_cast(aSequenceTdf97941.getLength()));
+
+drawinglayer::Primitive2dXmlDump dumper;
+xmlDocUniquePtr pDocument = dumper.dumpAndParse(aSequenceTdf97941);
+
+CPPUNIT_ASSERT (pDocument);
+
+assertXPath(pDocument, "/primitive2D/transform/mask/textsimpleportion[1]", 
"text", "a b");
+assertXPath(pDocument, "/primitive2D/transform/mask/textsimpleportion[2]", 
"text", "a b");
+assertXPath(pDocument, "/primitive2D/transform/mask/textsimpleportion[3]", 
"text", "a b");
+assertXPath(pDocument, "/primitive2D/transform/mask/textsimpleportion[4]", 
"text", "a  b");
+assertXPath(pDocument, "/primitive2D/transform/mask/textsimpleportion[5]", 
"text", "a b");
+assertXPath(pDocument, "/primitive2D/transform/mask/textsimpleportion[6]", 
"text", "a   b");
+}
+
 void Test::testTdf45771()
 {
 //Check text fontsize when using relative units
diff --git a/svgio/qa/cppunit/data/textXmlSpace.svg 
b/svgio/qa/cppunit/data/textXmlSpace.svg
new file mode 100644
index ..606e2eb7a306
--- /dev/null
+++ b/svgio/qa/cppunit/data/textXmlSpace.svg
@@ -0,0 +1,12 @@
+http://www.w3.org/2000/svg"; version="1.1"
+   viewBox="0 0 250 250">
+  a  b
+  a   b
+  a
+  b
+  a  b
+  a  b
+  a
+  b
+
+
diff --git a/svgio/source/svgreader/svgcharacternode.cxx 
b/svgio/source/svgreader/svgcharacternode.cxx
index 31376ee179a8..456a3abc8013 100644
--- a/svgio/source/svgreader/svgcharacternode.cxx
+++ b/svgio/source/svgreader/svgcharacternode.cxx
@@ -541,11 +541,11 @@ namespace svgio::svgreader
 {
 if (XmlSpace::Default == getXmlSpace())
 {
-maText = whiteSpaceHandlingDefault(maText);
+maText = xmlSpaceHandling(maText, true);
 }
 else
 {
-maText = whiteSpaceHandlingPreserve(maText);
+maText = xmlSpaceHandling(maText, false);
 }
 }
 
diff --git a/svgio/source/svgreade

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

2022-09-22 Thread Mike Kaganski (via logerrit)
 sw/qa/extras/odfexport/data/tdf151100.docx |binary
 sw/qa/extras/odfexport/odfexport2.cxx  |   14 ++
 xmloff/source/draw/shapeexport.cxx |   15 ---
 3 files changed, 14 insertions(+), 15 deletions(-)

New commits:
commit d194474aabd699806cb3631bc8641dd0548b8026
Author: Mike Kaganski 
AuthorDate: Wed Sep 21 11:11:47 2022 +0300
Commit: Xisco Fauli 
CommitDate: Thu Sep 22 13:21:33 2022 +0200

tdf#151100: xText->getString() may be empty for content needing export

The check that is removed prevents collecting the table data.
Assume that it's the performance optimization, and that processing
empty text objects would be fast anyway.

This basically reverts commit 73fcb052edf1a21d785583bc53e8b4323b577bb1
  Author Christian Lippka 
  Date   Thu Nov 22 12:26:35 2001 +
#90330# only export text autostyles for shapes with text

and commit 7661bbbaef31adfdb298b1447301b24a70f85834
  Author Michael Stahl 
  Date   Fri Nov 25 22:46:34 2016 +0100
tdf#102479 ODF export: ignore exceptions when checking shape text

that becomes unnecessary after the former change is reverted.

Change-Id: I709a7b4c5ac1cc0621d3a1b18f2eb74feb987efb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140313
Tested-by: Mike Kaganski 
Reviewed-by: Mike Kaganski 
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140352
Tested-by: Jenkins
(cherry picked from commit 226b1c2006e936e4b32748b810624c5d655c4a98)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140378
Reviewed-by: Michael Stahl 

diff --git a/sw/qa/extras/odfexport/data/tdf151100.docx 
b/sw/qa/extras/odfexport/data/tdf151100.docx
new file mode 100644
index ..e0341bdb9c8c
Binary files /dev/null and b/sw/qa/extras/odfexport/data/tdf151100.docx differ
diff --git a/sw/qa/extras/odfexport/odfexport2.cxx 
b/sw/qa/extras/odfexport/odfexport2.cxx
index 398804455097..9a1345812f13 100644
--- a/sw/qa/extras/odfexport/odfexport2.cxx
+++ b/sw/qa/extras/odfexport/odfexport2.cxx
@@ -35,6 +35,20 @@ public:
 
 };
 
+CPPUNIT_TEST_FIXTURE(Test, tdf151100)
+{
+// Similar to tdf135942
+
+loadAndReload("tdf151100.docx");
+// All table autostyles should be collected, including nested, and must 
not crash.
+
+CPPUNIT_ASSERT_EQUAL(1, getPages());
+
+xmlDocUniquePtr pXmlDoc = parseExport("styles.xml");
+
+assertXPath(pXmlDoc, 
"/office:document-styles/office:automatic-styles/style:style[@style:family='table']",
 1);
+}
+
 DECLARE_ODFEXPORT_TEST(testTdf52065_centerTabs, "testTdf52065_centerTabs.odt")
 {
 CPPUNIT_ASSERT_EQUAL(1, getPages());
diff --git a/xmloff/source/draw/shapeexport.cxx 
b/xmloff/source/draw/shapeexport.cxx
index d47ea15b2758..0c4676b5f84f 100644
--- a/xmloff/source/draw/shapeexport.cxx
+++ b/xmloff/source/draw/shapeexport.cxx
@@ -301,22 +301,7 @@ void XMLShapeExport::collectShapeAutoStyles(const 
uno::Reference< drawing::XShap
 if( xPropSet.is() && bObjSupportsText )
 {
 uno::Reference< text::XText > xText(xShape, uno::UNO_QUERY);
-bool bSkip = false;
 if (xText.is())
-{
-try
-{
-bSkip = xText->getString().isEmpty();
-}
-catch (uno::RuntimeException const&)
-{
-// tdf#102479: SwXTextFrame that contains only a table will
-// throw, but the table must be iterated so that
-// SwXMLExport::ExportTableLines() can find its auto styles
-// so do not skip it!
-}
-}
-if (!bSkip)
 {
 uno::Reference< beans::XPropertySetInfo > xPropSetInfo( 
xPropSet->getPropertySetInfo() );
 


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

2022-09-22 Thread Henry Castro (via logerrit)
 sw/source/uibase/uiview/formatclipboard.cxx |   10 ++
 1 file changed, 10 insertions(+)

New commits:
commit 35502dd36bfd857c5514022e25bce8d1695eec61
Author: Henry Castro 
AuthorDate: Thu Aug 25 11:56:16 2022 -0400
Commit: Szymon Kłos 
CommitDate: Thu Sep 22 12:47:54 2022 +0200

sw: fix format brush to reset the font strikeout attribute

The format brush always inserts attributes to a set,
it should be intersected. For a special use case,
ugly hack to reset the font strikeout attribute.

Signed-off-by: Henry Castro 
Change-Id: I94c172e61b3d6d3339b1243a9344952b5c59d872
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138839
Tested-by: Jenkins
Reviewed-by: Gökay ŞATIR 
(cherry picked from commit 576ba26d09448f8bc332acdf6d17061e8ad552a3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140375
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/sw/source/uibase/uiview/formatclipboard.cxx 
b/sw/source/uibase/uiview/formatclipboard.cxx
index 2bf4dd036fef..881a3f0109b5 100644
--- a/sw/source/uibase/uiview/formatclipboard.cxx
+++ b/sw/source/uibase/uiview/formatclipboard.cxx
@@ -550,7 +550,17 @@ void SwFormatClipboard::Paste( SwWrtShell& rWrtShell, 
SfxStyleSheetBasePool* pPo
 if( nSelectionType & (SelectionType::Frame | 
SelectionType::Ole | SelectionType::Graphic) )
 rWrtShell.SetFlyFrameAttr(*pTemplateItemSet);
 else if ( !bNoCharacterFormats )
+{
+const SfxPoolItem* pItem;
+SfxItemSetFixed aSet(rWrtShell.GetAttrPool());
+rWrtShell.GetCurAttr(aSet);
+if (!pTemplateItemSet->HasItem(RES_CHRATR_CROSSEDOUT, 
&pItem))
+{
+rWrtShell.ResetAttr({ RES_CHRATR_CROSSEDOUT });
+}
+
 rWrtShell.SetAttrSet(*pTemplateItemSet);
+}
 }
 }
 }


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

2022-09-22 Thread Andrea Gelmini (via logerrit)
 sfx2/source/doc/objstor.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit cde237f7612cc34b1a7e46b83507877754b8e921
Author: Andrea Gelmini 
AuthorDate: Thu Sep 22 11:51:53 2022 +0200
Commit: Julien Nabet 
CommitDate: Thu Sep 22 12:31:20 2022 +0200

Fix typo

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

diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 83d28956ebee..98e87e2963f5 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -3217,7 +3217,7 @@ bool SfxObjectShell::SaveAsOwnFormat( SfxMedium& rMedium )
 // calls SwXTextFieldMasters::getByName, which in turn maps 
property names by
 // calling SwStyleNameMapper::GetTextUINameArray, which uses
 // SvtSysLocale().GetUILanguageTag() to do the mapping, saving 
indirectly depends
-// on the UI language. This is an unfortunate depenency. Here we 
use the loader's language.
+// on the UI language. This is an unfortunate dependency. Here we 
use the loader's language.
 const LanguageTag viewLanguage = 
comphelper::LibreOfficeKit::getLanguageTag();
 const LanguageTag loadLanguage = SfxLokHelper::getLoadLanguage();
 


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

2022-09-22 Thread Miklos Vajna (via logerrit)
 sw/qa/filter/ww8/ww8.cxx|   26 
 sw/source/filter/ww8/docxattributeoutput.cxx|   18 +-
 writerfilter/qa/cppunittests/dmapper/SdtHelper.cxx  |   30 
++
 writerfilter/qa/cppunittests/dmapper/data/sdt-run-combobox.docx |binary
 writerfilter/source/dmapper/DomainMapper.cxx|   23 ++-
 writerfilter/source/dmapper/DomainMapper_Impl.cxx   |7 ++
 writerfilter/source/dmapper/SdtHelper.cxx   |3 -
 writerfilter/source/dmapper/SdtHelper.hxx   |1 
 8 files changed, 100 insertions(+), 8 deletions(-)

New commits:
commit 01b1f57a90172a76faa1489b3b72250ee76169a6
Author: Miklos Vajna 
AuthorDate: Thu Sep 22 10:01:26 2022 +0200
Commit: Miklos Vajna 
CommitDate: Thu Sep 22 12:29:15 2022 +0200

sw content controls, combo box: add DOCX filter

Map the ComboBox UNO property to:


  
  ...
  


and the opposite on import.

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

diff --git a/sw/qa/filter/ww8/ww8.cxx b/sw/qa/filter/ww8/ww8.cxx
index 4f33e781d05d..ea8c4d9a9553 100644
--- a/sw/qa/filter/ww8/ww8.cxx
+++ b/sw/qa/filter/ww8/ww8.cxx
@@ -11,6 +11,10 @@
 
 #include 
 
+#include 
+#include 
+#include 
+
 namespace
 {
 constexpr OUStringLiteral DATA_DIRECTORY = u"/sw/qa/filter/ww8/data/";
@@ -81,6 +85,28 @@ CPPUNIT_TEST_FIXTURE(Test, testPlainTextContentControlExport)
 // i.e. the plain text content control was turned into a rich text one on 
export.
 assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:text", 1);
 }
+
+CPPUNIT_TEST_FIXTURE(Test, testDocxComboBoxContentControlExport)
+{
+// Given a document with a combo box content control around a text portion:
+mxComponent = loadFromDesktop("private:factory/swriter");
+SwDoc* pDoc = getSwDoc();
+SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+pWrtShell->InsertContentControl(SwContentControlType::COMBO_BOX);
+
+// When exporting to DOCX:
+save("Office Open XML Text", maTempFile);
+mbExported = true;
+
+// Then make sure the expected markup is used:
+xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: 1
+// - Actual  : 0
+// - XPath '//w:sdt/w:sdtPr/w:comboBox' number of nodes is incorrect
+// i.e. the combo box content control was turned into a drop-down one on 
export.
+assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:comboBox", 1);
+}
 }
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index f8fc5429fb97..5833dd62dbca 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -2393,14 +2393,28 @@ void DocxAttributeOutput::WriteContentControlStart()
 
 if (m_pContentControl->HasListItems())
 {
-m_pSerializer->startElementNS(XML_w, XML_dropDownList);
+if (m_pContentControl->GetComboBox())
+{
+m_pSerializer->startElementNS(XML_w, XML_comboBox);
+}
+else
+{
+m_pSerializer->startElementNS(XML_w, XML_dropDownList);
+}
 for (const auto& rItem : m_pContentControl->GetListItems())
 {
 m_pSerializer->singleElementNS(XML_w, XML_listItem,
 FSNS(XML_w, XML_displayText), rItem.m_aDisplayText,
 FSNS(XML_w, XML_value), rItem.m_aValue);
 }
-m_pSerializer->endElementNS(XML_w, XML_dropDownList);
+if (m_pContentControl->GetComboBox())
+{
+m_pSerializer->endElementNS(XML_w, XML_comboBox);
+}
+else
+{
+m_pSerializer->endElementNS(XML_w, XML_dropDownList);
+}
 }
 
 if (m_pContentControl->GetDate())
diff --git a/writerfilter/qa/cppunittests/dmapper/SdtHelper.cxx 
b/writerfilter/qa/cppunittests/dmapper/SdtHelper.cxx
index 6b568619785e..7b842e667104 100644
--- a/writerfilter/qa/cppunittests/dmapper/SdtHelper.cxx
+++ b/writerfilter/qa/cppunittests/dmapper/SdtHelper.cxx
@@ -212,6 +212,36 @@ CPPUNIT_TEST_FIXTURE(Test, testSdtRunDropdown)
 CPPUNIT_ASSERT_EQUAL(OUString("choose a color"), xContent->getString());
 }
 
+CPPUNIT_TEST_FIXTURE(Test, testSdtRunComboBox)
+{
+// Given a document with a combo box inline/run SDT:
+OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + 
"sdt-run-combobox.docx";
+
+// When loading the document:
+getComponent() = loadFromDesktop(aURL);
+
+// Then make sure that the doc model has a clickable combo box content 
control:
+uno::Reference xTextDocument(getComponent(), 
uno::UNO_QUERY);
+uno::Refe

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

2022-09-22 Thread Mike Kaganski (via logerrit)
 sw/qa/extras/odfexport/data/tdf151100.docx |binary
 sw/qa/extras/odfexport/odfexport2.cxx  |   14 ++
 xmloff/source/draw/shapeexport.cxx |   15 ---
 3 files changed, 14 insertions(+), 15 deletions(-)

New commits:
commit 226b1c2006e936e4b32748b810624c5d655c4a98
Author: Mike Kaganski 
AuthorDate: Wed Sep 21 11:11:47 2022 +0300
Commit: Xisco Fauli 
CommitDate: Thu Sep 22 11:05:18 2022 +0200

tdf#151100: xText->getString() may be empty for content needing export

The check that is removed prevents collecting the table data.
Assume that it's the performance optimization, and that processing
empty text objects would be fast anyway.

This basically reverts commit 73fcb052edf1a21d785583bc53e8b4323b577bb1
  Author Christian Lippka 
  Date   Thu Nov 22 12:26:35 2001 +
#90330# only export text autostyles for shapes with text

and commit 7661bbbaef31adfdb298b1447301b24a70f85834
  Author Michael Stahl 
  Date   Fri Nov 25 22:46:34 2016 +0100
tdf#102479 ODF export: ignore exceptions when checking shape text

that becomes unnecessary after the former change is reverted.

Change-Id: I709a7b4c5ac1cc0621d3a1b18f2eb74feb987efb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140313
Tested-by: Mike Kaganski 
Reviewed-by: Mike Kaganski 
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140352
Tested-by: Jenkins

diff --git a/sw/qa/extras/odfexport/data/tdf151100.docx 
b/sw/qa/extras/odfexport/data/tdf151100.docx
new file mode 100644
index ..e0341bdb9c8c
Binary files /dev/null and b/sw/qa/extras/odfexport/data/tdf151100.docx differ
diff --git a/sw/qa/extras/odfexport/odfexport2.cxx 
b/sw/qa/extras/odfexport/odfexport2.cxx
index 2ced17e903de..c6f5d025edea 100644
--- a/sw/qa/extras/odfexport/odfexport2.cxx
+++ b/sw/qa/extras/odfexport/odfexport2.cxx
@@ -28,6 +28,20 @@ public:
 
 };
 
+CPPUNIT_TEST_FIXTURE(Test, tdf151100)
+{
+// Similar to tdf135942
+
+loadAndReload("tdf151100.docx");
+// All table autostyles should be collected, including nested, and must 
not crash.
+
+CPPUNIT_ASSERT_EQUAL(1, getPages());
+
+xmlDocUniquePtr pXmlDoc = parseExport("styles.xml");
+
+assertXPath(pXmlDoc, 
"/office:document-styles/office:automatic-styles/style:style[@style:family='table']",
 1);
+}
+
 DECLARE_ODFEXPORT_TEST(testTdf52065_centerTabs, "testTdf52065_centerTabs.odt")
 {
 CPPUNIT_ASSERT_EQUAL(1, getPages());
diff --git a/xmloff/source/draw/shapeexport.cxx 
b/xmloff/source/draw/shapeexport.cxx
index 727489f5b7a5..b804b6800efa 100644
--- a/xmloff/source/draw/shapeexport.cxx
+++ b/xmloff/source/draw/shapeexport.cxx
@@ -306,22 +306,7 @@ void XMLShapeExport::collectShapeAutoStyles(const 
uno::Reference< drawing::XShap
 if( xPropSet.is() && bObjSupportsText )
 {
 uno::Reference< text::XText > xText(xShape, uno::UNO_QUERY);
-bool bSkip = false;
 if (xText.is())
-{
-try
-{
-bSkip = xText->getString().isEmpty();
-}
-catch (uno::RuntimeException const&)
-{
-// tdf#102479: SwXTextFrame that contains only a table will
-// throw, but the table must be iterated so that
-// SwXMLExport::ExportTableLines() can find its auto styles
-// so do not skip it!
-}
-}
-if (!bSkip)
 {
 uno::Reference< beans::XPropertySetInfo > xPropSetInfo( 
xPropSet->getPropertySetInfo() );
 


[Libreoffice-commits] core.git: Branch 'libreoffice-7-4' - download.lst external/libpng

2022-09-22 Thread Taichi Haradaguchi (via logerrit)
 download.lst   |4 ++--
 external/libpng/libpng-osx.patch.1 |2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit a0a34f08730c78f311d03aeab506c8fe83cdc3e7
Author: Taichi Haradaguchi <20001...@ymail.ne.jp>
AuthorDate: Wed Sep 21 17:17:35 2022 +0900
Commit: Xisco Fauli 
CommitDate: Thu Sep 22 10:58:51 2022 +0200

libpng: update to release 1.6.38

Change-Id: Ife594699cc8736ffdfc8f68e462d11416d7930e9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140311
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
(cherry picked from commit 18f4fc547a8c055afdaec4aad69c9fea387696c3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140377
Reviewed-by: Xisco Fauli 

diff --git a/download.lst b/download.lst
index 682ba8ec2042..13f7134d24de 100644
--- a/download.lst
+++ b/download.lst
@@ -206,8 +206,8 @@ export PDFIUM_SHA256SUM := 
eaf4ce9fad32b5d951c524139df23119b66c67720057defb97aca
 export PDFIUM_TARBALL := pdfium-5058.tar.bz2
 export PIXMAN_SHA256SUM := 
6d200dec3740d9ec4ec8d1180e25779c00bc749f94278c8b9021f5534db223fc
 export PIXMAN_TARBALL := pixman-0.40.0.tar.gz
-export LIBPNG_SHA256SUM := 
505e70834d35383537b6491e7ae8641f1a4bed1876dbfe361201fc80868d88ca
-export LIBPNG_TARBALL := libpng-1.6.37.tar.xz
+export LIBPNG_SHA256SUM := 
b3683e8b8111ebf6f1ac004ebb6b0c975cd310ec469d98364388e9cedbfa68be
+export LIBPNG_TARBALL := libpng-1.6.38.tar.xz
 export LIBTIFF_SHA256SUM := 
49307b510048ccc7bc40f2cba6e8439182fe6e654057c1a1683139bf2ecb1dc1
 export LIBTIFF_TARBALL := tiff-4.4.0.tar.xz
 export POPPLER_SHA256SUM := 
d7a8f748211359cadb774ba3e18ecda6464b34027045c0648eb30d5852a41e2e
diff --git a/external/libpng/libpng-osx.patch.1 
b/external/libpng/libpng-osx.patch.1
index 0e9d7336a762..387b3a8cc613 100644
--- a/external/libpng/libpng-osx.patch.1
+++ b/external/libpng/libpng-osx.patch.1
@@ -4,7 +4,7 @@ Avoid warning: 'inflateValidate' is only available on macOS 
10.13 or newer [-Wun
 
 --- a/pngrutil.c
 +++ b/pngrutil.c
-@@ -419,7 +419,8 @@
+@@ -422,7 +422,8 @@
}
  
  #if ZLIB_VERNUM >= 0x1290 && \


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

2022-09-22 Thread Miklos Vajna (via logerrit)
 schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng |6 +
 xmloff/qa/unit/data/content-control-combo-box.fodt  |8 +
 xmloff/qa/unit/text.cxx |   66 
 xmloff/source/text/txtparae.cxx |9 +
 xmloff/source/text/xmlcontentcontrolcontext.cxx |   13 ++
 xmloff/source/text/xmlcontentcontrolcontext.hxx |1 
 6 files changed, 103 insertions(+)

New commits:
commit 21d93d8d2ffd9c5d5cfe9064590b35e0727295c9
Author: Miklos Vajna 
AuthorDate: Thu Sep 22 08:36:51 2022 +0200
Commit: Miklos Vajna 
CommitDate: Thu Sep 22 09:34:38 2022 +0200

sw content controls, combo box: add ODT filter

Map the ComboBox UNO property to:



on export, and do the opposite on import.

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

diff --git a/schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng 
b/schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng
index cd0c8fb04244..a26e920aa687 100644
--- a/schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng
+++ b/schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng
@@ -2986,6 +2986,12 @@ 
xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.
   
 
   
+  
+
+
+  
+
+  
   
 
   
diff --git a/xmloff/qa/unit/data/content-control-combo-box.fodt 
b/xmloff/qa/unit/data/content-control-combo-box.fodt
new file mode 100644
index ..03f6911fb7dd
--- /dev/null
+++ b/xmloff/qa/unit/data/content-control-combo-box.fodt
@@ -0,0 +1,8 @@
+
+
+  
+
+  choose a 
color
+
+  
+
diff --git a/xmloff/qa/unit/text.cxx b/xmloff/qa/unit/text.cxx
index 8ad3ea6f941b..72b0e49ecbd0 100644
--- a/xmloff/qa/unit/text.cxx
+++ b/xmloff/qa/unit/text.cxx
@@ -899,6 +899,72 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, 
testPlainTextContentControlImport)
 CPPUNIT_ASSERT(bPlainText);
 }
 
+CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testComboBoxContentControlExport)
+{
+// Given a document with a combo box content control around a text portion:
+getComponent() = loadFromDesktop("private:factory/swriter");
+uno::Reference xMSF(getComponent(), 
uno::UNO_QUERY);
+uno::Reference xTextDocument(getComponent(), 
uno::UNO_QUERY);
+uno::Reference xText = xTextDocument->getText();
+uno::Reference xCursor = xText->createTextCursor();
+xText->insertString(xCursor, "test", /*bAbsorb=*/false);
+xCursor->gotoStart(/*bExpand=*/false);
+xCursor->gotoEnd(/*bExpand=*/true);
+uno::Reference xContentControl(
+xMSF->createInstance("com.sun.star.text.ContentControl"), 
uno::UNO_QUERY);
+uno::Reference xContentControlProps(xContentControl, 
uno::UNO_QUERY);
+xContentControlProps->setPropertyValue("ComboBox", uno::Any(true));
+xText->insertTextContent(xCursor, xContentControl, /*bAbsorb=*/true);
+
+// When exporting to ODT:
+uno::Reference xStorable(getComponent(), uno::UNO_QUERY);
+uno::Sequence aStoreProps = 
comphelper::InitPropertySequence({
+{ "FilterName", uno::Any(OUString("writer8")) },
+});
+utl::TempFile aTempFile;
+aTempFile.EnableKillingFile();
+xStorable->storeToURL(aTempFile.GetURL(), aStoreProps);
+validate(aTempFile.GetFileName(), test::ODF);
+
+// Then make sure the expected markup is used:
+std::unique_ptr pStream = parseExportStream(aTempFile, 
"content.xml");
+xmlDocUniquePtr pXmlDoc = parseXmlStream(pStream.get());
+// Without the accompanying fix in place, this test would have failed with:
+// - XPath '//loext:content-control' no attribute 'combobox' exist
+// i.e. the combo box content control was turned into a drop-down one on 
export.
+assertXPath(pXmlDoc, "//loext:content-control", "combobox", "true");
+}
+
+CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testComboBoxContentControlImport)
+{
+// Given an ODF document with a plain-text content control:
+OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + 
"content-control-combo-box.fodt";
+
+// When loading that document:
+getComponent() = loadFromDesktop(aURL);
+
+// Then make sure that the content control is not lost on import:
+uno::Reference xTextDocument(getComponent(), 
uno::UNO_QUERY);
+uno::Reference 
xParagraphsAccess(xTextDocument->getText(),
+
uno::UNO_QUERY);
+uno::Reference xParagraphs = 
xParagraphsAccess->createEnumeration();
+uno::Reference 
xParagraph(xParagraphs->nextElement(),
+ uno::UNO_QUERY);
+uno::Reference xPortions = 
xParagraph->createEnumeration();
+uno::Reference xTextPortion(xPortions->nextElement(), 
uno::UNO_QUERY);