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

2023-08-11 Thread Noel Grandin (via logerrit)
 include/sfx2/sfxbasemodel.hxx|   21 -
 include/sfx2/stbitem.hxx |3 ---
 sfx2/inc/templatedefaultview.hxx |2 --
 sfx2/source/control/templatedefaultview.cxx  |5 -
 sfx2/source/control/templatedlglocalview.cxx |2 +-
 sfx2/source/doc/SfxDocumentMetaData.cxx  |2 +-
 sfx2/source/doc/docundomanager.cxx   |4 ++--
 sfx2/source/doc/templatedlg.cxx  |2 +-
 sfx2/source/doc/zoomitem.cxx |2 +-
 sfx2/source/sidebar/SidebarToolBox.cxx   |2 +-
 sfx2/source/statbar/stbitem.cxx  |   12 
 11 files changed, 7 insertions(+), 50 deletions(-)

New commits:
commit 0f3b36bd2749f360df84d1594c01e619ba0f4930
Author: Noel Grandin 
AuthorDate: Fri Aug 11 15:10:28 2023 +0200
Commit: Noel Grandin 
CommitDate: Sat Aug 12 08:18:17 2023 +0200

clang-tidy bugprone-parent-virtual-call in sfx2

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

diff --git a/include/sfx2/sfxbasemodel.hxx b/include/sfx2/sfxbasemodel.hxx
index 2602387fad59..b134b8ac7ea7 100644
--- a/include/sfx2/sfxbasemodel.hxx
+++ b/include/sfx2/sfxbasemodel.hxx
@@ -184,27 +184,6 @@ public:
 
 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& rType 
) override ;
 
-
/**___
-@short  increment refcount
-@seealsoXInterface
-@seealsorelease()
-@onerrorA RuntimeException is thrown.
-*/
-
-virtual void SAL_CALL acquire() noexcept override
-{ OWeakObject::acquire(); }
-
-
/**___
-@short  decrement refcount
-@seealsoXInterface
-@seealsoacquire()
-@onerrorA RuntimeException is thrown.
-*/
-
-virtual void SAL_CALL release() noexcept override
-{ OWeakObject::release(); }
-
-
 //  XTypeProvider
 
 
diff --git a/include/sfx2/stbitem.hxx b/include/sfx2/stbitem.hxx
index 67c88c68710d..7325ca0959d8 100644
--- a/include/sfx2/stbitem.hxx
+++ b/include/sfx2/stbitem.hxx
@@ -63,9 +63,6 @@ class SFX2_DLLPUBLIC SfxStatusBarControl: public 
svt::StatusbarController
 
 public:
 // new controller API
-// XInterface
-virtual void   SAL_CALL acquire() noexcept override;
-virtual void   SAL_CALL release() noexcept override;
 
 protected:
 // XEventListener
diff --git a/sfx2/inc/templatedefaultview.hxx b/sfx2/inc/templatedefaultview.hxx
index 1771ad3d8759..07cd3d126639 100644
--- a/sfx2/inc/templatedefaultview.hxx
+++ b/sfx2/inc/templatedefaultview.hxx
@@ -19,8 +19,6 @@ public:
 
 virtual void showAllTemplates() override;
 
-virtual bool KeyInput(const KeyEvent& rKEvt) override;
-
 virtual bool MouseButtonDown(const MouseEvent& rMEvt) override;
 
 void createContextMenu();
diff --git a/sfx2/source/control/templatedefaultview.cxx 
b/sfx2/source/control/templatedefaultview.cxx
index 17ad2ba7cbda..b7e7c0edc4a6 100644
--- a/sfx2/source/control/templatedefaultview.cxx
+++ b/sfx2/source/control/templatedefaultview.cxx
@@ -47,11 +47,6 @@ void TemplateDefaultView::showAllTemplates()
 insertItems(maAllTemplates, false);
 }
 
-bool TemplateDefaultView::KeyInput( const KeyEvent& rKEvt )
-{
-return ThumbnailView::KeyInput(rKEvt);
-}
-
 bool TemplateDefaultView::MouseButtonDown( const MouseEvent& rMEvt )
 {
 if( rMEvt.IsLeft() && rMEvt.GetClicks() == 1 )
diff --git a/sfx2/source/control/templatedlglocalview.cxx 
b/sfx2/source/control/templatedlglocalview.cxx
index 52a12b4ef965..a4cac457cd0e 100644
--- a/sfx2/source/control/templatedlglocalview.cxx
+++ b/sfx2/source/control/templatedlglocalview.cxx
@@ -401,7 +401,7 @@ bool TemplateDlgLocalView::KeyInput(const KeyEvent& rKEvt)
 reload();
 }
 
-return ThumbnailView::KeyInput(rKEvt);
+return TemplateLocalView::KeyInput(rKEvt);
 }
 
 IMPL_LINK(TemplateDlgLocalView, KeyPressHdl, const KeyEvent&, rKEvt, bool)
diff --git a/sfx2/source/doc/SfxDocumentMetaData.cxx 
b/sfx2/source/doc/SfxDocumentMetaData.cxx
index 7d1f16c01fd9..56c47315ab54 100644
--- a/sfx2/source/doc/SfxDocumentMetaData.cxx
+++ b/sfx2/source/doc/SfxDocumentMetaData.cxx
@@ -1345,7 +1345,7 @@ void SAL_CALL SfxDocumentMetaData::dispose()
 if (!m_isInitialized) {
 return;
 }
-WeakComponentImplHelperBase::dispose(); // superclass
+PartialWeakComponentImplHelper::dispose(); // superclass
 m_NotifyListeners.disposeAndClear(css::lang::EventObject(
 getXWeak()));
 m_isInitialized = false;
diff --git a/sfx2/source/doc/docundomanager.cxx 
b/sfx2/source/doc/docundomanager.cxx
index 94f416c2d786..2370397e267c 100644
--- a/sfx2/source/doc/do

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

2023-08-11 Thread Justin Luth (via logerrit)
 framework/source/services/autorecovery.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit f1c3526dee49927f7efb79bef285e3688264ec3f
Author: Justin Luth 
AuthorDate: Thu Aug 10 15:42:58 2023 -0400
Commit: Justin Luth 
CommitDate: Sat Aug 12 01:36:13 2023 +0200

tdf#137878 autorecovery: reduce "file not found" pop-ups

For a DOCX file, there were four of them during a recovery
if the file was on a USB or renamed or whatever.

Now there aren't any.

Change-Id: I5cbad6e4ed1a1bc1d3b8e805a6b493f4ee61ec68
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155567
Reviewed-by: Justin Luth 
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/framework/source/services/autorecovery.cxx 
b/framework/source/services/autorecovery.cxx
index 2b62186b08fe..dfed8cfc6993 100644
--- a/framework/source/services/autorecovery.cxx
+++ b/framework/source/services/autorecovery.cxx
@@ -88,6 +88,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -3459,6 +3460,8 @@ void AutoRecovery::implts_openOneDoc(const OUString&  
 sURL   ,
 // TODO: remove load-process specific arguments from the 
descriptor, e.g. the status indicator
 xModel->attachResource( sURL, 
lDescriptor.getAsConstPropertyValueList() );
 }
+else if (!utl::UCBContentHelper::Exists(sURL))
+throw css::uno::Exception();
 else
 {
 OUString sFilterName;


Re: Enhancement request for Bugzilla

2023-08-11 Thread Regina Henschel

Hi Xisco,

Xisco Fauli schrieb am 11.08.2023 um 23:41:

Hi Regina,

it seems to work for me. For instance, in 
https://bugs.documentfoundation.org/show_bug.cgi?id=154074 I uploaded a 
.pptx file and Bugzilla detected it as 
application/vnd.openxmlformats-officedocument.presentationml.presentation.


Could you please point to the ticket where you saw the problem you 
mentioned?


It seems to work sometimes and fails sometimes.

https://bugs.documentfoundation.org/buglist.cgi?f1=attachments.mimetype&list_id=1636496&o1=changedfrom&product=LibreOffice&query_format=advanced&v1=application%2Fzip

That means in section "Custom Search" search for "Attachment mime type" 
"changed from" "application/zip".


Kind regards,
Regina



On 10/8/23 19:33, Regina Henschel wrote:

Hi all,

I want to make an enhancement request for our Bugzilla, but where? 
Neither Bugzilla nor Redmine seem to have a suitable category.


This is my problem:
If I attach a pptx, docx, or xlsx file, the option 'auto-detect' in 
section 'Content Type' does not work. So I try option 'select from 
list', but that list has no items for the OOXML formats.


So my request is to make the 'auto-detect' able to detect OOXML 
formats or extend the list with these formats.


Kind regards,
Regina


--
Xisco Faulí
LibreOffice QA Team
IRC: x1sc0





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

2023-08-11 Thread Henry Castro (via logerrit)
 sc/source/ui/view/tabview4.cxx |8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit 48e03dfb8398fa7dc881f039f9d56b729e95ca8d
Author: Henry Castro 
AuthorDate: Fri Aug 11 09:11:09 2023 -0400
Commit: Aron Budea 
CommitDate: Sat Aug 12 00:53:20 2023 +0200

tdf#155799: sc: fix input formula reference

If the start point reference mark is selected
with mouse direction up, it should extend to show
the correct input formula reference.

Signed-off-by: Henry Castro 
Change-Id: I41f2ea52bf7de341eccadfba80e91fd76a6fd2de
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155618
Reviewed-by: Tomaž Vajngerl 
Tested-by: Jenkins CollaboraOffice 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155593
Tested-by: Aron Budea 
Reviewed-by: Aron Budea 

diff --git a/sc/source/ui/view/tabview4.cxx b/sc/source/ui/view/tabview4.cxx
index 3ed71a5ef931..9ff3d41ef4df 100644
--- a/sc/source/ui/view/tabview4.cxx
+++ b/sc/source/ui/view/tabview4.cxx
@@ -229,9 +229,13 @@ void ScTabView::UpdateRef( SCCOL nCurX, SCROW nCurY, SCTAB 
nCurZ )
 ScRefType eType = aViewData.GetRefType();
 if ( eType == SC_REFTYPE_REF )
 {
+if ((nStartX > nEndX || nStartY > nEndY) &&
+rDoc.HasAttrib(nStartX, nStartY, nTab, HasAttrFlags::Merged))
+rDoc.ExtendMerge( nStartX, nStartY, nStartX, nStartY, nTab );
+
 ScRange aRef(
-aViewData.GetRefStartX(), aViewData.GetRefStartY(), 
aViewData.GetRefStartZ(),
-aViewData.GetRefEndX(), aViewData.GetRefEndY(), 
aViewData.GetRefEndZ() );
+nStartX, nStartY, aViewData.GetRefStartZ(),
+nEndX, nEndY, aViewData.GetRefEndZ() );
 SC_MOD()->SetReference( aRef, rDoc, &rMark );
 ShowRefTip();
 }


Re: Enhancement request for Bugzilla

2023-08-11 Thread Xisco Fauli

Hi Regina,

it seems to work for me. For instance, in 
https://bugs.documentfoundation.org/show_bug.cgi?id=154074 I uploaded a 
.pptx file and Bugzilla detected it as 
application/vnd.openxmlformats-officedocument.presentationml.presentation.


Could you please point to the ticket where you saw the problem you 
mentioned?


On 10/8/23 19:33, Regina Henschel wrote:

Hi all,

I want to make an enhancement request for our Bugzilla, but where? 
Neither Bugzilla nor Redmine seem to have a suitable category.


This is my problem:
If I attach a pptx, docx, or xlsx file, the option 'auto-detect' in 
section 'Content Type' does not work. So I try option 'select from 
list', but that list has no items for the OOXML formats.


So my request is to make the 'auto-detect' able to detect OOXML 
formats or extend the list with these formats.


Kind regards,
Regina


--
Xisco Faulí
LibreOffice QA Team
IRC: x1sc0


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

2023-08-11 Thread Marco Cecchetti (via logerrit)
 sfx2/source/view/viewsh.cxx |   54 ++--
 1 file changed, 32 insertions(+), 22 deletions(-)

New commits:
commit 166d3f204aad40f2cd023e4860200182dbe48d8f
Author: Marco Cecchetti 
AuthorDate: Mon Jul 10 17:26:52 2023 +0200
Commit: Miklos Vajna 
CommitDate: Fri Aug 11 22:06:28 2023 +0200

Get LOKDocumentFocusListener to handle enable/disable a11y properly

This patch fix the following problems:
- Remove all children when accessibility is disabled
- Update the currently focused paragraph when accessibility is enabled

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

diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index f204b03c3721..18208bb8e919 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -520,20 +520,23 @@ public:
 /// @throws lang::IndexOutOfBoundsException
 /// @throws uno::RuntimeException
 void detachRecursive(
-const uno::Reference< accessibility::XAccessible >& xAccessible
+const uno::Reference< accessibility::XAccessible >& xAccessible,
+bool bForce = false
 );
 
 /// @throws lang::IndexOutOfBoundsException
 /// @throws uno::RuntimeException
 void detachRecursive(
-const uno::Reference< accessibility::XAccessibleContext >& xContext
+const uno::Reference< accessibility::XAccessibleContext >& xContext,
+bool bForce = false
 );
 
 /// @throws lang::IndexOutOfBoundsException
 /// @throws uno::RuntimeException
 void detachRecursive(
 const uno::Reference< accessibility::XAccessibleContext >& xContext,
-const sal_Int64 nStateSet
+const sal_Int64 nStateSet,
+bool bForce = false
 );
 
 /// @throws lang::IndexOutOfBoundsException
