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

2023-01-02 Thread Dennis Francis (via logerrit)
 sw/qa/extras/tiledrendering/tiledrendering.cxx |   41 +
 sw/source/core/fields/docufld.cxx  |   11 ++
 2 files changed, 51 insertions(+), 1 deletion(-)

New commits:
commit cf9e91f4082a9b01014e99e112e14a12246ce5f2
Author: Dennis Francis 
AuthorDate: Thu May 19 15:27:48 2022 +0530
Commit: Miklos Vajna 
CommitDate: Tue Jan 3 07:27:10 2023 +

sw: prefer view's redline author name...

to expand SwAuthorFieldType. Redline author name is set in
SwXTextDocument::initializeForTiledRendering each time a new view is
created.

Change-Id: I316e0cae4399796682949de14b6d4b924833eb04
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134608
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143649
(cherry picked from commit 8be4a713e9f44bf05aebc0a3054654a18b4de065)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143585
Tested-by: Jenkins

diff --git a/sw/qa/extras/tiledrendering/tiledrendering.cxx 
b/sw/qa/extras/tiledrendering/tiledrendering.cxx
index e39dc418f8a2..f9c4e77e1631 100644
--- a/sw/qa/extras/tiledrendering/tiledrendering.cxx
+++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx
@@ -19,6 +19,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 
 #include 
@@ -3790,6 +3792,45 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, 
testDateContentControl)
 CPPUNIT_ASSERT_EQUAL(OUString("2022-05-30"), 
pTextNode->GetExpandText(pWrtShell->GetLayout()));
 }
 
+CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testAuthorField)
+{
+SwXTextDocument* pXTextDocument = createDoc();
+const OUString sAuthor("Abcd Xyz");
+
+uno::Sequence 
aPropertyValues1(comphelper::InitPropertySequence(
+{
+{".uno:Author", uno::Any(sAuthor)},
+}));
+pXTextDocument->initializeForTiledRendering(aPropertyValues1);
+
+auto insertAuthorField = [this]()
+{
+uno::Reference const xMSF(mxComponent, 
uno::UNO_QUERY_THROW);
+uno::Reference const xTD(mxComponent, 
uno::UNO_QUERY_THROW);
+
+auto const xText = xTD->getText();
+auto const xTextCursor = xText->createTextCursor();
+CPPUNIT_ASSERT(xTextCursor.is());
+
+xTextCursor->gotoEnd(false);
+
+uno::Reference const xTextField(
+xMSF->createInstance("com.sun.star.text.textfield.Author"), 
uno::UNO_QUERY_THROW);
+
+uno::Reference xTextFieldProps(xTextField, 
uno::UNO_QUERY_THROW);
+xTextFieldProps->setPropertyValue("FullName", uno::Any(true));
+
+xText->insertTextContent(xTextCursor, xTextField, false);
+};
+
+insertAuthorField();
+Scheduler::ProcessEventsToIdle();
+
+xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+
+assertXPath(pXmlDoc, 
"/root/page[1]/body/txt[1]/SwParaPortion[1]/SwLineLayout[1]/SwFieldPortion[1]", 
"expand", sAuthor);
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/fields/docufld.cxx 
b/sw/source/core/fields/docufld.cxx
index 2015216f2a91..98010119566e 100644
--- a/sw/source/core/fields/docufld.cxx
+++ b/sw/source/core/fields/docufld.cxx
@@ -315,7 +315,16 @@ OUString SwAuthorFieldType::Expand(sal_uLong nFormat)
 {
 SvtUserOptions&  rOpt = SW_MOD()->GetUserOptions();
 if((nFormat & 0xff) == AF_NAME)
-return rOpt.GetFullName();
+{
+// Prefer the view's redline author name.
+// (set in SwXTextDocument::initializeForTiledRendering)
+std::size_t nAuthor = SW_MOD()->GetRedlineAuthor();
+OUString sAuthor = SW_MOD()->GetRedlineAuthor(nAuthor);
+if (sAuthor.isEmpty())
+return rOpt.GetFullName();
+
+return sAuthor;
+}
 
 return rOpt.GetID();
 }


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

2023-01-02 Thread Dennis Francis (via logerrit)
 vcl/qa/cppunit/pdfexport/data/ref-to-kids.pdf |binary
 vcl/qa/cppunit/pdfexport/pdfexport.cxx|   46 ++
 vcl/source/gdi/pdfobjectcopier.cxx|   22 
 3 files changed, 68 insertions(+)

New commits:
commit 68540314ecc801ddff06b843ac2e332b02bd7a3b
Author: Dennis Francis 
AuthorDate: Fri Dec 2 13:11:42 2022 +0530
Commit: Miklos Vajna 
CommitDate: Tue Jan 3 07:26:25 2023 +

vcl: Copy the resource kind object itself if...

some of the items in that resource are themselves dictionaries instead
of references.

Change-Id: I427386b14fe5507dfdfc9745dad27a8fceefd929
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143564
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 
(cherry picked from commit 4cb521b28e8582eda1a63bc4d92061fd111a2e3d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144438
Tested-by: Jenkins

diff --git a/vcl/qa/cppunit/pdfexport/data/ref-to-kids.pdf 
b/vcl/qa/cppunit/pdfexport/data/ref-to-kids.pdf
index 0390ccad8410..fdda33f78231 100644
Binary files a/vcl/qa/cppunit/pdfexport/data/ref-to-kids.pdf and 
b/vcl/qa/cppunit/pdfexport/data/ref-to-kids.pdf differ
diff --git a/vcl/qa/cppunit/pdfexport/pdfexport.cxx 
b/vcl/qa/cppunit/pdfexport/pdfexport.cxx
index ce070a711911..4cf31e708220 100644
--- a/vcl/qa/cppunit/pdfexport/pdfexport.cxx
+++ b/vcl/qa/cppunit/pdfexport/pdfexport.cxx
@@ -4247,6 +4247,52 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, 
testRexportMediaBoxOrigin)
 }
 }
 
+CPPUNIT_TEST_FIXTURE(PdfExportTest, testRexportResourceItemReference)
+{
+// We need to enable PDFium import (and make sure to disable after the 
test)
+bool bResetEnvVar = false;
+if (getenv("LO_IMPORT_USE_PDFIUM") == nullptr)
+{
+bResetEnvVar = true;
+osl_setEnvironment(OUString("LO_IMPORT_USE_PDFIUM").pData, 
OUString("1").pData);
+}
+comphelper::ScopeGuard aPDFiumEnvVarGuard([&]() {
+if (bResetEnvVar)
+osl_clearEnvironment(OUString("LO_IMPORT_USE_PDFIUM").pData);
+});
+
+// Load the PDF and save as PDF
+vcl::filter::PDFDocument aDocument;
+load(u"ref-to-kids.pdf", aDocument);
+
+std::vector aPages = aDocument.GetPages();
+CPPUNIT_ASSERT_EQUAL(size_t(5), aPages.size());
+
+// Directly go to the inner XObject Im10 that has reference to Font in 
page 2.
+auto pInnerIm = aDocument.LookupObject(10);
+CPPUNIT_ASSERT(pInnerIm);
+
+auto pResources
+= 
dynamic_cast(pInnerIm->Lookup("Resources"));
+CPPUNIT_ASSERT(pResources);
+auto pFontsReference
+= 
dynamic_cast(pResources->LookupElement("Font"));
+CPPUNIT_ASSERT(pFontsReference);
+
+auto pFontsObject = pFontsReference->LookupObject();
+CPPUNIT_ASSERT(pFontsObject);
+
+auto pFontDict
+= 
dynamic_cast(pFontsObject->Lookup("FF132"));
+CPPUNIT_ASSERT(pFontDict);
+
+auto pFontDescriptor = pFontDict->LookupObject("FontDescriptor");
+CPPUNIT_ASSERT(pFontDescriptor);
+
+auto pFontWidths = pFontDict->LookupObject("Widths");
+CPPUNIT_ASSERT(pFontWidths);
+}
+
 } // end anonymous namespace
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/vcl/source/gdi/pdfobjectcopier.cxx 
b/vcl/source/gdi/pdfobjectcopier.cxx
index 67f70d10f2a9..2f32cdc27ce1 100644
--- a/vcl/source/gdi/pdfobjectcopier.cxx
+++ b/vcl/source/gdi/pdfobjectcopier.cxx
@@ -184,6 +184,7 @@ OString 
PDFObjectCopier::copyExternalResources(filter::PDFObjectElement& rPage,
 
 // Get the rKind subset of the resource dictionary.
 std::map aItems;
+filter::PDFObjectElement* pKindObject = nullptr;
 if (auto pResources = 
dynamic_cast(rPage.Lookup("Resources")))
 {
 // Resources is a direct dictionary.
@@ -202,6 +203,7 @@ OString 
PDFObjectCopier::copyExternalResources(filter::PDFObjectElement& rPage,
 return {};
 }
 
+pKindObject = pReferenced;
 aItems = pReferenced->GetDictionaryItems();
 }
 }
@@ -210,23 +212,37 @@ OString 
PDFObjectCopier::copyExternalResources(filter::PDFObjectElement& rPage,
 // Resources is an indirect object.
 filter::PDFElement* pValue = pPageResources->Lookup(rKind);
 if (auto pDictionary = 
dynamic_cast(pValue))
+{
 // Kind is a direct dictionary.
 aItems = pDictionary->GetItems();
+}
 else if (filter::PDFObjectElement* pObject = 
pPageResources->LookupObject(rKind))
+{
 // Kind is an indirect object.
 aItems = pObject->GetDictionaryItems();
+pKindObject = pObject;
+}
 }
 if (aItems.empty())
 return {};
 
 SvMemoryStream& rDocBuffer = rPage.GetDocument().GetEditBuffer();
+bool bHasDictValue = false;
 
 for (const auto& rItem : aItems)
 {
 // For each item copy it over to our output then insert it into aRet.
 auto pReference = 
dynamic_cast(rItem.second);
 

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

2023-01-02 Thread Dennis Francis (via logerrit)
 vcl/source/gdi/pdfobjectcopier.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit c060f449371cebc9e447568ae1e0aa0860137e2d
Author: Dennis Francis 
AuthorDate: Fri Dec 2 12:50:44 2022 +0530
Commit: Miklos Vajna 
CommitDate: Tue Jan 3 07:26:03 2023 +

vcl: copy /Pattern resources too

Change-Id: I3d99f9083fb67c68ddee24d2d285350230533fda
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143563
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 
(cherry picked from commit cf923b7f892ee8d5c5122c7bd88cb40a2e390a56)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144437
Tested-by: Jenkins

diff --git a/vcl/source/gdi/pdfobjectcopier.cxx 
b/vcl/source/gdi/pdfobjectcopier.cxx
index 999be92bd752..67f70d10f2a9 100644
--- a/vcl/source/gdi/pdfobjectcopier.cxx
+++ b/vcl/source/gdi/pdfobjectcopier.cxx
@@ -260,7 +260,7 @@ void 
PDFObjectCopier::copyPageResources(filter::PDFObjectElement* pPage, OString
 {
 rLine.append(" /Resources <<");
 static const std::initializer_list aKeys
-= { "ColorSpace", "ExtGState", "Font", "XObject", "Shading" };
+= { "ColorSpace", "ExtGState", "Font", "XObject", "Shading", "Pattern" 
};
 for (const auto& rKey : aKeys)
 {
 rLine.append(copyExternalResources(*pPage, rKey, rCopiedResources));


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

2023-01-02 Thread Dennis Francis (via logerrit)
 vcl/qa/cppunit/pdfexport/data/ref-to-kids.pdf |binary
 vcl/qa/cppunit/pdfexport/pdfexport.cxx|   61 ++
 vcl/source/gdi/pdfwriter_impl.cxx |   29 ++--
 3 files changed, 85 insertions(+), 5 deletions(-)

New commits:
commit e72f77b8164820569834f5459514c18d2bfd911b
Author: Dennis Francis 
AuthorDate: Thu Dec 1 11:47:12 2022 +0530
Commit: Miklos Vajna 
CommitDate: Tue Jan 3 07:25:42 2023 +

vcl: use /MediaBox origin in the ctm...

of the inner XObject, else the clip polypolygon may clip out partly or
whole contents. Adjusting the clip polypolygon is not straightforward.

Change-Id: If3b208ba850c3579c9e16c15e4fb2f947dad4406
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143561
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 
(cherry picked from commit a67dcc248a103098de883a4dd2fa9ff2e1cc1f90)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144436
Tested-by: Jenkins

diff --git a/vcl/qa/cppunit/pdfexport/data/ref-to-kids.pdf 
b/vcl/qa/cppunit/pdfexport/data/ref-to-kids.pdf
index 598358a636aa..0390ccad8410 100644
Binary files a/vcl/qa/cppunit/pdfexport/data/ref-to-kids.pdf and 
b/vcl/qa/cppunit/pdfexport/data/ref-to-kids.pdf differ
diff --git a/vcl/qa/cppunit/pdfexport/pdfexport.cxx 
b/vcl/qa/cppunit/pdfexport/pdfexport.cxx
index 428f9d5a132a..ce070a711911 100644
--- a/vcl/qa/cppunit/pdfexport/pdfexport.cxx
+++ b/vcl/qa/cppunit/pdfexport/pdfexport.cxx
@@ -4186,6 +4186,67 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, 
testRexportFilterSingletonArray)
 CPPUNIT_ASSERT(it != pEnd);
 }
 
+CPPUNIT_TEST_FIXTURE(PdfExportTest, testRexportMediaBoxOrigin)
+{
+// We need to enable PDFium import (and make sure to disable after the 
test)
+bool bResetEnvVar = false;
+if (getenv("LO_IMPORT_USE_PDFIUM") == nullptr)
+{
+bResetEnvVar = true;
+osl_setEnvironment(OUString("LO_IMPORT_USE_PDFIUM").pData, 
OUString("1").pData);
+}
+comphelper::ScopeGuard aPDFiumEnvVarGuard([&]() {
+if (bResetEnvVar)
+osl_clearEnvironment(OUString("LO_IMPORT_USE_PDFIUM").pData);
+});
+
+// Load the PDF and save as PDF
+vcl::filter::PDFDocument aDocument;
+load(u"ref-to-kids.pdf", aDocument);
+
+std::vector aPages = aDocument.GetPages();
+CPPUNIT_ASSERT_EQUAL(size_t(5), aPages.size());
+
+// Directly go to the inner XObject Im10 that contains the rectangle 
drawings in page 2.
+auto pInnerIm = aDocument.LookupObject(10);
+CPPUNIT_ASSERT(pInnerIm);
+
+constexpr sal_Int32 aOrigin[2] = { -800, -600 };
+sal_Int32 aSize[2] = { 0, 0 };
+
+auto pBBox = 
dynamic_cast(pInnerIm->Lookup("BBox"));
+CPPUNIT_ASSERT(pBBox);
+const auto& rElements2 = pBBox->GetElements();
+CPPUNIT_ASSERT_EQUAL(static_cast(4), rElements2.size());
+for (sal_Int32 nIdx = 0; nIdx < 4; ++nIdx)
+{
+const auto* pNumElement = 
dynamic_cast(rElements2[nIdx]);
+CPPUNIT_ASSERT(pNumElement);
+if (nIdx < 2)
+CPPUNIT_ASSERT_EQUAL(aOrigin[nIdx], 
static_cast(pNumElement->GetValue()));
+else
+aSize[nIdx - 2] = static_cast(pNumElement->GetValue()) 
- aOrigin[nIdx - 2];
+}
+
+auto pMatrix = 
dynamic_cast(pInnerIm->Lookup("Matrix"));
+CPPUNIT_ASSERT(pMatrix);
+const auto& rElements = pMatrix->GetElements();
+CPPUNIT_ASSERT_EQUAL(static_cast(6), rElements.size());
+sal_Int32 aMatTranslate[6]
+= { // Rotation by $\theta$ $cos(\theta), sin(\theta), -sin(\theta), 
cos(\theta)$
+0, -1, 1, 0,
+// Translate x,y
+-aOrigin[1] - aSize[1] / 2 + aSize[0] / 2, aOrigin[0] + aSize[0] / 
2 + aSize[1] / 2
+  };
+
+for (sal_Int32 nIdx = 0; nIdx < 6; ++nIdx)
+{
+const auto* pNumElement = 
dynamic_cast(rElements[nIdx]);
+CPPUNIT_ASSERT(pNumElement);
+CPPUNIT_ASSERT_EQUAL(aMatTranslate[nIdx], 
static_cast(pNumElement->GetValue()));
+}
+}
+
 } // end anonymous namespace
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx 
b/vcl/source/gdi/pdfwriter_impl.cxx
index f4a3145c5085..d95a74aeb6af 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -8873,6 +8873,21 @@ void PDFWriterImpl::writeReferenceXObject(const 
ReferenceXObjectEmit& rEmit)
 return;
 }
 
