Re: Adding an implemented UNO interface

2023-09-04 Thread Noel Grandin
On Mon, 4 Sept 2023 at 21:54, Noel Grandin  wrote:

>
> On Mon, 4 Sept 2023 at 20:43, Lionel Élie Mamane  wrote:
>
>> becomes an ambiguous base of class bar, as it is derived from twice
>> :-|
>>
>> How do we solve that?
>>
>>
> using using
>
>

Sorry, could not resist that.

But unfortunately, I'm wrong, I keep forgetting when "using Baseclass::foo"
will work and when it wont.

Likely you will have to implement disambiguation overrides like:

   virtual SAL_CALL void setFoo() override { Baseclass::setFoo(); }


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

2023-09-04 Thread Miklos Vajna (via logerrit)
 sw/inc/fmtautofmt.hxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 6ee0f9f02f7255339e18ab9e6189b2200bb71e6e
Author: Miklos Vajna 
AuthorDate: Mon Sep 4 21:00:34 2023 +0200
Commit: Miklos Vajna 
CommitDate: Tue Sep 5 08:28:01 2023 +0200

sw: document SwFormatAutoFormat

It can be a bit confusing that char formats go via an autostyle, while
para formats go into the attribute set of the text node directly.

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

diff --git a/sw/inc/fmtautofmt.hxx b/sw/inc/fmtautofmt.hxx
index f4ac2fae7035..1523389083bd 100644
--- a/sw/inc/fmtautofmt.hxx
+++ b/sw/inc/fmtautofmt.hxx
@@ -23,6 +23,10 @@
 #include 
 #include 
 