@@ -1030,25 +1033,30 @@ void LOKDocumentFocusListener::attachRecursive(
 {
 // Usually, when the document is loaded, a CARET_CHANGED 
accessibility event is automatically emitted
 // for the first paragraph. That allows to notify the paragraph 
content to the client, even if no input
-// event occurred yet. However, in Cypress tests no accessibility 
event is automatically emitted until
-// some input event occurs. So we use the following workaround to 
notify the content of the focused
-// paragraph, without waiting for an input event.
+// event occurred yet. However, when switching to a11y enabled in 
the client and in Cypress tests
+// no accessibility event is automatically emitted until some 
input event occurs.
+// So we use the following workaround to notify the content of the 
focused paragraph,
+// without waiting for an input event.
 // Here we update the paragraph info related to the focused 
paragraph,
 // later when afterCallbackRegistered is executed we notify the 
paragraph content.
 sal_Int64 nChildCount = xContext->getAccessibleChildCount();
 if (nChildCount > 0)
 {
-uno::Reference< accessibility::XAccessible > xChild( 
xContext->getAccessibleChild( 0 ) );
-if( xChild.is() )
+for (sal_Int64 n = 0; n < nChildCount; ++n)
 {
-uno::Reference 
xAccText(xChild, uno::UNO_QUERY);
-if (xAccText.is())
+uno::Reference< accessibility::XAccessible > 
xChild(xContext->getAccessibleChild(n));
+if (xChild.is())
 {
-sal_Int32 nPos = xAccText->getCaretPosition();
-if (nPos >= 0)
+uno::Reference 
xAccText(xChild, uno::UNO_QUERY);
+if (xAccText.is())
 {
-attachRecursive(xChild);
-updateParagraphInfo(xAccText, false, 
"LOKDocumentFocusListener::attachRecursive(3)");
+sal_Int32 nPos = xAccText->getCaretPosition();
+if (nPos >= 0)
+{
+attachRecursive(xChild);
+updateParagraphInfo(xAccText, false, 
"LOKDocumentFocusListener::attachRecursive(3)");
+break;
+}
 }
 }
 }
@@ -1058,18 +1066,20 @@ void LOKDocumentFocusListener::attachRecursive(
 }
 
 void LOKDocumentFocusListener::detachRecursive(
-const uno::Reference< accessibility::XAccessible >& xAccessible
+const uno::Reference< accessibility::XAccessible >& xAccessible,
+bool bForce
 )
 {
 uno::Reference< accessibility::XAccessibleContext > xContext =
 xAccessible->getAc

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

2023-08-11 Thread Noel Grandin (via logerrit)
 canvas/source/cairo/cairo_canvas.hxx |   22 ++
 canvas/source/cairo/cairo_canvasbitmap.hxx   |   22 ++
 canvas/source/cairo/cairo_canvascustomsprite.hxx |   22 ++
 canvas/source/cairo/cairo_spritecanvas.hxx   |   22 ++
 canvas/source/opengl/ogl_spritecanvas.hxx|   22 ++
 canvas/source/vcl/canvas.hxx |   22 ++
 canvas/source/vcl/canvascustomsprite.hxx |   22 ++
 canvas/source/vcl/spritecanvas.hxx   |   22 ++
 8 files changed, 144 insertions(+), 32 deletions(-)

New commits:
commit eb6110aae0af9e27f71dac95274b8f3879090deb
Author: Noel Grandin 
AuthorDate: Fri Aug 11 15:00:18 2023 +0200
Commit: Noel Grandin 
CommitDate: Fri Aug 11 20:32:35 2023 +0200

clang-tidy bugprone-parent-virtual-call in canvas

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

diff --git a/canvas/source/cairo/cairo_canvas.hxx 
b/canvas/source/cairo/cairo_canvas.hxx
index 0c41a8a5c0d3..5d0b8e348caf 100644
--- a/canvas/source/cairo/cairo_canvas.hxx
+++ b/canvas/source/cairo/cairo_canvas.hxx
@@ -109,10 +109,24 @@ namespace cairocanvas
 
 // Forwarding the XComponent implementation to the
 // cppu::ImplHelper templated base
-//  Classname Base doing refcounting   
 Base implementing the XComponent interface
-//| |  
  |
-//V V  
  V
-DECLARE_UNO3_XCOMPONENT_AGG_DEFAULTS( Canvas, GraphicDeviceBase_Base, 
::cppu::WeakComponentImplHelperBase )
+virtual void SAL_CALL acquire() noexcept override { 
GraphicDeviceBase_Base::acquire(); }   \
+virtual void SAL_CALL release() noexcept override { 
GraphicDeviceBase_Base::release(); }   \
+virtual css::uno::Any  SAL_CALL queryInterface(const css::uno::Type& 
_rType) override
+{ return GraphicDeviceBase_Base::queryInterface(_rType); }
+virtual void SAL_CALL dispose() override
+{
+CanvasBaseSurfaceProvider_Base::dispose();
+}
+virtual void SAL_CALL addEventListener(
+css::uno::Reference< css::lang::XEventListener > const & xListener 
) override
+{
+CanvasBaseSurfaceProvider_Base::addEventListener(xListener);
+}
+virtual void SAL_CALL removeEventListener(
+css::uno::Reference< css::lang::XEventListener > const & xListener 
) override
+{
+CanvasBaseSurfaceProvider_Base::removeEventListener(xListener);
+}
 
 // XServiceName
 virtual OUString SAL_CALL getServiceName(  ) override;
diff --git a/canvas/source/cairo/cairo_canvasbitmap.hxx 
b/canvas/source/cairo/cairo_canvasbitmap.hxx
index f2371821023f..9e6d1d8a28cd 100644
--- a/canvas/source/cairo/cairo_canvasbitmap.hxx
+++ b/canvas/source/cairo/cairo_canvasbitmap.hxx
@@ -78,10 +78,24 @@ namespace cairocanvas
 
 // Forwarding the XComponent implementation to the
 // cppu::ImplHelper templated base
-//Classname Base doing 
refcountingBase implementing the XComponent interface
-//   | |   
 |
-//   V V   
 V
-DECLARE_UNO3_XCOMPONENT_AGG_DEFAULTS( CanvasBitmap, 
CanvasBitmapBase_Base, ::cppu::WeakComponentImplHelperBase )
+virtual void SAL_CALL acquire() noexcept override { 
CanvasBitmapBase_Base::acquire(); }
+virtual void SAL_CALL release() noexcept override { 
CanvasBitmapBase_Base::release(); }
+virtual css::uno::Any  SAL_CALL queryInterface(const css::uno::Type& 
_rType) override
+{ return CanvasBitmapBase_Base::queryInterface(_rType); }
+virtual void SAL_CALL dispose() override
+{
+CanvasBitmapSpriteSurface_Base::dispose();
+}
+virtual void SAL_CALL addEventListener(
+css::uno::Reference< css::lang::XEventListener > const & xListener 
) override
+{
+CanvasBitmapSpriteSurface_Base::addEventListener(xListener);
+}
+virtual void SAL_CALL removeEventListener(
+css::uno::Reference< css::lang::XEventListener > const & xListener 
) override
+{
+CanvasBitmapSpriteSurface_Base::removeEventListener(xListener);
+}
 
 // XServiceInfo
 virtual OUString SAL_CALL getImplementationName(  ) override;
diff --git a/canvas/source/cairo/cairo_canvascustomsprite.hxx 
b/canvas/source/cairo/cairo_canv

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

2023-08-11 Thread Andrea Gelmini (via logerrit)
 sw/source/core/attr/swatrset.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit cf686f4586fb0a94643efdde1c36ddd714d7479c
Author: Andrea Gelmini 
AuthorDate: Fri Aug 11 15:39:29 2023 +0200
Commit: Julien Nabet 
CommitDate: Fri Aug 11 19:19:52 2023 +0200

Fix typo

Change-Id: I0336d39dd003f18383326b3f7806597612edf755
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155623
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/sw/source/core/attr/swatrset.cxx b/sw/source/core/attr/swatrset.cxx
index f2761d7dec41..b319330e6ed8 100644
--- a/sw/source/core/attr/swatrset.cxx
+++ b/sw/source/core/attr/swatrset.cxx
@@ -122,7 +122,7 @@ void SwAttrSet::changeCallback(const SfxPoolItem* pOld, 
const SfxPoolItem* pNew)
 }
 }
 
-// all given itmes are valid. If we got no WhichID != 0 then
+// all given items are valid. If we got no WhichID != 0 then
 // pOld == pNew == nullptr or SfxVoidItem(0) and we have no
 // valid input. Also not needed if !IsWhich (aka > SFX_WHICH_MAX)
 if (0 == nWhich || !SfxItemPool::IsWhich(nWhich))


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

2023-08-11 Thread Henry Castro (via logerrit)
 sc/source/ui/view/tabview2.cxx |   20 
 1 file changed, 20 insertions(+)

New commits:
commit ee6d3d10ae7962d7eb6562e65abe9e1524a04e99
Author: Henry Castro 
AuthorDate: Tue Jul 18 15:09:18 2023 -0400
Commit: Henry Castro 
CommitDate: Fri Aug 11 19:18:02 2023 +0200

tdf#155799: sc: fix formula reference "key up"

When the formula reference mode is active and it process
the keyboard event UP, it should decrease -1 according
the merge attribute row, col span.

Signed-off-by: Henry Castro 
Change-Id: I278bcd9d52caeb09e4a47336af8c8e9b522397c9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154999
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tomaž Vajngerl 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155628

diff --git a/sc/source/ui/view/tabview2.cxx b/sc/source/ui/view/tabview2.cxx
index d9fa2cb3f3d5..6c7cdadd4d48 100644
--- a/sc/source/ui/view/tabview2.cxx
+++ b/sc/source/ui/view/tabview2.cxx
@@ -197,6 +197,8 @@ void moveRefByCell(SCCOL& rNewX, SCROW& rNewY,
SCCOL nMovX, SCROW nMovY, SCTAB nRefTab,
const ScDocument& rDoc)
 {
+SCCOL nOldX = rNewX;
+SCROW nOldY = rNewY;
 bool bSelectLocked = true;
 bool bSelectUnlocked = true;
 const ScTableProtection* pTabProtection = rDoc.GetTabProtection(nRefTab);
@@ -223,6 +225,15 @@ void moveRefByCell(SCCOL& rNewX, SCROW& rNewY,
 }
 if (isCellQualified(&rDoc, nTempX, rNewY, nRefTab, bSelectLocked, 
bSelectUnlocked))
 rNewX = nTempX;
+
+if (nMovX < 0 && rNewX > 0)
+{
+const ScMergeAttr* pMergeAttr = rDoc.GetAttr(rNewX, rNewY, 
nRefTab, ATTR_MERGE);
+if (pMergeAttr && pMergeAttr->IsMerged() &&
+nOldX >= rNewX &&
+nOldX <= rNewX + pMergeAttr->GetRowMerge() - 1)
+rNewX = rNewX - 1;
+}
 }
 
 if (nMovY)
@@ -239,6 +250,15 @@ void moveRefByCell(SCCOL& rNewX, SCROW& rNewY,
 }
 if (isCellQualified(&rDoc, rNewX, nTempY, nRefTab, bSelectLocked, 
bSelectUnlocked))
 rNewY = nTempY;
+
+if (nMovY < 0 && rNewY > 0)
+{
+const ScMergeAttr* pMergeAttr = rDoc.GetAttr(rNewX, rNewY, 
nRefTab, ATTR_MERGE);
+if (pMergeAttr && pMergeAttr->IsMerged() &&
+nOldY >= rNewY &&
+nOldY <= rNewY + pMergeAttr->GetRowMerge() - 1)
+rNewY = rNewY - 1;
+}
 }
 
 rDoc.SkipOverlapped(rNewX, rNewY, nRefTab);


[Libreoffice-commits] core.git: include/sfx2 sc/source sd/source sfx2/source sw/source

2023-08-11 Thread Marco Cecchetti (via logerrit)
 include/sfx2/viewsh.hxx |2 +
 sc/source/ui/view/tabvwshc.cxx  |3 +
 sd/source/ui/inc/ViewShellBase.hxx  |2 -
 sd/source/ui/view/ViewShellBase.cxx |5 ---
 sfx2/source/view/viewsh.cxx |   58 
 sw/source/uibase/uiview/view.cxx|4 ++
 6 files changed, 61 insertions(+), 13 deletions(-)

New commits:
commit 9de08c6f8f2b4150da628fe3e9311f5dc64137b0
Author: Marco Cecchetti 
AuthorDate: Mon Jun 5 21:33:55 2023 +0200
Commit: Miklos Vajna 
CommitDate: Fri Aug 11 19:13:38 2023 +0200

lok: a11y: get focused paragraph notified on document load

Usually, when the document is loaded, a CARET_CHANGED accessibility
event is automatically emitted for the first paragraph. That allows to
notify the paragraph content to the client, even if no input event
occurred yet. However, in Cypress tests no accessibility event is
automatically emitted until some input event occurs. So we use the
workaround in this patch to notify the content of the focused
paragraph, without waiting for an input event.

(cherry picked from commit d6f929c03ca08a0c1134937a1ff1a42f75221e93)

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

diff --git a/include/sfx2/viewsh.hxx b/include/sfx2/viewsh.hxx
index 4adf62a196c4..c0628a0bd4fb 100644
--- a/include/sfx2/viewsh.hxx
+++ b/include/sfx2/viewsh.hxx
@@ -440,6 +440,8 @@ public:
 const LanguageTag& GetLOKLanguageTag() const { return maLOKLanguageTag; }
 /// Enable/Disable LibreOfficeKit AT support for this view.
 void SetLOKAccessibilityState(bool bEnabled);
+/// Get LibreOfficeKit AT support state for this view.
+bool GetLOKAccessibilityState() const { return mbLOKAccessibilityEnabled; }
 
 /// Get the LibreOfficeKit timezone of this view. See @SetLOKTimezone.
 std::pair GetLOKTimezone() const
diff --git a/sc/source/ui/view/tabvwshc.cxx b/sc/source/ui/view/tabvwshc.cxx
index 997e710e18e9..56cfba5ddfdb 100644
--- a/sc/source/ui/view/tabvwshc.cxx
+++ b/sc/source/ui/view/tabvwshc.cxx
@@ -453,6 +453,9 @@ int ScTabViewShell::getPart() const
 
 void ScTabViewShell::afterCallbackRegistered()
 {
+// common tasks
+SfxViewShell::afterCallbackRegistered();
+
 UpdateInputHandler(true, false);
 
 ScInputHandler* pHdl = mpInputHandler ? mpInputHandler.get() : 
SC_MOD()->GetInputHdl();
diff --git a/sd/source/ui/inc/ViewShellBase.hxx 
b/sd/source/ui/inc/ViewShellBase.hxx
index 3f40123405f3..c2b2d16158e0 100644
--- a/sd/source/ui/inc/ViewShellBase.hxx
+++ b/sd/source/ui/inc/ViewShellBase.hxx
@@ -217,8 +217,6 @@ public:
 int getEditMode() const override;
 /// See SfxViewShell::setEditMode().
 void setEditMode(int nMode);
-/// See SfxViewShell::afterCallbackRegistered().
-void afterCallbackRegistered() override;
 /// See SfxViewShell::NotifyCursor().
 void NotifyCursor(SfxViewShell* pViewShell) const override;
 /// See SfxViewShell::GetColorConfigColor().
diff --git a/sd/source/ui/view/ViewShellBase.cxx 
b/sd/source/ui/view/ViewShellBase.cxx
index 460e102e7796..6ad6d454be57 100644
--- a/sd/source/ui/view/ViewShellBase.cxx
+++ b/sd/source/ui/view/ViewShellBase.cxx
@@ -1010,11 +1010,6 @@ void ViewShellBase::setEditMode(int nMode)
 }
 }
 
-void ViewShellBase::afterCallbackRegistered()
-{
-// TODO: Add theme color palette changed callback
-}
-
 void ViewShellBase::NotifyCursor(SfxViewShell* pOtherShell) const
 {
 ViewShell* pThisShell = 
framework::FrameworkHelper::Instance(*const_cast(this))->GetViewShell(FrameworkHelper::msCenterPaneURL).get();
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index 0d61e2f3f005..f204b03c3721 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -554,8 +554,10 @@ public:
 int getCaretPosition() const;
 
 private:
-void updateParagraphInfo(const 
uno::Reference& xAccText,
+bool updateParagraphInfo(const 
uno::Reference& xAccText,
  bool force, std::string msg = "");
+void updateAndNotifyParagraph(const 
uno::Reference& xAccText,
+  bool force, std::string msg = "");
 };
 
 LOKDocumentFocusListener::LOKDocumentFocusListener(const SfxViewShell* 
pViewShell)
@@ -676,12 +678,13 @@ void LOKDocumentFocusListener::disposing( const 
lang::EventObject& aEvent )
 
 }
 