+double aOrigin[2] = { 0.0, 0.0 };
+if (auto* pArray = 
dynamic_cast(pPage->Lookup("MediaBox")))
+{
+const auto& rElements = pArray->GetElements();
+if (rElements.size() >= 4)
+{
+// get x1, y1 of the rectangle.
+for (sal_Int32 nIdx = 0; nIdx < 2; ++nIdx)
+{
+if (const auto* pNumElement = 
dynamic_cast(rElements[nIdx]))
+aOrigin[nIdx] = pNumElement->GetValue();
+}
+}
+}
+
 std::vect

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

2023-01-02 Thread Stephan Bergmann (via logerrit)
 solenv/gbuild/UnoApiTarget.mk |8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

New commits:
commit 9fdf6b4d8317df2a6ccc866fad93292b41c97274
Author: Stephan Bergmann 
AuthorDate: Mon Jan 2 08:35:28 2023 +0100
Commit: Stephan Bergmann 
CommitDate: Tue Jan 3 07:14:15 2023 +

More verbose unoidl-check errors

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

diff --git a/solenv/gbuild/UnoApiTarget.mk b/solenv/gbuild/UnoApiTarget.mk
index 25a53dfa0a59..67e8bccca906 100644
--- a/solenv/gbuild/UnoApiTarget.mk
+++ b/solenv/gbuild/UnoApiTarget.mk
@@ -35,9 +35,11 @@ $(if $(UNOAPI_ENTITIES), \
 $(if $(UNOAPI_ENTITIES),&& rm -f $${RESPONSEFILE}) \
 $(if $(UNOAPI_REFERENCE), \
$(call gb_Output_announce,$(2),$(true),DBc,3) \
-   && $(gb_UnoApiTarget_UNOIDLCHECKCOMMAND) $(UNOAPI_REFERENCE) -- \
-   $(foreach rdb,$(UNOAPI_DEPRDBS),$(call 
gb_UnoApiTarget_get_target,$(rdb))) \
-   $(1))
+   && { $(gb_UnoApiTarget_UNOIDLCHECKCOMMAND) $(UNOAPI_REFERENCE) -- \
+   $(foreach rdb,$(UNOAPI_DEPRDBS),$(call 
gb_UnoApiTarget_get_target,$(rdb))) \
+   $(1) \
+   || { printf 'ERROR: Published UNO API must not be changed 
incompatibly!\n(If published UNO API shall be changed incompatibly after all, 
see\n.)\n';
 \
+false; } })
 endef
 
 $(call gb_UnoApiTarget_get_target,%) :


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

2023-01-02 Thread Stephan Bergmann (via logerrit)
 oox/qa/unit/shape.cxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 1ce6ae04f7faa84d98b10b67f2ef5f24ac1b0129
Author: Stephan Bergmann 
AuthorDate: Mon Jan 2 13:18:33 2023 +0100
Commit: Stephan Bergmann 
CommitDate: Tue Jan 3 07:13:11 2023 +

-Werror=maybe-uninitialized

(Adding just CPPUNIT_ASSERT wasn't enough to silence the warnings at least 
for
my GCC 13 trunk build, so also added the redundant initializations.)

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

diff --git a/oox/qa/unit/shape.cxx b/oox/qa/unit/shape.cxx
index 19b9f739ad60..094687ffe1df 100644
--- a/oox/qa/unit/shape.cxx
+++ b/oox/qa/unit/shape.cxx
@@ -336,8 +336,8 @@ CPPUNIT_TEST_FIXTURE(OoxShapeTest, testWriterFontwork)
 uno::Reference xShapeProps(xDrawPage->getByIndex(0), 
uno::UNO_QUERY);
 
 // Is it a Fontwork?
-bool bTextBox;
-xShapeProps->getPropertyValue(u"TextBox") >>= bTextBox;
+bool bTextBox = bool();
+CPPUNIT_ASSERT(xShapeProps->getPropertyValue(u"TextBox") >>= bTextBox);
 CPPUNIT_ASSERT(!bTextBox);
 
 uno::Reference xTextFrame;
@@ -354,8 +354,8 @@ CPPUNIT_TEST_FIXTURE(OoxShapeTest, testWriterFontwork)
 CPPUNIT_ASSERT(aTextPathSeq.getLength() > 0);
 
 comphelper::SequenceAsHashMap aTextPathPropMap(aTextPathSeq);
-bool bTextPathOn;
-aTextPathPropMap.getValue(u"TextPath") >>= bTextPathOn;
+bool bTextPathOn = bool();
+CPPUNIT_ASSERT(aTextPathPropMap.getValue(u"TextPath") >>= bTextPathOn);
 CPPUNIT_ASSERT(bTextPathOn);
 
 // Is it the correct kind of Fontwork?


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

2023-01-02 Thread Patrick Luby (via logerrit)
 vcl/osx/salframeview.mm |   31 ++-
 1 file changed, 30 insertions(+), 1 deletion(-)

New commits:
commit d118be7ed4dd6596a8b4d766e8507b6dcaf2b7f7
Author: Patrick Luby 
AuthorDate: Mon Jan 2 19:53:46 2023 -0500
Commit: Noel Grandin 
CommitDate: Tue Jan 3 07:12:20 2023 +

Related: tdf#152703 Eliminate empty window with Skia/Metal while resizing

The window will clear its background in [SalFrameWindow displayIfNeeded]
so when Skia/Metal is enabled, explicitly flush the Skia graphics to the
window during live resizing or else nothing will be drawn until after live
resizing has ended.

Also, when Skia/Metal is enabled, rapidly resizing a window has a noticeable
amount of flicker so don't send any paint events during live resizing. Also,
it appears that most of the LibreOffice layouts do not change their layout
much during live resizing so apply this change when Skia is not enabled to
ensure consistent behavior whether Skia is enabled or not.

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

diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm
index 2f35d3a057b7..de996654bc1d 100644
--- a/vcl/osx/salframeview.mm
+++ b/vcl/osx/salframeview.mm
@@ -36,6 +36,10 @@
 #include 
 #include 
 
+#if HAVE_FEATURE_SKIA
+#include 
+#endif
+
 #define WHEEL_EVENT_FACTOR 1.5
 
 static sal_uInt16 ImplGetModifierMask( unsigned int nMask )
@@ -215,6 +219,21 @@ static AquaSalFrame* getMouseContainerFrame()
 if( GetSalData() && GetSalData()->mpInstance )
 {
 SolarMutexGuard aGuard;
+
+#if HAVE_FEATURE_SKIA
+// Related: tdf#152703 Eliminate empty window with Skia/Metal while 
resizing
+// The window will clear its background so when Skia/Metal is enabled,
+// explicitly flush the Skia graphics to the window during live
+// resizing or else nothing will be drawn until after live resizing
+// has ended.
+if ( [self inLiveResize] && SkiaHelper::isVCLSkiaEnabled() && mpFrame 
&& AquaSalFrame::isAlive( mpFrame ) )
+{
+AquaSalGraphics* pGraphics = mpFrame->mpGraphics;
+if ( pGraphics )
+pGraphics->Flush();
+}
+#endif
+
 [super displayIfNeeded];
 }
 }
@@ -317,7 +336,17 @@ static AquaSalFrame* getMouseContainerFrame()
 {
 mpFrame->UpdateFrameGeometry();
 mpFrame->CallCallback( SalEvent::Resize, nullptr );
-mpFrame->SendPaintEvent();
+
+// Related: tdf#152703 Stop flicker with Skia/Metal while resizing
+// When Skia/Metal is enabled, rapidly resizing a window has a
+// noticeable amount of flicker so don't send any paint events during
+// live resizing.
+// Also, it appears that most of the LibreOffice layouts do not change
+// their layout much during live resizing so apply this change when
+// Skia is not enabled to ensure consistent behavior whether Skia is
+// enabled or not.
+if ( ![self inLiveResize] )
+mpFrame->SendPaintEvent();
 }
 }
 


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

2023-01-02 Thread Ilhan Yesil (via logerrit)
 vcl/source/control/imp_listbox.cxx|8 ++--
 vcl/source/control/listbox.cxx|   14 +++---
 vcl/unx/gtk3/salnativewidgets-gtk.cxx |   20 +++-
 3 files changed, 24 insertions(+), 18 deletions(-)

New commits:
commit ff7e00e12ff80bd708f31a1d886d000907ceb31a
Author: Ilhan Yesil 
AuthorDate: Mon Mar 21 13:27:52 2022 +0100
Commit: Michael Weghorn 
CommitDate: Tue Jan 3 07:03:55 2023 +

tdf#148109 Paint background color in listbox

The combobox described in 148109 is indeed a listbox.
If drop down list is not open and only the selected item
is shown without having the focus, the background color
will be paint either it's defined as native control
or not.

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

diff --git a/vcl/source/control/imp_listbox.cxx 
b/vcl/source/control/imp_listbox.cxx
index 531244925062..75bc1fd622e2 100644
--- a/vcl/source/control/imp_listbox.cxx
+++ b/vcl/source/control/imp_listbox.cxx
@@ -2603,6 +2603,10 @@ void ImplWin::ImplDraw(vcl::RenderContext& 
rRenderContext, bool bLayout)
 if( bMouseOver )
 nState |= ControlState::ROLLOVER;
 
+Color aBackgroundColor = COL_AUTO;
+if (IsControlBackground())
+aBackgroundColor = GetControlBackground();
+
 // if parent has no border, then nobody has drawn the background
 // since no border window exists. so draw it here.
 WinBits nParentStyle = pWin->GetStyle();
@@ -2610,11 +2614,11 @@ void ImplWin::ImplDraw(vcl::RenderContext& 
rRenderContext, bool bLayout)
 {
 tools::Rectangle aParentRect( Point( 0, 0 ), 
pWin->GetSizePixel() );
 pWin->GetOutDev()->DrawNativeControl( ControlType::Listbox, 
ControlPart::Entire, aParentRect,
- nState, aControlValue, OUString() );
+ nState, aControlValue, OUString(), 
aBackgroundColor);
 }
 
 bNativeOK = rRenderContext.DrawNativeControl(ControlType::Listbox, 
ControlPart::Entire, aCtrlRegion,
- nState, 
aControlValue, OUString());
+ nState, 
aControlValue, OUString(), aBackgroundColor);
 }
 
 if (bIsEnabled)
diff --git a/vcl/source/control/listbox.cxx b/vcl/source/control/listbox.cxx
index e463b2ff958c..ce3cbba69aec 100644
--- a/vcl/source/control/listbox.cxx
+++ b/vcl/source/control/listbox.cxx
@@ -771,17 +771,9 @@ void ListBox::StateChanged( StateChangedType nType )
 mpImplLB->SetControlBackground( GetControlBackground() );
 if ( mpImplWin )
 {
-if ( mpImplWin->IsNativeControlSupported(ControlType::Listbox, 
ControlPart::Entire) )
-{
-// Transparent background
-mpImplWin->SetBackground();
-mpImplWin->SetControlBackground();
-}
-else
-{
-mpImplWin->SetBackground( 
mpImplLB->GetMainWindow()->GetControlBackground() );
-mpImplWin->SetControlBackground( 
mpImplLB->GetMainWindow()->GetControlBackground() );
-}
+
+mpImplWin->SetBackground( GetControlBackground() );
+mpImplWin->SetControlBackground( GetControlBackground() );
 mpImplWin->SetFont( mpImplLB->GetMainWindow()->GetFont() );
 mpImplWin->Invalidate();
 }
