core.git: odk/examples

2024-05-16 Thread Hossein (via logerrit)
 
odk/examples/DevelopersGuide/FirstSteps/HelloTextTableShape/cxx/HelloTextTableShape.cxx
 |   20 +-
 1 file changed, 10 insertions(+), 10 deletions(-)

New commits:
commit 12447b7c70cd1314c35fe7e2ae89078abdd9a4a6
Author: Hossein 
AuthorDate: Thu May 16 13:19:58 2024 +0200
Commit: René Engelhard 
CommitDate: Thu May 16 17:14:22 2024 +0200

Fix odk examples build on 32 bit systems

It is required to cast integer literals to sal_Int32 when passing them
to Any().

Change-Id: I377f88fc3441d8e4bc7afdb2411c1fd140853134
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167739
Tested-by: Jenkins
Reviewed-by: René Engelhard 
Tested-by: René Engelhard 

diff --git 
a/odk/examples/DevelopersGuide/FirstSteps/HelloTextTableShape/cxx/HelloTextTableShape.cxx
 
b/odk/examples/DevelopersGuide/FirstSteps/HelloTextTableShape/cxx/HelloTextTableShape.cxx
index 3fa9c1b960fc..b9f2a11ae528 100644
--- 
a/odk/examples/DevelopersGuide/FirstSteps/HelloTextTableShape/cxx/HelloTextTableShape.cxx
+++ 
b/odk/examples/DevelopersGuide/FirstSteps/HelloTextTableShape/cxx/HelloTextTableShape.cxx
@@ -171,7 +171,7 @@ void useWriter()
 //Object table = xIndexedTables.getByIndex(i);
 Any table = xIndexedTables->getByIndex(i);
 xTableProps = Reference(table, UNO_QUERY_THROW);
-xTableProps->setPropertyValue("BackColor", Any(0xC8FFB9));
+xTableProps->setPropertyValue("BackColor", 
Any(static_cast(0xC8FFB9)));
 }
 }
 
@@ -311,7 +311,7 @@ void manipulateTable(const Reference& 
xCellRange)
 xTableProps = Reference(xCellRange, UNO_QUERY_THROW);
 }
 // set cell background color
-xCellProps->setPropertyValue(backColorPropertyName, Any(0x99CCFF));
+xCellProps->setPropertyValue(backColorPropertyName, 
Any(static_cast(0x99CCFF)));
 
 // set table borders
 // create description for blue line, width 10
@@ -336,14 +336,14 @@ void manipulateTable(const Reference& 
xCellRange)
 void manipulateShape(const Reference& xShape)
 {
 Reference xShapeProps = Reference(xShape, 
UNO_QUERY_THROW);
-xShapeProps->setPropertyValue("FillColor", Any(0x99CCFF));
-xShapeProps->setPropertyValue("LineColor", Any(0x99));
-xShapeProps->setPropertyValue("RotateAngle", Any(3000));
-
-xShapeProps->setPropertyValue("TextLeftDistance", Any(0));
-xShapeProps->setPropertyValue("TextRightDistance", Any(0));
-xShapeProps->setPropertyValue("TextUpperDistance", Any(0));
-xShapeProps->setPropertyValue("TextLowerDistance", Any(0));
+xShapeProps->setPropertyValue("FillColor", 
Any(static_cast(0x99CCFF)));
+xShapeProps->setPropertyValue("LineColor", 
Any(static_cast(0x99)));
+xShapeProps->setPropertyValue("RotateAngle", 
Any(static_cast(3000)));
+
+xShapeProps->setPropertyValue("TextLeftDistance", 
Any(static_cast(0)));
+xShapeProps->setPropertyValue("TextRightDistance", 
Any(static_cast(0)));
+xShapeProps->setPropertyValue("TextUpperDistance", 
Any(static_cast(0)));
+xShapeProps->setPropertyValue("TextLowerDistance", 
Any(static_cast(0)));
 }
 
 Reference newDocComponent(const OUString docType)


core.git: Branch 'libreoffice-7-6' - sd/source

2024-03-14 Thread Hossein (via logerrit)
 sd/source/core/drawdoc2.cxx |6 +-
 sd/source/core/sdpage.cxx   |3 ++-
 2 files changed, 7 insertions(+), 2 deletions(-)

New commits:
commit 58352309d1299cbbaf465991f5cec17c2ae32cee
Author: Hossein 
AuthorDate: Tue Mar 12 16:32:09 2024 +0100
Commit: Xisco Fauli 
CommitDate: Thu Mar 14 11:22:32 2024 +0100

tdf#160162 Fix hyperlink update in Draw

Changing the links to keep them up-to-date was previously done only when
the name "Slide" was used for the pages, just like Impress, as Draw and
Impress share code. Now, the term "Page" is used instead of "Slide"
since 942d1d2ea59bf4605f2c464a6b29c967fa9f8de8 in Draw. This change,
fixes the above issue by also using the correct string consntant.

The patch is tested for Draw and Impress to make sure both are working
correctly now.

Change-Id: I55b4f56bd499d05f87f475d4c6cb3423247bf8d7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164716
Tested-by: Jenkins
Reviewed-by: Stéphane Guillou 
Reviewed-by: Hossein 
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164760
Reviewed-by: Adolfo Jayme Barrientos 
(cherry picked from commit 2ad14fdade187579b2abf3c76a08780b77614662)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164747

diff --git a/sd/source/core/drawdoc2.cxx b/sd/source/core/drawdoc2.cxx
index d591113fcca9..335761f862c7 100644
--- a/sd/source/core/drawdoc2.cxx
+++ b/sd/source/core/drawdoc2.cxx
@@ -326,7 +326,11 @@ void SdDrawDocument::UpdatePageRelativeURLs(SdPage const * 
pPage, sal_uInt16 nPo
 
 if (!aURL.isEmpty() && (aURL[0] == 35))
 {
-OUString aHashSlide = "#" + SdResId(STR_PAGE);
+OUString aHashSlide;
+if (meDocType == DocumentType::Draw)
+aHashSlide = "#" + SdResId(STR_PAGE_NAME);
+else
+aHashSlide = "#" + SdResId(STR_PAGE);
 
 if (aURL.startsWith(aHashSlide))
 {
diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx
index 230b6b5aef79..8947b6ef4b4b 100644
--- a/sd/source/core/sdpage.cxx
+++ b/sd/source/core/sdpage.cxx
@@ -2512,9 +2512,10 @@ const OUString& SdPage::GetName() const
 // default name for handout pages
 sal_uInt16  nNum = (GetPageNum() + 1) / 2;
 
-aCreatedPageName = SdResId(STR_PAGE) + " ";
 if 
(static_cast(getSdrModelFromSdrPage()).GetDocumentType() == 
DocumentType::Draw )
  aCreatedPageName = SdResId(STR_PAGE_NAME) + " ";
+else
+aCreatedPageName = SdResId(STR_PAGE) + " ";
 
 if( getSdrModelFromSdrPage().GetPageNumType() == 
css::style::NumberingType::NUMBER_NONE )
 {


core.git: Branch 'libreoffice-24-2' - sd/source

2024-03-13 Thread Hossein (via logerrit)
 sd/source/core/drawdoc2.cxx |6 +-
 sd/source/core/sdpage.cxx   |3 ++-
 2 files changed, 7 insertions(+), 2 deletions(-)

New commits:
commit 2ad14fdade187579b2abf3c76a08780b77614662
Author: Hossein 
AuthorDate: Tue Mar 12 16:32:09 2024 +0100
Commit: Adolfo Jayme Barrientos 
CommitDate: Wed Mar 13 20:48:32 2024 +0100

tdf#160162 Fix hyperlink update in Draw

Changing the links to keep them up-to-date was previously done only when
the name "Slide" was used for the pages, just like Impress, as Draw and
Impress share code. Now, the term "Page" is used instead of "Slide"
since 942d1d2ea59bf4605f2c464a6b29c967fa9f8de8 in Draw. This change,
fixes the above issue by also using the correct string consntant.

The patch is tested for Draw and Impress to make sure both are working
correctly now.

Change-Id: I55b4f56bd499d05f87f475d4c6cb3423247bf8d7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164716
Tested-by: Jenkins
Reviewed-by: Stéphane Guillou 
Reviewed-by: Hossein 
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164760
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/sd/source/core/drawdoc2.cxx b/sd/source/core/drawdoc2.cxx
index de82a8b95306..8f7c9f3328e6 100644
--- a/sd/source/core/drawdoc2.cxx
+++ b/sd/source/core/drawdoc2.cxx
@@ -324,7 +324,11 @@ void SdDrawDocument::UpdatePageRelativeURLs(SdPage const * 
pPage, sal_uInt16 nPo
 
 if (!aURL.isEmpty() && (aURL[0] == 35))
 {
-OUString aHashSlide = "#" + SdResId(STR_PAGE);
+OUString aHashSlide;
+if (meDocType == DocumentType::Draw)
+aHashSlide = "#" + SdResId(STR_PAGE_NAME);
+else
+aHashSlide = "#" + SdResId(STR_PAGE);
 
 if (aURL.startsWith(aHashSlide))
 {
diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx
index 02609a7083fa..10b4f34b761f 100644
--- a/sd/source/core/sdpage.cxx
+++ b/sd/source/core/sdpage.cxx
@@ -2512,9 +2512,10 @@ const OUString& SdPage::GetName() const
 // default name for handout pages
 sal_uInt16  nNum = (GetPageNum() + 1) / 2;
 
-aCreatedPageName = SdResId(STR_PAGE) + " ";
 if 
(static_cast(getSdrModelFromSdrPage()).GetDocumentType() == 
DocumentType::Draw )
  aCreatedPageName = SdResId(STR_PAGE_NAME) + " ";
+else
+aCreatedPageName = SdResId(STR_PAGE) + " ";
 
 if( getSdrModelFromSdrPage().GetPageNumType() == 
css::style::NumberingType::NUMBER_NONE )
 {


core.git: odk/examples

2024-03-12 Thread Hossein (via logerrit)
 
odk/examples/DevelopersGuide/FirstSteps/FirstLoadComponent/cxx/FirstLoadComponent.cxx
 |   22 +-
 1 file changed, 11 insertions(+), 11 deletions(-)

New commits:
commit a2265e8faa099d9652efd12392c2877c2df1d1eb
Author: Hossein 
AuthorDate: Tue Mar 12 10:21:32 2024 +0100
Commit: Hossein 
CommitDate: Wed Mar 13 00:57:06 2024 +0100

Use UNO_QUERY_THROW instead of UNO_QUERY

Previously, in SDK examples, de-referencing was done unconditionally
after obtaining a reference using UNO_QUERY. Now, we use UNO_QUERY_THROW
instead, to make sure cases where exceptions may occure can be handled
correctly.

Change-Id: Ic73ba3cfcad914dabb7ae3736ad1ae2bd6cc15bd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164682
Tested-by: Hossein 
Reviewed-by: Hossein 

diff --git 
a/odk/examples/DevelopersGuide/FirstSteps/FirstLoadComponent/cxx/FirstLoadComponent.cxx
 
b/odk/examples/DevelopersGuide/FirstSteps/FirstLoadComponent/cxx/FirstLoadComponent.cxx
index 9ac650ad49af..79493e2e5ed0 100644
--- 
a/odk/examples/DevelopersGuide/FirstSteps/FirstLoadComponent/cxx/FirstLoadComponent.cxx
+++ 
b/odk/examples/DevelopersGuide/FirstSteps/FirstLoadComponent/cxx/FirstLoadComponent.cxx
@@ -30,7 +30,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -63,20 +62,21 @@ SAL_IMPLEMENT_MAIN()
 Reference desktop = 
xRemoteServiceManager->createInstanceWithContext(
 "com.sun.star.frame.Desktop", xRemoteContext);
 Reference xComponentLoader
-= Reference(desktop, UNO_QUERY);
+= Reference(desktop, UNO_QUERY_THROW);
 
 Sequence loadProps(0);
 Reference xSpreadsheetComponent = 
xComponentLoader->loadComponentFromURL(
 "private:factory/scalc", "_blank", 0, loadProps);
 
-Reference 
xSpreadsheetDocument(xSpreadsheetComponent, UNO_QUERY);
+Reference 
xSpreadsheetDocument(xSpreadsheetComponent,
+ UNO_QUERY_THROW);
 Reference xSpreadsheets = 
xSpreadsheetDocument->getSheets();
 xSpreadsheets->insertNewByName("MySheet", (sal_Int16)0);
 Type elemType = xSpreadsheets->getElementType();
 
 std::cout << elemType.getTypeName() << std::endl;
 Any sheet = xSpreadsheets->getByName("MySheet");
-Reference xSpreadsheet(sheet, UNO_QUERY);
+Reference xSpreadsheet(sheet, UNO_QUERY_THROW);
 
 Reference xCell = xSpreadsheet->getCellByPosition(0, 0);
 xCell->setValue(21);
@@ -85,12 +85,12 @@ SAL_IMPLEMENT_MAIN()
 xCell = xSpreadsheet->getCellByPosition(0, 2);
 xCell->setFormula("=sum(A1:A2)");
 
-Reference xCellProps(xCell, UNO_QUERY);
+Reference xCellProps(xCell, UNO_QUERY_THROW);
 xCellProps->setPropertyValue("CellStyle", Any(OUString("Result")));
 
-Reference xSpreadsheetModel(xSpreadsheetComponent, UNO_QUERY);
+Reference xSpreadsheetModel(xSpreadsheetComponent, 
UNO_QUERY_THROW);
 Reference xSpreadsheetController = 
xSpreadsheetModel->getCurrentController();
-Reference xSpreadsheetView(xSpreadsheetController, 
UNO_QUERY);
+Reference xSpreadsheetView(xSpreadsheetController, 
UNO_QUERY_THROW);
 xSpreadsheetView->setActiveSheet(xSpreadsheet);
 
 // *
@@ -118,7 +118,7 @@ SAL_IMPLEMENT_MAIN()
 
 // *
 // example for use of XEnumerationAccess
-Reference xCellQuery(sheet, UNO_QUERY);
+Reference xCellQuery(sheet, UNO_QUERY_THROW);
 Reference xFormulaCells
 = xCellQuery->queryContentCells((sal_Int16)CellFlags::FORMULA);
 Reference xFormulas = xFormulaCells->getCells();
@@ -126,8 +126,8 @@ SAL_IMPLEMENT_MAIN()
 
 while (xFormulaEnum->hasMoreElements())
 {
-Reference formulaCell(xFormulaEnum->nextElement(), 
UNO_QUERY);
-Reference xCellAddress(formulaCell, UNO_QUERY);
+Reference formulaCell(xFormulaEnum->nextElement(), 
UNO_QUERY_THROW);
+Reference xCellAddress(formulaCell, 
UNO_QUERY_THROW);
 if (xCellAddress.is())
 {
 std::cout << "Formula cell in column " << 
xCellAddress->getCellAddress().Column
@@ -136,7 +136,7 @@ SAL_IMPLEMENT_MAIN()
 }
 }
 }
-catch (RuntimeException& e)
+catch (Exception& e)
 {
 std::cerr << e.Message << "
";
 return 1;


core.git: sd/source

2024-03-12 Thread Hossein (via logerrit)
 sd/source/core/drawdoc2.cxx |6 +-
 sd/source/core/sdpage.cxx   |3 ++-
 2 files changed, 7 insertions(+), 2 deletions(-)

New commits:
commit c1f097854f89f35cfc0f097a10384014042b95d6
Author: Hossein 
AuthorDate: Tue Mar 12 16:32:09 2024 +0100
Commit: Hossein 
CommitDate: Wed Mar 13 00:39:16 2024 +0100

tdf#160162 Fix hyperlink update in Draw

Changing the links to keep them up-to-date was previously done only when
the name "Slide" was used for the pages, just like Impress, as Draw and
Impress share code. Now, the term "Page" is used instead of "Slide"
since 942d1d2ea59bf4605f2c464a6b29c967fa9f8de8 in Draw. This change,
fixes the above issue by also using the correct string consntant.

The patch is tested for Draw and Impress to make sure both are working
correctly now.

Change-Id: I55b4f56bd499d05f87f475d4c6cb3423247bf8d7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164716
Tested-by: Jenkins
Reviewed-by: Stéphane Guillou 
Reviewed-by: Hossein 

diff --git a/sd/source/core/drawdoc2.cxx b/sd/source/core/drawdoc2.cxx
index 4feb8f10c6fd..69e274afc906 100644
--- a/sd/source/core/drawdoc2.cxx
+++ b/sd/source/core/drawdoc2.cxx
@@ -339,7 +339,11 @@ void SdDrawDocument::UpdatePageRelativeURLs(SdPage const * 
pPage, sal_uInt16 nPo
 if (aURL.isEmpty() || (aURL[0] != 35))
 return true; // continue callbacks
 
-OUString aHashSlide = "#" + SdResId(STR_PAGE);
+OUString aHashSlide;
+if (meDocType == DocumentType::Draw)
+aHashSlide = "#" + SdResId(STR_PAGE_NAME);
+else
+aHashSlide = "#" + SdResId(STR_PAGE);
 
 if (!aURL.startsWith(aHashSlide))
 return true; // continue callbacks
diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx
index 02609a7083fa..10b4f34b761f 100644
--- a/sd/source/core/sdpage.cxx
+++ b/sd/source/core/sdpage.cxx
@@ -2512,9 +2512,10 @@ const OUString& SdPage::GetName() const
 // default name for handout pages
 sal_uInt16  nNum = (GetPageNum() + 1) / 2;
 
-aCreatedPageName = SdResId(STR_PAGE) + " ";
 if 
(static_cast(getSdrModelFromSdrPage()).GetDocumentType() == 
DocumentType::Draw )
  aCreatedPageName = SdResId(STR_PAGE_NAME) + " ";
+else
+aCreatedPageName = SdResId(STR_PAGE) + " ";
 
 if( getSdrModelFromSdrPage().GetPageNumType() == 
css::style::NumberingType::NUMBER_NONE )
 {


core.git: odk/CustomTarget_build-examples.mk odk/examples odk/Package_examples.mk

2024-03-10 Thread Hossein (via logerrit)
 odk/CustomTarget_build-examples.mk 
 |1 
 odk/Package_examples.mk
 |2 
 
odk/examples/DevelopersGuide/FirstSteps/HelloTextTableShape/cxx/HelloTextTableShape.cxx
 |  383 ++
 odk/examples/DevelopersGuide/FirstSteps/HelloTextTableShape/cxx/Makefile   
 |   77 ++
 4 files changed, 463 insertions(+)

New commits:
commit d30891d6ad5473708aaba7b31aa87de29ae57fe6
Author: Hossein 
AuthorDate: Sun Mar 10 20:58:37 2024 +0100
Commit: Hossein 
CommitDate: Mon Mar 11 00:25:38 2024 +0100

tdf#143122 Port HelloTextTableShape example to C++

Port DevelopersGuide/FirstSteps/HelloTextTableShape Java SDK example to
C++ and add a GNU Makefile for the build.

Change-Id: I8798406c24ec6c566fb6494f7202f6a2a984a25c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164635
Tested-by: Jenkins
Reviewed-by: Hossein 

diff --git a/odk/CustomTarget_build-examples.mk 
b/odk/CustomTarget_build-examples.mk
index dd5a2e58732e..50131ecb4f99 100644
--- a/odk/CustomTarget_build-examples.mk
+++ b/odk/CustomTarget_build-examples.mk
@@ -12,6 +12,7 @@ my_example_dirs = \
 CLI/VB.NET/WriterDemo \
 DevelopersGuide/FirstSteps/FirstUnoContact/cxx \
 DevelopersGuide/FirstSteps/FirstLoadComponent/cxx \
+DevelopersGuide/FirstSteps/HelloTextTableShape/cxx \
 DevelopersGuide/BasicAndDialogs/ToolkitControls \
 DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp \
 DevelopersGuide/Components/CppComponent \
diff --git a/odk/Package_examples.mk b/odk/Package_examples.mk
index 10b30815bf9c..87bad187b91b 100644
--- a/odk/Package_examples.mk
+++ b/odk/Package_examples.mk
@@ -189,6 +189,8 @@ $(eval $(call 
gb_Package_add_files_with_dir,odk_examples,$(SDKDIRNAME)/examples,
 DevelopersGuide/FirstSteps/FirstLoadComponent/basic/FirstLoadComponent.bas 
\
 DevelopersGuide/FirstSteps/FirstLoadComponent/python/FirstLoadComponent.py 
\
 
DevelopersGuide/FirstSteps/FirstLoadComponent/python/DualComponentLoader.py \
+DevelopersGuide/FirstSteps/HelloTextTableShape/cxx/HelloTextTableShape.cxx 
\
+DevelopersGuide/FirstSteps/HelloTextTableShape/cxx/Makefile \
 
DevelopersGuide/FirstSteps/HelloTextTableShape/java/HelloTextTableShape.java \
 DevelopersGuide/FirstSteps/HelloTextTableShape/java/Makefile \
 
DevelopersGuide/FirstSteps/HelloTextTableShape/basic/HelloTextTableShape.bas \
diff --git 
a/odk/examples/DevelopersGuide/FirstSteps/HelloTextTableShape/cxx/HelloTextTableShape.cxx
 
b/odk/examples/DevelopersGuide/FirstSteps/HelloTextTableShape/cxx/HelloTextTableShape.cxx
new file mode 100644
index ..3fa9c1b960fc
--- /dev/null
+++ 
b/odk/examples/DevelopersGuide/FirstSteps/HelloTextTableShape/cxx/HelloTextTableShape.cxx
@@ -0,0 +1,383 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * 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/.
+ */
+
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+using namespace css;
+using namespace cppu;
+using namespace css::uno;
+using namespace css::lang;
+using namespace css::frame;
+using namespace css::beans;
+using namespace css::sheet;
+using namespace css::table;
+using namespace css::text;
+using namespace css::drawing;
+using namespace css::awt;
+using namespace css::container;
+using namespace rtl;
+using namespace awt;
+
+void manipulateText(const Reference& xText);
+void manipulateTable(const Reference& xCellRange);
+void manipulateShape(const Reference& xShape);
+void useDocuments();
+void useWriter();
+void useCalc();
+void useDraw();
+Reference getComponentContext();
+Reference getRemoteServiceManager();
+Reference newDocComponent(const OUString docType);
+
+Reference xRemoteContext = NULL;
+Reference xRemoteServiceManager = NULL;
+
+SAL_IMPLEMENT_MAIN()
+{
+try
+{
+useDocuments();
+}
+catch (RuntimeException& e)
+{
+std::cerr << e.Message << "
";
+return 1;
+}
+return 0;
+}
+
+void useDocuments()
+{
+useWriter();
+useCalc();
+useDraw();
+}
+
+void useWriter()
+{
+// create new writer document and get text, then manipulate text
+Reference xWriterComponent = newDocComponent("swriter");
+Reference xTextDocument(xWriterComponent, UNO_QUERY_THROW);
+Reference xText = xTextDocument->getText();
+
+manipulateText(xText);
+
+// 

core.git: odk/examples

2024-03-10 Thread Hossein (via logerrit)
 
odk/examples/DevelopersGuide/FirstSteps/HelloTextTableShape/java/HelloTextTableShape.java
 |   28 +-
 1 file changed, 14 insertions(+), 14 deletions(-)

New commits:
commit 93c5a2513c7cb2f737a0e1f8de0b101bdc6337d4
Author: Hossein 
AuthorDate: Sun Mar 10 22:14:39 2024 +0100
Commit: Hossein 
CommitDate: Mon Mar 11 00:14:32 2024 +0100

Enable commented part in HelloTextTableShape.java

Commented code in the HelloTextTableShape.java example demonstrates the
use of bookmarks. This part is now enabled.

Change-Id: Iace525be0d53b01bed8b5a6a123384a678d1d761
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164636
Tested-by: Jenkins
Reviewed-by: Hossein 

diff --git 
a/odk/examples/DevelopersGuide/FirstSteps/HelloTextTableShape/java/HelloTextTableShape.java
 
b/odk/examples/DevelopersGuide/FirstSteps/HelloTextTableShape/java/HelloTextTableShape.java
index 66bb2d8d6420..2ea20e61b61f 100644
--- 
a/odk/examples/DevelopersGuide/FirstSteps/HelloTextTableShape/java/HelloTextTableShape.java
+++ 
b/odk/examples/DevelopersGuide/FirstSteps/HelloTextTableShape/java/HelloTextTableShape.java
@@ -46,6 +46,7 @@ import com.sun.star.text.XTextDocument;
 import com.sun.star.text.XText;
 import com.sun.star.text.XTextCursor;
 import com.sun.star.text.XTextContent;
+import com.sun.star.text.XTextRange;
 import com.sun.star.table.XCellRange;
 import com.sun.star.table.XCell;
 import com.sun.star.table.TableBorder;
@@ -58,6 +59,10 @@ import com.sun.star.container.XIndexAccess;
 import com.sun.star.drawing.XDrawPagesSupplier;
 import com.sun.star.drawing.XDrawPageSupplier;
 import com.sun.star.drawing.XDrawPage;
+import com.sun.star.container.XNamed;
+import com.sun.star.text.XBookmarksSupplier;
+import com.sun.star.text.XTextTablesSupplier;
+import com.sun.star.container.XNameAccess;
 
 public class HelloTextTableShape {
 
@@ -139,7 +144,7 @@ public class HelloTextTableShape {
 manipulateText(xShapeText);
 manipulateShape(xWriterShape);
 
-/* more code snippets used in the manual:
+// more code snippets used in the manual:
 
 Object bookmark = xWriterFactory.createInstance ( 
"com.sun.star.text.Bookmark" );
 // name the bookmark
@@ -150,22 +155,18 @@ public class HelloTextTableShape {
 // get XTextContent interface and insert it at the end of the 
document
 XTextContent xTextContent = (XTextContent) 
UnoRuntime.queryInterface (
 XTextContent.class, bookmark );
-//mxDocText.insertTextContent ( mxDocText.getEnd(), xTextContent, 
false );
 xText.insertTextContent ( xText.getEnd(), xTextContent, false );
 
-//query BookmarksSupplier
-XBookmarksSupplier xBookmarksSupplier = 
(XBookmarksSupplier)UnoRuntime.queryInterface(
-XBookmarksSupplier.class, xWriterComponent);
-XNameAccess xNamedBookmarks = 
xBookmarksSupplier.getBookmarks();
-Object foundBookmark = 
xNamedBookmarks.getByName("MyUniqueBookmarkName");
-XTextContent xFoundBookmark = 
(XTextContent)UnoRuntime.queryInterface(XTextContent.class, foundBookmark);
-XTextRange xFound = xFoundBookmark.getAnchor();
-xFound.setString(" The throat mike, glued to her neck, 
"
+//query BookmarksSupplier
+XBookmarksSupplier xBookmarksSupplier = 
(XBookmarksSupplier)UnoRuntime.queryInterface(
+XBookmarksSupplier.class, xWriterComponent);
+XNameAccess xNamedBookmarks = xBookmarksSupplier.getBookmarks();
+Object foundBookmark = 
xNamedBookmarks.getByName("MyUniqueBookmarkName");
+XTextContent xFoundBookmark = 
(XTextContent)UnoRuntime.queryInterface(XTextContent.class, foundBookmark);
+XTextRange xFound = xFoundBookmark.getAnchor();
+xFound.setString(" The throat mike, glued to her neck, "
 + "looked as much as possible like an analgesic 
dermadisk.");
 
-
-
-
 // first query the XTextTablesSupplier interface from our document
 XTextTablesSupplier xTablesSupplier = (XTextTablesSupplier) 
UnoRuntime.queryInterface(
 XTextTablesSupplier.class, xWriterComponent);
@@ -187,7 +188,6 @@ public class HelloTextTableShape {
 XPropertySet.class, table);
 xTableProps.setPropertyValue("BackColor", 
Integer.valueOf(0xC8FFB9));
 }
- */
 }
 catch( com.sun.star.lang.DisposedException e ) { //works from Patch 1
 xRemoteContext = null;


core.git: configure.ac

2024-02-27 Thread Hossein (via logerrit)
 configure.ac |9 +
 1 file changed, 9 insertions(+)

New commits:
commit 8f7d4f1da306fc7e104050c96ae1538c3f04c52f
Author: Hossein 
AuthorDate: Thu Feb 22 13:20:09 2024 +
Commit: Michael Stahl 
CommitDate: Tue Feb 27 10:49:29 2024 +0100

Check Windows SDK version

Because of a regression in Windows SDK version 10.0.19 which
is now fixed in 10.0.20348, it is good to check that the
required SDK version is installed:

More information

https://developercommunity.visualstudio.com/t/std:c17-generates-warning-compiling-Win/1249671

It is important to know that both Windows 10 and Windows 11 SDK should
work.

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

diff --git a/configure.ac b/configure.ac
index 276657f3cae1..6c6509ad3fd8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6829,6 +6829,15 @@ if test "$_os" = "WINNT"; then
 fi
 
 WINDOWS_SDK_LIB_SUBDIR=$winsdklibsubdir
+# The variable also contains the Windows SDK version
+echo $WINDOWS_SDK_LIB_SUBDIR
+IFS='.' read -r SDK_v1 SDK_v2 SDK_v3 SDK_v4 <<< 
"$WINDOWS_SDK_LIB_SUBDIR"
+# Assuming maximum of 5 digits for each part and ignoring last part
+SDK_NORMALIZED_VER=$((SDK_v1 * 100 + SDK_v2 * 10 + SDK_v3))
+# 10.0.20348.0 is the minumum required version
+if test "$SDK_NORMALIZED_VER" -lt 10020348; then
+AC_MSG_ERROR([You need Windows SDK greater than or equal 
10.0.20348.0])
+fi
 fi
 
 if test -n "$WINDOWS_SDK_HOME"; then


core.git: Branch 'libreoffice-7-6' - solenv/gbuild

2024-02-16 Thread Hossein (via logerrit)
 solenv/gbuild/platform/com_MSC_class.mk |8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit aeca67238e26cd148083055e0f223753f7462c14
Author: Hossein 
AuthorDate: Thu May 25 15:55:11 2023 +0200
Commit: Xisco Fauli 
CommitDate: Fri Feb 16 19:25:51 2024 +0100

tdf#155446 Fix problem with ccache on Windows

This patch fixes the recent problem with building LibreOffice with ccache
on Windows which was caused by the lack of double quotation mark between
ccache.exe and path to the MSVC compiler.

Change-Id: I1a714513ccb8cd674895d0c887013ea862d3b544
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152277
Tested-by: Jenkins
Reviewed-by: Hossein 
(cherry picked from commit 0c9f095a01682d8cb99a596e568bd81ae96906a5)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163505
Reviewed-by: Xisco Fauli 

diff --git a/solenv/gbuild/platform/com_MSC_class.mk 
b/solenv/gbuild/platform/com_MSC_class.mk
index ba42b0ba48df..d8cab84ff7c7 100644
--- a/solenv/gbuild/platform/com_MSC_class.mk
+++ b/solenv/gbuild/platform/com_MSC_class.mk
@@ -179,7 +179,7 @@ define gb_AsmObject__command
 $(call gb_Output_announce,$(2),$(true),ASM,3)
 $(call gb_Helper_abbreviate_dirs,\
 mkdir -p $(dir $(1)) $(dir $(4)) && \
-"$(CC)" -nologo -EP -D_M_ARM64 $(SOLARINC) $(3) > $(subst .o,.asm,$(1)) && 
\
+$(CC) -nologo -EP -D_M_ARM64 $(SOLARINC) $(3) > $(subst .o,.asm,$(1)) && \
 "$(ML_EXE)" $(gb_AFLAGS) -g -errorReport:prompt -o $(1) $(subst 
.o,.asm,$(1)), \
 ) && \
 echo "$(1) : $(3)" > $(4)
@@ -664,8 +664,12 @@ gb_AUTOCONF_WRAPPERS = \
 gb_ExternalProject_INCLUDE := \
$(subst -I,,$(subst $(WHITESPACE),;,$(SOLARINC)))
 
+# Workaround for openssl build - it puts the CC var into additional pair of 
quotes. This breaks if
+# CC consists of more than a single element such as when using "ccache 
compiler". In case the
+# variables are exported for openssl, it closes and reopens the quotes after 
each element.
 gb_NMAKE_VARS = \
-   CC="$(shell cygpath -w $(filter-out -%,$(CC))) $(filter -%,$(CC))" \
+   CC="$(subst $(WHITESPACE),$(if $(filter openssl,$(1)),\" \", ),$(strip \
+   $(shell cygpath -ws $(filter-out -%,$(CC))) $(filter 
-%,$(CC" \
INCLUDE="$(gb_ExternalProject_INCLUDE)" \
LIB="$(ILIB)" \
MAKEFLAGS= \


core.git: sc/inc sc/source

2024-01-29 Thread Hossein (via logerrit)
 sc/inc/globstr.hrc|1 +
 sc/source/ui/inc/datafdlg.hxx |2 +-
 sc/source/ui/view/cellsh2.cxx |   13 +
 3 files changed, 15 insertions(+), 1 deletion(-)

New commits:
commit 07203b8ed8cc7a392c196b695c9a5c60955b732b
Author: Hossein 
AuthorDate: Wed Jan 24 01:17:28 2024 +0100
Commit: Hossein 
CommitDate: Mon Jan 29 13:19:40 2024 +0100

tdf#158426 Limit field columns for data form to 32

Previously, maximum number of field columns for data form was 256, which
was too much. But, even with that value, nothing was happening when
exceeding that threshold. With this patch, the limit is decreased to 32,
and if the user goes beyond this limit by selecting more columns, an
error message is displayed. This change is done to prevent LibreOffice
hang when excessive number of filed columns are selected and using data
form is requested.

Change-Id: Ib6189b5b3beffb26a3fd8ba8cd06e4ae213f77da
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162488
Tested-by: Jenkins
Reviewed-by: Hossein 

diff --git a/sc/inc/globstr.hrc b/sc/inc/globstr.hrc
index 876fd231a316..b5badb52dff3 100644
--- a/sc/inc/globstr.hrc
+++ b/sc/inc/globstr.hrc
@@ -219,6 +219,7 @@
 #define STR_MATRIXFRAGMENTERR   NC_("STR_MATRIXFRAGMENTERR", 
"You cannot change only part of an array.")
 #define STR_PAGEHEADER  NC_("STR_PAGEHEADER", "Header")
 #define STR_PAGEFOOTER  NC_("STR_PAGEFOOTER", "Footer")
+#define STR_TOO_MANY_COLUMNS_DATA_FORM  
NC_("STR_TOO_MANY_COLUMNS_DATA_FORM", "Too many columns in the data form.")
 
 /* BEGIN error constants and error strings. */
 #define STR_ERROR_STR   NC_("STR_ERROR_STR", "Err:")
diff --git a/sc/source/ui/inc/datafdlg.hxx b/sc/source/ui/inc/datafdlg.hxx
index 4a05cbf1a1fc..cb61d0cc3cc5 100644
--- a/sc/source/ui/inc/datafdlg.hxx
+++ b/sc/source/ui/inc/datafdlg.hxx
@@ -16,7 +16,7 @@
 class ScTabViewShell;
 class ScDocument;
 
-#define MAX_DATAFORM_COLS   256
+#define MAX_DATAFORM_COLS   32
 #define MAX_DATAFORM_ROWS   32000
 
 class ScDataFormDlg : public weld::GenericDialogController
diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx
index 8911cb33fbc1..5fbde9ca526f 100644
--- a/sc/source/ui/view/cellsh2.cxx
+++ b/sc/source/ui/view/cellsh2.cxx
@@ -53,6 +53,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -353,6 +354,18 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
 
 case SID_DATA_FORM:
 {
+ScViewData& rData = GetViewData();
+ScRange aRange;
+rData.GetSimpleArea( aRange );
+ScAddress aStart = aRange.aStart;
+ScAddress aEnd = aRange.aEnd;
+
+if((aEnd.Col() - aStart.Col()) >= MAX_DATAFORM_COLS)
+{
+
rData.GetDocShell()->ErrorMessage(STR_TOO_MANY_COLUMNS_DATA_FORM);
+break;
+}
+
 ScAbstractDialogFactory* pFact = 
ScAbstractDialogFactory::Create();
 
 VclPtr pDlg(pFact->CreateScDataFormDlg(


core.git: include/LibreOfficeKit

2024-01-23 Thread Hossein (via logerrit)
 include/LibreOfficeKit/LibreOfficeKit.h |2 +-
 include/LibreOfficeKit/LibreOfficeKit.hxx   |6 +++---
 include/LibreOfficeKit/LibreOfficeKitGtk.h  |2 +-
 include/LibreOfficeKit/LibreOfficeKitInit.h |2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 0d37cbb937e4c8a72de07621ae7d4943b4a032e8
Author: Hossein 
AuthorDate: Tue Jan 9 00:44:16 2024 +
Commit: Tomaž Vajngerl 
CommitDate: Wed Jan 24 06:03:11 2024 +0100

Normalize include syntax in include/LibreOfficeKit

Changed #include  to #include "..." in the header
folder include/LibreOfficeKit/.

The reason is described in:

C[++]: Normalizing include syntax ("" vs <>)
https://lists.freedesktop.org/archives/libreoffice/2017-November/078778.html

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

diff --git a/include/LibreOfficeKit/LibreOfficeKit.h 
b/include/LibreOfficeKit/LibreOfficeKit.h
index ed7f4e7f2d28..963d7962a6c2 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.h
+++ b/include/LibreOfficeKit/LibreOfficeKit.h
@@ -21,7 +21,7 @@
 # include 
 #endif
 
-#include 
+#include "LibreOfficeKitTypes.h"
 
 #ifdef __cplusplus
 extern "C"
diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx 
b/include/LibreOfficeKit/LibreOfficeKit.hxx
index 6f75eb6be5cb..29e644900caf 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.hxx
+++ b/include/LibreOfficeKit/LibreOfficeKit.hxx
@@ -9,9 +9,9 @@
 
 #pragma once
 
-#include 
-#include 
-#include 
+#include "LibreOfficeKit.h"
+#include "LibreOfficeKitEnums.h"
+#include "LibreOfficeKitInit.h"
 
 /*
  * The reasons this C++ code is not as pretty as it could be are:
diff --git a/include/LibreOfficeKit/LibreOfficeKitGtk.h 
b/include/LibreOfficeKit/LibreOfficeKitGtk.h
index fe9310c46c51..26b1178c2667 100644
--- a/include/LibreOfficeKit/LibreOfficeKitGtk.h
+++ b/include/LibreOfficeKit/LibreOfficeKitGtk.h
@@ -13,7 +13,7 @@
 #include 
 #include 
 
-#include 
+#include "LibreOfficeKit.h"
 
  // Avoid "error C2375: 'foo': redefinition; different linkage" on MSVC
 #if defined LOK_DOC_VIEW_IMPLEMENTATION
diff --git a/include/LibreOfficeKit/LibreOfficeKitInit.h 
b/include/LibreOfficeKit/LibreOfficeKitInit.h
index 695784d27941..10085d3c1c35 100644
--- a/include/LibreOfficeKit/LibreOfficeKitInit.h
+++ b/include/LibreOfficeKit/LibreOfficeKitInit.h
@@ -10,7 +10,7 @@
 #ifndef INCLUDED_LIBREOFFICEKIT_LIBREOFFICEKITINIT_H
 #define INCLUDED_LIBREOFFICEKIT_LIBREOFFICEKITINIT_H
 
-#include 
+#include "LibreOfficeKit.h"
 
 #if defined __GNUC__ || defined __clang__
 #  define LOK_TOLERATE_UNUSED __attribute__((used))


core.git: sw/JunitTest_sw_complex.mk

2024-01-20 Thread Hossein (via logerrit)
 sw/JunitTest_sw_complex.mk |4 
 1 file changed, 4 insertions(+)

New commits:
commit 97337f5395ca1f4597690c97a19da9fd55ee1c66
Author: Hossein 
AuthorDate: Thu Jan 18 18:30:09 2024 +
Commit: Hossein 
CommitDate: Sun Jan 21 00:21:33 2024 +0100

Fix sw_complex JUnitTest not running

Call to gb_JunitTest_add_classes was missing in the gbuild makefile
sw/JunitTest_sw_complex.mk, and now it sholud be fixed. Before that
the sw/qa/complex/indeterminateState/CheckIndeterminateState.java was
compiled, but it was not run due to the missing class name
(complex.indeterminateState.CheckIndeterminateState) from the java
command which was used to invoke the test.

The test can be run with:

$ make JunitTest_sw_complex

Change-Id: I85823336d7f3ad2fde47442b5d1c5d2f3003299b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162263
Tested-by: Jenkins
Reviewed-by: Hossein 

diff --git a/sw/JunitTest_sw_complex.mk b/sw/JunitTest_sw_complex.mk
index 41785d5c49f6..45c5a29859d4 100644
--- a/sw/JunitTest_sw_complex.mk
+++ b/sw/JunitTest_sw_complex.mk
@@ -25,4 +25,8 @@ $(eval $(call gb_JunitTest_add_sourcefiles,sw_complex,\
 
 $(eval $(call gb_JunitTest_use_unoapi_jars,sw_complex))
 
+$(eval $(call gb_JunitTest_add_classes,sw_complex,\
+complex.indeterminateState.CheckIndeterminateState \
+))
+
 # vim: set noet sw=4 ts=4:


core.git: odk/CustomTarget_build-examples.mk odk/examples odk/Package_examples.mk

2024-01-16 Thread Hossein (via logerrit)
 odk/CustomTarget_build-examples.mk   |
1 
 odk/Package_examples.mk  |
7 +
 odk/examples/python/minimal-extension/Addons.xcu |   
28 
 odk/examples/python/minimal-extension/META-INF/manifest.xml  |
7 +
 odk/examples/python/minimal-extension/Makefile   |   
25 +++
 odk/examples/python/minimal-extension/description.xml|   
19 ++
 odk/examples/python/minimal-extension/main.py|   
68 ++
 odk/examples/python/minimal-extension/pkg-description/pkg-description.en |
1 
 odk/examples/python/minimal-extension/registration/license.txt   |
1 
 9 files changed, 157 insertions(+)

New commits:
commit b9a36edc6d435cb1b4bf8e950cd4dc49ecead2bc
Author: Hossein 
AuthorDate: Fri Nov 24 18:45:47 2023 +
Commit: Hossein 
CommitDate: Tue Jan 16 10:54:20 2024 +0100

Add a minimal Python extension

This is a minimal Python extension. It is possible to run main.py from:

1. Inside a LibreOffice extension
2. Inside LibreOffice, and also via APSO
3. Outside LibreOffice, as an external process, and also in a Python IDE

The provided Python script is very useful for debugging extensions as an
example. That is because it is possible to debug it in an IDE before
packaging it as a LibreOffice extension.

Python file is checked with:

$ flake8 --ignore E501 main.py

Change-Id: I24d9aefdfda29264bf6b5f9403a40fae35e610f6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159938
Tested-by: Jenkins
Reviewed-by: Hossein 

diff --git a/odk/CustomTarget_build-examples.mk 
b/odk/CustomTarget_build-examples.mk
index 4a725ad78846..dd5a2e58732e 100644
--- a/odk/CustomTarget_build-examples.mk
+++ b/odk/CustomTarget_build-examples.mk
@@ -28,6 +28,7 @@ my_example_dirs = \
 cpp/counter \
 cpp/remoteclient \
 python/toolpanel \
+python/minimal-extension \
 
 
 #cpp/custompanel \
diff --git a/odk/Package_examples.mk b/odk/Package_examples.mk
index fe8d927c6d85..eb6c3563c5f5 100644
--- a/odk/Package_examples.mk
+++ b/odk/Package_examples.mk
@@ -551,6 +551,13 @@ $(eval $(call 
gb_Package_add_files_with_dir,odk_examples,$(SDKDIRNAME)/examples,
 python/toolpanel/toolpanel.component \
 python/toolpanel/toolpanel.py \
 python/toolpanel/toolpanels/poc.xdl \
+python/minimal-extension/Makefile \
+python/minimal-extension/main.py \
+python/minimal-extension/description.xml \
+python/minimal-extension/Addons.xcu \
+python/minimal-extension/registration/license.txt \
+python/minimal-extension/pkg-description/pkg-description.en \
+python/minimal-extension/META-INF/manifest.xml \
 python/DocumentHandling/DocumentConverter.py \
 python/DocumentHandling/DocumentLoader.py \
 python/DocumentHandling/DocumentPrinter.py \
diff --git a/odk/examples/python/minimal-extension/Addons.xcu 
b/odk/examples/python/minimal-extension/Addons.xcu
new file mode 100644
index ..5d40bad39a19
--- /dev/null
+++ b/odk/examples/python/minimal-extension/Addons.xcu
@@ -0,0 +1,28 @@
+http://openoffice.org/2001/registry; 
xmlns:xs="http://www.w3.org/2001/XMLSchema; oor:name="Addons" 
oor:package="org.openoffice.Office">
+  
+
+  
+
+  Sample Extension
+
+
+  com.sun.star.text.TextDocument
+
+
+  
+
+  Example item
+
+
+  service:org.extension.sample.do?FirstMenuItem
+
+
+  _self
+
+  
+
+  
+
+  
+
+
diff --git a/odk/examples/python/minimal-extension/META-INF/manifest.xml 
b/odk/examples/python/minimal-extension/META-INF/manifest.xml
new file mode 100644
index ..a3f7700875a3
--- /dev/null
+++ b/odk/examples/python/minimal-extension/META-INF/manifest.xml
@@ -0,0 +1,7 @@
+
+
+http://openoffice.org/2001/manifest;>
+   
+   
+   
+
diff --git a/odk/examples/python/minimal-extension/Makefile 
b/odk/examples/python/minimal-extension/Makefile
new file mode 100644
index ..0cd40a43c1b3
--- /dev/null
+++ b/odk/examples/python/minimal-extension/Makefile
@@ -0,0 +1,25 @@
+#
+# 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/.
+#
+
+PRJ = ../../..
+SETTINGS = $(PRJ)/settings
+
+include $(SETTINGS)/settings.mk
+include $(SETTINGS)/std.mk
+
+FILES = \
+Addons.xcu \
+META-INF/manifest.xml \
+description.xml \
+pkg-description/pkg-description.en \
+registration/license.txt \
+main.py
+
+$(OUT_BIN)/minimal-python.$(UNOOXT_EXT): $(FILES)
+   -$(MKDIR) $(subst 

core.git: include/svl

2024-01-05 Thread Hossein (via logerrit)
 include/svl/style.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 1ec3ef4db8c4c03d89a3d86c0e633effde04efda
Author: Hossein 
AuthorDate: Thu Jan 4 10:32:49 2024 +
Commit: Hossein 
CommitDate: Fri Jan 5 23:30:47 2024 +0100

Update comment to match function parameters

One parameter of SfxStyleSheetBasePool::Make function was changed in
0035573ee7798cdf54ef44a54306a0515eeb90a7, but that change was not
reflected in the comment. It is now updated.

Change-Id: I89f7c1a6e0424d11acddf1f94d3af370af691b36
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161611
Tested-by: Jenkins
Reviewed-by: Hossein 

diff --git a/include/svl/style.hxx b/include/svl/style.hxx
index 0e3a09ec442e..75ebe788c737 100644
--- a/include/svl/style.hxx
+++ b/include/svl/style.hxx
@@ -101,7 +101,7 @@ SfxSimpleHint(SfxHintId::Dying) from:
 
 SfxStyleSheetHint( SfxHintId::StyleSheetCreated, *p ) from:
SfxStyleSheetBasePool::Make( const String& rName,
-   SfxStyleFamily eFam, sal_uInt16 mask)
+   SfxStyleFamily eFam, SfxStyleSearchBits mask)
 
 SfxStyleSheetHint( SfxHintId::StyleSheetChanged, *pNew ) from:
SfxStyleSheetBasePool::Add( SfxStyleSheetBase& rSheet )


[Libreoffice-commits] core.git: odk/examples

2023-11-21 Thread Hossein (via logerrit)
 odk/examples/DevelopersGuide/FirstSteps/FirstLoadComponent/cxx/Makefile   |
2 +-
 odk/examples/DevelopersGuide/FirstSteps/FirstLoadComponent/java/Makefile  |
2 +-
 odk/examples/DevelopersGuide/FirstSteps/FirstUnoContact/cxx/Makefile  |
2 +-
 odk/examples/DevelopersGuide/FirstSteps/FirstUnoContact/java/Makefile |
2 +-
 odk/examples/DevelopersGuide/FirstSteps/HelloTextTableShape/java/Makefile |
2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 42edec63fba4a3ddc0dcd83a5affb7913625b42a
Author: Hossein 
AuthorDate: Tue Nov 21 12:05:10 2023 +0100
Commit: Hossein 
CommitDate: Tue Nov 21 13:31:36 2023 +0100

Cleanup make files for Java/C++ SDK examples

This fixes some minor issues with the make files for Java/C++ SDK
examples in DevelopersGuide/FirstSteps.

For Java examples, an exatra "-f Example_Java.mk" was a leftover from a
previous change.

For C++ examples, 'make clean' was not working correctly, because of a
leftover from a previous change.

Both should be fixed now.

Change-Id: Id936824675a9bfd43674ca526bc97a998ed9daf8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159777
Tested-by: Jenkins
Reviewed-by: Hossein 

diff --git 
a/odk/examples/DevelopersGuide/FirstSteps/FirstLoadComponent/cxx/Makefile 
b/odk/examples/DevelopersGuide/FirstSteps/FirstLoadComponent/cxx/Makefile
index 20f6b34bd8c9..47df3bdc4fa5 100644
--- a/odk/examples/DevelopersGuide/FirstSteps/FirstLoadComponent/cxx/Makefile
+++ b/odk/examples/DevelopersGuide/FirstSteps/FirstLoadComponent/cxx/Makefile
@@ -97,4 +97,4 @@ clean :
-$(DELRECURSIVE) $(subst /,$(PS),$(OUT_APP_INC))
-$(DELRECURSIVE) $(subst /,$(PS),$(OUT_APP_GEN))
-$(DELRECURSIVE) $(subst /,$(PS),$(OUT_APP_OBJ))
-   -$(DEL) $(subst \\,\,$(subst /,$(PS),$(OUT_BIN)/*SimpleBootstrap*))
+   -$(DEL) $(subst \\,\,$(subst /,$(PS),$(OUT_BIN)/*FirstLoadComponent*))
diff --git 
a/odk/examples/DevelopersGuide/FirstSteps/FirstLoadComponent/java/Makefile 
b/odk/examples/DevelopersGuide/FirstSteps/FirstLoadComponent/java/Makefile
index 94f2332ca066..091c9bcda3e0 100644
--- a/odk/examples/DevelopersGuide/FirstSteps/FirstLoadComponent/java/Makefile
+++ b/odk/examples/DevelopersGuide/FirstSteps/FirstLoadComponent/java/Makefile
@@ -81,7 +81,7 @@ $(EXAMPLE_NAME) : $(APP_JAR)
@echo 

@echo Please use the following command to execute the example!
@echo -
-   @echo $(MAKE) -f Example_Java.mk $(APP_NAME).run
+   @echo $(MAKE) $(APP_NAME).run
@echo 

 
 %.run: $(OUT_APP_CLASS)/%.jar
diff --git 
a/odk/examples/DevelopersGuide/FirstSteps/FirstUnoContact/cxx/Makefile 
b/odk/examples/DevelopersGuide/FirstSteps/FirstUnoContact/cxx/Makefile
index dca5fa92506b..a996044c602a 100644
--- a/odk/examples/DevelopersGuide/FirstSteps/FirstUnoContact/cxx/Makefile
+++ b/odk/examples/DevelopersGuide/FirstSteps/FirstUnoContact/cxx/Makefile
@@ -97,4 +97,4 @@ clean :
-$(DELRECURSIVE) $(subst /,$(PS),$(OUT_APP_INC))
-$(DELRECURSIVE) $(subst /,$(PS),$(OUT_APP_GEN))
-$(DELRECURSIVE) $(subst /,$(PS),$(OUT_APP_OBJ))
-   -$(DEL) $(subst \\,\,$(subst /,$(PS),$(OUT_BIN)/*SimpleBootstrap*))
+   -$(DEL) $(subst \\,\,$(subst /,$(PS),$(OUT_BIN)/*FirstUnoContact*))
diff --git 
a/odk/examples/DevelopersGuide/FirstSteps/FirstUnoContact/java/Makefile 
b/odk/examples/DevelopersGuide/FirstSteps/FirstUnoContact/java/Makefile
index 4dca4468f74a..eae7d4452ffe 100644
--- a/odk/examples/DevelopersGuide/FirstSteps/FirstUnoContact/java/Makefile
+++ b/odk/examples/DevelopersGuide/FirstSteps/FirstUnoContact/java/Makefile
@@ -81,7 +81,7 @@ $(EXAMPLE_NAME) : $(APP_JAR)
@echo 

@echo Please use the following command to execute the example!
@echo -
-   @echo $(MAKE) -f Example_Java.mk $(APP_NAME).run
+   @echo $(MAKE) $(APP_NAME).run
@echo 

 
 %.run: $(OUT_APP_CLASS)/%.jar
diff --git 
a/odk/examples/DevelopersGuide/FirstSteps/HelloTextTableShape/java/Makefile 
b/odk/examples/DevelopersGuide/FirstSteps/HelloTextTableShape/java/Makefile
index a208b6eb6006..615e86bf3f25 100644
--- a/odk/examples/DevelopersGuide/FirstSteps/HelloTextTableShape/java/Makefile
+++ b/odk/examples/DevelopersGuide/FirstSteps/HelloTextTableShape/java/Makefile
@@ -81,7 +81,7 @@ $(EXAMPLE_NAME) : $(APP_JAR)
@echo 

@echo Please use the following command to execute the example!
@echo -
-   @echo $(MAKE) -f Example_Java.mk $(APP_NAME).run
+   @echo $(MAKE) $(APP_NAME).run
@echo 

[Libreoffice-commits] core.git: odk/CustomTarget_build-examples.mk odk/examples odk/Package_examples.mk

2023-11-20 Thread Hossein (via logerrit)
 odk/CustomTarget_build-examples.mk 
   |1 
 odk/Package_examples.mk
   |2 
 
odk/examples/DevelopersGuide/FirstSteps/FirstLoadComponent/cxx/FirstLoadComponent.cxx
 |  148 ++
 odk/examples/DevelopersGuide/FirstSteps/FirstLoadComponent/cxx/Makefile
   |  100 ++
 4 files changed, 251 insertions(+)

New commits:
commit ae61f6aa2b5f6156f61c4fd2cceb5b1206450c48
Author: Hossein 
AuthorDate: Mon Nov 20 14:01:56 2023 +
Commit: Hossein 
CommitDate: Tue Nov 21 00:50:15 2023 +0100

tdf#143122 Port FirstLoadComponent example to C++

Port DevelopersGuide/FirstSteps/FirstLoadComponent Java SDK example to
C++ and add a GNU Makefile for the build.

Change-Id: I24da0422014e42f844cae21863d54301dd902f0e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159740
Tested-by: Jenkins
Reviewed-by: Hossein 

diff --git a/odk/CustomTarget_build-examples.mk 
b/odk/CustomTarget_build-examples.mk
index d1810e28aabc..4a725ad78846 100644
--- a/odk/CustomTarget_build-examples.mk
+++ b/odk/CustomTarget_build-examples.mk
@@ -11,6 +11,7 @@ my_example_dirs = \
 CLI/CSharp/Spreadsheet \
 CLI/VB.NET/WriterDemo \
 DevelopersGuide/FirstSteps/FirstUnoContact/cxx \
+DevelopersGuide/FirstSteps/FirstLoadComponent/cxx \
 DevelopersGuide/BasicAndDialogs/ToolkitControls \
 DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp \
 DevelopersGuide/Components/CppComponent \
diff --git a/odk/Package_examples.mk b/odk/Package_examples.mk
index 9e5bc65dcc9a..71682c4c65a1 100644
--- a/odk/Package_examples.mk
+++ b/odk/Package_examples.mk
@@ -178,6 +178,8 @@ $(eval $(call 
gb_Package_add_files_with_dir,odk_examples,$(SDKDIRNAME)/examples,
 DevelopersGuide/FirstSteps/FirstUnoContact/java/build.xml \
 DevelopersGuide/FirstSteps/FirstUnoContact/basic/FirstUnoContact.bas \
 DevelopersGuide/FirstSteps/FirstUnoContact/python/FirstUnoContact.py \
+DevelopersGuide/FirstSteps/FirstLoadComponent/cxx/FirstLoadComponent.cxx \
+DevelopersGuide/FirstSteps/FirstLoadComponent/cxx/Makefile \
 DevelopersGuide/FirstSteps/FirstLoadComponent/java/FirstLoadComponent.java 
\
 DevelopersGuide/FirstSteps/FirstLoadComponent/java/Makefile \
 DevelopersGuide/FirstSteps/FirstLoadComponent/basic/FirstLoadComponent.bas 
\
diff --git 
a/odk/examples/DevelopersGuide/FirstSteps/FirstLoadComponent/cxx/FirstLoadComponent.cxx
 
b/odk/examples/DevelopersGuide/FirstSteps/FirstLoadComponent/cxx/FirstLoadComponent.cxx
new file mode 100644
index ..9ac650ad49af
--- /dev/null
+++ 
b/odk/examples/DevelopersGuide/FirstSteps/FirstLoadComponent/cxx/FirstLoadComponent.cxx
@@ -0,0 +1,148 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * 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/.
+ */
+
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+using namespace rtl;
+using namespace cppu;
+using namespace css::uno;
+using namespace css::lang;
+using namespace css::frame;
+using namespace css::container;
+using namespace css::sheet;
+using namespace css::beans;
+using namespace css::table;
+
+SAL_IMPLEMENT_MAIN()
+{
+try
+{
+Reference xRemoteContext = bootstrap();
+if (!xRemoteContext.is())
+{
+std::cerr << "ERROR: Could not bootstrap default Office.\n";
+return 1;
+}
+
+Reference xRemoteServiceManager
+= xRemoteContext->getServiceManager();
+
+Reference desktop = 
xRemoteServiceManager->createInstanceWithContext(
+"com.sun.star.frame.Desktop", xRemoteContext);
+Reference xComponentLoader
+= Reference(desktop, UNO_QUERY);
+
+Sequence loadProps(0);
+Reference xSpreadsheetComponent = 
xComponentLoader->loadComponentFromURL(
+"private:factory/scalc", "_blank", 0, loadProps);
+
+Reference 
xSpreadsheetDocument(xSpreadsheetComponent, UNO_QUERY);
+Reference xSpreadsheets = 
xSpreadsheetDocument->getSheets();
+xSpreadsheets->insertNewByName("MySheet", (sal_Int16)0);
+Type elemType = xSpreadsheets->getElementType();
+
+std::cout << elemType.getTypeName() << std::endl;
+Any sheet = xSpreadsheets->getByName("MySheet");
+Reference xSpreadsheet(sheet, UNO_QUERY);
+
+Reference xCell = xSpreadsheet->getCellByPosition(0, 0);
+

[Libreoffice-commits] core.git: odk/CustomTarget_build-examples_java.mk odk/CustomTarget_build-examples.mk odk/examples odk/Package_examples.mk

2023-11-20 Thread Hossein (via logerrit)
 odk/CustomTarget_build-examples.mk|
2 
 odk/CustomTarget_build-examples_java.mk   |
4 
 odk/Package_examples.mk   |   
22 +-
 odk/examples/DevelopersGuide/FirstSteps/FirstLoadComponent/java/Makefile  |   
24 --
 odk/examples/DevelopersGuide/FirstSteps/FirstUnoContact/cxx/Makefile  |
2 
 odk/examples/DevelopersGuide/FirstSteps/FirstUnoContact/java/Makefile |   
92 ++
 odk/examples/DevelopersGuide/FirstSteps/HelloTextTableShape/java/Makefile |   
92 ++
 odk/examples/DevelopersGuide/examples.html|   
12 -
 8 files changed, 218 insertions(+), 32 deletions(-)

New commits:
commit bc5c767e9aebadf12aa6a181a6ce066cbfff71ad
Author: Hossein 
AuthorDate: Mon Nov 20 12:32:26 2023 +0100
Commit: Hossein 
CommitDate: Mon Nov 20 14:59:10 2023 +0100

Separate folders for DevelopersGuide/FirstSteps

This patch creates separate folders for 3 different SDK examples in
DevelopersGuide/FirstSteps:

1. FirstUnoContact
2. FirstLoadComponent
3. HelloTextTableShape

Each one of these are ported to 4 languages: Java, C++, BASIC, Python.
The Java Makefile in the top folder is now separated into 3 different
Makefiles for Java programs.

Change-Id: Ifb2003be2aafb4caec4810eb21fbb4708b9a0628
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159591
Tested-by: Hossein 
Reviewed-by: Hossein 

diff --git a/odk/CustomTarget_build-examples.mk 
b/odk/CustomTarget_build-examples.mk
index f536d8351b7b..d1810e28aabc 100644
--- a/odk/CustomTarget_build-examples.mk
+++ b/odk/CustomTarget_build-examples.mk
@@ -10,7 +10,7 @@
 my_example_dirs = \
 CLI/CSharp/Spreadsheet \
 CLI/VB.NET/WriterDemo \
-DevelopersGuide/FirstSteps/cxx \
+DevelopersGuide/FirstSteps/FirstUnoContact/cxx \
 DevelopersGuide/BasicAndDialogs/ToolkitControls \
 DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp \
 DevelopersGuide/Components/CppComponent \
diff --git a/odk/CustomTarget_build-examples_java.mk 
b/odk/CustomTarget_build-examples_java.mk
index f49429677e0e..213aa35cff75 100644
--- a/odk/CustomTarget_build-examples_java.mk
+++ b/odk/CustomTarget_build-examples_java.mk
@@ -19,7 +19,9 @@ my_example_dirs_java = \
 DevelopersGuide/Config \
 DevelopersGuide/Database \
 DevelopersGuide/Drawing \
-DevelopersGuide/FirstSteps \
+DevelopersGuide/FirstSteps/FirstUnoContact/java \
+DevelopersGuide/FirstSteps/FirstLoadComponent/java \
+DevelopersGuide/FirstSteps/HelloTextTableShape/java \
 DevelopersGuide/Forms \
 DevelopersGuide/GUI \
 DevelopersGuide/OfficeBean \
diff --git a/odk/Package_examples.mk b/odk/Package_examples.mk
index f533a91a346c..9e5bc65dcc9a 100644
--- a/odk/Package_examples.mk
+++ b/odk/Package_examples.mk
@@ -19,8 +19,6 @@ $(eval $(call 
gb_Package_add_files_with_dir,odk_examples,$(SDKDIRNAME)/examples,
 CLI/CSharp/Spreadsheet/ViewSample.cs \
 CLI/VB.NET/WriterDemo/Makefile \
 CLI/VB.NET/WriterDemo/WriterDemo.vb \
-DevelopersGuide/FirstSteps/cxx/FirstUnoContact.cxx \
-DevelopersGuide/FirstSteps/cxx/Makefile \
 DevelopersGuide/BasicAndDialogs/CreatingDialogs/CreatingDialogs.odt \
 DevelopersGuide/BasicAndDialogs/CreatingDialogs/Makefile \
 DevelopersGuide/BasicAndDialogs/CreatingDialogs/SampleDialog.java \
@@ -173,11 +171,21 @@ $(eval $(call 
gb_Package_add_files_with_dir,odk_examples,$(SDKDIRNAME)/examples,
 
DevelopersGuide/Extensions/DialogWithHelp/help/en/com.foocorp.foo-ext/page1.xhp 
\
 
DevelopersGuide/Extensions/DialogWithHelp/help/en/com.foocorp.foo-ext/page2.xhp 
\
 
DevelopersGuide/Extensions/DialogWithHelp/help/en/com.foocorp.foo-ext/subfolder/anotherpage.xhp
 \
-DevelopersGuide/FirstSteps/FirstLoadComponent.java \
-DevelopersGuide/FirstSteps/FirstUnoContact.java \
-DevelopersGuide/FirstSteps/HelloTextTableShape.java \
-DevelopersGuide/FirstSteps/Makefile \
-DevelopersGuide/FirstSteps/build_FirstUnoContact.xml \
+DevelopersGuide/FirstSteps/FirstUnoContact/cxx/FirstUnoContact.cxx \
+DevelopersGuide/FirstSteps/FirstUnoContact/cxx/Makefile \
+DevelopersGuide/FirstSteps/FirstUnoContact/java/FirstUnoContact.java \
+DevelopersGuide/FirstSteps/FirstUnoContact/java/Makefile \
+DevelopersGuide/FirstSteps/FirstUnoContact/java/build.xml \
+DevelopersGuide/FirstSteps/FirstUnoContact/basic/FirstUnoContact.bas \
+DevelopersGuide/FirstSteps/FirstUnoContact/python/FirstUnoContact.py \
+DevelopersGuide/FirstSteps/FirstLoadComponent/java/FirstLoadComponent.java 
\
+DevelopersGuide/FirstSteps/FirstLoadComponent/java/Makefile \
+DevelopersGuide/FirstSteps/FirstLoadComponent/basic/FirstLoadComponent.bas 
\
+DevelopersGuide/FirstSteps/FirstLoadComponent/python/FirstLoadComponent.py 
\
+

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

2023-10-18 Thread Hossein (via logerrit)
 basctl/source/basicide/brkdlg.cxx |7 +--
 1 file changed, 1 insertion(+), 6 deletions(-)

New commits:
commit e94cbd7dbf4a8c82f17522806a9011c89bf20865
Author: Hossein 
AuthorDate: Wed Oct 18 10:29:22 2023 +0200
Commit: Hossein 
CommitDate: Wed Oct 18 17:41:52 2023 +0200

Remove obsolete comments in basctl

First comment was last updated with USHORT -> sal_uInt16 in
a2242be9c3551310027b341db53164ebd78bc6c8 but with the newer commit
68ec95b3f80408ae50897b043eed69a07d084df9 there is no remaining sal_uInt16
left, and thus the comment is no longer relevant.

Second comment was added in 1fac87f84723a3d6e7e13c091e39b09e0dea1aa5,
but with changes in 444c242c51e6b049598359ea6cf98e34f611838b it is no
longer relevant.

Third comment was also last updated with USHORT -> sal_uInt16 in
a2242be9c3551310027b341db53164ebd78bc6c8 but with the newer commit
444c242c51e6b049598359ea6cf98e34f611838b it is no longer relevant.

Change-Id: I9ed383f15a5b403740c0b8bcdd153d04bb1a2b0c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158111
Tested-by: Jenkins
Reviewed-by: Hossein 

diff --git a/basctl/source/basicide/brkdlg.cxx 
b/basctl/source/basicide/brkdlg.cxx
index 37ba1dbb60ae..48522d11ac37 100644
--- a/basctl/source/basicide/brkdlg.cxx
+++ b/basctl/source/basicide/brkdlg.cxx
@@ -28,15 +28,11 @@
 
 namespace basctl
 {
-// FIXME  Why does BreakPointDialog allow only sal_uInt16 for break-point line
-// numbers, whereas BreakPoint supports sal_uLong?
-
 namespace
 {
 bool lcl_ParseText(OUString const& rText, size_t& rLineNr)
 {
-// aText should look like "# n" where
-// n > 0 && n < std::numeric_limits< sal_uInt16 >::max().
+// aText should look like "# n" where n > 0
 // All spaces are ignored, so there can even be spaces within the
 // number n.  (Maybe it would be better to ignore all whitespace instead
 // of just spaces.)
@@ -48,7 +44,6 @@ bool lcl_ParseText(OUString const& rText, size_t& rLineNr)
 return false;
 if (cFirst == '#')
 aText = aText.copy(1);
-// XXX Assumes that sal_uInt16 is contained within sal_Int32:
 sal_Int32 n = aText.toInt32();
 if (n <= 0)
 return false;


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

2023-10-05 Thread Hossein (via logerrit)
 dev/null |binary
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx |9 -
 sw/qa/extras/ooxmlexport/ooxmlexport3.cxx|2 +-
 sw/source/filter/ww8/docxattributeoutput.cxx |3 ---
 4 files changed, 1 insertion(+), 13 deletions(-)

New commits:
commit e0bedd3f7311bf47392a46d097304e3c7afcb246
Author: Hossein 
AuthorDate: Wed Oct 4 22:22:06 2023 +0200
Commit: Xisco Fauli 
CommitDate: Thu Oct 5 10:14:59 2023 +0200

Revert "tdf#155470 DOCX export: fix RTL numbers changed to LTR"

This reverts commit 40ed8dd3a5a16f21f2e98440c62efa0fa6ec60ff.

Reason for revert: tdf#157598 problem with LTR documents

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

diff --git a/sw/qa/extras/ooxmlexport/data/numbers-rtl.docx 
b/sw/qa/extras/ooxmlexport/data/numbers-rtl.docx
deleted file mode 100644
index 2142967a3619..
Binary files a/sw/qa/extras/ooxmlexport/data/numbers-rtl.docx and /dev/null 
differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 60e097925829..cbca150319b7 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -1106,15 +1106,6 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf115094v3)
 assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblPr/w:tblpPr", "tblpY", 
"1064");
 }
 
-CPPUNIT_TEST_FIXTURE(Test, testTdf155470)
-{
-loadAndSave("numbers-rtl.docx");
-xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
-
-// Make sure that  is preserved
-assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:rPr/w:rtl");
-}
-
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
index 9458051ea6d3..db2abe3513a7 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
@@ -174,7 +174,7 @@ CPPUNIT_TEST_FIXTURE(Test, testStyleInheritance)
 
 // We output exactly 2 properties in rPrDefault, nothing else was
 // introduced as an additional default
-assertXPath(pXmlStyles, "/w:styles/w:docDefaults/w:rPrDefault/w:rPr/*", 3);
+assertXPath(pXmlStyles, "/w:styles/w:docDefaults/w:rPrDefault/w:rPr/*", 2);
 // Check that we output real content of rPrDefault
 assertXPath(pXmlStyles, 
"/w:styles/w:docDefaults/w:rPrDefault/w:rPr/w:rFonts", "ascii", "Times New 
Roman");
 assertXPath(pXmlStyles, 
"/w:styles/w:docDefaults/w:rPrDefault/w:rPr/w:lang", "bidi", "ar-SA");
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 4f0c67f3ce99..9c67855acbdd 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -160,7 +160,6 @@
 #include 
 #include 
 #include 
-#include 
 
 using ::editeng::SvxBorderLine;
 
@@ -7932,8 +7931,6 @@ void DocxAttributeOutput::CharLanguage( const 
SvxLanguageItem& rLanguage )
 AddToAttrList( m_pCharLangAttrList, FSNS( XML_w, XML_eastAsia ), 
aLanguageCode );
 break;
 case RES_CHRATR_CTL_LANGUAGE:
-if (MsLangId::isRightToLeft(rLanguage.GetLanguage()))
-m_pSerializer->singleElementNS(XML_w, XML_rtl);
 AddToAttrList( m_pCharLangAttrList, FSNS( XML_w, XML_bidi ), 
aLanguageCode );
 break;
 }


[Libreoffice-commits] core.git: bin/run

2023-09-20 Thread Hossein (via logerrit)
 bin/run |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit a34dcd03254480927c403d904c0e754802d97b90
Author: Hossein 
AuthorDate: Sat Sep 16 03:05:34 2023 +0200
Commit: Hossein 
CommitDate: Wed Sep 20 14:23:33 2023 +0200

Prepend instdir/program to the PATH in bin/run

To avoid problems described in 21cf443235bf6579959988edee325e8332a42f9f,
do not change directory.

Change-Id: I56590c4728a6505c089a5bc06bed2a31a0cd0362
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156973
Tested-by: Hossein 
Reviewed-by: Hossein 

diff --git a/bin/run b/bin/run
index b154834c1db5..be78c38d55e6 100755
--- a/bin/run
+++ b/bin/run
@@ -71,9 +71,8 @@ if uname | grep -i CYGWIN >/dev/null; then
 
 exedir=$(cygpath -m "${dir}"/workdir/LinkTarget/Executable)
 export URE_BOOTSTRAP=file:///$(cygpath -m 
"${dir}")/instdir/program/fundamental.ini
-export PATH=${PATH:+$PATH:}"${dir}"/instdir/program
+export PATH="${dir}/instdir/program${PATH:+:$PATH}"
 SEARCH_PATH="${PATH}"
-cd instdir/program
 
 elif [ $(uname) = Darwin ]; then
 


[Libreoffice-commits] core.git: odk/examples

2023-09-16 Thread Hossein (via logerrit)
 odk/examples/DevelopersGuide/FirstSteps/FirstLoadComponent.bas  |   41 +
 odk/examples/DevelopersGuide/FirstSteps/FirstUnoContact.bas |   17 
 odk/examples/DevelopersGuide/FirstSteps/HelloTextTableShape.bas |  223 
++
 3 files changed, 281 insertions(+)

New commits:
commit 930f0aa232611d751209c5cb089b9f282f26bde8
Author: Hossein 
AuthorDate: Sat Sep 16 14:05:03 2023 +0200
Commit: Hossein 
CommitDate: Sat Sep 16 15:08:31 2023 +0200

tdf#157273 Port DevelopersGuide/FirstSteps examples to BASIC

These 3 examples from the chapter 1 of the DevGuide are ported to BASIC:

1) FirstUnoContact
2) FirstLoadComponent
3) HelloTextTableShape

More details can be found in the LibreOffice DevGuide:

LibreOffice Developer's Guide: Chapter 1 - First Steps
https://wiki.documentfoundation.org/Documentation/DevGuide/First_Steps

Change-Id: I577ad81d76cec06102f00b2646b004caa5f7b401
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156976
Tested-by: Jenkins
Reviewed-by: Hossein 

diff --git a/odk/examples/DevelopersGuide/FirstSteps/FirstLoadComponent.bas 
b/odk/examples/DevelopersGuide/FirstSteps/FirstLoadComponent.bas
new file mode 100644
index ..e11b91b23596
--- /dev/null
+++ b/odk/examples/DevelopersGuide/FirstSteps/FirstLoadComponent.bas
@@ -0,0 +1,41 @@
+'
+' 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/.
+'
+
+Sub Main
+desktop = createUnoService("com.sun.star.frame.Desktop")
+Dim args()
+spreadsheet_component = 
desktop.loadComponentFromURL("private:factory/scalc", "_blank", 0, args())
+
+spreadsheets = spreadsheet_component.getSheets()
+spreadsheets.insertNewByName("MySheet", 0)
+elem_type = spreadsheets.getElementType()
+Msgbox(elem_type.Name)
+sheet = spreadsheets.getByName("MySheet")
+cell = sheet.getCellByPosition(0, 0)
+cell.setValue(21)
+cell = sheet.getCellByPosition(0, 1)
+cell.setValue(21)
+cell = sheet.getCellByPosition(0, 2)
+cell.setFormula("=sum(A1:A2)")
+
+cell.setPropertyValue("CellStyle", "Result")
+
+spreadsheet_controller = spreadsheet_component.getCurrentController()
+spreadsheet_controller.setActiveSheet(sheet)
+cell.setPropertyValue("VertJustify", 
"com.sun.star.table.CellVertJustify.TOP")
+formula_cells = 
sheet.queryContentCells(com.sun.star.sheet.CellFlags.FORMULA)
+formulas = formula_cells.getCells()
+formula_enum = formulas.createEnumeration()
+
+Do while formula_enum.hasMoreElements()
+formula_cell = formula_enum.nextElement()
+Msgbox("Formula cell in column " + 
formula_cell.getCellAddress().Column + _
+ ", row " + formula_cell.getCellAddress().Row + _
+  " contains " + cell.getFormula())
+Loop
+End Sub
diff --git a/odk/examples/DevelopersGuide/FirstSteps/FirstUnoContact.bas 
b/odk/examples/DevelopersGuide/FirstSteps/FirstUnoContact.bas
new file mode 100644
index ..ba8f542d834e
--- /dev/null
+++ b/odk/examples/DevelopersGuide/FirstSteps/FirstUnoContact.bas
@@ -0,0 +1,17 @@
+'
+' 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/.
+'
+
+Sub Main
+Set oContext = GetDefaultContext()
+MsgBox "Connected to a running office..."
+Set oServiceManager=oContext.GetServiceManager()
+If IsNull(oServiceManager) Then
+bAvailable = "not "
+End If
+MsgBox "ServiceManager is " + bAvailable + "available"
+End Sub
\ No newline at end of file
diff --git a/odk/examples/DevelopersGuide/FirstSteps/HelloTextTableShape.bas 
b/odk/examples/DevelopersGuide/FirstSteps/HelloTextTableShape.bas
new file mode 100644
index ..96d75a445fac
--- /dev/null
+++ b/odk/examples/DevelopersGuide/FirstSteps/HelloTextTableShape.bas
@@ -0,0 +1,223 @@
+'
+' 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/.
+'
+
+Function new_doc_component(doc_type As String)
+load_url = "private:factory/" & doc_type
+desktop = createUnoService("com.sun.star.frame.Desktop")
+Set new_doc_component = desktop.loadComponentFromURL(load_url, "_blank", 
0, Array())
+End Function
+
+Sub use_documents
+use_writer()
+use_calc()
+use_draw()
+End Sub
+
+Sub use_writer
+Set doc = new_doc_component("swriter")
+Set xtext = doc.Text
+manipulateText(xtext)
+
+' insert TextTable and get cell text, then manipulate text in cell
+Set 

[Libreoffice-commits] core.git: Repository.mk vcl/Module_vcl.mk

2023-09-15 Thread Hossein (via logerrit)
 Repository.mk |2 +-
 vcl/Module_vcl.mk |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 36163d269bd8f77a86605e4c5ff5adce17b4c66c
Author: Hossein 
AuthorDate: Fri Sep 15 22:38:02 2023 +0200
Commit: Hossein 
CommitDate: Fri Sep 15 23:48:49 2023 +0200

Make svptest VCL example build on all platforms

Previously, svptest VCL example was not built on all paltforms. Now,
svptest is built on Windows and elsewhere. To run, one can invoke:

 ./bin/run svptest

Change-Id: I915a4ef9748e2248d2d209969d1fef079ee06cff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156972
Tested-by: Jenkins
Reviewed-by: Hossein 

diff --git a/Repository.mk b/Repository.mk
index 22e1da82d263..e26116336b2a 100644
--- a/Repository.mk
+++ b/Repository.mk
@@ -70,13 +70,13 @@ $(eval $(call gb_Helper_register_executables,NONE, \
xrmex \
$(if $(filter-out ANDROID iOS WNT,$(OS)), \
 fftester \
-svptest \
 svpclient ) \
$(if $(filter LINUX %BSD SOLARIS,$(OS)), tilebench) \
$(if $(filter LINUX MACOSX SOLARIS WNT %BSD,$(OS)),icontest) \
vcldemo \
svdemo \
minvcl \
+   svptest \
tiledrendering \
mtfdemo \
visualbackendtest \
diff --git a/vcl/Module_vcl.mk b/vcl/Module_vcl.mk
index 704b324622fe..dd66a86dbf73 100644
--- a/vcl/Module_vcl.mk
+++ b/vcl/Module_vcl.mk
@@ -45,6 +45,7 @@ $(eval $(call gb_Module_add_targets,vcl,\
 Executable_vcldemo \
 Executable_svdemo \
 Executable_minvcl \
+Executable_svptest \
 Executable_icontest \
 Executable_visualbackendtest \
 Executable_mtfdemo \
@@ -57,7 +58,6 @@ ifeq ($(CROSS_COMPILING)$(DISABLE_DYNLOADING),)
 $(eval $(call gb_Module_add_targets,vcl,\
 $(if $(filter-out ANDROID iOS WNT,$(OS)), \
 Executable_fftester \
-Executable_svptest \
 Executable_listfonts \
 Executable_listglyphs \
 Executable_svpclient) \


[Libreoffice-commits] core.git: bin/run

2023-09-15 Thread Hossein (via logerrit)
 bin/run |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 140fe3080da8dd6468a223cb7bb56d3734377b9c
Author: Hossein 
AuthorDate: Wed Sep 13 23:31:21 2023 +0200
Commit: Hossein 
CommitDate: Fri Sep 15 21:24:09 2023 +0200

Make sure bin/run script finds the correct dlls

On Windows/Cygwin, if you put "C:\Program Files\LibreOffice\program"
in PATH, bin/run will have trouble finding correct vcllo.dll and other
LibreOffice .dll files inside instdir/program. Because the script uses
the absolute path of the executable, it is enough to use instdir/program
as the current working directory.

The symptom was that in the above case it was not possible to run the
workbenches like vcldemo, minvcl, etc. The error was:

$ ./bin/run minvcl

minvcl.exe - Entry Point Not Found | The procedure entry point
?RasterFromBitmap@SKImages@@... could not be located in the dynamic
link library vcllo.dll

$ ldd ./lode/dev/core/workdir/LinkTarget/Executable/minvcl.exe
...
comphelper.dll => not found
fwklo.dll => not found
i18nlangtag.dll => /cygdrive/c/Program 
Files/LibreOffice/program/i18nlangtag.dll (?)
sal3.dll => /cygdrive/c/Program Files/LibreOffice/program/sal3.dll 
(?)
vcllo.dll => not found
MSVCP140D.dll => /cygdrive/c/WINDOWS/SYSTEM32/MSVCP140D.dll (?)
VCRUNTIME140D.dll => /cygdrive/c/WINDOWS/SYSTEM32/VCRUNTIME140D.dll 
(?)
VCRUNTIME140_1D.dll => 
/cygdrive/c/WINDOWS/SYSTEM32/VCRUNTIME140_1D.dll (?)
ucrtbased.dll => /cygdrive/c/WINDOWS/SYSTEM32/ucrtbased.dll (?)

Change-Id: I02b6d9aca1062b22a91d5a1f9bce0cf7238a896a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156902
Tested-by: Jenkins
Reviewed-by: Hossein 

diff --git a/bin/run b/bin/run
index 695905e09e6b..b154834c1db5 100755
--- a/bin/run
+++ b/bin/run
@@ -73,6 +73,7 @@ if uname | grep -i CYGWIN >/dev/null; then
 export URE_BOOTSTRAP=file:///$(cygpath -m 
"${dir}")/instdir/program/fundamental.ini
 export PATH=${PATH:+$PATH:}"${dir}"/instdir/program
 SEARCH_PATH="${PATH}"
+cd instdir/program
 
 elif [ $(uname) = Darwin ]; then
 


[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - ridljar/com

2023-09-12 Thread Hossein (via logerrit)
 ridljar/com/sun/star/lib/util/NativeLibraryLoader.java |9 -
 1 file changed, 9 deletions(-)

New commits:
commit db0ee77abb37c1c649cc14c1a8e54ed5357eef09
Author: Hossein 
AuthorDate: Thu Aug 31 11:02:09 2023 +0200
Commit: Xisco Fauli 
CommitDate: Tue Sep 12 09:28:22 2023 +0200

tdf#149069 Revert "ridljar: check UnoClassLoader used for 
NativeLibraryLoader"

This reverts commit 97b61ea3297e04e64aab1e1a4ec50202e9f86fff. It checked
that the NativeLibraryLoader is an instance of the class
com.sun.star.lib.unoloader.UnoClassLoader. If this is not the case, a
warning was displayed. This was for java_uno bridge to work.

On the other hand, as the comment in the code implies, "not a problem
if this is using Java remote bridge or (in a) unit test". But, in the
code there was no check for that. As a result, this warning is displayed
in many places like the simple examples that want to connect to the
LibreOffice process via Java API.

Change-Id: I056ed372ad071573051024a63e51afd6b4425ce5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156302
Reviewed-by: Michael Stahl 
Tested-by: Jenkins
Reviewed-by: Hossein 
(cherry picked from commit 345b214c37d1f645dd0e6e084358f8ca81d9ed66)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156374
Reviewed-by: Xisco Fauli 

diff --git a/ridljar/com/sun/star/lib/util/NativeLibraryLoader.java 
b/ridljar/com/sun/star/lib/util/NativeLibraryLoader.java
index d255a71ea5d1..eb5c6af34e90 100644
--- a/ridljar/com/sun/star/lib/util/NativeLibraryLoader.java
+++ b/ridljar/com/sun/star/lib/util/NativeLibraryLoader.java
@@ -21,7 +21,6 @@ package com.sun.star.lib.util;
 import java.io.File;
 import java.net.URL;
 import java.net.URLClassLoader;
-import com.sun.star.lib.unoloader.UnoClassLoader;
 
 /**
  * Helper functions to locate and load native files.
@@ -36,14 +35,6 @@ import com.sun.star.lib.unoloader.UnoClassLoader;
  * algorithm.
  */
 public final class NativeLibraryLoader {
-static {
-// if it's some other class loader, then resolving the symbol
-// Java_com_sun_star_bridges_jni_1uno_JNI_1proxy_dispatch_1call in
-// java_uno will not work and result in UnsatisfiedLinkError
-if (!(NativeLibraryLoader.class.getClassLoader() instanceof 
com.sun.star.lib.unoloader.UnoClassLoader)) {
-System.err.println("warning: 
com.sun.star.lib.util.NativeLibraryLoader must be loaded by 
com.sun.star.lib.unoloader.UnoClassLoader for java_uno bridge to work (not a 
problem if this is using Java remote bridge or unit test)");
-}
-}
 /**
  * Load a system library, using a given class loader to locate the library.
  *


[Libreoffice-commits] core.git: odk/examples odk/Package_examples.mk solenv/clang-format

2023-09-08 Thread Hossein (via logerrit)
 odk/Package_examples.mk |8 
 odk/examples/OLE/activex/Makefile   |   12 ++--
 odk/examples/OLE/activex/SOActiveX.cxx  |2 +-
 odk/examples/OLE/activex/StdAfx2.cxx|6 +++---
 odk/examples/OLE/activex/so_activex.cxx |2 +-
 solenv/clang-format/excludelist |2 +-
 6 files changed, 16 insertions(+), 16 deletions(-)

New commits:
commit 65325f9c2f9aff6782fa5df910e8f2f5e63dfd93
Author: Hossein 
AuthorDate: Thu Sep 7 17:16:24 2023 +0200
Commit: Hossein 
CommitDate: Sat Sep 9 01:20:46 2023 +0200

Rename .cpp examples to .cxx

The files are renamed, and the associated lines in Makefiles and
elsewhere are also changed.

Change-Id: Ieec38055690e03afd8982320ee0836904a3f41eb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156670
Tested-by: Jenkins
Reviewed-by: Hossein 

diff --git a/odk/Package_examples.mk b/odk/Package_examples.mk
index 457aea37e166..f533a91a346c 100644
--- a/odk/Package_examples.mk
+++ b/odk/Package_examples.mk
@@ -366,17 +366,17 @@ $(eval $(call 
gb_Package_add_files_with_dir,odk_examples,$(SDKDIRNAME)/examples,
 DevelopersGuide/UCB/data/data.txt \
 OLE/activex/Makefile \
 OLE/activex/README.txt \
-OLE/activex/SOActiveX.cpp \
+OLE/activex/SOActiveX.cxx \
 OLE/activex/SOActiveX.h \
 OLE/activex/SOActiveX.rgs \
-OLE/activex/SOComWindowPeer.cpp \
+OLE/activex/SOComWindowPeer.cxx \
 OLE/activex/SOComWindowPeer.h \
 OLE/activex/SOComWindowPeer.rgs \
-OLE/activex/StdAfx2.cpp \
+OLE/activex/StdAfx2.cxx \
 OLE/activex/StdAfx2.h \
 OLE/activex/example.html \
 OLE/activex/resource.h \
-OLE/activex/so_activex.cpp \
+OLE/activex/so_activex.cxx \
 OLE/activex/so_activex.def \
 OLE/activex/so_activex.idl \
 OLE/activex/so_activex.rc \
diff --git a/odk/examples/OLE/activex/Makefile 
b/odk/examples/OLE/activex/Makefile
index 15167bc93ba4..ca893a44362a 100644
--- a/odk/examples/OLE/activex/Makefile
+++ b/odk/examples/OLE/activex/Makefile
@@ -50,12 +50,12 @@ OUT_COMP_SLO=$(OUT_SLO)/$(COMPONENT_NAME)
 
 MIDLFILES = so_activex.idl
 
-CXXFILES = SOActiveX.cpp \
-SOComWindowPeer.cpp \
-so_activex.cpp \
-StdAfx2.cpp
+CXXFILES = SOActiveX.cxx \
+SOComWindowPeer.cxx \
+so_activex.cxx \
+StdAfx2.cxx
 
-SLOFILES = $(patsubst %.cpp,$(OUT_COMP_SLO)/%.$(OBJ_EXT),$(CXXFILES))
+SLOFILES = $(patsubst %.cxx,$(OUT_COMP_SLO)/%.$(OBJ_EXT),$(CXXFILES))
 
 # Targets
 .PHONY: ALL
@@ -76,7 +76,7 @@ $(OUT_COMP_GEN)/so_activex.res : so_activex.rc 
$(OUT_COMP_INC)/so_activex.h
-$(MKDIR) $(subst /,$(PS),$(@D))
rc $(CC_INCLUDES) /R /FO$@ so_activex.rc   
 
-$(OUT_COMP_SLO)/%.$(OBJ_EXT) : %.cpp
+$(OUT_COMP_SLO)/%.$(OBJ_EXT) : %.cxx
-$(MKDIR) $(subst /,$(PS),$(@D))
$(CC) $(CC_FLAGS) $(CC_INCLUDES) -I$(OUT_COMP_INC) $(CC_DEFINES) 
$(CC_OUTPUT_SWITCH)$(subst /,$(PS),$@) $<
 
diff --git a/odk/examples/OLE/activex/SOActiveX.cpp 
b/odk/examples/OLE/activex/SOActiveX.cxx
similarity index 99%
rename from odk/examples/OLE/activex/SOActiveX.cpp
rename to odk/examples/OLE/activex/SOActiveX.cxx
index 81159e489f2e..e29a439f3552 100644
--- a/odk/examples/OLE/activex/SOActiveX.cpp
+++ b/odk/examples/OLE/activex/SOActiveX.cxx
@@ -33,7 +33,7 @@
  *
  */
 
-// SOActiveX.cpp : Implementation of CSOActiveX
+// SOActiveX.cxx : Implementation of CSOActiveX
 
 #include "stdafx2.h"
 #include "so_activex.h"
diff --git a/odk/examples/OLE/activex/SOComWindowPeer.cpp 
b/odk/examples/OLE/activex/SOComWindowPeer.cxx
similarity index 100%
rename from odk/examples/OLE/activex/SOComWindowPeer.cpp
rename to odk/examples/OLE/activex/SOComWindowPeer.cxx
diff --git a/odk/examples/OLE/activex/StdAfx2.cpp 
b/odk/examples/OLE/activex/StdAfx2.cxx
similarity index 95%
rename from odk/examples/OLE/activex/StdAfx2.cpp
rename to odk/examples/OLE/activex/StdAfx2.cxx
index 3911bcf24003..46743f22c2a0 100644
--- a/odk/examples/OLE/activex/StdAfx2.cpp
+++ b/odk/examples/OLE/activex/StdAfx2.cxx
@@ -33,7 +33,7 @@
  *
  */
 
-// stdafx1.cpp : source file that includes just the standard includes
+// stdafx1.cxx : source file that includes just the standard includes
 //  stdafx1.pch will be the pre-compiled header
 //  stdafx1.obj will contain the pre-compiled type information
 
@@ -41,9 +41,9 @@
 
 #ifdef _ATL_STATIC_REGISTRY
 #include 
-#include 
+#include 
 #endif
 
-#include 
+#include 
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/odk/examples/OLE/activex/so_activex.cpp 
b/odk/examples/OLE/activex/so_activex.cxx
similarity index 98%
rename from odk/examples/OLE/activex/so_activex.cpp
rename to odk/examples/OLE/activex/so_activex.cxx
index b2cf16a80349..614d9866a7ec 100644
--- a/odk/examples/OLE/activex/so_activex.cpp
+++ 

[Libreoffice-commits] core.git: odk/examples

2023-09-08 Thread Hossein (via logerrit)
 odk/examples/DevelopersGuide/FirstSteps/FirstLoadComponent.py |   62 ++
 1 file changed, 62 insertions(+)

New commits:
commit 7dc3be651b050c7b4d383d8ee25b69728418acc7
Author: Hossein 
AuthorDate: Fri Sep 8 01:16:29 2023 +0200
Commit: Hossein 
CommitDate: Fri Sep 8 10:16:06 2023 +0200

tdf#143123 Port DevelopersGuide/FirstSteps/FirstLoadComponent to Python

Porting FirstSteps/FirstLoadComponent.java to Python is done. More
information on this example can be found on LibreOffice DevGuide:

LibreOffice Developer's Guide: Chapter 1 - First Steps - First Contact
https://wiki.documentfoundation.org/Documentation/DevGuide/First_Steps

This is the last of the 3 examples in the first chapter which are ported
to Python.

Change-Id: Iac0682943d4286168bbdadf792423670f41bdee6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156686
Tested-by: Hossein 
Reviewed-by: Hossein 

diff --git a/odk/examples/DevelopersGuide/FirstSteps/FirstLoadComponent.py 
b/odk/examples/DevelopersGuide/FirstSteps/FirstLoadComponent.py
new file mode 100755
index ..a5d93d799f8c
--- /dev/null
+++ b/odk/examples/DevelopersGuide/FirstSteps/FirstLoadComponent.py
@@ -0,0 +1,62 @@
+# -*- 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/.
+#
+
+import uno
+import officehelper
+import sys
+import traceback
+from com.sun.star.sheet.CellFlags import FORMULA
+
+
+def main():
+try:
+remote_context = officehelper.bootstrap()
+if remote_context is None:
+print("ERROR: Could not bootstrap default Office.")
+sys.exit(1)
+srv_mgr = remote_context.getServiceManager()
+desktop = 
srv_mgr.createInstanceWithContext("com.sun.star.frame.Desktop", remote_context)
+spreadsheet_component = 
desktop.loadComponentFromURL("private:factory/scalc", "_blank", 0, tuple())
+spreadsheets = spreadsheet_component.getSheets()
+spreadsheets.insertNewByName("MySheet", 0)
+elem_type = spreadsheets.getElementType()
+print(elem_type)
+sheet = spreadsheets.getByName("MySheet")
+cell = sheet.getCellByPosition(0, 0)
+cell.setValue(21)
+cell = sheet.getCellByPosition(0, 1)
+cell.setValue(21)
+cell = sheet.getCellByPosition(0, 2)
+cell.setFormula("=sum(A1:A2)")
+
+cell.setPropertyValue("CellStyle", "Result")
+
+spreadsheet_controller = spreadsheet_component.getCurrentController()
+spreadsheet_controller.setActiveSheet(sheet)
+cell.setPropertyValue("VertJustify", 
"com.sun.star.table.CellVertJustify.TOP")
+formula_cells = sheet.queryContentCells(FORMULA)
+formulas = formula_cells.getCells()
+formula_enum = formulas.createEnumeration()
+
+while formula_enum.hasMoreElements():
+formula_cell = formula_enum.nextElement()
+print("Formula cell in column " + 
str(formula_cell.getCellAddress().Column)
+  + ", row " + str(formula_cell.getCellAddress().Row)
+  + " contains " + cell.getFormula())
+
+except Exception as e:
+print(e)
+traceback.print_exc()
+sys.exit(1)
+
+
+if __name__ == "__main__":
+main()
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:


[Libreoffice-commits] core.git: extensions/source odk/examples

2023-09-07 Thread Hossein (via logerrit)
 extensions/source/activex/SOActionsApproval.cxx |   13 +++--
 extensions/source/activex/SOComWindowPeer.cxx   |   13 +++--
 extensions/source/activex/SODispatchInterceptor.cxx |   14 +++---
 odk/examples/OLE/activex/SOComWindowPeer.cpp|   13 +++--
 4 files changed, 12 insertions(+), 41 deletions(-)

New commits:
commit 7a643f40b4c76bc55f17c3137aad90dbf55463ea
Author: Hossein 
AuthorDate: Wed Sep 6 22:50:25 2023 +0200
Commit: Hossein 
CommitDate: Thu Sep 7 10:09:14 2023 +0200

Simplify condition in a loop over a single element

The loop was over an array which has only one element, so the
condition should also work directly with its only element.

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

diff --git a/extensions/source/activex/SOActionsApproval.cxx 
b/extensions/source/activex/SOActionsApproval.cxx
index 833e220ae183..6fd6d0888141 100644
--- a/extensions/source/activex/SOActionsApproval.cxx
+++ b/extensions/source/activex/SOActionsApproval.cxx
@@ -17,7 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-// SOActionsApproval.cpp : Implementation of CHelpApp and DLL registration.
+// SOActionsApproval.cxx : Implementation of CHelpApp and DLL registration.
 
 #include 
 
@@ -31,15 +31,8 @@
 
 COM_DECLSPEC_NOTHROW STDMETHODIMP 
SOActionsApproval::InterfaceSupportsErrorInfo(REFIID riid)
 {
-static const IID* arr[] = {
-_ISOActionsApproval,
-};
-
-for (std::size_t i = 0; i < SAL_N_ELEMENTS(arr); i++)
-{
-if (InlineIsEqualGUID(*arr[i], riid))
-return S_OK;
-}
+if (InlineIsEqualGUID(IID_ISOActionsApproval, riid))
+return S_OK;
 return S_FALSE;
 }
 
diff --git a/extensions/source/activex/SOComWindowPeer.cxx 
b/extensions/source/activex/SOComWindowPeer.cxx
index 6973bc173984..59510c24a7a7 100644
--- a/extensions/source/activex/SOComWindowPeer.cxx
+++ b/extensions/source/activex/SOComWindowPeer.cxx
@@ -17,7 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-// SOComWindowPeer.cpp : Implementation of CHelpApp and DLL registration.
+// SOComWindowPeer.cxx : Implementation of CHelpApp and DLL registration.
 
 #include 
 
@@ -30,15 +30,8 @@
 
 COM_DECLSPEC_NOTHROW STDMETHODIMP 
SOComWindowPeer::InterfaceSupportsErrorInfo(REFIID riid)
 {
-static const IID* arr[] = {
-_ISOComWindowPeer,
-};
-
-for (std::size_t i = 0; i < SAL_N_ELEMENTS(arr); i++)
-{
-if (InlineIsEqualGUID(*arr[i], riid))
-return S_OK;
-}
+if (InlineIsEqualGUID(IID_ISOComWindowPeer, riid))
+return S_OK;
 return S_FALSE;
 }
 
diff --git a/extensions/source/activex/SODispatchInterceptor.cxx 
b/extensions/source/activex/SODispatchInterceptor.cxx
index af3d69e02ea9..97ea07568fde 100644
--- a/extensions/source/activex/SODispatchInterceptor.cxx
+++ b/extensions/source/activex/SODispatchInterceptor.cxx
@@ -17,7 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-// SODispatchInterceptor.cpp : Implementation of CHelpApp and DLL registration.
+// SODispatchInterceptor.cxx : Implementation of CHelpApp and DLL registration.
 
 #include 
 
@@ -33,16 +33,8 @@
 
 COM_DECLSPEC_NOTHROW STDMETHODIMP 
SODispatchInterceptor::InterfaceSupportsErrorInfo(REFIID riid)
 {
-static const IID* arr[] =
-{
-_ISODispatchInterceptor,
-};
-
-for (auto const  : arr)
-{
-if (InlineIsEqualGUID(*i,riid))
-return S_OK;
-}
+if (InlineIsEqualGUID(IID_ISODispatchInterceptor, riid))
+return S_OK;
 return S_FALSE;
 }
 
diff --git a/odk/examples/OLE/activex/SOComWindowPeer.cpp 
b/odk/examples/OLE/activex/SOComWindowPeer.cpp
index 7439593dd138..50c1d7e8b341 100644
--- a/odk/examples/OLE/activex/SOComWindowPeer.cpp
+++ b/odk/examples/OLE/activex/SOComWindowPeer.cpp
@@ -33,7 +33,7 @@
  *
  */
 
-// SOComWindowPeer.cpp : Implementation of CHelpApp and DLL registration.
+// SOComWindowPeer.cxx : Implementation of CHelpApp and DLL registration.
 
 #include "stdafx2.h"
 #include "so_activex.h"
@@ -42,15 +42,8 @@
 
 STDMETHODIMP SOComWindowPeer::InterfaceSupportsErrorInfo(REFIID riid)
 {
-static const IID* arr[] = {
-_ISOComWindowPeer,
-};
-
-for (int i = 0; i < SAL_N_ELEMENTS(arr); i++)
-{
-if (InlineIsEqualGUID(*arr[i], riid))
-return S_OK;
-}
+if (InlineIsEqualGUID(IID_ISOComWindowPeer, riid))
+return S_OK;
 return S_FALSE;
 }
 


[Libreoffice-commits] core.git: Branch 'libreoffice-7-6-1' - ridljar/com

2023-09-06 Thread Hossein (via logerrit)
 ridljar/com/sun/star/lib/util/NativeLibraryLoader.java |9 -
 1 file changed, 9 deletions(-)

New commits:
commit e0557220321b09fdbcaaeaffbdf31e072e6511c4
Author: Hossein 
AuthorDate: Thu Aug 31 11:02:09 2023 +0200
Commit: Xisco Fauli 
CommitDate: Wed Sep 6 16:48:12 2023 +0200

tdf#149069 Revert "ridljar: check UnoClassLoader used for 
NativeLibraryLoader"

This reverts commit 97b61ea3297e04e64aab1e1a4ec50202e9f86fff. It checked
that the NativeLibraryLoader is an instance of the class
com.sun.star.lib.unoloader.UnoClassLoader. If this is not the case, a
warning was displayed. This was for java_uno bridge to work.

On the other hand, as the comment in the code implies, "not a problem
if this is using Java remote bridge or (in a) unit test". But, in the
code there was no check for that. As a result, this warning is displayed
in many places like the simple examples that want to connect to the
LibreOffice process via Java API.

Change-Id: I056ed372ad071573051024a63e51afd6b4425ce5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156302
Reviewed-by: Michael Stahl 
Tested-by: Jenkins
Reviewed-by: Hossein 
(cherry picked from commit 345b214c37d1f645dd0e6e084358f8ca81d9ed66)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156373
Reviewed-by: Xisco Fauli 
(cherry picked from commit 20e997a4256a65f2301aa10037aa6cd37022b50e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156387
Reviewed-by: Ilmari Lauhakangas 
Tested-by: Xisco Fauli 

diff --git a/ridljar/com/sun/star/lib/util/NativeLibraryLoader.java 
b/ridljar/com/sun/star/lib/util/NativeLibraryLoader.java
index d255a71ea5d1..eb5c6af34e90 100644
--- a/ridljar/com/sun/star/lib/util/NativeLibraryLoader.java
+++ b/ridljar/com/sun/star/lib/util/NativeLibraryLoader.java
@@ -21,7 +21,6 @@ package com.sun.star.lib.util;
 import java.io.File;
 import java.net.URL;
 import java.net.URLClassLoader;
-import com.sun.star.lib.unoloader.UnoClassLoader;
 
 /**
  * Helper functions to locate and load native files.
@@ -36,14 +35,6 @@ import com.sun.star.lib.unoloader.UnoClassLoader;
  * algorithm.
  */
 public final class NativeLibraryLoader {
-static {
-// if it's some other class loader, then resolving the symbol
-// Java_com_sun_star_bridges_jni_1uno_JNI_1proxy_dispatch_1call in
-// java_uno will not work and result in UnsatisfiedLinkError
-if (!(NativeLibraryLoader.class.getClassLoader() instanceof 
com.sun.star.lib.unoloader.UnoClassLoader)) {
-System.err.println("warning: 
com.sun.star.lib.util.NativeLibraryLoader must be loaded by 
com.sun.star.lib.unoloader.UnoClassLoader for java_uno bridge to work (not a 
problem if this is using Java remote bridge or unit test)");
-}
-}
 /**
  * Load a system library, using a given class loader to locate the library.
  *


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

2023-09-06 Thread Hossein (via logerrit)
 sc/source/ui/inc/viewdata.hxx  |2 +-
 sc/source/ui/view/cellsh4.cxx  |2 +-
 sc/source/ui/view/tabview3.cxx |   18 ++
 3 files changed, 16 insertions(+), 6 deletions(-)

New commits:
commit 218b73d937453d5d813a050f1216840ba71f4fe7
Author: Hossein 
AuthorDate: Wed Sep 6 13:00:18 2023 +0200
Commit: Hossein 
CommitDate: Wed Sep 6 16:27:11 2023 +0200

tdf#154271 Fix automatic cursor/screen jump in Calc

Previously, when using ctrl+end, the screen/cursor jump was done to the
middle of the screen. In this way, the available space of the screen was
not optimally used.

In this patch, the jump is adjusted to move the cursor to the end of the
screen, and the visible/usable space will be all of the screen.

In this patch, previous behavior for showing the search results and
other purposes other than pressing ctrl+end to jump to the last cell are
preserved, and in those cases, the selected cell will be in the middle
of the screen, as before.

Also, in the situations that the jump is done from a cell lower or right
of the last cell (in other words, further than the last cell), the
behavior is preserved.

Change-Id: I25f308f84f096ec271c23df75998ddeea32119ea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156266
Tested-by: Jenkins
Reviewed-by: Hossein 

diff --git a/sc/source/ui/inc/viewdata.hxx b/sc/source/ui/inc/viewdata.hxx
index 34bc8c49c4f6..5dd60f6d266e 100644
--- a/sc/source/ui/inc/viewdata.hxx
+++ b/sc/source/ui/inc/viewdata.hxx
@@ -49,7 +49,7 @@ inline ScHSplitPos WhichH( ScSplitPos ePos );
 inline ScVSplitPos WhichV( ScSplitPos ePos );
 
 /**  Screen behavior related to cursor movements */
-enum ScFollowMode { SC_FOLLOW_NONE, SC_FOLLOW_LINE, SC_FOLLOW_FIX, 
SC_FOLLOW_JUMP };
+enum ScFollowMode { SC_FOLLOW_NONE, SC_FOLLOW_LINE, SC_FOLLOW_FIX, 
SC_FOLLOW_JUMP, SC_FOLLOW_JUMP_END };
 
 /** Mouse mode to select areas */
 enum ScRefType { SC_REFTYPE_NONE, SC_REFTYPE_REF, SC_REFTYPE_FILL,
diff --git a/sc/source/ui/view/cellsh4.cxx b/sc/source/ui/view/cellsh4.cxx
index 8cf13970bdeb..bacbf2b98f90 100644
--- a/sc/source/ui/view/cellsh4.cxx
+++ b/sc/source/ui/view/cellsh4.cxx
@@ -507,7 +507,7 @@ void ScCellShell::ExecutePage( SfxRequest& rReq )
 break;
 
 case SID_CURSORENDOFFILE:
-pTabViewShell->MoveCursorEnd( 1, 1, SC_FOLLOW_JUMP, bSel, bKeep );
+pTabViewShell->MoveCursorEnd( 1, 1, SC_FOLLOW_JUMP_END, bSel, 
bKeep );
 break;
 
 default:
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index 9a321f73eefe..723f2b4904e0 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -959,8 +959,17 @@ void ScTabView::AlignToCursor( SCCOL nCurX, SCROW nCurY, 
ScFollowMode eMode,
 else
 nCellSizeX = nCellSizeY = 0;
 Size aScrSize = aViewData.GetScrSize();
-tools::Long nSpaceX = ( aScrSize.Width()  - nCellSizeX ) / 2;
-tools::Long nSpaceY = ( aScrSize.Height() - nCellSizeY ) / 2;
+
+tools::Long nDenom;
+if ( eMode == SC_FOLLOW_JUMP_END && nCurX > aViewData.GetRefStartX()
+&& nCurY > aViewData.GetRefStartY() )
+nDenom = 1; // tdf#154271 Selected cell will be at the bottom 
corner
+// to maximize the visible/usable area
+else
+nDenom = 2; // Selected cell will be at the center of the screen, 
so that
+// it will be visible. This is useful for search 
results, etc.
+tools::Long nSpaceX = ( aScrSize.Width()  - nCellSizeX ) / nDenom;
+tools::Long nSpaceY = ( aScrSize.Height() - nCellSizeY ) / nDenom;
 //  nSpaceY: desired start position of cell for FOLLOW_JUMP, modified 
if dialog interferes
 
 bool bForceNew = false; // force new calculation of JUMP position 
(vertical only)
@@ -971,7 +980,7 @@ void ScTabView::AlignToCursor( SCCOL nCurX, SCROW nCurY, 
ScFollowMode eMode,
 // if possible, put the row with the cursor above or below the dialog
 //! not if already completely visible
 
-if ( eMode == SC_FOLLOW_JUMP )
+if ( eMode == SC_FOLLOW_JUMP || eMode == SC_FOLLOW_JUMP_END )
 {
 weld::Window* pCare = lcl_GetCareWin( 
aViewData.GetViewShell()->GetViewFrame() );
 if (pCare)
@@ -1042,6 +1051,7 @@ void ScTabView::AlignToCursor( SCCOL nCurX, SCROW nCurY, 
ScFollowMode eMode,
 switch (eMode)
 {
 case SC_FOLLOW_JUMP:
+case SC_FOLLOW_JUMP_END:
 if ( nCurX < nDeltaX || nCurX >= nDeltaX+nSizeX )
 {
 nNewDeltaX = nCurX - aViewData.CellsAtX( nCurX, -1, 
eAlignX, static_cast(nSpaceX) );
@@ -1521,7 +1531,7 @@ bool ScTabView::MoveCursorKeyInput( const KeyEvent& 
rKeyEvent )
 if( (nCode == KEY_HOME) || (nCode == KEY_END) )
 {
 nDX = (nCode == KEY_HOME) ? -1 : 

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

2023-09-01 Thread Hossein (via logerrit)
 ridljar/com/sun/star/lib/util/NativeLibraryLoader.java |9 --
 sc/qa/unit/data/ods/tdf150815.ods  |binary
 sc/qa/unit/subsequent_filters_test3.cxx|   22 -
 sc/source/ui/inc/viewfunc.hxx  |4 +--
 sc/source/ui/view/viewfunc.cxx |   22 +
 5 files changed, 45 insertions(+), 12 deletions(-)

New commits:
commit b0ef63638b31ae3fcc5e4a6bbf5298040a878ee3
Author: Hossein 
AuthorDate: Thu Aug 31 11:02:09 2023 +0200
Commit: Xisco Fauli 
CommitDate: Fri Sep 1 13:34:20 2023 +0200

tdf#149069 Revert "ridljar: check UnoClassLoader used for 
NativeLibraryLoader"

This reverts commit 97b61ea3297e04e64aab1e1a4ec50202e9f86fff. It checked
that the NativeLibraryLoader is an instance of the class
com.sun.star.lib.unoloader.UnoClassLoader. If this is not the case, a
warning was displayed. This was for java_uno bridge to work.

On the other hand, as the comment in the code implies, "not a problem
if this is using Java remote bridge or (in a) unit test". But, in the
code there was no check for that. As a result, this warning is displayed
in many places like the simple examples that want to connect to the
LibreOffice process via Java API.

Change-Id: I056ed372ad071573051024a63e51afd6b4425ce5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156302
Reviewed-by: Michael Stahl 
Tested-by: Jenkins
Reviewed-by: Hossein 
(cherry picked from commit 345b214c37d1f645dd0e6e084358f8ca81d9ed66)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156373
Reviewed-by: Xisco Fauli 

diff --git a/ridljar/com/sun/star/lib/util/NativeLibraryLoader.java 
b/ridljar/com/sun/star/lib/util/NativeLibraryLoader.java
index d255a71ea5d1..eb5c6af34e90 100644
--- a/ridljar/com/sun/star/lib/util/NativeLibraryLoader.java
+++ b/ridljar/com/sun/star/lib/util/NativeLibraryLoader.java
@@ -21,7 +21,6 @@ package com.sun.star.lib.util;
 import java.io.File;
 import java.net.URL;
 import java.net.URLClassLoader;
-import com.sun.star.lib.unoloader.UnoClassLoader;
 
 /**
  * Helper functions to locate and load native files.
@@ -36,14 +35,6 @@ import com.sun.star.lib.unoloader.UnoClassLoader;
  * algorithm.
  */
 public final class NativeLibraryLoader {
-static {
-// if it's some other class loader, then resolving the symbol
-// Java_com_sun_star_bridges_jni_1uno_JNI_1proxy_dispatch_1call in
-// java_uno will not work and result in UnsatisfiedLinkError
-if (!(NativeLibraryLoader.class.getClassLoader() instanceof 
com.sun.star.lib.unoloader.UnoClassLoader)) {
-System.err.println("warning: 
com.sun.star.lib.util.NativeLibraryLoader must be loaded by 
com.sun.star.lib.unoloader.UnoClassLoader for java_uno bridge to work (not a 
problem if this is using Java remote bridge or unit test)");
-}
-}
 /**
  * Load a system library, using a given class loader to locate the library.
  *
commit 009ea5c6bcf34b877dddfe4080b9bb2450844adb
Author: Tibor Nagy 
AuthorDate: Wed Aug 30 16:22:02 2023 +0200
Commit: Xisco Fauli 
CommitDate: Fri Sep 1 13:34:15 2023 +0200

tdf#150815 sc: fix repainting sparkline

On Windows, if the input range of the sparkline is not in the
same row as the output range, the sparkline wasn't repainted
after changing the data within its range. Force the update
to avoid of showing obsolete data.

Change-Id: Id56209b20387ee68144507a0102d3a0d093ff1ea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156304
Reviewed-by: László Németh 
Tested-by: László Németh 
(cherry picked from commit 0d41e2e2e3af5b6e3c80116fa90c6a000ca291c9)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156229
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 

diff --git a/sc/qa/unit/data/ods/tdf150815.ods 
b/sc/qa/unit/data/ods/tdf150815.ods
new file mode 100644
index ..2dd407b6cea5
Binary files /dev/null and b/sc/qa/unit/data/ods/tdf150815.ods differ
diff --git a/sc/qa/unit/subsequent_filters_test3.cxx 
b/sc/qa/unit/subsequent_filters_test3.cxx
index 54d5061d2cd9..b4b918164d09 100644
--- a/sc/qa/unit/subsequent_filters_test3.cxx
+++ b/sc/qa/unit/subsequent_filters_test3.cxx
@@ -393,7 +393,8 @@ struct PaintListener : public SfxListener
 {
 if ((pPaintHint->GetStartCol() <= 0 && pPaintHint->GetEndCol() >= 
0)
 && ((pPaintHint->GetStartRow() <= 9 && pPaintHint->GetEndRow() 
>= 9)
-|| (pPaintHint->GetStartRow() == 2 && 
pPaintHint->GetEndRow() == 3)))
+|| (pPaintHint->GetStartRow() == 2 && 
pPaintHint->GetEndRow() == 3)
+|| (pPaintHint->GetStartRow() == 1 && 
pPaintHint->GetEndRow() == 1)))
 {
 mbCalled = true;
 }
@@ -441,6 +442,25 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest3, testTdf131471)
 

[Libreoffice-commits] core.git: 2 commits - helpcontent2 ridljar/com

2023-08-31 Thread Hossein (via logerrit)
 helpcontent2   |2 +-
 ridljar/com/sun/star/lib/util/NativeLibraryLoader.java |9 -
 2 files changed, 1 insertion(+), 10 deletions(-)

New commits:
commit 345b214c37d1f645dd0e6e084358f8ca81d9ed66
Author: Hossein 
AuthorDate: Thu Aug 31 11:02:09 2023 +0200
Commit: Hossein 
CommitDate: Fri Sep 1 00:02:44 2023 +0200

tdf#149069 Revert "ridljar: check UnoClassLoader used for 
NativeLibraryLoader"

This reverts commit 97b61ea3297e04e64aab1e1a4ec50202e9f86fff. It checked
that the NativeLibraryLoader is an instance of the class
com.sun.star.lib.unoloader.UnoClassLoader. If this is not the case, a
warning was displayed. This was for java_uno bridge to work.

On the other hand, as the comment in the code implies, "not a problem
if this is using Java remote bridge or (in a) unit test". But, in the
code there was no check for that. As a result, this warning is displayed
in many places like the simple examples that want to connect to the
LibreOffice process via Java API.

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

diff --git a/ridljar/com/sun/star/lib/util/NativeLibraryLoader.java 
b/ridljar/com/sun/star/lib/util/NativeLibraryLoader.java
index d255a71ea5d1..eb5c6af34e90 100644
--- a/ridljar/com/sun/star/lib/util/NativeLibraryLoader.java
+++ b/ridljar/com/sun/star/lib/util/NativeLibraryLoader.java
@@ -21,7 +21,6 @@ package com.sun.star.lib.util;
 import java.io.File;
 import java.net.URL;
 import java.net.URLClassLoader;
-import com.sun.star.lib.unoloader.UnoClassLoader;
 
 /**
  * Helper functions to locate and load native files.
@@ -36,14 +35,6 @@ import com.sun.star.lib.unoloader.UnoClassLoader;
  * algorithm.
  */
 public final class NativeLibraryLoader {
-static {
-// if it's some other class loader, then resolving the symbol
-// Java_com_sun_star_bridges_jni_1uno_JNI_1proxy_dispatch_1call in
-// java_uno will not work and result in UnsatisfiedLinkError
-if (!(NativeLibraryLoader.class.getClassLoader() instanceof 
com.sun.star.lib.unoloader.UnoClassLoader)) {
-System.err.println("warning: 
com.sun.star.lib.util.NativeLibraryLoader must be loaded by 
com.sun.star.lib.unoloader.UnoClassLoader for java_uno bridge to work (not a 
problem if this is using Java remote bridge or unit test)");
-}
-}
 /**
  * Load a system library, using a given class loader to locate the library.
  *
commit 462b0fee32442d6e6baffaf8a157d448dd0ecb4f
Author: Olivier Hallot 
AuthorDate: Thu Aug 31 19:02:29 2023 -0300
Commit: Gerrit Code Review 
CommitDate: Fri Sep 1 00:02:29 2023 +0200

Update git submodules

* Update helpcontent2 from branch 'master'
  to 4913c6e46228cf9b750f30f686fbb2c70baf21c7
  - PDF export Help page, improve navigation

Change-Id: Ic4f061289ed82cf2a42d2f0e714a4f7a40cd47e8
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/156365
Tested-by: Jenkins
Reviewed-by: Olivier Hallot 

diff --git a/helpcontent2 b/helpcontent2
index ffaa9e1adb04..4913c6e46228 16
--- a/helpcontent2
+++ b/helpcontent2
@@ -1 +1 @@
-Subproject commit ffaa9e1adb04a683ec87eb5c4c35387384e32702
+Subproject commit 4913c6e46228cf9b750f30f686fbb2c70baf21c7


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

2023-08-21 Thread Hossein (via logerrit)
 sw/qa/extras/ooxmlexport/data/numbers-rtl.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx   |9 +
 sw/qa/extras/ooxmlexport/ooxmlexport3.cxx  |2 +-
 sw/source/filter/ww8/docxattributeoutput.cxx   |3 +++
 4 files changed, 13 insertions(+), 1 deletion(-)

New commits:
commit 40ed8dd3a5a16f21f2e98440c62efa0fa6ec60ff
Author: Hossein 
AuthorDate: Tue Aug 15 14:56:53 2023 +0200
Commit: Hossein 
CommitDate: Mon Aug 21 14:26:51 2023 +0200

tdf#155470 DOCX export: fix RTL numbers changed to LTR

When using numerals in "context" mode in "Tools > Options", in
"Language Settings > Complext Text Layout > General Options > Numerals",
the actual display of the numbers is dependant on the direction and
the language of those numbers.

Previously, when exporting the DOCX in LO the RTL direction was lost,
and because of that, the numerals were shown incorrectly after saving
in LibreOffice, and loading again.

This patch adds  where  contains an RTL language.
For example, before  inside , it always
adds .

It is worth noting that this is not always the case, as there are
situations that  is not present in  with an RTL language
like  and  should not be in the output.
This patch does not handle that case, because currently loading such a
text is not done correctly in LO, and the LTR numbers inside RTL
environment are shown just like RTL numbers. To fix it, first loading
and displaying of that should be fixed.

A test is added to check the export of the sample file, which can be
invoked with:

 make CppunitTest_sw_ooxmlexport CPPUNIT_TEST_NAME=testTdf155470

Change-Id: I8fc54916fcd3295010c5c81ccb632bc6082ffaa2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155721
Tested-by: Jenkins
Reviewed-by: Hossein 

diff --git a/sw/qa/extras/ooxmlexport/data/numbers-rtl.docx 
b/sw/qa/extras/ooxmlexport/data/numbers-rtl.docx
new file mode 100755
index ..2142967a3619
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/numbers-rtl.docx 
differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index cbca150319b7..60e097925829 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -1106,6 +1106,15 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf115094v3)
 assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblPr/w:tblpPr", "tblpY", 
"1064");
 }
 
+CPPUNIT_TEST_FIXTURE(Test, testTdf155470)
+{
+loadAndSave("numbers-rtl.docx");
+xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
+
+// Make sure that  is preserved
+assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:rPr/w:rtl");
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
index db2abe3513a7..9458051ea6d3 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
@@ -174,7 +174,7 @@ CPPUNIT_TEST_FIXTURE(Test, testStyleInheritance)
 
 // We output exactly 2 properties in rPrDefault, nothing else was
 // introduced as an additional default
-assertXPath(pXmlStyles, "/w:styles/w:docDefaults/w:rPrDefault/w:rPr/*", 2);
+assertXPath(pXmlStyles, "/w:styles/w:docDefaults/w:rPrDefault/w:rPr/*", 3);
 // Check that we output real content of rPrDefault
 assertXPath(pXmlStyles, 
"/w:styles/w:docDefaults/w:rPrDefault/w:rPr/w:rFonts", "ascii", "Times New 
Roman");
 assertXPath(pXmlStyles, 
"/w:styles/w:docDefaults/w:rPrDefault/w:rPr/w:lang", "bidi", "ar-SA");
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index df29dd801e08..c2a55ff8bfc7 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -160,6 +160,7 @@
 #include 
 #include 
 #include 
+#include 
 
 using ::editeng::SvxBorderLine;
 
@@ -7916,6 +7917,8 @@ void DocxAttributeOutput::CharLanguage( const 
SvxLanguageItem& rLanguage )
 AddToAttrList( m_pCharLangAttrList, FSNS( XML_w, XML_eastAsia ), 
aLanguageCode );
 break;
 case RES_CHRATR_CTL_LANGUAGE:
+if (MsLangId::isRightToLeft(rLanguage.GetLanguage()))
+m_pSerializer->singleElementNS(XML_w, XML_rtl);
 AddToAttrList( m_pCharLangAttrList, FSNS( XML_w, XML_bidi ), 
aLanguageCode );
 break;
 }


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

2023-08-09 Thread Hossein (via logerrit)
 solenv/gbuild/platform/com_MSC_class.mk |8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit 0c9f095a01682d8cb99a596e568bd81ae96906a5
Author: Hossein 
AuthorDate: Thu May 25 15:55:11 2023 +0200
Commit: Hossein 
CommitDate: Wed Aug 9 10:15:16 2023 +0200

tdf#155446 Fix problem with ccache on Windows

This patch fixes the recent problem with building LibreOffice with ccache
on Windows which was caused by the lack of double quotation mark between
ccache.exe and path to the MSVC compiler.

Change-Id: I1a714513ccb8cd674895d0c887013ea862d3b544
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152277
Tested-by: Jenkins
Reviewed-by: Hossein 

diff --git a/solenv/gbuild/platform/com_MSC_class.mk 
b/solenv/gbuild/platform/com_MSC_class.mk
index ba42b0ba48df..d8cab84ff7c7 100644
--- a/solenv/gbuild/platform/com_MSC_class.mk
+++ b/solenv/gbuild/platform/com_MSC_class.mk
@@ -179,7 +179,7 @@ define gb_AsmObject__command
 $(call gb_Output_announce,$(2),$(true),ASM,3)
 $(call gb_Helper_abbreviate_dirs,\
 mkdir -p $(dir $(1)) $(dir $(4)) && \
-"$(CC)" -nologo -EP -D_M_ARM64 $(SOLARINC) $(3) > $(subst .o,.asm,$(1)) && 
\
+$(CC) -nologo -EP -D_M_ARM64 $(SOLARINC) $(3) > $(subst .o,.asm,$(1)) && \
 "$(ML_EXE)" $(gb_AFLAGS) -g -errorReport:prompt -o $(1) $(subst 
.o,.asm,$(1)), \
 ) && \
 echo "$(1) : $(3)" > $(4)
@@ -664,8 +664,12 @@ gb_AUTOCONF_WRAPPERS = \
 gb_ExternalProject_INCLUDE := \
$(subst -I,,$(subst $(WHITESPACE),;,$(SOLARINC)))
 
+# Workaround for openssl build - it puts the CC var into additional pair of 
quotes. This breaks if
+# CC consists of more than a single element such as when using "ccache 
compiler". In case the
+# variables are exported for openssl, it closes and reopens the quotes after 
each element.
 gb_NMAKE_VARS = \
-   CC="$(shell cygpath -w $(filter-out -%,$(CC))) $(filter -%,$(CC))" \
+   CC="$(subst $(WHITESPACE),$(if $(filter openssl,$(1)),\" \", ),$(strip \
+   $(shell cygpath -ws $(filter-out -%,$(CC))) $(filter 
-%,$(CC" \
INCLUDE="$(gb_ExternalProject_INCLUDE)" \
LIB="$(ILIB)" \
MAKEFLAGS= \


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

2023-08-03 Thread Hossein (via logerrit)
 sw/qa/extras/uiwriter/data/tdf156560.docx |binary
 sw/qa/extras/uiwriter/uiwriter8.cxx   |   16 
 sw/source/core/layout/paintfrm.cxx|4 
 3 files changed, 20 insertions(+)

New commits:
commit a99a63287f96290f5641a4216432f7b637402ea6
Author: Hossein 
AuthorDate: Tue Aug 1 14:48:26 2023 +0200
Commit: Hossein 
CommitDate: Thu Aug 3 11:41:27 2023 +0200

tdf#156560 Fix assertion failure editing RTL header

Clicking on an RTL header previously lead to assertion failure, but now
it is checked if the SwFrame pointer is null. If so, an empty vector is
returned.

It should be noted that the rendering of the rtl header in the
attachment 188689 is still wrong as the text and image are misplaced.

A test is added to the patch, and can be run using:

 make CppunitTest_sw_uiwriter8 CPPUNIT_TEST_NAME=testTdf156560

Change-Id: I9e8f66895b4ef9369300c9d7c03d22a2085a1d71
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155159
Tested-by: Jenkins
Reviewed-by: Hossein 

diff --git a/sw/qa/extras/uiwriter/data/tdf156560.docx 
b/sw/qa/extras/uiwriter/data/tdf156560.docx
new file mode 100755
index ..8cfd5501914c
Binary files /dev/null and b/sw/qa/extras/uiwriter/data/tdf156560.docx differ
diff --git a/sw/qa/extras/uiwriter/uiwriter8.cxx 
b/sw/qa/extras/uiwriter/uiwriter8.cxx
index 48b17ef211ea..621fecc6fd98 100644
--- a/sw/qa/extras/uiwriter/uiwriter8.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter8.cxx
@@ -2674,6 +2674,22 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, 
testTdf62032ApplyStyle)
  getProperty(getParagraph(2), 
"ListLabelString").trim());
 }
 
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf156560)
+{
+createSwDoc("tdf156560.docx");
+
+uno::Reference 
xPageStyle(getStyles("PageStyles")->getByName("Standard"),
+   uno::UNO_QUERY);
+CPPUNIT_ASSERT_EQUAL(true, getProperty(xPageStyle, "HeaderIsOn"));
+
+SwXTextDocument* pTextDoc = 
dynamic_cast(mxComponent.get());
+pTextDoc->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_MOD1 | KEY_PAGEUP);
+
+// Insert header
+// Without the fix in place, this test would have got SIGABRT here
+dispatchCommand(mxComponent, ".uno:InsertHeader", {});
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/paintfrm.cxx 
b/sw/source/core/layout/paintfrm.cxx
index 7c757e4d19ca..8b44b33445d5 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -7070,6 +7070,10 @@ std::vector 
SwPageFrame::GetSubsidiaryLinesPolygons(const S
 const SwFrame* pLay = Lower();
 const SwFrame* pFootnoteCont = nullptr;
 const SwFrame* pPageBody = nullptr;
+
+if (!pLay)
+return aPolygons;
+
 while ( pLay && !( pFootnoteCont && pPageBody ) )
 {
 if ( pLay->IsFootnoteContFrame( ) )


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

2023-07-27 Thread Hossein (via logerrit)
 sc/qa/uitest/calc_tests9/tdf156268.py |   24 ++
 sc/qa/uitest/data/tdf156268.fods  |  358 ++
 2 files changed, 382 insertions(+)

New commits:
commit f58dc86c9c8a257f620b009e243ab591a4a67ced
Author: Hossein 
AuthorDate: Thu Jul 27 02:44:12 2023 +0200
Commit: Hossein 
CommitDate: Thu Jul 27 10:41:26 2023 +0200

tdf#156268 Add UITest for Calc ### display crash

UITest loads a minimal .fods example to check if Calc crashes with that.
The example file does not crash without UI, as it needs the ###
indication to be painted on the screen. Calc does not crash with the
CppUnitTest, tested using testImportCrash() to load the file in a test
added to sc/qa/unit/subsequent_filters_test4.cxx. Also, PDF export works
without problem. But, UITest leads to crash without the fix in place.

The UITest can be run using:

 make UITest_calc_tests9 UITEST_TEST_NAME=tdf156268.Tdf156268.test_tdf156268

Change-Id: I9712d70f057cfc11f10fd98caadbf6e10ee67d5e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154977
Tested-by: Jenkins
Reviewed-by: Hossein 

diff --git a/sc/qa/uitest/calc_tests9/tdf156268.py 
b/sc/qa/uitest/calc_tests9/tdf156268.py
new file mode 100644
index ..373f0d90da85
--- /dev/null
+++ b/sc/qa/uitest/calc_tests9/tdf156268.py
@@ -0,0 +1,24 @@
+# -*- 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 libreoffice.uno.propertyvalue import mkPropertyValues
+from libreoffice.calc.document import get_cell_by_position
+from uitest.uihelper.common import get_url_for_data_file
+
+class Tdf156268(UITestCase):
+
+   def test_tdf156268(self):
+# In order to simulate copy from external source,
+# import the text in Writer, copy it and paste it in Calc
+with self.ui_test.load_file(get_url_for_data_file("tdf156268.fods")):
+
+self.xUITest.executeCommand(".uno:SelectAll")
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/data/tdf156268.fods b/sc/qa/uitest/data/tdf156268.fods
new file mode 100644
index ..aaa8ed1e13e4
--- /dev/null
+++ b/sc/qa/uitest/data/tdf156268.fods
@@ -0,0 +1,358 @@
+
+
+http://www.w3.org/TR/css3-text/; 
xmlns:grddl="http://www.w3.org/2003/g/data-view#; 
xmlns:xhtml="http://www.w3.org/1999/xhtml; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema; 
xmlns:xforms="http://www.w3.org/2002/xforms; 
xmlns:dom="http://www.w3.org/2001/xml-events; 
xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" 
xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" 
xmlns:math="http://www.w3.org/1998/Math/MathML; 
xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" 
xmlns:ooo="http://openoffice.org/2004/office; 
xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" 
xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" 
xmlns:ooow="http://openoffice.org/2004/writer; 
xmlns:xlink="http://www.w3.org/1999/xlink; 
xmlns:drawooo="http://openoffice.org/2010/draw; xmlns:oooc="http://o
 penoffice.org/2004/calc" xmlns:dc="http://purl.org/dc/elements/1.1/; 
xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0"
 xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" 
xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" 
xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" 
xmlns:tableooo="http://openoffice.org/2009/table; 
xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" 
xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" 
xmlns:rpt="http://openoffice.org/2005/report; 
xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0"
 xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" 
xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" 
xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" 
xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" 
xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" 
xmlns:meta="urn:oasis:name
 s:tc:opendocument:xmlns:meta:1.0" 
xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0"
 office:version="1.3" 
office:mimetype="application/vnd.oasis.opendocument.spreadsheet">
+ 
2013-06-26T09:55:092023-07-27T01:42:19.9176907498P23DT22H13M17SLibreOffice/7.5.1.2$Linux_X86_64
 
LibreOffice_project/fcbaee479e84c6cd81291587d2ee68cba099e129
+ 
+  
+   0
+   0
+   399
+   18062
+   
+
+ view1
+ 
+  
+   0
+   1
+   2
+   2
+   3
+   9
+   0
+   0
+   3
+   0
+   9

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

2023-07-17 Thread Hossein (via logerrit)
 sfx2/source/sidebar/ResourceManager.cxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit 4ea4ce78d116757638b08a389d9c509c523085f3
Author: Hossein 
AuthorDate: Mon Jul 17 11:39:58 2023 +0200
Commit: Hossein 
CommitDate: Mon Jul 17 18:38:08 2023 +0200

Remove leftover debug code

This fprintf was leftover from 1653bb9bffaa84a40b7d81a8277e887ea28df4e4
which came up with attachment 94167 from tdf#75059 in terminal output
with just opening and closing in the official 7.5.1.2 binaries.

Change-Id: Ib04b5f6dd3426e97a14b3c6f38b68481f1bf85b7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154518
Tested-by: Jenkins
Reviewed-by: Hossein 

diff --git a/sfx2/source/sidebar/ResourceManager.cxx 
b/sfx2/source/sidebar/ResourceManager.cxx
index 5974e20af488..7989d2820263 100644
--- a/sfx2/source/sidebar/ResourceManager.cxx
+++ b/sfx2/source/sidebar/ResourceManager.cxx
@@ -699,7 +699,6 @@ void ResourceManager::ReadLegacyAddons (const 
Reference& rxC
 rPanelDescriptor.mbShowForReadOnlyDocuments = false;
 rPanelDescriptor.mbWantsCanvas = false;
 rPanelDescriptor.mbWantsAWT = true;
-fprintf(stderr, "THIS PLACE\n");
 
rPanelDescriptor.maContextList.AddContextDescription(Context(sModuleName, 
"any"), true, OUString());
 }
 }


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

2023-06-19 Thread Hossein (via logerrit)
 sw/source/uibase/docvw/edtwin.cxx   |   18 +++---
 sw/source/uibase/docvw/edtwin2.cxx  |   21 
 sw/source/uibase/inc/edtwin.hxx |1 
 sw/source/uibase/inc/shdwcrsr.hxx   |5 ---
 sw/source/uibase/utlui/shdwcrsr.cxx |   59 +---
 5 files changed, 24 insertions(+), 80 deletions(-)

New commits:
commit f9f7cfc080c3adb751ceca96be4ca5440de4a2b6
Author: Hossein 
AuthorDate: Wed Jun 14 23:55:06 2023 +0200
Commit: Hossein 
CommitDate: Tue Jun 20 01:03:55 2023 +0200

tdf#122970 Fix direct cursor leaving screen trail

Previously, an old method using RasterOp::Xor rendering (see tdf#38844)
was used to draw the extra triangle left or right of the mouse pointer
in direct cursor mode. Now, instead of drawing it manually, we change
the cursor type to somewhat similar pointer type.

There is no perfect match for the previous mouse pointer shape, so now
instead of left triangle, PointerStyle::AutoScrollW is used. Also instead
of right triangle, PointerStyle::AutoScrollE is used.

Change-Id: Iadb955f9fcee0978a190e0b8920186a2579f3a4b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153099
Tested-by: Jenkins
Reviewed-by: Hossein 

diff --git a/sw/source/uibase/docvw/edtwin.cxx 
b/sw/source/uibase/docvw/edtwin.cxx
index ba62bb8fa856..65ec052a 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -634,6 +634,14 @@ void SwEditWin::UpdatePointer(const Point , 
sal_uInt16 nModifier )
 eStyle = PointerStyle::HideWhitespace;
 }
 
+if( m_pShadCursor )
+{
+if( text::HoriOrientation::LEFT == m_eOrient )// Arrow to the 
right
+eStyle = PointerStyle::AutoScrollE;
+else// Arrow to the left
+eStyle = PointerStyle::AutoScrollW;
+}
+
 SetPointer( eStyle );
 }
 }
@@ -4537,16 +4545,16 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt)
 !rSh.HasSelection() && !GetOutDev()->GetConnectMetaFile() )
 {
 SwRect aRect;
-sal_Int16 eOrient;
+
 SwFillMode eMode = 
rSh.GetViewOptions()->GetShdwCursorFillMode();
-if( rSh.GetShadowCursorPos( aDocPt, eMode, aRect, eOrient 
))
+if( rSh.GetShadowCursorPos( aDocPt, eMode, aRect, 
m_eOrient ))
 {
 if( !m_pShadCursor )
 m_pShadCursor.reset( new SwShadowCursor( *this,
 rSh.GetViewOptions()->GetDirectCursorColor() ) 
);
-if( text::HoriOrientation::RIGHT != eOrient && 
text::HoriOrientation::CENTER != eOrient )
-eOrient = text::HoriOrientation::LEFT;
-m_pShadCursor->SetPos( aRect.Pos(), aRect.Height(), 
static_cast< sal_uInt16 >(eOrient) );
+if( text::HoriOrientation::RIGHT != m_eOrient && 
text::HoriOrientation::CENTER != m_eOrient )
+m_eOrient = text::HoriOrientation::LEFT;
+m_pShadCursor->SetPos( aRect.Pos(), aRect.Height(), 
static_cast< sal_uInt16 >(m_eOrient) );
 bDelShadCursor = false;
 }
 }
diff --git a/sw/source/uibase/docvw/edtwin2.cxx 
b/sw/source/uibase/docvw/edtwin2.cxx
index bafd9570a726..6e09ffd19b45 100644
--- a/sw/source/uibase/docvw/edtwin2.cxx
+++ b/sw/source/uibase/docvw/edtwin2.cxx
@@ -660,24 +660,6 @@ void SwEditWin::Paint(vcl::RenderContext& rRenderContext, 
const tools::Rectangle
 SwWrtShell* pWrtShell = GetView().GetWrtShellPtr();
 if(!pWrtShell)
 return;
-bool bPaintShadowCursor = false;
-if( m_pShadCursor )
-{
-tools::Rectangle aRect( m_pShadCursor->GetRect());
-// fully resides inside?
-if( rRect.Contains( aRect ) )
-{
-// then cancel
-m_pShadCursor.reset();
-}
-else if( rRect.Overlaps( aRect ))
-{
-// resides somewhat above, then everything is clipped outside
-// and we have to make the "inner part" at the end of the
-// Paint visible again. Otherwise Paint errors occur!
-bPaintShadowCursor = true;
-}
-}
 
 if ( GetView().GetVisArea().GetWidth()  <= 0 ||
   GetView().GetVisArea().GetHeight() <= 0 )
@@ -698,9 +680,6 @@ void SwEditWin::Paint(vcl::RenderContext& rRenderContext, 
const tools::Rectangle
 }
 pWrtShell->setOutputToWindow(false);
 }
-
-if( bPaintShadowCursor )
-m_pShadCursor->Paint();
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/inc/edtwin.hxx b/sw/source/uibase/inc/edtwin.hxx
index aac86d4f8807..714e6bcc3be0 100644
--- a/sw/source/uibase/inc/edtwin.hxx
+++ 

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

2023-06-04 Thread Hossein (via logerrit)
 cui/source/inc/connect.hxx  |2 +-
 cui/source/tabpages/connect.cxx |   16 
 2 files changed, 9 insertions(+), 9 deletions(-)

New commits:
commit af27b57521075b35234daed4a6a7b554ed434df7
Author: Hossein 
AuthorDate: Sun Jun 4 22:16:27 2023 +0200
Commit: Hossein 
CommitDate: Sun Jun 4 23:56:55 2023 +0200

Rename function to SetMetricValueAndSave

Rename the function, remove prefix and suffix

Change-Id: Iaca0541d15a9162f11f8461892bf4c4454c9d674
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151843
Tested-by: Jenkins
Reviewed-by: Hossein 

diff --git a/cui/source/inc/connect.hxx b/cui/source/inc/connect.hxx
index 9aa2cc92dabb..73891d0ff8e6 100644
--- a/cui/source/inc/connect.hxx
+++ b/cui/source/inc/connect.hxx
@@ -56,7 +56,7 @@ private:
 DECL_LINK(ChangeAttrListBoxHdl_Impl, weld::ComboBox&, void);
 
 template
-void lcl_SetMetricValueAndSave_new(const SfxItemSet *rAttrs, 
weld::MetricSpinButton , TypedWhichId nWhich);
+void SetMetricValueAndSave(const SfxItemSet *rAttrs, 
weld::MetricSpinButton , TypedWhichId nWhich);
 public:
 
 SvxConnectionPage(weld::Container* pPage, weld::DialogController* 
pController, const SfxItemSet& rInAttrs);
diff --git a/cui/source/tabpages/connect.cxx b/cui/source/tabpages/connect.cxx
index a76de5eff3fd..b69f17b55113 100644
--- a/cui/source/tabpages/connect.cxx
+++ b/cui/source/tabpages/connect.cxx
@@ -119,7 +119,7 @@ SvxConnectionPage::~SvxConnectionPage()
 }
 
 template
-void SvxConnectionPage::lcl_SetMetricValueAndSave_new(const SfxItemSet* 
rAttrs, weld::MetricSpinButton& rField, TypedWhichId nWhich)
+void SvxConnectionPage::SetMetricValueAndSave(const SfxItemSet* rAttrs, 
weld::MetricSpinButton& rField, TypedWhichId nWhich)
 {
 const SfxPoolItem* pItem = GetItem( *rAttrs,  nWhich);
 const SfxItemPool* pPool = rAttrs->GetPool();
@@ -141,25 +141,25 @@ void SvxConnectionPage::Reset( const SfxItemSet* rAttrs )
 const SfxItemPool* pPool = rAttrs->GetPool();
 
 // SdrEdgeNode1HorzDistItem
-lcl_SetMetricValueAndSave_new(rAttrs, *m_xMtrFldHorz1, 
SDRATTR_EDGENODE1HORZDIST);
+SetMetricValueAndSave(rAttrs, *m_xMtrFldHorz1, SDRATTR_EDGENODE1HORZDIST);
 
 // SdrEdgeNode2HorzDistItem
-lcl_SetMetricValueAndSave_new(rAttrs, *m_xMtrFldHorz2, 
SDRATTR_EDGENODE2HORZDIST);
+SetMetricValueAndSave(rAttrs, *m_xMtrFldHorz2, SDRATTR_EDGENODE2HORZDIST);
 
 // SdrEdgeNode1VertDistItem
-lcl_SetMetricValueAndSave_new(rAttrs, *m_xMtrFldVert1, 
SDRATTR_EDGENODE1VERTDIST);
+SetMetricValueAndSave(rAttrs, *m_xMtrFldVert1, SDRATTR_EDGENODE1VERTDIST);
 
 // SdrEdgeNode2VertDistItem
-lcl_SetMetricValueAndSave_new(rAttrs, *m_xMtrFldVert2, 
SDRATTR_EDGENODE2VERTDIST);
+SetMetricValueAndSave(rAttrs, *m_xMtrFldVert2, SDRATTR_EDGENODE2VERTDIST);
 
 // SdrEdgeLine1DeltaItem
-lcl_SetMetricValueAndSave_new(rAttrs, *m_xMtrFldLine1, 
SDRATTR_EDGELINE1DELTA);
+SetMetricValueAndSave(rAttrs, *m_xMtrFldLine1, SDRATTR_EDGELINE1DELTA);
 
 // SdrEdgeLine2DeltaItem
-lcl_SetMetricValueAndSave_new(rAttrs, *m_xMtrFldLine2, 
SDRATTR_EDGELINE2DELTA);
+SetMetricValueAndSave(rAttrs, *m_xMtrFldLine2, SDRATTR_EDGELINE2DELTA);
 
 // SdrEdgeLine3DeltaItem
-lcl_SetMetricValueAndSave_new(rAttrs, *m_xMtrFldLine3, 
SDRATTR_EDGELINE3DELTA);
+SetMetricValueAndSave(rAttrs, *m_xMtrFldLine3, SDRATTR_EDGELINE3DELTA);
 
 // SdrEdgeLineDeltaAnzItem
 pItem = GetItem( *rAttrs, SDRATTR_EDGELINEDELTACOUNT );


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

2023-05-16 Thread Hossein (via logerrit)
 cui/source/inc/connect.hxx  |2 +
 cui/source/tabpages/connect.cxx |   58 +---
 2 files changed, 21 insertions(+), 39 deletions(-)

New commits:
commit c01639c556276e496d9e762468cad6b27f9ed0f4
Author: Hossein 
AuthorDate: Tue May 16 00:50:48 2023 +0200
Commit: Hossein 
CommitDate: Tue May 16 13:44:00 2023 +0200

Simplify the code by introducing a new function

There were a lot of repetitions in the code of the function
SvxConnectionPage::Reset(). This patch Simplifies this function by
introducing SvxConnectionPage::lcl_SetMetricValueAndSave() to do the
repetetive instructions.

Change-Id: I337ccf2281fd8d1bd9b1948beb6d31b2306eb339
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151820
Tested-by: Jenkins
Reviewed-by: Hossein 

diff --git a/cui/source/inc/connect.hxx b/cui/source/inc/connect.hxx
index 8b7119f0dcaf..9aa2cc92dabb 100644
--- a/cui/source/inc/connect.hxx
+++ b/cui/source/inc/connect.hxx
@@ -55,6 +55,8 @@ private:
 DECL_LINK(ChangeAttrEditHdl_Impl, weld::MetricSpinButton&, void);
 DECL_LINK(ChangeAttrListBoxHdl_Impl, weld::ComboBox&, void);
 
+template
+void lcl_SetMetricValueAndSave_new(const SfxItemSet *rAttrs, 
weld::MetricSpinButton , TypedWhichId nWhich);
 public:
 
 SvxConnectionPage(weld::Container* pPage, weld::DialogController* 
pController, const SfxItemSet& rInAttrs);
diff --git a/cui/source/tabpages/connect.cxx b/cui/source/tabpages/connect.cxx
index f26cb485c897..a76de5eff3fd 100644
--- a/cui/source/tabpages/connect.cxx
+++ b/cui/source/tabpages/connect.cxx
@@ -118,6 +118,17 @@ SvxConnectionPage::~SvxConnectionPage()
 m_xCtlPreview.reset();
 }
 
+template
+void SvxConnectionPage::lcl_SetMetricValueAndSave_new(const SfxItemSet* 
rAttrs, weld::MetricSpinButton& rField, TypedWhichId nWhich)
+{
+const SfxPoolItem* pItem = GetItem( *rAttrs,  nWhich);
+const SfxItemPool* pPool = rAttrs->GetPool();
+if( !pItem )
+pItem = >GetDefaultItem( nWhich );
+SetMetricValue(rField, pItem->StaticWhichCast(nWhich).GetValue(), eUnit);
+rField.save_value();
+}
+
 /*
 |*
 |* reads passed Item-Set
@@ -126,60 +137,29 @@ SvxConnectionPage::~SvxConnectionPage()
 
 void SvxConnectionPage::Reset( const SfxItemSet* rAttrs )
 {
-const SfxPoolItem* pItem = GetItem( *rAttrs, SDRATTR_EDGENODE1HORZDIST );
+const SfxPoolItem* pItem;
 const SfxItemPool* pPool = rAttrs->GetPool();
 
 // SdrEdgeNode1HorzDistItem
-if( !pItem )
-pItem = >GetDefaultItem( SDRATTR_EDGENODE1HORZDIST );
-SetMetricValue(*m_xMtrFldHorz1, 
pItem->StaticWhichCast(SDRATTR_EDGENODE1HORZDIST).GetValue(),
-   eUnit);
-m_xMtrFldHorz1->save_value();
+lcl_SetMetricValueAndSave_new(rAttrs, *m_xMtrFldHorz1, 
SDRATTR_EDGENODE1HORZDIST);
 
 // SdrEdgeNode2HorzDistItem
-pItem = GetItem( *rAttrs, SDRATTR_EDGENODE2HORZDIST );
-if( !pItem )
-pItem = >GetDefaultItem( SDRATTR_EDGENODE2HORZDIST );
-SetMetricValue(*m_xMtrFldHorz2, 
pItem->StaticWhichCast(SDRATTR_EDGENODE2HORZDIST).GetValue(),
-   eUnit);
-m_xMtrFldHorz2->save_value();
+lcl_SetMetricValueAndSave_new(rAttrs, *m_xMtrFldHorz2, 
SDRATTR_EDGENODE2HORZDIST);
 
 // SdrEdgeNode1VertDistItem
-pItem = GetItem( *rAttrs, SDRATTR_EDGENODE1VERTDIST );
-if( !pItem )
-pItem = >GetDefaultItem( SDRATTR_EDGENODE1VERTDIST );
-SetMetricValue(*m_xMtrFldVert1, 
pItem->StaticWhichCast(SDRATTR_EDGENODE1VERTDIST).GetValue(),
-   eUnit);
-m_xMtrFldVert1->save_value();
+lcl_SetMetricValueAndSave_new(rAttrs, *m_xMtrFldVert1, 
SDRATTR_EDGENODE1VERTDIST);
 
 // SdrEdgeNode2VertDistItem
-pItem = GetItem( *rAttrs, SDRATTR_EDGENODE2VERTDIST );
-if( !pItem )
-pItem = >GetDefaultItem( SDRATTR_EDGENODE2VERTDIST );
-SetMetricValue(*m_xMtrFldVert2, 
pItem->StaticWhichCast(SDRATTR_EDGENODE2VERTDIST).GetValue(),
-   eUnit);
-m_xMtrFldVert2->save_value();
+lcl_SetMetricValueAndSave_new(rAttrs, *m_xMtrFldVert2, 
SDRATTR_EDGENODE2VERTDIST);
 
 // SdrEdgeLine1DeltaItem
-pItem = GetItem( *rAttrs, SDRATTR_EDGELINE1DELTA );
-if( !pItem )
-pItem = >GetDefaultItem( SDRATTR_EDGELINE1DELTA );
-SetMetricValue(*m_xMtrFldLine1, 
pItem->StaticWhichCast(SDRATTR_EDGELINE1DELTA).GetValue(), eUnit);
-m_xMtrFldLine1->save_value();
+lcl_SetMetricValueAndSave_new(rAttrs, *m_xMtrFldLine1, 
SDRATTR_EDGELINE1DELTA);
 
 // SdrEdgeLine2DeltaItem
-pItem = GetItem( *rAttrs, SDRATTR_EDGELINE2DELTA );
-if( !pItem )
-pItem = >GetDefaultItem( SDRATTR_EDGELINE2DELTA );
-SetMetricValue(*m_xMtrFldLine2, 
pItem->StaticWhichCast(SDRATTR_EDGELINE2DELTA).GetValue(), eUnit);
-m_xMtrFldLine2->save_value();
+lcl_SetMetricValueAndSave_new(rAttrs, *m_xMtrFldLine2, 
SDRATTR_EDGELINE2DELTA);
 
 // 

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

2023-05-08 Thread Hossein (via logerrit)
 writerfilter/source/dmapper/DomainMapperTableHandler.cxx |   20 +++
 1 file changed, 10 insertions(+), 10 deletions(-)

New commits:
commit fdd7304485ce00177e4b61e6632d14d89d438756
Author: Hossein 
AuthorDate: Sat May 6 15:18:43 2023 +0200
Commit: Stephan Bergmann 
CommitDate: Mon May 8 09:36:59 2023 +0200

Drop boost dependency for writerfilter

The last usage of boost in writerfilter was .
This is now implemented using rtl::math::stringToDouble(). To avoid
behavior change in case it does not find any suitable characters to
convert, it is checked that the index of the last parsed character to
be zero, as lexical_cast throwing bad_lexical_cast exception in this
case but stringToDouble reports rtl_math_ConversionStatus_Ok.

OUString::toDouble() is not enough here, as it does not provide suitable
error handling mechanism beyond IEEE 754 special values and 0 as output.

stringToDouble() should be able to handle 16-bit char strings, as it
takes std::u16string_view type string as input, and also uses sal_Unicode
as the data type for the separators.

The boost library is no longer in use in writerfilter. But, right now it
is not possible to remove the remainings from the makefiles and includes,
because of the dependencies that still use boost.

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

diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx 
b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
index c70615a49a9f..f2f09d8a22d4 100644
--- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
@@ -51,7 +51,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #ifdef DBG_UTIL
@@ -1248,15 +1247,16 @@ static void lcl_convertFormulaRanges(const 
uno::Reference & xT
 sLastCell = 
xCell->getPropertyValue("CellName").get();
 if (sNextCell.isEmpty())
 sNextCell = sLastCell;
-try
-{
-// accept numbers with comma and 
percent
-OUString sCellText = 
xText->getString().replace(',', '.');
-if (sCellText.endsWith("%"))
-sCellText = sCellText.copy(0, 
sCellText.getLength()-1);
-
boost::lexical_cast(sCellText);
-}
-catch( boost::bad_lexical_cast const& )
+
+// accept numbers with comma and 
percent
+OUString sCellText = 
xText->getString().replace(',', '.');
+if (sCellText.endsWith("%"))
+sCellText = sCellText.copy(0, 
sCellText.getLength()-1);
+
+rtl_math_ConversionStatus 
eConversionStatus;
+sal_Int32 nParsedEnd;
+rtl::math::stringToDouble(sCellText, 
'.', ',', , );
+if ( eConversionStatus != 
rtl_math_ConversionStatus_Ok || nParsedEnd == 0 )
 {
 if ( !bFoundFirst )
 {


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

2023-05-04 Thread Hossein (via logerrit)
 sw/qa/extras/uiwriter/uiwriter3.cxx   |   56 ++
 sw/qa/uitest/writer_tests2/deleteFootnotes.py |   44 
 2 files changed, 56 insertions(+), 44 deletions(-)

New commits:
commit 894bb1128ca0e80b96d48bfd94556f70af02ce41
Author: Hossein 
AuthorDate: Wed May 3 15:13:06 2023 +0200
Commit: Hossein 
CommitDate: Thu May 4 15:17:35 2023 +0200

tdf#150457 Port UITest to CppunitTest

The UITest for tdf#150457 is now ported to CppunitTest. The new test can
be run by:

 make CPPUNIT_TEST_NAME=testTdf150457 -sr CppunitTest_sw_uiwriter3

Without the fix d05c176cc022f1b771f7c064f6ce74e9f8c27a1b in place,
running the test leads to a segfault.

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

diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx 
b/sw/qa/extras/uiwriter/uiwriter3.cxx
index 00665b353d7d..c7bc792e4a5b 100644
--- a/sw/qa/extras/uiwriter/uiwriter3.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter3.cxx
@@ -2294,6 +2294,62 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf130680)
 CPPUNIT_ASSERT_EQUAL(sal_Int32(23), xIndexAccess->getCount());
 }
 
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf150457)
+{
+createSwDoc();
+SwXTextDocument* pTextDoc = 
dynamic_cast(mxComponent.get());
+
+pTextDoc->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 'a', 0);
+Scheduler::ProcessEventsToIdle();
+
+dispatchCommand(mxComponent, ".uno:InsertFootnote", {});
+pTextDoc->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 'a', 0);
+pTextDoc->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 'b', 0);
+pTextDoc->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 'c', 0);
+Scheduler::ProcessEventsToIdle();
+
+auto xFootnotes = pTextDoc->getFootnotes();
+CPPUNIT_ASSERT_EQUAL(static_cast(1), xFootnotes->getCount());
+auto xParagraph = 
uno::Reference(xFootnotes->getByIndex(0), uno::UNO_QUERY);
+CPPUNIT_ASSERT_EQUAL(OUString("abc"), xParagraph->getString());
+
+pTextDoc->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_PAGEUP);
+pTextDoc->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_RETURN);
+pTextDoc->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 'd', 0);
+Scheduler::ProcessEventsToIdle();
+
+dispatchCommand(mxComponent, ".uno:InsertFootnote", {});
+pTextDoc->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 'd', 0);
+pTextDoc->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 'e', 0);
+pTextDoc->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 'f', 0);
+Scheduler::ProcessEventsToIdle();
+
+CPPUNIT_ASSERT_EQUAL(static_cast(2), xFootnotes->getCount());
+xParagraph = uno::Reference(xFootnotes->getByIndex(1), 
uno::UNO_QUERY);
+CPPUNIT_ASSERT_EQUAL(OUString("def"), xParagraph->getString());
+
+// This key sequence deletes a footnote and its number (without the fix 
applied)
+pTextDoc->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_UP);
+pTextDoc->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_HOME);
+pTextDoc->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_SHIFT | KEY_DOWN);
+pTextDoc->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_DELETE);
+
+// Page up moves the cursor from the footnote area to the main text, then
+// doing select all and pressing delete removes all the text and footenote 
references,
+// thus removing all the footnotes
+pTextDoc->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_PAGEUP);
+pTextDoc->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, awt::Key::SELECT_ALL);
+pTextDoc->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_DELETE);
+
+// Without having fix in place, segfault happens after running next line
+Scheduler::ProcessEventsToIdle();
+
+// Without the fix, the above action should have already created a crash,
+// but here we also check to make sure that the number of footnotes are
+// exactly zero, as expected
+CPPUNIT_ASSERT_EQUAL(static_cast(0), xFootnotes->getCount());
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/uitest/writer_tests2/deleteFootnotes.py 
b/sw/qa/uitest/writer_tests2/deleteFootnotes.py
deleted file mode 100644
index 0c6644097a51..
--- a/sw/qa/uitest/writer_tests2/deleteFootnotes.py
+++ /dev/null
@@ -1,44 +0,0 @@
-# -*- 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 type_text
-from libreoffice.uno.propertyvalue import mkPropertyValues
-
-class tdf150457(UITestCase):
-
-   def test_delete_footnotes(self):
-with self.ui_test.create_doc_in_start_center("writer") as document:
-xWriterDoc = 

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

2023-05-03 Thread Hossein (via logerrit)
 svx/source/sdr/contact/viewcontactofsdrpathobj.cxx |3 ++-
 sw/source/core/text/itrform2.cxx   |   14 +++---
 2 files changed, 13 insertions(+), 4 deletions(-)

New commits:
commit df461b42126e440492fc919d2b1b2d6649962a90
Author: Hossein 
AuthorDate: Mon Apr 17 13:17:00 2023 +0200
Commit: Xisco Fauli 
CommitDate: Wed May 3 10:03:20 2023 +0200

tdf#152246 Fix RTL content control field position

With this patch, the horizonal position of the content control fields
are corrected. Previously, they were calculated just like the fields in
the LTR paragraphs. To implement this, I've used the
GetTextFrame()->SwitchLTRtoRTL method.

The remaining issue is that The exported fileds in the PDF are still LTR
themselves. For example, the combo box will still be LTR.

It should be pointed that handling vertical text is still an issue that
should be addressed later. If you rotate the paragraph with content
control field, the output does not obey, which is incorrect.

Change-Id: I927d14f9ca90434b4397dcf175dbb9531dda0c7c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150515
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 
(cherry picked from commit 1466e2a58f40c869d8c2590a4479e85c093b3468)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151270
Reviewed-by: Xisco Fauli 

diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx
index ea420b0a0b30..ab31c524ba40 100644
--- a/sw/source/core/text/itrform2.cxx
+++ b/sw/source/core/text/itrform2.cxx
@@ -1064,11 +1064,19 @@ bool SwContentControlPortion::DescribePDFControl(const 
SwTextPaintInfo& rInf) co
 auto pTextFrame = const_cast(rInf.GetTextFrame());
 SwTextSizeInfo aInf(pTextFrame);
 SwTextCursor aLine(pTextFrame, );
-SwRect aStartRect;
+SwRect aStartRect, aEndRect;
 aLine.GetCharRect(, nViewStart);
-aLocation = aStartRect;
-SwRect aEndRect;
 aLine.GetCharRect(, nViewEnd);
+
+// Handling RTL text direction
+if(rInf.GetTextFrame()->IsRightToLeft())
+{
+rInf.GetTextFrame()->SwitchLTRtoRTL( aStartRect );
+rInf.GetTextFrame()->SwitchLTRtoRTL( aEndRect );
+}
+// TODO: handle rInf.GetTextFrame()->IsVertical()
+
+aLocation = aStartRect;
 aLocation.Union(aEndRect);
 pDescriptor->Location = aLocation.SVRect();
 
commit baa397e9b7e2978602a8fe17421d6e9908145108
Author: Noel Grandin 
AuthorDate: Tue May 2 14:03:55 2023 +0200
Commit: Xisco Fauli 
CommitDate: Wed May 3 10:03:13 2023 +0200

fix mistake in commit "optimise ensureGeometry"

In
commit bfe32f3e50b5406810e740ac41368f101033e766
Author: Noel Grandin 
Date:   Wed Jan 12 20:51:39 2022 +0200
optimise ensureGeometry

I got the return value wrong for the early exit case.
I am quite surprised this did not mess up something
in the drawinglayer line handling.

Change-Id: I6788ef8898575c89344f25f6e66c4ae0a999f013
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151268
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
(cherry picked from commit 7a2435b4ae52bbbe8bd7d0fd0cf6a32ee42aac98)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151277
Reviewed-by: Xisco Fauli 

diff --git a/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx 
b/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx
index e2644489d6d1..0a03ace32df8 100644
--- a/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx
@@ -52,8 +52,9 @@ namespace sdr::contact
 for(auto const& rPolygon : std::as_const(rUnitPolyPolygon))
 {
 nPointCount += rPolygon.count();
+// return early if we definitely have geometry
 if (nPointCount > 1)
-return false;
+return nPolyCount == 1;
 }
 
 if(!nPointCount)


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

2023-05-01 Thread Hossein (via logerrit)
 vcl/qa/cppunit/pdfexport/data/content-control-rtl.docx |binary
 vcl/qa/cppunit/pdfexport/pdfexport.cxx |   53 +
 2 files changed, 53 insertions(+)

New commits:
commit 57f46a5a64f4e3bca2f0a52309ca7d201c1e2372
Author: Hossein 
AuthorDate: Wed Apr 26 13:38:20 2023 +0200
Commit: Hossein 
CommitDate: Mon May 1 13:00:48 2023 +0200

tdf#152246 Test position of RTL elements in PDF

This test checks the position of RTL/LTR elements in the exported PDF
files. Without the fix in place, the test fails because the RTL elements
will position as LTR, and the "Rect" element will be something else:

double equality assertion failed
- Expected: 303.349
- Actual  : 56.699
- Delta   : 1e-06

The Sample DOCX file contains both RTL and LTR content controls for testing.

One may run the test with:

 make CPPUNIT_TEST_NAME=testTdf152246 -sr CppunitTest_vcl_pdfexport

For an overview on PDF fill-in forms, please refer to:

James C. King, Introduction to the Insides of PDF, pages 81-85
https://www.adobe.com/technology/pdfs/presentations/KingPDFTutorial.pdf

Change-Id: I6c15b49bffb1aef6f137f7bb518a291f4d88b888
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151228
Tested-by: Jenkins
Reviewed-by: Hossein 

diff --git a/vcl/qa/cppunit/pdfexport/data/content-control-rtl.docx 
b/vcl/qa/cppunit/pdfexport/data/content-control-rtl.docx
new file mode 100644
index ..1b5fba455517
Binary files /dev/null and 
b/vcl/qa/cppunit/pdfexport/data/content-control-rtl.docx differ
diff --git a/vcl/qa/cppunit/pdfexport/pdfexport.cxx 
b/vcl/qa/cppunit/pdfexport/pdfexport.cxx
index a11e2a820506..4bdc920b3574 100644
--- a/vcl/qa/cppunit/pdfexport/pdfexport.cxx
+++ b/vcl/qa/cppunit/pdfexport/pdfexport.cxx
@@ -4638,6 +4638,59 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, 
testRexportResourceItemReference)
 CPPUNIT_ASSERT(pFontWidths);
 }
 
+CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf152246)
+{
+// Import the bugdoc and export as PDF.
+aMediaDescriptor["FilterName"] <<= OUString("writer_pdf_Export");
+saveAsPDF(u"content-control-rtl.docx");
+
+// Parse the export result.
+vcl::filter::PDFDocument aDocument;
+SvFileStream aStream(maTempFile.GetURL(), StreamMode::READ);
+CPPUNIT_ASSERT(aDocument.Read(aStream));
+
+// The document has one page.
+std::vector aPages = aDocument.GetPages();
+CPPUNIT_ASSERT_EQUAL(static_cast(1), aPages.size());
+
+// Position array
+constexpr double aPos[5][4] = { { 56.699, 707.701, 131.401, 721.499 },
+{ 198.499, 707.701, 273.201, 721.499 },
+{ 303.349, 680.101, 378.051, 693.899 },
+{ 480.599, 680.101, 555.301, 693.899 },
+{ 56.699, 652.501, 131.401, 666.299 } };
+
+// Get page annotations.
+auto pAnnots = 
dynamic_cast(aPages[0]->Lookup("Annots"));
+CPPUNIT_ASSERT(pAnnots);
+CPPUNIT_ASSERT_EQUAL(static_cast(5), 
pAnnots->GetElements().size());
+for (sal_Int32 i = 0; i < 5; ++i)
+{
+auto pAnnotReference
+= 
dynamic_cast(pAnnots->GetElements()[i]);
+CPPUNIT_ASSERT(pAnnotReference);
+vcl::filter::PDFObjectElement* pAnnot = 
pAnnotReference->LookupObject();
+CPPUNIT_ASSERT(pAnnot);
+CPPUNIT_ASSERT_EQUAL(
+OString("Annot"),
+
static_cast(pAnnot->Lookup("Type"))->GetValue());
+CPPUNIT_ASSERT_EQUAL(
+OString("Widget"),
+
static_cast(pAnnot->Lookup("Subtype"))->GetValue());
+
+auto pRect = 
dynamic_cast(pAnnot->Lookup("Rect"));
+CPPUNIT_ASSERT(pRect);
+const auto& rElements = pRect->GetElements();
+CPPUNIT_ASSERT_EQUAL(static_cast(4), rElements.size());
+for (sal_Int32 nIdx = 0; nIdx < 4; ++nIdx)
+{
+const auto* pNumElement = 
dynamic_cast(rElements[nIdx]);
+CPPUNIT_ASSERT(pNumElement);
+CPPUNIT_ASSERT_DOUBLES_EQUAL(aPos[i][nIdx], 
pNumElement->GetValue(), 1e-6);
+}
+}
+}
+
 } // end anonymous namespace
 
 CPPUNIT_PLUGIN_IMPLEMENT();


[Libreoffice-commits] core.git: .gitignore

2023-04-28 Thread Hossein (via logerrit)
 .gitignore |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 8434b855434e17db99ebcd9c8c29f989677b3571
Author: Hossein 
AuthorDate: Wed Apr 26 11:33:38 2023 +0200
Commit: Hossein 
CommitDate: Fri Apr 28 21:54:20 2023 +0200

Add .cache (Qt Creator) and gdbtrace.log (gdb)

Change-Id: I80ebe9270bcb895ea95d2fd679417dd4f2b22165
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151047
Tested-by: Jenkins
Reviewed-by: Hossein 

diff --git a/.gitignore b/.gitignore
index 70f3f95819d5..2655822709cd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -151,6 +151,7 @@ LibreOffice.VC.VC.opendb
 *.pro.user
 *.pro.user.*
 .qtc_clangd
+.cache
 
 # doxygen output
 /docs
@@ -158,9 +159,10 @@ LibreOffice.VC.VC.opendb
 # make dump-deps output
 /lo.png
 
-# gdb config
+# gdb specific
 /.gdbinit
 /.gdb_history
+gdbtrace.log
 
 # Codelite IDE specific
 *.project


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

2023-04-26 Thread Hossein (via logerrit)
 sw/source/core/text/itrform2.cxx |   14 +++---
 1 file changed, 11 insertions(+), 3 deletions(-)

New commits:
commit 1466e2a58f40c869d8c2590a4479e85c093b3468
Author: Hossein 
AuthorDate: Mon Apr 17 13:17:00 2023 +0200
Commit: Miklos Vajna 
CommitDate: Wed Apr 26 11:09:10 2023 +0200

tdf#152246 Fix RTL content control field position

With this patch, the horizonal position of the content control fields
are corrected. Previously, they were calculated just like the fields in
the LTR paragraphs. To implement this, I've used the
GetTextFrame()->SwitchLTRtoRTL method.

The remaining issue is that The exported fileds in the PDF are still LTR
themselves. For example, the combo box will still be LTR.

It should be pointed that handling vertical text is still an issue that
should be addressed later. If you rotate the paragraph with content
control field, the output does not obey, which is incorrect.

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

diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx
index f2c130ac4194..f754e13c63a4 100644
--- a/sw/source/core/text/itrform2.cxx
+++ b/sw/source/core/text/itrform2.cxx
@@ -1064,11 +1064,19 @@ bool SwContentControlPortion::DescribePDFControl(const 
SwTextPaintInfo& rInf) co
 auto pTextFrame = const_cast(rInf.GetTextFrame());
 SwTextSizeInfo aInf(pTextFrame);
 SwTextCursor aLine(pTextFrame, );
-SwRect aStartRect;
+SwRect aStartRect, aEndRect;
 aLine.GetCharRect(, nViewStart);
-aLocation = aStartRect;
-SwRect aEndRect;
 aLine.GetCharRect(, nViewEnd);
+
+// Handling RTL text direction
+if(rInf.GetTextFrame()->IsRightToLeft())
+{
+rInf.GetTextFrame()->SwitchLTRtoRTL( aStartRect );
+rInf.GetTextFrame()->SwitchLTRtoRTL( aEndRect );
+}
+// TODO: handle rInf.GetTextFrame()->IsVertical()
+
+aLocation = aStartRect;
 aLocation.Union(aEndRect);
 pDescriptor->Location = aLocation.SVRect();
 


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

2023-02-24 Thread Hossein (via logerrit)
 chart2/qa/extras/chart2import.cxx |   12 
 1 file changed, 4 insertions(+), 8 deletions(-)

New commits:
commit 573863d78ae55cdb8dfc9747aee47804a0b6f84c
Author: Hossein 
AuthorDate: Fri Feb 10 23:20:50 2023 +
Commit: Hossein 
CommitDate: Fri Feb 24 22:58:08 2023 +

tdf#153533 Fix chart2_import test failure on HiDPI display

The test checks that the text shape width is smaller than the chart
wall. This test fails on HiDPI displays. For example:


lode/dev/core/chart2/qa/extras/chart2import.cxx(2207) : error : Assertion
Test name: Chart2ImportTest::testFixedSizeBarChartVeryLongLabel
double equality assertion failed
- Expected: 4800
- Actual  : 4632
- Delta   : 100

Failures !!!
Run: 85   Failure total: 1   Failures: 1   Errors: 0


Now, instead of testing the
exact value of the text shape width, I have used CPPUNIT_ASSERT_LESS()
to make sure that the above condition holds:

 CPPUNIT_ASSERT_LESS(xChartWall->getSize().Width, xXAxis->getSize().Width)

This is done in two different tests:

* Chart2ImportTest::testFixedSizeBarChartVeryLongLabel()
* Chart2ImportTest::testAutomaticSizeBarChartVeryLongLabel()

Both tests are among those that can be invoked with:

  cd chart2 && make CppunitTest_chart2_import

Change-Id: Ifb28fcf91da451aecdadff7a95aa810ef16fc510
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146815
Tested-by: Jenkins
Reviewed-by: Hossein 

diff --git a/chart2/qa/extras/chart2import.cxx 
b/chart2/qa/extras/chart2import.cxx
index b02f52c68411..3f156cb79266 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -2200,11 +2200,9 @@ void 
Chart2ImportTest::testFixedSizeBarChartVeryLongLabel()
 CPPUNIT_ASSERT(xChartWall.is());
 
 // The text shape width should be smaller than the chart wall
-// The specific numbers unfortunately vary depending on DPI - allow 1 mm
-CPPUNIT_ASSERT_DOUBLES_EQUAL(5085, xChartWall->getSize().Width, 100);
-CPPUNIT_ASSERT_DOUBLES_EQUAL(7113, xChartWall->getSize().Height, 100);
+CPPUNIT_ASSERT_LESS(xChartWall->getSize().Width, xXAxis->getSize().Width);
 
-CPPUNIT_ASSERT_DOUBLES_EQUAL(4800, xXAxis->getSize().Width, 100);
+CPPUNIT_ASSERT_DOUBLES_EQUAL(7113, xChartWall->getSize().Height, 100);
 CPPUNIT_ASSERT_DOUBLES_EQUAL(398, xXAxis->getSize().Height, 100);
 }
 
@@ -2270,11 +2268,9 @@ void 
Chart2ImportTest::testAutomaticSizeBarChartVeryLongLabel()
 CPPUNIT_ASSERT(xChartWall.is());
 
 // The text shape width should be smaller than the chart wall
-// The specific numbers unfortunately vary depending on DPI - allow 1 mm
-CPPUNIT_ASSERT_DOUBLES_EQUAL(5761, xChartWall->getSize().Width, 100);
-CPPUNIT_ASSERT_DOUBLES_EQUAL(7200, xChartWall->getSize().Height, 100);
+CPPUNIT_ASSERT_LESS(xChartWall->getSize().Width, xXAxis->getSize().Width);
 
-CPPUNIT_ASSERT_DOUBLES_EQUAL(5320, xXAxis->getSize().Width, 100);
+CPPUNIT_ASSERT_DOUBLES_EQUAL(7200, xChartWall->getSize().Height, 100);
 CPPUNIT_ASSERT_DOUBLES_EQUAL(1192, xXAxis->getSize().Height, 100);
 }
 


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

2023-02-14 Thread Hossein (via logerrit)
 svx/source/unodraw/unoshtxt.cxx |9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

New commits:
commit 7dfa3da02c32aacea2992aa3dfcf8cf3301cdd28
Author: Hossein 
AuthorDate: Thu May 5 13:45:36 2022 +0200
Commit: Aron Budea 
CommitDate: Tue Feb 14 08:01:19 2023 +

tdf#148818 Fix missing text in boxes with empty first paragraph

Text was lost from the text boxes with empty first paragraph. The
problem was happening when there was 2 paragraphs in a text box, in
which the first paragraph was completely empty. The regression was
introduced in cf2449aac0141711a7610d67f7c50cd108e12443 because of the
bad handling of the paragraphs, and only looking at the size of the
text of the first paragraph.

This is fixed by looking at mpOutliner->GetEditEngine().GetTextLen(i)
for all i=1..k where k=min(2,mpOutliner->GetParagraphCount()).

I have negated the condition to provide a better explanation of what
the condition should be.

Change-Id: Id5d8787df5111c734760afdd98a6fbe832047f32
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133527
Tested-by: Jenkins
Reviewed-by: Hossein 
(cherry picked from commit 759792e40aceb17a621c37ed725d1e998acbd30d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146390
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Aron Budea 

diff --git a/svx/source/unodraw/unoshtxt.cxx b/svx/source/unodraw/unoshtxt.cxx
index 23c772daa1da..d4b6b791 100644
--- a/svx/source/unodraw/unoshtxt.cxx
+++ b/svx/source/unodraw/unoshtxt.cxx
@@ -775,14 +775,15 @@ void SvxTextEditSourceImpl::UpdateData()
 SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >( mpObject );
 if( pTextObj )
 {
-if( (mpOutliner->GetParagraphCount() != 1 && 
mpOutliner->GetParagraphCount() != 2)
-|| mpOutliner->GetEditEngine().GetTextLen( 0 ) )
+if( (mpOutliner->GetParagraphCount() == 1 && 
mpOutliner->GetEditEngine().GetTextLen( 0 ) == 0 )
+|| (mpOutliner->GetParagraphCount() == 2 && 
mpOutliner->GetEditEngine().GetTextLen( 0 ) == 0
+&& mpOutliner->GetEditEngine().GetTextLen( 1 ) == 
0) )
 {
-pTextObj->NbcSetOutlinerParaObjectForText( 
mpOutliner->CreateParaObject(), mpText );
+pTextObj->NbcSetOutlinerParaObjectForText( std::nullopt, 
mpText );
 }
 else
 {
-pTextObj->NbcSetOutlinerParaObjectForText( std::nullopt, 
mpText );
+pTextObj->NbcSetOutlinerParaObjectForText( 
mpOutliner->CreateParaObject(), mpText );
 }
 }
 


[Libreoffice-commits] core.git: configure.ac

2023-02-08 Thread Hossein (via logerrit)
 configure.ac |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit b1f0c23720cbb7a30128c066d54f7dcf1fdc6178
Author: Hossein 
AuthorDate: Wed Feb 8 23:06:29 2023 +
Commit: Mike Kaganski 
CommitDate: Thu Feb 9 07:06:57 2023 +

tdf#153476 Disable MS telemetry in VsDevCmd.bat

MS telemetry inside VsDevCmd.bat causes problems for the autogen.sh
script which uses it to find the Visual Studio C/C++ standard library
via the environment variables that show the UCRT path and version.

VsDevCmd.bat is the "Developer Command Prompt for Visual Studio".

The telemtry is disabled by:

  set VSCMD_SKIP_SENDTELEMETRY=1

This change resolves the problems described in tdf#153476.

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

diff --git a/configure.ac b/configure.ac
index d6291f7f4fc5..86896f3c4c80 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3995,7 +3995,8 @@ vs_versions_to_check()
 win_get_env_from_vsdevcmdbat()
 {
 local WRAPPERBATCHFILEPATH="`mktemp -t wrpXX.bat`"
-printf '@call "%s/../Common7/Tools/VsDevCmd.bat" /no_logo\r\n' "$(cygpath 
-w $VC_PRODUCT_DIR)" > $WRAPPERBATCHFILEPATH
+printf '@set VSCMD_SKIP_SENDTELEMETRY=1\r\n' > $WRAPPERBATCHFILEPATH
+printf '@call "%s/../Common7/Tools/VsDevCmd.bat" /no_logo\r\n' "$(cygpath 
-w $VC_PRODUCT_DIR)" >> $WRAPPERBATCHFILEPATH
 # use 'echo.%ENV%' syntax (instead of 'echo %ENV%') to avoid outputting 
"ECHO is off." in case when ENV is empty or a space
 printf '@setlocal\r\n@echo.%%%s%%\r\n@endlocal\r\n' "$1" >> 
$WRAPPERBATCHFILEPATH
 local result


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

2023-02-07 Thread Hossein (via logerrit)
 svx/source/unodraw/unoshtxt.cxx |9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

New commits:
commit d26a532651312a200ed88f43a8e67ee2ce7083b9
Author: Hossein 
AuthorDate: Thu May 5 13:45:36 2022 +0200
Commit: Aron Budea 
CommitDate: Wed Feb 8 04:45:06 2023 +

tdf#148818 Fix missing text in boxes with empty first paragraph

Text was lost from the text boxes with empty first paragraph. The
problem was happening when there was 2 paragraphs in a text box, in
which the first paragraph was completely empty. The regression was
introduced in cf2449aac0141711a7610d67f7c50cd108e12443 because of the
bad handling of the paragraphs, and only looking at the size of the
text of the first paragraph.

This is fixed by looking at mpOutliner->GetEditEngine().GetTextLen(i)
for all i=1..k where k=min(2,mpOutliner->GetParagraphCount()).

I have negated the condition to provide a better explanation of what
the condition should be.

Change-Id: Id5d8787df5111c734760afdd98a6fbe832047f32
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133527
Tested-by: Jenkins
Reviewed-by: Hossein 
(cherry picked from commit 759792e40aceb17a621c37ed725d1e998acbd30d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146426
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Aron Budea 

diff --git a/svx/source/unodraw/unoshtxt.cxx b/svx/source/unodraw/unoshtxt.cxx
index e6d80c17ffe1..a11ca30de502 100644
--- a/svx/source/unodraw/unoshtxt.cxx
+++ b/svx/source/unodraw/unoshtxt.cxx
@@ -775,14 +775,15 @@ void SvxTextEditSourceImpl::UpdateData()
 SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >( mpObject );
 if( pTextObj )
 {
-if( (mpOutliner->GetParagraphCount() != 1 && 
mpOutliner->GetParagraphCount() != 2)
-|| mpOutliner->GetEditEngine().GetTextLen( 0 ) )
+if( (mpOutliner->GetParagraphCount() == 1 && 
mpOutliner->GetEditEngine().GetTextLen( 0 ) == 0 )
+|| (mpOutliner->GetParagraphCount() == 2 && 
mpOutliner->GetEditEngine().GetTextLen( 0 ) == 0
+&& mpOutliner->GetEditEngine().GetTextLen( 1 ) == 
0) )
 {
-pTextObj->NbcSetOutlinerParaObjectForText( 
mpOutliner->CreateParaObject(), mpText );
+pTextObj->NbcSetOutlinerParaObjectForText( nullptr, mpText 
);
 }
 else
 {
-pTextObj->NbcSetOutlinerParaObjectForText( nullptr,mpText 
);
+pTextObj->NbcSetOutlinerParaObjectForText( 
mpOutliner->CreateParaObject(), mpText );
 }
 }
 


[Libreoffice-commits] core.git: Repository.mk vcl/Module_vcl.mk

2023-01-28 Thread Hossein (via logerrit)
 Repository.mk |4 ++--
 vcl/Module_vcl.mk |4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 5fa078413ede313aed2ba41c3c57e8e13e4eb847
Author: Hossein 
AuthorDate: Sat Jan 28 01:09:36 2023 +0100
Commit: Hossein 
CommitDate: Sat Jan 28 13:08:27 2023 +

Make minvcl and svdemo VCL examples build on Windows

Previously, minvcl and svdemo VCL examples were not built on Windows.
With this patch, both of the minvcl.exe and svdemo.exe are built on
Windows. To run, one can invoke:

  ./bin/run minvcl
and:
  ./bin/run svdemo

Change-Id: I43bfb314b41c662250615486a3ca783fc6d82600
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146264
Tested-by: Jenkins
Reviewed-by: Hossein 

diff --git a/Repository.mk b/Repository.mk
index 1f63eec0f89b..f8dc574145b7 100644
--- a/Repository.mk
+++ b/Repository.mk
@@ -69,14 +69,14 @@ $(eval $(call gb_Helper_register_executables,NONE, \
unoidl-check \
xrmex \
$(if $(filter-out ANDROID iOS WNT,$(OS)), \
-svdemo \
-minvcl \
 fftester \
 svptest \
 svpclient ) \
$(if $(filter LINUX %BSD SOLARIS,$(OS)), tilebench) \
$(if $(filter LINUX MACOSX SOLARIS WNT %BSD,$(OS)),icontest) \
vcldemo \
+   svdemo \
+   minvcl \
tiledrendering \
mtfdemo \
visualbackendtest \
diff --git a/vcl/Module_vcl.mk b/vcl/Module_vcl.mk
index b6d06a6bc351..52224e438753 100644
--- a/vcl/Module_vcl.mk
+++ b/vcl/Module_vcl.mk
@@ -43,6 +43,8 @@ $(eval $(call gb_Module_add_targets,vcl,\
 , \
 $(if $(filter LINUX MACOSX SOLARIS WNT %BSD,$(OS)), \
 Executable_vcldemo \
+Executable_svdemo \
+Executable_minvcl \
 Executable_icontest \
 Executable_visualbackendtest \
 Executable_mtfdemo \
@@ -54,8 +56,6 @@ ifeq ($(CROSS_COMPILING)$(DISABLE_DYNLOADING),)
 
 $(eval $(call gb_Module_add_targets,vcl,\
 $(if $(filter-out ANDROID iOS WNT,$(OS)), \
-Executable_svdemo \
-Executable_minvcl \
 Executable_fftester \
 Executable_svptest \
 Executable_listfonts \


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

2023-01-28 Thread Hossein (via logerrit)
 vcl/workben/minvcl.cxx |   68 -
 1 file changed, 29 insertions(+), 39 deletions(-)

New commits:
commit 10c340c2b59dd677d6f598901506b08ff2cbd49c
Author: Hossein 
AuthorDate: Mon Dec 5 03:15:36 2022 +0100
Commit: Hossein 
CommitDate: Sat Jan 28 09:00:04 2023 +

Add exception handling to minvcl, minify code

Improve minvcl example:

* Add exception handling
* Minify code by removing custom Window

Change-Id: I1f1dc10c05812b4cfad7d38e09d7ecd26bec35b9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143650
Tested-by: Jenkins
Reviewed-by: Hossein 

diff --git a/vcl/workben/minvcl.cxx b/vcl/workben/minvcl.cxx
index 2e5aa3c061bb..465573918cfd 100644
--- a/vcl/workben/minvcl.cxx
+++ b/vcl/workben/minvcl.cxx
@@ -7,6 +7,8 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
+#include 
+
 #include 
 #include 
 #include 
@@ -14,73 +16,61 @@
 #include 
 #include 
 #include 
-#include 
 
 #include 
 #include 
+#include 
+
+#include 
 
 namespace
 {
-class TheWindow : public WorkWindow
-{
-public:
-TheWindow()
-: WorkWindow(nullptr, WB_APP | WB_STDWORK)
-{
-}
-virtual void Paint(vcl::RenderContext& rRenderContext, const 
tools::Rectangle& rRect);
-};
-
 class TheApplication : public Application
 {
 public:
 virtual int Main();
 
 private:
-VclPtr mpWin;
+VclPtr mpWin;
 };
 }
 
-void TheWindow::Paint(vcl::RenderContext& rRenderContext, const 
tools::Rectangle& rRect)
-{
-rRenderContext.DrawText(Point(rRect.GetWidth() / 2, rRect.getOpenHeight() 
/ 2),
-OUString(u"VCL module in LibreOffice"));
-}
-
 int TheApplication::Main()
 {
-mpWin = VclPtr::Create();
-mpWin->SetText(u"VCL");
+mpWin = VclPtr::Create(nullptr, WB_APP | WB_STDWORK);
+mpWin->SetText(u"Minimum VCL application with a window");
 mpWin->Show();
 Execute();
 mpWin.disposeAndClear();
 return 0;
 }
 
-static int main_impl()
+SAL_IMPLEMENT_MAIN()
 {
-auto xContext = cppu::defaultBootstrap_InitialComponentContext();
-css::uno::Reference xServiceManager(
-xContext->getServiceManager(), css::uno::UNO_QUERY);
-comphelper::setProcessServiceFactory(xServiceManager);
-LanguageTag::setConfiguredSystemLanguage(MsLangId::getSystemLanguage());
+try
+{
+TheApplication aApp;
 
-TheApplication aApp;
-InitVCL();
-int ret = aApp.Main();
-
framework::getDesktop(::comphelper::getProcessComponentContext())->terminate();
-DeInitVCL();
+auto xContext = cppu::defaultBootstrap_InitialComponentContext();
+css::uno::Reference xServiceManager(
+xContext->getServiceManager(), css::uno::UNO_QUERY);
+comphelper::setProcessServiceFactory(xServiceManager);
+
LanguageTag::setConfiguredSystemLanguage(MsLangId::getSystemLanguage());
+InitVCL();
 
-comphelper::setProcessServiceFactory(nullptr);
+aApp.Main();
 
-return ret;
-}
+
framework::getDesktop(::comphelper::getProcessComponentContext())->terminate();
+DeInitVCL();
+comphelper::setProcessServiceFactory(nullptr);
+}
+catch (...)
+{
+std::cout << "Exception has occured\n";
+return 1;
+}
 
-int main()
-{
-int ret;
-suppress_fun_call_w_exception(ret = main_impl());
-return ret;
+return 0;
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */


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

2022-12-28 Thread Hossein (via logerrit)
 sw/source/uibase/uiview/scroll.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 196930bae2577a73a0201bda943e8cccaa839e2b
Author: Hossein 
AuthorDate: Sun Dec 25 02:19:27 2022 +0100
Commit: Stephan Bergmann 
CommitDate: Wed Dec 28 16:17:54 2022 +

Revert "tdf#114441 Convert use of sal_uLong to better integer types"

This partially reverts 3cc818c38e11c0882bc3ad32ffd0019a9ad38643. In this
patch sal_uLong was converted to better data types. In part of the patch
the order of the calls, GetVisibleSize() ~> SetLineSize ~> SetPageSize()
was changed so that the GetVisibleSize() is invoked inside the parameter
passing to SetPageSize() to avoid creating a temporary variable.

As sberg mentioned, it was needed that the call to SetLineSize() did
not have side effects that changes the result of the GetVisibleSize().
But it was hard to prove so, even if it seemed logically sound. Thus,
I am reverting the above commit partially.

In the revert, I've used tools::Long for nVisSize instead of sal_uLong.

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

diff --git a/sw/source/uibase/uiview/scroll.cxx 
b/sw/source/uibase/uiview/scroll.cxx
index 28fbab182bd5..7b1d7f915a7f 100644
--- a/sw/source/uibase/uiview/scroll.cxx
+++ b/sw/source/uibase/uiview/scroll.cxx
@@ -40,8 +40,9 @@ void SwScrollbar::DocSzChgd( const Size  )
 {
 m_aDocSz = rSize;
 SetRange( Range( 0, m_bHori ? rSize.Width() : rSize.Height()) );
+const tools::Long nVisSize = GetVisibleSize();
 SetLineSize( SCROLL_LINE_SIZE );
-SetPageSize( GetVisibleSize() * 77 / 100 );
+SetPageSize( nVisSize * 77 / 100 );
 }
 
 // Will be called after a change of the visible view section.


[Libreoffice-commits] core.git: nlpsolver/README.md

2022-12-19 Thread Hossein (via logerrit)
 nlpsolver/README.md |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit c6837f8ebe611f3a0ae144ffe4d4ac4bc98f6b96
Author: Hossein 
AuthorDate: Sun Dec 18 22:37:34 2022 +0100
Commit: Adolfo Jayme Barrientos 
CommitDate: Mon Dec 19 09:42:02 2022 +

Fix title for nlpsolver/README.md

The nlpsolver module is "Solver for Nonlinear Programming", which was
mistakenly called "New Linear Programming", and this is now fixed.

The change will appear within a week in:

https://docs.libreoffice.org/nlpsolver.html

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

diff --git a/nlpsolver/README.md b/nlpsolver/README.md
index 4f929e0d3dc9..1c1f1ec671f3 100644
--- a/nlpsolver/README.md
+++ b/nlpsolver/README.md
@@ -1,4 +1,4 @@
-# New Linear Programming Solver (nlpsolver)
+# Nonlinear Programming Solver (nlpsolver)
 
 This extension integrates into LibreOffice Calc and offers new Solver engines 
to use for optimizing
 nonlinear programming models.


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

2022-12-13 Thread Hossein (via logerrit)
 sw/qa/uitest/writer_tests2/deleteFootnotes.py |   46 ++
 sw/source/core/crsr/swcrsr.cxx|6 ++-
 2 files changed, 51 insertions(+), 1 deletion(-)

New commits:
commit 02fdf3bb9afef1faee9aaf9f6b437144489f8d31
Author: Hossein 
AuthorDate: Wed Aug 24 23:03:09 2022 +0200
Commit: Michael Stahl 
CommitDate: Tue Dec 13 10:35:33 2022 +

tdf#150457 Fix crash on hovering removed footnote reference

The regression was caused by 402f36efb215338ad545caa65d39fb8a39685ea1.
Before that, 0aa0fda64057647219954480ac1bab86b0f0e433 changed the cursor
jumping behavior to fix tdf#81226. The goal was to make LibreOffice
behave as described in the description of the issue:

"When your cursor is on the last line but not at the end of it, simply
press the down arrow to go at the end of the file (end of that line)."

The same behavior was achieved for pressing down on the last line.

The above patches allowed removing the footnotes and their numbers
(except the first number) while the reference were still present. Then,
on hovering a removed footnote reference, a crash was happening. It
should be noted that even with this patch, removing the first reference
number was not possible.

This fix limits this behavior to anywhere other than inside a footnote.
In this way, it prevents crashing.

With this fix, the behavior of the cursor goes back to what it was
before 0aa0fda64057647219954480ac1bab86b0f0e433. The user will not be
able to select all the footnotes at once. Also, removing footnote number
will not be possible.

It is worth noting that not being able to select all the footnotes at
once prevents the user from changing the characteristics of the
footnotes all at the same time. Also, not being able to remove the
footnote numbers, prevents the user from having footnotes with custom
numbers written manually. Both of these actions are possible in MS Word.
The other difference is that by going up, one can go out of the footnote
section in MS Word, but this is not the case for LibreOffice.

A UI test is added to make sure the crash will not happen again. The
test can be run by:

 cd sw && make -srj1 UITest_writer_tests2 \
  UITEST_TEST_NAME="deleteFootnotes.tdf150457.test_delete_footnotes" \
  SAL_USE_VCLPLUGIN=gen

Change-Id: I1ce7d2189355f6763b6f31219e00516ff7a8164e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138562
Tested-by: Jenkins
Reviewed-by: Hossein 
(cherry picked from commit d05c176cc022f1b771f7c064f6ce74e9f8c27a1b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139423
Reviewed-by: Michael Stahl 

diff --git a/sw/qa/uitest/writer_tests2/deleteFootnotes.py 
b/sw/qa/uitest/writer_tests2/deleteFootnotes.py
new file mode 100644
index ..162cc7d3e1b2
--- /dev/null
+++ b/sw/qa/uitest/writer_tests2/deleteFootnotes.py
@@ -0,0 +1,46 @@
+# -*- 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 type_text
+from libreoffice.uno.propertyvalue import mkPropertyValues
+import time
+
+
+class tdf150457(UITestCase):
+
+   def test_delete_footnotes(self):
+with self.ui_test.create_doc_in_start_center("writer") as document:
+xWriterDoc = self.xUITest.getTopFocusWindow()
+xWriterEdit = xWriterDoc.getChild("writer_edit")
+
+type_text(xWriterEdit, "a")
+self.xUITest.executeCommand(".uno:InsertFootnote")
+type_text(xWriterEdit, "abc")
+self.assertEqual(document.Footnotes[0].String, "abc")
+self.assertEqual(document.Footnotes.getCount(), 1)
+
+xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": 
"PAGEUP"}))
+xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": 
"RETURN"}))
+type_text(xWriterEdit, "d")
+
+self.xUITest.executeCommand(".uno:InsertFootnote")
+type_text(xWriterEdit, "def")
+self.assertEqual(document.Footnotes[1].String, "def")
+self.assertEqual(document.Footnotes.getCount(), 2)
+
+xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": 
"UP"}))
+xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": 
"HOME"}))
+xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": 
"SHIFT+DOWN"}))
+xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": 
"DELETE"}))
+xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": 
"PAGEUP"}))
+

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

2022-11-16 Thread Hossein (via logerrit)
 vcl/source/outdev/bitmap.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 19174e373aa6cb5db6975f925a8a1211f219301b
Author: Hossein 
AuthorDate: Wed Nov 16 04:30:17 2022 +0100
Commit: Caolán McNamara 
CommitDate: Wed Nov 16 13:17:02 2022 +0100

tdf#152061 Fix bitmap image scaling

In the regression introduced by c2c37eadf32c80bcd8f168b9fc67f32002b3cb07
the bitmap image scale was calculated incorrectly. Upon resizing the
image a bit, this problem went away, and the image was shown with much
better quality compared to what it was before the above commit. It
turned out that the problem happened when the scale was less than 1, and
it was happening inside "if ( nScaleX < 1.0 || nScaleY < 1.0 ) {...}".

The part that was calculating aPosAry.mnSrcWidth and aPosAry.mnSrcHeight
was wrong, because it was setting the same height and width without
considering the fScale. The bitmap was scaled using Bitmap::Scale()
parameter which was newly multipled by fScale in the above commit. To
fix the problem, these two values are now multipled by fScale.

Change-Id: I8c77d2db3b05da54f1999d3915a70e3b7cc8106f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142754
Tested-by: Jenkins
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 
(cherry picked from commit 31d510389928c8f8a495a85cdab4c12d1bbbd3ce)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142690

diff --git a/vcl/source/outdev/bitmap.cxx b/vcl/source/outdev/bitmap.cxx
index 49bdf9826398..df916c0e6b70 100644
--- a/vcl/source/outdev/bitmap.cxx
+++ b/vcl/source/outdev/bitmap.cxx
@@ -171,8 +171,8 @@ void OutputDevice::DrawBitmap( const Point& rDestPt, const 
Size& rDestSize,
 if ( nScaleX < 1.0 || nScaleY < 1.0 )
 {
 aBmp.Scale(nScaleX, nScaleY);
-aPosAry.mnSrcWidth = aPosAry.mnDestWidth;
-aPosAry.mnSrcHeight = aPosAry.mnDestHeight;
+aPosAry.mnSrcWidth = aPosAry.mnDestWidth * fScale;
+aPosAry.mnSrcHeight = aPosAry.mnDestHeight * fScale;
 }
 }
 


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

2022-11-16 Thread Hossein (via logerrit)
 vcl/source/outdev/bitmap.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 31d510389928c8f8a495a85cdab4c12d1bbbd3ce
Author: Hossein 
AuthorDate: Wed Nov 16 04:30:17 2022 +0100
Commit: Caolán McNamara 
CommitDate: Wed Nov 16 11:17:29 2022 +0100

tdf#152061 Fix bitmap image scaling

In the regression introduced by c2c37eadf32c80bcd8f168b9fc67f32002b3cb07
the bitmap image scale was calculated incorrectly. Upon resizing the
image a bit, this problem went away, and the image was shown with much
better quality compared to what it was before the above commit. It
turned out that the problem happened when the scale was less than 1, and
it was happening inside "if ( nScaleX < 1.0 || nScaleY < 1.0 ) {...}".

The part that was calculating aPosAry.mnSrcWidth and aPosAry.mnSrcHeight
was wrong, because it was setting the same height and width without
considering the fScale. The bitmap was scaled using Bitmap::Scale()
parameter which was newly multipled by fScale in the above commit. To
fix the problem, these two values are now multipled by fScale.

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

diff --git a/vcl/source/outdev/bitmap.cxx b/vcl/source/outdev/bitmap.cxx
index 45e3b0d3ede1..8e453e835904 100644
--- a/vcl/source/outdev/bitmap.cxx
+++ b/vcl/source/outdev/bitmap.cxx
@@ -171,8 +171,8 @@ void OutputDevice::DrawBitmap( const Point& rDestPt, const 
Size& rDestSize,
 if ( nScaleX < 1.0 || nScaleY < 1.0 )
 {
 aBmp.Scale(nScaleX, nScaleY);
-aPosAry.mnSrcWidth = aPosAry.mnDestWidth;
-aPosAry.mnSrcHeight = aPosAry.mnDestHeight;
+aPosAry.mnSrcWidth = aPosAry.mnDestWidth * fScale;
+aPosAry.mnSrcHeight = aPosAry.mnDestHeight * fScale;
 }
 }
 


[Libreoffice-commits] core.git: include/vcl sc/source sw/qa toolkit/source vcl/inc vcl/source

2022-11-14 Thread Hossein (via logerrit)
 include/vcl/outdev.hxx  |6 ++--
 sc/source/ui/view/output2.cxx   |2 -
 sw/qa/uitest/data/date_picker.docx  |binary
 sw/qa/uitest/writer_tests5/DateFormFieldPropertiesDialog.py |   15 
 toolkit/source/awt/vclxgraphics.cxx |2 -
 vcl/inc/calendar.hxx|2 -
 vcl/source/control/calendar.cxx |7 -
 7 files changed, 26 insertions(+), 8 deletions(-)

New commits:
commit 2d7db6981e5087507c02bde6c0841c388cfaad0f
Author: Hossein 
AuthorDate: Sun Nov 13 00:57:22 2022 +0100
Commit: خالد حسني 
CommitDate: Mon Nov 14 12:08:08 2022 +0100

tdf#152012 Fix assert fail on opening date picker

This patch fixes tdf#152012 which caused an assertion failure on opening
date picker field in a DOCX file

The assertion was:

include/o3tl/span.hxx:83: constexpr o3tl::span::value_type& o3tl::
span::operator[](o3tl::span::size_type) const [with T = const
int; o3tl::span::reference = const int&; o3tl::span::size_type
= long unsigned int]: Assertion `pos < size()' failed.

And the backtrace was:

1  __pthread_kill_implementation   pthread_kill.c:44
2  __pthread_kill_internal pthread_kill.c:78
3  __GI___pthread_kill pthread_kill.c:89
4  __GI_raise  raise.c:26
5  __GI_abort  abort.c:79
6  __assert_fail_base  assert.c:92
7  __GI___assert_fail  assert.c:101
8  o3tl::span::operator[]   span.hxx:83
9  OutputDevice::ImplLayouttext.cxx:1396
10 OutputDevice::DrawTextArray text.cxx:948
11 Calendar::ImplDraw  calendar.cxx:71
12 Calendar::Paint calendar.cxx:1133

The problem was caused by an out of bound access to a vector of integers
which was created for rendering calendar header consisting of the first
letters of 7 days of week, when you clicked on the down arrow on the
date field.

The function OutputDevice::DrawTextArray() takes an 'rStr' string to
draw, and 'pDXAry' array for the exact position of the the individual
characters. It also takes 'nIndex' as the first index, and 'nLen' as the
length of the array. 'nLen' has the default value of -1. In this case,
the length is calculated from the size of the string passed to the
function. This works well if the one who uses the function makes sure
that the size of the array and the length of string are equal.

Previously, for the 7 days of the week, a 7 letter string "smtwtfs"
(depending on the week start day this can be different, but length is
always 7) was sent to this method without providing the length, thus
the string length: 7 was used. In this case, positions of the letters
were calculated and used from other array named mnDayOfWeekAry[7].
mnDayOfWeekAry[k+1] was used as the position of letter k (k=0..5).
In this case, there was 7 letters for 7 days, and only 6 positions
provided by the array. This caused assertion failure in span.hxx:83
when trying to accesss mnDayOfWeekAry[7] via o3tl::span::operator[].

Value of mnDayOfWeekAry[0] was used in other calculations, therefore to
fix this problem, mnDayOfWeekAry was extended from 7 to 8, and the last
position was set to the end of drawing rectangle.

The other thing that is done in this patch to avoid this problem in the
future is removing the default value from the function prototype, so
that the use should always be done by providing the length of array and
starting index. After removing these defaults, it became necessary to
provide empty arrays for 'pKashidaAry' which provides the kashida
positions, if needed.

With this fix in place, the assertion failure no longer happens.

A UI test is added to make sure the crash will not happen again. The
test can be run by invoking:

 cd sw && make -srj1 UITest_writer_tests5 \
  
UITEST_TEST_NAME="DateFormFieldPropertiesDialog.dateFormFieldDialog.test_date_picker_drop_down"
 \
  SAL_USE_VCLPLUGIN=gen

Change-Id: I347afb358fbc4956524f7f0a0abc3a221bf42992
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142642
Tested-by: Jenkins
Reviewed-by: خالد حسني 

diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index b1b47d60c1a0..14c1675e7eed 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -1038,9 +1038,9 @@ public:
 
 voidDrawTextArray( const Point& rStartPt, const 
OUString& rStr,
o3tl::span 
pDXAry,
-   o3tl::span 
pKashidaAry={},
- 

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

2022-11-06 Thread Hossein (via logerrit)
 ure/source/uretest/cppmain.cc |   11 +--
 1 file changed, 5 insertions(+), 6 deletions(-)

New commits:
commit acf7a851e87ec993ae828ccbf1bfb25448e88423
Author: Hossein 
AuthorDate: Sun Nov 6 22:44:40 2022 +0100
Commit: Hossein 
CommitDate: Mon Nov 7 08:20:46 2022 +0100

Revert "tdf#145538 Use range based for loops"

This reverts commit 64469bb1a7383da6e7ff1150d693b3e08f54bc91.

To keep the compatibility with C++98, we need to revert the previous patch.

Quoting sberg:
"This code happens to not normally be processed (see 
ure/source/uretest/README)
and is meant to be compilable with the 3rd-party UNO compiler baselines 
(i.e.,
just C++98, which implies no range base for loops)."

Change-Id: I1355a29af24299a99a23dfcd1dd473894d7c9e0c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142302
Tested-by: Jenkins
Reviewed-by: Hossein 

diff --git a/ure/source/uretest/cppmain.cc b/ure/source/uretest/cppmain.cc
index 1acdad0a7811..fb957d9f221a 100644
--- a/ure/source/uretest/cppmain.cc
+++ b/ure/source/uretest/cppmain.cc
@@ -17,6 +17,7 @@
  */
 
 #include "sal/config.h"
+#include "sal/macros.h"
 
 #include 
 #include 
@@ -119,9 +120,8 @@ private:
 "com.sun.star.script.InvocationAdapterFactory",
 "com.sun.star.uri.UriSchemeParser_vndDOTsunDOTstarDOTscript"
 };
-for (auto const & service : services)
-{
-::rtl::OUString name(::rtl::OUString::createFromAscii(service));
+for (::std::size_t i = 0; i < SAL_N_ELEMENTS(services); ++i) {
+::rtl::OUString name(::rtl::OUString::createFromAscii(services[i]));
 css::uno::Reference< css::uno::XInterface > instance;
 try {
 instance = 
context_->getServiceManager()->createInstanceWithContext(
@@ -165,11 +165,10 @@ private:
 static char const * const singletons[] = {
 "com.sun.star.reflection.theTypeDescriptionManager"
 };
-for (auto const & singleton : singletons)
-{
+for (std::size_t i = 0; i != SAL_N_ELEMENTS(singletons); ++i) {
 css::uno::Reference< css::uno::XInterface > instance(
 context_->getValueByName(
-"/singletons/" + rtl::OUString::createFromAscii(singleton)),
+"/singletons/" + 
rtl::OUString::createFromAscii(singletons[i])),
 css::uno::UNO_QUERY_THROW);
 }
 css::util::theMacroExpander::get(context_);


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

2022-10-19 Thread Hossein (via logerrit)
 sw/qa/uitest/chart/tdf149718.py |   40 
 sw/source/core/unocore/unochart.cxx |8 ++-
 vcl/source/window/event.cxx |   22 +++
 3 files changed, 60 insertions(+), 10 deletions(-)

New commits:
commit a71e40d37f177b2d4461db158282ae1c620e774e
Author: Hossein 
AuthorDate: Mon Oct 10 15:48:02 2022 +0200
Commit: Xisco Fauli 
CommitDate: Wed Oct 19 08:33:08 2022 +0200

tdf#149718 Fix crash on insert chart for tables with merged cells

Previously inserting charts for tables with merged cells lead to crash.
This was because a wrong assumption in unochart.cxx, specifically
SwChartDataProvider::Impl_createDataSource() that every row has the same
number of columns. Therefore the code was using the number of columns in
the first row as the number of columns for all the rows, which is wrong.

For example, inserting a chart for the second column of this table leads
to a crash:

[  ]
[1 ][ 2]

In this way, an assertion failure was created because the number of
columns where counted from the first row, which has merged cells, and
therefore fewer number of columns compared to the last column of the
selected part.

To solve tdf#149718, now we use the maximum number of columns calculated
across all the rows. In this way, the remainder of the function does not
need a fix, although a cleanup for the whole function can be interesting
and help avoid using tiny extra memory space.

A UITest is provided to avoid this bug in the future. To run the test:

cd sw && make -srj1 UITest_sw_chart \

UITEST_TEST_NAME="tdf149718.tdf149718.test_chart_from_table_with_merged_cells" \
SAL_USE_VCLPLUGIN=gen

Change-Id: I3c1000d7f177417e98d3a8ceae7886824c1053a6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140092
Tested-by: Jenkins
Reviewed-by: Hossein 
(cherry picked from commit d1707bc31261d16893c1f5240c803d283e293ec1)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141192
Reviewed-by: Xisco Fauli 

diff --git a/sw/qa/uitest/chart/tdf149718.py b/sw/qa/uitest/chart/tdf149718.py
new file mode 100644
index ..873379a36909
--- /dev/null
+++ b/sw/qa/uitest/chart/tdf149718.py
@@ -0,0 +1,40 @@
+# -*- 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 libreoffice.uno.propertyvalue import mkPropertyValues
+from uitest.uihelper.common import get_state_as_dict
+from uitest.uihelper.common import select_pos
+
+class tdf149718( UITestCase ):
+
+def test_chart_from_table_with_merged_cells( self ):
+with self.ui_test.create_doc_in_start_center("writer") as document:
+xWriterDoc = self.xUITest.getTopFocusWindow()
+xWriterEdit = xWriterDoc.getChild("writer_edit")
+with 
self.ui_test.execute_dialog_through_command(".uno:InsertTable") as xDialog:
+formatlbinstable = xDialog.getChild("formatlbinstable")
+entry = formatlbinstable.getChild("1")
+entry.executeAction("SELECT", tuple())
+xWriterEdit.executeAction("TYPE", 
mkPropertyValues({"KEYCODE":"RETURN"}))
+
+self.xUITest.executeCommand(".uno:GoDown")
+self.xUITest.executeCommand(".uno:CharRightSel")
+self.xUITest.executeCommand(".uno:MergeCells")
+
+self.xUITest.executeCommand(".uno:GoDown")
+xWriterEdit.executeAction("TYPE", mkPropertyValues({"TEXT": "1"}))
+self.xUITest.executeCommand(".uno:GoLeft")
+self.xUITest.executeCommand(".uno:GoLeft")
+xWriterEdit.executeAction("TYPE", mkPropertyValues({"TEXT": "1"}))
+self.xUITest.executeCommand(".uno:CharRightSel")
+with 
self.ui_test.execute_dialog_through_command(".uno:InsertObjectChart", 
close_button="finish") as xDialog:
+ xWizard = xDialog.getChild('Wizard')
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/source/core/unocore/unochart.cxx 
b/sw/source/core/unocore/unochart.cxx
index edaa628c68f4..e1b8e14e33f5 100644
--- a/sw/source/core/unocore/unochart.cxx
+++ b/sw/source/core/unocore/unochart.cxx
@@ -644,7 +644,13 @@ uno::Reference< chart2::data::XDataSource > 
SwChartDataProvider::Impl_createData
 // get a character map in the size of the table to mark
 // all the ranges to use in
 sal_Int32 nRows = pTable->GetTabLines().size();
-sal_Int32 nCols = pTable->GetTabLines().front()->GetTabBoxes().size();
+sal_Int32 nCols = 0;
+// As per tdf#149718 one should know that 

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

2022-10-10 Thread Hossein (via logerrit)
 sw/qa/uitest/chart/tdf149718.py |   40 
 sw/source/core/unocore/unochart.cxx |8 ++-
 2 files changed, 47 insertions(+), 1 deletion(-)

New commits:
commit d1707bc31261d16893c1f5240c803d283e293ec1
Author: Hossein 
AuthorDate: Mon Oct 10 15:48:02 2022 +0200
Commit: Hossein 
CommitDate: Mon Oct 10 18:27:03 2022 +0200

tdf#149718 Fix crash on insert chart for tables with merged cells

Previously inserting charts for tables with merged cells lead to crash.
This was because a wrong assumption in unochart.cxx, specifically
SwChartDataProvider::Impl_createDataSource() that every row has the same
number of columns. Therefore the code was using the number of columns in
the first row as the number of columns for all the rows, which is wrong.

For example, inserting a chart for the second column of this table leads
to a crash:

[  ]
[1 ][ 2]

In this way, an assertion failure was created because the number of
columns where counted from the first row, which has merged cells, and
therefore fewer number of columns compared to the last column of the
selected part.

To solve tdf#149718, now we use the maximum number of columns calculated
across all the rows. In this way, the remainder of the function does not
need a fix, although a cleanup for the whole function can be interesting
and help avoid using tiny extra memory space.

A UITest is provided to avoid this bug in the future. To run the test:

cd sw && make -srj1 UITest_sw_chart \

UITEST_TEST_NAME="tdf149718.tdf149718.test_chart_from_table_with_merged_cells" \
SAL_USE_VCLPLUGIN=gen

Change-Id: I3c1000d7f177417e98d3a8ceae7886824c1053a6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140092
Tested-by: Jenkins
Reviewed-by: Hossein 

diff --git a/sw/qa/uitest/chart/tdf149718.py b/sw/qa/uitest/chart/tdf149718.py
new file mode 100644
index ..873379a36909
--- /dev/null
+++ b/sw/qa/uitest/chart/tdf149718.py
@@ -0,0 +1,40 @@
+# -*- 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 libreoffice.uno.propertyvalue import mkPropertyValues
+from uitest.uihelper.common import get_state_as_dict
+from uitest.uihelper.common import select_pos
+
+class tdf149718( UITestCase ):
+
+def test_chart_from_table_with_merged_cells( self ):
+with self.ui_test.create_doc_in_start_center("writer") as document:
+xWriterDoc = self.xUITest.getTopFocusWindow()
+xWriterEdit = xWriterDoc.getChild("writer_edit")
+with 
self.ui_test.execute_dialog_through_command(".uno:InsertTable") as xDialog:
+formatlbinstable = xDialog.getChild("formatlbinstable")
+entry = formatlbinstable.getChild("1")
+entry.executeAction("SELECT", tuple())
+xWriterEdit.executeAction("TYPE", 
mkPropertyValues({"KEYCODE":"RETURN"}))
+
+self.xUITest.executeCommand(".uno:GoDown")
+self.xUITest.executeCommand(".uno:CharRightSel")
+self.xUITest.executeCommand(".uno:MergeCells")
+
+self.xUITest.executeCommand(".uno:GoDown")
+xWriterEdit.executeAction("TYPE", mkPropertyValues({"TEXT": "1"}))
+self.xUITest.executeCommand(".uno:GoLeft")
+self.xUITest.executeCommand(".uno:GoLeft")
+xWriterEdit.executeAction("TYPE", mkPropertyValues({"TEXT": "1"}))
+self.xUITest.executeCommand(".uno:CharRightSel")
+with 
self.ui_test.execute_dialog_through_command(".uno:InsertObjectChart", 
close_button="finish") as xDialog:
+ xWizard = xDialog.getChild('Wizard')
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/source/core/unocore/unochart.cxx 
b/sw/source/core/unocore/unochart.cxx
index dfbe2a78c44a..ec750133684e 100644
--- a/sw/source/core/unocore/unochart.cxx
+++ b/sw/source/core/unocore/unochart.cxx
@@ -644,7 +644,13 @@ uno::Reference< chart2::data::XDataSource > 
SwChartDataProvider::Impl_createData
 // get a character map in the size of the table to mark
 // all the ranges to use in
 sal_Int32 nRows = pTable->GetTabLines().size();
-sal_Int32 nCols = pTable->GetTabLines().front()->GetTabBoxes().size();
+sal_Int32 nCols = 0;
+// As per tdf#149718 one should know that some cells can be merged 
together.
+// Therefore, the number of columns (boxes in each row) are not necessarily
+// equal. Here, we calculate the maximum number of columns in all rows.
+for (sal_Int32 i = 0; i < nRows; ++i)
+ 

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

2022-09-25 Thread Hossein (via logerrit)
 uitest/packaging/README.md |3 +--
 uitest/packaging/setup.py  |3 ++-
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit d3050ff4a1355f7ebd3d4e7ddc8fb64f2b8894dd
Author: Hossein 
AuthorDate: Fri Aug 19 15:29:35 2022 +0200
Commit: Adolfo Jayme Barrientos 
CommitDate: Mon Sep 26 00:26:05 2022 +0200

Use Markdown instead of reStructuredText

Use Markdown markup instead of reStructuredText for
uitest/packaging/README.rst

Change from reStructuredText to Markdown in setup.py is done according
to this guide:

Making a PyPI-friendly README
https://packaging.python.org/en/latest/guides/making-a-pypi-friendly-readme/

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

diff --git a/uitest/packaging/README.rst b/uitest/packaging/README.md
similarity index 76%
rename from uitest/packaging/README.rst
rename to uitest/packaging/README.md
index 45d8716f6586..41dacf520414 100644
--- a/uitest/packaging/README.rst
+++ b/uitest/packaging/README.md
@@ -1,4 +1,3 @@
-Connection code for LibreOffice's pyUNO
-===
+# Connection code for LibreOffice's pyUNO
 
 This code allows out-of-process communication with a LibreOffice instance. The 
instance can either be started by the script or a connection to a running 
LibreOffice instance. The code contains several safety checks for hanging and 
crashed LibreOffice instances.
diff --git a/uitest/packaging/setup.py b/uitest/packaging/setup.py
index 9aa32054ccc2..dcaa24512b09 100644
--- a/uitest/packaging/setup.py
+++ b/uitest/packaging/setup.py
@@ -5,7 +5,7 @@ from os import path
 here = path.abspath(path.dirname(__file__))
 
 # Get the long description from the README file
-with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
+with open(path.join(here, 'README.md'), encoding='utf-8') as f:
 long_description = f.read()
 
 setup(
@@ -13,6 +13,7 @@ setup(
 version="0.0.1",
 description="Connection code for LibreOffice's pyUNO",
 long_description=long_description,
+long_description_content_type='text/markdown',
 url="http://www.libreoffice.org;,
 author="The LibreOffice developers",
 author_email="libreoffice@lists.freedesktop.org",


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

2022-08-26 Thread Hossein (via logerrit)
 sw/qa/uitest/writer_tests2/deleteFootnotes.py |   46 ++
 sw/source/core/crsr/swcrsr.cxx|6 ++-
 2 files changed, 51 insertions(+), 1 deletion(-)

New commits:
commit d05c176cc022f1b771f7c064f6ce74e9f8c27a1b
Author: Hossein 
AuthorDate: Wed Aug 24 23:03:09 2022 +0200
Commit: Hossein 
CommitDate: Sat Aug 27 00:53:55 2022 +0200

tdf#150457 Fix crash on hovering removed footnote reference

The regression was caused by 402f36efb215338ad545caa65d39fb8a39685ea1.
Before that, 0aa0fda64057647219954480ac1bab86b0f0e433 changed the cursor
jumping behavior to fix tdf#81226. The goal was to make LibreOffice
behave as described in the description of the issue:

"When your cursor is on the last line but not at the end of it, simply
press the down arrow to go at the end of the file (end of that line)."

The same behavior was achieved for pressing down on the last line.

The above patches allowed removing the footnotes and their numbers
(except the first number) while the reference were still present. Then,
on hovering a removed footnote reference, a crash was happening. It
should be noted that even with this patch, removing the first reference
number was not possible.

This fix limits this behavior to anywhere other than inside a footnote.
In this way, it prevents crashing.

With this fix, the behavior of the cursor goes back to what it was
before 0aa0fda64057647219954480ac1bab86b0f0e433. The user will not be
able to select all the footnotes at once. Also, removing footnote number
will not be possible.

It is worth noting that not being able to select all the footnotes at
once prevents the user from changing the characteristics of the
footnotes all at the same time. Also, not being able to remove the
footnote numbers, prevents the user from having footnotes with custom
numbers written manually. Both of these actions are possible in MS Word.
The other difference is that by going up, one can go out of the footnote
section in MS Word, but this is not the case for LibreOffice.

A UI test is added to make sure the crash will not happen again. The
test can be run by:

 cd sw && make -srj1 UITest_writer_tests2 \
  UITEST_TEST_NAME="deleteFootnotes.tdf150457.test_delete_footnotes" \
  SAL_USE_VCLPLUGIN=gen

Change-Id: I1ce7d2189355f6763b6f31219e00516ff7a8164e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138562
Tested-by: Jenkins
Reviewed-by: Hossein 

diff --git a/sw/qa/uitest/writer_tests2/deleteFootnotes.py 
b/sw/qa/uitest/writer_tests2/deleteFootnotes.py
new file mode 100644
index ..162cc7d3e1b2
--- /dev/null
+++ b/sw/qa/uitest/writer_tests2/deleteFootnotes.py
@@ -0,0 +1,46 @@
+# -*- 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 type_text
+from libreoffice.uno.propertyvalue import mkPropertyValues
+import time
+
+
+class tdf150457(UITestCase):
+
+   def test_delete_footnotes(self):
+with self.ui_test.create_doc_in_start_center("writer") as document:
+xWriterDoc = self.xUITest.getTopFocusWindow()
+xWriterEdit = xWriterDoc.getChild("writer_edit")
+
+type_text(xWriterEdit, "a")
+self.xUITest.executeCommand(".uno:InsertFootnote")
+type_text(xWriterEdit, "abc")
+self.assertEqual(document.Footnotes[0].String, "abc")
+self.assertEqual(document.Footnotes.getCount(), 1)
+
+xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": 
"PAGEUP"}))
+xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": 
"RETURN"}))
+type_text(xWriterEdit, "d")
+
+self.xUITest.executeCommand(".uno:InsertFootnote")
+type_text(xWriterEdit, "def")
+self.assertEqual(document.Footnotes[1].String, "def")
+self.assertEqual(document.Footnotes.getCount(), 2)
+
+xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": 
"UP"}))
+xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": 
"HOME"}))
+xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": 
"SHIFT+DOWN"}))
+xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": 
"DELETE"}))
+xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": 
"PAGEUP"}))
+xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": 
"CTRL+A"}))
+xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": 
"DELETE"}))
+
+# vim: set 

[Libreoffice-commits] core.git: bin/run

2022-08-20 Thread Hossein (via logerrit)
 bin/run |9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 482264a7c2058d50906c83219566d79c1cf3cbb9
Author: Hossein 
AuthorDate: Fri Aug 19 16:55:39 2022 +0200
Commit: Hossein 
CommitDate: Sat Aug 20 12:12:19 2022 +0200

Remove extra output from "bin/run -l" on Windows

The previous output contained extra file names other than executables,
but now we limit the output to *.bat and *.exe files.

Change-Id: Ie785d1e4388780b290f6580d02af635279080412
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138556
Tested-by: Jenkins
Reviewed-by: Hossein 

diff --git a/bin/run b/bin/run
index 660dfbe273a6..695905e09e6b 100755
--- a/bin/run
+++ b/bin/run
@@ -26,7 +26,14 @@ print_usage()
 list_executables()
 {
 echo "Listing executables inside workdir/LinkTarget/Executable folder:"
-find workdir/LinkTarget/Executable -executable -printf "%P\n" | grep -v 
batch | awk -F. {'print $1'} | sort -u
+if uname | grep -i CYGWIN >/dev/null
+then
+echo
+find workdir/LinkTarget/Executable -iname "*.bat" -printf "%P\n"
+find workdir/LinkTarget/Executable -iname "*.exe" -printf "%P\n"
+else
+find workdir/LinkTarget/Executable -executable -printf "%P\n"
+fi
 }
 
 print_executable_name()


[Libreoffice-commits] core.git: bin/README.md bin/run

2022-08-19 Thread Hossein (via logerrit)
 bin/README.md |   19 ++-
 bin/run   |6 +++---
 2 files changed, 21 insertions(+), 4 deletions(-)

New commits:
commit a6c50882fd3fd90a7eaca81b311640e86eced9fa
Author: Hossein 
AuthorDate: Fri Aug 19 11:14:32 2022 +0200
Commit: Hossein 
CommitDate: Fri Aug 19 12:21:16 2022 +0200

Fix "bin/run -l" to work correctly on Windows

On Windows, the script did not run correctly because of the "return"s.
Here, we use "exit" instead.

Also, there were many files with the same name but with different
extensions in the output. Now, we only print out the names using grep,
awk and sort utilities.

In addition, a description for bin/run is added to bin/README.md

Change-Id: Ifb106c89199ebc5a9debf6caef80bd1edf143b20
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138514
Tested-by: Jenkins
Reviewed-by: Hossein 

diff --git a/bin/README.md b/bin/README.md
index b81d1f4d1cf3..88a9b73a49d1 100644
--- a/bin/README.md
+++ b/bin/README.md
@@ -3,9 +3,26 @@
 Tools and scripts mostly not used during the build
 
 This direction has a number of key pieces (?) that are used during the
-build, or are simply generally useful. One example is
+build, or are simply generally useful. One example is `bin/run`.
+
+This utility can be used to run the executables in this folder:
+
+workdir/LinkTarget/Executable
+
+Format of the usage is:
+
+./bin/run application [parameters]|--list|--help
+
+Use --list (same as -list or -l) to get the list of executables
+Use --help (same as -help or -h) to get this help
+
+Another example is:
 
 bin/find-german-comments 
 
 which will try to detect and extract all the German comments in a
 given source code hierarchy `/` directory.
+
+Please note that the associated issue 
[tdf#39468](https://bugs.documentfoundation.org/show_bug.cgi?id=39468) is now 
marked as
+RESOLVED/FIXED, so don't expect many German comments.
+
diff --git a/bin/run b/bin/run
index 5405bd34cd2a..660dfbe273a6 100755
--- a/bin/run
+++ b/bin/run
@@ -26,7 +26,7 @@ print_usage()
 list_executables()
 {
 echo "Listing executables inside workdir/LinkTarget/Executable folder:"
-find workdir/LinkTarget/Executable -executable -printf "%P\n"
+find workdir/LinkTarget/Executable -executable -printf "%P\n" | grep -v 
batch | awk -F. {'print $1'} | sort -u
 }
 
 print_executable_name()
@@ -52,9 +52,9 @@ setdefaults()
 
 case "$1" in
 ""|"-h"|"-help"|"--help")
-print_usage; return 1;;
+print_usage; exit 1;;
 "-l"|"-list"|"--list")
-list_executables; return 0;;
+list_executables; exit 0;;
 *) print_executable_name $1;;
 esac
 


[Libreoffice-commits] core.git: vcl/README.scheduler.md

2022-07-30 Thread Hossein (via logerrit)
 vcl/README.scheduler.md |   23 ++-
 1 file changed, 18 insertions(+), 5 deletions(-)

New commits:
commit 67615c8461eccc031c1934863a94df6bf8269641
Author: Hossein 
AuthorDate: Sat Jul 30 20:30:19 2022 +0200
Commit: Hossein 
CommitDate: Sat Jul 30 20:34:50 2022 +0200

Improve vcl scheduler documentation

* Fixed a heading problem
* Marked variables, functions and identifiers as fixed width
* Added several related links

Change-Id: If5e56c1e2a474fcfa52601ccda7911bf9e80c913
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137636
Tested-by: Hossein 
Reviewed-by: Hossein 

diff --git a/vcl/README.scheduler.md b/vcl/README.scheduler.md
index bfaf53e017d0..b213448762a7 100644
--- a/vcl/README.scheduler.md
+++ b/vcl/README.scheduler.md
@@ -9,10 +9,15 @@ using round-robin for reoccurring tasks.
 The scheduler has the following behaviour:
 
 B.1. Tasks are scheduled just priority based
+
 B.2. Implicitly cooperative AKA non-preemptive
+
 B.3. It's not "fair" in any way (a consequence of B.2)
+
 B.4. Tasks are handled round-robin (per priority)
+
 B.5. Higher priorities have lower values
+
 B.6. A small set of priorities instead of an flexible value AKA int
 
 There are some consequences due to this design.
@@ -224,8 +229,7 @@ other long running tasks, so interactivity can be improved.
 
 There were some questions coming up when implementing it:
 
- Why does the scheduler not detect that we only have idle tasks pending,
-and skip the instant timeout?
+ Why does the scheduler not detect that we only have idle tasks pending, 
and skip the instant timeout?
 
 You never know how long a task will run. Currently the scheduler simply asks
 each task when it'll be ready to run, until two runnable tasks are found.
@@ -274,12 +278,12 @@ the `DBG_TESTSOLARMUTEX` calls are disabled, as we can't 
release the
 Those wakeup events must be ignored to prevent busy-locks. For more info read
 the "General: main thread deferral" section.
 
-We can neither rely on macOS dispatch_sync code block execution nor the
+We can neither rely on macOS `dispatch_sync` code block execution nor the
 message handling, as both can't be prioritized or filtered and the first
 does also not allow nested execution and is just processed in sequence.
 
 There is also a workaround for a problem for pushing tasks to an empty queue,
-as [NSApp postEvent: ... atStart: NO] doesn't append the event, if the
+as `[NSApp postEvent: ... atStart: NO]` doesn't append the event, if the
 message queue is empty.
 
 An additional problem is the filtering of events on Window close. This drops
@@ -415,7 +419,7 @@ do {
 while ( bHasPending )
 ```
 
-The idea is to use g_main_context_prepare and keep the `max_priority` as an
+The idea is to use `g_main_context_prepare` and keep the `max_priority` as an
 indicator. We cannot prevent running newer lower events, but we can prevent
 running new higher events, which should be sufficient for most stuff.
 
@@ -433,3 +437,12 @@ will also affect the Gtk+ and KDE backend for the user 
event handling.
 
 This way it can be easier used to profile Tasks, eventually to improve LO's
 interactivity.
+
+## See Also
+
+- [Solar Mutex](https://wiki.openoffice.org/wiki/Terms/Solar_Mutex)
+- [LibreOffice Main 
Loop](https://wiki.documentfoundation.org/Development/LHM_LiMux/Main_Loop)
+- [AOO Advanced Threading-Architecture 
(proposal)](https://wiki.openoffice.org/wiki/Architecture/Proposal/Advanced_Threading-Architecture)
+- [Revise OOo Multi-Threading 
Efforts](https://wiki.openoffice.org/wiki/Effort/Revise_OOo_Multi-Threading)
+- [Multi-Threading 
Analysis](https://wiki.openoffice.org/wiki/Analysis/Multi-Threading)
+- [AOO Wiki - 
Category:Multi-Threading](https://wiki.openoffice.org/wiki/Category:Multi-Threading)


[Libreoffice-commits] core.git: bin/run

2022-07-29 Thread Hossein (via logerrit)
 bin/run |   33 +
 1 file changed, 33 insertions(+)

New commits:
commit c2746a665656b61927bbf551b4723ccfae8fa9c8
Author: Hossein 
AuthorDate: Fri Jul 29 23:59:20 2022 +0200
Commit: Hossein 
CommitDate: Sat Jul 30 06:35:50 2022 +0200

Add help and list executables options for bin/run script

bin/run script is described as:

"simple wrapper script to run non-installed executables from workdir".

When the bin/run script was used without parameters, it was generating
error as it could not run the folder workdir/LinkTarget/Executable.
Now, we print usage instructions in this case, or when help is
requested with -h, -help or --help.

Also, now user can get the list of executables with -l, -list or --list.

In normal execution, the script's name is also printed. For example:

$ ./bin/run minvcl
Setting env variables and running workdir/LinkTarget/Executable/minvcl
...

Change-Id: I5c62c300d5247f55d1d1cfd095cecffc979d494b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137626
Tested-by: Hossein 
Reviewed-by: Hossein 

diff --git a/bin/run b/bin/run
index 523da3c0e178..5405bd34cd2a 100755
--- a/bin/run
+++ b/bin/run
@@ -9,6 +9,31 @@
 
 # simple wrapper script to run non-installed executables from workdir
 
+print_usage()
+{
+echo "This utility can be used to run the executables in this folder:"
+echo
+echo "  workdir/LinkTarget/Executable"
+echo
+echo "Usage:"
+echo
+echo "  ./bin/run application [parameters]|--list|--help"
+echo
+echo "Use --list (same as -list or -l) to get the list of executables"
+echo "Use --help (same as -help or -h) to get this help"
+}
+
+list_executables()
+{
+echo "Listing executables inside workdir/LinkTarget/Executable folder:"
+find workdir/LinkTarget/Executable -executable -printf "%P\n"
+}
+
+print_executable_name()
+{
+echo "Setting env variables and running workdir/LinkTarget/Executable/$1"
+}
+
 setdefaults()
 {
 dir=$(realpath "$(pwd)")
@@ -25,6 +50,14 @@ setdefaults()
 export URE_BOOTSTRAP=file://"${dir}"/instdir/program/fundamentalrc
 }
 
+case "$1" in
+""|"-h"|"-help"|"--help")
+print_usage; return 1;;
+"-l"|"-list"|"--list")
+list_executables; return 0;;
+*) print_executable_name $1;;
+esac
+
 if uname | grep -i CYGWIN >/dev/null; then
 
 setdefaults


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

2022-07-25 Thread Hossein (via logerrit)
 include/svtools/tabbar.hxx|1 +
 sc/source/ui/view/tabview5.cxx|1 +
 svtools/source/control/tabbar.cxx |5 +
 3 files changed, 7 insertions(+)

New commits:
commit fd948aed2230e50cce9c4aa7f1eb30e7cc8c4f8f
Author: Hossein 
AuthorDate: Fri Jul 22 16:44:29 2022 +0200
Commit: Adolfo Jayme Barrientos 
CommitDate: Mon Jul 25 10:35:14 2022 +0200

tdf#147868 Disable add sheet when structure is protected

Using "Tools > Protect Spreadsheet Structure...", it is possible to
protect the structure of a spreadsheet document. Without this patch in
place, the [+] (add new sheet) button is clickable but it does not work.
This is confusing for the user, so it was decided that the button should
be disabled when the structure is protected.

This patch disables the [+] button just after the structure is protected
using the above toggle menu option. The menu option becomes checked, and
the [+] button gets disabled immediately. After choosing the same toggle
menu option again, the check mark goes away, and the [+] button becomes
enabled immediately.

In this patch, GetDocument().IsDocEditable() is used to check if the
document structure is protected. The argument for this choice is that
the same function is used when renaming a sheet with
ScDocFunc::RenameTable().

Change-Id: If812d94841d3efd98d7ef898cc1f4b2f1387130b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137365
Tested-by: Jenkins
Reviewed-by: Hossein 
(cherry picked from commit e2b7f59c745a79542b15937bc824c7afe9969cde)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137333
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/include/svtools/tabbar.hxx b/include/svtools/tabbar.hxx
index 8735e0728599..948e60b3596b 100644
--- a/include/svtools/tabbar.hxx
+++ b/include/svtools/tabbar.hxx
@@ -496,6 +496,7 @@ public:
 voidSetSelectHdl( const Link& rLink ) { 
maSelectHdl = rLink; }
 voidSetSplitHdl( const Link& rLink ) { 
maSplitHdl = rLink; }
 voidSetScrollAreaContextHdl( const Link& rLink ) { maScrollAreaContextHdl = rLink; }
+voidSetAddButtonEnabled(bool bAddButtonEnabled);
 
 // accessibility
 virtual css::uno::Reference 
CreateAccessible() override;
diff --git a/sc/source/ui/view/tabview5.cxx b/sc/source/ui/view/tabview5.cxx
index d83d4206198d..6db05da9c94e 100644
--- a/sc/source/ui/view/tabview5.cxx
+++ b/sc/source/ui/view/tabview5.cxx
@@ -383,6 +383,7 @@ void ScTabView::UpdateLayerLocks()
 pDrawView->SetLayerLocked( pLayer->GetName(), bProt || bShared );
 pDrawView->SetLayerVisible( pLayer->GetName(), false);
 }
+pTabControl->SetAddButtonEnabled(aViewData.GetDocument().IsDocEditable());
 }
 
 void ScTabView::DrawDeselectAll()
diff --git a/svtools/source/control/tabbar.cxx 
b/svtools/source/control/tabbar.cxx
index a62d0ae6fad9..dd49bda0df4f 100644
--- a/svtools/source/control/tabbar.cxx
+++ b/svtools/source/control/tabbar.cxx
@@ -2494,6 +2494,11 @@ tools::Rectangle TabBar::GetPageArea() const
  Size(mnLastOffX - mnOffX + 1, GetSizePixel().Height() - 
mnOffY));
 }
 
+void TabBar::SetAddButtonEnabled(bool bAddButtonEnabled)
+{
+mpImpl->mxButtonBox->m_xAddButton->set_sensitive(bAddButtonEnabled);
+}
+
 css::uno::Reference TabBar::CreateAccessible()
 {
 return 
mpImpl->maAccessibleFactory.getFactory().createAccessibleTabBar(*this);


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

2022-07-24 Thread Hossein (via logerrit)
 include/svtools/tabbar.hxx|1 +
 sc/source/ui/view/tabview5.cxx|1 +
 svtools/source/control/tabbar.cxx |5 +
 3 files changed, 7 insertions(+)

New commits:
commit e2b7f59c745a79542b15937bc824c7afe9969cde
Author: Hossein 
AuthorDate: Fri Jul 22 16:44:29 2022 +0200
Commit: Hossein 
CommitDate: Sun Jul 24 15:53:39 2022 +0200

tdf#147868 Disable add sheet when structure is protected

Using "Tools > Protect Spreadsheet Structure...", it is possible to
protect the structure of a spreadsheet document. Without this patch in
place, the [+] (add new sheet) button is clickable but it does not work.
This is confusing for the user, so it was decided that the button should
be disabled when the structure is protected.

This patch disables the [+] button just after the structure is protected
using the above toggle menu option. The menu option becomes checked, and
the [+] button gets disabled immediately. After choosing the same toggle
menu option again, the check mark goes away, and the [+] button becomes
enabled immediately.

In this patch, GetDocument().IsDocEditable() is used to check if the
document structure is protected. The argument for this choice is that
the same function is used when renaming a sheet with
ScDocFunc::RenameTable().

Change-Id: If812d94841d3efd98d7ef898cc1f4b2f1387130b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137365
Tested-by: Jenkins
Reviewed-by: Hossein 

diff --git a/include/svtools/tabbar.hxx b/include/svtools/tabbar.hxx
index 8735e0728599..948e60b3596b 100644
--- a/include/svtools/tabbar.hxx
+++ b/include/svtools/tabbar.hxx
@@ -496,6 +496,7 @@ public:
 voidSetSelectHdl( const Link& rLink ) { 
maSelectHdl = rLink; }
 voidSetSplitHdl( const Link& rLink ) { 
maSplitHdl = rLink; }
 voidSetScrollAreaContextHdl( const Link& rLink ) { maScrollAreaContextHdl = rLink; }
+voidSetAddButtonEnabled(bool bAddButtonEnabled);
 
 // accessibility
 virtual css::uno::Reference 
CreateAccessible() override;
diff --git a/sc/source/ui/view/tabview5.cxx b/sc/source/ui/view/tabview5.cxx
index d83d4206198d..6db05da9c94e 100644
--- a/sc/source/ui/view/tabview5.cxx
+++ b/sc/source/ui/view/tabview5.cxx
@@ -383,6 +383,7 @@ void ScTabView::UpdateLayerLocks()
 pDrawView->SetLayerLocked( pLayer->GetName(), bProt || bShared );
 pDrawView->SetLayerVisible( pLayer->GetName(), false);
 }
+pTabControl->SetAddButtonEnabled(aViewData.GetDocument().IsDocEditable());
 }
 
 void ScTabView::DrawDeselectAll()
diff --git a/svtools/source/control/tabbar.cxx 
b/svtools/source/control/tabbar.cxx
index 5e5aba4af172..a1a074c4470a 100644
--- a/svtools/source/control/tabbar.cxx
+++ b/svtools/source/control/tabbar.cxx
@@ -2494,6 +2494,11 @@ tools::Rectangle TabBar::GetPageArea() const
  Size(mnLastOffX - mnOffX + 1, GetSizePixel().Height() - 
mnOffY));
 }
 
+void TabBar::SetAddButtonEnabled(bool bAddButtonEnabled)
+{
+mpImpl->mxButtonBox->m_xAddButton->set_sensitive(bAddButtonEnabled);
+}
+
 css::uno::Reference TabBar::CreateAccessible()
 {
 return 
mpImpl->maAccessibleFactory.getFactory().createAccessibleTabBar(*this);


[Libreoffice-commits] core.git: README.md

2022-06-10 Thread Hossein (via logerrit)
 README.md |   10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

New commits:
commit d0e50ba13b545ab00dfb02a445eeb93011ff4af8
Author: Hossein 
AuthorDate: Thu Jun 9 15:48:11 2022 +0200
Commit: Adolfo Jayme Barrientos 
CommitDate: Fri Jun 10 08:21:57 2022 +0200

Add information on Java baseline in README.md

As discussed in the ESC, although LibreOffice can be built with the
Java Development Kit (JDK) version 9, the JDK 9 is no longer
supported by the JVM vendors including Oracle, Red Hat and others.
Thus, it is asserted here that JDK 11 or later should be used to build
LibreOffice.

For further information on the supported versions of JDK, and its
lifcycle, see these articles:

Oracle Java SE Support Roadmap (Updated March 22, 2022)
https://www.oracle.com/java/technologies/java-se-support-roadmap.html

OpenJDK Life Cycle and Support Policy (Updated November 22 2021)
https://access.redhat.com/articles/1299013

It should be noted that JDK 8 is still supported, but it is not usable
for building LibreOffice.

It is also documented that without Java one may lose many features that
are described in the TDF wiki article Development/Java:
https://wiki.documentfoundation.org/Development/Java

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

diff --git a/README.md b/README.md
index dcc33988f293..d2effbb58576 100644
--- a/README.md
+++ b/README.md
@@ -53,6 +53,14 @@ run and compile LibreOffice, also used by the TDF builds:
 * Build: Qt 5.15 with Qt supported Emscripten 1.39.8
 * See [README.wasm](static/README.wasm.md)
 
+Java is required for building many parts of LibreOffice. In TDF Wiki article
+[Development/Java](https://wiki.documentfoundation.org/Development/Java), the
+exact modules that depend on Java are listed.
+
+The baseline for Java is Java Development Kit (JDK) Version 11 or later. It is
+possible to build LibreOffice with JDK version 9, but it is no longer supported
+by the JDK vendors, thus it should be avoided.
+
 If you want to use Clang with the LibreOffice compiler plugins, the minimal
 version of Clang is 12.0.1. Since Xcode doesn't provide the compiler plugin
 headers, you have to compile your own Clang to use them on macOS.
@@ -64,7 +72,7 @@ the LibreOffice Development Environment
 ([LODE](https://wiki.documentfoundation.org/Development/lode)) scripts.
 
 For more information see the build instructions for your platform in the
-[TDF wiki](https://wiki.documentfoundation.org/Development).
+[TDF wiki](https://wiki.documentfoundation.org/Development/How_to_build).
 
 ## The Important Bits of Code
 


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

2022-06-01 Thread Hossein (via logerrit)
 sw/qa/extras/uiwriter/data/simplefooter.docx |binary
 sw/qa/extras/uiwriter/uiwriter.cxx   |   22 ++
 sw/source/filter/ww8/wrtw8sty.cxx|8 
 3 files changed, 30 insertions(+)

New commits:
commit 18c2a7d4cf10564b3f9c48ec190c1c3be8122f6a
Author: Hossein 
AuthorDate: Fri May 20 15:20:40 2022 +0200
Commit: Miklos Vajna 
CommitDate: Wed Jun 1 11:25:16 2022 +0200

tdf#149184 DOCX: fix crash removing footer, then saving to doc

When openeing the simplefooter.docx, after removing the footer and
exporting to .doc, LibreOffice crashes. This regression was
introduced with 88e6a1bfeac86e0c89d2ff08c908c2b5ae061177 which is
titled: "DOCX: export hidden (shared) headers/footers".

The current patch fixes this problem by checking to see if the header
or footer text is there or not.

A unit test is added to avoid this problem in the future. One can run
the test with:

make CPPUNIT_TEST_NAME="testTdf149184" -sr CppunitTest_sw_uiwriter7

Change-Id: I5586561677b3c490e49b4b10bd987aecdf3fc134
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134684
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134829
(cherry picked from commit 7b09579295579045c4ad76578df09356f3d5b8d0)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134787
Reviewed-by: Michael Stahl 
Tested-by: Miklos Vajna 

diff --git a/sw/qa/extras/uiwriter/data/simplefooter.docx 
b/sw/qa/extras/uiwriter/data/simplefooter.docx
new file mode 100644
index ..006c85ab7cc8
Binary files /dev/null and b/sw/qa/extras/uiwriter/data/simplefooter.docx differ
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx 
b/sw/qa/extras/uiwriter/uiwriter.cxx
index b7593759971b..0aea38d4bbe7 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -50,6 +50,7 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -290,6 +291,7 @@ public:
 void testTdf92648();
 void testTdf103978_backgroundTextShape();
 void testTdf117225();
+void testTdf149184();
 
 CPPUNIT_TEST_SUITE(SwUiWriterTest);
 CPPUNIT_TEST(testReplaceForward);
@@ -411,6 +413,7 @@ public:
 CPPUNIT_TEST(testTdf92648);
 CPPUNIT_TEST(testTdf103978_backgroundTextShape);
 CPPUNIT_TEST(testTdf117225);
+CPPUNIT_TEST(testTdf149184);
 CPPUNIT_TEST_SUITE_END();
 
 private:
@@ -4691,6 +4694,25 @@ void SwUiWriterTest::testTdf117225()
 CPPUNIT_ASSERT_EQUAL(nExpected, nActual);
 }
 
+void SwUiWriterTest::testTdf149184()
+{
+SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "simplefooter.docx");
+SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+// Removing the footer for all styles
+pWrtShell->ChangeHeaderOrFooter(u"", false, false, false);
+// export to simplefooter.doc
+uno::Reference xStorable(mxComponent, uno::UNO_QUERY);
+uno::Sequence aStoreProps = 
comphelper::InitPropertySequence({
+{ "FilterName", uno::Any(OUString("MS Word 97")) },
+});
+utl::TempFile aTempFile;
+aTempFile.EnableKillingFile();
+// Without the fix in place, the test fails with:
+// [CUT] sw_uiwriter7
+// Segmentation fault (core dumped)
+// [_RUN_] testTdf149184::TestBody
+xStorable->storeToURL(aTempFile.GetURL(), aStoreProps);
+}
 
 CPPUNIT_TEST_SUITE_REGISTRATION(SwUiWriterTest);
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/filter/ww8/wrtw8sty.cxx 
b/sw/source/filter/ww8/wrtw8sty.cxx
index 9f103627d576..4126b9f88a50 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -2087,6 +2087,10 @@ void MSWordExportBase::WriteHeaderFooterText( const 
SwFormat& rFormat, bool bHea
 m_bHasHdr = true;
 const SwFormatHeader& rHd = rFormat.GetHeader();
 OSL_ENSURE( rHd.GetHeaderFormat(), "Header text is not here" );
+
+if ( !rHd.GetHeaderFormat() )
+return;
+
 pContent = ()->GetContent();
 }
 else
@@ -2094,6 +2098,10 @@ void MSWordExportBase::WriteHeaderFooterText( const 
SwFormat& rFormat, bool bHea
 m_bHasFtr = true;
 const SwFormatFooter& rFt = rFormat.GetFooter();
 OSL_ENSURE( rFt.GetFooterFormat(), "Footer text is not here" );
+
+if ( !rFt.GetFooterFormat() )
+return;
+
 pContent = ()->GetContent();
 }
 


[Libreoffice-commits] core.git: odk/CustomTarget_build-examples.mk odk/examples odk/Package_examples.mk

2022-05-25 Thread Hossein (via logerrit)
 odk/CustomTarget_build-examples.mk   |1 
 odk/Package_examples.mk  |2 
 odk/examples/DevelopersGuide/FirstSteps/cxx/Makefile |  100 +++
 3 files changed, 103 insertions(+)

New commits:
commit b6e0ae1b1bad5e222e21bbb4b2a158c1fc6f9779
Author: Hossein 
AuthorDate: Thu May 19 10:28:41 2022 +0200
Commit: Hossein 
CommitDate: Wed May 25 09:02:29 2022 +0200

Add Makefile for the FirstUnoContact C++ SDK example

Add Makefile for the DevelopersGuide/FirstUnoContact C++ SDK example.
The example now can be built using the same process for other C++
exmaples.

The DevelopersGuide examples will be categorized into several
directories, according to the language:

basic cxx java python

This requires that all examples ported to each of these languages.

Change-Id: I95c5c324fef4836b5e07bf34c98117e6b478
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134596
Tested-by: Jenkins
Reviewed-by: Hossein 

diff --git a/odk/CustomTarget_build-examples.mk 
b/odk/CustomTarget_build-examples.mk
index 38ed74bf9262..f536d8351b7b 100644
--- a/odk/CustomTarget_build-examples.mk
+++ b/odk/CustomTarget_build-examples.mk
@@ -10,6 +10,7 @@
 my_example_dirs = \
 CLI/CSharp/Spreadsheet \
 CLI/VB.NET/WriterDemo \
+DevelopersGuide/FirstSteps/cxx \
 DevelopersGuide/BasicAndDialogs/ToolkitControls \
 DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp \
 DevelopersGuide/Components/CppComponent \
diff --git a/odk/Package_examples.mk b/odk/Package_examples.mk
index f7bda16f9dd8..6749bcdcc798 100644
--- a/odk/Package_examples.mk
+++ b/odk/Package_examples.mk
@@ -19,6 +19,8 @@ $(eval $(call 
gb_Package_add_files_with_dir,odk_examples,$(SDKDIRNAME)/examples,
 CLI/CSharp/Spreadsheet/ViewSample.cs \
 CLI/VB.NET/WriterDemo/Makefile \
 CLI/VB.NET/WriterDemo/WriterDemo.vb \
+DevelopersGuide/FirstSteps/cxx/FirstUnoContact.cxx \
+DevelopersGuide/FirstSteps/cxx/Makefile \
 DevelopersGuide/BasicAndDialogs/CreatingDialogs/CreatingDialogs.odt \
 DevelopersGuide/BasicAndDialogs/CreatingDialogs/Makefile \
 DevelopersGuide/BasicAndDialogs/CreatingDialogs/SampleDialog.java \
diff --git a/odk/examples/DevelopersGuide/FirstSteps/FirstUnoContact.cpp 
b/odk/examples/DevelopersGuide/FirstSteps/cxx/FirstUnoContact.cxx
similarity index 100%
rename from odk/examples/DevelopersGuide/FirstSteps/FirstUnoContact.cpp
rename to odk/examples/DevelopersGuide/FirstSteps/cxx/FirstUnoContact.cxx
diff --git a/odk/examples/DevelopersGuide/FirstSteps/cxx/Makefile 
b/odk/examples/DevelopersGuide/FirstSteps/cxx/Makefile
new file mode 100644
index ..0ba2928e838b
--- /dev/null
+++ b/odk/examples/DevelopersGuide/FirstSteps/cxx/Makefile
@@ -0,0 +1,100 @@
+#*
+#
+#  The Contents of this file are made available subject to the terms of
+#  the BSD license.
+#  
+#  Copyright 2000, 2010 Oracle and/or its affiliates.
+#  All rights reserved.
+#
+#  Redistribution and use in source and binary forms, with or without
+#  modification, are permitted provided that the following conditions
+#  are met:
+#  1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#  2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#  3. Neither the name of Sun Microsystems, Inc. nor the names of its
+# contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+#  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+#  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+#  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+#  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+#  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+#  OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+#  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+#  TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+#  USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# 
+#**
+
+# Builds the FirstUnoContact example of the SDK.
+
+PRJ=../../../..
+SETTINGS=$(PRJ)/settings
+
+include $(SETTINGS)/settings.mk
+include $(SETTINGS)/std.mk
+
+# Define non-platform/compiler specific settings
+APP_NAME=FirstUnoContact
+
+OUT_APP_INC = $(OUT_INC)/$(APP_NAME)

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

2022-05-24 Thread Hossein (via logerrit)
 sw/qa/extras/uiwriter/data/simplefooter.docx |binary
 sw/qa/extras/uiwriter/uiwriter.cxx   |   22 ++
 sw/source/filter/ww8/wrtw8sty.cxx|8 
 3 files changed, 30 insertions(+)

New commits:
commit 7b09579295579045c4ad76578df09356f3d5b8d0
Author: Hossein 
AuthorDate: Fri May 20 15:20:40 2022 +0200
Commit: Xisco Fauli 
CommitDate: Tue May 24 09:35:49 2022 +0200

tdf#149184 DOCX: fix crash removing footer, then saving to doc

When openeing the simplefooter.docx, after removing the footer and
exporting to .doc, LibreOffice crashes. This regression was
introduced with 88e6a1bfeac86e0c89d2ff08c908c2b5ae061177 which is
titled: "DOCX: export hidden (shared) headers/footers".

The current patch fixes this problem by checking to see if the header
or footer text is there or not.

A unit test is added to avoid this problem in the future. One can run
the test with:

make CPPUNIT_TEST_NAME="testTdf149184" -sr CppunitTest_sw_uiwriter7

Change-Id: I5586561677b3c490e49b4b10bd987aecdf3fc134
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134684
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134829

diff --git a/sw/qa/extras/uiwriter/data/simplefooter.docx 
b/sw/qa/extras/uiwriter/data/simplefooter.docx
new file mode 100644
index ..006c85ab7cc8
Binary files /dev/null and b/sw/qa/extras/uiwriter/data/simplefooter.docx differ
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx 
b/sw/qa/extras/uiwriter/uiwriter.cxx
index b7593759971b..0aea38d4bbe7 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -50,6 +50,7 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -290,6 +291,7 @@ public:
 void testTdf92648();
 void testTdf103978_backgroundTextShape();
 void testTdf117225();
+void testTdf149184();
 
 CPPUNIT_TEST_SUITE(SwUiWriterTest);
 CPPUNIT_TEST(testReplaceForward);
@@ -411,6 +413,7 @@ public:
 CPPUNIT_TEST(testTdf92648);
 CPPUNIT_TEST(testTdf103978_backgroundTextShape);
 CPPUNIT_TEST(testTdf117225);
+CPPUNIT_TEST(testTdf149184);
 CPPUNIT_TEST_SUITE_END();
 
 private:
@@ -4691,6 +4694,25 @@ void SwUiWriterTest::testTdf117225()
 CPPUNIT_ASSERT_EQUAL(nExpected, nActual);
 }
 
+void SwUiWriterTest::testTdf149184()
+{
+SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "simplefooter.docx");
+SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+// Removing the footer for all styles
+pWrtShell->ChangeHeaderOrFooter(u"", false, false, false);
+// export to simplefooter.doc
+uno::Reference xStorable(mxComponent, uno::UNO_QUERY);
+uno::Sequence aStoreProps = 
comphelper::InitPropertySequence({
+{ "FilterName", uno::Any(OUString("MS Word 97")) },
+});
+utl::TempFile aTempFile;
+aTempFile.EnableKillingFile();
+// Without the fix in place, the test fails with:
+// [CUT] sw_uiwriter7
+// Segmentation fault (core dumped)
+// [_RUN_] testTdf149184::TestBody
+xStorable->storeToURL(aTempFile.GetURL(), aStoreProps);
+}
 
 CPPUNIT_TEST_SUITE_REGISTRATION(SwUiWriterTest);
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/filter/ww8/wrtw8sty.cxx 
b/sw/source/filter/ww8/wrtw8sty.cxx
index 9f103627d576..4126b9f88a50 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -2087,6 +2087,10 @@ void MSWordExportBase::WriteHeaderFooterText( const 
SwFormat& rFormat, bool bHea
 m_bHasHdr = true;
 const SwFormatHeader& rHd = rFormat.GetHeader();
 OSL_ENSURE( rHd.GetHeaderFormat(), "Header text is not here" );
+
+if ( !rHd.GetHeaderFormat() )
+return;
+
 pContent = ()->GetContent();
 }
 else
@@ -2094,6 +2098,10 @@ void MSWordExportBase::WriteHeaderFooterText( const 
SwFormat& rFormat, bool bHea
 m_bHasFtr = true;
 const SwFormatFooter& rFt = rFormat.GetFooter();
 OSL_ENSURE( rFt.GetFooterFormat(), "Footer text is not here" );
+
+if ( !rFt.GetFooterFormat() )
+return;
+
 pContent = ()->GetContent();
 }
 


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

2022-05-23 Thread Hossein (via logerrit)
 sw/qa/extras/uiwriter/data/simplefooter.docx |binary
 sw/qa/extras/uiwriter/uiwriter7.cxx  |   24 
 sw/source/filter/ww8/wrtw8sty.cxx|8 
 3 files changed, 32 insertions(+)

New commits:
commit 3eda5d345f14f8926358df7b425c452a8a165c7d
Author: Hossein 
AuthorDate: Fri May 20 15:20:40 2022 +0200
Commit: Miklos Vajna 
CommitDate: Mon May 23 16:29:54 2022 +0200

tdf#149184 DOCX: fix crash removing footer, then saving to doc

When openeing the simplefooter.docx, after removing the footer and
exporting to .doc, LibreOffice crashes. This regression was
introduced with 88e6a1bfeac86e0c89d2ff08c908c2b5ae061177 which is
titled: "DOCX: export hidden (shared) headers/footers".

The current patch fixes this problem by checking to see if the header
or footer text is there or not.

A unit test is added to avoid this problem in the future. One can run
the test with:

make CPPUNIT_TEST_NAME="testTdf149184" -sr CppunitTest_sw_uiwriter7

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

diff --git a/sw/qa/extras/uiwriter/data/simplefooter.docx 
b/sw/qa/extras/uiwriter/data/simplefooter.docx
new file mode 100644
index ..006c85ab7cc8
Binary files /dev/null and b/sw/qa/extras/uiwriter/data/simplefooter.docx differ
diff --git a/sw/qa/extras/uiwriter/uiwriter7.cxx 
b/sw/qa/extras/uiwriter/uiwriter7.cxx
index 3815713dc877..0cb70e91076b 100644
--- a/sw/qa/extras/uiwriter/uiwriter7.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter7.cxx
@@ -24,6 +24,7 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -2751,6 +2752,29 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf117225)
 CPPUNIT_ASSERT_EQUAL(nExpected, nActual);
 }
 
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf149184)
+{
+SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "simplefooter.docx");
+SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+
+// Removing the footer for all styles
+pWrtShell->ChangeHeaderOrFooter(u"", false, false, false);
+
+// export to simplefooter.doc
+uno::Reference xStorable(mxComponent, uno::UNO_QUERY);
+uno::Sequence aStoreProps = 
comphelper::InitPropertySequence({
+{ "FilterName", uno::Any(OUString("MS Word 97")) },
+});
+utl::TempFile aTempFile;
+aTempFile.EnableKillingFile();
+
+// Without the fix in place, the test fails with:
+// [CUT] sw_uiwriter7
+// Segmentation fault (core dumped)
+// [_RUN_] testTdf149184::TestBody
+xStorable->storeToURL(aTempFile.GetURL(), aStoreProps);
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/ww8/wrtw8sty.cxx 
b/sw/source/filter/ww8/wrtw8sty.cxx
index 44d437dbf772..6e9053401606 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -2080,6 +2080,10 @@ void MSWordExportBase::WriteHeaderFooterText( const 
SwFormat& rFormat, bool bHea
 m_bHasHdr = true;
 const SwFormatHeader& rHd = rFormat.GetHeader();
 OSL_ENSURE( rHd.GetHeaderFormat(), "Header text is not here" );
+
+if ( !rHd.GetHeaderFormat() )
+return;
+
 pContent = ()->GetContent();
 }
 else
@@ -2087,6 +2091,10 @@ void MSWordExportBase::WriteHeaderFooterText( const 
SwFormat& rFormat, bool bHea
 m_bHasFtr = true;
 const SwFormatFooter& rFt = rFormat.GetFooter();
 OSL_ENSURE( rFt.GetFooterFormat(), "Footer text is not here" );
+
+if ( !rFt.GetFooterFormat() )
+return;
+
 pContent = ()->GetContent();
 }
 


[Libreoffice-commits] core.git: configure.ac README.md

2022-05-05 Thread Hossein (via logerrit)
 README.md|2 +-
 configure.ac |   16 
 2 files changed, 17 insertions(+), 1 deletion(-)

New commits:
commit 7fe756570fb4ab30f540d644fd5125a67c2d9ea9
Author: Hossein 
AuthorDate: Sun Apr 24 12:04:33 2022 +0200
Commit: Hossein 
CommitDate: Thu May 5 17:26:12 2022 +0200

Warn if Visual Studio 2019 version is < 16.10

During the compilation with Visual Studio 2019 v16.5, the dragonbox
was failing the build, but it was OK when ugprading to the latest
version, 16.11.

It should be noted that according to the list of predfined macros in
Visual Studio, v16.10 and v16.11 use the same value for _MSC_VER,
which is 1929. Thus, the distinction between these 2 versions can not
be distinguished.

Predefined macros
https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros

For not having the Visual Studio version > 16.10, a warning is
shown, and if the Visual Studio version is < 16.5, just like before,
an error is generated.

Change-Id: I6661ee5121b03ca43e1f7503b74191abcc8d6b40
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132907
Tested-by: Jenkins
Reviewed-by: Hossein 

diff --git a/README.md b/README.md
index 96fde564a842..dcc33988f293 100644
--- a/README.md
+++ b/README.md
@@ -36,7 +36,7 @@ run and compile LibreOffice, also used by the TDF builds:
 
 * Windows:
 * Runtime: Windows 7
-* Build: Cygwin + Visual Studio 2019 version 16.5
+* Build: Cygwin + Visual Studio 2019 version 16.10
 * macOS:
 * Runtime: 10.13
 * Build: 11.0 + Xcode 12.5
diff --git a/configure.ac b/configure.ac
index ec9175d1964a..c711d230f0d2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4266,6 +4266,7 @@ if test "$_os" = "WINNT"; then
 AC_MSG_ERROR([Visual C++ not found after all, huh])
 fi
 
+# ERROR if VS version < 16.5
 AC_MSG_CHECKING([$CC_BASE is at least Visual Studio 2019 version 16.5])
 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
 // See 
 for 
mapping
@@ -4275,6 +4276,21 @@ if test "$_os" = "WINNT"; then
 #endif
 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([no])])
 
+# WARN if VS version < 16.10
+AC_MSG_CHECKING([$CC_BASE is at least Visual Studio 2019 version 16.10])
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
+#if _MSC_VER < 1929
+#error
+#endif
+]])],[vs2019_recommended_version=yes],[vs2019_recommended_version=no])
+
+if test $vs2019_recommended_version = yes; then
+AC_MSG_RESULT([yes])
+else
+AC_MSG_WARN([no])
+add_warning "You should have at least Visual Studio 2019 version 16.10 
to avoid build problems. Otherwise, you may face problems with the build of 
some modules including dragonbox."
+fi
+
 # Check for 64-bit (cross-)compiler to use to build the 64-bit
 # version of the Explorer extension (and maybe other small
 # bits, too) needed when installing a 32-bit LibreOffice on a


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

2022-05-05 Thread Hossein (via logerrit)
 sd/qa/unit/import-tests-smartart.cxx |3 +--
 svx/source/unodraw/unoshtxt.cxx  |9 +
 2 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 759792e40aceb17a621c37ed725d1e998acbd30d
Author: Hossein 
AuthorDate: Thu May 5 13:45:36 2022 +0200
Commit: Hossein 
CommitDate: Thu May 5 17:23:40 2022 +0200

tdf#148818 Fix missing text in boxes with empty first paragraph

Text was lost from the text boxes with empty first paragraph. The
problem was happening when there was 2 paragraphs in a text box, in
which the first paragraph was completely empty. The regression was
introduced in cf2449aac0141711a7610d67f7c50cd108e12443 because of the
bad handling of the paragraphs, and only looking at the size of the
text of the first paragraph.

This is fixed by looking at mpOutliner->GetEditEngine().GetTextLen(i)
for all i=1..k where k=min(2,mpOutliner->GetParagraphCount()).

I have negated the condition to provide a better explanation of what
the condition should be.

Change-Id: Id5d8787df5111c734760afdd98a6fbe832047f32
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133527
Tested-by: Jenkins
Reviewed-by: Hossein 

diff --git a/sd/qa/unit/import-tests-smartart.cxx 
b/sd/qa/unit/import-tests-smartart.cxx
index 2e246485d36c..371d8d81511b 100644
--- a/sd/qa/unit/import-tests-smartart.cxx
+++ b/sd/qa/unit/import-tests-smartart.cxx
@@ -347,9 +347,8 @@ void SdImportTestSmartArt::testTdf148665()
  uno::UNO_QUERY_THROW);
 CPPUNIT_ASSERT_EQUAL(sal_Int32(4), xShapeGroup->getCount());
 
-// FIXME: tdf#148818: Text should be 'Fufufu'
 uno::Reference xText0(xShapeGroup->getByIndex(1), 
uno::UNO_QUERY_THROW);
-CPPUNIT_ASSERT_EQUAL(OUString(""), xText0->getString());
+CPPUNIT_ASSERT_EQUAL(OUString("\nFufufu"), xText0->getString());
 uno::Reference xText1(xShapeGroup->getByIndex(2), 
uno::UNO_QUERY_THROW);
 CPPUNIT_ASSERT_EQUAL(OUString("Susu"), xText1->getString());
 uno::Reference xText2(xShapeGroup->getByIndex(3), 
uno::UNO_QUERY_THROW);
diff --git a/svx/source/unodraw/unoshtxt.cxx b/svx/source/unodraw/unoshtxt.cxx
index 029dd5434903..71e63997e4f1 100644
--- a/svx/source/unodraw/unoshtxt.cxx
+++ b/svx/source/unodraw/unoshtxt.cxx
@@ -775,14 +775,15 @@ void SvxTextEditSourceImpl::UpdateData()
 SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >( mpObject );
 if( pTextObj )
 {
-if( (mpOutliner->GetParagraphCount() != 1 && 
mpOutliner->GetParagraphCount() != 2)
-|| mpOutliner->GetEditEngine().GetTextLen( 0 ) )
+if( (mpOutliner->GetParagraphCount() == 1 && 
mpOutliner->GetEditEngine().GetTextLen( 0 ) == 0 )
+|| (mpOutliner->GetParagraphCount() == 2 && 
mpOutliner->GetEditEngine().GetTextLen( 0 ) == 0
+&& mpOutliner->GetEditEngine().GetTextLen( 1 ) == 
0) )
 {
-pTextObj->NbcSetOutlinerParaObjectForText( 
mpOutliner->CreateParaObject(), mpText );
+pTextObj->NbcSetOutlinerParaObjectForText( std::nullopt, 
mpText );
 }
 else
 {
-pTextObj->NbcSetOutlinerParaObjectForText( std::nullopt, 
mpText );
+pTextObj->NbcSetOutlinerParaObjectForText( 
mpOutliner->CreateParaObject(), mpText );
 }
 }
 


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

2022-04-27 Thread Hossein (via logerrit)
 oox/source/drawingml/textbody.cxx   |   17 ++---
 vcl/source/filter/idxf/dxfentrd.cxx |2 +-
 2 files changed, 11 insertions(+), 8 deletions(-)

New commits:
commit 148f45253f75bc724804f3231a0b04b2d453e0c7
Author: Hossein 
AuthorDate: Sat Apr 23 05:14:02 2022 +0200
Commit: Thorsten Behrens 
CommitDate: Wed Apr 27 12:16:38 2022 +0200

tdf#148665 Fix crash while loading SmartArt graphics

The regression introduced by c79fa460fe6220051bbda2d3c0cb67fbf765e2ac
causes LibreOffice to crash while loading certain files that contain
SmartArt graphics.

By loading sample documents from tdf#148665 (docx) and also tdf#148735
(pptx) in a debug session, it became obvious that the problem happens
in these statements from TextBody::toString() in textbody.cxx:

 if (!isEmpty())
 return maParagraphs.front()->getRuns().front()->getText();

It is guaranteed that maParagraphs is not empty when trying to call
getRuns(), but it is not checked that there are no runs in the first
paragraph before trying to call getText(). The isEmpty() function
returns false upon finding out that there is at least 1 paragraph.

A check is added to TextBody::toString() to prevent a crash.

This is the backtrace generated from loading documents from tdf#148735
in a Qt Creator debug session:

1   __GI_raise  raise.c   50   0x779ec03b
2   __GI_abort  abort.c   79   0x779cb859
3   ??   0x77846109
4   std::vector>::front  vector  
443  0x7fffd23d1fa6
5   oox::drawingml::TextBody::toString  textbody.cxx  92   0x7fffd23d0f85
6   
oox::drawingml::DiagramData::secureDataFromShapeToModelAfterDiagramImport 
datamodel.cxx   295  0x7fffd22d3047
7   oox::drawingml::AdvancedDiagramHelper::doAnchor   diagramhelper.cxx   
213  0x7fffd22fb92d
8   oox::drawingml::Shape::propagateDiagramHelper   shape.cxx   229  
0x7fffd2372a27
9   oox::ppt::PPTShape::addShape  pptshape.cxx  574  0x7fffd25b2bd4
10  oox::ppt::SlidePersist::createXShapes   slidepersist.cxx  150  
0x7fffd25d81ea
11  oox::ppt::PresentationFragmentHandler::importSlide  
presentationfragmenthandler.cxx 404  0x7fffd25c1a78
12  oox::ppt::PresentationFragmentHandler::finalizeImport   
presentationfragmenthandler.cxx 550  0x7fffd25c3331
13  oox::core::FragmentHandler2::endDocument  fragmenthandler2.cxx  53   
0x7fffd22364ab
14  sax_fastparser::FastSaxParserImpl::parseStream  fastparser.cxx  907  
0x7fffe18b2d2b
15  sax_fastparser::FastSaxParser::parseStream  fastparser.cxx  1480 
0x7fffe18b71d2
16  oox::core::FastParser::parseStream  fastparser.cxx  121  0x7fffd221d85b
17  oox::core::FastParser::parseStream  fastparser.cxx  129  0x7fffd221d930
18  oox::core::XmlFilterBase::importFragment  xmlfilterbase.cxx   413  
0x7fffd2248ba5
19  oox::core::XmlFilterBase::importFragment  xmlfilterbase.cxx   343  
0x7fffd2248687
20  oox::ppt::PowerPointImport::importDocument  pptimport.cxx   109  
0x7fffd25a89e2
... 

Change-Id: I3a40be33061008b93455a5926259ef5b92e4ffe6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133341
Tested-by: Jenkins
Tested-by: Julien Nabet 
Reviewed-by: Thorsten Behrens 

diff --git a/oox/source/drawingml/textbody.cxx 
b/oox/source/drawingml/textbody.cxx
index 41a237e97cee..0f053ab6ad74 100644
--- a/oox/source/drawingml/textbody.cxx
+++ b/oox/source/drawingml/textbody.cxx
@@ -77,21 +77,24 @@ bool TextBody::isEmpty() const
 if ( maParagraphs.size() > 1 )
 return false;
 
-const TextRunVector aRuns = maParagraphs[0]->getRuns();
-if ( aRuns.empty() )
+const TextRunVector& rRuns = maParagraphs[0]->getRuns();
+if ( rRuns.empty() )
 return true;
-if ( aRuns.size() > 1 )
+if ( rRuns.size() > 1 )
 return false;
 
-return aRuns[0]->getText().isEmpty();
+return rRuns[0]->getText().isEmpty();
 }
 
 OUString TextBody::toString() const
 {
 if (!isEmpty())
-return maParagraphs.front()->getRuns().front()->getText();
-else
-return OUString();
+{
+const TextRunVector& rRuns = maParagraphs.front()->getRuns();
+if(!rRuns.empty())
+return rRuns.front()->getText();
+}
+return OUString();
 }
 
 bool TextBody::hasVisualRunProperties() const
commit 221da351f37c33296c2e3ce17334280bfb9226cc
Author: Caolán McNamara 
AuthorDate: Wed Apr 27 10:14:50 2022 +0100
Commit: Caolán McNamara 
CommitDate: Wed Apr 27 12:16:23 2022 +0200

ofz#47051 Out-of-memory

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

diff --git a/vcl/source/filter/idxf/dxfentrd.cxx 
b/vcl/source/filter/idxf/dxfentrd.cxx
index ba7cae6adb76..b4915c6573f8 100644
--- a/vcl/source/filter/idxf/dxfentrd.cxx
+++ b/vcl/source/filter/idxf/dxfentrd.cxx
@@ 

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

2022-04-24 Thread Hossein (via logerrit)
 emfio/qa/cppunit/wmf/wmfimporttest.cxx |5 -
 1 file changed, 5 deletions(-)

New commits:
commit 45aac5b97192a97369c7785772ce7400d9ea8abc
Author: Hossein 
AuthorDate: Sun Apr 24 14:13:21 2022 +0200
Commit: Hossein - 
CommitDate: Sun Apr 24 14:56:24 2022 +0200

Remove brittle test from WmfTest

The WmfTest::testStockObject() contained test for the number of
children in the metafile dump. This can be changed when unimplemented
records are implemented.

The problem was revelead while implementing SetPolyFillMode record:


xmltesttools.cxx:234:WmfTest::testStockObject
equality assertion failed
- Expected: 42
- Actual  : 47
- In <>, XPath '/metafile/push[2]' number of child-nodes is incorrect

Change-Id: I627801b7ac535a2f0c736880d9675f3d0136136a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133353
Tested-by: Jenkins
Reviewed-by: Hossein - 

diff --git a/emfio/qa/cppunit/wmf/wmfimporttest.cxx 
b/emfio/qa/cppunit/wmf/wmfimporttest.cxx
index d8a4ed82d0f0..a85876e03a7d 100644
--- a/emfio/qa/cppunit/wmf/wmfimporttest.cxx
+++ b/emfio/qa/cppunit/wmf/wmfimporttest.cxx
@@ -402,11 +402,6 @@ void WmfTest::testStockObject()
 
 CPPUNIT_ASSERT(pDoc);
 
-//   Without the fix in place, this test would have failed with
-// - Expected: 42
-// - Actual  : 37
-assertXPathChildren(pDoc, "/metafile/push[2]", 42);
-
 //   Without the fix in place, this test would have failed with
 // - Expected: 1
 // - Actual  : 0


[Libreoffice-commits] core.git: odk/examples

2022-04-20 Thread Hossein (via logerrit)
 odk/examples/DevelopersGuide/FirstSteps/FirstUnoContact.cpp |   35 
 1 file changed, 35 insertions(+)

New commits:
commit a40558be785756929f606ab0798a026b985e0ffb
Author: Hossein 
AuthorDate: Tue Apr 12 15:20:01 2022 +0200
Commit: Hossein 
CommitDate: Wed Apr 20 14:51:40 2022 +0200

tdf#143122 - Port Java examples to C++

Porting FirstSteps/FirstUnoContact.java to C++ is done. More
information on this example can be found in the DevGuide:

LibreOffice Developer's Guide: Chapter 1 - First Steps - First Contact
https://wiki.documentfoundation.org/Documentation/DevGuide/First_Steps

Change-Id: I84b0a60738bfe614158d7eabf8bff3cda1ccca50
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132910
Tested-by: Jenkins
Reviewed-by: Hossein 

diff --git a/odk/examples/DevelopersGuide/FirstSteps/FirstUnoContact.cpp 
b/odk/examples/DevelopersGuide/FirstSteps/FirstUnoContact.cpp
new file mode 100644
index ..bdcac76bec14
--- /dev/null
+++ b/odk/examples/DevelopersGuide/FirstSteps/FirstUnoContact.cpp
@@ -0,0 +1,35 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4;
+ * fill-column: 100 -*- */
+/*
+ * 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/.
+ */
+
+#include 
+#include 
+#include 
+#include 
+
+SAL_IMPLEMENT_MAIN()
+{
+try
+{
+css::uno::Reference 
xContext(cppu::bootstrap());
+std::cout << "Connected to a running office ..." << std::endl;
+css::uno::Reference xMCF = 
xContext->getServiceManager();
+std::string available = xMCF != nullptr ? "available" : "not 
available";
+std::cout << "remote ServiceManager is " + available << std::endl;
+}
+catch (css::uno::Exception& e)
+{
+std::cout << e.Message << std::endl;
+return 1;
+}
+return 0;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s
+ * cinkeys+=0=break: */


[Libreoffice-commits] core.git: odk/examples

2022-04-20 Thread Hossein (via logerrit)
 odk/examples/DevelopersGuide/FirstSteps/FirstUnoContact.py |   24 +
 1 file changed, 24 insertions(+)

New commits:
commit c37d00a4f22a973c0905a9d8f409994763cb637a
Author: Hossein 
AuthorDate: Tue Apr 12 16:07:19 2022 +0200
Commit: Hossein 
CommitDate: Wed Apr 20 12:39:50 2022 +0200

tdf#143123 - Port Java examples to Python

Porting FirstSteps/FirstUnoContact.java to Python is done. More
information on this example can be found in the DevGuide:

LibreOffice Developer's Guide: Chapter 1 - First Steps - First Contact
https://wiki.documentfoundation.org/Documentation/DevGuide/First_Steps

Change-Id: I8a97672a0b437177f19ddce029e6ef27e97533ec
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132914
Tested-by: Jenkins
Reviewed-by: Hossein 

diff --git a/odk/examples/DevelopersGuide/FirstSteps/FirstUnoContact.py 
b/odk/examples/DevelopersGuide/FirstSteps/FirstUnoContact.py
new file mode 100644
index ..06cd0bc5a719
--- /dev/null
+++ b/odk/examples/DevelopersGuide/FirstSteps/FirstUnoContact.py
@@ -0,0 +1,24 @@
+# -*- 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/.
+#
+
+import uno
+import officehelper
+
+try:
+xContext = officehelper.bootstrap()
+print("Connected to a running office ...")
+xMCF = xContext.getServiceManager()
+available = "not available" if xMCF is None else "available"
+print("remote ServiceManager is " + available)
+
+except Exception as e:
+print(e)
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
+


[Libreoffice-commits] core.git: drawinglayer/README.md emfio/README.md README.md

2022-04-16 Thread Hossein (via logerrit)
 README.md  |6 +++---
 drawinglayer/README.md |2 +-
 emfio/README.md|2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 622b92dab29aff0fe9f23cf6fbf00dc7347bb34a
Author: Hossein 
AuthorDate: Fri Apr 15 12:46:24 2022 +0200
Commit: Adolfo Jayme Barrientos 
CommitDate: Sat Apr 16 20:43:11 2022 +0200

Update README.md files

* Fix typo
* Improve links

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

diff --git a/README.md b/README.md
index 2d9432868c70..96fde564a842 100644
--- a/README.md
+++ b/README.md
@@ -18,8 +18,8 @@ A quick overview of the LibreOffice code structure.
 You can develop for LibreOffice in one of two ways, one
 recommended and one much less so. First the somewhat less recommended
 way: it is possible to use the SDK to develop an extension,
-for which you can read the API docs [here](https://api.libreoffice.org/)
-and [here](https://wiki.documentfoundation.org/Documentation/DevGuide).
+for which you can read the [API docs](https://api.libreoffice.org/)
+and [Developers 
Guide](https://wiki.documentfoundation.org/Documentation/DevGuide).
 This re-uses the (extremely generic) UNO APIs that are also used by
 macro scripting in StarBasic.
 
@@ -51,7 +51,7 @@ run and compile LibreOffice, also used by the TDF builds:
 * Emscripten / WASM:
 * Runtime: a browser with SharedMemory support (threads + atomics)
 * Build: Qt 5.15 with Qt supported Emscripten 1.39.8
-* See README.wasm
+* See [README.wasm](static/README.wasm.md)
 
 If you want to use Clang with the LibreOffice compiler plugins, the minimal
 version of Clang is 12.0.1. Since Xcode doesn't provide the compiler plugin
diff --git a/drawinglayer/README.md b/drawinglayer/README.md
index a22dc0b68343..9eb7057d2a37 100644
--- a/drawinglayer/README.md
+++ b/drawinglayer/README.md
@@ -86,7 +86,7 @@ printing), etc.
 ## Dumping DrawingLayer Primitives as XML
 
 For debugging purposes, it is possible to dump the drawinglayer primitives as
-as an xml file. The drawinglayer xml dump can show possible problems with the
+an xml file. The drawinglayer xml dump can show possible problems with the
 rendering.
 
 For example, in `emfio/qa/cppunit/emf/EmfImportTest.cxx`, one can write:
diff --git a/emfio/README.md b/emfio/README.md
index 283e0c3f41c7..f9f33a2ba4e1 100644
--- a/emfio/README.md
+++ b/emfio/README.md
@@ -51,7 +51,7 @@ documentation.
 
 The drawinglayer primitives created to draw the emf/wmf files can be dumped as
 xml for debugging purposes. For more information, please refer to the
-[drawyinglayer](../drawyinglayer) documentation.
+[drawinglayer](../drawyinglayer) documentation.
 
 ## Limitations
 Not all the WMF/EMF/EMF+ records are supported by this module. Unsupported


[Libreoffice-commits] core.git: drawinglayer/README.md emfio/README.md

2022-04-13 Thread Hossein (via logerrit)
 drawinglayer/README.md |   17 +
 emfio/README.md|6 ++
 2 files changed, 23 insertions(+)

New commits:
commit 3a641c344d35df13437f97e68ee5cfd993845e91
Author: Hossein 
AuthorDate: Wed Apr 13 13:06:01 2022 +0200
Commit: Miklos Vajna 
CommitDate: Wed Apr 13 17:04:35 2022 +0200

Add info on limerest / dump drawyinglayer primitives

* Add information on dumping drawyinglayer primitives as xml
* Add link to a new tool named limerest on gitlab

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

diff --git a/drawinglayer/README.md b/drawinglayer/README.md
index 04ebcadf0b17..a22dc0b68343 100644
--- a/drawinglayer/README.md
+++ b/drawinglayer/README.md
@@ -82,3 +82,20 @@ printing), etc.
 above)
 
 * Custom widgets (like the Header / Footer indicator button)
+
+## Dumping DrawingLayer Primitives as XML
+
+For debugging purposes, it is possible to dump the drawinglayer primitives as
+as an xml file. The drawinglayer xml dump can show possible problems with the
+rendering.
+
+For example, in `emfio/qa/cppunit/emf/EmfImportTest.cxx`, one can write:
+
+Primitive2DSequence aSequence = 
parseEmf(u"emfio/qa/cppunit/wmf/data/stockobject.emf");
+drawinglayer::Primitive2dXmlDump dumper;
+Primitive2DContainer aContainer(aSequence);
+dumper.dump(aContainer, "/tmp/drawyinglayer.xml");
+
+Then, after invoking `make CppunitTest_emfio_emf`, `/tmp/drawyinglayer.xml` 
will
+be the dump of the drawinglayer primitives used to draw the emf file in
+LibreOffice. The top level tag will be .
diff --git a/emfio/README.md b/emfio/README.md
index 665af1fa4e0c..db7393d9018c 100644
--- a/emfio/README.md
+++ b/emfio/README.md
@@ -49,6 +49,10 @@ documentation.
 ## How does it work?
 `emfio` module takes a byte array and turns it into a `drawinglayer` primitive 
container. The rendering is done via `drawinglayer` primitives. For more 
information, you should refer to [VCL](../vcl) documentation.
 
+The drawinglayer primitives created to draw the emf/wmf files can be dumped as
+xml for debugging purposes. For more information, please refer to the
+[drawyinglayer](../drawyinglayer) documentation.
+
 ## Limitations
 Not all the WMF/EMF/EMF+ records are supported by this module. Unsupported
 records are marked as "not implemented", and a warning message will printed
@@ -114,6 +118,8 @@ formats. Some of them are:
 modifies several binary formats from Microsoft including WMF/EMF/EMF+, and also
 other companies.
 * [EMF+ diagnostics reporting 
tool](https://github.com/chrissherlock/emfplus-decoder)
+* [limerest](https://gitlab.com/re-lab-project/limerest): A new gui tool based
+on OLEToy for working with verious binary formats
 
 ## Related Software
 * [libemf](http://libemf.sourceforge.net/)


[Libreoffice-commits] core.git: odk/examples odk/Package_examples.mk

2022-04-06 Thread Hossein (via logerrit)
 odk/Package_examples.mk  |1 
 odk/examples/DevelopersGuide/FirstSteps/FirstConnection.java |   61 ---
 2 files changed, 62 deletions(-)

New commits:
commit 9c2c16fbd1282a21ffb82f71e7e3c575fd0e78b6
Author: Hossein 
AuthorDate: Sat Apr 2 18:35:48 2022 +0200
Commit: Hossein 
CommitDate: Wed Apr 6 16:44:48 2022 +0200

Remove duplicate DevGuide example FirstConnection

While cleaning up "LibreOffice DevGuide: Chapter 1 - First Steps" in
the TDF Wiki, I understood that only 3 examples were compiled via the
Makefile, but there were 4 java files. It turned out that the
FirstUnoContact.java and FirstConnection.java are essentially the
same. I removed the second one, as it was not built, and was not
referenced elsewhere.

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

diff --git a/odk/Package_examples.mk b/odk/Package_examples.mk
index 78368d14bdab..f7bda16f9dd8 100644
--- a/odk/Package_examples.mk
+++ b/odk/Package_examples.mk
@@ -171,7 +171,6 @@ $(eval $(call 
gb_Package_add_files_with_dir,odk_examples,$(SDKDIRNAME)/examples,
 
DevelopersGuide/Extensions/DialogWithHelp/help/en/com.foocorp.foo-ext/page1.xhp 
\
 
DevelopersGuide/Extensions/DialogWithHelp/help/en/com.foocorp.foo-ext/page2.xhp 
\
 
DevelopersGuide/Extensions/DialogWithHelp/help/en/com.foocorp.foo-ext/subfolder/anotherpage.xhp
 \
-DevelopersGuide/FirstSteps/FirstConnection.java \
 DevelopersGuide/FirstSteps/FirstLoadComponent.java \
 DevelopersGuide/FirstSteps/FirstUnoContact.java \
 DevelopersGuide/FirstSteps/HelloTextTableShape.java \
diff --git a/odk/examples/DevelopersGuide/FirstSteps/FirstConnection.java 
b/odk/examples/DevelopersGuide/FirstSteps/FirstConnection.java
deleted file mode 100644
index 9506b0070117..
--- a/odk/examples/DevelopersGuide/FirstSteps/FirstConnection.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- 
*/
-/*
- *
- *  The Contents of this file are made available subject to the terms of
- *  the BSD license.
- *
- *  Copyright 2000, 2010 Oracle and/or its affiliates.
- *  All rights reserved.
- *
- *  Redistribution and use in source and binary forms, with or without
- *  modification, are permitted provided that the following conditions
- *  are met:
- *  1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *  2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *  3. Neither the name of Sun Microsystems, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- *  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- *  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- *  OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- *  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
- *  TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
- *  USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-public class FirstConnection {
-
-public static void main(String[] args) {
-try {
-// get the remote office component context
-com.sun.star.uno.XComponentContext xContext =
-com.sun.star.comp.helper.Bootstrap.bootstrap();
-
-System.out.println("Connected to a running office ...");
-
-com.sun.star.lang.XMultiComponentFactory xMCF =
-xContext.getServiceManager();
-
-String available = (null != xMCF ? "available" : "not available");
-System.out.println( "remote ServiceManager is " + available );
-}
-catch (java.lang.Exception e){
-e.printStackTrace();
-}
-finally {
-System.exit(0);
-}
-}
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */


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

2022-04-06 Thread Hossein (via logerrit)
 emfio/qa/cppunit/wmf/data/stockobject.emf |binary
 emfio/qa/cppunit/wmf/wmfimporttest.cxx|   25 +
 emfio/source/reader/mtftools.cxx  |2 +-
 3 files changed, 26 insertions(+), 1 deletion(-)

New commits:
commit f385661ec1463053c1ca51dc50db075c478de87c
Author: Hossein 
AuthorDate: Tue Apr 5 14:07:36 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Wed Apr 6 16:41:57 2022 +0200

tdf#148359 Fix emfio regression: missing emf image

This patch fixes tdf#148359 which prevented the display of EMF images
embedded in the rtf files or even loading when loading them directly.

Looking into the problem caused by the cleanup commit
3e7dd04dd8ca1baea4b7918eb7a7080c595c4625, it became visible that
while enums were converted to enum class, there was a cast that
was wrongly ommited:

- sal_uInt16 nStockId = static_cast(nIndex);
+ StockObject nStockId = static_cast(nIndex);

Now, it is re-written as:

StockObject nStockId = static_cast(nIndex & 0xFF);

The symptom was that the StockObject field was mishandled, and thus
the shapes were displayed in white, instead of black.

"Stock Logical Object" is discussed in the MS document for EMF:

* [MS-EMF] v20210625 - pages 44, 45 and 182

A unit test is provided to make sure that the regression does not
happen again. The test can be run by:

make CPPUNIT_TEST_NAME=testStockObject -sr CppunitTest_emfio_wmf

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

diff --git a/emfio/qa/cppunit/wmf/data/stockobject.emf 
b/emfio/qa/cppunit/wmf/data/stockobject.emf
new file mode 100644
index ..8de7c1ae591c
Binary files /dev/null and b/emfio/qa/cppunit/wmf/data/stockobject.emf differ
diff --git a/emfio/qa/cppunit/wmf/wmfimporttest.cxx 
b/emfio/qa/cppunit/wmf/wmfimporttest.cxx
index b8c2218fdec2..d8a4ed82d0f0 100644
--- a/emfio/qa/cppunit/wmf/wmfimporttest.cxx
+++ b/emfio/qa/cppunit/wmf/wmfimporttest.cxx
@@ -56,6 +56,7 @@ public:
 void testTdf99402();
 void testTdf39894();
 void testETO_PDY();
+void testStockObject();
 
 CPPUNIT_TEST_SUITE(WmfTest);
 CPPUNIT_TEST(testNonPlaceableWmf);
@@ -69,6 +70,7 @@ public:
 CPPUNIT_TEST(testTdf99402);
 CPPUNIT_TEST(testTdf39894);
 CPPUNIT_TEST(testETO_PDY);
+CPPUNIT_TEST(testStockObject);
 CPPUNIT_TEST_SUITE_END();
 };
 
@@ -389,6 +391,29 @@ void WmfTest::testETO_PDY()
 }
 }
 
+void WmfTest::testStockObject()
+{
+SvFileStream aFileStream(getFullUrl(u"stockobject.emf"), StreamMode::READ);
+GDIMetaFile aGDIMetaFile;
+ReadWindowMetafile(aFileStream, aGDIMetaFile);
+
+MetafileXmlDump dumper;
+xmlDocUniquePtr pDoc = dumpAndParse(dumper, aGDIMetaFile);
+
+CPPUNIT_ASSERT(pDoc);
+
+//   Without the fix in place, this test would have failed with
+// - Expected: 42
+// - Actual  : 37
+assertXPathChildren(pDoc, "/metafile/push[2]", 42);
+
+//   Without the fix in place, this test would have failed with
+// - Expected: 1
+// - Actual  : 0
+// - In <>, XPath '/metafile/push[2]/fillcolor[2]' number of nodes is 
incorrect
+assertXPath(pDoc, "/metafile/push[2]/fillcolor[2]", "color", "#00");
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(WmfTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/emfio/source/reader/mtftools.cxx b/emfio/source/reader/mtftools.cxx
index f829788dbd1b..5cb43ec68510 100644
--- a/emfio/source/reader/mtftools.cxx
+++ b/emfio/source/reader/mtftools.cxx
@@ -750,7 +750,7 @@ namespace emfio
 if ( nIndex & ENHMETA_STOCK_OBJECT )
 {
 SAL_INFO ( "emfio", "\t\t ENHMETA_STOCK_OBJECT, StockObject 
Enumeration: 0x" << std::hex  << nIndex );
-StockObject nStockId = static_cast(nIndex);
+StockObject nStockId = static_cast(nIndex & 0xFF);
 switch( nStockId )
 {
 case StockObject::WHITE_BRUSH :


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

2022-04-06 Thread Hossein (via logerrit)
 emfio/inc/mtftools.hxx |2 +-
 emfio/qa/cppunit/wmf/wmfimporttest.cxx |2 +-
 emfio/source/reader/mtftools.cxx   |2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 51431559bda9a81293d502328982452caeeba6c6
Author: Hossein 
AuthorDate: Wed Apr 6 04:41:07 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Wed Apr 6 10:52:50 2022 +0200

Fix type, calculation of FamilyFont PitchAndFamily

This patch fixes problems caused by the cleanup commit
3e7dd04dd8ca1baea4b7918eb7a7080c595c4625 for type and calculation of
FamilyFont and PitchAndFamily enumerations.

FamilyFont enumeration is described in [MS-WMF] v20210625 page 33:

  "In a Font Object, when a FamilyFont value is packed into a byte
  with a PitchFont Enumeration value, the result is a PitchAndFamily
  Object".

Thus, we will use sal_uInt8 as the underlying type for FamilyFont.

The PitchAndFamily is created as shown in [MS-WMF] v20210625 page 96:

[0 1 2 3] 4 5 [6 7]
 Family   0 0 Pitch

The values for FamilyFont enumeration are created according to the
[MS-WMF], and the calculations are changed to use '<< 4' and '>> 4'
instead of applying the same shift to the enumeration values.

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

diff --git a/emfio/inc/mtftools.hxx b/emfio/inc/mtftools.hxx
index cb6e1c7ff243..0290c487c574 100644
--- a/emfio/inc/mtftools.hxx
+++ b/emfio/inc/mtftools.hxx
@@ -275,7 +275,7 @@ namespace emfio
 };
 
 /* [MS-WMF] - v20210625 - pages 33,  */
-enum FamilyFont : sal_uInt32
+enum FamilyFont : sal_uInt8
 {
 FF_DONTCARE   = 0x00,
 FF_ROMAN  = 0x01,
diff --git a/emfio/qa/cppunit/wmf/wmfimporttest.cxx 
b/emfio/qa/cppunit/wmf/wmfimporttest.cxx
index 1ae7416521aa..b8c2218fdec2 100644
--- a/emfio/qa/cppunit/wmf/wmfimporttest.cxx
+++ b/emfio/qa/cppunit/wmf/wmfimporttest.cxx
@@ -336,7 +336,7 @@ void WmfTest::testTdf99402()
 logfontw.lfUnderline = 0;
 logfontw.lfStrikeOut = 0;
 logfontw.lfCharSet = emfio::CharacterSet::OEM_CHARSET;
-logfontw.lfPitchAndFamily = +emfio::FamilyFont::FF_ROMAN | 
+emfio::PitchFont::DEFAULT_PITCH;
+logfontw.lfPitchAndFamily = emfio::FamilyFont::FF_ROMAN << 4 | 
emfio::PitchFont::DEFAULT_PITCH;
 logfontw.alfFaceName = "Symbol";
 
 emfio::WinMtfFontStyle fontStyle(logfontw);
diff --git a/emfio/source/reader/mtftools.cxx b/emfio/source/reader/mtftools.cxx
index b4973f6e51ab..f829788dbd1b 100644
--- a/emfio/source/reader/mtftools.cxx
+++ b/emfio/source/reader/mtftools.cxx
@@ -179,7 +179,7 @@ namespace emfio
 aFont.SetCharSet( eCharSet );
 aFont.SetFamilyName( rFont.alfFaceName );
 FontFamily eFamily;
-switch ( rFont.lfPitchAndFamily & 0xf0 )
+switch ( rFont.lfPitchAndFamily >> 4 & 0x0f )
 {
 case FamilyFont::FF_ROMAN:
 eFamily = FAMILY_ROMAN;


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

2022-03-28 Thread Hossein (via logerrit)
 sw/source/uibase/shells/textsh1.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit ff0783ce6c74178ae44d6b5e402b0feecff918a9
Author: Hossein 
AuthorDate: Tue Jan 18 09:24:04 2022 +0100
Commit: Michael Stahl 
CommitDate: Mon Mar 28 12:54:22 2022 +0200

tdf#146523 Fix editable protected drop-down fields

Previously, drop-down fields from a protected section in a Writer
document could be edited by double-clicking on them. This patch adds
a check to see if the appropriate section is protected or not. This
check is done before allowing LibreOffice to open a popup window
titled "Drop-down Form Field" for editing the list of possible
values.

Also, with this patch, menu item "Form > Control Properties..." will
no longer do anything for the fields in a protected section.

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

diff --git a/sw/source/uibase/shells/textsh1.cxx 
b/sw/source/uibase/shells/textsh1.cxx
index e0f4459f31e9..4b94dc5b3b94 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -1473,7 +1473,8 @@ void SwTextShell::Execute(SfxRequest )
 pFieldBM = 
GetShell().getIDocumentMarkAccess()->getFieldmarkFor(aPos);
 }
 
-if ( pFieldBM && pFieldBM->GetFieldname() == ODF_FORMDROPDOWN )
+if ( pFieldBM && pFieldBM->GetFieldname() == ODF_FORMDROPDOWN
+ && !(rWrtSh.GetCurrSection() && 
rWrtSh.GetCurrSection()->IsProtect()) )
 {
 SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
 ScopedVclPtr 
pDlg(pFact->CreateDropDownFormFieldDialog(rWrtSh.GetView().GetFrameWeld(), 
pFieldBM));


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

2022-03-15 Thread Hossein (via logerrit)
 editeng/source/items/numitem.cxx |   48 ---
 1 file changed, 11 insertions(+), 37 deletions(-)

New commits:
commit 3cc41346f5529026d7d38f2863ae3d84948e6ab7
Author: Hossein 
AuthorDate: Tue Mar 15 09:07:59 2022 +0100
Commit: Mike Kaganski 
CommitDate: Tue Mar 15 13:50:38 2022 +0100

Better CreateRomanString() to create Roman numbers

The previous implementation of CreateRomanString() was complex and
was using various tricks and pointers to create Roman representation
of the integers.

The new implementation is simpler, and easier to understand.

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

diff --git a/editeng/source/items/numitem.cxx b/editeng/source/items/numitem.cxx
index 7d6fa5fe23ae..c4220c78a4b5 100644
--- a/editeng/source/items/numitem.cxx
+++ b/editeng/source/items/numitem.cxx
@@ -539,48 +539,22 @@ Size SvxNumberFormat::GetGraphicSizeMM100(const Graphic* 
pGraphic)
 
 OUString SvxNumberFormat::CreateRomanString( sal_Int32 nNo, bool bUpper )
 {
-nNo %= 4000;// more can not be displayed
-//  i, ii, iii, iv, v, vi, vii, vii, viii, ix
-//  (Dummy),1000,500,100,50,10,5,1
-const char *cRomanArr = bUpper
-? "MDCLXVI--"   // +2 Dummy entries!
-: "mdclxvi--";  // +2 Dummy entries!
-
 OUStringBuffer sRet;
-sal_uInt16 nMask = 1000;
-while( nMask )
-{
-sal_uInt8 nNumber = sal_uInt8(nNo / nMask);
-sal_uInt8 nDiff = 1;
-nNo %= nMask;
 
-if( 5 < nNumber )
-{
-if( nNumber < 9 )
-sRet.append(*(cRomanArr-1));
-++nDiff;
-nNumber -= 5;
-}
-switch( nNumber )
+constexpr char romans[][13] = {"M", "CM", "D", "CD", "C", "XC", "L", "XL", 
"X", "IX", "V", "IV", "I"};
+constexpr sal_Int32 values[] = {1000, 900, 500, 400, 100, 90, 50, 40, 10, 
9, 5, 4, 1};
+
+for (size_t i = 0; i < std::size(romans); ++i)
+{
+while(nNo - values[i] >= 0)
 {
-case 3: { sRet.append(*cRomanArr); [[fallthrough]]; }
-case 2: { sRet.append(*cRomanArr); [[fallthrough]]; }
-case 1: { sRet.append(*cRomanArr); }
-break;
-
-case 4: {
-sRet.append(*cRomanArr);
-sRet.append(*(cRomanArr-nDiff));
-}
-break;
-case 5: { sRet.append(*(cRomanArr-nDiff)); }
-break;
+sRet.appendAscii(romans[i]);
+nNo -= values[i];
 }
-
-nMask /= 10;// for the next decade
-cRomanArr += 2;
 }
-return sRet.makeStringAndClear();
+
+return bUpper ? sRet.makeStringAndClear()
+  : sRet.makeStringAndClear().toAsciiLowerCase();
 }
 
 void SvxNumberFormat::SetListFormat(const OUString& rPrefix, const OUString& 
rSuffix, int nLevel)


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

2022-03-15 Thread Hossein (via logerrit)
 basegfx/source/workbench/Makefile   |   13 --
 basegfx/source/workbench/bezierclip.cxx |  186 
 2 files changed, 95 insertions(+), 104 deletions(-)

New commits:
commit 59cb2aa7908e1a7079a6fb692465b1bbe4321e2b
Author: Hossein 
AuthorDate: Thu Dec 16 07:59:33 2021 +0100
Commit: Hossein 
CommitDate: Tue Mar 15 13:03:08 2022 +0100

Update basegfx workbench

* Update Makefile
  + Remove obsolete 'test' rule
  + Fix include
* Add needed headers, std:: where needed
* Add newlines in the print

One can run the workbench simply by invoking:

make

inside 'basegfx/source/workbench' and then

./bezierclip

Change-Id: I1055260a801d3a95c102a92004874000efb6871c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126903
Tested-by: Jenkins
Reviewed-by: Hossein 

diff --git a/basegfx/source/workbench/Makefile 
b/basegfx/source/workbench/Makefile
index 21dfc1400d11..6218141da1c8 100644
--- a/basegfx/source/workbench/Makefile
+++ b/basegfx/source/workbench/Makefile
@@ -16,19 +16,8 @@
 #   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 #
 
-# Testbuild
-
-#test : bezierclip.cxx convexhull.cxx
-#  g++ -Wall -g \
-#  -I. -I. -I../inc -I./inc -I./unx/inc -I./unxlngi4/inc -I. 
-I/develop4/update/SRX644/unxlngi4/inc.m4/stl 
-I/develop4/update/SRX644/unxlngi4/inc.m4/external 
-I/develop4/update/SRX644/unxlngi4/inc.m4 
-I/develop4/update/SRX644/src.m4/solenv/unxlngi4/inc  
-I/net/grande/develop6/update/dev/gcc_3.0.1_linux_libc2.11_turbolinux/include 
-I/develop4/update/SRX644/src.m4/solenv/inc 
-I/develop4/update/SRX644/unxlngi4/inc.m4/stl 
-I/net/grande.germany/develop6/update/dev/gcc_3.0.1_linux_libc2.11_turbolinux/redhat60/usr/include
 
-I/net/grande.germany/develop6/update/dev/gcc_3.0.1_linux_libc2.11_turbolinux/redhat60/usr/include/X11
 -I/develop4/update/SRX644/src.m4/res 
-I/net/grande/develop6/update/dev/Linux_JDK_1.4.0/include 
-I/net/grande/develop6/update/dev/Linux_JDK_1.4.0/include/linux -I. -I./res -I. 
\
-#  -include preinclude.h -D_USE_NAMESPACE -DGLIBC=2 -D_USE_NAMESPACE=1 
-D_DEBUG_RUNTIME \
-#  bezierclip.cxx convexhull.cxx -o bezierclip
-
 prog : bezierclip.cxx convexhull.cxx
-   g++ -Wall -g bezierclip.cxx convexhull.cxx -o bezierclip
-
-test : testconvexhull.cxx
-   g++ -Wall -g testconvexhull.cxx -o testhull
+   g++ -I. -Wall -g bezierclip.cxx convexhull.cxx -o bezierclip
 
 .cxx.o:
g++ -c $(LOCALDEFINES) $(CCFLAGS) $<
diff --git a/basegfx/source/workbench/bezierclip.cxx 
b/basegfx/source/workbench/bezierclip.cxx
index 1f16ed37c05c..7c939f9b 100644
--- a/basegfx/source/workbench/bezierclip.cxx
+++ b/basegfx/source/workbench/bezierclip.cxx
@@ -17,6 +17,8 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -287,9 +289,9 @@ bool Impl_calcSafeParams_clip( double&  t1,
 
 Polygon2D convHull( convexHull( poly ) );
 
-cout << "# convex hull testing" << endl
+std::cout << "# convex hull testing" << std::endl
  << "plot [t=0:1] ";
-cout << " bez("
+std::cout << " bez("
  << poly[0].x << ","
  << poly[1].x << ","
  << poly[2].x << ","
@@ -303,22 +305,22 @@ bool Impl_calcSafeParams_clip( double&  t1,
  << t1 << ", t, "
  << t2 << ", t, "
  << "'-' using ($1):($2) title \"control polygon\" with lp, "
- << "'-' using ($1):($2) title \"convex hull\" with lp" << endl;
+ << "'-' using ($1):($2) title \"convex hull\" with lp" << std::endl;
 
 unsigned int k;
 for( k=0; k void Impl_applySafeRanges_rec( 
std::back_insert_iterato
 // tangency, and justifies to return a single intersection
 // point. Otherwise, inside/outside test might fail here.
 
-for( int i=0; i

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

2022-03-15 Thread Hossein (via logerrit)
 emfio/inc/mtftools.hxx |  445 ++---
 emfio/qa/cppunit/wmf/wmfimporttest.cxx |4 
 emfio/source/reader/emfreader.cxx  |   23 -
 emfio/source/reader/mtftools.cxx   |  168 ++--
 emfio/source/reader/wmfreader.cxx  |   64 ++--
 5 files changed, 397 insertions(+), 307 deletions(-)

New commits:
commit 3e7dd04dd8ca1baea4b7918eb7a7080c595c4625
Author: Hossein 
AuthorDate: Mon Feb 28 00:07:16 2022 +0100
Commit: Hossein 
CommitDate: Tue Mar 15 13:00:59 2022 +0100

tdf#145614 Convert #define to enum and constexpr

* Converted symbolic constants with #define in mftools.hxx to:
  a) 'enum' where facing multiple values of the same category with
 similar prefixes, or enums from the [MS-WMF] / [MS-EMF]
  b) extracted the underlying integral type from the above documents
  c) 'constexpr' where there was a single value

* Where possible, 'enum class' in 'emfio' namespace is used
  * Some enums with binary or comparison operations are not converted
MappingMode, TextAlignmentMode, RasterOperations, PenStyle
CharacterSet, ExtTextOutOptions, PitchFont, FamilyFont, WeightFont

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

diff --git a/emfio/inc/mtftools.hxx b/emfio/inc/mtftools.hxx
index d258a9250b91..cb6e1c7ff243 100644
--- a/emfio/inc/mtftools.hxx
+++ b/emfio/inc/mtftools.hxx
@@ -32,51 +32,60 @@
 
 #include "emfiodllapi.h"
 
-#define ERROR   0
-#define NULLREGION  1
-#define COMPLEXREGION   3
-
-#define RGN_AND 1
-#define RGN_OR  2
-#define RGN_XOR 3
-#define RGN_DIFF4
-#define RGN_COPY5
-
 namespace emfio
 {
-enum class BkMode
+/* [MS-EMF] - v20210625 - pages 43, 107 */
+enum class RegionMode : sal_uInt32
+{
+RGN_AND  = 0x01,
+RGN_OR   = 0x02,
+RGN_XOR  = 0x03,
+RGN_DIFF = 0x04,
+RGN_COPY = 0x05
+};
+
+/* [MS-EMF] - v20210625 - pages 40, 198 */
+enum class BackgroundMode : sal_uInt32
 {
 NONE = 0,
 Transparent = 1,
 OPAQUE = 2,
 };
-}
 
-/* xform stuff */
-#define MWT_IDENTITY1
-#define MWT_LEFTMULTIPLY2
-#define MWT_RIGHTMULTIPLY   3
-#define MWT_SET 4
-
-#define ENHMETA_STOCK_OBJECT0x8000
-
-/* Stock Logical Objects */
-#define WHITE_BRUSH 0
-#define LTGRAY_BRUSH1
-#define GRAY_BRUSH  2
-#define DKGRAY_BRUSH3
-#define BLACK_BRUSH 4
-#define NULL_BRUSH  5
-#define WHITE_PEN   6
-#define BLACK_PEN   7
-#define NULL_PEN8
-#define ANSI_FIXED_FONT 11
-#define ANSI_VAR_FONT   12
-#define SYSTEM_FIXED_FONT   16
+/* [MS-EMF] - v20210625 - pages 40, 210 */
+/* xform stuff */
+enum class ModifyWorldTransformMode : sal_uInt32
+{
+MWT_IDENTITY  = 0x01,
+MWT_LEFTMULTIPLY  = 0x02,
+MWT_RIGHTMULTIPLY = 0x03,
+MWT_SET   = 0x04
+};
+
+constexpr sal_uInt32 ENHMETA_STOCK_OBJECT = 0x8000;
 
-namespace emfio
-{
-enum class WMFRasterOp {
+/* [MS-EMF] - v20210625 - pages 44, 45, 182 */
+/* Stock Logical Objects */
+enum class StockObject : sal_uInt32
+{
+WHITE_BRUSH   = 0,
+LTGRAY_BRUSH  = 1,
+GRAY_BRUSH= 2,
+DKGRAY_BRUSH  = 3,
+BLACK_BRUSH   = 4,
+NULL_BRUSH= 5,
+WHITE_PEN = 6,
+BLACK_PEN = 7,
+NULL_PEN  = 8,
+ANSI_FIXED_FONT   = 11,
+ANSI_VAR_FONT = 12,
+SYSTEM_FIXED_FONT = 16
+};
+
+/* Note: This enum is incomplete compared to the specification */
+/* [MS-WMF] - v20210625 - pages 25-26 */
+enum class WMFRasterOp : sal_uInt16
+{
 NONE = 0,
 Black = 1,
 Not = 6,
@@ -84,35 +93,48 @@ namespace emfio
 Nop = 11,
 CopyPen = 13
 };
-}
 
-/* Mapping modes */
-#define MM_TEXT 1
-#define MM_LOMETRIC 2
-#define MM_HIMETRIC 3
-#define MM_LOENGLISH4
-#define MM_HIENGLISH5
-#define MM_TWIPS6
-#define MM_ISOTROPIC7
-#define MM_ANISOTROPIC  8
-
-/* Graphics modes */
-#define GM_COMPATIBLE   1
-#define GM_ADVANCED 2
-
-/* StretchBlt() modes */
-#define BLACKONWHITE1
-#define WHITEONBLACK2
-#define COLORONCOLOR3
-#define HALFTONE4
-#define STRETCH_ANDSCANSBLACKONWHITE
-#define STRETCH_ORSCANS WHITEONBLACK
-#define STRETCH_DELETESCANS COLORONCOLOR
-
-#define LF_FACESIZE 32
+/* Note: We have 

[Libreoffice-commits] core.git: emfio/README.md

2022-03-14 Thread Hossein (via logerrit)
 emfio/README.md |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 4d2d2f04288b87228511ff9afcdda691f103de16
Author: Hossein 
AuthorDate: Fri Mar 11 18:02:18 2022 +0100
Commit: Hossein 
CommitDate: Mon Mar 14 22:35:10 2022 +0100

Remove EMR_SETARCDIRECTION from unimplemented records

As EMR_SETARCDIRECTION record for EMF is now implemented in commit
7b28920382d3820344bfc4075bac98f85e838dba, it is now removed from
the unimplemented list of records for EMF.

Change-Id: Ib2931d339f924e813d243ba503d4b17aab0d6868
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131401
Tested-by: Jenkins
Reviewed-by: Hossein 

diff --git a/emfio/README.md b/emfio/README.md
index 4cbd9d45a4ad..665af1fa4e0c 100644
--- a/emfio/README.md
+++ b/emfio/README.md
@@ -55,7 +55,7 @@ records are marked as "not implemented", and a warning 
message will printed
 if they are actually read within a file. You can file a bug report for
 implementing these records.
 
-Currently, these records are not implemented (specified in
+Currently, these records are not implemented for WMF (specified in
 `wmfreader.cxx`):
 
 ```
@@ -69,12 +69,12 @@ W_META_RESETDC W_META_STARTDOC W_META_STARTPAGE 
W_META_ENDPAGE
 W_META_ABORTDOC W_META_ENDDOC
 ```
 
-And these records are not implemented (specified in `emfreader.cxx`):
+And these records are not implemented for EMF/EMF+ (specified in 
`emfreader.cxx`):
 
 ```
 EMR_MASKBLT EMR_PLGBLT EMR_SETDIBITSTODEVICE EMR_FRAMERGN
 EMR_INVERTRGN EMR_FLATTENPATH EMR_WIDENPATH EMR_POLYDRAW
-EMR_SETARCDIRECTION EMR_SETPALETTEENTRIES EMR_RESIZEPALETTE
+EMR_SETPALETTEENTRIES EMR_RESIZEPALETTE
 EMR_EXTFLOODFILL EMR_ANGLEARC EMR_SETCOLORADJUSTMENT EMR_POLYDRAW16
 EMR_CREATECOLORSPACE EMR_SETCOLORSPACE EMR_DELETECOLORSPACE
 EMR_GLSRECORD EMR_GLSBOUNDEDRECORD EMR_PIXELFORMAT EMR_DRAWESCAPE


[Libreoffice-commits] core.git: configure.ac

2022-03-08 Thread Hossein (via logerrit)
 configure.ac |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit abaac7a4c1b27d71c4e6f9cfb64900619a46f7f7
Author: Hossein 
AuthorDate: Sun Mar 6 14:02:48 2022 +0100
Commit: Michael Stahl 
CommitDate: Tue Mar 8 10:44:18 2022 +0100

tdf#147801 Demote bsdtar in favor of tar in configure.ac

The utility used to extract archives including tar.xz is chosen among
'gtar gnutar bsdtar tar' (respectively) that may be present in the
system PATH.
When compiling LibreOffice, there is a possiblity that some bad tools
that are available in the PATH are chosen incorrectly. As an example,
Anaconda on Windows provides a 'bsdtar' utility which can not handle
tar.xz files, but it is chosen as the archive extraction utility.

This patch demotes 'bsdtar' comapred to 'tar' in configure.ac to fix
the issue, which is filed as tdf#147801.

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

diff --git a/configure.ac b/configure.ac
index 3e65a8298aff..10529032c5fe 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2955,7 +2955,7 @@ fi
 AC_SUBST(COMPRESSIONTOOL)
 
 AC_MSG_CHECKING([for GNU or BSD tar])
-for a in $GNUTAR gtar gnutar bsdtar tar /usr/sfw/bin/gtar; do
+for a in $GNUTAR gtar gnutar tar bsdtar /usr/sfw/bin/gtar; do
 $a --version 2> /dev/null | egrep "GNU|bsdtar"  2>&1 > /dev/null
 if test $? -eq 0;  then
 GNUTAR=$a


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

2022-03-01 Thread Hossein (via logerrit)
 sax/source/fastparser/fastparser.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit d1cfe4228316322d0ae9f3b8020036e5140fc32b
Author: Hossein 
AuthorDate: Tue Mar 1 14:33:33 2022 +0100
Commit: Hossein 
CommitDate: Wed Mar 2 02:11:23 2022 +0100

Remove 'const' from for loop variable

In the commit f63a6f2e396fa41ed1338dcec874e06159cafa9f, a for loop is
converted into a range-based for loop. The pointer is used to change
the nodes using xmlUnlinkNode() and xmlFreeNode(), thus the 'const'
should have not been used.

The reinterpret_cast does not change the constness, thus I have
removed the const from the loop variable, and it will no longer be a
const reference.

Change-Id: If4c61017ea77f464230bb5802f6fc928acc7a7e3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130792
Tested-by: Jenkins
Reviewed-by: Hossein 

diff --git a/sax/source/fastparser/fastparser.cxx 
b/sax/source/fastparser/fastparser.cxx
index beb30443ba02..71b316378e01 100644
--- a/sax/source/fastparser/fastparser.cxx
+++ b/sax/source/fastparser/fastparser.cxx
@@ -674,7 +674,7 @@ FastSaxParserImpl::~FastSaxParserImpl()
 {
 if( mxDocumentLocator.is() )
 mxDocumentLocator->dispose();
-for (const auto& entity : m_TemporalEntities)
+for (auto& entity : m_TemporalEntities)
 {
 if (!entity)
 continue;


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

2022-03-01 Thread Hossein (via logerrit)
 sc/source/core/data/bcaslot.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit acc008c6600070837599c994e5552e66ec85c18c
Author: Hossein 
AuthorDate: Thu Feb 10 23:36:15 2022 +0100
Commit: Hossein 
CommitDate: Tue Mar 1 11:40:15 2022 +0100

Add asserts to make sure the calculation is correct

On Linux/gcc (Ubuntu 10.3.0-1ubuntu1~20.04), I was getting this
warning:

sc/source/core/data/bcaslot.cxx:647:25: warning: comparison of
unsigned expression in ‘>= 0’ is always true [-Wtype-limits]
  647 | assert(slot >= 0 && slot < mnBcaSlots);
  |~^~~~

slot variable is of type SCSIZE, which is defined as size_t in
sc/inc/address.hxx.

This is fixed in 405a7a09558ad17642808cc3739ab202f86bea0c. To make
sure the calculation of slot is OK, I have added these 2 asserts:

assert(nRow >= rSD.nStartRow);
assert(nCol >= rSD.nStartCol);

Change-Id: I731c1b6e913febde51fc16042d32c35950e707db
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129805
Tested-by: Jenkins
Reviewed-by: Hossein 

diff --git a/sc/source/core/data/bcaslot.cxx b/sc/source/core/data/bcaslot.cxx
index 65bc2600d475..09493963469c 100644
--- a/sc/source/core/data/bcaslot.cxx
+++ b/sc/source/core/data/bcaslot.cxx
@@ -639,6 +639,8 @@ inline SCSIZE ScBroadcastAreaSlotMachine::ComputeSlotOffset(
 {
 if (nRow < rSD.nStopRow && nCol < rSD.nStopCol)
 {
+assert(nRow >= rSD.nStartRow);
+assert(nCol >= rSD.nStartCol);
 SCSIZE slot = rSD.nCumulatedRow
 + static_cast(nRow - rSD.nStartRow) / rSD.nSliceRow
 + rSD.nCumulatedCol


[Libreoffice-commits] core.git: i18npool/CppunitTest_i18npool_breakiterator.mk i18npool/CppunitTest_i18npool_calendar.mk i18npool/CppunitTest_i18npool_characterclassification.mk i18npool/CppunitTest_i

2022-02-27 Thread Hossein (via logerrit)
 i18npool/CppunitTest_i18npool_breakiterator.mk|   37 ++
 i18npool/CppunitTest_i18npool_calendar.mk |   16 ++--
 i18npool/CppunitTest_i18npool_characterclassification.mk  |   31 
 i18npool/CppunitTest_i18npool_ordinalsuffix.mk|   12 +--
 i18npool/CppunitTest_i18npool_test_breakiterator.mk   |   37 --
 i18npool/CppunitTest_i18npool_test_characterclassification.mk |   31 
 i18npool/CppunitTest_i18npool_textsearch.mk   |   14 +--
 i18npool/Module_i18npool.mk   |   10 +-
 8 files changed, 94 insertions(+), 94 deletions(-)

New commits:
commit 637e7ddf1e3091191b6835c7f66c71f014dfaa19
Author: Hossein 
AuthorDate: Fri Feb 25 21:17:09 2022 +0100
Commit: Stephan Bergmann 
CommitDate: Mon Feb 28 08:49:26 2022 +0100

Remove redundant _test from i18npool/CppunitTest*

As suggested in , the
name of the CppunitTests contain a redundant '_test'. This patch
removes this additional word from the name of all the CppunitTests in
i18npool.

The new names for the tests in i18npool are:

CppunitTest_i18npool_break_iterator
CppunitTest_i18npool_calendar
CppunitTest_i18npool_characterclassification
CppunitTest_i18npool_defaultnumberingprovider (unchanged)
CppunitTest_i18npool_ordinalsuffix
CppunitTest_i18npool_textsearch

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

diff --git a/i18npool/CppunitTest_i18npool_breakiterator.mk 
b/i18npool/CppunitTest_i18npool_breakiterator.mk
new file mode 100644
index ..656d9aa75ccd
--- /dev/null
+++ b/i18npool/CppunitTest_i18npool_breakiterator.mk
@@ -0,0 +1,37 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_CppunitTest_CppunitTest,i18npool_break_iterator))
+
+$(eval $(call gb_CppunitTest_use_external,i18npool_break_iterator,icu_headers))
+
+$(eval $(call gb_CppunitTest_use_sdk_api,i18npool_break_iterator))
+
+$(eval $(call gb_CppunitTest_use_libraries,i18npool_break_iterator,\
+   cppu \
+   cppuhelper \
+   sal \
+   unotest \
+))
+
+$(eval $(call gb_CppunitTest_add_exception_objects,i18npool_break_iterator,\
+i18npool/qa/cppunit/test_breakiterator \
+))
+
+$(eval $(call gb_CppunitTest_use_ure,i18npool_break_iterator))
+
+$(eval $(call gb_CppunitTest_use_components,i18npool_break_iterator,\
+   i18npool/util/i18npool \
+))
+
+$(call gb_CppunitTest_get_target,i18npool_break_iterator) : \
+$(call gb_Library_get_target,dict_ja) \
+$(call gb_Library_get_target,dict_zh)
+
+# vim: set noet sw=4 ts=4:
diff --git a/i18npool/CppunitTest_i18npool_test_calendar.mk 
b/i18npool/CppunitTest_i18npool_calendar.mk
similarity index 52%
rename from i18npool/CppunitTest_i18npool_test_calendar.mk
rename to i18npool/CppunitTest_i18npool_calendar.mk
index 85a3b2fbb576..701dfec27db6 100644
--- a/i18npool/CppunitTest_i18npool_test_calendar.mk
+++ b/i18npool/CppunitTest_i18npool_calendar.mk
@@ -7,16 +7,16 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 #
 
-$(eval $(call gb_CppunitTest_CppunitTest,i18npool_test_calendar))
+$(eval $(call gb_CppunitTest_CppunitTest,i18npool_calendar))
 
-$(eval $(call gb_CppunitTest_set_include,i18npool_test_calendar,\
+$(eval $(call gb_CppunitTest_set_include,i18npool_calendar,\
 $$(INCLUDE) \
 -I$(SRCDIR)/i18npool/inc \
 ))
 
-$(eval $(call gb_CppunitTest_use_sdk_api,i18npool_test_calendar))
+$(eval $(call gb_CppunitTest_use_sdk_api,i18npool_calendar))
 
-$(eval $(call gb_CppunitTest_use_libraries,i18npool_test_calendar,\
+$(eval $(call gb_CppunitTest_use_libraries,i18npool_calendar,\
cppu \
cppuhelper \
sal \
@@ -24,19 +24,19 @@ $(eval $(call 
gb_CppunitTest_use_libraries,i18npool_test_calendar,\
 i18npool \
 ))
 
-$(eval $(call gb_CppunitTest_use_externals,i18npool_test_calendar,\
+$(eval $(call gb_CppunitTest_use_externals,i18npool_calendar,\
 icui18n \
 icuuc \
 icu_headers \
 ))
 
-$(eval $(call gb_CppunitTest_add_exception_objects,i18npool_test_calendar,\
+$(eval $(call gb_CppunitTest_add_exception_objects,i18npool_calendar,\
 i18npool/qa/cppunit/test_calendar \
 ))
 
-$(eval $(call gb_CppunitTest_use_ure,i18npool_test_calendar))
+$(eval $(call gb_CppunitTest_use_ure,i18npool_calendar))
 
-$(eval $(call gb_CppunitTest_use_components,i18npool_test_calendar,\
+$(eval $(call gb_CppunitTest_use_components,i18npool_calendar,\
i18npool/util/i18npool \
 ))
 
diff --git 

[Libreoffice-commits] core.git: xmlsecurity/README.md

2022-02-25 Thread Hossein (via logerrit)
 xmlsecurity/README.md |   32 ++--
 1 file changed, 30 insertions(+), 2 deletions(-)

New commits:
commit ad65aa4391e00ee578595d0301f572f7384c1612
Author: Hossein 
AuthorDate: Mon Feb 21 17:10:49 2022 +0100
Commit: Hossein 
CommitDate: Fri Feb 25 23:59:56 2022 +0100

Add documentation for xmlsecurity

* Add basic information
* Add some references

Change-Id: Id036c23f90f53c36052b155f62f68ee0266f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130289
Tested-by: Jenkins
Reviewed-by: Hossein 

diff --git a/xmlsecurity/README.md b/xmlsecurity/README.md
index 796094901112..b983f5dc5eb5 100644
--- a/xmlsecurity/README.md
+++ b/xmlsecurity/README.md
@@ -1,4 +1,32 @@
 # Stuff for Document Signing
 
-This code provides dialogs, and infrastructure wrapping `libxmlsec` and 
`gpgme` that
-implements document signing.
+This code provides dialogs, and infrastructure wrapping `libxmlsec` and
+`gpgme` that implements document signing.
+
+For signing a document, a personal key pair is used, which consists of a
+private key and a public key, which is added to the document in addition
+to the digital signature of the document, when signing it.
+
+The document signing can be done both for the source ODF/OOXML files and
+the exported PDF files. It is also possible to sign existing PDF files.
+
+To test the signed PDFs, one can use the `pdfverify` in this way:
+
+./bin/run pdfverify $PWD/xmlsecurity/qa/unit/pdfsigning/data/2good.pdf
+
+The file parameter should be an absolute path.
+
+This is the output of `pdfverify` for `2good.pdf`:
+
+```
+verifying signatures
+found 2 signatures
+signature #0: digest match? 1
+signature #0: partial? 0
+signature #1: digest match? 1
+signature #1: partial? 0
+```
+
+## References
+* [Adobe: Digital Signatures in a 
PDF](https://www.adobe.com/devnet-docs/etk_deprecated/tools/DigSig/Acrobat\_DigitalSignatures_in_PDF.pdf)
+* [Adobe: Acrobat DC Digital Signatures - Supported 
Standards](https://www.adobe.com/devnet-docs/acrobatetk/tools/DigSigDC/standards.html)


[Libreoffice-commits] core.git: connectivity/source i18npool/CppunitTest_i18npool_test_calendar.mk i18npool/inc i18npool/Module_i18npool.mk i18npool/qa i18npool/source include/i18nutil

2022-02-25 Thread Hossein (via logerrit)
 connectivity/source/drivers/dbase/DTable.cxx   |9 -
 i18npool/CppunitTest_i18npool_test_calendar.mk |   43 
 i18npool/Module_i18npool.mk|1 
 i18npool/inc/calendar_hijri.hxx|   12 +-
 i18npool/qa/cppunit/test_calendar.cxx  |  130 +
 i18npool/source/calendar/calendar_hijri.cxx|8 -
 include/i18nutil/calendar.hxx  |   23 
 7 files changed, 212 insertions(+), 14 deletions(-)

New commits:
commit 0308e48e46cee2f56a6239c8479d26185146d74a
Author: Hossein 
AuthorDate: Fri Feb 25 00:22:11 2022 +0100
Commit: Eike Rathke 
CommitDate: Fri Feb 25 19:12:41 2022 +0100

tdf#145759 30.6001 -> monthDaysWithoutJanFeb

30.6001 shows month days without Jan and Feb.
According to the below link, it is calcuated as (365-31-28)/10 = 30.6
but because of a floating point bug, it was used as 30.6001 as a
workaround.

"30.6001, 25 year old hack?"
https://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/archv011.cgi?read=31650

The value 30.6 is used as i18nutil::monthDaysWithoutJanFeb here
instead of 30.6001. The new value is ~30.6038 which is > 30.6, so
the calculations should be correct. In order to make sure, a unit test
is added, and part of the values are checked against the values
calculated by this website:

Julian Day and Civil Date Calculator
https://core2.gsfc.nasa.gov/time/julian.html

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

diff --git a/connectivity/source/drivers/dbase/DTable.cxx 
b/connectivity/source/drivers/dbase/DTable.cxx
index 0f8f72328a0b..d7a5b1c458a6 100644
--- a/connectivity/source/drivers/dbase/DTable.cxx
+++ b/connectivity/source/drivers/dbase/DTable.cxx
@@ -54,6 +54,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -132,13 +133,13 @@ void lcl_CalcJulDate(sal_Int32& _nJulianDate,sal_Int32& 
_nJulianTime, const css:
 if ( aDateTime.Year <= 0 )
 {
 _nJulianDate = static_cast((365.25 * iy0) - 0.75)
-+ static_cast(30.6001 * (im0 + 1) )
++ static_cast(i18nutil::monthDaysWithoutJanFeb * (im0 + 
1) )
 + aDateTime.Day + 1720994;
 } // if ( rDateTime.Year <= 0 )
 else
 {
 _nJulianDate = static_cast(365.25 * iy0)
-+ static_cast(30.6001 * (im0 + 1))
++ static_cast(i18nutil::monthDaysWithoutJanFeb * (im0 + 
1))
 + aDateTime.Day + 1720994;
 }
 double JD = _nJulianDate + 0.5;
@@ -164,8 +165,8 @@ void lcl_CalDate(sal_Int32 _nJulianDate,sal_Int32 
_nJulianTime,css::util::DateTi
 sal_Int64 kb = ka + 1524;
 sal_Int64 kc = static_cast((static_cast(kb) - 
122.1) / 365.25);
 sal_Int64 kd = static_cast(static_cast(kc) * 
365.25);
-sal_Int64 ke = static_cast(static_cast(kb - kd) / 
30.6001);
-_rDateTime.Day = static_cast(kb - kd - 
static_cast( static_cast(ke) * 30.6001 ));
+sal_Int64 ke = static_cast(static_cast(kb - kd) / 
i18nutil::monthDaysWithoutJanFeb);
+_rDateTime.Day = static_cast(kb - kd - 
static_cast( static_cast(ke) * 
i18nutil::monthDaysWithoutJanFeb ));
 if ( ke > 13 )
 _rDateTime.Month = static_cast(ke - 13);
 else
diff --git a/i18npool/CppunitTest_i18npool_test_calendar.mk 
b/i18npool/CppunitTest_i18npool_test_calendar.mk
new file mode 100644
index ..85a3b2fbb576
--- /dev/null
+++ b/i18npool/CppunitTest_i18npool_test_calendar.mk
@@ -0,0 +1,43 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t; fill-column: 
100 -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_CppunitTest_CppunitTest,i18npool_test_calendar))
+
+$(eval $(call gb_CppunitTest_set_include,i18npool_test_calendar,\
+$$(INCLUDE) \
+-I$(SRCDIR)/i18npool/inc \
+))
+
+$(eval $(call gb_CppunitTest_use_sdk_api,i18npool_test_calendar))
+
+$(eval $(call gb_CppunitTest_use_libraries,i18npool_test_calendar,\
+   cppu \
+   cppuhelper \
+   sal \
+   unotest \
+i18npool \
+))
+
+$(eval $(call gb_CppunitTest_use_externals,i18npool_test_calendar,\
+icui18n \
+icuuc \
+icu_headers \
+))
+
+$(eval $(call gb_CppunitTest_add_exception_objects,i18npool_test_calendar,\
+i18npool/qa/cppunit/test_calendar \
+))
+
+$(eval $(call gb_CppunitTest_use_ure,i18npool_test_calendar))
+
+$(eval $(call gb_CppunitTest_use_components,i18npool_test_calendar,\
+   i18npool/util/i18npool \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/i18npool/Module_i18npool.mk b/i18npool/Module_i18npool.mk
index 271c751081da..1926fdd70d82 100644
--- 

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

2022-02-21 Thread Hossein (via logerrit)
 xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx |   36 +-
 1 file changed, 14 insertions(+), 22 deletions(-)

New commits:
commit 02e1be8883a08ab17f3e890a834ab88f13c5867d
Author: Hossein 
AuthorDate: Sun Feb 20 18:15:55 2022 +0100
Commit: Mike Kaganski 
CommitDate: Mon Feb 21 20:55:45 2022 +0100

Cleanup x509certificate_nssimpl.cxx

* Remove unused headers
* Remove 'using namespace'
* Use enum values in the condition

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

diff --git a/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx 
b/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx
index 2d52134344fb..bf1da39b3fec 100644
--- a/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx
+++ b/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx
@@ -21,11 +21,8 @@
 #include 
 
 #include 
-#include 
-#include 
 #include 
 
-#include 
 #include 
 #include 
 #include 
@@ -41,12 +38,7 @@
 #include 
 #include 
 
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno ;
-using namespace ::com::sun::star::security ;
-
-using ::com::sun::star::security::XCertificate ;
-using ::com::sun::star::util::DateTime ;
+using ::css::util::DateTime;
 
 X509Certificate_NssImpl::X509Certificate_NssImpl() :
 m_pCert(nullptr)
@@ -104,7 +96,7 @@ css::util::DateTime SAL_CALL 
X509Certificate_NssImpl::getNotValidBefore() {
 DateTime dateTime ;
 
 rv = DER_DecodeTimeChoice( , _pCert->validity.notBefore ) ;
-if( rv ) {
+if( rv != SECStatus::SECSuccess ) {
 return DateTime() ;
 }
 
@@ -133,7 +125,7 @@ css::util::DateTime SAL_CALL 
X509Certificate_NssImpl::getNotValidAfter() {
 DateTime dateTime ;
 
 rv = DER_DecodeTimeChoice( , _pCert->validity.notAfter ) ;
-if( rv ) {
+if( rv != SECStatus::SECSuccess ) {
 return DateTime() ;
 }
 
@@ -177,7 +169,7 @@ css::uno::Sequence< css::uno::Reference< 
css::security::XCertificateExtension >
 int len ;
 
 for( len = 0, extns = m_pCert->extensions; *extns != nullptr; len ++, 
extns ++ ) ;
-Sequence< Reference< XCertificateExtension > > xExtns( len ) ;
+css::uno::Sequence< css::uno::Reference< 
css::security::XCertificateExtension > > xExtns( len ) ;
 auto xExtnsRange = asNonConstRange(xExtns);
 
 for( extns = m_pCert->extensions, len = 0; *extns != nullptr; extns 
++, len ++ ) {
@@ -301,7 +293,7 @@ const CERTCertificate* 
X509Certificate_NssImpl::getNssCert() const {
 }
 }
 
-void X509Certificate_NssImpl::setRawCert( const Sequence< sal_Int8 >& rawCert 
) {
+void X509Certificate_NssImpl::setRawCert( const css::uno::Sequence< sal_Int8 
>& rawCert ) {
 CERTCertificate* cert ;
 SECItem certItem ;
 
@@ -310,7 +302,7 @@ void X509Certificate_NssImpl::setRawCert( const Sequence< 
sal_Int8 >& rawCert )
 
 cert = CERT_DecodeDERCertificate( , PR_TRUE, nullptr ) ;
 if( cert == nullptr )
-throw RuntimeException() ;
+throw css::uno::RuntimeException() ;
 
 if( m_pCert != nullptr ) {
 CERT_DestroyCertificate( m_pCert ) ;
@@ -332,13 +324,13 @@ SECKEYPrivateKey* X509Certificate_NssImpl::getPrivateKey()
 }
 
 /* XUnoTunnel */
-sal_Int64 SAL_CALL X509Certificate_NssImpl::getSomething( const Sequence< 
sal_Int8 >& aIdentifier ) {
+sal_Int64 SAL_CALL X509Certificate_NssImpl::getSomething( const 
css::uno::Sequence< sal_Int8 >& aIdentifier ) {
 return comphelper::getSomethingImpl(aIdentifier, this);
 }
 
 /* XUnoTunnel extension */
 
-const Sequence< sal_Int8>& X509Certificate_NssImpl::getUnoTunnelId() {
+const css::uno::Sequence< sal_Int8>& X509Certificate_NssImpl::getUnoTunnelId() 
{
 static const comphelper::UnoIdInit theX509Certificate_NssImplUnoTunnelId;
 return theX509Certificate_NssImplUnoTunnelId.getSeq();
 }
@@ -377,7 +369,7 @@ static css::uno::Sequence< sal_Int8 > 
getThumbprint(CERTCertificate const *pCert
 
 memset(fingerprint, 0, sizeof fingerprint);
 rv = PK11_HashBuf(id, fingerprint, pCert->derCert.data, 
pCert->derCert.len);
-if(rv == SECSuccess)
+if(rv == SECStatus::SECSuccess)
 {
 return comphelper::arrayToSequence(fingerprint, length);
 }
@@ -444,7 +436,7 @@ css::uno::Sequence< sal_Int8 > SAL_CALL 
X509Certificate_NssImpl::getSHA1Thumbpri
 return getThumbprint(m_pCert, SEC_OID_SHA1);
 }
 
-uno::Sequence X509Certificate_NssImpl::getSHA256Thumbprint()
+css::uno::Sequence X509Certificate_NssImpl::getSHA256Thumbprint()
 {
 return getThumbprint(m_pCert, SEC_OID_SHA256);
 }
@@ -454,9 +446,9 @@ css::uno::Sequence< sal_Int8 > SAL_CALL 
X509Certificate_NssImpl::getMD5Thumbprin
 return getThumbprint(m_pCert, SEC_OID_MD5);
 }
 
-CertificateKind SAL_CALL X509Certificate_NssImpl::getCertificateKind()

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

2022-02-09 Thread Hossein (via logerrit)
 editeng/source/items/frmitems.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit a5c6fbe247ee9f9b2fba828d1360748c3fe4642b
Author: Hossein 
AuthorDate: Tue Feb 8 15:13:58 2022 +0100
Commit: Hossein 
CommitDate: Wed Feb 9 23:17:35 2022 +0100

tdf#147021 Use std::size() instead of SAL_N_ELEMENTS() macro

The signed loop index variable of type 'int' is converted into
'size_t' to match the return value of std::size() which is unsigned

Change-Id: I39170c487a46aed0370d987f6ec94949c71509cd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129676
Tested-by: Jenkins
Reviewed-by: Hossein 

diff --git a/editeng/source/items/frmitems.cxx 
b/editeng/source/items/frmitems.cxx
index ba55d734515c..bd9840cfde0a 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -1560,7 +1560,7 @@ bool SvxBoxItem::PutValue( const uno::Any& rVal, 
sal_uInt8 nMemberId )
 {
 // 4 Borders and 5 distances
 const SvxBoxItemLine aBorders[] = { SvxBoxItemLine::LEFT, 
SvxBoxItemLine::RIGHT, SvxBoxItemLine::BOTTOM, SvxBoxItemLine::TOP };
-for (int n(0); n != SAL_N_ELEMENTS(aBorders); ++n)
+for (size_t n(0); n != std::size(aBorders); ++n)
 {
 if (!lcl_setLine(aSeq[n], *this, aBorders[n], bConvert))
 return false;
@@ -2583,7 +2583,7 @@ OUString SvxFormatBreakItem::GetValueTextByPos( 
sal_uInt16 nPos )
 RID_SVXITEMS_BREAK_PAGE_AFTER,
 RID_SVXITEMS_BREAK_PAGE_BOTH
 };
-static_assert(SAL_N_ELEMENTS(RID_SVXITEMS_BREAK) == size_t(SvxBreak::End), 
"unexpected size");
+static_assert(std::size(RID_SVXITEMS_BREAK) == size_t(SvxBreak::End), 
"unexpected size");
 assert(nPos < sal_uInt16(SvxBreak::End) && "enum overflow!");
 return EditResId(RID_SVXITEMS_BREAK[nPos]);
 }


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

2022-01-10 Thread Hossein (via logerrit)
 i18nlangtag/qa/cppunit/test_languagetag.cxx |   95 
 1 file changed, 95 insertions(+)

New commits:
commit 98eea4c8c73a05114ec831a18ef8b3eed9a574da
Author: Hossein 
AuthorDate: Sun Jan 9 15:03:45 2022 +0100
Commit: Eike Rathke 
CommitDate: Mon Jan 10 13:28:54 2022 +0100

tdf#146084 Test for languages without hyphenation

Add test for languages without hyphenation. The fix can be tested with:

make CPPUNIT_TEST_NAME="testLanguagesWithoutHyphenation" -sr \
CppunitTest_i18nlangtag_test_languagetag

It is important to know that Kurdish language consists of different
dialects with differences in hyphenation:

1. Central Kurdish (Sorani): Arabic script, no hyphenation
2. Northern Kurdish (Kurmanji): Latin script, uses hyphenation
3. Southern Kurdish (Xwarîn): Arabic script, no hyphenation

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

diff --git a/i18nlangtag/qa/cppunit/test_languagetag.cxx 
b/i18nlangtag/qa/cppunit/test_languagetag.cxx
index 84e363d01eb4..d9f7563a635b 100644
--- a/i18nlangtag/qa/cppunit/test_languagetag.cxx
+++ b/i18nlangtag/qa/cppunit/test_languagetag.cxx
@@ -35,11 +35,13 @@ public:
 void testAllTags();
 void testAllIsoLangEntries();
 void testDisplayNames();
+void testLanguagesWithoutHyphenation();
 
 CPPUNIT_TEST_SUITE(TestLanguageTag);
 CPPUNIT_TEST(testAllTags);
 CPPUNIT_TEST(testAllIsoLangEntries);
 CPPUNIT_TEST(testDisplayNames);
+CPPUNIT_TEST(testLanguagesWithoutHyphenation);
 CPPUNIT_TEST_SUITE_END();
 };
 
@@ -878,6 +880,99 @@ void TestLanguageTag::testDisplayNames()
 CPPUNIT_ASSERT_EQUAL( OUString("*"), aStr);
 }
 
+void TestLanguageTag::testLanguagesWithoutHyphenation()
+{
+// Arabic
+CPPUNIT_ASSERT(!MsLangId::usesHyphenation(LANGUAGE_ARABIC_PRIMARY_ONLY));
+CPPUNIT_ASSERT(!MsLangId::usesHyphenation(LANGUAGE_ARABIC_ALGERIA));
+CPPUNIT_ASSERT(!MsLangId::usesHyphenation(LANGUAGE_ARABIC_BAHRAIN));
+CPPUNIT_ASSERT(!MsLangId::usesHyphenation(LANGUAGE_ARABIC_EGYPT));
+CPPUNIT_ASSERT(!MsLangId::usesHyphenation(LANGUAGE_ARABIC_IRAQ));
+CPPUNIT_ASSERT(!MsLangId::usesHyphenation(LANGUAGE_ARABIC_JORDAN));
+CPPUNIT_ASSERT(!MsLangId::usesHyphenation(LANGUAGE_ARABIC_KUWAIT));
+CPPUNIT_ASSERT(!MsLangId::usesHyphenation(LANGUAGE_ARABIC_LEBANON));
+CPPUNIT_ASSERT(!MsLangId::usesHyphenation(LANGUAGE_ARABIC_LIBYA));
+CPPUNIT_ASSERT(!MsLangId::usesHyphenation(LANGUAGE_ARABIC_MOROCCO));
+CPPUNIT_ASSERT(!MsLangId::usesHyphenation(LANGUAGE_ARABIC_OMAN));
+CPPUNIT_ASSERT(!MsLangId::usesHyphenation(LANGUAGE_ARABIC_QATAR));
+CPPUNIT_ASSERT(!MsLangId::usesHyphenation(LANGUAGE_ARABIC_SAUDI_ARABIA));
+CPPUNIT_ASSERT(!MsLangId::usesHyphenation(LANGUAGE_ARABIC_SYRIA));
+CPPUNIT_ASSERT(!MsLangId::usesHyphenation(LANGUAGE_ARABIC_TUNISIA));
+CPPUNIT_ASSERT(!MsLangId::usesHyphenation(LANGUAGE_ARABIC_UAE));
+CPPUNIT_ASSERT(!MsLangId::usesHyphenation(LANGUAGE_ARABIC_YEMEN));
+
+// Pashto
+CPPUNIT_ASSERT(!MsLangId::usesHyphenation(LANGUAGE_PASHTO));
+
+// Persian/Farsi
+CPPUNIT_ASSERT(!MsLangId::usesHyphenation(LANGUAGE_FARSI));
+
+// Kashmiri
+CPPUNIT_ASSERT(!MsLangId::usesHyphenation(LANGUAGE_KASHMIRI));
+CPPUNIT_ASSERT(!MsLangId::usesHyphenation(LANGUAGE_KASHMIRI_INDIA));
+
+// Central Kurdish (Sorani), uses Arabic script, does not have hyphenation
+CPPUNIT_ASSERT(!MsLangId::usesHyphenation(LANGUAGE_KURDISH_ARABIC_IRAQ));
+CPPUNIT_ASSERT(!MsLangId::usesHyphenation(LANGUAGE_KURDISH_ARABIC_LSO));
+
+// Northern Kurdish (Kurmanji) -> uses Latin scrit, has hyphenation
+CPPUNIT_ASSERT(MsLangId::usesHyphenation(LANGUAGE_USER_KURDISH_SYRIA));
+CPPUNIT_ASSERT(MsLangId::usesHyphenation(LANGUAGE_USER_KURDISH_TURKEY));
+
+// Southern Kurdish -> uses Arabic script, does not have hyphenation
+
CPPUNIT_ASSERT(!MsLangId::usesHyphenation(LANGUAGE_USER_KURDISH_SOUTHERN_IRAN));
+
CPPUNIT_ASSERT(!MsLangId::usesHyphenation(LANGUAGE_USER_KURDISH_SOUTHERN_IRAQ));
+
+// Punjabi
+CPPUNIT_ASSERT(!MsLangId::usesHyphenation(LANGUAGE_PUNJABI));
+CPPUNIT_ASSERT(!MsLangId::usesHyphenation(LANGUAGE_PUNJABI_ARABIC_LSO));
+CPPUNIT_ASSERT(!MsLangId::usesHyphenation(LANGUAGE_PUNJABI_PAKISTAN));
+
+// Sindhi
+CPPUNIT_ASSERT(!MsLangId::usesHyphenation(LANGUAGE_SINDHI));
+CPPUNIT_ASSERT(!MsLangId::usesHyphenation(LANGUAGE_SINDHI_ARABIC_LSO));
+CPPUNIT_ASSERT(!MsLangId::usesHyphenation(LANGUAGE_SINDHI_PAKISTAN));
+
+// Malai
+
CPPUNIT_ASSERT(!MsLangId::usesHyphenation(LANGUAGE_MALAY_BRUNEI_DARUSSALAM));
+CPPUNIT_ASSERT(!MsLangId::usesHyphenation(LANGUAGE_MALAY_MALAYSIA));
+
CPPUNIT_ASSERT(!MsLangId::usesHyphenation(LANGUAGE_USER_MALAY_ARABIC_BRUNEI));
+

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

2022-01-09 Thread Hossein (via logerrit)
 i18nlangtag/source/isolang/mslangid.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 4b0b5adf22ee479258a2625d6d12d81160f247d0
Author: Hossein 
AuthorDate: Sun Jan 9 16:58:29 2022 +0100
Commit: Adolfo Jayme Barrientos 
CommitDate: Sun Jan 9 21:14:23 2022 +0100

tdf#146084 No hyphenation warning for Pashto

Pashto language, which is spoken in Afghanistan and Pakistan uses the
Arabic script, and does not use hyphenation.

Change-Id: I87a1235b183055b0961ab27f45281be7aa9965c3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128191
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos 
(cherry picked from commit 7ac5ee3546e15455c5ee306af234bb7fe8a29049)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128148

diff --git a/i18nlangtag/source/isolang/mslangid.cxx 
b/i18nlangtag/source/isolang/mslangid.cxx
index 661bebcb6956..83d21b596de9 100644
--- a/i18nlangtag/source/isolang/mslangid.cxx
+++ b/i18nlangtag/source/isolang/mslangid.cxx
@@ -179,6 +179,7 @@ bool MsLangId::usesHyphenation(LanguageType nLang)
 primary(LANGUAGE_SOMALI),
 primary(LANGUAGE_SWAHILI),
 primary(LANGUAGE_URDU_PAKISTAN),
+primary(LANGUAGE_PASHTO),
 primary(LANGUAGE_VIETNAMESE))
 || isCJK(nLang))
 {


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

2022-01-09 Thread Hossein (via logerrit)
 i18nlangtag/source/isolang/mslangid.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 7ac5ee3546e15455c5ee306af234bb7fe8a29049
Author: Hossein 
AuthorDate: Sun Jan 9 16:58:29 2022 +0100
Commit: Adolfo Jayme Barrientos 
CommitDate: Sun Jan 9 18:50:23 2022 +0100

tdf#146084 No hyphenation warning for Pashto

Pashto language, which is spoken in Afghanistan and Pakistan uses the
Arabic script, and does not use hyphenation.

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

diff --git a/i18nlangtag/source/isolang/mslangid.cxx 
b/i18nlangtag/source/isolang/mslangid.cxx
index 0143ea228596..34c55b66e261 100644
--- a/i18nlangtag/source/isolang/mslangid.cxx
+++ b/i18nlangtag/source/isolang/mslangid.cxx
@@ -179,6 +179,7 @@ bool MsLangId::usesHyphenation(LanguageType nLang)
 primary(LANGUAGE_SOMALI),
 primary(LANGUAGE_SWAHILI),
 primary(LANGUAGE_URDU_PAKISTAN),
+primary(LANGUAGE_PASHTO),
 primary(LANGUAGE_VIETNAMESE))
 || isCJK(nLang))
 {


  1   2   >