-void LOKDocumentFocusListener::updateParagraphInfo(const 
uno::Reference& xAccText,
+bool LOKDocumentFocusListener::updateParagraphInfo(const 
uno::Reference& xAccText,
bool force, std::string msg)
 {
 if (!xAccText.is())
-return;
+return false;
 
+bool bNotify = false;
 // If caret is present inside the paragraph (pos != -1), it means that 
paragraph has focus in the current view.
 sal_Int32

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

2023-08-11 Thread Noel Grandin (via logerrit)
 include/vcl/toolbox.hxx   |1 -
 vcl/source/app/idle.cxx   |2 +-
 vcl/source/app/salvtables.cxx |8 
 vcl/source/control/PriorityMergedHBox.cxx |   10 +-
 vcl/source/control/combobox.cxx   |8 
 vcl/source/control/imp_listbox.cxx|2 +-
 vcl/source/control/spinfld.cxx|2 +-
 vcl/source/edit/vclmedit.cxx  |4 ++--
 vcl/source/uitest/uiobject.cxx|6 +++---
 vcl/source/window/menubarwindow.cxx   |2 +-
 vcl/source/window/toolbox.cxx |5 -
 vcl/unx/gtk3/gtkinst.cxx  |2 +-
 12 files changed, 23 insertions(+), 29 deletions(-)

New commits:
commit 69972719542cd686687ddd91f2b5284483513608
Author: Noel Grandin 
AuthorDate: Fri Aug 11 15:01:21 2023 +0200
Commit: Noel Grandin 
CommitDate: Fri Aug 11 18:47:15 2023 +0200

clang-tidy bugprone-parent-virtual-call in vcl

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

diff --git a/include/vcl/toolbox.hxx b/include/vcl/toolbox.hxx
index 6cf448a30b1d..aa24a6d5c2c4 100644
--- a/include/vcl/toolbox.hxx
+++ b/include/vcl/toolbox.hxx
@@ -291,7 +291,6 @@ public:
 virtual voidResizing( Size& rSize ) override;
 virtual SizeGetOptimalSize() const override;
 virtual voiddoDeferredInit(WinBits nBits) override;
-virtual voidqueue_resize(StateChangedType eReason = 
StateChangedType::Layout) override;
 
 /// Insert a command (like '.uno:Save').
 virtual voidInsertItem( const OUString& rCommand,
diff --git a/vcl/source/app/idle.cxx b/vcl/source/app/idle.cxx
index 7e5756537164..0aed942beb79 100644
--- a/vcl/source/app/idle.cxx
+++ b/vcl/source/app/idle.cxx
@@ -33,7 +33,7 @@ Idle::Idle( const char *pDebugName )
 
 void Idle::Start(const bool bStartTimer)
 {
-Task::Start(false);
+Timer::Start(false);
 
 sal_uInt64 nPeriod = Scheduler::ImmediateTimeoutMs;
 if (Scheduler::GetDeterministicMode())
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 80772536adeb..1ce6cf936316 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -6227,22 +6227,22 @@ void SalInstanceDrawingArea::queue_draw_area(int x, int 
y, int width, int height
 
 void SalInstanceDrawingArea::connect_size_allocate(const Link& rLink)
 {
-weld::Widget::connect_size_allocate(rLink);
+SalInstanceWidget::connect_size_allocate(rLink);
 }
 
 void SalInstanceDrawingArea::connect_key_press(const Link& rLink)
 {
-weld::Widget::connect_key_press(rLink);
+SalInstanceWidget::connect_key_press(rLink);
 }
 
 void SalInstanceDrawingArea::connect_key_release(const Link& rLink)
 {
-weld::Widget::connect_key_release(rLink);
+SalInstanceWidget::connect_key_release(rLink);
 }
 
 void SalInstanceDrawingArea::connect_style_updated(const Link& 
rLink)
 {
-weld::Widget::connect_style_updated(rLink);
+SalInstanceWidget::connect_style_updated(rLink);
 }
 
 void SalInstanceDrawingArea::set_cursor(PointerStyle ePointerStyle)
diff --git a/vcl/source/control/PriorityMergedHBox.cxx 
b/vcl/source/control/PriorityMergedHBox.cxx
index fd5aa5814dac..5d5e6249ed16 100644
--- a/vcl/source/control/PriorityMergedHBox.cxx
+++ b/vcl/source/control/PriorityMergedHBox.cxx
@@ -46,18 +46,18 @@ PriorityMergedHBox::PriorityMergedHBox(vcl::Window* pParent)
 void PriorityMergedHBox::Resize()
 {
 if (comphelper::LibreOfficeKit::isActive())
-return VclHBox::Resize();
+return PriorityHBox::Resize();
 
 if (!m_bInitialized)
 Initialize();
 
 if (!m_bInitialized)
 {
-return VclHBox::Resize();
+return PriorityHBox::Resize();
 }
 
 tools::Long nWidth = GetSizePixel().Width();
-tools::Long nCurrentWidth = VclHBox::calculateRequisition().getWidth() + 
BUTTON_WIDTH;
+tools::Long nCurrentWidth = 
PriorityHBox::calculateRequisition().getWidth() + BUTTON_WIDTH;
 
 // Hide lower priority controls
 for (int i = GetChildCount() - 1; i >= 0; i--)
@@ -104,7 +104,7 @@ void PriorityMergedHBox::Resize()
 }
 }
 
-VclHBox::Resize();
+PriorityHBox::Resize();
 
 if (GetHiddenCount())
 m_pButton->Show();
@@ -138,7 +138,7 @@ Size PriorityMergedHBox::calculateRequisition() const
 {
 if (!m_bInitialized)
 {
-return VclHBox::calculateRequisition();
+return PriorityHBox::calculateRequisition();
 }
 
 sal_uInt16 nVisibleChildren = 0;
diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx
index 05b7a50006b9..ac817ce2a426 100644
--- a/vcl/source/control/combobox.cxx
+++ b/vcl/source/control/combobox.cxx
@@ -575,7 +575,7 @@ void ComboBox::setPosSizePixel( tools::Long nX, tools::Long 
nY, tools::Long nWid
 
 void ComboBox::Resize()
 {
-Control::Res

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

2023-08-11 Thread Caolán McNamara (via logerrit)
 sc/inc/postit.hxx  |5 +
 sc/source/core/data/postit.cxx |   41 +
 2 files changed, 30 insertions(+), 16 deletions(-)

New commits:
commit ac40c3923580e4ec0e738d57ff8b885da93301ef
Author: Caolán McNamara 
AuthorDate: Fri Aug 11 13:08:36 2023 +0100
Commit: Caolán McNamara 
CommitDate: Fri Aug 11 18:14:15 2023 +0200

split out a common CreateNoteData

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

diff --git a/sc/inc/postit.hxx b/sc/inc/postit.hxx
index 92602e5150ac..c6ac3b5a4bd4 100644
--- a/sc/inc/postit.hxx
+++ b/sc/inc/postit.hxx
@@ -178,6 +178,9 @@ class SC_DLLPUBLIC ScNoteUtil
 {
 static ScPostIt* InsertNote(ScDocument& rDoc, const ScAddress& rPos, 
ScNoteData&& rNoteData,
 bool bAlwaysCreateCaption, sal_uInt32 
nPostItId);
+
+static ScNoteData CreateNoteData(ScDocument& rDoc, const ScAddress& rPos, 
const OutlinerParaObject& rOutlinerObj,
+ const tools::Rectangle& rCaptionRect, 
bool bShown);
 public:
 
 /** Creates and returns a caption object for a temporary caption. */
diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx
index 8fa13927d3d9..378323338eb1 100644
--- a/sc/source/core/data/postit.cxx
+++ b/sc/source/core/data/postit.cxx
@@ -929,17 +929,13 @@ ScPostIt* ScNoteUtil::CreateNoteFromCaption(
 return pNote;
 }
 
-ScPostIt* ScNoteUtil::CreateNoteFromObjectData(
-ScDocument& rDoc, const ScAddress& rPos, SfxItemSet&& rItemSet, const 
OUString& rStyleName,
-const OutlinerParaObject& rOutlinerObj, const tools::Rectangle& 
rCaptionRect,
-bool bShown )
+ScNoteData ScNoteUtil::CreateNoteData(ScDocument& rDoc, const ScAddress& rPos, 
const OutlinerParaObject& rOutlinerObj,
+  const tools::Rectangle& rCaptionRect, 
bool bShown)
 {
 ScNoteData aNoteData( bShown );
 aNoteData.mxInitData = std::make_shared();
 ScCaptionInitData& rInitData = *aNoteData.mxInitData;
-rInitData.moItemSet.emplace(std::move(rItemSet));
 rInitData.mxOutlinerObj = rOutlinerObj;
-rInitData.maStyleName = 
ScStyleNameConversion::ProgrammaticToDisplayName(rStyleName, 
SfxStyleFamily::Frame);
 
 // convert absolute caption position to relative position
 rInitData.mbDefaultPosSize = rCaptionRect.IsEmpty();
@@ -952,6 +948,19 @@ ScPostIt* ScNoteUtil::CreateNoteFromObjectData(
 rInitData.maCaptionSize = rCaptionRect.GetSize();
 }
 
+return aNoteData;
+}
+
+ScPostIt* ScNoteUtil::CreateNoteFromObjectData(
+ScDocument& rDoc, const ScAddress& rPos, SfxItemSet&& rItemSet, const 
OUString& rStyleName,
+const OutlinerParaObject& rOutlinerObj, const tools::Rectangle& 
rCaptionRect,
+bool bShown )
+{
+ScNoteData aNoteData(CreateNoteData(rDoc, rPos, rOutlinerObj, 
rCaptionRect, bShown));
+ScCaptionInitData& rInitData = *aNoteData.mxInitData;
+rInitData.moItemSet.emplace(std::move(rItemSet));
+rInitData.maStyleName = 
ScStyleNameConversion::ProgrammaticToDisplayName(rStyleName, 
SfxStyleFamily::Frame);
+
 return InsertNote(rDoc, rPos, std::move(aNoteData), 
/*bAlwaysCreateCaption*/false, 0/*nPostItId*/);
 }
 
commit 5ae486eea7a381403a9f81e5aa8ef1a0a57b95b6
Author: Caolán McNamara 
AuthorDate: Fri Aug 11 13:01:17 2023 +0100
Commit: Caolán McNamara 
CommitDate: Fri Aug 11 18:14:05 2023 +0200

split out common ScPostIt insertion piece

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

diff --git a/sc/inc/postit.hxx b/sc/inc/postit.hxx
index 828d094e49d1..92602e5150ac 100644
--- a/sc/inc/postit.hxx
+++ b/sc/inc/postit.hxx
@@ -176,6 +176,8 @@ private:
 
 class SC_DLLPUBLIC ScNoteUtil
 {
+static ScPostIt* InsertNote(ScDocument& rDoc, const ScAddress& rPos, 
ScNoteData&& rNoteData,
+bool bAlwaysCreateCaption, sal_uInt32 
nPostItId);
 public:
 
 /** Creates and returns a caption object for a temporary caption. */
diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx
index cbb2eff1ff14..8fa13927d3d9 100644
--- a/sc/source/core/data/postit.cxx
+++ b/sc/source/core/data/postit.cxx
@@ -23,8 +23,8 @@
 #include 
 #include 
 #include 
-#include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -952,13 +952,18 @@ ScPostIt* ScNoteUtil::CreateNoteFromObjectData(
 rInitData.maCaptionSize = rCaptionRect.GetSize();
 }
 
+return InsertNote(rDoc, rPos, std::move(aNoteData), 
/*bAlwaysCreateCaption*/false, 0/*nPostItId*/);
+}
+
+ScPostIt* ScNoteUtil::InsertNote(ScDocument& rDoc, const ScAddress& rPos, 
ScNoteData&& rNoteData,
+ bool bAlwaysCreat

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

2023-08-11 Thread Caolán McNamara (via logerrit)
 sc/source/filter/oox/commentsbuffer.cxx |   43 +---
 1 file changed, 34 insertions(+), 9 deletions(-)

New commits:
commit e11a0e646b8eb75e102f878dc70f5196c4efbea2
Author: Caolán McNamara 
AuthorDate: Fri Aug 11 12:32:09 2023 +0100
Commit: Caolán McNamara 
CommitDate: Fri Aug 11 18:13:48 2023 +0200

rearrange to collect the properties set on the annotation together

and set them in one block. No behavior change intended.

note: type passed as TextFitToSize seems to be wrong
Change-Id: I349aeba5176ef6c10163069a73d0367469aadd6b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155588
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 

diff --git a/sc/source/filter/oox/commentsbuffer.cxx 
b/sc/source/filter/oox/commentsbuffer.cxx
index 55bcb7e2cc73..9307ad707006 100644
--- a/sc/source/filter/oox/commentsbuffer.cxx
+++ b/sc/source/filter/oox/commentsbuffer.cxx
@@ -169,10 +169,11 @@ void Comment::finalizeImport()
 // setting a property triggers expensive process, so set them all at 
once
 
 // Add shape formatting properties (autoFill, colHidden and rowHidden 
are dropped)
-static_cast(xAnnoShape.get())->setPropertyValues(
-Sequence { "TextFitToSize", "MoveProtect", 
"TextHorizontalAdjust", "TextVerticalAdjust" },
-Sequence { Any(maModel.mbAutoScale), Any(maModel.mbLocked),
-Any(lcl_ToHorizAlign( maModel.mnTHA )), Any(lcl_ToVertAlign( 
maModel.mnTVA )) });
+// vvv TODO vvv TextFitToSize should be a drawing::TextFitToSizeType 
not bool
+Sequence aPropertyNames{ "TextFitToSize", "MoveProtect", 
"TextHorizontalAdjust", "TextVerticalAdjust" };
+Sequence aPropertyValues{ Any(maModel.mbAutoScale), 
Any(maModel.mbLocked),
+Any(lcl_ToHorizAlign( maModel.mnTHA )), Any(lcl_ToVertAlign( 
maModel.mnTVA )) };
+
 if( maModel.maAnchor.Width > 0 && maModel.maAnchor.Height > 0 )
 {
 xAnnoShape->setPosition( css::awt::Point( maModel.maAnchor.X, 
maModel.maAnchor.Y ) );
@@ -191,18 +192,42 @@ void Comment::finalizeImport()
 xAnnoShape->setSize(css::awt::Size(aShapeRect.Width, 
aShapeRect.Height));
 
 ::oox::drawingml::ShapePropertyMap 
aPropMap(pVmlNoteShape->makeShapePropertyMap());
-css::uno::Reference xShape(xAnnoShape);
-PropertySet(xShape).setProperties(aPropMap);
+
+Sequence aVMLPropNames;
+Sequence aVMLPropValues;
+aPropMap.fillSequences(aVMLPropNames, aVMLPropValues);
+
+sal_uInt32 nOldPropLen = aPropertyNames.getLength();
+sal_uInt32 nVMLPropLen = aVMLPropNames.getLength();
+aPropertyNames.realloc(nOldPropLen + nVMLPropLen);
+aPropertyValues.realloc(nOldPropLen + nVMLPropLen);
+OUString* pNames = aPropertyNames.getArray();
+Any* pValues = aPropertyValues.getArray();
+for (sal_uInt32 i = 0; i < nVMLPropLen; ++i)
+{
+pNames[nOldPropLen + i] = aVMLPropNames[i];
+pValues[nOldPropLen + i] = aVMLPropValues[i];
+}
 }
+
 // visibility
 bVisible = pVmlNoteShape->getTypeModel().mbVisible;
 
 // Setting comment text alignment
 const ::oox::vml::ClientData* xClientData = 
pVmlNoteShape->getClientData();
-static_cast(xAnnoShape.get())->setPropertyValues(
-Sequence { "TextVerticalAdjust", "ParaAdjust" },
-Sequence { Any(lcl_ToVertAlign( xClientData->mnTextVAlign 
)), Any(lcl_ToParaAlign( xClientData->mnTextHAlign )) });
+sal_uInt32 nOldPropLen = aPropertyNames.getLength();
+aPropertyNames.realloc(nOldPropLen + 2);
+aPropertyValues.realloc(nOldPropLen + 2);
+OUString* pNames = aPropertyNames.getArray();
+Any* pValues = aPropertyValues.getArray();
+pNames[nOldPropLen] = "TextVerticalAdjust";
+pValues[nOldPropLen] <<= 
lcl_ToVertAlign(xClientData->mnTextVAlign);
+pNames[nOldPropLen + 1] = "ParaAdjust";
+pValues[nOldPropLen + 1] <<= lcl_ToParaAlign( 
xClientData->mnTextHAlign);
 }
+
+
static_cast(xAnnoShape.get())->setPropertyValues(aPropertyNames, 
aPropertyValues);
+
 if (bVisible)
 pDocShell->GetDocFunc().ShowNote( maModel.maRange.aStart, bVisible 
);
 


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

2023-08-11 Thread Caolán McNamara (via logerrit)
 include/oox/vml/vmlshape.hxx|8 +---
 oox/source/vml/vmlshape.cxx |   25 +
 sc/source/filter/oox/commentsbuffer.cxx |7 ++-
 3 files changed, 24 insertions(+), 16 deletions(-)

New commits:
commit 6945d031e759823ab52bdf077e43196b67f594a4
Author: Caolán McNamara 
AuthorDate: Fri Aug 11 11:37:28 2023 +0100
Commit: Caolán McNamara 
CommitDate: Fri Aug 11 18:13:13 2023 +0200

move setting properties into note comments from oox to sc

no change in behavior intended, the SdrCaption doesn't support
the skipped conditions

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

diff --git a/include/oox/vml/vmlshape.hxx b/include/oox/vml/vmlshape.hxx
index 2aa2163653de..e95e44053330 100644
--- a/include/oox/vml/vmlshape.hxx
+++ b/include/oox/vml/vmlshape.hxx
@@ -267,9 +267,11 @@ public:
 const css::uno::Reference< css::drawing::XShapes 
>& rxShapes,
 const ShapeParentAnchor* pParentAnchor = nullptr ) 
const;
 
-/** Converts formatting into the passed existing XShape and returns 
position. */
-css::awt::Rectangle convertFormatting(
-const css::uno::Reference< css::drawing::XShape >& 
rxShape ) const;
+/** Returns bounds of Shape */
+css::awt::Rectangle getShapeRectangle() const;
+
+/** Collects common shape properties such as formatting attributes. */
+oox::drawingml::ShapePropertyMap makeShapePropertyMap() const;
 
 void setContainer(ShapeContainer* pContainer);
 ShapeContainer* getContainer() const;
@@ -295,9 +297,6 @@ protected:
 css::awt::Rectangle calcShapeRectangle(
 const ShapeParentAnchor* pParentAnchor ) const;
 
-/** Collects common shape properties such as formatting attributes. */
-oox::drawingml::ShapePropertyMap makeShapePropertyMap() const;
-
 /** Converts common shape properties such as formatting attributes. */
 voidconvertShapeProperties(
 const css::uno::Reference< css::drawing::XShape >& 
rxShape ) const;
diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx
index c297fc1563bb..81ba42ba0a48 100644
--- a/oox/source/vml/vmlshape.cxx
+++ b/oox/source/vml/vmlshape.cxx
@@ -484,20 +484,11 @@ Reference< XShape > ShapeBase::convertAndInsert( const 
Reference< XShapes >& rxS
 return xShape;
 }
 
-awt::Rectangle ShapeBase::convertFormatting( const Reference< XShape >& 
rxShape ) const
+awt::Rectangle ShapeBase::getShapeRectangle() const
 {
-if( !rxShape.is() )
-return awt::Rectangle();
-
 /*  Calculate shape rectangle. Applications may do something special
 according to some imported shape client data (e.g. Excel cell anchor). 
*/
-awt::Rectangle aShapeRect = calcShapeRectangle( nullptr );
-
-// convert the shape, if the calculated rectangle is not empty
-if( (aShapeRect.Width > 0) || (aShapeRect.Height > 0) )
-convertShapeProperties( rxShape );
-
-return aShapeRect;
+return calcShapeRectangle(nullptr);
 }
 
 void ShapeBase::setContainer(ShapeContainer* pContainer) { mpContainer = 
pContainer; }
diff --git a/sc/source/filter/oox/commentsbuffer.cxx 
b/sc/source/filter/oox/commentsbuffer.cxx
index 555ddad3a924..55bcb7e2cc73 100644
--- a/sc/source/filter/oox/commentsbuffer.cxx
+++ b/sc/source/filter/oox/commentsbuffer.cxx
@@ -24,6 +24,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -183,11 +184,15 @@ void Comment::finalizeImport()
 if( const ::oox::vml::ShapeBase* pVmlNoteShape = 
getVmlDrawing().getNoteShape( maModel.maRange.aStart ) )
 {
 // position and formatting
-css::awt::Rectangle aShapeRect = 
pVmlNoteShape->convertFormatting(xAnnoShape);
+css::awt::Rectangle aShapeRect = 
pVmlNoteShape->getShapeRectangle();
 if (aShapeRect.Width > 0 || aShapeRect.Height > 0)
 {
 xAnnoShape->setPosition(css::awt::Point(aShapeRect.X, 
aShapeRect.Y));
 xAnnoShape->setSize(css::awt::Size(aShapeRect.Width, 
aShapeRect.Height));
+
+::oox::drawingml::ShapePropertyMap 
aPropMap(pVmlNoteShape->makeShapePropertyMap());
+css::uno::Reference xShape(xAnnoShape);
+PropertySet(xShape).setProperties(aPropMap);
 }
 // visibility
 bVisible = pVmlNoteShape->getTypeModel().mbVisible;
commit c88855c45a675cf28e2cfe4fa261c2b0339f5898
Author: Caolán McNamara 
AuthorDate: Fri Aug 11 11:15:22 2023 +0100
Commit: Caolán McNamara 
CommitDate: Fri Aug 11 18:13:04 2023 +0200

split ShapeBase::convertShapeProperties into two parts

Change-Id: I62f42e54c776f15ea83c5fc861bb4f4ff899e891
Reviewed-on: https://gerrit.lib

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

2023-08-11 Thread Caolán McNamara (via logerrit)
 include/oox/vml/vmlshape.hxx|4 ++--
 oox/source/vml/vmlshape.cxx |   10 --
 sc/source/filter/oox/commentsbuffer.cxx |7 ++-
 3 files changed, 12 insertions(+), 9 deletions(-)

New commits:
commit 5aeb15e95d26ce6de28eb5f5933324828d553f41
Author: Caolán McNamara 
AuthorDate: Fri Aug 11 10:46:53 2023 +0100
Commit: Caolán McNamara 
CommitDate: Fri Aug 11 18:12:47 2023 +0200

refactor to return the position to be set by the caller instead

no change in behavior intended

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

diff --git a/include/oox/vml/vmlshape.hxx b/include/oox/vml/vmlshape.hxx
index d46c23282324..8c63d8cbd26c 100644
--- a/include/oox/vml/vmlshape.hxx
+++ b/include/oox/vml/vmlshape.hxx
@@ -267,8 +267,8 @@ public:
 const css::uno::Reference< css::drawing::XShapes 
>& rxShapes,
 const ShapeParentAnchor* pParentAnchor = nullptr ) 
const;
 
-/** Converts position and formatting into the passed existing XShape. */
-voidconvertFormatting(
+/** Converts formatting into the passed existing XShape and returns 
position. */
+css::awt::Rectangle convertFormatting(
 const css::uno::Reference< css::drawing::XShape >& 
rxShape ) const;
 
 void setContainer(ShapeContainer* pContainer);
diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx
index 607ddf5354b4..328abeba7875 100644
--- a/oox/source/vml/vmlshape.cxx
+++ b/oox/source/vml/vmlshape.cxx
@@ -484,10 +484,10 @@ Reference< XShape > ShapeBase::convertAndInsert( const 
Reference< XShapes >& rxS
 return xShape;
 }
 
-void ShapeBase::convertFormatting( const Reference< XShape >& rxShape ) const
+awt::Rectangle ShapeBase::convertFormatting( const Reference< XShape >& 
rxShape ) const
 {
 if( !rxShape.is() )
-return;
+return awt::Rectangle();
 
 /*  Calculate shape rectangle. Applications may do something special
 according to some imported shape client data (e.g. Excel cell anchor). 
*/
@@ -495,11 +495,9 @@ void ShapeBase::convertFormatting( const Reference< XShape 
>& rxShape ) const
 
 // convert the shape, if the calculated rectangle is not empty
 if( (aShapeRect.Width > 0) || (aShapeRect.Height > 0) )
-{
-rxShape->setPosition( awt::Point( aShapeRect.X, aShapeRect.Y ) );
-rxShape->setSize( awt::Size( aShapeRect.Width, aShapeRect.Height ) );
 convertShapeProperties( rxShape );
-}
+
+return aShapeRect;
 }
 
 void ShapeBase::setContainer(ShapeContainer* pContainer) { mpContainer = 
pContainer; }
diff --git a/sc/source/filter/oox/commentsbuffer.cxx 
b/sc/source/filter/oox/commentsbuffer.cxx
index 05deae3ee876..555ddad3a924 100644
--- a/sc/source/filter/oox/commentsbuffer.cxx
+++ b/sc/source/filter/oox/commentsbuffer.cxx
@@ -183,7 +183,12 @@ void Comment::finalizeImport()
 if( const ::oox::vml::ShapeBase* pVmlNoteShape = 
getVmlDrawing().getNoteShape( maModel.maRange.aStart ) )
 {
 // position and formatting
-pVmlNoteShape->convertFormatting( xAnnoShape );
+css::awt::Rectangle aShapeRect = 
pVmlNoteShape->convertFormatting(xAnnoShape);
+if (aShapeRect.Width > 0 || aShapeRect.Height > 0)
+{
+xAnnoShape->setPosition(css::awt::Point(aShapeRect.X, 
aShapeRect.Y));
+xAnnoShape->setSize(css::awt::Size(aShapeRect.Width, 
aShapeRect.Height));
+}
 // visibility
 bVisible = pVmlNoteShape->getTypeModel().mbVisible;
 


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

2023-08-11 Thread Caolán McNamara (via logerrit)
 sc/source/filter/inc/workbookhelper.hxx |   48 +++
 sc/source/filter/oox/stylesbuffer.cxx   |   97 +++-
 sc/source/filter/oox/workbookhelper.cxx |8 ++
 3 files changed, 115 insertions(+), 38 deletions(-)

New commits:
commit de20853e5243843ac9f4c5927ce0b4cf0e407c15
Author: Caolán McNamara 
AuthorDate: Thu Aug 10 21:49:59 2023 +0100
Commit: Caolán McNamara 
CommitDate: Fri Aug 11 18:11:47 2023 +0200

xlsx with a lot of comments repeatedly calls OutputDevice::HasGlyphs

on the same font over and over again getting the same results

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

diff --git a/sc/source/filter/inc/workbookhelper.hxx 
b/sc/source/filter/inc/workbookhelper.hxx
index 7b3047759329..8e2aa221241a 100644
--- a/sc/source/filter/inc/workbookhelper.hxx
+++ b/sc/source/filter/inc/workbookhelper.hxx
@@ -21,10 +21,14 @@
 
 #include 
 #include 
+#include 
 
+#include 
 #include 
 #include 
 
+#include 
+
 namespace oox::drawingml::chart { class ChartConverter; }
 namespace rtl { template  class Reference; }
 
@@ -57,6 +61,22 @@ class ScRangeData;
 
 namespace oox::xls {
 
+enum class FontClassification : sal_uInt8
+{
+None= 0x,
+Asian   = 0x0001,
+Cmplx   = 0x0002,
+Latin   = 0x0004
+};
+
+}
+
+namespace o3tl {
+template<> struct typed_flags : 
is_typed_flags {};
+}
+
+namespace oox::xls {
+
 class ExcelFilter;
 
 /** Functor for case-insensitive string comparison, usable in maps etc. */
@@ -87,6 +107,32 @@ class FormulaBuffer;
 class WorkbookGlobals;
 typedef std::shared_ptr< WorkbookGlobals > WorkbookGlobalsRef;
 
+struct FontDescriptorHash
+{
+size_t operator()( const css::awt::FontDescriptor& rKey) const
+{
+std::size_t seed = rKey.Name.hashCode();
+o3tl::hash_combine(seed, rKey.Height);
+o3tl::hash_combine(seed, rKey.Width);
+o3tl::hash_combine(seed, rKey.StyleName.hashCode());
+o3tl::hash_combine(seed, rKey.Family);
+o3tl::hash_combine(seed, rKey.CharSet);
+o3tl::hash_combine(seed, rKey.Pitch);
+o3tl::hash_combine(seed, rKey.CharacterWidth);
+o3tl::hash_combine(seed, rKey.Weight);
+o3tl::hash_combine(seed, rKey.Slant);
+o3tl::hash_combine(seed, rKey.Underline);
+o3tl::hash_combine(seed, rKey.Strikeout);
+o3tl::hash_combine(seed, rKey.Orientation);
+o3tl::hash_combine(seed, rKey.Kerning);
+o3tl::hash_combine(seed, rKey.WordLineMode);
+o3tl::hash_combine(seed, rKey.Type);
+return seed;
+}
+};
+
+typedef std::unordered_map FontClassificationMap;
+
 /** Helper class to provide access to global workbook data.
 
 All classes derived from this helper class will have access to a singleton
@@ -235,6 +281,8 @@ public:
 PivotCacheBuffer&   getPivotCaches() const;
 /** Returns the collection of pivot tables. */
 PivotTableBuffer&   getPivotTables() const;
+/** Shared cache of Font Classifications to avoid repeated lookups */
+FontClassificationMap& getFontClassificationCache() const;
 
 // converters -
 
diff --git a/sc/source/filter/oox/stylesbuffer.cxx 
b/sc/source/filter/oox/stylesbuffer.cxx
index 25f273b1e1f2..e38b5cd13002 100644
--- a/sc/source/filter/oox/stylesbuffer.cxx
+++ b/sc/source/filter/oox/stylesbuffer.cxx
@@ -793,44 +793,65 @@ void Font::finalizeImport()
 if( !maUsedFlags.mbNameUsed )
 return;
 
-PropertySet aDocProps( getDocument() );
-Reference< XDevice > xDevice( aDocProps.getAnyProperty( 
PROP_ReferenceDevice ), UNO_QUERY );
-if( !xDevice.is() )
-return;
-
-Reference< XFont2 > xFont( xDevice->getFont( maApiData.maDesc ), UNO_QUERY 
);
-if( !xFont.is() )
-return;
-
-// #91658# CJK fonts
-bool bHasAsian =
-xFont->hasGlyphs( OUString( u'\x3041' ) ) ||// 3040-309F: Hiragana
-xFont->hasGlyphs( OUString( u'\x30A1' ) ) ||// 30A0-30FF: Katakana
-xFont->hasGlyphs( OUString( u'\x3111' ) ) ||// 3100-312F: Bopomofo
-xFont->hasGlyphs( OUString( u'\x3131' ) ) ||// 3130-318F: Hangul 
Compatibility Jamo
-xFont->hasGlyphs( OUString( u'\x3301' ) ) ||// 3300-33FF: CJK 
Compatibility
-xFont->hasGlyphs( OUString( u'\x3401' ) ) ||// 3400-4DBF: CJK 
Unified Ideographs Extension A
-xFont->hasGlyphs( OUString( u'\x4E01' ) ) ||// 4E00-9FFF: CJK 
Unified Ideographs
-xFont->hasGlyphs( OUString( u'\x7E01' ) ) ||// 4E00-9FFF: CJK 
Unified Ideographs
-xFont->hasGlyphs( OUString( u'\xA001' ) ) ||// A001-A48F: Yi 
Syllables
-xFont->hasGlyphs( OUString( u'\xAC01' ) ) ||// AC00-D7AF: Hangul 
Syllables
-xFont->hasGlyphs( OUString( u'\xCC01' ) ) ||

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

2023-08-11 Thread Caolán McNamara (via logerrit)
 svgio/source/svgreader/svgcharacternode.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 4db0a2c1c3b0a9c9868574b5c538bfd92adfb48a
Author: Caolán McNamara 
AuthorDate: Fri Aug 11 11:02:29 2023 +0100
Commit: Caolán McNamara 
CommitDate: Fri Aug 11 18:11:31 2023 +0200

cid#1539807 Uninitialized pointer field

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

diff --git a/svgio/source/svgreader/svgcharacternode.cxx 
b/svgio/source/svgreader/svgcharacternode.cxx
index 6150fbb62953..2b88944aa8d0 100644
--- a/svgio/source/svgreader/svgcharacternode.cxx
+++ b/svgio/source/svgreader/svgcharacternode.cxx
@@ -78,7 +78,8 @@ namespace svgio::svgreader
 SvgNode* pParent,
 OUString aText)
 :   SvgNode(SVGToken::Character, rDocument, pParent),
-maText(std::move(aText))
+maText(std::move(aText)),
+mpTextParent(nullptr)
 {
 }
 


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

2023-08-11 Thread Caolán McNamara (via logerrit)
 sc/source/ui/undo/undoblk.cxx |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit fa3cfa7ac8b9000aec943e13dc75f8d3828685b4
Author: Caolán McNamara 
AuthorDate: Fri Aug 11 11:00:49 2023 +0100
Commit: Caolán McNamara 
CommitDate: Fri Aug 11 18:11:15 2023 +0200

cid#1539806 Dereference after null check

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

diff --git a/sc/source/ui/undo/undoblk.cxx b/sc/source/ui/undo/undoblk.cxx
index 0ef3e22f66b1..d352ba143ba8 100644
--- a/sc/source/ui/undo/undoblk.cxx
+++ b/sc/source/ui/undo/undoblk.cxx
@@ -1148,8 +1148,10 @@ void ScUndoPaste::DoChange(bool bUndo)
 pDocShell->PostPaint(aDrawRanges, nPaint, nExtFlags);
 
 pDocShell->PostDataChanged();
-if (pViewShell)
-pViewShell->CellContentChanged();
+if (!pViewShell)
+return;
+
+pViewShell->CellContentChanged();
 
 if (bColsAffected || bRowsAffected)
 ScTabViewShell::notifyAllViewsSheetGeomInvalidation(


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

2023-08-11 Thread Noel Grandin (via logerrit)
 svl/source/notify/SfxBroadcaster.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit ab4de498475930ba829a23262f82e32df36f1ea2
Author: Noel Grandin 
AuthorDate: Fri Aug 11 14:23:34 2023 +0200
Commit: Noel Grandin 
CommitDate: Fri Aug 11 17:42:53 2023 +0200

fix SfxBroadcaster::ForAllListeners

regression from
commit 7c66fc45239d2589e90fd694d54b3ff826b1bd15
Author: Noel Grandin 
Date:   Thu Jun 1 14:22:57 2023 +0200
use internal iterator for SfxBroadcaster

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

diff --git a/svl/source/notify/SfxBroadcaster.cxx 
b/svl/source/notify/SfxBroadcaster.cxx
index e9b0e1e1a552..419c535f56dc 100644
--- a/svl/source/notify/SfxBroadcaster.cxx
+++ b/svl/source/notify/SfxBroadcaster.cxx
@@ -137,7 +137,8 @@ void 
SfxBroadcaster::ForAllListeners(std::function f) const
 {
 SfxListener* const pListener = m_Listeners[i];
 if (pListener)
-f(pListener);
+if (f(pListener))
+break;
 }
 }
 


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

2023-08-11 Thread Henry Castro (via logerrit)
 sc/source/ui/view/tabview4.cxx |8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit eee7a3c165aaa60e70d0bab9ab29fab71078abbe
Author: Henry Castro 
AuthorDate: Fri Aug 11 09:11:09 2023 -0400
Commit: Henry Castro 
CommitDate: Fri Aug 11 16:21:54 2023 +0200

tdf#155799: sc: fix input formula reference

If the start point reference mark is selected
with mouse direction up, it should extend to show
the correct input formula reference.

Signed-off-by: Henry Castro 
Change-Id: I41f2ea52bf7de341eccadfba80e91fd76a6fd2de
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155618
Reviewed-by: Tomaž Vajngerl 
Tested-by: Jenkins CollaboraOffice 

diff --git a/sc/source/ui/view/tabview4.cxx b/sc/source/ui/view/tabview4.cxx
index 442ef9a79654..a7de6bdf67d2 100644
--- a/sc/source/ui/view/tabview4.cxx
+++ b/sc/source/ui/view/tabview4.cxx
@@ -229,9 +229,13 @@ void ScTabView::UpdateRef( SCCOL nCurX, SCROW nCurY, SCTAB 
nCurZ )
 ScRefType eType = aViewData.GetRefType();
 if ( eType == SC_REFTYPE_REF )
 {
+if ((nStartX > nEndX || nStartY > nEndY) &&
+rDoc.HasAttrib(nStartX, nStartY, nTab, HasAttrFlags::Merged))
+rDoc.ExtendMerge( nStartX, nStartY, nStartX, nStartY, nTab );
+
 ScRange aRef(
-aViewData.GetRefStartX(), aViewData.GetRefStartY(), 
aViewData.GetRefStartZ(),
-aViewData.GetRefEndX(), aViewData.GetRefEndY(), 
aViewData.GetRefEndZ() );
+nStartX, nStartY, aViewData.GetRefStartZ(),
+nEndX, nEndY, aViewData.GetRefEndZ() );
 SC_MOD()->SetReference( aRef, rDoc, &rMark );
 ShowRefTip();
 }


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

2023-08-11 Thread Henry Castro (via logerrit)
 sc/source/ui/view/tabview2.cxx |   97 +
 1 file changed, 52 insertions(+), 45 deletions(-)

New commits:
commit 9b15ae4336203ed67f5ef735396873ce940b4eef
Author: Henry Castro 
AuthorDate: Mon Jul 17 09:41:55 2023 -0400
Commit: Aron Budea 
CommitDate: Fri Aug 11 16:14:00 2023 +0200

tdf#155799: sc: abstraction "moveRefByCell"

...

Change-Id: Ib00e3cddcd4a5dc4ef3d74d3939cdf278f2cb44d
Signed-off-by: Henry Castro 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154998
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tomaž Vajngerl 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155565
Tested-by: Aron Budea 
Reviewed-by: Aron Budea 

diff --git a/sc/source/ui/view/tabview2.cxx b/sc/source/ui/view/tabview2.cxx
index 6e5ee8527d54..d9fa2cb3f3d5 100644
--- a/sc/source/ui/view/tabview2.cxx
+++ b/sc/source/ui/view/tabview2.cxx
@@ -193,6 +193,57 @@ bool checkBoundary(const ScDocument* pDoc, SCCOL& rCol, 
SCROW& rRow)
 return bGood;
 }
 
+void moveRefByCell(SCCOL& rNewX, SCROW& rNewY,
+   SCCOL nMovX, SCROW nMovY, SCTAB nRefTab,
+   const ScDocument& rDoc)
+{
+bool bSelectLocked = true;
+bool bSelectUnlocked = true;
+const ScTableProtection* pTabProtection = rDoc.GetTabProtection(nRefTab);
+if (pTabProtection && pTabProtection->isProtected())
+{
+bSelectLocked   = 
pTabProtection->isOptionEnabled(ScTableProtection::SELECT_LOCKED_CELLS);
+bSelectUnlocked = 
pTabProtection->isOptionEnabled(ScTableProtection::SELECT_UNLOCKED_CELLS);
+}
+
+moveCursorByProtRule(rNewX, rNewY, nMovX, nMovY, nRefTab, &rDoc);
+checkBoundary(&rDoc, rNewX, rNewY);
+
+if (nMovX)
+{
+SCCOL nTempX = rNewX;
+while (rDoc.IsHorOverlapped(nTempX, rNewY, nRefTab))
+{
+if (nMovX > 0)
+++nTempX;
+else
+--nTempX;
+if (!checkBoundary(&rDoc, nTempX, rNewY))
+break;
+}
+if (isCellQualified(&rDoc, nTempX, rNewY, nRefTab, bSelectLocked, 
bSelectUnlocked))
+rNewX = nTempX;
+}
+
+if (nMovY)
+{
+SCROW nTempY = rNewY;
+while (rDoc.IsVerOverlapped(rNewX, nTempY, nRefTab))
+{
+if (nMovY > 0)
+++nTempY;
+else
+--nTempY;
+if (!checkBoundary(&rDoc, rNewX, nTempY))
+break;
+}
+if (isCellQualified(&rDoc, rNewX, nTempY, nRefTab, bSelectLocked, 
bSelectUnlocked))
+rNewY = nTempY;
+}
+
+rDoc.SkipOverlapped(rNewX, rNewY, nRefTab);
+}
+
 void moveCursorByMergedCell(SCCOL& rCol, SCROW& rRow, SCCOL nMovX, SCROW 
nMovY, SCCOL nStartX,
 SCROW nStartY, SCTAB nTab, const ScDocument* pDoc)
 {
@@ -952,51 +1003,7 @@ void ScTabView::ExpandBlock(SCCOL nMovX, SCROW nMovY, 
ScFollowMode eMode)
 SCROW nNewY = aViewData.GetRefEndY();
 SCTAB nRefTab = aViewData.GetRefEndZ();
 
-bool bSelectLocked = true;
-bool bSelectUnlocked = true;
-const ScTableProtection* pTabProtection = 
rDoc.GetTabProtection(nRefTab);
-if (pTabProtection && pTabProtection->isProtected())
-{
-bSelectLocked   = 
pTabProtection->isOptionEnabled(ScTableProtection::SELECT_LOCKED_CELLS);
-bSelectUnlocked = 
pTabProtection->isOptionEnabled(ScTableProtection::SELECT_UNLOCKED_CELLS);
-}
-
-moveCursorByProtRule(nNewX, nNewY, nMovX, nMovY, nRefTab, &rDoc);
-checkBoundary(&rDoc, nNewX, nNewY);
-
-if (nMovX)
-{
-SCCOL nTempX = nNewX;
-while (rDoc.IsHorOverlapped(nTempX, nNewY, nRefTab))
-{
-if (nMovX > 0)
-++nTempX;
-else
---nTempX;
-if (!checkBoundary(&rDoc, nTempX, nNewY))
-break;
-}
-if (isCellQualified(&rDoc, nTempX, nNewY, nRefTab, bSelectLocked, 
bSelectUnlocked))
-nNewX = nTempX;
-}
-
-if (nMovY)
-{
-SCROW nTempY = nNewY;
-while (rDoc.IsVerOverlapped(nNewX, nTempY, nRefTab))
-{
-if (nMovY > 0)
-++nTempY;
-else
---nTempY;
-if (!checkBoundary(&rDoc, nNewX, nTempY))
-break;
-}
-if (isCellQualified(&rDoc, nNewX, nTempY, nRefTab, bSelectLocked, 
bSelectUnlocked))
-nNewY = nTempY;
-}
-
-rDoc.SkipOverlapped(nNewX, nNewY, nRefTab);
+moveRefByCell(nNewX, nNewY, nMovX, nMovY, nRefTab, rDoc);
 UpdateRef(nNewX, nNewY, nRefTab);
 SCCOL nTargetCol = nNewX;
 SCROW nTargetRow = nNewY;


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

2023-08-11 Thread Marco Cecchetti (via logerrit)
 desktop/source/lib/init.cxx |1 
 sfx2/source/view/viewsh.cxx |  558 +---
 2 files changed, 374 insertions(+), 185 deletions(-)

New commits:
commit 5964796de82a4050081d25ab20151020de0a16cc
Author: Marco Cecchetti 
AuthorDate: Mon May 22 16:32:50 2023 +0200
Commit: Miklos Vajna 
CommitDate: Fri Aug 11 16:13:36 2023 +0200

lok: a11y: paragraph notifyied on text change, even coming from another view

Debug code has been re-organized.
Paragraph content is notifyied on any text change.
That fixed issues related to fast typing.
Paragraph content is also notified on text changed performed in
another view.
A paragraph is regarded as focused whenever the cursor position is
valid.

(cherry picked from commit cd726ba43c22e723b243dd6dfd5e3c253e81000b)

Conflicts:
sfx2/source/view/viewsh.cxx

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

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 932810fd4758..42d838b889b6 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -7023,7 +7023,6 @@ static void doc_setViewTimezone(SAL_UNUSED_PARAMETER 
LibreOfficeKitDocument* /*p
 static void doc_setAccessibilityState(SAL_UNUSED_PARAMETER 
LibreOfficeKitDocument* pThis, int nId, bool nEnabled)
 {
 SolarMutexGuard aGuard;
-SetLastExceptionMsg();
 
 int nDocType = getDocumentType(pThis);
 if (nDocType != LOK_DOCTYPE_TEXT)
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index cef69764bb14..0d61e2f3f005 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -54,6 +54,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -237,6 +238,246 @@ void SAL_CALL 
SfxClipboardChangeListener::changedContents( const datatransfer::c
 delete pInfo;
 }
 
+namespace
+{
+
+bool hasState(const accessibility::AccessibleEventObject& aEvent, ::sal_Int64 
nState)
+{
+bool res = false;
+uno::Reference< accessibility::XAccessibleContext > 
xContext(aEvent.Source, uno::UNO_QUERY);
+if (xContext.is())
+{
+::sal_Int64 nStateSet = xContext->getAccessibleStateSet();
+res = (nStateSet & nState) != 0;
+}
+return res;
+}
+
+bool isFocused(const accessibility::AccessibleEventObject& aEvent)
+{
+return hasState(aEvent, accessibility::AccessibleStateType::FOCUSED);
+}
+
+std::string stateSetToString(::sal_Int64 stateSet)
+{
+static const std::string states[34] = {
+"ACTIVE", "ARMED", "BUSY", "CHECKED", "DEFUNC",
+"EDITABLE", "ENABLED", "EXPANDABLE", "EXPANDED", "FOCUSABLE",
+"FOCUSED", "HORIZONTAL", "ICONIFIED", "INDETERMINATE", 
"MANAGES_DESCENDANTS",
+"MODAL", "MULTI_LINE", "MULTI_SELECTABLE", "OPAQUE", "PRESSED",
+"RESIZABLE", "SELECTABLE", "SELECTED", "SENSITIVE", "SHOWING",
+"SINGLE_LINE", "STALE", "TRANSIENT", "VERTICAL", "VISIBLE",
+"MOVEABLE", "DEFAULT", "OFFSCREEN", "COLLAPSE"
+};
+
+if (stateSet == 0)
+return "INVALID";
+::sal_Int64 state = 1;
+std::string s;
+for (int i = 0; i < 34; ++i)
+{
+if (stateSet & state)
+{
+s += states[i];
+s += "|";
+}
+state <<= 1;
+}
+return s;
+}
+
+void aboutView(std::string msg,  const void* pInstance, const SfxViewShell* 
pViewShell)
+{
+if (!pViewShell)
+return;
+
+SAL_INFO("lok.a11y", ">>> " << msg << ": instance: " << pInstance
+<< ", VIED ID: " <<  pViewShell->GetViewShellId().get() << " <<<");
+}
+
+void aboutEvent(std::string msg, const accessibility::AccessibleEventObject& 
aEvent)
+{
+try
+{
+uno::Reference< accessibility::XAccessible > xSource(aEvent.Source, 
uno::UNO_QUERY);
+if (xSource.is())
+{
+uno::Reference< accessibility::XAccessibleContext > xContext =
+xSource->getAccessibleContext();
+
+if (xContext.is())
+{
+SAL_INFO("lok.a11y", msg << ": event id: " << aEvent.EventId
+<< "\n  xSource: " << xSource.get()
+<< "\n  role: " << xContext->getAccessibleRole()
+<< "\n  name: " << xContext->getAccessibleName()
+<< "\n  index in parent: " << 
xContext->getAccessibleIndexInParent()
+<< "\n  state set: " << 
stateSetToString(xContext->getAccessibleStateSet())
+<< "\n  parent: " << 
xContext->getAccessibleParent().get()
+<< "\n  child count: " << 
xContext->getAccessibleChildCount());
+}
+}
+uno::Reference< accessibility::XAccessible > xOldValue;
+aEvent.OldValue >>= xOldV

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

2023-08-11 Thread Henry Castro (via logerrit)
 sc/source/ui/app/inputhdl.cxx |7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit c5779b506a701ff21d2d738439a8e4976e18833c
Author: Henry Castro 
AuthorDate: Thu Aug 10 15:14:18 2023 -0400
Commit: Aron Budea 
CommitDate: Fri Aug 11 16:13:00 2023 +0200

tdf#155799: lok: sc: fix extend reference mark

In the tiled rendering case, the server sends a reference
coordinates to client side, so extend the range end point
reference if merged cells.

Signed-off-by: Henry Castro 
Change-Id: Ie9611aea3f6645a6cf45514939ae6364afac0b1c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155564
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit edbf070a6bb6aacfb277140457cf21036b5239e9)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155590
Tested-by: Aron Budea 
Reviewed-by: Aron Budea 

diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 66eb92dd2efa..30e7c4482e1c 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -484,10 +484,15 @@ ReferenceMark ScInputHandler::GetReferenceMark( const 
ScViewData& rViewData, ScD
 {
 SCCOL nCol1 = nX1, nCol2 = nX2;
 SCROW nRow1 = nY1, nRow2 = nY2;
+ScDocument& rDoc = pDocSh->GetDocument();
+
 PutInOrder(nCol1, nCol2);
 PutInOrder(nRow1, nRow2);
+
 if (nCol1 == nCol2 && nRow1 == nRow2)
-pDocSh->GetDocument().ExtendMerge(nCol1, nRow1, nCol2, nRow2, 
nTab);
+rDoc.ExtendMerge(nCol1, nRow1, nCol2, nRow2, nTab);
+else if (rDoc.HasAttrib(nCol2, nRow2, nTab, HasAttrFlags::Merged))
+rDoc.ExtendMerge(nCol2, nRow2, nCol2, nRow2, nTab);
 
 Point aTopLeft = rViewData.GetPrintTwipsPos(nCol1, nRow1);
 Point aBottomRight = rViewData.GetPrintTwipsPos(nCol2 + 1, nRow2 + 1);


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

2023-08-11 Thread Balazs Varga (via logerrit)
 sw/source/core/access/AccessibilityCheck.cxx |   14 +++---
 1 file changed, 11 insertions(+), 3 deletions(-)

New commits:
commit 2b2285f70bcc85ae26ad12b75859dae8800c6662
Author: Balazs Varga 
AuthorDate: Wed Aug 9 14:43:55 2023 +0200
Commit: Michael Stahl 
CommitDate: Fri Aug 11 16:02:06 2023 +0200

tdf#156614 - A11Y - fix not clickable warning about fake forms

Make the warning message clickable and select the text.

Change-Id: I5b503ba278980c128bbef83631dabc897bb33b14
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155519
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt 
(cherry picked from commit 61730db0931ac117971646df8f9f359df99a1cc6)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155480
Reviewed-by: Michael Stahl 

diff --git a/sw/source/core/access/AccessibilityCheck.cxx 
b/sw/source/core/access/AccessibilityCheck.cxx
index a7907c8992cd..462205fc65d6 100644
--- a/sw/source/core/access/AccessibilityCheck.cxx
+++ b/sw/source/core/access/AccessibilityCheck.cxx
@@ -1129,10 +1129,10 @@ public:
 if (!pCurrent->IsTextNode())
 return;
 
-const auto& text = pCurrent->GetTextNode()->GetText();
+SwTextNode* pTextNode = pCurrent->GetTextNode();
+const auto& text = pTextNode->GetText();
 
 // Series of tests to detect if there are fake forms in the text.
-
 bool bCheck = text.indexOf("___") == -1; // Repeated underscores.
 
 if (bCheck)
@@ -1149,7 +1149,15 @@ public:
 
 // Checking if all the tests are passed successfully. If not, adding a 
warning.
 if (!bCheck)
-lclAddIssue(m_rIssueCollection, 
SwResId(STR_NON_INTERACTIVE_FORMS));
+{
+sal_Int32 nStart = 0;
+auto pIssue = lclAddIssue(m_rIssueCollection, 
SwResId(STR_NON_INTERACTIVE_FORMS));
+pIssue->setIssueObject(IssueObject::TEXT);
+pIssue->setNode(pTextNode);
+pIssue->setDoc(pTextNode->GetDoc());
+pIssue->setStart(nStart);
+pIssue->setEnd(nStart + text.getLength());
+}
 }
 };
 


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

2023-08-11 Thread Noel Grandin (via logerrit)
 oox/source/drawingml/textparagraphproperties.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 996890180dc143df1de97072c81799ec1f1de083
Author: Noel Grandin 
AuthorDate: Fri Aug 11 12:08:14 2023 +0200
Commit: Noel Grandin 
CommitDate: Fri Aug 11 14:15:44 2023 +0200

reduce noise in debug logs

Only set this property if the object supports it

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

diff --git a/oox/source/drawingml/textparagraphproperties.cxx 
b/oox/source/drawingml/textparagraphproperties.cxx
index df3d36a21003..949ee3f22d6b 100644
--- a/oox/source/drawingml/textparagraphproperties.cxx
+++ b/oox/source/drawingml/textparagraphproperties.cxx
@@ -420,7 +420,8 @@ void TextParagraphProperties::pushToPropSet( const 
::oox::core::XmlFilterBase* p
 }
 else if ( pMasterBuList && pMasterBuList->mnNumberingType.hasValue() )
 pMasterBuList->mnNumberingType >>= nNumberingType;
-if ( nNumberingType == NumberingType::NUMBER_NONE )
+if ( nNumberingType == NumberingType::NUMBER_NONE
+&& aPropSet.hasProperty(PROP_NumberingLevel) )
 aPropSet.setProperty< sal_Int16 >( PROP_NumberingLevel, -1 );
 
 maBulletList.pushToPropMap( pFilterBase, rioBulletMap );


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

2023-08-11 Thread Xisco Fauli (via logerrit)
 sw/source/uibase/wrtsh/wrtsh1.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 48a076e071369f5eee075f74947219dabfa63ec5
Author: Xisco Fauli 
AuthorDate: Thu Aug 10 17:59:01 2023 +0200
Commit: Michael Stahl 
CommitDate: Fri Aug 11 13:30:23 2023 +0200

tdf#156270: use double for width/height

Otherwise 0.313159 is rounded to 0

Regression from
commit 99f43923b66a98b75c78a50577f19293aa480998
Author: Xisco Fauli 
Date:   Tue Apr 18 14:37:32 2023 +0200

sw: fix divide by 0

Change-Id: Ib8bf0a770834e0ff73d215c27788df7a3b98404d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155561
Reviewed-by: Caolán McNamara 
Tested-by: Xisco Fauli 
Reviewed-by: Xisco Fauli 
(cherry picked from commit 6ab45e1e2b256880d2f05b6669eb196e83682a14)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155489
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx 
b/sw/source/uibase/wrtsh/wrtsh1.cxx
index 3ef6559cae34..e00aee5c72c7 100644
--- a/sw/source/uibase/wrtsh/wrtsh1.cxx
+++ b/sw/source/uibase/wrtsh/wrtsh1.cxx
@@ -914,8 +914,8 @@ void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& 
xObj,
 }
 else
 {
-tools::Long nWidth(pCli->GetScaleWidth());
-tools::Long nHeight(pCli->GetScaleHeight());
+double nWidth(pCli->GetScaleWidth());
+double nHeight(pCli->GetScaleHeight());
 if (nWidth && nHeight)
 {
 aArea.Width ( aArea.Width()  / nWidth );


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

2023-08-11 Thread Xisco Fauli (via logerrit)
 sw/source/uibase/wrtsh/wrtsh1.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 50c3d02656ffb10fc103ad2bb52f0fcc1de93daf
Author: Xisco Fauli 
AuthorDate: Thu Aug 10 17:59:01 2023 +0200
Commit: Michael Stahl 
CommitDate: Fri Aug 11 13:30:34 2023 +0200

tdf#156270: use double for width/height

Otherwise 0.313159 is rounded to 0

Regression from
commit 99f43923b66a98b75c78a50577f19293aa480998
Author: Xisco Fauli 
Date:   Tue Apr 18 14:37:32 2023 +0200

sw: fix divide by 0

Change-Id: Ib8bf0a770834e0ff73d215c27788df7a3b98404d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155561
Reviewed-by: Caolán McNamara 
Tested-by: Xisco Fauli 
Reviewed-by: Xisco Fauli 
(cherry picked from commit 6ab45e1e2b256880d2f05b6669eb196e83682a14)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155488
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx 
b/sw/source/uibase/wrtsh/wrtsh1.cxx
index 7a39048fec5f..af96916885d5 100644
--- a/sw/source/uibase/wrtsh/wrtsh1.cxx
+++ b/sw/source/uibase/wrtsh/wrtsh1.cxx
@@ -915,8 +915,8 @@ void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& 
xObj,
 }
 else
 {
-tools::Long nWidth(pCli->GetScaleWidth());
-tools::Long nHeight(pCli->GetScaleHeight());
+double nWidth(pCli->GetScaleWidth());
+double nHeight(pCli->GetScaleHeight());
 if (nWidth && nHeight)
 {
 aArea.Width ( aArea.Width()  / nWidth );


[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - starmath/source

2023-08-11 Thread Khaled Hosny (via logerrit)
 starmath/source/ElementsDockingWindow.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit ec7065bafc0a805b03a2b4d5522026f829c25522
Author: Khaled Hosny 
AuthorDate: Thu Aug 10 10:11:22 2023 +0300
Commit: Michael Stahl 
CommitDate: Fri Aug 11 13:25:48 2023 +0200

tdf#80467: Fix math rendering in elements dock with RTL UI

Make sure to disable RTL on the OutputDevice, otherwise the math will be
rendered right-to-left without even mirroring the parenthesis.

Change-Id: Iea43dbc0d7efe914120d5cc1605522254344b4fc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155538
Tested-by: Jenkins
Reviewed-by: خالد حسني 
(cherry picked from commit f681d37d7aab768b507ea48d34a985b8dc49391a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155486
Reviewed-by: Michael Stahl 

diff --git a/starmath/source/ElementsDockingWindow.cxx 
b/starmath/source/ElementsDockingWindow.cxx
index b2186a7ecbf9..7fdfb3b3ec49 100644
--- a/starmath/source/ElementsDockingWindow.cxx
+++ b/starmath/source/ElementsDockingWindow.cxx
@@ -532,6 +532,7 @@ void SmElementsControl::addElement(const OUString& 
aElementVisual, const OUStrin
 pDevice->SetDrawMode(DrawModeFlags::Default);
 pDevice->SetLayoutMode(vcl::text::ComplexTextLayoutFlags::Default);
 pDevice->SetDigitLanguage(LANGUAGE_ENGLISH);
+pDevice->EnableRTL(false);
 
 pDevice->SetBackground(GetControlBackground());
 pDevice->SetTextColor(GetTextColor());


[Libreoffice-commits] core.git: Branch 'distro/mimo/mimo-7-3' - configure.ac

2023-08-11 Thread Aron Budea (via logerrit)
 configure.ac |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit bd0da356a644430fe1925e01eb429c9c3d1e884c
Author: Aron Budea 
AuthorDate: Fri Aug 11 12:23:45 2023 +0200
Commit: Aron Budea 
CommitDate: Fri Aug 11 12:23:45 2023 +0200

Bump version to 7.3.7.2.M6

Change-Id: I5de38f7fd7269367846887aef3decefa5c16d4e7

diff --git a/configure.ac b/configure.ac
index 52205e99ac64..78f7cc94f264 100644
--- a/configure.ac
+++ b/configure.ac
@@ -9,7 +9,7 @@ dnl in order to create a configure script.
 # several non-alphanumeric characters, those are split off and used only for 
the
 # ABOUTBOXPRODUCTVERSIONSUFFIX in openoffice.lst. Why that is necessary, no 
idea.
 
-AC_INIT([LibreOffice],[7.3.7.2.M5],[],[],[http://documentfoundation.org/])
+AC_INIT([LibreOffice],[7.3.7.2.M6],[],[],[http://documentfoundation.org/])
 
 dnl libnumbertext needs autoconf 2.68, but that can pick up autoconf268 just 
fine if it is installed
 dnl whereas aclocal (as run by autogen.sh) insists on using autoconf and fails 
hard


Re: #tdf51510: Change the DPI to get better resolution, but failed the unit test

2023-08-11 Thread Tomaž Vajngerl
Hi,

On Fri, Aug 11, 2023 at 8:06 AM Lodev  wrote:
>
> Hi,
>
>
> We're trying to fix #tdf51510: "Exporting documents with embedded SVG to
> doc or docx converts the image to low-resolution pixel graphics" since
> it bothers us and it seems more and more bugs duplicated or related to
> this one.  We changed in vcl/source/gdi/vectorgraphicdata.cxx:78
>
> -Size
> aDPI(Application::GetDefaultDevice()->LogicToPixel(Size(1, 1),
> MapMode(MapUnit::MapInch)));
> +Size
> aDPI(Application::GetDefaultDevice()->LogicToPixel(Size(50, 50),
> MapMode(MapUnit::MapInch)));
>
> To get better resolutions.  It worked.  Exported docx file with embedded
> png now gets better resolution.
>
> However this change couldn't pass unit test :
> sw/qa/extras/ooxmlexport/ooxmlexport16.cxx:762, tdf136841.docx . It
> seems to be fixed, expecting low resolution converted images.
>
> Since it didn't pass the unit test, we didn't commit the patch to
> gerrit.  So here, first we'd like to know if this solution, changing
> size(1,1) to size(50,50) is acceptable or not?

I wouldn't do it like that. The purpose of that LogicToPixel
conversion is to figure out the DPI (number of pixels/inch) of the
output device - changing that to 50 doesn't make sense considering
what that call tries to achieve (you ask what's the number of pixels
per 50inches).
The next issue is that this will result in a 50x bigger size - that's
a lot! Typically the device DPI is 96 - this makes it 50*96 = 4800,
which means a 3 x 3 inch image (not that A4 paper size is 8.3 x 11.7
inch, so 3x3 inch image is typical) will have the resolution of
14400x14400 pixels!
Note also that in ODF we store a PNG bitmap for vector images in
addition the the vector image, which serves as a fall-back. For that
we go through the same code path, so the file size would increase
significantly.

What I suggest is to not depend on the output device DPI (which causes
us a lot of trouble because the result then depends on the system and
OS) and set a constant but high enough DPI, that will be good enough
in most cases. 300DPI is usually good enough for printing so I think
that would be a good constant to use here (it's 3x bigger than typical
96DPI of an output device).

> If yes, how can we pass the unit test given that patch?

As for the test - the purpose of that test is to check that the vector
image (WMF in the document) is rendered after the import-export cycle,
by checking that the pixel in the middle of the bitmap is set to
something visible that could be part of the image. As the pixel size
of the bitmap changes, because of the increase of DPI, this test needs
to be adapted for the new size.

> Thanks for your suggestion.
>
>
> Dev

Tomaž


New Defects reported by Coverity Scan for LibreOffice

2023-08-11 Thread scan-admin
Hi,

Please find the latest report on new defect(s) introduced to LibreOffice found 
with Coverity Scan.

2 new defect(s) introduced to LibreOffice found with Coverity Scan.


New defect(s) Reported-by: Coverity Scan
Showing 2 of 2 defect(s)


** CID 1539807:  Uninitialized members  (UNINIT_CTOR)
/svgio/source/svgreader/svgcharacternode.cxx: 83 in 
svgio::svgreader::SvgCharacterNode::SvgCharacterNode(svgio::svgreader::SvgDocument
 &, svgio::svgreader::SvgNode *, rtl::OUString)()



*** CID 1539807:  Uninitialized members  (UNINIT_CTOR)
/svgio/source/svgreader/svgcharacternode.cxx: 83 in 
svgio::svgreader::SvgCharacterNode::SvgCharacterNode(svgio::svgreader::SvgDocument
 &, svgio::svgreader::SvgNode *, rtl::OUString)()
77 SvgDocument& rDocument,
78 SvgNode* pParent,
79 OUString aText)
80 :   SvgNode(SVGToken::Character, rDocument, pParent),
81 maText(std::move(aText))
82 {
>>> CID 1539807:  Uninitialized members  (UNINIT_CTOR)
>>> Non-static class member "mpTextParent" is not initialized in this 
>>> constructor nor in any functions that it calls.
83 }
84 
85 SvgCharacterNode::~SvgCharacterNode()
86 {
87 }
88 

** CID 1539806:  Null pointer dereferences  (FORWARD_NULL)



*** CID 1539806:  Null pointer dereferences  (FORWARD_NULL)
/sc/source/ui/undo/undoblk.cxx: 1155 in ScUndoPaste::DoChange(bool)()
1149 
1150 pDocShell->PostDataChanged();
1151 if (pViewShell)
1152 pViewShell->CellContentChanged();
1153 
1154 if (bColsAffected || bRowsAffected)
>>> CID 1539806:  Null pointer dereferences  (FORWARD_NULL)
>>> Passing null pointer "pViewShell" to 
>>> "notifyAllViewsSheetGeomInvalidation", which dereferences it.
1155 ScTabViewShell::notifyAllViewsSheetGeomInvalidation(
1156 pViewShell,
1157 bColsAffected, bRowsAffected,
1158 true /* bSizes*/, true /* bHidden */, true /* bFiltered */,
1159 true /* bGroups */, aDrawRanges[0].aStart.Tab());
1160 }



To view the defects in Coverity Scan visit, 
https://u15810271.ct.sendgrid.net/ls/click?upn=HRESupC-2F2Czv4BOaCWWCy7my0P0qcxCbhZ31OYv50ypSs1kiFPuCn2xFdlMIFBirii0zZ9j2-2F9F2XPBcBm2BNgi9duPy3v-2FzgFDd2LJ-2BDKI-3DHfVY_OTq2XUZbbipYjyLSo6GRo-2FpVxQ9OzkDINu9UTS-2FQhSdO0F0jQniitrGlNxDIzPJiLDLGUIpEQkM88gBNH9yTVUiq-2FYuw67tQbk-2FTvx5sCdR9clnYJTdhPS5ZSQlXObvoAo9Vj1FgT-2BtNJmoJ09swDrQsdDohorv021mRS-2F-2Bigw5PKVgb5xHewe9IghkI76rTusw5MDqLqDCq4bJk2BDpKYHxGl-2B2ulzndROsqSYn-2FGs-3D



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

2023-08-11 Thread Miklos Vajna (via logerrit)
 sw/qa/core/objectpositioning/data/floattable-tbl-overlap.docx  |binary
 sw/qa/core/objectpositioning/objectpositioning.cxx |   33 
++
 sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx |   22 
++
 3 files changed, 55 insertions(+)

New commits:
commit cffb2473b2d50ff3cf158dc3ed733156980a3764
Author: Miklos Vajna 
AuthorDate: Thu Aug 10 09:05:18 2023 +0200
Commit: Caolán McNamara 
CommitDate: Fri Aug 11 11:17:58 2023 +0200

sw floattable: handle AllowOverlap==false in the layout

The bugdoc has two floating tables, and these would normally overlap,
but SwFormatWrapInfluenceOnObjPos::mbAllowOverlap requests tweaking the
position at a layout level to avoid that overlap.

This is similar to what commit d37096f59e7e0286e55008153591a60bab92b9e8
(Related: tdf#124600 sw anchored object allow overlap: add layout,
2019-09-19) did, but that was for draw shapes and this is for split
flys.

Fix the problem by extending
SwToContentAnchoredObjectPosition::CalcOverlap(): the overlap detection
can be reused, just need to look for split flys on the entire page +
need to check split flys against other split flys.

The ODT filter works out of the box.

(cherry picked from commit 905962db870e9d1cf1dcf3bd1be44c347cddafe1)

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

diff --git a/sw/qa/core/objectpositioning/data/floattable-tbl-overlap.docx 
b/sw/qa/core/objectpositioning/data/floattable-tbl-overlap.docx
new file mode 100644
index ..b5b23931a240
Binary files /dev/null and 
b/sw/qa/core/objectpositioning/data/floattable-tbl-overlap.docx differ
diff --git a/sw/qa/core/objectpositioning/objectpositioning.cxx 
b/sw/qa/core/objectpositioning/objectpositioning.cxx
index bb3a12793ae8..4958b8b6deb4 100644
--- a/sw/qa/core/objectpositioning/objectpositioning.cxx
+++ b/sw/qa/core/objectpositioning/objectpositioning.cxx
@@ -15,6 +15,12 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
 
 /// Covers sw/source/core/objectpositioning/ fixes.
 class SwCoreObjectpositioningTest : public SwModelTestBase
@@ -280,6 +286,33 @@ CPPUNIT_TEST_FIXTURE(SwCoreObjectpositioningTest, 
testVMLVertAlignBottomMargin)
 CPPUNIT_ASSERT_EQUAL(static_cast(1), nFifthVMLShapeOutside - 
nPageBottom);
 }
 
+CPPUNIT_TEST_FIXTURE(SwCoreObjectpositioningTest, 
testFloatingTableOverlapNever)
+{
+// Given a document with two floating tables, positioned in a way that 
normally these would
+// overlap, but SwFormatWrapInfluenceOnObjPos::mbAllowOverlap == false 
explicitly asks to avoid
+// overlaps:
+createSwDoc("floattable-tbl-overlap.docx");
+
+// When laying out that document:
+calcLayout();
+
+// Then make sure no overlap happens:
+SwDoc* pDoc = getSwDoc();
+SwRootFrame* pLayout = pDoc->getIDocumentLayoutAccess().GetCurrentLayout();
+auto pPage1 = dynamic_cast(pLayout->Lower());
+CPPUNIT_ASSERT(pPage1);
+CPPUNIT_ASSERT(pPage1->GetSortedObjs());
+const SwSortedObjs& rPage1Objs = *pPage1->GetSortedObjs();
+CPPUNIT_ASSERT_EQUAL(static_cast(2), rPage1Objs.size());
+auto pFlyFrame1 = rPage1Objs[0]->DynCastFlyFrame();
+auto pFlyFrame2 = rPage1Objs[1]->DynCastFlyFrame();
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected greater than: 2291
+// - Actual  : 2175
+// i.e. the 2nd floating table overlapped with the first one.
+CPPUNIT_ASSERT_GREATER(pFlyFrame1->getFrameArea().Bottom(), 
pFlyFrame2->getFrameArea().Top());
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx 
b/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx
index 9a9abc9f4dd8..33168ceba432 100644
--- a/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx
+++ b/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx
@@ -1194,6 +1194,21 @@ void 
SwToContentAnchoredObjectPosition::CalcOverlap(const SwTextFrame* pAnchorFr
 
 // Get the list of objects.
 auto pSortedObjs = pAnchorFrameForVertPos->GetDrawObjs();
+
+bool bSplitFly = false;
+SwFlyFrame* pFlyFrame = GetAnchoredObj().DynCastFlyFrame();
+if (pFlyFrame && pFlyFrame->IsFlySplitAllowed())
+{
+// At least for split flys we need to consider objects on the same 
page, but anchored in
+// different text frames.
+bSplitFly = true;
+const SwPageFrame* pPageFrame = 
pAnchorFrameForVertPos->FindPageFrame();
+if (pPageFrame)
+{
+pSortedObjs = pPageFrame->GetSortedObjs();
+}
+}
+
 if (!pSortedObjs)
 {
   

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

2023-08-11 Thread Miklos Vajna (via logerrit)
 sw/qa/filter/ww8/ww8.cxx |   45 +++
 sw/source/filter/ww8/docxtableexport.cxx |8 +
 2 files changed, 53 insertions(+)

New commits:
commit 5af44a176d2a738dd7523713202aeee27c5578b6
Author: Miklos Vajna 
AuthorDate: Fri Aug 11 08:27:32 2023 +0200
Commit: Miklos Vajna 
CommitDate: Fri Aug 11 11:09:30 2023 +0200

sw floattable: export  to DOCX

Once split flys containing tables have "allow overlap" disabled, this is
not saved to DOCX when we map them to floating tables.

The working case is the allowOverlap attribute on shapes, added in
commit f8c7a2284b88c149addc8a30abb0cad8a10dad77 (Related: tdf#124600 sw
anchored object allow overlap: add DOCX filter, 2019-09-20).

Fix the problem by extending DocxAttributeOutput::TableDefinition(), to
write  in case overlap is not allowed, after .

DOC and RTF filters are still missing.

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

diff --git a/sw/qa/filter/ww8/ww8.cxx b/sw/qa/filter/ww8/ww8.cxx
index 68bbc28fcfc3..2d12e980dbdb 100644
--- a/sw/qa/filter/ww8/ww8.cxx
+++ b/sw/qa/filter/ww8/ww8.cxx
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 
 
 namespace
 {
@@ -410,6 +411,50 @@ CPPUNIT_TEST_FIXTURE(Test, testFloattableThenFloattable)
 // anchor.
 CPPUNIT_ASSERT_EQUAL(nFly1Anchor + 1, nFly2Anchor);
 }
+
+CPPUNIT_TEST_FIXTURE(Test, testFloattableOverlapNeverDOCXExport)
+{
+// Given a document with a floating table, overlap is not allowed:
+createSwDoc();
+SwDoc* pDoc = getSwDoc();
+SwWrtShell* pWrtShell = getSwDocShell()->GetWrtShell();
+pWrtShell->Insert2("before table");
+// Insert a table:
+SwInsertTableOptions aTableOptions(SwInsertTableFlags::DefaultBorder, 0);
+pWrtShell->InsertTable(aTableOptions, /*nRows=*/1, /*nCols=*/1);
+pWrtShell->MoveTable(GotoPrevTable, fnTableStart);
+// Select table:
+pWrtShell->SelAll();
+// Wrap the table in a text frame:
+SwFlyFrameAttrMgr aMgr(true, pWrtShell, Frmmgr_Type::TEXT, nullptr);
+pWrtShell->StartAllAction();
+aMgr.InsertFlyFrame(RndStdIds::FLY_AT_PARA, aMgr.GetPos(), aMgr.GetSize());
+pWrtShell->EndAllAction();
+// Allow the text frame to split:
+pWrtShell->StartAllAction();
+auto& rFlys = *pDoc->GetSpzFrameFormats();
+auto pFly = rFlys[0];
+SwAttrSet aSet(pFly->GetAttrSet());
+aSet.Put(SwFormatFlySplit(true));
+// Don't allow overlap:
+SwFormatWrapInfluenceOnObjPos aInfluence;
+aInfluence.SetAllowOverlap(false);
+aSet.Put(aInfluence);
+pDoc->SetAttr(aSet, *pFly);
+pWrtShell->EndAllAction();
+
+// When saving to DOCX:
+save("Office Open XML Text");
+
+// Then make sure that the overlap=never markup is written:
+xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: 1
+// - Actual  : 0
+// - XPath '//w:tblPr/w:tblOverlap' number of nodes is incorrect
+// i.e.  was not written.
+assertXPath(pXmlDoc, "//w:tblPr/w:tblOverlap", "val", "never");
+}
 }
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/filter/ww8/docxtableexport.cxx 
b/sw/source/filter/ww8/docxtableexport.cxx
index 51fb3540c9df..b3e2d014222b 100644
--- a/sw/source/filter/ww8/docxtableexport.cxx
+++ b/sw/source/filter/ww8/docxtableexport.cxx
@@ -37,6 +37,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "docxexportfilter.hxx"
 #include "docxhelper.hxx"
@@ -281,6 +282,13 @@ void DocxAttributeOutput::TableDefinition(
 bFloatingTableWritten = true;
 // The outer table was floating, make sure potential inner tables are 
not floating.
 m_rExport.SetFloatingTableFrame(nullptr);
+
+const SwFrameFormat& rFloatingTableFormat = 
pFloatingTableFrame->GetFrameFormat();
+if (!rFloatingTableFormat.GetWrapInfluenceOnObjPos().GetAllowOverlap())
+{
+// Allowing overlap is the default, both in OOXML and in Writer.
+m_pSerializer->singleElementNS(XML_w, XML_tblOverlap, FSNS(XML_w, 
XML_val), "never");
+}
 }
 
 // Extract properties from grab bag


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

2023-08-11 Thread Noel Grandin (via logerrit)
 sc/source/ui/app/inputhdl.cxx |   15 ++-
 1 file changed, 6 insertions(+), 9 deletions(-)

New commits:
commit 5484657d2b1677b7e385ab6ef87ad64dcb9934e4
Author: Noel Grandin 
AuthorDate: Thu Aug 10 17:42:12 2023 +0200
Commit: Noel Grandin 
CommitDate: Fri Aug 11 09:58:43 2023 +0200

tdf#156209 Font size increases when copying from cell in edit mode

Regression from  0558926c2f9201a12b4c46efc36b8a4080af4d46
"use more officecfg for SvtMiscOptions".

However even reverting the above commit does not fix the problem.
This is because there is an underlying latent bug, where depending on the 
order of initialisation of various and when they fire events, we can end up 
calling the alternative path in ScInputHandler::ImplCreateEditEngine which 
creates a pool via EditEngine::CreatePool(), which ends up having the "wrong" 
default map unit. And then that pool sticks around even after we have a 
document, and causes the reported bug.

Solve it by simply not initialising the pool until we have an associated 
document, which is fine, since we don't actually need the pool until then.


Change-Id: If012c82df225e59dca828556bfca84c1948b5887
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155560
Tested-by: Noel Grandin 
Reviewed-by: Noel Grandin 

diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 3351408459a9..1267509d4e5f 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -928,14 +928,10 @@ void ScInputHandler::ImplCreateEditEngine()
 if ( mpEditEngine )
 return;
 
-if ( pActiveViewSh )
-{
-ScDocument& rDoc = 
pActiveViewSh->GetViewData().GetDocShell()->GetDocument();
-mpEditEngine = std::make_unique(&rDoc, 
rDoc.GetEnginePool(), rDoc.GetEditPool());
-}
-else
-mpEditEngine = std::make_unique(nullptr, 
EditEngine::CreatePool().get(), nullptr, true);
-
+// we cannot create a properly initialised EditEngine until we have a 
document
+assert( pActiveViewSh );
+ScDocument& rDoc = 
pActiveViewSh->GetViewData().GetDocShell()->GetDocument();
+mpEditEngine = std::make_unique(&rDoc, 
rDoc.GetEnginePool(), rDoc.GetEditPool());
 mpEditEngine->SetWordDelimiters( ScEditUtil::ModifyDelimiters( 
mpEditEngine->GetWordDelimiters() ) );
 UpdateRefDevice();  // also sets MapMode
 mpEditEngine->SetPaperSize( Size( 100, 100 ) );
@@ -4197,7 +4193,8 @@ void ScInputHandler::NotifyChange( const ScInputHdlState* 
pState,
 else
 pActiveViewSh = dynamic_cast( SfxViewShell::Current() 
);
 
-ImplCreateEditEngine();
+if (pActiveViewSh)
+ImplCreateEditEngine();
 
 if ( pState != pLastState.get() )
 {


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - filter/source sd/qa

2023-08-11 Thread Szymon Kłos (via logerrit)
 filter/source/svg/svgwriter.cxx |1 -
 sd/qa/unit/SVGExportTests.cxx   |8 
 2 files changed, 4 insertions(+), 5 deletions(-)

New commits:
commit 0a549b2c9595cd076e3b503b67df93bff380885a
Author: Szymon Kłos 
AuthorDate: Fri Aug 4 10:01:26 2023 +0200
Commit: Szymon Kłos 
CommitDate: Fri Aug 11 09:45:58 2023 +0200

svg: export text decoration for text run not paragraph

Previously we exported text-decoration and other properties
for whole paragraph what was overriding run properties.
So we reused properties of the first run for all other runs
in the paragraph.

Change that so we write font properties for individual runs only.

Change-Id: Ie30f0166132b2ee302d0fdd12e7eb3ee36766a33
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155348
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx
index 97e1c74c082b..4df1352ddc10 100644
--- a/filter/source/svg/svgwriter.cxx
+++ b/filter/source/svg/svgwriter.cxx
@@ -1349,7 +1349,6 @@ void SVGTextWriter::startTextParagraph()
 mrExport.AddAttribute( XML_NAMESPACE_NONE, "class", "TextParagraph" );
 }
 maParentFont = vcl::Font();
-addFontAttributes( /* isTexTContainer: */ true );
 mpTextParagraphElem.reset(new SvXMLElementExport( mrExport, 
XML_NAMESPACE_NONE, aXMLElemTspan, mbIWS, mbIWS ));
 
 if( !mbIsListLevelStyleImage )
diff --git a/sd/qa/unit/SVGExportTests.cxx b/sd/qa/unit/SVGExportTests.cxx
index a8d64e828a67..573c7e2405cc 100644
--- a/sd/qa/unit/SVGExportTests.cxx
+++ b/sd/qa/unit/SVGExportTests.cxx
@@ -89,12 +89,12 @@ public:
 assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_G[2]/SVG_G/SVG_G/SVG_G 
), "class", "Slide");
 assertXPath(svgDoc, SAL_STRINGIFY( 
/SVG_SVG/SVG_G[2]/SVG_G/SVG_G/SVG_G/SVG_G/SVG_G[1] ), "class", "TitleText");
 assertXPath(svgDoc, SAL_STRINGIFY( 
/SVG_SVG/SVG_G[2]/SVG_G/SVG_G/SVG_G/SVG_G/SVG_G[1]/SVG_G/SVG_TEXT ), "class", 
"SVGTextShape");
-assertXPath(svgDoc, SAL_STRINGIFY( 
/SVG_SVG/SVG_G[2]/SVG_G/SVG_G/SVG_G/SVG_G/SVG_G[1]/SVG_G/SVG_TEXT/SVG_TSPAN ), 
"class", "TextParagraph");
-assertXPath(svgDoc, SAL_STRINGIFY( 
/SVG_SVG/SVG_G[2]/SVG_G/SVG_G/SVG_G/SVG_G/SVG_G[1]/SVG_G/SVG_TEXT/SVG_TSPAN ), 
"text-decoration", "underline");
+assertXPath(svgDoc, SAL_STRINGIFY( 
/SVG_SVG/SVG_G[2]/SVG_G/SVG_G/SVG_G/SVG_G/SVG_G[1]/SVG_G/SVG_TEXT/SVG_TSPAN/SVG_TSPAN
 ), "class", "TextPosition");
+assertXPath(svgDoc, SAL_STRINGIFY( 
/SVG_SVG/SVG_G[2]/SVG_G/SVG_G/SVG_G/SVG_G/SVG_G[1]/SVG_G/SVG_TEXT/SVG_TSPAN/SVG_TSPAN/SVG_TSPAN[1]
 ), "text-decoration", "underline");
 
 assertXPath(svgDoc, SAL_STRINGIFY( 
/SVG_SVG/SVG_G[2]/SVG_G/SVG_G/SVG_G/SVG_G/SVG_G[2]/SVG_G/SVG_TEXT ), "class", 
"SVGTextShape");
-assertXPath(svgDoc, SAL_STRINGIFY( 
/SVG_SVG/SVG_G[2]/SVG_G/SVG_G/SVG_G/SVG_G/SVG_G[2]/SVG_G/SVG_TEXT/SVG_TSPAN ), 
"class", "TextParagraph");
-assertXPath(svgDoc, SAL_STRINGIFY( 
/SVG_SVG/SVG_G[2]/SVG_G/SVG_G/SVG_G/SVG_G/SVG_G[2]/SVG_G/SVG_TEXT/SVG_TSPAN ), 
"text-decoration", "line-through");
+assertXPath(svgDoc, SAL_STRINGIFY( 
/SVG_SVG/SVG_G[2]/SVG_G/SVG_G/SVG_G/SVG_G/SVG_G[2]/SVG_G/SVG_TEXT/SVG_TSPAN/SVG_TSPAN
 ), "class", "TextPosition");
+assertXPath(svgDoc, SAL_STRINGIFY( 
/SVG_SVG/SVG_G[2]/SVG_G/SVG_G/SVG_G/SVG_G/SVG_G[2]/SVG_G/SVG_TEXT/SVG_TSPAN/SVG_TSPAN/SVG_TSPAN
 ), "text-decoration", "line-through");
 }
 
 void testSVGExportJavascriptURL()


Bugs report

2023-08-11 Thread Davide Piva

Hello László, thank you for your reply.

I still had discover and currently use a workaround to exit the table, 
as for other issues in the application.


I follow your suggestion to list bugs/regression, please find enclosed a 
summary table. Maybe I recall or discover something else: should it be, 
I'll create a new table :-)


Thanks a lot for your help.


--

___
Davide Piva


--
Questa email è stata esaminata alla ricerca di virus dal software antivirus 
Avast.
www.avast.com

Bugs list 11-08-2023.odt
Description: application/vnd.oasis.opendocument.text


Re: Missing Patch Inside LibreOffice Core Master Branch

2023-08-11 Thread Miklos Vajna
Hi Andreas,

On Thu, Aug 10, 2023 at 09:05:06PM +0200, Andreas Mantke  wrote:
> I looked on the LibreOffice Gerrit and found out that a patch of the
> LibreOffice kit has not been committed to the LibreOffice master branch:
> https://gerrit.libreoffice.org/c/core/+/155282
> 
> I think it would only a lapse that it didn't make it only in branch but
> not into the master.

I think this was already explained in the past, some commits are not yet
ready for master and first bake in feature/ or distro/ branches.

With that aside, this particular change is now pending CI against master
at .

Regards,

Miklos


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

2023-08-11 Thread Miklos Vajna (via logerrit)
 sw/source/core/inc/tabfrm.hxx|1 -
 sw/source/core/layout/tabfrm.cxx |7 ++-
 sw/source/core/text/xmldump.cxx  |   10 --
 3 files changed, 6 insertions(+), 12 deletions(-)

New commits:
commit af4341a0262352efecd772a7390fb2cff544564b
Author: Miklos Vajna 
AuthorDate: Fri Aug 11 08:05:11 2023 +0200
Commit: Miklos Vajna 
CommitDate: Fri Aug 11 09:16:16 2023 +0200

sw: fold SwTabFrame::dumpAsXmlAttributes() into dumpAsXml()

One dumpAsXml() per SwFrame subclass is enough, no need to have a
separate function that dumps just the attributes.

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

diff --git a/sw/source/core/inc/tabfrm.hxx b/sw/source/core/inc/tabfrm.hxx
index 8fa64bc72bad..28b48e7ec0c9 100644
--- a/sw/source/core/inc/tabfrm.hxx
+++ b/sw/source/core/inc/tabfrm.hxx
@@ -238,7 +238,6 @@ public:
 
 sal_uInt16 GetBottomLineSize() const;
 
-virtual void dumpAsXmlAttributes(xmlTextWriterPtr writer) const override;
 void dumpAsXml(xmlTextWriterPtr writer = nullptr) const override;
 };
 
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index 8b8242cfe83d..ea2b963f76f9 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -6063,7 +6063,12 @@ bool SwTabFrame::IsCollapsingBorders() const
 void SwTabFrame::dumpAsXml(xmlTextWriterPtr writer) const
 {
 (void)xmlTextWriterStartElement(writer, reinterpret_cast("tab"));
-dumpAsXmlAttributes(writer);
+SwFrame::dumpAsXmlAttributes( writer );
+if ( HasFollow() )
+(void)xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "follow" ), 
"%" SAL_PRIuUINT32, GetFollow()->GetFrameId() );
+
+if (m_pPrecede != nullptr)
+(void)xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "precede" 
), "%" SAL_PRIuUINT32, static_cast( m_pPrecede )->GetFrameId() );
 
 (void)xmlTextWriterStartElement(writer, BAD_CAST("infos"));
 dumpInfosAsXml(writer);