diff --git a/vcl/unx/gtk3/salnativewidgets-gtk.cxx 
b/vcl/unx/gtk3/salnativewidgets-gtk.cxx
index 6fc1be3f8257..f55b45a8b92b 100644
--- a/vcl/unx/gtk3/salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk3/salnativewidgets-gtk.cxx
@@ -1005,9 +1005,8 @@ void GtkSalGraphics::PaintCombobox( GtkStateFlags flags, 
cairo_t *cr,
 else
 {
 render_common(mpListboxStyle, cr, aRect, flags);
-render_common(mpListboxBoxStyle, cr, aRect, flags);
-
 render_common(mpListboxButtonStyle, cr, aRect, flags);
+render_common(mpListboxBoxStyle, cr, aRect, flags);
 
 gtk_render_arrow(mpListboxButtonArrowStyle, cr,
  G_PI,
@@ -1882,13 +1881,24 @@ bool GtkSalGraphics::drawNativeControl( ControlType 
nType, ControlPart nPart, co
 case RenderType::Combobox:
 if (pBgCssProvider)
 {
-gtk_style_context_add_provider(mpComboboxEntryStyle, 
GTK_STYLE_PROVIDER(pBgCssProvider),
-   
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+if (nType == ControlType::Combobox)
+{
+gtk_style_context_add_provider(mpComboboxEntryStyle, 
GTK_STYLE_PROVIDER(pBgCssProvider),
+   
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);

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

2023-01-02 Thread Miklos Vajna (via logerrit)
 sw/qa/core/text/data/number-portion-format.odt  |binary
 sw/qa/core/text/data/number-portion-noformat.docx   |binary
 sw/qa/core/text/text.cxx|   18 ++
 sw/qa/extras/ooxmlexport/data/number-portion-format.odt |binary
 sw/qa/extras/ooxmlexport/ooxmlexport13.cxx  |6 
 sw/source/core/text/txtfld.cxx  |   10 
 sw/source/core/unocore/unoportenum.cxx  |   20 
 sw/source/filter/ww8/docxattributeoutput.cxx|2 -
 sw/source/filter/ww8/wrtw8nds.cxx   |   15 +---
 9 files changed, 51 insertions(+), 20 deletions(-)

New commits:
commit 55906cca53315c1dd0018405f64ac386da3b6c2d
Author: Miklos Vajna 
AuthorDate: Fri Dec 16 10:31:03 2022 +0100
Commit: Miklos Vajna 
CommitDate: Tue Jan 3 07:01:46 2023 +

sw, numbering portion format: ignore char formats covering the entire 
paragraph

The bugdoc has a single paragraph, where the numbering portion is bold
in Writer but not in Word.

The reason for this appears to be that Writer considers text node hints
for the formatting of the numbering portion where the hint covers the
entire paragraph, but Word doesn't do this. This behavior was added in
commits cb0e1b52d68aa6d5b505f91cb4ce577f7f3b2a8f (sw, numbering portion
format: consider full-para char formats as well, 2022-10-20) and DOCX
export was also adjusted in commit
f546f7573158e52359bbeae6194a83a1ff8ac52c (DOCX export, numbering portion
format: consider full-para char formats as well, 2022-10-28).

Fix the problem by partially reverting the above two commits and instead
only consider hints that both start and end at the paragraph end. The
revert of the first commit fixes the new bugdoc (its numbering portion
is no longer bold) and the old bugdoc keeps working if the sw UNO API's
text portion enumeration is extended to expose such empty autoformats at
paragraph end.

Related testcases:

- CppunitTest_sw_ooxmlexport13's testTdf123460 explicitly tested that we
  don't expose the paragraph marker's formatting on the UNO API.

- CppunitTest_sw_core_text's testNumberPortionFormat now uses the new
  ODT markup for these explicit paragraph marker char props (empty text
  span at para end).

- CppunitTest_sw_uiwriter2's testTdfChangeNumberingListAutoFormat failed
  when only the above first commit (layout) was reverted, so revert the
  matching DOCX export commit as well, which is also good for consistency.

- CppunitTest_sw_ooxmlexport18's testNumberPortionFormatFromODT also
  used the old ODT markup, updated.

(cherry picked from commit 99ed51bcad4008a4006dcec24aa33fd7f757a433)

Change-Id: Iee8acf72dabcd10b3f4d3d68b83ed248bf50c324
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144674
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144959
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/sw/qa/core/text/data/number-portion-format.odt 
b/sw/qa/core/text/data/number-portion-format.odt
index 3047153b63af..19b23ae84420 100644
Binary files a/sw/qa/core/text/data/number-portion-format.odt and 
b/sw/qa/core/text/data/number-portion-format.odt differ
diff --git a/sw/qa/core/text/data/number-portion-noformat.docx 
b/sw/qa/core/text/data/number-portion-noformat.docx
new file mode 100644
index ..b289b9c69ef4
Binary files /dev/null and b/sw/qa/core/text/data/number-portion-noformat.docx 
differ
diff --git a/sw/qa/core/text/text.cxx b/sw/qa/core/text/text.cxx
index 0bcd850073e9..38f984661ec5 100644
--- a/sw/qa/core/text/text.cxx
+++ b/sw/qa/core/text/text.cxx
@@ -751,6 +751,24 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, 
testNumberPortionFormat)
 assertXPath(pXmlDoc, "//Special[@nType='PortionType::Number']", "nHeight", 
"480");
 }
 
+CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testNumberPortionNoformat)
+{
+// Given a document with a numbering and a single paragraph, the entire 
run is red:
+createSwDoc(DATA_DIRECTORY, "number-portion-noformat.docx");
+
+// When laying out that document:
+xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+
+// Then make sure that just because the entire run is red, the numbering 
portion is not red:
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected:  (COL_AUTO)
+// - Actual  : 00ff (COL_LIGHTRED)
+// i.e. the run color affected the color of the number portion in Writer, 
but not in Word.
+CPPUNIT_ASSERT_EQUAL(
+OUString(""),
+getXPath(pXmlDoc, "//Special[@nType='PortionType::Number']/SwFont", 
"color"));
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/extras/ooxmlexport/data/numbe

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

2023-01-02 Thread Miklos Vajna (via logerrit)
 sw/qa/core/text/data/number-portion-format.odt  |binary
 sw/qa/core/text/text.cxx|   18 +
 sw/qa/extras/ooxmlexport/data/number-portion-format.odt |binary
 sw/qa/extras/ooxmlexport/ooxmlexport18.cxx  |   20 ++
 sw/source/core/text/txtfld.cxx  |   22 
 sw/source/filter/ww8/docxattributeoutput.cxx|2 -
 sw/source/filter/ww8/wrtw8nds.cxx   |   15 +-
 7 files changed, 74 insertions(+), 3 deletions(-)

New commits:
commit 6f4836ae8b72a4f4a5f7a8cb7d32a435a4b96be6
Author: Miklos Vajna 
AuthorDate: Fri Oct 28 16:39:31 2022 +0200
Commit: Miklos Vajna 
CommitDate: Tue Jan 3 07:01:35 2023 +

DOCX export, numbering portion format: consider full-para char formats as 
well

The bugdoc had a single paragraph with direct formatting (24pt font
size), numbering enabled and a bookmark covering half of the paragraph.
The numbering had default font size in the DOCX export result, not
inheriting from the paragraph.

In case the bookmark is removed, then the custom font size is not an
autoformat set on the whole text of the paragraph but rather a format on
the paragraph level, which does influence the formatting of the
numbering portion via the paragraph marker formatting, as expected.

Fix the problem in a way similar to what was done in commit
cb0e1b52d68aa6d5b505f91cb4ce577f7f3b2a8f (sw, numbering portion format:
consider full-para char formats as well, 2022-10-20), except that was
for the rendering and this is for the DOCX export.

This also required filtering out grab-bags in
lcl_writeParagraphMarkerProperties(), otherwise citation SDTs show up in
the export result at unexpected places, as shown by
CppunitTest_sw_ooxmlexport14's testTdf129353.

(cherry picked from commit f546f7573158e52359bbeae6194a83a1ff8ac52c)

Conflicts:
sw/qa/extras/ooxmlexport/ooxmlexport18.cxx

Change-Id: I7bb88e290f2a370d78ecc894f306bcb0a403545f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142103
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144958
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/sw/qa/extras/ooxmlexport/data/number-portion-format.odt 
b/sw/qa/extras/ooxmlexport/data/number-portion-format.odt
new file mode 100644
index ..3047153b63af
Binary files /dev/null and 
b/sw/qa/extras/ooxmlexport/data/number-portion-format.odt differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx
index c0d3e7c6d161..a77e2ec98ca4 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx
@@ -115,6 +115,26 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf152200)
 assertXPath(pXmlDoc, "//w:fldChar", 3); // no field characters elsewhere
 }
 
+CPPUNIT_TEST_FIXTURE(Test, testNumberPortionFormatFromODT)
+{
+// Given a document with a single paragraph, direct formatting asks 24pt 
font size for the
+// numbering and the text portion:
+load(DATA_DIRECTORY, "number-portion-format.odt");
+
+// When saving to DOCX:
+save("Office Open XML Text", maTempFile);
+mbExported = true;
+
+// Then make sure that the paragraph marker's char format has that custom 
font size:
+xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: 1
+// - Actual  : 0
+// - XPath '//w:pPr/w:rPr/w:sz' number of nodes is incorrect
+// i.e.  was missing under 's .
+assertXPath(pXmlDoc, "//w:pPr/w:rPr/w:sz", "val", "48");
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index b190bf38e581..0bff96233ce4 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -1407,7 +1407,7 @@ void 
lcl_writeParagraphMarkerProperties(DocxAttributeOutput& rAttributeOutput, c
 bool bFontSizeWritten = false;
 while (nWhichId)
 {
-if (rParagraphMarkerProperties.GetItemState(nWhichId, true, &pItem) == 
SfxItemState::SET)
+if (rParagraphMarkerProperties.GetItemState(nWhichId, true, &pItem) == 
SfxItemState::SET && nWhichId != RES_CHRATR_GRABBAG)
 {
 if (isCHRATR(nWhichId) || nWhichId == RES_TXTATR_CHARFMT)
 {
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx 
b/sw/source/filter/ww8/wrtw8nds.cxx
index 89fe95801f85..42036c163eca 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -3211,6 +3211,7 @@ void MSWordExportBase::OutputTextNode( SwTextNode& rNode )
 }
 else if (c

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

2023-01-02 Thread Miklos Vajna (via logerrit)
 sw/source/core/inc/UndoTable.hxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 3d72e1f014637e0c1f690014f3f1d4dff32de3d6
Author: Miklos Vajna 
AuthorDate: Mon Jan 2 20:10:04 2023 +0100
Commit: Miklos Vajna 
CommitDate: Tue Jan 3 07:00:44 2023 +

sw: document SwUndoInsTable

Table autoformat & redlining causes most complications here.

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

diff --git a/sw/source/core/inc/UndoTable.hxx b/sw/source/core/inc/UndoTable.hxx
index e0f8dd5fb58d..29850d2f07e2 100644
--- a/sw/source/core/inc/UndoTable.hxx
+++ b/sw/source/core/inc/UndoTable.hxx
@@ -53,6 +53,7 @@ void NotifyTableCollapsedParagraph(const SwContentNode* 
pNode, SwCursorShell *co
 
 }
 
+/// Implements undo/redo for Table -> Insert Table.
 class SwUndoInsTable final : public SwUndo
 {
 OUString m_sTableName;


[Libreoffice-commits] core.git: 2 commits - cui/source include/vcl sc/inc sc/source sfx2/source sw/source vcl/jsdialog vcl/source

2023-01-02 Thread Szymon Kłos (via logerrit)
 cui/source/dialogs/scriptdlg.cxx|3 +--
 include/vcl/svapp.hxx   |3 +--
 sc/inc/validat.hxx  |4 
 sc/source/core/data/validat.cxx |   11 +++
 sfx2/source/appl/app.cxx|3 +--
 sw/source/uibase/shells/translatehelper.cxx |9 -
 vcl/jsdialog/jsdialogbuilder.cxx|   10 +++---
 vcl/source/window/builder.cxx   |3 +--
 8 files changed, 30 insertions(+), 16 deletions(-)

New commits:
commit ac738382d63203965e13d3fe6f7745cdea95ea38
Author: Szymon Kłos 
AuthorDate: Fri Dec 2 16:18:02 2022 +0100
Commit: Szymon Kłos 
CommitDate: Tue Jan 3 06:36:09 2023 +

jsdialog: fix validation error dialog in Calc

Change-Id: Ie6551e386cd53f6b4bf4cceb6d7bd6170a2072ea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143599
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Rashesh Padia 
Reviewed-by: Aron Budea 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144951
Tested-by: Jenkins
Reviewed-by: Szymon Kłos 

diff --git a/cui/source/dialogs/scriptdlg.cxx b/cui/source/dialogs/scriptdlg.cxx
index fc27b3fbf3b6..a2d798e80a78 100644
--- a/cui/source/dialogs/scriptdlg.cxx
+++ b/cui/source/dialogs/scriptdlg.cxx
@@ -1327,8 +1327,7 @@ IMPL_STATIC_LINK( SvxScriptErrorDialog, ShowDialog, 
void*, p, void )
 xData->pParent,
 VclMessageType::Warning,
 VclButtonsType::Ok,
-message,
-comphelper::LibreOfficeKit::isActive()));
+message));
 
 xBox->set_title(CuiResId(RID_CUISTR_ERROR_TITLE));
 
diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx
index 398358f1bfad..55d7aa87adf2 100644
--- a/include/vcl/svapp.hxx
+++ b/include/vcl/svapp.hxx
@@ -1348,8 +1348,7 @@ public:
 static std::unique_ptr CreateInterimBuilder(vcl::Window* 
pParent, const OUString &rUIFile, bool bAllowCycleFocusOut, sal_uInt64 
nLOKWindowId = 0);
 
 static weld::MessageDialog* CreateMessageDialog(weld::Widget* pParent, 
VclMessageType eMessageType,
-VclButtonsType 
eButtonType, const OUString& rPrimaryMessage,
-bool bMobile = false);
+VclButtonsType 
eButtonType, const OUString& rPrimaryMessage);
 
 static weld::Window* GetFrameWeld(const 
css::uno::Reference& rWindow);
 
diff --git a/sc/inc/validat.hxx b/sc/inc/validat.hxx
index 79eb9b75a334..f28da4a1c50b 100644
--- a/sc/inc/validat.hxx
+++ b/sc/inc/validat.hxx
@@ -30,6 +30,8 @@ struct RefUpdateContext;
 
 }
 
+namespace vcl { class ILibreOfficeKitNotifier; }
+
 class ScPatternAttr;
 class ScTokenArray;
 class ScTypedStrData;
@@ -80,6 +82,8 @@ private:
 
 using ScConditionEntry::operator==;
 
+DECL_STATIC_LINK(ScValidationData, InstallLOKNotifierHdl, void*, 
vcl::ILibreOfficeKitNotifier*);
+
 public:
 ScValidationData( ScValidationMode eMode, ScConditionMode eOper,
 const OUString& rExpr1, const OUString& rExpr2,
diff --git a/sc/source/core/data/validat.cxx b/sc/source/core/data/validat.cxx
index 79f21d8de202..08f77ad4f862 100644
--- a/sc/source/core/data/validat.cxx
+++ b/sc/source/core/data/validat.cxx
@@ -366,6 +366,11 @@ void ScValidationData::DoCalcError( ScFormulaCell* pCell ) 
const
 DoMacro( pCell->aPos, OUString(), pCell, nullptr );
 }
 
+IMPL_STATIC_LINK_NOARG(ScValidationData, InstallLOKNotifierHdl, void*, 
vcl::ILibreOfficeKitNotifier*)
+{
+return SfxViewShell::Current();
+}
+
 // true -> abort
 
 bool ScValidationData::DoError(weld::Window* pParent, const OUString& rInput,
@@ -399,12 +404,10 @@ bool ScValidationData::DoError(weld::Window* pParent, 
const OUString& rInput,
 break;
 }
 
-bool bIsMobile = comphelper::LibreOfficeKit::isActive() && 
SfxViewShell::Current()
-&& SfxViewShell::Current()->isLOKMobilePhone();
-
 std::unique_ptr 
xBox(Application::CreateMessageDialog(pParent, eType,
-  eStyle, aMessage, bIsMobile));
+  eStyle, aMessage));
 xBox->set_title(aTitle);
+xBox->SetInstallLOKNotifierHdl(LINK(nullptr, ScValidationData, 
InstallLOKNotifierHdl));
 
 switch (eErrorStyle)
 {
diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx
index 3d3adb84bfe4..f225315d6ecd 100644
--- a/sfx2/source/appl/app.cxx
+++ b/sfx2/source/appl/app.cxx
@@ -413,8 +413,7 @@ IMPL_STATIC_LINK( SfxApplication, GlobalBasicErrorHdl_Impl, 
StarBASIC*, pStarBas
pViewFrame ? pViewFrame->GetFrameWeld() : nullptr,
VclMessageType::Error,
VclButtonsType::Ok,
-   aError,
-   true));
+   aError));
 
 

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

2023-01-02 Thread Szymon Kłos (via logerrit)
 svx/source/sidebar/shadow/ShadowPropertyPanel.cxx |2 +-
 svx/uiconfig/ui/sidebarshadow.ui  |4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 36de236836ee01f971744540688daad603583998
Author: Szymon Kłos 
AuthorDate: Tue Nov 29 19:59:57 2022 +0100
Commit: Szymon Kłos 
CommitDate: Tue Jan 3 06:06:24 2023 +

jsdialogs: fix generic color label name

update event was triggering other widget change:
when opened calc and selected shape first time
we saw color text next to other color label

Change-Id: I71670ac1273ce96fafc8d20126d9f32151e96d89
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143471
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Pedro Silva 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144950
Tested-by: Jenkins
Reviewed-by: Szymon Kłos 

