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

2023-04-03 Thread Andreas Heinisch (via logerrit)
 sc/qa/extras/macros-test.cxx|   26 ++
 sc/qa/extras/testdocuments/tdf89920.ods |binary
 sc/source/core/data/table6.cxx  |   15 ---
 3 files changed, 30 insertions(+), 11 deletions(-)

New commits:
commit 56ae7d01505fdae421109cfc78449230ba589d79
Author: Andreas Heinisch 
AuthorDate: Mon Mar 13 08:49:27 2023 +0100
Commit: Andreas Heinisch 
CommitDate: Mon Apr 3 08:43:06 2023 +0200

tdf#89920 - Handle embedded newline in Calc's search cell

If the replaced string contains a newline after find and replace,
insert an edit cell in order to handle an embedded line correctly
regardless of the content in the source cell.

Change-Id: Ic8a5fc80b85546897572a228511b319cd5a8b9aa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148752
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 

diff --git a/sc/qa/extras/macros-test.cxx b/sc/qa/extras/macros-test.cxx
index a77147504ae4..ec41a2fbe4a9 100644
--- a/sc/qa/extras/macros-test.cxx
+++ b/sc/qa/extras/macros-test.cxx
@@ -279,6 +279,32 @@ CPPUNIT_TEST_FIXTURE(ScMacrosTest, testTdf142033)
 CPPUNIT_ASSERT_EQUAL(OUString(u"string with" + OUStringChar(u'\xA') + 
u"newlines"), rDoc.GetString(ScAddress(1,1,0)));
 }
 
+CPPUNIT_TEST_FIXTURE(ScMacrosTest, testTdf89920)
+{
+loadFromURL(u"tdf89920.ods");
+
+
executeMacro("vnd.sun.Star.script:Standard.Module1.SearchAndReplaceNewline?language=Basic&"
+ "location=document");
+
+// Export to ODS
+saveAndReload("calc8");
+
+xmlDocUniquePtr pContentXml = parseExport("content.xml");
+CPPUNIT_ASSERT(pContentXml);
+
+assertXPathContent(pContentXml,
+   
"/office:document-content/office:body/office:spreadsheet/table:table[1]/"
+   "table:table-row[1]/table:table-cell[1]/text:p[1]",
+   "aa bb");
+
+// Without the fix in place, this test would have failed here with
+// - Expression: xmlXPathNodeSetGetLength(pXmlNodes) > 0
+assertXPathContent(pContentXml,
+   
"/office:document-content/office:body/office:spreadsheet/table:table[1]/"
+   "table:table-row[1]/table:table-cell[1]/text:p[2]",
+   "cc dd");
+}
+
 CPPUNIT_TEST_FIXTURE(ScMacrosTest, testPasswordProtectedUnicodeString)
 {
 const OUString sCorrectString(u"English Русский 中文");
diff --git a/sc/qa/extras/testdocuments/tdf89920.ods 
b/sc/qa/extras/testdocuments/tdf89920.ods
new file mode 100644
index ..216a5cc75d9d
Binary files /dev/null and b/sc/qa/extras/testdocuments/tdf89920.ods differ
diff --git a/sc/source/core/data/table6.cxx b/sc/source/core/data/table6.cxx
index 1f0fc1efbf3d..1ea4a5ace99d 100644
--- a/sc/source/core/data/table6.cxx
+++ b/sc/source/core/data/table6.cxx
@@ -35,14 +35,11 @@
 
 namespace {
 
-bool lcl_GetTextWithBreaks( const EditTextObject& rData, ScDocument* pDoc, 
OUString& rVal )
+void lcl_GetTextWithBreaks( const EditTextObject& rData, ScDocument* pDoc, 
OUString& rVal )
 {
-//  true = more than 1 paragraph
-
 EditEngine& rEngine = pDoc->GetEditEngine();
 rEngine.SetText(rData);
 rVal = rEngine.GetText();
-return ( rEngine.GetParagraphCount() > 1 );
 }
 
 }
@@ -81,7 +78,6 @@ bool ScTable::SearchCell(const SvxSearchItem& rSearchItem, 
SCCOL nCol, sc::Colum
 pNote = nullptr;
 }
 
-bool bMultiLine = false;
 CellType eCellType = aCell.getType();
 switch (rSearchItem.GetCellType())
 {
@@ -90,7 +86,7 @@ bool ScTable::SearchCell(const SvxSearchItem& rSearchItem, 
SCCOL nCol, sc::Colum
 if ( eCellType == CELLTYPE_FORMULA )
 aString = 
aCell.getFormula()->GetFormula(rDocument.GetGrammar());
 else if ( eCellType == CELLTYPE_EDIT )
-bMultiLine = lcl_GetTextWithBreaks(*aCell.getEditText(), 
, aString);
+lcl_GetTextWithBreaks(*aCell.getEditText(), , 
aString);
 else
 {
 if( !bSearchFormatted )
@@ -102,7 +98,7 @@ bool ScTable::SearchCell(const SvxSearchItem& rSearchItem, 
SCCOL nCol, sc::Colum
 }
 case SvxSearchCellType::VALUE:
 if ( eCellType == CELLTYPE_EDIT )
-bMultiLine = lcl_GetTextWithBreaks(*aCell.getEditText(), 
, aString);
+lcl_GetTextWithBreaks(*aCell.getEditText(), , 
aString);
 else
 {
 if( !bSearchFormatted )
@@ -114,10 +110,7 @@ bool ScTable::SearchCell(const SvxSearchItem& rSearchItem, 
SCCOL nCol, sc::Colum
 case SvxSearchCellType::NOTE:
 {
 if (pNote)
-{
 aString = pNote->GetText();
-bMultiLine = pNote->HasMultiLineText();
-}
 break;
 }
 default:
@@ -264,7 +257,7 @@ bool ScTable::SearchCell(const SvxSearchItem& rSearchItem, 
SCCOL nCol, sc::Colum
 pFCell->SetMatColsRows( nMatCols, nMatRows 

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

2023-03-31 Thread Andreas Heinisch (via logerrit)
 sc/qa/unit/subsequent_export_test2.cxx |   25 +
 sc/source/filter/xml/xmlexprt.cxx  |6 --
 2 files changed, 29 insertions(+), 2 deletions(-)

New commits:
commit 0aa559589035d496a5b80d0986b4cddf02437bab
Author: Andreas Heinisch 
AuthorDate: Wed Mar 29 16:53:48 2023 +0200
Commit: Xisco Fauli 
CommitDate: Fri Mar 31 09:23:44 2023 +

tdf#154445 - Export all page styles even if they are not in use

Change-Id: If0ca5ea97ad545058c6a70d223158a87bf9207ff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149729
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 
(cherry picked from commit 8085a68be7604e7bd4e0d9445be5e266ffbb)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149735
Reviewed-by: Xisco Fauli 

diff --git a/sc/qa/unit/subsequent_export_test2.cxx 
b/sc/qa/unit/subsequent_export_test2.cxx
index ce7ac0c43d2f..f97dc4b643d3 100644
--- a/sc/qa/unit/subsequent_export_test2.cxx
+++ b/sc/qa/unit/subsequent_export_test2.cxx
@@ -23,6 +23,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 #include 
 #include 
@@ -147,6 +149,7 @@ public:
 void testTdf121718_UseFirstPageNumberXLSX();
 void testHeaderFontStyleXLSX();
 void testTdf135828_Shape_Rect();
+void testTdf154445_unused_pagestyles();
 void testTdf123139XLSX();
 void testTdf123353();
 void testTdf140098();
@@ -276,6 +279,7 @@ public:
 CPPUNIT_TEST(testTdf121718_UseFirstPageNumberXLSX);
 CPPUNIT_TEST(testHeaderFontStyleXLSX);
 CPPUNIT_TEST(testTdf135828_Shape_Rect);
+CPPUNIT_TEST(testTdf154445_unused_pagestyles);
 CPPUNIT_TEST(testTdf123139XLSX);
 CPPUNIT_TEST(testTdf123353);
 CPPUNIT_TEST(testTdf140098);
@@ -1889,6 +1893,27 @@ void ScExportTest2::testTdf135828_Shape_Rect()
 CPPUNIT_ASSERT_DOUBLES_EQUAL(1988280, nHeight, 1);
 }
 
+void ScExportTest2::testTdf154445_unused_pagestyles()
+{
+createScDoc("ods/tdf108188_pagestyle.ods");
+
+// Check if the user defined page style is present
+const OUString aTestPageStyle = "TestPageStyle";
+ScDocument* pDoc = getScDoc();
+CPPUNIT_ASSERT_EQUAL(aTestPageStyle, pDoc->GetPageStyle(0));
+
+// Change page style to default so the user defined one is not used anymore
+pDoc->SetPageStyle(0, ScResId(STR_STYLENAME_STANDARD));
+
+// Save and reload the document to check if the unused page styles are 
still present
+saveAndReload("calc8");
+pDoc = getScDoc();
+
+// Without the accompanying fix in place, the unused page styles don't 
exist anymore
+ScStyleSheetPool* pStylePool = pDoc->GetStyleSheetPool();
+CPPUNIT_ASSERT(pStylePool->Find(aTestPageStyle, SfxStyleFamily::Page));
+}
+
 void ScExportTest2::testTdf123139XLSX()
 {
 createScDoc("xlsx/tdf123139_applyAlignment.xlsx");
diff --git a/sc/source/filter/xml/xmlexprt.cxx 
b/sc/source/filter/xml/xmlexprt.cxx
index 051c0ac251b3..9fba6fd02604 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -2611,7 +2611,8 @@ void ScXMLExport::collectAutoStyles()
 }
 
 if (getExportFlags() & SvXMLExportFlags::MASTERSTYLES)
-GetPageExport()->collectAutoStyles(true);
+// tdf#154445 - export all page styles even if they are not in use
+GetPageExport()->collectAutoStyles(false);
 
 mbAutoStylesCollected = true;
 }
@@ -2673,7 +2674,8 @@ void ScXMLExport::ExportAutoStyles_()
 
 void ScXMLExport::ExportMasterStyles_()
 {
-GetPageExport()->exportMasterStyles( true );
+// tdf#154445 - export all page styles even if they are not in use
+GetPageExport()->exportMasterStyles( false );
 }
 
 void ScXMLExport::CollectInternalShape( uno::Reference< drawing::XShape > 
const & xShape )


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

2023-03-30 Thread Andreas Heinisch (via logerrit)
 sc/qa/unit/subsequent_filters_test3.cxx |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 0e536abc286b50de171ecb0b6a57dad37467a516
Author: Andreas Heinisch 
AuthorDate: Wed Mar 29 18:18:14 2023 +0200
Commit: Andreas Heinisch 
CommitDate: Thu Mar 30 07:29:04 2023 +

tdf#108188 - Use constant string for default page style

Change-Id: I7c398c3dec044722e4552527de8553506cda54f2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149730
Tested-by: Andreas Heinisch 
Reviewed-by: Andreas Heinisch 

diff --git a/sc/qa/unit/subsequent_filters_test3.cxx 
b/sc/qa/unit/subsequent_filters_test3.cxx
index 7b2407c304b0..400a2fbcdd2c 100644
--- a/sc/qa/unit/subsequent_filters_test3.cxx
+++ b/sc/qa/unit/subsequent_filters_test3.cxx
@@ -34,6 +34,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 #include 
 #include 
@@ -1732,7 +1734,8 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest3, 
testTdf108188_pagestyle)
 // Without the accompanying fix in place, the page styles are always used
 ScStyleSheetPool* pStylePool = pDoc->GetStyleSheetPool();
 CPPUNIT_ASSERT(pStylePool->Find(aTestPageStyle, 
SfxStyleFamily::Page)->IsUsed());
-CPPUNIT_ASSERT(!pStylePool->Find("Default", 
SfxStyleFamily::Page)->IsUsed());
+CPPUNIT_ASSERT(
+!pStylePool->Find(ScResId(STR_STYLENAME_STANDARD), 
SfxStyleFamily::Page)->IsUsed());
 }
 
 CPPUNIT_PLUGIN_IMPLEMENT();


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

2023-03-29 Thread Andreas Heinisch (via logerrit)
 sc/qa/unit/subsequent_export_test4.cxx |   23 +++
 sc/source/filter/xml/xmlexprt.cxx  |6 --
 2 files changed, 27 insertions(+), 2 deletions(-)

New commits:
commit 8085a68be7604e7bd4e0d9445be5e266ffbb
Author: Andreas Heinisch 
AuthorDate: Wed Mar 29 16:53:48 2023 +0200
Commit: Andreas Heinisch 
CommitDate: Wed Mar 29 17:22:55 2023 +

tdf#154445 - Export all page styles even if they are not in use

Change-Id: If0ca5ea97ad545058c6a70d223158a87bf9207ff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149729
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 

diff --git a/sc/qa/unit/subsequent_export_test4.cxx 
b/sc/qa/unit/subsequent_export_test4.cxx
index 3033ff4fef85..275493f61387 100644
--- a/sc/qa/unit/subsequent_export_test4.cxx
+++ b/sc/qa/unit/subsequent_export_test4.cxx
@@ -18,6 +18,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 #include 
 #include 
@@ -418,6 +420,27 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, 
testHeaderFontStyleXLSX)
 CPPUNIT_ASSERT_MESSAGE("Second line should be italic.", bHasItalic);
 }
 
+CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf154445_unused_pagestyles)
+{
+createScDoc("ods/tdf108188_pagestyle.ods");
+
+// Check if the user defined page style is present
+const OUString aTestPageStyle = "TestPageStyle";
+ScDocument* pDoc = getScDoc();
+CPPUNIT_ASSERT_EQUAL(aTestPageStyle, pDoc->GetPageStyle(0));
+
+// Change page style to default so the user defined one is not used anymore
+pDoc->SetPageStyle(0, ScResId(STR_STYLENAME_STANDARD));
+
+// Save and reload the document to check if the unused page styles are 
still present
+saveAndReload("calc8");
+pDoc = getScDoc();
+
+// Without the accompanying fix in place, the unused page styles don't 
exist anymore
+ScStyleSheetPool* pStylePool = pDoc->GetStyleSheetPool();
+CPPUNIT_ASSERT(pStylePool->Find(aTestPageStyle, SfxStyleFamily::Page));
+}
+
 CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf135828_Shape_Rect)
 {
 if (!IsDefaultDPI())
diff --git a/sc/source/filter/xml/xmlexprt.cxx 
b/sc/source/filter/xml/xmlexprt.cxx
index cbf8dcf11a0a..4c306de2c907 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -2609,7 +2609,8 @@ void ScXMLExport::collectAutoStyles()
 }
 
 if (getExportFlags() & SvXMLExportFlags::MASTERSTYLES)
-GetPageExport()->collectAutoStyles(true);
+// tdf#154445 - export all page styles even if they are not in use
+GetPageExport()->collectAutoStyles(false);
 
 mbAutoStylesCollected = true;
 }
@@ -2671,7 +2672,8 @@ void ScXMLExport::ExportAutoStyles_()
 
 void ScXMLExport::ExportMasterStyles_()
 {
-GetPageExport()->exportMasterStyles( true );
+// tdf#154445 - export all page styles even if they are not in use
+GetPageExport()->exportMasterStyles( false );
 }
 
 void ScXMLExport::CollectInternalShape( uno::Reference< drawing::XShape > 
const & xShape )


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

2023-03-28 Thread Andreas Heinisch (via logerrit)
 basic/source/classes/image.cxx   |   12 +++
 basic/source/classes/sb.cxx  |   18 +++---
 basic/source/classes/sbxmod.cxx  |   53 ++-
 basic/source/inc/filefmt.hxx |6 +--
 basic/source/inc/image.hxx   |2 -
 basic/source/inc/sbjsmod.hxx |2 -
 basic/source/sbx/sbxarray.cxx|   18 +++---
 basic/source/sbx/sbxbase.cxx |9 ++---
 basic/source/sbx/sbxcoll.cxx |6 +--
 basic/source/sbx/sbxobj.cxx  |   22 +++-
 basic/source/sbx/sbxvalue.cxx|7 ++--
 basic/source/sbx/sbxvar.cxx  |   11 +++---
 include/basic/sbmeth.hxx |2 -
 include/basic/sbmod.hxx  |2 -
 include/basic/sbstar.hxx |2 -
 include/basic/sbx.hxx|6 +--
 include/basic/sbxcore.hxx|4 +-
 include/basic/sbxobj.hxx |2 -
 include/basic/sbxvar.hxx |4 +-
 sc/qa/extras/macros-test.cxx |   33 +++
 sc/qa/extras/testdocuments/tdf142391.ods |binary
 21 files changed, 141 insertions(+), 80 deletions(-)

New commits:
commit d622972dceba40d89852b1dc832c6e2a4612b2fa
Author: Andreas Heinisch 
AuthorDate: Mon Mar 20 17:13:26 2023 +0100
Commit: Andreas Heinisch 
CommitDate: Tue Mar 28 07:36:48 2023 +

tdf#142391 - Store method using 0x13 format only when actually needed

Change-Id: I907d234b20be5e3c7bee0d44407f1bf4c4b49f05
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149175
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 

diff --git a/basic/source/classes/image.cxx b/basic/source/classes/image.cxx
index e5f9ac3f5df2..eab5fe9e0905 100644
--- a/basic/source/classes/image.cxx
+++ b/basic/source/classes/image.cxx
@@ -124,11 +124,11 @@ bool SbiImage::Load( SvStream& r, sal_uInt32& nVersion )
 nFlags = static_cast(nTmpFlags);
 eCharSet = nCharSet;
 eCharSet = GetSOLoadTextEncoding( eCharSet );
-bBadVer  = ( nVersion > B_CURVERSION );
+bBadVer  = ( nVersion > B_IMG_VERSION_13 );
 nDimBase = static_cast(lDimBase);
 }
 
-bool bLegacy = ( nVersion < B_EXT_IMG_VERSION );
+bool bLegacy = ( nVersion < B_IMG_VERSION_12 );
 
 sal_uInt64 nNext;
 while( ( nNext = r.Tell() ) < nLast )
@@ -373,7 +373,7 @@ done:
 
 bool SbiImage::Save( SvStream& r, sal_uInt32 nVer )
 {
-bool bLegacy = ( nVer < B_EXT_IMG_VERSION );
+bool bLegacy = ( nVer < B_IMG_VERSION_12 );
 
 // detect if old code exceeds legacy limits
 // if so, then disallow save
@@ -381,7 +381,7 @@ bool SbiImage::Save( SvStream& r, sal_uInt32 nVer )
 {
 SbiImage aEmptyImg;
 aEmptyImg.aName = aName;
-aEmptyImg.Save( r, B_LEGACYVERSION );
+aEmptyImg.Save( r, B_IMG_VERSION_11 );
 return true;
 }
 // First of all the header
@@ -391,11 +391,11 @@ bool SbiImage::Save( SvStream& r, sal_uInt32 nVer )
 eCharSet = GetSOStoreTextEncoding( eCharSet );
 if ( bLegacy )
 {
-r.WriteInt32( B_LEGACYVERSION );
+r.WriteInt32( B_IMG_VERSION_11 );
 }
 else
 {
-r.WriteInt32( B_CURVERSION );
+r.WriteInt32( nVer );
 }
 r .WriteInt32( eCharSet )
   .WriteInt32( nDimBase )
diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx
index 7f02e65d9b55..64ba5cd20c86 100644
--- a/basic/source/classes/sb.cxx
+++ b/basic/source/classes/sb.cxx
@@ -1847,22 +1847,28 @@ bool StarBASIC::LoadData( SvStream& r, sal_uInt16 nVer )
 return true;
 }
 
-bool StarBASIC::StoreData( SvStream& r ) const
+std::pair StarBASIC::StoreData( SvStream& r ) const
 {
-if( !SbxObject::StoreData( r ) )
+auto [bSuccess, nVersion] = SbxObject::StoreData(r);
+if( !bSuccess )
 {
-return false;
+return { false, 0 };
 }
 assert(pModules.size() < SAL_MAX_UINT16);
 r.WriteUInt16( static_cast(pModules.size()));
 for( const auto& rpModule: pModules )
 {
-if( !rpModule->Store( r ) )
+const auto& [bSuccessModule, nVersionModule] = rpModule->Store(r);
+if( !bSuccessModule )
 {
-return false;
+return { false, 0 };
+}
+else if (nVersionModule > nVersion)
+{
+nVersion = nVersionModule;
 }
 }
-return true;
+return { true, nVersion };
 }
 
 bool StarBASIC::GetUNOConstant( const OUString& rName, css::uno::Any& aOut )
diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx
index aaad6cd9bb41..9a4fd841c98d 100644
--- a/basic/source/classes/sbxmod.cxx
+++ b/basic/source/classes/sbxmod.cxx
@@ -1606,7 +1606,7 @@ bool SbModule::LoadData( SvStream& rStrm, sal_uInt16 nVer 
)
 return false;
 }
 // If the image is in old format, we fix up the method start offsets
-if ( nImgVer < 

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

2023-03-23 Thread Andreas Heinisch (via logerrit)
 svx/source/dialog/charmap.cxx   |3 +--
 svx/source/dialog/searchcharmap.cxx |3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

New commits:
commit 6e70d50db34afc9242b45172f456bb8221c4fa00
Author: Andreas Heinisch 
AuthorDate: Fri Mar 24 00:28:11 2023 +0100
Commit: Andreas Heinisch 
CommitDate: Fri Mar 24 02:25:58 2023 +

Delete temporary variable

Change-Id: I5d0fc2a4b078e49be684b4a9b8a27f6059d9e5c3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149475
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 

diff --git a/svx/source/dialog/charmap.cxx b/svx/source/dialog/charmap.cxx
index 5f08ba3e96c8..7b74eab65aa3 100644
--- a/svx/source/dialog/charmap.cxx
+++ b/svx/source/dialog/charmap.cxx
@@ -634,9 +634,8 @@ void SvxShowCharSet::DrawChars_Impl(vcl::RenderContext& 
rRenderContext, int n1,
 rRenderContext.SetFillColor(rStyleSettings.GetDisableColor());
 for (i = n2 - n1 + 1; i < ROW_COUNT * COLUMN_COUNT; i++)
 {
-Point pix = MapIndexToPixel(i + n1);
 rRenderContext.DrawRect(
-tools::Rectangle(Point(pix.X(), pix.Y()), Size(nX + 2, nY + 
2)));
+tools::Rectangle(MapIndexToPixel(i + n1), Size(nX + 2, nY + 
2)));
 }
 }
 }
diff --git a/svx/source/dialog/searchcharmap.cxx 
b/svx/source/dialog/searchcharmap.cxx
index c5ae90dbf052..0bbb88448be5 100644
--- a/svx/source/dialog/searchcharmap.cxx
+++ b/svx/source/dialog/searchcharmap.cxx
@@ -286,9 +286,8 @@ void SvxSearchCharSet::DrawChars_Impl(vcl::RenderContext& 
rRenderContext, int n1
 rRenderContext.SetFillColor(rStyleSettings.GetDisableColor());
 for (i = n2 - n1 + 1; i < ROW_COUNT * COLUMN_COUNT; i++)
 {
-Point pix = MapIndexToPixel(i + n1);
 rRenderContext.DrawRect(
-tools::Rectangle(Point(pix.X(), pix.Y()), Size(nX + 2, nY + 
2)));
+tools::Rectangle(MapIndexToPixel(i + n1), Size(nX + 2, nY + 
2)));
 }
 }
 }


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

2023-03-17 Thread Andreas Heinisch (via logerrit)
 basctl/source/basicide/moduldl2.cxx |   16 
 basic/source/uno/namecont.cxx   |   20 ++--
 2 files changed, 30 insertions(+), 6 deletions(-)

New commits:
commit 928957ee04c57a20bab42223b81f55a714b62d9c
Author: Andreas Heinisch 
AuthorDate: Wed Mar 8 17:03:35 2023 +0100
Commit: Andreas Heinisch 
CommitDate: Fri Mar 17 14:22:44 2023 +

tdf#151741 - BASIC Organizer: fill various URLs for libraries

Otherwise, libraries cannot be renamed in the BASIC organizer.

Change-Id: I6c78cdee12f8d6128acf68e889fca463ed782477
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148483
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 

diff --git a/basctl/source/basicide/moduldl2.cxx 
b/basctl/source/basicide/moduldl2.cxx
index 12650fc8f66a..2b21a6f6ba64 100644
--- a/basctl/source/basicide/moduldl2.cxx
+++ b/basctl/source/basicide/moduldl2.cxx
@@ -1320,6 +1320,22 @@ void createLibImpl(weld::Window* pWin, const 
ScriptDocument& rDocument,
 if ( !rDocument.createModule( aLibName, aModName, true, 
sModuleCode ) )
 throw Exception("could not create module " + aModName, 
nullptr);
 
+// tdf#151741 - store all libraries to the file system, otherwise 
they
+// cannot be renamed/moved since the 
SfxLibraryContainer::renameLibrary
+// moves the foldes/files on the file system
+Reference xModLibContainer(
+rDocument.getLibraryContainer(E_SCRIPTS), UNO_QUERY);
+Reference xDlgLibContainer(
+rDocument.getLibraryContainer(E_DIALOGS), UNO_QUERY);
+Reference 
xModPersLibContainer(xModLibContainer,
+   
 UNO_QUERY);
+if (xModPersLibContainer.is())
+xModPersLibContainer->storeLibraries();
+Reference 
xDlgPersLibContainer(xDlgLibContainer,
+   
 UNO_QUERY);
+if (xDlgPersLibContainer.is())
+xDlgPersLibContainer->storeLibraries();
+
 SbxItem aSbxItem( SID_BASICIDE_ARG_SBX, rDocument, aLibName, 
aModName, TYPE_MODULE );
 if (SfxDispatcher* pDispatcher = GetDispatcher())
 pDispatcher->ExecuteList(SID_BASICIDE_SBXINSERTED,
diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx
index 7716649ee5fa..ca8beee5e74e 100644
--- a/basic/source/uno/namecont.cxx
+++ b/basic/source/uno/namecont.cxx
@@ -2146,6 +2146,9 @@ Reference< XNameContainer > SAL_CALL 
SfxLibraryContainer::createLibrary( const O
 pNewLib->maLibElementFileExtension = maLibElementFileExtension;
 
 createVariableURL( pNewLib->maUnexpandedStorageURL, Name, maInfoFileName, 
true );
+// tdf#151741 - fill various storage URLs for the newly created library
+checkStorageURL(pNewLib->maUnexpandedStorageURL, pNewLib->maLibInfoFileURL,
+pNewLib->maStorageURL, pNewLib->maUnexpandedStorageURL);
 
 Reference< XNameAccess > xNameAccess( pNewLib );
 Any aElement;
@@ -2491,10 +2494,6 @@ void SAL_CALL SfxLibraryContainer::renameLibrary( const 
OUString& Name, const OU
 }
 loadLibrary( Name );
 
-// Remove from container
-maNameContainer->removeByName( Name );
-maModifiable.setModified( true );
-
 // Rename library folder, but not for linked libraries
 bool bMovedSuccessful = true;
 
@@ -2505,6 +2504,14 @@ void SAL_CALL SfxLibraryContainer::renameLibrary( const 
OUString& Name, const OU
 bMovedSuccessful = false;
 
 OUString aLibDirPath = pImplLib->maStorageURL;
+// tdf#151741 - fill various storage URLs for the library
+// These URLs should not be empty for newly created libraries after
+// the change in SfxLibraryContainer::createLibrary.
+if (aLibDirPath.isEmpty())
+{
+checkStorageURL(pImplLib->maUnexpandedStorageURL, 
pImplLib->maLibInfoFileURL,
+pImplLib->maStorageURL, 
pImplLib->maUnexpandedStorageURL);
+}
 
 INetURLObject aDestInetObj( o3tl::getToken(maLibraryPath, 1, ';'));
 aDestInetObj.insertName( NewName, true, INetURLObject::LAST_SEGMENT,
@@ -2581,12 +2588,13 @@ void SAL_CALL SfxLibraryContainer::renameLibrary( const 
OUString& Name, const OU
 
 bMovedSuccessful = true;
 pImplLib->implSetModified( true );
+// Remove old library from container
+maNameContainer->removeByName( Name );
+maModifiable.setModified( true );
 }
 }
 catch(const Exception& )
 {
-// Restore old library
-maNameContainer->insertByName( Name, aLibAny ) ;
 }
 }
 


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

2023-03-16 Thread Andreas Heinisch (via logerrit)
 sc/qa/unit/ucalc.cxx |   65 +++
 sc/source/core/data/documen2.cxx |   30 ++
 2 files changed, 95 insertions(+)

New commits:
commit 07f95ee7c043702c2dde2af2fc02228a0c5273d3
Author: Andreas Heinisch 
AuthorDate: Sun Mar 5 17:11:27 2023 +0100
Commit: Xisco Fauli 
CommitDate: Thu Mar 16 09:47:28 2023 +

tdf#66613 - Transfer tab: preserve print ranges and col/row repetitions

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

diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index b94ccf7526c2..e5aa8515c663 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -94,6 +94,7 @@ public:
 void testMarkData();
 void testInput();
 void testColumnIterator();
+void testTdf66613();
 void testTdf90698();
 void testTdf114406();
 void testTdf93951();
@@ -244,6 +245,7 @@ public:
 CPPUNIT_TEST(testMarkData);
 CPPUNIT_TEST(testInput);
 CPPUNIT_TEST(testColumnIterator);
+CPPUNIT_TEST(testTdf66613);
 CPPUNIT_TEST(testTdf90698);
 CPPUNIT_TEST(testTdf114406);
 CPPUNIT_TEST(testTdf93951);
@@ -636,6 +638,69 @@ void Test::testColumnIterator() // tdf#118620
 m_pDoc->DeleteTab(0);
 }
 
+void Test::testTdf66613()
+{
+// Create different print ranges and col/row repetitions for two tabs
+const SCTAB nFirstTab = 0;
+CPPUNIT_ASSERT(m_pDoc->InsertTab(nFirstTab, "FirstPrintRange"));
+ScRange aFirstPrintRange(0, 0, nFirstTab, 2, 2, nFirstTab);
+m_pDoc->AddPrintRange(nFirstTab, aFirstPrintRange);
+ScRange aFirstRepeatColRange(0, 0, nFirstTab, 0, 0, nFirstTab);
+m_pDoc->SetRepeatColRange(nFirstTab, aFirstRepeatColRange);
+ScRange aFirstRepeatRowRange(1, 1, nFirstTab, 1, 1, nFirstTab);
+m_pDoc->SetRepeatRowRange(nFirstTab, aFirstRepeatRowRange);
+
+const SCTAB nSecondTab = 1;
+CPPUNIT_ASSERT(m_pDoc->InsertTab(nSecondTab, "SecondPrintRange"));
+ScRange aSecondPrintRange(0, 0, nSecondTab, 3, 3, nSecondTab);
+m_pDoc->AddPrintRange(nSecondTab, aSecondPrintRange);
+ScRange aSecondRepeatColRange(1, 1, nSecondTab, 1, 1, nSecondTab);
+m_pDoc->SetRepeatColRange(nSecondTab, aSecondRepeatColRange);
+ScRange aSecondRepeatRowRange(2, 2, nSecondTab, 2, 2, nSecondTab);
+m_pDoc->SetRepeatRowRange(nSecondTab, aSecondRepeatRowRange);
+
+// Transfer generated tabs to a new document with different order
+ScDocument aScDocument;
+aScDocument.TransferTab(*m_pDoc, nSecondTab, nFirstTab);
+aScDocument.TransferTab(*m_pDoc, nFirstTab, nSecondTab);
+
+// Check the number of print ranges in both documents
+CPPUNIT_ASSERT_EQUAL(static_cast(1), 
m_pDoc->GetPrintRangeCount(nFirstTab));
+CPPUNIT_ASSERT_EQUAL(static_cast(1), 
m_pDoc->GetPrintRangeCount(nSecondTab));
+CPPUNIT_ASSERT_EQUAL(static_cast(1), 
aScDocument.GetPrintRangeCount(nFirstTab));
+CPPUNIT_ASSERT_EQUAL(static_cast(1), 
aScDocument.GetPrintRangeCount(nSecondTab));
+
+// Check the print ranges and col/row repetitions in both documents
+CPPUNIT_ASSERT_EQUAL(aFirstPrintRange, *m_pDoc->GetPrintRange(nFirstTab, 
0));
+CPPUNIT_ASSERT_EQUAL(aFirstRepeatColRange, 
*m_pDoc->GetRepeatColRange(nFirstTab));
+CPPUNIT_ASSERT_EQUAL(aFirstRepeatRowRange, 
*m_pDoc->GetRepeatRowRange(nFirstTab));
+CPPUNIT_ASSERT_EQUAL(aSecondPrintRange, *m_pDoc->GetPrintRange(nSecondTab, 
0));
+CPPUNIT_ASSERT_EQUAL(aSecondRepeatColRange, 
*m_pDoc->GetRepeatColRange(nSecondTab));
+CPPUNIT_ASSERT_EQUAL(aSecondRepeatRowRange, 
*m_pDoc->GetRepeatRowRange(nSecondTab));
+
+// Tabs have to be adjusted since the order of the tabs is inverted in the 
new document
+std::vector aScRanges
+= { ,  ,  ,
+, ,  
};
+for (size_t i = 0; i < aScRanges.size(); i++)
+{
+const SCTAB nTab = i >= 3 ? nFirstTab : nSecondTab;
+aScRanges[i]->aStart.SetTab(nTab);
+aScRanges[i]->aEnd.SetTab(nTab);
+}
+
+// Without the fix in place, no print ranges and col/row repetitions would 
be present
+CPPUNIT_ASSERT_EQUAL(aFirstPrintRange, 
*aScDocument.GetPrintRange(nSecondTab, 0));
+CPPUNIT_ASSERT_EQUAL(aFirstRepeatColRange, 
*aScDocument.GetRepeatColRange(nSecondTab));
+CPPUNIT_ASSERT_EQUAL(aFirstRepeatRowRange, 
*aScDocument.GetRepeatRowRange(nSecondTab));
+CPPUNIT_ASSERT_EQUAL(aSecondPrintRange, 
*aScDocument.GetPrintRange(nFirstTab, 0));
+CPPUNIT_ASSERT_EQUAL(aSecondRepeatColRange, 
*aScDocument.GetRepeatColRange(nFirstTab));
+CPPUNIT_ASSERT_EQUAL(aSecondRepeatRowRange, 
*aScDocument.GetRepeatRowRange(nFirstTab));
+
+m_pDoc->DeleteTab(nFirstTab);
+m_pDoc->DeleteTab(nSecondTab);
+}
+
 void Test::testTdf90698()
 {
 

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

2023-03-15 Thread Andreas Heinisch (via logerrit)
 sw/qa/extras/uiwriter/data/tdf151462.odt |binary
 sw/qa/extras/uiwriter/data/tdf40142.odt  |binary
 sw/qa/extras/uiwriter/uiwriter8.cxx  |   16 ++--
 sw/source/core/doc/doctxm.cxx|2 ++
 4 files changed, 16 insertions(+), 2 deletions(-)

New commits:
commit 5c04c4474236cc50009aea6d89f7c443c861af19
Author: Andreas Heinisch 
AuthorDate: Tue Mar 14 15:34:16 2023 +0100
Commit: Andreas Heinisch 
CommitDate: Wed Mar 15 11:00:03 2023 +

tdf#40142 - Consider level settings of the various text nodes

Consider level settings of the various text nodes when creating a TOC
from custom styles.

Change-Id: I70759f9bcf63e8591ce89bc71afabb1da0c2f29c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148886
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 

diff --git a/sw/qa/extras/uiwriter/data/tdf151462.odt 
b/sw/qa/extras/uiwriter/data/tdf151462.odt
index cdd250232e18..648cb7619582 100644
Binary files a/sw/qa/extras/uiwriter/data/tdf151462.odt and 
b/sw/qa/extras/uiwriter/data/tdf151462.odt differ
diff --git a/sw/qa/extras/uiwriter/data/tdf40142.odt 
b/sw/qa/extras/uiwriter/data/tdf40142.odt
new file mode 100755
index ..7f87c867ee29
Binary files /dev/null and b/sw/qa/extras/uiwriter/data/tdf40142.odt differ
diff --git a/sw/qa/extras/uiwriter/uiwriter8.cxx 
b/sw/qa/extras/uiwriter/uiwriter8.cxx
index 498a9f9e7408..45d76fd76771 100644
--- a/sw/qa/extras/uiwriter/uiwriter8.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter8.cxx
@@ -2484,13 +2484,25 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf97899)
 CPPUNIT_ASSERT(!sCharStyleName.isEmpty());
 }
 
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf40142)
+{
+createSwDoc("tdf40142.odt");
+dispatchCommand(mxComponent, ".uno:UpdateAllIndexes", {});
+
+xmlDocUniquePtr pLayout = parseLayoutDump();
+// Without the fix in place, this test would have failed with
+// - Expected: 2
+// - Actual  : 4
+assertXPath(pLayout, "/root/page[1]/body/section[2]/txt", 2);
+}
+
 CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf151462)
 {
 createSwDoc("tdf151462.odt");
 dispatchCommand(mxComponent, ".uno:UpdateAllIndexes", {});
 
 xmlDocUniquePtr pLayout = parseLayoutDump();
-// tdf#151462 - without the fix in place, there would be just the first 
index entry
+// Without the fix in place, there would be just the first index entry
 assertXPath(pLayout,
 
"/root/page[1]/body/txt[2]/anchored/fly/section/txt[1]/SwParaPortion/"
 "SwLineLayout[1]/SwLinePortion[1]",
@@ -2504,7 +2516,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf151462)
 "SwLineLayout[1]/SwLinePortion[1]",
 "portion", "sub three");
 
-// tdf#151462 - without the fix in place, there would be just the first 
index entry
+// Without the fix in place, there would be just the first index entry
 assertXPath(pLayout,
 
"/root/page[1]/body/txt[6]/anchored/fly/section/txt[1]/SwParaPortion/"
 "SwLineLayout[1]/SwLinePortion[1]",
diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx
index 5f54e5313f70..0a80b25d2f6b 100644
--- a/sw/source/core/doc/doctxm.cxx
+++ b/sw/source/core/doc/doctxm.cxx
@@ -1373,6 +1373,8 @@ void SwTOXBaseSection::UpdateTemplate(const SwTextNode* 
pOwnChapterNode,
 if (pTextNd->GetText().getLength() &&
 pTextNd->getLayoutFrame(pLayout) &&
 pTextNd->GetNodes().IsDocNodes() &&
+// tdf#40142 - consider level settings of the various text 
nodes
+o3tl::make_unsigned(pTextNd->GetAttrOutlineLevel()) <= 
GetLevel() &&
 (!pLayout || !pLayout->HasMergedParas()
 || 
static_cast(pTextNd->getLayoutFrame(pLayout))->GetTextNodeForParaProps()
 == pTextNd) &&
 (!IsFromChapter() || IsHeadingContained(pOwnChapterNode, 
*pTextNd)))


[Libreoffice-commits] core.git: helpcontent2

2023-03-15 Thread Andreas Heinisch (via logerrit)
 helpcontent2 |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 7e678312f0832eed67595b7300047f60c6b1c253
Author: Andreas Heinisch 
AuthorDate: Wed Mar 15 10:18:53 2023 +
Commit: Gerrit Code Review 
CommitDate: Wed Mar 15 10:18:53 2023 +

Update git submodules

* Update helpcontent2 from branch 'master'
  to 4be597da538b8cdb54f1f12fedfd940a1fa9c60e
  - tdf#82254 - Add UTF-8 BOM (Token 14) to CSV filter parameters

Change-Id: I085e66ca6b46955110a4eaab7118c4a376f16b40
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/148871
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 

diff --git a/helpcontent2 b/helpcontent2
index 87ab9fc48e05..4be597da538b 16
--- a/helpcontent2
+++ b/helpcontent2
@@ -1 +1 @@
-Subproject commit 87ab9fc48e05a39caf563be8f171d0ed737c50f7
+Subproject commit 4be597da538b8cdb54f1f12fedfd940a1fa9c60e


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

2023-03-15 Thread Andreas Heinisch (via logerrit)
 source/text/shared/guide/csv_params.xhp |   11 +++
 1 file changed, 11 insertions(+)

New commits:
commit 4be597da538b8cdb54f1f12fedfd940a1fa9c60e
Author: Andreas Heinisch 
AuthorDate: Wed Mar 15 09:55:41 2023 +
Commit: Andreas Heinisch 
CommitDate: Wed Mar 15 10:18:53 2023 +

tdf#82254 - Add UTF-8 BOM (Token 14) to CSV filter parameters

Change-Id: I085e66ca6b46955110a4eaab7118c4a376f16b40
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/148871
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 

diff --git a/source/text/shared/guide/csv_params.xhp 
b/source/text/shared/guide/csv_params.xhp
index 9deb1252d0..a6bcf26e46 100644
--- a/source/text/shared/guide/csv_params.xhp
+++ b/source/text/shared/guide/csv_params.xhp
@@ -208,6 +208,17 @@
 String, either false or 
true. Default value: false. Determines 
whether formula expressions starting with a = equal sign character are to be 
evaluated as formulas or imported as textual data. If true 
evaluate formulas on input. If false formulas are input as 
text. If omitted (not present at all), the default value is 
true to keep the behaviour of old versions' options string 
that didn't have this token at all. If present and empty (or any other value 
than true) the default value is 
false.
 
 
+
+
+14
+
+
+Include a 
byte-order-mark (BOM)
+
+
+String, either false or 
true. Default value: false. If 
true include a byte-order-mark (BOM) in the export. If 
false the export does not include a BOM. If omitted (not 
present at all), the default value is false to keep the 
behaviour of old versions' options string that didn't have this token at all. 
If present and empty (or any other value than true) the 
default value is false. Automatically detected during the 
import.
+
+
 
 Special case of CSV files with separator 
defined in the first line
 


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

2023-03-14 Thread Andreas Heinisch (via logerrit)
 svl/source/numbers/zforfind.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 34510e6e57e58fb27071564f546bbd420404e66d
Author: Andreas Heinisch 
AuthorDate: Tue Mar 7 16:02:22 2023 +0100
Commit: Eike Rathke 
CommitDate: Tue Mar 14 20:39:33 2023 +

tdf#117037 - Support Unicode minus (0x2212) in the number scanner

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

diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx
index de5aacf69d2b..da993232e677 100644
--- a/svl/source/numbers/zforfind.cxx
+++ b/svl/source/numbers/zforfind.cxx
@@ -906,6 +906,7 @@ inline bool ImpSvNumberInputScan::GetTime100SecSep( 
std::u16string_view rString,
  * Read a sign including brackets
  * '+'   =>  1
  * '-'   => -1
+ * u'−'   => -1
  *  '('   => -1, bNegCheck = 1
  * else =>  0
  */
@@ -921,6 +922,8 @@ int ImpSvNumberInputScan::GetSign( std::u16string_view 
rString, sal_Int32& nPos
 bNegCheck = true;
 [[fallthrough]];
 case '-':
+// tdf#117037 - unicode minus (0x2212)
+case u'−':
 nPos++;
 return -1;
 default:


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

2023-03-14 Thread Andreas Heinisch (via logerrit)
 sw/qa/extras/uiwriter/uiwriter8.cxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit bd4ae16a5417c0997993b64864d914fb01fdb165
Author: Andreas Heinisch 
AuthorDate: Tue Mar 14 14:42:56 2023 +
Commit: Andreas Heinisch 
CommitDate: Tue Mar 14 15:18:26 2023 +

Remove debug command

Change-Id: I6cd82e83288724896987c591f308fb7ab0eb880a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148863
Tested-by: Andreas Heinisch 
Reviewed-by: Andreas Heinisch 

diff --git a/sw/qa/extras/uiwriter/uiwriter8.cxx 
b/sw/qa/extras/uiwriter/uiwriter8.cxx
index 7c39bbacaa7a..498a9f9e7408 100644
--- a/sw/qa/extras/uiwriter/uiwriter8.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter8.cxx
@@ -2487,7 +2487,6 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf97899)
 CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf151462)
 {
 createSwDoc("tdf151462.odt");
-//   xmlDocUniquePtr pLayout = parseLayoutDump();
 dispatchCommand(mxComponent, ".uno:UpdateAllIndexes", {});
 
 xmlDocUniquePtr pLayout = parseLayoutDump();


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

2023-03-08 Thread Andreas Heinisch (via logerrit)
 sc/qa/unit/ucalc.cxx |   63 +++
 sc/source/core/data/documen2.cxx |   30 ++
 2 files changed, 93 insertions(+)

New commits:
commit c1af1b9c555480305862336954ceefe14865e27d
Author: Andreas Heinisch 
AuthorDate: Sun Mar 5 17:11:27 2023 +0100
Commit: Andreas Heinisch 
CommitDate: Wed Mar 8 17:48:11 2023 +

tdf#66613 - Transfer tab: preserve print ranges and col/row repetitions

Change-Id: Ib0e6f9942c2bae1f1fdfa2d0ead0868e9b790b1a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148284
Tested-by: Jenkins
Tested-by: Andreas Heinisch 
Reviewed-by: Andreas Heinisch 

diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index b9217b2b5e6e..7f50f33cb3dc 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -387,6 +387,69 @@ CPPUNIT_TEST_FIXTURE(Test, testColumnIterator) // 
tdf#118620
 m_pDoc->DeleteTab(0);
 }
 
+CPPUNIT_TEST_FIXTURE(Test, testTdf66613)
+{
+// Create different print ranges and col/row repetitions for two tabs
+const SCTAB nFirstTab = 0;
+CPPUNIT_ASSERT(m_pDoc->InsertTab(nFirstTab, "FirstPrintRange"));
+ScRange aFirstPrintRange(0, 0, nFirstTab, 2, 2, nFirstTab);
+m_pDoc->AddPrintRange(nFirstTab, aFirstPrintRange);
+ScRange aFirstRepeatColRange(0, 0, nFirstTab, 0, 0, nFirstTab);
+m_pDoc->SetRepeatColRange(nFirstTab, aFirstRepeatColRange);
+ScRange aFirstRepeatRowRange(1, 1, nFirstTab, 1, 1, nFirstTab);
+m_pDoc->SetRepeatRowRange(nFirstTab, aFirstRepeatRowRange);
+
+const SCTAB nSecondTab = 1;
+CPPUNIT_ASSERT(m_pDoc->InsertTab(nSecondTab, "SecondPrintRange"));
+ScRange aSecondPrintRange(0, 0, nSecondTab, 3, 3, nSecondTab);
+m_pDoc->AddPrintRange(nSecondTab, aSecondPrintRange);
+ScRange aSecondRepeatColRange(1, 1, nSecondTab, 1, 1, nSecondTab);
+m_pDoc->SetRepeatColRange(nSecondTab, aSecondRepeatColRange);
+ScRange aSecondRepeatRowRange(2, 2, nSecondTab, 2, 2, nSecondTab);
+m_pDoc->SetRepeatRowRange(nSecondTab, aSecondRepeatRowRange);
+
+// Transfer generated tabs to a new document with different order
+ScDocument aScDocument;
+aScDocument.TransferTab(*m_pDoc, nSecondTab, nFirstTab);
+aScDocument.TransferTab(*m_pDoc, nFirstTab, nSecondTab);
+
+// Check the number of print ranges in both documents
+CPPUNIT_ASSERT_EQUAL(static_cast(1), 
m_pDoc->GetPrintRangeCount(nFirstTab));
+CPPUNIT_ASSERT_EQUAL(static_cast(1), 
m_pDoc->GetPrintRangeCount(nSecondTab));
+CPPUNIT_ASSERT_EQUAL(static_cast(1), 
aScDocument.GetPrintRangeCount(nFirstTab));
+CPPUNIT_ASSERT_EQUAL(static_cast(1), 
aScDocument.GetPrintRangeCount(nSecondTab));
+
+// Check the print ranges and col/row repetitions in both documents
+CPPUNIT_ASSERT_EQUAL(aFirstPrintRange, *m_pDoc->GetPrintRange(nFirstTab, 
0));
+CPPUNIT_ASSERT_EQUAL(aFirstRepeatColRange, 
*m_pDoc->GetRepeatColRange(nFirstTab));
+CPPUNIT_ASSERT_EQUAL(aFirstRepeatRowRange, 
*m_pDoc->GetRepeatRowRange(nFirstTab));
+CPPUNIT_ASSERT_EQUAL(aSecondPrintRange, *m_pDoc->GetPrintRange(nSecondTab, 
0));
+CPPUNIT_ASSERT_EQUAL(aSecondRepeatColRange, 
*m_pDoc->GetRepeatColRange(nSecondTab));
+CPPUNIT_ASSERT_EQUAL(aSecondRepeatRowRange, 
*m_pDoc->GetRepeatRowRange(nSecondTab));
+
+// Tabs have to be adjusted since the order of the tabs is inverted in the 
new document
+std::vector aScRanges
+= { ,  ,  ,
+, ,  
};
+for (size_t i = 0; i < aScRanges.size(); i++)
+{
+const SCTAB nTab = i >= 3 ? nFirstTab : nSecondTab;
+aScRanges[i]->aStart.SetTab(nTab);
+aScRanges[i]->aEnd.SetTab(nTab);
+}
+
+// Without the fix in place, no print ranges and col/row repetitions would 
be present
+CPPUNIT_ASSERT_EQUAL(aFirstPrintRange, 
*aScDocument.GetPrintRange(nSecondTab, 0));
+CPPUNIT_ASSERT_EQUAL(aFirstRepeatColRange, 
*aScDocument.GetRepeatColRange(nSecondTab));
+CPPUNIT_ASSERT_EQUAL(aFirstRepeatRowRange, 
*aScDocument.GetRepeatRowRange(nSecondTab));
+CPPUNIT_ASSERT_EQUAL(aSecondPrintRange, 
*aScDocument.GetPrintRange(nFirstTab, 0));
+CPPUNIT_ASSERT_EQUAL(aSecondRepeatColRange, 
*aScDocument.GetRepeatColRange(nFirstTab));
+CPPUNIT_ASSERT_EQUAL(aSecondRepeatRowRange, 
*aScDocument.GetRepeatRowRange(nFirstTab));
+
+m_pDoc->DeleteTab(nFirstTab);
+m_pDoc->DeleteTab(nSecondTab);
+}
+
 CPPUNIT_TEST_FIXTURE(Test, testTdf90698)
 {
 CPPUNIT_ASSERT(m_pDoc->InsertTab (0, "Test"));
diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx
index e21da4be599b..a7ea162177a9 100644
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
@@ -1023,6 +1023,36 @@ sal_uLong ScDocument::TransferTab( ScDocument& rSrcDoc, 
SCTAB nSrcPos,
 maTabs[nDestPos]->SetTabNo(nDestPos);
 
maTabs[nDestPos]->SetTabBgColor(rSrcDoc.maTabs[nSrcPos]->GetTabBgColor());
 
+// tdf#66613 - copy existing print ranges and col/row 

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

2023-03-04 Thread Andreas Heinisch (via logerrit)
 svx/source/dialog/charmap.cxx   |   12 
 svx/source/dialog/searchcharmap.cxx |   12 
 2 files changed, 24 insertions(+)

New commits:
commit abb2151dc915defbc12dcf78bd01ae69f2f1f292
Author: Andreas Heinisch 
AuthorDate: Wed Mar 1 14:12:53 2023 +0100
Commit: Andreas Heinisch 
CommitDate: Sat Mar 4 10:55:06 2023 +

tdf#141319 - Special Characters Dialog: mark empty/unused cells

Change-Id: I123aef9f9763b2ae88c4b4f6748b69f9d9c394af
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148051
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 

diff --git a/svx/source/dialog/charmap.cxx b/svx/source/dialog/charmap.cxx
index 7dd37c43e106..4c17ce11c98a 100644
--- a/svx/source/dialog/charmap.cxx
+++ b/svx/source/dialog/charmap.cxx
@@ -627,6 +627,18 @@ void SvxShowCharSet::DrawChars_Impl(vcl::RenderContext& 
rRenderContext, int n1,
 }
 rRenderContext.SetTextColor(aTextCol);
 }
+
+// tdf#141319 - mark empty/unused cells
+if (n2 - n1 < ROW_COUNT * COLUMN_COUNT)
+{
+rRenderContext.SetFillColor(rStyleSettings.GetDisableColor());
+for (i = n2 - n1 + 1; i < ROW_COUNT * COLUMN_COUNT; i++)
+{
+Point pix = MapIndexToPixel(i + n1);
+rRenderContext.DrawRect(
+tools::Rectangle(Point(pix.X(), pix.Y()), Size(nX + 2, nY + 
2)));
+}
+}
 }
 
 
diff --git a/svx/source/dialog/searchcharmap.cxx 
b/svx/source/dialog/searchcharmap.cxx
index 76a3a1a5f767..ea2ae309735a 100644
--- a/svx/source/dialog/searchcharmap.cxx
+++ b/svx/source/dialog/searchcharmap.cxx
@@ -283,6 +283,18 @@ void SvxSearchCharSet::DrawChars_Impl(vcl::RenderContext& 
rRenderContext, int n1
 }
 rRenderContext.SetTextColor(aTextCol);
 }
+
+// tdf#141319 - mark empty/unused cells
+if (n2 - n1 < ROW_COUNT * COLUMN_COUNT)
+{
+rRenderContext.SetFillColor(rStyleSettings.GetDisableColor());
+for (i = n2 - n1 + 1; i < ROW_COUNT * COLUMN_COUNT; i++)
+{
+Point pix = MapIndexToPixel(i + n1);
+rRenderContext.DrawRect(
+tools::Rectangle(Point(pix.X(), pix.Y()), Size(nX + 2, nY + 
2)));
+}
+}
 }
 
 sal_UCS4 SvxSearchCharSet::GetSelectCharacter() const


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

2023-03-01 Thread Andreas Heinisch (via logerrit)
 svx/source/dialog/charmap.cxx   |4 ++--
 svx/source/dialog/searchcharmap.cxx |4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit b466c1ad267e821dbda0a879ab31a2ea00e54b5c
Author: Andreas Heinisch 
AuthorDate: Wed Mar 1 11:06:49 2023 +0100
Commit: Andreas Heinisch 
CommitDate: Wed Mar 1 11:18:27 2023 +

tdf#109214 - Highlight the favorites in the grid of special characters

Remove visual artifacts around the corners by using horizontal and
vertical round.

Change-Id: I9821103c43dfbd93e6f295034b05da8b74e802e4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148040
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 

diff --git a/svx/source/dialog/charmap.cxx b/svx/source/dialog/charmap.cxx
index bc3950ad2ca6..7dd37c43e106 100644
--- a/svx/source/dialog/charmap.cxx
+++ b/svx/source/dialog/charmap.cxx
@@ -581,9 +581,9 @@ void SvxShowCharSet::DrawChars_Impl(vcl::RenderContext& 
rRenderContext, int n1,
 rRenderContext.SetLineColor(aHighlightColor);
 rRenderContext.SetFillColor(COL_TRANSPARENT);
 // Outer border
-rRenderContext.DrawRect(tools::Rectangle(Point(x - 1, y - 1), 
Size(nX + 3, nY + 3)));
+rRenderContext.DrawRect(tools::Rectangle(Point(x - 1, y - 1), 
Size(nX + 3, nY + 3)), 1, 1);
 // Inner border
-rRenderContext.DrawRect(tools::Rectangle(Point(x, y), Size(nX + 1, 
nY + 1)));
+rRenderContext.DrawRect(tools::Rectangle(Point(x, y), Size(nX + 1, 
nY + 1)), 1, 1);
 rRenderContext.SetLineColor(aLineCol);
 }
 
diff --git a/svx/source/dialog/searchcharmap.cxx 
b/svx/source/dialog/searchcharmap.cxx
index 637fbbe0d834..76a3a1a5f767 100644
--- a/svx/source/dialog/searchcharmap.cxx
+++ b/svx/source/dialog/searchcharmap.cxx
@@ -237,9 +237,9 @@ void SvxSearchCharSet::DrawChars_Impl(vcl::RenderContext& 
rRenderContext, int n1
 rRenderContext.SetLineColor(aHighlightColor);
 rRenderContext.SetFillColor(COL_TRANSPARENT);
 // Outer border
-rRenderContext.DrawRect(tools::Rectangle(Point(x - 1, y - 1), 
Size(nX + 3, nY + 3)));
+rRenderContext.DrawRect(tools::Rectangle(Point(x - 1, y - 1), 
Size(nX + 3, nY + 3)), 1, 1);
 // Inner border
-rRenderContext.DrawRect(tools::Rectangle(Point(x, y), Size(nX + 1, 
nY + 1)));
+rRenderContext.DrawRect(tools::Rectangle(Point(x, y), Size(nX + 1, 
nY + 1)), 1, 1);
 rRenderContext.SetLineColor(aLineCol);
 }
 


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

2023-02-27 Thread Andreas Heinisch (via logerrit)
 basctl/source/basicide/linenumberwindow.cxx |8 +++-
 svx/source/dialog/searchcharmap.cxx |   13 +
 2 files changed, 20 insertions(+), 1 deletion(-)

New commits:
commit 9da3d052b9048e9139b6943621f4eb6777422078
Author: Andreas Heinisch 
AuthorDate: Mon Feb 27 19:11:59 2023 +0100
Commit: Noel Grandin 
CommitDate: Tue Feb 28 07:15:19 2023 +

tdf#109214 - Highlight the favorites in the grid of special characters

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

diff --git a/svx/source/dialog/searchcharmap.cxx 
b/svx/source/dialog/searchcharmap.cxx
index 034ebd317a5a..637fbbe0d834 100644
--- a/svx/source/dialog/searchcharmap.cxx
+++ b/svx/source/dialog/searchcharmap.cxx
@@ -230,6 +230,19 @@ void SvxSearchCharSet::DrawChars_Impl(vcl::RenderContext& 
rRenderContext, int n1
 aPointTxTy.AdjustX(nXHDelta - 1 );
 }
 
+// tdf#109214 - highlight the favorite characters
+if (isFavChar(aCharStr, mxVirDev->GetFont().GetFamilyName()))
+{
+const Color aLineCol = rRenderContext.GetLineColor();
+rRenderContext.SetLineColor(aHighlightColor);
+rRenderContext.SetFillColor(COL_TRANSPARENT);
+// Outer border
+rRenderContext.DrawRect(tools::Rectangle(Point(x - 1, y - 1), 
Size(nX + 3, nY + 3)));
+// Inner border
+rRenderContext.DrawRect(tools::Rectangle(Point(x, y), Size(nX + 1, 
nY + 1)));
+rRenderContext.SetLineColor(aLineCol);
+}
+
 Color aTextCol = rRenderContext.GetTextColor();
 if (i != nSelectedIndex)
 {
commit dbd96e1c9a066979cb80ced6268edb148a8fc73b
Author: Andreas Heinisch 
AuthorDate: Mon Feb 27 13:49:10 2023 +0100
Commit: Noel Grandin 
CommitDate: Tue Feb 28 07:15:07 2023 +

tdf#153798 - Basic IDE: align line numbers to the right

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

diff --git a/basctl/source/basicide/linenumberwindow.cxx 
b/basctl/source/basicide/linenumberwindow.cxx
index 74ead4923863..9f5e85c72102 100644
--- a/basctl/source/basicide/linenumberwindow.cxx
+++ b/basctl/source/basicide/linenumberwindow.cxx
@@ -79,7 +79,13 @@ void LineNumberWindow::Paint(vcl::RenderContext& 
rRenderContext, const tools::Re
 sal_Int64 y = (nStartLine - 1) * static_cast(nLineHeight);
 rRenderContext.SetTextColor(m_FontColor);
 for (sal_uInt32 n = nStartLine; n <= nEndLine; ++n, y += nLineHeight)
-rRenderContext.DrawText(Point(0, y - m_nCurYOffset), 
OUString::number(n));
+{
+const OUString aLineNumber = OUString::number(n);
+// tdf#153798 - align line numbers to the right
+rRenderContext.DrawText(
+Point(m_nWidth - GetTextWidth(aLineNumber) - m_nBaseWidth / 2, y - 
m_nCurYOffset),
+aLineNumber);
+}
 
 // Resize the parent after calculating the new width and height values
 GetParent()->Resize();


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

2023-02-18 Thread Andreas Heinisch (via logerrit)
 sc/qa/unit/data/csv/testTdf82254-csv-bom.csv |3 +++
 sc/qa/unit/subsequent_filters_test.cxx   |   21 +
 sc/source/ui/dbgui/asciiopt.cxx  |8 +++-
 sc/source/ui/dbgui/imoptdlg.cxx  |7 ++-
 sc/source/ui/docshell/docsh.cxx  |   13 +
 sc/source/ui/docshell/impex.cxx  |   11 +++
 sc/source/ui/inc/asciiopt.hxx|3 +++
 sc/source/ui/inc/imoptdlg.hxx|3 ++-
 sc/source/ui/inc/impex.hxx   |4 
 sc/source/ui/unoobj/filtuno.cxx  |6 ++
 10 files changed, 72 insertions(+), 7 deletions(-)

New commits:
commit 509ab788baf54285b4e38f2560326657d97510fd
Author: Andreas Heinisch 
AuthorDate: Fri Jan 20 12:08:13 2023 +0100
Commit: Eike Rathke 
CommitDate: Sat Feb 18 20:05:49 2023 +

tdf#82254 - Don't remove UTF-8 BOM from CSV when saving file

Don't remove the byte-order-mark in the resulting CSV file
when it was present in the CSV source file.

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

diff --git a/sc/qa/unit/data/csv/testTdf82254-csv-bom.csv 
b/sc/qa/unit/data/csv/testTdf82254-csv-bom.csv
new file mode 100755
index ..eabb18da0bf0
--- /dev/null
+++ b/sc/qa/unit/data/csv/testTdf82254-csv-bom.csv
@@ -0,0 +1,3 @@
+col1  col2col3
+row1-1 row1-2  row1-3
+row2-1 row2-2  row2-3
diff --git a/sc/qa/unit/subsequent_filters_test.cxx 
b/sc/qa/unit/subsequent_filters_test.cxx
index 10cf129c0412..6af0460170be 100644
--- a/sc/qa/unit/subsequent_filters_test.cxx
+++ b/sc/qa/unit/subsequent_filters_test.cxx
@@ -54,6 +54,8 @@
 #include 
 #include 
 
+#include 
+
 #include 
 #include 
 
@@ -196,6 +198,7 @@ public:
 void testImportCrashes();
 void testTdf129681();
 void testTdf149484();
+void testTdf82254_csv_bom();
 void testEscapedUnicodeXLSX();
 void testTdf144758_DBDataDefaultOrientation();
 void testSharedFormulaXLS();
@@ -321,6 +324,7 @@ public:
 CPPUNIT_TEST(testImportCrashes);
 CPPUNIT_TEST(testTdf129681);
 CPPUNIT_TEST(testTdf149484);
+CPPUNIT_TEST(testTdf82254_csv_bom);
 CPPUNIT_TEST(testEscapedUnicodeXLSX);
 CPPUNIT_TEST(testTdf144758_DBDataDefaultOrientation);
 CPPUNIT_TEST(testSharedFormulaXLS);
@@ -3203,6 +3207,23 @@ void ScFiltersTest::testTdf149484()
 CPPUNIT_ASSERT_EQUAL(OUString("-TRUE-"), pDoc->GetString(0, 2, 0));
 }
 
+void ScFiltersTest::testTdf82254_csv_bom()
+{
+setImportFilterName(SC_TEXT_CSV_FILTER_NAME);
+createScDoc("csv/testTdf82254-csv-bom.csv");
+saveAndReload(SC_TEXT_CSV_FILTER_NAME);
+ScDocShell* pDocSh = getScDocShell();
+SvStream* pStream = pDocSh->GetMedium()->GetInStream();
+
+pStream->Seek(0);
+CPPUNIT_ASSERT_EQUAL(sal_uInt64(0), pStream->Tell());
+pStream->StartReadingUnicodeText(RTL_TEXTENCODING_UTF8);
+// Without the fix in place, this test would have failed with
+// - Expected: 3
+// - Actual  : 0 (no byte order mark was read)
+CPPUNIT_ASSERT_EQUAL(sal_uInt64(3), pStream->Tell());
+}
+
 void ScFiltersTest::testEscapedUnicodeXLSX()
 {
 createScDoc("xlsx/escape-unicode.xlsx");
diff --git a/sc/source/ui/dbgui/asciiopt.cxx b/sc/source/ui/dbgui/asciiopt.cxx
index 933491efbbe5..4234794ea279 100644
--- a/sc/source/ui/dbgui/asciiopt.cxx
+++ b/sc/source/ui/dbgui/asciiopt.cxx
@@ -37,6 +37,7 @@ ScAsciiOptions::ScAsciiOptions() :
 bSkipEmptyCells(false),
 bSaveAsShown(true),
 bSaveFormulas(false),
+bIncludeBOM(false),
 cTextSep( cDefaultTextSep ),
 eCharSet( osl_getThreadTextEncoding() ),
 eLang   ( LANGUAGE_SYSTEM ),
@@ -192,6 +193,9 @@ void ScAsciiOptions::ReadFromString( std::u16string_view 
rString )
 }
 else
 bEvaluateFormulas = true;   // default of versions that didn't add the 
parameter
+
+// Token 13: include BOM.
+bIncludeBOM = nPos >= 0 && o3tl::getToken(rString, 0, ',', nPos) == 
u"true";
 }
 
 OUString ScAsciiOptions::WriteToString() const
@@ -261,7 +265,9 @@ OUString ScAsciiOptions::WriteToString() const
// Token 11: sheet to export, always 0 for current sheet
",0," +
// Token 12: evaluate formulas in import
-   OUString::boolean( bEvaluateFormulas )
+   OUString::boolean( bEvaluateFormulas ) + "," +
+   // Token 13: include BOM
+   OUString::boolean(bIncludeBOM)
 );
 return aOutStr.makeStringAndClear();
 }
diff --git a/sc/source/ui/dbgui/imoptdlg.cxx b/sc/source/ui/dbgui/imoptdlg.cxx
index b285c6ae968e..2777eb9e450b 100644
--- a/sc/source/ui/dbgui/imoptdlg.cxx
+++ b/sc/source/ui/dbgui/imoptdlg.cxx
@@ -47,6 +47,7 @@ ScImportOptions::ScImportOptions( std::u16string_view rStr )
 bRemoveSpace = false;
 nSheetToExport = 0;
 

[Libreoffice-commits] core.git: framework/source officecfg/registry

2023-02-03 Thread Andreas Heinisch (via logerrit)
 framework/source/uielement/recentfilesmenucontroller.cxx   |   53 -
 officecfg/registry/schema/org/openoffice/Office/Common.xcs |7 +
 2 files changed, 57 insertions(+), 3 deletions(-)

New commits:
commit 6836776fa295293c114c267bca38d18603993a54
Author: Andreas Heinisch 
AuthorDate: Wed Feb 1 15:09:28 2023 +0100
Commit: Andreas Heinisch 
CommitDate: Fri Feb 3 09:46:01 2023 +

tdf#56696 - Sort recent document list according to current LibO module

Change-Id: I246dc9538e011b8981bea04963995559d2b43cc6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146456
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 

diff --git a/framework/source/uielement/recentfilesmenucontroller.cxx 
b/framework/source/uielement/recentfilesmenucontroller.cxx
index fe7de1c3d907..ef95d300058b 100644
--- a/framework/source/uielement/recentfilesmenucontroller.cxx
+++ b/framework/source/uielement/recentfilesmenucontroller.cxx
@@ -20,6 +20,8 @@
 #include 
 #include 
 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -34,6 +36,8 @@
 #include 
 #include 
 
+#include 
+
 using namespace css;
 using namespace com::sun::star::uno;
 using namespace com::sun::star::lang;
@@ -42,6 +46,7 @@ using namespace com::sun::star::beans;
 using namespace com::sun::star::util;
 
 #define MAX_MENU_ITEMS  99
+#define MAX_MENU_ITEMS_PER_MODULE  5
 
 namespace {
 
@@ -154,12 +159,50 @@ void RecentFilesMenuController::fillPopupMenu( Reference< 
css::awt::XPopupMenu >
 int nPickListMenuItems = std::min( aHistoryList.size(), 
MAX_MENU_ITEMS );
 m_aRecentFilesItems.clear();
 
+// tdf#56696 - retrieve expert configuration option if the recent document
+// list should show only files that can be handled by the current module
+const bool bShowCurrentModuleOnly
+= officecfg::Office::Common::History::ShowCurrentModuleOnly::get();
+
+size_t nItemPosModule = 0;
 if (( nPickListMenuItems > 0 ) && !m_bDisabled )
 {
-for ( int i = 0; i < nPickListMenuItems; i++ )
+size_t nItemPos = 0;
+if (m_aModuleName != "com.sun.star.frame.StartModule")
+{
+::comphelper::MimeConfigurationHelper aConfigHelper(
+comphelper::getProcessComponentContext());
+// Show the first MAX_MENU_ITEMS_PER_MODULE items of the current 
module
+// on top of the recent document list.
+for (int i = 0; i < nPickListMenuItems; i++)
+{
+const SvtHistoryOptions::HistoryItem& rPickListEntry = 
aHistoryList[i];
+const std::pair 
aPickListEntry(rPickListEntry.sURL,
+   
rPickListEntry.isReadOnly);
+if ((nItemPosModule < MAX_MENU_ITEMS_PER_MODULE || 
bShowCurrentModuleOnly)
+&& 
aConfigHelper.GetDocServiceNameFromFilter(rPickListEntry.sFilter)
+   == m_aModuleName)
+{
+m_aRecentFilesItems.insert(m_aRecentFilesItems.begin() + 
nItemPosModule,
+   aPickListEntry);
+nItemPos++;
+nItemPosModule++;
+}
+else if (!bShowCurrentModuleOnly)
+{
+m_aRecentFilesItems.insert(m_aRecentFilesItems.begin() + 
nItemPos,
+   aPickListEntry);
+nItemPos++;
+}
+}
+}
+else
 {
-const SvtHistoryOptions::HistoryItem& rPickListEntry = 
aHistoryList[i];
-m_aRecentFilesItems.emplace_back(rPickListEntry.sURL, 
rPickListEntry.isReadOnly);
+for (int i = 0; i < nPickListMenuItems; i++)
+{
+const SvtHistoryOptions::HistoryItem& rPickListEntry = 
aHistoryList[i];
+m_aRecentFilesItems.emplace_back(rPickListEntry.sURL, 
rPickListEntry.isReadOnly);
+}
 }
 }
 
@@ -220,6 +263,10 @@ void RecentFilesMenuController::fillPopupMenu( Reference< 
css::awt::XPopupMenu >
 
 rPopupMenu->setTipHelpText(sal_uInt16(i + 1), aTipHelpText);
 rPopupMenu->setCommand(sal_uInt16(i + 1), aURLString);
+
+// Show a separator after the MAX_MENU_ITEMS_PER_MODULE recent 
document items
+if (nItemPosModule > 0 && i == nItemPosModule - 1)
+rPopupMenu->insertSeparator(-1);
 }
 
 rPopupMenu->insertSeparator(-1);
diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs 
b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index f333657151f5..ced635fa4200 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -2233,6 +2233,13 @@
 
 true
   
+  
+
+  The entry specifies if the recent document list should 

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

2023-01-31 Thread Andreas Heinisch (via logerrit)
 sc/source/ui/dbgui/csvgrid.cxx |   18 ++
 1 file changed, 2 insertions(+), 16 deletions(-)

New commits:
commit 626b4d63431b4cd10aed515cb6d66899b4c60502
Author: Andreas Heinisch 
AuthorDate: Tue Jan 24 16:15:13 2023 +0100
Commit: Xisco Fauli 
CommitDate: Tue Jan 31 11:15:31 2023 +

tdf#45147 - CSV Import: Remove special handling for mixed script types

In the CSV import dialog, remove the special handling for mixed script 
types. Otherwise, right-to-left words appear in the wrong order.

The special handling of mixed script types was introduced in 
https://bz.apache.org/ooo/show_bug.cgi?id=60296 which is handled in the edit 
engine now.

Change-Id: Ic6dc3f2051ea41f79db5398a8442f78116da52de
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146096
Tested-by: Jenkins
Reviewed-by: Eike Rathke 
(cherry picked from commit a362c0145731031834bc3a73c8e3577bf6c12720)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146331
Reviewed-by: Xisco Fauli 

diff --git a/sc/source/ui/dbgui/csvgrid.cxx b/sc/source/ui/dbgui/csvgrid.cxx
index b44cca04dee7..16b7ca61e35f 100644
--- a/sc/source/ui/dbgui/csvgrid.cxx
+++ b/sc/source/ui/dbgui/csvgrid.cxx
@@ -1130,22 +1130,8 @@ void ScCsvGrid::ImplDrawCellText( const Point& rPos, 
const OUString& rText )
 OUString aPlainText = rText.replaceAll( "\t", " " );
 aPlainText = aPlainText.replaceAll( "\n", " " );
 mpEditEngine->SetPaperSize( maEdEngSize );
-
-/*  #i60296# If string contains mixed script types, the space character
-U+0020 may be drawn with a wrong width (from non-fixed-width Asian or
-Complex font). Now we draw every non-space portion separately. */
-sal_Int32 nCharIxInt {aPlainText.isEmpty() ? -1 : 0};
-while (nCharIxInt>=0)
-{
-sal_Int32 nBeginIx = nCharIxInt;
-const OUString aToken = aPlainText.getToken( 0, ' ', nCharIxInt );
-if( !aToken.isEmpty() )
-{
-sal_Int32 nX = rPos.X() + GetCharWidth() * nBeginIx;
-mpEditEngine->SetTextCurrentDefaults( aToken );
-mpEditEngine->Draw(*mpBackgrDev, Point(nX, rPos.Y()));
-}
-}
+mpEditEngine->SetTextCurrentDefaults(aPlainText);
+mpEditEngine->Draw(*mpBackgrDev, rPos);
 
 sal_Int32 nCharIx = 0;
 while( (nCharIx = rText.indexOf( '\t', nCharIx )) != -1 )


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

2023-01-30 Thread Andreas Heinisch (via logerrit)
 sc/source/ui/dbgui/csvgrid.cxx |   18 ++
 1 file changed, 2 insertions(+), 16 deletions(-)

New commits:
commit a362c0145731031834bc3a73c8e3577bf6c12720
Author: Andreas Heinisch 
AuthorDate: Tue Jan 24 16:15:13 2023 +0100
Commit: Eike Rathke 
CommitDate: Mon Jan 30 17:25:08 2023 +

tdf#45147 - CSV Import: Remove special handling for mixed script types

In the CSV import dialog, remove the special handling for mixed script 
types. Otherwise, right-to-left words appear in the wrong order.

The special handling of mixed script types was introduced in 
https://bz.apache.org/ooo/show_bug.cgi?id=60296 which is handled in the edit 
engine now.

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

diff --git a/sc/source/ui/dbgui/csvgrid.cxx b/sc/source/ui/dbgui/csvgrid.cxx
index b44cca04dee7..16b7ca61e35f 100644
--- a/sc/source/ui/dbgui/csvgrid.cxx
+++ b/sc/source/ui/dbgui/csvgrid.cxx
@@ -1130,22 +1130,8 @@ void ScCsvGrid::ImplDrawCellText( const Point& rPos, 
const OUString& rText )
 OUString aPlainText = rText.replaceAll( "\t", " " );
 aPlainText = aPlainText.replaceAll( "\n", " " );
 mpEditEngine->SetPaperSize( maEdEngSize );
-
-/*  #i60296# If string contains mixed script types, the space character
-U+0020 may be drawn with a wrong width (from non-fixed-width Asian or
-Complex font). Now we draw every non-space portion separately. */
-sal_Int32 nCharIxInt {aPlainText.isEmpty() ? -1 : 0};
-while (nCharIxInt>=0)
-{
-sal_Int32 nBeginIx = nCharIxInt;
-const OUString aToken = aPlainText.getToken( 0, ' ', nCharIxInt );
-if( !aToken.isEmpty() )
-{
-sal_Int32 nX = rPos.X() + GetCharWidth() * nBeginIx;
-mpEditEngine->SetTextCurrentDefaults( aToken );
-mpEditEngine->Draw(*mpBackgrDev, Point(nX, rPos.Y()));
-}
-}
+mpEditEngine->SetTextCurrentDefaults(aPlainText);
+mpEditEngine->Draw(*mpBackgrDev, rPos);
 
 sal_Int32 nCharIx = 0;
 while( (nCharIx = rText.indexOf( '\t', nCharIx )) != -1 )


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

2023-01-26 Thread Andreas Heinisch (via logerrit)
 sw/qa/uitest/writer_tests7/tdf135938.py |   25 +++--
 1 file changed, 15 insertions(+), 10 deletions(-)

New commits:
commit 3bbb77bef7e5d05b8584330514be9e384178936e
Author: Andreas Heinisch 
AuthorDate: Thu Jan 19 15:57:27 2023 +0100
Commit: Xisco Fauli 
CommitDate: Thu Jan 26 16:27:54 2023 +

tdf#135938 - Search for "insert reference" tree entry

Instead of assuming that the "insert reference" entry is always the second 
item of the menu tree, search for the correct child in the tree list. This 
commit addresses the failing build from 
https://gerrit.libreoffice.org/c/core/+/140985.

Change-Id: I6f0d7021ab6f632784cab85656823c69f90baf60
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145816
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 
(cherry picked from commit a29ec09f7c2a01f131095fd9b2ecafa0812e8325)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146196
Reviewed-by: Xisco Fauli 

diff --git a/sw/qa/uitest/writer_tests7/tdf135938.py 
b/sw/qa/uitest/writer_tests7/tdf135938.py
index 013da93624da..00a72bec26ff 100755
--- a/sw/qa/uitest/writer_tests7/tdf135938.py
+++ b/sw/qa/uitest/writer_tests7/tdf135938.py
@@ -31,16 +31,21 @@ class tdf135938(UITestCase):
 xName.executeAction("TYPE", mkPropertyValues({"TEXT": "DEF"}))
 xInsert.executeAction("CLICK", tuple())
 
-# Select insert reference type
-xTreeEntry = xTreelistType.getChild('1')
-self.assertEqual(get_state_as_dict(xTreeEntry)["Text"], 
"Insert Reference")
-xTreeEntry.executeAction("SELECT", tuple())
+# Search for insert reference type
+xFilter = None
+for childIx in range(len(xTreelistType.getChildren())):
+xTreeEntry = xTreelistType.getChild(childIx)
+if get_state_as_dict(xTreeEntry)["Text"] == "Insert 
Reference":
+xTreeEntry.executeAction("SELECT", tuple())
+# Filter the cross references
+xFilter = xDialog.getChild("filter")
+xFilter.executeAction("TYPE", 
mkPropertyValues({"TEXT": "A"}))
+# Without the fix in place, this test would have 
failed with
+# AssertionError: 'ABC' != 'DEF', i.e., the text of 
the name field did not change
+self.assertEqual(get_state_as_dict(xName)["Text"], 
"ABC")
+break
 
-# Filter the cross references
-xFilter = xDialog.getChild("filter")
-xFilter.executeAction("TYPE", mkPropertyValues({"TEXT": "A"}))
-# Without the fix in place, this test would have failed with
-# AssertionError: 'ABC' != 'DEF', i.e., the text of the name 
field did not change
-self.assertEqual(get_state_as_dict(xName)["Text"], "ABC")
+# Check if insert reference entry was found
+self.assertFalse(xFilter is None)
 
 # vim: set shiftwidth=4 softtabstop=4 expandtab:


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

2023-01-26 Thread Andreas Heinisch (via logerrit)
 sw/qa/uitest/writer_tests7/tdf135938.py |   25 +++--
 1 file changed, 15 insertions(+), 10 deletions(-)

New commits:
commit 313b04a8ab3cf67223c18f70b348017173a95f6b
Author: Andreas Heinisch 
AuthorDate: Thu Jan 19 15:57:27 2023 +0100
Commit: Xisco Fauli 
CommitDate: Thu Jan 26 16:16:36 2023 +

tdf#135938 - Search for "insert reference" tree entry

Instead of assuming that the "insert reference" entry is always the second 
item of the menu tree, search for the correct child in the tree list. This 
commit addresses the failing build from 
https://gerrit.libreoffice.org/c/core/+/140985.

Change-Id: I6f0d7021ab6f632784cab85656823c69f90baf60
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145816
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 
(cherry picked from commit a29ec09f7c2a01f131095fd9b2ecafa0812e8325)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146195
Tested-by: Xisco Fauli 
Reviewed-by: Xisco Fauli 

diff --git a/sw/qa/uitest/writer_tests7/tdf135938.py 
b/sw/qa/uitest/writer_tests7/tdf135938.py
index 013da93624da..00a72bec26ff 100755
--- a/sw/qa/uitest/writer_tests7/tdf135938.py
+++ b/sw/qa/uitest/writer_tests7/tdf135938.py
@@ -31,16 +31,21 @@ class tdf135938(UITestCase):
 xName.executeAction("TYPE", mkPropertyValues({"TEXT": "DEF"}))
 xInsert.executeAction("CLICK", tuple())
 
-# Select insert reference type
-xTreeEntry = xTreelistType.getChild('1')
-self.assertEqual(get_state_as_dict(xTreeEntry)["Text"], 
"Insert Reference")
-xTreeEntry.executeAction("SELECT", tuple())
+# Search for insert reference type
+xFilter = None
+for childIx in range(len(xTreelistType.getChildren())):
+xTreeEntry = xTreelistType.getChild(childIx)
+if get_state_as_dict(xTreeEntry)["Text"] == "Insert 
Reference":
+xTreeEntry.executeAction("SELECT", tuple())
+# Filter the cross references
+xFilter = xDialog.getChild("filter")
+xFilter.executeAction("TYPE", 
mkPropertyValues({"TEXT": "A"}))
+# Without the fix in place, this test would have 
failed with
+# AssertionError: 'ABC' != 'DEF', i.e., the text of 
the name field did not change
+self.assertEqual(get_state_as_dict(xName)["Text"], 
"ABC")
+break
 
-# Filter the cross references
-xFilter = xDialog.getChild("filter")
-xFilter.executeAction("TYPE", mkPropertyValues({"TEXT": "A"}))
-# Without the fix in place, this test would have failed with
-# AssertionError: 'ABC' != 'DEF', i.e., the text of the name 
field did not change
-self.assertEqual(get_state_as_dict(xName)["Text"], "ABC")
+# Check if insert reference entry was found
+self.assertFalse(xFilter is None)
 
 # vim: set shiftwidth=4 softtabstop=4 expandtab:


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

2023-01-25 Thread Andreas Heinisch (via logerrit)
 basic/qa/vba_tests/chr.vb |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 263c15ee238e04c7b25d36cdbb9ab21c0bdf518d
Author: Andreas Heinisch 
AuthorDate: Wed Jan 25 11:16:00 2023 +
Commit: Andreas Heinisch 
CommitDate: Thu Jan 26 07:45:25 2023 +

Delete extra whitespaces inserted by the editor

Change-Id: I89ef4d04e27e52f5ee6168f368e23f96e112a8be
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146085
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 

diff --git a/basic/qa/vba_tests/chr.vb b/basic/qa/vba_tests/chr.vb
index 5dc85a0c9157..f9bc7ea12aa5 100644
--- a/basic/qa/vba_tests/chr.vb
+++ b/basic/qa/vba_tests/chr.vb
@@ -21,7 +21,7 @@ Sub verify_testCHR()
 TestUtil.AssertEqual(Chr(87),  "W", "Chr(87)")
 TestUtil.AssertEqual(Chr(105), "i", "Chr(105)")
 TestUtil.AssertEqual(Chr(35),  "#", "Chr(35)")
-
+
 ' tdf#145693 - argument name should be 'charcode' instead of 'string'
 TestUtil.AssertEqual(Chr(charcode:=35),  "#", "Chr(charcode:=35)")
 


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

2023-01-24 Thread Andreas Heinisch (via logerrit)
 svtools/source/control/tabbar.cxx |   11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

New commits:
commit be86c8f2432623fdb8ed4f22ca08c35121fd8bec
Author: Andreas Heinisch 
AuthorDate: Thu Jan 19 08:56:04 2023 +0100
Commit: Andreas Heinisch 
CommitDate: Tue Jan 24 08:04:02 2023 +

tdf#100584 - Arrange sheets in the tab bar depending on the RTL settings

Change-Id: Id10bfd18029651790be943b74745016f6ad637ff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145765
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 

diff --git a/svtools/source/control/tabbar.cxx 
b/svtools/source/control/tabbar.cxx
index 7daba1791d3e..b09c748feb5e 100644
--- a/svtools/source/control/tabbar.cxx
+++ b/svtools/source/control/tabbar.cxx
@@ -704,10 +704,15 @@ void TabBar::ImplFormat()
 if (!mbFormat)
 return;
 
-sal_uInt16 nItemIndex = 0;
 tools::Long x = mnOffX;
-for (auto & rItem : mpImpl->maItemList)
+
+const size_t nItemListSize = mpImpl->maItemList.size();
+for (size_t nItemIndex = 0; nItemIndex < nItemListSize; nItemIndex++)
 {
+// tdf#100584 - arrange sheets depending on the RTL settings
+auto& rItem = mbMirrored ? mpImpl->maItemList[nItemListSize - 
nItemIndex - 1]
+ : mpImpl->maItemList[nItemIndex];
+
 // At all non-visible tabs an empty rectangle is set
 if ((nItemIndex + 1 < mnFirstPos) || (x > mnLastOffX))
 rItem.maRect.SetEmpty();
@@ -735,8 +740,6 @@ void TabBar::ImplFormat()
 rItem.maRect.SetLeft(nNewLeft);
 }
 }
-
-nItemIndex++;
 }
 
 mbFormat = false;


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

2023-01-19 Thread Andreas Heinisch (via logerrit)
 sw/qa/uitest/writer_tests7/tdf135938.py |   25 +++--
 1 file changed, 15 insertions(+), 10 deletions(-)

New commits:
commit a29ec09f7c2a01f131095fd9b2ecafa0812e8325
Author: Andreas Heinisch 
AuthorDate: Thu Jan 19 15:57:27 2023 +0100
Commit: Andreas Heinisch 
CommitDate: Thu Jan 19 22:57:59 2023 +

tdf#135938 - Search for "insert reference" tree entry

Instead of assuming that the "insert reference" entry is always the second 
item of the menu tree, search for the correct child in the tree list. This 
commit addresses the failing build from 
https://gerrit.libreoffice.org/c/core/+/140985.

Change-Id: I6f0d7021ab6f632784cab85656823c69f90baf60
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145816
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 

diff --git a/sw/qa/uitest/writer_tests7/tdf135938.py 
b/sw/qa/uitest/writer_tests7/tdf135938.py
index 013da93624da..00a72bec26ff 100755
--- a/sw/qa/uitest/writer_tests7/tdf135938.py
+++ b/sw/qa/uitest/writer_tests7/tdf135938.py
@@ -31,16 +31,21 @@ class tdf135938(UITestCase):
 xName.executeAction("TYPE", mkPropertyValues({"TEXT": "DEF"}))
 xInsert.executeAction("CLICK", tuple())
 
-# Select insert reference type
-xTreeEntry = xTreelistType.getChild('1')
-self.assertEqual(get_state_as_dict(xTreeEntry)["Text"], 
"Insert Reference")
-xTreeEntry.executeAction("SELECT", tuple())
+# Search for insert reference type
+xFilter = None
+for childIx in range(len(xTreelistType.getChildren())):
+xTreeEntry = xTreelistType.getChild(childIx)
+if get_state_as_dict(xTreeEntry)["Text"] == "Insert 
Reference":
+xTreeEntry.executeAction("SELECT", tuple())
+# Filter the cross references
+xFilter = xDialog.getChild("filter")
+xFilter.executeAction("TYPE", 
mkPropertyValues({"TEXT": "A"}))
+# Without the fix in place, this test would have 
failed with
+# AssertionError: 'ABC' != 'DEF', i.e., the text of 
the name field did not change
+self.assertEqual(get_state_as_dict(xName)["Text"], 
"ABC")
+break
 
-# Filter the cross references
-xFilter = xDialog.getChild("filter")
-xFilter.executeAction("TYPE", mkPropertyValues({"TEXT": "A"}))
-# Without the fix in place, this test would have failed with
-# AssertionError: 'ABC' != 'DEF', i.e., the text of the name 
field did not change
-self.assertEqual(get_state_as_dict(xName)["Text"], "ABC")
+# Check if insert reference entry was found
+self.assertFalse(xFilter is None)
 
 # vim: set shiftwidth=4 softtabstop=4 expandtab:


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

2023-01-16 Thread Andreas Heinisch (via logerrit)
 sc/qa/extras/macros-test.cxx|   34 ++
 sc/source/ui/unoobj/viewuno.cxx |9 -
 2 files changed, 42 insertions(+), 1 deletion(-)

New commits:
commit bf39a7a45a9e6d1292a4425e5d25f9ce6551205a
Author: Andreas Heinisch 
AuthorDate: Thu Jan 12 07:46:43 2023 +0100
Commit: Xisco Fauli 
CommitDate: Mon Jan 16 11:19:45 2023 +

tdf#147122 - Return cell object when a simple selection is merged

Change-Id: I4ddd3b3a804f8300a5ec15526f4c9c77aaf45fc5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145378
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 
(cherry picked from commit b9411e587586750f36ba9009b5f1e29fe461d8b5)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145452
Reviewed-by: Xisco Fauli 

diff --git a/sc/qa/extras/macros-test.cxx b/sc/qa/extras/macros-test.cxx
index f53389f40459..24379362bed5 100644
--- a/sc/qa/extras/macros-test.cxx
+++ b/sc/qa/extras/macros-test.cxx
@@ -71,6 +71,7 @@ public:
 void testTdf107572();
 void testShapeLayerId();
 void testFunctionAccessIndirect();
+void testTdf147122();
 
 CPPUNIT_TEST_SUITE(ScMacrosTest);
 CPPUNIT_TEST(testStarBasic);
@@ -105,6 +106,7 @@ public:
 CPPUNIT_TEST(testTdf107572);
 CPPUNIT_TEST(testShapeLayerId);
 CPPUNIT_TEST(testFunctionAccessIndirect);
+CPPUNIT_TEST(testTdf147122);
 
 CPPUNIT_TEST_SUITE_END();
 };
@@ -898,6 +900,38 @@ void ScMacrosTest::testFunctionAccessIndirect()
 CPPUNIT_ASSERT_EQUAL(css::uno::Any(OUString("a1")), aResult);
 }
 
+void ScMacrosTest::testTdf147122()
+{
+mxComponent = loadFromDesktop("private:factory/scalc");
+
+css::uno::Reference xDocScr(mxComponent, 
UNO_QUERY_THROW);
+auto xLibs = xDocScr->getBasicLibraries();
+auto xLibrary = xLibs->createLibrary("TestLibrary");
+xLibrary->insertByName(
+"TestModule",
+uno::Any(
+OUString("Function TestMergedSelection\n"
+ // Insert test string into cell A1
+ "  oActiveSheet = 
ThisComponent.CurrentController.ActiveSheet\n"
+ "  oActiveCell = 
oActiveSheet.getCellRangeByName(\"A1\")\n"
+ "  oActiveCell.setString(\"This is a test\")\n"
+ // Merge A1:B2 cell range and return the content of the 
merged range
+ "  oRange = oActiveSheet.getCellRangeByName(\"A1:B2\")\n"
+ "  ThisComponent.getCurrentController.Select(oRange)\n"
+ "  oActiveCell = ThisComponent.CurrentSelection\n"
+ "  oActiveCell.Merge(True)\n"
+ "  TestMergedSelection = 
ThisComponent.getCurrentSelection().getString()\n"
+ "End Function\n")));
+
+Any aRet = 
executeMacro("vnd.sun.Star.script:TestLibrary.TestModule.TestMergedSelection?"
+"language=Basic=document");
+// Without the fix in place, this test would have failed with
+// - Expression: false
+// - Unexpected dialog: Error: BASIC runtime error.
+// Property or method not found: getString.
+CPPUNIT_ASSERT_EQUAL(Any(OUString("This is a test")), aRet);
+}
+
 ScMacrosTest::ScMacrosTest()
   : UnoApiXmlTest("/sc/qa/extras/testdocuments")
 {
diff --git a/sc/source/ui/unoobj/viewuno.cxx b/sc/source/ui/unoobj/viewuno.cxx
index 5a7a8a391427..f8940594746c 100644
--- a/sc/source/ui/unoobj/viewuno.cxx
+++ b/sc/source/ui/unoobj/viewuno.cxx
@@ -70,6 +70,7 @@
 #include 
 #include 
 #include 
+#include 
 
 using namespace com::sun::star;
 
@@ -872,7 +873,13 @@ uno::Any SAL_CALL ScTabViewObj::getSelection()
 ScMarkType eMarkType = rViewData.GetSimpleArea(aRange);
 if ( nTabs == 1 && (eMarkType == SC_MARK_SIMPLE) )
 {
-if (aRange.aStart == aRange.aEnd)
+// tdf#147122 - return cell object when a simple selection is 
merged
+ScDocument& rDoc = pDocSh->GetDocument();
+const ScPatternAttr* pMarkPattern = rDoc.GetPattern(aRange.aStart);
+if (aRange.aStart == aRange.aEnd
+|| (pMarkPattern
+&& pMarkPattern->GetItemSet().GetItemState(ATTR_MERGE, 
false)
+   == SfxItemState::SET))
 pObj = new ScCellObj( pDocSh, aRange.aStart );
 else
 pObj = new ScCellRangeObj( pDocSh, aRange );


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

2023-01-16 Thread Andreas Heinisch (via logerrit)
 sc/qa/extras/macros-test.cxx|   34 ++
 sc/source/ui/unoobj/viewuno.cxx |9 -
 2 files changed, 42 insertions(+), 1 deletion(-)

New commits:
commit b9411e587586750f36ba9009b5f1e29fe461d8b5
Author: Andreas Heinisch 
AuthorDate: Thu Jan 12 07:46:43 2023 +0100
Commit: Andreas Heinisch 
CommitDate: Mon Jan 16 08:28:49 2023 +

tdf#147122 - Return cell object when a simple selection is merged

Change-Id: I4ddd3b3a804f8300a5ec15526f4c9c77aaf45fc5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145378
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 

diff --git a/sc/qa/extras/macros-test.cxx b/sc/qa/extras/macros-test.cxx
index f53389f40459..24379362bed5 100644
--- a/sc/qa/extras/macros-test.cxx
+++ b/sc/qa/extras/macros-test.cxx
@@ -71,6 +71,7 @@ public:
 void testTdf107572();
 void testShapeLayerId();
 void testFunctionAccessIndirect();
+void testTdf147122();
 
 CPPUNIT_TEST_SUITE(ScMacrosTest);
 CPPUNIT_TEST(testStarBasic);
@@ -105,6 +106,7 @@ public:
 CPPUNIT_TEST(testTdf107572);
 CPPUNIT_TEST(testShapeLayerId);
 CPPUNIT_TEST(testFunctionAccessIndirect);
+CPPUNIT_TEST(testTdf147122);
 
 CPPUNIT_TEST_SUITE_END();
 };
@@ -898,6 +900,38 @@ void ScMacrosTest::testFunctionAccessIndirect()
 CPPUNIT_ASSERT_EQUAL(css::uno::Any(OUString("a1")), aResult);
 }
 
+void ScMacrosTest::testTdf147122()
+{
+mxComponent = loadFromDesktop("private:factory/scalc");
+
+css::uno::Reference xDocScr(mxComponent, 
UNO_QUERY_THROW);
+auto xLibs = xDocScr->getBasicLibraries();
+auto xLibrary = xLibs->createLibrary("TestLibrary");
+xLibrary->insertByName(
+"TestModule",
+uno::Any(
+OUString("Function TestMergedSelection\n"
+ // Insert test string into cell A1
+ "  oActiveSheet = 
ThisComponent.CurrentController.ActiveSheet\n"
+ "  oActiveCell = 
oActiveSheet.getCellRangeByName(\"A1\")\n"
+ "  oActiveCell.setString(\"This is a test\")\n"
+ // Merge A1:B2 cell range and return the content of the 
merged range
+ "  oRange = oActiveSheet.getCellRangeByName(\"A1:B2\")\n"
+ "  ThisComponent.getCurrentController.Select(oRange)\n"
+ "  oActiveCell = ThisComponent.CurrentSelection\n"
+ "  oActiveCell.Merge(True)\n"
+ "  TestMergedSelection = 
ThisComponent.getCurrentSelection().getString()\n"
+ "End Function\n")));
+
+Any aRet = 
executeMacro("vnd.sun.Star.script:TestLibrary.TestModule.TestMergedSelection?"
+"language=Basic=document");
+// Without the fix in place, this test would have failed with
+// - Expression: false
+// - Unexpected dialog: Error: BASIC runtime error.
+// Property or method not found: getString.
+CPPUNIT_ASSERT_EQUAL(Any(OUString("This is a test")), aRet);
+}
+
 ScMacrosTest::ScMacrosTest()
   : UnoApiXmlTest("/sc/qa/extras/testdocuments")
 {
diff --git a/sc/source/ui/unoobj/viewuno.cxx b/sc/source/ui/unoobj/viewuno.cxx
index 5a7a8a391427..f8940594746c 100644
--- a/sc/source/ui/unoobj/viewuno.cxx
+++ b/sc/source/ui/unoobj/viewuno.cxx
@@ -70,6 +70,7 @@
 #include 
 #include 
 #include 
+#include 
 
 using namespace com::sun::star;
 
@@ -872,7 +873,13 @@ uno::Any SAL_CALL ScTabViewObj::getSelection()
 ScMarkType eMarkType = rViewData.GetSimpleArea(aRange);
 if ( nTabs == 1 && (eMarkType == SC_MARK_SIMPLE) )
 {
-if (aRange.aStart == aRange.aEnd)
+// tdf#147122 - return cell object when a simple selection is 
merged
+ScDocument& rDoc = pDocSh->GetDocument();
+const ScPatternAttr* pMarkPattern = rDoc.GetPattern(aRange.aStart);
+if (aRange.aStart == aRange.aEnd
+|| (pMarkPattern
+&& pMarkPattern->GetItemSet().GetItemState(ATTR_MERGE, 
false)
+   == SfxItemState::SET))
 pObj = new ScCellObj( pDocSh, aRange.aStart );
 else
 pObj = new ScCellRangeObj( pDocSh, aRange );


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

2023-01-10 Thread Andreas Heinisch (via logerrit)
 sw/qa/uitest/writer_tests3/tdf124088.py |   33 
 sw/source/ui/misc/glossary.cxx  |   24 ++-
 2 files changed, 52 insertions(+), 5 deletions(-)

New commits:
commit fbabd959060655a77188447c9fc0112e0ab8474c
Author: Andreas Heinisch 
AuthorDate: Sun Jan 8 12:31:51 2023 +0100
Commit: Andreas Heinisch 
CommitDate: Wed Jan 11 06:58:42 2023 +

tdf#124088 - Propose AutoText and shortcut name based on selected text

Change-Id: I55ab9b41a32d7a4e41465f375179997a5c8dd06a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145175
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 

diff --git a/sw/qa/uitest/writer_tests3/tdf124088.py 
b/sw/qa/uitest/writer_tests3/tdf124088.py
new file mode 100755
index ..6ff65dad7631
--- /dev/null
+++ b/sw/qa/uitest/writer_tests3/tdf124088.py
@@ -0,0 +1,33 @@
+# -*- 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, get_state_as_dict
+
+class tdf124088(UITestCase):
+
+def test_tdf124088_propose_autotext(self):
+with self.ui_test.create_doc_in_start_center("writer"):
+# Insert a random text greater than 25 characters and select it
+xWriterDoc = self.xUITest.getTopFocusWindow()
+xWriterEdit = xWriterDoc.getChild("writer_edit")
+type_text(xWriterEdit, "This is a sample paragraph")
+self.xUITest.executeCommand(".uno:SelectAll")
+
+# Open auto text dialog and check proposed text
+with 
self.ui_test.execute_dialog_through_command(".uno:EditGlossary") as 
xEditGlossaryDlg:
+xName = xEditGlossaryDlg.getChild("name")
+self.assertEqual(get_state_as_dict(xName)["Text"], "This is a 
sample")
+# Click on a group entry, proposed auto text should remain
+xCategory = xEditGlossaryDlg.getChild("category")
+xMyAutoText = xCategory.getChild("2")
+xMyAutoText.executeAction("SELECT", tuple())
+self.assertEqual(get_state_as_dict(xName)["Text"], "This is a 
sample")
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx
index ae3ce4f0..a1e4a60fe883 100644
--- a/sw/source/ui/misc/glossary.cxx
+++ b/sw/source/ui/misc/glossary.cxx
@@ -410,12 +410,7 @@ IMPL_LINK(SwGlossaryDlg, GrpSelect, weld::TreeView&, rBox, 
void)
 ShowAutoText(::GetCurrGlosGroup(), m_xShortNameEdit->get_text());
 }
 else
-{
-m_xNameED->set_text("");
-m_xShortNameEdit->set_text("");
-m_xShortNameEdit->set_sensitive(false);
 ShowAutoText("", "");
-}
 // update controls
 NameModify(*m_xShortNameEdit);
 if( SfxRequest::HasMacroRecorder( m_pShell->GetView().GetViewFrame() ) )
@@ -904,6 +899,25 @@ void SwGlossaryDlg::Init()
 m_xInsertTipCB->set_active( rCfg.IsAutoTextTip() );
 
m_xInsertTipCB->set_sensitive(!officecfg::Office::Writer::AutoFunction::Text::ShowToolTip::isReadOnly());
 m_xInsertTipCB->connect_toggled(LINK(this, SwGlossaryDlg, CheckBoxHdl));
+
+// tdf#124088 - propose autotext and shortcut name based on selected text
+if (m_pShell->HasSelection())
+{
+OUString aSelText;
+m_pShell->GetSelectedText(aSelText, ParaBreakType::ToBlank);
+
+aSelText = aSelText.trim();
+if (aSelText.getLength() > 25)
+{
+aSelText = aSelText.copy(0, 25);
+if (const sal_Int32 nBlankIndex = aSelText.lastIndexOf(' '); 
nBlankIndex != -1)
+aSelText = aSelText.copy(0, nBlankIndex);
+}
+
+m_xNameED->set_text(aSelText);
+m_xNameED->select_region(0, -1);
+m_xShortNameEdit->set_text(lcl_GetValidShortCut(aSelText));
+}
 }
 
 // KeyInput for ShortName - Edits without Spaces


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

2023-01-09 Thread Andreas Heinisch (via logerrit)
 sc/qa/uitest/calc_tests6/moveCopySheet.py |   13 +
 sc/source/ui/miscdlgs/mvtabdlg.cxx|1 -
 vcl/source/uitest/uiobject.cxx|1 +
 3 files changed, 14 insertions(+), 1 deletion(-)

New commits:
commit b551acd0a370809fc12e6552dad87447fe5d9dfd
Author: Andreas Heinisch 
AuthorDate: Thu Jan 5 08:21:35 2023 +0100
Commit: Xisco Fauli 
CommitDate: Mon Jan 9 20:16:10 2023 +

tdf#56973 - Copy/paste (single) sheet is checked but not enabled

Enable the "copy" radio button in the move/copy sheet dialog, if there is 
just a single sheet in a spreadsheet document. Otherwise, users get the 
impression that a single sheet cannot be copied because the "copy" radio button 
is selected but not enabled, i.e., greyed out.

Change-Id: Icf98973585491b0c8c9a74aad3900f6cc2895d11
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145064
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 
(cherry picked from commit a8d3b8985a79c216c3c132fb2e6bb0f85a27831a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145214
Reviewed-by: Xisco Fauli 

diff --git a/sc/qa/uitest/calc_tests6/moveCopySheet.py 
b/sc/qa/uitest/calc_tests6/moveCopySheet.py
index a80b7c329173..80bd9f830a27 100644
--- a/sc/qa/uitest/calc_tests6/moveCopySheet.py
+++ b/sc/qa/uitest/calc_tests6/moveCopySheet.py
@@ -63,6 +63,19 @@ class moveCopySheet(UITestCase):
 self.assertEqual(document.Sheets[1].Name, "Sheet1")
 self.assertEqual(document.Sheets[2].Name, "moveName")
 
+# tdf#56973 - copy/paste (single) sheet is checked but not enabled
+def test_tdf56973_copy_paste_inactive(self):
+with self.ui_test.create_doc_in_start_center("calc"):
+with self.ui_test.execute_dialog_through_command(".uno:Move") as 
xDialog:
+# A single sheet can only be copied
+xCopyButton = xDialog.getChild("copy")
+self.assertEqual(get_state_as_dict(xCopyButton)["Checked"], 
"true")
+self.assertEqual(get_state_as_dict(xCopyButton)["Enabled"], 
"true")
+# A single sheet can not be moved
+xMoveButton = xDialog.getChild("move")
+self.assertEqual(get_state_as_dict(xMoveButton)["Checked"], 
"false")
+self.assertEqual(get_state_as_dict(xMoveButton)["Enabled"], 
"false")
+
 #tdf#139464 Set OK button label to selected action: Move or Copy
 def test_tdf139464_move_sheet(self):
 with self.ui_test.create_doc_in_start_center("calc"):
diff --git a/sc/source/ui/miscdlgs/mvtabdlg.cxx 
b/sc/source/ui/miscdlgs/mvtabdlg.cxx
index 9cc587aa56e0..e64a29b6b471 100644
--- a/sc/source/ui/miscdlgs/mvtabdlg.cxx
+++ b/sc/source/ui/miscdlgs/mvtabdlg.cxx
@@ -74,7 +74,6 @@ void ScMoveTableDlg::SetForceCopyTable()
 {
 m_xBtnCopy->set_active(true);
 m_xBtnMove->set_sensitive(false);
-m_xBtnCopy->set_sensitive(false);
 SetOkBtnLabel();
 }
 
diff --git a/vcl/source/uitest/uiobject.cxx b/vcl/source/uitest/uiobject.cxx
index 0b55d4c96857..9b8616c3906b 100644
--- a/vcl/source/uitest/uiobject.cxx
+++ b/vcl/source/uitest/uiobject.cxx
@@ -1018,6 +1018,7 @@ StringMap RadioButtonUIObject::get_state()
 {
 StringMap aMap = WindowUIObject::get_state();
 aMap["Checked"] = OUString::boolean(mxRadioButton->IsChecked());
+aMap["Enabled"] = OUString::boolean(mxRadioButton->IsEnabled());
 
 return aMap;
 }


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

2023-01-05 Thread Andreas Heinisch (via logerrit)
 sc/qa/uitest/calc_tests6/moveCopySheet.py |   13 +
 sc/source/ui/miscdlgs/mvtabdlg.cxx|1 -
 vcl/source/uitest/uiobject.cxx|1 +
 3 files changed, 14 insertions(+), 1 deletion(-)

New commits:
commit a8d3b8985a79c216c3c132fb2e6bb0f85a27831a
Author: Andreas Heinisch 
AuthorDate: Thu Jan 5 08:21:35 2023 +0100
Commit: Andreas Heinisch 
CommitDate: Thu Jan 5 16:06:06 2023 +

tdf#56973 - Copy/paste (single) sheet is checked but not enabled

Enable the "copy" radio button in the move/copy sheet dialog, if there is 
just a single sheet in a spreadsheet document. Otherwise, users get the 
impression that a single sheet cannot be copied because the "copy" radio button 
is selected but not enabled, i.e., greyed out.

Change-Id: Icf98973585491b0c8c9a74aad3900f6cc2895d11
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145064
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 

diff --git a/sc/qa/uitest/calc_tests6/moveCopySheet.py 
b/sc/qa/uitest/calc_tests6/moveCopySheet.py
index a80b7c329173..80bd9f830a27 100644
--- a/sc/qa/uitest/calc_tests6/moveCopySheet.py
+++ b/sc/qa/uitest/calc_tests6/moveCopySheet.py
@@ -63,6 +63,19 @@ class moveCopySheet(UITestCase):
 self.assertEqual(document.Sheets[1].Name, "Sheet1")
 self.assertEqual(document.Sheets[2].Name, "moveName")
 
+# tdf#56973 - copy/paste (single) sheet is checked but not enabled
+def test_tdf56973_copy_paste_inactive(self):
+with self.ui_test.create_doc_in_start_center("calc"):
+with self.ui_test.execute_dialog_through_command(".uno:Move") as 
xDialog:
+# A single sheet can only be copied
+xCopyButton = xDialog.getChild("copy")
+self.assertEqual(get_state_as_dict(xCopyButton)["Checked"], 
"true")
+self.assertEqual(get_state_as_dict(xCopyButton)["Enabled"], 
"true")
+# A single sheet can not be moved
+xMoveButton = xDialog.getChild("move")
+self.assertEqual(get_state_as_dict(xMoveButton)["Checked"], 
"false")
+self.assertEqual(get_state_as_dict(xMoveButton)["Enabled"], 
"false")
+
 #tdf#139464 Set OK button label to selected action: Move or Copy
 def test_tdf139464_move_sheet(self):
 with self.ui_test.create_doc_in_start_center("calc"):
diff --git a/sc/source/ui/miscdlgs/mvtabdlg.cxx 
b/sc/source/ui/miscdlgs/mvtabdlg.cxx
index 9cc587aa56e0..e64a29b6b471 100644
--- a/sc/source/ui/miscdlgs/mvtabdlg.cxx
+++ b/sc/source/ui/miscdlgs/mvtabdlg.cxx
@@ -74,7 +74,6 @@ void ScMoveTableDlg::SetForceCopyTable()
 {
 m_xBtnCopy->set_active(true);
 m_xBtnMove->set_sensitive(false);
-m_xBtnCopy->set_sensitive(false);
 SetOkBtnLabel();
 }
 
diff --git a/vcl/source/uitest/uiobject.cxx b/vcl/source/uitest/uiobject.cxx
index 0b55d4c96857..9b8616c3906b 100644
--- a/vcl/source/uitest/uiobject.cxx
+++ b/vcl/source/uitest/uiobject.cxx
@@ -1018,6 +1018,7 @@ StringMap RadioButtonUIObject::get_state()
 {
 StringMap aMap = WindowUIObject::get_state();
 aMap["Checked"] = OUString::boolean(mxRadioButton->IsChecked());
+aMap["Enabled"] = OUString::boolean(mxRadioButton->IsEnabled());
 
 return aMap;
 }


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

2022-12-26 Thread Andreas Heinisch (via logerrit)
 vcl/source/control/edit.cxx |   13 +
 1 file changed, 13 insertions(+)

New commits:
commit 68c4dbcebed057084083b968f244b8c430a4dc60
Author: Andreas Heinisch 
AuthorDate: Fri Dec 23 17:10:54 2022 +0100
Commit: Andreas Heinisch 
CommitDate: Mon Dec 26 12:03:46 2022 +

tdf#127588 - extend selection to the entire field if nothing is selected

If a user pastes a string to an input field that has a maximum length 
restriction and no text is selected in the input field, extend the selection to 
the respective length of the pasted string or the maximum text length of the 
input field in order to prevent a text truncation warning. If the user selects 
some text in the input field, just replace the currently selected text and show 
the text truncation warning as before.

Change-Id: I2115f8c6672c9c66770abfa6918cf327a7eece17
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144784
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 

diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index d58decb6fedd..e11a9bae45fa 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -1307,6 +1307,19 @@ void Edit::ImplPaste( uno::Reference< 
datatransfer::clipboard::XClipboard > cons
 OUString aText;
 aData >>= aText;
 
+// tdf#127588 - extend selection to the entire field or paste the text
+// from the clipboard to the current position if there is no selection
+if (mnMaxTextLen < EDIT_NOLIMIT && maSelection.Len() == 0)
+{
+const sal_Int32 aTextLen = aText.getLength();
+if (aTextLen == mnMaxTextLen)
+{
+maSelection.Min() = 0;
+maSelection.Max() = mnMaxTextLen;
+} else
+maSelection.Max() = std::min(maSelection.Min() + 
aTextLen, mnMaxTextLen);
+}
+
 Selection aSelection(maSelection);
 aSelection.Normalize();
 if (ImplTruncateToMaxLen(aText, aSelection.Len()))


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

2022-12-25 Thread Andreas Heinisch (via logerrit)
 basic/source/comp/scanner.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit e431417aa67d4b31f57e9d751b63e8e8cf002567
Author: Andreas Heinisch 
AuthorDate: Sun Dec 25 18:19:09 2022 +0100
Commit: Andreas Heinisch 
CommitDate: Sun Dec 25 19:41:05 2022 +

Fixed a copy paste error in a comment

Change-Id: Ibcd4c2f0cccb233647f3b079f02d01f156d30138
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144818
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 

diff --git a/basic/source/comp/scanner.cxx b/basic/source/comp/scanner.cxx
index b5a923969bfd..45b65a29b129 100644
--- a/basic/source/comp/scanner.cxx
+++ b/basic/source/comp/scanner.cxx
@@ -668,7 +668,7 @@ PrevLineCommentLbl:
 bPrevLineExtentsComment = false;
 aSym = "REM";
 sal_Int32 nLen = aLine.getLength() - nLineIdx;
-// tdf#149402 - don't extend comment if line ends in a whitespace 
(asicCharClass::isWhitespace)
+// tdf#149402 - don't extend comment if line ends in a whitespace 
(BasicCharClass::isWhitespace)
 if (bCompatible && !bLineEndsWithWhitespace && aLine[nLineIdx + nLen - 
1] == '_'
 && aLine[nLineIdx + nLen - 2] == ' ')
 bPrevLineExtentsComment = true;


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

2022-12-21 Thread Andreas Heinisch (via logerrit)
 sw/source/ui/index/swuiidxmrk.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 9b1c218c9a4f09cac33fba24712bb9af029f2ea9
Author: Andreas Heinisch 
AuthorDate: Wed Dec 21 09:46:31 2022 +0100
Commit: Andreas Heinisch 
CommitDate: Wed Dec 21 10:08:10 2022 +

tdf#90641 - Insert bibliography dialog: sort entries by identifier

Change-Id: I77210c1dff237deeb93df0102cd96685cb36d4f2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144645
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 

diff --git a/sw/source/ui/index/swuiidxmrk.cxx 
b/sw/source/ui/index/swuiidxmrk.cxx
index fe3fa2b67282..656eacedae02 100644
--- a/sw/source/ui/index/swuiidxmrk.cxx
+++ b/sw/source/ui/index/swuiidxmrk.cxx
@@ -1206,6 +1206,8 @@ SwAuthorMarkPane::SwAuthorMarkPane(weld::DialogController 
, weld::Builde
 
 m_xEntryED->set_visible(!m_bNewEntry);
 m_xEntryLB->set_visible(m_bNewEntry);
+// tdf#90641 - sort bibliography entries by identifier
+m_xEntryLB->make_sorted();
 if (m_bNewEntry)
 {
 m_xEntryLB->connect_changed(LINK(this, SwAuthorMarkPane, 
CompEntryHdl));


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

2022-12-07 Thread Andreas Heinisch (via logerrit)
 sw/qa/uitest/writer_tests3/tdf53023.py |   38 -
 1 file changed, 38 deletions(-)

New commits:
commit 4d83725981e46c62efb5ce6a68ae7c345465b448
Author: Andreas Heinisch 
AuthorDate: Wed Dec 7 18:13:15 2022 +
Commit: Andreas Heinisch 
CommitDate: Wed Dec 7 21:05:35 2022 +

tdf#53023 - Revert hanging unit test

Change-Id: I7975ec874c4d636f0747417b138ffe64fb89e2cf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143719
Tested-by: Andreas Heinisch 
Reviewed-by: Andreas Heinisch 

diff --git a/sw/qa/uitest/writer_tests3/tdf53023.py 
b/sw/qa/uitest/writer_tests3/tdf53023.py
deleted file mode 100755
index 24c3be33d61a..
--- a/sw/qa/uitest/writer_tests3/tdf53023.py
+++ /dev/null
@@ -1,38 +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 tdf53023(UITestCase):
-
-def test_tdf53023_autotext_new_paragraph(self):
-with self.ui_test.create_doc_in_start_center("writer") as document:
-# Insert a test text and select it
-xWriterDoc = self.xUITest.getTopFocusWindow()
-xWriterEdit = xWriterDoc.getChild("writer_edit")
-type_text(xWriterEdit, "Test")
-self.xUITest.executeCommand(".uno:SelectAll")
-
-# Create auto text entry from the previously inserted text and 
insert it
-with 
self.ui_test.execute_dialog_through_command(".uno:EditGlossary") as 
xEditGlossaryDlg:
-xCategory = xEditGlossaryDlg.getChild("category")
-xMyAutoText = xCategory.getChild("2")
-xMyAutoText.executeAction("SELECT", tuple())
-xAutoTextName = xEditGlossaryDlg.getChild("name")
-type_text(xAutoTextName, "Test")
-xEditMenu = xEditGlossaryDlg.getChild("autotext")
-xEditMenu.executeAction("OPENFROMLIST", 
mkPropertyValues({"POS": "1"}))
-
-# Without the fix in place, this test would have failed with
-# AssertionError: 'TestTest' != 'TestTest\r\n'
-self.assertEqual("TestTest", document.Text.String)
-
-# vim: set shiftwidth=4 softtabstop=4 expandtab:


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

2022-12-07 Thread Andreas Heinisch (via logerrit)
 extras/source/autotext/lang/af/standard/LOREM/LOREM.xml   |1 
 extras/source/autotext/lang/am/standard/LOREM/LOREM.xml   |1 
 extras/source/autotext/lang/ar/standard/LOREM/LOREM.xml   |1 
 extras/source/autotext/lang/as/standard/LOREM/LOREM.xml   |1 
 extras/source/autotext/lang/ast/standard/LOREM/LOREM.xml  |1 
 extras/source/autotext/lang/be/standard/LOREM/LOREM.xml   |1 
 extras/source/autotext/lang/bg/standard/A/A.xml   |2 
 extras/source/autotext/lang/bg/standard/AR/AR.xml |2 
 extras/source/autotext/lang/bg/standard/BW/BW.xml |2 
 extras/source/autotext/lang/bg/standard/C/C.xml   |2 
 extras/source/autotext/lang/bg/standard/CD/CD.xml |2 
 extras/source/autotext/lang/bg/standard/CM/CM.xml |2 
 extras/source/autotext/lang/bg/standard/CNL/CNL.xml   |2 
 extras/source/autotext/lang/bg/standard/DT/DT.xml |2 
 extras/source/autotext/lang/bg/standard/E/E.xml   |2 
 extras/source/autotext/lang/bg/standard/I/I.xml   |2 
 extras/source/autotext/lang/bg/standard/IRT/IRT.xml   |2 
 extras/source/autotext/lang/bg/standard/LAG/LAG.xml   |2 
 extras/source/autotext/lang/bg/standard/LOREM/LOREM.xml   |1 
 extras/source/autotext/lang/bg/standard/O/O.xml   |2 
 extras/source/autotext/lang/bg/standard/P/P.xml   |2 
 extras/source/autotext/lang/bg/standard/Q/Q.xml   |2 
 extras/source/autotext/lang/bg/standard/RE/RE.xml |2 
 extras/source/autotext/lang/bg/standard/RF/RF.xml |2 
 extras/source/autotext/lang/bg/standard/RG/RG.xml |2 
 extras/source/autotext/lang/bg/standard/RM/RM.xml |2 
 extras/source/autotext/lang/bg/standard/S/S.xml   |2 
 extras/source/autotext/lang/bg/standard/SD/SD.xml |2 
 extras/source/autotext/lang/bg/standard/SI/SI.xml |2 
 extras/source/autotext/lang/bg/standard/TC/TC.xml |2 
 extras/source/autotext/lang/bg/standard/TOP/TOP.xml   |2 
 extras/source/autotext/lang/bg/standard/TWIMC/TWIMC.xml   |2 
 extras/source/autotext/lang/bg/standard/TY/TY.xml |2 
 extras/source/autotext/lang/bg/standard/VA/VA.xml |2 
 extras/source/autotext/lang/bg/standard/VOM/VOM.xml   |2 
 extras/source/autotext/lang/bn-IN/standard/LOREM/LOREM.xml|1 
 extras/source/autotext/lang/bn/standard/LOREM/LOREM.xml   |1 
 extras/source/autotext/lang/bo/standard/LOREM/LOREM.xml   |1 
 extras/source/autotext/lang/br/standard/LOREM/LOREM.xml   |1 
 extras/source/autotext/lang/brx/standard/LOREM/LOREM.xml  |1 
 extras/source/autotext/lang/bs/standard/LOREM/LOREM.xml   |1 
 extras/source/autotext/lang/ca-valencia/standard/LOREM/LOREM.xml  |1 
 extras/source/autotext/lang/ca/standard/LOREM/LOREM.xml   |1 
 extras/source/autotext/lang/cs/standard/A/A.xml   |1 
 extras/source/autotext/lang/cs/standard/BW/BW.xml |1 
 extras/source/autotext/lang/cs/standard/C/C.xml   |1 
 extras/source/autotext/lang/cs/standard/CD/CD.xml |1 
 extras/source/autotext/lang/cs/standard/CM/CM.xml |1 
 extras/source/autotext/lang/cs/standard/CNL/CNL.xml   |1 
 extras/source/autotext/lang/cs/standard/IRT/IRT.xml   |1 
 extras/source/autotext/lang/cs/standard/LAG/LAG.xml   |1 
 extras/source/autotext/lang/cs/standard/LOREM/LOREM.xml   |1 
 extras/source/autotext/lang/cs/standard/P/P.xml   |1 
 extras/source/autotext/lang/cs/standard/RE/RE.xml |1 
 extras/source/autotext/lang/cs/standard/RF/RF.xml |1 
 extras/source/autotext/lang/cs/standard/RG/RG.xml |1 
 extras/source/autotext/lang/cs/standard/RM/RM.xml |1 
 extras/source/autotext/lang/cs/standard/S/S.xml   |1 
 extras/source/autotext/lang/cs/standard/SD/SD.xml |1 
 extras/source/autotext/lang/cs/standard/SI/SI.xml |1 
 extras/source/autotext/lang/cs/standard/TC/TC.xml |1 
 extras/source/autotext/lang/cs/standard/TOP/TOP.xml   |1 
 extras/source/autotext/lang/cs/standard/TWIMC/TWIMC.xml   |1 
 extras/source/autotext/lang/cs/standard/TY/TY.xml |1 
 extras/source/autotext/lang/cs/standard/VA/VA.xml |1 
 extras/source/autotext/lang/cs/standard/VOM/VOM.xml   |1 
 

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

2022-12-07 Thread Andreas Heinisch (via logerrit)
 extras/source/autotext/lang/af/standard/LOREM/LOREM.xml   |1 
 extras/source/autotext/lang/am/standard/LOREM/LOREM.xml   |1 
 extras/source/autotext/lang/ar/standard/LOREM/LOREM.xml   |1 
 extras/source/autotext/lang/as/standard/LOREM/LOREM.xml   |1 
 extras/source/autotext/lang/ast/standard/LOREM/LOREM.xml  |1 
 extras/source/autotext/lang/be/standard/LOREM/LOREM.xml   |1 
 extras/source/autotext/lang/bg/standard/A/A.xml   |2 
 extras/source/autotext/lang/bg/standard/AR/AR.xml |2 
 extras/source/autotext/lang/bg/standard/BW/BW.xml |2 
 extras/source/autotext/lang/bg/standard/C/C.xml   |2 
 extras/source/autotext/lang/bg/standard/CD/CD.xml |2 
 extras/source/autotext/lang/bg/standard/CM/CM.xml |2 
 extras/source/autotext/lang/bg/standard/CNL/CNL.xml   |2 
 extras/source/autotext/lang/bg/standard/DT/DT.xml |2 
 extras/source/autotext/lang/bg/standard/E/E.xml   |2 
 extras/source/autotext/lang/bg/standard/I/I.xml   |2 
 extras/source/autotext/lang/bg/standard/IRT/IRT.xml   |2 
 extras/source/autotext/lang/bg/standard/LAG/LAG.xml   |2 
 extras/source/autotext/lang/bg/standard/LOREM/LOREM.xml   |1 
 extras/source/autotext/lang/bg/standard/O/O.xml   |2 
 extras/source/autotext/lang/bg/standard/P/P.xml   |2 
 extras/source/autotext/lang/bg/standard/Q/Q.xml   |2 
 extras/source/autotext/lang/bg/standard/RE/RE.xml |2 
 extras/source/autotext/lang/bg/standard/RF/RF.xml |2 
 extras/source/autotext/lang/bg/standard/RG/RG.xml |2 
 extras/source/autotext/lang/bg/standard/RM/RM.xml |2 
 extras/source/autotext/lang/bg/standard/S/S.xml   |2 
 extras/source/autotext/lang/bg/standard/SD/SD.xml |2 
 extras/source/autotext/lang/bg/standard/SI/SI.xml |2 
 extras/source/autotext/lang/bg/standard/TC/TC.xml |2 
 extras/source/autotext/lang/bg/standard/TOP/TOP.xml   |2 
 extras/source/autotext/lang/bg/standard/TWIMC/TWIMC.xml   |2 
 extras/source/autotext/lang/bg/standard/TY/TY.xml |2 
 extras/source/autotext/lang/bg/standard/VA/VA.xml |2 
 extras/source/autotext/lang/bg/standard/VOM/VOM.xml   |2 
 extras/source/autotext/lang/bn-IN/standard/LOREM/LOREM.xml|1 
 extras/source/autotext/lang/bn/standard/LOREM/LOREM.xml   |1 
 extras/source/autotext/lang/bo/standard/LOREM/LOREM.xml   |1 
 extras/source/autotext/lang/br/standard/LOREM/LOREM.xml   |1 
 extras/source/autotext/lang/brx/standard/LOREM/LOREM.xml  |1 
 extras/source/autotext/lang/bs/standard/LOREM/LOREM.xml   |1 
 extras/source/autotext/lang/ca-valencia/standard/LOREM/LOREM.xml  |1 
 extras/source/autotext/lang/ca/standard/LOREM/LOREM.xml   |1 
 extras/source/autotext/lang/cs/standard/A/A.xml   |1 
 extras/source/autotext/lang/cs/standard/BW/BW.xml |1 
 extras/source/autotext/lang/cs/standard/C/C.xml   |1 
 extras/source/autotext/lang/cs/standard/CD/CD.xml |1 
 extras/source/autotext/lang/cs/standard/CM/CM.xml |1 
 extras/source/autotext/lang/cs/standard/CNL/CNL.xml   |1 
 extras/source/autotext/lang/cs/standard/IRT/IRT.xml   |1 
 extras/source/autotext/lang/cs/standard/LAG/LAG.xml   |1 
 extras/source/autotext/lang/cs/standard/LOREM/LOREM.xml   |1 
 extras/source/autotext/lang/cs/standard/P/P.xml   |1 
 extras/source/autotext/lang/cs/standard/RE/RE.xml |1 
 extras/source/autotext/lang/cs/standard/RF/RF.xml |1 
 extras/source/autotext/lang/cs/standard/RG/RG.xml |1 
 extras/source/autotext/lang/cs/standard/RM/RM.xml |1 
 extras/source/autotext/lang/cs/standard/S/S.xml   |1 
 extras/source/autotext/lang/cs/standard/SD/SD.xml |1 
 extras/source/autotext/lang/cs/standard/SI/SI.xml |1 
 extras/source/autotext/lang/cs/standard/TC/TC.xml |1 
 extras/source/autotext/lang/cs/standard/TOP/TOP.xml   |1 
 extras/source/autotext/lang/cs/standard/TWIMC/TWIMC.xml   |1 
 extras/source/autotext/lang/cs/standard/TY/TY.xml |1 
 extras/source/autotext/lang/cs/standard/VA/VA.xml |1 
 extras/source/autotext/lang/cs/standard/VOM/VOM.xml   |1 
 

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

2022-12-06 Thread Andreas Heinisch (via logerrit)
 extras/source/autotext/lang/af/standard/LOREM/LOREM.xml   |1 
 extras/source/autotext/lang/am/standard/LOREM/LOREM.xml   |1 
 extras/source/autotext/lang/ar/standard/LOREM/LOREM.xml   |1 
 extras/source/autotext/lang/as/standard/LOREM/LOREM.xml   |1 
 extras/source/autotext/lang/ast/standard/LOREM/LOREM.xml  |1 
 extras/source/autotext/lang/be/standard/LOREM/LOREM.xml   |1 
 extras/source/autotext/lang/bg/standard/A/A.xml   |2 
 extras/source/autotext/lang/bg/standard/AR/AR.xml |2 
 extras/source/autotext/lang/bg/standard/BW/BW.xml |2 
 extras/source/autotext/lang/bg/standard/C/C.xml   |2 
 extras/source/autotext/lang/bg/standard/CD/CD.xml |2 
 extras/source/autotext/lang/bg/standard/CM/CM.xml |2 
 extras/source/autotext/lang/bg/standard/CNL/CNL.xml   |2 
 extras/source/autotext/lang/bg/standard/DT/DT.xml |2 
 extras/source/autotext/lang/bg/standard/E/E.xml   |2 
 extras/source/autotext/lang/bg/standard/I/I.xml   |2 
 extras/source/autotext/lang/bg/standard/IRT/IRT.xml   |2 
 extras/source/autotext/lang/bg/standard/LAG/LAG.xml   |2 
 extras/source/autotext/lang/bg/standard/LOREM/LOREM.xml   |1 
 extras/source/autotext/lang/bg/standard/O/O.xml   |2 
 extras/source/autotext/lang/bg/standard/P/P.xml   |2 
 extras/source/autotext/lang/bg/standard/Q/Q.xml   |2 
 extras/source/autotext/lang/bg/standard/RE/RE.xml |2 
 extras/source/autotext/lang/bg/standard/RF/RF.xml |2 
 extras/source/autotext/lang/bg/standard/RG/RG.xml |2 
 extras/source/autotext/lang/bg/standard/RM/RM.xml |2 
 extras/source/autotext/lang/bg/standard/S/S.xml   |2 
 extras/source/autotext/lang/bg/standard/SD/SD.xml |2 
 extras/source/autotext/lang/bg/standard/SI/SI.xml |2 
 extras/source/autotext/lang/bg/standard/TC/TC.xml |2 
 extras/source/autotext/lang/bg/standard/TOP/TOP.xml   |2 
 extras/source/autotext/lang/bg/standard/TWIMC/TWIMC.xml   |2 
 extras/source/autotext/lang/bg/standard/TY/TY.xml |2 
 extras/source/autotext/lang/bg/standard/VA/VA.xml |2 
 extras/source/autotext/lang/bg/standard/VOM/VOM.xml   |2 
 extras/source/autotext/lang/bn-IN/standard/LOREM/LOREM.xml|1 
 extras/source/autotext/lang/bn/standard/LOREM/LOREM.xml   |1 
 extras/source/autotext/lang/bo/standard/LOREM/LOREM.xml   |1 
 extras/source/autotext/lang/br/standard/LOREM/LOREM.xml   |1 
 extras/source/autotext/lang/brx/standard/LOREM/LOREM.xml  |1 
 extras/source/autotext/lang/bs/standard/LOREM/LOREM.xml   |1 
 extras/source/autotext/lang/ca-valencia/standard/LOREM/LOREM.xml  |1 
 extras/source/autotext/lang/ca/standard/LOREM/LOREM.xml   |1 
 extras/source/autotext/lang/cs/standard/A/A.xml   |1 
 extras/source/autotext/lang/cs/standard/BW/BW.xml |1 
 extras/source/autotext/lang/cs/standard/C/C.xml   |1 
 extras/source/autotext/lang/cs/standard/CD/CD.xml |1 
 extras/source/autotext/lang/cs/standard/CM/CM.xml |1 
 extras/source/autotext/lang/cs/standard/CNL/CNL.xml   |1 
 extras/source/autotext/lang/cs/standard/IRT/IRT.xml   |1 
 extras/source/autotext/lang/cs/standard/LAG/LAG.xml   |1 
 extras/source/autotext/lang/cs/standard/LOREM/LOREM.xml   |1 
 extras/source/autotext/lang/cs/standard/P/P.xml   |1 
 extras/source/autotext/lang/cs/standard/RE/RE.xml |1 
 extras/source/autotext/lang/cs/standard/RF/RF.xml |1 
 extras/source/autotext/lang/cs/standard/RG/RG.xml |1 
 extras/source/autotext/lang/cs/standard/RM/RM.xml |1 
 extras/source/autotext/lang/cs/standard/S/S.xml   |1 
 extras/source/autotext/lang/cs/standard/SD/SD.xml |1 
 extras/source/autotext/lang/cs/standard/SI/SI.xml |1 
 extras/source/autotext/lang/cs/standard/TC/TC.xml |1 
 extras/source/autotext/lang/cs/standard/TOP/TOP.xml   |1 
 extras/source/autotext/lang/cs/standard/TWIMC/TWIMC.xml   |1 
 extras/source/autotext/lang/cs/standard/TY/TY.xml |1 
 extras/source/autotext/lang/cs/standard/VA/VA.xml |1 
 extras/source/autotext/lang/cs/standard/VOM/VOM.xml   |1 
 

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

2022-11-22 Thread Andreas Heinisch (via logerrit)
 sw/source/ui/index/cnttab.cxx |8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit 66e48719c0a58508d75c0204531513541ae6db09
Author: Andreas Heinisch 
AuthorDate: Sun Nov 20 11:35:03 2022 +0100
Commit: Andreas Heinisch 
CommitDate: Tue Nov 22 09:01:07 2022 +0100

tdf#120405 - Use previously selected file, if selection is aborted

If a user aborts the selection of a concordance file, use the previously 
selected one, if it exists.

Change-Id: I55547ca98034269e897d6bc86ccc4dcfd63be9fd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142997
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 

diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index 4db6f48abcbf..d2671d2dd664 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -102,10 +102,16 @@ static OUString lcl_CreateAutoMarkFileDlg(weld::Window* 
pParent, const OUString&
 xFP->setDisplayDirectory( aPathOpt.GetUserConfigPath() );
 }
 
-if( aDlgHelper.Execute() == ERRCODE_NONE )
+const ErrCode aErrCode = aDlgHelper.Execute();
+if (aErrCode == ERRCODE_NONE)
 {
 sRet = xFP->getSelectedFiles().getConstArray()[0];
 }
+// tdf#120405 - use previously selected file, if selection is aborted
+else if (aErrCode == ERRCODE_ABORT && !rURL.isEmpty())
+{
+sRet = rURL;
+}
 
 return sRet;
 }


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

2022-11-20 Thread Andreas Heinisch (via logerrit)
 sc/qa/extras/vba-macro-test.cxx |   66 
 sc/source/ui/vba/vbawindows.cxx |   22 +
 2 files changed, 88 insertions(+)

New commits:
commit deb0bb9f2635a8dfec90b42e3727f4224548a8e9
Author: Andreas Heinisch 
AuthorDate: Mon Sep 26 20:36:15 2022 +0200
Commit: Andreas Heinisch 
CommitDate: Sun Nov 20 12:02:58 2022 +0100

tdf#126457 - Add URL and workbook name to window titles

The Windows object allows to activate a window using its caption. The 
window caption is the text shown in the title bar at the top of the window. It 
can be changed which does not affect the name of the workbook. In MS these 
captions are unique, i.e., a file with the same file name stored in a different 
directory can't be open.

However, LibreOffice allows to open files with the same name. So in order 
to make it as closely to the functionality of MS, the windows activate method 
now works with URLs and changed window captions.

It has still to be clarified what happens if two workbooks have the same 
caption.

Change-Id: I77a8680bc64b5992191df2fa1a7d475f9a48f518
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140627
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 

diff --git a/sc/qa/extras/vba-macro-test.cxx b/sc/qa/extras/vba-macro-test.cxx
index 30375807a6ad..5c4bb5b88cc4 100644
--- a/sc/qa/extras/vba-macro-test.cxx
+++ b/sc/qa/extras/vba-macro-test.cxx
@@ -31,6 +31,8 @@
 
 #include 
 
+#include 
+
 using namespace css;
 using namespace ooo::vba;
 
@@ -62,6 +64,7 @@ public:
 void testTdf90278();
 void testTdf149531();
 void testTdf118247();
+void testTdf126457();
 
 CPPUNIT_TEST_SUITE(VBAMacroTest);
 CPPUNIT_TEST(testSimpleCopyAndPaste);
@@ -84,6 +87,7 @@ public:
 CPPUNIT_TEST(testTdf90278);
 CPPUNIT_TEST(testTdf149531);
 CPPUNIT_TEST(testTdf118247);
+CPPUNIT_TEST(testTdf126457);
 CPPUNIT_TEST_SUITE_END();
 };
 
@@ -763,6 +767,68 @@ void VBAMacroTest::testTdf118247()
 CPPUNIT_ASSERT_EQUAL(sRange, aReturnValue);
 }
 }
+
+void VBAMacroTest::testTdf126457()
+{
+auto xComponent = loadFromDesktop("private:factory/scalc");
+
+// Save a copy of the file to get its URL
+uno::Reference xDocStorable(xComponent, uno::UNO_QUERY);
+utl::TempFileNamed aTempFile(u"testWindowsActivate", true, u".ods");
+aTempFile.EnableKillingFile();
+uno::Sequence descSaveAs(
+comphelper::InitPropertySequence({ { "FilterName", 
uno::Any(OUString("calc8")) } }));
+xDocStorable->storeAsURL(aTempFile.GetURL(), descSaveAs);
+
+// Insert initial library
+css::uno::Reference xDocScr(xComponent, 
uno::UNO_QUERY_THROW);
+auto xLibs = xDocScr->getBasicLibraries();
+auto xLibrary = xLibs->createLibrary("TestLibrary");
+xLibrary->insertByName(
+"TestModule",
+uno::Any(OUString("Option VBASupport 1\n"
+  "Function TestWindowsActivate\n"
+  "  dirName = Workbooks(1).Path\n"
+  "  workbookName = Workbooks(1).Name\n"
+  "  fileName = dirName + Application.PathSeparator + 
workbookName\n"
+  "  Workbooks.Open Filename := fileName\n"
+  "  On Error Goto handler\n"
+  // activate window using its URL
+  "  Windows(fileName).Activate\n"
+  // activate window using its caption name
+  "  Windows(workbookName).Activate\n"
+  // activate window using a newly generated window 
caption
+  "  newCaption = \"New Window Caption\"\n"
+  "  Windows(fileName).Caption = newCaption\n"
+  "  Windows(newCaption).Activate\n"
+  "  TestWindowsActivate = 0\n"
+  "  Exit Function\n"
+  "handler:\n"
+  "  TestWindowsActivate = 1\n"
+  "End Function\n")));
+
+uno::Any aRet;
+uno::Sequence aOutParamIndex;
+uno::Sequence aOutParam;
+
+SfxObjectShell* pFoundShell = 
SfxObjectShell::GetShellFromComponent(xComponent);
+ScDocShell* pDocSh = static_cast(pFoundShell);
+CPPUNIT_ASSERT(pDocSh);
+
+ErrCode result
+= SfxObjectShell::CallXScript(xComponent,
+  
"vnd.sun.Star.script:TestLibrary.TestModule."
+  
"TestWindowsActivate?language=Basic=document",
+  {}, aRet, aOutParamIndex, aOutParam);
+
+// Without the fix in place, the windows could not be activated in the 
macro
+CPPUNIT_ASSERT_EQUAL(ERRCODE_NONE, result);
+sal_Int16 nReturnValue;
+aRet >>= nReturnValue;
+CPPUNIT_ASSERT_EQUAL(sal_Int16(0), nReturnValue);
+
+pDocSh->DoClose();
+}
 

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

2022-11-02 Thread Andreas Heinisch (via logerrit)
 sw/qa/extras/uiwriter/data/tdf151462.odt |binary
 sw/qa/extras/uiwriter/uiwriter6.cxx  |   35 +++
 2 files changed, 35 insertions(+)

New commits:
commit fab66b3f912462527adfb06870cd52d087485c74
Author: Andreas Heinisch 
AuthorDate: Thu Oct 27 08:46:46 2022 +0200
Commit: Xisco Fauli 
CommitDate: Wed Nov 2 10:20:53 2022 +0100

tdf#151462 - Search for outline node containing the current node

Added unit test

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

diff --git a/sw/qa/extras/uiwriter/data/tdf151462.odt 
b/sw/qa/extras/uiwriter/data/tdf151462.odt
new file mode 100755
index ..cdd250232e18
Binary files /dev/null and b/sw/qa/extras/uiwriter/data/tdf151462.odt differ
diff --git a/sw/qa/extras/uiwriter/uiwriter6.cxx 
b/sw/qa/extras/uiwriter/uiwriter6.cxx
index b47da8fb386b..fb3b53c179b8 100644
--- a/sw/qa/extras/uiwriter/uiwriter6.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter6.cxx
@@ -2171,6 +2171,41 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testCaptionShape)
 CPPUNIT_ASSERT_EQUAL(1, getShapes());
 }
 
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf151462)
+{
+createSwDoc(DATA_DIRECTORY, "tdf151462.odt");
+//   xmlDocUniquePtr pLayout = parseLayoutDump();
+dispatchCommand(mxComponent, ".uno:UpdateAllIndexes", {});
+Scheduler::ProcessEventsToIdle();
+xmlDocUniquePtr pLayout = parseLayoutDump();
+// tdf#151462 - without the fix in place, there would be just the first 
index entry
+assertXPath(pLayout,
+
"/root/page[1]/body/txt[2]/anchored/fly/section/txt[1]/SwParaPortion/"
+"SwLineLayout[1]/SwLinePortion[1]",
+"portion", "sub one");
+assertXPath(pLayout,
+
"/root/page[1]/body/txt[2]/anchored/fly/section/txt[2]/SwParaPortion/"
+"SwLineLayout[1]/SwLinePortion[1]",
+"portion", "sub two");
+assertXPath(pLayout,
+
"/root/page[1]/body/txt[2]/anchored/fly/section/txt[3]/SwParaPortion/"
+"SwLineLayout[1]/SwLinePortion[1]",
+"portion", "sub three");
+// tdf#151462 - without the fix in place, there would be just the first 
index entry
+assertXPath(pLayout,
+
"/root/page[1]/body/txt[6]/anchored/fly/section/txt[1]/SwParaPortion/"
+"SwLineLayout[1]/SwLinePortion[1]",
+"portion", "another sub one");
+assertXPath(pLayout,
+
"/root/page[1]/body/txt[6]/anchored/fly/section/txt[2]/SwParaPortion/"
+"SwLineLayout[1]/SwLinePortion[1]",
+"portion", "another sub two");
+assertXPath(pLayout,
+
"/root/page[1]/body/txt[6]/anchored/fly/section/txt[3]/SwParaPortion/"
+"SwLineLayout[1]/SwLinePortion[1]",
+"portion", "another sub three");
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


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

2022-11-01 Thread Andreas Heinisch (via logerrit)
 sw/source/core/doc/doctxm.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit c54b8c442473c59deacc89de4c1a13e108993063
Author: Andreas Heinisch 
AuthorDate: Thu Oct 13 22:11:35 2022 +0200
Commit: Xisco Fauli 
CommitDate: Tue Nov 1 21:54:20 2022 +0100

tdf#151462 - Search for outline node containing the current node

If the index lies within a special section, the position of the anchor of 
the corresponding section will used to search the node of the paragraph. This 
patch searches for the outline node of the found paragraph in order to find all 
the corresponding sub indexes.

Change-Id: I9be4bdc0768d5d0d5987d47d37e41acc5009cca8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141344
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 
(cherry picked from commit ba58fc11723b7c9d370d6407385ea0e8829db099)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142136
Reviewed-by: Xisco Fauli 

diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx
index 9665c3915714..ea4cf47a3dce 100644
--- a/sw/source/core/doc/doctxm.cxx
+++ b/sw/source/core/doc/doctxm.cxx
@@ -733,6 +733,8 @@ static const SwTextNode* lcl_FindChapterNode( const SwNode& 
rNd,
 SwPosition aPos( *pNd );
 pNd = GetBodyTextNode( pNd->GetDoc(), aPos, *pFrame );
 OSL_ENSURE( pNd, "Where's the paragraph?" );
+// tdf#151462 - search for outline node containing the current node
+return pNd->FindOutlineNodeOfLevel(pNd->GetSectionLevel() - 1, 
pLayout);
 }
 }
 return pNd ? pNd->FindOutlineNodeOfLevel(nLvl, pLayout) : nullptr;


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

2022-10-27 Thread Andreas Heinisch (via logerrit)
 sw/qa/extras/uiwriter/data/tdf151462.odt |binary
 sw/qa/extras/uiwriter/uiwriter8.cxx  |   37 +++
 2 files changed, 37 insertions(+)

New commits:
commit 483afea3a99b928d0e1cb1df0415a06269067559
Author: Andreas Heinisch 
AuthorDate: Thu Oct 27 08:46:46 2022 +0200
Commit: Andreas Heinisch 
CommitDate: Thu Oct 27 12:20:29 2022 +0200

tdf#151462 - Search for outline node containing the current node

Added unit test

Change-Id: I9fcc26527ec2f7e036ee32a709f023fcc50d9e6e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141892
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 

diff --git a/sw/qa/extras/uiwriter/data/tdf151462.odt 
b/sw/qa/extras/uiwriter/data/tdf151462.odt
new file mode 100755
index ..cdd250232e18
Binary files /dev/null and b/sw/qa/extras/uiwriter/data/tdf151462.odt differ
diff --git a/sw/qa/extras/uiwriter/uiwriter8.cxx 
b/sw/qa/extras/uiwriter/uiwriter8.cxx
index 5c1476e30685..a0d40ff5cca6 100644
--- a/sw/qa/extras/uiwriter/uiwriter8.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter8.cxx
@@ -2375,6 +2375,43 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf97899)
 CPPUNIT_ASSERT(!sCharStyleName.isEmpty());
 }
 
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf151462)
+{
+createSwDoc(DATA_DIRECTORY, "tdf151462.odt");
+//   xmlDocUniquePtr pLayout = parseLayoutDump();
+dispatchCommand(mxComponent, ".uno:UpdateAllIndexes", {});
+Scheduler::ProcessEventsToIdle();
+
+xmlDocUniquePtr pLayout = parseLayoutDump();
+// tdf#151462 - without the fix in place, there would be just the first 
index entry
+assertXPath(pLayout,
+
"/root/page[1]/body/txt[2]/anchored/fly/section/txt[1]/SwParaPortion/"
+"SwLineLayout[1]/SwLinePortion[1]",
+"portion", "sub one");
+assertXPath(pLayout,
+
"/root/page[1]/body/txt[2]/anchored/fly/section/txt[2]/SwParaPortion/"
+"SwLineLayout[1]/SwLinePortion[1]",
+"portion", "sub two");
+assertXPath(pLayout,
+
"/root/page[1]/body/txt[2]/anchored/fly/section/txt[3]/SwParaPortion/"
+"SwLineLayout[1]/SwLinePortion[1]",
+"portion", "sub three");
+
+// tdf#151462 - without the fix in place, there would be just the first 
index entry
+assertXPath(pLayout,
+
"/root/page[1]/body/txt[6]/anchored/fly/section/txt[1]/SwParaPortion/"
+"SwLineLayout[1]/SwLinePortion[1]",
+"portion", "another sub one");
+assertXPath(pLayout,
+
"/root/page[1]/body/txt[6]/anchored/fly/section/txt[2]/SwParaPortion/"
+"SwLineLayout[1]/SwLinePortion[1]",
+"portion", "another sub two");
+assertXPath(pLayout,
+
"/root/page[1]/body/txt[6]/anchored/fly/section/txt[3]/SwParaPortion/"
+"SwLineLayout[1]/SwLinePortion[1]",
+"portion", "another sub three");
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


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

2022-10-19 Thread Andreas Heinisch (via logerrit)
 basic/qa/basic_coverage/test_optional_paramters_basic.bas  |   15 
++
 basic/qa/basic_coverage/test_optional_paramters_compatible.bas |   15 
++
 basic/source/runtime/runtime.cxx   |8 +
 3 files changed, 38 insertions(+)

New commits:
commit cc76bafdd1b8b4d03f549785b368e80b9c409c86
Author: Andreas Heinisch 
AuthorDate: Thu Oct 13 14:20:00 2022 +0200
Commit: Xisco Fauli 
CommitDate: Wed Oct 19 08:33:18 2022 +0200

tdf#151503 - Do not evaluate a missing optional variable to a boolean

Change-Id: I671f857344f91de63612eabcbbdb2cab9b94cc0d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141296
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 
(cherry picked from commit bdfcad586d7b1d4d26bcba50058af7fcb279558d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141318
Reviewed-by: Xisco Fauli 

diff --git a/basic/qa/basic_coverage/test_optional_paramters_basic.bas 
b/basic/qa/basic_coverage/test_optional_paramters_basic.bas
index a684fc256054..40475664fb7a 100644
--- a/basic/qa/basic_coverage/test_optional_paramters_basic.bas
+++ b/basic/qa/basic_coverage/test_optional_paramters_basic.bas
@@ -125,6 +125,12 @@ Sub verify_testOptionalsBasic()
 ' - Actual  : 448 (Actual value of the variable)
 TestUtil.AssertEqual(TestObjectError, 449, "TestObjectError")
 
+' tdf#151503 - error handling of missing optional parameters (boolean 
operations)
+' Without the fix in place, this test would have failed with:
+' - Expected: 449 (ERRCODE_BASIC_NOT_OPTIONAL - Argument not optional)
+' - Actual  : 0 (No error code since a missing parameter evaluates to true)
+TestUtil.AssertEqual(TestBooleanOperations, 449, "TestBooleanOperations")
+
 Exit Sub
 errorHandler:
 TestUtil.ReportErrorHandler("verify_testOptionalsBasic", Err, Error$, Erl)
@@ -229,6 +235,15 @@ errorHandler:
 TestObjectError = Err()
 End Function
 
+Function TestBooleanOperations(Optional optBool As Boolean)
+On Error GoTo errorHandler
+if optBool then
+TestBooleanOperations = 0
+end if
+errorHandler:
+TestBooleanOperations = Err()
+End Function
+
 Function CollectionSum(C)
 Dim idx As Integer
 CollectionSum = 0
diff --git a/basic/qa/basic_coverage/test_optional_paramters_compatible.bas 
b/basic/qa/basic_coverage/test_optional_paramters_compatible.bas
index 56b314288e7a..fc3ca385951c 100644
--- a/basic/qa/basic_coverage/test_optional_paramters_compatible.bas
+++ b/basic/qa/basic_coverage/test_optional_paramters_compatible.bas
@@ -127,6 +127,12 @@ Sub verify_testOptionalsCompatible()
 ' - Actual  : 448 (Actual value of the variable)
 TestUtil.AssertEqual(TestObjectError, 449, "TestObjectError")
 
+' tdf#151503 - error handling of missing optional parameters (boolean 
operations)
+' Without the fix in place, this test would have failed with:
+' - Expected: 449 (ERRCODE_BASIC_NOT_OPTIONAL - Argument not optional)
+' - Actual  : 0 (No error code since a missing parameter evaluates to true)
+TestUtil.AssertEqual(TestBooleanOperations, 449, "TestBooleanOperations")
+
 Exit Sub
 errorHandler:
 TestUtil.ReportErrorHandler("verify_testOptionalsCompatible", Err, Error$, 
Erl)
@@ -231,6 +237,15 @@ errorHandler:
 TestObjectError = Err()
 End Function
 
+Function TestBooleanOperations(Optional optBool As Boolean)
+On Error GoTo errorHandler
+if optBool then
+TestBooleanOperations = 0
+end if
+errorHandler:
+TestBooleanOperations = Err()
+End Function
+
 Function CollectionSum(C)
 Dim idx As Integer
 CollectionSum = 0
diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx
index f5792fe33dba..52efd4aea837 100644
--- a/basic/source/runtime/runtime.cxx
+++ b/basic/source/runtime/runtime.cxx
@@ -3024,6 +3024,14 @@ bool SbiRuntime::EvaluateTopOfStackAsBool()
 {
 return false;
 }
+
+// tdf#151503 - do not evaluate a missing optional variable to a boolean
+if (tos->GetType() == SbxERROR && IsMissing(tos.get(), 1))
+{
+Error(ERRCODE_BASIC_NOT_OPTIONAL);
+return false;
+}
+
 if ( tos->IsObject() )
 {
 //GetBool applied to an Object attempts to dereference and evaluate


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

2022-10-18 Thread Andreas Heinisch (via logerrit)
 sw/source/core/doc/doctxm.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit ba58fc11723b7c9d370d6407385ea0e8829db099
Author: Andreas Heinisch 
AuthorDate: Thu Oct 13 22:11:35 2022 +0200
Commit: Andreas Heinisch 
CommitDate: Tue Oct 18 08:15:48 2022 +0200

tdf#151462 - Search for outline node containing the current node

If the index lies within a special section, the position of the anchor of 
the corresponding section will used to search the node of the paragraph. This 
patch searches for the outline node of the found paragraph in order to find all 
the corresponding sub indexes.

Change-Id: I9be4bdc0768d5d0d5987d47d37e41acc5009cca8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141344
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 

diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx
index 36c197732cd9..09c44f1ef489 100644
--- a/sw/source/core/doc/doctxm.cxx
+++ b/sw/source/core/doc/doctxm.cxx
@@ -733,6 +733,8 @@ static const SwTextNode* lcl_FindChapterNode( const SwNode& 
rNd,
 SwPosition aPos( *pNd );
 pNd = GetBodyTextNode( pNd->GetDoc(), aPos, *pFrame );
 OSL_ENSURE( pNd, "Where's the paragraph?" );
+// tdf#151462 - search for outline node containing the current node
+return pNd->FindOutlineNodeOfLevel(pNd->GetSectionLevel() - 1, 
pLayout);
 }
 }
 return pNd ? pNd->FindOutlineNodeOfLevel(nLvl, pLayout) : nullptr;


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

2022-10-17 Thread Andreas Heinisch (via logerrit)
 sw/qa/uitest/writer_dialogs/openDialogs.py |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 923b75d9cae657a6bf18851c6105513ddab5e95d
Author: Andreas Heinisch 
AuthorDate: Mon Oct 17 09:23:30 2022 +0200
Commit: Andreas Heinisch 
CommitDate: Mon Oct 17 18:00:05 2022 +0200

tdf#135938 - Partially revert fix test case

Because it sometimes hangs, see 
https://gerrit.libreoffice.org/c/core/+/140985

Change-Id: Iee0d4584256441dff77b0548827fafbd0b559aa3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141400
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 

diff --git a/sw/qa/uitest/writer_dialogs/openDialogs.py 
b/sw/qa/uitest/writer_dialogs/openDialogs.py
index 896d2fd641c7..1e58c5acccd9 100644
--- a/sw/qa/uitest/writer_dialogs/openDialogs.py
+++ b/sw/qa/uitest/writer_dialogs/openDialogs.py
@@ -50,7 +50,8 @@ dialogs = [
 # dialog opens but is not recognised by execute_dialog_through_command
 # {"command": ".uno:InsertBookmark", "closeButton": "close"},
 # tested in sw/qa/uitest/writer_tests2/bookmark.py
-{"command": ".uno:InsertReferenceField", "closeButton": "cancel"},
+# {"command": ".uno:InsertReferenceField", "closeButton": "cancel"},
+# Tested in sw/qa/uitest/writer_tests7/tdf135938.py
 # {"command": ".uno:InsertSymbol", "closeButton": "cancel"},
 # tested in sw/qa/uitest/writer_tests3/specialCharacter.py
 # {"command": ".uno:InsertFootnoteDialog", "closeButton": "cancel"},


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

2022-10-14 Thread Andreas Heinisch (via logerrit)
 basic/qa/basic_coverage/test_optional_paramters_basic.bas  |   15 
++
 basic/qa/basic_coverage/test_optional_paramters_compatible.bas |   15 
++
 basic/source/runtime/runtime.cxx   |8 +
 3 files changed, 38 insertions(+)

New commits:
commit bdfcad586d7b1d4d26bcba50058af7fcb279558d
Author: Andreas Heinisch 
AuthorDate: Thu Oct 13 14:20:00 2022 +0200
Commit: Andreas Heinisch 
CommitDate: Fri Oct 14 10:06:38 2022 +0200

tdf#151503 - Do not evaluate a missing optional variable to a boolean

Change-Id: I671f857344f91de63612eabcbbdb2cab9b94cc0d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141296
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 

diff --git a/basic/qa/basic_coverage/test_optional_paramters_basic.bas 
b/basic/qa/basic_coverage/test_optional_paramters_basic.bas
index a684fc256054..40475664fb7a 100644
--- a/basic/qa/basic_coverage/test_optional_paramters_basic.bas
+++ b/basic/qa/basic_coverage/test_optional_paramters_basic.bas
@@ -125,6 +125,12 @@ Sub verify_testOptionalsBasic()
 ' - Actual  : 448 (Actual value of the variable)
 TestUtil.AssertEqual(TestObjectError, 449, "TestObjectError")
 
+' tdf#151503 - error handling of missing optional parameters (boolean 
operations)
+' Without the fix in place, this test would have failed with:
+' - Expected: 449 (ERRCODE_BASIC_NOT_OPTIONAL - Argument not optional)
+' - Actual  : 0 (No error code since a missing parameter evaluates to true)
+TestUtil.AssertEqual(TestBooleanOperations, 449, "TestBooleanOperations")
+
 Exit Sub
 errorHandler:
 TestUtil.ReportErrorHandler("verify_testOptionalsBasic", Err, Error$, Erl)
@@ -229,6 +235,15 @@ errorHandler:
 TestObjectError = Err()
 End Function
 
+Function TestBooleanOperations(Optional optBool As Boolean)
+On Error GoTo errorHandler
+if optBool then
+TestBooleanOperations = 0
+end if
+errorHandler:
+TestBooleanOperations = Err()
+End Function
+
 Function CollectionSum(C)
 Dim idx As Integer
 CollectionSum = 0
diff --git a/basic/qa/basic_coverage/test_optional_paramters_compatible.bas 
b/basic/qa/basic_coverage/test_optional_paramters_compatible.bas
index 56b314288e7a..fc3ca385951c 100644
--- a/basic/qa/basic_coverage/test_optional_paramters_compatible.bas
+++ b/basic/qa/basic_coverage/test_optional_paramters_compatible.bas
@@ -127,6 +127,12 @@ Sub verify_testOptionalsCompatible()
 ' - Actual  : 448 (Actual value of the variable)
 TestUtil.AssertEqual(TestObjectError, 449, "TestObjectError")
 
+' tdf#151503 - error handling of missing optional parameters (boolean 
operations)
+' Without the fix in place, this test would have failed with:
+' - Expected: 449 (ERRCODE_BASIC_NOT_OPTIONAL - Argument not optional)
+' - Actual  : 0 (No error code since a missing parameter evaluates to true)
+TestUtil.AssertEqual(TestBooleanOperations, 449, "TestBooleanOperations")
+
 Exit Sub
 errorHandler:
 TestUtil.ReportErrorHandler("verify_testOptionalsCompatible", Err, Error$, 
Erl)
@@ -231,6 +237,15 @@ errorHandler:
 TestObjectError = Err()
 End Function
 
+Function TestBooleanOperations(Optional optBool As Boolean)
+On Error GoTo errorHandler
+if optBool then
+TestBooleanOperations = 0
+end if
+errorHandler:
+TestBooleanOperations = Err()
+End Function
+
 Function CollectionSum(C)
 Dim idx As Integer
 CollectionSum = 0
diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx
index 5ff568140c75..4f77fecb56e2 100644
--- a/basic/source/runtime/runtime.cxx
+++ b/basic/source/runtime/runtime.cxx
@@ -3022,6 +3022,14 @@ bool SbiRuntime::EvaluateTopOfStackAsBool()
 {
 return false;
 }
+
+// tdf#151503 - do not evaluate a missing optional variable to a boolean
+if (tos->GetType() == SbxERROR && IsMissing(tos.get(), 1))
+{
+Error(ERRCODE_BASIC_NOT_OPTIONAL);
+return false;
+}
+
 if ( tos->IsObject() )
 {
 //GetBool applied to an Object attempts to dereference and evaluate


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

2022-10-13 Thread Andreas Heinisch (via logerrit)
 sc/qa/uitest/autofilter/autofilterBugs.py |   48 ++
 sc/source/core/tool/typedstrdata.cxx  |7 +---
 2 files changed, 51 insertions(+), 4 deletions(-)

New commits:
commit 1b1ad0e3d5988c5e16dabfaa40252a22dab517b7
Author: Andreas Heinisch 
AuthorDate: Fri Oct 7 11:59:33 2022 +0200
Commit: Xisco Fauli 
CommitDate: Thu Oct 13 18:10:10 2022 +0200

tdf#125363, tdf#123095 - Use CaseTransliteration for autofilter

Change-Id: Ib6f1edebe26a69d3316a901e00d2bc6e0c66695f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141047
Tested-by: Jenkins
Reviewed-by: Eike Rathke 
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141288

diff --git a/sc/qa/uitest/autofilter/autofilterBugs.py 
b/sc/qa/uitest/autofilter/autofilterBugs.py
index 1a9d2261d631..a295c6307793 100644
--- a/sc/qa/uitest/autofilter/autofilterBugs.py
+++ b/sc/qa/uitest/autofilter/autofilterBugs.py
@@ -25,6 +25,54 @@ class autofilter(UITestCase):
 #autofilter still exist
 
self.assertEqual(calc_doc.getPropertyValue("UnnamedDatabaseRanges").getByTable(0).AutoFilter,
 True)
 
+   def test_tdf123095(self):
+with self.ui_test.create_doc_in_start_center("calc") as document:
+calcDoc = self.xUITest.getTopFocusWindow()
+xGridWindow = calcDoc.getChild("grid_window")
+enter_text_to_cell(xGridWindow, "A1", "乙二醇(进口料件)")
+enter_text_to_cell(xGridWindow, "A2", "乙二醇(进口料件)")
+xGridWindow.executeAction("SELECT", mkPropertyValues({"RANGE": 
"A1:A2"}))
+
+with 
self.ui_test.execute_dialog_through_command(".uno:DataFilterAutoFilter", 
close_button="no"):
+pass
+
+xGridWindow.executeAction("LAUNCH", 
mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
+xFloatWindow = self.xUITest.getFloatWindow()
+xTreeList = xFloatWindow.getChild("check_list_box")
+
+# Without the fix in place, the second entry would not exist
+self.assertEqual(2, len(xTreeList.getChildren()))
+
self.assertEqual(get_state_as_dict(xTreeList.getChild("0"))["Text"], 
"乙二醇(进口料件)")
+
self.assertEqual(get_state_as_dict(xTreeList.getChild("1"))["Text"], 
"乙二醇(进口料件)")
+
+   def test_tdf125363(self):
+with self.ui_test.create_doc_in_start_center("calc") as document:
+calcDoc = self.xUITest.getTopFocusWindow()
+xGridWindow = calcDoc.getChild("grid_window")
+enter_text_to_cell(xGridWindow, "A1", "guet")
+enter_text_to_cell(xGridWindow, "A2", "guͤt")
+enter_text_to_cell(xGridWindow, "A3", "tuon")
+enter_text_to_cell(xGridWindow, "A4", "tuͦn")
+enter_text_to_cell(xGridWindow, "A5", "vröude")
+enter_text_to_cell(xGridWindow, "A6", "vröudᵉ")
+xGridWindow.executeAction("SELECT", mkPropertyValues({"RANGE": 
"A1:A6"}))
+
+with 
self.ui_test.execute_dialog_through_command(".uno:DataFilterAutoFilter", 
close_button="no"):
+pass
+
+xGridWindow.executeAction("LAUNCH", 
mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
+xFloatWindow = self.xUITest.getFloatWindow()
+xTreeList = xFloatWindow.getChild("check_list_box")
+
+# Without the fix in place, the entries with superscript/modifier 
letters would not exist
+self.assertEqual(6, len(xTreeList.getChildren()))
+
self.assertEqual(get_state_as_dict(xTreeList.getChild("0"))["Text"], "guet")
+
self.assertEqual(get_state_as_dict(xTreeList.getChild("1"))["Text"], "guͤt")
+
self.assertEqual(get_state_as_dict(xTreeList.getChild("2"))["Text"], "tuon")
+
self.assertEqual(get_state_as_dict(xTreeList.getChild("3"))["Text"], "tuͦn")
+
self.assertEqual(get_state_as_dict(xTreeList.getChild("4"))["Text"], "vröude")
+
self.assertEqual(get_state_as_dict(xTreeList.getChild("5"))["Text"], "vröudᵉ")
+
def test_tdf94055(self):
 with self.ui_test.create_doc_in_start_center("calc") as document:
 calcDoc = self.xUITest.getTopFocusWindow()
diff --git a/sc/source/core/tool/typedstrdata.cxx 
b/sc/source/core/tool/typedstrdata.cxx
index 83ecdfa64053..ecfdfdba93a8 100644
--- a/sc/source/core/tool/typedstrdata.cxx
+++ b/sc/source/core/tool/typedstrdata.cxx
@@ -11,6 +11,7 @@
 #include 
 
 #include 
+#include 
 
 bool ScTypedStrData::LessCaseSensitive::operator() (const ScTypedStrData& 
left, const ScTypedStrData& right) const
 {
@@ -53,8 +54,7 @@ bool ScTypedStrData::EqualCaseSensitive::operator() (const 
ScTypedStrData& left,
 if (left.mbIsDate != right.mbIsDate )
 return false;
 
-return ScGlobal::GetCaseCollator().compareString(
-left.maStrValue, right.maStrValue) == 0;
+return ScGlobal::GetCaseTransliteration().isEqual(left.maStrValue, 
right.maStrValue);
 }
 

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

2022-10-13 Thread Andreas Heinisch (via logerrit)
 sc/qa/uitest/autofilter/autofilterBugs.py |   48 ++
 sc/source/core/tool/typedstrdata.cxx  |7 +---
 2 files changed, 51 insertions(+), 4 deletions(-)

New commits:
commit 2e887e04c0008a4eb6cbf34050b6fa463a33599f
Author: Andreas Heinisch 
AuthorDate: Fri Oct 7 11:59:33 2022 +0200
Commit: Eike Rathke 
CommitDate: Thu Oct 13 12:28:14 2022 +0200

tdf#125363, tdf#123095 - Use CaseTransliteration for autofilter

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

diff --git a/sc/qa/uitest/autofilter/autofilterBugs.py 
b/sc/qa/uitest/autofilter/autofilterBugs.py
index 1a9d2261d631..a295c6307793 100644
--- a/sc/qa/uitest/autofilter/autofilterBugs.py
+++ b/sc/qa/uitest/autofilter/autofilterBugs.py
@@ -25,6 +25,54 @@ class autofilter(UITestCase):
 #autofilter still exist
 
self.assertEqual(calc_doc.getPropertyValue("UnnamedDatabaseRanges").getByTable(0).AutoFilter,
 True)
 
+   def test_tdf123095(self):
+with self.ui_test.create_doc_in_start_center("calc") as document:
+calcDoc = self.xUITest.getTopFocusWindow()
+xGridWindow = calcDoc.getChild("grid_window")
+enter_text_to_cell(xGridWindow, "A1", "乙二醇(进口料件)")
+enter_text_to_cell(xGridWindow, "A2", "乙二醇(进口料件)")
+xGridWindow.executeAction("SELECT", mkPropertyValues({"RANGE": 
"A1:A2"}))
+
+with 
self.ui_test.execute_dialog_through_command(".uno:DataFilterAutoFilter", 
close_button="no"):
+pass
+
+xGridWindow.executeAction("LAUNCH", 
mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
+xFloatWindow = self.xUITest.getFloatWindow()
+xTreeList = xFloatWindow.getChild("check_list_box")
+
+# Without the fix in place, the second entry would not exist
+self.assertEqual(2, len(xTreeList.getChildren()))
+
self.assertEqual(get_state_as_dict(xTreeList.getChild("0"))["Text"], 
"乙二醇(进口料件)")
+
self.assertEqual(get_state_as_dict(xTreeList.getChild("1"))["Text"], 
"乙二醇(进口料件)")
+
+   def test_tdf125363(self):
+with self.ui_test.create_doc_in_start_center("calc") as document:
+calcDoc = self.xUITest.getTopFocusWindow()
+xGridWindow = calcDoc.getChild("grid_window")
+enter_text_to_cell(xGridWindow, "A1", "guet")
+enter_text_to_cell(xGridWindow, "A2", "guͤt")
+enter_text_to_cell(xGridWindow, "A3", "tuon")
+enter_text_to_cell(xGridWindow, "A4", "tuͦn")
+enter_text_to_cell(xGridWindow, "A5", "vröude")
+enter_text_to_cell(xGridWindow, "A6", "vröudᵉ")
+xGridWindow.executeAction("SELECT", mkPropertyValues({"RANGE": 
"A1:A6"}))
+
+with 
self.ui_test.execute_dialog_through_command(".uno:DataFilterAutoFilter", 
close_button="no"):
+pass
+
+xGridWindow.executeAction("LAUNCH", 
mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
+xFloatWindow = self.xUITest.getFloatWindow()
+xTreeList = xFloatWindow.getChild("check_list_box")
+
+# Without the fix in place, the entries with superscript/modifier 
letters would not exist
+self.assertEqual(6, len(xTreeList.getChildren()))
+
self.assertEqual(get_state_as_dict(xTreeList.getChild("0"))["Text"], "guet")
+
self.assertEqual(get_state_as_dict(xTreeList.getChild("1"))["Text"], "guͤt")
+
self.assertEqual(get_state_as_dict(xTreeList.getChild("2"))["Text"], "tuon")
+
self.assertEqual(get_state_as_dict(xTreeList.getChild("3"))["Text"], "tuͦn")
+
self.assertEqual(get_state_as_dict(xTreeList.getChild("4"))["Text"], "vröude")
+
self.assertEqual(get_state_as_dict(xTreeList.getChild("5"))["Text"], "vröudᵉ")
+
def test_tdf94055(self):
 with self.ui_test.create_doc_in_start_center("calc") as document:
 calcDoc = self.xUITest.getTopFocusWindow()
diff --git a/sc/source/core/tool/typedstrdata.cxx 
b/sc/source/core/tool/typedstrdata.cxx
index bf659733366a..e00c1bc18d91 100644
--- a/sc/source/core/tool/typedstrdata.cxx
+++ b/sc/source/core/tool/typedstrdata.cxx
@@ -11,6 +11,7 @@
 #include 
 
 #include 
+#include 
 #include 
 
 bool ScTypedStrData::LessHiddenRows::operator() (const ScTypedStrData& left, 
const ScTypedStrData& right) const
@@ -77,8 +78,7 @@ bool ScTypedStrData::EqualCaseSensitive::operator() (const 
ScTypedStrData& left,
 if (left.mbIsDate != right.mbIsDate )
 return false;
 
-return ScGlobal::GetCaseCollator().compareString(
-left.maStrValue, right.maStrValue) == 0;
+return ScGlobal::GetCaseTransliteration().isEqual(left.maStrValue, 
right.maStrValue);
 }
 
 bool ScTypedStrData::EqualCaseInsensitive::operator() (const ScTypedStrData& 
left, 

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

2022-10-07 Thread Andreas Heinisch (via logerrit)
 sw/qa/uitest/writer_dialogs/openDialogs.py |3 -
 sw/qa/uitest/writer_tests7/tdf135938.py|   46 +
 sw/source/ui/fldui/fldref.cxx  |8 +++--
 3 files changed, 52 insertions(+), 5 deletions(-)

New commits:
commit c5d32e7a9a58e1643f1ef10bb24de40c58ab0edc
Author: Andreas Heinisch 
AuthorDate: Wed Oct 5 17:09:14 2022 +0200
Commit: Michael Stahl 
CommitDate: Fri Oct 7 12:04:26 2022 +0200

tdf#135938 - Refresh cross-reference name after filter selection has changed

Change-Id: I3e92adc10da089372637174f8551d531aea2fb13
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140985
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 
(cherry picked from commit fe51aa0a8d796b456a3c6966c47afc98e4532cd0)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141055
Reviewed-by: Michael Stahl 

diff --git a/sw/qa/uitest/writer_dialogs/openDialogs.py 
b/sw/qa/uitest/writer_dialogs/openDialogs.py
index ed3585e2923d..896d2fd641c7 100644
--- a/sw/qa/uitest/writer_dialogs/openDialogs.py
+++ b/sw/qa/uitest/writer_dialogs/openDialogs.py
@@ -50,8 +50,7 @@ dialogs = [
 # dialog opens but is not recognised by execute_dialog_through_command
 # {"command": ".uno:InsertBookmark", "closeButton": "close"},
 # tested in sw/qa/uitest/writer_tests2/bookmark.py
-# {"command": ".uno:InsertReferenceField", "closeButton": "close"},
-# dialog not closed
+{"command": ".uno:InsertReferenceField", "closeButton": "cancel"},
 # {"command": ".uno:InsertSymbol", "closeButton": "cancel"},
 # tested in sw/qa/uitest/writer_tests3/specialCharacter.py
 # {"command": ".uno:InsertFootnoteDialog", "closeButton": "cancel"},
diff --git a/sw/qa/uitest/writer_tests7/tdf135938.py 
b/sw/qa/uitest/writer_tests7/tdf135938.py
new file mode 100755
index ..013da93624da
--- /dev/null
+++ b/sw/qa/uitest/writer_tests7/tdf135938.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 get_state_as_dict
+from libreoffice.uno.propertyvalue import mkPropertyValues
+
+class tdf135938(UITestCase):
+
+def test_tdf135938_cross_reference_update(self):
+with self.ui_test.create_doc_in_start_center("writer"):
+with 
self.ui_test.execute_modeless_dialog_through_command(".uno:InsertReferenceField",
 close_button="cancel") as xDialog:
+# Select set reference type
+xTreelistType = xDialog.getChild("type-ref")
+xTreeEntry = xTreelistType.getChild('0')
+self.assertEqual(get_state_as_dict(xTreeEntry)["Text"], "Set 
Reference")
+xTreeEntry.executeAction("SELECT", tuple())
+
+# Insert cross references
+xName = xDialog.getChild("name-ref")
+xName.executeAction("TYPE", mkPropertyValues({"TEXT": "ABC"}))
+xInsert = xDialog.getChild("ok")
+xInsert.executeAction("CLICK", tuple())
+xName.executeAction("TYPE", 
mkPropertyValues({"KEYCODE":"CTRL+A"}))
+xName.executeAction("TYPE", mkPropertyValues({"TEXT": "DEF"}))
+xInsert.executeAction("CLICK", tuple())
+
+# Select insert reference type
+xTreeEntry = xTreelistType.getChild('1')
+self.assertEqual(get_state_as_dict(xTreeEntry)["Text"], 
"Insert Reference")
+xTreeEntry.executeAction("SELECT", tuple())
+
+# Filter the cross references
+xFilter = xDialog.getChild("filter")
+xFilter.executeAction("TYPE", mkPropertyValues({"TEXT": "A"}))
+# Without the fix in place, this test would have failed with
+# AssertionError: 'ABC' != 'DEF', i.e., the text of the name 
field did not change
+self.assertEqual(get_state_as_dict(xName)["Text"], "ABC")
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/source/ui/fldui/fldref.cxx b/sw/source/ui/fldui/fldref.cxx
index 1fbd69c9f10e..bae2557f173d 100644
--- a/sw/source/ui/fldui/fldref.cxx
+++ b/sw/source/ui/fldui/fldref.cxx
@@ -122,6 +122,8 @@ SwFieldRefPage::~SwFieldRefPage()
 IMPL_LINK_NOARG(SwFieldRefPage, ModifyHdl_Impl, weld::Entry&, void)
 {
 UpdateSubType(comphelper::string::strip(m_xFilterED->get_text(), ' '));
+// tdf#135938 - refresh cross-reference name after filter selection has 
changed
+SubTypeHdl();
 }
 
 // #i83479#
@@ -377,9 +379,6 @@ IMPL_LINK_NOARG(SwFieldRefPage, TypeHdl, weld::TreeView&, 
void)
 
 sal_uInt16 nTypeId = m_xTypeLB->get_id(GetTypeSel()).toUInt32();
 
-// 

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

2022-10-06 Thread Andreas Heinisch (via logerrit)
 sw/qa/uitest/writer_dialogs/openDialogs.py |3 -
 sw/qa/uitest/writer_tests7/tdf135938.py|   46 +
 sw/source/ui/fldui/fldref.cxx  |8 +++--
 3 files changed, 52 insertions(+), 5 deletions(-)

New commits:
commit fe51aa0a8d796b456a3c6966c47afc98e4532cd0
Author: Andreas Heinisch 
AuthorDate: Wed Oct 5 17:09:14 2022 +0200
Commit: Andreas Heinisch 
CommitDate: Thu Oct 6 21:50:43 2022 +0200

tdf#135938 - Refresh cross-reference name after filter selection has changed

Change-Id: I3e92adc10da089372637174f8551d531aea2fb13
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140985
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 

diff --git a/sw/qa/uitest/writer_dialogs/openDialogs.py 
b/sw/qa/uitest/writer_dialogs/openDialogs.py
index ed3585e2923d..896d2fd641c7 100644
--- a/sw/qa/uitest/writer_dialogs/openDialogs.py
+++ b/sw/qa/uitest/writer_dialogs/openDialogs.py
@@ -50,8 +50,7 @@ dialogs = [
 # dialog opens but is not recognised by execute_dialog_through_command
 # {"command": ".uno:InsertBookmark", "closeButton": "close"},
 # tested in sw/qa/uitest/writer_tests2/bookmark.py
-# {"command": ".uno:InsertReferenceField", "closeButton": "close"},
-# dialog not closed
+{"command": ".uno:InsertReferenceField", "closeButton": "cancel"},
 # {"command": ".uno:InsertSymbol", "closeButton": "cancel"},
 # tested in sw/qa/uitest/writer_tests3/specialCharacter.py
 # {"command": ".uno:InsertFootnoteDialog", "closeButton": "cancel"},
diff --git a/sw/qa/uitest/writer_tests7/tdf135938.py 
b/sw/qa/uitest/writer_tests7/tdf135938.py
new file mode 100755
index ..013da93624da
--- /dev/null
+++ b/sw/qa/uitest/writer_tests7/tdf135938.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 get_state_as_dict
+from libreoffice.uno.propertyvalue import mkPropertyValues
+
+class tdf135938(UITestCase):
+
+def test_tdf135938_cross_reference_update(self):
+with self.ui_test.create_doc_in_start_center("writer"):
+with 
self.ui_test.execute_modeless_dialog_through_command(".uno:InsertReferenceField",
 close_button="cancel") as xDialog:
+# Select set reference type
+xTreelistType = xDialog.getChild("type-ref")
+xTreeEntry = xTreelistType.getChild('0')
+self.assertEqual(get_state_as_dict(xTreeEntry)["Text"], "Set 
Reference")
+xTreeEntry.executeAction("SELECT", tuple())
+
+# Insert cross references
+xName = xDialog.getChild("name-ref")
+xName.executeAction("TYPE", mkPropertyValues({"TEXT": "ABC"}))
+xInsert = xDialog.getChild("ok")
+xInsert.executeAction("CLICK", tuple())
+xName.executeAction("TYPE", 
mkPropertyValues({"KEYCODE":"CTRL+A"}))
+xName.executeAction("TYPE", mkPropertyValues({"TEXT": "DEF"}))
+xInsert.executeAction("CLICK", tuple())
+
+# Select insert reference type
+xTreeEntry = xTreelistType.getChild('1')
+self.assertEqual(get_state_as_dict(xTreeEntry)["Text"], 
"Insert Reference")
+xTreeEntry.executeAction("SELECT", tuple())
+
+# Filter the cross references
+xFilter = xDialog.getChild("filter")
+xFilter.executeAction("TYPE", mkPropertyValues({"TEXT": "A"}))
+# Without the fix in place, this test would have failed with
+# AssertionError: 'ABC' != 'DEF', i.e., the text of the name 
field did not change
+self.assertEqual(get_state_as_dict(xName)["Text"], "ABC")
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/source/ui/fldui/fldref.cxx b/sw/source/ui/fldui/fldref.cxx
index 1fbd69c9f10e..bae2557f173d 100644
--- a/sw/source/ui/fldui/fldref.cxx
+++ b/sw/source/ui/fldui/fldref.cxx
@@ -122,6 +122,8 @@ SwFieldRefPage::~SwFieldRefPage()
 IMPL_LINK_NOARG(SwFieldRefPage, ModifyHdl_Impl, weld::Entry&, void)
 {
 UpdateSubType(comphelper::string::strip(m_xFilterED->get_text(), ' '));
+// tdf#135938 - refresh cross-reference name after filter selection has 
changed
+SubTypeHdl();
 }
 
 // #i83479#
@@ -377,9 +379,6 @@ IMPL_LINK_NOARG(SwFieldRefPage, TypeHdl, weld::TreeView&, 
void)
 
 sal_uInt16 nTypeId = m_xTypeLB->get_id(GetTypeSel()).toUInt32();
 
-// fill selection-ListBox
-UpdateSubType(comphelper::string::strip(m_xFilterED->get_text(), ' '));
-
 bool bName = false;
 nFieldDlgFormatSel = 0;
 
@@ 

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

2022-10-05 Thread Andreas Heinisch (via logerrit)
 sc/qa/uitest/autofilter/autofilter.py |   39 ++
 sc/source/ui/view/viewfunc.cxx|   28 +++-
 2 files changed, 66 insertions(+), 1 deletion(-)

New commits:
commit 3394e8746c505a8dae112f555cb2bb3e4596cbba
Author: Andreas Heinisch 
AuthorDate: Tue Sep 13 22:18:09 2022 +0200
Commit: Eike Rathke 
CommitDate: Wed Oct 5 17:30:46 2022 +0200

tdf#36383 - sc AutoFilter: fix changing row height

Changing row height showed the rows hidden
by AutoFilter, removing the result of the filtering.

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

diff --git a/sc/qa/uitest/autofilter/autofilter.py 
b/sc/qa/uitest/autofilter/autofilter.py
index 8f6db292230e..f792c0fdad33 100644
--- a/sc/qa/uitest/autofilter/autofilter.py
+++ b/sc/qa/uitest/autofilter/autofilter.py
@@ -376,6 +376,45 @@ class AutofilterTest(UITestCase):
 self.assertFalse(is_row_hidden(doc, 6))
 self.assertFalse(is_row_hidden(doc, 7))
 
+def test_tdf36383_row_height(self):
+with self.ui_test.create_doc_in_start_center("calc") as document:
+calcDoc = self.xUITest.getTopFocusWindow()
+gridwin = calcDoc.getChild("grid_window")
+
+enter_text_to_cell(gridwin, "A1", "A")
+enter_text_to_cell(gridwin, "A2", "1")
+enter_text_to_cell(gridwin, "A3", "2")
+enter_text_to_cell(gridwin, "A4", "3")
+gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": 
"A1:A4"}))
+
+self.xUITest.executeCommand(".uno:DataFilterAutoFilter")
+gridwin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": 
"", "COL": "0", "ROW": "0"}))
+xFloatWindow = self.xUITest.getFloatWindow()
+xCheckListMenu = xFloatWindow.getChild("FilterDropDown")
+xTreeList = xCheckListMenu.getChild("check_list_box")
+xEntry = xTreeList.getChild("1")
+xEntry.executeAction("CLICK", tuple())
+
+xOkButton = xFloatWindow.getChild("ok")
+xOkButton.executeAction("CLICK", tuple())
+
+self.assertTrue(is_row_hidden(document, 2))
+
+# row height
+with self.ui_test.execute_dialog_through_command(".uno:RowHeight") 
as xDialog:
+xvalue = xDialog.getChild("value")
+xvalue.executeAction("TYPE", 
mkPropertyValues({"KEYCODE":"CTRL+A"}))
+xvalue.executeAction("TYPE", 
mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+xvalue.executeAction("TYPE", mkPropertyValues({"TEXT":"1 cm"}))
+
+self.assertTrue(is_row_hidden(document, 2))
+
+# optimal row height
+with 
self.ui_test.execute_dialog_through_command(".uno:SetOptimalRowHeight"):
+pass
+
+self.assertTrue(is_row_hidden(document, 2))
+
 def test_tdf142350(self):
 with self.ui_test.create_doc_in_start_center("calc") as document:
 calcDoc = self.xUITest.getTopFocusWindow()
diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx
index c5341aadfa65..423c66abef2b 100644
--- a/sc/source/ui/view/viewfunc.cxx
+++ b/sc/source/ui/view/viewfunc.cxx
@@ -80,6 +80,19 @@
 
 #include 
 
+static void ShowFilteredRows(ScDocument& rDoc, SCTAB nTab, SCCOLROW nStartNo, 
SCCOLROW nEndNo,
+ bool bShow)
+{
+SCROW nFirstRow = nStartNo;
+SCROW nLastRow = nStartNo;
+do
+{
+if (!rDoc.RowFiltered(nFirstRow, nTab, nullptr, ))
+rDoc.ShowRows(nFirstRow, nLastRow < nEndNo ? nLastRow : nEndNo, 
nTab, bShow);
+nFirstRow = nLastRow + 1;
+} while (nFirstRow <= nEndNo);
+}
+
 static void lcl_PostRepaintCondFormat( const ScConditionalFormat *pCondFmt, 
ScDocShell *pDocSh )
 {
 if( pCondFmt )
@@ -2202,6 +2215,7 @@ void ScViewFunc::SetWidthOrHeight(
 if ( eMode==SC_SIZE_OPTIMAL || eMode==SC_SIZE_VISOPT )
 {
 bool bAll = ( eMode==SC_SIZE_OPTIMAL );
+bool bFiltered = false;
 if (!bAll)
 {
 //  delete CRFlags::ManualSize for all in range,
@@ -2220,6 +2234,14 @@ void ScViewFunc::SetWidthOrHeight(
 rDoc.SetRowFlags(nRow, nTab, nOld & 
~CRFlags::ManualSize);
 }
 }
+else
+{
+SCROW nLastRow = nStartNo;
+if (rDoc.RowFiltered(nStartNo, nTab, nullptr, 
)
+|| nLastRow < nEndNo)
+bFiltered = true;
+}
+
 
 double nPPTX = GetViewData().GetPPTX();
 double nPPTY = GetViewData().GetPPTY();
@@ -2239,6 +2261,9 @@ void 

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

2022-10-05 Thread Andreas Heinisch (via logerrit)
 forms/source/component/FormComponent.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 7c1a8152889fe38d961f8f605713c44293920a28
Author: Andreas Heinisch 
AuthorDate: Wed Sep 28 16:30:01 2022 +0200
Commit: Andreas Heinisch 
CommitDate: Wed Oct 5 15:31:51 2022 +0200

tdf#122319 - Don't allow nullable form components if input is required

Change-Id: I676aab37df7a98192680b87f0143a27d2a5fd3ee
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140713
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 

diff --git a/forms/source/component/FormComponent.cxx 
b/forms/source/component/FormComponent.cxx
index 9b5558eed5e6..7b6dd36c5e75 100644
--- a/forms/source/component/FormComponent.cxx
+++ b/forms/source/component/FormComponent.cxx
@@ -1960,7 +1960,8 @@ void OBoundControlModel::connectToField(const 
Reference& rForm)
 m_xColumn.set( m_xField, UNO_QUERY );
 sal_Int32 nNullableFlag = ColumnValue::NO_NULLS;
 m_xField->getPropertyValue(PROPERTY_ISNULLABLE) >>= 
nNullableFlag;
-m_bRequired = (ColumnValue::NO_NULLS == nNullableFlag);
+// tdf#122319 - don't allow nullable form components if input 
is required
+m_bRequired = (ColumnValue::NO_NULLS == nNullableFlag || 
m_bInputRequired);
 // we're optimistic: in case of ColumnValue_NULLABLE_UNKNOWN 
we assume nullability...
 }
 else


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

2022-10-03 Thread Andreas Heinisch (via logerrit)
 sc/qa/unit/uicalc/uicalc.cxx   |   49 +
 sc/source/ui/view/viewfunc.cxx |   11 +
 2 files changed, 56 insertions(+), 4 deletions(-)

New commits:
commit 38034728339c358286aa4fb97d372210712a9ad9
Author: Andreas Heinisch 
AuthorDate: Sat Sep 3 16:40:11 2022 +0200
Commit: Eike Rathke 
CommitDate: Mon Oct 3 17:17:28 2022 +0200

tdf#131073 - Don't show hidden rows/cols after setting optimal row/col 
height

Change-Id: I1dbe92cfc577e3425787b942415182889cda6a76
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139327
Tested-by: Jenkins
Reviewed-by: Heiko Tietze 
Reviewed-by: Andreas Heinisch 
(cherry picked from commit 9caf9f8fde68f075a9ae1377bcc0cf6127c1737f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140884
Reviewed-by: Eike Rathke 

diff --git a/sc/qa/unit/uicalc/uicalc.cxx b/sc/qa/unit/uicalc/uicalc.cxx
index 2e48f42f2e73..042be6d569be 100644
--- a/sc/qa/unit/uicalc/uicalc.cxx
+++ b/sc/qa/unit/uicalc/uicalc.cxx
@@ -2237,6 +2237,55 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf132431)
 CPPUNIT_ASSERT_EQUAL(OUString("Err:502"), pDoc->GetString(ScAddress(7, 
219, 0)));
 }
 
+CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf131073)
+{
+mxComponent = loadFromDesktop("private:factory/scalc");
+ScModelObj* pModelObj = dynamic_cast(mxComponent.get());
+CPPUNIT_ASSERT(pModelObj);
+ScDocument* pDoc = pModelObj->GetDocument();
+CPPUNIT_ASSERT(pDoc);
+
+for (SCCOLROW nColRow = 0; nColRow < 3; nColRow++)
+{
+pDoc->SetString(ScAddress(0, nColRow, 0), "Hello World");
+pDoc->SetRowHeight(0, nColRow, 1000 * (nColRow + 1));
+pDoc->SetString(ScAddress(nColRow, 0, 0), "Hello World");
+pDoc->SetColWidth(nColRow, 0, 1000 * (nColRow + 1));
+}
+
+// Check rows
+pDoc->SetRowHidden(1, 1, 0, true);
+goToCell("A1:A3");
+dispatchCommand(
+mxComponent, ".uno:SetOptimalRowHeight",
+comphelper::InitPropertySequence({ { "aExtraHeight", 
uno::Any(sal_uInt16(0)) } }));
+
+CPPUNIT_ASSERT(!pDoc->RowHidden(0, 0));
+// tdf#131073: Without the fix in place, the second row would not be hidden
+CPPUNIT_ASSERT(pDoc->RowHidden(1, 0));
+CPPUNIT_ASSERT(!pDoc->RowHidden(2, 0));
+const sal_uInt16 nStdRowHeight = pDoc->GetRowHeight(4, 0);
+CPPUNIT_ASSERT_EQUAL(nStdRowHeight, pDoc->GetRowHeight(0, 0));
+CPPUNIT_ASSERT_EQUAL(nStdRowHeight, pDoc->GetRowHeight(1, SCTAB(0), 
false));
+CPPUNIT_ASSERT_EQUAL(nStdRowHeight, pDoc->GetRowHeight(2, 0));
+
+// Check columns
+pDoc->SetColHidden(1, 1, 0, true);
+goToCell("A1:C1");
+dispatchCommand(
+mxComponent, ".uno:SetOptimalColumnWidth",
+comphelper::InitPropertySequence({ { "aExtraWidth", 
uno::Any(sal_uInt16(0)) } }));
+
+CPPUNIT_ASSERT(!pDoc->ColHidden(0, 0));
+// tdf#131073: Without the fix in place, the second column would not be 
hidden
+CPPUNIT_ASSERT(pDoc->ColHidden(1, 0));
+CPPUNIT_ASSERT(!pDoc->ColHidden(2, 0));
+const sal_uInt16 nStdColWidth = pDoc->GetColWidth(0, 0);
+CPPUNIT_ASSERT_EQUAL(nStdColWidth, pDoc->GetColWidth(0, 0));
+CPPUNIT_ASSERT_EQUAL(nStdColWidth, pDoc->GetColWidth(1, SCTAB(0), false));
+CPPUNIT_ASSERT_EQUAL(nStdColWidth, pDoc->GetColWidth(2, 0));
+}
+
 CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf83901)
 {
 mxComponent = loadFromDesktop("private:factory/scalc");
diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx
index cd886c976c88..d343551c984b 100644
--- a/sc/source/ui/view/viewfunc.cxx
+++ b/sc/source/ui/view/viewfunc.cxx
@@ -2238,8 +2238,6 @@ void ScViewFunc::SetWidthOrHeight(
 aCxt.setForceAutoSize(bAll);
 aCxt.setExtraHeight(nSizeTwips);
 rDoc.SetOptimalHeight(aCxt, nStartNo, nEndNo, nTab, true);
-if (bAll)
-rDoc.ShowRows( nStartNo, nEndNo, nTab, true );
 
 //  Manual-Flag already (re)set in SetOptimalHeight in 
case of bAll=sal_True
 //  (set for Extra-Height, else reset).
@@ -2268,7 +2266,8 @@ void ScViewFunc::SetWidthOrHeight(
 {
 for (SCCOL nCol=static_cast(nStartNo); 
nCol<=static_cast(nEndNo); nCol++)
 {
-if ( eMode != SC_SIZE_VISOPT || !rDoc.ColHidden(nCol, 
nTab) )
+const bool bIsColHidden = rDoc.ColHidden(nCol, nTab);
+if ( eMode != SC_SIZE_VISOPT || !bIsColHidden )
 {
 sal_uInt16 nThisSize = nSizeTwips;
 
@@ -2277,7 +2276,11 @@ void ScViewFunc::SetWidthOrHeight(
 if ( nThisSize )
 rDoc.SetColWidth( nCol, nTab, nThisSize );
 
-rDoc.ShowCol( nCol, nTab, bShow );
+// tdf#131073 - Don't show hidden cols after setting 
optimal col width
+if (eMode == 

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

2022-10-03 Thread Andreas Heinisch (via logerrit)
 basic/qa/basic_coverage/test_tdf147529_optional_parameters_msgbox.bas |4 
 basic/qa/vba_tests/tdf147529_optional_parameters_msgbox.vb|4 
 basic/source/runtime/methods.cxx  |   49 
++
 3 files changed, 32 insertions(+), 25 deletions(-)

New commits:
commit a2838a17498001c07b365d2087239710e7f0473a
Author: Andreas Heinisch 
AuthorDate: Sun Sep 18 21:57:21 2022 +0200
Commit: Xisco Fauli 
CommitDate: Mon Oct 3 11:59:57 2022 +0200

tdf#151012 - Initialize optional parameters with their default values

Change-Id: I3ed3eb904b50892e5946abe684e801819ba296e6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140128
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 
(cherry picked from commit 6f3532f6aaafb6ad58a9e32dc0eff43a0d54862b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140513
Reviewed-by: Xisco Fauli 

diff --git 
a/basic/qa/basic_coverage/test_tdf147529_optional_parameters_msgbox.bas 
b/basic/qa/basic_coverage/test_tdf147529_optional_parameters_msgbox.bas
index dabb23c0faf1..67378213e287 100755
--- a/basic/qa/basic_coverage/test_tdf147529_optional_parameters_msgbox.bas
+++ b/basic/qa/basic_coverage/test_tdf147529_optional_parameters_msgbox.bas
@@ -18,9 +18,7 @@ Sub verify_testOptionalParametersMsgBox
 On Error GoTo errorHandler
 
 ' tdf#147529 - check for missing optional parameters
-TestUtil.AssertEqual(TestOptionalParametersMsgBox(),  True, 
"TestOptionalParametersMsgBox()")
-TestUtil.AssertEqual(TestOptionalParametersMsgBox("test"),True, 
"TestOptionalParametersMsgBox(""test"")")
-TestUtil.AssertEqual(TestOptionalParametersMsgBox("test", 1), True, 
"TestOptionalParametersMsgBox(""test"", 1)")
+TestUtil.AssertEqual(TestOptionalParametersMsgBox(), True, 
"TestOptionalParametersMsgBox()")
 
 Exit Sub
 errorHandler:
diff --git a/basic/qa/vba_tests/tdf147529_optional_parameters_msgbox.vb 
b/basic/qa/vba_tests/tdf147529_optional_parameters_msgbox.vb
index dabe552a821b..e599f46eedf1 100755
--- a/basic/qa/vba_tests/tdf147529_optional_parameters_msgbox.vb
+++ b/basic/qa/vba_tests/tdf147529_optional_parameters_msgbox.vb
@@ -19,9 +19,7 @@ Sub verify_testOptionalParametersMsgBox
 On Error GoTo errorHandler
 
 ' tdf#147529 - check for missing optional parameters
-TestUtil.AssertEqual(TestOptionalParametersMsgBox(),  True, 
"TestOptionalParametersMsgBox()")
-TestUtil.AssertEqual(TestOptionalParametersMsgBox("test"),True, 
"TestOptionalParametersMsgBox(""test"")")
-TestUtil.AssertEqual(TestOptionalParametersMsgBox("test", 1), True, 
"TestOptionalParametersMsgBox(""test"", 1)")
+TestUtil.AssertEqual(TestOptionalParametersMsgBox(), True, 
"TestOptionalParametersMsgBox()")
 
 Exit Sub
 errorHandler:
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index fe654bbe6fd5..17d7674e4d02 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -3284,6 +3284,28 @@ void SbRtl_Format(StarBASIC *, SbxArray & rPar, bool)
 }
 }
 
+static bool IsMissing(SbxArray& rPar, const sal_uInt32 i)
+{
+const sal_uInt32 nArgCount = rPar.Count();
+if (nArgCount <= i)
+return true;
+
+SbxVariable* aPar = rPar.Get(i);
+return (aPar->GetType() == SbxERROR && SbiRuntime::IsMissing(aPar, 1));
+}
+
+static sal_Int16 GetOptionalIntegerParamOrDefault(SbxArray& rPar, const 
sal_uInt32 i,
+  const sal_Int16 defaultValue)
+{
+return IsMissing(rPar, i) ? defaultValue : rPar.Get(i)->GetInteger();
+}
+
+static OUString GetOptionalOUStringParamOrDefault(SbxArray& rPar, const 
sal_uInt32 i,
+  const OUString& defaultValue)
+{
+return IsMissing(rPar, i) ? defaultValue : rPar.Get(i)->GetOUString();
+}
+
 static void lcl_FormatNumberPercent(SbxArray& rPar, bool isPercent)
 {
 const sal_uInt32 nArgCount = rPar.Count();
@@ -4327,19 +4349,15 @@ void SbRtl_MsgBox(StarBASIC *, SbxArray & rPar, bool)
 return;
 }
 
-// tdf#147529 - check for missing optional parameters
-for (sal_uInt32 i = 2; i < nArgCount; i++)
+// tdf#147529 - check for missing parameters
+if (IsMissing(rPar, 1))
 {
-if (rPar.Get(i)->GetType() == SbxERROR && 
SbiRuntime::IsMissing(rPar.Get(i), 1))
-{
-StarBASIC::Error(ERRCODE_BASIC_NOT_OPTIONAL);
-return;
-}
+StarBASIC::Error(ERRCODE_BASIC_NOT_OPTIONAL);
+return;
 }
 
-WinBits nType = 0; // MB_OK
-if( nArgCount >= 3 )
-nType = static_cast(rPar.Get(2)->GetInteger());
+// tdf#151012 - initialize optional parameters with their default values 
(number of buttons)
+WinBits nType = 
static_cast(GetOptionalIntegerParamOrDefault(rPar, 2, 0)); // MB_OK
 WinBits nStyle = nType;
 nStyle &= 15; // delete bits 4-16
 if (nStyle > 5)
@@ -4357,15 

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

2022-10-01 Thread Andreas Heinisch (via logerrit)
 sw/source/uibase/docvw/edtwin.cxx   |   19 +++
 sw/source/uibase/shells/textidx.cxx |2 +-
 2 files changed, 20 insertions(+), 1 deletion(-)

New commits:
commit 2a7fcaf582df3ada57ca519b50e29011973a1b6f
Author: Andreas Heinisch 
AuthorDate: Sat Oct 1 11:31:41 2022 +0200
Commit: Andreas Heinisch 
CommitDate: Sat Oct 1 21:58:17 2022 +0200

tdf#143158 - Handle double clicks on alphabetical indices

Open the edit index dialog when double-clicking an alphabetical index field.

Change-Id: Iaba398e485d2e7e848503189ad1f3b12975a5a71
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140836
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 

diff --git a/sw/source/uibase/docvw/edtwin.cxx 
b/sw/source/uibase/docvw/edtwin.cxx
index 1ceb7d70f827..d7fed1052210 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -3514,6 +3514,25 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
 }
 }
 
+// tdf#143158 - handle alphabetical index entries
+SwContentAtPos aToxContentAtPos(IsAttrAtPos::ToxMark);
+if (rSh.GetContentAtPos(aDocPos, aToxContentAtPos))
+{
+const OUString sToxText = aToxContentAtPos.sStr;
+if (!sToxText.isEmpty() && 
aToxContentAtPos.pFndTextAttr)
+{
+const SwTOXType* pTType
+= 
aToxContentAtPos.pFndTextAttr->GetTOXMark().GetTOXType();
+if (pTType && pTType->GetType() == 
TOXTypes::TOX_INDEX)
+{
+RstMBDownFlags();
+
GetView().GetViewFrame()->GetBindings().Execute(
+FN_EDIT_IDX_ENTRY_DLG);
+return;
+}
+}
+}
+
 g_bHoldSelection = true;
 return;
 }
diff --git a/sw/source/uibase/shells/textidx.cxx 
b/sw/source/uibase/shells/textidx.cxx
index 590b9fa82f0b..299de33d1490 100644
--- a/sw/source/uibase/shells/textidx.cxx
+++ b/sw/source/uibase/shells/textidx.cxx
@@ -196,7 +196,7 @@ void SwTextShell::GetIdxState(SfxItemSet )
 
 bool bEnableEdit = true;
 bool bInReadonly = rSh.HasReadonlySel();
-if( rSh.HasSelection() || bInReadonly)
+if(bInReadonly)
 bEnableEdit = false;
 else
 {


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

2022-09-25 Thread Andreas Heinisch (via logerrit)
 basic/qa/basic_coverage/test_tdf147529_optional_parameters_msgbox.bas |4 
 basic/qa/vba_tests/tdf147529_optional_parameters_msgbox.vb|4 
 basic/source/runtime/methods.cxx  |   49 
++
 3 files changed, 32 insertions(+), 25 deletions(-)

New commits:
commit 6f3532f6aaafb6ad58a9e32dc0eff43a0d54862b
Author: Andreas Heinisch 
AuthorDate: Sun Sep 18 21:57:21 2022 +0200
Commit: Andreas Heinisch 
CommitDate: Sun Sep 25 11:39:33 2022 +0200

tdf#151012 - Initialize optional parameters with their default values

Change-Id: I3ed3eb904b50892e5946abe684e801819ba296e6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140128
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 

diff --git 
a/basic/qa/basic_coverage/test_tdf147529_optional_parameters_msgbox.bas 
b/basic/qa/basic_coverage/test_tdf147529_optional_parameters_msgbox.bas
index dabb23c0faf1..67378213e287 100644
--- a/basic/qa/basic_coverage/test_tdf147529_optional_parameters_msgbox.bas
+++ b/basic/qa/basic_coverage/test_tdf147529_optional_parameters_msgbox.bas
@@ -18,9 +18,7 @@ Sub verify_testOptionalParametersMsgBox
 On Error GoTo errorHandler
 
 ' tdf#147529 - check for missing optional parameters
-TestUtil.AssertEqual(TestOptionalParametersMsgBox(),  True, 
"TestOptionalParametersMsgBox()")
-TestUtil.AssertEqual(TestOptionalParametersMsgBox("test"),True, 
"TestOptionalParametersMsgBox(""test"")")
-TestUtil.AssertEqual(TestOptionalParametersMsgBox("test", 1), True, 
"TestOptionalParametersMsgBox(""test"", 1)")
+TestUtil.AssertEqual(TestOptionalParametersMsgBox(), True, 
"TestOptionalParametersMsgBox()")
 
 Exit Sub
 errorHandler:
diff --git a/basic/qa/vba_tests/tdf147529_optional_parameters_msgbox.vb 
b/basic/qa/vba_tests/tdf147529_optional_parameters_msgbox.vb
index dabe552a821b..e599f46eedf1 100644
--- a/basic/qa/vba_tests/tdf147529_optional_parameters_msgbox.vb
+++ b/basic/qa/vba_tests/tdf147529_optional_parameters_msgbox.vb
@@ -19,9 +19,7 @@ Sub verify_testOptionalParametersMsgBox
 On Error GoTo errorHandler
 
 ' tdf#147529 - check for missing optional parameters
-TestUtil.AssertEqual(TestOptionalParametersMsgBox(),  True, 
"TestOptionalParametersMsgBox()")
-TestUtil.AssertEqual(TestOptionalParametersMsgBox("test"),True, 
"TestOptionalParametersMsgBox(""test"")")
-TestUtil.AssertEqual(TestOptionalParametersMsgBox("test", 1), True, 
"TestOptionalParametersMsgBox(""test"", 1)")
+TestUtil.AssertEqual(TestOptionalParametersMsgBox(), True, 
"TestOptionalParametersMsgBox()")
 
 Exit Sub
 errorHandler:
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index 3b718d78a9af..9cc839a1e154 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -3285,6 +3285,28 @@ void SbRtl_Format(StarBASIC *, SbxArray & rPar, bool)
 }
 }
 
+static bool IsMissing(SbxArray& rPar, const sal_uInt32 i)
+{
+const sal_uInt32 nArgCount = rPar.Count();
+if (nArgCount <= i)
+return true;
+
+SbxVariable* aPar = rPar.Get(i);
+return (aPar->GetType() == SbxERROR && SbiRuntime::IsMissing(aPar, 1));
+}
+
+static sal_Int16 GetOptionalIntegerParamOrDefault(SbxArray& rPar, const 
sal_uInt32 i,
+  const sal_Int16 defaultValue)
+{
+return IsMissing(rPar, i) ? defaultValue : rPar.Get(i)->GetInteger();
+}
+
+static OUString GetOptionalOUStringParamOrDefault(SbxArray& rPar, const 
sal_uInt32 i,
+  const OUString& defaultValue)
+{
+return IsMissing(rPar, i) ? defaultValue : rPar.Get(i)->GetOUString();
+}
+
 static void lcl_FormatNumberPercent(SbxArray& rPar, bool isPercent)
 {
 const sal_uInt32 nArgCount = rPar.Count();
@@ -4328,19 +4350,15 @@ void SbRtl_MsgBox(StarBASIC *, SbxArray & rPar, bool)
 return;
 }
 
-// tdf#147529 - check for missing optional parameters
-for (sal_uInt32 i = 2; i < nArgCount; i++)
+// tdf#147529 - check for missing parameters
+if (IsMissing(rPar, 1))
 {
-if (rPar.Get(i)->GetType() == SbxERROR && 
SbiRuntime::IsMissing(rPar.Get(i), 1))
-{
-StarBASIC::Error(ERRCODE_BASIC_NOT_OPTIONAL);
-return;
-}
+StarBASIC::Error(ERRCODE_BASIC_NOT_OPTIONAL);
+return;
 }
 
-WinBits nType = 0; // MB_OK
-if( nArgCount >= 3 )
-nType = static_cast(rPar.Get(2)->GetInteger());
+// tdf#151012 - initialize optional parameters with their default values 
(number of buttons)
+WinBits nType = 
static_cast(GetOptionalIntegerParamOrDefault(rPar, 2, 0)); // MB_OK
 WinBits nStyle = nType;
 nStyle &= 15; // delete bits 4-16
 if (nStyle > 5)
@@ -4358,15 +4376,8 @@ void SbRtl_MsgBox(StarBASIC *, SbxArray & rPar, bool)
 };
 
 OUString aMsg = rPar.Get(1)->GetOUString();
-OUString aTitle;
-if( 

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

2022-09-12 Thread Andreas Heinisch (via logerrit)
 sc/qa/unit/uicalc/uicalc.cxx   |   49 +
 sc/source/ui/view/viewfunc.cxx |   11 +
 2 files changed, 56 insertions(+), 4 deletions(-)

New commits:
commit 9caf9f8fde68f075a9ae1377bcc0cf6127c1737f
Author: Andreas Heinisch 
AuthorDate: Sat Sep 3 16:40:11 2022 +0200
Commit: Andreas Heinisch 
CommitDate: Mon Sep 12 10:26:01 2022 +0200

tdf#131073 - Don't show hidden rows/cols after setting optimal row/col 
height

Change-Id: I1dbe92cfc577e3425787b942415182889cda6a76
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139327
Tested-by: Jenkins
Reviewed-by: Heiko Tietze 
Reviewed-by: Andreas Heinisch 

diff --git a/sc/qa/unit/uicalc/uicalc.cxx b/sc/qa/unit/uicalc/uicalc.cxx
index ab258894eb16..bd175ec1bde5 100644
--- a/sc/qa/unit/uicalc/uicalc.cxx
+++ b/sc/qa/unit/uicalc/uicalc.cxx
@@ -2277,6 +2277,55 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf132431)
 CPPUNIT_ASSERT_EQUAL(OUString("Err:502"), pDoc->GetString(ScAddress(7, 
219, 0)));
 }
 
+CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf131073)
+{
+mxComponent = loadFromDesktop("private:factory/scalc");
+ScModelObj* pModelObj = dynamic_cast(mxComponent.get());
+CPPUNIT_ASSERT(pModelObj);
+ScDocument* pDoc = pModelObj->GetDocument();
+CPPUNIT_ASSERT(pDoc);
+
+for (SCCOLROW nColRow = 0; nColRow < 3; nColRow++)
+{
+pDoc->SetString(ScAddress(0, nColRow, 0), "Hello World");
+pDoc->SetRowHeight(0, nColRow, 1000 * (nColRow + 1));
+pDoc->SetString(ScAddress(nColRow, 0, 0), "Hello World");
+pDoc->SetColWidth(nColRow, 0, 1000 * (nColRow + 1));
+}
+
+// Check rows
+pDoc->SetRowHidden(1, 1, 0, true);
+goToCell("A1:A3");
+dispatchCommand(
+mxComponent, ".uno:SetOptimalRowHeight",
+comphelper::InitPropertySequence({ { "aExtraHeight", 
uno::Any(sal_uInt16(0)) } }));
+
+CPPUNIT_ASSERT(!pDoc->RowHidden(0, 0));
+// tdf#131073: Without the fix in place, the second row would not be hidden
+CPPUNIT_ASSERT(pDoc->RowHidden(1, 0));
+CPPUNIT_ASSERT(!pDoc->RowHidden(2, 0));
+const sal_uInt16 nStdRowHeight = pDoc->GetRowHeight(4, 0);
+CPPUNIT_ASSERT_EQUAL(nStdRowHeight, pDoc->GetRowHeight(0, 0));
+CPPUNIT_ASSERT_EQUAL(nStdRowHeight, pDoc->GetRowHeight(1, SCTAB(0), 
false));
+CPPUNIT_ASSERT_EQUAL(nStdRowHeight, pDoc->GetRowHeight(2, 0));
+
+// Check columns
+pDoc->SetColHidden(1, 1, 0, true);
+goToCell("A1:C1");
+dispatchCommand(
+mxComponent, ".uno:SetOptimalColumnWidth",
+comphelper::InitPropertySequence({ { "aExtraWidth", 
uno::Any(sal_uInt16(0)) } }));
+
+CPPUNIT_ASSERT(!pDoc->ColHidden(0, 0));
+// tdf#131073: Without the fix in place, the second column would not be 
hidden
+CPPUNIT_ASSERT(pDoc->ColHidden(1, 0));
+CPPUNIT_ASSERT(!pDoc->ColHidden(2, 0));
+const sal_uInt16 nStdColWidth = pDoc->GetColWidth(0, 0);
+CPPUNIT_ASSERT_EQUAL(nStdColWidth, pDoc->GetColWidth(0, 0));
+CPPUNIT_ASSERT_EQUAL(nStdColWidth, pDoc->GetColWidth(1, SCTAB(0), false));
+CPPUNIT_ASSERT_EQUAL(nStdColWidth, pDoc->GetColWidth(2, 0));
+}
+
 CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf83901)
 {
 mxComponent = loadFromDesktop("private:factory/scalc");
diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx
index c1c003205828..c5341aadfa65 100644
--- a/sc/source/ui/view/viewfunc.cxx
+++ b/sc/source/ui/view/viewfunc.cxx
@@ -2238,8 +2238,6 @@ void ScViewFunc::SetWidthOrHeight(
 aCxt.setForceAutoSize(bAll);
 aCxt.setExtraHeight(nSizeTwips);
 rDoc.SetOptimalHeight(aCxt, nStartNo, nEndNo, nTab, true);
-if (bAll)
-rDoc.ShowRows( nStartNo, nEndNo, nTab, true );
 
 //  Manual-Flag already (re)set in SetOptimalHeight in 
case of bAll=sal_True
 //  (set for Extra-Height, else reset).
@@ -2268,7 +2266,8 @@ void ScViewFunc::SetWidthOrHeight(
 {
 for (SCCOL nCol=static_cast(nStartNo); 
nCol<=static_cast(nEndNo); nCol++)
 {
-if ( eMode != SC_SIZE_VISOPT || !rDoc.ColHidden(nCol, 
nTab) )
+const bool bIsColHidden = rDoc.ColHidden(nCol, nTab);
+if ( eMode != SC_SIZE_VISOPT || !bIsColHidden )
 {
 sal_uInt16 nThisSize = nSizeTwips;
 
@@ -2277,7 +2276,11 @@ void ScViewFunc::SetWidthOrHeight(
 if ( nThisSize )
 rDoc.SetColWidth( nCol, nTab, nThisSize );
 
-rDoc.ShowCol( nCol, nTab, bShow );
+// tdf#131073 - Don't show hidden cols after setting 
optimal col width
+if (eMode == SC_SIZE_OPTIMAL)
+rDoc.ShowCol(nCol, nTab, !bIsColHidden);
+else
+rDoc.ShowCol( 

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

2022-09-07 Thread Andreas Heinisch (via logerrit)
 sc/inc/compiler.hxx  |2 -
 sc/inc/funcdesc.hxx  |3 ++
 sc/inc/global.hxx|   15 
 sc/source/core/data/funcdesc.cxx |3 +-
 sc/source/core/data/global.cxx   |   37 ++
 sc/source/core/tool/compiler.cxx |8 --
 sc/source/ui/app/inputhdl.cxx|   47 +++
 sc/source/ui/inc/inputhdl.hxx|7 ++---
 8 files changed, 86 insertions(+), 36 deletions(-)

New commits:
commit bbd08d1dcdbb2dd8c30f590b2a8b785b64d01564
Author: Andreas Heinisch 
AuthorDate: Mon Aug 22 19:04:40 2022 +0200
Commit: Xisco Fauli 
CommitDate: Wed Sep 7 08:22:23 2022 +0200

tdf#142031 - Collect all the characters for the formula suggestion auto 
input

This is a combination of 5 commits.

tdf#142031 - Collect all the characters for the formula suggestion auto 
input

Change-Id: Idec350b09279f42f2ca42a1c02082d8e9e4207b8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138702
Tested-by: Jenkins
Reviewed-by: Eike Rathke 
Signed-off-by: Xisco Fauli 

Do not gather function data over and over again for each formula input

The function list changes only if switched to/from English
function names or if reset for AddIn config and only then needs to
be rebuilt. In all other cases simply reuse a once obtained data
set and only append the dynamic document content.

Change-Id: I5b1d14205e2933010a1b4382c985594d75802742
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138890
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
Signed-off-by: Xisco Fauli 

Move input handler function names to ScGlobal static

... as there is only one function list and
InputHandlerFunctionNames can be shared instead of each
ScInputHandler holding their own copy.

Change-Id: Id82b2020f8846456ce7464daa83feb6915792aa2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139012
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
Signed-off-by: Xisco Fauli 

Use ScFunctionList::IsEnglishFunctionNames()

Change-Id: I21a7bf18c2117187b2e8c770b9367f46323b2c2d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139054
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
Signed-off-by: Xisco Fauli 

Make static ScCompiler::GetCharClassLocalized() public as well

... and mutex guard it.

Change-Id: Ief9c6deaf7974ac43c7ae439a0fb73c29eced283
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138733
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139443

diff --git a/sc/inc/compiler.hxx b/sc/inc/compiler.hxx
index cb60e1f96acb..b7896c26c0e3 100644
--- a/sc/inc/compiler.hxx
+++ b/sc/inc/compiler.hxx
@@ -378,8 +378,8 @@ private:
 
 bool HasPossibleNamedRangeConflict(SCTAB nTab) const;
 
-static const CharClass* GetCharClassLocalized();
 public:
+static const CharClass* GetCharClassLocalized();
 static const CharClass* GetCharClassEnglish();
 
 public:
diff --git a/sc/inc/funcdesc.hxx b/sc/inc/funcdesc.hxx
index 0f37e924d941..01829417e485 100644
--- a/sc/inc/funcdesc.hxx
+++ b/sc/inc/funcdesc.hxx
@@ -253,9 +253,12 @@ public:
 
 const ScFuncDesc* GetFunction( sal_uInt32 nIndex ) const;
 
+bool IsEnglishFunctionNames() const { return mbEnglishFunctionNames; }
+
 private:
 ::std::vector aFunctionList; /**< List of functions */
 ::std::vector::iterator aFunctionListIter; /**< 
position in function list */
+bool mbEnglishFunctionNames;
 };
 
 /**
diff --git a/sc/inc/global.hxx b/sc/inc/global.hxx
index 47b93c845296..6c43f0328da6 100644
--- a/sc/inc/global.hxx
+++ b/sc/inc/global.hxx
@@ -20,6 +20,7 @@
 #pragma once
 
 #include "address.hxx"
+#include "typedstrdata.hxx"
 #include 
 #include 
 #include 
@@ -455,6 +456,17 @@ struct ScImportParam
 booloperator==  ( const ScImportParam& r ) const;
 };
 
+// Formula data replacement character for a pair of parentheses at end of
+// function name, to force sorting parentheses before all other characters.
+// Collation may treat parentheses differently.
+constexpr sal_Unicode cParenthesesReplacement = 0x0001;
+struct InputHandlerFunctionNames
+{
+ScTypedCaseStrSet   maFunctionData;
+ScTypedCaseStrSet   maFunctionDataPara;
+std::set   maFunctionChar;
+};
+
 class ScDocShell;
 class SvxSearchItem;
 class ScAutoFormat;
@@ -523,6 +535,8 @@ class ScGlobal
 
 static std::atomic pSharedStringPoolPurge;
 
+static InputHandlerFunctionNames maInputHandlerFunctionNames;
+
 static void InitPPT();
 
 public:
@@ -595,6 +609,7 @@ public:
 static ScFunctionList*  GetStarCalcFunctionList();
 static ScFunctionMgr*   GetStarCalcFunctionMgr();
 static void ResetFunctionList();
+static const InputHandlerFunctionNames& 

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

2022-09-06 Thread Andreas Heinisch (via logerrit)
 sc/qa/extras/testdocuments/tdf118247.xlsm |binary
 sc/qa/extras/vba-macro-test.cxx   |   47 ++
 sc/source/ui/vba/vbarange.cxx |   23 ++
 3 files changed, 69 insertions(+), 1 deletion(-)

New commits:
commit f972f27b455ef78f0d5db5eea96edd707909a154
Author: Andreas Heinisch 
AuthorDate: Thu Sep 1 21:55:05 2022 +0200
Commit: Andreas Heinisch 
CommitDate: Tue Sep 6 11:31:42 2022 +0200

tdf#118247 - Correctly handle xlCellTypeConstants parameter

Change-Id: I5cc281d6193bcf03d2da3c594d427ec340c2cfc1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139239
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 

diff --git a/sc/qa/extras/testdocuments/tdf118247.xlsm 
b/sc/qa/extras/testdocuments/tdf118247.xlsm
new file mode 100755
index ..73de66a0d423
Binary files /dev/null and b/sc/qa/extras/testdocuments/tdf118247.xlsm differ
diff --git a/sc/qa/extras/vba-macro-test.cxx b/sc/qa/extras/vba-macro-test.cxx
index 71c3b9033da1..24f8ddb996c6 100644
--- a/sc/qa/extras/vba-macro-test.cxx
+++ b/sc/qa/extras/vba-macro-test.cxx
@@ -29,7 +29,10 @@
 #include 
 #include 
 
+#include 
+
 using namespace css;
+using namespace ooo::vba;
 
 class VBAMacroTest : public UnoApiTest
 {
@@ -71,6 +74,7 @@ public:
 void testTdf107902();
 void testTdf90278();
 void testTdf149531();
+void testTdf118247();
 
 CPPUNIT_TEST_SUITE(VBAMacroTest);
 CPPUNIT_TEST(testSimpleCopyAndPaste);
@@ -92,6 +96,7 @@ public:
 CPPUNIT_TEST(testTdf107902);
 CPPUNIT_TEST(testTdf90278);
 CPPUNIT_TEST(testTdf149531);
+CPPUNIT_TEST(testTdf118247);
 CPPUNIT_TEST_SUITE_END();
 };
 
@@ -928,6 +933,48 @@ void VBAMacroTest::testTdf149531()
 
 pDocSh->DoClose();
 }
+
+void VBAMacroTest::testTdf118247()
+{
+OUString aFileName;
+createFileURL(u"tdf118247.xlsm", aFileName);
+auto xComponent = loadFromDesktop(aFileName, 
"com.sun.star.sheet.SpreadsheetDocument");
+
+uno::Any aRet;
+uno::Sequence aOutParamIndex;
+uno::Sequence aOutParam;
+uno::Sequence aParams;
+
+SfxObjectShell::CallXScript(
+xComponent,
+
"vnd.sun.Star.script:VBAProject.Module1.testXlSpecialCellsValuesConstantsEmpty?"
+"language=Basic=document",
+aParams, aRet, aOutParamIndex, aOutParam);
+
+OUString aReturnValue;
+aRet >>= aReturnValue;
+CPPUNIT_ASSERT_EQUAL(OUString("$A$1:$A$3"), aReturnValue);
+
+const std::vector> aTestParams(
+{ { excel::XlSpecialCellsValue::xlNumbers, "$A$1:$A$2" },
+  { excel::XlSpecialCellsValue::xlTextValues, "$A$3" },
+  { excel::XlSpecialCellsValue::xlLogical, "$A$1:$A$2" },
+  { excel::XlSpecialCellsValue::xlErrors, "$A$1:$A$4" } });
+
+for (auto & [ nXlSpecialCellsValue, sRange ] : aTestParams)
+{
+aParams = { uno::Any(nXlSpecialCellsValue) };
+SfxObjectShell::CallXScript(
+xComponent,
+
"vnd.sun.Star.script:VBAProject.Module1.testXlSpecialCellsValuesConstants?"
+"language=Basic=document",
+aParams, aRet, aOutParamIndex, aOutParam);
+aRet >>= aReturnValue;
+CPPUNIT_ASSERT_EQUAL(sRange, aReturnValue);
+}
+css::uno::Reference xCloseable(xComponent, 
css::uno::UNO_QUERY_THROW);
+xCloseable->close(true);
+}
 CPPUNIT_TEST_SUITE_REGISTRATION(VBAMacroTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx
index 279a4a53b930..d2bd37db518d 100644
--- a/sc/source/ui/vba/vbarange.cxx
+++ b/sc/source/ui/vba/vbarange.cxx
@@ -5536,6 +5536,27 @@ ScVbaRange::SpecialCells( const uno::Any& _oType, const 
uno::Any& _oValue)
 return pRangeToUse->SpecialCellsImpl( nType, _oValue );
 }
 
+static sal_Int32 getContentResultFlags(const uno::Any& aValue)
+{
+if (sal_Int32 aType; aValue >>= aType)
+{
+switch (aType)
+{
+case excel::XlSpecialCellsValue::xlNumbers:
+return sheet::CellFlags::VALUE | sheet::CellFlags::DATETIME;
+case excel::XlSpecialCellsValue::xlTextValues:
+return sheet::CellFlags::STRING;
+case excel::XlSpecialCellsValue::xlLogical:
+return sheet::CellFlags::VALUE | sheet::CellFlags::DATETIME;
+case excel::XlSpecialCellsValue::xlErrors:
+return 0;
+default:
+DebugHelper::basicexception(ERRCODE_BASIC_BAD_PARAMETER, {});
+}
+}
+return sheet::CellFlags::VALUE | sheet::CellFlags::STRING | 
sheet::CellFlags::DATETIME;
+}
+
 /// @throws script::BasicErrorException
 static sal_Int32 lcl_getFormulaResultFlags(const uno::Any& aType)
 {
@@ -5589,7 +5610,7 @@ ScVbaRange::SpecialCellsImpl( sal_Int32 nType, const 
uno::Any& _oValue)
 xLocSheetCellRanges = 
xQuery->queryContentCells(sheet::CellFlags::ANNOTATION);
 break;
 case 

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

2022-08-27 Thread Andreas Heinisch (via logerrit)
 sw/source/core/doc/doctxm.cxx |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 716f3e73fcedc4c4c107527a49aaec604a7e2c63
Author: Andreas Heinisch 
AuthorDate: Thu Aug 25 21:53:06 2022 +0200
Commit: Ilmari Lauhakangas 
CommitDate: Sat Aug 27 15:13:21 2022 +0200

tdf#150594 - Prevent crash while searching for the next outline node

Change-Id: Ia83968b26f0053815c0da9910aa00f9dde577246
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138850
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 
(cherry picked from commit 33c6dcfaab35a70f8794a67d31fbec636cb485d5)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138897
Reviewed-by: Julien Nabet 
Tested-by: Ilmari Lauhakangas 
Reviewed-by: Ilmari Lauhakangas 

diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx
index 83310172e852..9665c3915714 100644
--- a/sw/source/core/doc/doctxm.cxx
+++ b/sw/source/core/doc/doctxm.cxx
@@ -804,8 +804,9 @@ static bool IsHeadingContained(const SwTextNode* pChptrNd, 
const SwNode& rNd)
 else
 {
 // Search for the next outline node which lies not within the 
current chapter node
-while (pChptrNd->GetAttrOutlineLevel()
-   < rONds[nPos]->GetTextNode()->GetAttrOutlineLevel())
+while (nPos > 0
+   && pChptrNd->GetAttrOutlineLevel()
+  < rONds[nPos]->GetTextNode()->GetAttrOutlineLevel())
 nPos--;
 bIsHeadingContained = pChptrNd == rONds[nPos]->GetTextNode();
 }


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

2022-08-27 Thread Andreas Heinisch (via logerrit)
 sw/source/core/doc/doctxm.cxx |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 5f03dc914d67725b4d8e949d4e2198c4e9b537ec
Author: Andreas Heinisch 
AuthorDate: Thu Aug 25 21:53:06 2022 +0200
Commit: Ilmari Lauhakangas 
CommitDate: Sat Aug 27 14:24:23 2022 +0200

tdf#150594 - Prevent crash while searching for the next outline node

Change-Id: Ia83968b26f0053815c0da9910aa00f9dde577246
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138850
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 
(cherry picked from commit 33c6dcfaab35a70f8794a67d31fbec636cb485d5)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138898
Reviewed-by: Ilmari Lauhakangas 

diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx
index 83310172e852..9665c3915714 100644
--- a/sw/source/core/doc/doctxm.cxx
+++ b/sw/source/core/doc/doctxm.cxx
@@ -804,8 +804,9 @@ static bool IsHeadingContained(const SwTextNode* pChptrNd, 
const SwNode& rNd)
 else
 {
 // Search for the next outline node which lies not within the 
current chapter node
-while (pChptrNd->GetAttrOutlineLevel()
-   < rONds[nPos]->GetTextNode()->GetAttrOutlineLevel())
+while (nPos > 0
+   && pChptrNd->GetAttrOutlineLevel()
+  < rONds[nPos]->GetTextNode()->GetAttrOutlineLevel())
 nPos--;
 bIsHeadingContained = pChptrNd == rONds[nPos]->GetTextNode();
 }


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

2022-08-26 Thread Andreas Heinisch (via logerrit)
 sc/source/ui/app/inputhdl.cxx |   34 +++---
 1 file changed, 23 insertions(+), 11 deletions(-)

New commits:
commit e1a32c881a7230481ecc8659d587e3621213e10f
Author: Andreas Heinisch 
AuthorDate: Mon Aug 22 19:04:40 2022 +0200
Commit: Eike Rathke 
CommitDate: Fri Aug 26 21:39:35 2022 +0200

tdf#142031 - Collect all the characters for the formula suggestion auto 
input

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

diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index f16e52af8fb6..de0a49e692bb 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -68,6 +68,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1019,6 +1020,10 @@ void ScInputHandler::GetFormulaData()
 else
 pFormulaDataPara.reset( new ScTypedCaseStrSet );
 
+const CharClass* pCharClass = 
(SC_MOD()->GetFormulaOptions().GetUseEnglishFuncName()
+   ? ScCompiler::GetCharClassEnglish()
+   : ScCompiler::GetCharClassLocalized());
+
 const OUString aParenthesesReplacement( cParenthesesReplacement);
 const ScFunctionList* pFuncList = ScGlobal::GetStarCalcFunctionList();
 sal_uInt32 nListCount = pFuncList->GetCount();
@@ -1027,16 +1032,12 @@ void ScInputHandler::GetFormulaData()
 const ScFuncDesc* pDesc = pFuncList->GetFunction( i );
 if ( pDesc->mxFuncName )
 {
-const sal_Unicode* pName = pDesc->mxFuncName->getStr();
-const sal_Int32 nLen = pDesc->mxFuncName->getLength();
+OUString aFuncName(pCharClass->uppercase(*(pDesc->mxFuncName)));
 // fdo#75264 fill maFormulaChar with all characters used in 
formula names
-for ( sal_Int32 j = 0; j < nLen; j++ )
-{
-sal_Unicode c = pName[ j ];
-maFormulaChar.insert( c );
-}
-OUString aFuncName = *pDesc->mxFuncName + aParenthesesReplacement;
-pFormulaData->insert(ScTypedStrData(aFuncName, 0.0, 0.0, 
ScTypedStrData::Standard));
+for (sal_Int32 j = 0; j < aFuncName.getLength(); j++)
+maFormulaChar.insert(aFuncName[j]);
+pFormulaData->insert(ScTypedStrData(*(pDesc->mxFuncName) + 
aParenthesesReplacement, 0.0, 0.0,
+ScTypedStrData::Standard));
 pDesc->initArgumentInfo();
 OUString aEntry = pDesc->getSignature();
 pFormulaDataPara->insert(ScTypedStrData(aEntry, 0.0, 0.0, 
ScTypedStrData::Standard));
@@ -1066,8 +1067,19 @@ void ScInputHandler::GetFormulaData()
 }
 }
 miAutoPosFormula = pFormulaData->end();
-rDoc.GetFormulaEntries( *pFormulaData );
-rDoc.GetFormulaEntries( *pFormulaDataPara );
+
+// tdf#142031 - collect all the characters for the formula suggestion auto 
input
+ScTypedCaseStrSet aStrSet;
+rDoc.GetFormulaEntries( aStrSet );
+for (auto iter = aStrSet.begin(); iter != aStrSet.end(); ++iter)
+{
+const OUString aFuncName = 
ScGlobal::getCharClass().uppercase((*iter).GetString());
+// fdo#75264 fill maFormulaChar with all characters used in formula 
names
+for (sal_Int32 j = 0; j < aFuncName.getLength(); j++)
+maFormulaChar.insert(aFuncName[j]);
+}
+pFormulaData->insert(aStrSet.begin(), aStrSet.end());
+pFormulaDataPara->insert(aStrSet.begin(), aStrSet.end());
 }
 
 IMPL_LINK( ScInputHandler, ShowHideTipVisibleParentListener, VclWindowEvent&, 
rEvent, void )


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

2022-08-25 Thread Andreas Heinisch (via logerrit)
 sw/source/core/doc/doctxm.cxx |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 33c6dcfaab35a70f8794a67d31fbec636cb485d5
Author: Andreas Heinisch 
AuthorDate: Thu Aug 25 21:53:06 2022 +0200
Commit: Andreas Heinisch 
CommitDate: Thu Aug 25 23:01:08 2022 +0200

tdf#150594 - Prevent crash while searching for the next outline node

Change-Id: Ia83968b26f0053815c0da9910aa00f9dde577246
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138850
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 

diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx
index bdea1e4dec1d..ee418e5f1d4e 100644
--- a/sw/source/core/doc/doctxm.cxx
+++ b/sw/source/core/doc/doctxm.cxx
@@ -804,8 +804,9 @@ static bool IsHeadingContained(const SwTextNode* pChptrNd, 
const SwNode& rNd)
 else
 {
 // Search for the next outline node which lies not within the 
current chapter node
-while (pChptrNd->GetAttrOutlineLevel()
-   < rONds[nPos]->GetTextNode()->GetAttrOutlineLevel())
+while (nPos > 0
+   && pChptrNd->GetAttrOutlineLevel()
+  < rONds[nPos]->GetTextNode()->GetAttrOutlineLevel())
 nPos--;
 bIsHeadingContained = pChptrNd == rONds[nPos]->GetTextNode();
 }


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

2022-08-23 Thread Andreas Heinisch (via logerrit)
 sw/source/core/text/inftxt.cxx |1 +
 sw/source/core/text/porfld.cxx |1 +
 2 files changed, 2 insertions(+)

New commits:
commit 01e3c998e63fbf456e7f624adb1cae3d89ed7bb2
Author: Andreas Heinisch 
AuthorDate: Mon Aug 22 23:02:48 2022 +0200
Commit: Andreas Heinisch 
CommitDate: Tue Aug 23 09:34:07 2022 +0200

tdf#67669 - Make narrow no-break space visible by drawing a gray background

Change-Id: I7a80fe6ceab6b3693241db4fda77ce6712624321
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138710
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 

diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index c3a5068b3cf9..61a53c0aab76 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -1674,6 +1674,7 @@ TextFrameIndex 
SwTextFormatInfo::ScanPortionEnd(TextFrameIndex const nStart,
 
 case CHAR_SOFTHYPHEN:
 case CHAR_HARDHYPHEN:
+case CHAR_NNBSP:
 case CHAR_HARDBLANK:
 case CH_TAB:
 case CH_BREAK:
diff --git a/sw/source/core/text/porfld.cxx b/sw/source/core/text/porfld.cxx
index fe9127c58839..5ff64ae48845 100644
--- a/sw/source/core/text/porfld.cxx
+++ b/sw/source/core/text/porfld.cxx
@@ -398,6 +398,7 @@ bool SwFieldPortion::Format( SwTextFormatInfo  )
 case CH_TAB:
 case CHAR_HARDHYPHEN:   // non-breaking hyphen
 case CHAR_SOFTHYPHEN:
+case CHAR_NNBSP:
 case CHAR_HARDBLANK:
 case CHAR_ZWSP :
 case CHAR_WJ :


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

2022-08-22 Thread Andreas Heinisch (via logerrit)
 basic/inc/sbxbase.hxx|1 +
 basic/source/classes/sb.cxx  |4 ++--
 basic/source/sbx/sbxbase.cxx |   17 +
 basic/source/sbx/sbxexec.cxx |2 +-
 basic/source/sbx/sbxobj.cxx  |2 +-
 include/basic/sbxcore.hxx|2 ++
 6 files changed, 24 insertions(+), 4 deletions(-)

New commits:
commit 7e2a8a9869e362ae181ad92f50ea287e9abf85bb
Author: Andreas Heinisch 
AuthorDate: Tue Aug 9 18:42:40 2022 +0200
Commit: Andreas Heinisch 
CommitDate: Mon Aug 22 19:03:42 2022 +0200

tdf#150139 - Add a concrete name to the error message

Add a concrete name to the "Property or method not found: $(ARG1)" error 
message when creating a listener.

Change-Id: I76c904793a96082c49f8aa2d45c76c50a453d892
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138061
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 

diff --git a/basic/inc/sbxbase.hxx b/basic/inc/sbxbase.hxx
index 80552c2fbf08..e06d76161dec 100644
--- a/basic/inc/sbxbase.hxx
+++ b/basic/inc/sbxbase.hxx
@@ -36,6 +36,7 @@ class SbxBasicFormater;
 struct SbxAppData
 {
 ErrCode eErrCode; // Error code
+OUString aErrorMsg; // Error message for $ARG
 SbxVariableRef m_aGlobErr; // Global error object
 std::vector m_Factories; // these are owned by fields in 
SbiGlobals
 tools::SvRef mrImplRepository;
diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx
index 8d87330e469b..f1ab6dd1da0c 100644
--- a/basic/source/classes/sb.cxx
+++ b/basic/source/classes/sb.cxx
@@ -1325,11 +1325,11 @@ bool StarBASIC::Call( const OUString& rName, SbxArray* 
pParam )
 if( !bRes )
 {
 ErrCode eErr = SbxBase::GetError();
-SbxBase::ResetError();
 if( eErr != ERRCODE_NONE )
 {
-RTError( eErr, OUString(), 0, 0, 0 );
+RTError(eErr, SbxBase::GetErrorMsg(), 0, 0, 0);
 }
+SbxBase::ResetError();
 }
 return bRes;
 }
diff --git a/basic/source/sbx/sbxbase.cxx b/basic/source/sbx/sbxbase.cxx
index 3b70307ec3e7..9d2129e68a1e 100644
--- a/basic/source/sbx/sbxbase.cxx
+++ b/basic/source/sbx/sbxbase.cxx
@@ -37,6 +37,7 @@
 
 SbxAppData::SbxAppData()
 : eErrCode(ERRCODE_NONE)
+, aErrorMsg(OUString())
 , eBasicFormaterLangType(LANGUAGE_DONTKNOW)
 {
 }
@@ -96,6 +97,21 @@ ErrCode const & SbxBase::GetError()
 return GetSbxData_Impl().eErrCode;
 }
 
+OUString const & SbxBase::GetErrorMsg()
+{
+return GetSbxData_Impl().aErrorMsg;
+}
+
+void SbxBase::SetError(ErrCode e, const OUString& rMsg)
+{
+SbxAppData& r = GetSbxData_Impl();
+if (e && r.eErrCode == ERRCODE_NONE)
+{
+r.eErrCode = e;
+r.aErrorMsg = rMsg;
+}
+}
+
 void SbxBase::SetError( ErrCode e )
 {
 SbxAppData& r = GetSbxData_Impl();
@@ -111,6 +127,7 @@ bool SbxBase::IsError()
 void SbxBase::ResetError()
 {
 GetSbxData_Impl().eErrCode = ERRCODE_NONE;
+GetSbxData_Impl().aErrorMsg = OUString();
 }
 
 void SbxBase::AddFactory( SbxFactory* pFac )
diff --git a/basic/source/sbx/sbxexec.cxx b/basic/source/sbx/sbxexec.cxx
index d830061f071d..f3abca766d35 100644
--- a/basic/source/sbx/sbxexec.cxx
+++ b/basic/source/sbx/sbxexec.cxx
@@ -323,7 +323,7 @@ static SbxVariableRef Element
 }
 }
 else
-SbxBase::SetError( ERRCODE_BASIC_NO_METHOD );
+SbxBase::SetError( ERRCODE_BASIC_NO_METHOD, aSym );
 }
 *ppBuf = p;
 return refVar;
diff --git a/basic/source/sbx/sbxobj.cxx b/basic/source/sbx/sbxobj.cxx
index f83324a26bb8..4dd054959823 100644
--- a/basic/source/sbx/sbxobj.cxx
+++ b/basic/source/sbx/sbxobj.cxx
@@ -275,7 +275,7 @@ bool SbxObject::Call( const OUString& rName, SbxArray* 
pParam )
 pMeth->SetParameters( nullptr );
 return true;
 }
-SetError( ERRCODE_BASIC_NO_METHOD );
+SetError( ERRCODE_BASIC_NO_METHOD, rName );
 return false;
 }
 
diff --git a/include/basic/sbxcore.hxx b/include/basic/sbxcore.hxx
index e5f726e8d016..477858d9656c 100644
--- a/include/basic/sbxcore.hxx
+++ b/include/basic/sbxcore.hxx
@@ -85,7 +85,9 @@ public:
 virtual boolLoadCompleted();
 
 static ErrCode const & GetError();
+static OUString const& GetErrorMsg();
 static void SetError( ErrCode );
+static void SetError(ErrCode, const OUString&);
 static bool IsError();
 static void ResetError();
 


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

2022-08-21 Thread Andreas Heinisch (via logerrit)
 sc/qa/uitest/inputLine/tdf131326.py |   26 ++
 sc/source/ui/view/viewfun2.cxx  |2 ++
 2 files changed, 28 insertions(+)

New commits:
commit 82b27fabfe20e504233bdb0bac860266270bd6f6
Author: Andreas Heinisch 
AuthorDate: Tue Aug 9 20:05:43 2022 +0200
Commit: Andreas Heinisch 
CommitDate: Sun Aug 21 14:58:41 2022 +0200

tdf#131326 - Invalidate cell slots and update input line with new content

Change-Id: I4881b73bb230380388ed366818d7e0808aec11e9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138065
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 

diff --git a/sc/qa/uitest/inputLine/tdf131326.py 
b/sc/qa/uitest/inputLine/tdf131326.py
new file mode 100755
index ..6fbfe25f02bd
--- /dev/null
+++ b/sc/qa/uitest/inputLine/tdf131326.py
@@ -0,0 +1,26 @@
+# -*- 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.calc import enter_text_to_cell
+from uitest.uihelper.common import get_state_as_dict
+
+# Bug 131326 - Formula to Value does not automatically change text in input 
line
+class tdf131326(UITestCase):
+
+def test_tdf131326_formula_to_value_input_line(self):
+with self.ui_test.create_doc_in_start_center("calc"):
+xCalcDoc = self.xUITest.getTopFocusWindow()
+gridwin = xCalcDoc.getChild("grid_window")
+xInputWin = xCalcDoc.getChild("sc_input_window")
+
+enter_text_to_cell(gridwin, "A1", "=1")
+self.xUITest.executeCommand(".uno:ConvertFormulaToValue")
+self.assertEqual(get_state_as_dict(xInputWin)["Text"], "1")
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx
index 30f3d3fe083f..c8ed4cc9e485 100644
--- a/sc/source/ui/view/viewfun2.cxx
+++ b/sc/source/ui/view/viewfun2.cxx
@@ -1874,6 +1874,8 @@ void ScViewFunc::ConvertFormulaToValue()
 
 ScDocShell* pDocSh = GetViewData().GetDocShell();
 pDocSh->GetDocFunc().ConvertFormulaToValue(aRange, true);
+// tdf#131326 - invalidate cell slots and update input line with new 
content
+CellContentChanged();
 pDocSh->PostPaint(aRange, PaintPartFlags::Grid);
 }
 


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

2022-08-21 Thread Andreas Heinisch (via logerrit)
 i18npool/source/breakiterator/breakiteratorImpl.cxx |4 +--
 i18npool/source/breakiterator/breakiterator_unicode.cxx |   15 +++-
 sw/qa/core/crsr/crsr.cxx|   19 
 3 files changed, 30 insertions(+), 8 deletions(-)

New commits:
commit 70c99eef1643a17b2c1f0dba38b55a58cdb9aafc
Author: Andreas Heinisch 
AuthorDate: Fri Jul 29 09:29:33 2022 +0200
Commit: Andreas Heinisch 
CommitDate: Sun Aug 21 14:12:43 2022 +0200

tdf#135451 - Change the skipSpace implementation of the break iterator

Change the ICU whitespace function of the break iterator from 
u_isWhitespace to u_isUWhiteSpace to include no-break spaces.

u_isWhitespace includes Java isWhitespace; Z + whitespace ISO controls but 
excludes no-break spaces
u_isUWhiteSpace includes all code points with the Unicode White_Space 
property; most of general categories "Z" (separators) + most whitespace ISO 
controls (including no-break spaces, but excluding IS1..IS4)

See https://unicode-org.github.io/icu-docs/apidoc/dev/icu4c/uchar_8h.html 
for further details.

Change-Id: I21fddefaf2149096824908f644310a59d6e2f38d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137582
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 

diff --git a/i18npool/source/breakiterator/breakiteratorImpl.cxx 
b/i18npool/source/breakiterator/breakiteratorImpl.cxx
index 71f371a7eddc..71d794e2c9d4 100644
--- a/i18npool/source/breakiterator/breakiteratorImpl.cxx
+++ b/i18npool/source/breakiterator/breakiteratorImpl.cxx
@@ -82,7 +82,7 @@ static sal_Int32 skipSpace(const OUString& Text, sal_Int32 
nPos, sal_Int32 len,
 while (nPos < len)
 {
 ch = Text.iterateCodePoints();
-if (!u_isWhitespace(ch) && !isZWSP(ch))
+if (!u_isUWhiteSpace(ch) && !isZWSP(ch))
 break;
 nPos = pos;
 }
@@ -90,7 +90,7 @@ static sal_Int32 skipSpace(const OUString& Text, sal_Int32 
nPos, sal_Int32 len,
 while (nPos > 0)
 {
 ch = Text.iterateCodePoints(, -1);
-if (!u_isWhitespace(ch) && !isZWSP(ch))
+if (!u_isUWhiteSpace(ch) && !isZWSP(ch))
 break;
 nPos = pos;
 }
diff --git a/i18npool/source/breakiterator/breakiterator_unicode.cxx 
b/i18npool/source/breakiterator/breakiterator_unicode.cxx
index a4a00c46a1ad..cfac4ddea89d 100644
--- a/i18npool/source/breakiterator/breakiterator_unicode.cxx
+++ b/i18npool/source/breakiterator/breakiterator_unicode.cxx
@@ -379,9 +379,10 @@ Boundary SAL_CALL BreakIterator_Unicode::nextWord( const 
OUString& Text, sal_Int
 if( rv.startPos >= Text.getLength() || rv.startPos == 
icu::BreakIterator::DONE )
 rv.endPos = result.startPos;
 else {
-if ( (rWordType == WordType::ANYWORD_IGNOREWHITESPACES ||
-rWordType == WordType::DICTIONARY_WORD ) &&
-u_isWhitespace(Text.iterateCodePoints(, 0)) )
+if ((rWordType == WordType::ANYWORD_IGNOREWHITESPACES
+ && u_isUWhiteSpace(Text.iterateCodePoints(, 0)))
+|| (rWordType == WordType::DICTIONARY_WORD
+&& u_isWhitespace(Text.iterateCodePoints(, 0
 rv.startPos = 
icuBI->mpValue->mpBreakIterator->following(rv.startPos);
 
 rv.endPos = icuBI->mpValue->mpBreakIterator->following(rv.startPos);
@@ -402,9 +403,11 @@ Boundary SAL_CALL 
BreakIterator_Unicode::previousWord(const OUString& Text, sal_
 if( rv.startPos < 0)
 rv.endPos = rv.startPos;
 else {
-if ( (rWordType == WordType::ANYWORD_IGNOREWHITESPACES ||
-rWordType == WordType::DICTIONARY_WORD) &&
-u_isWhitespace(Text.iterateCodePoints(, 0)) )
+
+if ((rWordType == WordType::ANYWORD_IGNOREWHITESPACES
+ && u_isUWhiteSpace(Text.iterateCodePoints(, 0)))
+|| (rWordType == WordType::DICTIONARY_WORD
+&& u_isWhitespace(Text.iterateCodePoints(, 0
 rv.startPos = 
icuBI->mpValue->mpBreakIterator->preceding(rv.startPos);
 
 rv.endPos = icuBI->mpValue->mpBreakIterator->following(rv.startPos);
diff --git a/sw/qa/core/crsr/crsr.cxx b/sw/qa/core/crsr/crsr.cxx
index c0713389bec3..759b236d16ac 100644
--- a/sw/qa/core/crsr/crsr.cxx
+++ b/sw/qa/core/crsr/crsr.cxx
@@ -164,6 +164,25 @@ CPPUNIT_TEST_FIXTURE(SwCoreCrsrTest, 
testContentControlReadOnly)
 CPPUNIT_ASSERT(pWrtShell->HasReadonlySel());
 }
 
+CPPUNIT_TEST_FIXTURE(SwCoreCrsrTest, testTdf135451)
+{
+SwDoc* pDoc = createSwDoc();
+SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+
+// Insert narrow no-break space and move the cursor right before it
+pWrtShell->Insert(u"a" + OUStringChar(CHAR_NNBSP) + "b");
+pWrtShell->EndPara(/*bSelect=*/false);
+

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

2022-07-27 Thread Andreas Heinisch (via logerrit)
 sw/source/core/text/itrform2.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit fb63d0a090b049c16993054f1804e440adeba5d7
Author: Andreas Heinisch 
AuthorDate: Wed Jul 27 08:53:11 2022 +0200
Commit: Adolfo Jayme Barrientos 
CommitDate: Wed Jul 27 22:37:42 2022 +0200

tdf#67669 - Make narrow no-break space visible by drawing a gray background

Make narrow no-break space visible by drawing a gray background like for 
non-breaking spaces.

Change-Id: I3f2b4374a08ea8305c8c84eb497bc362866ad352
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137490
Tested-by: Andreas Heinisch 
Reviewed-by: Andreas Heinisch 
(cherry picked from commit bbb57e8198863ee7bdadd3f2aac4420c08da94a3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137432
Reviewed-by: Adolfo Jayme Barrientos 
Tested-by: Jenkins

diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx
index 563ddd5c4c02..e86c8079c8d2 100644
--- a/sw/source/core/text/itrform2.cxx
+++ b/sw/source/core/text/itrform2.cxx
@@ -1503,6 +1503,8 @@ SwLinePortion *SwTextFormatter::NewPortion( 
SwTextFormatInfo  )
 case CHAR_SOFTHYPHEN:   // soft hyphen
 pPor = new SwSoftHyphPortion; break;
 
+// tdf#67669 - make narrow no-break space visible by drawing a 
gray background
+case CHAR_NNBSP:// narrow no-break space
 case CHAR_HARDBLANK:// no-break space
 // Please check tdf#115067 if you want to edit the char
 pPor = new SwBlankPortion( cChar ); break;


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

2022-07-27 Thread Andreas Heinisch (via logerrit)
 editeng/source/editeng/impedit2.cxx   |5 -
 sc/qa/uitest/calc_tests9/tdf135761.py |   34 ++
 2 files changed, 38 insertions(+), 1 deletion(-)

New commits:
commit ad4e3f2b5ff5ab946a9de32fa8cf65ab664afa85
Author: Andreas Heinisch 
AuthorDate: Fri Jul 15 16:25:06 2022 +0200
Commit: Xisco Fauli 
CommitDate: Wed Jul 27 10:08:54 2022 +0200

tdf#135761 - Calc cell editing: change search preference for the word 
boundary

Since ImpEditEngine::StartOfWord is only used when a selection is deleted 
at the left, change the search preference of the word boundary from forward to 
backward. For further details of a deletion of a selection check 
ImpEditEngine::DeleteLeftOrRight.

Change-Id: Ic68901cc04e5057e058ff03304f68eef1dca7a1e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137108
Tested-by: Andreas Heinisch 
Reviewed-by: Andreas Heinisch 
(cherry picked from commit 9a612ce3d1d025d5f553cc348feaedeea37fc822)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137426
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 

diff --git a/editeng/source/editeng/impedit2.cxx 
b/editeng/source/editeng/impedit2.cxx
index c731932c51ec..8dbbc42f7ce7 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -1533,8 +1533,11 @@ EditPaM ImpEditEngine::StartOfWord( const EditPaM& rPaM )
 lang::Locale aLocale( GetLocale( aTmpPaM ) );
 
 uno::Reference < i18n::XBreakIterator > _xBI( ImplGetBreakIterator() );
+// tdf#135761 - since this function is only used when a selection is 
deleted at the left,
+// change the search preference of the word boundary from forward to 
backward.
+// For further details of a deletion of a selection check 
ImpEditEngine::DeleteLeftOrRight.
 i18n::Boundary aBoundary = _xBI->getWordBoundary(
-rPaM.GetNode()->GetString(), rPaM.GetIndex(), aLocale, 
css::i18n::WordType::ANYWORD_IGNOREWHITESPACES, true);
+rPaM.GetNode()->GetString(), rPaM.GetIndex(), aLocale, 
css::i18n::WordType::ANYWORD_IGNOREWHITESPACES, false);
 
 aNewPaM.SetIndex( aBoundary.startPos );
 return aNewPaM;
diff --git a/sc/qa/uitest/calc_tests9/tdf135761.py 
b/sc/qa/uitest/calc_tests9/tdf135761.py
new file mode 100755
index ..fd9e5ebda341
--- /dev/null
+++ b/sc/qa/uitest/calc_tests9/tdf135761.py
@@ -0,0 +1,34 @@
+# -*- 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
+
+class tdf135761(UITestCase):
+def test_tdf135761_ctrl_backspace(self):
+with self.ui_test.create_doc_in_start_center("calc") as document:
+xCalcDoc = self.xUITest.getTopFocusWindow()
+xGridWindow = xCalcDoc.getChild("grid_window")
+
+# Enter text including two whitespaces in the text, and delete the 
left part of the text
+xGridWindow.executeAction("SELECT", mkPropertyValues({"CELL": 
"A1"}))
+xGridWindow.executeAction("TYPE", mkPropertyValues({"TEXT": "a  
b"}))
+xGridWindow.executeAction("TYPE", 
mkPropertyValues({"KEYCODE":"F2"}))
+xGridWindow.executeAction("TYPE", 
mkPropertyValues({"KEYCODE":"LEFT"}))
+xGridWindow.executeAction("TYPE", 
mkPropertyValues({"KEYCODE":"LEFT"}))
+xGridWindow.executeAction("TYPE", 
mkPropertyValues({"KEYCODE":"CTRL+BACKSPACE"}))
+xGridWindow.executeAction("TYPE", 
mkPropertyValues({"KEYCODE":"RETURN"}))
+
+# Without the fix in place, this test would have failed with
+# AssertionError: ' b' != 'a b'
+
+self.assertEqual(get_cell_by_position(document, 0, 0, 
0).getString(), " b")
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:


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

2022-07-27 Thread Andreas Heinisch (via logerrit)
 sw/source/core/text/itrform2.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit bbb57e8198863ee7bdadd3f2aac4420c08da94a3
Author: Andreas Heinisch 
AuthorDate: Wed Jul 27 08:53:11 2022 +0200
Commit: Andreas Heinisch 
CommitDate: Wed Jul 27 09:53:56 2022 +0200

tdf#67669 - Make narrow no-break space visible by drawing a gray background

Make narrow no-break space visible by drawing a gray background like for 
non-breaking spaces.

Change-Id: I3f2b4374a08ea8305c8c84eb497bc362866ad352
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137490
Tested-by: Andreas Heinisch 
Reviewed-by: Andreas Heinisch 

diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx
index 563ddd5c4c02..e86c8079c8d2 100644
--- a/sw/source/core/text/itrform2.cxx
+++ b/sw/source/core/text/itrform2.cxx
@@ -1503,6 +1503,8 @@ SwLinePortion *SwTextFormatter::NewPortion( 
SwTextFormatInfo  )
 case CHAR_SOFTHYPHEN:   // soft hyphen
 pPor = new SwSoftHyphPortion; break;
 
+// tdf#67669 - make narrow no-break space visible by drawing a 
gray background
+case CHAR_NNBSP:// narrow no-break space
 case CHAR_HARDBLANK:// no-break space
 // Please check tdf#115067 if you want to edit the char
 pPor = new SwBlankPortion( cChar ); break;


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

2022-07-23 Thread Andreas Heinisch (via logerrit)
 sc/qa/uitest/calc_tests9/tdf135761.py |1 -
 1 file changed, 1 deletion(-)

New commits:
commit 1203fc97d9f036b24e1130575aa609bfe34601e1
Author: Andreas Heinisch 
AuthorDate: Sat Jul 23 12:44:29 2022 +0200
Commit: Andreas Heinisch 
CommitDate: Sat Jul 23 12:45:39 2022 +0200

Delete unnecessary new line

Change-Id: I3e826c02895adda7dfa18c786dce0d94b08636d3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137332
Tested-by: Andreas Heinisch 
Reviewed-by: Andreas Heinisch 

diff --git a/sc/qa/uitest/calc_tests9/tdf135761.py 
b/sc/qa/uitest/calc_tests9/tdf135761.py
index fd9e5ebda341..5de390b3e46d 100755
--- a/sc/qa/uitest/calc_tests9/tdf135761.py
+++ b/sc/qa/uitest/calc_tests9/tdf135761.py
@@ -28,7 +28,6 @@ class tdf135761(UITestCase):
 
 # Without the fix in place, this test would have failed with
 # AssertionError: ' b' != 'a b'
-
 self.assertEqual(get_cell_by_position(document, 0, 0, 
0).getString(), " b")
 
 # vim: set shiftwidth=4 softtabstop=4 expandtab:


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

2022-07-23 Thread Andreas Heinisch (via logerrit)
 editeng/source/editeng/impedit2.cxx   |5 -
 sc/qa/uitest/calc_tests9/tdf135761.py |   34 ++
 2 files changed, 38 insertions(+), 1 deletion(-)

New commits:
commit 9a612ce3d1d025d5f553cc348feaedeea37fc822
Author: Andreas Heinisch 
AuthorDate: Fri Jul 15 16:25:06 2022 +0200
Commit: Andreas Heinisch 
CommitDate: Sat Jul 23 12:35:25 2022 +0200

tdf#135761 - Calc cell editing: change search preference for the word 
boundary

Since ImpEditEngine::StartOfWord is only used when a selection is deleted 
at the left, change the search preference of the word boundary from forward to 
backward. For further details of a deletion of a selection check 
ImpEditEngine::DeleteLeftOrRight.

Change-Id: Ic68901cc04e5057e058ff03304f68eef1dca7a1e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137108
Tested-by: Andreas Heinisch 
Reviewed-by: Andreas Heinisch 

diff --git a/editeng/source/editeng/impedit2.cxx 
b/editeng/source/editeng/impedit2.cxx
index c731932c51ec..8dbbc42f7ce7 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -1533,8 +1533,11 @@ EditPaM ImpEditEngine::StartOfWord( const EditPaM& rPaM )
 lang::Locale aLocale( GetLocale( aTmpPaM ) );
 
 uno::Reference < i18n::XBreakIterator > _xBI( ImplGetBreakIterator() );
+// tdf#135761 - since this function is only used when a selection is 
deleted at the left,
+// change the search preference of the word boundary from forward to 
backward.
+// For further details of a deletion of a selection check 
ImpEditEngine::DeleteLeftOrRight.
 i18n::Boundary aBoundary = _xBI->getWordBoundary(
-rPaM.GetNode()->GetString(), rPaM.GetIndex(), aLocale, 
css::i18n::WordType::ANYWORD_IGNOREWHITESPACES, true);
+rPaM.GetNode()->GetString(), rPaM.GetIndex(), aLocale, 
css::i18n::WordType::ANYWORD_IGNOREWHITESPACES, false);
 
 aNewPaM.SetIndex( aBoundary.startPos );
 return aNewPaM;
diff --git a/sc/qa/uitest/calc_tests9/tdf135761.py 
b/sc/qa/uitest/calc_tests9/tdf135761.py
new file mode 100755
index ..fd9e5ebda341
--- /dev/null
+++ b/sc/qa/uitest/calc_tests9/tdf135761.py
@@ -0,0 +1,34 @@
+# -*- 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
+
+class tdf135761(UITestCase):
+def test_tdf135761_ctrl_backspace(self):
+with self.ui_test.create_doc_in_start_center("calc") as document:
+xCalcDoc = self.xUITest.getTopFocusWindow()
+xGridWindow = xCalcDoc.getChild("grid_window")
+
+# Enter text including two whitespaces in the text, and delete the 
left part of the text
+xGridWindow.executeAction("SELECT", mkPropertyValues({"CELL": 
"A1"}))
+xGridWindow.executeAction("TYPE", mkPropertyValues({"TEXT": "a  
b"}))
+xGridWindow.executeAction("TYPE", 
mkPropertyValues({"KEYCODE":"F2"}))
+xGridWindow.executeAction("TYPE", 
mkPropertyValues({"KEYCODE":"LEFT"}))
+xGridWindow.executeAction("TYPE", 
mkPropertyValues({"KEYCODE":"LEFT"}))
+xGridWindow.executeAction("TYPE", 
mkPropertyValues({"KEYCODE":"CTRL+BACKSPACE"}))
+xGridWindow.executeAction("TYPE", 
mkPropertyValues({"KEYCODE":"RETURN"}))
+
+# Without the fix in place, this test would have failed with
+# AssertionError: ' b' != 'a b'
+
+self.assertEqual(get_cell_by_position(document, 0, 0, 
0).getString(), " b")
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:


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

2022-07-09 Thread Andreas Heinisch (via logerrit)
 formula/source/ui/dlg/funcpage.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit bb4314aa21baec08268e0f02b816a8cf05096ceb
Author: Andreas Heinisch 
AuthorDate: Fri Jul 8 17:20:52 2022 +0200
Commit: Andreas Heinisch 
CommitDate: Sat Jul 9 14:39:40 2022 +0200

tdf#146781 - Function wizard: search desired function also in the 
description

Change-Id: I12f2fd5bf3497505a8652ab98bccb495a619333d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136905
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 

diff --git a/formula/source/ui/dlg/funcpage.cxx 
b/formula/source/ui/dlg/funcpage.cxx
index 553517ce778a..d90bf9ca951b 100644
--- a/formula/source/ui/dlg/funcpage.cxx
+++ b/formula/source/ui/dlg/funcpage.cxx
@@ -159,7 +159,9 @@ void FuncPage::UpdateFunctionList(const OUString& aStr)
 for (sal_uInt32 j = 0; j < nFunctionCount; ++j)
 {
 TFunctionDesc pDesc(pCategory->getFunction(j));
-if 
(rCharClass.uppercase(pDesc->getFunctionName()).indexOf(aSearchStr) >= 0)
+// tdf#146781 - search for the desired function also in the 
description
+if 
(rCharClass.uppercase(pDesc->getFunctionName()).indexOf(aSearchStr) >= 0
+|| 
rCharClass.uppercase(pDesc->getDescription()).indexOf(aSearchStr) >= 0)
 {
 if (!pDesc->isHidden())
 {


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

2022-07-05 Thread Andreas Heinisch (via logerrit)
 sw/source/ui/misc/outline.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 322f7414ce9600e45e52f9e3a89296703c2a6b42
Author: Andreas Heinisch 
AuthorDate: Mon Jul 4 13:53:15 2022 +0200
Commit: Xisco Fauli 
CommitDate: Tue Jul 5 10:51:16 2022 +0200

tdf#131568 - Chapter numbering dialog: sort list of character styles

Change-Id: Ibe6830a7d3fdd35c4d8e6fa2b7c0007fa318083a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136798
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 
(cherry picked from commit d6a363d83011ce3f195b96816e25dd749772cc24)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136761
Reviewed-by: Xisco Fauli 

diff --git a/sw/source/ui/misc/outline.cxx b/sw/source/ui/misc/outline.cxx
index 3c1345f308ae..533028ebe09b 100644
--- a/sw/source/ui/misc/outline.cxx
+++ b/sw/source/ui/misc/outline.cxx
@@ -409,6 +409,7 @@ 
SwOutlineSettingsTabPage::SwOutlineSettingsTabPage(weld::Container* pPage, weld:
 m_xPrefixED->connect_changed(LINK(this,   SwOutlineSettingsTabPage, 
DelimModify));
 m_xSuffixED->connect_changed(LINK(this,   SwOutlineSettingsTabPage, 
DelimModify));
 m_xStartEdit->connect_value_changed(LINK(this,  SwOutlineSettingsTabPage, 
StartModified));
+m_xCharFormatLB->make_sorted();
 m_xCharFormatLB->connect_changed(LINK(this,  SwOutlineSettingsTabPage, 
CharFormatHdl));
 }
 


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

2022-07-04 Thread Andreas Heinisch (via logerrit)
 sw/source/ui/misc/outline.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit d6a363d83011ce3f195b96816e25dd749772cc24
Author: Andreas Heinisch 
AuthorDate: Mon Jul 4 13:53:15 2022 +0200
Commit: Andreas Heinisch 
CommitDate: Mon Jul 4 15:03:55 2022 +0200

tdf#131568 - Chapter numbering dialog: sort list of character styles

Change-Id: Ibe6830a7d3fdd35c4d8e6fa2b7c0007fa318083a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136798
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 

diff --git a/sw/source/ui/misc/outline.cxx b/sw/source/ui/misc/outline.cxx
index 3c1345f308ae..533028ebe09b 100644
--- a/sw/source/ui/misc/outline.cxx
+++ b/sw/source/ui/misc/outline.cxx
@@ -409,6 +409,7 @@ 
SwOutlineSettingsTabPage::SwOutlineSettingsTabPage(weld::Container* pPage, weld:
 m_xPrefixED->connect_changed(LINK(this,   SwOutlineSettingsTabPage, 
DelimModify));
 m_xSuffixED->connect_changed(LINK(this,   SwOutlineSettingsTabPage, 
DelimModify));
 m_xStartEdit->connect_value_changed(LINK(this,  SwOutlineSettingsTabPage, 
StartModified));
+m_xCharFormatLB->make_sorted();
 m_xCharFormatLB->connect_changed(LINK(this,  SwOutlineSettingsTabPage, 
CharFormatHdl));
 }
 


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

2022-06-24 Thread Andreas Heinisch (via logerrit)
 basic/qa/basic_coverage/test_tdf147529_optional_parameters_msgbox.bas |   38 
+
 basic/qa/cppunit/test_vba.cxx |1 
 basic/qa/vba_tests/tdf147529_optional_parameters_msgbox.vb|   39 
++
 basic/source/runtime/methods.cxx  |   13 
+++
 4 files changed, 90 insertions(+), 1 deletion(-)

New commits:
commit c44e819489985cbd924e58ccfc82a654c29ea6f5
Author: Andreas Heinisch 
AuthorDate: Thu Jun 23 15:07:18 2022 +0200
Commit: Xisco Fauli 
CommitDate: Fri Jun 24 18:40:47 2022 +0200

tdf#147529 - BASIC MsgBox: Check for missing optional parameters

Change-Id: Iecb47e0005c609ee1117d6fb141e810c0166806a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136339
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 
(cherry picked from commit 522f5ad4d8c92624fffa869143aa869662a48589)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136375
Reviewed-by: Xisco Fauli 

diff --git 
a/basic/qa/basic_coverage/test_tdf147529_optional_parameters_msgbox.bas 
b/basic/qa/basic_coverage/test_tdf147529_optional_parameters_msgbox.bas
new file mode 100755
index ..dabb23c0faf1
--- /dev/null
+++ b/basic/qa/basic_coverage/test_tdf147529_optional_parameters_msgbox.bas
@@ -0,0 +1,38 @@
+'
+' 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/.
+'
+
+Option Explicit
+
+Function doUnitTest() As String
+TestUtil.TestInit
+verify_testOptionalParametersMsgBox
+doUnitTest = TestUtil.GetResult()
+End Function
+
+Sub verify_testOptionalParametersMsgBox
+On Error GoTo errorHandler
+
+' tdf#147529 - check for missing optional parameters
+TestUtil.AssertEqual(TestOptionalParametersMsgBox(),  True, 
"TestOptionalParametersMsgBox()")
+TestUtil.AssertEqual(TestOptionalParametersMsgBox("test"),True, 
"TestOptionalParametersMsgBox(""test"")")
+TestUtil.AssertEqual(TestOptionalParametersMsgBox("test", 1), True, 
"TestOptionalParametersMsgBox(""test"", 1)")
+
+Exit Sub
+errorHandler:
+TestUtil.ReportErrorHandler("verify_testOptionalParametersMsgBox", Err, 
Error$, Erl)
+End Sub
+
+Function TestOptionalParametersMsgBox(Optional text, Optional dialogType, 
Optional dialogTitle) As Boolean
+On Error GoTo errorHandler
+MsgBox(text, dialogType, dialogTitle)
+TestOptionalParametersMsgBox = False
+Exit Function
+errorHandler:
+TestUtil.AssertEqual(Err, 449, "Argument not optional (Error 449)")
+TestOptionalParametersMsgBox = True
+End Function
diff --git a/basic/qa/cppunit/test_vba.cxx b/basic/qa/cppunit/test_vba.cxx
index 07e4287e17b1..f048fee6dfda 100644
--- a/basic/qa/cppunit/test_vba.cxx
+++ b/basic/qa/cppunit/test_vba.cxx
@@ -136,6 +136,7 @@ void VBATest::testMiscVBAFunctions()
 "strreverse.vb",
 "switch.vb",
 "tdf147089_idiv.vb",
+"tdf147529_optional_parameters_msgbox.vb",
 "tdf148358_non_ascii_names.vb",
 "timeserial.vb",
 "timevalue.vb",
diff --git a/basic/qa/vba_tests/tdf147529_optional_parameters_msgbox.vb 
b/basic/qa/vba_tests/tdf147529_optional_parameters_msgbox.vb
new file mode 100755
index ..dabe552a821b
--- /dev/null
+++ b/basic/qa/vba_tests/tdf147529_optional_parameters_msgbox.vb
@@ -0,0 +1,39 @@
+'
+' 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/.
+'
+
+Option VBASupport 1
+Option Explicit
+
+Function doUnitTest() As String
+TestUtil.TestInit
+verify_testOptionalParametersMsgBox
+doUnitTest = TestUtil.GetResult()
+End Function
+
+Sub verify_testOptionalParametersMsgBox
+On Error GoTo errorHandler
+
+' tdf#147529 - check for missing optional parameters
+TestUtil.AssertEqual(TestOptionalParametersMsgBox(),  True, 
"TestOptionalParametersMsgBox()")
+TestUtil.AssertEqual(TestOptionalParametersMsgBox("test"),True, 
"TestOptionalParametersMsgBox(""test"")")
+TestUtil.AssertEqual(TestOptionalParametersMsgBox("test", 1), True, 
"TestOptionalParametersMsgBox(""test"", 1)")
+
+Exit Sub
+errorHandler:
+TestUtil.ReportErrorHandler("verify_testOptionalParametersMsgBox", Err, 
Error$, Erl)
+End Sub
+
+Function TestOptionalParametersMsgBox(Optional text, Optional dialogType, 
Optional dialogTitle) As Boolean
+On Error GoTo errorHandler
+MsgBox text, dialogType, dialogTitle
+TestOptionalParametersMsgBox = False
+Exit Function
+errorHandler:
+TestUtil.AssertEqual(Err, 449, "Argument not optional (Error 449)")
+TestOptionalParametersMsgBox = True
+End Function
diff --git 

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

2022-06-24 Thread Andreas Heinisch (via logerrit)
 basic/qa/basic_coverage/test_tdf147529_optional_parameters_msgbox.bas |   38 
+
 basic/qa/cppunit/test_vba.cxx |1 
 basic/qa/vba_tests/tdf147529_optional_parameters_msgbox.vb|   39 
++
 basic/source/runtime/methods.cxx  |   13 
+++
 4 files changed, 90 insertions(+), 1 deletion(-)

New commits:
commit 522f5ad4d8c92624fffa869143aa869662a48589
Author: Andreas Heinisch 
AuthorDate: Thu Jun 23 15:07:18 2022 +0200
Commit: Andreas Heinisch 
CommitDate: Fri Jun 24 09:20:45 2022 +0200

tdf#147529 - BASIC MsgBox: Check for missing optional parameters

Change-Id: Iecb47e0005c609ee1117d6fb141e810c0166806a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136339
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 

diff --git 
a/basic/qa/basic_coverage/test_tdf147529_optional_parameters_msgbox.bas 
b/basic/qa/basic_coverage/test_tdf147529_optional_parameters_msgbox.bas
new file mode 100755
index ..dabb23c0faf1
--- /dev/null
+++ b/basic/qa/basic_coverage/test_tdf147529_optional_parameters_msgbox.bas
@@ -0,0 +1,38 @@
+'
+' 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/.
+'
+
+Option Explicit
+
+Function doUnitTest() As String
+TestUtil.TestInit
+verify_testOptionalParametersMsgBox
+doUnitTest = TestUtil.GetResult()
+End Function
+
+Sub verify_testOptionalParametersMsgBox
+On Error GoTo errorHandler
+
+' tdf#147529 - check for missing optional parameters
+TestUtil.AssertEqual(TestOptionalParametersMsgBox(),  True, 
"TestOptionalParametersMsgBox()")
+TestUtil.AssertEqual(TestOptionalParametersMsgBox("test"),True, 
"TestOptionalParametersMsgBox(""test"")")
+TestUtil.AssertEqual(TestOptionalParametersMsgBox("test", 1), True, 
"TestOptionalParametersMsgBox(""test"", 1)")
+
+Exit Sub
+errorHandler:
+TestUtil.ReportErrorHandler("verify_testOptionalParametersMsgBox", Err, 
Error$, Erl)
+End Sub
+
+Function TestOptionalParametersMsgBox(Optional text, Optional dialogType, 
Optional dialogTitle) As Boolean
+On Error GoTo errorHandler
+MsgBox(text, dialogType, dialogTitle)
+TestOptionalParametersMsgBox = False
+Exit Function
+errorHandler:
+TestUtil.AssertEqual(Err, 449, "Argument not optional (Error 449)")
+TestOptionalParametersMsgBox = True
+End Function
diff --git a/basic/qa/cppunit/test_vba.cxx b/basic/qa/cppunit/test_vba.cxx
index 07e4287e17b1..f048fee6dfda 100644
--- a/basic/qa/cppunit/test_vba.cxx
+++ b/basic/qa/cppunit/test_vba.cxx
@@ -136,6 +136,7 @@ void VBATest::testMiscVBAFunctions()
 "strreverse.vb",
 "switch.vb",
 "tdf147089_idiv.vb",
+"tdf147529_optional_parameters_msgbox.vb",
 "tdf148358_non_ascii_names.vb",
 "timeserial.vb",
 "timevalue.vb",
diff --git a/basic/qa/vba_tests/tdf147529_optional_parameters_msgbox.vb 
b/basic/qa/vba_tests/tdf147529_optional_parameters_msgbox.vb
new file mode 100755
index ..dabe552a821b
--- /dev/null
+++ b/basic/qa/vba_tests/tdf147529_optional_parameters_msgbox.vb
@@ -0,0 +1,39 @@
+'
+' 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/.
+'
+
+Option VBASupport 1
+Option Explicit
+
+Function doUnitTest() As String
+TestUtil.TestInit
+verify_testOptionalParametersMsgBox
+doUnitTest = TestUtil.GetResult()
+End Function
+
+Sub verify_testOptionalParametersMsgBox
+On Error GoTo errorHandler
+
+' tdf#147529 - check for missing optional parameters
+TestUtil.AssertEqual(TestOptionalParametersMsgBox(),  True, 
"TestOptionalParametersMsgBox()")
+TestUtil.AssertEqual(TestOptionalParametersMsgBox("test"),True, 
"TestOptionalParametersMsgBox(""test"")")
+TestUtil.AssertEqual(TestOptionalParametersMsgBox("test", 1), True, 
"TestOptionalParametersMsgBox(""test"", 1)")
+
+Exit Sub
+errorHandler:
+TestUtil.ReportErrorHandler("verify_testOptionalParametersMsgBox", Err, 
Error$, Erl)
+End Sub
+
+Function TestOptionalParametersMsgBox(Optional text, Optional dialogType, 
Optional dialogTitle) As Boolean
+On Error GoTo errorHandler
+MsgBox text, dialogType, dialogTitle
+TestOptionalParametersMsgBox = False
+Exit Function
+errorHandler:
+TestUtil.AssertEqual(Err, 449, "Argument not optional (Error 449)")
+TestOptionalParametersMsgBox = True
+End Function
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index 2761caba0309..fe654bbe6fd5 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ 

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

2022-06-21 Thread Andreas Heinisch (via logerrit)
 sc/source/core/data/dptabres.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit b013342bf7b16cb2393bd7e020707ff58f4d88de
Author: Andreas Heinisch 
AuthorDate: Wed Jun 15 17:33:53 2022 +0200
Commit: Xisco Fauli 
CommitDate: Tue Jun 21 14:10:44 2022 +0200

tdf#113002 - Add numeric flag to recurring data fields

Change-Id: Ife6ace86807f85c644ff919621f562c251c6690f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135915
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 
(cherry picked from commit 30529311ffbbe193765aff0ff353d3409fce3a3e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136133
Reviewed-by: Xisco Fauli 

diff --git a/sc/source/core/data/dptabres.cxx b/sc/source/core/data/dptabres.cxx
index d41604eee45e..1037eac1c013 100644
--- a/sc/source/core/data/dptabres.cxx
+++ b/sc/source/core/data/dptabres.cxx
@@ -1408,7 +1408,13 @@ void ScDPResultMember::FillMemberResults(
 
 //  set "continue" flag (removed for subtotals later)
 for (tools::Long i=1; igetRepeatItemLabels() )
 {
 tools::Long nSizeNonEmpty = nSize;


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

2022-06-19 Thread Andreas Heinisch (via logerrit)
 sc/source/core/data/dptabres.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit 30529311ffbbe193765aff0ff353d3409fce3a3e
Author: Andreas Heinisch 
AuthorDate: Wed Jun 15 17:33:53 2022 +0200
Commit: Andreas Heinisch 
CommitDate: Sun Jun 19 19:03:17 2022 +0200

tdf#113002 - Add numeric flag to recurring data fields

Change-Id: Ife6ace86807f85c644ff919621f562c251c6690f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135915
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 

diff --git a/sc/source/core/data/dptabres.cxx b/sc/source/core/data/dptabres.cxx
index d41604eee45e..1037eac1c013 100644
--- a/sc/source/core/data/dptabres.cxx
+++ b/sc/source/core/data/dptabres.cxx
@@ -1408,7 +1408,13 @@ void ScDPResultMember::FillMemberResults(
 
 //  set "continue" flag (removed for subtotals later)
 for (tools::Long i=1; igetRepeatItemLabels() )
 {
 tools::Long nSizeNonEmpty = nSize;


[Libreoffice-commits] core.git: Branch 'libreoffice-7-4' - cui/uiconfig

2022-06-13 Thread Andreas Heinisch (via logerrit)
 cui/uiconfig/ui/hyperlinkdocpage.ui  |8 
 cui/uiconfig/ui/hyperlinkinternetpage.ui |8 
 cui/uiconfig/ui/hyperlinkmailpage.ui |8 
 cui/uiconfig/ui/hyperlinknewdocpage.ui   |8 
 4 files changed, 32 deletions(-)

New commits:
commit f78ce524ad8efce5181a47b63d01b4439a3fd03c
Author: Andreas Heinisch 
AuthorDate: Sat Jun 11 18:19:14 2022 +0200
Commit: Adolfo Jayme Barrientos 
CommitDate: Tue Jun 14 02:36:07 2022 +0200

tdf#133675 - Hyperlink dialog: change frame widtget from editbox to dropdown

Change-Id: Ibb8d5b14cf0f1524f6f554ee0ab77a14507330cf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135657
Tested-by: Jenkins
Tested-by: Heiko Tietze 
Reviewed-by: Heiko Tietze 
(cherry picked from commit 708c045178fb47c821a8f0a241a7670a2e45a232)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135712
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/cui/uiconfig/ui/hyperlinkdocpage.ui 
b/cui/uiconfig/ui/hyperlinkdocpage.ui
index 335e90778e5d..1e769d50862e 100644
--- a/cui/uiconfig/ui/hyperlinkdocpage.ui
+++ b/cui/uiconfig/ui/hyperlinkdocpage.ui
@@ -386,14 +386,6 @@
 True
 False
 True
-True
-
-  
-True
-True
-True
-  
-
 
   
 Enter the name 
of the frame that you want the linked file to open in, or select a predefined 
frame from the list. If you leave this box blank, the linked file opens in the 
current browser window.
diff --git a/cui/uiconfig/ui/hyperlinkinternetpage.ui 
b/cui/uiconfig/ui/hyperlinkinternetpage.ui
index 48b6a450a094..63978b8d0396 100644
--- a/cui/uiconfig/ui/hyperlinkinternetpage.ui
+++ b/cui/uiconfig/ui/hyperlinkinternetpage.ui
@@ -396,14 +396,6 @@
 True
 False
 True
-True
-
-  
-True
-True
-True
-  
-
 
   
 Enter the 
name of the frame that you want the linked file to open in, or select a 
predefined frame from the list. If you leave this box blank, the linked file 
opens in the current browser window.
diff --git a/cui/uiconfig/ui/hyperlinkmailpage.ui 
b/cui/uiconfig/ui/hyperlinkmailpage.ui
index edf8db7b77a5..f76d74aaf6f9 100644
--- a/cui/uiconfig/ui/hyperlinkmailpage.ui
+++ b/cui/uiconfig/ui/hyperlinkmailpage.ui
@@ -311,14 +311,6 @@
 True
 False
 True
-True
-
-  
-True
-True
-True
-  
-
 
   
 Enter the 
name of the frame that you want the linked file to open in, or select a 
predefined frame from the list. If you leave this box blank, the linked file 
opens in the current browser window.
diff --git a/cui/uiconfig/ui/hyperlinknewdocpage.ui 
b/cui/uiconfig/ui/hyperlinknewdocpage.ui
index 196a8fb0d768..a087c403b344 100644
--- a/cui/uiconfig/ui/hyperlinknewdocpage.ui
+++ b/cui/uiconfig/ui/hyperlinknewdocpage.ui
@@ -395,14 +395,6 @@
 True
 False
 True
-True
-
-  
-True
-True
-True
-  
-
 
   
 Enter the 
name of the frame that you want the linked file to open in, or select a 
predefined frame from the list. If you leave this box blank, the linked file 
opens in the current browser window.


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

2022-06-13 Thread Andreas Heinisch (via logerrit)
 cui/uiconfig/ui/hyperlinkdocpage.ui  |8 
 cui/uiconfig/ui/hyperlinkinternetpage.ui |8 
 cui/uiconfig/ui/hyperlinkmailpage.ui |8 
 cui/uiconfig/ui/hyperlinknewdocpage.ui   |8 
 4 files changed, 32 deletions(-)

New commits:
commit e8f97879c4e677107551692fa88b0791f70bd413
Author: Andreas Heinisch 
AuthorDate: Sat Jun 11 18:19:14 2022 +0200
Commit: Adolfo Jayme Barrientos 
CommitDate: Mon Jun 13 14:31:45 2022 +0200

tdf#133675 - Hyperlink dialog: change frame widtget from editbox to dropdown

Change-Id: Ibb8d5b14cf0f1524f6f554ee0ab77a14507330cf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135657
Tested-by: Jenkins
Tested-by: Heiko Tietze 
Reviewed-by: Heiko Tietze 

diff --git a/cui/uiconfig/ui/hyperlinkdocpage.ui 
b/cui/uiconfig/ui/hyperlinkdocpage.ui
index 335e90778e5d..1e769d50862e 100644
--- a/cui/uiconfig/ui/hyperlinkdocpage.ui
+++ b/cui/uiconfig/ui/hyperlinkdocpage.ui
@@ -386,14 +386,6 @@
 True
 False
 True
-True
-
-  
-True
-True
-True
-  
-
 
   
 Enter the name 
of the frame that you want the linked file to open in, or select a predefined 
frame from the list. If you leave this box blank, the linked file opens in the 
current browser window.
diff --git a/cui/uiconfig/ui/hyperlinkinternetpage.ui 
b/cui/uiconfig/ui/hyperlinkinternetpage.ui
index 48b6a450a094..63978b8d0396 100644
--- a/cui/uiconfig/ui/hyperlinkinternetpage.ui
+++ b/cui/uiconfig/ui/hyperlinkinternetpage.ui
@@ -396,14 +396,6 @@
 True
 False
 True
-True
-
-  
-True
-True
-True
-  
-
 
   
 Enter the 
name of the frame that you want the linked file to open in, or select a 
predefined frame from the list. If you leave this box blank, the linked file 
opens in the current browser window.
diff --git a/cui/uiconfig/ui/hyperlinkmailpage.ui 
b/cui/uiconfig/ui/hyperlinkmailpage.ui
index edf8db7b77a5..f76d74aaf6f9 100644
--- a/cui/uiconfig/ui/hyperlinkmailpage.ui
+++ b/cui/uiconfig/ui/hyperlinkmailpage.ui
@@ -311,14 +311,6 @@
 True
 False
 True
-True
-
-  
-True
-True
-True
-  
-
 
   
 Enter the 
name of the frame that you want the linked file to open in, or select a 
predefined frame from the list. If you leave this box blank, the linked file 
opens in the current browser window.
diff --git a/cui/uiconfig/ui/hyperlinknewdocpage.ui 
b/cui/uiconfig/ui/hyperlinknewdocpage.ui
index 196a8fb0d768..a087c403b344 100644
--- a/cui/uiconfig/ui/hyperlinknewdocpage.ui
+++ b/cui/uiconfig/ui/hyperlinknewdocpage.ui
@@ -395,14 +395,6 @@
 True
 False
 True
-True
-
-  
-True
-True
-True
-  
-
 
   
 Enter the 
name of the frame that you want the linked file to open in, or select a 
predefined frame from the list. If you leave this box blank, the linked file 
opens in the current browser window.


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

2022-06-06 Thread Andreas Heinisch (via logerrit)
 basic/qa/cppunit/test_compiler_checks.cxx |   41 ++
 basic/source/comp/scanner.cxx |7 -
 basic/source/inc/scanner.hxx  |1 
 3 files changed, 48 insertions(+), 1 deletion(-)

New commits:
commit ed3d572b730d1873dd66fa2a31695248d506a335
Author: Andreas Heinisch 
AuthorDate: Fri Jun 3 09:41:05 2022 +0200
Commit: Xisco Fauli 
CommitDate: Mon Jun 6 17:08:15 2022 +0200

tdf#149402 - BASIC: Don't extend comment if line ends in a whitespace

Change-Id: I8adf530e77a0e65329fa59ac2873b99f48befac4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135336
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 
(cherry picked from commit fbce18558a58cddf910b788a67c2f2d4d25d68e9)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135378
Reviewed-by: Xisco Fauli 

diff --git a/basic/qa/cppunit/test_compiler_checks.cxx 
b/basic/qa/cppunit/test_compiler_checks.cxx
index e2882f3f694c..044977670e62 100644
--- a/basic/qa/cppunit/test_compiler_checks.cxx
+++ b/basic/qa/cppunit/test_compiler_checks.cxx
@@ -73,4 +73,45 @@ CPPUNIT_TEST_FIXTURE(CppUnit::TestFixture, testTdf149157_vba)
 CPPUNIT_ASSERT(!aMacro.HasError());
 }
 
+CPPUNIT_TEST_FIXTURE(CppUnit::TestFixture, testTdf149402)
+{
+MacroSnippet aMacro("Function extentComment() As Integer\n"
+"  ' _ \n"
+"  If Not extentComment Then\n"
+" extentComment = 1\n"
+"  Else\n"
+"  End If\n"
+"End Function\n");
+aMacro.Compile();
+CPPUNIT_ASSERT(!aMacro.HasError());
+}
+
+CPPUNIT_TEST_FIXTURE(CppUnit::TestFixture, testTdf149402_compatible)
+{
+MacroSnippet aMacro("Option Compatible\n"
+"Function extentComment() As Integer\n"
+"  ' _ \n"
+"  If Not extentComment Then\n"
+" extentComment = 1\n"
+"  Else\n"
+"  End If\n"
+"End Function\n");
+aMacro.Compile();
+CPPUNIT_ASSERT(!aMacro.HasError());
+}
+
+CPPUNIT_TEST_FIXTURE(CppUnit::TestFixture, testTdf149402_vba)
+{
+MacroSnippet aMacro("Option VBASupport 1\n"
+"Function extentComment() As Integer\n"
+"  ' _ \n"
+"  If Not extentComment Then\n"
+" extentComment = 1\n"
+"  Else\n"
+"  End If\n"
+"End Function\n");
+aMacro.Compile();
+CPPUNIT_ASSERT(!aMacro.HasError());
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/basic/source/comp/scanner.cxx b/basic/source/comp/scanner.cxx
index d391e7b6dff2..8c63dcd6643c 100644
--- a/basic/source/comp/scanner.cxx
+++ b/basic/source/comp/scanner.cxx
@@ -53,6 +53,7 @@ SbiScanner::SbiScanner(const OUString& rBuf, StarBASIC* p)
 , bVBASupportOn(false)
 , bPrevLineExtentsComment(false)
 , bClosingUnderscore(false)
+, bLineEndsWithWhitespace(false)
 , bInStatement(false)
 {
 }
@@ -186,6 +187,8 @@ bool SbiScanner::readLine()
 while(nBufPos < nEnd && BasicCharClass::isWhitespace(aBuf[nEnd - 1]))
 --nEnd;
 
+// tdf#149402 - check if line ends with a whitespace
+bLineEndsWithWhitespace = (n > nEnd);
 aLine = aBuf.copy(nBufPos, nEnd - nBufPos);
 
 // Fast-forward past the line ending
@@ -663,7 +666,9 @@ PrevLineCommentLbl:
 bPrevLineExtentsComment = false;
 aSym = "REM";
 sal_Int32 nLen = aLine.getLength() - nLineIdx;
-if( bCompatible && aLine[nLineIdx + nLen - 1] == '_' && aLine[nLineIdx 
+ nLen - 2] == ' ' )
+// tdf#149402 - don't extend comment if line ends in a whitespace 
(asicCharClass::isWhitespace)
+if (bCompatible && !bLineEndsWithWhitespace && aLine[nLineIdx + nLen - 
1] == '_'
+&& aLine[nLineIdx + nLen - 2] == ' ')
 bPrevLineExtentsComment = true;
 nCol2 = nCol2 + nLen;
 nLineIdx = -1;
diff --git a/basic/source/inc/scanner.hxx b/basic/source/inc/scanner.hxx
index 39dda9fa391c..cc3cbb5d7b41 100644
--- a/basic/source/inc/scanner.hxx
+++ b/basic/source/inc/scanner.hxx
@@ -62,6 +62,7 @@ protected:
 bool   bVBASupportOn;   // true: OPTION VBASupport 1 otherwise 
default False
 bool   bPrevLineExtentsComment; // true: Previous line is comment and 
ends on "... _"
 bool   bClosingUnderscore;  // true: Closing underscore followed 
by end of line
+bool   bLineEndsWithWhitespace; // true: Line ends with whitespace 
(BasicCharClass::isWhitespace)
 
 bool   bInStatement;
 void   GenError( ErrCode );


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

2022-06-06 Thread Andreas Heinisch (via logerrit)
 basic/qa/cppunit/test_compiler_checks.cxx |   41 ++
 basic/source/comp/scanner.cxx |7 -
 basic/source/inc/scanner.hxx  |1 
 3 files changed, 48 insertions(+), 1 deletion(-)

New commits:
commit fbce18558a58cddf910b788a67c2f2d4d25d68e9
Author: Andreas Heinisch 
AuthorDate: Fri Jun 3 09:41:05 2022 +0200
Commit: Andreas Heinisch 
CommitDate: Mon Jun 6 10:24:20 2022 +0200

tdf#149402 - BASIC: Don't extend comment if line ends in a whitespace

Change-Id: I8adf530e77a0e65329fa59ac2873b99f48befac4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135336
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 

diff --git a/basic/qa/cppunit/test_compiler_checks.cxx 
b/basic/qa/cppunit/test_compiler_checks.cxx
index e2882f3f694c..044977670e62 100644
--- a/basic/qa/cppunit/test_compiler_checks.cxx
+++ b/basic/qa/cppunit/test_compiler_checks.cxx
@@ -73,4 +73,45 @@ CPPUNIT_TEST_FIXTURE(CppUnit::TestFixture, testTdf149157_vba)
 CPPUNIT_ASSERT(!aMacro.HasError());
 }
 
+CPPUNIT_TEST_FIXTURE(CppUnit::TestFixture, testTdf149402)
+{
+MacroSnippet aMacro("Function extentComment() As Integer\n"
+"  ' _ \n"
+"  If Not extentComment Then\n"
+" extentComment = 1\n"
+"  Else\n"
+"  End If\n"
+"End Function\n");
+aMacro.Compile();
+CPPUNIT_ASSERT(!aMacro.HasError());
+}
+
+CPPUNIT_TEST_FIXTURE(CppUnit::TestFixture, testTdf149402_compatible)
+{
+MacroSnippet aMacro("Option Compatible\n"
+"Function extentComment() As Integer\n"
+"  ' _ \n"
+"  If Not extentComment Then\n"
+" extentComment = 1\n"
+"  Else\n"
+"  End If\n"
+"End Function\n");
+aMacro.Compile();
+CPPUNIT_ASSERT(!aMacro.HasError());
+}
+
+CPPUNIT_TEST_FIXTURE(CppUnit::TestFixture, testTdf149402_vba)
+{
+MacroSnippet aMacro("Option VBASupport 1\n"
+"Function extentComment() As Integer\n"
+"  ' _ \n"
+"  If Not extentComment Then\n"
+" extentComment = 1\n"
+"  Else\n"
+"  End If\n"
+"End Function\n");
+aMacro.Compile();
+CPPUNIT_ASSERT(!aMacro.HasError());
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/basic/source/comp/scanner.cxx b/basic/source/comp/scanner.cxx
index af87757b2282..b5a923969bfd 100644
--- a/basic/source/comp/scanner.cxx
+++ b/basic/source/comp/scanner.cxx
@@ -55,6 +55,7 @@ SbiScanner::SbiScanner(OUString _aBuf, StarBASIC* p)
 , bVBASupportOn(false)
 , bPrevLineExtentsComment(false)
 , bClosingUnderscore(false)
+, bLineEndsWithWhitespace(false)
 , bInStatement(false)
 {
 }
@@ -188,6 +189,8 @@ bool SbiScanner::readLine()
 while(nBufPos < nEnd && BasicCharClass::isWhitespace(aBuf[nEnd - 1]))
 --nEnd;
 
+// tdf#149402 - check if line ends with a whitespace
+bLineEndsWithWhitespace = (n > nEnd);
 aLine = aBuf.copy(nBufPos, nEnd - nBufPos);
 
 // Fast-forward past the line ending
@@ -665,7 +668,9 @@ PrevLineCommentLbl:
 bPrevLineExtentsComment = false;
 aSym = "REM";
 sal_Int32 nLen = aLine.getLength() - nLineIdx;
-if( bCompatible && aLine[nLineIdx + nLen - 1] == '_' && aLine[nLineIdx 
+ nLen - 2] == ' ' )
+// tdf#149402 - don't extend comment if line ends in a whitespace 
(asicCharClass::isWhitespace)
+if (bCompatible && !bLineEndsWithWhitespace && aLine[nLineIdx + nLen - 
1] == '_'
+&& aLine[nLineIdx + nLen - 2] == ' ')
 bPrevLineExtentsComment = true;
 nCol2 = nCol2 + nLen;
 nLineIdx = -1;
diff --git a/basic/source/inc/scanner.hxx b/basic/source/inc/scanner.hxx
index c10d809055a6..3f2c7e2e2cff 100644
--- a/basic/source/inc/scanner.hxx
+++ b/basic/source/inc/scanner.hxx
@@ -62,6 +62,7 @@ protected:
 bool   bVBASupportOn;   // true: OPTION VBASupport 1 otherwise 
default False
 bool   bPrevLineExtentsComment; // true: Previous line is comment and 
ends on "... _"
 bool   bClosingUnderscore;  // true: Closing underscore followed 
by end of line
+bool   bLineEndsWithWhitespace; // true: Line ends with whitespace 
(BasicCharClass::isWhitespace)
 
 bool   bInStatement;
 void   GenError( ErrCode );


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

2022-05-31 Thread Andreas Heinisch (via logerrit)
 basic/qa/cppunit/test_compiler_checks.cxx |   40 ++
 basic/source/comp/scanner.cxx |2 +
 2 files changed, 42 insertions(+)

New commits:
commit 73e46d86335e60f1b11a91b23522402cd34466a8
Author: Andreas Heinisch 
AuthorDate: Wed May 25 12:42:23 2022 +0200
Commit: Xisco Fauli 
CommitDate: Tue May 31 19:55:38 2022 +0200

tdf#149157 - Break multiline continuation in a comment after a new line

Change-Id: I3dd875152a6f2cfafb67f13f597c36f01a4759b4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135018
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 
(cherry picked from commit b94275f6d2cb4dc28d1563fd7994251042b6d51a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135164
Reviewed-by: Xisco Fauli 

diff --git a/basic/qa/cppunit/test_compiler_checks.cxx 
b/basic/qa/cppunit/test_compiler_checks.cxx
index 24b380ed2a9a..e2882f3f694c 100644
--- a/basic/qa/cppunit/test_compiler_checks.cxx
+++ b/basic/qa/cppunit/test_compiler_checks.cxx
@@ -33,4 +33,44 @@ CPPUNIT_TEST_FIXTURE(CppUnit::TestFixture, 
testDoubleArgument)
 CPPUNIT_ASSERT_EQUAL(ERRCODE_BASIC_VAR_DEFINED, 
aMacro.getError().StripDynamic());
 }
 
+CPPUNIT_TEST_FIXTURE(CppUnit::TestFixture, testTdf149157)
+{
+MacroSnippet aMacro("Function extentComment() As Integer\n"
+"  ' _\n"
+"  If Not extentComment Then\n"
+" extentComment = 1\n"
+"  End If\n"
+"End Function\n");
+aMacro.Compile();
+CPPUNIT_ASSERT(!aMacro.HasError());
+}
+
+CPPUNIT_TEST_FIXTURE(CppUnit::TestFixture, testTdf149157_compatible)
+{
+MacroSnippet aMacro("Option Compatible\n"
+"Function extentComment() As Integer\n"
+"  ' _\n"
+"\n"
+"  If Not extentComment Then\n"
+" extentComment = 1\n"
+"  End If\n"
+"End Function\n");
+aMacro.Compile();
+CPPUNIT_ASSERT(!aMacro.HasError());
+}
+
+CPPUNIT_TEST_FIXTURE(CppUnit::TestFixture, testTdf149157_vba)
+{
+MacroSnippet aMacro("Option VBASupport 1\n"
+"Function extentComment() As Integer\n"
+"  ' _\n"
+"\n"
+"  If Not extentComment Then\n"
+" extentComment = 1\n"
+"  End If\n"
+"End Function\n");
+aMacro.Compile();
+CPPUNIT_ASSERT(!aMacro.HasError());
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/basic/source/comp/scanner.cxx b/basic/source/comp/scanner.cxx
index a0d9b9ab6c76..d391e7b6dff2 100644
--- a/basic/source/comp/scanner.cxx
+++ b/basic/source/comp/scanner.cxx
@@ -701,6 +701,8 @@ eoln:
 aSym = "\n";
 nColLock = 0;
 bClosingUnderscore = false;
+// tdf#149157 - break multiline continuation in a comment after a new 
line
+bPrevLineExtentsComment = false;
 return true;
 }
 }


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

2022-05-31 Thread Andreas Heinisch (via logerrit)
 basic/qa/cppunit/test_compiler_checks.cxx |   40 ++
 basic/source/comp/scanner.cxx |2 +
 2 files changed, 42 insertions(+)

New commits:
commit b94275f6d2cb4dc28d1563fd7994251042b6d51a
Author: Andreas Heinisch 
AuthorDate: Wed May 25 12:42:23 2022 +0200
Commit: Andreas Heinisch 
CommitDate: Tue May 31 12:30:21 2022 +0200

tdf#149157 - Break multiline continuation in a comment after a new line

Change-Id: I3dd875152a6f2cfafb67f13f597c36f01a4759b4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135018
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 

diff --git a/basic/qa/cppunit/test_compiler_checks.cxx 
b/basic/qa/cppunit/test_compiler_checks.cxx
index 24b380ed2a9a..e2882f3f694c 100644
--- a/basic/qa/cppunit/test_compiler_checks.cxx
+++ b/basic/qa/cppunit/test_compiler_checks.cxx
@@ -33,4 +33,44 @@ CPPUNIT_TEST_FIXTURE(CppUnit::TestFixture, 
testDoubleArgument)
 CPPUNIT_ASSERT_EQUAL(ERRCODE_BASIC_VAR_DEFINED, 
aMacro.getError().StripDynamic());
 }
 
+CPPUNIT_TEST_FIXTURE(CppUnit::TestFixture, testTdf149157)
+{
+MacroSnippet aMacro("Function extentComment() As Integer\n"
+"  ' _\n"
+"  If Not extentComment Then\n"
+" extentComment = 1\n"
+"  End If\n"
+"End Function\n");
+aMacro.Compile();
+CPPUNIT_ASSERT(!aMacro.HasError());
+}
+
+CPPUNIT_TEST_FIXTURE(CppUnit::TestFixture, testTdf149157_compatible)
+{
+MacroSnippet aMacro("Option Compatible\n"
+"Function extentComment() As Integer\n"
+"  ' _\n"
+"\n"
+"  If Not extentComment Then\n"
+" extentComment = 1\n"
+"  End If\n"
+"End Function\n");
+aMacro.Compile();
+CPPUNIT_ASSERT(!aMacro.HasError());
+}
+
+CPPUNIT_TEST_FIXTURE(CppUnit::TestFixture, testTdf149157_vba)
+{
+MacroSnippet aMacro("Option VBASupport 1\n"
+"Function extentComment() As Integer\n"
+"  ' _\n"
+"\n"
+"  If Not extentComment Then\n"
+" extentComment = 1\n"
+"  End If\n"
+"End Function\n");
+aMacro.Compile();
+CPPUNIT_ASSERT(!aMacro.HasError());
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/basic/source/comp/scanner.cxx b/basic/source/comp/scanner.cxx
index 63d525939459..4cb2e34e3285 100644
--- a/basic/source/comp/scanner.cxx
+++ b/basic/source/comp/scanner.cxx
@@ -702,6 +702,8 @@ eoln:
 aSym = "\n";
 nColLock = 0;
 bClosingUnderscore = false;
+// tdf#149157 - break multiline continuation in a comment after a new 
line
+bPrevLineExtentsComment = false;
 return true;
 }
 }


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - 32 commits - basic/qa cui/source download.lst fpicker/source include/rtl jvmfwk/plugins readlicense_oo/license sc/qa sc/source sd/s

2022-05-13 Thread Andreas Heinisch (via logerrit)
 basic/qa/basic_coverage/test_non_ascii_names.bas|   28 
 cui/source/customize/SvxMenuConfigPage.cxx  |2 
 cui/source/customize/SvxToolbarConfigPage.cxx   |6 
 download.lst|4 
 fpicker/source/win32/VistaFilePickerImpl.cxx|5 
 include/rtl/ustring.hxx |4 
 jvmfwk/plugins/sunmajor/pluginlib/otherjre.cxx  |6 
 readlicense_oo/license/CREDITS.fodt | 3951 
 sc/qa/unit/bugfix-test.cxx  |   21 
 sc/qa/unit/data/ods/tdf108188_pagestyle.ods |binary
 sc/source/core/data/markmulti.cxx   |4 
 sc/source/core/data/stlsheet.cxx|   35 
 sc/source/core/tool/interpr6.cxx|   15 
 sc/source/core/tool/queryparam.cxx  |   29 
 sc/source/filter/excel/xeformula.cxx|4 
 sc/source/filter/excel/xename.cxx   |4 
 sd/source/ui/animations/CustomAnimationPane.cxx |2 
 sfx2/source/dialog/StyleList.cxx|   15 
 starmath/source/edit.cxx|4 
 svl/source/passwordcontainer/passwordcontainer.cxx  |4 
 svx/qa/unit/customshapes.cxx|   73 
 svx/qa/unit/data/tdf148714_CurvedArrows.ppt |binary
 svx/source/customshapes/EnhancedCustomShapeGeometry.cxx |   12 
 sw/qa/extras/ooxmlexport/data/tdf146346.docx|binary
 sw/qa/extras/ooxmlexport/ooxmlexport14.cxx  |9 
 sw/qa/extras/uiwriter/uiwriter3.cxx |   40 
 sw/source/core/fields/cellfml.cxx   |5 
 sw/source/core/table/swtable.cxx|3 
 sw/source/core/text/frmpaint.cxx|9 
 sw/source/core/text/porrst.cxx  |2 
 sw/source/ui/chrdlg/swuiccoll.cxx   |2 
 sw/uiconfig/swriter/ui/assignstylesdialog.ui|   16 
 sw/uiconfig/swriter/ui/conditionpage.ui |2 
 ucb/source/ucp/webdav-curl/CurlSession.cxx  |   79 
 ucb/source/ucp/webdav-curl/DAVProperties.cxx|3 
 ucb/source/ucp/webdav-curl/webdavcontent.cxx|4 
 ucb/source/ucp/webdav-curl/webdavresponseparser.cxx |   19 
 vcl/inc/fontinstance.hxx|   16 
 vcl/osx/salmenu.cxx |   22 
 vcl/qa/cppunit/text.cxx |4 
 vcl/source/font/PhysicalFontCollection.cxx  |   64 
 vcl/source/font/fontinstance.cxx|   19 
 vcl/source/outdev/text.cxx  |   19 
 vcl/source/window/status.cxx|8 
 writerfilter/source/dmapper/PropertyMap.cxx |   19 
 45 files changed, 2458 insertions(+), 2134 deletions(-)

New commits:
commit 760bc6a5e8a501d4ff986f22aa2360e0cbc2fd3c
Author: Andreas Heinisch 
AuthorDate: Sun May 8 14:31:00 2022 +0200
Commit: Andras Timar 
CommitDate: Fri May 13 16:41:11 2022 +0200

tdf#108188, tdf#131190 - Verify that the page style is actually used

Change-Id: I007d26c6fcaf60d2a2378cc00e630da447f95a8a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134022
Tested-by: Andreas Heinisch 
Reviewed-by: Andreas Heinisch 
(cherry picked from commit ad79900cd62c487bda9d2515892d62b3b08a5dfa)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134067
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 

diff --git a/sc/qa/unit/bugfix-test.cxx b/sc/qa/unit/bugfix-test.cxx
index b5b0c92a800e..73dabe55db58 100644
--- a/sc/qa/unit/bugfix-test.cxx
+++ b/sc/qa/unit/bugfix-test.cxx
@@ -29,6 +29,7 @@
 #include 
 #include 
 #include 
+#include 
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
@@ -63,6 +64,7 @@ public:
 void testTdf129789();
 void testTdf130725();
 void testTdf104502_hiddenColsCountedInPageCount();
+void testTdf108188_pagestyle();
 
 CPPUNIT_TEST_SUITE(ScFiltersTest);
 CPPUNIT_TEST(testTdf137576_Measureline);
@@ -87,6 +89,7 @@ public:
 CPPUNIT_TEST(testTdf129789);
 CPPUNIT_TEST(testTdf130725);
 CPPUNIT_TEST(testTdf104502_hiddenColsCountedInPageCount);
+CPPUNIT_TEST(testTdf108188_pagestyle);
 CPPUNIT_TEST_SUITE_END();
 
 private:
@@ -748,6 +751,24 @@ void 
ScFiltersTest::testTdf104502_hiddenColsCountedInPageCount()
 
 xShell->DoClose();
 }
+void ScFiltersTest::testTdf108188_pagestyle()
+{
+ScDocShellRef xDocSh = loadDoc(u"tdf108188_pagestyle.", FORMAT_ODS);
+CPPUNIT_ASSERT(xDocSh);
+
+// Check if the user defined page style is present
+const OUString aTestPageStyle = "TestPageStyle";
+ScDocument& rDoc = xDocSh->GetDocument();
+CPPUNIT_ASSERT_EQUAL(aTestPageStyle, rDoc.GetPageStyle(0));
+
+// Without the 

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

2022-05-11 Thread Andreas Heinisch (via logerrit)
 sc/qa/unit/bugfix-test.cxx  |   21 
 sc/qa/unit/data/ods/tdf108188_pagestyle.ods |binary
 sc/source/core/data/stlsheet.cxx|   35 +++-
 sfx2/source/dialog/StyleList.cxx|   15 
 4 files changed, 45 insertions(+), 26 deletions(-)

New commits:
commit 10c07e001da992cff4078c1cb1f49fdb16673ac3
Author: Andreas Heinisch 
AuthorDate: Sun May 8 14:31:00 2022 +0200
Commit: Xisco Fauli 
CommitDate: Wed May 11 09:56:12 2022 +0200

tdf#108188, tdf#131190 - Verify that the page style is actually used

Change-Id: I007d26c6fcaf60d2a2378cc00e630da447f95a8a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134022
Tested-by: Andreas Heinisch 
Reviewed-by: Andreas Heinisch 
(cherry picked from commit ad79900cd62c487bda9d2515892d62b3b08a5dfa)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134067
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 

diff --git a/sc/qa/unit/bugfix-test.cxx b/sc/qa/unit/bugfix-test.cxx
index 7fd56122216e..d2a4f71f3087 100644
--- a/sc/qa/unit/bugfix-test.cxx
+++ b/sc/qa/unit/bugfix-test.cxx
@@ -29,6 +29,7 @@
 #include 
 #include 
 #include 
+#include 
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
@@ -63,6 +64,7 @@ public:
 void testTdf129789();
 void testTdf130725();
 void testTdf104502_hiddenColsCountedInPageCount();
+void testTdf108188_pagestyle();
 
 CPPUNIT_TEST_SUITE(ScFiltersTest);
 CPPUNIT_TEST(testTdf137576_Measureline);
@@ -87,6 +89,7 @@ public:
 CPPUNIT_TEST(testTdf129789);
 CPPUNIT_TEST(testTdf130725);
 CPPUNIT_TEST(testTdf104502_hiddenColsCountedInPageCount);
+CPPUNIT_TEST(testTdf108188_pagestyle);
 CPPUNIT_TEST_SUITE_END();
 
 private:
@@ -748,6 +751,24 @@ void 
ScFiltersTest::testTdf104502_hiddenColsCountedInPageCount()
 
 xShell->DoClose();
 }
+void ScFiltersTest::testTdf108188_pagestyle()
+{
+ScDocShellRef xDocSh = loadDoc(u"tdf108188_pagestyle.", FORMAT_ODS);
+CPPUNIT_ASSERT(xDocSh);
+
+// Check if the user defined page style is present
+const OUString aTestPageStyle = "TestPageStyle";
+ScDocument& rDoc = xDocSh->GetDocument();
+CPPUNIT_ASSERT_EQUAL(aTestPageStyle, rDoc.GetPageStyle(0));
+
+// Without the accompanying fix in place, the page styles are always used
+ScStyleSheetPool* pStylePool = rDoc.GetStyleSheetPool();
+CPPUNIT_ASSERT(pStylePool->Find(aTestPageStyle, 
SfxStyleFamily::Page)->IsUsed());
+CPPUNIT_ASSERT(!pStylePool->Find("Default", 
SfxStyleFamily::Page)->IsUsed());
+
+xDocSh->DoClose();
+}
+
 
 ScFiltersTest::ScFiltersTest()
   : ScBootstrapFixture( "sc/qa/unit/data" )
diff --git a/sc/qa/unit/data/ods/tdf108188_pagestyle.ods 
b/sc/qa/unit/data/ods/tdf108188_pagestyle.ods
new file mode 100644
index ..d0ecf9f88453
Binary files /dev/null and b/sc/qa/unit/data/ods/tdf108188_pagestyle.ods differ
diff --git a/sc/source/core/data/stlsheet.cxx b/sc/source/core/data/stlsheet.cxx
index 5712bf883c78..ae113cc82e91 100644
--- a/sc/source/core/data/stlsheet.cxx
+++ b/sc/source/core/data/stlsheet.cxx
@@ -250,19 +250,32 @@ SfxItemSet& ScStyleSheet::GetItemSet()
 
 bool ScStyleSheet::IsUsed() const
 {
-if ( GetFamily() == SfxStyleFamily::Para )
+switch (GetFamily())
 {
-// Always query the document to let it decide if a rescan is necessary,
-// and store the state.
-ScDocument* pDoc = 
static_cast(m_pPool)->GetDocument();
-if ( pDoc && pDoc->IsStyleSheetUsed( *this ) )
-eUsage = Usage::USED;
-else
-eUsage = Usage::NOTUSED;
-return eUsage == Usage::USED;
+case SfxStyleFamily::Para:
+{
+// Always query the document to let it decide if a rescan is 
necessary,
+// and store the state.
+ScDocument* pDoc = 
static_cast(m_pPool)->GetDocument();
+if ( pDoc && pDoc->IsStyleSheetUsed( *this ) )
+eUsage = Usage::USED;
+else
+eUsage = Usage::NOTUSED;
+return eUsage == Usage::USED;
+}
+case SfxStyleFamily::Page:
+{
+// tdf#108188 - verify that the page style is actually used
+ScDocument* pDoc = 
static_cast(m_pPool)->GetDocument();
+if (pDoc && pDoc->IsPageStyleInUse(GetName(), nullptr))
+eUsage = Usage::USED;
+else
+eUsage = Usage::NOTUSED;
+return eUsage == Usage::USED;
+}
+default:
+return true;
 }
-else
-return true;
 }
 
 void ScStyleSheet::Notify( SfxBroadcaster&, const SfxHint& rHint )
diff --git a/sfx2/source/dialog/StyleList.cxx b/sfx2/source/dialog/StyleList.cxx
index 5b86a1033c49..f8bcf6ee1799 100644
--- a/sfx2/source/dialog/StyleList.cxx
+++ b/sfx2/source/dialog/StyleList.cxx
@@ -1335,21 +1335,6 @@ IMPL_LINK_NOARG(StyleList, EnableDelete, void*, 

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

2022-05-10 Thread Andreas Heinisch (via logerrit)
 sc/qa/unit/bugfix-test.cxx  |   21 
 sc/qa/unit/data/ods/tdf108188_pagestyle.ods |binary
 sc/source/core/data/stlsheet.cxx|   35 +++-
 sfx2/source/dialog/StyleList.cxx|   15 
 4 files changed, 45 insertions(+), 26 deletions(-)

New commits:
commit ad79900cd62c487bda9d2515892d62b3b08a5dfa
Author: Andreas Heinisch 
AuthorDate: Sun May 8 14:31:00 2022 +0200
Commit: Andreas Heinisch 
CommitDate: Tue May 10 20:30:56 2022 +0200

tdf#108188, tdf#131190 - Verify that the page style is actually used

Change-Id: I007d26c6fcaf60d2a2378cc00e630da447f95a8a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134022
Tested-by: Andreas Heinisch 
Reviewed-by: Andreas Heinisch 

diff --git a/sc/qa/unit/bugfix-test.cxx b/sc/qa/unit/bugfix-test.cxx
index 3b3cc27439df..2975b0b0a834 100644
--- a/sc/qa/unit/bugfix-test.cxx
+++ b/sc/qa/unit/bugfix-test.cxx
@@ -29,6 +29,7 @@
 #include 
 #include 
 #include 
+#include 
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
@@ -63,6 +64,7 @@ public:
 void testTdf129789();
 void testTdf130725();
 void testTdf104502_hiddenColsCountedInPageCount();
+void testTdf108188_pagestyle();
 
 CPPUNIT_TEST_SUITE(ScFiltersTest);
 CPPUNIT_TEST(testTdf137576_Measureline);
@@ -87,6 +89,7 @@ public:
 CPPUNIT_TEST(testTdf129789);
 CPPUNIT_TEST(testTdf130725);
 CPPUNIT_TEST(testTdf104502_hiddenColsCountedInPageCount);
+CPPUNIT_TEST(testTdf108188_pagestyle);
 CPPUNIT_TEST_SUITE_END();
 
 private:
@@ -726,6 +729,24 @@ void 
ScFiltersTest::testTdf104502_hiddenColsCountedInPageCount()
 
 xShell->DoClose();
 }
+void ScFiltersTest::testTdf108188_pagestyle()
+{
+ScDocShellRef xDocSh = loadDoc(u"tdf108188_pagestyle.", FORMAT_ODS);
+CPPUNIT_ASSERT(xDocSh);
+
+// Check if the user defined page style is present
+const OUString aTestPageStyle = "TestPageStyle";
+ScDocument& rDoc = xDocSh->GetDocument();
+CPPUNIT_ASSERT_EQUAL(aTestPageStyle, rDoc.GetPageStyle(0));
+
+// Without the accompanying fix in place, the page styles are always used
+ScStyleSheetPool* pStylePool = rDoc.GetStyleSheetPool();
+CPPUNIT_ASSERT(pStylePool->Find(aTestPageStyle, 
SfxStyleFamily::Page)->IsUsed());
+CPPUNIT_ASSERT(!pStylePool->Find("Default", 
SfxStyleFamily::Page)->IsUsed());
+
+xDocSh->DoClose();
+}
+
 
 ScFiltersTest::ScFiltersTest()
   : ScBootstrapFixture( "sc/qa/unit/data" )
diff --git a/sc/qa/unit/data/ods/tdf108188_pagestyle.ods 
b/sc/qa/unit/data/ods/tdf108188_pagestyle.ods
new file mode 100644
index ..d0ecf9f88453
Binary files /dev/null and b/sc/qa/unit/data/ods/tdf108188_pagestyle.ods differ
diff --git a/sc/source/core/data/stlsheet.cxx b/sc/source/core/data/stlsheet.cxx
index e485b5f7fc99..fdf09e7cde3e 100644
--- a/sc/source/core/data/stlsheet.cxx
+++ b/sc/source/core/data/stlsheet.cxx
@@ -250,19 +250,32 @@ SfxItemSet& ScStyleSheet::GetItemSet()
 
 bool ScStyleSheet::IsUsed() const
 {
-if ( GetFamily() == SfxStyleFamily::Para )
+switch (GetFamily())
 {
-// Always query the document to let it decide if a rescan is necessary,
-// and store the state.
-ScDocument* pDoc = 
static_cast(m_pPool)->GetDocument();
-if ( pDoc && pDoc->IsStyleSheetUsed( *this ) )
-eUsage = Usage::USED;
-else
-eUsage = Usage::NOTUSED;
-return eUsage == Usage::USED;
+case SfxStyleFamily::Para:
+{
+// Always query the document to let it decide if a rescan is 
necessary,
+// and store the state.
+ScDocument* pDoc = 
static_cast(m_pPool)->GetDocument();
+if ( pDoc && pDoc->IsStyleSheetUsed( *this ) )
+eUsage = Usage::USED;
+else
+eUsage = Usage::NOTUSED;
+return eUsage == Usage::USED;
+}
+case SfxStyleFamily::Page:
+{
+// tdf#108188 - verify that the page style is actually used
+ScDocument* pDoc = 
static_cast(m_pPool)->GetDocument();
+if (pDoc && pDoc->IsPageStyleInUse(GetName(), nullptr))
+eUsage = Usage::USED;
+else
+eUsage = Usage::NOTUSED;
+return eUsage == Usage::USED;
+}
+default:
+return true;
 }
-else
-return true;
 }
 
 void ScStyleSheet::Notify( SfxBroadcaster&, const SfxHint& rHint )
diff --git a/sfx2/source/dialog/StyleList.cxx b/sfx2/source/dialog/StyleList.cxx
index 6f8e3543aac8..a25050ead918 100644
--- a/sfx2/source/dialog/StyleList.cxx
+++ b/sfx2/source/dialog/StyleList.cxx
@@ -1321,21 +1321,6 @@ IMPL_LINK_NOARG(StyleList, EnableDelete, void*, void)
 {
 bEnableDelete = true;
 }
-else if (pStyle->GetFamily() == SfxStyleFamily::Page)
-{
-// Hack to 

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

2022-05-07 Thread Andreas Heinisch (via logerrit)
 basic/qa/basic_coverage/test_non_ascii_names.bas|9 ++
 basic/qa/basic_coverage/test_non_ascii_names_compatible.bas |   45 
 basic/qa/cppunit/test_vba.cxx   |1 
 basic/qa/vba_tests/tdf148358_non_ascii_names.vb |   33 
 basic/source/sbx/sbxarray.cxx   |5 +
 5 files changed, 92 insertions(+), 1 deletion(-)

New commits:
commit 90d33f5945336fa46b7c02f425100af794768b15
Author: Andreas Heinisch 
AuthorDate: Tue May 3 20:38:37 2022 +0200
Commit: Andreas Heinisch 
CommitDate: Sat May 7 16:00:50 2022 +0200

tdf#148358 - Compare Non-ASCII variable names case-insensitive

Change-Id: I761eb27b16c92d58df1be8e6011fc9b94db2a59c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133774
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 

diff --git a/basic/qa/basic_coverage/test_non_ascii_names.bas 
b/basic/qa/basic_coverage/test_non_ascii_names.bas
index a9ef0f159da2..c85c9cae12cb 100644
--- a/basic/qa/basic_coverage/test_non_ascii_names.bas
+++ b/basic/qa/basic_coverage/test_non_ascii_names.bas
@@ -17,11 +17,20 @@ Function [Функция]([])
   [Функция] = [] & " and some text"
 End Function
 
+Function TestNonAsciiNative as Integer
+Dim [Абв] as Integer
+[Абв] = 5
+TestNonAsciiNative = [абв]
+End Function
+
 Sub [Prüfung]
   On Error GoTo errorHandler
 
   TestUtil.AssertEqual([Функция]("Smiley"), "Smiley and some text", 
"[Функция](""Smiley"")")
 
+  ' tdf#148358 - compare Non-ASCII variable names case-insensitive
+  TestUtil.AssertEqual(TestNonAsciiNative(), 5, "TestNonAsciiNative()")
+
   Exit Sub
 errorHandler:
   TestUtil.ReportErrorHandler("Prüfung", Err, Error$, Erl)
diff --git a/basic/qa/basic_coverage/test_non_ascii_names_compatible.bas 
b/basic/qa/basic_coverage/test_non_ascii_names_compatible.bas
new file mode 100644
index ..1abc272443c5
--- /dev/null
+++ b/basic/qa/basic_coverage/test_non_ascii_names_compatible.bas
@@ -0,0 +1,45 @@
+'
+' 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/.
+'
+
+Option Compatible
+Option Explicit
+
+Function doUnitTest as String
+  [Prüfung]
+  doUnitTest = TestUtil.GetResult()
+End Function
+
+Function [Функция]([])
+  [Функция] = [] & " and some text"
+End Function
+
+Function TestNonAscii as Integer
+Dim Абв as Integer
+Абв = 10
+TestNonAscii = абв
+End Function
+
+Function TestNonAsciiNative as Integer
+Dim [Абв] as Integer
+[Абв] = 5
+TestNonAsciiNative = [абв]
+End Function
+
+Sub [Prüfung]
+  On Error GoTo errorHandler
+
+  TestUtil.AssertEqual([Функция]("Smiley"), "Smiley and some text", 
"[Функция](""Smiley"")")
+
+  ' tdf#148358 - compare Non-ASCII variable names case-insensitive
+  TestUtil.AssertEqual(TestNonAscii(), 10, "TestNonAscii()")
+  TestUtil.AssertEqual(TestNonAsciiNative(), 5, "TestNonAsciiNative()")
+
+  Exit Sub
+errorHandler:
+  TestUtil.ReportErrorHandler("Prüfung Compatible", Err, Error$, Erl)
+End Sub
diff --git a/basic/qa/cppunit/test_vba.cxx b/basic/qa/cppunit/test_vba.cxx
index 6ac6974fc081..07e4287e17b1 100644
--- a/basic/qa/cppunit/test_vba.cxx
+++ b/basic/qa/cppunit/test_vba.cxx
@@ -136,6 +136,7 @@ void VBATest::testMiscVBAFunctions()
 "strreverse.vb",
 "switch.vb",
 "tdf147089_idiv.vb",
+"tdf148358_non_ascii_names.vb",
 "timeserial.vb",
 "timevalue.vb",
 "trim.vb",
diff --git a/basic/qa/vba_tests/tdf148358_non_ascii_names.vb 
b/basic/qa/vba_tests/tdf148358_non_ascii_names.vb
new file mode 100644
index ..95e7105407f5
--- /dev/null
+++ b/basic/qa/vba_tests/tdf148358_non_ascii_names.vb
@@ -0,0 +1,33 @@
+'
+' 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/.
+'
+
+Option VBASupport 1
+Option Explicit
+
+Function doUnitTest as String
+  TestUtil.TestInit
+  verify_testNonAsciiNames
+  doUnitTest = TestUtil.GetResult()
+End Function
+
+Function TestNonAscii as Integer
+Dim Абв as Integer
+Абв = 10
+TestNonAscii = абв
+End Function
+
+Sub verify_testNonAsciiNames
+  On Error GoTo errorHandler
+
+  ' tdf#148358 - compare Non-ASCII variable names case-insensitive
+  TestUtil.AssertEqual(TestNonAscii(), 10, "TestNonAscii()")
+
+  Exit Sub
+errorHandler:
+  TestUtil.ReportErrorHandler("verify_testNonAsciiNames", Err, Error$, Erl)
+End Sub
diff --git a/basic/source/sbx/sbxarray.cxx b/basic/source/sbx/sbxarray.cxx
index d8f16f5891c1..5f70345e6f2a 100644
--- a/basic/source/sbx/sbxarray.cxx
+++ b/basic/source/sbx/sbxarray.cxx
@@ -277,6 +277,8 @@ SbxVariable* SbxArray::Find( const OUString& 

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

2022-05-07 Thread Andreas Heinisch (via logerrit)
 fpicker/source/office/PlacesListBox.cxx   |   12 
 fpicker/source/office/PlacesListBox.hxx   |1 +
 fpicker/uiconfig/ui/explorerfiledialog.ui |2 ++
 3 files changed, 15 insertions(+)

New commits:
commit 9313b6c02cc40633edfaadfc7941cbb5640368b2
Author: Andreas Heinisch 
AuthorDate: Mon May 2 19:31:26 2022 +0200
Commit: Andreas Heinisch 
CommitDate: Sat May 7 11:09:32 2022 +0200

tdf#62776 - Add tooltip for folder location shortcuts

Change-Id: I326fd3c3695e5467a49688fc2164fe591aef2397
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133709
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 

diff --git a/fpicker/source/office/PlacesListBox.cxx 
b/fpicker/source/office/PlacesListBox.cxx
index 050cee39c113..86bd505179a3 100644
--- a/fpicker/source/office/PlacesListBox.cxx
+++ b/fpicker/source/office/PlacesListBox.cxx
@@ -29,6 +29,7 @@ PlacesListBox::PlacesListBox(std::unique_ptr 
xControl,
 
 mxImpl->connect_changed( LINK( this, PlacesListBox, Selection ) );
 mxImpl->connect_row_activated( LINK( this, PlacesListBox, DoubleClick ) ) ;
+mxImpl->connect_query_tooltip(LINK(this, PlacesListBox, QueryTooltipHdl));
 }
 
 PlacesListBox::~PlacesListBox( )
@@ -136,6 +137,17 @@ IMPL_LINK_NOARG( PlacesListBox, DoubleClick, 
weld::TreeView&, bool )
 return true;
 }
 
+IMPL_LINK(PlacesListBox, QueryTooltipHdl, const weld::TreeIter&, rIter, 
OUString)
+{
+const OUString sText = mxImpl->get_text(rIter);
+for (const auto& pPlace : maPlaces)
+{
+if (pPlace->GetName() == sText)
+return 
pPlace->GetUrlObject().GetMainURL(INetURLObject::DecodeMechanism::Unambiguous);
+}
+return OUString();
+}
+
 void PlacesListBox::updateView( )
 {
 sal_uInt32 nSelected = mxImpl->get_cursor_index();
diff --git a/fpicker/source/office/PlacesListBox.hxx 
b/fpicker/source/office/PlacesListBox.hxx
index ca507e06ae3a..ed3a0798e9e7 100644
--- a/fpicker/source/office/PlacesListBox.hxx
+++ b/fpicker/source/office/PlacesListBox.hxx
@@ -60,6 +60,7 @@ private:
 
 DECL_LINK( Selection, weld::TreeView&, void );
 DECL_LINK( DoubleClick, weld::TreeView&, bool );
+DECL_LINK(QueryTooltipHdl, const weld::TreeIter&, OUString);
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/uiconfig/ui/explorerfiledialog.ui 
b/fpicker/uiconfig/ui/explorerfiledialog.ui
index 1817d785c814..84a50b05d91c 100644
--- a/fpicker/uiconfig/ui/explorerfiledialog.ui
+++ b/fpicker/uiconfig/ui/explorerfiledialog.ui
@@ -293,6 +293,7 @@
 True
 True
 True
+Add shortcut
 image1
 True
   
@@ -307,6 +308,7 @@
 True
 True
 True
+Delete shortcut
 image2
 True
   


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

2022-04-21 Thread Andreas Heinisch (via logerrit)
 sc/qa/uitest/calc_tests9/tdf148437.py |   53 ++
 sc/source/ui/view/tabvwshe.cxx|3 +
 2 files changed, 55 insertions(+), 1 deletion(-)

New commits:
commit 66365e9fb2105c98f7bf16152fb4910f605dae78
Author: Andreas Heinisch 
AuthorDate: Sun Apr 10 18:36:01 2022 +0200
Commit: Andreas Heinisch 
CommitDate: Thu Apr 21 10:01:25 2022 +0200

tdf#148437 - Hyperlink: Replace entire content if cell contains a formula

Inserting a hyperlink through the hyperlink dialog should replace the
content of the entire cell if it contains a formula.

Change-Id: I2e06f134bfcd21ec3fef76f2a9b80e433adce1f6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132785
Tested-by: Jenkins
Tested-by: Heiko Tietze 
Reviewed-by: Heiko Tietze 

diff --git a/sc/qa/uitest/calc_tests9/tdf148437.py 
b/sc/qa/uitest/calc_tests9/tdf148437.py
new file mode 100644
index ..d457b2324892
--- /dev/null
+++ b/sc/qa/uitest/calc_tests9/tdf148437.py
@@ -0,0 +1,53 @@
+# -*- 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.calc import enter_text_to_cell
+from uitest.uihelper.common import get_state_as_dict, select_pos
+
+class tdf148437(UITestCase):
+def test_tdf148437_formula_cell(self):
+with self.ui_test.create_doc_in_start_center("calc") as document:
+xCalcDoc = self.xUITest.getTopFocusWindow()
+xGridWindow = xCalcDoc.getChild("grid_window")
+
+# Select a cell including a formula and insert a hyperlink
+enter_text_to_cell(xGridWindow, "A1", 
"=HYPERLINK(\"www.libreoffice.org\";\"LibreOffice\")")
+# Move focus to ensure cell is not in edit mode
+xGridWindow.executeAction("SELECT", mkPropertyValues({"CELL": 
"A2"}))
+xGridWindow.executeAction("SELECT", mkPropertyValues({"CELL": 
"A1"}))
+with 
self.ui_test.execute_dialog_through_command(".uno:HyperlinkDialog") as xDialog:
+xTab = xDialog.getChild("tabcontrol")
+select_pos(xTab, "0")
+
+# Text should contain the text of the cell
+xTarget = xDialog.getChild("target")
+self.assertEqual(get_state_as_dict(xTarget)["Text"], "")
+xIndication = xDialog.getChild("indication")
+self.assertEqual(get_state_as_dict(xIndication)["Text"], 
"LibreOffice")
+
+# Insert a sample hyperlink
+xTarget.executeAction("TYPE", mkPropertyValues({"TEXT": 
"https://www.documentfoundation.org/"}))
+xIndication.executeAction("TYPE", 
mkPropertyValues({"KEYCODE":"CTRL+A"}))
+xIndication.executeAction("TYPE", mkPropertyValues({"TEXT": 
"LibreOffice Document Foundation"}))
+
+# Move focus to ensure cell is not in edit mode
+xGridWindow.executeAction("SELECT", mkPropertyValues({"CELL": 
"A2"}))
+xGridWindow.executeAction("SELECT", mkPropertyValues({"CELL": 
"A1"}))
+
+# Check contents of the cell
+xCell = get_cell_by_position(document, 0, 0, 0)
+self.assertEqual(xCell.getString(), "LibreOffice Document 
Foundation")
+xTextFields = xCell.getTextFields()
+self.assertEqual(xTextFields.getCount(), 1)
+self.assertEqual(xTextFields.getByIndex(0).URL, 
"https://www.documentfoundation.org/;)
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/source/ui/view/tabvwshe.cxx b/sc/source/ui/view/tabvwshe.cxx
index fa3587dd70cc..d32500b74800 100644
--- a/sc/source/ui/view/tabvwshe.cxx
+++ b/sc/source/ui/view/tabvwshe.cxx
@@ -92,7 +92,8 @@ OUString ScTabViewShell::GetSelectionText( bool bWholeWord )
 }
 
 ScImportExport aObj( rDoc, aRange );
-aObj.SetFormulas( GetViewData().GetOptions().GetOption( 
VOPT_FORMULAS ) );
+// tdf#148437 - if cell contains a formula, overwrite entire 
content of the cell
+aObj.SetFormulas(true);
 OUString aExportOUString;
 /* TODO: STRING_TSVC under some circumstances? */
 aObj.ExportString( aExportOUString, SotClipboardFormatId::STRING );


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

2022-04-12 Thread Andreas Heinisch (via logerrit)
 sw/qa/uitest/writer_tests3/specialCharacter.py |7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit e38374b15be9ea4ced36a9b5954de1dc18ba2943
Author: Andreas Heinisch 
AuthorDate: Mon Apr 11 17:40:57 2022 +0100
Commit: Andreas Heinisch 
CommitDate: Tue Apr 12 08:06:40 2022 +0200

tdf#56363 - UI test fails if the selected font is not present
Change-Id: Ic8ff99464b435169460d678590896decc91f5152
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132712
Tested-by: Andreas Heinisch 
Reviewed-by: Andreas Heinisch 

diff --git a/sw/qa/uitest/writer_tests3/specialCharacter.py 
b/sw/qa/uitest/writer_tests3/specialCharacter.py
index 494875024c1e..c9e4299f2c1d 100644
--- a/sw/qa/uitest/writer_tests3/specialCharacter.py
+++ b/sw/qa/uitest/writer_tests3/specialCharacter.py
@@ -21,15 +21,16 @@ class specialCharacter(UITestCase):
 
 # Insert a font including a font feature into the font name 
combobox
 xFontName = xWriterDoc.getChild("fontnamecombobox")
-xFontName.executeAction("TYPE", 
mkPropertyValues({"KEYCODE":"CTRL+A"}))
-xFontName.executeAction("TYPE", 
mkPropertyValues({"TEXT":"Liberation Sans:smcp"}))
+fontName = get_state_as_dict(xFontName)["Text"]
+xFontName.executeAction("TYPE", mkPropertyValues({"KEYCODE": 
"CTRL+A"}))
+xFontName.executeAction("TYPE", mkPropertyValues({"TEXT": fontName 
+ ":smcp"}))
 xFontName.executeAction("TYPE", mkPropertyValues({"KEYCODE": 
"RETURN"}))
 
 # Open special character dialog and check selected font name
 with 
self.ui_test.execute_dialog_through_command(".uno:InsertSymbol", 
close_button="cancel") as xDialog:
 xComboFont = xDialog.getChild("fontlb")
 # Without the fix in place, no font would be selected
-self.assertEqual(get_state_as_dict(xComboFont)["Text"], 
"Liberation Sans")
+self.assertEqual(get_state_as_dict(xComboFont)["Text"], 
fontName)
 
 def test_special_character(self):
 with self.ui_test.create_doc_in_start_center("writer") as document:


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

2022-04-09 Thread Andreas Heinisch (via logerrit)
 cui/source/dialogs/cuicharmap.cxx  |   12 
 sw/qa/uitest/writer_tests3/specialCharacter.py |   17 -
 2 files changed, 24 insertions(+), 5 deletions(-)

New commits:
commit 7a2bd19355d78551f9ce253fca69d37881d1d1c1
Author: Andreas Heinisch 
AuthorDate: Tue Mar 22 21:12:09 2022 +0100
Commit: Andreas Heinisch 
CommitDate: Sat Apr 9 14:31:09 2022 +0200

tdf#56363 - Search font family without the font feature after the colon

In the special character dialog, search font family without the font
feature after the colon in order to find the correct item in the font
combobox.

Change-Id: I60d068bb22782bcce062365a8d4d53e15ec34c76
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131953
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 

diff --git a/cui/source/dialogs/cuicharmap.cxx 
b/cui/source/dialogs/cuicharmap.cxx
index 95678899df90..42c12c5e3ce9 100644
--- a/cui/source/dialogs/cuicharmap.cxx
+++ b/cui/source/dialogs/cuicharmap.cxx
@@ -477,7 +477,7 @@ void SvxCharacterMap::init()
 // the font may not be in the list =>
 // try to find a font name token in list and select found font,
 // else select topmost entry
-bool bFound = (m_xFontLB->find_text(aDefStr) == -1);
+bool bFound = (m_xFontLB->find_text(aDefStr) != -1);
 if (!bFound)
 {
 sal_Int32 nIndex = 0;
@@ -611,17 +611,21 @@ void SvxCharacterMap::SetCharFont( const vcl::Font& rFont 
)
 // like "Times New Roman;Times" resolved
 vcl::Font aTmp(m_xVirDev->GetFontMetric(rFont));
 
-if (aTmp.GetFamilyName() == "StarSymbol" && 
m_xFontLB->find_text(aTmp.GetFamilyName()) == -1)
+// tdf#56363 - search font family without the font feature after the colon
+OUString sFontFamilyName = aTmp.GetFamilyName();
+if (const sal_Int32 nIndex = sFontFamilyName.indexOf(":"); nIndex != -1)
+sFontFamilyName = sFontFamilyName.copy(0, nIndex);
+if (sFontFamilyName == "StarSymbol" && 
m_xFontLB->find_text(sFontFamilyName) == -1)
 {
 //if for some reason, like font in an old document, StarSymbol is 
requested and it's not available, then
 //try OpenSymbol instead
 aTmp.SetFamilyName("OpenSymbol");
 }
 
-if (m_xFontLB->find_text(aTmp.GetFamilyName()) == -1)
+if (m_xFontLB->find_text(sFontFamilyName) == -1)
 return;
 
-m_xFontLB->set_active_text(aTmp.GetFamilyName());
+m_xFontLB->set_active_text(sFontFamilyName);
 aFont = aTmp;
 FontSelectHdl(*m_xFontLB);
 if (m_xSubsetLB->get_count())
diff --git a/sw/qa/uitest/writer_tests3/specialCharacter.py 
b/sw/qa/uitest/writer_tests3/specialCharacter.py
index 577b8b531984..494875024c1e 100644
--- a/sw/qa/uitest/writer_tests3/specialCharacter.py
+++ b/sw/qa/uitest/writer_tests3/specialCharacter.py
@@ -12,10 +12,25 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
 from uitest.uihelper.common import get_state_as_dict
 from uitest.uihelper.common import select_pos
 
-
 # specialcharacters.ui
 class specialCharacter(UITestCase):
 
+def test_tdf56363(self):
+with self.ui_test.create_doc_in_start_center("writer") as document:
+xWriterDoc = self.xUITest.getTopFocusWindow()
+
+# Insert a font including a font feature into the font name 
combobox
+xFontName = xWriterDoc.getChild("fontnamecombobox")
+xFontName.executeAction("TYPE", 
mkPropertyValues({"KEYCODE":"CTRL+A"}))
+xFontName.executeAction("TYPE", 
mkPropertyValues({"TEXT":"Liberation Sans:smcp"}))
+xFontName.executeAction("TYPE", mkPropertyValues({"KEYCODE": 
"RETURN"}))
+
+# Open special character dialog and check selected font name
+with 
self.ui_test.execute_dialog_through_command(".uno:InsertSymbol", 
close_button="cancel") as xDialog:
+xComboFont = xDialog.getChild("fontlb")
+# Without the fix in place, no font would be selected
+self.assertEqual(get_state_as_dict(xComboFont)["Text"], 
"Liberation Sans")
+
 def test_special_character(self):
 with self.ui_test.create_doc_in_start_center("writer") as document:
 


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

2022-04-07 Thread Andreas Heinisch (via logerrit)
 sc/qa/uitest/calc_tests9/tdf80043.py |  243 +++
 sc/source/ui/view/cellsh.cxx |8 +
 sc/source/ui/view/tabvwshe.cxx   |   11 -
 3 files changed, 254 insertions(+), 8 deletions(-)

New commits:
commit 803c9a6f8d8681e1862e4132dbbc8cdb2f61b7b6
Author: Andreas Heinisch 
AuthorDate: Mon Mar 7 22:30:13 2022 +0100
Commit: Andreas Heinisch 
CommitDate: Thu Apr 7 11:31:28 2022 +0200

tdf#80043 - Put selected text into hyperlink item

If the user selects an entire cell by a single click, and inserts an URL
via the hyperlink dialog, the entire content of the corresponding cell
will be replaced instead of inserting a duplicate, or appending the URL.
If the cell contains more than one URL or an URL including some
additional text within the cell, the hyperlink dialog will only
preselect the text field when opening. If this is not the case, it fill the 
URL field as well.

Change-Id: I9a10c3f302a6cf91a4d9dfadfbe775075eb00fad
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131156
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 

diff --git a/sc/qa/uitest/calc_tests9/tdf80043.py 
b/sc/qa/uitest/calc_tests9/tdf80043.py
new file mode 100644
index ..eb99f0038871
--- /dev/null
+++ b/sc/qa/uitest/calc_tests9/tdf80043.py
@@ -0,0 +1,243 @@
+# -*- 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.calc import enter_text_to_cell
+from uitest.uihelper.common import get_state_as_dict, select_pos
+
+class tdf80043(UITestCase):
+def test_tdf80043_empty_cell(self):
+with self.ui_test.create_doc_in_start_center("calc") as document:
+xCalcDoc = self.xUITest.getTopFocusWindow()
+xGridWindow = xCalcDoc.getChild("grid_window")
+
+# Select an empty cell and insert a hyperlink
+xGridWindow.executeAction("SELECT", mkPropertyValues({"CELL": 
"A1"}))
+with 
self.ui_test.execute_dialog_through_command(".uno:HyperlinkDialog") as xDialog:
+xTab = xDialog.getChild("tabcontrol")
+select_pos(xTab, "0")
+
+# Both fields in the hyperlink dialog should be empty
+xTarget = xDialog.getChild("target")
+self.assertEqual(get_state_as_dict(xTarget)["Text"], "")
+xIndication = xDialog.getChild("indication")
+self.assertEqual(get_state_as_dict(xIndication)["Text"], "")
+
+# Insert a sample hyperlink
+xTarget.executeAction("TYPE", mkPropertyValues({"TEXT": 
"http://www.libreoffice.org/"}))
+xIndication.executeAction("TYPE", mkPropertyValues({"TEXT": 
"LibreOffice"}))
+
+# Move focus to ensure cell is not in edit mode
+xGridWindow.executeAction("SELECT", mkPropertyValues({"CELL": 
"A2"}))
+xGridWindow.executeAction("SELECT", mkPropertyValues({"CELL": 
"A1"}))
+
+# Check contents of the cell
+xCell = get_cell_by_position(document, 0, 0, 0)
+self.assertEqual(xCell.getString(), "LibreOffice")
+xTextFields = xCell.getTextFields()
+self.assertEqual(xTextFields.getCount(), 1)
+self.assertEqual(xTextFields.getByIndex(0).URL, 
"http://www.libreoffice.org/;)
+
+# Reopen hyperlink dialog and check the target and the indication 
of the hyperlink
+with 
self.ui_test.execute_dialog_through_command(".uno:HyperlinkDialog", 
close_button="cancel") as xDialog:
+xTab = xDialog.getChild("tabcontrol")
+select_pos(xTab, "0")
+
+# Text should contain the text of the cell
+xTarget = xDialog.getChild("target")
+self.assertEqual(get_state_as_dict(xTarget)["Text"], 
"http://www.libreoffice.org/;)
+xIndication = xDialog.getChild("indication")
+self.assertEqual(get_state_as_dict(xIndication)["Text"], 
"LibreOffice")
+
+def test_tdf80043_text_cell(self):
+with self.ui_test.create_doc_in_start_center("calc") as document:
+xCalcDoc = self.xUITest.getTopFocusWindow()
+xGridWindow = xCalcDoc.getChild("grid_window")
+
+# Select a cell including a text and insert a hyperlink
+enter_text_to_cell(xGridWindow, "A1", "LibreOffice")
+# Move focus to ensure cell is not in edit mode
+xGridWindow.executeAction("SELECT", mkPropertyValues({"CELL": 
"A2"}))
+

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

2022-03-31 Thread Andreas Heinisch (via logerrit)
 sw/source/core/doc/doctxm.cxx |  102 --
 1 file changed, 89 insertions(+), 13 deletions(-)

New commits:
commit 1cac7d18ab8561f129a30d6c93c0f9f1d7868e01
Author: Andreas Heinisch 
AuthorDate: Tue Nov 23 17:48:37 2021 +0100
Commit: Ilmari Lauhakangas 
CommitDate: Thu Mar 31 16:34:19 2022 +0200

tdf#130318 - Use the actual cursor position to create ToC "for chapter"

Use the actual cursor position to create ToC "for chapter" beginning at
the current level.

Change-Id: I92e7c440005d52c517efa7e64a61c58da9db3197
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125727
Tested-by: Jenkins
Reviewed-by: Ilmari Lauhakangas 

diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx
index 91fbbc03fe56..828742c0e37c 100644
--- a/sw/source/core/doc/doctxm.cxx
+++ b/sw/source/core/doc/doctxm.cxx
@@ -737,6 +737,87 @@ static const SwTextNode* lcl_FindChapterNode( const 
SwNode& rNd,
 return pNd ? pNd->FindOutlineNodeOfLevel(nLvl, pLayout) : nullptr;
 }
 
+static bool IsHeadingContained(const SwTextNode* pChptrNd, const SwNode& rNd)
+{
+const SwNode* pNd = 
+const SwOutlineNodes& rONds = pNd->GetNodes().GetOutLineNds();
+bool bIsHeadingContained = false;
+if (!rONds.empty())
+{
+bool bCheckFirst = false;
+SwOutlineNodes::size_type nPos;
+
+if (!rONds.Seek_Entry(const_cast(pNd), ))
+{
+if (nPos == 0)
+bCheckFirst = true;
+else
+nPos--;
+}
+
+if (bCheckFirst)
+{
+const SwContentNode* pCNd = pNd->GetContentNode();
+
+Point aPt(0, 0);
+std::pair const tmp(aPt, false);
+
+const SwFrame* pChptrFrame = pChptrNd->getLayoutFrame(
+
pChptrNd->GetDoc().getIDocumentLayoutAccess().GetCurrentLayout(), nullptr, 
);
+const SwPageFrame* pChptrPgFrame = pChptrFrame ? 
pChptrFrame->FindPageFrame() : nullptr;
+const SwFrame* pNdFrame
+= pCNd ? pCNd->getLayoutFrame(
+  
pCNd->GetDoc().getIDocumentLayoutAccess().GetCurrentLayout(), nullptr, )
+   : nullptr;
+
+// Check if the one asking doesn't precede the page of the 
specified chapter note
+bIsHeadingContained
+= pNdFrame && pChptrPgFrame
+  && pChptrPgFrame->getFrameArea().Top() <= 
pNdFrame->getFrameArea().Top();
+// Check if the one asking doesn't succeed the specified chapter 
note
+if (bIsHeadingContained)
+{
+const SwNode* aChptrNd = pChptrNd;
+if (!rONds.Seek_Entry(const_cast(aChptrNd), ) && 
nPos)
+nPos--;
+// Search for the next outline node with a larger level than 
the specified chapter node
+while (nPos < rONds.size() - 1
+   && pChptrNd->GetAttrOutlineLevel()
+  < rONds[nPos + 
1]->GetTextNode()->GetAttrOutlineLevel())
+nPos++;
+// If there exists such an outline node, check if the one 
asking doesn't succeed
+// the specified chapter node
+if (nPos < rONds.size() - 1) {
+nPos++;
+const auto aONdsTxtNd = rONds[nPos]->GetTextNode();
+pChptrFrame = aONdsTxtNd->getLayoutFrame(
+
aONdsTxtNd->GetDoc().getIDocumentLayoutAccess().GetCurrentLayout(), nullptr,
+);
+pChptrPgFrame = pChptrFrame ? pChptrFrame->FindPageFrame() 
: nullptr;
+bIsHeadingContained
+= pNdFrame && pChptrPgFrame
+  && pChptrPgFrame->getFrameArea().Top() >= 
pNdFrame->getFrameArea().Top();
+}
+}
+}
+else
+{
+// Search for the next outline node which lies not within the 
current chapter node
+while (pChptrNd->GetAttrOutlineLevel()
+   < rONds[nPos]->GetTextNode()->GetAttrOutlineLevel())
+nPos--;
+bIsHeadingContained = pChptrNd == rONds[nPos]->GetTextNode();
+}
+}
+else
+{
+// If there are no outline nodes, consider the heading contained,
+// otherwise the _XDocumentIndex._update() test fails
+bIsHeadingContained = true;
+}
+return bIsHeadingContained;
+}
+
 // Table of contents class
 SwTOXBaseSection::SwTOXBaseSection(SwTOXBase const& rBase, SwSectionFormat & 
rFormat)
 : SwTOXBase( rBase )
@@ -855,8 +936,8 @@ void SwTOXBaseSection::Update(const SfxItemSet* pAttr,
 // find the first layout node for this TOX, if it only find the content
 // in his own chapter
 const SwTextNode* pOwnChapterNode = IsFromChapter()
-? ::lcl_FindChapterNode( *pSectNd, pLayout )
-  

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

2022-03-25 Thread Andreas Heinisch (via logerrit)
 connectivity/source/drivers/firebird/ResultSetMetaData.cxx |   12 -
 dbaccess/qa/unit/data/tdf132924.odb|binary
 dbaccess/qa/unit/firebird.cxx  |   28 +
 3 files changed, 37 insertions(+), 3 deletions(-)

New commits:
commit 4590048952a9e62124641c512dc2d19122f7fb2d
Author: Andreas Heinisch 
AuthorDate: Wed Mar 23 21:14:46 2022 +0100
Commit: Andreas Heinisch 
CommitDate: Fri Mar 25 13:37:57 2022 +0100

tdf#132924 - Firebird findColumn: return column alias if specified

The function findColumn in a Basic macro should also find aliases for
columns specified in an SQL query using a Firebird database.

Change-Id: I96adb2564da1e18cee58f1c6803526d8ff4deabb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131990
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 

diff --git a/connectivity/source/drivers/firebird/ResultSetMetaData.cxx 
b/connectivity/source/drivers/firebird/ResultSetMetaData.cxx
index 78d684a725a2..5653d29c4211 100644
--- a/connectivity/source/drivers/firebird/ResultSetMetaData.cxx
+++ b/connectivity/source/drivers/firebird/ResultSetMetaData.cxx
@@ -128,9 +128,15 @@ OUString SAL_CALL 
OResultSetMetaData::getSchemaName(sal_Int32)
 OUString SAL_CALL OResultSetMetaData::getColumnName(sal_Int32 column)
 {
 verifyValidColumn(column);
-OUString sRet(m_pSqlda->sqlvar[column-1].sqlname,
-m_pSqlda->sqlvar[column-1].sqlname_length,
-RTL_TEXTENCODING_UTF8);
+char* pColumnName = m_pSqlda->sqlvar[column - 1].sqlname;
+sal_Int32 nColumnNameLength = m_pSqlda->sqlvar[column - 1].sqlname_length;
+// tdf#132924 - return column alias if specified
+if (m_pSqlda->sqlvar[column - 1].aliasname_length > 0)
+{
+pColumnName = m_pSqlda->sqlvar[column - 1].aliasname;
+nColumnNameLength = m_pSqlda->sqlvar[column - 1].aliasname_length;
+}
+OUString sRet(pColumnName, nColumnNameLength, RTL_TEXTENCODING_UTF8);
 sanitizeIdentifier(sRet);
 return sRet;
 }
diff --git a/dbaccess/qa/unit/data/tdf132924.odb 
b/dbaccess/qa/unit/data/tdf132924.odb
new file mode 100644
index ..8cee7bcbabfd
Binary files /dev/null and b/dbaccess/qa/unit/data/tdf132924.odb differ
diff --git a/dbaccess/qa/unit/firebird.cxx b/dbaccess/qa/unit/firebird.cxx
index e67a4d10c097..7a8143810097 100644
--- a/dbaccess/qa/unit/firebird.cxx
+++ b/dbaccess/qa/unit/firebird.cxx
@@ -27,10 +27,12 @@ class FirebirdTest
 public:
 void testEmptyDBConnection();
 void testIntegerDatabase();
+void testTdf132924();
 
 CPPUNIT_TEST_SUITE(FirebirdTest);
 CPPUNIT_TEST(testEmptyDBConnection);
 CPPUNIT_TEST(testIntegerDatabase);
+CPPUNIT_TEST(testTdf132924);
 CPPUNIT_TEST_SUITE_END();
 };
 
@@ -90,6 +92,32 @@ void FirebirdTest::testIntegerDatabase()
 closeDocument(uno::Reference(xDocument, uno::UNO_QUERY));
 }
 
+void FirebirdTest::testTdf132924()
+{
+uno::Reference xDocument = 
getDocumentForFileName(u"tdf132924.odb");
+uno::Reference xConnection = 
getConnectionForDocument(xDocument);
+
+uno::Reference xStatement = xConnection->createStatement();
+CPPUNIT_ASSERT(xStatement.is());
+
+uno::Reference xResultSet = xStatement->executeQuery("SELECT * 
FROM AliasTest");
+CPPUNIT_ASSERT(xResultSet.is());
+CPPUNIT_ASSERT(xResultSet->next());
+
+uno::Reference xRow(xResultSet, UNO_QUERY);
+CPPUNIT_ASSERT(xRow.is());
+uno::Reference xColumnLocate(xRow, UNO_QUERY);
+CPPUNIT_ASSERT(xColumnLocate.is());
+
+// Without the fix in place, this test would have failed with:
+// - Expected: 1
+// - Actual  : The column name 'TestId' is not valid
+CPPUNIT_ASSERT_EQUAL(sal_Int16(1), 
xRow->getShort(xColumnLocate->findColumn("TestId")));
+CPPUNIT_ASSERT_EQUAL(OUString("TestName"), 
xRow->getString(xColumnLocate->findColumn("TestName")));
+
+closeDocument(uno::Reference(xDocument, uno::UNO_QUERY));
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(FirebirdTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();


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

2022-03-23 Thread Andreas Heinisch (via logerrit)
 include/vcl/customweld.hxx  |1 +
 sfx2/source/control/charwin.cxx |3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 37c1eae8a36e346efc076d90bf69cc03f345e3da
Author: Andreas Heinisch 
AuthorDate: Thu Mar 17 21:14:10 2022 +0100
Commit: Xisco Fauli 
CommitDate: Wed Mar 23 09:33:15 2022 +0100

tdf#111924 - Special characters: don't lose focus on context menu

Don't lose focus on the favorite or recently used items in the special
characters dialog when right-clicking them to show the context menu.

Change-Id: Iaedc4bbc6fb627591b9c0cd9a2c44940312eeb1d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131721
Tested-by: Andreas Heinisch 
Reviewed-by: Andreas Heinisch 
(cherry picked from commit ce3e760f9155ac8d80f60054be036e862df7029a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131858
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 

diff --git a/include/vcl/customweld.hxx b/include/vcl/customweld.hxx
index a96d8c5522fe..e37555b36777 100644
--- a/include/vcl/customweld.hxx
+++ b/include/vcl/customweld.hxx
@@ -65,6 +65,7 @@ public:
 virtual void Hide() { m_pDrawingArea->hide(); }
 void GrabFocus() { m_pDrawingArea->grab_focus(); }
 bool HasFocus() const { return m_pDrawingArea->has_focus(); }
+bool HasChildFocus() const { return m_pDrawingArea->has_child_focus(); }
 bool IsVisible() const { return m_pDrawingArea->get_visible(); }
 bool IsReallyVisible() const { return m_pDrawingArea->is_visible(); }
 bool IsEnabled() const { return m_pDrawingArea->get_sensitive(); }
diff --git a/sfx2/source/control/charwin.cxx b/sfx2/source/control/charwin.cxx
index eb5b5662a817..6b7c8cd8b514 100644
--- a/sfx2/source/control/charwin.cxx
+++ b/sfx2/source/control/charwin.cxx
@@ -189,7 +189,8 @@ void SvxCharView::Paint(vcl::RenderContext& rRenderContext, 
const tools::Rectang
 aPoint.setX(-aBoundRect.Left() + (aSize.Width() - 
aBoundRect.GetWidth()) / 2);
 }
 
-if (HasFocus())
+// tdf#111924 - don't lose focus on context menu
+if (HasFocus() || HasChildFocus())
 {
 rRenderContext.SetFillColor(aHighlightColor);
 rRenderContext.DrawRect(tools::Rectangle(Point(0, 0), aSize));


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

2022-03-18 Thread Andreas Heinisch (via logerrit)
 include/vcl/customweld.hxx  |1 +
 sfx2/source/control/charwin.cxx |3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

New commits:
commit ce3e760f9155ac8d80f60054be036e862df7029a
Author: Andreas Heinisch 
AuthorDate: Thu Mar 17 21:14:10 2022 +0100
Commit: Andreas Heinisch 
CommitDate: Fri Mar 18 19:57:01 2022 +0100

tdf#111924 - Special characters: don't lose focus on context menu

Don't lose focus on the favorite or recently used items in the special
characters dialog when right-clicking them to show the context menu.

Change-Id: Iaedc4bbc6fb627591b9c0cd9a2c44940312eeb1d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131721
Tested-by: Andreas Heinisch 
Reviewed-by: Andreas Heinisch 

diff --git a/include/vcl/customweld.hxx b/include/vcl/customweld.hxx
index a96d8c5522fe..e37555b36777 100644
--- a/include/vcl/customweld.hxx
+++ b/include/vcl/customweld.hxx
@@ -65,6 +65,7 @@ public:
 virtual void Hide() { m_pDrawingArea->hide(); }
 void GrabFocus() { m_pDrawingArea->grab_focus(); }
 bool HasFocus() const { return m_pDrawingArea->has_focus(); }
+bool HasChildFocus() const { return m_pDrawingArea->has_child_focus(); }
 bool IsVisible() const { return m_pDrawingArea->get_visible(); }
 bool IsReallyVisible() const { return m_pDrawingArea->is_visible(); }
 bool IsEnabled() const { return m_pDrawingArea->get_sensitive(); }
diff --git a/sfx2/source/control/charwin.cxx b/sfx2/source/control/charwin.cxx
index eb5b5662a817..6b7c8cd8b514 100644
--- a/sfx2/source/control/charwin.cxx
+++ b/sfx2/source/control/charwin.cxx
@@ -189,7 +189,8 @@ void SvxCharView::Paint(vcl::RenderContext& rRenderContext, 
const tools::Rectang
 aPoint.setX(-aBoundRect.Left() + (aSize.Width() - 
aBoundRect.GetWidth()) / 2);
 }
 
-if (HasFocus())
+// tdf#111924 - don't lose focus on context menu
+if (HasFocus() || HasChildFocus())
 {
 rRenderContext.SetFillColor(aHighlightColor);
 rRenderContext.DrawRect(tools::Rectangle(Point(0, 0), aSize));


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

2022-03-16 Thread Andreas Heinisch (via logerrit)
 cui/source/dialogs/cuicharmap.cxx |2 ++
 svx/source/dialog/charmap.cxx |   13 +
 2 files changed, 15 insertions(+)

New commits:
commit e7895fbacff945d38f679f504c179a417e3b9af1
Author: Andreas Heinisch 
AuthorDate: Sat Mar 12 17:50:33 2022 +0100
Commit: Andreas Heinisch 
CommitDate: Wed Mar 16 16:52:51 2022 +0100

tdf#109214 - Highlight the favorites in the grid of special characters

Change-Id: Ie1bb019495d2db4acd92da4bccf44ece2bd1d976
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131446
Tested-by: Jenkins
Reviewed-by: Heiko Tietze 

diff --git a/cui/source/dialogs/cuicharmap.cxx 
b/cui/source/dialogs/cuicharmap.cxx
index bda30b764f26..0e991d6dce16 100644
--- a/cui/source/dialogs/cuicharmap.cxx
+++ b/cui/source/dialogs/cuicharmap.cxx
@@ -421,6 +421,8 @@ void SvxCharacterMap::updateFavCharControl()
 }
 m_xShowSet->getFavCharacterList();
 m_xSearchSet->getFavCharacterList();
+// tdf#109214 - redraw highlight of the favorite characters
+m_xShowSet->Invalidate();
 }
 
 void SvxCharacterMap::deleteFavCharacterFromList(std::u16string_view sTitle, 
std::u16string_view rFont)
diff --git a/svx/source/dialog/charmap.cxx b/svx/source/dialog/charmap.cxx
index 23b6cda06ec7..6b618d51f73b 100644
--- a/svx/source/dialog/charmap.cxx
+++ b/svx/source/dialog/charmap.cxx
@@ -567,6 +567,19 @@ void SvxShowCharSet::DrawChars_Impl(vcl::RenderContext& 
rRenderContext, int n1,
 aPointTxTy.AdjustX(nXHDelta - 1 );
 }
 
+// tdf#109214 - highlight the favorite characters
+if (isFavChar(aCharStr, mxVirDev->GetFont().GetFamilyName()))
+{
+const Color aLineCol = rRenderContext.GetLineColor();
+rRenderContext.SetLineColor(aHighlightColor);
+rRenderContext.SetFillColor(COL_TRANSPARENT);
+// Outer border
+rRenderContext.DrawRect(tools::Rectangle(Point(x - 1, y - 1), 
Size(nX + 3, nY + 3)));
+// Inner border
+rRenderContext.DrawRect(tools::Rectangle(Point(x, y), Size(nX + 1, 
nY + 1)));
+rRenderContext.SetLineColor(aLineCol);
+}
+
 Color aTextCol = rRenderContext.GetTextColor();
 if (i != nSelectedIndex)
 {


<    1   2   3   4   5   >