diff --git a/sw/source/core/text/xmldump.cxx b/sw/source/core/text/xmldump.cxx
index 402727606fde..29cbd4c5e911 100644
--- a/sw/source/core/text/xmldump.cxx
+++ b/sw/source/core/text/xmldump.cxx
@@ -322,14 +322,4 @@ void SwSectionFrame::dumpAsXmlAttributes( xmlTextWriterPtr 
writer ) const
 (void)xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "precede" 
), "%" SAL_PRIuUINT32, static_cast( m_pPrecede )->GetFrameId() 
);
 }
 
-void SwTabFrame::dumpAsXmlAttributes( xmlTextWriterPtr writer ) const
-{
-SwFrame::dumpAsXmlAttributes( writer );
-if ( HasFollow() )
-(void)xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "follow" ), 
"%" SAL_PRIuUINT32, GetFollow()->GetFrameId() );
-
-if (m_pPrecede != nullptr)
-(void)xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "precede" 
), "%" SAL_PRIuUINT32, static_cast( m_pPrecede )->GetFrameId() );
-}
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/inc sc/qa sc/source

2023-08-11 Thread Tomaž Vajngerl (via logerrit)
 sc/inc/patattr.hxx |   50 +---
 sc/qa/unit/helper/qahelper.cxx |   26 
 sc/qa/unit/subsequent_export_test2.cxx |4 -
 sc/qa/unit/ucalc.cxx   |2 
 sc/qa/unit/uicalc/uicalc.cxx   |   26 
 sc/source/core/data/column2.cxx|6 -
 sc/source/core/data/global.cxx |2 
 sc/source/core/data/patattr.cxx|  103 +++--
 sc/source/core/tool/editutil.cxx   |2 
 sc/source/core/tool/interpr1.cxx   |4 -
 sc/source/filter/excel/xecontent.cxx   |8 +-
 sc/source/filter/excel/xehelper.cxx|   23 ---
 sc/source/filter/excel/xestyle.cxx |   16 ++---
 sc/source/filter/excel/xlstyle.cxx |   18 ++---
 sc/source/filter/inc/xestyle.hxx   |   18 ++---
 sc/source/filter/inc/xlstyle.hxx   |8 +-
 sc/source/ui/cctrl/dpcontrol.cxx   |5 -
 sc/source/ui/docshell/docsh3.cxx   |4 -
 sc/source/ui/vba/vbarange.cxx  |4 -
 sc/source/ui/view/cellsh1.cxx  |8 +-
 sc/source/ui/view/gridwin4.cxx |6 -
 sc/source/ui/view/output2.cxx  |   12 +--
 sc/source/ui/view/printfun.cxx |8 +-
 23 files changed, 214 insertions(+), 149 deletions(-)