diff --git a/svx/source/sidebar/shadow/ShadowPropertyPanel.cxx 
b/svx/source/sidebar/shadow/ShadowPropertyPanel.cxx
index 93259adc27f0..914d13de695d 100644
--- a/svx/source/sidebar/shadow/ShadowPropertyPanel.cxx
+++ b/svx/source/sidebar/shadow/ShadowPropertyPanel.cxx
@@ -50,7 +50,7 @@ ShadowPropertyPanel::ShadowPropertyPanel(
 mxFTDistance(m_xBuilder->weld_label("distance")),
 mxFTTransparency(m_xBuilder->weld_label("transparency_label")),
 mxFTBlur(m_xBuilder->weld_label("blur_label")),
-mxFTColor(m_xBuilder->weld_label("color")),
+mxFTColor(m_xBuilder->weld_label("shadowcolorlabel")),
 mxShadowTransSlider(m_xBuilder->weld_scale("transparency_slider")),
 
mxShadowTransMetric(m_xBuilder->weld_metric_spin_button("FIELD_TRANSPARENCY", 
FieldUnit::PERCENT)),
 mxShadowBlurMetric(m_xBuilder->weld_metric_spin_button("LB_SHADOW_BLUR", 
FieldUnit::POINT))
diff --git a/svx/uiconfig/ui/sidebarshadow.ui b/svx/uiconfig/ui/sidebarshadow.ui
index a2b170ffa792..26e2263134cc 100644
--- a/svx/uiconfig/ui/sidebarshadow.ui
+++ b/svx/uiconfig/ui/sidebarshadow.ui
@@ -89,10 +89,10 @@
   
 
 
-  
+  
 True
 False
-Color:
+Color:
 True
 LB_SHADOW_COLOR
 0


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

2023-01-02 Thread Justin Luth (via logerrit)
 i18npool/source/localedata/data/ak_GH.xml  |   11 +--
 i18npool/source/localedata/data/an_ES.xml  |   11 +--
 i18npool/source/localedata/data/ast_ES.xml |   11 +--
 i18npool/source/localedata/data/bm_ML.xml  |   11 +--
 i18npool/source/localedata/data/bs_BA.xml  |   11 +--
 i18npool/source/localedata/data/dv_MV.xml  |   11 +--
 i18npool/source/localedata/data/ee_GH.xml  |   11 +--
 i18npool/source/localedata/data/en_GH.xml  |   11 +--
 i18npool/source/localedata/data/fr_BF.xml  |   11 +--
 i18npool/source/localedata/data/fur_IT.xml |   11 +--
 i18npool/source/localedata/data/fy_NL.xml  |   11 +--
 i18npool/source/localedata/data/gd_GB.xml  |   11 +--
 i18npool/source/localedata/data/gsc_FR.xml |   11 +--
 i18npool/source/localedata/data/gug_PY.xml |   11 +--
 i18npool/source/localedata/data/ha_Latn_GH.xml |   11 +--
 i18npool/source/localedata/data/haw_US.xml |   11 +--
 i18npool/source/localedata/data/hil_PH.xml |   11 +--
 i18npool/source/localedata/data/hr_HR.xml  |   11 +--
 i18npool/source/localedata/data/ht_HT.xml  |   11 +--
 i18npool/source/localedata/data/jbo.xml|   11 +--
 i18npool/source/localedata/data/kab_DZ.xml |   11 +--
 i18npool/source/localedata/data/kk_KZ.xml  |   11 +--
 i18npool/source/localedata/data/kmr_Latn_TR.xml|   11 +--
 i18npool/source/localedata/data/lg_UG.xml  |   11 +--
 i18npool/source/localedata/data/lgr_SB.xml |   11 +--
 i18npool/source/localedata/data/lld_IT.xml |   11 +--
 i18npool/source/localedata/data/ln_CD.xml  |   11 +--
 i18npool/source/localedata/data/mk_MK.xml  |   11 +--
 i18npool/source/localedata/data/mos_BF.xml |   11 +--
 i18npool/source/localedata/data/mt_MT.xml  |   11 +--
 i18npool/source/localedata/data/myv_RU.xml |   11 +--
 i18npool/source/localedata/data/ny_MW.xml  |   11 +--
 i18npool/source/localedata/data/oc_FR_lengadoc.xml |   11 +--
 i18npool/source/localedata/data/om_ET.xml  |   11 +--
 i18npool/source/localedata/data/pap_CW.xml |   11 +--
 i18npool/source/localedata/data/plt_MG.xml |   11 +--
 i18npool/source/localedata/data/rue_SK.xml |   11 +--
 i18npool/source/localedata/data/sc_IT.xml  |   11 +--
 i18npool/source/localedata/data/sg_CF.xml  |   11 +--
 i18npool/source/localedata/data/shs_CA.xml |   11 +--
 i18npool/source/localedata/data/sid_ET.xml |   11 +--
 i18npool/source/localedata/data/so_SO.xml  |   11 +--
 i18npool/source/localedata/data/ti_ET.xml  |   11 +--
 i18npool/source/localedata/data/tk_TM.xml  |   11 +--
 i18npool/source/localedata/data/tpi_PG.xml |   11 +--
 i18npool/source/localedata/data/ug_CN.xml  |   11 +--
 i18npool/source/localedata/data/ur_PK.xml  |   11 +--
 i18npool/source/localedata/data/vi_VN.xml  |   11 +--
 48 files changed, 48 insertions(+), 480 deletions(-)

New commits:
commit ef3b7b7118c854d8ca67cc2249b6c08ddc1885eb
Author: Justin Luth 
AuthorDate: Sat Dec 31 17:52:34 2022 -0500
Commit: Justin Luth 
CommitDate: Mon Jan 2 22:53:58 2023 +

NFC tdf#56258 i18npool NumberingLevel: use ref="en_US"

In preparing to see what improvements can be made to
list defaults, it is helpful to see what customizations
have been made to the US defaults. Those that match
identically were changed to simple refs.

Thanks to https://www.linuxtopia.org/online_books/
linux_tool_guides/the_sed_faq/sedfaq4_013.html
The script there helped to generate sed expressions.

sed -f ref.sed *.xml
- ref.sed -
\##,\## {
:ack
N;
\##! b ack
s#\
\
\
\
\
\
\
\
\
  ##;
}
---

- ref2.sed -
\##,\## {
:ack
N;
\##! b ack
s#\
\
\
\
\
\
\
\
\
  ##;
}



Change-Id: I85d8a8ed095f19d08b035d7f2c4e2cd94ff08c76
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144890
Tested-by: Justin Luth 
Reviewed-by: Justin Luth 

diff --git a/i18npool/source/localedata/data/ak_GH.xml 
b/i18npool/source/localedata/data/ak_GH.xml
index 8a380241adf3..2c42a3d9f37b 100644
--- a/i18npool/source/localedata/data/ak_GH.xml
+++ b/i18npool/source/localedata/data/ak_GH.xml

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

2023-01-02 Thread Noel Grandin (via logerrit)
 include/vcl/bitmap.hxx|   15 ++
 vcl/source/bitmap/bitmappaint.cxx |  253 --
 2 files changed, 150 insertions(+), 118 deletions(-)

New commits:
commit 5244e7cab70a3c1f567e2e3cda41bd753e5cb530
Author: Noel Grandin 
AuthorDate: Mon Jan 2 19:21:34 2023 +0200
Commit: Noel Grandin 
CommitDate: Mon Jan 2 20:23:10 2023 +

split OutputDevice::CreateMask method

to make it easier to understand, very little of the code is shared
between the nTol == 0 and the nTol != 0 cases.

Also flatten the code structure a little.

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

diff --git a/include/vcl/bitmap.hxx b/include/vcl/bitmap.hxx
index 123b48fcd752..a732e77f3a97 100644
--- a/include/vcl/bitmap.hxx
+++ b/include/vcl/bitmap.hxx
@@ -343,6 +343,19 @@ public:
  */
 boolRotate( Degree10 nAngle10, const Color& rFillColor 
);
 
+/** Create on-off mask from bitmap
+
+This method creates a bitmask from the bitmap, where every
+pixel that equals rTransColor is set transparent, the rest
+opaque.
+
+@param rTransColor
+Color value where the bitmask should be transparent
+
+@return the resulting bitmask.
+ */
+Bitmap  CreateMask( const Color& rTransColor ) const;
+
 /** Create on-off mask from bitmap
 
 This method creates a bitmask from the bitmap, where every
@@ -359,7 +372,7 @@ public:
 
 @return the resulting bitmask.
  */
-Bitmap  CreateMask( const Color& rTransColor, sal_uInt8 
nTol = 0 ) const;
+Bitmap  CreateMask( const Color& rTransColor, sal_uInt8 
nTol ) const;
 
 /** Create region of similar colors in a given rectangle
 
diff --git a/vcl/source/bitmap/bitmappaint.cxx 
b/vcl/source/bitmap/bitmappaint.cxx
index c0f6715238e7..cdece0f438ed 100644
--- a/vcl/source/bitmap/bitmappaint.cxx
+++ b/vcl/source/bitmap/bitmappaint.cxx
@@ -433,18 +433,19 @@ bool Bitmap::Rotate(Degree10 nAngle10, const Color& 
rFillColor)
 return bRet;
 };
 
-Bitmap Bitmap::CreateMask(const Color& rTransColor, sal_uInt8 nTol) const
+Bitmap Bitmap::CreateMask(const Color& rTransColor) const
 {
 ScopedReadAccess pReadAcc(const_cast(*this));
+if (!pReadAcc)
+return Bitmap();
 
 // Historically LO used 1bpp masks, but 8bpp masks are much faster,
 // better supported by hardware, and the memory savings are not worth
 // it anymore.
 // TODO: Possibly remove the 1bpp code later.
 
-if (!nTol && pReadAcc
-&& (pReadAcc->GetScanlineFormat() == ScanlineFormat::N1BitLsbPal
-|| pReadAcc->GetScanlineFormat() == ScanlineFormat::N1BitMsbPal)
+if ((pReadAcc->GetScanlineFormat() == ScanlineFormat::N1BitLsbPal
+ || pReadAcc->GetScanlineFormat() == ScanlineFormat::N1BitMsbPal)
 && pReadAcc->GetBestMatchingColor(COL_WHITE) == 
pReadAcc->GetBestMatchingColor(rTransColor))
 {
 // if we're a 1 bit pixel already, and the transcolor matches the 
color that would replace it
@@ -455,146 +456,164 @@ Bitmap Bitmap::CreateMask(const Color& rTransColor, 
sal_uInt8 nTol) const
 auto ePixelFormat = vcl::PixelFormat::N8_BPP;
 Bitmap aNewBmp(GetSizePixel(), ePixelFormat, &Bitmap::GetGreyPalette(256));
 BitmapScopedWriteAccess pWriteAcc(aNewBmp);
-bool bRet = false;
+if (!pWriteAcc)
+return Bitmap();
 
-if (pWriteAcc && pReadAcc)
-{
-const tools::Long nWidth = pReadAcc->Width();
-const tools::Long nHeight = pReadAcc->Height();
-const BitmapColor aBlack(pWriteAcc->GetBestMatchingColor(COL_BLACK));
-const BitmapColor aWhite(pWriteAcc->GetBestMatchingColor(COL_WHITE));
+const tools::Long nWidth = pReadAcc->Width();
+const tools::Long nHeight = pReadAcc->Height();
+const BitmapColor aBlack(pWriteAcc->GetBestMatchingColor(COL_BLACK));
+const BitmapColor aWhite(pWriteAcc->GetBestMatchingColor(COL_WHITE));
+
+const BitmapColor aTest(pReadAcc->GetBestMatchingColor(rTransColor));
 
-if (!nTol)
+if (pWriteAcc->GetScanlineFormat() == pReadAcc->GetScanlineFormat() && 
aWhite.GetIndex() == 1
+&& (pReadAcc->GetScanlineFormat() == ScanlineFormat::N1BitLsbPal
+|| pReadAcc->GetScanlineFormat() == ScanlineFormat::N1BitMsbPal))
+{
+for (tools::Long nY = 0; nY < nHeight; ++nY)
 {
-const BitmapColor 
aTest(pReadAcc->GetBestMatchingColor(rTransColor));
+Scanline pSrc = pReadAcc->GetScanline(nY);
+Scanline pDst = pWriteAcc->GetScanline(nY);
+assert(pWriteAcc->GetScanlineSize() == 
pReadAcc->GetScanlineSize());
+const tools::Long nScanlineSize = pWriteAcc->GetScanlineSize();
+for (tools::Long nX = 0; nX < nScanlineSize; ++nX)
+  

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

2023-01-02 Thread Caolán McNamara (via logerrit)
 sd/qa/unit/uiimpress.cxx |2 +-
 svx/sdi/svx.sdi  |   16 
 sw/sdi/swriter.sdi   |4 ++--
 3 files changed, 11 insertions(+), 11 deletions(-)

New commits:
commit cc4ead451cb3b6ce6994370b3a9263756ea284d1
Author: Caolán McNamara 
AuthorDate: Thu Dec 29 19:37:57 2022 +
Commit: Caolán McNamara 
CommitDate: Mon Jan 2 19:04:31 2023 +

Resolves: tdf#150339 two arguments called "Color"

from around:

commit 780d83771af89e6b27b3618d9c033c3fb29ba803
Date:   Mon Nov 4 17:17:58 2019 +0100

jsdialogs: .uno:Color with string argument

and:

commit 1144712bb99cfb699e73b473ee44351c50a35613
Date:   Mon Oct 28 10:19:50 2019 +0100

jsdialogs: make possible to set .uno:BackgroundColor in Writer

SvxColorItem Color SID_ATTR_CHAR_COLOR
(SfxStringItem Color SID_ATTR_COLOR_STR, SvxColorItem Color 
SID_ATTR_CHAR_COLOR,...
   ^  ^

rename the most recently added to "ColorString"

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

diff --git a/sd/qa/unit/uiimpress.cxx b/sd/qa/unit/uiimpress.cxx
index 13f072cf2488..0235cada8194 100644
--- a/sd/qa/unit/uiimpress.cxx
+++ b/sd/qa/unit/uiimpress.cxx
@@ -757,7 +757,7 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testPageFillColor)
 // Set FillPageColor
 
 uno::Sequence 
aPropertyValues(comphelper::InitPropertySequence({
-{ "Color", uno::Any(OUString("ff")) },
+{ "ColorString", uno::Any(OUString("ff")) },
 }));
 
 dispatchCommand(mxComponent, ".uno:FillPageColor", aPropertyValues);
diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi
index d1f02f5b1d3b..f2e040712566 100644
--- a/svx/sdi/svx.sdi
+++ b/svx/sdi/svx.sdi
@@ -408,7 +408,7 @@ SfxVoidItem TableDesign SID_TABLEDESIGN
 ]
 
 SvxColorItem BackgroundColor SID_BACKGROUND_COLOR
-(SfxStringItem Color SID_ATTR_COLOR_STR, SvxColorItem BackgroundColor 
SID_BACKGROUND_COLOR)
+(SfxStringItem ColorString SID_ATTR_COLOR_STR, SvxColorItem BackgroundColor 
SID_BACKGROUND_COLOR)
 
 [
 AutoUpdate = TRUE,
@@ -1506,7 +1506,7 @@ SfxVoidItem ClearOutline SID_OUTLINE_DELETEALL
 
 
 SvxColorItem Color SID_ATTR_CHAR_COLOR
-(SfxStringItem Color SID_ATTR_COLOR_STR, SvxColorItem Color 
SID_ATTR_CHAR_COLOR, SfxInt16Item ColorThemeIndex SID_ATTR_COLOR_THEME_INDEX, 
SfxInt16Item ColorLumMod SID_ATTR_COLOR_LUM_MOD, SfxInt16Item ColorLumOff 
SID_ATTR_COLOR_LUM_OFF)
+(SfxStringItem ColorString SID_ATTR_COLOR_STR, SvxColorItem Color 
SID_ATTR_CHAR_COLOR, SfxInt16Item ColorThemeIndex SID_ATTR_COLOR_THEME_INDEX, 
SfxInt16Item ColorLumMod SID_ATTR_COLOR_LUM_MOD, SfxInt16Item ColorLumOff 
SID_ATTR_COLOR_LUM_OFF)
 [
 AutoUpdate = TRUE,
 FastCall = FALSE,
@@ -1524,7 +1524,7 @@ SvxColorItem Color SID_ATTR_CHAR_COLOR
 ]
 
 SvxColorItem CharBackColor SID_ATTR_CHAR_BACK_COLOR
-(SfxStringItem Color SID_ATTR_COLOR_STR, SvxColorItem CharBackColor 
SID_ATTR_CHAR_BACK_COLOR)
+(SfxStringItem ColorString SID_ATTR_COLOR_STR, SvxColorItem CharBackColor 
SID_ATTR_CHAR_BACK_COLOR)
 [
 AutoUpdate = TRUE,
 FastCall = FALSE,
@@ -2798,7 +2798,7 @@ XFillBitmapItem FillPageBitmap SID_ATTR_PAGE_BITMAP
 ]
 
 XFillColorItem FillColor SID_ATTR_FILL_COLOR
-(SfxStringItem Color SID_ATTR_COLOR_STR, XFillColorItem FillColor 
SID_ATTR_FILL_COLOR, SfxInt16Item ColorThemeIndex SID_ATTR_COLOR_THEME_INDEX, 
SfxInt16Item ColorLumMod SID_ATTR_COLOR_LUM_MOD, SfxInt16Item ColorLumOff 
SID_ATTR_COLOR_LUM_OFF)
+(SfxStringItem ColorString SID_ATTR_COLOR_STR, XFillColorItem FillColor 
SID_ATTR_FILL_COLOR, SfxInt16Item ColorThemeIndex SID_ATTR_COLOR_THEME_INDEX, 
SfxInt16Item ColorLumMod SID_ATTR_COLOR_LUM_MOD, SfxInt16Item ColorLumOff 
SID_ATTR_COLOR_LUM_OFF)
 [
 AutoUpdate = TRUE,
 FastCall = FALSE,
@@ -2816,7 +2816,7 @@ XFillColorItem FillColor SID_ATTR_FILL_COLOR
 ]
 
 XFillColorItem FillPageColor SID_ATTR_PAGE_COLOR
-(SfxStringItem Color SID_ATTR_COLOR_STR)
+(SfxStringItem ColorString SID_ATTR_COLOR_STR)
 [
 /* flags: */
 AutoUpdate = TRUE,