+/// Has a shared reference to an "auto-style", i.e. a not named collection of 
character formats. It
+/// is owned by an SwTextAttrEnd, which is then stored in the SwpHints of an 
SwTextNode.
+///
+/// This is the primary way how direct character formats are stored inside a 
paragraph.
 class SW_DLLPUBLIC SwFormatAutoFormat final : public SfxPoolItem
 {
 std::shared_ptr mpHandle;


Re: What is the "dynamic" flag in errcode?

2023-09-04 Thread Stephan Bergmann

On 9/5/23 07:13, Lodev wrote:
In the ErrCode definition  (include/comphelper/errcode.hxx) error codes 
are defined as a 32-bit integer.  There is a "Dynamic" area in bit 
30-26.  Also in ErrCode class it defines some methods like isDynamic(), 
StripDynamic(), ... etc.  But we didn't find any comments or documents 
saying what this "Dynamic" flags means, and didn't find where this flag 
is set.


We're looking at an issue about an ods file with empty meta.xml. The 
return errcode was SCWARN_IMPORT_FILE_ROWCOL but the Dynamic flag was 
set, but we couldn't find where and why it was set.


Would anyone please tell me about this dynamic flag/area?


That's for error instances that carry additional data (strings and 
DialogMasks), see StringErrorInfo and TwoStringErrorInfo, and their 
common DynamicErrorInfo base class, in include/vcl/errinf.hxx.  (And 
note how the instance of that SCWARN_IMPORT_FILE_ROWCOL error is 
constructed as a TwoStringErrorInfo in 
ScXMLImportWrapper::ImportFromComponent in sc/source/filter/xml/xmlwrap.cxx.




[Libreoffice-commits] core.git: offapi/type_reference

2023-09-04 Thread Stephan Bergmann (via logerrit)
 offapi/type_reference/offapi.idl |   34 --
 1 file changed, 24 insertions(+), 10 deletions(-)

New commits:
commit d0166429887ab3cbe8c8369fd73668502d638a4a
Author: Stephan Bergmann 
AuthorDate: Mon Sep 4 20:56:30 2023 +0200
Commit: Stephan Bergmann 
CommitDate: Tue Sep 5 07:36:05 2023 +0200

Update the reference rdbs to libreoffice-7.6.0.3

.../master/instdir/sdk/bin/unoidl-read --published \
 .../libreoffice-7.6.0.3/instdir/program/types.rdb \
 >.../master/udkapi/type_reference/udkapi.idl

.../master/instdir/sdk/bin/unoidl-read --published \
 .../libreoffice-7.6.0.3/instdir/program/types.rdb \
 .../libreoffice-7.6.0.3/instdir/program/types/offapi.rdb \
 >.../master/offapi/type_reference/offapi.idl

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

diff --git a/offapi/type_reference/offapi.idl b/offapi/type_reference/offapi.idl
index 7c172af98344..fd13e3da3452 100644
--- a/offapi/type_reference/offapi.idl
+++ b/offapi/type_reference/offapi.idl
@@ -430,6 +430,7 @@ module com {
  const short BRACKETRIGHT = 1316;
  const short C = 514;
  const short CAPSLOCK = 1312;
+ const short COLON = 1320;
  const short COMMA = 1292;
  const short CONTEXTMENU = 1305;
  const short COPY = 1298;
@@ -2846,7 +2847,7 @@ module com {
 };
 published enum LineJoint {
  NONE = 0,
- MIDDLE = 1,
+ /** @deprecated */ MIDDLE = 1,
  BEVEL = 2,
  MITER = 3,
  ROUND = 4
@@ -3273,6 +3274,9 @@ module com {
  [property, optional] short RelativeWidth;
  [property, optional] short RelativeHeightRelation;
  [property, optional] short RelativeWidthRelation;
+ [property, optional] string Title;
+ [property, optional] string Description;
+ [property, optional] boolean Decorative;
 };
};
module chart {
@@ -3658,6 +3662,7 @@ module com {
  [property, optional] boolean ParaHyphenationNoLastWord;
  [property, optional] short ParaHyphenationMinWordLength;
  [property, optional] long ParaHyphenationZone;
+ [property, optional, readonly] long SortedTextId;
 };
};
module util {
@@ -4323,11 +4328,6 @@ module com {
   interface ::com::sun::star::lang::XInitialization;
   interface ::com::sun::star::lang::XComponent;
  };
- published constants RenderingCapabilities {
-  const byte Delayed = 1;
-  /** @deprecated */ const byte Persistant = 2;
-  const byte Persistent = 2;
- };
  published interface XFlushableClipboard {
   interface ::com::sun::star::uno::XInterface;
   void flushClipboard();
@@ -4338,6 +4338,11 @@ module com {
   interface ::com::sun::star::lang::XComponent;
   [optional] interface 
::com::sun::star::datatransfer::clipboard::XFlushableClipboard;
  };
+ published constants RenderingCapabilities {
+  const byte Delayed = 1;
+  /** @deprecated */ const byte Persistant = 2;
+  const byte Persistent = 2;
+ };
  published service SystemClipboard: 
::com::sun::star::datatransfer::clipboard::XSystemClipboard;
  published interface XClipboardFactory {
   interface ::com::sun::star::uno::XInterface;
@@ -7888,7 +7893,7 @@ module com {
  const short HYPHENATION = 2;
  const short WORDBOUNDARY = 1;
 };
-published constants CTLScriptType {
+/** @deprecated */ published constants CTLScriptType {
  const short CTL_ARABIC = 2;
  const short CTL_HEBREW = 1;
  const short CTL_INDIC = 4;
@@ -8779,9 +8784,9 @@ module com {
  long beginOfScriptDirection([in] string aText, [in] long nPos, [in] short 
nScriptDirection);
  long endOfScriptDirection([in] string aText, [in] long nPos, [in] short 
nScriptDirection);
  short getScriptDirection([in] string aText, [in] long nPos, [in] short 
nDefaultScriptDirection);
- long beginOfCTLScriptType([in] string aText, [in] long nPos);
- long endOfCTLScriptType([in] string aText, [in] long nPos);
- short getCTLScriptType([in] string aText, [in] long nPos);
+ /** @deprecated */ long beginOfCTLScriptType([in] string aText, [in] long 
nPos);
+ /** @deprecated */ long endOfCTLScriptType([in] string aText, [in] long 
nPos);
+ /** @deprecated */ short getCTLScriptType([in] string aText, [in] long 
nPos);
 };
 published constants reservedWords {
  const short ABOVE_WORD = 6;
@@ -13376,14 +13381,18 @@ module com {
  const short CHARS_CYRILLIC_LOWER_LETTER_N_BG = 41;
  const short CHARS_CYRILLIC_LOWER_LETTER_N_RU = 45;
  const short CHARS_CYRILLIC_LOWER_LETTER_N_SR = 51;
+ const short CHARS_CYRILLIC_LOWER_LETTER_N_UK = 75;
  const short CHARS_CYRILLIC_LOWER_LETTER_RU = 43;
  const short CHARS_CYRILLIC_LOWER_LETTER_SR = 49;
+ const short CHARS_CYRILLIC_LOWER_LETTER_UK = 73;
  const short CHARS_CYRILLIC_UPPER

What is the "dynamic" flag in errcode?

2023-09-04 Thread Lodev

Hi,


In the ErrCode definition  (include/comphelper/errcode.hxx) error codes 
are defined as a 32-bit integer.  There is a "Dynamic" area in bit 
30-26.  Also in ErrCode class it defines some methods like isDynamic(), 
StripDynamic(), ... etc.  But we didn't find any comments or documents 
saying what this "Dynamic" flags means, and didn't find where this flag 
is set.


We're looking at an issue about an ods file with empty meta.xml. The 
return errcode was SCWARN_IMPORT_FILE_ROWCOL but the Dynamic flag was 
set, but we couldn't find where and why it was set.


Would anyone please tell me about this dynamic flag/area?


Thanks,

Dev


Re: Seeking help with Windows build using v7.6.1.1

2023-09-04 Thread Andrew Richardson
Thank you for the input.  I scraped my original tree and restarted from
scratch under LODE's recommended '~/lode' path.  Seeing same build issues.
I have attempted to adjust my Norton 360 to exclude the LO build
processing, but it may still be a factor.
I am NOT willing to uninstall Norton on this machine, so I am aborting this
Windows build effort.
May try a Linux build to see if I have better luck...

On Mon, Sep 4, 2023 at 4:03 PM Noel Grandin  wrote:

>
> I am guessing either
>
> (a) anti-virus tool
>
> or
>
> (b) you are using a different git client and it has munged some line
> endings
>
>


Re: Seeking help with Windows build using v7.6.1.1

2023-09-04 Thread Noel Grandin
I am guessing either

(a) anti-virus tool

or

(b) you are using a different git client and it has munged some line endings


Re: Adding an implemented UNO interface

2023-09-04 Thread Noel Grandin
On Mon, 4 Sept 2023 at 20:43, Lionel Élie Mamane  wrote:

> becomes an ambiguous base of class bar, as it is derived from twice
> :-|
>
> How do we solve that?
>
>
using using


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

2023-09-04 Thread Michael Weghorn (via logerrit)
 accessibility/inc/standard/vclxaccessiblelist.hxx|7 +-
 accessibility/source/standard/vclxaccessiblelist.cxx |   53 +--
 2 files changed, 30 insertions(+), 30 deletions(-)

New commits:
commit 410632ac4b8a280e0993e665ffa9cfede8326b49
Author: Michael Weghorn 
AuthorDate: Mon Sep 4 19:09:18 2023 +0200
Commit: Michael Weghorn 
CommitDate: Mon Sep 4 21:43:22 2023 +0200

a11y: Hold list items by rtl::Reference

Use a vector of `rtl::Reference`
for the children instead of a vector of
`css::uno::Reference`
and casting in various places.

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

diff --git a/accessibility/inc/standard/vclxaccessiblelist.hxx 
b/accessibility/inc/standard/vclxaccessiblelist.hxx
index eb1cdc6f9d53..f668e75d7cda 100644
--- a/accessibility/inc/standard/vclxaccessiblelist.hxx
+++ b/accessibility/inc/standard/vclxaccessiblelist.hxx
@@ -25,6 +25,8 @@
 #include 
 #include 
 
+class VCLXAccessibleListItem;
+
 namespace accessibility
 {
 class IComboListBoxHelper;
@@ -114,7 +116,7 @@ public:
 private:
 BoxType m_aBoxType;
 std::unique_ptr<::accessibility::IComboListBoxHelper> m_pListBoxHelper;
-std::vector> 
m_aAccessibleChildren;
+std::vector> m_aAccessibleChildren;
 sal_Int32   m_nVisibleLineCount;
 /// Index in parent.  This is settable from the outside.
 sal_Int32   m_nIndexInParent;
@@ -144,8 +146,7 @@ private:
 /** Create the specified child and insert it into the list of children.
 Sets the child's states.
 */
-css::uno::Reference< css::accessibility::XAccessible >
-CreateChild (sal_Int32 i);
+rtl::Reference CreateChild (sal_Int32 i);
 
 /** Call this method when the item list has been changed, i.e. items
 have been deleted or inserted.
diff --git a/accessibility/source/standard/vclxaccessiblelist.cxx 
b/accessibility/source/standard/vclxaccessiblelist.cxx
index 14f6cddc504b..67061aac3ab0 100644
--- a/accessibility/source/standard/vclxaccessiblelist.cxx
+++ b/accessibility/source/standard/vclxaccessiblelist.cxx
@@ -108,8 +108,11 @@ void SAL_CALL VCLXAccessibleList::disposing()
 VCLXAccessibleComponent::disposing();
 
 // Dispose all items in the list.
-for (Reference& rxChild : m_aAccessibleChildren)
-comphelper::disposeComponent(rxChild);
+for (rtl::Reference& rxChild : 
m_aAccessibleChildren)
+{
+if (rxChild.is())
+rxChild->dispose();
+}
 
 m_aAccessibleChildren.clear();
 
@@ -159,18 +162,17 @@ void VCLXAccessibleList::notifyVisibleStates(bool 
_bSetNew )
 // adjust the index inside the VCLXAccessibleListItem
 for ( ; aIter != m_aAccessibleChildren.end(); )
 {
-Reference xChild = *aIter;
+rtl::Reference xChild = *aIter;
 if (!xChild.is())
 {
 aIter = m_aAccessibleChildren.erase(aIter);
 }
 else
 {
-VCLXAccessibleListItem* pItem = 
static_cast(xChild.get());
 const sal_Int32 nTopEntry = m_pListBoxHelper ? 
m_pListBoxHelper->GetTopEntry() : 0;
 const sal_Int32 nPos = static_cast(aIter - 
m_aAccessibleChildren.begin());
 bool bVisible = ( nPos>=nTopEntry && nPos<( nTopEntry + 
m_nVisibleLineCount ) );
-pItem->SetVisible( m_bVisible && bVisible );
+xChild->SetVisible(m_bVisible && bVisible);
 ++aIter;
 }
 
@@ -209,25 +211,24 @@ void VCLXAccessibleList::UpdateSelection_Impl_Acc(bool 
bHasDropDownList)
 {
 sal_Int32 i=0;
 m_nCurSelectedPos = LISTBOX_ENTRY_NOTFOUND;
-for (const Reference& rxChild : m_aAccessibleChildren)
+for (const rtl::Reference& rxChild : 
m_aAccessibleChildren)
 {
 if (rxChild.is())
 {
-VCLXAccessibleListItem* pItem = static_cast< 
VCLXAccessibleListItem* >(rxChild.get() );
 // Retrieve the item's index from the list entry.
 bool bNowSelected = m_pListBoxHelper->IsEntryPosSelected 
(i);
 if (bNowSelected)
 m_nCurSelectedPos = i;
 
-if ( bNowSelected && !pItem->IsSelected() )
+if (bNowSelected && !rxChild->IsSelected())
 {
 xNewAcc = rxChild;
 aNewValue <<= xNewAcc;
 }
-else if ( pItem->IsSelected() )
+else if (rxChild->IsSelected())
 m_nLastSelectedPos = i;
 
-pItem->SetSelected( bNowSelected );
+rxChild->SetSelected(bNowSelected);
 }
 else
 { // it could happen that a child was not created before
@@ -332,7 +333,7

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

2023-09-04 Thread Michael Weghorn (via logerrit)
 accessibility/inc/standard/vclxaccessiblelist.hxx|5 +
 accessibility/source/standard/vclxaccessiblelist.cxx |2 +-
 2 files changed, 2 insertions(+), 5 deletions(-)

New commits:
commit 307b9af2420d649b2e50817e38f8cb63687abf8b
Author: Michael Weghorn 
AuthorDate: Mon Sep 4 17:29:57 2023 +0200
Commit: Michael Weghorn 
CommitDate: Mon Sep 4 21:41:40 2023 +0200

a11y: Drop ListItems typdef

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

diff --git a/accessibility/inc/standard/vclxaccessiblelist.hxx 
b/accessibility/inc/standard/vclxaccessiblelist.hxx
index 57d43d2c11de..eb1cdc6f9d53 100644
--- a/accessibility/inc/standard/vclxaccessiblelist.hxx
+++ b/accessibility/inc/standard/vclxaccessiblelist.hxx
@@ -25,9 +25,6 @@
 #include 
 #include 
 
-typedef std::vector>
-ListItems;
-
 namespace accessibility
 {
 class IComboListBoxHelper;
@@ -117,7 +114,7 @@ public:
 private:
 BoxType m_aBoxType;
 std::unique_ptr<::accessibility::IComboListBoxHelper> m_pListBoxHelper;
-ListItems   m_aAccessibleChildren;
+std::vector> 
m_aAccessibleChildren;
 sal_Int32   m_nVisibleLineCount;
 /// Index in parent.  This is settable from the outside.
 sal_Int32   m_nIndexInParent;
diff --git a/accessibility/source/standard/vclxaccessiblelist.cxx 
b/accessibility/source/standard/vclxaccessiblelist.cxx
index 101c5815c0ac..14f6cddc504b 100644
--- a/accessibility/source/standard/vclxaccessiblelist.cxx
+++ b/accessibility/source/standard/vclxaccessiblelist.cxx
@@ -154,7 +154,7 @@ void VCLXAccessibleList::notifyVisibleStates(bool _bSetNew )
 (_bSetNew ? aNewValue : aOldValue ) <<= AccessibleStateType::SHOWING;
 NotifyAccessibleEvent( AccessibleEventId::STATE_CHANGED, aOldValue, 
aNewValue );
 
-ListItems::iterator aIter = m_aAccessibleChildren.begin();
+auto aIter = m_aAccessibleChildren.begin();
 UpdateVisibleLineCount();
 // adjust the index inside the VCLXAccessibleListItem
 for ( ; aIter != m_aAccessibleChildren.end(); )


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

2023-09-04 Thread Michael Weghorn (via logerrit)
 accessibility/source/standard/vclxaccessiblelist.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 51de048ae97cbd371457dbc07120e30db9ee4187
Author: Michael Weghorn 
AuthorDate: Mon Sep 4 17:19:03 2023 +0200
Commit: Michael Weghorn 
CommitDate: Mon Sep 4 21:41:21 2023 +0200

tdf#157088 a11y: Dispose list items with list

Don't only clear, but also dispose the
list items when the `VCLXAccessibleList`
gets disposed.

Interestingly, there was already a comment
saying

// Dispose all items in the list.

, but that wasn't done so far...

Fixes a crash on exit with the below backtrace
after using the font color toolbox item with
the qt6 VCL plugin and Orca running:

1  __pthread_kill_implementation  pthread_kill.c  44  0x7fe2a2ea80fc
2  __pthread_kill_internalpthread_kill.c  78  0x7fe2a2ea815f
3  __GI_raise raise.c 26  0x7fe2a2e5a472
4  __GI_abort abort.c 79  0x7fe2a2e444b2
5  __assert_fail_base assert.c92  0x7fe2a2e443d5
6  __assert_fail  assert.c101 0x7fe2a2e533a2
7  (anonymous namespace)::implLookupClient
accessibleeventnotifier.cxx 140 0x7fe2a21138a4
8  comphelper::AccessibleEventNotifier::revokeClientNotifyDisposing   
accessibleeventnotifier.cxx 185 0x7fe2a2113bb8
9  VCLXAccessibleListItem::disposing  vclxaccessiblelistitem.cxx  164 
0x7fe26870cb58
10 cppu::WeakAggComponentImplHelperBase::dispose  implbase.cxx230 
0x7fe2a1c755e3
11 cppu::WeakAggComponentImplHelperBase::release  implbase.cxx204 
0x7fe2a1c75312
12 
cppu::WeakAggComponentImplHelper6::release compbase6.hxx   142 0x7fe26870fc0c
13 
com::sun::star::uno::Reference::~Reference
 Reference.hxx   114 0x7fe28f2428a7
14 QtAccessibleWidget::~QtAccessibleWidgetQtAccessibleWidget.hxx  
39  0x7fe28f262cf9
15 QtAccessibleWidget::~QtAccessibleWidgetQtAccessibleWidget.hxx  
39  0x7fe28f262dd0
16 QAccessibleCache::deleteInterface  qaccessiblecache.cpp173 
0x7fe28e0c8e4b
17 QAccessibleCache::~QAccessibleCacheqaccessiblecache.cpp31  
0x7fe28e0c845c
18 QAccessibleCache::~QAccessibleCacheqaccessiblecache.cpp32  
0x7fe28e0c84e2
19 cleanupAccessibleCache qaccessiblecache.cpp24  0x7fe28e0c83c8
20 qt_call_post_routines  qcoreapplication.cpp327 0x7fe28e9a4593
21 QApplication::~QApplicationqapplication.cpp663 0x7fe28cf9dff6
22 QApplication::~QApplicationqapplication.cpp717 0x7fe28cf9e2f4
23 std::default_delete::operator()  unique_ptr.h99  
0x7fe28f2cf3ae
24 std::__uniq_ptr_impl>::reset   unique_ptr.h211 0x7fe28f2cf7f6
25 std::unique_ptr>::resetunique_ptr.h509 0x7fe28f2cd72d
26 QtInstance::~QtInstanceQtInstance.cxx  273 0x7fe28f2c614f
27 QtInstance::~QtInstanceQtInstance.cxx  274 0x7fe28f2c6226
28 DestroySalInstance salplug.cxx 389 0x7fe299a62611
29 DeInitVCL  svmain.cxx  600 0x7fe299b41226
30 ImplSVMain svmain.cxx  229 0x7fe299b3f9f7
31 SVMain svmain.cxx  236 0x7fe299b3fa53
32 soffice_main   sofficemain.cxx 94  0x7fe2a30a1b5d
33 sal_main   main.c  51  0x55c86565c9d4
34 main   main.c  49  0x55c86565c9ba

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

diff --git a/accessibility/source/standard/vclxaccessiblelist.cxx 
b/accessibility/source/standard/vclxaccessiblelist.cxx
index 57f9b1eabcb3..101c5815c0ac 100644
--- a/accessibility/source/standard/vclxaccessiblelist.cxx
+++ b/accessibility/source/standard/vclxaccessiblelist.cxx
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -107,6 +108,8 @@ void SAL_CALL VCLXAccessibleList::disposing()
 VCLXAccessibleComponent::disposing();
 
 // Dispose all items in the list.
+for (Reference& rxChild : m_aAccessibleChildren)
+comphelper::disposeComponent(rxChild);
 
 m_aAccessibleChildren.clear();
 


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

2023-09-04 Thread Michael Weghorn (via logerrit)
 accessibility/inc/standard/vclxaccessiblelist.hxx|2 -
 accessibility/source/standard/vclxaccessiblelist.cxx |   25 +--
 2 files changed, 13 insertions(+), 14 deletions(-)

New commits:
commit bfa9d01920e7e042a83627d7fa4e78c70bc7ece5
Author: Michael Weghorn 
AuthorDate: Mon Sep 4 17:03:47 2023 +0200
Commit: Michael Weghorn 
CommitDate: Mon Sep 4 21:41:00 2023 +0200

tdf#157088 a11y: No need to use WeakReference for list children

`VCLXAccessibleList` is the owner of the
`VCLXAccessibleListItem`s held in that vector,
so I see no reason to hold them by weak reference,
which according to the doc in
`udkapi/com/sun/star/uno/XWeak.idl` is to avoid
affecting the lifetime of the objects:

> The sense of weak references is to hold a reference to an object
> without affecting the lifetime of the object. That means that a weak
> reference may become invalid, at any time, if the referenced object dies.
> 

Quite the contrary, it is actually responsible for the
lifecycle of the list item a11y objects and should dispose
them when itself gets disposed, which will be added
in a subsequent commit.

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

diff --git a/accessibility/inc/standard/vclxaccessiblelist.hxx 
b/accessibility/inc/standard/vclxaccessiblelist.hxx
index bab8b649fa07..57d43d2c11de 100644
--- a/accessibility/inc/standard/vclxaccessiblelist.hxx
+++ b/accessibility/inc/standard/vclxaccessiblelist.hxx
@@ -25,7 +25,7 @@
 #include 
 #include 
 
-typedef std::vector< css::uno::WeakReference< css::accessibility::XAccessible 
> >
+typedef std::vector>
 ListItems;
 
 namespace accessibility
diff --git a/accessibility/source/standard/vclxaccessiblelist.cxx 
b/accessibility/source/standard/vclxaccessiblelist.cxx
index c38240e3b4e7..57f9b1eabcb3 100644
--- a/accessibility/source/standard/vclxaccessiblelist.cxx
+++ b/accessibility/source/standard/vclxaccessiblelist.cxx
@@ -107,6 +107,7 @@ void SAL_CALL VCLXAccessibleList::disposing()
 VCLXAccessibleComponent::disposing();
 
 // Dispose all items in the list.
+
 m_aAccessibleChildren.clear();
 
 m_pListBoxHelper.reset();
@@ -155,14 +156,14 @@ void VCLXAccessibleList::notifyVisibleStates(bool 
_bSetNew )
 // adjust the index inside the VCLXAccessibleListItem
 for ( ; aIter != m_aAccessibleChildren.end(); )
 {
-Reference< XAccessible > xHold = *aIter;
-if (!xHold.is())
+Reference xChild = *aIter;
+if (!xChild.is())
 {
 aIter = m_aAccessibleChildren.erase(aIter);
 }
 else
 {
-VCLXAccessibleListItem* pItem = 
static_cast(xHold.get());
+VCLXAccessibleListItem* pItem = 
static_cast(xChild.get());
 const sal_Int32 nTopEntry = m_pListBoxHelper ? 
m_pListBoxHelper->GetTopEntry() : 0;
 const sal_Int32 nPos = static_cast(aIter - 
m_aAccessibleChildren.begin());
 bool bVisible = ( nPos>=nTopEntry && nPos<( nTopEntry + 
m_nVisibleLineCount ) );
@@ -205,12 +206,11 @@ void VCLXAccessibleList::UpdateSelection_Impl_Acc(bool 
bHasDropDownList)
 {
 sal_Int32 i=0;
 m_nCurSelectedPos = LISTBOX_ENTRY_NOTFOUND;
-for ( const auto& rChild : m_aAccessibleChildren )
+for (const Reference& rxChild : m_aAccessibleChildren)
 {
-Reference< XAccessible > xHold = rChild;
-if ( xHold.is() )
+if (rxChild.is())
 {
-VCLXAccessibleListItem* pItem = static_cast< 
VCLXAccessibleListItem* >( xHold.get() );
+VCLXAccessibleListItem* pItem = static_cast< 
VCLXAccessibleListItem* >(rxChild.get() );
 // Retrieve the item's index from the list entry.
 bool bNowSelected = m_pListBoxHelper->IsEntryPosSelected 
(i);
 if (bNowSelected)
@@ -218,7 +218,7 @@ void VCLXAccessibleList::UpdateSelection_Impl_Acc(bool 
bHasDropDownList)
 
 if ( bNowSelected && !pItem->IsSelected() )
 {
-xNewAcc = rChild;
+xNewAcc = rxChild;
 aNewValue <<= xNewAcc;
 }
 else if ( pItem->IsSelected() )
@@ -663,12 +663,11 @@ void VCLXAccessibleList::UpdateSelection_Impl(sal_Int32)
 {
 sal_Int32 i=0;
 m_nCurSelectedPos = LISTBOX_ENTRY_NOTFOUND;
-for ( const auto& rChild : m_aAccessibleChildren )
+for (const Reference& rxChild : m_aAccessibleChildren 
)
 {
-Reference< XAccessible > xHold = rChild;
-if ( xHold.is() )
+if (rxChild.is())
 {
- 

[Libreoffice-commits] core.git: 2 commits - filter/source include/sfx2 include/svl include/vcl include/xmloff offapi/com offapi/UnoApi_offapi.mk sfx2/source sfx2/uiconfig vcl/inc vcl/source xmloff/sou

2023-09-04 Thread Sarper Akdemir (via logerrit)
 filter/source/pdf/pdfexport.cxx   |   12 
 include/sfx2/dinfdlg.hxx  |   32 ++
 include/svl/memberid.h|   14 
 include/vcl/pdfwriter.hxx |8 
 include/xmloff/xmltoken.hxx   |4 
 offapi/UnoApi_offapi.mk   |1 
 offapi/com/sun/star/document/XDocumentProperties2.idl |   50 +++
 sfx2/source/dialog/dinfdlg.cxx|  118 +++-
 sfx2/source/doc/SfxDocumentMetaData.cxx   |  135 +
 sfx2/uiconfig/ui/descriptioninfopage.ui   |  260 +-
 vcl/inc/pdf/XmpMetadata.hxx   |9 
 vcl/source/gdi/pdfwriter_impl.cxx |   28 +
 vcl/source/pdf/XmpMetadata.cxx|   84 +
 xmloff/source/core/xmltoken.cxx   |4 
 xmloff/source/token/tokens.txt|4 
 15 files changed, 748 insertions(+), 15 deletions(-)

New commits:
commit b273a0c1527193e21fbd0ccbc23853205f90056b
Author: Sarper Akdemir 
AuthorDate: Thu Aug 31 19:49:42 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Mon Sep 4 20:54:25 2023 +0200

tdf#138792: PDF export: export metadata dc:format

Export application/pdf MIMEType in dc:format

Change-Id: I7cb658c869898df3a9436937329b4082843338bc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156507
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

diff --git a/vcl/source/pdf/XmpMetadata.cxx b/vcl/source/pdf/XmpMetadata.cxx
index 7496ab26e3f5..cb88016365b3 100644
--- a/vcl/source/pdf/XmpMetadata.cxx
+++ b/vcl/source/pdf/XmpMetadata.cxx
@@ -73,6 +73,11 @@ void XmpMetadata::write()
 aXmlWriter.startElement("rdf:Description");
 aXmlWriter.attribute("rdf:about", OString(""));
 aXmlWriter.attribute("xmlns:dc", 
OString("http://purl.org/dc/elements/1.1/";));
+
+aXmlWriter.startElement("dc:format");
+aXmlWriter.content("application/pdf");
+aXmlWriter.endElement();
+
 if (!msTitle.isEmpty())
 {
 // this is according to PDF/A-1, technical corrigendum 1 
(2007-04-01)
commit 0deea02b1da1001fa497dc5afa5e43207af491d5
Author: Sarper Akdemir 
AuthorDate: Sat Aug 19 17:18:50 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Mon Sep 4 20:54:19 2023 +0200

tdf#138792: PDF export: add batch of dublin core attributes

Adds support for exporting, editing in the UI and storage in
ODF for the dublin core attributes listed below.

Contributor (http://purl.org/dc/elements/1.1/contributor)
Coverage (http://purl.org/dc/elements/1.1/coverage)
Identifier (http://purl.org/dc/elements/1.1/identifier)
Publisher (http://purl.org/dc/elements/1.1/publisher)
Relation (http://purl.org/dc/elements/1.1/relation)
Rights (http://purl.org/dc/elements/1.1/rights)
Source (http://purl.org/dc/elements/1.1/source)
Type (http://purl.org/dc/elements/1.1/type)

Introduces XDocumentProperties2 to extend XDocumentProperties interface.

Change-Id: Ie2e0b1fbbbd00b66aef477ba1bf4e4f61c03a3b3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156330
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx
index 9b6523448dfb..a9a717a56cc5 100644
--- a/filter/source/pdf/pdfexport.cxx
+++ b/filter/source/pdf/pdfexport.cxx
@@ -49,7 +49,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -470,7 +470,7 @@ bool PDFExport::Export( const OUString& rFile, const 
Sequence< PropertyValue >&
 Reference< document::XDocumentPropertiesSupplier > 
xDocumentPropsSupplier( mxSrcDoc, UNO_QUERY );
 if ( xDocumentPropsSupplier.is() )
 {
-Reference< document::XDocumentProperties > xDocumentProps( 
xDocumentPropsSupplier->getDocumentProperties() );
+Reference< document::XDocumentProperties2 > xDocumentProps( 
xDocumentPropsSupplier->getDocumentProperties(), UNO_QUERY );
 if ( xDocumentProps.is() )
 {
 aContext.DocumentInfo.Title = xDocumentProps->getTitle();
@@ -481,6 +481,14 @@ bool PDFExport::Export( const OUString& rFile, const 
Sequence< PropertyValue >&
 = xDocumentProps->getEditingCycles() < 1
   ? xDocumentProps->getCreationDate()
   : xDocumentProps->getModificationDate();
+aContext.DocumentInfo.Contributor = 
xDocumentProps->getContributor();
+aContext.DocumentInfo.Coverage = 
xDocumentProps->getCoverage();
+aContext.DocumentInfo.Identifier = 
xDocumentProps->getIdentifier();
+aContext.DocumentInfo.Publisher = 
xDocumentProps->g

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

2023-09-04 Thread Sarper Akdemir (via logerrit)
 vcl/inc/pdf/XmpMetadata.hxx   |1 +
 vcl/source/gdi/pdfwriter_impl.cxx |   32 +---
 vcl/source/pdf/XmpMetadata.cxx|8 +++-
 3 files changed, 29 insertions(+), 12 deletions(-)

New commits:
commit a45f72b8122d3bb4c0d5ac4252cf7e5a25d52291
Author: Sarper Akdemir 
AuthorDate: Thu Aug 31 02:59:51 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Mon Sep 4 20:53:40 2023 +0200

tdf#138792: PDF export: export metadata pdf:PDFVersion

Adds export of pdf:PDFVersion metadata.

Change-Id: Ic4c3eec3672839d0d125b64dfca6149912cd2458
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156329
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

diff --git a/vcl/inc/pdf/XmpMetadata.hxx b/vcl/inc/pdf/XmpMetadata.hxx
index d94d6e690c3c..a144266497cf 100644
--- a/vcl/inc/pdf/XmpMetadata.hxx
+++ b/vcl/inc/pdf/XmpMetadata.hxx
@@ -27,6 +27,7 @@ public:
 OString msAuthor;
 OString msSubject;
 OString msProducer;
+OString msPDFVersion;
 OString msKeywords;
 OString m_sCreatorTool;
 OString m_sCreateDate;
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx 
b/vcl/source/gdi/pdfwriter_impl.cxx
index def3d4ee3ba5..00b59830f048 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -623,6 +623,25 @@ void appendPdfTimeDate(OStringBuffer & rBuffer,
 }
 }
 
+const char* getPDFVersionStr(PDFWriter::PDFVersion ePDFVersion)
+{
+switch (ePDFVersion)
+{
+case PDFWriter::PDFVersion::PDF_A_1:
+case PDFWriter::PDFVersion::PDF_1_4:
+return "1.4";
+case PDFWriter::PDFVersion::PDF_1_5:
+return "1.5";
+case PDFWriter::PDFVersion::PDF_1_6:
+return "1.6";
+default:
+case PDFWriter::PDFVersion::PDF_A_2:
+case PDFWriter::PDFVersion::PDF_A_3:
+case PDFWriter::PDFVersion::PDF_1_7:
+return "1.7";
+}
+}
+
 } // end namespace
 
 PDFPage::PDFPage( PDFWriterImpl* pWriter, double nPageWidth, double 
nPageHeight, PDFWriter::Orientation eOrientation )
@@ -1295,17 +1314,7 @@ PDFWriterImpl::PDFWriterImpl( const 
PDFWriter::PDFWriterContext& rContext,
 // write header
 OStringBuffer aBuffer( 20 );
 aBuffer.append( "%PDF-" );
-switch( m_aContext.Version )
-{
-case PDFWriter::PDFVersion::PDF_A_1:
-case PDFWriter::PDFVersion::PDF_1_4: aBuffer.append( "1.4" );break;
-case PDFWriter::PDFVersion::PDF_1_5: aBuffer.append( "1.5" );break;
-case PDFWriter::PDFVersion::PDF_1_6: aBuffer.append( "1.6" );break;
-default:
-case PDFWriter::PDFVersion::PDF_A_2:
-case PDFWriter::PDFVersion::PDF_A_3:
-case PDFWriter::PDFVersion::PDF_1_7: aBuffer.append( "1.7" );break;
-}
+aBuffer.append(getPDFVersionStr(m_aContext.Version));
 // append something binary as comment (suggested in PDF Reference)
 aBuffer.append( "\n%\303\244\303\274\303\266\303\237\n" );
 if( !writeBuffer( aBuffer ) )
@@ -5952,6 +5961,7 @@ sal_Int32 PDFWriterImpl::emitDocumentMetadata()
 lcl_assignMeta(m_aContext.DocumentInfo.Author, aMetadata.msAuthor);
 lcl_assignMeta(m_aContext.DocumentInfo.Subject, aMetadata.msSubject);
 lcl_assignMeta(m_aContext.DocumentInfo.Producer, aMetadata.msProducer);
+aMetadata.msPDFVersion = getPDFVersionStr(m_aContext.Version);
 lcl_assignMeta(m_aContext.DocumentInfo.Keywords, aMetadata.msKeywords);
 lcl_assignMeta(m_aContext.DocumentInfo.Creator, 
aMetadata.m_sCreatorTool);
 aMetadata.m_sCreateDate = m_aCreationMetaDateString;
diff --git a/vcl/source/pdf/XmpMetadata.cxx b/vcl/source/pdf/XmpMetadata.cxx
index 7b0df42dbb92..6dae3b86ebc1 100644
--- a/vcl/source/pdf/XmpMetadata.cxx
+++ b/vcl/source/pdf/XmpMetadata.cxx
@@ -122,7 +122,7 @@ void XmpMetadata::write()
 }
 
 // PDF properties
-if (!msProducer.isEmpty() || !msKeywords.isEmpty())
+if (!msProducer.isEmpty() || !msKeywords.isEmpty() || 
!msPDFVersion.isEmpty())
 {
 aXmlWriter.startElement("rdf:Description");
 aXmlWriter.attribute("rdf:about", OString(""));
@@ -139,6 +139,12 @@ void XmpMetadata::write()
 aXmlWriter.content(msKeywords);
 aXmlWriter.endElement();
 }
+if (!msPDFVersion.isEmpty())
+{
+aXmlWriter.startElement("pdf:PDFVersion");
+aXmlWriter.content(msPDFVersion);
+aXmlWriter.endElement();
+}
 aXmlWriter.endElement();
 }
 


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

2023-09-04 Thread Sarper Akdemir (via logerrit)
 filter/source/pdf/pdfexport.cxx   |4 
 include/vcl/pdfwriter.hxx |1 +
 vcl/inc/pdf/pdfwriter_impl.hxx|1 +
 vcl/source/gdi/pdfwriter_impl.cxx |   12 ++--
 vcl/source/pdf/XmpMetadata.cxx|8 
 5 files changed, 24 insertions(+), 2 deletions(-)

New commits:
commit 7803c5749365c6dca6583708c14d6229c9659572
Author: Sarper Akdemir 
AuthorDate: Thu Aug 10 08:49:24 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Mon Sep 4 20:53:27 2023 +0200

tdf#138792: PDF export: export metadata xmp:ModifyDate, xmp:MetadataDate

Export metadata xmp:ModifyDate & xmp:MetadataDate - populate
both with the same information as CreateDate.

Change-Id: I391a72cbe4e7d1ebba5c04c402a68534bbeb4743
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156328
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

diff --git a/vcl/source/pdf/XmpMetadata.cxx b/vcl/source/pdf/XmpMetadata.cxx
index d4c58c23348b..7b0df42dbb92 100644
--- a/vcl/source/pdf/XmpMetadata.cxx
+++ b/vcl/source/pdf/XmpMetadata.cxx
@@ -155,8 +155,16 @@ void XmpMetadata::write()
 aXmlWriter.startElement("xmp:CreateDate");
 aXmlWriter.content(m_sCreateDate);
 aXmlWriter.endElement();
+
+aXmlWriter.startElement("xmp:ModifyDate");
+aXmlWriter.content(m_sCreateDate);
+aXmlWriter.endElement();
+
+aXmlWriter.startElement("xmp:MetadataDate");
+aXmlWriter.content(m_sCreateDate);
 aXmlWriter.endElement();
 
+aXmlWriter.endElement();
 aXmlWriter.endElement();
 aXmlWriter.endElement();
 aXmlWriter.endDocument();
commit 07ac61f2c67020ad2941462ea7081f06495bcb92
Author: Sarper Akdemir 
AuthorDate: Mon Aug 28 11:16:34 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Mon Sep 4 20:53:17 2023 +0200

tdf#138792: PDF export: fix date of xmp:CreateDate

for pdf export xmp:CreateDate should be the modification
date instead of the creation date.

Change-Id: I2a86f30cb528cb2bd5e0f9e7c9a8a8b8d2993f50
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156327
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx
index 8199132b66b4..9b6523448dfb 100644
--- a/filter/source/pdf/pdfexport.cxx
+++ b/filter/source/pdf/pdfexport.cxx
@@ -477,6 +477,10 @@ bool PDFExport::Export( const OUString& rFile, const 
Sequence< PropertyValue >&
 aContext.DocumentInfo.Author = xDocumentProps->getAuthor();
 aContext.DocumentInfo.Subject = 
xDocumentProps->getSubject();
 aContext.DocumentInfo.Keywords = 
::comphelper::string::convertCommaSeparated(xDocumentProps->getKeywords());
+aContext.DocumentInfo.ModificationDate
+= xDocumentProps->getEditingCycles() < 1
+  ? xDocumentProps->getCreationDate()
+  : xDocumentProps->getModificationDate();
 }
 }
 
diff --git a/include/vcl/pdfwriter.hxx b/include/vcl/pdfwriter.hxx
index 796c1f03cd9b..2b62b26b6ef4 100644
--- a/include/vcl/pdfwriter.hxx
+++ b/include/vcl/pdfwriter.hxx
@@ -559,6 +559,7 @@ The following structure describes the permissions used in 
PDF security
 OUString  Author; // document author
 OUString  Subject;// subject
 OUString  Keywords;   // keywords
+css::util::DateTime ModificationDate;
 OUString  Creator;// application that created the 
original document
 OUString  Producer;   // OpenOffice
 };
diff --git a/vcl/inc/pdf/pdfwriter_impl.hxx b/vcl/inc/pdf/pdfwriter_impl.hxx
index 75f613060c04..b9eaf4686b95 100644
--- a/vcl/inc/pdf/pdfwriter_impl.hxx
+++ b/vcl/inc/pdf/pdfwriter_impl.hxx
@@ -1115,6 +1115,7 @@ i12626
 static void computeDocumentIdentifier( std::vector< sal_uInt8 >& 
o_rIdentifier,
const vcl::PDFWriter::PDFDocInfo& 
i_rDocInfo,
const OString& i_rCString1,
+   const css::util::DateTime& 
rCreationMetaDate,
OString& o_rCString2
   );
 static sal_Int32 computeAccessPermissions( const 
vcl::PDFWriter::PDFEncryptionProperties& i_rProperties,
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx 
b/vcl/source/gdi/pdfwriter_impl.cxx
index 55ed6d514b9d..def3d4ee3ba5 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -1375,7 +1375,7 @@ void PDFWriterImpl::setupDocInfo()
 {
 std::vector< sal_uInt8 > aId;
 m_aCreationDateString = PDFWriter::GetDateTime();
-computeDocumentIdentifier( aId, m_aContext.DocumentInfo, 
m_aCreationDateString, m_aCreationMetaDateString );
+computeDocumentIdentifier( 

Re: Adding an implemented UNO interface

2023-09-04 Thread Lionel Élie Mamane
On Mon, Sep 04, 2023 at 11:58:23AM +0200, Lionel Élie Mamane wrote:

> Reading up on ImplInheritanceHelper, I think you meant (or my question
> was unclear, but the answer to the question I had meant to ask is)

> typedef cppu::ImplInheritanceHelper  bar_BASE;

> class bar: public bar_BASE
> {
>
> }

Now we hit the problem that css::corge is an extension of an interface
already implemented by grault (let's call it css::qux), so css:qux
becomes an ambiguous base of class bar, as it is derived from twice
:-|

How do we solve that?

So to recap (and rename corge to qux2 for better clarity) we have:

/* qux2.idl contains:
 *
 * interface qux2 : qux
 * {
 * ... stuff ...
 * )
 */


#include 
/* grault.hxx contains:
 *
 * typedef ::cppu::WeakComponentImplHelper2 <
 *css::baz,
 *css::qux >  grault_BASE;
 *
 * class grault : public grault_BASE { ... }
 */

typedef grault bar_BASE;

class bar : public bar_BASE
{
   ...
}


and what we want to achieve is to implement interface css::qux2 in
class bar. Surely there must be a recipe for that.

(For Stephan: css::qux above is css::sdbc::XConnection in the patch,
 and qux2 is the newly introduced css::sdbc::XConnection2)


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

2023-09-04 Thread Julien Nabet (via logerrit)
 cui/qa/uitest/dialogs/chardlg.py   |4 ++--
 cui/qa/uitest/tabpages/tpcolor.py  |4 ++--
 svx/source/tbxctrls/PaletteManager.cxx |6 +-
 3 files changed, 9 insertions(+), 5 deletions(-)

New commits:
commit a70b613e6b5d95362f34f57df5cda22a74cb670e
Author: Julien Nabet 
AuthorDate: Thu Aug 31 16:19:13 2023 +0200
Commit: Tomaž Vajngerl 
CommitDate: Mon Sep 4 19:51:06 2023 +0200

tdf#157034: FILESAVE loext:theme-type is off by one

nItemId begins with 1 but list of themes begin with 0 so decrement nItemId
part of bt here:
https://bugs.documentfoundation.org/show_bug.cgi?id=157034#c1

+ adapt QA tests

Change-Id: I7913ea0f71abb9ff98039a9c45a49fdb8f709ae0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156350
Tested-by: Jenkins
Reviewed-by: Regina Henschel 
(cherry picked from commit 85aa230aebfe383eecdb4fc6704d093db8a18402)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156389
Reviewed-by: Tomaž Vajngerl 

diff --git a/cui/qa/uitest/dialogs/chardlg.py b/cui/qa/uitest/dialogs/chardlg.py
index 85e60f766238..d6ebffac3e1e 100644
--- a/cui/qa/uitest/dialogs/chardlg.py
+++ b/cui/qa/uitest/dialogs/chardlg.py
@@ -106,9 +106,9 @@ class Test(UITestCase):
 portion = portions.nextElement()
 
 # Without the accompanying fix in place, this test would have 
failed with:
-# AssertionError: -1 != 4
+# AssertionError: -1 != 3
 # i.e. no theme index was set, instead of accent1 (index into the 
above color scheme).
-self.assertEqual(portion.CharColorTheme, 4)
+self.assertEqual(portion.CharColorTheme, 3)
 
 # Then make sure that '80% lighter' is lum-mod=2000 and 
lum-off=8000:
 # Without the accompanying fix in place, this test would have 
failed with:
diff --git a/cui/qa/uitest/tabpages/tpcolor.py 
b/cui/qa/uitest/tabpages/tpcolor.py
index ad52711857e4..820ffa634eb1 100644
--- a/cui/qa/uitest/tabpages/tpcolor.py
+++ b/cui/qa/uitest/tabpages/tpcolor.py
@@ -61,9 +61,9 @@ class Test(UITestCase):
 # Then make sure the doc model is updated accordingly:
 shape = drawPage.getByIndex(0)
 # Without the accompanying fix in place, this test would have 
failed with:
-# AssertionError: -1 != 4
+# AssertionError: -1 != 3
 # i.e. the theme metadata of the selected fill color was lost.
-self.assertEqual(shape.FillColorTheme, 4)
+self.assertEqual(shape.FillColorTheme, 3)
 
 
 # vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/svx/source/tbxctrls/PaletteManager.cxx 
b/svx/source/tbxctrls/PaletteManager.cxx
index 9fcefd34d1c8..343448c8e788 100644
--- a/svx/source/tbxctrls/PaletteManager.cxx
+++ b/svx/source/tbxctrls/PaletteManager.cxx
@@ -161,7 +161,11 @@ bool PaletteManager::IsThemePaletteSelected() const
 
 bool PaletteManager::GetThemeAndEffectIndex(sal_uInt16 nItemId, sal_uInt16& 
rThemeIndex, sal_uInt16& rEffectIndex)
 {
- // Each column is the same color with different effects.
+// tdf#157034, nItemId begins with 1 but list of themes begin with 0
+// so decrement nItemId
+--nItemId;
+
+// Each column is the same color with different effects.
 rThemeIndex = nItemId % 12;
 
 rEffectIndex = nItemId / 12;


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

2023-09-04 Thread Samuel Mehrbrodt (via logerrit)
 filter/source/msfilter/msdffimp.cxx |   13 -
 filter/source/msfilter/svdfppt.cxx  |   17 +++--
 sd/qa/unit/data/ppt/tdf48083.ppt|binary
 sd/qa/unit/import-tests2.cxx|   16 +++-
 4 files changed, 34 insertions(+), 12 deletions(-)

New commits:
commit a43f1ac6c964181cbaa4c889409688197cbf7a2b
Author: Samuel Mehrbrodt 
AuthorDate: Mon Sep 4 14:54:38 2023 +0200
Commit: Samuel Mehrbrodt 
CommitDate: Mon Sep 4 19:44:29 2023 +0200

tdf#48083 Import mso_fillBackground from ppt

Change-Id: Ic60fbc5fcfd7b38e7dd594690e5cfe784061a3d9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156517
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt 

diff --git a/filter/source/msfilter/msdffimp.cxx 
b/filter/source/msfilter/msdffimp.cxx
index 8d6f9023ad16..bc28e62e2b16 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -74,6 +74,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1338,6 +1339,7 @@ void DffPropertyReader::ApplyFillAttributes( SvStream& 
rIn, SfxItemSet& rSet, co
 if ( nFillFlags & 0x10 )
 {
 auto eMSO_FillType = GetPropertyValue(DFF_Prop_fillType, 
mso_fillSolid);
+bool bUseSlideBackground = false;
 drawing::FillStyle eXFill = drawing::FillStyle_NONE;
 switch( eMSO_FillType )
 {
@@ -1366,7 +1368,10 @@ void DffPropertyReader::ApplyFillAttributes( SvStream& 
rIn, SfxItemSet& rSet, co
 case mso_fillShadeTitle :   // special type - shade to title 
---  for PP
 eXFill = drawing::FillStyle_GRADIENT;
 break;
-//  case mso_fillBackground :   // Use the background fill 
color/pattern
+case mso_fillBackground :   // Use the background fill 
color/pattern
+eXFill = drawing::FillStyle_NONE;
+bUseSlideBackground = true;
+break;
 default: break;
 }
 rSet.Put( XFillStyleItem( eXFill ) );
@@ -1466,6 +1471,12 @@ void DffPropertyReader::ApplyFillAttributes( SvStream& 
rIn, SfxItemSet& rSet, co
 }
 }
 }
+else if (eXFill == drawing::FillStyle_BITMAP && bUseSlideBackground)
+{
+rSet.Put( XFillStyleItem( drawing::FillStyle_NONE ) );
+XFillUseSlideBackgroundItem aFillBgItem(true);
+rSet.Put(aFillBgItem);
+}
 }
 else
 rSet.Put( XFillStyleItem( drawing::FillStyle_NONE ) );
diff --git a/filter/source/msfilter/svdfppt.cxx 
b/filter/source/msfilter/svdfppt.cxx
index fa4c9c55d7dc..a4442cfb2393 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -53,6 +53,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -2930,17 +2931,13 @@ void SdrPowerPointImport::ImportPage( SdrPage* pRet, 
const PptSlidePersistEntry*
 {
 if 
(!aProcessData.aBackgroundColoredObjects.empty())
 {
-if (!rSlidePersist.pBObj)
+for (auto const & pObject : 
aProcessData.aBackgroundColoredObjects)
 {
-for (auto const & pObject : 
aProcessData.aBackgroundColoredObjects)
-{
-// The shape wants a background, but 
the slide doesn't have
-// one: default to white.
-SfxItemSet 
aNewSet(*pObject->GetMergedItemSet().GetPool());
-
aNewSet.Put(XFillStyleItem(css::drawing::FillStyle_SOLID));
-aNewSet.Put(XFillColorItem(OUString(), 
COL_WHITE));
-pObject->SetMergedItemSet(aNewSet);
-}
+SfxItemSet 
aNewSet(*pObject->GetMergedItemSet().GetPool());
+
aNewSet.Put(XFillStyleItem(css::drawing::FillStyle_NONE));
+XFillUseSlideBackgroundItem 
aFillBgItem(true);
+aNewSet.Put(aFillBgItem);
+pObject->SetMergedItemSet(aNewSet);
 }
 }
 }
diff --git a/sd/qa/unit/data/ppt/tdf48083.ppt b/sd/qa/unit/data/ppt/tdf48083.ppt
new file mode 100644
index ..97ca371d7a55
Binary files /dev/null and b/sd/qa/unit/data/ppt/tdf48083.ppt differ
diff --git a/sd/qa/unit/import-tests2.cxx b/sd/qa/unit/import-tests2.cxx
index 7702e27d715e..525177ba44da 100644
--- a/sd/qa/unit/import-tests2.cxx
+++ b/sd/qa/unit/import-tests2.cxx
@@ -581,7 +581,9 @@ CPPUNIT_TEST_FIXTURE(SdImportTest2, testTdf105150PPT)
 // This 

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

2023-09-04 Thread Khaled Hosny (via logerrit)
 starmath/inc/cursor.hxx|1 
 starmath/source/cursor.cxx |7 
 starmath/source/view.cxx   |   64 -
 3 files changed, 66 insertions(+), 6 deletions(-)

New commits:
commit 065609f86f730d4eedc6b7ae28382dc7daea11ac
Author: Khaled Hosny 
AuthorDate: Mon Sep 4 13:22:04 2023 +0300
Commit: خالد حسني 
CommitDate: Mon Sep 4 19:29:45 2023 +0200

starmath: Make cut/copy/paste buttons work with inline editing

Check for visual cursor selection when in inline editing mode, and update 
edit
window when updating visual cursor.

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

diff --git a/starmath/inc/cursor.hxx b/starmath/inc/cursor.hxx
index 0a8a35071f10..7e1f8ec83c53 100644
--- a/starmath/inc/cursor.hxx
+++ b/starmath/inc/cursor.hxx
@@ -85,6 +85,7 @@ public:
 
 /** True, if the cursor has a selection */
 bool HasSelection() const { return mpAnchor != mpPosition; }
+const ESelection& GetSelection();
 
 /** Move the position of this cursor */
 void Move(OutputDevice* pDev, SmMovementDirection direction, bool 
bMoveAnchor = true);
diff --git a/starmath/source/cursor.cxx b/starmath/source/cursor.cxx
index e8623517bcd7..41506dff3109 100644
--- a/starmath/source/cursor.cxx
+++ b/starmath/source/cursor.cxx
@@ -1141,6 +1141,13 @@ SmNode* SmCursor::FindSelectedNode(SmNode* pNode){
 return nullptr;
 }
 
+const ESelection& SmCursor::GetSelection() {
+const SmNode* pNode = FindSelectedNode(mpTree);
+if (!pNode)
+return mpTree->GetSelection();
+return pNode->GetSelection();
+}
+
 void SmCursor::LineToList(SmStructureNode* pLine, SmNodeList& list){
 for(auto pChild : *pLine)
 {
diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index 85dccb711ec6..22ca4e575d3b 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -368,8 +368,13 @@ bool SmGraphicWidget::MouseButtonDown(const MouseEvent& 
rMEvt)
 if (!pTree)
 return true;
 
+SmEditWindow* pEdit = GetView().GetEditWindow();
+
 if (SmViewShell::IsInlineEditEnabled()) {
-GetCursor().MoveTo(&rDevice, aPos, !rMEvt.IsShift());
+SmCursor& rCursor = GetCursor();
+rCursor.MoveTo(&rDevice, aPos, !rMEvt.IsShift());
+if (pEdit)
+pEdit->SetSelection(rCursor.GetSelection());
 // 'on grab' window events are missing in lok, do it explicitly
 if (comphelper::LibreOfficeKit::isActive())
 SetIsCursorVisible(true);
@@ -383,7 +388,6 @@ bool SmGraphicWidget::MouseButtonDown(const MouseEvent& 
rMEvt)
 if (!pNode)
 return true;
 
-SmEditWindow* pEdit = GetView().GetEditWindow();
 if (!pEdit)
 return true;
 
@@ -713,6 +717,7 @@ bool SmGraphicWidget::KeyInput(const KeyEvent& rKEvt)
 return GetView().KeyInput(rKEvt);
 
 bool bConsumed = true;
+bool bSetSelection = false;
 
 SmCursor& rCursor = GetCursor();
 switch (rKEvt.GetKeyCode().GetFunction())
@@ -737,24 +742,32 @@ bool SmGraphicWidget::KeyInput(const KeyEvent& rKEvt)
 {
 case KEY_LEFT:
 rCursor.Move(&GetOutputDevice(), MoveLeft, 
!rKEvt.GetKeyCode().IsShift());
+bSetSelection = true;
 break;
 case KEY_RIGHT:
 rCursor.Move(&GetOutputDevice(), MoveRight, 
!rKEvt.GetKeyCode().IsShift());
+bSetSelection = true;
 break;
 case KEY_UP:
 rCursor.Move(&GetOutputDevice(), MoveUp, 
!rKEvt.GetKeyCode().IsShift());
+bSetSelection = true;
 break;
 case KEY_DOWN:
 rCursor.Move(&GetOutputDevice(), MoveDown, 
!rKEvt.GetKeyCode().IsShift());
+bSetSelection = true;
 break;
 case KEY_RETURN:
 if (!rKEvt.GetKeyCode().IsShift())
+{
 rCursor.InsertRow();
+bSetSelection = true;
+}
 break;
 case KEY_DELETE:
 if (!rCursor.HasSelection())
 {
 rCursor.Move(&GetOutputDevice(), MoveRight, false);
+bSetSelection = true;
 if (rCursor.HasComplexSelection())
 break;
 }
@@ -762,12 +775,17 @@ bool SmGraphicWidget::KeyInput(const KeyEvent& rKEvt)
 break;
 case KEY_BACKSPACE:
 rCursor.DeletePrev(&GetOutputDevice());
+bSetSelection = true;
 break;
 default:
 if (!CharInput(rKEvt.GetCharCode(), rCursor, 
GetOutputDevice()))
 bConsumed = GetView().KeyInput(rKEvt);
 }
 }
+
+SmEditWindow* pEdit = GetView().GetEditWindow();
+if 

Adam Fallon (adam.eric.fal...@gmail.com) License Statement

2023-09-04 Thread Philip Fallon
Dear Sir,

I am sending this statement as the parent of Adam Fallon as he is below 18.

"All of my past & future contributions to LibreOffice may be licensed under the 
MPLv2/LGPLv3+ dual license.”

Yours sincerely,

Philip G Fallon
(on behalf of Adam Fallon)



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

2023-09-04 Thread Khaled Hosny (via logerrit)
 starmath/inc/visitors.hxx|2 +-
 starmath/source/document.cxx |   24 ++--
 starmath/source/visitors.cxx |8 
 3 files changed, 23 insertions(+), 11 deletions(-)

New commits:
commit f80c2c70756e3620daed6675c8546caca4153d4b
Author: Khaled Hosny 
AuthorDate: Tue Aug 29 20:51:06 2023 +0300
Commit: خالد حسني 
CommitDate: Mon Sep 4 18:18:37 2023 +0200

tdf#134193: Fix inline editing with RTL direction

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

diff --git a/starmath/inc/visitors.hxx b/starmath/inc/visitors.hxx
index c1a2a8983286..338e93432ba1 100644
--- a/starmath/inc/visitors.hxx
+++ b/starmath/inc/visitors.hxx
@@ -219,7 +219,7 @@ public:
 , maPosition( position )
 , mrFormat( rFormat )
 {
-if (mrFormat.IsRightToLeft())
+if (mrFormat.IsRightToLeft() && mrDev.GetOutDevType() != OUTDEV_WINDOW)
 mrDev.ReMirror(maPosition);
 pTree->Accept( this );
 }
diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx
index 9bdaad7530e6..8f8e184470a0 100644
--- a/starmath/source/document.cxx
+++ b/starmath/source/document.cxx
@@ -332,8 +332,10 @@ void SmDocShell::DrawFormula(OutputDevice &rDev, Point 
&rPosition, bool bDrawSel
 rPosition.AdjustY(maFormat.GetDistance( DIS_TOPSPACE  ) );
 
 Point aPosition(rPosition);
-if (bRTL)
-aPosition.AdjustX(GetSize().Width() - 
maFormat.GetDistance(DIS_LEFTSPACE) - maFormat.GetDistance(DIS_RIGHTSPACE));
+if (bRTL && rDev.GetOutDevType() != OUTDEV_WINDOW)
+aPosition.AdjustX(GetSize().Width()
+  - maFormat.GetDistance(DIS_LEFTSPACE)
+  - maFormat.GetDistance(DIS_RIGHTSPACE));
 
 //! in case of high contrast-mode (accessibility option!)
 //! the draw mode needs to be set to default, because when embedding
@@ -353,11 +355,21 @@ void SmDocShell::DrawFormula(OutputDevice &rDev, Point 
&rPosition, bool bDrawSel
   vcl::PushFlags::RTLENABLED);
 
 // We want the device to always be LTR, we handle RTL formulas ourselves.
-rDev.EnableRTL(false);
+if (rDev.GetOutDevType() == OUTDEV_WINDOW)
+rDev.EnableRTL(bRTL);
+else
+rDev.EnableRTL(false);
 
-// For RTL formulas, we want the brackets to be mirrored.
-rDev.SetLayoutMode(bRTL ? vcl::text::ComplexTextLayoutFlags::BiDiRtl
-: vcl::text::ComplexTextLayoutFlags::Default);
+auto nLayoutFlags = vcl::text::ComplexTextLayoutFlags::Default;
+if (bRTL)
+{
+// For RTL formulas, we want the brackets to be mirrored.
+nLayoutFlags |= vcl::text::ComplexTextLayoutFlags::BiDiRtl;
+if (rDev.GetOutDevType() == OUTDEV_WINDOW)
+nLayoutFlags |= vcl::text::ComplexTextLayoutFlags::TextOriginLeft;
+}
+
+rDev.SetLayoutMode(nLayoutFlags);
 
 // Numbers should not be converted, for now.
 rDev.SetDigitLanguage( LANGUAGE_ENGLISH );
diff --git a/starmath/source/visitors.cxx b/starmath/source/visitors.cxx
index cece754de276..732c27f9840f 100644
--- a/starmath/source/visitors.cxx
+++ b/starmath/source/visitors.cxx
@@ -438,7 +438,7 @@ void SmDrawingVisitor::Visit( SmRootSymbolNode* pNode )
 
 tools::Rectangle  aBar( aBarPos, Size( nBarWidth, nBarHeight ) );
 
-if (mrFormat.IsRightToLeft())
+if (mrFormat.IsRightToLeft() && mrDev.GetOutDevType() != OUTDEV_WINDOW)
 mrDev.ReMirror(aBar);
 
 //! avoid GROWING AND SHRINKING of drawn rectangle when constantly
@@ -465,7 +465,7 @@ void SmDrawingVisitor::Visit( SmPolyLineNode* pNode )
+ Point( nBorderwidth, nBorderwidth ) ),
   aPos ( maPosition + aOffset );
 
-if (mrFormat.IsRightToLeft())
+if (mrFormat.IsRightToLeft() && mrDev.GetOutDevType() != OUTDEV_WINDOW)
 mrDev.ReMirror(aPos);
 
 pNode->GetPolygon( ).Move( aPos.X( ), aPos.Y( ) );//Works because 
Polygon wraps a pointer
@@ -497,7 +497,7 @@ void SmDrawingVisitor::Visit( SmRectangleNode* pNode )
 
 SAL_WARN_IF( aTmp.IsEmpty(), "starmath", "Empty rectangle" );
 
-if (mrFormat.IsRightToLeft())
+if (mrFormat.IsRightToLeft() && mrDev.GetOutDevType() != OUTDEV_WINDOW)
 mrDev.ReMirror(aTmp);
 
 //! avoid GROWING AND SHRINKING of drawn rectangle when constantly
@@ -521,7 +521,7 @@ void SmDrawingVisitor::DrawTextNode( SmTextNode* pNode )
 Point  aPos ( maPosition );
 aPos.AdjustY(pNode->GetBaselineOffset( ) );
 
-if (mrFormat.IsRightToLeft())
+if (mrFormat.IsRightToLeft() && mrDev.GetOutDevType() != OUTDEV_WINDOW)
 mrDev.ReMirror(aPos);
 
 // round to pixel coordinate


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

2023-09-04 Thread Khaled Hosny (via logerrit)
 starmath/source/view.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit fe3098b4c4b5b8099e43279044db9ae7a1e0999d
Author: Khaled Hosny 
AuthorDate: Sun Aug 27 15:06:14 2023 +0300
Commit: خالد حسني 
CommitDate: Mon Sep 4 18:18:16 2023 +0200

tdf#134193: Fix RTL selection and cursor handling

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

diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index 6505031f13ba..85dccb711ec6 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -310,6 +310,7 @@ void SmGraphicWidget::SetDrawingArea(weld::DrawingArea* 
pDrawingArea)
 
 OutputDevice& rDevice = GetOutputDevice();
 
+rDevice.EnableRTL(GetDoc()->GetFormat().IsRightToLeft());
 
rDevice.SetBackground(SM_MOD()->GetColorConfig().GetColorValue(svtools::DOCCOLOR).nColor);
 
 if (comphelper::LibreOfficeKit::isActive())
@@ -2073,6 +2074,7 @@ void SmViewShell::Execute(SfxRequest& rReq)
 {
 bool bRTL = rReq.GetSlot() == SID_ATTR_PARA_RIGHT_TO_LEFT;
 GetDoc()->SetRightToLeft(bRTL);
+
GetGraphicWindow().GetGraphicWidget().GetOutputDevice().EnableRTL(bRTL);
 GetViewFrame().GetBindings().Invalidate(bRTL ? 
SID_ATTR_PARA_LEFT_TO_RIGHT : SID_ATTR_PARA_RIGHT_TO_LEFT);
 }
 break;


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

2023-09-04 Thread Khaled Hosny (via logerrit)
 starmath/sdi/smslots.sdi|   10 ++
 starmath/source/view.cxx|   16 
 starmath/uiconfig/smath/toolbar/toolbar.xml |3 +++
 3 files changed, 29 insertions(+)

New commits:
commit b6c30b3d35eb01205acf0271d0192921c60eb73b
Author: Khaled Hosny 
AuthorDate: Wed Aug 16 16:08:49 2023 +0300
Commit: خالد حسني 
CommitDate: Mon Sep 4 18:17:45 2023 +0200

tdf#134193: Allow setting math direction

Add LTR/RTL buttons to the toolbar and make them change the
IsRightToLeft property.

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

diff --git a/starmath/sdi/smslots.sdi b/starmath/sdi/smslots.sdi
index 47468ce5f11d..3f998e8b182b 100644
--- a/starmath/sdi/smslots.sdi
+++ b/starmath/sdi/smslots.sdi
@@ -282,6 +282,16 @@ interface FormulaView
 ExecMethod = Execute ;
 StateMethod = GetState ;
 ]
+SID_ATTR_PARA_LEFT_TO_RIGHT
+[
+ExecMethod = Execute ;
+StateMethod = GetState ;
+]
+SID_ATTR_PARA_RIGHT_TO_LEFT
+[
+ExecMethod = Execute ;
+StateMethod = GetState ;
+]
 }
 
 shell SmViewShell
diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index a71438bc82b5..6505031f13ba 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -2067,6 +2067,15 @@ void SmViewShell::Execute(SfxRequest& rReq)
 aDialog.run();
 }
 break;
+
+case SID_ATTR_PARA_LEFT_TO_RIGHT:
+case SID_ATTR_PARA_RIGHT_TO_LEFT:
+{
+bool bRTL = rReq.GetSlot() == SID_ATTR_PARA_RIGHT_TO_LEFT;
+GetDoc()->SetRightToLeft(bRTL);
+GetViewFrame().GetBindings().Invalidate(bRTL ? 
SID_ATTR_PARA_LEFT_TO_RIGHT : SID_ATTR_PARA_RIGHT_TO_LEFT);
+}
+break;
 }
 rReq.Done();
 }
@@ -2155,6 +2164,13 @@ void SmViewShell::GetState(SfxItemSet &rSet)
 rSet.Put(SfxBoolItem(SID_ELEMENTSDOCKINGWINDOW, bState));
 }
 break;
+case SID_ATTR_PARA_LEFT_TO_RIGHT:
+rSet.Put(SfxBoolItem(nWh, !GetDoc()->GetFormat().IsRightToLeft()));
+break;
+
+case SID_ATTR_PARA_RIGHT_TO_LEFT:
+rSet.Put(SfxBoolItem(nWh, GetDoc()->GetFormat().IsRightToLeft()));
+break;
 }
 }
 }
diff --git a/starmath/uiconfig/smath/toolbar/toolbar.xml 
b/starmath/uiconfig/smath/toolbar/toolbar.xml
index 7501380c4383..2a093f9bb6e0 100644
--- a/starmath/uiconfig/smath/toolbar/toolbar.xml
+++ b/starmath/uiconfig/smath/toolbar/toolbar.xml
@@ -26,4 +26,7 @@
  
  
  
+ 
+ 
+ 
 


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

2023-09-04 Thread Khaled Hosny (via logerrit)
 include/vcl/outdev.hxx|6 ++--
 starmath/inc/visitors.hxx |7 -
 starmath/source/ElementsDockingWindow.cxx |2 -
 starmath/source/document.cxx  |   41 ++
 starmath/source/visitors.cxx  |   15 ++
 5 files changed, 56 insertions(+), 15 deletions(-)

New commits:
commit fb43c497f2cc71c988a967fa0126c27561f8c16d
Author: Khaled Hosny 
AuthorDate: Wed Aug 16 15:17:41 2023 +0300
Commit: خالد حسني 
CommitDate: Mon Sep 4 18:17:15 2023 +0200

tdf#134193: Support rendering math in RTL mode

Respect IsRightToLeft property and render accordingly.

This also fixes math rendering in RTL UI, which was incorrectly rendered 
RTL.

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

diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index 898939978daa..f2fdf7ab7db7 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -1217,9 +1217,9 @@ public:
 
 // tells whether this output device is RTL in an LTR UI or LTR in a RTL UI
 SAL_DLLPRIVATE bool ImplIsAntiparallel() const ;
-SAL_DLLPRIVATE void ReMirror( Point &rPoint ) const;
-SAL_DLLPRIVATE void ReMirror( tools::Rectangle &rRect ) const;
-SAL_DLLPRIVATE void ReMirror( vcl::Region &rRegion ) const;
+   void ReMirror( Point &rPoint ) const;
+   void ReMirror( tools::Rectangle &rRect ) const;
+   void ReMirror( vcl::Region &rRegion ) const;
 SAL_DLLPRIVATE bool ImplIsRecordLayout() const;
 virtual boolHasMirroredGraphics() const;
 std::unique_ptr
diff --git a/starmath/inc/visitors.hxx b/starmath/inc/visitors.hxx
index eaf329034c7d..c1a2a8983286 100644
--- a/starmath/inc/visitors.hxx
+++ b/starmath/inc/visitors.hxx
@@ -211,12 +211,16 @@ public:
  * @param rDevice   Device to draw on
  * @param position  Offset on device to draw the formula
  * @param pTree Formula tree to draw
+ * @param rFormat   Formula formatting settings
  * @remarks This constructor will do the drawing, no need to anything more.
  */
-SmDrawingVisitor( OutputDevice &rDevice, Point position, SmNode* pTree )
+SmDrawingVisitor( OutputDevice &rDevice, Point position, SmNode* pTree, 
const SmFormat& rFormat )
 : mrDev( rDevice )
 , maPosition( position )
+, mrFormat( rFormat )
 {
+if (mrFormat.IsRightToLeft())
+mrDev.ReMirror(maPosition);
 pTree->Accept( this );
 }
 virtual ~SmDrawingVisitor() {}
@@ -265,6 +269,7 @@ private:
 so if needed cache it locally on the stack.
  */
 Point maPosition;
+const SmFormat& mrFormat;
 };
 
 // SmSetSelectionVisitor
diff --git a/starmath/source/ElementsDockingWindow.cxx 
b/starmath/source/ElementsDockingWindow.cxx
index 7fdfb3b3ec49..d1feabd921a9 100644
--- a/starmath/source/ElementsDockingWindow.cxx
+++ b/starmath/source/ElementsDockingWindow.cxx
@@ -546,7 +546,7 @@ void SmElementsControl::addElement(const OUString& 
aElementVisual, const OUStrin
 Size aSize = pDevice->LogicToPixel(Size(pNode->GetWidth(), 
pNode->GetHeight()));
 aSize.extendBy(10, 0); // Add 5 pixels from both sides to accommodate 
extending parts of italics
 pDevice->SetOutputSizePixel(aSize);
-SmDrawingVisitor(*pDevice, pDevice->PixelToLogic(Point(5, 0)), 
pNode.get());
+SmDrawingVisitor(*pDevice, pDevice->PixelToLogic(Point(5, 0)), 
pNode.get(), maFormat);
 
 maItemDatas.push_back(std::make_unique(aElementSource, 
aHelpText));
 const OUString aId(weld::toId(maItemDatas.back().get()));
diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx
index c0f28ac18190..9bdaad7530e6 100644
--- a/starmath/source/document.cxx
+++ b/starmath/source/document.cxx
@@ -261,10 +261,18 @@ void SmDocShell::ArrangeFormula()
 const SmFormat &rFormat = GetFormat();
 mpTree->Prepare(rFormat, *this, 0);
 
-// format/draw formulas always from left to right,
-// and numbers should not be converted
-pOutDev->Push(vcl::PushFlags::TEXTLAYOUTMODE | 
vcl::PushFlags::TEXTLANGUAGE);
-pOutDev->SetLayoutMode( vcl::text::ComplexTextLayoutFlags::Default );
+pOutDev->Push(vcl::PushFlags::TEXTLAYOUTMODE | 
vcl::PushFlags::TEXTLANGUAGE |
+  vcl::PushFlags::RTLENABLED);
+
+// We want the device to always be LTR, we handle RTL formulas ourselves.
+pOutDev->EnableRTL(false);
+
+// For RTL formulas, we want the brackets to be mirrored.
+bool bRTL = GetFormat().IsRightToLeft();
+pOutDev->SetLayoutMode(bRTL ? vcl::text::ComplexTextLayoutFlags::BiDiRtl
+: vcl::text::ComplexTextLayoutFlags::Default);
+
+// Numbers should not be converted, for now.
 

[Libreoffice-commits] core.git: offapi/com starmath/inc starmath/source

2023-09-04 Thread Khaled Hosny (via logerrit)
 offapi/com/sun/star/formula/FormulaProperties.idl |6 ++
 starmath/inc/document.hxx |2 ++
 starmath/inc/format.hxx   |4 
 starmath/source/cfgitem.cxx   |7 +++
 starmath/source/document.cxx  |   18 ++
 starmath/source/format.cxx|4 +++-
 starmath/source/mathml/mathmlexport.cxx   |   21 -
 starmath/source/unomodel.cxx  |   10 ++
 8 files changed, 66 insertions(+), 6 deletions(-)

New commits:
commit 5c5c71266ff14493975f20ff5807f31565a3f909
Author: Khaled Hosny 
AuthorDate: Wed Aug 16 15:08:33 2023 +0300
Commit: خالد حسني 
CommitDate: Mon Sep 4 18:15:50 2023 +0200

tdf#134193: Add the ability to set RTL math direction

This adds a new IsRightToLeft document property, reads/writes it, and
sets dir="rtl" on the top level MathML  element if set to true.

Rendering will be handled in next commits.

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

diff --git a/offapi/com/sun/star/formula/FormulaProperties.idl 
b/offapi/com/sun/star/formula/FormulaProperties.idl
index 204e06f50ba0..79ab4e7244bc 100644
--- a/offapi/com/sun/star/formula/FormulaProperties.idl
+++ b/offapi/com/sun/star/formula/FormulaProperties.idl
@@ -282,6 +282,12 @@ published service FormulaProperties
 @since OOo 3.4
  */
 [property, optional] shortBaseLine;
+
+/** switches into right-to-left layout.
+
+@since LibreOffice 24.2
+ */
+[property, optional] boolean  IsRightToLeft;
 };
 
 
diff --git a/starmath/inc/document.hxx b/starmath/inc/document.hxx
index bf9477b30f11..45321614385a 100644
--- a/starmath/inc/document.hxx
+++ b/starmath/inc/document.hxx
@@ -222,6 +222,8 @@ public:
 mathml::SmMlIteratorFree(m_pMlElementTree);
 m_pMlElementTree = pMlElementTree;
 }
+
+void SetRightToLeft(bool bRTL);
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/starmath/inc/format.hxx b/starmath/inc/format.hxx
index 23dc04d290cf..5845d148e7fa 100644
--- a/starmath/inc/format.hxx
+++ b/starmath/inc/format.hxx
@@ -98,6 +98,7 @@ class SM_DLLPUBLIC SmFormat final : public SfxBroadcaster
 SmHorAlign  eHorAlign;
 sal_Int16   nGreekCharStyle;
 boolbIsTextmode,
+bIsRightToLeft,
 bScaleNormalBrackets;
 
 public:
@@ -126,6 +127,9 @@ public:
 boolIsTextmode() const { return bIsTextmode; }
 voidSetTextmode(bool bVal) { bIsTextmode = bVal; }
 
+boolIsRightToLeft() const { return bIsRightToLeft; }
+voidSetRightToLeft(bool bVal) { bIsRightToLeft = bVal; }
+
 sal_Int16   GetGreekCharStyle() const { return nGreekCharStyle; }
 voidSetGreekCharStyle(sal_Int16 nVal) { nGreekCharStyle = 
nVal; }
 
diff --git a/starmath/source/cfgitem.cxx b/starmath/source/cfgitem.cxx
index 2146c366cd1e..6e27a0168e8b 100644
--- a/starmath/source/cfgitem.cxx
+++ b/starmath/source/cfgitem.cxx
@@ -91,6 +91,7 @@ static Sequence< OUString > lcl_GetFormatPropertyNames()
 //! see respective load/save routines here
 return Sequence< OUString > {
 "StandardFormat/Textmode",
+"StandardFormat/RightToLeft",
 "StandardFormat/GreekCharStyle",
 "StandardFormat/ScaleNormalBracket",
 "StandardFormat/HorizontalAlignment",
@@ -983,6 +984,10 @@ void SmMathConfig::LoadFormat()
 if (pVal->hasValue()  &&  (*pVal >>= bTmp))
 pFormat->SetTextmode( bTmp );
 ++pVal;
+// StandardFormat/RightToLeft
+if (pVal->hasValue()  &&  (*pVal >>= bTmp))
+pFormat->SetRightToLeft( bTmp );
+++pVal;
 // StandardFormat/GreekCharStyle
 if (pVal->hasValue()  &&  (*pVal >>= nTmp16))
 pFormat->SetGreekCharStyle( nTmp16 );
@@ -1061,6 +1066,8 @@ void SmMathConfig::SaveFormat()
 
 // StandardFormat/Textmode
 *pValue++ <<= pFormat->IsTextmode();
+// StandardFormat/RightToLeft
+*pValue++ <<= pFormat->IsRightToLeft();
 // StandardFormat/GreekCharStyle
 *pValue++ <<= pFormat->GetGreekCharStyle();
 // StandardFormat/ScaleNormalBracket
diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx
index 5c09cf40d3c0..c0f28ac18190 100644
--- a/starmath/source/document.cxx
+++ b/starmath/source/document.cxx
@@ -1219,4 +1219,22 @@ bool SmDocShell::WriteAsMathType3( SfxMedium& rMedium )
 return aEquation.ConvertFromStarMath( rMedium );
 }
 
+void SmDocShell::SetRightToLeft(bool bRTL)
+{
+SmFormat aOldFormat = GetFormat();
+if (aOldFormat.IsRightToLeft() == bRTL)
+return;
+
+SmFormat aNewFormat(aOldFormat);
+aNewFormat.SetRigh

Re: new bridgetest failures in 7.6 on ppc64le/s390x (was: Re: new bridgetest failures in 7.6 on ppc64le)

2023-09-04 Thread Rene Engelhard

Hi,

Am 04.09.23 um 14:23 schrieb Dan Horák:

for the record, we haven't seen this issue on s390x in Fedora, only on
ppc64le.


Interesting. (Note that I don't run "all the other tests" on 
!amd64/!arm64/!armhf because of the sysiphos work dealt with in the 
other  thread, but just testtools and the sal, cppuhelper etc. tests)



The revert only works around the actual problem, because the Java
bridge tests aren't run any more for "make unitcheck", but the real
issue is still there.


Yeah, got it.


That's why I didn't apply the revert directly to my packages. Better is 
to fix it indeed.



Regards,


Rene




Dan


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

2023-09-04 Thread Seth Chaiklin (via logerrit)
 sfx2/uiconfig/ui/managestylepage.ui |  138 ++--
 1 file changed, 69 insertions(+), 69 deletions(-)

New commits:
commit e3d13aaf1a22edbbdb988538daa20ff4e140e845
Author: Seth Chaiklin 
AuthorDate: Mon Sep 4 11:18:04 2023 +0200
Commit: Seth Chaiklin 
CommitDate: Mon Sep 4 17:28:44 2023 +0200

bump to glade 3.40

Change-Id: I3a40bce7391fef9228fa63b225e4d4fe89a9b928
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156445
Tested-by: Jenkins
Reviewed-by: Seth Chaiklin 

diff --git a/sfx2/uiconfig/ui/managestylepage.ui 
b/sfx2/uiconfig/ui/managestylepage.ui
index 676c00e689ad..b4583292f09c 100644
--- a/sfx2/uiconfig/ui/managestylepage.ui
+++ b/sfx2/uiconfig/ui/managestylepage.ui
@@ -1,174 +1,174 @@
 
-
+
 
   
   
 True
-False
+False
 True
-6
+6
 vertical
 12
 
   
 True
-False
+False
 True
-0
-none
+0
+none
 
-  
+  
   
 True
-False
-True
-6
-12
+False
 12
 6
+True
+6
+12
 
   
 True
-False
+False
 _Name:
-True
-name
+True
+name
 1
   
   
-0
-0
+0
+0
   
 
 
   
 True
-False
+False
 Ne_xt style:
-True
-nextstyle
+True
+nextstyle
 1
   
   
-0
-2
+0
+2
   
 
 
   
 True
-False
+False
 Inherit from:
-True
-linkedwith
+True
+linkedwith
 1
   
   
-0
-3
+0
+3
   
 
 
   
 True
-False
+False
 _Category:
-True
-category
+True
+category
 1
   
   
-0
-4
+0
+4
   
 
 
   
 True
-False
+False
 center
 True
   
   
-1
-2
+1
+2
   
 
 
   
 Edit Style
 True
-True
-False
+True
+False
   
   
-2
-2
+2
+2
   
 
 
   
 True
-False
+False
 center
 True
   
   
-1
-3
+1
+3
   
 
 
   
 Edit Style
 True
-True
-False
+True
+False
   
   
-2
-3
+2
+3
   
 
 
   
 True
-False
+False
 center
 True
   
   
-1
-4
+1
+4
   
 
 
   
 _AutoUpdate
-True
-False
-True
-True
-True
+True
+False
+True
+True
+True
   
   
-1
-1
+1
+1
   
 
 
   
 True
-False
+False
 center
 True
 False
+52
 True
-52
   
   
-1
-0
+1
+0
   
 
 
@@ -1

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

2023-09-04 Thread Miklos Vajna (via logerrit)
 sw/qa/core/objectpositioning/data/floattable-vert-orient-top.odt   |binary
 sw/qa/core/objectpositioning/objectpositioning.cxx |   24 
++
 sw/source/core/inc/frame.hxx   |2 
 sw/source/core/layout/findfrm.cxx  |   10 
 sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx |5 +-
 5 files changed, 40 insertions(+), 1 deletion(-)

New commits:
commit 38192482e552195a5c76a6e40fc3586cc6f0355c
Author: Miklos Vajna 
AuthorDate: Fri Sep 1 08:51:20 2023 +0200
Commit: Xisco Fauli 
CommitDate: Mon Sep 4 17:26:09 2023 +0200

Related: tdf#156318 sw floattable: fix handling of vert orient == top

The bugdoc resulted in a layout loop on load. It was created by forcing
pages to be in a single column + increasing the top+bottom margin of the
page to 2.5cm.

The problem was that the SwFormatVertOrient's m_eOrient is usually
text::VertOrientation::NONE ("from top" with 0 offset), but here it's
text::VertOrientation::TOP. These are meant to be more or less
equivalent, but SwToContentAnchoredObjectPosition::CalcPosition() has
different codepath for them.

Fix the problem by making sure that TOP doesn't have a vertical offset
for follow fly frame: do this by realizing that in case the "orient
frame" and the "anchor" is not the same that may need no action, since
the fly frame case changes the "orient" to the follow anchor and the
"anchor" is the master anchor.

The original scenario still needs more work, we don't hang anymore but
the follow fly appears on page 3 instead of page 2.

Change-Id: I1596a07b78575583070d494ddb8e1400e5653820
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156392
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins
(cherry picked from commit 7d4213b9f0253b323750acceca8f4edb9d1a7fc5)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156530
Reviewed-by: Xisco Fauli 

diff --git a/sw/qa/core/objectpositioning/data/floattable-vert-orient-top.odt 
b/sw/qa/core/objectpositioning/data/floattable-vert-orient-top.odt
new file mode 100644
index ..b10f0b7188fa
Binary files /dev/null and 
b/sw/qa/core/objectpositioning/data/floattable-vert-orient-top.odt differ
diff --git a/sw/qa/core/objectpositioning/objectpositioning.cxx 
b/sw/qa/core/objectpositioning/objectpositioning.cxx
index 4958b8b6deb4..611ce1294c22 100644
--- a/sw/qa/core/objectpositioning/objectpositioning.cxx
+++ b/sw/qa/core/objectpositioning/objectpositioning.cxx
@@ -313,6 +313,30 @@ CPPUNIT_TEST_FIXTURE(SwCoreObjectpositioningTest, 
testFloatingTableOverlapNever)
 CPPUNIT_ASSERT_GREATER(pFlyFrame1->getFrameArea().Bottom(), 
pFlyFrame2->getFrameArea().Top());
 }
 
+CPPUNIT_TEST_FIXTURE(SwCoreObjectpositioningTest, 
testFloatingTableVertOrientTop)
+{
+// Given a document with a vert-orient=from-top anchored floating table:
+createSwDoc("floattable-vert-orient-top.odt");
+
+// When laying out that document:
+calcLayout();
+
+// Then make sure we correctly split the table to two pages:
+// Without the accompanying fix in place, this test would have produced a 
layout loop.
+SwDoc* pDoc = getSwDoc();
+SwRootFrame* pLayout = pDoc->getIDocumentLayoutAccess().GetCurrentLayout();
+auto pPage1 = pLayout->Lower()->DynCastPageFrame();
+CPPUNIT_ASSERT(pPage1);
+CPPUNIT_ASSERT(pPage1->GetSortedObjs());
+const SwSortedObjs& rPage1Objs = *pPage1->GetSortedObjs();
+CPPUNIT_ASSERT_EQUAL(static_cast(1), rPage1Objs.size());
+auto pPage2 = pPage1->GetNext()->DynCastPageFrame();
+CPPUNIT_ASSERT(pPage2);
+CPPUNIT_ASSERT(pPage2->GetSortedObjs());
+const SwSortedObjs& rPage2Objs = *pPage2->GetSortedObjs();
+CPPUNIT_ASSERT_EQUAL(static_cast(1), rPage2Objs.size());
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx
index ec47266ec468..885a0d223f24 100644
--- a/sw/source/core/inc/frame.hxx
+++ b/sw/source/core/inc/frame.hxx
@@ -874,6 +874,8 @@ public:
 inline bool IsTextFrame() const;
 SwTextFrame* DynCastTextFrame();
 const SwTextFrame* DynCastTextFrame() const;
+SwPageFrame* DynCastPageFrame();
+const SwPageFrame* DynCastPageFrame() const;
 inline bool IsNoTextFrame() const;
 // Frames where its PrtArea depends on their neighbors and that are
 // positioned in the content flow
diff --git a/sw/source/core/layout/findfrm.cxx 
b/sw/source/core/layout/findfrm.cxx
index 1a98f6cf6747..5331baacd93e 100644
--- a/sw/source/core/layout/findfrm.cxx
+++ b/sw/source/core/layout/findfrm.cxx
@@ -1944,4 +1944,14 @@ const SwTextFrame* SwFrame::DynCastTextFrame() const
 return IsTextFrame() ? static_cast(this) : nullptr;
 }
 
+SwPageFrame* SwFrame::DynCastPageFrame()
+{
+return IsPageFrame() ? static_cast(this) : nullptr;

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

2023-09-04 Thread Miklos Vajna (via logerrit)
 include/svx/svdglue.hxx   |   10 +-
 svx/source/svdraw/svdglue.cxx |   22 +++---
 2 files changed, 16 insertions(+), 16 deletions(-)

New commits:
commit 9bb4fa71c230a34a07ea9b7c4e4f13f4d3f7b5fe
Author: Miklos Vajna 
AuthorDate: Mon Sep 4 08:29:26 2023 +0200
Commit: Miklos Vajna 
CommitDate: Mon Sep 4 16:27:30 2023 +0200

svx: prefix members of SdrGluePointList

See tdf#94879 for motivation.

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

diff --git a/include/svx/svdglue.hxx b/include/svx/svdglue.hxx
index acdebd0bf4ea..234ecf08cdd0 100644
--- a/include/svx/svdglue.hxx
+++ b/include/svx/svdglue.hxx
@@ -182,7 +182,7 @@ public:
 
 class SVXCORE_DLLPUBLIC SdrGluePointList
 {
-std::vector aList;
+std::vector m_aList;
 public:
 SdrGluePointList() {};
 SdrGluePointList(const SdrGluePointList& rSrcList)
@@ -193,22 +193,22 @@ public:
 SdrGluePointList& operator=(const SdrGluePointList& rSrcList);
 sal_uInt16 GetCount() const
 {
-return sal_uInt16(aList.size());
+return sal_uInt16(m_aList.size());
 }
 // At insert, the object (GluePoint) automatically gets an ID assigned.
 // Return value is the index of the new GluePoint in the list.
 sal_uInt16 Insert(const SdrGluePoint& rGP);
 void Delete(sal_uInt16 nPos)
 {
-aList.erase(aList.begin() + nPos);
+m_aList.erase(m_aList.begin() + nPos);
 }
 SdrGluePoint& operator[](sal_uInt16 nPos)
 {
-return aList[nPos];
+return m_aList[nPos];
 }
 const SdrGluePoint& operator[](sal_uInt16 nPos) const
 {
-return aList[nPos];
+return m_aList[nPos];
 }
 sal_uInt16 FindGluePoint(sal_uInt16 nId) const;
 sal_uInt16 HitTest(const Point& rPnt, const OutputDevice& rOut, const 
SdrObject* pObj) const;
diff --git a/svx/source/svdraw/svdglue.cxx b/svx/source/svdraw/svdglue.cxx
index 471089f3763c..c27fc2e2bde9 100644
--- a/svx/source/svdraw/svdglue.cxx
+++ b/svx/source/svdraw/svdglue.cxx
@@ -282,7 +282,7 @@ bool SdrGluePoint::IsHit(const Point& rPnt, const 
OutputDevice& rOut, const SdrO
 
 SdrGluePointList& SdrGluePointList::operator=(const SdrGluePointList& rSrcList)
 {
-if (GetCount()!=0) aList.clear();
+if (GetCount()!=0) m_aList.clear();
 sal_uInt16 nCount=rSrcList.GetCount();
 for (sal_uInt16 i=0; i=nCount,"SdrGluePointList::Insert(): nLastIdnCount;
 if (nId<=nLastId) {
@@ -307,7 +307,7 @@ sal_uInt16 SdrGluePointList::Insert(const SdrGluePoint& rGP)
 } else {
 bool bBrk = false;
 for (sal_uInt16 nNum=0; nNum0) && nRet==SDRGLUEPOINT_NOTFOUND) {
 nNum--;
-const auto& pGP = aList[nNum];
+const auto& pGP = m_aList[nNum];
 if (pGP.IsHit(rPnt,rOut,pObj))
 nRet = nNum;
 }
@@ -362,13 +362,13 @@ sal_uInt16 SdrGluePointList::HitTest(const Point& rPnt, 
const OutputDevice& rOut
 
 void SdrGluePointList::SetReallyAbsolute(bool bOn, const SdrObject& rObj)
 {
-for (auto& xGP : aList)
+for (auto& xGP : m_aList)
 xGP.SetReallyAbsolute(bOn,rObj);
 }
 
 void SdrGluePointList::Rotate(const Point& rRef, Degree100 nAngle, double sn, 
double cs, const SdrObject* pObj)
 {
-for (auto& xGP : aList)
+for (auto& xGP : m_aList)
 xGP.Rotate(rRef,nAngle,sn,cs,pObj);
 }
 
@@ -381,13 +381,13 @@ void SdrGluePointList::Mirror(const Point& rRef1, const 
Point& rRef2, const SdrO
 
 void SdrGluePointList::Mirror(const Point& rRef1, const Point& rRef2, 
Degree100 nAngle, const SdrObject* pObj)
 {
-for (auto& xGP : aList)
+for (auto& xGP : m_aList)
 xGP.Mirror(rRef1,rRef2,nAngle,pObj);
 }
 
 void SdrGluePointList::Shear(const Point& rRef, double tn, bool bVShear, const 
SdrObject* pObj)
 {
-for (auto& xGP : aList)
+for (auto& xGP : m_aList)
 xGP.Shear(rRef,tn,bVShear,pObj);
 }
 


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

2023-09-04 Thread Xisco Fauli (via logerrit)
 sc/qa/unit/ucalc_formula2.cxx |   21 +
 1 file changed, 21 insertions(+)

New commits:
commit 2ac7d339a97efa638124c2862551e0876487833b
Author: Xisco Fauli 
AuthorDate: Mon Sep 4 10:28:57 2023 +0200
Commit: Xisco Fauli 
CommitDate: Mon Sep 4 16:12:30 2023 +0200

tdf#156985: sc_ucalc_formula2: Add unittest

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

diff --git a/sc/qa/unit/ucalc_formula2.cxx b/sc/qa/unit/ucalc_formula2.cxx
index 14f0001f943d..3b068348685a 100644
--- a/sc/qa/unit/ucalc_formula2.cxx
+++ b/sc/qa/unit/ucalc_formula2.cxx
@@ -4606,6 +4606,27 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testTdf147398)
 m_pDoc->DeleteTab(0);
 }
 
+#if !defined(_WIN32)
+CPPUNIT_TEST_FIXTURE(TestFormula2, testTdf156985)
+{
+m_pDoc->InsertTab(0, "Test");
+
+m_pDoc->SetString(0, 0, 0, "=-170.87");
+m_pDoc->SetString(0, 1, 0, "-223.73");
+m_pDoc->SetString(0, 2, 0, "-12.58");
+m_pDoc->SetString(0, 3, 0, "234.98");
+m_pDoc->SetString(0, 4, 0, "172.2");
+m_pDoc->SetString(0, 5, 0, "=SUM(A1:A5)");
+
+// Without the fix in place, this test would have failed with
+// - Expected: 0
+// - Actual  : -1.59872115546023e-14
+CPPUNIT_ASSERT_EQUAL(0.0, m_pDoc->GetValue(0, 5, 0));
+
+m_pDoc->DeleteTab(0);
+}
+#endif
+
 CPPUNIT_TEST_FIXTURE(TestFormula2, testFormulaAfterDeleteRows)
 {
 sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.


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

2023-09-04 Thread Samuel Mehrbrodt (via logerrit)
 include/svx/sidebar/AreaPropertyPanelBase.hxx |6 
 include/vcl/EnumContext.hxx   |1 
 svx/source/sidebar/area/AreaPropertyPanelBase.cxx |   27 ++
 vcl/source/window/EnumContext.cxx |5 
 4 files changed, 39 insertions(+)

New commits:
commit d4cebb60c7757086fd737e7a2134326209bd4190
Author: Samuel Mehrbrodt 
AuthorDate: Mon Sep 4 13:17:15 2023 +0200
Commit: Samuel Mehrbrodt 
CommitDate: Mon Sep 4 16:10:41 2023 +0200

tdf#154875 "Use slide background" is only for Impress

Change-Id: I078437a1cff58b868f4db4b482ad2aff335dc965
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156514
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt 

diff --git a/include/svx/sidebar/AreaPropertyPanelBase.hxx 
b/include/svx/sidebar/AreaPropertyPanelBase.hxx
index c2c967a8333b..07a5873acf53 100644
--- a/include/svx/sidebar/AreaPropertyPanelBase.hxx
+++ b/include/svx/sidebar/AreaPropertyPanelBase.hxx
@@ -20,6 +20,7 @@
 #define INCLUDED_SVX_SOURCE_SIDEBAR_AREA_AREAPROPERTYPANELBASE_HXX
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -33,6 +34,7 @@
 #include 
 #include 
 #include 
+#include 
 
 class ToolbarUnoDispatcher;
 class XFillFloatTransparenceItem;
@@ -48,6 +50,7 @@ namespace svx::sidebar {
 
 class SVX_DLLPUBLIC AreaPropertyPanelBase
 :   public PanelLayout,
+public ::sfx2::sidebar::IContextChangeReceiver,
 public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
 {
 public:
@@ -99,9 +102,11 @@ public:
 
 private:
 void Initialize();
+virtual void HandleContextChange(const vcl::EnumContext& rContext) 
override;
 
 protected:
 const css::uno::Reference&  mxFrame;
+vcl::EnumContextmaContext;
 
 sal_uInt16  meLastXFS;
 
@@ -109,6 +114,7 @@ protected:
 sal_Int32   mnLastPosBitmap;
 sal_Int32   mnLastPosPattern;
 sal_uInt16  mnLastTransSolid;
+OUStringmsUseBackgroundText;
 
 basegfx::BGradient  maGradientLinear;
 basegfx::BGradient  maGradientAxial;
diff --git a/include/vcl/EnumContext.hxx b/include/vcl/EnumContext.hxx
index 9d82e72adc9d..b8e02efd1f68 100644
--- a/include/vcl/EnumContext.hxx
+++ b/include/vcl/EnumContext.hxx
@@ -128,6 +128,7 @@ public:
 */
 sal_Int32 GetCombinedContext_DI() const;
 
+Application GetApplication() const;
 Application GetApplication_DI() const;
 
 bool operator == (const EnumContext& rOther) const;
diff --git a/svx/source/sidebar/area/AreaPropertyPanelBase.cxx 
b/svx/source/sidebar/area/AreaPropertyPanelBase.cxx
index 9adff2c65dfd..05f4c100d71c 100644
--- a/svx/source/sidebar/area/AreaPropertyPanelBase.cxx
+++ b/svx/source/sidebar/area/AreaPropertyPanelBase.cxx
@@ -1392,6 +1392,33 @@ basegfx::BColorStops 
AreaPropertyPanelBase::createColorStops()
 return aColorStops;
 }
 
+void AreaPropertyPanelBase::HandleContextChange(
+const vcl::EnumContext& rContext)
+{
+if (maContext.GetApplication() == rContext.GetApplication())
+return;
+
+maContext = rContext;
+
+switch (maContext.GetApplication())
+{
+case vcl::EnumContext::Application::Impress:
+if (!msUseBackgroundText.isEmpty())
+{
+mxLbFillType->insert_text(USE_BACKGROUND, msUseBackgroundText);
+msUseBackgroundText = OUString();
+}
+break;
+default:
+if (msUseBackgroundText.isEmpty())
+{
+msUseBackgroundText = mxLbFillType->get_text(USE_BACKGROUND);
+mxLbFillType->remove(USE_BACKGROUND);
+}
+break;
+}
+}
+
 } // end of namespace svx::sidebar
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/EnumContext.cxx 
b/vcl/source/window/EnumContext.cxx
index 6ca075eb6943..ffe065568282 100644
--- a/vcl/source/window/EnumContext.cxx
+++ b/vcl/source/window/EnumContext.cxx
@@ -60,6 +60,11 @@ sal_Int32 EnumContext::GetCombinedContext_DI() const
 return CombinedEnumContext(GetApplication_DI(), meContext);
 }
 
+EnumContext::Application EnumContext::GetApplication() const
+{
+ return meApplication;
+}
+
 EnumContext::Application EnumContext::GetApplication_DI() const
 {
  switch (meApplication)


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

2023-09-04 Thread Adam Seskunas (via logerrit)
 formula/source/ui/dlg/parawin.cxx|2 +-
 framework/source/fwe/classes/addonsoptions.cxx   |2 +-
 framework/source/uielement/controlmenucontroller.cxx |2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit b1b002c293ddf38be125dc9083f41eb27452c450
Author: Adam Seskunas 
AuthorDate: Thu Aug 31 14:14:03 2023 -0700
Commit: Hossein 
CommitDate: Mon Sep 4 15:50:51 2023 +0200

tdf#147021 use std::size instead of SAL_N_ELEMENTS

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

diff --git a/formula/source/ui/dlg/parawin.cxx 
b/formula/source/ui/dlg/parawin.cxx
index f09c0e51ec01..bcc1c2d1a962 100644
--- a/formula/source/ui/dlg/parawin.cxx
+++ b/formula/source/ui/dlg/parawin.cxx
@@ -496,7 +496,7 @@ IMPL_LINK( ParaWin, GetFxHdl, ArgInput&, rPtr, void )
 {
 sal_uInt16 nOffset = GetSliderPos();
 nEdFocus=NOT_FOUND;
-for (size_t nPos=0; nPos < SAL_N_ELEMENTS(aArgInput); ++nPos)
+for (size_t nPos=0; nPos < std::size(aArgInput); ++nPos)
 {
 if(&rPtr == &aArgInput[nPos])
 {
diff --git a/framework/source/fwe/classes/addonsoptions.cxx 
b/framework/source/fwe/classes/addonsoptions.cxx
index d35b9a34c69e..cd384c737aa7 100644
--- a/framework/source/fwe/classes/addonsoptions.cxx
+++ b/framework/source/fwe/classes/addonsoptions.cxx
@@ -1594,7 +1594,7 @@ void AddonsOptions_Impl::ReadAndAssociateImages( const 
OUString& aURL, const OUS
 
 // Loop to create the two possible image names and try to read the bitmap 
files
 static const char* aExtArray[] = { "_16", "_26" };
-for ( size_t i = 0; i < SAL_N_ELEMENTS(aExtArray); i++ )
+for ( size_t i = 0; i < std::size(aExtArray); i++ )
 {
 OUStringBuffer aFileURL( aImageURL );
 aFileURL.appendAscii( aExtArray[i] );
diff --git a/framework/source/uielement/controlmenucontroller.cxx 
b/framework/source/uielement/controlmenucontroller.cxx
index afbf3ec9258d..b6dd84e069ce 100644
--- a/framework/source/uielement/controlmenucontroller.cxx
+++ b/framework/source/uielement/controlmenucontroller.cxx
@@ -188,7 +188,7 @@ void 
ControlMenuController::updateImagesPopupMenu(Reference con
 {
 if (!rPopupMenu)
 return;
-for (size_t i=0; i < SAL_N_ELEMENTS(aCommands); ++i)
+for (size_t i=0; i < std::size(aCommands); ++i)
 {
 sal_Int16 nItemId = i + 1;
 if (m_bShowMenuImages)


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

2023-09-04 Thread Aron Budea (via logerrit)
 sc/source/ui/view/tabview2.cxx |   10 ++
 1 file changed, 2 insertions(+), 8 deletions(-)

New commits:
commit 4d8cff696cfdb23733b0e91348b28a83f1c3bedc
Author: Aron Budea 
AuthorDate: Mon Sep 4 03:15:13 2023 +0200
Commit: Henry Castro 
CommitDate: Mon Sep 4 15:37:59 2023 +0200

sc: ui: view: Use conditional assignment

Change-Id: I51ba012079a955c139a0c55f12a4b141ba536aa6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156502
Tested-by: Jenkins
Reviewed-by: Henry Castro 

diff --git a/sc/source/ui/view/tabview2.cxx b/sc/source/ui/view/tabview2.cxx
index 4faa5d89d569..e28ff1d7 100644
--- a/sc/source/ui/view/tabview2.cxx
+++ b/sc/source/ui/view/tabview2.cxx
@@ -217,10 +217,7 @@ void moveRefByCell(SCCOL& rNewX, SCROW& rNewY,
 SCCOL nTempX = rNewX;
 while (rDoc.IsHorOverlapped(nTempX, rNewY, nRefTab))
 {
-if (nMovX > 0)
-++nTempX;
-else
---nTempX;
+nTempX = (nMovX > 0) ? nTempX + 1 : nTempX - 1;
 if (!checkBoundary(&rDoc, nTempX, rNewY))
 break;
 }
@@ -242,10 +239,7 @@ void moveRefByCell(SCCOL& rNewX, SCROW& rNewY,
 SCROW nTempY = rNewY;
 while (rDoc.IsVerOverlapped(rNewX, nTempY, nRefTab))
 {
-if (nMovY > 0)
-++nTempY;
-else
---nTempY;
+nTempY = (nMovY > 0) ? nTempY + 1 : nTempY - 1;
 if (!checkBoundary(&rDoc, rNewX, nTempY))
 break;
 }


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

2023-09-04 Thread Dan Horák (via logerrit)
 sc/qa/unit/functions_array.cxx |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 3426c96d0e32e0c83e4ce5fdb3405787a0c81e6c
Author: Dan Horák 
AuthorDate: Fri Sep 1 18:45:42 2023 +0200
Commit: Stephan Bergmann 
CommitDate: Mon Sep 4 14:46:34 2023 +0200

limit tests giving dubious results to x86_64

We have confirmed that ArrayFunctionsTest::testDubiousArrayFormulasFODS
gives different results depending on the -ffp-contract setting on
ppc64le and likely also on s390x in addition to aarch64. Thus limit the
check only to x86_64 where it's known to give consistent results.

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

diff --git a/sc/qa/unit/functions_array.cxx b/sc/qa/unit/functions_array.cxx
index 7584c4e0b309..2053c44dfad7 100644
--- a/sc/qa/unit/functions_array.cxx
+++ b/sc/qa/unit/functions_array.cxx
@@ -27,8 +27,9 @@ void ArrayFunctionsTest::testDubiousArrayFormulasFODS()
 {
 //TODO: sc/qa/unit/data/functions/array/dubious/fods/linest.fods produces 
widely different
 // values when built with -ffp-contract enabled (-ffp-contract=on default 
on Clang 14,
-// -ffp-contract=fast default when building with optimizations on GCC) on 
at least aarch64:
-#if !((defined __clang__ || defined __GNUC__) && defined __aarch64__)
+// -ffp-contract=fast default when building with optimizations on GCC) on 
at least aarch64
+// and ppc64le. Thus limit the check only to platforms with consistent 
results.
+#if defined X86_64
 OUString aDirectoryURL
 = 
m_directories.getURLFromSrc(u"/sc/qa/unit/data/functions/array/dubious/fods/");
 recursiveScan(test::pass, "OpenDocument Spreadsheet Flat XML", 
aDirectoryURL,


Re: new bridgetest failures in 7.6 on ppc64le/s390x (was: Re: new bridgetest failures in 7.6 on ppc64le)

2023-09-04 Thread Dan Horák
On Sat, 2 Sep 2023 19:13:44 +0200
Rene Engelhard  wrote:

> Hi,
> 
> Am 02.09.23 um 09:33 schrieb Rene Engelhard:
> > Hi,
> >
> > Am 31.08.23 um 10:21 schrieb Dan Horák:
> >> ...
> >> [CXX] vcl/qa/cppunit/GraphicTest.cxx
> >> [CXX] vcl/qa/cppunit/GraphicDescriptorTest.cxx
> >> two floats struct test failed
> >> four floats struct test failed
> >> standard test failed
> >> exception occurred: error: test failed! at 
> >> /home/sharkcz/projects/libreoffice/testtools/source/bridgetest/bridgetest.cxx:1268
> >>
> >>> error: error: test failed! at 
> >>> /home/sharkcz/projects/libreoffice/testtools/source/bridgetest/bridgetest.cxx:1268
> >>> dying...make[1]: *** 
> >>> [/home/sharkcz/projects/libreoffice/testtools/CustomTarget_uno_test.mk:26:
> >>>  
> >>> /home/sharkcz/projects/libreoffice/workdir/CustomTarget/testtools/uno_test.done]
> >>>  
> >>> Error 1
> >> make[1]: *** Waiting for unfinished jobs
> >>
> >>
> >> I have tracked it down to
> >> https://git.libreoffice.org/core/+/32c845cb4389aba9430ce471b04f2891f5ff630d%5E%21/
> >>  
> >>
> >> So I guess it possibly uncovered a real issue somewhere else.
> >
> > Ah, thanks. I tried with the actual bridge commits but didn't try this 
> > one.
> >
> > Indeed reverting it fixes it.
> >
> >
> > BTw, s390x seems to have a similar problem, see 
> > https://buildd.debian.org/status/fetch.php?pkg=libreoffice&arch=s390x&ver=4%3A7.6.1%7Erc1-1&stamp=1692862844&raw=1.
> >  
> > Trying whether reverting that patch also fixes it.
> >
> yup, it does make the test pass again. "fix" is wrong here somehow ;-)

for the record, we haven't seen this issue on s390x in Fedora, only on
ppc64le.

The revert only works around the actual problem, because the Java
bridge tests aren't run any more for "make unitcheck", but the real
issue is still there.


Dan


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

2023-09-04 Thread Julien Nabet (via logerrit)
 sc/source/ui/app/client.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 4a501a7270a0dd476ff71f72fae2c9fb9b40520a
Author: Julien Nabet 
AuthorDate: Mon Sep 4 11:19:31 2023 +0200
Commit: Julien Nabet 
CommitDate: Mon Sep 4 14:21:05 2023 +0200

Related tdf#108976: Crash in: OutputDevice::GetOutputSizePixel()

On pc Debian x86-64 with master sources updated today, I encountered this:
5  0x7f68124533a2 in __assert_fail
(assertion=0x7f67016aea9b "_pInterface != NULL", file=0x7f670156834a 
"/home/julien/lo/libreoffice/include/com/sun/star/uno/Reference.h", line=385, 
function=0x7f6701592970 "interface_type 
*com::sun::star::uno::Reference::operator->()
 const [interface_type = com::sun::star::embed::XEmbeddedObject]") at 
./assert/assert.c:101
6  0x7f67023ed042 in 
com::sun::star::uno::Reference::operator->()
 const (this=0x7ffe3b5f11c0) at include/com/sun/star/uno/Reference.h:385
7  0x7f67030a7ba9 in ScClient::ViewChanged() (this=0x55fb3b69e7b0) at 
/home/julien/lo/libreoffice/sc/source/ui/app/client.cxx:191
8  0x7f680f1d13db in SfxInPlaceClient::Invalidate() 
(this=0x55fb3b69e7b0) at 
/home/julien/lo/libreoffice/sfx2/source/view/ipclient.cxx:840
9  0x7f680f1d59db in SfxInPlaceClient::SetObjArea(tools::Rectangle 
const&) (this=0x55fb3b69e7b0, rArea=...) at 
/home/julien/lo/libreoffice/sfx2/source/view/ipclient.cxx:764
10 0x7f6703b74c30 in ScTabViewShell::ConnectObject(SdrOle2Obj const*) 
(this=0x55fb3ca0b880, pObj=0x55fb3c68b2c0) at 
/home/julien/lo/libreoffice/sc/source/ui/view/tabvwshb.cxx:107

See full bt here:
https://bugs.documentfoundation.org/attachment.cgi?id=189332

Change-Id: I0b48f2e624b249438d8d4fbc53057f89f5877c05
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156509
Reviewed-by: Noel Grandin 
Reviewed-by: Julien Nabet 
Tested-by: Jenkins

diff --git a/sc/source/ui/app/client.cxx b/sc/source/ui/app/client.cxx
index 26c84e5fa347..5c44bc077e83 100644
--- a/sc/source/ui/app/client.cxx
+++ b/sc/source/ui/app/client.cxx
@@ -184,6 +184,8 @@ void ScClient::ViewChanged()
 }
 
 uno::Reference < embed::XEmbeddedObject > xObj = GetObject();
+if (!xObj.is())
+return;
 
 // TODO/LEAN: working with Visual Area can switch object to running state
 awt::Size aSz;


Re: ArrayFunctionsTest::testDubiousArrayFormulasFODS fails on ppc64le (and s390x)

2023-09-04 Thread Dan Horák
On Fri, 1 Sep 2023 16:36:30 +0200
Stephan Bergmann  wrote:

> On 9/1/23 15:41, Dan Horák wrote:
> > On Fri, 1 Sep 2023 11:29:23 +0200
> > Stephan Bergmann  wrote:
> [...]
> >> would be that the TODO comment makes it then sound like the issues on
> >> ppc64le and s390x are also known to be due to -ffp-contract settings,
> >> even if you would not verify that.
> > 
> > I have verified it's indeed caused by -ffp-contract. When set to "off",
> > the test passes (checked on ppc64le).
> 
> Good to know.  Please add that knowledge to the commit message.
> 
> >> So maybe the best thing is to turn this into a x86_64 only conditional,
> >> and extend the TODO comment with something like "...on at least aarch64,
> >> so lets only execute this on x86-64, where it appears to always work well:"
> > 
> > yeah, I think using a "positive" list would be better. I could
> > possibly prepare a patch, but is there an example where I can see how
> > the condition should look like?
> 
> For better or worse, we pass or configure.ac's "compiler independent" 
> CPUNAME into the compiler via -D$(CPUNAME) (solenv/gbuild/gbuild.mk), so 
> something like
> 
> > #if defined X86_64
> 
> should work for a positive list of just x86_64, regardless of compiler 
> (MSVC vs. Clang/GCC).
> 

thanks, fix posted for review in
https://gerrit.libreoffice.org/c/core/+/156453


Dan


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

2023-09-04 Thread Adam Eric Fallon (via logerrit)
 sw/uiconfig/swriter/ui/notebookbar.ui |   57 ++-
 sw/uiconfig/swriter/ui/notebookbar_compact.ui |   63 --
 2 files changed, 114 insertions(+), 6 deletions(-)

New commits:
commit b0a9a21aee0588998d43f73ddb44b94391e2d40e
Author: Adam Eric Fallon 
AuthorDate: Thu Aug 31 13:53:02 2023 +0100
Commit: Heiko Tietze 
CommitDate: Mon Sep 4 13:58:14 2023 +0200

Added horizontal line and autocorrect to tabbed and compact tabbed 
interfaces.

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

diff --git a/sw/uiconfig/swriter/ui/notebookbar.ui 
b/sw/uiconfig/swriter/ui/notebookbar.ui
index 3b1ea93f6f19..4a65e014823f 100644
--- a/sw/uiconfig/swriter/ui/notebookbar.ui
+++ b/sw/uiconfig/swriter/ui/notebookbar.ui
@@ -1030,6 +1030,13 @@
 .uno:InsertSection
   
 
+
+  
+True
+False
+.uno:StyleApply?Style:string=Horizontal 
Line&FamilyName:string=ParagraphStyles
+  
+
 
   
 True
@@ -1594,9 +1601,53 @@
 False
 .uno:MoreDictionaries
   
-  
-0
-  
+
+
+  
+True
+False
+.uno:AutoFormatMenu
+
+  
+True
+False
+
+  
+True
+False
+.uno:OnlineAutoFormat
+  
+
+
+  
+True
+False
+.uno:AutoFormatApply
+  
+
+
+  
+True
+False
+.uno:AutoFormatRedlineApply
+  
+
+
+  
+True
+False
+  
+
+
+  
+True
+False
+.uno:AutoCorrectDlg
+  
+
+  
+
+  
 
 
   
diff --git a/sw/uiconfig/swriter/ui/notebookbar_compact.ui 
b/sw/uiconfig/swriter/ui/notebookbar_compact.ui
index 3f9e712a8cdf..a183fa3c703b 100644
--- a/sw/uiconfig/swriter/ui/notebookbar_compact.ui
+++ b/sw/uiconfig/swriter/ui/notebookbar_compact.ui
@@ -1185,6 +1185,12 @@
 .uno:PageNumberWizard
   
 
+
+  
+True
+False
+  
+
 
   
 True
@@ -1199,6 +1205,13 @@
 .uno:InsertSection
   
 
+
+  
+True
+False
+.uno:StyleApply?Style:string=Horizontal 
Line&FamilyName:string=ParagraphStyles
+  
+
 
   
 True
@@ -1777,9 +1790,53 @@
 False
 .uno:MoreDictionaries
   
-  
-0
-  
+
+
+  
+True
+False
+.uno:AutoFormatMenu
+
+  
+True
+False
+
+  
+True
+False
+.uno:OnlineAutoFormat
+  
+
+
+  
+True
+False
+.uno:AutoFormatApply
+  
+
+
+  
+True
+False
+.uno:AutoFormatRedlineApply
+  
+
+
+  
+True
+False
+  
+
+
+  
+True
+False
+.uno:AutoCorrectDlg
+  
+
+  
+
+  
 
 
   


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

2023-09-04 Thread Samuel Mehrbrodt (via logerrit)
 svx/source/sidebar/area/AreaPropertyPanelBase.cxx |   10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)

New commits:
commit b5effb66ee1563689c27ff10b682357120ab7786
Author: Samuel Mehrbrodt 
AuthorDate: Mon Sep 4 11:52:08 2023 +0200
Commit: Samuel Mehrbrodt 
CommitDate: Mon Sep 4 13:29:08 2023 +0200

tdf#151188 Select correct fill type in sidebar

Change-Id: Ic123e6b21009cc57bf1c4b5f4edc6dcd277bae0a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156510
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt 

diff --git a/svx/source/sidebar/area/AreaPropertyPanelBase.cxx 
b/svx/source/sidebar/area/AreaPropertyPanelBase.cxx
index 3659110f16db..9adff2c65dfd 100644
--- a/svx/source/sidebar/area/AreaPropertyPanelBase.cxx
+++ b/svx/source/sidebar/area/AreaPropertyPanelBase.cxx
@@ -1066,10 +1066,14 @@ void 
AreaPropertyPanelBase::updateFillUseBackground(bool bDisabled, bool bDefaul
 if (pState)
 {
 const XFillUseSlideBackgroundItem* pItem = static_cast(pState);
-// When XFillUseSlideBackgroundItem is true, select "Use 
Background Fill". When false, select "None"
+// When XFillUseSlideBackgroundItem is set, select "Use Background 
Fill".
+// When false, select "None" (only if "Use background fill" was 
selected beforehand)
 int nPos = pItem->GetValue() ? USE_BACKGROUND : NONE;
-mxLbFillType->set_active(nPos);
-FillStyleChanged(false);
+if ((nPos == NONE && mxLbFillType->get_active() == USE_BACKGROUND) 
|| nPos == USE_BACKGROUND)
+{
+mxLbFillType->set_active(nPos);
+FillStyleChanged(false);
+}
 }
 }
 }


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

2023-09-04 Thread Bayram Çiçek (via logerrit)
 cui/source/options/treeopt.cxx |   12 +---
 1 file changed, 9 insertions(+), 3 deletions(-)

New commits:
commit c68e1dca3a5a06248ce129bfb13206753163d71d
Author: Bayram Çiçek 
AuthorDate: Thu Aug 31 00:01:56 2023 +0300
Commit: Andreas Heinisch 
CommitDate: Mon Sep 4 13:10:26 2023 +0200

tdf#49895: show wait cursor while Options dialog loads

initializing of the dialogs happens at two stage:
- at the loading of the Options dialog
- at the time of searching

We have to notify the user that there is a process ongoing.
Therefore, a wait cursor indicator added to the both
stage of the initialization.

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

diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx
index d514b7deeb7f..1b5e29e2aca2 100644
--- a/cui/source/options/treeopt.cxx
+++ b/cui/source/options/treeopt.cxx
@@ -791,6 +791,12 @@ IMPL_LINK_NOARG(OfaTreeOptionsDialog, SearchUpdateHdl, 
weld::Entry&, void)
 
 IMPL_LINK_NOARG(OfaTreeOptionsDialog, ImplUpdateDataHdl, Timer*, void)
 {
+// initializeFirstNDialog() can take a long time, show wait cursor and 
disable input
+std::unique_ptr xWait(m_pParent ? new 
weld::WaitObject(m_pParent) : nullptr);
+
+// Pause redraw
+xTreeLB->freeze();
+
 if (bIsFirtsInitialize)
 {
 m_xSearchEdit->freeze();
@@ -803,9 +809,6 @@ IMPL_LINK_NOARG(OfaTreeOptionsDialog, ImplUpdateDataHdl, 
Timer*, void)
 bIsFirtsInitialize = false;
 }
 
-// Pause redraw
-xTreeLB->freeze();
-
 // Apply the search filter
 OUString aSearchTerm(m_xSearchEdit->get_text());
 int nMatchFound = applySearchFilter(aSearchTerm);
@@ -1186,6 +1189,9 @@ void OfaTreeOptionsDialog::ActivateLastSelection()
 m_xSearchEdit->grab_focus();
 SelectHdl_Impl();
 
+// initializeFirstNDialog() can take a long time, show wait cursor
+std::unique_ptr xWait(m_pParent ? new 
weld::WaitObject(m_pParent) : nullptr);
+
 /* initialize first 25 dialogs which are almost half of the dialogs
 in a row while Options dialog opens. then clear&reselect to avoid UI test 
failures. */
 initializeFirstNDialog(25);


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

2023-09-04 Thread Paris Oplopoios (via logerrit)
 sw/source/uibase/app/apphdl.cxx |   14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)

New commits:
commit ed191e04cb846074c4e65025405bba889751edef
Author: Paris Oplopoios 
AuthorDate: Mon Jun 12 00:49:27 2023 +0300
Commit: Xisco Fauli 
CommitDate: Mon Sep 4 12:51:08 2023 +0200

Fix unchecked dynamic cast

Change-Id: If662e24bb864690ead959b2599a6448d84da0de9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152866
Tested-by: Jenkins
Reviewed-by: Paris Oplopoios 
(cherry picked from commit 20a6c2df3ea899cce15775d954ffa50bb9dc81cd)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156447
Reviewed-by: Xisco Fauli 

diff --git a/sw/source/uibase/app/apphdl.cxx b/sw/source/uibase/app/apphdl.cxx
index bd4cdbe28f0f..d7ab78d6e392 100644
--- a/sw/source/uibase/app/apphdl.cxx
+++ b/sw/source/uibase/app/apphdl.cxx
@@ -983,23 +983,27 @@ void SwModule::ConfigurationChanged( 
utl::ConfigurationBroadcaster* pBrdCst, Con
 {
 if(pViewShell->GetWindow())
 {
-auto pSwView = dynamic_cast( pViewShell );
-if(pSwView !=  nullptr ||
-   dynamic_cast< const SwPagePreview *>( pViewShell ) !=  
nullptr ||
-   dynamic_cast< const SwSrcView *>( pViewShell ) !=  nullptr)
+auto pSwView = dynamic_cast(pViewShell);
+if (pSwView)
 {
 SwViewOption aNewOptions = 
*pSwView->GetWrtShell().GetViewOptions();
 
aNewOptions.SetThemeName(svtools::ColorConfig::GetCurrentSchemeName());
 SwViewColors aViewColors(*m_pColorConfig);
 aNewOptions.SetColorConfig(aViewColors);
 pSwView->GetWrtShell().ApplyViewOptions(aNewOptions);
-pViewShell->GetWindow()->Invalidate();
+
 if (bOnlyInvalidateCurrentView)
 {
 
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_APPLICATION_BACKGROUND_COLOR,
 
aViewColors.m_aAppBackgroundColor.AsRGBHexString().toUtf8());
 }
 }
+if(pSwView !=  nullptr ||
+   dynamic_cast< const SwPagePreview *>( pViewShell ) !=  
nullptr ||
+   dynamic_cast< const SwSrcView *>( pViewShell ) !=  nullptr)
+{
+pViewShell->GetWindow()->Invalidate();
+}
 }
 if (bOnlyInvalidateCurrentView)
 break;


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

2023-09-04 Thread Khaled Hosny (via logerrit)
 starmath/source/view.cxx |   36 +---
 1 file changed, 17 insertions(+), 19 deletions(-)

New commits:
commit 03c43d303b6d32dc4c39bd273d446b66a3e6c42d
Author: Khaled Hosny 
AuthorDate: Thu Aug 31 11:55:22 2023 +0300
Commit: خالد حسني 
CommitDate: Mon Sep 4 11:58:15 2023 +0200

Math: enable in-place editing on desktop

Move the code outside the else block as it doesn’t get hit for me on
desktop otherwise, and use SmViewShell::IsInlineEditEnabled() instead of
comphelper::LibreOfficeKit::isActive() (which is included in the former).

Followup to:

commit 737a270c61cd2038ede7911b7d7b4afcf020f53c
Date:   Mon Jan 17 17:15:46 2022 +0300

lok: enable in-place editing of math equations

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

diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index 97332a4810c1..a71438bc82b5 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -835,26 +835,24 @@ bool SmGraphicWidget::Command(const CommandEvent& rCEvt)
 default: break;
 }
 }
-else
+
+switch (rCEvt.GetCommand())
 {
-switch (rCEvt.GetCommand())
-{
-case CommandEventId::ExtTextInput:
-if (comphelper::LibreOfficeKit::isActive())
-{
-const CommandExtTextInputData* pData = 
rCEvt.GetExtTextInputData();
-assert(pData);
-const OUString& rText = pData->GetText();
-SmCursor& rCursor = GetCursor();
-OutputDevice& rDevice = GetOutputDevice();
-for (sal_Int32 i = 0; i < rText.getLength();)
-CharInput(rText.iterateCodePoints(&i), rCursor, 
rDevice);
-bCallBase = false;
-}
-break;
-default:
-break;
-}
+case CommandEventId::ExtTextInput:
+if (SmViewShell::IsInlineEditEnabled())
+{
+const CommandExtTextInputData* pData = 
rCEvt.GetExtTextInputData();
+assert(pData);
+const OUString& rText = pData->GetText();
+SmCursor& rCursor = GetCursor();
+OutputDevice& rDevice = GetOutputDevice();
+for (sal_Int32 i = 0; i < rText.getLength();)
+CharInput(rText.iterateCodePoints(&i), rCursor, rDevice);
+bCallBase = false;
+}
+break;
+default:
+break;
 }
 return !bCallBase;
 }


Re: Adding an implemented UNO interface

2023-09-04 Thread Lionel Élie Mamane
On Sun, Sep 03, 2023 at 07:21:40PM +0200, Noel Grandin wrote:
> On Sat, 2 Sept 2023 at 09:26, Lionel Élie Mamane  wrote:

>> #include 
>> /* grault .hxx contains:
>>  *
>>  * typedef ::cppu::WeakComponentImplHelper2 <
>>  *css::Baz,
>>  *css::qux >  grault_BASE;
>>  *
>>  * class grault : public grault_BASE { ... }
>>  */

> You can do

> class bar1 : public grault_BASE {}
> class bar : public ImplInheritanceHelper {}

Reading up on ImplInheritanceHelper, I think you meant (or my question
was unclear, but the answer to the question I had meant to ask is)

typedef cppu::ImplInheritanceHelper  bar_BASE;

class bar: public bar_BASE
{
   
}


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

2023-09-04 Thread Miklos Vajna (via logerrit)
 sw/CppunitTest_sw_core_objectpositioning.mk   |4 
 sw/qa/core/objectpositioning/data/floattable-follow-on-wrong-page.odt |binary
 sw/qa/core/objectpositioning/objectpositioning.cxx|   56 
--
 sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx|7 +
 4 files changed, 56 insertions(+), 11 deletions(-)

New commits:
commit 401c175d1bbe3c64e5dd96e3b2377271cfb1
Author: Miklos Vajna 
AuthorDate: Mon Sep 4 08:31:18 2023 +0200
Commit: Miklos Vajna 
CommitDate: Mon Sep 4 11:51:53 2023 +0200

tdf#156318 sw floattable: fix follow text flow handling on interactive edit

Once the bugdoc has 1 col for pages, setting the top and bottom margins
to 2.5cm created a split fly, but the follow fly was on page 3, not on
page 2.

What happened is that the layout was already wrong before calling into
SwFrame::GetNextFlyLeaf() (that does the split), the "follow text flow"
feature shifted the fly down (top was originally 1341, then the
increased margin means 2475, but an additional 4329 was set), and then
the fly was created on the wrong page.

Fix the problem by not calling GetAnchoredObj().SetObjTop() in
SwToContentAnchoredObjectPosition::CalcPosition() when the fly doesn't
fit anymore, this way the fly can shrink, a follow can be created and
some of the content will be moved to the follow fly, leading to a
correct split fly on pages 1 & 2.

This also fixes the previously appearing "fly frame has negative height
now" warnings on setting the page margin.

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

diff --git a/sw/CppunitTest_sw_core_objectpositioning.mk 
b/sw/CppunitTest_sw_core_objectpositioning.mk
index 0f1a9dcff0be..8edae42595c8 100644
--- a/sw/CppunitTest_sw_core_objectpositioning.mk
+++ b/sw/CppunitTest_sw_core_objectpositioning.mk
@@ -21,6 +21,7 @@ $(eval $(call 
gb_CppunitTest_use_libraries,sw_core_objectpositioning, \
 comphelper \
 cppu \
 cppuhelper \
+editeng \
 sal \
 sfx \
 subsequenttest \
@@ -70,6 +71,9 @@ $(eval $(call 
gb_CppunitTest_use_uiconfigs,sw_core_objectpositioning, \
 modules/swriter \
 ))
 
+# assert if font/glyph fallback occurs
+$(eval $(call 
gb_CppunitTest_set_non_application_font_use,sw_core_objectpositioning,abort))
+
 $(eval $(call gb_CppunitTest_use_more_fonts,sw_core_objectpositioning))
 
 # vim: set noet sw=4 ts=4:
diff --git 
a/sw/qa/core/objectpositioning/data/floattable-follow-on-wrong-page.odt 
b/sw/qa/core/objectpositioning/data/floattable-follow-on-wrong-page.odt
new file mode 100644
index ..6401747fd9d3
Binary files /dev/null and 
b/sw/qa/core/objectpositioning/data/floattable-follow-on-wrong-page.odt differ
diff --git a/sw/qa/core/objectpositioning/objectpositioning.cxx 
b/sw/qa/core/objectpositioning/objectpositioning.cxx
index 611ce1294c22..4e0db43c475f 100644
--- a/sw/qa/core/objectpositioning/objectpositioning.cxx
+++ b/sw/qa/core/objectpositioning/objectpositioning.cxx
@@ -12,6 +12,8 @@
 #include 
 #include 
 
+#include 
+
 #include 
 #include 
 #include 
@@ -21,18 +23,21 @@
 #include 
 #include 
 #include 
+#include 
 
+namespace
+{
 /// Covers sw/source/core/objectpositioning/ fixes.
-class SwCoreObjectpositioningTest : public SwModelTestBase
+class Test : public SwModelTestBase
 {
 public:
-SwCoreObjectpositioningTest()
+Test()
 : SwModelTestBase("/sw/qa/core/objectpositioning/data/")
 {
 }
 };
 
-CPPUNIT_TEST_FIXTURE(SwCoreObjectpositioningTest, testOverlapCrash)
+CPPUNIT_TEST_FIXTURE(Test, testOverlapCrash)
 {
 // Load a document with 2 images.
 createSwDoc("overlap-crash.odt");
@@ -51,7 +56,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreObjectpositioningTest, 
testOverlapCrash)
 pWrtShell->SplitNode();
 }
 
-CPPUNIT_TEST_FIXTURE(SwCoreObjectpositioningTest, testVertPosFromBottom)
+CPPUNIT_TEST_FIXTURE(Test, testVertPosFromBottom)
 {
 // Create a document, insert a shape and position it 1cm above the bottom 
of the body area.
 createSwDoc();
@@ -80,7 +85,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreObjectpositioningTest, 
testVertPosFromBottom)
 CPPUNIT_ASSERT_EQUAL(static_cast(565), nBodyBottom - 
nAnchoredBottom);
 }
 
-CPPUNIT_TEST_FIXTURE(SwCoreObjectpositioningTest, testVertAlignBottomMargin)
+CPPUNIT_TEST_FIXTURE(Test, testVertAlignBottomMargin)
 {
 // Create a document, insert three shapes and align it the 
bottom,center,top of page print area bottom.
 // The size of shapes are 284 ~ 0.5cm
@@ -151,7 +156,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreObjectpositioningTest, 
testVertAlignBottomMargin)
 CPPUNIT_ASSERT_EQUAL(static_cast(0), nThirdShapeTop - 
nBodyBottom);
 }
 
-CPPUNIT_TEST_FIXTURE(SwCoreObjectpositioningTest, 
testVertAlignBottomMarginWithFooter)
+CPPUNIT_TEST_FIXTURE(Test, testVertAlignBottom

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

2023-09-04 Thread Julien Nabet (via logerrit)
 svx/source/tbxctrls/Palette.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit cddb28b591ca8d27a7ae9bc36cdb108f4ad021ee
Author: Julien Nabet 
AuthorDate: Fri Sep 1 15:56:01 2023 +0200
Commit: Xisco Fauli 
CommitDate: Mon Sep 4 10:42:02 2023 +0200

tdf#156126: fix crash when using gpl color palette

keep the do/while instead of a plain while since:
1) you'll always got a empty line since aLine isn't initialized
2) some palette may contain empty line
eg: "Office 2016" palette from 
https://extensions.libreoffice.org/en/extensions/show/o2k10-color-palette

Change-Id: I2874261b8dd13ce180ed05628b11bd3efce6720c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156421
Reviewed-by: Julien Nabet 
Tested-by: Julien Nabet 
(cherry picked from commit 46022e5fcdf01db60c0c560cbd2aff9b7a57a372)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156439
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 

diff --git a/svx/source/tbxctrls/Palette.cxx b/svx/source/tbxctrls/Palette.cxx
index 8c81eb53167e..b3f1965de31b 100644
--- a/svx/source/tbxctrls/Palette.cxx
+++ b/svx/source/tbxctrls/Palette.cxx
@@ -262,6 +262,9 @@ void PaletteGPL::LoadPalette()
 
 OStringBuffer aLine;
 do {
+if (aLine.isEmpty())
+continue;
+
 if (aLine[0] != '#' && aLine[0] != '\n')
 {
 // TODO check if r,g,b are 0<= x <=255, or just clamp?


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

2023-09-04 Thread Caolán McNamara (via logerrit)
 sw/source/core/layout/paintfrm.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 4f83442f2be2bf0ce1dcb75b44235f4fe13433df
Author: Caolán McNamara 
AuthorDate: Fri Aug 25 09:54:28 2023 +0100
Commit: Xisco Fauli 
CommitDate: Mon Sep 4 10:41:18 2023 +0200

crash case seen on clicking on drawing text box inside a footer

Change-Id: Id7645ad651d237c94fecb2fc2b6c57a88f3caa55
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156091
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
(cherry picked from commit bbbd7e346c5b929ca3b867b6dd80c71b8dd788d6)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156385
Reviewed-by: Xisco Fauli 

diff --git a/sw/source/core/layout/paintfrm.cxx 
b/sw/source/core/layout/paintfrm.cxx
index e86ad990f83c..be694a390350 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -6946,7 +6946,8 @@ void SwPageFrame::PaintSubsidiaryLines( const SwPageFrame 
*,
 pLay = pLay->GetNext();
 }
 
-assert(pPageBody && "presumably this is impossible");
+if (!pPageBody)
+return;
 
 SwRect aArea( pPageBody->getFrameArea() );
 if ( pFootnoteCont )


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

2023-09-04 Thread Caolán McNamara (via logerrit)
 sw/source/core/layout/paintfrm.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 8c886e86bc4b7534a0376204fdc646ce8103eedf
Author: Caolán McNamara 
AuthorDate: Fri Aug 25 09:54:28 2023 +0100
Commit: Xisco Fauli 
CommitDate: Mon Sep 4 10:41:11 2023 +0200

crash case seen on clicking on drawing text box inside a footer

Change-Id: Id7645ad651d237c94fecb2fc2b6c57a88f3caa55
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156091
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
(cherry picked from commit bbbd7e346c5b929ca3b867b6dd80c71b8dd788d6)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156383
Reviewed-by: Xisco Fauli 

diff --git a/sw/source/core/layout/paintfrm.cxx 
b/sw/source/core/layout/paintfrm.cxx
index 361e750570e9..8f6347a2268e 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -7257,7 +7257,8 @@ void SwPageFrame::PaintSubsidiaryLines( const SwPageFrame 
*,
 pLay = pLay->GetNext();
 }
 
-assert(pPageBody && "presumably this is impossible");
+if (!pPageBody)
+return;
 
 SwRect aArea( pPageBody->getFrameArea() );
 if ( pFootnoteCont )


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

2023-09-04 Thread Eike Rathke (via logerrit)
 sc/inc/kahan.hxx |   11 +++
 1 file changed, 11 insertions(+)

New commits:
commit 1f320173fc92dcf3873751bffe490931542679bc
Author: Eike Rathke 
AuthorDate: Fri Sep 1 15:20:28 2023 +0200
Commit: Xisco Fauli 
CommitDate: Mon Sep 4 10:40:22 2023 +0200

Resolves: tdf#156985 Treat adding two KahanSum differently

When summing mixed formula cells and numeric cells, cell type runs are
summed using KahanSum that when switching cell types are added. Using
add() to explicitly add the rhs m_fError compensation value separately
may had lead to effectively cancelling out the relation of sum and
error, living on with an unrelated error value. Instead, add a "final"
rhs sum+compensation.

Change-Id: I751d3e0eeef9cd80482895c24f05b1ab667c3020
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156253
Tested-by: Jenkins
Reviewed-by: Eike Rathke 
(cherry picked from commit caafee1a4805e40d29be5c90f3a021ed6ef5c4d2)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156431
Reviewed-by: Xisco Fauli 

diff --git a/sc/inc/kahan.hxx b/sc/inc/kahan.hxx
index 6c84f6eeef2e..ac97ae4394fa 100644
--- a/sc/inc/kahan.hxx
+++ b/sc/inc/kahan.hxx
@@ -71,8 +71,15 @@ public:
   */
 inline void add(const KahanSum& fSum)
 {
+#ifdef _WIN32
+// For some odd unknown reason WIN32 fails badly with the
+// sum+compensation value. Continue keeping the old though slightly off
+// (see tdf#156985) explicit addition of the compensation value.
 add(fSum.m_fSum);
 add(fSum.m_fError);
+#else
+add(fSum.m_fSum + fSum.m_fError);
+#endif
 add(fSum.m_fMem);
 }
 
@@ -82,8 +89,12 @@ public:
   */
 inline void subtract(const KahanSum& fSum)
 {
+#ifdef _WIN32
 add(-fSum.m_fSum);
 add(-fSum.m_fError);
+#else
+add(-(fSum.m_fSum + fSum.m_fError));
+#endif
 add(-fSum.m_fMem);
 }
 


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

2023-09-04 Thread Tomaž Vajngerl (via logerrit)
 vcl/source/filter/GraphicFormatDetector.cxx |  134 +---
 1 file changed, 64 insertions(+), 70 deletions(-)

New commits:
commit 1428eb1dc2f6540ec2261da6bdfd8ca2e79d7a58
Author: Tomaž Vajngerl 
AuthorDate: Fri Sep 1 21:20:05 2023 +0200
Commit: Xisco Fauli 
CommitDate: Mon Sep 4 09:49:28 2023 +0200

tdf#147704 fix reading TIFF metadata (width and height)

When we prepare (not read and load) the bitmap we need to read
only the metadata - most importantly pixel width and height. This
didn't work correctly for the TIFF files or more importantly the
specific TIFF files in the document, and the result was that the
size reported was 0,0 and somehow the crop factor wasn't applied
correctly. This change fixes the metadata reading and makes it
more robust.

Change-Id: I60951e5d01afc311c400589496ae82377ccb4cf5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156457
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 9c636d76a9a7e167da39913ab60f5135f8e831a6)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156437
Reviewed-by: Xisco Fauli 

diff --git a/vcl/source/filter/GraphicFormatDetector.cxx 
b/vcl/source/filter/GraphicFormatDetector.cxx
index fc43cdd963ab..1a216bb1db92 100644
--- a/vcl/source/filter/GraphicFormatDetector.cxx
+++ b/vcl/source/filter/GraphicFormatDetector.cxx
@@ -33,7 +33,6 @@
 
 constexpr sal_uInt32 SVG_CHECK_SIZE = 2048;
 constexpr sal_uInt32 WMF_EMF_CHECK_SIZE = 44;
-constexpr sal_uInt32 DATA_SIZE = 640;
 
 namespace
 {
@@ -716,6 +715,7 @@ bool GraphicFormatDetector::checkTIF()
 if (bDetectOk)
 {
 sal_uInt16 nTemp16 = 0;
+sal_uInt32 nTemp32 = 0;
 
 mrStream.ReadUInt16(nTemp16);
 if (nTemp16 == 0x2a)
@@ -725,90 +725,84 @@ bool GraphicFormatDetector::checkTIF()
 
 if (mbExtendedInfo)
 {
-sal_uLong nCount;
-sal_uLong nMax = DATA_SIZE - 48;
-sal_uInt32 nTemp32 = 0;
+sal_uInt32 nIfdOffset = 0;
 
 // Offset of the first IFD
-mrStream.ReadUInt32(nTemp32);
-nCount = nTemp32 + 2;
-mrStream.SeekRel(nCount - 0x08);
+mrStream.ReadUInt32(nIfdOffset);
+mrStream.SeekRel(nIfdOffset - 8); // read 6 bytes until 
here
+
+sal_uInt16 nNumberOfTags = 0;
+mrStream.ReadUInt16(nNumberOfTags);
+
+bool bOk = true;
+sal_Int32 nCount = 0;
 
-if (nCount < nMax)
+// read tags till we find Tag256(Width)
+mrStream.ReadUInt16(nTemp16);
+while (nTemp16 != 256 && bOk)
 {
-bool bOk = false;
+mrStream.SeekRel(10);
+mrStream.ReadUInt16(nTemp16);
+nCount++;
+if (nCount > nNumberOfTags)
+bOk = false;
+}
 
-// read tags till we find Tag256 ( Width )
-// do not read more bytes than DATA_SIZE
+if (bOk)
+{
+// width
 mrStream.ReadUInt16(nTemp16);
-while (nTemp16 != 256)
+mrStream.SeekRel(4);
+if (nTemp16 == 3)
 {
-bOk = nCount < nMax;
-if (!bOk)
-{
-break;
-}
-mrStream.SeekRel(10);
 mrStream.ReadUInt16(nTemp16);
-nCount += 12;
+maMetadata.maPixSize.setWidth(nTemp16);
+mrStream.SeekRel(2);
+}
+else
+{
+mrStream.ReadUInt32(nTemp32);
+maMetadata.maPixSize.setWidth(nTemp32);
 }
 
-if (bOk)
+// height
+mrStream.SeekRel(2);
+mrStream.ReadUInt16(nTemp16);
+mrStream.SeekRel(4);
+if (nTemp16 == 3)
 {
-// width
 mrStream.ReadUInt16(nTemp16);
-mrStream.SeekRel(4);
-if (nTemp16 == 3)
-{
-mrStream.ReadUInt16(nTemp16);
-maMetadata.maPixSize.setWidth(nTemp16);
- 

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

2023-09-04 Thread Xisco Fauli (via logerrit)
 accessibility/source/extended/accessiblelistboxentry.cxx |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit bc376cef318f9a39c780c8b5dd9ca72f04e1b64a
Author: Xisco Fauli 
AuthorDate: Fri Sep 1 12:19:40 2023 +0200
Commit: Xisco Fauli 
CommitDate: Mon Sep 4 09:46:18 2023 +0200

accessibility: fix crash in getAccessibleActionDescription

See 
https://crashreport.libreoffice.org/stats/signature/SvTreeListEntry::HasChildren()

Change-Id: I21879ad531a5c61b3a6808c373454522557e2ff9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156403
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 
(cherry picked from commit e3b4bb25d4ef1684e1a370a34bc13ec65df23ea5)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156433
Reviewed-by: Xisco Fauli 
(cherry picked from commit a453cafde419d186625c191154d8d6178f0149d0)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156436

diff --git a/accessibility/source/extended/accessiblelistboxentry.cxx 
b/accessibility/source/extended/accessiblelistboxentry.cxx
index e22c8ce2ba5d..f8e42c98d954 100644
--- a/accessibility/source/extended/accessiblelistboxentry.cxx
+++ b/accessibility/source/extended/accessiblelistboxentry.cxx
@@ -794,9 +794,10 @@ namespace accessibility
 //Sometimes, a List or Tree may have both checkbox and label 
at the same time
 return OUString();
 }
-}else if( (nIndex == 1 && (treeFlag & SvTreeFlags::CHKBTN)) || nIndex 
== 0 )
+}
+else if( (nIndex == 1 && (treeFlag & SvTreeFlags::CHKBTN)) || nIndex 
== 0 )
 {
-if( pEntry->HasChildren() || pEntry->HasChildrenOnDemand() )
+if( pEntry && (pEntry->HasChildren() || 
pEntry->HasChildrenOnDemand()) )
 return m_pTreeListBox->IsExpanded( pEntry ) ?
 AccResId(STR_SVT_ACC_ACTION_COLLAPSE) :
 AccResId(STR_SVT_ACC_ACTION_EXPAND);


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

2023-09-04 Thread Julien Nabet (via logerrit)
 sw/source/core/unocore/unostyle.cxx |   18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

New commits:
commit 1761680a8f8f4a4dfa50e5be4c9a94ffa2aa46b2
Author: Julien Nabet 
AuthorDate: Sun Sep 3 22:21:54 2023 +0200
Commit: Julien Nabet 
CommitDate: Mon Sep 4 09:23:36 2023 +0200

Make nPropSetId vars sal_uInt16 instead of sal_Int8

since:
- for some lines, it's initialized from propMapType() which returns 
m_nPropMapType which is sal_uInt16
- for other lines, it's used with GetPropertySet which takes a sal_uInt16 
as parameter

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

diff --git a/sw/source/core/unocore/unostyle.cxx 
b/sw/source/core/unocore/unostyle.cxx
index 184a931e798b..e57beb1a72f7 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -2025,7 +2025,7 @@ void SwXStyle::SetPropertyValues_Impl(const 
uno::Sequence& rPropertyNa
 {
 if(!m_pDoc)
 throw uno::RuntimeException();
-sal_Int8 nPropSetId = m_bIsConditional ? 
PROPERTY_MAP_CONDITIONAL_PARA_STYLE : m_rEntry.propMapType();
+sal_uInt16 nPropSetId = m_bIsConditional ? 
PROPERTY_MAP_CONDITIONAL_PARA_STYLE : m_rEntry.propMapType();
 const SfxItemPropertySet* pPropSet = 
aSwMapProvider.GetPropertySet(nPropSetId);
 const SfxItemPropertyMap &rMap = pPropSet->getPropertyMap();
 if(rPropertyNames.getLength() != rValues.getLength())
@@ -2407,7 +2407,7 @@ uno::Any SwXStyle::getPropertyValue(const OUString& 
rPropertyName)
 throw uno::RuntimeException();
 if(!m_pBasePool && !m_bIsDescriptor)
 throw uno::RuntimeException();
-sal_Int8 nPropSetId = m_bIsConditional ? 
PROPERTY_MAP_CONDITIONAL_PARA_STYLE : m_rEntry.propMapType();
+sal_uInt16 nPropSetId = m_bIsConditional ? 
PROPERTY_MAP_CONDITIONAL_PARA_STYLE : m_rEntry.propMapType();
 const SfxItemPropertySet* pPropSet = 
aSwMapProvider.GetPropertySet(nPropSetId);
 SwStyleBase_Impl aBase(*m_pDoc, m_sStyleName, 
&m_pDoc->GetDfltTextFormatColl()->GetAttrSet()); // add pDfltTextFormatColl as 
parent
 return GetPropertyValue_Impl(pPropSet, aBase, rPropertyName);
@@ -2420,7 +2420,7 @@ uno::Sequence SwXStyle::getPropertyValues(const 
uno::SequenceGetDfltTextFormatColl()->GetAttrSet()); // add pDfltTextFormatColl as 
parent
 uno::Sequence aValues(rPropertyNames.getLength());
@@ -2492,7 +2492,7 @@ uno::Sequence 
SwXStyle::getPropertyStates(const uno::Seque
 
 const OUString* pNames = rPropertyNames.getConstArray();
 rtl::Reference xStyle(new 
SwDocStyleSheet(*static_cast(pBase)));
-sal_Int8 nPropSetId = m_bIsConditional ? 
PROPERTY_MAP_CONDITIONAL_PARA_STYLE : m_rEntry.propMapType();
+sal_uInt16 nPropSetId = m_bIsConditional ? 
PROPERTY_MAP_CONDITIONAL_PARA_STYLE : m_rEntry.propMapType();
 
 const SfxItemPropertySet* pPropSet = 
aSwMapProvider.GetPropertySet(nPropSetId);
 const SfxItemPropertyMap& rMap = pPropSet->getPropertyMap();
@@ -2627,7 +2627,7 @@ void SAL_CALL SwXStyle::setPropertiesToDefault(const 
uno::Sequence& aP
 m_pPropertiesImpl->ClearProperty(rName);
 return;
 }
-const sal_Int8 nPropSetId = m_bIsConditional ? 
PROPERTY_MAP_CONDITIONAL_PARA_STYLE : m_rEntry.propMapType();
+const sal_uInt16 nPropSetId = m_bIsConditional ? 
PROPERTY_MAP_CONDITIONAL_PARA_STYLE : m_rEntry.propMapType();
 const SfxItemPropertySet* pPropSet = 
aSwMapProvider.GetPropertySet(nPropSetId);
 const SfxItemPropertyMap &rMap = pPropSet->getPropertyMap();
 for(const auto& rName : aPropertyNames)
@@ -2746,7 +2746,7 @@ uno::Sequence SAL_CALL 
SwXStyle::getPropertyDefaults(const uno::Sequen
 if(!pBase)
 throw uno::RuntimeException();
 rtl::Reference xStyle(new 
SwDocStyleSheet(*static_cast(pBase)));
-const sal_Int8 nPropSetId = m_bIsConditional ? 
PROPERTY_MAP_CONDITIONAL_PARA_STYLE : m_rEntry.propMapType();
+const sal_uInt16 nPropSetId = m_bIsConditional ? 
PROPERTY_MAP_CONDITIONAL_PARA_STYLE : m_rEntry.propMapType();
 const SfxItemPropertySet* pPropSet = 
aSwMapProvider.GetPropertySet(nPropSetId);
 const SfxItemPropertyMap& rMap = pPropSet->getPropertyMap();
 
@@ -3968,7 +3968,7 @@ uno::Sequence< uno::Any > 
SwXAutoStyle::GetPropertyValues_Impl(
 }
 
 // query_item
-sal_Int8 nPropSetId = PROPERTY_MAP_CHAR_AUTO_STYLE;
+sal_uInt16 nPropSetId = PROPERTY_MAP_CHAR_AUTO_STYLE;
 switch(meFamily)
 {
 case IStyleAccess::AUTO_STYLE_CHAR  : nPropSetId = 
PROPERTY_MAP_CHAR_AUTO_STYLE;  break;
@@ -4170,7 +4170,7 @@ uno::Sequence< beans::PropertyState > 
SwXAutoStyle::getPropertyStates(
 beans::PropertyState* pStates = aRet.getArray();
 const OUString* pNames = rPropertyNames.getConstArray();
 
-sal_Int8 nPropSetId = PROPERTY_MAP_CHAR_AUTO_STYLE;
+sal_uInt16 nPropSetId = PROPERTY_MAP_CHAR_AUTO_STYLE;
 switc

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

2023-09-04 Thread Tomaž Vajngerl (via logerrit)
 include/docmodel/color/ComplexColor.hxx  |2 -
 include/docmodel/theme/FormatScheme.hxx  |   18 +--
 include/oox/export/ColorExportUtils.hxx  |3 -
 oox/source/export/ColorExportUtils.cxx   |7 +++-
 sc/qa/unit/ucalc_DocumentThemes.cxx  |1 
 sc/source/filter/excel/xestyle.cxx   |   13 
 sc/source/ui/drawfunc/drawsh.cxx |6 +--
 sc/source/ui/theme/ThemeColorChanger.cxx |   49 +--
 8 files changed, 53 insertions(+), 46 deletions(-)

New commits:
commit e6f42c8e43a0b10ff13d3b2c12717f8e0984f76d
Author: Tomaž Vajngerl 
AuthorDate: Mon Aug 28 18:36:10 2023 +0200
Commit: Miklos Vajna 
CommitDate: Mon Sep 4 09:16:28 2023 +0200

various theme and complex color related fixes

Most of changes are a results of code reviews.

Added comments and clarifications, removed unneeded methods,
renamed variables to be more clear, protection against nullptr
dereference,...

Change-Id: Iae2b6abfa90b3bbd3f28328ca7fcf429765cbe9d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156203
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 03bc5199f92e70b6168e4f79600ac288aa7b26ec)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156458
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/include/docmodel/color/ComplexColor.hxx 
b/include/docmodel/color/ComplexColor.hxx
index 92d39a28426b..01f1dac0e703 100644
--- a/include/docmodel/color/ComplexColor.hxx
+++ b/include/docmodel/color/ComplexColor.hxx
@@ -180,8 +180,6 @@ public:
 meType = ColorType::HSL;
 }
 
-void setPlaceholder() { meType = ColorType::Placeholder; }
-
 void setSystemColor(SystemColorType eSystemColorType, sal_Int32 nRGB)
 {
 maLastColor = ::Color(ColorTransparency, nRGB);
diff --git a/include/docmodel/theme/FormatScheme.hxx 
b/include/docmodel/theme/FormatScheme.hxx
index 96c8afc48214..d6812e749aba 100644
--- a/include/docmodel/theme/FormatScheme.hxx
+++ b/include/docmodel/theme/FormatScheme.hxx
@@ -474,19 +474,19 @@ public:
 {
 FillStyle* pFillStyle = pThis->addFillStyle();
 auto pFill = std::make_shared();
-pFill->maColor.setPlaceholder();
+pFill->maColor.setThemePlaceholder();
 pFillStyle->mpFill = pFill;
 }
 {
 FillStyle* pFillStyle = pThis->addFillStyle();
 auto pFill = std::make_shared();
-pFill->maColor.setPlaceholder();
+pFill->maColor.setThemePlaceholder();
 pFillStyle->mpFill = pFill;
 }
 {
 FillStyle* pFillStyle = pThis->addFillStyle();
 auto pFill = std::make_shared();
-pFill->maColor.setPlaceholder();
+pFill->maColor.setThemePlaceholder();
 pFillStyle->mpFill = pFill;
 }
 }
@@ -517,7 +517,7 @@ public:
 pLineStyle->maLineDash.mePresetType = PresetDashType::Solid;
 pLineStyle->maLineJoin.meType = LineJoinType::Miter;
 auto pFill = std::make_shared();
-pFill->maColor.setPlaceholder();
+pFill->maColor.setThemePlaceholder();
 pLineStyle->maLineFillStyle.mpFill = pFill;
 }
 {
@@ -529,7 +529,7 @@ public:
 pLineStyle->maLineDash.mePresetType = PresetDashType::Solid;
 pLineStyle->maLineJoin.meType = LineJoinType::Miter;
 auto pFill = std::make_shared();
-pFill->maColor.setPlaceholder();
+pFill->maColor.setThemePlaceholder();
 pLineStyle->maLineFillStyle.mpFill = pFill;
 }
 {
@@ -541,7 +541,7 @@ public:
 pLineStyle->maLineDash.mePresetType = PresetDashType::Solid;
 pLineStyle->maLineJoin.meType = LineJoinType::Miter;
 auto pFill = std::make_shared();
-pFill->maColor.setPlaceholder();
+pFill->maColor.setThemePlaceholder();
 pLineStyle->maLineFillStyle.mpFill = pFill;
 }
 }
@@ -591,19 +591,19 @@ public:
 {
 FillStyle* pFillStyle = pThis->addBackgroundFillStyle();
 auto pFill = std::make_shared();
-pFill->maColor.setPlaceholder();
+pFill->maColor.setThemePlaceholder();
 pFillStyle->mpFill = pFill;
 }
 {
 FillStyle* pFillStyle = pThis->addBackgroundFillStyle();
 auto pFill = std::make_shared();
-pFill->maColor.setPlaceholder();
+pFill->maColor.setThemePlaceholder();
 pFillStyle->mpFill = pFill;
 }
 {
 FillStyle* pFillStyle = pThis->addBackgroundFillStyle();
 auto pFill = std::make_shared();
-pFill->maColor.setPlaceholder();
+pFill->maColor.setThemePlaceholder();
 pFillStyle->mpFill = pFill;
 }
 }
diff --git a/include/oox/export/Co

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

2023-09-04 Thread Tomaž Vajngerl (via logerrit)
 sc/inc/unonames.hxx   |1 
 sc/qa/extras/scspreadsheetsettingsobj.cxx |   19 +-
 sc/qa/unit/ThemeImportExportTest.cxx  |   85 +-
 sc/source/filter/xml/xmlexprt.cxx |   21 +++
 sc/source/filter/xml/xmlexprt.hxx |2 
 sc/source/ui/unoobj/docuno.cxx|   23 
 xmloff/inc/XMLThemeContext.hxx|6 +-
 xmloff/source/style/XMLThemeContext.cxx   |6 +-
 xmloff/source/style/xmlstyle.cxx  |   22 ---
 9 files changed, 154 insertions(+), 31 deletions(-)

New commits:
commit 72dc179044bafdfbc577fdd2a69f19bb8f08c958
Author: Tomaž Vajngerl 
AuthorDate: Thu Aug 31 22:29:46 2023 +0200
Commit: Miklos Vajna 
CommitDate: Mon Sep 4 09:15:21 2023 +0200

sc: add ODF import/export of the Theme + tests

One missing thing is the support in calc to save the Theme into
the ODS document and read that back. The theme element is added as
a child element to the office:styles - the same as it already is
added in Writer.

Also adds "Theme" property as a top level document property
so it is possible to get and set the theme in xmloff.

Also tests have been added to cover this usecases.

Change-Id: Ic214ff5e945b77d50e6c881def9d49509560a0e0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156363
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit b36f7769dd07a6b6f55cdf4ce76e2f39ed186e89)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156456
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/sc/inc/unonames.hxx b/sc/inc/unonames.hxx
index c644dc32391a..57f75c3d9293 100644
--- a/sc/inc/unonames.hxx
+++ b/sc/inc/unonames.hxx
@@ -47,6 +47,7 @@ inline constexpr OUStringLiteral SC_UNO_ROWLABELRNG  
= u"RowLabelRanges"
 inline constexpr OUStringLiteral SC_UNO_SHEETLINKS   = u"SheetLinks";
 inline constexpr OUStringLiteral SC_UNO_FORBIDDEN= 
u"ForbiddenCharacters";
 inline constexpr OUStringLiteral SC_UNO_HASDRAWPAGES = u"HasDrawPages";
+inline constexpr OUStringLiteral SC_UNO_THEME= u"Theme";
 
 //  CharacterProperties
 inline constexpr OUStringLiteral SC_UNONAME_CCOLOR   = u"CharColor";
diff --git a/sc/qa/extras/scspreadsheetsettingsobj.cxx 
b/sc/qa/extras/scspreadsheetsettingsobj.cxx
index 117fc4d4a097..9173a80ba178 100644
--- a/sc/qa/extras/scspreadsheetsettingsobj.cxx
+++ b/sc/qa/extras/scspreadsheetsettingsobj.cxx
@@ -48,21 +48,10 @@ public:
 
 ScSpreadsheetSettingsObj::ScSpreadsheetSettingsObj()
 : UnoApiTest("/sc/qa/extras/testdocuments")
-, XPropertySet({
-  "AreaLinks",
-  "CharLocale",
-  "CharLocaleAsian",
-  "CharLocaleComplex",
-  "ColumnLabelRanges",
-  "DDELinks",
-  "DatabaseRanges",
-  "ExternalDocLinks",
-  "InteropGrabBag",
-  "NamedRanges",
-  "NullDate",
-  "RowLabelRanges",
-  "SheetLinks",
-  })
+, XPropertySet({ "AreaLinks", "CharLocale", "CharLocaleAsian", 
"CharLocaleComplex",
+ "ColumnLabelRanges", "DDELinks", "DatabaseRanges", 
"ExternalDocLinks",
+ "InteropGrabBag", "NamedRanges", "NullDate", 
"RowLabelRanges", "SheetLinks",
+ "Theme" })
 {
 }
 
diff --git a/sc/qa/unit/ThemeImportExportTest.cxx 
b/sc/qa/unit/ThemeImportExportTest.cxx
index 7e054ce5fe92..7d0eb47ee2c9 100644
--- a/sc/qa/unit/ThemeImportExportTest.cxx
+++ b/sc/qa/unit/ThemeImportExportTest.cxx
@@ -15,6 +15,11 @@
 #include 
 #include 
 
+#include 
+#include 
+#include 
+#include 
+
 using namespace css;
 
 namespace
@@ -28,7 +33,85 @@ public:
 }
 };
 
-CPPUNIT_TEST_FIXTURE(ThemeImportExportTest, testThemeExport)
+CPPUNIT_TEST_FIXTURE(ThemeImportExportTest, testThemeExportAndImport)
+{
+mxComponent = loadFromDesktop("private:factory/scalc");
+{
+uno::Reference xPropertySet(mxComponent, 
uno::UNO_QUERY_THROW);
+
+auto pTheme = std::make_shared("MyTheme");
+auto pColorSet = std::make_shared("MyColorSet");
+pColorSet->add(model::ThemeColorType::Dark1, 0x11);
+pColorSet->add(model::ThemeColorType::Light1, 0x22);
+pColorSet->add(model::ThemeColorType::Dark2, 0x33);
+pColorSet->add(model::ThemeColorType::Light2, 0x44);
+pColorSet->add(model::ThemeColorType::Accent1, 0x55);
+pColorSet->add(model::ThemeColorType::Accent2, 0x66);
+pColorSet->add(model::ThemeColorType::Accent3, 0x77);
+pColorSet->add(model::ThemeColorType::Accent4, 0x88);
+pColorSet->add(model::ThemeColorType::Accent5, 0x99);
+pColorSet->add(model::ThemeColorType::Accent6, 0xaa);
+pColorSet->add(model::ThemeColorType::Hyperlink, 0xbb);
+pColorSet->add(model::ThemeColorType::FollowedHyperlink, 0xcc);
+pTheme->setC

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

2023-09-04 Thread Tomaž Vajngerl (via logerrit)
 include/xmloff/xmlexp.hxx|4 ++
 sw/source/filter/xml/xmlexp.hxx  |3 -
 sw/source/filter/xml/xmlfmte.cxx |   61 ++-
 xmloff/source/core/xmlexp.cxx|   48 +++
 xmloff/source/draw/sdxmlexp.cxx  |   44 +
 xmloff/source/draw/sdxmlexp_impl.hxx |2 -
 6 files changed, 68 insertions(+), 94 deletions(-)

New commits:
commit 0d99720641f733372516fa579094dca13601efdd
Author: Tomaž Vajngerl 
AuthorDate: Thu Aug 31 13:47:27 2023 +0200
Commit: Miklos Vajna 
CommitDate: Mon Sep 4 09:12:54 2023 +0200

move theme element export to xmloff to remove code duplication

Both Impress/Draw and Writer export the model::Theme in a similar
way, but the code is duplicated. Remove duplication and move the
code to a common place (on the SwXMLExport class) so it can be
reused at both places.

Change-Id: Id93acfafb0dd4ab0168b3228079f6ce6f64e6b55
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156362
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit b53a03d1d55de7fd04efc47c4a57baa11d72dd85)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156455
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/include/xmloff/xmlexp.hxx b/include/xmloff/xmlexp.hxx
index 37a9096a0b32..2fb4bb6c3062 100644
--- a/include/xmloff/xmlexp.hxx
+++ b/include/xmloff/xmlexp.hxx
@@ -88,6 +88,8 @@ namespace com::sun::star {
 }
 namespace comphelper { class UnoInterfaceToUniqueIdentifierMapper; }
 
+namespace model { class Theme; }
+
 enum class SvXMLExportFlags {
 NONE = 0,
 META = 0x0001,
@@ -262,6 +264,8 @@ protected:
 
 void SetDocHandler( const css::uno::Reference< 
css::xml::sax::XDocumentHandler > &rHandler );
 
+void ExportThemeElement(std::shared_ptr const& pTheme);
+
 bool mbAutoStylesCollected;
 public:
 
diff --git a/sw/source/filter/xml/xmlexp.hxx b/sw/source/filter/xml/xmlexp.hxx
index 3ba34a5cced4..b87051d0c8a5 100644
--- a/sw/source/filter/xml/xmlexp.hxx
+++ b/sw/source/filter/xml/xmlexp.hxx
@@ -90,8 +90,7 @@ class SwXMLExport : public SvXMLExport
SwXMLTableInfo_Impl& rTableInfo,
sal_uInt32 nHeaderRows = 0 );
 
-void ExportThemeElement(const 
css::uno::Reference& xDrawPage);
-
+void exportTheme();
 
 virtual void ExportMeta_() override;
 virtual void ExportFontDecls_() override;
diff --git a/sw/source/filter/xml/xmlfmte.cxx b/sw/source/filter/xml/xmlfmte.cxx
index 6da12046665b..74782536b1dd 100644
--- a/sw/source/filter/xml/xmlfmte.cxx
+++ b/sw/source/filter/xml/xmlfmte.cxx
@@ -41,9 +41,7 @@
 #include 
 #include 
 #include 
-#include 
 
-#include 
 #include 
 #include 
 #include 
@@ -184,22 +182,21 @@ void SwXMLExport::ExportStyles_( bool bUsed )
 GetPageExport()->exportDefaultStyle();
 
 // Theme
-uno::Reference xDrawPageSupplier(GetModel(), 
UNO_QUERY);
-if (xDrawPageSupplier.is())
-{
-uno::Reference xPage = 
xDrawPageSupplier->getDrawPage();
-if (xPage.is())
-ExportThemeElement(xPage);
-}
+exportTheme();
 }
 
-void SwXMLExport::ExportThemeElement(const uno::Reference& 
xDrawPage)
+void SwXMLExport::exportTheme()
 {
 if ((getSaneDefaultVersion() & SvtSaveOptions::ODFSVER_EXTENDED) == 0)
-{
-// Do not export in standard ODF 1.3 or older.
 return;
-}
+
+uno::Reference xDrawPageSupplier(GetModel(), 
UNO_QUERY);
+if (!xDrawPageSupplier.is())
+return;
+
+uno::Reference xDrawPage = 
xDrawPageSupplier->getDrawPage();
+if (!xDrawPage.is())
+return;
 
 SdrPage* pPage = GetSdrPageFromXDrawPage(xDrawPage);
 SAL_WARN_IF(!pPage, "oox", "Can't get SdrPage from XDrawPage");
@@ -211,43 +208,7 @@ void SwXMLExport::ExportThemeElement(const 
uno::Reference& x
 if (!pTheme)
 return;
 
-if (!pTheme->GetName().isEmpty())
-AddAttribute(XML_NAMESPACE_LO_EXT, XML_NAME, pTheme->GetName());
-SvXMLElementExport aTheme(*this, XML_NAMESPACE_LO_EXT, XML_THEME, true, 
true);
-
-auto pColorSet = pTheme->getColorSet();
-if (!pColorSet->getName().isEmpty())
-AddAttribute(XML_NAMESPACE_LO_EXT, XML_NAME, pColorSet->getName());
-SvXMLElementExport aColorTable(*this, XML_NAMESPACE_LO_EXT, 
XML_THEME_COLORS, true, true);
-
-static const XMLTokenEnum aColorTokens[] =
-{
-XML_DARK1, // Text 1
-XML_LIGHT1, // Background 1
-XML_DARK2, // Text 2
-XML_LIGHT2, // Background 2
-XML_ACCENT1,
-XML_ACCENT2,
-XML_ACCENT3,
-XML_ACCENT4,
-XML_ACCENT5,
-XML_ACCENT6,
-XML_HYPERLINK, // Hyperlink
-XML_FOLLOWED_HYPERLINK, // Followed hyperlink
-};
-
-for (auto eThemeColorType : o3tl::enumrange())
-{
-if (eThemeColorType == model::ThemeColorTyp

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

2023-09-04 Thread Tomaž Vajngerl (via logerrit)
 sd/source/core/ThemeColorChanger.cxx |   42 ++-
 svx/source/theme/ThemeColorChangerCommon.cxx |   17 +-
 2 files changed, 32 insertions(+), 27 deletions(-)

New commits:
commit e3a9b09ffdb6fd3bf9f1d14c11d87468c3fab92c
Author: Tomaž Vajngerl 
AuthorDate: Thu Aug 31 08:11:18 2023 +0200
Commit: Miklos Vajna 
CommitDate: Mon Sep 4 09:11:35 2023 +0200

sd: set the theme for all master pages

It can be annoying for the user to set the theme one by one for
each master page. The reason for this is that in MSO the master
slide (which contains the theme) has multiple layouts, which are
converted to master pages in LO. As LO doesn't group master pages
together the theme is defined on each master page, so it is needed
to change each master page one by one.

Change-Id: I94d75246ca012005ab376446c0941b8f57ca
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156361
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 70663f464b24f223c4174681b9a469d9f554bcee)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156454
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/sd/source/core/ThemeColorChanger.cxx 
b/sd/source/core/ThemeColorChanger.cxx
index 573a5f085dd4..3a5c7804ae57 100644
--- a/sd/source/core/ThemeColorChanger.cxx
+++ b/sd/source/core/ThemeColorChanger.cxx
@@ -154,31 +154,35 @@ void 
ThemeColorChanger::apply(std::shared_ptr const& pColorSet)
 {
 SdrPage* pCurrentPage = rModel.GetPage(nPage);
 
-// Skip pages that are usign a different master page
-if (!pCurrentPage->TRG_HasMasterPage()
-|| &pCurrentPage->TRG_GetMasterPage() != mpMasterPage)
-continue;
-
-for (size_t nObject = 0; nObject < pCurrentPage->GetObjCount(); 
++nObject)
+// TODO - for now change all the objects regardless to which master 
page it belongs to.
+// Currently we don't have a concept of master slide with a group of 
layouts as in MSO, but we always only
+// have master pages, which aren't grouped together. In MSO the theme 
is defined per master slide, so when
+// changing a theme, all the layouts get the new theme, as layouts are 
synonomus to master pages in LibreOffise,
+// this is not possible to do and we would need to change the theme 
for each master page separately, which
+// is just annoying for the user.
+
+// if (!pCurrentPage->TRG_HasMasterPage() || 
&pCurrentPage->TRG_GetMasterPage() != mpMasterPage)
+// continue;
+
+SdrObjListIter aIter(pCurrentPage, SdrIterMode::DeepWithGroups);
+while (aIter.IsMore())
 {
-SdrObject* pObject = pCurrentPage->GetObj(nObject);
-svx::theme::updateSdrObject(*pColorSet, pObject, pView, 
pUndoManager);
-
-// update child objects
-SdrObjList* pList = pObject->GetSubList();
-if (pList)
-{
-SdrObjListIter aIter(pList, SdrIterMode::DeepWithGroups);
-while (aIter.IsMore())
-{
-svx::theme::updateSdrObject(*pColorSet, aIter.Next(), 
pView, pUndoManager);
-}
-}
+svx::theme::updateSdrObject(*pColorSet, aIter.Next(), pView, 
pUndoManager);
 }
 }
 
 changeThemeColors(mpDocShell, mpMasterPage, pColorSet);
 
+// See the TODO comment a couple of line above for the explanation - need 
to change the ThemeColors for all master
+// pages for now, but the following code will need to be changed in the 
future when we have the concept similar to
+// master slide and layouts
+for (sal_uInt16 nPage = 0; nPage < rModel.GetPageCount(); ++nPage)
+{
+SdrPage* pCurrentPage = rModel.GetPage(nPage);
+if (pCurrentPage->IsMasterPage() && pCurrentPage != mpMasterPage)
+changeThemeColors(mpDocShell, pCurrentPage, pColorSet);
+}
+
 pUndoManager->LeaveListAction();
 }
 
diff --git a/svx/source/theme/ThemeColorChangerCommon.cxx 
b/svx/source/theme/ThemeColorChangerCommon.cxx
index fab4835684a1..5ff1a0de8cd6 100644
--- a/svx/source/theme/ThemeColorChangerCommon.cxx
+++ b/svx/source/theme/ThemeColorChangerCommon.cxx
@@ -105,13 +105,8 @@ bool updateEditEngTextSections(model::ColorSet const& 
rColorSet, SdrObject* pObj
 bool updateObjectAttributes(model::ColorSet const& rColorSet, SdrObject& 
rObject,
 SfxUndoManager* pUndoManager)
 {
-if (pUndoManager)
-{
-pUndoManager->AddUndoAction(
-
rObject.getSdrModelFromSdrObject().GetSdrUndoFactory().CreateUndoAttrObject(
-rObject, true, true));
-}
 bool bChanged = false;
+
 auto aItemSet = rObject.GetMergedItemSet();
 
 if (const XFillColorItem* pItem = aItemSet.GetItemIfSet(XATTR_FILLCOLOR, 
false))
@@ -152,6 +147,13 @@ bool updateObjectAttribute

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

2023-09-04 Thread Tomaž Vajngerl (via logerrit)
 vcl/source/filter/GraphicFormatDetector.cxx |  134 +---
 1 file changed, 64 insertions(+), 70 deletions(-)

New commits:
commit 232216c003781404c377f96cd9d45aa9e83da2e7
Author: Tomaž Vajngerl 
AuthorDate: Fri Sep 1 21:20:05 2023 +0200
Commit: Miklos Vajna 
CommitDate: Mon Sep 4 09:10:58 2023 +0200

tdf#147704 fix reading TIFF metadata (width and height)

When we prepare (not read and load) the bitmap we need to read
only the metadata - most importantly pixel width and height. This
didn't work correctly for the TIFF files or more importantly the
specific TIFF files in the document, and the result was that the
size reported was 0,0 and somehow the crop factor wasn't applied
correctly. This change fixes the metadata reading and makes it
more robust.

Change-Id: I60951e5d01afc311c400589496ae82377ccb4cf5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156457
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 9c636d76a9a7e167da39913ab60f5135f8e831a6)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156438
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/vcl/source/filter/GraphicFormatDetector.cxx 
b/vcl/source/filter/GraphicFormatDetector.cxx
index fc43cdd963ab..1a216bb1db92 100644
--- a/vcl/source/filter/GraphicFormatDetector.cxx
+++ b/vcl/source/filter/GraphicFormatDetector.cxx
@@ -33,7 +33,6 @@
 
 constexpr sal_uInt32 SVG_CHECK_SIZE = 2048;
 constexpr sal_uInt32 WMF_EMF_CHECK_SIZE = 44;
-constexpr sal_uInt32 DATA_SIZE = 640;
 
 namespace
 {
@@ -716,6 +715,7 @@ bool GraphicFormatDetector::checkTIF()
 if (bDetectOk)
 {
 sal_uInt16 nTemp16 = 0;
+sal_uInt32 nTemp32 = 0;
 
 mrStream.ReadUInt16(nTemp16);
 if (nTemp16 == 0x2a)
@@ -725,90 +725,84 @@ bool GraphicFormatDetector::checkTIF()
 
 if (mbExtendedInfo)
 {
-sal_uLong nCount;
-sal_uLong nMax = DATA_SIZE - 48;
-sal_uInt32 nTemp32 = 0;
+sal_uInt32 nIfdOffset = 0;
 
 // Offset of the first IFD
-mrStream.ReadUInt32(nTemp32);
-nCount = nTemp32 + 2;
-mrStream.SeekRel(nCount - 0x08);
+mrStream.ReadUInt32(nIfdOffset);
+mrStream.SeekRel(nIfdOffset - 8); // read 6 bytes until 
here
+
+sal_uInt16 nNumberOfTags = 0;
+mrStream.ReadUInt16(nNumberOfTags);
+
+bool bOk = true;
+sal_Int32 nCount = 0;
 
-if (nCount < nMax)
+// read tags till we find Tag256(Width)
+mrStream.ReadUInt16(nTemp16);
+while (nTemp16 != 256 && bOk)
 {
-bool bOk = false;
+mrStream.SeekRel(10);
+mrStream.ReadUInt16(nTemp16);
+nCount++;
+if (nCount > nNumberOfTags)
+bOk = false;
+}
 
-// read tags till we find Tag256 ( Width )
-// do not read more bytes than DATA_SIZE
+if (bOk)
+{
+// width
 mrStream.ReadUInt16(nTemp16);
-while (nTemp16 != 256)
+mrStream.SeekRel(4);
+if (nTemp16 == 3)
 {
-bOk = nCount < nMax;
-if (!bOk)
-{
-break;
-}
-mrStream.SeekRel(10);
 mrStream.ReadUInt16(nTemp16);
-nCount += 12;
+maMetadata.maPixSize.setWidth(nTemp16);
+mrStream.SeekRel(2);
+}
+else
+{
+mrStream.ReadUInt32(nTemp32);
+maMetadata.maPixSize.setWidth(nTemp32);
 }
 
-if (bOk)
+// height
+mrStream.SeekRel(2);
+mrStream.ReadUInt16(nTemp16);
+mrStream.SeekRel(4);
+if (nTemp16 == 3)
 {
-// width
 mrStream.ReadUInt16(nTemp16);
-mrStream.SeekRel(4);
-if (nTemp16 == 3)
-{
-mrStream.ReadUInt16(nTemp16);
-maMetadata.m