New commits:
commit 01938c0447e395f15fb370f6f5b231fee424aa1c
Author: Tomaž Vajngerl 
AuthorDate: Tue May 16 22:10:10 2023 +0900
Commit: Miklos Vajna 
CommitDate: Fri Aug 11 09:13:48 2023 +0200

sc: factor out color from setting vcl::Font from a ItemSet

vcl::Font color parameter is deprecated so we need to handle the
color separately from font data. This refactors GetFont into 2
separate functions - fillFontOnly and fillColor, where fillFont
now does the same as previously GetFont function did.
All GetFont calls have been changed depending on if we need only
the font data or also color - where the color is now treated in
a different call. There are a couple of calls where fillFont was
used, because to change that needs a more complex refactoring.

Change-Id: I0a2ce50a0cb28d196fcff87e1e80099a2bb60a9e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151858
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 3537cef02c25c2c2459d7900eed13eeec533b7ae)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155549
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/sc/inc/patattr.hxx b/sc/inc/patattr.hxx
index d78509ca74e3..842a28632ad9 100644
--- a/sc/inc/patattr.hxx
+++ b/sc/inc/patattr.hxx
@@ -93,23 +93,55 @@ public:
 SvxCellOrientation  GetCellOrientation( const SfxItemSet* pCondSet = 
nullptr ) const;
 
 /** Static helper function to fill a font object from the passed item set. 
*/
-static void GetFont( vcl::Font& rFont, const SfxItemSet& 
rItemSet,
+static void fillFontOnly(vcl::Font& rFont, const SfxItemSet& rItemSet,
+const OutputDevice* pOutDev = nullptr,
+const Fraction* pScale = nullptr,
+const SfxItemSet* pCondSet = nullptr,
+SvtScriptType nScript = 
SvtScriptType::NONE);
+
+static void fillFont( vcl::Font& rFont, const SfxItemSet& rItemSet,
 ScAutoFontColorMode eAutoMode,
 const OutputDevice* pOutDev = nullptr,
 const Fraction* pScale = nullptr,
 const SfxItemSet* pCondSet = nullptr,
 SvtScriptType nScript = 
SvtScriptType::NONE, const Color* pBackConfigColor = nullptr,
-const Color* pTextConfigColor = 
nullptr );
+const Color* pTextConfigColor = 
nullptr);
+
+static void fillColor(Color& rColor, const SfxItemSet& rItemSet, 
ScAutoFontColorMode eAutoMode, const SfxItemSet* pCondSet = nullptr,
+const Color* pBackConfigColor = nullptr, const 
Color* pTextConfigColor = nullptr);
+
 
 static ScDxfFontGetDxfFont(const SfxItemSet& rSet, SvtScriptType 
nScript);
+
+void fillColor(Color& rColor,
+ScAutoFontColorMode eAutoMode,
+const SfxItemSet* pCondSet = nullptr,
+const Color* pBackConfigColor = nullptr,
+const Color* pTextConfigColor = nullptr) const
+{
+fillColor(rColor, GetItemSet(), eAutoMode, pCondSet, pBackConfigColor, 
pTextConfigColor);
+}
+
+void fillFontOnly(vcl::Font& rFont,
+const OutputDevice* pOutDev = nullptr,
+const Fraction* pScale = nullptr,
+const SfxItemSet* pCondSet = nullptr,
+SvtScriptType nScript = SvtScriptType::NONE) c

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - include/oox oox/source sc/source