@@ -5677,7 +5677,7 @@ SfxVoidItem ArrowsToolbox SID_DRAWTBX_ARROWS
 ]
 
 SvxColorItem FrameLineColor SID_FRAME_LINECOLOR
-(SfxStringItem Color SID_ATTR_COLOR_STR, SvxColorItem FrameLineColor 
SID_FRAME_LINECOLOR)
+(SfxStringItem ColorString SID_ATTR_COLOR_STR, SvxColorItem FrameLineColor 
SID_FRAME_LINECOLOR)
 [
 AutoUpdate = TRUE,
 FastCall = FALSE,
@@ -7874,7 +7874,7 @@ SdrOnOffItem FillShadow SID_ATTR_FILL_SHADOW
 ]
 
 XColorItem FillShadowColor SID_ATTR_SHADOW_COLOR
-(SfxStringItem Color SID_ATTR_COLOR_STR)
+(SfxStringItem ColorString SID_ATTR_COLOR_STR)
 [
 
 AutoUpdate = TRUE,
@@ -9118,7 +9118,7 @@ SvxWordLineModeItem WordMode SID_ATTR_CHAR_WORDLINEMODE
 
 
 XLineColorItem XLineColor SID_ATTR_LINE_COLOR
-(SfxStringItem Color SID_ATTR_COLOR_STR, XLineColorItem XLineColor 

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

2023-01-02 Thread Rafael Lima (via logerrit)
 cui/source/dialogs/SpellDialog.cxx |8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit 9adcf14d9b2e9dffd47a26eae202da348675a5e4
Author: Rafael Lima 
AuthorDate: Wed Nov 2 18:54:24 2022 +0200
Commit: Caolán McNamara 
CommitDate: Mon Jan 2 19:03:52 2023 +

tdf#116566 Make Spellcheck dialog respect dark background

This patch makes the sentence in the spellcheck dialog respect the colors 
in the selected color scheme. More specifically, it uses the AutoSpellcheck 
color and the Font Color in the Edit Engine.

Change-Id: I0f8e842417645250c9145d1e37d8cf52c290379e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142147
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
(cherry picked from commit 1de8308d40fad8e9281d2b491f8c5c919fda82f4)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144910

diff --git a/cui/source/dialogs/SpellDialog.cxx 
b/cui/source/dialogs/SpellDialog.cxx
index 49e1415e744e..21f7f2b4da80 100644
--- a/cui/source/dialogs/SpellDialog.cxx
+++ b/cui/source/dialogs/SpellDialog.cxx
@@ -1140,6 +1140,7 @@ void 
SentenceEditWindow_Impl::SetDrawingArea(weld::DrawingArea* pDrawingArea)
 OutputDevice& rDevice = pDrawingArea->get_ref_device();
 rDevice.SetBackground(aBgColor);
 m_xEditView->SetBackgroundColor(aBgColor);
+m_xEditEngine->SetBackgroundColor(aBgColor);
 }
 
 SentenceEditWindow_Impl::~SentenceEditWindow_Impl()
@@ -1671,8 +1672,13 @@ void SentenceEditWindow_Impl::MoveErrorMarkTo(sal_Int32 
nStart, sal_Int32 nEnd,
 m_xEditEngine->RemoveAttribs(aAll, false, EE_CHAR_WEIGHT_CJK);
 m_xEditEngine->RemoveAttribs(aAll, false, EE_CHAR_WEIGHT_CTL);
 
+// tdf#116566 Use color defined in the current Color Scheme
+Color aSpellErrorCollor = 
svtools::ColorConfig().GetColorValue(svtools::SPELL).nColor;
+
+// TODO: Create a new Color Scheme entry for grammar mistakes and use it 
below
+// instead of using hardcoded COL_LIGHTBLUE
 SfxItemSet aSet(m_xEditEngine->GetEmptyItemSet());
-aSet.Put(SvxColorItem(bGrammarError ? COL_LIGHTBLUE : COL_LIGHTRED, 
EE_CHAR_COLOR));
+aSet.Put(SvxColorItem(bGrammarError ? COL_LIGHTBLUE : aSpellErrorCollor, 
EE_CHAR_COLOR));
 aSet.Put(SvxWeightItem(WEIGHT_BOLD, EE_CHAR_WEIGHT));
 aSet.Put(SvxWeightItem(WEIGHT_BOLD, EE_CHAR_WEIGHT_CJK));
 aSet.Put(SvxWeightItem(WEIGHT_BOLD, EE_CHAR_WEIGHT_CTL));


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

2023-01-02 Thread Miklos Vajna (via logerrit)
 sw/qa/uibase/shells/shells.cxx  |   31 +++
 sw/source/uibase/shells/textfld.cxx |   10 ++
 2 files changed, 41 insertions(+)

New commits:
commit a178a2ac6df8dc63a7ab8d4a19b90ae8a17baca4
Author: Miklos Vajna 
AuthorDate: Mon Jan 2 14:45:53 2023 +0100
Commit: Miklos Vajna 
CommitDate: Mon Jan 2 18:26:32 2023 +

sw UI: fix crash on inserting a fieldmark inside a fieldmark

Inserting a fieldmark using .uno:TextFormField, then entering into that
fieldmark using the cursor, finally doing in insertion again using
.uno:TextFormField resulted in a crash.

The problem is that lcl_SetFieldMarks() uses 3
IDocumentContentOperations().InsertString() calls to insert the field
start/separator/end, but right after inserting the field start we
already create an sw::InsertText hint, which works with an inconsistent
string (the start is already inserted but not the separator / end).

Fix the problem by just not allowing the insertion of fieldmarks inside
fieldmarks on the UI: these are meant to be read-only for the user, so
fieldmark insertion is OK to be not working, as long as a clear error
message is provided.

An alternative approach would be to insert the inner fieldmark in a way
similar to how import filters can do it, but that would be more work.

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

diff --git a/sw/qa/uibase/shells/shells.cxx b/sw/qa/uibase/shells/shells.cxx
index a6603984afbb..2f89720cf570 100644
--- a/sw/qa/uibase/shells/shells.cxx
+++ b/sw/qa/uibase/shells/shells.cxx
@@ -501,6 +501,37 @@ CPPUNIT_TEST_FIXTURE(SwUibaseShellsTest, 
testUpdateBookmarks)
 CPPUNIT_ASSERT_EQUAL(OUString("Anew result 1Cnew result 2E"), aActual);
 }
 
+CPPUNIT_TEST_FIXTURE(SwUibaseShellsTest, testInsertFieldmarkReadonly)
+{
+// Given a document with a fieldmark, the cursor inside the fieldmark:
+createSwDoc();
+uno::Sequence aArgs = {
+comphelper::makePropertyValue("FieldType", 
uno::Any(OUString(ODF_UNHANDLED))),
+comphelper::makePropertyValue("FieldCommand", uno::Any(OUString("my 
command"))),
+comphelper::makePropertyValue("FieldResult", uno::Any(OUString("my 
result"))),
+};
+dispatchCommand(mxComponent, ".uno:TextFormField", aArgs);
+SwDoc* pDoc = getSwDoc();
+SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+SwCursor* pCursor = pWrtShell->GetCursor();
+pCursor->SttEndDoc(/*bSttDoc=*/true);
+pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, 
/*bBasicCall=*/false);
+
+// When trying to insert an inner fieldmark:
+// Without the accompanying fix in place, this test would have crashed.
+dispatchCommand(mxComponent, ".uno:TextFormField", aArgs);
+
+// Then make sure the read-only content refuses to accept that inner 
fieldmark, so we still have
+// just one:
+size_t nActual = 0;
+IDocumentMarkAccess& rIDMA = *pDoc->getIDocumentMarkAccess();
+for (auto it = rIDMA.getFieldmarksBegin(); it != rIDMA.getFieldmarksEnd(); 
++it)
+{
+++nActual;
+}
+CPPUNIT_ASSERT_EQUAL(static_cast(1), nActual);
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/shells/textfld.cxx 
b/sw/source/uibase/shells/textfld.cxx
index 12cc13a15bd2..aad7d0891bd9 100644
--- a/sw/source/uibase/shells/textfld.cxx
+++ b/sw/source/uibase/shells/textfld.cxx
@@ -719,6 +719,16 @@ FIELD_INSERT:
 aFieldCode = pFieldCode->GetValue();
 }
 
+if (rSh.HasReadonlySel())
+{
+// Inform the user that the request has been ignored.
+auto xInfo = std::make_shared(
+GetView().GetFrameWeld(), 
"modules/swriter/ui/inforeadonlydialog.ui",
+"InfoReadonlyDialog");
+weld::DialogController::runAsync(xInfo, [](sal_Int32 
/*nResult*/) {});
+break;
+}
+
 
rSh.GetDoc()->GetIDocumentUndoRedo().StartUndo(SwUndoId::INSERT_FORM_FIELD, 
nullptr);
 // Don't update the layout after inserting content and before 
deleting temporary
 // text nodes.


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

2023-01-02 Thread Tor Lillqvist (via logerrit)
 vcl/headless/svpinst.cxx |   82 ---
 vcl/inc/headless/svpinst.hxx |9 +++-
 2 files changed, 22 insertions(+), 69 deletions(-)

New commits:
commit 91526a2f53d5c7a703b9fc5fbc1728ee50854cc1
Author: Tor Lillqvist 
AuthorDate: Thu Dec 29 12:16:25 2022 +0200
Commit: Tor Lillqvist 
CommitDate: Mon Jan 2 17:57:16 2023 +

Use std synchronisation APIs instead of a pipe

The immediate reason for this is that pipes are broken in the
Emscripten runtime, see
https://github.com/emscripten-core/emscripten/issues/13214. But if we
can drop the use of a pipe for other platforms, too, why not.

Without this, when attemting to run Collabora Online as WASM, I get:
Aborted(Assertion failed: nRet == 1, at: 
.../vcl/headless/svpinst.cxx,538,DoYield)

It is quite possible that the code could be simplified drastically. I
only replaced the use of a pipe with hopefully equivalent use of a
queue, a condition variable, and a mutex.

Change-Id: I9259ba36afeabce6474a1aec827d01bcbbd4412b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144944
Reviewed-by: Michael Meeks 
Tested-by: Jenkins

diff --git a/vcl/headless/svpinst.cxx b/vcl/headless/svpinst.cxx
index 5a86826423e3..19eef8997689 100644
--- a/vcl/headless/svpinst.cxx
+++ b/vcl/headless/svpinst.cxx
@@ -22,9 +22,6 @@
 
 #include 
 
-#include 
-#include 
-#include 
 #include 
 #include 
 #include 
@@ -76,14 +73,13 @@ do { \
 #define DBG_TESTSVPYIELDMUTEX() ((void)0)
 #endif
 
-#if !defined(ANDROID) && !defined(IOS)
+#if !defined(ANDROID) && !defined(IOS) && !defined(EMSCRIPTEN)
 
 static void atfork_child()
 {
 if (SvpSalInstance::s_pDefaultInstance != nullptr)
 {
-SvpSalInstance::s_pDefaultInstance->CloseWakeupPipe(false);
-SvpSalInstance::s_pDefaultInstance->CreateWakeupPipe(false);
+SvpSalInstance::s_pDefaultInstance->CloseWakeupPipe();
 }
 }
 
@@ -97,10 +93,9 @@ SvpSalInstance::SvpSalInstance( 
std::unique_ptr pMutex )
 m_nTimeoutMS= 0;
 
 m_MainThread = osl::Thread::getCurrentIdentifier();
-CreateWakeupPipe(true);
 if( s_pDefaultInstance == nullptr )
 s_pDefaultInstance = this;
-#if !defined(ANDROID) && !defined(IOS)
+#if !defined(ANDROID) && !defined(IOS) && !defined(EMSCRIPTEN)
 pthread_atfork(nullptr, nullptr, atfork_child);
 #endif
 }
@@ -109,62 +104,16 @@ SvpSalInstance::~SvpSalInstance()
 {
 if( s_pDefaultInstance == this )
 s_pDefaultInstance = nullptr;
-CloseWakeupPipe(true);
+CloseWakeupPipe();
 }
 
-void SvpSalInstance::CloseWakeupPipe(bool log)
+void SvpSalInstance::CloseWakeupPipe()
 {
 SvpSalYieldMutex *const 
pMutex(dynamic_cast(GetYieldMutex()));
 if (!pMutex)
 return;
-if (pMutex->m_FeedbackFDs[0] != -1)
-{
-if (log)
-{
-SAL_INFO("vcl.headless", "CloseWakeupPipe: Closing inherited 
feedback pipe: [" << pMutex->m_FeedbackFDs[0] << "," << 
pMutex->m_FeedbackFDs[1] << "]");
-}
-close (pMutex->m_FeedbackFDs[0]);
-close (pMutex->m_FeedbackFDs[1]);
-pMutex->m_FeedbackFDs[0] = pMutex->m_FeedbackFDs[1] = -1;
-}
-}
-
-void SvpSalInstance::CreateWakeupPipe(bool log)
-{
-SvpSalYieldMutex *const 
pMutex(dynamic_cast(GetYieldMutex()));
-if (!pMutex)
-return;
-if (pipe (pMutex->m_FeedbackFDs) == -1)
-{
-if (log)
-{
-SAL_WARN("vcl.headless", "Could not create feedback pipe: " << 
strerror(errno));
-std::abort();
-}
-}
-else
-{
-if (log)
-{
-SAL_INFO("vcl.headless", "CreateWakeupPipe: Created feedback pipe: 
[" << pMutex->m_FeedbackFDs[0] << "," << pMutex->m_FeedbackFDs[1] << "]");
-}
-
-int flags;
-
-// set close-on-exec descriptor flag.
-if ((flags = fcntl (pMutex->m_FeedbackFDs[0], F_GETFD)) != -1)
-{
-flags |= FD_CLOEXEC;
-(void) fcntl(pMutex->m_FeedbackFDs[0], F_SETFD, flags);
-}
-if ((flags = fcntl (pMutex->m_FeedbackFDs[1], F_GETFD)) != -1)
-{
-flags |= FD_CLOEXEC;
-(void) fcntl(pMutex->m_FeedbackFDs[1], F_SETFD, flags);
-}
-
-// retain the default blocking I/O for feedback pipe
-}
+while (!pMutex->m_FeedbackPipe.empty())
+pMutex->m_FeedbackPipe.pop();
 }
 
 void SvpSalInstance::TriggerUserEventProcessing()
@@ -328,9 +277,6 @@ void SvpSalInstance::ProcessEvent( SalUserEvent aEvent )
 
 SvpSalYieldMutex::SvpSalYieldMutex()
 {
-#ifndef IOS
-m_FeedbackFDs[0] = m_FeedbackFDs[1] = -1;
-#endif
 }
 
 SvpSalYieldMutex::~SvpSalYieldMutex()
@@ -367,11 +313,11 @@ void SvpSalYieldMutex::doAcquire(sal_uInt32 const 
nLockCount)
 m_bNoYieldLock = true;
 bool const bEvents = pInst->DoYield(false, request == 
SvpRequest::MainThreadDispatchAllEvents);
 m_bNoYieldLock = false

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

2023-01-02 Thread Andrea Gelmini (via logerrit)
 oox/source/shape/WpsContext.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 777df29e306be375c48c586855376bc25f4b85f4
Author: Andrea Gelmini 
AuthorDate: Mon Jan 2 14:50:46 2023 +0100
Commit: Julien Nabet 
CommitDate: Mon Jan 2 14:14:29 2023 +

Fix typo

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

diff --git a/oox/source/shape/WpsContext.cxx b/oox/source/shape/WpsContext.cxx
index 943d639fd8f6..767f3807607f 100644
--- a/oox/source/shape/WpsContext.cxx
+++ b/oox/source/shape/WpsContext.cxx
@@ -97,7 +97,7 @@ bool lcl_getTextPropsFromFrameText(const 
uno::Reference& xText,
 // CharInteropGrabBag puts all attributes of an element into a property with 
Name="attributes" and
 // Value being a sequence of the attributes. This methods finds the value of 
an individual rName
 // attribute and puts it into rValue parameter. If it does not find it, rValue 
is unchanged and
-// the methode returns false, otherwise it returns true.
+// the method returns false, otherwise it returns true.
 bool lcl_getAttributeAsString(const uno::Sequence& 
aPropertyValueAsSeq,
   const OUString& rName, OUString& rValue)
 {
@@ -219,7 +219,7 @@ void lcl_getFillDetailsFromPropSeq(const 
uno::Sequence& rT
 if ((aTextFillMap.getValue(u"gradFill") >>= aPropSeq) && 
aPropSeq.hasElements())
 {
 rFillProperties.moFillType = oox::XML_gradFill;
-// aPropSeq should have two items. One ist "gsLst" for the stop 
colors, the other is
+// aPropSeq should have two items. One is "gsLst" for the stop colors, 
the other is
 // either "lin" or "path" for the kind of gradient.
 // First get stop colors
 comphelper::SequenceAsHashMap aPropMap(aPropSeq);


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

2023-01-02 Thread Andrea Gelmini (via logerrit)
 oox/source/shape/WpsContext.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 3b7c9049c6887c0004edb9da9fd4a68d4c8ab951
Author: Andrea Gelmini 
AuthorDate: Mon Jan 2 14:49:28 2023 +0100
Commit: Julien Nabet 
CommitDate: Mon Jan 2 14:13:50 2023 +

Fix typo

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

diff --git a/oox/source/shape/WpsContext.cxx b/oox/source/shape/WpsContext.cxx
index 86e02d24b146..943d639fd8f6 100644
--- a/oox/source/shape/WpsContext.cxx
+++ b/oox/source/shape/WpsContext.cxx
@@ -96,7 +96,7 @@ bool lcl_getTextPropsFromFrameText(const 
uno::Reference& xText,
 
 // CharInteropGrabBag puts all attributes of an element into a property with 
Name="attributes" and
 // Value being a sequence of the attributes. This methods finds the value of 
an individual rName
-// attribute and puts it into rValue paramenter. If it does not find it, 
rValue is unchanged and
+// attribute and puts it into rValue parameter. If it does not find it, rValue 
is unchanged and
 // the methode returns false, otherwise it returns true.
 bool lcl_getAttributeAsString(const uno::Sequence& 
aPropertyValueAsSeq,
   const OUString& rName, OUString& rValue)


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

2023-01-02 Thread Andrea Gelmini (via logerrit)
 oox/qa/unit/shape.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 75b8f7693ceb2d78acc066c4ea92a9d085a9d7d6
Author: Andrea Gelmini 
AuthorDate: Mon Jan 2 14:48:35 2023 +0100
Commit: Julien Nabet 
CommitDate: Mon Jan 2 14:13:05 2023 +

Fix typo

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

diff --git a/oox/qa/unit/shape.cxx b/oox/qa/unit/shape.cxx
index bc341faf9683..19b9f739ad60 100644
--- a/oox/qa/unit/shape.cxx
+++ b/oox/qa/unit/shape.cxx
@@ -326,7 +326,7 @@ CPPUNIT_TEST_FIXTURE(OoxShapeTest, 
testTdf54095_SmartArtThemeTextColor)
 CPPUNIT_TEST_FIXTURE(OoxShapeTest, testWriterFontwork)
 {
 loadFromURL(u"tdf125885_WordArt.docx");
-// Without the patch WordArt in text document was imported as rectangular 
custome shape with
+// Without the patch WordArt in text document was imported as rectangular 
custom shape with
 // attached frame. So there was no artistic text at all. Now it is 
imported as Fontwork.
 // This test covers some basic properties.
 
@@ -401,7 +401,7 @@ CPPUNIT_TEST_FIXTURE(OoxShapeTest, testWriterFontwork)
 CPPUNIT_TEST_FIXTURE(OoxShapeTest, testWriterFontwork2)
 {
 loadFromURL(u"tdf125885_WordArt2.docx");
-// Without the patch WordArt in text document was imported as rectangular 
custome shape with
+// Without the patch WordArt in text document was imported as rectangular 
custom shape with
 // attached frame. So there was no artistic text at all. Now it is 
imported as Fontwork.
 // This test covers whether theme color properties are correctly converted 
on import.
 
@@ -446,7 +446,7 @@ CPPUNIT_TEST_FIXTURE(OoxShapeTest, testWriterFontwork2)
 CPPUNIT_TEST_FIXTURE(OoxShapeTest, testWriterFontwork3)
 {
 loadFromURL(u"tdf125885_WordArt3.docx");
-// Without the patch WordArt in text document was imported as rectangular 
custome shape with
+// Without the patch WordArt in text document was imported as rectangular 
custom shape with
 // attached frame. So there was no artistic text at all. Now it is 
imported as Fontwork.
 // This test covers some aspects of import of gradient fill.
 


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - solenv/clang-format vcl/jsdialog

2023-01-02 Thread Szymon Kłos (via logerrit)
 solenv/clang-format/excludelist |1 
 vcl/jsdialog/enabled.cxx|  213 ++--
 2 files changed, 123 insertions(+), 91 deletions(-)

New commits:
commit 5d7f44821d737958a8ea7825f4233079aee77db8
Author: Szymon Kłos 
AuthorDate: Fri Dec 2 08:44:13 2022 +0100
Commit: Michael Meeks 
CommitDate: Mon Jan 2 13:41:22 2023 +

jsdialog: sort enabled .ui list

and exclude form clang format to not break that

Change-Id: I85a7843d564c6d2ff7397870c36c3ad0c0767eb0

diff --git a/solenv/clang-format/excludelist b/solenv/clang-format/excludelist
index f70f91331a2e..d3b97ee92735 100644
--- a/solenv/clang-format/excludelist
+++ b/solenv/clang-format/excludelist
@@ -14752,6 +14752,7 @@ vcl/inc/wizdlg.hxx
 vcl/ios/dummies.cxx
 vcl/ios/iosinst.cxx
 vcl/ios/salios.cxx
+vcl/jsdialog/enabled.cxx
 vcl/null/printerinfomanager.cxx
 vcl/osx/DataFlavorMapping.cxx
 vcl/osx/DataFlavorMapping.hxx
diff --git a/vcl/jsdialog/enabled.cxx b/vcl/jsdialog/enabled.cxx
index b3be08c4ba80..3b3f1e045ed3 100644
--- a/vcl/jsdialog/enabled.cxx
+++ b/vcl/jsdialog/enabled.cxx
@@ -18,76 +18,85 @@ bool isBuilderEnabled(std::u16string_view rUIFile, bool 
bMobile)
 // mobile only dialogs
 if (bMobile)
 {
-if (rUIFile == u"modules/swriter/ui/wordcount-mobile.ui"
-|| rUIFile == u"svx/ui/findreplacedialog-mobile.ui"
-|| rUIFile == u"modules/swriter/ui/watermarkdialog.ui"
-|| rUIFile == u"modules/scalc/ui/validationdialog.ui"
+if (// scalc
+rUIFile == u"modules/scalc/ui/erroralerttabpage-mobile.ui"
 || rUIFile == u"modules/scalc/ui/validationcriteriapage.ui"
+|| rUIFile == u"modules/scalc/ui/validationdialog.ui"
 || rUIFile == u"modules/scalc/ui/validationhelptabpage-mobile.ui"
-|| rUIFile == u"modules/scalc/ui/erroralerttabpage-mobile.ui"
-|| rUIFile == u"modules/scalc/ui/validationdialog.ui")
+// swriter
+|| rUIFile == u"modules/swriter/ui/watermarkdialog.ui"
+|| rUIFile == u"modules/swriter/ui/wordcount-mobile.ui"
+// svx
+|| rUIFile == u"svx/ui/findreplacedialog-mobile.ui")
 {
 return true;
 }
 }
 
-if (rUIFile == u"modules/scalc/ui/pivottablelayoutdialog.ui"
-|| rUIFile == u"modules/scalc/ui/selectsource.ui"
-|| rUIFile == u"modules/scalc/ui/managenamesdialog.ui"
-|| rUIFile == u"modules/scalc/ui/definename.ui"
-|| rUIFile == u"modules/scalc/ui/correlationdialog.ui"
-|| rUIFile == u"modules/scalc/ui/samplingdialog.ui"
-|| rUIFile == u"modules/scalc/ui/descriptivestatisticsdialog.ui"
+if (// cui
+rUIFile == u"cui/ui/formatnumberdialog.ui"
+|| rUIFile == u"cui/ui/macroselectordialog.ui"
+|| rUIFile == u"cui/ui/numberingformatpage.ui"
+|| rUIFile == u"cui/ui/password.ui"
+|| rUIFile == u"cui/ui/splitcellsdialog.ui"
+|| rUIFile == u"cui/ui/widgettestdialog.ui"
+// scalc
 || rUIFile == u"modules/scalc/ui/analysisofvariancedialog.ui"
-|| rUIFile == u"modules/scalc/ui/covariancedialog.ui"
-|| rUIFile == u"modules/scalc/ui/exponentialsmoothingdialog.ui"
-|| rUIFile == u"modules/scalc/ui/movingaveragedialog.ui"
-|| rUIFile == u"modules/scalc/ui/regressiondialog.ui"
-|| rUIFile == u"modules/scalc/ui/ttestdialog.ui"
-|| rUIFile == u"modules/scalc/ui/ztestdialog.ui"
 || rUIFile == u"modules/scalc/ui/chisquaretestdialog.ui"
-|| rUIFile == u"modules/scalc/ui/fourieranalysisdialog.ui"
+|| rUIFile == u"modules/scalc/ui/colwidthdialog.ui"
+|| rUIFile == u"modules/scalc/ui/correlationdialog.ui"
+|| rUIFile == u"modules/scalc/ui/covariancedialog.ui"
 || rUIFile == u"modules/scalc/ui/datafielddialog.ui"
-|| rUIFile == u"modules/scalc/ui/pivotfielddialog.ui"
 || rUIFile == u"modules/scalc/ui/datafieldoptionsdialog.ui"
-|| rUIFile == u"modules/scalc/ui/insertcells.ui"
+|| rUIFile == u"modules/scalc/ui/definename.ui"
 || rUIFile == u"modules/scalc/ui/deletecells.ui"
 || rUIFile == u"modules/scalc/ui/deletecontents.ui"
-|| rUIFile == u"modules/scalc/ui/ungroupdialog.ui"
+|| rUIFile == u"modules/scalc/ui/descriptivestatisticsdialog.ui"
+|| rUIFile == u"modules/scalc/ui/exponentialsmoothingdialog.ui"
+|| rUIFile == u"modules/scalc/ui/fourieranalysisdialog.ui"
 || rUIFile == u"modules/scalc/ui/groupdialog.ui"
-|| rUIFile == u"modules/scalc/ui/rowheightdialog.ui"
-|| rUIFile == u"modules/scalc/ui/optimalrowheightdialog.ui"
-|| rUIFile == u"modules/scalc/ui/colwidthdialog.ui"
+|| rUIFile == u"modules/scalc/ui/insertcells.ui"
+|| rUIFile == u"modules/scalc/ui/managenamesdialog.ui"
+|| rUIFile == u"modules/scalc/ui/movingaveragedialog.ui"
   

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

2023-01-02 Thread Justin Luth (via logerrit)
 sw/qa/extras/ooxmlexport/data/tdf151704_thinColumnHeight.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport14.cxx|   10 ++
 sw/source/core/text/frmform.cxx   |9 -
 3 files changed, 10 insertions(+), 9 deletions(-)

New commits:
commit cd7f8d895abae28533ec43ed43b2d90947e92b42
Author: Justin Luth 
AuthorDate: Fri Dec 23 15:49:59 2022 -0500
Commit: Miklos Vajna 
CommitDate: Mon Jan 2 13:31:09 2023 +

tdf#151704 sw: don't give random height to text frame

This was introduced forever ago with
commit 6c3ae34e32539f8493a940666dbe16b23a8ba7b0
Author: Frank Meies on Tue Nov 20 15:24:54 2001 +
Chg: Vertical Formatting - Growing frames

But why?
Assuming that anything that NEEDED to set a proper height
has done so by now. The commit suggests it was added to
handle vertical layouts.

If this exploratory patch causes problems
(and it very well might since this is a really generic spot)
then perhaps it can be limited to verical layout situations?

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

diff --git a/sw/qa/extras/ooxmlexport/data/tdf151704_thinColumnHeight.docx 
b/sw/qa/extras/ooxmlexport/data/tdf151704_thinColumnHeight.docx
new file mode 100644
index ..7e7cd57e1395
Binary files /dev/null and 
b/sw/qa/extras/ooxmlexport/data/tdf151704_thinColumnHeight.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
index 27c62342d849..ffb48ecad109 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
@@ -129,6 +129,16 @@ DECLARE_OOXMLEXPORT_TEST(testTdf135595_HFtableWrap_c12, 
"tdf135595_HFtableWrap_c
 CPPUNIT_ASSERT_MESSAGE("Text must not wrap around header image", 
nRowHeight < 800);
 }
 
+DECLARE_OOXMLEXPORT_TEST(testTdf151704_thinColumnHeight, 
"tdf151704_thinColumnHeight.docx")
+{
+xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+sal_Int32 nRowHeightT1 = getXPath(
+pXmlDoc, "//page[1]/body/tab[1]/row/cell/tab[1]/row[1]/infos/bounds", 
"height").toInt32();
+sal_Int32 nRowHeightT2 = getXPath(
+pXmlDoc, "//page[2]/body/tab/row[1]/infos/bounds", "height").toInt32();
+CPPUNIT_ASSERT_EQUAL_MESSAGE("Same row height in both tables", 
nRowHeightT1, nRowHeightT2);
+}
+
 DECLARE_OOXMLEXPORT_TEST(testTdf123622, "tdf123622.docx")
 {
 uno::Reference 
XPropsRight(getShape(1),uno::UNO_QUERY);
diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx
index 19dcb6e3ed5f..46d2613021cb 100644
--- a/sw/source/core/text/frmform.cxx
+++ b/sw/source/core/text/frmform.cxx
@@ -1799,7 +1799,6 @@ void SwTextFrame::Format( vcl::RenderContext* 
pRenderContext, const SwBorderAttr
 if( aRectFnSet.GetWidth(getFramePrintArea()) <= 0 )
 {
 // If MustFit is set, we shrink to the Upper's bottom edge if needed.
-// Else we just take a standard size of 12 Pt. (240 twip).
 SwTextLineAccess aAccess( this );
 tools::Long nFrameHeight = aRectFnSet.GetHeight(getFrameArea());
 
@@ -1810,14 +1809,6 @@ void SwTextFrame::Format( vcl::RenderContext* 
pRenderContext, const SwBorderAttr
 if( nDiff > 0 )
 Shrink( nDiff );
 }
-else if( 240 < nFrameHeight )
-{
-Shrink( nFrameHeight - 240 );
-}
-else if( 240 > nFrameHeight )
-{
-Grow( 240 - nFrameHeight );
-}
 
 nFrameHeight = aRectFnSet.GetHeight(getFrameArea());
 const tools::Long nTop = aRectFnSet.GetTopMargin(*this);


[Libreoffice-commits] core.git: include/oox oox/Library_oox.mk oox/source

2023-01-02 Thread Tomaž Vajngerl (via logerrit)
 include/oox/export/ThemeExport.hxx |   38 +
 oox/Library_oox.mk |1 
 oox/source/export/ThemeExport.cxx  |  263 +
 3 files changed, 302 insertions(+)

New commits:
commit 958d4667e361a1d8461889117ca830a5da85d0ee
Author: Tomaž Vajngerl 
AuthorDate: Mon Dec 12 22:18:43 2022 +0900
Commit: Tomaž Vajngerl 
CommitDate: Mon Jan 2 12:44:45 2023 +

oox: add ThemeExport that exports a svx::Theme into theme.xml file

Adds ThemeExport that takes a svx::Theme as input and exports that
into a theme.xml file in the OOXML document. Currently supports
exporting of color schemes and font schemes. Format schemes are
hard-coded for now. The ThemeExport isn't yet used in any actual
export functionality.

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

diff --git a/include/oox/export/ThemeExport.hxx 
b/include/oox/export/ThemeExport.hxx
new file mode 100644
index ..02f222cadafe
--- /dev/null
+++ b/include/oox/export/ThemeExport.hxx
@@ -0,0 +1,38 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-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/.
+ */
+
+#pragma once
+
+#include 
+#include 
+#include 
+#include 
+
+namespace oox
+{
+class OOX_DLLPUBLIC ThemeExport
+{
+private:
+oox::core::XmlFilterBase* mpFilterBase;
+
+public:
+ThemeExport(oox::core::XmlFilterBase* pFilterBase);
+
+void write(OUString const& rPath, svx::Theme const& rTheme);
+
+private:
+static bool writeColorSet(sax_fastparser::FSHelperPtr pFS, svx::Theme 
const& rTheme);
+static bool writeFontScheme(sax_fastparser::FSHelperPtr pFS,
+svx::FontScheme const& rFontScheme);
+static bool writeFormatScheme(sax_fastparser::FSHelperPtr pFS);
+};
+
+} // end namespace oox
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/Library_oox.mk b/oox/Library_oox.mk
index aba27c786f8d..67f4f6e1ec0f 100644
--- a/oox/Library_oox.mk
+++ b/oox/Library_oox.mk
@@ -231,6 +231,7 @@ $(eval $(call gb_Library_add_exception_objects,oox,\
 oox/source/export/DMLPresetShapeExport \
 oox/source/export/shapes \
 oox/source/export/vmlexport \
+oox/source/export/ThemeExport \
 oox/source/helper/attributelist \
 oox/source/helper/binaryinputstream \
 oox/source/helper/binaryoutputstream \
diff --git a/oox/source/export/ThemeExport.cxx 
b/oox/source/export/ThemeExport.cxx
new file mode 100644
index ..f11b894f924a
--- /dev/null
+++ b/oox/source/export/ThemeExport.cxx
@@ -0,0 +1,263 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-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/.
+ */
+
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+namespace oox
+{
+ThemeExport::ThemeExport(oox::core::XmlFilterBase* pFilterBase)
+: mpFilterBase(pFilterBase)
+
+{
+}
+
+void ThemeExport::write(OUString const& rPath, svx::Theme const& rTheme)
+{
+sax_fastparser::FSHelperPtr pFS = 
mpFilterBase->openFragmentStreamWithSerializer(
+rPath, "application/vnd.openxmlformats-officedocument.theme+xml");
+
+OUString aThemeName = rTheme.GetName();
+
+pFS->startElementNS(XML_a, XML_theme, FSNS(XML_xmlns, XML_a),
+mpFilterBase->getNamespaceURL(OOX_NS(dml)), XML_name, 
aThemeName);
+
+pFS->startElementNS(XML_a, XML_themeElements);
+
+const svx::ColorSet* pColorSet = rTheme.GetColorSet();
+
+pFS->startElementNS(XML_a, XML_clrScheme, XML_name, pColorSet->getName());
+writeColorSet(pFS, rTheme);
+pFS->endElementNS(XML_a, XML_clrScheme);
+
+svx::FontScheme const& rFontScheme = rTheme.getFontScheme();
+pFS->startElementNS(XML_a, XML_fontScheme, XML_name, 
rFontScheme.getName());
+writeFontScheme(pFS, rFontScheme);
+pFS->endElementNS(XML_a, XML_fontScheme);
+
+pFS->startElementNS(XML_a, XML_fmtScheme);
+writeFormatScheme(pFS);
+pFS->endElementNS(XML_a, XML_fmtScheme);
+
+pFS->endElementNS(XML_a, XML_themeElements);
+pFS->endElementNS(XML_a, XML_theme);
+
+pFS->endDocument();
+}
+
+namespace
+{
+void fillAttrList(rtl::Reference const& 
pAttrList,
+  svx::ThemeFont const& rThemeFont)
+{
+pAttrList->add(XML_typeface, rThemeFont.maTypeface);
+pAttrList->add(XML_panose, rThemeFont.maPanose);
+pAttrList->add(XML_pitchFamily, 

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

2023-01-02 Thread Mike Kaganski (via logerrit)
 sfx2/source/doc/docmacromode.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 86373552318c4858b8a050d08c57dcb35cdb2193
Author: Mike Kaganski 
AuthorDate: Mon Jan 2 07:41:46 2023 +
Commit: Mike Kaganski 
CommitDate: Mon Jan 2 12:23:35 2023 +

Only call getDocumentLocation once

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

diff --git a/sfx2/source/doc/docmacromode.cxx b/sfx2/source/doc/docmacromode.cxx
index c2ec2fd8e417..ae70c6a8c056 100644
--- a/sfx2/source/doc/docmacromode.cxx
+++ b/sfx2/source/doc/docmacromode.cxx
@@ -206,12 +206,13 @@ namespace sfx2
 if ( nMacroExecutionMode == MacroExecMode::ALWAYS_EXECUTE_NO_WARN )
 return true;
 
+const OUString sURL(m_xData->m_rDocumentAccess.getDocumentLocation());
 try
 {
 // get document location from medium name and check whether it is 
a trusted one
 // the service is created without document version, since it is 
not of interest here
 Reference< XDocumentDigitalSignatures > 
xSignatures(DocumentDigitalSignatures::createDefault(::comphelper::getProcessComponentContext()));
-INetURLObject aURLReferer( 
m_xData->m_rDocumentAccess.getDocumentLocation() );
+INetURLObject aURLReferer(sURL);
 
 OUString aLocation;
 if ( aURLReferer.removeSegment() )
@@ -293,7 +294,6 @@ namespace sfx2
 #if defined(_WIN32)
 // Windows specific: try to decide macros loading depending on Windows 
Security Zones
 // (is the file local, or it was downloaded from internet, etc?)
-OUString sURL(m_xData->m_rDocumentAccess.getDocumentLocation());
 OUString sFilePath;
 osl::FileBase::getSystemPathFromFileURL(sURL, sFilePath);
 sal::systools::COMReference pZoneId;
@@ -348,7 +348,7 @@ namespace sfx2
 
 if ( eAutoConfirm == eNoAutoConfirm )
 {
-OUString sReferrer( 
m_xData->m_rDocumentAccess.getDocumentLocation() );
+OUString sReferrer(sURL);
 
 OUString aSystemFileURL;
 if ( osl::FileBase::getSystemPathFromFileURL( sReferrer, 
aSystemFileURL ) == osl::FileBase::E_None )


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

2023-01-02 Thread Miklos Vajna (via logerrit)
 sw/source/ui/vba/vbaformfields.cxx|   10 +-
 sw/source/ui/vba/vbaframes.cxx|8 
 sw/source/ui/vba/vbalistgalleries.cxx |   12 ++--
 sw/source/ui/vba/vbalisttemplate.cxx  |6 +++---
 sw/source/ui/vba/vbalisttemplate.hxx  |2 +-
 5 files changed, 19 insertions(+), 19 deletions(-)

New commits:
commit 773baa53608c4fd36de469c92b39f54672889f88
Author: Miklos Vajna 
AuthorDate: Mon Jan 2 08:14:43 2023 +0100
Commit: Miklos Vajna 
CommitDate: Mon Jan 2 11:47:46 2023 +

sw: prefix members of FormFieldsEnumWrapper, FramesEnumeration, ...

... ListGalleriesEnumWrapper and SwVbaListTemplate

See tdf#94879 for motivation.

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

diff --git a/sw/source/ui/vba/vbaformfields.cxx 
b/sw/source/ui/vba/vbaformfields.cxx
index 187f41f3b4f7..586393e35818 100644
--- a/sw/source/ui/vba/vbaformfields.cxx
+++ b/sw/source/ui/vba/vbaformfields.cxx
@@ -78,21 +78,21 @@ namespace
 class FormFieldsEnumWrapper : public EnumerationHelper_BASE
 {
 uno::Reference mxIndexAccess;
-sal_Int32 nIndex;
+sal_Int32 mnIndex;
 
 public:
 explicit FormFieldsEnumWrapper(uno::Reference 
xIndexAccess)
 : mxIndexAccess(xIndexAccess)
-, nIndex(0)
+, mnIndex(0)
 {
 }
-sal_Bool SAL_CALL hasMoreElements() override { return (nIndex < 
mxIndexAccess->getCount()); }
+sal_Bool SAL_CALL hasMoreElements() override { return (mnIndex < 
mxIndexAccess->getCount()); }
 
 uno::Any SAL_CALL nextElement() override
 {
-if (nIndex < mxIndexAccess->getCount())
+if (mnIndex < mxIndexAccess->getCount())
 {
-return mxIndexAccess->getByIndex(nIndex++);
+return mxIndexAccess->getByIndex(mnIndex++);
 }
 throw container::NoSuchElementException();
 }
diff --git a/sw/source/ui/vba/vbaframes.cxx b/sw/source/ui/vba/vbaframes.cxx
index a6495da08d71..376082054b18 100644
--- a/sw/source/ui/vba/vbaframes.cxx
+++ b/sw/source/ui/vba/vbaframes.cxx
@@ -34,22 +34,22 @@ private:
 uno::Reference< uno::XComponentContext > mxContext;
 uno::Reference< container::XIndexAccess> mxIndexAccess;
 uno::Reference< frame::XModel > mxModel;
-sal_Int32 nCurrentPos;
+sal_Int32 mnCurrentPos;
 public:
 /// @throws uno::RuntimeException
-FramesEnumeration( uno::Reference< XHelperInterface > xParent, 
uno::Reference< uno::XComponentContext >  xContext, uno::Reference< 
container::XIndexAccess >  xIndexAccess,  uno::Reference< frame::XModel >  
xModel  ) : mxParent(std::move( xParent )), mxContext(std::move( xContext)), 
mxIndexAccess(std::move( xIndexAccess )), mxModel(std::move( xModel )), 
nCurrentPos(0)
+FramesEnumeration( uno::Reference< XHelperInterface > xParent, 
uno::Reference< uno::XComponentContext >  xContext, uno::Reference< 
container::XIndexAccess >  xIndexAccess,  uno::Reference< frame::XModel >  
xModel  ) : mxParent(std::move( xParent )), mxContext(std::move( xContext)), 
mxIndexAccess(std::move( xIndexAccess )), mxModel(std::move( xModel )), 
mnCurrentPos(0)
 {
 }
 virtual sal_Bool SAL_CALL hasMoreElements(  ) override
 {
-return ( nCurrentPos < mxIndexAccess->getCount() );
+return ( mnCurrentPos < mxIndexAccess->getCount() );
 }
 
 virtual uno::Any SAL_CALL nextElement(  ) override
 {
 if ( !hasMoreElements() )
 throw container::NoSuchElementException();
-uno::Reference< text::XTextFrame > xTextFrame( 
mxIndexAccess->getByIndex( nCurrentPos++ ), uno::UNO_QUERY_THROW );
+uno::Reference< text::XTextFrame > xTextFrame( 
mxIndexAccess->getByIndex( mnCurrentPos++ ), uno::UNO_QUERY_THROW );
 return uno::Any( uno::Reference< word::XFrame > ( new SwVbaFrame( 
mxParent, mxContext, mxModel, xTextFrame ) ) );
 }
 
diff --git a/sw/source/ui/vba/vbalistgalleries.cxx 
b/sw/source/ui/vba/vbalistgalleries.cxx
index 56c2116c328c..9c047b1b6490 100644
--- a/sw/source/ui/vba/vbalistgalleries.cxx
+++ b/sw/source/ui/vba/vbalistgalleries.cxx
@@ -28,19 +28,19 @@ namespace {
 
 class ListGalleriesEnumWrapper : public EnumerationHelper_BASE
 {
-SwVbaListGalleries* pListGalleries;
-sal_Int32 nIndex;
+SwVbaListGalleries* m_pListGalleries;
+sal_Int32 m_nIndex;
 public:
-explicit ListGalleriesEnumWrapper( SwVbaListGalleries* pGalleries ) : 
pListGalleries( pGalleries ), nIndex( 1 ) {}
+explicit ListGalleriesEnumWrapper( SwVbaListGalleries* pGalleries ) : 
m_pListGalleries( pGalleries ), m_nIndex( 1 ) {}
 virtual sal_Bool SAL_CALL hasMoreElements(  ) override
 {
-return ( nIndex <= pListGalleries->getCount() );
+return ( m_nIndex <= m_pListGalleries->getCount() );
 }
 
 virtual uno::Any SAL_CALL nextElement(  ) override
 {
-if ( nIndex <= pListGalleries->getCoun

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

2023-01-02 Thread Mike Kaganski (via logerrit)
 sfx2/source/doc/docmacromode.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 672e519556c72cc376a1bdf1c2e6788509c6f348
Author: Mike Kaganski 
AuthorDate: Mon Jan 2 07:34:56 2023 +
Commit: Mike Kaganski 
CommitDate: Mon Jan 2 11:07:18 2023 +

Avoid reinterpret_cast

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

diff --git a/sfx2/source/doc/docmacromode.cxx b/sfx2/source/doc/docmacromode.cxx
index 44be05a06841..c2ec2fd8e417 100644
--- a/sfx2/source/doc/docmacromode.cxx
+++ b/sfx2/source/doc/docmacromode.cxx
@@ -39,6 +39,7 @@
 #include 
 
 #if defined(_WIN32)
+#include 
 #include 
 #include 
 #include 
@@ -299,7 +300,7 @@ namespace sfx2
 pZoneId.CoCreateInstance(CLSID_PersistentZoneIdentifier);
 sal::systools::COMReference pPersist(pZoneId, 
sal::systools::COM_QUERY_THROW);
 DWORD dwZone;
-if 
(!SUCCEEDED(pPersist->Load(reinterpret_cast(sFilePath.getStr()), 
STGM_READ)) ||
+if (!SUCCEEDED(pPersist->Load(o3tl::toW(sFilePath.getStr()), 
STGM_READ)) ||
 !SUCCEEDED(pZoneId->GetId(&dwZone)))
 {
 // no Security Zone info found -> assume a local file, not


[Libreoffice-commits] core.git: pyuno/demo pyuno/qa

2023-01-02 Thread Bogdan B (via logerrit)
 pyuno/demo/hello_world_comp.py |1 -
 pyuno/demo/ooextract.py|7 +++
 pyuno/demo/swriter.py  |4 
 pyuno/qa/pytests/insertremovecells.py  |3 ---
 pyuno/qa/pytests/testcollections_XCellRange.py |2 --
 pyuno/qa/pytests/testcollections_XEnumeration.py   |2 --
 pyuno/qa/pytests/testcollections_XEnumerationAccess.py |2 --
 pyuno/qa/pytests/testcollections_XIndexAccess.py   |4 +---
 pyuno/qa/pytests/testcollections_XIndexReplace.py  |1 -
 pyuno/qa/pytests/testcollections_XNameAccess.py|2 --
 pyuno/qa/pytests/testcollections_XNameContainer.py |3 +--
 pyuno/qa/pytests/testcollections_XNameReplace.py   |1 -
 pyuno/qa/pytests/testcollections_base.py   |1 -
 pyuno/qa/pytests/testcollections_misc.py   |2 --
 pyuno/qa/pytests/testcollections_misc2.py  |1 -
 pyuno/qa/pytests/testcollections_mixednameindex.py |2 --
 16 files changed, 5 insertions(+), 33 deletions(-)

New commits:
commit de419b94b3f7870e7ad962b1e7c8bf43b27f3d81
Author: Bogdan B 
AuthorDate: Sun Jan 1 11:27:55 2023 +0100
Commit: Hossein 
CommitDate: Mon Jan 2 09:37:00 2023 +

Remove unused imports from pyuno/demo and pyuno/qa

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

diff --git a/pyuno/demo/hello_world_comp.py b/pyuno/demo/hello_world_comp.py
index 646a124a47b8..020953b4f41a 100644
--- a/pyuno/demo/hello_world_comp.py
+++ b/pyuno/demo/hello_world_comp.py
@@ -17,7 +17,6 @@
 #   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 #
 
-import uno
 import unohelper
 
 from com.sun.star.task import XJobExecutor
diff --git a/pyuno/demo/ooextract.py b/pyuno/demo/ooextract.py
index d6cce94e80d5..a5699548ce22 100644
--- a/pyuno/demo/ooextract.py
+++ b/pyuno/demo/ooextract.py
@@ -19,13 +19,12 @@
 
 import getopt,sys
 import uno
-from unohelper import Base,systemPathToFileUrl, absolutize
-from os import getcwd
 
+from unohelper import Base,systemPathToFileUrl
+from os import getcwd
 from com.sun.star.beans import PropertyValue
-from com.sun.star.beans.PropertyState import DIRECT_VALUE
 from com.sun.star.uno import Exception as UnoException
-from com.sun.star.io import IOException,XInputStream, XOutputStream
+from com.sun.star.io import IOException, XOutputStream
 
 class OutputStream(Base, XOutputStream):
 def __init__(self):
diff --git a/pyuno/demo/swriter.py b/pyuno/demo/swriter.py
index 90a53e826545..70af4f98d003 100644
--- a/pyuno/demo/swriter.py
+++ b/pyuno/demo/swriter.py
@@ -19,16 +19,12 @@
 
 # bootstrap uno component context
 import uno
-import unohelper
-
-from com.sun.star.lang import IllegalArgumentException
 
 # a UNO struct later needed to create a document
 from com.sun.star.text.ControlCharacter import PARAGRAPH_BREAK
 from com.sun.star.text.TextContentAnchorType import AS_CHARACTER
 from com.sun.star.awt import Size
 
-
 def insertTextIntoCell( table, cellName, text, color ):
 tableText = table.getCellByName( cellName )
 cursor = tableText.createTextCursor()
diff --git a/pyuno/qa/pytests/insertremovecells.py 
b/pyuno/qa/pytests/insertremovecells.py
index 1d850a65d9fd..2583fdb134c1 100644
--- a/pyuno/qa/pytests/insertremovecells.py
+++ b/pyuno/qa/pytests/insertremovecells.py
@@ -1,9 +1,6 @@
 import pathlib
-import re
 import unittest
 
-from os import getenv, path
-
 from org.libreoffice.unotest import pyuno, mkPropertyValue, makeCopyFromTDOC
 
 
diff --git a/pyuno/qa/pytests/testcollections_XCellRange.py 
b/pyuno/qa/pytests/testcollections_XCellRange.py
index 641482433375..6ab827ab3346 100644
--- a/pyuno/qa/pytests/testcollections_XCellRange.py
+++ b/pyuno/qa/pytests/testcollections_XCellRange.py
@@ -8,10 +8,8 @@
 #
 
 import unittest
-import uno
 
 from testcollections_base import CollectionsTestBase
-from com.sun.star.beans import PropertyValue
 from com.sun.star.table import CellAddress
 
 # TextTable instance factory
diff --git a/pyuno/qa/pytests/testcollections_XEnumeration.py 
b/pyuno/qa/pytests/testcollections_XEnumeration.py
index 8d1f8eece046..a12d30359658 100644
--- a/pyuno/qa/pytests/testcollections_XEnumeration.py
+++ b/pyuno/qa/pytests/testcollections_XEnumeration.py
@@ -8,10 +8,8 @@
 #
 
 import unittest
-import uno
 
 from testcollections_base import CollectionsTestBase
-from com.sun.star.beans import PropertyValue
 
 
 # Tests behaviour of objects implementing XEnumeration using the new-style
diff --git a/pyuno/qa/pytests/testcollections_XEnumerationAccess.py 
b/pyuno/qa/pytests/testcollections_XEnumerationAccess.py
index a62b05ce9c5f..385514ae77c5 100644
--- a/pyuno/qa/pytests/testcollections_XEnumerationAccess.py
+++ b/pyuno/qa/pytests/testcollections_XEnumerationAccess.py
@@ -8,10 +8,8 @@
 #
 
 import unittest
-import 

[Libreoffice-commits] core.git: Branch 'distro/lhm/libreoffice-6-4+backports' - svtools/source

2023-01-02 Thread Ilhan Yesil (via logerrit)
 svtools/source/uno/wizard/wizardpagecontroller.cxx |   11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)

New commits:
commit 16be7b74fe3187333a6ff544ee90d3c1093b9177
Author: Ilhan Yesil 
AuthorDate: Fri Dec 16 07:30:13 2022 +0100
Commit: Michael Weghorn 
CommitDate: Mon Jan 2 09:01:15 2023 +

tdf#152508 Initiate container request size after call of createPage

As the container's request size of wizard pages can't be changed
directly by the UNO call setPosSize, the UNO caller can set the size
in the callback function createPage, this size will then taken as
request size. This doesn't solve the problem entirely as descriped
in tdf#152508, but the most important is, that the wizard page can
be initialized with an appropriate size at startup.

Change-Id: I1899da9c018681291559eb7c0de25a3e2e8af14e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144287
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Reviewed-by: Michael Weghorn 
(cherry picked from commit aef2ee893c7b76794bc9db869f08bbbea60606a8)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144809
Tested-by: Michael Weghorn 

diff --git a/svtools/source/uno/wizard/wizardpagecontroller.cxx 
b/svtools/source/uno/wizard/wizardpagecontroller.cxx
index 3faf68258b10..bbb081a01313 100644
--- a/svtools/source/uno/wizard/wizardpagecontroller.cxx
+++ b/svtools/source/uno/wizard/wizardpagecontroller.cxx
@@ -54,7 +54,16 @@ namespace svt { namespace uno
 try
 {
 // Plug a toplevel SalFrame into the native page which can host 
our awt widgetry
-
m_xWizardPage.set(m_xController->createPage(pParent->CreateChildFrame(), 
i_nPageId), UNO_SET_THROW);
+css::uno::Reference xChildFrame = 
pParent->CreateChildFrame();
+// If size of page is changed by createPage, then the requested 
size of the container
+// should also be set to this size, to avoid annoying resizings.
+com::sun::star::awt::Rectangle r0 = xChildFrame->getPosSize();
+m_xWizardPage.set(m_xController->createPage(xChildFrame, 
i_nPageId), UNO_SET_THROW);
+com::sun::star::awt::Rectangle r1 = xChildFrame->getPosSize();
+if (r0.Width != r1.Width || r0.Height != r1.Height)
+{
+pParent->set_size_request(r1.Width, r1.Height);
+}
 
 Reference< XWindow > xPageWindow(m_xWizardPage->getWindow(), 
UNO_SET_THROW);
 xPageWindow->setVisible( true );


Re: DOCX import: MS Office WordArt to LO Fontwork

2023-01-02 Thread Miklos Vajna
Hi Regina,

On Thu, Dec 22, 2022 at 12:30:54AM +0100, Regina Henschel 
 wrote:
> Maybe I should try to improve the export first?

Given that many users are just interested in the import (and they don't
care about the export), we can also argue the other way around... :-)

I just merged the import one, it's appreciated if you have time for the
export side at some stage.

Thanks,

Miklos


[Libreoffice-commits] core.git: oox/inc oox/Library_oox.mk oox/qa oox/source

2023-01-02 Thread Regina Henschel (via logerrit)
 oox/Library_oox.mk   |1 
 oox/inc/drawingml/fontworkhelpers.hxx|   44 ++
 oox/qa/unit/data/tdf125885_WordArt.docx  |binary
 oox/qa/unit/data/tdf125885_WordArt2.docx |binary
 oox/qa/unit/data/tdf125885_WordArt3.docx |binary
 oox/qa/unit/shape.cxx|  189 +
 oox/source/drawingml/fontworkhelpers.cxx |  172 
 oox/source/drawingml/shape.cxx   |  154 ---
 oox/source/export/drawingml.cxx  |3 
 oox/source/shape/WpsContext.cxx  |  607 ++-
 oox/source/shape/WpsContext.hxx  |1 
 11 files changed, 1013 insertions(+), 158 deletions(-)

New commits:
commit cbf30153a5c776e6d1ee26f2f83c8f77503eceb9
Author: Regina Henschel 
AuthorDate: Sat Dec 3 15:37:49 2022 +0100
Commit: Miklos Vajna 
CommitDate: Mon Jan 2 08:19:37 2023 +

tdf#125885 Conversion WordArt to Fontwork in docx import

docx has the information, that a shape is a WordArt shape, after the
text content. So in import of such file there is already a frame
attached to the shape, which makes it impossible to set it into text
path mode.

The patch detects that it should be a WordArt shape. It transfers the
text from frame to shape, removes the frame and then sets the shape
into text path mode.

WordArt in OOXML has the same closed set of types as we have for MS
binary import. But MS Word can combine them with arbitrary shapes. The
patch does only convert rectangles.

The text is copied from frame to the shape as string. Thus it looses
all styles. But our Fontwork cannot use different styles for
portions of text, so I think that is acceptable.

Fontwork uses not the styles of the text but styles set at the shape.
The patch copies the styles from the first not empty run. That should
give sufficient results in most cases. These text styles are set at
the shape, which will result in a paragraph style referenced by the
draw:text-style-name attribute of the draw:custom-shape element in ODF.

The patch does not yet include export to docx. The current 'restore
old shape' on resave to docx is lost. ToDo: Patch for export.

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

diff --git a/oox/Library_oox.mk b/oox/Library_oox.mk
index 6e031a35c5a0..aba27c786f8d 100644
--- a/oox/Library_oox.mk
+++ b/oox/Library_oox.mk
@@ -165,6 +165,7 @@ $(eval $(call gb_Library_add_exception_objects,oox,\
 oox/source/drawingml/effectpropertiescontext \
 oox/source/drawingml/embeddedwavaudiofile \
 oox/source/drawingml/fillproperties \
+oox/source/drawingml/fontworkhelpers \
 oox/source/drawingml/misccontexts \
 oox/source/drawingml/graphicshapecontext \
 oox/source/drawingml/guidcontext \
diff --git a/oox/inc/drawingml/fontworkhelpers.hxx 
b/oox/inc/drawingml/fontworkhelpers.hxx
new file mode 100755
index ..2a48f422abbf
--- /dev/null
+++ b/oox/inc/drawingml/fontworkhelpers.hxx
@@ -0,0 +1,44 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+#include 
+#include 
+
+#include "customshapeproperties.hxx"
+
+#include 
+#include 
+
+namespace FontworkHelpers
+{
+/** Removes the property specified by rName from the rPropVec vector of 
properties */
+void resetPropertyValueInVec(std::vector& rPropVec,
+ const OUString& rName);
+
+/** Changes the EnhancedCustomShapeGeometry of xShape shape so, that it 
becomes a LO Fontwork
+shape corresponding to the OOXML shape specified by sMSPresetType.
+Precondition: xShape is a custom shape.*/
+void putCustomShapeIntoTextPathMode(
+const css::uno::Reference& xShape,
+const oox::drawingml::CustomShapePropertiesPtr& pCustomShapePropertiesPtr,
+const OUString& sMSPresetType, const bool bFromWordArt);
+}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
\ No newline at end of fil

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

2023-01-02 Thread Caolán McNamara (via logerrit)
 xmloff/source/text/txtprmap.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 54cb5990e694385dd269dc2e946c58d64390986a
Author: Caolán McNamara 
AuthorDate: Thu Dec 29 21:37:02 2022 +
Commit: Miklos Vajna 
CommitDate: Mon Jan 2 08:18:42 2023 +

tdf#150707 xmloff/source/style/xmlexppr.cxx:907: no prop type specified

warning seen on saving very simple writer document.

maybe since:

commit 91f649a119d4b7ece26f9737a38663664953a57a
Date:   Thu Dec 9 08:43:27 2021 +0100

ODP import/export: refer to theme from shape text color

Refer to the 12 pre-defined colors by name + don't write the attribute
for the case when there is no theme.

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

diff --git a/xmloff/source/text/txtprmap.cxx b/xmloff/source/text/txtprmap.cxx
index 8385e678bfbe..527c63bbc1f0 100644
--- a/xmloff/source/text/txtprmap.cxx
+++ b/xmloff/source/text/txtprmap.cxx
@@ -139,7 +139,7 @@ XMLPropertyMapEntry const aXMLParaPropMap[] =
 MT_ED( PROP_CharColor, STYLE,  USE_WINDOW_FONT_COLOR,  
XML_TYPE_ISAUTOCOLOR|MID_FLAG_MERGE_PROPERTY,   0 ),
 MAP_EXT_I( PROP_CharTransparence, XML_NAMESPACE_DRAW, XML_OPACITY, 
XML_TYPE_NEG_PERCENT16 | XML_TYPE_PROP_TEXT, 0),
 MAP_EXT( PROP_CharTransparence, XML_NAMESPACE_LO_EXT, XML_OPACITY, 
XML_TYPE_NEG_PERCENT16 | XML_TYPE_PROP_TEXT, 0),
-MAP_EXT( PROP_CharColorTheme, XML_NAMESPACE_LO_EXT, XML_THEME_COLOR, 
XML_TYPE_THEME_COLOR, 0),
+MAP_EXT( PROP_CharColorTheme, XML_NAMESPACE_LO_EXT, XML_THEME_COLOR, 
XML_TYPE_THEME_COLOR | XML_TYPE_PROP_TEXT, 0),
 MAP_EXT( PROP_CharColorLumMod, XML_NAMESPACE_LO_EXT, XML_COLOR_LUM_MOD, 
XML_TYPE_PERCENT100 | XML_TYPE_PROP_TEXT, 0),
 MAP_EXT( PROP_CharColorLumOff, XML_NAMESPACE_LO_EXT, XML_COLOR_LUM_OFF, 
XML_TYPE_PERCENT100 | XML_TYPE_PROP_TEXT, 0),
 // RES_CHRATR_CONTOUR


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

2023-01-02 Thread Henry Castro (via logerrit)
 desktop/source/lib/init.cxx |   19 +++
 1 file changed, 19 insertions(+)

New commits:
commit 6a2ed798348c4c4b53a1813c7d2fc94b0f5d605e
Author: Henry Castro 
AuthorDate: Fri Dec 23 13:57:01 2022 -0400
Commit: Miklos Vajna 
CommitDate: Mon Jan 2 08:16:44 2023 +

lok: disable spell if remote language tool enabled

.

Signed-off-by: Henry Castro 
Change-Id: I73158c3feaa84af4d713d3f1b1fc9a60dcf95463
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144785
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 3f18763818fa..617d5926dc0b 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -56,6 +56,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -7026,6 +7027,24 @@ void setLanguageToolConfig()
 rLanguageOpts.setUsername(aUsername);
 rLanguageOpts.setApiKey(aApiKey);
 }
+
+css::uno::Reference 
xLangSrv =
+css::linguistic2::LinguServiceManager::create(xContext);
+if (xLangSrv.is())
+{
+css::uno::Reference xSpell = 
xLangSrv->getSpellChecker();
+if (xSpell.is())
+{
+Sequence aEmpty;
+constexpr OUStringLiteral cSpell(SN_SPELLCHECKER);
+Sequence aLocales = 
xSpell->getLocales();
+
+for (int itLocale = 0; itLocale < aLocales.getLength(); 
itLocale++)
+{
+xLangSrv->setConfiguredServices(cSpell, 
aLocales[itLocale], aEmpty);
+}
+}
+}
 }
 catch(uno::Exception const& rException)
 {