2023-08-11 Thread Tomaž Vajngerl (via logerrit)
 include/oox/drawingml/color.hxx   |   10 +++-
 oox/source/drawingml/color.cxx|   77 ++
 sc/source/filter/inc/stylesbuffer.hxx |3 +
 sc/source/filter/oox/stylesbuffer.cxx |   17 +--
 sc/source/ui/unoobj/styleuno.cxx  |1 
 5 files changed, 102 insertions(+), 6 deletions(-)

New commits:
commit 1f2e110bfcd41707f2b0dbf6a296eb5cf79efe95
Author: Tomaž Vajngerl 
AuthorDate: Fri May 12 23:21:22 2023 +0900
Commit: Miklos Vajna 
CommitDate: Fri Aug 11 09:12:12 2023 +0200

sc: OOXML import of theme colors for char and background colors

Change-Id: I8209238927bb425e8e306352f1fa78d63378f005
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151707
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit ea1cd4993be992b89930db4811d08a4a51b1f68d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155544
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/include/oox/drawingml/color.hxx b/include/oox/drawingml/color.hxx
index 245e655d7c78..ea02ef8a03e4 100644
--- a/include/oox/drawingml/color.hxx
+++ b/include/oox/drawingml/color.hxx
@@ -37,6 +37,7 @@ namespace oox { class GraphicHelper; }
 namespace oox::drawingml
 {
 
+model::ThemeColorType schemeTokenToThemeColorType(sal_uInt32 nToken);
 model::ThemeColorType schemeNameToThemeColorType(OUString const& rSchemeName);
 
 class OOX_DLLPUBLIC Color
@@ -107,6 +108,13 @@ public:
 sal_Int16   getLumMod() const;
 sal_Int16   getLumOff() const;
 
+model::ThemeColorType getThemeColorType() const
+{
+return meThemeColorType;
+}
+
+model::ComplexColor createComplexColor(const GraphicHelper& 
rGraphicHelper, sal_Int16 nPhClrTheme) const;
+
 /** Returns the unaltered list of transformations for interoperability 
purposes */
 const css::uno::Sequence< css::beans::PropertyValue >& 
getTransformations() const { return maInteropTransformations;}
 
@@ -160,8 +168,8 @@ private:
 mutable sal_Int32   mnC2;   /// Green, green%, saturation, or 
system default RGB.
 mutable sal_Int32   mnC3;   /// Blue, blue%, or luminance.
 sal_Int32   mnAlpha;/// Alpha value (color opacity).
-
 OUStringmsSchemeName;   /// Scheme name from the a:schemeClr 
element for interoperability purposes
+model::ThemeColorType meThemeColorType;
 css::uno::Sequence< css::beans::PropertyValue >
 maInteropTransformations;   /// Unaltered list of 
transformations for interoperability purposes
 };
diff --git a/oox/source/drawingml/color.cxx b/oox/source/drawingml/color.cxx
index e9c645b99b7c..fca70e2018ab 100644
--- a/oox/source/drawingml/color.cxx
+++ b/oox/source/drawingml/color.cxx
@@ -250,6 +250,44 @@ model::ThemeColorType schemeNameToThemeColorType(OUString 
const& rSchemeName)
 return aIterator->second;
 }
 
+model::ThemeColorType schemeTokenToThemeColorType(sal_uInt32 nToken)
+{
+static std::unordered_map const 
constThemeColorTokenMap {
+{ XML_dk1, model::ThemeColorType::Dark1 },
+{ XML_lt1, model::ThemeColorType::Light1 },
+{ XML_dk2, model::ThemeColorType::Dark2 },
+{ XML_lt2, model::ThemeColorType::Light2 },
+{ XML_accent1, model::ThemeColorType::Accent1 },
+{ XML_accent2, model::ThemeColorType::Accent2 },
+{ XML_accent3, model::ThemeColorType::Accent3 },
+{ XML_accent4, model::ThemeColorType::Accent4 },
+{ XML_accent5, model::ThemeColorType::Accent5 },
+{ XML_accent6, model::ThemeColorType::Accent6 },
+{ XML_hlink, model::ThemeColorType::Hyperlink },
+{ XML_folHlink, model::ThemeColorType::FollowedHyperlink },
+{ XML_tx1, model::ThemeColorType::Dark1 },
+{ XML_bg1, model::ThemeColorType::Light1 },
+{ XML_tx2, model::ThemeColorType::Dark2 },
+{ XML_bg2, model::ThemeColorType::Light2 },
+{ XML_dark1, model::ThemeColorType::Dark1 },
+{ XML_light1, model::ThemeColorType::Light1 },
+{ XML_dark2, model::ThemeColorType::Dark2 },
+{ XML_light2, model::ThemeColorType::Light2 },
+{ XML_text1, model::ThemeColorType::Dark1 },
+{ XML_background1, model::ThemeColorType::Light1 },
+{ XML_text2, model::ThemeColorType::Dark2 },
+{ XML_background2, model::ThemeColorType::Light2 },
+{ XML_hyperlink, model::ThemeColorType::Hyperlink },
+{ XML_followedHyperlink, model::ThemeColorType::FollowedHyperlink },
+};
+
+auto aIterator = constThemeColorTokenMap.find(nToken);
+if (aIterator == constThemeColorTokenMap.end())
+return model::ThemeColorType::Unknown;
+else
+return aIterator->second;
+}
+
 Color::Color() :
 meMode( COLOR_UNUSED ),
 mnC1( 0 ),
@@ -346,6 +384,8 @@ void Color::setSchemeClr( sal_Int32 nToken )
 OSL_ENSURE( nToken != XML_TOKEN_INVALID, "Color::setSchemeClr - inval

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

2023-08-11 Thread Tomaž Vajngerl (via logerrit)
 sc/source/ui/theme/ThemeColorChanger.cxx |   25 ++---
 1 file changed, 22 insertions(+), 3 deletions(-)

New commits:
commit 9533d56cb31e49410f3023da1076dafad2786f7b
Author: Tomaž Vajngerl 
AuthorDate: Thu May 11 23:02:08 2023 +0900
Commit: Miklos Vajna 
CommitDate: Fri Aug 11 09:09:21 2023 +0200

sc: change text and background theme colors for direct attributes

Change-Id: Ia1ef2d151476bb627a0cb999135f6add827fb341
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151675
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 17bc0f05908769f024f3aa49554b96388dd49e96)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155543
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/sc/source/ui/theme/ThemeColorChanger.cxx 
b/sc/source/ui/theme/ThemeColorChanger.cxx
index 870ef5b15cb8..2211aa67b554 100644
--- a/sc/source/ui/theme/ThemeColorChanger.cxx
+++ b/sc/source/ui/theme/ThemeColorChanger.cxx
@@ -21,6 +21,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 namespace sc
 {
@@ -33,10 +35,9 @@ ThemeColorChanger::~ThemeColorChanger() = default;
 
 namespace
 {
-void paragraphStyleChange(ScStyleSheet* pStyle, model::ColorSet const& 
rColorSet)
+void changeCellItems(SfxItemSet& rItemSet, model::ColorSet const& rColorSet)
 {
 const SfxPoolItem* pItem = nullptr;
-auto& rItemSet = pStyle->GetItemSet();
 
 if (rItemSet.HasItem(ATTR_FONT_COLOR, &pItem))
 {
@@ -87,9 +88,27 @@ void 
ThemeColorChanger::apply(std::shared_ptr const& pColorSet)
 pStyle = static_cast(pPool->First(SfxStyleFamily::Para));
 while (pStyle)
 {
-paragraphStyleChange(pStyle, *pColorSet);
+auto& rItemSet = pStyle->GetItemSet();
+changeCellItems(rItemSet, *pColorSet);
 pStyle = static_cast(pPool->Next());
 }
+
+// Change Cell / Text attributes
+for (SCTAB nTab = 0; nTab < rDocument.GetTableCount(); nTab++)
+{
+ScDocAttrIterator aAttributeIterator(rDocument, nTab, 0, 0, 
rDocument.MaxCol(),
+ rDocument.MaxRow());
+SCCOL nCol = 0;
+SCROW nRow1 = 0;
+SCROW nRow2 = 0;
+
+while (const ScPatternAttr* pPattern = 
aAttributeIterator.GetNext(nCol, nRow1, nRow2))
+{
+auto* pNonConstPattern = const_cast(pPattern);
+auto& rItemSet = pNonConstPattern->GetItemSet();
+changeCellItems(rItemSet, *pColorSet);
+}
+}
 }
 
 } // end sw namespace


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/inc sc/qa sc/source test/Library_subsequenttest.mk test/source

2023-08-11 Thread Tomaž Vajngerl (via logerrit)
 sc/inc/unonames.hxx|2 ++
 sc/qa/extras/scstyleobj.cxx|   35 ++-
 sc/source/ui/unoobj/cellsuno.cxx   |   13 +
 sc/source/ui/unoobj/styleuno.cxx   |3 +++
 test/Library_subsequenttest.mk |1 +
 test/source/beans/xpropertyset.cxx |9 +
 6 files changed, 54 insertions(+), 9 deletions(-)

New commits:
commit 292a36299d863ac04e403c3bb8d823fdcefe47ce
Author: Tomaž Vajngerl 
AuthorDate: Thu May 11 19:40:06 2023 +0900
Commit: Miklos Vajna 
CommitDate: Fri Aug 11 09:08:40 2023 +0200

sc: add CharComplexColor and CellBackgroundComplexColor properties

Change-Id: I30153796a39b2aa3648cb107905974ed6f0f3851
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151668
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 56e58e6a1280d9bdd23550ba998f14aef4980244)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155542
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/sc/inc/unonames.hxx b/sc/inc/unonames.hxx
index bdd37e666871..550817c62790 100644
--- a/sc/inc/unonames.hxx
+++ b/sc/inc/unonames.hxx
@@ -50,6 +50,7 @@ inline constexpr OUStringLiteral SC_UNO_HASDRAWPAGES 
= u"HasDrawPages";
 
 //  CharacterProperties
 inline constexpr OUStringLiteral SC_UNONAME_CCOLOR   = u"CharColor";
+inline constexpr OUStringLiteral SC_UNONAME_CHAR_COMPLEX_COLOR = 
u"CharComplexColor";
 inline constexpr OUStringLiteral SC_UNONAME_CHEIGHT  = u"CharHeight";
 inline constexpr OUStringLiteral SC_UNONAME_CUNDER   = 
u"CharUnderline";
 inline constexpr OUStringLiteral SC_UNONAME_CUNDLCOL = 
u"CharUnderlineColor";
@@ -97,6 +98,7 @@ inline constexpr OUStringLiteral SC_UNO_CTL_CLOCAL   
= u"CharLocaleCompl
 //  CellProperties
 inline constexpr OUStringLiteral SC_UNONAME_CELLSTYL = u"CellStyle";
 inline constexpr OUStringLiteral SC_UNONAME_CELLBACK = 
u"CellBackColor";
+inline constexpr OUStringLiteral SC_UNONAME_CELL_BACKGROUND_COMPLEX_COLOR = 
u"CellBackgroundComplexColor";
 inline constexpr OUStringLiteral SC_UNONAME_CELLTRAN = 
u"IsCellBackgroundTransparent";
 inline constexpr OUStringLiteral SC_UNONAME_CELLPRO  = 
u"CellProtection";
 inline constexpr OUStringLiteral SC_UNONAME_CELLHJUS = u"HoriJustify";
diff --git a/sc/qa/extras/scstyleobj.cxx b/sc/qa/extras/scstyleobj.cxx
index 7b8ca77c03ab..813a59db944b 100644
--- a/sc/qa/extras/scstyleobj.cxx
+++ b/sc/qa/extras/scstyleobj.cxx
@@ -59,15 +59,32 @@ public:
 ScStyleObj::ScStyleObj()
 : UnoApiTest("/sc/qa/extras/testdocuments")
 , XNamed("ScStyleObj")
-, XPropertySet({
-  "BottomBorder",  "BottomBorder2", "CellProtection", 
"CharLocale",
-  "CharLocaleAsian",   "CharLocaleComplex", "CharPosture",
"CharPostureAsian",
-  "CharPostureComplex","DiagonalBLTR",  "DiagonalBLTR2",  
"DiagonalTLBR",
-  "DiagonalTLBR2", "HoriJustify",   "LeftBorder", 
"LeftBorder2",
-  "NumberFormat",  "Orientation",   "RightBorder",
"RightBorder2",
-  "ShadowFormat",  "TableBorder",   "TopBorder",  
"TopBorder2",
-  "UserDefinedAttributes",
-  })
+, XPropertySet({ "BottomBorder",
+ "BottomBorder2",
+ "CellProtection",
+ "CharLocale",
+ "CharLocaleAsian",
+ "CharLocaleComplex",
+ "CharPosture",
+ "CharPostureAsian",
+ "CharPostureComplex",
+ "DiagonalBLTR",
+ "DiagonalBLTR2",
+ "DiagonalTLBR",
+ "DiagonalTLBR2",
+ "HoriJustify",
+ "LeftBorder",
+ "LeftBorder2",
+ "NumberFormat",
+ "Orientation",
+ "RightBorder",
+ "RightBorder2",
+ "ShadowFormat",
+ "TableBorder",
+ "TopBorder",
+ "TopBorder2",
+ "UserDefinedAttributes",
+ "CellBackgroundComplexColor" })
 {
 }
 
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index 119486d79768..19d9e4216cbb 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -65,6 +65,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -156,9 +157,11 @@ static const SfxItemPropertySet* lcl_GetCellsPropertySet()
 { SC_UNONAME_BOTTBORDER,ATTR_BORDER,   
::cppu::UnoType::get(), 0, BOTTOM_BORDER | CONVERT_TWIPS },
 { SC_UNONAME_BOTTBORDER2,ATTR_BORDER,  
::cppu::UnoType::get(), 0, BOTTOM_BORDER | CONVERT_TWIPS },
 { SC_UNONAME_CELLBACK, ATTR_BACKGROUND,
cppu::UnoType:

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

2023-08-11 Thread Tomaž Vajngerl (via logerrit)
 sd/qa/unit/uiimpress.cxx   |5 +++--
 sd/source/ui/func/fuconstr.cxx |   36 
 2 files changed, 3 insertions(+), 38 deletions(-)

New commits:
commit cd1385378cb56396f0b2145c446c97ae01fc8069
Author: Tomaž Vajngerl 
AuthorDate: Mon Jun 19 15:28:40 2023 +0900
Commit: Miklos Vajna 
CommitDate: Fri Aug 11 09:08:02 2023 +0200

tdf#155086 remove code that sets theme color to shapes as DF

Remove this functionallity for now until we support theme colors
in shape styles. Then we can do it for the default style, and not
as a direct format for each inserted shape.

Change-Id: Ib042072954a79cadc750372333c40269fbe4ca40
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153244
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 2afff27c5327bcb30f894d9a507131f2ad8f1dc6)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155541
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/sd/qa/unit/uiimpress.cxx b/sd/qa/unit/uiimpress.cxx
index c1a53d493797..b4a7890123d7 100644
--- a/sd/qa/unit/uiimpress.cxx
+++ b/sd/qa/unit/uiimpress.cxx
@@ -1137,7 +1137,8 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf127696)
 CPPUNIT_ASSERT(bContoured);
 }
 
-CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testThemeShapeInsert)
+// TODO - Readd when we implement style level fill color and set that for 
default style
+/*CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testThemeShapeInsert)
 {
 // Given a document with a theme, accent1 color is set to 0x04:
 createSdImpressDoc();
@@ -1181,7 +1182,7 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, 
testThemeShapeInsert)
 // - Expected: 0 / 0x04 (~black)
 // - Actual  : 7512015 / 0x729fcf (~blue)
 CPPUNIT_ASSERT_EQUAL(static_cast(0x4), nFillColor);
-}
+}*/
 
 CPPUNIT_PLUGIN_IMPLEMENT();
 
diff --git a/sd/source/ui/func/fuconstr.cxx b/sd/source/ui/func/fuconstr.cxx
index 4db1f4042dc9..fd93a3ce7c94 100644
--- a/sd/source/ui/func/fuconstr.cxx
+++ b/sd/source/ui/func/fuconstr.cxx
@@ -371,42 +371,6 @@ void FuConstruct::SetStyleSheet( SfxItemSet& rAttr, 
SdrObject* pObj,
 pObj->SetMergedItemSet(aAttr);
 }
 }
-else
-{
-// Creating an object with fill.
-SdrPage* pThemePage = pPage;
-if (pThemePage->TRG_HasMasterPage())
-{
-pThemePage = &pThemePage->TRG_GetMasterPage();
-}
-
-auto const& pTheme = pThemePage->getSdrPageProperties().GetTheme();
-if (pTheme)
-{
-// We construct an object on a page where the master page has 
a theme. Take the
-// accent1 color from that theme, make sure it has priority 
over the shape's
-// document-global style.
-SfxItemSet aAttr(mpView->GetDefaultAttr());
-
-aAttr.Put(XFillStyleItem(css::drawing::FillStyle_SOLID));
-
-model::ThemeColorType eColorType = 
model::ThemeColorType::Accent1;
-Color aColor = pTheme->GetColor(eColorType);
-XFillColorItem aFillColorItem("", aColor);
-aFillColorItem.getComplexColor().setSchemeColor(eColorType);
-aAttr.Put(aFillColorItem);
-
-aAttr.Put(XLineStyleItem(css::drawing::LineStyle_SOLID));
-
-// Line color is 50% darker than the fill color.
-aColor.ApplyTintOrShade(-5000);
-XLineColorItem aLineColorItem("", aColor);
-// TODO no theme or theme effect for line colors yet.
-aAttr.Put(aLineColorItem);
-
-pObj->SetMergedItemSet(aAttr);
-}
-}
 }
 }
 


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

2023-08-11 Thread Tomaž Vajngerl (via logerrit)
 sw/qa/extras/ooxmlexport/data/Test_ThemeTextParaBackgroundColor.docx |binary
 sw/qa/extras/ooxmlexport/ooxml_ThemeExport.cxx   |   43 
++
 2 files changed, 43 insertions(+)

New commits:
commit 353c135c81bdf64fa6e19af4f123c7ce0ee95f1b
Author: Tomaž Vajngerl 
AuthorDate: Mon Jun 19 15:48:56 2023 +0900
Commit: Miklos Vajna 
CommitDate: Fri Aug 11 09:07:20 2023 +0200

sw: Test paragraph level text background

Change-Id: Icea365ae036cae49749dd24bb8412775fafbd6c5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153247
Tested-by: Tomaž Vajngerl 
Reviewed-by: Tomaž Vajngerl 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155512
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git 
a/sw/qa/extras/ooxmlexport/data/Test_ThemeTextParaBackgroundColor.docx 
b/sw/qa/extras/ooxmlexport/data/Test_ThemeTextParaBackgroundColor.docx
new file mode 100644
index ..5b012f01333b
Binary files /dev/null and 
b/sw/qa/extras/ooxmlexport/data/Test_ThemeTextParaBackgroundColor.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxml_ThemeExport.cxx 
b/sw/qa/extras/ooxmlexport/ooxml_ThemeExport.cxx
index f9e7155859ea..45bd8014f1d3 100644
--- a/sw/qa/extras/ooxmlexport/ooxml_ThemeExport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxml_ThemeExport.cxx
@@ -97,6 +97,49 @@ DECLARE_SW_ROUNDTRIP_TEST(testCharUnderlineTheme_DOCX, 
"Test_CharUnderlineThemeC
 CPPUNIT_ASSERT_EQUAL(sal_Int16(2509), rTransforms[0].mnValue);
 }
 
+DECLARE_SW_ROUNDTRIP_TEST(testParaBackgroundTheme_DOCX, 
"Test_ThemeTextParaBackgroundColor.docx",
+  nullptr, Test)
+{
+{
+auto xParagraph = getParagraph(1);
+CPPUNIT_ASSERT(xParagraph.is());
+auto xComplexColor = getProperty>(
+xParagraph, "ParaBackgroundComplexColor");
+auto aComplexColor = model::color::getFromXComplexColor(xComplexColor);
+CPPUNIT_ASSERT_EQUAL(model::ThemeColorType::Accent3, 
aComplexColor.getSchemeType());
+auto const& rTransforms = aComplexColor.getTransformations();
+CPPUNIT_ASSERT_EQUAL(size_t(1), rTransforms.size());
+CPPUNIT_ASSERT_EQUAL(model::TransformationType::Tint, 
rTransforms[0].meType);
+CPPUNIT_ASSERT_EQUAL(sal_Int16(8000), rTransforms[0].mnValue);
+}
+
+{
+auto xParagraph = getParagraph(2);
+CPPUNIT_ASSERT(xParagraph.is());
+auto xComplexColor = getProperty>(
+xParagraph, "ParaBackgroundComplexColor");
+auto aComplexColor = model::color::getFromXComplexColor(xComplexColor);
+CPPUNIT_ASSERT_EQUAL(model::ThemeColorType::Accent6, 
aComplexColor.getSchemeType());
+auto const& rTransforms = aComplexColor.getTransformations();
+CPPUNIT_ASSERT_EQUAL(size_t(1), rTransforms.size());
+CPPUNIT_ASSERT_EQUAL(model::TransformationType::Tint, 
rTransforms[0].meType);
+CPPUNIT_ASSERT_EQUAL(sal_Int16(8000), rTransforms[0].mnValue);
+}
+
+{
+auto xParagraph = getParagraph(3);
+CPPUNIT_ASSERT(xParagraph.is());
+auto xComplexColor = getProperty>(
+xParagraph, "ParaBackgroundComplexColor");
+auto aComplexColor = model::color::getFromXComplexColor(xComplexColor);
+CPPUNIT_ASSERT_EQUAL(model::ThemeColorType::Accent3, 
aComplexColor.getSchemeType());
+auto const& rTransforms = aComplexColor.getTransformations();
+CPPUNIT_ASSERT_EQUAL(size_t(1), rTransforms.size());
+CPPUNIT_ASSERT_EQUAL(model::TransformationType::Tint, 
rTransforms[0].meType);
+CPPUNIT_ASSERT_EQUAL(sal_Int16(8000), rTransforms[0].mnValue);
+}
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/Library_sc.mk sc/source

2023-08-11 Thread Tomaž Vajngerl (via logerrit)
 sc/Library_sc.mk |1 
 sc/source/ui/inc/ThemeColorChanger.hxx   |   31 +
 sc/source/ui/theme/ThemeColorChanger.cxx |   97 +++
 sc/source/ui/view/formatsh.cxx   |   13 +---
 sc/source/ui/view/tabvwsh3.cxx   |6 -
 5 files changed, 137 insertions(+), 11 deletions(-)

New commits:
commit 59a972aecc4f7851031cac21e5ae56410dbe7120
Author: Tomaž Vajngerl 
AuthorDate: Thu May 11 17:51:49 2023 +0900
Commit: Miklos Vajna 
CommitDate: Fri Aug 11 09:06:41 2023 +0200

sc: change (char, background) style colors when changing the theme

This adds a Calc specific ThemeColorChanger, which changes the
character and background colors in styles. In addition add the
changes that make this possible - support in SvxBrushItem for
the ComplexColor, making sure that ComplexColor is properly passed
to other items (mainly from color picker),...

Change-Id: Id2e98c42bbe195a0f75cc8951ff69f6d7eea6be0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151667
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155511
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/sc/Library_sc.mk b/sc/Library_sc.mk
index 79c41e83ebac..b53b4efdee8e 100644
--- a/sc/Library_sc.mk
+++ b/sc/Library_sc.mk
@@ -540,6 +540,7 @@ $(eval $(call gb_Library_add_exception_objects,sc,\
 sc/source/ui/StatisticsDialogs/TableFillingAndNavigationTools \
 sc/source/ui/StatisticsDialogs/TTestDialog \
 sc/source/ui/StatisticsDialogs/ZTestDialog \
+sc/source/ui/theme/ThemeColorChanger \
 sc/source/ui/uitest/uiobject \
 sc/source/ui/undo/areasave \
 sc/source/ui/undo/refundo \
diff --git a/sc/source/ui/inc/ThemeColorChanger.hxx 
b/sc/source/ui/inc/ThemeColorChanger.hxx
new file mode 100644
index ..888cf34f11ba
--- /dev/null
+++ b/sc/source/ui/inc/ThemeColorChanger.hxx
@@ -0,0 +1,31 @@
+/* -*- 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 "docsh.hxx"
+
+namespace sc
+{
+class ThemeColorChanger : public svx::IThemeColorChanger
+{
+ScDocShell& m_rDocShell;
+
+public:
+ThemeColorChanger(ScDocShell& rDocShell);
+virtual ~ThemeColorChanger() override;
+
+void apply(std::shared_ptr const& pColorSet) override;
+};
+
+} // end sc namespace
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/theme/ThemeColorChanger.cxx 
b/sc/source/ui/theme/ThemeColorChanger.cxx
new file mode 100644
index ..870ef5b15cb8
--- /dev/null
+++ b/sc/source/ui/theme/ThemeColorChanger.cxx
@@ -0,0 +1,97 @@
+/* -*- 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 
+#include 
+#include 
+
+namespace sc
+{
+ThemeColorChanger::ThemeColorChanger(ScDocShell& rDocShell)
+: m_rDocShell(rDocShell)
+{
+}
+
+ThemeColorChanger::~ThemeColorChanger() = default;
+
+namespace
+{
+void paragraphStyleChange(ScStyleSheet* pStyle, model::ColorSet const& 
rColorSet)
+{
+const SfxPoolItem* pItem = nullptr;
+auto& rItemSet = pStyle->GetItemSet();
+
+if (rItemSet.HasItem(ATTR_FONT_COLOR, &pItem))
+{
+auto const* pColorItem = static_cast(pItem);
+model::ComplexColor const& rComplexColor = 
pColorItem->getComplexColor();
+if (rComplexColor.meType == model::ColorType::Scheme)
+{
+auto eThemeType = rComplexColor.meSchemeType;
+if (eThemeType != model::ThemeColorType::Unknown)
+{
+Color aColor = rColorSet.getColor(eThemeType);
+aColor = rComplexColor.applyTransformations(aColor);
+
+SvxColorItem aColorItem(*pColorItem);
+aColorItem.setColor(aColor);
+rItemSet.Put(aColorItem);
+}
+}
+}
+if (rItemSet.HasItem(ATTR_BACKGROUND, &pItem))
+{
+auto const* pBrushItem = static_cast(pItem);
+model::ComplexColor const& rComplexColor = 
pBrushItem->getComplexColor();
+if (rComplexColor.meType == model::ColorType::Scheme)
+{
+auto eThemeType = rComplexColor.meSchemeType;
+if (eThemeType != model::ThemeColorType::Unknown)
+{
+Color aColor = rC

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/sdi sc/source sc/uiconfig

2023-08-11 Thread Tomaž Vajngerl (via logerrit)
 sc/sdi/tabvwsh.sdi|1 +
 sc/source/ui/view/tabvwsh3.cxx|   33 -
 sc/uiconfig/scalc/menubar/menubar.xml |1 +
 3 files changed, 34 insertions(+), 1 deletion(-)

New commits:
commit 75339c04dabb1d347fc06b249e6a29c38c477e60
Author: Tomaž Vajngerl 
AuthorDate: Fri May 5 23:10:14 2023 +0900
Commit: Miklos Vajna 
CommitDate: Fri Aug 11 09:05:04 2023 +0200

sc: add ThemeDialog to the main menu

Change-Id: I677aac5fdc8f493dcd8190c12e4e44ba09d3eb9d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151450
Tested-by: Tomaž Vajngerl 
Reviewed-by: Tomaž Vajngerl 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155510
Tested-by: Miklos Vajna 
Reviewed-by: Miklos Vajna 

diff --git a/sc/sdi/tabvwsh.sdi b/sc/sdi/tabvwsh.sdi
index 50049bad7abc..f001395dde9b 100644
--- a/sc/sdi/tabvwsh.sdi
+++ b/sc/sdi/tabvwsh.sdi
@@ -184,6 +184,7 @@ interface TableEditView
 SID_JUMPTOMARK  [ ExecMethod = Execute; StateMethod = NoState; ] // 
status(final|play)
 
 SID_PRINTPREVIEW[ ExecMethod = Execute; StateMethod = GetState; ]
+SID_THEME_DIALOG[ ExecMethod = Execute; StateMethod = GetState; ]
 
 
 // search/replace
diff --git a/sc/source/ui/view/tabvwsh3.cxx b/sc/source/ui/view/tabvwsh3.cxx
index ec19d4c1d4a6..8e0695a29d20 100644
--- a/sc/source/ui/view/tabvwsh3.cxx
+++ b/sc/source/ui/view/tabvwsh3.cxx
@@ -59,6 +59,11 @@
 
 #include 
 
+#include 
+#include 
+#include 
+#include 
+
 namespace
 {
 void collectUIInformation(const OUString& aZoom)
@@ -1335,7 +1340,33 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
 SelectionChanged();
 }
 break;
-
+case SID_THEME_DIALOG:
+{
+MakeDrawLayer();
+ScTabView* pTabView = GetViewData().GetView();
+ScDrawView* pView = pTabView->GetScDrawView();
+SdrPage* pPage = pView->GetSdrPageView()->GetPage();
+auto const& pTheme = pPage->getSdrPageProperties().GetTheme();
+if (pTheme)
+{
+ScViewData& rViewData = GetViewData();
+vcl::Window* pWin = rViewData.GetActiveWin();
+auto pDialog = std::make_shared(pWin ? 
pWin->GetFrameWeld() : nullptr, pTheme.get());
+weld::DialogController::runAsync(pDialog, [pDialog, 
pPage](sal_uInt32 nResult) {
+if (RET_OK != nResult)
+return;
+
+auto pColorSet = pDialog->getCurrentColorSet();
+if (pColorSet)
+{
+svx::ThemeColorChanger aChanger(pPage);
+aChanger.apply(pColorSet);
+}
+});
+}
+rReq.Done();
+}
+break;
 case SID_OPT_LOCALE_CHANGED :
 {   // locale changed, SYSTEM number formats changed => repaint 
cell contents
 PaintGrid();
diff --git a/sc/uiconfig/scalc/menubar/menubar.xml 
b/sc/uiconfig/scalc/menubar/menubar.xml
index 8c732452103d..121249b5fba6 100644
--- a/sc/uiconfig/scalc/menubar/menubar.xml
+++ b/sc/uiconfig/scalc/menubar/menubar.xml
@@ -422,6 +422,7 @@
   
   
   
+